[hkl] 01/22: Imported Upstream version 4.99.99.1892

Frédéric-Emmanuel Picca picca at moszumanska.debian.org
Fri Jan 30 15:22:01 UTC 2015


This is an automated email from the git hooks/post-receive script.

picca pushed a commit to branch experimental
in repository hkl.

commit 88bc86e0bdb4fb48b05d53326769df82909ddf9b
Author: Picca Frédéric-Emmanuel <picca at debian.org>
Date:   Fri Jan 30 09:26:50 2015 +0100

    Imported Upstream version 4.99.99.1892
---
 ChangeLog                                          |  4295 ++++++++
 Documentation/Makefile.am                          |    23 +-
 Documentation/Makefile.in                          |    92 +-
 Documentation/api/Makefile.in                      |   139 +-
 Documentation/api/hkl-docs.sgml                    |    12 +-
 Documentation/api/html/annotation-glossary.html    |    46 +-
 Documentation/api/html/api-index-full.html         |   874 +-
 Documentation/api/html/ch01.html                   |    52 +-
 Documentation/api/html/deprecated-api-index.html   |    18 +-
 Documentation/api/html/hkl-array-size.html         |    55 +-
 Documentation/api/html/hkl-autodata.html           |   173 +-
 Documentation/api/html/hkl-build-assert.html       |    64 +-
 Documentation/api/html/hkl-check-type.html         |    66 +-
 Documentation/api/html/hkl-compiler.html           |   154 +-
 Documentation/api/html/hkl-container-of.html       |    92 +-
 Documentation/api/html/hkl-darray.html             |   580 +-
 Documentation/api/html/hkl-hkl-axis-private.html   |    86 +-
 .../api/html/hkl-hkl-detector-private.html         |   188 +-
 Documentation/api/html/hkl-hkl-error-private.html  |   408 -
 .../api/html/hkl-hkl-factory-private.html          |   121 +
 .../api/html/hkl-hkl-geometry-private.html         |   894 +-
 .../api/html/hkl-hkl-interval-private.html         |   459 +-
 .../api/html/hkl-hkl-lattice-private.html          |   204 +-
 Documentation/api/html/hkl-hkl-macros-private.html |   177 +-
 Documentation/api/html/hkl-hkl-matrix-private.html |   591 +-
 .../api/html/hkl-hkl-parameter-private.html        |   595 +-
 .../api/html/hkl-hkl-pseudoaxis-auto-private.html  |   301 +-
 ...kl-hkl-pseudoaxis-common-eulerians-private.html |   103 +-
 .../hkl-hkl-pseudoaxis-common-hkl-private.html     |   241 +-
 .../hkl-hkl-pseudoaxis-common-psi-private.html     |   116 +-
 .../html/hkl-hkl-pseudoaxis-common-q-private.html  |   145 +-
 .../api/html/hkl-hkl-pseudoaxis-e4c-private.html   |    64 -
 .../api/html/hkl-hkl-pseudoaxis-e6c-private.html   |    64 -
 .../api/html/hkl-hkl-pseudoaxis-k4cv-private.html  |    64 -
 .../api/html/hkl-hkl-pseudoaxis-k6c-private.html   |    64 -
 .../html/hkl-hkl-pseudoaxis-petra3-private.html    |    58 -
 .../api/html/hkl-hkl-pseudoaxis-private.html       |   508 +-
 ...hkl-hkl-pseudoaxis-soleil-sixs-med-private.html |    86 -
 .../api/html/hkl-hkl-pseudoaxis-zaxis-private.html |    58 -
 .../api/html/hkl-hkl-quaternion-private.html       |   654 +-
 Documentation/api/html/hkl-hkl-sample-private.html |   223 +-
 Documentation/api/html/hkl-hkl-source-private.html |   396 +-
 Documentation/api/html/hkl-hkl-type-builtins.html  |    85 +-
 Documentation/api/html/hkl-hkl-types.html          |   149 +-
 Documentation/api/html/hkl-hkl-unit-private.html   |   260 +-
 Documentation/api/html/hkl-hkl-vector-private.html |  1506 +--
 Documentation/api/html/hkl-hkl.html                |   552 +
 Documentation/api/html/hkl-list.html               |   481 +-
 Documentation/api/html/hkl-noerr.html              |    92 +-
 Documentation/api/html/hkl-ptr-valid.html          |   239 +-
 Documentation/api/html/hkl-str-debug.html          |   285 +
 Documentation/api/html/hkl-str.html                |   369 +
 Documentation/api/html/hkl.devhelp2                |   662 +-
 Documentation/api/html/home.png                    |   Bin 654 -> 256 bytes
 Documentation/api/html/index.html                  |    38 +-
 Documentation/api/html/index.sgml                  |   786 +-
 Documentation/api/html/left-insensitive.png        |   Bin 0 -> 395 bytes
 Documentation/api/html/left.png                    |   Bin 459 -> 262 bytes
 Documentation/api/html/object-tree.html            |    21 +-
 Documentation/api/html/right-insensitive.png       |   Bin 0 -> 373 bytes
 Documentation/api/html/right.png                   |   Bin 472 -> 261 bytes
 Documentation/api/html/style.css                   |   418 +-
 Documentation/api/html/up-insensitive.png          |   Bin 0 -> 374 bytes
 Documentation/api/html/up.png                      |   Bin 406 -> 260 bytes
 Documentation/default.el                           |    25 +
 Documentation/figures/3S+1D.png                    |   Bin 112746 -> 146277 bytes
 Documentation/figures/4S+2D.png                    |   Bin 134379 -> 172796 bytes
 Documentation/figures/4S+2D_reciprocal.png         |   Bin 173399 -> 139787 bytes
 Documentation/figures/4S+2D_reciprocal2.png        |   Bin 179272 -> 131392 bytes
 Documentation/figures/4S+2D_reciprocal3.png        |   Bin 177616 -> 130334 bytes
 Documentation/figures/4S+2D_reciprocal4.png        |   Bin 187566 -> 151510 bytes
 Documentation/figures/B_a.png                      |   Bin 14394 -> 18561 bytes
 Documentation/figures/B_b.png                      |   Bin 13235 -> 18247 bytes
 Documentation/figures/B_b3_y.png                   |   Bin 14336 -> 18764 bytes
 Documentation/figures/Makefile.am                  |     6 +-
 Documentation/figures/Makefile.in                  |    21 +-
 Documentation/figures/crystal.png                  |   Bin 23823 -> 44520 bytes
 Documentation/figures/e2k_1.png                    |   Bin 139218 -> 163887 bytes
 Documentation/figures/e2k_2.png                    |   Bin 120580 -> 139242 bytes
 Documentation/figures/e2k_3.png                    |   Bin 146727 -> 182705 bytes
 Documentation/figures/e2k_4.png                    |   Bin 135252 -> 167324 bytes
 Documentation/figures/k4cv.png                     |   Bin 73345 -> 101790 bytes
 Documentation/figures/k6c.png                      |   Bin 95774 -> 128504 bytes
 Documentation/figures/med2_3_slits.asy             |    79 +
 Documentation/figures/med2_3_slits.png             |   Bin 0 -> 61516 bytes
 Documentation/figures/qper_qpar.png                |   Bin 30438 -> 43942 bytes
 Documentation/figures/zaxis.png                    |   Bin 120967 -> 149410 bytes
 Documentation/hkl.html                             |  4521 +++++++++
 Documentation/hkl.org.in                           |  1003 ++
 Documentation/sphinx/Makefile.am                   |    23 +-
 Documentation/sphinx/Makefile.in                   |   452 +-
 Documentation/sphinx/source/bindings/bindings.rst  |   124 +
 Documentation/sphinx/source/bindings/python.py     |    78 +
 Documentation/sphinx/source/development.rst        |   482 +-
 .../sphinx/source/diffractometers/med1_2.rst       |    45 +
 .../sphinx/source/diffractometers/med2_3.rst       |    64 +
 .../sphinx/source/diffractometers/petra3.rst       |    76 +
 .../source/diffractometers/soleil_sirius_kappa.rst |   179 +
 .../diffractometers/soleil_sirius_turret.rst       |    61 +
 Documentation/sphinx/source/index.rst              |     2 +
 .../sphinx/source/pyplots/trajectory_full.py       |    66 +
 .../sphinx/source/pyplots/trajectory_simple.py     |    79 +
 INSTALL                                            |     4 +-
 Makefile.am                                        |    10 +-
 Makefile.in                                        |    53 +-
 NEWS                                               |    72 +-
 TODO                                               |    45 -
 aclocal.m4                                         |   171 +-
 config.h.in                                        |    40 +-
 config/compile                                     |   347 +
 config/config.guess                                |   192 +-
 config/config.sub                                  |    30 +-
 config/ltmain.sh                                   |     4 +-
 config/mdate-sh                                    |   224 +
 config/missing                                     |     4 +-
 config/test-driver                                 |    20 +-
 config/texinfo.tex                                 | 10079 +++++++++++++++++++
 configure                                          |  4928 +++++----
 configure.ac                                       |   162 +-
 data/Makefile.in                                   |    15 +-
 gtk-doc.make                                       |   101 +-
 gui/3d.ui                                          |   260 +
 gui/Makefile.am                                    |    65 +-
 gui/Makefile.in                                    |   345 +-
 gui/ghkl.ui                                        |  3028 +++---
 gui/{hkl3d/hkl3d-gui-gl.c => hkl-gui-3d-gl.c}      |    10 +-
 gui/{hkl3d/hkl3d-gui-gl.h => hkl-gui-3d-gl.h}      |     0
 gui/hkl-gui-3d.c                                   |  1147 +++
 gui/hkl-gui-3d.cpp                                 |   244 -
 gui/hkl-gui-3d.h                                   |    75 +-
 gui/hkl-gui-callbacks.cpp                          |   933 --
 hkl/hkl-lattice-private.h => gui/hkl-gui-macros.h  |    45 +-
 gui/hkl-gui-modelcolumns.h                         |   167 -
 gui/hkl-gui-pseudoaxes.c                           |   454 +
 gui/hkl-gui-pseudoaxes.cpp                         |   236 -
 gui/hkl-gui-pseudoaxes.h                           |   158 +-
 gui/hkl-gui.c                                      |  2376 +++++
 gui/hkl-gui.cpp                                    |  1020 --
 gui/hkl-gui.h                                      |   276 +-
 gui/hkl3d/GL_ShapeDrawer.cpp                       |   805 --
 gui/hkl3d/GL_ShapeDrawer.h                         |   111 -
 gui/hkl3d/Makefile.am                              |    47 -
 gui/hkl3d/Makefile.in                              |   714 --
 gui/hkl3d/hkl3d-gui-model.cpp                      |   407 -
 gui/hkl3d/hkl3d-gui-model.h                        |   121 -
 gui/hkl3d/hkl3d-gui-scene.cpp                      |   432 -
 gui/hkl3d/hkl3d-gui-scene.h                        |   120 -
 gui/hkl3d/hkl3d-gui-view.cpp                       |   222 -
 gui/hkl3d/hkl3d-gui-view.h                         |   109 -
 gui/hkl3d/texture.c                                |    42 -
 gui/hkl3d/texture.h                                |    30 -
 gui/hkl3d/trackball.c                              |   323 -
 gui/hkl3d/trackball.h                              |    77 -
 gui/main.cpp                                       |    36 -
 gui/pseudo.ui                                      |    83 +-
 hkl.h                                              |   341 +-
 hkl/Makefile.am                                    |    60 +-
 hkl/Makefile.in                                    |   531 +-
 hkl/ccan/Makefile.am                               |    22 +-
 hkl/ccan/Makefile.in                               |   165 +-
 hkl/ccan/autodata/autodata.h                       |     3 +-
 hkl/ccan/compiler/compiler.h                       |    30 +-
 hkl/ccan/container_of/container_of.h               |     2 +-
 hkl/ccan/list/list.h                               |   139 +-
 hkl/ccan/str/debug.c                               |   108 +
 hkl/ccan/str/str.c                                 |    13 +
 hkl/ccan/str/str.h                                 |   228 +
 hkl/ccan/str/str_debug.h                           |    30 +
 hkl/hkl-axis-private.h                             |    14 +-
 hkl/hkl-axis.c                                     |    87 +-
 hkl/hkl-binding-private.h                          |    64 +-
 hkl/hkl-binding.c                                  |   330 +-
 hkl/hkl-detector-factory.c                         |     8 +-
 hkl/hkl-detector-private.h                         |    13 +-
 hkl/hkl-detector.c                                 |    32 +-
 hkl/hkl-engine-2c.c                                |    63 +
 hkl/hkl-engine-e4c.c                               |   323 +
 hkl/hkl-engine-e6c.c                               |   376 +
 ...{hkl-pseudoaxis-k4cv-hkl.c => hkl-engine-k4c.c} |   299 +-
 hkl/hkl-engine-k6c.c                               |  1017 ++
 hkl/hkl-engine-petra3-p09-eh2.c                    |   243 +
 hkl/hkl-engine-soleil-sirius-turret.c              |   105 +
 hkl/hkl-engine-soleil-sixs-med.c                   |   451 +
 hkl/hkl-engine-template.c                          |   224 +
 hkl/hkl-engine-zaxis.c                             |   145 +
 hkl/hkl-error-private.h                            |    72 -
 hkl/hkl-error.c                                    |   332 -
 hkl/hkl-factory-private.h                          |    28 +-
 hkl/hkl-factory.c                                  |   694 +-
 hkl/hkl-geometry-private.h                         |    47 +-
 hkl/hkl-geometry.c                                 |   458 +-
 hkl/hkl-interval-private.h                         |     8 +-
 hkl/hkl-interval.c                                 |    17 +-
 hkl/hkl-lattice-private.h                          |    17 +-
 hkl/hkl-lattice.c                                  |   364 +-
 hkl/hkl-macros-private.h                           |    17 +-
 hkl/hkl-macros.c                                   |    11 +-
 hkl/hkl-matrix-private.h                           |     7 +-
 hkl/hkl-matrix.c                                   |    31 +-
 hkl/hkl-parameter-private.h                        |   136 +-
 hkl/hkl-parameter.c                                |   323 +-
 hkl/hkl-pseudoaxis-auto-private.h                  |   135 +-
 hkl/hkl-pseudoaxis-auto.c                          |   156 +-
 hkl/hkl-pseudoaxis-common-eulerians-private.h      |    12 +-
 hkl/hkl-pseudoaxis-common-eulerians.c              |   115 +-
 hkl/hkl-pseudoaxis-common-hkl-private.h            |   120 +-
 hkl/hkl-pseudoaxis-common-hkl.c                    |   304 +-
 hkl/hkl-pseudoaxis-common-psi-private.h            |    34 +-
 hkl/hkl-pseudoaxis-common-psi.c                    |   172 +-
 hkl/hkl-pseudoaxis-common-q-private.h              |     8 +-
 hkl/hkl-pseudoaxis-common-q.c                      |   118 +-
 hkl/hkl-pseudoaxis-e4c-hkl.c                       |   166 -
 hkl/hkl-pseudoaxis-e4c-private.h                   |    34 -
 hkl/hkl-pseudoaxis-e4c-psi.c                       |    57 -
 hkl/hkl-pseudoaxis-e6c-hkl.c                       |   286 -
 hkl/hkl-pseudoaxis-e6c-private.h                   |    34 -
 hkl/hkl-pseudoaxis-e6c-psi.c                       |    64 -
 hkl/hkl-pseudoaxis-k4cv-private.h                  |    34 -
 hkl/hkl-pseudoaxis-k4cv-psi.c                      |    64 -
 hkl/hkl-pseudoaxis-k6c-hkl.c                       |   597 --
 hkl/hkl-pseudoaxis-k6c-private.h                   |    34 -
 hkl/hkl-pseudoaxis-k6c-psi.c                       |    56 -
 hkl/hkl-pseudoaxis-petra3-hkl.c                    |   181 -
 hkl/hkl-pseudoaxis-petra3-private.h                |    33 -
 hkl/hkl-pseudoaxis-private.h                       |   670 +-
 hkl/hkl-pseudoaxis-soleil-sixs-med-private.h       |    38 -
 hkl/hkl-pseudoaxis-soleil-sixs-med.c               |   285 -
 hkl/hkl-pseudoaxis-zaxis-hkl.c                     |   100 -
 hkl/hkl-pseudoaxis-zaxis-private.h                 |    33 -
 hkl/hkl-pseudoaxis.c                               |   846 +-
 hkl/hkl-quaternion-private.h                       |    18 +-
 hkl/hkl-quaternion.c                               |    26 +-
 hkl/hkl-sample-private.h                           |    39 +-
 hkl/hkl-sample.c                                   |   446 +-
 hkl/hkl-source-private.h                           |    10 +-
 hkl/hkl-source.c                                   |    18 +-
 hkl/hkl-type-builtins.c                            |    46 +
 hkl/hkl-type-builtins.h                            |    10 +-
 hkl/hkl-type-builtins.h.template                   |     4 +-
 hkl/hkl-types.c                                    |   276 +-
 hkl/hkl-types.h                                    |    57 +-
 hkl/hkl-unit-private.h                             |    10 +-
 hkl/hkl-unit.c                                     |    24 +-
 hkl/hkl-vector-private.h                           |    29 +-
 hkl/hkl-vector.c                                   |    44 +-
 hkl3d/Makefile.am                                  |    28 +-
 hkl3d/Makefile.in                                  |   297 +-
 hkl3d/bullet/AUTHORS                               |    22 -
 hkl3d/bullet/COPYING                               |   674 --
 hkl3d/bullet/ChangeLog                             |   755 --
 hkl3d/bullet/Makefile.am                           |     3 -
 hkl3d/bullet/Makefile.in                           |   656 --
 hkl3d/bullet/NEWS                                  |     4 -
 hkl3d/bullet/README                                |     7 -
 hkl3d/bullet/src/Bullet-C-Api.h                    |   176 -
 .../BroadphaseCollision/btAxisSweep3.cpp           |    37 -
 .../BroadphaseCollision/btAxisSweep3.h             |  1051 --
 .../BroadphaseCollision/btBroadphaseInterface.h    |    82 -
 .../BroadphaseCollision/btBroadphaseProxy.cpp      |    17 -
 .../BroadphaseCollision/btBroadphaseProxy.h        |   270 -
 .../BroadphaseCollision/btCollisionAlgorithm.cpp   |    23 -
 .../BroadphaseCollision/btCollisionAlgorithm.h     |    80 -
 .../BulletCollision/BroadphaseCollision/btDbvt.cpp |  1295 ---
 .../BulletCollision/BroadphaseCollision/btDbvt.h   |  1256 ---
 .../BroadphaseCollision/btDbvtBroadphase.cpp       |   796 --
 .../BroadphaseCollision/btDbvtBroadphase.h         |   146 -
 .../BroadphaseCollision/btDispatcher.cpp           |    22 -
 .../BroadphaseCollision/btDispatcher.h             |   110 -
 .../BroadphaseCollision/btMultiSapBroadphase.cpp   |   489 -
 .../BroadphaseCollision/btMultiSapBroadphase.h     |   151 -
 .../BroadphaseCollision/btOverlappingPairCache.cpp |   633 --
 .../BroadphaseCollision/btOverlappingPairCache.h   |   469 -
 .../btOverlappingPairCallback.h                    |    40 -
 .../BroadphaseCollision/btQuantizedBvh.cpp         |  1375 ---
 .../BroadphaseCollision/btQuantizedBvh.h           |   579 --
 .../BroadphaseCollision/btSimpleBroadphase.cpp     |   349 -
 .../BroadphaseCollision/btSimpleBroadphase.h       |   171 -
 .../CollisionDispatch/SphereTriangleDetector.cpp   |   201 -
 .../CollisionDispatch/SphereTriangleDetector.h     |    51 -
 .../btActivatingCollisionAlgorithm.cpp             |    47 -
 .../btActivatingCollisionAlgorithm.h               |    36 -
 .../btBox2dBox2dCollisionAlgorithm.cpp             |   435 -
 .../btBox2dBox2dCollisionAlgorithm.h               |    66 -
 .../btBoxBoxCollisionAlgorithm.cpp                 |    85 -
 .../CollisionDispatch/btBoxBoxCollisionAlgorithm.h |    66 -
 .../CollisionDispatch/btBoxBoxDetector.cpp         |   718 --
 .../CollisionDispatch/btBoxBoxDetector.h           |    44 -
 .../CollisionDispatch/btCollisionConfiguration.h   |    48 -
 .../CollisionDispatch/btCollisionCreateFunc.h      |    45 -
 .../CollisionDispatch/btCollisionDispatcher.cpp    |   310 -
 .../CollisionDispatch/btCollisionDispatcher.h      |   172 -
 .../CollisionDispatch/btCollisionObject.cpp        |   116 -
 .../CollisionDispatch/btCollisionObject.h          |   524 -
 .../CollisionDispatch/btCollisionWorld.cpp         |  1513 ---
 .../CollisionDispatch/btCollisionWorld.h           |   509 -
 .../btCompoundCollisionAlgorithm.cpp               |   353 -
 .../btCompoundCollisionAlgorithm.h                 |    86 -
 .../btConvex2dConvex2dAlgorithm.cpp                |   247 -
 .../btConvex2dConvex2dAlgorithm.h                  |    95 -
 .../btConvexConcaveCollisionAlgorithm.cpp          |   312 -
 .../btConvexConcaveCollisionAlgorithm.h            |   116 -
 .../CollisionDispatch/btConvexConvexAlgorithm.cpp  |   679 --
 .../CollisionDispatch/btConvexConvexAlgorithm.h    |   109 -
 .../btConvexPlaneCollisionAlgorithm.cpp            |   155 -
 .../btConvexPlaneCollisionAlgorithm.h              |    84 -
 .../btDefaultCollisionConfiguration.cpp            |   298 -
 .../btDefaultCollisionConfiguration.h              |   135 -
 .../btEmptyCollisionAlgorithm.cpp                  |    34 -
 .../CollisionDispatch/btEmptyCollisionAlgorithm.h  |    54 -
 .../CollisionDispatch/btGhostObject.cpp            |   171 -
 .../CollisionDispatch/btGhostObject.h              |   175 -
 .../CollisionDispatch/btInternalEdgeUtility.cpp    |   842 --
 .../CollisionDispatch/btInternalEdgeUtility.h      |    46 -
 .../CollisionDispatch/btManifoldResult.cpp         |   135 -
 .../CollisionDispatch/btManifoldResult.h           |   128 -
 .../btSimulationIslandManager.cpp                  |   443 -
 .../CollisionDispatch/btSimulationIslandManager.h  |    81 -
 .../btSphereBoxCollisionAlgorithm.cpp              |   260 -
 .../btSphereBoxCollisionAlgorithm.h                |    75 -
 .../btSphereSphereCollisionAlgorithm.cpp           |   105 -
 .../btSphereSphereCollisionAlgorithm.h             |    66 -
 .../btSphereTriangleCollisionAlgorithm.cpp         |    84 -
 .../btSphereTriangleCollisionAlgorithm.h           |    69 -
 .../CollisionDispatch/btUnionFind.cpp              |    82 -
 .../CollisionDispatch/btUnionFind.h                |   129 -
 .../CollisionShapes/btBox2dShape.cpp               |    42 -
 .../BulletCollision/CollisionShapes/btBox2dShape.h |   363 -
 .../BulletCollision/CollisionShapes/btBoxShape.cpp |    41 -
 .../BulletCollision/CollisionShapes/btBoxShape.h   |   318 -
 .../CollisionShapes/btBvhTriangleMeshShape.cpp     |   466 -
 .../CollisionShapes/btBvhTriangleMeshShape.h       |   139 -
 .../CollisionShapes/btCapsuleShape.cpp             |   171 -
 .../CollisionShapes/btCapsuleShape.h               |   173 -
 .../CollisionShapes/btCollisionMargin.h            |    26 -
 .../CollisionShapes/btCollisionShape.cpp           |   119 -
 .../CollisionShapes/btCollisionShape.h             |   150 -
 .../CollisionShapes/btCompoundShape.cpp            |   356 -
 .../CollisionShapes/btCompoundShape.h              |   212 -
 .../CollisionShapes/btConcaveShape.cpp             |    27 -
 .../CollisionShapes/btConcaveShape.h               |    60 -
 .../CollisionShapes/btConeShape.cpp                |   143 -
 .../BulletCollision/CollisionShapes/btConeShape.h  |   103 -
 .../CollisionShapes/btConvex2dShape.cpp            |    92 -
 .../CollisionShapes/btConvex2dShape.h              |    80 -
 .../CollisionShapes/btConvexHullShape.cpp          |   211 -
 .../CollisionShapes/btConvexHullShape.h            |   120 -
 .../CollisionShapes/btConvexInternalShape.cpp      |   151 -
 .../CollisionShapes/btConvexInternalShape.h        |   202 -
 .../CollisionShapes/btConvexPointCloudShape.cpp    |   157 -
 .../CollisionShapes/btConvexPointCloudShape.h      |   105 -
 .../CollisionShapes/btConvexPolyhedron.cpp         |   185 -
 .../CollisionShapes/btConvexPolyhedron.h           |    54 -
 .../CollisionShapes/btConvexShape.cpp              |   429 -
 .../CollisionShapes/btConvexShape.h                |    82 -
 .../CollisionShapes/btConvexTriangleMeshShape.cpp  |   315 -
 .../CollisionShapes/btConvexTriangleMeshShape.h    |    75 -
 .../CollisionShapes/btCylinderShape.cpp            |   279 -
 .../CollisionShapes/btCylinderShape.h              |   200 -
 .../CollisionShapes/btEmptyShape.cpp               |    50 -
 .../BulletCollision/CollisionShapes/btEmptyShape.h |    70 -
 .../CollisionShapes/btHeightfieldTerrainShape.cpp  |   411 -
 .../CollisionShapes/btHeightfieldTerrainShape.h    |   161 -
 .../BulletCollision/CollisionShapes/btMaterial.h   |    35 -
 .../CollisionShapes/btMinkowskiSumShape.cpp        |    60 -
 .../CollisionShapes/btMinkowskiSumShape.h          |    60 -
 .../CollisionShapes/btMultiSphereShape.cpp         |   167 -
 .../CollisionShapes/btMultiSphereShape.h           |    99 -
 .../btMultimaterialTriangleMeshShape.cpp           |    45 -
 .../btMultimaterialTriangleMeshShape.h             |   120 -
 .../CollisionShapes/btOptimizedBvh.cpp             |   391 -
 .../CollisionShapes/btOptimizedBvh.h               |    65 -
 .../CollisionShapes/btPolyhedralConvexShape.cpp    |   338 -
 .../CollisionShapes/btPolyhedralConvexShape.h      |   112 -
 .../btScaledBvhTriangleMeshShape.cpp               |   123 -
 .../CollisionShapes/btScaledBvhTriangleMeshShape.h |    93 -
 .../CollisionShapes/btShapeHull.cpp                |   170 -
 .../BulletCollision/CollisionShapes/btShapeHull.h  |    59 -
 .../CollisionShapes/btSphereShape.cpp              |    71 -
 .../CollisionShapes/btSphereShape.h                |    73 -
 .../CollisionShapes/btStaticPlaneShape.cpp         |   107 -
 .../CollisionShapes/btStaticPlaneShape.h           |   103 -
 .../CollisionShapes/btStridingMeshInterface.cpp    |   379 -
 .../CollisionShapes/btStridingMeshInterface.h      |   162 -
 .../CollisionShapes/btTetrahedronShape.cpp         |   218 -
 .../CollisionShapes/btTetrahedronShape.h           |    74 -
 .../CollisionShapes/btTriangleBuffer.cpp           |    35 -
 .../CollisionShapes/btTriangleBuffer.h             |    69 -
 .../CollisionShapes/btTriangleCallback.cpp         |    28 -
 .../CollisionShapes/btTriangleCallback.h           |    42 -
 .../CollisionShapes/btTriangleIndexVertexArray.cpp |    95 -
 .../CollisionShapes/btTriangleIndexVertexArray.h   |   131 -
 .../btTriangleIndexVertexMaterialArray.cpp         |    86 -
 .../btTriangleIndexVertexMaterialArray.h           |    84 -
 .../CollisionShapes/btTriangleInfoMap.h            |   240 -
 .../CollisionShapes/btTriangleMesh.cpp             |   140 -
 .../CollisionShapes/btTriangleMesh.h               |    69 -
 .../CollisionShapes/btTriangleMeshShape.cpp        |   211 -
 .../CollisionShapes/btTriangleMeshShape.h          |    89 -
 .../CollisionShapes/btTriangleShape.h              |   182 -
 .../CollisionShapes/btUniformScalingShape.cpp      |   160 -
 .../CollisionShapes/btUniformScalingShape.h        |    87 -
 .../src/BulletCollision/Gimpact/btBoxCollision.h   |   647 --
 .../src/BulletCollision/Gimpact/btClipPolygon.h    |   182 -
 .../BulletCollision/Gimpact/btContactProcessing.h  |   145 -
 .../src/BulletCollision/Gimpact/btGImpactBvh.cpp   |   498 -
 .../src/BulletCollision/Gimpact/btGImpactBvh.h     |   396 -
 .../Gimpact/btGImpactCollisionAlgorithm.cpp        |   904 --
 .../Gimpact/btGImpactCollisionAlgorithm.h          |   306 -
 .../BulletCollision/Gimpact/btGImpactMassUtil.h    |    60 -
 .../Gimpact/btGImpactQuantizedBvh.cpp              |   528 -
 .../Gimpact/btGImpactQuantizedBvh.h                |   372 -
 .../src/BulletCollision/Gimpact/btGImpactShape.cpp |   203 -
 .../src/BulletCollision/Gimpact/btGImpactShape.h   |  1171 ---
 .../Gimpact/btGenericPoolAllocator.h               |   163 -
 .../BulletCollision/Gimpact/btGeometryOperations.h |   212 -
 .../src/BulletCollision/Gimpact/btQuantization.h   |    88 -
 .../BulletCollision/Gimpact/btTriangleShapeEx.cpp  |   218 -
 .../BulletCollision/Gimpact/btTriangleShapeEx.h    |   180 -
 .../bullet/src/BulletCollision/Gimpact/gim_array.h |   326 -
 .../Gimpact/gim_basic_geometry_operations.h        |   543 -
 .../src/BulletCollision/Gimpact/gim_bitset.h       |   123 -
 .../BulletCollision/Gimpact/gim_box_collision.h    |   590 --
 .../src/BulletCollision/Gimpact/gim_box_set.cpp    |   182 -
 .../src/BulletCollision/Gimpact/gim_box_set.h      |   674 --
 .../src/BulletCollision/Gimpact/gim_clip_polygon.h |   210 -
 .../src/BulletCollision/Gimpact/gim_contact.cpp    |   146 -
 .../src/BulletCollision/Gimpact/gim_contact.h      |   164 -
 .../src/BulletCollision/Gimpact/gim_geom_types.h   |    97 -
 .../src/BulletCollision/Gimpact/gim_geometry.h     |    42 -
 .../src/BulletCollision/Gimpact/gim_hash_table.h   |   902 --
 .../src/BulletCollision/Gimpact/gim_linear_math.h  |  1573 ---
 .../bullet/src/BulletCollision/Gimpact/gim_math.h  |   157 -
 .../src/BulletCollision/Gimpact/gim_memory.cpp     |   135 -
 .../src/BulletCollision/Gimpact/gim_memory.h       |   190 -
 .../src/BulletCollision/Gimpact/gim_radixsort.h    |   406 -
 .../BulletCollision/Gimpact/gim_tri_collision.cpp  |   640 --
 .../BulletCollision/Gimpact/gim_tri_collision.h    |   379 -
 .../btContinuousConvexCollision.cpp                |   243 -
 .../btContinuousConvexCollision.h                  |    59 -
 .../NarrowPhaseCollision/btConvexCast.cpp          |    20 -
 .../NarrowPhaseCollision/btConvexCast.h            |    73 -
 .../btConvexPenetrationDepthSolver.h               |    42 -
 .../btDiscreteCollisionDetectorInterface.h         |    91 -
 .../NarrowPhaseCollision/btGjkConvexCast.cpp       |   176 -
 .../NarrowPhaseCollision/btGjkConvexCast.h         |    50 -
 .../NarrowPhaseCollision/btGjkEpa2.cpp             |   989 --
 .../NarrowPhaseCollision/btGjkEpa2.h               |    75 -
 .../btGjkEpaPenetrationDepthSolver.cpp             |    66 -
 .../btGjkEpaPenetrationDepthSolver.h               |    43 -
 .../NarrowPhaseCollision/btGjkPairDetector.cpp     |   457 -
 .../NarrowPhaseCollision/btGjkPairDetector.h       |   103 -
 .../NarrowPhaseCollision/btManifoldPoint.h         |   158 -
 .../btMinkowskiPenetrationDepthSolver.cpp          |   362 -
 .../btMinkowskiPenetrationDepthSolver.h            |    40 -
 .../NarrowPhaseCollision/btPersistentManifold.cpp  |   260 -
 .../NarrowPhaseCollision/btPersistentManifold.h    |   232 -
 .../NarrowPhaseCollision/btPointCollector.h        |    64 -
 .../btPolyhedralContactClipping.cpp                |   360 -
 .../btPolyhedralContactClipping.h                  |    46 -
 .../NarrowPhaseCollision/btRaycastCallback.cpp     |   177 -
 .../NarrowPhaseCollision/btRaycastCallback.h       |    72 -
 .../btSimplexSolverInterface.h                     |    63 -
 .../btSubSimplexConvexCast.cpp                     |   160 -
 .../NarrowPhaseCollision/btSubSimplexConvexCast.h  |    50 -
 .../btVoronoiSimplexSolver.cpp                     |   609 --
 .../NarrowPhaseCollision/btVoronoiSimplexSolver.h  |   179 -
 .../Character/btCharacterControllerInterface.h     |    46 -
 .../Character/btKinematicCharacterController.cpp   |   641 --
 .../Character/btKinematicCharacterController.h     |   162 -
 .../ConstraintSolver/btConeTwistConstraint.cpp     |  1127 ---
 .../ConstraintSolver/btConeTwistConstraint.h       |   346 -
 .../ConstraintSolver/btConstraintSolver.h          |    52 -
 .../ConstraintSolver/btContactConstraint.cpp       |   178 -
 .../ConstraintSolver/btContactConstraint.h         |    71 -
 .../ConstraintSolver/btContactSolverInfo.h         |    87 -
 .../ConstraintSolver/btGeneric6DofConstraint.cpp   |  1070 --
 .../ConstraintSolver/btGeneric6DofConstraint.h     |   614 --
 .../btGeneric6DofSpringConstraint.cpp              |   172 -
 .../btGeneric6DofSpringConstraint.h                |    97 -
 .../ConstraintSolver/btHinge2Constraint.cpp        |    66 -
 .../ConstraintSolver/btHinge2Constraint.h          |    58 -
 .../ConstraintSolver/btHingeConstraint.cpp         |  1033 --
 .../ConstraintSolver/btHingeConstraint.h           |   381 -
 .../ConstraintSolver/btJacobianEntry.h             |   156 -
 .../ConstraintSolver/btPoint2PointConstraint.cpp   |   230 -
 .../ConstraintSolver/btPoint2PointConstraint.h     |   161 -
 .../btSequentialImpulseConstraintSolver.cpp        |  1239 ---
 .../btSequentialImpulseConstraintSolver.h          |   128 -
 .../ConstraintSolver/btSliderConstraint.cpp        |   857 --
 .../ConstraintSolver/btSliderConstraint.h          |   333 -
 .../ConstraintSolver/btSolve2LinearConstraint.cpp  |   255 -
 .../ConstraintSolver/btSolve2LinearConstraint.h    |   107 -
 .../BulletDynamics/ConstraintSolver/btSolverBody.h |   191 -
 .../ConstraintSolver/btSolverConstraint.h          |    96 -
 .../ConstraintSolver/btTypedConstraint.cpp         |   214 -
 .../ConstraintSolver/btTypedConstraint.h           |   436 -
 .../ConstraintSolver/btUniversalConstraint.cpp     |    87 -
 .../ConstraintSolver/btUniversalConstraint.h       |    62 -
 .../src/BulletDynamics/Dynamics/Bullet-C-API.cpp   |   405 -
 .../BulletDynamics/Dynamics/btActionInterface.h    |    46 -
 .../Dynamics/btContinuousDynamicsWorld.cpp         |   196 -
 .../Dynamics/btContinuousDynamicsWorld.h           |    46 -
 .../Dynamics/btDiscreteDynamicsWorld.cpp           |  1348 ---
 .../Dynamics/btDiscreteDynamicsWorld.h             |   200 -
 .../src/BulletDynamics/Dynamics/btDynamicsWorld.h  |   151 -
 .../src/BulletDynamics/Dynamics/btRigidBody.cpp    |   402 -
 .../src/BulletDynamics/Dynamics/btRigidBody.h      |   691 --
 .../Dynamics/btSimpleDynamicsWorld.cpp             |   280 -
 .../Dynamics/btSimpleDynamicsWorld.h               |    89 -
 .../BulletDynamics/Vehicle/btRaycastVehicle.cpp    |   771 --
 .../src/BulletDynamics/Vehicle/btRaycastVehicle.h  |   236 -
 .../BulletDynamics/Vehicle/btVehicleRaycaster.h    |    35 -
 .../src/BulletDynamics/Vehicle/btWheelInfo.cpp     |    56 -
 .../src/BulletDynamics/Vehicle/btWheelInfo.h       |   119 -
 .../GpuSoftBodySolvers/CPU/btSoftBodySolverData.h  |   744 --
 .../CPU/btSoftBodySolver_CPU.cpp                   |   979 --
 .../GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h  |   370 -
 hkl3d/bullet/src/BulletMultiThreaded/HeapManager.h |   117 -
 .../src/BulletMultiThreaded/PlatformDefinitions.h  |    99 -
 .../src/BulletMultiThreaded/PosixThreadSupport.cpp |   399 -
 .../src/BulletMultiThreaded/PosixThreadSupport.h   |   142 -
 .../src/BulletMultiThreaded/PpuAddressSpace.h      |    37 -
 .../SequentialThreadSupport.cpp                    |   169 -
 .../BulletMultiThreaded/SequentialThreadSupport.h  |    96 -
 .../SpuCollisionObjectWrapper.cpp                  |    48 -
 .../SpuCollisionObjectWrapper.h                    |    40 -
 .../SpuCollisionTaskProcess.cpp                    |   317 -
 .../BulletMultiThreaded/SpuCollisionTaskProcess.h  |   163 -
 .../SpuContactManifoldCollisionAlgorithm.cpp       |    69 -
 .../SpuContactManifoldCollisionAlgorithm.h         |   120 -
 .../src/BulletMultiThreaded/SpuDoubleBuffer.h      |   126 -
 .../bullet/src/BulletMultiThreaded/SpuFakeDma.cpp  |   215 -
 hkl3d/bullet/src/BulletMultiThreaded/SpuFakeDma.h  |   135 -
 .../SpuGatheringCollisionDispatcher.cpp            |   275 -
 .../SpuGatheringCollisionDispatcher.h              |    72 -
 .../src/BulletMultiThreaded/SpuLibspe2Support.cpp  |   257 -
 .../src/BulletMultiThreaded/SpuLibspe2Support.h    |   180 -
 .../SpuNarrowPhaseCollisionTask/Box.h              |   167 -
 .../SpuCollisionShapes.cpp                         |   302 -
 .../SpuCollisionShapes.h                           |   128 -
 .../SpuContactResult.cpp                           |   248 -
 .../SpuNarrowPhaseCollisionTask/SpuContactResult.h |   106 -
 .../SpuConvexPenetrationDepthSolver.h              |    51 -
 .../SpuGatheringCollisionTask.cpp                  |  1412 ---
 .../SpuGatheringCollisionTask.h                    |   140 -
 .../SpuNarrowPhaseCollisionTask/SpuLocalSupport.h  |    19 -
 .../SpuMinkowskiPenetrationDepthSolver.cpp         |   348 -
 .../SpuMinkowskiPenetrationDepthSolver.h           |    48 -
 .../SpuPreferredPenetrationDirections.h            |    70 -
 .../SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp |  1160 ---
 .../SpuNarrowPhaseCollisionTask/boxBoxDistance.h   |    65 -
 .../SpuSampleTask/SpuSampleTask.cpp                |   214 -
 .../SpuSampleTask/SpuSampleTask.h                  |    54 -
 .../BulletMultiThreaded/SpuSampleTaskProcess.cpp   |   222 -
 .../src/BulletMultiThreaded/SpuSampleTaskProcess.h |   153 -
 hkl3d/bullet/src/BulletMultiThreaded/SpuSync.h     |   149 -
 hkl3d/bullet/src/BulletMultiThreaded/TrbDynBody.h  |    79 -
 hkl3d/bullet/src/BulletMultiThreaded/TrbStateVec.h |   339 -
 .../src/BulletMultiThreaded/Win32ThreadSupport.cpp |   446 -
 .../src/BulletMultiThreaded/Win32ThreadSupport.h   |   138 -
 .../btThreadSupportInterface.cpp                   |    22 -
 .../BulletMultiThreaded/btThreadSupportInterface.h |    85 -
 hkl3d/bullet/src/LinearMath/btAabbUtil2.h          |   236 -
 hkl3d/bullet/src/LinearMath/btAlignedAllocator.cpp |   182 -
 hkl3d/bullet/src/LinearMath/btAlignedAllocator.h   |   107 -
 hkl3d/bullet/src/LinearMath/btAlignedObjectArray.h |   471 -
 hkl3d/bullet/src/LinearMath/btConvexHull.cpp       |  1174 ---
 hkl3d/bullet/src/LinearMath/btConvexHull.h         |   241 -
 .../bullet/src/LinearMath/btConvexHullComputer.cpp |  2749 -----
 hkl3d/bullet/src/LinearMath/btConvexHullComputer.h |   103 -
 hkl3d/bullet/src/LinearMath/btDefaultMotionState.h |    40 -
 hkl3d/bullet/src/LinearMath/btGeometryUtil.cpp     |   185 -
 hkl3d/bullet/src/LinearMath/btGeometryUtil.h       |    42 -
 hkl3d/bullet/src/LinearMath/btHashMap.h            |   450 -
 hkl3d/bullet/src/LinearMath/btIDebugDraw.h         |   417 -
 hkl3d/bullet/src/LinearMath/btList.h               |    73 -
 hkl3d/bullet/src/LinearMath/btMatrix3x3.h          |   771 --
 hkl3d/bullet/src/LinearMath/btMinMax.h             |    71 -
 hkl3d/bullet/src/LinearMath/btMotionState.h        |    40 -
 hkl3d/bullet/src/LinearMath/btPoolAllocator.h      |   121 -
 hkl3d/bullet/src/LinearMath/btQuadWord.h           |   180 -
 hkl3d/bullet/src/LinearMath/btQuaternion.h         |   433 -
 hkl3d/bullet/src/LinearMath/btQuickprof.cpp        |   565 --
 hkl3d/bullet/src/LinearMath/btQuickprof.h          |   196 -
 hkl3d/bullet/src/LinearMath/btRandom.h             |    42 -
 hkl3d/bullet/src/LinearMath/btScalar.h             |   522 -
 hkl3d/bullet/src/LinearMath/btSerializer.cpp       |   832 --
 hkl3d/bullet/src/LinearMath/btSerializer.h         |   655 --
 hkl3d/bullet/src/LinearMath/btStackAlloc.h         |   116 -
 hkl3d/bullet/src/LinearMath/btTransform.h          |   307 -
 hkl3d/bullet/src/LinearMath/btTransformUtil.h      |   228 -
 hkl3d/bullet/src/LinearMath/btVector3.h            |   766 --
 hkl3d/bullet/src/Makefile.am                       |   358 -
 hkl3d/bullet/src/Makefile.in                       |  2212 ----
 hkl3d/bullet/src/btBulletCollisionCommon.h         |    69 -
 hkl3d/bullet/src/btBulletDynamicsCommon.h          |    49 -
 hkl3d/hkl3d.cpp                                    |    50 +-
 hkl3d/hkl3d.h                                      |     3 +-
 m4/gtk-doc.m4                                      |    51 +-
 m4/libtool.m4                                      |    12 +-
 tests/Makefile.am                                  |    16 +-
 tests/Makefile.in                                  |   158 +-
 tests/bindings/Makefile.am                         |     7 +-
 tests/bindings/Makefile.in                         |    20 +-
 tests/bindings/python.py                           |   202 +-
 tests/bindings/trajectory.py                       |    49 +-
 tests/hkl-axis-t.c                                 |   210 +-
 tests/hkl-bench-t.c                                |   103 +-
 tests/hkl-detector-t.c                             |    15 +-
 tests/hkl-error-t.c                                |   122 -
 tests/hkl-geometry-t.c                             |   190 +-
 tests/hkl-interval-t.c                             |    30 +-
 tests/hkl-lattice-t.c                              |   281 +-
 tests/hkl-matrix-t.c                               |    16 +-
 tests/hkl-parameter-t.c                            |   123 +-
 tests/hkl-pseudoaxis-e4ch-t.c                      |   294 +-
 tests/hkl-pseudoaxis-e4cv-t.c                      |   293 +-
 tests/hkl-pseudoaxis-e6c-t.c                       |   426 +-
 tests/hkl-pseudoaxis-k4cv-t.c                      |   176 +-
 tests/hkl-pseudoaxis-k6c-t.c                       |   220 +-
 tests/hkl-pseudoaxis-soleil-sixs-med-t.c           |   124 +-
 tests/hkl-pseudoaxis-t.c                           |   533 +-
 tests/hkl-pseudoaxis-zaxis-t.c                     |    46 +-
 tests/hkl-quaternion-t.c                           |    21 +-
 tests/hkl-sample-t.c                               |   295 +-
 tests/hkl-source-t.c                               |     8 +-
 tests/hkl-unit-t.c                                 |    15 +-
 tests/hkl-vector-t.c                               |     6 +-
 tests/hkl3d-test-t.c                               |    54 +-
 tests/tap/Makefile.am                              |     4 +-
 tests/tap/Makefile.in                              |    38 +-
 tests/tap/hkl-tap.c                                |   106 +-
 tests/tap/hkl-tap.h                                |    31 +-
 633 files changed, 51151 insertions(+), 120158 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2a0b820..eb2fecd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,3912 @@
 # Generated by Makefile. Do not edit.
 
+commit 2b2531c8d01eea14abb3e3912731fc927eba5128
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Jan 25 20:16:07 2015 +0100
+
+    [contrib] create a transformation type
+
+ contrib/hkl.hs | 52 ++++++++++++++++++++++++++++------------------------
+ 1 file changed, 28 insertions(+), 24 deletions(-)
+
+commit b0e5fc6fa9efa1eb774e0ef8a5b02e9afed8358a
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Jan 25 17:31:43 2015 +0100
+
+    [contrib] create a Lattice type with all the known type
+
+ contrib/hkl.hs | 53 +++++++++++++++++++++++++++++++++--------------------
+ 1 file changed, 33 insertions(+), 20 deletions(-)
+
+commit 8c7fdf080422b70c58bd7f45fbfc5d1da2664cd1
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Jan 25 11:15:40 2015 +0100
+
+    [contrib] work a bit on the haskell implementation
+    
+    this long term project will help to produce a better design for the libhkl
+
+ contrib/hkl.hs  | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ contrib/hkl.lhs | 64 ----------------------------------------
+ 2 files changed, 90 insertions(+), 64 deletions(-)
+
+commit bf268fd5c24ea3e753bf831a21a8c6df038c7f2d
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jan 24 11:24:03 2015 +0100
+
+    [doc] style
+
+ Documentation/hkl.org.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 73c6c23c0e21411090f7f86a1e03991368821624
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jan 24 11:20:02 2015 +0100
+
+    [doc] add Howto's to add a diffractometer and work on the documentation
+
+ Documentation/hkl.org.in | 51 ++++++++++++++++++++++++++++++++++--------------
+ 1 file changed, 36 insertions(+), 15 deletions(-)
+
+commit bb5f2aa6bf74cf9941dd5cd88a31f5b67b88276d
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jan 24 09:58:57 2015 +0100
+
+    [doc] rework the gui todos and add the tooltips.
+
+ Documentation/hkl.org.in | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+commit 148575f020e5555d90f64c3c52ccac9c215bb133
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jan 24 09:07:53 2015 +0100
+
+    [hkl] use M_SQRT1_2 instead of non const expression (clang error)
+
+ tests/hkl-axis-t.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit c945bc432db86904481220c821c3d21b90cd83d0
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Fri Jan 23 16:34:41 2015 +0100
+
+    [todo] add more todo about the petraIII problems
+
+ Documentation/hkl.org.in | 19 +++++++++++++++++--
+ 1 file changed, 17 insertions(+), 2 deletions(-)
+
+commit 6e284614ee0b896529ab9a213ee4408fa56d707f
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Fri Jan 23 16:33:56 2015 +0100
+
+    [doc] generate the pseudo axis and parameter description
+
+ Documentation/Makefile.am               | 10 +++++++-
+ Documentation/default.el                |  4 ++--
+ Documentation/hkl.org.in                | 41 ++++++++++++++++++++++-----------
+ hkl.h                                   |  6 ++---
+ hkl/hkl-binding-private.h               |  2 +-
+ hkl/hkl-binding.c                       |  2 +-
+ hkl/hkl-pseudoaxis-common-hkl-private.h |  8 +++----
+ hkl/hkl-pseudoaxis-common-hkl.c         |  2 +-
+ hkl/hkl-pseudoaxis-common-q.c           |  8 +++----
+ hkl/hkl-pseudoaxis.c                    |  4 ++--
+ tests/bindings/python.py                | 12 ++++++----
+ 11 files changed, 62 insertions(+), 37 deletions(-)
+
+commit 241aafccddf9b728d18ba4e5994e972c1fbf3f3c
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Fri Jan 23 15:05:44 2015 +0100
+
+    [tests] add better binding check for all lists
+
+ tests/bindings/python.py | 3 +++
+ 1 file changed, 3 insertions(+)
+
+commit ef00049a9c9cc9a353940ccc810cdee04cb8698a
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Fri Jan 23 13:39:25 2015 +0100
+
+    [binding] expose hkl_engine_parameter_get
+    
+    so it is possible to use this to document the engine mode parameters
+
+ hkl/hkl-pseudoaxis.c     | 2 +-
+ tests/bindings/python.py | 3 +++
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+commit 23b1c1aac8e77778c8a65176df91ad42d98d441a
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Fri Jan 23 11:51:47 2015 +0100
+
+    [hkl] factorize the constant_(omega|chi|phi)_parameters
+
+ hkl/hkl-engine-k4c.c                    | 18 +++++--------
+ hkl/hkl-engine-k6c.c                    | 48 +++++++++++----------------------
+ hkl/hkl-pseudoaxis-common-hkl-private.h | 48 ++++++++++++++++++++-------------
+ 3 files changed, 52 insertions(+), 62 deletions(-)
+
+commit 8c2d67518eb8c75dcee8e1370f3cd6afd39825b8
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Fri Jan 23 11:46:42 2015 +0100
+
+    [hkl] add the constant_incidence parameters description
+
+ hkl/hkl-engine-k6c.c                    | 20 ++++----------------
+ hkl/hkl-pseudoaxis-common-hkl-private.h | 26 ++++++++++++++++++++++++++
+ 2 files changed, 30 insertions(+), 16 deletions(-)
+
+commit 064a793b02f2c8b49e4ae739e1742f16a1f9dcc7
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Fri Jan 23 10:35:22 2015 +0100
+
+    [hkl] factorize also the psi_constant_vertical parameters for e6c
+
+ hkl/hkl-engine-e6c.c                    |  7 +----
+ hkl/hkl-pseudoaxis-common-hkl-private.h | 49 +++++++++++++++++----------------
+ 2 files changed, 26 insertions(+), 30 deletions(-)
+
+commit 17c7a98858f2ad566f46294c926bf3c56eeb4eab
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Fri Jan 23 10:06:30 2015 +0100
+
+    [hkl] factorize the psi_parameters for the psi engine.
+    
+    during thie refactoring I renamed the parameters so they match the
+    psi_constant_xxx mode of the hkl engine. It will be easier to understand
+    the these parameters are equivalent.
+
+ hkl/hkl-engine-e4c.c                    |  8 ++------
+ hkl/hkl-engine-e6c.c                    |  8 ++------
+ hkl/hkl-engine-k4c.c                    |  8 ++------
+ hkl/hkl-engine-k6c.c                    | 16 ++++------------
+ hkl/hkl-engine-template.c               |  8 ++------
+ hkl/hkl-pseudoaxis-common-psi-private.h | 18 ++++++++++++++++++
+ 6 files changed, 30 insertions(+), 36 deletions(-)
+
+commit 0dde5c60a89dcd5c235ba2a9153dfe937169bc5d
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Fri Jan 23 09:45:25 2015 +0100
+
+    [doc] fix the distcheck target
+
+ Documentation/Makefile.am | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit f3aeac9a287842ae95e4768db398c6fd172455ea
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Fri Jan 23 09:03:50 2015 +0100
+
+    [todo] more information about the computing problem of PetraIII
+
+ Documentation/hkl.org.in | 41 ++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 36 insertions(+), 5 deletions(-)
+
+commit 2fe29270d6ba59cba2ed2bcaf07c3a35c6953ab2
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Fri Jan 23 09:03:25 2015 +0100
+
+    [hkl] factorize the psi_constant_parameters
+
+ hkl/hkl-engine-e4c.c                    | 10 ++--------
+ hkl/hkl-engine-e6c.c                    |  9 ++-------
+ hkl/hkl-engine-k4c.c                    |  9 ++-------
+ hkl/hkl-engine-k6c.c                    | 18 ++++--------------
+ hkl/hkl-pseudoaxis-common-hkl-private.h | 22 ++++++++++++++++++++++
+ 5 files changed, 32 insertions(+), 36 deletions(-)
+
+commit 8970375aaae09d71dc0df8648169ef3b9df3e35b
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Thu Jan 22 14:22:23 2015 +0100
+
+    [hkl] set the eulerian solutions parameter description
+
+ hkl/hkl-pseudoaxis-common-eulerians.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+commit 8480f586139f18c74304acb5c298bd5a154064c4
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Thu Jan 22 14:21:34 2015 +0100
+
+    [hkl] factorize the double_diffraction_parameters (with description)
+
+ hkl/hkl-engine-e4c.c                    |  9 ++-------
+ hkl/hkl-engine-e6c.c                    | 17 ++++-------------
+ hkl/hkl-engine-k4c.c                    |  8 ++------
+ hkl/hkl-engine-k6c.c                    | 32 ++++++++------------------------
+ hkl/hkl-pseudoaxis-common-hkl-private.h | 19 +++++++++++++++++++
+ 5 files changed, 35 insertions(+), 50 deletions(-)
+
+commit 14ea2092422f8d109e77556010c0e4aec609a9c5
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Thu Jan 22 14:20:04 2015 +0100
+
+    [hkl] set the description of all PseudoAxis
+
+ hkl/hkl-pseudoaxis-common-eulerians.c | 12 +++++++++---
+ hkl/hkl-pseudoaxis-common-hkl.c       | 15 +++++++++++---
+ hkl/hkl-pseudoaxis-common-psi.c       |  4 +++-
+ hkl/hkl-pseudoaxis-common-q.c         | 37 ++++++++++++++++++++++++++++-------
+ 4 files changed, 54 insertions(+), 14 deletions(-)
+
+commit cd4dca754a9b245763e3380c151fd39d6ddee028
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Thu Jan 22 13:00:41 2015 +0100
+
+    [hkl] add the hkl_parameter_description_get method
+
+ hkl.h                       |  2 ++
+ hkl/hkl-lattice.c           | 21 +++++++++++++++------
+ hkl/hkl-parameter-private.h |  5 +++--
+ hkl/hkl-parameter.c         | 19 +++++++++++++++++--
+ hkl/hkl-sample.c            |  9 ++++++---
+ tests/hkl-parameter-t.c     | 36 +++++++++++++++++++-----------------
+ 6 files changed, 62 insertions(+), 30 deletions(-)
+
+commit 83ff394e628177f760b2c5c6e65aad80a5dfdfef
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Thu Jan 22 10:20:31 2015 +0100
+
+    [todo] add new informations for the petraIII problem.
+
+ Documentation/hkl.org.in | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+commit 8701faf27699cdba0c227bc041c82797ce0b5b68
+Author: Ken L <klauer at bnl.gov>
+Date:   Thu Jan 22 11:25:02 2015 -0500
+
+    axes_(names|values) -> axis_(names|values)
+
+ Documentation/sphinx/source/bindings/python.py     | 18 +++++-----
+ Documentation/sphinx/source/pyplots/trajectory.py  |  8 ++---
+ .../sphinx/source/pyplots/trajectory_full.py       |  8 ++---
+ .../sphinx/source/pyplots/trajectory_simple.py     | 14 ++++----
+ gui/hkl-gui-pseudoaxes.c                           |  4 +--
+ gui/hkl-gui.c                                      | 22 ++++++-------
+ hkl.h                                              | 18 +++++-----
+ hkl/hkl-binding-private.h                          | 10 +++---
+ hkl/hkl-binding.c                                  | 38 +++++++++++-----------
+ hkl/hkl-geometry.c                                 | 12 +++----
+ hkl/hkl-pseudoaxis-common-hkl.c                    |  2 +-
+ hkl/hkl-pseudoaxis-private.h                       | 14 ++++----
+ hkl/hkl-pseudoaxis.c                               | 28 ++++++++--------
+ tests/bindings/python.py                           | 24 +++++++-------
+ tests/bindings/trajectory.py                       | 12 +++----
+ tests/hkl-bench-t.c                                |  8 ++---
+ tests/hkl-geometry-t.c                             | 16 ++++-----
+ tests/hkl-pseudoaxis-e4ch-t.c                      |  8 ++---
+ tests/hkl-pseudoaxis-e4cv-t.c                      |  8 ++---
+ tests/hkl-pseudoaxis-e6c-t.c                       | 16 ++++-----
+ tests/hkl-pseudoaxis-k4cv-t.c                      |  4 +--
+ tests/hkl-pseudoaxis-k6c-t.c                       |  4 +--
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c           |  8 ++---
+ tests/hkl-pseudoaxis-t.c                           | 34 +++++++++----------
+ tests/hkl-pseudoaxis-zaxis-t.c                     |  2 +-
+ tests/tap/hkl-tap.c                                |  4 +--
+ 26 files changed, 172 insertions(+), 172 deletions(-)
+
+commit 91042e9be687fb5343bb9b9ec55ed73633eb8f5b
+Author: Ken L <klauer at bnl.gov>
+Date:   Thu Jan 22 10:44:53 2015 -0500
+
+    mesured -> measured
+
+ hkl.h                    | 2 +-
+ hkl/hkl-sample.c         | 8 ++++----
+ tests/bindings/python.py | 4 ++--
+ tests/hkl-sample-t.c     | 4 ++--
+ 4 files changed, 9 insertions(+), 9 deletions(-)
+
+commit 0d20c51641b9f9c445abf68cc603ae5efeaf6dc9
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Jan 21 16:39:52 2015 +0100
+
+    [todo] problem with the petraIII diffractometer.
+
+ Documentation/hkl.org.in | 54 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 54 insertions(+)
+
+commit 5d8b4a1811d2cdf240a89a84b8782a31ab04a7f3
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Jan 21 10:11:49 2015 +0100
+
+    add --disable-hkl-doc option to no build the documentation
+
+ Documentation/hkl.org.in | 42 +++++++++++++++++++++++-------------------
+ Makefile.am              |  5 ++++-
+ configure.ac             | 24 +++++++++++-------------
+ 3 files changed, 38 insertions(+), 33 deletions(-)
+
+commit 1185bfae4cd2e407177fd6e13de6822420996286
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Jan 21 08:52:11 2015 +0100
+
+    expose the hkl_geometry_wavelength_get into the binding
+    
+    thanks Ken Lauer, for the issue.
+
+ hkl/hkl-geometry.c       | 2 +-
+ tests/bindings/python.py | 5 +++++
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+commit 97d290ff3ba4d8325b21b3ab5e3f39869abe914d
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jan 17 20:03:51 2015 +0100
+
+    [doc] use org-info.js
+    
+    for now org-info is not embeded.
+
+ Documentation/hkl.org.in | 30 ++++++++----------------------
+ 1 file changed, 8 insertions(+), 22 deletions(-)
+
+commit 6a2025a251e517e0afe1c97985e10ee4baa0d84d
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jan 17 20:02:56 2015 +0100
+
+    [doc] fix the Makefile rules
+
+ Documentation/Makefile.am | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+commit be51577505bafb6f5807b808bdb1319fef8fe2e1
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jan 17 12:01:54 2015 +0100
+
+    [doc] use mathjax when exporting the org documentation
+
+ Documentation/Makefile.am |  14 ++--
+ Documentation/hkl.org.in  |   2 +-
+ org-doc.make              | 176 ----------------------------------------------
+ 3 files changed, 7 insertions(+), 185 deletions(-)
+
+commit 05a5669a462ab24373c4783760c13f0e932c7815
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Fri Jan 16 16:38:31 2015 +0100
+
+    [todo] add unit test for hkl_sample_affine.
+
+ Documentation/hkl.org.in | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+commit 625eac4ec27cf6103fa0537b9902a4ff7c156fe6
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Fri Jan 16 09:37:02 2015 +0100
+
+    [doc] set a correct mailto link for the bug reporting.
+
+ Documentation/hkl.org.in | 13 +------------
+ 1 file changed, 1 insertion(+), 12 deletions(-)
+
+commit b310fe6b9ccacd185aab96434054cce34976d028
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Fri Jan 16 09:36:23 2015 +0100
+
+    [doc] typo
+
+ Documentation/hkl.org.in | 1 -
+ 1 file changed, 1 deletion(-)
+
+commit c13509bcfaf7aade27cf2153c6cca29f882fee1f
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Fri Jan 16 09:36:11 2015 +0100
+
+    [doc] better TODO for the documentation
+
+ Documentation/hkl.org.in | 21 +++++++++++++--------
+ 1 file changed, 13 insertions(+), 8 deletions(-)
+
+commit c39817295a5a3d87b2873a564e1c35da81b58fcb
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Thu Jan 15 16:49:09 2015 +0100
+
+    [doc] reword
+
+ Documentation/hkl.org.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 04f184e83bea7961444880df867c7401cab4c0e6
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Thu Jan 15 16:44:42 2015 +0100
+
+    TODO HklParameter description.
+
+ Documentation/hkl.org.in | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+commit fa8b02bce12dca123542e4ec8ccae64a6024d9dc
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Thu Jan 15 16:42:47 2015 +0100
+
+    use the hkl_parameter_quaternion_get in the hkl3d library
+    
+    this way no need to access the private HklAxis part from hkl3d.
+
+ hkl3d/hkl3d.cpp | 13 +++++--------
+ 1 file changed, 5 insertions(+), 8 deletions(-)
+
+commit 6bb26914a92a6a5c5320bbce7ae7f551cd3ea925
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Thu Jan 15 16:34:35 2015 +0100
+
+    add hkl_parameter_axis_v_get and hkl_parameter_quaternion_get
+
+ Documentation/hkl.org.in                |  28 +++--
+ hkl.h                                   |  28 +++++
+ hkl/hkl-axis.c                          |  14 ++-
+ hkl/hkl-matrix-private.h                |   1 -
+ hkl/hkl-parameter-private.h             |  39 ++++--
+ hkl/hkl-parameter.c                     |  22 ++++
+ hkl/hkl-pseudoaxis-common-hkl-private.h |  13 --
+ hkl/hkl-quaternion-private.h            |   6 -
+ hkl/hkl-types.c                         |   1 +
+ hkl/hkl-vector-private.h                |  17 ---
+ tests/bindings/python.py                |  26 +++-
+ tests/hkl-axis-t.c                      | 206 ++++++++++++++++----------------
+ tests/hkl-parameter-t.c                 |  18 ++-
+ tests/tap/hkl-tap.c                     |  17 +++
+ tests/tap/hkl-tap.h                     |   3 +
+ 15 files changed, 271 insertions(+), 168 deletions(-)
+
+commit c03066355fc358609e3167ca22654d1a1834c57b
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Wed Jan 14 16:02:56 2015 +0100
+
+    fix the disctcheck target for the org-mode documentation
+
+ Documentation/Makefile.am |  16 +++--
+ org-doc.make              | 176 ++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 187 insertions(+), 5 deletions(-)
+
+commit f1fe69052cc992f024945a929d2d602bdf55f8d8
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Tue Jan 13 16:09:57 2015 +0100
+
+    add the default.el file to export the hkl.org.
+
+ Documentation/default.el | 25 +++++++++++++++++++++++++
+ 1 file changed, 25 insertions(+)
+
+commit 4399db59a51f3ace8d5295b39202dd84ed85382b
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Tue Jan 13 16:08:44 2015 +0100
+
+    move the TODO file into hkl.org.in
+
+ Documentation/hkl.org.in | 71 ++++++++++++++++++++++++++++++++++++++++++++++++
+ TODO                     | 71 ------------------------------------------------
+ 2 files changed, 71 insertions(+), 71 deletions(-)
+
+commit e5fcc6a1dab01b07b75f7ae6647d56b182265d1f
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Tue Jan 13 15:55:43 2015 +0100
+
+    generate the diffractometer description using the python binding
+    
+    we introspect the library to generate the Diffractometers section
+
+ Documentation/Makefile.am |    4 +-
+ Documentation/hkl.org.in  | 1258 ++-------------------------------------------
+ 2 files changed, 50 insertions(+), 1212 deletions(-)
+
+commit 18061c91e103522ec4ef9a7cb8ddf2f489d2fbbd
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Tue Jan 13 11:49:57 2015 +0100
+
+    fix all the references
+
+ Documentation/hkl.org.in | 24 +++++++++++++++---------
+ 1 file changed, 15 insertions(+), 9 deletions(-)
+
+commit e948755950f2e2ca74a47652f4b80458546f3bc2
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Tue Jan 13 11:25:11 2015 +0100
+
+    indent hkl.org.in
+
+ Documentation/hkl.org.in | 1439 +++++++++++++++++++---------------------------
+ 1 file changed, 581 insertions(+), 858 deletions(-)
+
+commit 02f76c5a4588b1be3f82ff198d90efb27b1e6a32
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Tue Jan 13 11:16:10 2015 +0100
+
+    fix all the equations in the org-mode file
+
+ Documentation/hkl.org.in | 331 +++++++++++++++++++++++++++++++----------------
+ 1 file changed, 218 insertions(+), 113 deletions(-)
+
+commit ed198b9619b9cd6d5cb036c1599e6630c1205fa9
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Mon Jan 12 16:01:39 2015 +0100
+
+    use babel for all the shell scripts
+
+ Documentation/hkl.org.in | 90 ++++++++++++++++++++++++------------------------
+ 1 file changed, 45 insertions(+), 45 deletions(-)
+
+commit 8b755cf9eea9b3ab8a2cce9197af266f01dc5524
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Mon Jan 12 15:57:25 2015 +0100
+
+    remove the old lyx code now part of hkl.org
+
+ Documentation/hkl.lyx | 3402 -------------------------------------------------
+ 1 file changed, 3402 deletions(-)
+
+commit ba7eba6af3d37a890dcd79c97d6472c2f3f53b50
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Mon Jan 12 15:56:59 2015 +0100
+
+    put the hkl.org file at the right place and fix the figure inclusion
+
+ Documentation/Makefile.am |   6 +--
+ Documentation/hkl.org.in  | 113 +++++++++++++++++++---------------------------
+ configure.ac              |   6 +++
+ 3 files changed, 55 insertions(+), 70 deletions(-)
+
+commit 7733a326c7861e889403f0a50b40b6dc659074ee
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Mon Jan 12 11:11:11 2015 +0100
+
+    add the hkl.org file with all the documentation
+
+ Documentation/Makefile.am |    5 +
+ Documentation/hkl.org.in  | 2138 +++++++++++++++++++++++++++++++++++++++++++++
+ configure.ac              |    1 +
+ 3 files changed, 2144 insertions(+)
+
+commit 159e2f3f8aa475217c044afb0ffbc3bc73ca2726
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Mon Jan 12 07:24:14 2015 +0100
+
+    update the NEWS and TODO files
+
+ NEWS |  4 +++-
+ TODO | 71 +++++++++++++++++++++++++++++++++++++++++++++-----------------------
+ 2 files changed, 50 insertions(+), 25 deletions(-)
+
+commit 9fcb33894c5591eca8edd40bc62dd37d9a8cf3c7
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Fri Jan 9 15:28:25 2015 +0100
+
+    typo
+
+ hkl/hkl-pseudoaxis.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+commit cf635233a0a589f72b1b73379e784d9e4dbc1b64
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Fri Jan 9 14:47:19 2015 +0100
+
+    fix a segfault in the gui
+
+ gui/hkl-gui.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+commit 70ff43eccd1ce407254c0b2ed921b7bde167727e
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Fri Jan 9 14:31:15 2015 +0100
+
+    add an --enable-logging to activate the logging in the hkl library
+    
+    For now this is optional to avoid the perfomance impact.
+    I do not have numbers for now but I prefer to make this optional in a first time.
+    
+    I am not really happy with the implementation of the logging.
+    Only one method is instrumented for now
+    
+    hkl_engine_pseudo_axes_values_set
+
+ configure.ac         | 49 +++++++++++++++++++++++++++++++++----------------
+ hkl/hkl-pseudoaxis.c | 40 +++++++++++++++++++++++-----------------
+ 2 files changed, 56 insertions(+), 33 deletions(-)
+
+commit f09b45ea8bc0733ad37ec3f9ee04ee07096594c9
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Wed Jan 7 15:20:52 2015 +0100
+
+    remove a bunch of warning during the compilation
+
+ hkl.h                |  4 ++--
+ hkl/hkl-binding.c    |  3 +--
+ hkl/hkl-factory.c    |  4 ++--
+ hkl/hkl-geometry.c   |  3 ---
+ hkl/hkl-pseudoaxis.c |  1 -
+ hkl/hkl-types.c      |  1 +
+ hkl/hkl-types.h      | 37 ++++++++++++++++++++-----------------
+ 7 files changed, 26 insertions(+), 27 deletions(-)
+
+commit b1ac77679017c16f00f886ecc9a02abb6a263825
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Wed Jan 7 11:57:20 2015 +0100
+
+    reworks the NEWS file
+
+ NEWS | 39 +++++++++++++++++++++------------------
+ 1 file changed, 21 insertions(+), 18 deletions(-)
+
+commit 184629e2b99612c7b99fd6a40417a0612048b2cd
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Wed Jan 7 11:08:32 2015 +0100
+
+    fix a segmentation fault with the HklSampleReflection in the binding.
+    
+    - test deletion of objects in the python binding.
+    - rewrite the hkl-type.c with a macro to be a lot more maintainable.
+    - use a fake ref and unref method for the HklSampleReflection type.
+    - fix all the binding test of the documentation
+
+ Documentation/sphinx/Makefile.am                   |   6 +-
+ Documentation/sphinx/source/bindings/python.py     |   2 +-
+ Documentation/sphinx/source/pyplots/trajectory.py  |   2 +-
+ .../sphinx/source/pyplots/trajectory_full.py       |   2 +-
+ .../sphinx/source/pyplots/trajectory_simple.py     |   5 +-
+ hkl/hkl-binding-private.h                          |   2 +-
+ hkl/hkl-binding.c                                  |   8 +-
+ hkl/hkl-sample.c                                   |   2 +-
+ hkl/hkl-types.c                                    | 243 +++------------------
+ hkl/hkl-types.h                                    |   9 -
+ tests/bindings/python.py                           |  18 +-
+ 11 files changed, 60 insertions(+), 239 deletions(-)
+
+commit 2baed83926a1c9520f9c62bea73b614c497fab57
+Author: picca <picca at synchrotron-soleil.fr>
+Date:   Tue Jan 6 09:36:31 2015 +0100
+
+    fix the reference manual
+
+ Documentation/api/hkl-docs.sgml | 11 +++--------
+ 1 file changed, 3 insertions(+), 8 deletions(-)
+
+commit 4225df2bd442d695dd9fe07caf778eb2cd6b3005
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Dec 23 16:53:41 2014 +0100
+
+    do not install the hkl3d.pc
+
+ Makefile.am | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit d4f7ed4de1de7e89fd00303f5d545ec58a3befd6
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Dec 23 16:49:36 2014 +0100
+
+    remove the embeded bullet library.
+    
+    this will reduce the work for the packaging.
+
+ Documentation/sphinx/source/development.rst        |    7 +-
+ Makefile.am                                        |    2 +-
+ configure.ac                                       |   89 +-
+ gui/Makefile.am                                    |   10 +-
+ hkl3d/Makefile.am                                  |   28 +-
+ hkl3d/bullet/AUTHORS                               |   22 -
+ hkl3d/bullet/BulletLicense.txt                     |   18 -
+ hkl3d/bullet/COPYING                               |  674 -----
+ hkl3d/bullet/ChangeLog                             |  755 ------
+ hkl3d/bullet/Doxyfile                              |  768 ------
+ hkl3d/bullet/LICENSE                               |   19 -
+ hkl3d/bullet/Makefile.am                           |    3 -
+ hkl3d/bullet/NEWS                                  |    4 -
+ hkl3d/bullet/README                                |    7 -
+ hkl3d/bullet/RELEASING.TXT                         |   34 -
+ hkl3d/bullet/VERSION                               |    1 -
+ hkl3d/bullet/bullet.pc                             |   11 -
+ hkl3d/bullet/src/Bullet-C-Api.h                    |  176 --
+ .../BroadphaseCollision/btAxisSweep3.cpp           |   37 -
+ .../BroadphaseCollision/btAxisSweep3.h             | 1051 --------
+ .../BroadphaseCollision/btBroadphaseInterface.h    |   82 -
+ .../BroadphaseCollision/btBroadphaseProxy.cpp      |   17 -
+ .../BroadphaseCollision/btBroadphaseProxy.h        |  270 --
+ .../BroadphaseCollision/btCollisionAlgorithm.cpp   |   23 -
+ .../BroadphaseCollision/btCollisionAlgorithm.h     |   80 -
+ .../BulletCollision/BroadphaseCollision/btDbvt.cpp | 1295 ---------
+ .../BulletCollision/BroadphaseCollision/btDbvt.h   | 1256 ---------
+ .../BroadphaseCollision/btDbvtBroadphase.cpp       |  796 ------
+ .../BroadphaseCollision/btDbvtBroadphase.h         |  146 --
+ .../BroadphaseCollision/btDispatcher.cpp           |   22 -
+ .../BroadphaseCollision/btDispatcher.h             |  110 -
+ .../BroadphaseCollision/btMultiSapBroadphase.cpp   |  489 ----
+ .../BroadphaseCollision/btMultiSapBroadphase.h     |  151 --
+ .../BroadphaseCollision/btOverlappingPairCache.cpp |  633 -----
+ .../BroadphaseCollision/btOverlappingPairCache.h   |  469 ----
+ .../btOverlappingPairCallback.h                    |   40 -
+ .../BroadphaseCollision/btQuantizedBvh.cpp         | 1375 ----------
+ .../BroadphaseCollision/btQuantizedBvh.h           |  579 -----
+ .../BroadphaseCollision/btSimpleBroadphase.cpp     |  349 ---
+ .../BroadphaseCollision/btSimpleBroadphase.h       |  171 --
+ .../CollisionDispatch/SphereTriangleDetector.cpp   |  201 --
+ .../CollisionDispatch/SphereTriangleDetector.h     |   51 -
+ .../btActivatingCollisionAlgorithm.cpp             |   47 -
+ .../btActivatingCollisionAlgorithm.h               |   36 -
+ .../btBox2dBox2dCollisionAlgorithm.cpp             |  435 ----
+ .../btBox2dBox2dCollisionAlgorithm.h               |   66 -
+ .../btBoxBoxCollisionAlgorithm.cpp                 |   85 -
+ .../CollisionDispatch/btBoxBoxCollisionAlgorithm.h |   66 -
+ .../CollisionDispatch/btBoxBoxDetector.cpp         |  718 -----
+ .../CollisionDispatch/btBoxBoxDetector.h           |   44 -
+ .../CollisionDispatch/btCollisionConfiguration.h   |   48 -
+ .../CollisionDispatch/btCollisionCreateFunc.h      |   45 -
+ .../CollisionDispatch/btCollisionDispatcher.cpp    |  310 ---
+ .../CollisionDispatch/btCollisionDispatcher.h      |  172 --
+ .../CollisionDispatch/btCollisionObject.cpp        |  116 -
+ .../CollisionDispatch/btCollisionObject.h          |  524 ----
+ .../CollisionDispatch/btCollisionWorld.cpp         | 1513 -----------
+ .../CollisionDispatch/btCollisionWorld.h           |  509 ----
+ .../btCompoundCollisionAlgorithm.cpp               |  353 ---
+ .../btCompoundCollisionAlgorithm.h                 |   86 -
+ .../btConvex2dConvex2dAlgorithm.cpp                |  247 --
+ .../btConvex2dConvex2dAlgorithm.h                  |   95 -
+ .../btConvexConcaveCollisionAlgorithm.cpp          |  312 ---
+ .../btConvexConcaveCollisionAlgorithm.h            |  116 -
+ .../CollisionDispatch/btConvexConvexAlgorithm.cpp  |  679 -----
+ .../CollisionDispatch/btConvexConvexAlgorithm.h    |  109 -
+ .../btConvexPlaneCollisionAlgorithm.cpp            |  155 --
+ .../btConvexPlaneCollisionAlgorithm.h              |   84 -
+ .../btDefaultCollisionConfiguration.cpp            |  298 ---
+ .../btDefaultCollisionConfiguration.h              |  135 -
+ .../btEmptyCollisionAlgorithm.cpp                  |   34 -
+ .../CollisionDispatch/btEmptyCollisionAlgorithm.h  |   54 -
+ .../CollisionDispatch/btGhostObject.cpp            |  171 --
+ .../CollisionDispatch/btGhostObject.h              |  175 --
+ .../CollisionDispatch/btInternalEdgeUtility.cpp    |  842 ------
+ .../CollisionDispatch/btInternalEdgeUtility.h      |   46 -
+ .../CollisionDispatch/btManifoldResult.cpp         |  135 -
+ .../CollisionDispatch/btManifoldResult.h           |  128 -
+ .../btSimulationIslandManager.cpp                  |  443 ----
+ .../CollisionDispatch/btSimulationIslandManager.h  |   81 -
+ .../btSphereBoxCollisionAlgorithm.cpp              |  260 --
+ .../btSphereBoxCollisionAlgorithm.h                |   75 -
+ .../btSphereSphereCollisionAlgorithm.cpp           |  105 -
+ .../btSphereSphereCollisionAlgorithm.h             |   66 -
+ .../btSphereTriangleCollisionAlgorithm.cpp         |   84 -
+ .../btSphereTriangleCollisionAlgorithm.h           |   69 -
+ .../CollisionDispatch/btUnionFind.cpp              |   82 -
+ .../CollisionDispatch/btUnionFind.h                |  129 -
+ .../CollisionShapes/btBox2dShape.cpp               |   42 -
+ .../BulletCollision/CollisionShapes/btBox2dShape.h |  363 ---
+ .../BulletCollision/CollisionShapes/btBoxShape.cpp |   41 -
+ .../BulletCollision/CollisionShapes/btBoxShape.h   |  318 ---
+ .../CollisionShapes/btBvhTriangleMeshShape.cpp     |  466 ----
+ .../CollisionShapes/btBvhTriangleMeshShape.h       |  139 -
+ .../CollisionShapes/btCapsuleShape.cpp             |  171 --
+ .../CollisionShapes/btCapsuleShape.h               |  173 --
+ .../CollisionShapes/btCollisionMargin.h            |   26 -
+ .../CollisionShapes/btCollisionShape.cpp           |  119 -
+ .../CollisionShapes/btCollisionShape.h             |  150 --
+ .../CollisionShapes/btCompoundShape.cpp            |  356 ---
+ .../CollisionShapes/btCompoundShape.h              |  212 --
+ .../CollisionShapes/btConcaveShape.cpp             |   27 -
+ .../CollisionShapes/btConcaveShape.h               |   60 -
+ .../CollisionShapes/btConeShape.cpp                |  143 -
+ .../BulletCollision/CollisionShapes/btConeShape.h  |  103 -
+ .../CollisionShapes/btConvex2dShape.cpp            |   92 -
+ .../CollisionShapes/btConvex2dShape.h              |   80 -
+ .../CollisionShapes/btConvexHullShape.cpp          |  211 --
+ .../CollisionShapes/btConvexHullShape.h            |  120 -
+ .../CollisionShapes/btConvexInternalShape.cpp      |  151 --
+ .../CollisionShapes/btConvexInternalShape.h        |  202 --
+ .../CollisionShapes/btConvexPointCloudShape.cpp    |  157 --
+ .../CollisionShapes/btConvexPointCloudShape.h      |  105 -
+ .../CollisionShapes/btConvexPolyhedron.cpp         |  185 --
+ .../CollisionShapes/btConvexPolyhedron.h           |   54 -
+ .../CollisionShapes/btConvexShape.cpp              |  429 ---
+ .../CollisionShapes/btConvexShape.h                |   82 -
+ .../CollisionShapes/btConvexTriangleMeshShape.cpp  |  315 ---
+ .../CollisionShapes/btConvexTriangleMeshShape.h    |   75 -
+ .../CollisionShapes/btCylinderShape.cpp            |  279 --
+ .../CollisionShapes/btCylinderShape.h              |  200 --
+ .../CollisionShapes/btEmptyShape.cpp               |   50 -
+ .../BulletCollision/CollisionShapes/btEmptyShape.h |   70 -
+ .../CollisionShapes/btHeightfieldTerrainShape.cpp  |  411 ---
+ .../CollisionShapes/btHeightfieldTerrainShape.h    |  161 --
+ .../BulletCollision/CollisionShapes/btMaterial.h   |   35 -
+ .../CollisionShapes/btMinkowskiSumShape.cpp        |   60 -
+ .../CollisionShapes/btMinkowskiSumShape.h          |   60 -
+ .../CollisionShapes/btMultiSphereShape.cpp         |  167 --
+ .../CollisionShapes/btMultiSphereShape.h           |   99 -
+ .../btMultimaterialTriangleMeshShape.cpp           |   45 -
+ .../btMultimaterialTriangleMeshShape.h             |  120 -
+ .../CollisionShapes/btOptimizedBvh.cpp             |  391 ---
+ .../CollisionShapes/btOptimizedBvh.h               |   65 -
+ .../CollisionShapes/btPolyhedralConvexShape.cpp    |  338 ---
+ .../CollisionShapes/btPolyhedralConvexShape.h      |  112 -
+ .../btScaledBvhTriangleMeshShape.cpp               |  123 -
+ .../CollisionShapes/btScaledBvhTriangleMeshShape.h |   93 -
+ .../CollisionShapes/btShapeHull.cpp                |  170 --
+ .../BulletCollision/CollisionShapes/btShapeHull.h  |   59 -
+ .../CollisionShapes/btSphereShape.cpp              |   71 -
+ .../CollisionShapes/btSphereShape.h                |   73 -
+ .../CollisionShapes/btStaticPlaneShape.cpp         |  107 -
+ .../CollisionShapes/btStaticPlaneShape.h           |  103 -
+ .../CollisionShapes/btStridingMeshInterface.cpp    |  379 ---
+ .../CollisionShapes/btStridingMeshInterface.h      |  162 --
+ .../CollisionShapes/btTetrahedronShape.cpp         |  218 --
+ .../CollisionShapes/btTetrahedronShape.h           |   74 -
+ .../CollisionShapes/btTriangleBuffer.cpp           |   35 -
+ .../CollisionShapes/btTriangleBuffer.h             |   69 -
+ .../CollisionShapes/btTriangleCallback.cpp         |   28 -
+ .../CollisionShapes/btTriangleCallback.h           |   42 -
+ .../CollisionShapes/btTriangleIndexVertexArray.cpp |   95 -
+ .../CollisionShapes/btTriangleIndexVertexArray.h   |  131 -
+ .../btTriangleIndexVertexMaterialArray.cpp         |   86 -
+ .../btTriangleIndexVertexMaterialArray.h           |   84 -
+ .../CollisionShapes/btTriangleInfoMap.h            |  240 --
+ .../CollisionShapes/btTriangleMesh.cpp             |  140 -
+ .../CollisionShapes/btTriangleMesh.h               |   69 -
+ .../CollisionShapes/btTriangleMeshShape.cpp        |  211 --
+ .../CollisionShapes/btTriangleMeshShape.h          |   89 -
+ .../CollisionShapes/btTriangleShape.h              |  182 --
+ .../CollisionShapes/btUniformScalingShape.cpp      |  160 --
+ .../CollisionShapes/btUniformScalingShape.h        |   87 -
+ hkl3d/bullet/src/BulletCollision/Doxyfile          |  746 ------
+ .../src/BulletCollision/Gimpact/btBoxCollision.h   |  647 -----
+ .../src/BulletCollision/Gimpact/btClipPolygon.h    |  182 --
+ .../Gimpact/btContactProcessing.cpp                |  181 --
+ .../BulletCollision/Gimpact/btContactProcessing.h  |  145 --
+ .../src/BulletCollision/Gimpact/btGImpactBvh.cpp   |  498 ----
+ .../src/BulletCollision/Gimpact/btGImpactBvh.h     |  396 ---
+ .../Gimpact/btGImpactCollisionAlgorithm.cpp        |  904 -------
+ .../Gimpact/btGImpactCollisionAlgorithm.h          |  306 ---
+ .../BulletCollision/Gimpact/btGImpactMassUtil.h    |   60 -
+ .../Gimpact/btGImpactQuantizedBvh.cpp              |  528 ----
+ .../Gimpact/btGImpactQuantizedBvh.h                |  372 ---
+ .../src/BulletCollision/Gimpact/btGImpactShape.cpp |  203 --
+ .../src/BulletCollision/Gimpact/btGImpactShape.h   | 1171 ---------
+ .../Gimpact/btGenericPoolAllocator.cpp             |  283 --
+ .../Gimpact/btGenericPoolAllocator.h               |  163 --
+ .../BulletCollision/Gimpact/btGeometryOperations.h |  212 --
+ .../src/BulletCollision/Gimpact/btQuantization.h   |   88 -
+ .../BulletCollision/Gimpact/btTriangleShapeEx.cpp  |  218 --
+ .../BulletCollision/Gimpact/btTriangleShapeEx.h    |  180 --
+ .../bullet/src/BulletCollision/Gimpact/gim_array.h |  326 ---
+ .../Gimpact/gim_basic_geometry_operations.h        |  543 ----
+ .../src/BulletCollision/Gimpact/gim_bitset.h       |  123 -
+ .../BulletCollision/Gimpact/gim_box_collision.h    |  590 -----
+ .../src/BulletCollision/Gimpact/gim_box_set.cpp    |  182 --
+ .../src/BulletCollision/Gimpact/gim_box_set.h      |  674 -----
+ .../src/BulletCollision/Gimpact/gim_clip_polygon.h |  210 --
+ .../src/BulletCollision/Gimpact/gim_contact.cpp    |  146 --
+ .../src/BulletCollision/Gimpact/gim_contact.h      |  164 --
+ .../src/BulletCollision/Gimpact/gim_geom_types.h   |   97 -
+ .../src/BulletCollision/Gimpact/gim_geometry.h     |   42 -
+ .../src/BulletCollision/Gimpact/gim_hash_table.h   |  902 -------
+ .../src/BulletCollision/Gimpact/gim_linear_math.h  | 1573 -----------
+ .../bullet/src/BulletCollision/Gimpact/gim_math.h  |  157 --
+ .../src/BulletCollision/Gimpact/gim_memory.cpp     |  135 -
+ .../src/BulletCollision/Gimpact/gim_memory.h       |  190 --
+ .../src/BulletCollision/Gimpact/gim_radixsort.h    |  406 ---
+ .../BulletCollision/Gimpact/gim_tri_collision.cpp  |  640 -----
+ .../BulletCollision/Gimpact/gim_tri_collision.h    |  379 ---
+ .../btContinuousConvexCollision.cpp                |  243 --
+ .../btContinuousConvexCollision.h                  |   59 -
+ .../NarrowPhaseCollision/btConvexCast.cpp          |   20 -
+ .../NarrowPhaseCollision/btConvexCast.h            |   73 -
+ .../btConvexPenetrationDepthSolver.h               |   42 -
+ .../btDiscreteCollisionDetectorInterface.h         |   91 -
+ .../NarrowPhaseCollision/btGjkConvexCast.cpp       |  176 --
+ .../NarrowPhaseCollision/btGjkConvexCast.h         |   50 -
+ .../NarrowPhaseCollision/btGjkEpa2.cpp             |  989 -------
+ .../NarrowPhaseCollision/btGjkEpa2.h               |   75 -
+ .../btGjkEpaPenetrationDepthSolver.cpp             |   66 -
+ .../btGjkEpaPenetrationDepthSolver.h               |   43 -
+ .../NarrowPhaseCollision/btGjkPairDetector.cpp     |  457 ----
+ .../NarrowPhaseCollision/btGjkPairDetector.h       |  103 -
+ .../NarrowPhaseCollision/btManifoldPoint.h         |  158 --
+ .../btMinkowskiPenetrationDepthSolver.cpp          |  362 ---
+ .../btMinkowskiPenetrationDepthSolver.h            |   40 -
+ .../NarrowPhaseCollision/btPersistentManifold.cpp  |  260 --
+ .../NarrowPhaseCollision/btPersistentManifold.h    |  232 --
+ .../NarrowPhaseCollision/btPointCollector.h        |   64 -
+ .../btPolyhedralContactClipping.cpp                |  360 ---
+ .../btPolyhedralContactClipping.h                  |   46 -
+ .../NarrowPhaseCollision/btRaycastCallback.cpp     |  177 --
+ .../NarrowPhaseCollision/btRaycastCallback.h       |   72 -
+ .../btSimplexSolverInterface.h                     |   63 -
+ .../btSubSimplexConvexCast.cpp                     |  160 --
+ .../NarrowPhaseCollision/btSubSimplexConvexCast.h  |   50 -
+ .../btVoronoiSimplexSolver.cpp                     |  609 -----
+ .../NarrowPhaseCollision/btVoronoiSimplexSolver.h  |  179 --
+ .../Character/btCharacterControllerInterface.h     |   46 -
+ .../Character/btKinematicCharacterController.cpp   |  641 -----
+ .../Character/btKinematicCharacterController.h     |  162 --
+ .../ConstraintSolver/btConeTwistConstraint.cpp     | 1127 --------
+ .../ConstraintSolver/btConeTwistConstraint.h       |  346 ---
+ .../ConstraintSolver/btConstraintSolver.h          |   52 -
+ .../ConstraintSolver/btContactConstraint.cpp       |  178 --
+ .../ConstraintSolver/btContactConstraint.h         |   71 -
+ .../ConstraintSolver/btContactSolverInfo.h         |   87 -
+ .../ConstraintSolver/btGeneric6DofConstraint.cpp   | 1070 --------
+ .../ConstraintSolver/btGeneric6DofConstraint.h     |  614 -----
+ .../btGeneric6DofSpringConstraint.cpp              |  172 --
+ .../btGeneric6DofSpringConstraint.h                |   97 -
+ .../ConstraintSolver/btHinge2Constraint.cpp        |   66 -
+ .../ConstraintSolver/btHinge2Constraint.h          |   58 -
+ .../ConstraintSolver/btHingeConstraint.cpp         | 1033 --------
+ .../ConstraintSolver/btHingeConstraint.h           |  381 ---
+ .../ConstraintSolver/btJacobianEntry.h             |  156 --
+ .../ConstraintSolver/btPoint2PointConstraint.cpp   |  230 --
+ .../ConstraintSolver/btPoint2PointConstraint.h     |  161 --
+ .../btSequentialImpulseConstraintSolver.cpp        | 1239 ---------
+ .../btSequentialImpulseConstraintSolver.h          |  128 -
+ .../ConstraintSolver/btSliderConstraint.cpp        |  857 ------
+ .../ConstraintSolver/btSliderConstraint.h          |  333 ---
+ .../ConstraintSolver/btSolve2LinearConstraint.cpp  |  255 --
+ .../ConstraintSolver/btSolve2LinearConstraint.h    |  107 -
+ .../BulletDynamics/ConstraintSolver/btSolverBody.h |  191 --
+ .../ConstraintSolver/btSolverConstraint.h          |   96 -
+ .../ConstraintSolver/btTypedConstraint.cpp         |  214 --
+ .../ConstraintSolver/btTypedConstraint.h           |  436 ----
+ .../ConstraintSolver/btUniversalConstraint.cpp     |   87 -
+ .../ConstraintSolver/btUniversalConstraint.h       |   62 -
+ .../src/BulletDynamics/Dynamics/Bullet-C-API.cpp   |  405 ---
+ .../BulletDynamics/Dynamics/btActionInterface.h    |   46 -
+ .../Dynamics/btContinuousDynamicsWorld.cpp         |  196 --
+ .../Dynamics/btContinuousDynamicsWorld.h           |   46 -
+ .../Dynamics/btDiscreteDynamicsWorld.cpp           | 1348 ----------
+ .../Dynamics/btDiscreteDynamicsWorld.h             |  200 --
+ .../src/BulletDynamics/Dynamics/btDynamicsWorld.h  |  151 --
+ .../src/BulletDynamics/Dynamics/btRigidBody.cpp    |  402 ---
+ .../src/BulletDynamics/Dynamics/btRigidBody.h      |  691 -----
+ .../Dynamics/btSimpleDynamicsWorld.cpp             |  280 --
+ .../Dynamics/btSimpleDynamicsWorld.h               |   89 -
+ .../BulletDynamics/Vehicle/btRaycastVehicle.cpp    |  771 ------
+ .../src/BulletDynamics/Vehicle/btRaycastVehicle.h  |  236 --
+ .../BulletDynamics/Vehicle/btVehicleRaycaster.h    |   35 -
+ .../src/BulletDynamics/Vehicle/btWheelInfo.cpp     |   56 -
+ .../src/BulletDynamics/Vehicle/btWheelInfo.h       |  119 -
+ .../GpuSoftBodySolvers/CPU/btSoftBodySolverData.h  |  744 ------
+ .../CPU/btSoftBodySolver_CPU.cpp                   |  979 -------
+ .../GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h  |  370 ---
+ hkl3d/bullet/src/BulletMultiThreaded/HeapManager.h |  117 -
+ .../src/BulletMultiThreaded/Makefile.original      |  187 --
+ hkl3d/bullet/src/BulletMultiThreaded/MiniCL.cpp    |  517 ----
+ .../BulletMultiThreaded/MiniCLTask/MiniCLTask.cpp  |   74 -
+ .../BulletMultiThreaded/MiniCLTask/MiniCLTask.h    |   62 -
+ .../BulletMultiThreaded/MiniCLTaskScheduler.cpp    |  519 ----
+ .../src/BulletMultiThreaded/MiniCLTaskScheduler.h  |  194 --
+ .../src/BulletMultiThreaded/PlatformDefinitions.h  |   99 -
+ .../src/BulletMultiThreaded/PosixThreadSupport.cpp |  399 ---
+ .../src/BulletMultiThreaded/PosixThreadSupport.h   |  142 -
+ .../src/BulletMultiThreaded/PpuAddressSpace.h      |   37 -
+ .../SequentialThreadSupport.cpp                    |  169 --
+ .../BulletMultiThreaded/SequentialThreadSupport.h  |   96 -
+ .../SpuCollisionObjectWrapper.cpp                  |   48 -
+ .../SpuCollisionObjectWrapper.h                    |   40 -
+ .../SpuCollisionTaskProcess.cpp                    |  317 ---
+ .../BulletMultiThreaded/SpuCollisionTaskProcess.h  |  163 --
+ .../SpuContactManifoldCollisionAlgorithm.cpp       |   69 -
+ .../SpuContactManifoldCollisionAlgorithm.h         |  120 -
+ .../src/BulletMultiThreaded/SpuDoubleBuffer.h      |  126 -
+ .../bullet/src/BulletMultiThreaded/SpuFakeDma.cpp  |  215 --
+ hkl3d/bullet/src/BulletMultiThreaded/SpuFakeDma.h  |  135 -
+ .../SpuGatheringCollisionDispatcher.cpp            |  275 --
+ .../SpuGatheringCollisionDispatcher.h              |   72 -
+ .../src/BulletMultiThreaded/SpuLibspe2Support.cpp  |  257 --
+ .../src/BulletMultiThreaded/SpuLibspe2Support.h    |  180 --
+ .../SpuNarrowPhaseCollisionTask/Box.h              |  167 --
+ .../SpuCollisionShapes.cpp                         |  302 ---
+ .../SpuCollisionShapes.h                           |  128 -
+ .../SpuContactResult.cpp                           |  248 --
+ .../SpuNarrowPhaseCollisionTask/SpuContactResult.h |  106 -
+ .../SpuConvexPenetrationDepthSolver.h              |   51 -
+ .../SpuGatheringCollisionTask.cpp                  | 1412 ----------
+ .../SpuGatheringCollisionTask.h                    |  140 -
+ .../SpuNarrowPhaseCollisionTask/SpuLocalSupport.h  |   19 -
+ .../SpuMinkowskiPenetrationDepthSolver.cpp         |  348 ---
+ .../SpuMinkowskiPenetrationDepthSolver.h           |   48 -
+ .../SpuPreferredPenetrationDirections.h            |   70 -
+ .../SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp | 1160 ---------
+ .../SpuNarrowPhaseCollisionTask/boxBoxDistance.h   |   65 -
+ .../SpuNarrowPhaseCollisionTask/readme.txt         |    1 -
+ .../SpuSampleTask/SpuSampleTask.cpp                |  214 --
+ .../SpuSampleTask/SpuSampleTask.h                  |   54 -
+ .../BulletMultiThreaded/SpuSampleTask/readme.txt   |    1 -
+ .../BulletMultiThreaded/SpuSampleTaskProcess.cpp   |  222 --
+ .../src/BulletMultiThreaded/SpuSampleTaskProcess.h |  153 --
+ hkl3d/bullet/src/BulletMultiThreaded/SpuSync.h     |  149 --
+ hkl3d/bullet/src/BulletMultiThreaded/TrbDynBody.h  |   79 -
+ hkl3d/bullet/src/BulletMultiThreaded/TrbStateVec.h |  339 ---
+ .../src/BulletMultiThreaded/Win32ThreadSupport.cpp |  446 ----
+ .../src/BulletMultiThreaded/Win32ThreadSupport.h   |  138 -
+ .../BulletMultiThreaded/btGpu3DGridBroadphase.cpp  |  590 -----
+ .../BulletMultiThreaded/btGpu3DGridBroadphase.h    |  138 -
+ .../btGpu3DGridBroadphaseSharedCode.h              |  430 ---
+ .../btGpu3DGridBroadphaseSharedDefs.h              |   61 -
+ .../btGpu3DGridBroadphaseSharedTypes.h             |   67 -
+ .../bullet/src/BulletMultiThreaded/btGpuDefines.h  |  211 --
+ .../src/BulletMultiThreaded/btGpuUtilsSharedCode.h |   55 -
+ .../src/BulletMultiThreaded/btGpuUtilsSharedDefs.h |   52 -
+ .../btParallelConstraintSolver.cpp                 | 1389 ----------
+ .../btParallelConstraintSolver.h                   |  285 --
+ .../btThreadSupportInterface.cpp                   |   22 -
+ .../BulletMultiThreaded/btThreadSupportInterface.h |   85 -
+ .../vectormath/scalar/cpp/boolInVec.h              |  225 --
+ .../vectormath/scalar/cpp/floatInVec.h             |  343 ---
+ .../vectormath/scalar/cpp/mat_aos.h                | 1630 ------------
+ .../vectormath/scalar/cpp/quat_aos.h               |  433 ---
+ .../vectormath/scalar/cpp/vec_aos.h                | 1426 ----------
+ .../vectormath/scalar/cpp/vectormath_aos.h         | 1872 -------------
+ .../src/BulletMultiThreaded/vectormath2bullet.h    |   73 -
+ hkl3d/bullet/src/LinearMath/btAabbUtil2.h          |  236 --
+ hkl3d/bullet/src/LinearMath/btAlignedAllocator.cpp |  182 --
+ hkl3d/bullet/src/LinearMath/btAlignedAllocator.h   |  107 -
+ hkl3d/bullet/src/LinearMath/btAlignedObjectArray.h |  471 ----
+ hkl3d/bullet/src/LinearMath/btConvexHull.cpp       | 1174 ---------
+ hkl3d/bullet/src/LinearMath/btConvexHull.h         |  241 --
+ .../bullet/src/LinearMath/btConvexHullComputer.cpp | 2749 --------------------
+ hkl3d/bullet/src/LinearMath/btConvexHullComputer.h |  103 -
+ hkl3d/bullet/src/LinearMath/btDefaultMotionState.h |   40 -
+ hkl3d/bullet/src/LinearMath/btGeometryUtil.cpp     |  185 --
+ hkl3d/bullet/src/LinearMath/btGeometryUtil.h       |   42 -
+ hkl3d/bullet/src/LinearMath/btHashMap.h            |  450 ----
+ hkl3d/bullet/src/LinearMath/btIDebugDraw.h         |  417 ---
+ hkl3d/bullet/src/LinearMath/btList.h               |   73 -
+ hkl3d/bullet/src/LinearMath/btMatrix3x3.h          |  771 ------
+ hkl3d/bullet/src/LinearMath/btMinMax.h             |   71 -
+ hkl3d/bullet/src/LinearMath/btMotionState.h        |   40 -
+ hkl3d/bullet/src/LinearMath/btPoolAllocator.h      |  121 -
+ hkl3d/bullet/src/LinearMath/btQuadWord.h           |  180 --
+ hkl3d/bullet/src/LinearMath/btQuaternion.h         |  433 ---
+ hkl3d/bullet/src/LinearMath/btQuickprof.cpp        |  565 ----
+ hkl3d/bullet/src/LinearMath/btQuickprof.h          |  196 --
+ hkl3d/bullet/src/LinearMath/btRandom.h             |   42 -
+ hkl3d/bullet/src/LinearMath/btScalar.h             |  522 ----
+ hkl3d/bullet/src/LinearMath/btSerializer.cpp       |  832 ------
+ hkl3d/bullet/src/LinearMath/btSerializer.h         |  655 -----
+ hkl3d/bullet/src/LinearMath/btStackAlloc.h         |  116 -
+ hkl3d/bullet/src/LinearMath/btTransform.h          |  307 ---
+ hkl3d/bullet/src/LinearMath/btTransformUtil.h      |  228 --
+ hkl3d/bullet/src/LinearMath/btVector3.h            |  766 ------
+ hkl3d/bullet/src/Makefile.am                       |  358 ---
+ hkl3d/bullet/src/btBulletCollisionCommon.h         |   69 -
+ hkl3d/bullet/src/btBulletDynamicsCommon.h          |   49 -
+ hkl3d/hkl3d.cpp                                    |    8 +-
+ tests/Makefile.am                                  |    6 +-
+ 388 files changed, 28 insertions(+), 104964 deletions(-)
+
+commit e9a43f6129700071fcef8dfb345e70b8d6147b1b
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Dec 23 15:59:18 2014 +0100
+
+    prepare the NEWS file for the release
+
+ NEWS | 67 ++++++++++++++++++++++++++++++++++++++++++-------------------------
+ 1 file changed, 42 insertions(+), 25 deletions(-)
+
+commit e2f678644e9af6d578fac2fde590602d45a726f3
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Dec 23 13:01:19 2014 +0100
+
+    remove an inconsistancy between the C-API and the bindings.
+
+ Documentation/sphinx/source/bindings/python.py         |  2 +-
+ Documentation/sphinx/source/pyplots/trajectory_full.py |  2 +-
+ hkl/hkl-binding-private.h                              |  6 ------
+ hkl/hkl-binding.c                                      | 15 ---------------
+ hkl/hkl-geometry.c                                     |  2 +-
+ tests/bindings/python.py                               |  2 +-
+ tests/bindings/trajectory.py                           |  2 +-
+ 7 files changed, 5 insertions(+), 26 deletions(-)
+
+commit 367d2097d1b9fedc81a592211b5bc89d14b9f1de
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Dec 23 12:52:07 2014 +0100
+
+    export the pseudo_axes_names in the bindings
+
+ hkl/hkl-binding-private.h |  3 +++
+ hkl/hkl-binding.c         | 16 ++++++++++++++++
+ hkl/hkl-pseudoaxis.c      |  2 +-
+ tests/bindings/python.py  |  1 +
+ 4 files changed, 21 insertions(+), 1 deletion(-)
+
+commit 67a98667c8ce8f2f5a8f2ad1cd5ca844a51f8a3f
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Dec 23 11:47:33 2014 +0100
+
+    fix the documentation
+    
+    now the check target verify that the embeded python code is ok
+
+ Documentation/sphinx/Makefile.am                   |  21 +-
+ Documentation/sphinx/source/bindings/python.py     |  29 +-
+ Documentation/sphinx/source/development.rst        | 477 +++------------------
+ .../sphinx/source/pyplots/trajectory_full.py       |  27 +-
+ .../sphinx/source/pyplots/trajectory_simple.py     |  27 +-
+ hkl/hkl-engine-template.c                          | 164 +++----
+ 6 files changed, 210 insertions(+), 535 deletions(-)
+
+commit d00d42f4e40a1791ab8bed61718db5531e799269
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Fri Dec 19 16:55:16 2014 +0100
+
+    improve the template
+
+ hkl/hkl-engine-template.c | 235 ++++++----------------------------------------
+ 1 file changed, 29 insertions(+), 206 deletions(-)
+
+commit d58be53dd40166a4d72dd2f286e8ed604eba27a5
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Fri Dec 19 16:23:08 2014 +0100
+
+    add a diffractometer's template file for documentation
+    
+    this file is also compiled during the build process to ensure that it
+    can be used by users to add a new diffractometer.
+
+ hkl/Makefile.am           |   4 +
+ hkl/hkl-engine-template.c | 399 ++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 403 insertions(+)
+
+commit ecd831108d721bd5ee6b52aa998b9749332029db
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Dec 18 15:24:14 2014 +0100
+
+    dedup the k6c and k4c kappa_2_kappap method
+
+ hkl/hkl-engine-k4c.c                          | 17 -----------------
+ hkl/hkl-engine-k6c.c                          | 17 -----------------
+ hkl/hkl-pseudoaxis-common-eulerians-private.h |  3 +++
+ hkl/hkl-pseudoaxis-common-eulerians.c         | 17 +++++++++++++++++
+ 4 files changed, 20 insertions(+), 34 deletions(-)
+
+commit fc35217aaedf58b2ca7525a7e3728ecac07b6045
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Dec 18 09:43:42 2014 +0100
+
+    just reorganisation and add a few missing static
+
+ hkl/Makefile.am                       |   2 +-
+ hkl/hkl-engine-e4c.c                  |  12 +-
+ hkl/hkl-engine-e6c.c                  |   4 +-
+ hkl/hkl-engine-k4c.c                  | 129 +++++++++---------
+ hkl/hkl-engine-k6c.c                  |   8 +-
+ hkl/hkl-engine-petra3-p09-eh2.c       | 243 ++++++++++++++++++++++++++++++++++
+ hkl/hkl-engine-petra3.c               | 243 ----------------------------------
+ hkl/hkl-engine-soleil-sirius-turret.c |   2 +-
+ hkl/hkl-engine-soleil-sixs-med.c      |  10 +-
+ hkl/hkl-engine-zaxis.c                |  38 +++---
+ 10 files changed, 337 insertions(+), 354 deletions(-)
+
+commit 1352e6bf6a24f8aa438469ccbd09ccccc5d0ee5b
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Dec 17 21:54:58 2014 +0100
+
+    put the zaxis diffractometers into it's own file
+
+ hkl/Makefile.am                    |   3 +-
+ hkl/hkl-engine-zaxis.c             | 151 +++++++++++++++++++++++++++++++++++++
+ hkl/hkl-factory.c                  |  62 ---------------
+ hkl/hkl-pseudoaxis-zaxis-hkl.c     | 104 -------------------------
+ hkl/hkl-pseudoaxis-zaxis-private.h |  33 --------
+ 5 files changed, 152 insertions(+), 201 deletions(-)
+
+commit 2db9162ac2e2aa1b50879f7649836312cb17bdfa
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Dec 17 21:30:02 2014 +0100
+
+    put the soleil sixs med diffractometers into it's own file
+
+ hkl/Makefile.am                              |   3 +-
+ hkl/hkl-engine-soleil-sixs-med.c             | 451 +++++++++++++++++++++++++++
+ hkl/hkl-factory.c                            | 156 ---------
+ hkl/hkl-pseudoaxis-soleil-sixs-med-private.h |  38 ---
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c         | 309 ------------------
+ 5 files changed, 452 insertions(+), 505 deletions(-)
+
+commit e67fbc0262bcc4c94339ee4c247a74ce3c160d55
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Dec 17 21:19:02 2014 +0100
+
+    put the soleil sirius turret diffractometers into it's own file
+
+ hkl/Makefile.am                                   |   3 +-
+ hkl/hkl-engine-soleil-sirius-turret.c             | 105 ++++++++++++++++++++++
+ hkl/hkl-factory.c                                 |  51 -----------
+ hkl/hkl-pseudoaxis-soleil-sirius-turret-private.h |  33 -------
+ hkl/hkl-pseudoaxis-soleil-sirius-turret.c         |  57 ------------
+ 5 files changed, 106 insertions(+), 143 deletions(-)
+
+commit 7c648a7fbe0b3bcc4a14bdee6c03d8ff0463efcc
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Dec 17 21:06:43 2014 +0100
+
+    put the petra3 diffractometers into it's own file
+
+ hkl/Makefile.am                     |   3 +-
+ hkl/hkl-engine-petra3.c             | 243 ++++++++++++++++++++++++++++++++++++
+ hkl/hkl-factory.c                   |  51 --------
+ hkl/hkl-pseudoaxis-petra3-hkl.c     | 197 -----------------------------
+ hkl/hkl-pseudoaxis-petra3-private.h |  33 -----
+ 5 files changed, 244 insertions(+), 283 deletions(-)
+
+commit 9cf81ca9c2c63c8827e90cc091974c4ab8cc2a79
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Wed Dec 17 16:24:57 2014 +0100
+
+    put the k6c diffractometer family into it's own file
+
+ hkl/Makefile.am                  |    4 +-
+ hkl/hkl-engine-k6c.c             | 1096 ++++++++++++++++++++++++++++++++++++++
+ hkl/hkl-factory.c                |  157 ------
+ hkl/hkl-pseudoaxis-k6c-hkl.c     |  885 ------------------------------
+ hkl/hkl-pseudoaxis-k6c-private.h |   37 --
+ hkl/hkl-pseudoaxis-k6c-psi.c     |   93 ----
+ 6 files changed, 1097 insertions(+), 1175 deletions(-)
+
+commit c23090e19788f8cd3eec59414f6203a68c265c31
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Wed Dec 17 15:56:15 2014 +0100
+
+    put the e6c diffractometer into it's own file
+
+ hkl/Makefile.am                  |   4 +-
+ hkl/hkl-engine-e6c.c             | 399 +++++++++++++++++++++++++++++++++++++++
+ hkl/hkl-factory.c                |  53 ------
+ hkl/hkl-pseudoaxis-e6c-hkl.c     | 314 ------------------------------
+ hkl/hkl-pseudoaxis-e6c-private.h |  34 ----
+ hkl/hkl-pseudoaxis-e6c-psi.c     |  66 -------
+ 6 files changed, 400 insertions(+), 470 deletions(-)
+
+commit e94032963201554debe6a18715979446e489a504
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Wed Dec 17 15:38:05 2014 +0100
+
+    put all the k4c diffractometer into it's own file
+
+ hkl/Makefile.am                   |   4 +-
+ hkl/hkl-engine-k4c.c              | 475 ++++++++++++++++++++++++++++++++++++++
+ hkl/hkl-factory.c                 |  83 -------
+ hkl/hkl-pseudoaxis-k4cv-hkl.c     | 344 ---------------------------
+ hkl/hkl-pseudoaxis-k4cv-private.h |  34 ---
+ hkl/hkl-pseudoaxis-k4cv-psi.c     |  65 ------
+ 6 files changed, 476 insertions(+), 529 deletions(-)
+
+commit a6bd565e4bdcc828e3871b28bb0832316718bf76
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Wed Dec 17 15:20:58 2014 +0100
+
+    put the e4c diffractometer family into it's own file
+
+ hkl/Makefile.am                  |   4 +-
+ hkl/hkl-engine-e4c.c             | 344 +++++++++++++++++++++++++++++++++++++++
+ hkl/hkl-factory.c                | 141 ----------------
+ hkl/hkl-pseudoaxis-e4c-hkl.c     | 178 --------------------
+ hkl/hkl-pseudoaxis-e4c-private.h |  34 ----
+ hkl/hkl-pseudoaxis-e4c-psi.c     |  57 -------
+ 6 files changed, 345 insertions(+), 413 deletions(-)
+
+commit cc40715bbacbe6ce1c254b5d6e8ba2d84d9d983e
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Wed Dec 17 14:50:39 2014 +0100
+
+    put the twoC diffractometer into it's own file
+
+ hkl/Makefile.am           |  1 +
+ hkl/hkl-engine-2c.c       | 63 +++++++++++++++++++++++++++++++++++++++++++++++
+ hkl/hkl-factory-private.h | 10 ++++++++
+ hkl/hkl-factory.c         | 50 +------------------------------------
+ 4 files changed, 75 insertions(+), 49 deletions(-)
+
+commit 71cbece4b394829bc2220771e295060c5338f470
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Tue Oct 14 21:38:09 2014 +0200
+
+    add the begining of an haskell implementation of hkl
+
+ contrib/hkl.lhs | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 64 insertions(+)
+
+commit 3eddf7c4262bd318d0c48f53f1036ca8dc67afd9
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Oct 11 19:11:40 2014 +0200
+
+    now the gui can find the .ui files when installed
+
+ TODO                     |   4 +-
+ gui/Makefile.am          |   1 +
+ gui/hkl-gui-3d.c         |  97 +++++------
+ gui/hkl-gui-macros.h     |  52 ++++++
+ gui/hkl-gui-pseudoaxes.c |  23 +--
+ gui/hkl-gui.c            | 433 ++++++++++++++++++++++++-----------------------
+ gui/hkl-gui.h            |   8 -
+ gui/pseudo.ui            |  12 +-
+ 8 files changed, 340 insertions(+), 290 deletions(-)
+
+commit eead998dafd5f68519ce8652fff7f9c681bef63b
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Fri Oct 10 16:43:13 2014 +0200
+
+    wip logging (unactivated for now)
+    
+    it was just added for a test in the tango devices.
+
+ TODO                 |  3 ++-
+ hkl/Makefile.am      |  1 +
+ hkl/hkl-geometry.c   | 10 +++++-----
+ hkl/hkl-pseudoaxis.c | 42 ++++++++++++++++++++++++++++++++++--------
+ 4 files changed, 42 insertions(+), 14 deletions(-)
+
+commit 1f2928a9a6f3d2c4550bbce6dc3b4763ab6d1a49
+Merge: b2c4731 db07452
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Oct 8 21:23:52 2014 +0200
+
+    Merge branch 'maint' into next
+
+commit b2c473171eb9286b8d6e4df5313c9d50cd120680
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Oct 7 15:05:13 2014 +0200
+
+    editing the pseudo axes panel display the raised errors.
+
+ gui/hkl-gui-pseudoaxes.c | 63 +++++++++++++++------------------------
+ gui/hkl-gui-pseudoaxes.h |  2 ++
+ gui/hkl-gui.c            | 77 ++++++++++++++++++++++++++++++++++--------------
+ 3 files changed, 80 insertions(+), 62 deletions(-)
+
+commit a68301e83ceead0cb67d25fa70b90de0daeb6776
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Oct 7 14:08:32 2014 +0200
+
+    display the error when no computation is done.
+
+ gui/hkl-gui.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit dacfd2e4e0f4a3ec8ae62b3ea96ed3681eff7b9a
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Fri Oct 3 16:33:41 2014 +0200
+
+    remove all the c++ part of the gui.
+
+ configure.ac                  |   3 -
+ gui/Makefile.am               |  18 +-
+ gui/hkl-gui-3d-gl.c           | 808 ++++++++++++++++++++++++++++++++++++++++++
+ gui/hkl-gui-3d-gl.h           |  64 ++++
+ gui/hkl-gui-3d.c              |  14 +-
+ gui/hkl-gui-3d.h              |  57 ---
+ gui/hkl-gui.c                 |  12 +-
+ gui/hkl3d/GL_ShapeDrawer.cpp  | 805 -----------------------------------------
+ gui/hkl3d/GL_ShapeDrawer.h    | 111 ------
+ gui/hkl3d/Makefile.am         |  47 ---
+ gui/hkl3d/hkl3d-gui-gl.c      | 808 ------------------------------------------
+ gui/hkl3d/hkl3d-gui-gl.h      |  64 ----
+ gui/hkl3d/hkl3d-gui-model.cpp | 407 ---------------------
+ gui/hkl3d/hkl3d-gui-model.h   | 121 -------
+ gui/hkl3d/hkl3d-gui-scene.cpp | 486 -------------------------
+ gui/hkl3d/hkl3d-gui-scene.h   | 120 -------
+ gui/hkl3d/hkl3d-gui-view.cpp  | 222 ------------
+ gui/hkl3d/hkl3d-gui-view.h    | 109 ------
+ gui/hkl3d/texture.c           |  42 ---
+ gui/hkl3d/texture.h           |  30 --
+ gui/hkl3d/trackball.c         | 323 -----------------
+ gui/hkl3d/trackball.h         |  77 ----
+ 22 files changed, 893 insertions(+), 3855 deletions(-)
+
+commit 49736e293ed32ff36586e13fd89ab98e029b9a93
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Fri Oct 3 14:52:02 2014 +0200
+
+    add a few togglebutton for the 3d view (reset and aabb)
+
+ gui/3d.ui        |  32 +++++++++++++
+ gui/hkl-gui-3d.c | 138 +++++++++++++++++++++++++++++++++++++++++--------------
+ 2 files changed, 135 insertions(+), 35 deletions(-)
+
+commit 57ceace375f76278e23696a0e0b863c114793a4a
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Thu Oct 2 21:42:28 2014 +0200
+
+    draw the aabb boxes
+
+ gui/hkl-gui-3d.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ hkl3d/hkl3d.cpp  | 14 ++++++++++
+ hkl3d/hkl3d.h    |  1 +
+ 3 files changed, 97 insertions(+)
+
+commit 0521911a1a13a46f7ae1a776bb7d6575294325d5
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 29 16:48:39 2014 +0200
+
+    better 3d shift (should be enhanced)
+
+ gui/hkl-gui-3d.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 695f4cc3d3006d5ee6b02c74b08758575a20f493
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 29 16:38:43 2014 +0200
+
+    add draw_collision
+
+ gui/hkl-gui-3d.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++----
+ 1 file changed, 83 insertions(+), 6 deletions(-)
+
+commit 78e8e2c0916e1c2a641108f770f4d01a1a91f3b9
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 29 15:42:57 2014 +0200
+
+    add the 3d object selection
+
+ gui/hkl-gui-3d.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 83 insertions(+), 2 deletions(-)
+
+commit 3dac7b9288d0d49ec588af6fcd4c036d52941268
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 29 15:10:17 2014 +0200
+
+    wip migrate 3d scene to C
+
+ gui/3d.ui                |  12 +-
+ gui/Makefile.am          |   5 +-
+ gui/hkl-gui-3d.c         | 344 ++++++++++++++++++++++++++++++++++++++++++++++-
+ gui/hkl3d/hkl3d-gui-gl.c |   8 +-
+ 4 files changed, 355 insertions(+), 14 deletions(-)
+
+commit ecc3f6f0b791b642c1122ddd130d63cc09a708c8
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Sep 25 09:49:42 2014 +0200
+
+    re-add the c++ 3d part
+
+ gui/3d.ui                     |  179 ++--
+ gui/Makefile.am               |   27 +-
+ gui/g3d.vapi                  |   55 --
+ gui/gl.vapi                   | 1402 ----------------------------
+ gui/glu.vapi                  |  301 ------
+ gui/glut.vapi                 |  611 ------------
+ gui/glx.vapi                  |  202 ----
+ gui/gtkglext-1.0.vapi         |  373 --------
+ gui/hkl-gui-3d.c              |  508 ++++++++++
+ gui/hkl-gui-3d.h              |  109 +++
+ gui/hkl-gui-3d.vala           |  271 ------
+ gui/hkl-gui-pseudoaxes.c      |    1 -
+ gui/hkl-gui.c                 |  339 +++----
+ gui/hkl-gui.h                 |    8 +
+ gui/hkl-gui.vala              | 2075 -----------------------------------------
+ gui/hkl.vapi                  |  190 ----
+ gui/hkl3d-gui-model.vala      |  527 -----------
+ gui/hkl3d-gui-scene.vala      |  373 --------
+ gui/hkl3d-gui-view.vala       |  218 -----
+ gui/hkl3d.vapi                |  110 ---
+ gui/hkl3d/Makefile.am         |   24 +-
+ gui/hkl3d/hkl3d-gui-model.cpp |  407 ++++++++
+ gui/hkl3d/hkl3d-gui-model.h   |  121 +++
+ gui/hkl3d/hkl3d-gui-scene.cpp |  486 ++++++++++
+ gui/hkl3d/hkl3d-gui-scene.h   |  120 +++
+ gui/hkl3d/hkl3d-gui-view.cpp  |  222 +++++
+ gui/hkl3d/hkl3d-gui-view.h    |  109 +++
+ gui/trackball.vapi            |   36 -
+ hkl3d/hkl3d.cpp               |   15 +
+ 29 files changed, 2354 insertions(+), 7065 deletions(-)
+
+commit db074524dc45608f238add5caf1d0bf2bfdc5c66
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 22 14:54:11 2014 +0200
+
+    release the 4.0.9 version
+
+ hkl/pom.xml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 41a52f52cbbe3345484a99f1d341e7241a19bd16
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 22 14:46:00 2014 +0200
+
+    fix the SOLEIL sirius kappa géométrie pseudo axes.
+    
+    delta is in the horizontal plan (not the vertical one).
+
+ hkl/hkl-pseudoaxis-factory.c |   9 +-
+ hkl/hkl-pseudoaxis-k6c-hkl.c | 214 +++++++++++++++++++++++++++++++++++++++++++
+ hkl/hkl-pseudoaxis-k6c-psi.c |  17 ++++
+ hkl/hkl-pseudoaxis-k6c.h     |   3 +
+ 4 files changed, 242 insertions(+), 1 deletion(-)
+
+commit b3c9d6029fc81d973ae027750a47f1b9f9996bb1
+Merge: ce4c831 79e3766
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 15 16:38:07 2014 +0200
+
+    wip Merge branch 'next' into gtk
+    
+    Conflicts:
+    	gui/hkl-gui-3d.cpp
+    	gui/hkl-gui-3d.h
+    	gui/hkl-gui-callbacks.cpp
+    	gui/hkl-gui-modelcolumns.h
+    	gui/hkl-gui-pseudoaxes.cpp
+    	gui/hkl-gui-pseudoaxes.h
+    	gui/hkl-gui.cpp
+    	gui/hkl-gui.h
+    	gui/hkl3d/hkl3d-gui-model.cpp
+    	gui/hkl3d/hkl3d-gui-model.h
+    	gui/hkl3d/hkl3d-gui-scene.cpp
+    	gui/hkl3d/hkl3d-gui-scene.h
+    	gui/hkl3d/hkl3d-gui-view.cpp
+    	gui/hkl3d/hkl3d-gui-view.h
+    	hkl.h
+    	hkl/hkl-binding-private.h
+    	hkl/hkl-pseudoaxis-common-hkl.c
+    	hkl/hkl-pseudoaxis.c
+    	hkl/hkl-sample.c
+    	tests/hkl-sample-t.c
+
+commit 79e37666ba17baba279fa000c95fe5c781698e6c
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Fri Sep 12 14:06:36 2014 +0200
+
+    fix the refactoring script
+
+ scripts/refactoring | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit a9b9635ef9331156a24492094d5b0a90eb0df7a3
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Sep 11 11:54:57 2014 +0200
+
+    refactor using detector.cocci
+    @@
+    @@
+    
+    -hkl_detector_idx_set(...);
+    
+    @@
+    identifier detector;
+    @@
+    
+    HklDetector *detector;
+    ...
+    - 0 == detector->idx
+    + 1 == detector->idx
+
+ gui/hkl-gui.cpp                          |  1 -
+ hkl.h                                    |  2 --
+ hkl/hkl-detector.c                       | 14 +-------------
+ scripts/detector.cocci                   | 14 ++++++++++++++
+ scripts/refactoring                      |  6 +++---
+ tests/bindings/python.py                 |  6 ------
+ tests/bindings/trajectory.py             |  1 -
+ tests/hkl-bench-t.c                      |  2 --
+ tests/hkl-detector-t.c                   |  9 +++++++--
+ tests/hkl-pseudoaxis-e4ch-t.c            |  6 ------
+ tests/hkl-pseudoaxis-e4cv-t.c            |  6 ------
+ tests/hkl-pseudoaxis-e6c-t.c             |  5 -----
+ tests/hkl-pseudoaxis-k4cv-t.c            |  3 ---
+ tests/hkl-pseudoaxis-k6c-t.c             |  4 ----
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c |  2 --
+ tests/hkl-pseudoaxis-t.c                 |  3 ---
+ tests/hkl-pseudoaxis-zaxis-t.c           |  1 -
+ tests/hkl-sample-t.c                     |  7 -------
+ 18 files changed, 25 insertions(+), 67 deletions(-)
+
+commit e9883e5f6082f987ece17721037ba55d6a46eff1
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 8 13:29:24 2014 +0200
+
+    simplify the axes_names_get unit test and use the TEST_FOREACH_MODE macro
+
+ tests/hkl-pseudoaxis-t.c | 66 ++++++++++++++++++++----------------------------
+ 1 file changed, 28 insertions(+), 38 deletions(-)
+
+commit a21f43b3711baeed8b786988c5ede352262b7255
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 8 13:15:46 2014 +0200
+
+    add the HklEngine parameters unit tests
+
+ hkl/hkl-pseudoaxis.c     |  6 +++--
+ tests/hkl-pseudoaxis-t.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++-
+ 2 files changed, 66 insertions(+), 3 deletions(-)
+
+commit c6f5a20a1753f97497419800c0678e05e47a24aa
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 8 12:09:51 2014 +0200
+
+    add the hkl_egnine_current_mode_get/set tests
+
+ tests/hkl-pseudoaxis-t.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 46 insertions(+), 1 deletion(-)
+
+commit 5f9c48a39607c8e81fcd5492772a64a766bc8795
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 8 11:43:25 2014 +0200
+
+    refactor using diag.cocci
+    
+    @@
+    identifier res;
+    expression E;
+    @@
+    
+    (
+    res &= DIAG(E);
+    |
+    -res &= E;
+    +res &= DIAG(E);
+    )
+
+ scripts/diag.cocci                       | 13 ++++++++
+ scripts/refactoring                      |  6 ++--
+ tests/hkl-pseudoaxis-e4ch-t.c            | 28 ++++++++---------
+ tests/hkl-pseudoaxis-e4cv-t.c            | 30 +++++++++---------
+ tests/hkl-pseudoaxis-e6c-t.c             | 52 ++++++++++++++------------------
+ tests/hkl-pseudoaxis-k4cv-t.c            | 10 +++---
+ tests/hkl-pseudoaxis-k6c-t.c             | 14 ++++-----
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c |  2 +-
+ tests/hkl-pseudoaxis-zaxis-t.c           |  2 +-
+ tests/hkl-unit-t.c                       |  9 +++---
+ tests/hkl3d-test-t.c                     | 21 +++++++------
+ 11 files changed, 98 insertions(+), 89 deletions(-)
+
+commit ad332d062ff7427fb7e7d908e0855ad1bbb32dde
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 8 11:24:59 2014 +0200
+
+    move the DAIG macro into the hkl-tap.h header.
+    
+    This way it will be possible to use it everywhere in the tests
+
+ tests/hkl-pseudoaxis-t.c | 10 ----------
+ tests/tap/hkl-tap.h      | 11 +++++++++++
+ 2 files changed, 11 insertions(+), 10 deletions(-)
+
+commit d5614417c569af92e6358f2a9df4a40b979178ba
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Tue Sep 2 21:40:42 2014 +0200
+
+    refactor using OK.cocci
+    
+    @@
+    identifier res, f;
+    expression E;
+    @@
+    
+    (
+    res &= DIAG(E);
+    |
+    -res &= E;
+    +res &= DIAG(E);
+    )
+
+ hkl/hkl-pseudoaxis-auto-private.h       |   1 +
+ hkl/hkl-pseudoaxis-common-hkl-private.h |   1 +
+ scripts/OK.cocci                        |  13 ++++
+ scripts/refactoring                     |   3 +-
+ tests/hkl-pseudoaxis-t.c                | 103 ++++++++++++++++----------------
+ 5 files changed, 69 insertions(+), 52 deletions(-)
+
+commit de7e77691f3d20382b973a24ee53769e118961f2
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Sep 2 16:24:26 2014 +0200
+
+    better diagnostique during test for loop
+
+ tests/Makefile.am        |  2 +-
+ tests/hkl-pseudoaxis-t.c | 46 +++++++++++++++++++++++++---------------------
+ 2 files changed, 26 insertions(+), 22 deletions(-)
+
+commit a610d680e148a1c2d1c547f744081979c1eb8f79
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Sep 2 13:33:27 2014 +0200
+
+    modify the refactoring path to use cocci files
+
+ scripts/refactoring | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+commit ceb1f416ce75ee0e1a0ffad6d36a9ff330eb03c4
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Sep 2 13:25:11 2014 +0200
+
+    rewrite the HklEngine check for all mode
+
+ tests/hkl-pseudoaxis-t.c | 249 +++++++++++++++++++++--------------------------
+ 1 file changed, 112 insertions(+), 137 deletions(-)
+
+commit 6e6f0eb789fe922222c0463c43f129ecf0f2f9a1
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Sep 2 10:29:52 2014 +0200
+
+    add the hkl_engine_initialized unit test
+
+ tests/hkl-pseudoaxis-t.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 52 insertions(+), 2 deletions(-)
+
+commit 967a5f8d8948b4b4293efbbcd31407fa95802b16
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Sep 2 10:07:45 2014 +0200
+
+    rework the hkl_engine_capabilities unit test
+
+ tests/hkl-pseudoaxis-t.c | 36 +++++++++++++-----------------------
+ 1 file changed, 13 insertions(+), 23 deletions(-)
+
+commit e272b8bbb7c776b110f0da8aeb8e0d5510a44ef1
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Sep 2 09:49:04 2014 +0200
+
+    add hkl_engine_pseudo_axis_get GError unit test
+
+ tests/hkl-pseudoaxis-t.c | 40 +++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 39 insertions(+), 1 deletion(-)
+
+commit 10479d607cff479a4936d76777be5b80243dbfdf
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 1 16:57:43 2014 +0200
+
+    rework and add the pseudoaxis GError unit test
+
+ tests/hkl-pseudoaxis-t.c | 230 ++++++++++++++++++++++++++++++++---------------
+ 1 file changed, 160 insertions(+), 70 deletions(-)
+
+commit 22c69ea33f567b1acc7183d6f8ecfc88c0e90c4e
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 1 15:32:47 2014 +0200
+
+    fix warning in lattice test
+
+ tests/hkl-lattice-t.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit ee1d127dd40ccae39e303d2cf8bcfb6e13de072e
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 1 15:29:19 2014 +0200
+
+    use is_matrix everywhere
+    
+    first use of the coccinelle software to do this change, except the #include
+    addition.
+
+ scripts/is_matrix.spatch | 14 ++++++++++++++
+ tests/hkl-lattice-t.c    |  5 +++--
+ tests/hkl-quaternion-t.c |  3 ++-
+ tests/hkl-sample-t.c     | 14 +++++++-------
+ 4 files changed, 26 insertions(+), 10 deletions(-)
+
+commit 4fc8bf5ec1d9824a242c55ebb7b4114db4a332ac
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 1 14:40:48 2014 +0200
+
+    add hkl-sample unit test with GError
+
+ hkl/hkl-sample-private.h |  13 +++
+ hkl/hkl-sample.c         | 210 +++++++++++++++++++++++++++++++----------------
+ tests/hkl-sample-t.c     | 161 +++++++++++++++++++++++++-----------
+ tests/tap/hkl-tap.c      |  23 ++++++
+ tests/tap/hkl-tap.h      |   3 +
+ 5 files changed, 288 insertions(+), 122 deletions(-)
+
+commit 96c7b0eb5ce747b56ac447a25bbedff5c4ff9459
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Aug 9 10:32:44 2014 +0200
+
+    get rid of all warning generated by unuser-result in hkl-sample-t
+
+ tests/hkl-sample-t.c | 52 ++++++++++++++++++++++++++--------------------------
+ 1 file changed, 26 insertions(+), 26 deletions(-)
+
+commit 6559108a0e7f2e46bd5ad23db2f670e4ef4e288e
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Fri Aug 8 17:30:04 2014 +0200
+
+    add HKL_WARN_UNUSED_RESULT for the public API
+    
+    if an hkl user does not use a return value from a method marked with this
+    attribute, a warning is displayed during the compilation.
+    
+    for now only the method throwing a GError are instrumented. It is a good
+    reminder to deal with the GError.
+    
+    BEWARE this warn is not activated for the libhkl compilation itself
+    using the CFLAGS -Wno-unused-result.
+
+ hkl.h           | 73 +++++++++++++++++++++++++++++++--------------------------
+ hkl/Makefile.am |  3 ++-
+ 2 files changed, 42 insertions(+), 34 deletions(-)
+
+commit a1aed94bc236e6ddcecdd9ea8739bfc2f64765c7
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Fri Aug 8 16:46:19 2014 +0200
+
+    typo
+
+ tests/hkl-lattice-t.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+commit 305d3d741e4b8804793f0ac41316b325244a9a64
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Fri Aug 8 16:44:32 2014 +0200
+
+    Add all the lattice Error check
+
+ hkl/hkl-parameter-private.h |   1 +
+ tests/hkl-lattice-t.c       | 132 ++++++++++++++++++++++++++++++++++----------
+ 2 files changed, 103 insertions(+), 30 deletions(-)
+
+commit 405bc6411a7cb6e5ce3588f7dc5f9db9ae46cadb
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Fri Aug 8 14:13:02 2014 +0200
+
+    replace g_return_val_if_fail by hkl_error when relevant
+    
+    In case of programming error the programm stop with an abort.
+    Using gdb you can obtain a backtrace with 'bt' command.
+    This hkl_error is like assert except that it is not possible to get rid
+    of them with NDEBUG.
+    
+    Recoverable errors (not due to programming error) are reported via the
+    usual GError system.
+
+ hkl/hkl-axis.c                    |  4 ++--
+ hkl/hkl-binding.c                 |  2 +-
+ hkl/hkl-geometry.c                | 12 ++++++------
+ hkl/hkl-lattice.c                 | 18 +++++++++---------
+ hkl/hkl-macros-private.h          |  6 ++++++
+ hkl/hkl-parameter-private.h       |  4 ++--
+ hkl/hkl-parameter.c               |  2 +-
+ hkl/hkl-pseudoaxis-auto-private.h |  2 +-
+ hkl/hkl-pseudoaxis-auto.c         |  2 +-
+ hkl/hkl-pseudoaxis-common-hkl.c   |  2 +-
+ hkl/hkl-pseudoaxis-common-psi.c   |  2 +-
+ hkl/hkl-pseudoaxis-private.h      |  4 ++--
+ hkl/hkl-pseudoaxis.c              | 24 ++++++++++++------------
+ hkl/hkl-sample.c                  | 10 +++++-----
+ tests/hkl-geometry-t.c            |  3 +--
+ 15 files changed, 51 insertions(+), 46 deletions(-)
+
+commit 3d3ab4a7358c1b691c0c1bcc1025a8019ab83957
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Aug 7 16:48:16 2014 +0200
+
+    add all HklGeometry error tests
+
+ hkl/hkl-geometry.c     |  3 ++-
+ tests/hkl-geometry-t.c | 47 +++++++++++++++++++++++++++++------------------
+ 2 files changed, 31 insertions(+), 19 deletions(-)
+
+commit 8d5f2194fe38d13dc4c7928d02bf95d45247b59b
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Aug 7 16:08:20 2014 +0200
+
+    add all HklParameter tests
+
+ tests/hkl-parameter-t.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+commit 412cbe4a8582de54112ceedafcbeb040188f468e
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Aug 7 14:37:29 2014 +0200
+
+    rename hkl_factory_axes_names_get -> hkl_geometry_axes_names_get
+
+ gui/hkl-gui-modelcolumns.h   |  4 ++--
+ gui/hkl-gui.cpp              |  8 ++++----
+ hkl.h                        |  7 ++++---
+ hkl/hkl-binding-private.h    |  7 ++++---
+ hkl/hkl-binding.c            | 18 +++++++++---------
+ hkl/hkl-factory-private.h    | 12 ++++++++++++
+ hkl/hkl-factory.c            | 25 -------------------------
+ hkl/hkl-geometry.c           | 14 ++++++++++++++
+ tests/bindings/python.py     |  8 +-------
+ tests/bindings/trajectory.py |  8 ++++----
+ tests/hkl-pseudoaxis-t.c     |  5 ++++-
+ 11 files changed, 58 insertions(+), 58 deletions(-)
+
+commit defdc993693be7c258bfb3b06e2c3d9f499a8043
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Jul 11 16:36:55 2014 +0200
+
+    add an unit test for the soleil med 2+3 diffractometer.
+
+ hkl/hkl-pseudoaxis-auto-private.h        |  2 +-
+ hkl/hkl-pseudoaxis-auto.c                | 33 ++++++++++++++-
+ hkl/hkl-pseudoaxis-common-hkl.c          |  4 +-
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c     | 12 +++---
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c | 69 +++++++++++++++++++++++++++++++-
+ 5 files changed, 108 insertions(+), 12 deletions(-)
+
+commit 46ca796c6d93bd594389214c07e1a2fbe1e558b1
+Author: cristal <cristal at stomoxe.synchrotron-soleil.fr>
+Date:   Thu Jul 10 13:49:20 2014 +0200
+
+    remove the hkl_engine_list_pseudo_axis_get_by_name
+
+ hkl.h                |  4 ----
+ hkl/hkl-pseudoaxis.c | 35 -----------------------------------
+ 2 files changed, 39 deletions(-)
+
+commit a9a85663ed5dd8686b0cd84aa7bd07be4069e482
+Author: cristal <cristal at stomoxe.synchrotron-soleil.fr>
+Date:   Thu Jul 10 10:55:09 2014 +0200
+
+    hkl_geometry_new_copy is now part of the public API
+
+ hkl.h                      | 2 ++
+ hkl/hkl-geometry-private.h | 2 --
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+commit e716485b9b6338c3d004e0a4199879b2d713c1c8
+Author: cristal <cristal at stomoxe.synchrotron-soleil.fr>
+Date:   Thu Jul 10 10:47:47 2014 +0200
+
+    now the hkl_lattice_get/get take an HklUnitEnum.
+
+ hkl.h                        |  5 ++--
+ hkl/hkl-lattice.c            | 53 +++++++++++++++++++++++----------
+ tests/bindings/python.py     | 22 +++++++-------
+ tests/bindings/trajectory.py | 12 ++++----
+ tests/hkl-lattice-t.c        | 70 +++++++++++++++++++++++---------------------
+ tests/hkl-sample-t.c         |  5 ++--
+ 6 files changed, 96 insertions(+), 71 deletions(-)
+
+commit 1b5e517ce4fd7bc0509ed022b525c96aa4b35a4a
+Author: cristal <cristal at stomoxe.synchrotron-soleil.fr>
+Date:   Wed Jul 9 16:09:40 2014 +0200
+
+    change the HklEngineInfo pseudo_axes from const char * -> darray_string
+
+ hkl/hkl-pseudoaxis-common-eulerians.c |  4 +---
+ hkl/hkl-pseudoaxis-common-hkl.c       |  3 +--
+ hkl/hkl-pseudoaxis-common-psi.c       |  3 +--
+ hkl/hkl-pseudoaxis-common-q.c         |  9 +++------
+ hkl/hkl-pseudoaxis-private.h          |  3 +--
+ hkl/hkl-pseudoaxis.c                  | 10 +++++-----
+ 6 files changed, 12 insertions(+), 20 deletions(-)
+
+commit ccf4b097757a9a2ddefc6c8f79fe26f290eb5901
+Author: cristal <cristal at stomoxe.synchrotron-soleil.fr>
+Date:   Wed Jul 9 15:43:47 2014 +0200
+
+    remove hkl_return_val_if_fail by its glib counterpart
+
+ hkl/hkl-macros-private.h          | 2 --
+ hkl/hkl-pseudoaxis-auto-private.h | 2 +-
+ hkl/hkl-pseudoaxis-auto.c         | 2 +-
+ hkl/hkl-pseudoaxis-common-hkl.c   | 2 +-
+ hkl/hkl-pseudoaxis-common-psi.c   | 2 +-
+ hkl/hkl-pseudoaxis-private.h      | 4 ++--
+ hkl/hkl-pseudoaxis.c              | 2 +-
+ 7 files changed, 7 insertions(+), 9 deletions(-)
+
+commit 766277463be6e0c0c25b3a78d5ccfe1bbe523954
+Author: cristal <cristal at stomoxe.synchrotron-soleil.fr>
+Date:   Wed Jul 9 15:05:33 2014 +0200
+
+    change the signature of the hkl_factory_axes_names_get
+    
+    now it return a darray_string
+
+ gui/hkl-gui-modelcolumns.h |  8 ++++----
+ gui/hkl-gui.cpp            | 42 +++++++++++++++++++++++-------------------
+ hkl.h                      |  3 +--
+ hkl/hkl-binding-private.h  |  3 +++
+ hkl/hkl-binding.c          | 21 +++++++++++++++++++++
+ hkl/hkl-factory.c          | 26 +++++++++++---------------
+ tests/hkl-pseudoaxis-t.c   | 16 ++++++++--------
+ 7 files changed, 71 insertions(+), 48 deletions(-)
+
+commit 2acc64c6600646e2d57ddd95736013a5b1a791a8
+Author: cristal <cristal at stomoxe.synchrotron-soleil.fr>
+Date:   Wed Jul 9 14:28:21 2014 +0200
+
+    rename hkl_factory_name -> hkl_factory_name_get
+    
+    for consistency
+
+ gui/hkl-gui.cpp    | 2 +-
+ hkl.h              | 2 +-
+ hkl/hkl-binding.c  | 2 +-
+ hkl/hkl-factory.c  | 2 +-
+ hkl/hkl-geometry.c | 2 +-
+ 5 files changed, 5 insertions(+), 5 deletions(-)
+
+commit d76ba68747646261b77a6c557cfad50d4aea7f41
+Author: cristal <cristal at stomoxe.synchrotron-soleil.fr>
+Date:   Wed Jul 9 14:12:44 2014 +0200
+
+    rework the sample reflection part to be similar to HklGeometryList
+    
+    rename hkl_sample_first_reflection_get -> hkl_sample_reflections_first_get
+    rename hkl_sample_next_reflection_get -> hkl_sample_reflections_next_get
+    
+    add
+    
+    hkl_sample_n_reflections_get which return the number of reflection in the list
+    HKL_SAMPLE_REFLECTIONS_FOREACH maxro to iterate over the reflections
+
+ gui/hkl-gui-callbacks.cpp |  4 ++--
+ gui/hkl-gui.cpp           |  4 ++--
+ hkl.h                     | 14 ++++++++++----
+ hkl/hkl-sample-private.h  |  1 +
+ hkl/hkl-sample.c          | 27 ++++++++++++++++++++++-----
+ tests/hkl-sample-t.c      | 13 +++++++++----
+ 6 files changed, 46 insertions(+), 17 deletions(-)
+
+commit 0e23d738e1d4fbfd7077ca9ee08cdb5ace7d957a
+Author: cristal <cristal at stomoxe.synchrotron-soleil.fr>
+Date:   Wed Jul 9 13:46:28 2014 +0200
+
+    make the HklDetector copy constructor public
+
+ hkl.h                      | 6 ++++--
+ hkl/hkl-detector-private.h | 2 --
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+commit 95b91bb89bd1ecb3f5fe103566eebd6f254f542a
+Author: cristal <cristal at stomoxe.synchrotron-soleil.fr>
+Date:   Wed Jul 9 12:39:45 2014 +0200
+
+    add hkl_geometry_axes_values_get/set
+
+ hkl.h                     |  9 ++++++++
+ hkl/hkl-binding-private.h | 12 ++++------
+ hkl/hkl-binding.c         | 33 ++++-----------------------
+ hkl/hkl-geometry.c        | 58 +++++++++++++++++++++++++++++++++++++++++++++++
+ hkl/hkl-pseudoaxis.c      |  6 ++---
+ tests/hkl-geometry-t.c    | 33 ++++++++++++++-------------
+ 6 files changed, 96 insertions(+), 55 deletions(-)
+
+commit dd5f6536e6516ed01a0cf9e1dd2872c66932b5e3
+Author: cristal <cristal at stomoxe.synchrotron-soleil.fr>
+Date:   Wed Jul 9 10:47:23 2014 +0200
+
+    (add hkl_engine_axes_names_get
+    
+    now an HklEngine can return a darray_string of the axes
+    involve where reading or writing on it.
+
+ hkl.h                                     |  9 +++-
+ hkl/hkl-binding-private.h                 |  4 ++
+ hkl/hkl-binding.c                         | 21 ++++++++++
+ hkl/hkl-macros-private.h                  |  2 +
+ hkl/hkl-pseudoaxis-auto-private.h         |  9 ++--
+ hkl/hkl-pseudoaxis-auto.c                 | 13 +++---
+ hkl/hkl-pseudoaxis-common-eulerians.c     |  2 +-
+ hkl/hkl-pseudoaxis-common-hkl.c           | 26 ++++++------
+ hkl/hkl-pseudoaxis-common-psi.c           |  2 +-
+ hkl/hkl-pseudoaxis-common-q.c             |  6 +--
+ hkl/hkl-pseudoaxis-e4c-hkl.c              | 21 ++++++----
+ hkl/hkl-pseudoaxis-e4c-psi.c              |  2 +-
+ hkl/hkl-pseudoaxis-e6c-hkl.c              | 65 ++++++++++++++++------------
+ hkl/hkl-pseudoaxis-e6c-psi.c              |  5 ++-
+ hkl/hkl-pseudoaxis-k4cv-hkl.c             | 12 +++---
+ hkl/hkl-pseudoaxis-k4cv-psi.c             |  2 +-
+ hkl/hkl-pseudoaxis-k6c-hkl.c              | 70 ++++++++++++++++++-------------
+ hkl/hkl-pseudoaxis-k6c-psi.c              |  5 ++-
+ hkl/hkl-pseudoaxis-petra3-hkl.c           | 35 +++++++++-------
+ hkl/hkl-pseudoaxis-private.h              | 32 +++++++-------
+ hkl/hkl-pseudoaxis-soleil-sirius-turret.c |  5 ++-
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c      | 52 +++++++++++++----------
+ hkl/hkl-pseudoaxis-zaxis-hkl.c            |  7 ++--
+ hkl/hkl-pseudoaxis.c                      | 43 +++++++++++++++----
+ tests/bindings/python.py                  |  6 ++-
+ tests/hkl-pseudoaxis-t.c                  | 59 +++++++++++++++++++++++++-
+ 26 files changed, 344 insertions(+), 171 deletions(-)
+
+commit 4553826ef069e20bce620bdd212d5b91b1b63187
+Author: cristal <cristal at stomoxe.synchrotron-soleil.fr>
+Date:   Tue Jul 8 14:41:05 2014 +0200
+
+    move the HklPseudoAxis class into the hkl-pseudoaxis-private part
+
+ hkl.h                        | 1 -
+ hkl/hkl-pseudoaxis-private.h | 1 +
+ 2 files changed, 1 insertion(+), 1 deletion(-)
+
+commit 9abe58b717c585d67e225678233d5eb27f3e1164
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Jul 6 22:02:36 2014 +0200
+
+    (wip) rework of the pseudo axis part
+    
+    now the set method return the HklGeometryList.
+    It is now the responsability of the API user to release the memory
+    by calling hkl_geometry_list_free on the returned geometries.
+    
+    fix the hkl-pseudoaxis-e6c petra2_3 test by using hkl_method_set_hkl_real
+    for the psi_constant_vertical_mode_operations.
+    This setter compute also a set of solutions by using the z-axis strategie
+    which consist in a rotation of the sample around the latest axis and a fit
+    of the detector position.
+    
+    move the hkl_pseudo...randomize methodes into the hkl tap library instead of
+    the public API.
+    
+    - Add the HklEngine Capabilities
+      you can get them with hkl_engine_capabilities_get
+      this tells you if an HklEngine is READABLE, WRITABLE, INITIALIZABLE
+    
+    - add a new hkl_engine_initialized_get/set
+      if an HklEngine is INITIALIZABLE you can set the value to TRUE.
+      depending on the Mode, this can changes the mode parameters, save the
+      diffractometer current position, ...
+
+ Documentation/sphinx/source/development.rst |   2 +-
+ Documentation/sphinx/source/test.py         |   2 +-
+ gui/hkl-gui-callbacks.cpp                   |  27 +-
+ gui/hkl-gui-pseudoaxes.cpp                  |  20 +-
+ gui/hkl-gui.cpp                             |  19 +-
+ gui/hkl-gui.h                               |   2 +-
+ hkl.h                                       |  66 +--
+ hkl/hkl-binding-private.h                   |   4 -
+ hkl/hkl-binding.c                           |  59 ---
+ hkl/hkl-geometry-private.h                  |   2 -
+ hkl/hkl-pseudoaxis-auto-private.h           |  89 ++--
+ hkl/hkl-pseudoaxis-auto.c                   |  38 +-
+ hkl/hkl-pseudoaxis-common-eulerians.c       |  12 +-
+ hkl/hkl-pseudoaxis-common-hkl-private.h     |  16 +-
+ hkl/hkl-pseudoaxis-common-hkl.c             | 116 +++---
+ hkl/hkl-pseudoaxis-common-psi.c             |  79 ++--
+ hkl/hkl-pseudoaxis-common-q.c               |  12 +-
+ hkl/hkl-pseudoaxis-e4c-hkl.c                |  34 +-
+ hkl/hkl-pseudoaxis-e4c-psi.c                |   2 +-
+ hkl/hkl-pseudoaxis-e6c-hkl.c                |  65 +--
+ hkl/hkl-pseudoaxis-e6c-psi.c                |   2 +-
+ hkl/hkl-pseudoaxis-k4cv-hkl.c               |  30 +-
+ hkl/hkl-pseudoaxis-k4cv-psi.c               |   2 +-
+ hkl/hkl-pseudoaxis-k6c-hkl.c                |  72 ++--
+ hkl/hkl-pseudoaxis-k6c-psi.c                |   2 +-
+ hkl/hkl-pseudoaxis-petra3-hkl.c             |  35 +-
+ hkl/hkl-pseudoaxis-private.h                | 622 +++++++++++++++++++++-------
+ hkl/hkl-pseudoaxis-soleil-sirius-turret.c   |   5 +-
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c        |  15 +-
+ hkl/hkl-pseudoaxis-zaxis-hkl.c              |  10 +-
+ hkl/hkl-pseudoaxis.c                        | 509 ++++++-----------------
+ tests/bindings/Makefile.am                  |   2 +-
+ tests/bindings/python.py                    |  33 +-
+ tests/bindings/trajectory.py                |  11 +-
+ tests/hkl-bench-t.c                         |  55 +--
+ tests/hkl-pseudoaxis-e4ch-t.c               | 108 ++---
+ tests/hkl-pseudoaxis-e4cv-t.c               | 101 ++---
+ tests/hkl-pseudoaxis-e6c-t.c                | 144 +++----
+ tests/hkl-pseudoaxis-k4cv-t.c               |  80 ++--
+ tests/hkl-pseudoaxis-k6c-t.c                | 109 +++--
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c    |  19 +-
+ tests/hkl-pseudoaxis-t.c                    |  70 +++-
+ tests/hkl-pseudoaxis-zaxis-t.c              |  15 +-
+ tests/tap/hkl-tap.c                         |  57 ++-
+ tests/tap/hkl-tap.h                         |   8 +-
+ 45 files changed, 1442 insertions(+), 1340 deletions(-)
+
+commit 54c71cf33c5525b5fec485cc4e05173f7f502f9c
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Jun 23 10:36:28 2014 +0200
+
+    run ccan-update
+    
+    this is to prepare the inclusion of htable in the futur.
+
+ hkl/ccan/Makefile.am                 |  22 ++--
+ hkl/ccan/autodata/autodata.h         |   3 +-
+ hkl/ccan/compiler/compiler.h         |  30 +++--
+ hkl/ccan/container_of/container_of.h |   2 +-
+ hkl/ccan/list/list.h                 |  91 ++++++++++----
+ hkl/ccan/str/LICENSE                 |   1 +
+ hkl/ccan/str/debug.c                 | 108 +++++++++++++++++
+ hkl/ccan/str/str.c                   |  13 ++
+ hkl/ccan/str/str.h                   | 228 +++++++++++++++++++++++++++++++++++
+ hkl/ccan/str/str_debug.h             |  30 +++++
+ 10 files changed, 484 insertions(+), 44 deletions(-)
+
+commit 94cb46bab46a187f6a507269f7d31b1906693687
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Jun 22 23:32:42 2014 +0200
+
+    Rework the unit part of the hkl library
+    
+    Prepare the final API for the inclusion of the udunits library.
+    This will allow to set the user unit prefered output of
+    the instrumented methods.
+    
+    until now this was mostly used for radian to degree convertion.
+    But we can imagine other convertions in the futur.
+    
+    the binding API also changed
+
+ gui/hkl-gui-callbacks.cpp                |  66 ++++++-------
+ gui/hkl-gui-modelcolumns.h               |   2 +-
+ gui/hkl-gui-pseudoaxes.cpp               |  11 ++-
+ gui/hkl-gui.cpp                          | 128 +++++++++++++------------
+ hkl.h                                    |  59 +++++++-----
+ hkl/hkl-axis.c                           |  25 +----
+ hkl/hkl-binding-private.h                |  17 ++--
+ hkl/hkl-binding.c                        |  59 +++++-------
+ hkl/hkl-factory.c                        |  30 +++---
+ hkl/hkl-geometry-private.h               |   3 -
+ hkl/hkl-geometry.c                       |  53 +++++------
+ hkl/hkl-lattice.c                        | 123 ++++++++++++++----------
+ hkl/hkl-parameter-private.h              |  26 ++----
+ hkl/hkl-parameter.c                      | 155 +++++++++++++++----------------
+ hkl/hkl-pseudoaxis-auto.c                |   1 +
+ hkl/hkl-pseudoaxis-common-eulerians.c    |   9 +-
+ hkl/hkl-pseudoaxis-common-hkl.c          |  20 ++--
+ hkl/hkl-pseudoaxis-private.h             |   3 +-
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c     |   6 +-
+ hkl/hkl-pseudoaxis.c                     |  17 ++--
+ hkl/hkl-sample.c                         |  86 ++++++++---------
+ hkl/hkl-unit-private.h                   |   2 +-
+ tests/bindings/python.py                 |  31 +++----
+ tests/bindings/trajectory.py             |  18 ++--
+ tests/hkl-axis-t.c                       |  64 ++++++-------
+ tests/hkl-bench-t.c                      |  10 +-
+ tests/hkl-detector-t.c                   |   4 +-
+ tests/hkl-geometry-t.c                   |  65 ++++++-------
+ tests/hkl-lattice-t.c                    | 131 +++++++++++++-------------
+ tests/hkl-parameter-t.c                  |  12 +--
+ tests/hkl-pseudoaxis-e4ch-t.c            |  62 +++++++------
+ tests/hkl-pseudoaxis-e4cv-t.c            |  52 +++++------
+ tests/hkl-pseudoaxis-e6c-t.c             |  54 +++++------
+ tests/hkl-pseudoaxis-k4cv-t.c            |  12 +--
+ tests/hkl-pseudoaxis-k6c-t.c             |  19 ++--
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c |  12 ++-
+ tests/hkl-pseudoaxis-t.c                 |   7 +-
+ tests/hkl-pseudoaxis-zaxis-t.c           |  10 +-
+ tests/hkl-sample-t.c                     |  94 ++++++++++++-------
+ tests/hkl3d-test-t.c                     |  27 +++---
+ tests/tap/hkl-tap.c                      |   4 +-
+ 41 files changed, 817 insertions(+), 772 deletions(-)
+
+commit 44e92c5c15ab05fd489e47bac08bb7b2527c6f25
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Jun 22 08:25:14 2014 +0200
+
+    Add all the GError were it can be usefull for the final API
+    
+    also solve two bugs
+    - an wrong #if -> #ifdef for debugging purpose
+    - another ... variadic issue int -> float in the bench test
+    
+    I should really remove this hkl_geometry_set_values_unit_v method
+    for the final API
+
+ Documentation/api/hkl-docs.sgml          |   3 +-
+ gui/hkl-gui-callbacks.cpp                |  93 +++++++++------
+ gui/hkl-gui-pseudoaxes.cpp               |  16 +--
+ gui/hkl-gui.cpp                          |  12 +-
+ hkl.h                                    | 119 ++++++++++++-------
+ hkl/hkl-axis.c                           |  31 +++--
+ hkl/hkl-binding-private.h                |   3 +-
+ hkl/hkl-binding.c                        |  14 ++-
+ hkl/hkl-factory.c                        |   2 +-
+ hkl/hkl-geometry-private.h               |  17 ++-
+ hkl/hkl-geometry.c                       | 120 ++++++++++++++++---
+ hkl/hkl-lattice-private.h                |  11 ++
+ hkl/hkl-lattice.c                        | 168 +++++++++++++++++---------
+ hkl/hkl-parameter-private.h              |  40 +++++--
+ hkl/hkl-parameter.c                      |  53 ++++++---
+ hkl/hkl-pseudoaxis-common-hkl.c          |   2 +-
+ hkl/hkl-pseudoaxis-private.h             |  41 ++++---
+ hkl/hkl-pseudoaxis.c                     | 198 ++++++++++++++++++++++---------
+ hkl/hkl-sample-private.h                 |  11 ++
+ hkl/hkl-sample.c                         | 106 +++++++++++++----
+ tests/hkl-axis-t.c                       |  10 +-
+ tests/hkl-bench-t.c                      |  19 +--
+ tests/hkl-geometry-t.c                   | 102 ++++++++++++++--
+ tests/hkl-lattice-t.c                    |  57 +++++++--
+ tests/hkl-parameter-t.c                  |  33 +++++-
+ tests/hkl-pseudoaxis-e4ch-t.c            |  55 ++++-----
+ tests/hkl-pseudoaxis-e4cv-t.c            |  55 ++++-----
+ tests/hkl-pseudoaxis-e6c-t.c             |  63 +++++-----
+ tests/hkl-pseudoaxis-k4cv-t.c            |  30 ++---
+ tests/hkl-pseudoaxis-k6c-t.c             |  43 +++----
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c |   8 +-
+ tests/hkl-pseudoaxis-t.c                 |   2 +-
+ tests/hkl-pseudoaxis-zaxis-t.c           |  11 +-
+ tests/hkl-sample-t.c                     | 121 ++++++++++---------
+ 34 files changed, 1139 insertions(+), 530 deletions(-)
+
+commit bb13ab9901ae5f55f360ad01428f7a9192d603ed
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 17 16:03:37 2014 +0200
+
+    use TRUE/FALSE from Glib instead of HKL_TRUE/FALSE
+
+ Documentation/sphinx/source/development.rst |  6 ++--
+ hkl.h                                       |  3 --
+ hkl/hkl-axis.c                              | 20 ++++++------
+ hkl/hkl-detector.c                          |  4 +--
+ hkl/hkl-geometry.c                          | 16 ++++-----
+ hkl/hkl-interval.c                          |  6 ++--
+ hkl/hkl-lattice.c                           | 34 ++++++++++----------
+ hkl/hkl-matrix.c                            | 12 +++----
+ hkl/hkl-parameter-private.h                 | 16 ++++-----
+ hkl/hkl-parameter.c                         |  4 +--
+ hkl/hkl-pseudoaxis-auto-private.h           |  4 +--
+ hkl/hkl-pseudoaxis-auto.c                   | 24 +++++++-------
+ hkl/hkl-pseudoaxis-common-eulerians.c       | 12 +++----
+ hkl/hkl-pseudoaxis-common-hkl.c             | 24 +++++++-------
+ hkl/hkl-pseudoaxis-common-psi.c             | 16 ++++-----
+ hkl/hkl-pseudoaxis-common-q.c               |  6 ++--
+ hkl/hkl-pseudoaxis-private.h                | 12 +++----
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c        |  6 ++--
+ hkl/hkl-pseudoaxis.c                        | 50 ++++++++++++++---------------
+ hkl/hkl-quaternion.c                        |  6 ++--
+ hkl/hkl-sample.c                            | 16 ++++-----
+ hkl/hkl-source.c                            |  6 ++--
+ hkl/hkl-unit.c                              | 12 +++----
+ hkl/hkl-vector.c                            | 24 +++++++-------
+ tests/hkl-axis-t.c                          | 22 ++++++-------
+ tests/hkl-bench-t.c                         |  2 +-
+ tests/hkl-geometry-t.c                      | 10 +++---
+ tests/hkl-interval-t.c                      | 28 ++++++++--------
+ tests/hkl-lattice-t.c                       | 16 ++++-----
+ tests/hkl-matrix-t.c                        | 14 ++++----
+ tests/hkl-parameter-t.c                     | 36 ++++++++++-----------
+ tests/hkl-pseudoaxis-e4ch-t.c               | 24 +++++++-------
+ tests/hkl-pseudoaxis-e4cv-t.c               | 24 +++++++-------
+ tests/hkl-pseudoaxis-e6c-t.c                | 24 +++++++-------
+ tests/hkl-pseudoaxis-k4cv-t.c               | 12 +++----
+ tests/hkl-pseudoaxis-k6c-t.c                | 16 ++++-----
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c    |  4 +--
+ tests/hkl-pseudoaxis-t.c                    | 12 +++----
+ tests/hkl-pseudoaxis-zaxis-t.c              |  6 ++--
+ tests/hkl-quaternion-t.c                    | 18 +++++------
+ tests/hkl-sample-t.c                        | 10 +++---
+ tests/hkl-source-t.c                        |  6 ++--
+ tests/hkl-unit-t.c                          |  4 +--
+ tests/hkl-vector-t.c                        |  4 +--
+ tests/tap/hkl-tap.c                         |  2 +-
+ 45 files changed, 315 insertions(+), 318 deletions(-)
+
+commit 394a29feb6579a84260d8aef04911c074be3e0a3
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 17 15:57:59 2014 +0200
+
+    rename HKL_BEGIN/END_DECLS -> G_BEGIN/END_DECLS
+
+ Documentation/sphinx/source/development.rst       |  4 ++--
+ hkl.h                                             | 13 ++-----------
+ hkl/hkl-axis-private.h                            |  4 ++--
+ hkl/hkl-binding-private.h                         |  4 ++--
+ hkl/hkl-detector-private.h                        |  4 ++--
+ hkl/hkl-factory-private.h                         |  4 ++--
+ hkl/hkl-geometry-private.h                        |  4 ++--
+ hkl/hkl-interval-private.h                        |  6 +++---
+ hkl/hkl-lattice-private.h                         |  4 ++--
+ hkl/hkl-macros-private.h                          |  6 +++---
+ hkl/hkl-matrix-private.h                          |  4 ++--
+ hkl/hkl-parameter-private.h                       |  4 ++--
+ hkl/hkl-pseudoaxis-auto-private.h                 |  4 ++--
+ hkl/hkl-pseudoaxis-common-eulerians-private.h     |  4 ++--
+ hkl/hkl-pseudoaxis-common-psi-private.h           |  4 ++--
+ hkl/hkl-pseudoaxis-common-q-private.h             |  4 ++--
+ hkl/hkl-pseudoaxis-e4c-private.h                  |  6 +++---
+ hkl/hkl-pseudoaxis-e6c-private.h                  |  6 +++---
+ hkl/hkl-pseudoaxis-k4cv-private.h                 |  6 +++---
+ hkl/hkl-pseudoaxis-k6c-private.h                  |  6 +++---
+ hkl/hkl-pseudoaxis-petra3-private.h               |  6 +++---
+ hkl/hkl-pseudoaxis-private.h                      |  4 ++--
+ hkl/hkl-pseudoaxis-soleil-sirius-turret-private.h |  4 ++--
+ hkl/hkl-pseudoaxis-soleil-sixs-med-private.h      |  6 +++---
+ hkl/hkl-pseudoaxis-zaxis-private.h                |  6 +++---
+ hkl/hkl-quaternion-private.h                      |  6 +++---
+ hkl/hkl-sample-private.h                          |  4 ++--
+ hkl/hkl-source-private.h                          |  6 +++---
+ hkl/hkl-unit-private.h                            |  6 +++---
+ hkl/hkl-vector-private.h                          |  6 +++---
+ tests/tap/hkl-tap.h                               |  4 ++--
+ 31 files changed, 75 insertions(+), 84 deletions(-)
+
+commit 9859742e524517d100451a7da65fb552d0a4165d
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 17 15:45:50 2014 +0200
+
+    rename HklError -> GError
+    
+    now GLib is a required dependency. It was tested with the RHEL4 version
+    2.3.4. So this should not be problematic
+
+ Documentation/sphinx/source/development.rst |   5 +-
+ NEWS                                        |   2 +-
+ configure.ac                                |   4 +-
+ gui/hkl-gui.cpp                             |   4 +-
+ gui/hkl-gui.h                               |   2 +-
+ hkl.h                                       |  25 +--
+ hkl/Makefile.am                             |  13 +-
+ hkl/hkl-axis.c                              |   4 +-
+ hkl/hkl-binding.c                           |  20 +-
+ hkl/hkl-error-private.h                     |  72 ------
+ hkl/hkl-error.c                             | 335 ----------------------------
+ hkl/hkl-parameter-private.h                 |   8 +-
+ hkl/hkl-parameter.c                         |   4 +-
+ hkl/hkl-pseudoaxis-auto-private.h           |  21 +-
+ hkl/hkl-pseudoaxis-auto.c                   |  24 +-
+ hkl/hkl-pseudoaxis-common-eulerians.c       |  25 ++-
+ hkl/hkl-pseudoaxis-common-hkl-private.h     |   6 +-
+ hkl/hkl-pseudoaxis-common-hkl.c             |  43 +++-
+ hkl/hkl-pseudoaxis-common-psi.c             |  48 +++-
+ hkl/hkl-pseudoaxis-common-q.c               |   6 +-
+ hkl/hkl-pseudoaxis-private.h                |  33 ++-
+ hkl/hkl-pseudoaxis.c                        |  64 ++++--
+ hkl/hkl-types.c                             |  13 --
+ hkl/hkl-types.h                             |   4 -
+ tests/Makefile.am                           |   6 +-
+ tests/hkl-error-t.c                         | 122 ----------
+ tests/tap/Makefile.am                       |   4 +-
+ 27 files changed, 242 insertions(+), 675 deletions(-)
+
+commit af5978fce0dc396e8c4a4abefeefacd8b0c8e832
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Jun 16 12:33:46 2014 +0200
+
+    rename hkl_engine_parameters_set -> hkl_engine_parameters_values_set
+
+ hkl.h                         |  6 +++---
+ hkl/hkl-pseudoaxis.c          |  8 ++++----
+ tests/hkl-pseudoaxis-e4ch-t.c | 14 +++++++-------
+ tests/hkl-pseudoaxis-e4cv-t.c | 16 ++++++++--------
+ tests/hkl-pseudoaxis-e6c-t.c  | 16 ++++++++--------
+ 5 files changed, 30 insertions(+), 30 deletions(-)
+
+commit 0ac9e22294c48615e8a817c4c1c646fa8f872c64
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Jun 16 13:05:27 2014 +0200
+
+    add a few test to the python binding for engine parameters
+
+ hkl/hkl-binding-private.h | 4 ++--
+ tests/bindings/python.py  | 7 +++++++
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+commit 5270c9f771f99d620845fa0485256c93c1fcd9c7
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Jun 16 11:11:58 2014 +0200
+
+    fix the refactoring script to work directly form its directory
+
+ scripts/refactoring | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+commit 3dc6576ac7241752d2b9d8aa42e98801e1fd2a76
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Jun 16 13:01:03 2014 +0200
+
+    rename hkl_engine_modes_get -> hkl_engine_modes_names_get
+    
+    add also a gdb target to the binding test (this way it is easyer to debug
+    segfaut in the python part.
+
+ gui/hkl-gui-pseudoaxes.cpp    | 2 +-
+ hkl.h                         | 2 +-
+ hkl/hkl-binding-private.h     | 4 ++--
+ hkl/hkl-binding.c             | 6 +++---
+ hkl/hkl-pseudoaxis.c          | 4 ++--
+ tests/bindings/Makefile.am    | 5 ++++-
+ tests/bindings/python.py      | 8 ++++----
+ tests/bindings/trajectory.py  | 2 +-
+ tests/hkl-bench-t.c           | 4 ++--
+ tests/hkl-pseudoaxis-e4ch-t.c | 6 +++---
+ tests/hkl-pseudoaxis-e4cv-t.c | 6 +++---
+ tests/hkl-pseudoaxis-e6c-t.c  | 4 ++--
+ tests/hkl-pseudoaxis-k4cv-t.c | 6 +++---
+ tests/hkl-pseudoaxis-k6c-t.c  | 6 +++---
+ tests/hkl-pseudoaxis-t.c      | 2 +-
+ 15 files changed, 35 insertions(+), 32 deletions(-)
+
+commit cccb4c2b169cd3098fd744d1d0774c9f79dfb1a0
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Jun 16 10:38:24 2014 +0200
+
+    fix the distcheck target
+    
+    with a working graphic card it is now possible to regenerate the
+    documentation figures.
+
+ Documentation/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 442ebce07ded84269838435f847d739b1ad243ff
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Jun 4 18:59:20 2014 +0200
+
+    comment and todo for optimisation
+    
+    on my T40 this todo seems to produce a big increase of time in the bench
+
+ hkl.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit 28eac129b2c804d29793722602fa688cd6cc105e
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Jun 4 12:16:58 2014 +0200
+
+    get rid of all the hkl_parameter_list methods
+
+ hkl/hkl-binding.c               |  92 ++++-------------------------
+ hkl/hkl-parameter-private.h     |  29 +---------
+ hkl/hkl-parameter.c             | 125 ----------------------------------------
+ hkl/hkl-pseudoaxis-common-psi.c |  12 ++--
+ hkl/hkl-pseudoaxis-k4cv-hkl.c   |  30 ++--------
+ hkl/hkl-pseudoaxis-k6c-hkl.c    |  29 +++-------
+ hkl/hkl-pseudoaxis-private.h    |  14 ++++-
+ hkl/hkl-pseudoaxis.c            |  15 ++++-
+ 8 files changed, 57 insertions(+), 289 deletions(-)
+
+commit bebff6f4681465f2f96ac10a5d757b159813478e
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Jun 4 09:48:48 2014 +0200
+
+    forgot one file
+
+ hkl/hkl-pseudoaxis-soleil-sirius-turret.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+commit 624e2ec04d191c347fa6a69b68c863a91afce8ea
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Jun 4 09:44:07 2014 +0200
+
+    upgrading copyright year from 2013 to 2014
+
+ gui/hkl-gui-3d.cpp                            | 2 +-
+ gui/hkl-gui-3d.h                              | 2 +-
+ gui/hkl-gui-callbacks.cpp                     | 2 +-
+ gui/hkl-gui-modelcolumns.h                    | 2 +-
+ gui/hkl-gui-pseudoaxes.cpp                    | 2 +-
+ gui/hkl-gui-pseudoaxes.h                      | 2 +-
+ gui/hkl-gui.cpp                               | 2 +-
+ gui/hkl-gui.h                                 | 2 +-
+ gui/hkl3d/GL_ShapeDrawer.cpp                  | 2 +-
+ gui/hkl3d/GL_ShapeDrawer.h                    | 2 +-
+ gui/hkl3d/hkl3d-gui-model.cpp                 | 2 +-
+ gui/hkl3d/hkl3d-gui-model.h                   | 2 +-
+ gui/hkl3d/hkl3d-gui-scene.cpp                 | 2 +-
+ gui/hkl3d/hkl3d-gui-scene.h                   | 2 +-
+ gui/hkl3d/hkl3d-gui-view.cpp                  | 2 +-
+ gui/hkl3d/hkl3d-gui-view.h                    | 2 +-
+ gui/main.cpp                                  | 2 +-
+ hkl.h                                         | 2 +-
+ hkl/hkl-axis-private.h                        | 2 +-
+ hkl/hkl-axis.c                                | 2 +-
+ hkl/hkl-binding-private.h                     | 2 +-
+ hkl/hkl-binding.c                             | 2 +-
+ hkl/hkl-detector-factory.c                    | 2 +-
+ hkl/hkl-detector-private.h                    | 2 +-
+ hkl/hkl-detector.c                            | 2 +-
+ hkl/hkl-factory-private.h                     | 2 +-
+ hkl/hkl-factory.c                             | 2 +-
+ hkl/hkl-geometry-private.h                    | 2 +-
+ hkl/hkl-geometry.c                            | 2 +-
+ hkl/hkl-interval-private.h                    | 2 +-
+ hkl/hkl-interval.c                            | 2 +-
+ hkl/hkl-lattice-private.h                     | 2 +-
+ hkl/hkl-lattice.c                             | 2 +-
+ hkl/hkl-macros-private.h                      | 2 +-
+ hkl/hkl-macros.c                              | 2 +-
+ hkl/hkl-matrix-private.h                      | 2 +-
+ hkl/hkl-matrix.c                              | 2 +-
+ hkl/hkl-parameter-private.h                   | 2 +-
+ hkl/hkl-parameter.c                           | 2 +-
+ hkl/hkl-pseudoaxis-auto-private.h             | 2 +-
+ hkl/hkl-pseudoaxis-auto.c                     | 2 +-
+ hkl/hkl-pseudoaxis-common-eulerians-private.h | 2 +-
+ hkl/hkl-pseudoaxis-common-eulerians.c         | 2 +-
+ hkl/hkl-pseudoaxis-common-hkl-private.h       | 2 +-
+ hkl/hkl-pseudoaxis-common-hkl.c               | 2 +-
+ hkl/hkl-pseudoaxis-common-psi-private.h       | 2 +-
+ hkl/hkl-pseudoaxis-common-psi.c               | 2 +-
+ hkl/hkl-pseudoaxis-common-q-private.h         | 2 +-
+ hkl/hkl-pseudoaxis-common-q.c                 | 2 +-
+ hkl/hkl-pseudoaxis-e4c-hkl.c                  | 2 +-
+ hkl/hkl-pseudoaxis-e4c-private.h              | 2 +-
+ hkl/hkl-pseudoaxis-e4c-psi.c                  | 2 +-
+ hkl/hkl-pseudoaxis-e6c-hkl.c                  | 2 +-
+ hkl/hkl-pseudoaxis-e6c-private.h              | 2 +-
+ hkl/hkl-pseudoaxis-e6c-psi.c                  | 2 +-
+ hkl/hkl-pseudoaxis-k4cv-hkl.c                 | 2 +-
+ hkl/hkl-pseudoaxis-k4cv-private.h             | 2 +-
+ hkl/hkl-pseudoaxis-k4cv-psi.c                 | 2 +-
+ hkl/hkl-pseudoaxis-k6c-hkl.c                  | 2 +-
+ hkl/hkl-pseudoaxis-k6c-private.h              | 2 +-
+ hkl/hkl-pseudoaxis-k6c-psi.c                  | 2 +-
+ hkl/hkl-pseudoaxis-petra3-hkl.c               | 2 +-
+ hkl/hkl-pseudoaxis-petra3-private.h           | 2 +-
+ hkl/hkl-pseudoaxis-private.h                  | 2 +-
+ hkl/hkl-pseudoaxis-soleil-sixs-med-private.h  | 2 +-
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c          | 2 +-
+ hkl/hkl-pseudoaxis-zaxis-hkl.c                | 2 +-
+ hkl/hkl-pseudoaxis-zaxis-private.h            | 2 +-
+ hkl/hkl-pseudoaxis.c                          | 2 +-
+ hkl/hkl-quaternion-private.h                  | 2 +-
+ hkl/hkl-quaternion.c                          | 2 +-
+ hkl/hkl-sample-private.h                      | 2 +-
+ hkl/hkl-sample.c                              | 2 +-
+ hkl/hkl-source-private.h                      | 2 +-
+ hkl/hkl-source.c                              | 2 +-
+ hkl/hkl-types.c                               | 2 +-
+ hkl/hkl-types.h                               | 2 +-
+ hkl/hkl-unit-private.h                        | 2 +-
+ hkl/hkl-unit.c                                | 2 +-
+ hkl/hkl-vector-private.h                      | 2 +-
+ hkl/hkl-vector.c                              | 2 +-
+ hkl3d/hkl3d.h                                 | 2 +-
+ tests/hkl-axis-t.c                            | 2 +-
+ tests/hkl-bench-t.c                           | 2 +-
+ tests/hkl-detector-t.c                        | 2 +-
+ tests/hkl-error-t.c                           | 2 +-
+ tests/hkl-geometry-t.c                        | 2 +-
+ tests/hkl-interval-t.c                        | 2 +-
+ tests/hkl-lattice-t.c                         | 2 +-
+ tests/hkl-matrix-t.c                          | 2 +-
+ tests/hkl-parameter-t.c                       | 2 +-
+ tests/hkl-pseudoaxis-e4ch-t.c                 | 2 +-
+ tests/hkl-pseudoaxis-e4cv-t.c                 | 2 +-
+ tests/hkl-pseudoaxis-e6c-t.c                  | 2 +-
+ tests/hkl-pseudoaxis-k4cv-t.c                 | 2 +-
+ tests/hkl-pseudoaxis-k6c-t.c                  | 2 +-
+ tests/hkl-pseudoaxis-t.c                      | 2 +-
+ tests/hkl-pseudoaxis-zaxis-t.c                | 2 +-
+ tests/hkl-quaternion-t.c                      | 2 +-
+ tests/hkl-sample-t.c                          | 2 +-
+ tests/hkl-source-t.c                          | 2 +-
+ tests/hkl-unit-t.c                            | 2 +-
+ tests/hkl-vector-t.c                          | 2 +-
+ tests/hkl3d-test-t.c                          | 2 +-
+ tests/tap/hkl-tap.h                           | 2 +-
+ 105 files changed, 105 insertions(+), 105 deletions(-)
+
+commit c06a86c321e3eef55d63e996bca18b00652c4f38
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Jun 4 09:43:49 2014 +0200
+
+    add the update_copyright_year script
+    
+    this script set the last copyright year with the current one.
+
+ scripts/update_copyright_year | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+commit 3f2786fd9791eb2aef1cef2c8ae1edfdb04aefc6
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Jun 2 11:29:48 2014 +0200
+
+    rename hkl_engine_parameters_get -> hkl_engine_parameters_names_get
+
+ gui/hkl-gui-pseudoaxes.cpp    | 2 +-
+ gui/hkl-gui.cpp               | 2 +-
+ hkl.h                         | 2 +-
+ hkl/hkl-binding.c             | 6 +++---
+ hkl/hkl-pseudoaxis.c          | 4 ++--
+ tests/hkl-bench-t.c           | 4 ++--
+ tests/hkl-pseudoaxis-e4ch-t.c | 2 +-
+ tests/hkl-pseudoaxis-e4cv-t.c | 2 +-
+ tests/hkl-pseudoaxis-e6c-t.c  | 2 +-
+ tests/hkl-pseudoaxis-k4cv-t.c | 4 ++--
+ tests/hkl-pseudoaxis-k6c-t.c  | 4 ++--
+ 11 files changed, 17 insertions(+), 17 deletions(-)
+
+commit 6a36918327b8228ef213259bf40cf17d0ed54ec5
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed May 21 18:41:06 2014 +0200
+
+    rename hkl_engine_pseudo_axes_get -> hkl_engine_pseudo_axes_names_get
+
+ gui/hkl-gui-pseudoaxes.cpp | 2 +-
+ gui/hkl-gui.cpp            | 2 +-
+ hkl.h                      | 2 +-
+ hkl/hkl-pseudoaxis.c       | 4 ++--
+ tests/hkl-pseudoaxis-t.c   | 2 +-
+ 5 files changed, 6 insertions(+), 6 deletions(-)
+
+commit 6fb3c8fe217e1db4a457151496027559a3b84732
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed May 21 18:23:50 2014 +0200
+
+    typo
+
+ hkl.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit d18d82f2f49405a068c8b5d922ce95cbaa301089
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 3 15:48:20 2014 +0200
+
+    HklParameterList is now private
+
+ gui/hkl-gui-callbacks.cpp                |  10 ++-
+ gui/hkl-gui-modelcolumns.h               |   8 +-
+ gui/hkl-gui-pseudoaxes.cpp               |  12 +--
+ gui/hkl-gui.cpp                          |  26 +++----
+ gui/hkl-gui.h                            |   2 +-
+ hkl.h                                    |  38 +++++-----
+ hkl/Makefile.am                          |   5 +-
+ hkl/hkl-binding-private.h                |  12 +--
+ hkl/hkl-binding.c                        |  29 +++++++
+ hkl/hkl-geometry-private.h               |   1 +
+ hkl/hkl-parameter-private.h              |  21 +++++-
+ hkl/hkl-pseudoaxis-private.h             |   5 +-
+ hkl/hkl-pseudoaxis.c                     | 126 ++++++++++++++++++++++++++++++-
+ tests/bindings/python.py                 |   9 ++-
+ tests/hkl-bench-t.c                      |  21 +++---
+ tests/hkl-pseudoaxis-e4ch-t.c            |  34 ++++-----
+ tests/hkl-pseudoaxis-e4cv-t.c            |  30 +++-----
+ tests/hkl-pseudoaxis-e6c-t.c             |  55 ++++++++------
+ tests/hkl-pseudoaxis-k4cv-t.c            |  19 ++---
+ tests/hkl-pseudoaxis-k6c-t.c             |  26 +++----
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c |  17 ++---
+ tests/hkl-pseudoaxis-t.c                 |  40 +++++-----
+ tests/hkl-pseudoaxis-zaxis-t.c           |   6 +-
+ tests/tap/hkl-tap.c                      |  17 ++---
+ 24 files changed, 354 insertions(+), 215 deletions(-)
+
+commit 5c5ad1d7c527d46b69322204ee135d34d6eff416
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Apr 17 15:54:35 2014 +0200
+
+    now the HklMode struct is a private struct
+
+ Documentation/Makefile.am                   |   4 +-
+ Documentation/sphinx/source/development.rst |   1 +
+ gui/hkl-gui-callbacks.cpp                   |   8 +-
+ gui/hkl-gui-modelcolumns.h                  |   6 +-
+ gui/hkl-gui-pseudoaxes.cpp                  |  52 ++++-----
+ gui/hkl-gui-pseudoaxes.h                    |  32 +++---
+ gui/hkl-gui.cpp                             |  18 ++--
+ hkl.h                                       |  34 +++---
+ hkl/hkl-binding-private.h                   |  10 +-
+ hkl/hkl-binding.c                           |  33 +++---
+ hkl/hkl-pseudoaxis-common-eulerians.c       |   2 +-
+ hkl/hkl-pseudoaxis-common-q.c               |   6 +-
+ hkl/hkl-pseudoaxis-e4c-hkl.c                |   2 +-
+ hkl/hkl-pseudoaxis-e4c-psi.c                |   2 +-
+ hkl/hkl-pseudoaxis-e6c-hkl.c                |   2 +-
+ hkl/hkl-pseudoaxis-e6c-psi.c                |   2 +-
+ hkl/hkl-pseudoaxis-k4cv-hkl.c               |   2 +-
+ hkl/hkl-pseudoaxis-k4cv-psi.c               |   2 +-
+ hkl/hkl-pseudoaxis-k6c-hkl.c                |   2 +-
+ hkl/hkl-pseudoaxis-k6c-psi.c                |   2 +-
+ hkl/hkl-pseudoaxis-petra3-hkl.c             |   2 +-
+ hkl/hkl-pseudoaxis-private.h                |  19 +++-
+ hkl/hkl-pseudoaxis-soleil-sirius-turret.c   |   2 +-
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c        |   6 +-
+ hkl/hkl-pseudoaxis-zaxis-hkl.c              |   2 +-
+ hkl/hkl-pseudoaxis.c                        | 160 ++++++++++++++++++++--------
+ tests/bindings/python.py                    |  25 +----
+ tests/bindings/trajectory.py                |   4 +-
+ tests/hkl-bench-t.c                         |  25 +++--
+ tests/hkl-pseudoaxis-e4ch-t.c               |  55 ++++------
+ tests/hkl-pseudoaxis-e4cv-t.c               |  65 +++++------
+ tests/hkl-pseudoaxis-e6c-t.c                | 101 ++++++++----------
+ tests/hkl-pseudoaxis-k4cv-t.c               |  39 ++++---
+ tests/hkl-pseudoaxis-k6c-t.c                |  49 +++++----
+ tests/hkl-pseudoaxis-t.c                    |  10 +-
+ 35 files changed, 434 insertions(+), 352 deletions(-)
+
+commit 6ce8ae801e350d525c4e4b9907b58a6bca51851e
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Apr 2 10:59:52 2014 +0200
+
+    add the reactoring script
+    
+    you can use it to rename a method
+    
+    refactoring <old_name> <new_name>
+
+ scripts/refactoring | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit fac96a7df303d40bc6bf199907655afa01a23985
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Apr 2 10:58:59 2014 +0200
+
+    use list and design an iterator interface for the HklGeometryList
+    
+    no more darray for the HklGeometryLis structure.
+    it was not efficient.
+    
+    now the interface use
+    
+    hkl_geometry_list_n_items_get
+    hkl_geometry_list_items_first_get
+    hkl_geometry_list_items_next_get
+    
+    and a foreach macro
+    
+    HKL_GEOMETRY_LIST_FOREACH
+
+ gui/hkl-gui.cpp                          |   9 +-
+ hkl.h                                    |  16 ++-
+ hkl/hkl-binding.c                        |   7 +-
+ hkl/hkl-geometry-private.h               |   5 +-
+ hkl/hkl-geometry.c                       | 167 ++++++++++++++++++++-----------
+ hkl/hkl-pseudoaxis-common-hkl.c          |  15 ++-
+ hkl/hkl-pseudoaxis.c                     |  16 ++-
+ tests/bindings/trajectory.py             |   3 +-
+ tests/hkl-bench-t.c                      |   7 +-
+ tests/hkl-geometry-t.c                   |  16 +--
+ tests/hkl-pseudoaxis-e4ch-t.c            |  28 +++---
+ tests/hkl-pseudoaxis-e4cv-t.c            |  28 +++---
+ tests/hkl-pseudoaxis-e6c-t.c             |  48 ++++-----
+ tests/hkl-pseudoaxis-k4cv-t.c            |  35 +++----
+ tests/hkl-pseudoaxis-k6c-t.c             |  36 +++----
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c |  11 +-
+ tests/hkl-pseudoaxis-t.c                 |   7 +-
+ tests/hkl-pseudoaxis-zaxis-t.c           |   7 +-
+ 18 files changed, 251 insertions(+), 210 deletions(-)
+
+commit edeb17ef82ef9f7c27bd827214d0279ee84a5ea8
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Thu Mar 20 17:02:09 2014 +0100
+
+    remove unsafe hkl_geometry_axes_get method
+    
+    replace it with hkl_factory_axes_get which return a list of axis names.
+    fix also the python.py unit test for the Factory part.
+
+ gui/hkl-gui-callbacks.cpp                |  6 ++--
+ gui/hkl-gui-modelcolumns.h               | 10 +++----
+ gui/hkl-gui.cpp                          | 50 ++++++++++++++++++--------------
+ gui/hkl-gui.h                            |  1 +
+ hkl.h                                    |  5 ++--
+ hkl/hkl-factory.c                        | 48 ++++++++++++++++++++++++++++++
+ hkl/hkl-geometry.c                       |  5 ----
+ tests/Makefile.am                        |  2 --
+ tests/bindings/python.py                 | 25 +++++++++++-----
+ tests/hkl-pseudoaxis-e6c-t.c             | 18 +++++++-----
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c |  8 ++---
+ tests/hkl3d-test-t.c                     |  4 +--
+ 12 files changed, 121 insertions(+), 61 deletions(-)
+
+commit 76993475c362342c902dd82243ff5804217f2107
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Mar 10 15:43:52 2014 +0100
+
+    remove a bunch of warning
+    
+    const_cast<> arounf the HklSampleReflections
+
+ gui/hkl-gui-callbacks.cpp | 3 ++-
+ gui/hkl-gui.cpp           | 5 +++--
+ hkl/hkl-binding.c         | 2 +-
+ 3 files changed, 6 insertions(+), 4 deletions(-)
+
+commit fa784e202ff87b4114d7d952088abe668791eddc
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Mar 10 13:36:53 2014 +0100
+
+    rename hkl_engine_list_get_pseudo_axis_by_name -> hkl_engine_list_pseudo_axis_get_by_name
+
+ hkl.h                | 2 +-
+ hkl/hkl-pseudoaxis.c | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+commit 566ef8dc5b0fe30f187392367be4675462c12712
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Mar 10 12:02:38 2014 +0100
+
+    rename hkl_engine_list_get_by_name -> hkl_engine_list_engine_get_by_name
+
+ hkl.h                                    |  2 +-
+ hkl/hkl-pseudoaxis.c                     |  4 ++--
+ tests/bindings/python.py                 |  4 ++--
+ tests/bindings/trajectory.py             |  2 +-
+ tests/hkl-bench-t.c                      |  4 ++--
+ tests/hkl-pseudoaxis-e4ch-t.c            | 12 ++++++------
+ tests/hkl-pseudoaxis-e4cv-t.c            | 12 ++++++------
+ tests/hkl-pseudoaxis-e6c-t.c             | 14 +++++++-------
+ tests/hkl-pseudoaxis-k4cv-t.c            |  6 +++---
+ tests/hkl-pseudoaxis-k6c-t.c             |  8 ++++----
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c |  2 +-
+ tests/hkl-pseudoaxis-zaxis-t.c           |  2 +-
+ 12 files changed, 36 insertions(+), 36 deletions(-)
+
+commit 71e7da00f8d2c904aa1301d8272a6343110363bb
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Mar 10 11:56:31 2014 +0100
+
+    rename hkl_engine_list_get_geometry -> hkl_engine_list_geometry_get
+
+ hkl.h                    | 4 ++--
+ hkl/hkl-pseudoaxis.c     | 4 ++--
+ tests/hkl-pseudoaxis-t.c | 2 +-
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+commit b2efda75fdce92d74420ea6eee51c2ee5428ee7a
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Mar 10 11:48:05 2014 +0100
+
+    rename hkl_engine_list_geometries -> hkl_engine_list_geometries_get
+
+ gui/hkl-gui.cpp                          | 2 +-
+ hkl.h                                    | 2 +-
+ hkl/hkl-pseudoaxis.c                     | 4 ++--
+ tests/bindings/python.py                 | 2 +-
+ tests/bindings/trajectory.py             | 2 +-
+ tests/hkl-bench-t.c                      | 2 +-
+ tests/hkl-pseudoaxis-e4ch-t.c            | 8 ++++----
+ tests/hkl-pseudoaxis-e4cv-t.c            | 8 ++++----
+ tests/hkl-pseudoaxis-e6c-t.c             | 8 ++++----
+ tests/hkl-pseudoaxis-k4cv-t.c            | 6 +++---
+ tests/hkl-pseudoaxis-k6c-t.c             | 6 +++---
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c | 2 +-
+ tests/hkl-pseudoaxis-t.c                 | 2 +-
+ tests/hkl-pseudoaxis-zaxis-t.c           | 2 +-
+ 14 files changed, 28 insertions(+), 28 deletions(-)
+
+commit a4a8814235f59aab6c2296e5303f2606f712155a
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Mar 10 11:40:40 2014 +0100
+
+    rename hkl_engine_list_engines -> hkl_engine_list_engines_get
+
+ gui/hkl-gui.cpp              | 4 ++--
+ hkl.h                        | 2 +-
+ hkl/hkl-binding-private.h    | 2 +-
+ hkl/hkl-binding.c            | 6 +++---
+ hkl/hkl-pseudoaxis.c         | 4 ++--
+ tests/bindings/python.py     | 2 +-
+ tests/bindings/trajectory.py | 2 +-
+ tests/hkl-pseudoaxis-t.c     | 2 +-
+ 8 files changed, 12 insertions(+), 12 deletions(-)
+
+commit 227ad3603429fe598968e45e652a14c5981d4a4e
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Mar 10 11:23:06 2014 +0100
+
+    rename hkl_engine_engines -> hkl_engine_engines_get
+
+ gui/hkl-gui-pseudoaxes.cpp   | 2 +-
+ hkl.h                        | 2 +-
+ hkl/hkl-pseudoaxis.c         | 4 ++--
+ tests/bindings/trajectory.py | 4 ++--
+ 4 files changed, 6 insertions(+), 6 deletions(-)
+
+commit 0858f1dcc42aa53ba42bc8794767ff3601c8ca78
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Mar 10 11:14:42 2014 +0100
+
+    rename hkl_engine_modes -> hkl_engine_modes_get
+
+ gui/hkl-gui-pseudoaxes.cpp    | 2 +-
+ hkl.h                         | 2 +-
+ hkl/hkl-binding-private.h     | 9 ++++-----
+ hkl/hkl-binding.c             | 8 ++++----
+ hkl/hkl-pseudoaxis.c          | 4 ++--
+ tests/bindings/python.py      | 4 ++--
+ tests/bindings/trajectory.py  | 2 +-
+ tests/hkl-bench-t.c           | 4 ++--
+ tests/hkl-pseudoaxis-e4ch-t.c | 6 +++---
+ tests/hkl-pseudoaxis-e4cv-t.c | 6 +++---
+ tests/hkl-pseudoaxis-e6c-t.c  | 4 ++--
+ tests/hkl-pseudoaxis-k4cv-t.c | 6 +++---
+ tests/hkl-pseudoaxis-k6c-t.c  | 6 +++---
+ tests/hkl-pseudoaxis-t.c      | 2 +-
+ 14 files changed, 32 insertions(+), 33 deletions(-)
+
+commit 7158a6bdf484696589eb7c4e71df0fe039aa41fd
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Mar 10 10:44:59 2014 +0100
+
+    rename hkl_engine_mode -> hkl_engine_mode_get
+
+ gui/hkl-gui-pseudoaxes.cpp    |  2 +-
+ gui/hkl-gui.cpp               |  2 +-
+ hkl.h                         |  2 +-
+ hkl/hkl-pseudoaxis.c          |  4 ++--
+ tests/bindings/python.py      |  4 ++--
+ tests/hkl-pseudoaxis-e4ch-t.c |  6 +++---
+ tests/hkl-pseudoaxis-e4cv-t.c |  6 +++---
+ tests/hkl-pseudoaxis-e6c-t.c  | 16 ++++++++--------
+ 8 files changed, 21 insertions(+), 21 deletions(-)
+
+commit 66a7e7f28731c7e778762dd942216a3614c34f06
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Mar 10 10:36:25 2014 +0100
+
+    rename hkl_engine_pseudo_axes -> hkl_engine_pseudo_axes_get
+
+ gui/hkl-gui-pseudoaxes.cpp               | 2 +-
+ gui/hkl-gui.cpp                          | 2 +-
+ hkl.h                                    | 2 +-
+ hkl/hkl-pseudoaxis.c                     | 4 ++--
+ tests/hkl-bench-t.c                      | 4 ++--
+ tests/hkl-pseudoaxis-e4ch-t.c            | 8 ++++----
+ tests/hkl-pseudoaxis-e4cv-t.c            | 8 ++++----
+ tests/hkl-pseudoaxis-e6c-t.c             | 8 ++++----
+ tests/hkl-pseudoaxis-k4cv-t.c            | 4 ++--
+ tests/hkl-pseudoaxis-k6c-t.c             | 4 ++--
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c | 2 +-
+ tests/hkl-pseudoaxis-t.c                 | 2 +-
+ tests/hkl-pseudoaxis-zaxis-t.c           | 2 +-
+ tests/tap/hkl-tap.c                      | 4 ++--
+ 14 files changed, 28 insertions(+), 28 deletions(-)
+
+commit 6a3e4632f9362edf69cb069cedabeec75f8ce5c0
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Mar 10 10:30:30 2014 +0100
+
+    rename hkl_engine_name -> hkl_engine_name_get
+
+ gui/hkl-gui-pseudoaxes.cpp   | 2 +-
+ hkl.h                        | 2 +-
+ hkl/hkl-pseudoaxis.c         | 4 ++--
+ tests/bindings/python.py     | 2 +-
+ tests/bindings/trajectory.py | 2 +-
+ tests/hkl-bench-t.c          | 2 +-
+ tests/hkl-pseudoaxis-t.c     | 2 +-
+ 7 files changed, 8 insertions(+), 8 deletions(-)
+
+commit 8ca435103c900ad83eaeeb2a8de9775cf42e9841
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Mar 10 10:24:06 2014 +0100
+
+    rename hkl_mode_parameters -> hkl_mode_parameters_get
+
+ gui/hkl-gui-pseudoaxes.cpp    |  2 +-
+ gui/hkl-gui.cpp               |  2 +-
+ hkl.h                         |  2 +-
+ hkl/hkl-pseudoaxis.c          |  4 ++--
+ tests/bindings/python.py      |  2 +-
+ tests/hkl-bench-t.c           |  2 +-
+ tests/hkl-pseudoaxis-e4ch-t.c |  8 ++++----
+ tests/hkl-pseudoaxis-e4cv-t.c |  8 ++++----
+ tests/hkl-pseudoaxis-e6c-t.c  | 18 +++++++++---------
+ tests/hkl-pseudoaxis-k4cv-t.c |  4 ++--
+ tests/hkl-pseudoaxis-k6c-t.c  |  4 ++--
+ tests/hkl-pseudoaxis-t.c      |  2 +-
+ 12 files changed, 29 insertions(+), 29 deletions(-)
+
+commit 757c9520625bfe42d2ca845173ba5af9483973fe
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Mar 10 10:14:48 2014 +0100
+
+    rename hkl_mode_name -> hkl_mode_name_get
+
+ INSTALL                      | 12 ++++++------
+ gui/hkl-gui-pseudoaxes.cpp   |  2 +-
+ hkl.h                        |  2 +-
+ hkl/hkl-pseudoaxis.c         |  4 ++--
+ tests/bindings/python.py     |  2 +-
+ tests/bindings/trajectory.py |  4 ++--
+ tests/hkl-bench-t.c          |  2 +-
+ tests/hkl-pseudoaxis-k6c-t.c |  4 ++--
+ tests/hkl-pseudoaxis-t.c     |  4 ++--
+ 9 files changed, 18 insertions(+), 18 deletions(-)
+
+commit 82bcd55e1d7159633be79697f1bf6f001cb1a930
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Thu Feb 27 22:04:36 2014 +0100
+
+    release the 4.0.8 version
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit bc01bb4eb17b8e817ab3f930cb2508e1515b7c5c
+Merge: c66e437 50622f4
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Feb 27 16:57:24 2014 +0100
+
+    Merge branch 'maint' into next
+    
+    Conflicts:
+    	TODO
+    	hkl/hkl-geometry-factory.c
+    	hkl/hkl-geometry-factory.h
+    	hkl/hkl-geometry-private.h
+    	hkl/hkl-pseudoaxis-factory.c
+    	hkl/pom.xml
+
+commit 50622f450b08645952775ed54ead6bb97c484c96
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Feb 27 14:47:07 2014 +0100
+
+    add the SOLEIL SIRIUS KAPPA diffractometer
+
+ .../source/diffractometers/soleil_sirius_kappa.rst | 179 +++++++++++++++++++++
+ Documentation/sphinx/source/index.rst              |   1 +
+ hkl/hkl-geometry-factory.c                         |  24 +++
+ hkl/hkl-geometry-factory.h                         |   1 +
+ hkl/hkl-geometry.h                                 |   3 +-
+ hkl/hkl-pseudoaxis-auto.c                          |   2 +-
+ hkl/hkl-pseudoaxis-factory.c                       |   2 +
+ hkl/pom.xml                                        |   2 +-
+ test/hkl-test-pseudoaxis.c                         |   9 ++
+ 9 files changed, 220 insertions(+), 3 deletions(-)
+
+commit 0b84fdc2a32c34b7daaa88685f2c58392444b750
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Feb 25 14:55:28 2014 +0100
+
+    add the soleil sirius turret documentation
+
+ .../diffractometers/soleil_sirius_turret.rst       | 61 ++++++++++++++++++++++
+ Documentation/sphinx/source/index.rst              |  1 +
+ 2 files changed, 62 insertions(+)
+
+commit ce4c831ece2e34b4a2958e149a1f74c8995c8420
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Thu Feb 6 14:46:42 2014 +0100
+
+    implemente the ux_uy_uz toggled
+
+ gui/ghkl.ui   |   9 ++++
+ gui/hkl-gui.c | 140 +++++++++++++---------------------------------------------
+ 2 files changed, 39 insertions(+), 110 deletions(-)
+
+commit 3b26c7ad3c470642ec39ee182ed740f3856e4c1b
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Thu Feb 6 13:46:12 2014 +0100
+
+    remove useless code
+
+ gui/hkl-gui.c | 92 -----------------------------------------------------------
+ 1 file changed, 92 deletions(-)
+
+commit db639e3ab9365f874de19888f5ad7e8cbbd712ed
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Thu Feb 6 12:58:05 2014 +0100
+
+    implemente the checkbutton toggled
+
+ gui/ghkl.ui   |   6 +
+ gui/hkl-gui.c | 382 +++++++---------------------------------------------------
+ 2 files changed, 49 insertions(+), 339 deletions(-)
+
+commit 92d387b720960e1140236d308dc56da66a85c9c7
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Thu Feb 6 12:22:25 2014 +0100
+
+    add the sample refine callback
+
+ gui/ghkl.ui   |  9 +++++++-
+ gui/hkl-gui.c | 71 +++++++++++++++++------------------------------------------
+ 2 files changed, 28 insertions(+), 52 deletions(-)
+
+commit 9f84769fb2faafa40409a120d4595874c29421cd
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Thu Feb 6 12:14:18 2014 +0100
+
+    add the UB busing et levy computation
+
+ gui/ghkl.ui   |  61 ++++-------------------------
+ gui/hkl-gui.c | 120 ++++++++++++++++++++++++++++++++++------------------------
+ 2 files changed, 79 insertions(+), 102 deletions(-)
+
+commit a5c324989b9ccfbe0b71fa03f430cd7060871adf
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Feb 5 16:53:45 2014 +0100
+
+    add the error handling to the hkl_sample_UB_set method
+
+ gui/ghkl.ui                              |   8 +
+ gui/hkl-gui.c                            | 354 +++----------------------------
+ hkl.h                                    |   4 +-
+ hkl/hkl-binding-private.h                |   5 +
+ hkl/hkl-binding.c                        |  50 +++++
+ hkl/hkl-sample.c                         |   9 +-
+ tests/hkl-pseudoaxis-e6c-t.c             |   4 +-
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c |   2 +-
+ tests/hkl-pseudoaxis-zaxis-t.c           |   2 +-
+ tests/hkl-sample-t.c                     |   5 +-
+ 10 files changed, 108 insertions(+), 335 deletions(-)
+
+commit 9bd9e473e26511fd8e565b12ab0146c59dd76dfd
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Feb 3 13:51:21 2014 +0100
+
+    add callback for ux, uy, uz
+
+ gui/ghkl.ui   |  3 +++
+ gui/hkl-gui.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 54 insertions(+)
+
+commit faafb652fefadaee926a03a7f6dbc42c77de29ed
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Jan 29 16:36:42 2014 +0100
+
+    reorganise the UB matrix display
+
+ gui/ghkl.ui   | 1385 +++++++++++++++++++++++++++++++--------------------------
+ gui/hkl-gui.c |   54 +--
+ 2 files changed, 765 insertions(+), 674 deletions(-)
+
+commit c6f464ffdf3d2902be1fbdc92a704d097946515e
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jan 28 14:58:31 2014 +0100
+
+    FitParameters where wrong at the startup.
+
+ gui/hkl-gui.c | 32 +++++++++++++++++---------------
+ 1 file changed, 17 insertions(+), 15 deletions(-)
+
+commit 0856572ae0693249207fed095f453adbeea5c058
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Mon Jan 27 16:37:35 2014 +0100
+
+    just ui reorganisation on the notebook
+
+ gui/ghkl.ui | 26 ++++++++++++++++----------
+ 1 file changed, 16 insertions(+), 10 deletions(-)
+
+commit f3db2262252d6b9ef6540eba494c3c8ea6fa86e6
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Mon Jan 27 16:17:01 2014 +0100
+
+    add the callback for the wavelength
+
+ gui/ghkl.ui   |   2 ++
+ gui/hkl-gui.c | 105 ++++++++++++++++++++++++++++------------------------------
+ 2 files changed, 52 insertions(+), 55 deletions(-)
+
+commit 0bb0955b7c266227a65372a2a4419411a318543b
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Mon Jan 27 15:14:24 2014 +0100
+
+    typo
+
+ gui/hkl-gui.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+commit 2193c11031ca52e239ca5b2d0a216a785e57a8ac
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Mon Jan 27 15:14:14 2014 +0100
+
+    for now the wave length does not deserve a dedicated panel
+
+ gui/ghkl.ui | 171 +++++++++++++++++++++++++++++-------------------------------
+ 1 file changed, 84 insertions(+), 87 deletions(-)
+
+commit 57b36313f582f5f37cf74956daa781caf1a74054
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Mon Jan 27 14:29:20 2014 +0100
+
+    fix a bug when selecting a new crystal
+
+ gui/hkl-gui.c | 82 +++++++++++++++++++++++++++++++----------------------------
+ 1 file changed, 43 insertions(+), 39 deletions(-)
+
+commit a7288ae25dd717c89a77ee00d1b128e89da41b88
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Mon Jan 27 12:43:49 2014 +0100
+
+    now the first visible panel is the crystal one.
+
+ gui/ghkl.ui | 86 ++++++++++++++++++++++++++++++-------------------------------
+ 1 file changed, 43 insertions(+), 43 deletions(-)
+
+commit 05be4b8accc35d8b00d2d089d23ccc14e71c1968
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Mon Jan 27 12:14:03 2014 +0100
+
+    remove the pseudo_axes_parameter treeview (useless)
+
+ gui/ghkl.ui   | 146 +++++---------------
+ gui/hkl-gui.c | 418 ----------------------------------------------------------
+ 2 files changed, 35 insertions(+), 529 deletions(-)
+
+commit 72891529f487fd15bbaf039900d270e462a9aa62
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Mon Jan 27 11:30:54 2014 +0100
+
+    remove more usless code
+
+ gui/hkl-gui.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+commit 08fda072487343f89a8147a0b36cf30833675cc4
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Jan 24 14:55:24 2014 +0100
+
+    add the set_crystal parameters
+
+ gui/ghkl.ui   |  66 ++++++++++
+ gui/hkl-gui.c | 398 ++++++++++++++++++++--------------------------------------
+ 2 files changed, 203 insertions(+), 261 deletions(-)
+
+commit 59f71fc5a0a1c30d7836c26b19380969eb02b23b
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Jan 24 09:36:20 2014 +0100
+
+    typo
+
+ gui/hkl-gui.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 180497ebb698eb02cb46317e324916b0e5aff3ae
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Thu Jan 23 21:30:23 2014 +0100
+
+    remove more useless code
+
+ gui/hkl-gui.c | 362 ----------------------------------------------------------
+ 1 file changed, 362 deletions(-)
+
+commit c265e5f6fa2599847d6f948f6e153fa9f72a1a63
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Thu Jan 23 21:22:27 2014 +0100
+
+    update_UB
+
+ gui/hkl-gui.c | 395 ++++++++--------------------------------------------------
+ 1 file changed, 52 insertions(+), 343 deletions(-)
+
+commit 2d1c7e093f09fcf03c246321ca07298d7d93ae13
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Thu Jan 23 20:49:36 2014 +0100
+
+    add the update_ux_uy_yz
+
+ gui/hkl-gui.c | 142 +++++++++++++---------------------------------------------
+ 1 file changed, 30 insertions(+), 112 deletions(-)
+
+commit e59a96f11213ffe305a9a55ccdd4ef7ec38f1070
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Thu Jan 23 19:59:19 2014 +0100
+
+    add the lattice part
+
+ gui/hkl-gui.c | 687 ++++++----------------------------------------------------
+ 1 file changed, 64 insertions(+), 623 deletions(-)
+
+commit f5a5de229d7ffc5697e56406029c021dfaee961d
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Thu Jan 23 15:19:48 2014 +0100
+
+    remove useless code
+
+ gui/hkl-gui.c | 500 ----------------------------------------------------------
+ 1 file changed, 500 deletions(-)
+
+commit 7d39ac5b784b1e468cfbb0f17e942df2ac30e940
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Thu Jan 23 11:41:24 2014 +0100
+
+    now deleting a reflevion is working
+
+ gui/ghkl.ui   | 64 ++++++++++-------------------------------------------------
+ gui/hkl-gui.c |  4 ++--
+ 2 files changed, 12 insertions(+), 56 deletions(-)
+
+commit 6a766ea943933950ddd1c938e6dbee59da190fdd
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Jan 22 22:12:42 2014 +0100
+
+    fix a bug in the reflection
+
+ gui/hkl-gui.c | 18 +++++++++++++-----
+ 1 file changed, 13 insertions(+), 5 deletions(-)
+
+commit 0a71a0ecf3354cdbc99d990598c67ca22e33d07a
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Jan 22 16:53:00 2014 +0100
+
+    more check
+
+ gui/hkl-gui.c | 67 ++++++++++++++++++++++++++++++++---------------------------
+ 1 file changed, 36 insertions(+), 31 deletions(-)
+
+commit e595ae52643b8066ddf5b23becc8885a24e3d80a
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Jan 22 16:34:05 2014 +0100
+
+    add the crystal del
+
+ gui/ghkl.ui   |  1 +
+ gui/hkl-gui.c | 81 ++++++++++++++++++++++++++++++-----------------------------
+ 2 files changed, 42 insertions(+), 40 deletions(-)
+
+commit ccbcab403e5211b8492b562164ca4b20a5cd8010
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Jan 22 15:38:05 2014 +0100
+
+    implemente the cursor changed of the crystals
+
+ gui/ghkl.ui   |   1 +
+ gui/hkl-gui.c | 166 +++++++++++++++++++---------------------------------------
+ 2 files changed, 54 insertions(+), 113 deletions(-)
+
+commit 5130c3b2d205251efbd024bc7c3d2507ad429408
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Jan 22 15:02:48 2014 +0100
+
+    copy_crystal is working
+
+ gui/ghkl.ui   |   1 +
+ gui/hkl-gui.c | 168 ++++++++++++----------------------------------------------
+ 2 files changed, 35 insertions(+), 134 deletions(-)
+
+commit 28a091d29564f328e83d8befcc991a07c4c37820
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Jan 22 11:24:34 2014 +0100
+
+    now we can add samples
+
+ gui/ghkl.ui   |   1 +
+ gui/hkl-gui.c | 178 +++++++++++++++++++++++++---------------------------------
+ 2 files changed, 77 insertions(+), 102 deletions(-)
+
+commit 918264ee07650163d63ccb087f852f9c6ee454eb
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Jan 22 10:09:02 2014 +0100
+
+    add the crystal treeview and liststore
+
+ gui/ghkl.ui   | 161 ++++++++++++++++++++++
+ gui/hkl-gui.c | 425 +++++++++-------------------------------------------------
+ 2 files changed, 225 insertions(+), 361 deletions(-)
+
+commit 28d0ecafda2baa9cd225b2148fc47f6fcdd8b00a
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Mon Jan 20 21:21:15 2014 +0100
+
+    add the hkl_gui_window_toolbutton_del_reflection_clicked_cb
+
+ gui/ghkl.ui   |   1 +
+ gui/hkl-gui.c | 499 +++++++++++++---------------------------------------------
+ 2 files changed, 108 insertions(+), 392 deletions(-)
+
+commit f99f78b706d7e6e0e9803a80de4d95afbe20ca18
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jan 18 18:51:37 2014 +0100
+
+    add toolbutton_goto_reflection_clicked_cb
+
+ gui/ghkl.ui   |   1 +
+ gui/hkl-gui.c | 256 ++++++++++++++++------------------------------------------
+ 2 files changed, 70 insertions(+), 187 deletions(-)
+
+commit d23fef6565c47226dc8d7014a49033692a94f084
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jan 18 17:18:05 2014 +0100
+
+    add the toolbutton_add_reflection_clicked_cb callback
+
+ gui/ghkl.ui   |  1 +
+ gui/hkl-gui.c | 93 ++++++++++++++++++++---------------------------------------
+ 2 files changed, 32 insertions(+), 62 deletions(-)
+
+commit 0efdbfb201795264dfe960a528f2e30f078a41be
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jan 18 16:37:44 2014 +0100
+
+    add the treeview_reflections_key_press_event_cb
+
+ gui/ghkl.ui   |  7 +++++++
+ gui/hkl-gui.c | 30 +++++++++---------------------
+ 2 files changed, 16 insertions(+), 21 deletions(-)
+
+commit e7c5829cfd5b476b8e363b76e2108c287832d5fc
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jan 18 16:04:47 2014 +0100
+
+    set up the treeview reflections
+
+ gui/ghkl.ui   |  154 +-
+ gui/hkl-gui.c | 4748 ++++++++++++++++++++++++---------------------------------
+ 2 files changed, 2109 insertions(+), 2793 deletions(-)
+
+commit ce36bebd09bfe05a125fba378d41013aa3e27de5
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jan 18 16:04:09 2014 +0100
+
+    remove useless code
+
+ gui/hkl-gui-pseudoaxes.c |  2 --
+ gui/hkl-gui.c            | 55 ------------------------------------------------
+ 2 files changed, 57 deletions(-)
+
+commit 9ca28e992cd8ddffa3eca4665b90d415a85d53ca
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jan 18 14:30:18 2014 +0100
+
+    reorganization of hkl-gui.c
+
+ gui/hkl-gui.c | 1099 +++++++++++++++++++++++++++------------------------------
+ 1 file changed, 529 insertions(+), 570 deletions(-)
+
+commit 74ac219a2d19b643793717510c84db250ccaae9b
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jan 18 13:39:19 2014 +0100
+
+    reorganize the code
+
+ gui/hkl-gui-pseudoaxes.c | 123 ++++++++++++++++++++++-------------------------
+ 1 file changed, 57 insertions(+), 66 deletions(-)
+
+commit 464006aa03613180f6e8d7d27ea8c97217064f23
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jan 18 12:09:22 2014 +0100
+
+    define HKL_GUI_ENGINE_GET_PRIVATE and use it
+
+ gui/hkl-gui-pseudoaxes.c | 60 +++++++++++++++---------------------------------
+ 1 file changed, 18 insertions(+), 42 deletions(-)
+
+commit 58a9d31d5a3cafb8b5dce69655e2eb16b215abac
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jan 18 11:40:41 2014 +0100
+
+    silent for now the diffractometer when the computation is not possible
+
+ gui/hkl-gui.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+commit b031e959c9166e189654912b1a60769206d881f1
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jan 18 11:40:11 2014 +0100
+
+    trailling spaces
+
+ gui/hkl-gui.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+commit d4ddb094b8d21e9beac394ac510d6ec24c2c1dc4
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jan 18 11:40:00 2014 +0100
+
+    forgot an hkl_gui_window_update_pseudo_axes_frames
+
+ gui/hkl-gui.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 4cb3879b20b6a905a5a55b7dfe3decac8a7058c1
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jan 18 11:39:23 2014 +0100
+
+    rewrite the HklGuiEngine following the GObject tutorial
+
+ gui/hkl-gui-pseudoaxes.c | 73 +++++++++++++++++++++++++++++++++++-------------
+ 1 file changed, 54 insertions(+), 19 deletions(-)
+
+commit 744ddb9a168b4ef1e2b804288a9b2611fca74fbb
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Mon Jan 13 20:51:56 2014 +0100
+
+    fix a bug with the gobject property
+
+ gui/hkl-gui.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+commit 957892edd5ced8b5ceb68917c482d752930f6b10
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jan 11 16:34:42 2014 +0100
+
+    now the computation in the pseudo_frames raise also the error.
+
+ gui/hkl-gui-pseudoaxes.c |  28 +++++---
+ gui/hkl-gui.c            | 184 +++++++++++++++++++++++++++--------------------
+ 2 files changed, 125 insertions(+), 87 deletions(-)
+
+commit 4af266b313259fe3d8f682cd9fe4a10fa98cbebf
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Jan 8 18:02:48 2014 +0100
+
+    wip pseudo frames before reorganisation
+
+ gui/hkl-gui-pseudoaxes.c |  74 ++++++++++++++--------
+ gui/hkl-gui.c            | 156 +++++++++++++++++++++--------------------------
+ 2 files changed, 115 insertions(+), 115 deletions(-)
+
+commit 2d991257432c87f3c827fc7e8ceb3d5047e74180
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Jan 8 10:48:35 2014 +0100
+
+    now the mode is well reflected in the combobox
+
+ gui/hkl-gui-pseudoaxes.c | 329 +++++++++++++++++++++++------------------------
+ 1 file changed, 159 insertions(+), 170 deletions(-)
+
+commit 383fd25602cfab37979a0927253dcd805142b7bc
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Jan 8 10:25:11 2014 +0100
+
+    format and remove some useless code
+
+ gui/hkl-gui.c | 323 ++++++----------------------------------------------------
+ 1 file changed, 30 insertions(+), 293 deletions(-)
+
+commit b07c34475a910420ade2556679f7c1f350a0964d
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Jan 8 10:11:18 2014 +0100
+
+    better error message handling in the gui
+
+ gui/hkl-gui.c | 54 +++++++++++++++++++++++++++++++++++++++++-------------
+ 1 file changed, 41 insertions(+), 13 deletions(-)
+
+commit 24a1ba4c50b583db4eeed2ba6735a0f4bdd4c049
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Jan 8 10:10:45 2014 +0100
+
+    better error message when using hkl engine
+
+ hkl.h                                 |  1 +
+ hkl/hkl-pseudoaxis-common-hkl.c       | 39 ++++++++++++++++++++++++++++++-----
+ hkl/hkl-pseudoaxis-common-q-private.h |  2 ++
+ hkl/hkl-pseudoaxis-common-q.c         | 12 ++++++++---
+ hkl/hkl-pseudoaxis.c                  | 10 ++++++++-
+ 5 files changed, 55 insertions(+), 9 deletions(-)
+
+commit 2910d60245a03849c161134f9faa55b596c2bd0d
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jan 7 11:55:33 2014 +0100
+
+    reset the pseudo axis value if the computation failed
+    
+    if the computation failed, the expected value should be restored to allow
+    futur computation. Otherwise the list_tree and the hkl internal are not
+    synchronized.
+
+ gui/hkl-gui.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit 7172fa4884764f51546a9aeeab3776829d44b5e8
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jan 7 11:42:52 2014 +0100
+
+    add an içnfor bar to give the user some feddback about the computation
+
+ gui/ghkl.ui   | 39 +++++++++++++++++++++----
+ gui/hkl-gui.c | 91 +++++++++++++++++++++++++++++++++++++++--------------------
+ 2 files changed, 93 insertions(+), 37 deletions(-)
+
+commit e3f379b47c7a5243fb258079056306ee66c1aec1
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jan 7 10:21:31 2014 +0100
+
+    cleaner code for hkl_gui_window_update_solutions
+
+ gui/hkl-gui.c | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+commit 3ffc5166812e2f763ee8d97d95acee9bd5833b63
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Jan 6 17:05:57 2014 +0100
+
+    add the solution part
+
+ gui/ghkl.ui   |   4 +-
+ gui/hkl-gui.c | 735 ++++++++++++++--------------------------------------------
+ 2 files changed, 180 insertions(+), 559 deletions(-)
+
+commit f755789e85f7f863fda6ea93e67c238c01f9e58b
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Jan 6 13:34:03 2014 +0100
+
+    add the pseudo axes
+
+ INSTALL         |  12 +-
+ configure.ac    |   2 +-
+ gui/ghkl.ui     | 169 +++++++++---
+ gui/hkl-gui.c   | 840 ++++++++------------------------------------------------
+ gui/pseudo.ui   |  68 ++---
+ hkl/hkl-types.c |   1 -
+ 6 files changed, 299 insertions(+), 793 deletions(-)
+
+commit 0e25b32e79e6c42b0b3d51cad2662503bea453f4
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Mon Jan 6 08:42:57 2014 +0100
+
+    wip
+
+ gui/ghkl.ui   |   23 +-
+ gui/hkl-gui.c | 1046 +++++++++++++++++----------------------------------------
+ gui/pseudo.ui |   50 +--
+ 3 files changed, 366 insertions(+), 753 deletions(-)
+
+commit 7311dfb420a77fb0218c7f27c20cc77264b40be9
+Merge: 8688c93 c66e437
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Jan 5 15:58:30 2014 +0100
+
+    Merge branch 'next' into gtk
+    
+    Conflicts:
+    	configure.ac
+    	gui/Makefile.am
+    	gui/hkl-gui-3d.cpp
+    	gui/hkl-gui-3d.h
+    	gui/hkl-gui-callbacks.cpp
+    	gui/hkl-gui-modelcolumns.h
+    	gui/hkl-gui-pseudoaxes.cpp
+    	gui/hkl-gui-pseudoaxes.h
+    	gui/hkl-gui.cpp
+    	gui/hkl-gui.h
+    	gui/hkl3d/hkl3d-gui-model.cpp
+    	gui/hkl3d/hkl3d-gui-model.h
+    	gui/hkl3d/hkl3d-gui-scene.cpp
+    	gui/hkl3d/hkl3d-gui-scene.h
+    	gui/hkl3d/hkl3d-gui-view.cpp
+    	gui/hkl3d/hkl3d-gui-view.h
+    	gui/trackball.vapi
+    	hkl3d/bullet/src/Makefile.am
+    	hkl3d/hkl3d.cpp
+    	hkl3d/hkl3d.h
+    	test/hkl/axis-t.c
+    	test/hkl/lattice-t.c
+    	test/hkl/pseudoaxis-e4cv-t.c
+    	test/hkl/pseudoaxis-e6c-t.c
+    	test/hkl/pseudoaxis-k4cv-t.c
+    	test/hkl/pseudoaxis-k6c-t.c
+    	test/hkl/pseudoaxis-t.c
+    	test/hkl/sample-t.c
+    	tests/hkl-geometry-t.c
+    	tests/hkl-parameter-t.c
+    	tests/hkl-vector-t.c
+    	tests/runtests.c
+    	tests/tap/basic.c
+    	tests/tap/basic.h
+    	tests/tap/libtap.sh
+
+commit c66e43766d2aaf04eadf2ad2780d5179dba483b5
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Dec 29 14:21:45 2013 +0100
+
+    clean-all
+
+ INSTALL                     | 4 ++--
+ gui/hkl-gui.h               | 2 +-
+ hkl/hkl-binding.c           | 1 -
+ hkl/hkl-factory.c           | 6 +++---
+ hkl/hkl-matrix.c            | 2 +-
+ hkl/hkl-parameter-private.h | 6 +++---
+ hkl/hkl-parameter.c         | 4 ++--
+ hkl/hkl-sample.c            | 2 +-
+ scripts/clean-all           | 6 ++++--
+ 9 files changed, 17 insertions(+), 16 deletions(-)
+
+commit 29dd8a7e44a384ecb01f3f387f764434a90f0202
+Merge: f5c116a 7c302b9
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Dec 29 11:31:38 2013 +0100
+
+    Merge branch 'maint' into next
+    
+    Conflicts:
+    	hkl/Makefile.am
+    	hkl/hkl-geometry-factory.c
+    	hkl/hkl-geometry-factory.h
+    	hkl/hkl-geometry-private.h
+    	hkl/hkl-pseudoaxis-factory.c
+    	hkl/pom.xml
+
+commit f5c116a1bdef94ef2d999d4751523dbfda067759
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Tue Dec 17 22:27:10 2013 +0100
+
+    update ccan
+
+ hkl/ccan/list/list.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit be3a6967942b5b4eaa73035c05e9fd64dfcf990b
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Oct 7 15:34:07 2013 +0200
+
+    add the TODO list for sirius
+
+ TODO | 24 ++++++++++++++++++++++++
+ 1 file changed, 24 insertions(+)
+
+commit 7c302b91e2a893cf5e1ba1bb41e37ca45b716480
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Oct 7 15:30:46 2013 +0200
+
+    update the pom.xml 4.0.6 -> 4.0.7
+
+ hkl/pom.xml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 94d97c72691021a3ada50cae2df74dbb8759c0e6
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Oct 7 15:09:58 2013 +0200
+
+    add the sirius turret geometry
+
+ hkl/Makefile.am                           |  8 +++--
+ hkl/hkl-geometry-factory.c                | 19 ++++++++++++
+ hkl/hkl-geometry-factory.h                |  1 +
+ hkl/hkl-geometry.h                        |  3 +-
+ hkl/hkl-pseudoaxis-factory.c              |  5 +++
+ hkl/hkl-pseudoaxis-soleil-sirius-turret.c | 51 +++++++++++++++++++++++++++++++
+ hkl/hkl-pseudoaxis-soleil-sirius-turret.h | 33 ++++++++++++++++++++
+ test/hkl-test-pseudoaxis.c                |  9 ++++++
+ 8 files changed, 125 insertions(+), 4 deletions(-)
+
+commit ec683db8d110083cc1e2af1dbac74f5cf709191c
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Sep 22 19:59:48 2013 +0200
+
+    use the new list_next from ccan
+
+ hkl.h            |  6 +++---
+ hkl/hkl-sample.c | 11 ++++-------
+ 2 files changed, 7 insertions(+), 10 deletions(-)
+
+commit d9b07271dee955716e3b6a1e5cbe7ae7632a1eec
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Sep 22 19:34:44 2013 +0200
+
+    update ccan
+
+ hkl/ccan/list/list.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 52 insertions(+)
+
+commit 04cfaf020898969848adc8383926d8548c036298
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Sep 22 18:30:47 2013 +0200
+
+    we are using subdir-objects so add the options
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit d5d86aae223c857d78c7090c481ad8f3d89f0540
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Sep 22 17:26:01 2013 +0200
+
+    fix the header with the help of iwyu
+
+ hkl.h                                         |  9 +++----
+ hkl/Makefile.am                               |  9 ++++++-
+ hkl/hkl-axis-private.h                        |  8 +++---
+ hkl/hkl-axis.c                                | 23 ++++++++++-------
+ hkl/hkl-binding-private.h                     |  6 ++---
+ hkl/hkl-binding.c                             | 25 +++++++++++--------
+ hkl/hkl-detector-factory.c                    |  6 ++---
+ hkl/hkl-detector-private.h                    |  5 +++-
+ hkl/hkl-detector.c                            | 12 ++++++---
+ hkl/hkl-error.c                               | 13 ++++++----
+ hkl/hkl-factory.c                             | 32 ++++++++++++------------
+ hkl/hkl-geometry-private.h                    | 11 +++++---
+ hkl/hkl-geometry.c                            | 35 ++++++++++++++++----------
+ hkl/hkl-interval-private.h                    |  2 +-
+ hkl/hkl-interval.c                            |  9 ++++---
+ hkl/hkl-lattice.c                             | 17 +++++++------
+ hkl/hkl-macros-private.h                      |  3 ++-
+ hkl/hkl-macros.c                              |  9 +++----
+ hkl/hkl-matrix.c                              | 15 +++++------
+ hkl/hkl-parameter-private.h                   | 13 +++++-----
+ hkl/hkl-parameter.c                           | 13 +++++++---
+ hkl/hkl-pseudoaxis-auto-private.h             | 16 +++++++-----
+ hkl/hkl-pseudoaxis-auto.c                     | 29 ++++++++++++++-------
+ hkl/hkl-pseudoaxis-common-eulerians-private.h |  3 ++-
+ hkl/hkl-pseudoaxis-common-eulerians.c         | 19 +++++++++-----
+ hkl/hkl-pseudoaxis-common-hkl-private.h       |  4 ++-
+ hkl/hkl-pseudoaxis-common-hkl.c               | 36 +++++++++++++++++++--------
+ hkl/hkl-pseudoaxis-common-psi-private.h       | 10 ++++----
+ hkl/hkl-pseudoaxis-common-psi.c               | 32 ++++++++++++++++--------
+ hkl/hkl-pseudoaxis-common-q.c                 | 28 ++++++++++++++-------
+ hkl/hkl-pseudoaxis-e4c-hkl.c                  | 19 ++++++++------
+ hkl/hkl-pseudoaxis-e4c-private.h              |  2 +-
+ hkl/hkl-pseudoaxis-e4c-psi.c                  | 12 ++++-----
+ hkl/hkl-pseudoaxis-e6c-hkl.c                  | 18 ++++++++------
+ hkl/hkl-pseudoaxis-e6c-private.h              |  2 +-
+ hkl/hkl-pseudoaxis-e6c-psi.c                  | 11 ++++----
+ hkl/hkl-pseudoaxis-k4cv-hkl.c                 | 17 +++++++------
+ hkl/hkl-pseudoaxis-k4cv-private.h             |  2 +-
+ hkl/hkl-pseudoaxis-k4cv-psi.c                 | 11 ++++----
+ hkl/hkl-pseudoaxis-k6c-hkl.c                  | 26 ++++++++++++-------
+ hkl/hkl-pseudoaxis-k6c-private.h              |  2 +-
+ hkl/hkl-pseudoaxis-k6c-psi.c                  | 11 ++++----
+ hkl/hkl-pseudoaxis-petra3-hkl.c               | 14 ++++++-----
+ hkl/hkl-pseudoaxis-petra3-private.h           |  2 +-
+ hkl/hkl-pseudoaxis-private.h                  | 17 +++++++------
+ hkl/hkl-pseudoaxis-soleil-sixs-med-private.h  |  2 +-
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c          | 23 ++++++++++++-----
+ hkl/hkl-pseudoaxis-zaxis-hkl.c                | 15 +++++------
+ hkl/hkl-pseudoaxis-zaxis-private.h            |  2 +-
+ hkl/hkl-pseudoaxis.c                          | 23 +++++++++--------
+ hkl/hkl-quaternion-private.h                  |  8 +++---
+ hkl/hkl-quaternion.c                          | 18 +++++++-------
+ hkl/hkl-sample-private.h                      |  8 +++---
+ hkl/hkl-sample.c                              | 34 +++++++++++++++++--------
+ hkl/hkl-source-private.h                      |  4 ++-
+ hkl/hkl-source.c                              | 12 +++++----
+ hkl/hkl-type-builtins.h.template              |  4 ++-
+ hkl/hkl-types.c                               | 16 ++++++++----
+ hkl/hkl-types.h                               |  7 +++---
+ hkl/hkl-unit-private.h                        |  2 +-
+ hkl/hkl-unit.c                                | 12 ++++-----
+ hkl/hkl-vector-private.h                      |  6 ++---
+ hkl/hkl-vector.c                              | 18 +++++++-------
+ 63 files changed, 502 insertions(+), 330 deletions(-)
+
 commit 9b3f95021c6f5b591d47768c3d2526c42e96973d
 Author: Picca Frédéric-Emmanuel <picca at debian.org>
 Date:   Mon Aug 26 11:12:48 2013 +0200
@@ -1768,6 +5675,15 @@ Date:   Sat Mar 9 19:19:15 2013 +0100
  test/Makefile.am | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
 
+commit 93c9f9e6e091b55f8e1832db965432324271b5d1
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Feb 6 20:45:59 2013 +0100
+
+    add the med2_3_slits figure
+
+ Documentation/figures/med2_3_slits.asy | 79 ++++++++++++++++++++++++++++++++++
+ 1 file changed, 79 insertions(+)
+
 commit c3425266e928836b743c3345afbe76d67c764655
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
 Date:   Mon Feb 4 17:35:58 2013 +0100
@@ -5073,6 +8989,35 @@ Date:   Mon May 9 16:33:58 2011 +0200
  test/hkl/bench-t.c | 22 ++++++++++++++++------
  1 file changed, 16 insertions(+), 6 deletions(-)
 
+commit 8688c93affc233430accc9e040c91980f7207354
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun May 1 19:53:40 2011 +0200
+
+    remove useless files
+
+ hkl3d/bullet/src/BulletSoftBody/btSoftBody.cpp     | 2931 --------------------
+ hkl3d/bullet/src/BulletSoftBody/btSoftBody.h       |  891 ------
+ .../btSoftBodyConcaveCollisionAlgorithm.cpp        |  368 ---
+ .../btSoftBodyConcaveCollisionAlgorithm.h          |  153 -
+ .../src/BulletSoftBody/btSoftBodyHelpers.cpp       | 1019 -------
+ .../bullet/src/BulletSoftBody/btSoftBodyHelpers.h  |  143 -
+ .../src/BulletSoftBody/btSoftBodyInternals.h       |  931 -------
+ .../btSoftBodyRigidBodyCollisionConfiguration.cpp  |  134 -
+ .../btSoftBodyRigidBodyCollisionConfiguration.h    |   48 -
+ .../btSoftRigidCollisionAlgorithm.cpp              |   82 -
+ .../BulletSoftBody/btSoftRigidCollisionAlgorithm.h |   75 -
+ .../BulletSoftBody/btSoftRigidDynamicsWorld.cpp    |  292 --
+ .../src/BulletSoftBody/btSoftRigidDynamicsWorld.h  |   97 -
+ .../btSoftSoftCollisionAlgorithm.cpp               |   46 -
+ .../BulletSoftBody/btSoftSoftCollisionAlgorithm.h  |   69 -
+ hkl3d/bullet/src/BulletSoftBody/btSparseSDF.h      |  306 --
+ hkl3d/bullet/src/Makefile.am                       |   22 +-
+ hkl3d/bullet/src/MiniCL/cl.h                       |  865 ------
+ hkl3d/bullet/src/MiniCL/cl_MiniCL_Defs.h           |  265 --
+ hkl3d/bullet/src/MiniCL/cl_gl.h                    |  113 -
+ hkl3d/bullet/src/MiniCL/cl_platform.h              |  254 --
+ 21 files changed, 2 insertions(+), 9102 deletions(-)
+
 commit 5347e4ba57784be8d9024aa0337c4041b7c589d1
 Merge: 41c90a4 2165cc9
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -5456,6 +9401,19 @@ Date:   Fri Apr 29 22:17:26 2011 +0200
  test/tap/libtap.sh |  3 ++-
  4 files changed, 81 insertions(+), 50 deletions(-)
 
+commit 4522007fd73e2aaea30beb226711b879949cb629
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Fri Apr 29 22:11:37 2011 +0200
+
+    * work in progress
+
+ gui/Makefile.am          |   3 +
+ gui/g3d.vapi             |  55 ++++++++++
+ gui/hkl3d-gui-model.vala | 276 +++++++++++++++++++++--------------------------
+ gui/hkl3d-gui-scene.vala | 135 +++++++++++------------
+ gui/hkl3d.vapi           |  16 +--
+ 5 files changed, 251 insertions(+), 234 deletions(-)
+
 commit 2165cc97163034a2adaaef5bc4f5f3416a3b5dfe
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
 Date:   Fri Apr 29 10:47:18 2011 +0200
@@ -5466,6 +9424,32 @@ Date:   Fri Apr 29 10:47:18 2011 +0200
  NEWS                   |  3 +++
  2 files changed, 55 insertions(+), 2 deletions(-)
 
+commit 9a712722c1984b04ea66f3eb516a2825ac366053
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Apr 25 12:31:09 2011 +0200
+
+    * add the hkl3d-gui-scene.vala
+
+ configure.ac                  |   1 +
+ gui/Makefile.am               |  17 +-
+ gui/hkl-gui-3d.vala           |  17 +-
+ gui/hkl-gui-pseudoaxes.h      |   0
+ gui/hkl-gui-pseudoaxes.vala   |   2 +-
+ gui/hkl-gui.vala              |  73 ++++--
+ gui/hkl.vapi                  |  39 ++-
+ gui/hkl3d-gui-model.vala      | 561 ++++++++++++++++++++++++++++++++++++++++++
+ gui/hkl3d-gui-scene.vala      | 382 ++++++++++++++++++++++++++++
+ gui/hkl3d-gui-view.vala       | 218 ++++++++++++++++
+ gui/hkl3d/Makefile.am         |  24 +-
+ gui/hkl3d/hkl3d-gui-model.cpp | 407 ------------------------------
+ gui/hkl3d/hkl3d-gui-model.h   | 121 ---------
+ gui/hkl3d/hkl3d-gui-scene.cpp | 432 --------------------------------
+ gui/hkl3d/hkl3d-gui-scene.h   | 120 ---------
+ gui/hkl3d/hkl3d-gui-view.cpp  | 222 -----------------
+ gui/hkl3d/hkl3d-gui-view.h    | 109 --------
+ gui/trackball.vapi            |  36 +++
+ 18 files changed, 1315 insertions(+), 1466 deletions(-)
+
 commit 744156fb0db25b83d18ede8ea249a329351d539f
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
 Date:   Thu Apr 14 19:54:47 2011 +0200
@@ -6041,6 +10025,33 @@ Date:   Sat Jan 8 06:55:21 2011 -0500
  Documentation/figures/zaxis.asy   | 34 ++++++++++++++--------------------
  2 files changed, 18 insertions(+), 23 deletions(-)
 
+commit 585d8e247cc01107f82139d5e6f9611fce76c75f
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Jan 6 15:48:42 2011 -0500
+
+    * TO DELETE
+
+ test/hkl/axis-t.c            |  40 ++++++++--------
+ test/hkl/geometry-t.c        |  34 +++++++-------
+ test/hkl/interval-t.c        |   4 +-
+ test/hkl/lattice-t.c         | 108 +++++++++++++++++++++----------------------
+ test/hkl/matrix-t.c          |  18 ++++----
+ test/hkl/parameter-t.c       |  12 ++---
+ test/hkl/pseudoaxis-e4cv-t.c |  30 ++++++------
+ test/hkl/pseudoaxis-e6c-t.c  |  16 +++----
+ test/hkl/pseudoaxis-k4cv-t.c |  20 ++++----
+ test/hkl/pseudoaxis-k6c-t.c  |  22 ++++-----
+ test/hkl/pseudoaxis-t.c      |   6 +--
+ test/hkl/quaternion-t.c      |  16 +++----
+ test/hkl/sample-t.c          |  62 ++++++++++++-------------
+ test/hkl/source-t.c          |  12 ++---
+ test/hkl/vector-t.c          |  30 ++++++------
+ test/runtests.c              |  66 +++++++++++++++++---------
+ test/tap/basic.c             |  87 +++++++++++++++++++---------------
+ test/tap/basic.h             |  23 +++++++--
+ test/tap/libtap.sh           |  65 +++++++++++++++++++++-----
+ 19 files changed, 384 insertions(+), 287 deletions(-)
+
 commit c49422e6e39413950a4ba176a091ce08534938b6
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
 Date:   Thu Jan 6 14:30:03 2011 +0100
@@ -6053,6 +10064,35 @@ Date:   Thu Jan 6 14:30:03 2011 +0100
  configure.ac                      |  6 ++++
  4 files changed, 55 insertions(+), 30 deletions(-)
 
+commit a16281324308a4411fe43d2316e33749c00834f4
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Fri Dec 31 10:09:32 2010 -0500
+
+    * work on the 3d gui part, it seems that it compiles now
+
+ gui/hkl-gui-3d.vala | 131 +++++++++++++++++++++++++++-------------------------
+ gui/hkl3d.vapi      |   9 +++-
+ 2 files changed, 75 insertions(+), 65 deletions(-)
+
+commit 56a40497dd8da78c4ef8d53c6d892aa5625d390c
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Dec 30 09:54:13 2010 -0500
+
+    * now the signals are ok
+
+ gui/Makefile.am               |   1 +
+ gui/hkl-gui-3d.vala           |   2 +-
+ gui/hkl-gui-pseudoaxes.vala   |  21 +-
+ gui/hkl-gui.vala              | 550 +++++++++++++++++++++++-------------------
+ gui/hkl3d.vapi                |  15 +-
+ gui/hkl3d/hkl3d-gui-model.cpp |   6 +-
+ gui/hkl3d/hkl3d-gui-model.h   |   8 +-
+ gui/hkl3d/hkl3d-gui-scene.cpp |   2 +-
+ gui/hkl3d/hkl3d-gui-scene.h   |   2 +-
+ hkl3d/hkl3d.cpp               | 124 +++++-----
+ hkl3d/hkl3d.h                 |  78 +++---
+ 11 files changed, 438 insertions(+), 371 deletions(-)
+
 commit 5054481f1af5856b70571f61bbd4030238fe4f3a
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
 Date:   Mon Dec 13 02:25:57 2010 -0500
@@ -6479,6 +10519,93 @@ Date:   Sat Sep 18 10:02:43 2010 +0200
  test/hkl3d/test-t.c           |  12 ++---
  7 files changed, 120 insertions(+), 112 deletions(-)
 
+commit b01401357262335aebfe91d6b641bbb03b27e217
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Sep 18 09:42:17 2010 +0200
+
+    * work in progress
+
+ configure.ac                |    1 +
+ gui/Makefile.am             |   14 +-
+ gui/ghkl.vala               | 1985 -------------------------------------------
+ gui/gl.vapi                 | 1402 ++++++++++++++++++++++++++++++
+ gui/glu.vapi                |  301 +++++++
+ gui/glut.vapi               |  611 +++++++++++++
+ gui/glx.vapi                |  202 +++++
+ gui/gtkglext-1.0.vapi       |  373 ++++++++
+ gui/hkl-gui-3d.cpp          |  244 ------
+ gui/hkl-gui-3d.h            |   91 --
+ gui/hkl-gui-3d.vala         |  261 ++++++
+ gui/hkl-gui-pseudoaxes.vala |  217 +++++
+ gui/hkl-gui.vala            | 1985 +++++++++++++++++++++++++++++++++++++++++++
+ gui/hkl.vapi                |   12 +-
+ gui/hkl3d.vapi              |  104 +++
+ gui/pseudoaxesframe.vala    |  217 -----
+ hkl3d/hkl3d.h               |    6 +
+ 17 files changed, 5476 insertions(+), 2550 deletions(-)
+
+commit 8e6fc58522ecef974258b508fadf7ba3a20a9f72
+Merge: 66cdb7e 7402e4e
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Sep 16 23:03:21 2010 +0200
+
+    Merge branch 'next' into gtk
+    
+    Conflicts:
+    	configure.ac
+    	gui/Makefile.am
+    	gui/hkl-gui-callbacks.cpp
+    	gui/hkl-gui-modelcolumns.h
+    	gui/hkl-gui-pseudoaxes.cpp
+    	gui/hkl-gui-pseudoaxes.h
+    	gui/hkl-gui.cpp
+    	gui/hkl-gui.h
+    	gui/main.cpp
+
+commit 66cdb7ec98e86f9c8565eae79331629424c2f85a
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Sep 14 18:38:12 2010 +0200
+
+    * remove useless code
+
+ gui/ghkl.vala | 6 ------
+ 1 file changed, 6 deletions(-)
+
+commit 90ccacd8bbd4bdc2fbaf50fd1eace9e74417e2f7
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Sep 12 12:26:08 2010 +0200
+
+    * finish the transition to vala code for the interface
+
+ gui/Makefile.am       |    3 +-
+ gui/ghkl-callbacks.c  | 1262 -------------------------------------------------
+ gui/ghkl-callbacks.h  |  199 --------
+ gui/ghkl.h            |  243 ----------
+ gui/ghkl.vala         |    9 +
+ gui/main.c            |   39 --
+ gui/pseudoaxesframe.h |   55 ---
+ 7 files changed, 10 insertions(+), 1800 deletions(-)
+
+commit c9960f95ec610541ab49b1ff0c00ed612d5888e5
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Sep 12 10:53:34 2010 +0200
+
+    * fix the pseudo axes frames
+
+ gui/ghkl.vala | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+commit 34ee59fa605d8321ae03e8ccba5c53f7c657e976
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Fri Sep 10 11:35:27 2010 +0200
+
+    * work in progress
+
+ gui/ghkl.vala            | 255 +++++++++++++++++++++++------------------------
+ gui/hkl.vapi             |   8 +-
+ gui/pseudoaxesframe.vala |  10 +-
+ 3 files changed, 134 insertions(+), 139 deletions(-)
+
 commit 7402e4e761d2730005337bdf03b121c28e54d81d
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
 Date:   Tue Sep 7 10:17:04 2010 +0200
@@ -6490,6 +10617,73 @@ Date:   Tue Sep 7 10:17:04 2010 +0200
  test/hkl/bench-t.c | 21 ++++++++++++++-------
  1 file changed, 14 insertions(+), 7 deletions(-)
 
+commit 3f6f13f2a409a40eb83765eb1ff0dd2d241f0947
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 6 07:44:55 2010 +0200
+
+    * still work in progress
+
+ configure.ac             |    1 +
+ gui/Makefile.am          |    8 +-
+ gui/ghkl.vala            | 1161 +++++++++++++++++++++-------------------------
+ gui/hkl.vapi             |   99 ++--
+ gui/main.c               |    2 +-
+ gui/pseudoaxesframe.vala |    4 +
+ 6 files changed, 602 insertions(+), 673 deletions(-)
+
+commit dc78a4db56705a166031a02cc399f1b97363269b
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Sep 2 23:26:15 2010 +0200
+
+    * still working
+
+ gui/ghkl.vala      | 371 ++++++++++++++++++++++++-----------------------------
+ gui/hkl.vapi       |  31 ++++-
+ hkl/hkl-interval.c |   2 +-
+ 3 files changed, 198 insertions(+), 206 deletions(-)
+
+commit b4f0936b93dee22d50b5478f89c713d01273605c
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Wed Sep 1 22:46:29 2010 +0200
+
+    * still working
+
+ gui/ghkl.vala | 518 +++++++++++++++++++++++++---------------------------------
+ gui/hkl.vapi  |  32 +++-
+ 2 files changed, 256 insertions(+), 294 deletions(-)
+
+commit 942a49a3e34d929a987ef42756ca18b0a3125f64
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 31 22:59:31 2010 +0200
+
+    * still working
+
+ gui/ghkl.vala | 60 +++++++++++++++++++++++++++--------------------------------
+ gui/hkl.vapi  |  2 ++
+ 2 files changed, 29 insertions(+), 33 deletions(-)
+
+commit 93d19e6182a143bbac4adcbc4080330124bf6645
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 30 22:47:07 2010 +0200
+
+    * DELETE work in progress
+
+ gui/ghkl.vala | 761 ++++++++++++++++++++++------------------------------------
+ gui/hkl.vapi  |  36 +++
+ 2 files changed, 322 insertions(+), 475 deletions(-)
+
+commit 703e8046a9d57f58aa944506b83ffaedc3aa768a
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 30 18:24:51 2010 +0200
+
+    * TO DELETE work in progress
+
+ gui/Makefile.am |    3 +-
+ gui/ghkl.c      | 1349 -------------------------------------------------------
+ gui/ghkl.vala   | 1289 +++++++++++++++++++++++++++++++++++++++++++++-------
+ gui/hkl.vapi    |   68 +++
+ 4 files changed, 1191 insertions(+), 1518 deletions(-)
+
 commit f35055c053d0713c8b939b81d2ea69b63676bdef
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
 Date:   Mon Aug 30 16:31:25 2010 +0200
@@ -6499,6 +10693,22 @@ Date:   Mon Aug 30 16:31:25 2010 +0200
  hkl/pom.xml | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
+commit b23aa06dd7941f1fa60e13d6284999ef925b95c5
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Aug 29 23:19:30 2010 +0200
+
+    * work in progress
+
+ configure.ac             |    1 +
+ gui/Makefile.am          |    8 +-
+ gui/ghkl.c               |    5 +-
+ gui/ghkl.vala            | 1453 +++++++++++++++++++++++++++++++++++++++++++++-
+ gui/hkl.vapi             |   71 +++
+ gui/modelcolumns.h       |  161 -----
+ gui/pseudoaxesframe.c    |  234 --------
+ gui/pseudoaxesframe.vala |  213 +++++++
+ 8 files changed, 1720 insertions(+), 426 deletions(-)
+
 commit be344c27456256f466bae55ebea866ea6eae0d9b
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
 Date:   Sun Aug 29 13:15:31 2010 +0200
@@ -7523,6 +11733,18 @@ Date:   Fri Jul 30 21:47:45 2010 +0200
  Documentation/hkl.lyx                           |  14 +-
  14 files changed, 810 insertions(+), 810 deletions(-)
 
+commit 35f3a106aa2e1cb6cb60eca4b2f15e1619272748
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 9 22:40:22 2010 +0200
+
+    * work in progress
+
+ gui/ghkl-callbacks.c  |  98 +++++-----
+ gui/ghkl.c            | 517 ++++++++++++++++++++++++++++++--------------------
+ gui/ghkl.h            |  16 +-
+ gui/pseudoaxesframe.c |   1 +
+ 4 files changed, 372 insertions(+), 260 deletions(-)
+
 commit 59f03f1629eada7ada70a45e4a76d4d2685f3805
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
 Date:   Tue Aug 3 17:27:37 2010 +0200
@@ -7765,6 +11987,18 @@ Date:   Mon Jul 5 16:20:50 2010 +0200
  hkl3d/hkl3d.h   |  1 +
  2 files changed, 26 insertions(+), 14 deletions(-)
 
+commit 85b06ef9d57f583a884b600ce6ec59cc2d29833a
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jul 4 23:15:52 2010 +0200
+
+    * still working on the C++ -> C conversion
+
+ gui/ghkl-callbacks.c | 1565 ++++++++++++++++++++++++++++----------------------
+ gui/ghkl-callbacks.h |  243 +++++---
+ gui/ghkl.c           |  763 +++++++++++++++---------
+ gui/ghkl.h           |  146 +++--
+ 4 files changed, 1616 insertions(+), 1101 deletions(-)
+
 commit dc668d9829bedede5677230313cf520ebcb931b0
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
 Date:   Fri Jul 2 14:17:47 2010 +0200
@@ -7804,6 +12038,16 @@ Date:   Fri Jul 2 08:58:49 2010 +0200
  hkl3d/hkl3d.cpp | 17 ++++++++++++-----
  1 file changed, 12 insertions(+), 5 deletions(-)
 
+commit 6cbcfcd8af8787fc1a56796b6e2c1acbd8da86fb
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Jul 1 23:32:15 2010 +0200
+
+    * work in progress
+
+ gui/ghkl-callbacks.c | 661 +++++++++++++++++++++++++++++----------------------
+ gui/ghkl-callbacks.h |  80 +++++--
+ 2 files changed, 436 insertions(+), 305 deletions(-)
+
 commit f51567e641a3349e64f9ab5147e7d9e906652f67
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
 Date:   Thu Jul 1 15:12:57 2010 +0200
@@ -7871,6 +12115,57 @@ Date:   Wed Jun 23 17:11:40 2010 +0100
  gui/hkl3d/hkl3d-gui-view.h    |  2 +-
  6 files changed, 37 insertions(+), 8 deletions(-)
 
+commit 2f8785c760d689223e0d7cea9efdad73559c9d28
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 27 13:10:00 2010 +0200
+
+    * start to implement the pseudo axes frames.
+
+ gui/ghkl.c | 66 +++++++++++++++++++++++++++++++++++++-------------------------
+ gui/ghkl.h |  3 ++-
+ 2 files changed, 41 insertions(+), 28 deletions(-)
+
+commit b60f3bfd604028ba4415f9bbaded3469401d5404
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 27 13:09:28 2010 +0200
+
+    * add the signals
+
+ gui/ghkl.c | 265 +++++++++++++++++++++++++++++++++++--------------------------
+ 1 file changed, 151 insertions(+), 114 deletions(-)
+
+commit d26d5adee35888aade6fb6ba1fb1ea72d32c371c
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 27 12:43:57 2010 +0200
+
+    * put all the ghkl.h callbacks in their own file ghkl-callbacks.h
+
+ gui/ghkl-callbacks.h | 102 ++++++++++++++++++++++++++++++++++++++
+ gui/ghkl.c           |   1 +
+ gui/ghkl.h           | 135 +++++++++++----------------------------------------
+ 3 files changed, 132 insertions(+), 106 deletions(-)
+
+commit bc038ed8003dc9947ecbbac085dc7767a294d5ee
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jun 26 15:46:11 2010 +0200
+
+    * work in progress
+
+ configure.ac            |   6 +-
+ gui/Makefile.am         |  18 +-
+ gui/ghkl-callbacks.c    | 962 ++++++++++++++++++++++++++++++++++++++++++++++
+ gui/ghkl-callbacks.cpp  | 962 ----------------------------------------------
+ gui/ghkl.c              | 992 ++++++++++++++++++++++++++++++++++++++++++++++++
+ gui/ghkl.cpp            | 939 ---------------------------------------------
+ gui/ghkl.h              | 433 +++++++++++----------
+ gui/ghkl.vala           |  32 ++
+ gui/main.c              |  39 ++
+ gui/main.cpp            |  33 --
+ gui/pseudoaxesframe.c   | 233 ++++++++++++
+ gui/pseudoaxesframe.cpp | 202 ----------
+ gui/pseudoaxesframe.h   |  90 +----
+ 13 files changed, 2504 insertions(+), 2437 deletions(-)
+
 commit 2ad80d55f7a924d3977c6145100b505735495dc5
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
 Date:   Sat Jun 26 11:33:07 2010 +0200
diff --git a/Documentation/Makefile.am b/Documentation/Makefile.am
index 41c68cc..ab33477 100644
--- a/Documentation/Makefile.am
+++ b/Documentation/Makefile.am
@@ -1,3 +1,24 @@
 SUBDIRS=api figures sphinx
 
-dist_man_MANS = ghkl.1
\ No newline at end of file
+dist_man_MANS = ghkl.1
+
+AM_LDFLAGS = $(top_builddir)/hkl/libhkl.la
+
+dist_html_DATA=hkl.html
+
+hkl.html: hkl.org $(srcdir)/default.el
+	env GI_TYPELIB_PATH=$(top_builddir)/hkl \
+	$(LIBTOOL) --mode=execute -dlopen $(AM_LDFLAGS) \
+	$(EMACS) $< --batch -q --load $(srcdir)/default.el -f org-html-export-to-html --kill
+
+EXTRA_DIST=default.el
+
+CLEANFILES=hkl.html
+
+editdoc:
+	env GI_TYPELIB_PATH=$(top_builddir)/hkl \
+	$(LIBTOOL) --mode=execute -dlopen $(AM_LDFLAGS) \
+	$(EMACS) hkl.org.in -q --load $(srcdir)/default.el
+
+
+.PHONY: editdoc
diff --git a/Documentation/Makefile.in b/Documentation/Makefile.in
index 04f6c4b..1b833bf 100644
--- a/Documentation/Makefile.in
+++ b/Documentation/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
@@ -13,6 +13,7 @@
 # PARTICULAR PURPOSE.
 
 @SET_MAKE@
+
 VPATH = @srcdir@
 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
 am__make_running_with_option = \
@@ -79,7 +80,7 @@ build_triplet = @build@
 host_triplet = @host@
 subdir = Documentation
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(dist_man_MANS)
+	$(srcdir)/hkl.org.in $(dist_man_MANS) $(dist_html_DATA)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
 	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
@@ -89,7 +90,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_FILES = hkl.org
 CONFIG_CLEAN_VPATH_FILES =
 AM_V_P = $(am__v_P_ at AM_V@)
 am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
@@ -146,9 +147,10 @@ am__uninstall_files_from_dir = { \
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
 man1dir = $(mandir)/man1
-am__installdirs = "$(DESTDIR)$(man1dir)"
+am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(htmldir)"
 NROFF = nroff
 MANS = $(dist_man_MANS)
+DATA = $(dist_html_DATA)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
 am__recursive_targets = \
@@ -213,6 +215,8 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BULLET_CFLAGS = @BULLET_CFLAGS@
+BULLET_LIBS = @BULLET_LIBS@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
@@ -232,6 +236,7 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+EMACS = @EMACS@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
 G3D_CFLAGS = @G3D_CFLAGS@
@@ -251,14 +256,15 @@ GSL_CFLAGS = @GSL_CFLAGS@
 GSL_CONFIG = @GSL_CONFIG@
 GSL_LIBS = @GSL_LIBS@
 GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@
 GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
 GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
 GTKDOC_MKPDF = @GTKDOC_MKPDF@
 GTKDOC_REBASE = @GTKDOC_REBASE@
-GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
-GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
-GTKMM_CFLAGS = @GTKMM_CFLAGS@
-GTKMM_LIBS = @GTKMM_LIBS@
+GTKGLEXT_CFLAGS = @GTKGLEXT_CFLAGS@
+GTKGLEXT_LIBS = @GTKGLEXT_LIBS@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
 HTML_DIR = @HTML_DIR@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -354,7 +360,6 @@ localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
-opengl_LIBS = @opengl_LIBS@
 pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
@@ -371,6 +376,10 @@ top_srcdir = @top_srcdir@
 version_info = @version_info@
 SUBDIRS = api figures sphinx
 dist_man_MANS = ghkl.1
+AM_LDFLAGS = $(top_builddir)/hkl/libhkl.la
+dist_html_DATA = hkl.html
+EXTRA_DIST = default.el
+CLEANFILES = hkl.html
 all: all-recursive
 
 .SUFFIXES:
@@ -404,6 +413,8 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
+hkl.org: $(top_builddir)/config.status $(srcdir)/hkl.org.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -453,6 +464,27 @@ uninstall-man1:
 	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
 	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
 	dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
+install-dist_htmlDATA: $(dist_html_DATA)
+	@$(NORMAL_INSTALL)
+	@list='$(dist_html_DATA)'; test -n "$(htmldir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
+	done
+
+uninstall-dist_htmlDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(dist_html_DATA)'; test -n "$(htmldir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(htmldir)'; $(am__uninstall_files_from_dir)
 
 # This directory's subdirectories are mostly independent; you can cd
 # into them and run 'make' without going through this Makefile.
@@ -610,10 +642,10 @@ distdir: $(DISTFILES)
 	done
 check-am: all-am
 check: check-recursive
-all-am: Makefile $(MANS)
+all-am: Makefile $(MANS) $(DATA)
 installdirs: installdirs-recursive
 installdirs-am:
-	for dir in "$(DESTDIR)$(man1dir)"; do \
+	for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(htmldir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-recursive
@@ -638,6 +670,7 @@ install-strip:
 mostlyclean-generic:
 
 clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -666,7 +699,7 @@ info: info-recursive
 
 info-am:
 
-install-data-am: install-man
+install-data-am: install-dist_htmlDATA install-man
 
 install-dvi: install-dvi-recursive
 
@@ -710,7 +743,7 @@ ps: ps-recursive
 
 ps-am:
 
-uninstall-am: uninstall-man
+uninstall-am: uninstall-dist_htmlDATA uninstall-man
 
 uninstall-man: uninstall-man1
 
@@ -720,16 +753,29 @@ uninstall-man: uninstall-man1
 	check-am clean clean-generic clean-libtool cscopelist-am ctags \
 	ctags-am distclean distclean-generic distclean-libtool \
 	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-man1 install-pdf install-pdf-am install-ps \
-	install-ps-am install-strip installcheck installcheck-am \
-	installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
-	uninstall-am uninstall-man uninstall-man1
-
+	install install-am install-data install-data-am \
+	install-dist_htmlDATA install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-man1 install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs installdirs-am \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-am uninstall uninstall-am uninstall-dist_htmlDATA \
+	uninstall-man uninstall-man1
+
+
+hkl.html: hkl.org $(srcdir)/default.el
+	env GI_TYPELIB_PATH=$(top_builddir)/hkl \
+	$(LIBTOOL) --mode=execute -dlopen $(AM_LDFLAGS) \
+	$(EMACS) $< --batch -q --load $(srcdir)/default.el -f org-html-export-to-html --kill
+
+editdoc:
+	env GI_TYPELIB_PATH=$(top_builddir)/hkl \
+	$(LIBTOOL) --mode=execute -dlopen $(AM_LDFLAGS) \
+	$(EMACS) hkl.org.in -q --load $(srcdir)/default.el
+
+.PHONY: editdoc
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/Documentation/api/Makefile.in b/Documentation/api/Makefile.in
index a74e9d8..9a24450 100644
--- a/Documentation/api/Makefile.in
+++ b/Documentation/api/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
@@ -128,6 +128,8 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BULLET_CFLAGS = @BULLET_CFLAGS@
+BULLET_LIBS = @BULLET_LIBS@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
@@ -147,6 +149,7 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+EMACS = @EMACS@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
 G3D_CFLAGS = @G3D_CFLAGS@
@@ -166,14 +169,15 @@ GSL_CFLAGS = @GSL_CFLAGS@
 GSL_CONFIG = @GSL_CONFIG@
 GSL_LIBS = @GSL_LIBS@
 GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@
 GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
 GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
 GTKDOC_MKPDF = @GTKDOC_MKPDF@
 GTKDOC_REBASE = @GTKDOC_REBASE@
-GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
-GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
-GTKMM_CFLAGS = @GTKMM_CFLAGS@
-GTKMM_LIBS = @GTKMM_LIBS@
+GTKGLEXT_CFLAGS = @GTKGLEXT_CFLAGS@
+GTKGLEXT_LIBS = @GTKGLEXT_LIBS@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
 HTML_DIR = @HTML_DIR@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -269,7 +273,6 @@ localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
-opengl_LIBS = @opengl_LIBS@
 pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
@@ -406,11 +409,42 @@ REPORT_FILES = \
 	$(DOC_MODULE)-undeclared.txt \
 	$(DOC_MODULE)-unused.txt
 
-CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS)
- at ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_FALSE at HTML_BUILD_STAMP = 
- at ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_TRUE at HTML_BUILD_STAMP = html-build.stamp
- at ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_FALSE at PDF_BUILD_STAMP = 
- at ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_TRUE at PDF_BUILD_STAMP = pdf-build.stamp
+CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test
+ at GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = 
+ at GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp
+ at GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = 
+ at GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp
+
+#### setup ####
+GTK_DOC_V_SETUP = $(GTK_DOC_V_SETUP_$(V))
+GTK_DOC_V_SETUP_ = $(GTK_DOC_V_SETUP_$(AM_DEFAULT_VERBOSITY))
+GTK_DOC_V_SETUP_0 = @echo "  DOC   Preparing build";
+
+#### scan ####
+GTK_DOC_V_SCAN = $(GTK_DOC_V_SCAN_$(V))
+GTK_DOC_V_SCAN_ = $(GTK_DOC_V_SCAN_$(AM_DEFAULT_VERBOSITY))
+GTK_DOC_V_SCAN_0 = @echo "  DOC   Scanning header files";
+GTK_DOC_V_INTROSPECT = $(GTK_DOC_V_INTROSPECT_$(V))
+GTK_DOC_V_INTROSPECT_ = $(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY))
+GTK_DOC_V_INTROSPECT_0 = @echo "  DOC   Introspecting gobjects";
+
+#### xml ####
+GTK_DOC_V_XML = $(GTK_DOC_V_XML_$(V))
+GTK_DOC_V_XML_ = $(GTK_DOC_V_XML_$(AM_DEFAULT_VERBOSITY))
+GTK_DOC_V_XML_0 = @echo "  DOC   Building XML";
+
+#### html ####
+GTK_DOC_V_HTML = $(GTK_DOC_V_HTML_$(V))
+GTK_DOC_V_HTML_ = $(GTK_DOC_V_HTML_$(AM_DEFAULT_VERBOSITY))
+GTK_DOC_V_HTML_0 = @echo "  DOC   Building HTML";
+GTK_DOC_V_XREF = $(GTK_DOC_V_XREF_$(V))
+GTK_DOC_V_XREF_ = $(GTK_DOC_V_XREF_$(AM_DEFAULT_VERBOSITY))
+GTK_DOC_V_XREF_0 = @echo "  DOC   Fixing cross-references";
+
+#### pdf ####
+GTK_DOC_V_PDF = $(GTK_DOC_V_PDF_$(V))
+GTK_DOC_V_PDF_ = $(GTK_DOC_V_PDF_$(AM_DEFAULT_VERBOSITY))
+GTK_DOC_V_PDF_0 = @echo "  DOC   Building PDF";
 
 # Files not to distribute
 # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types
@@ -498,6 +532,7 @@ distdir: $(DISTFILES)
 	  dist-hook
 check-am: all-am
 check: check-am
+ at ENABLE_GTK_DOC_FALSE@all-local:
 all-am: Makefile all-local
 installdirs:
 install: install-am
@@ -616,39 +651,41 @@ uninstall-am: uninstall-local
 	uninstall-am uninstall-local
 
 
- at ENABLE_GTK_DOC_TRUE@all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
- at ENABLE_GTK_DOC_FALSE@all-local:
+gtkdoc-check.test: Makefile
+	$(AM_V_GEN)echo "#!/bin/sh -e" > $@; \
+		echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \
+		chmod +x $@
+
+all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
+.PHONY: all-gtk-doc
+
+ at ENABLE_GTK_DOC_TRUE@all-local: all-gtk-doc
 
 docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
 
 $(REPORT_FILES): sgml-build.stamp
 
-#### setup ####
-
 setup-build.stamp:
-	- at if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
-	    echo '  DOC   Preparing build'; \
+	-$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
 	    files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \
 	    if test "x$$files" != "x" ; then \
 	        for file in $$files ; do \
+	            destdir=`dirname $(abs_builddir)/$$file`; \
+	            test -d "$$destdir" || mkdir -p "$$destdir"; \
 	            test -f $(abs_srcdir)/$$file && \
-	                cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \
+	                cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \
 	        done; \
 	    fi; \
 	fi
-	@touch setup-build.stamp
+	$(AM_V_at)touch setup-build.stamp
 
-#### scan ####
-
-scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
-	@echo '  DOC   Scanning header files'
-	@_source_dir='' ; \
+scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB)
+	$(GTK_DOC_V_SCAN)_source_dir='' ; \
 	for i in $(DOC_SOURCE_DIR) ; do \
 	    _source_dir="$${_source_dir} --source-dir=$$i" ; \
 	done ; \
 	gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
-	@if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \
-	    echo "  DOC   Introspecting gobjects"; \
+	$(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \
 	    scanobj_options=""; \
 	    gtkdoc-scangobj 2>&1 --help | grep  >/dev/null "\-\-verbose"; \
 	    if test "$(?)" = "0"; then \
@@ -663,32 +700,25 @@ scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
 	        test -f $$i || touch $$i ; \
 	    done \
 	fi
-	@touch scan-build.stamp
+	$(AM_V_at)touch scan-build.stamp
 
 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp
 	@true
 
-#### xml ####
-
 sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files)
-	@echo '  DOC   Building XML'
-	@_source_dir='' ; \
+	$(GTK_DOC_V_XML)_source_dir='' ; \
 	for i in $(DOC_SOURCE_DIR) ; do \
 	    _source_dir="$${_source_dir} --source-dir=$$i" ; \
 	done ; \
 	gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS)
-	@touch sgml-build.stamp
+	$(AM_V_at)touch sgml-build.stamp
 
 sgml.stamp: sgml-build.stamp
 	@true
 
-#### html ####
-
 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
-	@echo '  DOC   Building HTML'
-	@rm -rf html
-	@mkdir html
-	@mkhtml_options=""; \
+	$(GTK_DOC_V_HTML)rm -rf html && mkdir html && \
+	mkhtml_options=""; \
 	gtkdoc-mkhtml 2>&1 --help | grep  >/dev/null "\-\-verbose"; \
 	if test "$(?)" = "0"; then \
 	  if test "x$(V)" = "x1"; then \
@@ -709,16 +739,12 @@ html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
 	    cp $(abs_builddir)/$$file $(abs_builddir)/html; \
 	  fi; \
 	done;
-	@echo '  DOC   Fixing cross-references'
-	@gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
-	@touch html-build.stamp
-
-#### pdf ####
+	$(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
+	$(AM_V_at)touch html-build.stamp
 
 pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
-	@echo '  DOC   Building PDF'
-	@rm -f $(DOC_MODULE).pdf
-	@mkpdf_options=""; \
+	$(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \
+	mkpdf_options=""; \
 	gtkdoc-mkpdf 2>&1 --help | grep  >/dev/null "\-\-verbose"; \
 	if test "$(?)" = "0"; then \
 	  if test "x$(V)" = "x1"; then \
@@ -735,13 +761,16 @@ pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
 	  done; \
 	fi; \
 	gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
-	@touch pdf-build.stamp
+	$(AM_V_at)touch pdf-build.stamp
 
 ##############
 
 clean-local:
 	@rm -f *~ *.bak
 	@rm -rf .libs
+	@if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \
+	  rm -f $(DOC_MODULE).types; \
+	fi
 
 distclean-local:
 	@rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \
@@ -750,7 +779,7 @@ distclean-local:
 	    rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \
 	fi
 
-maintainer-clean-local: clean
+maintainer-clean-local:
 	@rm -rf xml html
 
 install-data-local:
@@ -786,12 +815,14 @@ uninstall-local:
 #
 # Require gtk-doc when making dist
 #
- at ENABLE_GTK_DOC_TRUE@dist-check-gtkdoc:
- at ENABLE_GTK_DOC_FALSE@dist-check-gtkdoc:
- at ENABLE_GTK_DOC_FALSE@	@echo "*** gtk-doc must be installed and enabled in order to make dist"
- at ENABLE_GTK_DOC_FALSE@	@false
-
-dist-hook: dist-check-gtkdoc dist-hook-local
+ at HAVE_GTK_DOC_TRUE@dist-check-gtkdoc: docs
+ at HAVE_GTK_DOC_FALSE@dist-check-gtkdoc:
+ at HAVE_GTK_DOC_FALSE@	@echo "*** gtk-doc is needed to run 'make dist'.         ***"
+ at HAVE_GTK_DOC_FALSE@	@echo "*** gtk-doc was not found when 'configure' ran.   ***"
+ at HAVE_GTK_DOC_FALSE@	@echo "*** please install gtk-doc and rerun 'configure'. ***"
+ at HAVE_GTK_DOC_FALSE@	@false
+
+dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local
 	@mkdir $(distdir)/html
 	@cp ./html/* $(distdir)/html
 	@-cp ./$(DOC_MODULE).pdf $(distdir)/
diff --git a/Documentation/api/hkl-docs.sgml b/Documentation/api/hkl-docs.sgml
index 541be6a..df2b53a 100644
--- a/Documentation/api/hkl-docs.sgml
+++ b/Documentation/api/hkl-docs.sgml
@@ -23,9 +23,10 @@
     <xi:include href="xml/compiler.xml"/>
     <xi:include href="xml/container_of.xml"/>
     <xi:include href="xml/darray.xml"/>
+    <xi:include href="xml/hkl.xml"/>
     <xi:include href="xml/hkl-axis-private.xml"/>
     <xi:include href="xml/hkl-detector-private.xml"/>
-    <xi:include href="xml/hkl-error-private.xml"/>
+    <xi:include href="xml/hkl-factory-private.xml"/>
     <xi:include href="xml/hkl-geometry-private.xml"/>
     <xi:include href="xml/hkl-interval-private.xml"/>
     <xi:include href="xml/hkl-lattice-private.xml"/>
@@ -37,14 +38,7 @@
     <xi:include href="xml/hkl-pseudoaxis-common-hkl-private.xml"/>
     <xi:include href="xml/hkl-pseudoaxis-common-psi-private.xml"/>
     <xi:include href="xml/hkl-pseudoaxis-common-q-private.xml"/>
-    <xi:include href="xml/hkl-pseudoaxis-e4c-private.xml"/>
-    <xi:include href="xml/hkl-pseudoaxis-e6c-private.xml"/>
-    <xi:include href="xml/hkl-pseudoaxis-k4cv-private.xml"/>
-    <xi:include href="xml/hkl-pseudoaxis-k6c-private.xml"/>
-    <xi:include href="xml/hkl-pseudoaxis-petra3-private.xml"/>
     <xi:include href="xml/hkl-pseudoaxis-private.xml"/>
-    <xi:include href="xml/hkl-pseudoaxis-soleil-sixs-med-private.xml"/>
-    <xi:include href="xml/hkl-pseudoaxis-zaxis-private.xml"/>
     <xi:include href="xml/hkl-quaternion-private.xml"/>
     <xi:include href="xml/hkl-sample-private.xml"/>
     <xi:include href="xml/hkl-source-private.xml"/>
@@ -55,6 +49,8 @@
     <xi:include href="xml/list.xml"/>
     <xi:include href="xml/noerr.xml"/>
     <xi:include href="xml/ptr_valid.xml"/>
+    <xi:include href="xml/str.xml"/>
+    <xi:include href="xml/str_debug.xml"/>
 
   </chapter>
   <chapter id="object-tree">
diff --git a/Documentation/api/html/annotation-glossary.html b/Documentation/api/html/annotation-glossary.html
index 0dc717f..18d0a6c 100644
--- a/Documentation/api/html/annotation-glossary.html
+++ b/Documentation/api/html/annotation-glossary.html
@@ -2,53 +2,41 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>Annotation Glossary</title>
+<title>hkl Reference Manual: Annotation Glossary</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="index.html" title="hkl Reference Manual">
 <link rel="prev" href="deprecated-api-index.html" title="Index of deprecated API">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="deprecated-api-index.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td> </td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td> </td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a class="shortcut" href="#glsA">A</a>
-                      | 
-                   <a class="shortcut" href="#glsO">O</a>
-                      | 
-                   <a class="shortcut" href="#glsI">I</a>
-                      | 
-                   <a class="shortcut" href="#glsT">T</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts"><span id="nav_glossary"><a class="shortcut" href="#glsI">I</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#glsO">O</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#glsT">T</a></span></td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
+<td><a accesskey="p" href="deprecated-api-index.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><img src="right-insensitive.png" width="16" height="16" border="0"></td>
+</tr></table>
 <div class="glossary">
 <div class="titlepage"><div><div><h1 class="title">
 <a name="annotation-glossary"></a>Annotation Glossary</h1></div></div></div>
-<a name="glsA"></a><h3 class="title">A</h3>
-<dt><span class="glossterm"><a name="annotation-glossterm-array"></a>array</span></dt>
-<dd class="glossdef"><p>Parameter points to an array of items.</p></dd>
-<a name="glsO"></a><h3 class="title">O</h3>
-<dt><span class="glossterm"><a name="annotation-glossterm-out"></a>out</span></dt>
-<dd class="glossdef"><p>Parameter for returning results. Default is <acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>.</p></dd>
 <a name="glsI"></a><h3 class="title">I</h3>
 <dt><span class="glossterm"><a name="annotation-glossterm-in"></a>in</span></dt>
 <dd class="glossdef"><p>Parameter for input. Default is <acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>.</p></dd>
+<a name="glsO"></a><h3 class="title">O</h3>
+<dt><span class="glossterm"><a name="annotation-glossterm-out%20caller-allocates"></a>out caller-allocates</span></dt>
+<dd class="glossdef"><p>Out parameter, where caller must allocate storage.</p></dd>
 <a name="glsT"></a><h3 class="title">T</h3>
-<dt><span class="glossterm"><a name="annotation-glossterm-transfer%20full"></a>transfer full</span></dt>
-<dd class="glossdef"><p>Free data after the code is done.</p></dd>
 <dt><span class="glossterm"><a name="annotation-glossterm-transfer%20none"></a>transfer none</span></dt>
 <dd class="glossdef"><p>Don't free data after the code is done.</p></dd>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/api-index-full.html b/Documentation/api/html/api-index-full.html
index fb05def..368390c 100644
--- a/Documentation/api/html/api-index-full.html
+++ b/Documentation/api/html/api-index-full.html
@@ -2,66 +2,63 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>API Index</title>
+<title>hkl Reference Manual: API Index</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="index.html" title="hkl Reference Manual">
 <link rel="prev" href="object-tree.html" title="Object Hierarchy">
 <link rel="next" href="deprecated-api-index.html" title="Index of deprecated API">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="object-tree.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td> </td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="deprecated-api-index.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a class="shortcut" href="#idxA">A</a>
-                      | 
-                   <a class="shortcut" href="#idxB">B</a>
-                      | 
-                   <a class="shortcut" href="#idxC">C</a>
-                      | 
-                   <a class="shortcut" href="#idxD">D</a>
-                      | 
-                   <a class="shortcut" href="#idxE">E</a>
-                      | 
-                   <a class="shortcut" href="#idxF">F</a>
-                      | 
-                   <a class="shortcut" href="#idxG">G</a>
-                      | 
-                   <a class="shortcut" href="#idxH">H</a>
-                      | 
-                   <a class="shortcut" href="#idxI">I</a>
-                      | 
-                   <a class="shortcut" href="#idxL">L</a>
-                      | 
-                   <a class="shortcut" href="#idxM">M</a>
-                      | 
-                   <a class="shortcut" href="#idxN">N</a>
-                      | 
-                   <a class="shortcut" href="#idxP">P</a>
-                      | 
-                   <a class="shortcut" href="#idxQ">Q</a>
-                      | 
-                   <a class="shortcut" href="#idxR">R</a>
-                      | 
-                   <a class="shortcut" href="#idxS">S</a>
-                      | 
-                   <a class="shortcut" href="#idxT">T</a>
-                      | 
-                   <a class="shortcut" href="#idxU">U</a>
-                      | 
-                   <a class="shortcut" href="#idxV">V</a>
-                      | 
-                   <a class="shortcut" href="#idxW">W</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts"><span id="nav_index"><a class="shortcut" href="#idxA">A</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#idxB">B</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#idxC">C</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#idxD">D</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#idxE">E</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#idxF">F</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#idxG">G</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#idxH">H</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#idxI">I</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#idxK">K</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#idxL">L</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#idxM">M</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#idxN">N</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#idxP">P</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#idxQ">Q</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#idxR">R</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#idxS">S</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#idxT">T</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#idxU">U</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#idxV">V</a>
+                     <span class="dim">|</span> 
+                  <a class="shortcut" href="#idxW">W</a></span></td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
+<td><a accesskey="p" href="object-tree.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="deprecated-api-index.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="index">
 <div class="titlepage"><div><div><h1 class="title">
 <a name="api-index-full"></a>API Index</h1></div></div></div>
@@ -79,11 +76,11 @@
 </dt>
 <dd></dd>
 <dt>
-HKLAPI, macro in hkl
+<a class="link" href="hkl-hkl.html#HKLAPI:CAPS" title="HKLAPI">HKLAPI</a>, macro in <a class="link" href="hkl-hkl.html" title="hkl">hkl</a>
 </dt>
 <dd></dd>
 <dt>
-HKL_ARG_NONNULL, macro in hkl
+<a class="link" href="hkl-hkl.html#HKL-ARG-NONNULL:CAPS" title="HKL_ARG_NONNULL()">HKL_ARG_NONNULL</a>, macro in <a class="link" href="hkl-hkl.html" title="hkl">hkl</a>
 </dt>
 <dd></dd>
 <dt>
@@ -99,7 +96,7 @@ HKL_ARG_NONNULL, macro in hkl
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-autodata.html#autodata-free" title="autodata_free ()">autodata_free</a>, function in <a class="link" href="hkl-autodata.html" title="autodata">autodata</a>
+<a class="link" href="hkl-autodata.html#autodata-free" title="autodata_free ()">autodata_free</a>, function in <a class="link" href="hkl-autodata.html" title="autodata">autodata</a>
 </dt>
 <dd></dd>
 <dt>
@@ -107,7 +104,7 @@ HKL_ARG_NONNULL, macro in hkl
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-autodata.html#autodata-get-section" title="autodata_get_section ()">autodata_get_section</a>, function in <a class="link" href="hkl-autodata.html" title="autodata">autodata</a>
+<a class="link" href="hkl-autodata.html#autodata-get-section" title="autodata_get_section ()">autodata_get_section</a>, function in <a class="link" href="hkl-autodata.html" title="autodata">autodata</a>
 </dt>
 <dd></dd>
 <dt>
@@ -115,7 +112,7 @@ HKL_ARG_NONNULL, macro in hkl
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-autodata.html#autodata-make-table" title="autodata_make_table ()">autodata_make_table</a>, function in <a class="link" href="hkl-autodata.html" title="autodata">autodata</a>
+<a class="link" href="hkl-autodata.html#autodata-make-table" title="autodata_make_table ()">autodata_make_table</a>, function in <a class="link" href="hkl-autodata.html" title="autodata">autodata</a>
 </dt>
 <dd></dd>
 <dt>
@@ -134,11 +131,11 @@ HKL_ARG_NONNULL, macro in hkl
 <a class="link" href="hkl-hkl-axis-private.html#HklAxis" title="struct HklAxis">HklAxis</a>, struct in <a class="link" href="hkl-hkl-axis-private.html" title="hkl-axis-private">hkl-axis-private</a>
 </dt>
 <dd></dd>
-<a name="idxB"></a><h3 class="title">B</h3>
 <dt>
-<a href="hkl-hkl-macros.html#HKL-BEGIN-DECLS:CAPS">HKL_BEGIN_DECLS</a>, macro in hkl
+<a class="link" href="hkl-hkl-pseudoaxis-private.html#axis" title="axis">axis</a>, variable in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
 </dt>
 <dd></dd>
+<a name="idxB"></a><h3 class="title">B</h3>
 <dt>
 <a class="link" href="hkl-build-assert.html#BUILD-ASSERT:CAPS" title="BUILD_ASSERT()">BUILD_ASSERT</a>, macro in <a class="link" href="hkl-build-assert.html" title="build_assert">build_assert</a>
 </dt>
@@ -161,7 +158,7 @@ HKL_ARG_NONNULL, macro in hkl
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-noerr.html#close-noerr" title="close_noerr ()">close_noerr</a>, function in <a class="link" href="hkl-noerr.html" title="noerr">noerr</a>
+<a class="link" href="hkl-noerr.html#close-noerr" title="close_noerr ()">close_noerr</a>, function in <a class="link" href="hkl-noerr.html" title="noerr">noerr</a>
 </dt>
 <dd></dd>
 <dt>
@@ -169,6 +166,10 @@ HKL_ARG_NONNULL, macro in hkl
 </dt>
 <dd></dd>
 <dt>
+<a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#CONSTANT-PARAMETER:CAPS" title="CONSTANT_PARAMETER()">CONSTANT_PARAMETER</a>, macro in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html" title="hkl-pseudoaxis-common-hkl-private">hkl-pseudoaxis-common-hkl-private</a>
+</dt>
+<dd></dd>
+<dt>
 <a class="link" href="hkl-compiler.html#CONST-FUNCTION:CAPS" title="CONST_FUNCTION">CONST_FUNCTION</a>, macro in <a class="link" href="hkl-compiler.html" title="compiler">compiler</a>
 </dt>
 <dd></dd>
@@ -194,6 +195,10 @@ HKL_ARG_NONNULL, macro in hkl
 </dt>
 <dd></dd>
 <dt>
+<a class="link" href="hkl-hkl-macros-private.html#DARRAY:CAPS" title="DARRAY()">DARRAY</a>, macro in <a class="link" href="hkl-hkl-macros-private.html" title="hkl-macros-private">hkl-macros-private</a>
+</dt>
+<dd></dd>
+<dt>
 <a class="link" href="hkl-darray.html#darray-alloc" title="darray_alloc()">darray_alloc</a>, macro in <a class="link" href="hkl-darray.html" title="darray">darray</a>
 </dt>
 <dd></dd>
@@ -234,7 +239,7 @@ HKL_ARG_NONNULL, macro in hkl
 </dt>
 <dd></dd>
 <dt>
-darray_engine, typedef in hkl
+<a class="link" href="hkl-hkl.html#darray-engine" title="darray_engine">darray_engine</a>, typedef in <a class="link" href="hkl-hkl.html" title="hkl">hkl</a>
 </dt>
 <dd></dd>
 <dt>
@@ -266,6 +271,10 @@ darray_engine, typedef in hkl
 </dt>
 <dd></dd>
 <dt>
+<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#darray-function" title="darray_function">darray_function</a>, typedef in <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html" title="hkl-pseudoaxis-auto-private">hkl-pseudoaxis-auto-private</a>
+</dt>
+<dd></dd>
+<dt>
 <a class="link" href="hkl-darray.html#darray-growalloc" title="darray_growalloc()">darray_growalloc</a>, macro in <a class="link" href="hkl-darray.html" title="darray">darray</a>
 </dt>
 <dd></dd>
@@ -282,7 +291,7 @@ darray_engine, typedef in hkl
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-darray.html#darray-item" title="darray_item">darray_item</a>, typedef in hkl
+<a class="link" href="hkl-darray.html#darray-item" title="darray_item()">darray_item</a>, macro in <a class="link" href="hkl-darray.html" title="darray">darray</a>
 </dt>
 <dd></dd>
 <dt>
@@ -294,7 +303,7 @@ darray_engine, typedef in hkl
 </dt>
 <dd></dd>
 <dt>
-darray_mode, typedef in hkl
+<a class="link" href="hkl-hkl-pseudoaxis-private.html#darray-mode" title="darray_mode">darray_mode</a>, typedef in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
 </dt>
 <dd></dd>
 <dt>
@@ -302,7 +311,7 @@ darray_mode, typedef in hkl
 </dt>
 <dd></dd>
 <dt>
-darray_parameter, typedef in hkl
+<a class="link" href="hkl-hkl-parameter-private.html#darray-parameter" title="darray_parameter">darray_parameter</a>, typedef in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
 </dt>
 <dd></dd>
 <dt>
@@ -370,6 +379,10 @@ darray_parameter, typedef in hkl
 </dt>
 <dd></dd>
 <dt>
+<a class="link" href="hkl-hkl.html#darray-string" title="darray_string">darray_string</a>, typedef in <a class="link" href="hkl-hkl.html" title="hkl">hkl</a>
+</dt>
+<dd></dd>
+<dt>
 <a class="link" href="hkl-darray.html#darray-uchar" title="darray_uchar">darray_uchar</a>, typedef in <a class="link" href="hkl-darray.html" title="darray">darray</a>
 </dt>
 <dd></dd>
@@ -386,52 +399,56 @@ darray_parameter, typedef in hkl
 </dt>
 <dd></dd>
 <dt>
-<a href="hkl-hkl-macros.html#HKL-DEGTORAD:CAPS">HKL_DEGTORAD</a>, macro in hkl
+<a class="link" href="hkl-hkl.html#HKL-DEGTORAD:CAPS" title="HKL_DEGTORAD">HKL_DEGTORAD</a>, macro in <a class="link" href="hkl-hkl.html" title="hkl">hkl</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-hkl.html#HKL-DEPRECATED:CAPS" title="HKL_DEPRECATED">HKL_DEPRECATED</a>, macro in <a class="link" href="hkl-hkl.html" title="hkl">hkl</a>
 </dt>
 <dd></dd>
 <dt>
-HKL_DEPRECATED, macro in hkl
+<a class="link" href="hkl-hkl.html#HKL-DEPRECATED-FOR:CAPS" title="HKL_DEPRECATED_FOR()">HKL_DEPRECATED_FOR</a>, macro in <a class="link" href="hkl-hkl.html" title="hkl">hkl</a>
 </dt>
 <dd></dd>
 <dt>
-HKL_DEPRECATED_FOR, macro in hkl
+<a class="link" href="hkl-hkl.html#HklDetector" title="HklDetector">HklDetector</a>, struct in <a class="link" href="hkl-hkl-detector-private.html" title="hkl-detector-private">hkl-detector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-detector-private.html#HklDetector" title="HklDetector">HklDetector</a>, struct in <a class="link" href="hkl-hkl-detector-private.html" title="hkl-detector-private">hkl-detector-private</a>
+<a class="link" href="hkl-hkl.html#HklDetectorType" title="enum HklDetectorType">HklDetectorType</a>, enum in <a class="link" href="hkl-hkl.html" title="hkl">hkl</a>
 </dt>
 <dd></dd>
 <dt>
-HklDetectorType, enum in hkl
+<a class="link" href="hkl-hkl-detector-private.html#hkl-detector-attach-to-holder" title="hkl_detector_attach_to_holder ()">hkl_detector_attach_to_holder</a>, function in <a class="link" href="hkl-hkl-detector-private.html" title="hkl-detector-private">hkl-detector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-detector-private.html#hkl-detector-attach-to-holder" title="hkl_detector_attach_to_holder ()">hkl_detector_attach_to_holder</a>, function in <a class="link" href="hkl-hkl-detector-private.html" title="hkl-detector-private">hkl-detector-private</a>
+<a class="link" href="hkl-hkl-detector-private.html#hkl-detector-compute-kf" title="hkl_detector_compute_kf ()">hkl_detector_compute_kf</a>, function in <a class="link" href="hkl-hkl-detector-private.html" title="hkl-detector-private">hkl-detector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-detector-private.html#hkl-detector-compute-kf" title="hkl_detector_compute_kf ()">hkl_detector_compute_kf</a>, function in <a class="link" href="hkl-hkl-detector-private.html" title="hkl-detector-private">hkl-detector-private</a>
+<a class="link" href="hkl-hkl-detector-private.html#hkl-detector-new" title="hkl_detector_new ()">hkl_detector_new</a>, function in <a class="link" href="hkl-hkl-detector-private.html" title="hkl-detector-private">hkl-detector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-detector-private.html#hkl-detector-new" title="hkl_detector_new ()">hkl_detector_new</a>, function in <a class="link" href="hkl-hkl-detector-private.html" title="hkl-detector-private">hkl-detector-private</a>
+<a class="link" href="hkl-hkl-parameter-private.html#dup" title="dup">dup</a>, variable in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
 </dt>
 <dd></dd>
+<a name="idxE"></a><h3 class="title">E</h3>
 <dt>
-<a class="link" href="hkl-hkl-detector-private.html#hkl-detector-new-copy" title="hkl_detector_new_copy ()">hkl_detector_new_copy</a>, function in <a class="link" href="hkl-hkl-detector-private.html" title="hkl-detector-private">hkl-detector-private</a>
+<a class="link" href="hkl-hkl.html#HklEngine" title="HklEngine">HklEngine</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-parameter-private.html#dup" title="dup">dup</a>, variable in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
+<a class="link" href="hkl-hkl.html#HklEngineAxisNamesGet" title="enum HklEngineAxisNamesGet">HklEngineAxisNamesGet</a>, enum in <a class="link" href="hkl-hkl.html" title="hkl">hkl</a>
 </dt>
 <dd></dd>
-<a name="idxE"></a><h3 class="title">E</h3>
 <dt>
-<a href="hkl-hkl-macros.html#HKL-END-DECLS:CAPS">HKL_END_DECLS</a>, macro in hkl
+<a class="link" href="hkl-hkl.html#HklEngineCapabilities" title="enum HklEngineCapabilities">HklEngineCapabilities</a>, enum in <a class="link" href="hkl-hkl.html" title="hkl">hkl</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine">HklEngine</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineError" title="enum HklEngineError">HklEngineError</a>, enum in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
 </dt>
 <dd></dd>
 <dt>
@@ -447,7 +464,11 @@ HklDetectorType, enum in hkl
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineList" title="HklEngineList">HklEngineList</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
+<a class="link" href="hkl-hkl.html#HklEngineList" title="HklEngineList">HklEngineList</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineListError" title="enum HklEngineListError">HklEngineListError</a>, enum in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
 </dt>
 <dd></dd>
 <dt>
@@ -471,520 +492,517 @@ HklDetectorType, enum in hkl
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-e4c-private.html#hkl-engine-e4c-hkl-new" title="hkl_engine_e4c_hkl_new ()">hkl_engine_e4c_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-e4c-private.html" title="hkl-pseudoaxis-e4c-private">hkl-pseudoaxis-e4c-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-private.html#HKL-ENGINE-ERROR:CAPS" title="HKL_ENGINE_ERROR">HKL_ENGINE_ERROR</a>, macro in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-e4c-private.html#hkl-engine-e4c-psi-new" title="hkl_engine_e4c_psi_new ()">hkl_engine_e4c_psi_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-e4c-private.html" title="hkl-pseudoaxis-e4c-private">hkl-pseudoaxis-e4c-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-eulerians-private.html#hkl-engine-eulerians-new" title="hkl_engine_eulerians_new ()">hkl_engine_eulerians_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-eulerians-private.html" title="hkl-pseudoaxis-common-eulerians-private">hkl-pseudoaxis-common-eulerians-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-e6c-private.html#hkl-engine-e6c-hkl-new" title="hkl_engine_e6c_hkl_new ()">hkl_engine_e6c_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-e6c-private.html" title="hkl-pseudoaxis-e6c-private">hkl-pseudoaxis-e6c-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-engine-hkl-new" title="hkl_engine_hkl_new ()">hkl_engine_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html" title="hkl-pseudoaxis-common-hkl-private">hkl-pseudoaxis-common-hkl-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-e6c-private.html#hkl-engine-e6c-psi-new" title="hkl_engine_e6c_psi_new ()">hkl_engine_e6c_psi_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-e6c-private.html" title="hkl-pseudoaxis-e6c-private">hkl-pseudoaxis-e6c-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-private.html#HKL-ENGINE-LIST-ERROR:CAPS" title="HKL_ENGINE_LIST_ERROR">HKL_ENGINE_LIST_ERROR</a>, macro in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-eulerians-private.html#hkl-engine-eulerians-new" title="hkl_engine_eulerians_new ()">hkl_engine_eulerians_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-eulerians-private.html" title="hkl-pseudoaxis-common-eulerians-private">hkl-pseudoaxis-common-eulerians-private</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-engine-hkl-new" title="hkl_engine_hkl_new ()">hkl_engine_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html" title="hkl-pseudoaxis-common-hkl-private">hkl-pseudoaxis-common-hkl-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-private.html#HKL-ENGINE-OPERATIONS-DEFAULTS:CAPS" title="HKL_ENGINE_OPERATIONS_DEFAULTS">HKL_ENGINE_OPERATIONS_DEFAULTS</a>, macro in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#hkl-engine-init" title="hkl_engine_init ()">hkl_engine_init</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-psi-private.html#hkl-engine-psi-new" title="hkl_engine_psi_new ()">hkl_engine_psi_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-psi-private.html" title="hkl-pseudoaxis-common-psi-private">hkl-pseudoaxis-common-psi-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-k4cv-private.html#hkl-engine-k4cv-hkl-new" title="hkl_engine_k4cv_hkl_new ()">hkl_engine_k4cv_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-k4cv-private.html" title="hkl-pseudoaxis-k4cv-private">hkl-pseudoaxis-k4cv-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-q2-new" title="hkl_engine_q2_new ()">hkl_engine_q2_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html" title="hkl-pseudoaxis-common-q-private">hkl-pseudoaxis-common-q-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-k4cv-private.html#hkl-engine-k4cv-psi-new" title="hkl_engine_k4cv_psi_new ()">hkl_engine_k4cv_psi_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-k4cv-private.html" title="hkl-pseudoaxis-k4cv-private">hkl-pseudoaxis-k4cv-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-qper-qpar-new" title="hkl_engine_qper_qpar_new ()">hkl_engine_qper_qpar_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html" title="hkl-pseudoaxis-common-q-private">hkl-pseudoaxis-common-q-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-k6c-private.html#hkl-engine-k6c-hkl-new" title="hkl_engine_k6c_hkl_new ()">hkl_engine_k6c_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-k6c-private.html" title="hkl-pseudoaxis-k6c-private">hkl-pseudoaxis-k6c-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-q-new" title="hkl_engine_q_new ()">hkl_engine_q_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html" title="hkl-pseudoaxis-common-q-private">hkl-pseudoaxis-common-q-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-k6c-private.html#hkl-engine-k6c-psi-new" title="hkl_engine_k6c_psi_new ()">hkl_engine_k6c_psi_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-k6c-private.html" title="hkl-pseudoaxis-k6c-private">hkl-pseudoaxis-k6c-private</a>
+<a class="link" href="hkl-hkl.html#HKL-EPSILON:CAPS" title="HKL_EPSILON">HKL_EPSILON</a>, macro in <a class="link" href="hkl-hkl.html" title="hkl">hkl</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#hkl-engine-list-add" title="hkl_engine_list_add ()">hkl_engine_list_add</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
+<a class="link" href="hkl-hkl-macros-private.html#hkl-error" title="hkl_error()">hkl_error</a>, macro in <a class="link" href="hkl-hkl-macros-private.html" title="hkl-macros-private">hkl-macros-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#hkl-engine-list-clear" title="hkl_engine_list_clear ()">hkl_engine_list_clear</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
+<a class="link" href="hkl-hkl-macros-private.html#HKL-EULERIAN-KAPPA-SOLUTION:CAPS" title="HKL_EULERIAN_KAPPA_SOLUTION">HKL_EULERIAN_KAPPA_SOLUTION</a>, macro in <a class="link" href="hkl-hkl-macros-private.html" title="hkl-macros-private">hkl-macros-private</a>
 </dt>
 <dd></dd>
+<a name="idxF"></a><h3 class="title">F</h3>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#hkl-engine-list-new" title="hkl_engine_list_new ()">hkl_engine_list_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
+<a class="link" href="hkl-hkl-parameter-private.html#factor" title="factor">factor</a>, variable in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#hkl-engine-list-new-copy" title="hkl_engine_list_new_copy ()">hkl_engine_list_new_copy</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
+<a class="link" href="hkl-hkl.html#HklFactory" title="HklFactory">HklFactory</a>, struct in <a class="link" href="hkl-hkl-factory-private.html" title="hkl-factory-private">hkl-factory-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#HKL-ENGINE-OPERATIONS-DEFAULTS:CAPS" title="HKL_ENGINE_OPERATIONS_DEFAULTS">HKL_ENGINE_OPERATIONS_DEFAULTS</a>, macro in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
+<a class="link" href="hkl-hkl-factory-private.html#HklFactoryEngineListFunction" title="HklFactoryEngineListFunction ()">HklFactoryEngineListFunction</a>, user_function in <a class="link" href="hkl-hkl-factory-private.html" title="hkl-factory-private">hkl-factory-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-petra3-private.html#hkl-engine-petra3-p09-eh2-hkl-new" title="hkl_engine_petra3_p09_eh2_hkl_new ()">hkl_engine_petra3_p09_eh2_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-petra3-private.html" title="hkl-pseudoaxis-petra3-private">hkl-pseudoaxis-petra3-private</a>
+<a class="link" href="hkl-hkl-factory-private.html#HklFactoryGeometryFunction" title="HklFactoryGeometryFunction ()">HklFactoryGeometryFunction</a>, user_function in <a class="link" href="hkl-hkl-factory-private.html" title="hkl-factory-private">hkl-factory-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-psi-private.html#hkl-engine-psi-new" title="hkl_engine_psi_new ()">hkl_engine_psi_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-psi-private.html" title="hkl-pseudoaxis-common-psi-private">hkl-pseudoaxis-common-psi-private</a>
+<a class="link" href="hkl-noerr.html#fclose-noerr" title="fclose_noerr ()">fclose_noerr</a>, function in <a class="link" href="hkl-noerr.html" title="noerr">noerr</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-q2-new" title="hkl_engine_q2_new ()">hkl_engine_q2_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html" title="hkl-pseudoaxis-common-q-private">hkl-pseudoaxis-common-q-private</a>
+<a class="link" href="hkl-hkl-parameter-private.html#fprintf" title="fprintf ()">fprintf</a>, function in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-qper-qpar-new" title="hkl_engine_qper_qpar_new ()">hkl_engine_qper_qpar_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html" title="hkl-pseudoaxis-common-q-private">hkl-pseudoaxis-common-q-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklFunction" title="struct HklFunction">HklFunction</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html" title="hkl-pseudoaxis-auto-private">hkl-pseudoaxis-auto-private</a>
 </dt>
 <dd></dd>
+<a name="idxG"></a><h3 class="title">G</h3>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-q-new" title="hkl_engine_q_new ()">hkl_engine_q_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html" title="hkl-pseudoaxis-common-q-private">hkl-pseudoaxis-common-q-private</a>
+<a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry">HklGeometry</a>, struct in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html#hkl-engine-soleil-sixs-med-1-2-hkl-new" title="hkl_engine_soleil_sixs_med_1_2_hkl_new ()">hkl_engine_soleil_sixs_med_1_2_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html" title="hkl-pseudoaxis-soleil-sixs-med-private">hkl-pseudoaxis-soleil-sixs-med-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#HklGeometryError" title="enum HklGeometryError">HklGeometryError</a>, enum in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html#hkl-engine-soleil-sixs-med-2-2-hkl-new" title="hkl_engine_soleil_sixs_med_2_2_hkl_new ()">hkl_engine_soleil_sixs_med_2_2_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html" title="hkl-pseudoaxis-soleil-sixs-med-private">hkl-pseudoaxis-soleil-sixs-med-private</a>
+<a class="link" href="hkl-hkl.html#HklGeometryList" title="HklGeometryList">HklGeometryList</a>, struct in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html#hkl-engine-soleil-sixs-med-2-3-hkl-new" title="hkl_engine_soleil_sixs_med_2_3_hkl_new ()">hkl_engine_soleil_sixs_med_2_3_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html" title="hkl-pseudoaxis-soleil-sixs-med-private">hkl-pseudoaxis-soleil-sixs-med-private</a>
+<a class="link" href="hkl-hkl.html#HklGeometryListItem" title="HklGeometryListItem">HklGeometryListItem</a>, struct in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-zaxis-private.html#hkl-engine-zaxis-hkl-new" title="hkl_engine_zaxis_hkl_new ()">hkl_engine_zaxis_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-zaxis-private.html" title="hkl-pseudoaxis-zaxis-private">hkl-pseudoaxis-zaxis-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#HklGeometryListMultiplyFunction" title="HklGeometryListMultiplyFunction ()">HklGeometryListMultiplyFunction</a>, user_function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a href="hkl-hkl-macros.html#HKL-EPSILON:CAPS">HKL_EPSILON</a>, macro in hkl
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-add-holder" title="hkl_geometry_add_holder ()">hkl_geometry_add_holder</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError">HklError</a>, struct in <a class="link" href="hkl-hkl-error-private.html" title="hkl-error-private">hkl-error-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-closest-from-geometry-with-range" title="hkl_geometry_closest_from_geometry_with_range ()">hkl_geometry_closest_from_geometry_with_range</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-error-private.html#hkl-error-clear" title="hkl_error_clear ()">hkl_error_clear</a>, function in <a class="link" href="hkl-hkl-error-private.html" title="hkl-error-private">hkl-error-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-distance" title="hkl_geometry_distance ()">hkl_geometry_distance</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-error-private.html#hkl-error-free" title="hkl_error_free ()">hkl_error_free</a>, function in <a class="link" href="hkl-hkl-error-private.html" title="hkl-error-private">hkl-error-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-distance-orthodromic" title="hkl_geometry_distance_orthodromic ()">hkl_geometry_distance_orthodromic</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-error-private.html#hkl-error-new" title="hkl_error_new ()">hkl_error_new</a>, function in <a class="link" href="hkl-hkl-error-private.html" title="hkl-error-private">hkl-error-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#HKL-GEOMETRY-ERROR:CAPS" title="HKL_GEOMETRY_ERROR">HKL_GEOMETRY_ERROR</a>, macro in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-error-private.html#hkl-error-new-copy" title="hkl_error_new_copy ()">hkl_error_new_copy</a>, function in <a class="link" href="hkl-hkl-error-private.html" title="hkl-error-private">hkl-error-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-get-axis-by-name" title="hkl_geometry_get_axis_by_name ()">hkl_geometry_get_axis_by_name</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-error-private.html#hkl-error-new-literal" title="hkl_error_new_literal ()">hkl_error_new_literal</a>, function in <a class="link" href="hkl-hkl-error-private.html" title="hkl-error-private">hkl-error-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-get-axis-idx-by-name" title="hkl_geometry_get_axis_idx_by_name ()">hkl_geometry_get_axis_idx_by_name</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-error-private.html#hkl-error-new-valist" title="hkl_error_new_valist ()">hkl_error_new_valist</a>, function in <a class="link" href="hkl-hkl-error-private.html" title="hkl-error-private">hkl-error-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-init-geometry" title="hkl_geometry_init_geometry ()">hkl_geometry_init_geometry</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-error-private.html#hkl-error-prefix" title="hkl_error_prefix ()">hkl_error_prefix</a>, function in <a class="link" href="hkl-hkl-error-private.html" title="hkl-error-private">hkl-error-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-is-valid" title="hkl_geometry_is_valid ()">hkl_geometry_is_valid</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-error-private.html#hkl-error-propagate" title="hkl_error_propagate ()">hkl_error_propagate</a>, function in <a class="link" href="hkl-hkl-error-private.html" title="hkl-error-private">hkl-error-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-add" title="hkl_geometry_list_add ()">hkl_geometry_list_add</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-error-private.html#hkl-error-propagate-prefixed" title="hkl_error_propagate_prefixed ()">hkl_error_propagate_prefixed</a>, function in <a class="link" href="hkl-hkl-error-private.html" title="hkl-error-private">hkl-error-private</a>
+<a class="link" href="hkl-hkl.html#HKL-GEOMETRY-LIST-FOREACH:CAPS" title="HKL_GEOMETRY_LIST_FOREACH()">HKL_GEOMETRY_LIST_FOREACH</a>, macro in <a class="link" href="hkl-hkl.html" title="hkl">hkl</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-error-private.html#hkl-error-set" title="hkl_error_set ()">hkl_error_set</a>, function in <a class="link" href="hkl-hkl-error-private.html" title="hkl-error-private">hkl-error-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-fprintf" title="hkl_geometry_list_fprintf ()">hkl_geometry_list_fprintf</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-error-private.html#hkl-error-set-literal" title="hkl_error_set_literal ()">hkl_error_set_literal</a>, function in <a class="link" href="hkl-hkl-error-private.html" title="hkl-error-private">hkl-error-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-item-free" title="hkl_geometry_list_item_free ()">hkl_geometry_list_item_free</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-macros-private.html#HKL-EULERIAN-KAPPA-SOLUTION:CAPS" title="HKL_EULERIAN_KAPPA_SOLUTION">HKL_EULERIAN_KAPPA_SOLUTION</a>, macro in <a class="link" href="hkl-hkl-macros-private.html" title="hkl-macros-private">hkl-macros-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-item-new" title="hkl_geometry_list_item_new ()">hkl_geometry_list_item_new</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
-<a name="idxF"></a><h3 class="title">F</h3>
 <dt>
-<a class="link" href="hkl-hkl-parameter-private.html#factor" title="factor">factor</a>, variable in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-item-new-copy" title="hkl_geometry_list_item_new_copy ()">hkl_geometry_list_item_new_copy</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-HklFactory, struct in hkl
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-multiply" title="hkl_geometry_list_multiply ()">hkl_geometry_list_multiply</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a href="hkl-hkl-macros.html#HKL-FALSE:CAPS">HKL_FALSE</a>, macro in hkl
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-multiply-from-range" title="hkl_geometry_list_multiply_from_range ()">hkl_geometry_list_multiply_from_range</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-noerr.html#fclose-noerr" title="fclose_noerr ()">fclose_noerr</a>, function in <a class="link" href="hkl-noerr.html" title="noerr">noerr</a>
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-new" title="hkl_geometry_list_new ()">hkl_geometry_list_new</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-parameter-private.html#fprintf" title="fprintf ()">fprintf</a>, function in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-new-copy" title="hkl_geometry_list_new_copy ()">hkl_geometry_list_new_copy</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklFunction" title="struct HklFunction">HklFunction</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html" title="hkl-pseudoaxis-auto-private">hkl-pseudoaxis-auto-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-remove-invalid" title="hkl_geometry_list_remove_invalid ()">hkl_geometry_list_remove_invalid</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
-<a name="idxG"></a><h3 class="title">G</h3>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry">HklGeometry</a>, struct in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-reset" title="hkl_geometry_list_reset ()">hkl_geometry_list_reset</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList">HklGeometryList</a>, struct in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-sort" title="hkl_geometry_list_sort ()">hkl_geometry_list_sort</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#HklGeometryListItem" title="HklGeometryListItem">HklGeometryListItem</a>, struct in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-new" title="hkl_geometry_new ()">hkl_geometry_new</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#HklGeometryListMultiplyFunction" title="HklGeometryListMultiplyFunction ()">HklGeometryListMultiplyFunction</a>, user_function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-update" title="hkl_geometry_update ()">hkl_geometry_update</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-add-holder" title="hkl_geometry_add_holder ()">hkl_geometry_add_holder</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-macros-private.html#G-GNUC-PRINTF:CAPS" title="G_GNUC_PRINTF()">G_GNUC_PRINTF</a>, macro in <a class="link" href="hkl-hkl-macros-private.html" title="hkl-macros-private">hkl-macros-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-closest-from-geometry-with-range" title="hkl_geometry_closest_from_geometry_with_range ()">hkl_geometry_closest_from_geometry_with_range</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#g-quark-from-static-string" title="g_quark_from_static_string ()">g_quark_from_static_string</a>, function in <a class="link" href="hkl-hkl-sample-private.html" title="hkl-sample-private">hkl-sample-private</a>
 </dt>
 <dd></dd>
+<a name="idxH"></a><h3 class="title">H</h3>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-distance" title="hkl_geometry_distance ()">hkl_geometry_distance</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#HklHolder" title="struct HklHolder">HklHolder</a>, struct in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-distance-orthodromic" title="hkl_geometry_distance_orthodromic ()">hkl_geometry_distance_orthodromic</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#HklHolderConfig" title="struct HklHolderConfig">HklHolderConfig</a>, struct in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-get-axis-by-name" title="hkl_geometry_get_axis_by_name ()">hkl_geometry_get_axis_by_name</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-holder-add-rotation-axis" title="hkl_holder_add_rotation_axis ()">hkl_holder_add_rotation_axis</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
 </dt>
 <dd></dd>
+<a name="idxI"></a><h3 class="title">I</h3>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-get-axis-idx-by-name" title="hkl_geometry_get_axis_idx_by_name ()">hkl_geometry_get_axis_idx_by_name</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-private.html#i" title="i">i</a>, variable in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-init-geometry" title="hkl_geometry_init_geometry ()">hkl_geometry_init_geometry</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval">HklInterval</a>, struct in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-is-valid" title="hkl_geometry_is_valid ()">hkl_geometry_is_valid</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-acos" title="hkl_interval_acos ()">hkl_interval_acos</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-add" title="hkl_geometry_list_add ()">hkl_geometry_list_add</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-angle-restrict-symm" title="hkl_interval_angle_restrict_symm ()">hkl_interval_angle_restrict_symm</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-fprintf" title="hkl_geometry_list_fprintf ()">hkl_geometry_list_fprintf</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-asin" title="hkl_interval_asin ()">hkl_interval_asin</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-free" title="hkl_geometry_list_free ()">hkl_geometry_list_free</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-atan" title="hkl_interval_atan ()">hkl_interval_atan</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-item-free" title="hkl_geometry_list_item_free ()">hkl_geometry_list_item_free</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-cmp" title="hkl_interval_cmp ()">hkl_interval_cmp</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-item-new" title="hkl_geometry_list_item_new ()">hkl_geometry_list_item_new</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-contain-zero" title="hkl_interval_contain_zero ()">hkl_interval_contain_zero</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-item-new-copy" title="hkl_geometry_list_item_new_copy ()">hkl_geometry_list_item_new_copy</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-cos" title="hkl_interval_cos ()">hkl_interval_cos</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-multiply" title="hkl_geometry_list_multiply ()">hkl_geometry_list_multiply</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-divides-double" title="hkl_interval_divides_double ()">hkl_interval_divides_double</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-multiply-from-range" title="hkl_geometry_list_multiply_from_range ()">hkl_geometry_list_multiply_from_range</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-dup" title="hkl_interval_dup ()">hkl_interval_dup</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html#hkl-geometry-list-multiply-soleil-sixs-med-2-3" title="hkl_geometry_list_multiply_soleil_sixs_med_2_3 ()">hkl_geometry_list_multiply_soleil_sixs_med_2_3</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html" title="hkl-pseudoaxis-soleil-sixs-med-private">hkl-pseudoaxis-soleil-sixs-med-private</a>
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-free" title="hkl_interval_free ()">hkl_interval_free</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-new" title="hkl_geometry_list_new ()">hkl_geometry_list_new</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-length" title="hkl_interval_length ()">hkl_interval_length</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-new-copy" title="hkl_geometry_list_new_copy ()">hkl_geometry_list_new_copy</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-minus-double" title="hkl_interval_minus_double ()">hkl_interval_minus_double</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-remove-invalid" title="hkl_geometry_list_remove_invalid ()">hkl_geometry_list_remove_invalid</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-minus-interval" title="hkl_interval_minus_interval ()">hkl_interval_minus_interval</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-reset" title="hkl_geometry_list_reset ()">hkl_geometry_list_reset</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-plus-double" title="hkl_interval_plus_double ()">hkl_interval_plus_double</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-sort" title="hkl_geometry_list_sort ()">hkl_geometry_list_sort</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-plus-interval" title="hkl_interval_plus_interval ()">hkl_interval_plus_interval</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-new" title="hkl_geometry_new ()">hkl_geometry_new</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-sin" title="hkl_interval_sin ()">hkl_interval_sin</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-new-copy" title="hkl_geometry_new_copy ()">hkl_geometry_new_copy</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-tan" title="hkl_interval_tan ()">hkl_interval_tan</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-set-values-v" title="hkl_geometry_set_values_v ()">hkl_geometry_set_values_v</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-times-double" title="hkl_interval_times_double ()">hkl_interval_times_double</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-update" title="hkl_geometry_update ()">hkl_geometry_update</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-times-interval" title="hkl_interval_times_interval ()">hkl_interval_times_interval</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-macros-private.html#G-GNUC-PRINTF:CAPS" title="G_GNUC_PRINTF()">G_GNUC_PRINTF</a>, macro in <a class="link" href="hkl-hkl-macros-private.html" title="hkl-macros-private">hkl-macros-private</a>
+<a class="link" href="hkl-str.html#isalnum" title="isalnum ()">isalnum</a>, function in <a class="link" href="hkl-str.html" title="str">str</a>
 </dt>
 <dd></dd>
-<a name="idxH"></a><h3 class="title">H</h3>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#HklHolder" title="struct HklHolder">HklHolder</a>, struct in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-str.html#isalpha" title="isalpha ()">isalpha</a>, function in <a class="link" href="hkl-str.html" title="str">str</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-private.html#hkl-holder-add-rotation-axis" title="hkl_holder_add_rotation_axis ()">hkl_holder_add_rotation_axis</a>, function in <a class="link" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">hkl-geometry-private</a>
+<a class="link" href="hkl-str.html#isascii" title="isascii ()">isascii</a>, function in <a class="link" href="hkl-str.html" title="str">str</a>
 </dt>
 <dd></dd>
-<a name="idxI"></a><h3 class="title">I</h3>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#i" title="i">i</a>, variable in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
+<a class="link" href="hkl-str.html#isblank" title="isblank ()">isblank</a>, function in <a class="link" href="hkl-str.html" title="str">str</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#INFO:CAPS" title="INFO()">INFO</a>, macro in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
+<a class="link" href="hkl-str.html#iscntrl" title="iscntrl ()">iscntrl</a>, function in <a class="link" href="hkl-str.html" title="str">str</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#INFO-AUTO:CAPS" title="INFO_AUTO()">INFO_AUTO</a>, macro in <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html" title="hkl-pseudoaxis-auto-private">hkl-pseudoaxis-auto-private</a>
+<a class="link" href="hkl-str.html#isdigit" title="isdigit ()">isdigit</a>, function in <a class="link" href="hkl-str.html" title="str">str</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#INFO-AUTO-WITH-PARAMS:CAPS" title="INFO_AUTO_WITH_PARAMS()">INFO_AUTO_WITH_PARAMS</a>, macro in <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html" title="hkl-pseudoaxis-auto-private">hkl-pseudoaxis-auto-private</a>
+<a class="link" href="hkl-str.html#isgraph" title="isgraph ()">isgraph</a>, function in <a class="link" href="hkl-str.html" title="str">str</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#INFO-WITH-PARAMS:CAPS" title="INFO_WITH_PARAMS()">INFO_WITH_PARAMS</a>, macro in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
+<a class="link" href="hkl-str.html#islower" title="islower ()">islower</a>, function in <a class="link" href="hkl-str.html" title="str">str</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval">HklInterval</a>, struct in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
+<a class="link" href="hkl-str.html#isprint" title="isprint ()">isprint</a>, function in <a class="link" href="hkl-str.html" title="str">str</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-acos" title="hkl_interval_acos ()">hkl_interval_acos</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
+<a class="link" href="hkl-str.html#ispunct" title="ispunct ()">ispunct</a>, function in <a class="link" href="hkl-str.html" title="str">str</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-angle-restrict-symm" title="hkl_interval_angle_restrict_symm ()">hkl_interval_angle_restrict_symm</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
+<a class="link" href="hkl-str.html#isspace" title="isspace ()">isspace</a>, function in <a class="link" href="hkl-str.html" title="str">str</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-asin" title="hkl_interval_asin ()">hkl_interval_asin</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
+<a class="link" href="hkl-str.html#isupper" title="isupper ()">isupper</a>, function in <a class="link" href="hkl-str.html" title="str">str</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-atan" title="hkl_interval_atan ()">hkl_interval_atan</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
+<a class="link" href="hkl-str.html#isxdigit" title="isxdigit ()">isxdigit</a>, function in <a class="link" href="hkl-str.html" title="str">str</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-cmp" title="hkl_interval_cmp ()">hkl_interval_cmp</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
+<a class="link" href="hkl-compiler.html#IS-COMPILE-CONSTANT:CAPS" title="IS_COMPILE_CONSTANT()">IS_COMPILE_CONSTANT</a>, macro in <a class="link" href="hkl-compiler.html" title="compiler">compiler</a>
 </dt>
 <dd></dd>
+<a name="idxK"></a><h3 class="title">K</h3>
 <dt>
-<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-contain-zero" title="hkl_interval_contain_zero ()">hkl_interval_contain_zero</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-eulerians-private.html#kappa-2-kappap" title="kappa_2_kappap ()">kappa_2_kappap</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-eulerians-private.html" title="hkl-pseudoaxis-common-eulerians-private">hkl-pseudoaxis-common-eulerians-private</a>
 </dt>
 <dd></dd>
+<a name="idxL"></a><h3 class="title">L</h3>
 <dt>
-<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-cos" title="hkl_interval_cos ()">hkl_interval_cos</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
+<a class="link" href="hkl-hkl.html#HklLattice" title="HklLattice">HklLattice</a>, struct in <a class="link" href="hkl-hkl-lattice-private.html" title="hkl-lattice-private">hkl-lattice-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-divides-double" title="hkl_interval_divides_double ()">hkl_interval_divides_double</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
+<a class="link" href="hkl-hkl-lattice-private.html#HklLatticeError" title="enum HklLatticeError">HklLatticeError</a>, enum in <a class="link" href="hkl-hkl-lattice-private.html" title="hkl-lattice-private">hkl-lattice-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-dup" title="hkl_interval_dup ()">hkl_interval_dup</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
+<a class="link" href="hkl-hkl-lattice-private.html#HKL-LATTICE-ERROR:CAPS" title="HKL_LATTICE_ERROR">HKL_LATTICE_ERROR</a>, macro in <a class="link" href="hkl-hkl-lattice-private.html" title="hkl-lattice-private">hkl-lattice-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-free" title="hkl_interval_free ()">hkl_interval_free</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
+<a class="link" href="hkl-hkl-lattice-private.html#hkl-lattice-fprintf" title="hkl_lattice_fprintf ()">hkl_lattice_fprintf</a>, function in <a class="link" href="hkl-hkl-lattice-private.html" title="hkl-lattice-private">hkl-lattice-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-length" title="hkl_interval_length ()">hkl_interval_length</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
+<a class="link" href="hkl-hkl-lattice-private.html#hkl-lattice-lattice-set" title="hkl_lattice_lattice_set ()">hkl_lattice_lattice_set</a>, function in <a class="link" href="hkl-hkl-lattice-private.html" title="hkl-lattice-private">hkl-lattice-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-minus-double" title="hkl_interval_minus_double ()">hkl_interval_minus_double</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
+<a class="link" href="hkl-hkl-lattice-private.html#hkl-lattice-randomize" title="hkl_lattice_randomize ()">hkl_lattice_randomize</a>, function in <a class="link" href="hkl-hkl-lattice-private.html" title="hkl-lattice-private">hkl-lattice-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-minus-interval" title="hkl_interval_minus_interval ()">hkl_interval_minus_interval</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
+<a class="link" href="hkl-list.html#list-add" title="list_add()">list_add</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-plus-double" title="hkl_interval_plus_double ()">hkl_interval_plus_double</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
+<a class="link" href="hkl-list.html#list-add-off" title="list_add_off()">list_add_off</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-plus-interval" title="hkl_interval_plus_interval ()">hkl_interval_plus_interval</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
+<a class="link" href="hkl-list.html#list-add-tail" title="list_add_tail()">list_add_tail</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-sin" title="hkl_interval_sin ()">hkl_interval_sin</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
+<a class="link" href="hkl-list.html#list-append-list" title="list_append_list()">list_append_list</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-tan" title="hkl_interval_tan ()">hkl_interval_tan</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
+<a class="link" href="hkl-list.html#list-check" title="list_check ()">list_check</a>, function in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-times-double" title="hkl_interval_times_double ()">hkl_interval_times_double</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
+<a class="link" href="hkl-list.html#list-check-node" title="list_check_node ()">list_check_node</a>, function in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-times-interval" title="hkl_interval_times_interval ()">hkl_interval_times_interval</a>, function in <a class="link" href="hkl-hkl-interval-private.html" title="hkl-interval-private">hkl-interval-private</a>
+<a class="link" href="hkl-list.html#list-debug" title="list_debug()">list_debug</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-compiler.html#IS-COMPILE-CONSTANT:CAPS" title="IS_COMPILE_CONSTANT()">IS_COMPILE_CONSTANT</a>, macro in <a class="link" href="hkl-compiler.html" title="compiler">compiler</a>
+<a class="link" href="hkl-list.html#list-debug-node" title="list_debug_node()">list_debug_node</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
-<a name="idxL"></a><h3 class="title">L</h3>
 <dt>
-<a class="link" href="hkl-hkl-lattice-private.html#HklLattice" title="HklLattice">HklLattice</a>, struct in <a class="link" href="hkl-hkl-lattice-private.html" title="hkl-lattice-private">hkl-lattice-private</a>
+<a class="link" href="hkl-list.html#list-del" title="list_del()">list_del</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-lattice-private.html#hkl-lattice-fprintf" title="hkl_lattice_fprintf ()">hkl_lattice_fprintf</a>, function in <a class="link" href="hkl-hkl-lattice-private.html" title="hkl-lattice-private">hkl-lattice-private</a>
+<a class="link" href="hkl-list.html#list-del-from-off" title="list_del_from_off()">list_del_from_off</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-lattice-private.html#hkl-lattice-lattice-set" title="hkl_lattice_lattice_set ()">hkl_lattice_lattice_set</a>, function in <a class="link" href="hkl-hkl-lattice-private.html" title="hkl-lattice-private">hkl-lattice-private</a>
+<a class="link" href="hkl-list.html#list-del-off" title="list_del_off()">list_del_off</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-lattice-private.html#hkl-lattice-randomize" title="hkl_lattice_randomize ()">hkl_lattice_randomize</a>, function in <a class="link" href="hkl-hkl-lattice-private.html" title="hkl-lattice-private">hkl-lattice-private</a>
+<a class="link" href="hkl-list.html#list-empty" title="list_empty()">list_empty</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-list.html#list-add-off" title="list_add_off()">list_add_off</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
+<a class="link" href="hkl-list.html#list-empty-nodebug" title="list_empty_nodebug()">list_empty_nodebug</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-list.html#list-check" title="list_check ()">list_check</a>, function in <a class="link" href="hkl-list.html" title="list">list</a>
+<a class="link" href="hkl-list.html#list-entry" title="list_entry()">list_entry</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-list.html#list-check-node" title="list_check_node ()">list_check_node</a>, function in <a class="link" href="hkl-list.html" title="list">list</a>
+<a class="link" href="hkl-list.html#list-entry-off" title="list_entry_off()">list_entry_off</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-list.html#list-debug" title="list_debug()">list_debug</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
+<a class="link" href="hkl-list.html#list-for-each" title="list_for_each()">list_for_each</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-list.html#list-debug-node" title="list_debug_node()">list_debug_node</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
+<a class="link" href="hkl-list.html#list-for-each-off" title="list_for_each_off()">list_for_each_off</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-list.html#list-del-from-off" title="list_del_from_off()">list_del_from_off</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
+<a class="link" href="hkl-list.html#list-for-each-rev" title="list_for_each_rev()">list_for_each_rev</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-list.html#list-del-off" title="list_del_off()">list_del_off</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
+<a class="link" href="hkl-list.html#list-for-each-safe" title="list_for_each_safe()">list_for_each_safe</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-list.html#list-entry" title="list_entry()">list_entry</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
+<a class="link" href="hkl-list.html#list-for-each-safe-off" title="list_for_each_safe_off()">list_for_each_safe_off</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-list.html#list-entry-off" title="list_entry_off()">list_entry_off</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
+<a class="link" href="hkl-list.html#LIST-HEAD:CAPS" title="LIST_HEAD()">LIST_HEAD</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-list.html#list-for-each" title="list_for_each()">list_for_each</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
+<a class="link" href="hkl-list.html#list-head" title="struct list_head">list_head</a>, struct in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-list.html#list-for-each-off" title="list_for_each_off()">list_for_each_off</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
+<a class="link" href="hkl-list.html#LIST-HEAD-INIT:CAPS" title="LIST_HEAD_INIT()">LIST_HEAD_INIT</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-list.html#list-for-each-rev" title="list_for_each_rev()">list_for_each_rev</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
+<a class="link" href="hkl-list.html#list-head-off" title="list_head_off()">list_head_off</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-list.html#list-for-each-safe" title="list_for_each_safe()">list_for_each_safe</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
+<a class="link" href="hkl-list.html#LIST-LOC:CAPS" title="LIST_LOC">LIST_LOC</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-list.html#list-for-each-safe-off" title="list_for_each_safe_off()">list_for_each_safe_off</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
+<a class="link" href="hkl-list.html#list-next" title="list_next()">list_next</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-list.html#LIST-HEAD:CAPS" title="LIST_HEAD()">LIST_HEAD</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
+<a class="link" href="hkl-list.html#list-node" title="struct list_node">list_node</a>, struct in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-list.html#LIST-HEAD-INIT:CAPS" title="LIST_HEAD_INIT()">LIST_HEAD_INIT</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
+<a class="link" href="hkl-list.html#list-off-" title="list_off_()">list_off_</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-list.html#list-head-off" title="list_head_off()">list_head_off</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
+<a class="link" href="hkl-list.html#list-off-var-" title="list_off_var_()">list_off_var_</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-list.html#list-off-" title="list_off_()">list_off_</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
+<a class="link" href="hkl-list.html#list-pop" title="list_pop()">list_pop</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-list.html#list-off-var-" title="list_off_var_()">list_off_var_</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
+<a class="link" href="hkl-list.html#list-prepend-list" title="list_prepend_list()">list_prepend_list</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-list.html#list-pop" title="list_pop()">list_pop</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
+<a class="link" href="hkl-list.html#list-prev" title="list_prev()">list_prev</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
 <dt>
@@ -999,61 +1017,65 @@ HklFactory, struct in hkl
 <a class="link" href="hkl-list.html#list-top" title="list_top()">list_top</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
 </dt>
 <dd></dd>
+<dt>
+<a class="link" href="hkl-list.html#list-typeof" title="list_typeof()">list_typeof</a>, macro in <a class="link" href="hkl-list.html" title="list">list</a>
+</dt>
+<dd></dd>
 <a name="idxM"></a><h3 class="title">M</h3>
 <dt>
 <a class="link" href="hkl-hkl-macros-private.html#HKL-MALLOC:CAPS" title="HKL_MALLOC()">HKL_MALLOC</a>, macro in <a class="link" href="hkl-hkl-macros-private.html" title="hkl-macros-private">hkl-macros-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix">HklMatrix</a>, struct in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
+<a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix">HklMatrix</a>, struct in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-det" title="hkl_matrix_det ()">hkl_matrix_det</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-det" title="hkl_matrix_det ()">hkl_matrix_det</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-dup" title="hkl_matrix_dup ()">hkl_matrix_dup</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-dup" title="hkl_matrix_dup ()">hkl_matrix_dup</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-fprintf" title="hkl_matrix_fprintf ()">hkl_matrix_fprintf</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-fprintf" title="hkl_matrix_fprintf ()">hkl_matrix_fprintf</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-init-from-euler" title="hkl_matrix_init_from_euler ()">hkl_matrix_init_from_euler</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-init-from-euler" title="hkl_matrix_init_from_euler ()">hkl_matrix_init_from_euler</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-init-from-two-vector" title="hkl_matrix_init_from_two_vector ()">hkl_matrix_init_from_two_vector</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-init-from-two-vector" title="hkl_matrix_init_from_two_vector ()">hkl_matrix_init_from_two_vector</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-is-null" title="hkl_matrix_is_null ()">hkl_matrix_is_null</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-is-null" title="hkl_matrix_is_null ()">hkl_matrix_is_null</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-matrix-set" title="hkl_matrix_matrix_set ()">hkl_matrix_matrix_set</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-matrix-set" title="hkl_matrix_matrix_set ()">hkl_matrix_matrix_set</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-solve" title="hkl_matrix_solve ()">hkl_matrix_solve</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-solve" title="hkl_matrix_solve ()">hkl_matrix_solve</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-times-vector" title="hkl_matrix_times_vector ()">hkl_matrix_times_vector</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-times-vector" title="hkl_matrix_times_vector ()">hkl_matrix_times_vector</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-to-euler" title="hkl_matrix_to_euler ()">hkl_matrix_to_euler</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-to-euler" title="hkl_matrix_to_euler ()">hkl_matrix_to_euler</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-transpose" title="hkl_matrix_transpose ()">hkl_matrix_transpose</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-transpose" title="hkl_matrix_transpose ()">hkl_matrix_transpose</a>, function in <a class="link" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">hkl-matrix-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="HklMode">HklMode</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="struct HklMode">HklMode</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
 </dt>
 <dd></dd>
 <dt>
@@ -1065,6 +1087,10 @@ HklFactory, struct in hkl
 </dt>
 <dd></dd>
 <dt>
+<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklModeError" title="enum HklModeError">HklModeError</a>, enum in <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html" title="hkl-pseudoaxis-auto-private">hkl-pseudoaxis-auto-private</a>
+</dt>
+<dd></dd>
+<dt>
 <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklModeInfo" title="struct HklModeInfo">HklModeInfo</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
 </dt>
 <dd></dd>
@@ -1077,27 +1103,47 @@ HklFactory, struct in hkl
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-init" title="hkl_mode_auto_init ()">hkl_mode_auto_init</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html" title="hkl-pseudoaxis-auto-private">hkl-pseudoaxis-auto-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-AUTO-INFO:CAPS" title="HKL_MODE_AUTO_INFO()">HKL_MODE_AUTO_INFO</a>, macro in <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html" title="hkl-pseudoaxis-auto-private">hkl-pseudoaxis-auto-private</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-AUTO-INFO-WITH-PARAMS:CAPS" title="HKL_MODE_AUTO_INFO_WITH_PARAMS()">HKL_MODE_AUTO_INFO_WITH_PARAMS</a>, macro in <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html" title="hkl-pseudoaxis-auto-private">hkl-pseudoaxis-auto-private</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-init" title="hkl_mode_auto_init ()">hkl_mode_auto_init</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html" title="hkl-pseudoaxis-auto-private">hkl-pseudoaxis-auto-private</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-new" title="hkl_mode_auto_new ()">hkl_mode_auto_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html" title="hkl-pseudoaxis-auto-private">hkl-pseudoaxis-auto-private</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-set-real" title="hkl_mode_auto_set_real ()">hkl_mode_auto_set_real</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html" title="hkl-pseudoaxis-auto-private">hkl-pseudoaxis-auto-private</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-AUTO-WITH-INIT-ERROR:CAPS" title="HKL_MODE_AUTO_WITH_INIT_ERROR">HKL_MODE_AUTO_WITH_INIT_ERROR</a>, macro in <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html" title="hkl-pseudoaxis-auto-private">hkl-pseudoaxis-auto-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-new" title="hkl_mode_auto_new ()">hkl_mode_auto_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html" title="hkl-pseudoaxis-auto-private">hkl-pseudoaxis-auto-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-with-init-new" title="hkl_mode_auto_with_init_new ()">hkl_mode_auto_with_init_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html" title="hkl-pseudoaxis-auto-private">hkl-pseudoaxis-auto-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-set-real" title="hkl_mode_auto_set_real ()">hkl_mode_auto_set_real</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html" title="hkl-pseudoaxis-auto-private">hkl-pseudoaxis-auto-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-get-hkl-real" title="hkl_mode_get_hkl_real ()">hkl_mode_get_hkl_real</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html" title="hkl-pseudoaxis-common-hkl-private">hkl-pseudoaxis-common-hkl-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-with-init-new" title="hkl_mode_auto_with_init_new ()">hkl_mode_auto_with_init_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html" title="hkl-pseudoaxis-auto-private">hkl-pseudoaxis-auto-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-private.html#HKL-MODE-INFO:CAPS" title="HKL_MODE_INFO()">HKL_MODE_INFO</a>, macro in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-get-hkl-real" title="hkl_mode_get_hkl_real ()">hkl_mode_get_hkl_real</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html" title="hkl-pseudoaxis-common-hkl-private">hkl-pseudoaxis-common-hkl-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-private.html#HKL-MODE-INFO-WITH-PARAMS:CAPS" title="HKL_MODE_INFO_WITH_PARAMS()">HKL_MODE_INFO_WITH_PARAMS</a>, macro in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-init-psi-constant-vertical-real" title="hkl_mode_init_psi_constant_vertical_real ()">hkl_mode_init_psi_constant_vertical_real</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html" title="hkl-pseudoaxis-common-hkl-private">hkl-pseudoaxis-common-hkl-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-initialized-set-psi-constant-vertical-real" title="hkl_mode_initialized_set_psi_constant_vertical_real ()">hkl_mode_initialized_set_psi_constant_vertical_real</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html" title="hkl-pseudoaxis-common-hkl-private">hkl-pseudoaxis-common-hkl-private</a>
 </dt>
 <dd></dd>
 <dt>
@@ -1117,11 +1163,11 @@ HklFactory, struct in hkl
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-psi-private.html#hkl-mode-psi-new" title="hkl_mode_psi_new ()">hkl_mode_psi_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-psi-private.html" title="hkl-pseudoaxis-common-psi-private">hkl-pseudoaxis-common-psi-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-psi-private.html#hkl-mode-psi-new" title="hkl_mode_psi_new ()">hkl_mode_psi_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-psi-private.html" title="hkl-pseudoaxis-common-psi-private">hkl-pseudoaxis-common-psi-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-set-hkl-real" title="hkl_mode_set_hkl_real ()">hkl_mode_set_hkl_real</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html" title="hkl-pseudoaxis-common-hkl-private">hkl-pseudoaxis-common-hkl-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-set-hkl-real" title="hkl_mode_set_hkl_real ()">hkl_mode_set_hkl_real</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html" title="hkl-pseudoaxis-common-hkl-private">hkl-pseudoaxis-common-hkl-private</a>
 </dt>
 <dd></dd>
 <a name="idxN"></a><h3 class="title">N</h3>
@@ -1135,11 +1181,11 @@ HklFactory, struct in hkl
 <dd></dd>
 <a name="idxP"></a><h3 class="title">P</h3>
 <dt>
-<a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter">HklParameter</a>, struct in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
+<a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter">HklParameter</a>, struct in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
 </dt>
 <dd></dd>
 <dt>
-HklParameterList, struct in hkl
+<a class="link" href="hkl-hkl-parameter-private.html#HklParameterError" title="enum HklParameterError">HklParameterError</a>, enum in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
 </dt>
 <dd></dd>
 <dt>
@@ -1155,210 +1201,230 @@ HklParameterList, struct in hkl
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-fprintf" title="hkl_parameter_fprintf ()">hkl_parameter_fprintf</a>, function in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
+<a class="link" href="hkl-hkl-parameter-private.html#HKL-PARAMETER-ERROR:CAPS" title="HKL_PARAMETER_ERROR">HKL_PARAMETER_ERROR</a>, macro in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-init-copy" title="hkl_parameter_init_copy ()">hkl_parameter_init_copy</a>, function in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
+<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-fprintf" title="hkl_parameter_fprintf ()">hkl_parameter_fprintf</a>, function in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-is-valid" title="hkl_parameter_is_valid ()">hkl_parameter_is_valid</a>, function in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
+<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-init-copy" title="hkl_parameter_init_copy ()">hkl_parameter_init_copy</a>, function in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-list-fprintf" title="hkl_parameter_list_fprintf ()">hkl_parameter_list_fprintf</a>, function in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
+<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-is-valid" title="hkl_parameter_is_valid ()">hkl_parameter_is_valid</a>, function in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-list-free" title="hkl_parameter_list_free ()">hkl_parameter_list_free</a>, function in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
+<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-new" title="hkl_parameter_new ()">hkl_parameter_new</a>, function in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-list-values-get" title="hkl_parameter_list_values_get ()">hkl_parameter_list_values_get</a>, function in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
+<a class="link" href="hkl-hkl-axis-private.html#hkl-parameter-new-axis" title="hkl_parameter_new_axis ()">hkl_parameter_new_axis</a>, function in <a class="link" href="hkl-hkl-axis-private.html" title="hkl-axis-private">hkl-axis-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-list-values-unit-set" title="hkl_parameter_list_values_unit_set ()">hkl_parameter_list_values_unit_set</a>, function in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
+<a class="link" href="hkl-hkl-parameter-private.html#HKL-PARAMETER-OPERATIONS-DEFAULTS:CAPS" title="HKL_PARAMETER_OPERATIONS_DEFAULTS">HKL_PARAMETER_OPERATIONS_DEFAULTS</a>, macro in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-new" title="hkl_parameter_new ()">hkl_parameter_new</a>, function in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-private.html#HKL-PARAMETER-OPERATIONS-PSEUDOAXIS-DEFAULTS:CAPS" title="HKL_PARAMETER_OPERATIONS_PSEUDOAXIS_DEFAULTS">HKL_PARAMETER_OPERATIONS_PSEUDOAXIS_DEFAULTS</a>, macro in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-axis-private.html#hkl-parameter-new-axis" title="hkl_parameter_new_axis ()">hkl_parameter_new_axis</a>, function in <a class="link" href="hkl-hkl-axis-private.html" title="hkl-axis-private">hkl-axis-private</a>
+<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-value-get-closest" title="hkl_parameter_value_get_closest ()">hkl_parameter_value_get_closest</a>, function in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#hkl-parameter-new-pseudo-axis" title="hkl_parameter_new_pseudo_axis ()">hkl_parameter_new_pseudo_axis</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
+<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-value-set-smallest-in-range" title="hkl_parameter_value_set_smallest_in_range ()">hkl_parameter_value_set_smallest_in_range</a>, function in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-parameter-private.html#HKL-PARAMETER-OPERATIONS-DEFAULTS:CAPS" title="HKL_PARAMETER_OPERATIONS_DEFAULTS">HKL_PARAMETER_OPERATIONS_DEFAULTS</a>, macro in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
+<a class="link" href="hkl-hkl-macros-private.html#hkl-printbt" title="hkl_printbt ()">hkl_printbt</a>, function in <a class="link" href="hkl-hkl-macros-private.html" title="hkl-macros-private">hkl-macros-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-value-get-closest" title="hkl_parameter_value_get_closest ()">hkl_parameter_value_get_closest</a>, function in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
+<a class="link" href="hkl-compiler.html#PRINTF-FMT:CAPS" title="PRINTF_FMT()">PRINTF_FMT</a>, macro in <a class="link" href="hkl-compiler.html" title="compiler">compiler</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-value-set-real" title="hkl_parameter_value_set_real ()">hkl_parameter_value_set_real</a>, function in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklPseudoAxis" title="struct HklPseudoAxis">HklPseudoAxis</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-value-set-smallest-in-range" title="hkl_parameter_value_set_smallest_in_range ()">hkl_parameter_value_set_smallest_in_range</a>, function in <a class="link" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">hkl-parameter-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-private.html#pseudo-axis" title="pseudo_axis">pseudo_axis</a>, variable in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-macros-private.html#hkl-printbt" title="hkl_printbt ()">hkl_printbt</a>, function in <a class="link" href="hkl-hkl-macros-private.html" title="hkl-macros-private">hkl-macros-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#PSI-CONSTANT-PARAMETERS:CAPS" title="PSI_CONSTANT_PARAMETERS()">PSI_CONSTANT_PARAMETERS</a>, macro in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html" title="hkl-pseudoaxis-common-hkl-private">hkl-pseudoaxis-common-hkl-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-compiler.html#PRINTF-FMT:CAPS" title="PRINTF_FMT()">PRINTF_FMT</a>, macro in <a class="link" href="hkl-compiler.html" title="compiler">compiler</a>
+<a class="link" href="hkl-ptr-valid.html#ptr-valid" title="ptr_valid ()">ptr_valid</a>, function in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklPseudoAxis" title="HklPseudoAxis">HklPseudoAxis</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
+<a class="link" href="hkl-ptr-valid.html#PTR-VALID-ALIGNOF:CAPS" title="PTR_VALID_ALIGNOF()">PTR_VALID_ALIGNOF</a>, macro in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-ptr-valid.html#ptr-valid" title="ptr_valid ()">ptr_valid</a>, function in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
+<a class="link" href="hkl-ptr-valid.html#ptr-valid-batch" title="struct ptr_valid_batch">ptr_valid_batch</a>, struct in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-ptr-valid.html#PTR-VALID-ALIGNOF:CAPS" title="PTR_VALID_ALIGNOF()">PTR_VALID_ALIGNOF</a>, macro in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
+<a class="link" href="hkl-ptr-valid.html#ptr-valid-batch-end" title="ptr_valid_batch_end ()">ptr_valid_batch_end</a>, function in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-ptr-valid.html#ptr-valid-batch" title="ptr_valid_batch ()">ptr_valid_batch</a>, function in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
+<a class="link" href="hkl-ptr-valid.html#ptr-valid-batch-read" title="ptr_valid_batch_read()">ptr_valid_batch_read</a>, macro in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-ptr-valid.html#ptr-valid-batch-end" title="ptr_valid_batch_end ()">ptr_valid_batch_end</a>, function in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
+<a class="link" href="hkl-ptr-valid.html#ptr-valid-batch-start" title="ptr_valid_batch_start ()">ptr_valid_batch_start</a>, function in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-ptr-valid.html#ptr-valid-batch-read" title="ptr_valid_batch_read()">ptr_valid_batch_read</a>, macro in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
+<a class="link" href="hkl-ptr-valid.html#ptr-valid-batch-string" title="ptr_valid_batch_string ()">ptr_valid_batch_string</a>, function in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-ptr-valid.html#ptr-valid-batch-start" title="ptr_valid_batch_start ()">ptr_valid_batch_start</a>, function in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
+<a class="link" href="hkl-ptr-valid.html#ptr-valid-batch-write" title="ptr_valid_batch_write()">ptr_valid_batch_write</a>, macro in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-ptr-valid.html#ptr-valid-batch-string" title="ptr_valid_batch_string ()">ptr_valid_batch_string</a>, function in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
+<a class="link" href="hkl-ptr-valid.html#ptr-valid-map" title="struct ptr_valid_map">ptr_valid_map</a>, struct in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-ptr-valid.html#ptr-valid-batch-write" title="ptr_valid_batch_write()">ptr_valid_batch_write</a>, macro in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
+<a class="link" href="hkl-ptr-valid.html#ptr-valid-read" title="ptr_valid_read()">ptr_valid_read</a>, macro in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-ptr-valid.html#ptr-valid-read" title="ptr_valid_read()">ptr_valid_read</a>, macro in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
+<a class="link" href="hkl-ptr-valid.html#ptr-valid-string" title="ptr_valid_string ()">ptr_valid_string</a>, function in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-ptr-valid.html#ptr-valid-string" title="ptr_valid_string ()">ptr_valid_string</a>, function in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
+<a class="link" href="hkl-ptr-valid.html#ptr-valid-write" title="ptr_valid_write()">ptr_valid_write</a>, macro in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-ptr-valid.html#ptr-valid-write" title="ptr_valid_write()">ptr_valid_write</a>, macro in <a class="link" href="hkl-ptr-valid.html" title="ptr_valid">ptr_valid</a>
+<a class="link" href="hkl-compiler.html#PURE-FUNCTION:CAPS" title="PURE_FUNCTION">PURE_FUNCTION</a>, macro in <a class="link" href="hkl-compiler.html" title="compiler">compiler</a>
 </dt>
 <dd></dd>
 <a name="idxQ"></a><h3 class="title">Q</h3>
 <dt>
-<a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion">HklQuaternion</a>, struct in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html#qmax" title="qmax ()">qmax</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html" title="hkl-pseudoaxis-common-q-private">hkl-pseudoaxis-common-q-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-cmp" title="hkl_quaternion_cmp ()">hkl_quaternion_cmp</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
+<a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion">HklQuaternion</a>, struct in <a class="link" href="hkl-hkl.html" title="hkl">hkl</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-conjugate" title="hkl_quaternion_conjugate ()">hkl_quaternion_conjugate</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-cmp" title="hkl_quaternion_cmp ()">hkl_quaternion_cmp</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-dup" title="hkl_quaternion_dup ()">hkl_quaternion_dup</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-conjugate" title="hkl_quaternion_conjugate ()">hkl_quaternion_conjugate</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-fprintf" title="hkl_quaternion_fprintf ()">hkl_quaternion_fprintf</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-dup" title="hkl_quaternion_dup ()">hkl_quaternion_dup</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-free" title="hkl_quaternion_free ()">hkl_quaternion_free</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-fprintf" title="hkl_quaternion_fprintf ()">hkl_quaternion_fprintf</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-init" title="hkl_quaternion_init ()">hkl_quaternion_init</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-free" title="hkl_quaternion_free ()">hkl_quaternion_free</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-init-from-angle-and-axe" title="hkl_quaternion_init_from_angle_and_axe ()">hkl_quaternion_init_from_angle_and_axe</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-init" title="hkl_quaternion_init ()">hkl_quaternion_init</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-init-from-vector" title="hkl_quaternion_init_from_vector ()">hkl_quaternion_init_from_vector</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-init-from-angle-and-axe" title="hkl_quaternion_init_from_angle_and_axe ()">hkl_quaternion_init_from_angle_and_axe</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-minus-quaternion" title="hkl_quaternion_minus_quaternion ()">hkl_quaternion_minus_quaternion</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-init-from-vector" title="hkl_quaternion_init_from_vector ()">hkl_quaternion_init_from_vector</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-norm2" title="hkl_quaternion_norm2 ()">hkl_quaternion_norm2</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-minus-quaternion" title="hkl_quaternion_minus_quaternion ()">hkl_quaternion_minus_quaternion</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-times-quaternion" title="hkl_quaternion_times_quaternion ()">hkl_quaternion_times_quaternion</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-norm2" title="hkl_quaternion_norm2 ()">hkl_quaternion_norm2</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-to-angle-and-axe" title="hkl_quaternion_to_angle_and_axe ()">hkl_quaternion_to_angle_and_axe</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-times-quaternion" title="hkl_quaternion_times_quaternion ()">hkl_quaternion_times_quaternion</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-to-matrix" title="hkl_quaternion_to_matrix ()">hkl_quaternion_to_matrix</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-to-angle-and-axe" title="hkl_quaternion_to_angle_and_axe ()">hkl_quaternion_to_angle_and_axe</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
 </dt>
 <dd></dd>
-<a name="idxR"></a><h3 class="title">R</h3>
 <dt>
-<a href="hkl-hkl-macros.html#HKL-RADTODEG:CAPS">HKL_RADTODEG</a>, macro in hkl
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-to-matrix" title="hkl_quaternion_to_matrix ()">hkl_quaternion_to_matrix</a>, function in <a class="link" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">hkl-quaternion-private</a>
 </dt>
 <dd></dd>
+<a name="idxR"></a><h3 class="title">R</h3>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#register-pseudo-axis" title="register_pseudo_axis ()">register_pseudo_axis</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
+<a class="link" href="hkl-hkl.html#HKL-RADTODEG:CAPS" title="HKL_RADTODEG">HKL_RADTODEG</a>, macro in <a class="link" href="hkl-hkl.html" title="hkl">hkl</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-macros-private.html#hkl-return-val-if-fail" title="hkl_return_val_if_fail()">hkl_return_val_if_fail</a>, macro in <a class="link" href="hkl-hkl-macros-private.html" title="hkl-macros-private">hkl-macros-private</a>
+<a class="link" href="hkl-hkl-factory-private.html#REGISTER-DIFFRACTOMETER:CAPS" title="REGISTER_DIFFRACTOMETER()">REGISTER_DIFFRACTOMETER</a>, macro in <a class="link" href="hkl-hkl-factory-private.html" title="hkl-factory-private">hkl-factory-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#RUBh-minus-Q" title="RUBh_minus_Q ()">RUBh_minus_Q</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html" title="hkl-pseudoaxis-common-hkl-private">hkl-pseudoaxis-common-hkl-private</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#RUBh-minus-Q" title="RUBh_minus_Q ()">RUBh_minus_Q</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html" title="hkl-pseudoaxis-common-hkl-private">hkl-pseudoaxis-common-hkl-private</a>
 </dt>
 <dd></dd>
 <a name="idxS"></a><h3 class="title">S</h3>
 <dt>
-<a class="link" href="hkl-hkl-sample-private.html#HklSample" title="HklSample">HklSample</a>, struct in <a class="link" href="hkl-hkl-sample-private.html" title="hkl-sample-private">hkl-sample-private</a>
+<a class="link" href="hkl-hkl.html#HklSample" title="HklSample">HklSample</a>, struct in <a class="link" href="hkl-hkl-sample-private.html" title="hkl-sample-private">hkl-sample-private</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-hkl-sample-private.html#HklSampleError" title="enum HklSampleError">HklSampleError</a>, enum in <a class="link" href="hkl-hkl-sample-private.html" title="hkl-sample-private">hkl-sample-private</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-hkl.html#HklSampleReflection" title="HklSampleReflection">HklSampleReflection</a>, struct in <a class="link" href="hkl-hkl-sample-private.html" title="hkl-sample-private">hkl-sample-private</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-hkl-sample-private.html#HklSampleReflectionError" title="enum HklSampleReflectionError">HklSampleReflectionError</a>, enum in <a class="link" href="hkl-hkl-sample-private.html" title="hkl-sample-private">hkl-sample-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-sample-private.html#HklSampleReflection" title="HklSampleReflection">HklSampleReflection</a>, struct in <a class="link" href="hkl-hkl-sample-private.html" title="hkl-sample-private">hkl-sample-private</a>
+<a class="link" href="hkl-hkl-sample-private.html#HKL-SAMPLE-ERROR:CAPS" title="HKL_SAMPLE_ERROR">HKL_SAMPLE_ERROR</a>, macro in <a class="link" href="hkl-hkl-sample-private.html" title="hkl-sample-private">hkl-sample-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-sample-private.html#hkl-sample-fprintf" title="hkl_sample_fprintf ()">hkl_sample_fprintf</a>, function in <a class="link" href="hkl-hkl-sample-private.html" title="hkl-sample-private">hkl-sample-private</a>
+<a class="link" href="hkl-hkl-sample-private.html#hkl-sample-fprintf" title="hkl_sample_fprintf ()">hkl_sample_fprintf</a>, function in <a class="link" href="hkl-hkl-sample-private.html" title="hkl-sample-private">hkl-sample-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-sample-private.html#hkl-sample-reflection-free" title="hkl_sample_reflection_free ()">hkl_sample_reflection_free</a>, function in <a class="link" href="hkl-hkl-sample-private.html" title="hkl-sample-private">hkl-sample-private</a>
+<a class="link" href="hkl-hkl.html#HKL-SAMPLE-REFLECTIONS-FOREACH:CAPS" title="HKL_SAMPLE_REFLECTIONS_FOREACH()">HKL_SAMPLE_REFLECTIONS_FOREACH</a>, macro in <a class="link" href="hkl-hkl.html" title="hkl">hkl</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-sample-private.html#hkl-sample-reflection-new-copy" title="hkl_sample_reflection_new_copy ()">hkl_sample_reflection_new_copy</a>, function in <a class="link" href="hkl-hkl-sample-private.html" title="hkl-sample-private">hkl-sample-private</a>
+<a class="link" href="hkl-hkl-sample-private.html#HKL-SAMPLE-REFLECTION-ERROR:CAPS" title="HKL_SAMPLE_REFLECTION_ERROR">HKL_SAMPLE_REFLECTION_ERROR</a>, macro in <a class="link" href="hkl-hkl-sample-private.html" title="hkl-sample-private">hkl-sample-private</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-hkl-sample-private.html#hkl-sample-reflection-free" title="hkl_sample_reflection_free ()">hkl_sample_reflection_free</a>, function in <a class="link" href="hkl-hkl-sample-private.html" title="hkl-sample-private">hkl-sample-private</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-hkl-sample-private.html#hkl-sample-reflection-new-copy" title="hkl_sample_reflection_new_copy ()">hkl_sample_reflection_new_copy</a>, function in <a class="link" href="hkl-hkl-sample-private.html" title="hkl-sample-private">hkl-sample-private</a>
 </dt>
 <dd></dd>
 <dt>
@@ -1370,11 +1436,11 @@ HklParameterList, struct in hkl
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-source-private.html#hkl-source-cmp" title="hkl_source_cmp ()">hkl_source_cmp</a>, function in <a class="link" href="hkl-hkl-source-private.html" title="hkl-source-private">hkl-source-private</a>
+<a class="link" href="hkl-hkl-source-private.html#hkl-source-cmp" title="hkl_source_cmp ()">hkl_source_cmp</a>, function in <a class="link" href="hkl-hkl-source-private.html" title="hkl-source-private">hkl-source-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-source-private.html#hkl-source-compute-ki" title="hkl_source_compute_ki ()">hkl_source_compute_ki</a>, function in <a class="link" href="hkl-hkl-source-private.html" title="hkl-source-private">hkl-source-private</a>
+<a class="link" href="hkl-hkl-source-private.html#hkl-source-compute-ki" title="hkl_source_compute_ki ()">hkl_source_compute_ki</a>, function in <a class="link" href="hkl-hkl-source-private.html" title="hkl-source-private">hkl-source-private</a>
 </dt>
 <dd></dd>
 <dt>
@@ -1382,36 +1448,140 @@ HklParameterList, struct in hkl
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-source-private.html#hkl-source-dup" title="hkl_source_dup ()">hkl_source_dup</a>, function in <a class="link" href="hkl-hkl-source-private.html" title="hkl-source-private">hkl-source-private</a>
+<a class="link" href="hkl-hkl-source-private.html#hkl-source-dup" title="hkl_source_dup ()">hkl_source_dup</a>, function in <a class="link" href="hkl-hkl-source-private.html" title="hkl-source-private">hkl-source-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-source-private.html#hkl-source-fprintf" title="hkl_source_fprintf ()">hkl_source_fprintf</a>, function in <a class="link" href="hkl-hkl-source-private.html" title="hkl-source-private">hkl-source-private</a>
+<a class="link" href="hkl-hkl-source-private.html#hkl-source-fprintf" title="hkl_source_fprintf ()">hkl_source_fprintf</a>, function in <a class="link" href="hkl-hkl-source-private.html" title="hkl-source-private">hkl-source-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-source-private.html#hkl-source-free" title="hkl_source_free ()">hkl_source_free</a>, function in <a class="link" href="hkl-hkl-source-private.html" title="hkl-source-private">hkl-source-private</a>
+<a class="link" href="hkl-hkl-source-private.html#hkl-source-free" title="hkl_source_free ()">hkl_source_free</a>, function in <a class="link" href="hkl-hkl-source-private.html" title="hkl-source-private">hkl-source-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-source-private.html#hkl-source-get-wavelength" title="hkl_source_get_wavelength ()">hkl_source_get_wavelength</a>, function in <a class="link" href="hkl-hkl-source-private.html" title="hkl-source-private">hkl-source-private</a>
+<a class="link" href="hkl-hkl-source-private.html#hkl-source-get-wavelength" title="hkl_source_get_wavelength ()">hkl_source_get_wavelength</a>, function in <a class="link" href="hkl-hkl-source-private.html" title="hkl-source-private">hkl-source-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-source-private.html#hkl-source-init" title="hkl_source_init ()">hkl_source_init</a>, function in <a class="link" href="hkl-hkl-source-private.html" title="hkl-source-private">hkl-source-private</a>
+<a class="link" href="hkl-hkl-source-private.html#hkl-source-init" title="hkl_source_init ()">hkl_source_init</a>, function in <a class="link" href="hkl-hkl-source-private.html" title="hkl-source-private">hkl-source-private</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str.html#strchr" title="strchr()">strchr</a>, macro in <a class="link" href="hkl-str.html" title="str">str</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str.html#strcount" title="strcount ()">strcount</a>, function in <a class="link" href="hkl-str.html" title="str">str</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str.html#streq" title="streq()">streq</a>, macro in <a class="link" href="hkl-str.html" title="str">str</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str.html#stringify" title="stringify()">stringify</a>, macro in <a class="link" href="hkl-str.html" title="str">str</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str.html#stringify-1" title="stringify_1()">stringify_1</a>, macro in <a class="link" href="hkl-str.html" title="str">str</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str.html#strrchr" title="strrchr()">strrchr</a>, macro in <a class="link" href="hkl-str.html" title="str">str</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str.html#strstarts" title="strstarts()">strstarts</a>, macro in <a class="link" href="hkl-str.html" title="str">str</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str.html#strstr" title="strstr()">strstr</a>, macro in <a class="link" href="hkl-str.html" title="str">str</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str.html#str-check-arg-" title="str_check_arg_()">str_check_arg_</a>, macro in <a class="link" href="hkl-str.html" title="str">str</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str-debug.html#str-isalnum" title="str_isalnum ()">str_isalnum</a>, function in <a class="link" href="hkl-str-debug.html" title="str_debug">str_debug</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str-debug.html#str-isalpha" title="str_isalpha ()">str_isalpha</a>, function in <a class="link" href="hkl-str-debug.html" title="str_debug">str_debug</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str-debug.html#str-isascii" title="str_isascii ()">str_isascii</a>, function in <a class="link" href="hkl-str-debug.html" title="str_debug">str_debug</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str-debug.html#str-isblank" title="str_isblank ()">str_isblank</a>, function in <a class="link" href="hkl-str-debug.html" title="str_debug">str_debug</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str-debug.html#str-iscntrl" title="str_iscntrl ()">str_iscntrl</a>, function in <a class="link" href="hkl-str-debug.html" title="str_debug">str_debug</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str-debug.html#str-isdigit" title="str_isdigit ()">str_isdigit</a>, function in <a class="link" href="hkl-str-debug.html" title="str_debug">str_debug</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str-debug.html#str-isgraph" title="str_isgraph ()">str_isgraph</a>, function in <a class="link" href="hkl-str-debug.html" title="str_debug">str_debug</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str-debug.html#str-islower" title="str_islower ()">str_islower</a>, function in <a class="link" href="hkl-str-debug.html" title="str_debug">str_debug</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str-debug.html#str-isprint" title="str_isprint ()">str_isprint</a>, function in <a class="link" href="hkl-str-debug.html" title="str_debug">str_debug</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str-debug.html#str-ispunct" title="str_ispunct ()">str_ispunct</a>, function in <a class="link" href="hkl-str-debug.html" title="str_debug">str_debug</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str-debug.html#str-isspace" title="str_isspace ()">str_isspace</a>, function in <a class="link" href="hkl-str-debug.html" title="str_debug">str_debug</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str-debug.html#str-isupper" title="str_isupper ()">str_isupper</a>, function in <a class="link" href="hkl-str-debug.html" title="str_debug">str_debug</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str-debug.html#str-isxdigit" title="str_isxdigit ()">str_isxdigit</a>, function in <a class="link" href="hkl-str-debug.html" title="str_debug">str_debug</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str.html#STR-MAX-CHARS:CAPS" title="STR_MAX_CHARS()">STR_MAX_CHARS</a>, macro in <a class="link" href="hkl-str.html" title="str">str</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-str.html#STR-MAX-CHARS-TCHECK-:CAPS" title="STR_MAX_CHARS_TCHECK_()">STR_MAX_CHARS_TCHECK_</a>, macro in <a class="link" href="hkl-str.html" title="str">str</a>
 </dt>
 <dd></dd>
-<a name="idxT"></a><h3 class="title">T</h3>
 <dt>
-<a href="hkl-hkl-macros.html#HKL-TAU:CAPS">HKL_TAU</a>, macro in hkl
+<a class="link" href="hkl-str-debug.html#str-strchr" title="str_strchr ()">str_strchr</a>, function in <a class="link" href="hkl-str-debug.html" title="str_debug">str_debug</a>
 </dt>
 <dd></dd>
 <dt>
-<a href="hkl-hkl-macros.html#HKL-TINY:CAPS">HKL_TINY</a>, macro in hkl
+<a class="link" href="hkl-str-debug.html#str-strrchr" title="str_strrchr ()">str_strrchr</a>, function in <a class="link" href="hkl-str-debug.html" title="str_debug">str_debug</a>
 </dt>
 <dd></dd>
 <dt>
-<a href="hkl-hkl-macros.html#HKL-TRUE:CAPS">HKL_TRUE</a>, macro in hkl
+<a class="link" href="hkl-str-debug.html#str-strstr" title="str_strstr ()">str_strstr</a>, function in <a class="link" href="hkl-str-debug.html" title="str_debug">str_debug</a>
+</dt>
+<dd></dd>
+<a name="idxT"></a><h3 class="title">T</h3>
+<dt>
+<a class="link" href="hkl-hkl.html#HKL-TAU:CAPS" title="HKL_TAU">HKL_TAU</a>, macro in <a class="link" href="hkl-hkl.html" title="hkl">hkl</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-hkl.html#HKL-TINY:CAPS" title="HKL_TINY">HKL_TINY</a>, macro in <a class="link" href="hkl-hkl.html" title="hkl">hkl</a>
 </dt>
 <dd></dd>
 <dt>
@@ -1419,7 +1589,11 @@ HklParameterList, struct in hkl
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-types.html#TYPE-HKL-AXIS:CAPS" title="TYPE_HKL_AXIS">TYPE_HKL_AXIS</a>, macro in <a class="link" href="hkl-hkl-types.html" title="hkl-types">hkl-types</a>
+<a class="link" href="hkl-hkl-type-builtins.html#HKL-TYPE-ENGINE-AXIS-NAMES-GET:CAPS" title="HKL_TYPE_ENGINE_AXIS_NAMES_GET">HKL_TYPE_ENGINE_AXIS_NAMES_GET</a>, macro in <a class="link" href="hkl-hkl-type-builtins.html" title="hkl-type-builtins">hkl-type-builtins</a>
+</dt>
+<dd></dd>
+<dt>
+<a class="link" href="hkl-hkl-type-builtins.html#HKL-TYPE-ENGINE-CAPABILITIES:CAPS" title="HKL_TYPE_ENGINE_CAPABILITIES">HKL_TYPE_ENGINE_CAPABILITIES</a>, macro in <a class="link" href="hkl-hkl-type-builtins.html" title="hkl-type-builtins">hkl-type-builtins</a>
 </dt>
 <dd></dd>
 <dt>
@@ -1435,7 +1609,7 @@ HklParameterList, struct in hkl
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-types.html#TYPE-HKL-ERROR:CAPS" title="TYPE_HKL_ERROR">TYPE_HKL_ERROR</a>, macro in <a class="link" href="hkl-hkl-types.html" title="hkl-types">hkl-types</a>
+<a class="link" href="hkl-hkl-types.html#TYPE-HKL-FACTORY:CAPS" title="TYPE_HKL_FACTORY">TYPE_HKL_FACTORY</a>, macro in <a class="link" href="hkl-hkl-types.html" title="hkl-types">hkl-types</a>
 </dt>
 <dd></dd>
 <dt>
@@ -1463,14 +1637,6 @@ HklParameterList, struct in hkl
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-types.html#TYPE-HKL-PARAMETER-LIST:CAPS" title="TYPE_HKL_PARAMETER_LIST">TYPE_HKL_PARAMETER_LIST</a>, macro in <a class="link" href="hkl-hkl-types.html" title="hkl-types">hkl-types</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-types.html#TYPE-HKL-PSEUDO-AXIS:CAPS" title="TYPE_HKL_PSEUDO_AXIS">TYPE_HKL_PSEUDO_AXIS</a>, macro in <a class="link" href="hkl-hkl-types.html" title="hkl-types">hkl-types</a>
-</dt>
-<dd></dd>
-<dt>
 <a class="link" href="hkl-hkl-types.html#TYPE-HKL-SAMPLE:CAPS" title="TYPE_HKL_SAMPLE">TYPE_HKL_SAMPLE</a>, macro in <a class="link" href="hkl-hkl-types.html" title="hkl-types">hkl-types</a>
 </dt>
 <dd></dd>
@@ -1486,41 +1652,45 @@ HklParameterList, struct in hkl
 <a class="link" href="hkl-hkl-types.html#TYPE-HKL-VECTOR:CAPS" title="TYPE_HKL_VECTOR">TYPE_HKL_VECTOR</a>, macro in <a class="link" href="hkl-hkl-types.html" title="hkl-types">hkl-types</a>
 </dt>
 <dd></dd>
+<dt>
+<a class="link" href="hkl-hkl-type-builtins.html#HKL-TYPE-UNIT-ENUM:CAPS" title="HKL_TYPE_UNIT_ENUM">HKL_TYPE_UNIT_ENUM</a>, macro in <a class="link" href="hkl-hkl-type-builtins.html" title="hkl-type-builtins">hkl-type-builtins</a>
+</dt>
+<dd></dd>
 <a name="idxU"></a><h3 class="title">U</h3>
 <dt>
 <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit">HklUnit</a>, struct in <a class="link" href="hkl-hkl-unit-private.html" title="hkl-unit-private">hkl-unit-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-unit-private.html#HklUnitType" title="enum HklUnitType">HklUnitType</a>, enum in <a class="link" href="hkl-hkl-unit-private.html" title="hkl-unit-private">hkl-unit-private</a>
+<a class="link" href="hkl-hkl.html#HklUnitEnum" title="enum HklUnitEnum">HklUnitEnum</a>, enum in <a class="link" href="hkl-hkl.html" title="hkl">hkl</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-unit-private.html#hkl-unit-compatible" title="hkl_unit_compatible ()">hkl_unit_compatible</a>, function in <a class="link" href="hkl-hkl-unit-private.html" title="hkl-unit-private">hkl-unit-private</a>
+<a class="link" href="hkl-hkl-unit-private.html#HklUnitType" title="enum HklUnitType">HklUnitType</a>, enum in <a class="link" href="hkl-hkl-unit-private.html" title="hkl-unit-private">hkl-unit-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-unit-private.html#hkl-unit-dup" title="hkl_unit_dup ()">hkl_unit_dup</a>, function in <a class="link" href="hkl-hkl-unit-private.html" title="hkl-unit-private">hkl-unit-private</a>
+<a class="link" href="hkl-hkl-unit-private.html#hkl-unit-compatible" title="hkl_unit_compatible ()">hkl_unit_compatible</a>, function in <a class="link" href="hkl-hkl-unit-private.html" title="hkl-unit-private">hkl-unit-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-unit-private.html#hkl-unit-factor" title="hkl_unit_factor ()">hkl_unit_factor</a>, function in <a class="link" href="hkl-hkl-unit-private.html" title="hkl-unit-private">hkl-unit-private</a>
+<a class="link" href="hkl-hkl-unit-private.html#hkl-unit-dup" title="hkl_unit_dup ()">hkl_unit_dup</a>, function in <a class="link" href="hkl-hkl-unit-private.html" title="hkl-unit-private">hkl-unit-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-unit-private.html#hkl-unit-free" title="hkl_unit_free ()">hkl_unit_free</a>, function in <a class="link" href="hkl-hkl-unit-private.html" title="hkl-unit-private">hkl-unit-private</a>
+<a class="link" href="hkl-hkl-unit-private.html#hkl-unit-factor" title="hkl_unit_factor ()">hkl_unit_factor</a>, function in <a class="link" href="hkl-hkl-unit-private.html" title="hkl-unit-private">hkl-unit-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-noerr.html#unlink-noerr" title="unlink_noerr ()">unlink_noerr</a>, function in <a class="link" href="hkl-noerr.html" title="noerr">noerr</a>
+<a class="link" href="hkl-hkl-unit-private.html#hkl-unit-free" title="hkl_unit_free ()">hkl_unit_free</a>, function in <a class="link" href="hkl-hkl-unit-private.html" title="hkl-unit-private">hkl-unit-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-compiler.html#UNNEEDED:CAPS" title="UNNEEDED">UNNEEDED</a>, macro in <a class="link" href="hkl-compiler.html" title="compiler">compiler</a>
+<a class="link" href="hkl-noerr.html#unlink-noerr" title="unlink_noerr ()">unlink_noerr</a>, function in <a class="link" href="hkl-noerr.html" title="noerr">noerr</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#unregister-pseudo-axis" title="unregister_pseudo_axis ()">unregister_pseudo_axis</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">hkl-pseudoaxis-private</a>
+<a class="link" href="hkl-compiler.html#UNNEEDED:CAPS" title="UNNEEDED">UNNEEDED</a>, macro in <a class="link" href="hkl-compiler.html" title="compiler">compiler</a>
 </dt>
 <dd></dd>
 <dt>
@@ -1529,137 +1699,141 @@ HklParameterList, struct in hkl
 <dd></dd>
 <a name="idxV"></a><h3 class="title">V</h3>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector">HklVector</a>, struct in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector">HklVector</a>, struct in <a class="link" href="hkl-hkl.html" title="hkl">hkl</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-add-vector" title="hkl_vector_add_vector ()">hkl_vector_add_vector</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-add-vector" title="hkl_vector_add_vector ()">hkl_vector_add_vector</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-angle" title="hkl_vector_angle ()">hkl_vector_angle</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-angle" title="hkl_vector_angle ()">hkl_vector_angle</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-cmp" title="hkl_vector_cmp ()">hkl_vector_cmp</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-cmp" title="hkl_vector_cmp ()">hkl_vector_cmp</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-div-double" title="hkl_vector_div_double ()">hkl_vector_div_double</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-div-double" title="hkl_vector_div_double ()">hkl_vector_div_double</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-dup" title="hkl_vector_dup ()">hkl_vector_dup</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-dup" title="hkl_vector_dup ()">hkl_vector_dup</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-fprintf" title="hkl_vector_fprintf ()">hkl_vector_fprintf</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-fprintf" title="hkl_vector_fprintf ()">hkl_vector_fprintf</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-free" title="hkl_vector_free ()">hkl_vector_free</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-free" title="hkl_vector_free ()">hkl_vector_free</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-init" title="hkl_vector_init ()">hkl_vector_init</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-init" title="hkl_vector_init ()">hkl_vector_init</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-is-colinear" title="hkl_vector_is_colinear ()">hkl_vector_is_colinear</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-is-colinear" title="hkl_vector_is_colinear ()">hkl_vector_is_colinear</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-is-null" title="hkl_vector_is_null ()">hkl_vector_is_null</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-is-null" title="hkl_vector_is_null ()">hkl_vector_is_null</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-is-opposite" title="hkl_vector_is_opposite ()">hkl_vector_is_opposite</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-is-opposite" title="hkl_vector_is_opposite ()">hkl_vector_is_opposite</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-minus-vector" title="hkl_vector_minus_vector ()">hkl_vector_minus_vector</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-minus-vector" title="hkl_vector_minus_vector ()">hkl_vector_minus_vector</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-norm2" title="hkl_vector_norm2 ()">hkl_vector_norm2</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-norm2" title="hkl_vector_norm2 ()">hkl_vector_norm2</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-normalize" title="hkl_vector_normalize ()">hkl_vector_normalize</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-normalize" title="hkl_vector_normalize ()">hkl_vector_normalize</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-oriented-angle" title="hkl_vector_oriented_angle ()">hkl_vector_oriented_angle</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-oriented-angle" title="hkl_vector_oriented_angle ()">hkl_vector_oriented_angle</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-oriented-angle-points" title="hkl_vector_oriented_angle_points ()">hkl_vector_oriented_angle_points</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-oriented-angle-points" title="hkl_vector_oriented_angle_points ()">hkl_vector_oriented_angle_points</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-project-on-plan" title="hkl_vector_project_on_plan ()">hkl_vector_project_on_plan</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-project-on-plan" title="hkl_vector_project_on_plan ()">hkl_vector_project_on_plan</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-project-on-plan-with-point" title="hkl_vector_project_on_plan_with_point ()">hkl_vector_project_on_plan_with_point</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-project-on-plan-with-point" title="hkl_vector_project_on_plan_with_point ()">hkl_vector_project_on_plan_with_point</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-randomize" title="hkl_vector_randomize ()">hkl_vector_randomize</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-randomize" title="hkl_vector_randomize ()">hkl_vector_randomize</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-randomize-vector" title="hkl_vector_randomize_vector ()">hkl_vector_randomize_vector</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-randomize-vector" title="hkl_vector_randomize_vector ()">hkl_vector_randomize_vector</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-randomize-vector-vector" title="hkl_vector_randomize_vector_vector ()">hkl_vector_randomize_vector_vector</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-randomize-vector-vector" title="hkl_vector_randomize_vector_vector ()">hkl_vector_randomize_vector_vector</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-rotated-around-line" title="hkl_vector_rotated_around_line ()">hkl_vector_rotated_around_line</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-rotated-around-line" title="hkl_vector_rotated_around_line ()">hkl_vector_rotated_around_line</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-rotated-around-vector" title="hkl_vector_rotated_around_vector ()">hkl_vector_rotated_around_vector</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-rotated-around-vector" title="hkl_vector_rotated_around_vector ()">hkl_vector_rotated_around_vector</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-rotated-quaternion" title="hkl_vector_rotated_quaternion ()">hkl_vector_rotated_quaternion</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-rotated-quaternion" title="hkl_vector_rotated_quaternion ()">hkl_vector_rotated_quaternion</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-scalar-product" title="hkl_vector_scalar_product ()">hkl_vector_scalar_product</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-scalar-product" title="hkl_vector_scalar_product ()">hkl_vector_scalar_product</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-sum" title="hkl_vector_sum ()">hkl_vector_sum</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-sum" title="hkl_vector_sum ()">hkl_vector_sum</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-times-double" title="hkl_vector_times_double ()">hkl_vector_times_double</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-times-double" title="hkl_vector_times_double ()">hkl_vector_times_double</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-times-matrix" title="hkl_vector_times_matrix ()">hkl_vector_times_matrix</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-times-matrix" title="hkl_vector_times_matrix ()">hkl_vector_times_matrix</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-times-vector" title="hkl_vector_times_vector ()">hkl_vector_times_vector</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-times-vector" title="hkl_vector_times_vector ()">hkl_vector_times_vector</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-vectorial-product" title="hkl_vector_vectorial_product ()">hkl_vector_vectorial_product</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-vectorial-product" title="hkl_vector_vectorial_product ()">hkl_vector_vectorial_product</a>, function in <a class="link" href="hkl-hkl-vector-private.html" title="hkl-vector-private">hkl-vector-private</a>
 </dt>
 <dd></dd>
 <a name="idxW"></a><h3 class="title">W</h3>
 <dt>
+<a class="link" href="hkl-hkl.html#HKL-WARN-UNUSED-RESULT:CAPS" title="HKL_WARN_UNUSED_RESULT">HKL_WARN_UNUSED_RESULT</a>, macro in <a class="link" href="hkl-hkl.html" title="hkl">hkl</a>
+</dt>
+<dd></dd>
+<dt>
 <a class="link" href="hkl-compiler.html#WARN-UNUSED-RESULT:CAPS" title="WARN_UNUSED_RESULT">WARN_UNUSED_RESULT</a>, macro in <a class="link" href="hkl-compiler.html" title="compiler">compiler</a>
 </dt>
 <dd></dd>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/ch01.html b/Documentation/api/html/ch01.html
index de9b729..36f1f93 100644
--- a/Documentation/api/html/ch01.html
+++ b/Documentation/api/html/ch01.html
@@ -2,26 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>[Insert title here]</title>
+<title>hkl Reference Manual: [Insert title here]</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="index.html" title="hkl Reference Manual">
 <link rel="prev" href="index.html" title="hkl Reference Manual">
 <link rel="next" href="hkl-array-size.html" title="array_size">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
-<td><a accesskey="p" href="index.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td> </td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-array-size.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts"></td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
+<td><a accesskey="p" href="index.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-array-size.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
 </tr></table>
 <div class="chapter">
 <div class="titlepage"><div><div><h1 class="title">
-<a name="idp46841404"></a>[Insert title here]</h1></div></div></div>
+<a name="id-1.2"></a>[Insert title here]</h1></div></div></div>
 <div class="toc"><dl class="toc">
 <dt>
 <span class="refentrytitle"><a href="hkl-array-size.html">array_size</a></span><span class="refpurpose"></span>
@@ -45,13 +45,16 @@
 <span class="refentrytitle"><a href="hkl-darray.html">darray</a></span><span class="refpurpose"></span>
 </dt>
 <dt>
+<span class="refentrytitle"><a href="hkl-hkl.html">hkl</a></span><span class="refpurpose"></span>
+</dt>
+<dt>
 <span class="refentrytitle"><a href="hkl-hkl-axis-private.html">hkl-axis-private</a></span><span class="refpurpose"></span>
 </dt>
 <dt>
 <span class="refentrytitle"><a href="hkl-hkl-detector-private.html">hkl-detector-private</a></span><span class="refpurpose"></span>
 </dt>
 <dt>
-<span class="refentrytitle"><a href="hkl-hkl-error-private.html">hkl-error-private</a></span><span class="refpurpose"></span>
+<span class="refentrytitle"><a href="hkl-hkl-factory-private.html">hkl-factory-private</a></span><span class="refpurpose"></span>
 </dt>
 <dt>
 <span class="refentrytitle"><a href="hkl-hkl-geometry-private.html">hkl-geometry-private</a></span><span class="refpurpose"></span>
@@ -87,30 +90,9 @@
 <span class="refentrytitle"><a href="hkl-hkl-pseudoaxis-common-q-private.html">hkl-pseudoaxis-common-q-private</a></span><span class="refpurpose"></span>
 </dt>
 <dt>
-<span class="refentrytitle"><a href="hkl-hkl-pseudoaxis-e4c-private.html">hkl-pseudoaxis-e4c-private</a></span><span class="refpurpose"></span>
-</dt>
-<dt>
-<span class="refentrytitle"><a href="hkl-hkl-pseudoaxis-e6c-private.html">hkl-pseudoaxis-e6c-private</a></span><span class="refpurpose"></span>
-</dt>
-<dt>
-<span class="refentrytitle"><a href="hkl-hkl-pseudoaxis-k4cv-private.html">hkl-pseudoaxis-k4cv-private</a></span><span class="refpurpose"></span>
-</dt>
-<dt>
-<span class="refentrytitle"><a href="hkl-hkl-pseudoaxis-k6c-private.html">hkl-pseudoaxis-k6c-private</a></span><span class="refpurpose"></span>
-</dt>
-<dt>
-<span class="refentrytitle"><a href="hkl-hkl-pseudoaxis-petra3-private.html">hkl-pseudoaxis-petra3-private</a></span><span class="refpurpose"></span>
-</dt>
-<dt>
 <span class="refentrytitle"><a href="hkl-hkl-pseudoaxis-private.html">hkl-pseudoaxis-private</a></span><span class="refpurpose"></span>
 </dt>
 <dt>
-<span class="refentrytitle"><a href="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html">hkl-pseudoaxis-soleil-sixs-med-private</a></span><span class="refpurpose"></span>
-</dt>
-<dt>
-<span class="refentrytitle"><a href="hkl-hkl-pseudoaxis-zaxis-private.html">hkl-pseudoaxis-zaxis-private</a></span><span class="refpurpose"></span>
-</dt>
-<dt>
 <span class="refentrytitle"><a href="hkl-hkl-quaternion-private.html">hkl-quaternion-private</a></span><span class="refpurpose"></span>
 </dt>
 <dt>
@@ -140,10 +122,16 @@
 <dt>
 <span class="refentrytitle"><a href="hkl-ptr-valid.html">ptr_valid</a></span><span class="refpurpose"></span>
 </dt>
+<dt>
+<span class="refentrytitle"><a href="hkl-str.html">str</a></span><span class="refpurpose"></span>
+</dt>
+<dt>
+<span class="refentrytitle"><a href="hkl-str-debug.html">str_debug</a></span><span class="refpurpose"></span>
+</dt>
 </dl></div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/deprecated-api-index.html b/Documentation/api/html/deprecated-api-index.html
index 69da0af..55ef44f 100644
--- a/Documentation/api/html/deprecated-api-index.html
+++ b/Documentation/api/html/deprecated-api-index.html
@@ -2,22 +2,22 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>Index of deprecated API</title>
+<title>hkl Reference Manual: Index of deprecated API</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="index.html" title="hkl Reference Manual">
 <link rel="prev" href="api-index-full.html" title="API Index">
 <link rel="next" href="annotation-glossary.html" title="Annotation Glossary">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
-<td><a accesskey="p" href="api-index-full.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td> </td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="annotation-glossary.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts"></td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
+<td><a accesskey="p" href="api-index-full.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="annotation-glossary.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
 </tr></table>
 <div class="index">
 <div class="titlepage"><div><div><h1 class="title">
@@ -26,6 +26,6 @@
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-array-size.html b/Documentation/api/html/hkl-array-size.html
index 286a3cf..da6e6c9 100644
--- a/Documentation/api/html/hkl-array-size.html
+++ b/Documentation/api/html/hkl-array-size.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>array_size</title>
+<title>hkl Reference Manual: array_size</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="ch01.html" title="[Insert title here]">
 <link rel="next" href="hkl-autodata.html" title="autodata">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="ch01.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-autodata.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-array-size.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-array-size.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-array-size.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="ch01.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-autodata.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-array-size"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,27 +29,40 @@
 <h2><span class="refentrytitle"><a name="hkl-array-size.top_of_page"></a>array_size</span></h2>
 <p>array_size</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-array-size.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">#define             <a class="link" href="hkl-array-size.html#ARRAY-SIZE:CAPS" title="ARRAY_SIZE()">ARRAY_SIZE</a>                          (arr)
-</pre>
+<div class="refsect1">
+<a name="hkl-array-size.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody><tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-array-size.html#ARRAY-SIZE:CAPS" title="ARRAY_SIZE()">ARRAY_SIZE</a><span class="c_punctuation">()</span>
+</td>
+</tr></tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-array-size.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-array-size.details"></a><h2>Details</h2>
+<a name="hkl-array-size.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
 <a name="ARRAY-SIZE:CAPS"></a><h3>ARRAY_SIZE()</h3>
 <pre class="programlisting">#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + _array_size_chk(arr))
 </pre>
 </div>
 </div>
+<div class="refsect1">
+<a name="hkl-array-size.other_details"></a><h2>Types and Values</h2>
+</div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-autodata.html b/Documentation/api/html/hkl-autodata.html
index 13f3718..174ed0f 100644
--- a/Documentation/api/html/hkl-autodata.html
+++ b/Documentation/api/html/hkl-autodata.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>autodata</title>
+<title>hkl Reference Manual: autodata</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-array-size.html" title="array_size">
 <link rel="next" href="hkl-build-assert.html" title="build_assert">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-array-size.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-build-assert.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-autodata.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-autodata.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-autodata.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-array-size.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-build-assert.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-autodata"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,55 +29,101 @@
 <h2><span class="refentrytitle"><a name="hkl-autodata.top_of_page"></a>autodata</span></h2>
 <p>autodata</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-autodata.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">#define             <a class="link" href="hkl-autodata.html#AUTODATA:CAPS" title="AUTODATA()">AUTODATA</a>                            (name,
-                                                         ptr)
-#define             <a class="link" href="hkl-autodata.html#AUTODATA-MAGIC:CAPS" title="AUTODATA_MAGIC">AUTODATA_MAGIC</a>
-#define             <a class="link" href="hkl-autodata.html#AUTODATA-TYPE:CAPS" title="AUTODATA_TYPE()">AUTODATA_TYPE</a>                       (name,
-                                                         type)
-#define             <a class="link" href="hkl-autodata.html#AUTODATA-VAR-:CAPS" title="AUTODATA_VAR_()">AUTODATA_VAR_</a>                       (name,
-                                                         line)
-#define             <a class="link" href="hkl-autodata.html#AUTODATA-VAR--:CAPS" title="AUTODATA_VAR__()">AUTODATA_VAR__</a>                      (name,
-                                                         line)
-<span class="returnvalue">void</span>                <a class="link" href="hkl-autodata.html#autodata-free" title="autodata_free ()">autodata_free</a>                       (<em class="parameter"><code><span class="type">void</span> *p</code></em>);
-#define             <a class="link" href="hkl-autodata.html#autodata-get" title="autodata_get()">autodata_get</a>                        (name,
-                                                         nump)
-<span class="returnvalue">void</span> *              <a class="link" href="hkl-autodata.html#autodata-get-section" title="autodata_get_section ()">autodata_get_section</a>                (<em class="parameter"><code><span class="type">void</span> *start</code></em>,
-                                                         <em class="parameter"><code><span class="type">void</span> *stop</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> *nump</code></em>);
-<span class="returnvalue">void</span> *              <a class="link" href="hkl-autodata.html#autodata-make-table" title="autodata_make_table ()">autodata_make_table</a>                 (<em class="parameter"><code>const <span class="type">void</span> *example</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">char</span> *name</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> *nump</code></em>);
-</pre>
+<div class="refsect1">
+<a name="hkl-autodata.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-autodata.html#AUTODATA-TYPE:CAPS" title="AUTODATA_TYPE()">AUTODATA_TYPE</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-autodata.html#AUTODATA:CAPS" title="AUTODATA()">AUTODATA</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-autodata.html#autodata-get" title="autodata_get()">autodata_get</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-autodata.html#autodata-free" title="autodata_free ()">autodata_free</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-autodata.html#AUTODATA-VAR--:CAPS" title="AUTODATA_VAR__()">AUTODATA_VAR__</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-autodata.html#AUTODATA-VAR-:CAPS" title="AUTODATA_VAR_()">AUTODATA_VAR_</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-autodata.html#autodata-get-section" title="autodata_get_section ()">autodata_get_section</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-autodata.html#AUTODATA-MAGIC:CAPS" title="AUTODATA_MAGIC">AUTODATA_MAGIC</a></td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-autodata.html#autodata-make-table" title="autodata_make_table ()">autodata_make_table</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-autodata.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-autodata.details"></a><h2>Details</h2>
+<a name="hkl-autodata.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
-<a name="AUTODATA:CAPS"></a><h3>AUTODATA()</h3>
-<pre class="programlisting">#define             AUTODATA(name, ptr)</pre>
+<a name="AUTODATA-TYPE:CAPS"></a><h3>AUTODATA_TYPE()</h3>
+<pre class="programlisting">#define             AUTODATA_TYPE(name, type)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="AUTODATA-MAGIC:CAPS"></a><h3>AUTODATA_MAGIC</h3>
-<pre class="programlisting">#define AUTODATA_MAGIC ((long)0xFEEDA10DA7AF00D5ULL)
-</pre>
+<a name="AUTODATA:CAPS"></a><h3>AUTODATA()</h3>
+<pre class="programlisting">#define             AUTODATA(name, ptr)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="AUTODATA-TYPE:CAPS"></a><h3>AUTODATA_TYPE()</h3>
-<pre class="programlisting">#define             AUTODATA_TYPE(name, type)</pre>
+<a name="autodata-get"></a><h3>autodata_get()</h3>
+<pre class="programlisting">#define             autodata_get(name, nump)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="AUTODATA-VAR-:CAPS"></a><h3>AUTODATA_VAR_()</h3>
-<pre class="programlisting">#define AUTODATA_VAR_(name, line) AUTODATA_VAR__(name, line)
-</pre>
+<a name="autodata-free"></a><h3>autodata_free ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+autodata_free (<em class="parameter"><code><span class="type">void</span> *p</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
@@ -91,32 +133,39 @@
 </div>
 <hr>
 <div class="refsect2">
-<a name="autodata-free"></a><h3>autodata_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                autodata_free                       (<em class="parameter"><code><span class="type">void</span> *p</code></em>);</pre>
+<a name="AUTODATA-VAR-:CAPS"></a><h3>AUTODATA_VAR_()</h3>
+<pre class="programlisting">#define AUTODATA_VAR_(name, line) AUTODATA_VAR__(name, line)
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="autodata-get"></a><h3>autodata_get()</h3>
-<pre class="programlisting">#define             autodata_get(name, nump)</pre>
+<a name="autodata-get-section"></a><h3>autodata_get_section ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span> *
+autodata_get_section (<em class="parameter"><code><span class="type">void</span> *start</code></em>,
+                      <em class="parameter"><code><span class="type">void</span> *stop</code></em>,
+                      <em class="parameter"><code><span class="type">size_t</span> *nump</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="autodata-get-section"></a><h3>autodata_get_section ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span> *              autodata_get_section                (<em class="parameter"><code><span class="type">void</span> *start</code></em>,
-                                                         <em class="parameter"><code><span class="type">void</span> *stop</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> *nump</code></em>);</pre>
+<a name="AUTODATA-MAGIC:CAPS"></a><h3>AUTODATA_MAGIC</h3>
+<pre class="programlisting">#define AUTODATA_MAGIC ((long)0xFEEDA10DA7AF00D5ULL)
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="autodata-make-table"></a><h3>autodata_make_table ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span> *              autodata_make_table                 (<em class="parameter"><code>const <span class="type">void</span> *example</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">char</span> *name</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> *nump</code></em>);</pre>
+<a name="autodata-make-table"></a><h3>autodata_make_table ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span> *
+autodata_make_table (<em class="parameter"><code>const <span class="type">void</span> *example</code></em>,
+                     <em class="parameter"><code>const <span class="type">char</span> *name</code></em>,
+                     <em class="parameter"><code><span class="type">size_t</span> *nump</code></em>);</pre>
+</div>
 </div>
+<div class="refsect1">
+<a name="hkl-autodata.other_details"></a><h2>Types and Values</h2>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-build-assert.html b/Documentation/api/html/hkl-build-assert.html
index eed0fe6..d3015c8 100644
--- a/Documentation/api/html/hkl-build-assert.html
+++ b/Documentation/api/html/hkl-build-assert.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>build_assert</title>
+<title>hkl Reference Manual: build_assert</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-autodata.html" title="autodata">
 <link rel="next" href="hkl-check-type.html" title="check_type">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-autodata.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-check-type.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-build-assert.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-build-assert.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-build-assert.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-autodata.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-check-type.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-build-assert"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,19 +29,36 @@
 <h2><span class="refentrytitle"><a name="hkl-build-assert.top_of_page"></a>build_assert</span></h2>
 <p>build_assert</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-build-assert.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">#define             <a class="link" href="hkl-build-assert.html#BUILD-ASSERT:CAPS" title="BUILD_ASSERT()">BUILD_ASSERT</a>                        (cond)
-#define             <a class="link" href="hkl-build-assert.html#BUILD-ASSERT-OR-ZERO:CAPS" title="BUILD_ASSERT_OR_ZERO()">BUILD_ASSERT_OR_ZERO</a>                (cond)
-</pre>
+<div class="refsect1">
+<a name="hkl-build-assert.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-build-assert.html#BUILD-ASSERT:CAPS" title="BUILD_ASSERT()">BUILD_ASSERT</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-build-assert.html#BUILD-ASSERT-OR-ZERO:CAPS" title="BUILD_ASSERT_OR_ZERO()">BUILD_ASSERT_OR_ZERO</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-build-assert.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-build-assert.details"></a><h2>Details</h2>
+<a name="hkl-build-assert.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
 <a name="BUILD-ASSERT:CAPS"></a><h3>BUILD_ASSERT()</h3>
 <pre class="programlisting">#define             BUILD_ASSERT(cond)</pre>
@@ -56,9 +69,12 @@
 <pre class="programlisting">#define             BUILD_ASSERT_OR_ZERO(cond)</pre>
 </div>
 </div>
+<div class="refsect1">
+<a name="hkl-build-assert.other_details"></a><h2>Types and Values</h2>
+</div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-check-type.html b/Documentation/api/html/hkl-check-type.html
index 0ce1f5e..8d1cd8b 100644
--- a/Documentation/api/html/hkl-check-type.html
+++ b/Documentation/api/html/hkl-check-type.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>check_type</title>
+<title>hkl Reference Manual: check_type</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-build-assert.html" title="build_assert">
 <link rel="next" href="hkl-compiler.html" title="compiler">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-build-assert.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-compiler.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-check-type.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-check-type.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-check-type.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-build-assert.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-compiler.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-check-type"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,21 +29,36 @@
 <h2><span class="refentrytitle"><a name="hkl-check-type.top_of_page"></a>check_type</span></h2>
 <p>check_type</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-check-type.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">#define             <a class="link" href="hkl-check-type.html#check-type" title="check_type()">check_type</a>                          (expr,
-                                                         type)
-#define             <a class="link" href="hkl-check-type.html#check-types-match" title="check_types_match()">check_types_match</a>                   (expr1,
-                                                         expr2)
-</pre>
+<div class="refsect1">
+<a name="hkl-check-type.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-check-type.html#check-type" title="check_type()">check_type</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-check-type.html#check-types-match" title="check_types_match()">check_types_match</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-check-type.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-check-type.details"></a><h2>Details</h2>
+<a name="hkl-check-type.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
 <a name="check-type"></a><h3>check_type()</h3>
 <pre class="programlisting">#define             check_type(expr, type)</pre>
@@ -58,9 +69,12 @@
 <pre class="programlisting">#define             check_types_match(expr1, expr2)</pre>
 </div>
 </div>
+<div class="refsect1">
+<a name="hkl-check-type.other_details"></a><h2>Types and Values</h2>
+</div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-compiler.html b/Documentation/api/html/hkl-compiler.html
index 517dac8..4545081 100644
--- a/Documentation/api/html/hkl-compiler.html
+++ b/Documentation/api/html/hkl-compiler.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>compiler</title>
+<title>hkl Reference Manual: compiler</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-check-type.html" title="check_type">
 <link rel="next" href="hkl-container-of.html" title="container_of">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-check-type.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-container-of.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-compiler.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-compiler.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-compiler.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-check-type.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-container-of.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-compiler"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,37 +29,82 @@
 <h2><span class="refentrytitle"><a name="hkl-compiler.top_of_page"></a>compiler</span></h2>
 <p>compiler</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-compiler.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">#define             <a class="link" href="hkl-compiler.html#COLD:CAPS" title="COLD">COLD</a>
-#define             <a class="link" href="hkl-compiler.html#CONST-FUNCTION:CAPS" title="CONST_FUNCTION">CONST_FUNCTION</a>
-#define             <a class="link" href="hkl-compiler.html#IS-COMPILE-CONSTANT:CAPS" title="IS_COMPILE_CONSTANT()">IS_COMPILE_CONSTANT</a>                 (expr)
-#define             <a class="link" href="hkl-compiler.html#NEEDED:CAPS" title="NEEDED">NEEDED</a>
-#define             <a class="link" href="hkl-compiler.html#NORETURN:CAPS" title="NORETURN">NORETURN</a>
-#define             <a class="link" href="hkl-compiler.html#PRINTF-FMT:CAPS" title="PRINTF_FMT()">PRINTF_FMT</a>                          (nfmt,
-                                                         narg)
-#define             <a class="link" href="hkl-compiler.html#UNNEEDED:CAPS" title="UNNEEDED">UNNEEDED</a>
-#define             <a class="link" href="hkl-compiler.html#UNUSED:CAPS" title="UNUSED">UNUSED</a>
-#define             <a class="link" href="hkl-compiler.html#WARN-UNUSED-RESULT:CAPS" title="WARN_UNUSED_RESULT">WARN_UNUSED_RESULT</a>
-</pre>
+<div class="refsect1">
+<a name="hkl-compiler.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-compiler.html#PRINTF-FMT:CAPS" title="PRINTF_FMT()">PRINTF_FMT</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-compiler.html#IS-COMPILE-CONSTANT:CAPS" title="IS_COMPILE_CONSTANT()">IS_COMPILE_CONSTANT</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
-<a name="hkl-compiler.description"></a><h2>Description</h2>
+<a name="hkl-compiler.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="name">
+<col class="description">
+</colgroup>
+<tbody>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-compiler.html#COLD:CAPS" title="COLD">COLD</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-compiler.html#NORETURN:CAPS" title="NORETURN">NORETURN</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-compiler.html#CONST-FUNCTION:CAPS" title="CONST_FUNCTION">CONST_FUNCTION</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-compiler.html#PURE-FUNCTION:CAPS" title="PURE_FUNCTION">PURE_FUNCTION</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-compiler.html#UNNEEDED:CAPS" title="UNNEEDED">UNNEEDED</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-compiler.html#NEEDED:CAPS" title="NEEDED">NEEDED</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-compiler.html#UNUSED:CAPS" title="UNUSED">UNUSED</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-compiler.html#WARN-UNUSED-RESULT:CAPS" title="WARN_UNUSED_RESULT">WARN_UNUSED_RESULT</a></td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
-<a name="hkl-compiler.details"></a><h2>Details</h2>
-<div class="refsect2">
-<a name="COLD:CAPS"></a><h3>COLD</h3>
-<pre class="programlisting">#define COLD __attribute__((cold))
-</pre>
+<a name="hkl-compiler.description"></a><h2>Description</h2>
 </div>
-<hr>
+<div class="refsect1">
+<a name="hkl-compiler.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
-<a name="CONST-FUNCTION:CAPS"></a><h3>CONST_FUNCTION</h3>
-<pre class="programlisting">#define CONST_FUNCTION __attribute__((const))
-</pre>
+<a name="PRINTF-FMT:CAPS"></a><h3>PRINTF_FMT()</h3>
+<pre class="programlisting">#define             PRINTF_FMT(nfmt, narg)</pre>
 </div>
 <hr>
 <div class="refsect2">
@@ -71,10 +112,12 @@
 <pre class="programlisting">#define IS_COMPILE_CONSTANT(expr) __builtin_constant_p(expr)
 </pre>
 </div>
-<hr>
+</div>
+<div class="refsect1">
+<a name="hkl-compiler.other_details"></a><h2>Types and Values</h2>
 <div class="refsect2">
-<a name="NEEDED:CAPS"></a><h3>NEEDED</h3>
-<pre class="programlisting">#define NEEDED __attribute__((used))
+<a name="COLD:CAPS"></a><h3>COLD</h3>
+<pre class="programlisting">#define COLD __attribute__((__cold__))
 </pre>
 </div>
 <hr>
@@ -84,31 +127,44 @@
 </div>
 <hr>
 <div class="refsect2">
-<a name="PRINTF-FMT:CAPS"></a><h3>PRINTF_FMT()</h3>
-<pre class="programlisting">#define             PRINTF_FMT(nfmt, narg)</pre>
+<a name="CONST-FUNCTION:CAPS"></a><h3>CONST_FUNCTION</h3>
+<pre class="programlisting">#define CONST_FUNCTION __attribute__((__const__))
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="PURE-FUNCTION:CAPS"></a><h3>PURE_FUNCTION</h3>
+<pre class="programlisting">#define PURE_FUNCTION __attribute__((__pure__))
+</pre>
 </div>
 <hr>
 <div class="refsect2">
 <a name="UNNEEDED:CAPS"></a><h3>UNNEEDED</h3>
-<pre class="programlisting">#define UNNEEDED __attribute__((unused))
+<pre class="programlisting">#define UNNEEDED __attribute__((__unused__))
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="NEEDED:CAPS"></a><h3>NEEDED</h3>
+<pre class="programlisting">#define NEEDED __attribute__((__used__))
 </pre>
 </div>
 <hr>
 <div class="refsect2">
 <a name="UNUSED:CAPS"></a><h3>UNUSED</h3>
-<pre class="programlisting">#define UNUSED __attribute__((unused))
+<pre class="programlisting">#define UNUSED __attribute__((__unused__))
 </pre>
 </div>
 <hr>
 <div class="refsect2">
 <a name="WARN-UNUSED-RESULT:CAPS"></a><h3>WARN_UNUSED_RESULT</h3>
-<pre class="programlisting">#define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
+<pre class="programlisting">#define WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))
 </pre>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-container-of.html b/Documentation/api/html/hkl-container-of.html
index a556114..513c4af 100644
--- a/Documentation/api/html/hkl-container-of.html
+++ b/Documentation/api/html/hkl-container-of.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>container_of</title>
+<title>hkl Reference Manual: container_of</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-compiler.html" title="compiler">
 <link rel="next" href="hkl-darray.html" title="darray">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-compiler.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-darray.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-container-of.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-container-of.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-container-of.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-compiler.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-darray.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-container-of"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,40 +29,61 @@
 <h2><span class="refentrytitle"><a name="hkl-container-of.top_of_page"></a>container_of</span></h2>
 <p>container_of</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-container-of.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">#define             <a class="link" href="hkl-container-of.html#container-of" title="container_of()">container_of</a>                        (member_ptr,
-                                                         containing_type,
-                                                         member)
-#define             <a class="link" href="hkl-container-of.html#container-of-var" title="container_of_var()">container_of_var</a>                    (member_ptr,
-                                                         container_var,
-                                                         member)
-#define             <a class="link" href="hkl-container-of.html#container-off" title="container_off()">container_off</a>                       (containing_type,
-                                                         member)
-#define             <a class="link" href="hkl-container-of.html#container-off-var" title="container_off_var()">container_off_var</a>                   (var,
-                                                         member)
-</pre>
+<div class="refsect1">
+<a name="hkl-container-of.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-container-of.html#container-of" title="container_of()">container_of</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-container-of.html#container-off" title="container_off()">container_off</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-container-of.html#container-of-var" title="container_of_var()">container_of_var</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-container-of.html#container-off-var" title="container_off_var()">container_off_var</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-container-of.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-container-of.details"></a><h2>Details</h2>
+<a name="hkl-container-of.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
 <a name="container-of"></a><h3>container_of()</h3>
 <pre class="programlisting">#define             container_of(member_ptr, containing_type, member)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="container-of-var"></a><h3>container_of_var()</h3>
-<pre class="programlisting">#define             container_of_var(member_ptr, container_var, member)</pre>
+<a name="container-off"></a><h3>container_off()</h3>
+<pre class="programlisting">#define             container_off(containing_type, member)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="container-off"></a><h3>container_off()</h3>
-<pre class="programlisting">#define             container_off(containing_type, member)</pre>
+<a name="container-of-var"></a><h3>container_of_var()</h3>
+<pre class="programlisting">#define             container_of_var(member_ptr, container_var, member)</pre>
 </div>
 <hr>
 <div class="refsect2">
@@ -74,9 +91,12 @@
 <pre class="programlisting">#define             container_off_var(var, member)</pre>
 </div>
 </div>
+<div class="refsect1">
+<a name="hkl-container-of.other_details"></a><h2>Types and Values</h2>
+</div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-darray.html b/Documentation/api/html/hkl-darray.html
index 5169211..c6a05d9 100644
--- a/Documentation/api/html/hkl-darray.html
+++ b/Documentation/api/html/hkl-darray.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>darray</title>
+<title>hkl Reference Manual: darray</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-container-of.html" title="container_of">
-<link rel="next" href="hkl-hkl-axis-private.html" title="hkl-axis-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<link rel="next" href="hkl-hkl.html" title="hkl">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-container-of.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-axis-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-darray.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-darray.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-darray.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-container-of.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-darray"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,95 +29,285 @@
 <h2><span class="refentrytitle"><a name="hkl-darray.top_of_page"></a>darray</span></h2>
 <p>darray</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-darray.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">#define             <a class="link" href="hkl-darray.html#darray" title="darray()">darray</a>                              (type)
-#define             <a class="link" href="hkl-darray.html#darray-alloc" title="darray_alloc()">darray_alloc</a>                        (arr)
-#define             <a class="link" href="hkl-darray.html#darray-append" title="darray_append()">darray_append</a>                       (arr,
-                                                         ...)
-#define             <a class="link" href="hkl-darray.html#darray-append-items" title="darray_append_items()">darray_append_items</a>                 (arr,
-                                                         items,
-                                                         count)
-#define             <a class="link" href="hkl-darray.html#darray-append-items-nullterminate" title="darray_append_items_nullterminate()">darray_append_items_nullterminate</a>   (arr,
-                                                         items,
-                                                         count)
-#define             <a class="link" href="hkl-darray.html#darray-append-lit" title="darray_append_lit()">darray_append_lit</a>                   (arr,
-                                                         stringLiteral)
-#define             <a class="link" href="hkl-darray.html#darray-append-string" title="darray_append_string()">darray_append_string</a>                (arr,
-                                                         str)
-#define             <a class="link" href="hkl-darray.html#darray-appends" title="darray_appends()">darray_appends</a>                      (arr,
-                                                         ...)
-#define             <a class="link" href="hkl-darray.html#darray-appends-t" title="darray_appends_t()">darray_appends_t</a>                    (arr,
-                                                         type,
-                                                         ...)
-typedef             <a class="link" href="hkl-darray.html#darray-char" title="darray_char">darray_char</a>;
-#define             <a class="link" href="hkl-darray.html#darray-empty" title="darray_empty()">darray_empty</a>                        (arr)
-#define             <a class="link" href="hkl-darray.html#darray-foreach" title="darray_foreach()">darray_foreach</a>                      (i,
-                                                         arr)
-#define             <a class="link" href="hkl-darray.html#darray-foreach-reverse" title="darray_foreach_reverse()">darray_foreach_reverse</a>              (i,
-                                                         arr)
-#define             <a class="link" href="hkl-darray.html#darray-free" title="darray_free()">darray_free</a>                         (arr)
-#define             <a class="link" href="hkl-darray.html#darray-from-c" title="darray_from_c()">darray_from_c</a>                       (arr,
-                                                         c_array)
-#define             <a class="link" href="hkl-darray.html#darray-from-items" title="darray_from_items()">darray_from_items</a>                   (arr,
-                                                         items,
-                                                         count)
-#define             <a class="link" href="hkl-darray.html#darray-from-lit" title="darray_from_lit()">darray_from_lit</a>                     (arr,
-                                                         stringLiteral)
-#define             <a class="link" href="hkl-darray.html#darray-from-string" title="darray_from_string()">darray_from_string</a>                  (arr,
-                                                         str)
-#define             <a class="link" href="hkl-darray.html#darray-growalloc" title="darray_growalloc()">darray_growalloc</a>                    (arr,
-                                                         need)
-#define             <a class="link" href="hkl-darray.html#darray-init" title="darray_init()">darray_init</a>                         (arr)
-typedef             <a class="link" href="hkl-darray.html#darray-int" title="darray_int">darray_int</a>;
-typedef             <a class="link" href="hkl-darray.html#darray-item" title="darray_item">darray_item</a>;
-typedef             <a class="link" href="hkl-darray.html#darray-long" title="darray_long">darray_long</a>;
-#define             <a class="link" href="hkl-darray.html#darray-make-room" title="darray_make_room()">darray_make_room</a>                    (arr,
-                                                         room)
-#define             <a class="link" href="hkl-darray.html#darray-new" title="darray_new">darray_new</a>
-#define             <a class="link" href="hkl-darray.html#darray-pop" title="darray_pop()">darray_pop</a>                          (arr)
-#define             <a class="link" href="hkl-darray.html#darray-pop-check" title="darray_pop_check()">darray_pop_check</a>                    (arr)
-#define             <a class="link" href="hkl-darray.html#darray-prepend" title="darray_prepend()">darray_prepend</a>                      (arr,
-                                                         ...)
-#define             <a class="link" href="hkl-darray.html#darray-prepend-items" title="darray_prepend_items()">darray_prepend_items</a>                (arr,
-                                                         items,
-                                                         count)
-#define             <a class="link" href="hkl-darray.html#darray-prepend-items-nullterminate" title="darray_prepend_items_nullterminate()">darray_prepend_items_nullterminate</a>  (arr,
-                                                         items,
-                                                         count)
-#define             <a class="link" href="hkl-darray.html#darray-prepend-lit" title="darray_prepend_lit()">darray_prepend_lit</a>                  (arr,
-                                                         stringLiteral)
-#define             <a class="link" href="hkl-darray.html#darray-prepend-string" title="darray_prepend_string()">darray_prepend_string</a>               (arr,
-                                                         str)
-#define             <a class="link" href="hkl-darray.html#darray-prepends" title="darray_prepends()">darray_prepends</a>                     (arr,
-                                                         ...)
-#define             <a class="link" href="hkl-darray.html#darray-prepends-t" title="darray_prepends_t()">darray_prepends_t</a>                   (arr,
-                                                         type,
-                                                         ...)
-#define             <a class="link" href="hkl-darray.html#darray-push" title="darray_push()">darray_push</a>                         (arr,
-                                                         ...)
-#define             <a class="link" href="hkl-darray.html#darray-realloc" title="darray_realloc()">darray_realloc</a>                      (arr,
-                                                         newAlloc)
-#define             <a class="link" href="hkl-darray.html#darray-resize" title="darray_resize()">darray_resize</a>                       (arr,
-                                                         newSize)
-#define             <a class="link" href="hkl-darray.html#darray-resize0" title="darray_resize0()">darray_resize0</a>                      (arr,
-                                                         newSize)
-typedef             <a class="link" href="hkl-darray.html#darray-schar" title="darray_schar">darray_schar</a>;
-typedef             <a class="link" href="hkl-darray.html#darray-short" title="darray_short">darray_short</a>;
-#define             <a class="link" href="hkl-darray.html#darray-size" title="darray_size()">darray_size</a>                         (arr)
-typedef             <a class="link" href="hkl-darray.html#darray-uchar" title="darray_uchar">darray_uchar</a>;
-typedef             <a class="link" href="hkl-darray.html#darray-uint" title="darray_uint">darray_uint</a>;
-typedef             <a class="link" href="hkl-darray.html#darray-ulong" title="darray_ulong">darray_ulong</a>;
-typedef             <a class="link" href="hkl-darray.html#darray-ushort" title="darray_ushort">darray_ushort</a>;
-</pre>
+<div class="refsect1">
+<a name="hkl-darray.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray" title="darray()">darray</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-darray.html#darray-new" title="darray_new">darray_new</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-init" title="darray_init()">darray_init</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-free" title="darray_free()">darray_free</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-item" title="darray_item()">darray_item</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-size" title="darray_size()">darray_size</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-alloc" title="darray_alloc()">darray_alloc</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-empty" title="darray_empty()">darray_empty</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-append" title="darray_append()">darray_append</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-prepend" title="darray_prepend()">darray_prepend</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-push" title="darray_push()">darray_push</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-append-items" title="darray_append_items()">darray_append_items</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-prepend-items" title="darray_prepend_items()">darray_prepend_items</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-append-items-nullterminate" title="darray_append_items_nullterminate()">darray_append_items_nullterminate</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-prepend-items-nullterminate" title="darray_prepend_items_nullterminate()">darray_prepend_items_nullterminate</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-appends" title="darray_appends()">darray_appends</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-prepends" title="darray_prepends()">darray_prepends</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-appends-t" title="darray_appends_t()">darray_appends_t</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-prepends-t" title="darray_prepends_t()">darray_prepends_t</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-pop" title="darray_pop()">darray_pop</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-pop-check" title="darray_pop_check()">darray_pop_check</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-from-items" title="darray_from_items()">darray_from_items</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-from-c" title="darray_from_c()">darray_from_c</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-append-string" title="darray_append_string()">darray_append_string</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-append-lit" title="darray_append_lit()">darray_append_lit</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-prepend-string" title="darray_prepend_string()">darray_prepend_string</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-prepend-lit" title="darray_prepend_lit()">darray_prepend_lit</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-from-string" title="darray_from_string()">darray_from_string</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-from-lit" title="darray_from_lit()">darray_from_lit</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-resize" title="darray_resize()">darray_resize</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-resize0" title="darray_resize0()">darray_resize0</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-realloc" title="darray_realloc()">darray_realloc</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-growalloc" title="darray_growalloc()">darray_growalloc</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-make-room" title="darray_make_room()">darray_make_room</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-foreach" title="darray_foreach()">darray_foreach</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-darray.html#darray-foreach-reverse" title="darray_foreach_reverse()">darray_foreach_reverse</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-darray.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="name">
+<col class="description">
+</colgroup>
+<tbody>
+<tr>
+<td class="typedef_keyword">typedef</td>
+<td class="function_name"><a class="link" href="hkl-darray.html#darray-char" title="darray_char">darray_char</a></td>
+</tr>
+<tr>
+<td class="typedef_keyword">typedef</td>
+<td class="function_name"><a class="link" href="hkl-darray.html#darray-schar" title="darray_schar">darray_schar</a></td>
+</tr>
+<tr>
+<td class="typedef_keyword">typedef</td>
+<td class="function_name"><a class="link" href="hkl-darray.html#darray-uchar" title="darray_uchar">darray_uchar</a></td>
+</tr>
+<tr>
+<td class="typedef_keyword">typedef</td>
+<td class="function_name"><a class="link" href="hkl-darray.html#darray-short" title="darray_short">darray_short</a></td>
+</tr>
+<tr>
+<td class="typedef_keyword">typedef</td>
+<td class="function_name"><a class="link" href="hkl-darray.html#darray-int" title="darray_int">darray_int</a></td>
+</tr>
+<tr>
+<td class="typedef_keyword">typedef</td>
+<td class="function_name"><a class="link" href="hkl-darray.html#darray-long" title="darray_long">darray_long</a></td>
+</tr>
+<tr>
+<td class="typedef_keyword">typedef</td>
+<td class="function_name"><a class="link" href="hkl-darray.html#darray-ushort" title="darray_ushort">darray_ushort</a></td>
+</tr>
+<tr>
+<td class="typedef_keyword">typedef</td>
+<td class="function_name"><a class="link" href="hkl-darray.html#darray-uint" title="darray_uint">darray_uint</a></td>
+</tr>
+<tr>
+<td class="typedef_keyword">typedef</td>
+<td class="function_name"><a class="link" href="hkl-darray.html#darray-ulong" title="darray_ulong">darray_ulong</a></td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-darray.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-darray.details"></a><h2>Details</h2>
+<a name="hkl-darray.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
 <a name="darray"></a><h3>darray()</h3>
 <pre class="programlisting">#define darray(type) struct {type *item; size_t size; size_t alloc;}
@@ -129,215 +315,217 @@ typedef             <a class="link" href="hkl-darray.html#darray-ushort" title="
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-alloc"></a><h3>darray_alloc()</h3>
-<pre class="programlisting">#define darray_alloc(arr)   ((arr).alloc)
+<a name="darray-new"></a><h3>darray_new</h3>
+<pre class="programlisting">#define darray_new() {0,0,0}
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-append"></a><h3>darray_append()</h3>
-<pre class="programlisting">#define             darray_append(arr, ...)</pre>
+<a name="darray-init"></a><h3>darray_init()</h3>
+<pre class="programlisting">#define darray_init(arr) do {(arr).item=0; (arr).size=0; (arr).alloc=0;} while(0)
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-append-items"></a><h3>darray_append_items()</h3>
-<pre class="programlisting">#define             darray_append_items(arr, items, count)</pre>
+<a name="darray-free"></a><h3>darray_free()</h3>
+<pre class="programlisting">#define darray_free(arr) do {free((arr).item);} while(0)
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-append-items-nullterminate"></a><h3>darray_append_items_nullterminate()</h3>
-<pre class="programlisting">#define             darray_append_items_nullterminate(arr, items, count)</pre>
+<a name="darray-item"></a><h3>darray_item()</h3>
+<pre class="programlisting">#define darray_item(arr, i) ((arr).item[i])
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-append-lit"></a><h3>darray_append_lit()</h3>
-<pre class="programlisting">#define darray_append_lit(arr, stringLiteral) do {darray_append_items(arr, stringLiteral, sizeof(stringLiteral)); (arr).size--;} while(0)
+<a name="darray-size"></a><h3>darray_size()</h3>
+<pre class="programlisting">#define darray_size(arr)    ((arr).size)
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-append-string"></a><h3>darray_append_string()</h3>
-<pre class="programlisting">#define darray_append_string(arr, str) do {const char *__str = (str); darray_append_items(arr, __str, strlen(__str)+1); (arr).size--;} while(0)
+<a name="darray-alloc"></a><h3>darray_alloc()</h3>
+<pre class="programlisting">#define darray_alloc(arr)   ((arr).alloc)
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-appends"></a><h3>darray_appends()</h3>
-<pre class="programlisting">#define darray_appends(arr, ...) darray_appends_t(arr, typeof((*(arr).item)), __VA_ARGS__)
+<a name="darray-empty"></a><h3>darray_empty()</h3>
+<pre class="programlisting">#define darray_empty(arr)   ((arr).size == 0)
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-appends-t"></a><h3>darray_appends_t()</h3>
-<pre class="programlisting">#define             darray_appends_t(arr, type, ...)</pre>
+<a name="darray-append"></a><h3>darray_append()</h3>
+<pre class="programlisting">#define             darray_append(arr, ...)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-char"></a><h3>darray_char</h3>
-<pre class="programlisting">typedef darray(char)           darray_char;
-</pre>
+<a name="darray-prepend"></a><h3>darray_prepend()</h3>
+<pre class="programlisting">#define             darray_prepend(arr, ...)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-empty"></a><h3>darray_empty()</h3>
-<pre class="programlisting">#define darray_empty(arr)   ((arr).size == 0)
+<a name="darray-push"></a><h3>darray_push()</h3>
+<pre class="programlisting">#define darray_push(arr, ...) darray_append(arr, __VA_ARGS__)
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-foreach"></a><h3>darray_foreach()</h3>
-<pre class="programlisting">#define             darray_foreach(i, arr)</pre>
+<a name="darray-append-items"></a><h3>darray_append_items()</h3>
+<pre class="programlisting">#define             darray_append_items(arr, items, count)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-foreach-reverse"></a><h3>darray_foreach_reverse()</h3>
-<pre class="programlisting">#define             darray_foreach_reverse(i, arr)</pre>
+<a name="darray-prepend-items"></a><h3>darray_prepend_items()</h3>
+<pre class="programlisting">#define             darray_prepend_items(arr, items, count)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-free"></a><h3>darray_free()</h3>
-<pre class="programlisting">#define darray_free(arr) do {free((arr).item);} while(0)
-</pre>
+<a name="darray-append-items-nullterminate"></a><h3>darray_append_items_nullterminate()</h3>
+<pre class="programlisting">#define             darray_append_items_nullterminate(arr, items, count)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-from-c"></a><h3>darray_from_c()</h3>
-<pre class="programlisting">#define darray_from_c(arr, c_array) darray_from_items(arr, c_array, sizeof(c_array)/sizeof(*(c_array)))
-</pre>
+<a name="darray-prepend-items-nullterminate"></a><h3>darray_prepend_items_nullterminate()</h3>
+<pre class="programlisting">#define             darray_prepend_items_nullterminate(arr, items, count)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-from-items"></a><h3>darray_from_items()</h3>
-<pre class="programlisting">#define darray_from_items(arr, items, count) do {size_t __count = (count); darray_resize(arr, __count); memcpy((arr).item, items, __count*sizeof(*(arr).item));} while(0)
+<a name="darray-appends"></a><h3>darray_appends()</h3>
+<pre class="programlisting">#define darray_appends(arr, ...) darray_appends_t(arr, typeof((*(arr).item)), __VA_ARGS__)
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-from-lit"></a><h3>darray_from_lit()</h3>
-<pre class="programlisting">#define darray_from_lit(arr, stringLiteral) do {darray_from_items(arr, stringLiteral, sizeof(stringLiteral)); (arr).size--;} while(0)
+<a name="darray-prepends"></a><h3>darray_prepends()</h3>
+<pre class="programlisting">#define darray_prepends(arr, ...) darray_prepends_t(arr, typeof((*(arr).item)), __VA_ARGS__)
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-from-string"></a><h3>darray_from_string()</h3>
-<pre class="programlisting">#define darray_from_string(arr, str) do {const char *__str = (str); darray_from_items(arr, __str, strlen(__str)+1); (arr).size--;} while(0)
-</pre>
+<a name="darray-appends-t"></a><h3>darray_appends_t()</h3>
+<pre class="programlisting">#define             darray_appends_t(arr, type, ...)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-growalloc"></a><h3>darray_growalloc()</h3>
-<pre class="programlisting">#define             darray_growalloc(arr, need)</pre>
+<a name="darray-prepends-t"></a><h3>darray_prepends_t()</h3>
+<pre class="programlisting">#define             darray_prepends_t(arr, type, ...)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-init"></a><h3>darray_init()</h3>
-<pre class="programlisting">#define darray_init(arr) do {(arr).item=0; (arr).size=0; (arr).alloc=0;} while(0)
+<a name="darray-pop"></a><h3>darray_pop()</h3>
+<pre class="programlisting">#define darray_pop(arr) ((arr).item[--(arr).size])
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-int"></a><h3>darray_int</h3>
-<pre class="programlisting">typedef darray(int)            darray_int;
+<a name="darray-pop-check"></a><h3>darray_pop_check()</h3>
+<pre class="programlisting">#define darray_pop_check(arr) ((arr).size ? darray_pop(arr) : NULL)
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-item"></a><h3>darray_item</h3>
-<pre class="programlisting">typedef darray(HklGeometryListItem *) darray_item;
+<a name="darray-from-items"></a><h3>darray_from_items()</h3>
+<pre class="programlisting">#define darray_from_items(arr, items, count) do {size_t __count = (count); darray_resize(arr, __count); memcpy((arr).item, items, __count*sizeof(*(arr).item));} while(0)
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-long"></a><h3>darray_long</h3>
-<pre class="programlisting">typedef darray(long)           darray_long;
+<a name="darray-from-c"></a><h3>darray_from_c()</h3>
+<pre class="programlisting">#define darray_from_c(arr, c_array) darray_from_items(arr, c_array, sizeof(c_array)/sizeof(*(c_array)))
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-make-room"></a><h3>darray_make_room()</h3>
-<pre class="programlisting">#define darray_make_room(arr, room) ({size_t newAlloc = (arr).size+(room); if ((arr).alloc<newAlloc) darray_realloc(arr, newAlloc); (arr).item+(arr).size; })
+<a name="darray-append-string"></a><h3>darray_append_string()</h3>
+<pre class="programlisting">#define darray_append_string(arr, str) do {const char *__str = (str); darray_append_items(arr, __str, strlen(__str)+1); (arr).size--;} while(0)
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-new"></a><h3>darray_new</h3>
-<pre class="programlisting">#define darray_new() {0,0,0}
+<a name="darray-append-lit"></a><h3>darray_append_lit()</h3>
+<pre class="programlisting">#define darray_append_lit(arr, stringLiteral) do {darray_append_items(arr, stringLiteral, sizeof(stringLiteral)); (arr).size--;} while(0)
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-pop"></a><h3>darray_pop()</h3>
-<pre class="programlisting">#define darray_pop(arr) ((arr).item[--(arr).size])
-</pre>
+<a name="darray-prepend-string"></a><h3>darray_prepend_string()</h3>
+<pre class="programlisting">#define             darray_prepend_string(arr, str)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-pop-check"></a><h3>darray_pop_check()</h3>
-<pre class="programlisting">#define darray_pop_check(arr) ((arr).size ? darray_pop(arr) : NULL)
-</pre>
+<a name="darray-prepend-lit"></a><h3>darray_prepend_lit()</h3>
+<pre class="programlisting">#define             darray_prepend_lit(arr, stringLiteral)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-prepend"></a><h3>darray_prepend()</h3>
-<pre class="programlisting">#define             darray_prepend(arr, ...)</pre>
+<a name="darray-from-string"></a><h3>darray_from_string()</h3>
+<pre class="programlisting">#define darray_from_string(arr, str) do {const char *__str = (str); darray_from_items(arr, __str, strlen(__str)+1); (arr).size--;} while(0)
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-prepend-items"></a><h3>darray_prepend_items()</h3>
-<pre class="programlisting">#define             darray_prepend_items(arr, items, count)</pre>
+<a name="darray-from-lit"></a><h3>darray_from_lit()</h3>
+<pre class="programlisting">#define darray_from_lit(arr, stringLiteral) do {darray_from_items(arr, stringLiteral, sizeof(stringLiteral)); (arr).size--;} while(0)
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-prepend-items-nullterminate"></a><h3>darray_prepend_items_nullterminate()</h3>
-<pre class="programlisting">#define             darray_prepend_items_nullterminate(arr, items, count)</pre>
+<a name="darray-resize"></a><h3>darray_resize()</h3>
+<pre class="programlisting">#define darray_resize(arr, newSize) darray_growalloc(arr, (arr).size = (newSize))
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-prepend-lit"></a><h3>darray_prepend_lit()</h3>
-<pre class="programlisting">#define             darray_prepend_lit(arr, stringLiteral)</pre>
+<a name="darray-resize0"></a><h3>darray_resize0()</h3>
+<pre class="programlisting">#define             darray_resize0(arr, newSize)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-prepend-string"></a><h3>darray_prepend_string()</h3>
-<pre class="programlisting">#define             darray_prepend_string(arr, str)</pre>
+<a name="darray-realloc"></a><h3>darray_realloc()</h3>
+<pre class="programlisting">#define             darray_realloc(arr, newAlloc)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-prepends"></a><h3>darray_prepends()</h3>
-<pre class="programlisting">#define darray_prepends(arr, ...) darray_prepends_t(arr, typeof((*(arr).item)), __VA_ARGS__)
-</pre>
+<a name="darray-growalloc"></a><h3>darray_growalloc()</h3>
+<pre class="programlisting">#define             darray_growalloc(arr, need)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-prepends-t"></a><h3>darray_prepends_t()</h3>
-<pre class="programlisting">#define             darray_prepends_t(arr, type, ...)</pre>
+<a name="darray-make-room"></a><h3>darray_make_room()</h3>
+<pre class="programlisting">#define darray_make_room(arr, room) ({size_t newAlloc = (arr).size+(room); if ((arr).alloc<newAlloc) darray_realloc(arr, newAlloc); (arr).item+(arr).size; })
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-push"></a><h3>darray_push()</h3>
-<pre class="programlisting">#define darray_push(arr, ...) darray_append(arr, __VA_ARGS__)
-</pre>
+<a name="darray-foreach"></a><h3>darray_foreach()</h3>
+<pre class="programlisting">#define             darray_foreach(i, arr)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-realloc"></a><h3>darray_realloc()</h3>
-<pre class="programlisting">#define             darray_realloc(arr, newAlloc)</pre>
+<a name="darray-foreach-reverse"></a><h3>darray_foreach_reverse()</h3>
+<pre class="programlisting">#define             darray_foreach_reverse(i, arr)</pre>
 </div>
-<hr>
+</div>
+<div class="refsect1">
+<a name="hkl-darray.other_details"></a><h2>Types and Values</h2>
 <div class="refsect2">
-<a name="darray-resize"></a><h3>darray_resize()</h3>
-<pre class="programlisting">#define darray_resize(arr, newSize) darray_growalloc(arr, (arr).size = (newSize))
+<a name="darray-char"></a><h3>darray_char</h3>
+<pre class="programlisting">typedef darray(char)           darray_char;
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-resize0"></a><h3>darray_resize0()</h3>
-<pre class="programlisting">#define             darray_resize0(arr, newSize)</pre>
+<a name="darray-schar"></a><h3>darray_schar</h3>
+<pre class="programlisting">typedef darray(signed char)    darray_schar;
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-schar"></a><h3>darray_schar</h3>
-<pre class="programlisting">typedef darray(signed char)    darray_schar;
+<a name="darray-uchar"></a><h3>darray_uchar</h3>
+<pre class="programlisting">typedef darray(unsigned char)  darray_uchar;
 </pre>
 </div>
 <hr>
@@ -348,38 +536,38 @@ typedef             <a class="link" href="hkl-darray.html#darray-ushort" title="
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-size"></a><h3>darray_size()</h3>
-<pre class="programlisting">#define darray_size(arr)    ((arr).size)
+<a name="darray-int"></a><h3>darray_int</h3>
+<pre class="programlisting">typedef darray(int)            darray_int;
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-uchar"></a><h3>darray_uchar</h3>
-<pre class="programlisting">typedef darray(unsigned char)  darray_uchar;
+<a name="darray-long"></a><h3>darray_long</h3>
+<pre class="programlisting">typedef darray(long)           darray_long;
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-uint"></a><h3>darray_uint</h3>
-<pre class="programlisting">typedef darray(unsigned int)   darray_uint;
+<a name="darray-ushort"></a><h3>darray_ushort</h3>
+<pre class="programlisting">typedef darray(unsigned short) darray_ushort;
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-ulong"></a><h3>darray_ulong</h3>
-<pre class="programlisting">typedef darray(unsigned long)  darray_ulong;
+<a name="darray-uint"></a><h3>darray_uint</h3>
+<pre class="programlisting">typedef darray(unsigned int)   darray_uint;
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-ushort"></a><h3>darray_ushort</h3>
-<pre class="programlisting">typedef darray(unsigned short) darray_ushort;
+<a name="darray-ulong"></a><h3>darray_ulong</h3>
+<pre class="programlisting">typedef darray(unsigned long)  darray_ulong;
 </pre>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-axis-private.html b/Documentation/api/html/hkl-hkl-axis-private.html
index 6212041..e9a68a4 100644
--- a/Documentation/api/html/hkl-hkl-axis-private.html
+++ b/Documentation/api/html/hkl-hkl-axis-private.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-axis-private</title>
+<title>hkl Reference Manual: hkl-axis-private</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
-<link rel="prev" href="hkl-darray.html" title="darray">
+<link rel="prev" href="hkl-hkl.html" title="hkl">
 <link rel="next" href="hkl-hkl-detector-private.html" title="hkl-detector-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-darray.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-detector-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-axis-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-axis-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-axis-private.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-detector-private.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-hkl-axis-private"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,20 +29,52 @@
 <h2><span class="refentrytitle"><a name="hkl-hkl-axis-private.top_of_page"></a>hkl-axis-private</span></h2>
 <p>hkl-axis-private</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-axis-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">struct              <a class="link" href="hkl-hkl-axis-private.html#HklAxis" title="struct HklAxis">HklAxis</a>;
-<a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *      <a class="link" href="hkl-hkl-axis-private.html#hkl-parameter-new-axis" title="hkl_parameter_new_axis ()">hkl_parameter_new_axis</a>              (<em class="parameter"><code><span class="type">char</span> const *name</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> const *axis_v</code></em>);
-</pre>
+<div class="refsect1">
+<a name="hkl-hkl-axis-private.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody><tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-axis-private.html#hkl-parameter-new-axis" title="hkl_parameter_new_axis ()">hkl_parameter_new_axis</a> <span class="c_punctuation">()</span>
+</td>
+</tr></tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-axis-private.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="name">
+<col class="description">
+</colgroup>
+<tbody><tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl-axis-private.html#HklAxis" title="struct HklAxis">HklAxis</a></td>
+</tr></tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-hkl-axis-private.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-hkl-axis-private.details"></a><h2>Details</h2>
+<a name="hkl-hkl-axis-private.functions_details"></a><h2>Functions</h2>
+<div class="refsect2">
+<a name="hkl-parameter-new-axis"></a><h3>hkl_parameter_new_axis ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *
+hkl_parameter_new_axis (<em class="parameter"><code><span class="type">char</span> const *name</code></em>,
+                        <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> const *axis_v</code></em>);</pre>
+</div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-axis-private.other_details"></a><h2>Types and Values</h2>
 <div class="refsect2">
 <a name="HklAxis"></a><h3>struct HklAxis</h3>
 <pre class="programlisting">struct HklAxis {
@@ -56,16 +84,10 @@
 };
 </pre>
 </div>
-<hr>
-<div class="refsect2">
-<a name="hkl-parameter-new-axis"></a><h3>hkl_parameter_new_axis ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *      hkl_parameter_new_axis              (<em class="parameter"><code><span class="type">char</span> const *name</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> const *axis_v</code></em>);</pre>
-</div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-detector-private.html b/Documentation/api/html/hkl-hkl-detector-private.html
index cdd8518..0b4a94b 100644
--- a/Documentation/api/html/hkl-hkl-detector-private.html
+++ b/Documentation/api/html/hkl-hkl-detector-private.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-detector-private</title>
+<title>hkl Reference Manual: hkl-detector-private</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-axis-private.html" title="hkl-axis-private">
-<link rel="next" href="hkl-hkl-error-private.html" title="hkl-error-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<link rel="next" href="hkl-hkl-factory-private.html" title="hkl-factory-private">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-axis-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-error-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-detector-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-detector-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-detector-private.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-axis-private.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-factory-private.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-hkl-detector-private"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,100 +29,128 @@
 <h2><span class="refentrytitle"><a name="hkl-hkl-detector-private.top_of_page"></a>hkl-detector-private</span></h2>
 <p>hkl-detector-private</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-detector-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-detector-private.html#HklDetector" title="HklDetector">HklDetector</a>;
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-detector-private.html#hkl-detector-attach-to-holder" title="hkl_detector_attach_to_holder ()">hkl_detector_attach_to_holder</a>       (<em class="parameter"><code><a class="link" href="hkl-hkl-detector-private.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-detector-private.html#hkl-detector-compute-kf" title="hkl_detector_compute_kf ()">hkl_detector_compute_kf</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-detector-private.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *g</code></em>);
-<a class="link" href="hkl-hkl-detector-private.html#HklDetector" title="HklDetector"><span class="returnvalue">HklDetector</span></a> *       <a class="link" href="hkl-hkl-detector-private.html#hkl-detector-new" title="hkl_detector_new ()">hkl_detector_new</a>                    (<em class="parameter"><code><span class="type">void</span></code></em>);
-<a class="link" href="hkl-hkl-detector-private.html#HklDetector" title="HklDetector"><span class="returnvalue">HklDetector</span></a> *       <a class="link" href="hkl-hkl-detector-private.html#hkl-detector-new-copy" title="hkl_detector_new_copy ()">hkl_detector_new_copy</a>               ();
-</pre>
+<div class="refsect1">
+<a name="hkl-hkl-detector-private.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklDetector" title="HklDetector"><span class="returnvalue">HklDetector</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-detector-private.html#hkl-detector-new" title="hkl_detector_new ()">hkl_detector_new</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-detector-private.html#hkl-detector-attach-to-holder" title="hkl_detector_attach_to_holder ()">hkl_detector_attach_to_holder</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-detector-private.html#hkl-detector-compute-kf" title="hkl_detector_compute_kf ()">hkl_detector_compute_kf</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-detector-private.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="name">
+<col class="description">
+</colgroup>
+<tbody><tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklDetector" title="HklDetector">HklDetector</a></td>
+</tr></tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-hkl-detector-private.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-hkl-detector-private.details"></a><h2>Details</h2>
+<a name="hkl-hkl-detector-private.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
-<a name="HklDetector"></a><h3>HklDetector</h3>
-<pre class="programlisting">typedef struct {
-	size_t idx;
-	HklHolder const *holder;
-} HklDetector;
-</pre>
+<a name="hkl-detector-new"></a><h3>hkl_detector_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklDetector" title="HklDetector"><span class="returnvalue">HklDetector</span></a> *
+hkl_detector_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
+<p>Create a new default <a class="link" href="hkl-hkl.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a></p>
+<div class="refsect3">
+<a name="id-1.2.11.6.2.5"></a><h4>Returns</h4>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-detector-attach-to-holder"></a><h3>hkl_detector_attach_to_holder ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_detector_attach_to_holder       (<em class="parameter"><code><a class="link" href="hkl-hkl-detector-private.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *self</code></em>);</pre>
-<p>
-attach the <a class="link" href="hkl-hkl-detector-private.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> to an <a class="link" href="hkl-hkl-geometry-private.html#HklHolder" title="struct HklHolder"><span class="type">HklHolder</span></a>
-</p>
+<a name="hkl-detector-attach-to-holder"></a><h3>hkl_detector_attach_to_holder ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_detector_attach_to_holder (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *self</code></em>);</pre>
+<p>attach the <a class="link" href="hkl-hkl.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> to an <a class="link" href="hkl-hkl-geometry-private.html#HklHolder" title="struct HklHolder"><span class="type">HklHolder</span></a></p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-detector-compute-kf"></a><h3>hkl_detector_compute_kf ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_detector_compute_kf             (<em class="parameter"><code><a class="link" href="hkl-hkl-detector-private.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *g</code></em>);</pre>
-<p>
-Compute the kf vector of the <a class="link" href="hkl-hkl-detector-private.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a>
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-detector-compute-kf"></a><h3>hkl_detector_compute_kf ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_detector_compute_kf (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> const *self</code></em>,
+                         <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *g</code></em>);</pre>
+<p>Compute the kf vector of the <a class="link" href="hkl-hkl.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a></p>
+<div class="refsect3">
+<a name="id-1.2.11.6.4.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>g</code></em> :</span></p></td>
-<td>the diffractometer <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> use to compute kf. <span class="annotation">[<acronym title="Parameter for input. Default is transfer none."><span class="acronym">in</span></acronym>]</span>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>kf</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> fill with the kf coordinates. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym> caller-allocates]</span>
-</td>
+<td class="parameter_name"><p>g</p></td>
+<td class="parameter_description"><p> the diffractometer <a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> use to compute kf. </p></td>
+<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for input. Default is transfer none."><span class="acronym">in</span></acronym>]</span></td>
 </tr>
 <tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>HKL_SUCCESS if everythongs goes fine. HKL_FAIL otherwise.</td>
+<td class="parameter_name"><p>kf</p></td>
+<td class="parameter_description"><p> the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> fill with the kf coordinates. </p></td>
+<td class="parameter_annotations"><span class="annotation">[<acronym title="Out parameter, where caller must allocate storage."><span class="acronym">out caller-allocates</span></acronym>]</span></td>
 </tr>
 </tbody>
 </table></div>
 </div>
-<hr>
-<div class="refsect2">
-<a name="hkl-detector-new"></a><h3>hkl_detector_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-detector-private.html#HklDetector" title="HklDetector"><span class="returnvalue">HklDetector</span></a> *       hkl_detector_new                    (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-<p>
-Create a new default <a class="link" href="hkl-hkl-detector-private.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a>
-</p>
+<div class="refsect3">
+<a name="id-1.2.11.6.4.6"></a><h4>Returns</h4>
+<p> HKL_SUCCESS if everythongs goes fine. HKL_FAIL otherwise.</p>
+<p></p>
 </div>
-<hr>
+</div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-detector-private.other_details"></a><h2>Types and Values</h2>
 <div class="refsect2">
-<a name="hkl-detector-new-copy"></a><h3>hkl_detector_new_copy ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-detector-private.html#HklDetector" title="HklDetector"><span class="returnvalue">HklDetector</span></a> *       hkl_detector_new_copy               ();</pre>
-<p>
-the copy constructor
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
-<td>the detector to copy</td>
-</tr></tbody>
-</table></div>
+<a name="HklDetector"></a><h3>HklDetector</h3>
+<pre class="programlisting">typedef struct {
+	size_t idx;
+	HklHolder const *holder;
+} HklDetector;
+</pre>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-error-private.html b/Documentation/api/html/hkl-hkl-error-private.html
deleted file mode 100644
index 39d799f..0000000
--- a/Documentation/api/html/hkl-hkl-error-private.html
+++ /dev/null
@@ -1,408 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-error-private</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
-<link rel="home" href="index.html" title="hkl Reference Manual">
-<link rel="up" href="ch01.html" title="[Insert title here]">
-<link rel="prev" href="hkl-hkl-detector-private.html" title="hkl-detector-private">
-<link rel="next" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
-<link rel="stylesheet" href="style.css" type="text/css">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-detector-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-geometry-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-error-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-error-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
-<div class="refentry">
-<a name="hkl-hkl-error-private"></a><div class="titlepage"></div>
-<div class="refnamediv"><table width="100%"><tr>
-<td valign="top">
-<h2><span class="refentrytitle"><a name="hkl-hkl-error-private.top_of_page"></a>hkl-error-private</span></h2>
-<p>hkl-error-private</p>
-</td>
-<td valign="top" align="right"></td>
-</tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-error-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError">HklError</a>;
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-error-private.html#hkl-error-clear" title="hkl_error_clear ()">hkl_error_clear</a>                     (<em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **err</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-error-private.html#hkl-error-free" title="hkl_error_free ()">hkl_error_free</a>                      (<em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> *error</code></em>);
-<a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="returnvalue">HklError</span></a> *          <a class="link" href="hkl-hkl-error-private.html#hkl-error-new" title="hkl_error_new ()">hkl_error_new</a>                       (<em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
-                                                         <em class="parameter"><code>...</code></em>);
-<a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="returnvalue">HklError</span></a> *          <a class="link" href="hkl-hkl-error-private.html#hkl-error-new-copy" title="hkl_error_new_copy ()">hkl_error_new_copy</a>                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> *error</code></em>);
-<a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="returnvalue">HklError</span></a> *          <a class="link" href="hkl-hkl-error-private.html#hkl-error-new-literal" title="hkl_error_new_literal ()">hkl_error_new_literal</a>               (<em class="parameter"><code>const <span class="type">char</span> *message</code></em>);
-<a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="returnvalue">HklError</span></a> *          <a class="link" href="hkl-hkl-error-private.html#hkl-error-new-valist" title="hkl_error_new_valist ()">hkl_error_new_valist</a>                (<em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
-                                                         <em class="parameter"><code><span class="type">va_list</span> args</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-error-private.html#hkl-error-prefix" title="hkl_error_prefix ()">hkl_error_prefix</a>                    (<em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **err</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
-                                                         <em class="parameter"><code>...</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-error-private.html#hkl-error-propagate" title="hkl_error_propagate ()">hkl_error_propagate</a>                 (<em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **dest</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> *src</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-error-private.html#hkl-error-propagate-prefixed" title="hkl_error_propagate_prefixed ()">hkl_error_propagate_prefixed</a>        (<em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **dest</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> *src</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
-                                                         <em class="parameter"><code>...</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-error-private.html#hkl-error-set" title="hkl_error_set ()">hkl_error_set</a>                       (<em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **err</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
-                                                         <em class="parameter"><code>...</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-error-private.html#hkl-error-set-literal" title="hkl_error_set_literal ()">hkl_error_set_literal</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **err</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">char</span> *message</code></em>);
-</pre>
-</div>
-<div class="refsect1">
-<a name="hkl-hkl-error-private.description"></a><h2>Description</h2>
-</div>
-<div class="refsect1">
-<a name="hkl-hkl-error-private.details"></a><h2>Details</h2>
-<div class="refsect2">
-<a name="HklError"></a><h3>HklError</h3>
-<pre class="programlisting">typedef struct {
-	char *message;
-} HklError;
-</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-error-clear"></a><h3>hkl_error_clear ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_error_clear                     (<em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **err</code></em>);</pre>
-<p>
-If <em class="parameter"><code>err</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, does nothing. If <em class="parameter"><code>err</code></em> is non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, calls
-<a class="link" href="hkl-hkl-error-private.html#hkl-error-free" title="hkl_error_free ()"><code class="function">hkl_error_free()</code></a> on *<em class="parameter"><code>err</code></em> and sets *<em class="parameter"><code>err</code></em> to <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>err</code></em> :</span></p></td>
-<td>a <a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> return location</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-error-free"></a><h3>hkl_error_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_error_free                      (<em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> *error</code></em>);</pre>
-<p>
-Frees a <a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> and associated resources.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
-<td>a <a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a>
-</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-error-new"></a><h3>hkl_error_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="returnvalue">HklError</span></a> *          hkl_error_new                       (<em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
-                                                         <em class="parameter"><code>...</code></em>);</pre>
-<p>
-Creates a new <a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> with the given,
-and a message formatted with <em class="parameter"><code>format</code></em>.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
-<td>printf()-style format for error message</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>Varargs</code></em> :</span></p></td>
-<td>parameters for message format</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>a new <a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-error-new-copy"></a><h3>hkl_error_new_copy ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="returnvalue">HklError</span></a> *          hkl_error_new_copy                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> *error</code></em>);</pre>
-<p>
-Makes a copy of <em class="parameter"><code>error</code></em>.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
-<td>a <a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>a new <a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-error-new-literal"></a><h3>hkl_error_new_literal ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="returnvalue">HklError</span></a> *          hkl_error_new_literal               (<em class="parameter"><code>const <span class="type">char</span> *message</code></em>);</pre>
-<p>
-Creates a new <a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a>; unlike <a class="link" href="hkl-hkl-error-private.html#hkl-error-new" title="hkl_error_new ()"><code class="function">hkl_error_new()</code></a>, <em class="parameter"><code>message</code></em> is not a
-<code class="function">printf()</code>-style format string. Use this function if <em class="parameter"><code>message</code></em>
-contains text you don't have control over, that could include
-<code class="function">printf()</code> escape sequences.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
-<td>error message</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>a new <a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-error-new-valist"></a><h3>hkl_error_new_valist ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="returnvalue">HklError</span></a> *          hkl_error_new_valist                (<em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
-                                                         <em class="parameter"><code><span class="type">va_list</span> args</code></em>);</pre>
-<p>
-Creates a new <a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> with the given message
-formatted with <em class="parameter"><code>format</code></em>.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
-<td>printf()-style format for error message</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>args</code></em> :</span></p></td>
-<td>
-<span class="type">va_list</span> of parameters for the message format</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>a new <a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a>
-</td>
-</tr>
-</tbody>
-</table></div>
-<p class="since">Since 2.22</p>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-error-prefix"></a><h3>hkl_error_prefix ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_error_prefix                    (<em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **err</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
-                                                         <em class="parameter"><code>...</code></em>);</pre>
-<p>
-Formats a string according to <em class="parameter"><code>format</code></em> and prefix it to an existing
-error message.  If <em class="parameter"><code>err</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> (ie: no error variable) then do
-nothing.
-</p>
-<p>
-If *<em class="parameter"><code>err</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> (ie: an error variable is present but there is no
-error condition) then also do nothing.  Whether or not it makes
-sense to take advantage of this feature is up to you.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>err</code></em> :</span></p></td>
-<td>a return location for a <a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
-<td>printf()-style format string</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
-<td>arguments to <em class="parameter"><code>format</code></em>
-</td>
-</tr>
-</tbody>
-</table></div>
-<p class="since">Since 2.16</p>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-error-propagate"></a><h3>hkl_error_propagate ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_error_propagate                 (<em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **dest</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> *src</code></em>);</pre>
-<p>
-If <em class="parameter"><code>dest</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, free <em class="parameter"><code>src</code></em>; otherwise, moves <em class="parameter"><code>src</code></em> into *<em class="parameter"><code>dest</code></em>.
-The error variable <em class="parameter"><code>dest</code></em> points to must be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>dest</code></em> :</span></p></td>
-<td>error return location</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
-<td>error to move into the return location</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-error-propagate-prefixed"></a><h3>hkl_error_propagate_prefixed ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_error_propagate_prefixed        (<em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **dest</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> *src</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
-                                                         <em class="parameter"><code>...</code></em>);</pre>
-<p>
-If <em class="parameter"><code>dest</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, free <em class="parameter"><code>src</code></em>; otherwise, moves <em class="parameter"><code>src</code></em> into
-*<em class="parameter"><code>dest</code></em>. *<em class="parameter"><code>dest</code></em> must be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.  After the move, add a prefix as with
-<code class="function">hkl_prefix_error()</code>.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>dest</code></em> :</span></p></td>
-<td>error return location</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
-<td>error to move into the return location</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
-<td>printf()-style format string</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
-<td>arguments to <em class="parameter"><code>format</code></em>
-</td>
-</tr>
-</tbody>
-</table></div>
-<p class="since">Since 2.16</p>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-error-set"></a><h3>hkl_error_set ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_error_set                       (<em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **err</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
-                                                         <em class="parameter"><code>...</code></em>);</pre>
-<p>
-Does nothing if <em class="parameter"><code>err</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>; if <em class="parameter"><code>err</code></em> is non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then *<em class="parameter"><code>err</code></em>
-must be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. A new <a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> is created and assigned to *<em class="parameter"><code>err</code></em>.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>err</code></em> :</span></p></td>
-<td>a return location for a <a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
-<td>printf()-style format</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>Varargs</code></em> :</span></p></td>
-<td>args for <em class="parameter"><code>format</code></em>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-error-set-literal"></a><h3>hkl_error_set_literal ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_error_set_literal               (<em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **err</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">char</span> *message</code></em>);</pre>
-<p>
-Does nothing if <em class="parameter"><code>err</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>; if <em class="parameter"><code>err</code></em> is non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then *<em class="parameter"><code>err</code></em>
-must be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. A new <a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> is created and assigned to *<em class="parameter"><code>err</code></em>.
-Unlike <code class="function">hkl_set_error()</code>, <em class="parameter"><code>message</code></em> is not a <code class="function">printf()</code>-style format
-string.  Use this function if <em class="parameter"><code>message</code></em> contains text you don't have
-control over, that could include <code class="function">printf()</code> escape sequences.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>err</code></em> :</span></p></td>
-<td>a return location for a <a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
-<td>error message</td>
-</tr>
-</tbody>
-</table></div>
-<p class="since">Since 2.18</p>
-</div>
-</div>
-</div>
-<div class="footer">
-<hr>
-          Generated by GTK-Doc V1.18</div>
-</body>
-</html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-factory-private.html b/Documentation/api/html/hkl-hkl-factory-private.html
new file mode 100644
index 0000000..32c908e
--- /dev/null
+++ b/Documentation/api/html/hkl-hkl-factory-private.html
@@ -0,0 +1,121 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>hkl Reference Manual: hkl-factory-private</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
+<link rel="home" href="index.html" title="hkl Reference Manual">
+<link rel="up" href="ch01.html" title="[Insert title here]">
+<link rel="prev" href="hkl-hkl-detector-private.html" title="hkl-detector-private">
+<link rel="next" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
+<link rel="stylesheet" href="style.css" type="text/css">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-factory-private.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-detector-private.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-geometry-private.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
+<div class="refentry">
+<a name="hkl-hkl-factory-private"></a><div class="titlepage"></div>
+<div class="refnamediv"><table width="100%"><tr>
+<td valign="top">
+<h2><span class="refentrytitle"><a name="hkl-hkl-factory-private.top_of_page"></a>hkl-factory-private</span></h2>
+<p>hkl-factory-private</p>
+</td>
+<td class="gallery_image" valign="top" align="right"></td>
+</tr></table></div>
+<div class="refsect1">
+<a name="hkl-hkl-factory-private.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="returnvalue">HklGeometry</span></a> *
+</td>
+<td class="function_name">
+<span class="c_punctuation">(</span><a class="link" href="hkl-hkl-factory-private.html#HklFactoryGeometryFunction" title="HklFactoryGeometryFunction ()">*HklFactoryGeometryFunction</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklEngineList" title="HklEngineList"><span class="returnvalue">HklEngineList</span></a> *
+</td>
+<td class="function_name">
+<span class="c_punctuation">(</span><a class="link" href="hkl-hkl-factory-private.html#HklFactoryEngineListFunction" title="HklFactoryEngineListFunction ()">*HklFactoryEngineListFunction</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-factory-private.html#REGISTER-DIFFRACTOMETER:CAPS" title="REGISTER_DIFFRACTOMETER()">REGISTER_DIFFRACTOMETER</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-factory-private.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="name">
+<col class="description">
+</colgroup>
+<tbody><tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklFactory" title="HklFactory">HklFactory</a></td>
+</tr></tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-factory-private.description"></a><h2>Description</h2>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-factory-private.functions_details"></a><h2>Functions</h2>
+<div class="refsect2">
+<a name="HklFactoryGeometryFunction"></a><h3>HklFactoryGeometryFunction ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="returnvalue">HklGeometry</span></a> *
+<span class="c_punctuation">(</span>*HklFactoryGeometryFunction<span class="c_punctuation">)</span> (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklFactory" title="HklFactory"><span class="type">HklFactory</span></a> *factory</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklFactoryEngineListFunction"></a><h3>HklFactoryEngineListFunction ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklEngineList" title="HklEngineList"><span class="returnvalue">HklEngineList</span></a> *
+<span class="c_punctuation">(</span>*HklFactoryEngineListFunction<span class="c_punctuation">)</span> (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklFactory" title="HklFactory"><span class="type">HklFactory</span></a> *factory</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="REGISTER-DIFFRACTOMETER:CAPS"></a><h3>REGISTER_DIFFRACTOMETER()</h3>
+<pre class="programlisting">#define             REGISTER_DIFFRACTOMETER(name_, real_name_, description_)</pre>
+</div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-factory-private.other_details"></a><h2>Types and Values</h2>
+<div class="refsect2">
+<a name="HklFactory"></a><h3>HklFactory</h3>
+<pre class="programlisting">typedef struct {
+	const char *name;
+	const char *description;
+	const darray_string axes;
+	HklFactoryGeometryFunction create_new_geometry;
+	HklFactoryEngineListFunction create_new_engine_list;
+} HklFactory;
+</pre>
+</div>
+</div>
+</div>
+<div class="footer">
+<hr>
+          Generated by GTK-Doc V1.21</div>
+</body>
+</html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-geometry-private.html b/Documentation/api/html/hkl-hkl-geometry-private.html
index aaad5f6..4313b1d 100644
--- a/Documentation/api/html/hkl-hkl-geometry-private.html
+++ b/Documentation/api/html/hkl-hkl-geometry-private.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-geometry-private</title>
+<title>hkl Reference Manual: hkl-geometry-private</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
-<link rel="prev" href="hkl-hkl-error-private.html" title="hkl-error-private">
+<link rel="prev" href="hkl-hkl-factory-private.html" title="hkl-factory-private">
 <link rel="next" href="hkl-hkl-interval-private.html" title="hkl-interval-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-error-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-interval-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-geometry-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-geometry-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-geometry-private.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-factory-private.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-interval-private.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-hkl-geometry-private"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,433 +29,713 @@
 <h2><span class="refentrytitle"><a name="hkl-hkl-geometry-private.top_of_page"></a>hkl-geometry-private</span></h2>
 <p>hkl-geometry-private</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-geometry-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry">HklGeometry</a>;
-                    <a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList">HklGeometryList</a>;
-                    <a class="link" href="hkl-hkl-geometry-private.html#HklGeometryListItem" title="HklGeometryListItem">HklGeometryListItem</a>;
-<span class="returnvalue">void</span>                (<a class="link" href="hkl-hkl-geometry-private.html#HklGeometryListMultiplyFunction" title="HklGeometryListMultiplyFunction ()">*HklGeometryListMultiplyFunction</a>)  (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryListItem" title="HklGeometryListItem"><span class="type">HklGeometryListItem</span></a> *item</code></em>);
-struct              <a class="link" href="hkl-hkl-geometry-private.html#HklHolder" title="struct HklHolder">HklHolder</a>;
-typedef             <a class="link" href="hkl-hkl-geometry-private.html#darray-holder" title="darray_holder">darray_holder</a>;
-<a class="link" href="hkl-hkl-geometry-private.html#HklHolder" title="struct HklHolder"><span class="returnvalue">HklHolder</span></a> *         <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-add-holder" title="hkl_geometry_add_holder ()">hkl_geometry_add_holder</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-closest-from-geometry-with-range" title="hkl_geometry_closest_from_geometry_with_range ()">hkl_geometry_closest_from_geometry_with_range</a>
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-distance" title="hkl_geometry_distance ()">hkl_geometry_distance</a>               (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-distance-orthodromic" title="hkl_geometry_distance_orthodromic ()">hkl_geometry_distance_orthodromic</a>   (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);
-<a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *      <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-get-axis-by-name" title="hkl_geometry_get_axis_by_name ()">hkl_geometry_get_axis_by_name</a>       (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">char</span> *name</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-get-axis-idx-by-name" title="hkl_geometry_get_axis_idx_by_name ()">hkl_geometry_get_axis_idx_by_name</a>   (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">char</span> *name</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-init-geometry" title="hkl_geometry_init_geometry ()">hkl_geometry_init_geometry</a>          (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *src</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-is-valid" title="hkl_geometry_is_valid ()">hkl_geometry_is_valid</a>               (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-add" title="hkl_geometry_list_add ()">hkl_geometry_list_add</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-fprintf" title="hkl_geometry_list_fprintf ()">hkl_geometry_list_fprintf</a>           (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-free" title="hkl_geometry_list_free ()">hkl_geometry_list_free</a>              (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-item-free" title="hkl_geometry_list_item_free ()">hkl_geometry_list_item_free</a>         (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryListItem" title="HklGeometryListItem"><span class="type">HklGeometryListItem</span></a> *self</code></em>);
-<a class="link" href="hkl-hkl-geometry-private.html#HklGeometryListItem" title="HklGeometryListItem"><span class="returnvalue">HklGeometryListItem</span></a> * <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-item-new" title="hkl_geometry_list_item_new ()">hkl_geometry_list_item_new</a>        (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</cod [...]
-<a class="link" href="hkl-hkl-geometry-private.html#HklGeometryListItem" title="HklGeometryListItem"><span class="returnvalue">HklGeometryListItem</span></a> * <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-item-new-copy" title="hkl_geometry_list_item_new_copy ()">hkl_geometry_list_item_new_copy</a>   (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometryListItem" title="HklGeometryListItem"><span class="type">HklGeometry [...]
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-multiply" title="hkl_geometry_list_multiply ()">hkl_geometry_list_multiply</a>          (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-multiply-from-range" title="hkl_geometry_list_multiply_from_range ()">hkl_geometry_list_multiply_from_range</a>
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);
-<a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="returnvalue">HklGeometryList</span></a> *   <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-new" title="hkl_geometry_list_new ()">hkl_geometry_list_new</a>               (<em class="parameter"><code><span class="type">void</span></code></em>);
-<a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="returnvalue">HklGeometryList</span></a> *   <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-new-copy" title="hkl_geometry_list_new_copy ()">hkl_geometry_list_new_copy</a>          (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</cod [...]
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-remove-invalid" title="hkl_geometry_list_remove_invalid ()">hkl_geometry_list_remove_invalid</a>    (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-reset" title="hkl_geometry_list_reset ()">hkl_geometry_list_reset</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-sort" title="hkl_geometry_list_sort ()">hkl_geometry_list_sort</a>              (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);
-<a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="returnvalue">HklGeometry</span></a> *       <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-new" title="hkl_geometry_new ()">hkl_geometry_new</a>                    (<em class="parameter"><code>const <span class="type">HklFactory</span> *factory</code></em>);
-<a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="returnvalue">HklGeometry</span></a> *       <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-new-copy" title="hkl_geometry_new_copy ()">hkl_geometry_new_copy</a>               (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-set-values-v" title="hkl_geometry_set_values_v ()">hkl_geometry_set_values_v</a>           (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> len</code></em>,
-                                                         <em class="parameter"><code>...</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-update" title="hkl_geometry_update ()">hkl_geometry_update</a>                 (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);
-<a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *      <a class="link" href="hkl-hkl-geometry-private.html#hkl-holder-add-rotation-axis" title="hkl_holder_add_rotation_axis ()">hkl_holder_add_rotation_axis</a>        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklHolder" title="struct HklHolder"><span class="type">HklHolder</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> x</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> y</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> z</code></em>);
-</pre>
+<div class="refsect1">
+<a name="hkl-hkl-geometry-private.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<span class="c_punctuation">(</span><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryListMultiplyFunction" title="HklGeometryListMultiplyFunction ()">*HklGeometryListMultiplyFunction</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">return</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#g-quark-from-static-string" title="g_quark_from_static_string ()">g_quark_from_static_string</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-holder-add-rotation-axis" title="hkl_holder_add_rotation_axis ()">hkl_holder_add_rotation_axis</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="returnvalue">HklGeometry</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-new" title="hkl_geometry_new ()">hkl_geometry_new</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-init-geometry" title="hkl_geometry_init_geometry ()">hkl_geometry_init_geometry</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl-geometry-private.html#HklHolder" title="struct HklHolder"><span class="returnvalue">HklHolder</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-add-holder" title="hkl_geometry_add_holder ()">hkl_geometry_add_holder</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-update" title="hkl_geometry_update ()">hkl_geometry_update</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-get-axis-idx-by-name" title="hkl_geometry_get_axis_idx_by_name ()">hkl_geometry_get_axis_idx_by_name</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-get-axis-by-name" title="hkl_geometry_get_axis_by_name ()">hkl_geometry_get_axis_by_name</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">double</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-distance" title="hkl_geometry_distance ()">hkl_geometry_distance</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">double</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-distance-orthodromic" title="hkl_geometry_distance_orthodromic ()">hkl_geometry_distance_orthodromic</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-closest-from-geometry-with-range" title="hkl_geometry_closest_from_geometry_with_range ()">hkl_geometry_closest_from_geometry_with_range</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-is-valid" title="hkl_geometry_is_valid ()">hkl_geometry_is_valid</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklGeometryList" title="HklGeometryList"><span class="returnvalue">HklGeometryList</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-new" title="hkl_geometry_list_new ()">hkl_geometry_list_new</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklGeometryList" title="HklGeometryList"><span class="returnvalue">HklGeometryList</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-new-copy" title="hkl_geometry_list_new_copy ()">hkl_geometry_list_new_copy</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-add" title="hkl_geometry_list_add ()">hkl_geometry_list_add</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-reset" title="hkl_geometry_list_reset ()">hkl_geometry_list_reset</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-sort" title="hkl_geometry_list_sort ()">hkl_geometry_list_sort</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-fprintf" title="hkl_geometry_list_fprintf ()">hkl_geometry_list_fprintf</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-multiply" title="hkl_geometry_list_multiply ()">hkl_geometry_list_multiply</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-multiply-from-range" title="hkl_geometry_list_multiply_from_range ()">hkl_geometry_list_multiply_from_range</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-remove-invalid" title="hkl_geometry_list_remove_invalid ()">hkl_geometry_list_remove_invalid</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklGeometryListItem" title="HklGeometryListItem"><span class="returnvalue">HklGeometryListItem</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-item-new" title="hkl_geometry_list_item_new ()">hkl_geometry_list_item_new</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklGeometryListItem" title="HklGeometryListItem"><span class="returnvalue">HklGeometryListItem</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-item-new-copy" title="hkl_geometry_list_item_new_copy ()">hkl_geometry_list_item_new_copy</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#hkl-geometry-list-item-free" title="hkl_geometry_list_item_free ()">hkl_geometry_list_item_free</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-geometry-private.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="name">
+<col class="description">
+</colgroup>
+<tbody>
+<tr>
+<td class="typedef_keyword">typedef</td>
+<td class="function_name"><a class="link" href="hkl-hkl-geometry-private.html#darray-holder" title="darray_holder">darray_holder</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl-geometry-private.html#HklHolderConfig" title="struct HklHolderConfig">HklHolderConfig</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl-geometry-private.html#HklHolder" title="struct HklHolder">HklHolder</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry">HklGeometry</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-geometry-private.html#HKL-GEOMETRY-ERROR:CAPS" title="HKL_GEOMETRY_ERROR">HKL_GEOMETRY_ERROR</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">enum</td>
+<td class="function_name"><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryError" title="enum HklGeometryError">HklGeometryError</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklGeometryList" title="HklGeometryList">HklGeometryList</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklGeometryListItem" title="HklGeometryListItem">HklGeometryListItem</a></td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-hkl-geometry-private.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-hkl-geometry-private.details"></a><h2>Details</h2>
+<a name="hkl-hkl-geometry-private.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
-<a name="HklGeometry"></a><h3>HklGeometry</h3>
-<pre class="programlisting">typedef struct {
-	const HklFactory *factory;
-	HklSource source;
-	darray_parameter axes;
-	darray_holder holders;
-} HklGeometry;
-</pre>
+<a name="HklGeometryListMultiplyFunction"></a><h3>HklGeometryListMultiplyFunction ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+<span class="c_punctuation">(</span>*HklGeometryListMultiplyFunction<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
+                                    <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklGeometryListItem" title="HklGeometryListItem"><span class="type">HklGeometryListItem</span></a> *item</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="HklGeometryList"></a><h3>HklGeometryList</h3>
-<pre class="programlisting">typedef struct {
-	HklGeometryListMultiplyFunction multiply;
-	darray_item items;
-} HklGeometryList;
-</pre>
+<a name="g-quark-from-static-string"></a><h3>g_quark_from_static_string ()</h3>
+<pre class="programlisting"><span class="returnvalue">return</span>
+g_quark_from_static_string ();</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="HklGeometryListItem"></a><h3>HklGeometryListItem</h3>
-<pre class="programlisting">typedef struct {
-	HklGeometry *geometry;
-} HklGeometryListItem;
-</pre>
+<a name="hkl-holder-add-rotation-axis"></a><h3>hkl_holder_add_rotation_axis ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *
+hkl_holder_add_rotation_axis (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklHolder" title="struct HklHolder"><span class="type">HklHolder</span></a> *self</code></em>,
+                              <em class="parameter"><code><span class="type">char</span> const *name</code></em>,
+                              <em class="parameter"><code><span class="type">double</span> x</code></em>,
+                              <em class="parameter"><code><span class="type">double</span> y</code></em>,
+                              <em class="parameter"><code><span class="type">double</span> z</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="HklGeometryListMultiplyFunction"></a><h3>HklGeometryListMultiplyFunction ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                (*HklGeometryListMultiplyFunction)  (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryListItem" title="HklGeometryListItem"><span class="type">HklGeometryListItem</span></a> *item</code></em>);</pre>
+<a name="hkl-geometry-new"></a><h3>hkl_geometry_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="returnvalue">HklGeometry</span></a> *
+hkl_geometry_new (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklFactory" title="HklFactory"><span class="type">HklFactory</span></a> *factory</code></em>);</pre>
+<p>constructor</p>
+<div class="refsect3">
+<a name="id-1.2.13.6.5.5"></a><h4>Returns</h4>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="HklHolder"></a><h3>struct HklHolder</h3>
-<pre class="programlisting">struct HklHolder {
-	struct HklHolderConfig *config;
-	HklGeometry *geometry;
-	HklQuaternion q;
-};
-</pre>
+<a name="hkl-geometry-init-geometry"></a><h3>hkl_geometry_init_geometry ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_geometry_init_geometry (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
+                            <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *src</code></em>);</pre>
+<p>initilize an HklGeometry</p>
+<div class="refsect3">
+<a name="id-1.2.13.6.6.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
+</colgroup>
+<tbody>
+<tr>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the this ptr</p></td>
+<td class="parameter_annotations"> </td>
+</tr>
+<tr>
+<td class="parameter_name"><p>src</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> to set from</p></td>
+<td class="parameter_annotations"> </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect3">
+<a name="id-1.2.13.6.6.6"></a><h4>Returns</h4>
+<p> TRUE on success, FALSE if an error occurred</p>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="darray-holder"></a><h3>darray_holder</h3>
-<pre class="programlisting">typedef darray(HklHolder *) darray_holder;
-</pre>
+<a name="hkl-geometry-add-holder"></a><h3>hkl_geometry_add_holder ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl-geometry-private.html#HklHolder" title="struct HklHolder"><span class="returnvalue">HklHolder</span></a> *
+hkl_geometry_add_holder (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);</pre>
+<p>add an Holder to the <a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a></p>
+<div class="refsect3">
+<a name="id-1.2.13.6.7.5"></a><h4>Returns</h4>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-add-holder"></a><h3>hkl_geometry_add_holder ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-geometry-private.html#HklHolder" title="struct HklHolder"><span class="returnvalue">HklHolder</span></a> *         hkl_geometry_add_holder             (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);</pre>
-<p>
-add an Holder to the <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a>
-</p>
+<a name="hkl-geometry-update"></a><h3>hkl_geometry_update ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_geometry_update (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);</pre>
+<p>update the geometry internal once an Axis values changed</p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-closest-from-geometry-with-range"></a><h3>hkl_geometry_closest_from_geometry_with_range ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_geometry_closest_from_geometry_with_range
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);</pre>
-<p>
-get the closest axes values in the HklInterval compatible with the
-current axes values
-</p>
+<a name="hkl-geometry-get-axis-idx-by-name"></a><h3>hkl_geometry_get_axis_idx_by_name ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_geometry_get_axis_idx_by_name (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
+                                   <em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre>
+<p>get the index of the axes named <em class="parameter"><code>name</code></em>
+ in the geometry</p>
+<div class="refsect3">
+<a name="id-1.2.13.6.9.5"></a><h4>Returns</h4>
+<p> -1 if the axis was not found</p>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-distance"></a><h3>hkl_geometry_distance ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_geometry_distance               (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);</pre>
-<p>
-compute the distance between two <span class="type">HklGeometries</span>
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-geometry-get-axis-by-name"></a><h3>hkl_geometry_get_axis_by_name ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *
+hkl_geometry_get_axis_by_name (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
+                               <em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre>
+<p>get an <a class="link" href="hkl-hkl-axis-private.html#HklAxis" title="struct HklAxis"><span class="type">HklAxis</span></a> using its name</p>
+<div class="refsect3">
+<a name="id-1.2.13.6.10.5"></a><h4>Returns</h4>
+<p>. </p>
+<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
+</div>
+</div>
+<hr>
+<div class="refsect2">
+<a name="hkl-geometry-distance"></a><h3>hkl_geometry_distance ()</h3>
+<pre class="programlisting"><span class="returnvalue">double</span>
+hkl_geometry_distance (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
+                       <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);</pre>
+<p>compute the distance between two <span class="type">HklGeometries</span></p>
+<div class="refsect3">
+<a name="id-1.2.13.6.11.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the this ptr</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>ref</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> to compare with</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the this ptr</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>the distance between the two geometries</td>
+<td class="parameter_name"><p>ref</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> to compare with</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+<div class="refsect3">
+<a name="id-1.2.13.6.11.6"></a><h4>Returns</h4>
+<p> the distance between the two geometries</p>
+<p></p>
+</div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-distance-orthodromic"></a><h3>hkl_geometry_distance_orthodromic ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_geometry_distance_orthodromic   (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);</pre>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-geometry-distance-orthodromic"></a><h3>hkl_geometry_distance_orthodromic ()</h3>
+<pre class="programlisting"><span class="returnvalue">double</span>
+hkl_geometry_distance_orthodromic (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
+                                   <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);</pre>
+<div class="refsect3">
+<a name="id-1.2.13.6.12.4"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the this ptr</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>ref</code></em> :</span></p></td>
-<td>the reference <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> to compare with.</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the this ptr</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>the orthodromique distance</td>
+<td class="parameter_name"><p>ref</p></td>
+<td class="parameter_description"><p>the reference <a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> to compare with.</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+<div class="refsect3">
+<a name="id-1.2.13.6.12.5"></a><h4>Returns</h4>
+<p> the orthodromique distance</p>
+<p></p>
+</div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-get-axis-by-name"></a><h3>hkl_geometry_get_axis_by_name ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *      hkl_geometry_get_axis_by_name       (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre>
-<p>
-get an <a class="link" href="hkl-hkl-axis-private.html#HklAxis" title="struct HklAxis"><span class="type">HklAxis</span></a> using its name
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
-</td>
-</tr></tbody>
-</table></div>
+<a name="hkl-geometry-closest-from-geometry-with-range"></a><h3>hkl_geometry_closest_from_geometry_with_range ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_geometry_closest_from_geometry_with_range
+                               (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
+                                <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);</pre>
+<p>get the closest axes values in the HklInterval compatible with the
+current axes values</p>
+<div class="refsect3">
+<a name="id-1.2.13.6.13.5"></a><h4>Returns</h4>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-get-axis-idx-by-name"></a><h3>hkl_geometry_get_axis_idx_by_name ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_geometry_get_axis_idx_by_name   (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre>
-<p>
-get the index of the axes named <em class="parameter"><code>name</code></em> in the geometry
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>-1 if the axis was not found</td>
-</tr></tbody>
-</table></div>
+<a name="hkl-geometry-is-valid"></a><h3>hkl_geometry_is_valid ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_geometry_is_valid (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);</pre>
+<p>check if all axes of the <a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> are valid.</p>
+<div class="refsect3">
+<a name="id-1.2.13.6.14.5"></a><h4>Returns</h4>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-init-geometry"></a><h3>hkl_geometry_init_geometry ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_init_geometry          (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *src</code></em>);</pre>
-<p>
-initilize an HklGeometry
-</p>
+<a name="hkl-geometry-list-new"></a><h3>hkl_geometry_list_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklGeometryList" title="HklGeometryList"><span class="returnvalue">HklGeometryList</span></a> *
+hkl_geometry_list_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
+<p>constructor</p>
+<div class="refsect3">
+<a name="id-1.2.13.6.15.5"></a><h4>Returns</h4>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-is-valid"></a><h3>hkl_geometry_is_valid ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_geometry_is_valid               (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);</pre>
-<p>
-check if all axes of the <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> are valid.
-</p>
+<a name="hkl-geometry-list-new-copy"></a><h3>hkl_geometry_list_new_copy ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklGeometryList" title="HklGeometryList"><span class="returnvalue">HklGeometryList</span></a> *
+hkl_geometry_list_new_copy (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
+<p>copy constructor</p>
+<div class="refsect3">
+<a name="id-1.2.13.6.16.5"></a><h4>Returns</h4>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-list-add"></a><h3>hkl_geometry_list_add ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_add               (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>);</pre>
-<p>
-this method Add a geometry to the geometries
-</p>
-<p>
-This method try to be clever by allocating memory only if the
+<a name="hkl-geometry-list-add"></a><h3>hkl_geometry_list_add ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_geometry_list_add (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
+                       <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>);</pre>
+<p>this method Add a geometry to the geometries</p>
+<p>This method try to be clever by allocating memory only if the
 current length of the geometries is not large enought. Then it just
 set the geometry axes and copy it to the right geometries. We do
-not gives the x len as it is equal to the self->axes_len.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+not gives the x len as it is equal to the self->axes_len.</p>
+<div class="refsect3">
+<a name="id-1.2.13.6.17.6"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>The current <a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a>
-</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>The current <a class="link" href="hkl-hkl.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>geometry</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> to add</td>
+<td class="parameter_name"><p>geometry</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> to add</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-list-fprintf"></a><h3>hkl_geometry_list_fprintf ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_fprintf           (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
-<p>
-print to a file the <a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a>
-</p>
+<a name="hkl-geometry-list-reset"></a><h3>hkl_geometry_list_reset ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_geometry_list_reset (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
+<p>reset the HklGeometry, in fact it is a sort of clean method remove
+all the items of the list.</p>
+<div class="refsect3">
+<a name="id-1.2.13.6.18.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
+</colgroup>
+<tbody><tr>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the this ptr</p></td>
+<td class="parameter_annotations"> </td>
+</tr></tbody>
+</table></div>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-list-free"></a><h3>hkl_geometry_list_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_free              (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
-<p>
-destructor
-</p>
+<a name="hkl-geometry-list-sort"></a><h3>hkl_geometry_list_sort ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_geometry_list_sort (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
+                        <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);</pre>
+<p>sort the <a class="link" href="hkl-hkl.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> compare to the distance of the given
+<a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a></p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-list-item-free"></a><h3>hkl_geometry_list_item_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_item_free         (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryListItem" title="HklGeometryListItem"><span class="type">HklGeometryListItem</span></a> *self</code></em>);</pre>
-<p>
-destructor
-</p>
+<a name="hkl-geometry-list-fprintf"></a><h3>hkl_geometry_list_fprintf ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_geometry_list_fprintf (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
+                           <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
+<p>print to a file the <a class="link" href="hkl-hkl.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a></p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-list-item-new"></a><h3>hkl_geometry_list_item_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryListItem" title="HklGeometryListItem"><span class="returnvalue">HklGeometryListItem</span></a> * hkl_geometry_list_item_new        (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>);</pre>
-<p>
-constructor
-</p>
+<a name="hkl-geometry-list-multiply"></a><h3>hkl_geometry_list_multiply ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_geometry_list_multiply (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
+<p>apply the multiply lenthod to the <a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a></p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-list-item-new-copy"></a><h3>hkl_geometry_list_item_new_copy ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryListItem" title="HklGeometryListItem"><span class="returnvalue">HklGeometryListItem</span></a> * hkl_geometry_list_item_new_copy   (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometryListItem" title="HklGeometryListItem"><span class="type">HklGeometryListItem</span></a> *self</code></em>);</pre>
-<p>
-copy constructor
-</p>
+<a name="hkl-geometry-list-multiply-from-range"></a><h3>hkl_geometry_list_multiply_from_range ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_geometry_list_multiply_from_range (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-list-multiply"></a><h3>hkl_geometry_list_multiply ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_multiply          (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
-<p>
-apply the multiply lenthod to the <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a>
-</p>
+<a name="hkl-geometry-list-remove-invalid"></a><h3>hkl_geometry_list_remove_invalid ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_geometry_list_remove_invalid (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
+<p>remove all invalid <a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> from the <a class="link" href="hkl-hkl.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a></p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-list-multiply-from-range"></a><h3>hkl_geometry_list_multiply_from_range ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_multiply_from_range
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
+<a name="hkl-geometry-list-item-new"></a><h3>hkl_geometry_list_item_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklGeometryListItem" title="HklGeometryListItem"><span class="returnvalue">HklGeometryListItem</span></a> *
+hkl_geometry_list_item_new (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>);</pre>
+<p>constructor</p>
+<div class="refsect3">
+<a name="id-1.2.13.6.24.5"></a><h4>Returns</h4>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-list-new"></a><h3>hkl_geometry_list_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="returnvalue">HklGeometryList</span></a> *   hkl_geometry_list_new               (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-<p>
-constructor
-</p>
+<a name="hkl-geometry-list-item-new-copy"></a><h3>hkl_geometry_list_item_new_copy ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklGeometryListItem" title="HklGeometryListItem"><span class="returnvalue">HklGeometryListItem</span></a> *
+hkl_geometry_list_item_new_copy (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklGeometryListItem" title="HklGeometryListItem"><span class="type">HklGeometryListItem</span></a> *self</code></em>);</pre>
+<p>copy constructor</p>
+<div class="refsect3">
+<a name="id-1.2.13.6.25.5"></a><h4>Returns</h4>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-list-new-copy"></a><h3>hkl_geometry_list_new_copy ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="returnvalue">HklGeometryList</span></a> *   hkl_geometry_list_new_copy          (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
-<p>
-copy constructor
-</p>
+<a name="hkl-geometry-list-item-free"></a><h3>hkl_geometry_list_item_free ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_geometry_list_item_free (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklGeometryListItem" title="HklGeometryListItem"><span class="type">HklGeometryListItem</span></a> *self</code></em>);</pre>
+<p>destructor</p>
 </div>
-<hr>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-geometry-private.other_details"></a><h2>Types and Values</h2>
 <div class="refsect2">
-<a name="hkl-geometry-list-remove-invalid"></a><h3>hkl_geometry_list_remove_invalid ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_remove_invalid    (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
-<p>
-remove all invalid <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> from the <a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a>
-</p>
+<a name="darray-holder"></a><h3>darray_holder</h3>
+<pre class="programlisting">typedef darray(HklHolder *) darray_holder;
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-list-reset"></a><h3>hkl_geometry_list_reset ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_reset             (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
-<p>
-reset the HklGeometry, in fact it is a sort of clean method remove
-all the items of the list.
-</p>
+<a name="HklHolderConfig"></a><h3>struct HklHolderConfig</h3>
+<pre class="programlisting">struct HklHolderConfig {
+	int gc;
+	size_t *idx;
+	size_t len;
+};
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-list-sort"></a><h3>hkl_geometry_list_sort ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_sort              (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);</pre>
-<p>
-sort the <a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> compare to the distance of the given
-<a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a>
-</p>
+<a name="HklHolder"></a><h3>struct HklHolder</h3>
+<pre class="programlisting">struct HklHolder {
+	struct HklHolderConfig *config;
+	HklGeometry *geometry;
+	HklQuaternion q;
+};
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-new"></a><h3>hkl_geometry_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="returnvalue">HklGeometry</span></a> *       hkl_geometry_new                    (<em class="parameter"><code>const <span class="type">HklFactory</span> *factory</code></em>);</pre>
-<p>
-constructor
-</p>
+<a name="HklGeometry"></a><h3>HklGeometry</h3>
+<pre class="programlisting">typedef struct {
+	const HklFactory *factory;
+	HklSource source;
+	darray_parameter axes;
+	darray_holder holders;
+} HklGeometry;
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-new-copy"></a><h3>hkl_geometry_new_copy ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="returnvalue">HklGeometry</span></a> *       hkl_geometry_new_copy               (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);</pre>
-<p>
-copy constructor
-</p>
+<a name="HKL-GEOMETRY-ERROR:CAPS"></a><h3>HKL_GEOMETRY_ERROR</h3>
+<pre class="programlisting">#define HKL_GEOMETRY_ERROR hkl_geometry_error_quark ()
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-set-values-v"></a><h3>hkl_geometry_set_values_v ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_geometry_set_values_v           (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> len</code></em>,
-                                                         <em class="parameter"><code>...</code></em>);</pre>
-<p>
-set the axes values
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="HklGeometryError"></a><h3>enum HklGeometryError</h3>
+<div class="refsect3">
+<a name="id-1.2.13.7.7.3"></a><h4>Members</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="300px" class="enum_members_name">
+<col class="enum_members_description">
+<col width="200px" class="enum_members_annotations">
 </colgroup>
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
-<td>"...:</td>
-</tr></tbody>
+<tbody>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-GEOMETRY-ERROR-AXIS-GET:CAPS"></a>HKL_GEOMETRY_ERROR_AXIS_GET</p></td>
+<td> </td>
+<td> </td>
+</tr>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-GEOMETRY-ERROR-AXIS-SET:CAPS"></a>HKL_GEOMETRY_ERROR_AXIS_SET</p></td>
+<td> </td>
+<td> </td>
+</tr>
+</tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-geometry-update"></a><h3>hkl_geometry_update ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_update                 (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);</pre>
-<p>
-update the geometry internal once an Axis values changed
-</p>
+<a name="HklGeometryList"></a><h3>HklGeometryList</h3>
+<pre class="programlisting">typedef struct {
+	HklGeometryListMultiplyFunction multiply;
+	struct list_head items;
+	size_t n_items;
+} HklGeometryList;
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-holder-add-rotation-axis"></a><h3>hkl_holder_add_rotation_axis ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *      hkl_holder_add_rotation_axis        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklHolder" title="struct HklHolder"><span class="type">HklHolder</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> x</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> y</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> z</code></em>);</pre>
+<a name="HklGeometryListItem"></a><h3>HklGeometryListItem</h3>
+<pre class="programlisting">typedef struct {
+	struct list_node list;
+	HklGeometry *geometry;
+} HklGeometryListItem;
+</pre>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-interval-private.html b/Documentation/api/html/hkl-hkl-interval-private.html
index 7e3be79..d6b621d 100644
--- a/Documentation/api/html/hkl-hkl-interval-private.html
+++ b/Documentation/api/html/hkl-hkl-interval-private.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-interval-private</title>
+<title>hkl Reference Manual: hkl-interval-private</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-geometry-private.html" title="hkl-geometry-private">
 <link rel="next" href="hkl-hkl-lattice-private.html" title="hkl-lattice-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-geometry-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-lattice-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-interval-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-interval-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-interval-private.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-geometry-private.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-lattice-private.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-hkl-interval-private"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,217 +29,360 @@
 <h2><span class="refentrytitle"><a name="hkl-hkl-interval-private.top_of_page"></a>hkl-interval-private</span></h2>
 <p>hkl-interval-private</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-interval-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">struct              <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval">HklInterval</a>;
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval-private.html#hkl-interval-acos" title="hkl_interval_acos ()">hkl_interval_acos</a>                   (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval-private.html#hkl-interval-angle-restrict-symm" title="hkl_interval_angle_restrict_symm ()">hkl_interval_angle_restrict_symm</a>    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval-private.html#hkl-interval-asin" title="hkl_interval_asin ()">hkl_interval_asin</a>                   (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval-private.html#hkl-interval-atan" title="hkl_interval_atan ()">hkl_interval_atan</a>                   (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-interval-private.html#hkl-interval-cmp" title="hkl_interval_cmp ()">hkl_interval_cmp</a>                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *interval</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-interval-private.html#hkl-interval-contain-zero" title="hkl_interval_contain_zero ()">hkl_interval_contain_zero</a>           (<em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval-private.html#hkl-interval-cos" title="hkl_interval_cos ()">hkl_interval_cos</a>                    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval-private.html#hkl-interval-divides-double" title="hkl_interval_divides_double ()">hkl_interval_divides_double</a>         (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> const d</code></em>);
-<a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="returnvalue">HklInterval</span></a> *       <a class="link" href="hkl-hkl-interval-private.html#hkl-interval-dup" title="hkl_interval_dup ()">hkl_interval_dup</a>                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval-private.html#hkl-interval-free" title="hkl_interval_free ()">hkl_interval_free</a>                   (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-interval-private.html#hkl-interval-length" title="hkl_interval_length ()">hkl_interval_length</a>                 (<em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval-private.html#hkl-interval-minus-double" title="hkl_interval_minus_double ()">hkl_interval_minus_double</a>           (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> const d</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval-private.html#hkl-interval-minus-interval" title="hkl_interval_minus_interval ()">hkl_interval_minus_interval</a>         (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *interval</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval-private.html#hkl-interval-plus-double" title="hkl_interval_plus_double ()">hkl_interval_plus_double</a>            (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> const d</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval-private.html#hkl-interval-plus-interval" title="hkl_interval_plus_interval ()">hkl_interval_plus_interval</a>          (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *interval</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval-private.html#hkl-interval-sin" title="hkl_interval_sin ()">hkl_interval_sin</a>                    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval-private.html#hkl-interval-tan" title="hkl_interval_tan ()">hkl_interval_tan</a>                    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval-private.html#hkl-interval-times-double" title="hkl_interval_times_double ()">hkl_interval_times_double</a>           (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> const d</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval-private.html#hkl-interval-times-interval" title="hkl_interval_times_interval ()">hkl_interval_times_interval</a>         (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *interval</code></em>);
-</pre>
+<div class="refsect1">
+<a name="hkl-hkl-interval-private.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="returnvalue">HklInterval</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-dup" title="hkl_interval_dup ()">hkl_interval_dup</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-free" title="hkl_interval_free ()">hkl_interval_free</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-cmp" title="hkl_interval_cmp ()">hkl_interval_cmp</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-plus-interval" title="hkl_interval_plus_interval ()">hkl_interval_plus_interval</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-plus-double" title="hkl_interval_plus_double ()">hkl_interval_plus_double</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-minus-interval" title="hkl_interval_minus_interval ()">hkl_interval_minus_interval</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-minus-double" title="hkl_interval_minus_double ()">hkl_interval_minus_double</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-times-interval" title="hkl_interval_times_interval ()">hkl_interval_times_interval</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-times-double" title="hkl_interval_times_double ()">hkl_interval_times_double</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-divides-double" title="hkl_interval_divides_double ()">hkl_interval_divides_double</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-contain-zero" title="hkl_interval_contain_zero ()">hkl_interval_contain_zero</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-cos" title="hkl_interval_cos ()">hkl_interval_cos</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-acos" title="hkl_interval_acos ()">hkl_interval_acos</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-sin" title="hkl_interval_sin ()">hkl_interval_sin</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-asin" title="hkl_interval_asin ()">hkl_interval_asin</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-tan" title="hkl_interval_tan ()">hkl_interval_tan</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-atan" title="hkl_interval_atan ()">hkl_interval_atan</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">double</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-length" title="hkl_interval_length ()">hkl_interval_length</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-interval-private.html#hkl-interval-angle-restrict-symm" title="hkl_interval_angle_restrict_symm ()">hkl_interval_angle_restrict_symm</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-interval-private.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="name">
+<col class="description">
+</colgroup>
+<tbody><tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval">HklInterval</a></td>
+</tr></tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-hkl-interval-private.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-hkl-interval-private.details"></a><h2>Details</h2>
+<a name="hkl-hkl-interval-private.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
-<a name="HklInterval"></a><h3>struct HklInterval</h3>
-<pre class="programlisting">struct HklInterval {
-	double min;
-	double max;
-};
-</pre>
+<a name="hkl-interval-dup"></a><h3>hkl_interval_dup ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="returnvalue">HklInterval</span></a> *
+hkl_interval_dup (<em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
+<p>copy an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a></p>
+<div class="refsect3">
+<a name="id-1.2.14.6.2.5"></a><h4>Returns</h4>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-interval-acos"></a><h3>hkl_interval_acos ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_acos                   (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
-<p>
-compute the arc cosinus of an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
-</p>
+<a name="hkl-interval-free"></a><h3>hkl_interval_free ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_interval_free (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
+<p>delete an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a></p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-interval-angle-restrict-symm"></a><h3>hkl_interval_angle_restrict_symm ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_angle_restrict_symm    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
-<p>
-restrict an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> into -pi, pi
-</p>
+<a name="hkl-interval-cmp"></a><h3>hkl_interval_cmp ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_interval_cmp (<em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+                  <em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *interval</code></em>);</pre>
+<p>compare two intervals</p>
+<div class="refsect3">
+<a name="id-1.2.14.6.4.5"></a><h4>Returns</h4>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-interval-asin"></a><h3>hkl_interval_asin ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_asin                   (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
-<p>
-compute the arc sinus of an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
-</p>
+<a name="hkl-interval-plus-interval"></a><h3>hkl_interval_plus_interval ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_interval_plus_interval (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+                            <em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *interval</code></em>);</pre>
+<p>add two ontervals</p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-interval-atan"></a><h3>hkl_interval_atan ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_atan                   (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
-<p>
-compute the arc tangente of an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
-</p>
+<a name="hkl-interval-plus-double"></a><h3>hkl_interval_plus_double ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_interval_plus_double (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+                          <em class="parameter"><code><span class="type">double</span> const d</code></em>);</pre>
+<p>add to an interval a double</p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-interval-cmp"></a><h3>hkl_interval_cmp ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_interval_cmp                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *interval</code></em>);</pre>
-<p>
-compare two intervals
-</p>
+<a name="hkl-interval-minus-interval"></a><h3>hkl_interval_minus_interval ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_interval_minus_interval (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+                             <em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *interval</code></em>);</pre>
+<p>substract two <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a></p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-interval-contain-zero"></a><h3>hkl_interval_contain_zero ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_interval_contain_zero           (<em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
-<p>
-check if an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> contain zero
-</p>
+<a name="hkl-interval-minus-double"></a><h3>hkl_interval_minus_double ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_interval_minus_double (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+                           <em class="parameter"><code><span class="type">double</span> const d</code></em>);</pre>
+<p>subst a double to an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a></p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-interval-cos"></a><h3>hkl_interval_cos ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_cos                    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
-<p>
-compute the cosinus of an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
-</p>
+<a name="hkl-interval-times-interval"></a><h3>hkl_interval_times_interval ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_interval_times_interval (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+                             <em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *interval</code></em>);</pre>
+<p>multiply two <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a></p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-interval-divides-double"></a><h3>hkl_interval_divides_double ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_divides_double         (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> const d</code></em>);</pre>
-<p>
-divide an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> by a double
-</p>
+<a name="hkl-interval-times-double"></a><h3>hkl_interval_times_double ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_interval_times_double (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+                           <em class="parameter"><code><span class="type">double</span> const d</code></em>);</pre>
+<p>multiply an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> by a double</p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-interval-dup"></a><h3>hkl_interval_dup ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="returnvalue">HklInterval</span></a> *       hkl_interval_dup                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
-<p>
-copy an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
-</p>
+<a name="hkl-interval-divides-double"></a><h3>hkl_interval_divides_double ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_interval_divides_double (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+                             <em class="parameter"><code><span class="type">double</span> const d</code></em>);</pre>
+<p>divide an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> by a double</p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-interval-free"></a><h3>hkl_interval_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_free                   (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
-<p>
-delete an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
-</p>
+<a name="hkl-interval-contain-zero"></a><h3>hkl_interval_contain_zero ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_interval_contain_zero (<em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
+<p>check if an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> contain zero</p>
+<div class="refsect3">
+<a name="id-1.2.14.6.12.5"></a><h4>Returns</h4>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-interval-length"></a><h3>hkl_interval_length ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_interval_length                 (<em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
-<p>
-compute the length of an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
-</p>
+<a name="hkl-interval-cos"></a><h3>hkl_interval_cos ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_interval_cos (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
+<p>compute the cosinus of an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a></p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-interval-minus-double"></a><h3>hkl_interval_minus_double ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_minus_double           (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> const d</code></em>);</pre>
-<p>
-subst a double to an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
-</p>
+<a name="hkl-interval-acos"></a><h3>hkl_interval_acos ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_interval_acos (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
+<p>compute the arc cosinus of an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a></p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-interval-minus-interval"></a><h3>hkl_interval_minus_interval ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_minus_interval         (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *interval</code></em>);</pre>
-<p>
-substract two <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
-</p>
+<a name="hkl-interval-sin"></a><h3>hkl_interval_sin ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_interval_sin (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
+<p>compute the sin of an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a></p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-interval-plus-double"></a><h3>hkl_interval_plus_double ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_plus_double            (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> const d</code></em>);</pre>
-<p>
-add to an interval a double
-</p>
+<a name="hkl-interval-asin"></a><h3>hkl_interval_asin ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_interval_asin (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
+<p>compute the arc sinus of an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a></p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-interval-plus-interval"></a><h3>hkl_interval_plus_interval ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_plus_interval          (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *interval</code></em>);</pre>
-<p>
-add two ontervals
-</p>
+<a name="hkl-interval-tan"></a><h3>hkl_interval_tan ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_interval_tan (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
+<p>compute the tangente of an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a></p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-interval-sin"></a><h3>hkl_interval_sin ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_sin                    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
-<p>
-compute the sin of an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
-</p>
+<a name="hkl-interval-atan"></a><h3>hkl_interval_atan ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_interval_atan (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
+<p>compute the arc tangente of an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a></p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-interval-tan"></a><h3>hkl_interval_tan ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_tan                    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
-<p>
-compute the tangente of an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
-</p>
+<a name="hkl-interval-length"></a><h3>hkl_interval_length ()</h3>
+<pre class="programlisting"><span class="returnvalue">double</span>
+hkl_interval_length (<em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
+<p>compute the length of an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a></p>
+<div class="refsect3">
+<a name="id-1.2.14.6.19.5"></a><h4>Returns</h4>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-interval-times-double"></a><h3>hkl_interval_times_double ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_times_double           (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> const d</code></em>);</pre>
-<p>
-multiply an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> by a double
-</p>
+<a name="hkl-interval-angle-restrict-symm"></a><h3>hkl_interval_angle_restrict_symm ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_interval_angle_restrict_symm (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
+<p>restrict an <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> into -pi, pi</p>
 </div>
-<hr>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-interval-private.other_details"></a><h2>Types and Values</h2>
 <div class="refsect2">
-<a name="hkl-interval-times-interval"></a><h3>hkl_interval_times_interval ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_times_interval         (<em class="parameter"><code><a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *interval</code></em>);</pre>
-<p>
-multiply two <a class="link" href="hkl-hkl-interval-private.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
-</p>
+<a name="HklInterval"></a><h3>struct HklInterval</h3>
+<pre class="programlisting">struct HklInterval {
+	double min;
+	double max;
+};
+</pre>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-lattice-private.html b/Documentation/api/html/hkl-hkl-lattice-private.html
index 5999f1d..f07aa42 100644
--- a/Documentation/api/html/hkl-hkl-lattice-private.html
+++ b/Documentation/api/html/hkl-hkl-lattice-private.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-lattice-private</title>
+<title>hkl Reference Manual: hkl-lattice-private</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-interval-private.html" title="hkl-interval-private">
 <link rel="next" href="hkl-hkl-macros-private.html" title="hkl-macros-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-interval-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-macros-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-lattice-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-lattice-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-lattice-private.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-interval-private.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-macros-private.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-hkl-lattice-private"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,23 +29,131 @@
 <h2><span class="refentrytitle"><a name="hkl-hkl-lattice-private.top_of_page"></a>hkl-lattice-private</span></h2>
 <p>hkl-lattice-private</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-lattice-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-lattice-private.html#HklLattice" title="HklLattice">HklLattice</a>;
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-lattice-private.html#hkl-lattice-fprintf" title="hkl_lattice_fprintf ()">hkl_lattice_fprintf</a>                 (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-lattice-private.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-lattice-private.html#hkl-lattice-lattice-set" title="hkl_lattice_lattice_set ()">hkl_lattice_lattice_set</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-lattice-private.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-lattice-private.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *lattice</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-lattice-private.html#hkl-lattice-randomize" title="hkl_lattice_randomize ()">hkl_lattice_randomize</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-lattice-private.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *self</code></em>);
-</pre>
+<div class="refsect1">
+<a name="hkl-hkl-lattice-private.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="function_type">
+<span class="returnvalue">return</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#g-quark-from-static-string" title="g_quark_from_static_string ()">g_quark_from_static_string</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-lattice-private.html#hkl-lattice-lattice-set" title="hkl_lattice_lattice_set ()">hkl_lattice_lattice_set</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-lattice-private.html#hkl-lattice-randomize" title="hkl_lattice_randomize ()">hkl_lattice_randomize</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-lattice-private.html#hkl-lattice-fprintf" title="hkl_lattice_fprintf ()">hkl_lattice_fprintf</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-lattice-private.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="name">
+<col class="description">
+</colgroup>
+<tbody>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklLattice" title="HklLattice">HklLattice</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-lattice-private.html#HKL-LATTICE-ERROR:CAPS" title="HKL_LATTICE_ERROR">HKL_LATTICE_ERROR</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">enum</td>
+<td class="function_name"><a class="link" href="hkl-hkl-lattice-private.html#HklLatticeError" title="enum HklLatticeError">HklLatticeError</a></td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-hkl-lattice-private.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-hkl-lattice-private.details"></a><h2>Details</h2>
+<a name="hkl-hkl-lattice-private.functions_details"></a><h2>Functions</h2>
+<div class="refsect2">
+<a name="g-quark-from-static-string"></a><h3>g_quark_from_static_string ()</h3>
+<pre class="programlisting"><span class="returnvalue">return</span>
+g_quark_from_static_string ();</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="hkl-lattice-lattice-set"></a><h3>hkl_lattice_lattice_set ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_lattice_lattice_set (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *self</code></em>,
+                         <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *lattice</code></em>);</pre>
+<div class="refsect3">
+<a name="id-1.2.15.6.3.4"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
+</colgroup>
+<tbody>
+<tr>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the this ptr</p></td>
+<td class="parameter_annotations"> </td>
+</tr>
+<tr>
+<td class="parameter_name"><p>lattice</p></td>
+<td class="parameter_description"><p>the lattice to set from.</p></td>
+<td class="parameter_annotations"> </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+</div>
+<hr>
+<div class="refsect2">
+<a name="hkl-lattice-randomize"></a><h3>hkl_lattice_randomize ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_lattice_randomize (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *self</code></em>);</pre>
+<p>randomize the lattice</p>
+</div>
+<hr>
+<div class="refsect2">
+<a name="hkl-lattice-fprintf"></a><h3>hkl_lattice_fprintf ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_lattice_fprintf (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
+                     <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *self</code></em>);</pre>
+<p>print into a file the lattice.</p>
+</div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-lattice-private.other_details"></a><h2>Types and Values</h2>
 <div class="refsect2">
 <a name="HklLattice"></a><h3>HklLattice</h3>
 <pre class="programlisting">typedef struct {
@@ -64,47 +168,33 @@
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-lattice-fprintf"></a><h3>hkl_lattice_fprintf ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_lattice_fprintf                 (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-lattice-private.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *self</code></em>);</pre>
-<p>
-print into a file the lattice.
-</p>
+<a name="HKL-LATTICE-ERROR:CAPS"></a><h3>HKL_LATTICE_ERROR</h3>
+<pre class="programlisting">#define HKL_LATTICE_ERROR hkl_lattice_error_quark ()
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-lattice-lattice-set"></a><h3>hkl_lattice_lattice_set ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_lattice_lattice_set             (<em class="parameter"><code><a class="link" href="hkl-hkl-lattice-private.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-lattice-private.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *lattice</code></em>);</pre>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="HklLatticeError"></a><h3>enum HklLatticeError</h3>
+<div class="refsect3">
+<a name="id-1.2.15.7.4.3"></a><h4>Members</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="300px" class="enum_members_name">
+<col class="enum_members_description">
+<col width="200px" class="enum_members_annotations">
 </colgroup>
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the this ptr</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>lattice</code></em> :</span></p></td>
-<td>the lattice to set from.</td>
-</tr>
-</tbody>
+<tbody><tr>
+<td class="enum_member_name"><p><a name="HKL-LATTICE-CHECK-LATTICE:CAPS"></a>HKL_LATTICE_CHECK_LATTICE</p></td>
+<td> </td>
+<td> </td>
+</tr></tbody>
 </table></div>
 </div>
-<hr>
-<div class="refsect2">
-<a name="hkl-lattice-randomize"></a><h3>hkl_lattice_randomize ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_lattice_randomize               (<em class="parameter"><code><a class="link" href="hkl-hkl-lattice-private.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *self</code></em>);</pre>
-<p>
-randomize the lattice
-</p>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-macros-private.html b/Documentation/api/html/hkl-hkl-macros-private.html
index be9670d..b1c020d 100644
--- a/Documentation/api/html/hkl-hkl-macros-private.html
+++ b/Documentation/api/html/hkl-hkl-macros-private.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-macros-private</title>
+<title>hkl Reference Manual: hkl-macros-private</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-lattice-private.html" title="hkl-lattice-private">
 <link rel="next" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-lattice-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-matrix-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-macros-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-macros-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-macros-private.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-lattice-private.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-matrix-private.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-hkl-macros-private"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,33 +29,102 @@
 <h2><span class="refentrytitle"><a name="hkl-hkl-macros-private.top_of_page"></a>hkl-macros-private</span></h2>
 <p>hkl-macros-private</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-macros-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">#define             <a class="link" href="hkl-hkl-macros-private.html#ALLOC-GROW:CAPS" title="ALLOC_GROW()">ALLOC_GROW</a>                          (x,
-                                                         nr,
-                                                         alloc)
-#define             <a class="link" href="hkl-hkl-macros-private.html#G-GNUC-PRINTF:CAPS" title="G_GNUC_PRINTF()">G_GNUC_PRINTF</a>                       (format_idx,
-                                                         arg_idx)
-#define             <a class="link" href="hkl-hkl-macros-private.html#HKL-EULERIAN-KAPPA-SOLUTION:CAPS" title="HKL_EULERIAN_KAPPA_SOLUTION">HKL_EULERIAN_KAPPA_SOLUTION</a>
-#define             <a class="link" href="hkl-hkl-macros-private.html#HKL-MALLOC:CAPS" title="HKL_MALLOC()">HKL_MALLOC</a>                          (type)
-#define             <a class="link" href="hkl-compiler.html#NORETURN:CAPS" title="NORETURN">NORETURN</a>
-#define             <a class="link" href="hkl-hkl-macros-private.html#alloc-nr" title="alloc_nr()">alloc_nr</a>                            (x)
-#define             <a class="link" href="hkl-hkl-macros-private.html#hkl-assert" title="hkl_assert()">hkl_assert</a>                          (x)
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-macros-private.html#hkl-printbt" title="hkl_printbt ()">hkl_printbt</a>                         (<em class="parameter"><code><span class="type">void</span></code></em>);
-#define             <a class="link" href="hkl-hkl-macros-private.html#hkl-return-val-if-fail" title="hkl_return_val_if_fail()">hkl_return_val_if_fail</a>              (expr,
-                                                         val)
-</pre>
+<div class="refsect1">
+<a name="hkl-hkl-macros-private.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-macros-private.html#hkl-assert" title="hkl_assert()">hkl_assert</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-macros-private.html#hkl-error" title="hkl_error()">hkl_error</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-macros-private.html#G-GNUC-PRINTF:CAPS" title="G_GNUC_PRINTF()">G_GNUC_PRINTF</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-macros-private.html#alloc-nr" title="alloc_nr()">alloc_nr</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-macros-private.html#ALLOC-GROW:CAPS" title="ALLOC_GROW()">ALLOC_GROW</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-macros-private.html#DARRAY:CAPS" title="DARRAY()">DARRAY</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-macros-private.html#hkl-printbt" title="hkl_printbt ()">hkl_printbt</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-macros-private.html#HKL-MALLOC:CAPS" title="HKL_MALLOC()">HKL_MALLOC</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-macros-private.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="name">
+<col class="description">
+</colgroup>
+<tbody>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-macros-private.html#HKL-EULERIAN-KAPPA-SOLUTION:CAPS" title="HKL_EULERIAN_KAPPA_SOLUTION">HKL_EULERIAN_KAPPA_SOLUTION</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-compiler.html#NORETURN:CAPS" title="NORETURN">NORETURN</a></td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-hkl-macros-private.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-hkl-macros-private.details"></a><h2>Details</h2>
+<a name="hkl-hkl-macros-private.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
-<a name="ALLOC-GROW:CAPS"></a><h3>ALLOC_GROW()</h3>
-<pre class="programlisting">#define             ALLOC_GROW(x, nr, alloc)</pre>
+<a name="hkl-assert"></a><h3>hkl_assert()</h3>
+<pre class="programlisting"># define hkl_assert(x) do{ if (!(x)) {hkl_printbt(); assert(x); } } while(0)
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="hkl-error"></a><h3>hkl_error()</h3>
+<pre class="programlisting">#define             hkl_error(expr)</pre>
 </div>
 <hr>
 <div class="refsect2">
@@ -68,48 +133,50 @@
 </div>
 <hr>
 <div class="refsect2">
-<a name="HKL-EULERIAN-KAPPA-SOLUTION:CAPS"></a><h3>HKL_EULERIAN_KAPPA_SOLUTION</h3>
-<pre class="programlisting">#define HKL_EULERIAN_KAPPA_SOLUTION 1
+<a name="alloc-nr"></a><h3>alloc_nr()</h3>
+<pre class="programlisting">#define alloc_nr(x) (((x)+16)*3/2)
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="HKL-MALLOC:CAPS"></a><h3>HKL_MALLOC()</h3>
-<pre class="programlisting">#define HKL_MALLOC(type) (type *)_hkl_malloc(sizeof(type), "Can not allocate memory for a " #type)
-</pre>
+<a name="ALLOC-GROW:CAPS"></a><h3>ALLOC_GROW()</h3>
+<pre class="programlisting">#define             ALLOC_GROW(x, nr, alloc)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="NORETURN:CAPS"></a><h3>NORETURN</h3>
-<pre class="programlisting">#define             NORETURN</pre>
+<a name="DARRAY:CAPS"></a><h3>DARRAY()</h3>
+<pre class="programlisting">#define DARRAY(_items) {.item=_items, .size=ARRAY_SIZE(_items), .alloc=ARRAY_SIZE(_items)}
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="alloc-nr"></a><h3>alloc_nr()</h3>
-<pre class="programlisting">#define alloc_nr(x) (((x)+16)*3/2)
-</pre>
+<a name="hkl-printbt"></a><h3>hkl_printbt ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_printbt (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-assert"></a><h3>hkl_assert()</h3>
-<pre class="programlisting"># define hkl_assert(x) do{ if (!(x)) {hkl_printbt(); assert(x); } } while(0)
+<a name="HKL-MALLOC:CAPS"></a><h3>HKL_MALLOC()</h3>
+<pre class="programlisting">#define HKL_MALLOC(type) (type *)_hkl_malloc(sizeof(type), "Can not allocate memory for a " #type)
 </pre>
 </div>
-<hr>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-macros-private.other_details"></a><h2>Types and Values</h2>
 <div class="refsect2">
-<a name="hkl-printbt"></a><h3>hkl_printbt ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_printbt                         (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
+<a name="HKL-EULERIAN-KAPPA-SOLUTION:CAPS"></a><h3>HKL_EULERIAN_KAPPA_SOLUTION</h3>
+<pre class="programlisting">#define HKL_EULERIAN_KAPPA_SOLUTION 1
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-return-val-if-fail"></a><h3>hkl_return_val_if_fail()</h3>
-<pre class="programlisting">#define hkl_return_val_if_fail(expr, val) if (expr) { } else return val
-</pre>
+<a name="NORETURN:CAPS"></a><h3>NORETURN</h3>
+<pre class="programlisting">#define             NORETURN</pre>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-matrix-private.html b/Documentation/api/html/hkl-hkl-matrix-private.html
index 6164e22..7cf0075 100644
--- a/Documentation/api/html/hkl-hkl-matrix-private.html
+++ b/Documentation/api/html/hkl-hkl-matrix-private.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-matrix-private</title>
+<title>hkl Reference Manual: hkl-matrix-private</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-macros-private.html" title="hkl-macros-private">
 <link rel="next" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-macros-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-parameter-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-matrix-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-matrix-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-matrix-private.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-macros-private.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-parameter-private.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-hkl-matrix-private"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,338 +29,479 @@
 <h2><span class="refentrytitle"><a name="hkl-hkl-matrix-private.top_of_page"></a>hkl-matrix-private</span></h2>
 <p>hkl-matrix-private</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-matrix-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix">HklMatrix</a>;
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-det" title="hkl_matrix_det ()">hkl_matrix_det</a>                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);
-<a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="returnvalue">HklMatrix</span></a> *         <a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-dup" title="hkl_matrix_dup ()">hkl_matrix_dup</a>                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-fprintf" title="hkl_matrix_fprintf ()">hkl_matrix_fprintf</a>                  (<em class="parameter"><code><span class="type">FILE</span> *file</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-init-from-euler" title="hkl_matrix_init_from_euler ()">hkl_matrix_init_from_euler</a>          (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> euler_x</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> euler_y</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-init-from-two-vector" title="hkl_matrix_init_from_two_vector ()">hkl_matrix_init_from_two_vector</a>     (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v1</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v2</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-is-null" title="hkl_matrix_is_null ()">hkl_matrix_is_null</a>                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-matrix-set" title="hkl_matrix_matrix_set ()">hkl_matrix_matrix_set</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-solve" title="hkl_matrix_solve ()">hkl_matrix_solve</a>                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *x</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *b</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-times-vector" title="hkl_matrix_times_vector ()">hkl_matrix_times_vector</a>             (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-to-euler" title="hkl_matrix_to_euler ()">hkl_matrix_to_euler</a>                 (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> *euler_x</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> *euler_y</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> *euler_z</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-transpose" title="hkl_matrix_transpose ()">hkl_matrix_transpose</a>                (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);
-</pre>
-</div>
 <div class="refsect1">
-<a name="hkl-hkl-matrix-private.description"></a><h2>Description</h2>
-</div>
-<div class="refsect1">
-<a name="hkl-hkl-matrix-private.details"></a><h2>Details</h2>
-<div class="refsect2">
-<a name="HklMatrix"></a><h3>HklMatrix</h3>
-<pre class="programlisting">typedef struct {
-	double data[3][3];
-} HklMatrix;
-</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-matrix-det"></a><h3>hkl_matrix_det ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_matrix_det                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);</pre>
-<p>
-compute the determinant of an <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a>
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-hkl-matrix-private.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="functions_return">
+<col class="functions_name">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> use to compute the determinant</td>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="returnvalue">HklMatrix</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-dup" title="hkl_matrix_dup ()">hkl_matrix_dup</a> <span class="c_punctuation">()</span>
+</td>
 </tr>
 <tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>the determinant of the self <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a>
-Todo: test</td>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-init-from-euler" title="hkl_matrix_init_from_euler ()">hkl_matrix_init_from_euler</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-matrix-set" title="hkl_matrix_matrix_set ()">hkl_matrix_matrix_set</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-init-from-two-vector" title="hkl_matrix_init_from_two_vector ()">hkl_matrix_init_from_two_vector</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-fprintf" title="hkl_matrix_fprintf ()">hkl_matrix_fprintf</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-to-euler" title="hkl_matrix_to_euler ()">hkl_matrix_to_euler</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-times-vector" title="hkl_matrix_times_vector ()">hkl_matrix_times_vector</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-transpose" title="hkl_matrix_transpose ()">hkl_matrix_transpose</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">double</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-det" title="hkl_matrix_det ()">hkl_matrix_det</a> <span class="c_punctuation">()</span>
+</td>
 </tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-matrix-dup"></a><h3>hkl_matrix_dup ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="returnvalue">HklMatrix</span></a> *         hkl_matrix_dup                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-matrix-fprintf"></a><h3>hkl_matrix_fprintf ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_matrix_fprintf                  (<em class="parameter"><code><span class="type">FILE</span> *file</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);</pre>
-<p>
-printf an <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> into a FILE stream.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>file</code></em> :</span></p></td>
-<td>the FILE stream</td>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-solve" title="hkl_matrix_solve ()">hkl_matrix_solve</a> <span class="c_punctuation">()</span>
+</td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> to print into the file stream</td>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-matrix-private.html#hkl-matrix-is-null" title="hkl_matrix_is_null ()">hkl_matrix_is_null</a> <span class="c_punctuation">()</span>
+</td>
 </tr>
 </tbody>
 </table></div>
 </div>
+<div class="refsect1">
+<a name="hkl-hkl-matrix-private.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="name">
+<col class="description">
+</colgroup>
+<tbody><tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix">HklMatrix</a></td>
+</tr></tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-matrix-private.description"></a><h2>Description</h2>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-matrix-private.functions_details"></a><h2>Functions</h2>
+<div class="refsect2">
+<a name="hkl-matrix-dup"></a><h3>hkl_matrix_dup ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="returnvalue">HklMatrix</span></a> *
+hkl_matrix_dup (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);</pre>
+<div class="refsect3">
+<a name="id-1.2.17.6.2.4"></a><h4>Returns</h4>
+<p></p>
+</div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-matrix-init-from-euler"></a><h3>hkl_matrix_init_from_euler ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_matrix_init_from_euler          (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> euler_x</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> euler_y</code></em>);</pre>
-<p>
-Create a rotation <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> from three eulerians angles.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-matrix-init-from-euler"></a><h3>hkl_matrix_init_from_euler ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_matrix_init_from_euler (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
+                            <em class="parameter"><code><span class="type">double</span> euler_x</code></em>,
+                            <em class="parameter"><code><span class="type">double</span> euler_y</code></em>);</pre>
+<p>Create a rotation <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> from three eulerians angles.</p>
+<div class="refsect3">
+<a name="id-1.2.17.6.3.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> to initialize</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> to initialize</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>euler_x</code></em> :</span></p></td>
-<td>the eulerian value along X</td>
+<td class="parameter_name"><p>euler_x</p></td>
+<td class="parameter_description"><p>the eulerian value along X</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>euler_y</code></em> :</span></p></td>
-<td>the eulerian value along Y</td>
+<td class="parameter_name"><p>euler_y</p></td>
+<td class="parameter_description"><p>the eulerian value along Y</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>euler_z</code></em> :</span></p></td>
-<td>the eulerian value along Z</td>
+<td class="parameter_name"><p>euler_z</p></td>
+<td class="parameter_description"><p>the eulerian value along Z</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-matrix-init-from-two-vector"></a><h3>hkl_matrix_init_from_two_vector ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_matrix_init_from_two_vector     (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v1</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v2</code></em>);</pre>
-<p>
-Create an <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> which represent a direct oriented base of the space
-the first row correspond to the |v1|, the second row |v2| and the last one
-is |v1 ^ v2|
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-matrix-matrix-set"></a><h3>hkl_matrix_matrix_set ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_matrix_matrix_set (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);</pre>
+<p><em class="parameter"><code>todo</code></em>
+ test</p>
+<div class="refsect3">
+<a name="id-1.2.17.6.4.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>The <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> to initialize</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>v1</code></em> :</span></p></td>
-<td>the first <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the this ptr</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>v2</code></em> :</span></p></td>
-<td>the second <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</td>
+<td class="parameter_name"><p>m</p></td>
+<td class="parameter_description"><p>the matrix to set</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-matrix-is-null"></a><h3>hkl_matrix_is_null ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_matrix_is_null                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);</pre>
-<p>
-is all <span class="type">hklMatrix</span> elementes bellow <a href="hkl-hkl-macros.html#HKL-EPSILON:CAPS"><span class="type">HKL_EPSILON</span></a>
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-matrix-init-from-two-vector"></a><h3>hkl_matrix_init_from_two_vector ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_matrix_init_from_two_vector (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
+                                 <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v1</code></em>,
+                                 <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v2</code></em>);</pre>
+<p>Create an <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> which represent a direct oriented base of the space
+the first row correspond to the |v1|, the second row |v2| and the last one
+is |v1 ^ v2|</p>
+<div class="refsect3">
+<a name="id-1.2.17.6.5.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> to test</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>The <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> to initialize</p></td>
+<td class="parameter_annotations"> </td>
+</tr>
+<tr>
+<td class="parameter_name"><p>v1</p></td>
+<td class="parameter_description"><p>the first <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>HKL_TRUE if the self <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> is null
-Todo: test</td>
+<td class="parameter_name"><p>v2</p></td>
+<td class="parameter_description"><p>the second <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-matrix-matrix-set"></a><h3>hkl_matrix_matrix_set ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_matrix_matrix_set               (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);</pre>
-<p>
-<em class="parameter"><code>todo</code></em> test
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-matrix-fprintf"></a><h3>hkl_matrix_fprintf ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_matrix_fprintf (<em class="parameter"><code><span class="type">FILE</span> *file</code></em>,
+                    <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);</pre>
+<p>printf an <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> into a FILE stream.</p>
+<div class="refsect3">
+<a name="id-1.2.17.6.6.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the this ptr</td>
+<td class="parameter_name"><p>file</p></td>
+<td class="parameter_description"><p>the FILE stream</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>m</code></em> :</span></p></td>
-<td>the matrix to set</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> to print into the file stream</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-matrix-solve"></a><h3>hkl_matrix_solve ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_matrix_solve                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *x</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *b</code></em>);</pre>
-<p>
-solve the system self . X = b
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-matrix-to-euler"></a><h3>hkl_matrix_to_euler ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_matrix_to_euler (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
+                     <em class="parameter"><code><span class="type">double</span> *euler_x</code></em>,
+                     <em class="parameter"><code><span class="type">double</span> *euler_y</code></em>,
+                     <em class="parameter"><code><span class="type">double</span> *euler_z</code></em>);</pre>
+<p>compute the three eulerians values for a given rotation <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a></p>
+<div class="refsect3">
+<a name="id-1.2.17.6.7.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>The <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> of the system</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the rotation <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> use to compute the eulerians angles</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to compute.</td>
+<td class="parameter_name"><p>euler_x</p></td>
+<td class="parameter_description"><p>the eulerian value along X</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>b</code></em> :</span></p></td>
-<td>the <span class="type">hklVector</span> of the system to solve.</td>
+<td class="parameter_name"><p>euler_y</p></td>
+<td class="parameter_description"><p>the eulerian value along Y</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>-1 if the système has no solution, 0 otherwise.
-Todo: test</td>
+<td class="parameter_name"><p>euler_z</p></td>
+<td class="parameter_description"><p>the eulerian value along Z</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-matrix-times-vector"></a><h3>hkl_matrix_times_vector ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_matrix_times_vector             (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v</code></em>);</pre>
-<p>
-multiply an <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> by an <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a>
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-matrix-times-vector"></a><h3>hkl_matrix_times_vector ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_matrix_times_vector (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
+                         <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v</code></em>);</pre>
+<p>multiply an <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> by an <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a></p>
+<div class="refsect3">
+<a name="id-1.2.17.6.8.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> use to multiply the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> use to multiply the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>v</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> multiply by the <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a>
-</td>
+<td class="parameter_name"><p>v</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> multiply by the <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-matrix-to-euler"></a><h3>hkl_matrix_to_euler ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_matrix_to_euler                 (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> *euler_x</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> *euler_y</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> *euler_z</code></em>);</pre>
-<p>
-compute the three eulerians values for a given rotation <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a>
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-matrix-transpose"></a><h3>hkl_matrix_transpose ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_matrix_transpose (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);</pre>
+<p>transpose an <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a></p>
+<div class="refsect3">
+<a name="id-1.2.17.6.9.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
+</colgroup>
+<tbody><tr>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> to transpose</p></td>
+<td class="parameter_annotations"> </td>
+</tr></tbody>
+</table></div>
+</div>
+</div>
+<hr>
+<div class="refsect2">
+<a name="hkl-matrix-det"></a><h3>hkl_matrix_det ()</h3>
+<pre class="programlisting"><span class="returnvalue">double</span>
+hkl_matrix_det (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);</pre>
+<p>compute the determinant of an <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a></p>
+<div class="refsect3">
+<a name="id-1.2.17.6.10.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
+</colgroup>
+<tbody><tr>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> use to compute the determinant</p></td>
+<td class="parameter_annotations"> </td>
+</tr></tbody>
+</table></div>
+</div>
+<div class="refsect3">
+<a name="id-1.2.17.6.10.6"></a><h4>Returns</h4>
+<p> the determinant of the self <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a>
+Todo: test</p>
+<p></p>
+</div>
+</div>
+<hr>
+<div class="refsect2">
+<a name="hkl-matrix-solve"></a><h3>hkl_matrix_solve ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_matrix_solve (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
+                  <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *x</code></em>,
+                  <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *b</code></em>);</pre>
+<p>solve the system self . X = b</p>
+<div class="refsect3">
+<a name="id-1.2.17.6.11.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the rotation <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> use to compute the eulerians angles</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>The <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> of the system</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>euler_x</code></em> :</span></p></td>
-<td>the eulerian value along X</td>
+<td class="parameter_name"><p>x</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to compute.</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>euler_y</code></em> :</span></p></td>
-<td>the eulerian value along Y</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>euler_z</code></em> :</span></p></td>
-<td>the eulerian value along Z</td>
+<td class="parameter_name"><p>b</p></td>
+<td class="parameter_description"><p>the <span class="type">hklVector</span> of the system to solve.</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+<div class="refsect3">
+<a name="id-1.2.17.6.11.6"></a><h4>Returns</h4>
+<p> -1 if the système has no solution, 0 otherwise.
+Todo: test</p>
+<p></p>
+</div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-matrix-transpose"></a><h3>hkl_matrix_transpose ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_matrix_transpose                (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);</pre>
-<p>
-transpose an <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a>
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-matrix-is-null"></a><h3>hkl_matrix_is_null ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_matrix_is_null (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);</pre>
+<p>is all <span class="type">hklMatrix</span> elementes bellow <a class="link" href="hkl-hkl.html#HKL-EPSILON:CAPS" title="HKL_EPSILON"><span class="type">HKL_EPSILON</span></a></p>
+<div class="refsect3">
+<a name="id-1.2.17.6.12.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> to transpose</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> to test</p></td>
+<td class="parameter_annotations"> </td>
 </tr></tbody>
 </table></div>
 </div>
+<div class="refsect3">
+<a name="id-1.2.17.6.12.6"></a><h4>Returns</h4>
+<p> TRUE if the self <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> is null
+Todo: test</p>
+<p></p>
+</div>
+</div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-matrix-private.other_details"></a><h2>Types and Values</h2>
+<div class="refsect2">
+<a name="HklMatrix"></a><h3>HklMatrix</h3>
+<pre class="programlisting">typedef struct {
+	double data[3][3];
+} HklMatrix;
+</pre>
+</div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-parameter-private.html b/Documentation/api/html/hkl-hkl-parameter-private.html
index 9ca65bd..c693501 100644
--- a/Documentation/api/html/hkl-hkl-parameter-private.html
+++ b/Documentation/api/html/hkl-hkl-parameter-private.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-parameter-private</title>
+<title>hkl Reference Manual: hkl-parameter-private</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-matrix-private.html" title="hkl-matrix-private">
 <link rel="next" href="hkl-hkl-pseudoaxis-auto-private.html" title="hkl-pseudoaxis-auto-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-matrix-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-pseudoaxis-auto-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-parameter-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-parameter-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-parameter-private.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-matrix-private.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-pseudoaxis-auto-private.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-hkl-parameter-private"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,319 +29,398 @@
 <h2><span class="refentrytitle"><a name="hkl-hkl-parameter-private.top_of_page"></a>hkl-parameter-private</span></h2>
 <p>hkl-parameter-private</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-parameter-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">#define             <a class="link" href="hkl-hkl-parameter-private.html#HKL-PARAMETER-DEFAULTS:CAPS" title="HKL_PARAMETER_DEFAULTS">HKL_PARAMETER_DEFAULTS</a>
-#define             <a class="link" href="hkl-hkl-parameter-private.html#HKL-PARAMETER-DEFAULTS-ANGLE:CAPS" title="HKL_PARAMETER_DEFAULTS_ANGLE">HKL_PARAMETER_DEFAULTS_ANGLE</a>
-#define             <a class="link" href="hkl-hkl-parameter-private.html#HKL-PARAMETER-OPERATIONS-DEFAULTS:CAPS" title="HKL_PARAMETER_OPERATIONS_DEFAULTS">HKL_PARAMETER_OPERATIONS_DEFAULTS</a>
-                    <a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter">HklParameter</a>;
-struct              <a class="link" href="hkl-hkl-parameter-private.html#HklParameterOperations" title="struct HklParameterOperations">HklParameterOperations</a>;
-double              <a class="link" href="hkl-hkl-parameter-private.html#alea" title="alea">alea</a>;
-HklParameter *      <a class="link" href="hkl-hkl-parameter-private.html#dup" title="dup">dup</a>;
-double              <a class="link" href="hkl-hkl-parameter-private.html#factor" title="factor">factor</a>;
-<span class="returnvalue">else</span>                <a class="link" href="hkl-hkl-parameter-private.html#fprintf" title="fprintf ()">fprintf</a>                             (<em class="parameter"><code><span class="type">f</span> Param1</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-fprintf" title="hkl_parameter_fprintf ()">hkl_parameter_fprintf</a>               (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-init-copy" title="hkl_parameter_init_copy ()">hkl_parameter_init_copy</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *src</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-is-valid" title="hkl_parameter_is_valid ()">hkl_parameter_is_valid</a>              (<em class="parameter"><code>const <a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-list-fprintf" title="hkl_parameter_list_fprintf ()">hkl_parameter_list_fprintf</a>          (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">HklParameterList</span> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-list-free" title="hkl_parameter_list_free ()">hkl_parameter_list_free</a>             (<em class="parameter"><code><span class="type">HklParameterList</span> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-list-values-get" title="hkl_parameter_list_values_get ()">hkl_parameter_list_values_get</a>       (<em class="parameter"><code>const <span class="type">HklParameterList</span> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> values[]</code></em>,
-                                                         <em class="parameter"><code>unsigned <span class="type">int</span> *len</code></em>);
-unsigned <span class="returnvalue">int</span>        <a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-list-values-unit-set" title="hkl_parameter_list_values_unit_set ()">hkl_parameter_list_values_unit_set</a>  (<em class="parameter"><code><span class="type">HklParameterList</span> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> values[]</code></em>,
-                                                         <em class="parameter"><code>unsigned <span class="type">int</span> len</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);
-<a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *      <a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-new" title="hkl_parameter_new ()">hkl_parameter_new</a>                   (<em class="parameter"><code>const <span class="type">char</span> *name</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> min</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> value</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> max</code></em>,
-                                                         <em class="parameter"><code><span class="type">int</span> fit</code></em>,
-                                                         <em class="parameter"><code><span class="type">int</span> changed</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *unit</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *punit</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-value-get-closest" title="hkl_parameter_value_get_closest ()">hkl_parameter_value_get_closest</a>     (<em class="parameter"><code>const <a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *ref</code></em>);
-<span class="returnvalue">return</span>              <a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-value-set-real" title="hkl_parameter_value_set_real ()">hkl_parameter_value_set_real</a>        (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#self" title="self"><span class="type">self</span></a> Param1</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-value-set-smallest-in-range" title="hkl_parameter_value_set_smallest_in_range ()">hkl_parameter_value_set_smallest_in_range</a>
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>);
-</pre>
-</div>
 <div class="refsect1">
-<a name="hkl-hkl-parameter-private.description"></a><h2>Description</h2>
+<a name="hkl-hkl-parameter-private.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="function_type">
+<span class="returnvalue">return</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#g-quark-from-static-string" title="g_quark_from_static_string ()">g_quark_from_static_string</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">else</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-parameter-private.html#fprintf" title="fprintf ()">fprintf</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-new" title="hkl_parameter_new ()">hkl_parameter_new</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-init-copy" title="hkl_parameter_init_copy ()">hkl_parameter_init_copy</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">double</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-value-get-closest" title="hkl_parameter_value_get_closest ()">hkl_parameter_value_get_closest</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-value-set-smallest-in-range" title="hkl_parameter_value_set_smallest_in_range ()">hkl_parameter_value_set_smallest_in_range</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-is-valid" title="hkl_parameter_is_valid ()">hkl_parameter_is_valid</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-parameter-private.html#hkl-parameter-fprintf" title="hkl_parameter_fprintf ()">hkl_parameter_fprintf</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
-<a name="hkl-hkl-parameter-private.details"></a><h2>Details</h2>
-<div class="refsect2">
-<a name="HKL-PARAMETER-DEFAULTS:CAPS"></a><h3>HKL_PARAMETER_DEFAULTS</h3>
-<pre class="programlisting">#define HKL_PARAMETER_DEFAULTS .name="dummy", .range={.min=0, .max=0}, ._value=0, .unit=NULL, .punit=NULL, .fit=HKL_TRUE, .changed=HKL_TRUE, .ops = &hkl_parameter_operations_defaults
-</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="HKL-PARAMETER-DEFAULTS-ANGLE:CAPS"></a><h3>HKL_PARAMETER_DEFAULTS_ANGLE</h3>
-<pre class="programlisting">#define HKL_PARAMETER_DEFAULTS_ANGLE HKL_PARAMETER_DEFAULTS, .range={.min=-M_PI, .max=M_PI}, .unit = &hkl_unit_angle_rad, .punit = &hkl_unit_angle_deg
-</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="HKL-PARAMETER-OPERATIONS-DEFAULTS:CAPS"></a><h3>HKL_PARAMETER_OPERATIONS_DEFAULTS</h3>
-<pre class="programlisting">#define             HKL_PARAMETER_OPERATIONS_DEFAULTS</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="HklParameter"></a><h3>HklParameter</h3>
-<pre class="programlisting">typedef struct {
-	const char *name;
-	HklInterval range;
-	double _value;
-	const HklUnit *unit;
-	const HklUnit *punit;
-	int fit;
-	int changed;
-	const HklParameterOperations *ops;
-} HklParameter;
-</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="HklParameterOperations"></a><h3>struct HklParameterOperations</h3>
-<pre class="programlisting">struct HklParameterOperations {
-	HklParameter * (*copy)(const HklParameter *self);
-	void           (*free)(HklParameter *self);
-	void           (*init_copy)(HklParameter *self, const HklParameter *src);
-	double         (*get_value_closest)(const HklParameter *self,
-				    const HklParameter *other);
-	unsigned int   (*set_value)(HklParameter *self, double value,
-				  HklError **error);
-	unsigned int   (*set_value_unit)(HklParameter *self, double value,
-				       HklError **error);
-	void           (*set_value_smallest_in_range)(HklParameter *self);
-	void           (*randomize)(HklParameter *self);
-	int            (*is_valid)(const HklParameter *self);
-	void           (*fprintf)(FILE *f, const HklParameter *self);
-};
-</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="alea"></a><h3>alea</h3>
-<pre class="programlisting">		double alea = (double)rand() / (RAND_MAX + 1.);
-</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="dup"></a><h3>dup</h3>
-<pre class="programlisting">	HklParameter *dup = HKL_MALLOC(HklParameter);
-</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="factor"></a><h3>factor</h3>
-<pre class="programlisting">	double factor = hkl_unit_factor(self->unit, self->punit);
-</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="fprintf"></a><h3>fprintf ()</h3>
-<pre class="programlisting"><span class="returnvalue">else</span>                fprintf                             (<em class="parameter"><code><span class="type">f</span> Param1</code></em>);</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-parameter-fprintf"></a><h3>hkl_parameter_fprintf ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_parameter_fprintf               (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>);</pre>
-<p>
-print into the <span class="type">FILE</span> f an <a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a>
-</p>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-parameter-init-copy"></a><h3>hkl_parameter_init_copy ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_parameter_init_copy             (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *src</code></em>);</pre>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-hkl-parameter-private.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="name">
+<col class="description">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the this ptr</td>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter">HklParameter</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-parameter-private.html#HKL-PARAMETER-DEFAULTS:CAPS" title="HKL_PARAMETER_DEFAULTS">HKL_PARAMETER_DEFAULTS</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-parameter-private.html#HKL-PARAMETER-DEFAULTS-ANGLE:CAPS" title="HKL_PARAMETER_DEFAULTS_ANGLE">HKL_PARAMETER_DEFAULTS_ANGLE</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-parameter-private.html#HKL-PARAMETER-ERROR:CAPS" title="HKL_PARAMETER_ERROR">HKL_PARAMETER_ERROR</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">enum</td>
+<td class="function_name"><a class="link" href="hkl-hkl-parameter-private.html#HklParameterError" title="enum HklParameterError">HklParameterError</a></td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
-<td>the parameter to copy from</td>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl-parameter-private.html#HklParameterOperations" title="struct HklParameterOperations">HklParameterOperations</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-parameter-private.html#HKL-PARAMETER-OPERATIONS-DEFAULTS:CAPS" title="HKL_PARAMETER_OPERATIONS_DEFAULTS">HKL_PARAMETER_OPERATIONS_DEFAULTS</a></td>
+</tr>
+<tr>
+<td class="variable_type">HklParameter *</td>
+<td class="function_name"><a class="link" href="hkl-hkl-parameter-private.html#dup" title="dup">dup</a></td>
+</tr>
+<tr>
+<td class="variable_type">double </td>
+<td class="function_name"><a class="link" href="hkl-hkl-parameter-private.html#alea" title="alea">alea</a></td>
+</tr>
+<tr>
+<td class="variable_type">double </td>
+<td class="function_name"><a class="link" href="hkl-hkl-parameter-private.html#factor" title="factor">factor</a></td>
+</tr>
+<tr>
+<td class="typedef_keyword">typedef</td>
+<td class="function_name"><a class="link" href="hkl-hkl-parameter-private.html#darray-parameter" title="darray_parameter">darray_parameter</a></td>
 </tr>
 </tbody>
 </table></div>
 </div>
-<hr>
+<div class="refsect1">
+<a name="hkl-hkl-parameter-private.description"></a><h2>Description</h2>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-parameter-private.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
-<a name="hkl-parameter-is-valid"></a><h3>hkl_parameter_is_valid ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_parameter_is_valid              (<em class="parameter"><code>const <a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>);</pre>
-<p>
-check if the value of the <a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> is in the min,max range
-</p>
+<a name="g-quark-from-static-string"></a><h3>g_quark_from_static_string ()</h3>
+<pre class="programlisting"><span class="returnvalue">return</span>
+g_quark_from_static_string ();</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-parameter-list-fprintf"></a><h3>hkl_parameter_list_fprintf ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_parameter_list_fprintf          (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">HklParameterList</span> *self</code></em>);</pre>
+<a name="fprintf"></a><h3>fprintf ()</h3>
+<pre class="programlisting"><span class="returnvalue">else</span>
+fprintf (<em class="parameter"><code><span class="type">f</span> Param1</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-parameter-list-free"></a><h3>hkl_parameter_list_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_parameter_list_free             (<em class="parameter"><code><span class="type">HklParameterList</span> *self</code></em>);</pre>
+<a name="hkl-parameter-new"></a><h3>hkl_parameter_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *
+hkl_parameter_new (<em class="parameter"><code>const <span class="type">char</span> *name</code></em>,
+                   <em class="parameter"><code>const <span class="type">char</span> *description</code></em>,
+                   <em class="parameter"><code><span class="type">double</span> min</code></em>,
+                   <em class="parameter"><code><span class="type">double</span> value</code></em>,
+                   <em class="parameter"><code><span class="type">double</span> max</code></em>,
+                   <em class="parameter"><code><span class="type">int</span> fit</code></em>,
+                   <em class="parameter"><code><span class="type">int</span> changed</code></em>,
+                   <em class="parameter"><code>const <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *unit</code></em>,
+                   <em class="parameter"><code>const <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *punit</code></em>);</pre>
+<p>create a new <a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a></p>
+<div class="refsect3">
+<a name="id-1.2.18.6.4.5"></a><h4>Returns</h4>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-parameter-list-values-get"></a><h3>hkl_parameter_list_values_get ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_parameter_list_values_get       (<em class="parameter"><code>const <span class="type">HklParameterList</span> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> values[]</code></em>,
-                                                         <em class="parameter"><code>unsigned <span class="type">int</span> *len</code></em>);</pre>
-<p>
-get a list of all the <a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> values
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-parameter-init-copy"></a><h3>hkl_parameter_init_copy ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_parameter_init_copy (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>,
+                         <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *src</code></em>,
+                         <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
+<div class="refsect3">
+<a name="id-1.2.18.6.5.4"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the this ptr</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the this ptr</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>values</code></em> :</span></p></td>
-<td>list of the paremetersc values. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=len]</span>
-</td>
+<td class="parameter_name"><p>src</p></td>
+<td class="parameter_description"><p>the parameter to copy from</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
-<td>the len of the returned list. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym> caller-allocates]</span>
-</td>
+<td class="parameter_name"><p>error</p></td>
+<td class="parameter_description"><p>return location for a GError, or NULL</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+<div class="refsect3">
+<a name="id-1.2.18.6.5.5"></a><h4>Returns</h4>
+<p> TRUE on success, FALSE if an error occurred</p>
+<p></p>
+</div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-parameter-list-values-unit-set"></a><h3>hkl_parameter_list_values_unit_set ()</h3>
-<pre class="programlisting">unsigned <span class="returnvalue">int</span>        hkl_parameter_list_values_unit_set  (<em class="parameter"><code><span class="type">HklParameterList</span> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> values[]</code></em>,
-                                                         <em class="parameter"><code>unsigned <span class="type">int</span> len</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);</pre>
-<p>
-set the parameter list with the given values
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-parameter-value-get-closest"></a><h3>hkl_parameter_value_get_closest ()</h3>
+<pre class="programlisting"><span class="returnvalue">double</span>
+hkl_parameter_value_get_closest (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>,
+                                 <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *ref</code></em>);</pre>
+<div class="refsect3">
+<a name="id-1.2.18.6.6.4"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the this ptr</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>values</code></em> :</span></p></td>
-<td>the values to set. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=len]</span>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
-<td>the length of the values</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the this ptr</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
-<td>error set if something goes wrong</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>true if succeed or false otherwise</td>
+<td class="parameter_name"><p>ref</p></td>
+<td class="parameter_description"><p>the reference <a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
-<hr>
-<div class="refsect2">
-<a name="hkl-parameter-new"></a><h3>hkl_parameter_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *      hkl_parameter_new                   (<em class="parameter"><code>const <span class="type">char</span> *name</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> min</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> value</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> max</code></em>,
-                                                         <em class="parameter"><code><span class="type">int</span> fit</code></em>,
-                                                         <em class="parameter"><code><span class="type">int</span> changed</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *unit</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *punit</code></em>);</pre>
-<p>
-create a new <a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a>
-</p>
+<div class="refsect3">
+<a name="id-1.2.18.6.6.5"></a><h4>Returns</h4>
+<p> the closest value of the ref <a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> from the
+current self <a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a></p>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-parameter-value-get-closest"></a><h3>hkl_parameter_value_get_closest ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_parameter_value_get_closest     (<em class="parameter"><code>const <a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *ref</code></em>);</pre>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-parameter-value-set-smallest-in-range"></a><h3>hkl_parameter_value_set_smallest_in_range ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_parameter_value_set_smallest_in_range
+                               (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>);</pre>
+<div class="refsect3">
+<a name="id-1.2.18.6.7.4"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the this ptr</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>ref</code></em> :</span></p></td>
-<td>the reference <a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>the closest value of the ref <a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> from the
-current self <a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a>
-</td>
-</tr>
-</tbody>
+<tbody><tr>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the this ptr</p></td>
+<td class="parameter_annotations"> </td>
+</tr></tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-parameter-value-set-real"></a><h3>hkl_parameter_value_set_real ()</h3>
-<pre class="programlisting"><span class="returnvalue">return</span>              hkl_parameter_value_set_real        (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#self" title="self"><span class="type">self</span></a> Param1</code></em>);</pre>
+<a name="hkl-parameter-is-valid"></a><h3>hkl_parameter_is_valid ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_parameter_is_valid (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>);</pre>
+<p>check if the value of the <a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> is in the min,max range</p>
+<div class="refsect3">
+<a name="id-1.2.18.6.8.5"></a><h4>Returns</h4>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-parameter-value-set-smallest-in-range"></a><h3>hkl_parameter_value_set_smallest_in_range ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_parameter_value_set_smallest_in_range
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>);</pre>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-parameter-fprintf"></a><h3>hkl_parameter_fprintf ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_parameter_fprintf (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
+                       <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>);</pre>
+<p>print into the <span class="type">FILE</span> f an <a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a></p>
+</div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-parameter-private.other_details"></a><h2>Types and Values</h2>
+<div class="refsect2">
+<a name="HklParameter"></a><h3>HklParameter</h3>
+<pre class="programlisting">typedef struct {
+	const char *name;
+	const char *description;
+	HklInterval range;
+	double _value;
+	const HklUnit *unit;
+	const HklUnit *punit;
+	int fit;
+	int changed;
+	const HklParameterOperations *ops;
+} HklParameter;
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HKL-PARAMETER-DEFAULTS:CAPS"></a><h3>HKL_PARAMETER_DEFAULTS</h3>
+<pre class="programlisting">#define HKL_PARAMETER_DEFAULTS .name="dummy", .description="no description", .range={.min=0, .max=0}, ._value=0, .unit=NULL, .punit=NULL, .fit=TRUE, .changed=TRUE, .ops = &hkl_parameter_operations_defaults
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HKL-PARAMETER-DEFAULTS-ANGLE:CAPS"></a><h3>HKL_PARAMETER_DEFAULTS_ANGLE</h3>
+<pre class="programlisting">#define HKL_PARAMETER_DEFAULTS_ANGLE HKL_PARAMETER_DEFAULTS, .range={.min=-M_PI, .max=M_PI}, .unit = &hkl_unit_angle_rad, .punit = &hkl_unit_angle_deg
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HKL-PARAMETER-ERROR:CAPS"></a><h3>HKL_PARAMETER_ERROR</h3>
+<pre class="programlisting">#define HKL_PARAMETER_ERROR hkl_parameter_error_quark ()
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklParameterError"></a><h3>enum HklParameterError</h3>
+<div class="refsect3">
+<a name="id-1.2.18.7.6.3"></a><h4>Members</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="300px" class="enum_members_name">
+<col class="enum_members_description">
+<col width="200px" class="enum_members_annotations">
 </colgroup>
 <tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the this ptr</td>
+<td class="enum_member_name"><p><a name="HKL-PARAMETER-ERROR-MIN-MAX-SET:CAPS"></a>HKL_PARAMETER_ERROR_MIN_MAX_SET</p></td>
+<td> </td>
+<td> </td>
 </tr></tbody>
 </table></div>
 </div>
 </div>
+<hr>
+<div class="refsect2">
+<a name="HklParameterOperations"></a><h3>struct HklParameterOperations</h3>
+<pre class="programlisting">struct HklParameterOperations {
+	HklParameter *        (*copy)(const HklParameter *self);
+	void                  (*free)(HklParameter *self);
+	int                   (*init_copy)(HklParameter *self, const HklParameter *src,
+					   GError **error);
+	double                (*get_value_closest)(const HklParameter *self,
+						   const HklParameter *other);
+	int                   (*set_value)(HklParameter *self, double value,
+					   HklUnitEnum unit_type, GError **error);
+	void                  (*set_value_smallest_in_range)(HklParameter *self);
+	void                  (*randomize)(HklParameter *self);
+	int                   (*is_valid)(const HklParameter *self);
+	void                  (*fprintf)(FILE *f, const HklParameter *self);
+	const HklVector *     (*axis_v_get)(const HklParameter *self);
+	const HklQuaternion * (*quaternion_get)(const HklParameter *self);
+};
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HKL-PARAMETER-OPERATIONS-DEFAULTS:CAPS"></a><h3>HKL_PARAMETER_OPERATIONS_DEFAULTS</h3>
+<pre class="programlisting">#define             HKL_PARAMETER_OPERATIONS_DEFAULTS</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="dup"></a><h3>dup</h3>
+<pre class="programlisting">	HklParameter *dup = HKL_MALLOC(HklParameter);
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="alea"></a><h3>alea</h3>
+<pre class="programlisting">		double alea = (double)rand() / (RAND_MAX + 1.);
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="factor"></a><h3>factor</h3>
+<pre class="programlisting">	double factor = hkl_unit_factor(self->unit, self->punit);
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="darray-parameter"></a><h3>darray_parameter</h3>
+<pre class="programlisting">typedef darray(HklParameter *) darray_parameter;
+</pre>
+</div>
+</div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-auto-private.html b/Documentation/api/html/hkl-hkl-pseudoaxis-auto-private.html
index c46e9a1..30ef3a1 100644
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-auto-private.html
+++ b/Documentation/api/html/hkl-hkl-pseudoaxis-auto-private.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-pseudoaxis-auto-private</title>
+<title>hkl Reference Manual: hkl-pseudoaxis-auto-private</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-parameter-private.html" title="hkl-parameter-private">
 <link rel="next" href="hkl-hkl-pseudoaxis-common-eulerians-private.html" title="hkl-pseudoaxis-common-eulerians-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-parameter-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-pseudoaxis-common-eulerians-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-pseudoaxis-auto-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-pseudoaxis-auto-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-pseudoaxis-auto-private.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-parameter-private.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-pseudoaxis-common-eulerians-private.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-hkl-pseudoaxis-auto-private"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,61 +29,191 @@
 <h2><span class="refentrytitle"><a name="hkl-hkl-pseudoaxis-auto-private.top_of_page"></a>hkl-pseudoaxis-auto-private</span></h2>
 <p>hkl-pseudoaxis-auto-private</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-pseudoaxis-auto-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">#define             <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#CHECK-NAN:CAPS" title="CHECK_NAN()">CHECK_NAN</a>                           (x,
-                                                         len)
-#define             <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-OPERATIONS-AUTO-DEFAULTS:CAPS" title="HKL_MODE_OPERATIONS_AUTO_DEFAULTS">HKL_MODE_OPERATIONS_AUTO_DEFAULTS</a>
-#define             <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-OPERATIONS-AUTO-WITH-INIT-DEFAULTS:CAPS" title="HKL_MODE_OPERATIONS_AUTO_WITH_INIT_DEFAULTS">HKL_MODE_OPERATIONS_AUTO_WITH_INIT_DEFAULTS</a>
-struct              <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklFunction" title="struct HklFunction">HklFunction</a>;
-struct              <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoInfo" title="struct HklModeAutoInfo">HklModeAutoInfo</a>;
-struct              <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoWithInit" title="struct HklModeAutoWithInit">HklModeAutoWithInit</a>;
-#define             <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#INFO-AUTO:CAPS" title="INFO_AUTO()">INFO_AUTO</a>                           (name,
-                                                         axes,
-                                                         fn)
-#define             <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#INFO-AUTO-WITH-PARAMS:CAPS" title="INFO_AUTO_WITH_PARAMS()">INFO_AUTO_WITH_PARAMS</a>               (name,
-                                                         axes,
-                                                         fn,
-                                                         parameters)
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-init" title="hkl_mode_auto_init ()">hkl_mode_auto_init</a>                  (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="HklMode"><span class="type">HklMode</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoInfo" title="struct HklModeAutoInfo"><span class="type">HklModeAutoInfo</span></a> *info</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklModeOperations" title="struct HklModeOperations"><span class="type">HklModeOperations</span></a> *ops</code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="HklMode"><span class="returnvalue">HklMode</span></a> *           <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-new" title="hkl_mode_auto_new ()">hkl_mode_auto_new</a>                   (<em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoInfo" title="struct HklModeAutoInfo"><span class="type">HklModeAutoInfo</span></a> *info</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklModeOperations" title="struct HklModeOperations"><span class="type">HklModeOperations</span></a> *ops</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-set-real" title="hkl_mode_auto_set_real ()">hkl_mode_auto_set_real</a>              (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="HklMode"><span class="type">HklMode</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector-private.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample-private.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="HklMode"><span class="returnvalue">HklMode</span></a> *           <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-with-init-new" title="hkl_mode_auto_with_init_new ()">hkl_mode_auto_with_init_new</a>         (<em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoInfo" title="struct HklModeAutoInfo"><span class="type">HklModeAutoInfo</span></a> * [...]
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklModeOperations" title="struct HklModeOperations"><span class="type">HklModeOperations</span></a> *ops</code></em>);
-HklMode *           <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#self" title="self">self</a>;
-</pre>
+<div class="refsect1">
+<a name="hkl-hkl-pseudoaxis-auto-private.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#CHECK-NAN:CAPS" title="CHECK_NAN()">CHECK_NAN</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-AUTO-INFO:CAPS" title="HKL_MODE_AUTO_INFO()">HKL_MODE_AUTO_INFO</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-AUTO-INFO-WITH-PARAMS:CAPS" title="HKL_MODE_AUTO_INFO_WITH_PARAMS()">HKL_MODE_AUTO_INFO_WITH_PARAMS</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="struct HklMode"><span class="returnvalue">HklMode</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-new" title="hkl_mode_auto_new ()">hkl_mode_auto_new</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-init" title="hkl_mode_auto_init ()">hkl_mode_auto_init</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-set-real" title="hkl_mode_auto_set_real ()">hkl_mode_auto_set_real</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">return</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#g-quark-from-static-string" title="g_quark_from_static_string ()">g_quark_from_static_string</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="struct HklMode"><span class="returnvalue">HklMode</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-with-init-new" title="hkl_mode_auto_with_init_new ()">hkl_mode_auto_with_init_new</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-pseudoaxis-auto-private.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="name">
+<col class="description">
+</colgroup>
+<tbody>
+<tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklFunction" title="struct HklFunction">HklFunction</a></td>
+</tr>
+<tr>
+<td class="typedef_keyword">typedef</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#darray-function" title="darray_function">darray_function</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoInfo" title="struct HklModeAutoInfo">HklModeAutoInfo</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-OPERATIONS-AUTO-DEFAULTS:CAPS" title="HKL_MODE_OPERATIONS_AUTO_DEFAULTS">HKL_MODE_OPERATIONS_AUTO_DEFAULTS</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoWithInit" title="struct HklModeAutoWithInit">HklModeAutoWithInit</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-AUTO-WITH-INIT-ERROR:CAPS" title="HKL_MODE_AUTO_WITH_INIT_ERROR">HKL_MODE_AUTO_WITH_INIT_ERROR</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">enum</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklModeError" title="enum HklModeError">HklModeError</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-OPERATIONS-AUTO-WITH-INIT-DEFAULTS:CAPS" title="HKL_MODE_OPERATIONS_AUTO_WITH_INIT_DEFAULTS">HKL_MODE_OPERATIONS_AUTO_WITH_INIT_DEFAULTS</a></td>
+</tr>
+<tr>
+<td class="variable_type">HklModeAutoWithInit *</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#self" title="self">self</a></td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-auto-private.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-hkl-pseudoaxis-auto-private.details"></a><h2>Details</h2>
+<a name="hkl-hkl-pseudoaxis-auto-private.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
 <a name="CHECK-NAN:CAPS"></a><h3>CHECK_NAN()</h3>
 <pre class="programlisting">#define             CHECK_NAN(x, len)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="HKL-MODE-OPERATIONS-AUTO-DEFAULTS:CAPS"></a><h3>HKL_MODE_OPERATIONS_AUTO_DEFAULTS</h3>
-<pre class="programlisting">#define             HKL_MODE_OPERATIONS_AUTO_DEFAULTS</pre>
+<a name="HKL-MODE-AUTO-INFO:CAPS"></a><h3>HKL_MODE_AUTO_INFO()</h3>
+<pre class="programlisting">#define HKL_MODE_AUTO_INFO(_name, _axes_r, _axes_w, _fn) .info={HKL_MODE_INFO(_name, _axes_r, _axes_w),}, .functions=DARRAY(_fn)
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="HKL-MODE-OPERATIONS-AUTO-WITH-INIT-DEFAULTS:CAPS"></a><h3>HKL_MODE_OPERATIONS_AUTO_WITH_INIT_DEFAULTS</h3>
-<pre class="programlisting">#define             HKL_MODE_OPERATIONS_AUTO_WITH_INIT_DEFAULTS</pre>
+<a name="HKL-MODE-AUTO-INFO-WITH-PARAMS:CAPS"></a><h3>HKL_MODE_AUTO_INFO_WITH_PARAMS()</h3>
+<pre class="programlisting">#define HKL_MODE_AUTO_INFO_WITH_PARAMS(_name, _axes_r, _axes_w, _fn, _parameters) .info={HKL_MODE_INFO_WITH_PARAMS(_name, _axes_r, _axes_w, _parameters)}, .functions=DARRAY(_fn)
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="hkl-mode-auto-new"></a><h3>hkl_mode_auto_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="struct HklMode"><span class="returnvalue">HklMode</span></a> *
+hkl_mode_auto_new (<em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoInfo" title="struct HklModeAutoInfo"><span class="type">HklModeAutoInfo</span></a> *auto_info</code></em>,
+                   <em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklModeOperations" title="struct HklModeOperations"><span class="type">HklModeOperations</span></a> *ops</code></em>,
+                   <em class="parameter"><code><span class="type">int</span> initialized</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
+<a name="hkl-mode-auto-init"></a><h3>hkl_mode_auto_init ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_mode_auto_init (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="struct HklMode"><span class="type">HklMode</span></a> *self</code></em>,
+                    <em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoInfo" title="struct HklModeAutoInfo"><span class="type">HklModeAutoInfo</span></a> *auto_info</code></em>,
+                    <em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklModeOperations" title="struct HklModeOperations"><span class="type">HklModeOperations</span></a> *ops</code></em>,
+                    <em class="parameter"><code><span class="type">int</span> initialized</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="hkl-mode-auto-set-real"></a><h3>hkl_mode_auto_set_real ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_mode_auto_set_real (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="struct HklMode"><span class="type">HklMode</span></a> *self</code></em>,
+                        <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklEngine" title="HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>,
+                        <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
+                        <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
+                        <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
+                        <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="g-quark-from-static-string"></a><h3>g_quark_from_static_string ()</h3>
+<pre class="programlisting"><span class="returnvalue">return</span>
+g_quark_from_static_string ();</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="hkl-mode-auto-with-init-new"></a><h3>hkl_mode_auto_with_init_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="struct HklMode"><span class="returnvalue">HklMode</span></a> *
+hkl_mode_auto_with_init_new (<em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoInfo" title="struct HklModeAutoInfo"><span class="type">HklModeAutoInfo</span></a> *info</code></em>,
+                             <em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklModeOperations" title="struct HklModeOperations"><span class="type">HklModeOperations</span></a> *ops</code></em>,
+                             <em class="parameter"><code><span class="type">int</span> initialized</code></em>);</pre>
+</div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-pseudoaxis-auto-private.other_details"></a><h2>Types and Values</h2>
+<div class="refsect2">
 <a name="HklFunction"></a><h3>struct HklFunction</h3>
 <pre class="programlisting">struct HklFunction {
 	const uint size;
@@ -97,16 +223,26 @@ HklMode *           <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#s
 </div>
 <hr>
 <div class="refsect2">
+<a name="darray-function"></a><h3>darray_function</h3>
+<pre class="programlisting">typedef darray(const HklFunction*) darray_function;
+</pre>
+</div>
+<hr>
+<div class="refsect2">
 <a name="HklModeAutoInfo"></a><h3>struct HklModeAutoInfo</h3>
 <pre class="programlisting">struct HklModeAutoInfo {
-	const HklModeInfo mode;
-	const HklFunction **functions;
-	const uint n_functions;
+	const HklModeInfo info;
+	darray_function functions;
 };
 </pre>
 </div>
 <hr>
 <div class="refsect2">
+<a name="HKL-MODE-OPERATIONS-AUTO-DEFAULTS:CAPS"></a><h3>HKL_MODE_OPERATIONS_AUTO_DEFAULTS</h3>
+<pre class="programlisting">#define             HKL_MODE_OPERATIONS_AUTO_DEFAULTS</pre>
+</div>
+<hr>
+<div class="refsect2">
 <a name="HklModeAutoWithInit"></a><h3>struct HklModeAutoWithInit</h3>
 <pre class="programlisting">struct HklModeAutoWithInit {
 	HklMode mode;
@@ -118,55 +254,44 @@ HklMode *           <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#s
 </div>
 <hr>
 <div class="refsect2">
-<a name="INFO-AUTO:CAPS"></a><h3>INFO_AUTO()</h3>
-<pre class="programlisting">#define INFO_AUTO(name, axes, fn) .mode={INFO(name, axes),}, .functions=fn, .n_functions=ARRAY_SIZE(fn)
+<a name="HKL-MODE-AUTO-WITH-INIT-ERROR:CAPS"></a><h3>HKL_MODE_AUTO_WITH_INIT_ERROR</h3>
+<pre class="programlisting">#define HKL_MODE_AUTO_WITH_INIT_ERROR hkl_mode_auto_with_init_error_quark ()
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="INFO-AUTO-WITH-PARAMS:CAPS"></a><h3>INFO_AUTO_WITH_PARAMS()</h3>
-<pre class="programlisting">#define INFO_AUTO_WITH_PARAMS(name, axes, fn, parameters) .mode={INFO_WITH_PARAMS(name, axes, parameters)}, .functions=fn, .n_functions=ARRAY_SIZE(fn)
-</pre>
+<a name="HklModeError"></a><h3>enum HklModeError</h3>
+<div class="refsect3">
+<a name="id-1.2.19.7.8.3"></a><h4>Members</h4>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="300px" class="enum_members_name">
+<col class="enum_members_description">
+<col width="200px" class="enum_members_annotations">
+</colgroup>
+<tbody><tr>
+<td class="enum_member_name"><p><a name="HKL-MODE-AUTO-WITH-INIT-ERROR-INIT:CAPS"></a>HKL_MODE_AUTO_WITH_INIT_ERROR_INIT</p></td>
+<td> </td>
+<td> </td>
+</tr></tbody>
+</table></div>
 </div>
-<hr>
-<div class="refsect2">
-<a name="hkl-mode-auto-init"></a><h3>hkl_mode_auto_init ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_mode_auto_init                  (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="HklMode"><span class="type">HklMode</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoInfo" title="struct HklModeAutoInfo"><span class="type">HklModeAutoInfo</span></a> *info</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklModeOperations" title="struct HklModeOperations"><span class="type">HklModeOperations</span></a> *ops</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-mode-auto-new"></a><h3>hkl_mode_auto_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="HklMode"><span class="returnvalue">HklMode</span></a> *           hkl_mode_auto_new                   (<em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoInfo" title="struct HklModeAutoInfo"><span class="type">HklModeAutoInfo</span></a> *info</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklModeOperations" title="struct HklModeOperations"><span class="type">HklModeOperations</span></a> *ops</code></em>);</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-mode-auto-set-real"></a><h3>hkl_mode_auto_set_real ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_mode_auto_set_real              (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="HklMode"><span class="type">HklMode</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector-private.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample-private.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-mode-auto-with-init-new"></a><h3>hkl_mode_auto_with_init_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="HklMode"><span class="returnvalue">HklMode</span></a> *           hkl_mode_auto_with_init_new         (<em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoInfo" title="struct HklModeAutoInfo"><span class="type">HklModeAutoInfo</span></a> *info</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklModeOperations" title="struct HklModeOperations"><span class="type">HklModeOperations</span></a> *ops</code></em>);</pre>
+<a name="HKL-MODE-OPERATIONS-AUTO-WITH-INIT-DEFAULTS:CAPS"></a><h3>HKL_MODE_OPERATIONS_AUTO_WITH_INIT_DEFAULTS</h3>
+<pre class="programlisting">#define             HKL_MODE_OPERATIONS_AUTO_WITH_INIT_DEFAULTS</pre>
 </div>
 <hr>
 <div class="refsect2">
 <a name="self"></a><h3>self</h3>
-<pre class="programlisting">	HklMode *self = NULL;
+<pre class="programlisting">	HklModeAutoWithInit *self = container_of(mode, HklModeAutoWithInit, mode);
 </pre>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-common-eulerians-private.html b/Documentation/api/html/hkl-hkl-pseudoaxis-common-eulerians-private.html
index 578c86c..94b65e8 100644
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-common-eulerians-private.html
+++ b/Documentation/api/html/hkl-hkl-pseudoaxis-common-eulerians-private.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-pseudoaxis-common-eulerians-private</title>
+<title>hkl Reference Manual: hkl-pseudoaxis-common-eulerians-private</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-pseudoaxis-auto-private.html" title="hkl-pseudoaxis-auto-private">
 <link rel="next" href="hkl-hkl-pseudoaxis-common-hkl-private.html" title="hkl-pseudoaxis-common-hkl-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-pseudoaxis-auto-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-pseudoaxis-common-hkl-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-pseudoaxis-common-eulerians-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-pseudoaxis-common-eulerians-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-pseudoaxis-common-eulerians-private.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-pseudoaxis-auto-private.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-pseudoaxis-common-hkl-private.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-hkl-pseudoaxis-common-eulerians-private"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,19 +29,73 @@
 <h2><span class="refentrytitle"><a name="hkl-hkl-pseudoaxis-common-eulerians-private.top_of_page"></a>hkl-pseudoaxis-common-eulerians-private</span></h2>
 <p>hkl-pseudoaxis-common-eulerians-private</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-pseudoaxis-common-eulerians-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">struct              <a class="link" href="hkl-hkl-pseudoaxis-common-eulerians-private.html#HklEngineEulerians" title="struct HklEngineEulerians">HklEngineEulerians</a>;
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-common-eulerians-private.html#hkl-engine-eulerians-new" title="hkl_engine_eulerians_new ()">hkl_engine_eulerians_new</a>            (<em class="parameter"><code><span class="type">void</span></code></em>);
-</pre>
+<div class="refsect1">
+<a name="hkl-hkl-pseudoaxis-common-eulerians-private.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-common-eulerians-private.html#hkl-engine-eulerians-new" title="hkl_engine_eulerians_new ()">hkl_engine_eulerians_new</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-common-eulerians-private.html#kappa-2-kappap" title="kappa_2_kappap ()">kappa_2_kappap</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-pseudoaxis-common-eulerians-private.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="name">
+<col class="description">
+</colgroup>
+<tbody><tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-common-eulerians-private.html#HklEngineEulerians" title="struct HklEngineEulerians">HklEngineEulerians</a></td>
+</tr></tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-common-eulerians-private.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-hkl-pseudoaxis-common-eulerians-private.details"></a><h2>Details</h2>
+<a name="hkl-hkl-pseudoaxis-common-eulerians-private.functions_details"></a><h2>Functions</h2>
+<div class="refsect2">
+<a name="hkl-engine-eulerians-new"></a><h3>hkl_engine_eulerians_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *
+hkl_engine_eulerians_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="kappa-2-kappap"></a><h3>kappa_2_kappap ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+kappa_2_kappap (<em class="parameter"><code><span class="type">double</span> komega</code></em>,
+                <em class="parameter"><code><span class="type">double</span> kappa</code></em>,
+                <em class="parameter"><code><span class="type">double</span> kphi</code></em>,
+                <em class="parameter"><code><span class="type">double</span> alpha</code></em>,
+                <em class="parameter"><code><span class="type">double</span> *komegap</code></em>,
+                <em class="parameter"><code><span class="type">double</span> *kappap</code></em>,
+                <em class="parameter"><code><span class="type">double</span> *kphip</code></em>);</pre>
+</div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-pseudoaxis-common-eulerians-private.other_details"></a><h2>Types and Values</h2>
 <div class="refsect2">
 <a name="HklEngineEulerians"></a><h3>struct HklEngineEulerians</h3>
 <pre class="programlisting">struct HklEngineEulerians {
@@ -56,15 +106,10 @@
 };
 </pre>
 </div>
-<hr>
-<div class="refsect2">
-<a name="hkl-engine-eulerians-new"></a><h3>hkl_engine_eulerians_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_eulerians_new            (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-</div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-common-hkl-private.html b/Documentation/api/html/hkl-hkl-pseudoaxis-common-hkl-private.html
index caa6cf4..2b0e60b 100644
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-common-hkl-private.html
+++ b/Documentation/api/html/hkl-hkl-pseudoaxis-common-hkl-private.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-pseudoaxis-common-hkl-private</title>
+<title>hkl Reference Manual: hkl-pseudoaxis-common-hkl-private</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-pseudoaxis-common-eulerians-private.html" title="hkl-pseudoaxis-common-eulerians-private">
 <link rel="next" href="hkl-hkl-pseudoaxis-common-psi-private.html" title="hkl-pseudoaxis-common-psi-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-pseudoaxis-common-eulerians-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-pseudoaxis-common-psi-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-pseudoaxis-common-hkl-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-pseudoaxis-common-hkl-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-pseudoaxis-common-hkl-private.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-pseudoaxis-common-eulerians-private.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-pseudoaxis-common-psi-private.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-hkl-pseudoaxis-common-hkl-private"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,104 +29,179 @@
 <h2><span class="refentrytitle"><a name="hkl-hkl-pseudoaxis-common-hkl-private.top_of_page"></a>hkl-pseudoaxis-common-hkl-private</span></h2>
 <p>hkl-pseudoaxis-common-hkl-private</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-pseudoaxis-common-hkl-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">#define             <a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#HKL-MODE-OPERATIONS-HKL-DEFAULTS:CAPS" title="HKL_MODE_OPERATIONS_HKL_DEFAULTS">HKL_MODE_OPERATIONS_HKL_DEFAULTS</a>
-struct              <a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#HklEngineHkl" title="struct HklEngineHkl">HklEngineHkl</a>;
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#RUBh-minus-Q" title="RUBh_minus_Q ()">RUBh_minus_Q</a>                        (<em class="parameter"><code><span class="type">double</span> const x[]</code></em>,
-                                                         <em class="parameter"><code><span class="type">void</span> *params</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> f[]</code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-engine-hkl-new" title="hkl_engine_hkl_new ()">hkl_engine_hkl_new</a>                  (<em class="parameter"><code><span class="type">void</span></code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-get-hkl-real" title="hkl_mode_get_hkl_real ()">hkl_mode_get_hkl_real</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="HklMode"><span class="type">HklMode</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector-private.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample-private.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-init-psi-constant-vertical-real" title="hkl_mode_init_psi_constant_vertical_real ()">hkl_mode_init_psi_constant_vertical_real</a>
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="HklMode"><span class="type">HklMode</span></a> *base</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector-private.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample-private.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-set-hkl-real" title="hkl_mode_set_hkl_real ()">hkl_mode_set_hkl_real</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="HklMode"><span class="type">HklMode</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector-private.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample-private.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);
-</pre>
+<div class="refsect1">
+<a name="hkl-hkl-pseudoaxis-common-hkl-private.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#RUBh-minus-Q" title="RUBh_minus_Q ()">RUBh_minus_Q</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-get-hkl-real" title="hkl_mode_get_hkl_real ()">hkl_mode_get_hkl_real</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-set-hkl-real" title="hkl_mode_set_hkl_real ()">hkl_mode_set_hkl_real</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-initialized-set-psi-constant-vertical-real" title="hkl_mode_initialized_set_psi_constant_vertical_real ()">hkl_mode_initialized_set_psi_constant_vertical_real</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-engine-hkl-new" title="hkl_engine_hkl_new ()">hkl_engine_hkl_new</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#CONSTANT-PARAMETER:CAPS" title="CONSTANT_PARAMETER()">CONSTANT_PARAMETER</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#PSI-CONSTANT-PARAMETERS:CAPS" title="PSI_CONSTANT_PARAMETERS()">PSI_CONSTANT_PARAMETERS</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-pseudoaxis-common-hkl-private.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="name">
+<col class="description">
+</colgroup>
+<tbody>
+<tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#HklEngineHkl" title="struct HklEngineHkl">HklEngineHkl</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-common-hkl-private.html#HKL-MODE-OPERATIONS-HKL-DEFAULTS:CAPS" title="HKL_MODE_OPERATIONS_HKL_DEFAULTS">HKL_MODE_OPERATIONS_HKL_DEFAULTS</a></td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-common-hkl-private.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-hkl-pseudoaxis-common-hkl-private.details"></a><h2>Details</h2>
+<a name="hkl-hkl-pseudoaxis-common-hkl-private.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
-<a name="HKL-MODE-OPERATIONS-HKL-DEFAULTS:CAPS"></a><h3>HKL_MODE_OPERATIONS_HKL_DEFAULTS</h3>
-<pre class="programlisting">#define             HKL_MODE_OPERATIONS_HKL_DEFAULTS</pre>
+<a name="RUBh-minus-Q"></a><h3>RUBh_minus_Q ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+RUBh_minus_Q (<em class="parameter"><code><span class="type">double</span> const x[]</code></em>,
+              <em class="parameter"><code><span class="type">void</span> *params</code></em>,
+              <em class="parameter"><code><span class="type">double</span> f[]</code></em>);</pre>
+<div class="refsect3">
+<a name="id-1.2.21.6.2.4"></a><h4>Returns</h4>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="HklEngineHkl"></a><h3>struct HklEngineHkl</h3>
-<pre class="programlisting">struct HklEngineHkl {
-	HklEngine engine;
-	HklParameter *h;
-	HklParameter *k;
-	HklParameter *l;
-};
-</pre>
+<a name="hkl-mode-get-hkl-real"></a><h3>hkl_mode_get_hkl_real ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_mode_get_hkl_real (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="struct HklMode"><span class="type">HklMode</span></a> *self</code></em>,
+                       <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklEngine" title="HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>,
+                       <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
+                       <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
+                       <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
+                       <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="RUBh-minus-Q"></a><h3>RUBh_minus_Q ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 RUBh_minus_Q                        (<em class="parameter"><code><span class="type">double</span> const x[]</code></em>,
-                                                         <em class="parameter"><code><span class="type">void</span> *params</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> f[]</code></em>);</pre>
+<a name="hkl-mode-set-hkl-real"></a><h3>hkl_mode_set_hkl_real ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_mode_set_hkl_real (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="struct HklMode"><span class="type">HklMode</span></a> *self</code></em>,
+                       <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklEngine" title="HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>,
+                       <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
+                       <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
+                       <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
+                       <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-engine-hkl-new"></a><h3>hkl_engine_hkl_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_hkl_new                  (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
+<a name="hkl-mode-initialized-set-psi-constant-vertical-real"></a><h3>hkl_mode_initialized_set_psi_constant_vertical_real ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_mode_initialized_set_psi_constant_vertical_real
+                               (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="struct HklMode"><span class="type">HklMode</span></a> *base</code></em>,
+                                <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklEngine" title="HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>,
+                                <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
+                                <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
+                                <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
+                                <em class="parameter"><code><span class="type">int</span> initialized</code></em>,
+                                <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-mode-get-hkl-real"></a><h3>hkl_mode_get_hkl_real ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_mode_get_hkl_real               (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="HklMode"><span class="type">HklMode</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector-private.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample-private.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);</pre>
+<a name="hkl-engine-hkl-new"></a><h3>hkl_engine_hkl_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *
+hkl_engine_hkl_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-mode-init-psi-constant-vertical-real"></a><h3>hkl_mode_init_psi_constant_vertical_real ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_mode_init_psi_constant_vertical_real
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="HklMode"><span class="type">HklMode</span></a> *base</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector-private.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample-private.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);</pre>
+<a name="CONSTANT-PARAMETER:CAPS"></a><h3>CONSTANT_PARAMETER()</h3>
+<pre class="programlisting">#define             CONSTANT_PARAMETER(_name)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-mode-set-hkl-real"></a><h3>hkl_mode_set_hkl_real ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_mode_set_hkl_real               (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="HklMode"><span class="type">HklMode</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector-private.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample-private.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error-private.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);</pre>
+<a name="PSI-CONSTANT-PARAMETERS:CAPS"></a><h3>PSI_CONSTANT_PARAMETERS()</h3>
+<pre class="programlisting">#define             PSI_CONSTANT_PARAMETERS(_h2, _k2, _l2, _psi)</pre>
+</div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-pseudoaxis-common-hkl-private.other_details"></a><h2>Types and Values</h2>
+<div class="refsect2">
+<a name="HklEngineHkl"></a><h3>struct HklEngineHkl</h3>
+<pre class="programlisting">struct HklEngineHkl {
+	HklEngine engine;
+	HklParameter *h;
+	HklParameter *k;
+	HklParameter *l;
+};
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HKL-MODE-OPERATIONS-HKL-DEFAULTS:CAPS"></a><h3>HKL_MODE_OPERATIONS_HKL_DEFAULTS</h3>
+<pre class="programlisting">#define             HKL_MODE_OPERATIONS_HKL_DEFAULTS</pre>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-common-psi-private.html b/Documentation/api/html/hkl-hkl-pseudoaxis-common-psi-private.html
index 6ab30a6..3411b97 100644
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-common-psi-private.html
+++ b/Documentation/api/html/hkl-hkl-pseudoaxis-common-psi-private.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-pseudoaxis-common-psi-private</title>
+<title>hkl Reference Manual: hkl-pseudoaxis-common-psi-private</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-pseudoaxis-common-hkl-private.html" title="hkl-pseudoaxis-common-hkl-private">
 <link rel="next" href="hkl-hkl-pseudoaxis-common-q-private.html" title="hkl-pseudoaxis-common-q-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-pseudoaxis-common-hkl-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-pseudoaxis-common-q-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-pseudoaxis-common-psi-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-pseudoaxis-common-psi-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-pseudoaxis-common-psi-private.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-pseudoaxis-common-hkl-private.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-pseudoaxis-common-q-private.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-hkl-pseudoaxis-common-psi-private"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,31 +29,74 @@
 <h2><span class="refentrytitle"><a name="hkl-hkl-pseudoaxis-common-psi-private.top_of_page"></a>hkl-pseudoaxis-common-psi-private</span></h2>
 <p>hkl-pseudoaxis-common-psi-private</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-pseudoaxis-common-psi-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">struct              <a class="link" href="hkl-hkl-pseudoaxis-common-psi-private.html#HklEnginePsi" title="struct HklEnginePsi">HklEnginePsi</a>;
-struct              <a class="link" href="hkl-hkl-pseudoaxis-common-psi-private.html#HklModePsi" title="struct HklModePsi">HklModePsi</a>;
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-common-psi-private.html#hkl-engine-psi-new" title="hkl_engine_psi_new ()">hkl_engine_psi_new</a>                  (<em class="parameter"><code><span class="type">void</span></code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="HklMode"><span class="returnvalue">HklMode</span></a> *           <a class="link" href="hkl-hkl-pseudoaxis-common-psi-private.html#hkl-mode-psi-new" title="hkl_mode_psi_new ()">hkl_mode_psi_new</a>                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoInfo" title="struct HklModeAutoInfo"><span class="type">HklModeAutoInfo</span></a> *info</code></em>);
-</pre>
+<div class="refsect1">
+<a name="hkl-hkl-pseudoaxis-common-psi-private.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="struct HklMode"><span class="returnvalue">HklMode</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-common-psi-private.html#hkl-mode-psi-new" title="hkl_mode_psi_new ()">hkl_mode_psi_new</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-common-psi-private.html#hkl-engine-psi-new" title="hkl_engine_psi_new ()">hkl_engine_psi_new</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-pseudoaxis-common-psi-private.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="name">
+<col class="description">
+</colgroup>
+<tbody>
+<tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-common-psi-private.html#HklModePsi" title="struct HklModePsi">HklModePsi</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-common-psi-private.html#HklEnginePsi" title="struct HklEnginePsi">HklEnginePsi</a></td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-common-psi-private.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-hkl-pseudoaxis-common-psi-private.details"></a><h2>Details</h2>
+<a name="hkl-hkl-pseudoaxis-common-psi-private.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
-<a name="HklEnginePsi"></a><h3>struct HklEnginePsi</h3>
-<pre class="programlisting">struct HklEnginePsi {
-	HklEngine engine;
-	HklParameter *psi;
-};
-</pre>
+<a name="hkl-mode-psi-new"></a><h3>hkl_mode_psi_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="struct HklMode"><span class="returnvalue">HklMode</span></a> *
+hkl_mode_psi_new (<em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoInfo" title="struct HklModeAutoInfo"><span class="type">HklModeAutoInfo</span></a> *info</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
+<a name="hkl-engine-psi-new"></a><h3>hkl_engine_psi_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *
+hkl_engine_psi_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
+</div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-pseudoaxis-common-psi-private.other_details"></a><h2>Types and Values</h2>
+<div class="refsect2">
 <a name="HklModePsi"></a><h3>struct HklModePsi</h3>
 <pre class="programlisting">struct HklModePsi {
 	HklMode parent;
@@ -68,18 +107,17 @@ struct              <a class="link" href="hkl-hkl-pseudoaxis-common-psi-private.
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-engine-psi-new"></a><h3>hkl_engine_psi_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_psi_new                  (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-mode-psi-new"></a><h3>hkl_mode_psi_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="HklMode"><span class="returnvalue">HklMode</span></a> *           hkl_mode_psi_new                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoInfo" title="struct HklModeAutoInfo"><span class="type">HklModeAutoInfo</span></a> *info</code></em>);</pre>
+<a name="HklEnginePsi"></a><h3>struct HklEnginePsi</h3>
+<pre class="programlisting">struct HklEnginePsi {
+	HklEngine engine;
+	HklParameter *psi;
+};
+</pre>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-common-q-private.html b/Documentation/api/html/hkl-hkl-pseudoaxis-common-q-private.html
index 7608c9e..f4824a2 100644
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-common-q-private.html
+++ b/Documentation/api/html/hkl-hkl-pseudoaxis-common-q-private.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-pseudoaxis-common-q-private</title>
+<title>hkl Reference Manual: hkl-pseudoaxis-common-q-private</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-pseudoaxis-common-psi-private.html" title="hkl-pseudoaxis-common-psi-private">
-<link rel="next" href="hkl-hkl-pseudoaxis-e4c-private.html" title="hkl-pseudoaxis-e4c-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<link rel="next" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-pseudoaxis-common-psi-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-pseudoaxis-e4c-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-pseudoaxis-common-q-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-pseudoaxis-common-q-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-pseudoaxis-common-q-private.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-pseudoaxis-common-psi-private.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-pseudoaxis-private.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-hkl-pseudoaxis-common-q-private"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,56 +29,123 @@
 <h2><span class="refentrytitle"><a name="hkl-hkl-pseudoaxis-common-q-private.top_of_page"></a>hkl-pseudoaxis-common-q-private</span></h2>
 <p>hkl-pseudoaxis-common-q-private</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-pseudoaxis-common-q-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html#HklEngineQ" title="HklEngineQ">HklEngineQ</a>;
-                    <a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html#HklEngineQ2" title="HklEngineQ2">HklEngineQ2</a>;
-                    <a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html#HklEngineQperQpar" title="HklEngineQperQpar">HklEngineQperQpar</a>;
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-q2-new" title="hkl_engine_q2_new ()">hkl_engine_q2_new</a>                   (<em class="parameter"><code><span class="type">void</span></code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-q-new" title="hkl_engine_q_new ()">hkl_engine_q_new</a>                    (<em class="parameter"><code><span class="type">void</span></code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-qper-qpar-new" title="hkl_engine_qper_qpar_new ()">hkl_engine_qper_qpar_new</a>            (<em class="parameter"><code><span class="type">void</span></code></em>);
-</pre>
+<div class="refsect1">
+<a name="hkl-hkl-pseudoaxis-common-q-private.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="function_type">
+<span class="returnvalue">double</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html#qmax" title="qmax ()">qmax</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-q-new" title="hkl_engine_q_new ()">hkl_engine_q_new</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-q2-new" title="hkl_engine_q2_new ()">hkl_engine_q2_new</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-qper-qpar-new" title="hkl_engine_qper_qpar_new ()">hkl_engine_qper_qpar_new</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-pseudoaxis-common-q-private.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="name">
+<col class="description">
+</colgroup>
+<tbody>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html#HklEngineQ" title="HklEngineQ">HklEngineQ</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html#HklEngineQ2" title="HklEngineQ2">HklEngineQ2</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-common-q-private.html#HklEngineQperQpar" title="HklEngineQperQpar">HklEngineQperQpar</a></td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-common-q-private.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-hkl-pseudoaxis-common-q-private.details"></a><h2>Details</h2>
+<a name="hkl-hkl-pseudoaxis-common-q-private.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
-<a name="HklEngineQ"></a><h3>HklEngineQ</h3>
-<pre class="programlisting">typedef struct _HklEngineQ HklEngineQ;</pre>
+<a name="qmax"></a><h3>qmax ()</h3>
+<pre class="programlisting"><span class="returnvalue">double</span>
+qmax (<em class="parameter"><code><span class="type">double</span> wavelength</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="HklEngineQ2"></a><h3>HklEngineQ2</h3>
-<pre class="programlisting">typedef struct _HklEngineQ2 HklEngineQ2;</pre>
+<a name="hkl-engine-q-new"></a><h3>hkl_engine_q_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *
+hkl_engine_q_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="HklEngineQperQpar"></a><h3>HklEngineQperQpar</h3>
-<pre class="programlisting">typedef struct _HklEngineQperQpar HklEngineQperQpar;</pre>
+<a name="hkl-engine-q2-new"></a><h3>hkl_engine_q2_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *
+hkl_engine_q2_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-engine-q2-new"></a><h3>hkl_engine_q2_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_q2_new                   (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
+<a name="hkl-engine-qper-qpar-new"></a><h3>hkl_engine_qper_qpar_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *
+hkl_engine_qper_qpar_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
+</div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-pseudoaxis-common-q-private.other_details"></a><h2>Types and Values</h2>
+<div class="refsect2">
+<a name="HklEngineQ"></a><h3>HklEngineQ</h3>
+<pre class="programlisting">typedef struct _HklEngineQ HklEngineQ;</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-engine-q-new"></a><h3>hkl_engine_q_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_q_new                    (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
+<a name="HklEngineQ2"></a><h3>HklEngineQ2</h3>
+<pre class="programlisting">typedef struct _HklEngineQ2 HklEngineQ2;</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-engine-qper-qpar-new"></a><h3>hkl_engine_qper_qpar_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_qper_qpar_new            (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
+<a name="HklEngineQperQpar"></a><h3>HklEngineQperQpar</h3>
+<pre class="programlisting">typedef struct _HklEngineQperQpar HklEngineQperQpar;</pre>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-e4c-private.html b/Documentation/api/html/hkl-hkl-pseudoaxis-e4c-private.html
deleted file mode 100644
index a0251e9..0000000
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-e4c-private.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-pseudoaxis-e4c-private</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
-<link rel="home" href="index.html" title="hkl Reference Manual">
-<link rel="up" href="ch01.html" title="[Insert title here]">
-<link rel="prev" href="hkl-hkl-pseudoaxis-common-q-private.html" title="hkl-pseudoaxis-common-q-private">
-<link rel="next" href="hkl-hkl-pseudoaxis-e6c-private.html" title="hkl-pseudoaxis-e6c-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
-<link rel="stylesheet" href="style.css" type="text/css">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-pseudoaxis-common-q-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-pseudoaxis-e6c-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-pseudoaxis-e4c-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-pseudoaxis-e4c-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
-<div class="refentry">
-<a name="hkl-hkl-pseudoaxis-e4c-private"></a><div class="titlepage"></div>
-<div class="refnamediv"><table width="100%"><tr>
-<td valign="top">
-<h2><span class="refentrytitle"><a name="hkl-hkl-pseudoaxis-e4c-private.top_of_page"></a>hkl-pseudoaxis-e4c-private</span></h2>
-<p>hkl-pseudoaxis-e4c-private</p>
-</td>
-<td valign="top" align="right"></td>
-</tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-pseudoaxis-e4c-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-e4c-private.html#hkl-engine-e4c-hkl-new" title="hkl_engine_e4c_hkl_new ()">hkl_engine_e4c_hkl_new</a>              (<em class="parameter"><code><span class="type">void</span></code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-e4c-private.html#hkl-engine-e4c-psi-new" title="hkl_engine_e4c_psi_new ()">hkl_engine_e4c_psi_new</a>              (<em class="parameter"><code><span class="type">void</span></code></em>);
-</pre>
-</div>
-<div class="refsect1">
-<a name="hkl-hkl-pseudoaxis-e4c-private.description"></a><h2>Description</h2>
-</div>
-<div class="refsect1">
-<a name="hkl-hkl-pseudoaxis-e4c-private.details"></a><h2>Details</h2>
-<div class="refsect2">
-<a name="hkl-engine-e4c-hkl-new"></a><h3>hkl_engine_e4c_hkl_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_e4c_hkl_new              (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-engine-e4c-psi-new"></a><h3>hkl_engine_e4c_psi_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_e4c_psi_new              (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-</div>
-</div>
-</div>
-<div class="footer">
-<hr>
-          Generated by GTK-Doc V1.18</div>
-</body>
-</html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-e6c-private.html b/Documentation/api/html/hkl-hkl-pseudoaxis-e6c-private.html
deleted file mode 100644
index 2d3a80f..0000000
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-e6c-private.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-pseudoaxis-e6c-private</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
-<link rel="home" href="index.html" title="hkl Reference Manual">
-<link rel="up" href="ch01.html" title="[Insert title here]">
-<link rel="prev" href="hkl-hkl-pseudoaxis-e4c-private.html" title="hkl-pseudoaxis-e4c-private">
-<link rel="next" href="hkl-hkl-pseudoaxis-k4cv-private.html" title="hkl-pseudoaxis-k4cv-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
-<link rel="stylesheet" href="style.css" type="text/css">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-pseudoaxis-e4c-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-pseudoaxis-k4cv-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-pseudoaxis-e6c-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-pseudoaxis-e6c-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
-<div class="refentry">
-<a name="hkl-hkl-pseudoaxis-e6c-private"></a><div class="titlepage"></div>
-<div class="refnamediv"><table width="100%"><tr>
-<td valign="top">
-<h2><span class="refentrytitle"><a name="hkl-hkl-pseudoaxis-e6c-private.top_of_page"></a>hkl-pseudoaxis-e6c-private</span></h2>
-<p>hkl-pseudoaxis-e6c-private</p>
-</td>
-<td valign="top" align="right"></td>
-</tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-pseudoaxis-e6c-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-e6c-private.html#hkl-engine-e6c-hkl-new" title="hkl_engine_e6c_hkl_new ()">hkl_engine_e6c_hkl_new</a>              (<em class="parameter"><code><span class="type">void</span></code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-e6c-private.html#hkl-engine-e6c-psi-new" title="hkl_engine_e6c_psi_new ()">hkl_engine_e6c_psi_new</a>              (<em class="parameter"><code><span class="type">void</span></code></em>);
-</pre>
-</div>
-<div class="refsect1">
-<a name="hkl-hkl-pseudoaxis-e6c-private.description"></a><h2>Description</h2>
-</div>
-<div class="refsect1">
-<a name="hkl-hkl-pseudoaxis-e6c-private.details"></a><h2>Details</h2>
-<div class="refsect2">
-<a name="hkl-engine-e6c-hkl-new"></a><h3>hkl_engine_e6c_hkl_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_e6c_hkl_new              (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-engine-e6c-psi-new"></a><h3>hkl_engine_e6c_psi_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_e6c_psi_new              (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-</div>
-</div>
-</div>
-<div class="footer">
-<hr>
-          Generated by GTK-Doc V1.18</div>
-</body>
-</html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-k4cv-private.html b/Documentation/api/html/hkl-hkl-pseudoaxis-k4cv-private.html
deleted file mode 100644
index 97d9289..0000000
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-k4cv-private.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-pseudoaxis-k4cv-private</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
-<link rel="home" href="index.html" title="hkl Reference Manual">
-<link rel="up" href="ch01.html" title="[Insert title here]">
-<link rel="prev" href="hkl-hkl-pseudoaxis-e6c-private.html" title="hkl-pseudoaxis-e6c-private">
-<link rel="next" href="hkl-hkl-pseudoaxis-k6c-private.html" title="hkl-pseudoaxis-k6c-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
-<link rel="stylesheet" href="style.css" type="text/css">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-pseudoaxis-e6c-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-pseudoaxis-k6c-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-pseudoaxis-k4cv-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-pseudoaxis-k4cv-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
-<div class="refentry">
-<a name="hkl-hkl-pseudoaxis-k4cv-private"></a><div class="titlepage"></div>
-<div class="refnamediv"><table width="100%"><tr>
-<td valign="top">
-<h2><span class="refentrytitle"><a name="hkl-hkl-pseudoaxis-k4cv-private.top_of_page"></a>hkl-pseudoaxis-k4cv-private</span></h2>
-<p>hkl-pseudoaxis-k4cv-private</p>
-</td>
-<td valign="top" align="right"></td>
-</tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-pseudoaxis-k4cv-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-k4cv-private.html#hkl-engine-k4cv-hkl-new" title="hkl_engine_k4cv_hkl_new ()">hkl_engine_k4cv_hkl_new</a>             (<em class="parameter"><code><span class="type">void</span></code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-k4cv-private.html#hkl-engine-k4cv-psi-new" title="hkl_engine_k4cv_psi_new ()">hkl_engine_k4cv_psi_new</a>             (<em class="parameter"><code><span class="type">void</span></code></em>);
-</pre>
-</div>
-<div class="refsect1">
-<a name="hkl-hkl-pseudoaxis-k4cv-private.description"></a><h2>Description</h2>
-</div>
-<div class="refsect1">
-<a name="hkl-hkl-pseudoaxis-k4cv-private.details"></a><h2>Details</h2>
-<div class="refsect2">
-<a name="hkl-engine-k4cv-hkl-new"></a><h3>hkl_engine_k4cv_hkl_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_k4cv_hkl_new             (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-engine-k4cv-psi-new"></a><h3>hkl_engine_k4cv_psi_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_k4cv_psi_new             (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-</div>
-</div>
-</div>
-<div class="footer">
-<hr>
-          Generated by GTK-Doc V1.18</div>
-</body>
-</html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-k6c-private.html b/Documentation/api/html/hkl-hkl-pseudoaxis-k6c-private.html
deleted file mode 100644
index bfb2aa1..0000000
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-k6c-private.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-pseudoaxis-k6c-private</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
-<link rel="home" href="index.html" title="hkl Reference Manual">
-<link rel="up" href="ch01.html" title="[Insert title here]">
-<link rel="prev" href="hkl-hkl-pseudoaxis-k4cv-private.html" title="hkl-pseudoaxis-k4cv-private">
-<link rel="next" href="hkl-hkl-pseudoaxis-petra3-private.html" title="hkl-pseudoaxis-petra3-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
-<link rel="stylesheet" href="style.css" type="text/css">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-pseudoaxis-k4cv-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-pseudoaxis-petra3-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-pseudoaxis-k6c-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-pseudoaxis-k6c-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
-<div class="refentry">
-<a name="hkl-hkl-pseudoaxis-k6c-private"></a><div class="titlepage"></div>
-<div class="refnamediv"><table width="100%"><tr>
-<td valign="top">
-<h2><span class="refentrytitle"><a name="hkl-hkl-pseudoaxis-k6c-private.top_of_page"></a>hkl-pseudoaxis-k6c-private</span></h2>
-<p>hkl-pseudoaxis-k6c-private</p>
-</td>
-<td valign="top" align="right"></td>
-</tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-pseudoaxis-k6c-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-k6c-private.html#hkl-engine-k6c-hkl-new" title="hkl_engine_k6c_hkl_new ()">hkl_engine_k6c_hkl_new</a>              (<em class="parameter"><code><span class="type">void</span></code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-k6c-private.html#hkl-engine-k6c-psi-new" title="hkl_engine_k6c_psi_new ()">hkl_engine_k6c_psi_new</a>              (<em class="parameter"><code><span class="type">void</span></code></em>);
-</pre>
-</div>
-<div class="refsect1">
-<a name="hkl-hkl-pseudoaxis-k6c-private.description"></a><h2>Description</h2>
-</div>
-<div class="refsect1">
-<a name="hkl-hkl-pseudoaxis-k6c-private.details"></a><h2>Details</h2>
-<div class="refsect2">
-<a name="hkl-engine-k6c-hkl-new"></a><h3>hkl_engine_k6c_hkl_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_k6c_hkl_new              (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-engine-k6c-psi-new"></a><h3>hkl_engine_k6c_psi_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_k6c_psi_new              (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-</div>
-</div>
-</div>
-<div class="footer">
-<hr>
-          Generated by GTK-Doc V1.18</div>
-</body>
-</html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-petra3-private.html b/Documentation/api/html/hkl-hkl-pseudoaxis-petra3-private.html
deleted file mode 100644
index 4998128..0000000
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-petra3-private.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-pseudoaxis-petra3-private</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
-<link rel="home" href="index.html" title="hkl Reference Manual">
-<link rel="up" href="ch01.html" title="[Insert title here]">
-<link rel="prev" href="hkl-hkl-pseudoaxis-k6c-private.html" title="hkl-pseudoaxis-k6c-private">
-<link rel="next" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
-<link rel="stylesheet" href="style.css" type="text/css">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-pseudoaxis-k6c-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-pseudoaxis-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-pseudoaxis-petra3-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-pseudoaxis-petra3-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
-<div class="refentry">
-<a name="hkl-hkl-pseudoaxis-petra3-private"></a><div class="titlepage"></div>
-<div class="refnamediv"><table width="100%"><tr>
-<td valign="top">
-<h2><span class="refentrytitle"><a name="hkl-hkl-pseudoaxis-petra3-private.top_of_page"></a>hkl-pseudoaxis-petra3-private</span></h2>
-<p>hkl-pseudoaxis-petra3-private</p>
-</td>
-<td valign="top" align="right"></td>
-</tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-pseudoaxis-petra3-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-petra3-private.html#hkl-engine-petra3-p09-eh2-hkl-new" title="hkl_engine_petra3_p09_eh2_hkl_new ()">hkl_engine_petra3_p09_eh2_hkl_new</a>   (<em class="parameter"><code><span class="type">void</span></code></em>);
-</pre>
-</div>
-<div class="refsect1">
-<a name="hkl-hkl-pseudoaxis-petra3-private.description"></a><h2>Description</h2>
-</div>
-<div class="refsect1">
-<a name="hkl-hkl-pseudoaxis-petra3-private.details"></a><h2>Details</h2>
-<div class="refsect2">
-<a name="hkl-engine-petra3-p09-eh2-hkl-new"></a><h3>hkl_engine_petra3_p09_eh2_hkl_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_petra3_p09_eh2_hkl_new   (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-</div>
-</div>
-</div>
-<div class="footer">
-<hr>
-          Generated by GTK-Doc V1.18</div>
-</body>
-</html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-private.html b/Documentation/api/html/hkl-hkl-pseudoaxis-private.html
index eeafb78..372d6c8 100644
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-private.html
+++ b/Documentation/api/html/hkl-hkl-pseudoaxis-private.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-pseudoaxis-private</title>
+<title>hkl Reference Manual: hkl-pseudoaxis-private</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
-<link rel="prev" href="hkl-hkl-pseudoaxis-petra3-private.html" title="hkl-pseudoaxis-petra3-private">
-<link rel="next" href="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html" title="hkl-pseudoaxis-soleil-sixs-med-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<link rel="prev" href="hkl-hkl-pseudoaxis-common-q-private.html" title="hkl-pseudoaxis-common-q-private">
+<link rel="next" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-pseudoaxis-petra3-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-pseudoaxis-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-pseudoaxis-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-pseudoaxis-private.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-pseudoaxis-common-q-private.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-quaternion-private.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-hkl-pseudoaxis-private"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,111 +29,187 @@
 <h2><span class="refentrytitle"><a name="hkl-hkl-pseudoaxis-private.top_of_page"></a>hkl-pseudoaxis-private</span></h2>
 <p>hkl-pseudoaxis-private</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-pseudoaxis-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">#define             <a class="link" href="hkl-hkl-pseudoaxis-private.html#HKL-ENGINE-OPERATIONS-DEFAULTS:CAPS" title="HKL_ENGINE_OPERATIONS_DEFAULTS">HKL_ENGINE_OPERATIONS_DEFAULTS</a>
-#define             <a class="link" href="hkl-hkl-pseudoaxis-private.html#HKL-MODE-OPERATIONS-DEFAULTS:CAPS" title="HKL_MODE_OPERATIONS_DEFAULTS">HKL_MODE_OPERATIONS_DEFAULTS</a>
-                    <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine">HklEngine</a>;
-struct              <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineInfo" title="struct HklEngineInfo">HklEngineInfo</a>;
-                    <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineList" title="HklEngineList">HklEngineList</a>;
-struct              <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineOperations" title="struct HklEngineOperations">HklEngineOperations</a>;
-                    <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="HklMode">HklMode</a>;
-struct              <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklModeInfo" title="struct HklModeInfo">HklModeInfo</a>;
-struct              <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklModeOperations" title="struct HklModeOperations">HklModeOperations</a>;
-                    <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklPseudoAxis" title="HklPseudoAxis">HklPseudoAxis</a>;
-#define             <a class="link" href="hkl-hkl-pseudoaxis-private.html#INFO:CAPS" title="INFO()">INFO</a>                                (n,
-                                                         ax)
-#define             <a class="link" href="hkl-hkl-pseudoaxis-private.html#INFO-WITH-PARAMS:CAPS" title="INFO_WITH_PARAMS()">INFO_WITH_PARAMS</a>                    (name,
-                                                         axes,
-                                                         parameters)
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-pseudoaxis-private.html#hkl-engine-init" title="hkl_engine_init ()">hkl_engine_init</a>                     (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineInfo" title="struct HklEngineInfo"><span class="type">HklEngineInfo</span></a> *info</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineOperations" title="struct HklEngineOperations"><span class="type">HklEngineOperations</span></a> *ops</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis-private.html#hkl-engine-list-add" title="hkl_engine_list_add ()">hkl_engine_list_add</a>                 (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineList" title="HklEngineList"><span class="type">HklEngineList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-pseudoaxis-private.html#hkl-engine-list-clear" title="hkl_engine_list_clear ()">hkl_engine_list_clear</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineList" title="HklEngineList"><span class="type">HklEngineList</span></a> *self</code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineList" title="HklEngineList"><span class="returnvalue">HklEngineList</span></a> *     <a class="link" href="hkl-hkl-pseudoaxis-private.html#hkl-engine-list-new" title="hkl_engine_list_new ()">hkl_engine_list_new</a>                 (<em class="parameter"><code><span class="type">void</span></code></em>);
-const <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineList" title="HklEngineList"><span class="returnvalue">HklEngineList</span></a> * <a class="link" href="hkl-hkl-pseudoaxis-private.html#hkl-engine-list-new-copy" title="hkl_engine_list_new_copy ()">hkl_engine_list_new_copy</a>          (<em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineList" title="HklEngineList"><span class="type">HklEngineList</span></a> *self</code></em>);
-<a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *      <a class="link" href="hkl-hkl-pseudoaxis-private.html#hkl-parameter-new-pseudo-axis" title="hkl_parameter_new_pseudo_axis ()">hkl_parameter_new_pseudo_axis</a>       (<em class="parameter"><code>const <a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *parameter</cod [...]
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>);
-uint                <a class="link" href="hkl-hkl-pseudoaxis-private.html#i" title="i">i</a>;
-<a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *      <a class="link" href="hkl-hkl-pseudoaxis-private.html#register-pseudo-axis" title="register_pseudo_axis ()">register_pseudo_axis</a>                (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="type">HklEngine</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *parameter</code></em>);
-HklMode *           <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#self" title="self">self</a>;
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-pseudoaxis-private.html#unregister-pseudo-axis" title="unregister_pseudo_axis ()">unregister_pseudo_axis</a>              (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *pseudo_axis</code></em>);
-</pre>
+<div class="refsect1">
+<a name="hkl-hkl-pseudoaxis-private.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-private.html#HKL-MODE-INFO:CAPS" title="HKL_MODE_INFO()">HKL_MODE_INFO</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-pseudoaxis-private.html#HKL-MODE-INFO-WITH-PARAMS:CAPS" title="HKL_MODE_INFO_WITH_PARAMS()">HKL_MODE_INFO_WITH_PARAMS</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">return</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#g-quark-from-static-string" title="g_quark_from_static_string ()">g_quark_from_static_string</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-pseudoaxis-private.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="name">
+<col class="description">
+</colgroup>
+<tbody>
+<tr>
+<td class="typedef_keyword">typedef</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-private.html#darray-mode" title="darray_mode">darray_mode</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklPseudoAxis" title="struct HklPseudoAxis">HklPseudoAxis</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HKL-PARAMETER-OPERATIONS-PSEUDOAXIS-DEFAULTS:CAPS" title="HKL_PARAMETER_OPERATIONS_PSEUDOAXIS_DEFAULTS">HKL_PARAMETER_OPERATIONS_PSEUDOAXIS_DEFAULTS</a></td>
+</tr>
+<tr>
+<td class="variable_type">HklPseudoAxis *</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-private.html#pseudo-axis" title="pseudo_axis">pseudo_axis</a></td>
+</tr>
+<tr>
+<td class="variable_type">HklParameter *</td>
+<td class="function_name"><a class="link" href="hkl-hkl-parameter-private.html#dup" title="dup">dup</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklModeInfo" title="struct HklModeInfo">HklModeInfo</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklModeOperations" title="struct HklModeOperations">HklModeOperations</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HKL-MODE-OPERATIONS-DEFAULTS:CAPS" title="HKL_MODE_OPERATIONS_DEFAULTS">HKL_MODE_OPERATIONS_DEFAULTS</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklMode" title="struct HklMode">HklMode</a></td>
+</tr>
+<tr>
+<td class="variable_type">HklModeAutoWithInit *</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#self" title="self">self</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineInfo" title="struct HklEngineInfo">HklEngineInfo</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklEngine" title="HklEngine">HklEngine</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklEngineList" title="HklEngineList">HklEngineList</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HKL-ENGINE-ERROR:CAPS" title="HKL_ENGINE_ERROR">HKL_ENGINE_ERROR</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">enum</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineError" title="enum HklEngineError">HklEngineError</a></td>
+</tr>
+<tr>
+<td class="variable_type">uint </td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-private.html#i" title="i">i</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineOperations" title="struct HklEngineOperations">HklEngineOperations</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HKL-ENGINE-OPERATIONS-DEFAULTS:CAPS" title="HKL_ENGINE_OPERATIONS_DEFAULTS">HKL_ENGINE_OPERATIONS_DEFAULTS</a></td>
+</tr>
+<tr>
+<td class="variable_type">HklParameter *</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-private.html#axis" title="axis">axis</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HKL-ENGINE-LIST-ERROR:CAPS" title="HKL_ENGINE_LIST_ERROR">HKL_ENGINE_LIST_ERROR</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">enum</td>
+<td class="function_name"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineListError" title="enum HklEngineListError">HklEngineListError</a></td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-private.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-hkl-pseudoaxis-private.details"></a><h2>Details</h2>
+<a name="hkl-hkl-pseudoaxis-private.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
-<a name="HKL-ENGINE-OPERATIONS-DEFAULTS:CAPS"></a><h3>HKL_ENGINE_OPERATIONS_DEFAULTS</h3>
-<pre class="programlisting">#define             HKL_ENGINE_OPERATIONS_DEFAULTS</pre>
+<a name="HKL-MODE-INFO:CAPS"></a><h3>HKL_MODE_INFO()</h3>
+<pre class="programlisting">#define HKL_MODE_INFO(_name, _axes_r, _axes_w) .name=_name, .axes_r=DARRAY(_axes_r), .axes_w=DARRAY(_axes_w)
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="HKL-MODE-OPERATIONS-DEFAULTS:CAPS"></a><h3>HKL_MODE_OPERATIONS_DEFAULTS</h3>
-<pre class="programlisting">#define             HKL_MODE_OPERATIONS_DEFAULTS</pre>
+<a name="HKL-MODE-INFO-WITH-PARAMS:CAPS"></a><h3>HKL_MODE_INFO_WITH_PARAMS()</h3>
+<pre class="programlisting">#define             HKL_MODE_INFO_WITH_PARAMS(_name, _axes_r, _axes_w, _parameters)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="HklEngine"></a><h3>HklEngine</h3>
-<pre class="programlisting">typedef struct {
-	const HklEngineInfo *info;
-	const HklEngineOperations *ops;
-	HklGeometry *geometry;
-	HklDetector *detector;
-	HklSample *sample;
-	HklMode *mode; /* not owned */
-	HklEngineList *engines; /* not owned */
-	darray_parameter pseudo_axes;
-	darray_mode modes;
-	darray_parameter axes;
-} HklEngine;
+<a name="g-quark-from-static-string"></a><h3>g_quark_from_static_string ()</h3>
+<pre class="programlisting"><span class="returnvalue">return</span>
+g_quark_from_static_string ();</pre>
+</div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-pseudoaxis-private.other_details"></a><h2>Types and Values</h2>
+<div class="refsect2">
+<a name="darray-mode"></a><h3>darray_mode</h3>
+<pre class="programlisting">typedef darray(HklMode *) darray_mode;
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="HklEngineInfo"></a><h3>struct HklEngineInfo</h3>
-<pre class="programlisting">struct HklEngineInfo {
-	const char *name;
-	const HklPseudoAxis **pseudo_axes;
-	uint n_pseudo_axes;
+<a name="HklPseudoAxis"></a><h3>struct HklPseudoAxis</h3>
+<pre class="programlisting">struct HklPseudoAxis {
+	HklParameter parameter;
+	HklEngine *engine;
 };
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="HklEngineList"></a><h3>HklEngineList</h3>
-<pre class="programlisting">typedef struct {
-	_darray(HklEngine *);
-	HklGeometryList *geometries;
-	HklGeometry *geometry;
-	HklDetector *detector;
-	HklSample *sample;
-} HklEngineList;
-</pre>
+<a name="HKL-PARAMETER-OPERATIONS-PSEUDOAXIS-DEFAULTS:CAPS"></a><h3>HKL_PARAMETER_OPERATIONS_PSEUDOAXIS_DEFAULTS</h3>
+<pre class="programlisting">#define             HKL_PARAMETER_OPERATIONS_PSEUDOAXIS_DEFAULTS</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="HklEngineOperations"></a><h3>struct HklEngineOperations</h3>
-<pre class="programlisting">struct HklEngineOperations {
-	void (*free)(HklEngine *self);
-};
+<a name="pseudo-axis"></a><h3>pseudo_axis</h3>
+<pre class="programlisting">	HklPseudoAxis *pseudo_axis = container_of(self, HklPseudoAxis, parameter);
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="HklMode"></a><h3>HklMode</h3>
-<pre class="programlisting">typedef struct {
-	const HklModeInfo *info;
-	const HklModeOperations *ops;
-	darray_parameter parameters;
-} HklMode;
+<a name="dup"></a><h3>dup</h3>
+<pre class="programlisting">	HklParameter *dup = HKL_MALLOC(HklParameter);
 </pre>
 </div>
 <hr>
@@ -145,10 +217,9 @@ HklMode *           <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#s
 <a name="HklModeInfo"></a><h3>struct HklModeInfo</h3>
 <pre class="programlisting">struct HklModeInfo {
 	const char *name;
-	const char **axes;
-	uint n_axes;
-	const HklParameter *parameters;
-	uint n_parameters;
+	const darray_string axes_r;
+	const darray_string axes_w;
+	const darray(const HklParameter) parameters;
 };
 </pre>
 </div>
@@ -156,163 +227,224 @@ HklMode *           <a class="link" href="hkl-hkl-pseudoaxis-auto-private.html#s
 <div class="refsect2">
 <a name="HklModeOperations"></a><h3>struct HklModeOperations</h3>
 <pre class="programlisting">struct HklModeOperations {
+	unsigned long capabilities;
+
 	void (* free)(HklMode *self);
-	int (* init)(HklMode *self,
-		     HklEngine *engine,
-		     HklGeometry *geometry,
-		     HklDetector *detector,
-		     HklSample *sample,
-		     HklError **error);
+	int (* initialized_get)(const HklMode *self);
+	int (* initialized_set)(HklMode *self,
+				HklEngine *engine,
+				HklGeometry *geometry,
+				HklDetector *detector,
+				HklSample *sample,
+				int initialized,
+				GError **error);
 	int (* get)(HklMode *self,
 		    HklEngine *engine,
 		    HklGeometry *geometry,
 		    HklDetector *detector,
 		    HklSample *sample,
-		    HklError **error);
+		    GError **error);
 	int (* set)(HklMode *self,
 		    HklEngine *engine,
 		    HklGeometry *geometry,
 		    HklDetector *detector,
 		    HklSample *sample,
-		    HklError **error);
+		    GError **error);
 };
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="HklPseudoAxis"></a><h3>HklPseudoAxis</h3>
-<pre class="programlisting">typedef struct {
-	HklParameter parameter;
-	HklEngine *engine;
-} HklPseudoAxis;
+<a name="HKL-MODE-OPERATIONS-DEFAULTS:CAPS"></a><h3>HKL_MODE_OPERATIONS_DEFAULTS</h3>
+<pre class="programlisting">#define             HKL_MODE_OPERATIONS_DEFAULTS</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklMode"></a><h3>struct HklMode</h3>
+<pre class="programlisting">struct HklMode {
+	const HklModeInfo *info;
+	const HklModeOperations *ops;
+	darray_parameter parameters;
+	darray_string parameters_names;
+	int initialized;
+};
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="INFO:CAPS"></a><h3>INFO()</h3>
-<pre class="programlisting">#define INFO(n, ax) .name = n, .axes=ax, .n_axes=ARRAY_SIZE(ax)
+<a name="self"></a><h3>self</h3>
+<pre class="programlisting">	HklModeAutoWithInit *self = container_of(mode, HklModeAutoWithInit, mode);
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="INFO-WITH-PARAMS:CAPS"></a><h3>INFO_WITH_PARAMS()</h3>
-<pre class="programlisting">#define INFO_WITH_PARAMS(name, axes, parameters) INFO(name, axes), .parameters=parameters, .n_parameters=ARRAY_SIZE(parameters)
+<a name="HklEngineInfo"></a><h3>struct HklEngineInfo</h3>
+<pre class="programlisting">struct HklEngineInfo {
+	const char *name;
+	const darray(const HklPseudoAxis *) pseudo_axes;
+};
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklEngine"></a><h3>HklEngine</h3>
+<pre class="programlisting">typedef struct {
+	const HklEngineInfo *info;
+	const HklEngineOperations *ops;
+	HklGeometry *geometry;
+	HklDetector *detector;
+	HklSample *sample;
+	HklMode *mode; /* not owned */
+	HklEngineList *engines; /* not owned */
+	darray_parameter axes;
+	darray_parameter pseudo_axes;
+	darray_string pseudo_axis_names;
+	darray_mode modes;
+	darray_string mode_names;
+} HklEngine;
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklEngineList"></a><h3>HklEngineList</h3>
+<pre class="programlisting">typedef struct {
+	_darray(HklEngine *);
+	HklGeometryList *geometries;
+	HklGeometry *geometry;
+	HklDetector *detector;
+	HklSample *sample;
+} HklEngineList;
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-engine-init"></a><h3>hkl_engine_init ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_engine_init                     (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineInfo" title="struct HklEngineInfo"><span class="type">HklEngineInfo</span></a> *info</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineOperations" title="struct HklEngineOperations"><span class="type">HklEngineOperations</span></a> *ops</code></em>);</pre>
+<a name="HKL-ENGINE-ERROR:CAPS"></a><h3>HKL_ENGINE_ERROR</h3>
+<pre class="programlisting">#define HKL_ENGINE_ERROR hkl_engine_error_quark ()
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-engine-list-add"></a><h3>hkl_engine_list_add ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_engine_list_add                 (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineList" title="HklEngineList"><span class="type">HklEngineList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>);</pre>
-<p>
-add an <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="type">HklEngine</span></a> to the <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineList" title="HklEngineList"><span class="type">HklEngineList</span></a>
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="HklEngineError"></a><h3>enum HklEngineError</h3>
+<div class="refsect3">
+<a name="id-1.2.24.7.16.3"></a><h4>Members</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="300px" class="enum_members_name">
+<col class="enum_members_description">
+<col width="200px" class="enum_members_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the engine list</td>
+<td class="enum_member_name"><p><a name="HKL-ENGINE-ERROR-PSEUDO-AXIS-VALUES-GET:CAPS"></a>HKL_ENGINE_ERROR_PSEUDO_AXIS_VALUES_GET</p></td>
+<td> </td>
+<td> </td>
+</tr>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-ENGINE-ERROR-PSEUDO-AXIS-VALUES-SET:CAPS"></a>HKL_ENGINE_ERROR_PSEUDO_AXIS_VALUES_SET</p></td>
+<td> </td>
+<td> </td>
+</tr>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-ENGINE-ERROR-PSEUDO-AXIS-SET:CAPS"></a>HKL_ENGINE_ERROR_PSEUDO_AXIS_SET</p></td>
+<td> </td>
+<td> </td>
+</tr>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-ENGINE-ERROR-INITIALIZE:CAPS"></a>HKL_ENGINE_ERROR_INITIALIZE</p></td>
+<td> </td>
+<td> </td>
+</tr>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-ENGINE-ERROR-SET:CAPS"></a>HKL_ENGINE_ERROR_SET</p></td>
+<td> </td>
+<td> </td>
+</tr>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-ENGINE-ERROR-GET:CAPS"></a>HKL_ENGINE_ERROR_GET</p></td>
+<td> </td>
+<td> </td>
+</tr>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-ENGINE-ERROR-PARAMETER-GET:CAPS"></a>HKL_ENGINE_ERROR_PARAMETER_GET</p></td>
+<td> </td>
+<td> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>engine</code></em> :</span></p></td>
-<td>the engine to add</td>
+<td class="enum_member_name"><p><a name="HKL-ENGINE-ERROR-PARAMETER-SET:CAPS"></a>HKL_ENGINE_ERROR_PARAMETER_SET</p></td>
+<td> </td>
+<td> </td>
 </tr>
 <tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>HKL_SUCCESS or HKL_FAIL</td>
+<td class="enum_member_name"><p><a name="HKL-ENGINE-ERROR-CURRENT-MODE-SET:CAPS"></a>HKL_ENGINE_ERROR_CURRENT_MODE_SET</p></td>
+<td> </td>
+<td> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
-<hr>
-<div class="refsect2">
-<a name="hkl-engine-list-clear"></a><h3>hkl_engine_list_clear ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_engine_list_clear               (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineList" title="HklEngineList"><span class="type">HklEngineList</span></a> *self</code></em>);</pre>
-<p>
-remove all engine from the engine list
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the engine list to clear</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-engine-list-new"></a><h3>hkl_engine_list_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineList" title="HklEngineList"><span class="returnvalue">HklEngineList</span></a> *     hkl_engine_list_new                 (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-<p>
-default constructor
-</p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-engine-list-new-copy"></a><h3>hkl_engine_list_new_copy ()</h3>
-<pre class="programlisting">const <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineList" title="HklEngineList"><span class="returnvalue">HklEngineList</span></a> * hkl_engine_list_new_copy          (<em class="parameter"><code>const <a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngineList" title="HklEngineList"><span class="type">HklEngineList</span></a> *self</code></em>);</pre>
-<p>
-dummy copy constructor for the binding
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>NULL all the time the structure is non-copyable. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
-</td>
-</tr></tbody>
-</table></div>
+<a name="i"></a><h3>i</h3>
+<pre class="programlisting">	uint i = 0;
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-parameter-new-pseudo-axis"></a><h3>hkl_parameter_new_pseudo_axis ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *      hkl_parameter_new_pseudo_axis       (<em class="parameter"><code>const <a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *parameter</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>);</pre>
+<a name="HklEngineOperations"></a><h3>struct HklEngineOperations</h3>
+<pre class="programlisting">struct HklEngineOperations {
+	void (*free)(HklEngine *self);
+};
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="i"></a><h3>i</h3>
-<pre class="programlisting">	uint i = 0;
+<a name="HKL-ENGINE-OPERATIONS-DEFAULTS:CAPS"></a><h3>HKL_ENGINE_OPERATIONS_DEFAULTS</h3>
+<pre class="programlisting">#define HKL_ENGINE_OPERATIONS_DEFAULTS .free=hkl_engine_free_real
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="register-pseudo-axis"></a><h3>register_pseudo_axis ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *      register_pseudo_axis                (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="type">HklEngine</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *parameter</code></em>);</pre>
+<a name="axis"></a><h3>axis</h3>
+<pre class="programlisting">			HklParameter *axis = hkl_geometry_get_axis_by_name(self->geometry,
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="self"></a><h3>self</h3>
-<pre class="programlisting">	HklMode *self = NULL;
+<a name="HKL-ENGINE-LIST-ERROR:CAPS"></a><h3>HKL_ENGINE_LIST_ERROR</h3>
+<pre class="programlisting">#define HKL_ENGINE_LIST_ERROR hkl_engine_list_error_quark ()
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="unregister-pseudo-axis"></a><h3>unregister_pseudo_axis ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                unregister_pseudo_axis              (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter-private.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *pseudo_axis</code></em>);</pre>
+<a name="HklEngineListError"></a><h3>enum HklEngineListError</h3>
+<div class="refsect3">
+<a name="id-1.2.24.7.22.3"></a><h4>Members</h4>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="300px" class="enum_members_name">
+<col class="enum_members_description">
+<col width="200px" class="enum_members_annotations">
+</colgroup>
+<tbody>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-ENGINE-LIST-ERROR-ENGINE-GET-BY-NAME:CAPS"></a>HKL_ENGINE_LIST_ERROR_ENGINE_GET_BY_NAME</p></td>
+<td> </td>
+<td> </td>
+</tr>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-ENGINE-LIST-ERROR-PSEUDO-AXIS-GET-BY-NAME:CAPS"></a>HKL_ENGINE_LIST_ERROR_PSEUDO_AXIS_GET_BY_NAME</p></td>
+<td> </td>
+<td> </td>
+</tr>
+</tbody>
+</table></div>
+</div>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-soleil-sixs-med-private.html b/Documentation/api/html/hkl-hkl-pseudoaxis-soleil-sixs-med-private.html
deleted file mode 100644
index eddec01..0000000
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-soleil-sixs-med-private.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-pseudoaxis-soleil-sixs-med-private</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
-<link rel="home" href="index.html" title="hkl Reference Manual">
-<link rel="up" href="ch01.html" title="[Insert title here]">
-<link rel="prev" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">
-<link rel="next" href="hkl-hkl-pseudoaxis-zaxis-private.html" title="hkl-pseudoaxis-zaxis-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
-<link rel="stylesheet" href="style.css" type="text/css">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-pseudoaxis-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-pseudoaxis-zaxis-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-pseudoaxis-soleil-sixs-med-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-pseudoaxis-soleil-sixs-med-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
-<div class="refentry">
-<a name="hkl-hkl-pseudoaxis-soleil-sixs-med-private"></a><div class="titlepage"></div>
-<div class="refnamediv"><table width="100%"><tr>
-<td valign="top">
-<h2><span class="refentrytitle"><a name="hkl-hkl-pseudoaxis-soleil-sixs-med-private.top_of_page"></a>hkl-pseudoaxis-soleil-sixs-med-private</span></h2>
-<p>hkl-pseudoaxis-soleil-sixs-med-private</p>
-</td>
-<td valign="top" align="right"></td>
-</tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-pseudoaxis-soleil-sixs-med-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html#hkl-engine-soleil-sixs-med-1-2-hkl-new" title="hkl_engine_soleil_sixs_med_1_2_hkl_new ()">hkl_engine_soleil_sixs_med_1_2_hkl_new</a>
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html#hkl-engine-soleil-sixs-med-2-2-hkl-new" title="hkl_engine_soleil_sixs_med_2_2_hkl_new ()">hkl_engine_soleil_sixs_med_2_2_hkl_new</a>
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html#hkl-engine-soleil-sixs-med-2-3-hkl-new" title="hkl_engine_soleil_sixs_med_2_3_hkl_new ()">hkl_engine_soleil_sixs_med_2_3_hkl_new</a>
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html#hkl-geometry-list-multiply-soleil-sixs-med-2-3" title="hkl_geometry_list_multiply_soleil_sixs_med_2_3 ()">hkl_geometry_list_multiply_soleil_sixs_med_2_3</a>
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryListItem" title="HklGeometryListItem"><span class="type">HklGeometryListItem</span></a> *item</code></em>);
-</pre>
-</div>
-<div class="refsect1">
-<a name="hkl-hkl-pseudoaxis-soleil-sixs-med-private.description"></a><h2>Description</h2>
-</div>
-<div class="refsect1">
-<a name="hkl-hkl-pseudoaxis-soleil-sixs-med-private.details"></a><h2>Details</h2>
-<div class="refsect2">
-<a name="hkl-engine-soleil-sixs-med-1-2-hkl-new"></a><h3>hkl_engine_soleil_sixs_med_1_2_hkl_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_soleil_sixs_med_1_2_hkl_new
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-engine-soleil-sixs-med-2-2-hkl-new"></a><h3>hkl_engine_soleil_sixs_med_2_2_hkl_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_soleil_sixs_med_2_2_hkl_new
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-engine-soleil-sixs-med-2-3-hkl-new"></a><h3>hkl_engine_soleil_sixs_med_2_3_hkl_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_soleil_sixs_med_2_3_hkl_new
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-geometry-list-multiply-soleil-sixs-med-2-3"></a><h3>hkl_geometry_list_multiply_soleil_sixs_med_2_3 ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_multiply_soleil_sixs_med_2_3
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry-private.html#HklGeometryListItem" title="HklGeometryListItem"><span class="type">HklGeometryListItem</span></a> *item</code></em>);</pre>
-</div>
-</div>
-</div>
-<div class="footer">
-<hr>
-          Generated by GTK-Doc V1.18</div>
-</body>
-</html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-zaxis-private.html b/Documentation/api/html/hkl-hkl-pseudoaxis-zaxis-private.html
deleted file mode 100644
index 52c2c00..0000000
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-zaxis-private.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-pseudoaxis-zaxis-private</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
-<link rel="home" href="index.html" title="hkl Reference Manual">
-<link rel="up" href="ch01.html" title="[Insert title here]">
-<link rel="prev" href="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html" title="hkl-pseudoaxis-soleil-sixs-med-private">
-<link rel="next" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
-<link rel="stylesheet" href="style.css" type="text/css">
-</head>
-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-quaternion-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-pseudoaxis-zaxis-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-pseudoaxis-zaxis-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
-<div class="refentry">
-<a name="hkl-hkl-pseudoaxis-zaxis-private"></a><div class="titlepage"></div>
-<div class="refnamediv"><table width="100%"><tr>
-<td valign="top">
-<h2><span class="refentrytitle"><a name="hkl-hkl-pseudoaxis-zaxis-private.top_of_page"></a>hkl-pseudoaxis-zaxis-private</span></h2>
-<p>hkl-pseudoaxis-zaxis-private</p>
-</td>
-<td valign="top" align="right"></td>
-</tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-pseudoaxis-zaxis-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-zaxis-private.html#hkl-engine-zaxis-hkl-new" title="hkl_engine_zaxis_hkl_new ()">hkl_engine_zaxis_hkl_new</a>            (<em class="parameter"><code><span class="type">void</span></code></em>);
-</pre>
-</div>
-<div class="refsect1">
-<a name="hkl-hkl-pseudoaxis-zaxis-private.description"></a><h2>Description</h2>
-</div>
-<div class="refsect1">
-<a name="hkl-hkl-pseudoaxis-zaxis-private.details"></a><h2>Details</h2>
-<div class="refsect2">
-<a name="hkl-engine-zaxis-hkl-new"></a><h3>hkl_engine_zaxis_hkl_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-private.html#HklEngine" title="HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_zaxis_hkl_new            (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-</div>
-</div>
-</div>
-<div class="footer">
-<hr>
-          Generated by GTK-Doc V1.18</div>
-</body>
-</html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-quaternion-private.html b/Documentation/api/html/hkl-hkl-quaternion-private.html
index 3b32b2e..1df48c1 100644
--- a/Documentation/api/html/hkl-hkl-quaternion-private.html
+++ b/Documentation/api/html/hkl-hkl-quaternion-private.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-quaternion-private</title>
+<title>hkl Reference Manual: hkl-quaternion-private</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
-<link rel="prev" href="hkl-hkl-pseudoaxis-zaxis-private.html" title="hkl-pseudoaxis-zaxis-private">
+<link rel="prev" href="hkl-hkl-pseudoaxis-private.html" title="hkl-pseudoaxis-private">
 <link rel="next" href="hkl-hkl-sample-private.html" title="hkl-sample-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-pseudoaxis-zaxis-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-sample-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-quaternion-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-quaternion-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-quaternion-private.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-pseudoaxis-private.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-sample-private.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-hkl-quaternion-private"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,387 +29,519 @@
 <h2><span class="refentrytitle"><a name="hkl-hkl-quaternion-private.top_of_page"></a>hkl-quaternion-private</span></h2>
 <p>hkl-quaternion-private</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-quaternion-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion">HklQuaternion</a>;
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-cmp" title="hkl_quaternion_cmp ()">hkl_quaternion_cmp</a>                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *q</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-conjugate" title="hkl_quaternion_conjugate ()">hkl_quaternion_conjugate</a>            (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>);
-<a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="returnvalue">HklQuaternion</span></a> *     <a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-dup" title="hkl_quaternion_dup ()">hkl_quaternion_dup</a>                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-fprintf" title="hkl_quaternion_fprintf ()">hkl_quaternion_fprintf</a>              (<em class="parameter"><code><span class="type">FILE</span> *file</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-free" title="hkl_quaternion_free ()">hkl_quaternion_free</a>                 (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-init" title="hkl_quaternion_init ()">hkl_quaternion_init</a>                 (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> a</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> b</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> c</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> d</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-init-from-angle-and-axe" title="hkl_quaternion_init_from_angle_and_axe ()">hkl_quaternion_init_from_angle_and_axe</a>
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> angle</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-init-from-vector" title="hkl_quaternion_init_from_vector ()">hkl_quaternion_init_from_vector</a>     (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-minus-quaternion" title="hkl_quaternion_minus_quaternion ()">hkl_quaternion_minus_quaternion</a>     (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *q</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-norm2" title="hkl_quaternion_norm2 ()">hkl_quaternion_norm2</a>                (<em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-times-quaternion" title="hkl_quaternion_times_quaternion ()">hkl_quaternion_times_quaternion</a>     (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *q</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-to-angle-and-axe" title="hkl_quaternion_to_angle_and_axe ()">hkl_quaternion_to_angle_and_axe</a>     (<em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> *angle</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-to-matrix" title="hkl_quaternion_to_matrix ()">hkl_quaternion_to_matrix</a>            (<em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *m</code></em>);
-</pre>
-</div>
-<div class="refsect1">
-<a name="hkl-hkl-quaternion-private.description"></a><h2>Description</h2>
-</div>
 <div class="refsect1">
-<a name="hkl-hkl-quaternion-private.details"></a><h2>Details</h2>
-<div class="refsect2">
-<a name="HklQuaternion"></a><h3>HklQuaternion</h3>
-<pre class="programlisting">typedef struct {
-	double data[4];
-} HklQuaternion;
-</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-quaternion-cmp"></a><h3>hkl_quaternion_cmp ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_quaternion_cmp                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *q</code></em>);</pre>
-<p>
-compare two <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a>.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-hkl-quaternion-private.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="functions_return">
+<col class="functions_name">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the first <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="returnvalue">HklQuaternion</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-dup" title="hkl_quaternion_dup ()">hkl_quaternion_dup</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-free" title="hkl_quaternion_free ()">hkl_quaternion_free</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-init" title="hkl_quaternion_init ()">hkl_quaternion_init</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-init-from-vector" title="hkl_quaternion_init_from_vector ()">hkl_quaternion_init_from_vector</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-init-from-angle-and-axe" title="hkl_quaternion_init_from_angle_and_axe ()">hkl_quaternion_init_from_angle_and_axe</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-fprintf" title="hkl_quaternion_fprintf ()">hkl_quaternion_fprintf</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-cmp" title="hkl_quaternion_cmp ()">hkl_quaternion_cmp</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-minus-quaternion" title="hkl_quaternion_minus_quaternion ()">hkl_quaternion_minus_quaternion</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-times-quaternion" title="hkl_quaternion_times_quaternion ()">hkl_quaternion_times_quaternion</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">double</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-norm2" title="hkl_quaternion_norm2 ()">hkl_quaternion_norm2</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-conjugate" title="hkl_quaternion_conjugate ()">hkl_quaternion_conjugate</a> <span class="c_punctuation">()</span>
 </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>q</code></em> :</span></p></td>
-<td>the second <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-to-matrix" title="hkl_quaternion_to_matrix ()">hkl_quaternion_to_matrix</a> <span class="c_punctuation">()</span>
 </td>
 </tr>
 <tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-<a href="hkl-hkl-macros.html#HKL-TRUE:CAPS"><span class="type">HKL_TRUE</span></a> if both are equal, <a href="hkl-hkl-macros.html#HKL-FALSE:CAPS"><span class="type">HKL_FALSE</span></a> otherwise.</td>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-quaternion-private.html#hkl-quaternion-to-angle-and-axe" title="hkl_quaternion_to_angle_and_axe ()">hkl_quaternion_to_angle_and_axe</a> <span class="c_punctuation">()</span>
+</td>
 </tr>
 </tbody>
 </table></div>
 </div>
-<hr>
+<div class="refsect1">
+<a name="hkl-hkl-quaternion-private.description"></a><h2>Description</h2>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-quaternion-private.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
-<a name="hkl-quaternion-conjugate"></a><h3>hkl_quaternion_conjugate ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_quaternion_conjugate            (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>);</pre>
-<p>
-compute the conjugate of a quaternion
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to conjugate</td>
-</tr></tbody>
-</table></div>
+<a name="hkl-quaternion-dup"></a><h3>hkl_quaternion_dup ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="returnvalue">HklQuaternion</span></a> *
+hkl_quaternion_dup (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>);</pre>
+<div class="refsect3">
+<a name="id-1.2.25.5.2.4"></a><h4>Returns</h4>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-quaternion-dup"></a><h3>hkl_quaternion_dup ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="returnvalue">HklQuaternion</span></a> *     hkl_quaternion_dup                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>);</pre>
+<a name="hkl-quaternion-free"></a><h3>hkl_quaternion_free ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_quaternion_free (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-quaternion-fprintf"></a><h3>hkl_quaternion_fprintf ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_quaternion_fprintf              (<em class="parameter"><code><span class="type">FILE</span> *file</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>);</pre>
-<p>
-print an <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> into a FILE stream
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-quaternion-init"></a><h3>hkl_quaternion_init ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_quaternion_init (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
+                     <em class="parameter"><code><span class="type">double</span> a</code></em>,
+                     <em class="parameter"><code><span class="type">double</span> b</code></em>,
+                     <em class="parameter"><code><span class="type">double</span> c</code></em>,
+                     <em class="parameter"><code><span class="type">double</span> d</code></em>);</pre>
+<p>initialize the four elements of an <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a></p>
+<div class="refsect3">
+<a name="id-1.2.25.5.4.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>file</code></em> :</span></p></td>
-<td>the file to send the <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> into</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> to initialize</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to write into the file stream.</td>
+<td class="parameter_name"><p>a</p></td>
+<td class="parameter_description"><p>the 1st element value</p></td>
+<td class="parameter_annotations"> </td>
+</tr>
+<tr>
+<td class="parameter_name"><p>b</p></td>
+<td class="parameter_description"><p>the 2nd element value</p></td>
+<td class="parameter_annotations"> </td>
+</tr>
+<tr>
+<td class="parameter_name"><p>c</p></td>
+<td class="parameter_description"><p>the 3rd element value</p></td>
+<td class="parameter_annotations"> </td>
+</tr>
+<tr>
+<td class="parameter_name"><p>d</p></td>
+<td class="parameter_description"><p>the 4th element value</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
-<hr>
-<div class="refsect2">
-<a name="hkl-quaternion-free"></a><h3>hkl_quaternion_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_quaternion_free                 (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-quaternion-init"></a><h3>hkl_quaternion_init ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_quaternion_init                 (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> a</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> b</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> c</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> d</code></em>);</pre>
-<p>
-initialize the four elements of an <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a>
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-quaternion-init-from-vector"></a><h3>hkl_quaternion_init_from_vector ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_quaternion_init_from_vector (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
+                                 <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v</code></em>);</pre>
+<p>initialize an <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> from an <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p>
+<div class="refsect3">
+<a name="id-1.2.25.5.5.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to initialize</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> to set</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
-<td>the 1st element value</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>b</code></em> :</span></p></td>
-<td>the 2nd element value</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td>
-<td>the 3rd element value</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>d</code></em> :</span></p></td>
-<td>the 4th element value</td>
+<td class="parameter_name"><p>v</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> used to set the self <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-quaternion-init-from-angle-and-axe"></a><h3>hkl_quaternion_init_from_angle_and_axe ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_quaternion_init_from_angle_and_axe
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> angle</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v</code></em>);</pre>
-<p>
-initialize an <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> from a vector and a angle.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-quaternion-init-from-angle-and-axe"></a><h3>hkl_quaternion_init_from_angle_and_axe ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_quaternion_init_from_angle_and_axe
+                               (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
+                                <em class="parameter"><code><span class="type">double</span> angle</code></em>,
+                                <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v</code></em>);</pre>
+<p>initialize an <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> from a vector and a angle.</p>
+<div class="refsect3">
+<a name="id-1.2.25.5.6.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to set</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> to set</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>angle</code></em> :</span></p></td>
-<td>the angles of the rotation</td>
+<td class="parameter_name"><p>angle</p></td>
+<td class="parameter_description"><p>the angles of the rotation</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>v</code></em> :</span></p></td>
-<td>the axe of rotation</td>
+<td class="parameter_name"><p>v</p></td>
+<td class="parameter_description"><p>the axe of rotation</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-quaternion-init-from-vector"></a><h3>hkl_quaternion_init_from_vector ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_quaternion_init_from_vector     (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v</code></em>);</pre>
-<p>
-initialize an <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> from an <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-quaternion-fprintf"></a><h3>hkl_quaternion_fprintf ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_quaternion_fprintf (<em class="parameter"><code><span class="type">FILE</span> *file</code></em>,
+                        <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>);</pre>
+<p>print an <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> into a FILE stream</p>
+<div class="refsect3">
+<a name="id-1.2.25.5.7.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to set</td>
+<td class="parameter_name"><p>file</p></td>
+<td class="parameter_description"><p>the file to send the <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> into</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>v</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> used to set the self <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a>
-</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> to write into the file stream.</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-quaternion-minus-quaternion"></a><h3>hkl_quaternion_minus_quaternion ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_quaternion_minus_quaternion     (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *q</code></em>);</pre>
-<p>
-substract two <a href="hkl-hkl-vector-private.html#HklQuaternion"><span class="type">HklQuaternions</span></a>
-Todo: test
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-quaternion-cmp"></a><h3>hkl_quaternion_cmp ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_quaternion_cmp (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
+                    <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> *q</code></em>);</pre>
+<p>compare two <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a>.</p>
+<div class="refsect3">
+<a name="id-1.2.25.5.8.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to modify.</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the first <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>q</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to substract</td>
+<td class="parameter_name"><p>q</p></td>
+<td class="parameter_description"><p>the second <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+<div class="refsect3">
+<a name="id-1.2.25.5.8.6"></a><h4>Returns</h4>
+<p> <span class="type">TRUE</span> if both are equal, <span class="type">FALSE</span> otherwise.</p>
+<p></p>
+</div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-quaternion-norm2"></a><h3>hkl_quaternion_norm2 ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_quaternion_norm2                (<em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>);</pre>
-<p>
-compute the norm2 of an <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a>
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-quaternion-minus-quaternion"></a><h3>hkl_quaternion_minus_quaternion ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_quaternion_minus_quaternion (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
+                                 <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> *q</code></em>);</pre>
+<p>substract two <a href="hkl-hkl.html#HklQuaternion"><span class="type">HklQuaternions</span></a>
+Todo: test</p>
+<div class="refsect3">
+<a name="id-1.2.25.5.9.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the quaternion use to compute the norm</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> to modify.</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>the self <span class="type">hklquaternion</span> norm</td>
+<td class="parameter_name"><p>q</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> to substract</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-quaternion-times-quaternion"></a><h3>hkl_quaternion_times_quaternion ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_quaternion_times_quaternion     (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *q</code></em>);</pre>
-<p>
-multiply two quaternions
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-quaternion-times-quaternion"></a><h3>hkl_quaternion_times_quaternion ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_quaternion_times_quaternion (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
+                                 <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> *q</code></em>);</pre>
+<p>multiply two quaternions</p>
+<div class="refsect3">
+<a name="id-1.2.25.5.10.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to modify</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> to modify</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>q</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to multiply by</td>
+<td class="parameter_name"><p>q</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> to multiply by</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-quaternion-to-angle-and-axe"></a><h3>hkl_quaternion_to_angle_and_axe ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_quaternion_to_angle_and_axe     (<em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> *angle</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v</code></em>);</pre>
-<p>
-compute the axe and angle of the unitary quaternion angle [-pi, pi]
-if q is the (1, 0, 0, 0) quaternion return the (0,0,0) axe and a 0 angle
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-quaternion-norm2"></a><h3>hkl_quaternion_norm2 ()</h3>
+<pre class="programlisting"><span class="returnvalue">double</span>
+hkl_quaternion_norm2 (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>);</pre>
+<p>compute the norm2 of an <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a></p>
+<div class="refsect3">
+<a name="id-1.2.25.5.11.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>The <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> use to compute the angle and the roation axis.</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>angle</code></em> :</span></p></td>
-<td>the returned angle of the rotation.</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>v</code></em> :</span></p></td>
-<td>the returned axis of the rotation.</td>
-</tr>
-</tbody>
+<tbody><tr>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the quaternion use to compute the norm</p></td>
+<td class="parameter_annotations"> </td>
+</tr></tbody>
 </table></div>
 </div>
+<div class="refsect3">
+<a name="id-1.2.25.5.11.6"></a><h4>Returns</h4>
+<p> the self <span class="type">hklquaternion</span> norm</p>
+<p></p>
+</div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-quaternion-to-matrix"></a><h3>hkl_quaternion_to_matrix ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_quaternion_to_matrix            (<em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *m</code></em>);</pre>
-<p>
-Compute the rotation matrix of a Quaternion.
-</p>
-<p>
-compute the rotation matrix corresponding to the unitary quaternion.
-\f$ q = a + b \cdot i + c \cdot j + d \cdot k \f$
-</p>
-<p>
-\f$
+<a name="hkl-quaternion-conjugate"></a><h3>hkl_quaternion_conjugate ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_quaternion_conjugate (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>);</pre>
+<p>compute the conjugate of a quaternion</p>
+<div class="refsect3">
+<a name="id-1.2.25.5.12.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
+</colgroup>
+<tbody><tr>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> to conjugate</p></td>
+<td class="parameter_annotations"> </td>
+</tr></tbody>
+</table></div>
+</div>
+</div>
+<hr>
+<div class="refsect2">
+<a name="hkl-quaternion-to-matrix"></a><h3>hkl_quaternion_to_matrix ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_quaternion_to_matrix (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
+                          <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *m</code></em>);</pre>
+<p>Compute the rotation matrix of a Quaternion.</p>
+<p>compute the rotation matrix corresponding to the unitary quaternion.
+\f$ q = a + b \cdot i + c \cdot j + d \cdot k \f$</p>
+<p>\f$
 \left(
  \begin{array}{ccc}
-   a^2+b^2-c^2-d^2 & 2bc-2ad         & 2ac+2bd\\
-   2ad+2bc         & a^2-b^2+c^2-d^2 & 2cd-2ab\\
+   a^2+b^2-c^2-d^2 & 2bc-2ad         & 2ac+2bd\
+   2ad+2bc         & a^2-b^2+c^2-d^2 & 2cd-2ab\
    2bd-2ac         & 2ab+2cd         & a^2-b^2-c^2+d^2
  \end{array}
 \right)
 \f$
-Todo: optimize
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+Todo: optimize</p>
+<div class="refsect3">
+<a name="id-1.2.25.5.13.7"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> use to compute the <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a>
-</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> use to compute the <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>m</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> return.</td>
+<td class="parameter_name"><p>m</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> return.</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
 </div>
+<hr>
+<div class="refsect2">
+<a name="hkl-quaternion-to-angle-and-axe"></a><h3>hkl_quaternion_to_angle_and_axe ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_quaternion_to_angle_and_axe (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
+                                 <em class="parameter"><code><span class="type">double</span> *angle</code></em>,
+                                 <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v</code></em>);</pre>
+<p>compute the axe and angle of the unitary quaternion angle [-pi, pi]
+if q is the (1, 0, 0, 0) quaternion return the (0,0,0) axe and a 0 angle</p>
+<div class="refsect3">
+<a name="id-1.2.25.5.14.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
+</colgroup>
+<tbody>
+<tr>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>The <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> use to compute the angle and the roation axis.</p></td>
+<td class="parameter_annotations"> </td>
+</tr>
+<tr>
+<td class="parameter_name"><p>angle</p></td>
+<td class="parameter_description"><p>the returned angle of the rotation.</p></td>
+<td class="parameter_annotations"> </td>
+</tr>
+<tr>
+<td class="parameter_name"><p>v</p></td>
+<td class="parameter_description"><p>the returned axis of the rotation.</p></td>
+<td class="parameter_annotations"> </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+</div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-quaternion-private.other_details"></a><h2>Types and Values</h2>
+</div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-sample-private.html b/Documentation/api/html/hkl-hkl-sample-private.html
index e9133e9..cf1a1a3 100644
--- a/Documentation/api/html/hkl-hkl-sample-private.html
+++ b/Documentation/api/html/hkl-hkl-sample-private.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-sample-private</title>
+<title>hkl Reference Manual: hkl-sample-private</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-quaternion-private.html" title="hkl-quaternion-private">
 <link rel="next" href="hkl-hkl-source-private.html" title="hkl-source-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-quaternion-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-source-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-sample-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-sample-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-sample-private.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-quaternion-private.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-source-private.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-hkl-sample-private"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,23 +29,125 @@
 <h2><span class="refentrytitle"><a name="hkl-hkl-sample-private.top_of_page"></a>hkl-sample-private</span></h2>
 <p>hkl-sample-private</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-sample-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-sample-private.html#HklSample" title="HklSample">HklSample</a>;
-                    <a class="link" href="hkl-hkl-sample-private.html#HklSampleReflection" title="HklSampleReflection">HklSampleReflection</a>;
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-sample-private.html#hkl-sample-fprintf" title="hkl_sample_fprintf ()">hkl_sample_fprintf</a>                  (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-sample-private.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-sample-private.html#hkl-sample-reflection-free" title="hkl_sample_reflection_free ()">hkl_sample_reflection_free</a>          (<em class="parameter"><code><a class="link" href="hkl-hkl-sample-private.html#HklSampleReflection" title="HklSampleReflection"><span class="type">HklSampleReflection</span></a> *self</code></em>);
-<a class="link" href="hkl-hkl-sample-private.html#HklSampleReflection" title="HklSampleReflection"><span class="returnvalue">HklSampleReflection</span></a> * <a class="link" href="hkl-hkl-sample-private.html#hkl-sample-reflection-new-copy" title="hkl_sample_reflection_new_copy ()">hkl_sample_reflection_new_copy</a>    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-sample-private.html#HklSampleReflection" title="HklSampleReflection"><span class="type">HklSampleReflection [...]
-</pre>
+<div class="refsect1">
+<a name="hkl-hkl-sample-private.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="function_type">
+<span class="returnvalue">return</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-geometry-private.html#g-quark-from-static-string" title="g_quark_from_static_string ()">g_quark_from_static_string</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-sample-private.html#hkl-sample-fprintf" title="hkl_sample_fprintf ()">hkl_sample_fprintf</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklSampleReflection" title="HklSampleReflection"><span class="returnvalue">HklSampleReflection</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-sample-private.html#hkl-sample-reflection-new-copy" title="hkl_sample_reflection_new_copy ()">hkl_sample_reflection_new_copy</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-sample-private.html#hkl-sample-reflection-free" title="hkl_sample_reflection_free ()">hkl_sample_reflection_free</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-sample-private.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="name">
+<col class="description">
+</colgroup>
+<tbody>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklSample" title="HklSample">HklSample</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-sample-private.html#HKL-SAMPLE-ERROR:CAPS" title="HKL_SAMPLE_ERROR">HKL_SAMPLE_ERROR</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">enum</td>
+<td class="function_name"><a class="link" href="hkl-hkl-sample-private.html#HklSampleError" title="enum HklSampleError">HklSampleError</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklSampleReflection" title="HklSampleReflection">HklSampleReflection</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-sample-private.html#HKL-SAMPLE-REFLECTION-ERROR:CAPS" title="HKL_SAMPLE_REFLECTION_ERROR">HKL_SAMPLE_REFLECTION_ERROR</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">enum</td>
+<td class="function_name"><a class="link" href="hkl-hkl-sample-private.html#HklSampleReflectionError" title="enum HklSampleReflectionError">HklSampleReflectionError</a></td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-hkl-sample-private.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-hkl-sample-private.details"></a><h2>Details</h2>
+<a name="hkl-hkl-sample-private.functions_details"></a><h2>Functions</h2>
+<div class="refsect2">
+<a name="g-quark-from-static-string"></a><h3>g_quark_from_static_string ()</h3>
+<pre class="programlisting"><span class="returnvalue">return</span>
+g_quark_from_static_string ();</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="hkl-sample-fprintf"></a><h3>hkl_sample_fprintf ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_sample_fprintf (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
+                    <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *self</code></em>);</pre>
+<p>print to a file a sample</p>
+</div>
+<hr>
+<div class="refsect2">
+<a name="hkl-sample-reflection-new-copy"></a><h3>hkl_sample_reflection_new_copy ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklSampleReflection" title="HklSampleReflection"><span class="returnvalue">HklSampleReflection</span></a> *
+hkl_sample_reflection_new_copy (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklSampleReflection" title="HklSampleReflection"><span class="type">HklSampleReflection</span></a> *self</code></em>);</pre>
+<p>copy constructor</p>
+<div class="refsect3">
+<a name="id-1.2.26.6.4.5"></a><h4>Returns</h4>
+<p></p>
+</div>
+</div>
+<hr>
+<div class="refsect2">
+<a name="hkl-sample-reflection-free"></a><h3>hkl_sample_reflection_free ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_sample_reflection_free (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklSampleReflection" title="HklSampleReflection"><span class="type">HklSampleReflection</span></a> *self</code></em>);</pre>
+<p>destructor</p>
+</div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-sample-private.other_details"></a><h2>Types and Values</h2>
 <div class="refsect2">
 <a name="HklSample"></a><h3>HklSample</h3>
 <pre class="programlisting">typedef struct {
@@ -61,11 +159,44 @@
 	HklParameter *uy;
 	HklParameter *uz;
 	struct list_head reflections;
+	size_t n_reflections;
 } HklSample;
 </pre>
 </div>
 <hr>
 <div class="refsect2">
+<a name="HKL-SAMPLE-ERROR:CAPS"></a><h3>HKL_SAMPLE_ERROR</h3>
+<pre class="programlisting">#define HKL_SAMPLE_ERROR hkl_sample_error_quark ()
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklSampleError"></a><h3>enum HklSampleError</h3>
+<div class="refsect3">
+<a name="id-1.2.26.7.4.3"></a><h4>Members</h4>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="300px" class="enum_members_name">
+<col class="enum_members_description">
+<col width="200px" class="enum_members_annotations">
+</colgroup>
+<tbody>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-SAMPLE-ERROR-MINIMIZED:CAPS"></a>HKL_SAMPLE_ERROR_MINIMIZED</p></td>
+<td> </td>
+<td> </td>
+</tr>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-SAMPLE-ERROR-COMPUTE-UB-BUSING-LEVY:CAPS"></a>HKL_SAMPLE_ERROR_COMPUTE_UB_BUSING_LEVY</p></td>
+<td> </td>
+<td> </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+</div>
+<hr>
+<div class="refsect2">
 <a name="HklSampleReflection"></a><h3>HklSampleReflection</h3>
 <pre class="programlisting">typedef struct {
 	HklGeometry *geometry;
@@ -79,33 +210,33 @@
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-sample-fprintf"></a><h3>hkl_sample_fprintf ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_sample_fprintf                  (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-sample-private.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *self</code></em>);</pre>
-<p>
-print to a file a sample
-</p>
+<a name="HKL-SAMPLE-REFLECTION-ERROR:CAPS"></a><h3>HKL_SAMPLE_REFLECTION_ERROR</h3>
+<pre class="programlisting">#define HKL_SAMPLE_REFLECTION_ERROR hkl_sample_reflection_error_quark ()
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-sample-reflection-free"></a><h3>hkl_sample_reflection_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_sample_reflection_free          (<em class="parameter"><code><a class="link" href="hkl-hkl-sample-private.html#HklSampleReflection" title="HklSampleReflection"><span class="type">HklSampleReflection</span></a> *self</code></em>);</pre>
-<p>
-destructor
-</p>
+<a name="HklSampleReflectionError"></a><h3>enum HklSampleReflectionError</h3>
+<div class="refsect3">
+<a name="id-1.2.26.7.7.3"></a><h4>Members</h4>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="300px" class="enum_members_name">
+<col class="enum_members_description">
+<col width="200px" class="enum_members_annotations">
+</colgroup>
+<tbody><tr>
+<td class="enum_member_name"><p><a name="HKL-SAMPLE-REFLECTION-ERROR-HKL-SET:CAPS"></a>HKL_SAMPLE_REFLECTION_ERROR_HKL_SET</p></td>
+<td> </td>
+<td> </td>
+</tr></tbody>
+</table></div>
 </div>
-<hr>
-<div class="refsect2">
-<a name="hkl-sample-reflection-new-copy"></a><h3>hkl_sample_reflection_new_copy ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-sample-private.html#HklSampleReflection" title="HklSampleReflection"><span class="returnvalue">HklSampleReflection</span></a> * hkl_sample_reflection_new_copy    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-sample-private.html#HklSampleReflection" title="HklSampleReflection"><span class="type">HklSampleReflection</span></a> *self</code></em>);</pre>
-<p>
-copy constructor
-</p>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-source-private.html b/Documentation/api/html/hkl-hkl-source-private.html
index 32858e8..350b073 100644
--- a/Documentation/api/html/hkl-hkl-source-private.html
+++ b/Documentation/api/html/hkl-hkl-source-private.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-source-private</title>
+<title>hkl Reference Manual: hkl-source-private</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-sample-private.html" title="hkl-sample-private">
 <link rel="next" href="hkl-hkl-type-builtins.html" title="hkl-type-builtins">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-sample-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-type-builtins.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-source-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-source-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-source-private.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-sample-private.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-type-builtins.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-hkl-source-private"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,207 +29,297 @@
 <h2><span class="refentrytitle"><a name="hkl-hkl-source-private.top_of_page"></a>hkl-source-private</span></h2>
 <p>hkl-source-private</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-source-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">#define             <a class="link" href="hkl-hkl-source-private.html#HKL-SOURCE-DEFAULT-WAVE-LENGTH:CAPS" title="HKL_SOURCE_DEFAULT_WAVE_LENGTH">HKL_SOURCE_DEFAULT_WAVE_LENGTH</a>
-struct              <a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource">HklSource</a>;
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-source-private.html#hkl-source-cmp" title="hkl_source_cmp ()">hkl_source_cmp</a>                      (<em class="parameter"><code><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *s</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-source-private.html#hkl-source-compute-ki" title="hkl_source_compute_ki ()">hkl_source_compute_ki</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *ki</code></em>);
-<a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="returnvalue">HklSource</span></a> *         <a class="link" href="hkl-hkl-source-private.html#hkl-source-dup" title="hkl_source_dup ()">hkl_source_dup</a>                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-source-private.html#hkl-source-fprintf" title="hkl_source_fprintf ()">hkl_source_fprintf</a>                  (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-source-private.html#hkl-source-free" title="hkl_source_free ()">hkl_source_free</a>                     (<em class="parameter"><code><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> *self</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-source-private.html#hkl-source-get-wavelength" title="hkl_source_get_wavelength ()">hkl_source_get_wavelength</a>           (<em class="parameter"><code><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-source-private.html#hkl-source-init" title="hkl_source_init ()">hkl_source_init</a>                     (<em class="parameter"><code><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> wave_length</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> x</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> y</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> z</code></em>);
-</pre>
-</div>
-<div class="refsect1">
-<a name="hkl-hkl-source-private.description"></a><h2>Description</h2>
-</div>
 <div class="refsect1">
-<a name="hkl-hkl-source-private.details"></a><h2>Details</h2>
-<div class="refsect2">
-<a name="HKL-SOURCE-DEFAULT-WAVE-LENGTH:CAPS"></a><h3>HKL_SOURCE_DEFAULT_WAVE_LENGTH</h3>
-<pre class="programlisting">#define HKL_SOURCE_DEFAULT_WAVE_LENGTH (1.54)
-</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="HklSource"></a><h3>struct HklSource</h3>
-<pre class="programlisting">struct HklSource {
-	double wave_length;
-	HklVector direction;
-};
-</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-source-cmp"></a><h3>hkl_source_cmp ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_source_cmp                      (<em class="parameter"><code><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *s</code></em>);</pre>
-<p>
-compare two sources
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-hkl-source-private.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="functions_return">
+<col class="functions_name">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>1st <span class="type">Hklsource</span>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-source-private.html#HKL-SOURCE-DEFAULT-WAVE-LENGTH:CAPS" title="HKL_SOURCE_DEFAULT_WAVE_LENGTH">HKL_SOURCE_DEFAULT_WAVE_LENGTH</a></td>
+</tr>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="returnvalue">HklSource</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-source-private.html#hkl-source-dup" title="hkl_source_dup ()">hkl_source_dup</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-source-private.html#hkl-source-free" title="hkl_source_free ()">hkl_source_free</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-source-private.html#hkl-source-init" title="hkl_source_init ()">hkl_source_init</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-source-private.html#hkl-source-cmp" title="hkl_source_cmp ()">hkl_source_cmp</a> <span class="c_punctuation">()</span>
 </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>s</code></em> :</span></p></td>
-<td>2nd <span class="type">Hklsource</span>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-source-private.html#hkl-source-compute-ki" title="hkl_source_compute_ki ()">hkl_source_compute_ki</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">double</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-source-private.html#hkl-source-get-wavelength" title="hkl_source_get_wavelength ()">hkl_source_get_wavelength</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-source-private.html#hkl-source-fprintf" title="hkl_source_fprintf ()">hkl_source_fprintf</a> <span class="c_punctuation">()</span>
 </td>
 </tr>
 </tbody>
 </table></div>
 </div>
-<hr>
-<div class="refsect2">
-<a name="hkl-source-compute-ki"></a><h3>hkl_source_compute_ki ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_source_compute_ki               (<em class="parameter"><code><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *ki</code></em>);</pre>
-<p>
-compute the ki hkl_vector
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<div class="refsect1">
+<a name="hkl-hkl-source-private.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="name">
+<col class="description">
 </colgroup>
 <tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>ki</code></em> :</span></p></td>
-<td>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym> caller-allocates]</span>
-</td>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource">HklSource</a></td>
 </tr></tbody>
 </table></div>
 </div>
-<hr>
-<div class="refsect2">
-<a name="hkl-source-dup"></a><h3>hkl_source_dup ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="returnvalue">HklSource</span></a> *         hkl_source_dup                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> *self</code></em>);</pre>
-<p>
-copy constructor
-TODO test
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <span class="type">Hklsource</span> to copy</td>
-</tr></tbody>
-</table></div>
+<div class="refsect1">
+<a name="hkl-hkl-source-private.description"></a><h2>Description</h2>
 </div>
-<hr>
+<div class="refsect1">
+<a name="hkl-hkl-source-private.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
-<a name="hkl-source-fprintf"></a><h3>hkl_source_fprintf ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_source_fprintf                  (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *self</code></em>);</pre>
-<p>
-printf the source
-</p>
+<a name="HKL-SOURCE-DEFAULT-WAVE-LENGTH:CAPS"></a><h3>HKL_SOURCE_DEFAULT_WAVE_LENGTH</h3>
+<pre class="programlisting">#define HKL_SOURCE_DEFAULT_WAVE_LENGTH (1.54)
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-source-free"></a><h3>hkl_source_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_source_free                     (<em class="parameter"><code><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> *self</code></em>);</pre>
-<p>
-destructor
-TODO: test
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-source-dup"></a><h3>hkl_source_dup ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="returnvalue">HklSource</span></a> *
+hkl_source_dup (<em class="parameter"><code>const <a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> *self</code></em>);</pre>
+<p>copy constructor
+TODO test</p>
+<div class="refsect3">
+<a name="id-1.2.27.6.3.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <span class="type">Hklsource</span> to delete</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <span class="type">Hklsource</span> to copy</p></td>
+<td class="parameter_annotations"> </td>
 </tr></tbody>
 </table></div>
 </div>
+<div class="refsect3">
+<a name="id-1.2.27.6.3.6"></a><h4>Returns</h4>
+<p></p>
+</div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-source-get-wavelength"></a><h3>hkl_source_get_wavelength ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_source_get_wavelength           (<em class="parameter"><code><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *self</code></em>);</pre>
-<p>
-get the wave_length
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-source-free"></a><h3>hkl_source_free ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_source_free (<em class="parameter"><code><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> *self</code></em>);</pre>
+<p>destructor
+TODO: test</p>
+<div class="refsect3">
+<a name="id-1.2.27.6.4.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>the wave_length</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <span class="type">Hklsource</span> to delete</p></td>
+<td class="parameter_annotations"> </td>
 </tr></tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-source-init"></a><h3>hkl_source_init ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_source_init                     (<em class="parameter"><code><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> wave_length</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> x</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> y</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> z</code></em>);</pre>
-<p>
-initialize the <a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a>
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-source-init"></a><h3>hkl_source_init ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_source_init (<em class="parameter"><code><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> *self</code></em>,
+                 <em class="parameter"><code><span class="type">double</span> wave_length</code></em>,
+                 <em class="parameter"><code><span class="type">double</span> x</code></em>,
+                 <em class="parameter"><code><span class="type">double</span> y</code></em>,
+                 <em class="parameter"><code><span class="type">double</span> z</code></em>);</pre>
+<p>initialize the <a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a></p>
+<div class="refsect3">
+<a name="id-1.2.27.6.5.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <span class="type">Hklsource</span> to initialize</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <span class="type">Hklsource</span> to initialize</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>wave_length</code></em> :</span></p></td>
-<td>the wave length to set</td>
+<td class="parameter_name"><p>wave_length</p></td>
+<td class="parameter_description"><p>the wave length to set</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
-<td>x coordinates of the ki vector</td>
+<td class="parameter_name"><p>x</p></td>
+<td class="parameter_description"><p>x coordinates of the ki vector</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
-<td>y coordinates of the ki vector</td>
+<td class="parameter_name"><p>y</p></td>
+<td class="parameter_description"><p>y coordinates of the ki vector</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>z</code></em> :</span></p></td>
-<td>z coordinates of the ki vector</td>
+<td class="parameter_name"><p>z</p></td>
+<td class="parameter_description"><p>z coordinates of the ki vector</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect3">
+<a name="id-1.2.27.6.5.6"></a><h4>Returns</h4>
+<p> HKL_SUCCESS if everythongs goes fine, HKL_FAIL otherwise</p>
+<p></p>
+</div>
+</div>
+<hr>
+<div class="refsect2">
+<a name="hkl-source-cmp"></a><h3>hkl_source_cmp ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_source_cmp (<em class="parameter"><code><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *self</code></em>,
+                <em class="parameter"><code><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *s</code></em>);</pre>
+<p>compare two sources</p>
+<div class="refsect3">
+<a name="id-1.2.27.6.6.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
+</colgroup>
+<tbody>
 <tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>HKL_SUCCESS if everythongs goes fine, HKL_FAIL otherwise</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>1st <span class="type">Hklsource</span></p></td>
+<td class="parameter_annotations"> </td>
+</tr>
+<tr>
+<td class="parameter_name"><p>s</p></td>
+<td class="parameter_description"><p>2nd <span class="type">Hklsource</span></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+<div class="refsect3">
+<a name="id-1.2.27.6.6.6"></a><h4>Returns</h4>
+<p></p>
+</div>
+</div>
+<hr>
+<div class="refsect2">
+<a name="hkl-source-compute-ki"></a><h3>hkl_source_compute_ki ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_source_compute_ki (<em class="parameter"><code><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *self</code></em>,
+                       <em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *ki</code></em>);</pre>
+<p>compute the ki hkl_vector</p>
+<div class="refsect3">
+<a name="id-1.2.27.6.7.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
+</colgroup>
+<tbody><tr>
+<td class="parameter_name"><p>ki</p></td>
+<td class="parameter_description"><p>. </p></td>
+<td class="parameter_annotations"><span class="annotation">[<acronym title="Out parameter, where caller must allocate storage."><span class="acronym">out caller-allocates</span></acronym>]</span></td>
+</tr></tbody>
+</table></div>
+</div>
+</div>
+<hr>
+<div class="refsect2">
+<a name="hkl-source-get-wavelength"></a><h3>hkl_source_get_wavelength ()</h3>
+<pre class="programlisting"><span class="returnvalue">double</span>
+hkl_source_get_wavelength (<em class="parameter"><code><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *self</code></em>);</pre>
+<p>get the wave_length</p>
+<div class="refsect3">
+<a name="id-1.2.27.6.8.5"></a><h4>Returns</h4>
+<p> the wave_length</p>
+<p></p>
+</div>
+</div>
+<hr>
+<div class="refsect2">
+<a name="hkl-source-fprintf"></a><h3>hkl_source_fprintf ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_source_fprintf (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
+                    <em class="parameter"><code><a class="link" href="hkl-hkl-source-private.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *self</code></em>);</pre>
+<p>printf the source</p>
+</div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-source-private.other_details"></a><h2>Types and Values</h2>
+<div class="refsect2">
+<a name="HklSource"></a><h3>struct HklSource</h3>
+<pre class="programlisting">struct HklSource {
+	double wave_length;
+	HklVector direction;
+};
+</pre>
+</div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-type-builtins.html b/Documentation/api/html/hkl-hkl-type-builtins.html
index 70e67a8..41a9a6e 100644
--- a/Documentation/api/html/hkl-hkl-type-builtins.html
+++ b/Documentation/api/html/hkl-hkl-type-builtins.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-type-builtins</title>
+<title>hkl Reference Manual: hkl-type-builtins</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-source-private.html" title="hkl-source-private">
 <link rel="next" href="hkl-hkl-types.html" title="hkl-types">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-source-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-types.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-type-builtins.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-type-builtins.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-type-builtins.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-source-private.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-types.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-hkl-type-builtins"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,27 +29,70 @@
 <h2><span class="refentrytitle"><a name="hkl-hkl-type-builtins.top_of_page"></a>hkl-type-builtins</span></h2>
 <p>hkl-type-builtins</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-type-builtins.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">#define             <a class="link" href="hkl-hkl-type-builtins.html#HKL-TYPE-DETECTOR-TYPE:CAPS" title="HKL_TYPE_DETECTOR_TYPE">HKL_TYPE_DETECTOR_TYPE</a>
-</pre>
+<div class="refsect1">
+<a name="hkl-hkl-type-builtins.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-type-builtins.html#HKL-TYPE-UNIT-ENUM:CAPS" title="HKL_TYPE_UNIT_ENUM">HKL_TYPE_UNIT_ENUM</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-type-builtins.html#HKL-TYPE-DETECTOR-TYPE:CAPS" title="HKL_TYPE_DETECTOR_TYPE">HKL_TYPE_DETECTOR_TYPE</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-type-builtins.html#HKL-TYPE-ENGINE-CAPABILITIES:CAPS" title="HKL_TYPE_ENGINE_CAPABILITIES">HKL_TYPE_ENGINE_CAPABILITIES</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-type-builtins.html#HKL-TYPE-ENGINE-AXIS-NAMES-GET:CAPS" title="HKL_TYPE_ENGINE_AXIS_NAMES_GET">HKL_TYPE_ENGINE_AXIS_NAMES_GET</a></td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-hkl-type-builtins.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-hkl-type-builtins.details"></a><h2>Details</h2>
+<a name="hkl-hkl-type-builtins.functions_details"></a><h2>Functions</h2>
+<div class="refsect2">
+<a name="HKL-TYPE-UNIT-ENUM:CAPS"></a><h3>HKL_TYPE_UNIT_ENUM</h3>
+<pre class="programlisting">#define HKL_TYPE_UNIT_ENUM (hkl_unit_enum_get_type ())
+</pre>
+</div>
+<hr>
 <div class="refsect2">
 <a name="HKL-TYPE-DETECTOR-TYPE:CAPS"></a><h3>HKL_TYPE_DETECTOR_TYPE</h3>
 <pre class="programlisting">#define HKL_TYPE_DETECTOR_TYPE (hkl_detector_type_get_type ())
 </pre>
 </div>
+<hr>
+<div class="refsect2">
+<a name="HKL-TYPE-ENGINE-CAPABILITIES:CAPS"></a><h3>HKL_TYPE_ENGINE_CAPABILITIES</h3>
+<pre class="programlisting">#define HKL_TYPE_ENGINE_CAPABILITIES (hkl_engine_capabilities_get_type ())
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HKL-TYPE-ENGINE-AXIS-NAMES-GET:CAPS"></a><h3>HKL_TYPE_ENGINE_AXIS_NAMES_GET</h3>
+<pre class="programlisting">#define HKL_TYPE_ENGINE_AXIS_NAMES_GET (hkl_engine_axis_names_get_get_type ())
+</pre>
+</div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-type-builtins.other_details"></a><h2>Types and Values</h2>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-types.html b/Documentation/api/html/hkl-hkl-types.html
index 1ac547f..32a7d4d 100644
--- a/Documentation/api/html/hkl-hkl-types.html
+++ b/Documentation/api/html/hkl-hkl-types.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-types</title>
+<title>hkl Reference Manual: hkl-types</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-type-builtins.html" title="hkl-type-builtins">
 <link rel="next" href="hkl-hkl-unit-private.html" title="hkl-unit-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-type-builtins.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-unit-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-types.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-types.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-types.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-type-builtins.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-unit-private.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-hkl-types"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,40 +29,80 @@
 <h2><span class="refentrytitle"><a name="hkl-hkl-types.top_of_page"></a>hkl-types</span></h2>
 <p>hkl-types</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-types.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">#define             <a class="link" href="hkl-hkl-types.html#TYPE-HKL-AXIS:CAPS" title="TYPE_HKL_AXIS">TYPE_HKL_AXIS</a>
-#define             <a class="link" href="hkl-hkl-types.html#TYPE-HKL-DETECTOR:CAPS" title="TYPE_HKL_DETECTOR">TYPE_HKL_DETECTOR</a>
-#define             <a class="link" href="hkl-hkl-types.html#TYPE-HKL-ENGINE:CAPS" title="TYPE_HKL_ENGINE">TYPE_HKL_ENGINE</a>
-#define             <a class="link" href="hkl-hkl-types.html#TYPE-HKL-ENGINE-LIST:CAPS" title="TYPE_HKL_ENGINE_LIST">TYPE_HKL_ENGINE_LIST</a>
-#define             <a class="link" href="hkl-hkl-types.html#TYPE-HKL-ERROR:CAPS" title="TYPE_HKL_ERROR">TYPE_HKL_ERROR</a>
-#define             <a class="link" href="hkl-hkl-types.html#TYPE-HKL-GEOMETRY:CAPS" title="TYPE_HKL_GEOMETRY">TYPE_HKL_GEOMETRY</a>
-#define             <a class="link" href="hkl-hkl-types.html#TYPE-HKL-GEOMETRY-LIST:CAPS" title="TYPE_HKL_GEOMETRY_LIST">TYPE_HKL_GEOMETRY_LIST</a>
-#define             <a class="link" href="hkl-hkl-types.html#TYPE-HKL-GEOMETRY-LIST-ITEM:CAPS" title="TYPE_HKL_GEOMETRY_LIST_ITEM">TYPE_HKL_GEOMETRY_LIST_ITEM</a>
-#define             <a class="link" href="hkl-hkl-types.html#TYPE-HKL-LATTICE:CAPS" title="TYPE_HKL_LATTICE">TYPE_HKL_LATTICE</a>
-#define             <a class="link" href="hkl-hkl-types.html#TYPE-HKL-MATRIX:CAPS" title="TYPE_HKL_MATRIX">TYPE_HKL_MATRIX</a>
-#define             <a class="link" href="hkl-hkl-types.html#TYPE-HKL-PARAMETER:CAPS" title="TYPE_HKL_PARAMETER">TYPE_HKL_PARAMETER</a>
-#define             <a class="link" href="hkl-hkl-types.html#TYPE-HKL-PARAMETER-LIST:CAPS" title="TYPE_HKL_PARAMETER_LIST">TYPE_HKL_PARAMETER_LIST</a>
-#define             <a class="link" href="hkl-hkl-types.html#TYPE-HKL-PSEUDO-AXIS:CAPS" title="TYPE_HKL_PSEUDO_AXIS">TYPE_HKL_PSEUDO_AXIS</a>
-#define             <a class="link" href="hkl-hkl-types.html#TYPE-HKL-SAMPLE:CAPS" title="TYPE_HKL_SAMPLE">TYPE_HKL_SAMPLE</a>
-#define             <a class="link" href="hkl-hkl-types.html#TYPE-HKL-SAMPLE-REFLECTION:CAPS" title="TYPE_HKL_SAMPLE_REFLECTION">TYPE_HKL_SAMPLE_REFLECTION</a>
-#define             <a class="link" href="hkl-hkl-types.html#TYPE-HKL-UNIT:CAPS" title="TYPE_HKL_UNIT">TYPE_HKL_UNIT</a>
-#define             <a class="link" href="hkl-hkl-types.html#TYPE-HKL-VECTOR:CAPS" title="TYPE_HKL_VECTOR">TYPE_HKL_VECTOR</a>
-</pre>
+<div class="refsect1">
+<a name="hkl-hkl-types.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-types.html#TYPE-HKL-DETECTOR:CAPS" title="TYPE_HKL_DETECTOR">TYPE_HKL_DETECTOR</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-types.html#TYPE-HKL-ENGINE:CAPS" title="TYPE_HKL_ENGINE">TYPE_HKL_ENGINE</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-types.html#TYPE-HKL-ENGINE-LIST:CAPS" title="TYPE_HKL_ENGINE_LIST">TYPE_HKL_ENGINE_LIST</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-types.html#TYPE-HKL-FACTORY:CAPS" title="TYPE_HKL_FACTORY">TYPE_HKL_FACTORY</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-types.html#TYPE-HKL-GEOMETRY:CAPS" title="TYPE_HKL_GEOMETRY">TYPE_HKL_GEOMETRY</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-types.html#TYPE-HKL-GEOMETRY-LIST:CAPS" title="TYPE_HKL_GEOMETRY_LIST">TYPE_HKL_GEOMETRY_LIST</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-types.html#TYPE-HKL-GEOMETRY-LIST-ITEM:CAPS" title="TYPE_HKL_GEOMETRY_LIST_ITEM">TYPE_HKL_GEOMETRY_LIST_ITEM</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-types.html#TYPE-HKL-LATTICE:CAPS" title="TYPE_HKL_LATTICE">TYPE_HKL_LATTICE</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-types.html#TYPE-HKL-MATRIX:CAPS" title="TYPE_HKL_MATRIX">TYPE_HKL_MATRIX</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-types.html#TYPE-HKL-PARAMETER:CAPS" title="TYPE_HKL_PARAMETER">TYPE_HKL_PARAMETER</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-types.html#TYPE-HKL-SAMPLE-REFLECTION:CAPS" title="TYPE_HKL_SAMPLE_REFLECTION">TYPE_HKL_SAMPLE_REFLECTION</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-types.html#TYPE-HKL-SAMPLE:CAPS" title="TYPE_HKL_SAMPLE">TYPE_HKL_SAMPLE</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-types.html#TYPE-HKL-UNIT:CAPS" title="TYPE_HKL_UNIT">TYPE_HKL_UNIT</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl-types.html#TYPE-HKL-VECTOR:CAPS" title="TYPE_HKL_VECTOR">TYPE_HKL_VECTOR</a></td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-hkl-types.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-hkl-types.details"></a><h2>Details</h2>
-<div class="refsect2">
-<a name="TYPE-HKL-AXIS:CAPS"></a><h3>TYPE_HKL_AXIS</h3>
-<pre class="programlisting">#define TYPE_HKL_AXIS (hkl_axis_get_type ())
-</pre>
-</div>
-<hr>
+<a name="hkl-hkl-types.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
 <a name="TYPE-HKL-DETECTOR:CAPS"></a><h3>TYPE_HKL_DETECTOR</h3>
 <pre class="programlisting">#define TYPE_HKL_DETECTOR (hkl_detector_get_type ())
@@ -86,8 +122,8 @@
 </div>
 <hr>
 <div class="refsect2">
-<a name="TYPE-HKL-ERROR:CAPS"></a><h3>TYPE_HKL_ERROR</h3>
-<pre class="programlisting">#define TYPE_HKL_ERROR (hkl_error_get_type ())
+<a name="TYPE-HKL-FACTORY:CAPS"></a><h3>TYPE_HKL_FACTORY</h3>
+<pre class="programlisting">#define TYPE_HKL_FACTORY (hkl_factory_get_type ())
 </pre>
 </div>
 <hr>
@@ -128,14 +164,8 @@
 </div>
 <hr>
 <div class="refsect2">
-<a name="TYPE-HKL-PARAMETER-LIST:CAPS"></a><h3>TYPE_HKL_PARAMETER_LIST</h3>
-<pre class="programlisting">#define TYPE_HKL_PARAMETER_LIST (hkl_parameter_list_get_type ())
-</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="TYPE-HKL-PSEUDO-AXIS:CAPS"></a><h3>TYPE_HKL_PSEUDO_AXIS</h3>
-<pre class="programlisting">#define TYPE_HKL_PSEUDO_AXIS (hkl_pseudo_axis_get_type ())
+<a name="TYPE-HKL-SAMPLE-REFLECTION:CAPS"></a><h3>TYPE_HKL_SAMPLE_REFLECTION</h3>
+<pre class="programlisting">#define TYPE_HKL_SAMPLE_REFLECTION (hkl_sample_reflection_get_type ())
 </pre>
 </div>
 <hr>
@@ -146,12 +176,6 @@
 </div>
 <hr>
 <div class="refsect2">
-<a name="TYPE-HKL-SAMPLE-REFLECTION:CAPS"></a><h3>TYPE_HKL_SAMPLE_REFLECTION</h3>
-<pre class="programlisting">#define TYPE_HKL_SAMPLE_REFLECTION (hkl_sample_reflection_get_type ())
-</pre>
-</div>
-<hr>
-<div class="refsect2">
 <a name="TYPE-HKL-UNIT:CAPS"></a><h3>TYPE_HKL_UNIT</h3>
 <pre class="programlisting">#define TYPE_HKL_UNIT (hkl_unit_get_type ())
 </pre>
@@ -163,9 +187,12 @@
 </pre>
 </div>
 </div>
+<div class="refsect1">
+<a name="hkl-hkl-types.other_details"></a><h2>Types and Values</h2>
+</div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-unit-private.html b/Documentation/api/html/hkl-hkl-unit-private.html
index d62a332..843d6b8 100644
--- a/Documentation/api/html/hkl-hkl-unit-private.html
+++ b/Documentation/api/html/hkl-hkl-unit-private.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-unit-private</title>
+<title>hkl Reference Manual: hkl-unit-private</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-types.html" title="hkl-types">
 <link rel="next" href="hkl-hkl-vector-private.html" title="hkl-vector-private">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-types.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-hkl-vector-private.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-unit-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-unit-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-unit-private.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-types.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-vector-private.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-hkl-unit-private"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,125 +29,195 @@
 <h2><span class="refentrytitle"><a name="hkl-hkl-unit-private.top_of_page"></a>hkl-unit-private</span></h2>
 <p>hkl-unit-private</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-unit-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">struct              <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit">HklUnit</a>;
-enum                <a class="link" href="hkl-hkl-unit-private.html#HklUnitType" title="enum HklUnitType">HklUnitType</a>;
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-unit-private.html#hkl-unit-compatible" title="hkl_unit_compatible ()">hkl_unit_compatible</a>                 (<em class="parameter"><code>const <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *unit</code></em>);
-<a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="returnvalue">HklUnit</span></a> *           <a class="link" href="hkl-hkl-unit-private.html#hkl-unit-dup" title="hkl_unit_dup ()">hkl_unit_dup</a>                        (<em class="parameter"><code>const <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *self</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-unit-private.html#hkl-unit-factor" title="hkl_unit_factor ()">hkl_unit_factor</a>                     (<em class="parameter"><code>const <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *unit</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-unit-private.html#hkl-unit-free" title="hkl_unit_free ()">hkl_unit_free</a>                       (<em class="parameter"><code><a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *self</code></em>);
-</pre>
+<div class="refsect1">
+<a name="hkl-hkl-unit-private.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="returnvalue">HklUnit</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-unit-private.html#hkl-unit-dup" title="hkl_unit_dup ()">hkl_unit_dup</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-unit-private.html#hkl-unit-free" title="hkl_unit_free ()">hkl_unit_free</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-unit-private.html#hkl-unit-compatible" title="hkl_unit_compatible ()">hkl_unit_compatible</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">double</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-unit-private.html#hkl-unit-factor" title="hkl_unit_factor ()">hkl_unit_factor</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-unit-private.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="name">
+<col class="description">
+</colgroup>
+<tbody>
+<tr>
+<td class="datatype_keyword">enum</td>
+<td class="function_name"><a class="link" href="hkl-hkl-unit-private.html#HklUnitType" title="enum HklUnitType">HklUnitType</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit">HklUnit</a></td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-hkl-unit-private.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-hkl-unit-private.details"></a><h2>Details</h2>
+<a name="hkl-hkl-unit-private.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
-<a name="HklUnit"></a><h3>struct HklUnit</h3>
-<pre class="programlisting">struct HklUnit {
-	HklUnitType type;
-	char const *name;
-	char const *repr;
-};
-</pre>
+<a name="hkl-unit-dup"></a><h3>hkl_unit_dup ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="returnvalue">HklUnit</span></a> *
+hkl_unit_dup (<em class="parameter"><code>const <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *self</code></em>);</pre>
+<p>copy an <span class="type">Hklunit</span></p>
+<div class="refsect3">
+<a name="id-1.2.30.6.2.5"></a><h4>Returns</h4>
+<p> the copied <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> (memory must be release with
+hkl_unit_free)</p>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="HklUnitType"></a><h3>enum HklUnitType</h3>
-<pre class="programlisting">typedef enum {
-	HKL_UNIT_ANGLE_DEG,
-	HKL_UNIT_ANGLE_RAD,
-	HKL_UNIT_LENGTH_NM
-} HklUnitType;
-</pre>
+<a name="hkl-unit-free"></a><h3>hkl_unit_free ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_unit_free (<em class="parameter"><code><a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *self</code></em>);</pre>
+<p>release the memory of an <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a></p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-unit-compatible"></a><h3>hkl_unit_compatible ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_unit_compatible                 (<em class="parameter"><code>const <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *unit</code></em>);</pre>
-<p>
-check if two units are compatible.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-unit-compatible"></a><h3>hkl_unit_compatible ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_unit_compatible (<em class="parameter"><code>const <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *self</code></em>,
+                     <em class="parameter"><code>const <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *unit</code></em>);</pre>
+<p>check if two units are compatible.</p>
+<div class="refsect3">
+<a name="id-1.2.30.6.4.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the first <em class="parameter"><code>HklUnit</code></em>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>unit</code></em> :</span></p></td>
-<td>the second <em class="parameter"><code>HklUnit</code></em> to check</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the first <em class="parameter"><code>HklUnit</code></em>
+</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>HKL_TRUE or HKL_FALSE</td>
+<td class="parameter_name"><p>unit</p></td>
+<td class="parameter_description"><p>the second <em class="parameter"><code>HklUnit</code></em>
+to check</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+<div class="refsect3">
+<a name="id-1.2.30.6.4.6"></a><h4>Returns</h4>
+<p> TRUE or FALSE</p>
+<p></p>
+</div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-unit-dup"></a><h3>hkl_unit_dup ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="returnvalue">HklUnit</span></a> *           hkl_unit_dup                        (<em class="parameter"><code>const <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *self</code></em>);</pre>
-<p>
-copy an <span class="type">Hklunit</span>
+<a name="hkl-unit-factor"></a><h3>hkl_unit_factor ()</h3>
+<pre class="programlisting"><span class="returnvalue">double</span>
+hkl_unit_factor (<em class="parameter"><code>const <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *self</code></em>,
+                 <em class="parameter"><code>const <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *unit</code></em>);</pre>
+<p>compute the factor to convert from one <em class="parameter"><code>Hklunit</code></em>
+ to another one.
+<em class="parameter"><code>self</code></em>
+ * factor =  <em class="parameter"><code>unit</code></em>
 </p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>the copied <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> (memory must be release with
-hkl_unit_free)</td>
-</tr></tbody>
-</table></div>
+<div class="refsect3">
+<a name="id-1.2.30.6.5.5"></a><h4>Returns</h4>
+<p> the factor of the conversion.</p>
+<p></p>
 </div>
-<hr>
+</div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl-unit-private.other_details"></a><h2>Types and Values</h2>
 <div class="refsect2">
-<a name="hkl-unit-factor"></a><h3>hkl_unit_factor ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_unit_factor                     (<em class="parameter"><code>const <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *unit</code></em>);</pre>
-<p>
-compute the factor to convert from one <em class="parameter"><code>Hklunit</code></em> to another one.
-<em class="parameter"><code>self</code></em> * factor =  <em class="parameter"><code>unit</code></em>
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="HklUnitType"></a><h3>enum HklUnitType</h3>
+<div class="refsect3">
+<a name="id-1.2.30.7.2.3"></a><h4>Members</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="300px" class="enum_members_name">
+<col class="enum_members_description">
+<col width="200px" class="enum_members_annotations">
 </colgroup>
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>the factor of the conversion.</td>
-</tr></tbody>
+<tbody>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-UNIT-ANGLE-DEG:CAPS"></a>HKL_UNIT_ANGLE_DEG</p></td>
+<td> </td>
+<td> </td>
+</tr>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-UNIT-ANGLE-RAD:CAPS"></a>HKL_UNIT_ANGLE_RAD</p></td>
+<td> </td>
+<td> </td>
+</tr>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-UNIT-LENGTH-NM:CAPS"></a>HKL_UNIT_LENGTH_NM</p></td>
+<td> </td>
+<td> </td>
+</tr>
+</tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-unit-free"></a><h3>hkl_unit_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_unit_free                       (<em class="parameter"><code><a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *self</code></em>);</pre>
-<p>
-release the memory of an <a class="link" href="hkl-hkl-unit-private.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a>
-</p>
+<a name="HklUnit"></a><h3>struct HklUnit</h3>
+<pre class="programlisting">struct HklUnit {
+	HklUnitType type;
+	char const *name;
+	char const *repr;
+};
+</pre>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-vector-private.html b/Documentation/api/html/hkl-hkl-vector-private.html
index 1954258..6b054d7 100644
--- a/Documentation/api/html/hkl-hkl-vector-private.html
+++ b/Documentation/api/html/hkl-hkl-vector-private.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl-vector-private</title>
+<title>hkl Reference Manual: hkl-vector-private</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-unit-private.html" title="hkl-unit-private">
 <link rel="next" href="hkl-list.html" title="list">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-unit-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-list.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-hkl-vector-private.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-hkl-vector-private.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl-vector-private.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-unit-private.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-list.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-hkl-vector-private"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,937 +29,1213 @@
 <h2><span class="refentrytitle"><a name="hkl-hkl-vector-private.top_of_page"></a>hkl-vector-private</span></h2>
 <p>hkl-vector-private</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-hkl-vector-private.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion">HklQuaternion</a>;
-struct              <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector">HklVector</a>;
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-add-vector" title="hkl_vector_add_vector ()">hkl_vector_add_vector</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-angle" title="hkl_vector_angle ()">hkl_vector_angle</a>                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-cmp" title="hkl_vector_cmp ()">hkl_vector_cmp</a>                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-div-double" title="hkl_vector_div_double ()">hkl_vector_div_double</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">double</span> d</code></em>);
-<a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="returnvalue">HklVector</span></a> *         <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-dup" title="hkl_vector_dup ()">hkl_vector_dup</a>                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-fprintf" title="hkl_vector_fprintf ()">hkl_vector_fprintf</a>                  (<em class="parameter"><code><span class="type">FILE</span> *file</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-free" title="hkl_vector_free ()">hkl_vector_free</a>                     (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-init" title="hkl_vector_init ()">hkl_vector_init</a>                     (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> x</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> y</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> z</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-is-colinear" title="hkl_vector_is_colinear ()">hkl_vector_is_colinear</a>              (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-is-null" title="hkl_vector_is_null ()">hkl_vector_is_null</a>                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-is-opposite" title="hkl_vector_is_opposite ()">hkl_vector_is_opposite</a>              (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-minus-vector" title="hkl_vector_minus_vector ()">hkl_vector_minus_vector</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-norm2" title="hkl_vector_norm2 ()">hkl_vector_norm2</a>                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-normalize" title="hkl_vector_normalize ()">hkl_vector_normalize</a>                (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-oriented-angle" title="hkl_vector_oriented_angle ()">hkl_vector_oriented_angle</a>           (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *ref</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-oriented-angle-points" title="hkl_vector_oriented_angle_points ()">hkl_vector_oriented_angle_points</a>    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *p2</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *p3</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *ref</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-project-on-plan" title="hkl_vector_project_on_plan ()">hkl_vector_project_on_plan</a>          (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *normal</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-project-on-plan-with-point" title="hkl_vector_project_on_plan_with_point ()">hkl_vector_project_on_plan_with_point</a>
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *normal</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *point</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-randomize" title="hkl_vector_randomize ()">hkl_vector_randomize</a>                (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-randomize-vector" title="hkl_vector_randomize_vector ()">hkl_vector_randomize_vector</a>         (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-randomize-vector-vector" title="hkl_vector_randomize_vector_vector ()">hkl_vector_randomize_vector_vector</a>  (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector1</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector2</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-rotated-around-line" title="hkl_vector_rotated_around_line ()">hkl_vector_rotated_around_line</a>      (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> angle</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *c1</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *c2</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-rotated-around-vector" title="hkl_vector_rotated_around_vector ()">hkl_vector_rotated_around_vector</a>    (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *axe</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> angle</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-rotated-quaternion" title="hkl_vector_rotated_quaternion ()">hkl_vector_rotated_quaternion</a>       (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *qr</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-scalar-product" title="hkl_vector_scalar_product ()">hkl_vector_scalar_product</a>           (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-sum" title="hkl_vector_sum ()">hkl_vector_sum</a>                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-times-double" title="hkl_vector_times_double ()">hkl_vector_times_double</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">double</span> d</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-times-matrix" title="hkl_vector_times_matrix ()">hkl_vector_times_matrix</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *m</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-times-vector" title="hkl_vector_times_vector ()">hkl_vector_times_vector</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector-private.html#hkl-vector-vectorial-product" title="hkl_vector_vectorial_product ()">hkl_vector_vectorial_product</a>        (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
-</pre>
+<div class="refsect1">
+<a name="hkl-hkl-vector-private.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="function_type">
+<a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="returnvalue">HklVector</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-dup" title="hkl_vector_dup ()">hkl_vector_dup</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-free" title="hkl_vector_free ()">hkl_vector_free</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-init" title="hkl_vector_init ()">hkl_vector_init</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-fprintf" title="hkl_vector_fprintf ()">hkl_vector_fprintf</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-cmp" title="hkl_vector_cmp ()">hkl_vector_cmp</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-is-opposite" title="hkl_vector_is_opposite ()">hkl_vector_is_opposite</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-add-vector" title="hkl_vector_add_vector ()">hkl_vector_add_vector</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-minus-vector" title="hkl_vector_minus_vector ()">hkl_vector_minus_vector</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-div-double" title="hkl_vector_div_double ()">hkl_vector_div_double</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-times-double" title="hkl_vector_times_double ()">hkl_vector_times_double</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-times-vector" title="hkl_vector_times_vector ()">hkl_vector_times_vector</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-times-matrix" title="hkl_vector_times_matrix ()">hkl_vector_times_matrix</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">double</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-sum" title="hkl_vector_sum ()">hkl_vector_sum</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">double</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-scalar-product" title="hkl_vector_scalar_product ()">hkl_vector_scalar_product</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-vectorial-product" title="hkl_vector_vectorial_product ()">hkl_vector_vectorial_product</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">double</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-angle" title="hkl_vector_angle ()">hkl_vector_angle</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">double</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-oriented-angle" title="hkl_vector_oriented_angle ()">hkl_vector_oriented_angle</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">double</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-oriented-angle-points" title="hkl_vector_oriented_angle_points ()">hkl_vector_oriented_angle_points</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">double</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-norm2" title="hkl_vector_norm2 ()">hkl_vector_norm2</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-normalize" title="hkl_vector_normalize ()">hkl_vector_normalize</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-is-colinear" title="hkl_vector_is_colinear ()">hkl_vector_is_colinear</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-randomize" title="hkl_vector_randomize ()">hkl_vector_randomize</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-randomize-vector" title="hkl_vector_randomize_vector ()">hkl_vector_randomize_vector</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-randomize-vector-vector" title="hkl_vector_randomize_vector_vector ()">hkl_vector_randomize_vector_vector</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-rotated-around-vector" title="hkl_vector_rotated_around_vector ()">hkl_vector_rotated_around_vector</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-rotated-quaternion" title="hkl_vector_rotated_quaternion ()">hkl_vector_rotated_quaternion</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-rotated-around-line" title="hkl_vector_rotated_around_line ()">hkl_vector_rotated_around_line</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-is-null" title="hkl_vector_is_null ()">hkl_vector_is_null</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-project-on-plan" title="hkl_vector_project_on_plan ()">hkl_vector_project_on_plan</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl-vector-private.html#hkl-vector-project-on-plan-with-point" title="hkl_vector_project_on_plan_with_point ()">hkl_vector_project_on_plan_with_point</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-hkl-vector-private.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-hkl-vector-private.details"></a><h2>Details</h2>
+<a name="hkl-hkl-vector-private.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
-<a name="HklQuaternion"></a><h3>HklQuaternion</h3>
-<pre class="programlisting">typedef struct {
-	double data[4];
-} HklQuaternion;
-</pre>
-</div>
-<hr>
-<div class="refsect2">
-<a name="HklVector"></a><h3>struct HklVector</h3>
-<pre class="programlisting">struct HklVector {
-	double data[3];
-};
-</pre>
-<p>
-A struct containing a 3D space coordinates.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-dup"></a><h3>hkl_vector_dup ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="returnvalue">HklVector</span></a> *
+hkl_vector_dup (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
+<p>Copy an HklVector</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.2.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody><tr>
-<td><p><span class="term"><span class="type">double</span> <em class="structfield"><code><a name="HklVector.data"></a>data</code></em>[3];</span></p></td>
-<td>contain the vector data. <span class="annotation">[skip]</span>
-</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the HklVector to copy</p></td>
+<td class="parameter_annotations"> </td>
 </tr></tbody>
 </table></div>
 </div>
+<div class="refsect3">
+<a name="id-1.2.31.5.2.6"></a><h4>Returns</h4>
+<p> A copy of self which need to be free using hkl_vector_free</p>
+<p></p>
+</div>
+</div>
+<hr>
+<div class="refsect2">
+<a name="hkl-vector-free"></a><h3>hkl_vector_free ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_vector_free (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
+<p>delete an HklVector struct</p>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-add-vector"></a><h3>hkl_vector_add_vector ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_add_vector               (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
-<p>
-add an <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to another one.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-init"></a><h3>hkl_vector_init ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_vector_init (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                 <em class="parameter"><code><span class="type">double</span> x</code></em>,
+                 <em class="parameter"><code><span class="type">double</span> y</code></em>,
+                 <em class="parameter"><code><span class="type">double</span> z</code></em>);</pre>
+<p>initialize an <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p>
+<div class="refsect3">
+<a name="id-1.2.31.5.4.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the modified <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to initialize.</p></td>
+<td class="parameter_annotations"> </td>
+</tr>
+<tr>
+<td class="parameter_name"><p>x</p></td>
+<td class="parameter_description"><p>the first coordinate value</p></td>
+<td class="parameter_annotations"> </td>
+</tr>
+<tr>
+<td class="parameter_name"><p>y</p></td>
+<td class="parameter_description"><p>the second coordinate value</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>vector</code></em> :</span></p></td>
-<td>the <span class="type">hklvector</span> to add</td>
+<td class="parameter_name"><p>z</p></td>
+<td class="parameter_description"><p>the third coordinate value</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-angle"></a><h3>hkl_vector_angle ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_vector_angle                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
-<p>
-compute the angles beetween two <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-fprintf"></a><h3>hkl_vector_fprintf ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_vector_fprintf (<em class="parameter"><code><span class="type">FILE</span> *file</code></em>,
+                    <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
+<p>print an <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> into a stream</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.5.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the fist <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</td>
+<td class="parameter_name"><p>file</p></td>
+<td class="parameter_description"><p>the stream to print into</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>vector</code></em> :</span></p></td>
-<td>the second <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>the return value is in beetween [0, pi]</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to print.</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-cmp"></a><h3>hkl_vector_cmp ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_vector_cmp                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
-<p>
-compare two <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>. this comparison use HKL_EPSILON
-to do the comparison.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-cmp"></a><h3>hkl_vector_cmp ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_vector_cmp (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
+<p>compare two <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>. this comparison use HKL_EPSILON
+to do the comparison.</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.6.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the first vector</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>vector</code></em> :</span></p></td>
-<td>th vector to compare with</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the first vector</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>HKL_FALSE if both are equals, HKL_TRUE otherwise.</td>
+<td class="parameter_name"><p>vector</p></td>
+<td class="parameter_description"><p>th vector to compare with</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+<div class="refsect3">
+<a name="id-1.2.31.5.6.6"></a><h4>Returns</h4>
+<p> FALSE if both are equals, TRUE otherwise.</p>
+<p></p>
+</div>
+</div>
+<hr>
+<div class="refsect2">
+<a name="hkl-vector-is-opposite"></a><h3>hkl_vector_is_opposite ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_vector_is_opposite (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                        <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
+<p>Check if two vectors are oposite.</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.7.5"></a><h4>Returns</h4>
+<p> TRUE is vector are oposite vectors.</p>
+<p></p>
+</div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-div-double"></a><h3>hkl_vector_div_double ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_div_double               (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">double</span> d</code></em>);</pre>
-<p>
-divide an <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> by constant.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-add-vector"></a><h3>hkl_vector_add_vector ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_vector_add_vector (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                       <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
+<p>add an <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to another one.</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.8.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to divide.</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the modified <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>d</code></em> :</span></p></td>
-<td>constant use to divide the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</td>
+<td class="parameter_name"><p>vector</p></td>
+<td class="parameter_description"><p>the <span class="type">hklvector</span> to add</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-dup"></a><h3>hkl_vector_dup ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="returnvalue">HklVector</span></a> *         hkl_vector_dup                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
-<p>
-Copy an HklVector
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-minus-vector"></a><h3>hkl_vector_minus_vector ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_vector_minus_vector (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                         <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
+<p>substract an <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to another one.</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.9.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the HklVector to copy</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the modified <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>A copy of self which need to be free using hkl_vector_free</td>
+<td class="parameter_name"><p>vector</p></td>
+<td class="parameter_description"><p>the <span class="type">hklvector</span> to substract</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-fprintf"></a><h3>hkl_vector_fprintf ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_fprintf                  (<em class="parameter"><code><span class="type">FILE</span> *file</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
-<p>
-print an <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> into a stream
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-div-double"></a><h3>hkl_vector_div_double ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_vector_div_double (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                       <em class="parameter"><code>const <span class="type">double</span> d</code></em>);</pre>
+<p>divide an <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> by constant.</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.10.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>file</code></em> :</span></p></td>
-<td>the stream to print into</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to divide.</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to print.</td>
+<td class="parameter_name"><p>d</p></td>
+<td class="parameter_description"><p>constant use to divide the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
-<hr>
-<div class="refsect2">
-<a name="hkl-vector-free"></a><h3>hkl_vector_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_free                     (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
-<p>
-delete an HklVector struct
-</p>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-init"></a><h3>hkl_vector_init ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_init                     (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> x</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> y</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> z</code></em>);</pre>
-<p>
-initialize an <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-times-double"></a><h3>hkl_vector_times_double ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_vector_times_double (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                         <em class="parameter"><code>const <span class="type">double</span> d</code></em>);</pre>
+<p>multiply an <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> by a constant value.</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.11.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to initialize.</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
-<td>the first coordinate value</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to modify</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
-<td>the second coordinate value</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>z</code></em> :</span></p></td>
-<td>the third coordinate value</td>
+<td class="parameter_name"><p>d</p></td>
+<td class="parameter_description"><p>the multiply factor</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-is-colinear"></a><h3>hkl_vector_is_colinear ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_vector_is_colinear              (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
-<p>
-check if two <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> are colinears
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-times-vector"></a><h3>hkl_vector_times_vector ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_vector_times_vector (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                         <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
+<p>multiply an <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> by another one. This method multiply
+coordinate by coordinate.</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.12.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the first <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>vector</code></em> :</span></p></td>
-<td>the second <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to modify</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>HKL_TRUE if both are colinear.</td>
+<td class="parameter_name"><p>vector</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> use to modify the first one</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-is-null"></a><h3>hkl_vector_is_null ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_vector_is_null                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
-<p>
-check if all the coordinates of an <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> are null.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-times-matrix"></a><h3>hkl_vector_times_matrix ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_vector_times_matrix (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                         <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *m</code></em>);</pre>
+<p>multiply an <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> by an <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a>.
+compute v'= M . v</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.13.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <span class="type">hklvector</span> to check</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to multiply</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>HKl_TRUE if all |elements| are below HKL_EPSILON, HKl_FALSE otherwise
-Todo: test</td>
+<td class="parameter_name"><p>m</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> use to multiply the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-is-opposite"></a><h3>hkl_vector_is_opposite ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_vector_is_opposite              (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
-<p>
-Check if two vectors are oposite.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-sum"></a><h3>hkl_vector_sum ()</h3>
+<pre class="programlisting"><span class="returnvalue">double</span>
+hkl_vector_sum (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
+<p>compute the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> sum of all its elements.</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.14.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>HKL_TRUE is vector are oposite vectors.</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to sum.</p></td>
+<td class="parameter_annotations"> </td>
 </tr></tbody>
 </table></div>
 </div>
+<div class="refsect3">
+<a name="id-1.2.31.5.14.6"></a><h4>Returns</h4>
+<p> the sum of all elements.</p>
+<p></p>
+</div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-minus-vector"></a><h3>hkl_vector_minus_vector ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_minus_vector             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
-<p>
-substract an <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to another one.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-scalar-product"></a><h3>hkl_vector_scalar_product ()</h3>
+<pre class="programlisting"><span class="returnvalue">double</span>
+hkl_vector_scalar_product (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                           <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
+<p>compute the scalar product of two <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p>
+<div class="refsect3">
+<a name="id-1.2.31.5.15.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the modified <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the first <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>vector</code></em> :</span></p></td>
-<td>the <span class="type">hklvector</span> to substract</td>
+<td class="parameter_name"><p>vector</p></td>
+<td class="parameter_description"><p>the second <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+<div class="refsect3">
+<a name="id-1.2.31.5.15.6"></a><h4>Returns</h4>
+<p> the scalar product.</p>
+<p></p>
+</div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-norm2"></a><h3>hkl_vector_norm2 ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_vector_norm2                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
-<p>
-compute the norm2 of an <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-vectorial-product"></a><h3>hkl_vector_vectorial_product ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_vector_vectorial_product (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                              <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
+<p>compute the vectorial product of two vectors</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.16.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <span class="type">hklvector</span> use to compute the norm2</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the first <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> (modify)</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>the sqrt(|v|)</td>
+<td class="parameter_name"><p>vector</p></td>
+<td class="parameter_description"><p>the second <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-normalize"></a><h3>hkl_vector_normalize ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_vector_normalize                (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
-<p>
-normalize a hkl_vector
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-angle"></a><h3>hkl_vector_angle ()</h3>
+<pre class="programlisting"><span class="returnvalue">double</span>
+hkl_vector_angle (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                  <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
+<p>compute the angles beetween two <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p>
+<div class="refsect3">
+<a name="id-1.2.31.5.17.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to normalize</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the fist <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>HKL_TRUE if the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> can be normalized, HKL_FALSE otherwise</td>
+<td class="parameter_name"><p>vector</p></td>
+<td class="parameter_description"><p>the second <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+<div class="refsect3">
+<a name="id-1.2.31.5.17.6"></a><h4>Returns</h4>
+<p> the return value is in beetween [0, pi]</p>
+<p></p>
+</div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-oriented-angle"></a><h3>hkl_vector_oriented_angle ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_vector_oriented_angle           (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *ref</code></em>);</pre>
-<p>
-compute the angles beetween two <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> and use
-a reference <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to orientate the space. That's
+<a name="hkl-vector-oriented-angle"></a><h3>hkl_vector_oriented_angle ()</h3>
+<pre class="programlisting"><span class="returnvalue">double</span>
+hkl_vector_oriented_angle (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                           <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>,
+                           <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *ref</code></em>);</pre>
+<p>compute the angles beetween two <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> and use
+a reference <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to orientate the space. That's
 way the return value can be in beetween [-pi, pi].
-the (self, vector, ref) is a right oriented base.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+the (self, vector, ref) is a right oriented base.</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.18.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the first <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>vector</code></em> :</span></p></td>
-<td>the second <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the first <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>ref</code></em> :</span></p></td>
-<td>the reference <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</td>
+<td class="parameter_name"><p>vector</p></td>
+<td class="parameter_description"><p>the second <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>the angles [-pi, pi]</td>
+<td class="parameter_name"><p>ref</p></td>
+<td class="parameter_description"><p>the reference <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+<div class="refsect3">
+<a name="id-1.2.31.5.18.6"></a><h4>Returns</h4>
+<p> the angles [-pi, pi]</p>
+<p></p>
+</div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-oriented-angle-points"></a><h3>hkl_vector_oriented_angle_points ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_vector_oriented_angle_points    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *p2</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *p3</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *ref</code></em>);</pre>
-<p>
-compute the angles beetween three points (p1, p2, p3) and use
-a reference <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to orientate the space. That's
+<a name="hkl-vector-oriented-angle-points"></a><h3>hkl_vector_oriented_angle_points ()</h3>
+<pre class="programlisting"><span class="returnvalue">double</span>
+hkl_vector_oriented_angle_points (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                  <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *p2</code></em>,
+                                  <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *p3</code></em>,
+                                  <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *ref</code></em>);</pre>
+<p>compute the angles beetween three points (p1, p2, p3) and use
+a reference <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to orientate the space. That's
 way the return value can be in beetween [-pi, pi].
-the (self, vector, ref) is a right oriented base.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+the (self, vector, ref) is a right oriented base.</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.19.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the first point</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>p2</code></em> :</span></p></td>
-<td>the second point</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the first point</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>p3</code></em> :</span></p></td>
-<td>the third point</td>
+<td class="parameter_name"><p>p2</p></td>
+<td class="parameter_description"><p>the second point</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>ref</code></em> :</span></p></td>
-<td>the reference <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</td>
+<td class="parameter_name"><p>p3</p></td>
+<td class="parameter_description"><p>the third point</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>the angles [-pi, pi]</td>
+<td class="parameter_name"><p>ref</p></td>
+<td class="parameter_description"><p>the reference <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
-<hr>
-<div class="refsect2">
-<a name="hkl-vector-project-on-plan"></a><h3>hkl_vector_project_on_plan ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_project_on_plan          (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *normal</code></em>);</pre>
-<p>
-project an <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> on a plan of normal which contain
-the origin [0, 0, 0]
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the vector to project</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>normal</code></em> :</span></p></td>
-<td>the normal of the plane.</td>
-</tr>
-</tbody>
-</table></div>
+<div class="refsect3">
+<a name="id-1.2.31.5.19.6"></a><h4>Returns</h4>
+<p> the angles [-pi, pi]</p>
+<p></p>
+</div>
 </div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-project-on-plan-with-point"></a><h3>hkl_vector_project_on_plan_with_point ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_project_on_plan_with_point
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *normal</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *point</code></em>);</pre>
-<p>
-project an <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> on a plan of normal <span class="type">normal</span> which contain <span class="type">point</span>.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-norm2"></a><h3>hkl_vector_norm2 ()</h3>
+<pre class="programlisting"><span class="returnvalue">double</span>
+hkl_vector_norm2 (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
+<p>compute the norm2 of an <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p>
+<div class="refsect3">
+<a name="id-1.2.31.5.20.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the vector to project (modify)</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>normal</code></em> :</span></p></td>
-<td>the normal of the plane.</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>point</code></em> :</span></p></td>
-<td>a point of the plan.</td>
-</tr>
-</tbody>
+<tbody><tr>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <span class="type">hklvector</span> use to compute the norm2</p></td>
+<td class="parameter_annotations"> </td>
+</tr></tbody>
 </table></div>
 </div>
+<div class="refsect3">
+<a name="id-1.2.31.5.20.6"></a><h4>Returns</h4>
+<p> the sqrt(|v|)</p>
+<p></p>
+</div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-randomize"></a><h3>hkl_vector_randomize ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_randomize                (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
-<p>
-initialize a vector with random values.
-coordinates range [-1, 1]
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-normalize"></a><h3>hkl_vector_normalize ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_vector_normalize (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
+<p>normalize a hkl_vector</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.21.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to randomize</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to normalize</p></td>
+<td class="parameter_annotations"> </td>
 </tr></tbody>
 </table></div>
 </div>
+<div class="refsect3">
+<a name="id-1.2.31.5.21.6"></a><h4>Returns</h4>
+<p> TRUE if the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> can be normalized, FALSE otherwise</p>
+<p></p>
+</div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-randomize-vector"></a><h3>hkl_vector_randomize_vector ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_randomize_vector         (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
-<p>
-randomize an <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> an be sure that it is not equal
-to the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> vector.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-is-colinear"></a><h3>hkl_vector_is_colinear ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_vector_is_colinear (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                        <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
+<p>check if two <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> are colinears</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.22.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to randomize</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the first <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>vector</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> result to avoid</td>
+<td class="parameter_name"><p>vector</p></td>
+<td class="parameter_description"><p>the second <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a></p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+<div class="refsect3">
+<a name="id-1.2.31.5.22.6"></a><h4>Returns</h4>
+<p> TRUE if both are colinear.</p>
+<p></p>
+</div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-randomize-vector-vector"></a><h3>hkl_vector_randomize_vector_vector ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_randomize_vector_vector  (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector1</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector2</code></em>);</pre>
-<p>
-randomize an <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> an be sure that it is not equal
-to the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> vector1 and vector2.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-randomize"></a><h3>hkl_vector_randomize ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_vector_randomize (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
+<p>initialize a vector with random values.
+coordinates range [-1, 1]</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.23.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to randomize</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>vector1</code></em> :</span></p></td>
-<td>the first <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> solution to avoid</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>vector2</code></em> :</span></p></td>
-<td>the second <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> solution to avoid</td>
-</tr>
-</tbody>
+<tbody><tr>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to randomize</p></td>
+<td class="parameter_annotations"> </td>
+</tr></tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-rotated-around-line"></a><h3>hkl_vector_rotated_around_line ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_rotated_around_line      (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> angle</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *c1</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *c2</code></em>);</pre>
-<p>
-This method rotate a point around a line defined by two points
-of a certain amount of angle. The rotation is right handed.
-this mean that c2 - c1 gives the direction of the rotation.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-randomize-vector"></a><h3>hkl_vector_randomize_vector ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_vector_randomize_vector (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                             <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
+<p>randomize an <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> an be sure that it is not equal
+to the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> vector.</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.24.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the point to rotate around a line</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to randomize</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>angle</code></em> :</span></p></td>
-<td>the angle of the rotation</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>c1</code></em> :</span></p></td>
-<td>the fist point of the line</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>c2</code></em> :</span></p></td>
-<td>the second point of the line</td>
+<td class="parameter_name"><p>vector</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> result to avoid</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-rotated-around-vector"></a><h3>hkl_vector_rotated_around_vector ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_rotated_around_vector    (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *axe</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> angle</code></em>);</pre>
-<p>
-rotate a vector around another one with a given angle.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-randomize-vector-vector"></a><h3>hkl_vector_randomize_vector_vector ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_vector_randomize_vector_vector (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                    <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector1</code></em>,
+                                    <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector2</code></em>);</pre>
+<p>randomize an <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> an be sure that it is not equal
+to the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> vector1 and vector2.</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.25.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to rotate</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to randomize</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>axe</code></em> :</span></p></td>
-<td>the axe of rotation</td>
+<td class="parameter_name"><p>vector1</p></td>
+<td class="parameter_description"><p>the first <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> solution to avoid</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>angle</code></em> :</span></p></td>
-<td>the angle of the rotation</td>
+<td class="parameter_name"><p>vector2</p></td>
+<td class="parameter_description"><p>the second <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> solution to avoid</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-rotated-quaternion"></a><h3>hkl_vector_rotated_quaternion ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_rotated_quaternion       (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *qr</code></em>);</pre>
-<p>
-rotate an <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> using an <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a>.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-rotated-around-vector"></a><h3>hkl_vector_rotated_around_vector ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_vector_rotated_around_vector (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                  <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *axe</code></em>,
+                                  <em class="parameter"><code><span class="type">double</span> angle</code></em>);</pre>
+<p>rotate a vector around another one with a given angle.</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.26.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to rotate</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to rotate</p></td>
+<td class="parameter_annotations"> </td>
+</tr>
+<tr>
+<td class="parameter_name"><p>axe</p></td>
+<td class="parameter_description"><p>the axe of rotation</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>qr</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion-private.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> use to rotate the vector</td>
+<td class="parameter_name"><p>angle</p></td>
+<td class="parameter_description"><p>the angle of the rotation</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-scalar-product"></a><h3>hkl_vector_scalar_product ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_vector_scalar_product           (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
-<p>
-compute the scalar product of two <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-rotated-quaternion"></a><h3>hkl_vector_rotated_quaternion ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_vector_rotated_quaternion (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                               <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> *qr</code></em>);</pre>
+<p>rotate an <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> using an <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a>.</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.27.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the first <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to rotate</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>vector</code></em> :</span></p></td>
-<td>the second <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>the scalar product.</td>
+<td class="parameter_name"><p>qr</p></td>
+<td class="parameter_description"><p>the <a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion"><span class="type">HklQuaternion</span></a> use to rotate the vector</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-sum"></a><h3>hkl_vector_sum ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_vector_sum                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
-<p>
-compute the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> sum of all its elements.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-rotated-around-line"></a><h3>hkl_vector_rotated_around_line ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_vector_rotated_around_line (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                <em class="parameter"><code><span class="type">double</span> angle</code></em>,
+                                <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *c1</code></em>,
+                                <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *c2</code></em>);</pre>
+<p>This method rotate a point around a line defined by two points
+of a certain amount of angle. The rotation is right handed.
+this mean that c2 - c1 gives the direction of the rotation.</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.28.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to sum.</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the point to rotate around a line</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>the sum of all elements.</td>
+<td class="parameter_name"><p>angle</p></td>
+<td class="parameter_description"><p>the angle of the rotation</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2">
-<a name="hkl-vector-times-double"></a><h3>hkl_vector_times_double ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_times_double             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">double</span> d</code></em>);</pre>
-<p>
-multiply an <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> by a constant value.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
-<colgroup>
-<col align="left" valign="top">
-<col>
-</colgroup>
-<tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to modify</td>
+<td class="parameter_name"><p>c1</p></td>
+<td class="parameter_description"><p>the fist point of the line</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>d</code></em> :</span></p></td>
-<td>the multiply factor</td>
+<td class="parameter_name"><p>c2</p></td>
+<td class="parameter_description"><p>the second point of the line</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-times-matrix"></a><h3>hkl_vector_times_matrix ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_times_matrix             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *m</code></em>);</pre>
-<p>
-multiply an <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> by an <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a>.
-compute v'= M . v
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-is-null"></a><h3>hkl_vector_is_null ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+hkl_vector_is_null (<em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
+<p>check if all the coordinates of an <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> are null.</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.29.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to multiply</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>m</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-matrix-private.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> use to multiply the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</td>
-</tr>
-</tbody>
+<tbody><tr>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the <span class="type">hklvector</span> to check</p></td>
+<td class="parameter_annotations"> </td>
+</tr></tbody>
 </table></div>
 </div>
+<div class="refsect3">
+<a name="id-1.2.31.5.29.6"></a><h4>Returns</h4>
+<p> HKl_TRUE if all |elements| are below HKL_EPSILON, HKl_FALSE otherwise</p>
+<p>Todo: test</p>
+<p></p>
+</div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-times-vector"></a><h3>hkl_vector_times_vector ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_times_vector             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
-<p>
-multiply an <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> by another one. This method multiply
-coordinate by coordinate.
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-project-on-plan"></a><h3>hkl_vector_project_on_plan ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_vector_project_on_plan (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                            <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *normal</code></em>);</pre>
+<p>project an <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> on a plan of normal which contain
+the origin [0, 0, 0]</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.30.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to modify</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the vector to project</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>vector</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> use to modify the first one</td>
+<td class="parameter_name"><p>normal</p></td>
+<td class="parameter_description"><p>the normal of the plane.</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
+</div>
 <hr>
 <div class="refsect2">
-<a name="hkl-vector-vectorial-product"></a><h3>hkl_vector_vectorial_product ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_vectorial_product        (<em class="parameter"><code><a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
-<p>
-compute the vectorial product of two vectors
-</p>
-<div class="variablelist"><table border="0" class="variablelist">
+<a name="hkl-vector-project-on-plan-with-point"></a><h3>hkl_vector_project_on_plan_with_point ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+hkl_vector_project_on_plan_with_point (<em class="parameter"><code><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                       <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *normal</code></em>,
+                                       <em class="parameter"><code>const <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *point</code></em>);</pre>
+<p>project an <a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> on a plan of normal <span class="type">normal</span> which contain <span class="type">point</span>.</p>
+<div class="refsect3">
+<a name="id-1.2.31.5.31.5"></a><h4>Parameters</h4>
+<div class="informaltable"><table width="100%" border="0">
 <colgroup>
-<col align="left" valign="top">
-<col>
+<col width="150px" class="parameters_name">
+<col class="parameters_description">
+<col width="200px" class="parameters_annotations">
 </colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the first <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> (modify)</td>
+<td class="parameter_name"><p>self</p></td>
+<td class="parameter_description"><p>the vector to project (modify)</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>vector</code></em> :</span></p></td>
-<td>the second <a class="link" href="hkl-hkl-vector-private.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
-</td>
+<td class="parameter_name"><p>normal</p></td>
+<td class="parameter_description"><p>the normal of the plane.</p></td>
+<td class="parameter_annotations"> </td>
+</tr>
+<tr>
+<td class="parameter_name"><p>point</p></td>
+<td class="parameter_description"><p>a point of the plan.</p></td>
+<td class="parameter_annotations"> </td>
 </tr>
 </tbody>
 </table></div>
 </div>
 </div>
 </div>
+<div class="refsect1">
+<a name="hkl-hkl-vector-private.other_details"></a><h2>Types and Values</h2>
+</div>
+</div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl.html b/Documentation/api/html/hkl-hkl.html
new file mode 100644
index 0000000..2174c01
--- /dev/null
+++ b/Documentation/api/html/hkl-hkl.html
@@ -0,0 +1,552 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>hkl Reference Manual: hkl</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
+<link rel="home" href="index.html" title="hkl Reference Manual">
+<link rel="up" href="ch01.html" title="[Insert title here]">
+<link rel="prev" href="hkl-darray.html" title="darray">
+<link rel="next" href="hkl-hkl-axis-private.html" title="hkl-axis-private">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
+<link rel="stylesheet" href="style.css" type="text/css">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-hkl.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-darray.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-hkl-axis-private.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
+<div class="refentry">
+<a name="hkl-hkl"></a><div class="titlepage"></div>
+<div class="refnamediv"><table width="100%"><tr>
+<td valign="top">
+<h2><span class="refentrytitle"><a name="hkl-hkl.top_of_page"></a>hkl</span></h2>
+<p>hkl</p>
+</td>
+<td class="gallery_image" valign="top" align="right"></td>
+</tr></table></div>
+<div class="refsect1">
+<a name="hkl-hkl.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl.html#HKL-DEPRECATED-FOR:CAPS" title="HKL_DEPRECATED_FOR()">HKL_DEPRECATED_FOR</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HKL-DEGTORAD:CAPS" title="HKL_DEGTORAD">HKL_DEGTORAD</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HKL-RADTODEG:CAPS" title="HKL_RADTODEG">HKL_RADTODEG</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HKL-TAU:CAPS" title="HKL_TAU">HKL_TAU</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl.html#HKL-ARG-NONNULL:CAPS" title="HKL_ARG_NONNULL()">HKL_ARG_NONNULL</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl.html#HKL-GEOMETRY-LIST-FOREACH:CAPS" title="HKL_GEOMETRY_LIST_FOREACH()">HKL_GEOMETRY_LIST_FOREACH</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-hkl.html#HKL-SAMPLE-REFLECTIONS-FOREACH:CAPS" title="HKL_SAMPLE_REFLECTIONS_FOREACH()">HKL_SAMPLE_REFLECTIONS_FOREACH</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="name">
+<col class="description">
+</colgroup>
+<tbody>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HKL-DEPRECATED:CAPS" title="HKL_DEPRECATED">HKL_DEPRECATED</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HKL-TINY:CAPS" title="HKL_TINY">HKL_TINY</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HKL-EPSILON:CAPS" title="HKL_EPSILON">HKL_EPSILON</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HKLAPI:CAPS" title="HKLAPI">HKLAPI</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HKL-WARN-UNUSED-RESULT:CAPS" title="HKL_WARN_UNUSED_RESULT">HKL_WARN_UNUSED_RESULT</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklVector" title="struct HklVector">HklVector</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklQuaternion" title="struct HklQuaternion">HklQuaternion</a></td>
+</tr>
+<tr>
+<td class="typedef_keyword">typedef</td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#darray-string" title="darray_string">darray_string</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">enum</td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklUnitEnum" title="enum HklUnitEnum">HklUnitEnum</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">enum</td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklDetectorType" title="enum HklDetectorType">HklDetectorType</a></td>
+</tr>
+<tr>
+<td class="typedef_keyword">typedef</td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#darray-engine" title="darray_engine">darray_engine</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">enum</td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklEngineCapabilities" title="enum HklEngineCapabilities">HklEngineCapabilities</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">enum</td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklEngineAxisNamesGet" title="enum HklEngineAxisNamesGet">HklEngineAxisNamesGet</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklParameter" title="HklParameter">HklParameter</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklGeometry" title="HklGeometry">HklGeometry</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklSampleReflection" title="HklSampleReflection">HklSampleReflection</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklSample" title="HklSample">HklSample</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklGeometryListItem" title="HklGeometryListItem">HklGeometryListItem</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklFactory" title="HklFactory">HklFactory</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklEngineList" title="HklEngineList">HklEngineList</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklGeometryList" title="HklGeometryList">HklGeometryList</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklLattice" title="HklLattice">HklLattice</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklMatrix" title="HklMatrix">HklMatrix</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklDetector" title="HklDetector">HklDetector</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword"> </td>
+<td class="function_name"><a class="link" href="hkl-hkl.html#HklEngine" title="HklEngine">HklEngine</a></td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl.description"></a><h2>Description</h2>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl.functions_details"></a><h2>Functions</h2>
+<div class="refsect2">
+<a name="HKL-DEPRECATED-FOR:CAPS"></a><h3>HKL_DEPRECATED_FOR()</h3>
+<pre class="programlisting"># define HKL_DEPRECATED_FOR(f) __attribute__((__deprecated__("Use '" #f "' instead")))
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HKL-DEGTORAD:CAPS"></a><h3>HKL_DEGTORAD</h3>
+<pre class="programlisting">#define HKL_DEGTORAD (M_PI/180.)
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HKL-RADTODEG:CAPS"></a><h3>HKL_RADTODEG</h3>
+<pre class="programlisting">#define HKL_RADTODEG (180./M_PI)
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HKL-TAU:CAPS"></a><h3>HKL_TAU</h3>
+<pre class="programlisting">#define HKL_TAU (2. * M_PI)
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HKL-ARG-NONNULL:CAPS"></a><h3>HKL_ARG_NONNULL()</h3>
+<pre class="programlisting"># define HKL_ARG_NONNULL(...) __attribute__ ((__nonnull__(__VA_ARGS__)))
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HKL-GEOMETRY-LIST-FOREACH:CAPS"></a><h3>HKL_GEOMETRY_LIST_FOREACH()</h3>
+<pre class="programlisting">#define             HKL_GEOMETRY_LIST_FOREACH(item, list)</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HKL-SAMPLE-REFLECTIONS-FOREACH:CAPS"></a><h3>HKL_SAMPLE_REFLECTIONS_FOREACH()</h3>
+<pre class="programlisting">#define             HKL_SAMPLE_REFLECTIONS_FOREACH(_item, _list)</pre>
+</div>
+</div>
+<div class="refsect1">
+<a name="hkl-hkl.other_details"></a><h2>Types and Values</h2>
+<div class="refsect2">
+<a name="HKL-DEPRECATED:CAPS"></a><h3>HKL_DEPRECATED</h3>
+<pre class="programlisting"># define HKL_DEPRECATED __attribute__((__deprecated__))
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HKL-TINY:CAPS"></a><h3>HKL_TINY</h3>
+<pre class="programlisting">#define HKL_TINY 1e-7
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HKL-EPSILON:CAPS"></a><h3>HKL_EPSILON</h3>
+<pre class="programlisting">#define HKL_EPSILON 1e-6
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HKLAPI:CAPS"></a><h3>HKLAPI</h3>
+<pre class="programlisting">#  define HKLAPI __attribute__ ((visibility("default")))
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HKL-WARN-UNUSED-RESULT:CAPS"></a><h3>HKL_WARN_UNUSED_RESULT</h3>
+<pre class="programlisting">#  define HKL_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__))
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklVector"></a><h3>struct HklVector</h3>
+<pre class="programlisting">struct HklVector {
+	double data[3];
+};
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklQuaternion"></a><h3>struct HklQuaternion</h3>
+<pre class="programlisting">struct HklQuaternion {
+	double data[4];
+};
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="darray-string"></a><h3>darray_string</h3>
+<pre class="programlisting">typedef darray(const char *) darray_string;
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklUnitEnum"></a><h3>enum HklUnitEnum</h3>
+<div class="refsect3">
+<a name="id-1.2.9.7.10.3"></a><h4>Members</h4>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="300px" class="enum_members_name">
+<col class="enum_members_description">
+<col width="200px" class="enum_members_annotations">
+</colgroup>
+<tbody>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-UNIT-DEFAULT:CAPS"></a>HKL_UNIT_DEFAULT</p></td>
+<td> </td>
+<td> </td>
+</tr>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-UNIT-USER:CAPS"></a>HKL_UNIT_USER</p></td>
+<td> </td>
+<td> </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklDetectorType"></a><h3>enum HklDetectorType</h3>
+<div class="refsect3">
+<a name="id-1.2.9.7.11.3"></a><h4>Members</h4>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="300px" class="enum_members_name">
+<col class="enum_members_description">
+<col width="200px" class="enum_members_annotations">
+</colgroup>
+<tbody><tr>
+<td class="enum_member_name"><p><a name="HKL-DETECTOR-TYPE-0D:CAPS"></a>HKL_DETECTOR_TYPE_0D</p></td>
+<td> </td>
+<td> </td>
+</tr></tbody>
+</table></div>
+</div>
+</div>
+<hr>
+<div class="refsect2">
+<a name="darray-engine"></a><h3>darray_engine</h3>
+<pre class="programlisting">typedef darray(HklEngine *) darray_engine;
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklEngineCapabilities"></a><h3>enum HklEngineCapabilities</h3>
+<div class="refsect3">
+<a name="id-1.2.9.7.13.3"></a><h4>Members</h4>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="300px" class="enum_members_name">
+<col class="enum_members_description">
+<col width="200px" class="enum_members_annotations">
+</colgroup>
+<tbody>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-ENGINE-CAPABILITIES-READABLE:CAPS"></a>HKL_ENGINE_CAPABILITIES_READABLE</p></td>
+<td> </td>
+<td> </td>
+</tr>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-ENGINE-CAPABILITIES-WRITABLE:CAPS"></a>HKL_ENGINE_CAPABILITIES_WRITABLE</p></td>
+<td> </td>
+<td> </td>
+</tr>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-ENGINE-CAPABILITIES-INITIALIZABLE:CAPS"></a>HKL_ENGINE_CAPABILITIES_INITIALIZABLE</p></td>
+<td> </td>
+<td> </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklEngineAxisNamesGet"></a><h3>enum HklEngineAxisNamesGet</h3>
+<div class="refsect3">
+<a name="id-1.2.9.7.14.3"></a><h4>Members</h4>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="300px" class="enum_members_name">
+<col class="enum_members_description">
+<col width="200px" class="enum_members_annotations">
+</colgroup>
+<tbody>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-ENGINE-AXIS-NAMES-GET-READ:CAPS"></a>HKL_ENGINE_AXIS_NAMES_GET_READ</p></td>
+<td> </td>
+<td> </td>
+</tr>
+<tr>
+<td class="enum_member_name"><p><a name="HKL-ENGINE-AXIS-NAMES-GET-WRITE:CAPS"></a>HKL_ENGINE_AXIS_NAMES_GET_WRITE</p></td>
+<td> </td>
+<td> </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklParameter"></a><h3>HklParameter</h3>
+<pre class="programlisting">typedef struct {
+	const char *name;
+	const char *description;
+	HklInterval range;
+	double _value;
+	const HklUnit *unit;
+	const HklUnit *punit;
+	int fit;
+	int changed;
+	const HklParameterOperations *ops;
+} HklParameter;
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklGeometry"></a><h3>HklGeometry</h3>
+<pre class="programlisting">typedef struct {
+	const HklFactory *factory;
+	HklSource source;
+	darray_parameter axes;
+	darray_holder holders;
+} HklGeometry;
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklSampleReflection"></a><h3>HklSampleReflection</h3>
+<pre class="programlisting">typedef struct {
+	HklGeometry *geometry;
+	HklDetector *detector;
+	HklVector hkl;
+	HklVector _hkl;
+	int flag;
+	struct list_node list;
+} HklSampleReflection;
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklSample"></a><h3>HklSample</h3>
+<pre class="programlisting">typedef struct {
+	char *name;
+	HklLattice *lattice;
+	HklMatrix U;
+	HklMatrix UB;
+	HklParameter *ux;
+	HklParameter *uy;
+	HklParameter *uz;
+	struct list_head reflections;
+	size_t n_reflections;
+} HklSample;
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklGeometryListItem"></a><h3>HklGeometryListItem</h3>
+<pre class="programlisting">typedef struct {
+	struct list_node list;
+	HklGeometry *geometry;
+} HklGeometryListItem;
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklFactory"></a><h3>HklFactory</h3>
+<pre class="programlisting">typedef struct {
+	const char *name;
+	const char *description;
+	const darray_string axes;
+	HklFactoryGeometryFunction create_new_geometry;
+	HklFactoryEngineListFunction create_new_engine_list;
+} HklFactory;
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklEngineList"></a><h3>HklEngineList</h3>
+<pre class="programlisting">typedef struct {
+	_darray(HklEngine *);
+	HklGeometryList *geometries;
+	HklGeometry *geometry;
+	HklDetector *detector;
+	HklSample *sample;
+} HklEngineList;
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklGeometryList"></a><h3>HklGeometryList</h3>
+<pre class="programlisting">typedef struct {
+	HklGeometryListMultiplyFunction multiply;
+	struct list_head items;
+	size_t n_items;
+} HklGeometryList;
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklLattice"></a><h3>HklLattice</h3>
+<pre class="programlisting">typedef struct {
+	HklParameter *a;
+	HklParameter *b;
+	HklParameter *c;
+	HklParameter *alpha;
+	HklParameter *beta;
+	HklParameter *gamma;
+} HklLattice;
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklMatrix"></a><h3>HklMatrix</h3>
+<pre class="programlisting">typedef struct {
+	double data[3][3];
+} HklMatrix;
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklDetector"></a><h3>HklDetector</h3>
+<pre class="programlisting">typedef struct {
+	size_t idx;
+	HklHolder const *holder;
+} HklDetector;
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="HklEngine"></a><h3>HklEngine</h3>
+<pre class="programlisting">typedef struct {
+	const HklEngineInfo *info;
+	const HklEngineOperations *ops;
+	HklGeometry *geometry;
+	HklDetector *detector;
+	HklSample *sample;
+	HklMode *mode; /* not owned */
+	HklEngineList *engines; /* not owned */
+	darray_parameter axes;
+	darray_parameter pseudo_axes;
+	darray_string pseudo_axis_names;
+	darray_mode modes;
+	darray_string mode_names;
+} HklEngine;
+</pre>
+</div>
+</div>
+</div>
+<div class="footer">
+<hr>
+          Generated by GTK-Doc V1.21</div>
+</body>
+</html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-list.html b/Documentation/api/html/hkl-list.html
index 88a2f43..8e9c9e3 100644
--- a/Documentation/api/html/hkl-list.html
+++ b/Documentation/api/html/hkl-list.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>list</title>
+<title>hkl Reference Manual: list</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-vector-private.html" title="hkl-vector-private">
 <link rel="next" href="hkl-noerr.html" title="noerr">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-hkl-vector-private.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-noerr.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-list.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-list.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-list.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-hkl-vector-private.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-noerr.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-list"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,123 +29,312 @@
 <h2><span class="refentrytitle"><a name="hkl-list.top_of_page"></a>list</span></h2>
 <p>list</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-list.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">#define             <a class="link" href="hkl-list.html#LIST-HEAD:CAPS" title="LIST_HEAD()">LIST_HEAD</a>                           (name)
-#define             <a class="link" href="hkl-list.html#LIST-HEAD-INIT:CAPS" title="LIST_HEAD_INIT()">LIST_HEAD_INIT</a>                      (name)
-#define             <a class="link" href="hkl-list.html#list-add-off" title="list_add_off()">list_add_off</a>                        (h,
-                                                         n,
-                                                         off)
-struct <span class="returnvalue">list_head</span> *  <a class="link" href="hkl-list.html#list-check" title="list_check ()">list_check</a>                          (<em class="parameter"><code>const <span class="type">struct list_head</span> *h</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">char</span> *abortstr</code></em>);
-struct <span class="returnvalue">list_node</span> *  <a class="link" href="hkl-list.html#list-check-node" title="list_check_node ()">list_check_node</a>                     (<em class="parameter"><code>const <span class="type">struct list_node</span> *n</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">char</span> *abortstr</code></em>);
-#define             <a class="link" href="hkl-list.html#list-debug" title="list_debug()">list_debug</a>                          (h)
-#define             <a class="link" href="hkl-list.html#list-debug-node" title="list_debug_node()">list_debug_node</a>                     (n)
-#define             <a class="link" href="hkl-list.html#list-del-from-off" title="list_del_from_off()">list_del_from_off</a>                   (h,
-                                                         n,
-                                                         off)
-#define             <a class="link" href="hkl-list.html#list-del-off" title="list_del_off()">list_del_off</a>                        (n,
-                                                         off)
-#define             <a class="link" href="hkl-list.html#list-entry" title="list_entry()">list_entry</a>                          (n,
-                                                         type,
-                                                         member)
-#define             <a class="link" href="hkl-list.html#list-entry-off" title="list_entry_off()">list_entry_off</a>                      (n,
-                                                         type,
-                                                         off)
-#define             <a class="link" href="hkl-list.html#list-for-each" title="list_for_each()">list_for_each</a>                       (h,
-                                                         i,
-                                                         member)
-#define             <a class="link" href="hkl-list.html#list-for-each-off" title="list_for_each_off()">list_for_each_off</a>                   (h,
-                                                         i,
-                                                         off)
-#define             <a class="link" href="hkl-list.html#list-for-each-rev" title="list_for_each_rev()">list_for_each_rev</a>                   (h,
-                                                         i,
-                                                         member)
-#define             <a class="link" href="hkl-list.html#list-for-each-safe" title="list_for_each_safe()">list_for_each_safe</a>                  (h,
-                                                         i,
-                                                         nxt,
-                                                         member)
-#define             <a class="link" href="hkl-list.html#list-for-each-safe-off" title="list_for_each_safe_off()">list_for_each_safe_off</a>              (h,
-                                                         i,
-                                                         nxt,
-                                                         off)
-#define             <a class="link" href="hkl-list.html#list-head-off" title="list_head_off()">list_head_off</a>                       (h,
-                                                         type,
-                                                         off)
-#define             <a class="link" href="hkl-list.html#list-off-" title="list_off_()">list_off_</a>                           (type,
-                                                         member)
-#define             <a class="link" href="hkl-list.html#list-off-var-" title="list_off_var_()">list_off_var_</a>                       (var,
-                                                         member)
-#define             <a class="link" href="hkl-list.html#list-pop" title="list_pop()">list_pop</a>                            (h,
-                                                         type,
-                                                         member)
-#define             <a class="link" href="hkl-list.html#list-tail" title="list_tail()">list_tail</a>                           (h,
-                                                         type,
-                                                         member)
-#define             <a class="link" href="hkl-list.html#list-tail-off" title="list_tail_off()">list_tail_off</a>                       (h,
-                                                         type,
-                                                         off)
-#define             <a class="link" href="hkl-list.html#list-top" title="list_top()">list_top</a>                            (h,
-                                                         type,
-                                                         member)
-</pre>
+<div class="refsect1">
+<a name="hkl-list.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="function_type">struct <a class="link" href="hkl-list.html#list-head" title="struct list_head"><span class="returnvalue">list_head</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-check" title="list_check ()">list_check</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">struct <a class="link" href="hkl-list.html#list-node" title="struct list_node"><span class="returnvalue">list_node</span></a> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-check-node" title="list_check_node ()">list_check_node</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-debug" title="list_debug()">list_debug</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-debug-node" title="list_debug_node()">list_debug_node</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#LIST-HEAD-INIT:CAPS" title="LIST_HEAD_INIT()">LIST_HEAD_INIT</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#LIST-HEAD:CAPS" title="LIST_HEAD()">LIST_HEAD</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-add" title="list_add()">list_add</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-add-tail" title="list_add_tail()">list_add_tail</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-empty" title="list_empty()">list_empty</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-empty-nodebug" title="list_empty_nodebug()">list_empty_nodebug</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-del" title="list_del()">list_del</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-entry" title="list_entry()">list_entry</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-top" title="list_top()">list_top</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-pop" title="list_pop()">list_pop</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-tail" title="list_tail()">list_tail</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-for-each" title="list_for_each()">list_for_each</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-for-each-rev" title="list_for_each_rev()">list_for_each_rev</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-for-each-safe" title="list_for_each_safe()">list_for_each_safe</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-next" title="list_next()">list_next</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-prev" title="list_prev()">list_prev</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-append-list" title="list_append_list()">list_append_list</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-prepend-list" title="list_prepend_list()">list_prepend_list</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-for-each-off" title="list_for_each_off()">list_for_each_off</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-for-each-safe-off" title="list_for_each_safe_off()">list_for_each_safe_off</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-entry-off" title="list_entry_off()">list_entry_off</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-head-off" title="list_head_off()">list_head_off</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-tail-off" title="list_tail_off()">list_tail_off</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-add-off" title="list_add_off()">list_add_off</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-del-off" title="list_del_off()">list_del_off</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-del-from-off" title="list_del_from_off()">list_del_from_off</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-off-" title="list_off_()">list_off_</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-off-var-" title="list_off_var_()">list_off_var_</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-list.html#list-typeof" title="list_typeof()">list_typeof</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-list.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="name">
+<col class="description">
+</colgroup>
+<tbody>
+<tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-list.html#list-node" title="struct list_node">list_node</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-list.html#list-head" title="struct list_head">list_head</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="hkl-list.html#LIST-LOC:CAPS" title="LIST_LOC">LIST_LOC</a></td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-list.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-list.details"></a><h2>Details</h2>
+<a name="hkl-list.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
-<a name="LIST-HEAD:CAPS"></a><h3>LIST_HEAD()</h3>
-<pre class="programlisting">#define             LIST_HEAD(name)</pre>
+<a name="list-check"></a><h3>list_check ()</h3>
+<pre class="programlisting">struct <a class="link" href="hkl-list.html#list-head" title="struct list_head"><span class="returnvalue">list_head</span></a> *
+list_check (<em class="parameter"><code>const <span class="type">struct list_head</span> *h</code></em>,
+            <em class="parameter"><code>const <span class="type">char</span> *abortstr</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="LIST-HEAD-INIT:CAPS"></a><h3>LIST_HEAD_INIT()</h3>
-<pre class="programlisting">#define LIST_HEAD_INIT(name) { { &name.n, &name.n } }
+<a name="list-check-node"></a><h3>list_check_node ()</h3>
+<pre class="programlisting">struct <a class="link" href="hkl-list.html#list-node" title="struct list_node"><span class="returnvalue">list_node</span></a> *
+list_check_node (<em class="parameter"><code>const <span class="type">struct list_node</span> *n</code></em>,
+                 <em class="parameter"><code>const <span class="type">char</span> *abortstr</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="list-debug"></a><h3>list_debug()</h3>
+<pre class="programlisting">#define list_debug(h, loc) list_check((h), loc)
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="list-add-off"></a><h3>list_add_off()</h3>
-<pre class="programlisting">#define             list_add_off(h, n, off)</pre>
+<a name="list-debug-node"></a><h3>list_debug_node()</h3>
+<pre class="programlisting">#define list_debug_node(n, loc) list_check_node((n), loc)
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="LIST-HEAD-INIT:CAPS"></a><h3>LIST_HEAD_INIT()</h3>
+<pre class="programlisting">#define LIST_HEAD_INIT(name) { { &name.n, &name.n } }
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="list-check"></a><h3>list_check ()</h3>
-<pre class="programlisting">struct <span class="returnvalue">list_head</span> *  list_check                          (<em class="parameter"><code>const <span class="type">struct list_head</span> *h</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">char</span> *abortstr</code></em>);</pre>
+<a name="LIST-HEAD:CAPS"></a><h3>LIST_HEAD()</h3>
+<pre class="programlisting">#define             LIST_HEAD(name)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="list-check-node"></a><h3>list_check_node ()</h3>
-<pre class="programlisting">struct <span class="returnvalue">list_node</span> *  list_check_node                     (<em class="parameter"><code>const <span class="type">struct list_node</span> *n</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">char</span> *abortstr</code></em>);</pre>
+<a name="list-add"></a><h3>list_add()</h3>
+<pre class="programlisting">#define list_add(h, n) list_add_(h, n, LIST_LOC)
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="list-debug"></a><h3>list_debug()</h3>
-<pre class="programlisting">#define list_debug(h) list_check((h), __func__)
+<a name="list-add-tail"></a><h3>list_add_tail()</h3>
+<pre class="programlisting">#define list_add_tail(h, n) list_add_tail_(h, n, LIST_LOC)
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="list-debug-node"></a><h3>list_debug_node()</h3>
-<pre class="programlisting">#define list_debug_node(n) list_check_node((n), __func__)
+<a name="list-empty"></a><h3>list_empty()</h3>
+<pre class="programlisting">#define list_empty(h) list_empty_(h, LIST_LOC)
 </pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="list-del-from-off"></a><h3>list_del_from_off()</h3>
-<pre class="programlisting">#define             list_del_from_off(h, n, off)</pre>
+<a name="list-empty-nodebug"></a><h3>list_empty_nodebug()</h3>
+<pre class="programlisting">#define list_empty_nodebug(h) list_empty(h)
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="list-del-off"></a><h3>list_del_off()</h3>
-<pre class="programlisting">#define             list_del_off(n, off)</pre>
+<a name="list-del"></a><h3>list_del()</h3>
+<pre class="programlisting">#define list_del(n) list_del_(n, LIST_LOC)
+</pre>
 </div>
 <hr>
 <div class="refsect2">
@@ -159,18 +344,23 @@ struct <span class="returnvalue">list_node</span> *  <a class="link" href="hkl-l
 </div>
 <hr>
 <div class="refsect2">
-<a name="list-entry-off"></a><h3>list_entry_off()</h3>
-<pre class="programlisting">#define             list_entry_off(n, type, off)</pre>
+<a name="list-top"></a><h3>list_top()</h3>
+<pre class="programlisting">#define             list_top(h, type, member)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="list-for-each"></a><h3>list_for_each()</h3>
-<pre class="programlisting">#define             list_for_each(h, i, member)</pre>
+<a name="list-pop"></a><h3>list_pop()</h3>
+<pre class="programlisting">#define             list_pop(h, type, member)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="list-for-each-off"></a><h3>list_for_each_off()</h3>
-<pre class="programlisting">#define             list_for_each_off(h, i, off)</pre>
+<a name="list-tail"></a><h3>list_tail()</h3>
+<pre class="programlisting">#define             list_tail(h, type, member)</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="list-for-each"></a><h3>list_for_each()</h3>
+<pre class="programlisting">#define             list_for_each(h, i, member)</pre>
 </div>
 <hr>
 <div class="refsect2">
@@ -184,16 +374,67 @@ struct <span class="returnvalue">list_node</span> *  <a class="link" href="hkl-l
 </div>
 <hr>
 <div class="refsect2">
+<a name="list-next"></a><h3>list_next()</h3>
+<pre class="programlisting">#define             list_next(h, i, member)</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="list-prev"></a><h3>list_prev()</h3>
+<pre class="programlisting">#define             list_prev(h, i, member)</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="list-append-list"></a><h3>list_append_list()</h3>
+<pre class="programlisting">#define             list_append_list(t, f)</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="list-prepend-list"></a><h3>list_prepend_list()</h3>
+<pre class="programlisting">#define list_prepend_list(t, f) list_prepend_list_(t, f, LIST_LOC)
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="list-for-each-off"></a><h3>list_for_each_off()</h3>
+<pre class="programlisting">#define             list_for_each_off(h, i, off)</pre>
+</div>
+<hr>
+<div class="refsect2">
 <a name="list-for-each-safe-off"></a><h3>list_for_each_safe_off()</h3>
 <pre class="programlisting">#define             list_for_each_safe_off(h, i, nxt, off)</pre>
 </div>
 <hr>
 <div class="refsect2">
+<a name="list-entry-off"></a><h3>list_entry_off()</h3>
+<pre class="programlisting">#define             list_entry_off(n, type, off)</pre>
+</div>
+<hr>
+<div class="refsect2">
 <a name="list-head-off"></a><h3>list_head_off()</h3>
 <pre class="programlisting">#define             list_head_off(h, type, off)</pre>
 </div>
 <hr>
 <div class="refsect2">
+<a name="list-tail-off"></a><h3>list_tail_off()</h3>
+<pre class="programlisting">#define             list_tail_off(h, type, off)</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="list-add-off"></a><h3>list_add_off()</h3>
+<pre class="programlisting">#define             list_add_off(h, n, off)</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="list-del-off"></a><h3>list_del_off()</h3>
+<pre class="programlisting">#define             list_del_off(n, off)</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="list-del-from-off"></a><h3>list_del_from_off()</h3>
+<pre class="programlisting">#define             list_del_from_off(h, n, off)</pre>
+</div>
+<hr>
+<div class="refsect2">
 <a name="list-off-"></a><h3>list_off_()</h3>
 <pre class="programlisting">#define             list_off_(type, member)</pre>
 </div>
@@ -204,28 +445,38 @@ struct <span class="returnvalue">list_node</span> *  <a class="link" href="hkl-l
 </div>
 <hr>
 <div class="refsect2">
-<a name="list-pop"></a><h3>list_pop()</h3>
-<pre class="programlisting">#define             list_pop(h, type, member)</pre>
+<a name="list-typeof"></a><h3>list_typeof()</h3>
+<pre class="programlisting">#define list_typeof(var) typeof(var)
+</pre>
 </div>
-<hr>
+</div>
+<div class="refsect1">
+<a name="hkl-list.other_details"></a><h2>Types and Values</h2>
 <div class="refsect2">
-<a name="list-tail"></a><h3>list_tail()</h3>
-<pre class="programlisting">#define             list_tail(h, type, member)</pre>
+<a name="list-node"></a><h3>struct list_node</h3>
+<pre class="programlisting">struct list_node {
+	struct list_node *next, *prev;
+};
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="list-tail-off"></a><h3>list_tail_off()</h3>
-<pre class="programlisting">#define             list_tail_off(h, type, off)</pre>
+<a name="list-head"></a><h3>struct list_head</h3>
+<pre class="programlisting">struct list_head {
+	struct list_node n;
+};
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="list-top"></a><h3>list_top()</h3>
-<pre class="programlisting">#define             list_top(h, type, member)</pre>
+<a name="LIST-LOC:CAPS"></a><h3>LIST_LOC</h3>
+<pre class="programlisting">#define LIST_LOC __FILE__  ":" stringify(__LINE__)
+</pre>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-noerr.html b/Documentation/api/html/hkl-noerr.html
index ad099ca..7be29af 100644
--- a/Documentation/api/html/hkl-noerr.html
+++ b/Documentation/api/html/hkl-noerr.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>noerr</title>
+<title>hkl Reference Manual: noerr</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-list.html" title="list">
 <link rel="next" href="hkl-ptr-valid.html" title="ptr_valid">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-list.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="hkl-ptr-valid.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-noerr.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-noerr.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-noerr.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-list.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-ptr-valid.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-noerr"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,38 +29,72 @@
 <h2><span class="refentrytitle"><a name="hkl-noerr.top_of_page"></a>noerr</span></h2>
 <p>noerr</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-noerr.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"><span class="returnvalue">int</span>                 <a class="link" href="hkl-noerr.html#close-noerr" title="close_noerr ()">close_noerr</a>                         (<em class="parameter"><code><span class="type">int</span> fd</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-noerr.html#fclose-noerr" title="fclose_noerr ()">fclose_noerr</a>                        (<em class="parameter"><code><span class="type">FILE</span> *fp</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-noerr.html#unlink-noerr" title="unlink_noerr ()">unlink_noerr</a>                        (<em class="parameter"><code>const <span class="type">char</span> *pathname</code></em>);
-</pre>
+<div class="refsect1">
+<a name="hkl-noerr.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-noerr.html#close-noerr" title="close_noerr ()">close_noerr</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-noerr.html#fclose-noerr" title="fclose_noerr ()">fclose_noerr</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-noerr.html#unlink-noerr" title="unlink_noerr ()">unlink_noerr</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-noerr.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-noerr.details"></a><h2>Details</h2>
+<a name="hkl-noerr.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
-<a name="close-noerr"></a><h3>close_noerr ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 close_noerr                         (<em class="parameter"><code><span class="type">int</span> fd</code></em>);</pre>
+<a name="close-noerr"></a><h3>close_noerr ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+close_noerr (<em class="parameter"><code><span class="type">int</span> fd</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="fclose-noerr"></a><h3>fclose_noerr ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 fclose_noerr                        (<em class="parameter"><code><span class="type">FILE</span> *fp</code></em>);</pre>
+<a name="fclose-noerr"></a><h3>fclose_noerr ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+fclose_noerr (<em class="parameter"><code><span class="type">FILE</span> *fp</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="unlink-noerr"></a><h3>unlink_noerr ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 unlink_noerr                        (<em class="parameter"><code>const <span class="type">char</span> *pathname</code></em>);</pre>
+<a name="unlink-noerr"></a><h3>unlink_noerr ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+unlink_noerr (<em class="parameter"><code>const <span class="type">char</span> *pathname</code></em>);</pre>
+</div>
 </div>
+<div class="refsect1">
+<a name="hkl-noerr.other_details"></a><h2>Types and Values</h2>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-ptr-valid.html b/Documentation/api/html/hkl-ptr-valid.html
index eeff225..cc53bde 100644
--- a/Documentation/api/html/hkl-ptr-valid.html
+++ b/Documentation/api/html/hkl-ptr-valid.html
@@ -2,30 +2,26 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>ptr_valid</title>
+<title>hkl Reference Manual: ptr_valid</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-noerr.html" title="noerr">
-<link rel="next" href="object-tree.html" title="Object Hierarchy">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<link rel="next" href="hkl-str.html" title="str">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
-<tr valign="middle">
-<td><a accesskey="p" href="hkl-noerr.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="object-tree.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
-</tr>
-<tr><td colspan="5" class="shortcuts">
-<a href="#hkl-ptr-valid.synopsis" class="shortcut">Top</a>
-                   | 
-                  <a href="#hkl-ptr-valid.description" class="shortcut">Description</a>
-</td></tr>
-</table>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-ptr-valid.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-noerr.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-str.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
 <div class="refentry">
 <a name="hkl-ptr-valid"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
@@ -33,64 +29,142 @@
 <h2><span class="refentrytitle"><a name="hkl-ptr-valid.top_of_page"></a>ptr_valid</span></h2>
 <p>ptr_valid</p>
 </td>
-<td valign="top" align="right"></td>
+<td class="gallery_image" valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv">
-<a name="hkl-ptr-valid.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">#define             <a class="link" href="hkl-ptr-valid.html#PTR-VALID-ALIGNOF:CAPS" title="PTR_VALID_ALIGNOF()">PTR_VALID_ALIGNOF</a>                   (var)
-<span class="returnvalue">bool</span>                <a class="link" href="hkl-ptr-valid.html#ptr-valid" title="ptr_valid ()">ptr_valid</a>                           (<em class="parameter"><code>const <span class="type">void</span> *p</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> align</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> size</code></em>,
-                                                         <em class="parameter"><code><span class="type">bool</span> write</code></em>);
-<span class="returnvalue">bool</span>                <a class="link" href="hkl-ptr-valid.html#ptr-valid-batch" title="ptr_valid_batch ()">ptr_valid_batch</a>                     (<em class="parameter"><code><span class="type">struct ptr_valid_batch</span> *batch</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">void</span> *p</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> alignment</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> size</code></em>,
-                                                         <em class="parameter"><code><span class="type">bool</span> write</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-ptr-valid.html#ptr-valid-batch-end" title="ptr_valid_batch_end ()">ptr_valid_batch_end</a>                 (<em class="parameter"><code><span class="type">struct ptr_valid_batch</span> *batch</code></em>);
-#define             <a class="link" href="hkl-ptr-valid.html#ptr-valid-batch-read" title="ptr_valid_batch_read()">ptr_valid_batch_read</a>                (batch,
-                                                         p)
-<span class="returnvalue">bool</span>                <a class="link" href="hkl-ptr-valid.html#ptr-valid-batch-start" title="ptr_valid_batch_start ()">ptr_valid_batch_start</a>               (<em class="parameter"><code><span class="type">struct ptr_valid_batch</span> *batch</code></em>);
-<span class="returnvalue">bool</span>                <a class="link" href="hkl-ptr-valid.html#ptr-valid-batch-string" title="ptr_valid_batch_string ()">ptr_valid_batch_string</a>              (<em class="parameter"><code><span class="type">struct ptr_valid_batch</span> *batch</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">char</span> *p</code></em>);
-#define             <a class="link" href="hkl-ptr-valid.html#ptr-valid-batch-write" title="ptr_valid_batch_write()">ptr_valid_batch_write</a>               (batch,
-                                                         p)
-#define             <a class="link" href="hkl-ptr-valid.html#ptr-valid-read" title="ptr_valid_read()">ptr_valid_read</a>                      (p)
-<span class="returnvalue">bool</span>                <a class="link" href="hkl-ptr-valid.html#ptr-valid-string" title="ptr_valid_string ()">ptr_valid_string</a>                    (<em class="parameter"><code>const <span class="type">char</span> *p</code></em>);
-#define             <a class="link" href="hkl-ptr-valid.html#ptr-valid-write" title="ptr_valid_write()">ptr_valid_write</a>                     (p)
-</pre>
+<div class="refsect1">
+<a name="hkl-ptr-valid.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-ptr-valid.html#ptr-valid-read" title="ptr_valid_read()">ptr_valid_read</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-ptr-valid.html#ptr-valid-write" title="ptr_valid_write()">ptr_valid_write</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">bool</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-ptr-valid.html#ptr-valid-string" title="ptr_valid_string ()">ptr_valid_string</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">bool</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-ptr-valid.html#ptr-valid" title="ptr_valid ()">ptr_valid</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">bool</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-ptr-valid.html#ptr-valid-batch-start" title="ptr_valid_batch_start ()">ptr_valid_batch_start</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-ptr-valid.html#ptr-valid-batch-read" title="ptr_valid_batch_read()">ptr_valid_batch_read</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-ptr-valid.html#ptr-valid-batch-write" title="ptr_valid_batch_write()">ptr_valid_batch_write</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">bool</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-ptr-valid.html#ptr-valid-batch-string" title="ptr_valid_batch_string ()">ptr_valid_batch_string</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">void</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-ptr-valid.html#ptr-valid-batch-end" title="ptr_valid_batch_end ()">ptr_valid_batch_end</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-ptr-valid.html#PTR-VALID-ALIGNOF:CAPS" title="PTR_VALID_ALIGNOF()">PTR_VALID_ALIGNOF</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-ptr-valid.other"></a><h2>Types and Values</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="name">
+<col class="description">
+</colgroup>
+<tbody>
+<tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-ptr-valid.html#ptr-valid-batch" title="struct ptr_valid_batch">ptr_valid_batch</a></td>
+</tr>
+<tr>
+<td class="datatype_keyword">struct</td>
+<td class="function_name"><a class="link" href="hkl-ptr-valid.html#ptr-valid-map" title="struct ptr_valid_map">ptr_valid_map</a></td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <div class="refsect1">
 <a name="hkl-ptr-valid.description"></a><h2>Description</h2>
 </div>
 <div class="refsect1">
-<a name="hkl-ptr-valid.details"></a><h2>Details</h2>
+<a name="hkl-ptr-valid.functions_details"></a><h2>Functions</h2>
 <div class="refsect2">
-<a name="PTR-VALID-ALIGNOF:CAPS"></a><h3>PTR_VALID_ALIGNOF()</h3>
-<pre class="programlisting">#define PTR_VALID_ALIGNOF(var) __alignof__(var)
-</pre>
+<a name="ptr-valid-read"></a><h3>ptr_valid_read()</h3>
+<pre class="programlisting">#define             ptr_valid_read(p)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="ptr-valid"></a><h3>ptr_valid ()</h3>
-<pre class="programlisting"><span class="returnvalue">bool</span>                ptr_valid                           (<em class="parameter"><code>const <span class="type">void</span> *p</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> align</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> size</code></em>,
-                                                         <em class="parameter"><code><span class="type">bool</span> write</code></em>);</pre>
+<a name="ptr-valid-write"></a><h3>ptr_valid_write()</h3>
+<pre class="programlisting">#define             ptr_valid_write(p)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="ptr-valid-batch"></a><h3>ptr_valid_batch ()</h3>
-<pre class="programlisting"><span class="returnvalue">bool</span>                ptr_valid_batch                     (<em class="parameter"><code><span class="type">struct ptr_valid_batch</span> *batch</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">void</span> *p</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> alignment</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> size</code></em>,
-                                                         <em class="parameter"><code><span class="type">bool</span> write</code></em>);</pre>
+<a name="ptr-valid-string"></a><h3>ptr_valid_string ()</h3>
+<pre class="programlisting"><span class="returnvalue">bool</span>
+ptr_valid_string (<em class="parameter"><code>const <span class="type">char</span> *p</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="ptr-valid-batch-end"></a><h3>ptr_valid_batch_end ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                ptr_valid_batch_end                 (<em class="parameter"><code><span class="type">struct ptr_valid_batch</span> *batch</code></em>);</pre>
+<a name="ptr-valid"></a><h3>ptr_valid ()</h3>
+<pre class="programlisting"><span class="returnvalue">bool</span>
+ptr_valid (<em class="parameter"><code>const <span class="type">void</span> *p</code></em>,
+           <em class="parameter"><code><span class="type">size_t</span> align</code></em>,
+           <em class="parameter"><code><span class="type">size_t</span> size</code></em>,
+           <em class="parameter"><code><span class="type">bool</span> write</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="ptr-valid-batch-start"></a><h3>ptr_valid_batch_start ()</h3>
+<pre class="programlisting"><span class="returnvalue">bool</span>
+ptr_valid_batch_start (<em class="parameter"><code><span class="type">struct ptr_valid_batch</span> *batch</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
@@ -99,39 +173,56 @@
 </div>
 <hr>
 <div class="refsect2">
-<a name="ptr-valid-batch-start"></a><h3>ptr_valid_batch_start ()</h3>
-<pre class="programlisting"><span class="returnvalue">bool</span>                ptr_valid_batch_start               (<em class="parameter"><code><span class="type">struct ptr_valid_batch</span> *batch</code></em>);</pre>
+<a name="ptr-valid-batch-write"></a><h3>ptr_valid_batch_write()</h3>
+<pre class="programlisting">#define             ptr_valid_batch_write(batch, p)</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="ptr-valid-batch-string"></a><h3>ptr_valid_batch_string ()</h3>
-<pre class="programlisting"><span class="returnvalue">bool</span>                ptr_valid_batch_string              (<em class="parameter"><code><span class="type">struct ptr_valid_batch</span> *batch</code></em>,
-                                                         <em class="parameter"><code>const <span class="type">char</span> *p</code></em>);</pre>
+<a name="ptr-valid-batch-string"></a><h3>ptr_valid_batch_string ()</h3>
+<pre class="programlisting"><span class="returnvalue">bool</span>
+ptr_valid_batch_string (<em class="parameter"><code><span class="type">struct ptr_valid_batch</span> *batch</code></em>,
+                        <em class="parameter"><code>const <span class="type">char</span> *p</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="ptr-valid-batch-write"></a><h3>ptr_valid_batch_write()</h3>
-<pre class="programlisting">#define             ptr_valid_batch_write(batch, p)</pre>
+<a name="ptr-valid-batch-end"></a><h3>ptr_valid_batch_end ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>
+ptr_valid_batch_end (<em class="parameter"><code><span class="type">struct ptr_valid_batch</span> *batch</code></em>);</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="ptr-valid-read"></a><h3>ptr_valid_read()</h3>
-<pre class="programlisting">#define             ptr_valid_read(p)</pre>
+<a name="PTR-VALID-ALIGNOF:CAPS"></a><h3>PTR_VALID_ALIGNOF()</h3>
+<pre class="programlisting">#define PTR_VALID_ALIGNOF(var) __alignof__(var)
+</pre>
 </div>
-<hr>
+</div>
+<div class="refsect1">
+<a name="hkl-ptr-valid.other_details"></a><h2>Types and Values</h2>
 <div class="refsect2">
-<a name="ptr-valid-string"></a><h3>ptr_valid_string ()</h3>
-<pre class="programlisting"><span class="returnvalue">bool</span>                ptr_valid_string                    (<em class="parameter"><code>const <span class="type">char</span> *p</code></em>);</pre>
+<a name="ptr-valid-batch"></a><h3>struct ptr_valid_batch</h3>
+<pre class="programlisting">struct ptr_valid_batch {
+	unsigned int num_maps;
+	struct ptr_valid_map *maps;
+	int child_pid;
+	int to_child, from_child;
+	void *last;
+	bool last_ok;
+};
+</pre>
 </div>
 <hr>
 <div class="refsect2">
-<a name="ptr-valid-write"></a><h3>ptr_valid_write()</h3>
-<pre class="programlisting">#define             ptr_valid_write(p)</pre>
+<a name="ptr-valid-map"></a><h3>struct ptr_valid_map</h3>
+<pre class="programlisting">struct ptr_valid_map {
+	const char *start, *end;
+	bool is_write;
+};
+</pre>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-str-debug.html b/Documentation/api/html/hkl-str-debug.html
new file mode 100644
index 0000000..84170fb
--- /dev/null
+++ b/Documentation/api/html/hkl-str-debug.html
@@ -0,0 +1,285 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>hkl Reference Manual: str_debug</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
+<link rel="home" href="index.html" title="hkl Reference Manual">
+<link rel="up" href="ch01.html" title="[Insert title here]">
+<link rel="prev" href="hkl-str.html" title="str">
+<link rel="next" href="object-tree.html" title="Object Hierarchy">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
+<link rel="stylesheet" href="style.css" type="text/css">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-str-debug.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-str.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="object-tree.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
+<div class="refentry">
+<a name="hkl-str-debug"></a><div class="titlepage"></div>
+<div class="refnamediv"><table width="100%"><tr>
+<td valign="top">
+<h2><span class="refentrytitle"><a name="hkl-str-debug.top_of_page"></a>str_debug</span></h2>
+<p>str_debug</p>
+</td>
+<td class="gallery_image" valign="top" align="right"></td>
+</tr></table></div>
+<div class="refsect1">
+<a name="hkl-str-debug.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str-debug.html#str-isalnum" title="str_isalnum ()">str_isalnum</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str-debug.html#str-isalpha" title="str_isalpha ()">str_isalpha</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str-debug.html#str-isascii" title="str_isascii ()">str_isascii</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str-debug.html#str-isblank" title="str_isblank ()">str_isblank</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str-debug.html#str-iscntrl" title="str_iscntrl ()">str_iscntrl</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str-debug.html#str-isdigit" title="str_isdigit ()">str_isdigit</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str-debug.html#str-isgraph" title="str_isgraph ()">str_isgraph</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str-debug.html#str-islower" title="str_islower ()">str_islower</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str-debug.html#str-isprint" title="str_isprint ()">str_isprint</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str-debug.html#str-ispunct" title="str_ispunct ()">str_ispunct</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str-debug.html#str-isspace" title="str_isspace ()">str_isspace</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str-debug.html#str-isupper" title="str_isupper ()">str_isupper</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">int</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str-debug.html#str-isxdigit" title="str_isxdigit ()">str_isxdigit</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">char</span> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str-debug.html#str-strstr" title="str_strstr ()">str_strstr</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">char</span> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str-debug.html#str-strchr" title="str_strchr ()">str_strchr</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">char</span> *
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str-debug.html#str-strrchr" title="str_strrchr ()">str_strrchr</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-str-debug.description"></a><h2>Description</h2>
+</div>
+<div class="refsect1">
+<a name="hkl-str-debug.functions_details"></a><h2>Functions</h2>
+<div class="refsect2">
+<a name="str-isalnum"></a><h3>str_isalnum ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+str_isalnum (<em class="parameter"><code><span class="type">int</span> i</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="str-isalpha"></a><h3>str_isalpha ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+str_isalpha (<em class="parameter"><code><span class="type">int</span> i</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="str-isascii"></a><h3>str_isascii ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+str_isascii (<em class="parameter"><code><span class="type">int</span> i</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="str-isblank"></a><h3>str_isblank ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+str_isblank (<em class="parameter"><code><span class="type">int</span> i</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="str-iscntrl"></a><h3>str_iscntrl ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+str_iscntrl (<em class="parameter"><code><span class="type">int</span> i</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="str-isdigit"></a><h3>str_isdigit ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+str_isdigit (<em class="parameter"><code><span class="type">int</span> i</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="str-isgraph"></a><h3>str_isgraph ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+str_isgraph (<em class="parameter"><code><span class="type">int</span> i</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="str-islower"></a><h3>str_islower ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+str_islower (<em class="parameter"><code><span class="type">int</span> i</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="str-isprint"></a><h3>str_isprint ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+str_isprint (<em class="parameter"><code><span class="type">int</span> i</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="str-ispunct"></a><h3>str_ispunct ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+str_ispunct (<em class="parameter"><code><span class="type">int</span> i</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="str-isspace"></a><h3>str_isspace ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+str_isspace (<em class="parameter"><code><span class="type">int</span> i</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="str-isupper"></a><h3>str_isupper ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+str_isupper (<em class="parameter"><code><span class="type">int</span> i</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="str-isxdigit"></a><h3>str_isxdigit ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>
+str_isxdigit (<em class="parameter"><code><span class="type">int</span> i</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="str-strstr"></a><h3>str_strstr ()</h3>
+<pre class="programlisting"><span class="returnvalue">char</span> *
+str_strstr (<em class="parameter"><code>const <span class="type">char</span> *haystack</code></em>,
+            <em class="parameter"><code>const <span class="type">char</span> *needle</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="str-strchr"></a><h3>str_strchr ()</h3>
+<pre class="programlisting"><span class="returnvalue">char</span> *
+str_strchr (<em class="parameter"><code>const <span class="type">char</span> *s</code></em>,
+            <em class="parameter"><code><span class="type">int</span> c</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="str-strrchr"></a><h3>str_strrchr ()</h3>
+<pre class="programlisting"><span class="returnvalue">char</span> *
+str_strrchr (<em class="parameter"><code>const <span class="type">char</span> *s</code></em>,
+             <em class="parameter"><code><span class="type">int</span> c</code></em>);</pre>
+</div>
+</div>
+<div class="refsect1">
+<a name="hkl-str-debug.other_details"></a><h2>Types and Values</h2>
+</div>
+</div>
+<div class="footer">
+<hr>
+          Generated by GTK-Doc V1.21</div>
+</body>
+</html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-str.html b/Documentation/api/html/hkl-str.html
new file mode 100644
index 0000000..cd1cbc4
--- /dev/null
+++ b/Documentation/api/html/hkl-str.html
@@ -0,0 +1,369 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>hkl Reference Manual: str</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
+<link rel="home" href="index.html" title="hkl Reference Manual">
+<link rel="up" href="ch01.html" title="[Insert title here]">
+<link rel="prev" href="hkl-ptr-valid.html" title="ptr_valid">
+<link rel="next" href="hkl-str-debug.html" title="str_debug">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
+<link rel="stylesheet" href="style.css" type="text/css">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts">
+<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
+                  <a href="#hkl-str.description" class="shortcut">Description</a></span>
+</td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
+<td><a accesskey="p" href="hkl-ptr-valid.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="hkl-str-debug.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
+</tr></table>
+<div class="refentry">
+<a name="hkl-str"></a><div class="titlepage"></div>
+<div class="refnamediv"><table width="100%"><tr>
+<td valign="top">
+<h2><span class="refentrytitle"><a name="hkl-str.top_of_page"></a>str</span></h2>
+<p>str</p>
+</td>
+<td class="gallery_image" valign="top" align="right"></td>
+</tr></table></div>
+<div class="refsect1">
+<a name="hkl-str.functions"></a><h2>Functions</h2>
+<div class="informaltable"><table width="100%" border="0">
+<colgroup>
+<col width="150px" class="functions_return">
+<col class="functions_name">
+</colgroup>
+<tbody>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#streq" title="streq()">streq</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#strstarts" title="strstarts()">strstarts</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#stringify" title="stringify()">stringify</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#stringify-1" title="stringify_1()">stringify_1</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">size_t</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#strcount" title="strcount ()">strcount</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#STR-MAX-CHARS:CAPS" title="STR_MAX_CHARS()">STR_MAX_CHARS</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#STR-MAX-CHARS-TCHECK-:CAPS" title="STR_MAX_CHARS_TCHECK_()">STR_MAX_CHARS_TCHECK_</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">return</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#isalnum" title="isalnum ()">isalnum</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">return</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#isalpha" title="isalpha ()">isalpha</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">return</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#isascii" title="isascii ()">isascii</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">return</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#isblank" title="isblank ()">isblank</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">return</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#iscntrl" title="iscntrl ()">iscntrl</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">return</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#isdigit" title="isdigit ()">isdigit</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">return</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#isgraph" title="isgraph ()">isgraph</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">return</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#islower" title="islower ()">islower</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">return</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#isprint" title="isprint ()">isprint</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">return</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#ispunct" title="ispunct ()">ispunct</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">return</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#isspace" title="isspace ()">isspace</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">return</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#isupper" title="isupper ()">isupper</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="function_type">
+<span class="returnvalue">return</span>
+</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#isxdigit" title="isxdigit ()">isxdigit</a> <span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#str-check-arg-" title="str_check_arg_()">str_check_arg_</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#strstr" title="strstr()">strstr</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#strchr" title="strchr()">strchr</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
+<td class="function_name">
+<a class="link" href="hkl-str.html#strrchr" title="strrchr()">strrchr</a><span class="c_punctuation">()</span>
+</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="refsect1">
+<a name="hkl-str.description"></a><h2>Description</h2>
+</div>
+<div class="refsect1">
+<a name="hkl-str.functions_details"></a><h2>Functions</h2>
+<div class="refsect2">
+<a name="streq"></a><h3>streq()</h3>
+<pre class="programlisting">#define streq(a,b) (strcmp((a),(b)) == 0)
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="strstarts"></a><h3>strstarts()</h3>
+<pre class="programlisting">#define strstarts(str,prefix) (strncmp((str),(prefix),strlen(prefix)) == 0)
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="stringify"></a><h3>stringify()</h3>
+<pre class="programlisting">#define stringify(expr)		stringify_1(expr)
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="stringify-1"></a><h3>stringify_1()</h3>
+<pre class="programlisting">#define stringify_1(expr) #expr
+</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="strcount"></a><h3>strcount ()</h3>
+<pre class="programlisting"><span class="returnvalue">size_t</span>
+strcount (<em class="parameter"><code>const <span class="type">char</span> *haystack</code></em>,
+          <em class="parameter"><code>const <span class="type">char</span> *needle</code></em>);</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="STR-MAX-CHARS:CAPS"></a><h3>STR_MAX_CHARS()</h3>
+<pre class="programlisting">#define             STR_MAX_CHARS(type_or_expr)</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="STR-MAX-CHARS-TCHECK-:CAPS"></a><h3>STR_MAX_CHARS_TCHECK_()</h3>
+<pre class="programlisting">#define             STR_MAX_CHARS_TCHECK_(type_or_expr)</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="isalnum"></a><h3>isalnum ()</h3>
+<pre class="programlisting"><span class="returnvalue">return</span>
+isalnum ();</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="isalpha"></a><h3>isalpha ()</h3>
+<pre class="programlisting"><span class="returnvalue">return</span>
+isalpha ();</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="isascii"></a><h3>isascii ()</h3>
+<pre class="programlisting"><span class="returnvalue">return</span>
+isascii ();</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="isblank"></a><h3>isblank ()</h3>
+<pre class="programlisting"><span class="returnvalue">return</span>
+isblank ();</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="iscntrl"></a><h3>iscntrl ()</h3>
+<pre class="programlisting"><span class="returnvalue">return</span>
+iscntrl ();</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="isdigit"></a><h3>isdigit ()</h3>
+<pre class="programlisting"><span class="returnvalue">return</span>
+isdigit ();</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="isgraph"></a><h3>isgraph ()</h3>
+<pre class="programlisting"><span class="returnvalue">return</span>
+isgraph ();</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="islower"></a><h3>islower ()</h3>
+<pre class="programlisting"><span class="returnvalue">return</span>
+islower ();</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="isprint"></a><h3>isprint ()</h3>
+<pre class="programlisting"><span class="returnvalue">return</span>
+isprint ();</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="ispunct"></a><h3>ispunct ()</h3>
+<pre class="programlisting"><span class="returnvalue">return</span>
+ispunct ();</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="isspace"></a><h3>isspace ()</h3>
+<pre class="programlisting"><span class="returnvalue">return</span>
+isspace ();</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="isupper"></a><h3>isupper ()</h3>
+<pre class="programlisting"><span class="returnvalue">return</span>
+isupper ();</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="isxdigit"></a><h3>isxdigit ()</h3>
+<pre class="programlisting"><span class="returnvalue">return</span>
+isxdigit ();</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="str-check-arg-"></a><h3>str_check_arg_()</h3>
+<pre class="programlisting">#define             str_check_arg_(i)</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="strstr"></a><h3>strstr()</h3>
+<pre class="programlisting">#define             strstr(haystack, needle)</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="strchr"></a><h3>strchr()</h3>
+<pre class="programlisting">#define             strchr(haystack, c)</pre>
+</div>
+<hr>
+<div class="refsect2">
+<a name="strrchr"></a><h3>strrchr()</h3>
+<pre class="programlisting">#define             strrchr(haystack, c)</pre>
+</div>
+</div>
+<div class="refsect1">
+<a name="hkl-str.other_details"></a><h2>Types and Values</h2>
+</div>
+</div>
+<div class="footer">
+<hr>
+          Generated by GTK-Doc V1.21</div>
+</body>
+</html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl.devhelp2 b/Documentation/api/html/hkl.devhelp2
index d507b59..48cc79d 100644
--- a/Documentation/api/html/hkl.devhelp2
+++ b/Documentation/api/html/hkl.devhelp2
@@ -10,9 +10,10 @@
       <sub name="compiler" link="hkl-compiler.html"/>
       <sub name="container_of" link="hkl-container-of.html"/>
       <sub name="darray" link="hkl-darray.html"/>
+      <sub name="hkl" link="hkl-hkl.html"/>
       <sub name="hkl-axis-private" link="hkl-hkl-axis-private.html"/>
       <sub name="hkl-detector-private" link="hkl-hkl-detector-private.html"/>
-      <sub name="hkl-error-private" link="hkl-hkl-error-private.html"/>
+      <sub name="hkl-factory-private" link="hkl-hkl-factory-private.html"/>
       <sub name="hkl-geometry-private" link="hkl-hkl-geometry-private.html"/>
       <sub name="hkl-interval-private" link="hkl-hkl-interval-private.html"/>
       <sub name="hkl-lattice-private" link="hkl-hkl-lattice-private.html"/>
@@ -24,14 +25,7 @@
       <sub name="hkl-pseudoaxis-common-hkl-private" link="hkl-hkl-pseudoaxis-common-hkl-private.html"/>
       <sub name="hkl-pseudoaxis-common-psi-private" link="hkl-hkl-pseudoaxis-common-psi-private.html"/>
       <sub name="hkl-pseudoaxis-common-q-private" link="hkl-hkl-pseudoaxis-common-q-private.html"/>
-      <sub name="hkl-pseudoaxis-e4c-private" link="hkl-hkl-pseudoaxis-e4c-private.html"/>
-      <sub name="hkl-pseudoaxis-e6c-private" link="hkl-hkl-pseudoaxis-e6c-private.html"/>
-      <sub name="hkl-pseudoaxis-k4cv-private" link="hkl-hkl-pseudoaxis-k4cv-private.html"/>
-      <sub name="hkl-pseudoaxis-k6c-private" link="hkl-hkl-pseudoaxis-k6c-private.html"/>
-      <sub name="hkl-pseudoaxis-petra3-private" link="hkl-hkl-pseudoaxis-petra3-private.html"/>
       <sub name="hkl-pseudoaxis-private" link="hkl-hkl-pseudoaxis-private.html"/>
-      <sub name="hkl-pseudoaxis-soleil-sixs-med-private" link="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html"/>
-      <sub name="hkl-pseudoaxis-zaxis-private" link="hkl-hkl-pseudoaxis-zaxis-private.html"/>
       <sub name="hkl-quaternion-private" link="hkl-hkl-quaternion-private.html"/>
       <sub name="hkl-sample-private" link="hkl-hkl-sample-private.html"/>
       <sub name="hkl-source-private" link="hkl-hkl-source-private.html"/>
@@ -42,6 +36,8 @@
       <sub name="list" link="hkl-list.html"/>
       <sub name="noerr" link="hkl-noerr.html"/>
       <sub name="ptr_valid" link="hkl-ptr-valid.html"/>
+      <sub name="str" link="hkl-str.html"/>
+      <sub name="str_debug" link="hkl-str-debug.html"/>
     </sub>
     <sub name="Object Hierarchy" link="object-tree.html"/>
     <sub name="API Index" link="api-index-full.html"/>
@@ -50,381 +46,461 @@
   </chapters>
   <functions>
     <keyword type="macro" name="ARRAY_SIZE()" link="hkl-array-size.html#ARRAY-SIZE:CAPS"/>
-    <keyword type="macro" name="AUTODATA()" link="hkl-autodata.html#AUTODATA:CAPS"/>
-    <keyword type="macro" name="AUTODATA_MAGIC" link="hkl-autodata.html#AUTODATA-MAGIC:CAPS"/>
     <keyword type="macro" name="AUTODATA_TYPE()" link="hkl-autodata.html#AUTODATA-TYPE:CAPS"/>
-    <keyword type="macro" name="AUTODATA_VAR_()" link="hkl-autodata.html#AUTODATA-VAR-:CAPS"/>
-    <keyword type="macro" name="AUTODATA_VAR__()" link="hkl-autodata.html#AUTODATA-VAR--:CAPS"/>
-    <keyword type="function" name="autodata_free ()" link="hkl-autodata.html#autodata-free"/>
+    <keyword type="macro" name="AUTODATA()" link="hkl-autodata.html#AUTODATA:CAPS"/>
     <keyword type="macro" name="autodata_get()" link="hkl-autodata.html#autodata-get"/>
-    <keyword type="function" name="autodata_get_section ()" link="hkl-autodata.html#autodata-get-section"/>
-    <keyword type="function" name="autodata_make_table ()" link="hkl-autodata.html#autodata-make-table"/>
+    <keyword type="function" name="autodata_free ()" link="hkl-autodata.html#autodata-free"/>
+    <keyword type="macro" name="AUTODATA_VAR__()" link="hkl-autodata.html#AUTODATA-VAR--:CAPS"/>
+    <keyword type="macro" name="AUTODATA_VAR_()" link="hkl-autodata.html#AUTODATA-VAR-:CAPS"/>
+    <keyword type="function" name="autodata_get_section ()" link="hkl-autodata.html#autodata-get-section"/>
+    <keyword type="macro" name="AUTODATA_MAGIC" link="hkl-autodata.html#AUTODATA-MAGIC:CAPS"/>
+    <keyword type="function" name="autodata_make_table ()" link="hkl-autodata.html#autodata-make-table"/>
     <keyword type="macro" name="BUILD_ASSERT()" link="hkl-build-assert.html#BUILD-ASSERT:CAPS"/>
     <keyword type="macro" name="BUILD_ASSERT_OR_ZERO()" link="hkl-build-assert.html#BUILD-ASSERT-OR-ZERO:CAPS"/>
     <keyword type="macro" name="check_type()" link="hkl-check-type.html#check-type"/>
     <keyword type="macro" name="check_types_match()" link="hkl-check-type.html#check-types-match"/>
-    <keyword type="macro" name="COLD" link="hkl-compiler.html#COLD:CAPS"/>
-    <keyword type="macro" name="CONST_FUNCTION" link="hkl-compiler.html#CONST-FUNCTION:CAPS"/>
+    <keyword type="macro" name="PRINTF_FMT()" link="hkl-compiler.html#PRINTF-FMT:CAPS"/>
     <keyword type="macro" name="IS_COMPILE_CONSTANT()" link="hkl-compiler.html#IS-COMPILE-CONSTANT:CAPS"/>
-    <keyword type="macro" name="NEEDED" link="hkl-compiler.html#NEEDED:CAPS"/>
+    <keyword type="macro" name="COLD" link="hkl-compiler.html#COLD:CAPS"/>
     <keyword type="macro" name="NORETURN" link="hkl-compiler.html#NORETURN:CAPS"/>
-    <keyword type="macro" name="PRINTF_FMT()" link="hkl-compiler.html#PRINTF-FMT:CAPS"/>
+    <keyword type="macro" name="CONST_FUNCTION" link="hkl-compiler.html#CONST-FUNCTION:CAPS"/>
+    <keyword type="macro" name="PURE_FUNCTION" link="hkl-compiler.html#PURE-FUNCTION:CAPS"/>
     <keyword type="macro" name="UNNEEDED" link="hkl-compiler.html#UNNEEDED:CAPS"/>
+    <keyword type="macro" name="NEEDED" link="hkl-compiler.html#NEEDED:CAPS"/>
     <keyword type="macro" name="UNUSED" link="hkl-compiler.html#UNUSED:CAPS"/>
     <keyword type="macro" name="WARN_UNUSED_RESULT" link="hkl-compiler.html#WARN-UNUSED-RESULT:CAPS"/>
     <keyword type="macro" name="container_of()" link="hkl-container-of.html#container-of"/>
-    <keyword type="macro" name="container_of_var()" link="hkl-container-of.html#container-of-var"/>
     <keyword type="macro" name="container_off()" link="hkl-container-of.html#container-off"/>
+    <keyword type="macro" name="container_of_var()" link="hkl-container-of.html#container-of-var"/>
     <keyword type="macro" name="container_off_var()" link="hkl-container-of.html#container-off-var"/>
     <keyword type="macro" name="darray()" link="hkl-darray.html#darray"/>
+    <keyword type="macro" name="darray_new" link="hkl-darray.html#darray-new"/>
+    <keyword type="macro" name="darray_init()" link="hkl-darray.html#darray-init"/>
+    <keyword type="macro" name="darray_free()" link="hkl-darray.html#darray-free"/>
+    <keyword type="macro" name="darray_item()" link="hkl-darray.html#darray-item"/>
+    <keyword type="macro" name="darray_size()" link="hkl-darray.html#darray-size"/>
     <keyword type="macro" name="darray_alloc()" link="hkl-darray.html#darray-alloc"/>
+    <keyword type="macro" name="darray_empty()" link="hkl-darray.html#darray-empty"/>
     <keyword type="macro" name="darray_append()" link="hkl-darray.html#darray-append"/>
+    <keyword type="macro" name="darray_prepend()" link="hkl-darray.html#darray-prepend"/>
+    <keyword type="macro" name="darray_push()" link="hkl-darray.html#darray-push"/>
     <keyword type="macro" name="darray_append_items()" link="hkl-darray.html#darray-append-items"/>
+    <keyword type="macro" name="darray_prepend_items()" link="hkl-darray.html#darray-prepend-items"/>
     <keyword type="macro" name="darray_append_items_nullterminate()" link="hkl-darray.html#darray-append-items-nullterminate"/>
-    <keyword type="macro" name="darray_append_lit()" link="hkl-darray.html#darray-append-lit"/>
-    <keyword type="macro" name="darray_append_string()" link="hkl-darray.html#darray-append-string"/>
+    <keyword type="macro" name="darray_prepend_items_nullterminate()" link="hkl-darray.html#darray-prepend-items-nullterminate"/>
     <keyword type="macro" name="darray_appends()" link="hkl-darray.html#darray-appends"/>
+    <keyword type="macro" name="darray_prepends()" link="hkl-darray.html#darray-prepends"/>
     <keyword type="macro" name="darray_appends_t()" link="hkl-darray.html#darray-appends-t"/>
-    <keyword type="typedef" name="darray_char" link="hkl-darray.html#darray-char"/>
-    <keyword type="macro" name="darray_empty()" link="hkl-darray.html#darray-empty"/>
-    <keyword type="macro" name="darray_foreach()" link="hkl-darray.html#darray-foreach"/>
-    <keyword type="macro" name="darray_foreach_reverse()" link="hkl-darray.html#darray-foreach-reverse"/>
-    <keyword type="macro" name="darray_free()" link="hkl-darray.html#darray-free"/>
-    <keyword type="macro" name="darray_from_c()" link="hkl-darray.html#darray-from-c"/>
-    <keyword type="macro" name="darray_from_items()" link="hkl-darray.html#darray-from-items"/>
-    <keyword type="macro" name="darray_from_lit()" link="hkl-darray.html#darray-from-lit"/>
-    <keyword type="macro" name="darray_from_string()" link="hkl-darray.html#darray-from-string"/>
-    <keyword type="macro" name="darray_growalloc()" link="hkl-darray.html#darray-growalloc"/>
-    <keyword type="macro" name="darray_init()" link="hkl-darray.html#darray-init"/>
-    <keyword type="typedef" name="darray_int" link="hkl-darray.html#darray-int"/>
-    <keyword type="typedef" name="darray_item" link="hkl-darray.html#darray-item"/>
-    <keyword type="typedef" name="darray_long" link="hkl-darray.html#darray-long"/>
-    <keyword type="macro" name="darray_make_room()" link="hkl-darray.html#darray-make-room"/>
-    <keyword type="macro" name="darray_new" link="hkl-darray.html#darray-new"/>
+    <keyword type="macro" name="darray_prepends_t()" link="hkl-darray.html#darray-prepends-t"/>
     <keyword type="macro" name="darray_pop()" link="hkl-darray.html#darray-pop"/>
     <keyword type="macro" name="darray_pop_check()" link="hkl-darray.html#darray-pop-check"/>
-    <keyword type="macro" name="darray_prepend()" link="hkl-darray.html#darray-prepend"/>
-    <keyword type="macro" name="darray_prepend_items()" link="hkl-darray.html#darray-prepend-items"/>
-    <keyword type="macro" name="darray_prepend_items_nullterminate()" link="hkl-darray.html#darray-prepend-items-nullterminate"/>
-    <keyword type="macro" name="darray_prepend_lit()" link="hkl-darray.html#darray-prepend-lit"/>
+    <keyword type="macro" name="darray_from_items()" link="hkl-darray.html#darray-from-items"/>
+    <keyword type="macro" name="darray_from_c()" link="hkl-darray.html#darray-from-c"/>
+    <keyword type="macro" name="darray_append_string()" link="hkl-darray.html#darray-append-string"/>
+    <keyword type="macro" name="darray_append_lit()" link="hkl-darray.html#darray-append-lit"/>
     <keyword type="macro" name="darray_prepend_string()" link="hkl-darray.html#darray-prepend-string"/>
-    <keyword type="macro" name="darray_prepends()" link="hkl-darray.html#darray-prepends"/>
-    <keyword type="macro" name="darray_prepends_t()" link="hkl-darray.html#darray-prepends-t"/>
-    <keyword type="macro" name="darray_push()" link="hkl-darray.html#darray-push"/>
-    <keyword type="macro" name="darray_realloc()" link="hkl-darray.html#darray-realloc"/>
+    <keyword type="macro" name="darray_prepend_lit()" link="hkl-darray.html#darray-prepend-lit"/>
+    <keyword type="macro" name="darray_from_string()" link="hkl-darray.html#darray-from-string"/>
+    <keyword type="macro" name="darray_from_lit()" link="hkl-darray.html#darray-from-lit"/>
     <keyword type="macro" name="darray_resize()" link="hkl-darray.html#darray-resize"/>
     <keyword type="macro" name="darray_resize0()" link="hkl-darray.html#darray-resize0"/>
+    <keyword type="macro" name="darray_realloc()" link="hkl-darray.html#darray-realloc"/>
+    <keyword type="macro" name="darray_growalloc()" link="hkl-darray.html#darray-growalloc"/>
+    <keyword type="macro" name="darray_make_room()" link="hkl-darray.html#darray-make-room"/>
+    <keyword type="macro" name="darray_foreach()" link="hkl-darray.html#darray-foreach"/>
+    <keyword type="macro" name="darray_foreach_reverse()" link="hkl-darray.html#darray-foreach-reverse"/>
+    <keyword type="typedef" name="darray_char" link="hkl-darray.html#darray-char"/>
     <keyword type="typedef" name="darray_schar" link="hkl-darray.html#darray-schar"/>
-    <keyword type="typedef" name="darray_short" link="hkl-darray.html#darray-short"/>
-    <keyword type="macro" name="darray_size()" link="hkl-darray.html#darray-size"/>
     <keyword type="typedef" name="darray_uchar" link="hkl-darray.html#darray-uchar"/>
+    <keyword type="typedef" name="darray_short" link="hkl-darray.html#darray-short"/>
+    <keyword type="typedef" name="darray_int" link="hkl-darray.html#darray-int"/>
+    <keyword type="typedef" name="darray_long" link="hkl-darray.html#darray-long"/>
+    <keyword type="typedef" name="darray_ushort" link="hkl-darray.html#darray-ushort"/>
     <keyword type="typedef" name="darray_uint" link="hkl-darray.html#darray-uint"/>
     <keyword type="typedef" name="darray_ulong" link="hkl-darray.html#darray-ulong"/>
-    <keyword type="typedef" name="darray_ushort" link="hkl-darray.html#darray-ushort"/>
+    <keyword type="macro" name="HKL_DEPRECATED_FOR()" link="hkl-hkl.html#HKL-DEPRECATED-FOR:CAPS"/>
+    <keyword type="macro" name="HKL_DEGTORAD" link="hkl-hkl.html#HKL-DEGTORAD:CAPS"/>
+    <keyword type="macro" name="HKL_RADTODEG" link="hkl-hkl.html#HKL-RADTODEG:CAPS"/>
+    <keyword type="macro" name="HKL_TAU" link="hkl-hkl.html#HKL-TAU:CAPS"/>
+    <keyword type="macro" name="HKL_ARG_NONNULL()" link="hkl-hkl.html#HKL-ARG-NONNULL:CAPS"/>
+    <keyword type="macro" name="HKL_GEOMETRY_LIST_FOREACH()" link="hkl-hkl.html#HKL-GEOMETRY-LIST-FOREACH:CAPS"/>
+    <keyword type="macro" name="HKL_SAMPLE_REFLECTIONS_FOREACH()" link="hkl-hkl.html#HKL-SAMPLE-REFLECTIONS-FOREACH:CAPS"/>
+    <keyword type="macro" name="HKL_DEPRECATED" link="hkl-hkl.html#HKL-DEPRECATED:CAPS"/>
+    <keyword type="macro" name="HKL_TINY" link="hkl-hkl.html#HKL-TINY:CAPS"/>
+    <keyword type="macro" name="HKL_EPSILON" link="hkl-hkl.html#HKL-EPSILON:CAPS"/>
+    <keyword type="macro" name="HKLAPI" link="hkl-hkl.html#HKLAPI:CAPS"/>
+    <keyword type="macro" name="HKL_WARN_UNUSED_RESULT" link="hkl-hkl.html#HKL-WARN-UNUSED-RESULT:CAPS"/>
+    <keyword type="struct" name="struct HklVector" link="hkl-hkl.html#HklVector"/>
+    <keyword type="struct" name="struct HklQuaternion" link="hkl-hkl.html#HklQuaternion"/>
+    <keyword type="typedef" name="darray_string" link="hkl-hkl.html#darray-string"/>
+    <keyword type="enum" name="enum HklUnitEnum" link="hkl-hkl.html#HklUnitEnum"/>
+    <keyword type="enum" name="enum HklDetectorType" link="hkl-hkl.html#HklDetectorType"/>
+    <keyword type="typedef" name="darray_engine" link="hkl-hkl.html#darray-engine"/>
+    <keyword type="enum" name="enum HklEngineCapabilities" link="hkl-hkl.html#HklEngineCapabilities"/>
+    <keyword type="enum" name="enum HklEngineAxisNamesGet" link="hkl-hkl.html#HklEngineAxisNamesGet"/>
+    <keyword type="struct" name="HklParameter" link="hkl-hkl.html#HklParameter"/>
+    <keyword type="struct" name="HklGeometry" link="hkl-hkl.html#HklGeometry"/>
+    <keyword type="struct" name="HklSampleReflection" link="hkl-hkl.html#HklSampleReflection"/>
+    <keyword type="struct" name="HklSample" link="hkl-hkl.html#HklSample"/>
+    <keyword type="struct" name="HklGeometryListItem" link="hkl-hkl.html#HklGeometryListItem"/>
+    <keyword type="struct" name="HklFactory" link="hkl-hkl.html#HklFactory"/>
+    <keyword type="struct" name="HklEngineList" link="hkl-hkl.html#HklEngineList"/>
+    <keyword type="struct" name="HklGeometryList" link="hkl-hkl.html#HklGeometryList"/>
+    <keyword type="struct" name="HklLattice" link="hkl-hkl.html#HklLattice"/>
+    <keyword type="struct" name="HklMatrix" link="hkl-hkl.html#HklMatrix"/>
+    <keyword type="struct" name="HklDetector" link="hkl-hkl.html#HklDetector"/>
+    <keyword type="struct" name="HklEngine" link="hkl-hkl.html#HklEngine"/>
+    <keyword type="function" name="hkl_parameter_new_axis ()" link="hkl-hkl-axis-private.html#hkl-parameter-new-axis"/>
     <keyword type="struct" name="struct HklAxis" link="hkl-hkl-axis-private.html#HklAxis"/>
-    <keyword type="function" name="hkl_parameter_new_axis ()" link="hkl-hkl-axis-private.html#hkl-parameter-new-axis"/>
+    <keyword type="function" name="hkl_detector_new ()" link="hkl-hkl-detector-private.html#hkl-detector-new"/>
+    <keyword type="function" name="hkl_detector_attach_to_holder ()" link="hkl-hkl-detector-private.html#hkl-detector-attach-to-holder"/>
+    <keyword type="function" name="hkl_detector_compute_kf ()" link="hkl-hkl-detector-private.html#hkl-detector-compute-kf"/>
     <keyword type="struct" name="HklDetector" link="hkl-hkl-detector-private.html#HklDetector"/>
-    <keyword type="function" name="hkl_detector_attach_to_holder ()" link="hkl-hkl-detector-private.html#hkl-detector-attach-to-holder"/>
-    <keyword type="function" name="hkl_detector_compute_kf ()" link="hkl-hkl-detector-private.html#hkl-detector-compute-kf"/>
-    <keyword type="function" name="hkl_detector_new ()" link="hkl-hkl-detector-private.html#hkl-detector-new"/>
-    <keyword type="function" name="hkl_detector_new_copy ()" link="hkl-hkl-detector-private.html#hkl-detector-new-copy"/>
-    <keyword type="struct" name="HklError" link="hkl-hkl-error-private.html#HklError"/>
-    <keyword type="function" name="hkl_error_clear ()" link="hkl-hkl-error-private.html#hkl-error-clear"/>
-    <keyword type="function" name="hkl_error_free ()" link="hkl-hkl-error-private.html#hkl-error-free"/>
-    <keyword type="function" name="hkl_error_new ()" link="hkl-hkl-error-private.html#hkl-error-new"/>
-    <keyword type="function" name="hkl_error_new_copy ()" link="hkl-hkl-error-private.html#hkl-error-new-copy"/>
-    <keyword type="function" name="hkl_error_new_literal ()" link="hkl-hkl-error-private.html#hkl-error-new-literal"/>
-    <keyword type="function" name="hkl_error_new_valist ()" link="hkl-hkl-error-private.html#hkl-error-new-valist" since="2.22"/>
-    <keyword type="function" name="hkl_error_prefix ()" link="hkl-hkl-error-private.html#hkl-error-prefix" since="2.16"/>
-    <keyword type="function" name="hkl_error_propagate ()" link="hkl-hkl-error-private.html#hkl-error-propagate"/>
-    <keyword type="function" name="hkl_error_propagate_prefixed ()" link="hkl-hkl-error-private.html#hkl-error-propagate-prefixed" since="2.16"/>
-    <keyword type="function" name="hkl_error_set ()" link="hkl-hkl-error-private.html#hkl-error-set"/>
-    <keyword type="function" name="hkl_error_set_literal ()" link="hkl-hkl-error-private.html#hkl-error-set-literal" since="2.18"/>
+    <keyword type="function" name="HklFactoryGeometryFunction ()" link="hkl-hkl-factory-private.html#HklFactoryGeometryFunction"/>
+    <keyword type="function" name="HklFactoryEngineListFunction ()" link="hkl-hkl-factory-private.html#HklFactoryEngineListFunction"/>
+    <keyword type="macro" name="REGISTER_DIFFRACTOMETER()" link="hkl-hkl-factory-private.html#REGISTER-DIFFRACTOMETER:CAPS"/>
+    <keyword type="struct" name="HklFactory" link="hkl-hkl-factory-private.html#HklFactory"/>
+    <keyword type="function" name="HklGeometryListMultiplyFunction ()" link="hkl-hkl-geometry-private.html#HklGeometryListMultiplyFunction"/>
+    <keyword type="function" name="g_quark_from_static_string ()" link="hkl-hkl-geometry-private.html#g-quark-from-static-string"/>
+    <keyword type="function" name="hkl_holder_add_rotation_axis ()" link="hkl-hkl-geometry-private.html#hkl-holder-add-rotation-axis"/>
+    <keyword type="function" name="hkl_geometry_new ()" link="hkl-hkl-geometry-private.html#hkl-geometry-new"/>
+    <keyword type="function" name="hkl_geometry_init_geometry ()" link="hkl-hkl-geometry-private.html#hkl-geometry-init-geometry"/>
+    <keyword type="function" name="hkl_geometry_add_holder ()" link="hkl-hkl-geometry-private.html#hkl-geometry-add-holder"/>
+    <keyword type="function" name="hkl_geometry_update ()" link="hkl-hkl-geometry-private.html#hkl-geometry-update"/>
+    <keyword type="function" name="hkl_geometry_get_axis_idx_by_name ()" link="hkl-hkl-geometry-private.html#hkl-geometry-get-axis-idx-by-name"/>
+    <keyword type="function" name="hkl_geometry_get_axis_by_name ()" link="hkl-hkl-geometry-private.html#hkl-geometry-get-axis-by-name"/>
+    <keyword type="function" name="hkl_geometry_distance ()" link="hkl-hkl-geometry-private.html#hkl-geometry-distance"/>
+    <keyword type="function" name="hkl_geometry_distance_orthodromic ()" link="hkl-hkl-geometry-private.html#hkl-geometry-distance-orthodromic"/>
+    <keyword type="function" name="hkl_geometry_closest_from_geometry_with_range ()" link="hkl-hkl-geometry-private.html#hkl-geometry-closest-from-geometry-with-range"/>
+    <keyword type="function" name="hkl_geometry_is_valid ()" link="hkl-hkl-geometry-private.html#hkl-geometry-is-valid"/>
+    <keyword type="function" name="hkl_geometry_list_new ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-new"/>
+    <keyword type="function" name="hkl_geometry_list_new_copy ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-new-copy"/>
+    <keyword type="function" name="hkl_geometry_list_add ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-add"/>
+    <keyword type="function" name="hkl_geometry_list_reset ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-reset"/>
+    <keyword type="function" name="hkl_geometry_list_sort ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-sort"/>
+    <keyword type="function" name="hkl_geometry_list_fprintf ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-fprintf"/>
+    <keyword type="function" name="hkl_geometry_list_multiply ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-multiply"/>
+    <keyword type="function" name="hkl_geometry_list_multiply_from_range ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-multiply-from-range"/>
+    <keyword type="function" name="hkl_geometry_list_remove_invalid ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-remove-invalid"/>
+    <keyword type="function" name="hkl_geometry_list_item_new ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-item-new"/>
+    <keyword type="function" name="hkl_geometry_list_item_new_copy ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-item-new-copy"/>
+    <keyword type="function" name="hkl_geometry_list_item_free ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-item-free"/>
+    <keyword type="typedef" name="darray_holder" link="hkl-hkl-geometry-private.html#darray-holder"/>
+    <keyword type="struct" name="struct HklHolderConfig" link="hkl-hkl-geometry-private.html#HklHolderConfig"/>
+    <keyword type="struct" name="struct HklHolder" link="hkl-hkl-geometry-private.html#HklHolder"/>
     <keyword type="struct" name="HklGeometry" link="hkl-hkl-geometry-private.html#HklGeometry"/>
+    <keyword type="macro" name="HKL_GEOMETRY_ERROR" link="hkl-hkl-geometry-private.html#HKL-GEOMETRY-ERROR:CAPS"/>
+    <keyword type="enum" name="enum HklGeometryError" link="hkl-hkl-geometry-private.html#HklGeometryError"/>
     <keyword type="struct" name="HklGeometryList" link="hkl-hkl-geometry-private.html#HklGeometryList"/>
     <keyword type="struct" name="HklGeometryListItem" link="hkl-hkl-geometry-private.html#HklGeometryListItem"/>
-    <keyword type="function" name="HklGeometryListMultiplyFunction ()" link="hkl-hkl-geometry-private.html#HklGeometryListMultiplyFunction"/>
-    <keyword type="struct" name="struct HklHolder" link="hkl-hkl-geometry-private.html#HklHolder"/>
-    <keyword type="typedef" name="darray_holder" link="hkl-hkl-geometry-private.html#darray-holder"/>
-    <keyword type="function" name="hkl_geometry_add_holder ()" link="hkl-hkl-geometry-private.html#hkl-geometry-add-holder"/>
-    <keyword type="function" name="hkl_geometry_closest_from_geometry_with_range ()" link="hkl-hkl-geometry-private.html#hkl-geometry-closest-from-geometry-with-range"/>
-    <keyword type="function" name="hkl_geometry_distance ()" link="hkl-hkl-geometry-private.html#hkl-geometry-distance"/>
-    <keyword type="function" name="hkl_geometry_distance_orthodromic ()" link="hkl-hkl-geometry-private.html#hkl-geometry-distance-orthodromic"/>
-    <keyword type="function" name="hkl_geometry_get_axis_by_name ()" link="hkl-hkl-geometry-private.html#hkl-geometry-get-axis-by-name"/>
-    <keyword type="function" name="hkl_geometry_get_axis_idx_by_name ()" link="hkl-hkl-geometry-private.html#hkl-geometry-get-axis-idx-by-name"/>
-    <keyword type="function" name="hkl_geometry_init_geometry ()" link="hkl-hkl-geometry-private.html#hkl-geometry-init-geometry"/>
-    <keyword type="function" name="hkl_geometry_is_valid ()" link="hkl-hkl-geometry-private.html#hkl-geometry-is-valid"/>
-    <keyword type="function" name="hkl_geometry_list_add ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-add"/>
-    <keyword type="function" name="hkl_geometry_list_fprintf ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-fprintf"/>
-    <keyword type="function" name="hkl_geometry_list_free ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-free"/>
-    <keyword type="function" name="hkl_geometry_list_item_free ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-item-free"/>
-    <keyword type="function" name="hkl_geometry_list_item_new ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-item-new"/>
-    <keyword type="function" name="hkl_geometry_list_item_new_copy ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-item-new-copy"/>
-    <keyword type="function" name="hkl_geometry_list_multiply ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-multiply"/>
-    <keyword type="function" name="hkl_geometry_list_multiply_from_range ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-multiply-from-range"/>
-    <keyword type="function" name="hkl_geometry_list_new ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-new"/>
-    <keyword type="function" name="hkl_geometry_list_new_copy ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-new-copy"/>
-    <keyword type="function" name="hkl_geometry_list_remove_invalid ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-remove-invalid"/>
-    <keyword type="function" name="hkl_geometry_list_reset ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-reset"/>
-    <keyword type="function" name="hkl_geometry_list_sort ()" link="hkl-hkl-geometry-private.html#hkl-geometry-list-sort"/>
-    <keyword type="function" name="hkl_geometry_new ()" link="hkl-hkl-geometry-private.html#hkl-geometry-new"/>
-    <keyword type="function" name="hkl_geometry_new_copy ()" link="hkl-hkl-geometry-private.html#hkl-geometry-new-copy"/>
-    <keyword type="function" name="hkl_geometry_set_values_v ()" link="hkl-hkl-geometry-private.html#hkl-geometry-set-values-v"/>
-    <keyword type="function" name="hkl_geometry_update ()" link="hkl-hkl-geometry-private.html#hkl-geometry-update"/>
-    <keyword type="function" name="hkl_holder_add_rotation_axis ()" link="hkl-hkl-geometry-private.html#hkl-holder-add-rotation-axis"/>
+    <keyword type="function" name="hkl_interval_dup ()" link="hkl-hkl-interval-private.html#hkl-interval-dup"/>
+    <keyword type="function" name="hkl_interval_free ()" link="hkl-hkl-interval-private.html#hkl-interval-free"/>
+    <keyword type="function" name="hkl_interval_cmp ()" link="hkl-hkl-interval-private.html#hkl-interval-cmp"/>
+    <keyword type="function" name="hkl_interval_plus_interval ()" link="hkl-hkl-interval-private.html#hkl-interval-plus-interval"/>
+    <keyword type="function" name="hkl_interval_plus_double ()" link="hkl-hkl-interval-private.html#hkl-interval-plus-double"/>
+    <keyword type="function" name="hkl_interval_minus_interval ()" link="hkl-hkl-interval-private.html#hkl-interval-minus-interval"/>
+    <keyword type="function" name="hkl_interval_minus_double ()" link="hkl-hkl-interval-private.html#hkl-interval-minus-double"/>
+    <keyword type="function" name="hkl_interval_times_interval ()" link="hkl-hkl-interval-private.html#hkl-interval-times-interval"/>
+    <keyword type="function" name="hkl_interval_times_double ()" link="hkl-hkl-interval-private.html#hkl-interval-times-double"/>
+    <keyword type="function" name="hkl_interval_divides_double ()" link="hkl-hkl-interval-private.html#hkl-interval-divides-double"/>
+    <keyword type="function" name="hkl_interval_contain_zero ()" link="hkl-hkl-interval-private.html#hkl-interval-contain-zero"/>
+    <keyword type="function" name="hkl_interval_cos ()" link="hkl-hkl-interval-private.html#hkl-interval-cos"/>
+    <keyword type="function" name="hkl_interval_acos ()" link="hkl-hkl-interval-private.html#hkl-interval-acos"/>
+    <keyword type="function" name="hkl_interval_sin ()" link="hkl-hkl-interval-private.html#hkl-interval-sin"/>
+    <keyword type="function" name="hkl_interval_asin ()" link="hkl-hkl-interval-private.html#hkl-interval-asin"/>
+    <keyword type="function" name="hkl_interval_tan ()" link="hkl-hkl-interval-private.html#hkl-interval-tan"/>
+    <keyword type="function" name="hkl_interval_atan ()" link="hkl-hkl-interval-private.html#hkl-interval-atan"/>
+    <keyword type="function" name="hkl_interval_length ()" link="hkl-hkl-interval-private.html#hkl-interval-length"/>
+    <keyword type="function" name="hkl_interval_angle_restrict_symm ()" link="hkl-hkl-interval-private.html#hkl-interval-angle-restrict-symm"/>
     <keyword type="struct" name="struct HklInterval" link="hkl-hkl-interval-private.html#HklInterval"/>
-    <keyword type="function" name="hkl_interval_acos ()" link="hkl-hkl-interval-private.html#hkl-interval-acos"/>
-    <keyword type="function" name="hkl_interval_angle_restrict_symm ()" link="hkl-hkl-interval-private.html#hkl-interval-angle-restrict-symm"/>
-    <keyword type="function" name="hkl_interval_asin ()" link="hkl-hkl-interval-private.html#hkl-interval-asin"/>
-    <keyword type="function" name="hkl_interval_atan ()" link="hkl-hkl-interval-private.html#hkl-interval-atan"/>
-    <keyword type="function" name="hkl_interval_cmp ()" link="hkl-hkl-interval-private.html#hkl-interval-cmp"/>
-    <keyword type="function" name="hkl_interval_contain_zero ()" link="hkl-hkl-interval-private.html#hkl-interval-contain-zero"/>
-    <keyword type="function" name="hkl_interval_cos ()" link="hkl-hkl-interval-private.html#hkl-interval-cos"/>
-    <keyword type="function" name="hkl_interval_divides_double ()" link="hkl-hkl-interval-private.html#hkl-interval-divides-double"/>
-    <keyword type="function" name="hkl_interval_dup ()" link="hkl-hkl-interval-private.html#hkl-interval-dup"/>
-    <keyword type="function" name="hkl_interval_free ()" link="hkl-hkl-interval-private.html#hkl-interval-free"/>
-    <keyword type="function" name="hkl_interval_length ()" link="hkl-hkl-interval-private.html#hkl-interval-length"/>
-    <keyword type="function" name="hkl_interval_minus_double ()" link="hkl-hkl-interval-private.html#hkl-interval-minus-double"/>
-    <keyword type="function" name="hkl_interval_minus_interval ()" link="hkl-hkl-interval-private.html#hkl-interval-minus-interval"/>
-    <keyword type="function" name="hkl_interval_plus_double ()" link="hkl-hkl-interval-private.html#hkl-interval-plus-double"/>
-    <keyword type="function" name="hkl_interval_plus_interval ()" link="hkl-hkl-interval-private.html#hkl-interval-plus-interval"/>
-    <keyword type="function" name="hkl_interval_sin ()" link="hkl-hkl-interval-private.html#hkl-interval-sin"/>
-    <keyword type="function" name="hkl_interval_tan ()" link="hkl-hkl-interval-private.html#hkl-interval-tan"/>
-    <keyword type="function" name="hkl_interval_times_double ()" link="hkl-hkl-interval-private.html#hkl-interval-times-double"/>
-    <keyword type="function" name="hkl_interval_times_interval ()" link="hkl-hkl-interval-private.html#hkl-interval-times-interval"/>
+    <keyword type="function" name="g_quark_from_static_string ()" link="hkl-hkl-lattice-private.html#g-quark-from-static-string"/>
+    <keyword type="function" name="hkl_lattice_lattice_set ()" link="hkl-hkl-lattice-private.html#hkl-lattice-lattice-set"/>
+    <keyword type="function" name="hkl_lattice_randomize ()" link="hkl-hkl-lattice-private.html#hkl-lattice-randomize"/>
+    <keyword type="function" name="hkl_lattice_fprintf ()" link="hkl-hkl-lattice-private.html#hkl-lattice-fprintf"/>
     <keyword type="struct" name="HklLattice" link="hkl-hkl-lattice-private.html#HklLattice"/>
-    <keyword type="function" name="hkl_lattice_fprintf ()" link="hkl-hkl-lattice-private.html#hkl-lattice-fprintf"/>
-    <keyword type="function" name="hkl_lattice_lattice_set ()" link="hkl-hkl-lattice-private.html#hkl-lattice-lattice-set"/>
-    <keyword type="function" name="hkl_lattice_randomize ()" link="hkl-hkl-lattice-private.html#hkl-lattice-randomize"/>
-    <keyword type="macro" name="ALLOC_GROW()" link="hkl-hkl-macros-private.html#ALLOC-GROW:CAPS"/>
+    <keyword type="macro" name="HKL_LATTICE_ERROR" link="hkl-hkl-lattice-private.html#HKL-LATTICE-ERROR:CAPS"/>
+    <keyword type="enum" name="enum HklLatticeError" link="hkl-hkl-lattice-private.html#HklLatticeError"/>
+    <keyword type="macro" name="hkl_assert()" link="hkl-hkl-macros-private.html#hkl-assert"/>
+    <keyword type="macro" name="hkl_error()" link="hkl-hkl-macros-private.html#hkl-error"/>
     <keyword type="macro" name="G_GNUC_PRINTF()" link="hkl-hkl-macros-private.html#G-GNUC-PRINTF:CAPS"/>
-    <keyword type="macro" name="HKL_EULERIAN_KAPPA_SOLUTION" link="hkl-hkl-macros-private.html#HKL-EULERIAN-KAPPA-SOLUTION:CAPS"/>
+    <keyword type="macro" name="alloc_nr()" link="hkl-hkl-macros-private.html#alloc-nr"/>
+    <keyword type="macro" name="ALLOC_GROW()" link="hkl-hkl-macros-private.html#ALLOC-GROW:CAPS"/>
+    <keyword type="macro" name="DARRAY()" link="hkl-hkl-macros-private.html#DARRAY:CAPS"/>
+    <keyword type="function" name="hkl_printbt ()" link="hkl-hkl-macros-private.html#hkl-printbt"/>
     <keyword type="macro" name="HKL_MALLOC()" link="hkl-hkl-macros-private.html#HKL-MALLOC:CAPS"/>
+    <keyword type="macro" name="HKL_EULERIAN_KAPPA_SOLUTION" link="hkl-hkl-macros-private.html#HKL-EULERIAN-KAPPA-SOLUTION:CAPS"/>
     <keyword type="macro" name="NORETURN" link="hkl-hkl-macros-private.html#NORETURN:CAPS"/>
-    <keyword type="macro" name="alloc_nr()" link="hkl-hkl-macros-private.html#alloc-nr"/>
-    <keyword type="macro" name="hkl_assert()" link="hkl-hkl-macros-private.html#hkl-assert"/>
-    <keyword type="function" name="hkl_printbt ()" link="hkl-hkl-macros-private.html#hkl-printbt"/>
-    <keyword type="macro" name="hkl_return_val_if_fail()" link="hkl-hkl-macros-private.html#hkl-return-val-if-fail"/>
+    <keyword type="function" name="hkl_matrix_dup ()" link="hkl-hkl-matrix-private.html#hkl-matrix-dup"/>
+    <keyword type="function" name="hkl_matrix_init_from_euler ()" link="hkl-hkl-matrix-private.html#hkl-matrix-init-from-euler"/>
+    <keyword type="function" name="hkl_matrix_matrix_set ()" link="hkl-hkl-matrix-private.html#hkl-matrix-matrix-set"/>
+    <keyword type="function" name="hkl_matrix_init_from_two_vector ()" link="hkl-hkl-matrix-private.html#hkl-matrix-init-from-two-vector"/>
+    <keyword type="function" name="hkl_matrix_fprintf ()" link="hkl-hkl-matrix-private.html#hkl-matrix-fprintf"/>
+    <keyword type="function" name="hkl_matrix_to_euler ()" link="hkl-hkl-matrix-private.html#hkl-matrix-to-euler"/>
+    <keyword type="function" name="hkl_matrix_times_vector ()" link="hkl-hkl-matrix-private.html#hkl-matrix-times-vector"/>
+    <keyword type="function" name="hkl_matrix_transpose ()" link="hkl-hkl-matrix-private.html#hkl-matrix-transpose"/>
+    <keyword type="function" name="hkl_matrix_det ()" link="hkl-hkl-matrix-private.html#hkl-matrix-det"/>
+    <keyword type="function" name="hkl_matrix_solve ()" link="hkl-hkl-matrix-private.html#hkl-matrix-solve"/>
+    <keyword type="function" name="hkl_matrix_is_null ()" link="hkl-hkl-matrix-private.html#hkl-matrix-is-null"/>
     <keyword type="struct" name="HklMatrix" link="hkl-hkl-matrix-private.html#HklMatrix"/>
-    <keyword type="function" name="hkl_matrix_det ()" link="hkl-hkl-matrix-private.html#hkl-matrix-det"/>
-    <keyword type="function" name="hkl_matrix_dup ()" link="hkl-hkl-matrix-private.html#hkl-matrix-dup"/>
-    <keyword type="function" name="hkl_matrix_fprintf ()" link="hkl-hkl-matrix-private.html#hkl-matrix-fprintf"/>
-    <keyword type="function" name="hkl_matrix_init_from_euler ()" link="hkl-hkl-matrix-private.html#hkl-matrix-init-from-euler"/>
-    <keyword type="function" name="hkl_matrix_init_from_two_vector ()" link="hkl-hkl-matrix-private.html#hkl-matrix-init-from-two-vector"/>
-    <keyword type="function" name="hkl_matrix_is_null ()" link="hkl-hkl-matrix-private.html#hkl-matrix-is-null"/>
-    <keyword type="function" name="hkl_matrix_matrix_set ()" link="hkl-hkl-matrix-private.html#hkl-matrix-matrix-set"/>
-    <keyword type="function" name="hkl_matrix_solve ()" link="hkl-hkl-matrix-private.html#hkl-matrix-solve"/>
-    <keyword type="function" name="hkl_matrix_times_vector ()" link="hkl-hkl-matrix-private.html#hkl-matrix-times-vector"/>
-    <keyword type="function" name="hkl_matrix_to_euler ()" link="hkl-hkl-matrix-private.html#hkl-matrix-to-euler"/>
-    <keyword type="function" name="hkl_matrix_transpose ()" link="hkl-hkl-matrix-private.html#hkl-matrix-transpose"/>
+    <keyword type="function" name="g_quark_from_static_string ()" link="hkl-hkl-parameter-private.html#g-quark-from-static-string"/>
+    <keyword type="function" name="fprintf ()" link="hkl-hkl-parameter-private.html#fprintf"/>
+    <keyword type="function" name="hkl_parameter_new ()" link="hkl-hkl-parameter-private.html#hkl-parameter-new"/>
+    <keyword type="function" name="hkl_parameter_init_copy ()" link="hkl-hkl-parameter-private.html#hkl-parameter-init-copy"/>
+    <keyword type="function" name="hkl_parameter_value_get_closest ()" link="hkl-hkl-parameter-private.html#hkl-parameter-value-get-closest"/>
+    <keyword type="function" name="hkl_parameter_value_set_smallest_in_range ()" link="hkl-hkl-parameter-private.html#hkl-parameter-value-set-smallest-in-range"/>
+    <keyword type="function" name="hkl_parameter_is_valid ()" link="hkl-hkl-parameter-private.html#hkl-parameter-is-valid"/>
+    <keyword type="function" name="hkl_parameter_fprintf ()" link="hkl-hkl-parameter-private.html#hkl-parameter-fprintf"/>
+    <keyword type="struct" name="HklParameter" link="hkl-hkl-parameter-private.html#HklParameter"/>
     <keyword type="macro" name="HKL_PARAMETER_DEFAULTS" link="hkl-hkl-parameter-private.html#HKL-PARAMETER-DEFAULTS:CAPS"/>
     <keyword type="macro" name="HKL_PARAMETER_DEFAULTS_ANGLE" link="hkl-hkl-parameter-private.html#HKL-PARAMETER-DEFAULTS-ANGLE:CAPS"/>
-    <keyword type="macro" name="HKL_PARAMETER_OPERATIONS_DEFAULTS" link="hkl-hkl-parameter-private.html#HKL-PARAMETER-OPERATIONS-DEFAULTS:CAPS"/>
-    <keyword type="struct" name="HklParameter" link="hkl-hkl-parameter-private.html#HklParameter"/>
+    <keyword type="macro" name="HKL_PARAMETER_ERROR" link="hkl-hkl-parameter-private.html#HKL-PARAMETER-ERROR:CAPS"/>
+    <keyword type="enum" name="enum HklParameterError" link="hkl-hkl-parameter-private.html#HklParameterError"/>
     <keyword type="struct" name="struct HklParameterOperations" link="hkl-hkl-parameter-private.html#HklParameterOperations"/>
-    <keyword type="variable" name="alea" link="hkl-hkl-parameter-private.html#alea"/>
+    <keyword type="macro" name="HKL_PARAMETER_OPERATIONS_DEFAULTS" link="hkl-hkl-parameter-private.html#HKL-PARAMETER-OPERATIONS-DEFAULTS:CAPS"/>
     <keyword type="variable" name="dup" link="hkl-hkl-parameter-private.html#dup"/>
+    <keyword type="variable" name="alea" link="hkl-hkl-parameter-private.html#alea"/>
     <keyword type="variable" name="factor" link="hkl-hkl-parameter-private.html#factor"/>
-    <keyword type="function" name="fprintf ()" link="hkl-hkl-parameter-private.html#fprintf"/>
-    <keyword type="function" name="hkl_parameter_fprintf ()" link="hkl-hkl-parameter-private.html#hkl-parameter-fprintf"/>
-    <keyword type="function" name="hkl_parameter_init_copy ()" link="hkl-hkl-parameter-private.html#hkl-parameter-init-copy"/>
-    <keyword type="function" name="hkl_parameter_is_valid ()" link="hkl-hkl-parameter-private.html#hkl-parameter-is-valid"/>
-    <keyword type="function" name="hkl_parameter_list_fprintf ()" link="hkl-hkl-parameter-private.html#hkl-parameter-list-fprintf"/>
-    <keyword type="function" name="hkl_parameter_list_free ()" link="hkl-hkl-parameter-private.html#hkl-parameter-list-free"/>
-    <keyword type="function" name="hkl_parameter_list_values_get ()" link="hkl-hkl-parameter-private.html#hkl-parameter-list-values-get"/>
-    <keyword type="function" name="hkl_parameter_list_values_unit_set ()" link="hkl-hkl-parameter-private.html#hkl-parameter-list-values-unit-set"/>
-    <keyword type="function" name="hkl_parameter_new ()" link="hkl-hkl-parameter-private.html#hkl-parameter-new"/>
-    <keyword type="function" name="hkl_parameter_value_get_closest ()" link="hkl-hkl-parameter-private.html#hkl-parameter-value-get-closest"/>
-    <keyword type="function" name="hkl_parameter_value_set_real ()" link="hkl-hkl-parameter-private.html#hkl-parameter-value-set-real"/>
-    <keyword type="function" name="hkl_parameter_value_set_smallest_in_range ()" link="hkl-hkl-parameter-private.html#hkl-parameter-value-set-smallest-in-range"/>
+    <keyword type="typedef" name="darray_parameter" link="hkl-hkl-parameter-private.html#darray-parameter"/>
     <keyword type="macro" name="CHECK_NAN()" link="hkl-hkl-pseudoaxis-auto-private.html#CHECK-NAN:CAPS"/>
-    <keyword type="macro" name="HKL_MODE_OPERATIONS_AUTO_DEFAULTS" link="hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-OPERATIONS-AUTO-DEFAULTS:CAPS"/>
-    <keyword type="macro" name="HKL_MODE_OPERATIONS_AUTO_WITH_INIT_DEFAULTS" link="hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-OPERATIONS-AUTO-WITH-INIT-DEFAULTS:CAPS"/>
+    <keyword type="macro" name="HKL_MODE_AUTO_INFO()" link="hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-AUTO-INFO:CAPS"/>
+    <keyword type="macro" name="HKL_MODE_AUTO_INFO_WITH_PARAMS()" link="hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-AUTO-INFO-WITH-PARAMS:CAPS"/>
+    <keyword type="function" name="hkl_mode_auto_new ()" link="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-new"/>
+    <keyword type="function" name="hkl_mode_auto_init ()" link="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-init"/>
+    <keyword type="function" name="hkl_mode_auto_set_real ()" link="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-set-real"/>
+    <keyword type="function" name="g_quark_from_static_string ()" link="hkl-hkl-pseudoaxis-auto-private.html#g-quark-from-static-string"/>
+    <keyword type="function" name="hkl_mode_auto_with_init_new ()" link="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-with-init-new"/>
     <keyword type="struct" name="struct HklFunction" link="hkl-hkl-pseudoaxis-auto-private.html#HklFunction"/>
+    <keyword type="typedef" name="darray_function" link="hkl-hkl-pseudoaxis-auto-private.html#darray-function"/>
     <keyword type="struct" name="struct HklModeAutoInfo" link="hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoInfo"/>
+    <keyword type="macro" name="HKL_MODE_OPERATIONS_AUTO_DEFAULTS" link="hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-OPERATIONS-AUTO-DEFAULTS:CAPS"/>
     <keyword type="struct" name="struct HklModeAutoWithInit" link="hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoWithInit"/>
-    <keyword type="macro" name="INFO_AUTO()" link="hkl-hkl-pseudoaxis-auto-private.html#INFO-AUTO:CAPS"/>
-    <keyword type="macro" name="INFO_AUTO_WITH_PARAMS()" link="hkl-hkl-pseudoaxis-auto-private.html#INFO-AUTO-WITH-PARAMS:CAPS"/>
-    <keyword type="function" name="hkl_mode_auto_init ()" link="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-init"/>
-    <keyword type="function" name="hkl_mode_auto_new ()" link="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-new"/>
-    <keyword type="function" name="hkl_mode_auto_set_real ()" link="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-set-real"/>
-    <keyword type="function" name="hkl_mode_auto_with_init_new ()" link="hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-with-init-new"/>
+    <keyword type="macro" name="HKL_MODE_AUTO_WITH_INIT_ERROR" link="hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-AUTO-WITH-INIT-ERROR:CAPS"/>
+    <keyword type="enum" name="enum HklModeError" link="hkl-hkl-pseudoaxis-auto-private.html#HklModeError"/>
+    <keyword type="macro" name="HKL_MODE_OPERATIONS_AUTO_WITH_INIT_DEFAULTS" link="hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-OPERATIONS-AUTO-WITH-INIT-DEFAULTS:CAPS"/>
     <keyword type="variable" name="self" link="hkl-hkl-pseudoaxis-auto-private.html#self"/>
+    <keyword type="function" name="hkl_engine_eulerians_new ()" link="hkl-hkl-pseudoaxis-common-eulerians-private.html#hkl-engine-eulerians-new"/>
+    <keyword type="function" name="kappa_2_kappap ()" link="hkl-hkl-pseudoaxis-common-eulerians-private.html#kappa-2-kappap"/>
     <keyword type="struct" name="struct HklEngineEulerians" link="hkl-hkl-pseudoaxis-common-eulerians-private.html#HklEngineEulerians"/>
-    <keyword type="function" name="hkl_engine_eulerians_new ()" link="hkl-hkl-pseudoaxis-common-eulerians-private.html#hkl-engine-eulerians-new"/>
-    <keyword type="macro" name="HKL_MODE_OPERATIONS_HKL_DEFAULTS" link="hkl-hkl-pseudoaxis-common-hkl-private.html#HKL-MODE-OPERATIONS-HKL-DEFAULTS:CAPS"/>
+    <keyword type="function" name="RUBh_minus_Q ()" link="hkl-hkl-pseudoaxis-common-hkl-private.html#RUBh-minus-Q"/>
+    <keyword type="function" name="hkl_mode_get_hkl_real ()" link="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-get-hkl-real"/>
+    <keyword type="function" name="hkl_mode_set_hkl_real ()" link="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-set-hkl-real"/>
+    <keyword type="function" name="hkl_mode_initialized_set_psi_constant_vertical_real ()" link="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-initialized-set-psi-constant-vertical-real"/>
+    <keyword type="function" name="hkl_engine_hkl_new ()" link="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-engine-hkl-new"/>
+    <keyword type="macro" name="CONSTANT_PARAMETER()" link="hkl-hkl-pseudoaxis-common-hkl-private.html#CONSTANT-PARAMETER:CAPS"/>
+    <keyword type="macro" name="PSI_CONSTANT_PARAMETERS()" link="hkl-hkl-pseudoaxis-common-hkl-private.html#PSI-CONSTANT-PARAMETERS:CAPS"/>
     <keyword type="struct" name="struct HklEngineHkl" link="hkl-hkl-pseudoaxis-common-hkl-private.html#HklEngineHkl"/>
-    <keyword type="function" name="RUBh_minus_Q ()" link="hkl-hkl-pseudoaxis-common-hkl-private.html#RUBh-minus-Q"/>
-    <keyword type="function" name="hkl_engine_hkl_new ()" link="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-engine-hkl-new"/>
-    <keyword type="function" name="hkl_mode_get_hkl_real ()" link="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-get-hkl-real"/>
-    <keyword type="function" name="hkl_mode_init_psi_constant_vertical_real ()" link="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-init-psi-constant-vertical-real"/>
-    <keyword type="function" name="hkl_mode_set_hkl_real ()" link="hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-set-hkl-real"/>
-    <keyword type="struct" name="struct HklEnginePsi" link="hkl-hkl-pseudoaxis-common-psi-private.html#HklEnginePsi"/>
+    <keyword type="macro" name="HKL_MODE_OPERATIONS_HKL_DEFAULTS" link="hkl-hkl-pseudoaxis-common-hkl-private.html#HKL-MODE-OPERATIONS-HKL-DEFAULTS:CAPS"/>
+    <keyword type="function" name="hkl_mode_psi_new ()" link="hkl-hkl-pseudoaxis-common-psi-private.html#hkl-mode-psi-new"/>
+    <keyword type="function" name="hkl_engine_psi_new ()" link="hkl-hkl-pseudoaxis-common-psi-private.html#hkl-engine-psi-new"/>
     <keyword type="struct" name="struct HklModePsi" link="hkl-hkl-pseudoaxis-common-psi-private.html#HklModePsi"/>
-    <keyword type="function" name="hkl_engine_psi_new ()" link="hkl-hkl-pseudoaxis-common-psi-private.html#hkl-engine-psi-new"/>
-    <keyword type="function" name="hkl_mode_psi_new ()" link="hkl-hkl-pseudoaxis-common-psi-private.html#hkl-mode-psi-new"/>
+    <keyword type="struct" name="struct HklEnginePsi" link="hkl-hkl-pseudoaxis-common-psi-private.html#HklEnginePsi"/>
+    <keyword type="function" name="qmax ()" link="hkl-hkl-pseudoaxis-common-q-private.html#qmax"/>
+    <keyword type="function" name="hkl_engine_q_new ()" link="hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-q-new"/>
+    <keyword type="function" name="hkl_engine_q2_new ()" link="hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-q2-new"/>
+    <keyword type="function" name="hkl_engine_qper_qpar_new ()" link="hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-qper-qpar-new"/>
     <keyword type="struct" name="HklEngineQ" link="hkl-hkl-pseudoaxis-common-q-private.html#HklEngineQ"/>
     <keyword type="struct" name="HklEngineQ2" link="hkl-hkl-pseudoaxis-common-q-private.html#HklEngineQ2"/>
     <keyword type="struct" name="HklEngineQperQpar" link="hkl-hkl-pseudoaxis-common-q-private.html#HklEngineQperQpar"/>
-    <keyword type="function" name="hkl_engine_q2_new ()" link="hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-q2-new"/>
-    <keyword type="function" name="hkl_engine_q_new ()" link="hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-q-new"/>
-    <keyword type="function" name="hkl_engine_qper_qpar_new ()" link="hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-qper-qpar-new"/>
-    <keyword type="function" name="hkl_engine_e4c_hkl_new ()" link="hkl-hkl-pseudoaxis-e4c-private.html#hkl-engine-e4c-hkl-new"/>
-    <keyword type="function" name="hkl_engine_e4c_psi_new ()" link="hkl-hkl-pseudoaxis-e4c-private.html#hkl-engine-e4c-psi-new"/>
-    <keyword type="function" name="hkl_engine_e6c_hkl_new ()" link="hkl-hkl-pseudoaxis-e6c-private.html#hkl-engine-e6c-hkl-new"/>
-    <keyword type="function" name="hkl_engine_e6c_psi_new ()" link="hkl-hkl-pseudoaxis-e6c-private.html#hkl-engine-e6c-psi-new"/>
-    <keyword type="function" name="hkl_engine_k4cv_hkl_new ()" link="hkl-hkl-pseudoaxis-k4cv-private.html#hkl-engine-k4cv-hkl-new"/>
-    <keyword type="function" name="hkl_engine_k4cv_psi_new ()" link="hkl-hkl-pseudoaxis-k4cv-private.html#hkl-engine-k4cv-psi-new"/>
-    <keyword type="function" name="hkl_engine_k6c_hkl_new ()" link="hkl-hkl-pseudoaxis-k6c-private.html#hkl-engine-k6c-hkl-new"/>
-    <keyword type="function" name="hkl_engine_k6c_psi_new ()" link="hkl-hkl-pseudoaxis-k6c-private.html#hkl-engine-k6c-psi-new"/>
-    <keyword type="function" name="hkl_engine_petra3_p09_eh2_hkl_new ()" link="hkl-hkl-pseudoaxis-petra3-private.html#hkl-engine-petra3-p09-eh2-hkl-new"/>
-    <keyword type="macro" name="HKL_ENGINE_OPERATIONS_DEFAULTS" link="hkl-hkl-pseudoaxis-private.html#HKL-ENGINE-OPERATIONS-DEFAULTS:CAPS"/>
+    <keyword type="macro" name="HKL_MODE_INFO()" link="hkl-hkl-pseudoaxis-private.html#HKL-MODE-INFO:CAPS"/>
+    <keyword type="macro" name="HKL_MODE_INFO_WITH_PARAMS()" link="hkl-hkl-pseudoaxis-private.html#HKL-MODE-INFO-WITH-PARAMS:CAPS"/>
+    <keyword type="function" name="g_quark_from_static_string ()" link="hkl-hkl-pseudoaxis-private.html#g-quark-from-static-string"/>
+    <keyword type="typedef" name="darray_mode" link="hkl-hkl-pseudoaxis-private.html#darray-mode"/>
+    <keyword type="struct" name="struct HklPseudoAxis" link="hkl-hkl-pseudoaxis-private.html#HklPseudoAxis"/>
+    <keyword type="macro" name="HKL_PARAMETER_OPERATIONS_PSEUDOAXIS_DEFAULTS" link="hkl-hkl-pseudoaxis-private.html#HKL-PARAMETER-OPERATIONS-PSEUDOAXIS-DEFAULTS:CAPS"/>
+    <keyword type="variable" name="pseudo_axis" link="hkl-hkl-pseudoaxis-private.html#pseudo-axis"/>
+    <keyword type="variable" name="dup" link="hkl-hkl-pseudoaxis-private.html#dup"/>
+    <keyword type="struct" name="struct HklModeInfo" link="hkl-hkl-pseudoaxis-private.html#HklModeInfo"/>
+    <keyword type="struct" name="struct HklModeOperations" link="hkl-hkl-pseudoaxis-private.html#HklModeOperations"/>
     <keyword type="macro" name="HKL_MODE_OPERATIONS_DEFAULTS" link="hkl-hkl-pseudoaxis-private.html#HKL-MODE-OPERATIONS-DEFAULTS:CAPS"/>
-    <keyword type="struct" name="HklEngine" link="hkl-hkl-pseudoaxis-private.html#HklEngine"/>
+    <keyword type="struct" name="struct HklMode" link="hkl-hkl-pseudoaxis-private.html#HklMode"/>
+    <keyword type="variable" name="self" link="hkl-hkl-pseudoaxis-private.html#self"/>
     <keyword type="struct" name="struct HklEngineInfo" link="hkl-hkl-pseudoaxis-private.html#HklEngineInfo"/>
+    <keyword type="struct" name="HklEngine" link="hkl-hkl-pseudoaxis-private.html#HklEngine"/>
     <keyword type="struct" name="HklEngineList" link="hkl-hkl-pseudoaxis-private.html#HklEngineList"/>
-    <keyword type="struct" name="struct HklEngineOperations" link="hkl-hkl-pseudoaxis-private.html#HklEngineOperations"/>
-    <keyword type="struct" name="HklMode" link="hkl-hkl-pseudoaxis-private.html#HklMode"/>
-    <keyword type="struct" name="struct HklModeInfo" link="hkl-hkl-pseudoaxis-private.html#HklModeInfo"/>
-    <keyword type="struct" name="struct HklModeOperations" link="hkl-hkl-pseudoaxis-private.html#HklModeOperations"/>
-    <keyword type="struct" name="HklPseudoAxis" link="hkl-hkl-pseudoaxis-private.html#HklPseudoAxis"/>
-    <keyword type="macro" name="INFO()" link="hkl-hkl-pseudoaxis-private.html#INFO:CAPS"/>
-    <keyword type="macro" name="INFO_WITH_PARAMS()" link="hkl-hkl-pseudoaxis-private.html#INFO-WITH-PARAMS:CAPS"/>
-    <keyword type="function" name="hkl_engine_init ()" link="hkl-hkl-pseudoaxis-private.html#hkl-engine-init"/>
-    <keyword type="function" name="hkl_engine_list_add ()" link="hkl-hkl-pseudoaxis-private.html#hkl-engine-list-add"/>
-    <keyword type="function" name="hkl_engine_list_clear ()" link="hkl-hkl-pseudoaxis-private.html#hkl-engine-list-clear"/>
-    <keyword type="function" name="hkl_engine_list_new ()" link="hkl-hkl-pseudoaxis-private.html#hkl-engine-list-new"/>
-    <keyword type="function" name="hkl_engine_list_new_copy ()" link="hkl-hkl-pseudoaxis-private.html#hkl-engine-list-new-copy"/>
-    <keyword type="function" name="hkl_parameter_new_pseudo_axis ()" link="hkl-hkl-pseudoaxis-private.html#hkl-parameter-new-pseudo-axis"/>
+    <keyword type="macro" name="HKL_ENGINE_ERROR" link="hkl-hkl-pseudoaxis-private.html#HKL-ENGINE-ERROR:CAPS"/>
+    <keyword type="enum" name="enum HklEngineError" link="hkl-hkl-pseudoaxis-private.html#HklEngineError"/>
     <keyword type="variable" name="i" link="hkl-hkl-pseudoaxis-private.html#i"/>
-    <keyword type="function" name="register_pseudo_axis ()" link="hkl-hkl-pseudoaxis-private.html#register-pseudo-axis"/>
-    <keyword type="variable" name="self" link="hkl-hkl-pseudoaxis-private.html#self"/>
-    <keyword type="function" name="unregister_pseudo_axis ()" link="hkl-hkl-pseudoaxis-private.html#unregister-pseudo-axis"/>
-    <keyword type="function" name="hkl_engine_soleil_sixs_med_1_2_hkl_new ()" link="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html#hkl-engine-soleil-sixs-med-1-2-hkl-new"/>
-    <keyword type="function" name="hkl_engine_soleil_sixs_med_2_2_hkl_new ()" link="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html#hkl-engine-soleil-sixs-med-2-2-hkl-new"/>
-    <keyword type="function" name="hkl_engine_soleil_sixs_med_2_3_hkl_new ()" link="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html#hkl-engine-soleil-sixs-med-2-3-hkl-new"/>
-    <keyword type="function" name="hkl_geometry_list_multiply_soleil_sixs_med_2_3 ()" link="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html#hkl-geometry-list-multiply-soleil-sixs-med-2-3"/>
-    <keyword type="function" name="hkl_engine_zaxis_hkl_new ()" link="hkl-hkl-pseudoaxis-zaxis-private.html#hkl-engine-zaxis-hkl-new"/>
-    <keyword type="struct" name="HklQuaternion" link="hkl-hkl-quaternion-private.html#HklQuaternion"/>
-    <keyword type="function" name="hkl_quaternion_cmp ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-cmp"/>
-    <keyword type="function" name="hkl_quaternion_conjugate ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-conjugate"/>
-    <keyword type="function" name="hkl_quaternion_dup ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-dup"/>
-    <keyword type="function" name="hkl_quaternion_fprintf ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-fprintf"/>
-    <keyword type="function" name="hkl_quaternion_free ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-free"/>
-    <keyword type="function" name="hkl_quaternion_init ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-init"/>
-    <keyword type="function" name="hkl_quaternion_init_from_angle_and_axe ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-init-from-angle-and-axe"/>
-    <keyword type="function" name="hkl_quaternion_init_from_vector ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-init-from-vector"/>
-    <keyword type="function" name="hkl_quaternion_minus_quaternion ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-minus-quaternion"/>
-    <keyword type="function" name="hkl_quaternion_norm2 ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-norm2"/>
-    <keyword type="function" name="hkl_quaternion_times_quaternion ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-times-quaternion"/>
-    <keyword type="function" name="hkl_quaternion_to_angle_and_axe ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-to-angle-and-axe"/>
-    <keyword type="function" name="hkl_quaternion_to_matrix ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-to-matrix"/>
+    <keyword type="struct" name="struct HklEngineOperations" link="hkl-hkl-pseudoaxis-private.html#HklEngineOperations"/>
+    <keyword type="macro" name="HKL_ENGINE_OPERATIONS_DEFAULTS" link="hkl-hkl-pseudoaxis-private.html#HKL-ENGINE-OPERATIONS-DEFAULTS:CAPS"/>
+    <keyword type="variable" name="axis" link="hkl-hkl-pseudoaxis-private.html#axis"/>
+    <keyword type="macro" name="HKL_ENGINE_LIST_ERROR" link="hkl-hkl-pseudoaxis-private.html#HKL-ENGINE-LIST-ERROR:CAPS"/>
+    <keyword type="enum" name="enum HklEngineListError" link="hkl-hkl-pseudoaxis-private.html#HklEngineListError"/>
+    <keyword type="function" name="hkl_quaternion_dup ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-dup"/>
+    <keyword type="function" name="hkl_quaternion_free ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-free"/>
+    <keyword type="function" name="hkl_quaternion_init ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-init"/>
+    <keyword type="function" name="hkl_quaternion_init_from_vector ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-init-from-vector"/>
+    <keyword type="function" name="hkl_quaternion_init_from_angle_and_axe ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-init-from-angle-and-axe"/>
+    <keyword type="function" name="hkl_quaternion_fprintf ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-fprintf"/>
+    <keyword type="function" name="hkl_quaternion_cmp ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-cmp"/>
+    <keyword type="function" name="hkl_quaternion_minus_quaternion ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-minus-quaternion"/>
+    <keyword type="function" name="hkl_quaternion_times_quaternion ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-times-quaternion"/>
+    <keyword type="function" name="hkl_quaternion_norm2 ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-norm2"/>
+    <keyword type="function" name="hkl_quaternion_conjugate ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-conjugate"/>
+    <keyword type="function" name="hkl_quaternion_to_matrix ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-to-matrix"/>
+    <keyword type="function" name="hkl_quaternion_to_angle_and_axe ()" link="hkl-hkl-quaternion-private.html#hkl-quaternion-to-angle-and-axe"/>
+    <keyword type="function" name="g_quark_from_static_string ()" link="hkl-hkl-sample-private.html#g-quark-from-static-string"/>
+    <keyword type="function" name="hkl_sample_fprintf ()" link="hkl-hkl-sample-private.html#hkl-sample-fprintf"/>
+    <keyword type="function" name="hkl_sample_reflection_new_copy ()" link="hkl-hkl-sample-private.html#hkl-sample-reflection-new-copy"/>
+    <keyword type="function" name="hkl_sample_reflection_free ()" link="hkl-hkl-sample-private.html#hkl-sample-reflection-free"/>
     <keyword type="struct" name="HklSample" link="hkl-hkl-sample-private.html#HklSample"/>
+    <keyword type="macro" name="HKL_SAMPLE_ERROR" link="hkl-hkl-sample-private.html#HKL-SAMPLE-ERROR:CAPS"/>
+    <keyword type="enum" name="enum HklSampleError" link="hkl-hkl-sample-private.html#HklSampleError"/>
     <keyword type="struct" name="HklSampleReflection" link="hkl-hkl-sample-private.html#HklSampleReflection"/>
-    <keyword type="function" name="hkl_sample_fprintf ()" link="hkl-hkl-sample-private.html#hkl-sample-fprintf"/>
-    <keyword type="function" name="hkl_sample_reflection_free ()" link="hkl-hkl-sample-private.html#hkl-sample-reflection-free"/>
-    <keyword type="function" name="hkl_sample_reflection_new_copy ()" link="hkl-hkl-sample-private.html#hkl-sample-reflection-new-copy"/>
+    <keyword type="macro" name="HKL_SAMPLE_REFLECTION_ERROR" link="hkl-hkl-sample-private.html#HKL-SAMPLE-REFLECTION-ERROR:CAPS"/>
+    <keyword type="enum" name="enum HklSampleReflectionError" link="hkl-hkl-sample-private.html#HklSampleReflectionError"/>
     <keyword type="macro" name="HKL_SOURCE_DEFAULT_WAVE_LENGTH" link="hkl-hkl-source-private.html#HKL-SOURCE-DEFAULT-WAVE-LENGTH:CAPS"/>
+    <keyword type="function" name="hkl_source_dup ()" link="hkl-hkl-source-private.html#hkl-source-dup"/>
+    <keyword type="function" name="hkl_source_free ()" link="hkl-hkl-source-private.html#hkl-source-free"/>
+    <keyword type="function" name="hkl_source_init ()" link="hkl-hkl-source-private.html#hkl-source-init"/>
+    <keyword type="function" name="hkl_source_cmp ()" link="hkl-hkl-source-private.html#hkl-source-cmp"/>
+    <keyword type="function" name="hkl_source_compute_ki ()" link="hkl-hkl-source-private.html#hkl-source-compute-ki"/>
+    <keyword type="function" name="hkl_source_get_wavelength ()" link="hkl-hkl-source-private.html#hkl-source-get-wavelength"/>
+    <keyword type="function" name="hkl_source_fprintf ()" link="hkl-hkl-source-private.html#hkl-source-fprintf"/>
     <keyword type="struct" name="struct HklSource" link="hkl-hkl-source-private.html#HklSource"/>
-    <keyword type="function" name="hkl_source_cmp ()" link="hkl-hkl-source-private.html#hkl-source-cmp"/>
-    <keyword type="function" name="hkl_source_compute_ki ()" link="hkl-hkl-source-private.html#hkl-source-compute-ki"/>
-    <keyword type="function" name="hkl_source_dup ()" link="hkl-hkl-source-private.html#hkl-source-dup"/>
-    <keyword type="function" name="hkl_source_fprintf ()" link="hkl-hkl-source-private.html#hkl-source-fprintf"/>
-    <keyword type="function" name="hkl_source_free ()" link="hkl-hkl-source-private.html#hkl-source-free"/>
-    <keyword type="function" name="hkl_source_get_wavelength ()" link="hkl-hkl-source-private.html#hkl-source-get-wavelength"/>
-    <keyword type="function" name="hkl_source_init ()" link="hkl-hkl-source-private.html#hkl-source-init"/>
+    <keyword type="macro" name="HKL_TYPE_UNIT_ENUM" link="hkl-hkl-type-builtins.html#HKL-TYPE-UNIT-ENUM:CAPS"/>
     <keyword type="macro" name="HKL_TYPE_DETECTOR_TYPE" link="hkl-hkl-type-builtins.html#HKL-TYPE-DETECTOR-TYPE:CAPS"/>
-    <keyword type="macro" name="TYPE_HKL_AXIS" link="hkl-hkl-types.html#TYPE-HKL-AXIS:CAPS"/>
+    <keyword type="macro" name="HKL_TYPE_ENGINE_CAPABILITIES" link="hkl-hkl-type-builtins.html#HKL-TYPE-ENGINE-CAPABILITIES:CAPS"/>
+    <keyword type="macro" name="HKL_TYPE_ENGINE_AXIS_NAMES_GET" link="hkl-hkl-type-builtins.html#HKL-TYPE-ENGINE-AXIS-NAMES-GET:CAPS"/>
     <keyword type="macro" name="TYPE_HKL_DETECTOR" link="hkl-hkl-types.html#TYPE-HKL-DETECTOR:CAPS"/>
     <keyword type="macro" name="TYPE_HKL_ENGINE" link="hkl-hkl-types.html#TYPE-HKL-ENGINE:CAPS"/>
     <keyword type="macro" name="TYPE_HKL_ENGINE_LIST" link="hkl-hkl-types.html#TYPE-HKL-ENGINE-LIST:CAPS"/>
-    <keyword type="macro" name="TYPE_HKL_ERROR" link="hkl-hkl-types.html#TYPE-HKL-ERROR:CAPS"/>
+    <keyword type="macro" name="TYPE_HKL_FACTORY" link="hkl-hkl-types.html#TYPE-HKL-FACTORY:CAPS"/>
     <keyword type="macro" name="TYPE_HKL_GEOMETRY" link="hkl-hkl-types.html#TYPE-HKL-GEOMETRY:CAPS"/>
     <keyword type="macro" name="TYPE_HKL_GEOMETRY_LIST" link="hkl-hkl-types.html#TYPE-HKL-GEOMETRY-LIST:CAPS"/>
     <keyword type="macro" name="TYPE_HKL_GEOMETRY_LIST_ITEM" link="hkl-hkl-types.html#TYPE-HKL-GEOMETRY-LIST-ITEM:CAPS"/>
     <keyword type="macro" name="TYPE_HKL_LATTICE" link="hkl-hkl-types.html#TYPE-HKL-LATTICE:CAPS"/>
     <keyword type="macro" name="TYPE_HKL_MATRIX" link="hkl-hkl-types.html#TYPE-HKL-MATRIX:CAPS"/>
     <keyword type="macro" name="TYPE_HKL_PARAMETER" link="hkl-hkl-types.html#TYPE-HKL-PARAMETER:CAPS"/>
-    <keyword type="macro" name="TYPE_HKL_PARAMETER_LIST" link="hkl-hkl-types.html#TYPE-HKL-PARAMETER-LIST:CAPS"/>
-    <keyword type="macro" name="TYPE_HKL_PSEUDO_AXIS" link="hkl-hkl-types.html#TYPE-HKL-PSEUDO-AXIS:CAPS"/>
-    <keyword type="macro" name="TYPE_HKL_SAMPLE" link="hkl-hkl-types.html#TYPE-HKL-SAMPLE:CAPS"/>
     <keyword type="macro" name="TYPE_HKL_SAMPLE_REFLECTION" link="hkl-hkl-types.html#TYPE-HKL-SAMPLE-REFLECTION:CAPS"/>
+    <keyword type="macro" name="TYPE_HKL_SAMPLE" link="hkl-hkl-types.html#TYPE-HKL-SAMPLE:CAPS"/>
     <keyword type="macro" name="TYPE_HKL_UNIT" link="hkl-hkl-types.html#TYPE-HKL-UNIT:CAPS"/>
     <keyword type="macro" name="TYPE_HKL_VECTOR" link="hkl-hkl-types.html#TYPE-HKL-VECTOR:CAPS"/>
-    <keyword type="struct" name="struct HklUnit" link="hkl-hkl-unit-private.html#HklUnit"/>
+    <keyword type="function" name="hkl_unit_dup ()" link="hkl-hkl-unit-private.html#hkl-unit-dup"/>
+    <keyword type="function" name="hkl_unit_free ()" link="hkl-hkl-unit-private.html#hkl-unit-free"/>
+    <keyword type="function" name="hkl_unit_compatible ()" link="hkl-hkl-unit-private.html#hkl-unit-compatible"/>
+    <keyword type="function" name="hkl_unit_factor ()" link="hkl-hkl-unit-private.html#hkl-unit-factor"/>
     <keyword type="enum" name="enum HklUnitType" link="hkl-hkl-unit-private.html#HklUnitType"/>
-    <keyword type="function" name="hkl_unit_compatible ()" link="hkl-hkl-unit-private.html#hkl-unit-compatible"/>
-    <keyword type="function" name="hkl_unit_dup ()" link="hkl-hkl-unit-private.html#hkl-unit-dup"/>
-    <keyword type="function" name="hkl_unit_factor ()" link="hkl-hkl-unit-private.html#hkl-unit-factor"/>
-    <keyword type="function" name="hkl_unit_free ()" link="hkl-hkl-unit-private.html#hkl-unit-free"/>
-    <keyword type="struct" name="HklQuaternion" link="hkl-hkl-vector-private.html#HklQuaternion"/>
-    <keyword type="struct" name="struct HklVector" link="hkl-hkl-vector-private.html#HklVector"/>
-    <keyword type="function" name="hkl_vector_add_vector ()" link="hkl-hkl-vector-private.html#hkl-vector-add-vector"/>
-    <keyword type="function" name="hkl_vector_angle ()" link="hkl-hkl-vector-private.html#hkl-vector-angle"/>
-    <keyword type="function" name="hkl_vector_cmp ()" link="hkl-hkl-vector-private.html#hkl-vector-cmp"/>
-    <keyword type="function" name="hkl_vector_div_double ()" link="hkl-hkl-vector-private.html#hkl-vector-div-double"/>
-    <keyword type="function" name="hkl_vector_dup ()" link="hkl-hkl-vector-private.html#hkl-vector-dup"/>
-    <keyword type="function" name="hkl_vector_fprintf ()" link="hkl-hkl-vector-private.html#hkl-vector-fprintf"/>
-    <keyword type="function" name="hkl_vector_free ()" link="hkl-hkl-vector-private.html#hkl-vector-free"/>
-    <keyword type="function" name="hkl_vector_init ()" link="hkl-hkl-vector-private.html#hkl-vector-init"/>
-    <keyword type="function" name="hkl_vector_is_colinear ()" link="hkl-hkl-vector-private.html#hkl-vector-is-colinear"/>
-    <keyword type="function" name="hkl_vector_is_null ()" link="hkl-hkl-vector-private.html#hkl-vector-is-null"/>
-    <keyword type="function" name="hkl_vector_is_opposite ()" link="hkl-hkl-vector-private.html#hkl-vector-is-opposite"/>
-    <keyword type="function" name="hkl_vector_minus_vector ()" link="hkl-hkl-vector-private.html#hkl-vector-minus-vector"/>
-    <keyword type="function" name="hkl_vector_norm2 ()" link="hkl-hkl-vector-private.html#hkl-vector-norm2"/>
-    <keyword type="function" name="hkl_vector_normalize ()" link="hkl-hkl-vector-private.html#hkl-vector-normalize"/>
-    <keyword type="function" name="hkl_vector_oriented_angle ()" link="hkl-hkl-vector-private.html#hkl-vector-oriented-angle"/>
-    <keyword type="function" name="hkl_vector_oriented_angle_points ()" link="hkl-hkl-vector-private.html#hkl-vector-oriented-angle-points"/>
-    <keyword type="function" name="hkl_vector_project_on_plan ()" link="hkl-hkl-vector-private.html#hkl-vector-project-on-plan"/>
-    <keyword type="function" name="hkl_vector_project_on_plan_with_point ()" link="hkl-hkl-vector-private.html#hkl-vector-project-on-plan-with-point"/>
-    <keyword type="function" name="hkl_vector_randomize ()" link="hkl-hkl-vector-private.html#hkl-vector-randomize"/>
-    <keyword type="function" name="hkl_vector_randomize_vector ()" link="hkl-hkl-vector-private.html#hkl-vector-randomize-vector"/>
-    <keyword type="function" name="hkl_vector_randomize_vector_vector ()" link="hkl-hkl-vector-private.html#hkl-vector-randomize-vector-vector"/>
-    <keyword type="function" name="hkl_vector_rotated_around_line ()" link="hkl-hkl-vector-private.html#hkl-vector-rotated-around-line"/>
-    <keyword type="function" name="hkl_vector_rotated_around_vector ()" link="hkl-hkl-vector-private.html#hkl-vector-rotated-around-vector"/>
-    <keyword type="function" name="hkl_vector_rotated_quaternion ()" link="hkl-hkl-vector-private.html#hkl-vector-rotated-quaternion"/>
-    <keyword type="function" name="hkl_vector_scalar_product ()" link="hkl-hkl-vector-private.html#hkl-vector-scalar-product"/>
-    <keyword type="function" name="hkl_vector_sum ()" link="hkl-hkl-vector-private.html#hkl-vector-sum"/>
-    <keyword type="function" name="hkl_vector_times_double ()" link="hkl-hkl-vector-private.html#hkl-vector-times-double"/>
-    <keyword type="function" name="hkl_vector_times_matrix ()" link="hkl-hkl-vector-private.html#hkl-vector-times-matrix"/>
-    <keyword type="function" name="hkl_vector_times_vector ()" link="hkl-hkl-vector-private.html#hkl-vector-times-vector"/>
-    <keyword type="function" name="hkl_vector_vectorial_product ()" link="hkl-hkl-vector-private.html#hkl-vector-vectorial-product"/>
-    <keyword type="macro" name="LIST_HEAD()" link="hkl-list.html#LIST-HEAD:CAPS"/>
-    <keyword type="macro" name="LIST_HEAD_INIT()" link="hkl-list.html#LIST-HEAD-INIT:CAPS"/>
-    <keyword type="macro" name="list_add_off()" link="hkl-list.html#list-add-off"/>
-    <keyword type="function" name="list_check ()" link="hkl-list.html#list-check"/>
-    <keyword type="function" name="list_check_node ()" link="hkl-list.html#list-check-node"/>
+    <keyword type="struct" name="struct HklUnit" link="hkl-hkl-unit-private.html#HklUnit"/>
+    <keyword type="function" name="hkl_vector_dup ()" link="hkl-hkl-vector-private.html#hkl-vector-dup"/>
+    <keyword type="function" name="hkl_vector_free ()" link="hkl-hkl-vector-private.html#hkl-vector-free"/>
+    <keyword type="function" name="hkl_vector_init ()" link="hkl-hkl-vector-private.html#hkl-vector-init"/>
+    <keyword type="function" name="hkl_vector_fprintf ()" link="hkl-hkl-vector-private.html#hkl-vector-fprintf"/>
+    <keyword type="function" name="hkl_vector_cmp ()" link="hkl-hkl-vector-private.html#hkl-vector-cmp"/>
+    <keyword type="function" name="hkl_vector_is_opposite ()" link="hkl-hkl-vector-private.html#hkl-vector-is-opposite"/>
+    <keyword type="function" name="hkl_vector_add_vector ()" link="hkl-hkl-vector-private.html#hkl-vector-add-vector"/>
+    <keyword type="function" name="hkl_vector_minus_vector ()" link="hkl-hkl-vector-private.html#hkl-vector-minus-vector"/>
+    <keyword type="function" name="hkl_vector_div_double ()" link="hkl-hkl-vector-private.html#hkl-vector-div-double"/>
+    <keyword type="function" name="hkl_vector_times_double ()" link="hkl-hkl-vector-private.html#hkl-vector-times-double"/>
+    <keyword type="function" name="hkl_vector_times_vector ()" link="hkl-hkl-vector-private.html#hkl-vector-times-vector"/>
+    <keyword type="function" name="hkl_vector_times_matrix ()" link="hkl-hkl-vector-private.html#hkl-vector-times-matrix"/>
+    <keyword type="function" name="hkl_vector_sum ()" link="hkl-hkl-vector-private.html#hkl-vector-sum"/>
+    <keyword type="function" name="hkl_vector_scalar_product ()" link="hkl-hkl-vector-private.html#hkl-vector-scalar-product"/>
+    <keyword type="function" name="hkl_vector_vectorial_product ()" link="hkl-hkl-vector-private.html#hkl-vector-vectorial-product"/>
+    <keyword type="function" name="hkl_vector_angle ()" link="hkl-hkl-vector-private.html#hkl-vector-angle"/>
+    <keyword type="function" name="hkl_vector_oriented_angle ()" link="hkl-hkl-vector-private.html#hkl-vector-oriented-angle"/>
+    <keyword type="function" name="hkl_vector_oriented_angle_points ()" link="hkl-hkl-vector-private.html#hkl-vector-oriented-angle-points"/>
+    <keyword type="function" name="hkl_vector_norm2 ()" link="hkl-hkl-vector-private.html#hkl-vector-norm2"/>
+    <keyword type="function" name="hkl_vector_normalize ()" link="hkl-hkl-vector-private.html#hkl-vector-normalize"/>
+    <keyword type="function" name="hkl_vector_is_colinear ()" link="hkl-hkl-vector-private.html#hkl-vector-is-colinear"/>
+    <keyword type="function" name="hkl_vector_randomize ()" link="hkl-hkl-vector-private.html#hkl-vector-randomize"/>
+    <keyword type="function" name="hkl_vector_randomize_vector ()" link="hkl-hkl-vector-private.html#hkl-vector-randomize-vector"/>
+    <keyword type="function" name="hkl_vector_randomize_vector_vector ()" link="hkl-hkl-vector-private.html#hkl-vector-randomize-vector-vector"/>
+    <keyword type="function" name="hkl_vector_rotated_around_vector ()" link="hkl-hkl-vector-private.html#hkl-vector-rotated-around-vector"/>
+    <keyword type="function" name="hkl_vector_rotated_quaternion ()" link="hkl-hkl-vector-private.html#hkl-vector-rotated-quaternion"/>
+    <keyword type="function" name="hkl_vector_rotated_around_line ()" link="hkl-hkl-vector-private.html#hkl-vector-rotated-around-line"/>
+    <keyword type="function" name="hkl_vector_is_null ()" link="hkl-hkl-vector-private.html#hkl-vector-is-null"/>
+    <keyword type="function" name="hkl_vector_project_on_plan ()" link="hkl-hkl-vector-private.html#hkl-vector-project-on-plan"/>
+    <keyword type="function" name="hkl_vector_project_on_plan_with_point ()" link="hkl-hkl-vector-private.html#hkl-vector-project-on-plan-with-point"/>
+    <keyword type="function" name="list_check ()" link="hkl-list.html#list-check"/>
+    <keyword type="function" name="list_check_node ()" link="hkl-list.html#list-check-node"/>
     <keyword type="macro" name="list_debug()" link="hkl-list.html#list-debug"/>
     <keyword type="macro" name="list_debug_node()" link="hkl-list.html#list-debug-node"/>
-    <keyword type="macro" name="list_del_from_off()" link="hkl-list.html#list-del-from-off"/>
-    <keyword type="macro" name="list_del_off()" link="hkl-list.html#list-del-off"/>
+    <keyword type="macro" name="LIST_HEAD_INIT()" link="hkl-list.html#LIST-HEAD-INIT:CAPS"/>
+    <keyword type="macro" name="LIST_HEAD()" link="hkl-list.html#LIST-HEAD:CAPS"/>
+    <keyword type="macro" name="list_add()" link="hkl-list.html#list-add"/>
+    <keyword type="macro" name="list_add_tail()" link="hkl-list.html#list-add-tail"/>
+    <keyword type="macro" name="list_empty()" link="hkl-list.html#list-empty"/>
+    <keyword type="macro" name="list_empty_nodebug()" link="hkl-list.html#list-empty-nodebug"/>
+    <keyword type="macro" name="list_del()" link="hkl-list.html#list-del"/>
     <keyword type="macro" name="list_entry()" link="hkl-list.html#list-entry"/>
-    <keyword type="macro" name="list_entry_off()" link="hkl-list.html#list-entry-off"/>
+    <keyword type="macro" name="list_top()" link="hkl-list.html#list-top"/>
+    <keyword type="macro" name="list_pop()" link="hkl-list.html#list-pop"/>
+    <keyword type="macro" name="list_tail()" link="hkl-list.html#list-tail"/>
     <keyword type="macro" name="list_for_each()" link="hkl-list.html#list-for-each"/>
-    <keyword type="macro" name="list_for_each_off()" link="hkl-list.html#list-for-each-off"/>
     <keyword type="macro" name="list_for_each_rev()" link="hkl-list.html#list-for-each-rev"/>
     <keyword type="macro" name="list_for_each_safe()" link="hkl-list.html#list-for-each-safe"/>
+    <keyword type="macro" name="list_next()" link="hkl-list.html#list-next"/>
+    <keyword type="macro" name="list_prev()" link="hkl-list.html#list-prev"/>
+    <keyword type="macro" name="list_append_list()" link="hkl-list.html#list-append-list"/>
+    <keyword type="macro" name="list_prepend_list()" link="hkl-list.html#list-prepend-list"/>
+    <keyword type="macro" name="list_for_each_off()" link="hkl-list.html#list-for-each-off"/>
     <keyword type="macro" name="list_for_each_safe_off()" link="hkl-list.html#list-for-each-safe-off"/>
+    <keyword type="macro" name="list_entry_off()" link="hkl-list.html#list-entry-off"/>
     <keyword type="macro" name="list_head_off()" link="hkl-list.html#list-head-off"/>
+    <keyword type="macro" name="list_tail_off()" link="hkl-list.html#list-tail-off"/>
+    <keyword type="macro" name="list_add_off()" link="hkl-list.html#list-add-off"/>
+    <keyword type="macro" name="list_del_off()" link="hkl-list.html#list-del-off"/>
+    <keyword type="macro" name="list_del_from_off()" link="hkl-list.html#list-del-from-off"/>
     <keyword type="macro" name="list_off_()" link="hkl-list.html#list-off-"/>
     <keyword type="macro" name="list_off_var_()" link="hkl-list.html#list-off-var-"/>
-    <keyword type="macro" name="list_pop()" link="hkl-list.html#list-pop"/>
-    <keyword type="macro" name="list_tail()" link="hkl-list.html#list-tail"/>
-    <keyword type="macro" name="list_tail_off()" link="hkl-list.html#list-tail-off"/>
-    <keyword type="macro" name="list_top()" link="hkl-list.html#list-top"/>
-    <keyword type="function" name="close_noerr ()" link="hkl-noerr.html#close-noerr"/>
-    <keyword type="function" name="fclose_noerr ()" link="hkl-noerr.html#fclose-noerr"/>
-    <keyword type="function" name="unlink_noerr ()" link="hkl-noerr.html#unlink-noerr"/>
-    <keyword type="macro" name="PTR_VALID_ALIGNOF()" link="hkl-ptr-valid.html#PTR-VALID-ALIGNOF:CAPS"/>
-    <keyword type="function" name="ptr_valid ()" link="hkl-ptr-valid.html#ptr-valid"/>
-    <keyword type="function" name="ptr_valid_batch ()" link="hkl-ptr-valid.html#ptr-valid-batch"/>
-    <keyword type="function" name="ptr_valid_batch_end ()" link="hkl-ptr-valid.html#ptr-valid-batch-end"/>
-    <keyword type="macro" name="ptr_valid_batch_read()" link="hkl-ptr-valid.html#ptr-valid-batch-read"/>
-    <keyword type="function" name="ptr_valid_batch_start ()" link="hkl-ptr-valid.html#ptr-valid-batch-start"/>
-    <keyword type="function" name="ptr_valid_batch_string ()" link="hkl-ptr-valid.html#ptr-valid-batch-string"/>
-    <keyword type="macro" name="ptr_valid_batch_write()" link="hkl-ptr-valid.html#ptr-valid-batch-write"/>
+    <keyword type="macro" name="list_typeof()" link="hkl-list.html#list-typeof"/>
+    <keyword type="struct" name="struct list_node" link="hkl-list.html#list-node"/>
+    <keyword type="struct" name="struct list_head" link="hkl-list.html#list-head"/>
+    <keyword type="macro" name="LIST_LOC" link="hkl-list.html#LIST-LOC:CAPS"/>
+    <keyword type="function" name="close_noerr ()" link="hkl-noerr.html#close-noerr"/>
+    <keyword type="function" name="fclose_noerr ()" link="hkl-noerr.html#fclose-noerr"/>
+    <keyword type="function" name="unlink_noerr ()" link="hkl-noerr.html#unlink-noerr"/>
     <keyword type="macro" name="ptr_valid_read()" link="hkl-ptr-valid.html#ptr-valid-read"/>
-    <keyword type="function" name="ptr_valid_string ()" link="hkl-ptr-valid.html#ptr-valid-string"/>
     <keyword type="macro" name="ptr_valid_write()" link="hkl-ptr-valid.html#ptr-valid-write"/>
+    <keyword type="function" name="ptr_valid_string ()" link="hkl-ptr-valid.html#ptr-valid-string"/>
+    <keyword type="function" name="ptr_valid ()" link="hkl-ptr-valid.html#ptr-valid"/>
+    <keyword type="function" name="ptr_valid_batch_start ()" link="hkl-ptr-valid.html#ptr-valid-batch-start"/>
+    <keyword type="macro" name="ptr_valid_batch_read()" link="hkl-ptr-valid.html#ptr-valid-batch-read"/>
+    <keyword type="macro" name="ptr_valid_batch_write()" link="hkl-ptr-valid.html#ptr-valid-batch-write"/>
+    <keyword type="function" name="ptr_valid_batch_string ()" link="hkl-ptr-valid.html#ptr-valid-batch-string"/>
+    <keyword type="function" name="ptr_valid_batch_end ()" link="hkl-ptr-valid.html#ptr-valid-batch-end"/>
+    <keyword type="macro" name="PTR_VALID_ALIGNOF()" link="hkl-ptr-valid.html#PTR-VALID-ALIGNOF:CAPS"/>
+    <keyword type="struct" name="struct ptr_valid_batch" link="hkl-ptr-valid.html#ptr-valid-batch"/>
+    <keyword type="struct" name="struct ptr_valid_map" link="hkl-ptr-valid.html#ptr-valid-map"/>
+    <keyword type="macro" name="streq()" link="hkl-str.html#streq"/>
+    <keyword type="macro" name="strstarts()" link="hkl-str.html#strstarts"/>
+    <keyword type="macro" name="stringify()" link="hkl-str.html#stringify"/>
+    <keyword type="macro" name="stringify_1()" link="hkl-str.html#stringify-1"/>
+    <keyword type="function" name="strcount ()" link="hkl-str.html#strcount"/>
+    <keyword type="macro" name="STR_MAX_CHARS()" link="hkl-str.html#STR-MAX-CHARS:CAPS"/>
+    <keyword type="macro" name="STR_MAX_CHARS_TCHECK_()" link="hkl-str.html#STR-MAX-CHARS-TCHECK-:CAPS"/>
+    <keyword type="function" name="isalnum ()" link="hkl-str.html#isalnum"/>
+    <keyword type="function" name="isalpha ()" link="hkl-str.html#isalpha"/>
+    <keyword type="function" name="isascii ()" link="hkl-str.html#isascii"/>
+    <keyword type="function" name="isblank ()" link="hkl-str.html#isblank"/>
+    <keyword type="function" name="iscntrl ()" link="hkl-str.html#iscntrl"/>
+    <keyword type="function" name="isdigit ()" link="hkl-str.html#isdigit"/>
+    <keyword type="function" name="isgraph ()" link="hkl-str.html#isgraph"/>
+    <keyword type="function" name="islower ()" link="hkl-str.html#islower"/>
+    <keyword type="function" name="isprint ()" link="hkl-str.html#isprint"/>
+    <keyword type="function" name="ispunct ()" link="hkl-str.html#ispunct"/>
+    <keyword type="function" name="isspace ()" link="hkl-str.html#isspace"/>
+    <keyword type="function" name="isupper ()" link="hkl-str.html#isupper"/>
+    <keyword type="function" name="isxdigit ()" link="hkl-str.html#isxdigit"/>
+    <keyword type="macro" name="str_check_arg_()" link="hkl-str.html#str-check-arg-"/>
+    <keyword type="macro" name="strstr()" link="hkl-str.html#strstr"/>
+    <keyword type="macro" name="strchr()" link="hkl-str.html#strchr"/>
+    <keyword type="macro" name="strrchr()" link="hkl-str.html#strrchr"/>
+    <keyword type="function" name="str_isalnum ()" link="hkl-str-debug.html#str-isalnum"/>
+    <keyword type="function" name="str_isalpha ()" link="hkl-str-debug.html#str-isalpha"/>
+    <keyword type="function" name="str_isascii ()" link="hkl-str-debug.html#str-isascii"/>
+    <keyword type="function" name="str_isblank ()" link="hkl-str-debug.html#str-isblank"/>
+    <keyword type="function" name="str_iscntrl ()" link="hkl-str-debug.html#str-iscntrl"/>
+    <keyword type="function" name="str_isdigit ()" link="hkl-str-debug.html#str-isdigit"/>
+    <keyword type="function" name="str_isgraph ()" link="hkl-str-debug.html#str-isgraph"/>
+    <keyword type="function" name="str_islower ()" link="hkl-str-debug.html#str-islower"/>
+    <keyword type="function" name="str_isprint ()" link="hkl-str-debug.html#str-isprint"/>
+    <keyword type="function" name="str_ispunct ()" link="hkl-str-debug.html#str-ispunct"/>
+    <keyword type="function" name="str_isspace ()" link="hkl-str-debug.html#str-isspace"/>
+    <keyword type="function" name="str_isupper ()" link="hkl-str-debug.html#str-isupper"/>
+    <keyword type="function" name="str_isxdigit ()" link="hkl-str-debug.html#str-isxdigit"/>
+    <keyword type="function" name="str_strstr ()" link="hkl-str-debug.html#str-strstr"/>
+    <keyword type="function" name="str_strchr ()" link="hkl-str-debug.html#str-strchr"/>
+    <keyword type="function" name="str_strrchr ()" link="hkl-str-debug.html#str-strrchr"/>
   </functions>
 </book>
diff --git a/Documentation/api/html/home.png b/Documentation/api/html/home.png
index 1700361..9346b33 100644
Binary files a/Documentation/api/html/home.png and b/Documentation/api/html/home.png differ
diff --git a/Documentation/api/html/index.html b/Documentation/api/html/index.html
index eb0b535..7233baf 100644
--- a/Documentation/api/html/index.html
+++ b/Documentation/api/html/index.html
@@ -2,11 +2,11 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>hkl Reference Manual</title>
+<title>hkl Reference Manual: hkl Reference Manual</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="next" href="ch01.html" title="[Insert title here]">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -47,13 +47,16 @@
 <span class="refentrytitle"><a href="hkl-darray.html">darray</a></span><span class="refpurpose"></span>
 </dt>
 <dt>
+<span class="refentrytitle"><a href="hkl-hkl.html">hkl</a></span><span class="refpurpose"></span>
+</dt>
+<dt>
 <span class="refentrytitle"><a href="hkl-hkl-axis-private.html">hkl-axis-private</a></span><span class="refpurpose"></span>
 </dt>
 <dt>
 <span class="refentrytitle"><a href="hkl-hkl-detector-private.html">hkl-detector-private</a></span><span class="refpurpose"></span>
 </dt>
 <dt>
-<span class="refentrytitle"><a href="hkl-hkl-error-private.html">hkl-error-private</a></span><span class="refpurpose"></span>
+<span class="refentrytitle"><a href="hkl-hkl-factory-private.html">hkl-factory-private</a></span><span class="refpurpose"></span>
 </dt>
 <dt>
 <span class="refentrytitle"><a href="hkl-hkl-geometry-private.html">hkl-geometry-private</a></span><span class="refpurpose"></span>
@@ -89,30 +92,9 @@
 <span class="refentrytitle"><a href="hkl-hkl-pseudoaxis-common-q-private.html">hkl-pseudoaxis-common-q-private</a></span><span class="refpurpose"></span>
 </dt>
 <dt>
-<span class="refentrytitle"><a href="hkl-hkl-pseudoaxis-e4c-private.html">hkl-pseudoaxis-e4c-private</a></span><span class="refpurpose"></span>
-</dt>
-<dt>
-<span class="refentrytitle"><a href="hkl-hkl-pseudoaxis-e6c-private.html">hkl-pseudoaxis-e6c-private</a></span><span class="refpurpose"></span>
-</dt>
-<dt>
-<span class="refentrytitle"><a href="hkl-hkl-pseudoaxis-k4cv-private.html">hkl-pseudoaxis-k4cv-private</a></span><span class="refpurpose"></span>
-</dt>
-<dt>
-<span class="refentrytitle"><a href="hkl-hkl-pseudoaxis-k6c-private.html">hkl-pseudoaxis-k6c-private</a></span><span class="refpurpose"></span>
-</dt>
-<dt>
-<span class="refentrytitle"><a href="hkl-hkl-pseudoaxis-petra3-private.html">hkl-pseudoaxis-petra3-private</a></span><span class="refpurpose"></span>
-</dt>
-<dt>
 <span class="refentrytitle"><a href="hkl-hkl-pseudoaxis-private.html">hkl-pseudoaxis-private</a></span><span class="refpurpose"></span>
 </dt>
 <dt>
-<span class="refentrytitle"><a href="hkl-hkl-pseudoaxis-soleil-sixs-med-private.html">hkl-pseudoaxis-soleil-sixs-med-private</a></span><span class="refpurpose"></span>
-</dt>
-<dt>
-<span class="refentrytitle"><a href="hkl-hkl-pseudoaxis-zaxis-private.html">hkl-pseudoaxis-zaxis-private</a></span><span class="refpurpose"></span>
-</dt>
-<dt>
 <span class="refentrytitle"><a href="hkl-hkl-quaternion-private.html">hkl-quaternion-private</a></span><span class="refpurpose"></span>
 </dt>
 <dt>
@@ -142,6 +124,12 @@
 <dt>
 <span class="refentrytitle"><a href="hkl-ptr-valid.html">ptr_valid</a></span><span class="refpurpose"></span>
 </dt>
+<dt>
+<span class="refentrytitle"><a href="hkl-str.html">str</a></span><span class="refpurpose"></span>
+</dt>
+<dt>
+<span class="refentrytitle"><a href="hkl-str-debug.html">str_debug</a></span><span class="refpurpose"></span>
+</dt>
 </dl></dd>
 <dt><span class="chapter"><a href="object-tree.html">Object Hierarchy</a></span></dt>
 <dt><span class="index"><a href="api-index-full.html">API Index</a></span></dt>
@@ -151,6 +139,6 @@
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/index.sgml b/Documentation/api/html/index.sgml
index ac9141f..f3e4566 100644
--- a/Documentation/api/html/index.sgml
+++ b/Documentation/api/html/index.sgml
@@ -1,539 +1,659 @@
 <ONLINE href="http://[SERVER]/hkl/index.html">
 <ANCHOR id="hkl-array-size" href="hkl/hkl-array-size.html">
-<ANCHOR id="hkl-array-size.synopsis" href="hkl/hkl-array-size.html#hkl-array-size.synopsis">
+<ANCHOR id="hkl-array-size.functions" href="hkl/hkl-array-size.html#hkl-array-size.functions">
 <ANCHOR id="hkl-array-size.description" href="hkl/hkl-array-size.html#hkl-array-size.description">
-<ANCHOR id="hkl-array-size.details" href="hkl/hkl-array-size.html#hkl-array-size.details">
+<ANCHOR id="hkl-array-size.functions_details" href="hkl/hkl-array-size.html#hkl-array-size.functions_details">
 <ANCHOR id="ARRAY-SIZE:CAPS" href="hkl/hkl-array-size.html#ARRAY-SIZE:CAPS">
+<ANCHOR id="hkl-array-size.other_details" href="hkl/hkl-array-size.html#hkl-array-size.other_details">
 <ANCHOR id="hkl-autodata" href="hkl/hkl-autodata.html">
-<ANCHOR id="hkl-autodata.synopsis" href="hkl/hkl-autodata.html#hkl-autodata.synopsis">
+<ANCHOR id="hkl-autodata.functions" href="hkl/hkl-autodata.html#hkl-autodata.functions">
 <ANCHOR id="hkl-autodata.description" href="hkl/hkl-autodata.html#hkl-autodata.description">
-<ANCHOR id="hkl-autodata.details" href="hkl/hkl-autodata.html#hkl-autodata.details">
-<ANCHOR id="AUTODATA:CAPS" href="hkl/hkl-autodata.html#AUTODATA:CAPS">
-<ANCHOR id="AUTODATA-MAGIC:CAPS" href="hkl/hkl-autodata.html#AUTODATA-MAGIC:CAPS">
+<ANCHOR id="hkl-autodata.functions_details" href="hkl/hkl-autodata.html#hkl-autodata.functions_details">
 <ANCHOR id="AUTODATA-TYPE:CAPS" href="hkl/hkl-autodata.html#AUTODATA-TYPE:CAPS">
-<ANCHOR id="AUTODATA-VAR-:CAPS" href="hkl/hkl-autodata.html#AUTODATA-VAR-:CAPS">
-<ANCHOR id="AUTODATA-VAR--:CAPS" href="hkl/hkl-autodata.html#AUTODATA-VAR--:CAPS">
-<ANCHOR id="autodata-free" href="hkl/hkl-autodata.html#autodata-free">
+<ANCHOR id="AUTODATA:CAPS" href="hkl/hkl-autodata.html#AUTODATA:CAPS">
 <ANCHOR id="autodata-get" href="hkl/hkl-autodata.html#autodata-get">
+<ANCHOR id="autodata-free" href="hkl/hkl-autodata.html#autodata-free">
+<ANCHOR id="AUTODATA-VAR--:CAPS" href="hkl/hkl-autodata.html#AUTODATA-VAR--:CAPS">
+<ANCHOR id="AUTODATA-VAR-:CAPS" href="hkl/hkl-autodata.html#AUTODATA-VAR-:CAPS">
 <ANCHOR id="autodata-get-section" href="hkl/hkl-autodata.html#autodata-get-section">
+<ANCHOR id="AUTODATA-MAGIC:CAPS" href="hkl/hkl-autodata.html#AUTODATA-MAGIC:CAPS">
 <ANCHOR id="autodata-make-table" href="hkl/hkl-autodata.html#autodata-make-table">
+<ANCHOR id="hkl-autodata.other_details" href="hkl/hkl-autodata.html#hkl-autodata.other_details">
 <ANCHOR id="hkl-build-assert" href="hkl/hkl-build-assert.html">
-<ANCHOR id="hkl-build-assert.synopsis" href="hkl/hkl-build-assert.html#hkl-build-assert.synopsis">
+<ANCHOR id="hkl-build-assert.functions" href="hkl/hkl-build-assert.html#hkl-build-assert.functions">
 <ANCHOR id="hkl-build-assert.description" href="hkl/hkl-build-assert.html#hkl-build-assert.description">
-<ANCHOR id="hkl-build-assert.details" href="hkl/hkl-build-assert.html#hkl-build-assert.details">
+<ANCHOR id="hkl-build-assert.functions_details" href="hkl/hkl-build-assert.html#hkl-build-assert.functions_details">
 <ANCHOR id="BUILD-ASSERT:CAPS" href="hkl/hkl-build-assert.html#BUILD-ASSERT:CAPS">
 <ANCHOR id="BUILD-ASSERT-OR-ZERO:CAPS" href="hkl/hkl-build-assert.html#BUILD-ASSERT-OR-ZERO:CAPS">
+<ANCHOR id="hkl-build-assert.other_details" href="hkl/hkl-build-assert.html#hkl-build-assert.other_details">
 <ANCHOR id="hkl-check-type" href="hkl/hkl-check-type.html">
-<ANCHOR id="hkl-check-type.synopsis" href="hkl/hkl-check-type.html#hkl-check-type.synopsis">
+<ANCHOR id="hkl-check-type.functions" href="hkl/hkl-check-type.html#hkl-check-type.functions">
 <ANCHOR id="hkl-check-type.description" href="hkl/hkl-check-type.html#hkl-check-type.description">
-<ANCHOR id="hkl-check-type.details" href="hkl/hkl-check-type.html#hkl-check-type.details">
+<ANCHOR id="hkl-check-type.functions_details" href="hkl/hkl-check-type.html#hkl-check-type.functions_details">
 <ANCHOR id="check-type" href="hkl/hkl-check-type.html#check-type">
 <ANCHOR id="check-types-match" href="hkl/hkl-check-type.html#check-types-match">
+<ANCHOR id="hkl-check-type.other_details" href="hkl/hkl-check-type.html#hkl-check-type.other_details">
 <ANCHOR id="hkl-compiler" href="hkl/hkl-compiler.html">
-<ANCHOR id="hkl-compiler.synopsis" href="hkl/hkl-compiler.html#hkl-compiler.synopsis">
+<ANCHOR id="hkl-compiler.functions" href="hkl/hkl-compiler.html#hkl-compiler.functions">
+<ANCHOR id="hkl-compiler.other" href="hkl/hkl-compiler.html#hkl-compiler.other">
 <ANCHOR id="hkl-compiler.description" href="hkl/hkl-compiler.html#hkl-compiler.description">
-<ANCHOR id="hkl-compiler.details" href="hkl/hkl-compiler.html#hkl-compiler.details">
-<ANCHOR id="COLD:CAPS" href="hkl/hkl-compiler.html#COLD:CAPS">
-<ANCHOR id="CONST-FUNCTION:CAPS" href="hkl/hkl-compiler.html#CONST-FUNCTION:CAPS">
+<ANCHOR id="hkl-compiler.functions_details" href="hkl/hkl-compiler.html#hkl-compiler.functions_details">
+<ANCHOR id="PRINTF-FMT:CAPS" href="hkl/hkl-compiler.html#PRINTF-FMT:CAPS">
 <ANCHOR id="IS-COMPILE-CONSTANT:CAPS" href="hkl/hkl-compiler.html#IS-COMPILE-CONSTANT:CAPS">
-<ANCHOR id="NEEDED:CAPS" href="hkl/hkl-compiler.html#NEEDED:CAPS">
+<ANCHOR id="hkl-compiler.other_details" href="hkl/hkl-compiler.html#hkl-compiler.other_details">
+<ANCHOR id="COLD:CAPS" href="hkl/hkl-compiler.html#COLD:CAPS">
 <ANCHOR id="NORETURN:CAPS" href="hkl/hkl-compiler.html#NORETURN:CAPS">
-<ANCHOR id="PRINTF-FMT:CAPS" href="hkl/hkl-compiler.html#PRINTF-FMT:CAPS">
+<ANCHOR id="CONST-FUNCTION:CAPS" href="hkl/hkl-compiler.html#CONST-FUNCTION:CAPS">
+<ANCHOR id="PURE-FUNCTION:CAPS" href="hkl/hkl-compiler.html#PURE-FUNCTION:CAPS">
 <ANCHOR id="UNNEEDED:CAPS" href="hkl/hkl-compiler.html#UNNEEDED:CAPS">
+<ANCHOR id="NEEDED:CAPS" href="hkl/hkl-compiler.html#NEEDED:CAPS">
 <ANCHOR id="UNUSED:CAPS" href="hkl/hkl-compiler.html#UNUSED:CAPS">
 <ANCHOR id="WARN-UNUSED-RESULT:CAPS" href="hkl/hkl-compiler.html#WARN-UNUSED-RESULT:CAPS">
 <ANCHOR id="hkl-container-of" href="hkl/hkl-container-of.html">
-<ANCHOR id="hkl-container-of.synopsis" href="hkl/hkl-container-of.html#hkl-container-of.synopsis">
+<ANCHOR id="hkl-container-of.functions" href="hkl/hkl-container-of.html#hkl-container-of.functions">
 <ANCHOR id="hkl-container-of.description" href="hkl/hkl-container-of.html#hkl-container-of.description">
-<ANCHOR id="hkl-container-of.details" href="hkl/hkl-container-of.html#hkl-container-of.details">
+<ANCHOR id="hkl-container-of.functions_details" href="hkl/hkl-container-of.html#hkl-container-of.functions_details">
 <ANCHOR id="container-of" href="hkl/hkl-container-of.html#container-of">
-<ANCHOR id="container-of-var" href="hkl/hkl-container-of.html#container-of-var">
 <ANCHOR id="container-off" href="hkl/hkl-container-of.html#container-off">
+<ANCHOR id="container-of-var" href="hkl/hkl-container-of.html#container-of-var">
 <ANCHOR id="container-off-var" href="hkl/hkl-container-of.html#container-off-var">
+<ANCHOR id="hkl-container-of.other_details" href="hkl/hkl-container-of.html#hkl-container-of.other_details">
 <ANCHOR id="hkl-darray" href="hkl/hkl-darray.html">
-<ANCHOR id="hkl-darray.synopsis" href="hkl/hkl-darray.html#hkl-darray.synopsis">
+<ANCHOR id="hkl-darray.functions" href="hkl/hkl-darray.html#hkl-darray.functions">
+<ANCHOR id="hkl-darray.other" href="hkl/hkl-darray.html#hkl-darray.other">
 <ANCHOR id="hkl-darray.description" href="hkl/hkl-darray.html#hkl-darray.description">
-<ANCHOR id="hkl-darray.details" href="hkl/hkl-darray.html#hkl-darray.details">
+<ANCHOR id="hkl-darray.functions_details" href="hkl/hkl-darray.html#hkl-darray.functions_details">
 <ANCHOR id="darray" href="hkl/hkl-darray.html#darray">
+<ANCHOR id="darray-new" href="hkl/hkl-darray.html#darray-new">
+<ANCHOR id="darray-init" href="hkl/hkl-darray.html#darray-init">
+<ANCHOR id="darray-free" href="hkl/hkl-darray.html#darray-free">
+<ANCHOR id="darray-item" href="hkl/hkl-darray.html#darray-item">
+<ANCHOR id="darray-size" href="hkl/hkl-darray.html#darray-size">
 <ANCHOR id="darray-alloc" href="hkl/hkl-darray.html#darray-alloc">
+<ANCHOR id="darray-empty" href="hkl/hkl-darray.html#darray-empty">
 <ANCHOR id="darray-append" href="hkl/hkl-darray.html#darray-append">
+<ANCHOR id="darray-prepend" href="hkl/hkl-darray.html#darray-prepend">
+<ANCHOR id="darray-push" href="hkl/hkl-darray.html#darray-push">
 <ANCHOR id="darray-append-items" href="hkl/hkl-darray.html#darray-append-items">
+<ANCHOR id="darray-prepend-items" href="hkl/hkl-darray.html#darray-prepend-items">
 <ANCHOR id="darray-append-items-nullterminate" href="hkl/hkl-darray.html#darray-append-items-nullterminate">
-<ANCHOR id="darray-append-lit" href="hkl/hkl-darray.html#darray-append-lit">
-<ANCHOR id="darray-append-string" href="hkl/hkl-darray.html#darray-append-string">
+<ANCHOR id="darray-prepend-items-nullterminate" href="hkl/hkl-darray.html#darray-prepend-items-nullterminate">
 <ANCHOR id="darray-appends" href="hkl/hkl-darray.html#darray-appends">
+<ANCHOR id="darray-prepends" href="hkl/hkl-darray.html#darray-prepends">
 <ANCHOR id="darray-appends-t" href="hkl/hkl-darray.html#darray-appends-t">
-<ANCHOR id="darray-char" href="hkl/hkl-darray.html#darray-char">
-<ANCHOR id="darray-empty" href="hkl/hkl-darray.html#darray-empty">
-<ANCHOR id="darray-foreach" href="hkl/hkl-darray.html#darray-foreach">
-<ANCHOR id="darray-foreach-reverse" href="hkl/hkl-darray.html#darray-foreach-reverse">
-<ANCHOR id="darray-free" href="hkl/hkl-darray.html#darray-free">
-<ANCHOR id="darray-from-c" href="hkl/hkl-darray.html#darray-from-c">
-<ANCHOR id="darray-from-items" href="hkl/hkl-darray.html#darray-from-items">
-<ANCHOR id="darray-from-lit" href="hkl/hkl-darray.html#darray-from-lit">
-<ANCHOR id="darray-from-string" href="hkl/hkl-darray.html#darray-from-string">
-<ANCHOR id="darray-growalloc" href="hkl/hkl-darray.html#darray-growalloc">
-<ANCHOR id="darray-init" href="hkl/hkl-darray.html#darray-init">
-<ANCHOR id="darray-int" href="hkl/hkl-darray.html#darray-int">
-<ANCHOR id="darray-item" href="hkl/hkl-darray.html#darray-item">
-<ANCHOR id="darray-long" href="hkl/hkl-darray.html#darray-long">
-<ANCHOR id="darray-make-room" href="hkl/hkl-darray.html#darray-make-room">
-<ANCHOR id="darray-new" href="hkl/hkl-darray.html#darray-new">
+<ANCHOR id="darray-prepends-t" href="hkl/hkl-darray.html#darray-prepends-t">
 <ANCHOR id="darray-pop" href="hkl/hkl-darray.html#darray-pop">
 <ANCHOR id="darray-pop-check" href="hkl/hkl-darray.html#darray-pop-check">
-<ANCHOR id="darray-prepend" href="hkl/hkl-darray.html#darray-prepend">
-<ANCHOR id="darray-prepend-items" href="hkl/hkl-darray.html#darray-prepend-items">
-<ANCHOR id="darray-prepend-items-nullterminate" href="hkl/hkl-darray.html#darray-prepend-items-nullterminate">
-<ANCHOR id="darray-prepend-lit" href="hkl/hkl-darray.html#darray-prepend-lit">
+<ANCHOR id="darray-from-items" href="hkl/hkl-darray.html#darray-from-items">
+<ANCHOR id="darray-from-c" href="hkl/hkl-darray.html#darray-from-c">
+<ANCHOR id="darray-append-string" href="hkl/hkl-darray.html#darray-append-string">
+<ANCHOR id="darray-append-lit" href="hkl/hkl-darray.html#darray-append-lit">
 <ANCHOR id="darray-prepend-string" href="hkl/hkl-darray.html#darray-prepend-string">
-<ANCHOR id="darray-prepends" href="hkl/hkl-darray.html#darray-prepends">
-<ANCHOR id="darray-prepends-t" href="hkl/hkl-darray.html#darray-prepends-t">
-<ANCHOR id="darray-push" href="hkl/hkl-darray.html#darray-push">
-<ANCHOR id="darray-realloc" href="hkl/hkl-darray.html#darray-realloc">
+<ANCHOR id="darray-prepend-lit" href="hkl/hkl-darray.html#darray-prepend-lit">
+<ANCHOR id="darray-from-string" href="hkl/hkl-darray.html#darray-from-string">
+<ANCHOR id="darray-from-lit" href="hkl/hkl-darray.html#darray-from-lit">
 <ANCHOR id="darray-resize" href="hkl/hkl-darray.html#darray-resize">
 <ANCHOR id="darray-resize0" href="hkl/hkl-darray.html#darray-resize0">
+<ANCHOR id="darray-realloc" href="hkl/hkl-darray.html#darray-realloc">
+<ANCHOR id="darray-growalloc" href="hkl/hkl-darray.html#darray-growalloc">
+<ANCHOR id="darray-make-room" href="hkl/hkl-darray.html#darray-make-room">
+<ANCHOR id="darray-foreach" href="hkl/hkl-darray.html#darray-foreach">
+<ANCHOR id="darray-foreach-reverse" href="hkl/hkl-darray.html#darray-foreach-reverse">
+<ANCHOR id="hkl-darray.other_details" href="hkl/hkl-darray.html#hkl-darray.other_details">
+<ANCHOR id="darray-char" href="hkl/hkl-darray.html#darray-char">
 <ANCHOR id="darray-schar" href="hkl/hkl-darray.html#darray-schar">
-<ANCHOR id="darray-short" href="hkl/hkl-darray.html#darray-short">
-<ANCHOR id="darray-size" href="hkl/hkl-darray.html#darray-size">
 <ANCHOR id="darray-uchar" href="hkl/hkl-darray.html#darray-uchar">
+<ANCHOR id="darray-short" href="hkl/hkl-darray.html#darray-short">
+<ANCHOR id="darray-int" href="hkl/hkl-darray.html#darray-int">
+<ANCHOR id="darray-long" href="hkl/hkl-darray.html#darray-long">
+<ANCHOR id="darray-ushort" href="hkl/hkl-darray.html#darray-ushort">
 <ANCHOR id="darray-uint" href="hkl/hkl-darray.html#darray-uint">
 <ANCHOR id="darray-ulong" href="hkl/hkl-darray.html#darray-ulong">
-<ANCHOR id="darray-ushort" href="hkl/hkl-darray.html#darray-ushort">
+<ANCHOR id="hkl-hkl" href="hkl/hkl-hkl.html">
+<ANCHOR id="hkl-hkl.functions" href="hkl/hkl-hkl.html#hkl-hkl.functions">
+<ANCHOR id="hkl-hkl.other" href="hkl/hkl-hkl.html#hkl-hkl.other">
+<ANCHOR id="hkl-hkl.description" href="hkl/hkl-hkl.html#hkl-hkl.description">
+<ANCHOR id="hkl-hkl.functions_details" href="hkl/hkl-hkl.html#hkl-hkl.functions_details">
+<ANCHOR id="HKL-DEPRECATED-FOR:CAPS" href="hkl/hkl-hkl.html#HKL-DEPRECATED-FOR:CAPS">
+<ANCHOR id="HKL-DEGTORAD:CAPS" href="hkl/hkl-hkl.html#HKL-DEGTORAD:CAPS">
+<ANCHOR id="HKL-RADTODEG:CAPS" href="hkl/hkl-hkl.html#HKL-RADTODEG:CAPS">
+<ANCHOR id="HKL-TAU:CAPS" href="hkl/hkl-hkl.html#HKL-TAU:CAPS">
+<ANCHOR id="HKL-ARG-NONNULL:CAPS" href="hkl/hkl-hkl.html#HKL-ARG-NONNULL:CAPS">
+<ANCHOR id="HKL-GEOMETRY-LIST-FOREACH:CAPS" href="hkl/hkl-hkl.html#HKL-GEOMETRY-LIST-FOREACH:CAPS">
+<ANCHOR id="HKL-SAMPLE-REFLECTIONS-FOREACH:CAPS" href="hkl/hkl-hkl.html#HKL-SAMPLE-REFLECTIONS-FOREACH:CAPS">
+<ANCHOR id="hkl-hkl.other_details" href="hkl/hkl-hkl.html#hkl-hkl.other_details">
+<ANCHOR id="HKL-DEPRECATED:CAPS" href="hkl/hkl-hkl.html#HKL-DEPRECATED:CAPS">
+<ANCHOR id="HKL-TINY:CAPS" href="hkl/hkl-hkl.html#HKL-TINY:CAPS">
+<ANCHOR id="HKL-EPSILON:CAPS" href="hkl/hkl-hkl.html#HKL-EPSILON:CAPS">
+<ANCHOR id="HKLAPI:CAPS" href="hkl/hkl-hkl.html#HKLAPI:CAPS">
+<ANCHOR id="HKL-WARN-UNUSED-RESULT:CAPS" href="hkl/hkl-hkl.html#HKL-WARN-UNUSED-RESULT:CAPS">
+<ANCHOR id="HklVector" href="hkl/hkl-hkl.html#HklVector">
+<ANCHOR id="HklQuaternion" href="hkl/hkl-hkl.html#HklQuaternion">
+<ANCHOR id="darray-string" href="hkl/hkl-hkl.html#darray-string">
+<ANCHOR id="HklUnitEnum" href="hkl/hkl-hkl.html#HklUnitEnum">
+<ANCHOR id="HklDetectorType" href="hkl/hkl-hkl.html#HklDetectorType">
+<ANCHOR id="darray-engine" href="hkl/hkl-hkl.html#darray-engine">
+<ANCHOR id="HklEngineCapabilities" href="hkl/hkl-hkl.html#HklEngineCapabilities">
+<ANCHOR id="HklEngineAxisNamesGet" href="hkl/hkl-hkl.html#HklEngineAxisNamesGet">
+<ANCHOR id="HklParameter" href="hkl/hkl-hkl.html#HklParameter">
+<ANCHOR id="HklGeometry" href="hkl/hkl-hkl.html#HklGeometry">
+<ANCHOR id="HklSampleReflection" href="hkl/hkl-hkl.html#HklSampleReflection">
+<ANCHOR id="HklSample" href="hkl/hkl-hkl.html#HklSample">
+<ANCHOR id="HklGeometryListItem" href="hkl/hkl-hkl.html#HklGeometryListItem">
+<ANCHOR id="HklFactory" href="hkl/hkl-hkl.html#HklFactory">
+<ANCHOR id="HklEngineList" href="hkl/hkl-hkl.html#HklEngineList">
+<ANCHOR id="HklGeometryList" href="hkl/hkl-hkl.html#HklGeometryList">
+<ANCHOR id="HklLattice" href="hkl/hkl-hkl.html#HklLattice">
+<ANCHOR id="HklMatrix" href="hkl/hkl-hkl.html#HklMatrix">
+<ANCHOR id="HklDetector" href="hkl/hkl-hkl.html#HklDetector">
+<ANCHOR id="HklEngine" href="hkl/hkl-hkl.html#HklEngine">
 <ANCHOR id="hkl-hkl-axis-private" href="hkl/hkl-hkl-axis-private.html">
-<ANCHOR id="hkl-hkl-axis-private.synopsis" href="hkl/hkl-hkl-axis-private.html#hkl-hkl-axis-private.synopsis">
+<ANCHOR id="hkl-hkl-axis-private.functions" href="hkl/hkl-hkl-axis-private.html#hkl-hkl-axis-private.functions">
+<ANCHOR id="hkl-hkl-axis-private.other" href="hkl/hkl-hkl-axis-private.html#hkl-hkl-axis-private.other">
 <ANCHOR id="hkl-hkl-axis-private.description" href="hkl/hkl-hkl-axis-private.html#hkl-hkl-axis-private.description">
-<ANCHOR id="hkl-hkl-axis-private.details" href="hkl/hkl-hkl-axis-private.html#hkl-hkl-axis-private.details">
-<ANCHOR id="HklAxis" href="hkl/hkl-hkl-axis-private.html#HklAxis">
+<ANCHOR id="hkl-hkl-axis-private.functions_details" href="hkl/hkl-hkl-axis-private.html#hkl-hkl-axis-private.functions_details">
 <ANCHOR id="hkl-parameter-new-axis" href="hkl/hkl-hkl-axis-private.html#hkl-parameter-new-axis">
+<ANCHOR id="hkl-hkl-axis-private.other_details" href="hkl/hkl-hkl-axis-private.html#hkl-hkl-axis-private.other_details">
+<ANCHOR id="HklAxis" href="hkl/hkl-hkl-axis-private.html#HklAxis">
 <ANCHOR id="hkl-hkl-detector-private" href="hkl/hkl-hkl-detector-private.html">
-<ANCHOR id="hkl-hkl-detector-private.synopsis" href="hkl/hkl-hkl-detector-private.html#hkl-hkl-detector-private.synopsis">
+<ANCHOR id="hkl-hkl-detector-private.functions" href="hkl/hkl-hkl-detector-private.html#hkl-hkl-detector-private.functions">
+<ANCHOR id="hkl-hkl-detector-private.other" href="hkl/hkl-hkl-detector-private.html#hkl-hkl-detector-private.other">
 <ANCHOR id="hkl-hkl-detector-private.description" href="hkl/hkl-hkl-detector-private.html#hkl-hkl-detector-private.description">
-<ANCHOR id="hkl-hkl-detector-private.details" href="hkl/hkl-hkl-detector-private.html#hkl-hkl-detector-private.details">
-<ANCHOR id="HklDetector" href="hkl/hkl-hkl-detector-private.html#HklDetector">
+<ANCHOR id="hkl-hkl-detector-private.functions_details" href="hkl/hkl-hkl-detector-private.html#hkl-hkl-detector-private.functions_details">
+<ANCHOR id="hkl-detector-new" href="hkl/hkl-hkl-detector-private.html#hkl-detector-new">
 <ANCHOR id="hkl-detector-attach-to-holder" href="hkl/hkl-hkl-detector-private.html#hkl-detector-attach-to-holder">
 <ANCHOR id="hkl-detector-compute-kf" href="hkl/hkl-hkl-detector-private.html#hkl-detector-compute-kf">
-<ANCHOR id="hkl-detector-new" href="hkl/hkl-hkl-detector-private.html#hkl-detector-new">
-<ANCHOR id="hkl-detector-new-copy" href="hkl/hkl-hkl-detector-private.html#hkl-detector-new-copy">
-<ANCHOR id="hkl-hkl-error-private" href="hkl/hkl-hkl-error-private.html">
-<ANCHOR id="hkl-hkl-error-private.synopsis" href="hkl/hkl-hkl-error-private.html#hkl-hkl-error-private.synopsis">
-<ANCHOR id="hkl-hkl-error-private.description" href="hkl/hkl-hkl-error-private.html#hkl-hkl-error-private.description">
-<ANCHOR id="hkl-hkl-error-private.details" href="hkl/hkl-hkl-error-private.html#hkl-hkl-error-private.details">
-<ANCHOR id="HklError" href="hkl/hkl-hkl-error-private.html#HklError">
-<ANCHOR id="hkl-error-clear" href="hkl/hkl-hkl-error-private.html#hkl-error-clear">
-<ANCHOR id="hkl-error-free" href="hkl/hkl-hkl-error-private.html#hkl-error-free">
-<ANCHOR id="hkl-error-new" href="hkl/hkl-hkl-error-private.html#hkl-error-new">
-<ANCHOR id="hkl-error-new-copy" href="hkl/hkl-hkl-error-private.html#hkl-error-new-copy">
-<ANCHOR id="hkl-error-new-literal" href="hkl/hkl-hkl-error-private.html#hkl-error-new-literal">
-<ANCHOR id="hkl-error-new-valist" href="hkl/hkl-hkl-error-private.html#hkl-error-new-valist">
-<ANCHOR id="hkl-error-prefix" href="hkl/hkl-hkl-error-private.html#hkl-error-prefix">
-<ANCHOR id="hkl-error-propagate" href="hkl/hkl-hkl-error-private.html#hkl-error-propagate">
-<ANCHOR id="hkl-error-propagate-prefixed" href="hkl/hkl-hkl-error-private.html#hkl-error-propagate-prefixed">
-<ANCHOR id="hkl-error-set" href="hkl/hkl-hkl-error-private.html#hkl-error-set">
-<ANCHOR id="hkl-error-set-literal" href="hkl/hkl-hkl-error-private.html#hkl-error-set-literal">
+<ANCHOR id="hkl-hkl-detector-private.other_details" href="hkl/hkl-hkl-detector-private.html#hkl-hkl-detector-private.other_details">
+<ANCHOR id="HklDetector" href="hkl/hkl-hkl-detector-private.html#HklDetector">
+<ANCHOR id="hkl-hkl-factory-private" href="hkl/hkl-hkl-factory-private.html">
+<ANCHOR id="hkl-hkl-factory-private.functions" href="hkl/hkl-hkl-factory-private.html#hkl-hkl-factory-private.functions">
+<ANCHOR id="hkl-hkl-factory-private.other" href="hkl/hkl-hkl-factory-private.html#hkl-hkl-factory-private.other">
+<ANCHOR id="hkl-hkl-factory-private.description" href="hkl/hkl-hkl-factory-private.html#hkl-hkl-factory-private.description">
+<ANCHOR id="hkl-hkl-factory-private.functions_details" href="hkl/hkl-hkl-factory-private.html#hkl-hkl-factory-private.functions_details">
+<ANCHOR id="HklFactoryGeometryFunction" href="hkl/hkl-hkl-factory-private.html#HklFactoryGeometryFunction">
+<ANCHOR id="HklFactoryEngineListFunction" href="hkl/hkl-hkl-factory-private.html#HklFactoryEngineListFunction">
+<ANCHOR id="REGISTER-DIFFRACTOMETER:CAPS" href="hkl/hkl-hkl-factory-private.html#REGISTER-DIFFRACTOMETER:CAPS">
+<ANCHOR id="hkl-hkl-factory-private.other_details" href="hkl/hkl-hkl-factory-private.html#hkl-hkl-factory-private.other_details">
+<ANCHOR id="HklFactory" href="hkl/hkl-hkl-factory-private.html#HklFactory">
 <ANCHOR id="hkl-hkl-geometry-private" href="hkl/hkl-hkl-geometry-private.html">
-<ANCHOR id="hkl-hkl-geometry-private.synopsis" href="hkl/hkl-hkl-geometry-private.html#hkl-hkl-geometry-private.synopsis">
+<ANCHOR id="hkl-hkl-geometry-private.functions" href="hkl/hkl-hkl-geometry-private.html#hkl-hkl-geometry-private.functions">
+<ANCHOR id="hkl-hkl-geometry-private.other" href="hkl/hkl-hkl-geometry-private.html#hkl-hkl-geometry-private.other">
 <ANCHOR id="hkl-hkl-geometry-private.description" href="hkl/hkl-hkl-geometry-private.html#hkl-hkl-geometry-private.description">
-<ANCHOR id="hkl-hkl-geometry-private.details" href="hkl/hkl-hkl-geometry-private.html#hkl-hkl-geometry-private.details">
-<ANCHOR id="HklGeometry" href="hkl/hkl-hkl-geometry-private.html#HklGeometry">
-<ANCHOR id="HklGeometryList" href="hkl/hkl-hkl-geometry-private.html#HklGeometryList">
-<ANCHOR id="HklGeometryListItem" href="hkl/hkl-hkl-geometry-private.html#HklGeometryListItem">
+<ANCHOR id="hkl-hkl-geometry-private.functions_details" href="hkl/hkl-hkl-geometry-private.html#hkl-hkl-geometry-private.functions_details">
 <ANCHOR id="HklGeometryListMultiplyFunction" href="hkl/hkl-hkl-geometry-private.html#HklGeometryListMultiplyFunction">
-<ANCHOR id="HklHolder" href="hkl/hkl-hkl-geometry-private.html#HklHolder">
-<ANCHOR id="darray-holder" href="hkl/hkl-hkl-geometry-private.html#darray-holder">
+<ANCHOR id="g-quark-from-static-string" href="hkl/hkl-hkl-geometry-private.html#g-quark-from-static-string">
+<ANCHOR id="hkl-holder-add-rotation-axis" href="hkl/hkl-hkl-geometry-private.html#hkl-holder-add-rotation-axis">
+<ANCHOR id="hkl-geometry-new" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-new">
+<ANCHOR id="hkl-geometry-init-geometry" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-init-geometry">
 <ANCHOR id="hkl-geometry-add-holder" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-add-holder">
-<ANCHOR id="hkl-geometry-closest-from-geometry-with-range" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-closest-from-geometry-with-range">
+<ANCHOR id="hkl-geometry-update" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-update">
+<ANCHOR id="hkl-geometry-get-axis-idx-by-name" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-get-axis-idx-by-name">
+<ANCHOR id="hkl-geometry-get-axis-by-name" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-get-axis-by-name">
 <ANCHOR id="hkl-geometry-distance" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-distance">
 <ANCHOR id="hkl-geometry-distance-orthodromic" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-distance-orthodromic">
-<ANCHOR id="hkl-geometry-get-axis-by-name" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-get-axis-by-name">
-<ANCHOR id="hkl-geometry-get-axis-idx-by-name" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-get-axis-idx-by-name">
-<ANCHOR id="hkl-geometry-init-geometry" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-init-geometry">
+<ANCHOR id="hkl-geometry-closest-from-geometry-with-range" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-closest-from-geometry-with-range">
 <ANCHOR id="hkl-geometry-is-valid" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-is-valid">
+<ANCHOR id="hkl-geometry-list-new" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-list-new">
+<ANCHOR id="hkl-geometry-list-new-copy" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-list-new-copy">
 <ANCHOR id="hkl-geometry-list-add" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-list-add">
+<ANCHOR id="hkl-geometry-list-reset" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-list-reset">
+<ANCHOR id="hkl-geometry-list-sort" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-list-sort">
 <ANCHOR id="hkl-geometry-list-fprintf" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-list-fprintf">
-<ANCHOR id="hkl-geometry-list-free" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-list-free">
-<ANCHOR id="hkl-geometry-list-item-free" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-list-item-free">
-<ANCHOR id="hkl-geometry-list-item-new" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-list-item-new">
-<ANCHOR id="hkl-geometry-list-item-new-copy" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-list-item-new-copy">
 <ANCHOR id="hkl-geometry-list-multiply" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-list-multiply">
 <ANCHOR id="hkl-geometry-list-multiply-from-range" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-list-multiply-from-range">
-<ANCHOR id="hkl-geometry-list-new" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-list-new">
-<ANCHOR id="hkl-geometry-list-new-copy" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-list-new-copy">
 <ANCHOR id="hkl-geometry-list-remove-invalid" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-list-remove-invalid">
-<ANCHOR id="hkl-geometry-list-reset" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-list-reset">
-<ANCHOR id="hkl-geometry-list-sort" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-list-sort">
-<ANCHOR id="hkl-geometry-new" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-new">
-<ANCHOR id="hkl-geometry-new-copy" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-new-copy">
-<ANCHOR id="hkl-geometry-set-values-v" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-set-values-v">
-<ANCHOR id="hkl-geometry-update" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-update">
-<ANCHOR id="hkl-holder-add-rotation-axis" href="hkl/hkl-hkl-geometry-private.html#hkl-holder-add-rotation-axis">
+<ANCHOR id="hkl-geometry-list-item-new" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-list-item-new">
+<ANCHOR id="hkl-geometry-list-item-new-copy" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-list-item-new-copy">
+<ANCHOR id="hkl-geometry-list-item-free" href="hkl/hkl-hkl-geometry-private.html#hkl-geometry-list-item-free">
+<ANCHOR id="hkl-hkl-geometry-private.other_details" href="hkl/hkl-hkl-geometry-private.html#hkl-hkl-geometry-private.other_details">
+<ANCHOR id="darray-holder" href="hkl/hkl-hkl-geometry-private.html#darray-holder">
+<ANCHOR id="HklHolderConfig" href="hkl/hkl-hkl-geometry-private.html#HklHolderConfig">
+<ANCHOR id="HklHolder" href="hkl/hkl-hkl-geometry-private.html#HklHolder">
+<ANCHOR id="HklGeometry" href="hkl/hkl-hkl-geometry-private.html#HklGeometry">
+<ANCHOR id="HKL-GEOMETRY-ERROR:CAPS" href="hkl/hkl-hkl-geometry-private.html#HKL-GEOMETRY-ERROR:CAPS">
+<ANCHOR id="HklGeometryError" href="hkl/hkl-hkl-geometry-private.html#HklGeometryError">
+<ANCHOR id="HklGeometryList" href="hkl/hkl-hkl-geometry-private.html#HklGeometryList">
+<ANCHOR id="HklGeometryListItem" href="hkl/hkl-hkl-geometry-private.html#HklGeometryListItem">
 <ANCHOR id="hkl-hkl-interval-private" href="hkl/hkl-hkl-interval-private.html">
-<ANCHOR id="hkl-hkl-interval-private.synopsis" href="hkl/hkl-hkl-interval-private.html#hkl-hkl-interval-private.synopsis">
+<ANCHOR id="hkl-hkl-interval-private.functions" href="hkl/hkl-hkl-interval-private.html#hkl-hkl-interval-private.functions">
+<ANCHOR id="hkl-hkl-interval-private.other" href="hkl/hkl-hkl-interval-private.html#hkl-hkl-interval-private.other">
 <ANCHOR id="hkl-hkl-interval-private.description" href="hkl/hkl-hkl-interval-private.html#hkl-hkl-interval-private.description">
-<ANCHOR id="hkl-hkl-interval-private.details" href="hkl/hkl-hkl-interval-private.html#hkl-hkl-interval-private.details">
-<ANCHOR id="HklInterval" href="hkl/hkl-hkl-interval-private.html#HklInterval">
-<ANCHOR id="hkl-interval-acos" href="hkl/hkl-hkl-interval-private.html#hkl-interval-acos">
-<ANCHOR id="hkl-interval-angle-restrict-symm" href="hkl/hkl-hkl-interval-private.html#hkl-interval-angle-restrict-symm">
-<ANCHOR id="hkl-interval-asin" href="hkl/hkl-hkl-interval-private.html#hkl-interval-asin">
-<ANCHOR id="hkl-interval-atan" href="hkl/hkl-hkl-interval-private.html#hkl-interval-atan">
-<ANCHOR id="hkl-interval-cmp" href="hkl/hkl-hkl-interval-private.html#hkl-interval-cmp">
-<ANCHOR id="hkl-interval-contain-zero" href="hkl/hkl-hkl-interval-private.html#hkl-interval-contain-zero">
-<ANCHOR id="hkl-interval-cos" href="hkl/hkl-hkl-interval-private.html#hkl-interval-cos">
-<ANCHOR id="hkl-interval-divides-double" href="hkl/hkl-hkl-interval-private.html#hkl-interval-divides-double">
+<ANCHOR id="hkl-hkl-interval-private.functions_details" href="hkl/hkl-hkl-interval-private.html#hkl-hkl-interval-private.functions_details">
 <ANCHOR id="hkl-interval-dup" href="hkl/hkl-hkl-interval-private.html#hkl-interval-dup">
 <ANCHOR id="hkl-interval-free" href="hkl/hkl-hkl-interval-private.html#hkl-interval-free">
-<ANCHOR id="hkl-interval-length" href="hkl/hkl-hkl-interval-private.html#hkl-interval-length">
-<ANCHOR id="hkl-interval-minus-double" href="hkl/hkl-hkl-interval-private.html#hkl-interval-minus-double">
-<ANCHOR id="hkl-interval-minus-interval" href="hkl/hkl-hkl-interval-private.html#hkl-interval-minus-interval">
-<ANCHOR id="hkl-interval-plus-double" href="hkl/hkl-hkl-interval-private.html#hkl-interval-plus-double">
+<ANCHOR id="hkl-interval-cmp" href="hkl/hkl-hkl-interval-private.html#hkl-interval-cmp">
 <ANCHOR id="hkl-interval-plus-interval" href="hkl/hkl-hkl-interval-private.html#hkl-interval-plus-interval">
+<ANCHOR id="hkl-interval-plus-double" href="hkl/hkl-hkl-interval-private.html#hkl-interval-plus-double">
+<ANCHOR id="hkl-interval-minus-interval" href="hkl/hkl-hkl-interval-private.html#hkl-interval-minus-interval">
+<ANCHOR id="hkl-interval-minus-double" href="hkl/hkl-hkl-interval-private.html#hkl-interval-minus-double">
+<ANCHOR id="hkl-interval-times-interval" href="hkl/hkl-hkl-interval-private.html#hkl-interval-times-interval">
+<ANCHOR id="hkl-interval-times-double" href="hkl/hkl-hkl-interval-private.html#hkl-interval-times-double">
+<ANCHOR id="hkl-interval-divides-double" href="hkl/hkl-hkl-interval-private.html#hkl-interval-divides-double">
+<ANCHOR id="hkl-interval-contain-zero" href="hkl/hkl-hkl-interval-private.html#hkl-interval-contain-zero">
+<ANCHOR id="hkl-interval-cos" href="hkl/hkl-hkl-interval-private.html#hkl-interval-cos">
+<ANCHOR id="hkl-interval-acos" href="hkl/hkl-hkl-interval-private.html#hkl-interval-acos">
 <ANCHOR id="hkl-interval-sin" href="hkl/hkl-hkl-interval-private.html#hkl-interval-sin">
+<ANCHOR id="hkl-interval-asin" href="hkl/hkl-hkl-interval-private.html#hkl-interval-asin">
 <ANCHOR id="hkl-interval-tan" href="hkl/hkl-hkl-interval-private.html#hkl-interval-tan">
-<ANCHOR id="hkl-interval-times-double" href="hkl/hkl-hkl-interval-private.html#hkl-interval-times-double">
-<ANCHOR id="hkl-interval-times-interval" href="hkl/hkl-hkl-interval-private.html#hkl-interval-times-interval">
+<ANCHOR id="hkl-interval-atan" href="hkl/hkl-hkl-interval-private.html#hkl-interval-atan">
+<ANCHOR id="hkl-interval-length" href="hkl/hkl-hkl-interval-private.html#hkl-interval-length">
+<ANCHOR id="hkl-interval-angle-restrict-symm" href="hkl/hkl-hkl-interval-private.html#hkl-interval-angle-restrict-symm">
+<ANCHOR id="hkl-hkl-interval-private.other_details" href="hkl/hkl-hkl-interval-private.html#hkl-hkl-interval-private.other_details">
+<ANCHOR id="HklInterval" href="hkl/hkl-hkl-interval-private.html#HklInterval">
 <ANCHOR id="hkl-hkl-lattice-private" href="hkl/hkl-hkl-lattice-private.html">
-<ANCHOR id="hkl-hkl-lattice-private.synopsis" href="hkl/hkl-hkl-lattice-private.html#hkl-hkl-lattice-private.synopsis">
+<ANCHOR id="hkl-hkl-lattice-private.functions" href="hkl/hkl-hkl-lattice-private.html#hkl-hkl-lattice-private.functions">
+<ANCHOR id="hkl-hkl-lattice-private.other" href="hkl/hkl-hkl-lattice-private.html#hkl-hkl-lattice-private.other">
 <ANCHOR id="hkl-hkl-lattice-private.description" href="hkl/hkl-hkl-lattice-private.html#hkl-hkl-lattice-private.description">
-<ANCHOR id="hkl-hkl-lattice-private.details" href="hkl/hkl-hkl-lattice-private.html#hkl-hkl-lattice-private.details">
-<ANCHOR id="HklLattice" href="hkl/hkl-hkl-lattice-private.html#HklLattice">
-<ANCHOR id="hkl-lattice-fprintf" href="hkl/hkl-hkl-lattice-private.html#hkl-lattice-fprintf">
+<ANCHOR id="hkl-hkl-lattice-private.functions_details" href="hkl/hkl-hkl-lattice-private.html#hkl-hkl-lattice-private.functions_details">
+<ANCHOR id="g-quark-from-static-string" href="hkl/hkl-hkl-lattice-private.html#g-quark-from-static-string">
 <ANCHOR id="hkl-lattice-lattice-set" href="hkl/hkl-hkl-lattice-private.html#hkl-lattice-lattice-set">
 <ANCHOR id="hkl-lattice-randomize" href="hkl/hkl-hkl-lattice-private.html#hkl-lattice-randomize">
+<ANCHOR id="hkl-lattice-fprintf" href="hkl/hkl-hkl-lattice-private.html#hkl-lattice-fprintf">
+<ANCHOR id="hkl-hkl-lattice-private.other_details" href="hkl/hkl-hkl-lattice-private.html#hkl-hkl-lattice-private.other_details">
+<ANCHOR id="HklLattice" href="hkl/hkl-hkl-lattice-private.html#HklLattice">
+<ANCHOR id="HKL-LATTICE-ERROR:CAPS" href="hkl/hkl-hkl-lattice-private.html#HKL-LATTICE-ERROR:CAPS">
+<ANCHOR id="HklLatticeError" href="hkl/hkl-hkl-lattice-private.html#HklLatticeError">
 <ANCHOR id="hkl-hkl-macros-private" href="hkl/hkl-hkl-macros-private.html">
-<ANCHOR id="hkl-hkl-macros-private.synopsis" href="hkl/hkl-hkl-macros-private.html#hkl-hkl-macros-private.synopsis">
+<ANCHOR id="hkl-hkl-macros-private.functions" href="hkl/hkl-hkl-macros-private.html#hkl-hkl-macros-private.functions">
+<ANCHOR id="hkl-hkl-macros-private.other" href="hkl/hkl-hkl-macros-private.html#hkl-hkl-macros-private.other">
 <ANCHOR id="hkl-hkl-macros-private.description" href="hkl/hkl-hkl-macros-private.html#hkl-hkl-macros-private.description">
-<ANCHOR id="hkl-hkl-macros-private.details" href="hkl/hkl-hkl-macros-private.html#hkl-hkl-macros-private.details">
-<ANCHOR id="ALLOC-GROW:CAPS" href="hkl/hkl-hkl-macros-private.html#ALLOC-GROW:CAPS">
+<ANCHOR id="hkl-hkl-macros-private.functions_details" href="hkl/hkl-hkl-macros-private.html#hkl-hkl-macros-private.functions_details">
+<ANCHOR id="hkl-assert" href="hkl/hkl-hkl-macros-private.html#hkl-assert">
+<ANCHOR id="hkl-error" href="hkl/hkl-hkl-macros-private.html#hkl-error">
 <ANCHOR id="G-GNUC-PRINTF:CAPS" href="hkl/hkl-hkl-macros-private.html#G-GNUC-PRINTF:CAPS">
-<ANCHOR id="HKL-EULERIAN-KAPPA-SOLUTION:CAPS" href="hkl/hkl-hkl-macros-private.html#HKL-EULERIAN-KAPPA-SOLUTION:CAPS">
-<ANCHOR id="HKL-MALLOC:CAPS" href="hkl/hkl-hkl-macros-private.html#HKL-MALLOC:CAPS">
-<ANCHOR id="NORETURN:CAPS" href="hkl/hkl-hkl-macros-private.html#NORETURN:CAPS">
 <ANCHOR id="alloc-nr" href="hkl/hkl-hkl-macros-private.html#alloc-nr">
-<ANCHOR id="hkl-assert" href="hkl/hkl-hkl-macros-private.html#hkl-assert">
+<ANCHOR id="ALLOC-GROW:CAPS" href="hkl/hkl-hkl-macros-private.html#ALLOC-GROW:CAPS">
+<ANCHOR id="DARRAY:CAPS" href="hkl/hkl-hkl-macros-private.html#DARRAY:CAPS">
 <ANCHOR id="hkl-printbt" href="hkl/hkl-hkl-macros-private.html#hkl-printbt">
-<ANCHOR id="hkl-return-val-if-fail" href="hkl/hkl-hkl-macros-private.html#hkl-return-val-if-fail">
+<ANCHOR id="HKL-MALLOC:CAPS" href="hkl/hkl-hkl-macros-private.html#HKL-MALLOC:CAPS">
+<ANCHOR id="hkl-hkl-macros-private.other_details" href="hkl/hkl-hkl-macros-private.html#hkl-hkl-macros-private.other_details">
+<ANCHOR id="HKL-EULERIAN-KAPPA-SOLUTION:CAPS" href="hkl/hkl-hkl-macros-private.html#HKL-EULERIAN-KAPPA-SOLUTION:CAPS">
+<ANCHOR id="NORETURN:CAPS" href="hkl/hkl-hkl-macros-private.html#NORETURN:CAPS">
 <ANCHOR id="hkl-hkl-matrix-private" href="hkl/hkl-hkl-matrix-private.html">
-<ANCHOR id="hkl-hkl-matrix-private.synopsis" href="hkl/hkl-hkl-matrix-private.html#hkl-hkl-matrix-private.synopsis">
+<ANCHOR id="hkl-hkl-matrix-private.functions" href="hkl/hkl-hkl-matrix-private.html#hkl-hkl-matrix-private.functions">
+<ANCHOR id="hkl-hkl-matrix-private.other" href="hkl/hkl-hkl-matrix-private.html#hkl-hkl-matrix-private.other">
 <ANCHOR id="hkl-hkl-matrix-private.description" href="hkl/hkl-hkl-matrix-private.html#hkl-hkl-matrix-private.description">
-<ANCHOR id="hkl-hkl-matrix-private.details" href="hkl/hkl-hkl-matrix-private.html#hkl-hkl-matrix-private.details">
-<ANCHOR id="HklMatrix" href="hkl/hkl-hkl-matrix-private.html#HklMatrix">
-<ANCHOR id="hkl-matrix-det" href="hkl/hkl-hkl-matrix-private.html#hkl-matrix-det">
+<ANCHOR id="hkl-hkl-matrix-private.functions_details" href="hkl/hkl-hkl-matrix-private.html#hkl-hkl-matrix-private.functions_details">
 <ANCHOR id="hkl-matrix-dup" href="hkl/hkl-hkl-matrix-private.html#hkl-matrix-dup">
-<ANCHOR id="hkl-matrix-fprintf" href="hkl/hkl-hkl-matrix-private.html#hkl-matrix-fprintf">
 <ANCHOR id="hkl-matrix-init-from-euler" href="hkl/hkl-hkl-matrix-private.html#hkl-matrix-init-from-euler">
-<ANCHOR id="hkl-matrix-init-from-two-vector" href="hkl/hkl-hkl-matrix-private.html#hkl-matrix-init-from-two-vector">
-<ANCHOR id="hkl-matrix-is-null" href="hkl/hkl-hkl-matrix-private.html#hkl-matrix-is-null">
 <ANCHOR id="hkl-matrix-matrix-set" href="hkl/hkl-hkl-matrix-private.html#hkl-matrix-matrix-set">
-<ANCHOR id="hkl-matrix-solve" href="hkl/hkl-hkl-matrix-private.html#hkl-matrix-solve">
-<ANCHOR id="hkl-matrix-times-vector" href="hkl/hkl-hkl-matrix-private.html#hkl-matrix-times-vector">
+<ANCHOR id="hkl-matrix-init-from-two-vector" href="hkl/hkl-hkl-matrix-private.html#hkl-matrix-init-from-two-vector">
+<ANCHOR id="hkl-matrix-fprintf" href="hkl/hkl-hkl-matrix-private.html#hkl-matrix-fprintf">
 <ANCHOR id="hkl-matrix-to-euler" href="hkl/hkl-hkl-matrix-private.html#hkl-matrix-to-euler">
+<ANCHOR id="hkl-matrix-times-vector" href="hkl/hkl-hkl-matrix-private.html#hkl-matrix-times-vector">
 <ANCHOR id="hkl-matrix-transpose" href="hkl/hkl-hkl-matrix-private.html#hkl-matrix-transpose">
+<ANCHOR id="hkl-matrix-det" href="hkl/hkl-hkl-matrix-private.html#hkl-matrix-det">
+<ANCHOR id="hkl-matrix-solve" href="hkl/hkl-hkl-matrix-private.html#hkl-matrix-solve">
+<ANCHOR id="hkl-matrix-is-null" href="hkl/hkl-hkl-matrix-private.html#hkl-matrix-is-null">
+<ANCHOR id="hkl-hkl-matrix-private.other_details" href="hkl/hkl-hkl-matrix-private.html#hkl-hkl-matrix-private.other_details">
+<ANCHOR id="HklMatrix" href="hkl/hkl-hkl-matrix-private.html#HklMatrix">
 <ANCHOR id="hkl-hkl-parameter-private" href="hkl/hkl-hkl-parameter-private.html">
-<ANCHOR id="hkl-hkl-parameter-private.synopsis" href="hkl/hkl-hkl-parameter-private.html#hkl-hkl-parameter-private.synopsis">
+<ANCHOR id="hkl-hkl-parameter-private.functions" href="hkl/hkl-hkl-parameter-private.html#hkl-hkl-parameter-private.functions">
+<ANCHOR id="hkl-hkl-parameter-private.other" href="hkl/hkl-hkl-parameter-private.html#hkl-hkl-parameter-private.other">
 <ANCHOR id="hkl-hkl-parameter-private.description" href="hkl/hkl-hkl-parameter-private.html#hkl-hkl-parameter-private.description">
-<ANCHOR id="hkl-hkl-parameter-private.details" href="hkl/hkl-hkl-parameter-private.html#hkl-hkl-parameter-private.details">
+<ANCHOR id="hkl-hkl-parameter-private.functions_details" href="hkl/hkl-hkl-parameter-private.html#hkl-hkl-parameter-private.functions_details">
+<ANCHOR id="g-quark-from-static-string" href="hkl/hkl-hkl-parameter-private.html#g-quark-from-static-string">
+<ANCHOR id="fprintf" href="hkl/hkl-hkl-parameter-private.html#fprintf">
+<ANCHOR id="hkl-parameter-new" href="hkl/hkl-hkl-parameter-private.html#hkl-parameter-new">
+<ANCHOR id="hkl-parameter-init-copy" href="hkl/hkl-hkl-parameter-private.html#hkl-parameter-init-copy">
+<ANCHOR id="hkl-parameter-value-get-closest" href="hkl/hkl-hkl-parameter-private.html#hkl-parameter-value-get-closest">
+<ANCHOR id="hkl-parameter-value-set-smallest-in-range" href="hkl/hkl-hkl-parameter-private.html#hkl-parameter-value-set-smallest-in-range">
+<ANCHOR id="hkl-parameter-is-valid" href="hkl/hkl-hkl-parameter-private.html#hkl-parameter-is-valid">
+<ANCHOR id="hkl-parameter-fprintf" href="hkl/hkl-hkl-parameter-private.html#hkl-parameter-fprintf">
+<ANCHOR id="hkl-hkl-parameter-private.other_details" href="hkl/hkl-hkl-parameter-private.html#hkl-hkl-parameter-private.other_details">
+<ANCHOR id="HklParameter" href="hkl/hkl-hkl-parameter-private.html#HklParameter">
 <ANCHOR id="HKL-PARAMETER-DEFAULTS:CAPS" href="hkl/hkl-hkl-parameter-private.html#HKL-PARAMETER-DEFAULTS:CAPS">
 <ANCHOR id="HKL-PARAMETER-DEFAULTS-ANGLE:CAPS" href="hkl/hkl-hkl-parameter-private.html#HKL-PARAMETER-DEFAULTS-ANGLE:CAPS">
-<ANCHOR id="HKL-PARAMETER-OPERATIONS-DEFAULTS:CAPS" href="hkl/hkl-hkl-parameter-private.html#HKL-PARAMETER-OPERATIONS-DEFAULTS:CAPS">
-<ANCHOR id="HklParameter" href="hkl/hkl-hkl-parameter-private.html#HklParameter">
+<ANCHOR id="HKL-PARAMETER-ERROR:CAPS" href="hkl/hkl-hkl-parameter-private.html#HKL-PARAMETER-ERROR:CAPS">
+<ANCHOR id="HklParameterError" href="hkl/hkl-hkl-parameter-private.html#HklParameterError">
 <ANCHOR id="HklParameterOperations" href="hkl/hkl-hkl-parameter-private.html#HklParameterOperations">
-<ANCHOR id="alea" href="hkl/hkl-hkl-parameter-private.html#alea">
+<ANCHOR id="HKL-PARAMETER-OPERATIONS-DEFAULTS:CAPS" href="hkl/hkl-hkl-parameter-private.html#HKL-PARAMETER-OPERATIONS-DEFAULTS:CAPS">
 <ANCHOR id="dup" href="hkl/hkl-hkl-parameter-private.html#dup">
+<ANCHOR id="alea" href="hkl/hkl-hkl-parameter-private.html#alea">
 <ANCHOR id="factor" href="hkl/hkl-hkl-parameter-private.html#factor">
-<ANCHOR id="fprintf" href="hkl/hkl-hkl-parameter-private.html#fprintf">
-<ANCHOR id="hkl-parameter-fprintf" href="hkl/hkl-hkl-parameter-private.html#hkl-parameter-fprintf">
-<ANCHOR id="hkl-parameter-init-copy" href="hkl/hkl-hkl-parameter-private.html#hkl-parameter-init-copy">
-<ANCHOR id="hkl-parameter-is-valid" href="hkl/hkl-hkl-parameter-private.html#hkl-parameter-is-valid">
-<ANCHOR id="hkl-parameter-list-fprintf" href="hkl/hkl-hkl-parameter-private.html#hkl-parameter-list-fprintf">
-<ANCHOR id="hkl-parameter-list-free" href="hkl/hkl-hkl-parameter-private.html#hkl-parameter-list-free">
-<ANCHOR id="hkl-parameter-list-values-get" href="hkl/hkl-hkl-parameter-private.html#hkl-parameter-list-values-get">
-<ANCHOR id="hkl-parameter-list-values-unit-set" href="hkl/hkl-hkl-parameter-private.html#hkl-parameter-list-values-unit-set">
-<ANCHOR id="hkl-parameter-new" href="hkl/hkl-hkl-parameter-private.html#hkl-parameter-new">
-<ANCHOR id="hkl-parameter-value-get-closest" href="hkl/hkl-hkl-parameter-private.html#hkl-parameter-value-get-closest">
-<ANCHOR id="hkl-parameter-value-set-real" href="hkl/hkl-hkl-parameter-private.html#hkl-parameter-value-set-real">
-<ANCHOR id="hkl-parameter-value-set-smallest-in-range" href="hkl/hkl-hkl-parameter-private.html#hkl-parameter-value-set-smallest-in-range">
+<ANCHOR id="darray-parameter" href="hkl/hkl-hkl-parameter-private.html#darray-parameter">
 <ANCHOR id="hkl-hkl-pseudoaxis-auto-private" href="hkl/hkl-hkl-pseudoaxis-auto-private.html">
-<ANCHOR id="hkl-hkl-pseudoaxis-auto-private.synopsis" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#hkl-hkl-pseudoaxis-auto-private.synopsis">
+<ANCHOR id="hkl-hkl-pseudoaxis-auto-private.functions" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#hkl-hkl-pseudoaxis-auto-private.functions">
+<ANCHOR id="hkl-hkl-pseudoaxis-auto-private.other" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#hkl-hkl-pseudoaxis-auto-private.other">
 <ANCHOR id="hkl-hkl-pseudoaxis-auto-private.description" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#hkl-hkl-pseudoaxis-auto-private.description">
-<ANCHOR id="hkl-hkl-pseudoaxis-auto-private.details" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#hkl-hkl-pseudoaxis-auto-private.details">
+<ANCHOR id="hkl-hkl-pseudoaxis-auto-private.functions_details" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#hkl-hkl-pseudoaxis-auto-private.functions_details">
 <ANCHOR id="CHECK-NAN:CAPS" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#CHECK-NAN:CAPS">
-<ANCHOR id="HKL-MODE-OPERATIONS-AUTO-DEFAULTS:CAPS" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-OPERATIONS-AUTO-DEFAULTS:CAPS">
-<ANCHOR id="HKL-MODE-OPERATIONS-AUTO-WITH-INIT-DEFAULTS:CAPS" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-OPERATIONS-AUTO-WITH-INIT-DEFAULTS:CAPS">
-<ANCHOR id="HklFunction" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#HklFunction">
-<ANCHOR id="HklModeAutoInfo" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoInfo">
-<ANCHOR id="HklModeAutoWithInit" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoWithInit">
-<ANCHOR id="INFO-AUTO:CAPS" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#INFO-AUTO:CAPS">
-<ANCHOR id="INFO-AUTO-WITH-PARAMS:CAPS" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#INFO-AUTO-WITH-PARAMS:CAPS">
-<ANCHOR id="hkl-mode-auto-init" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-init">
+<ANCHOR id="HKL-MODE-AUTO-INFO:CAPS" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-AUTO-INFO:CAPS">
+<ANCHOR id="HKL-MODE-AUTO-INFO-WITH-PARAMS:CAPS" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-AUTO-INFO-WITH-PARAMS:CAPS">
 <ANCHOR id="hkl-mode-auto-new" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-new">
+<ANCHOR id="hkl-mode-auto-init" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-init">
 <ANCHOR id="hkl-mode-auto-set-real" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-set-real">
+<ANCHOR id="g-quark-from-static-string" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#g-quark-from-static-string">
 <ANCHOR id="hkl-mode-auto-with-init-new" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#hkl-mode-auto-with-init-new">
+<ANCHOR id="hkl-hkl-pseudoaxis-auto-private.other_details" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#hkl-hkl-pseudoaxis-auto-private.other_details">
+<ANCHOR id="HklFunction" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#HklFunction">
+<ANCHOR id="darray-function" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#darray-function">
+<ANCHOR id="HklModeAutoInfo" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoInfo">
+<ANCHOR id="HKL-MODE-OPERATIONS-AUTO-DEFAULTS:CAPS" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-OPERATIONS-AUTO-DEFAULTS:CAPS">
+<ANCHOR id="HklModeAutoWithInit" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#HklModeAutoWithInit">
+<ANCHOR id="HKL-MODE-AUTO-WITH-INIT-ERROR:CAPS" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-AUTO-WITH-INIT-ERROR:CAPS">
+<ANCHOR id="HklModeError" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#HklModeError">
+<ANCHOR id="HKL-MODE-OPERATIONS-AUTO-WITH-INIT-DEFAULTS:CAPS" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#HKL-MODE-OPERATIONS-AUTO-WITH-INIT-DEFAULTS:CAPS">
 <ANCHOR id="self" href="hkl/hkl-hkl-pseudoaxis-auto-private.html#self">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-eulerians-private" href="hkl/hkl-hkl-pseudoaxis-common-eulerians-private.html">
-<ANCHOR id="hkl-hkl-pseudoaxis-common-eulerians-private.synopsis" href="hkl/hkl-hkl-pseudoaxis-common-eulerians-private.html#hkl-hkl-pseudoaxis-common-eulerians-private.synopsis">
+<ANCHOR id="hkl-hkl-pseudoaxis-common-eulerians-private.functions" href="hkl/hkl-hkl-pseudoaxis-common-eulerians-private.html#hkl-hkl-pseudoaxis-common-eulerians-private.functions">
+<ANCHOR id="hkl-hkl-pseudoaxis-common-eulerians-private.other" href="hkl/hkl-hkl-pseudoaxis-common-eulerians-private.html#hkl-hkl-pseudoaxis-common-eulerians-private.other">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-eulerians-private.description" href="hkl/hkl-hkl-pseudoaxis-common-eulerians-private.html#hkl-hkl-pseudoaxis-common-eulerians-private.description">
-<ANCHOR id="hkl-hkl-pseudoaxis-common-eulerians-private.details" href="hkl/hkl-hkl-pseudoaxis-common-eulerians-private.html#hkl-hkl-pseudoaxis-common-eulerians-private.details">
-<ANCHOR id="HklEngineEulerians" href="hkl/hkl-hkl-pseudoaxis-common-eulerians-private.html#HklEngineEulerians">
+<ANCHOR id="hkl-hkl-pseudoaxis-common-eulerians-private.functions_details" href="hkl/hkl-hkl-pseudoaxis-common-eulerians-private.html#hkl-hkl-pseudoaxis-common-eulerians-private.functions_details">
 <ANCHOR id="hkl-engine-eulerians-new" href="hkl/hkl-hkl-pseudoaxis-common-eulerians-private.html#hkl-engine-eulerians-new">
+<ANCHOR id="kappa-2-kappap" href="hkl/hkl-hkl-pseudoaxis-common-eulerians-private.html#kappa-2-kappap">
+<ANCHOR id="hkl-hkl-pseudoaxis-common-eulerians-private.other_details" href="hkl/hkl-hkl-pseudoaxis-common-eulerians-private.html#hkl-hkl-pseudoaxis-common-eulerians-private.other_details">
+<ANCHOR id="HklEngineEulerians" href="hkl/hkl-hkl-pseudoaxis-common-eulerians-private.html#HklEngineEulerians">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-hkl-private" href="hkl/hkl-hkl-pseudoaxis-common-hkl-private.html">
-<ANCHOR id="hkl-hkl-pseudoaxis-common-hkl-private.synopsis" href="hkl/hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-hkl-pseudoaxis-common-hkl-private.synopsis">
+<ANCHOR id="hkl-hkl-pseudoaxis-common-hkl-private.functions" href="hkl/hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-hkl-pseudoaxis-common-hkl-private.functions">
+<ANCHOR id="hkl-hkl-pseudoaxis-common-hkl-private.other" href="hkl/hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-hkl-pseudoaxis-common-hkl-private.other">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-hkl-private.description" href="hkl/hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-hkl-pseudoaxis-common-hkl-private.description">
-<ANCHOR id="hkl-hkl-pseudoaxis-common-hkl-private.details" href="hkl/hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-hkl-pseudoaxis-common-hkl-private.details">
-<ANCHOR id="HKL-MODE-OPERATIONS-HKL-DEFAULTS:CAPS" href="hkl/hkl-hkl-pseudoaxis-common-hkl-private.html#HKL-MODE-OPERATIONS-HKL-DEFAULTS:CAPS">
-<ANCHOR id="HklEngineHkl" href="hkl/hkl-hkl-pseudoaxis-common-hkl-private.html#HklEngineHkl">
+<ANCHOR id="hkl-hkl-pseudoaxis-common-hkl-private.functions_details" href="hkl/hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-hkl-pseudoaxis-common-hkl-private.functions_details">
 <ANCHOR id="RUBh-minus-Q" href="hkl/hkl-hkl-pseudoaxis-common-hkl-private.html#RUBh-minus-Q">
-<ANCHOR id="hkl-engine-hkl-new" href="hkl/hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-engine-hkl-new">
 <ANCHOR id="hkl-mode-get-hkl-real" href="hkl/hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-get-hkl-real">
-<ANCHOR id="hkl-mode-init-psi-constant-vertical-real" href="hkl/hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-init-psi-constant-vertical-real">
 <ANCHOR id="hkl-mode-set-hkl-real" href="hkl/hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-set-hkl-real">
+<ANCHOR id="hkl-mode-initialized-set-psi-constant-vertical-real" href="hkl/hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-mode-initialized-set-psi-constant-vertical-real">
+<ANCHOR id="hkl-engine-hkl-new" href="hkl/hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-engine-hkl-new">
+<ANCHOR id="CONSTANT-PARAMETER:CAPS" href="hkl/hkl-hkl-pseudoaxis-common-hkl-private.html#CONSTANT-PARAMETER:CAPS">
+<ANCHOR id="PSI-CONSTANT-PARAMETERS:CAPS" href="hkl/hkl-hkl-pseudoaxis-common-hkl-private.html#PSI-CONSTANT-PARAMETERS:CAPS">
+<ANCHOR id="hkl-hkl-pseudoaxis-common-hkl-private.other_details" href="hkl/hkl-hkl-pseudoaxis-common-hkl-private.html#hkl-hkl-pseudoaxis-common-hkl-private.other_details">
+<ANCHOR id="HklEngineHkl" href="hkl/hkl-hkl-pseudoaxis-common-hkl-private.html#HklEngineHkl">
+<ANCHOR id="HKL-MODE-OPERATIONS-HKL-DEFAULTS:CAPS" href="hkl/hkl-hkl-pseudoaxis-common-hkl-private.html#HKL-MODE-OPERATIONS-HKL-DEFAULTS:CAPS">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-psi-private" href="hkl/hkl-hkl-pseudoaxis-common-psi-private.html">
-<ANCHOR id="hkl-hkl-pseudoaxis-common-psi-private.synopsis" href="hkl/hkl-hkl-pseudoaxis-common-psi-private.html#hkl-hkl-pseudoaxis-common-psi-private.synopsis">
+<ANCHOR id="hkl-hkl-pseudoaxis-common-psi-private.functions" href="hkl/hkl-hkl-pseudoaxis-common-psi-private.html#hkl-hkl-pseudoaxis-common-psi-private.functions">
+<ANCHOR id="hkl-hkl-pseudoaxis-common-psi-private.other" href="hkl/hkl-hkl-pseudoaxis-common-psi-private.html#hkl-hkl-pseudoaxis-common-psi-private.other">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-psi-private.description" href="hkl/hkl-hkl-pseudoaxis-common-psi-private.html#hkl-hkl-pseudoaxis-common-psi-private.description">
-<ANCHOR id="hkl-hkl-pseudoaxis-common-psi-private.details" href="hkl/hkl-hkl-pseudoaxis-common-psi-private.html#hkl-hkl-pseudoaxis-common-psi-private.details">
-<ANCHOR id="HklEnginePsi" href="hkl/hkl-hkl-pseudoaxis-common-psi-private.html#HklEnginePsi">
-<ANCHOR id="HklModePsi" href="hkl/hkl-hkl-pseudoaxis-common-psi-private.html#HklModePsi">
-<ANCHOR id="hkl-engine-psi-new" href="hkl/hkl-hkl-pseudoaxis-common-psi-private.html#hkl-engine-psi-new">
+<ANCHOR id="hkl-hkl-pseudoaxis-common-psi-private.functions_details" href="hkl/hkl-hkl-pseudoaxis-common-psi-private.html#hkl-hkl-pseudoaxis-common-psi-private.functions_details">
 <ANCHOR id="hkl-mode-psi-new" href="hkl/hkl-hkl-pseudoaxis-common-psi-private.html#hkl-mode-psi-new">
+<ANCHOR id="hkl-engine-psi-new" href="hkl/hkl-hkl-pseudoaxis-common-psi-private.html#hkl-engine-psi-new">
+<ANCHOR id="hkl-hkl-pseudoaxis-common-psi-private.other_details" href="hkl/hkl-hkl-pseudoaxis-common-psi-private.html#hkl-hkl-pseudoaxis-common-psi-private.other_details">
+<ANCHOR id="HklModePsi" href="hkl/hkl-hkl-pseudoaxis-common-psi-private.html#HklModePsi">
+<ANCHOR id="HklEnginePsi" href="hkl/hkl-hkl-pseudoaxis-common-psi-private.html#HklEnginePsi">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-q-private" href="hkl/hkl-hkl-pseudoaxis-common-q-private.html">
-<ANCHOR id="hkl-hkl-pseudoaxis-common-q-private.synopsis" href="hkl/hkl-hkl-pseudoaxis-common-q-private.html#hkl-hkl-pseudoaxis-common-q-private.synopsis">
+<ANCHOR id="hkl-hkl-pseudoaxis-common-q-private.functions" href="hkl/hkl-hkl-pseudoaxis-common-q-private.html#hkl-hkl-pseudoaxis-common-q-private.functions">
+<ANCHOR id="hkl-hkl-pseudoaxis-common-q-private.other" href="hkl/hkl-hkl-pseudoaxis-common-q-private.html#hkl-hkl-pseudoaxis-common-q-private.other">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-q-private.description" href="hkl/hkl-hkl-pseudoaxis-common-q-private.html#hkl-hkl-pseudoaxis-common-q-private.description">
-<ANCHOR id="hkl-hkl-pseudoaxis-common-q-private.details" href="hkl/hkl-hkl-pseudoaxis-common-q-private.html#hkl-hkl-pseudoaxis-common-q-private.details">
+<ANCHOR id="hkl-hkl-pseudoaxis-common-q-private.functions_details" href="hkl/hkl-hkl-pseudoaxis-common-q-private.html#hkl-hkl-pseudoaxis-common-q-private.functions_details">
+<ANCHOR id="qmax" href="hkl/hkl-hkl-pseudoaxis-common-q-private.html#qmax">
+<ANCHOR id="hkl-engine-q-new" href="hkl/hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-q-new">
+<ANCHOR id="hkl-engine-q2-new" href="hkl/hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-q2-new">
+<ANCHOR id="hkl-engine-qper-qpar-new" href="hkl/hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-qper-qpar-new">
+<ANCHOR id="hkl-hkl-pseudoaxis-common-q-private.other_details" href="hkl/hkl-hkl-pseudoaxis-common-q-private.html#hkl-hkl-pseudoaxis-common-q-private.other_details">
 <ANCHOR id="HklEngineQ" href="hkl/hkl-hkl-pseudoaxis-common-q-private.html#HklEngineQ">
 <ANCHOR id="HklEngineQ2" href="hkl/hkl-hkl-pseudoaxis-common-q-private.html#HklEngineQ2">
 <ANCHOR id="HklEngineQperQpar" href="hkl/hkl-hkl-pseudoaxis-common-q-private.html#HklEngineQperQpar">
-<ANCHOR id="hkl-engine-q2-new" href="hkl/hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-q2-new">
-<ANCHOR id="hkl-engine-q-new" href="hkl/hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-q-new">
-<ANCHOR id="hkl-engine-qper-qpar-new" href="hkl/hkl-hkl-pseudoaxis-common-q-private.html#hkl-engine-qper-qpar-new">
-<ANCHOR id="hkl-hkl-pseudoaxis-e4c-private" href="hkl/hkl-hkl-pseudoaxis-e4c-private.html">
-<ANCHOR id="hkl-hkl-pseudoaxis-e4c-private.synopsis" href="hkl/hkl-hkl-pseudoaxis-e4c-private.html#hkl-hkl-pseudoaxis-e4c-private.synopsis">
-<ANCHOR id="hkl-hkl-pseudoaxis-e4c-private.description" href="hkl/hkl-hkl-pseudoaxis-e4c-private.html#hkl-hkl-pseudoaxis-e4c-private.description">
-<ANCHOR id="hkl-hkl-pseudoaxis-e4c-private.details" href="hkl/hkl-hkl-pseudoaxis-e4c-private.html#hkl-hkl-pseudoaxis-e4c-private.details">
-<ANCHOR id="hkl-engine-e4c-hkl-new" href="hkl/hkl-hkl-pseudoaxis-e4c-private.html#hkl-engine-e4c-hkl-new">
-<ANCHOR id="hkl-engine-e4c-psi-new" href="hkl/hkl-hkl-pseudoaxis-e4c-private.html#hkl-engine-e4c-psi-new">
-<ANCHOR id="hkl-hkl-pseudoaxis-e6c-private" href="hkl/hkl-hkl-pseudoaxis-e6c-private.html">
-<ANCHOR id="hkl-hkl-pseudoaxis-e6c-private.synopsis" href="hkl/hkl-hkl-pseudoaxis-e6c-private.html#hkl-hkl-pseudoaxis-e6c-private.synopsis">
-<ANCHOR id="hkl-hkl-pseudoaxis-e6c-private.description" href="hkl/hkl-hkl-pseudoaxis-e6c-private.html#hkl-hkl-pseudoaxis-e6c-private.description">
-<ANCHOR id="hkl-hkl-pseudoaxis-e6c-private.details" href="hkl/hkl-hkl-pseudoaxis-e6c-private.html#hkl-hkl-pseudoaxis-e6c-private.details">
-<ANCHOR id="hkl-engine-e6c-hkl-new" href="hkl/hkl-hkl-pseudoaxis-e6c-private.html#hkl-engine-e6c-hkl-new">
-<ANCHOR id="hkl-engine-e6c-psi-new" href="hkl/hkl-hkl-pseudoaxis-e6c-private.html#hkl-engine-e6c-psi-new">
-<ANCHOR id="hkl-hkl-pseudoaxis-k4cv-private" href="hkl/hkl-hkl-pseudoaxis-k4cv-private.html">
-<ANCHOR id="hkl-hkl-pseudoaxis-k4cv-private.synopsis" href="hkl/hkl-hkl-pseudoaxis-k4cv-private.html#hkl-hkl-pseudoaxis-k4cv-private.synopsis">
-<ANCHOR id="hkl-hkl-pseudoaxis-k4cv-private.description" href="hkl/hkl-hkl-pseudoaxis-k4cv-private.html#hkl-hkl-pseudoaxis-k4cv-private.description">
-<ANCHOR id="hkl-hkl-pseudoaxis-k4cv-private.details" href="hkl/hkl-hkl-pseudoaxis-k4cv-private.html#hkl-hkl-pseudoaxis-k4cv-private.details">
-<ANCHOR id="hkl-engine-k4cv-hkl-new" href="hkl/hkl-hkl-pseudoaxis-k4cv-private.html#hkl-engine-k4cv-hkl-new">
-<ANCHOR id="hkl-engine-k4cv-psi-new" href="hkl/hkl-hkl-pseudoaxis-k4cv-private.html#hkl-engine-k4cv-psi-new">
-<ANCHOR id="hkl-hkl-pseudoaxis-k6c-private" href="hkl/hkl-hkl-pseudoaxis-k6c-private.html">
-<ANCHOR id="hkl-hkl-pseudoaxis-k6c-private.synopsis" href="hkl/hkl-hkl-pseudoaxis-k6c-private.html#hkl-hkl-pseudoaxis-k6c-private.synopsis">
-<ANCHOR id="hkl-hkl-pseudoaxis-k6c-private.description" href="hkl/hkl-hkl-pseudoaxis-k6c-private.html#hkl-hkl-pseudoaxis-k6c-private.description">
-<ANCHOR id="hkl-hkl-pseudoaxis-k6c-private.details" href="hkl/hkl-hkl-pseudoaxis-k6c-private.html#hkl-hkl-pseudoaxis-k6c-private.details">
-<ANCHOR id="hkl-engine-k6c-hkl-new" href="hkl/hkl-hkl-pseudoaxis-k6c-private.html#hkl-engine-k6c-hkl-new">
-<ANCHOR id="hkl-engine-k6c-psi-new" href="hkl/hkl-hkl-pseudoaxis-k6c-private.html#hkl-engine-k6c-psi-new">
-<ANCHOR id="hkl-hkl-pseudoaxis-petra3-private" href="hkl/hkl-hkl-pseudoaxis-petra3-private.html">
-<ANCHOR id="hkl-hkl-pseudoaxis-petra3-private.synopsis" href="hkl/hkl-hkl-pseudoaxis-petra3-private.html#hkl-hkl-pseudoaxis-petra3-private.synopsis">
-<ANCHOR id="hkl-hkl-pseudoaxis-petra3-private.description" href="hkl/hkl-hkl-pseudoaxis-petra3-private.html#hkl-hkl-pseudoaxis-petra3-private.description">
-<ANCHOR id="hkl-hkl-pseudoaxis-petra3-private.details" href="hkl/hkl-hkl-pseudoaxis-petra3-private.html#hkl-hkl-pseudoaxis-petra3-private.details">
-<ANCHOR id="hkl-engine-petra3-p09-eh2-hkl-new" href="hkl/hkl-hkl-pseudoaxis-petra3-private.html#hkl-engine-petra3-p09-eh2-hkl-new">
 <ANCHOR id="hkl-hkl-pseudoaxis-private" href="hkl/hkl-hkl-pseudoaxis-private.html">
-<ANCHOR id="hkl-hkl-pseudoaxis-private.synopsis" href="hkl/hkl-hkl-pseudoaxis-private.html#hkl-hkl-pseudoaxis-private.synopsis">
+<ANCHOR id="hkl-hkl-pseudoaxis-private.functions" href="hkl/hkl-hkl-pseudoaxis-private.html#hkl-hkl-pseudoaxis-private.functions">
+<ANCHOR id="hkl-hkl-pseudoaxis-private.other" href="hkl/hkl-hkl-pseudoaxis-private.html#hkl-hkl-pseudoaxis-private.other">
 <ANCHOR id="hkl-hkl-pseudoaxis-private.description" href="hkl/hkl-hkl-pseudoaxis-private.html#hkl-hkl-pseudoaxis-private.description">
-<ANCHOR id="hkl-hkl-pseudoaxis-private.details" href="hkl/hkl-hkl-pseudoaxis-private.html#hkl-hkl-pseudoaxis-private.details">
-<ANCHOR id="HKL-ENGINE-OPERATIONS-DEFAULTS:CAPS" href="hkl/hkl-hkl-pseudoaxis-private.html#HKL-ENGINE-OPERATIONS-DEFAULTS:CAPS">
+<ANCHOR id="hkl-hkl-pseudoaxis-private.functions_details" href="hkl/hkl-hkl-pseudoaxis-private.html#hkl-hkl-pseudoaxis-private.functions_details">
+<ANCHOR id="HKL-MODE-INFO:CAPS" href="hkl/hkl-hkl-pseudoaxis-private.html#HKL-MODE-INFO:CAPS">
+<ANCHOR id="HKL-MODE-INFO-WITH-PARAMS:CAPS" href="hkl/hkl-hkl-pseudoaxis-private.html#HKL-MODE-INFO-WITH-PARAMS:CAPS">
+<ANCHOR id="g-quark-from-static-string" href="hkl/hkl-hkl-pseudoaxis-private.html#g-quark-from-static-string">
+<ANCHOR id="hkl-hkl-pseudoaxis-private.other_details" href="hkl/hkl-hkl-pseudoaxis-private.html#hkl-hkl-pseudoaxis-private.other_details">
+<ANCHOR id="darray-mode" href="hkl/hkl-hkl-pseudoaxis-private.html#darray-mode">
+<ANCHOR id="HklPseudoAxis" href="hkl/hkl-hkl-pseudoaxis-private.html#HklPseudoAxis">
+<ANCHOR id="HKL-PARAMETER-OPERATIONS-PSEUDOAXIS-DEFAULTS:CAPS" href="hkl/hkl-hkl-pseudoaxis-private.html#HKL-PARAMETER-OPERATIONS-PSEUDOAXIS-DEFAULTS:CAPS">
+<ANCHOR id="pseudo-axis" href="hkl/hkl-hkl-pseudoaxis-private.html#pseudo-axis">
+<ANCHOR id="dup" href="hkl/hkl-hkl-pseudoaxis-private.html#dup">
+<ANCHOR id="HklModeInfo" href="hkl/hkl-hkl-pseudoaxis-private.html#HklModeInfo">
+<ANCHOR id="HklModeOperations" href="hkl/hkl-hkl-pseudoaxis-private.html#HklModeOperations">
 <ANCHOR id="HKL-MODE-OPERATIONS-DEFAULTS:CAPS" href="hkl/hkl-hkl-pseudoaxis-private.html#HKL-MODE-OPERATIONS-DEFAULTS:CAPS">
-<ANCHOR id="HklEngine" href="hkl/hkl-hkl-pseudoaxis-private.html#HklEngine">
+<ANCHOR id="HklMode" href="hkl/hkl-hkl-pseudoaxis-private.html#HklMode">
+<ANCHOR id="self" href="hkl/hkl-hkl-pseudoaxis-private.html#self">
 <ANCHOR id="HklEngineInfo" href="hkl/hkl-hkl-pseudoaxis-private.html#HklEngineInfo">
+<ANCHOR id="HklEngine" href="hkl/hkl-hkl-pseudoaxis-private.html#HklEngine">
 <ANCHOR id="HklEngineList" href="hkl/hkl-hkl-pseudoaxis-private.html#HklEngineList">
-<ANCHOR id="HklEngineOperations" href="hkl/hkl-hkl-pseudoaxis-private.html#HklEngineOperations">
-<ANCHOR id="HklMode" href="hkl/hkl-hkl-pseudoaxis-private.html#HklMode">
-<ANCHOR id="HklModeInfo" href="hkl/hkl-hkl-pseudoaxis-private.html#HklModeInfo">
-<ANCHOR id="HklModeOperations" href="hkl/hkl-hkl-pseudoaxis-private.html#HklModeOperations">
-<ANCHOR id="HklPseudoAxis" href="hkl/hkl-hkl-pseudoaxis-private.html#HklPseudoAxis">
-<ANCHOR id="INFO:CAPS" href="hkl/hkl-hkl-pseudoaxis-private.html#INFO:CAPS">
-<ANCHOR id="INFO-WITH-PARAMS:CAPS" href="hkl/hkl-hkl-pseudoaxis-private.html#INFO-WITH-PARAMS:CAPS">
-<ANCHOR id="hkl-engine-init" href="hkl/hkl-hkl-pseudoaxis-private.html#hkl-engine-init">
-<ANCHOR id="hkl-engine-list-add" href="hkl/hkl-hkl-pseudoaxis-private.html#hkl-engine-list-add">
-<ANCHOR id="hkl-engine-list-clear" href="hkl/hkl-hkl-pseudoaxis-private.html#hkl-engine-list-clear">
-<ANCHOR id="hkl-engine-list-new" href="hkl/hkl-hkl-pseudoaxis-private.html#hkl-engine-list-new">
-<ANCHOR id="hkl-engine-list-new-copy" href="hkl/hkl-hkl-pseudoaxis-private.html#hkl-engine-list-new-copy">
-<ANCHOR id="hkl-parameter-new-pseudo-axis" href="hkl/hkl-hkl-pseudoaxis-private.html#hkl-parameter-new-pseudo-axis">
+<ANCHOR id="HKL-ENGINE-ERROR:CAPS" href="hkl/hkl-hkl-pseudoaxis-private.html#HKL-ENGINE-ERROR:CAPS">
+<ANCHOR id="HklEngineError" href="hkl/hkl-hkl-pseudoaxis-private.html#HklEngineError">
 <ANCHOR id="i" href="hkl/hkl-hkl-pseudoaxis-private.html#i">
-<ANCHOR id="register-pseudo-axis" href="hkl/hkl-hkl-pseudoaxis-private.html#register-pseudo-axis">
-<ANCHOR id="self" href="hkl/hkl-hkl-pseudoaxis-private.html#self">
-<ANCHOR id="unregister-pseudo-axis" href="hkl/hkl-hkl-pseudoaxis-private.html#unregister-pseudo-axis">
-<ANCHOR id="hkl-hkl-pseudoaxis-soleil-sixs-med-private" href="hkl/hkl-hkl-pseudoaxis-soleil-sixs-med-private.html">
-<ANCHOR id="hkl-hkl-pseudoaxis-soleil-sixs-med-private.synopsis" href="hkl/hkl-hkl-pseudoaxis-soleil-sixs-med-private.html#hkl-hkl-pseudoaxis-soleil-sixs-med-private.synopsis">
-<ANCHOR id="hkl-hkl-pseudoaxis-soleil-sixs-med-private.description" href="hkl/hkl-hkl-pseudoaxis-soleil-sixs-med-private.html#hkl-hkl-pseudoaxis-soleil-sixs-med-private.description">
-<ANCHOR id="hkl-hkl-pseudoaxis-soleil-sixs-med-private.details" href="hkl/hkl-hkl-pseudoaxis-soleil-sixs-med-private.html#hkl-hkl-pseudoaxis-soleil-sixs-med-private.details">
-<ANCHOR id="hkl-engine-soleil-sixs-med-1-2-hkl-new" href="hkl/hkl-hkl-pseudoaxis-soleil-sixs-med-private.html#hkl-engine-soleil-sixs-med-1-2-hkl-new">
-<ANCHOR id="hkl-engine-soleil-sixs-med-2-2-hkl-new" href="hkl/hkl-hkl-pseudoaxis-soleil-sixs-med-private.html#hkl-engine-soleil-sixs-med-2-2-hkl-new">
-<ANCHOR id="hkl-engine-soleil-sixs-med-2-3-hkl-new" href="hkl/hkl-hkl-pseudoaxis-soleil-sixs-med-private.html#hkl-engine-soleil-sixs-med-2-3-hkl-new">
-<ANCHOR id="hkl-geometry-list-multiply-soleil-sixs-med-2-3" href="hkl/hkl-hkl-pseudoaxis-soleil-sixs-med-private.html#hkl-geometry-list-multiply-soleil-sixs-med-2-3">
-<ANCHOR id="hkl-hkl-pseudoaxis-zaxis-private" href="hkl/hkl-hkl-pseudoaxis-zaxis-private.html">
-<ANCHOR id="hkl-hkl-pseudoaxis-zaxis-private.synopsis" href="hkl/hkl-hkl-pseudoaxis-zaxis-private.html#hkl-hkl-pseudoaxis-zaxis-private.synopsis">
-<ANCHOR id="hkl-hkl-pseudoaxis-zaxis-private.description" href="hkl/hkl-hkl-pseudoaxis-zaxis-private.html#hkl-hkl-pseudoaxis-zaxis-private.description">
-<ANCHOR id="hkl-hkl-pseudoaxis-zaxis-private.details" href="hkl/hkl-hkl-pseudoaxis-zaxis-private.html#hkl-hkl-pseudoaxis-zaxis-private.details">
-<ANCHOR id="hkl-engine-zaxis-hkl-new" href="hkl/hkl-hkl-pseudoaxis-zaxis-private.html#hkl-engine-zaxis-hkl-new">
+<ANCHOR id="HklEngineOperations" href="hkl/hkl-hkl-pseudoaxis-private.html#HklEngineOperations">
+<ANCHOR id="HKL-ENGINE-OPERATIONS-DEFAULTS:CAPS" href="hkl/hkl-hkl-pseudoaxis-private.html#HKL-ENGINE-OPERATIONS-DEFAULTS:CAPS">
+<ANCHOR id="axis" href="hkl/hkl-hkl-pseudoaxis-private.html#axis">
+<ANCHOR id="HKL-ENGINE-LIST-ERROR:CAPS" href="hkl/hkl-hkl-pseudoaxis-private.html#HKL-ENGINE-LIST-ERROR:CAPS">
+<ANCHOR id="HklEngineListError" href="hkl/hkl-hkl-pseudoaxis-private.html#HklEngineListError">
 <ANCHOR id="hkl-hkl-quaternion-private" href="hkl/hkl-hkl-quaternion-private.html">
-<ANCHOR id="hkl-hkl-quaternion-private.synopsis" href="hkl/hkl-hkl-quaternion-private.html#hkl-hkl-quaternion-private.synopsis">
+<ANCHOR id="hkl-hkl-quaternion-private.functions" href="hkl/hkl-hkl-quaternion-private.html#hkl-hkl-quaternion-private.functions">
 <ANCHOR id="hkl-hkl-quaternion-private.description" href="hkl/hkl-hkl-quaternion-private.html#hkl-hkl-quaternion-private.description">
-<ANCHOR id="hkl-hkl-quaternion-private.details" href="hkl/hkl-hkl-quaternion-private.html#hkl-hkl-quaternion-private.details">
-<ANCHOR id="HklQuaternion" href="hkl/hkl-hkl-quaternion-private.html#HklQuaternion">
-<ANCHOR id="hkl-quaternion-cmp" href="hkl/hkl-hkl-quaternion-private.html#hkl-quaternion-cmp">
-<ANCHOR id="hkl-quaternion-conjugate" href="hkl/hkl-hkl-quaternion-private.html#hkl-quaternion-conjugate">
+<ANCHOR id="hkl-hkl-quaternion-private.functions_details" href="hkl/hkl-hkl-quaternion-private.html#hkl-hkl-quaternion-private.functions_details">
 <ANCHOR id="hkl-quaternion-dup" href="hkl/hkl-hkl-quaternion-private.html#hkl-quaternion-dup">
-<ANCHOR id="hkl-quaternion-fprintf" href="hkl/hkl-hkl-quaternion-private.html#hkl-quaternion-fprintf">
 <ANCHOR id="hkl-quaternion-free" href="hkl/hkl-hkl-quaternion-private.html#hkl-quaternion-free">
 <ANCHOR id="hkl-quaternion-init" href="hkl/hkl-hkl-quaternion-private.html#hkl-quaternion-init">
-<ANCHOR id="hkl-quaternion-init-from-angle-and-axe" href="hkl/hkl-hkl-quaternion-private.html#hkl-quaternion-init-from-angle-and-axe">
 <ANCHOR id="hkl-quaternion-init-from-vector" href="hkl/hkl-hkl-quaternion-private.html#hkl-quaternion-init-from-vector">
+<ANCHOR id="hkl-quaternion-init-from-angle-and-axe" href="hkl/hkl-hkl-quaternion-private.html#hkl-quaternion-init-from-angle-and-axe">
+<ANCHOR id="hkl-quaternion-fprintf" href="hkl/hkl-hkl-quaternion-private.html#hkl-quaternion-fprintf">
+<ANCHOR id="hkl-quaternion-cmp" href="hkl/hkl-hkl-quaternion-private.html#hkl-quaternion-cmp">
 <ANCHOR id="hkl-quaternion-minus-quaternion" href="hkl/hkl-hkl-quaternion-private.html#hkl-quaternion-minus-quaternion">
-<ANCHOR id="hkl-quaternion-norm2" href="hkl/hkl-hkl-quaternion-private.html#hkl-quaternion-norm2">
 <ANCHOR id="hkl-quaternion-times-quaternion" href="hkl/hkl-hkl-quaternion-private.html#hkl-quaternion-times-quaternion">
-<ANCHOR id="hkl-quaternion-to-angle-and-axe" href="hkl/hkl-hkl-quaternion-private.html#hkl-quaternion-to-angle-and-axe">
+<ANCHOR id="hkl-quaternion-norm2" href="hkl/hkl-hkl-quaternion-private.html#hkl-quaternion-norm2">
+<ANCHOR id="hkl-quaternion-conjugate" href="hkl/hkl-hkl-quaternion-private.html#hkl-quaternion-conjugate">
 <ANCHOR id="hkl-quaternion-to-matrix" href="hkl/hkl-hkl-quaternion-private.html#hkl-quaternion-to-matrix">
+<ANCHOR id="hkl-quaternion-to-angle-and-axe" href="hkl/hkl-hkl-quaternion-private.html#hkl-quaternion-to-angle-and-axe">
+<ANCHOR id="hkl-hkl-quaternion-private.other_details" href="hkl/hkl-hkl-quaternion-private.html#hkl-hkl-quaternion-private.other_details">
 <ANCHOR id="hkl-hkl-sample-private" href="hkl/hkl-hkl-sample-private.html">
-<ANCHOR id="hkl-hkl-sample-private.synopsis" href="hkl/hkl-hkl-sample-private.html#hkl-hkl-sample-private.synopsis">
+<ANCHOR id="hkl-hkl-sample-private.functions" href="hkl/hkl-hkl-sample-private.html#hkl-hkl-sample-private.functions">
+<ANCHOR id="hkl-hkl-sample-private.other" href="hkl/hkl-hkl-sample-private.html#hkl-hkl-sample-private.other">
 <ANCHOR id="hkl-hkl-sample-private.description" href="hkl/hkl-hkl-sample-private.html#hkl-hkl-sample-private.description">
-<ANCHOR id="hkl-hkl-sample-private.details" href="hkl/hkl-hkl-sample-private.html#hkl-hkl-sample-private.details">
-<ANCHOR id="HklSample" href="hkl/hkl-hkl-sample-private.html#HklSample">
-<ANCHOR id="HklSampleReflection" href="hkl/hkl-hkl-sample-private.html#HklSampleReflection">
+<ANCHOR id="hkl-hkl-sample-private.functions_details" href="hkl/hkl-hkl-sample-private.html#hkl-hkl-sample-private.functions_details">
+<ANCHOR id="g-quark-from-static-string" href="hkl/hkl-hkl-sample-private.html#g-quark-from-static-string">
 <ANCHOR id="hkl-sample-fprintf" href="hkl/hkl-hkl-sample-private.html#hkl-sample-fprintf">
-<ANCHOR id="hkl-sample-reflection-free" href="hkl/hkl-hkl-sample-private.html#hkl-sample-reflection-free">
 <ANCHOR id="hkl-sample-reflection-new-copy" href="hkl/hkl-hkl-sample-private.html#hkl-sample-reflection-new-copy">
+<ANCHOR id="hkl-sample-reflection-free" href="hkl/hkl-hkl-sample-private.html#hkl-sample-reflection-free">
+<ANCHOR id="hkl-hkl-sample-private.other_details" href="hkl/hkl-hkl-sample-private.html#hkl-hkl-sample-private.other_details">
+<ANCHOR id="HklSample" href="hkl/hkl-hkl-sample-private.html#HklSample">
+<ANCHOR id="HKL-SAMPLE-ERROR:CAPS" href="hkl/hkl-hkl-sample-private.html#HKL-SAMPLE-ERROR:CAPS">
+<ANCHOR id="HklSampleError" href="hkl/hkl-hkl-sample-private.html#HklSampleError">
+<ANCHOR id="HklSampleReflection" href="hkl/hkl-hkl-sample-private.html#HklSampleReflection">
+<ANCHOR id="HKL-SAMPLE-REFLECTION-ERROR:CAPS" href="hkl/hkl-hkl-sample-private.html#HKL-SAMPLE-REFLECTION-ERROR:CAPS">
+<ANCHOR id="HklSampleReflectionError" href="hkl/hkl-hkl-sample-private.html#HklSampleReflectionError">
 <ANCHOR id="hkl-hkl-source-private" href="hkl/hkl-hkl-source-private.html">
-<ANCHOR id="hkl-hkl-source-private.synopsis" href="hkl/hkl-hkl-source-private.html#hkl-hkl-source-private.synopsis">
+<ANCHOR id="hkl-hkl-source-private.functions" href="hkl/hkl-hkl-source-private.html#hkl-hkl-source-private.functions">
+<ANCHOR id="hkl-hkl-source-private.other" href="hkl/hkl-hkl-source-private.html#hkl-hkl-source-private.other">
 <ANCHOR id="hkl-hkl-source-private.description" href="hkl/hkl-hkl-source-private.html#hkl-hkl-source-private.description">
-<ANCHOR id="hkl-hkl-source-private.details" href="hkl/hkl-hkl-source-private.html#hkl-hkl-source-private.details">
+<ANCHOR id="hkl-hkl-source-private.functions_details" href="hkl/hkl-hkl-source-private.html#hkl-hkl-source-private.functions_details">
 <ANCHOR id="HKL-SOURCE-DEFAULT-WAVE-LENGTH:CAPS" href="hkl/hkl-hkl-source-private.html#HKL-SOURCE-DEFAULT-WAVE-LENGTH:CAPS">
-<ANCHOR id="HklSource" href="hkl/hkl-hkl-source-private.html#HklSource">
-<ANCHOR id="hkl-source-cmp" href="hkl/hkl-hkl-source-private.html#hkl-source-cmp">
-<ANCHOR id="hkl-source-compute-ki" href="hkl/hkl-hkl-source-private.html#hkl-source-compute-ki">
 <ANCHOR id="hkl-source-dup" href="hkl/hkl-hkl-source-private.html#hkl-source-dup">
-<ANCHOR id="hkl-source-fprintf" href="hkl/hkl-hkl-source-private.html#hkl-source-fprintf">
 <ANCHOR id="hkl-source-free" href="hkl/hkl-hkl-source-private.html#hkl-source-free">
-<ANCHOR id="hkl-source-get-wavelength" href="hkl/hkl-hkl-source-private.html#hkl-source-get-wavelength">
 <ANCHOR id="hkl-source-init" href="hkl/hkl-hkl-source-private.html#hkl-source-init">
+<ANCHOR id="hkl-source-cmp" href="hkl/hkl-hkl-source-private.html#hkl-source-cmp">
+<ANCHOR id="hkl-source-compute-ki" href="hkl/hkl-hkl-source-private.html#hkl-source-compute-ki">
+<ANCHOR id="hkl-source-get-wavelength" href="hkl/hkl-hkl-source-private.html#hkl-source-get-wavelength">
+<ANCHOR id="hkl-source-fprintf" href="hkl/hkl-hkl-source-private.html#hkl-source-fprintf">
+<ANCHOR id="hkl-hkl-source-private.other_details" href="hkl/hkl-hkl-source-private.html#hkl-hkl-source-private.other_details">
+<ANCHOR id="HklSource" href="hkl/hkl-hkl-source-private.html#HklSource">
 <ANCHOR id="hkl-hkl-type-builtins" href="hkl/hkl-hkl-type-builtins.html">
-<ANCHOR id="hkl-hkl-type-builtins.synopsis" href="hkl/hkl-hkl-type-builtins.html#hkl-hkl-type-builtins.synopsis">
+<ANCHOR id="hkl-hkl-type-builtins.functions" href="hkl/hkl-hkl-type-builtins.html#hkl-hkl-type-builtins.functions">
 <ANCHOR id="hkl-hkl-type-builtins.description" href="hkl/hkl-hkl-type-builtins.html#hkl-hkl-type-builtins.description">
-<ANCHOR id="hkl-hkl-type-builtins.details" href="hkl/hkl-hkl-type-builtins.html#hkl-hkl-type-builtins.details">
+<ANCHOR id="hkl-hkl-type-builtins.functions_details" href="hkl/hkl-hkl-type-builtins.html#hkl-hkl-type-builtins.functions_details">
+<ANCHOR id="HKL-TYPE-UNIT-ENUM:CAPS" href="hkl/hkl-hkl-type-builtins.html#HKL-TYPE-UNIT-ENUM:CAPS">
 <ANCHOR id="HKL-TYPE-DETECTOR-TYPE:CAPS" href="hkl/hkl-hkl-type-builtins.html#HKL-TYPE-DETECTOR-TYPE:CAPS">
+<ANCHOR id="HKL-TYPE-ENGINE-CAPABILITIES:CAPS" href="hkl/hkl-hkl-type-builtins.html#HKL-TYPE-ENGINE-CAPABILITIES:CAPS">
+<ANCHOR id="HKL-TYPE-ENGINE-AXIS-NAMES-GET:CAPS" href="hkl/hkl-hkl-type-builtins.html#HKL-TYPE-ENGINE-AXIS-NAMES-GET:CAPS">
+<ANCHOR id="hkl-hkl-type-builtins.other_details" href="hkl/hkl-hkl-type-builtins.html#hkl-hkl-type-builtins.other_details">
 <ANCHOR id="hkl-hkl-types" href="hkl/hkl-hkl-types.html">
-<ANCHOR id="hkl-hkl-types.synopsis" href="hkl/hkl-hkl-types.html#hkl-hkl-types.synopsis">
+<ANCHOR id="hkl-hkl-types.functions" href="hkl/hkl-hkl-types.html#hkl-hkl-types.functions">
 <ANCHOR id="hkl-hkl-types.description" href="hkl/hkl-hkl-types.html#hkl-hkl-types.description">
-<ANCHOR id="hkl-hkl-types.details" href="hkl/hkl-hkl-types.html#hkl-hkl-types.details">
-<ANCHOR id="TYPE-HKL-AXIS:CAPS" href="hkl/hkl-hkl-types.html#TYPE-HKL-AXIS:CAPS">
+<ANCHOR id="hkl-hkl-types.functions_details" href="hkl/hkl-hkl-types.html#hkl-hkl-types.functions_details">
 <ANCHOR id="TYPE-HKL-DETECTOR:CAPS" href="hkl/hkl-hkl-types.html#TYPE-HKL-DETECTOR:CAPS">
 <ANCHOR id="TYPE-HKL-ENGINE:CAPS" href="hkl/hkl-hkl-types.html#TYPE-HKL-ENGINE:CAPS">
 <ANCHOR id="TYPE-HKL-ENGINE-LIST:CAPS" href="hkl/hkl-hkl-types.html#TYPE-HKL-ENGINE-LIST:CAPS">
-<ANCHOR id="TYPE-HKL-ERROR:CAPS" href="hkl/hkl-hkl-types.html#TYPE-HKL-ERROR:CAPS">
+<ANCHOR id="TYPE-HKL-FACTORY:CAPS" href="hkl/hkl-hkl-types.html#TYPE-HKL-FACTORY:CAPS">
 <ANCHOR id="TYPE-HKL-GEOMETRY:CAPS" href="hkl/hkl-hkl-types.html#TYPE-HKL-GEOMETRY:CAPS">
 <ANCHOR id="TYPE-HKL-GEOMETRY-LIST:CAPS" href="hkl/hkl-hkl-types.html#TYPE-HKL-GEOMETRY-LIST:CAPS">
 <ANCHOR id="TYPE-HKL-GEOMETRY-LIST-ITEM:CAPS" href="hkl/hkl-hkl-types.html#TYPE-HKL-GEOMETRY-LIST-ITEM:CAPS">
 <ANCHOR id="TYPE-HKL-LATTICE:CAPS" href="hkl/hkl-hkl-types.html#TYPE-HKL-LATTICE:CAPS">
 <ANCHOR id="TYPE-HKL-MATRIX:CAPS" href="hkl/hkl-hkl-types.html#TYPE-HKL-MATRIX:CAPS">
 <ANCHOR id="TYPE-HKL-PARAMETER:CAPS" href="hkl/hkl-hkl-types.html#TYPE-HKL-PARAMETER:CAPS">
-<ANCHOR id="TYPE-HKL-PARAMETER-LIST:CAPS" href="hkl/hkl-hkl-types.html#TYPE-HKL-PARAMETER-LIST:CAPS">
-<ANCHOR id="TYPE-HKL-PSEUDO-AXIS:CAPS" href="hkl/hkl-hkl-types.html#TYPE-HKL-PSEUDO-AXIS:CAPS">
-<ANCHOR id="TYPE-HKL-SAMPLE:CAPS" href="hkl/hkl-hkl-types.html#TYPE-HKL-SAMPLE:CAPS">
 <ANCHOR id="TYPE-HKL-SAMPLE-REFLECTION:CAPS" href="hkl/hkl-hkl-types.html#TYPE-HKL-SAMPLE-REFLECTION:CAPS">
+<ANCHOR id="TYPE-HKL-SAMPLE:CAPS" href="hkl/hkl-hkl-types.html#TYPE-HKL-SAMPLE:CAPS">
 <ANCHOR id="TYPE-HKL-UNIT:CAPS" href="hkl/hkl-hkl-types.html#TYPE-HKL-UNIT:CAPS">
 <ANCHOR id="TYPE-HKL-VECTOR:CAPS" href="hkl/hkl-hkl-types.html#TYPE-HKL-VECTOR:CAPS">
+<ANCHOR id="hkl-hkl-types.other_details" href="hkl/hkl-hkl-types.html#hkl-hkl-types.other_details">
 <ANCHOR id="hkl-hkl-unit-private" href="hkl/hkl-hkl-unit-private.html">
-<ANCHOR id="hkl-hkl-unit-private.synopsis" href="hkl/hkl-hkl-unit-private.html#hkl-hkl-unit-private.synopsis">
+<ANCHOR id="hkl-hkl-unit-private.functions" href="hkl/hkl-hkl-unit-private.html#hkl-hkl-unit-private.functions">
+<ANCHOR id="hkl-hkl-unit-private.other" href="hkl/hkl-hkl-unit-private.html#hkl-hkl-unit-private.other">
 <ANCHOR id="hkl-hkl-unit-private.description" href="hkl/hkl-hkl-unit-private.html#hkl-hkl-unit-private.description">
-<ANCHOR id="hkl-hkl-unit-private.details" href="hkl/hkl-hkl-unit-private.html#hkl-hkl-unit-private.details">
-<ANCHOR id="HklUnit" href="hkl/hkl-hkl-unit-private.html#HklUnit">
-<ANCHOR id="HklUnitType" href="hkl/hkl-hkl-unit-private.html#HklUnitType">
-<ANCHOR id="hkl-unit-compatible" href="hkl/hkl-hkl-unit-private.html#hkl-unit-compatible">
+<ANCHOR id="hkl-hkl-unit-private.functions_details" href="hkl/hkl-hkl-unit-private.html#hkl-hkl-unit-private.functions_details">
 <ANCHOR id="hkl-unit-dup" href="hkl/hkl-hkl-unit-private.html#hkl-unit-dup">
-<ANCHOR id="hkl-unit-factor" href="hkl/hkl-hkl-unit-private.html#hkl-unit-factor">
 <ANCHOR id="hkl-unit-free" href="hkl/hkl-hkl-unit-private.html#hkl-unit-free">
+<ANCHOR id="hkl-unit-compatible" href="hkl/hkl-hkl-unit-private.html#hkl-unit-compatible">
+<ANCHOR id="hkl-unit-factor" href="hkl/hkl-hkl-unit-private.html#hkl-unit-factor">
+<ANCHOR id="hkl-hkl-unit-private.other_details" href="hkl/hkl-hkl-unit-private.html#hkl-hkl-unit-private.other_details">
+<ANCHOR id="HklUnitType" href="hkl/hkl-hkl-unit-private.html#HklUnitType">
+<ANCHOR id="HklUnit" href="hkl/hkl-hkl-unit-private.html#HklUnit">
 <ANCHOR id="hkl-hkl-vector-private" href="hkl/hkl-hkl-vector-private.html">
-<ANCHOR id="hkl-hkl-vector-private.synopsis" href="hkl/hkl-hkl-vector-private.html#hkl-hkl-vector-private.synopsis">
+<ANCHOR id="hkl-hkl-vector-private.functions" href="hkl/hkl-hkl-vector-private.html#hkl-hkl-vector-private.functions">
 <ANCHOR id="hkl-hkl-vector-private.description" href="hkl/hkl-hkl-vector-private.html#hkl-hkl-vector-private.description">
-<ANCHOR id="hkl-hkl-vector-private.details" href="hkl/hkl-hkl-vector-private.html#hkl-hkl-vector-private.details">
-<ANCHOR id="HklQuaternion" href="hkl/hkl-hkl-vector-private.html#HklQuaternion">
-<ANCHOR id="HklVector" href="hkl/hkl-hkl-vector-private.html#HklVector">
-<ANCHOR id="hkl-vector-add-vector" href="hkl/hkl-hkl-vector-private.html#hkl-vector-add-vector">
-<ANCHOR id="hkl-vector-angle" href="hkl/hkl-hkl-vector-private.html#hkl-vector-angle">
-<ANCHOR id="hkl-vector-cmp" href="hkl/hkl-hkl-vector-private.html#hkl-vector-cmp">
-<ANCHOR id="hkl-vector-div-double" href="hkl/hkl-hkl-vector-private.html#hkl-vector-div-double">
+<ANCHOR id="hkl-hkl-vector-private.functions_details" href="hkl/hkl-hkl-vector-private.html#hkl-hkl-vector-private.functions_details">
 <ANCHOR id="hkl-vector-dup" href="hkl/hkl-hkl-vector-private.html#hkl-vector-dup">
-<ANCHOR id="hkl-vector-fprintf" href="hkl/hkl-hkl-vector-private.html#hkl-vector-fprintf">
 <ANCHOR id="hkl-vector-free" href="hkl/hkl-hkl-vector-private.html#hkl-vector-free">
 <ANCHOR id="hkl-vector-init" href="hkl/hkl-hkl-vector-private.html#hkl-vector-init">
-<ANCHOR id="hkl-vector-is-colinear" href="hkl/hkl-hkl-vector-private.html#hkl-vector-is-colinear">
-<ANCHOR id="hkl-vector-is-null" href="hkl/hkl-hkl-vector-private.html#hkl-vector-is-null">
+<ANCHOR id="hkl-vector-fprintf" href="hkl/hkl-hkl-vector-private.html#hkl-vector-fprintf">
+<ANCHOR id="hkl-vector-cmp" href="hkl/hkl-hkl-vector-private.html#hkl-vector-cmp">
 <ANCHOR id="hkl-vector-is-opposite" href="hkl/hkl-hkl-vector-private.html#hkl-vector-is-opposite">
+<ANCHOR id="hkl-vector-add-vector" href="hkl/hkl-hkl-vector-private.html#hkl-vector-add-vector">
 <ANCHOR id="hkl-vector-minus-vector" href="hkl/hkl-hkl-vector-private.html#hkl-vector-minus-vector">
-<ANCHOR id="hkl-vector-norm2" href="hkl/hkl-hkl-vector-private.html#hkl-vector-norm2">
-<ANCHOR id="hkl-vector-normalize" href="hkl/hkl-hkl-vector-private.html#hkl-vector-normalize">
+<ANCHOR id="hkl-vector-div-double" href="hkl/hkl-hkl-vector-private.html#hkl-vector-div-double">
+<ANCHOR id="hkl-vector-times-double" href="hkl/hkl-hkl-vector-private.html#hkl-vector-times-double">
+<ANCHOR id="hkl-vector-times-vector" href="hkl/hkl-hkl-vector-private.html#hkl-vector-times-vector">
+<ANCHOR id="hkl-vector-times-matrix" href="hkl/hkl-hkl-vector-private.html#hkl-vector-times-matrix">
+<ANCHOR id="hkl-vector-sum" href="hkl/hkl-hkl-vector-private.html#hkl-vector-sum">
+<ANCHOR id="hkl-vector-scalar-product" href="hkl/hkl-hkl-vector-private.html#hkl-vector-scalar-product">
+<ANCHOR id="hkl-vector-vectorial-product" href="hkl/hkl-hkl-vector-private.html#hkl-vector-vectorial-product">
+<ANCHOR id="hkl-vector-angle" href="hkl/hkl-hkl-vector-private.html#hkl-vector-angle">
 <ANCHOR id="hkl-vector-oriented-angle" href="hkl/hkl-hkl-vector-private.html#hkl-vector-oriented-angle">
 <ANCHOR id="hkl-vector-oriented-angle-points" href="hkl/hkl-hkl-vector-private.html#hkl-vector-oriented-angle-points">
-<ANCHOR id="hkl-vector-project-on-plan" href="hkl/hkl-hkl-vector-private.html#hkl-vector-project-on-plan">
-<ANCHOR id="hkl-vector-project-on-plan-with-point" href="hkl/hkl-hkl-vector-private.html#hkl-vector-project-on-plan-with-point">
+<ANCHOR id="hkl-vector-norm2" href="hkl/hkl-hkl-vector-private.html#hkl-vector-norm2">
+<ANCHOR id="hkl-vector-normalize" href="hkl/hkl-hkl-vector-private.html#hkl-vector-normalize">
+<ANCHOR id="hkl-vector-is-colinear" href="hkl/hkl-hkl-vector-private.html#hkl-vector-is-colinear">
 <ANCHOR id="hkl-vector-randomize" href="hkl/hkl-hkl-vector-private.html#hkl-vector-randomize">
 <ANCHOR id="hkl-vector-randomize-vector" href="hkl/hkl-hkl-vector-private.html#hkl-vector-randomize-vector">
 <ANCHOR id="hkl-vector-randomize-vector-vector" href="hkl/hkl-hkl-vector-private.html#hkl-vector-randomize-vector-vector">
-<ANCHOR id="hkl-vector-rotated-around-line" href="hkl/hkl-hkl-vector-private.html#hkl-vector-rotated-around-line">
 <ANCHOR id="hkl-vector-rotated-around-vector" href="hkl/hkl-hkl-vector-private.html#hkl-vector-rotated-around-vector">
 <ANCHOR id="hkl-vector-rotated-quaternion" href="hkl/hkl-hkl-vector-private.html#hkl-vector-rotated-quaternion">
-<ANCHOR id="hkl-vector-scalar-product" href="hkl/hkl-hkl-vector-private.html#hkl-vector-scalar-product">
-<ANCHOR id="hkl-vector-sum" href="hkl/hkl-hkl-vector-private.html#hkl-vector-sum">
-<ANCHOR id="hkl-vector-times-double" href="hkl/hkl-hkl-vector-private.html#hkl-vector-times-double">
-<ANCHOR id="hkl-vector-times-matrix" href="hkl/hkl-hkl-vector-private.html#hkl-vector-times-matrix">
-<ANCHOR id="hkl-vector-times-vector" href="hkl/hkl-hkl-vector-private.html#hkl-vector-times-vector">
-<ANCHOR id="hkl-vector-vectorial-product" href="hkl/hkl-hkl-vector-private.html#hkl-vector-vectorial-product">
+<ANCHOR id="hkl-vector-rotated-around-line" href="hkl/hkl-hkl-vector-private.html#hkl-vector-rotated-around-line">
+<ANCHOR id="hkl-vector-is-null" href="hkl/hkl-hkl-vector-private.html#hkl-vector-is-null">
+<ANCHOR id="hkl-vector-project-on-plan" href="hkl/hkl-hkl-vector-private.html#hkl-vector-project-on-plan">
+<ANCHOR id="hkl-vector-project-on-plan-with-point" href="hkl/hkl-hkl-vector-private.html#hkl-vector-project-on-plan-with-point">
+<ANCHOR id="hkl-hkl-vector-private.other_details" href="hkl/hkl-hkl-vector-private.html#hkl-hkl-vector-private.other_details">
 <ANCHOR id="hkl-list" href="hkl/hkl-list.html">
-<ANCHOR id="hkl-list.synopsis" href="hkl/hkl-list.html#hkl-list.synopsis">
+<ANCHOR id="hkl-list.functions" href="hkl/hkl-list.html#hkl-list.functions">
+<ANCHOR id="hkl-list.other" href="hkl/hkl-list.html#hkl-list.other">
 <ANCHOR id="hkl-list.description" href="hkl/hkl-list.html#hkl-list.description">
-<ANCHOR id="hkl-list.details" href="hkl/hkl-list.html#hkl-list.details">
-<ANCHOR id="LIST-HEAD:CAPS" href="hkl/hkl-list.html#LIST-HEAD:CAPS">
-<ANCHOR id="LIST-HEAD-INIT:CAPS" href="hkl/hkl-list.html#LIST-HEAD-INIT:CAPS">
-<ANCHOR id="list-add-off" href="hkl/hkl-list.html#list-add-off">
+<ANCHOR id="hkl-list.functions_details" href="hkl/hkl-list.html#hkl-list.functions_details">
 <ANCHOR id="list-check" href="hkl/hkl-list.html#list-check">
 <ANCHOR id="list-check-node" href="hkl/hkl-list.html#list-check-node">
 <ANCHOR id="list-debug" href="hkl/hkl-list.html#list-debug">
 <ANCHOR id="list-debug-node" href="hkl/hkl-list.html#list-debug-node">
-<ANCHOR id="list-del-from-off" href="hkl/hkl-list.html#list-del-from-off">
-<ANCHOR id="list-del-off" href="hkl/hkl-list.html#list-del-off">
+<ANCHOR id="LIST-HEAD-INIT:CAPS" href="hkl/hkl-list.html#LIST-HEAD-INIT:CAPS">
+<ANCHOR id="LIST-HEAD:CAPS" href="hkl/hkl-list.html#LIST-HEAD:CAPS">
+<ANCHOR id="list-add" href="hkl/hkl-list.html#list-add">
+<ANCHOR id="list-add-tail" href="hkl/hkl-list.html#list-add-tail">
+<ANCHOR id="list-empty" href="hkl/hkl-list.html#list-empty">
+<ANCHOR id="list-empty-nodebug" href="hkl/hkl-list.html#list-empty-nodebug">
+<ANCHOR id="list-del" href="hkl/hkl-list.html#list-del">
 <ANCHOR id="list-entry" href="hkl/hkl-list.html#list-entry">
-<ANCHOR id="list-entry-off" href="hkl/hkl-list.html#list-entry-off">
+<ANCHOR id="list-top" href="hkl/hkl-list.html#list-top">
+<ANCHOR id="list-pop" href="hkl/hkl-list.html#list-pop">
+<ANCHOR id="list-tail" href="hkl/hkl-list.html#list-tail">
 <ANCHOR id="list-for-each" href="hkl/hkl-list.html#list-for-each">
-<ANCHOR id="list-for-each-off" href="hkl/hkl-list.html#list-for-each-off">
 <ANCHOR id="list-for-each-rev" href="hkl/hkl-list.html#list-for-each-rev">
 <ANCHOR id="list-for-each-safe" href="hkl/hkl-list.html#list-for-each-safe">
+<ANCHOR id="list-next" href="hkl/hkl-list.html#list-next">
+<ANCHOR id="list-prev" href="hkl/hkl-list.html#list-prev">
+<ANCHOR id="list-append-list" href="hkl/hkl-list.html#list-append-list">
+<ANCHOR id="list-prepend-list" href="hkl/hkl-list.html#list-prepend-list">
+<ANCHOR id="list-for-each-off" href="hkl/hkl-list.html#list-for-each-off">
 <ANCHOR id="list-for-each-safe-off" href="hkl/hkl-list.html#list-for-each-safe-off">
+<ANCHOR id="list-entry-off" href="hkl/hkl-list.html#list-entry-off">
 <ANCHOR id="list-head-off" href="hkl/hkl-list.html#list-head-off">
+<ANCHOR id="list-tail-off" href="hkl/hkl-list.html#list-tail-off">
+<ANCHOR id="list-add-off" href="hkl/hkl-list.html#list-add-off">
+<ANCHOR id="list-del-off" href="hkl/hkl-list.html#list-del-off">
+<ANCHOR id="list-del-from-off" href="hkl/hkl-list.html#list-del-from-off">
 <ANCHOR id="list-off-" href="hkl/hkl-list.html#list-off-">
 <ANCHOR id="list-off-var-" href="hkl/hkl-list.html#list-off-var-">
-<ANCHOR id="list-pop" href="hkl/hkl-list.html#list-pop">
-<ANCHOR id="list-tail" href="hkl/hkl-list.html#list-tail">
-<ANCHOR id="list-tail-off" href="hkl/hkl-list.html#list-tail-off">
-<ANCHOR id="list-top" href="hkl/hkl-list.html#list-top">
+<ANCHOR id="list-typeof" href="hkl/hkl-list.html#list-typeof">
+<ANCHOR id="hkl-list.other_details" href="hkl/hkl-list.html#hkl-list.other_details">
+<ANCHOR id="list-node" href="hkl/hkl-list.html#list-node">
+<ANCHOR id="list-head" href="hkl/hkl-list.html#list-head">
+<ANCHOR id="LIST-LOC:CAPS" href="hkl/hkl-list.html#LIST-LOC:CAPS">
 <ANCHOR id="hkl-noerr" href="hkl/hkl-noerr.html">
-<ANCHOR id="hkl-noerr.synopsis" href="hkl/hkl-noerr.html#hkl-noerr.synopsis">
+<ANCHOR id="hkl-noerr.functions" href="hkl/hkl-noerr.html#hkl-noerr.functions">
 <ANCHOR id="hkl-noerr.description" href="hkl/hkl-noerr.html#hkl-noerr.description">
-<ANCHOR id="hkl-noerr.details" href="hkl/hkl-noerr.html#hkl-noerr.details">
+<ANCHOR id="hkl-noerr.functions_details" href="hkl/hkl-noerr.html#hkl-noerr.functions_details">
 <ANCHOR id="close-noerr" href="hkl/hkl-noerr.html#close-noerr">
 <ANCHOR id="fclose-noerr" href="hkl/hkl-noerr.html#fclose-noerr">
 <ANCHOR id="unlink-noerr" href="hkl/hkl-noerr.html#unlink-noerr">
+<ANCHOR id="hkl-noerr.other_details" href="hkl/hkl-noerr.html#hkl-noerr.other_details">
 <ANCHOR id="hkl-ptr-valid" href="hkl/hkl-ptr-valid.html">
-<ANCHOR id="hkl-ptr-valid.synopsis" href="hkl/hkl-ptr-valid.html#hkl-ptr-valid.synopsis">
+<ANCHOR id="hkl-ptr-valid.functions" href="hkl/hkl-ptr-valid.html#hkl-ptr-valid.functions">
+<ANCHOR id="hkl-ptr-valid.other" href="hkl/hkl-ptr-valid.html#hkl-ptr-valid.other">
 <ANCHOR id="hkl-ptr-valid.description" href="hkl/hkl-ptr-valid.html#hkl-ptr-valid.description">
-<ANCHOR id="hkl-ptr-valid.details" href="hkl/hkl-ptr-valid.html#hkl-ptr-valid.details">
-<ANCHOR id="PTR-VALID-ALIGNOF:CAPS" href="hkl/hkl-ptr-valid.html#PTR-VALID-ALIGNOF:CAPS">
+<ANCHOR id="hkl-ptr-valid.functions_details" href="hkl/hkl-ptr-valid.html#hkl-ptr-valid.functions_details">
+<ANCHOR id="ptr-valid-read" href="hkl/hkl-ptr-valid.html#ptr-valid-read">
+<ANCHOR id="ptr-valid-write" href="hkl/hkl-ptr-valid.html#ptr-valid-write">
+<ANCHOR id="ptr-valid-string" href="hkl/hkl-ptr-valid.html#ptr-valid-string">
 <ANCHOR id="ptr-valid" href="hkl/hkl-ptr-valid.html#ptr-valid">
-<ANCHOR id="ptr-valid-batch" href="hkl/hkl-ptr-valid.html#ptr-valid-batch">
-<ANCHOR id="ptr-valid-batch-end" href="hkl/hkl-ptr-valid.html#ptr-valid-batch-end">
-<ANCHOR id="ptr-valid-batch-read" href="hkl/hkl-ptr-valid.html#ptr-valid-batch-read">
 <ANCHOR id="ptr-valid-batch-start" href="hkl/hkl-ptr-valid.html#ptr-valid-batch-start">
-<ANCHOR id="ptr-valid-batch-string" href="hkl/hkl-ptr-valid.html#ptr-valid-batch-string">
+<ANCHOR id="ptr-valid-batch-read" href="hkl/hkl-ptr-valid.html#ptr-valid-batch-read">
 <ANCHOR id="ptr-valid-batch-write" href="hkl/hkl-ptr-valid.html#ptr-valid-batch-write">
-<ANCHOR id="ptr-valid-read" href="hkl/hkl-ptr-valid.html#ptr-valid-read">
-<ANCHOR id="ptr-valid-string" href="hkl/hkl-ptr-valid.html#ptr-valid-string">
-<ANCHOR id="ptr-valid-write" href="hkl/hkl-ptr-valid.html#ptr-valid-write">
-<ANCHOR id="annotation-glossterm-array" href="hkl/annotation-glossary.html#annotation-glossterm-array">
-<ANCHOR id="annotation-glossterm-out" href="hkl/annotation-glossary.html#annotation-glossterm-out">
+<ANCHOR id="ptr-valid-batch-string" href="hkl/hkl-ptr-valid.html#ptr-valid-batch-string">
+<ANCHOR id="ptr-valid-batch-end" href="hkl/hkl-ptr-valid.html#ptr-valid-batch-end">
+<ANCHOR id="PTR-VALID-ALIGNOF:CAPS" href="hkl/hkl-ptr-valid.html#PTR-VALID-ALIGNOF:CAPS">
+<ANCHOR id="hkl-ptr-valid.other_details" href="hkl/hkl-ptr-valid.html#hkl-ptr-valid.other_details">
+<ANCHOR id="ptr-valid-batch" href="hkl/hkl-ptr-valid.html#ptr-valid-batch">
+<ANCHOR id="ptr-valid-map" href="hkl/hkl-ptr-valid.html#ptr-valid-map">
+<ANCHOR id="hkl-str" href="hkl/hkl-str.html">
+<ANCHOR id="hkl-str.functions" href="hkl/hkl-str.html#hkl-str.functions">
+<ANCHOR id="hkl-str.description" href="hkl/hkl-str.html#hkl-str.description">
+<ANCHOR id="hkl-str.functions_details" href="hkl/hkl-str.html#hkl-str.functions_details">
+<ANCHOR id="streq" href="hkl/hkl-str.html#streq">
+<ANCHOR id="strstarts" href="hkl/hkl-str.html#strstarts">
+<ANCHOR id="stringify" href="hkl/hkl-str.html#stringify">
+<ANCHOR id="stringify-1" href="hkl/hkl-str.html#stringify-1">
+<ANCHOR id="strcount" href="hkl/hkl-str.html#strcount">
+<ANCHOR id="STR-MAX-CHARS:CAPS" href="hkl/hkl-str.html#STR-MAX-CHARS:CAPS">
+<ANCHOR id="STR-MAX-CHARS-TCHECK-:CAPS" href="hkl/hkl-str.html#STR-MAX-CHARS-TCHECK-:CAPS">
+<ANCHOR id="isalnum" href="hkl/hkl-str.html#isalnum">
+<ANCHOR id="isalpha" href="hkl/hkl-str.html#isalpha">
+<ANCHOR id="isascii" href="hkl/hkl-str.html#isascii">
+<ANCHOR id="isblank" href="hkl/hkl-str.html#isblank">
+<ANCHOR id="iscntrl" href="hkl/hkl-str.html#iscntrl">
+<ANCHOR id="isdigit" href="hkl/hkl-str.html#isdigit">
+<ANCHOR id="isgraph" href="hkl/hkl-str.html#isgraph">
+<ANCHOR id="islower" href="hkl/hkl-str.html#islower">
+<ANCHOR id="isprint" href="hkl/hkl-str.html#isprint">
+<ANCHOR id="ispunct" href="hkl/hkl-str.html#ispunct">
+<ANCHOR id="isspace" href="hkl/hkl-str.html#isspace">
+<ANCHOR id="isupper" href="hkl/hkl-str.html#isupper">
+<ANCHOR id="isxdigit" href="hkl/hkl-str.html#isxdigit">
+<ANCHOR id="str-check-arg-" href="hkl/hkl-str.html#str-check-arg-">
+<ANCHOR id="strstr" href="hkl/hkl-str.html#strstr">
+<ANCHOR id="strchr" href="hkl/hkl-str.html#strchr">
+<ANCHOR id="strrchr" href="hkl/hkl-str.html#strrchr">
+<ANCHOR id="hkl-str.other_details" href="hkl/hkl-str.html#hkl-str.other_details">
+<ANCHOR id="hkl-str-debug" href="hkl/hkl-str-debug.html">
+<ANCHOR id="hkl-str-debug.functions" href="hkl/hkl-str-debug.html#hkl-str-debug.functions">
+<ANCHOR id="hkl-str-debug.description" href="hkl/hkl-str-debug.html#hkl-str-debug.description">
+<ANCHOR id="hkl-str-debug.functions_details" href="hkl/hkl-str-debug.html#hkl-str-debug.functions_details">
+<ANCHOR id="str-isalnum" href="hkl/hkl-str-debug.html#str-isalnum">
+<ANCHOR id="str-isalpha" href="hkl/hkl-str-debug.html#str-isalpha">
+<ANCHOR id="str-isascii" href="hkl/hkl-str-debug.html#str-isascii">
+<ANCHOR id="str-isblank" href="hkl/hkl-str-debug.html#str-isblank">
+<ANCHOR id="str-iscntrl" href="hkl/hkl-str-debug.html#str-iscntrl">
+<ANCHOR id="str-isdigit" href="hkl/hkl-str-debug.html#str-isdigit">
+<ANCHOR id="str-isgraph" href="hkl/hkl-str-debug.html#str-isgraph">
+<ANCHOR id="str-islower" href="hkl/hkl-str-debug.html#str-islower">
+<ANCHOR id="str-isprint" href="hkl/hkl-str-debug.html#str-isprint">
+<ANCHOR id="str-ispunct" href="hkl/hkl-str-debug.html#str-ispunct">
+<ANCHOR id="str-isspace" href="hkl/hkl-str-debug.html#str-isspace">
+<ANCHOR id="str-isupper" href="hkl/hkl-str-debug.html#str-isupper">
+<ANCHOR id="str-isxdigit" href="hkl/hkl-str-debug.html#str-isxdigit">
+<ANCHOR id="str-strstr" href="hkl/hkl-str-debug.html#str-strstr">
+<ANCHOR id="str-strchr" href="hkl/hkl-str-debug.html#str-strchr">
+<ANCHOR id="str-strrchr" href="hkl/hkl-str-debug.html#str-strrchr">
+<ANCHOR id="hkl-str-debug.other_details" href="hkl/hkl-str-debug.html#hkl-str-debug.other_details">
 <ANCHOR id="annotation-glossterm-in" href="hkl/annotation-glossary.html#annotation-glossterm-in">
-<ANCHOR id="annotation-glossterm-transfer full" href="hkl/annotation-glossary.html#annotation-glossterm-transfer full">
+<ANCHOR id="annotation-glossterm-out caller-allocates" href="hkl/annotation-glossary.html#annotation-glossterm-out caller-allocates">
 <ANCHOR id="annotation-glossterm-transfer none" href="hkl/annotation-glossary.html#annotation-glossterm-transfer none">
diff --git a/Documentation/api/html/left-insensitive.png b/Documentation/api/html/left-insensitive.png
new file mode 100644
index 0000000..3269393
Binary files /dev/null and b/Documentation/api/html/left-insensitive.png differ
diff --git a/Documentation/api/html/left.png b/Documentation/api/html/left.png
index 2d05b3d..2abde03 100644
Binary files a/Documentation/api/html/left.png and b/Documentation/api/html/left.png differ
diff --git a/Documentation/api/html/object-tree.html b/Documentation/api/html/object-tree.html
index 0f4799e..d847291 100644
--- a/Documentation/api/html/object-tree.html
+++ b/Documentation/api/html/object-tree.html
@@ -2,31 +2,32 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>Object Hierarchy</title>
+<title>hkl Reference Manual: Object Hierarchy</title>
 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="index.html" title="hkl Reference Manual">
-<link rel="prev" href="hkl-ptr-valid.html" title="ptr_valid">
+<link rel="prev" href="hkl-str-debug.html" title="str_debug">
 <link rel="next" href="api-index-full.html" title="API Index">
-<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
-<td><a accesskey="p" href="hkl-ptr-valid.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
-<td> </td>
-<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<th width="100%" align="center">hkl Reference Manual</th>
-<td><a accesskey="n" href="api-index-full.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
+<td width="100%" align="left" class="shortcuts"></td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
+<td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
+<td><a accesskey="p" href="hkl-str-debug.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
+<td><a accesskey="n" href="api-index-full.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
 </tr></table>
 <div class="chapter">
 <div class="titlepage"><div><div><h1 class="title">
 <a name="object-tree"></a>Object Hierarchy</h1></div></div></div>
 <pre class="screen">
+
 </pre>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.18</div>
+          Generated by GTK-Doc V1.21</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/right-insensitive.png b/Documentation/api/html/right-insensitive.png
new file mode 100644
index 0000000..4c95785
Binary files /dev/null and b/Documentation/api/html/right-insensitive.png differ
diff --git a/Documentation/api/html/right.png b/Documentation/api/html/right.png
index 92832e3..76260ec 100644
Binary files a/Documentation/api/html/right.png and b/Documentation/api/html/right.png differ
diff --git a/Documentation/api/html/style.css b/Documentation/api/html/style.css
index d6f6c26..c141ddd 100644
--- a/Documentation/api/html/style.css
+++ b/Documentation/api/html/style.css
@@ -1,15 +1,23 @@
+body
+{
+  font-family: cantarell, sans-serif;
+}
 .synopsis, .classsynopsis
 {
   /* tango:aluminium 1/2 */
   background: #eeeeec;
-  border: solid 1px #d3d7cf;
+  background: rgba(238, 238, 236, 0.5);
+  border: solid 1px rgb(238, 238, 236);
   padding: 0.5em;
 }
 .programlisting
 {
   /* tango:sky blue 0/1 */
+  /* fallback for no rgba support */
   background: #e6f3ff;
   border: solid 1px #729fcf;
+  background: rgba(114, 159, 207, 0.1);
+  border: solid 1px rgba(114, 159, 207, 0.2);
   padding: 0.5em;
 }
 .variablelist
@@ -22,89 +30,6 @@
   vertical-align: top;
 }
 
- at media screen {
-  sup a.footnote
-  {
-    position: relative;
-    top: 0em ! important;
-    
-  }
-  /* this is needed so that the local anchors are displayed below the naviagtion */
-  div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name]
-  {
-    display: inline-block;
-    position: relative;
-    top:-5em;
-  }
-  /* this seems to be a bug in the xsl style sheets when generating indexes */
-  div.index div.index
-  {
-    top: 0em;
-  }
-  /* make space for the fixed navigation bar and add space at the bottom so that
-   * link targets appear somewhat close to top
-   */
-  body
-  {
-    padding-top: 3.2em;
-    padding-bottom: 20em;
-  }
-  /* style and size the navigation bar */
-  table.navigation#top
-  {
-    position: fixed;
-    /* tango:scarlet red 0/1 */
-    background: #ffe6e6;
-    border: solid 1px #ef2929;
-    margin-top: 0;
-    margin-bottom: 0;
-    top: 0;
-    left: 0;
-    height: 3em;
-    z-index: 10;
-  }
-  .navigation a, .navigation a:visited
-  {
-    /* tango:scarlet red 3 */
-    color: #a40000;
-  }
-  .navigation a:hover
-  {
-    /* tango:scarlet red 1 */
-    color: #ef2929;
-  }
-  td.shortcuts
-  {
-    /* tango:scarlet red 1 */
-    color: #ef2929;
-    font-size: 80%;
-    white-space: nowrap;
-  }
-}
- at media print {
-  table.navigation {
-    visibility: collapse;
-    display: none;
-  }
-  div.titlepage table.navigation {
-    visibility: visible;
-    display: table;
-    /* tango:scarlet red 0/1 */
-    background: #ffe6e6;
-    border: solid 1px #ef2929;
-    margin-top: 0;
-    margin-bottom: 0;
-    top: 0;
-    left: 0;
-    height: 3em;
-  }
-}
-
-.navigation .title
-{
-  font-size: 200%;
-}
-
 div.gallery-float
 {
   float: left;
@@ -132,6 +57,72 @@ a:hover
   color: #729fcf;
 }
 
+div.informaltable table
+{
+  border-collapse: separate;
+  border-spacing: 1em 0.5em;
+  border: none;
+}
+
+div.informaltable table td, div.informaltable table th
+{
+  vertical-align: top;
+}
+
+.function_type,
+.variable_type,
+.property_type,
+.signal_type,
+.parameter_name,
+.struct_member_name,
+.union_member_name,
+.define_keyword,
+.datatype_keyword,
+.typedef_keyword
+{
+  text-align: right;
+}
+
+/* dim non-primary columns */
+.c_punctuation,
+.function_type,
+.variable_type,
+.property_type,
+.signal_type,
+.define_keyword,
+.datatype_keyword,
+.typedef_keyword,
+.property_flags,
+.signal_flags,
+.parameter_annotations,
+.enum_member_annotations,
+.struct_member_annotations,
+.union_member_annotations
+{
+  color: #888a85;
+}
+
+.function_type a,
+.function_type a:visited,
+.function_type a:hover,
+.property_type a,
+.property_type a:visited,
+.property_type a:hover,
+.signal_type a,
+.signal_type a:visited,
+.signal_type a:hover,
+.signal_flags a,
+.signal_flags a:visited,
+.signal_flags a:hover
+{
+ color: #729fcf;
+}
+
+td p
+{
+  margin: 0.25em;
+}
+
 div.table table
 {
   border-collapse: collapse;
@@ -154,14 +145,43 @@ div.table table th
   background-color: #d3d7cf;
 }
 
+h4
+{
+  color: #555753;
+}
+
 hr
 {
-  /* tango:aluminium 3 */
-  color: #babdb6;
-  background: #babdb6;
+  /* tango:aluminium 1 */
+  color: #d3d7cf;
+  background: #d3d7cf;
   border: none 0px;
   height: 1px;
   clear: both;
+  margin: 2.0em 0em 2.0em 0em;
+}
+
+dl.toc dt
+{
+  padding-bottom: 0.25em;
+}
+
+dl.toc > dd > dl > dt
+{
+  padding-top: 0.25em;
+  padding-bottom: 0.25em;
+}
+
+dl.toc > dt
+{
+  padding-top: 1em;
+  padding-bottom: 0.5em;
+  font-weight: bold;
+}
+
+.parameter
+{
+  font-style: normal;
 }
 
 .footer
@@ -173,31 +193,70 @@ hr
   font-size: 80%;
 }
 
+.informalfigure,
+.figure
+{
+  margin: 1em;
+}
+
+.informalexample,
+.example
+{
+  margin-top: 1em;
+  margin-bottom: 1em;
+}
+
 .warning
 {
   /* tango:orange 0/1 */
   background: #ffeed9;
+  background: rgba(252, 175, 62, 0.1);
   border-color: #ffb04f;
+  border-color: rgba(252, 175, 62, 0.2);
 }
 .note
 {
   /* tango:chameleon 0/0.5 */
   background: #d8ffb2;
+  background: rgba(138, 226, 52, 0.1);
   border-color: #abf562;
+  border-color: rgba(138, 226, 52, 0.2);
 }
-.note, .warning
+div.blockquote
+{
+  border-color: #eeeeec;
+}
+.note, .warning, div.blockquote
 {
   padding: 0.5em;
   border-width: 1px;
   border-style: solid;
+  margin: 2em;
 }
-.note h3, .warning h3
+.note p, .warning p
 {
-  margin-top: 0.0em
+  margin: 0;
 }
-.note p, .warning p
+
+div.warning h3.title,
+div.note h3.title
+{
+  display: none;
+}
+
+p + div.section
 {
-  margin-bottom: 0.0em
+  margin-top: 1em;
+}
+
+div.refnamediv,
+div.refsynopsisdiv,
+div.refsect1,
+div.refsect2,
+div.toc,
+div.section
+{
+  margin-bottom: 1em;
 }
 
 /* blob links */
@@ -210,33 +269,52 @@ h2 .extralinks, h3 .extralinks
   font-weight: normal;
 }
 
+.lineart
+{
+  color: #d3d7cf;
+  font-weight: normal;
+}
+
 .annotation
 {
   /* tango:aluminium 5 */
   color: #555753;
-  font-size: 80%;
   font-weight: normal;
 }
 
+.structfield
+{
+  font-style: normal;
+  font-weight: normal;
+}
+
+acronym,abbr 
+{
+  border-bottom: 1px dotted gray;
+}
+
 /* code listings */
 
-.listing_code .programlisting .cbracket   { color: #a40000; } /* tango: scarlet red 3 */
-.listing_code .programlisting .comment    { color: #a1a39d; } /* tango: aluminium 4 */
-.listing_code .programlisting .function   { color: #000000; font-weight: bold; }
-.listing_code .programlisting .function a { color: #11326b; font-weight: bold; } /* tango: sky blue 4 */
-.listing_code .programlisting .keyword    { color: #4e9a06; } /* tango: chameleon 3  */
+.listing_code .programlisting .normal,
+.listing_code .programlisting .normal a,
+.listing_code .programlisting .number,
+.listing_code .programlisting .cbracket,
+.listing_code .programlisting .symbol     { color: #555753; }
+.listing_code .programlisting .comment,
 .listing_code .programlisting .linenum    { color: #babdb6; } /* tango: aluminium 3 */
-.listing_code .programlisting .normal     { color: #000000; }
-.listing_code .programlisting .number     { color: #75507b; } /* tango: plum 2 */
+.listing_code .programlisting .function,
+.listing_code .programlisting .function a,
 .listing_code .programlisting .preproc    { color: #204a87; } /* tango: sky blue 3  */
-.listing_code .programlisting .string     { color: #c17d11; } /* tango: chocolate 2 */
-.listing_code .programlisting .type       { color: #000000; }
-.listing_code .programlisting .type a     { color: #11326b; } /* tango: sky blue 4 */
-.listing_code .programlisting .symbol     { color: #ce5c00; } /* tango: orange 3 */
+.listing_code .programlisting .string     { color: #ad7fa8; } /* tango: plum */
+.listing_code .programlisting .keyword,
+.listing_code .programlisting .usertype,
+.listing_code .programlisting .type,
+.listing_code .programlisting .type a     { color: #4e9a06; } /* tango: chameleon 3  */
 
 .listing_frame {
   /* tango:sky blue 1 */
   border: solid 1px #729fcf;
+  border: solid 1px rgba(114, 159, 207, 0.2);
   padding: 0px;
 }
 
@@ -248,19 +326,151 @@ h2 .extralinks, h3 .extralinks
 .listing_lines {
   /* tango:sky blue 0.5 */
   background: #a6c5e3;
+  background: rgba(114, 159, 207, 0.2);
   /* tango:aluminium 6 */
   color: #2e3436;
 }
 .listing_code {
   /* tango:sky blue 0 */
   background: #e6f3ff;
+  background: rgba(114, 159, 207, 0.1);
 }
 .listing_code .programlisting {
   /* override from previous */
   border: none 0px;
   padding: 0px;
+  background: none;
 }
 .listing_lines pre, .listing_code pre {
   margin: 0px;
 }
 
+ at media screen {
+  sup a.footnote
+  {
+    position: relative;
+    top: 0em ! important;
+  }
+  /* this is needed so that the local anchors are displayed below the naviagtion */
+  div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name]
+  {
+    display: inline-block;
+    position: relative;
+    top:-5em;
+  }
+  /* this seems to be a bug in the xsl style sheets when generating indexes */
+  div.index div.index
+  {
+    top: 0em;
+  }
+  /* make space for the fixed navigation bar and add space at the bottom so that
+   * link targets appear somewhat close to top
+   */
+  body
+  {
+    padding-top: 2.5em;
+    padding-bottom: 500px;
+    max-width: 60em;
+  }
+  p
+  {
+    max-width: 60em;
+  }
+  /* style and size the navigation bar */
+  table.navigation#top
+  {
+    position: fixed;
+    background: #e2e2e2;
+    border-bottom: solid 1px #babdb6;
+    border-spacing: 5px;
+    margin-top: 0;
+    margin-bottom: 0;
+    top: 0;
+    left: 0;
+    z-index: 10;
+  }
+  table.navigation#top td
+  {
+    padding-left: 6px;
+    padding-right: 6px;
+  }
+  .navigation a, .navigation a:visited
+  {
+    /* tango:sky blue 3 */
+    color: #204a87;
+  }
+  .navigation a:hover
+  {
+    /* tango:sky blue 2 */
+    color: #3465a4;
+  }
+  td.shortcuts
+  {
+    /* tango:sky blue 2 */
+    color: #3465a4;
+    font-size: 80%;
+    white-space: nowrap;
+  }
+  td.shortcuts .dim
+  {
+    color: #babdb6;
+  }
+  .navigation .title
+  {
+    font-size: 80%;
+    max-width: none;
+    margin: 0px;
+    font-weight: normal;
+  }
+}
+ at media screen and (min-width: 60em) {
+  /* screen larger than 60em */
+  body { margin: auto; }
+}
+ at media screen and (max-width: 60em) {
+  /* screen less than 60em */
+  #nav_hierarchy { display: none; }
+  #nav_interfaces { display: none; }
+  #nav_prerequisites { display: none; }
+  #nav_derived_interfaces { display: none; }
+  #nav_implementations { display: none; }
+  #nav_child_properties { display: none; }
+  #nav_style_properties { display: none; }
+  #nav_index { display: none; }
+  #nav_glossary { display: none; }
+  .gallery_image { display: none; }
+  .property_flags { display: none; }
+  .signal_flags { display: none; }
+  .parameter_annotations { display: none; }
+  .enum_member_annotations { display: none; }
+  .struct_member_annotations { display: none; }
+  .union_member_annotations { display: none; }
+  /* now that a column is hidden, optimize space */
+  col.parameters_name { width: auto; }
+  col.parameters_description { width: auto; }
+  col.struct_members_name { width: auto; }
+  col.struct_members_description { width: auto; }
+  col.enum_members_name { width: auto; }
+  col.enum_members_description { width: auto; }
+  col.union_members_name { width: auto; }
+  col.union_members_description { width: auto; }
+  .listing_lines { display: none; }
+}
+ at media print {
+  table.navigation {
+    visibility: collapse;
+    display: none;
+  }
+  div.titlepage table.navigation {
+    visibility: visible;
+    display: table;
+    background: #e2e2e2;
+    border: solid 1px #babdb6;
+    margin-top: 0;
+    margin-bottom: 0;
+    top: 0;
+    left: 0;
+    height: 3em;
+  }
+}
+
diff --git a/Documentation/api/html/up-insensitive.png b/Documentation/api/html/up-insensitive.png
new file mode 100644
index 0000000..f404986
Binary files /dev/null and b/Documentation/api/html/up-insensitive.png differ
diff --git a/Documentation/api/html/up.png b/Documentation/api/html/up.png
index 85b3e2a..80b4b37 100644
Binary files a/Documentation/api/html/up.png and b/Documentation/api/html/up.png differ
diff --git a/Documentation/default.el b/Documentation/default.el
new file mode 100644
index 0000000..e06eb83
--- /dev/null
+++ b/Documentation/default.el
@@ -0,0 +1,25 @@
+(custom-set-variables
+ ;; custom-set-variables was added by Custom.
+ ;; If you edit it by hand, you could mess it up, so be careful.
+ ;; Your init file should contain only one such instance.
+ ;; If there is more than one, they won't work right.
+ '(org-babel-load-languages
+   (quote
+    ((latex . t)
+     (python . t)
+     (emacs-lisp . t))))
+ '(org-confirm-babel-evaluate nil)
+ '(org-latex-listings (quote minted))
+ '(org-latex-minted-langs
+   (quote
+    ((emacs-lisp "common-lisp")
+     (cc "c++")
+     (cperl "perl")
+     (shell-script "bash")
+     (caml "ocaml")
+     (python "python"))))
+ '(org-latex-pdf-process
+   (quote
+    ("pdflatex -interaction nonstopmode --shell-escape -output-directory %o %f" "pdflatex -interaction nonstopmode --shell-escape -output-directory %o %f" "pdflatex -interaction nonstopmode --shell-escape -output-directory %o %f")))
+ '(org-export-with-sub-superscripts nil)
+ '(org-src-fontify-natively t))
diff --git a/Documentation/figures/3S+1D.png b/Documentation/figures/3S+1D.png
index 2d32e9c..5af2b0a 100644
Binary files a/Documentation/figures/3S+1D.png and b/Documentation/figures/3S+1D.png differ
diff --git a/Documentation/figures/4S+2D.png b/Documentation/figures/4S+2D.png
index 2d19689..f7cc697 100644
Binary files a/Documentation/figures/4S+2D.png and b/Documentation/figures/4S+2D.png differ
diff --git a/Documentation/figures/4S+2D_reciprocal.png b/Documentation/figures/4S+2D_reciprocal.png
index dee1323..966a48c 100644
Binary files a/Documentation/figures/4S+2D_reciprocal.png and b/Documentation/figures/4S+2D_reciprocal.png differ
diff --git a/Documentation/figures/4S+2D_reciprocal2.png b/Documentation/figures/4S+2D_reciprocal2.png
index 9840fac..8e134fd 100644
Binary files a/Documentation/figures/4S+2D_reciprocal2.png and b/Documentation/figures/4S+2D_reciprocal2.png differ
diff --git a/Documentation/figures/4S+2D_reciprocal3.png b/Documentation/figures/4S+2D_reciprocal3.png
index b0bb19a..aaafe2b 100644
Binary files a/Documentation/figures/4S+2D_reciprocal3.png and b/Documentation/figures/4S+2D_reciprocal3.png differ
diff --git a/Documentation/figures/4S+2D_reciprocal4.png b/Documentation/figures/4S+2D_reciprocal4.png
index e5d9762..854f602 100644
Binary files a/Documentation/figures/4S+2D_reciprocal4.png and b/Documentation/figures/4S+2D_reciprocal4.png differ
diff --git a/Documentation/figures/B_a.png b/Documentation/figures/B_a.png
index a5ad0b0..3772d07 100644
Binary files a/Documentation/figures/B_a.png and b/Documentation/figures/B_a.png differ
diff --git a/Documentation/figures/B_b.png b/Documentation/figures/B_b.png
index 07d03ed..c9dcfbe 100644
Binary files a/Documentation/figures/B_b.png and b/Documentation/figures/B_b.png differ
diff --git a/Documentation/figures/B_b3_y.png b/Documentation/figures/B_b3_y.png
index dccb243..b181908 100644
Binary files a/Documentation/figures/B_b3_y.png and b/Documentation/figures/B_b3_y.png differ
diff --git a/Documentation/figures/Makefile.am b/Documentation/figures/Makefile.am
index 953158a..4b706e3 100644
--- a/Documentation/figures/Makefile.am
+++ b/Documentation/figures/Makefile.am
@@ -1,8 +1,8 @@
 .asy.png:
-	@ASY@ -config "" -render=4 -f png -o $@ $<
+	- at ASY@ -config "" -render=4 -f png -o $@ $<
 
 .asy.pdf:
-	@ASY@ -config "" -render=0 -f pdf -noprc -o $@ $<
+	- at ASY@ -config "" -render=0 -f pdf -noprc -o $@ $<
 
 dist_noinst_DATA = \
 	3S+1D.png \
@@ -17,6 +17,7 @@ dist_noinst_DATA = \
 	4S+2D_reciprocal4.png \
 	k4cv.png \
 	k6c.png \
+	med2_3_slits.png \
 	zaxis.png \
 	e2k_1.png \
 	e2k_2.png \
@@ -39,6 +40,7 @@ EXTRA_DIST = \
 	4S+2D_reciprocal4.asy \
 	k4cv.asy \
 	k6c.asy \
+	med2_3_slits.asy \
 	diffractometer.asy \
 	zaxis.asy \
 	eulerians.asy \
diff --git a/Documentation/figures/Makefile.in b/Documentation/figures/Makefile.in
index 2565ed5..ddae3b1 100644
--- a/Documentation/figures/Makefile.in
+++ b/Documentation/figures/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
@@ -124,6 +124,8 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BULLET_CFLAGS = @BULLET_CFLAGS@
+BULLET_LIBS = @BULLET_LIBS@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
@@ -143,6 +145,7 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+EMACS = @EMACS@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
 G3D_CFLAGS = @G3D_CFLAGS@
@@ -162,14 +165,15 @@ GSL_CFLAGS = @GSL_CFLAGS@
 GSL_CONFIG = @GSL_CONFIG@
 GSL_LIBS = @GSL_LIBS@
 GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@
 GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
 GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
 GTKDOC_MKPDF = @GTKDOC_MKPDF@
 GTKDOC_REBASE = @GTKDOC_REBASE@
-GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
-GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
-GTKMM_CFLAGS = @GTKMM_CFLAGS@
-GTKMM_LIBS = @GTKMM_LIBS@
+GTKGLEXT_CFLAGS = @GTKGLEXT_CFLAGS@
+GTKGLEXT_LIBS = @GTKGLEXT_LIBS@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
 HTML_DIR = @HTML_DIR@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -265,7 +269,6 @@ localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
-opengl_LIBS = @opengl_LIBS@
 pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
@@ -293,6 +296,7 @@ dist_noinst_DATA = \
 	4S+2D_reciprocal4.png \
 	k4cv.png \
 	k6c.png \
+	med2_3_slits.png \
 	zaxis.png \
 	e2k_1.png \
 	e2k_2.png \
@@ -314,6 +318,7 @@ EXTRA_DIST = \
 	4S+2D_reciprocal4.asy \
 	k4cv.asy \
 	k6c.asy \
+	med2_3_slits.asy \
 	diffractometer.asy \
 	zaxis.asy \
 	eulerians.asy \
@@ -516,10 +521,10 @@ uninstall-am:
 	tags-am uninstall uninstall-am
 
 .asy.png:
-	@ASY@ -config "" -render=4 -f png -o $@ $<
+	- at ASY@ -config "" -render=4 -f png -o $@ $<
 
 .asy.pdf:
-	@ASY@ -config "" -render=0 -f pdf -noprc -o $@ $<
+	- at ASY@ -config "" -render=0 -f pdf -noprc -o $@ $<
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/Documentation/figures/crystal.png b/Documentation/figures/crystal.png
index 6189b05..725a124 100644
Binary files a/Documentation/figures/crystal.png and b/Documentation/figures/crystal.png differ
diff --git a/Documentation/figures/e2k_1.png b/Documentation/figures/e2k_1.png
index da70777..cbafd70 100644
Binary files a/Documentation/figures/e2k_1.png and b/Documentation/figures/e2k_1.png differ
diff --git a/Documentation/figures/e2k_2.png b/Documentation/figures/e2k_2.png
index 2dd6292..ea14a5b 100644
Binary files a/Documentation/figures/e2k_2.png and b/Documentation/figures/e2k_2.png differ
diff --git a/Documentation/figures/e2k_3.png b/Documentation/figures/e2k_3.png
index f596721..0804250 100644
Binary files a/Documentation/figures/e2k_3.png and b/Documentation/figures/e2k_3.png differ
diff --git a/Documentation/figures/e2k_4.png b/Documentation/figures/e2k_4.png
index 9a00add..6eab57e 100644
Binary files a/Documentation/figures/e2k_4.png and b/Documentation/figures/e2k_4.png differ
diff --git a/Documentation/figures/k4cv.png b/Documentation/figures/k4cv.png
index 976d8c5..9e21ce0 100644
Binary files a/Documentation/figures/k4cv.png and b/Documentation/figures/k4cv.png differ
diff --git a/Documentation/figures/k6c.png b/Documentation/figures/k6c.png
index 53b5179..35ef988 100644
Binary files a/Documentation/figures/k6c.png and b/Documentation/figures/k6c.png differ
diff --git a/Documentation/figures/med2_3_slits.asy b/Documentation/figures/med2_3_slits.asy
new file mode 100644
index 0000000..aa03682
--- /dev/null
+++ b/Documentation/figures/med2_3_slits.asy
@@ -0,0 +1,79 @@
+import three;
+
+currentprojection=orthographic(
+camera=(3.01553867584536,7.69355163375629,1.55824928263524),
+up=(-0.000558993492954675,-0.00231647705177596,0.012518906910417),
+target=(2.93710368526323e-16,1.12323345069498e-15,1.74149973955484e-17),
+zoom=1);
+
+size(12cm);
+
+// orthonormal coordinates
+draw(Label("$\vec{x}$", 1), (-3*X)--(X), gray, Arrow3());
+draw(Label("$\vec{y}$", 1), (-Y)--(Y), gray, Arrow3());
+draw(Label("$\vec{z}$", 1), (-Z)--(2*Z), gray, Arrow3());
+
+surface slits(real size)
+{
+  surface s;
+  surface slits_in = rotate(90, Y) * yscale3(.3) * scale3(size) * unitplane;
+  surface slits_out = shift(2 / 3. * size * Y) * slits_in;
+
+  s.append(slits_in);
+  s.append(slits_out);
+  s = shift(.5 * Z - size / 2. * Y) * s;
+
+  return s;
+}
+
+// La construction d'Ewald
+void main(triple ki, real gamma, real delta, real eta)
+{
+  real k = length(ki);
+  transform3 M = rotate(gamma, Z) * rotate(-delta, Y) * rotate(eta, X);
+  triple kf = M * ki;
+  triple Q = kf-ki;
+
+  // incomming and outgoing beam
+  draw(Label("$\vec{k_i}$", .5, S), shift(-ki)*(O--ki), Arrow3());
+  draw(Label("$\vec{k_f}$"), (O--kf), dashed, Arrow3());
+
+  // project kf on xOy
+  triple Pkf_xy = planeproject(Z, O) * kf;
+  draw(Pkf_xy--O, grey+dashed);
+  draw(Label("$\gamma$"), arc(O, length(Pkf_xy)*X, Pkf_xy), dashed, Arrow3());
+  draw(Label("$\delta$"), arc(O, Pkf_xy, kf), dashed, Arrow3());
+  
+  // draw the slits and the surface of rotation
+  triple n_slits = shift(kf) * M * Z;
+  path3 Cs = circle(kf, 1, kf);
+  draw(shift(kf) * M * slits(1), red);
+  draw(Label("$\vec{n_{slits}}$", 1), kf--n_slits, red, Arrow3());
+  draw(Cs, red+dashed);
+  //draw(surface(Cs), yellow+dashed);
+  
+  // draw the n and n' surface
+  path3 Cn = circle(kf, 1, Y);
+  draw(Label("$\vec{n}$"), O--Y, blue, Arrow3());
+  draw(Label("$\vec{n'}$"), shift(kf) * (O--Y), blue, Arrow3());
+  draw(Y--(Y+kf), dashed);
+  draw(Cn, blue);
+  draw(surface(Cn), blue+dashed+opacity(.2));
+
+  // draw the ange between eta_p and n
+  draw(arc(kf, kf+Y, M * (ki + Z)));
+
+  // draw the expected slits orientation
+  triple [] positions;
+  positions = intersectionpoints(Cs, Cn);
+  for(triple pos : positions){
+    dot(pos);
+  }
+
+  // angle eta_a
+  draw(Label("$\eta_a$"), arc(kf, n_slits, positions[0]), red);
+}
+
+//slits(2*X, -30, 40);
+main(2*X, 45, 45, -35);
+main(2*X, 45, 45, 0);
diff --git a/Documentation/figures/med2_3_slits.png b/Documentation/figures/med2_3_slits.png
new file mode 100644
index 0000000..d497c14
Binary files /dev/null and b/Documentation/figures/med2_3_slits.png differ
diff --git a/Documentation/figures/qper_qpar.png b/Documentation/figures/qper_qpar.png
index bc7266f..77228be 100644
Binary files a/Documentation/figures/qper_qpar.png and b/Documentation/figures/qper_qpar.png differ
diff --git a/Documentation/figures/zaxis.png b/Documentation/figures/zaxis.png
index 47b6b21..d3768a8 100644
Binary files a/Documentation/figures/zaxis.png and b/Documentation/figures/zaxis.png differ
diff --git a/Documentation/hkl.html b/Documentation/hkl.html
new file mode 100644
index 0000000..bb2750a
--- /dev/null
+++ b/Documentation/hkl.html
@@ -0,0 +1,4521 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>Welcome to hkl's 4.99.99.1892 documentation!</title>
+<!-- 2015-01-30 ven. 09:17 -->
+<meta  http-equiv="Content-Type" content="text/html;charset=utf-8" />
+<meta  name="generator" content="Org-mode" />
+<meta  name="author" content="Picca Frédéric-Emmanuel" />
+<style type="text/css">
+ <!--/*--><![CDATA[/*><!--*/
+  .title  { text-align: center; }
+  .todo   { font-family: monospace; color: red; }
+  .done   { color: green; }
+  .tag    { background-color: #eee; font-family: monospace;
+            padding: 2px; font-size: 80%; font-weight: normal; }
+  .timestamp { color: #bebebe; }
+  .timestamp-kwd { color: #5f9ea0; }
+  .right  { margin-left: auto; margin-right: 0px;  text-align: right; }
+  .left   { margin-left: 0px;  margin-right: auto; text-align: left; }
+  .center { margin-left: auto; margin-right: auto; text-align: center; }
+  .underline { text-decoration: underline; }
+  #postamble p, #preamble p { font-size: 90%; margin: .2em; }
+  p.verse { margin-left: 3%; }
+  pre {
+    border: 1px solid #ccc;
+    box-shadow: 3px 3px 3px #eee;
+    padding: 8pt;
+    font-family: monospace;
+    overflow: auto;
+    margin: 1.2em;
+  }
+  pre.src {
+    position: relative;
+    overflow: visible;
+    padding-top: 1.2em;
+  }
+  pre.src:before {
+    display: none;
+    position: absolute;
+    background-color: white;
+    top: -10px;
+    right: 10px;
+    padding: 3px;
+    border: 1px solid black;
+  }
+  pre.src:hover:before { display: inline;}
+  pre.src-sh:before    { content: 'sh'; }
+  pre.src-bash:before  { content: 'sh'; }
+  pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
+  pre.src-R:before     { content: 'R'; }
+  pre.src-perl:before  { content: 'Perl'; }
+  pre.src-java:before  { content: 'Java'; }
+  pre.src-sql:before   { content: 'SQL'; }
+
+  table { border-collapse:collapse; }
+  caption.t-above { caption-side: top; }
+  caption.t-bottom { caption-side: bottom; }
+  td, th { vertical-align:top;  }
+  th.right  { text-align: center;  }
+  th.left   { text-align: center;   }
+  th.center { text-align: center; }
+  td.right  { text-align: right;  }
+  td.left   { text-align: left;   }
+  td.center { text-align: center; }
+  dt { font-weight: bold; }
+  .footpara:nth-child(2) { display: inline; }
+  .footpara { display: block; }
+  .footdef  { margin-bottom: 1em; }
+  .figure { padding: 1em; }
+  .figure p { text-align: center; }
+  .inlinetask {
+    padding: 10px;
+    border: 2px solid gray;
+    margin: 10px;
+    background: #ffffcc;
+  }
+  #org-div-home-and-up
+   { text-align: right; font-size: 70%; white-space: nowrap; }
+  textarea { overflow-x: auto; }
+  .linenr { font-size: smaller }
+  .code-highlighted { background-color: #ffff00; }
+  .org-info-js_info-navigation { border-style: none; }
+  #org-info-js_console-label
+    { font-size: 10px; font-weight: bold; white-space: nowrap; }
+  .org-info-js_search-highlight
+    { background-color: #ffff00; color: #000000; font-weight: bold; }
+  /*]]>*/-->
+</style>
+<script type="text/javascript">
+/*
+ at licstart  The following is the entire license notice for the
+JavaScript code in this tag.
+
+Copyright (C) 2012-2013 Free Software Foundation, Inc.
+
+The JavaScript code in this tag is free software: you can
+redistribute it and/or modify it under the terms of the GNU
+General Public License (GNU GPL) as published by the Free Software
+Foundation, either version 3 of the License, or (at your option)
+any later version.  The code is distributed WITHOUT ANY WARRANTY;
+without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE.  See the GNU GPL for more details.
+
+As additional permission under GNU GPL version 3 section 7, you
+may distribute non-source (e.g., minimized or compacted) forms of
+that code without the copy of the GNU GPL normally required by
+section 4, provided you include this license notice and a URL
+through which recipients can access the Corresponding Source.
+
+
+ at licend  The above is the entire license notice
+for the JavaScript code in this tag.
+*/
+<!--/*--><![CDATA[/*><!--*/
+ function CodeHighlightOn(elem, id)
+ {
+   var target = document.getElementById(id);
+   if(null != target) {
+     elem.cacheClassElem = elem.className;
+     elem.cacheClassTarget = target.className;
+     target.className = "code-highlighted";
+     elem.className   = "code-highlighted";
+   }
+ }
+ function CodeHighlightOff(elem, id)
+ {
+   var target = document.getElementById(id);
+   if(elem.cacheClassElem)
+     elem.className = elem.cacheClassElem;
+   if(elem.cacheClassTarget)
+     target.className = elem.cacheClassTarget;
+ }
+/*]]>*///-->
+</script>
+<script type="text/javascript" src="/usr/share/javascript/mathjax/MathJax.js"></script>
+<script type="text/javascript">
+<!--/*--><![CDATA[/*><!--*/
+    MathJax.Hub.Config({
+        // Only one of the two following lines, depending on user settings
+        // First allows browser-native MathML display, second forces HTML/CSS
+        //  config: ["MMLorHTML.js"], jax: ["input/TeX"],
+            jax: ["input/TeX", "output/HTML-CSS"],
+        extensions: ["tex2jax.js","TeX/AMSmath.js","TeX/AMSsymbols.js",
+                     "TeX/noUndefined.js"],
+        tex2jax: {
+            inlineMath: [ ["\\(","\\)"] ],
+            displayMath: [ ['$$','$$'], ["\\[","\\]"], ["\\begin{displaymath}","\\end{displaymath}"] ],
+            skipTags: ["script","noscript","style","textarea","pre","code"],
+            ignoreClass: "tex2jax_ignore",
+            processEscapes: false,
+            processEnvironments: true,
+            preview: "TeX"
+        },
+        showProcessingMessages: true,
+        displayAlign: "center",
+        displayIndent: "2em",
+
+        "HTML-CSS": {
+             scale: 100,
+             availableFonts: ["STIX","TeX"],
+             preferredFont: "TeX",
+             webFont: "TeX",
+             imageFont: "TeX",
+             showMathMenu: true,
+        },
+        MMLorHTML: {
+             prefer: {
+                 MSIE:    "MML",
+                 Firefox: "MML",
+                 Opera:   "HTML",
+                 other:   "HTML"
+             }
+        }
+    });
+/*]]>*///-->
+</script>
+</head>
+<body>
+<div id="content">
+<h1 class="title">Welcome to hkl's 4.99.99.1892 documentation!</h1>
+<div id="table-of-contents">
+<h2>Table of Contents</h2>
+<div id="text-table-of-contents">
+<ul>
+<li><a href="#sec-1">1. Introduction</a>
+<ul>
+<li><a href="#sec-1-1">1.1. Features</a></li>
+<li><a href="#sec-1-2">1.2. Conventions</a></li>
+<li><a href="#sec-1-3">1.3. Diffraction</a>
+<ul>
+<li><a href="#sec-1-3-1">1.3.1. the crystal</a></li>
+<li><a href="#sec-1-3-2">1.3.2. Diffraction</a></li>
+<li><a href="#sec-1-3-3">1.3.3. Quaternions</a></li>
+</ul>
+</li>
+<li><a href="#sec-1-4">1.4. Modes de fonctionnement</a></li>
+<li><a href="#sec-1-5">1.5. Equations fondamentales</a>
+<ul>
+<li><a href="#sec-1-5-1">1.5.1. Calcule de B</a></li>
+<li><a href="#sec-1-5-2">1.5.2. Calcule de U</a></li>
+<li><a href="#sec-1-5-3">1.5.3. Algorithme de Busing Levy</a></li>
+<li><a href="#sec-1-5-4">1.5.4. Affinement par la méthode du simplex</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li><a href="#sec-2">2. PseudoAxes</a>
+<ul>
+<li><a href="#sec-2-1">2.1. Eulerians to Kappa angles</a></li>
+<li><a href="#sec-2-2">2.2. Kappa to Eulerians angles</a></li>
+<li><a href="#sec-2-3">2.3. Qper and Qpar</a></li>
+</ul>
+</li>
+<li><a href="#sec-3">3. Diffractometers</a>
+<ul>
+<li><a href="#sec-3-1">3.1. E4CH</a>
+<ul>
+<li><a href="#sec-3-1-1">3.1.1. Axes:</a></li>
+<li><a href="#sec-3-1-2">3.1.2. Engines:</a></li>
+</ul>
+</li>
+<li><a href="#sec-3-2">3.2. E4CV</a>
+<ul>
+<li><a href="#sec-3-2-1">3.2.1. Axes:</a></li>
+<li><a href="#sec-3-2-2">3.2.2. Engines:</a></li>
+</ul>
+</li>
+<li><a href="#sec-3-3">3.3. E6C</a>
+<ul>
+<li><a href="#sec-3-3-1">3.3.1. Axes:</a></li>
+<li><a href="#sec-3-3-2">3.3.2. Engines:</a></li>
+</ul>
+</li>
+<li><a href="#sec-3-4">3.4. K4CV</a>
+<ul>
+<li><a href="#sec-3-4-1">3.4.1. Axes:</a></li>
+<li><a href="#sec-3-4-2">3.4.2. Engines:</a></li>
+</ul>
+</li>
+<li><a href="#sec-3-5">3.5. K6C</a>
+<ul>
+<li><a href="#sec-3-5-1">3.5.1. Axes:</a></li>
+<li><a href="#sec-3-5-2">3.5.2. Engines:</a></li>
+</ul>
+</li>
+<li><a href="#sec-3-6">3.6. PETRA3 P09 EH2</a>
+<ul>
+<li><a href="#sec-3-6-1">3.6.1. Axes:</a></li>
+<li><a href="#sec-3-6-2">3.6.2. Engines:</a></li>
+</ul>
+</li>
+<li><a href="#sec-3-7">3.7. SOLEIL MARS</a>
+<ul>
+<li><a href="#sec-3-7-1">3.7.1. Axes:</a></li>
+<li><a href="#sec-3-7-2">3.7.2. Engines:</a></li>
+</ul>
+</li>
+<li><a href="#sec-3-8">3.8. SOLEIL SIRIUS KAPPA</a>
+<ul>
+<li><a href="#sec-3-8-1">3.8.1. Axes:</a></li>
+<li><a href="#sec-3-8-2">3.8.2. Engines:</a></li>
+</ul>
+</li>
+<li><a href="#sec-3-9">3.9. SOLEIL SIRIUS TURRET</a>
+<ul>
+<li><a href="#sec-3-9-1">3.9.1. Axes:</a></li>
+<li><a href="#sec-3-9-2">3.9.2. Engines:</a></li>
+</ul>
+</li>
+<li><a href="#sec-3-10">3.10. SOLEIL SIXS MED1+2</a>
+<ul>
+<li><a href="#sec-3-10-1">3.10.1. Axes:</a></li>
+<li><a href="#sec-3-10-2">3.10.2. Engines:</a></li>
+</ul>
+</li>
+<li><a href="#sec-3-11">3.11. SOLEIL SIXS MED2+2</a>
+<ul>
+<li><a href="#sec-3-11-1">3.11.1. Axes:</a></li>
+<li><a href="#sec-3-11-2">3.11.2. Engines:</a></li>
+</ul>
+</li>
+<li><a href="#sec-3-12">3.12. SOLEIL SIXS MED2+3</a>
+<ul>
+<li><a href="#sec-3-12-1">3.12.1. Axes:</a></li>
+<li><a href="#sec-3-12-2">3.12.2. Engines:</a></li>
+</ul>
+</li>
+<li><a href="#sec-3-13">3.13. TwoC</a>
+<ul>
+<li><a href="#sec-3-13-1">3.13.1. Axes:</a></li>
+<li><a href="#sec-3-13-2">3.13.2. Engines:</a></li>
+</ul>
+</li>
+<li><a href="#sec-3-14">3.14. ZAXIS</a>
+<ul>
+<li><a href="#sec-3-14-1">3.14.1. Axes:</a></li>
+<li><a href="#sec-3-14-2">3.14.2. Engines:</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li><a href="#sec-4">4. Developpement</a>
+<ul>
+<li><a href="#sec-4-1">4.1. Getting hkl</a></li>
+<li><a href="#sec-4-2">4.2. Building hkl</a></li>
+<li><a href="#sec-4-3">4.3. Hacking hkl</a>
+<ul>
+<li><a href="#sec-4-3-1">4.3.1. Bug reporting</a></li>
+<li><a href="#sec-4-3-2">4.3.2. Providing patchs</a></li>
+</ul>
+</li>
+<li><a href="#sec-4-4">4.4. Howto's</a>
+<ul>
+<li><a href="#sec-4-4-1">4.4.1. Add a diffractometer</a></li>
+<li><a href="#sec-4-4-2">4.4.2. Work on the documentation</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li><a href="#sec-5">5. Bindings</a>
+<ul>
+<li><a href="#sec-5-1">5.1. Python</a></li>
+</ul>
+</li>
+<li><a href="#sec-6">6. Todo</a>
+<ul>
+<li><a href="#sec-6-1">6.1. hkl</a>
+<ul>
+<li><a href="#sec-6-1-1">6.1.1. <span class="todo TODO">TODO</span> <code>[0/2]</code> PetraIII</a></li>
+<li><a href="#sec-6-1-2">6.1.2. <span class="todo TODO">TODO</span> <code>[2/4]</code> HklParameter</a></li>
+<li><a href="#sec-6-1-3">6.1.3. <span class="todo TODO">TODO</span> HklGeometryList different method to help select a solution.</a></li>
+<li><a href="#sec-6-1-4">6.1.4. <span class="todo TODO">TODO</span> add a fit on the Hklaxis offsets.</a></li>
+<li><a href="#sec-6-1-5">6.1.5. <span class="todo TODO">TODO</span> API to put a detector and a sample on the Geometry.</a></li>
+<li><a href="#sec-6-1-6">6.1.6. <span class="todo TODO">TODO</span> HklSample</a></li>
+<li><a href="#sec-6-1-7">6.1.7. <span class="todo TODO">TODO</span> HklEngine "zone"</a></li>
+<li><a href="#sec-6-1-8">6.1.8. <span class="todo TODO">TODO</span> HklEngine "custom"</a></li>
+<li><a href="#sec-6-1-9">6.1.9. <span class="todo TODO">TODO</span> create a macro to help compare two real the right way</a></li>
+<li><a href="#sec-6-1-10">6.1.10. <span class="todo TODO">TODO</span> add an hkl_sample_set_lattice_unit()</a></li>
+<li><a href="#sec-6-1-11">6.1.11. <span class="todo TODO">TODO</span> SOLEIL SIXS</a></li>
+<li><a href="#sec-6-1-12">6.1.12. <span class="todo TODO">TODO</span> generalisation of the z-axis hkl solver</a></li>
+<li><a href="#sec-6-1-13">6.1.13. <span class="todo TODO">TODO</span> investigate the prigo geometry.</a></li>
+<li><a href="#sec-6-1-14">6.1.14. <span class="todo TODO">TODO</span> augeas/elektra for the plugin configure part.</a></li>
+<li><a href="#sec-6-1-15">6.1.15. <span class="todo TODO">TODO</span> logging</a></li>
+<li><a href="#sec-6-1-16">6.1.16. <span class="todo TODO">TODO</span> performances</a></li>
+</ul>
+</li>
+<li><a href="#sec-6-2">6.2. documentation</a>
+<ul>
+<li><a href="#sec-6-2-1">6.2.1. <span class="todo TODO">TODO</span> <code>[1/6]</code> rewrite documentation in org-mode</a></li>
+</ul>
+</li>
+<li><a href="#sec-6-3">6.3. <code>[0/3]</code> gui</a></li>
+<li><a href="#sec-6-4">6.4. hkl3d</a>
+<ul>
+<li><a href="#sec-6-4-1">6.4.1. <span class="todo TODO">TODO</span> add a method to find the 3D models in the right directories.</a></li>
+</ul>
+</li>
+<li><a href="#sec-6-5">6.5. packaging</a>
+<ul>
+<li><a href="#sec-6-5-1">6.5.1. <span class="todo TODO">TODO</span> add a .spec file for rpm generation.</a></li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</div>
+
+<div id="outline-container-sec-1" class="outline-2">
+<h2 id="sec-1"><span class="section-number-2">1</span> Introduction</h2>
+<div class="outline-text-2" id="text-1">
+<p>
+The purpose of the library is to factorise single crystal
+diffraction angles computation for different kind of diffractometer
+geometries. It is used at the SOLEIL, Desy and Alba synchrotron with
+the Tango control system to pilot diffractometers.
+</p>
+</div>
+<div id="outline-container-sec-1-1" class="outline-3">
+<h3 id="sec-1-1"><span class="section-number-3">1.1</span> Features</h3>
+<div class="outline-text-3" id="text-1-1">
+<ul class="org-ul">
+<li>mode computation (aka PseudoAxis)
+</li>
+<li>item for different diffractometer geometries.
+</li>
+<li>UB matrix computation.
+<ul class="org-ul">
+<li>busing & Levy with 2 reflections
+</li>
+<li>simplex computation with more than 2 reflections using the GSL
+library.
+</li>
+<li>Eulerians angles to pre-orientate your sample.
+</li>
+</ul>
+</li>
+<li>Crystal lattice affinement
+<ul class="org-ul">
+<li>with more than 2 reflections you can select which parameter must
+be fitted.
+</li>
+</ul>
+</li>
+<li>Pseudoaxes
+<ul class="org-ul">
+<li>psi, eulerians, q, &#x2026;
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</div>
+<div id="outline-container-sec-1-2" class="outline-3">
+<h3 id="sec-1-2"><span class="section-number-3">1.2</span> Conventions</h3>
+<div class="outline-text-3" id="text-1-2">
+<p>
+In all this document the next convention will be used to describe
+the diffractometers geometries.
+</p>
+<ul class="org-ul">
+<li>right handed convention for all the angles.
+</li>
+<li>direct space orthogonal base.
+</li>
+<li>description of the diffractometer geometries is done with all
+axes values set to zero.
+</li>
+</ul>
+</div>
+</div>
+<div id="outline-container-sec-1-3" class="outline-3">
+<h3 id="sec-1-3"><span class="section-number-3">1.3</span> Diffraction</h3>
+<div class="outline-text-3" id="text-1-3">
+</div><div id="outline-container-sec-1-3-1" class="outline-4">
+<h4 id="sec-1-3-1"><span class="section-number-4">1.3.1</span> the crystal</h4>
+<div class="outline-text-4" id="text-1-3-1">
+<p>
+A periodic crystal is the association of a pattern and a lattice. The
+pattern is located at each points of the lattice node. Positions of
+those nodes are given by:
+</p>
+
+\begin{displaymath}
+R_{uvw}=u\cdot\vec{a}+v\cdot\vec{b}+w\cdot\vec{c}
+\end{displaymath}
+
+<p>
+\(\vec{a}\), \(\vec{b}\), \(\vec{c}\) are the former vector of a base of the
+space. <code>u</code>, <code>v</code>, <code>w</code> are integrers. The pattern contain atomes
+associated to each lattice node. the purpose of diffraction is to study
+the interaction of this crystal (pattern+lattice) with X-rays.
+</p>
+
+
+<div class="figure">
+<p><img src="./figures/crystal.png" alt="crystal.png" />
+</p>
+<p><span class="figure-number">Figure 1:</span> Crystal direct lattice.</p>
+</div>
+
+<p>
+this lattice is defined by \(\vec{a}\), \(\vec{b}\), \(\vec{c}\) vectors, and
+the angles \(\alpha\), \(\beta\), \(\gamma\). In general cases this lattice is
+not othonormal.
+</p>
+
+<p>
+Nevertheless to compute the interaction of this real space lattice and
+the X-Rays, it is convenient to define another lattice called reciprocal
+lattice defined like this:
+</p>
+
+\begin{eqnarray*}
+\vec{a}^{\star} & = & \tau\frac{\vec{b}\wedge\vec{c}}{\vec{a}\cdot(\vec{b}\wedge\vec{c})}\\
+\vec{b}^{\star} & = & \tau\frac{\vec{c}\wedge\vec{a}}{\vec{b}\cdot(\vec{c}\wedge\vec{a})}\\
+\vec{c}^{\star} & = & \tau\frac{\vec{a}\wedge\vec{b}}{\vec{c}\cdot(\vec{a}\wedge\vec{b})}
+\end{eqnarray*}
+
+<p>
+\(\tau=2\pi\) or \(\tau=1\) depending on the conventions.
+</p>
+
+<p>
+It is then possible to define thoses orthogonal properties:
+</p>
+
+\begin{eqnarray*}
+\vec{a}^{\star}\cdot\vec{a}=\tau & \vec{b}^{\star}\cdot\vec{a}=0    & \vec{c}^{\star}\cdot\vec{a}=0\\
+\vec{a}^{\star}\cdot\vec{b}=0    & \vec{b}^{\star}\cdot\vec{b}=\tau & \vec{c}^{\star}\cdot\vec{b}=0\\
+\vec{a}^{\star}\cdot\vec{c}=0    & \vec{b}^{\star}\cdot\vec{c}=0    & \vec{c}^{\star}\cdot\vec{c}=\tau
+\end{eqnarray*}
+
+<p>
+This reciprocal space lattice allow to write in a simpler form the
+interaction between the crystal and the X-Rays. We often only know about
+\(\vec{a}\), \(\vec{b}\), \(\vec{c}\) vectors and the angles \(\alpha\),
+\(\beta\), \(\gamma\). Using the previous equations reciprocal, we can
+compute the reciprocal lattice this way:
+</p>
+
+
+\begin{eqnarray*}
+a^{\star} & = & \frac{\sin\alpha}{aD}\\
+b^{\star} & = & \frac{\sin\beta}{bD}\\
+c^{\star} & = & \frac{\sin\gamma}{cD}
+\end{eqnarray*}
+
+<p>
+where
+</p>
+
+\begin{displaymath}
+D=\sqrt{1-\cos^{2}\alpha-\cos^{2}\beta-\cos^{2}\gamma+2\cos\alpha\cos\beta\cos\gamma}
+\end{displaymath}
+
+<p>
+To compute the angles between the reciprocal space vectors, it is once
+again possible to use the previous equations reciprocal to obtain the
+sinus and cosinus of the angles \(\alpha^\star\), \(\beta^\star\) et
+\(\gamma^\star\):
+</p>
+
+\begin{eqnarray*}
+\cos\alpha^{\star}=\frac{\cos\beta\cos\gamma-\cos\alpha}{\sin\beta\sin\gamma} & \, & \sin\alpha^{\star}=\frac{D}{\sin\beta\sin\gamma} \\
+\cos\beta^{\star}=\frac{\cos\gamma\cos\alpha-\cos\beta}{\sin\gamma\sin\alpha} & \, & \sin\beta^{\star}=\frac{D}{\sin\gamma\sin\alpha}\\
+\cos\gamma^{\star}=\frac{\cos\alpha\cos\beta-\cos\gamma}{\sin\alpha\sin\beta} & \, & \sin\gamma^{\star}=\frac{D}{\sin\alpha\sin\beta}
+\end{eqnarray*}
+</div>
+</div>
+
+<div id="outline-container-sec-1-3-2" class="outline-4">
+<h4 id="sec-1-3-2"><span class="section-number-4">1.3.2</span> Diffraction</h4>
+<div class="outline-text-4" id="text-1-3-2">
+<p>
+Let the incomming X-rays beam whose wave vector is \(\vec{k_{i}}\),
+\(|k_{i}|=\tau/\lambda\) where \(\lambda\) is the wavelength of the signal.
+The \(\vec{k_{d}}\) vector wavelength of the diffracted beam. There is
+diffusion if the diffusion vector \(\vec{q}\) can be expressed as follows:
+</p>
+
+\begin{displaymath}
+\vec{q}=\vec{k_{d}}-\vec{k_{i}}=h.\vec{a}^{*}+k.\vec{b}^{*}+l.\vec{c}^{*}
+\end{displaymath}
+
+<p>
+where \((h,k,l)\in\mathbb{N}^{3}\) and \((h,k,l)\neq(0,0,0)\). Thoses
+indices \((h,k,l)\) are named Miller indices.
+</p>
+
+<p>
+Another way of looking at things has been given by Bragg and that famous
+relationship:
+</p>
+
+\begin{displaymath}
+n\lambda=2d\sin\theta
+\end{displaymath}
+
+<p>
+where \(d\) is the inter-plan distance and \(n \in \mathbb{N}\).
+</p>
+
+<p>
+The diffusion accure for a unique \(\theta\) angle. Then we got \(\vec{q}\)
+perpendicular to the diffraction plan.
+</p>
+
+<p>
+The Ewald construction allow to represent this diffraction in the
+reciprocal space.
+</p>
+</div>
+</div>
+
+<div id="outline-container-sec-1-3-3" class="outline-4">
+<h4 id="sec-1-3-3"><span class="section-number-4">1.3.3</span> Quaternions</h4>
+<div class="outline-text-4" id="text-1-3-3">
+</div><ol class="org-ol"><li><a id="sec-1-3-3-1" name="sec-1-3-3-1"></a>Properties<br  /><div class="outline-text-5" id="text-1-3-3-1">
+<p>
+The quaternions will be used to discribe the diffractometers geometries.
+Thoses quaternions can represent 3D rotations. There is different way to
+describe then like complex numbers.
+</p>
+
+\begin{displaymath}
+q=a+bi+cj+dk
+\end{displaymath}
+
+<p>
+or
+</p>
+
+\begin{displaymath}
+q=[a,\vec{v}]
+\end{displaymath}
+
+<p>
+To compute the quaternion's norm, we can proceed like for complex
+numbers
+</p>
+
+\begin{displaymath}
+\lvert q \rvert = \sqrt{a{{}^2}+b{{}^2}+c{{}^2}+d{{}^2}}
+\end{displaymath}
+
+<p>
+Its conjugate is :
+</p>
+
+\begin{displaymath}
+q^{*}=[a,-\vec{u}]=a-bi-cj-dk
+\end{displaymath}
+</div>
+</li>
+
+<li><a id="sec-1-3-3-2" name="sec-1-3-3-2"></a>Operations<br  /><div class="outline-text-5" id="text-1-3-3-2">
+<p>
+The difference with the complexnumber algebre is about
+non-commutativity.
+</p>
+
+\begin{displaymath}
+qp \neq pq
+\end{displaymath}
+
+\begin{displaymath}
+\begin{bmatrix}
+~ & 1 & i  & j  & k \cr
+1 & 1 & i  & j  & k \cr
+i & i & -1 & k  & -j \cr
+j & j & -k & -1 & i \cr
+k & k & j  & -i & -1
+\end{bmatrix}
+\end{displaymath}
+
+<p>
+The product of two quaternions can be express by the Grassman product
+Grassman product. So for two quaternions \(p\) and \(q\):
+</p>
+
+\begin{align*}
+q &= a+\vec{u} = a+bi+cj+dk\\
+p &= t+\vec{v} = t+xi+yj+zk
+\end{align*}
+
+<p>
+we got
+</p>
+
+\begin{displaymath}
+pq = at - \vec{u} \cdot \vec{v} + a \vec{v} + t \vec{u} + \vec{v} \times \vec{u}
+\end{displaymath}
+
+<p>
+or equivalent
+</p>
+
+\begin{displaymath}
+pq = (at - bx - cy - dz) + (bt + ax + cz - dy) i + (ct + ay + dx - bz) j + (dt + az + by - cx) k
+\end{displaymath}
+</div>
+</li>
+
+<li><a id="sec-1-3-3-3" name="sec-1-3-3-3"></a>3D rotations<br  /><div class="outline-text-5" id="text-1-3-3-3">
+<p>
+L'ensemble des quaternions unitaires (leur norme est égale à 1) est le
+groupe qui représente les rotations dans l'espace 3D. Si on a un vecteur
+unitaire \(\vec{u}\) et un angle de rotation \(\theta\) alors le quaternion
+\([\cos\frac{\theta}{2},\sin\frac{\theta}{2}\vec{u]}\) représente la
+rotation de \(\theta\) autour de l'axe \(\vec{u}\) dans le sens
+trigonométrique. Nous allons donc utiliser ces quaternions unitaires
+pour représenter les mouvements du diffractomètre.
+</p>
+
+<p>
+Alors que dans le plan 2D une simple multiplication entre un nombre
+complex et le nombre \(e^{i\theta}\) permet de calculer simplement la
+rotation d'angle \(\theta\) autour de l'origine, dans l'espace 3D
+l'expression équivalente est:
+</p>
+
+\begin{displaymath}
+z'=qzq^{-1}
+\end{displaymath}
+
+<p>
+où \(q\) est le quaternion de norme 1 représentant la rotation dans
+l'espace et \(z\) le quaternion représentant le vecteur qui subit la
+rotation (sa partie réelle est nulle).
+</p>
+
+<p>
+Dans le cas des quaternions de norme 1, il est très facile de calculer
+\(q^{-1}\). En effet l'inverse d'une rotation d'angle \(\theta\) est la
+rotation d'angle \(-\theta\). On a donc directement:
+</p>
+
+\begin{displaymath}
+q^{-1}=[\cos\frac{-\theta}{2},\sin\frac{-\theta}{2}\vec{u}]=[\cos\frac{\theta}{2},-\sin\frac{\theta}{2}\vec{u}]=q^{*}
+\end{displaymath}
+
+<p>
+Le passage aux matrices de rotation se fait par la formule suivante
+\(q\rightarrow M\).
+</p>
+
+\begin{displaymath}
+\begin{bmatrix}
+a{{}^2}+b{{}^2}-c{{}^2}-d{{}^2} & 2bc-2ad & 2ac+2bd\\
+2ad+2bc & a{{}^2}-b{{}^2}+c{{}^2}-d{{}^2} & 2cd-2ab\\
+2bd-2ac & 2ab+2cd & a{{}^2}-b{{}^2}-c{{}^2}+d{{}^2}
+\end{bmatrix}
+\end{displaymath}
+
+<p>
+La composition de rotation se fait simplement en multipliant les
+quaternions entre eux. Si l'on à \(q\)
+</p>
+</div>
+</li></ol>
+</div>
+</div>
+
+<div id="outline-container-sec-1-4" class="outline-3">
+<h3 id="sec-1-4"><span class="section-number-3">1.4</span> Modes de fonctionnement</h3>
+</div>
+<div id="outline-container-sec-1-5" class="outline-3">
+<h3 id="sec-1-5"><span class="section-number-3">1.5</span> Equations fondamentales</h3>
+<div class="outline-text-3" id="text-1-5">
+<p>
+Le problème que nous devons résoudre est de calculer pour une famille de
+plan \((h,k,l)\) donné, les angles de rotation du diffractomètre qui
+permettent de le mettre en condition de diffraction. Il faut donc
+exprimer les relations mathématiques qui lient les différents angles
+entre eux lorsque la condition de Bragg est vérifiée. L'équation
+fondamentale est la suivante:
+</p>
+
+\begin{align*}
+\left(\prod_{i}S_{i}\right)\cdot U\cdot B\cdot\vec{h} & =\left(\prod_{j}D_{j}-I\right)\cdot\vec{k_{i}}\\
+R\cdot U\cdot B\cdot\vec{h} & =\vec{Q}
+\end{align*}
+
+<p>
+ou \(\vec{h}\) est le vecteur \((h,k,l)\), \(\vec{k_{i}}\) est le vecteur
+incident, \(S_{i}\) les matrices de rotations des mouvements liés à
+l'échantillon, \(D_{j}\) les matrices de rotation des mouvements liés au
+détecteur, \(I\) la matrice identité, \(U\) la matrice d'orientation du
+cristal par rapport au repère de l'axe sur lequel ce dernier est monté
+et \(B\) la matrice de passage d'un repère non orthonormé ( celui du
+crystal réciproque) à un repère orthonormé.
+</p>
+</div>
+
+<div id="outline-container-sec-1-5-1" class="outline-4">
+<h4 id="sec-1-5-1"><span class="section-number-4">1.5.1</span> Calcule de B</h4>
+<div class="outline-text-4" id="text-1-5-1">
+<p>
+Si l'on connaît les paramètres cristallins du cristal étudié, il est
+très simple de calculer \(B\):
+</p>
+
+\begin{displaymath}
+B=
+\begin{bmatrix}
+a^{\star} & b^{\star}\cos\gamma^{\star} & c^{\star}\cos\beta^{\star}\\
+0 & b^{\star}\sin\gamma^{\star} & -c^{\star}\sin\beta^{\star}\cos\alpha\\
+0 & 0 & 1/c
+\end{bmatrix}
+\end{displaymath}
+</div>
+</div>
+
+<div id="outline-container-sec-1-5-2" class="outline-4">
+<h4 id="sec-1-5-2"><span class="section-number-4">1.5.2</span> Calcule de U</h4>
+<div class="outline-text-4" id="text-1-5-2">
+<p>
+Il existe plusieurs façons de calculer \(U\). Busing et Levy en a proposé
+plusieurs. Nous allons présenter celle qui nécessite la mesure de
+seulement deux réflections ainsi que la connaissance des paramètres
+cristallins. Cette façon de calculer la matrice d'orientation \(U\), peut
+être généralisée à n'importe quel diffractomètre pour peu que la
+description des axes de rotation permette d'obtenir la matrice de
+rotation de la machine \(R\) et le vecteur de diffusion \(\vec{Q}\).
+</p>
+
+<p>
+Il est également possible de calculer \(U\) sans la connaîssance des
+paramètres cristallins. il faut alors faire un affinement des
+paramètres. Cela revient à minimiser une fonction. Nous allons utiliser
+la méthode du simplex pour trouver ce minimum et donc ajuster l'ensemble
+des paramètres cristallins ainsi que la matrice d'orientation.
+</p>
+</div>
+</div>
+
+<div id="outline-container-sec-1-5-3" class="outline-4">
+<h4 id="sec-1-5-3"><span class="section-number-4">1.5.3</span> Algorithme de Busing Levy</h4>
+<div class="outline-text-4" id="text-1-5-3">
+<p>
+L'idée est de se placer dans le repère de l'axe sur lequel est monté
+l'échantillon. On mesure deux réflections \((\vec{h}_{1},\vec{h}_{2})\)
+ainsi que leurs angles associés. Cela nous permet de calculer \(R\) et
+\(\vec{Q}\) pour chacune de ces reflections. nous avons alors ce système:
+</p>
+
+\begin{eqnarray*}
+U\cdot B\cdot\vec{h}_{1} & = & \tilde{R}_{1}\cdot\vec{Q}_{1}\\
+U\cdot B\cdot\vec{h}_{2} & = & \tilde{R}_{2}\cdot\vec{Q}_{2}
+\end{eqnarray*}
+
+<p>
+De façon à calculer facilement \(U\), il est intéressant de définir deux
+trièdres orthonormé \(T_{\vec{h}}\) et \(T_{\vec{Q}}\) à partir des vecteurs
+\((B\vec{h}_{1},B\vec{h}_{2})\) et
+\((\tilde{R}_{1}\vec{Q}_{1},\tilde{R}_{2}\vec{Q}_{2})\). On a alors très
+simplement:
+</p>
+
+\begin{displaymath}
+U \cdot T_{\vec{h}} = T_{\vec{Q}}
+\end{displaymath}
+
+<p>
+Et donc
+</p>
+
+\begin{displaymath}
+U = T_{\vec{Q}} \cdot \tilde{T}_{\vec{h}}
+\end{displaymath}
+</div>
+</div>
+
+<div id="outline-container-sec-1-5-4" class="outline-4">
+<h4 id="sec-1-5-4"><span class="section-number-4">1.5.4</span> Affinement par la méthode du simplex</h4>
+<div class="outline-text-4" id="text-1-5-4">
+<p>
+Dans ce cas nous ne connaissons pas la matrice \(B\), il faut donc mesurer
+plus que deux réflections pour ajuster les 9 paramètres. Six paramètres
+pour le crystal et trois pour la matrice d'orientation \(U\). Les trois
+paramètres qui permennt de representer \(U\) sont en fait les angles
+d'euler. il faut donc être en mesure de passer d'une représentation
+eulérien à cette matrice :math::U et réciproquement.
+</p>
+
+\begin{displaymath}
+U = X \cdot Y \cdot Z
+\end{displaymath}
+
+<p>
+où \(X\) est la matrice rotation suivant l'axe Ox et le premier angle
+d'Euler, \(Y\) la matrice de rotation suivant l'axe Oy et le deuxième
+angle d'Euler et \(Z\) la matrice du troisième angle d'Euler pour l'axe
+Oz.
+</p>
+
+<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
+
+
+<colgroup>
+<col  class="left" />
+
+<col  class="left" />
+
+<col  class="left" />
+</colgroup>
+<tbody>
+<tr>
+<td class="left">\(X\)</td>
+<td class="left">\(Y\)</td>
+<td class="left">\(Z\)</td>
+</tr>
+
+<tr>
+<td class="left">\(\begin{bmatrix} 1 & 0 & 0\\ 0 & A & -B\\ 0 & B & A \end{bmatrix}\)</td>
+<td class="left">\(\begin{bmatrix}C & 0 & D\\0 & 1 & 0\\-D & 0 & C\end{bmatrix}\)</td>
+<td class="left">\(\begin{bmatrix}E & -F & 0\\F & E & 0\\0 & 0 & 1\end{bmatrix}\)</td>
+</tr>
+</tbody>
+</table>
+
+<p>
+et donc:
+</p>
+
+\begin{displaymath}
+U=
+\begin{bmatrix}
+CE & -CF & D\\
+BDE+AF & -BDF+AE & -BC\\
+-ADE+BF & ADF+BE & AC
+\end{bmatrix}
+\end{displaymath}
+
+<p>
+Il est donc facile de passer des angles d'Euler à la matrice
+d'orientation.
+</p>
+
+<p>
+Il faut maintenant faire la transformation inverse de la matrice \(U\)
+vers les angles d'euler.
+</p>
+</div>
+</div>
+</div>
+</div>
+
+<div id="outline-container-sec-2" class="outline-2">
+<h2 id="sec-2"><span class="section-number-2">2</span> PseudoAxes</h2>
+<div class="outline-text-2" id="text-2">
+<p>
+This section describe the calculations done by the library for the
+different kind of pseudo axes.
+</p>
+</div>
+<div id="outline-container-sec-2-1" class="outline-3">
+<h3 id="sec-2-1"><span class="section-number-3">2.1</span> Eulerians to Kappa angles</h3>
+<div class="outline-text-3" id="text-2-1">
+<p>
+1st solution
+</p>
+
+\begin{eqnarray*}
+\kappa_\omega & = & \omega - p + \frac{\pi}{2} \\
+\kappa & = & 2 \arcsin\left(\frac{\sin\frac{\chi}{2}}{\sin\alpha}\right) \\
+\kappa_\phi & = &  \phi - p - \frac{\pi}{2}
+\end{eqnarray*}
+
+<p>
+or 2nd one
+</p>
+
+\begin{eqnarray*}
+\kappa_\omega & = & \omega - p - \frac{\pi}{2} \\
+\kappa & = & -2 \arcsin\left(\frac{\sin\frac{\chi}{2}}{\sin\alpha}\right) \\
+\kappa_\phi & = &  \phi - p + \frac{\pi}{2}
+\end{eqnarray*}
+
+<p>
+where
+</p>
+
+\begin{displaymath}
+p = \arcsin\left(\frac{\tan\frac{\chi}{2}}{\tan\alpha}\right)
+\end{displaymath}
+
+<p>
+and \(\alpha\) is the angle of the kappa axis with the \(\vec{y}\) axis.
+</p>
+</div>
+</div>
+
+<div id="outline-container-sec-2-2" class="outline-3">
+<h3 id="sec-2-2"><span class="section-number-3">2.2</span> Kappa to Eulerians angles</h3>
+<div class="outline-text-3" id="text-2-2">
+<p>
+1st solution
+</p>
+
+\begin{eqnarray*}
+\omega & = & \kappa_\omega + p - \frac{\pi}{2} \\
+\chi   & = & 2 \arcsin\left(\sin\frac{\kappa}{2} \sin\alpha\right) \\
+\phi   & = & \kappa_\phi + p + \frac{\pi}{2}
+\end{eqnarray*}
+
+<p>
+or 2nd one
+</p>
+
+\begin{eqnarray*}
+\omega & = & \kappa_\omega + p + \frac{\pi}{2} \\
+\chi   & = & -2 \arcsin\left(\sin\frac{\kappa}{2} \sin\alpha\right) \\
+\phi   & = & \kappa_\phi + p - \frac{\pi}{2}
+\end{eqnarray*}
+
+<p>
+where
+</p>
+
+\begin{displaymath}
+p = \arctan\left(\tan\frac{\kappa}{2} \cos\alpha\right)
+\end{displaymath}
+
+
+<div class="figure">
+<p><img src="./figures/e2k_1.png" alt="e2k_1.png" />
+</p>
+<p><span class="figure-number">Figure 2:</span> \(\omega = 0\), \(\chi = 0\), \(\phi = 0\), 1st solution</p>
+</div>
+
+
+<div class="figure">
+<p><img src="./figures/e2k_2.png" alt="e2k_2.png" />
+</p>
+<p><span class="figure-number">Figure 3:</span> \(\omega = 0\), \(\chi = 0\), \(\phi = 0\), 2nd solution</p>
+</div>
+
+
+<div class="figure">
+<p><img src="./figures/e2k_3.png" alt="e2k_3.png" />
+</p>
+<p><span class="figure-number">Figure 4:</span> \(\omega = 0\), \(\chi = 90\), \(\phi = 0\), 1st solution</p>
+</div>
+
+
+<div class="figure">
+<p><img src="./figures/e2k_4.png" alt="e2k_4.png" />
+</p>
+<p><span class="figure-number">Figure 5:</span> \(\omega = 0\), \(\chi = 90\), \(\phi = 0\), 2nd solution</p>
+</div>
+</div>
+</div>
+
+<div id="outline-container-sec-2-3" class="outline-3">
+<h3 id="sec-2-3"><span class="section-number-3">2.3</span> Qper and Qpar</h3>
+<div class="outline-text-3" id="text-2-3">
+
+<div class="figure">
+<p><img src="./figures/qper_qpar.png" alt="qper_qpar.png" />
+</p>
+</div>
+
+<p>
+this pseudo axis engine compute the perpendicular
+(\(\left|\left|\vec{Q_\text{per}}\right|\right|\)) and parallel
+(\(\left|\left|\vec{Q_\text{par}}\right|\right|\)) contribution of
+\(\vec{Q}\) relatively to the surface of the sample defined by the
+\(\vec{n}\) vector.
+</p>
+
+\begin{eqnarray*}
+\vec{q} & = & \vec{k_\text{f}} - \vec{k_\text{i}} \\
+\vec{q} & = & \vec{q_\text{per}} + \vec{q_\text{par}} \\
+\vec{q_\text{per}} & = & \frac{\vec{q} \cdot \vec{n}}{\left|\left|\vec{n}\right|\right|} \frac{\vec{n}}{\left|\left|\vec{n}\right|\right|}
+\end{eqnarray*}
+</div>
+</div>
+</div>
+<div id="outline-container-sec-3" class="outline-2">
+<h2 id="sec-3"><span class="section-number-2">3</span> Diffractometers</h2>
+<div class="outline-text-2" id="text-3">
+<blockquote>
+<p>
+<b>warning</b>
+</p>
+
+<p>
+This section is automatically generating by introspecting the hkl library.
+</p>
+</blockquote>
+</div>
+<div id="outline-container-sec-3-1" class="outline-3">
+<h3 id="sec-3-1"><span class="section-number-3">3.1</span> E4CH</h3>
+<div class="outline-text-3" id="text-3-1">
+</div><div id="outline-container-sec-3-1-1" class="outline-4">
+<h4 id="sec-3-1-1"><span class="section-number-4">3.1.1</span> Axes:</h4>
+<div class="outline-text-4" id="text-3-1-1">
+<ul class="org-ul">
+<li>"<b>omega</b>": rotation around the <b>[0.0, 0.0, 1.0]</b> axis
+</li>
+<li>"<b>chi</b>": rotation around the <b>[1.0, 0.0, 0.0]</b> axis
+</li>
+<li>"<b>phi</b>": rotation around the <b>[0.0, 0.0, 1.0]</b> axis
+</li>
+<li>"<b>tth</b>": rotation around the <b>[0.0, 0.0, 1.0]</b> axis
+</li>
+</ul>
+</div>
+</div>
+<div id="outline-container-sec-3-1-2" class="outline-4">
+<h4 id="sec-3-1-2"><span class="section-number-4">3.1.2</span> Engines:</h4>
+<div class="outline-text-4" id="text-3-1-2">
+</div><ol class="org-ol"><li><a id="sec-3-1-2-1" name="sec-3-1-2-1"></a>"<b>hkl</b>":<br  /><div class="outline-text-5" id="text-3-1-2-1">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>h</b>" : h coordinate of the diffracting plan
+</li>
+
+<li>"<b>k</b>" : k coordinate of the diffracting plan
+</li>
+
+<li>"<b>l</b>" : l coordinate of the diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>bissector</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_omega</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_chi</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_phi</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>tth</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>double_diffraction</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the second diffracting plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the second diffracting plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the second diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>psi_constant</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the reference plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the reference plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the reference plan
+</li>
+<li><b>psi</b> [0.0]: expected angle between the reference and the diffraction plans
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-1-2-2" name="sec-3-1-2-2"></a>"<b>psi</b>":<br  /><div class="outline-text-5" id="text-3-1-2-2">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>psi</b>" : angle between the reference vector and the diffraction plan
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>psi</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the reference plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the reference plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the reference plan
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-1-2-3" name="sec-3-1-2-3"></a>"<b>q</b>":<br  /><div class="outline-text-5" id="text-3-1-2-3">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>q</b>" : the norm of \(\vec{q}\)
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>q</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>tth</b>"
+</li>
+<li>axes (write): "<b>tth</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li></ol>
+</div>
+</div>
+<div id="outline-container-sec-3-2" class="outline-3">
+<h3 id="sec-3-2"><span class="section-number-3">3.2</span> E4CV</h3>
+<div class="outline-text-3" id="text-3-2">
+</div><div id="outline-container-sec-3-2-1" class="outline-4">
+<h4 id="sec-3-2-1"><span class="section-number-4">3.2.1</span> Axes:</h4>
+<div class="outline-text-4" id="text-3-2-1">
+<ul class="org-ul">
+<li>"<b>omega</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+<li>"<b>chi</b>": rotation around the <b>[1.0, 0.0, 0.0]</b> axis
+</li>
+<li>"<b>phi</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+<li>"<b>tth</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+</ul>
+</div>
+</div>
+<div id="outline-container-sec-3-2-2" class="outline-4">
+<h4 id="sec-3-2-2"><span class="section-number-4">3.2.2</span> Engines:</h4>
+<div class="outline-text-4" id="text-3-2-2">
+</div><ol class="org-ol"><li><a id="sec-3-2-2-1" name="sec-3-2-2-1"></a>"<b>hkl</b>":<br  /><div class="outline-text-5" id="text-3-2-2-1">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>h</b>" : h coordinate of the diffracting plan
+</li>
+
+<li>"<b>k</b>" : k coordinate of the diffracting plan
+</li>
+
+<li>"<b>l</b>" : l coordinate of the diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>bissector</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_omega</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_chi</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_phi</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>tth</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>double_diffraction</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the second diffracting plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the second diffracting plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the second diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>psi_constant</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the reference plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the reference plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the reference plan
+</li>
+<li><b>psi</b> [0.0]: expected angle between the reference and the diffraction plans
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-2-2-2" name="sec-3-2-2-2"></a>"<b>psi</b>":<br  /><div class="outline-text-5" id="text-3-2-2-2">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>psi</b>" : angle between the reference vector and the diffraction plan
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>psi</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the reference plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the reference plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the reference plan
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-2-2-3" name="sec-3-2-2-3"></a>"<b>q</b>":<br  /><div class="outline-text-5" id="text-3-2-2-3">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>q</b>" : the norm of \(\vec{q}\)
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>q</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>tth</b>"
+</li>
+<li>axes (write): "<b>tth</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li></ol>
+</div>
+</div>
+<div id="outline-container-sec-3-3" class="outline-3">
+<h3 id="sec-3-3"><span class="section-number-3">3.3</span> E6C</h3>
+<div class="outline-text-3" id="text-3-3">
+</div><div id="outline-container-sec-3-3-1" class="outline-4">
+<h4 id="sec-3-3-1"><span class="section-number-4">3.3.1</span> Axes:</h4>
+<div class="outline-text-4" id="text-3-3-1">
+<ul class="org-ul">
+<li>"<b>mu</b>": rotation around the <b>[0.0, 0.0, 1.0]</b> axis
+</li>
+<li>"<b>omega</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+<li>"<b>chi</b>": rotation around the <b>[1.0, 0.0, 0.0]</b> axis
+</li>
+<li>"<b>phi</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+<li>"<b>gamma</b>": rotation around the <b>[0.0, 0.0, 1.0]</b> axis
+</li>
+<li>"<b>delta</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+</ul>
+</div>
+</div>
+<div id="outline-container-sec-3-3-2" class="outline-4">
+<h4 id="sec-3-3-2"><span class="section-number-4">3.3.2</span> Engines:</h4>
+<div class="outline-text-4" id="text-3-3-2">
+</div><ol class="org-ol"><li><a id="sec-3-3-2-1" name="sec-3-3-2-1"></a>"<b>hkl</b>":<br  /><div class="outline-text-5" id="text-3-3-2-1">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>h</b>" : h coordinate of the diffracting plan
+</li>
+
+<li>"<b>k</b>" : k coordinate of the diffracting plan
+</li>
+
+<li>"<b>l</b>" : l coordinate of the diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>bissector_vertical</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_omega_vertical</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>chi</b>", "<b>phi</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_chi_vertical</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>phi</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_phi_vertical</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>lifting_detector_phi</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>phi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>lifting_detector_omega</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>lifting_detector_mu</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>mu</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>double_diffraction_vertical</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>delta</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the second diffracting plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the second diffracting plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the second diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>bissector_horizontal</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>gamma</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>double_diffraction_horizontal</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>mu</b>", "<b>chi</b>", "<b>phi</b>", "<b>gamma</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the second diffracting plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the second diffracting plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the second diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>psi_constant_vertical</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>delta</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the reference plan
+</li>
+<li><b>k2</b> [0.0]: k coordinate of the reference plan
+</li>
+<li><b>l2</b> [0.0]: l coordinate of the reference plan
+</li>
+<li><b>psi</b> [0.0]: expected angle between the reference and the diffraction plans
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>psi_constant_horizontal</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>gamma</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the reference plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the reference plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the reference plan
+</li>
+<li><b>psi</b> [0.0]: expected angle between the reference and the diffraction plans
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_mu_horizontal</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>chi</b>", "<b>phi</b>", "<b>gamma</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-3-2-2" name="sec-3-3-2-2"></a>"<b>psi</b>":<br  /><div class="outline-text-5" id="text-3-3-2-2">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>psi</b>" : angle between the reference vector and the diffraction plan
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>psi_vertical</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>delta</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the reference plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the reference plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the reference plan
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-3-2-3" name="sec-3-3-2-3"></a>"<b>q2</b>":<br  /><div class="outline-text-5" id="text-3-3-2-3">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>q</b>" : the norm of \(\vec{q}\)
+</li>
+
+<li>"<b>alpha</b>" : angle of the projection of \(\vec{q}\) on the \(yOz\) plan and \(\vec{y}\)
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>q2</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-3-2-4" name="sec-3-3-2-4"></a>"<b>qper_qpar</b>":<br  /><div class="outline-text-5" id="text-3-3-2-4">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>qper</b>" : perpendicular component of \(\vec{q}\) along the normal of the sample surface
+</li>
+
+<li>"<b>qpar</b>" : parallel component of \(\vec{q}\)
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>qper_qpar</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>x</b> [0.0]: the first coordinate of the surface vector
+</li>
+<li><b>y</b> [1.0]: the second coordinate of the surface vector
+</li>
+<li><b>z</b> [0.0]: the third coordinate of the surface vector
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li></ol>
+</div>
+</div>
+<div id="outline-container-sec-3-4" class="outline-3">
+<h3 id="sec-3-4"><span class="section-number-3">3.4</span> K4CV</h3>
+<div class="outline-text-3" id="text-3-4">
+</div><div id="outline-container-sec-3-4-1" class="outline-4">
+<h4 id="sec-3-4-1"><span class="section-number-4">3.4.1</span> Axes:</h4>
+<div class="outline-text-4" id="text-3-4-1">
+<ul class="org-ul">
+<li>"<b>komega</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+<li>"<b>kappa</b>": rotation around the <b>[0.0, -0.6427876096865394, -0.766044443118978]</b> axis
+</li>
+<li>"<b>kphi</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+<li>"<b>tth</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+</ul>
+</div>
+</div>
+<div id="outline-container-sec-3-4-2" class="outline-4">
+<h4 id="sec-3-4-2"><span class="section-number-4">3.4.2</span> Engines:</h4>
+<div class="outline-text-4" id="text-3-4-2">
+</div><ol class="org-ol"><li><a id="sec-3-4-2-1" name="sec-3-4-2-1"></a>"<b>hkl</b>":<br  /><div class="outline-text-5" id="text-3-4-2-1">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>h</b>" : h coordinate of the diffracting plan
+</li>
+
+<li>"<b>k</b>" : k coordinate of the diffracting plan
+</li>
+
+<li>"<b>l</b>" : l coordinate of the diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>bissector</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>tth</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_omega</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>tth</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>omega</b> [0.0]: the freezed value
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_chi</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>tth</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>chi</b> [0.0]: the freezed value
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_phi</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>tth</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>phi</b> [0.0]: the freezed value
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>double_diffraction</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>tth</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the second diffracting plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the second diffracting plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the second diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>psi_constant</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>tth</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the reference plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the reference plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the reference plan
+</li>
+<li><b>psi</b> [0.0]: expected angle between the reference and the diffraction plans
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-4-2-2" name="sec-3-4-2-2"></a>"<b>eulerians</b>":<br  /><div class="outline-text-5" id="text-3-4-2-2">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>omega</b>" : omega equivalent for a four circle eulerian geometry
+</li>
+
+<li>"<b>chi</b>" : chi equivalent for a four circle eulerian geometry
+</li>
+
+<li>"<b>phi</b>" : phi equivalent for a four circle eulerian geometry
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>eulerians</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>solutions</b> [1.0]: (0/1) to select the first or second solution
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-4-2-3" name="sec-3-4-2-3"></a>"<b>psi</b>":<br  /><div class="outline-text-5" id="text-3-4-2-3">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>psi</b>" : angle between the reference vector and the diffraction plan
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>psi</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>tth</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the reference plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the reference plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the reference plan
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-4-2-4" name="sec-3-4-2-4"></a>"<b>q</b>":<br  /><div class="outline-text-5" id="text-3-4-2-4">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>q</b>" : the norm of \(\vec{q}\)
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>q</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>tth</b>"
+</li>
+<li>axes (write): "<b>tth</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li></ol>
+</div>
+</div>
+<div id="outline-container-sec-3-5" class="outline-3">
+<h3 id="sec-3-5"><span class="section-number-3">3.5</span> K6C</h3>
+<div class="outline-text-3" id="text-3-5">
+</div><div id="outline-container-sec-3-5-1" class="outline-4">
+<h4 id="sec-3-5-1"><span class="section-number-4">3.5.1</span> Axes:</h4>
+<div class="outline-text-4" id="text-3-5-1">
+<ul class="org-ul">
+<li>"<b>mu</b>": rotation around the <b>[0.0, 0.0, 1.0]</b> axis
+</li>
+<li>"<b>komega</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+<li>"<b>kappa</b>": rotation around the <b>[0.0, -0.6427876096865394, -0.766044443118978]</b> axis
+</li>
+<li>"<b>kphi</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+<li>"<b>gamma</b>": rotation around the <b>[0.0, 0.0, 1.0]</b> axis
+</li>
+<li>"<b>delta</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+</ul>
+</div>
+</div>
+<div id="outline-container-sec-3-5-2" class="outline-4">
+<h4 id="sec-3-5-2"><span class="section-number-4">3.5.2</span> Engines:</h4>
+<div class="outline-text-4" id="text-3-5-2">
+</div><ol class="org-ol"><li><a id="sec-3-5-2-1" name="sec-3-5-2-1"></a>"<b>hkl</b>":<br  /><div class="outline-text-5" id="text-3-5-2-1">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>h</b>" : h coordinate of the diffracting plan
+</li>
+
+<li>"<b>k</b>" : k coordinate of the diffracting plan
+</li>
+
+<li>"<b>l</b>" : l coordinate of the diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>bissector_vertical</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_omega_vertical</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>omega</b> [0.0]: the freezed value
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_chi_vertical</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>chi</b> [0.0]: the freezed value
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_phi_vertical</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>phi</b> [0.0]: the freezed value
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>lifting_detector_kphi</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>kphi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>lifting_detector_komega</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>lifting_detector_mu</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>mu</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>double_diffraction_vertical</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the second diffracting plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the second diffracting plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the second diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>bissector_horizontal</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_phi_horizontal</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>phi</b> [0.0]: the freezed value
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_kphi_horizontal</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>gamma</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>double_diffraction_horizontal</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the second diffracting plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the second diffracting plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the second diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>psi_constant_vertical</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the reference plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the reference plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the reference plan
+</li>
+<li><b>psi</b> [0.0]: expected angle between the reference and the diffraction plans
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_incidence</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>x</b> [1.0]: the x coordinate of the surface \(\vec{n}\)
+</li>
+<li><b>y</b> [1.0]: the y coordinate of the surface \(\vec{n}\)
+</li>
+<li><b>z</b> [1.0]: the z coordinate of the surface \(\vec{n}\)
+</li>
+<li><b>incidence</b> [0.0]: expected incidence of the incoming beam \(\vec{k_i}\) on the surface.
+</li>
+<li><b>azimuth</b> [90.0]: expected azimuth
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-5-2-2" name="sec-3-5-2-2"></a>"<b>eulerians</b>":<br  /><div class="outline-text-5" id="text-3-5-2-2">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>omega</b>" : omega equivalent for a four circle eulerian geometry
+</li>
+
+<li>"<b>chi</b>" : chi equivalent for a four circle eulerian geometry
+</li>
+
+<li>"<b>phi</b>" : phi equivalent for a four circle eulerian geometry
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>eulerians</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>solutions</b> [1.0]: (0/1) to select the first or second solution
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-5-2-3" name="sec-3-5-2-3"></a>"<b>psi</b>":<br  /><div class="outline-text-5" id="text-3-5-2-3">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>psi</b>" : angle between the reference vector and the diffraction plan
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>psi_vertical</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the reference plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the reference plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the reference plan
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-5-2-4" name="sec-3-5-2-4"></a>"<b>q2</b>":<br  /><div class="outline-text-5" id="text-3-5-2-4">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>q</b>" : the norm of \(\vec{q}\)
+</li>
+
+<li>"<b>alpha</b>" : angle of the projection of \(\vec{q}\) on the \(yOz\) plan and \(\vec{y}\)
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>q2</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-5-2-5" name="sec-3-5-2-5"></a>"<b>qper_qpar</b>":<br  /><div class="outline-text-5" id="text-3-5-2-5">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>qper</b>" : perpendicular component of \(\vec{q}\) along the normal of the sample surface
+</li>
+
+<li>"<b>qpar</b>" : parallel component of \(\vec{q}\)
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>qper_qpar</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>x</b> [0.0]: the first coordinate of the surface vector
+</li>
+<li><b>y</b> [1.0]: the second coordinate of the surface vector
+</li>
+<li><b>z</b> [0.0]: the third coordinate of the surface vector
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li></ol>
+</div>
+</div>
+<div id="outline-container-sec-3-6" class="outline-3">
+<h3 id="sec-3-6"><span class="section-number-3">3.6</span> PETRA3 P09 EH2</h3>
+<div class="outline-text-3" id="text-3-6">
+</div><div id="outline-container-sec-3-6-1" class="outline-4">
+<h4 id="sec-3-6-1"><span class="section-number-4">3.6.1</span> Axes:</h4>
+<div class="outline-text-4" id="text-3-6-1">
+<ul class="org-ul">
+<li>"<b>mu</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+<li>"<b>omega</b>": rotation around the <b>[0.0, 0.0, 1.0]</b> axis
+</li>
+<li>"<b>chi</b>": rotation around the <b>[1.0, 0.0, 0.0]</b> axis
+</li>
+<li>"<b>phi</b>": rotation around the <b>[0.0, 0.0, 1.0]</b> axis
+</li>
+<li>"<b>delta</b>": rotation around the <b>[0.0, 0.0, 1.0]</b> axis
+</li>
+<li>"<b>gamma</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+</ul>
+</div>
+</div>
+<div id="outline-container-sec-3-6-2" class="outline-4">
+<h4 id="sec-3-6-2"><span class="section-number-4">3.6.2</span> Engines:</h4>
+<div class="outline-text-4" id="text-3-6-2">
+</div><ol class="org-ol"><li><a id="sec-3-6-2-1" name="sec-3-6-2-1"></a>"<b>hkl</b>":<br  /><div class="outline-text-5" id="text-3-6-2-1">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>h</b>" : h coordinate of the diffracting plan
+</li>
+
+<li>"<b>k</b>" : k coordinate of the diffracting plan
+</li>
+
+<li>"<b>l</b>" : l coordinate of the diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>zaxis + alpha-fixed</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>zaxis + beta-fixed</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>mu</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>zaxis + alpha=beta</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>mu</b>", "<b>omega</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>4-circles bissecting horizontal</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>4-circles constant omega horizontal</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>chi</b>", "<b>phi</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>4-circles constant chi horizontal</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>phi</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>4-circles constant phi horizontal</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li></ol>
+</div>
+</div>
+<div id="outline-container-sec-3-7" class="outline-3">
+<h3 id="sec-3-7"><span class="section-number-3">3.7</span> SOLEIL MARS</h3>
+<div class="outline-text-3" id="text-3-7">
+</div><div id="outline-container-sec-3-7-1" class="outline-4">
+<h4 id="sec-3-7-1"><span class="section-number-4">3.7.1</span> Axes:</h4>
+<div class="outline-text-4" id="text-3-7-1">
+<ul class="org-ul">
+<li>"<b>omega</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+<li>"<b>chi</b>": rotation around the <b>[-1.0, 0.0, 0.0]</b> axis
+</li>
+<li>"<b>phi</b>": rotation around the <b>[0.0, 0.0, 1.0]</b> axis
+</li>
+<li>"<b>tth</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+</ul>
+</div>
+</div>
+<div id="outline-container-sec-3-7-2" class="outline-4">
+<h4 id="sec-3-7-2"><span class="section-number-4">3.7.2</span> Engines:</h4>
+<div class="outline-text-4" id="text-3-7-2">
+</div><ol class="org-ol"><li><a id="sec-3-7-2-1" name="sec-3-7-2-1"></a>"<b>hkl</b>":<br  /><div class="outline-text-5" id="text-3-7-2-1">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>h</b>" : h coordinate of the diffracting plan
+</li>
+
+<li>"<b>k</b>" : k coordinate of the diffracting plan
+</li>
+
+<li>"<b>l</b>" : l coordinate of the diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>bissector</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_omega</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_chi</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_phi</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>tth</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>double_diffraction</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the second diffracting plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the second diffracting plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the second diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>psi_constant</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the reference plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the reference plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the reference plan
+</li>
+<li><b>psi</b> [0.0]: expected angle between the reference and the diffraction plans
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-7-2-2" name="sec-3-7-2-2"></a>"<b>psi</b>":<br  /><div class="outline-text-5" id="text-3-7-2-2">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>psi</b>" : angle between the reference vector and the diffraction plan
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>psi</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>chi</b>", "<b>phi</b>", "<b>tth</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the reference plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the reference plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the reference plan
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-7-2-3" name="sec-3-7-2-3"></a>"<b>q</b>":<br  /><div class="outline-text-5" id="text-3-7-2-3">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>q</b>" : the norm of \(\vec{q}\)
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>q</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>tth</b>"
+</li>
+<li>axes (write): "<b>tth</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li></ol>
+</div>
+</div>
+<div id="outline-container-sec-3-8" class="outline-3">
+<h3 id="sec-3-8"><span class="section-number-3">3.8</span> SOLEIL SIRIUS KAPPA</h3>
+<div class="outline-text-3" id="text-3-8">
+</div><div id="outline-container-sec-3-8-1" class="outline-4">
+<h4 id="sec-3-8-1"><span class="section-number-4">3.8.1</span> Axes:</h4>
+<div class="outline-text-4" id="text-3-8-1">
+<ul class="org-ul">
+<li>"<b>mu</b>": rotation around the <b>[0.0, 0.0, -1.0]</b> axis
+</li>
+<li>"<b>komega</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+<li>"<b>kappa</b>": rotation around the <b>[0.0, -0.6427876096865394, -0.766044443118978]</b> axis
+</li>
+<li>"<b>kphi</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+<li>"<b>delta</b>": rotation around the <b>[0.0, 0.0, -1.0]</b> axis
+</li>
+<li>"<b>gamma</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+</ul>
+</div>
+</div>
+<div id="outline-container-sec-3-8-2" class="outline-4">
+<h4 id="sec-3-8-2"><span class="section-number-4">3.8.2</span> Engines:</h4>
+<div class="outline-text-4" id="text-3-8-2">
+</div><ol class="org-ol"><li><a id="sec-3-8-2-1" name="sec-3-8-2-1"></a>"<b>hkl</b>":<br  /><div class="outline-text-5" id="text-3-8-2-1">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>h</b>" : h coordinate of the diffracting plan
+</li>
+
+<li>"<b>k</b>" : k coordinate of the diffracting plan
+</li>
+
+<li>"<b>l</b>" : l coordinate of the diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>bissector_vertical</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_omega_vertical</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>omega</b> [0.0]: the freezed value
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_chi_vertical</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>chi</b> [0.0]: the freezed value
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_phi_vertical</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>phi</b> [0.0]: the freezed value
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>lifting_detector_kphi</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>kphi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>lifting_detector_komega</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>lifting_detector_mu</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>mu</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>double_diffraction_vertical</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the second diffracting plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the second diffracting plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the second diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>bissector_horizontal</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_phi_horizontal</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>phi</b> [0.0]: the freezed value
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_kphi_horizontal</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>double_diffraction_horizontal</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the second diffracting plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the second diffracting plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the second diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>psi_constant_vertical</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the reference plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the reference plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the reference plan
+</li>
+<li><b>psi</b> [0.0]: expected angle between the reference and the diffraction plans
+</li>
+</ul>
+</li>
+</ul>
+</li>
+<li>mode: "<b>constant_incidence</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>x</b> [1.0]: the x coordinate of the surface \(\vec{n}\)
+</li>
+<li><b>y</b> [1.0]: the y coordinate of the surface \(\vec{n}\)
+</li>
+<li><b>z</b> [1.0]: the z coordinate of the surface \(\vec{n}\)
+</li>
+<li><b>incidence</b> [0.0]: expected incidence of the incoming beam \(\vec{k_i}\) on the surface.
+</li>
+<li><b>azimuth</b> [90.0]: expected azimuth
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-8-2-2" name="sec-3-8-2-2"></a>"<b>eulerians</b>":<br  /><div class="outline-text-5" id="text-3-8-2-2">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>omega</b>" : omega equivalent for a four circle eulerian geometry
+</li>
+
+<li>"<b>chi</b>" : chi equivalent for a four circle eulerian geometry
+</li>
+
+<li>"<b>phi</b>" : phi equivalent for a four circle eulerian geometry
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>eulerians</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>solutions</b> [1.0]: (0/1) to select the first or second solution
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-8-2-3" name="sec-3-8-2-3"></a>"<b>psi</b>":<br  /><div class="outline-text-5" id="text-3-8-2-3">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>psi</b>" : angle between the reference vector and the diffraction plan
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>psi_vertical_soleil_sirius_kappa</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>komega</b>", "<b>kappa</b>", "<b>kphi</b>", "<b>gamma</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>h2</b> [1.0]: h coordinate of the reference plan
+</li>
+<li><b>k2</b> [1.0]: k coordinate of the reference plan
+</li>
+<li><b>l2</b> [1.0]: l coordinate of the reference plan
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-8-2-4" name="sec-3-8-2-4"></a>"<b>q2</b>":<br  /><div class="outline-text-5" id="text-3-8-2-4">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>q</b>" : the norm of \(\vec{q}\)
+</li>
+
+<li>"<b>alpha</b>" : angle of the projection of \(\vec{q}\) on the \(yOz\) plan and \(\vec{y}\)
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>q2</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-8-2-5" name="sec-3-8-2-5"></a>"<b>qper_qpar</b>":<br  /><div class="outline-text-5" id="text-3-8-2-5">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>qper</b>" : perpendicular component of \(\vec{q}\) along the normal of the sample surface
+</li>
+
+<li>"<b>qpar</b>" : parallel component of \(\vec{q}\)
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>qper_qpar</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>x</b> [0.0]: the first coordinate of the surface vector
+</li>
+<li><b>y</b> [1.0]: the second coordinate of the surface vector
+</li>
+<li><b>z</b> [0.0]: the third coordinate of the surface vector
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li></ol>
+</div>
+</div>
+<div id="outline-container-sec-3-9" class="outline-3">
+<h3 id="sec-3-9"><span class="section-number-3">3.9</span> SOLEIL SIRIUS TURRET</h3>
+<div class="outline-text-3" id="text-3-9">
+</div><div id="outline-container-sec-3-9-1" class="outline-4">
+<h4 id="sec-3-9-1"><span class="section-number-4">3.9.1</span> Axes:</h4>
+<div class="outline-text-4" id="text-3-9-1">
+<ul class="org-ul">
+<li>"<b>thetah</b>": rotation around the <b>[0.0, 0.0, -1.0]</b> axis
+</li>
+<li>"<b>alphay</b>": rotation around the <b>[0.0, 1.0, 0.0]</b> axis
+</li>
+<li>"<b>alphax</b>": rotation around the <b>[1.0, 0.0, 0.0]</b> axis
+</li>
+<li>"<b>delta</b>": rotation around the <b>[0.0, 0.0, -1.0]</b> axis
+</li>
+<li>"<b>gamma</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+</ul>
+</div>
+</div>
+<div id="outline-container-sec-3-9-2" class="outline-4">
+<h4 id="sec-3-9-2"><span class="section-number-4">3.9.2</span> Engines:</h4>
+<div class="outline-text-4" id="text-3-9-2">
+</div><ol class="org-ol"><li><a id="sec-3-9-2-1" name="sec-3-9-2-1"></a>"<b>hkl</b>":<br  /><div class="outline-text-5" id="text-3-9-2-1">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>h</b>" : h coordinate of the diffracting plan
+</li>
+
+<li>"<b>k</b>" : k coordinate of the diffracting plan
+</li>
+
+<li>"<b>l</b>" : l coordinate of the diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>lifting_detector_thetah</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>thetah</b>", "<b>alphay</b>", "<b>alphax</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>thetah</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-9-2-2" name="sec-3-9-2-2"></a>"<b>q2</b>":<br  /><div class="outline-text-5" id="text-3-9-2-2">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>q</b>" : the norm of \(\vec{q}\)
+</li>
+
+<li>"<b>alpha</b>" : angle of the projection of \(\vec{q}\) on the \(yOz\) plan and \(\vec{y}\)
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>q2</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-9-2-3" name="sec-3-9-2-3"></a>"<b>qper_qpar</b>":<br  /><div class="outline-text-5" id="text-3-9-2-3">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>qper</b>" : perpendicular component of \(\vec{q}\) along the normal of the sample surface
+</li>
+
+<li>"<b>qpar</b>" : parallel component of \(\vec{q}\)
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>qper_qpar</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>x</b> [0.0]: the first coordinate of the surface vector
+</li>
+<li><b>y</b> [1.0]: the second coordinate of the surface vector
+</li>
+<li><b>z</b> [0.0]: the third coordinate of the surface vector
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li></ol>
+</div>
+</div>
+<div id="outline-container-sec-3-10" class="outline-3">
+<h3 id="sec-3-10"><span class="section-number-3">3.10</span> SOLEIL SIXS MED1+2</h3>
+<div class="outline-text-3" id="text-3-10">
+</div><div id="outline-container-sec-3-10-1" class="outline-4">
+<h4 id="sec-3-10-1"><span class="section-number-4">3.10.1</span> Axes:</h4>
+<div class="outline-text-4" id="text-3-10-1">
+<ul class="org-ul">
+<li>"<b>pitch</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+<li>"<b>mu</b>": rotation around the <b>[0.0, 0.0, 1.0]</b> axis
+</li>
+<li>"<b>gamma</b>": rotation around the <b>[0.0, 0.0, 1.0]</b> axis
+</li>
+<li>"<b>delta</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+</ul>
+</div>
+</div>
+<div id="outline-container-sec-3-10-2" class="outline-4">
+<h4 id="sec-3-10-2"><span class="section-number-4">3.10.2</span> Engines:</h4>
+<div class="outline-text-4" id="text-3-10-2">
+</div><ol class="org-ol"><li><a id="sec-3-10-2-1" name="sec-3-10-2-1"></a>"<b>hkl</b>":<br  /><div class="outline-text-5" id="text-3-10-2-1">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>h</b>" : h coordinate of the diffracting plan
+</li>
+
+<li>"<b>k</b>" : k coordinate of the diffracting plan
+</li>
+
+<li>"<b>l</b>" : l coordinate of the diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>pitch_fixed</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>pitch</b>", "<b>mu</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>mu</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-10-2-2" name="sec-3-10-2-2"></a>"<b>q2</b>":<br  /><div class="outline-text-5" id="text-3-10-2-2">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>q</b>" : the norm of \(\vec{q}\)
+</li>
+
+<li>"<b>alpha</b>" : angle of the projection of \(\vec{q}\) on the \(yOz\) plan and \(\vec{y}\)
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>q2</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-10-2-3" name="sec-3-10-2-3"></a>"<b>qper_qpar</b>":<br  /><div class="outline-text-5" id="text-3-10-2-3">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>qper</b>" : perpendicular component of \(\vec{q}\) along the normal of the sample surface
+</li>
+
+<li>"<b>qpar</b>" : parallel component of \(\vec{q}\)
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>qper_qpar</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>x</b> [0.0]: the first coordinate of the surface vector
+</li>
+<li><b>y</b> [1.0]: the second coordinate of the surface vector
+</li>
+<li><b>z</b> [0.0]: the third coordinate of the surface vector
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li></ol>
+</div>
+</div>
+<div id="outline-container-sec-3-11" class="outline-3">
+<h3 id="sec-3-11"><span class="section-number-3">3.11</span> SOLEIL SIXS MED2+2</h3>
+<div class="outline-text-3" id="text-3-11">
+</div><div id="outline-container-sec-3-11-1" class="outline-4">
+<h4 id="sec-3-11-1"><span class="section-number-4">3.11.1</span> Axes:</h4>
+<div class="outline-text-4" id="text-3-11-1">
+<ul class="org-ul">
+<li>"<b>beta</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+<li>"<b>mu</b>": rotation around the <b>[0.0, 0.0, 1.0]</b> axis
+</li>
+<li>"<b>omega</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+<li>"<b>gamma</b>": rotation around the <b>[0.0, 0.0, 1.0]</b> axis
+</li>
+<li>"<b>delta</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+</ul>
+</div>
+</div>
+<div id="outline-container-sec-3-11-2" class="outline-4">
+<h4 id="sec-3-11-2"><span class="section-number-4">3.11.2</span> Engines:</h4>
+<div class="outline-text-4" id="text-3-11-2">
+</div><ol class="org-ol"><li><a id="sec-3-11-2-1" name="sec-3-11-2-1"></a>"<b>hkl</b>":<br  /><div class="outline-text-5" id="text-3-11-2-1">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>h</b>" : h coordinate of the diffracting plan
+</li>
+
+<li>"<b>k</b>" : k coordinate of the diffracting plan
+</li>
+
+<li>"<b>l</b>" : l coordinate of the diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>mu_fixed</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>beta</b>", "<b>mu</b>", "<b>omega</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>reflectivity</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>beta</b>", "<b>mu</b>", "<b>omega</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>mu</b>", "<b>omega</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-11-2-2" name="sec-3-11-2-2"></a>"<b>q2</b>":<br  /><div class="outline-text-5" id="text-3-11-2-2">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>q</b>" : the norm of \(\vec{q}\)
+</li>
+
+<li>"<b>alpha</b>" : angle of the projection of \(\vec{q}\) on the \(yOz\) plan and \(\vec{y}\)
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>q2</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-11-2-3" name="sec-3-11-2-3"></a>"<b>qper_qpar</b>":<br  /><div class="outline-text-5" id="text-3-11-2-3">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>qper</b>" : perpendicular component of \(\vec{q}\) along the normal of the sample surface
+</li>
+
+<li>"<b>qpar</b>" : parallel component of \(\vec{q}\)
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>qper_qpar</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>x</b> [0.0]: the first coordinate of the surface vector
+</li>
+<li><b>y</b> [1.0]: the second coordinate of the surface vector
+</li>
+<li><b>z</b> [0.0]: the third coordinate of the surface vector
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li></ol>
+</div>
+</div>
+<div id="outline-container-sec-3-12" class="outline-3">
+<h3 id="sec-3-12"><span class="section-number-3">3.12</span> SOLEIL SIXS MED2+3</h3>
+<div class="outline-text-3" id="text-3-12">
+</div><div id="outline-container-sec-3-12-1" class="outline-4">
+<h4 id="sec-3-12-1"><span class="section-number-4">3.12.1</span> Axes:</h4>
+<div class="outline-text-4" id="text-3-12-1">
+<ul class="org-ul">
+<li>"<b>beta</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+<li>"<b>mu</b>": rotation around the <b>[0.0, 0.0, 1.0]</b> axis
+</li>
+<li>"<b>omega</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+<li>"<b>gamma</b>": rotation around the <b>[0.0, 0.0, 1.0]</b> axis
+</li>
+<li>"<b>delta</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+<li>"<b>eta_a</b>": rotation around the <b>[-1.0, 0.0, 0.0]</b> axis
+</li>
+</ul>
+</div>
+</div>
+<div id="outline-container-sec-3-12-2" class="outline-4">
+<h4 id="sec-3-12-2"><span class="section-number-4">3.12.2</span> Engines:</h4>
+<div class="outline-text-4" id="text-3-12-2">
+</div><ol class="org-ol"><li><a id="sec-3-12-2-1" name="sec-3-12-2-1"></a>"<b>hkl</b>":<br  /><div class="outline-text-5" id="text-3-12-2-1">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>h</b>" : h coordinate of the diffracting plan
+</li>
+
+<li>"<b>k</b>" : k coordinate of the diffracting plan
+</li>
+
+<li>"<b>l</b>" : l coordinate of the diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>mu_fixed</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>beta</b>", "<b>mu</b>", "<b>omega</b>", "<b>gamma</b>", "<b>delta</b>", "<b>eta_a</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-12-2-2" name="sec-3-12-2-2"></a>"<b>q2</b>":<br  /><div class="outline-text-5" id="text-3-12-2-2">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>q</b>" : the norm of \(\vec{q}\)
+</li>
+
+<li>"<b>alpha</b>" : angle of the projection of \(\vec{q}\) on the \(yOz\) plan and \(\vec{y}\)
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>q2</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-12-2-3" name="sec-3-12-2-3"></a>"<b>qper_qpar</b>":<br  /><div class="outline-text-5" id="text-3-12-2-3">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>qper</b>" : perpendicular component of \(\vec{q}\) along the normal of the sample surface
+</li>
+
+<li>"<b>qpar</b>" : parallel component of \(\vec{q}\)
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>qper_qpar</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>x</b> [0.0]: the first coordinate of the surface vector
+</li>
+<li><b>y</b> [1.0]: the second coordinate of the surface vector
+</li>
+<li><b>z</b> [0.0]: the third coordinate of the surface vector
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li></ol>
+</div>
+</div>
+<div id="outline-container-sec-3-13" class="outline-3">
+<h3 id="sec-3-13"><span class="section-number-3">3.13</span> TwoC</h3>
+<div class="outline-text-3" id="text-3-13">
+</div><div id="outline-container-sec-3-13-1" class="outline-4">
+<h4 id="sec-3-13-1"><span class="section-number-4">3.13.1</span> Axes:</h4>
+<div class="outline-text-4" id="text-3-13-1">
+<ul class="org-ul">
+<li>"<b>omega</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+<li>"<b>tth</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+</ul>
+</div>
+</div>
+<div id="outline-container-sec-3-13-2" class="outline-4">
+<h4 id="sec-3-13-2"><span class="section-number-4">3.13.2</span> Engines:</h4>
+</div>
+</div>
+<div id="outline-container-sec-3-14" class="outline-3">
+<h3 id="sec-3-14"><span class="section-number-3">3.14</span> ZAXIS</h3>
+<div class="outline-text-3" id="text-3-14">
+</div><div id="outline-container-sec-3-14-1" class="outline-4">
+<h4 id="sec-3-14-1"><span class="section-number-4">3.14.1</span> Axes:</h4>
+<div class="outline-text-4" id="text-3-14-1">
+<ul class="org-ul">
+<li>"<b>mu</b>": rotation around the <b>[0.0, 0.0, 1.0]</b> axis
+</li>
+<li>"<b>omega</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+<li>"<b>delta</b>": rotation around the <b>[0.0, -1.0, 0.0]</b> axis
+</li>
+<li>"<b>gamma</b>": rotation around the <b>[0.0, 0.0, 1.0]</b> axis
+</li>
+</ul>
+</div>
+</div>
+<div id="outline-container-sec-3-14-2" class="outline-4">
+<h4 id="sec-3-14-2"><span class="section-number-4">3.14.2</span> Engines:</h4>
+<div class="outline-text-4" id="text-3-14-2">
+</div><ol class="org-ol"><li><a id="sec-3-14-2-1" name="sec-3-14-2-1"></a>"<b>hkl</b>":<br  /><div class="outline-text-5" id="text-3-14-2-1">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>h</b>" : h coordinate of the diffracting plan
+</li>
+
+<li>"<b>k</b>" : k coordinate of the diffracting plan
+</li>
+
+<li>"<b>l</b>" : l coordinate of the diffracting plan
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>zaxis</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>omega</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+<li>mode: "<b>reflectivity</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>mu</b>", "<b>omega</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>axes (write): "<b>mu</b>", "<b>omega</b>", "<b>delta</b>", "<b>gamma</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-14-2-2" name="sec-3-14-2-2"></a>"<b>q2</b>":<br  /><div class="outline-text-5" id="text-3-14-2-2">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>q</b>" : the norm of \(\vec{q}\)
+</li>
+
+<li>"<b>alpha</b>" : angle of the projection of \(\vec{q}\) on the \(yOz\) plan and \(\vec{y}\)
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>q2</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: No parameter
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-3-14-2-3" name="sec-3-14-2-3"></a>"<b>qper_qpar</b>":<br  /><div class="outline-text-5" id="text-3-14-2-3">
+<ul class="org-ul">
+<li>pseudo axes:
+<ul class="org-ul">
+<li>"<b>qper</b>" : perpendicular component of \(\vec{q}\) along the normal of the sample surface
+</li>
+
+<li>"<b>qpar</b>" : parallel component of \(\vec{q}\)
+</li>
+</ul>
+</li>
+</ul>
+
+
+<ul class="org-ul">
+<li>mode: "<b>qper_qpar</b>"
+<ul class="org-ul">
+<li>axes (read) : "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>axes (write): "<b>gamma</b>", "<b>delta</b>"
+</li>
+<li>parameters: 
+<ul class="org-ul">
+<li><b>x</b> [0.0]: the first coordinate of the surface vector
+</li>
+<li><b>y</b> [1.0]: the second coordinate of the surface vector
+</li>
+<li><b>z</b> [0.0]: the third coordinate of the surface vector
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</div>
+</li></ol>
+</div>
+</div>
+</div>
+
+<div id="outline-container-sec-4" class="outline-2">
+<h2 id="sec-4"><span class="section-number-2">4</span> Developpement</h2>
+<div class="outline-text-2" id="text-4">
+</div><div id="outline-container-sec-4-1" class="outline-3">
+<h3 id="sec-4-1"><span class="section-number-3">4.1</span> Getting hkl</h3>
+<div class="outline-text-3" id="text-4-1">
+<p>
+To get hkl, you can download the last stable version from sourceforge or
+if you want the latest development version use
+<a href="http://git.or.cz/">git</a> or
+<a href="http://code.google.com/p/msysgit/downloads/list">msysgit</a> on windows
+system and do:
+</p>
+
+<div class="org-src-container">
+
+<pre class="src src-sh">git clone git://repo.or.cz/hkl.git
+</pre>
+</div>
+
+<p>
+or:
+</p>
+
+<div class="org-src-container">
+
+<pre class="src src-sh">git clone http://repo.or.cz/r/hkl.git (slower)
+</pre>
+</div>
+
+<p>
+then checkout the next branch like this:
+</p>
+
+<div class="org-src-container">
+
+<pre class="src src-sh">cd hkl
+git checkout -b next origin/next
+</pre>
+</div>
+</div>
+</div>
+
+<div id="outline-container-sec-4-2" class="outline-3">
+<h3 id="sec-4-2"><span class="section-number-3">4.2</span> Building hkl</h3>
+<div class="outline-text-3" id="text-4-2">
+<p>
+To build hkl you need <a href="http://www.python.org">Python 2.3+</a> the
+<a href="http://www.gnu.org/software/gsl/">GNU Scientific Library 1.12</a> and
+<a href="https://developer.gnome.org/glib/">GLib-2.0 >= 2.3.4</a>:
+</p>
+
+<div class="org-src-container">
+
+<pre class="src src-sh">./configure --disable-gui
+make
+sudo make install
+</pre>
+</div>
+
+<p>
+you can also build a GUI interfaces which use
+<a href="http://www.gtk.org">gtk</a>:
+</p>
+
+<div class="org-src-container">
+
+<pre class="src src-sh">./configure
+make
+sudo make install
+</pre>
+</div>
+
+<p>
+optionnaly you can build an experimental <i>libhkl3d</i> library (no public
+API for now) which is used by the GUI to display and compute
+diffractometer collisions (only the <i>K6C</i> model). To build it you need
+also <a href="https://projects.gnome.org/gtkglext/">gtkglext</a> and
+<a href="http://bulletphysics.org/wordpress/">bullet 2.82</a>:
+</p>
+
+<div class="org-src-container">
+
+<pre class="src src-sh">./configure --enable-hkl3d
+make
+sudo make install
+</pre>
+</div>
+
+<p>
+if you want to work on the documentation you need the extra
+</p>
+
+<ul class="org-ul">
+<li><a href="http://www.gtk.org/gtk-doc/">gtk-doc</a> for the api
+</li>
+<li><a href="http://sphinx.pocoo.org/">sphinx</a> for the html and latex doc.
+</li>
+<li><a href="http://asymptote.sourceforge.net/">asymptote</a> for the figures
+</li>
+<li><a href="http://www.gnu.org/software/emacs/">emacs</a> the well known editor
+</li>
+<li><a href="https://github.com/emacsmirror/htmlize">htmlize</a> used to highlight the source code
+</li>
+<li><a href="http://orgmode.org">org-mode</a> litteral programming
+</li>
+</ul>
+
+<p>
+On Debian/Ubuntu you just need to install
+</p>
+
+<div class="org-src-container">
+
+<pre class="src src-sh">sudo apt-get install emacs dvipng emacs-goodies-el org-mode
+</pre>
+</div>
+
+<div class="org-src-container">
+
+<pre class="src src-sh">./configure --enable-gtk-doc
+make
+make html
+</pre>
+</div>
+
+<p>
+nevertheless if you do not want to build the documentation you can do:
+</p>
+
+<div class="org-src-container">
+
+<pre class="src src-sh">./configure --disable-hkl-doc
+</pre>
+</div>
+</div>
+</div>
+
+<div id="outline-container-sec-4-3" class="outline-3">
+<h3 id="sec-4-3"><span class="section-number-3">4.3</span> Hacking hkl</h3>
+<div class="outline-text-3" id="text-4-3">
+</div><div id="outline-container-sec-4-3-1" class="outline-4">
+<h4 id="sec-4-3-1"><span class="section-number-4">4.3.1</span> Bug reporting</h4>
+<div class="outline-text-4" id="text-4-3-1">
+<p>
+You can find the bug tracker here
+<a href="https://bugs.debian.org/cgi-bin/pkgreport.cgi?repeatmerged=no&src=hkl">libhkl</a>
+</p>
+
+<ul class="org-ul">
+<li>Debian/Ubuntu:
+
+<div class="org-src-container">
+
+<pre class="src src-sh">reportbug hkl
+</pre>
+</div>
+</li>
+
+<li>Other OS
+
+<p>
+You just need to send an <a href="mailto:submit at bugs.debian.org?subject=%20My%20problem%20with%20hkl...&body=Package:%20hkl%0AVersion:%204.99.99.1892%0A%0AI%20found%20this%20problem%20in%20hkl">email</a>
+</p>
+</li>
+</ul>
+</div>
+</div>
+
+<div id="outline-container-sec-4-3-2" class="outline-4">
+<h4 id="sec-4-3-2"><span class="section-number-4">4.3.2</span> Providing patchs</h4>
+<div class="outline-text-4" id="text-4-3-2">
+<p>
+you can send your patch to <i>Picca
+Frédéric-Emmanuel</i> using <code>git</code>
+</p>
+
+<p>
+Here a minimalist exemple of the workflow to prepare and send a patch
+for hkl. Suppose you wan to add a new feature to hkl create first a new
+branch from the next one:
+</p>
+
+<div class="org-src-container">
+
+<pre class="src src-sh">git checkout -b my-next next
+</pre>
+</div>
+
+<p>
+hack, hack:
+</p>
+
+<div class="org-src-container">
+
+<pre class="src src-sh">git commit -a
+</pre>
+</div>
+
+<p>
+more hacks:
+</p>
+
+<div class="org-src-container">
+
+<pre class="src src-sh">git commit -a
+</pre>
+</div>
+
+<p>
+now that your new feature is ready for a review, you can send by email
+your work using git format-patch:
+</p>
+
+<div class="org-src-container">
+
+<pre class="src src-sh">git format-patch origin/next
+</pre>
+</div>
+
+<p>
+and send generated files <code>0001\_xxx</code>, <code>0002\_xxx</code>, &#x2026; to the author.
+</p>
+</div>
+</div>
+</div>
+
+<div id="outline-container-sec-4-4" class="outline-3">
+<h3 id="sec-4-4"><span class="section-number-3">4.4</span> Howto's</h3>
+<div class="outline-text-3" id="text-4-4">
+</div><div id="outline-container-sec-4-4-1" class="outline-4">
+<h4 id="sec-4-4-1"><span class="section-number-4">4.4.1</span> Add a diffractometer</h4>
+<div class="outline-text-4" id="text-4-4-1">
+<p>
+To add a new diffractometer, you just need to copy the
+<code>hkl/hkl-engine-template.c</code> into
+<code>hkl/hkl-engine-INSTITUT-BEAMLINE-INSTRUMENT.c</code> where you replace
+the upper case with the appropriate values.
+</p>
+
+<p>
+The template file is compiled during the build process to ensure
+that it is always valid.
+</p>
+
+<p>
+Then you just need to follow the instruction found in the
+template. If you need some precision about the process, do not
+hesitate to contact the main author.
+</p>
+
+<p>
+do not forgot also to add this new file into <code>hkl/Makefile.am</code>
+with other diffractometers in the hkl_c_sources variable (please
+keep the alphabetic order).
+</p>
+</div>
+</div>
+<div id="outline-container-sec-4-4-2" class="outline-4">
+<h4 id="sec-4-4-2"><span class="section-number-4">4.4.2</span> Work on the documentation</h4>
+<div class="outline-text-4" id="text-4-4-2">
+<p>
+The documentation system is written with <a href="http://orgmode.org/">org-mode</a>, and the <a href="http://orgmode.org/worg/org-contrib/babel/">babel</a>
+extension which allow to introspect the library and generate part
+of the doc using the hkl library. Python code is executed during
+the build process to generate the Diffractometer section of the
+documentation. To work on the doc and test the embedded python
+code it is necessary to setup a few environment variables and
+start emacs with the right LD_LIBRARY_PATH. In order to simplify
+the process a make target was written. You just need to type:
+</p>
+<div class="org-src-container">
+
+<pre class="src src-sh">cd Documentation
+make editdoc
+</pre>
+</div>
+<p>
+and start to contribute.
+</p>
+
+<p>
+If you do not have emacs, you can nevertheless contribute by
+editing the <code>Documentation/hkl.org.in</code> file which is text only.
+</p>
+
+<p>
+The most expected contributions for now are:
+</p>
+<ul class="org-ul">
+<li>english correctness
+</li>
+<li>a nicer css
+</li>
+</ul>
+</div>
+</div>
+</div>
+</div>
+<div id="outline-container-sec-5" class="outline-2">
+<h2 id="sec-5"><span class="section-number-2">5</span> Bindings</h2>
+<div class="outline-text-2" id="text-5">
+<p>
+The hkl library use the gobject-introspection to provide automatic
+binding for a few languages.
+</p>
+</div>
+
+<div id="outline-container-sec-5-1" class="outline-3">
+<h3 id="sec-5-1"><span class="section-number-3">5.1</span> Python</h3>
+<div class="outline-text-3" id="text-5-1">
+<p>
+hkl computation:
+</p>
+
+<p>
+has you can see there is 4 available solutions.
+</p>
+
+<p>
+let's compute an hkl trajectory and select the first solution.
+</p>
+
+<p>
+if we look at the 3 other solutions we can see that there is a problem
+of continuity at the begining of the trajectory.
+</p>
+
+<p>
+hey what's happend with theses solutions ! let's look closely to real
+numbers. the last column is the distance to the diffractometer current
+position. This distance is for now express like this:
+</p>
+
+<p>
+\(\sum_{axes} \left|\text{current position} - \text{target position}\right|\)
+</p>
+
+<pre class="example">
+[0.0, 119.99999999999999, 0.0, -90.0, 0.0, 59.99999999999999] 0.0
+[0.0, -119.99999999999999, 0.0, -90.0, 0.0, -59.99999999999999] 6.28318530718
+[0.0, -60.00000000000005, 0.0, 90.0, 0.0, 59.99999999999999] 6.28318530718
+[0.0, 60.00000000000001, 0.0, 90.0, 0.0, -59.99999999999999] 6.28318530718
+
+[0.0, 117.7665607657826, 7.456826294401656, -92.39856410531434, 0.0, 60.33024982425957] 0.216753826612
+[0.0, -57.436310940366894, -7.456826294401656, 92.39856418853617, 0.0, 60.33024982425957] 6.41621345188
+[0.0, 62.2334392342174, -7.456826294401656, 92.39856410531434, 0.0, -60.33024982425957] 6.42197739723
+[0.0, -122.5636890596331, 7.456826294401656, -92.3985641885362, 0.0, -60.33024982425957] 6.50570308205
+
+[0.0, 115.89125602137928, 14.781064139466098, -94.7660423112577, 0.0, 61.314597086440706] 0.219062698235
+[0.0, -125.42334103772737, 14.781064139466098, -94.7660427050904, 0.0, -61.314597086440706] 6.53671995288
+[0.0, -54.57665896227262, -14.781064139466098, 94.76604270509038, 0.0, 61.314597086440706] 6.67989976726
+[0.0, 64.10874397862072, -14.781064139466098, 94.7660423112577, 0.0, -61.314597086440706] 6.71437170098
+
+[0.0, 114.39338605351007, 21.85448296702796, -97.074145033719, 0.0, 62.93506298693471] 0.218163667981
+[0.0, -128.54167683157993, 21.85448296702796, -97.07414574435087, 0.0, -62.93506298693471] 6.59846359365
+[0.0, -51.45832316842005, -21.85448296702796, 97.07414574435087, 0.0, 62.93506298693471] 6.93673746356
+[0.0, 65.60661394648993, -21.85448296702796, 97.074145033719, 0.0, -62.93506298693471] 7.03385205725
+
+[0.0, 113.28316795475283, 28.583837575232764, -99.29953499008337, 0.0, 65.16540747008955] 0.21459359225
+[0.0, -131.88223933078322, 28.583837575232764, -99.29953638594702, 0.0, -65.16540747008955] 6.69038531388
+[0.0, -48.11776066921677, -28.583837575232764, 99.29953638594702, 0.0, 65.16540747008955] 7.18296350386
+[0.0, 66.71683204524717, -28.583837575232764, 99.29953499008337, 0.0, -65.16540747008955] 7.37556986959
+
+[0.0, 112.56286877075006, 34.90573305321372, -101.42496979586187, 0.0, 67.97568017857415] 0.209053830457
+[0.0, -135.4128111996365, 34.90573305321372, -101.42497263302461, 0.0, -67.97568017857415] 6.81174779784
+[0.0, -44.58718880036348, -34.90573305321372, 101.4249726330246, 0.0, 67.97568017857415] 7.41581162393
+[0.0, 67.43713122924994, -34.90573305321372, 101.42496979586187, 0.0, -67.97568017857415] 7.7353201851
+
+[0.0, 112.2291126083182, 40.78594007247402, -103.43941832567457, 0.0, 71.33706722449408] 0.202280147961
+[0.0, -139.10795451001587, 40.78594007247402, -103.43942357602316, 0.0, -71.33706722449408] 6.96173845391
+[0.0, -40.89204548998411, -40.78594007247402, 103.43942357602312, 0.0, 71.33706722449408] 7.63358787543
+[0.0, 67.7708873916818, -40.78594007247402, 103.43941832567457, 0.0, -71.33706722449408] 8.10986069093
+
+[0.0, 112.27578927291766, 46.214916130901734, -105.33741042812996, 0.0, 75.22640762217479] 0.196576175748
+[0.0, -142.95061850160724, 46.214916130901734, -105.3374188005596, 0.0, -75.22640762217479] 7.13962155618
+[0.0, -37.04938149839278, -46.214916130901734, 105.33741880055959, 0.0, 75.22640762217479] 7.83557762281
+[0.0, 67.72421072708234, -46.214916130901734, 105.33741042812996, 0.0, -75.22640762217479] 8.49706672677
+
+[0.0, 112.697137434232, 51.201667684695856, -107.11797492933192, 0.0, 79.63023536264535] 0.202327153157
+[0.0, -146.9330984641471, 51.201667684695856, -107.11798610058318, 0.0, -79.63023536264535] 7.34491897177
+[0.0, -33.0669015358529, -51.201667684695856, 107.11798610058317, 0.0, 79.63023536264535] 8.02185610877
+[0.0, 67.30286256576798, -51.201667684695856, 107.11797492933192, 0.0, -79.63023536264535] 8.89597005568
+
+[0.0, 113.49085964586432, 55.76762791023837, -108.78347437395287, 0.0, 84.54867879242364] 0.208455586312
+[0.0, -151.05782007465257, 55.76762791023837, -108.78348605483542, 0.0, -84.54867879242364] 7.57761473366
+[0.0, -28.942179925347414, -55.76762791023837, 108.78348605483538, 0.0, 84.54867879242364] 8.19307323084
+[0.0, 66.50914035413568, -55.76762791023837, 108.78347437395287, 0.0, -84.54867879242364] 9.30675279514
+
+[0.0, 114.6614608037443, 59.941489465646214, -110.3385360479293, 0.0, 90.00000081324956] 0.215562935229
+[0.0, -155.33854118146962, 59.941489465646214, -110.33854432979601, 0.0, -89.99999918675044] 7.83839602383
+[0.0, -24.661458818530395, -59.941489465646214, 110.33854432979601, 0.0, 90.00000081324956] 8.3502621071
+[0.0, 65.3385391962557, -59.941489465646214, 110.3385360479293, 0.0, -89.99999918675044] 9.7307712883
+</pre>
+
+<p>
+as you can see for the first point of the trajectory, the 2nd, 3rd and
+4th solutions have identical distances to the current position of the
+diffractometer so they are un-ordered:
+</p>
+
+<pre class="example">
+[0.0, 119.99999999999999, 0.0, -90.0, 0.0, 59.99999999999999] 0.0
+[0.0, -119.99999999999999, 0.0, -90.0, 0.0, -59.99999999999999] 6.28318530718
+[0.0, -60.00000000000005, 0.0, 90.0, 0.0, 59.99999999999999] 6.28318530718
+[0.0, 60.00000000000001, 0.0, 90.0, 0.0, -59.99999999999999] 6.28318530718
+</pre>
+
+<p>
+then the problem arise with the second and third solution. you can see a
+sort of reorganisation of the solution. 2 -> 3, 3 -> 4 and 4 -> 2 then
+the order will stick unchanged until the end of the trajectory. this is
+because the distance is computed relatively to the current position of
+the diffractometer.:
+</p>
+
+<pre class="example">
+[0.0, 117.7665607657826, 7.456826294401656, -92.39856410531434, 0.0, 60.33024982425957] 0.216753826612
+[0.0, -57.436310940366894, -7.456826294401656, 92.39856418853617, 0.0, 60.33024982425957] 6.41621345188
+[0.0, 62.2334392342174, -7.456826294401656, 92.39856410531434, 0.0, -60.33024982425957] 6.42197739723
+[0.0, -122.5636890596331, 7.456826294401656, -92.3985641885362, 0.0, -60.33024982425957] 6.50570308205
+
+[0.0, 115.89125602137928, 14.781064139466098, -94.7660423112577, 0.0, 61.314597086440706] 0.219062698235
+[0.0, -125.42334103772737, 14.781064139466098, -94.7660427050904, 0.0, -61.314597086440706] 6.53671995288
+[0.0, -54.57665896227262, -14.781064139466098, 94.76604270509038, 0.0, 61.314597086440706] 6.67989976726
+[0.0, 64.10874397862072, -14.781064139466098, 94.7660423112577, 0.0, -61.314597086440706] 6.71437170098
+</pre>
+
+<blockquote>
+<p>
+<b>warning</b>
+</p>
+
+<p>
+when you compute a trajectory, start from a valid position (the
+starting point must be the real first point of your trajectory) then
+use only the closest solution for the next points of the trajectory.
+(first solution of the geometries list)
+</p>
+</blockquote>
+</div>
+</div>
+</div>
+<div id="outline-container-sec-6" class="outline-2">
+<h2 id="sec-6"><span class="section-number-2">6</span> Todo</h2>
+<div class="outline-text-2" id="text-6">
+</div><div id="outline-container-sec-6-1" class="outline-3">
+<h3 id="sec-6-1"><span class="section-number-3">6.1</span> hkl</h3>
+<div class="outline-text-3" id="text-6-1">
+</div><div id="outline-container-sec-6-1-1" class="outline-4">
+<h4 id="sec-6-1-1"><span class="section-number-4">6.1.1</span> <span class="todo TODO">TODO</span> <code>[0/2]</code> PetraIII</h4>
+<div class="outline-text-4" id="text-6-1-1">
+</div><ol class="org-ol"><li><a id="sec-6-1-1-1" name="sec-6-1-1-1"></a><span class="todo TODO">TODO</span> computation problem<br  /><div class="outline-text-5" id="text-6-1-1-1">
+<p>
+Dear Teresa,
+</p>
+
+<p>
+Using the prruptest.txt ubmatrix I see that the value of psi is
+offset by 45 degrees. I expect it to be 0 degrees when azimuth
+reference vector is 0 0 1 that is along the beam. See below
+thereturned numbers. This might have to do with the definition of
+the beam axis in the controller.  Otherwise now when I change
+reference vector by 90 degrees the computed value is changed by
+90 degrees. That is a progress. Can you contact Frederic and ask
+him about this ?
+</p>
+
+<p>
+Best regards,
+</p>
+
+<p>
+Sonia
+</p>
+
+<p>
+See below
+p09/door/haspp09.01 <sup><a id="fnr.1" name="fnr.1" class="footref" href="#fn.1">1</a></sup>: setaz 1 0 0
+</p>
+
+<p>
+p09/door/haspp09.01 <sup><a id="fnr.2" name="fnr.2" class="footref" href="#fn.2">2</a></sup>: wh
+</p>
+
+<p>
+Engine: hkl
+</p>
+
+<p>
+Mode: psi_constant_vertical
+</p>
+
+<p>
+H K L =    0.00000   3.00605  -0.00000
+Ref   =    1.00000   0.00000   0.00000
+Azimuth (Psi - calculated) =  -45.00005
+Azimuth (Psi - set) =  0.00000
+Wavelength =  2.07957
+</p>
+
+<p>
+Delta       Theta          Chi         Phi         Mu       Gamma
+45.77575    22.88783     90.00000   182.85400    0.00000    -0.00000
+</p>
+
+<p>
+p09/door/haspp09.01 <sup><a id="fnr.3" name="fnr.3" class="footref" href="#fn.3">3</a></sup>: setaz 0 0 1
+</p>
+
+<p>
+p09/door/haspp09.01 <sup><a id="fnr.4" name="fnr.4" class="footref" href="#fn.4">4</a></sup>: wh
+</p>
+
+<p>
+Engine: hkl
+</p>
+
+<p>
+Mode: psi_constant_vertical
+</p>
+
+<p>
+H K L =    0.00000   3.00605  -0.00000
+Ref   =    0.00000   0.00000   1.00000
+Azimuth (Psi - calculated) =  -135.00005
+Azimuth (Psi - set) =  0.00000
+Wavelength =  2.07957
+</p>
+
+<p>
+Delta       Theta          Chi         Phi         Mu       Gamma
+45.77575    22.88783     90.00000   182.85400    0.00000    -0.00000
+</p>
+
+<p>
+where:
+</p>
+
+<p>
+Azimuth (Psi - calculated) is the value of the pseudomotor psi.
+Azimuth (Psi - set) is the value set in the parameter psi of the current mode.
+</p>
+
+<p>
+Hi Frederic,
+</p>
+
+<p>
+This is the UB matrix:
+</p>
+
+<p>
+Best regards,
+</p>
+
+<p>
+Sonia
+</p>
+
+<p>
+Created at 2015-01-21 12:35
+</p>
+
+<p>
+Crystal    prruptest
+</p>
+
+<p>
+Wavelength 2.07957463938
+</p>
+
+<p>
+A 8.03656 B 8.03656 C 8.03656
+Alpha 90.0 Beta 90.0 Gamma 90.0
+</p>
+
+<p>
+R0 0 0.0 1.0 0.0 0 1 0.0 14.8979 90.0 182.854 0.0 29.7959
+R1 1 1.0 0.0 1.0 0 1 0.0 14.8979 0.0 182.854 0.0 29.7959
+</p>
+
+<p>
+Mode psi_constant_vertical
+</p>
+
+<p>
+PsiRef 0.0 0.0 1.0
+</p>
+
+<p>
+U00 -0.580 U01 0.000 U02 0.525
+U10 0.000 U11 0.782 U12 -0.000
+U20 -0.525 U21 -0.000 U22 -0.580
+</p>
+
+<p>
+Ux 179.999952315 Uy 42.14605 Uz -179.999932647
+</p>
+
+<p>
+SaveDirectory <i>home/p09user/crystals</i>
+</p>
+</div>
+</li>
+
+<li><a id="sec-6-1-1-2" name="sec-6-1-1-2"></a><span class="todo TODO">TODO</span> another question<br  /><div class="outline-text-5" id="text-6-1-1-2">
+<p>
+J'ai un probleme avec la position que le controlleur calcule avec la
+matrice UB que nous t'avons envoye.
+See sequence of emails echanges avec Teresa.
+</p>
+
+<p>
+>>>> I am at 0 3.00605 0 with phi -182 and psi calculated is -135
+>>>> When I freeze psi at -135  and type ca 0 3.00605 0 the controller
+>> should return to me the positions at which I am. But no he tells me
+that I
+>> have to go to 178 degrees in  phi that is turning by 360 degrees.
+</p>
+
+<p>
+Est-ce un probleme avec la trajectoire selectionnee ?
+Est-ce qu'il est possible de definir des cut-points comme dans spec avec
+ta librairie ?
+</p>
+</div>
+</li></ol>
+</div>
+<div id="outline-container-sec-6-1-2" class="outline-4">
+<h4 id="sec-6-1-2"><span class="section-number-4">6.1.2</span> <span class="todo TODO">TODO</span> <code>[2/4]</code> HklParameter</h4>
+<div class="outline-text-4" id="text-6-1-2">
+<ul class="org-ul">
+<li><code>[X]</code> method to use min/max to check for the validity
+</li>
+<li><code>[X]</code> add a method to get the axis_v and quaternion of the HklAxis
+this method will return NULL if this is not relevant.
+hkl_parameter_axis_v_get and hkl_parameter_quaternion_get
+</li>
+<li><code>[&#xa0;]</code> degenerated an axis is degenerated if its position have no
+effect on the HklPseudoAxis calculus. Add a degenerated member
+to the axis. that way it would be possible to check a posteriori
+for this degenerescencence.
+</li>
+<li><code>[&#xa0;]</code> Add a description for each parameters.
+This will help for the documentation and the gui.
+</li>
+</ul>
+</div>
+</div>
+<div id="outline-container-sec-6-1-3" class="outline-4">
+<h4 id="sec-6-1-3"><span class="section-number-4">6.1.3</span> <span class="todo TODO">TODO</span> HklGeometryList different method to help select a solution.</h4>
+<div class="outline-text-4" id="text-6-1-3">
+<p>
+this select solution can depend on the geometry
+for example the kappa axis must be in one side of the plane.
+</p>
+</div>
+</div>
+<div id="outline-container-sec-6-1-4" class="outline-4">
+<h4 id="sec-6-1-4"><span class="section-number-4">6.1.4</span> <span class="todo TODO">TODO</span> add a fit on the Hklaxis offsets.</h4>
+</div>
+<div id="outline-container-sec-6-1-5" class="outline-4">
+<h4 id="sec-6-1-5"><span class="section-number-4">6.1.5</span> <span class="todo TODO">TODO</span> API to put a detector and a sample on the Geometry.</h4>
+</div>
+<div id="outline-container-sec-6-1-6" class="outline-4">
+<h4 id="sec-6-1-6"><span class="section-number-4">6.1.6</span> <span class="todo TODO">TODO</span> HklSample</h4>
+<div class="outline-text-4" id="text-6-1-6">
+</div><ol class="org-ol"><li><a id="sec-6-1-6-1" name="sec-6-1-6-1"></a><span class="todo TODO">TODO</span> HklSample add the cell volum computation.<br  /></li>
+<li><a id="sec-6-1-6-2" name="sec-6-1-6-2"></a><span class="todo TODO">TODO</span> unit test: hkl_sample_affine.<br  /><div class="outline-text-5" id="text-6-1-6-2">
+<p>
+Check this:
+lattice=1.540000;1.540000;1.540000;90.000000;90.000000;90.000000;0;0;0;0;0;0
+uxuyuz=0.000000;0.000000;0.000000
+reflection=1.540000;0.159010;1.256718;0.796660;1;0.000000;0.000000;0.000000;0.000000;0.000000
+reflection=1.540000;0.206208;0.342357;-0.080346;1;0.000000;0.000000;0.000000;0.000000;0.000000
+reflection=1.540000;0.206208;0.342357;-0.080346;1;0.000000;0.000000;0.000000;0.000000;0.000000
+</p>
+
+<p>
+A,  B, C, Alpha,  Beta, Gamma, Ux, Uy, Uy:
+17764892.133, 5793679.092, 15733785.198,  179.997,  179.999,452408725.23,  -575727594.04,  -1913661011.01 (affine) 1rst finetness
+</p>
+</div>
+</li></ol>
+</div>
+<div id="outline-container-sec-6-1-7" class="outline-4">
+<h4 id="sec-6-1-7"><span class="section-number-4">6.1.7</span> <span class="todo TODO">TODO</span> HklEngine "zone"</h4>
+</div>
+<div id="outline-container-sec-6-1-8" class="outline-4">
+<h4 id="sec-6-1-8"><span class="section-number-4">6.1.8</span> <span class="todo TODO">TODO</span> HklEngine "custom"</h4>
+<div class="outline-text-4" id="text-6-1-8">
+<p>
+for now this pseudoaxis let you select the axis you
+want to use for the computation.
+</p>
+</div>
+</div>
+<div id="outline-container-sec-6-1-9" class="outline-4">
+<h4 id="sec-6-1-9"><span class="section-number-4">6.1.9</span> <span class="todo TODO">TODO</span> create a macro to help compare two real the right way</h4>
+<div class="outline-text-4" id="text-6-1-9">
+<p>
+fabs(a-b) < epsilon * max(1, abs(a), abs(b))
+</p>
+</div>
+</div>
+<div id="outline-container-sec-6-1-10" class="outline-4">
+<h4 id="sec-6-1-10"><span class="section-number-4">6.1.10</span> <span class="todo TODO">TODO</span> add an hkl_sample_set_lattice_unit()</h4>
+</div>
+<div id="outline-container-sec-6-1-11" class="outline-4">
+<h4 id="sec-6-1-11"><span class="section-number-4">6.1.11</span> <span class="todo TODO">TODO</span> SOLEIL SIXS</h4>
+<div class="outline-text-4" id="text-6-1-11">
+</div><ol class="org-ol"><li><a id="sec-6-1-11-1" name="sec-6-1-11-1"></a><span class="done DONE">DONE</span> find the right solutions.&#xa0;&#xa0;&#xa0;<span class="tag"><span class="zaxis">zaxis</span></span><br  /><div class="outline-text-5" id="text-6-1-11-1">
+<p>
+The cosinus and sinus properties are not enough to find the solution expected by the users.
+The idea is to use the Ewalds construction to generate a valid solution from the first one
+obtain numerically. The basic idea is to rotate the hkl vector around the last axis of the
+sample holder until it intersect again the Ewalds sphere. Then we just need to fit the
+detector position. This way the solution can be entirely generic (not geometry specific).
+Nevertheless it is necessary to propose this only for the hkl pseudo axes. I will add this
+special feature in the Mode. So it will be possible to add thoses special cases easily.
+</p>
+</div>
+</li>
+<li><a id="sec-6-1-11-2" name="sec-6-1-11-2"></a><span class="todo TODO">TODO</span> Add the DEP diffractometer geometry<br  /><div class="outline-text-5" id="text-6-1-11-2">
+<p>
+This diffractometer is a Newport one based on the kappa 6 circles ones.
+But instead of a kappa head, they use an Hexapod head.
+This head can be put horizontally or vertically.
+</p>
+</div>
+</li></ol>
+</div>
+<div id="outline-container-sec-6-1-12" class="outline-4">
+<h4 id="sec-6-1-12"><span class="section-number-4">6.1.12</span> <span class="todo TODO">TODO</span> generalisation of the z-axis hkl solver</h4>
+<div class="outline-text-4" id="text-6-1-12">
+<p>
+first we need the degenerated member of the Axis. thaht way it could be possible
+to find the last non degenerated axis for the detector fit.
+</p>
+</div>
+</div>
+<div id="outline-container-sec-6-1-13" class="outline-4">
+<h4 id="sec-6-1-13"><span class="section-number-4">6.1.13</span> <span class="todo TODO">TODO</span> investigate the prigo geometry.</h4>
+</div>
+<div id="outline-container-sec-6-1-14" class="outline-4">
+<h4 id="sec-6-1-14"><span class="section-number-4">6.1.14</span> <span class="todo TODO">TODO</span> augeas/elektra for the plugin configure part.</h4>
+</div>
+<div id="outline-container-sec-6-1-15" class="outline-4">
+<h4 id="sec-6-1-15"><span class="section-number-4">6.1.15</span> <span class="todo TODO">TODO</span> logging</h4>
+<div class="outline-text-4" id="text-6-1-15">
+</div><ol class="org-ol"><li><a id="sec-6-1-15-1" name="sec-6-1-15-1"></a><span class="todo TODO">TODO</span> <code>[1/2]</code> add in a few methods.<br  /><div class="outline-text-5" id="text-6-1-15-1">
+<ul class="org-ul">
+<li><code>[X]</code> hkl_pseudo_axes_values_set
+</li>
+<li><code>[&#xa0;]</code> hkl_sample_affine
+</li>
+</ul>
+</div>
+</li>
+<li><a id="sec-6-1-15-2" name="sec-6-1-15-2"></a><span class="todo TODO">TODO</span> gir logging<br  /><div class="outline-text-5" id="text-6-1-15-2">
+<p>
+It would be nice to generate the library logging using the .gir
+information. So instead of writing the logging code for each
+method, it would be better to have a generic method for this
+purpose.
+</p>
+</div>
+</li>
+<li><a id="sec-6-1-15-3" name="sec-6-1-15-3"></a><span class="todo TODO">TODO</span> parsable logging information.<br  /><div class="outline-text-5" id="text-6-1-15-3">
+<p>
+A parsable logging format would help to setup some re-play unit
+test. This way it could help during the developpement process
+(modification of the hkl internals) to be confident that
+computation are ok.
+</p>
+</div>
+</li></ol>
+</div>
+<div id="outline-container-sec-6-1-16" class="outline-4">
+<h4 id="sec-6-1-16"><span class="section-number-4">6.1.16</span> <span class="todo TODO">TODO</span> performances</h4>
+<div class="outline-text-4" id="text-6-1-16">
+<p>
+Investigate <a href="http://liboil.freedesktop.org/wiki/">liboil</a> to speed calculation (in HklVector, HklMatrix
+and HklQuaternion)
+</p>
+</div>
+</div>
+</div>
+<div id="outline-container-sec-6-2" class="outline-3">
+<h3 id="sec-6-2"><span class="section-number-3">6.2</span> documentation</h3>
+<div class="outline-text-3" id="text-6-2">
+</div><div id="outline-container-sec-6-2-1" class="outline-4">
+<h4 id="sec-6-2-1"><span class="section-number-4">6.2.1</span> <span class="todo TODO">TODO</span> <code>[1/6]</code> rewrite documentation in org-mode</h4>
+<div class="outline-text-4" id="text-6-2-1">
+<ul class="org-ul">
+<li><code>[-]</code> embedding code into the org file
+<ul class="org-ul">
+<li><code>[-]</code> <code>[1/4]</code> python
+<ul class="org-ul">
+<li><code>[X]</code> auto generation of the diffractometer descriptions
+</li>
+<li><code>[&#xa0;]</code> trajectories explanations
+</li>
+<li><code>[&#xa0;]</code> trajectories tests.
+</li>
+<li><code>[&#xa0;]</code> unit tests output ?
+</li>
+</ul>
+</li>
+<li><code>[&#xa0;]</code> asymptote
+</li>
+</ul>
+</li>
+<li><code>[X]</code> need to check if templates could be generated using the hkl
+python binding for all diffractometer geometries.
+</li>
+<li><code>[&#xa0;]</code> need to add a description for the diffractometer, the mode, the parameters.
+</li>
+<li><code>[&#xa0;]</code> need a nice css for the generated doc.
+</li>
+<li><code>[&#xa0;]</code> check if org-info.js could be usefull
+</li>
+<li><code>[&#xa0;]</code> add documentation explaining the sector-cuts a la hkl
+</li>
+</ul>
+</div>
+</div>
+</div>
+<div id="outline-container-sec-6-3" class="outline-3">
+<h3 id="sec-6-3"><span class="section-number-3">6.3</span> <code>[0/3]</code> gui</h3>
+<div class="outline-text-3" id="text-6-3">
+<ul class="org-ul">
+<li><code>[&#xa0;]</code> change the color of fitparameter cells if they differ from
+the current sample values
+</li>
+<li><code>[&#xa0;]</code> check if a <a href="https://github.com/jonathanslenders/python-prompt-toolkit/tree/master/examples/tutorial">REPL</a> could be integrated to provide an autocad
+like interface.
+</li>
+<li><code>[&#xa0;]</code> add tooltips using hkl_parameter_description_get for the
+pseudo axes and the mode parameters.
+</li>
+</ul>
+</div>
+</div>
+<div id="outline-container-sec-6-4" class="outline-3">
+<h3 id="sec-6-4"><span class="section-number-3">6.4</span> hkl3d</h3>
+<div class="outline-text-3" id="text-6-4">
+</div><div id="outline-container-sec-6-4-1" class="outline-4">
+<h4 id="sec-6-4-1"><span class="section-number-4">6.4.1</span> <span class="todo TODO">TODO</span> add a method to find the 3D models in the right directories.</h4>
+</div>
+</div>
+
+<div id="outline-container-sec-6-5" class="outline-3">
+<h3 id="sec-6-5"><span class="section-number-3">6.5</span> packaging</h3>
+<div class="outline-text-3" id="text-6-5">
+</div><div id="outline-container-sec-6-5-1" class="outline-4">
+<h4 id="sec-6-5-1"><span class="section-number-4">6.5.1</span> <span class="todo TODO">TODO</span> add a .spec file for rpm generation.</h4>
+</div>
+</div>
+</div>
+<div id="footnotes">
+<h2 class="footnotes">Footnotes: </h2>
+<div id="text-footnotes">
+
+<div class="footdef"><sup><a id="fn.1" name="fn.1" class="footnum" href="#fnr.1">1</a></sup> <p>DEFINITION NOT FOUND.</p></div>
+
+<div class="footdef"><sup><a id="fn.2" name="fn.2" class="footnum" href="#fnr.2">2</a></sup> <p>DEFINITION NOT FOUND.</p></div>
+
+<div class="footdef"><sup><a id="fn.3" name="fn.3" class="footnum" href="#fnr.3">3</a></sup> <p>DEFINITION NOT FOUND.</p></div>
+
+<div class="footdef"><sup><a id="fn.4" name="fn.4" class="footnum" href="#fnr.4">4</a></sup> <p>DEFINITION NOT FOUND.</p></div>
+
+
+</div>
+</div></div>
+<div id="postamble" class="status">
+<p class="author">Author: Picca Frédéric-Emmanuel</p>
+<p class="date">Created: 2015-01-30 ven. 09:17</p>
+<p class="creator"><a href="http://www.gnu.org/software/emacs/">Emacs</a> 24.4.1 (<a href="http://orgmode.org">Org</a> mode 8.2.10)</p>
+<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
+</div>
+</body>
+</html>
diff --git a/Documentation/hkl.org.in b/Documentation/hkl.org.in
new file mode 100644
index 0000000..9cbea74
--- /dev/null
+++ b/Documentation/hkl.org.in
@@ -0,0 +1,1003 @@
+#+TITLE: Welcome to hkl's @VERSION@ documentation!
+#+AUTHOR: Picca Frédéric-Emmanuel
+#+EMAIL: picca at synchrotron dash soleil dot fr
+#+LANGUAGE: en
+#+HTML_MATHJAX: path:"/usr/share/javascript/mathjax/MathJax.js"
+#+STYLE: <style>table.center {margin-left:auto; margin- right:auto;}</style>
+
+* Introduction
+  The purpose of the library is to factorise single crystal
+  diffraction angles computation for different kind of diffractometer
+  geometries. It is used at the SOLEIL, Desy and Alba synchrotron with
+  the Tango control system to pilot diffractometers.
+** Features
+   - mode computation (aka PseudoAxis)
+   - item for different diffractometer geometries.
+   - UB matrix computation.
+     - busing & Levy with 2 reflections
+     - simplex computation with more than 2 reflections using the GSL
+       library.
+     - Eulerians angles to pre-orientate your sample.
+   - Crystal lattice affinement
+     - with more than 2 reflections you can select which parameter must
+       be fitted.
+   - Pseudoaxes
+     - psi, eulerians, q, ...
+** Conventions
+   In all this document the next convention will be used to describe
+   the diffractometers geometries.
+   - right handed convention for all the angles.
+   - direct space orthogonal base.
+   - description of the diffractometer geometries is done with all
+     axes values set to zero.
+** Diffraction
+*** the crystal
+
+    A periodic crystal is the association of a pattern and a lattice. The
+    pattern is located at each points of the lattice node. Positions of
+    those nodes are given by:
+
+    \begin{displaymath}
+    R_{uvw}=u\cdot\vec{a}+v\cdot\vec{b}+w\cdot\vec{c}
+    \end{displaymath}
+
+    $\vec{a}$, $\vec{b}$, $\vec{c}$ are the former vector of a base of the
+    space. =u=, =v=, =w= are integrers. The pattern contain atomes
+    associated to each lattice node. the purpose of diffraction is to study
+    the interaction of this crystal (pattern+lattice) with X-rays.
+
+    #+CAPTION: Crystal direct lattice.
+    [[./figures/crystal.png]]
+
+    this lattice is defined by $\vec{a}$, $\vec{b}$, $\vec{c}$ vectors, and
+    the angles $\alpha$, $\beta$, $\gamma$. In general cases this lattice is
+    not othonormal.
+
+    Nevertheless to compute the interaction of this real space lattice and
+    the X-Rays, it is convenient to define another lattice called reciprocal
+    lattice defined like this:
+
+    \begin{eqnarray*}
+    \vec{a}^{\star} & = & \tau\frac{\vec{b}\wedge\vec{c}}{\vec{a}\cdot(\vec{b}\wedge\vec{c})}\\
+    \vec{b}^{\star} & = & \tau\frac{\vec{c}\wedge\vec{a}}{\vec{b}\cdot(\vec{c}\wedge\vec{a})}\\
+    \vec{c}^{\star} & = & \tau\frac{\vec{a}\wedge\vec{b}}{\vec{c}\cdot(\vec{a}\wedge\vec{b})}
+    \end{eqnarray*}
+
+    $\tau=2\pi$ or $\tau=1$ depending on the conventions.
+
+    It is then possible to define thoses orthogonal properties:
+
+    \begin{eqnarray*}
+    \vec{a}^{\star}\cdot\vec{a}=\tau & \vec{b}^{\star}\cdot\vec{a}=0    & \vec{c}^{\star}\cdot\vec{a}=0\\
+    \vec{a}^{\star}\cdot\vec{b}=0    & \vec{b}^{\star}\cdot\vec{b}=\tau & \vec{c}^{\star}\cdot\vec{b}=0\\
+    \vec{a}^{\star}\cdot\vec{c}=0    & \vec{b}^{\star}\cdot\vec{c}=0    & \vec{c}^{\star}\cdot\vec{c}=\tau
+    \end{eqnarray*}
+
+    This reciprocal space lattice allow to write in a simpler form the
+    interaction between the crystal and the X-Rays. We often only know about
+    $\vec{a}$, $\vec{b}$, $\vec{c}$ vectors and the angles $\alpha$,
+    $\beta$, $\gamma$. Using the previous equations reciprocal, we can
+    compute the reciprocal lattice this way:
+
+
+    \begin{eqnarray*}
+    a^{\star} & = & \frac{\sin\alpha}{aD}\\
+    b^{\star} & = & \frac{\sin\beta}{bD}\\
+    c^{\star} & = & \frac{\sin\gamma}{cD}
+    \end{eqnarray*}
+
+    where
+
+    \begin{displaymath}
+    D=\sqrt{1-\cos^{2}\alpha-\cos^{2}\beta-\cos^{2}\gamma+2\cos\alpha\cos\beta\cos\gamma}
+    \end{displaymath}
+
+    To compute the angles between the reciprocal space vectors, it is once
+    again possible to use the previous equations reciprocal to obtain the
+    sinus and cosinus of the angles $\alpha^\star$, $\beta^\star$ et
+    $\gamma^\star$:
+
+    \begin{eqnarray*}
+    \cos\alpha^{\star}=\frac{\cos\beta\cos\gamma-\cos\alpha}{\sin\beta\sin\gamma} & \, & \sin\alpha^{\star}=\frac{D}{\sin\beta\sin\gamma} \\
+    \cos\beta^{\star}=\frac{\cos\gamma\cos\alpha-\cos\beta}{\sin\gamma\sin\alpha} & \, & \sin\beta^{\star}=\frac{D}{\sin\gamma\sin\alpha}\\
+    \cos\gamma^{\star}=\frac{\cos\alpha\cos\beta-\cos\gamma}{\sin\alpha\sin\beta} & \, & \sin\gamma^{\star}=\frac{D}{\sin\alpha\sin\beta}
+    \end{eqnarray*}
+
+*** Diffraction
+
+    Let the incomming X-rays beam whose wave vector is $\vec{k_{i}}$,
+    $|k_{i}|=\tau/\lambda$ where $\lambda$ is the wavelength of the signal.
+    The $\vec{k_{d}}$ vector wavelength of the diffracted beam. There is
+    diffusion if the diffusion vector $\vec{q}$ can be expressed as follows:
+
+    \begin{displaymath}
+    \vec{q}=\vec{k_{d}}-\vec{k_{i}}=h.\vec{a}^{*}+k.\vec{b}^{*}+l.\vec{c}^{*}
+    \end{displaymath}
+
+    where $(h,k,l)\in\mathbb{N}^{3}$ and $(h,k,l)\neq(0,0,0)$. Thoses
+    indices $(h,k,l)$ are named Miller indices.
+
+    Another way of looking at things has been given by Bragg and that famous
+    relationship:
+
+    \begin{displaymath}
+    n\lambda=2d\sin\theta
+    \end{displaymath}
+
+    where $d$ is the inter-plan distance and $n \in \mathbb{N}$.
+
+    The diffusion accure for a unique $\theta$ angle. Then we got $\vec{q}$
+    perpendicular to the diffraction plan.
+
+    The Ewald construction allow to represent this diffraction in the
+    reciprocal space.
+
+*** Quaternions
+**** Properties
+
+     The quaternions will be used to discribe the diffractometers geometries.
+     Thoses quaternions can represent 3D rotations. There is different way to
+     describe then like complex numbers.
+
+     \begin{displaymath}
+     q=a+bi+cj+dk
+     \end{displaymath}
+
+     or
+
+     \begin{displaymath}
+     q=[a,\vec{v}]
+     \end{displaymath}
+
+     To compute the quaternion's norm, we can proceed like for complex
+     numbers
+
+     \begin{displaymath}
+     \lvert q \rvert = \sqrt{a{{}^2}+b{{}^2}+c{{}^2}+d{{}^2}}
+     \end{displaymath}
+
+     Its conjugate is :
+
+     \begin{displaymath}
+     q^{*}=[a,-\vec{u}]=a-bi-cj-dk
+     \end{displaymath}
+
+**** Operations
+
+     The difference with the complexnumber algebre is about
+     non-commutativity.
+
+     \begin{displaymath}
+     qp \neq pq
+     \end{displaymath}
+
+     \begin{displaymath}
+     \begin{bmatrix}
+     ~ & 1 & i  & j  & k \cr
+     1 & 1 & i  & j  & k \cr
+     i & i & -1 & k  & -j \cr
+     j & j & -k & -1 & i \cr
+     k & k & j  & -i & -1
+     \end{bmatrix}
+     \end{displaymath}
+
+     The product of two quaternions can be express by the Grassman product
+     Grassman product. So for two quaternions $p$ and $q$:
+
+     \begin{align*}
+     q &= a+\vec{u} = a+bi+cj+dk\\
+     p &= t+\vec{v} = t+xi+yj+zk
+     \end{align*}
+
+     we got
+
+     \begin{displaymath}
+     pq = at - \vec{u} \cdot \vec{v} + a \vec{v} + t \vec{u} + \vec{v} \times \vec{u}
+     \end{displaymath}
+
+     or equivalent
+
+     \begin{displaymath}
+     pq = (at - bx - cy - dz) + (bt + ax + cz - dy) i + (ct + ay + dx - bz) j + (dt + az + by - cx) k
+     \end{displaymath}
+
+**** 3D rotations
+
+     L'ensemble des quaternions unitaires (leur norme est égale à 1) est le
+     groupe qui représente les rotations dans l'espace 3D. Si on a un vecteur
+     unitaire $\vec{u}$ et un angle de rotation $\theta$ alors le quaternion
+     $[\cos\frac{\theta}{2},\sin\frac{\theta}{2}\vec{u]}$ représente la
+     rotation de $\theta$ autour de l'axe $\vec{u}$ dans le sens
+     trigonométrique. Nous allons donc utiliser ces quaternions unitaires
+     pour représenter les mouvements du diffractomètre.
+
+     Alors que dans le plan 2D une simple multiplication entre un nombre
+     complex et le nombre $e^{i\theta}$ permet de calculer simplement la
+     rotation d'angle $\theta$ autour de l'origine, dans l'espace 3D
+     l'expression équivalente est:
+
+     \begin{displaymath}
+     z'=qzq^{-1}
+     \end{displaymath}
+
+     où $q$ est le quaternion de norme 1 représentant la rotation dans
+     l'espace et $z$ le quaternion représentant le vecteur qui subit la
+     rotation (sa partie réelle est nulle).
+
+     Dans le cas des quaternions de norme 1, il est très facile de calculer
+     $q^{-1}$. En effet l'inverse d'une rotation d'angle $\theta$ est la
+     rotation d'angle $-\theta$. On a donc directement:
+
+     \begin{displaymath}
+     q^{-1}=[\cos\frac{-\theta}{2},\sin\frac{-\theta}{2}\vec{u}]=[\cos\frac{\theta}{2},-\sin\frac{\theta}{2}\vec{u}]=q^{*}
+     \end{displaymath}
+
+     Le passage aux matrices de rotation se fait par la formule suivante
+     $q\rightarrow M$.
+
+     \begin{displaymath}
+     \begin{bmatrix}
+     a{{}^2}+b{{}^2}-c{{}^2}-d{{}^2} & 2bc-2ad & 2ac+2bd\\
+     2ad+2bc & a{{}^2}-b{{}^2}+c{{}^2}-d{{}^2} & 2cd-2ab\\
+     2bd-2ac & 2ab+2cd & a{{}^2}-b{{}^2}-c{{}^2}+d{{}^2}
+     \end{bmatrix}
+     \end{displaymath}
+
+     La composition de rotation se fait simplement en multipliant les
+     quaternions entre eux. Si l'on à $q$
+
+** Modes de fonctionnement
+** Equations fondamentales
+
+   Le problème que nous devons résoudre est de calculer pour une famille de
+   plan $(h,k,l)$ donné, les angles de rotation du diffractomètre qui
+   permettent de le mettre en condition de diffraction. Il faut donc
+   exprimer les relations mathématiques qui lient les différents angles
+   entre eux lorsque la condition de Bragg est vérifiée. L'équation
+   fondamentale est la suivante:
+
+   \begin{align*}
+   \left(\prod_{i}S_{i}\right)\cdot U\cdot B\cdot\vec{h} & =\left(\prod_{j}D_{j}-I\right)\cdot\vec{k_{i}}\\
+   R\cdot U\cdot B\cdot\vec{h} & =\vec{Q}
+   \end{align*}
+
+   ou $\vec{h}$ est le vecteur $(h,k,l)$, $\vec{k_{i}}$ est le vecteur
+   incident, $S_{i}$ les matrices de rotations des mouvements liés à
+   l'échantillon, $D_{j}$ les matrices de rotation des mouvements liés au
+   détecteur, $I$ la matrice identité, $U$ la matrice d'orientation du
+   cristal par rapport au repère de l'axe sur lequel ce dernier est monté
+   et $B$ la matrice de passage d'un repère non orthonormé ( celui du
+   crystal réciproque) à un repère orthonormé.
+
+*** Calcule de B
+
+    Si l'on connaît les paramètres cristallins du cristal étudié, il est
+    très simple de calculer $B$:
+
+    \begin{displaymath}
+    B=
+    \begin{bmatrix}
+    a^{\star} & b^{\star}\cos\gamma^{\star} & c^{\star}\cos\beta^{\star}\\
+    0 & b^{\star}\sin\gamma^{\star} & -c^{\star}\sin\beta^{\star}\cos\alpha\\
+    0 & 0 & 1/c
+    \end{bmatrix}
+    \end{displaymath}
+
+*** Calcule de U
+
+    Il existe plusieurs façons de calculer $U$. Busing et Levy en a proposé
+    plusieurs. Nous allons présenter celle qui nécessite la mesure de
+    seulement deux réflections ainsi que la connaissance des paramètres
+    cristallins. Cette façon de calculer la matrice d'orientation $U$, peut
+    être généralisée à n'importe quel diffractomètre pour peu que la
+    description des axes de rotation permette d'obtenir la matrice de
+    rotation de la machine $R$ et le vecteur de diffusion $\vec{Q}$.
+
+    Il est également possible de calculer $U$ sans la connaîssance des
+    paramètres cristallins. il faut alors faire un affinement des
+    paramètres. Cela revient à minimiser une fonction. Nous allons utiliser
+    la méthode du simplex pour trouver ce minimum et donc ajuster l'ensemble
+    des paramètres cristallins ainsi que la matrice d'orientation.
+
+*** Algorithme de Busing Levy
+
+    L'idée est de se placer dans le repère de l'axe sur lequel est monté
+    l'échantillon. On mesure deux réflections $(\vec{h}_{1},\vec{h}_{2})$
+    ainsi que leurs angles associés. Cela nous permet de calculer $R$ et
+    $\vec{Q}$ pour chacune de ces reflections. nous avons alors ce système:
+
+    \begin{eqnarray*}
+    U\cdot B\cdot\vec{h}_{1} & = & \tilde{R}_{1}\cdot\vec{Q}_{1}\\
+    U\cdot B\cdot\vec{h}_{2} & = & \tilde{R}_{2}\cdot\vec{Q}_{2}
+    \end{eqnarray*}
+
+    De façon à calculer facilement $U$, il est intéressant de définir deux
+    trièdres orthonormé $T_{\vec{h}}$ et $T_{\vec{Q}}$ à partir des vecteurs
+    $(B\vec{h}_{1},B\vec{h}_{2})$ et
+    $(\tilde{R}_{1}\vec{Q}_{1},\tilde{R}_{2}\vec{Q}_{2})$. On a alors très
+    simplement:
+
+    \begin{displaymath}
+    U \cdot T_{\vec{h}} = T_{\vec{Q}}
+    \end{displaymath}
+
+    Et donc
+
+    \begin{displaymath}
+    U = T_{\vec{Q}} \cdot \tilde{T}_{\vec{h}}
+    \end{displaymath}
+
+*** Affinement par la méthode du simplex
+
+    Dans ce cas nous ne connaissons pas la matrice $B$, il faut donc mesurer
+    plus que deux réflections pour ajuster les 9 paramètres. Six paramètres
+    pour le crystal et trois pour la matrice d'orientation $U$. Les trois
+    paramètres qui permennt de representer $U$ sont en fait les angles
+    d'euler. il faut donc être en mesure de passer d'une représentation
+    eulérien à cette matrice :math::U et réciproquement.
+
+    \begin{displaymath}
+    U = X \cdot Y \cdot Z
+    \end{displaymath}
+
+    où $X$ est la matrice rotation suivant l'axe Ox et le premier angle
+    d'Euler, $Y$ la matrice de rotation suivant l'axe Oy et le deuxième
+    angle d'Euler et $Z$ la matrice du troisième angle d'Euler pour l'axe
+    Oz.
+
+    #+ATTR_HTML: class="center"
+    | $X$        | $Y$        | $Z$        |
+    | <10>       | <10>       | <10>       |
+    | $\begin{bmatrix} 1 & 0 & 0\\ 0 & A & -B\\ 0 & B & A \end{bmatrix}$ | $\begin{bmatrix}C & 0 & D\\0 & 1 & 0\\-D & 0 & C\end{bmatrix}$ | $\begin{bmatrix}E & -F & 0\\F & E & 0\\0 & 0 & 1\end{bmatrix}$ |
+
+    et donc:
+
+    \begin{displaymath}
+    U=
+    \begin{bmatrix}
+    CE & -CF & D\\
+    BDE+AF & -BDF+AE & -BC\\
+    -ADE+BF & ADF+BE & AC
+    \end{bmatrix}
+    \end{displaymath}
+
+    Il est donc facile de passer des angles d'Euler à la matrice
+    d'orientation.
+
+    Il faut maintenant faire la transformation inverse de la matrice $U$
+    vers les angles d'euler.
+
+* PseudoAxes
+  This section describe the calculations done by the library for the
+  different kind of pseudo axes.
+** Eulerians to Kappa angles
+
+   1st solution
+
+   \begin{eqnarray*}
+   \kappa_\omega & = & \omega - p + \frac{\pi}{2} \\
+   \kappa & = & 2 \arcsin\left(\frac{\sin\frac{\chi}{2}}{\sin\alpha}\right) \\
+   \kappa_\phi & = &  \phi - p - \frac{\pi}{2}
+   \end{eqnarray*}
+
+   or 2nd one
+
+   \begin{eqnarray*}
+   \kappa_\omega & = & \omega - p - \frac{\pi}{2} \\
+   \kappa & = & -2 \arcsin\left(\frac{\sin\frac{\chi}{2}}{\sin\alpha}\right) \\
+   \kappa_\phi & = &  \phi - p + \frac{\pi}{2}
+   \end{eqnarray*}
+
+   where
+
+   \begin{displaymath}
+   p = \arcsin\left(\frac{\tan\frac{\chi}{2}}{\tan\alpha}\right)
+   \end{displaymath}
+
+   and $\alpha$ is the angle of the kappa axis with the $\vec{y}$ axis.
+
+** Kappa to Eulerians angles
+
+   1st solution
+
+   \begin{eqnarray*}
+   \omega & = & \kappa_\omega + p - \frac{\pi}{2} \\
+   \chi   & = & 2 \arcsin\left(\sin\frac{\kappa}{2} \sin\alpha\right) \\
+   \phi   & = & \kappa_\phi + p + \frac{\pi}{2}
+   \end{eqnarray*}
+
+   or 2nd one
+
+   \begin{eqnarray*}
+   \omega & = & \kappa_\omega + p + \frac{\pi}{2} \\
+   \chi   & = & -2 \arcsin\left(\sin\frac{\kappa}{2} \sin\alpha\right) \\
+   \phi   & = & \kappa_\phi + p - \frac{\pi}{2}
+   \end{eqnarray*}
+
+   where
+
+   \begin{displaymath}
+   p = \arctan\left(\tan\frac{\kappa}{2} \cos\alpha\right)
+   \end{displaymath}
+
+   #+CAPTION: $\omega = 0$, $\chi = 0$, $\phi = 0$, 1st solution
+   [[./figures/e2k_1.png]]
+
+   #+CAPTION: $\omega = 0$, $\chi = 0$, $\phi = 0$, 2nd solution
+   [[./figures/e2k_2.png]]
+
+   #+CAPTION: $\omega = 0$, $\chi = 90$, $\phi = 0$, 1st solution
+   [[./figures/e2k_3.png]]
+
+   #+CAPTION: $\omega = 0$, $\chi = 90$, $\phi = 0$, 2nd solution
+   [[./figures/e2k_4.png]]
+
+** Qper and Qpar
+   [[./figures/qper_qpar.png]]
+
+   this pseudo axis engine compute the perpendicular
+   ($\left|\left|\vec{Q_\text{per}}\right|\right|$) and parallel
+   ($\left|\left|\vec{Q_\text{par}}\right|\right|$) contribution of
+   $\vec{Q}$ relatively to the surface of the sample defined by the
+   $\vec{n}$ vector.
+
+   \begin{eqnarray*}
+   \vec{q} & = & \vec{k_\text{f}} - \vec{k_\text{i}} \\
+   \vec{q} & = & \vec{q_\text{per}} + \vec{q_\text{par}} \\
+   \vec{q_\text{per}} & = & \frac{\vec{q} \cdot \vec{n}}{\left|\left|\vec{n}\right|\right|} \frac{\vec{n}}{\left|\left|\vec{n}\right|\right|}
+   \end{eqnarray*}
+* Diffractometers
+  #+BEGIN_QUOTE
+  *warning*
+
+  This section is automatically generating by introspecting the hkl library.
+  #+END_QUOTE
+
+#+BEGIN_SRC python :exports results :results value raw
+  from gi.repository import Hkl
+
+  def bold(l):
+      return ["\"*" + _ + "*\"" for _ in l]
+
+  def level(indent=1, s=None):
+      return "  "*indent + s
+
+  diffractometers = Hkl.factories().iterkeys()
+
+  output = ''
+  for diffractometer in sorted(diffractometers):
+      factory = Hkl.factories()[diffractometer]
+      output += "** " + diffractometer + "\n\n"
+      detector = Hkl.Detector.factory_new(Hkl.DetectorType(0))
+      sample = Hkl.Sample.new("toto")
+      geometry = factory.create_new_geometry()
+      engines = factory.create_new_engine_list()
+      engines.init(geometry, detector, sample)
+
+      output += "*** Axes: \n"
+      for axis in geometry.axis_names_get():
+          axis_v = geometry.axis_get(axis).axis_v_get().data
+          output += level(2, "+ \"*" + axis + "*\": rotation around the *" + repr(axis_v) + "* axis\n")
+
+      output += "*** Engines: \n"
+      for engine in engines.engines_get():
+          output += "**** \"*" + engine.name_get() + "*\":\n\n"
+          output += level(3, "* pseudo axes:\n")
+          for pseudo in engine.pseudo_axis_names_get():
+              p = engine.pseudo_axis_get(pseudo)
+              description = p.description_get()
+              output += level(4, "* \"*" + pseudo + "*\" : " + description + '\n\n')
+          output += "\n"
+          for mode in engine.modes_names_get():
+              output += level(3, "+ mode: \"*" + mode + "*\"\n")
+              engine.current_mode_set(mode)
+              axes_r = engine.axis_names_get(Hkl.EngineAxisNamesGet.READ)
+              axes_w = engine.axis_names_get(Hkl.EngineAxisNamesGet.WRITE)
+              output += level(4, "+ axes (read) : " + ", ".join(bold(axes_r)) + "\n")
+              output += level(4, "+ axes (write): " + ", ".join(bold(axes_w)) + "\n")
+              parameters = engine.parameters_names_get()
+              output += level(4, "+ parameters: ")
+              if parameters:
+                  output += "\n"
+                  for parameter in parameters:
+                      p = engine.parameter_get(parameter)
+                      description = p.description_get()
+                      value = p.value_get(Hkl.UnitEnum.USER)
+                      output += level(5, "+ *" + parameter + "* [" + str(value) + "]: " + description + "\n")
+              else:
+                  output += "No parameter\n"
+
+  return output
+#+END_SRC
+* Developpement
+** Getting hkl
+
+   To get hkl, you can download the last stable version from sourceforge or
+   if you want the latest development version use
+   [[http://git.or.cz/][git]] or
+   [[http://code.google.com/p/msysgit/downloads/list][msysgit]] on windows
+   system and do:
+
+   #+BEGIN_SRC sh
+git clone git://repo.or.cz/hkl.git
+   #+END_SRC
+
+   or:
+
+   #+BEGIN_SRC sh
+    git clone http://repo.or.cz/r/hkl.git (slower)
+   #+END_SRC
+
+   then checkout the next branch like this:
+
+   #+BEGIN_SRC sh
+    cd hkl
+    git checkout -b next origin/next
+   #+END_SRC
+
+** Building hkl
+
+   To build hkl you need [[http://www.python.org][Python 2.3+]] the
+   [[http://www.gnu.org/software/gsl/][GNU Scientific Library 1.12]] and
+   [[https://developer.gnome.org/glib/][GLib-2.0 >= 2.3.4]]:
+
+   #+BEGIN_SRC sh
+    ./configure --disable-gui
+    make
+    sudo make install
+   #+END_SRC
+
+   you can also build a GUI interfaces which use
+   [[http://www.gtk.org][gtk]]:
+
+   #+BEGIN_SRC sh
+    ./configure
+    make
+    sudo make install
+   #+END_SRC
+
+   optionnaly you can build an experimental /libhkl3d/ library (no public
+   API for now) which is used by the GUI to display and compute
+   diffractometer collisions (only the /K6C/ model). To build it you need
+   also [[https://projects.gnome.org/gtkglext/][gtkglext]] and
+   [[http://bulletphysics.org/wordpress/][bullet 2.82]]:
+
+   #+BEGIN_SRC sh
+    ./configure --enable-hkl3d
+    make
+    sudo make install
+   #+END_SRC
+
+   if you want to work on the documentation you need the extra
+
+   - [[http://www.gtk.org/gtk-doc/][gtk-doc]] for the api
+   - [[http://sphinx.pocoo.org/][sphinx]] for the html and latex doc.
+   - [[http://asymptote.sourceforge.net/][asymptote]] for the figures
+   - [[http://www.gnu.org/software/emacs/][emacs]] the well known editor
+   - [[https://github.com/emacsmirror/htmlize][htmlize]] used to highlight the source code
+   - [[http://orgmode.org][org-mode]] litteral programming
+
+   On Debian/Ubuntu you just need to install
+
+   #+BEGIN_SRC sh
+    sudo apt-get install emacs dvipng emacs-goodies-el org-mode
+   #+END_SRC
+
+   #+BEGIN_SRC sh
+    ./configure --enable-gtk-doc
+    make
+    make html
+#+END_SRC
+
+   nevertheless if you do not want to build the documentation you can do:
+
+   #+BEGIN_SRC sh
+   ./configure --disable-hkl-doc
+   #+END_SRC
+
+** Hacking hkl
+*** Bug reporting
+
+    You can find the bug tracker here
+    [[https://bugs.debian.org/cgi-bin/pkgreport.cgi?repeatmerged=no&src=hkl][libhkl]]
+
+-  Debian/Ubuntu:
+
+   #+BEGIN_SRC sh
+       reportbug hkl
+   #+END_SRC
+
+-  Other OS
+
+   You just need to send an [[mailto:submit at bugs.debian.org?subject=%20My%20problem%20with%20hkl...&body=Package:%20hkl%0AVersion:%20 at VERSION@%0A%0AI%20found%20this%20problem%20in%20hkl][email]]
+
+*** Providing patchs
+
+    you can send your patch to [[picca at synchrotron-soleil.fr][Picca
+    Frédéric-Emmanuel]] using =git=
+
+    Here a minimalist exemple of the workflow to prepare and send a patch
+    for hkl. Suppose you wan to add a new feature to hkl create first a new
+    branch from the next one:
+
+    #+BEGIN_SRC sh
+    git checkout -b my-next next
+    #+END_SRC
+
+    hack, hack:
+
+    #+BEGIN_SRC sh
+    git commit -a
+    #+END_SRC
+
+    more hacks:
+
+    #+BEGIN_SRC sh
+    git commit -a
+    #+END_SRC
+
+    now that your new feature is ready for a review, you can send by email
+    your work using git format-patch:
+
+    #+BEGIN_SRC sh
+    git format-patch origin/next
+    #+END_SRC
+
+    and send generated files ~0001\_xxx~, ~0002\_xxx~, ... to the author.
+
+** Howto's
+*** Add a diffractometer
+    To add a new diffractometer, you just need to copy the
+    ~hkl/hkl-engine-template.c~ into
+    ~hkl/hkl-engine-INSTITUT-BEAMLINE-INSTRUMENT.c~ where you replace
+    the upper case with the appropriate values.
+
+    The template file is compiled during the build process to ensure
+    that it is always valid.
+
+    Then you just need to follow the instruction found in the
+    template. If you need some precision about the process, do not
+    hesitate to contact the main author.
+
+    do not forgot also to add this new file into ~hkl/Makefile.am~
+    with other diffractometers in the hkl_c_sources variable (please
+    keep the alphabetic order).
+*** Work on the documentation
+    The documentation system is written with [[http://orgmode.org/][org-mode]], and the [[http://orgmode.org/worg/org-contrib/babel/][babel]]
+    extension which allow to introspect the library and generate part
+    of the doc using the hkl library. Python code is executed during
+    the build process to generate the Diffractometer section of the
+    documentation. To work on the doc and test the embedded python
+    code it is necessary to setup a few environment variables and
+    start emacs with the right LD_LIBRARY_PATH. In order to simplify
+    the process a make target was written. You just need to type:
+    #+BEGIN_SRC sh
+      cd Documentation
+      make editdoc
+    #+END_SRC
+    and start to contribute.
+
+    If you do not have emacs, you can nevertheless contribute by
+    editing the ~Documentation/hkl.org.in~ file which is text only.
+
+    The most expected contributions for now are:
+    * english correctness
+    * a nicer css
+* Bindings
+
+  The hkl library use the gobject-introspection to provide automatic
+  binding for a few languages.
+
+** Python
+
+   hkl computation:
+
+   has you can see there is 4 available solutions.
+
+   let's compute an hkl trajectory and select the first solution.
+
+   if we look at the 3 other solutions we can see that there is a problem
+   of continuity at the begining of the trajectory.
+
+   hey what's happend with theses solutions ! let's look closely to real
+   numbers. the last column is the distance to the diffractometer current
+   position. This distance is for now express like this:
+
+   $\sum_{axes} \left|\text{current position} - \text{target position}\right|$
+
+   #+BEGIN_EXAMPLE
+    [0.0, 119.99999999999999, 0.0, -90.0, 0.0, 59.99999999999999] 0.0
+    [0.0, -119.99999999999999, 0.0, -90.0, 0.0, -59.99999999999999] 6.28318530718
+    [0.0, -60.00000000000005, 0.0, 90.0, 0.0, 59.99999999999999] 6.28318530718
+    [0.0, 60.00000000000001, 0.0, 90.0, 0.0, -59.99999999999999] 6.28318530718
+
+    [0.0, 117.7665607657826, 7.456826294401656, -92.39856410531434, 0.0, 60.33024982425957] 0.216753826612
+    [0.0, -57.436310940366894, -7.456826294401656, 92.39856418853617, 0.0, 60.33024982425957] 6.41621345188
+    [0.0, 62.2334392342174, -7.456826294401656, 92.39856410531434, 0.0, -60.33024982425957] 6.42197739723
+    [0.0, -122.5636890596331, 7.456826294401656, -92.3985641885362, 0.0, -60.33024982425957] 6.50570308205
+
+    [0.0, 115.89125602137928, 14.781064139466098, -94.7660423112577, 0.0, 61.314597086440706] 0.219062698235
+    [0.0, -125.42334103772737, 14.781064139466098, -94.7660427050904, 0.0, -61.314597086440706] 6.53671995288
+    [0.0, -54.57665896227262, -14.781064139466098, 94.76604270509038, 0.0, 61.314597086440706] 6.67989976726
+    [0.0, 64.10874397862072, -14.781064139466098, 94.7660423112577, 0.0, -61.314597086440706] 6.71437170098
+
+    [0.0, 114.39338605351007, 21.85448296702796, -97.074145033719, 0.0, 62.93506298693471] 0.218163667981
+    [0.0, -128.54167683157993, 21.85448296702796, -97.07414574435087, 0.0, -62.93506298693471] 6.59846359365
+    [0.0, -51.45832316842005, -21.85448296702796, 97.07414574435087, 0.0, 62.93506298693471] 6.93673746356
+    [0.0, 65.60661394648993, -21.85448296702796, 97.074145033719, 0.0, -62.93506298693471] 7.03385205725
+
+    [0.0, 113.28316795475283, 28.583837575232764, -99.29953499008337, 0.0, 65.16540747008955] 0.21459359225
+    [0.0, -131.88223933078322, 28.583837575232764, -99.29953638594702, 0.0, -65.16540747008955] 6.69038531388
+    [0.0, -48.11776066921677, -28.583837575232764, 99.29953638594702, 0.0, 65.16540747008955] 7.18296350386
+    [0.0, 66.71683204524717, -28.583837575232764, 99.29953499008337, 0.0, -65.16540747008955] 7.37556986959
+
+    [0.0, 112.56286877075006, 34.90573305321372, -101.42496979586187, 0.0, 67.97568017857415] 0.209053830457
+    [0.0, -135.4128111996365, 34.90573305321372, -101.42497263302461, 0.0, -67.97568017857415] 6.81174779784
+    [0.0, -44.58718880036348, -34.90573305321372, 101.4249726330246, 0.0, 67.97568017857415] 7.41581162393
+    [0.0, 67.43713122924994, -34.90573305321372, 101.42496979586187, 0.0, -67.97568017857415] 7.7353201851
+
+    [0.0, 112.2291126083182, 40.78594007247402, -103.43941832567457, 0.0, 71.33706722449408] 0.202280147961
+    [0.0, -139.10795451001587, 40.78594007247402, -103.43942357602316, 0.0, -71.33706722449408] 6.96173845391
+    [0.0, -40.89204548998411, -40.78594007247402, 103.43942357602312, 0.0, 71.33706722449408] 7.63358787543
+    [0.0, 67.7708873916818, -40.78594007247402, 103.43941832567457, 0.0, -71.33706722449408] 8.10986069093
+
+    [0.0, 112.27578927291766, 46.214916130901734, -105.33741042812996, 0.0, 75.22640762217479] 0.196576175748
+    [0.0, -142.95061850160724, 46.214916130901734, -105.3374188005596, 0.0, -75.22640762217479] 7.13962155618
+    [0.0, -37.04938149839278, -46.214916130901734, 105.33741880055959, 0.0, 75.22640762217479] 7.83557762281
+    [0.0, 67.72421072708234, -46.214916130901734, 105.33741042812996, 0.0, -75.22640762217479] 8.49706672677
+
+    [0.0, 112.697137434232, 51.201667684695856, -107.11797492933192, 0.0, 79.63023536264535] 0.202327153157
+    [0.0, -146.9330984641471, 51.201667684695856, -107.11798610058318, 0.0, -79.63023536264535] 7.34491897177
+    [0.0, -33.0669015358529, -51.201667684695856, 107.11798610058317, 0.0, 79.63023536264535] 8.02185610877
+    [0.0, 67.30286256576798, -51.201667684695856, 107.11797492933192, 0.0, -79.63023536264535] 8.89597005568
+
+    [0.0, 113.49085964586432, 55.76762791023837, -108.78347437395287, 0.0, 84.54867879242364] 0.208455586312
+    [0.0, -151.05782007465257, 55.76762791023837, -108.78348605483542, 0.0, -84.54867879242364] 7.57761473366
+    [0.0, -28.942179925347414, -55.76762791023837, 108.78348605483538, 0.0, 84.54867879242364] 8.19307323084
+    [0.0, 66.50914035413568, -55.76762791023837, 108.78347437395287, 0.0, -84.54867879242364] 9.30675279514
+
+    [0.0, 114.6614608037443, 59.941489465646214, -110.3385360479293, 0.0, 90.00000081324956] 0.215562935229
+    [0.0, -155.33854118146962, 59.941489465646214, -110.33854432979601, 0.0, -89.99999918675044] 7.83839602383
+    [0.0, -24.661458818530395, -59.941489465646214, 110.33854432979601, 0.0, 90.00000081324956] 8.3502621071
+    [0.0, 65.3385391962557, -59.941489465646214, 110.3385360479293, 0.0, -89.99999918675044] 9.7307712883
+   #+END_EXAMPLE
+
+   as you can see for the first point of the trajectory, the 2nd, 3rd and
+   4th solutions have identical distances to the current position of the
+   diffractometer so they are un-ordered:
+
+   #+BEGIN_EXAMPLE
+    [0.0, 119.99999999999999, 0.0, -90.0, 0.0, 59.99999999999999] 0.0
+    [0.0, -119.99999999999999, 0.0, -90.0, 0.0, -59.99999999999999] 6.28318530718
+    [0.0, -60.00000000000005, 0.0, 90.0, 0.0, 59.99999999999999] 6.28318530718
+    [0.0, 60.00000000000001, 0.0, 90.0, 0.0, -59.99999999999999] 6.28318530718
+   #+END_EXAMPLE
+
+   then the problem arise with the second and third solution. you can see a
+   sort of reorganisation of the solution. 2 -> 3, 3 -> 4 and 4 -> 2 then
+   the order will stick unchanged until the end of the trajectory. this is
+   because the distance is computed relatively to the current position of
+   the diffractometer.:
+
+   #+BEGIN_EXAMPLE
+    [0.0, 117.7665607657826, 7.456826294401656, -92.39856410531434, 0.0, 60.33024982425957] 0.216753826612
+    [0.0, -57.436310940366894, -7.456826294401656, 92.39856418853617, 0.0, 60.33024982425957] 6.41621345188
+    [0.0, 62.2334392342174, -7.456826294401656, 92.39856410531434, 0.0, -60.33024982425957] 6.42197739723
+    [0.0, -122.5636890596331, 7.456826294401656, -92.3985641885362, 0.0, -60.33024982425957] 6.50570308205
+
+    [0.0, 115.89125602137928, 14.781064139466098, -94.7660423112577, 0.0, 61.314597086440706] 0.219062698235
+    [0.0, -125.42334103772737, 14.781064139466098, -94.7660427050904, 0.0, -61.314597086440706] 6.53671995288
+    [0.0, -54.57665896227262, -14.781064139466098, 94.76604270509038, 0.0, 61.314597086440706] 6.67989976726
+    [0.0, 64.10874397862072, -14.781064139466098, 94.7660423112577, 0.0, -61.314597086440706] 6.71437170098
+   #+END_EXAMPLE
+
+   #+BEGIN_QUOTE
+   *warning*
+
+   when you compute a trajectory, start from a valid position (the
+   starting point must be the real first point of your trajectory) then
+   use only the closest solution for the next points of the trajectory.
+   (first solution of the geometries list)
+   #+END_QUOTE
+* Todo
+** hkl
+*** TODO [0/2] PetraIII
+**** TODO computation problem
+     Dear Teresa,
+
+     Using the prruptest.txt ubmatrix I see that the value of psi is
+     offset by 45 degrees. I expect it to be 0 degrees when azimuth
+     reference vector is 0 0 1 that is along the beam. See below
+     thereturned numbers. This might have to do with the definition of
+     the beam axis in the controller.  Otherwise now when I change
+     reference vector by 90 degrees the computed value is changed by
+     90 degrees. That is a progress. Can you contact Frederic and ask
+     him about this ?
+
+     Best regards,
+
+     Sonia
+
+     See below
+     p09/door/haspp09.01 [9]: setaz 1 0 0
+
+     p09/door/haspp09.01 [10]: wh
+
+     Engine: hkl
+
+     Mode: psi_constant_vertical
+
+     H K L =    0.00000   3.00605  -0.00000
+     Ref   =    1.00000   0.00000   0.00000
+     Azimuth (Psi - calculated) =  -45.00005
+     Azimuth (Psi - set) =  0.00000
+     Wavelength =  2.07957
+
+     Delta       Theta          Chi         Phi         Mu       Gamma
+     45.77575    22.88783     90.00000   182.85400    0.00000    -0.00000
+
+     p09/door/haspp09.01 [11]: setaz 0 0 1
+
+     p09/door/haspp09.01 [12]: wh
+
+     Engine: hkl
+
+     Mode: psi_constant_vertical
+
+     H K L =    0.00000   3.00605  -0.00000
+     Ref   =    0.00000   0.00000   1.00000
+     Azimuth (Psi - calculated) =  -135.00005
+     Azimuth (Psi - set) =  0.00000
+     Wavelength =  2.07957
+
+     Delta       Theta          Chi         Phi         Mu       Gamma
+     45.77575    22.88783     90.00000   182.85400    0.00000    -0.00000
+
+     where:
+
+     Azimuth (Psi - calculated) is the value of the pseudomotor psi.
+     Azimuth (Psi - set) is the value set in the parameter psi of the current mode.
+
+   Hi Frederic,
+
+   This is the UB matrix:
+
+   Best regards,
+
+   Sonia
+
+   Created at 2015-01-21 12:35
+
+   Crystal    prruptest
+
+   Wavelength 2.07957463938
+
+   A 8.03656 B 8.03656 C 8.03656
+   Alpha 90.0 Beta 90.0 Gamma 90.0
+
+   R0 0 0.0 1.0 0.0 0 1 0.0 14.8979 90.0 182.854 0.0 29.7959
+   R1 1 1.0 0.0 1.0 0 1 0.0 14.8979 0.0 182.854 0.0 29.7959
+
+   Mode psi_constant_vertical
+
+   PsiRef 0.0 0.0 1.0
+
+   U00 -0.580 U01 0.000 U02 0.525
+   U10 0.000 U11 0.782 U12 -0.000
+   U20 -0.525 U21 -0.000 U22 -0.580
+
+   Ux 179.999952315 Uy 42.14605 Uz -179.999932647
+
+   SaveDirectory /home/p09user/crystals/
+
+**** TODO another question
+     J'ai un probleme avec la position que le controlleur calcule avec la
+     matrice UB que nous t'avons envoye.
+     See sequence of emails echanges avec Teresa.
+
+     >>>> I am at 0 3.00605 0 with phi -182 and psi calculated is -135
+     >>>> When I freeze psi at -135  and type ca 0 3.00605 0 the controller
+     >> should return to me the positions at which I am. But no he tells me
+     that I
+     >> have to go to 178 degrees in  phi that is turning by 360 degrees.
+
+     Est-ce un probleme avec la trajectoire selectionnee ?
+     Est-ce qu'il est possible de definir des cut-points comme dans spec avec
+     ta librairie ?
+*** TODO [2/4] HklParameter
+    - [X] method to use min/max to check for the validity
+    - [X] add a method to get the axis_v and quaternion of the HklAxis
+      this method will return NULL if this is not relevant.
+      hkl_parameter_axis_v_get and hkl_parameter_quaternion_get
+    - [ ] degenerated an axis is degenerated if its position have no
+      effect on the HklPseudoAxis calculus. Add a degenerated member
+      to the axis. that way it would be possible to check a posteriori
+      for this degenerescencence.
+    - [ ] Add a description for each parameters.
+      This will help for the documentation and the gui.
+*** TODO HklGeometryList different method to help select a solution.
+    this select solution can depend on the geometry
+    for example the kappa axis must be in one side of the plane.
+*** TODO add a fit on the Hklaxis offsets.
+*** TODO API to put a detector and a sample on the Geometry.
+*** TODO HklSample
+**** TODO HklSample add the cell volum computation.
+**** TODO unit test: hkl_sample_affine.
+     Check this:
+     lattice=1.540000;1.540000;1.540000;90.000000;90.000000;90.000000;0;0;0;0;0;0
+     uxuyuz=0.000000;0.000000;0.000000
+     reflection=1.540000;0.159010;1.256718;0.796660;1;0.000000;0.000000;0.000000;0.000000;0.000000
+     reflection=1.540000;0.206208;0.342357;-0.080346;1;0.000000;0.000000;0.000000;0.000000;0.000000
+     reflection=1.540000;0.206208;0.342357;-0.080346;1;0.000000;0.000000;0.000000;0.000000;0.000000
+
+     A,  B, C, Alpha,  Beta, Gamma, Ux, Uy, Uy:
+     17764892.133, 5793679.092, 15733785.198,  179.997,  179.999,452408725.23,  -575727594.04,  -1913661011.01 (affine) 1rst finetness
+*** TODO HklEngine "zone"
+*** TODO HklEngine "custom"
+    for now this pseudoaxis let you select the axis you
+    want to use for the computation.
+*** TODO create a macro to help compare two real the right way
+    fabs(a-b) < epsilon * max(1, abs(a), abs(b))
+*** TODO add an hkl_sample_set_lattice_unit()
+*** TODO SOLEIL SIXS
+**** DONE find the right solutions.				      :zaxis:
+     The cosinus and sinus properties are not enough to find the solution expected by the users.
+     The idea is to use the Ewalds construction to generate a valid solution from the first one
+     obtain numerically. The basic idea is to rotate the hkl vector around the last axis of the
+     sample holder until it intersect again the Ewalds sphere. Then we just need to fit the
+     detector position. This way the solution can be entirely generic (not geometry specific).
+     Nevertheless it is necessary to propose this only for the hkl pseudo axes. I will add this
+     special feature in the Mode. So it will be possible to add thoses special cases easily.
+**** TODO Add the DEP diffractometer geometry
+     This diffractometer is a Newport one based on the kappa 6 circles ones.
+     But instead of a kappa head, they use an Hexapod head.
+     This head can be put horizontally or vertically.
+*** TODO generalisation of the z-axis hkl solver
+    first we need the degenerated member of the Axis. thaht way it could be possible
+    to find the last non degenerated axis for the detector fit.
+*** TODO investigate the prigo geometry.
+*** TODO augeas/elektra for the plugin configure part.
+*** TODO logging
+**** TODO [1/2] add in a few methods.
+     + [X] hkl_pseudo_axes_values_set
+     + [ ] hkl_sample_affine
+**** TODO gir logging
+     It would be nice to generate the library logging using the .gir
+     information. So instead of writing the logging code for each
+     method, it would be better to have a generic method for this
+     purpose.
+**** TODO parsable logging information.
+     A parsable logging format would help to setup some re-play unit
+     test. This way it could help during the developpement process
+     (modification of the hkl internals) to be confident that
+     computation are ok.
+*** TODO performances
+    Investigate [[http://liboil.freedesktop.org/wiki/][liboil]] to speed calculation (in HklVector, HklMatrix
+    and HklQuaternion)
+** documentation
+*** TODO [1/6] rewrite documentation in org-mode
+    - [-] embedding code into the org file
+      - [-] [1/4] python
+	- [X] auto generation of the diffractometer descriptions
+	- [ ] trajectories explanations
+	- [ ] trajectories tests.
+	- [ ] unit tests output ?
+      - [ ] asymptote
+    - [X] need to check if templates could be generated using the hkl
+      python binding for all diffractometer geometries.
+    - [ ] need to add a description for the diffractometer, the mode, the parameters.
+    - [ ] need a nice css for the generated doc.
+    - [ ] check if org-info.js could be usefull
+    - [ ] add documentation explaining the sector-cuts a la hkl
+** [0/3] gui
+   - [ ] change the color of fitparameter cells if they differ from
+     the current sample values
+   - [ ] check if a [[https://github.com/jonathanslenders/python-prompt-toolkit/tree/master/examples/tutorial][REPL]] could be integrated to provide an autocad
+      like interface.
+   - [ ] add tooltips using hkl_parameter_description_get for the
+     pseudo axes and the mode parameters.
+** hkl3d
+*** TODO add a method to find the 3D models in the right directories.
+
+** packaging
+*** TODO add a .spec file for rpm generation.
diff --git a/Documentation/sphinx/Makefile.am b/Documentation/sphinx/Makefile.am
index 5134d4a..49f00b7 100644
--- a/Documentation/sphinx/Makefile.am
+++ b/Documentation/sphinx/Makefile.am
@@ -1,18 +1,31 @@
+TESTS_ENVIRONMENT=env GI_TYPELIB_PATH=$(top_builddir)/hkl $(LIBTOOL) --mode=execute -dlopen $(top_builddir)/hkl/libhkl.la
+TESTS =\
+	source/bindings/python.py \
+	source/pyplots/trajectory_full.py \
+	source/pyplots/trajectory_simple.py
+
 EXTRA_DIST = \
 	source/conf.py.in \
+	source/bindings/bindings.rst \
 	source/development.rst \
 	source/diffractometers/e4cv.rst \
-	source/diffractometers/mars.rst \
-	source/diffractometers/k4cv.rst \
 	source/diffractometers/e6c.rst \
+	source/diffractometers/k4cv.rst \
 	source/diffractometers/k6c.rst \
-	source/diffractometers/zaxis.rst \
+	source/diffractometers/mars.rst \
+	source/diffractometers/med1_2.rst \
 	source/diffractometers/med2_2.rst \
+	source/diffractometers/med2_3.rst \
+	source/diffractometers/petra3.rst \
+	source/diffractometers/soleil_sirius_kappa.rst \
+	source/diffractometers/soleil_sirius_turret.rst \
+	source/diffractometers/zaxis.rst \
 	source/index.rst \
 	source/introduction.rst \
-	source/pseudo.rst
+	source/pseudo.rst \
+	$(TESTS)
 
 -include $(top_srcdir)/sphinx.make
 
 publish: html
-	rsync -avz build/html/ picca at people.debian.org:public_html/hkl
\ No newline at end of file
+	rsync -avz build/html/ picca at people.debian.org:public_html/hkl
diff --git a/Documentation/sphinx/Makefile.in b/Documentation/sphinx/Makefile.in
index 1532c6d..9befdc0 100644
--- a/Documentation/sphinx/Makefile.in
+++ b/Documentation/sphinx/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
@@ -78,7 +78,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = Documentation/sphinx
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/config/test-driver
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
 	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
@@ -110,6 +111,210 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+am__tty_colors = { \
+  $(am__tty_colors_dummy); \
+  if test "X$(AM_COLOR_TESTS)" = Xno; then \
+    am__color_tests=no; \
+  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+    am__color_tests=yes; \
+  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+    am__color_tests=yes; \
+  fi; \
+  if test $$am__color_tests = yes; then \
+    red=''; \
+    grn=''; \
+    lgn=''; \
+    blu=''; \
+    mgn=''; \
+    brg=''; \
+    std=''; \
+  fi; \
+}
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__recheck_rx = ^[ 	]*:recheck:[ 	]*
+am__global_test_result_rx = ^[ 	]*:global-test-result:[ 	]*
+am__copy_in_global_log_rx = ^[ 	]*:copy-in-global-log:[ 	]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+  recheck = 1; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+        { \
+          if ((getline line2 < ($$0 ".log")) < 0) \
+	    recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+        { \
+          recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+        { \
+          break; \
+        } \
+    }; \
+  if (recheck) \
+    print $$0; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+  print "fatal: making $@: " msg | "cat >&2"; \
+  exit 1; \
+} \
+function rst_section(header) \
+{ \
+  print header; \
+  len = length(header); \
+  for (i = 1; i <= len; i = i + 1) \
+    printf "="; \
+  printf "\n\n"; \
+} \
+{ \
+  copy_in_global_log = 1; \
+  global_test_result = "RUN"; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+         fatal("failed to read from " $$0 ".trs"); \
+      if (line ~ /$(am__global_test_result_rx)/) \
+        { \
+          sub("$(am__global_test_result_rx)", "", line); \
+          sub("[ 	]*$$", "", line); \
+          global_test_result = line; \
+        } \
+      else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+        copy_in_global_log = 0; \
+    }; \
+  if (copy_in_global_log) \
+    { \
+      rst_section(global_test_result ": " $$0); \
+      while ((rc = (getline line < ($$0 ".log"))) != 0) \
+      { \
+        if (rc < 0) \
+          fatal("failed to read from " $$0 ".log"); \
+        print line; \
+      }; \
+      printf "\n"; \
+    }; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/   &   /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this.  Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+  --color-tests "$$am__color_tests" \
+  --enable-hard-errors "$$am__enable_hard_errors" \
+  --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test.  Creates the
+# directory for the log if needed.  Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log.  Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT.  Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup);					\
+$(am__vpath_adj_setup) $(am__vpath_adj)			\
+$(am__tty_colors);					\
+srcdir=$(srcdir); export srcdir;			\
+case "$@" in						\
+  */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;;	\
+    *) am__odir=.;; 					\
+esac;							\
+test "x$$am__odir" = x"." || test -d "$$am__odir" 	\
+  || $(MKDIR_P) "$$am__odir" || exit $$?;		\
+if test -f "./$$f"; then dir=./;			\
+elif test -f "$$f"; then dir=;				\
+else dir="$(srcdir)/"; fi;				\
+tst=$$dir$$f; log='$@'; 				\
+if test -n '$(DISABLE_HARD_ERRORS)'; then		\
+  am__enable_hard_errors=no; 				\
+else							\
+  am__enable_hard_errors=yes; 				\
+fi; 							\
+case " $(XFAIL_TESTS) " in				\
+  *[\ \	]$$f[\ \	]* | *[\ \	]$$dir$$f[\ \	]*) \
+    am__expect_failure=yes;;				\
+  *)							\
+    am__expect_failure=no;;				\
+esac; 							\
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed).  The result is saved in the shell variable
+# '$bases'.  This honors runtime overriding of TESTS and TEST_LOGS.  Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+  bases='$(TEST_LOGS)'; \
+  bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+  bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+AM_RECURSIVE_TARGETS = check recheck
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver
+LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
+am__set_b = \
+  case '$@' in \
+    */*) \
+      case '$*' in \
+        */*) b='$*';; \
+          *) b=`echo '$@' | sed 's/\.log$$//'`; \
+       esac;; \
+    *) \
+      b='$*';; \
+  esac
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT at .log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+	$(TEST_LOG_FLAGS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -121,6 +326,8 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BULLET_CFLAGS = @BULLET_CFLAGS@
+BULLET_LIBS = @BULLET_LIBS@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
@@ -140,6 +347,7 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+EMACS = @EMACS@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
 G3D_CFLAGS = @G3D_CFLAGS@
@@ -159,14 +367,15 @@ GSL_CFLAGS = @GSL_CFLAGS@
 GSL_CONFIG = @GSL_CONFIG@
 GSL_LIBS = @GSL_LIBS@
 GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@
 GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
 GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
 GTKDOC_MKPDF = @GTKDOC_MKPDF@
 GTKDOC_REBASE = @GTKDOC_REBASE@
-GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
-GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
-GTKMM_CFLAGS = @GTKMM_CFLAGS@
-GTKMM_LIBS = @GTKMM_LIBS@
+GTKGLEXT_CFLAGS = @GTKGLEXT_CFLAGS@
+GTKGLEXT_LIBS = @GTKGLEXT_LIBS@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
 HTML_DIR = @HTML_DIR@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -262,7 +471,6 @@ localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
-opengl_LIBS = @opengl_LIBS@
 pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
@@ -277,23 +485,37 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 version_info = @version_info@
+TESTS_ENVIRONMENT = env GI_TYPELIB_PATH=$(top_builddir)/hkl $(LIBTOOL) --mode=execute -dlopen $(top_builddir)/hkl/libhkl.la
+TESTS = \
+	source/bindings/python.py \
+	source/pyplots/trajectory_full.py \
+	source/pyplots/trajectory_simple.py
+
 EXTRA_DIST = \
 	source/conf.py.in \
+	source/bindings/bindings.rst \
 	source/development.rst \
 	source/diffractometers/e4cv.rst \
-	source/diffractometers/mars.rst \
-	source/diffractometers/k4cv.rst \
 	source/diffractometers/e6c.rst \
+	source/diffractometers/k4cv.rst \
 	source/diffractometers/k6c.rst \
-	source/diffractometers/zaxis.rst \
+	source/diffractometers/mars.rst \
+	source/diffractometers/med1_2.rst \
 	source/diffractometers/med2_2.rst \
+	source/diffractometers/med2_3.rst \
+	source/diffractometers/petra3.rst \
+	source/diffractometers/soleil_sirius_kappa.rst \
+	source/diffractometers/soleil_sirius_turret.rst \
+	source/diffractometers/zaxis.rst \
 	source/index.rst \
 	source/introduction.rst \
-	source/pseudo.rst
+	source/pseudo.rst \
+	$(TESTS)
 
 all: all-am
 
 .SUFFIXES:
+.SUFFIXES: .log .test .test$(EXEEXT) .trs
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
@@ -337,6 +559,183 @@ ctags CTAGS:
 cscope cscopelist:
 
 
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'.  Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+	rm -f $< $@
+	$(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+	@:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+	@$(am__set_TESTS_bases); \
+	am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+	redo_bases=`for i in $$bases; do \
+	              am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+	            done`; \
+	if test -n "$$redo_bases"; then \
+	  redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+	  redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+	  if $(am__make_dryrun); then :; else \
+	    rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+	  fi; \
+	fi; \
+	if test -n "$$am__remaking_logs"; then \
+	  echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+	       "recursion detected" >&2; \
+	else \
+	  am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+	fi; \
+	if $(am__make_dryrun); then :; else \
+	  st=0;  \
+	  errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+	  for i in $$redo_bases; do \
+	    test -f $$i.trs && test -r $$i.trs \
+	      || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+	    test -f $$i.log && test -r $$i.log \
+	      || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+	  done; \
+	  test $$st -eq 0 || exit 1; \
+	fi
+	@$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+	ws='[ 	]'; \
+	results=`for b in $$bases; do echo $$b.trs; done`; \
+	test -n "$$results" || results=/dev/null; \
+	all=`  grep "^$$ws*:test-result:"           $$results | wc -l`; \
+	pass=` grep "^$$ws*:test-result:$$ws*PASS"  $$results | wc -l`; \
+	fail=` grep "^$$ws*:test-result:$$ws*FAIL"  $$results | wc -l`; \
+	skip=` grep "^$$ws*:test-result:$$ws*SKIP"  $$results | wc -l`; \
+	xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+	xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+	error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+	if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+	  success=true; \
+	else \
+	  success=false; \
+	fi; \
+	br='==================='; br=$$br$$br$$br$$br; \
+	result_count () \
+	{ \
+	    if test x"$$1" = x"--maybe-color"; then \
+	      maybe_colorize=yes; \
+	    elif test x"$$1" = x"--no-color"; then \
+	      maybe_colorize=no; \
+	    else \
+	      echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+	    fi; \
+	    shift; \
+	    desc=$$1 count=$$2; \
+	    if test $$maybe_colorize = yes && test $$count -gt 0; then \
+	      color_start=$$3 color_end=$$std; \
+	    else \
+	      color_start= color_end=; \
+	    fi; \
+	    echo "$${color_start}# $$desc $$count$${color_end}"; \
+	}; \
+	create_testsuite_report () \
+	{ \
+	  result_count $$1 "TOTAL:" $$all   "$$brg"; \
+	  result_count $$1 "PASS: " $$pass  "$$grn"; \
+	  result_count $$1 "SKIP: " $$skip  "$$blu"; \
+	  result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+	  result_count $$1 "FAIL: " $$fail  "$$red"; \
+	  result_count $$1 "XPASS:" $$xpass "$$red"; \
+	  result_count $$1 "ERROR:" $$error "$$mgn"; \
+	}; \
+	{								\
+	  echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" |	\
+	    $(am__rst_title);						\
+	  create_testsuite_report --no-color;				\
+	  echo;								\
+	  echo ".. contents:: :depth: 2";				\
+	  echo;								\
+	  for b in $$bases; do echo $$b; done				\
+	    | $(am__create_global_log);					\
+	} >$(TEST_SUITE_LOG).tmp || exit 1;				\
+	mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG);			\
+	if $$success; then						\
+	  col="$$grn";							\
+	 else								\
+	  col="$$red";							\
+	  test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG);		\
+	fi;								\
+	echo "$${col}$$br$${std}"; 					\
+	echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}";	\
+	echo "$${col}$$br$${std}"; 					\
+	create_testsuite_report --maybe-color;				\
+	echo "$$col$$br$$std";						\
+	if $$success; then :; else					\
+	  echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}";		\
+	  if test -n "$(PACKAGE_BUGREPORT)"; then			\
+	    echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}";	\
+	  fi;								\
+	  echo "$$col$$br$$std";					\
+	fi;								\
+	$$success || exit 1
+
+check-TESTS:
+	@list='$(RECHECK_LOGS)';           test -z "$$list" || rm -f $$list
+	@list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+	@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+	@set +e; $(am__set_TESTS_bases); \
+	log_list=`for i in $$bases; do echo $$i.log; done`; \
+	trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+	log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+	exit $$?;
+recheck: all 
+	@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+	@set +e; $(am__set_TESTS_bases); \
+	bases=`for i in $$bases; do echo $$i; done \
+	         | $(am__list_recheck_tests)` || exit 1; \
+	log_list=`for i in $$bases; do echo $$i.log; done`; \
+	log_list=`echo $$log_list`; \
+	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+	        am__force_recheck=am--force-recheck \
+	        TEST_LOGS="$$log_list"; \
+	exit $$?
+source/bindings/python.py.log: source/bindings/python.py
+	@p='source/bindings/python.py'; \
+	b='source/bindings/python.py'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+source/pyplots/trajectory_full.py.log: source/pyplots/trajectory_full.py
+	@p='source/pyplots/trajectory_full.py'; \
+	b='source/pyplots/trajectory_full.py'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+source/pyplots/trajectory_simple.py.log: source/pyplots/trajectory_simple.py
+	@p='source/pyplots/trajectory_simple.py'; \
+	b='source/pyplots/trajectory_simple.py'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+.test.log:
+	@p='$<'; \
+	$(am__set_b); \
+	$(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+ at am__EXEEXT_TRUE@.test$(EXEEXT).log:
+ at am__EXEEXT_TRUE@	@p='$<'; \
+ at am__EXEEXT_TRUE@	$(am__set_b); \
+ at am__EXEEXT_TRUE@	$(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ at am__EXEEXT_TRUE@	--log-file $$b.log --trs-file $$b.trs \
+ at am__EXEEXT_TRUE@	$(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ at am__EXEEXT_TRUE@	"$$tst" $(AM_TESTS_FD_REDIRECT)
+
 distdir: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -368,6 +767,7 @@ distdir: $(DISTFILES)
 	  fi; \
 	done
 check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
 check: check-am
 all-am: Makefile
 installdirs:
@@ -391,6 +791,9 @@ install-strip:
 	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
 	fi
 mostlyclean-generic:
+	-test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+	-test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+	-test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
 
 clean-generic:
 
@@ -467,19 +870,20 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
-	cscopelist-am ctags-am distclean distclean-generic \
-	distclean-libtool distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags-am uninstall uninstall-am
+.MAKE: check-am install-am install-strip
+
+.PHONY: all all-am check check-TESTS check-am clean clean-generic \
+	clean-libtool cscopelist-am ctags-am distclean \
+	distclean-generic distclean-libtool distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am recheck tags-am \
+	uninstall uninstall-am
 
 
 -include $(top_srcdir)/sphinx.make
diff --git a/Documentation/sphinx/source/bindings/bindings.rst b/Documentation/sphinx/source/bindings/bindings.rst
new file mode 100644
index 0000000..c8ffb15
--- /dev/null
+++ b/Documentation/sphinx/source/bindings/bindings.rst
@@ -0,0 +1,124 @@
+.. _bindings:
+
+Bindings
+########
+
+The hkl library use the gobject-introspection to provide automatic
+binding for a few languages.
+
+Python
+******
+
+hkl computation:
+
+.. literalinclude:: python.py
+
+has you can see there is 4 available solutions.
+
+let's compute an hkl trajectory and select the first solution.
+
+.. plot:: pyplots/trajectory_simple.py
+
+
+if we look at the 3 other solutions we can see that there is a problem
+of continuity at the begining of the trajectory.
+
+.. plot:: pyplots/trajectory_full.py
+
+hey what's happend with theses solutions ! let's look closely to real
+numbers.  the last column is the distance to the diffractometer
+current position. This distance is for now express like this:
+
+.. math::
+   \sum_{axes} \left|\text{current position} - \text{target position}\right|
+
+::
+
+	[0.0, 119.99999999999999, 0.0, -90.0, 0.0, 59.99999999999999] 0.0
+	[0.0, -119.99999999999999, 0.0, -90.0, 0.0, -59.99999999999999] 6.28318530718
+	[0.0, -60.00000000000005, 0.0, 90.0, 0.0, 59.99999999999999] 6.28318530718
+	[0.0, 60.00000000000001, 0.0, 90.0, 0.0, -59.99999999999999] 6.28318530718
+	
+	[0.0, 117.7665607657826, 7.456826294401656, -92.39856410531434, 0.0, 60.33024982425957] 0.216753826612
+	[0.0, -57.436310940366894, -7.456826294401656, 92.39856418853617, 0.0, 60.33024982425957] 6.41621345188
+	[0.0, 62.2334392342174, -7.456826294401656, 92.39856410531434, 0.0, -60.33024982425957] 6.42197739723
+	[0.0, -122.5636890596331, 7.456826294401656, -92.3985641885362, 0.0, -60.33024982425957] 6.50570308205
+	
+	[0.0, 115.89125602137928, 14.781064139466098, -94.7660423112577, 0.0, 61.314597086440706] 0.219062698235
+	[0.0, -125.42334103772737, 14.781064139466098, -94.7660427050904, 0.0, -61.314597086440706] 6.53671995288
+	[0.0, -54.57665896227262, -14.781064139466098, 94.76604270509038, 0.0, 61.314597086440706] 6.67989976726
+	[0.0, 64.10874397862072, -14.781064139466098, 94.7660423112577, 0.0, -61.314597086440706] 6.71437170098
+	
+	[0.0, 114.39338605351007, 21.85448296702796, -97.074145033719, 0.0, 62.93506298693471] 0.218163667981
+	[0.0, -128.54167683157993, 21.85448296702796, -97.07414574435087, 0.0, -62.93506298693471] 6.59846359365
+	[0.0, -51.45832316842005, -21.85448296702796, 97.07414574435087, 0.0, 62.93506298693471] 6.93673746356
+	[0.0, 65.60661394648993, -21.85448296702796, 97.074145033719, 0.0, -62.93506298693471] 7.03385205725
+	
+	[0.0, 113.28316795475283, 28.583837575232764, -99.29953499008337, 0.0, 65.16540747008955] 0.21459359225
+	[0.0, -131.88223933078322, 28.583837575232764, -99.29953638594702, 0.0, -65.16540747008955] 6.69038531388
+	[0.0, -48.11776066921677, -28.583837575232764, 99.29953638594702, 0.0, 65.16540747008955] 7.18296350386
+	[0.0, 66.71683204524717, -28.583837575232764, 99.29953499008337, 0.0, -65.16540747008955] 7.37556986959
+	
+	[0.0, 112.56286877075006, 34.90573305321372, -101.42496979586187, 0.0, 67.97568017857415] 0.209053830457
+	[0.0, -135.4128111996365, 34.90573305321372, -101.42497263302461, 0.0, -67.97568017857415] 6.81174779784
+	[0.0, -44.58718880036348, -34.90573305321372, 101.4249726330246, 0.0, 67.97568017857415] 7.41581162393
+	[0.0, 67.43713122924994, -34.90573305321372, 101.42496979586187, 0.0, -67.97568017857415] 7.7353201851
+	
+	[0.0, 112.2291126083182, 40.78594007247402, -103.43941832567457, 0.0, 71.33706722449408] 0.202280147961
+	[0.0, -139.10795451001587, 40.78594007247402, -103.43942357602316, 0.0, -71.33706722449408] 6.96173845391
+	[0.0, -40.89204548998411, -40.78594007247402, 103.43942357602312, 0.0, 71.33706722449408] 7.63358787543
+	[0.0, 67.7708873916818, -40.78594007247402, 103.43941832567457, 0.0, -71.33706722449408] 8.10986069093
+	
+	[0.0, 112.27578927291766, 46.214916130901734, -105.33741042812996, 0.0, 75.22640762217479] 0.196576175748
+	[0.0, -142.95061850160724, 46.214916130901734, -105.3374188005596, 0.0, -75.22640762217479] 7.13962155618
+	[0.0, -37.04938149839278, -46.214916130901734, 105.33741880055959, 0.0, 75.22640762217479] 7.83557762281
+	[0.0, 67.72421072708234, -46.214916130901734, 105.33741042812996, 0.0, -75.22640762217479] 8.49706672677
+	
+	[0.0, 112.697137434232, 51.201667684695856, -107.11797492933192, 0.0, 79.63023536264535] 0.202327153157
+	[0.0, -146.9330984641471, 51.201667684695856, -107.11798610058318, 0.0, -79.63023536264535] 7.34491897177
+	[0.0, -33.0669015358529, -51.201667684695856, 107.11798610058317, 0.0, 79.63023536264535] 8.02185610877
+	[0.0, 67.30286256576798, -51.201667684695856, 107.11797492933192, 0.0, -79.63023536264535] 8.89597005568
+	
+	[0.0, 113.49085964586432, 55.76762791023837, -108.78347437395287, 0.0, 84.54867879242364] 0.208455586312
+	[0.0, -151.05782007465257, 55.76762791023837, -108.78348605483542, 0.0, -84.54867879242364] 7.57761473366
+	[0.0, -28.942179925347414, -55.76762791023837, 108.78348605483538, 0.0, 84.54867879242364] 8.19307323084
+	[0.0, 66.50914035413568, -55.76762791023837, 108.78347437395287, 0.0, -84.54867879242364] 9.30675279514
+	
+	[0.0, 114.6614608037443, 59.941489465646214, -110.3385360479293, 0.0, 90.00000081324956] 0.215562935229
+	[0.0, -155.33854118146962, 59.941489465646214, -110.33854432979601, 0.0, -89.99999918675044] 7.83839602383
+	[0.0, -24.661458818530395, -59.941489465646214, 110.33854432979601, 0.0, 90.00000081324956] 8.3502621071
+	[0.0, 65.3385391962557, -59.941489465646214, 110.3385360479293, 0.0, -89.99999918675044] 9.7307712883
+	
+
+as you can see for the first point of the trajectory, the 2nd, 3rd and
+4th solutions have identical distances to the current position of the
+diffractometer so they are un-ordered::
+
+	[0.0, 119.99999999999999, 0.0, -90.0, 0.0, 59.99999999999999] 0.0
+	[0.0, -119.99999999999999, 0.0, -90.0, 0.0, -59.99999999999999] 6.28318530718
+	[0.0, -60.00000000000005, 0.0, 90.0, 0.0, 59.99999999999999] 6.28318530718
+	[0.0, 60.00000000000001, 0.0, 90.0, 0.0, -59.99999999999999] 6.28318530718
+
+then the problem arise with the second and third solution. you can see
+a sort of reorganisation of the solution. 2 -> 3, 3 -> 4 and 4 -> 2
+then the order will stick unchanged until the end of the
+trajectory. this is because the distance is computed relatively to the
+current position of the diffractometer.::
+
+	[0.0, 117.7665607657826, 7.456826294401656, -92.39856410531434, 0.0, 60.33024982425957] 0.216753826612
+	[0.0, -57.436310940366894, -7.456826294401656, 92.39856418853617, 0.0, 60.33024982425957] 6.41621345188
+	[0.0, 62.2334392342174, -7.456826294401656, 92.39856410531434, 0.0, -60.33024982425957] 6.42197739723
+	[0.0, -122.5636890596331, 7.456826294401656, -92.3985641885362, 0.0, -60.33024982425957] 6.50570308205
+	
+	[0.0, 115.89125602137928, 14.781064139466098, -94.7660423112577, 0.0, 61.314597086440706] 0.219062698235
+	[0.0, -125.42334103772737, 14.781064139466098, -94.7660427050904, 0.0, -61.314597086440706] 6.53671995288
+	[0.0, -54.57665896227262, -14.781064139466098, 94.76604270509038, 0.0, 61.314597086440706] 6.67989976726
+	[0.0, 64.10874397862072, -14.781064139466098, 94.7660423112577, 0.0, -61.314597086440706] 6.71437170098
+
+
+.. warning::
+
+   when you compute a trajectory, start from a valid position (the
+   starting point must be the real first point of your trajectory)
+   then use only the closest solution for the next points of the
+   trajectory. (first solution of the geometries list)
diff --git a/Documentation/sphinx/source/bindings/python.py b/Documentation/sphinx/source/bindings/python.py
new file mode 100755
index 0000000..fa9f9ee
--- /dev/null
+++ b/Documentation/sphinx/source/bindings/python.py
@@ -0,0 +1,78 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+This file is part of the hkl library.
+
+The hkl library is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+The hkl library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+
+Copyright (C) 2003-2012 Synchrotron SOLEIL
+                        L'Orme des Merisiers Saint-Aubin
+                        BP 48 91192 GIF-sur-YVETTE CEDEX
+Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+"""
+
+import math
+from gi.repository import GLib
+from gi.repository import Hkl
+
+detector = Hkl.Detector.factory_new(Hkl.DetectorType(0))
+
+factory = Hkl.factories()['K6C']
+geometry = factory.create_new_geometry()
+values_w = [0., 30., 0., 0., 0., 60.]
+geometry.axis_values_set(values_w, Hkl.UnitEnum.USER)
+axis_names = geometry.axis_names_get()
+print geometry.name_get(), "diffractometer has", len(axis_names),\
+    "axes : ", axis_names
+print values_w
+
+sample = Hkl.Sample.new("toto")
+lattice = Hkl.Lattice.new(1.54, 1.54, 1.54,
+                          math.radians(90.0),
+                          math.radians(90.0),
+                          math.radians(90.))
+sample.lattice_set(lattice)
+
+# compute all the pseudo axes managed by all engines
+engines = factory.create_new_engine_list()
+engines.init(geometry, detector, sample)
+engines.get()
+
+# get the hkl engine and do a computation
+hkl = engines.engine_get_by_name("hkl")
+values = hkl.pseudo_axis_values_get(Hkl.UnitEnum.USER)
+print "read : ", values
+
+# set the hkl engine and get the results
+for _ in range(100):
+    try:
+        print
+        solutions = hkl.pseudo_axis_values_set(values,
+                                               Hkl.UnitEnum.USER)
+        print hkl.pseudo_axis_values_get(Hkl.UnitEnum.USER)
+
+        print("idx".center(15)),
+        for name in axis_names:
+            print("{}".format(name.center(15))),
+        print
+
+        for i, item in enumerate(solutions.items()):
+            read = item.geometry_get().axis_values_get(Hkl.UnitEnum.USER)
+            print("{}".format(repr(i).center(15))),
+            for value in read:
+                print("{}".format(repr(value)[:15].center(15))),
+            print
+    except GLib.GError, err:
+        print values, err
+    values[1] += .01
diff --git a/Documentation/sphinx/source/development.rst b/Documentation/sphinx/source/development.rst
index 7ecc51c..785f190 100644
--- a/Documentation/sphinx/source/development.rst
+++ b/Documentation/sphinx/source/development.rst
@@ -11,38 +11,51 @@ want the latest development version use `git <http://git.or.cz/>`_ or
 `msysgit <http://code.google.com/p/msysgit/downloads/list>`_ on windows system and
 do::
 
-	$ git clone git://repo.or.cz/hkl.git
+  $ git clone git://repo.or.cz/hkl.git
 
 or::
 
-	$ git clone http://repo.or.cz/r/hkl.git (slower)
+  $ git clone http://repo.or.cz/r/hkl.git (slower)
 
 then checkout the next branch like this::
 
-	$ cd hkl
-	$ git checkout -b next origin/next
+  $ cd hkl
+  $ git checkout -b next origin/next
 
 Building hkl
 ************
 
-To build hkl you need `Python 2.3+ <http://www.python.org>`_ and the
-`GNU Scientific Library 1.12 <http://www.gnu.org/software/gsl/>`_::
+To build hkl you need `Python 2.3+ <http://www.python.org>`_ the
+`GNU Scientific Library 1.12 <http://www.gnu.org/software/gsl/>`_
+and `GLib-2.0 >= 2.3.4 <https://developer.gnome.org/glib/>`_::
 
-     $ ./configure --disable-ghkl
-     $ make
-     $ sudo make install
+  $ ./configure --disable-gui
+  $ make
+  $ sudo make install
+
+you can also build a GUI interfaces which use `gtk <http://www.gtk.org>`_::
+
+  $ ./configure
+  $ make
+  $ sudo make install
 
-you can also build a GUI interfaces which use `gtkmm <http://www.gtkmm.org>`_::
+optionnaly you can build an experimental *libhkl3d* library (no public
+API for now) which is used by the GUI to display and compute
+diffractometer collisions (only the *K6C* model). To build it you need
+also `gtkglext <https://projects.gnome.org/gtkglext/>`_ and
+`bullet 2.82 <http://bulletphysics.org/wordpress/>`_::
 
-    $ ./configure
-    $ make
-    $ sudo make install
+  $ ./configure --enable-hkl3d
+  $ make
+  $ sudo make install
 
-eventually if you want to work also on the documentation you need
+if you want to work on the documentation you need the extra
 
 + `gtk-doc <http://www.gtk.org/gtk-doc/>`_ for the api
 + `sphinx <http://sphinx.pocoo.org/>`_ for the html and latex doc.
-+ `asymptote <http://asymptote.sourceforge.net/>`_ for the figures::
++ `asymptote <http://asymptote.sourceforge.net/>`_ for the figures
+
+::
 
   $ ./configure --enable-gtk-doc
   $ make
@@ -51,423 +64,70 @@ eventually if you want to work also on the documentation you need
 Hacking hkl
 ***********
 
-you can send your patch to `Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>`_ using
-``git``
-
-The developpement process is like this. Suppose you wan to add a new feature to
-hkl create first a new branch from the next one::
-
-    $ git checkout -b my-next next
-
-hack, hack::
-
-     $ git commit -a
-
-more hacks::
-
-     $ git commit -a
-
-now that your new feature is ready for a review, you can send by
-email your work using git format-patch::
-
-     $ git format-patch origin/next
-
-and send generated files `0001_xxx`, `0002_xxx`, ... to the author.
-
-Howto add a diffractometer
-**************************
-
-In this section we will describe all steps requiered to add a new
-diffractometer. We will use the kappa 4 circles exemple.
-
-Adding Geometry
-===============
-
-.. highlight:: c
-   :linenothreshold: 5
-
-The first thing to do is to add the Geometry of this
-diffractometer. You need to edit the `hkl/hkl-geometry-factory.h` file
-
-add a new type ``HKL_GEOMETRY_KAPPA4C_VERTICAL`` into the ``_HklGeometryType`` enum::
-
-    enum _HklGeometryType
-    {
-	...
-	HKL_GEOMETRY_KAPPA4C_VERTICAL
-    }
-
-Now you must describe the diffractometer axes and the way they are
-connected all togethers.  This diffractometer have one sample holder
-and one detecter holder and four axes ("komega", "kappa", "kphi" and
-"tth") So you need to add a new init method for this diffractometer.::
-
-       static void hkl_geometry_init_kappa4C_vertical(HklGeometry *self, double alpha)
-       {
-		HklHolder *h;
-
-		self->name = "K4CV";
-		h = hkl_geometry_add_holder(self);
-		hkl_holder_add_rotation_axis(h, "komega", 0, -1, 0);
-		hkl_holder_add_rotation_axis(h, "kappa", 0, -cos(alpha), -sin(alpha));
-		hkl_holder_add_rotation_axis(h, "kphi", 0, -1, 0);
-
-		h = hkl_geometry_add_holder(self);
-		hkl_holder_add_rotation_axis(h, "tth", 0, -1, 0);
-	}
+Bug reporting
+=============
 
-first we set the diffractometer name by::
+You can find the bug tracker here `libhkl <https://bugs.debian.org/cgi-bin/pkgreport.cgi?repeatmerged=no&src=hkl>`_
 
-      self->name = "K4CV";
+* Debian/Ubuntu::
 
-This name is used in the Tango diffractometer device to refer to this
-diffractometer.
+    $ reportbug hkl
 
-Then you can create the first holder with it's three axes. The order
-of the axis is from the farest to the closest of the sample. In this
-case, komega -> kappa -> kphi::
+* Other OS
 
-      h = hkl_geometry_add_holder(self);
-      hkl_holder_add_rotation_axis(h, "komega", 0, -1, 0);
-      hkl_holder_add_rotation_axis(h, "kappa", 0, -cos(alpha), -sin(alpha));
-      hkl_holder_add_rotation_axis(h, "kphi", 0, -1, 0);
+  You just need to send an email::
 
-Same thing for the other holder holding the detector::
+    To: submit at bugs.debian.org
+    From: xxx at yyy.zzz
+    Subject: My problem with hkl...
+  
+    Package: hkl
+    Version: |version|
 
-     h = hkl_geometry_add_holder(self);
-     hkl_holder_add_rotation_axis(h, "tth", 0, -1, 0);
+    I found this problem in hkl...
 
-now it is almost finish for the geometry part. you just need to add it
-in the factory::
-
-   Hklgeometry *hkl_geometry_factory_new(HklGeometryType type, ...)
-   {
-	...
-	switch(type){
-		...
-		case HKL_GEOMETRY_KAPPA4C_VERTICAL:
-			va_start(ap, type);
-			alpha = va_arg(ap, double);
-			va_end(ap);
-			hkl_geometry_init_kappa4C_vertical(geom, alpha);
-		break;
-	}
-	...
-   }
-
-in this exemple the geometry take one parameter. The fatory can have a
-variable number of parameters you just need to take care of this with
-the va_arg methods.
-
-Adding PseudoAxis mode
-======================
-
-Suppose you want to add a new mode to the hkl pseudo axes. Lets call
-it ``psi constant vertical`` to the eulerian 6 circle geometry.
-
-The starting point is to look in the file ``src/hkl-pseudoaxis-factory.c`` for::
-
-    HklEngineList *hkl_engine_list_factory(HklGeometryType type)
-
-in that method you can see this in the eulerian 6 circle part::
-
-   case HKL_GEOMETRY_EULERIAN6C:
-	hkl_engine_list_add(self, hkl_engine_e6c_hkl_new());
-	hkl_engine_list_add(self, hkl_engine_e6c_psi_new());
-	hkl_engine_list_add(self, hkl_engine_q2_new());
-   break;
-
-so as you can see there is three pseudo axis engine for this
-geometry. Your mode if for the hkl pseudo axis. so let look in the
-``hkl_engine_e6c_hkl_new()`` method.  You can find it
-in the file ``include/hkl/hkl-pseudoaxis-e6c.h`` which contain this::
-
-   #ifndef __HKL_PSEUDOAXIS_E6C_H__
-   #define __HKL_PSEUDOAXIS_E6C_H__
-
-   #include <hkl/hkl-pseudoaxis-auto.h>
-
-   HKL_BEGIN_DECLS
-
-   extern HklEngine *hkl_engine_e6c_hkl_new(void);
-   extern HklEngine *hkl_engine_e6c_psi_new(void);
-
-   HKL_END_DECLS
-
-   #endif /* __HKL_PSEUDOAXIS_E6C_H__ */
-
-strange only 2 methods nothing about
-``hkl_engine_q2_new()``. This is because the
-implementation of this method is common to more than one geometry. So
-you can find it in the file ``hkl/hkl-pseudoaxis-common-q.h``
-
-now you need to change the code of
-``hkl_engine_e6c_hkl_new(void)``. Lets look about it in
-the file ``src/hkl-pseudoaxis-e6c-hkl.c``::
-
-    HklEngine *hkl_engine_e6c_hkl_new(void)
-    {
-	HklEngine *self;
-	HklMode *mode;
-
-	self = hkl_engine_hkl_new();
-
-	/* bissector_vertical */
-	mode = hkl_mode_new(
-		"bissector_vertical",
-		NULL,
-		hkl_mode_get_hkl_real,
-		hkl_engine_setter_func_bissector_vertical,
-		0,
-		4, "omega", "chi", "phi", "delta");
-	hkl_engine_add_mode(self, mode);
-
-	/* constant_omega_vertical */
-	mode = hkl_mode_new(
-		"constant_omega_vertical",
-		NULL,
-		hkl_mode_get_hkl_real,
-		hkl_mode_set_hkl_real,
-		0,
-		3, "chi", "phi", "delta");
-	hkl_engine_add_mode(self, mode);
-
-	/* constant_chi_vertical */
-	mode = hkl_mode_new(
-		"constant_chi_vertical",
-		NULL,
-		hkl_mode_get_hkl_real,
-		hkl_mode_set_hkl_real,
-		0,
-		3, "omega", "phi", "delta");
-	hkl_engine_add_mode(self, mode);
-
-	/* constant_phi_vertical */
-	mode = hkl_mode_new(
-		"constant_phi_vertical",
-		NULL,
-		hkl_mode_get_hkl_real,
-		hkl_mode_set_hkl_real,
-		0,
-		3, "omega", "chi", "delta");
-	hkl_engine_add_mode(self, mode);
-
-	/* lifting_detector_phi */
-	mode = hkl_mode_new(
-		"lifting_detector_phi",
-		NULL,
-		hkl_mode_get_hkl_real,
-		hkl_mode_set_hkl_real,
-		0,
-		3, "phi", "gamma", "delta");
-	hkl_engine_add_mode(self, mode);
-
-	/* lifting_detector_omega */
-	mode = hkl_mode_new(
-		"lifting_detector_omega",
-		NULL,
-		hkl_mode_get_hkl_real,
-		hkl_mode_set_hkl_real,
-		0,
-		3, "omega", "gamma", "delta");
-	hkl_engine_add_mode(self, mode);
-
-	/* lifting_detector_mu */
-	mode = hkl_mode_new(
-		"lifting_detector_mu",
-		NULL,
-		hkl_mode_get_hkl_real,
-		hkl_mode_set_hkl_real,
-		0,
-		3, "mu", "gamma", "delta");
-	hkl_engine_add_mode(self, mode);
-
-	/* double_diffraction vertical*/
-	HklParameter h2;
-	HklParameter k2;
-	HklParameter l2;
-
-	hkl_parameter_init(&h2, "h2", -1, 1, 1,
-			   HKL_TRUE, HKL_TRUE,
-			   NULL, NULL);
-	hkl_parameter_init(&k2, "k2", -1, 1, 1,
-			   HKL_TRUE, HKL_TRUE,
-			   NULL, NULL);
-	hkl_parameter_init(&l2, "l2", -1, 1, 1,
-			   HKL_TRUE, HKL_TRUE,
-			   NULL, NULL);
-
-	mode = hkl_mode_new(
-		"double_diffraction_vertical",
-		NULL,
-		hkl_mode_get_hkl_real,
-		hkl_mode_set_double_diffraction_real,
-		3, &h2, &k2, &l2,
-		4, "omega", "chi", "phi", "delta");
-	hkl_engine_add_mode(self, mode);
-
-	/* bissector_horizontal */
-	mode = hkl_mode_new(
-		"bissector_horizontal",
-		NULL,
-		hkl_mode_get_hkl_real,
-		hkl_engine_setter_func_bissector_horizontal,
-		0,
-		5, "mu", "omega", "chi", "phi", "gamma");
-	hkl_engine_add_mode(self, mode);
-
-	/* double_diffraction_horizontal */
-	mode = hkl_mode_new(
-		"double_diffraction_horizontal",
-		NULL,
-		hkl_mode_get_hkl_real,
-		hkl_mode_set_double_diffraction_real,
-		3, &h2, &k2, &l2,
-		4, "mu", "chi", "phi", "gamma");
-	hkl_engine_add_mode(self, mode);
-
-	hkl_engine_select_mode(self, 0);
-
-	return self;
-    }
-
-so you "just" need to add a new mode like this::
-
-	/* double_diffraction_horizontal */
-	mode = hkl_mode_new(
-		"psi_constant_vertical",
-		NULL,
-		hkl_mode_get_hkl_real,
-		hkl_mode_set_psi_constant_vertical,
-		3, &h2, &k2, &l2,
-		4, "omega", "chi", "phi", "delta");
-	hkl_engine_add_mode(self, mode);
-
-So the first parameter of the hkl_mode_new method
-
-+ name is the name of the mode
-+ then the init functions (usually you need to store the current state of the geometry to be able to use the pseudo axis). Here no need for this init method so we put ``NULL``.
-
-+ then the get method which compute for a given geometry the pseudo axis value. the hkl get method ``hkl_mode_get_hkl_real`` is completely generic and do not depend of the geometry. No need to write it.
-
-+ then the set method which compute a geometry for the given pseudo axis values. Now you need to work a little bit and write the set method.
-
-+ the parameters of your mode
-
-  + first the number of parameters : 3
-  + then each parameters (pointer on the right parameters) for this mode we have 3 parameters h2, k2, l2 which are the coordinates of a sample reference direction use to compute the psi value.
-
-+ the name of axes used by the set method.
-
-  + first the number of axes used by the set method : 4
-  + then all axes names.
-
-In fact the "set" method know nothing about the axes names, so you can
-use a set method with different kind of geometries. The association is
-only done during the mode creation.
-
-At the end you need to add this mode to the pseudo axis engine with
-``hkl_engine_add_mode(self, mode);``
-
-that's all.
-
-Now let see how this "set" method could be written. In our case we
-want to compute the geometry angles for a given h, k, l pseudo axis
-values keeping the angle between the reference reciprocal space vector
-(h2, k2, l2) and the diffraction plane defined by the incomming beam
-and the outgoing beam::
-
-	    static int hkl_mode_set_psi_constant_vertical(HklEngine *engine,
-									     HklGeometry *geometry,
-								             HklDetector *detector,
-								             HklSample *sample)
-	    {
-		hkl_engine_prepare_internal(engine, geometry, detector,
-							sample);
-
-		return hkl_engine_solve_function(engine, psi_constant_vertical);
-	    }
-
-the prepare internal part is about initializing the solver with the
-given geometry, detector and sample. Then comes the
-hkl_engine_solve_function which need the
-psi_constant_vertical function to work. This method use the GSL
-library to find the given function roots (where f(x) = 0).  Lets see
-how it works for the "bissector_horizontal" mode::
-
-    static int bissector_horizontal(const gsl_vector *x, void *params, gsl_vector *f)
-    {
-	double mu, omega, gamma;
-	double const *x_data = gsl_vector_const_ptr(x, 0);
-	double *f_data = gsl_vector_ptr(f, 0);
 
-	RUBh_minus_Q(x_data, params, f_data);
+Providing patchs
+================
 
-	mu = x_data[0];
-	omega = x_data[1];
-	gamma = x_data[4];
+you can send your patch to `Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>`_ using ``git``
 
-	f_data[3] = omega;
-	f_data[4] = gamma - 2 * fmod(mu, M_PI);
+Here a minimalist exemple of the workflow to prepare and send a patch
+for hkl. Suppose you wan to add a new feature to hkl create first a
+new branch from the next one::
 
-	return  GSL_SUCCESS;
-    }
+  $ git checkout -b my-next next
 
-The bissector_horizotal method is used by the setter method of the
-mode to compute the right set of axes angles corresponding to the
-pseudo axes values you want to reach. This method compute the
-difference between these pseudo axes values and the ones computed from
-the axes angles. It can be decompose in three parts:
-
-The first three of these equations are given for the function
-``RUBH_minus_Q``: they are the diference between the h,k,l values that
-want to be set and the h,k,l values computed for a possible
-combination of angles::
-
-	    f_data[0] = h-h(x)
-	    f_data[1] = k-k(x)
-	    f_data[2] = l-l(x)
-
-As the bissector_horizontal mode use 5 axes you need to find 2 other
-equations to be able to solve your mode. The first one is :math:`omega
-= 0`} for an horizontal mode::
-
-  f_data[3] = omega
+hack, hack::
 
-and the last one is for the bissector parameter :math:`gamma=2*mu`::
+  $ git commit -a
 
-    f_data[4] = gamma - 2 * fmod(mu, M_PI)
+more hacks::
 
-One question could be why this complicate ``f4 = gamma - 2 * fmod(mu,
-M_PI)`` equation instead of a simpler ``f4 = gamma - 2 * mu`` ?  this
-is because the bissector_horizontal method is also called by a
-solution multiplicator to gives the user plenty of equivalent
-solutions. This multiplicator do some operations like ``omega = pi -
-omega`` or ``omega = - omega`` on the axes.  Then it check that the
-new angles combination gives also :math:`f(x) = 0`. This is the
-explaination of this more complicate equation.
+  $ git commit -a
 
-So in our case we need to build something like::
+now that your new feature is ready for a review, you can send by
+email your work using git format-patch::
 
-   static int psi_constant_vertical(const gsl_vector *x, void *params, gsl_vector *f)
-   {
-	double mu, omega, gamma;
-	double const *x_data = gsl_vector_const_ptr(x, 0);
-	double *f_data = gsl_vector_ptr(f, 0);
+  $ git format-patch origin/next
 
-	RUBh_minus_Q(x_data, params, f_data);
+and send generated files `0001_xxx`, `0002_xxx`, ... to the author.
 
-	f_data[3] = ???;
+Howto add a diffractometer
+**************************
 
-	return  GSL_SUCCESS;
-    }
+To add a new diffractometer, you just need to copy the
+:file:`hkl/hkl-engine-template.c` into
+:file:`hkl/hkl-engine-INSTITUT-BEAMLINE-INSTRUMENT.c` where you
+replace the upper case with the appropriate values.
 
-The missing part is about the psi computation. ``f3 = psi (target) -
-psi(x)``.  Calculation psi is done in the psi pseudo axis common
-part::
+The template file is compiled during the build process to ensure that
+it is always valid.
 
-	   static int psi(const gsl_vector *x, void *params, gsl_vector *f)
+Then you just need to follow the instruction found in the template.
+If you need some precision about the process, do not hesitate to
+contact the main author.
 
-This psi method is the equivalent of psi_constant_vertical. So you
-need to factorize the psi calculation in between psi_constant_vertical
-and psi.
+do not forgot also to add this new file into :file:`hkl/Makefile.am`
+with other diffractometers in the hkl_c_sources variable (please keep
+the alphabetic order).
diff --git a/Documentation/sphinx/source/diffractometers/med1_2.rst b/Documentation/sphinx/source/diffractometers/med1_2.rst
new file mode 100644
index 0000000..a9df474
--- /dev/null
+++ b/Documentation/sphinx/source/diffractometers/med1_2.rst
@@ -0,0 +1,45 @@
+SOLEIL SIXS MED1+2
+##################
+
+Geometry
+********
+
++ xrays source fix allong the :math:`\vec{x}` direction (1, 0, 0)
++ 2 axes for the sample
+
+  + **pitch** : rotation around the :math:`-\vec{y}` direction (0, -1, 0)
+  + **mu** : rotation around the :math:`\vec{z}` direction (0, 0, 1)
+
++ 3 axis for the detector
+
+  + **pitch** : rotation around the :math:`-\vec{y}` direction (0, -1, 0)
+  + **gamma** : rotation around the :math:`\vec{z}` direction (0, 0, 1)
+  + **delta** : rotation around the :math:`-\vec{y}` direction (0, -1, 0)
+
+PseudoAxes
+**********
+
+hkl
+===
+
+PseudoAxes provided : **h**, **k** and **l**
+
++ mode **pitch_fixed**
+
+  + Axes : **mu**, **gamma**, **delta**
+  + Parameters : No parameter
+
+q2
+==
+
+PseudoAxis provided : **q**, **alpha**
+
+where **q** is :math:`|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}`
+and **alpha** is the azimuth of :math:`\vec{Q}` in the ``yz``
+plan. The origin of this angles is the :math:`\vec{y}` vector, and the
+positive rotation along :math:`\vec{x}`
+
++ mode : **q2**
+
+  + Axes : **"gamma"**, **"delta"**
+  + Parameters : no parameter
diff --git a/Documentation/sphinx/source/diffractometers/med2_3.rst b/Documentation/sphinx/source/diffractometers/med2_3.rst
new file mode 100644
index 0000000..256b5a3
--- /dev/null
+++ b/Documentation/sphinx/source/diffractometers/med2_3.rst
@@ -0,0 +1,64 @@
+SOLEIL SIXS MED2+3
+##################
+
+Geometry
+********
+
++ xrays source fix allong the :math:`\vec{x}` direction (1, 0, 0)
++ 3 axes for the sample
+
+  + **beta** : rotation around the :math:`-\vec{y}` direction (0, -1, 0)
+  + **mu** : rotation around the :math:`\vec{z}` direction (0, 0, 1)
+  + **omega** : rotating around the :math:`-\vec{y}` direction (0, -1, 0)
+
++ 3 axis for the detector
+
+  + **beta** : rotation around the :math:`-\vec{y}` direction (0, -1, 0)
+  + **gamma** : rotation around the :math:`\vec{z}` direction (0, 0, 1)
+  + **delta** : rotation around the :math:`-\vec{y}` direction (0, -1, 0)
+  + **eta_a** : rotation around the :math:`-\vec{x}` direction (-1, 0, 0)
+
+PseudoAxes
+**********
+
+hkl
+===
+
+PseudoAxes provided : **h**, **k** and **l**
+
++ mode **mu_eta_a_fixed**
+
+  + Axes : **omega**, **gamma**, **delta**
+  + Parameters : No parameter
+
++ mode **mu_fixed**
+
+  + Axes : **mu**, **omega**, **gamma**, **eta_a**
+  + Parameters : No parameter
+
+  This mode add the slits constant orientation compare to the surface
+  of the sample, which is along the **omega** axis.
+
+q2
+==
+
+PseudoAxis provided : **q**, **alpha**
+
+where **q** is :math:`|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}`
+and **alpha** is the azimuth of :math:`\vec{Q}` in the ``yz``
+plan. The origin of this angles is the :math:`\vec{y}` vector, and the
+positive rotation along :math:`\vec{x}`
+
++ mode : **q2**
+
+  + Axes : **"gamma"**, **"delta"**
+  + Parameters : no parameter
+
+qper_qpar
+=========
+
+PseudoAxis provided : **qper**, **qpar**
+
+where **qper** and **qpar** are the perpendicular and parallel
+composants of the :math:`|\vec{Q}|` vector. projected respectively to
+the surface vector of the sample.
diff --git a/Documentation/sphinx/source/diffractometers/petra3.rst b/Documentation/sphinx/source/diffractometers/petra3.rst
new file mode 100644
index 0000000..628f54c
--- /dev/null
+++ b/Documentation/sphinx/source/diffractometers/petra3.rst
@@ -0,0 +1,76 @@
+PETRA3 P09 EH2
+##############
+
+Geometry
+********
+
++ xrays source fix allong the :math:`\vec{x}` direction (1, 0, 0)
++ 4 axes for the sample
+
+  + **mu** : rotation around the :math:`-\vec{y}` direction (0, -1, 0)
+  + **omega** : rotation around the :math:`\vec{z}` direction (0, 0, 1)
+  + **chi** : rotating around the :math:`\vec{x}` direction (1, 0, 0)
+  + **phi** : rotating around the :math:`\vec{z}` direction (0, 0, 1)
+
++ 3 axis for the detector
+
+  + **mu** : rotation around the :math:`-\vec{y}` direction (0, -1, 0)
+  + **delta** : rotation around the :math:`\vec{z}` direction (0, 0, 1)
+  + **gamma** : rotation around the :math:`-\vec{y}` direction (0, -1, 0)
+
+PseudoAxes
+**********
+
+hkl
+===
+
+PseudoAxes provided : **h**, **k** and **l**
+
++ mode **zaxis + alpha-fixed**
+
+  + Axes : **"omega"**, **"gamma"**, **"delta"**
+  + Parameters : No parameter
+
++ mode **zaxis + beta-fixed**
+
+  + Axes : **"mu"**, **"omega"**, **"delta"**
+  + Parameters : No parameter
+
++ mode **zaxis + alpha=beta**
+
+  + Axes : **"mu"**, **"omega"**, **"gamma"**, **"delta"**
+  + Parameters : No parameter
+
+  This mode add the ``mu = gamma`` constrain.
+
++ mode **4-circles bissector_horizontal**
+
+  + Axes: **"omega"**, **"chi"**, **"phi"**, **"delta"**
+  + Parameters : No parameter
+
+  This mode add the bissector constrain ``delta = 2 * omega``. In this
+  mode the eulerian **"chi"** circle containt the vector of diffusion
+  :math:`\vec{Q}`. So it is easy to know the orientation of the hkl
+  plan.
+
++ mode **4-circles constant_omega_horizontal**
+
+  + Axes: **"chi"**, **"phi"**, **"delta"**
+  + Parameters : No parameter
+
+  This mode do not move the **"omega"** axis.
+
+
++ mode **4-circles constant_chi_horizontal**
+
+  + Axes: **"omega"**, **"phi"**, **"delta"**
+  + Parameters : No parameter
+
+  This mode do not move the **"chi"** axis.
+
++ mode **4-circles constant_phi_horizontal**
+
+  + Axes: **"omega"**, **"chi"**, **"delta"**
+  + Parameters : No parameter
+
+  This mode do not move the **"phi"** axis.
diff --git a/Documentation/sphinx/source/diffractometers/soleil_sirius_kappa.rst b/Documentation/sphinx/source/diffractometers/soleil_sirius_kappa.rst
new file mode 100644
index 0000000..f3d9b29
--- /dev/null
+++ b/Documentation/sphinx/source/diffractometers/soleil_sirius_kappa.rst
@@ -0,0 +1,179 @@
+SOLEIL SIRIUS KAPPA
+###################
+
+Geometry
+********
+
+For this geometry there is a special parameters called :math:`\alpha` which is the
+angle between the kappa rotation axis and the  :math:`\vec{y}` direction.
+
++ xrays source fix allong the :math:`\vec{x}` direction (1, 0, 0)
++ 4 axes for the sample
+
+  + **mu** : rotating around the :math:`-\vec{z}` direction (0, 0, -1)
+  + **komega** : rotating around the :math:`-\vec{y}` direction (0, -1, 0)
+  + **kappa** : rotating around the :math:`\vec{x}` direction (0, :math:`-\cos\alpha`, :math:`-\sin\alpha`)
+  + **kphi** : rotating around the :math:`-\vec{y}` direction (0, -1, 0)
+
++ 2 axes for the detector
+
+  + **delta** : rotation around the :math:`-\vec{z}` direction (0, 0, -1)
+  + **gamma** : rotation around the :math:`-\vec{y}` direction (0, -1, 0)
+
+PseudoAxes
+**********
+
+eulerians
+=========
+
+PseudoAxes provides : **"omega"**, **"chi"**, **"phi"**
+
++ mode **eulerians**
+
+  + Axes : **komega**, **kappa**, **kphi**
+  + Parameters : **"solution"**
+
+  When you compute the eulerians values from the kappa axes values,
+  there is two possibilities, so the **"solution"** parameter when set
+  0 or 1 allow to switch from one solution to the other.
+
+hkl
+===
+
+PseudoAxes provided : **h**, **k** and **l**
+
++ mode **bissector_vertical**
+
+  + Axes: **komega**, **kappa**, **kphi**, **delta**
+  + Parameters : No parameter
+
+  This mode add the bissector constrain ``tth = 2 * omega``. In this
+  mode the equivalent eulerian **chi** circle containt the vector of
+  diffusion :math:`\vec{Q}`. So it is easy to know the orientation of
+  the hkl plan.
+
++ mode **constant_omega_vertical**
+
+  + Axes: **"komega"**, **"kappa"**, **"kphi"**, **"delta"**
+  + Parameters : **omega**
+
+  This mode do not move the equivalent eulerian **omega** axis.
+
++ mode **constant_chi_vertical**
+
+  + Axes: **"komega"**, **"kappa"**, **"kphi"**, **"delta"**
+  + Parameters : **chi**
+
+  This mode do not move the equivalent eulerian **chi** axis.
+
++ mode **constant_phi_vertical**
+
+  + Axes : **"komega"**, **"kappa"**, **"kphi"**, **"delta"**
+  + Parameters : **phi**
+
+  This mode do not move the equivalent eulerian **phi** axis.
+
++ mode : **lifting_detector_kphi**
+
+  + Axes : **"kphi"**, **"gamma"**, **"delta"**
+  + Parameters : No Parameters
+
++ mode : **lifting_detector_mu**
+
+  + Axes : **"mu"**, **"gamma"**, **"delta"**
+  + Parameters : No Parameters
+
++ mode : **double_diffraction vertical**
+
+  + Axes : **"komega"**, **"kappa"**, **"kphi"**, **"delta"**
+  + Parameters : **h2**, **k2**, **l2**
+
+  This mode put a second hkl vector (**h2**, **k2**, **l2**) in
+  Bragg condition.  This is usefull sometimes when you want to explore
+  two bragg peaks without moving your sample.
+
++ mode : **bissector_horizontal**
+
+  + Axes : **"mu"**, **"komega"**, **"kappa"**, **"kphi"**, **"gamma"**
+  + Parameters : No parameters
+
++ mode : **constant_phi_horizontal**
+
+  + Axes : **"mu"**, **"komega"**, **"kappa"**, **"kphi"**, **"gamma"**
+  + Parameters : **phi**
+
++ mode : **horizontal kphi constant**
+
+  + Axes :  **"mu"**, **"komega"**, **"kappa"**, **"gamma"**
+  + Parameters : no parameters
+
++ mode : **double_diffraction_horizontal**
+
+  + Axes : **"mu"**, **"komega"**, **"kappa"**, **kphi**, **"gamma"**
+  + Parameters : **h2**, **k2**, **l2**
+
+  This mode put a second hkl vector (**h2**, **k2**, **l2**) in
+  Bragg condition.  This is usefull sometimes when you want to explore
+  two bragg peaks without moving your sample.
+
++ mode : **psi_constant_vertical**
+
+  + Axes : **"komega"**, **"kappa"**, **kphi**, **"delta"**
+  + Parameters : **h2**, **k2**, **l2**, **psi**
+
+  This mode allow to fix the value of the pseudo axis **psi** at a
+  constant value when you move around an **h**, **k** , **l**
+  position. The (**h2**, **k2**, **l2**) vector is used as a reference
+  for the computation of the **psi** pseudo axis value.
+
+  You can retrive and ``freeze`` the current value of the **psi**
+  pseudo axis value into the **psi** parameter when you initialize the
+  mode. But you can also write directly the value of the desired
+  **psi** parameter.
+
++ mode : **constant_incidence**
+
+  + Axes : **"komega"**, **"kappa"**, **kphi**, **"gamma"**, **"delta"**
+  + Parameters : **x**, **y**, **z**, **incidence**, **azimuth**
+
+  This mode allow to work with a constant incidence of the incoming
+  beam onto the sample surface.
+  To use this mode you need to follow a few steps:
+
+    + align your surface along a direction :math:`\vec{n}` (**x**,
+      **y**, **z**) in the laboratory space, with your diffractometer.
+    + initialize the mode, so it can remember the current diffractometer
+      position for futur computation.
+    + set the desired **incidence**
+    + set the desired **azimuth** of the normal of the surface in the
+      YOZ plane (azimuth = 0 -> :math:`\vec{n}` along :math:`\vec{y}`)
+
+  Now it is possible to do an HKL computation.
+
+psi
+===
+
+PseudoAxis provided : **psi**
+
++ mode **psi_vertical**
+
+  + Axes : **komega**, **kappa**, **kphi**, **delta**
+  + Parameters : **h1**, **k1**, **l1**
+
+  The (**h1**, **k1**, **l1**) vector is used as a reference for the
+  computation of the **psi** pseudo axis value.
+
+q2
+==
+
+PseudoAxis provided : **q**, **alpha**
+
+where **q** is :math:`|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}`
+and **alpha** is the azimuth of :math:`\vec{Q}` in the ``yz``
+plan. The origin of this angles is the :math:`\vec{y}` vector, and the
+positive rotation along :math:`\vec{x}`
+
++ mode : **q2**
+
+  + Axes : **"gamma"**, **"delta"**
+  + Parameters : no parameter
diff --git a/Documentation/sphinx/source/diffractometers/soleil_sirius_turret.rst b/Documentation/sphinx/source/diffractometers/soleil_sirius_turret.rst
new file mode 100644
index 0000000..8b50c4e
--- /dev/null
+++ b/Documentation/sphinx/source/diffractometers/soleil_sirius_turret.rst
@@ -0,0 +1,61 @@
+SOLEIL SIRIUS TURRET
+####################
+
+Geometry
+********
+
++ xrays source fix allong the :math:`\vec{x}` direction (1, 0, 0)
++ 3 axes for the sample
+
+  + **thetah** : rotating around the :math:`-\vec{z}` direction (0, 0, -1)
+  + **alphay** : rotating around the :math:`\vec{y}` direction (0, 1, 0)
+  + **alphax** : rotating around the :math:`\vec{x}` direction (1, 0, 0)
+
++ 2 axes for the detector
+
+  + **delta** : rotation around the :math:`-\vec{z}` direction (0, 0, -1)
+  + **gamma** : rotation around the :math:`-\vec{y}` direction (0, -1, 0)
+
+PseudoAxes
+**********
+
+hkl
+===
+
+PseudoAxes provided : **h**, **k** and **l**
+
++ mode : **lifting_detector_thetah**
+
+  + Axes : **"thetah"**, **"delta"**, **"gamma"**
+  + Parameters : No Parameters
+
+q2
+==
+
+PseudoAxis provided : **q**, **alpha**
+
+where **q** is :math:`|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}`
+and **alpha** is the azimuth of :math:`\vec{Q}` in the ``yz``
+plan. The origin of this angles is the :math:`\vec{y}` vector, and the
+positive rotation along :math:`\vec{x}`
+
++ mode : **q2**
+
+  + Axes : **"gamma"**, **"delta"**
+  + Parameters : no parameter
+
+qper_qpar
+=========
+
+PseudoAxis provided : **qper**, **qpar**
+
+where **qper** and **qpar** are the perpendicular and parallel
+composants of the :math:`|\vec{Q}|` vector projected respectively to
+the surface vector :math:`\vec{n}` of coordinates :math:`x`,
+:math:`y`, :math:`z` of the sample expressed in the sample
+referential. The default value for :math:`n` is (0, 1, 0)
+
++ mode : **qper_qpar**
+
+  + Axes : **"delta"**, **"gamma"**
+  + Parameters : **"x"**, **"y"**, **"z"**
diff --git a/Documentation/sphinx/source/index.rst b/Documentation/sphinx/source/index.rst
index 3fd221f..f87c423 100644
--- a/Documentation/sphinx/source/index.rst
+++ b/Documentation/sphinx/source/index.rst
@@ -24,6 +24,8 @@ Contents:
    diffractometers/med2_3
    diffractometers/mars
    diffractometers/petra3
+   diffractometers/soleil_sirius_turret
+   diffractometers/soleil_sirius_kappa
    pseudo
    bindings/bindings
    development
diff --git a/Documentation/sphinx/source/pyplots/trajectory_full.py b/Documentation/sphinx/source/pyplots/trajectory_full.py
new file mode 100755
index 0000000..b8827a4
--- /dev/null
+++ b/Documentation/sphinx/source/pyplots/trajectory_full.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import math
+import numpy
+
+import matplotlib.pyplot as plt
+
+from gi.repository import GLib
+from gi.repository import Hkl
+
+sample = Hkl.Sample.new("toto")
+lattice = Hkl.Lattice.new(1.54, 1.54, 1.54,
+                          math.radians(90.0),
+                          math.radians(90.0),
+                          math.radians(90.))
+sample.lattice_set(lattice)
+
+detector = Hkl.Detector.factory_new(Hkl.DetectorType(0))
+
+factory = Hkl.factories()['K6C']
+geometry = factory.create_new_geometry()
+axis_names = geometry.axis_names_get()
+geometry.axis_values_set([0., 120, 0., -90., 0., 60.],
+                         Hkl.UnitEnum.USER)
+
+engines = factory.create_new_engine_list()
+engines.init(geometry, detector, sample)
+
+n = 10
+h = numpy.linspace(0, 0, n + 1)
+k = numpy.linspace(0, 1, n + 1)
+l = numpy.linspace(1, 1, n + 1)
+
+# get the hkl engine
+hkl = engines.engine_get_by_name("hkl")
+
+# set the hkl engine and get the results
+trajectories = []
+for hh, kk, ll in zip(h, k, l):
+    try:
+        solutions = hkl.pseudo_axis_values_set([hh, kk, ll],
+                                               Hkl.UnitEnum.USER)
+        first_solution = solutions.items()[0]
+        for i, item in enumerate(solutions.items()):
+            try:
+                trajectories[i]
+            except IndexError:
+                trajectories.append([])
+            values = item.geometry_get().axis_values_get(Hkl.UnitEnum.USER)
+            # print values, item.geometry.distance(geometry)
+            trajectories[i].append(values)
+        engines.select_solution(first_solution)
+        # print
+    except GLib.GError, err:
+        pass
+
+for i, (trajectory, title) in enumerate(zip(trajectories[1:],
+                                            ["2nd", "3rd", "4th"])):
+    ax = plt.subplot(1, 3, i + 1)
+    plt.title(title)
+    plt.plot(trajectory, 'o-')
+    plt.ylim(-180, 180)
+    if i != 0:
+        for tl in ax.get_yticklabels():
+            tl.set_visible(False)
diff --git a/Documentation/sphinx/source/pyplots/trajectory_simple.py b/Documentation/sphinx/source/pyplots/trajectory_simple.py
new file mode 100755
index 0000000..21e1e2d
--- /dev/null
+++ b/Documentation/sphinx/source/pyplots/trajectory_simple.py
@@ -0,0 +1,79 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import math
+import numpy
+
+import matplotlib.pyplot as plt
+
+from gi.repository import GLib
+from gi.repository import Hkl
+
+
+sample = Hkl.Sample.new("toto")
+lattice = Hkl.Lattice.new(1.54, 1.54, 1.54,
+                          math.radians(90),
+                          math.radians(90),
+                          math.radians(90))
+sample.lattice_set(lattice)
+
+detector = Hkl.Detector.factory_new(Hkl.DetectorType(0))
+
+factory = Hkl.factories()['K6C']
+geometry = factory.create_new_geometry()
+axis_names = geometry.axis_names_get()
+
+# set the initial position
+geometry.axis_values_set([0, 120, 0, -90, 0, 60], Hkl.UnitEnum.USER)
+
+# get all engines for a given configuration
+engines = factory.create_new_engine_list()
+
+# prepare the engines to work with the related geometry, detector and
+# sample
+engines.init(geometry, detector, sample)
+
+#[0, 0, 1] -> [0, 1, 1]
+n = 10
+h = numpy.linspace(0, 0, n + 1)
+k = numpy.linspace(0, 1, n + 1)
+l = numpy.linspace(1, 1, n + 1)
+
+# get the hkl engine
+hkl = engines.engine_get_by_name("hkl")
+pseudo_axis_names = ["h", "k", "l"]
+
+# compute the trajectory
+motors_positions = []
+for idx, hh, kk, ll in zip(range(n), h, k, l):
+    try:
+        solutions = hkl.pseudo_axis_values_set([hh, kk, ll],
+                                               Hkl.UnitEnum.USER)
+        first_solution = solutions.items()[0]
+        # if no exception raised we have at least one solution
+        # move the diffractometer to the solution
+        engines.select_solution(first_solution)
+        motors_positions.append(geometry.axis_values_get(Hkl.UnitEnum.USER))
+    except GLib.GError, err:
+        pass
+
+plt.subplot(1, 2, 1)
+plt.title("motors trajectory (1st solution)")
+# reorder the motors_positions for the plot
+motors_positions = numpy.array(motors_positions).T
+for y, name in zip(motors_positions, axis_names):
+    plt.plot(y, 'o-', label=name)
+plt.legend(loc=2)
+plt.ylim(-180, 180)
+plt.xlabel("trajectory point index")
+plt.ylabel("motor position (Degree)")
+
+plt.subplot(1, 2, 2)
+plt.title("hkl trajectory")
+hkl_positions = numpy.array([h, k, l])
+for y, name in zip(hkl_positions, pseudo_axis_names):
+    plt.plot(y, 'o-', label=name)
+plt.legend(loc=2)
+plt.ylim(-0.1, 1.1)
+plt.xlabel("trajectory point index")
+plt.ylabel("pseudo motor position")
diff --git a/INSTALL b/INSTALL
index 007e939..2099840 100644
--- a/INSTALL
+++ b/INSTALL
@@ -12,8 +12,8 @@ without warranty of any kind.
 Basic Installation
 ==================
 
-   Briefly, the shell commands `./configure; make; make install' should
-configure, build, and install this package.  The following
+   Briefly, the shell command `./configure && make && make install'
+should configure, build, and install this package.  The following
 more-detailed instructions are generic; see the `README' file for
 instructions specific to this package.  Some packages provide this
 `INSTALL' file but do not implement all of the features documented
diff --git a/Makefile.am b/Makefile.am
index c1b33f5..2898481 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 
 ACLOCAL_AMFLAGS = -I m4
-AM_DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-introspection
+AM_DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-introspection --enable-hkl3d
 
 SUBDIRS = hkl
 if HKL3D
@@ -10,7 +10,10 @@ endif
 if GUI
 SUBDIRS += gui
 endif
-SUBDIRS += tests Documentation
+if HKL_DOC
+SUBDIRS += Documentation
+endif
+SUBDIRS += tests
 
 EXTRA_DIST = hkl.pc.in hkl3d.pc.in
 
@@ -21,7 +24,8 @@ pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = hkl.pc
 
 if HKL3D
-pkgconfig_DATA += hkl3d.pc
+#for not do not install
+noinst_DATA = hkl3d.pc
 endif
 
 ## lcov part
diff --git a/Makefile.in b/Makefile.in
index 6229bf5..7c2c268 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
@@ -80,7 +80,7 @@ build_triplet = @build@
 host_triplet = @host@
 @HKL3D_TRUE at am__append_1 = hkl3d data
 @GUI_TRUE at am__append_2 = gui
- at HKL3D_TRUE@am__append_3 = hkl3d.pc
+ at HKL_DOC_TRUE@am__append_3 = Documentation
 subdir = .
 DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
 	$(srcdir)/Makefile.in $(srcdir)/Makefile.am \
@@ -88,10 +88,11 @@ DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
 	$(srcdir)/config.h.in $(srcdir)/hkl.pc.in \
 	$(srcdir)/hkl3d.pc.in \
 	$(top_srcdir)/Documentation/sphinx/source/conf.py.in \
-	$(dist_installed_mainheader_DATA) COPYING TODO \
-	config/config.guess config/config.sub config/install-sh \
-	config/missing config/ltmain.sh \
-	$(top_srcdir)/config/config.guess \
+	$(dist_installed_mainheader_DATA) COPYING config/compile \
+	config/config.guess config/config.sub config/depcomp \
+	config/install-sh config/mdate-sh config/missing \
+	config/texinfo.tex config/ltmain.sh \
+	$(top_srcdir)/config/compile $(top_srcdir)/config/config.guess \
 	$(top_srcdir)/config/config.sub \
 	$(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
 	$(top_srcdir)/config/missing
@@ -165,7 +166,8 @@ am__uninstall_files_from_dir = { \
   }
 am__installdirs = "$(DESTDIR)$(installed_mainheaderdir)" \
 	"$(DESTDIR)$(pkgconfigdir)"
-DATA = $(dist_installed_mainheader_DATA) $(pkgconfig_DATA)
+DATA = $(dist_installed_mainheader_DATA) $(noinst_DATA) \
+	$(pkgconfig_DATA)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
 am__recursive_targets = \
@@ -195,7 +197,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 CSCOPE = cscope
-DIST_SUBDIRS = hkl hkl3d data gui tests Documentation
+DIST_SUBDIRS = hkl hkl3d data gui Documentation tests
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
@@ -248,6 +250,8 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BULLET_CFLAGS = @BULLET_CFLAGS@
+BULLET_LIBS = @BULLET_LIBS@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
@@ -267,6 +271,7 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+EMACS = @EMACS@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
 G3D_CFLAGS = @G3D_CFLAGS@
@@ -286,14 +291,15 @@ GSL_CFLAGS = @GSL_CFLAGS@
 GSL_CONFIG = @GSL_CONFIG@
 GSL_LIBS = @GSL_LIBS@
 GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@
 GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
 GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
 GTKDOC_MKPDF = @GTKDOC_MKPDF@
 GTKDOC_REBASE = @GTKDOC_REBASE@
-GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
-GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
-GTKMM_CFLAGS = @GTKMM_CFLAGS@
-GTKMM_LIBS = @GTKMM_LIBS@
+GTKGLEXT_CFLAGS = @GTKGLEXT_CFLAGS@
+GTKGLEXT_LIBS = @GTKGLEXT_LIBS@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
 HTML_DIR = @HTML_DIR@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -389,7 +395,6 @@ localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
-opengl_LIBS = @opengl_LIBS@
 pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
@@ -405,13 +410,16 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 version_info = @version_info@
 ACLOCAL_AMFLAGS = -I m4
-AM_DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-introspection
-SUBDIRS = hkl $(am__append_1) $(am__append_2) tests Documentation
+AM_DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-introspection --enable-hkl3d
+SUBDIRS = hkl $(am__append_1) $(am__append_2) $(am__append_3) tests
 EXTRA_DIST = hkl.pc.in hkl3d.pc.in
 installed_mainheaderdir = $(includedir)/hkl- at VMAJ@
 dist_installed_mainheader_DATA = hkl.h
 pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = hkl.pc $(am__append_3)
+pkgconfig_DATA = hkl.pc
+
+#for not do not install
+ at HKL3D_TRUE@noinst_DATA = hkl3d.pc
 CCAN_PUBLIC_MODULES = darray
 CCAN_PRIVATE_MODULES = array_size container_of autodata list
 CCAN_LOCAL_REPO = /tmp/ccan
@@ -460,8 +468,8 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 
 config.h: stamp-h1
-	@if test ! -f $@; then rm -f stamp-h1; else :; fi
-	@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
+	@test -f $@ || rm -f stamp-h1
+	@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
 
 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
 	@rm -f stamp-h1
@@ -721,10 +729,16 @@ dist-xz: distdir
 	$(am__post_remove_distdir)
 
 dist-tarZ: distdir
+	@echo WARNING: "Support for shar distribution archives is" \
+	               "deprecated." >&2
+	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
 	$(am__post_remove_distdir)
 
 dist-shar: distdir
+	@echo WARNING: "Support for distribution archives compressed with" \
+		       "legacy program 'compress' is deprecated." >&2
+	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
 	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
 	$(am__post_remove_distdir)
 
@@ -766,9 +780,10 @@ distcheck: dist
 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
 	  && am__cwd=`pwd` \
 	  && $(am__cd) $(distdir)/_build \
-	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	  && ../configure \
 	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
+	    --srcdir=.. --prefix="$$dc_install_base" \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
 	  && $(MAKE) $(AM_MAKEFLAGS) check \
diff --git a/NEWS b/NEWS
index 0e77ccd..e5d5d40 100644
--- a/NEWS
+++ b/NEWS
@@ -1,19 +1,42 @@
-5.0.0	UNRELEASED
-	* general:
-	  - use the c-tap-hardness library for the test suite.
-	  - add the hkl3d library (anti-collision)
-	  - add a 3D view to ghkl
-	    - add the diffabs (SOLEIL) 3D model.
-	  - add a --disable-hkl3d flag to avoid hkl3d library compilation.
-	  - replace the --enable-ghkl with a --disable-gui
-	  - use the gobject-instrospection to provide bindings.
-	    - python binding (tested)
-	    - all other languages (not tested)
-	* new diffractometers
-	  - E4CH (eulerian 4 circles horizontal) geometry.
-	  - MARS beamline (SOLEIL) eulerian 4 circles vertical geometry.
+# -*- org -*-
 
-4.0.4	UNRELEASED
+* 5.0.0	UNRELEASED
+** General
+   - 5.x runtime can be co-installed with the 4.x series.
+   - hkl.h contain all the Public API.
+   - A clear separation between the public and private API was
+     achieved, in order to propose a Long Time Support of the
+     5.x series.
+   - c-tap-hardness library was embeded to provide the unit test
+     framework.
+   - gobject-instrospection provide the binding support. Look at this
+     [[https://wiki.gnome.org/action/show/Projects/GObjectIntrospection][page]] for more informations.
+   - Documentation was generated with sphinx and asymptote for the figures.
+   - New diffractometers added
+     - E4CH (eulerian 4 circles horizontal) geometry.
+     - MARS beamline (SOLEIL) eulerian 4 circles vertical geometry.
+     - SOLEIL SIRIUS KAPPA
+     - SOLEIL SIRIUS TURRET
+   - New Pseudo Axes engines.
+     - qper_qpar
+   - A not yet public hkl3d library used only by the gui allow to
+     compute (Bullet) and display (OpenGL) collision for model
+     described using the COLLADA file format.
+** Buildsystem
+   - add a --disable-hkl3d flag to avoid hkl3d library compilation.
+   - replace the --enable-ghkl with a --disable-gui.
+   - use ./configure --help for all the options
+** Gui
+   - Rewriten using Gtk instead of Gtkmm, in order to minimise the
+     required dependencies.
+   - Added a 3D view to display diffractometers and collisions.
+   - Added the K6C 3D model.
+** Bindings
+   - Provide the garantie via unit tests that the python API will be
+     stable during all the 5.x lifetime.
+   - For other languages look at [[https://wiki.gnome.org/Projects/GObjectIntrospection/][here]].
+
+* 4.0.4	UNRELEASED
 	* add the SOLEIL SIXS MED2+2 diffractometer
 	  - engine: hkl
 	    - mode: reflectivity.
@@ -31,22 +54,22 @@
 	  - engine: qper_qpar
 	* add the sphinx documentation
 
-4.0.3	06-06-2010
+* 4.0.3	06-06-2010
 	* remove the usage.c file to avoid a GPL2-GPL3+ incompatibility
 	* update the documentation
 	* fix warning catched by clang
 
-4.0.2	01-06-2010
+* 4.0.2	01-06-2010
 	* add the ghkl manpage and .desktop file
 	* fix the ghkl quit menuitem bugs
 
-4.0.1	10-05-2010
+* 4.0.1	10-05-2010
 	* fix a few ghkl bugs (.ui files installation)
 	* add a --enable-ghkl=[yes,no] flag to allow compiling the gui interface
 	* do not forgot to link ghkl against gsl.
 	* display by default the preference panel of ghkl.
 
-4.0.0	14-04-2010
+* 4.0.0	14-04-2010
 
 	* add the autotools buildsystem and remove all other systems.
 	* add a GUI ghkl for testing purpose based on gtkmm.
@@ -55,20 +78,20 @@
 	* new structure for the HklDetector (prepare for 2D detectors)
 	* HklGeometryConfig shared between all equivalent HklGeometries.
 	* fix for 64 bits computers runtime error.
-	* add the HklError class to report calculation errors (not yet used)
+	* add the GError class to report calculation errors (not yet used)
 	* new way to set the UB matrix of a sample (hkl_sample_set_UB).
 	* new ZAxis geometry
 		- mode zaxis
 		- mode reflectivity (mu = gamma)
 
-3.0.1	23-10-2009
+* 3.0.1	23-10-2009
 
 	* add the psi_constant mode to the e4cv, e6c, k4cv and k6c geometries. (thanks teresa)
 	* upgrade the user guide to explain how to add a mode.
 	* the horizontal modes are also valid if omega = +-PI. (e6c, k6c)
 	* remove geometries with an invalid range from the list of solutions.
 
-3.0.0	15-07-2009
+* 3.0.0	15-07-2009
 
 	* Rewrote from scratch in C with the GSL library.
 		- now most of pseudo axes modes are numeric.
@@ -122,7 +145,7 @@
 		- PseudoAxisEngien "eulerians": "omega", "chi", "phi"
 			* mode "eulerians"
 
-2.3.0   24-01-2007
+* 2.3.0 24-01-2007
 
     * Refactoring of the sample part.
       - It is now possible to create different kind of samples easily.
@@ -160,8 +183,7 @@
       - Derived Mode can be created from an already existing Mode if the Geometry conversion exist.
       - all Eulerian 4 Circles on the kappa4C, Eulerian6c and Kappa6C diffractometers.
 
-
-2.2.0   19-06-2006
+* 2.2.0 19-06-2006
     
     * Diffractometers:
       - twoC Vertical.
diff --git a/TODO b/TODO
deleted file mode 100644
index cee2cdc..0000000
--- a/TODO
+++ /dev/null
@@ -1,45 +0,0 @@
-Roadmap
--------
-
-* 5.0.0 UNRELEASE
-** TODO [hkl] HklEngine "q" -> "qper" and "qpar"
-** TODO [hkl] HklAxis degenerated.
-   an axis is degenerated if its position have no effect
-   on the HklPseudoAxis calculus. Add a degenerated member to the axis.
-   that way it would be possible to check a posteriori for this degenerescencence.
-** TODO [hkl] HklAxis method to use min/max to check for the validity
-** TODO [hkl] HklGeometryList different method to help select a solution.
-   this select solution can depend on the geometry
-   for example the kappa axis must be in one side of the plane.
-** TODO [hkl] add a fit on the Hklaxis offsets.
-** TODO [hkl] API to put a detector and a sample on the Geometry.
-** TODO [hkl] HklSample add the cell volum computation.
-** TODO [hkl] HklEngine "zone"
-** TODO [hkl] HklEngine "custom"
-		for now this pseudoaxis let you select the axis you
-		want to use for the computation.
-** TODO [hkl] create a macro to help compare two real the right way
-   fabs(a-b) < epsilon * max(1, abs(a), abs(b))
-** TODO [hkl] add an hkl_sample_set_lattice_unit()
-** TODO [hkl] use the liboil to speed calculation (in HklVector, HklMatrix and HklQuaternion)
-** TODO [hkl] SOLEIL SIXS
-*** DONE find the right solutions. 				      :zaxis:
-    The cosinus and sinus properties are not enough to find the solution expected by the users.
-    The idea is to use the Ewalds construction to generate a valid solution from the first one
-    obtain numerically. The basic idea is to rotate the hkl vector around the last axis of the
-    sample holder until it intersect again the Ewalds sphere. Then we just need to fit the
-    detector position. This way the solution can be entirely generic (not geometry specific).
-    Nevertheless it is necessary to propose this only for the hkl pseudo axes. I will add this
-    special feature in the Mode. So it will be possible to add thoses special cases easily.
-*** TODO Add the DEP diffractometer geometry
-    This diffractometer is a Newport one based on the kappa 6 circles ones.
-    But instead of a kappa head, they use an Hexapod head.
-    This head can be put horizontally or vertically.
-** TODO [hkl] generalisation of the z-axis hkl solver
-   first we need the degenerated member of the Axis. thaht way it could be possible
-   to find the last non degenerated axis for the detector fit.
-** TODO [hkl] investigate the prigo geometry.
-** TODO [ghkl] change the color of fitparameter cells if they differ from the current
-	  sample values
-** TODO [hkl3d] add a method to find the 3D models in the right directories.
-** TODO [packaging] add a .spec file for rpm generation.
diff --git a/aclocal.m4 b/aclocal.m4
index 079d0d4..56431f7 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.13.3 -*- Autoconf -*-
+# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
 
 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
 
@@ -115,13 +115,10 @@ int
 main ()
 {
   unsigned int major, minor, micro;
-  char *tmp_version;
 
   fclose (fopen ("conf.glibtest", "w"));
 
-  /* HP/UX 9 (%@#!) writes to sscanf strings */
-  tmp_version = g_strdup("$min_glib_version");
-  if (sscanf(tmp_version, "%u.%u.%u", &major, &minor, &micro) != 3) {
+  if (sscanf("$min_glib_version", "%u.%u.%u", &major, &minor, &micro) != 3) {
      printf("%s, bad version string\n", "$min_glib_version");
      exit(1);
    }
@@ -655,6 +652,61 @@ else
 fi[]dnl
 ])# PKG_CHECK_MODULES
 
+
+# PKG_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable pkgconfigdir as the location where a module
+# should install pkg-config .pc files. By default the directory is
+# $libdir/pkgconfig, but the default can be changed by passing
+# DIRECTORY. The user can override through the --with-pkgconfigdir
+# parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+    [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_INSTALLDIR
+
+
+# PKG_NOARCH_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable noarch_pkgconfigdir as the location where a
+# module should install arch-independent pkg-config .pc files. By
+# default the directory is $datadir/pkgconfig, but the default can be
+# changed by passing DIRECTORY. The user can override through the
+# --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+    [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_NOARCH_INSTALLDIR
+
+
+# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------
+# Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])# PKG_CHECK_VAR
+
 # Copyright (C) 2002-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
@@ -667,10 +719,10 @@ fi[]dnl
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.13'
+[am__api_version='1.14'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.13.3], [],
+m4_if([$1], [1.14.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -686,7 +738,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.13.3])dnl
+[AM_AUTOMAKE_VERSION([1.14.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
@@ -738,10 +790,9 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 # configured tree to be moved without reconfiguration.
 
 AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
 ])
 
 # AM_COND_IF                                            -*- Autoconf -*-
@@ -1090,6 +1141,12 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
 
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
 # AM_INIT_AUTOMAKE([OPTIONS])
 # -----------------------------------------------
@@ -1198,6 +1255,48 @@ dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
 AC_CONFIG_COMMANDS_PRE(dnl
 [m4_provide_if([_AM_COMPILER_EXEEXT],
   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake at gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+  fi
+fi
 ])
 
 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
@@ -1206,7 +1305,6 @@ dnl mangled by Autoconf and run in a shell conditional statement.
 m4_define([_AC_COMPILER_EXEEXT],
 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
 
-
 # When config.status generates a header, we must update the stamp-h file.
 # This file resides in the same directory as the config header
 # that is generated.  The stamp files are numbered to have different names.
@@ -1388,6 +1486,53 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+  [whether $CC understands -c and -o together],
+  [am_cv_prog_cc_c_o],
+  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
diff --git a/config.h.in b/config.h.in
index fce111e..bb8edd2 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,17 +1,5 @@
 /* config.h.in.  Generated from configure.ac by autoheader.  */
 
-/* Define if building universal (internal helper macro) */
-#undef AC_APPLE_UNIVERSAL_BUILD
-
-/* Architecture is PowerPC */
-#undef ARCH_PPC
-
-/* Architecture is x86 */
-#undef ARCH_X86
-
-/* Architecture is x86-64 */
-#undef ARCH_X86_64
-
 /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
    systems. This function is required for `alloca.c' support on those systems.
    */
@@ -113,9 +101,6 @@
 /* "do we have typeof" */
 #undef HAVE_STATEMENT_EXPR
 
-/* Define to 1 if stdbool.h conforms to C99. */
-#undef HAVE_STDBOOL_H
-
 /* Define to 1 if you have the <stddef.h> header file. */
 #undef HAVE_STDDEF_H
 
@@ -164,8 +149,8 @@
 /* Define to 1 if you have the <yaml.h> header file. */
 #undef HAVE_YAML_H
 
-/* Define to 1 if the system has the type `_Bool'. */
-#undef HAVE__BOOL
+/* activate the logging or not */
+#undef LOGGING
 
 /* Define to the sub-directory in which libtool stores uninstalled libraries.
    */
@@ -192,15 +177,6 @@
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
-/* Platform is Apple */
-#undef PLATFORM_APPLE
-
-/* Platform is Linux */
-#undef PLATFORM_LINUX
-
-/* Platform is Win32 */
-#undef PLATFORM_WIN32
-
 /* If using the C implementation of alloca, define if you know the
    direction of stack growth for your system; otherwise it will be
    automatically deduced at runtime.
@@ -230,18 +206,6 @@
 /* Revison */
 #undef VREV
 
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
-   significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-#  define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-#  undef WORDS_BIGENDIAN
-# endif
-#endif
-
 /* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
    <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
    #define below would cause a syntax error. */
diff --git a/config/compile b/config/compile
new file mode 100755
index 0000000..531136b
--- /dev/null
+++ b/config/compile
@@ -0,0 +1,347 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2012-10-14.11; # UTC
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey at cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""	$nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+	# lazily determine how to convert abs files
+	case `uname -s` in
+	  MINGW*)
+	    file_conv=mingw
+	    ;;
+	  CYGWIN*)
+	    file_conv=cygwin
+	    ;;
+	  *)
+	    file_conv=wine
+	    ;;
+	esac
+      fi
+      case $file_conv/,$2, in
+	*,$file_conv,*)
+	  ;;
+	mingw/*)
+	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+	  ;;
+	cygwin/*)
+	  file=`cygpath -m "$file" || echo "$file"`
+	  ;;
+	wine/*)
+	  file=`winepath -w "$file" || echo "$file"`
+	  ;;
+      esac
+      ;;
+  esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+  func_file_conv "$1"
+  if test -z "$lib_path"; then
+    lib_path=$file
+  else
+    lib_path="$lib_path;$file"
+  fi
+  linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+  lib=$1
+  found=no
+  save_IFS=$IFS
+  IFS=';'
+  for dir in $lib_path $LIB
+  do
+    IFS=$save_IFS
+    if $shared && test -f "$dir/$lib.dll.lib"; then
+      found=yes
+      lib=$dir/$lib.dll.lib
+      break
+    fi
+    if test -f "$dir/$lib.lib"; then
+      found=yes
+      lib=$dir/$lib.lib
+      break
+    fi
+    if test -f "$dir/lib$lib.a"; then
+      found=yes
+      lib=$dir/lib$lib.a
+      break
+    fi
+  done
+  IFS=$save_IFS
+
+  if test "$found" != yes; then
+    lib=$lib.lib
+  fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+  # Assume a capable shell
+  lib_path=
+  shared=:
+  linker_opts=
+  for arg
+  do
+    if test -n "$eat"; then
+      eat=
+    else
+      case $1 in
+	-o)
+	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
+	  eat=1
+	  case $2 in
+	    *.o | *.[oO][bB][jJ])
+	      func_file_conv "$2"
+	      set x "$@" -Fo"$file"
+	      shift
+	      ;;
+	    *)
+	      func_file_conv "$2"
+	      set x "$@" -Fe"$file"
+	      shift
+	      ;;
+	  esac
+	  ;;
+	-I)
+	  eat=1
+	  func_file_conv "$2" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-I*)
+	  func_file_conv "${1#-I}" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-l)
+	  eat=1
+	  func_cl_dashl "$2"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-l*)
+	  func_cl_dashl "${1#-l}"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-L)
+	  eat=1
+	  func_cl_dashL "$2"
+	  ;;
+	-L*)
+	  func_cl_dashL "${1#-L}"
+	  ;;
+	-static)
+	  shared=false
+	  ;;
+	-Wl,*)
+	  arg=${1#-Wl,}
+	  save_ifs="$IFS"; IFS=','
+	  for flag in $arg; do
+	    IFS="$save_ifs"
+	    linker_opts="$linker_opts $flag"
+	  done
+	  IFS="$save_ifs"
+	  ;;
+	-Xlinker)
+	  eat=1
+	  linker_opts="$linker_opts $2"
+	  ;;
+	-*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+	*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+	  func_file_conv "$1"
+	  set x "$@" -Tp"$file"
+	  shift
+	  ;;
+	*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+	  func_file_conv "$1" mingw
+	  set x "$@" "$file"
+	  shift
+	  ;;
+	*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+      esac
+    fi
+    shift
+  done
+  if test -n "$linker_opts"; then
+    linker_opts="-link$linker_opts"
+  fi
+  exec "$@" $linker_opts
+  exit 1
+}
+
+eat=
+
+case $1 in
+  '')
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+    func_cl_wrapper "$@"      # Doesn't return...
+    ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+	# configure might choose to run compile as 'compile cc -o foo foo.c'.
+	# So we strip '-o arg' only if arg is an object.
+	eat=1
+	case $2 in
+	  *.o | *.obj)
+	    ofile=$2
+	    ;;
+	  *)
+	    set x "$@" -o "$2"
+	    shift
+	    ;;
+	esac
+	;;
+      *.c)
+	cfile=$1
+	set x "$@" "$1"
+	shift
+	;;
+      *)
+	set x "$@" "$1"
+	shift
+	;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no '-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # '.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/config/config.guess b/config/config.guess
index b79252d..1f5c50c 100755
--- a/config/config.guess
+++ b/config/config.guess
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2013 Free Software Foundation, Inc.
+#   Copyright 1992-2014 Free Software Foundation, Inc.
 
-timestamp='2013-06-10'
+timestamp='2014-03-23'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -50,7 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright 1992-2014 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -149,7 +149,7 @@ Linux|GNU|GNU/*)
 	LIBC=gnu
 	#endif
 	EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
 	;;
 esac
 
@@ -826,7 +826,7 @@ EOF
     *:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit ;;
-    i*:MSYS*:*)
+    *:MSYS*:*)
 	echo ${UNAME_MACHINE}-pc-msys
 	exit ;;
     i*:windows32*:*)
@@ -969,10 +969,10 @@ EOF
 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
 	;;
-    or1k:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+    openrisc*:Linux:*:*)
+	echo or1k-unknown-linux-${LIBC}
 	exit ;;
-    or32:Linux:*:*)
+    or32:Linux:*:* | or1k*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     padre:Linux:*:*)
@@ -1260,16 +1260,26 @@ EOF
 	if test "$UNAME_PROCESSOR" = unknown ; then
 	    UNAME_PROCESSOR=powerpc
 	fi
-	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-		grep IS_64BIT_ARCH >/dev/null
-	    then
-		case $UNAME_PROCESSOR in
-		    i386) UNAME_PROCESSOR=x86_64 ;;
-		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
-		esac
+	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+	    if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		    grep IS_64BIT_ARCH >/dev/null
+		then
+		    case $UNAME_PROCESSOR in
+			i386) UNAME_PROCESSOR=x86_64 ;;
+			powerpc) UNAME_PROCESSOR=powerpc64 ;;
+		    esac
+		fi
 	    fi
+	elif test "$UNAME_PROCESSOR" = i386 ; then
+	    # Avoid executing cc on OS X 10.9, as it ships with a stub
+	    # that puts up a graphical alert prompting to install
+	    # developer tools.  Any system running Mac OS X 10.7 or
+	    # later (Darwin 11 and later) is required to have a 64-bit
+	    # processor. This is not true of the ARM version of Darwin
+	    # that Apple uses in portable devices.
+	    UNAME_PROCESSOR=x86_64
 	fi
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
 	exit ;;
@@ -1361,154 +1371,6 @@ EOF
 	exit ;;
 esac
 
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
-  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
-     I don't know....  */
-  printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
-  printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
-	"4"
-#else
-	""
-#endif
-	); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
-  printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
-  int version;
-  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
-  if (version < 4)
-    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
-  else
-    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
-  exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
-  printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
-  printf ("ns32k-encore-mach\n"); exit (0);
-#else
-  printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
-  printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
-  printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
-  printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
-    struct utsname un;
-
-    uname(&un);
-
-    if (strncmp(un.version, "V2", 2) == 0) {
-	printf ("i386-sequent-ptx2\n"); exit (0);
-    }
-    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
-	printf ("i386-sequent-ptx1\n"); exit (0);
-    }
-    printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-#  include <sys/param.h>
-#  if defined (BSD)
-#   if BSD == 43
-      printf ("vax-dec-bsd4.3\n"); exit (0);
-#   else
-#    if BSD == 199006
-      printf ("vax-dec-bsd4.3reno\n"); exit (0);
-#    else
-      printf ("vax-dec-bsd\n"); exit (0);
-#    endif
-#   endif
-#  else
-    printf ("vax-dec-bsd\n"); exit (0);
-#  endif
-# else
-    printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
-  printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
-  exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
-	{ echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
-    case `getsysinfo -f cpu_type` in
-    c1*)
-	echo c1-convex-bsd
-	exit ;;
-    c2*)
-	if getsysinfo -f scalar_acc
-	then echo c32-convex-bsd
-	else echo c2-convex-bsd
-	fi
-	exit ;;
-    c34*)
-	echo c34-convex-bsd
-	exit ;;
-    c38*)
-	echo c38-convex-bsd
-	exit ;;
-    c4*)
-	echo c4-convex-bsd
-	exit ;;
-    esac
-fi
-
 cat >&2 <<EOF
 $0: unable to guess system type
 
diff --git a/config/config.sub b/config/config.sub
index 9633db7..bba4efb 100755
--- a/config/config.sub
+++ b/config/config.sub
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright 1992-2013 Free Software Foundation, Inc.
+#   Copyright 1992-2014 Free Software Foundation, Inc.
 
-timestamp='2013-08-10'
+timestamp='2014-09-11'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -68,7 +68,7 @@ Report bugs and patches to <config-patches at gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright 1992-2014 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -265,6 +265,7 @@ case $basic_machine in
 	| hexagon \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
+	| k1om \
 	| le32 | le64 \
 	| lm32 \
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
@@ -282,8 +283,10 @@ case $basic_machine in
 	| mips64vr5900 | mips64vr5900el \
 	| mipsisa32 | mipsisa32el \
 	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa32r6 | mipsisa32r6el \
 	| mipsisa64 | mipsisa64el \
 	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64r6 | mipsisa64r6el \
 	| mipsisa64sb1 | mipsisa64sb1el \
 	| mipsisa64sr71k | mipsisa64sr71kel \
 	| mipsr5900 | mipsr5900el \
@@ -295,11 +298,11 @@ case $basic_machine in
 	| nds32 | nds32le | nds32be \
 	| nios | nios2 | nios2eb | nios2el \
 	| ns16k | ns32k \
-	| open8 \
-	| or1k | or32 \
+	| open8 | or1k | or1knd | or32 \
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pyramid \
+	| riscv32 | riscv64 \
 	| rl78 | rx \
 	| score \
 	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
@@ -324,7 +327,7 @@ case $basic_machine in
 	c6x)
 		basic_machine=tic6x-unknown
 		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
@@ -381,6 +384,7 @@ case $basic_machine in
 	| hexagon-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
+	| k1om-* \
 	| le32-* | le64-* \
 	| lm32-* \
 	| m32c-* | m32r-* | m32rle-* \
@@ -400,8 +404,10 @@ case $basic_machine in
 	| mips64vr5900-* | mips64vr5900el-* \
 	| mipsisa32-* | mipsisa32el-* \
 	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa32r6-* | mipsisa32r6el-* \
 	| mipsisa64-* | mipsisa64el-* \
 	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64r6-* | mipsisa64r6el-* \
 	| mipsisa64sb1-* | mipsisa64sb1el-* \
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
 	| mipsr5900-* | mipsr5900el-* \
@@ -413,6 +419,7 @@ case $basic_machine in
 	| nios-* | nios2-* | nios2eb-* | nios2el-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
 	| open8-* \
+	| or1k*-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
@@ -822,6 +829,10 @@ case $basic_machine in
 		basic_machine=powerpc-unknown
 		os=-morphos
 		;;
+	moxiebox)
+		basic_machine=moxie-unknown
+		os=-moxiebox
+		;;
 	msdos)
 		basic_machine=i386-pc
 		os=-msdos
@@ -1367,14 +1378,14 @@ case $os in
 	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
 	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
 	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
-	      | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)
@@ -1592,9 +1603,6 @@ case $basic_machine in
 	mips*-*)
 		os=-elf
 		;;
-	or1k-*)
-		os=-elf
-		;;
 	or32-*)
 		os=-coff
 		;;
diff --git a/config/ltmain.sh b/config/ltmain.sh
index 68c6d96..bffda54 100644
--- a/config/ltmain.sh
+++ b/config/ltmain.sh
@@ -70,7 +70,7 @@
 #         compiler:		$LTCC
 #         compiler flags:		$LTCFLAGS
 #         linker:		$LD (gnu? $with_gnu_ld)
-#         $progname:	(GNU libtool) 2.4.2 Debian-2.4.2-1.3
+#         $progname:	(GNU libtool) 2.4.2 Debian-2.4.2-1.11
 #         automake:	$automake_version
 #         autoconf:	$autoconf_version
 #
@@ -80,7 +80,7 @@
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION="2.4.2 Debian-2.4.2-1.3"
+VERSION="2.4.2 Debian-2.4.2-1.11"
 TIMESTAMP=""
 package_revision=1.3337
 
diff --git a/config/mdate-sh b/config/mdate-sh
new file mode 100755
index 0000000..b3719cf
--- /dev/null
+++ b/config/mdate-sh
@@ -0,0 +1,224 @@
+#!/bin/sh
+# Get modification time of a file or directory and pretty-print it.
+
+scriptversion=2010-08-21.06; # UTC
+
+# Copyright (C) 1995-2013 Free Software Foundation, Inc.
+# written by Ulrich Drepper <drepper at gnu.ai.mit.edu>, June 1995
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+fi
+
+case $1 in
+  '')
+     echo "$0: No file.  Try '$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: mdate-sh [--help] [--version] FILE
+
+Pretty-print the modification day of FILE, in the format:
+1 January 1970
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "mdate-sh $scriptversion"
+    exit $?
+    ;;
+esac
+
+error ()
+{
+  echo "$0: $1" >&2
+  exit 1
+}
+
+
+# Prevent date giving response in another language.
+LANG=C
+export LANG
+LC_ALL=C
+export LC_ALL
+LC_TIME=C
+export LC_TIME
+
+# GNU ls changes its time format in response to the TIME_STYLE
+# variable.  Since we cannot assume 'unset' works, revert this
+# variable to its documented default.
+if test "${TIME_STYLE+set}" = set; then
+  TIME_STYLE=posix-long-iso
+  export TIME_STYLE
+fi
+
+save_arg1=$1
+
+# Find out how to get the extended ls output of a file or directory.
+if ls -L /dev/null 1>/dev/null 2>&1; then
+  ls_command='ls -L -l -d'
+else
+  ls_command='ls -l -d'
+fi
+# Avoid user/group names that might have spaces, when possible.
+if ls -n /dev/null 1>/dev/null 2>&1; then
+  ls_command="$ls_command -n"
+fi
+
+# A 'ls -l' line looks as follows on OS/2.
+#  drwxrwx---        0 Aug 11  2001 foo
+# This differs from Unix, which adds ownership information.
+#  drwxrwx---   2 root  root      4096 Aug 11  2001 foo
+#
+# To find the date, we split the line on spaces and iterate on words
+# until we find a month.  This cannot work with files whose owner is a
+# user named "Jan", or "Feb", etc.  However, it's unlikely that '/'
+# will be owned by a user whose name is a month.  So we first look at
+# the extended ls output of the root directory to decide how many
+# words should be skipped to get the date.
+
+# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
+set x`$ls_command /`
+
+# Find which argument is the month.
+month=
+command=
+until test $month
+do
+  test $# -gt 0 || error "failed parsing '$ls_command /' output"
+  shift
+  # Add another shift to the command.
+  command="$command shift;"
+  case $1 in
+    Jan) month=January; nummonth=1;;
+    Feb) month=February; nummonth=2;;
+    Mar) month=March; nummonth=3;;
+    Apr) month=April; nummonth=4;;
+    May) month=May; nummonth=5;;
+    Jun) month=June; nummonth=6;;
+    Jul) month=July; nummonth=7;;
+    Aug) month=August; nummonth=8;;
+    Sep) month=September; nummonth=9;;
+    Oct) month=October; nummonth=10;;
+    Nov) month=November; nummonth=11;;
+    Dec) month=December; nummonth=12;;
+  esac
+done
+
+test -n "$month" || error "failed parsing '$ls_command /' output"
+
+# Get the extended ls output of the file or directory.
+set dummy x`eval "$ls_command \"\\\$save_arg1\""`
+
+# Remove all preceding arguments
+eval $command
+
+# Because of the dummy argument above, month is in $2.
+#
+# On a POSIX system, we should have
+#
+# $# = 5
+# $1 = file size
+# $2 = month
+# $3 = day
+# $4 = year or time
+# $5 = filename
+#
+# On Darwin 7.7.0 and 7.6.0, we have
+#
+# $# = 4
+# $1 = day
+# $2 = month
+# $3 = year or time
+# $4 = filename
+
+# Get the month.
+case $2 in
+  Jan) month=January; nummonth=1;;
+  Feb) month=February; nummonth=2;;
+  Mar) month=March; nummonth=3;;
+  Apr) month=April; nummonth=4;;
+  May) month=May; nummonth=5;;
+  Jun) month=June; nummonth=6;;
+  Jul) month=July; nummonth=7;;
+  Aug) month=August; nummonth=8;;
+  Sep) month=September; nummonth=9;;
+  Oct) month=October; nummonth=10;;
+  Nov) month=November; nummonth=11;;
+  Dec) month=December; nummonth=12;;
+esac
+
+case $3 in
+  ???*) day=$1;;
+  *) day=$3; shift;;
+esac
+
+# Here we have to deal with the problem that the ls output gives either
+# the time of day or the year.
+case $3 in
+  *:*) set `date`; eval year=\$$#
+       case $2 in
+	 Jan) nummonthtod=1;;
+	 Feb) nummonthtod=2;;
+	 Mar) nummonthtod=3;;
+	 Apr) nummonthtod=4;;
+	 May) nummonthtod=5;;
+	 Jun) nummonthtod=6;;
+	 Jul) nummonthtod=7;;
+	 Aug) nummonthtod=8;;
+	 Sep) nummonthtod=9;;
+	 Oct) nummonthtod=10;;
+	 Nov) nummonthtod=11;;
+	 Dec) nummonthtod=12;;
+       esac
+       # For the first six month of the year the time notation can also
+       # be used for files modified in the last year.
+       if (expr $nummonth \> $nummonthtod) > /dev/null;
+       then
+	 year=`expr $year - 1`
+       fi;;
+  *) year=$3;;
+esac
+
+# The result.
+echo $day $month $year
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/config/missing b/config/missing
index cdea514..db98974 100755
--- a/config/missing
+++ b/config/missing
@@ -1,7 +1,7 @@
 #! /bin/sh
 # Common wrapper for a few potentially missing GNU programs.
 
-scriptversion=2012-06-26.16; # UTC
+scriptversion=2013-10-28.13; # UTC
 
 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
 # Originally written by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
@@ -160,7 +160,7 @@ give_advice ()
       ;;
    autom4te*)
       echo "You might have modified some maintainer files that require"
-      echo "the 'automa4te' program to be rebuilt."
+      echo "the 'autom4te' program to be rebuilt."
       program_details 'autom4te'
       ;;
     bison*|yacc*)
diff --git a/config/test-driver b/config/test-driver
index 32bf39e..d306056 100755
--- a/config/test-driver
+++ b/config/test-driver
@@ -1,7 +1,7 @@
 #! /bin/sh
 # test-driver - basic testsuite driver script.
 
-scriptversion=2012-06-27.10; # UTC
+scriptversion=2013-07-13.22; # UTC
 
 # Copyright (C) 2011-2013 Free Software Foundation, Inc.
 #
@@ -44,13 +44,12 @@ print_usage ()
 Usage:
   test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
               [--expect-failure={yes|no}] [--color-tests={yes|no}]
-              [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT
+              [--enable-hard-errors={yes|no}] [--]
+              TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
 The '--test-name', '--log-file' and '--trs-file' options are mandatory.
 END
 }
 
-# TODO: better error handling in option parsing (in particular, ensure
-# TODO: $log_file, $trs_file and $test_name are defined).
 test_name= # Used for reporting.
 log_file=  # Where to save the output of the test script.
 trs_file=  # Where to save the metadata of the test run.
@@ -69,10 +68,23 @@ while test $# -gt 0; do
   --enable-hard-errors) enable_hard_errors=$2; shift;;
   --) shift; break;;
   -*) usage_error "invalid option: '$1'";;
+   *) break;;
   esac
   shift
 done
 
+missing_opts=
+test x"$test_name" = x && missing_opts="$missing_opts --test-name"
+test x"$log_file"  = x && missing_opts="$missing_opts --log-file"
+test x"$trs_file"  = x && missing_opts="$missing_opts --trs-file"
+if test x"$missing_opts" != x; then
+  usage_error "the following mandatory options are missing:$missing_opts"
+fi
+
+if test $# -eq 0; then
+  usage_error "missing argument"
+fi
+
 if test $color_tests = yes; then
   # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
   red='' # Red.
diff --git a/config/texinfo.tex b/config/texinfo.tex
new file mode 100644
index 0000000..85f184c
--- /dev/null
+++ b/config/texinfo.tex
@@ -0,0 +1,10079 @@
+% texinfo.tex -- TeX macros to handle Texinfo files.
+% 
+% Load plain if necessary, i.e., if running under initex.
+\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
+%
+\def\texinfoversion{2013-02-01.11}
+%
+% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
+% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+% 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
+%
+% This texinfo.tex file is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public License as
+% published by the Free Software Foundation, either version 3 of the
+% License, or (at your option) any later version.
+%
+% This texinfo.tex file is distributed in the hope that it will be
+% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+% General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program.  If not, see <http://www.gnu.org/licenses/>.
+%
+% As a special exception, when this file is read by TeX when processing
+% a Texinfo source document, you may use the result without
+% restriction. This Exception is an additional permission under section 7
+% of the GNU General Public License, version 3 ("GPLv3").
+%
+% Please try the latest version of texinfo.tex before submitting bug
+% reports; you can get the latest version from:
+%   http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
+%   http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
+%   http://www.gnu.org/software/texinfo/ (the Texinfo home page)
+% The texinfo.tex in any given distribution could well be out
+% of date, so if that's what you're using, please check.
+%
+% Send bug reports to bug-texinfo at gnu.org.  Please include including a
+% complete document in each bug report with which we can reproduce the
+% problem.  Patches are, of course, greatly appreciated.
+%
+% To process a Texinfo manual with TeX, it's most reliable to use the
+% texi2dvi shell script that comes with the distribution.  For a simple
+% manual foo.texi, however, you can get away with this:
+%   tex foo.texi
+%   texindex foo.??
+%   tex foo.texi
+%   tex foo.texi
+%   dvips foo.dvi -o  # or whatever; this makes foo.ps.
+% The extra TeX runs get the cross-reference information correct.
+% Sometimes one run after texindex suffices, and sometimes you need more
+% than two; texi2dvi does it as many times as necessary.
+%
+% It is possible to adapt texinfo.tex for other languages, to some
+% extent.  You can get the existing language-specific files from the
+% full Texinfo distribution.
+%
+% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
+
+
+\message{Loading texinfo [version \texinfoversion]:}
+
+% If in a .fmt file, print the version number
+% and turn on active characters that we couldn't do earlier because
+% they might have appeared in the input file name.
+\everyjob{\message{[Texinfo version \texinfoversion]}%
+  \catcode`+=\active \catcode`\_=\active}
+
+\chardef\other=12
+
+% We never want plain's \outer definition of \+ in Texinfo.
+% For @tex, we can use \tabalign.
+\let\+ = \relax
+
+% Save some plain tex macros whose names we will redefine.
+\let\ptexb=\b
+\let\ptexbullet=\bullet
+\let\ptexc=\c
+\let\ptexcomma=\,
+\let\ptexdot=\.
+\let\ptexdots=\dots
+\let\ptexend=\end
+\let\ptexequiv=\equiv
+\let\ptexexclam=\!
+\let\ptexfootnote=\footnote
+\let\ptexgtr=>
+\let\ptexhat=^
+\let\ptexi=\i
+\let\ptexindent=\indent
+\let\ptexinsert=\insert
+\let\ptexlbrace=\{
+\let\ptexless=<
+\let\ptexnewwrite\newwrite
+\let\ptexnoindent=\noindent
+\let\ptexplus=+
+\let\ptexraggedright=\raggedright
+\let\ptexrbrace=\}
+\let\ptexslash=\/
+\let\ptexstar=\*
+\let\ptext=\t
+\let\ptextop=\top
+{\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
+
+% If this character appears in an error message or help string, it
+% starts a new line in the output.
+\newlinechar = `^^J
+
+% Use TeX 3.0's \inputlineno to get the line number, for better error
+% messages, but if we're using an old version of TeX, don't do anything.
+%
+\ifx\inputlineno\thisisundefined
+  \let\linenumber = \empty % Pre-3.0.
+\else
+  \def\linenumber{l.\the\inputlineno:\space}
+\fi
+
+% Set up fixed words for English if not already set.
+\ifx\putwordAppendix\undefined  \gdef\putwordAppendix{Appendix}\fi
+\ifx\putwordChapter\undefined   \gdef\putwordChapter{Chapter}\fi
+\ifx\putworderror\undefined     \gdef\putworderror{error}\fi
+\ifx\putwordfile\undefined      \gdef\putwordfile{file}\fi
+\ifx\putwordin\undefined        \gdef\putwordin{in}\fi
+\ifx\putwordIndexIsEmpty\undefined       \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
+\ifx\putwordIndexNonexistent\undefined   \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
+\ifx\putwordInfo\undefined      \gdef\putwordInfo{Info}\fi
+\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
+\ifx\putwordMethodon\undefined  \gdef\putwordMethodon{Method on}\fi
+\ifx\putwordNoTitle\undefined   \gdef\putwordNoTitle{No Title}\fi
+\ifx\putwordof\undefined        \gdef\putwordof{of}\fi
+\ifx\putwordon\undefined        \gdef\putwordon{on}\fi
+\ifx\putwordpage\undefined      \gdef\putwordpage{page}\fi
+\ifx\putwordsection\undefined   \gdef\putwordsection{section}\fi
+\ifx\putwordSection\undefined   \gdef\putwordSection{Section}\fi
+\ifx\putwordsee\undefined       \gdef\putwordsee{see}\fi
+\ifx\putwordSee\undefined       \gdef\putwordSee{See}\fi
+\ifx\putwordShortTOC\undefined  \gdef\putwordShortTOC{Short Contents}\fi
+\ifx\putwordTOC\undefined       \gdef\putwordTOC{Table of Contents}\fi
+%
+\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
+\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
+\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
+\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
+\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
+\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
+\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
+\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
+\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
+\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
+\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
+\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
+%
+\ifx\putwordDefmac\undefined    \gdef\putwordDefmac{Macro}\fi
+\ifx\putwordDefspec\undefined   \gdef\putwordDefspec{Special Form}\fi
+\ifx\putwordDefvar\undefined    \gdef\putwordDefvar{Variable}\fi
+\ifx\putwordDefopt\undefined    \gdef\putwordDefopt{User Option}\fi
+\ifx\putwordDeffunc\undefined   \gdef\putwordDeffunc{Function}\fi
+
+% Since the category of space is not known, we have to be careful.
+\chardef\spacecat = 10
+\def\spaceisspace{\catcode`\ =\spacecat}
+
+% sometimes characters are active, so we need control sequences.
+\chardef\ampChar   = `\&
+\chardef\colonChar = `\:
+\chardef\commaChar = `\,
+\chardef\dashChar  = `\-
+\chardef\dotChar   = `\.
+\chardef\exclamChar= `\!
+\chardef\hashChar  = `\#
+\chardef\lquoteChar= `\`
+\chardef\questChar = `\?
+\chardef\rquoteChar= `\'
+\chardef\semiChar  = `\;
+\chardef\slashChar = `\/
+\chardef\underChar = `\_
+
+% Ignore a token.
+%
+\def\gobble#1{}
+
+% The following is used inside several \edef's.
+\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
+
+% Hyphenation fixes.
+\hyphenation{
+  Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
+  ap-pen-dix bit-map bit-maps
+  data-base data-bases eshell fall-ing half-way long-est man-u-script
+  man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
+  par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
+  spell-ing spell-ings
+  stand-alone strong-est time-stamp time-stamps which-ever white-space
+  wide-spread wrap-around
+}
+
+% Margin to add to right of even pages, to left of odd pages.
+\newdimen\bindingoffset
+\newdimen\normaloffset
+\newdimen\pagewidth \newdimen\pageheight
+
+% For a final copy, take out the rectangles
+% that mark overfull boxes (in case you have decided
+% that the text looks ok even though it passes the margin).
+%
+\def\finalout{\overfullrule=0pt }
+
+% Sometimes it is convenient to have everything in the transcript file
+% and nothing on the terminal.  We don't just call \tracingall here,
+% since that produces some useless output on the terminal.  We also make
+% some effort to order the tracing commands to reduce output in the log
+% file; cf. trace.sty in LaTeX.
+%
+\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
+\def\loggingall{%
+  \tracingstats2
+  \tracingpages1
+  \tracinglostchars2  % 2 gives us more in etex
+  \tracingparagraphs1
+  \tracingoutput1
+  \tracingmacros2
+  \tracingrestores1
+  \showboxbreadth\maxdimen \showboxdepth\maxdimen
+  \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
+    \tracingscantokens1
+    \tracingifs1
+    \tracinggroups1
+    \tracingnesting2
+    \tracingassigns1
+  \fi
+  \tracingcommands3  % 3 gives us more in etex
+  \errorcontextlines16
+}%
+
+% @errormsg{MSG}.  Do the index-like expansions on MSG, but if things
+% aren't perfect, it's not the end of the world, being an error message,
+% after all.
+% 
+\def\errormsg{\begingroup \indexnofonts \doerrormsg}
+\def\doerrormsg#1{\errmessage{#1}}
+
+% add check for \lastpenalty to plain's definitions.  If the last thing
+% we did was a \nobreak, we don't want to insert more space.
+%
+\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
+  \removelastskip\penalty-50\smallskip\fi\fi}
+\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
+  \removelastskip\penalty-100\medskip\fi\fi}
+\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
+  \removelastskip\penalty-200\bigskip\fi\fi}
+
+% Do @cropmarks to get crop marks.
+%
+\newif\ifcropmarks
+\let\cropmarks = \cropmarkstrue
+%
+% Dimensions to add cropmarks at corners.
+% Added by P. A. MacKay, 12 Nov. 1986
+%
+\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
+\newdimen\cornerlong  \cornerlong=1pc
+\newdimen\cornerthick \cornerthick=.3pt
+\newdimen\topandbottommargin \topandbottommargin=.75in
+
+% Output a mark which sets \thischapter, \thissection and \thiscolor.
+% We dump everything together because we only have one kind of mark.
+% This works because we only use \botmark / \topmark, not \firstmark.
+%
+% A mark contains a subexpression of the \ifcase ... \fi construct.
+% \get*marks macros below extract the needed part using \ifcase.
+%
+% Another complication is to let the user choose whether \thischapter
+% (\thissection) refers to the chapter (section) in effect at the top
+% of a page, or that at the bottom of a page.  The solution is
+% described on page 260 of The TeXbook.  It involves outputting two
+% marks for the sectioning macros, one before the section break, and
+% one after.  I won't pretend I can describe this better than DEK...
+\def\domark{%
+  \toks0=\expandafter{\lastchapterdefs}%
+  \toks2=\expandafter{\lastsectiondefs}%
+  \toks4=\expandafter{\prevchapterdefs}%
+  \toks6=\expandafter{\prevsectiondefs}%
+  \toks8=\expandafter{\lastcolordefs}%
+  \mark{%
+                   \the\toks0 \the\toks2
+      \noexpand\or \the\toks4 \the\toks6
+    \noexpand\else \the\toks8
+  }%
+}
+% \topmark doesn't work for the very first chapter (after the title
+% page or the contents), so we use \firstmark there -- this gets us
+% the mark with the chapter defs, unless the user sneaks in, e.g.,
+% @setcolor (or @url, or @link, etc.) between @contents and the very
+% first @chapter.
+\def\gettopheadingmarks{%
+  \ifcase0\topmark\fi
+  \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
+}
+\def\getbottomheadingmarks{\ifcase1\botmark\fi}
+\def\getcolormarks{\ifcase2\topmark\fi}
+
+% Avoid "undefined control sequence" errors.
+\def\lastchapterdefs{}
+\def\lastsectiondefs{}
+\def\prevchapterdefs{}
+\def\prevsectiondefs{}
+\def\lastcolordefs{}
+
+% Main output routine.
+\chardef\PAGE = 255
+\output = {\onepageout{\pagecontents\PAGE}}
+
+\newbox\headlinebox
+\newbox\footlinebox
+
+% \onepageout takes a vbox as an argument.  Note that \pagecontents
+% does insertions, but you have to call it yourself.
+\def\onepageout#1{%
+  \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
+  %
+  \ifodd\pageno  \advance\hoffset by \bindingoffset
+  \else \advance\hoffset by -\bindingoffset\fi
+  %
+  % Do this outside of the \shipout so @code etc. will be expanded in
+  % the headline as they should be, not taken literally (outputting ''code).
+  \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
+  \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
+  \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
+  \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
+  %
+  {%
+    % Have to do this stuff outside the \shipout because we want it to
+    % take effect in \write's, yet the group defined by the \vbox ends
+    % before the \shipout runs.
+    %
+    \indexdummies         % don't expand commands in the output.
+    \normalturnoffactive  % \ in index entries must not stay \, e.g., if
+               % the page break happens to be in the middle of an example.
+               % We don't want .vr (or whatever) entries like this:
+               % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
+               % "\acronym" won't work when it's read back in;
+               % it needs to be
+               % {\code {{\tt \backslashcurfont }acronym}
+    \shipout\vbox{%
+      % Do this early so pdf references go to the beginning of the page.
+      \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
+      %
+      \ifcropmarks \vbox to \outervsize\bgroup
+        \hsize = \outerhsize
+        \vskip-\topandbottommargin
+        \vtop to0pt{%
+          \line{\ewtop\hfil\ewtop}%
+          \nointerlineskip
+          \line{%
+            \vbox{\moveleft\cornerthick\nstop}%
+            \hfill
+            \vbox{\moveright\cornerthick\nstop}%
+          }%
+          \vss}%
+        \vskip\topandbottommargin
+        \line\bgroup
+          \hfil % center the page within the outer (page) hsize.
+          \ifodd\pageno\hskip\bindingoffset\fi
+          \vbox\bgroup
+      \fi
+      %
+      \unvbox\headlinebox
+      \pagebody{#1}%
+      \ifdim\ht\footlinebox > 0pt
+        % Only leave this space if the footline is nonempty.
+        % (We lessened \vsize for it in \oddfootingyyy.)
+        % The \baselineskip=24pt in plain's \makefootline has no effect.
+        \vskip 24pt
+        \unvbox\footlinebox
+      \fi
+      %
+      \ifcropmarks
+          \egroup % end of \vbox\bgroup
+        \hfil\egroup % end of (centering) \line\bgroup
+        \vskip\topandbottommargin plus1fill minus1fill
+        \boxmaxdepth = \cornerthick
+        \vbox to0pt{\vss
+          \line{%
+            \vbox{\moveleft\cornerthick\nsbot}%
+            \hfill
+            \vbox{\moveright\cornerthick\nsbot}%
+          }%
+          \nointerlineskip
+          \line{\ewbot\hfil\ewbot}%
+        }%
+      \egroup % \vbox from first cropmarks clause
+      \fi
+    }% end of \shipout\vbox
+  }% end of group with \indexdummies
+  \advancepageno
+  \ifnum\outputpenalty>-20000 \else\dosupereject\fi
+}
+
+\newinsert\margin \dimen\margin=\maxdimen
+
+\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
+{\catcode`\@ =11
+\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
+% marginal hacks, juha at viisa.uucp (Juha Takala)
+\ifvoid\margin\else % marginal info is present
+  \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
+\dimen@=\dp#1\relax \unvbox#1\relax
+\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
+\ifr at ggedbottom \kern-\dimen@ \vfil \fi}
+}
+
+% Here are the rules for the cropmarks.  Note that they are
+% offset so that the space between them is truly \outerhsize or \outervsize
+% (P. A. MacKay, 12 November, 1986)
+%
+\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
+\def\nstop{\vbox
+  {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
+\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
+\def\nsbot{\vbox
+  {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
+
+% Parse an argument, then pass it to #1.  The argument is the rest of
+% the input line (except we remove a trailing comment).  #1 should be a
+% macro which expects an ordinary undelimited TeX argument.
+%
+\def\parsearg{\parseargusing{}}
+\def\parseargusing#1#2{%
+  \def\argtorun{#2}%
+  \begingroup
+    \obeylines
+    \spaceisspace
+    #1%
+    \parseargline\empty% Insert the \empty token, see \finishparsearg below.
+}
+
+{\obeylines %
+  \gdef\parseargline#1^^M{%
+    \endgroup % End of the group started in \parsearg.
+    \argremovecomment #1\comment\ArgTerm%
+  }%
+}
+
+% First remove any @comment, then any @c comment.
+\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
+\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
+
+% Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
+%
+% \argremovec might leave us with trailing space, e.g.,
+%    @end itemize  @c foo
+% This space token undergoes the same procedure and is eventually removed
+% by \finishparsearg.
+%
+\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
+\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
+\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
+  \def\temp{#3}%
+  \ifx\temp\empty
+    % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
+    \let\temp\finishparsearg
+  \else
+    \let\temp\argcheckspaces
+  \fi
+  % Put the space token in:
+  \temp#1 #3\ArgTerm
+}
+
+% If a _delimited_ argument is enclosed in braces, they get stripped; so
+% to get _exactly_ the rest of the line, we had to prevent such situation.
+% We prepended an \empty token at the very beginning and we expand it now,
+% just before passing the control to \argtorun.
+% (Similarly, we have to think about #3 of \argcheckspacesY above: it is
+% either the null string, or it ends with \^^M---thus there is no danger
+% that a pair of braces would be stripped.
+%
+% But first, we have to remove the trailing space token.
+%
+\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
+
+% \parseargdef\foo{...}
+%	is roughly equivalent to
+% \def\foo{\parsearg\Xfoo}
+% \def\Xfoo#1{...}
+%
+% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
+% favourite TeX trick.  --kasal, 16nov03
+
+\def\parseargdef#1{%
+  \expandafter \doparseargdef \csname\string#1\endcsname #1%
+}
+\def\doparseargdef#1#2{%
+  \def#2{\parsearg#1}%
+  \def#1##1%
+}
+
+% Several utility definitions with active space:
+{
+  \obeyspaces
+  \gdef\obeyedspace{ }
+
+  % Make each space character in the input produce a normal interword
+  % space in the output.  Don't allow a line break at this space, as this
+  % is used only in environments like @example, where each line of input
+  % should produce a line of output anyway.
+  %
+  \gdef\sepspaces{\obeyspaces\let =\tie}
+
+  % If an index command is used in an @example environment, any spaces
+  % therein should become regular spaces in the raw index file, not the
+  % expansion of \tie (\leavevmode \penalty \@M \ ).
+  \gdef\unsepspaces{\let =\space}
+}
+
+
+\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
+
+% Define the framework for environments in texinfo.tex.  It's used like this:
+%
+%   \envdef\foo{...}
+%   \def\Efoo{...}
+%
+% It's the responsibility of \envdef to insert \begingroup before the
+% actual body; @end closes the group after calling \Efoo.  \envdef also
+% defines \thisenv, so the current environment is known; @end checks
+% whether the environment name matches.  The \checkenv macro can also be
+% used to check whether the current environment is the one expected.
+%
+% Non-false conditionals (@iftex, @ifset) don't fit into this, so they
+% are not treated as environments; they don't open a group.  (The
+% implementation of @end takes care not to call \endgroup in this
+% special case.)
+
+
+% At run-time, environments start with this:
+\def\startenvironment#1{\begingroup\def\thisenv{#1}}
+% initialize
+\let\thisenv\empty
+
+% ... but they get defined via ``\envdef\foo{...}'':
+\long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
+\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
+
+% Check whether we're in the right environment:
+\def\checkenv#1{%
+  \def\temp{#1}%
+  \ifx\thisenv\temp
+  \else
+    \badenverr
+  \fi
+}
+
+% Environment mismatch, #1 expected:
+\def\badenverr{%
+  \errhelp = \EMsimple
+  \errmessage{This command can appear only \inenvironment\temp,
+    not \inenvironment\thisenv}%
+}
+\def\inenvironment#1{%
+  \ifx#1\empty
+    outside of any environment%
+  \else
+    in environment \expandafter\string#1%
+  \fi
+}
+
+% @end foo executes the definition of \Efoo.
+% But first, it executes a specialized version of \checkenv
+%
+\parseargdef\end{%
+  \if 1\csname iscond.#1\endcsname
+  \else
+    % The general wording of \badenverr may not be ideal.
+    \expandafter\checkenv\csname#1\endcsname
+    \csname E#1\endcsname
+    \endgroup
+  \fi
+}
+
+\newhelp\EMsimple{Press RETURN to continue.}
+
+
+% Be sure we're in horizontal mode when doing a tie, since we make space
+% equivalent to this in @example-like environments. Otherwise, a space
+% at the beginning of a line will start with \penalty -- and
+% since \penalty is valid in vertical mode, we'd end up putting the
+% penalty on the vertical list instead of in the new paragraph.
+{\catcode`@ = 11
+ % Avoid using \@M directly, because that causes trouble
+ % if the definition is written into an index file.
+ \global\let\tiepenalty = \@M
+ \gdef\tie{\leavevmode\penalty\tiepenalty\ }
+}
+
+% @: forces normal size whitespace following.
+\def\:{\spacefactor=1000 }
+
+% @* forces a line break.
+\def\*{\unskip\hfil\break\hbox{}\ignorespaces}
+
+% @/ allows a line break.
+\let\/=\allowbreak
+
+% @. is an end-of-sentence period.
+\def\.{.\spacefactor=\endofsentencespacefactor\space}
+
+% @! is an end-of-sentence bang.
+\def\!{!\spacefactor=\endofsentencespacefactor\space}
+
+% @? is an end-of-sentence query.
+\def\?{?\spacefactor=\endofsentencespacefactor\space}
+
+% @frenchspacing on|off  says whether to put extra space after punctuation.
+%
+\def\onword{on}
+\def\offword{off}
+%
+\parseargdef\frenchspacing{%
+  \def\temp{#1}%
+  \ifx\temp\onword \plainfrenchspacing
+  \else\ifx\temp\offword \plainnonfrenchspacing
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
+  \fi\fi
+}
+
+% @w prevents a word break.  Without the \leavevmode, @w at the
+% beginning of a paragraph, when TeX is still in vertical mode, would
+% produce a whole line of output instead of starting the paragraph.
+\def\w#1{\leavevmode\hbox{#1}}
+
+% @group ... @end group forces ... to be all on one page, by enclosing
+% it in a TeX vbox.  We use \vtop instead of \vbox to construct the box
+% to keep its height that of a normal line.  According to the rules for
+% \topskip (p.114 of the TeXbook), the glue inserted is
+% max (\topskip - \ht (first item), 0).  If that height is large,
+% therefore, no glue is inserted, and the space between the headline and
+% the text is small, which looks bad.
+%
+% Another complication is that the group might be very large.  This can
+% cause the glue on the previous page to be unduly stretched, because it
+% does not have much material.  In this case, it's better to add an
+% explicit \vfill so that the extra space is at the bottom.  The
+% threshold for doing this is if the group is more than \vfilllimit
+% percent of a page (\vfilllimit can be changed inside of @tex).
+%
+\newbox\groupbox
+\def\vfilllimit{0.7}
+%
+\envdef\group{%
+  \ifnum\catcode`\^^M=\active \else
+    \errhelp = \groupinvalidhelp
+    \errmessage{@group invalid in context where filling is enabled}%
+  \fi
+  \startsavinginserts
+  %
+  \setbox\groupbox = \vtop\bgroup
+    % Do @comment since we are called inside an environment such as
+    % @example, where each end-of-line in the input causes an
+    % end-of-line in the output.  We don't want the end-of-line after
+    % the `@group' to put extra space in the output.  Since @group
+    % should appear on a line by itself (according to the Texinfo
+    % manual), we don't worry about eating any user text.
+    \comment
+}
+%
+% The \vtop produces a box with normal height and large depth; thus, TeX puts
+% \baselineskip glue before it, and (when the next line of text is done)
+% \lineskip glue after it.  Thus, space below is not quite equal to space
+% above.  But it's pretty close.
+\def\Egroup{%
+    % To get correct interline space between the last line of the group
+    % and the first line afterwards, we have to propagate \prevdepth.
+    \endgraf % Not \par, as it may have been set to \lisppar.
+    \global\dimen1 = \prevdepth
+  \egroup           % End the \vtop.
+  % \dimen0 is the vertical size of the group's box.
+  \dimen0 = \ht\groupbox  \advance\dimen0 by \dp\groupbox
+  % \dimen2 is how much space is left on the page (more or less).
+  \dimen2 = \pageheight   \advance\dimen2 by -\pagetotal
+  % if the group doesn't fit on the current page, and it's a big big
+  % group, force a page break.
+  \ifdim \dimen0 > \dimen2
+    \ifdim \pagetotal < \vfilllimit\pageheight
+      \page
+    \fi
+  \fi
+  \box\groupbox
+  \prevdepth = \dimen1
+  \checkinserts
+}
+%
+% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
+% message, so this ends up printing `@group can only ...'.
+%
+\newhelp\groupinvalidhelp{%
+group can only be used in environments such as @example,^^J%
+where each line of input produces a line of output.}
+
+% @need space-in-mils
+% forces a page break if there is not space-in-mils remaining.
+
+\newdimen\mil  \mil=0.001in
+
+\parseargdef\need{%
+  % Ensure vertical mode, so we don't make a big box in the middle of a
+  % paragraph.
+  \par
+  %
+  % If the @need value is less than one line space, it's useless.
+  \dimen0 = #1\mil
+  \dimen2 = \ht\strutbox
+  \advance\dimen2 by \dp\strutbox
+  \ifdim\dimen0 > \dimen2
+    %
+    % Do a \strut just to make the height of this box be normal, so the
+    % normal leading is inserted relative to the preceding line.
+    % And a page break here is fine.
+    \vtop to #1\mil{\strut\vfil}%
+    %
+    % TeX does not even consider page breaks if a penalty added to the
+    % main vertical list is 10000 or more.  But in order to see if the
+    % empty box we just added fits on the page, we must make it consider
+    % page breaks.  On the other hand, we don't want to actually break the
+    % page after the empty box.  So we use a penalty of 9999.
+    %
+    % There is an extremely small chance that TeX will actually break the
+    % page at this \penalty, if there are no other feasible breakpoints in
+    % sight.  (If the user is using lots of big @group commands, which
+    % almost-but-not-quite fill up a page, TeX will have a hard time doing
+    % good page breaking, for example.)  However, I could not construct an
+    % example where a page broke at this \penalty; if it happens in a real
+    % document, then we can reconsider our strategy.
+    \penalty9999
+    %
+    % Back up by the size of the box, whether we did a page break or not.
+    \kern -#1\mil
+    %
+    % Do not allow a page break right after this kern.
+    \nobreak
+  \fi
+}
+
+% @br   forces paragraph break (and is undocumented).
+
+\let\br = \par
+
+% @page forces the start of a new page.
+%
+\def\page{\par\vfill\supereject}
+
+% @exdent text....
+% outputs text on separate line in roman font, starting at standard page margin
+
+% This records the amount of indent in the innermost environment.
+% That's how much \exdent should take out.
+\newskip\exdentamount
+
+% This defn is used inside fill environments such as @defun.
+\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
+
+% This defn is used inside nofill environments such as @example.
+\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
+  \leftline{\hskip\leftskip{\rm#1}}}}
+
+% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
+% paragraph.  For more general purposes, use the \margin insertion
+% class.  WHICH is `l' or `r'.  Not documented, written for gawk manual.
+%
+\newskip\inmarginspacing \inmarginspacing=1cm
+\def\strutdepth{\dp\strutbox}
+%
+\def\doinmargin#1#2{\strut\vadjust{%
+  \nobreak
+  \kern-\strutdepth
+  \vtop to \strutdepth{%
+    \baselineskip=\strutdepth
+    \vss
+    % if you have multiple lines of stuff to put here, you'll need to
+    % make the vbox yourself of the appropriate size.
+    \ifx#1l%
+      \llap{\ignorespaces #2\hskip\inmarginspacing}%
+    \else
+      \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
+    \fi
+    \null
+  }%
+}}
+\def\inleftmargin{\doinmargin l}
+\def\inrightmargin{\doinmargin r}
+%
+% @inmargin{TEXT [, RIGHT-TEXT]}
+% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
+% else use TEXT for both).
+%
+\def\inmargin#1{\parseinmargin #1,,\finish}
+\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
+  \setbox0 = \hbox{\ignorespaces #2}%
+  \ifdim\wd0 > 0pt
+    \def\lefttext{#1}%  have both texts
+    \def\righttext{#2}%
+  \else
+    \def\lefttext{#1}%  have only one text
+    \def\righttext{#1}%
+  \fi
+  %
+  \ifodd\pageno
+    \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
+  \else
+    \def\temp{\inleftmargin\lefttext}%
+  \fi
+  \temp
+}
+
+% @| inserts a changebar to the left of the current line.  It should
+% surround any changed text.  This approach does *not* work if the
+% change spans more than two lines of output.  To handle that, we would
+% have adopt a much more difficult approach (putting marks into the main
+% vertical list for the beginning and end of each change).  This command
+% is not documented, not supported, and doesn't work.
+%
+\def\|{%
+  % \vadjust can only be used in horizontal mode.
+  \leavevmode
+  %
+  % Append this vertical mode material after the current line in the output.
+  \vadjust{%
+    % We want to insert a rule with the height and depth of the current
+    % leading; that is exactly what \strutbox is supposed to record.
+    \vskip-\baselineskip
+    %
+    % \vadjust-items are inserted at the left edge of the type.  So
+    % the \llap here moves out into the left-hand margin.
+    \llap{%
+      %
+      % For a thicker or thinner bar, change the `1pt'.
+      \vrule height\baselineskip width1pt
+      %
+      % This is the space between the bar and the text.
+      \hskip 12pt
+    }%
+  }%
+}
+
+% @include FILE -- \input text of FILE.
+%
+\def\include{\parseargusing\filenamecatcodes\includezzz}
+\def\includezzz#1{%
+  \pushthisfilestack
+  \def\thisfile{#1}%
+  {%
+    \makevalueexpandable  % we want to expand any @value in FILE.
+    \turnoffactive        % and allow special characters in the expansion
+    \indexnofonts         % Allow `@@' and other weird things in file names.
+    \wlog{texinfo.tex: doing @include of #1^^J}%
+    \edef\temp{\noexpand\input #1 }%
+    %
+    % This trickery is to read FILE outside of a group, in case it makes
+    % definitions, etc.
+    \expandafter
+  }\temp
+  \popthisfilestack
+}
+\def\filenamecatcodes{%
+  \catcode`\\=\other
+  \catcode`~=\other
+  \catcode`^=\other
+  \catcode`_=\other
+  \catcode`|=\other
+  \catcode`<=\other
+  \catcode`>=\other
+  \catcode`+=\other
+  \catcode`-=\other
+  \catcode`\`=\other
+  \catcode`\'=\other
+}
+
+\def\pushthisfilestack{%
+  \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
+}
+\def\pushthisfilestackX{%
+  \expandafter\pushthisfilestackY\thisfile\StackTerm
+}
+\def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
+  \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
+}
+
+\def\popthisfilestack{\errthisfilestackempty}
+\def\errthisfilestackempty{\errmessage{Internal error:
+  the stack of filenames is empty.}}
+%
+\def\thisfile{}
+
+% @center line
+% outputs that line, centered.
+%
+\parseargdef\center{%
+  \ifhmode
+    \let\centersub\centerH
+  \else
+    \let\centersub\centerV
+  \fi
+  \centersub{\hfil \ignorespaces#1\unskip \hfil}%
+  \let\centersub\relax % don't let the definition persist, just in case
+}
+\def\centerH#1{{%
+  \hfil\break
+  \advance\hsize by -\leftskip
+  \advance\hsize by -\rightskip
+  \line{#1}%
+  \break
+}}
+%
+\newcount\centerpenalty
+\def\centerV#1{%
+  % The idea here is the same as in \startdefun, \cartouche, etc.: if
+  % @center is the first thing after a section heading, we need to wipe
+  % out the negative parskip inserted by \sectionheading, but still
+  % prevent a page break here.
+  \centerpenalty = \lastpenalty
+  \ifnum\centerpenalty>10000 \vskip\parskip \fi
+  \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
+  \line{\kern\leftskip #1\kern\rightskip}%
+}
+
+% @sp n   outputs n lines of vertical space
+%
+\parseargdef\sp{\vskip #1\baselineskip}
+
+% @comment ...line which is ignored...
+% @c is the same as @comment
+% @ignore ... @end ignore  is another way to write a comment
+%
+\def\comment{\begingroup \catcode`\^^M=\other%
+\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
+\commentxxx}
+{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
+%
+\let\c=\comment
+
+% @paragraphindent NCHARS
+% We'll use ems for NCHARS, close enough.
+% NCHARS can also be the word `asis' or `none'.
+% We cannot feasibly implement @paragraphindent asis, though.
+%
+\def\asisword{asis} % no translation, these are keywords
+\def\noneword{none}
+%
+\parseargdef\paragraphindent{%
+  \def\temp{#1}%
+  \ifx\temp\asisword
+  \else
+    \ifx\temp\noneword
+      \defaultparindent = 0pt
+    \else
+      \defaultparindent = #1em
+    \fi
+  \fi
+  \parindent = \defaultparindent
+}
+
+% @exampleindent NCHARS
+% We'll use ems for NCHARS like @paragraphindent.
+% It seems @exampleindent asis isn't necessary, but
+% I preserve it to make it similar to @paragraphindent.
+\parseargdef\exampleindent{%
+  \def\temp{#1}%
+  \ifx\temp\asisword
+  \else
+    \ifx\temp\noneword
+      \lispnarrowing = 0pt
+    \else
+      \lispnarrowing = #1em
+    \fi
+  \fi
+}
+
+% @firstparagraphindent WORD
+% If WORD is `none', then suppress indentation of the first paragraph
+% after a section heading.  If WORD is `insert', then do indent at such
+% paragraphs.
+%
+% The paragraph indentation is suppressed or not by calling
+% \suppressfirstparagraphindent, which the sectioning commands do.
+% We switch the definition of this back and forth according to WORD.
+% By default, we suppress indentation.
+%
+\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
+\def\insertword{insert}
+%
+\parseargdef\firstparagraphindent{%
+  \def\temp{#1}%
+  \ifx\temp\noneword
+    \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
+  \else\ifx\temp\insertword
+    \let\suppressfirstparagraphindent = \relax
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @firstparagraphindent option `\temp'}%
+  \fi\fi
+}
+
+% Here is how we actually suppress indentation.  Redefine \everypar to
+% \kern backwards by \parindent, and then reset itself to empty.
+%
+% We also make \indent itself not actually do anything until the next
+% paragraph.
+%
+\gdef\dosuppressfirstparagraphindent{%
+  \gdef\indent{%
+    \restorefirstparagraphindent
+    \indent
+  }%
+  \gdef\noindent{%
+    \restorefirstparagraphindent
+    \noindent
+  }%
+  \global\everypar = {%
+    \kern -\parindent
+    \restorefirstparagraphindent
+  }%
+}
+
+\gdef\restorefirstparagraphindent{%
+  \global \let \indent = \ptexindent
+  \global \let \noindent = \ptexnoindent
+  \global \everypar = {}%
+}
+
+
+% @refill is a no-op.
+\let\refill=\relax
+
+% If working on a large document in chapters, it is convenient to
+% be able to disable indexing, cross-referencing, and contents, for test runs.
+% This is done with @novalidate (before @setfilename).
+%
+\newif\iflinks \linkstrue % by default we want the aux files.
+\let\novalidate = \linksfalse
+
+% @setfilename is done at the beginning of every texinfo file.
+% So open here the files we need to have open while reading the input.
+% This makes it possible to make a .fmt file for texinfo.
+\def\setfilename{%
+   \fixbackslash  % Turn off hack to swallow `\input texinfo'.
+   \iflinks
+     \tryauxfile
+     % Open the new aux file.  TeX will close it automatically at exit.
+     \immediate\openout\auxfile=\jobname.aux
+   \fi % \openindices needs to do some work in any case.
+   \openindices
+   \let\setfilename=\comment % Ignore extra @setfilename cmds.
+   %
+   % If texinfo.cnf is present on the system, read it.
+   % Useful for site-wide @afourpaper, etc.
+   \openin 1 texinfo.cnf
+   \ifeof 1 \else \input texinfo.cnf \fi
+   \closein 1
+   %
+   \comment % Ignore the actual filename.
+}
+
+% Called from \setfilename.
+%
+\def\openindices{%
+  \newindex{cp}%
+  \newcodeindex{fn}%
+  \newcodeindex{vr}%
+  \newcodeindex{tp}%
+  \newcodeindex{ky}%
+  \newcodeindex{pg}%
+}
+
+% @bye.
+\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
+
+
+\message{pdf,}
+% adobe `portable' document format
+\newcount\tempnum
+\newcount\lnkcount
+\newtoks\filename
+\newcount\filenamelength
+\newcount\pgn
+\newtoks\toksA
+\newtoks\toksB
+\newtoks\toksC
+\newtoks\toksD
+\newbox\boxA
+\newcount\countA
+\newif\ifpdf
+\newif\ifpdfmakepagedest
+
+% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
+% can be set).  So we test for \relax and 0 as well as being undefined.
+\ifx\pdfoutput\thisisundefined
+\else
+  \ifx\pdfoutput\relax
+  \else
+    \ifcase\pdfoutput
+    \else
+      \pdftrue
+    \fi
+  \fi
+\fi
+
+% PDF uses PostScript string constants for the names of xref targets,
+% for display in the outlines, and in other places.  Thus, we have to
+% double any backslashes.  Otherwise, a name like "\node" will be
+% interpreted as a newline (\n), followed by o, d, e.  Not good.
+% 
+% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
+% related messages.  The final outcome is that it is up to the TeX user
+% to double the backslashes and otherwise make the string valid, so
+% that's what we do.  pdftex 1.30.0 (ca.2005) introduced a primitive to
+% do this reliably, so we use it.
+
+% #1 is a control sequence in which to do the replacements,
+% which we \xdef.
+\def\txiescapepdf#1{%
+  \ifx\pdfescapestring\thisisundefined
+    % No primitive available; should we give a warning or log?
+    % Many times it won't matter.
+  \else
+    % The expandable \pdfescapestring primitive escapes parentheses,
+    % backslashes, and other special chars.
+    \xdef#1{\pdfescapestring{#1}}%
+  \fi
+}
+
+\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
+with PDF output, and none of those formats could be found.  (.eps cannot
+be supported due to the design of the PDF format; use regular TeX (DVI
+output) for that.)}
+
+\ifpdf
+  %
+  % Color manipulation macros based on pdfcolor.tex,
+  % except using rgb instead of cmyk; the latter is said to render as a
+  % very dark gray on-screen and a very dark halftone in print, instead
+  % of actual black.
+  \def\rgbDarkRed{0.50 0.09 0.12}
+  \def\rgbBlack{0 0 0}
+  %
+  % k sets the color for filling (usual text, etc.);
+  % K sets the color for stroking (thin rules, e.g., normal _'s).
+  \def\pdfsetcolor#1{\pdfliteral{#1 rg  #1 RG}}
+  %
+  % Set color, and create a mark which defines \thiscolor accordingly,
+  % so that \makeheadline knows which color to restore.
+  \def\setcolor#1{%
+    \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
+    \domark
+    \pdfsetcolor{#1}%
+  }
+  %
+  \def\maincolor{\rgbBlack}
+  \pdfsetcolor{\maincolor}
+  \edef\thiscolor{\maincolor}
+  \def\lastcolordefs{}
+  %
+  \def\makefootline{%
+    \baselineskip24pt
+    \line{\pdfsetcolor{\maincolor}\the\footline}%
+  }
+  %
+  \def\makeheadline{%
+    \vbox to 0pt{%
+      \vskip-22.5pt
+      \line{%
+        \vbox to8.5pt{}%
+        % Extract \thiscolor definition from the marks.
+        \getcolormarks
+        % Typeset the headline with \maincolor, then restore the color.
+        \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
+      }%
+      \vss
+    }%
+    \nointerlineskip
+  }
+  %
+  %
+  \pdfcatalog{/PageMode /UseOutlines}
+  %
+  % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
+  \def\dopdfimage#1#2#3{%
+    \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
+    \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
+    %
+    % pdftex (and the PDF format) support .pdf, .png, .jpg (among
+    % others).  Let's try in that order, PDF first since if
+    % someone has a scalable image, presumably better to use that than a
+    % bitmap.
+    \let\pdfimgext=\empty
+    \begingroup
+      \openin 1 #1.pdf \ifeof 1
+        \openin 1 #1.PDF \ifeof 1
+          \openin 1 #1.png \ifeof 1
+            \openin 1 #1.jpg \ifeof 1
+              \openin 1 #1.jpeg \ifeof 1
+                \openin 1 #1.JPG \ifeof 1
+                  \errhelp = \nopdfimagehelp
+                  \errmessage{Could not find image file #1 for pdf}%
+                \else \gdef\pdfimgext{JPG}%
+                \fi
+              \else \gdef\pdfimgext{jpeg}%
+              \fi
+            \else \gdef\pdfimgext{jpg}%
+            \fi
+          \else \gdef\pdfimgext{png}%
+          \fi
+        \else \gdef\pdfimgext{PDF}%
+        \fi
+      \else \gdef\pdfimgext{pdf}%
+      \fi
+      \closein 1
+    \endgroup
+    %
+    % without \immediate, ancient pdftex seg faults when the same image is
+    % included twice.  (Version 3.14159-pre-1.0-unofficial-20010704.)
+    \ifnum\pdftexversion < 14
+      \immediate\pdfimage
+    \else
+      \immediate\pdfximage
+    \fi
+      \ifdim \wd0 >0pt width \pdfimagewidth \fi
+      \ifdim \wd2 >0pt height \pdfimageheight \fi
+      \ifnum\pdftexversion<13
+         #1.\pdfimgext
+       \else
+         {#1.\pdfimgext}%
+       \fi
+    \ifnum\pdftexversion < 14 \else
+      \pdfrefximage \pdflastximage
+    \fi}
+  %
+  \def\pdfmkdest#1{{%
+    % We have to set dummies so commands such as @code, and characters
+    % such as \, aren't expanded when present in a section title.
+    \indexnofonts
+    \turnoffactive
+    \makevalueexpandable
+    \def\pdfdestname{#1}%
+    \txiescapepdf\pdfdestname
+    \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
+  }}
+  %
+  % used to mark target names; must be expandable.
+  \def\pdfmkpgn#1{#1}
+  %
+  % by default, use a color that is dark enough to print on paper as
+  % nearly black, but still distinguishable for online viewing.
+  \def\urlcolor{\rgbDarkRed}
+  \def\linkcolor{\rgbDarkRed}
+  \def\endlink{\setcolor{\maincolor}\pdfendlink}
+  %
+  % Adding outlines to PDF; macros for calculating structure of outlines
+  % come from Petr Olsak
+  \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
+    \else \csname#1\endcsname \fi}
+  \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
+    \advance\tempnum by 1
+    \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
+  %
+  % #1 is the section text, which is what will be displayed in the
+  % outline by the pdf viewer.  #2 is the pdf expression for the number
+  % of subentries (or empty, for subsubsections).  #3 is the node text,
+  % which might be empty if this toc entry had no corresponding node.
+  % #4 is the page number
+  %
+  \def\dopdfoutline#1#2#3#4{%
+    % Generate a link to the node text if that exists; else, use the
+    % page number.  We could generate a destination for the section
+    % text in the case where a section has no node, but it doesn't
+    % seem worth the trouble, since most documents are normally structured.
+    \edef\pdfoutlinedest{#3}%
+    \ifx\pdfoutlinedest\empty
+      \def\pdfoutlinedest{#4}%
+    \else
+      \txiescapepdf\pdfoutlinedest
+    \fi
+    %
+    % Also escape PDF chars in the display string.
+    \edef\pdfoutlinetext{#1}%
+    \txiescapepdf\pdfoutlinetext
+    %
+    \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
+  }
+  %
+  \def\pdfmakeoutlines{%
+    \begingroup
+      % Read toc silently, to get counts of subentries for \pdfoutline.
+      \def\partentry##1##2##3##4{}% ignore parts in the outlines
+      \def\numchapentry##1##2##3##4{%
+	\def\thischapnum{##2}%
+	\def\thissecnum{0}%
+	\def\thissubsecnum{0}%
+      }%
+      \def\numsecentry##1##2##3##4{%
+	\advancenumber{chap\thischapnum}%
+	\def\thissecnum{##2}%
+	\def\thissubsecnum{0}%
+      }%
+      \def\numsubsecentry##1##2##3##4{%
+	\advancenumber{sec\thissecnum}%
+	\def\thissubsecnum{##2}%
+      }%
+      \def\numsubsubsecentry##1##2##3##4{%
+	\advancenumber{subsec\thissubsecnum}%
+      }%
+      \def\thischapnum{0}%
+      \def\thissecnum{0}%
+      \def\thissubsecnum{0}%
+      %
+      % use \def rather than \let here because we redefine \chapentry et
+      % al. a second time, below.
+      \def\appentry{\numchapentry}%
+      \def\appsecentry{\numsecentry}%
+      \def\appsubsecentry{\numsubsecentry}%
+      \def\appsubsubsecentry{\numsubsubsecentry}%
+      \def\unnchapentry{\numchapentry}%
+      \def\unnsecentry{\numsecentry}%
+      \def\unnsubsecentry{\numsubsecentry}%
+      \def\unnsubsubsecentry{\numsubsubsecentry}%
+      \readdatafile{toc}%
+      %
+      % Read toc second time, this time actually producing the outlines.
+      % The `-' means take the \expnumber as the absolute number of
+      % subentries, which we calculated on our first read of the .toc above.
+      %
+      % We use the node names as the destinations.
+      \def\numchapentry##1##2##3##4{%
+        \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
+      \def\numsecentry##1##2##3##4{%
+        \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
+      \def\numsubsecentry##1##2##3##4{%
+        \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
+      \def\numsubsubsecentry##1##2##3##4{% count is always zero
+        \dopdfoutline{##1}{}{##3}{##4}}%
+      %
+      % PDF outlines are displayed using system fonts, instead of
+      % document fonts.  Therefore we cannot use special characters,
+      % since the encoding is unknown.  For example, the eogonek from
+      % Latin 2 (0xea) gets translated to a | character.  Info from
+      % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
+      %
+      % TODO this right, we have to translate 8-bit characters to
+      % their "best" equivalent, based on the @documentencoding.  Too
+      % much work for too little return.  Just use the ASCII equivalents
+      % we use for the index sort strings.
+      % 
+      \indexnofonts
+      \setupdatafile
+      % We can have normal brace characters in the PDF outlines, unlike
+      % Texinfo index files.  So set that up.
+      \def\{{\lbracecharliteral}%
+      \def\}{\rbracecharliteral}%
+      \catcode`\\=\active \otherbackslash
+      \input \tocreadfilename
+    \endgroup
+  }
+  {\catcode`[=1 \catcode`]=2
+   \catcode`{=\other \catcode`}=\other
+   \gdef\lbracecharliteral[{]%
+   \gdef\rbracecharliteral[}]%
+  ]
+  %
+  \def\skipspaces#1{\def\PP{#1}\def\D{|}%
+    \ifx\PP\D\let\nextsp\relax
+    \else\let\nextsp\skipspaces
+      \addtokens{\filename}{\PP}%
+      \advance\filenamelength by 1
+    \fi
+    \nextsp}
+  \def\getfilename#1{%
+    \filenamelength=0
+    % If we don't expand the argument now, \skipspaces will get
+    % snagged on things like "@value{foo}".
+    \edef\temp{#1}%
+    \expandafter\skipspaces\temp|\relax
+  }
+  \ifnum\pdftexversion < 14
+    \let \startlink \pdfannotlink
+  \else
+    \let \startlink \pdfstartlink
+  \fi
+  % make a live url in pdf output.
+  \def\pdfurl#1{%
+    \begingroup
+      % it seems we really need yet another set of dummies; have not
+      % tried to figure out what each command should do in the context
+      % of @url.  for now, just make @/ a no-op, that's the only one
+      % people have actually reported a problem with.
+      %
+      \normalturnoffactive
+      \def\@{@}%
+      \let\/=\empty
+      \makevalueexpandable
+      % do we want to go so far as to use \indexnofonts instead of just
+      % special-casing \var here?
+      \def\var##1{##1}%
+      %
+      \leavevmode\setcolor{\urlcolor}%
+      \startlink attr{/Border [0 0 0]}%
+        user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
+    \endgroup}
+  \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
+  \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+  \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
+  \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
+  \def\maketoks{%
+    \expandafter\poptoks\the\toksA|ENDTOKS|\relax
+    \ifx\first0\adn0
+    \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
+    \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
+    \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
+    \else
+      \ifnum0=\countA\else\makelink\fi
+      \ifx\first.\let\next=\done\else
+        \let\next=\maketoks
+        \addtokens{\toksB}{\the\toksD}
+        \ifx\first,\addtokens{\toksB}{\space}\fi
+      \fi
+    \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+    \next}
+  \def\makelink{\addtokens{\toksB}%
+    {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
+  \def\pdflink#1{%
+    \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
+    \setcolor{\linkcolor}#1\endlink}
+  \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
+\else
+  % non-pdf mode
+  \let\pdfmkdest = \gobble
+  \let\pdfurl = \gobble
+  \let\endlink = \relax
+  \let\setcolor = \gobble
+  \let\pdfsetcolor = \gobble
+  \let\pdfmakeoutlines = \relax
+\fi  % \ifx\pdfoutput
+
+
+\message{fonts,}
+
+% Change the current font style to #1, remembering it in \curfontstyle.
+% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
+% italics, not bold italics.
+%
+\def\setfontstyle#1{%
+  \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
+  \csname ten#1\endcsname  % change the current font
+}
+
+% Select #1 fonts with the current style.
+%
+\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
+
+\def\rm{\fam=0 \setfontstyle{rm}}
+\def\it{\fam=\itfam \setfontstyle{it}}
+\def\sl{\fam=\slfam \setfontstyle{sl}}
+\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
+\def\tt{\fam=\ttfam \setfontstyle{tt}}
+
+% Unfortunately, we have to override this for titles and the like, since
+% in those cases "rm" is bold.  Sigh.
+\def\rmisbold{\rm\def\curfontstyle{bf}}
+
+% Texinfo sort of supports the sans serif font style, which plain TeX does not.
+% So we set up a \sf.
+\newfam\sffam
+\def\sf{\fam=\sffam \setfontstyle{sf}}
+\let\li = \sf % Sometimes we call it \li, not \sf.
+
+% We don't need math for this font style.
+\def\ttsl{\setfontstyle{ttsl}}
+
+
+% Set the baselineskip to #1, and the lineskip and strut size
+% correspondingly.  There is no deep meaning behind these magic numbers
+% used as factors; they just match (closely enough) what Knuth defined.
+%
+\def\lineskipfactor{.08333}
+\def\strutheightpercent{.70833}
+\def\strutdepthpercent {.29167}
+%
+% can get a sort of poor man's double spacing by redefining this.
+\def\baselinefactor{1}
+%
+\newdimen\textleading
+\def\setleading#1{%
+  \dimen0 = #1\relax
+  \normalbaselineskip = \baselinefactor\dimen0
+  \normallineskip = \lineskipfactor\normalbaselineskip
+  \normalbaselines
+  \setbox\strutbox =\hbox{%
+    \vrule width0pt height\strutheightpercent\baselineskip
+                    depth \strutdepthpercent \baselineskip
+  }%
+}
+
+% PDF CMaps.  See also LaTeX's t1.cmap.
+%
+% do nothing with this by default.
+\expandafter\let\csname cmapOT1\endcsname\gobble
+\expandafter\let\csname cmapOT1IT\endcsname\gobble
+\expandafter\let\csname cmapOT1TT\endcsname\gobble
+
+% if we are producing pdf, and we have \pdffontattr, then define cmaps.
+% (\pdffontattr was introduced many years ago, but people still run
+% older pdftex's; it's easy to conditionalize, so we do.)
+\ifpdf \ifx\pdffontattr\thisisundefined \else
+  \begingroup
+    \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
+    \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-OT1-0)
+%%Title: (TeX-OT1-0 TeX OT1 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (OT1)
+/Supplement 0
+>> def
+/CMapName /TeX-OT1-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <7F>
+endcodespacerange
+8 beginbfrange
+<00> <01> <0393>
+<09> <0A> <03A8>
+<23> <26> <0023>
+<28> <3B> <0028>
+<3F> <5B> <003F>
+<5D> <5E> <005D>
+<61> <7A> <0061>
+<7B> <7C> <2013>
+endbfrange
+40 beginbfchar
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<07> <03D2>
+<08> <03A6>
+<0B> <00660066>
+<0C> <00660069>
+<0D> <0066006C>
+<0E> <006600660069>
+<0F> <00660066006C>
+<10> <0131>
+<11> <0237>
+<12> <0060>
+<13> <00B4>
+<14> <02C7>
+<15> <02D8>
+<16> <00AF>
+<17> <02DA>
+<18> <00B8>
+<19> <00DF>
+<1A> <00E6>
+<1B> <0153>
+<1C> <00F8>
+<1D> <00C6>
+<1E> <0152>
+<1F> <00D8>
+<21> <0021>
+<22> <201D>
+<27> <2019>
+<3C> <00A1>
+<3D> <003D>
+<3E> <00BF>
+<5C> <201C>
+<5F> <02D9>
+<60> <2018>
+<7D> <02DD>
+<7E> <007E>
+<7F> <00A8>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+    }\endgroup
+  \expandafter\edef\csname cmapOT1\endcsname#1{%
+    \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
+  }%
+%
+% \cmapOT1IT
+  \begingroup
+    \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
+    \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-OT1IT-0)
+%%Title: (TeX-OT1IT-0 TeX OT1IT 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (OT1IT)
+/Supplement 0
+>> def
+/CMapName /TeX-OT1IT-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <7F>
+endcodespacerange
+8 beginbfrange
+<00> <01> <0393>
+<09> <0A> <03A8>
+<25> <26> <0025>
+<28> <3B> <0028>
+<3F> <5B> <003F>
+<5D> <5E> <005D>
+<61> <7A> <0061>
+<7B> <7C> <2013>
+endbfrange
+42 beginbfchar
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<07> <03D2>
+<08> <03A6>
+<0B> <00660066>
+<0C> <00660069>
+<0D> <0066006C>
+<0E> <006600660069>
+<0F> <00660066006C>
+<10> <0131>
+<11> <0237>
+<12> <0060>
+<13> <00B4>
+<14> <02C7>
+<15> <02D8>
+<16> <00AF>
+<17> <02DA>
+<18> <00B8>
+<19> <00DF>
+<1A> <00E6>
+<1B> <0153>
+<1C> <00F8>
+<1D> <00C6>
+<1E> <0152>
+<1F> <00D8>
+<21> <0021>
+<22> <201D>
+<23> <0023>
+<24> <00A3>
+<27> <2019>
+<3C> <00A1>
+<3D> <003D>
+<3E> <00BF>
+<5C> <201C>
+<5F> <02D9>
+<60> <2018>
+<7D> <02DD>
+<7E> <007E>
+<7F> <00A8>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+    }\endgroup
+  \expandafter\edef\csname cmapOT1IT\endcsname#1{%
+    \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
+  }%
+%
+% \cmapOT1TT
+  \begingroup
+    \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
+    \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-OT1TT-0)
+%%Title: (TeX-OT1TT-0 TeX OT1TT 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (OT1TT)
+/Supplement 0
+>> def
+/CMapName /TeX-OT1TT-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <7F>
+endcodespacerange
+5 beginbfrange
+<00> <01> <0393>
+<09> <0A> <03A8>
+<21> <26> <0021>
+<28> <5F> <0028>
+<61> <7E> <0061>
+endbfrange
+32 beginbfchar
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<07> <03D2>
+<08> <03A6>
+<0B> <2191>
+<0C> <2193>
+<0D> <0027>
+<0E> <00A1>
+<0F> <00BF>
+<10> <0131>
+<11> <0237>
+<12> <0060>
+<13> <00B4>
+<14> <02C7>
+<15> <02D8>
+<16> <00AF>
+<17> <02DA>
+<18> <00B8>
+<19> <00DF>
+<1A> <00E6>
+<1B> <0153>
+<1C> <00F8>
+<1D> <00C6>
+<1E> <0152>
+<1F> <00D8>
+<20> <2423>
+<27> <2019>
+<60> <2018>
+<7F> <00A8>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+    }\endgroup
+  \expandafter\edef\csname cmapOT1TT\endcsname#1{%
+    \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
+  }%
+\fi\fi
+
+
+% Set the font macro #1 to the font named \fontprefix#2.
+% #3 is the font's design size, #4 is a scale factor, #5 is the CMap
+% encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
+% Example:
+% #1 = \textrm
+% #2 = \rmshape
+% #3 = 10
+% #4 = \mainmagstep
+% #5 = OT1
+%
+\def\setfont#1#2#3#4#5{%
+  \font#1=\fontprefix#2#3 scaled #4
+  \csname cmap#5\endcsname#1%
+}
+% This is what gets called when #5 of \setfont is empty.
+\let\cmap\gobble
+%
+% (end of cmaps)
+
+% Use cm as the default font prefix.
+% To specify the font prefix, you must define \fontprefix
+% before you read in texinfo.tex.
+\ifx\fontprefix\thisisundefined
+\def\fontprefix{cm}
+\fi
+% Support font families that don't use the same naming scheme as CM.
+\def\rmshape{r}
+\def\rmbshape{bx}               % where the normal face is bold
+\def\bfshape{b}
+\def\bxshape{bx}
+\def\ttshape{tt}
+\def\ttbshape{tt}
+\def\ttslshape{sltt}
+\def\itshape{ti}
+\def\itbshape{bxti}
+\def\slshape{sl}
+\def\slbshape{bxsl}
+\def\sfshape{ss}
+\def\sfbshape{ss}
+\def\scshape{csc}
+\def\scbshape{csc}
+
+% Definitions for a main text size of 11pt.  (The default in Texinfo.)
+%
+\def\definetextfontsizexi{%
+% Text fonts (11.2pt, magstep1).
+\def\textnominalsize{11pt}
+\edef\mainmagstep{\magstephalf}
+\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
+\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
+\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
+\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
+\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
+\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
+\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
+\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
+\font\texti=cmmi10 scaled \mainmagstep
+\font\textsy=cmsy10 scaled \mainmagstep
+\def\textecsize{1095}
+
+% A few fonts for @defun names and args.
+\setfont\defbf\bfshape{10}{\magstep1}{OT1}
+\setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
+\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
+
+% Fonts for indices, footnotes, small examples (9pt).
+\def\smallnominalsize{9pt}
+\setfont\smallrm\rmshape{9}{1000}{OT1}
+\setfont\smalltt\ttshape{9}{1000}{OT1TT}
+\setfont\smallbf\bfshape{10}{900}{OT1}
+\setfont\smallit\itshape{9}{1000}{OT1IT}
+\setfont\smallsl\slshape{9}{1000}{OT1}
+\setfont\smallsf\sfshape{9}{1000}{OT1}
+\setfont\smallsc\scshape{10}{900}{OT1}
+\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
+\font\smalli=cmmi9
+\font\smallsy=cmsy9
+\def\smallecsize{0900}
+
+% Fonts for small examples (8pt).
+\def\smallernominalsize{8pt}
+\setfont\smallerrm\rmshape{8}{1000}{OT1}
+\setfont\smallertt\ttshape{8}{1000}{OT1TT}
+\setfont\smallerbf\bfshape{10}{800}{OT1}
+\setfont\smallerit\itshape{8}{1000}{OT1IT}
+\setfont\smallersl\slshape{8}{1000}{OT1}
+\setfont\smallersf\sfshape{8}{1000}{OT1}
+\setfont\smallersc\scshape{10}{800}{OT1}
+\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
+\font\smalleri=cmmi8
+\font\smallersy=cmsy8
+\def\smallerecsize{0800}
+
+% Fonts for title page (20.4pt):
+\def\titlenominalsize{20pt}
+\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
+\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
+\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
+\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
+\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
+\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\titleecsize{2074}
+
+% Chapter (and unnumbered) fonts (17.28pt).
+\def\chapnominalsize{17pt}
+\setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
+\setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
+\setfont\chapsl\slbshape{10}{\magstep3}{OT1}
+\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
+\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
+\setfont\chapsf\sfbshape{17}{1000}{OT1}
+\let\chapbf=\chaprm
+\setfont\chapsc\scbshape{10}{\magstep3}{OT1}
+\font\chapi=cmmi12 scaled \magstep2
+\font\chapsy=cmsy10 scaled \magstep3
+\def\chapecsize{1728}
+
+% Section fonts (14.4pt).
+\def\secnominalsize{14pt}
+\setfont\secrm\rmbshape{12}{\magstep1}{OT1}
+\setfont\secit\itbshape{10}{\magstep2}{OT1IT}
+\setfont\secsl\slbshape{10}{\magstep2}{OT1}
+\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
+\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
+\setfont\secsf\sfbshape{12}{\magstep1}{OT1}
+\let\secbf\secrm
+\setfont\secsc\scbshape{10}{\magstep2}{OT1}
+\font\seci=cmmi12 scaled \magstep1
+\font\secsy=cmsy10 scaled \magstep2
+\def\sececsize{1440}
+
+% Subsection fonts (13.15pt).
+\def\ssecnominalsize{13pt}
+\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
+\setfont\ssecit\itbshape{10}{1315}{OT1IT}
+\setfont\ssecsl\slbshape{10}{1315}{OT1}
+\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
+\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
+\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
+\let\ssecbf\ssecrm
+\setfont\ssecsc\scbshape{10}{1315}{OT1}
+\font\sseci=cmmi12 scaled \magstephalf
+\font\ssecsy=cmsy10 scaled 1315
+\def\ssececsize{1200}
+
+% Reduced fonts for @acro in text (10pt).
+\def\reducednominalsize{10pt}
+\setfont\reducedrm\rmshape{10}{1000}{OT1}
+\setfont\reducedtt\ttshape{10}{1000}{OT1TT}
+\setfont\reducedbf\bfshape{10}{1000}{OT1}
+\setfont\reducedit\itshape{10}{1000}{OT1IT}
+\setfont\reducedsl\slshape{10}{1000}{OT1}
+\setfont\reducedsf\sfshape{10}{1000}{OT1}
+\setfont\reducedsc\scshape{10}{1000}{OT1}
+\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
+\font\reducedi=cmmi10
+\font\reducedsy=cmsy10
+\def\reducedecsize{1000}
+
+\textleading = 13.2pt % line spacing for 11pt CM
+\textfonts            % reset the current fonts
+\rm
+} % end of 11pt text font size definitions, \definetextfontsizexi
+
+
+% Definitions to make the main text be 10pt Computer Modern, with
+% section, chapter, etc., sizes following suit.  This is for the GNU
+% Press printing of the Emacs 22 manual.  Maybe other manuals in the
+% future.  Used with @smallbook, which sets the leading to 12pt.
+%
+\def\definetextfontsizex{%
+% Text fonts (10pt).
+\def\textnominalsize{10pt}
+\edef\mainmagstep{1000}
+\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
+\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
+\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
+\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
+\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
+\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
+\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
+\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
+\font\texti=cmmi10 scaled \mainmagstep
+\font\textsy=cmsy10 scaled \mainmagstep
+\def\textecsize{1000}
+
+% A few fonts for @defun names and args.
+\setfont\defbf\bfshape{10}{\magstephalf}{OT1}
+\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
+\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
+
+% Fonts for indices, footnotes, small examples (9pt).
+\def\smallnominalsize{9pt}
+\setfont\smallrm\rmshape{9}{1000}{OT1}
+\setfont\smalltt\ttshape{9}{1000}{OT1TT}
+\setfont\smallbf\bfshape{10}{900}{OT1}
+\setfont\smallit\itshape{9}{1000}{OT1IT}
+\setfont\smallsl\slshape{9}{1000}{OT1}
+\setfont\smallsf\sfshape{9}{1000}{OT1}
+\setfont\smallsc\scshape{10}{900}{OT1}
+\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
+\font\smalli=cmmi9
+\font\smallsy=cmsy9
+\def\smallecsize{0900}
+
+% Fonts for small examples (8pt).
+\def\smallernominalsize{8pt}
+\setfont\smallerrm\rmshape{8}{1000}{OT1}
+\setfont\smallertt\ttshape{8}{1000}{OT1TT}
+\setfont\smallerbf\bfshape{10}{800}{OT1}
+\setfont\smallerit\itshape{8}{1000}{OT1IT}
+\setfont\smallersl\slshape{8}{1000}{OT1}
+\setfont\smallersf\sfshape{8}{1000}{OT1}
+\setfont\smallersc\scshape{10}{800}{OT1}
+\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
+\font\smalleri=cmmi8
+\font\smallersy=cmsy8
+\def\smallerecsize{0800}
+
+% Fonts for title page (20.4pt):
+\def\titlenominalsize{20pt}
+\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
+\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
+\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
+\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
+\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
+\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\titleecsize{2074}
+
+% Chapter fonts (14.4pt).
+\def\chapnominalsize{14pt}
+\setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
+\setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
+\setfont\chapsl\slbshape{10}{\magstep2}{OT1}
+\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
+\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
+\setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
+\let\chapbf\chaprm
+\setfont\chapsc\scbshape{10}{\magstep2}{OT1}
+\font\chapi=cmmi12 scaled \magstep1
+\font\chapsy=cmsy10 scaled \magstep2
+\def\chapecsize{1440}
+
+% Section fonts (12pt).
+\def\secnominalsize{12pt}
+\setfont\secrm\rmbshape{12}{1000}{OT1}
+\setfont\secit\itbshape{10}{\magstep1}{OT1IT}
+\setfont\secsl\slbshape{10}{\magstep1}{OT1}
+\setfont\sectt\ttbshape{12}{1000}{OT1TT}
+\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
+\setfont\secsf\sfbshape{12}{1000}{OT1}
+\let\secbf\secrm
+\setfont\secsc\scbshape{10}{\magstep1}{OT1}
+\font\seci=cmmi12
+\font\secsy=cmsy10 scaled \magstep1
+\def\sececsize{1200}
+
+% Subsection fonts (10pt).
+\def\ssecnominalsize{10pt}
+\setfont\ssecrm\rmbshape{10}{1000}{OT1}
+\setfont\ssecit\itbshape{10}{1000}{OT1IT}
+\setfont\ssecsl\slbshape{10}{1000}{OT1}
+\setfont\ssectt\ttbshape{10}{1000}{OT1TT}
+\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
+\setfont\ssecsf\sfbshape{10}{1000}{OT1}
+\let\ssecbf\ssecrm
+\setfont\ssecsc\scbshape{10}{1000}{OT1}
+\font\sseci=cmmi10
+\font\ssecsy=cmsy10
+\def\ssececsize{1000}
+
+% Reduced fonts for @acro in text (9pt).
+\def\reducednominalsize{9pt}
+\setfont\reducedrm\rmshape{9}{1000}{OT1}
+\setfont\reducedtt\ttshape{9}{1000}{OT1TT}
+\setfont\reducedbf\bfshape{10}{900}{OT1}
+\setfont\reducedit\itshape{9}{1000}{OT1IT}
+\setfont\reducedsl\slshape{9}{1000}{OT1}
+\setfont\reducedsf\sfshape{9}{1000}{OT1}
+\setfont\reducedsc\scshape{10}{900}{OT1}
+\setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
+\font\reducedi=cmmi9
+\font\reducedsy=cmsy9
+\def\reducedecsize{0900}
+
+\divide\parskip by 2  % reduce space between paragraphs
+\textleading = 12pt   % line spacing for 10pt CM
+\textfonts            % reset the current fonts
+\rm
+} % end of 10pt text font size definitions, \definetextfontsizex
+
+
+% We provide the user-level command
+%   @fonttextsize 10
+% (or 11) to redefine the text font size.  pt is assumed.
+%
+\def\xiword{11}
+\def\xword{10}
+\def\xwordpt{10pt}
+%
+\parseargdef\fonttextsize{%
+  \def\textsizearg{#1}%
+  %\wlog{doing @fonttextsize \textsizearg}%
+  %
+  % Set \globaldefs so that documents can use this inside @tex, since
+  % makeinfo 4.8 does not support it, but we need it nonetheless.
+  %
+ \begingroup \globaldefs=1
+  \ifx\textsizearg\xword \definetextfontsizex
+  \else \ifx\textsizearg\xiword \definetextfontsizexi
+  \else
+    \errhelp=\EMsimple
+    \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
+  \fi\fi
+ \endgroup
+}
+
+
+% In order for the font changes to affect most math symbols and letters,
+% we have to define the \textfont of the standard families.  Since
+% texinfo doesn't allow for producing subscripts and superscripts except
+% in the main text, we don't bother to reset \scriptfont and
+% \scriptscriptfont (which would also require loading a lot more fonts).
+%
+\def\resetmathfonts{%
+  \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
+  \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
+  \textfont\ttfam=\tentt \textfont\sffam=\tensf
+}
+
+% The font-changing commands redefine the meanings of \tenSTYLE, instead
+% of just \STYLE.  We do this because \STYLE needs to also set the
+% current \fam for math mode.  Our \STYLE (e.g., \rm) commands hardwire
+% \tenSTYLE to set the current font.
+%
+% Each font-changing command also sets the names \lsize (one size lower)
+% and \lllsize (three sizes lower).  These relative commands are used in
+% the LaTeX logo and acronyms.
+%
+% This all needs generalizing, badly.
+%
+\def\textfonts{%
+  \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
+  \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
+  \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
+  \let\tenttsl=\textttsl
+  \def\curfontsize{text}%
+  \def\lsize{reduced}\def\lllsize{smaller}%
+  \resetmathfonts \setleading{\textleading}}
+\def\titlefonts{%
+  \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
+  \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
+  \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
+  \let\tenttsl=\titlettsl
+  \def\curfontsize{title}%
+  \def\lsize{chap}\def\lllsize{subsec}%
+  \resetmathfonts \setleading{27pt}}
+\def\titlefont#1{{\titlefonts\rmisbold #1}}
+\def\chapfonts{%
+  \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
+  \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
+  \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
+  \let\tenttsl=\chapttsl
+  \def\curfontsize{chap}%
+  \def\lsize{sec}\def\lllsize{text}%
+  \resetmathfonts \setleading{19pt}}
+\def\secfonts{%
+  \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
+  \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
+  \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
+  \let\tenttsl=\secttsl
+  \def\curfontsize{sec}%
+  \def\lsize{subsec}\def\lllsize{reduced}%
+  \resetmathfonts \setleading{16pt}}
+\def\subsecfonts{%
+  \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
+  \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
+  \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
+  \let\tenttsl=\ssecttsl
+  \def\curfontsize{ssec}%
+  \def\lsize{text}\def\lllsize{small}%
+  \resetmathfonts \setleading{15pt}}
+\let\subsubsecfonts = \subsecfonts
+\def\reducedfonts{%
+  \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
+  \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
+  \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
+  \let\tenttsl=\reducedttsl
+  \def\curfontsize{reduced}%
+  \def\lsize{small}\def\lllsize{smaller}%
+  \resetmathfonts \setleading{10.5pt}}
+\def\smallfonts{%
+  \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
+  \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
+  \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
+  \let\tenttsl=\smallttsl
+  \def\curfontsize{small}%
+  \def\lsize{smaller}\def\lllsize{smaller}%
+  \resetmathfonts \setleading{10.5pt}}
+\def\smallerfonts{%
+  \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
+  \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
+  \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
+  \let\tenttsl=\smallerttsl
+  \def\curfontsize{smaller}%
+  \def\lsize{smaller}\def\lllsize{smaller}%
+  \resetmathfonts \setleading{9.5pt}}
+
+% Fonts for short table of contents.
+\setfont\shortcontrm\rmshape{12}{1000}{OT1}
+\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1}  % no cmb12
+\setfont\shortcontsl\slshape{12}{1000}{OT1}
+\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
+
+% Define these just so they can be easily changed for other fonts.
+\def\angleleft{$\langle$}
+\def\angleright{$\rangle$}
+
+% Set the fonts to use with the @small... environments.
+\let\smallexamplefonts = \smallfonts
+
+% About \smallexamplefonts.  If we use \smallfonts (9pt), @smallexample
+% can fit this many characters:
+%   8.5x11=86   smallbook=72  a4=90  a5=69
+% If we use \scriptfonts (8pt), then we can fit this many characters:
+%   8.5x11=90+  smallbook=80  a4=90+  a5=77
+% For me, subjectively, the few extra characters that fit aren't worth
+% the additional smallness of 8pt.  So I'm making the default 9pt.
+%
+% By the way, for comparison, here's what fits with @example (10pt):
+%   8.5x11=71  smallbook=60  a4=75  a5=58
+% --karl, 24jan03.
+
+% Set up the default fonts, so we can use them for creating boxes.
+%
+\definetextfontsizexi
+
+
+\message{markup,}
+
+% Check if we are currently using a typewriter font.  Since all the
+% Computer Modern typewriter fonts have zero interword stretch (and
+% shrink), and it is reasonable to expect all typewriter fonts to have
+% this property, we can check that font parameter.
+%
+\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
+
+% Markup style infrastructure.  \defmarkupstylesetup\INITMACRO will
+% define and register \INITMACRO to be called on markup style changes.
+% \INITMACRO can check \currentmarkupstyle for the innermost
+% style and the set of \ifmarkupSTYLE switches for all styles
+% currently in effect.
+\newif\ifmarkupvar
+\newif\ifmarkupsamp
+\newif\ifmarkupkey
+%\newif\ifmarkupfile % @file == @samp.
+%\newif\ifmarkupoption % @option == @samp.
+\newif\ifmarkupcode
+\newif\ifmarkupkbd
+%\newif\ifmarkupenv % @env == @code.
+%\newif\ifmarkupcommand % @command == @code.
+\newif\ifmarkuptex % @tex (and part of @math, for now).
+\newif\ifmarkupexample
+\newif\ifmarkupverb
+\newif\ifmarkupverbatim
+
+\let\currentmarkupstyle\empty
+
+\def\setupmarkupstyle#1{%
+  \csname markup#1true\endcsname
+  \def\currentmarkupstyle{#1}%
+  \markupstylesetup
+}
+
+\let\markupstylesetup\empty
+
+\def\defmarkupstylesetup#1{%
+  \expandafter\def\expandafter\markupstylesetup
+    \expandafter{\markupstylesetup #1}%
+  \def#1%
+}
+
+% Markup style setup for left and right quotes.
+\defmarkupstylesetup\markupsetuplq{%
+  \expandafter\let\expandafter \temp
+    \csname markupsetuplq\currentmarkupstyle\endcsname
+  \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
+}
+
+\defmarkupstylesetup\markupsetuprq{%
+  \expandafter\let\expandafter \temp
+    \csname markupsetuprq\currentmarkupstyle\endcsname
+  \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
+}
+
+{
+\catcode`\'=\active
+\catcode`\`=\active
+
+\gdef\markupsetuplqdefault{\let`\lq}
+\gdef\markupsetuprqdefault{\let'\rq}
+
+\gdef\markupsetcodequoteleft{\let`\codequoteleft}
+\gdef\markupsetcodequoteright{\let'\codequoteright}
+}
+
+\let\markupsetuplqcode \markupsetcodequoteleft
+\let\markupsetuprqcode \markupsetcodequoteright
+%
+\let\markupsetuplqexample \markupsetcodequoteleft
+\let\markupsetuprqexample \markupsetcodequoteright
+%
+\let\markupsetuplqkbd     \markupsetcodequoteleft
+\let\markupsetuprqkbd     \markupsetcodequoteright
+%
+\let\markupsetuplqsamp \markupsetcodequoteleft
+\let\markupsetuprqsamp \markupsetcodequoteright
+%
+\let\markupsetuplqverb \markupsetcodequoteleft
+\let\markupsetuprqverb \markupsetcodequoteright
+%
+\let\markupsetuplqverbatim \markupsetcodequoteleft
+\let\markupsetuprqverbatim \markupsetcodequoteright
+
+% Allow an option to not use regular directed right quote/apostrophe
+% (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
+% The undirected quote is ugly, so don't make it the default, but it
+% works for pasting with more pdf viewers (at least evince), the
+% lilypond developers report.  xpdf does work with the regular 0x27.
+%
+\def\codequoteright{%
+  \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
+    \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
+      '%
+    \else \char'15 \fi
+  \else \char'15 \fi
+}
+%
+% and a similar option for the left quote char vs. a grave accent.
+% Modern fonts display ASCII 0x60 as a grave accent, so some people like
+% the code environments to do likewise.
+%
+\def\codequoteleft{%
+  \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
+    \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
+      % [Knuth] pp. 380,381,391
+      % \relax disables Spanish ligatures ?` and !` of \tt font.
+      \relax`%
+    \else \char'22 \fi
+  \else \char'22 \fi
+}
+
+% Commands to set the quote options.
+% 
+\parseargdef\codequoteundirected{%
+  \def\temp{#1}%
+  \ifx\temp\onword
+    \expandafter\let\csname SETtxicodequoteundirected\endcsname
+      = t%
+  \else\ifx\temp\offword
+    \expandafter\let\csname SETtxicodequoteundirected\endcsname
+      = \relax
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
+  \fi\fi
+}
+%
+\parseargdef\codequotebacktick{%
+  \def\temp{#1}%
+  \ifx\temp\onword
+    \expandafter\let\csname SETtxicodequotebacktick\endcsname
+      = t%
+  \else\ifx\temp\offword
+    \expandafter\let\csname SETtxicodequotebacktick\endcsname
+      = \relax
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
+  \fi\fi
+}
+
+% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
+\def\noligaturesquoteleft{\relax\lq}
+
+% Count depth in font-changes, for error checks
+\newcount\fontdepth \fontdepth=0
+
+% Font commands.
+
+% #1 is the font command (\sl or \it), #2 is the text to slant.
+% If we are in a monospaced environment, however, 1) always use \ttsl,
+% and 2) do not add an italic correction.
+\def\dosmartslant#1#2{%
+  \ifusingtt 
+    {{\ttsl #2}\let\next=\relax}%
+    {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
+  \next
+}
+\def\smartslanted{\dosmartslant\sl}
+\def\smartitalic{\dosmartslant\it}
+
+% Output an italic correction unless \next (presumed to be the following
+% character) is such as not to need one.
+\def\smartitaliccorrection{%
+  \ifx\next,%
+  \else\ifx\next-%
+  \else\ifx\next.%
+  \else\ptexslash
+  \fi\fi\fi
+  \aftersmartic
+}
+
+% Unconditional use \ttsl, and no ic.  @var is set to this for defuns.
+\def\ttslanted#1{{\ttsl #1}}
+
+% @cite is like \smartslanted except unconditionally use \sl.  We never want
+% ttsl for book titles, do we?
+\def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
+
+\def\aftersmartic{}
+\def\var#1{%
+  \let\saveaftersmartic = \aftersmartic
+  \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
+  \smartslanted{#1}%
+}
+
+\let\i=\smartitalic
+\let\slanted=\smartslanted
+\let\dfn=\smartslanted
+\let\emph=\smartitalic
+
+% Explicit font changes: @r, @sc, undocumented @ii.
+\def\r#1{{\rm #1}}              % roman font
+\def\sc#1{{\smallcaps#1}}       % smallcaps font
+\def\ii#1{{\it #1}}             % italic font
+
+% @b, explicit bold.  Also @strong.
+\def\b#1{{\bf #1}}
+\let\strong=\b
+
+% @sansserif, explicit sans.
+\def\sansserif#1{{\sf #1}}
+
+% We can't just use \exhyphenpenalty, because that only has effect at
+% the end of a paragraph.  Restore normal hyphenation at the end of the
+% group within which \nohyphenation is presumably called.
+%
+\def\nohyphenation{\hyphenchar\font = -1  \aftergroup\restorehyphenation}
+\def\restorehyphenation{\hyphenchar\font = `- }
+
+% Set sfcode to normal for the chars that usually have another value.
+% Can't use plain's \frenchspacing because it uses the `\x notation, and
+% sometimes \x has an active definition that messes things up.
+%
+\catcode`@=11
+  \def\plainfrenchspacing{%
+    \sfcode\dotChar  =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
+    \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
+    \def\endofsentencespacefactor{1000}% for @. and friends
+  }
+  \def\plainnonfrenchspacing{%
+    \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
+    \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
+    \def\endofsentencespacefactor{3000}% for @. and friends
+  }
+\catcode`@=\other
+\def\endofsentencespacefactor{3000}% default
+
+% @t, explicit typewriter.
+\def\t#1{%
+  {\tt \rawbackslash \plainfrenchspacing #1}%
+  \null
+}
+
+% @samp.
+\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
+
+% @indicateurl is \samp, that is, with quotes.
+\let\indicateurl=\samp
+
+% @code (and similar) prints in typewriter, but with spaces the same
+% size as normal in the surrounding text, without hyphenation, etc.
+% This is a subroutine for that.
+\def\tclose#1{%
+  {%
+    % Change normal interword space to be same as for the current font.
+    \spaceskip = \fontdimen2\font
+    %
+    % Switch to typewriter.
+    \tt
+    %
+    % But `\ ' produces the large typewriter interword space.
+    \def\ {{\spaceskip = 0pt{} }}%
+    %
+    % Turn off hyphenation.
+    \nohyphenation
+    %
+    \rawbackslash
+    \plainfrenchspacing
+    #1%
+  }%
+  \null % reset spacefactor to 1000
+}
+
+% We *must* turn on hyphenation at `-' and `_' in @code.
+% Otherwise, it is too hard to avoid overfull hboxes
+% in the Emacs manual, the Library manual, etc.
+%
+% Unfortunately, TeX uses one parameter (\hyphenchar) to control
+% both hyphenation at - and hyphenation within words.
+% We must therefore turn them both off (\tclose does that)
+% and arrange explicitly to hyphenate at a dash.
+%  -- rms.
+{
+  \catcode`\-=\active \catcode`\_=\active
+  \catcode`\'=\active \catcode`\`=\active
+  \global\let'=\rq \global\let`=\lq  % default definitions
+  %
+  \global\def\code{\begingroup
+    \setupmarkupstyle{code}%
+    % The following should really be moved into \setupmarkupstyle handlers.
+    \catcode\dashChar=\active  \catcode\underChar=\active
+    \ifallowcodebreaks
+     \let-\codedash
+     \let_\codeunder
+    \else
+     \let-\normaldash
+     \let_\realunder
+    \fi
+    \codex
+  }
+}
+
+\def\codex #1{\tclose{#1}\endgroup}
+
+\def\normaldash{-}
+\def\codedash{-\discretionary{}{}{}}
+\def\codeunder{%
+  % this is all so @math{@code{var_name}+1} can work.  In math mode, _
+  % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
+  % will therefore expand the active definition of _, which is us
+  % (inside @code that is), therefore an endless loop.
+  \ifusingtt{\ifmmode
+               \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
+             \else\normalunderscore \fi
+             \discretionary{}{}{}}%
+            {\_}%
+}
+
+% An additional complication: the above will allow breaks after, e.g.,
+% each of the four underscores in __typeof__.  This is bad.
+% @allowcodebreaks provides a document-level way to turn breaking at -
+% and _ on and off.
+%
+\newif\ifallowcodebreaks  \allowcodebreakstrue
+
+\def\keywordtrue{true}
+\def\keywordfalse{false}
+
+\parseargdef\allowcodebreaks{%
+  \def\txiarg{#1}%
+  \ifx\txiarg\keywordtrue
+    \allowcodebreakstrue
+  \else\ifx\txiarg\keywordfalse
+    \allowcodebreaksfalse
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
+  \fi\fi
+}
+
+% For @command, @env, @file, @option quotes seem unnecessary,
+% so use \code rather than \samp.
+\let\command=\code
+\let\env=\code
+\let\file=\code
+\let\option=\code
+
+% @uref (abbreviation for `urlref') takes an optional (comma-separated)
+% second argument specifying the text to display and an optional third
+% arg as text to display instead of (rather than in addition to) the url
+% itself.  First (mandatory) arg is the url.
+% (This \urefnobreak definition isn't used now, leaving it for a while
+% for comparison.)
+\def\urefnobreak#1{\dourefnobreak #1,,,\finish}
+\def\dourefnobreak#1,#2,#3,#4\finish{\begingroup
+  \unsepspaces
+  \pdfurl{#1}%
+  \setbox0 = \hbox{\ignorespaces #3}%
+  \ifdim\wd0 > 0pt
+    \unhbox0 % third arg given, show only that
+  \else
+    \setbox0 = \hbox{\ignorespaces #2}%
+    \ifdim\wd0 > 0pt
+      \ifpdf
+        \unhbox0             % PDF: 2nd arg given, show only it
+      \else
+        \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
+      \fi
+    \else
+      \code{#1}% only url given, so show it
+    \fi
+  \fi
+  \endlink
+\endgroup}
+
+% This \urefbreak definition is the active one.
+\def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
+\let\uref=\urefbreak
+\def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
+\def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
+  \unsepspaces
+  \pdfurl{#1}%
+  \setbox0 = \hbox{\ignorespaces #3}%
+  \ifdim\wd0 > 0pt
+    \unhbox0 % third arg given, show only that
+  \else
+    \setbox0 = \hbox{\ignorespaces #2}%
+    \ifdim\wd0 > 0pt
+      \ifpdf
+        \unhbox0             % PDF: 2nd arg given, show only it
+      \else
+        \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url
+      \fi
+    \else
+      \urefcode{#1}% only url given, so show it
+    \fi
+  \fi
+  \endlink
+\endgroup}
+
+% Allow line breaks around only a few characters (only).
+\def\urefcatcodes{%
+  \catcode\ampChar=\active   \catcode\dotChar=\active
+  \catcode\hashChar=\active  \catcode\questChar=\active
+  \catcode\slashChar=\active
+}
+{
+  \urefcatcodes
+  %
+  \global\def\urefcode{\begingroup
+    \setupmarkupstyle{code}%
+    \urefcatcodes
+    \let&\urefcodeamp
+    \let.\urefcodedot
+    \let#\urefcodehash
+    \let?\urefcodequest
+    \let/\urefcodeslash
+    \codex
+  }
+  %
+  % By default, they are just regular characters.
+  \global\def&{\normalamp}
+  \global\def.{\normaldot}
+  \global\def#{\normalhash}
+  \global\def?{\normalquest}
+  \global\def/{\normalslash}
+}
+
+% we put a little stretch before and after the breakable chars, to help
+% line breaking of long url's.  The unequal skips make look better in
+% cmtt at least, especially for dots.
+\def\urefprestretch{\urefprebreak \hskip0pt plus.13em }
+\def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em }
+%
+\def\urefcodeamp{\urefprestretch \&\urefpoststretch}
+\def\urefcodedot{\urefprestretch .\urefpoststretch}
+\def\urefcodehash{\urefprestretch \#\urefpoststretch}
+\def\urefcodequest{\urefprestretch ?\urefpoststretch}
+\def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
+{
+  \catcode`\/=\active
+  \global\def\urefcodeslashfinish{%
+    \urefprestretch \slashChar
+    % Allow line break only after the final / in a sequence of
+    % slashes, to avoid line break between the slashes in http://.
+    \ifx\next/\else \urefpoststretch \fi
+  }
+}
+
+% One more complication: by default we'll break after the special
+% characters, but some people like to break before the special chars, so
+% allow that.  Also allow no breaking at all, for manual control.
+% 
+\parseargdef\urefbreakstyle{%
+  \def\txiarg{#1}%
+  \ifx\txiarg\wordnone
+    \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
+  \else\ifx\txiarg\wordbefore
+    \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
+  \else\ifx\txiarg\wordafter
+    \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
+  \fi\fi\fi
+}
+\def\wordafter{after}
+\def\wordbefore{before}
+\def\wordnone{none}
+
+\urefbreakstyle after
+
+% @url synonym for @uref, since that's how everyone uses it.
+%
+\let\url=\uref
+
+% rms does not like angle brackets --karl, 17may97.
+% So now @email is just like @uref, unless we are pdf.
+%
+%\def\email#1{\angleleft{\tt #1}\angleright}
+\ifpdf
+  \def\email#1{\doemail#1,,\finish}
+  \def\doemail#1,#2,#3\finish{\begingroup
+    \unsepspaces
+    \pdfurl{mailto:#1}%
+    \setbox0 = \hbox{\ignorespaces #2}%
+    \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
+    \endlink
+  \endgroup}
+\else
+  \let\email=\uref
+\fi
+
+% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
+%   `example' (@kbd uses ttsl only inside of @example and friends),
+%   or `code' (@kbd uses normal tty font always).
+\parseargdef\kbdinputstyle{%
+  \def\txiarg{#1}%
+  \ifx\txiarg\worddistinct
+    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
+  \else\ifx\txiarg\wordexample
+    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
+  \else\ifx\txiarg\wordcode
+    \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
+  \fi\fi\fi
+}
+\def\worddistinct{distinct}
+\def\wordexample{example}
+\def\wordcode{code}
+
+% Default is `distinct'.
+\kbdinputstyle distinct
+
+% @kbd is like @code, except that if the argument is just one @key command,
+% then @kbd has no effect.
+\def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
+
+\def\xkey{\key}
+\def\kbdsub#1#2#3\par{%
+  \def\one{#1}\def\three{#3}\def\threex{??}%
+  \ifx\one\xkey\ifx\threex\three \key{#2}%
+  \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
+  \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
+}
+
+% definition of @key that produces a lozenge.  Doesn't adjust to text size.
+%\setfont\keyrm\rmshape{8}{1000}{OT1}
+%\font\keysy=cmsy9
+%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
+%  \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
+%    \vbox{\hrule\kern-0.4pt
+%     \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
+%    \kern-0.4pt\hrule}%
+%  \kern-.06em\raise0.4pt\hbox{\angleright}}}}
+
+% definition of @key with no lozenge.  If the current font is already
+% monospace, don't change it; that way, we respect @kbdinputstyle.  But
+% if it isn't monospace, then use \tt.
+%
+\def\key#1{{\setupmarkupstyle{key}%
+  \nohyphenation
+  \ifmonospace\else\tt\fi
+  #1}\null}
+
+% @clicksequence{File @click{} Open ...}
+\def\clicksequence#1{\begingroup #1\endgroup}
+
+% @clickstyle @arrow   (by default)
+\parseargdef\clickstyle{\def\click{#1}}
+\def\click{\arrow}
+
+% Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
+% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
+%
+\def\dmn#1{\thinspace #1}
+
+% @l was never documented to mean ``switch to the Lisp font'',
+% and it is not used as such in any manual I can find.  We need it for
+% Polish suppressed-l.  --karl, 22sep96.
+%\def\l#1{{\li #1}\null}
+
+% @acronym for "FBI", "NATO", and the like.
+% We print this one point size smaller, since it's intended for
+% all-uppercase.
+%
+\def\acronym#1{\doacronym #1,,\finish}
+\def\doacronym#1,#2,#3\finish{%
+  {\selectfonts\lsize #1}%
+  \def\temp{#2}%
+  \ifx\temp\empty \else
+    \space ({\unsepspaces \ignorespaces \temp \unskip})%
+  \fi
+  \null % reset \spacefactor=1000
+}
+
+% @abbr for "Comput. J." and the like.
+% No font change, but don't do end-of-sentence spacing.
+%
+\def\abbr#1{\doabbr #1,,\finish}
+\def\doabbr#1,#2,#3\finish{%
+  {\plainfrenchspacing #1}%
+  \def\temp{#2}%
+  \ifx\temp\empty \else
+    \space ({\unsepspaces \ignorespaces \temp \unskip})%
+  \fi
+  \null % reset \spacefactor=1000
+}
+
+% @asis just yields its argument.  Used with @table, for example.
+%
+\def\asis#1{#1}
+
+% @math outputs its argument in math mode.
+%
+% One complication: _ usually means subscripts, but it could also mean
+% an actual _ character, as in @math{@var{some_variable} + 1}.  So make
+% _ active, and distinguish by seeing if the current family is \slfam,
+% which is what @var uses.
+{
+  \catcode`\_ = \active
+  \gdef\mathunderscore{%
+    \catcode`\_=\active
+    \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
+  }
+}
+% Another complication: we want \\ (and @\) to output a math (or tt) \.
+% FYI, plain.tex uses \\ as a temporary control sequence (for no
+% particular reason), but this is not advertised and we don't care.
+%
+% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
+\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
+%
+\def\math{%
+  \tex
+  \mathunderscore
+  \let\\ = \mathbackslash
+  \mathactive
+  % make the texinfo accent commands work in math mode
+  \let\"=\ddot
+  \let\'=\acute
+  \let\==\bar
+  \let\^=\hat
+  \let\`=\grave
+  \let\u=\breve
+  \let\v=\check
+  \let\~=\tilde
+  \let\dotaccent=\dot
+  $\finishmath
+}
+\def\finishmath#1{#1$\endgroup}  % Close the group opened by \tex.
+
+% Some active characters (such as <) are spaced differently in math.
+% We have to reset their definitions in case the @math was an argument
+% to a command which sets the catcodes (such as @item or @section).
+%
+{
+  \catcode`^ = \active
+  \catcode`< = \active
+  \catcode`> = \active
+  \catcode`+ = \active
+  \catcode`' = \active
+  \gdef\mathactive{%
+    \let^ = \ptexhat
+    \let< = \ptexless
+    \let> = \ptexgtr
+    \let+ = \ptexplus
+    \let' = \ptexquoteright
+  }
+}
+
+% ctrl is no longer a Texinfo command, but leave this definition for fun.
+\def\ctrl #1{{\tt \rawbackslash \hat}#1}
+
+% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
+% Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
+% except specified as a normal braced arg, so no newlines to worry about.
+% 
+\def\outfmtnametex{tex}
+%
+\long\def\inlinefmt#1{\doinlinefmt #1,\finish}
+\long\def\doinlinefmt#1,#2,\finish{%
+  \def\inlinefmtname{#1}%
+  \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
+}
+% For raw, must switch into @tex before parsing the argument, to avoid
+% setting catcodes prematurely.  Doing it this way means that, for
+% example, @inlineraw{html, foo{bar} gets a parse error instead of being
+% ignored.  But this isn't important because if people want a literal
+% *right* brace they would have to use a command anyway, so they may as
+% well use a command to get a left brace too.  We could re-use the
+% delimiter character idea from \verb, but it seems like overkill.
+% 
+\long\def\inlineraw{\tex \doinlineraw}
+\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
+\def\doinlinerawtwo#1,#2,\finish{%
+  \def\inlinerawname{#1}%
+  \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
+  \endgroup % close group opened by \tex.
+}
+
+
+\message{glyphs,}
+% and logos.
+
+% @@ prints an @, as does @atchar{}.
+\def\@{\char64 }
+\let\atchar=\@
+
+% @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
+% Unless we're in typewriter, use \ecfont because the CM text fonts do
+% not have braces, and we don't want to switch into math.
+\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
+\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
+\let\{=\mylbrace \let\lbracechar=\{
+\let\}=\myrbrace \let\rbracechar=\}
+\begingroup
+  % Definitions to produce \{ and \} commands for indices,
+  % and @{ and @} for the aux/toc files.
+  \catcode`\{ = \other \catcode`\} = \other
+  \catcode`\[ = 1 \catcode`\] = 2
+  \catcode`\! = 0 \catcode`\\ = \other
+  !gdef!lbracecmd[\{]%
+  !gdef!rbracecmd[\}]%
+  !gdef!lbraceatcmd[@{]%
+  !gdef!rbraceatcmd[@}]%
+!endgroup
+
+% @comma{} to avoid , parsing problems.
+\let\comma = ,
+
+% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
+% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
+\let\, = \ptexc
+\let\dotaccent = \ptexdot
+\def\ringaccent#1{{\accent23 #1}}
+\let\tieaccent = \ptext
+\let\ubaraccent = \ptexb
+\let\udotaccent = \d
+
+% Other special characters: @questiondown @exclamdown @ordf @ordm
+% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
+\def\questiondown{?`}
+\def\exclamdown{!`}
+\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
+\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
+
+% Dotless i and dotless j, used for accents.
+\def\imacro{i}
+\def\jmacro{j}
+\def\dotless#1{%
+  \def\temp{#1}%
+  \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
+  \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
+  \else \errmessage{@dotless can be used only with i or j}%
+  \fi\fi
+}
+
+% The \TeX{} logo, as in plain, but resetting the spacing so that a
+% period following counts as ending a sentence.  (Idea found in latex.)
+%
+\edef\TeX{\TeX \spacefactor=1000 }
+
+% @LaTeX{} logo.  Not quite the same results as the definition in
+% latex.ltx, since we use a different font for the raised A; it's most
+% convenient for us to use an explicitly smaller font, rather than using
+% the \scriptstyle font (since we don't reset \scriptstyle and
+% \scriptscriptstyle).
+%
+\def\LaTeX{%
+  L\kern-.36em
+  {\setbox0=\hbox{T}%
+   \vbox to \ht0{\hbox{%
+     \ifx\textnominalsize\xwordpt
+       % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
+       % Revert to plain's \scriptsize, which is 7pt.
+       \count255=\the\fam $\fam\count255 \scriptstyle A$%
+     \else
+       % For 11pt, we can use our lllsize.
+       \selectfonts\lllsize A%
+     \fi
+     }%
+     \vss
+  }}%
+  \kern-.15em
+  \TeX
+}
+
+% Some math mode symbols.
+\def\bullet{$\ptexbullet$}
+\def\geq{\ifmmode \ge\else $\ge$\fi}
+\def\leq{\ifmmode \le\else $\le$\fi}
+\def\minus{\ifmmode -\else $-$\fi}
+
+% @dots{} outputs an ellipsis using the current font.
+% We do .5em per period so that it has the same spacing in the cm
+% typewriter fonts as three actual period characters; on the other hand,
+% in other typewriter fonts three periods are wider than 1.5em.  So do
+% whichever is larger.
+%
+\def\dots{%
+  \leavevmode
+  \setbox0=\hbox{...}% get width of three periods
+  \ifdim\wd0 > 1.5em
+    \dimen0 = \wd0
+  \else
+    \dimen0 = 1.5em
+  \fi
+  \hbox to \dimen0{%
+    \hskip 0pt plus.25fil
+    .\hskip 0pt plus1fil
+    .\hskip 0pt plus1fil
+    .\hskip 0pt plus.5fil
+  }%
+}
+
+% @enddots{} is an end-of-sentence ellipsis.
+%
+\def\enddots{%
+  \dots
+  \spacefactor=\endofsentencespacefactor
+}
+
+% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
+%
+% Since these characters are used in examples, they should be an even number of
+% \tt widths. Each \tt character is 1en, so two makes it 1em.
+%
+\def\point{$\star$}
+\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
+\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
+\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
+\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
+\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
+
+% The @error{} command.
+% Adapted from the TeXbook's \boxit.
+%
+\newbox\errorbox
+%
+{\tentt \global\dimen0 = 3em}% Width of the box.
+\dimen2 = .55pt % Thickness of rules
+% The text. (`r' is open on the right, `e' somewhat less so on the left.)
+\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
+%
+\setbox\errorbox=\hbox to \dimen0{\hfil
+   \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
+   \advance\hsize by -2\dimen2 % Rules.
+   \vbox{%
+      \hrule height\dimen2
+      \hbox{\vrule width\dimen2 \kern3pt          % Space to left of text.
+         \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
+         \kern3pt\vrule width\dimen2}% Space to right.
+      \hrule height\dimen2}
+    \hfil}
+%
+\def\error{\leavevmode\lower.7ex\copy\errorbox}
+
+% @pounds{} is a sterling sign, which Knuth put in the CM italic font.
+%
+\def\pounds{{\it\$}}
+
+% @euro{} comes from a separate font, depending on the current style.
+% We use the free feym* fonts from the eurosym package by Henrik
+% Theiling, which support regular, slanted, bold and bold slanted (and
+% "outlined" (blackboard board, sort of) versions, which we don't need).
+% It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
+%
+% Although only regular is the truly official Euro symbol, we ignore
+% that.  The Euro is designed to be slightly taller than the regular
+% font height.
+%
+% feymr - regular
+% feymo - slanted
+% feybr - bold
+% feybo - bold slanted
+%
+% There is no good (free) typewriter version, to my knowledge.
+% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
+% Hmm.
+%
+% Also doesn't work in math.  Do we need to do math with euro symbols?
+% Hope not.
+%
+%
+\def\euro{{\eurofont e}}
+\def\eurofont{%
+  % We set the font at each command, rather than predefining it in
+  % \textfonts and the other font-switching commands, so that
+  % installations which never need the symbol don't have to have the
+  % font installed.
+  %
+  % There is only one designed size (nominal 10pt), so we always scale
+  % that to the current nominal size.
+  %
+  % By the way, simply using "at 1em" works for cmr10 and the like, but
+  % does not work for cmbx10 and other extended/shrunken fonts.
+  %
+  \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
+  %
+  \ifx\curfontstyle\bfstylename
+    % bold:
+    \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
+  \else
+    % regular:
+    \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
+  \fi
+  \thiseurofont
+}
+
+% Glyphs from the EC fonts.  We don't use \let for the aliases, because
+% sometimes we redefine the original macro, and the alias should reflect
+% the redefinition.
+%
+% Use LaTeX names for the Icelandic letters.
+\def\DH{{\ecfont \char"D0}} % Eth
+\def\dh{{\ecfont \char"F0}} % eth
+\def\TH{{\ecfont \char"DE}} % Thorn
+\def\th{{\ecfont \char"FE}} % thorn
+%
+\def\guillemetleft{{\ecfont \char"13}}
+\def\guillemotleft{\guillemetleft}
+\def\guillemetright{{\ecfont \char"14}}
+\def\guillemotright{\guillemetright}
+\def\guilsinglleft{{\ecfont \char"0E}}
+\def\guilsinglright{{\ecfont \char"0F}}
+\def\quotedblbase{{\ecfont \char"12}}
+\def\quotesinglbase{{\ecfont \char"0D}}
+%
+% This positioning is not perfect (see the ogonek LaTeX package), but
+% we have the precomposed glyphs for the most common cases.  We put the
+% tests to use those glyphs in the single \ogonek macro so we have fewer
+% dummy definitions to worry about for index entries, etc.
+%
+% ogonek is also used with other letters in Lithuanian (IOU), but using
+% the precomposed glyphs for those is not so easy since they aren't in
+% the same EC font.
+\def\ogonek#1{{%
+  \def\temp{#1}%
+  \ifx\temp\macrocharA\Aogonek
+  \else\ifx\temp\macrochara\aogonek
+  \else\ifx\temp\macrocharE\Eogonek
+  \else\ifx\temp\macrochare\eogonek
+  \else
+    \ecfont \setbox0=\hbox{#1}%
+    \ifdim\ht0=1ex\accent"0C #1%
+    \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
+    \fi
+  \fi\fi\fi\fi
+  }%
+}
+\def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
+\def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
+\def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
+\def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
+%
+% Use the ec* fonts (cm-super in outline format) for non-CM glyphs.
+\def\ecfont{%
+  % We can't distinguish serif/sans and italic/slanted, but this
+  % is used for crude hacks anyway (like adding French and German
+  % quotes to documents typeset with CM, where we lose kerning), so
+  % hopefully nobody will notice/care.
+  \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
+  \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
+  \ifmonospace
+    % typewriter:
+    \font\thisecfont = ectt\ecsize \space at \nominalsize
+  \else
+    \ifx\curfontstyle\bfstylename
+      % bold:
+      \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
+    \else
+      % regular:
+      \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
+    \fi
+  \fi
+  \thisecfont
+}
+
+% @registeredsymbol - R in a circle.  The font for the R should really
+% be smaller yet, but lllsize is the best we can do for now.
+% Adapted from the plain.tex definition of \copyright.
+%
+\def\registeredsymbol{%
+  $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
+               \hfil\crcr\Orb}}%
+    }$%
+}
+
+% @textdegree - the normal degrees sign.
+%
+\def\textdegree{$^\circ$}
+
+% Laurent Siebenmann reports \Orb undefined with:
+%  Textures 1.7.7 (preloaded format=plain 93.10.14)  (68K)  16 APR 2004 02:38
+% so we'll define it if necessary.
+%
+\ifx\Orb\thisisundefined
+\def\Orb{\mathhexbox20D}
+\fi
+
+% Quotes.
+\chardef\quotedblleft="5C
+\chardef\quotedblright=`\"
+\chardef\quoteleft=`\`
+\chardef\quoteright=`\'
+
+
+\message{page headings,}
+
+\newskip\titlepagetopglue \titlepagetopglue = 1.5in
+\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
+
+% First the title page.  Must do @settitle before @titlepage.
+\newif\ifseenauthor
+\newif\iffinishedtitlepage
+
+% Do an implicit @contents or @shortcontents after @end titlepage if the
+% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
+%
+\newif\ifsetcontentsaftertitlepage
+ \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
+\newif\ifsetshortcontentsaftertitlepage
+ \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
+
+\parseargdef\shorttitlepage{%
+  \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
+  \endgroup\page\hbox{}\page}
+
+\envdef\titlepage{%
+  % Open one extra group, as we want to close it in the middle of \Etitlepage.
+  \begingroup
+    \parindent=0pt \textfonts
+    % Leave some space at the very top of the page.
+    \vglue\titlepagetopglue
+    % No rule at page bottom unless we print one at the top with @title.
+    \finishedtitlepagetrue
+    %
+    % Most title ``pages'' are actually two pages long, with space
+    % at the top of the second.  We don't want the ragged left on the second.
+    \let\oldpage = \page
+    \def\page{%
+      \iffinishedtitlepage\else
+	 \finishtitlepage
+      \fi
+      \let\page = \oldpage
+      \page
+      \null
+    }%
+}
+
+\def\Etitlepage{%
+    \iffinishedtitlepage\else
+	\finishtitlepage
+    \fi
+    % It is important to do the page break before ending the group,
+    % because the headline and footline are only empty inside the group.
+    % If we use the new definition of \page, we always get a blank page
+    % after the title page, which we certainly don't want.
+    \oldpage
+  \endgroup
+  %
+  % Need this before the \...aftertitlepage checks so that if they are
+  % in effect the toc pages will come out with page numbers.
+  \HEADINGSon
+  %
+  % If they want short, they certainly want long too.
+  \ifsetshortcontentsaftertitlepage
+    \shortcontents
+    \contents
+    \global\let\shortcontents = \relax
+    \global\let\contents = \relax
+  \fi
+  %
+  \ifsetcontentsaftertitlepage
+    \contents
+    \global\let\contents = \relax
+    \global\let\shortcontents = \relax
+  \fi
+}
+
+\def\finishtitlepage{%
+  \vskip4pt \hrule height 2pt width \hsize
+  \vskip\titlepagebottomglue
+  \finishedtitlepagetrue
+}
+
+% Settings used for typesetting titles: no hyphenation, no indentation,
+% don't worry much about spacing, ragged right.  This should be used
+% inside a \vbox, and fonts need to be set appropriately first.  Because
+% it is always used for titles, nothing else, we call \rmisbold.  \par
+% should be specified before the end of the \vbox, since a vbox is a group.
+% 
+\def\raggedtitlesettings{%
+  \rmisbold
+  \hyphenpenalty=10000
+  \parindent=0pt
+  \tolerance=5000
+  \ptexraggedright
+}
+
+% Macros to be used within @titlepage:
+
+\let\subtitlerm=\tenrm
+\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
+
+\parseargdef\title{%
+  \checkenv\titlepage
+  \vbox{\titlefonts \raggedtitlesettings #1\par}%
+  % print a rule at the page bottom also.
+  \finishedtitlepagefalse
+  \vskip4pt \hrule height 4pt width \hsize \vskip4pt
+}
+
+\parseargdef\subtitle{%
+  \checkenv\titlepage
+  {\subtitlefont \rightline{#1}}%
+}
+
+% @author should come last, but may come many times.
+% It can also be used inside @quotation.
+%
+\parseargdef\author{%
+  \def\temp{\quotation}%
+  \ifx\thisenv\temp
+    \def\quotationauthor{#1}% printed in \Equotation.
+  \else
+    \checkenv\titlepage
+    \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
+    {\secfonts\rmisbold \leftline{#1}}%
+  \fi
+}
+
+
+% Set up page headings and footings.
+
+\let\thispage=\folio
+
+\newtoks\evenheadline    % headline on even pages
+\newtoks\oddheadline     % headline on odd pages
+\newtoks\evenfootline    % footline on even pages
+\newtoks\oddfootline     % footline on odd pages
+
+% Now make TeX use those variables
+\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
+                            \else \the\evenheadline \fi}}
+\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
+                            \else \the\evenfootline \fi}\HEADINGShook}
+\let\HEADINGShook=\relax
+
+% Commands to set those variables.
+% For example, this is what  @headings on  does
+% @evenheading @thistitle|@thispage|@thischapter
+% @oddheading @thischapter|@thispage|@thistitle
+% @evenfooting @thisfile||
+% @oddfooting ||@thisfile
+
+
+\def\evenheading{\parsearg\evenheadingxxx}
+\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
+\def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
+\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\def\oddheading{\parsearg\oddheadingxxx}
+\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
+\def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
+\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
+
+\def\evenfooting{\parsearg\evenfootingxxx}
+\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
+\def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
+\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\def\oddfooting{\parsearg\oddfootingxxx}
+\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
+\def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
+  \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
+  %
+  % Leave some space for the footline.  Hopefully ok to assume
+  % @evenfooting will not be used by itself.
+  \global\advance\pageheight by -12pt
+  \global\advance\vsize by -12pt
+}
+
+\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
+
+% @evenheadingmarks top     \thischapter <- chapter at the top of a page
+% @evenheadingmarks bottom  \thischapter <- chapter at the bottom of a page
+%
+% The same set of arguments for:
+%
+% @oddheadingmarks
+% @evenfootingmarks
+% @oddfootingmarks
+% @everyheadingmarks
+% @everyfootingmarks
+
+\def\evenheadingmarks{\headingmarks{even}{heading}}
+\def\oddheadingmarks{\headingmarks{odd}{heading}}
+\def\evenfootingmarks{\headingmarks{even}{footing}}
+\def\oddfootingmarks{\headingmarks{odd}{footing}}
+\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
+                          \headingmarks{odd}{heading}{#1} }
+\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
+                          \headingmarks{odd}{footing}{#1} }
+% #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
+\def\headingmarks#1#2#3 {%
+  \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
+  \global\expandafter\let\csname get#1#2marks\endcsname \temp
+}
+
+\everyheadingmarks bottom
+\everyfootingmarks bottom
+
+% @headings double      turns headings on for double-sided printing.
+% @headings single      turns headings on for single-sided printing.
+% @headings off         turns them off.
+% @headings on          same as @headings double, retained for compatibility.
+% @headings after       turns on double-sided headings after this page.
+% @headings doubleafter turns on double-sided headings after this page.
+% @headings singleafter turns on single-sided headings after this page.
+% By default, they are off at the start of a document,
+% and turned `on' after @end titlepage.
+
+\def\headings #1 {\csname HEADINGS#1\endcsname}
+
+\def\headingsoff{% non-global headings elimination
+  \evenheadline={\hfil}\evenfootline={\hfil}%
+   \oddheadline={\hfil}\oddfootline={\hfil}%
+}
+
+\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
+\HEADINGSoff  % it's the default
+
+% When we turn headings on, set the page number to 1.
+% For double-sided printing, put current file name in lower left corner,
+% chapter name on inside top of right hand pages, document
+% title on inside top of left hand pages, and page numbers on outside top
+% edge of all pages.
+\def\HEADINGSdouble{%
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+\let\contentsalignmacro = \chappager
+
+% For single-sided printing, chapter title goes across top left of page,
+% page number on top right.
+\def\HEADINGSsingle{%
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+\def\HEADINGSon{\HEADINGSdouble}
+
+\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
+\let\HEADINGSdoubleafter=\HEADINGSafter
+\def\HEADINGSdoublex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+
+\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
+\def\HEADINGSsinglex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+
+% Subroutines used in generating headings
+% This produces Day Month Year style of output.
+% Only define if not already defined, in case a txi-??.tex file has set
+% up a different format (e.g., txi-cs.tex does this).
+\ifx\today\thisisundefined
+\def\today{%
+  \number\day\space
+  \ifcase\month
+  \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
+  \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
+  \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
+  \fi
+  \space\number\year}
+\fi
+
+% @settitle line...  specifies the title of the document, for headings.
+% It generates no output of its own.
+\def\thistitle{\putwordNoTitle}
+\def\settitle{\parsearg{\gdef\thistitle}}
+
+
+\message{tables,}
+% Tables -- @table, @ftable, @vtable, @item(x).
+
+% default indentation of table text
+\newdimen\tableindent \tableindent=.8in
+% default indentation of @itemize and @enumerate text
+\newdimen\itemindent  \itemindent=.3in
+% margin between end of table item and start of table text.
+\newdimen\itemmargin  \itemmargin=.1in
+
+% used internally for \itemindent minus \itemmargin
+\newdimen\itemmax
+
+% Note @table, @ftable, and @vtable define @item, @itemx, etc., with
+% these defs.
+% They also define \itemindex
+% to index the item name in whatever manner is desired (perhaps none).
+
+\newif\ifitemxneedsnegativevskip
+
+\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
+
+\def\internalBitem{\smallbreak \parsearg\itemzzz}
+\def\internalBitemx{\itemxpar \parsearg\itemzzz}
+
+\def\itemzzz #1{\begingroup %
+  \advance\hsize by -\rightskip
+  \advance\hsize by -\tableindent
+  \setbox0=\hbox{\itemindicate{#1}}%
+  \itemindex{#1}%
+  \nobreak % This prevents a break before @itemx.
+  %
+  % If the item text does not fit in the space we have, put it on a line
+  % by itself, and do not allow a page break either before or after that
+  % line.  We do not start a paragraph here because then if the next
+  % command is, e.g., @kindex, the whatsit would get put into the
+  % horizontal list on a line by itself, resulting in extra blank space.
+  \ifdim \wd0>\itemmax
+    %
+    % Make this a paragraph so we get the \parskip glue and wrapping,
+    % but leave it ragged-right.
+    \begingroup
+      \advance\leftskip by-\tableindent
+      \advance\hsize by\tableindent
+      \advance\rightskip by0pt plus1fil\relax
+      \leavevmode\unhbox0\par
+    \endgroup
+    %
+    % We're going to be starting a paragraph, but we don't want the
+    % \parskip glue -- logically it's part of the @item we just started.
+    \nobreak \vskip-\parskip
+    %
+    % Stop a page break at the \parskip glue coming up.  However, if
+    % what follows is an environment such as @example, there will be no
+    % \parskip glue; then the negative vskip we just inserted would
+    % cause the example and the item to crash together.  So we use this
+    % bizarre value of 10001 as a signal to \aboveenvbreak to insert
+    % \parskip glue after all.  Section titles are handled this way also.
+    %
+    \penalty 10001
+    \endgroup
+    \itemxneedsnegativevskipfalse
+  \else
+    % The item text fits into the space.  Start a paragraph, so that the
+    % following text (if any) will end up on the same line.
+    \noindent
+    % Do this with kerns and \unhbox so that if there is a footnote in
+    % the item text, it can migrate to the main vertical list and
+    % eventually be printed.
+    \nobreak\kern-\tableindent
+    \dimen0 = \itemmax  \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
+    \unhbox0
+    \nobreak\kern\dimen0
+    \endgroup
+    \itemxneedsnegativevskiptrue
+  \fi
+}
+
+\def\item{\errmessage{@item while not in a list environment}}
+\def\itemx{\errmessage{@itemx while not in a list environment}}
+
+% @table, @ftable, @vtable.
+\envdef\table{%
+  \let\itemindex\gobble
+  \tablecheck{table}%
+}
+\envdef\ftable{%
+  \def\itemindex ##1{\doind {fn}{\code{##1}}}%
+  \tablecheck{ftable}%
+}
+\envdef\vtable{%
+  \def\itemindex ##1{\doind {vr}{\code{##1}}}%
+  \tablecheck{vtable}%
+}
+\def\tablecheck#1{%
+  \ifnum \the\catcode`\^^M=\active
+    \endgroup
+    \errmessage{This command won't work in this context; perhaps the problem is
+      that we are \inenvironment\thisenv}%
+    \def\next{\doignore{#1}}%
+  \else
+    \let\next\tablex
+  \fi
+  \next
+}
+\def\tablex#1{%
+  \def\itemindicate{#1}%
+  \parsearg\tabley
+}
+\def\tabley#1{%
+  {%
+    \makevalueexpandable
+    \edef\temp{\noexpand\tablez #1\space\space\space}%
+    \expandafter
+  }\temp \endtablez
+}
+\def\tablez #1 #2 #3 #4\endtablez{%
+  \aboveenvbreak
+  \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
+  \ifnum 0#2>0 \tableindent=#2\mil \fi
+  \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
+  \itemmax=\tableindent
+  \advance \itemmax by -\itemmargin
+  \advance \leftskip by \tableindent
+  \exdentamount=\tableindent
+  \parindent = 0pt
+  \parskip = \smallskipamount
+  \ifdim \parskip=0pt \parskip=2pt \fi
+  \let\item = \internalBitem
+  \let\itemx = \internalBitemx
+}
+\def\Etable{\endgraf\afterenvbreak}
+\let\Eftable\Etable
+\let\Evtable\Etable
+\let\Eitemize\Etable
+\let\Eenumerate\Etable
+
+% This is the counter used by @enumerate, which is really @itemize
+
+\newcount \itemno
+
+\envdef\itemize{\parsearg\doitemize}
+
+\def\doitemize#1{%
+  \aboveenvbreak
+  \itemmax=\itemindent
+  \advance\itemmax by -\itemmargin
+  \advance\leftskip by \itemindent
+  \exdentamount=\itemindent
+  \parindent=0pt
+  \parskip=\smallskipamount
+  \ifdim\parskip=0pt \parskip=2pt \fi
+  %
+  % Try typesetting the item mark that if the document erroneously says
+  % something like @itemize @samp (intending @table), there's an error
+  % right away at the @itemize.  It's not the best error message in the
+  % world, but it's better than leaving it to the @item.  This means if
+  % the user wants an empty mark, they have to say @w{} not just @w.
+  \def\itemcontents{#1}%
+  \setbox0 = \hbox{\itemcontents}%
+  %
+  % @itemize with no arg is equivalent to @itemize @bullet.
+  \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
+  %
+  \let\item=\itemizeitem
+}
+
+% Definition of @item while inside @itemize and @enumerate.
+%
+\def\itemizeitem{%
+  \advance\itemno by 1  % for enumerations
+  {\let\par=\endgraf \smallbreak}% reasonable place to break
+  {%
+   % If the document has an @itemize directly after a section title, a
+   % \nobreak will be last on the list, and \sectionheading will have
+   % done a \vskip-\parskip.  In that case, we don't want to zero
+   % parskip, or the item text will crash with the heading.  On the
+   % other hand, when there is normal text preceding the item (as there
+   % usually is), we do want to zero parskip, or there would be too much
+   % space.  In that case, we won't have a \nobreak before.  At least
+   % that's the theory.
+   \ifnum\lastpenalty<10000 \parskip=0in \fi
+   \noindent
+   \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
+   %
+   \vadjust{\penalty 1200}}% not good to break after first line of item.
+  \flushcr
+}
+
+% \splitoff TOKENS\endmark defines \first to be the first token in
+% TOKENS, and \rest to be the remainder.
+%
+\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
+
+% Allow an optional argument of an uppercase letter, lowercase letter,
+% or number, to specify the first label in the enumerated list.  No
+% argument is the same as `1'.
+%
+\envparseargdef\enumerate{\enumeratey #1  \endenumeratey}
+\def\enumeratey #1 #2\endenumeratey{%
+  % If we were given no argument, pretend we were given `1'.
+  \def\thearg{#1}%
+  \ifx\thearg\empty \def\thearg{1}\fi
+  %
+  % Detect if the argument is a single token.  If so, it might be a
+  % letter.  Otherwise, the only valid thing it can be is a number.
+  % (We will always have one token, because of the test we just made.
+  % This is a good thing, since \splitoff doesn't work given nothing at
+  % all -- the first parameter is undelimited.)
+  \expandafter\splitoff\thearg\endmark
+  \ifx\rest\empty
+    % Only one token in the argument.  It could still be anything.
+    % A ``lowercase letter'' is one whose \lccode is nonzero.
+    % An ``uppercase letter'' is one whose \lccode is both nonzero, and
+    %   not equal to itself.
+    % Otherwise, we assume it's a number.
+    %
+    % We need the \relax at the end of the \ifnum lines to stop TeX from
+    % continuing to look for a <number>.
+    %
+    \ifnum\lccode\expandafter`\thearg=0\relax
+      \numericenumerate % a number (we hope)
+    \else
+      % It's a letter.
+      \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
+        \lowercaseenumerate % lowercase letter
+      \else
+        \uppercaseenumerate % uppercase letter
+      \fi
+    \fi
+  \else
+    % Multiple tokens in the argument.  We hope it's a number.
+    \numericenumerate
+  \fi
+}
+
+% An @enumerate whose labels are integers.  The starting integer is
+% given in \thearg.
+%
+\def\numericenumerate{%
+  \itemno = \thearg
+  \startenumeration{\the\itemno}%
+}
+
+% The starting (lowercase) letter is in \thearg.
+\def\lowercaseenumerate{%
+  \itemno = \expandafter`\thearg
+  \startenumeration{%
+    % Be sure we're not beyond the end of the alphabet.
+    \ifnum\itemno=0
+      \errmessage{No more lowercase letters in @enumerate; get a bigger
+                  alphabet}%
+    \fi
+    \char\lccode\itemno
+  }%
+}
+
+% The starting (uppercase) letter is in \thearg.
+\def\uppercaseenumerate{%
+  \itemno = \expandafter`\thearg
+  \startenumeration{%
+    % Be sure we're not beyond the end of the alphabet.
+    \ifnum\itemno=0
+      \errmessage{No more uppercase letters in @enumerate; get a bigger
+                  alphabet}
+    \fi
+    \char\uccode\itemno
+  }%
+}
+
+% Call \doitemize, adding a period to the first argument and supplying the
+% common last two arguments.  Also subtract one from the initial value in
+% \itemno, since @item increments \itemno.
+%
+\def\startenumeration#1{%
+  \advance\itemno by -1
+  \doitemize{#1.}\flushcr
+}
+
+% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
+% to @enumerate.
+%
+\def\alphaenumerate{\enumerate{a}}
+\def\capsenumerate{\enumerate{A}}
+\def\Ealphaenumerate{\Eenumerate}
+\def\Ecapsenumerate{\Eenumerate}
+
+
+% @multitable macros
+% Amy Hendrickson, 8/18/94, 3/6/96
+%
+% @multitable ... @end multitable will make as many columns as desired.
+% Contents of each column will wrap at width given in preamble.  Width
+% can be specified either with sample text given in a template line,
+% or in percent of \hsize, the current width of text on page.
+
+% Table can continue over pages but will only break between lines.
+
+% To make preamble:
+%
+% Either define widths of columns in terms of percent of \hsize:
+%   @multitable @columnfractions .25 .3 .45
+%   @item ...
+%
+%   Numbers following @columnfractions are the percent of the total
+%   current hsize to be used for each column. You may use as many
+%   columns as desired.
+
+
+% Or use a template:
+%   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+%   @item ...
+%   using the widest term desired in each column.
+
+% Each new table line starts with @item, each subsequent new column
+% starts with @tab. Empty columns may be produced by supplying @tab's
+% with nothing between them for as many times as empty columns are needed,
+% ie, @tab at tab@tab will produce two empty columns.
+
+% @item, @tab do not need to be on their own lines, but it will not hurt
+% if they are.
+
+% Sample multitable:
+
+%   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+%   @item first col stuff @tab second col stuff @tab third col
+%   @item
+%   first col stuff
+%   @tab
+%   second col stuff
+%   @tab
+%   third col
+%   @item first col stuff @tab second col stuff
+%   @tab Many paragraphs of text may be used in any column.
+%
+%         They will wrap at the width determined by the template.
+%   @item at tab@tab This will be in third column.
+%   @end multitable
+
+% Default dimensions may be reset by user.
+% @multitableparskip is vertical space between paragraphs in table.
+% @multitableparindent is paragraph indent in table.
+% @multitablecolmargin is horizontal space to be left between columns.
+% @multitablelinespace is space to leave between table items, baseline
+%                                                            to baseline.
+%   0pt means it depends on current normal line spacing.
+%
+\newskip\multitableparskip
+\newskip\multitableparindent
+\newdimen\multitablecolspace
+\newskip\multitablelinespace
+\multitableparskip=0pt
+\multitableparindent=6pt
+\multitablecolspace=12pt
+\multitablelinespace=0pt
+
+% Macros used to set up halign preamble:
+%
+\let\endsetuptable\relax
+\def\xendsetuptable{\endsetuptable}
+\let\columnfractions\relax
+\def\xcolumnfractions{\columnfractions}
+\newif\ifsetpercent
+
+% #1 is the @columnfraction, usually a decimal number like .5, but might
+% be just 1.  We just use it, whatever it is.
+%
+\def\pickupwholefraction#1 {%
+  \global\advance\colcount by 1
+  \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
+  \setuptable
+}
+
+\newcount\colcount
+\def\setuptable#1{%
+  \def\firstarg{#1}%
+  \ifx\firstarg\xendsetuptable
+    \let\go = \relax
+  \else
+    \ifx\firstarg\xcolumnfractions
+      \global\setpercenttrue
+    \else
+      \ifsetpercent
+         \let\go\pickupwholefraction
+      \else
+         \global\advance\colcount by 1
+         \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
+                   % separator; typically that is always in the input, anyway.
+         \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
+      \fi
+    \fi
+    \ifx\go\pickupwholefraction
+      % Put the argument back for the \pickupwholefraction call, so
+      % we'll always have a period there to be parsed.
+      \def\go{\pickupwholefraction#1}%
+    \else
+      \let\go = \setuptable
+    \fi%
+  \fi
+  \go
+}
+
+% multitable-only commands.
+%
+% @headitem starts a heading row, which we typeset in bold.
+% Assignments have to be global since we are inside the implicit group
+% of an alignment entry.  \everycr resets \everytab so we don't have to
+% undo it ourselves.
+\def\headitemfont{\b}% for people to use in the template row; not changeable
+\def\headitem{%
+  \checkenv\multitable
+  \crcr
+  \global\everytab={\bf}% can't use \headitemfont since the parsing differs
+  \the\everytab % for the first item
+}%
+%
+% A \tab used to include \hskip1sp.  But then the space in a template
+% line is not enough.  That is bad.  So let's go back to just `&' until
+% we again encounter the problem the 1sp was intended to solve.
+%					--karl, nathan at acm.org, 20apr99.
+\def\tab{\checkenv\multitable &\the\everytab}%
+
+% @multitable ... @end multitable definitions:
+%
+\newtoks\everytab  % insert after every tab.
+%
+\envdef\multitable{%
+  \vskip\parskip
+  \startsavinginserts
+  %
+  % @item within a multitable starts a normal row.
+  % We use \def instead of \let so that if one of the multitable entries
+  % contains an @itemize, we don't choke on the \item (seen as \crcr aka
+  % \endtemplate) expanding \doitemize.
+  \def\item{\crcr}%
+  %
+  \tolerance=9500
+  \hbadness=9500
+  \setmultitablespacing
+  \parskip=\multitableparskip
+  \parindent=\multitableparindent
+  \overfullrule=0pt
+  \global\colcount=0
+  %
+  \everycr = {%
+    \noalign{%
+      \global\everytab={}%
+      \global\colcount=0 % Reset the column counter.
+      % Check for saved footnotes, etc.
+      \checkinserts
+      % Keeps underfull box messages off when table breaks over pages.
+      %\filbreak
+	% Maybe so, but it also creates really weird page breaks when the
+	% table breaks over pages. Wouldn't \vfil be better?  Wait until the
+	% problem manifests itself, so it can be fixed for real --karl.
+    }%
+  }%
+  %
+  \parsearg\domultitable
+}
+\def\domultitable#1{%
+  % To parse everything between @multitable and @item:
+  \setuptable#1 \endsetuptable
+  %
+  % This preamble sets up a generic column definition, which will
+  % be used as many times as user calls for columns.
+  % \vtop will set a single line and will also let text wrap and
+  % continue for many paragraphs if desired.
+  \halign\bgroup &%
+    \global\advance\colcount by 1
+    \multistrut
+    \vtop{%
+      % Use the current \colcount to find the correct column width:
+      \hsize=\expandafter\csname col\the\colcount\endcsname
+      %
+      % In order to keep entries from bumping into each other
+      % we will add a \leftskip of \multitablecolspace to all columns after
+      % the first one.
+      %
+      % If a template has been used, we will add \multitablecolspace
+      % to the width of each template entry.
+      %
+      % If the user has set preamble in terms of percent of \hsize we will
+      % use that dimension as the width of the column, and the \leftskip
+      % will keep entries from bumping into each other.  Table will start at
+      % left margin and final column will justify at right margin.
+      %
+      % Make sure we don't inherit \rightskip from the outer environment.
+      \rightskip=0pt
+      \ifnum\colcount=1
+	% The first column will be indented with the surrounding text.
+	\advance\hsize by\leftskip
+      \else
+	\ifsetpercent \else
+	  % If user has not set preamble in terms of percent of \hsize
+	  % we will advance \hsize by \multitablecolspace.
+	  \advance\hsize by \multitablecolspace
+	\fi
+       % In either case we will make \leftskip=\multitablecolspace:
+      \leftskip=\multitablecolspace
+      \fi
+      % Ignoring space at the beginning and end avoids an occasional spurious
+      % blank line, when TeX decides to break the line at the space before the
+      % box from the multistrut, so the strut ends up on a line by itself.
+      % For example:
+      % @multitable @columnfractions .11 .89
+      % @item @code{#}
+      % @tab Legal holiday which is valid in major parts of the whole country.
+      % Is automatically provided with highlighting sequences respectively
+      % marking characters.
+      \noindent\ignorespaces##\unskip\multistrut
+    }\cr
+}
+\def\Emultitable{%
+  \crcr
+  \egroup % end the \halign
+  \global\setpercentfalse
+}
+
+\def\setmultitablespacing{%
+  \def\multistrut{\strut}% just use the standard line spacing
+  %
+  % Compute \multitablelinespace (if not defined by user) for use in
+  % \multitableparskip calculation.  We used define \multistrut based on
+  % this, but (ironically) that caused the spacing to be off.
+  % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
+\ifdim\multitablelinespace=0pt
+\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
+\global\advance\multitablelinespace by-\ht0
+\fi
+% Test to see if parskip is larger than space between lines of
+% table. If not, do nothing.
+%        If so, set to same dimension as multitablelinespace.
+\ifdim\multitableparskip>\multitablelinespace
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
+                                      % than skip between lines in the table.
+\fi%
+\ifdim\multitableparskip=0pt
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
+                                      % than skip between lines in the table.
+\fi}
+
+
+\message{conditionals,}
+
+% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
+% @ifnotxml always succeed.  They currently do nothing; we don't
+% attempt to check whether the conditionals are properly nested.  But we
+% have to remember that they are conditionals, so that @end doesn't
+% attempt to close an environment group.
+%
+\def\makecond#1{%
+  \expandafter\let\csname #1\endcsname = \relax
+  \expandafter\let\csname iscond.#1\endcsname = 1
+}
+\makecond{iftex}
+\makecond{ifnotdocbook}
+\makecond{ifnothtml}
+\makecond{ifnotinfo}
+\makecond{ifnotplaintext}
+\makecond{ifnotxml}
+
+% Ignore @ignore, @ifhtml, @ifinfo, and the like.
+%
+\def\direntry{\doignore{direntry}}
+\def\documentdescription{\doignore{documentdescription}}
+\def\docbook{\doignore{docbook}}
+\def\html{\doignore{html}}
+\def\ifdocbook{\doignore{ifdocbook}}
+\def\ifhtml{\doignore{ifhtml}}
+\def\ifinfo{\doignore{ifinfo}}
+\def\ifnottex{\doignore{ifnottex}}
+\def\ifplaintext{\doignore{ifplaintext}}
+\def\ifxml{\doignore{ifxml}}
+\def\ignore{\doignore{ignore}}
+\def\menu{\doignore{menu}}
+\def\xml{\doignore{xml}}
+
+% Ignore text until a line `@end #1', keeping track of nested conditionals.
+%
+% A count to remember the depth of nesting.
+\newcount\doignorecount
+
+\def\doignore#1{\begingroup
+  % Scan in ``verbatim'' mode:
+  \obeylines
+  \catcode`\@ = \other
+  \catcode`\{ = \other
+  \catcode`\} = \other
+  %
+  % Make sure that spaces turn into tokens that match what \doignoretext wants.
+  \spaceisspace
+  %
+  % Count number of #1's that we've seen.
+  \doignorecount = 0
+  %
+  % Swallow text until we reach the matching `@end #1'.
+  \dodoignore{#1}%
+}
+
+{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
+  \obeylines %
+  %
+  \gdef\dodoignore#1{%
+    % #1 contains the command name as a string, e.g., `ifinfo'.
+    %
+    % Define a command to find the next `@end #1'.
+    \long\def\doignoretext##1^^M at end #1{%
+      \doignoretextyyy##1^^M@#1\_STOP_}%
+    %
+    % And this command to find another #1 command, at the beginning of a
+    % line.  (Otherwise, we would consider a line `@c @ifset', for
+    % example, to count as an @ifset for nesting.)
+    \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
+    %
+    % And now expand that command.
+    \doignoretext ^^M%
+  }%
+}
+
+\def\doignoreyyy#1{%
+  \def\temp{#1}%
+  \ifx\temp\empty			% Nothing found.
+    \let\next\doignoretextzzz
+  \else					% Found a nested condition, ...
+    \advance\doignorecount by 1
+    \let\next\doignoretextyyy		% ..., look for another.
+    % If we're here, #1 ends with ^^M\ifinfo (for example).
+  \fi
+  \next #1% the token \_STOP_ is present just after this macro.
+}
+
+% We have to swallow the remaining "\_STOP_".
+%
+\def\doignoretextzzz#1{%
+  \ifnum\doignorecount = 0	% We have just found the outermost @end.
+    \let\next\enddoignore
+  \else				% Still inside a nested condition.
+    \advance\doignorecount by -1
+    \let\next\doignoretext      % Look for the next @end.
+  \fi
+  \next
+}
+
+% Finish off ignored text.
+{ \obeylines%
+  % Ignore anything after the last `@end #1'; this matters in verbatim
+  % environments, where otherwise the newline after an ignored conditional
+  % would result in a blank line in the output.
+  \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
+}
+
+
+% @set VAR sets the variable VAR to an empty value.
+% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
+%
+% Since we want to separate VAR from REST-OF-LINE (which might be
+% empty), we can't just use \parsearg; we have to insert a space of our
+% own to delimit the rest of the line, and then take it out again if we
+% didn't need it.
+% We rely on the fact that \parsearg sets \catcode`\ =10.
+%
+\parseargdef\set{\setyyy#1 \endsetyyy}
+\def\setyyy#1 #2\endsetyyy{%
+  {%
+    \makevalueexpandable
+    \def\temp{#2}%
+    \edef\next{\gdef\makecsname{SET#1}}%
+    \ifx\temp\empty
+      \next{}%
+    \else
+      \setzzz#2\endsetzzz
+    \fi
+  }%
+}
+% Remove the trailing space \setxxx inserted.
+\def\setzzz#1 \endsetzzz{\next{#1}}
+
+% @clear VAR clears (i.e., unsets) the variable VAR.
+%
+\parseargdef\clear{%
+  {%
+    \makevalueexpandable
+    \global\expandafter\let\csname SET#1\endcsname=\relax
+  }%
+}
+
+% @value{foo} gets the text saved in variable foo.
+\def\value{\begingroup\makevalueexpandable\valuexxx}
+\def\valuexxx#1{\expandablevalue{#1}\endgroup}
+{
+  \catcode`\- = \active \catcode`\_ = \active
+  %
+  \gdef\makevalueexpandable{%
+    \let\value = \expandablevalue
+    % We don't want these characters active, ...
+    \catcode`\-=\other \catcode`\_=\other
+    % ..., but we might end up with active ones in the argument if
+    % we're called from @code, as @code{@value{foo-bar_}}, though.
+    % So \let them to their normal equivalents.
+    \let-\normaldash \let_\normalunderscore
+  }
+}
+
+% We have this subroutine so that we can handle at least some @value's
+% properly in indexes (we call \makevalueexpandable in \indexdummies).
+% The command has to be fully expandable (if the variable is set), since
+% the result winds up in the index file.  This means that if the
+% variable's value contains other Texinfo commands, it's almost certain
+% it will fail (although perhaps we could fix that with sufficient work
+% to do a one-level expansion on the result, instead of complete).
+%
+\def\expandablevalue#1{%
+  \expandafter\ifx\csname SET#1\endcsname\relax
+    {[No value for ``#1'']}%
+    \message{Variable `#1', used in @value, is not set.}%
+  \else
+    \csname SET#1\endcsname
+  \fi
+}
+
+% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
+% with @set.
+%
+% To get special treatment of `@end ifset,' call \makeond and the redefine.
+%
+\makecond{ifset}
+\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
+\def\doifset#1#2{%
+  {%
+    \makevalueexpandable
+    \let\next=\empty
+    \expandafter\ifx\csname SET#2\endcsname\relax
+      #1% If not set, redefine \next.
+    \fi
+    \expandafter
+  }\next
+}
+\def\ifsetfail{\doignore{ifset}}
+
+% @ifclear VAR ... @end executes the `...' iff VAR has never been
+% defined with @set, or has been undefined with @clear.
+%
+% The `\else' inside the `\doifset' parameter is a trick to reuse the
+% above code: if the variable is not set, do nothing, if it is set,
+% then redefine \next to \ifclearfail.
+%
+\makecond{ifclear}
+\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
+\def\ifclearfail{\doignore{ifclear}}
+
+% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
+% without the @) is in fact defined.  We can only feasibly check at the
+% TeX level, so something like `mathcode' is going to considered
+% defined even though it is not a Texinfo command.
+% 
+\makecond{ifcommanddefined}
+\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
+%
+\def\doifcmddefined#1#2{{%
+    \makevalueexpandable
+    \let\next=\empty
+    \expandafter\ifx\csname #2\endcsname\relax
+      #1% If not defined, \let\next as above.
+    \fi
+    \expandafter
+  }\next
+}
+\def\ifcmddefinedfail{\doignore{ifcommanddefined}}
+
+% @ifcommandnotdefined CMD ... handled similar to @ifclear above.
+\makecond{ifcommandnotdefined}
+\def\ifcommandnotdefined{%
+  \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
+\def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
+
+% Set the `txicommandconditionals' variable, so documents have a way to
+% test if the @ifcommand...defined conditionals are available.
+\set txicommandconditionals
+
+% @dircategory CATEGORY  -- specify a category of the dir file
+% which this file should belong to.  Ignore this in TeX.
+\let\dircategory=\comment
+
+% @defininfoenclose.
+\let\definfoenclose=\comment
+
+
+\message{indexing,}
+% Index generation facilities
+
+% Define \newwrite to be identical to plain tex's \newwrite
+% except not \outer, so it can be used within macros and \if's.
+\edef\newwrite{\makecsname{ptexnewwrite}}
+
+% \newindex {foo} defines an index named foo.
+% It automatically defines \fooindex such that
+% \fooindex ...rest of line... puts an entry in the index foo.
+% It also defines \fooindfile to be the number of the output channel for
+% the file that accumulates this index.  The file's extension is foo.
+% The name of an index should be no more than 2 characters long
+% for the sake of vms.
+%
+\def\newindex#1{%
+  \iflinks
+    \expandafter\newwrite \csname#1indfile\endcsname
+    \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
+  \fi
+  \expandafter\xdef\csname#1index\endcsname{%     % Define @#1index
+    \noexpand\doindex{#1}}
+}
+
+% @defindex foo  ==  \newindex{foo}
+%
+\def\defindex{\parsearg\newindex}
+
+% Define @defcodeindex, like @defindex except put all entries in @code.
+%
+\def\defcodeindex{\parsearg\newcodeindex}
+%
+\def\newcodeindex#1{%
+  \iflinks
+    \expandafter\newwrite \csname#1indfile\endcsname
+    \openout \csname#1indfile\endcsname \jobname.#1
+  \fi
+  \expandafter\xdef\csname#1index\endcsname{%
+    \noexpand\docodeindex{#1}}%
+}
+
+
+% @synindex foo bar    makes index foo feed into index bar.
+% Do this instead of @defindex foo if you don't want it as a separate index.
+%
+% @syncodeindex foo bar   similar, but put all entries made for index foo
+% inside @code.
+%
+\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
+\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
+
+% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
+% #3 the target index (bar).
+\def\dosynindex#1#2#3{%
+  % Only do \closeout if we haven't already done it, else we'll end up
+  % closing the target index.
+  \expandafter \ifx\csname donesynindex#2\endcsname \relax
+    % The \closeout helps reduce unnecessary open files; the limit on the
+    % Acorn RISC OS is a mere 16 files.
+    \expandafter\closeout\csname#2indfile\endcsname
+    \expandafter\let\csname donesynindex#2\endcsname = 1
+  \fi
+  % redefine \fooindfile:
+  \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
+  \expandafter\let\csname#2indfile\endcsname=\temp
+  % redefine \fooindex:
+  \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
+}
+
+% Define \doindex, the driver for all \fooindex macros.
+% Argument #1 is generated by the calling \fooindex macro,
+%  and it is "foo", the name of the index.
+
+% \doindex just uses \parsearg; it calls \doind for the actual work.
+% This is because \doind is more useful to call from other macros.
+
+% There is also \dosubind {index}{topic}{subtopic}
+% which makes an entry in a two-level index such as the operation index.
+
+\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
+\def\singleindexer #1{\doind{\indexname}{#1}}
+
+% like the previous two, but they put @code around the argument.
+\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
+\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
+
+% Take care of Texinfo commands that can appear in an index entry.
+% Since there are some commands we want to expand, and others we don't,
+% we have to laboriously prevent expansion for those that we don't.
+%
+\def\indexdummies{%
+  \escapechar = `\\     % use backslash in output files.
+  \def\@{@}% change to @@ when we switch to @ as escape char in index files.
+  \def\ {\realbackslash\space }%
+  %
+  % Need these unexpandable (because we define \tt as a dummy)
+  % definitions when @{ or @} appear in index entry text.  Also, more
+  % complicated, when \tex is in effect and \{ is a \delimiter again.
+  % We can't use \lbracecmd and \rbracecmd because texindex assumes
+  % braces and backslashes are used only as delimiters.  Perhaps we
+  % should define @lbrace and @rbrace commands a la @comma.
+  \def\{{{\tt\char123}}%
+  \def\}{{\tt\char125}}%
+  %
+  % I don't entirely understand this, but when an index entry is
+  % generated from a macro call, the \endinput which \scanmacro inserts
+  % causes processing to be prematurely terminated.  This is,
+  % apparently, because \indexsorttmp is fully expanded, and \endinput
+  % is an expandable command.  The redefinition below makes \endinput
+  % disappear altogether for that purpose -- although logging shows that
+  % processing continues to some further point.  On the other hand, it
+  % seems \endinput does not hurt in the printed index arg, since that
+  % is still getting written without apparent harm.
+  %
+  % Sample source (mac-idx3.tex, reported by Graham Percival to
+  % help-texinfo, 22may06):
+  % @macro funindex {WORD}
+  % @findex xyz
+  % @end macro
+  % ...
+  % @funindex commtest
+  %
+  % The above is not enough to reproduce the bug, but it gives the flavor.
+  %
+  % Sample whatsit resulting:
+  % . at write3{\entry{xyz}{@folio }{@code {xyz at endinput }}}
+  %
+  % So:
+  \let\endinput = \empty
+  %
+  % Do the redefinitions.
+  \commondummies
+}
+
+% For the aux and toc files, @ is the escape character.  So we want to
+% redefine everything using @ as the escape character (instead of
+% \realbackslash, still used for index files).  When everything uses @,
+% this will be simpler.
+%
+\def\atdummies{%
+  \def\@{@@}%
+  \def\ {@ }%
+  \let\{ = \lbraceatcmd
+  \let\} = \rbraceatcmd
+  %
+  % Do the redefinitions.
+  \commondummies
+  \otherbackslash
+}
+
+% Called from \indexdummies and \atdummies.
+%
+\def\commondummies{%
+  %
+  % \definedummyword defines \#1 as \string\#1\space, thus effectively
+  % preventing its expansion.  This is used only for control words,
+  % not control letters, because the \space would be incorrect for
+  % control characters, but is needed to separate the control word
+  % from whatever follows.
+  %
+  % For control letters, we have \definedummyletter, which omits the
+  % space.
+  %
+  % These can be used both for control words that take an argument and
+  % those that do not.  If it is followed by {arg} in the input, then
+  % that will dutifully get written to the index (or wherever).
+  %
+  \def\definedummyword  ##1{\def##1{\string##1\space}}%
+  \def\definedummyletter##1{\def##1{\string##1}}%
+  \let\definedummyaccent\definedummyletter
+  %
+  \commondummiesnofonts
+  %
+  \definedummyletter\_%
+  \definedummyletter\-%
+  %
+  % Non-English letters.
+  \definedummyword\AA
+  \definedummyword\AE
+  \definedummyword\DH
+  \definedummyword\L
+  \definedummyword\O
+  \definedummyword\OE
+  \definedummyword\TH
+  \definedummyword\aa
+  \definedummyword\ae
+  \definedummyword\dh
+  \definedummyword\exclamdown
+  \definedummyword\l
+  \definedummyword\o
+  \definedummyword\oe
+  \definedummyword\ordf
+  \definedummyword\ordm
+  \definedummyword\questiondown
+  \definedummyword\ss
+  \definedummyword\th
+  %
+  % Although these internal commands shouldn't show up, sometimes they do.
+  \definedummyword\bf
+  \definedummyword\gtr
+  \definedummyword\hat
+  \definedummyword\less
+  \definedummyword\sf
+  \definedummyword\sl
+  \definedummyword\tclose
+  \definedummyword\tt
+  %
+  \definedummyword\LaTeX
+  \definedummyword\TeX
+  %
+  % Assorted special characters.
+  \definedummyword\arrow
+  \definedummyword\bullet
+  \definedummyword\comma
+  \definedummyword\copyright
+  \definedummyword\registeredsymbol
+  \definedummyword\dots
+  \definedummyword\enddots
+  \definedummyword\entrybreak
+  \definedummyword\equiv
+  \definedummyword\error
+  \definedummyword\euro
+  \definedummyword\expansion
+  \definedummyword\geq
+  \definedummyword\guillemetleft
+  \definedummyword\guillemetright
+  \definedummyword\guilsinglleft
+  \definedummyword\guilsinglright
+  \definedummyword\lbracechar
+  \definedummyword\leq
+  \definedummyword\minus
+  \definedummyword\ogonek
+  \definedummyword\pounds
+  \definedummyword\point
+  \definedummyword\print
+  \definedummyword\quotedblbase
+  \definedummyword\quotedblleft
+  \definedummyword\quotedblright
+  \definedummyword\quoteleft
+  \definedummyword\quoteright
+  \definedummyword\quotesinglbase
+  \definedummyword\rbracechar
+  \definedummyword\result
+  \definedummyword\textdegree
+  %
+  % We want to disable all macros so that they are not expanded by \write.
+  \macrolist
+  %
+  \normalturnoffactive
+  %
+  % Handle some cases of @value -- where it does not contain any
+  % (non-fully-expandable) commands.
+  \makevalueexpandable
+}
+
+% \commondummiesnofonts: common to \commondummies and \indexnofonts.
+%
+\def\commondummiesnofonts{%
+  % Control letters and accents.
+  \definedummyletter\!%
+  \definedummyaccent\"%
+  \definedummyaccent\'%
+  \definedummyletter\*%
+  \definedummyaccent\,%
+  \definedummyletter\.%
+  \definedummyletter\/%
+  \definedummyletter\:%
+  \definedummyaccent\=%
+  \definedummyletter\?%
+  \definedummyaccent\^%
+  \definedummyaccent\`%
+  \definedummyaccent\~%
+  \definedummyword\u
+  \definedummyword\v
+  \definedummyword\H
+  \definedummyword\dotaccent
+  \definedummyword\ogonek
+  \definedummyword\ringaccent
+  \definedummyword\tieaccent
+  \definedummyword\ubaraccent
+  \definedummyword\udotaccent
+  \definedummyword\dotless
+  %
+  % Texinfo font commands.
+  \definedummyword\b
+  \definedummyword\i
+  \definedummyword\r
+  \definedummyword\sansserif
+  \definedummyword\sc
+  \definedummyword\slanted
+  \definedummyword\t
+  %
+  % Commands that take arguments.
+  \definedummyword\abbr
+  \definedummyword\acronym
+  \definedummyword\anchor
+  \definedummyword\cite
+  \definedummyword\code
+  \definedummyword\command
+  \definedummyword\dfn
+  \definedummyword\dmn
+  \definedummyword\email
+  \definedummyword\emph
+  \definedummyword\env
+  \definedummyword\file
+  \definedummyword\image
+  \definedummyword\indicateurl
+  \definedummyword\inforef
+  \definedummyword\kbd
+  \definedummyword\key
+  \definedummyword\math
+  \definedummyword\option
+  \definedummyword\pxref
+  \definedummyword\ref
+  \definedummyword\samp
+  \definedummyword\strong
+  \definedummyword\tie
+  \definedummyword\uref
+  \definedummyword\url
+  \definedummyword\var
+  \definedummyword\verb
+  \definedummyword\w
+  \definedummyword\xref
+}
+
+% \indexnofonts is used when outputting the strings to sort the index
+% by, and when constructing control sequence names.  It eliminates all
+% control sequences and just writes whatever the best ASCII sort string
+% would be for a given command (usually its argument).
+%
+\def\indexnofonts{%
+  % Accent commands should become @asis.
+  \def\definedummyaccent##1{\let##1\asis}%
+  % We can just ignore other control letters.
+  \def\definedummyletter##1{\let##1\empty}%
+  % All control words become @asis by default; overrides below.
+  \let\definedummyword\definedummyaccent
+  %
+  \commondummiesnofonts
+  %
+  % Don't no-op \tt, since it isn't a user-level command
+  % and is used in the definitions of the active chars like <, >, |, etc.
+  % Likewise with the other plain tex font commands.
+  %\let\tt=\asis
+  %
+  \def\ { }%
+  \def\@{@}%
+  \def\_{\normalunderscore}%
+  \def\-{}% @- shouldn't affect sorting
+  %
+  % Unfortunately, texindex is not prepared to handle braces in the
+  % content at all.  So for index sorting, we map @{ and @} to strings
+  % starting with |, since that ASCII character is between ASCII { and }.
+  \def\{{|a}%
+  \def\lbracechar{|a}%
+  %
+  \def\}{|b}%
+  \def\rbracechar{|b}%
+  %
+  % Non-English letters.
+  \def\AA{AA}%
+  \def\AE{AE}%
+  \def\DH{DZZ}%
+  \def\L{L}%
+  \def\OE{OE}%
+  \def\O{O}%
+  \def\TH{ZZZ}%
+  \def\aa{aa}%
+  \def\ae{ae}%
+  \def\dh{dzz}%
+  \def\exclamdown{!}%
+  \def\l{l}%
+  \def\oe{oe}%
+  \def\ordf{a}%
+  \def\ordm{o}%
+  \def\o{o}%
+  \def\questiondown{?}%
+  \def\ss{ss}%
+  \def\th{zzz}%
+  %
+  \def\LaTeX{LaTeX}%
+  \def\TeX{TeX}%
+  %
+  % Assorted special characters.
+  % (The following {} will end up in the sort string, but that's ok.)
+  \def\arrow{->}%
+  \def\bullet{bullet}%
+  \def\comma{,}%
+  \def\copyright{copyright}%
+  \def\dots{...}%
+  \def\enddots{...}%
+  \def\equiv{==}%
+  \def\error{error}%
+  \def\euro{euro}%
+  \def\expansion{==>}%
+  \def\geq{>=}%
+  \def\guillemetleft{<<}%
+  \def\guillemetright{>>}%
+  \def\guilsinglleft{<}%
+  \def\guilsinglright{>}%
+  \def\leq{<=}%
+  \def\minus{-}%
+  \def\point{.}%
+  \def\pounds{pounds}%
+  \def\print{-|}%
+  \def\quotedblbase{"}%
+  \def\quotedblleft{"}%
+  \def\quotedblright{"}%
+  \def\quoteleft{`}%
+  \def\quoteright{'}%
+  \def\quotesinglbase{,}%
+  \def\registeredsymbol{R}%
+  \def\result{=>}%
+  \def\textdegree{o}%
+  %
+  \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
+  \else \indexlquoteignore \fi
+  %
+  % We need to get rid of all macros, leaving only the arguments (if present).
+  % Of course this is not nearly correct, but it is the best we can do for now.
+  % makeinfo does not expand macros in the argument to @deffn, which ends up
+  % writing an index entry, and texindex isn't prepared for an index sort entry
+  % that starts with \.
+  %
+  % Since macro invocations are followed by braces, we can just redefine them
+  % to take a single TeX argument.  The case of a macro invocation that
+  % goes to end-of-line is not handled.
+  %
+  \macrolist
+}
+
+% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
+% ignore left quotes in the sort term.
+{\catcode`\`=\active
+ \gdef\indexlquoteignore{\let`=\empty}}
+
+\let\indexbackslash=0  %overridden during \printindex.
+\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
+
+% Most index entries go through here, but \dosubind is the general case.
+% #1 is the index name, #2 is the entry text.
+\def\doind#1#2{\dosubind{#1}{#2}{}}
+
+% Workhorse for all \fooindexes.
+% #1 is name of index, #2 is stuff to put there, #3 is subentry --
+% empty if called from \doind, as we usually are (the main exception
+% is with most defuns, which call us directly).
+%
+\def\dosubind#1#2#3{%
+  \iflinks
+  {%
+    % Store the main index entry text (including the third arg).
+    \toks0 = {#2}%
+    % If third arg is present, precede it with a space.
+    \def\thirdarg{#3}%
+    \ifx\thirdarg\empty \else
+      \toks0 = \expandafter{\the\toks0 \space #3}%
+    \fi
+    %
+    \edef\writeto{\csname#1indfile\endcsname}%
+    %
+    \safewhatsit\dosubindwrite
+  }%
+  \fi
+}
+
+% Write the entry in \toks0 to the index file:
+%
+\def\dosubindwrite{%
+  % Put the index entry in the margin if desired.
+  \ifx\SETmarginindex\relax\else
+    \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
+  \fi
+  %
+  % Remember, we are within a group.
+  \indexdummies % Must do this here, since \bf, etc expand at this stage
+  \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
+      % so it will be output as is; and it will print as backslash.
+  %
+  % Process the index entry with all font commands turned off, to
+  % get the string to sort by.
+  {\indexnofonts
+   \edef\temp{\the\toks0}% need full expansion
+   \xdef\indexsorttmp{\temp}%
+  }%
+  %
+  % Set up the complete index entry, with both the sort key and
+  % the original text, including any font commands.  We write
+  % three arguments to \entry to the .?? file (four in the
+  % subentry case), texindex reduces to two when writing the .??s
+  % sorted result.
+  \edef\temp{%
+    \write\writeto{%
+      \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
+  }%
+  \temp
+}
+
+% Take care of unwanted page breaks/skips around a whatsit:
+%
+% If a skip is the last thing on the list now, preserve it
+% by backing up by \lastskip, doing the \write, then inserting
+% the skip again.  Otherwise, the whatsit generated by the
+% \write or \pdfdest will make \lastskip zero.  The result is that
+% sequences like this:
+% @end defun
+% @tindex whatever
+% @defun ...
+% will have extra space inserted, because the \medbreak in the
+% start of the @defun won't see the skip inserted by the @end of
+% the previous defun.
+%
+% But don't do any of this if we're not in vertical mode.  We
+% don't want to do a \vskip and prematurely end a paragraph.
+%
+% Avoid page breaks due to these extra skips, too.
+%
+% But wait, there is a catch there:
+% We'll have to check whether \lastskip is zero skip.  \ifdim is not
+% sufficient for this purpose, as it ignores stretch and shrink parts
+% of the skip.  The only way seems to be to check the textual
+% representation of the skip.
+%
+% The following is almost like \def\zeroskipmacro{0.0pt} except that
+% the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
+%
+\edef\zeroskipmacro{\expandafter\the\csname z at skip\endcsname}
+%
+\newskip\whatsitskip
+\newcount\whatsitpenalty
+%
+% ..., ready, GO:
+%
+\def\safewhatsit#1{\ifhmode
+  #1%
+ \else
+  % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
+  \whatsitskip = \lastskip
+  \edef\lastskipmacro{\the\lastskip}%
+  \whatsitpenalty = \lastpenalty
+  %
+  % If \lastskip is nonzero, that means the last item was a
+  % skip.  And since a skip is discardable, that means this
+  % -\whatsitskip glue we're inserting is preceded by a
+  % non-discardable item, therefore it is not a potential
+  % breakpoint, therefore no \nobreak needed.
+  \ifx\lastskipmacro\zeroskipmacro
+  \else
+    \vskip-\whatsitskip
+  \fi
+  %
+  #1%
+  %
+  \ifx\lastskipmacro\zeroskipmacro
+    % If \lastskip was zero, perhaps the last item was a penalty, and
+    % perhaps it was >=10000, e.g., a \nobreak.  In that case, we want
+    % to re-insert the same penalty (values >10000 are used for various
+    % signals); since we just inserted a non-discardable item, any
+    % following glue (such as a \parskip) would be a breakpoint.  For example:
+    %   @deffn deffn-whatever
+    %   @vindex index-whatever
+    %   Description.
+    % would allow a break between the index-whatever whatsit
+    % and the "Description." paragraph.
+    \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
+  \else
+    % On the other hand, if we had a nonzero \lastskip,
+    % this make-up glue would be preceded by a non-discardable item
+    % (the whatsit from the \write), so we must insert a \nobreak.
+    \nobreak\vskip\whatsitskip
+  \fi
+\fi}
+
+% The index entry written in the file actually looks like
+%  \entry {sortstring}{page}{topic}
+% or
+%  \entry {sortstring}{page}{topic}{subtopic}
+% The texindex program reads in these files and writes files
+% containing these kinds of lines:
+%  \initial {c}
+%     before the first topic whose initial is c
+%  \entry {topic}{pagelist}
+%     for a topic that is used without subtopics
+%  \primary {topic}
+%     for the beginning of a topic that is used with subtopics
+%  \secondary {subtopic}{pagelist}
+%     for each subtopic.
+
+% Define the user-accessible indexing commands
+% @findex, @vindex, @kindex, @cindex.
+
+\def\findex {\fnindex}
+\def\kindex {\kyindex}
+\def\cindex {\cpindex}
+\def\vindex {\vrindex}
+\def\tindex {\tpindex}
+\def\pindex {\pgindex}
+
+\def\cindexsub {\begingroup\obeylines\cindexsub}
+{\obeylines %
+\gdef\cindexsub "#1" #2^^M{\endgroup %
+\dosubind{cp}{#2}{#1}}}
+
+% Define the macros used in formatting output of the sorted index material.
+
+% @printindex causes a particular index (the ??s file) to get printed.
+% It does not print any chapter heading (usually an @unnumbered).
+%
+\parseargdef\printindex{\begingroup
+  \dobreak \chapheadingskip{10000}%
+  %
+  \smallfonts \rm
+  \tolerance = 9500
+  \plainfrenchspacing
+  \everypar = {}% don't want the \kern\-parindent from indentation suppression.
+  %
+  % See if the index file exists and is nonempty.
+  % Change catcode of @ here so that if the index file contains
+  % \initial {@}
+  % as its first line, TeX doesn't complain about mismatched braces
+  % (because it thinks @} is a control sequence).
+  \catcode`\@ = 11
+  \openin 1 \jobname.#1s
+  \ifeof 1
+    % \enddoublecolumns gets confused if there is no text in the index,
+    % and it loses the chapter title and the aux file entries for the
+    % index.  The easiest way to prevent this problem is to make sure
+    % there is some text.
+    \putwordIndexNonexistent
+  \else
+    %
+    % If the index file exists but is empty, then \openin leaves \ifeof
+    % false.  We have to make TeX try to read something from the file, so
+    % it can discover if there is anything in it.
+    \read 1 to \temp
+    \ifeof 1
+      \putwordIndexIsEmpty
+    \else
+      % Index files are almost Texinfo source, but we use \ as the escape
+      % character.  It would be better to use @, but that's too big a change
+      % to make right now.
+      \def\indexbackslash{\backslashcurfont}%
+      \catcode`\\ = 0
+      \escapechar = `\\
+      \begindoublecolumns
+      \input \jobname.#1s
+      \enddoublecolumns
+    \fi
+  \fi
+  \closein 1
+\endgroup}
+
+% These macros are used by the sorted index file itself.
+% Change them to control the appearance of the index.
+
+\def\initial#1{{%
+  % Some minor font changes for the special characters.
+  \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
+  %
+  % Remove any glue we may have, we'll be inserting our own.
+  \removelastskip
+  %
+  % We like breaks before the index initials, so insert a bonus.
+  \nobreak
+  \vskip 0pt plus 3\baselineskip
+  \penalty 0
+  \vskip 0pt plus -3\baselineskip
+  %
+  % Typeset the initial.  Making this add up to a whole number of
+  % baselineskips increases the chance of the dots lining up from column
+  % to column.  It still won't often be perfect, because of the stretch
+  % we need before each entry, but it's better.
+  %
+  % No shrink because it confuses \balancecolumns.
+  \vskip 1.67\baselineskip plus .5\baselineskip
+  \leftline{\secbf #1}%
+  % Do our best not to break after the initial.
+  \nobreak
+  \vskip .33\baselineskip plus .1\baselineskip
+}}
+
+% \entry typesets a paragraph consisting of the text (#1), dot leaders, and
+% then page number (#2) flushed to the right margin.  It is used for index
+% and table of contents entries.  The paragraph is indented by \leftskip.
+%
+% A straightforward implementation would start like this:
+%	\def\entry#1#2{...
+% But this freezes the catcodes in the argument, and can cause problems to
+% @code, which sets - active.  This problem was fixed by a kludge---
+% ``-'' was active throughout whole index, but this isn't really right.
+% The right solution is to prevent \entry from swallowing the whole text.
+%                                 --kasal, 21nov03
+\def\entry{%
+  \begingroup
+    %
+    % Start a new paragraph if necessary, so our assignments below can't
+    % affect previous text.
+    \par
+    %
+    % Do not fill out the last line with white space.
+    \parfillskip = 0in
+    %
+    % No extra space above this paragraph.
+    \parskip = 0in
+    %
+    % Do not prefer a separate line ending with a hyphen to fewer lines.
+    \finalhyphendemerits = 0
+    %
+    % \hangindent is only relevant when the entry text and page number
+    % don't both fit on one line.  In that case, bob suggests starting the
+    % dots pretty far over on the line.  Unfortunately, a large
+    % indentation looks wrong when the entry text itself is broken across
+    % lines.  So we use a small indentation and put up with long leaders.
+    %
+    % \hangafter is reset to 1 (which is the value we want) at the start
+    % of each paragraph, so we need not do anything with that.
+    \hangindent = 2em
+    %
+    % When the entry text needs to be broken, just fill out the first line
+    % with blank space.
+    \rightskip = 0pt plus1fil
+    %
+    % A bit of stretch before each entry for the benefit of balancing
+    % columns.
+    \vskip 0pt plus1pt
+    %
+    % When reading the text of entry, convert explicit line breaks
+    % from @* into spaces.  The user might give these in long section
+    % titles, for instance.
+    \def\*{\unskip\space\ignorespaces}%
+    \def\entrybreak{\hfil\break}%
+    %
+    % Swallow the left brace of the text (first parameter):
+    \afterassignment\doentry
+    \let\temp =
+}
+\def\entrybreak{\unskip\space\ignorespaces}%
+\def\doentry{%
+    \bgroup % Instead of the swallowed brace.
+      \noindent
+      \aftergroup\finishentry
+      % And now comes the text of the entry.
+}
+\def\finishentry#1{%
+    % #1 is the page number.
+    %
+    % The following is kludged to not output a line of dots in the index if
+    % there are no page numbers.  The next person who breaks this will be
+    % cursed by a Unix daemon.
+    \setbox\boxA = \hbox{#1}%
+    \ifdim\wd\boxA = 0pt
+      \ %
+    \else
+      %
+      % If we must, put the page number on a line of its own, and fill out
+      % this line with blank space.  (The \hfil is overwhelmed with the
+      % fill leaders glue in \indexdotfill if the page number does fit.)
+      \hfil\penalty50
+      \null\nobreak\indexdotfill % Have leaders before the page number.
+      %
+      % The `\ ' here is removed by the implicit \unskip that TeX does as
+      % part of (the primitive) \par.  Without it, a spurious underfull
+      % \hbox ensues.
+      \ifpdf
+	\pdfgettoks#1.%
+	\ \the\toksA
+      \else
+	\ #1%
+      \fi
+    \fi
+    \par
+  \endgroup
+}
+
+% Like plain.tex's \dotfill, except uses up at least 1 em.
+\def\indexdotfill{\cleaders
+  \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill}
+
+\def\primary #1{\line{#1\hfil}}
+
+\newskip\secondaryindent \secondaryindent=0.5cm
+\def\secondary#1#2{{%
+  \parfillskip=0in
+  \parskip=0in
+  \hangindent=1in
+  \hangafter=1
+  \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
+  \ifpdf
+    \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
+  \else
+    #2
+  \fi
+  \par
+}}
+
+% Define two-column mode, which we use to typeset indexes.
+% Adapted from the TeXbook, page 416, which is to say,
+% the manmac.tex format used to print the TeXbook itself.
+\catcode`\@=11
+
+\newbox\partialpage
+\newdimen\doublecolumnhsize
+
+\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
+  % Grab any single-column material above us.
+  \output = {%
+    %
+    % Here is a possibility not foreseen in manmac: if we accumulate a
+    % whole lot of material, we might end up calling this \output
+    % routine twice in a row (see the doublecol-lose test, which is
+    % essentially a couple of indexes with @setchapternewpage off).  In
+    % that case we just ship out what is in \partialpage with the normal
+    % output routine.  Generally, \partialpage will be empty when this
+    % runs and this will be a no-op.  See the indexspread.tex test case.
+    \ifvoid\partialpage \else
+      \onepageout{\pagecontents\partialpage}%
+    \fi
+    %
+    \global\setbox\partialpage = \vbox{%
+      % Unvbox the main output page.
+      \unvbox\PAGE
+      \kern-\topskip \kern\baselineskip
+    }%
+  }%
+  \eject % run that output routine to set \partialpage
+  %
+  % Use the double-column output routine for subsequent pages.
+  \output = {\doublecolumnout}%
+  %
+  % Change the page size parameters.  We could do this once outside this
+  % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
+  % format, but then we repeat the same computation.  Repeating a couple
+  % of assignments once per index is clearly meaningless for the
+  % execution time, so we may as well do it in one place.
+  %
+  % First we halve the line length, less a little for the gutter between
+  % the columns.  We compute the gutter based on the line length, so it
+  % changes automatically with the paper format.  The magic constant
+  % below is chosen so that the gutter has the same value (well, +-<1pt)
+  % as it did when we hard-coded it.
+  %
+  % We put the result in a separate register, \doublecolumhsize, so we
+  % can restore it in \pagesofar, after \hsize itself has (potentially)
+  % been clobbered.
+  %
+  \doublecolumnhsize = \hsize
+    \advance\doublecolumnhsize by -.04154\hsize
+    \divide\doublecolumnhsize by 2
+  \hsize = \doublecolumnhsize
+  %
+  % Double the \vsize as well.  (We don't need a separate register here,
+  % since nobody clobbers \vsize.)
+  \vsize = 2\vsize
+}
+
+% The double-column output routine for all double-column pages except
+% the last.
+%
+\def\doublecolumnout{%
+  \splittopskip=\topskip \splitmaxdepth=\maxdepth
+  % Get the available space for the double columns -- the normal
+  % (undoubled) page height minus any material left over from the
+  % previous page.
+  \dimen@ = \vsize
+  \divide\dimen@ by 2
+  \advance\dimen@ by -\ht\partialpage
+  %
+  % box0 will be the left-hand column, box2 the right.
+  \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
+  \onepageout\pagesofar
+  \unvbox255
+  \penalty\outputpenalty
+}
+%
+% Re-output the contents of the output page -- any previous material,
+% followed by the two boxes we just split, in box0 and box2.
+\def\pagesofar{%
+  \unvbox\partialpage
+  %
+  \hsize = \doublecolumnhsize
+  \wd0=\hsize \wd2=\hsize
+  \hbox to\pagewidth{\box0\hfil\box2}%
+}
+%
+% All done with double columns.
+\def\enddoublecolumns{%
+  % The following penalty ensures that the page builder is exercised
+  % _before_ we change the output routine.  This is necessary in the
+  % following situation:
+  %
+  % The last section of the index consists only of a single entry.
+  % Before this section, \pagetotal is less than \pagegoal, so no
+  % break occurs before the last section starts.  However, the last
+  % section, consisting of \initial and the single \entry, does not
+  % fit on the page and has to be broken off.  Without the following
+  % penalty the page builder will not be exercised until \eject
+  % below, and by that time we'll already have changed the output
+  % routine to the \balancecolumns version, so the next-to-last
+  % double-column page will be processed with \balancecolumns, which
+  % is wrong:  The two columns will go to the main vertical list, with
+  % the broken-off section in the recent contributions.  As soon as
+  % the output routine finishes, TeX starts reconsidering the page
+  % break.  The two columns and the broken-off section both fit on the
+  % page, because the two columns now take up only half of the page
+  % goal.  When TeX sees \eject from below which follows the final
+  % section, it invokes the new output routine that we've set after
+  % \balancecolumns below; \onepageout will try to fit the two columns
+  % and the final section into the vbox of \pageheight (see
+  % \pagebody), causing an overfull box.
+  %
+  % Note that glue won't work here, because glue does not exercise the
+  % page builder, unlike penalties (see The TeXbook, pp. 280-281).
+  \penalty0
+  %
+  \output = {%
+    % Split the last of the double-column material.  Leave it on the
+    % current page, no automatic page break.
+    \balancecolumns
+    %
+    % If we end up splitting too much material for the current page,
+    % though, there will be another page break right after this \output
+    % invocation ends.  Having called \balancecolumns once, we do not
+    % want to call it again.  Therefore, reset \output to its normal
+    % definition right away.  (We hope \balancecolumns will never be
+    % called on to balance too much material, but if it is, this makes
+    % the output somewhat more palatable.)
+    \global\output = {\onepageout{\pagecontents\PAGE}}%
+  }%
+  \eject
+  \endgroup % started in \begindoublecolumns
+  %
+  % \pagegoal was set to the doubled \vsize above, since we restarted
+  % the current page.  We're now back to normal single-column
+  % typesetting, so reset \pagegoal to the normal \vsize (after the
+  % \endgroup where \vsize got restored).
+  \pagegoal = \vsize
+}
+%
+% Called at the end of the double column material.
+\def\balancecolumns{%
+  \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
+  \dimen@ = \ht0
+  \advance\dimen@ by \topskip
+  \advance\dimen@ by-\baselineskip
+  \divide\dimen@ by 2 % target to split to
+  %debug\message{final 2-column material height=\the\ht0, target=\the\dimen at .}%
+  \splittopskip = \topskip
+  % Loop until we get a decent breakpoint.
+  {%
+    \vbadness = 10000
+    \loop
+      \global\setbox3 = \copy0
+      \global\setbox1 = \vsplit3 to \dimen@
+    \ifdim\ht3>\dimen@
+      \global\advance\dimen@ by 1pt
+    \repeat
+  }%
+  %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
+  \setbox0=\vbox to\dimen@{\unvbox1}%
+  \setbox2=\vbox to\dimen@{\unvbox3}%
+  %
+  \pagesofar
+}
+\catcode`\@ = \other
+
+
+\message{sectioning,}
+% Chapters, sections, etc.
+
+% Let's start with @part.
+\outer\parseargdef\part{\partzzz{#1}}
+\def\partzzz#1{%
+  \chapoddpage
+  \null
+  \vskip.3\vsize  % move it down on the page a bit
+  \begingroup
+    \noindent \titlefonts\rmisbold #1\par % the text
+    \let\lastnode=\empty      % no node to associate with
+    \writetocentry{part}{#1}{}% but put it in the toc
+    \headingsoff              % no headline or footline on the part page
+    \chapoddpage
+  \endgroup
+}
+
+% \unnumberedno is an oxymoron.  But we count the unnumbered
+% sections so that we can refer to them unambiguously in the pdf
+% outlines by their "section number".  We avoid collisions with chapter
+% numbers by starting them at 10000.  (If a document ever has 10000
+% chapters, we're in trouble anyway, I'm sure.)
+\newcount\unnumberedno \unnumberedno = 10000
+\newcount\chapno
+\newcount\secno        \secno=0
+\newcount\subsecno     \subsecno=0
+\newcount\subsubsecno  \subsubsecno=0
+
+% This counter is funny since it counts through charcodes of letters A, B, ...
+\newcount\appendixno  \appendixno = `\@
+%
+% \def\appendixletter{\char\the\appendixno}
+% We do the following ugly conditional instead of the above simple
+% construct for the sake of pdftex, which needs the actual
+% letter in the expansion, not just typeset.
+%
+\def\appendixletter{%
+  \ifnum\appendixno=`A A%
+  \else\ifnum\appendixno=`B B%
+  \else\ifnum\appendixno=`C C%
+  \else\ifnum\appendixno=`D D%
+  \else\ifnum\appendixno=`E E%
+  \else\ifnum\appendixno=`F F%
+  \else\ifnum\appendixno=`G G%
+  \else\ifnum\appendixno=`H H%
+  \else\ifnum\appendixno=`I I%
+  \else\ifnum\appendixno=`J J%
+  \else\ifnum\appendixno=`K K%
+  \else\ifnum\appendixno=`L L%
+  \else\ifnum\appendixno=`M M%
+  \else\ifnum\appendixno=`N N%
+  \else\ifnum\appendixno=`O O%
+  \else\ifnum\appendixno=`P P%
+  \else\ifnum\appendixno=`Q Q%
+  \else\ifnum\appendixno=`R R%
+  \else\ifnum\appendixno=`S S%
+  \else\ifnum\appendixno=`T T%
+  \else\ifnum\appendixno=`U U%
+  \else\ifnum\appendixno=`V V%
+  \else\ifnum\appendixno=`W W%
+  \else\ifnum\appendixno=`X X%
+  \else\ifnum\appendixno=`Y Y%
+  \else\ifnum\appendixno=`Z Z%
+  % The \the is necessary, despite appearances, because \appendixletter is
+  % expanded while writing the .toc file.  \char\appendixno is not
+  % expandable, thus it is written literally, thus all appendixes come out
+  % with the same letter (or @) in the toc without it.
+  \else\char\the\appendixno
+  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+
+% Each @chapter defines these (using marks) as the number+name, number
+% and name of the chapter.  Page headings and footings can use
+% these.  @section does likewise.
+\def\thischapter{}
+\def\thischapternum{}
+\def\thischaptername{}
+\def\thissection{}
+\def\thissectionnum{}
+\def\thissectionname{}
+
+\newcount\absseclevel % used to calculate proper heading level
+\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
+
+% @raisesections: treat @section as chapter, @subsection as section, etc.
+\def\raisesections{\global\advance\secbase by -1}
+\let\up=\raisesections % original BFox name
+
+% @lowersections: treat @chapter as section, @section as subsection, etc.
+\def\lowersections{\global\advance\secbase by 1}
+\let\down=\lowersections % original BFox name
+
+% we only have subsub.
+\chardef\maxseclevel = 3
+%
+% A numbered section within an unnumbered changes to unnumbered too.
+% To achieve this, remember the "biggest" unnum. sec. we are currently in:
+\chardef\unnlevel = \maxseclevel
+%
+% Trace whether the current chapter is an appendix or not:
+% \chapheadtype is "N" or "A", unnumbered chapters are ignored.
+\def\chapheadtype{N}
+
+% Choose a heading macro
+% #1 is heading type
+% #2 is heading level
+% #3 is text for heading
+\def\genhead#1#2#3{%
+  % Compute the abs. sec. level:
+  \absseclevel=#2
+  \advance\absseclevel by \secbase
+  % Make sure \absseclevel doesn't fall outside the range:
+  \ifnum \absseclevel < 0
+    \absseclevel = 0
+  \else
+    \ifnum \absseclevel > 3
+      \absseclevel = 3
+    \fi
+  \fi
+  % The heading type:
+  \def\headtype{#1}%
+  \if \headtype U%
+    \ifnum \absseclevel < \unnlevel
+      \chardef\unnlevel = \absseclevel
+    \fi
+  \else
+    % Check for appendix sections:
+    \ifnum \absseclevel = 0
+      \edef\chapheadtype{\headtype}%
+    \else
+      \if \headtype A\if \chapheadtype N%
+	\errmessage{@appendix... within a non-appendix chapter}%
+      \fi\fi
+    \fi
+    % Check for numbered within unnumbered:
+    \ifnum \absseclevel > \unnlevel
+      \def\headtype{U}%
+    \else
+      \chardef\unnlevel = 3
+    \fi
+  \fi
+  % Now print the heading:
+  \if \headtype U%
+    \ifcase\absseclevel
+	\unnumberedzzz{#3}%
+    \or \unnumberedseczzz{#3}%
+    \or \unnumberedsubseczzz{#3}%
+    \or \unnumberedsubsubseczzz{#3}%
+    \fi
+  \else
+    \if \headtype A%
+      \ifcase\absseclevel
+	  \appendixzzz{#3}%
+      \or \appendixsectionzzz{#3}%
+      \or \appendixsubseczzz{#3}%
+      \or \appendixsubsubseczzz{#3}%
+      \fi
+    \else
+      \ifcase\absseclevel
+	  \chapterzzz{#3}%
+      \or \seczzz{#3}%
+      \or \numberedsubseczzz{#3}%
+      \or \numberedsubsubseczzz{#3}%
+      \fi
+    \fi
+  \fi
+  \suppressfirstparagraphindent
+}
+
+% an interface:
+\def\numhead{\genhead N}
+\def\apphead{\genhead A}
+\def\unnmhead{\genhead U}
+
+% @chapter, @appendix, @unnumbered.  Increment top-level counter, reset
+% all lower-level sectioning counters to zero.
+%
+% Also set \chaplevelprefix, which we prepend to @float sequence numbers
+% (e.g., figures), q.v.  By default (before any chapter), that is empty.
+\let\chaplevelprefix = \empty
+%
+\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
+\def\chapterzzz#1{%
+  % section resetting is \global in case the chapter is in a group, such
+  % as an @include file.
+  \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+    \global\advance\chapno by 1
+  %
+  % Used for \float.
+  \gdef\chaplevelprefix{\the\chapno.}%
+  \resetallfloatnos
+  %
+  % \putwordChapter can contain complex things in translations.
+  \toks0=\expandafter{\putwordChapter}%
+  \message{\the\toks0 \space \the\chapno}%
+  %
+  % Write the actual heading.
+  \chapmacro{#1}{Ynumbered}{\the\chapno}%
+  %
+  % So @section and the like are numbered underneath this chapter.
+  \global\let\section = \numberedsec
+  \global\let\subsection = \numberedsubsec
+  \global\let\subsubsection = \numberedsubsubsec
+}
+
+\outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
+%
+\def\appendixzzz#1{%
+  \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+    \global\advance\appendixno by 1
+  \gdef\chaplevelprefix{\appendixletter.}%
+  \resetallfloatnos
+  %
+  % \putwordAppendix can contain complex things in translations.
+  \toks0=\expandafter{\putwordAppendix}%
+  \message{\the\toks0 \space \appendixletter}%
+  %
+  \chapmacro{#1}{Yappendix}{\appendixletter}%
+  %
+  \global\let\section = \appendixsec
+  \global\let\subsection = \appendixsubsec
+  \global\let\subsubsection = \appendixsubsubsec
+}
+
+% normally unnmhead0 calls unnumberedzzz:
+\outer\parseargdef\unnumbered{\unnmhead0{#1}}
+\def\unnumberedzzz#1{%
+  \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+    \global\advance\unnumberedno by 1
+  %
+  % Since an unnumbered has no number, no prefix for figures.
+  \global\let\chaplevelprefix = \empty
+  \resetallfloatnos
+  %
+  % This used to be simply \message{#1}, but TeX fully expands the
+  % argument to \message.  Therefore, if #1 contained @-commands, TeX
+  % expanded them.  For example, in `@unnumbered The @cite{Book}', TeX
+  % expanded @cite (which turns out to cause errors because \cite is meant
+  % to be executed, not expanded).
+  %
+  % Anyway, we don't want the fully-expanded definition of @cite to appear
+  % as a result of the \message, we just want `@cite' itself.  We use
+  % \the<toks register> to achieve this: TeX expands \the<toks> only once,
+  % simply yielding the contents of <toks register>.  (We also do this for
+  % the toc entries.)
+  \toks0 = {#1}%
+  \message{(\the\toks0)}%
+  %
+  \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
+  %
+  \global\let\section = \unnumberedsec
+  \global\let\subsection = \unnumberedsubsec
+  \global\let\subsubsection = \unnumberedsubsubsec
+}
+
+% @centerchap is like @unnumbered, but the heading is centered.
+\outer\parseargdef\centerchap{%
+  % Well, we could do the following in a group, but that would break
+  % an assumption that \chapmacro is called at the outermost level.
+  % Thus we are safer this way:		--kasal, 24feb04
+  \let\centerparametersmaybe = \centerparameters
+  \unnmhead0{#1}%
+  \let\centerparametersmaybe = \relax
+}
+
+% @top is like @unnumbered.
+\let\top\unnumbered
+
+% Sections.
+% 
+\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
+\def\seczzz#1{%
+  \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
+  \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
+}
+
+% normally calls appendixsectionzzz:
+\outer\parseargdef\appendixsection{\apphead1{#1}}
+\def\appendixsectionzzz#1{%
+  \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
+  \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
+}
+\let\appendixsec\appendixsection
+
+% normally calls unnumberedseczzz:
+\outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
+\def\unnumberedseczzz#1{%
+  \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
+  \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
+}
+
+% Subsections.
+% 
+% normally calls numberedsubseczzz:
+\outer\parseargdef\numberedsubsec{\numhead2{#1}}
+\def\numberedsubseczzz#1{%
+  \global\subsubsecno=0  \global\advance\subsecno by 1
+  \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
+}
+
+% normally calls appendixsubseczzz:
+\outer\parseargdef\appendixsubsec{\apphead2{#1}}
+\def\appendixsubseczzz#1{%
+  \global\subsubsecno=0  \global\advance\subsecno by 1
+  \sectionheading{#1}{subsec}{Yappendix}%
+                 {\appendixletter.\the\secno.\the\subsecno}%
+}
+
+% normally calls unnumberedsubseczzz:
+\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
+\def\unnumberedsubseczzz#1{%
+  \global\subsubsecno=0  \global\advance\subsecno by 1
+  \sectionheading{#1}{subsec}{Ynothing}%
+                 {\the\unnumberedno.\the\secno.\the\subsecno}%
+}
+
+% Subsubsections.
+% 
+% normally numberedsubsubseczzz:
+\outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
+\def\numberedsubsubseczzz#1{%
+  \global\advance\subsubsecno by 1
+  \sectionheading{#1}{subsubsec}{Ynumbered}%
+                 {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+% normally appendixsubsubseczzz:
+\outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
+\def\appendixsubsubseczzz#1{%
+  \global\advance\subsubsecno by 1
+  \sectionheading{#1}{subsubsec}{Yappendix}%
+                 {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+% normally unnumberedsubsubseczzz:
+\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
+\def\unnumberedsubsubseczzz#1{%
+  \global\advance\subsubsecno by 1
+  \sectionheading{#1}{subsubsec}{Ynothing}%
+                 {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+% These macros control what the section commands do, according
+% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
+% Define them by default for a numbered chapter.
+\let\section = \numberedsec
+\let\subsection = \numberedsubsec
+\let\subsubsection = \numberedsubsubsec
+
+% Define @majorheading, @heading and @subheading
+
+\def\majorheading{%
+  {\advance\chapheadingskip by 10pt \chapbreak }%
+  \parsearg\chapheadingzzz
+}
+
+\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
+\def\chapheadingzzz#1{%
+  \vbox{\chapfonts \raggedtitlesettings #1\par}%
+  \nobreak\bigskip \nobreak
+  \suppressfirstparagraphindent
+}
+
+% @heading, @subheading, @subsubheading.
+\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
+  \suppressfirstparagraphindent}
+\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
+  \suppressfirstparagraphindent}
+\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
+  \suppressfirstparagraphindent}
+
+% These macros generate a chapter, section, etc. heading only
+% (including whitespace, linebreaking, etc. around it),
+% given all the information in convenient, parsed form.
+
+% Args are the skip and penalty (usually negative)
+\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
+
+% Parameter controlling skip before chapter headings (if needed)
+\newskip\chapheadingskip
+
+% Define plain chapter starts, and page on/off switching for it.
+\def\chapbreak{\dobreak \chapheadingskip {-4000}}
+\def\chappager{\par\vfill\supereject}
+% Because \domark is called before \chapoddpage, the filler page will
+% get the headings for the next chapter, which is wrong.  But we don't
+% care -- we just disable all headings on the filler page.
+\def\chapoddpage{%
+  \chappager
+  \ifodd\pageno \else
+    \begingroup
+      \headingsoff
+      \null
+      \chappager
+    \endgroup
+  \fi
+}
+
+\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
+
+\def\CHAPPAGoff{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chapbreak
+\global\let\pagealignmacro=\chappager}
+
+\def\CHAPPAGon{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chappager
+\global\let\pagealignmacro=\chappager
+\global\def\HEADINGSon{\HEADINGSsingle}}
+
+\def\CHAPPAGodd{%
+\global\let\contentsalignmacro = \chapoddpage
+\global\let\pchapsepmacro=\chapoddpage
+\global\let\pagealignmacro=\chapoddpage
+\global\def\HEADINGSon{\HEADINGSdouble}}
+
+\CHAPPAGon
+
+% Chapter opening.
+%
+% #1 is the text, #2 is the section type (Ynumbered, Ynothing,
+% Yappendix, Yomitfromtoc), #3 the chapter number.
+%
+% To test against our argument.
+\def\Ynothingkeyword{Ynothing}
+\def\Yomitfromtockeyword{Yomitfromtoc}
+\def\Yappendixkeyword{Yappendix}
+%
+\def\chapmacro#1#2#3{%
+  % Insert the first mark before the heading break (see notes for \domark).
+  \let\prevchapterdefs=\lastchapterdefs
+  \let\prevsectiondefs=\lastsectiondefs
+  \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
+                        \gdef\thissection{}}%
+  %
+  \def\temptype{#2}%
+  \ifx\temptype\Ynothingkeyword
+    \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
+                          \gdef\thischapter{\thischaptername}}%
+  \else\ifx\temptype\Yomitfromtockeyword
+    \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
+                          \gdef\thischapter{}}%
+  \else\ifx\temptype\Yappendixkeyword
+    \toks0={#1}%
+    \xdef\lastchapterdefs{%
+      \gdef\noexpand\thischaptername{\the\toks0}%
+      \gdef\noexpand\thischapternum{\appendixletter}%
+      % \noexpand\putwordAppendix avoids expanding indigestible
+      % commands in some of the translations.
+      \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
+                                 \noexpand\thischapternum:
+                                 \noexpand\thischaptername}%
+    }%
+  \else
+    \toks0={#1}%
+    \xdef\lastchapterdefs{%
+      \gdef\noexpand\thischaptername{\the\toks0}%
+      \gdef\noexpand\thischapternum{\the\chapno}%
+      % \noexpand\putwordChapter avoids expanding indigestible
+      % commands in some of the translations.
+      \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
+                                 \noexpand\thischapternum:
+                                 \noexpand\thischaptername}%
+    }%
+  \fi\fi\fi
+  %
+  % Output the mark.  Pass it through \safewhatsit, to take care of
+  % the preceding space.
+  \safewhatsit\domark
+  %
+  % Insert the chapter heading break.
+  \pchapsepmacro
+  %
+  % Now the second mark, after the heading break.  No break points
+  % between here and the heading.
+  \let\prevchapterdefs=\lastchapterdefs
+  \let\prevsectiondefs=\lastsectiondefs
+  \domark
+  %
+  {%
+    \chapfonts \rmisbold
+    %
+    % Have to define \lastsection before calling \donoderef, because the
+    % xref code eventually uses it.  On the other hand, it has to be called
+    % after \pchapsepmacro, or the headline will change too soon.
+    \gdef\lastsection{#1}%
+    %
+    % Only insert the separating space if we have a chapter/appendix
+    % number, and don't print the unnumbered ``number''.
+    \ifx\temptype\Ynothingkeyword
+      \setbox0 = \hbox{}%
+      \def\toctype{unnchap}%
+    \else\ifx\temptype\Yomitfromtockeyword
+      \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
+      \def\toctype{omit}%
+    \else\ifx\temptype\Yappendixkeyword
+      \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
+      \def\toctype{app}%
+    \else
+      \setbox0 = \hbox{#3\enspace}%
+      \def\toctype{numchap}%
+    \fi\fi\fi
+    %
+    % Write the toc entry for this chapter.  Must come before the
+    % \donoderef, because we include the current node name in the toc
+    % entry, and \donoderef resets it to empty.
+    \writetocentry{\toctype}{#1}{#3}%
+    %
+    % For pdftex, we have to write out the node definition (aka, make
+    % the pdfdest) after any page break, but before the actual text has
+    % been typeset.  If the destination for the pdf outline is after the
+    % text, then jumping from the outline may wind up with the text not
+    % being visible, for instance under high magnification.
+    \donoderef{#2}%
+    %
+    % Typeset the actual heading.
+    \nobreak % Avoid page breaks at the interline glue.
+    \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
+          \unhbox0 #1\par}%
+  }%
+  \nobreak\bigskip % no page break after a chapter title
+  \nobreak
+}
+
+% @centerchap -- centered and unnumbered.
+\let\centerparametersmaybe = \relax
+\def\centerparameters{%
+  \advance\rightskip by 3\rightskip
+  \leftskip = \rightskip
+  \parfillskip = 0pt
+}
+
+
+% I don't think this chapter style is supported any more, so I'm not
+% updating it with the new noderef stuff.  We'll see.  --karl, 11aug03.
+%
+\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
+%
+\def\unnchfopen #1{%
+  \chapoddpage
+  \vbox{\chapfonts \raggedtitlesettings #1\par}%
+  \nobreak\bigskip\nobreak
+}
+\def\chfopen #1#2{\chapoddpage {\chapfonts
+\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
+\par\penalty 5000 %
+}
+\def\centerchfopen #1{%
+  \chapoddpage
+  \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}%
+  \nobreak\bigskip \nobreak
+}
+\def\CHAPFopen{%
+  \global\let\chapmacro=\chfopen
+  \global\let\centerchapmacro=\centerchfopen}
+
+
+% Section titles.  These macros combine the section number parts and
+% call the generic \sectionheading to do the printing.
+%
+\newskip\secheadingskip
+\def\secheadingbreak{\dobreak \secheadingskip{-1000}}
+
+% Subsection titles.
+\newskip\subsecheadingskip
+\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
+
+% Subsubsection titles.
+\def\subsubsecheadingskip{\subsecheadingskip}
+\def\subsubsecheadingbreak{\subsecheadingbreak}
+
+
+% Print any size, any type, section title.
+%
+% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
+% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
+% section number.
+%
+\def\seckeyword{sec}
+%
+\def\sectionheading#1#2#3#4{%
+  {%
+    \checkenv{}% should not be in an environment.
+    %
+    % Switch to the right set of fonts.
+    \csname #2fonts\endcsname \rmisbold
+    %
+    \def\sectionlevel{#2}%
+    \def\temptype{#3}%
+    %
+    % Insert first mark before the heading break (see notes for \domark).
+    \let\prevsectiondefs=\lastsectiondefs
+    \ifx\temptype\Ynothingkeyword
+      \ifx\sectionlevel\seckeyword
+        \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
+                              \gdef\thissection{\thissectionname}}%
+      \fi
+    \else\ifx\temptype\Yomitfromtockeyword
+      % Don't redefine \thissection.
+    \else\ifx\temptype\Yappendixkeyword
+      \ifx\sectionlevel\seckeyword
+        \toks0={#1}%
+        \xdef\lastsectiondefs{%
+          \gdef\noexpand\thissectionname{\the\toks0}%
+          \gdef\noexpand\thissectionnum{#4}%
+          % \noexpand\putwordSection avoids expanding indigestible
+          % commands in some of the translations.
+          \gdef\noexpand\thissection{\noexpand\putwordSection{}
+                                     \noexpand\thissectionnum:
+                                     \noexpand\thissectionname}%
+        }%
+      \fi
+    \else
+      \ifx\sectionlevel\seckeyword
+        \toks0={#1}%
+        \xdef\lastsectiondefs{%
+          \gdef\noexpand\thissectionname{\the\toks0}%
+          \gdef\noexpand\thissectionnum{#4}%
+          % \noexpand\putwordSection avoids expanding indigestible
+          % commands in some of the translations.
+          \gdef\noexpand\thissection{\noexpand\putwordSection{}
+                                     \noexpand\thissectionnum:
+                                     \noexpand\thissectionname}%
+        }%
+      \fi
+    \fi\fi\fi
+    %
+    % Go into vertical mode.  Usually we'll already be there, but we
+    % don't want the following whatsit to end up in a preceding paragraph
+    % if the document didn't happen to have a blank line.
+    \par
+    %
+    % Output the mark.  Pass it through \safewhatsit, to take care of
+    % the preceding space.
+    \safewhatsit\domark
+    %
+    % Insert space above the heading.
+    \csname #2headingbreak\endcsname
+    %
+    % Now the second mark, after the heading break.  No break points
+    % between here and the heading.
+    \let\prevsectiondefs=\lastsectiondefs
+    \domark
+    %
+    % Only insert the space after the number if we have a section number.
+    \ifx\temptype\Ynothingkeyword
+      \setbox0 = \hbox{}%
+      \def\toctype{unn}%
+      \gdef\lastsection{#1}%
+    \else\ifx\temptype\Yomitfromtockeyword
+      % for @headings -- no section number, don't include in toc,
+      % and don't redefine \lastsection.
+      \setbox0 = \hbox{}%
+      \def\toctype{omit}%
+      \let\sectionlevel=\empty
+    \else\ifx\temptype\Yappendixkeyword
+      \setbox0 = \hbox{#4\enspace}%
+      \def\toctype{app}%
+      \gdef\lastsection{#1}%
+    \else
+      \setbox0 = \hbox{#4\enspace}%
+      \def\toctype{num}%
+      \gdef\lastsection{#1}%
+    \fi\fi\fi
+    %
+    % Write the toc entry (before \donoderef).  See comments in \chapmacro.
+    \writetocentry{\toctype\sectionlevel}{#1}{#4}%
+    %
+    % Write the node reference (= pdf destination for pdftex).
+    % Again, see comments in \chapmacro.
+    \donoderef{#3}%
+    %
+    % Interline glue will be inserted when the vbox is completed.
+    % That glue will be a valid breakpoint for the page, since it'll be
+    % preceded by a whatsit (usually from the \donoderef, or from the
+    % \writetocentry if there was no node).  We don't want to allow that
+    % break, since then the whatsits could end up on page n while the
+    % section is on page n+1, thus toc/etc. are wrong.  Debian bug 276000.
+    \nobreak
+    %
+    % Output the actual section heading.
+    \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
+          \hangindent=\wd0  % zero if no section number
+          \unhbox0 #1}%
+  }%
+  % Add extra space after the heading -- half of whatever came above it.
+  % Don't allow stretch, though.
+  \kern .5 \csname #2headingskip\endcsname
+  %
+  % Do not let the kern be a potential breakpoint, as it would be if it
+  % was followed by glue.
+  \nobreak
+  %
+  % We'll almost certainly start a paragraph next, so don't let that
+  % glue accumulate.  (Not a breakpoint because it's preceded by a
+  % discardable item.)  However, when a paragraph is not started next
+  % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
+  % or the negative glue will cause weirdly wrong output, typically
+  % obscuring the section heading with something else.
+  \vskip-\parskip
+  %
+  % This is so the last item on the main vertical list is a known
+  % \penalty > 10000, so \startdefun, etc., can recognize the situation
+  % and do the needful.
+  \penalty 10001
+}
+
+
+\message{toc,}
+% Table of contents.
+\newwrite\tocfile
+
+% Write an entry to the toc file, opening it if necessary.
+% Called from @chapter, etc.
+%
+% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
+% We append the current node name (if any) and page number as additional
+% arguments for the \{chap,sec,...}entry macros which will eventually
+% read this.  The node name is used in the pdf outlines as the
+% destination to jump to.
+%
+% We open the .toc file for writing here instead of at @setfilename (or
+% any other fixed time) so that @contents can be anywhere in the document.
+% But if #1 is `omit', then we don't do anything.  This is used for the
+% table of contents chapter openings themselves.
+%
+\newif\iftocfileopened
+\def\omitkeyword{omit}%
+%
+\def\writetocentry#1#2#3{%
+  \edef\writetoctype{#1}%
+  \ifx\writetoctype\omitkeyword \else
+    \iftocfileopened\else
+      \immediate\openout\tocfile = \jobname.toc
+      \global\tocfileopenedtrue
+    \fi
+    %
+    \iflinks
+      {\atdummies
+       \edef\temp{%
+         \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
+       \temp
+      }%
+    \fi
+  \fi
+  %
+  % Tell \shipout to create a pdf destination on each page, if we're
+  % writing pdf.  These are used in the table of contents.  We can't
+  % just write one on every page because the title pages are numbered
+  % 1 and 2 (the page numbers aren't printed), and so are the first
+  % two pages of the document.  Thus, we'd have two destinations named
+  % `1', and two named `2'.
+  \ifpdf \global\pdfmakepagedesttrue \fi
+}
+
+
+% These characters do not print properly in the Computer Modern roman
+% fonts, so we must take special care.  This is more or less redundant
+% with the Texinfo input format setup at the end of this file.
+%
+\def\activecatcodes{%
+  \catcode`\"=\active
+  \catcode`\$=\active
+  \catcode`\<=\active
+  \catcode`\>=\active
+  \catcode`\\=\active
+  \catcode`\^=\active
+  \catcode`\_=\active
+  \catcode`\|=\active
+  \catcode`\~=\active
+}
+
+
+% Read the toc file, which is essentially Texinfo input.
+\def\readtocfile{%
+  \setupdatafile
+  \activecatcodes
+  \input \tocreadfilename
+}
+
+\newskip\contentsrightmargin \contentsrightmargin=1in
+\newcount\savepageno
+\newcount\lastnegativepageno \lastnegativepageno = -1
+
+% Prepare to read what we've written to \tocfile.
+%
+\def\startcontents#1{%
+  % If @setchapternewpage on, and @headings double, the contents should
+  % start on an odd page, unlike chapters.  Thus, we maintain
+  % \contentsalignmacro in parallel with \pagealignmacro.
+  % From: Torbjorn Granlund <tege at matematik.su.se>
+  \contentsalignmacro
+  \immediate\closeout\tocfile
+  %
+  % Don't need to put `Contents' or `Short Contents' in the headline.
+  % It is abundantly clear what they are.
+  \chapmacro{#1}{Yomitfromtoc}{}%
+  %
+  \savepageno = \pageno
+  \begingroup                  % Set up to handle contents files properly.
+    \raggedbottom              % Worry more about breakpoints than the bottom.
+    \advance\hsize by -\contentsrightmargin % Don't use the full line length.
+    %
+    % Roman numerals for page numbers.
+    \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
+}
+
+% redefined for the two-volume lispref.  We always output on
+% \jobname.toc even if this is redefined.
+%
+\def\tocreadfilename{\jobname.toc}
+
+% Normal (long) toc.
+%
+\def\contents{%
+  \startcontents{\putwordTOC}%
+    \openin 1 \tocreadfilename\space
+    \ifeof 1 \else
+      \readtocfile
+    \fi
+    \vfill \eject
+    \contentsalignmacro % in case @setchapternewpage odd is in effect
+    \ifeof 1 \else
+      \pdfmakeoutlines
+    \fi
+    \closein 1
+  \endgroup
+  \lastnegativepageno = \pageno
+  \global\pageno = \savepageno
+}
+
+% And just the chapters.
+\def\summarycontents{%
+  \startcontents{\putwordShortTOC}%
+    %
+    \let\partentry = \shortpartentry
+    \let\numchapentry = \shortchapentry
+    \let\appentry = \shortchapentry
+    \let\unnchapentry = \shortunnchapentry
+    % We want a true roman here for the page numbers.
+    \secfonts
+    \let\rm=\shortcontrm \let\bf=\shortcontbf
+    \let\sl=\shortcontsl \let\tt=\shortconttt
+    \rm
+    \hyphenpenalty = 10000
+    \advance\baselineskip by 1pt % Open it up a little.
+    \def\numsecentry##1##2##3##4{}
+    \let\appsecentry = \numsecentry
+    \let\unnsecentry = \numsecentry
+    \let\numsubsecentry = \numsecentry
+    \let\appsubsecentry = \numsecentry
+    \let\unnsubsecentry = \numsecentry
+    \let\numsubsubsecentry = \numsecentry
+    \let\appsubsubsecentry = \numsecentry
+    \let\unnsubsubsecentry = \numsecentry
+    \openin 1 \tocreadfilename\space
+    \ifeof 1 \else
+      \readtocfile
+    \fi
+    \closein 1
+    \vfill \eject
+    \contentsalignmacro % in case @setchapternewpage odd is in effect
+  \endgroup
+  \lastnegativepageno = \pageno
+  \global\pageno = \savepageno
+}
+\let\shortcontents = \summarycontents
+
+% Typeset the label for a chapter or appendix for the short contents.
+% The arg is, e.g., `A' for an appendix, or `3' for a chapter.
+%
+\def\shortchaplabel#1{%
+  % This space should be enough, since a single number is .5em, and the
+  % widest letter (M) is 1em, at least in the Computer Modern fonts.
+  % But use \hss just in case.
+  % (This space doesn't include the extra space that gets added after
+  % the label; that gets put in by \shortchapentry above.)
+  %
+  % We'd like to right-justify chapter numbers, but that looks strange
+  % with appendix letters.  And right-justifying numbers and
+  % left-justifying letters looks strange when there is less than 10
+  % chapters.  Have to read the whole toc once to know how many chapters
+  % there are before deciding ...
+  \hbox to 1em{#1\hss}%
+}
+
+% These macros generate individual entries in the table of contents.
+% The first argument is the chapter or section name.
+% The last argument is the page number.
+% The arguments in between are the chapter number, section number, ...
+
+% Parts, in the main contents.  Replace the part number, which doesn't
+% exist, with an empty box.  Let's hope all the numbers have the same width.
+% Also ignore the page number, which is conventionally not printed.
+\def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
+\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
+%
+% Parts, in the short toc.
+\def\shortpartentry#1#2#3#4{%
+  \penalty-300
+  \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
+  \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
+}
+
+% Chapters, in the main contents.
+\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
+%
+% Chapters, in the short toc.
+% See comments in \dochapentry re vbox and related settings.
+\def\shortchapentry#1#2#3#4{%
+  \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
+}
+
+% Appendices, in the main contents.
+% Need the word Appendix, and a fixed-size box.
+%
+\def\appendixbox#1{%
+  % We use M since it's probably the widest letter.
+  \setbox0 = \hbox{\putwordAppendix{} M}%
+  \hbox to \wd0{\putwordAppendix{} #1\hss}}
+%
+\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
+
+% Unnumbered chapters.
+\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
+\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
+
+% Sections.
+\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
+\let\appsecentry=\numsecentry
+\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
+
+% Subsections.
+\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
+\let\appsubsecentry=\numsubsecentry
+\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
+
+% And subsubsections.
+\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
+\let\appsubsubsecentry=\numsubsubsecentry
+\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
+
+% This parameter controls the indentation of the various levels.
+% Same as \defaultparindent.
+\newdimen\tocindent \tocindent = 15pt
+
+% Now for the actual typesetting. In all these, #1 is the text and #2 is the
+% page number.
+%
+% If the toc has to be broken over pages, we want it to be at chapters
+% if at all possible; hence the \penalty.
+\def\dochapentry#1#2{%
+   \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
+   \begingroup
+     \chapentryfonts
+     \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+   \endgroup
+   \nobreak\vskip .25\baselineskip plus.1\baselineskip
+}
+
+\def\dosecentry#1#2{\begingroup
+  \secentryfonts \leftskip=\tocindent
+  \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsecentry#1#2{\begingroup
+  \subsecentryfonts \leftskip=2\tocindent
+  \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsubsecentry#1#2{\begingroup
+  \subsubsecentryfonts \leftskip=3\tocindent
+  \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+% We use the same \entry macro as for the index entries.
+\let\tocentry = \entry
+
+% Space between chapter (or whatever) number and the title.
+\def\labelspace{\hskip1em \relax}
+
+\def\dopageno#1{{\rm #1}}
+\def\doshortpageno#1{{\rm #1}}
+
+\def\chapentryfonts{\secfonts \rm}
+\def\secentryfonts{\textfonts}
+\def\subsecentryfonts{\textfonts}
+\def\subsubsecentryfonts{\textfonts}
+
+
+\message{environments,}
+% @foo ... @end foo.
+
+% @tex ... @end tex    escapes into raw TeX temporarily.
+% One exception: @ is still an escape character, so that @end tex works.
+% But \@ or @@ will get a plain @ character.
+
+\envdef\tex{%
+  \setupmarkupstyle{tex}%
+  \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
+  \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
+  \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
+  \catcode `\%=14
+  \catcode `\+=\other
+  \catcode `\"=\other
+  \catcode `\|=\other
+  \catcode `\<=\other
+  \catcode `\>=\other
+  \catcode`\`=\other
+  \catcode`\'=\other
+  \escapechar=`\\
+  %
+  % ' is active in math mode (mathcode"8000).  So reset it, and all our
+  % other math active characters (just in case), to plain's definitions.
+  \mathactive
+  %
+  \let\b=\ptexb
+  \let\bullet=\ptexbullet
+  \let\c=\ptexc
+  \let\,=\ptexcomma
+  \let\.=\ptexdot
+  \let\dots=\ptexdots
+  \let\equiv=\ptexequiv
+  \let\!=\ptexexclam
+  \let\i=\ptexi
+  \let\indent=\ptexindent
+  \let\noindent=\ptexnoindent
+  \let\{=\ptexlbrace
+  \let\+=\tabalign
+  \let\}=\ptexrbrace
+  \let\/=\ptexslash
+  \let\*=\ptexstar
+  \let\t=\ptext
+  \expandafter \let\csname top\endcsname=\ptextop  % outer
+  \let\frenchspacing=\plainfrenchspacing
+  %
+  \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
+  \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
+  \def\@{@}%
+}
+% There is no need to define \Etex.
+
+% Define @lisp ... @end lisp.
+% @lisp environment forms a group so it can rebind things,
+% including the definition of @end lisp (which normally is erroneous).
+
+% Amount to narrow the margins by for @lisp.
+\newskip\lispnarrowing \lispnarrowing=0.4in
+
+% This is the definition that ^^M gets inside @lisp, @example, and other
+% such environments.  \null is better than a space, since it doesn't
+% have any width.
+\def\lisppar{\null\endgraf}
+
+% This space is always present above and below environments.
+\newskip\envskipamount \envskipamount = 0pt
+
+% Make spacing and below environment symmetrical.  We use \parskip here
+% to help in doing that, since in @example-like environments \parskip
+% is reset to zero; thus the \afterenvbreak inserts no space -- but the
+% start of the next paragraph will insert \parskip.
+%
+\def\aboveenvbreak{{%
+  % =10000 instead of <10000 because of a special case in \itemzzz and
+  % \sectionheading, q.v.
+  \ifnum \lastpenalty=10000 \else
+    \advance\envskipamount by \parskip
+    \endgraf
+    \ifdim\lastskip<\envskipamount
+      \removelastskip
+      % it's not a good place to break if the last penalty was \nobreak
+      % or better ...
+      \ifnum\lastpenalty<10000 \penalty-50 \fi
+      \vskip\envskipamount
+    \fi
+  \fi
+}}
+
+\let\afterenvbreak = \aboveenvbreak
+
+% \nonarrowing is a flag.  If "set", @lisp etc don't narrow margins; it will
+% also clear it, so that its embedded environments do the narrowing again.
+\let\nonarrowing=\relax
+
+% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
+% environment contents.
+\font\circle=lcircle10
+\newdimen\circthick
+\newdimen\cartouter\newdimen\cartinner
+\newskip\normbskip\newskip\normpskip\newskip\normlskip
+\circthick=\fontdimen8\circle
+%
+\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
+\def\ctr{{\hskip 6pt\circle\char'010}}
+\def\cbl{{\circle\char'012\hskip -6pt}}
+\def\cbr{{\hskip 6pt\circle\char'011}}
+\def\carttop{\hbox to \cartouter{\hskip\lskip
+        \ctl\leaders\hrule height\circthick\hfil\ctr
+        \hskip\rskip}}
+\def\cartbot{\hbox to \cartouter{\hskip\lskip
+        \cbl\leaders\hrule height\circthick\hfil\cbr
+        \hskip\rskip}}
+%
+\newskip\lskip\newskip\rskip
+
+\envdef\cartouche{%
+  \ifhmode\par\fi  % can't be in the midst of a paragraph.
+  \startsavinginserts
+  \lskip=\leftskip \rskip=\rightskip
+  \leftskip=0pt\rightskip=0pt % we want these *outside*.
+  \cartinner=\hsize \advance\cartinner by-\lskip
+  \advance\cartinner by-\rskip
+  \cartouter=\hsize
+  \advance\cartouter by 18.4pt	% allow for 3pt kerns on either
+				% side, and for 6pt waste from
+				% each corner char, and rule thickness
+  \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
+  % Flag to tell @lisp, etc., not to narrow margin.
+  \let\nonarrowing = t%
+  %
+  % If this cartouche directly follows a sectioning command, we need the
+  % \parskip glue (backspaced over by default) or the cartouche can
+  % collide with the section heading.
+  \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
+  %
+  \vbox\bgroup
+      \baselineskip=0pt\parskip=0pt\lineskip=0pt
+      \carttop
+      \hbox\bgroup
+	  \hskip\lskip
+	  \vrule\kern3pt
+	  \vbox\bgroup
+	      \kern3pt
+	      \hsize=\cartinner
+	      \baselineskip=\normbskip
+	      \lineskip=\normlskip
+	      \parskip=\normpskip
+	      \vskip -\parskip
+	      \comment % For explanation, see the end of def\group.
+}
+\def\Ecartouche{%
+              \ifhmode\par\fi
+	      \kern3pt
+	  \egroup
+	  \kern3pt\vrule
+	  \hskip\rskip
+      \egroup
+      \cartbot
+  \egroup
+  \checkinserts
+}
+
+
+% This macro is called at the beginning of all the @example variants,
+% inside a group.
+\newdimen\nonfillparindent
+\def\nonfillstart{%
+  \aboveenvbreak
+  \hfuzz = 12pt % Don't be fussy
+  \sepspaces % Make spaces be word-separators rather than space tokens.
+  \let\par = \lisppar % don't ignore blank lines
+  \obeylines % each line of input is a line of output
+  \parskip = 0pt
+  % Turn off paragraph indentation but redefine \indent to emulate
+  % the normal \indent.
+  \nonfillparindent=\parindent
+  \parindent = 0pt
+  \let\indent\nonfillindent
+  %
+  \emergencystretch = 0pt % don't try to avoid overfull boxes
+  \ifx\nonarrowing\relax
+    \advance \leftskip by \lispnarrowing
+    \exdentamount=\lispnarrowing
+  \else
+    \let\nonarrowing = \relax
+  \fi
+  \let\exdent=\nofillexdent
+}
+
+\begingroup
+\obeyspaces
+% We want to swallow spaces (but not other tokens) after the fake
+% @indent in our nonfill-environments, where spaces are normally
+% active and set to @tie, resulting in them not being ignored after
+% @indent.
+\gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
+\gdef\nonfillindentcheck{%
+\ifx\temp %
+\expandafter\nonfillindentgobble%
+\else%
+\leavevmode\nonfillindentbox%
+\fi%
+}%
+\endgroup
+\def\nonfillindentgobble#1{\nonfillindent}
+\def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
+
+% If you want all examples etc. small: @set dispenvsize small.
+% If you want even small examples the full size: @set dispenvsize nosmall.
+% This affects the following displayed environments:
+%    @example, @display, @format, @lisp
+%
+\def\smallword{small}
+\def\nosmallword{nosmall}
+\let\SETdispenvsize\relax
+\def\setnormaldispenv{%
+  \ifx\SETdispenvsize\smallword
+    % end paragraph for sake of leading, in case document has no blank
+    % line.  This is redundant with what happens in \aboveenvbreak, but
+    % we need to do it before changing the fonts, and it's inconvenient
+    % to change the fonts afterward.
+    \ifnum \lastpenalty=10000 \else \endgraf \fi
+    \smallexamplefonts \rm
+  \fi
+}
+\def\setsmalldispenv{%
+  \ifx\SETdispenvsize\nosmallword
+  \else
+    \ifnum \lastpenalty=10000 \else \endgraf \fi
+    \smallexamplefonts \rm
+  \fi
+}
+
+% We often define two environments, @foo and @smallfoo.
+% Let's do it in one command.  #1 is the env name, #2 the definition.
+\def\makedispenvdef#1#2{%
+  \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
+  \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
+  \expandafter\let\csname E#1\endcsname \afterenvbreak
+  \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
+}
+
+% Define two environment synonyms (#1 and #2) for an environment.
+\def\maketwodispenvdef#1#2#3{%
+  \makedispenvdef{#1}{#3}%
+  \makedispenvdef{#2}{#3}%
+}
+%
+% @lisp: indented, narrowed, typewriter font;
+% @example: same as @lisp.
+%
+% @smallexample and @smalllisp: use smaller fonts.
+% Originally contributed by Pavel at xerox.
+%
+\maketwodispenvdef{lisp}{example}{%
+  \nonfillstart
+  \tt\setupmarkupstyle{example}%
+  \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
+  \gobble % eat return
+}
+% @display/@smalldisplay: same as @lisp except keep current font.
+%
+\makedispenvdef{display}{%
+  \nonfillstart
+  \gobble
+}
+
+% @format/@smallformat: same as @display except don't narrow margins.
+%
+\makedispenvdef{format}{%
+  \let\nonarrowing = t%
+  \nonfillstart
+  \gobble
+}
+
+% @flushleft: same as @format, but doesn't obey \SETdispenvsize.
+\envdef\flushleft{%
+  \let\nonarrowing = t%
+  \nonfillstart
+  \gobble
+}
+\let\Eflushleft = \afterenvbreak
+
+% @flushright.
+%
+\envdef\flushright{%
+  \let\nonarrowing = t%
+  \nonfillstart
+  \advance\leftskip by 0pt plus 1fill\relax
+  \gobble
+}
+\let\Eflushright = \afterenvbreak
+
+
+% @raggedright does more-or-less normal line breaking but no right
+% justification.  From plain.tex.
+\envdef\raggedright{%
+  \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax
+}
+\let\Eraggedright\par
+
+\envdef\raggedleft{%
+  \parindent=0pt \leftskip0pt plus2em
+  \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
+  \hbadness=10000 % Last line will usually be underfull, so turn off
+                  % badness reporting.
+}
+\let\Eraggedleft\par
+
+\envdef\raggedcenter{%
+  \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
+  \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
+  \hbadness=10000 % Last line will usually be underfull, so turn off
+                  % badness reporting.
+}
+\let\Eraggedcenter\par
+
+
+% @quotation does normal linebreaking (hence we can't use \nonfillstart)
+% and narrows the margins.  We keep \parskip nonzero in general, since
+% we're doing normal filling.  So, when using \aboveenvbreak and
+% \afterenvbreak, temporarily make \parskip 0.
+%
+\makedispenvdef{quotation}{\quotationstart}
+%
+\def\quotationstart{%
+  \indentedblockstart % same as \indentedblock, but increase right margin too.
+  \ifx\nonarrowing\relax
+    \advance\rightskip by \lispnarrowing
+  \fi
+  \parsearg\quotationlabel
+}
+
+% We have retained a nonzero parskip for the environment, since we're
+% doing normal filling.
+%
+\def\Equotation{%
+  \par
+  \ifx\quotationauthor\thisisundefined\else
+    % indent a bit.
+    \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
+  \fi
+  {\parskip=0pt \afterenvbreak}%
+}
+\def\Esmallquotation{\Equotation}
+
+% If we're given an argument, typeset it in bold with a colon after.
+\def\quotationlabel#1{%
+  \def\temp{#1}%
+  \ifx\temp\empty \else
+    {\bf #1: }%
+  \fi
+}
+
+% @indentedblock is like @quotation, but indents only on the left and
+% has no optional argument.
+% 
+\makedispenvdef{indentedblock}{\indentedblockstart}
+%
+\def\indentedblockstart{%
+  {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
+  \parindent=0pt
+  %
+  % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+  \ifx\nonarrowing\relax
+    \advance\leftskip by \lispnarrowing
+    \exdentamount = \lispnarrowing
+  \else
+    \let\nonarrowing = \relax
+  \fi
+}
+
+% Keep a nonzero parskip for the environment, since we're doing normal filling.
+%
+\def\Eindentedblock{%
+  \par
+  {\parskip=0pt \afterenvbreak}%
+}
+\def\Esmallindentedblock{\Eindentedblock}
+
+
+% LaTeX-like @verbatim... at end verbatim and @verb{<char>...<char>}
+% If we want to allow any <char> as delimiter,
+% we need the curly braces so that makeinfo sees the @verb command, eg:
+% `@verbx...x' would look like the '@verbx' command.  --janneke at gnu.org
+%
+% [Knuth]: Donald Ervin Knuth, 1996.  The TeXbook.
+%
+% [Knuth] p.344; only we need to do the other characters Texinfo sets
+% active too.  Otherwise, they get lost as the first character on a
+% verbatim line.
+\def\dospecials{%
+  \do\ \do\\\do\{\do\}\do\$\do\&%
+  \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
+  \do\<\do\>\do\|\do\@\do+\do\"%
+  % Don't do the quotes -- if we do, @set txicodequoteundirected and
+  % @set txicodequotebacktick will not have effect on @verb and
+  % @verbatim, and ?` and !` ligatures won't get disabled.
+  %\do\`\do\'%
+}
+%
+% [Knuth] p. 380
+\def\uncatcodespecials{%
+  \def\do##1{\catcode`##1=\other}\dospecials}
+%
+% Setup for the @verb command.
+%
+% Eight spaces for a tab
+\begingroup
+  \catcode`\^^I=\active
+  \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
+\endgroup
+%
+\def\setupverb{%
+  \tt  % easiest (and conventionally used) font for verbatim
+  \def\par{\leavevmode\endgraf}%
+  \setupmarkupstyle{verb}%
+  \tabeightspaces
+  % Respect line breaks,
+  % print special symbols as themselves, and
+  % make each space count
+  % must do in this order:
+  \obeylines \uncatcodespecials \sepspaces
+}
+
+% Setup for the @verbatim environment
+%
+% Real tab expansion.
+\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
+%
+% We typeset each line of the verbatim in an \hbox, so we can handle
+% tabs.  The \global is in case the verbatim line starts with an accent,
+% or some other command that starts with a begin-group.  Otherwise, the
+% entire \verbbox would disappear at the corresponding end-group, before
+% it is typeset.  Meanwhile, we can't have nested verbatim commands
+% (can we?), so the \global won't be overwriting itself.
+\newbox\verbbox
+\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
+%
+\begingroup
+  \catcode`\^^I=\active
+  \gdef\tabexpand{%
+    \catcode`\^^I=\active
+    \def^^I{\leavevmode\egroup
+      \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
+      \divide\dimen\verbbox by\tabw
+      \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
+      \advance\dimen\verbbox by\tabw  % advance to next multiple of \tabw
+      \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
+    }%
+  }
+\endgroup
+
+% start the verbatim environment.
+\def\setupverbatim{%
+  \let\nonarrowing = t%
+  \nonfillstart
+  \tt % easiest (and conventionally used) font for verbatim
+  % The \leavevmode here is for blank lines.  Otherwise, we would
+  % never \starttabox and the \egroup would end verbatim mode.
+  \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
+  \tabexpand
+  \setupmarkupstyle{verbatim}%
+  % Respect line breaks,
+  % print special symbols as themselves, and
+  % make each space count.
+  % Must do in this order:
+  \obeylines \uncatcodespecials \sepspaces
+  \everypar{\starttabbox}%
+}
+
+% Do the @verb magic: verbatim text is quoted by unique
+% delimiter characters.  Before first delimiter expect a
+% right brace, after last delimiter expect closing brace:
+%
+%    \def\doverb'{'<char>#1<char>'}'{#1}
+%
+% [Knuth] p. 382; only eat outer {}
+\begingroup
+  \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
+  \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
+\endgroup
+%
+\def\verb{\begingroup\setupverb\doverb}
+%
+%
+% Do the @verbatim magic: define the macro \doverbatim so that
+% the (first) argument ends when '@end verbatim' is reached, ie:
+%
+%     \def\doverbatim#1 at end verbatim{#1}
+%
+% For Texinfo it's a lot easier than for LaTeX,
+% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
+% we need not redefine '\', '{' and '}'.
+%
+% Inspired by LaTeX's verbatim command set [latex.ltx]
+%
+\begingroup
+  \catcode`\ =\active
+  \obeylines %
+  % ignore everything up to the first ^^M, that's the newline at the end
+  % of the @verbatim input line itself.  Otherwise we get an extra blank
+  % line in the output.
+  \xdef\doverbatim#1^^M#2 at end verbatim{#2\noexpand\end\gobble verbatim}%
+  % We really want {...\end verbatim} in the body of the macro, but
+  % without the active space; thus we have to use \xdef and \gobble.
+\endgroup
+%
+\envdef\verbatim{%
+    \setupverbatim\doverbatim
+}
+\let\Everbatim = \afterenvbreak
+
+
+% @verbatiminclude FILE - insert text of file in verbatim environment.
+%
+\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
+%
+\def\doverbatiminclude#1{%
+  {%
+    \makevalueexpandable
+    \setupverbatim
+    \indexnofonts       % Allow `@@' and other weird things in file names.
+    \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
+    \input #1
+    \afterenvbreak
+  }%
+}
+
+% @copying ... @end copying.
+% Save the text away for @insertcopying later.
+%
+% We save the uninterpreted tokens, rather than creating a box.
+% Saving the text in a box would be much easier, but then all the
+% typesetting commands (@smallbook, font changes, etc.) have to be done
+% beforehand -- and a) we want @copying to be done first in the source
+% file; b) letting users define the frontmatter in as flexible order as
+% possible is very desirable.
+%
+\def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
+\def\docopying#1 at end copying{\endgroup\def\copyingtext{#1}}
+%
+\def\insertcopying{%
+  \begingroup
+    \parindent = 0pt  % paragraph indentation looks wrong on title page
+    \scanexp\copyingtext
+  \endgroup
+}
+
+
+\message{defuns,}
+% @defun etc.
+
+\newskip\defbodyindent \defbodyindent=.4in
+\newskip\defargsindent \defargsindent=50pt
+\newskip\deflastargmargin \deflastargmargin=18pt
+\newcount\defunpenalty
+
+% Start the processing of @deffn:
+\def\startdefun{%
+  \ifnum\lastpenalty<10000
+    \medbreak
+    \defunpenalty=10003 % Will keep this @deffn together with the
+                        % following @def command, see below.
+  \else
+    % If there are two @def commands in a row, we'll have a \nobreak,
+    % which is there to keep the function description together with its
+    % header.  But if there's nothing but headers, we need to allow a
+    % break somewhere.  Check specifically for penalty 10002, inserted
+    % by \printdefunline, instead of 10000, since the sectioning
+    % commands also insert a nobreak penalty, and we don't want to allow
+    % a break between a section heading and a defun.
+    %
+    % As a further refinement, we avoid "club" headers by signalling
+    % with penalty of 10003 after the very first @deffn in the
+    % sequence (see above), and penalty of 10002 after any following
+    % @def command.
+    \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
+    %
+    % Similarly, after a section heading, do not allow a break.
+    % But do insert the glue.
+    \medskip  % preceded by discardable penalty, so not a breakpoint
+  \fi
+  %
+  \parindent=0in
+  \advance\leftskip by \defbodyindent
+  \exdentamount=\defbodyindent
+}
+
+\def\dodefunx#1{%
+  % First, check whether we are in the right environment:
+  \checkenv#1%
+  %
+  % As above, allow line break if we have multiple x headers in a row.
+  % It's not a great place, though.
+  \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
+  %
+  % And now, it's time to reuse the body of the original defun:
+  \expandafter\gobbledefun#1%
+}
+\def\gobbledefun#1\startdefun{}
+
+% \printdefunline \deffnheader{text}
+%
+\def\printdefunline#1#2{%
+  \begingroup
+    % call \deffnheader:
+    #1#2 \endheader
+    % common ending:
+    \interlinepenalty = 10000
+    \advance\rightskip by 0pt plus 1fil\relax
+    \endgraf
+    \nobreak\vskip -\parskip
+    \penalty\defunpenalty  % signal to \startdefun and \dodefunx
+    % Some of the @defun-type tags do not enable magic parentheses,
+    % rendering the following check redundant.  But we don't optimize.
+    \checkparencounts
+  \endgroup
+}
+
+\def\Edefun{\endgraf\medbreak}
+
+% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
+% the only thing remaining is to define \deffnheader.
+%
+\def\makedefun#1{%
+  \expandafter\let\csname E#1\endcsname = \Edefun
+  \edef\temp{\noexpand\domakedefun
+    \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
+  \temp
+}
+
+% \domakedefun \deffn \deffnx \deffnheader
+%
+% Define \deffn and \deffnx, without parameters.
+% \deffnheader has to be defined explicitly.
+%
+\def\domakedefun#1#2#3{%
+  \envdef#1{%
+    \startdefun
+    \doingtypefnfalse    % distinguish typed functions from all else
+    \parseargusing\activeparens{\printdefunline#3}%
+  }%
+  \def#2{\dodefunx#1}%
+  \def#3%
+}
+
+\newif\ifdoingtypefn       % doing typed function?
+\newif\ifrettypeownline    % typeset return type on its own line?
+
+% @deftypefnnewline on|off says whether the return type of typed functions
+% are printed on their own line.  This affects @deftypefn, @deftypefun,
+% @deftypeop, and @deftypemethod.
+% 
+\parseargdef\deftypefnnewline{%
+  \def\temp{#1}%
+  \ifx\temp\onword
+    \expandafter\let\csname SETtxideftypefnnl\endcsname
+      = \empty
+  \else\ifx\temp\offword
+    \expandafter\let\csname SETtxideftypefnnl\endcsname
+      = \relax
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @txideftypefnnl value `\temp',
+                must be on|off}%
+  \fi\fi
+}
+
+% Untyped functions:
+
+% @deffn category name args
+\makedefun{deffn}{\deffngeneral{}}
+
+% @deffn category class name args
+\makedefun{defop}#1 {\defopon{#1\ \putwordon}}
+
+% \defopon {category on}class name args
+\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
+
+% \deffngeneral {subind}category name args
+%
+\def\deffngeneral#1#2 #3 #4\endheader{%
+  % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
+  \dosubind{fn}{\code{#3}}{#1}%
+  \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
+}
+
+% Typed functions:
+
+% @deftypefn category type name args
+\makedefun{deftypefn}{\deftypefngeneral{}}
+
+% @deftypeop category class type name args
+\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
+
+% \deftypeopon {category on}class type name args
+\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
+
+% \deftypefngeneral {subind}category type name args
+%
+\def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
+  \dosubind{fn}{\code{#4}}{#1}%
+  \doingtypefntrue
+  \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
+}
+
+% Typed variables:
+
+% @deftypevr category type var args
+\makedefun{deftypevr}{\deftypecvgeneral{}}
+
+% @deftypecv category class type var args
+\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
+
+% \deftypecvof {category of}class type var args
+\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
+
+% \deftypecvgeneral {subind}category type var args
+%
+\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
+  \dosubind{vr}{\code{#4}}{#1}%
+  \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
+}
+
+% Untyped variables:
+
+% @defvr category var args
+\makedefun{defvr}#1 {\deftypevrheader{#1} {} }
+
+% @defcv category class var args
+\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
+
+% \defcvof {category of}class var args
+\def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
+
+% Types:
+
+% @deftp category name args
+\makedefun{deftp}#1 #2 #3\endheader{%
+  \doind{tp}{\code{#2}}%
+  \defname{#1}{}{#2}\defunargs{#3\unskip}%
+}
+
+% Remaining @defun-like shortcuts:
+\makedefun{defun}{\deffnheader{\putwordDeffunc} }
+\makedefun{defmac}{\deffnheader{\putwordDefmac} }
+\makedefun{defspec}{\deffnheader{\putwordDefspec} }
+\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
+\makedefun{defvar}{\defvrheader{\putwordDefvar} }
+\makedefun{defopt}{\defvrheader{\putwordDefopt} }
+\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
+\makedefun{defmethod}{\defopon\putwordMethodon}
+\makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
+\makedefun{defivar}{\defcvof\putwordInstanceVariableof}
+\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
+
+% \defname, which formats the name of the @def (not the args).
+% #1 is the category, such as "Function".
+% #2 is the return type, if any.
+% #3 is the function name.
+%
+% We are followed by (but not passed) the arguments, if any.
+%
+\def\defname#1#2#3{%
+  \par
+  % Get the values of \leftskip and \rightskip as they were outside the @def...
+  \advance\leftskip by -\defbodyindent
+  %
+  % Determine if we are typesetting the return type of a typed function
+  % on a line by itself.
+  \rettypeownlinefalse
+  \ifdoingtypefn  % doing a typed function specifically?
+    % then check user option for putting return type on its own line:
+    \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
+      \rettypeownlinetrue
+    \fi
+  \fi
+  %
+  % How we'll format the category name.  Putting it in brackets helps
+  % distinguish it from the body text that may end up on the next line
+  % just below it.
+  \def\temp{#1}%
+  \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
+  %
+  % Figure out line sizes for the paragraph shape.  We'll always have at
+  % least two.
+  \tempnum = 2
+  %
+  % The first line needs space for \box0; but if \rightskip is nonzero,
+  % we need only space for the part of \box0 which exceeds it:
+  \dimen0=\hsize  \advance\dimen0 by -\wd0  \advance\dimen0 by \rightskip
+  %
+  % If doing a return type on its own line, we'll have another line.
+  \ifrettypeownline
+    \advance\tempnum by 1
+    \def\maybeshapeline{0in \hsize}%
+  \else
+    \def\maybeshapeline{}%
+  \fi
+  %
+  % The continuations:
+  \dimen2=\hsize  \advance\dimen2 by -\defargsindent
+  %
+  % The final paragraph shape:
+  \parshape \tempnum  0in \dimen0  \maybeshapeline  \defargsindent \dimen2
+  %
+  % Put the category name at the right margin.
+  \noindent
+  \hbox to 0pt{%
+    \hfil\box0 \kern-\hsize
+    % \hsize has to be shortened this way:
+    \kern\leftskip
+    % Intentionally do not respect \rightskip, since we need the space.
+  }%
+  %
+  % Allow all lines to be underfull without complaint:
+  \tolerance=10000 \hbadness=10000
+  \exdentamount=\defbodyindent
+  {%
+    % defun fonts. We use typewriter by default (used to be bold) because:
+    % . we're printing identifiers, they should be in tt in principle.
+    % . in languages with many accents, such as Czech or French, it's
+    %   common to leave accents off identifiers.  The result looks ok in
+    %   tt, but exceedingly strange in rm.
+    % . we don't want -- and --- to be treated as ligatures.
+    % . this still does not fix the ?` and !` ligatures, but so far no
+    %   one has made identifiers using them :).
+    \df \tt
+    \def\temp{#2}% text of the return type
+    \ifx\temp\empty\else
+      \tclose{\temp}% typeset the return type
+      \ifrettypeownline
+        % put return type on its own line; prohibit line break following:
+        \hfil\vadjust{\nobreak}\break  
+      \else
+        \space  % type on same line, so just followed by a space
+      \fi
+    \fi           % no return type
+    #3% output function name
+  }%
+  {\rm\enskip}% hskip 0.5 em of \tenrm
+  %
+  \boldbrax
+  % arguments will be output next, if any.
+}
+
+% Print arguments in slanted roman (not ttsl), inconsistently with using
+% tt for the name.  This is because literal text is sometimes needed in
+% the argument list (groff manual), and ttsl and tt are not very
+% distinguishable.  Prevent hyphenation at `-' chars.
+%
+\def\defunargs#1{%
+  % use sl by default (not ttsl),
+  % tt for the names.
+  \df \sl \hyphenchar\font=0
+  %
+  % On the other hand, if an argument has two dashes (for instance), we
+  % want a way to get ttsl.  We used to recommend @var for that, so
+  % leave the code in, but it's strange for @var to lead to typewriter.
+  % Nowadays we recommend @code, since the difference between a ttsl hyphen
+  % and a tt hyphen is pretty tiny.  @code also disables ?` !`.
+  \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
+  #1%
+  \sl\hyphenchar\font=45
+}
+
+% We want ()&[] to print specially on the defun line.
+%
+\def\activeparens{%
+  \catcode`\(=\active \catcode`\)=\active
+  \catcode`\[=\active \catcode`\]=\active
+  \catcode`\&=\active
+}
+
+% Make control sequences which act like normal parenthesis chars.
+\let\lparen = ( \let\rparen = )
+
+% Be sure that we always have a definition for `(', etc.  For example,
+% if the fn name has parens in it, \boldbrax will not be in effect yet,
+% so TeX would otherwise complain about undefined control sequence.
+{
+  \activeparens
+  \global\let(=\lparen \global\let)=\rparen
+  \global\let[=\lbrack \global\let]=\rbrack
+  \global\let& = \&
+
+  \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
+  \gdef\magicamp{\let&=\amprm}
+}
+
+\newcount\parencount
+
+% If we encounter &foo, then turn on ()-hacking afterwards
+\newif\ifampseen
+\def\amprm#1 {\ampseentrue{\bf\&#1 }}
+
+\def\parenfont{%
+  \ifampseen
+    % At the first level, print parens in roman,
+    % otherwise use the default font.
+    \ifnum \parencount=1 \rm \fi
+  \else
+    % The \sf parens (in \boldbrax) actually are a little bolder than
+    % the contained text.  This is especially needed for [ and ] .
+    \sf
+  \fi
+}
+\def\infirstlevel#1{%
+  \ifampseen
+    \ifnum\parencount=1
+      #1%
+    \fi
+  \fi
+}
+\def\bfafterword#1 {#1 \bf}
+
+\def\opnr{%
+  \global\advance\parencount by 1
+  {\parenfont(}%
+  \infirstlevel \bfafterword
+}
+\def\clnr{%
+  {\parenfont)}%
+  \infirstlevel \sl
+  \global\advance\parencount by -1
+}
+
+\newcount\brackcount
+\def\lbrb{%
+  \global\advance\brackcount by 1
+  {\bf[}%
+}
+\def\rbrb{%
+  {\bf]}%
+  \global\advance\brackcount by -1
+}
+
+\def\checkparencounts{%
+  \ifnum\parencount=0 \else \badparencount \fi
+  \ifnum\brackcount=0 \else \badbrackcount \fi
+}
+% these should not use \errmessage; the glibc manual, at least, actually
+% has such constructs (when documenting function pointers).
+\def\badparencount{%
+  \message{Warning: unbalanced parentheses in @def...}%
+  \global\parencount=0
+}
+\def\badbrackcount{%
+  \message{Warning: unbalanced square brackets in @def...}%
+  \global\brackcount=0
+}
+
+
+\message{macros,}
+% @macro.
+
+% To do this right we need a feature of e-TeX, \scantokens,
+% which we arrange to emulate with a temporary file in ordinary TeX.
+\ifx\eTeXversion\thisisundefined
+  \newwrite\macscribble
+  \def\scantokens#1{%
+    \toks0={#1}%
+    \immediate\openout\macscribble=\jobname.tmp
+    \immediate\write\macscribble{\the\toks0}%
+    \immediate\closeout\macscribble
+    \input \jobname.tmp
+  }
+\fi
+
+\def\scanmacro#1{\begingroup
+  \newlinechar`\^^M
+  \let\xeatspaces\eatspaces
+  %
+  % Undo catcode changes of \startcontents and \doprintindex
+  % When called from @insertcopying or (short)caption, we need active
+  % backslash to get it printed correctly.  Previously, we had
+  % \catcode`\\=\other instead.  We'll see whether a problem appears
+  % with macro expansion.				--kasal, 19aug04
+  \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
+  %
+  % ... and for \example:
+  \spaceisspace
+  %
+  % The \empty here causes a following catcode 5 newline to be eaten as
+  % part of reading whitespace after a control sequence.  It does not
+  % eat a catcode 13 newline.  There's no good way to handle the two
+  % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX
+  % would then have different behavior).  See the Macro Details node in
+  % the manual for the workaround we recommend for macros and
+  % line-oriented commands.
+  % 
+  \scantokens{#1\empty}%
+\endgroup}
+
+\def\scanexp#1{%
+  \edef\temp{\noexpand\scanmacro{#1}}%
+  \temp
+}
+
+\newcount\paramno   % Count of parameters
+\newtoks\macname    % Macro name
+\newif\ifrecursive  % Is it recursive?
+
+% List of all defined macros in the form
+%    \definedummyword\macro1\definedummyword\macro2...
+% Currently is also contains all @aliases; the list can be split
+% if there is a need.
+\def\macrolist{}
+
+% Add the macro to \macrolist
+\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
+\def\addtomacrolistxxx#1{%
+     \toks0 = \expandafter{\macrolist\definedummyword#1}%
+     \xdef\macrolist{\the\toks0}%
+}
+
+% Utility routines.
+% This does \let #1 = #2, with \csnames; that is,
+%   \let \csname#1\endcsname = \csname#2\endcsname
+% (except of course we have to play expansion games).
+%
+\def\cslet#1#2{%
+  \expandafter\let
+  \csname#1\expandafter\endcsname
+  \csname#2\endcsname
+}
+
+% Trim leading and trailing spaces off a string.
+% Concepts from aro-bend problem 15 (see CTAN).
+{\catcode`\@=11
+\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
+\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
+\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
+\def\unbrace#1{#1}
+\unbrace{\gdef\trim@@@ #1 } #2@{#1}
+}
+
+% Trim a single trailing ^^M off a string.
+{\catcode`\^^M=\other \catcode`\Q=3%
+\gdef\eatcr #1{\eatcra #1Q^^MQ}%
+\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
+\gdef\eatcrb#1Q#2Q{#1}%
+}
+
+% Macro bodies are absorbed as an argument in a context where
+% all characters are catcode 10, 11 or 12, except \ which is active
+% (as in normal texinfo). It is necessary to change the definition of \
+% to recognize macro arguments; this is the job of \mbodybackslash.
+%
+% Non-ASCII encodings make 8-bit characters active, so un-activate
+% them to avoid their expansion.  Must do this non-globally, to
+% confine the change to the current group.
+%
+% It's necessary to have hard CRs when the macro is executed. This is
+% done by making ^^M (\endlinechar) catcode 12 when reading the macro
+% body, and then making it the \newlinechar in \scanmacro.
+%
+\def\scanctxt{% used as subroutine
+  \catcode`\"=\other
+  \catcode`\+=\other
+  \catcode`\<=\other
+  \catcode`\>=\other
+  \catcode`\@=\other
+  \catcode`\^=\other
+  \catcode`\_=\other
+  \catcode`\|=\other
+  \catcode`\~=\other
+  \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
+}
+
+\def\scanargctxt{% used for copying and captions, not macros.
+  \scanctxt
+  \catcode`\\=\other
+  \catcode`\^^M=\other
+}
+
+\def\macrobodyctxt{% used for @macro definitions
+  \scanctxt
+  \catcode`\{=\other
+  \catcode`\}=\other
+  \catcode`\^^M=\other
+  \usembodybackslash
+}
+
+\def\macroargctxt{% used when scanning invocations
+  \scanctxt
+  \catcode`\\=0
+}
+% why catcode 0 for \ in the above?  To recognize \\ \{ \} as "escapes"
+% for the single characters \ { }.  Thus, we end up with the "commands"
+% that would be written @\ @{ @} in a Texinfo document.
+% 
+% We already have @{ and @}.  For @\, we define it here, and only for
+% this purpose, to produce a typewriter backslash (so, the @\ that we
+% define for @math can't be used with @macro calls):
+%
+\def\\{\normalbackslash}%
+% 
+% We would like to do this for \, too, since that is what makeinfo does.
+% But it is not possible, because Texinfo already has a command @, for a
+% cedilla accent.  Documents must use @comma{} instead.
+%
+% \anythingelse will almost certainly be an error of some kind.
+
+
+% \mbodybackslash is the definition of \ in @macro bodies.
+% It maps \foo\ => \csname macarg.foo\endcsname => #N
+% where N is the macro parameter number.
+% We define \csname macarg.\endcsname to be \realbackslash, so
+% \\ in macro replacement text gets you a backslash.
+%
+{\catcode`@=0 @catcode`@\=@active
+ @gdef at usembodybackslash{@let\=@mbodybackslash}
+ @gdef at mbodybackslash#1\{@csname macarg.#1 at endcsname}
+}
+\expandafter\def\csname macarg.\endcsname{\realbackslash}
+
+\def\margbackslash#1{\char`\#1 }
+
+\def\macro{\recursivefalse\parsearg\macroxxx}
+\def\rmacro{\recursivetrue\parsearg\macroxxx}
+
+\def\macroxxx#1{%
+  \getargs{#1}% now \macname is the macname and \argl the arglist
+  \ifx\argl\empty       % no arguments
+     \paramno=0\relax
+  \else
+     \expandafter\parsemargdef \argl;%
+     \if\paramno>256\relax
+       \ifx\eTeXversion\thisisundefined
+         \errhelp = \EMsimple
+         \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
+       \fi
+     \fi
+  \fi
+  \if1\csname ismacro.\the\macname\endcsname
+     \message{Warning: redefining \the\macname}%
+  \else
+     \expandafter\ifx\csname \the\macname\endcsname \relax
+     \else \errmessage{Macro name \the\macname\space already defined}\fi
+     \global\cslet{macsave.\the\macname}{\the\macname}%
+     \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
+     \addtomacrolist{\the\macname}%
+  \fi
+  \begingroup \macrobodyctxt
+  \ifrecursive \expandafter\parsermacbody
+  \else \expandafter\parsemacbody
+  \fi}
+
+\parseargdef\unmacro{%
+  \if1\csname ismacro.#1\endcsname
+    \global\cslet{#1}{macsave.#1}%
+    \global\expandafter\let \csname ismacro.#1\endcsname=0%
+    % Remove the macro name from \macrolist:
+    \begingroup
+      \expandafter\let\csname#1\endcsname \relax
+      \let\definedummyword\unmacrodo
+      \xdef\macrolist{\macrolist}%
+    \endgroup
+  \else
+    \errmessage{Macro #1 not defined}%
+  \fi
+}
+
+% Called by \do from \dounmacro on each macro.  The idea is to omit any
+% macro definitions that have been changed to \relax.
+%
+\def\unmacrodo#1{%
+  \ifx #1\relax
+    % remove this
+  \else
+    \noexpand\definedummyword \noexpand#1%
+  \fi
+}
+
+% This makes use of the obscure feature that if the last token of a
+% <parameter list> is #, then the preceding argument is delimited by
+% an opening brace, and that opening brace is not consumed.
+\def\getargs#1{\getargsxxx#1{}}
+\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
+\def\getmacname#1 #2\relax{\macname={#1}}
+\def\getmacargs#1{\def\argl{#1}}
+
+% For macro processing make @ a letter so that we can make Texinfo private macro names.
+\edef\texiatcatcode{\the\catcode`\@}
+\catcode `@=11\relax
+
+% Parse the optional {params} list.  Set up \paramno and \paramlist
+% so \defmacro knows what to do.  Define \macarg.BLAH for each BLAH
+% in the params list to some hook where the argument si to be expanded.  If
+% there are less than 10 arguments that hook is to be replaced by ##N where N
+% is the position in that list, that is to say the macro arguments are to be
+% defined `a la TeX in the macro body.  
+%
+% That gets used by \mbodybackslash (above).
+%
+% We need to get `macro parameter char #' into several definitions.
+% The technique used is stolen from LaTeX: let \hash be something
+% unexpandable, insert that wherever you need a #, and then redefine
+% it to # just before using the token list produced.
+%
+% The same technique is used to protect \eatspaces till just before
+% the macro is used.
+%
+% If there are 10 or more arguments, a different technique is used, where the
+% hook remains in the body, and when macro is to be expanded the body is
+% processed again to replace the arguments.
+%
+% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
+% argument N value and then \edef  the body (nothing else will expand because of
+% the catcode regime underwhich the body was input).
+%
+% If you compile with TeX (not eTeX), and you have macros with 10 or more
+% arguments, you need that no macro has more than 256 arguments, otherwise an
+% error is produced.
+\def\parsemargdef#1;{%
+  \paramno=0\def\paramlist{}%
+  \let\hash\relax
+  \let\xeatspaces\relax
+  \parsemargdefxxx#1,;,%
+  % In case that there are 10 or more arguments we parse again the arguments
+  % list to set new definitions for the \macarg.BLAH macros corresponding to
+  % each BLAH argument. It was anyhow needed to parse already once this list
+  % in order to count the arguments, and as macros with at most 9 arguments
+  % are by far more frequent than macro with 10 or more arguments, defining
+  % twice the \macarg.BLAH macros does not cost too much processing power.
+  \ifnum\paramno<10\relax\else
+    \paramno0\relax
+    \parsemmanyargdef@@#1,;,% 10 or more arguments
+  \fi
+}
+\def\parsemargdefxxx#1,{%
+  \if#1;\let\next=\relax
+  \else \let\next=\parsemargdefxxx
+    \advance\paramno by 1
+    \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
+        {\xeatspaces{\hash\the\paramno}}%
+    \edef\paramlist{\paramlist\hash\the\paramno,}%
+  \fi\next}
+
+\def\parsemmanyargdef@@#1,{%
+  \if#1;\let\next=\relax
+  \else 
+    \let\next=\parsemmanyargdef@@
+    \edef\tempb{\eatspaces{#1}}%
+    \expandafter\def\expandafter\tempa
+       \expandafter{\csname macarg.\tempb\endcsname}%
+    % Note that we need some extra \noexpand\noexpand, this is because we
+    % don't want \the  to be expanded in the \parsermacbody  as it uses an
+    % \xdef .
+    \expandafter\edef\tempa
+      {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
+    \advance\paramno by 1\relax
+  \fi\next}
+
+% These two commands read recursive and nonrecursive macro bodies.
+% (They're different since rec and nonrec macros end differently.)
+%
+
+\catcode `\@\texiatcatcode
+\long\def\parsemacbody#1 at end macro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+\long\def\parsermacbody#1 at end rmacro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+\catcode `\@=11\relax
+
+\let\endargs@\relax
+\let\nil@\relax
+\def\nilm@{\nil@}%
+\long\def\nillm@{\nil@}%
+
+% This macro is expanded during the Texinfo macro expansion, not during its
+% definition.  It gets all the arguments values and assigns them to macros
+% macarg.ARGNAME
+%
+% #1 is the macro name
+% #2 is the list of argument names
+% #3 is the list of argument values
+\def\getargvals@#1#2#3{%
+  \def\macargdeflist@{}%
+  \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
+  \def\paramlist{#2,\nil@}%
+  \def\macroname{#1}%
+  \begingroup
+  \macroargctxt
+  \def\argvaluelist{#3,\nil@}%
+  \def\@tempa{#3}%
+  \ifx\@tempa\empty
+    \setemptyargvalues@
+  \else
+    \getargvals@@
+  \fi
+}
+
+% 
+\def\getargvals@@{%
+  \ifx\paramlist\nilm@
+      % Some sanity check needed here that \argvaluelist is also empty.
+      \ifx\argvaluelist\nillm@
+      \else
+        \errhelp = \EMsimple
+        \errmessage{Too many arguments in macro `\macroname'!}%
+      \fi
+      \let\next\macargexpandinbody@
+  \else
+    \ifx\argvaluelist\nillm@
+       % No more arguments values passed to macro.  Set remaining named-arg
+       % macros to empty.
+       \let\next\setemptyargvalues@
+    \else
+      % pop current arg name into \@tempb
+      \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
+      \expandafter\@tempa\expandafter{\paramlist}%
+       % pop current argument value into \@tempc
+      \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
+      \expandafter\@tempa\expandafter{\argvaluelist}%
+       % Here \@tempb is the current arg name and \@tempc is the current arg value.
+       % First place the new argument macro definition into \@tempd
+       \expandafter\macname\expandafter{\@tempc}%
+       \expandafter\let\csname macarg.\@tempb\endcsname\relax
+       \expandafter\def\expandafter\@tempe\expandafter{%
+         \csname macarg.\@tempb\endcsname}%
+       \edef\@tempd{\long\def\@tempe{\the\macname}}%
+       \push@\@tempd\macargdeflist@
+       \let\next\getargvals@@
+    \fi
+  \fi
+  \next
+}
+
+\def\push@#1#2{%
+  \expandafter\expandafter\expandafter\def
+  \expandafter\expandafter\expandafter#2%
+  \expandafter\expandafter\expandafter{%
+  \expandafter#1#2}%
+}
+
+% Replace arguments by their values in the macro body, and place the result
+% in macro \@tempa
+\def\macvalstoargs@{%
+  %  To do this we use the property that token registers that are \the'ed
+  % within an \edef  expand only once. So we are going to place all argument
+  % values into respective token registers.
+  %
+  % First we save the token context, and initialize argument numbering.
+  \begingroup
+    \paramno0\relax
+    % Then, for each argument number #N, we place the corresponding argument
+    % value into a new token list register \toks#N
+    \expandafter\putargsintokens@\saveparamlist@,;,%
+    % Then, we expand the body so that argument are replaced by their
+    % values. The trick for values not to be expanded themselves is that they
+    % are within tokens and that tokens expand only once in an \edef .
+    \edef\@tempc{\csname mac.\macroname .body\endcsname}%
+    % Now we restore the token stack pointer to free the token list registers
+    % which we have used, but we make sure that expanded body is saved after
+    % group.
+    \expandafter
+  \endgroup
+  \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
+  }
+
+\def\macargexpandinbody@{% 
+  %% Define the named-macro outside of this group and then close this group. 
+  \expandafter
+  \endgroup
+  \macargdeflist@
+  % First the replace in body the macro arguments by their values, the result
+  % is in \@tempa .
+  \macvalstoargs@
+  % Then we point at the \norecurse or \gobble (for recursive) macro value
+  % with \@tempb .
+  \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
+  % Depending on whether it is recursive or not, we need some tailing
+  % \egroup .
+  \ifx\@tempb\gobble
+     \let\@tempc\relax
+  \else
+     \let\@tempc\egroup
+  \fi
+  % And now we do the real job:
+  \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
+  \@tempd
+}
+
+\def\putargsintokens@#1,{%
+  \if#1;\let\next\relax
+  \else
+    \let\next\putargsintokens@
+    % First we allocate the new token list register, and give it a temporary
+    % alias \@tempb .
+    \toksdef\@tempb\the\paramno
+    % Then we place the argument value into that token list register.
+    \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
+    \expandafter\@tempb\expandafter{\@tempa}%
+    \advance\paramno by 1\relax
+  \fi
+  \next
+}
+
+% Save the token stack pointer into macro #1
+\def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}}
+% Restore the token stack pointer from number in macro #1
+\def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax}
+% newtoks that can be used non \outer .
+\def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi}
+
+% Tailing missing arguments are set to empty
+\def\setemptyargvalues@{%
+  \ifx\paramlist\nilm@
+    \let\next\macargexpandinbody@
+  \else
+    \expandafter\setemptyargvaluesparser@\paramlist\endargs@
+    \let\next\setemptyargvalues@
+  \fi
+  \next
+}
+
+\def\setemptyargvaluesparser@#1,#2\endargs@{%
+  \expandafter\def\expandafter\@tempa\expandafter{%
+    \expandafter\def\csname macarg.#1\endcsname{}}%
+  \push@\@tempa\macargdeflist@
+  \def\paramlist{#2}%
+}
+
+% #1 is the element target macro
+% #2 is the list macro
+% #3,#4\endargs@ is the list value
+\def\pop@#1#2#3,#4\endargs@{%
+   \def#1{#3}%
+   \def#2{#4}%
+}
+\long\def\longpop@#1#2#3,#4\endargs@{%
+   \long\def#1{#3}%
+   \long\def#2{#4}%
+}
+
+% This defines a Texinfo @macro. There are eight cases: recursive and
+% nonrecursive macros of zero, one, up to nine, and many arguments.
+% Much magic with \expandafter here.
+% \xdef is used so that macro definitions will survive the file
+% they're defined in; @include reads the file inside a group.
+%
+\def\defmacro{%
+  \let\hash=##% convert placeholders to macro parameter chars
+  \ifrecursive
+    \ifcase\paramno
+    % 0
+      \expandafter\xdef\csname\the\macname\endcsname{%
+        \noexpand\scanmacro{\temp}}%
+    \or % 1
+      \expandafter\xdef\csname\the\macname\endcsname{%
+         \bgroup\noexpand\macroargctxt
+         \noexpand\braceorline
+         \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+      \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+         \egroup\noexpand\scanmacro{\temp}}%
+    \else
+      \ifnum\paramno<10\relax % at most 9
+        \expandafter\xdef\csname\the\macname\endcsname{%
+           \bgroup\noexpand\macroargctxt
+           \noexpand\csname\the\macname xx\endcsname}%
+        \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+            \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+        \expandafter\expandafter
+        \expandafter\xdef
+        \expandafter\expandafter
+          \csname\the\macname xxx\endcsname
+            \paramlist{\egroup\noexpand\scanmacro{\temp}}%
+      \else % 10 or more
+        \expandafter\xdef\csname\the\macname\endcsname{%
+          \noexpand\getargvals@{\the\macname}{\argl}%
+        }%    
+        \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
+        \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
+      \fi
+    \fi
+  \else
+    \ifcase\paramno
+    % 0
+      \expandafter\xdef\csname\the\macname\endcsname{%
+        \noexpand\norecurse{\the\macname}%
+        \noexpand\scanmacro{\temp}\egroup}%
+    \or % 1
+      \expandafter\xdef\csname\the\macname\endcsname{%
+         \bgroup\noexpand\macroargctxt
+         \noexpand\braceorline
+         \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+      \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+        \egroup
+        \noexpand\norecurse{\the\macname}%
+        \noexpand\scanmacro{\temp}\egroup}%
+    \else % at most 9
+      \ifnum\paramno<10\relax
+        \expandafter\xdef\csname\the\macname\endcsname{%
+           \bgroup\noexpand\macroargctxt
+           \expandafter\noexpand\csname\the\macname xx\endcsname}%
+        \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+            \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+        \expandafter\expandafter
+        \expandafter\xdef
+        \expandafter\expandafter
+        \csname\the\macname xxx\endcsname
+        \paramlist{%
+            \egroup
+            \noexpand\norecurse{\the\macname}%
+            \noexpand\scanmacro{\temp}\egroup}%
+      \else % 10 or more:
+        \expandafter\xdef\csname\the\macname\endcsname{%
+          \noexpand\getargvals@{\the\macname}{\argl}%
+        }%
+        \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
+        \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
+      \fi
+    \fi
+  \fi}
+
+\catcode `\@\texiatcatcode\relax
+
+\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
+
+% \braceorline decides whether the next nonwhitespace character is a
+% {.  If so it reads up to the closing }, if not, it reads the whole
+% line.  Whatever was read is then fed to the next control sequence
+% as an argument (by \parsebrace or \parsearg).
+% 
+\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
+\def\braceorlinexxx{%
+  \ifx\nchar\bgroup\else
+    \expandafter\parsearg
+  \fi \macnamexxx}
+
+
+% @alias.
+% We need some trickery to remove the optional spaces around the equal
+% sign.  Make them active and then expand them all to nothing.
+%
+\def\alias{\parseargusing\obeyspaces\aliasxxx}
+\def\aliasxxx #1{\aliasyyy#1\relax}
+\def\aliasyyy #1=#2\relax{%
+  {%
+    \expandafter\let\obeyedspace=\empty
+    \addtomacrolist{#1}%
+    \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
+  }%
+  \next
+}
+
+
+\message{cross references,}
+
+\newwrite\auxfile
+\newif\ifhavexrefs    % True if xref values are known.
+\newif\ifwarnedxrefs  % True if we warned once that they aren't known.
+
+% @inforef is relatively simple.
+\def\inforef #1{\inforefzzz #1,,,,**}
+\def\inforefzzz #1,#2,#3,#4**{%
+  \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
+  node \samp{\ignorespaces#1{}}}
+
+% @node's only job in TeX is to define \lastnode, which is used in
+% cross-references.  The @node line might or might not have commas, and
+% might or might not have spaces before the first comma, like:
+% @node foo , bar , ...
+% We don't want such trailing spaces in the node name.
+%
+\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
+%
+% also remove a trailing comma, in case of something like this:
+% @node Help-Cross,  ,  , Cross-refs
+\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
+\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
+
+\let\nwnode=\node
+\let\lastnode=\empty
+
+% Write a cross-reference definition for the current node.  #1 is the
+% type (Ynumbered, Yappendix, Ynothing).
+%
+\def\donoderef#1{%
+  \ifx\lastnode\empty\else
+    \setref{\lastnode}{#1}%
+    \global\let\lastnode=\empty
+  \fi
+}
+
+% @anchor{NAME} -- define xref target at arbitrary point.
+%
+\newcount\savesfregister
+%
+\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
+\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
+\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
+
+% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
+% anchor), which consists of three parts:
+% 1) NAME-title - the current sectioning name taken from \lastsection,
+%                 or the anchor name.
+% 2) NAME-snt   - section number and type, passed as the SNT arg, or
+%                 empty for anchors.
+% 3) NAME-pg    - the page number.
+%
+% This is called from \donoderef, \anchor, and \dofloat.  In the case of
+% floats, there is an additional part, which is not written here:
+% 4) NAME-lof   - the text as it should appear in a @listoffloats.
+%
+\def\setref#1#2{%
+  \pdfmkdest{#1}%
+  \iflinks
+    {%
+      \atdummies  % preserve commands, but don't expand them
+      \edef\writexrdef##1##2{%
+	\write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
+	  ##1}{##2}}% these are parameters of \writexrdef
+      }%
+      \toks0 = \expandafter{\lastsection}%
+      \immediate \writexrdef{title}{\the\toks0 }%
+      \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
+      \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
+    }%
+  \fi
+}
+
+% @xrefautosectiontitle on|off says whether @section(ing) names are used
+% automatically in xrefs, if the third arg is not explicitly specified.
+% This was provided as a "secret" @set xref-automatic-section-title
+% variable, now it's official.
+% 
+\parseargdef\xrefautomaticsectiontitle{%
+  \def\temp{#1}%
+  \ifx\temp\onword
+    \expandafter\let\csname SETxref-automatic-section-title\endcsname
+      = \empty
+  \else\ifx\temp\offword
+    \expandafter\let\csname SETxref-automatic-section-title\endcsname
+      = \relax
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
+                must be on|off}%
+  \fi\fi
+}
+
+% 

+% @xref, @pxref, and @ref generate cross-references.  For \xrefX, #1 is
+% the node name, #2 the name of the Info cross-reference, #3 the printed
+% node name, #4 the name of the Info file, #5 the name of the printed
+% manual.  All but the node name can be omitted.
+%
+\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
+\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
+\def\ref#1{\xrefX[#1,,,,,,,]}
+%
+\newbox\toprefbox
+\newbox\printedrefnamebox
+\newbox\infofilenamebox
+\newbox\printedmanualbox
+%
+\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
+  \unsepspaces
+  %
+  % Get args without leading/trailing spaces.
+  \def\printedrefname{\ignorespaces #3}%
+  \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
+  %
+  \def\infofilename{\ignorespaces #4}%
+  \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
+  %
+  \def\printedmanual{\ignorespaces #5}%
+  \setbox\printedmanualbox  = \hbox{\printedmanual\unskip}%
+  %
+  % If the printed reference name (arg #3) was not explicitly given in
+  % the @xref, figure out what we want to use.
+  \ifdim \wd\printedrefnamebox = 0pt
+    % No printed node name was explicitly given.
+    \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
+      % Not auto section-title: use node name inside the square brackets.
+      \def\printedrefname{\ignorespaces #1}%
+    \else
+      % Auto section-title: use chapter/section title inside
+      % the square brackets if we have it.
+      \ifdim \wd\printedmanualbox > 0pt
+        % It is in another manual, so we don't have it; use node name.
+        \def\printedrefname{\ignorespaces #1}%
+      \else
+        \ifhavexrefs
+          % We (should) know the real title if we have the xref values.
+          \def\printedrefname{\refx{#1-title}{}}%
+        \else
+          % Otherwise just copy the Info node name.
+          \def\printedrefname{\ignorespaces #1}%
+        \fi%
+      \fi
+    \fi
+  \fi
+  %
+  % Make link in pdf output.
+  \ifpdf
+    {\indexnofonts
+     \turnoffactive
+     \makevalueexpandable
+     % This expands tokens, so do it after making catcode changes, so _
+     % etc. don't get their TeX definitions.  This ignores all spaces in
+     % #4, including (wrongly) those in the middle of the filename.
+     \getfilename{#4}%
+     %
+     % This (wrongly) does not take account of leading or trailing
+     % spaces in #1, which should be ignored.
+     \edef\pdfxrefdest{#1}%
+     \ifx\pdfxrefdest\empty
+       \def\pdfxrefdest{Top}% no empty targets
+     \else
+       \txiescapepdf\pdfxrefdest  % escape PDF special chars
+     \fi
+     %
+     \leavevmode
+     \startlink attr{/Border [0 0 0]}%
+     \ifnum\filenamelength>0
+       goto file{\the\filename.pdf} name{\pdfxrefdest}%
+     \else
+       goto name{\pdfmkpgn{\pdfxrefdest}}%
+     \fi
+    }%
+    \setcolor{\linkcolor}%
+  \fi
+  %
+  % Float references are printed completely differently: "Figure 1.2"
+  % instead of "[somenode], p.3".  We distinguish them by the
+  % LABEL-title being set to a magic string.
+  {%
+    % Have to otherify everything special to allow the \csname to
+    % include an _ in the xref name, etc.
+    \indexnofonts
+    \turnoffactive
+    \expandafter\global\expandafter\let\expandafter\Xthisreftitle
+      \csname XR#1-title\endcsname
+  }%
+  \iffloat\Xthisreftitle
+    % If the user specified the print name (third arg) to the ref,
+    % print it instead of our usual "Figure 1.2".
+    \ifdim\wd\printedrefnamebox = 0pt
+      \refx{#1-snt}{}%
+    \else
+      \printedrefname
+    \fi
+    %
+    % If the user also gave the printed manual name (fifth arg), append
+    % "in MANUALNAME".
+    \ifdim \wd\printedmanualbox > 0pt
+      \space \putwordin{} \cite{\printedmanual}%
+    \fi
+  \else
+    % node/anchor (non-float) references.
+    % 
+    % If we use \unhbox to print the node names, TeX does not insert
+    % empty discretionaries after hyphens, which means that it will not
+    % find a line break at a hyphen in a node names.  Since some manuals
+    % are best written with fairly long node names, containing hyphens,
+    % this is a loss.  Therefore, we give the text of the node name
+    % again, so it is as if TeX is seeing it for the first time.
+    % 
+    \ifdim \wd\printedmanualbox > 0pt
+      % Cross-manual reference with a printed manual name.
+      % 
+      \crossmanualxref{\cite{\printedmanual\unskip}}%
+    %
+    \else\ifdim \wd\infofilenamebox > 0pt
+      % Cross-manual reference with only an info filename (arg 4), no
+      % printed manual name (arg 5).  This is essentially the same as
+      % the case above; we output the filename, since we have nothing else.
+      % 
+      \crossmanualxref{\code{\infofilename\unskip}}%
+    %
+    \else
+      % Reference within this manual.
+      %
+      % _ (for example) has to be the character _ for the purposes of the
+      % control sequence corresponding to the node, but it has to expand
+      % into the usual \leavevmode...\vrule stuff for purposes of
+      % printing. So we \turnoffactive for the \refx-snt, back on for the
+      % printing, back off for the \refx-pg.
+      {\turnoffactive
+       % Only output a following space if the -snt ref is nonempty; for
+       % @unnumbered and @anchor, it won't be.
+       \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
+       \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
+      }%
+      % output the `[mynode]' via the macro below so it can be overridden.
+      \xrefprintnodename\printedrefname
+      %
+      % But we always want a comma and a space:
+      ,\space
+      %
+      % output the `page 3'.
+      \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
+    \fi\fi
+  \fi
+  \endlink
+\endgroup}
+
+% Output a cross-manual xref to #1.  Used just above (twice).
+% 
+% Only include the text "Section ``foo'' in" if the foo is neither
+% missing or Top.  Thus, @xref{,,,foo,The Foo Manual} outputs simply
+% "see The Foo Manual", the idea being to refer to the whole manual.
+% 
+% But, this being TeX, we can't easily compare our node name against the
+% string "Top" while ignoring the possible spaces before and after in
+% the input.  By adding the arbitrary 7sp below, we make it much less
+% likely that a real node name would have the same width as "Top" (e.g.,
+% in a monospaced font).  Hopefully it will never happen in practice.
+% 
+% For the same basic reason, we retypeset the "Top" at every
+% reference, since the current font is indeterminate.
+% 
+\def\crossmanualxref#1{%
+  \setbox\toprefbox = \hbox{Top\kern7sp}%
+  \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
+  \ifdim \wd2 > 7sp  % nonempty?
+    \ifdim \wd2 = \wd\toprefbox \else  % same as Top?
+      \putwordSection{} ``\printedrefname'' \putwordin{}\space
+    \fi
+  \fi
+  #1%
+}
+
+% This macro is called from \xrefX for the `[nodename]' part of xref
+% output.  It's a separate macro only so it can be changed more easily,
+% since square brackets don't work well in some documents.  Particularly
+% one that Bob is working on :).
+%
+\def\xrefprintnodename#1{[#1]}
+
+% Things referred to by \setref.
+%
+\def\Ynothing{}
+\def\Yomitfromtoc{}
+\def\Ynumbered{%
+  \ifnum\secno=0
+    \putwordChapter at tie \the\chapno
+  \else \ifnum\subsecno=0
+    \putwordSection at tie \the\chapno.\the\secno
+  \else \ifnum\subsubsecno=0
+    \putwordSection at tie \the\chapno.\the\secno.\the\subsecno
+  \else
+    \putwordSection at tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
+  \fi\fi\fi
+}
+\def\Yappendix{%
+  \ifnum\secno=0
+     \putwordAppendix at tie @char\the\appendixno{}%
+  \else \ifnum\subsecno=0
+     \putwordSection at tie @char\the\appendixno.\the\secno
+  \else \ifnum\subsubsecno=0
+    \putwordSection at tie @char\the\appendixno.\the\secno.\the\subsecno
+  \else
+    \putwordSection at tie
+      @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
+  \fi\fi\fi
+}
+
+% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
+% If its value is nonempty, SUFFIX is output afterward.
+%
+\def\refx#1#2{%
+  {%
+    \indexnofonts
+    \otherbackslash
+    \expandafter\global\expandafter\let\expandafter\thisrefX
+      \csname XR#1\endcsname
+  }%
+  \ifx\thisrefX\relax
+    % If not defined, say something at least.
+    \angleleft un\-de\-fined\angleright
+    \iflinks
+      \ifhavexrefs
+        {\toks0 = {#1}% avoid expansion of possibly-complex value
+         \message{\linenumber Undefined cross reference `\the\toks0'.}}%
+      \else
+        \ifwarnedxrefs\else
+          \global\warnedxrefstrue
+          \message{Cross reference values unknown; you must run TeX again.}%
+        \fi
+      \fi
+    \fi
+  \else
+    % It's defined, so just use it.
+    \thisrefX
+  \fi
+  #2% Output the suffix in any case.
+}
+
+% This is the macro invoked by entries in the aux file.  Usually it's
+% just a \def (we prepend XR to the control sequence name to avoid
+% collisions).  But if this is a float type, we have more work to do.
+%
+\def\xrdef#1#2{%
+  {% The node name might contain 8-bit characters, which in our current
+   % implementation are changed to commands like @'e.  Don't let these
+   % mess up the control sequence name.
+    \indexnofonts
+    \turnoffactive
+    \xdef\safexrefname{#1}%
+  }%
+  %
+  \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
+  %
+  % Was that xref control sequence that we just defined for a float?
+  \expandafter\iffloat\csname XR\safexrefname\endcsname
+    % it was a float, and we have the (safe) float type in \iffloattype.
+    \expandafter\let\expandafter\floatlist
+      \csname floatlist\iffloattype\endcsname
+    %
+    % Is this the first time we've seen this float type?
+    \expandafter\ifx\floatlist\relax
+      \toks0 = {\do}% yes, so just \do
+    \else
+      % had it before, so preserve previous elements in list.
+      \toks0 = \expandafter{\floatlist\do}%
+    \fi
+    %
+    % Remember this xref in the control sequence \floatlistFLOATTYPE,
+    % for later use in \listoffloats.
+    \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
+      {\safexrefname}}%
+  \fi
+}
+
+% Read the last existing aux file, if any.  No error if none exists.
+%
+\def\tryauxfile{%
+  \openin 1 \jobname.aux
+  \ifeof 1 \else
+    \readdatafile{aux}%
+    \global\havexrefstrue
+  \fi
+  \closein 1
+}
+
+\def\setupdatafile{%
+  \catcode`\^^@=\other
+  \catcode`\^^A=\other
+  \catcode`\^^B=\other
+  \catcode`\^^C=\other
+  \catcode`\^^D=\other
+  \catcode`\^^E=\other
+  \catcode`\^^F=\other
+  \catcode`\^^G=\other
+  \catcode`\^^H=\other
+  \catcode`\^^K=\other
+  \catcode`\^^L=\other
+  \catcode`\^^N=\other
+  \catcode`\^^P=\other
+  \catcode`\^^Q=\other
+  \catcode`\^^R=\other
+  \catcode`\^^S=\other
+  \catcode`\^^T=\other
+  \catcode`\^^U=\other
+  \catcode`\^^V=\other
+  \catcode`\^^W=\other
+  \catcode`\^^X=\other
+  \catcode`\^^Z=\other
+  \catcode`\^^[=\other
+  \catcode`\^^\=\other
+  \catcode`\^^]=\other
+  \catcode`\^^^=\other
+  \catcode`\^^_=\other
+  % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
+  % in xref tags, i.e., node names.  But since ^^e4 notation isn't
+  % supported in the main text, it doesn't seem desirable.  Furthermore,
+  % that is not enough: for node names that actually contain a ^
+  % character, we would end up writing a line like this: 'xrdef {'hat
+  % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
+  % argument, and \hat is not an expandable control sequence.  It could
+  % all be worked out, but why?  Either we support ^^ or we don't.
+  %
+  % The other change necessary for this was to define \auxhat:
+  % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
+  % and then to call \auxhat in \setq.
+  %
+  \catcode`\^=\other
+  %
+  % Special characters.  Should be turned off anyway, but...
+  \catcode`\~=\other
+  \catcode`\[=\other
+  \catcode`\]=\other
+  \catcode`\"=\other
+  \catcode`\_=\other
+  \catcode`\|=\other
+  \catcode`\<=\other
+  \catcode`\>=\other
+  \catcode`\$=\other
+  \catcode`\#=\other
+  \catcode`\&=\other
+  \catcode`\%=\other
+  \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
+  %
+  % This is to support \ in node names and titles, since the \
+  % characters end up in a \csname.  It's easier than
+  % leaving it active and making its active definition an actual \
+  % character.  What I don't understand is why it works in the *value*
+  % of the xrdef.  Seems like it should be a catcode12 \, and that
+  % should not typeset properly.  But it works, so I'm moving on for
+  % now.  --karl, 15jan04.
+  \catcode`\\=\other
+  %
+  % Make the characters 128-255 be printing characters.
+  {%
+    \count1=128
+    \def\loop{%
+      \catcode\count1=\other
+      \advance\count1 by 1
+      \ifnum \count1<256 \loop \fi
+    }%
+  }%
+  %
+  % @ is our escape character in .aux files, and we need braces.
+  \catcode`\{=1
+  \catcode`\}=2
+  \catcode`\@=0
+}
+
+\def\readdatafile#1{%
+\begingroup
+  \setupdatafile
+  \input\jobname.#1
+\endgroup}
+
+
+\message{insertions,}
+% including footnotes.
+
+\newcount \footnoteno
+
+% The trailing space in the following definition for supereject is
+% vital for proper filling; pages come out unaligned when you do a
+% pagealignmacro call if that space before the closing brace is
+% removed. (Generally, numeric constants should always be followed by a
+% space to prevent strange expansion errors.)
+\def\supereject{\par\penalty -20000\footnoteno =0 }
+
+% @footnotestyle is meaningful for Info output only.
+\let\footnotestyle=\comment
+
+{\catcode `\@=11
+%
+% Auto-number footnotes.  Otherwise like plain.
+\gdef\footnote{%
+  \let\indent=\ptexindent
+  \let\noindent=\ptexnoindent
+  \global\advance\footnoteno by \@ne
+  \edef\thisfootno{$^{\the\footnoteno}$}%
+  %
+  % In case the footnote comes at the end of a sentence, preserve the
+  % extra spacing after we do the footnote number.
+  \let\@sf\empty
+  \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
+  %
+  % Remove inadvertent blank space before typesetting the footnote number.
+  \unskip
+  \thisfootno\@sf
+  \dofootnote
+}%
+
+% Don't bother with the trickery in plain.tex to not require the
+% footnote text as a parameter.  Our footnotes don't need to be so general.
+%
+% Oh yes, they do; otherwise, @ifset (and anything else that uses
+% \parseargline) fails inside footnotes because the tokens are fixed when
+% the footnote is read.  --karl, 16nov96.
+%
+\gdef\dofootnote{%
+  \insert\footins\bgroup
+  % We want to typeset this text as a normal paragraph, even if the
+  % footnote reference occurs in (for example) a display environment.
+  % So reset some parameters.
+  \hsize=\pagewidth
+  \interlinepenalty\interfootnotelinepenalty
+  \splittopskip\ht\strutbox % top baseline for broken footnotes
+  \splitmaxdepth\dp\strutbox
+  \floatingpenalty\@MM
+  \leftskip\z at skip
+  \rightskip\z at skip
+  \spaceskip\z at skip
+  \xspaceskip\z at skip
+  \parindent\defaultparindent
+  %
+  \smallfonts \rm
+  %
+  % Because we use hanging indentation in footnotes, a @noindent appears
+  % to exdent this text, so make it be a no-op.  makeinfo does not use
+  % hanging indentation so @noindent can still be needed within footnote
+  % text after an @example or the like (not that this is good style).
+  \let\noindent = \relax
+  %
+  % Hang the footnote text off the number.  Use \everypar in case the
+  % footnote extends for more than one paragraph.
+  \everypar = {\hang}%
+  \textindent{\thisfootno}%
+  %
+  % Don't crash into the line above the footnote text.  Since this
+  % expands into a box, it must come within the paragraph, lest it
+  % provide a place where TeX can split the footnote.
+  \footstrut
+  %
+  % Invoke rest of plain TeX footnote routine.
+  \futurelet\next\fo at t
+}
+}%end \catcode `\@=11
+
+% In case a @footnote appears in a vbox, save the footnote text and create
+% the real \insert just after the vbox finished.  Otherwise, the insertion
+% would be lost.
+% Similarly, if a @footnote appears inside an alignment, save the footnote
+% text to a box and make the \insert when a row of the table is finished.
+% And the same can be done for other insert classes.  --kasal, 16nov03.
+
+% Replace the \insert primitive by a cheating macro.
+% Deeper inside, just make sure that the saved insertions are not spilled
+% out prematurely.
+%
+\def\startsavinginserts{%
+  \ifx \insert\ptexinsert
+    \let\insert\saveinsert
+  \else
+    \let\checkinserts\relax
+  \fi
+}
+
+% This \insert replacement works for both \insert\footins{foo} and
+% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
+%
+\def\saveinsert#1{%
+  \edef\next{\noexpand\savetobox \makeSAVEname#1}%
+  \afterassignment\next
+  % swallow the left brace
+  \let\temp =
+}
+\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
+\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
+
+\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
+
+\def\placesaveins#1{%
+  \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
+    {\box#1}%
+}
+
+% eat @SAVE -- beware, all of them have catcode \other:
+{
+  \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials  %  ;-)
+  \gdef\gobblesave @SAVE{}
+}
+
+% initialization:
+\def\newsaveins #1{%
+  \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
+  \next
+}
+\def\newsaveinsX #1{%
+  \csname newbox\endcsname #1%
+  \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
+    \checksaveins #1}%
+}
+
+% initialize:
+\let\checkinserts\empty
+\newsaveins\footins
+\newsaveins\margin
+
+
+% @image.  We use the macros from epsf.tex to support this.
+% If epsf.tex is not installed and @image is used, we complain.
+%
+% Check for and read epsf.tex up front.  If we read it only at @image
+% time, we might be inside a group, and then its definitions would get
+% undone and the next image would fail.
+\openin 1 = epsf.tex
+\ifeof 1 \else
+  % Do not bother showing banner with epsf.tex v2.7k (available in
+  % doc/epsf.tex and on ctan).
+  \def\epsfannounce{\toks0 = }%
+  \input epsf.tex
+\fi
+\closein 1
+%
+% We will only complain once about lack of epsf.tex.
+\newif\ifwarnednoepsf
+\newhelp\noepsfhelp{epsf.tex must be installed for images to
+  work.  It is also included in the Texinfo distribution, or you can get
+  it from ftp://tug.org/tex/epsf.tex.}
+%
+\def\image#1{%
+  \ifx\epsfbox\thisisundefined
+    \ifwarnednoepsf \else
+      \errhelp = \noepsfhelp
+      \errmessage{epsf.tex not found, images will be ignored}%
+      \global\warnednoepsftrue
+    \fi
+  \else
+    \imagexxx #1,,,,,\finish
+  \fi
+}
+%
+% Arguments to @image:
+% #1 is (mandatory) image filename; we tack on .eps extension.
+% #2 is (optional) width, #3 is (optional) height.
+% #4 is (ignored optional) html alt text.
+% #5 is (ignored optional) extension.
+% #6 is just the usual extra ignored arg for parsing stuff.
+\newif\ifimagevmode
+\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
+  \catcode`\^^M = 5     % in case we're inside an example
+  \normalturnoffactive  % allow _ et al. in names
+  % If the image is by itself, center it.
+  \ifvmode
+    \imagevmodetrue
+  \else \ifx\centersub\centerV
+    % for @center @image, we need a vbox so we can have our vertical space
+    \imagevmodetrue
+    \vbox\bgroup % vbox has better behavior than vtop herev
+  \fi\fi
+  %
+  \ifimagevmode
+    \nobreak\medskip
+    % Usually we'll have text after the image which will insert
+    % \parskip glue, so insert it here too to equalize the space
+    % above and below.
+    \nobreak\vskip\parskip
+    \nobreak
+  \fi
+  %
+  % Leave vertical mode so that indentation from an enclosing
+  %  environment such as @quotation is respected.
+  % However, if we're at the top level, we don't want the
+  %  normal paragraph indentation.
+  % On the other hand, if we are in the case of @center @image, we don't
+  %  want to start a paragraph, which will create a hsize-width box and
+  %  eradicate the centering.
+  \ifx\centersub\centerV\else \noindent \fi
+  %
+  % Output the image.
+  \ifpdf
+    \dopdfimage{#1}{#2}{#3}%
+  \else
+    % \epsfbox itself resets \epsf?size at each figure.
+    \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
+    \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
+    \epsfbox{#1.eps}%
+  \fi
+  %
+  \ifimagevmode
+    \medskip  % space after a standalone image
+  \fi  
+  \ifx\centersub\centerV \egroup \fi
+\endgroup}
+
+
+% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
+% etc.  We don't actually implement floating yet, we always include the
+% float "here".  But it seemed the best name for the future.
+%
+\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
+
+% There may be a space before second and/or third parameter; delete it.
+\def\eatcommaspace#1, {#1,}
+
+% #1 is the optional FLOATTYPE, the text label for this float, typically
+% "Figure", "Table", "Example", etc.  Can't contain commas.  If omitted,
+% this float will not be numbered and cannot be referred to.
+%
+% #2 is the optional xref label.  Also must be present for the float to
+% be referable.
+%
+% #3 is the optional positioning argument; for now, it is ignored.  It
+% will somehow specify the positions allowed to float to (here, top, bottom).
+%
+% We keep a separate counter for each FLOATTYPE, which we reset at each
+% chapter-level command.
+\let\resetallfloatnos=\empty
+%
+\def\dofloat#1,#2,#3,#4\finish{%
+  \let\thiscaption=\empty
+  \let\thisshortcaption=\empty
+  %
+  % don't lose footnotes inside @float.
+  %
+  % BEWARE: when the floats start float, we have to issue warning whenever an
+  % insert appears inside a float which could possibly float. --kasal, 26may04
+  %
+  \startsavinginserts
+  %
+  % We can't be used inside a paragraph.
+  \par
+  %
+  \vtop\bgroup
+    \def\floattype{#1}%
+    \def\floatlabel{#2}%
+    \def\floatloc{#3}% we do nothing with this yet.
+    %
+    \ifx\floattype\empty
+      \let\safefloattype=\empty
+    \else
+      {%
+        % the floattype might have accents or other special characters,
+        % but we need to use it in a control sequence name.
+        \indexnofonts
+        \turnoffactive
+        \xdef\safefloattype{\floattype}%
+      }%
+    \fi
+    %
+    % If label is given but no type, we handle that as the empty type.
+    \ifx\floatlabel\empty \else
+      % We want each FLOATTYPE to be numbered separately (Figure 1,
+      % Table 1, Figure 2, ...).  (And if no label, no number.)
+      %
+      \expandafter\getfloatno\csname\safefloattype floatno\endcsname
+      \global\advance\floatno by 1
+      %
+      {%
+        % This magic value for \lastsection is output by \setref as the
+        % XREFLABEL-title value.  \xrefX uses it to distinguish float
+        % labels (which have a completely different output format) from
+        % node and anchor labels.  And \xrdef uses it to construct the
+        % lists of floats.
+        %
+        \edef\lastsection{\floatmagic=\safefloattype}%
+        \setref{\floatlabel}{Yfloat}%
+      }%
+    \fi
+    %
+    % start with \parskip glue, I guess.
+    \vskip\parskip
+    %
+    % Don't suppress indentation if a float happens to start a section.
+    \restorefirstparagraphindent
+}
+
+% we have these possibilities:
+% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
+% @float Foo,lbl & no caption:    Foo 1.1
+% @float Foo & @caption{Cap}:     Foo: Cap
+% @float Foo & no caption:        Foo
+% @float ,lbl & Caption{Cap}:     1.1: Cap
+% @float ,lbl & no caption:       1.1
+% @float & @caption{Cap}:         Cap
+% @float & no caption:
+%
+\def\Efloat{%
+    \let\floatident = \empty
+    %
+    % In all cases, if we have a float type, it comes first.
+    \ifx\floattype\empty \else \def\floatident{\floattype}\fi
+    %
+    % If we have an xref label, the number comes next.
+    \ifx\floatlabel\empty \else
+      \ifx\floattype\empty \else % if also had float type, need tie first.
+        \appendtomacro\floatident{\tie}%
+      \fi
+      % the number.
+      \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
+    \fi
+    %
+    % Start the printed caption with what we've constructed in
+    % \floatident, but keep it separate; we need \floatident again.
+    \let\captionline = \floatident
+    %
+    \ifx\thiscaption\empty \else
+      \ifx\floatident\empty \else
+	\appendtomacro\captionline{: }% had ident, so need a colon between
+      \fi
+      %
+      % caption text.
+      \appendtomacro\captionline{\scanexp\thiscaption}%
+    \fi
+    %
+    % If we have anything to print, print it, with space before.
+    % Eventually this needs to become an \insert.
+    \ifx\captionline\empty \else
+      \vskip.5\parskip
+      \captionline
+      %
+      % Space below caption.
+      \vskip\parskip
+    \fi
+    %
+    % If have an xref label, write the list of floats info.  Do this
+    % after the caption, to avoid chance of it being a breakpoint.
+    \ifx\floatlabel\empty \else
+      % Write the text that goes in the lof to the aux file as
+      % \floatlabel-lof.  Besides \floatident, we include the short
+      % caption if specified, else the full caption if specified, else nothing.
+      {%
+        \atdummies
+        %
+        % since we read the caption text in the macro world, where ^^M
+        % is turned into a normal character, we have to scan it back, so
+        % we don't write the literal three characters "^^M" into the aux file.
+	\scanexp{%
+	  \xdef\noexpand\gtemp{%
+	    \ifx\thisshortcaption\empty
+	      \thiscaption
+	    \else
+	      \thisshortcaption
+	    \fi
+	  }%
+	}%
+        \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
+	  \ifx\gtemp\empty \else : \gtemp \fi}}%
+      }%
+    \fi
+  \egroup  % end of \vtop
+  %
+  % place the captured inserts
+  %
+  % BEWARE: when the floats start floating, we have to issue warning
+  % whenever an insert appears inside a float which could possibly
+  % float. --kasal, 26may04
+  %
+  \checkinserts
+}
+
+% Append the tokens #2 to the definition of macro #1, not expanding either.
+%
+\def\appendtomacro#1#2{%
+  \expandafter\def\expandafter#1\expandafter{#1#2}%
+}
+
+% @caption, @shortcaption
+%
+\def\caption{\docaption\thiscaption}
+\def\shortcaption{\docaption\thisshortcaption}
+\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
+\def\defcaption#1#2{\egroup \def#1{#2}}
+
+% The parameter is the control sequence identifying the counter we are
+% going to use.  Create it if it doesn't exist and assign it to \floatno.
+\def\getfloatno#1{%
+  \ifx#1\relax
+      % Haven't seen this figure type before.
+      \csname newcount\endcsname #1%
+      %
+      % Remember to reset this floatno at the next chap.
+      \expandafter\gdef\expandafter\resetallfloatnos
+        \expandafter{\resetallfloatnos #1=0 }%
+  \fi
+  \let\floatno#1%
+}
+
+% \setref calls this to get the XREFLABEL-snt value.  We want an @xref
+% to the FLOATLABEL to expand to "Figure 3.1".  We call \setref when we
+% first read the @float command.
+%
+\def\Yfloat{\floattype at tie \chaplevelprefix\the\floatno}%
+
+% Magic string used for the XREFLABEL-title value, so \xrefX can
+% distinguish floats from other xref types.
+\def\floatmagic{!!float!!}
+
+% #1 is the control sequence we are passed; we expand into a conditional
+% which is true if #1 represents a float ref.  That is, the magic
+% \lastsection value which we \setref above.
+%
+\def\iffloat#1{\expandafter\doiffloat#1==\finish}
+%
+% #1 is (maybe) the \floatmagic string.  If so, #2 will be the
+% (safe) float type for this float.  We set \iffloattype to #2.
+%
+\def\doiffloat#1=#2=#3\finish{%
+  \def\temp{#1}%
+  \def\iffloattype{#2}%
+  \ifx\temp\floatmagic
+}
+
+% @listoffloats FLOATTYPE - print a list of floats like a table of contents.
+%
+\parseargdef\listoffloats{%
+  \def\floattype{#1}% floattype
+  {%
+    % the floattype might have accents or other special characters,
+    % but we need to use it in a control sequence name.
+    \indexnofonts
+    \turnoffactive
+    \xdef\safefloattype{\floattype}%
+  }%
+  %
+  % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
+  \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
+    \ifhavexrefs
+      % if the user said @listoffloats foo but never @float foo.
+      \message{\linenumber No `\safefloattype' floats to list.}%
+    \fi
+  \else
+    \begingroup
+      \leftskip=\tocindent  % indent these entries like a toc
+      \let\do=\listoffloatsdo
+      \csname floatlist\safefloattype\endcsname
+    \endgroup
+  \fi
+}
+
+% This is called on each entry in a list of floats.  We're passed the
+% xref label, in the form LABEL-title, which is how we save it in the
+% aux file.  We strip off the -title and look up \XRLABEL-lof, which
+% has the text we're supposed to typeset here.
+%
+% Figures without xref labels will not be included in the list (since
+% they won't appear in the aux file).
+%
+\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
+\def\listoffloatsdoentry#1-title\finish{{%
+  % Can't fully expand XR#1-lof because it can contain anything.  Just
+  % pass the control sequence.  On the other hand, XR#1-pg is just the
+  % page number, and we want to fully expand that so we can get a link
+  % in pdf output.
+  \toksA = \expandafter{\csname XR#1-lof\endcsname}%
+  %
+  % use the same \entry macro we use to generate the TOC and index.
+  \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
+  \writeentry
+}}
+
+
+\message{localization,}
+
+% For single-language documents, @documentlanguage is usually given very
+% early, just after @documentencoding.  Single argument is the language
+% (de) or locale (de_DE) abbreviation.
+%
+{
+  \catcode`\_ = \active
+  \globaldefs=1
+\parseargdef\documentlanguage{\begingroup
+  \let_=\normalunderscore  % normal _ character for filenames
+  \tex % read txi-??.tex file in plain TeX.
+    % Read the file by the name they passed if it exists.
+    \openin 1 txi-#1.tex
+    \ifeof 1
+      \documentlanguagetrywithoutunderscore{#1_\finish}%
+    \else
+      \globaldefs = 1  % everything in the txi-LL files needs to persist
+      \input txi-#1.tex
+    \fi
+    \closein 1
+  \endgroup % end raw TeX
+\endgroup}
+%
+% If they passed de_DE, and txi-de_DE.tex doesn't exist,
+% try txi-de.tex.
+%
+\gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
+  \openin 1 txi-#1.tex
+  \ifeof 1
+    \errhelp = \nolanghelp
+    \errmessage{Cannot read language file txi-#1.tex}%
+  \else
+    \globaldefs = 1  % everything in the txi-LL files needs to persist
+    \input txi-#1.tex
+  \fi
+  \closein 1
+}
+}% end of special _ catcode
+%
+\newhelp\nolanghelp{The given language definition file cannot be found or
+is empty.  Maybe you need to install it?  Putting it in the current
+directory should work if nowhere else does.}
+
+% This macro is called from txi-??.tex files; the first argument is the
+% \language name to set (without the "\lang@" prefix), the second and
+% third args are \{left,right}hyphenmin.
+%
+% The language names to pass are determined when the format is built.
+% See the etex.log file created at that time, e.g.,
+% /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
+%
+% With TeX Live 2008, etex now includes hyphenation patterns for all
+% available languages.  This means we can support hyphenation in
+% Texinfo, at least to some extent.  (This still doesn't solve the
+% accented characters problem.)
+%
+\catcode`@=11
+\def\txisetlanguage#1#2#3{%
+  % do not set the language if the name is undefined in the current TeX.
+  \expandafter\ifx\csname lang@#1\endcsname \relax
+    \message{no patterns for #1}%
+  \else
+    \global\language = \csname lang@#1\endcsname
+  \fi
+  % but there is no harm in adjusting the hyphenmin values regardless.
+  \global\lefthyphenmin = #2\relax
+  \global\righthyphenmin = #3\relax
+}
+
+% Helpers for encodings.
+% Set the catcode of characters 128 through 255 to the specified number.
+%
+\def\setnonasciicharscatcode#1{%
+   \count255=128
+   \loop\ifnum\count255<256
+      \global\catcode\count255=#1\relax
+      \advance\count255 by 1
+   \repeat
+}
+
+\def\setnonasciicharscatcodenonglobal#1{%
+   \count255=128
+   \loop\ifnum\count255<256
+      \catcode\count255=#1\relax
+      \advance\count255 by 1
+   \repeat
+}
+
+% @documentencoding sets the definition of non-ASCII characters
+% according to the specified encoding.
+%
+\parseargdef\documentencoding{%
+  % Encoding being declared for the document.
+  \def\declaredencoding{\csname #1.enc\endcsname}%
+  %
+  % Supported encodings: names converted to tokens in order to be able
+  % to compare them with \ifx.
+  \def\ascii{\csname US-ASCII.enc\endcsname}%
+  \def\latnine{\csname ISO-8859-15.enc\endcsname}%
+  \def\latone{\csname ISO-8859-1.enc\endcsname}%
+  \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
+  \def\utfeight{\csname UTF-8.enc\endcsname}%
+  %
+  \ifx \declaredencoding \ascii
+     \asciichardefs
+  %
+  \else \ifx \declaredencoding \lattwo
+     \setnonasciicharscatcode\active
+     \lattwochardefs
+  %
+  \else \ifx \declaredencoding \latone
+     \setnonasciicharscatcode\active
+     \latonechardefs
+  %
+  \else \ifx \declaredencoding \latnine
+     \setnonasciicharscatcode\active
+     \latninechardefs
+  %
+  \else \ifx \declaredencoding \utfeight
+     \setnonasciicharscatcode\active
+     \utfeightchardefs
+  %
+  \else
+    \message{Unknown document encoding #1, ignoring.}%
+  %
+  \fi % utfeight
+  \fi % latnine
+  \fi % latone
+  \fi % lattwo
+  \fi % ascii
+}
+
+% A message to be logged when using a character that isn't available
+% the default font encoding (OT1).
+%
+\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
+
+% Take account of \c (plain) vs. \, (Texinfo) difference.
+\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
+
+% First, make active non-ASCII characters in order for them to be
+% correctly categorized when TeX reads the replacement text of
+% macros containing the character definitions.
+\setnonasciicharscatcode\active
+%
+% Latin1 (ISO-8859-1) character definitions.
+\def\latonechardefs{%
+  \gdef^^a0{\tie}
+  \gdef^^a1{\exclamdown}
+  \gdef^^a2{\missingcharmsg{CENT SIGN}}
+  \gdef^^a3{{\pounds}}
+  \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
+  \gdef^^a5{\missingcharmsg{YEN SIGN}}
+  \gdef^^a6{\missingcharmsg{BROKEN BAR}}
+  \gdef^^a7{\S}
+  \gdef^^a8{\"{}}
+  \gdef^^a9{\copyright}
+  \gdef^^aa{\ordf}
+  \gdef^^ab{\guillemetleft}
+  \gdef^^ac{$\lnot$}
+  \gdef^^ad{\-}
+  \gdef^^ae{\registeredsymbol}
+  \gdef^^af{\={}}
+  %
+  \gdef^^b0{\textdegree}
+  \gdef^^b1{$\pm$}
+  \gdef^^b2{$^2$}
+  \gdef^^b3{$^3$}
+  \gdef^^b4{\'{}}
+  \gdef^^b5{$\mu$}
+  \gdef^^b6{\P}
+  %
+  \gdef^^b7{$^.$}
+  \gdef^^b8{\cedilla\ }
+  \gdef^^b9{$^1$}
+  \gdef^^ba{\ordm}
+  %
+  \gdef^^bb{\guillemetright}
+  \gdef^^bc{$1\over4$}
+  \gdef^^bd{$1\over2$}
+  \gdef^^be{$3\over4$}
+  \gdef^^bf{\questiondown}
+  %
+  \gdef^^c0{\`A}
+  \gdef^^c1{\'A}
+  \gdef^^c2{\^A}
+  \gdef^^c3{\~A}
+  \gdef^^c4{\"A}
+  \gdef^^c5{\ringaccent A}
+  \gdef^^c6{\AE}
+  \gdef^^c7{\cedilla C}
+  \gdef^^c8{\`E}
+  \gdef^^c9{\'E}
+  \gdef^^ca{\^E}
+  \gdef^^cb{\"E}
+  \gdef^^cc{\`I}
+  \gdef^^cd{\'I}
+  \gdef^^ce{\^I}
+  \gdef^^cf{\"I}
+  %
+  \gdef^^d0{\DH}
+  \gdef^^d1{\~N}
+  \gdef^^d2{\`O}
+  \gdef^^d3{\'O}
+  \gdef^^d4{\^O}
+  \gdef^^d5{\~O}
+  \gdef^^d6{\"O}
+  \gdef^^d7{$\times$}
+  \gdef^^d8{\O}
+  \gdef^^d9{\`U}
+  \gdef^^da{\'U}
+  \gdef^^db{\^U}
+  \gdef^^dc{\"U}
+  \gdef^^dd{\'Y}
+  \gdef^^de{\TH}
+  \gdef^^df{\ss}
+  %
+  \gdef^^e0{\`a}
+  \gdef^^e1{\'a}
+  \gdef^^e2{\^a}
+  \gdef^^e3{\~a}
+  \gdef^^e4{\"a}
+  \gdef^^e5{\ringaccent a}
+  \gdef^^e6{\ae}
+  \gdef^^e7{\cedilla c}
+  \gdef^^e8{\`e}
+  \gdef^^e9{\'e}
+  \gdef^^ea{\^e}
+  \gdef^^eb{\"e}
+  \gdef^^ec{\`{\dotless i}}
+  \gdef^^ed{\'{\dotless i}}
+  \gdef^^ee{\^{\dotless i}}
+  \gdef^^ef{\"{\dotless i}}
+  %
+  \gdef^^f0{\dh}
+  \gdef^^f1{\~n}
+  \gdef^^f2{\`o}
+  \gdef^^f3{\'o}
+  \gdef^^f4{\^o}
+  \gdef^^f5{\~o}
+  \gdef^^f6{\"o}
+  \gdef^^f7{$\div$}
+  \gdef^^f8{\o}
+  \gdef^^f9{\`u}
+  \gdef^^fa{\'u}
+  \gdef^^fb{\^u}
+  \gdef^^fc{\"u}
+  \gdef^^fd{\'y}
+  \gdef^^fe{\th}
+  \gdef^^ff{\"y}
+}
+
+% Latin9 (ISO-8859-15) encoding character definitions.
+\def\latninechardefs{%
+  % Encoding is almost identical to Latin1.
+  \latonechardefs
+  %
+  \gdef^^a4{\euro}
+  \gdef^^a6{\v S}
+  \gdef^^a8{\v s}
+  \gdef^^b4{\v Z}
+  \gdef^^b8{\v z}
+  \gdef^^bc{\OE}
+  \gdef^^bd{\oe}
+  \gdef^^be{\"Y}
+}
+
+% Latin2 (ISO-8859-2) character definitions.
+\def\lattwochardefs{%
+  \gdef^^a0{\tie}
+  \gdef^^a1{\ogonek{A}}
+  \gdef^^a2{\u{}}
+  \gdef^^a3{\L}
+  \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
+  \gdef^^a5{\v L}
+  \gdef^^a6{\'S}
+  \gdef^^a7{\S}
+  \gdef^^a8{\"{}}
+  \gdef^^a9{\v S}
+  \gdef^^aa{\cedilla S}
+  \gdef^^ab{\v T}
+  \gdef^^ac{\'Z}
+  \gdef^^ad{\-}
+  \gdef^^ae{\v Z}
+  \gdef^^af{\dotaccent Z}
+  %
+  \gdef^^b0{\textdegree}
+  \gdef^^b1{\ogonek{a}}
+  \gdef^^b2{\ogonek{ }}
+  \gdef^^b3{\l}
+  \gdef^^b4{\'{}}
+  \gdef^^b5{\v l}
+  \gdef^^b6{\'s}
+  \gdef^^b7{\v{}}
+  \gdef^^b8{\cedilla\ }
+  \gdef^^b9{\v s}
+  \gdef^^ba{\cedilla s}
+  \gdef^^bb{\v t}
+  \gdef^^bc{\'z}
+  \gdef^^bd{\H{}}
+  \gdef^^be{\v z}
+  \gdef^^bf{\dotaccent z}
+  %
+  \gdef^^c0{\'R}
+  \gdef^^c1{\'A}
+  \gdef^^c2{\^A}
+  \gdef^^c3{\u A}
+  \gdef^^c4{\"A}
+  \gdef^^c5{\'L}
+  \gdef^^c6{\'C}
+  \gdef^^c7{\cedilla C}
+  \gdef^^c8{\v C}
+  \gdef^^c9{\'E}
+  \gdef^^ca{\ogonek{E}}
+  \gdef^^cb{\"E}
+  \gdef^^cc{\v E}
+  \gdef^^cd{\'I}
+  \gdef^^ce{\^I}
+  \gdef^^cf{\v D}
+  %
+  \gdef^^d0{\DH}
+  \gdef^^d1{\'N}
+  \gdef^^d2{\v N}
+  \gdef^^d3{\'O}
+  \gdef^^d4{\^O}
+  \gdef^^d5{\H O}
+  \gdef^^d6{\"O}
+  \gdef^^d7{$\times$}
+  \gdef^^d8{\v R}
+  \gdef^^d9{\ringaccent U}
+  \gdef^^da{\'U}
+  \gdef^^db{\H U}
+  \gdef^^dc{\"U}
+  \gdef^^dd{\'Y}
+  \gdef^^de{\cedilla T}
+  \gdef^^df{\ss}
+  %
+  \gdef^^e0{\'r}
+  \gdef^^e1{\'a}
+  \gdef^^e2{\^a}
+  \gdef^^e3{\u a}
+  \gdef^^e4{\"a}
+  \gdef^^e5{\'l}
+  \gdef^^e6{\'c}
+  \gdef^^e7{\cedilla c}
+  \gdef^^e8{\v c}
+  \gdef^^e9{\'e}
+  \gdef^^ea{\ogonek{e}}
+  \gdef^^eb{\"e}
+  \gdef^^ec{\v e}
+  \gdef^^ed{\'{\dotless{i}}}
+  \gdef^^ee{\^{\dotless{i}}}
+  \gdef^^ef{\v d}
+  %
+  \gdef^^f0{\dh}
+  \gdef^^f1{\'n}
+  \gdef^^f2{\v n}
+  \gdef^^f3{\'o}
+  \gdef^^f4{\^o}
+  \gdef^^f5{\H o}
+  \gdef^^f6{\"o}
+  \gdef^^f7{$\div$}
+  \gdef^^f8{\v r}
+  \gdef^^f9{\ringaccent u}
+  \gdef^^fa{\'u}
+  \gdef^^fb{\H u}
+  \gdef^^fc{\"u}
+  \gdef^^fd{\'y}
+  \gdef^^fe{\cedilla t}
+  \gdef^^ff{\dotaccent{}}
+}
+
+% UTF-8 character definitions.
+%
+% This code to support UTF-8 is based on LaTeX's utf8.def, with some
+% changes for Texinfo conventions.  It is included here under the GPL by
+% permission from Frank Mittelbach and the LaTeX team.
+%
+\newcount\countUTFx
+\newcount\countUTFy
+\newcount\countUTFz
+
+\gdef\UTFviiiTwoOctets#1#2{\expandafter
+   \UTFviiiDefined\csname u8:#1\string #2\endcsname}
+%
+\gdef\UTFviiiThreeOctets#1#2#3{\expandafter
+   \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
+%
+\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
+   \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
+
+\gdef\UTFviiiDefined#1{%
+  \ifx #1\relax
+    \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
+  \else
+    \expandafter #1%
+  \fi
+}
+
+\begingroup
+  \catcode`\~13
+  \catcode`\"12
+
+  \def\UTFviiiLoop{%
+    \global\catcode\countUTFx\active
+    \uccode`\~\countUTFx
+    \uppercase\expandafter{\UTFviiiTmp}%
+    \advance\countUTFx by 1
+    \ifnum\countUTFx < \countUTFy
+      \expandafter\UTFviiiLoop
+    \fi}
+
+  \countUTFx = "C2
+  \countUTFy = "E0
+  \def\UTFviiiTmp{%
+    \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
+  \UTFviiiLoop
+
+  \countUTFx = "E0
+  \countUTFy = "F0
+  \def\UTFviiiTmp{%
+    \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
+  \UTFviiiLoop
+
+  \countUTFx = "F0
+  \countUTFy = "F4
+  \def\UTFviiiTmp{%
+    \xdef~{\noexpand\UTFviiiFourOctets\string~}}
+  \UTFviiiLoop
+\endgroup
+
+\begingroup
+  \catcode`\"=12
+  \catcode`\<=12
+  \catcode`\.=12
+  \catcode`\,=12
+  \catcode`\;=12
+  \catcode`\!=12
+  \catcode`\~=13
+
+  \gdef\DeclareUnicodeCharacter#1#2{%
+    \countUTFz = "#1\relax
+    %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
+    \begingroup
+      \parseXMLCharref
+      \def\UTFviiiTwoOctets##1##2{%
+        \csname u8:##1\string ##2\endcsname}%
+      \def\UTFviiiThreeOctets##1##2##3{%
+        \csname u8:##1\string ##2\string ##3\endcsname}%
+      \def\UTFviiiFourOctets##1##2##3##4{%
+        \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
+      \expandafter\expandafter\expandafter\expandafter
+       \expandafter\expandafter\expandafter
+       \gdef\UTFviiiTmp{#2}%
+    \endgroup}
+
+  \gdef\parseXMLCharref{%
+    \ifnum\countUTFz < "A0\relax
+      \errhelp = \EMsimple
+      \errmessage{Cannot define Unicode char value < 00A0}%
+    \else\ifnum\countUTFz < "800\relax
+      \parseUTFviiiA,%
+      \parseUTFviiiB C\UTFviiiTwoOctets.,%
+    \else\ifnum\countUTFz < "10000\relax
+      \parseUTFviiiA;%
+      \parseUTFviiiA,%
+      \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
+    \else
+      \parseUTFviiiA;%
+      \parseUTFviiiA,%
+      \parseUTFviiiA!%
+      \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
+    \fi\fi\fi
+  }
+
+  \gdef\parseUTFviiiA#1{%
+    \countUTFx = \countUTFz
+    \divide\countUTFz by 64
+    \countUTFy = \countUTFz
+    \multiply\countUTFz by 64
+    \advance\countUTFx by -\countUTFz
+    \advance\countUTFx by 128
+    \uccode `#1\countUTFx
+    \countUTFz = \countUTFy}
+
+  \gdef\parseUTFviiiB#1#2#3#4{%
+    \advance\countUTFz by "#10\relax
+    \uccode `#3\countUTFz
+    \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
+\endgroup
+
+\def\utfeightchardefs{%
+  \DeclareUnicodeCharacter{00A0}{\tie}
+  \DeclareUnicodeCharacter{00A1}{\exclamdown}
+  \DeclareUnicodeCharacter{00A3}{\pounds}
+  \DeclareUnicodeCharacter{00A8}{\"{ }}
+  \DeclareUnicodeCharacter{00A9}{\copyright}
+  \DeclareUnicodeCharacter{00AA}{\ordf}
+  \DeclareUnicodeCharacter{00AB}{\guillemetleft}
+  \DeclareUnicodeCharacter{00AD}{\-}
+  \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
+  \DeclareUnicodeCharacter{00AF}{\={ }}
+
+  \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
+  \DeclareUnicodeCharacter{00B4}{\'{ }}
+  \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
+  \DeclareUnicodeCharacter{00BA}{\ordm}
+  \DeclareUnicodeCharacter{00BB}{\guillemetright}
+  \DeclareUnicodeCharacter{00BF}{\questiondown}
+
+  \DeclareUnicodeCharacter{00C0}{\`A}
+  \DeclareUnicodeCharacter{00C1}{\'A}
+  \DeclareUnicodeCharacter{00C2}{\^A}
+  \DeclareUnicodeCharacter{00C3}{\~A}
+  \DeclareUnicodeCharacter{00C4}{\"A}
+  \DeclareUnicodeCharacter{00C5}{\AA}
+  \DeclareUnicodeCharacter{00C6}{\AE}
+  \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
+  \DeclareUnicodeCharacter{00C8}{\`E}
+  \DeclareUnicodeCharacter{00C9}{\'E}
+  \DeclareUnicodeCharacter{00CA}{\^E}
+  \DeclareUnicodeCharacter{00CB}{\"E}
+  \DeclareUnicodeCharacter{00CC}{\`I}
+  \DeclareUnicodeCharacter{00CD}{\'I}
+  \DeclareUnicodeCharacter{00CE}{\^I}
+  \DeclareUnicodeCharacter{00CF}{\"I}
+
+  \DeclareUnicodeCharacter{00D0}{\DH}
+  \DeclareUnicodeCharacter{00D1}{\~N}
+  \DeclareUnicodeCharacter{00D2}{\`O}
+  \DeclareUnicodeCharacter{00D3}{\'O}
+  \DeclareUnicodeCharacter{00D4}{\^O}
+  \DeclareUnicodeCharacter{00D5}{\~O}
+  \DeclareUnicodeCharacter{00D6}{\"O}
+  \DeclareUnicodeCharacter{00D8}{\O}
+  \DeclareUnicodeCharacter{00D9}{\`U}
+  \DeclareUnicodeCharacter{00DA}{\'U}
+  \DeclareUnicodeCharacter{00DB}{\^U}
+  \DeclareUnicodeCharacter{00DC}{\"U}
+  \DeclareUnicodeCharacter{00DD}{\'Y}
+  \DeclareUnicodeCharacter{00DE}{\TH}
+  \DeclareUnicodeCharacter{00DF}{\ss}
+
+  \DeclareUnicodeCharacter{00E0}{\`a}
+  \DeclareUnicodeCharacter{00E1}{\'a}
+  \DeclareUnicodeCharacter{00E2}{\^a}
+  \DeclareUnicodeCharacter{00E3}{\~a}
+  \DeclareUnicodeCharacter{00E4}{\"a}
+  \DeclareUnicodeCharacter{00E5}{\aa}
+  \DeclareUnicodeCharacter{00E6}{\ae}
+  \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
+  \DeclareUnicodeCharacter{00E8}{\`e}
+  \DeclareUnicodeCharacter{00E9}{\'e}
+  \DeclareUnicodeCharacter{00EA}{\^e}
+  \DeclareUnicodeCharacter{00EB}{\"e}
+  \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
+  \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
+  \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
+  \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
+
+  \DeclareUnicodeCharacter{00F0}{\dh}
+  \DeclareUnicodeCharacter{00F1}{\~n}
+  \DeclareUnicodeCharacter{00F2}{\`o}
+  \DeclareUnicodeCharacter{00F3}{\'o}
+  \DeclareUnicodeCharacter{00F4}{\^o}
+  \DeclareUnicodeCharacter{00F5}{\~o}
+  \DeclareUnicodeCharacter{00F6}{\"o}
+  \DeclareUnicodeCharacter{00F8}{\o}
+  \DeclareUnicodeCharacter{00F9}{\`u}
+  \DeclareUnicodeCharacter{00FA}{\'u}
+  \DeclareUnicodeCharacter{00FB}{\^u}
+  \DeclareUnicodeCharacter{00FC}{\"u}
+  \DeclareUnicodeCharacter{00FD}{\'y}
+  \DeclareUnicodeCharacter{00FE}{\th}
+  \DeclareUnicodeCharacter{00FF}{\"y}
+
+  \DeclareUnicodeCharacter{0100}{\=A}
+  \DeclareUnicodeCharacter{0101}{\=a}
+  \DeclareUnicodeCharacter{0102}{\u{A}}
+  \DeclareUnicodeCharacter{0103}{\u{a}}
+  \DeclareUnicodeCharacter{0104}{\ogonek{A}}
+  \DeclareUnicodeCharacter{0105}{\ogonek{a}}
+  \DeclareUnicodeCharacter{0106}{\'C}
+  \DeclareUnicodeCharacter{0107}{\'c}
+  \DeclareUnicodeCharacter{0108}{\^C}
+  \DeclareUnicodeCharacter{0109}{\^c}
+  \DeclareUnicodeCharacter{0118}{\ogonek{E}}
+  \DeclareUnicodeCharacter{0119}{\ogonek{e}}
+  \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
+  \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
+  \DeclareUnicodeCharacter{010C}{\v{C}}
+  \DeclareUnicodeCharacter{010D}{\v{c}}
+  \DeclareUnicodeCharacter{010E}{\v{D}}
+
+  \DeclareUnicodeCharacter{0112}{\=E}
+  \DeclareUnicodeCharacter{0113}{\=e}
+  \DeclareUnicodeCharacter{0114}{\u{E}}
+  \DeclareUnicodeCharacter{0115}{\u{e}}
+  \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
+  \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
+  \DeclareUnicodeCharacter{011A}{\v{E}}
+  \DeclareUnicodeCharacter{011B}{\v{e}}
+  \DeclareUnicodeCharacter{011C}{\^G}
+  \DeclareUnicodeCharacter{011D}{\^g}
+  \DeclareUnicodeCharacter{011E}{\u{G}}
+  \DeclareUnicodeCharacter{011F}{\u{g}}
+
+  \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
+  \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
+  \DeclareUnicodeCharacter{0124}{\^H}
+  \DeclareUnicodeCharacter{0125}{\^h}
+  \DeclareUnicodeCharacter{0128}{\~I}
+  \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
+  \DeclareUnicodeCharacter{012A}{\=I}
+  \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
+  \DeclareUnicodeCharacter{012C}{\u{I}}
+  \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
+
+  \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
+  \DeclareUnicodeCharacter{0131}{\dotless{i}}
+  \DeclareUnicodeCharacter{0132}{IJ}
+  \DeclareUnicodeCharacter{0133}{ij}
+  \DeclareUnicodeCharacter{0134}{\^J}
+  \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
+  \DeclareUnicodeCharacter{0139}{\'L}
+  \DeclareUnicodeCharacter{013A}{\'l}
+
+  \DeclareUnicodeCharacter{0141}{\L}
+  \DeclareUnicodeCharacter{0142}{\l}
+  \DeclareUnicodeCharacter{0143}{\'N}
+  \DeclareUnicodeCharacter{0144}{\'n}
+  \DeclareUnicodeCharacter{0147}{\v{N}}
+  \DeclareUnicodeCharacter{0148}{\v{n}}
+  \DeclareUnicodeCharacter{014C}{\=O}
+  \DeclareUnicodeCharacter{014D}{\=o}
+  \DeclareUnicodeCharacter{014E}{\u{O}}
+  \DeclareUnicodeCharacter{014F}{\u{o}}
+
+  \DeclareUnicodeCharacter{0150}{\H{O}}
+  \DeclareUnicodeCharacter{0151}{\H{o}}
+  \DeclareUnicodeCharacter{0152}{\OE}
+  \DeclareUnicodeCharacter{0153}{\oe}
+  \DeclareUnicodeCharacter{0154}{\'R}
+  \DeclareUnicodeCharacter{0155}{\'r}
+  \DeclareUnicodeCharacter{0158}{\v{R}}
+  \DeclareUnicodeCharacter{0159}{\v{r}}
+  \DeclareUnicodeCharacter{015A}{\'S}
+  \DeclareUnicodeCharacter{015B}{\'s}
+  \DeclareUnicodeCharacter{015C}{\^S}
+  \DeclareUnicodeCharacter{015D}{\^s}
+  \DeclareUnicodeCharacter{015E}{\cedilla{S}}
+  \DeclareUnicodeCharacter{015F}{\cedilla{s}}
+
+  \DeclareUnicodeCharacter{0160}{\v{S}}
+  \DeclareUnicodeCharacter{0161}{\v{s}}
+  \DeclareUnicodeCharacter{0162}{\cedilla{t}}
+  \DeclareUnicodeCharacter{0163}{\cedilla{T}}
+  \DeclareUnicodeCharacter{0164}{\v{T}}
+
+  \DeclareUnicodeCharacter{0168}{\~U}
+  \DeclareUnicodeCharacter{0169}{\~u}
+  \DeclareUnicodeCharacter{016A}{\=U}
+  \DeclareUnicodeCharacter{016B}{\=u}
+  \DeclareUnicodeCharacter{016C}{\u{U}}
+  \DeclareUnicodeCharacter{016D}{\u{u}}
+  \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
+  \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
+
+  \DeclareUnicodeCharacter{0170}{\H{U}}
+  \DeclareUnicodeCharacter{0171}{\H{u}}
+  \DeclareUnicodeCharacter{0174}{\^W}
+  \DeclareUnicodeCharacter{0175}{\^w}
+  \DeclareUnicodeCharacter{0176}{\^Y}
+  \DeclareUnicodeCharacter{0177}{\^y}
+  \DeclareUnicodeCharacter{0178}{\"Y}
+  \DeclareUnicodeCharacter{0179}{\'Z}
+  \DeclareUnicodeCharacter{017A}{\'z}
+  \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
+  \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
+  \DeclareUnicodeCharacter{017D}{\v{Z}}
+  \DeclareUnicodeCharacter{017E}{\v{z}}
+
+  \DeclareUnicodeCharacter{01C4}{D\v{Z}}
+  \DeclareUnicodeCharacter{01C5}{D\v{z}}
+  \DeclareUnicodeCharacter{01C6}{d\v{z}}
+  \DeclareUnicodeCharacter{01C7}{LJ}
+  \DeclareUnicodeCharacter{01C8}{Lj}
+  \DeclareUnicodeCharacter{01C9}{lj}
+  \DeclareUnicodeCharacter{01CA}{NJ}
+  \DeclareUnicodeCharacter{01CB}{Nj}
+  \DeclareUnicodeCharacter{01CC}{nj}
+  \DeclareUnicodeCharacter{01CD}{\v{A}}
+  \DeclareUnicodeCharacter{01CE}{\v{a}}
+  \DeclareUnicodeCharacter{01CF}{\v{I}}
+
+  \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
+  \DeclareUnicodeCharacter{01D1}{\v{O}}
+  \DeclareUnicodeCharacter{01D2}{\v{o}}
+  \DeclareUnicodeCharacter{01D3}{\v{U}}
+  \DeclareUnicodeCharacter{01D4}{\v{u}}
+
+  \DeclareUnicodeCharacter{01E2}{\={\AE}}
+  \DeclareUnicodeCharacter{01E3}{\={\ae}}
+  \DeclareUnicodeCharacter{01E6}{\v{G}}
+  \DeclareUnicodeCharacter{01E7}{\v{g}}
+  \DeclareUnicodeCharacter{01E8}{\v{K}}
+  \DeclareUnicodeCharacter{01E9}{\v{k}}
+
+  \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
+  \DeclareUnicodeCharacter{01F1}{DZ}
+  \DeclareUnicodeCharacter{01F2}{Dz}
+  \DeclareUnicodeCharacter{01F3}{dz}
+  \DeclareUnicodeCharacter{01F4}{\'G}
+  \DeclareUnicodeCharacter{01F5}{\'g}
+  \DeclareUnicodeCharacter{01F8}{\`N}
+  \DeclareUnicodeCharacter{01F9}{\`n}
+  \DeclareUnicodeCharacter{01FC}{\'{\AE}}
+  \DeclareUnicodeCharacter{01FD}{\'{\ae}}
+  \DeclareUnicodeCharacter{01FE}{\'{\O}}
+  \DeclareUnicodeCharacter{01FF}{\'{\o}}
+
+  \DeclareUnicodeCharacter{021E}{\v{H}}
+  \DeclareUnicodeCharacter{021F}{\v{h}}
+
+  \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
+  \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
+  \DeclareUnicodeCharacter{0228}{\cedilla{E}}
+  \DeclareUnicodeCharacter{0229}{\cedilla{e}}
+  \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
+  \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
+
+  \DeclareUnicodeCharacter{0232}{\=Y}
+  \DeclareUnicodeCharacter{0233}{\=y}
+  \DeclareUnicodeCharacter{0237}{\dotless{j}}
+
+  \DeclareUnicodeCharacter{02DB}{\ogonek{ }}
+
+  \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
+  \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
+  \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
+  \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
+  \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
+  \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
+  \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
+  \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
+  \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
+  \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
+  \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
+  \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
+
+  \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
+  \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
+
+  \DeclareUnicodeCharacter{1E20}{\=G}
+  \DeclareUnicodeCharacter{1E21}{\=g}
+  \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
+  \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
+  \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
+  \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
+  \DeclareUnicodeCharacter{1E26}{\"H}
+  \DeclareUnicodeCharacter{1E27}{\"h}
+
+  \DeclareUnicodeCharacter{1E30}{\'K}
+  \DeclareUnicodeCharacter{1E31}{\'k}
+  \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
+  \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
+  \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
+  \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
+  \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
+  \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
+  \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
+  \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
+  \DeclareUnicodeCharacter{1E3E}{\'M}
+  \DeclareUnicodeCharacter{1E3F}{\'m}
+
+  \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
+  \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
+  \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
+  \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
+  \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
+  \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
+  \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
+  \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
+  \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
+  \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
+
+  \DeclareUnicodeCharacter{1E54}{\'P}
+  \DeclareUnicodeCharacter{1E55}{\'p}
+  \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
+  \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
+  \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
+  \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
+  \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
+  \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
+  \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
+  \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
+
+  \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
+  \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
+  \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
+  \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
+  \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
+  \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
+  \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
+  \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
+  \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
+  \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
+
+  \DeclareUnicodeCharacter{1E7C}{\~V}
+  \DeclareUnicodeCharacter{1E7D}{\~v}
+  \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
+  \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
+
+  \DeclareUnicodeCharacter{1E80}{\`W}
+  \DeclareUnicodeCharacter{1E81}{\`w}
+  \DeclareUnicodeCharacter{1E82}{\'W}
+  \DeclareUnicodeCharacter{1E83}{\'w}
+  \DeclareUnicodeCharacter{1E84}{\"W}
+  \DeclareUnicodeCharacter{1E85}{\"w}
+  \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
+  \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
+  \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
+  \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
+  \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
+  \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
+  \DeclareUnicodeCharacter{1E8C}{\"X}
+  \DeclareUnicodeCharacter{1E8D}{\"x}
+  \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
+  \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
+
+  \DeclareUnicodeCharacter{1E90}{\^Z}
+  \DeclareUnicodeCharacter{1E91}{\^z}
+  \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
+  \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
+  \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
+  \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
+  \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
+  \DeclareUnicodeCharacter{1E97}{\"t}
+  \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
+  \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
+
+  \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
+  \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
+
+  \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
+  \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
+  \DeclareUnicodeCharacter{1EBC}{\~E}
+  \DeclareUnicodeCharacter{1EBD}{\~e}
+
+  \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
+  \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
+  \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
+  \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
+
+  \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
+  \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
+
+  \DeclareUnicodeCharacter{1EF2}{\`Y}
+  \DeclareUnicodeCharacter{1EF3}{\`y}
+  \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
+
+  \DeclareUnicodeCharacter{1EF8}{\~Y}
+  \DeclareUnicodeCharacter{1EF9}{\~y}
+
+  \DeclareUnicodeCharacter{2013}{--}
+  \DeclareUnicodeCharacter{2014}{---}
+  \DeclareUnicodeCharacter{2018}{\quoteleft}
+  \DeclareUnicodeCharacter{2019}{\quoteright}
+  \DeclareUnicodeCharacter{201A}{\quotesinglbase}
+  \DeclareUnicodeCharacter{201C}{\quotedblleft}
+  \DeclareUnicodeCharacter{201D}{\quotedblright}
+  \DeclareUnicodeCharacter{201E}{\quotedblbase}
+  \DeclareUnicodeCharacter{2022}{\bullet}
+  \DeclareUnicodeCharacter{2026}{\dots}
+  \DeclareUnicodeCharacter{2039}{\guilsinglleft}
+  \DeclareUnicodeCharacter{203A}{\guilsinglright}
+  \DeclareUnicodeCharacter{20AC}{\euro}
+
+  \DeclareUnicodeCharacter{2192}{\expansion}
+  \DeclareUnicodeCharacter{21D2}{\result}
+
+  \DeclareUnicodeCharacter{2212}{\minus}
+  \DeclareUnicodeCharacter{2217}{\point}
+  \DeclareUnicodeCharacter{2261}{\equiv}
+}% end of \utfeightchardefs
+
+
+% US-ASCII character definitions.
+\def\asciichardefs{% nothing need be done
+   \relax
+}
+
+% Make non-ASCII characters printable again for compatibility with
+% existing Texinfo documents that may use them, even without declaring a
+% document encoding.
+%
+\setnonasciicharscatcode \other
+
+
+\message{formatting,}
+
+\newdimen\defaultparindent \defaultparindent = 15pt
+
+\chapheadingskip = 15pt plus 4pt minus 2pt
+\secheadingskip = 12pt plus 3pt minus 2pt
+\subsecheadingskip = 9pt plus 2pt minus 2pt
+
+% Prevent underfull vbox error messages.
+\vbadness = 10000
+
+% Don't be very finicky about underfull hboxes, either.
+\hbadness = 6666
+
+% Following George Bush, get rid of widows and orphans.
+\widowpenalty=10000
+\clubpenalty=10000
+
+% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
+% using an old version of TeX, don't do anything.  We want the amount of
+% stretch added to depend on the line length, hence the dependence on
+% \hsize.  We call this whenever the paper size is set.
+%
+\def\setemergencystretch{%
+  \ifx\emergencystretch\thisisundefined
+    % Allow us to assign to \emergencystretch anyway.
+    \def\emergencystretch{\dimen0}%
+  \else
+    \emergencystretch = .15\hsize
+  \fi
+}
+
+% Parameters in order: 1) textheight; 2) textwidth;
+% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
+% 7) physical page height; 8) physical page width.
+%
+% We also call \setleading{\textleading}, so the caller should define
+% \textleading.  The caller should also set \parskip.
+%
+\def\internalpagesizes#1#2#3#4#5#6#7#8{%
+  \voffset = #3\relax
+  \topskip = #6\relax
+  \splittopskip = \topskip
+  %
+  \vsize = #1\relax
+  \advance\vsize by \topskip
+  \outervsize = \vsize
+  \advance\outervsize by 2\topandbottommargin
+  \pageheight = \vsize
+  %
+  \hsize = #2\relax
+  \outerhsize = \hsize
+  \advance\outerhsize by 0.5in
+  \pagewidth = \hsize
+  %
+  \normaloffset = #4\relax
+  \bindingoffset = #5\relax
+  %
+  \ifpdf
+    \pdfpageheight #7\relax
+    \pdfpagewidth #8\relax
+    % if we don't reset these, they will remain at "1 true in" of
+    % whatever layout pdftex was dumped with.
+    \pdfhorigin = 1 true in
+    \pdfvorigin = 1 true in
+  \fi
+  %
+  \setleading{\textleading}
+  %
+  \parindent = \defaultparindent
+  \setemergencystretch
+}
+
+% @letterpaper (the default).
+\def\letterpaper{{\globaldefs = 1
+  \parskip = 3pt plus 2pt minus 1pt
+  \textleading = 13.2pt
+  %
+  % If page is nothing but text, make it come out even.
+  \internalpagesizes{607.2pt}{6in}% that's 46 lines
+                    {\voffset}{.25in}%
+                    {\bindingoffset}{36pt}%
+                    {11in}{8.5in}%
+}}
+
+% Use @smallbook to reset parameters for 7x9.25 trim size.
+\def\smallbook{{\globaldefs = 1
+  \parskip = 2pt plus 1pt
+  \textleading = 12pt
+  %
+  \internalpagesizes{7.5in}{5in}%
+                    {-.2in}{0in}%
+                    {\bindingoffset}{16pt}%
+                    {9.25in}{7in}%
+  %
+  \lispnarrowing = 0.3in
+  \tolerance = 700
+  \hfuzz = 1pt
+  \contentsrightmargin = 0pt
+  \defbodyindent = .5cm
+}}
+
+% Use @smallerbook to reset parameters for 6x9 trim size.
+% (Just testing, parameters still in flux.)
+\def\smallerbook{{\globaldefs = 1
+  \parskip = 1.5pt plus 1pt
+  \textleading = 12pt
+  %
+  \internalpagesizes{7.4in}{4.8in}%
+                    {-.2in}{-.4in}%
+                    {0pt}{14pt}%
+                    {9in}{6in}%
+  %
+  \lispnarrowing = 0.25in
+  \tolerance = 700
+  \hfuzz = 1pt
+  \contentsrightmargin = 0pt
+  \defbodyindent = .4cm
+}}
+
+% Use @afourpaper to print on European A4 paper.
+\def\afourpaper{{\globaldefs = 1
+  \parskip = 3pt plus 2pt minus 1pt
+  \textleading = 13.2pt
+  %
+  % Double-side printing via postscript on Laserjet 4050
+  % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
+  % To change the settings for a different printer or situation, adjust
+  % \normaloffset until the front-side and back-side texts align.  Then
+  % do the same for \bindingoffset.  You can set these for testing in
+  % your texinfo source file like this:
+  % @tex
+  % \global\normaloffset = -6mm
+  % \global\bindingoffset = 10mm
+  % @end tex
+  \internalpagesizes{673.2pt}{160mm}% that's 51 lines
+                    {\voffset}{\hoffset}%
+                    {\bindingoffset}{44pt}%
+                    {297mm}{210mm}%
+  %
+  \tolerance = 700
+  \hfuzz = 1pt
+  \contentsrightmargin = 0pt
+  \defbodyindent = 5mm
+}}
+
+% Use @afivepaper to print on European A5 paper.
+% From romildo at urano.iceb.ufop.br, 2 July 2000.
+% He also recommends making @example and @lisp be small.
+\def\afivepaper{{\globaldefs = 1
+  \parskip = 2pt plus 1pt minus 0.1pt
+  \textleading = 12.5pt
+  %
+  \internalpagesizes{160mm}{120mm}%
+                    {\voffset}{\hoffset}%
+                    {\bindingoffset}{8pt}%
+                    {210mm}{148mm}%
+  %
+  \lispnarrowing = 0.2in
+  \tolerance = 800
+  \hfuzz = 1.2pt
+  \contentsrightmargin = 0pt
+  \defbodyindent = 2mm
+  \tableindent = 12mm
+}}
+
+% A specific text layout, 24x15cm overall, intended for A4 paper.
+\def\afourlatex{{\globaldefs = 1
+  \afourpaper
+  \internalpagesizes{237mm}{150mm}%
+                    {\voffset}{4.6mm}%
+                    {\bindingoffset}{7mm}%
+                    {297mm}{210mm}%
+  %
+  % Must explicitly reset to 0 because we call \afourpaper.
+  \globaldefs = 0
+}}
+
+% Use @afourwide to print on A4 paper in landscape format.
+\def\afourwide{{\globaldefs = 1
+  \afourpaper
+  \internalpagesizes{241mm}{165mm}%
+                    {\voffset}{-2.95mm}%
+                    {\bindingoffset}{7mm}%
+                    {297mm}{210mm}%
+  \globaldefs = 0
+}}
+
+% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
+% Perhaps we should allow setting the margins, \topskip, \parskip,
+% and/or leading, also. Or perhaps we should compute them somehow.
+%
+\parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
+\def\pagesizesyyy#1,#2,#3\finish{{%
+  \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
+  \globaldefs = 1
+  %
+  \parskip = 3pt plus 2pt minus 1pt
+  \setleading{\textleading}%
+  %
+  \dimen0 = #1\relax
+  \advance\dimen0 by \voffset
+  %
+  \dimen2 = \hsize
+  \advance\dimen2 by \normaloffset
+  %
+  \internalpagesizes{#1}{\hsize}%
+                    {\voffset}{\normaloffset}%
+                    {\bindingoffset}{44pt}%
+                    {\dimen0}{\dimen2}%
+}}
+
+% Set default to letter.
+%
+\letterpaper
+
+
+\message{and turning on texinfo input format.}
+
+\def^^L{\par} % remove \outer, so ^L can appear in an @comment
+
+% DEL is a comment character, in case @c does not suffice.
+\catcode`\^^? = 14
+
+% Define macros to output various characters with catcode for normal text.
+\catcode`\"=\other \def\normaldoublequote{"}
+\catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
+\catcode`\+=\other \def\normalplus{+}
+\catcode`\<=\other \def\normalless{<}
+\catcode`\>=\other \def\normalgreater{>}
+\catcode`\^=\other \def\normalcaret{^}
+\catcode`\_=\other \def\normalunderscore{_}
+\catcode`\|=\other \def\normalverticalbar{|}
+\catcode`\~=\other \def\normaltilde{~}
+
+% This macro is used to make a character print one way in \tt
+% (where it can probably be output as-is), and another way in other fonts,
+% where something hairier probably needs to be done.
+%
+% #1 is what to print if we are indeed using \tt; #2 is what to print
+% otherwise.  Since all the Computer Modern typewriter fonts have zero
+% interword stretch (and shrink), and it is reasonable to expect all
+% typewriter fonts to have this, we can check that font parameter.
+%
+\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
+
+% Same as above, but check for italic font.  Actually this also catches
+% non-italic slanted fonts since it is impossible to distinguish them from
+% italic fonts.  But since this is only used by $ and it uses \sl anyway
+% this is not a problem.
+\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
+
+% Turn off all special characters except @
+% (and those which the user can use as if they were ordinary).
+% Most of these we simply print from the \tt font, but for some, we can
+% use math or other variants that look better in normal text.
+
+\catcode`\"=\active
+\def\activedoublequote{{\tt\char34}}
+\let"=\activedoublequote
+\catcode`\~=\active
+\def~{{\tt\char126}}
+\chardef\hat=`\^
+\catcode`\^=\active
+\def^{{\tt \hat}}
+
+\catcode`\_=\active
+\def_{\ifusingtt\normalunderscore\_}
+\let\realunder=_
+% Subroutine for the previous macro.
+\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
+
+\catcode`\|=\active
+\def|{{\tt\char124}}
+\chardef \less=`\<
+\catcode`\<=\active
+\def<{{\tt \less}}
+\chardef \gtr=`\>
+\catcode`\>=\active
+\def>{{\tt \gtr}}
+\catcode`\+=\active
+\def+{{\tt \char 43}}
+\catcode`\$=\active
+\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
+
+% If a .fmt file is being used, characters that might appear in a file
+% name cannot be active until we have parsed the command line.
+% So turn them off again, and have \everyjob (or @setfilename) turn them on.
+% \otherifyactive is called near the end of this file.
+\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
+
+% Used sometimes to turn off (effectively) the active characters even after
+% parsing them.
+\def\turnoffactive{%
+  \normalturnoffactive
+  \otherbackslash
+}
+
+\catcode`\@=0
+
+% \backslashcurfont outputs one backslash character in current font,
+% as in \char`\\.
+\global\chardef\backslashcurfont=`\\
+\global\let\rawbackslashxx=\backslashcurfont  % let existing .??s files work
+
+% \realbackslash is an actual character `\' with catcode other, and
+% \doublebackslash is two of them (for the pdf outlines).
+{\catcode`\\=\other @gdef at realbackslash{\} @gdef at doublebackslash{\\}}
+
+% In texinfo, backslash is an active character; it prints the backslash
+% in fixed width font.
+\catcode`\\=\active  % @ for escape char from now on.
+
+% The story here is that in math mode, the \char of \backslashcurfont
+% ends up printing the roman \ from the math symbol font (because \char
+% in math mode uses the \mathcode, and plain.tex sets
+% \mathcode`\\="026E).  It seems better for @backslashchar{} to always
+% print a typewriter backslash, hence we use an explicit \mathchar,
+% which is the decimal equivalent of "715c (class 7, e.g., use \fam;
+% ignored family value; char position "5C).  We can't use " for the
+% usual hex value because it has already been made active.
+ at def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
+ at let@backslashchar = @normalbackslash % @backslashchar{} is for user documents.
+
+% On startup, @fixbackslash assigns:
+%  @let \ = @normalbackslash
+% \rawbackslash defines an active \ to do \backslashcurfont.
+% \otherbackslash defines an active \ to be a literal `\' character with
+% catcode other.  We switch back and forth between these.
+ at gdef@rawbackslash{@let\=@backslashcurfont}
+ at gdef@otherbackslash{@let\=@realbackslash}
+
+% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
+% the literal character `\'.  Also revert - to its normal character, in
+% case the active - from code has slipped in.
+%
+{@catcode`- = @active
+ @gdef at normalturnoffactive{%
+   @let-=@normaldash
+   @let"=@normaldoublequote
+   @let$=@normaldollar %$ font-lock fix
+   @let+=@normalplus
+   @let<=@normalless
+   @let>=@normalgreater
+   @let\=@normalbackslash
+   @let^=@normalcaret
+   @let_=@normalunderscore
+   @let|=@normalverticalbar
+   @let~=@normaltilde
+   @markupsetuplqdefault
+   @markupsetuprqdefault
+   @unsepspaces
+ }
+}
+
+% Make _ and + \other characters, temporarily.
+% This is canceled by @fixbackslash.
+ at otherifyactive
+
+% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
+% That is what \eatinput is for; after that, the `\' should revert to printing
+% a backslash.
+%
+ at gdef@eatinput input texinfo{@fixbackslash}
+ at global@let\ = @eatinput
+
+% On the other hand, perhaps the file did not have a `\input texinfo'. Then
+% the first `\' in the file would cause an error. This macro tries to fix
+% that, assuming it is called before the first `\' could plausibly occur.
+% Also turn back on active characters that might appear in the input
+% file name, in case not using a pre-dumped format.
+%
+ at gdef@fixbackslash{%
+  @ifx\@eatinput @let\ = @normalbackslash @fi
+  @catcode`+=@active
+  @catcode`@_=@active
+}
+
+% Say @foo, not \foo, in error messages.
+ at escapechar = `@@
+
+% These (along with & and #) are made active for url-breaking, so need
+% active definitions as the normal characters.
+ at def@normaldot{.}
+ at def@normalquest{?}
+ at def@normalslash{/}
+
+% These look ok in all fonts, so just make them not special.
+% @hashchar{} gets its own user-level command, because of #line.
+ at catcode`@& = @other @def at normalamp{&}
+ at catcode`@# = @other @def at normalhash{#}
+ at catcode`@% = @other @def at normalpercent{%}
+
+ at let @hashchar = @normalhash
+
+ at c Finally, make ` and ' active, so that txicodequoteundirected and
+ at c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}.  If we
+ at c don't make ` and ' active, @code will not get them as active chars.
+ at c Do this last of all since we use ` in the previous @catcode assignments.
+ at catcode`@'=@active
+ at catcode`@`=@active
+ at markupsetuplqdefault
+ at markupsetuprqdefault
+
+ at c Local variables:
+ at c eval: (add-hook 'write-file-hooks 'time-stamp)
+ at c page-delimiter: "^\\\\message"
+ at c time-stamp-start: "def\\\\texinfoversion{"
+ at c time-stamp-format: "%:y-%02m-%02d.%02H"
+ at c time-stamp-end: "}"
+ at c End:
+
+ at c vim:sw=2:
+
+ at ignore
+   arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
+ at end ignore
diff --git a/configure b/configure
index 4dcaf63..2190348 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for hkl 4.99.99.1621.
+# Generated by GNU Autoconf 2.69 for hkl 4.99.99.1892.
 #
 # Report bugs to <picca at synchrotron-soleil.fr>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='hkl'
 PACKAGE_TARNAME='hkl'
-PACKAGE_VERSION='4.99.99.1621'
-PACKAGE_STRING='hkl 4.99.99.1621'
+PACKAGE_VERSION='4.99.99.1892'
+PACKAGE_STRING='hkl 4.99.99.1892'
 PACKAGE_BUGREPORT='picca at synchrotron-soleil.fr'
 PACKAGE_URL=''
 
@@ -635,12 +635,6 @@ ac_includes_default="\
 ac_subst_vars='am__EXEEXT_FALSE
 am__EXEEXT_TRUE
 LTLIBOBJS
-GLIB_COMPILE_RESOURCES
-GLIB_MKENUMS
-GOBJECT_QUERY
-GLIB_GENMARSHAL
-GLIB_LIBS
-GLIB_CFLAGS
 GOBJECT_LIBS
 GOBJECT_CFLAGS
 HAVE_INTROSPECTION_FALSE
@@ -656,26 +650,22 @@ INTROSPECTION_SCANNER
 LTP_GENHTML
 LTP
 SHTOOL
-GTKGLEXTMM_LIBS
-GTKGLEXTMM_CFLAGS
+GTKGLEXT_LIBS
+GTKGLEXT_CFLAGS
 GLU_LIBS
 GLU_CFLAGS
-GTKMM_LIBS
-GTKMM_CFLAGS
+GTK_LIBS
+GTK_CFLAGS
 GUI_FALSE
 GUI_TRUE
 YAML_LIBS
 YAML_CFLAGS
+BULLET_LIBS
+BULLET_CFLAGS
 G3D_LIBS
 G3D_CFLAGS
 HKL3D_FALSE
 HKL3D_TRUE
-CONDITIONAL_BUILD_DEMOS_FALSE
-CONDITIONAL_BUILD_DEMOS_TRUE
-CONDITIONAL_BUILD_MULTITHREADED_FALSE
-CONDITIONAL_BUILD_MULTITHREADED_TRUE
-opengl_LIBS
-ASY
 GTK_DOC_USE_REBASE_FALSE
 GTK_DOC_USE_REBASE_TRUE
 GTK_DOC_USE_LIBTOOL_FALSE
@@ -686,17 +676,32 @@ GTK_DOC_BUILD_HTML_FALSE
 GTK_DOC_BUILD_HTML_TRUE
 ENABLE_GTK_DOC_FALSE
 ENABLE_GTK_DOC_TRUE
+HAVE_GTK_DOC_FALSE
+HAVE_GTK_DOC_TRUE
 GTKDOC_DEPS_LIBS
 GTKDOC_DEPS_CFLAGS
 HTML_DIR
 GTKDOC_MKPDF
 GTKDOC_REBASE
+GTKDOC_CHECK_PATH
 GTKDOC_CHECK
+EMACS
+ASY
+HKL_DOC_FALSE
+HKL_DOC_TRUE
+LOGGING_FALSE
+LOGGING_TRUE
+LIBOBJS
+ALLOCA
+GLIB_COMPILE_RESOURCES
+GLIB_MKENUMS
+GOBJECT_QUERY
+GLIB_GENMARSHAL
+GLIB_LIBS
+GLIB_CFLAGS
 PKG_CONFIG_LIBDIR
 PKG_CONFIG_PATH
 PKG_CONFIG
-LIBOBJS
-ALLOCA
 GSL_LIBS
 GSL_CFLAGS
 GSL_CONFIG
@@ -734,15 +739,15 @@ build
 LIBTOOL
 LN_S
 CPP
-am__fastdepCC_FALSE
-am__fastdepCC_TRUE
-CCDEPMODE
-ac_ct_CC
-CFLAGS
-CC
 am__fastdepCXX_FALSE
 am__fastdepCXX_TRUE
 CXXDEPMODE
+ac_ct_CXX
+CXXFLAGS
+CXX
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
 am__nodep
 AMDEPBACKSLASH
 AMDEP_FALSE
@@ -752,11 +757,11 @@ am__include
 DEPDIR
 OBJEXT
 EXEEXT
-ac_ct_CXX
+ac_ct_CC
 CPPFLAGS
 LDFLAGS
-CXXFLAGS
-CXX
+CFLAGS
+CC
 AM_BACKSLASH
 AM_DEFAULT_VERBOSITY
 AM_DEFAULT_V
@@ -837,30 +842,29 @@ enable_libtool_lock
 with_gsl_prefix
 with_gsl_exec_prefix
 enable_gsltest
+enable_glibtest
+enable_logging
+enable_hkl_doc
 with_html_dir
 enable_gtk_doc
 enable_gtk_doc_html
 enable_gtk_doc_pdf
-enable_multithreaded
-enable_demos
-enable_debug
 enable_hkl3d
 enable_gui
 enable_gcov
 enable_introspection
-enable_glibtest
 '
       ac_precious_vars='build_alias
 host_alias
 target_alias
-CXX
-CXXFLAGS
+CC
+CFLAGS
 LDFLAGS
 LIBS
 CPPFLAGS
+CXX
+CXXFLAGS
 CCC
-CC
-CFLAGS
 CPP
 CXXCPP
 PKG_CONFIG
@@ -870,12 +874,14 @@ GTKDOC_DEPS_CFLAGS
 GTKDOC_DEPS_LIBS
 G3D_CFLAGS
 G3D_LIBS
-GTKMM_CFLAGS
-GTKMM_LIBS
+BULLET_CFLAGS
+BULLET_LIBS
+GTK_CFLAGS
+GTK_LIBS
 GLU_CFLAGS
 GLU_LIBS
-GTKGLEXTMM_CFLAGS
-GTKGLEXTMM_LIBS
+GTKGLEXT_CFLAGS
+GTKGLEXT_LIBS
 GOBJECT_CFLAGS
 GOBJECT_LIBS'
 
@@ -1418,7 +1424,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures hkl 4.99.99.1621 to adapt to many kinds of systems.
+\`configure' configures hkl 4.99.99.1892 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1488,7 +1494,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of hkl 4.99.99.1621:";;
+     short | recursive ) echo "Configuration of hkl 4.99.99.1892:";;
    esac
   cat <<\_ACEOF
 
@@ -1508,18 +1514,17 @@ Optional Features:
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
   --disable-gsltest       Do not try to compile and run a test GSL program
+  --disable-glibtest      do not try to compile and run a test GLIB program
+  --enable-logging        enable the glib logging
+  --disable-hkl-doc       build documentation
   --enable-gtk-doc        use gtk-doc to build documentation [[default=no]]
   --enable-gtk-doc-html   build documentation in html format [[default=yes]]
   --enable-gtk-doc-pdf    build documentation in pdf format [[default=no]]
-  --enable-multithreaded  build BulletMultiThreaded (default NO)
-  --disable-demos         disable Bullet demos
-  --enable-debug          build with debugging information (default NO)
   --enable-hkl3d          compile the hkl3d library
   --disable-gui           do not compile the gui interface
   --enable-gcov           Enable gcov
   --enable-introspection=[no/auto/yes]
                           Enable introspection for this build
-  --disable-glibtest      do not try to compile and run a test GLIB program
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -1534,15 +1539,15 @@ Optional Packages:
   --with-html-dir=PATH    path to installed docs
 
 Some influential environment variables:
-  CXX         C++ compiler command
-  CXXFLAGS    C++ compiler flags
+  CC          C compiler command
+  CFLAGS      C compiler flags
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>
   LIBS        libraries to pass to the linker, e.g. -l<library>
   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
-  CC          C compiler command
-  CFLAGS      C compiler flags
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
   CPP         C preprocessor
   CXXCPP      C++ preprocessor
   PKG_CONFIG  path to pkg-config utility
@@ -1556,15 +1561,17 @@ Some influential environment variables:
               linker flags for GTKDOC_DEPS, overriding pkg-config
   G3D_CFLAGS  C compiler flags for G3D, overriding pkg-config
   G3D_LIBS    linker flags for G3D, overriding pkg-config
-  GTKMM_CFLAGS
-              C compiler flags for GTKMM, overriding pkg-config
-  GTKMM_LIBS  linker flags for GTKMM, overriding pkg-config
+  BULLET_CFLAGS
+              C compiler flags for BULLET, overriding pkg-config
+  BULLET_LIBS linker flags for BULLET, overriding pkg-config
+  GTK_CFLAGS  C compiler flags for GTK, overriding pkg-config
+  GTK_LIBS    linker flags for GTK, overriding pkg-config
   GLU_CFLAGS  C compiler flags for GLU, overriding pkg-config
   GLU_LIBS    linker flags for GLU, overriding pkg-config
-  GTKGLEXTMM_CFLAGS
-              C compiler flags for GTKGLEXTMM, overriding pkg-config
-  GTKGLEXTMM_LIBS
-              linker flags for GTKGLEXTMM, overriding pkg-config
+  GTKGLEXT_CFLAGS
+              C compiler flags for GTKGLEXT, overriding pkg-config
+  GTKGLEXT_LIBS
+              linker flags for GTKGLEXT, overriding pkg-config
   GOBJECT_CFLAGS
               C compiler flags for GOBJECT, overriding pkg-config
   GOBJECT_LIBS
@@ -1636,7 +1643,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-hkl configure 4.99.99.1621
+hkl configure 4.99.99.1892
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1650,10 +1657,10 @@ fi
 ## Autoconf initialization. ##
 ## ------------------------ ##
 
-# ac_fn_cxx_try_compile LINENO
-# ----------------------------
+# ac_fn_c_try_compile LINENO
+# --------------------------
 # Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_compile ()
+ac_fn_c_try_compile ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   rm -f conftest.$ac_objext
@@ -1673,7 +1680,7 @@ $as_echo "$ac_try_echo"; } >&5
   fi
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; } && {
-	 test -z "$ac_cxx_werror_flag" ||
+	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then :
   ac_retval=0
@@ -1686,12 +1693,12 @@ fi
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
-} # ac_fn_cxx_try_compile
+} # ac_fn_c_try_compile
 
-# ac_fn_c_try_compile LINENO
-# --------------------------
+# ac_fn_cxx_try_compile LINENO
+# ----------------------------
 # Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
+ac_fn_cxx_try_compile ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   rm -f conftest.$ac_objext
@@ -1711,7 +1718,7 @@ $as_echo "$ac_try_echo"; } >&5
   fi
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; } && {
-	 test -z "$ac_c_werror_flag" ||
+	 test -z "$ac_cxx_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then :
   ac_retval=0
@@ -1724,7 +1731,7 @@ fi
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
-} # ac_fn_c_try_compile
+} # ac_fn_cxx_try_compile
 
 # ac_fn_c_try_cpp LINENO
 # ----------------------
@@ -2310,7 +2317,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by hkl $as_me 4.99.99.1621, which was
+It was created by hkl $as_me 4.99.99.1892, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2692,7 +2699,7 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 
 
-am__api_version='1.13'
+am__api_version='1.14'
 
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
@@ -2864,8 +2871,8 @@ test "$program_suffix" != NONE &&
 ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
 program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
 
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
 
 if test x"${MISSING+set}" != xset; then
   case $am_aux_dir in
@@ -3178,7 +3185,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='hkl'
- VERSION='4.99.99.1621'
+ VERSION='4.99.99.1892'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3345,29 +3352,61 @@ $as_echo "$am_cv_prog_tar_ustar" >&6; }
 
 
 
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
 
-# Checks for programs.
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
-  if test -n "$CCC"; then
-    CXX=$CCC
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake at gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
   else
-    if test -n "$ac_tool_prefix"; then
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+  fi
+fi
+
+
+# Checks for programs.
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CXX+:} false; then :
+if ${ac_cv_prog_AWK+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$CXX"; then
-  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -3376,7 +3415,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    ac_cv_prog_AWK="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -3386,32 +3425,97 @@ IFS=$as_save_IFS
 
 fi
 fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
-$as_echo "$CXX" >&6; }
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-    test -n "$CXX" && break
-  done
+  test -n "$AWK" && break
+done
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
 fi
-if test -z "$CXX"; then
-  ac_ct_CXX=$CXX
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+  enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+  am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CXX+:} false; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_CXX"; then
-  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -3420,7 +3524,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -3430,36 +3534,278 @@ IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
-$as_echo "$ac_ct_CXX" >&6; }
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-  test -n "$ac_ct_CXX" && break
-done
-
-  if test "x$ac_ct_CXX" = x; then
-    CXX="g++"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CXX=$ac_ct_CXX
-  fi
 fi
-
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
   fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
 fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
 # Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
 set X $ac_compile
 ac_compiler=$2
 for ac_option in --version -v -V -qversion; do
@@ -3499,8 +3845,8 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5
-$as_echo_n "checking whether the C++ compiler works... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
 
 # The possible output files:
@@ -3570,14 +3916,14 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C++ compiler cannot create executables
+as_fn_error 77 "C compiler cannot create executables
 See \`config.log' for more details" "$LINENO" 5; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5
-$as_echo_n "checking for C++ compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
 $as_echo "$ac_file" >&6; }
 ac_exeext=$ac_cv_exeext
@@ -3671,7 +4017,7 @@ $as_echo "$ac_try_echo"; } >&5
     else
 	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C++ compiled programs.
+as_fn_error $? "cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
 See \`config.log' for more details" "$LINENO" 5; }
     fi
@@ -3733,9 +4079,9 @@ fi
 $as_echo "$ac_cv_objext" >&6; }
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
-$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if ${ac_cv_cxx_compiler_gnu+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3752,33 +4098,33 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_compiler_gnu=yes
 else
   ac_compiler_gnu=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
-$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
 if test $ac_compiler_gnu = yes; then
-  GXX=yes
+  GCC=yes
 else
-  GXX=
+  GCC=
 fi
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
-$as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if ${ac_cv_prog_cxx_g+:} false; then :
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
-   ac_cxx_werror_flag=yes
-   ac_cv_prog_cxx_g=no
-   CXXFLAGS="-g"
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -3790,10 +4136,10 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_cv_prog_cxx_g=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
 else
-  CXXFLAGS=""
+  CFLAGS=""
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -3805,11 +4151,11 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"; then :
 
 else
-  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-	 CXXFLAGS="-g"
+  ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
 	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -3821,107 +4167,193 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_cv_prog_cxx_g=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+   ac_c_werror_flag=$ac_save_c_werror_flag
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
-$as_echo "$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
-  CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
-  if test "$GXX" = yes; then
-    CXXFLAGS="-g -O2"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
   else
-    CXXFLAGS="-g"
+    CFLAGS="-g"
   fi
 else
-  if test "$GXX" = yes; then
-    CXXFLAGS="-O2"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
   else
-    CXXFLAGS=
+    CFLAGS=
   fi
 fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-DEPDIR="${am__leading_dot}deps"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
 
-ac_config_commands="$ac_config_commands depfiles"
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
 
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
 
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
-	@echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
-     ;;
-   esac
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
 fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
 
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
-  enableval=$enable_dependency_tracking;
 fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
 
-if test "x$enable_dependency_tracking" != xno; then
-  am_depcomp="$ac_aux_dir/depcomp"
-  AMDEPBACKSLASH='\'
-  am__nodep='_no'
 fi
- if test "x$enable_dependency_tracking" != xno; then
-  AMDEP_TRUE=
-  AMDEP_FALSE='#'
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  AMDEP_TRUE='#'
-  AMDEP_FALSE=
-fi
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-depcc="$CXX"  am_compiler_list=
+depcc="$CC"   am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
 $as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
@@ -3944,7 +4376,7 @@ else
   # directory.
   mkdir sub
 
-  am_cv_CXX_dependencies_compiler_type=none
+  am_cv_CC_dependencies_compiler_type=none
   if test "$am_compiler_list" = ""; then
      am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
   fi
@@ -4017,7 +4449,7 @@ else
       #   icc: Command line remark: option '-MP' not supported
       if (grep 'ignoring option' conftest.err ||
           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CXX_dependencies_compiler_type=$depmode
+        am_cv_CC_dependencies_compiler_type=$depmode
         break
       fi
     fi
@@ -4026,36 +4458,223 @@ else
   cd ..
   rm -rf conftest.dir
 else
-  am_cv_CXX_dependencies_compiler_type=none
+  am_cv_CC_dependencies_compiler_type=none
 fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 
  if
   test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
-  am__fastdepCXX_TRUE=
-  am__fastdepCXX_FALSE='#'
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
 else
-  am__fastdepCXX_TRUE='#'
-  am__fastdepCXX_FALSE=
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
 fi
 
 
-for ac_prog in gawk mawk nawk awk
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if ${ac_cv_prog_cc_c99+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+  your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+	{
+	case 's': // string
+	  str = va_arg (args_copy, const char *);
+	  break;
+	case 'd': // int
+	  number = va_arg (args_copy, int);
+	  break;
+	case 'f': // float
+	  fnumber = va_arg (args_copy, double);
+	  break;
+	default:
+	  break;
+	}
+    }
+  va_end (args_copy);
+  va_end (args);
+}
+
+int
+main ()
+{
+
+  // Check bool.
+  _Bool success = false;
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs ("s, d' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+	  || dynamic_array[ni.number - 1] != 543);
+
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99
 do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c99"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+
+fi
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
+if ${ac_cv_prog_CXX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$AWK"; then
-  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -4064,7 +4683,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_AWK="$ac_prog"
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -4074,34 +4693,32 @@ IFS=$as_save_IFS
 
 fi
 fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-  test -n "$AWK" && break
-done
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if ${ac_cv_prog_ac_ct_CXX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -4110,7 +4727,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -4120,57 +4737,21 @@ IFS=$as_save_IFS
 
 fi
 fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="gcc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
+  test -n "$ac_ct_CXX" && break
 done
-  done
-IFS=$as_save_IFS
 
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_CC" = x; then
-    CC=""
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
@@ -4178,220 +4759,14 @@ yes:)
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
-    CC=$ac_ct_CC
-  fi
-else
-  CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
-          if test -n "$ac_tool_prefix"; then
-    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  fi
-fi
-if test -z "$CC"; then
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
-       ac_prog_rejected=yes
-       continue
-     fi
-    ac_cv_prog_CC="cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
-  # We found a bogon in the path, so make sure we never use it.
-  set dummy $ac_cv_prog_CC
-  shift
-  if test $# != 0; then
-    # We chose a different compiler from the bogus one.
-    # However, it has the same basename, so the bogon will be chosen
-    # first if we set CC to just the basename; use the full file name.
-    shift
-    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
-  fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl.exe
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    test -n "$CC" && break
-  done
-fi
-if test -z "$CC"; then
-  ac_ct_CC=$CC
-  for ac_prog in cl.exe
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
+    CXX=$ac_ct_CXX
   fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
 fi
 
-
-  test -n "$ac_ct_CC" && break
-done
-
-  if test "x$ac_ct_CC" = x; then
-    CC=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CC=$ac_ct_CC
   fi
 fi
-
-fi
-
-
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
-
 # Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
 set X $ac_compile
 ac_compiler=$2
 for ac_option in --version -v -V -qversion; do
@@ -4415,9 +4790,9 @@ $as_echo "$ac_try_echo"; } >&5
   test $ac_status = 0; }
 done
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if ${ac_cv_cxx_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4434,33 +4809,33 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"; then :
   ac_compiler_gnu=yes
 else
   ac_compiler_gnu=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
 if test $ac_compiler_gnu = yes; then
-  GCC=yes
+  GXX=yes
 else
-  GCC=
+  GXX=
 fi
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if ${ac_cv_prog_cxx_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  ac_save_c_werror_flag=$ac_c_werror_flag
-   ac_c_werror_flag=yes
-   ac_cv_prog_cc_g=no
-   CFLAGS="-g"
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -4472,10 +4847,10 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_g=yes
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_prog_cxx_g=yes
 else
-  CFLAGS=""
+  CXXFLAGS=""
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -4487,11 +4862,11 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_cxx_try_compile "$LINENO"; then :
 
 else
-  ac_c_werror_flag=$ac_save_c_werror_flag
-	 CFLAGS="-g"
+  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
 	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -4503,134 +4878,44 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_g=yes
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_prog_cxx_g=yes
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_c_werror_flag=$ac_save_c_werror_flag
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
-  CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
-  if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
   else
-    CFLAGS="-g"
+    CXXFLAGS="-g"
   fi
 else
-  if test "$GCC" = yes; then
-    CFLAGS="-O2"
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
   else
-    CFLAGS=
+    CXXFLAGS=
   fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
-   function prototypes and stuff, but not '\xHH' hex character constants.
-   These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std is added to get
-   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
-   array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std.  */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
-   inside strings and character constants.  */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-  ;
-  return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
-  test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
-  x)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
-  xno)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
-  *)
-    CC="$CC $ac_cv_prog_cc_c89"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-fi
-
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-depcc="$CC"   am_compiler_list=
+depcc="$CXX"  am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
 $as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
@@ -4653,7 +4938,7 @@ else
   # directory.
   mkdir sub
 
-  am_cv_CC_dependencies_compiler_type=none
+  am_cv_CXX_dependencies_compiler_type=none
   if test "$am_compiler_list" = ""; then
      am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
   fi
@@ -4726,7 +5011,7 @@ else
       #   icc: Command line remark: option '-MP' not supported
       if (grep 'ignoring option' conftest.err ||
           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CC_dependencies_compiler_type=$depmode
+        am_cv_CXX_dependencies_compiler_type=$depmode
         break
       fi
     fi
@@ -4735,239 +5020,62 @@ else
   cd ..
   rm -rf conftest.dir
 else
-  am_cv_CC_dependencies_compiler_type=none
+  am_cv_CXX_dependencies_compiler_type=none
 fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
 
  if
   test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
-  am__fastdepCC_TRUE=
-  am__fastdepCC_FALSE='#'
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
 else
-  am__fastdepCC_TRUE='#'
-  am__fastdepCC_FALSE=
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
 fi
 
 
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
-$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
-if ${ac_cv_prog_cc_c99+:} false; then :
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if ${ac_cv_prog_CPP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  ac_cv_prog_cc_c99=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stdarg.h>
-#include <stdbool.h>
-#include <stdlib.h>
-#include <wchar.h>
-#include <stdio.h>
-
-// Check varargs macros.  These examples are taken from C99 6.10.3.5.
-#define debug(...) fprintf (stderr, __VA_ARGS__)
-#define showlist(...) puts (#__VA_ARGS__)
-#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
-static void
-test_varargs_macros (void)
-{
-  int x = 1234;
-  int y = 5678;
-  debug ("Flag");
-  debug ("X = %d\n", x);
-  showlist (The first, second, and third items.);
-  report (x>y, "x is %d but y is %d", x, y);
-}
-
-// Check long long types.
-#define BIG64 18446744073709551615ull
-#define BIG32 4294967295ul
-#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
-#if !BIG_OK
-  your preprocessor is broken;
-#endif
-#if BIG_OK
+#ifdef __STDC__
+# include <limits.h>
 #else
-  your preprocessor is broken;
+# include <assert.h>
 #endif
-static long long int bignum = -9223372036854775807LL;
-static unsigned long long int ubignum = BIG64;
-
-struct incomplete_array
-{
-  int datasize;
-  double data[];
-};
-
-struct named_init {
-  int number;
-  const wchar_t *name;
-  double average;
-};
-
-typedef const char *ccp;
-
-static inline int
-test_restrict (ccp restrict text)
-{
-  // See if C++-style comments work.
-  // Iterate through items via the restricted pointer.
-  // Also check for declarations in for loops.
-  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
-    continue;
-  return 0;
-}
-
-// Check varargs and va_copy.
-static void
-test_varargs (const char *format, ...)
-{
-  va_list args;
-  va_start (args, format);
-  va_list args_copy;
-  va_copy (args_copy, args);
-
-  const char *str;
-  int number;
-  float fnumber;
-
-  while (*format)
-    {
-      switch (*format++)
-	{
-	case 's': // string
-	  str = va_arg (args_copy, const char *);
-	  break;
-	case 'd': // int
-	  number = va_arg (args_copy, int);
-	  break;
-	case 'f': // float
-	  fnumber = va_arg (args_copy, double);
-	  break;
-	default:
-	  break;
-	}
-    }
-  va_end (args_copy);
-  va_end (args);
-}
-
-int
-main ()
-{
-
-  // Check bool.
-  _Bool success = false;
-
-  // Check restrict.
-  if (test_restrict ("String literal") == 0)
-    success = true;
-  char *restrict newvar = "Another string";
-
-  // Check varargs.
-  test_varargs ("s, d' f .", "string", 65, 34.234);
-  test_varargs_macros ();
-
-  // Check flexible array members.
-  struct incomplete_array *ia =
-    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
-  ia->datasize = 10;
-  for (int i = 0; i < ia->datasize; ++i)
-    ia->data[i] = i * 1.234;
-
-  // Check named initializers.
-  struct named_init ni = {
-    .number = 34,
-    .name = L"Test wide string",
-    .average = 543.34343,
-  };
-
-  ni.number = 58;
-
-  int dynamic_array[ni.number];
-  dynamic_array[ni.number - 1] = 543;
-
-  // work around unused variable warnings
-  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
-	  || dynamic_array[ni.number - 1] != 543);
-
-  ;
-  return 0;
-}
-_ACEOF
-for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99
-do
-  CC="$ac_save_CC $ac_arg"
-  if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_c99=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
-  test "x$ac_cv_prog_cc_c99" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c99" in
-  x)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
-  xno)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
-  *)
-    CC="$CC $ac_cv_prog_cc_c99"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
-$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c99" != xno; then :
-
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
-  CPP=
-fi
-if test -z "$CPP"; then
-  if ${ac_cv_prog_CPP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-      # Double quotes because CPP needs to be expanded
-    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
+		     Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
 
 else
   # Broken: fails on valid input.
@@ -7507,7 +7615,7 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
@@ -7532,7 +7640,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 		;;
 	    esac
 	    ;;
-	  ppc64-*linux*|powerpc64-*linux*)
+	  powerpc64le-*)
+	    LD="${LD-ld} -m elf32lppclinux"
+	    ;;
+	  powerpc64-*)
 	    LD="${LD-ld} -m elf32ppclinux"
 	    ;;
 	  s390x-*linux*)
@@ -7551,7 +7662,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 	  x86_64-*linux*)
 	    LD="${LD-ld} -m elf_x86_64"
 	    ;;
-	  ppc*-*linux*|powerpc*-*linux*)
+	  powerpcle-*)
+	    LD="${LD-ld} -m elf64lppc"
+	    ;;
+	  powerpc-*)
 	    LD="${LD-ld} -m elf64ppc"
 	    ;;
 	  s390*-*linux*|s390*-*tpf*)
@@ -15814,64 +15928,357 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
-cat >>confdefs.h <<_ACEOF
-#define VREV 1621
-_ACEOF
+cat >>confdefs.h <<_ACEOF
+#define VREV 1892
+_ACEOF
+
+version_info="103:99:99"
+release_info=""
+
+
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+VMAJ=4
+
+
+# Checks for libraries.
+
+
+# Check whether --with-gsl-prefix was given.
+if test "${with_gsl_prefix+set}" = set; then :
+  withval=$with_gsl_prefix; gsl_prefix="$withval"
+else
+  gsl_prefix=""
+fi
+
+
+# Check whether --with-gsl-exec-prefix was given.
+if test "${with_gsl_exec_prefix+set}" = set; then :
+  withval=$with_gsl_exec_prefix; gsl_exec_prefix="$withval"
+else
+  gsl_exec_prefix=""
+fi
+
+# Check whether --enable-gsltest was given.
+if test "${enable_gsltest+set}" = set; then :
+  enableval=$enable_gsltest;
+else
+  enable_gsltest=yes
+fi
+
+
+  if test "x${GSL_CONFIG+set}" != xset ; then
+     if test "x$gsl_prefix" != x ; then
+         GSL_CONFIG="$gsl_prefix/bin/gsl-config"
+     fi
+     if test "x$gsl_exec_prefix" != x ; then
+        GSL_CONFIG="$gsl_exec_prefix/bin/gsl-config"
+     fi
+  fi
+
+  # Extract the first word of "gsl-config", so it can be a program name with args.
+set dummy gsl-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GSL_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $GSL_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GSL_CONFIG="$GSL_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GSL_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_GSL_CONFIG" && ac_cv_path_GSL_CONFIG="no"
+  ;;
+esac
+fi
+GSL_CONFIG=$ac_cv_path_GSL_CONFIG
+if test -n "$GSL_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GSL_CONFIG" >&5
+$as_echo "$GSL_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  min_gsl_version=0.2.5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GSL - version >= $min_gsl_version" >&5
+$as_echo_n "checking for GSL - version >= $min_gsl_version... " >&6; }
+  no_gsl=""
+  if test "$GSL_CONFIG" = "no" ; then
+    no_gsl=yes
+  else
+    GSL_CFLAGS=`$GSL_CONFIG --cflags`
+    GSL_LIBS=`$GSL_CONFIG --libs`
+
+    gsl_major_version=`$GSL_CONFIG --version | \
+           sed 's/^\([0-9]*\).*/\1/'`
+    if test "x${gsl_major_version}" = "x" ; then
+       gsl_major_version=0
+    fi
+
+    gsl_minor_version=`$GSL_CONFIG --version | \
+           sed 's/^\([0-9]*\)\.\{0,1\}\([0-9]*\).*/\2/'`
+    if test "x${gsl_minor_version}" = "x" ; then
+       gsl_minor_version=0
+    fi
+
+    gsl_micro_version=`$GSL_CONFIG --version | \
+           sed 's/^\([0-9]*\)\.\{0,1\}\([0-9]*\)\.\{0,1\}\([0-9]*\).*/\3/'`
+    if test "x${gsl_micro_version}" = "x" ; then
+       gsl_micro_version=0
+    fi
+
+    if test "x$enable_gsltest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GSL_CFLAGS"
+      LIBS="$LIBS $GSL_LIBS"
+
+      rm -f conf.gsltest
+      if test "$cross_compiling" = yes; then :
+  echo $ac_n "cross compiling; assumed OK... $ac_c"
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+char* my_strdup (const char *str);
+
+char*
+my_strdup (const char *str)
+{
+  char *new_str;
+
+  if (str)
+    {
+      new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
+      strcpy (new_str, str);
+    }
+  else
+    new_str = NULL;
+
+  return new_str;
+}
+
+int main (void)
+{
+  int major = 0, minor = 0, micro = 0;
+  int n;
+  char *tmp_version;
+
+  system ("touch conf.gsltest");
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = my_strdup("$min_gsl_version");
+
+  n = sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) ;
+
+  if (n != 2 && n != 3) {
+     printf("%s, bad version string\n", "$min_gsl_version");
+     exit(1);
+   }
+
+   if (($gsl_major_version > major) ||
+      (($gsl_major_version == major) && ($gsl_minor_version > minor)) ||
+      (($gsl_major_version == major) && ($gsl_minor_version == minor) && ($gsl_micro_version >= micro)))
+     {
+       exit(0);
+     }
+   else
+     {
+       exit(1);
+     }
+}
+
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  no_gsl=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_gsl" = x ; then
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+     :
+  else
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+     if test "$GSL_CONFIG" = "no" ; then
+       echo "*** The gsl-config script installed by GSL could not be found"
+       echo "*** If GSL was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the GSL_CONFIG environment variable to the"
+       echo "*** full path to gsl-config."
+     else
+       if test -f conf.gsltest ; then
+        :
+       else
+          echo "*** Could not run GSL test program, checking why..."
+          CFLAGS="$CFLAGS $GSL_CFLAGS"
+          LIBS="$LIBS $GSL_LIBS"
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdio.h>
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+   echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding GSL or finding the wrong"
+          echo "*** version of GSL. If it is not finding GSL, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+	  echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
+else
+   echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means GSL was incorrectly installed"
+          echo "*** or that you have moved GSL since it was installed. In the latter case, you"
+          echo "*** may want to edit the gsl-config script: $GSL_CONFIG"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+#     GSL_CFLAGS=""
+#     GSL_LIBS=""
+     :
+  fi
+
+
+  rm -f conf.gsltest
+
+# Check whether --enable-glibtest was given.
+if test "${enable_glibtest+set}" = set; then :
+  enableval=$enable_glibtest;
+else
+  enable_glibtest=yes
+fi
+
 
-version_info="103:99:99"
-release_info=""
+  pkg_config_args=glib-2.0
+  for module in .
+  do
+      case "$module" in
+         gmodule)
+             pkg_config_args="$pkg_config_args gmodule-2.0"
+         ;;
+         gmodule-no-export)
+             pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
+         ;;
+         gobject)
+             pkg_config_args="$pkg_config_args gobject-2.0"
+         ;;
+         gthread)
+             pkg_config_args="$pkg_config_args gthread-2.0"
+         ;;
+         gio*)
+             pkg_config_args="$pkg_config_args $module-2.0"
+         ;;
+      esac
+  done
 
 
-##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
-##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
-VMAJ=4
 
 
-# Checks for libraries.
 
 
-# Check whether --with-gsl-prefix was given.
-if test "${with_gsl_prefix+set}" = set; then :
-  withval=$with_gsl_prefix; gsl_prefix="$withval"
-else
-  gsl_prefix=""
-fi
 
 
-# Check whether --with-gsl-exec-prefix was given.
-if test "${with_gsl_exec_prefix+set}" = set; then :
-  withval=$with_gsl_exec_prefix; gsl_exec_prefix="$withval"
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  gsl_exec_prefix=""
-fi
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-# Check whether --enable-gsltest was given.
-if test "${enable_gsltest+set}" = set; then :
-  enableval=$enable_gsltest;
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
 else
-  enable_gsltest=yes
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
-  if test "x${GSL_CONFIG+set}" != xset ; then
-     if test "x$gsl_prefix" != x ; then
-         GSL_CONFIG="$gsl_prefix/bin/gsl-config"
-     fi
-     if test "x$gsl_exec_prefix" != x ; then
-        GSL_CONFIG="$gsl_exec_prefix/bin/gsl-config"
-     fi
-  fi
-
-  # Extract the first word of "gsl-config", so it can be a program name with args.
-set dummy gsl-config; ac_word=$2
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_GSL_CONFIG+:} false; then :
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  case $GSL_CONFIG in
+  case $ac_pt_PKG_CONFIG in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_GSL_CONFIG="$GSL_CONFIG" # Let the user override the test with a path.
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -15881,7 +16288,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_GSL_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -15889,119 +16296,172 @@ done
   done
 IFS=$as_save_IFS
 
-  test -z "$ac_cv_path_GSL_CONFIG" && ac_cv_path_GSL_CONFIG="no"
   ;;
 esac
 fi
-GSL_CONFIG=$ac_cv_path_GSL_CONFIG
-if test -n "$GSL_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GSL_CONFIG" >&5
-$as_echo "$GSL_CONFIG" >&6; }
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
-
-  min_gsl_version=0.2.5
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GSL - version >= $min_gsl_version" >&5
-$as_echo_n "checking for GSL - version >= $min_gsl_version... " >&6; }
-  no_gsl=""
-  if test "$GSL_CONFIG" = "no" ; then
-    no_gsl=yes
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
   else
-    GSL_CFLAGS=`$GSL_CONFIG --cflags`
-    GSL_LIBS=`$GSL_CONFIG --libs`
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
 
-    gsl_major_version=`$GSL_CONFIG --version | \
-           sed 's/^\([0-9]*\).*/\1/'`
-    if test "x${gsl_major_version}" = "x" ; then
-       gsl_major_version=0
-    fi
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=0.16
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+	else
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+		PKG_CONFIG=""
+	fi
+fi
 
-    gsl_minor_version=`$GSL_CONFIG --version | \
-           sed 's/^\([0-9]*\)\.\{0,1\}\([0-9]*\).*/\2/'`
-    if test "x${gsl_minor_version}" = "x" ; then
-       gsl_minor_version=0
+  no_glib=""
+
+  if test "x$PKG_CONFIG" = x ; then
+    no_glib=yes
+    PKG_CONFIG=no
+  fi
+
+  min_glib_version=2.0.0
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB - version >= $min_glib_version" >&5
+$as_echo_n "checking for GLIB - version >= $min_glib_version... " >&6; }
+
+  if test x$PKG_CONFIG != xno ; then
+    ## don't try to run the test against uninstalled libtool libs
+    if $PKG_CONFIG --uninstalled $pkg_config_args; then
+	  echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
+	  enable_glibtest=no
     fi
 
-    gsl_micro_version=`$GSL_CONFIG --version | \
-           sed 's/^\([0-9]*\)\.\{0,1\}\([0-9]*\)\.\{0,1\}\([0-9]*\).*/\3/'`
-    if test "x${gsl_micro_version}" = "x" ; then
-       gsl_micro_version=0
+    if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
+	  :
+    else
+	  no_glib=yes
     fi
+  fi
 
-    if test "x$enable_gsltest" = "xyes" ; then
+  if test x"$no_glib" = x ; then
+    GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
+    GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
+    GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
+    GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable=glib_compile_resources gio-2.0`
+
+    GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
+    GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
+    glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
+    glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
+    glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
+    if test "x$enable_glibtest" = "xyes" ; then
       ac_save_CFLAGS="$CFLAGS"
       ac_save_LIBS="$LIBS"
-      CFLAGS="$CFLAGS $GSL_CFLAGS"
-      LIBS="$LIBS $GSL_LIBS"
-
-      rm -f conf.gsltest
+      CFLAGS="$CFLAGS $GLIB_CFLAGS"
+      LIBS="$GLIB_LIBS $LIBS"
+      rm -f conf.glibtest
       if test "$cross_compiling" = yes; then :
   echo $ac_n "cross compiling; assumed OK... $ac_c"
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+#include <glib.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
-
-char* my_strdup (const char *str);
 
-char*
-my_strdup (const char *str)
+int
+main ()
 {
-  char *new_str;
+  unsigned int major, minor, micro;
 
-  if (str)
+  fclose (fopen ("conf.glibtest", "w"));
+
+  if (sscanf("$min_glib_version", "%u.%u.%u", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_glib_version");
+     exit(1);
+   }
+
+  if ((glib_major_version != $glib_config_major_version) ||
+      (glib_minor_version != $glib_config_minor_version) ||
+      (glib_micro_version != $glib_config_micro_version))
     {
-      new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
-      strcpy (new_str, str);
+      printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
+             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
+             glib_major_version, glib_minor_version, glib_micro_version);
+      printf ("*** was found! If pkg-config was correct, then it is best\n");
+      printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
+      printf("*** to point to the correct configuration files\n");
+    }
+  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
+	   (glib_minor_version != GLIB_MINOR_VERSION) ||
+           (glib_micro_version != GLIB_MICRO_VERSION))
+    {
+      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
+	     GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
+      printf("*** library (version %d.%d.%d)\n",
+	     glib_major_version, glib_minor_version, glib_micro_version);
+    }
+  else
+    {
+      if ((glib_major_version > major) ||
+        ((glib_major_version == major) && (glib_minor_version > minor)) ||
+        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
+      {
+        return 0;
+       }
+     else
+      {
+        printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n",
+               glib_major_version, glib_minor_version, glib_micro_version);
+        printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n",
+	       major, minor, micro);
+        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
+        printf("***\n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
+        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
     }
-  else
-    new_str = NULL;
-
-  return new_str;
-}
-
-int main (void)
-{
-  int major = 0, minor = 0, micro = 0;
-  int n;
-  char *tmp_version;
-
-  system ("touch conf.gsltest");
-
-  /* HP/UX 9 (%@#!) writes to sscanf strings */
-  tmp_version = my_strdup("$min_gsl_version");
-
-  n = sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) ;
-
-  if (n != 2 && n != 3) {
-     printf("%s, bad version string\n", "$min_gsl_version");
-     exit(1);
-   }
-
-   if (($gsl_major_version > major) ||
-      (($gsl_major_version == major) && ($gsl_minor_version > minor)) ||
-      (($gsl_major_version == major) && ($gsl_minor_version == minor) && ($gsl_micro_version >= micro)))
-     {
-       exit(0);
-     }
-   else
-     {
-       exit(1);
-     }
+  return 1;
 }
 
-
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
 
 else
-  no_gsl=yes
+  no_glib=yes
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
@@ -16011,42 +16471,43 @@ fi
        LIBS="$ac_save_LIBS"
      fi
   fi
-  if test "x$no_gsl" = x ; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+  if test "x$no_glib" = x ; then
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5
+$as_echo "yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6; }
      :
   else
      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-     if test "$GSL_CONFIG" = "no" ; then
-       echo "*** The gsl-config script installed by GSL could not be found"
-       echo "*** If GSL was installed in PREFIX, make sure PREFIX/bin is in"
-       echo "*** your path, or set the GSL_CONFIG environment variable to the"
-       echo "*** full path to gsl-config."
+     if test "$PKG_CONFIG" = "no" ; then
+       echo "*** A new enough version of pkg-config was not found."
+       echo "*** See http://www.freedesktop.org/software/pkgconfig/"
      else
-       if test -f conf.gsltest ; then
+       if test -f conf.glibtest ; then
         :
        else
-          echo "*** Could not run GSL test program, checking why..."
-          CFLAGS="$CFLAGS $GSL_CFLAGS"
-          LIBS="$LIBS $GSL_LIBS"
+          echo "*** Could not run GLIB test program, checking why..."
+          ac_save_CFLAGS="$CFLAGS"
+          ac_save_LIBS="$LIBS"
+          CFLAGS="$CFLAGS $GLIB_CFLAGS"
+          LIBS="$LIBS $GLIB_LIBS"
           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+#include <glib.h>
 #include <stdio.h>
 
 int
 main ()
 {
- return 0;
+ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version));
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
    echo "*** The test program compiled, but did not run. This usually means"
-          echo "*** that the run-time linker is not finding GSL or finding the wrong"
-          echo "*** version of GSL. If it is not finding GSL, you'll need to set your"
+          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
+          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
           echo "*** is required on your system"
@@ -16055,9 +16516,7 @@ if ac_fn_c_try_link "$LINENO"; then :
           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
 else
    echo "*** The test program failed to compile or link. See the file config.log for the"
-          echo "*** exact error that occured. This usually means GSL was incorrectly installed"
-          echo "*** or that you have moved GSL since it was installed. In the latter case, you"
-          echo "*** may want to edit the gsl-config script: $GSL_CONFIG"
+          echo "*** exact error that occured. This usually means GLIB is incorrectly installed."
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
@@ -16065,109 +16524,24 @@ rm -f core conftest.err conftest.$ac_objext \
           LIBS="$ac_save_LIBS"
        fi
      fi
-#     GSL_CFLAGS=""
-#     GSL_LIBS=""
+     GLIB_CFLAGS=""
+     GLIB_LIBS=""
+     GLIB_GENMARSHAL=""
+     GOBJECT_QUERY=""
+     GLIB_MKENUMS=""
+     GLIB_COMPILE_RESOURCES=""
      :
   fi
 
 
-  rm -f conf.gsltest
-
-
-# Checks for header files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
-$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
-if ${ac_cv_header_stdbool_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-             #include <stdbool.h>
-             #ifndef bool
-              "error: bool is not defined"
-             #endif
-             #ifndef false
-              "error: false is not defined"
-             #endif
-             #if false
-              "error: false is not 0"
-             #endif
-             #ifndef true
-              "error: true is not defined"
-             #endif
-             #if true != 1
-              "error: true is not 1"
-             #endif
-             #ifndef __bool_true_false_are_defined
-              "error: __bool_true_false_are_defined is not defined"
-             #endif
-
-             struct s { _Bool s: 1; _Bool t; } s;
-
-             char a[true == 1 ? 1 : -1];
-             char b[false == 0 ? 1 : -1];
-             char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-             char d[(bool) 0.5 == true ? 1 : -1];
-             /* See body of main program for 'e'.  */
-             char f[(_Bool) 0.0 == false ? 1 : -1];
-             char g[true];
-             char h[sizeof (_Bool)];
-             char i[sizeof s.t];
-             enum { j = false, k = true, l = false * true, m = true * 256 };
-             /* The following fails for
-                HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
-             _Bool n[m];
-             char o[sizeof n == m * sizeof n[0] ? 1 : -1];
-             char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
-             /* Catch a bug in an HP-UX C compiler.  See
-                http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
-                http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
-              */
-             _Bool q = true;
-             _Bool *pq = &q;
-
-int
-main ()
-{
-
-             bool e = &s;
-             *pq |= q;
-             *pq |= ! q;
-             /* Refer to every declared value, to avoid compiler optimizations.  */
-             return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
-                     + !m + !n + !o + !p + !q + !pq);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stdbool_h=yes
-else
-  ac_cv_header_stdbool_h=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
-$as_echo "$ac_cv_header_stdbool_h" >&6; }
-   ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
-if test "x$ac_cv_type__Bool" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE__BOOL 1
-_ACEOF
-
 
-fi
 
 
-if test $ac_cv_header_stdbool_h = yes; then
 
-$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
+  rm -f conf.glibtest
 
-fi
 
+# Checks for header files.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
 if ${ac_cv_header_stdc+:} false; then :
@@ -16956,189 +17330,64 @@ ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
 if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-
-
-
-
-
-
-
-
-
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
-	if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_path_PKG_CONFIG"; then
-  ac_pt_PKG_CONFIG=$PKG_CONFIG
-  # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $ac_pt_PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-if test -n "$ac_pt_PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
-$as_echo "$ac_pt_PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_pt_PKG_CONFIG" = x; then
-    PKG_CONFIG=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    PKG_CONFIG=$ac_pt_PKG_CONFIG
-  fi
-else
-  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
-fi
-
-fi
-if test -n "$PKG_CONFIG"; then
-	_pkg_min_version=0.9.0
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
-$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
-	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-	else
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-		PKG_CONFIG=""
-	fi
+_ACEOF
+
 fi
+done
 
 
 
-    # Extract the first word of "gtkdoc-check", so it can be a program name with args.
-set dummy gtkdoc-check; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_GTKDOC_CHECK+:} false; then :
-  $as_echo_n "(cached) " >&6
+
+
+  # Check whether --enable-logging was given.
+if test "${enable_logging+set}" = set; then :
+  enableval=$enable_logging;
 else
-  case $GTKDOC_CHECK in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_GTKDOC_CHECK="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+      enable_logging=no
+fi
 
-  ;;
-esac
+ if test x$enable_logging != xno; then
+  LOGGING_TRUE=
+  LOGGING_FALSE='#'
+else
+  LOGGING_TRUE='#'
+  LOGGING_FALSE=
 fi
-GTKDOC_CHECK=$ac_cv_path_GTKDOC_CHECK
-if test -n "$GTKDOC_CHECK"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5
-$as_echo "$GTKDOC_CHECK" >&6; }
+
+if test -z "$LOGGING_TRUE"; then :
+
+$as_echo "#define LOGGING 1" >>confdefs.h
+
+
+fi
+
+
+  # Check whether --enable-hkl-doc was given.
+if test "${enable_hkl_doc+set}" = set; then :
+  enableval=$enable_hkl_doc;
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+      enable_hkl_doc=yes
 fi
 
+ if test x$enable_hkl_doc = xyes; then
+  HKL_DOC_TRUE=
+  HKL_DOC_FALSE='#'
+else
+  HKL_DOC_TRUE='#'
+  HKL_DOC_FALSE=
+fi
 
-  for ac_prog in gtkdoc-rebase
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
+if test -z "$HKL_DOC_TRUE"; then :
+  	    # Extract the first word of "asy", so it can be a program name with args.
+set dummy asy; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_GTKDOC_REBASE+:} false; then :
+if ${ac_cv_path_ASY+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  case $GTKDOC_REBASE in
+  case $ASY in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_GTKDOC_REBASE="$GTKDOC_REBASE" # Let the user override the test with a path.
+  ac_cv_path_ASY="$ASY" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -17148,7 +17397,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_GTKDOC_REBASE="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_path_ASY="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -17156,33 +17405,30 @@ done
   done
 IFS=$as_save_IFS
 
+  test -z "$ac_cv_path_ASY" && ac_cv_path_ASY="echo"
   ;;
 esac
 fi
-GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE
-if test -n "$GTKDOC_REBASE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5
-$as_echo "$GTKDOC_REBASE" >&6; }
+ASY=$ac_cv_path_ASY
+if test -n "$ASY"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ASY" >&5
+$as_echo "$ASY" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-  test -n "$GTKDOC_REBASE" && break
-done
-test -n "$GTKDOC_REBASE" || GTKDOC_REBASE="true"
-
-  # Extract the first word of "gtkdoc-mkpdf", so it can be a program name with args.
-set dummy gtkdoc-mkpdf; ac_word=$2
+	    	    # Extract the first word of "emacs", so it can be a program name with args.
+set dummy emacs; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_GTKDOC_MKPDF+:} false; then :
+if ${ac_cv_path_EMACS+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  case $GTKDOC_MKPDF in
+  case $EMACS in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_GTKDOC_MKPDF="$GTKDOC_MKPDF" # Let the user override the test with a path.
+  ac_cv_path_EMACS="$EMACS" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -17192,7 +17438,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_GTKDOC_MKPDF="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_path_EMACS="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -17200,13 +17446,14 @@ done
   done
 IFS=$as_save_IFS
 
+  test -z "$ac_cv_path_EMACS" && ac_cv_path_EMACS="no"
   ;;
 esac
 fi
-GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF
-if test -n "$GTKDOC_MKPDF"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5
-$as_echo "$GTKDOC_MKPDF" >&6; }
+EMACS=$ac_cv_path_EMACS
+if test -n "$EMACS"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EMACS" >&5
+$as_echo "$EMACS" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
@@ -17214,209 +17461,83 @@ fi
 
 
 
-
-# Check whether --with-html-dir was given.
-if test "${with_html_dir+set}" = set; then :
-  withval=$with_html_dir;
-else
-  with_html_dir='${datadir}/gtk-doc/html'
-fi
-
-  HTML_DIR="$with_html_dir"
-
-
-    # Check whether --enable-gtk-doc was given.
-if test "${enable_gtk_doc+set}" = set; then :
-  enableval=$enable_gtk_doc;
-else
-  enable_gtk_doc=no
 fi
 
 
-  if test x$enable_gtk_doc = xyes; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-doc >= 1.9\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "gtk-doc >= 1.9") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  :
-else
-  as_fn_error $? "You need to have gtk-doc >= 1.9 installed to build $PACKAGE_NAME" "$LINENO" 5
-fi
-        if test "x$PACKAGE_NAME" != "xglib"; then
 
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKDOC_DEPS" >&5
-$as_echo_n "checking for GTKDOC_DEPS... " >&6; }
 
-if test -n "$GTKDOC_DEPS_CFLAGS"; then
-    pkg_cv_GTKDOC_DEPS_CFLAGS="$GTKDOC_DEPS_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_GTKDOC_DEPS_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
-if test -n "$GTKDOC_DEPS_LIBS"; then
-    pkg_cv_GTKDOC_DEPS_LIBS="$GTKDOC_DEPS_LIBS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0") 2>&5
+  gtk_doc_requires="gtk-doc >= 1.9"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gtk-doc" >&5
+$as_echo_n "checking for gtk-doc... " >&6; }
+  if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$gtk_doc_requires\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "$gtk_doc_requires") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_GTKDOC_DEPS_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
-
-
-
-if test $pkg_failed = yes; then
-   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-        _pkg_short_errors_supported=yes
+  have_gtk_doc=yes
 else
-        _pkg_short_errors_supported=no
+  have_gtk_doc=no
 fi
-        if test $_pkg_short_errors_supported = yes; then
-	        GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0" 2>&1`
-        else
-	        GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0" 2>&1`
-        fi
-	# Put the nasty error message in config.log where it belongs
-	echo "$GTKDOC_DEPS_PKG_ERRORS" >&5
-
-	as_fn_error $? "Package requirements (glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0) were not met:
-
-$GTKDOC_DEPS_PKG_ERRORS
-
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
-
-Alternatively, you may set the environment variables GTKDOC_DEPS_CFLAGS
-and GTKDOC_DEPS_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details." "$LINENO" 5
-elif test $pkg_failed = untried; then
-     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
-
-Alternatively, you may set the environment variables GTKDOC_DEPS_CFLAGS
-and GTKDOC_DEPS_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
-
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5; }
-else
-	GTKDOC_DEPS_CFLAGS=$pkg_cv_GTKDOC_DEPS_CFLAGS
-	GTKDOC_DEPS_LIBS=$pkg_cv_GTKDOC_DEPS_LIBS
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gtk_doc" >&5
+$as_echo "$have_gtk_doc" >&6; }
 
-fi
-    fi
+  if test "$have_gtk_doc" = "no"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
+  You will not be able to create source packages with 'make dist'
+  because $gtk_doc_requires is not found." >&5
+$as_echo "$as_me: WARNING:
+  You will not be able to create source packages with 'make dist'
+  because $gtk_doc_requires is not found." >&2;}
   fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5
-$as_echo_n "checking whether to build gtk-doc documentation... " >&6; }
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5
-$as_echo "$enable_gtk_doc" >&6; }
-
-    # Check whether --enable-gtk-doc-html was given.
-if test "${enable_gtk_doc_html+set}" = set; then :
-  enableval=$enable_gtk_doc_html;
+            # Extract the first word of "gtkdoc-check", so it can be a program name with args.
+set dummy gtkdoc-check; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_GTKDOC_CHECK+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  enable_gtk_doc_html=yes
-fi
-
-    # Check whether --enable-gtk-doc-pdf was given.
-if test "${enable_gtk_doc_pdf+set}" = set; then :
-  enableval=$enable_gtk_doc_pdf;
+  if test -n "$GTKDOC_CHECK"; then
+  ac_cv_prog_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test.
 else
-  enable_gtk_doc_pdf=no
-fi
-
-
-  if test -z "$GTKDOC_MKPDF"; then
-    enable_gtk_doc_pdf=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_GTKDOC_CHECK="gtkdoc-check.test"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
   fi
+done
+  done
+IFS=$as_save_IFS
 
-
-   if test x$enable_gtk_doc = xyes; then
-  ENABLE_GTK_DOC_TRUE=
-  ENABLE_GTK_DOC_FALSE='#'
-else
-  ENABLE_GTK_DOC_TRUE='#'
-  ENABLE_GTK_DOC_FALSE=
-fi
-
-   if test x$enable_gtk_doc_html = xyes; then
-  GTK_DOC_BUILD_HTML_TRUE=
-  GTK_DOC_BUILD_HTML_FALSE='#'
-else
-  GTK_DOC_BUILD_HTML_TRUE='#'
-  GTK_DOC_BUILD_HTML_FALSE=
-fi
-
-   if test x$enable_gtk_doc_pdf = xyes; then
-  GTK_DOC_BUILD_PDF_TRUE=
-  GTK_DOC_BUILD_PDF_FALSE='#'
-else
-  GTK_DOC_BUILD_PDF_TRUE='#'
-  GTK_DOC_BUILD_PDF_FALSE=
 fi
-
-   if test -n "$LIBTOOL"; then
-  GTK_DOC_USE_LIBTOOL_TRUE=
-  GTK_DOC_USE_LIBTOOL_FALSE='#'
-else
-  GTK_DOC_USE_LIBTOOL_TRUE='#'
-  GTK_DOC_USE_LIBTOOL_FALSE=
 fi
-
-   if test -n "$GTKDOC_REBASE"; then
-  GTK_DOC_USE_REBASE_TRUE=
-  GTK_DOC_USE_REBASE_FALSE='#'
+GTKDOC_CHECK=$ac_cv_prog_GTKDOC_CHECK
+if test -n "$GTKDOC_CHECK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5
+$as_echo "$GTKDOC_CHECK" >&6; }
 else
-  GTK_DOC_USE_REBASE_TRUE='#'
-  GTK_DOC_USE_REBASE_FALSE=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
-
-
-# Extract the first word of "asy", so it can be a program name with args.
-set dummy asy; ac_word=$2
+  # Extract the first word of "gtkdoc-check", so it can be a program name with args.
+set dummy gtkdoc-check; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ASY+:} false; then :
+if ${ac_cv_path_GTKDOC_CHECK_PATH+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  case $ASY in
+  case $GTKDOC_CHECK_PATH in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_ASY="$ASY" # Let the user override the test with a path.
+  ac_cv_path_GTKDOC_CHECK_PATH="$GTKDOC_CHECK_PATH" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -17426,7 +17547,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_ASY="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_path_GTKDOC_CHECK_PATH="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -17434,416 +17555,153 @@ done
   done
 IFS=$as_save_IFS
 
-  test -z "$ac_cv_path_ASY" && ac_cv_path_ASY="echo"
   ;;
 esac
 fi
-ASY=$ac_cv_path_ASY
-if test -n "$ASY"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ASY" >&5
-$as_echo "$ASY" >&6; }
+GTKDOC_CHECK_PATH=$ac_cv_path_GTKDOC_CHECK_PATH
+if test -n "$GTKDOC_CHECK_PATH"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK_PATH" >&5
+$as_echo "$GTKDOC_CHECK_PATH" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-
-
-
-case "$host" in
-        *-*-mingw*|*-*-cygwin*)
-
-$as_echo "#define PLATFORM_WIN32 1" >>confdefs.h
-
-                opengl_LIBS="-lunsupported_platform"
-                PLATFORM_STRING="Win32"
-                ;;
-        *-*-linux*)
-
-$as_echo "#define PLATFORM_LINUX 1" >>confdefs.h
-
-                opengl_LIBS="-lGL -lGLU"
-                PLATFORM_STRING="Linux"
-                ;;
-        *-*-darwin*)
-
-$as_echo "#define PLATFORM_APPLE 1" >>confdefs.h
-
-                opengl_LIBS="-framework AGL -framework OpenGL -framework GLUT"
-                PLATFORM_STRING="Apple"
-                ;;
-        *)
-                { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Please add $host to configure.ac checks!" >&5
-$as_echo "$as_me: WARNING: *** Please add $host to configure.ac checks!" >&2;}
-                ;;
-esac
-
-
-case "$host" in
-        i?86-* | k?-* | athlon-* | pentium*-)
-
-$as_echo "#define ARCH_X86 1" >>confdefs.h
-
-                ARCH_SPECIFIC_CFLAGS=""
-                ARCH_STRING="X86"
-                ;;
-        x86_64-*)
-
-$as_echo "#define ARCH_X86_64 1" >>confdefs.h
-
-                ARCH_SPECIFIC_CFLAGS="-DUSE_ADDR64"
-                ARCH_STRING="X86-64"
-                ;;
-        ppc-* | powerpc-*)
-
-$as_echo "#define ARCH_PPC 1" >>confdefs.h
-
-                ARCH_SPECIFIC_CFLAGS=""
-                ARCH_STRING="PowerPC"
-                ;;
-        *)
-                as_fn_error $? "Unknown Architecture" "$LINENO" 5
-                ;;
-esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
-$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if ${ac_cv_c_bigendian+:} false; then :
+  for ac_prog in gtkdoc-rebase
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GTKDOC_REBASE+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  ac_cv_c_bigendian=unknown
-    # See if we're dealing with a universal compiler.
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifndef __APPLE_CC__
-	       not a universal capable compiler
-	     #endif
-	     typedef int dummy;
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-	# Check for potential -arch flags.  It is not universal unless
-	# there are at least two -arch flags with different values.
-	ac_arch=
-	ac_prev=
-	for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
-	 if test -n "$ac_prev"; then
-	   case $ac_word in
-	     i?86 | x86_64 | ppc | ppc64)
-	       if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
-		 ac_arch=$ac_word
-	       else
-		 ac_cv_c_bigendian=universal
-		 break
-	       fi
-	       ;;
-	   esac
-	   ac_prev=
-	 elif test "x$ac_word" = "x-arch"; then
-	   ac_prev=arch
-	 fi
-       done
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    if test $ac_cv_c_bigendian = unknown; then
-      # See if sys/param.h defines the BYTE_ORDER macro.
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-	     #include <sys/param.h>
-
-int
-main ()
-{
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
-		     && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
-		     && LITTLE_ENDIAN)
-	      bogus endian macros
-	     #endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  # It does; now see whether it defined to BIG_ENDIAN or not.
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-		#include <sys/param.h>
-
-int
-main ()
-{
-#if BYTE_ORDER != BIG_ENDIAN
-		 not big endian
-		#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_bigendian=yes
-else
-  ac_cv_c_bigendian=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    fi
-    if test $ac_cv_c_bigendian = unknown; then
-      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <limits.h>
-
-int
-main ()
-{
-#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
-	      bogus endian macros
-	     #endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  # It does; now see whether it defined to _BIG_ENDIAN or not.
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <limits.h>
-
-int
-main ()
-{
-#ifndef _BIG_ENDIAN
-		 not big endian
-		#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_bigendian=yes
-else
-  ac_cv_c_bigendian=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    fi
-    if test $ac_cv_c_bigendian = unknown; then
-      # Compile a test program.
-      if test "$cross_compiling" = yes; then :
-  # Try to guess by grepping values from an object file.
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-short int ascii_mm[] =
-		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-		short int ascii_ii[] =
-		  { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-		int use_ascii (int i) {
-		  return ascii_mm[i] + ascii_ii[i];
-		}
-		short int ebcdic_ii[] =
-		  { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-		short int ebcdic_mm[] =
-		  { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-		int use_ebcdic (int i) {
-		  return ebcdic_mm[i] + ebcdic_ii[i];
-		}
-		extern int foo;
+  case $GTKDOC_REBASE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GTKDOC_REBASE="$GTKDOC_REBASE" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GTKDOC_REBASE="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-int
-main ()
-{
-return use_ascii (foo) == use_ebcdic (foo);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
-	      ac_cv_c_bigendian=yes
-	    fi
-	    if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
-	      if test "$ac_cv_c_bigendian" = unknown; then
-		ac_cv_c_bigendian=no
-	      else
-		# finding both strings is unlikely to happen, but who knows?
-		ac_cv_c_bigendian=unknown
-	      fi
-	    fi
+  ;;
+esac
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-
-	     /* Are we little or big endian?  From Harbison&Steele.  */
-	     union
-	     {
-	       long int l;
-	       char c[sizeof (long int)];
-	     } u;
-	     u.l = 1;
-	     return u.c[sizeof (long int) - 1] == 1;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_c_bigendian=no
+GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE
+if test -n "$GTKDOC_REBASE"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5
+$as_echo "$GTKDOC_REBASE" >&6; }
 else
-  ac_cv_c_bigendian=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-    fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
-$as_echo "$ac_cv_c_bigendian" >&6; }
- case $ac_cv_c_bigendian in #(
-   yes)
-     $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
-;; #(
-   no)
-      ;; #(
-   universal)
-
-$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
 
-     ;; #(
-   *)
-     as_fn_error $? "unknown endianness
- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
- esac
 
+  test -n "$GTKDOC_REBASE" && break
+done
+test -n "$GTKDOC_REBASE" || GTKDOC_REBASE="true"
 
-#----------------------------------------------------------------------------
-# Package configuration switches.
-#----------------------------------------------------------------------------
-# Check whether --enable-multithreaded was given.
-if test "${enable_multithreaded+set}" = set; then :
-  enableval=$enable_multithreaded; disable_multithreaded=no
+  # Extract the first word of "gtkdoc-mkpdf", so it can be a program name with args.
+set dummy gtkdoc-mkpdf; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GTKDOC_MKPDF+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  disable_multithreaded=yes
-fi
+  case $GTKDOC_MKPDF in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GTKDOC_MKPDF="$GTKDOC_MKPDF" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GTKDOC_MKPDF="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking BulletMultiThreaded" >&5
-$as_echo_n "checking BulletMultiThreaded... " >&6; }
-if test "$disable_multithreaded" = yes; then :
-  build_multithreaded=no
-else
-  build_multithreaded=yes
+  ;;
+esac
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $build_multithreaded" >&5
-$as_echo "$build_multithreaded" >&6; }
- if test "$build_multithreaded" = yes; then
-  CONDITIONAL_BUILD_MULTITHREADED_TRUE=
-  CONDITIONAL_BUILD_MULTITHREADED_FALSE='#'
+GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF
+if test -n "$GTKDOC_MKPDF"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5
+$as_echo "$GTKDOC_MKPDF" >&6; }
 else
-  CONDITIONAL_BUILD_MULTITHREADED_TRUE='#'
-  CONDITIONAL_BUILD_MULTITHREADED_FALSE=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
-# Check whether --enable-demos was given.
-if test "${enable_demos+set}" = set; then :
-  enableval=$enable_demos;
-else
-  enable_demos=yes
-fi
 
- if false; then
-  CONDITIONAL_BUILD_DEMOS_TRUE=
-  CONDITIONAL_BUILD_DEMOS_FALSE='#'
-else
-  CONDITIONAL_BUILD_DEMOS_TRUE='#'
-  CONDITIONAL_BUILD_DEMOS_FALSE=
-fi
 
-if test "x$enable_demos" != xno; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Building Bullet demos" >&5
-$as_echo "$as_me: Building Bullet demos" >&6;}
-     if true; then
-  CONDITIONAL_BUILD_DEMOS_TRUE=
-  CONDITIONAL_BUILD_DEMOS_FALSE='#'
+# Check whether --with-html-dir was given.
+if test "${with_html_dir+set}" = set; then :
+  withval=$with_html_dir;
 else
-  CONDITIONAL_BUILD_DEMOS_TRUE='#'
-  CONDITIONAL_BUILD_DEMOS_FALSE=
-fi
-
+  with_html_dir='${datadir}/gtk-doc/html'
 fi
 
+  HTML_DIR="$with_html_dir"
 
 
-# Check whether --enable-debug was given.
-if test "${enable_debug+set}" = set; then :
-  enableval=$enable_debug;
-else
-  enable_debug=no
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build mode" >&5
-$as_echo_n "checking build mode... " >&6; }
-if test $enable_debug = yes; then :
-  build_mode=debug
+    # Check whether --enable-gtk-doc was given.
+if test "${enable_gtk_doc+set}" = set; then :
+  enableval=$enable_gtk_doc;
 else
-  build_mode=optimize
+  enable_gtk_doc=no
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $build_mode" >&5
-$as_echo "$build_mode" >&6; }
-
-CFLAGS="$ARCH_SPECIFIC_CFLAGS $CFLAGS"
-CXXFLAGS="$ARCH_SPECIFIC_CFLAGS $CXXFLAGS $CFLAGS"
-
-### end bullet configure script
 
 
-# Check whether --enable-hkl3d was given.
-if test "${enable_hkl3d+set}" = set; then :
-  enableval=$enable_hkl3d;
-else
-  enable_hkl3d=no
-fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5
+$as_echo_n "checking whether to build gtk-doc documentation... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5
+$as_echo "$enable_gtk_doc" >&6; }
 
- if test x$enable_hkl3d != xno; then
-  HKL3D_TRUE=
-  HKL3D_FALSE='#'
-else
-  HKL3D_TRUE='#'
-  HKL3D_FALSE=
-fi
+  if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then
+    as_fn_error $? "
+  You must have $gtk_doc_requires installed to build documentation for
+  $PACKAGE_NAME. Please install gtk-doc or disable building the
+  documentation by adding '--disable-gtk-doc' to '$0'." "$LINENO" 5
+  fi
 
-if test -z "$HKL3D_TRUE"; then :
+    if test "x$PACKAGE_NAME" != "xglib"; then
 
 pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for G3D" >&5
-$as_echo_n "checking for G3D... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKDOC_DEPS" >&5
+$as_echo_n "checking for GTKDOC_DEPS... " >&6; }
 
-if test -n "$G3D_CFLAGS"; then
-    pkg_cv_G3D_CFLAGS="$G3D_CFLAGS"
+if test -n "$GTKDOC_DEPS_CFLAGS"; then
+    pkg_cv_GTKDOC_DEPS_CFLAGS="$GTKDOC_DEPS_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libg3d >= 0.0.8\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "libg3d >= 0.0.8") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_G3D_CFLAGS=`$PKG_CONFIG --cflags "libg3d >= 0.0.8" 2>/dev/null`
+  pkg_cv_GTKDOC_DEPS_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -17851,16 +17709,16 @@ fi
  else
     pkg_failed=untried
 fi
-if test -n "$G3D_LIBS"; then
-    pkg_cv_G3D_LIBS="$G3D_LIBS"
+if test -n "$GTKDOC_DEPS_LIBS"; then
+    pkg_cv_GTKDOC_DEPS_LIBS="$GTKDOC_DEPS_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libg3d >= 0.0.8\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "libg3d >= 0.0.8") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_G3D_LIBS=`$PKG_CONFIG --libs "libg3d >= 0.0.8" 2>/dev/null`
+  pkg_cv_GTKDOC_DEPS_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -17881,249 +17739,134 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        G3D_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libg3d >= 0.0.8" 2>&1`
+	        GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0" 2>&1`
         else
-	        G3D_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libg3d >= 0.0.8" 2>&1`
+	        GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
-	echo "$G3D_PKG_ERRORS" >&5
-
-	as_fn_error $? "Package requirements (libg3d >= 0.0.8) were not met:
-
-$G3D_PKG_ERRORS
-
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
+	echo "$GTKDOC_DEPS_PKG_ERRORS" >&5
 
-Alternatively, you may set the environment variables G3D_CFLAGS
-and G3D_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details." "$LINENO" 5
+	:
 elif test $pkg_failed = untried; then
      	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
-
-Alternatively, you may set the environment variables G3D_CFLAGS
-and G3D_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
-
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5; }
+	:
 else
-	G3D_CFLAGS=$pkg_cv_G3D_CFLAGS
-	G3D_LIBS=$pkg_cv_G3D_LIBS
+	GTKDOC_DEPS_CFLAGS=$pkg_cv_GTKDOC_DEPS_CFLAGS
+	GTKDOC_DEPS_LIBS=$pkg_cv_GTKDOC_DEPS_LIBS
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
 fi
-	   	   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing yaml_get_version" >&5
-$as_echo_n "checking for library containing yaml_get_version... " >&6; }
-if ${ac_cv_search_yaml_get_version+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char yaml_get_version ();
-int
-main ()
-{
-return yaml_get_version ();
-  ;
-  return 0;
-}
-_ACEOF
-for ac_lib in '' yaml; do
-  if test -z "$ac_lib"; then
-    ac_res="none required"
-  else
-    ac_res=-l$ac_lib
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
   fi
-  if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_yaml_get_version=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext
-  if ${ac_cv_search_yaml_get_version+:} false; then :
-  break
-fi
-done
-if ${ac_cv_search_yaml_get_version+:} false; then :
 
+    # Check whether --enable-gtk-doc-html was given.
+if test "${enable_gtk_doc_html+set}" = set; then :
+  enableval=$enable_gtk_doc_html;
 else
-  ac_cv_search_yaml_get_version=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+  enable_gtk_doc_html=yes
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_yaml_get_version" >&5
-$as_echo "$ac_cv_search_yaml_get_version" >&6; }
-ac_res=$ac_cv_search_yaml_get_version
-if test "$ac_res" != no; then :
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-  for ac_header in yaml.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "yaml.h" "ac_cv_header_yaml_h" "$ac_includes_default"
-if test "x$ac_cv_header_yaml_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_YAML_H 1
-_ACEOF
 
+    # Check whether --enable-gtk-doc-pdf was given.
+if test "${enable_gtk_doc_pdf+set}" = set; then :
+  enableval=$enable_gtk_doc_pdf;
 else
-  as_fn_error $? "Could not find the yaml headers, please install yaml developement files" "$LINENO" 5
-
+  enable_gtk_doc_pdf=no
 fi
 
-done
-
-else
-  as_fn_error $? "Could not find the libyaml runtime, please install yaml" "$LINENO" 5
-
-fi
 
-	   YAML_CFLAGS=""
+  if test -z "$GTKDOC_MKPDF"; then
+    enable_gtk_doc_pdf=no
+  fi
 
-	   YAML_LIBS="-lyaml"
+  if test -z "$AM_DEFAULT_VERBOSITY"; then
+    AM_DEFAULT_VERBOSITY=1
+  fi
 
 
+   if test x$have_gtk_doc = xyes; then
+  HAVE_GTK_DOC_TRUE=
+  HAVE_GTK_DOC_FALSE='#'
+else
+  HAVE_GTK_DOC_TRUE='#'
+  HAVE_GTK_DOC_FALSE=
 fi
 
-
-# Check whether --enable-gui was given.
-if test "${enable_gui+set}" = set; then :
-  enableval=$enable_gui;
+   if test x$enable_gtk_doc = xyes; then
+  ENABLE_GTK_DOC_TRUE=
+  ENABLE_GTK_DOC_FALSE='#'
 else
-  enable_gui=yes
+  ENABLE_GTK_DOC_TRUE='#'
+  ENABLE_GTK_DOC_FALSE=
 fi
 
- if test x$enable_gui = xyes; then
-  GUI_TRUE=
-  GUI_FALSE='#'
+   if test x$enable_gtk_doc_html = xyes; then
+  GTK_DOC_BUILD_HTML_TRUE=
+  GTK_DOC_BUILD_HTML_FALSE='#'
 else
-  GUI_TRUE='#'
-  GUI_FALSE=
+  GTK_DOC_BUILD_HTML_TRUE='#'
+  GTK_DOC_BUILD_HTML_FALSE=
 fi
 
-if test -z "$GUI_TRUE"; then :
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKMM" >&5
-$as_echo_n "checking for GTKMM... " >&6; }
-
-if test -n "$GTKMM_CFLAGS"; then
-    pkg_cv_GTKMM_CFLAGS="$GTKMM_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtkmm-2.4 >= 2.18\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "gtkmm-2.4 >= 2.18") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_GTKMM_CFLAGS=`$PKG_CONFIG --cflags "gtkmm-2.4 >= 2.18" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
+   if test x$enable_gtk_doc_pdf = xyes; then
+  GTK_DOC_BUILD_PDF_TRUE=
+  GTK_DOC_BUILD_PDF_FALSE='#'
 else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
+  GTK_DOC_BUILD_PDF_TRUE='#'
+  GTK_DOC_BUILD_PDF_FALSE=
 fi
-if test -n "$GTKMM_LIBS"; then
-    pkg_cv_GTKMM_LIBS="$GTKMM_LIBS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtkmm-2.4 >= 2.18\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "gtkmm-2.4 >= 2.18") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_GTKMM_LIBS=`$PKG_CONFIG --libs "gtkmm-2.4 >= 2.18" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
+
+   if test -n "$LIBTOOL"; then
+  GTK_DOC_USE_LIBTOOL_TRUE=
+  GTK_DOC_USE_LIBTOOL_FALSE='#'
 else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
+  GTK_DOC_USE_LIBTOOL_TRUE='#'
+  GTK_DOC_USE_LIBTOOL_FALSE=
 fi
 
-
-
-if test $pkg_failed = yes; then
-   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-        _pkg_short_errors_supported=yes
+   if test -n "$GTKDOC_REBASE"; then
+  GTK_DOC_USE_REBASE_TRUE=
+  GTK_DOC_USE_REBASE_FALSE='#'
 else
-        _pkg_short_errors_supported=no
+  GTK_DOC_USE_REBASE_TRUE='#'
+  GTK_DOC_USE_REBASE_FALSE=
 fi
-        if test $_pkg_short_errors_supported = yes; then
-	        GTKMM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtkmm-2.4 >= 2.18" 2>&1`
-        else
-	        GTKMM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtkmm-2.4 >= 2.18" 2>&1`
-        fi
-	# Put the nasty error message in config.log where it belongs
-	echo "$GTKMM_PKG_ERRORS" >&5
 
-	as_fn_error $? "Package requirements (gtkmm-2.4 >= 2.18) were not met:
 
-$GTKMM_PKG_ERRORS
 
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
 
-Alternatively, you may set the environment variables GTKMM_CFLAGS
-and GTKMM_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details." "$LINENO" 5
-elif test $pkg_failed = untried; then
-     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
+  # Check whether --enable-hkl3d was given.
+if test "${enable_hkl3d+set}" = set; then :
+  enableval=$enable_hkl3d;
+else
+      enable_hkl3d=no
+fi
 
-Alternatively, you may set the environment variables GTKMM_CFLAGS
-and GTKMM_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
 
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5; }
+ if test x$enable_hkl3d != xno; then
+  HKL3D_TRUE=
+  HKL3D_FALSE='#'
 else
-	GTKMM_CFLAGS=$pkg_cv_GTKMM_CFLAGS
-	GTKMM_LIBS=$pkg_cv_GTKMM_LIBS
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
+  HKL3D_TRUE='#'
+  HKL3D_FALSE=
 fi
-	if test -z "$HKL3D_TRUE"; then :
+
+if test -z "$HKL3D_TRUE"; then :
 
 pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLU" >&5
-$as_echo_n "checking for GLU... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for G3D" >&5
+$as_echo_n "checking for G3D... " >&6; }
 
-if test -n "$GLU_CFLAGS"; then
-    pkg_cv_GLU_CFLAGS="$GLU_CFLAGS"
+if test -n "$G3D_CFLAGS"; then
+    pkg_cv_G3D_CFLAGS="$G3D_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glu >= 7.7.1\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "glu >= 7.7.1") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libg3d >= 0.0.8\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libg3d >= 0.0.8") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_GLU_CFLAGS=`$PKG_CONFIG --cflags "glu >= 7.7.1" 2>/dev/null`
+  pkg_cv_G3D_CFLAGS=`$PKG_CONFIG --cflags "libg3d >= 0.0.8" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -18131,16 +17874,16 @@ fi
  else
     pkg_failed=untried
 fi
-if test -n "$GLU_LIBS"; then
-    pkg_cv_GLU_LIBS="$GLU_LIBS"
+if test -n "$G3D_LIBS"; then
+    pkg_cv_G3D_LIBS="$G3D_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glu >= 7.7.1\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "glu >= 7.7.1") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libg3d >= 0.0.8\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libg3d >= 0.0.8") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_GLU_LIBS=`$PKG_CONFIG --libs "glu >= 7.7.1" 2>/dev/null`
+  pkg_cv_G3D_LIBS=`$PKG_CONFIG --libs "libg3d >= 0.0.8" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -18161,22 +17904,22 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        GLU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glu >= 7.7.1" 2>&1`
+	        G3D_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libg3d >= 0.0.8" 2>&1`
         else
-	        GLU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glu >= 7.7.1" 2>&1`
+	        G3D_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libg3d >= 0.0.8" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
-	echo "$GLU_PKG_ERRORS" >&5
+	echo "$G3D_PKG_ERRORS" >&5
 
-	as_fn_error $? "Package requirements (glu >= 7.7.1) were not met:
+	as_fn_error $? "Package requirements (libg3d >= 0.0.8) were not met:
 
-$GLU_PKG_ERRORS
+$G3D_PKG_ERRORS
 
 Consider adjusting the PKG_CONFIG_PATH environment variable if you
 installed software in a non-standard prefix.
 
-Alternatively, you may set the environment variables GLU_CFLAGS
-and GLU_LIBS to avoid the need to call pkg-config.
+Alternatively, you may set the environment variables G3D_CFLAGS
+and G3D_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details." "$LINENO" 5
 elif test $pkg_failed = untried; then
      	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -18187,34 +17930,34 @@ as_fn_error $? "The pkg-config script could not be found or is too old.  Make su
 is in your PATH or set the PKG_CONFIG environment variable to the full
 path to pkg-config.
 
-Alternatively, you may set the environment variables GLU_CFLAGS
-and GLU_LIBS to avoid the need to call pkg-config.
+Alternatively, you may set the environment variables G3D_CFLAGS
+and G3D_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details.
 
 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
 See \`config.log' for more details" "$LINENO" 5; }
 else
-	GLU_CFLAGS=$pkg_cv_GLU_CFLAGS
-	GLU_LIBS=$pkg_cv_GLU_LIBS
+	G3D_CFLAGS=$pkg_cv_G3D_CFLAGS
+	G3D_LIBS=$pkg_cv_G3D_LIBS
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
 fi
 
 pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKGLEXTMM" >&5
-$as_echo_n "checking for GTKGLEXTMM... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BULLET" >&5
+$as_echo_n "checking for BULLET... " >&6; }
 
-if test -n "$GTKGLEXTMM_CFLAGS"; then
-    pkg_cv_GTKGLEXTMM_CFLAGS="$GTKGLEXTMM_CFLAGS"
+if test -n "$BULLET_CFLAGS"; then
+    pkg_cv_BULLET_CFLAGS="$BULLET_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtkglextmm-1.2\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "gtkglextmm-1.2") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bullet >= 2.82\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "bullet >= 2.82") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_GTKGLEXTMM_CFLAGS=`$PKG_CONFIG --cflags "gtkglextmm-1.2" 2>/dev/null`
+  pkg_cv_BULLET_CFLAGS=`$PKG_CONFIG --cflags "bullet >= 2.82" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -18222,16 +17965,16 @@ fi
  else
     pkg_failed=untried
 fi
-if test -n "$GTKGLEXTMM_LIBS"; then
-    pkg_cv_GTKGLEXTMM_LIBS="$GTKGLEXTMM_LIBS"
+if test -n "$BULLET_LIBS"; then
+    pkg_cv_BULLET_LIBS="$BULLET_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtkglextmm-1.2\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "gtkglextmm-1.2") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bullet >= 2.82\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "bullet >= 2.82") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_GTKGLEXTMM_LIBS=`$PKG_CONFIG --libs "gtkglextmm-1.2" 2>/dev/null`
+  pkg_cv_BULLET_LIBS=`$PKG_CONFIG --libs "bullet >= 2.82" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -18252,22 +17995,22 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        GTKGLEXTMM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtkglextmm-1.2" 2>&1`
+	        BULLET_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "bullet >= 2.82" 2>&1`
         else
-	        GTKGLEXTMM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtkglextmm-1.2" 2>&1`
+	        BULLET_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "bullet >= 2.82" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
-	echo "$GTKGLEXTMM_PKG_ERRORS" >&5
+	echo "$BULLET_PKG_ERRORS" >&5
 
-	as_fn_error $? "Package requirements (gtkglextmm-1.2) were not met:
+	as_fn_error $? "Package requirements (bullet >= 2.82) were not met:
 
-$GTKGLEXTMM_PKG_ERRORS
+$BULLET_PKG_ERRORS
 
 Consider adjusting the PKG_CONFIG_PATH environment variable if you
 installed software in a non-standard prefix.
 
-Alternatively, you may set the environment variables GTKGLEXTMM_CFLAGS
-and GTKGLEXTMM_LIBS to avoid the need to call pkg-config.
+Alternatively, you may set the environment variables BULLET_CFLAGS
+and BULLET_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details." "$LINENO" 5
 elif test $pkg_failed = untried; then
      	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -18278,321 +18021,315 @@ as_fn_error $? "The pkg-config script could not be found or is too old.  Make su
 is in your PATH or set the PKG_CONFIG environment variable to the full
 path to pkg-config.
 
-Alternatively, you may set the environment variables GTKGLEXTMM_CFLAGS
-and GTKGLEXTMM_LIBS to avoid the need to call pkg-config.
+Alternatively, you may set the environment variables BULLET_CFLAGS
+and BULLET_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details.
 
 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
 See \`config.log' for more details" "$LINENO" 5; }
 else
-	GTKGLEXTMM_CFLAGS=$pkg_cv_GTKGLEXTMM_CFLAGS
-	GTKGLEXTMM_LIBS=$pkg_cv_GTKGLEXTMM_LIBS
+	BULLET_CFLAGS=$pkg_cv_BULLET_CFLAGS
+	BULLET_LIBS=$pkg_cv_BULLET_LIBS
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
 fi
+	   	   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing yaml_get_version" >&5
+$as_echo_n "checking for library containing yaml_get_version... " >&6; }
+if ${ac_cv_search_yaml_get_version+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char yaml_get_version ();
+int
+main ()
+{
+return yaml_get_version ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' yaml; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_yaml_get_version=$ac_res
 fi
-
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_yaml_get_version+:} false; then :
+  break
 fi
+done
+if ${ac_cv_search_yaml_get_version+:} false; then :
 
-
-# Check whether --enable-gcov was given.
-if test "${enable_gcov+set}" = set; then :
-  enableval=$enable_gcov; use_gcov=$enableval
 else
-  use_gcov=no
+  ac_cv_search_yaml_get_version=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_yaml_get_version" >&5
+$as_echo "$ac_cv_search_yaml_get_version" >&6; }
+ac_res=$ac_cv_search_yaml_get_version
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  for ac_header in yaml.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "yaml.h" "ac_cv_header_yaml_h" "$ac_includes_default"
+if test "x$ac_cv_header_yaml_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_YAML_H 1
+_ACEOF
 
+else
+  as_fn_error $? "Could not find the yaml headers, please install yaml developement files" "$LINENO" 5
 
-if test "x$use_gcov" = "xyes"; then
-      if test "$GCC" != "yes"; then
-      as_fn_error $? "GCC is required for --enable-gcov" "$LINENO" 5
-   fi
+fi
 
-    # Extract the first word of "shtool", so it can be a program name with args.
-set dummy shtool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_SHTOOL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$SHTOOL"; then
-  ac_cv_prog_SHTOOL="$SHTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_SHTOOL="shtool"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
 done
-  done
-IFS=$as_save_IFS
 
-fi
-fi
-SHTOOL=$ac_cv_prog_SHTOOL
-if test -n "$SHTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHTOOL" >&5
-$as_echo "$SHTOOL" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
+  as_fn_error $? "Could not find the libyaml runtime, please install yaml" "$LINENO" 5
 
+fi
 
-  case `$SHTOOL path $CC` in
-    *ccache*) gcc_ccache=yes;;
-    *) gcc_ccache=no;;
-  esac
+	   YAML_CFLAGS=""
 
-  if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
-    as_fn_error $? "ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1." "$LINENO" 5
-  fi
+	   YAML_LIBS="-lyaml"
 
-  ltp_version_list="1.6 1.7 1.8 1.9"
-  # Extract the first word of "lcov", so it can be a program name with args.
-set dummy lcov; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_LTP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$LTP"; then
-  ac_cv_prog_LTP="$LTP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_LTP="lcov"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
 
 fi
-fi
-LTP=$ac_cv_prog_LTP
-if test -n "$LTP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LTP" >&5
-$as_echo "$LTP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
 
 
-  # Extract the first word of "genhtml", so it can be a program name with args.
-set dummy genhtml; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_LTP_GENHTML+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$LTP_GENHTML"; then
-  ac_cv_prog_LTP_GENHTML="$LTP_GENHTML" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_LTP_GENHTML="genhtml"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-LTP_GENHTML=$ac_cv_prog_LTP_GENHTML
-if test -n "$LTP_GENHTML"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LTP_GENHTML" >&5
-$as_echo "$LTP_GENHTML" >&6; }
+  # Check whether --enable-gui was given.
+if test "${enable_gui+set}" = set; then :
+  enableval=$enable_gui;
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+      enable_gui=yes
 fi
 
 
-
-  if test "$LTP"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ltp version" >&5
-$as_echo_n "checking for ltp version... " >&6; }
-if ${glib_cv_ltp_version+:} false; then :
-  $as_echo_n "(cached) " >&6
+ if test x$enable_gui = xyes; then
+  GUI_TRUE=
+  GUI_FALSE='#'
 else
-
-      glib_cv_ltp_version=invalid
-      ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
-      for ltp_check_version in $ltp_version_list; do
-        if test "$ltp_version" = "$ltp_check_version"; then
-          glib_cv_ltp_version="$ltp_check_version (ok)"
-        fi
-      done
-
+  GUI_TRUE='#'
+  GUI_FALSE=
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_ltp_version" >&5
-$as_echo "$glib_cv_ltp_version" >&6; }
-  else
-    ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
-    as_fn_error $? "$ltp_msg" "$LINENO" 5
-  fi
-
-  case $glib_cv_ltp_version in
-    ""|invalid)
-      ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
-      as_fn_error $? "$ltp_msg" "$LINENO" 5
-      LTP="exit 0;"
-      ;;
-  esac
-
-  if test -z "$LTP_GENHTML"; then
-    as_fn_error $? "Could not find genhtml from the LTP package" "$LINENO" 5
-  fi
 
+if test -z "$GUI_TRUE"; then :
 
-$as_echo "#define HAVE_GCOV 1" >>confdefs.h
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK" >&5
+$as_echo_n "checking for GTK... " >&6; }
 
+if test -n "$GTK_CFLAGS"; then
+    pkg_cv_GTK_CFLAGS="$GTK_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= 2.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= 2.0") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_GTK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= 2.0" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$GTK_LIBS"; then
+    pkg_cv_GTK_LIBS="$GTK_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= 2.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= 2.0") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_GTK_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= 2.0" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
 
 
-  CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
-  CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9]*//g'`
 
+if test $pkg_failed = yes; then
+   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 
-    CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
-  CXXFLAGS="$CXXFLAGS -O0 -fprofile-arcs -ftest-coverage"
-  LDFLAGS="$LDFLAGS -lgcov"
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
 fi
+        if test $_pkg_short_errors_supported = yes; then
+	        GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtk+-2.0 >= 2.0" 2>&1`
+        else
+	        GTK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtk+-2.0 >= 2.0" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$GTK_PKG_ERRORS" >&5
 
+	as_fn_error $? "Package requirements (gtk+-2.0 >= 2.0) were not met:
 
+$GTK_PKG_ERRORS
 
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables GTK_CFLAGS
+and GTK_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
 
+Alternatively, you may set the environment variables GTK_CFLAGS
+and GTK_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
 
-                # Check whether --enable-introspection was given.
-if test "${enable_introspection+set}" = set; then :
-  enableval=$enable_introspection;
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
 else
-  enable_introspection=auto
-fi
+	GTK_CFLAGS=$pkg_cv_GTK_CFLAGS
+	GTK_LIBS=$pkg_cv_GTK_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
+fi
+	if test -z "$HKL3D_TRUE"; then :
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gobject-introspection" >&5
-$as_echo_n "checking for gobject-introspection... " >&6; }
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLU" >&5
+$as_echo_n "checking for GLU... " >&6; }
 
-        case $enable_introspection in #(
-  no) :
-            found_introspection="no (disabled, use --enable-introspection to enable)"
-     ;; #(
-      yes) :
-            if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0") 2>&5
+if test -n "$GLU_CFLAGS"; then
+    pkg_cv_GLU_CFLAGS="$GLU_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glu >= 7.7.1\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "glu >= 7.7.1") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  :
+  pkg_cv_GLU_CFLAGS=`$PKG_CONFIG --cflags "glu >= 7.7.1" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
-  as_fn_error $? "gobject-introspection-1.0 is not installed" "$LINENO" 5
+  pkg_failed=yes
 fi
-        if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 0.6.7\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 0.6.7") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  found_introspection=yes
-else
-  as_fn_error $? "You need to have gobject-introspection >= 0.6.7 installed to build hkl" "$LINENO" 5
+ else
+    pkg_failed=untried
 fi
-     ;; #(
-      auto) :
-            if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 0.6.7\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 0.6.7") 2>&5
+if test -n "$GLU_LIBS"; then
+    pkg_cv_GLU_LIBS="$GLU_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glu >= 7.7.1\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "glu >= 7.7.1") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  found_introspection=yes
+  pkg_cv_GLU_LIBS=`$PKG_CONFIG --libs "glu >= 7.7.1" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
-  found_introspection=no
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
 fi
-		enable_introspection=$found_introspection
-     ;; #(
-  *) :
-                as_fn_error $? "invalid argument passed to --enable-introspection, should be one of [no/auto/yes]" "$LINENO" 5
-     ;;
-esac
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found_introspection" >&5
-$as_echo "$found_introspection" >&6; }
 
-    INTROSPECTION_SCANNER=
-    INTROSPECTION_COMPILER=
-    INTROSPECTION_GENERATE=
-    INTROSPECTION_GIRDIR=
-    INTROSPECTION_TYPELIBDIR=
-    if test "x$found_introspection" = "xyes"; then
-       INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
-       INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
-       INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
-       INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
-       INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
-       INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
-       INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
-       INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
-    fi
 
 
+if test $pkg_failed = yes; then
+   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        GLU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glu >= 7.7.1" 2>&1`
+        else
+	        GLU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glu >= 7.7.1" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$GLU_PKG_ERRORS" >&5
 
+	as_fn_error $? "Package requirements (glu >= 7.7.1) were not met:
 
+$GLU_PKG_ERRORS
 
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
 
+Alternatively, you may set the environment variables GLU_CFLAGS
+and GLU_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
 
+Alternatively, you may set the environment variables GLU_CFLAGS
+and GLU_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
 
-     if test "x$found_introspection" = "xyes"; then
-  HAVE_INTROSPECTION_TRUE=
-  HAVE_INTROSPECTION_FALSE='#'
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
 else
-  HAVE_INTROSPECTION_TRUE='#'
-  HAVE_INTROSPECTION_FALSE=
-fi
-
-
-
+	GLU_CFLAGS=$pkg_cv_GLU_CFLAGS
+	GLU_LIBS=$pkg_cv_GLU_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
-if test -z "$HAVE_INTROSPECTION_TRUE"; then :
+fi
 
 pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GOBJECT" >&5
-$as_echo_n "checking for GOBJECT... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKGLEXT" >&5
+$as_echo_n "checking for GTKGLEXT... " >&6; }
 
-if test -n "$GOBJECT_CFLAGS"; then
-    pkg_cv_GOBJECT_CFLAGS="$GOBJECT_CFLAGS"
+if test -n "$GTKGLEXT_CFLAGS"; then
+    pkg_cv_GTKGLEXT_CFLAGS="$GTKGLEXT_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-2.0\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "gobject-2.0") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtkglext-1.0 >= 1.2.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gtkglext-1.0 >= 1.2.0") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_GOBJECT_CFLAGS=`$PKG_CONFIG --cflags "gobject-2.0" 2>/dev/null`
+  pkg_cv_GTKGLEXT_CFLAGS=`$PKG_CONFIG --cflags "gtkglext-1.0 >= 1.2.0" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -18600,16 +18337,16 @@ fi
  else
     pkg_failed=untried
 fi
-if test -n "$GOBJECT_LIBS"; then
-    pkg_cv_GOBJECT_LIBS="$GOBJECT_LIBS"
+if test -n "$GTKGLEXT_LIBS"; then
+    pkg_cv_GTKGLEXT_LIBS="$GTKGLEXT_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-2.0\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "gobject-2.0") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtkglext-1.0 >= 1.2.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gtkglext-1.0 >= 1.2.0") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_GOBJECT_LIBS=`$PKG_CONFIG --libs "gobject-2.0" 2>/dev/null`
+  pkg_cv_GTKGLEXT_LIBS=`$PKG_CONFIG --libs "gtkglext-1.0 >= 1.2.0" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -18630,22 +18367,22 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        GOBJECT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gobject-2.0" 2>&1`
+	        GTKGLEXT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtkglext-1.0 >= 1.2.0" 2>&1`
         else
-	        GOBJECT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gobject-2.0" 2>&1`
+	        GTKGLEXT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtkglext-1.0 >= 1.2.0" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
-	echo "$GOBJECT_PKG_ERRORS" >&5
+	echo "$GTKGLEXT_PKG_ERRORS" >&5
 
-	as_fn_error $? "Package requirements (gobject-2.0) were not met:
+	as_fn_error $? "Package requirements (gtkglext-1.0 >= 1.2.0) were not met:
 
-$GOBJECT_PKG_ERRORS
+$GTKGLEXT_PKG_ERRORS
 
 Consider adjusting the PKG_CONFIG_PATH environment variable if you
 installed software in a non-standard prefix.
 
-Alternatively, you may set the environment variables GOBJECT_CFLAGS
-and GOBJECT_LIBS to avoid the need to call pkg-config.
+Alternatively, you may set the environment variables GTKGLEXT_CFLAGS
+and GTKGLEXT_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details." "$LINENO" 5
 elif test $pkg_failed = untried; then
      	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -18656,78 +18393,103 @@ as_fn_error $? "The pkg-config script could not be found or is too old.  Make su
 is in your PATH or set the PKG_CONFIG environment variable to the full
 path to pkg-config.
 
-Alternatively, you may set the environment variables GOBJECT_CFLAGS
-and GOBJECT_LIBS to avoid the need to call pkg-config.
+Alternatively, you may set the environment variables GTKGLEXT_CFLAGS
+and GTKGLEXT_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details.
 
 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
 See \`config.log' for more details" "$LINENO" 5; }
 else
-	GOBJECT_CFLAGS=$pkg_cv_GOBJECT_CFLAGS
-	GOBJECT_LIBS=$pkg_cv_GOBJECT_LIBS
+	GTKGLEXT_CFLAGS=$pkg_cv_GTKGLEXT_CFLAGS
+	GTKGLEXT_LIBS=$pkg_cv_GTKGLEXT_LIBS
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
 fi
-	# Check whether --enable-glibtest was given.
-if test "${enable_glibtest+set}" = set; then :
-  enableval=$enable_glibtest;
+
+fi
+
+fi
+
+
+# Check whether --enable-gcov was given.
+if test "${enable_gcov+set}" = set; then :
+  enableval=$enable_gcov; use_gcov=$enableval
 else
-  enable_glibtest=yes
+  use_gcov=no
 fi
 
 
-  pkg_config_args=glib-2.0
-  for module in .
-  do
-      case "$module" in
-         gmodule)
-             pkg_config_args="$pkg_config_args gmodule-2.0"
-         ;;
-         gmodule-no-export)
-             pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
-         ;;
-         gobject)
-             pkg_config_args="$pkg_config_args gobject-2.0"
-         ;;
-         gthread)
-             pkg_config_args="$pkg_config_args gthread-2.0"
-         ;;
-         gio*)
-             pkg_config_args="$pkg_config_args $module-2.0"
-         ;;
-      esac
+if test "x$use_gcov" = "xyes"; then
+      if test "$GCC" != "yes"; then
+      as_fn_error $? "GCC is required for --enable-gcov" "$LINENO" 5
+   fi
+
+    # Extract the first word of "shtool", so it can be a program name with args.
+set dummy shtool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_SHTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$SHTOOL"; then
+  ac_cv_prog_SHTOOL="$SHTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_SHTOOL="shtool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
   done
+IFS=$as_save_IFS
 
+fi
+fi
+SHTOOL=$ac_cv_prog_SHTOOL
+if test -n "$SHTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHTOOL" >&5
+$as_echo "$SHTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
 
+  case `$SHTOOL path $CC` in
+    *ccache*) gcc_ccache=yes;;
+    *) gcc_ccache=no;;
+  esac
 
+  if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
+    as_fn_error $? "ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1." "$LINENO" 5
+  fi
 
-
-
-
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
-	if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+  ltp_version_list="1.6 1.7 1.8 1.9"
+  # Extract the first word of "lcov", so it can be a program name with args.
+set dummy lcov; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
+if ${ac_cv_prog_LTP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  case $PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+  if test -n "$LTP"; then
+  ac_cv_prog_LTP="$LTP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_prog_LTP="lcov"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -18735,42 +18497,36 @@ done
   done
 IFS=$as_save_IFS
 
-  ;;
-esac
 fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
+fi
+LTP=$ac_cv_prog_LTP
+if test -n "$LTP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LTP" >&5
+$as_echo "$LTP" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-fi
-if test -z "$ac_cv_path_PKG_CONFIG"; then
-  ac_pt_PKG_CONFIG=$PKG_CONFIG
-  # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
+  # Extract the first word of "genhtml", so it can be a program name with args.
+set dummy genhtml; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+if ${ac_cv_prog_LTP_GENHTML+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  case $ac_pt_PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+  if test -n "$LTP_GENHTML"; then
+  ac_cv_prog_LTP_GENHTML="$LTP_GENHTML" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_prog_LTP_GENHTML="genhtml"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -18778,254 +18534,257 @@ done
   done
 IFS=$as_save_IFS
 
-  ;;
-esac
 fi
-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-if test -n "$ac_pt_PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
-$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+fi
+LTP_GENHTML=$ac_cv_prog_LTP_GENHTML
+if test -n "$LTP_GENHTML"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LTP_GENHTML" >&5
+$as_echo "$LTP_GENHTML" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
-  if test "x$ac_pt_PKG_CONFIG" = x; then
-    PKG_CONFIG=""
+
+
+  if test "$LTP"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ltp version" >&5
+$as_echo_n "checking for ltp version... " >&6; }
+if ${glib_cv_ltp_version+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+      glib_cv_ltp_version=invalid
+      ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
+      for ltp_check_version in $ltp_version_list; do
+        if test "$ltp_version" = "$ltp_check_version"; then
+          glib_cv_ltp_version="$ltp_check_version (ok)"
+        fi
+      done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_ltp_version" >&5
+$as_echo "$glib_cv_ltp_version" >&6; }
   else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    PKG_CONFIG=$ac_pt_PKG_CONFIG
+    ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
+    as_fn_error $? "$ltp_msg" "$LINENO" 5
+  fi
+
+  case $glib_cv_ltp_version in
+    ""|invalid)
+      ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
+      as_fn_error $? "$ltp_msg" "$LINENO" 5
+      LTP="exit 0;"
+      ;;
+  esac
+
+  if test -z "$LTP_GENHTML"; then
+    as_fn_error $? "Could not find genhtml from the LTP package" "$LINENO" 5
   fi
+
+
+$as_echo "#define HAVE_GCOV 1" >>confdefs.h
+
+
+
+  CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
+  CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9]*//g'`
+
+
+    CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
+  CXXFLAGS="$CXXFLAGS -O0 -fprofile-arcs -ftest-coverage"
+  LDFLAGS="$LDFLAGS -lgcov"
+fi
+
+
+
+
+
+                # Check whether --enable-introspection was given.
+if test "${enable_introspection+set}" = set; then :
+  enableval=$enable_introspection;
 else
-  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+  enable_introspection=auto
 fi
 
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gobject-introspection" >&5
+$as_echo_n "checking for gobject-introspection... " >&6; }
+
+        case $enable_introspection in #(
+  no) :
+            found_introspection="no (disabled, use --enable-introspection to enable)"
+     ;; #(
+      yes) :
+            if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  :
+else
+  as_fn_error $? "gobject-introspection-1.0 is not installed" "$LINENO" 5
 fi
-if test -n "$PKG_CONFIG"; then
-	_pkg_min_version=0.16
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
-$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
-	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-	else
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-		PKG_CONFIG=""
-	fi
+        if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 0.6.7\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 0.6.7") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  found_introspection=yes
+else
+  as_fn_error $? "You need to have gobject-introspection >= 0.6.7 installed to build hkl" "$LINENO" 5
+fi
+     ;; #(
+      auto) :
+            if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 0.6.7\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 0.6.7") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  found_introspection=yes
+else
+  found_introspection=no
 fi
+		enable_introspection=$found_introspection
+     ;; #(
+  *) :
+                as_fn_error $? "invalid argument passed to --enable-introspection, should be one of [no/auto/yes]" "$LINENO" 5
+     ;;
+esac
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found_introspection" >&5
+$as_echo "$found_introspection" >&6; }
 
-  no_glib=""
+    INTROSPECTION_SCANNER=
+    INTROSPECTION_COMPILER=
+    INTROSPECTION_GENERATE=
+    INTROSPECTION_GIRDIR=
+    INTROSPECTION_TYPELIBDIR=
+    if test "x$found_introspection" = "xyes"; then
+       INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
+       INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
+       INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
+       INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
+       INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+       INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
+       INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
+       INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
+    fi
 
-  if test "x$PKG_CONFIG" = x ; then
-    no_glib=yes
-    PKG_CONFIG=no
-  fi
 
-  min_glib_version=2.0.0
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB - version >= $min_glib_version" >&5
-$as_echo_n "checking for GLIB - version >= $min_glib_version... " >&6; }
 
-  if test x$PKG_CONFIG != xno ; then
-    ## don't try to run the test against uninstalled libtool libs
-    if $PKG_CONFIG --uninstalled $pkg_config_args; then
-	  echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
-	  enable_glibtest=no
-    fi
 
-    if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
-	  :
-    else
-	  no_glib=yes
-    fi
-  fi
 
-  if test x"$no_glib" = x ; then
-    GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
-    GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
-    GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
-    GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable=glib_compile_resources gio-2.0`
 
-    GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
-    GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
-    glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
-           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
-    glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
-           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
-    glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
-           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
-    if test "x$enable_glibtest" = "xyes" ; then
-      ac_save_CFLAGS="$CFLAGS"
-      ac_save_LIBS="$LIBS"
-      CFLAGS="$CFLAGS $GLIB_CFLAGS"
-      LIBS="$GLIB_LIBS $LIBS"
-      rm -f conf.glibtest
-      if test "$cross_compiling" = yes; then :
-  echo $ac_n "cross compiling; assumed OK... $ac_c"
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <glib.h>
-#include <stdio.h>
-#include <stdlib.h>
 
-int
-main ()
-{
-  unsigned int major, minor, micro;
-  char *tmp_version;
 
-  fclose (fopen ("conf.glibtest", "w"));
+     if test "x$found_introspection" = "xyes"; then
+  HAVE_INTROSPECTION_TRUE=
+  HAVE_INTROSPECTION_FALSE='#'
+else
+  HAVE_INTROSPECTION_TRUE='#'
+  HAVE_INTROSPECTION_FALSE=
+fi
 
-  /* HP/UX 9 (%@#!) writes to sscanf strings */
-  tmp_version = g_strdup("$min_glib_version");
-  if (sscanf(tmp_version, "%u.%u.%u", &major, &minor, &micro) != 3) {
-     printf("%s, bad version string\n", "$min_glib_version");
-     exit(1);
-   }
 
-  if ((glib_major_version != $glib_config_major_version) ||
-      (glib_minor_version != $glib_config_minor_version) ||
-      (glib_micro_version != $glib_config_micro_version))
-    {
-      printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
-             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
-             glib_major_version, glib_minor_version, glib_micro_version);
-      printf ("*** was found! If pkg-config was correct, then it is best\n");
-      printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
-      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
-      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
-      printf("*** required on your system.\n");
-      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
-      printf("*** to point to the correct configuration files\n");
-    }
-  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
-	   (glib_minor_version != GLIB_MINOR_VERSION) ||
-           (glib_micro_version != GLIB_MICRO_VERSION))
-    {
-      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
-	     GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
-      printf("*** library (version %d.%d.%d)\n",
-	     glib_major_version, glib_minor_version, glib_micro_version);
-    }
-  else
-    {
-      if ((glib_major_version > major) ||
-        ((glib_major_version == major) && (glib_minor_version > minor)) ||
-        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
-      {
-        return 0;
-       }
-     else
-      {
-        printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n",
-               glib_major_version, glib_minor_version, glib_micro_version);
-        printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n",
-	       major, minor, micro);
-        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
-        printf("***\n");
-        printf("*** If you have already installed a sufficiently new version, this error\n");
-        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
-        printf("*** being found. The easiest way to fix this is to remove the old version\n");
-        printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
-        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
-        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
-        printf("*** so that the correct libraries are found at run-time))\n");
-      }
-    }
-  return 1;
-}
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
 
+if test -z "$HAVE_INTROSPECTION_TRUE"; then :
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GOBJECT" >&5
+$as_echo_n "checking for GOBJECT... " >&6; }
+
+if test -n "$GOBJECT_CFLAGS"; then
+    pkg_cv_GOBJECT_CFLAGS="$GOBJECT_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-2.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gobject-2.0") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_GOBJECT_CFLAGS=`$PKG_CONFIG --cflags "gobject-2.0" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
-  no_glib=yes
+  pkg_failed=yes
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+ else
+    pkg_failed=untried
+fi
+if test -n "$GOBJECT_LIBS"; then
+    pkg_cv_GOBJECT_LIBS="$GOBJECT_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-2.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gobject-2.0") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_GOBJECT_LIBS=`$PKG_CONFIG --libs "gobject-2.0" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
 fi
 
-       CFLAGS="$ac_save_CFLAGS"
-       LIBS="$ac_save_LIBS"
-     fi
-  fi
-  if test "x$no_glib" = x ; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5
-$as_echo "yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6; }
-     :
-  else
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-     if test "$PKG_CONFIG" = "no" ; then
-       echo "*** A new enough version of pkg-config was not found."
-       echo "*** See http://www.freedesktop.org/software/pkgconfig/"
-     else
-       if test -f conf.glibtest ; then
-        :
-       else
-          echo "*** Could not run GLIB test program, checking why..."
-          ac_save_CFLAGS="$CFLAGS"
-          ac_save_LIBS="$LIBS"
-          CFLAGS="$CFLAGS $GLIB_CFLAGS"
-          LIBS="$LIBS $GLIB_LIBS"
-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <glib.h>
-#include <stdio.h>
 
-int
-main ()
-{
- return ((glib_major_version) || (glib_minor_version) || (glib_micro_version));
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-   echo "*** The test program compiled, but did not run. This usually means"
-          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
-          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
-          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
-          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
-          echo "*** is required on your system"
-	  echo "***"
-          echo "*** If you have an old version installed, it is best to remove it, although"
-          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
+if test $pkg_failed = yes; then
+   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
-   echo "*** The test program failed to compile or link. See the file config.log for the"
-          echo "*** exact error that occured. This usually means GLIB is incorrectly installed."
+        _pkg_short_errors_supported=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-          CFLAGS="$ac_save_CFLAGS"
-          LIBS="$ac_save_LIBS"
-       fi
-     fi
-     GLIB_CFLAGS=""
-     GLIB_LIBS=""
-     GLIB_GENMARSHAL=""
-     GOBJECT_QUERY=""
-     GLIB_MKENUMS=""
-     GLIB_COMPILE_RESOURCES=""
-     :
-  fi
+        if test $_pkg_short_errors_supported = yes; then
+	        GOBJECT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gobject-2.0" 2>&1`
+        else
+	        GOBJECT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gobject-2.0" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$GOBJECT_PKG_ERRORS" >&5
 
+	as_fn_error $? "Package requirements (gobject-2.0) were not met:
 
+$GOBJECT_PKG_ERRORS
 
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
 
+Alternatively, you may set the environment variables GOBJECT_CFLAGS
+and GOBJECT_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
 
+Alternatively, you may set the environment variables GOBJECT_CFLAGS
+and GOBJECT_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
 
-  rm -f conf.glibtest
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+	GOBJECT_CFLAGS=$pkg_cv_GOBJECT_CFLAGS
+	GOBJECT_LIBS=$pkg_cv_GOBJECT_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
 fi
+fi
 
 
 
@@ -19066,7 +18825,7 @@ $as_echo "#define HAVE_ATTRIBUTE_USED 1" >>confdefs.h
 $as_echo "#define HAVE_BUILTIN_TYPES_COMPATIBLE_P 1" >>confdefs.h
 
 
-ac_config_files="$ac_config_files Makefile hkl/Makefile hkl/ccan/Makefile hkl.pc hkl3d/Makefile hkl3d/bullet/Makefile hkl3d/bullet/src/Makefile hkl3d.pc tests/Makefile tests/bindings/Makefile tests/tap/Makefile Documentation/Makefile Documentation/api/Makefile Documentation/figures/Makefile Documentation/sphinx/Makefile Documentation/sphinx/source/conf.py gui/Makefile gui/hkl3d/Makefile data/Makefile"
+ac_config_files="$ac_config_files Makefile hkl/Makefile hkl/ccan/Makefile hkl.pc hkl3d/Makefile hkl3d.pc tests/Makefile tests/bindings/Makefile tests/tap/Makefile Documentation/Makefile Documentation/hkl.org Documentation/api/Makefile Documentation/figures/Makefile Documentation/sphinx/Makefile Documentation/sphinx/source/conf.py gui/Makefile data/Makefile"
 
 
 cat >confcache <<\_ACEOF
@@ -19198,12 +18957,24 @@ if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
   as_fn_error $? "conditional \"AMDEP\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
   as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
-  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+if test -z "${LOGGING_TRUE}" && test -z "${LOGGING_FALSE}"; then
+  as_fn_error $? "conditional \"LOGGING\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HKL_DOC_TRUE}" && test -z "${HKL_DOC_FALSE}"; then
+  as_fn_error $? "conditional \"HKL_DOC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_GTK_DOC_TRUE}" && test -z "${HAVE_GTK_DOC_FALSE}"; then
+  as_fn_error $? "conditional \"HAVE_GTK_DOC\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then
@@ -19226,19 +18997,6 @@ if test -z "${GTK_DOC_USE_REBASE_TRUE}" && test -z "${GTK_DOC_USE_REBASE_FALSE}"
   as_fn_error $? "conditional \"GTK_DOC_USE_REBASE\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-
-if test -z "${CONDITIONAL_BUILD_MULTITHREADED_TRUE}" && test -z "${CONDITIONAL_BUILD_MULTITHREADED_FALSE}"; then
-  as_fn_error $? "conditional \"CONDITIONAL_BUILD_MULTITHREADED\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${CONDITIONAL_BUILD_DEMOS_TRUE}" && test -z "${CONDITIONAL_BUILD_DEMOS_FALSE}"; then
-  as_fn_error $? "conditional \"CONDITIONAL_BUILD_DEMOS\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${CONDITIONAL_BUILD_DEMOS_TRUE}" && test -z "${CONDITIONAL_BUILD_DEMOS_FALSE}"; then
-  as_fn_error $? "conditional \"CONDITIONAL_BUILD_DEMOS\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${HKL3D_TRUE}" && test -z "${HKL3D_FALSE}"; then
   as_fn_error $? "conditional \"HKL3D\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -19648,7 +19406,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by hkl $as_me 4.99.99.1621, which was
+This file was extended by hkl $as_me 4.99.99.1892, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -19714,7 +19472,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-hkl config.status 4.99.99.1621
+hkl config.status 4.99.99.1892
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -20226,19 +19984,17 @@ do
     "hkl/ccan/Makefile") CONFIG_FILES="$CONFIG_FILES hkl/ccan/Makefile" ;;
     "hkl.pc") CONFIG_FILES="$CONFIG_FILES hkl.pc" ;;
     "hkl3d/Makefile") CONFIG_FILES="$CONFIG_FILES hkl3d/Makefile" ;;
-    "hkl3d/bullet/Makefile") CONFIG_FILES="$CONFIG_FILES hkl3d/bullet/Makefile" ;;
-    "hkl3d/bullet/src/Makefile") CONFIG_FILES="$CONFIG_FILES hkl3d/bullet/src/Makefile" ;;
     "hkl3d.pc") CONFIG_FILES="$CONFIG_FILES hkl3d.pc" ;;
     "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
     "tests/bindings/Makefile") CONFIG_FILES="$CONFIG_FILES tests/bindings/Makefile" ;;
     "tests/tap/Makefile") CONFIG_FILES="$CONFIG_FILES tests/tap/Makefile" ;;
     "Documentation/Makefile") CONFIG_FILES="$CONFIG_FILES Documentation/Makefile" ;;
+    "Documentation/hkl.org") CONFIG_FILES="$CONFIG_FILES Documentation/hkl.org" ;;
     "Documentation/api/Makefile") CONFIG_FILES="$CONFIG_FILES Documentation/api/Makefile" ;;
     "Documentation/figures/Makefile") CONFIG_FILES="$CONFIG_FILES Documentation/figures/Makefile" ;;
     "Documentation/sphinx/Makefile") CONFIG_FILES="$CONFIG_FILES Documentation/sphinx/Makefile" ;;
     "Documentation/sphinx/source/conf.py") CONFIG_FILES="$CONFIG_FILES Documentation/sphinx/source/conf.py" ;;
     "gui/Makefile") CONFIG_FILES="$CONFIG_FILES gui/Makefile" ;;
-    "gui/hkl3d/Makefile") CONFIG_FILES="$CONFIG_FILES gui/hkl3d/Makefile" ;;
     "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
diff --git a/configure.ac b/configure.ac
index 55a0660..4de559a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,12 +24,12 @@ AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_AUX_DIR(config)
 
-AM_INIT_AUTOMAKE([silent-rules tar-ustar -Wno-portability])
+AM_INIT_AUTOMAKE([silent-rules tar-ustar -Wno-portability subdir-objects])
 
 # Checks for programs.
-AC_PROG_CXX
 AC_PROG_AWK
 AC_PROG_CC_C99
+AC_PROG_CXX
 AC_PROG_CPP
 AC_PROG_INSTALL
 AC_PROG_LN_S
@@ -56,9 +56,9 @@ AC_SUBST(VMAJ)
 
 # Checks for libraries.
 AX_PATH_GSL
+AM_PATH_GLIB_2_0
 
 # Checks for header files.
-AC_HEADER_STDBOOL
 AC_HEADER_STDC
 AC_HEADER_TIME
 AC_FUNC_ALLOCA
@@ -85,129 +85,69 @@ AC_FUNC_VPRINTF
 AC_CHECK_FUNCS([floor getcwd gettimeofday memmove memset pow select sqrt strchr strdup strstr])
 
 dnl OPTION_DEFAULT_OFF(NAME, HELP-STRING)
-dnl Create a new --with option that defaults to being disabled.
-dnl NAME is the base name of the option.  The shell variable with_NAME
+dnl Create a new --enable option that defaults to being disabled.
+dnl NAME is the base name of the option.  The shell variable enable_NAME
 dnl   will be set to either the user's value (if the option is
-dnl   specified; 'yes' for a plain --with-NAME) or to 'no' (if the
+dnl   specified; 'yes' for a plain --enable-NAME) or to 'no' (if the
 dnl   option is not specified).  Note that the shell variable name is
 dnl   constructed as autoconf does, by replacing non-alphanumeric
 dnl   characters with "_".
 dnl HELP-STRING is the help text for the option.
 AC_DEFUN([OPTION_DEFAULT_OFF], [dnl
-  AC_ARG_WITH([$1],[AS_HELP_STRING([--with-$1],[$2])],[],[dnl
-    m4_bpatsubst([with_$1], [[^0-9a-z]], [_])=no])dnl
+  AC_ARG_ENABLE([$1],[AS_HELP_STRING([--enable-$1],[$2])],[],[dnl
+    m4_bpatsubst([enable_$1], [[^0-9a-z]], [_])=no])dnl
+])dnl
+
+dnl OPTION_DEFAULT_ON(NAME, HELP-STRING)
+dnl Create a new --enable option that defaults to being enabled.
+dnl NAME is the base name of the option.  The shell variable enable_NAME
+dnl   will be set to either the user's value (if the option is
+dnl   specified; 'no' for a plain --enable-NAME) or to 'yes' (if the
+dnl   option is not specified).  Note that the shell variable name is
+dnl   constructed as autoconf does, by replacing non-alphanumeric
+dnl   characters with "_".
+dnl HELP-STRING is the help text for the option.
+AC_DEFUN([OPTION_DEFAULT_ON], [dnl
+  AC_ARG_ENABLE([$1],[AS_HELP_STRING([--disable-$1],[$2])],[],[dnl
+    m4_bpatsubst([enable_$1], [[^0-9a-z]], [_])=yes])dnl
 ])dnl
 
 dnl ***************
-dnl *** gtk-doc ***
+dnl *** logging ***
 dnl ***************
 
-GTK_DOC_CHECK([1.9],[--flavour no-tmpl])
+OPTION_DEFAULT_OFF([logging], [enable the glib logging])
+AM_CONDITIONAL([LOGGING], [test x$enable_logging != xno])
+AM_COND_IF([LOGGING],
+	AC_DEFINE([LOGGING], [1], [activate the logging or not])
+	)
 
 dnl ***********
-dnl *** asy ***
+dnl *** doc ***
 dnl ***********
 
-AC_PATH_PROG([ASY], [asy], [echo])
-
-dnl *********************************************
-dnl *** took from the bullet configure script ***
-dnl *********************************************
-
-AC_CANONICAL_HOST
-case "$host" in
-        *-*-mingw*|*-*-cygwin*)
-                AC_DEFINE(PLATFORM_WIN32, 1, [Platform is Win32])
-                opengl_LIBS="-lunsupported_platform"
-                PLATFORM_STRING="Win32"
-                ;;
-        *-*-linux*)
-                AC_DEFINE(PLATFORM_LINUX, 1, [Platform is Linux])
-                opengl_LIBS="-lGL -lGLU"
-                PLATFORM_STRING="Linux"
-                ;;
-        *-*-darwin*)
-                AC_DEFINE(PLATFORM_APPLE, 1, [Platform is Apple])
-                opengl_LIBS="-framework AGL -framework OpenGL -framework GLUT"
-                PLATFORM_STRING="Apple"
-                ;;
-        *)
-                AC_MSG_WARN([*** Please add $host to configure.ac checks!])
-                ;;
-esac
-AC_SUBST(opengl_LIBS)
-
-case "$host" in
-        i?86-* | k?-* | athlon-* | pentium*-)
-                AC_DEFINE(ARCH_X86, 1, [Architecture is x86])
-                ARCH_SPECIFIC_CFLAGS=""
-                ARCH_STRING="X86"
-                ;;
-        x86_64-*)
-                AC_DEFINE(ARCH_X86_64, 1, [Architecture is x86-64])
-                ARCH_SPECIFIC_CFLAGS="-DUSE_ADDR64"
-                ARCH_STRING="X86-64"
-                ;;
-        ppc-* | powerpc-*)
-                AC_DEFINE(ARCH_PPC, 1, [Architecture is PowerPC])
-                ARCH_SPECIFIC_CFLAGS=""
-                ARCH_STRING="PowerPC"
-                ;;
-        *)
-                AC_MSG_ERROR([Unknown Architecture])
-                ;;
-esac
-AC_C_BIGENDIAN
-
-#----------------------------------------------------------------------------
-# Package configuration switches.
-#----------------------------------------------------------------------------
-AC_ARG_ENABLE([multithreaded],
-	[AS_HELP_STRING([--enable-multithreaded],[build BulletMultiThreaded (default NO)])],
-	[disable_multithreaded=no], [disable_multithreaded=yes])
-AC_MSG_CHECKING([BulletMultiThreaded])
-AS_IF([test "$disable_multithreaded" = yes], [build_multithreaded=no], [build_multithreaded=yes])
-AC_MSG_RESULT([$build_multithreaded])
-AM_CONDITIONAL([CONDITIONAL_BUILD_MULTITHREADED], [test "$build_multithreaded" = yes])
-
-AC_ARG_ENABLE([demos],
-    [AS_HELP_STRING([--disable-demos],
-	    [disable Bullet demos])],
-    [],
-    [enable_demos=yes])
-AM_CONDITIONAL([CONDITIONAL_BUILD_DEMOS], [false])
-if test "x$enable_demos" != xno; then
-    AC_MSG_NOTICE([Building Bullet demos])
-    AM_CONDITIONAL([CONDITIONAL_BUILD_DEMOS],[true])
-fi
-
-
-
-AC_ARG_ENABLE([debug],
-    [AS_HELP_STRING([--enable-debug],[build with debugging information (default NO)])],
-    [], [enable_debug=no])
-
-AC_MSG_CHECKING([build mode])
-AS_IF([test $enable_debug = yes], [build_mode=debug], [build_mode=optimize])
-AC_MSG_RESULT([$build_mode])
+OPTION_DEFAULT_ON([hkl-doc], [build documentation])
+AM_CONDITIONAL([HKL_DOC], [test x$enable_hkl_doc = xyes])
+AM_COND_IF([HKL_DOC],
+	   [dnl *** asymptote ***
+	    AC_PATH_PROG([ASY], [asy], [echo])
+	    dnl *** emacs ***
+	    AC_PATH_PROG([EMACS], [emacs], [no])
+	   ])
 
-CFLAGS="$ARCH_SPECIFIC_CFLAGS $CFLAGS"
-CXXFLAGS="$ARCH_SPECIFIC_CFLAGS $CXXFLAGS $CFLAGS"
-
-### end bullet configure script
+dnl *** gtk-doc ***
+GTK_DOC_CHECK([1.9],[--flavour no-tmpl])
 
 dnl *******************************
 dnl *** add an option for hkl3d ***
 dnl *******************************
 
-AC_ARG_ENABLE([hkl3d],
-	AS_HELP_STRING([--enable-hkl3d],
-		[compile the hkl3d library]),
-	[],
-	[enable_hkl3d=no])
+OPTION_DEFAULT_OFF([hkl3d], [compile the hkl3d library])
+
 AM_CONDITIONAL([HKL3D], [test x$enable_hkl3d != xno])
 AM_COND_IF([HKL3D],
 	   [PKG_CHECK_MODULES([G3D], [libg3d >= 0.0.8])
+	    PKG_CHECK_MODULES([BULLET], [bullet >= 2.82])
 	   dnl check for yaml
 	   AC_SEARCH_LIBS([yaml_get_version], [yaml],
 			  [AC_CHECK_HEADERS([yaml.h], [],
@@ -225,17 +165,14 @@ dnl ****************************************
 dnl *** add an option for the ghkl build ***
 dnl ****************************************
 
-AC_ARG_ENABLE([gui],
-	AS_HELP_STRING([--disable-gui],
-		[do not compile the gui interface]),
-	[],
-	[enable_gui=yes])
+OPTION_DEFAULT_ON([gui], [do not compile the gui interface])
+
 AM_CONDITIONAL([GUI], [test x$enable_gui = xyes])
 AM_COND_IF([GUI],
-	[PKG_CHECK_MODULES([GTKMM], [gtkmm-2.4 >= 2.18])
+	[PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.0])
 	AM_COND_IF([HKL3D],
 		   [PKG_CHECK_MODULES([GLU], [glu >= 7.7.1])
-		    PKG_CHECK_MODULES([GTKGLEXTMM], [gtkglextmm-1.2])
+		    PKG_CHECK_MODULES([GTKGLEXT], [gtkglext-1.0 >= 1.2.0])
 	])
 ])
 
@@ -318,8 +255,7 @@ dnl *********************
 GOBJECT_INTROSPECTION_CHECK([0.6.7])
 
 AM_COND_IF([HAVE_INTROSPECTION],
-	[PKG_CHECK_MODULES([GOBJECT], [gobject-2.0])
-	AM_PATH_GLIB_2_0])
+	[PKG_CHECK_MODULES([GOBJECT], [gobject-2.0])])
 
 
 dnl ************
@@ -344,19 +280,17 @@ AC_CONFIG_FILES([Makefile
 		 hkl/ccan/Makefile
 		 hkl.pc
 		 hkl3d/Makefile
-		 hkl3d/bullet/Makefile
-		 hkl3d/bullet/src/Makefile
 		 hkl3d.pc
 		 tests/Makefile
 		 tests/bindings/Makefile
 		 tests/tap/Makefile
 		 Documentation/Makefile
+		 Documentation/hkl.org
 		 Documentation/api/Makefile
 		 Documentation/figures/Makefile
 		 Documentation/sphinx/Makefile
 		 Documentation/sphinx/source/conf.py
 		 gui/Makefile
-		 gui/hkl3d/Makefile
 		 data/Makefile
 ])
 
diff --git a/data/Makefile.in b/data/Makefile.in
index f764d83..ed0ee97 100644
--- a/data/Makefile.in
+++ b/data/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
@@ -151,6 +151,8 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BULLET_CFLAGS = @BULLET_CFLAGS@
+BULLET_LIBS = @BULLET_LIBS@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
@@ -170,6 +172,7 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+EMACS = @EMACS@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
 G3D_CFLAGS = @G3D_CFLAGS@
@@ -189,14 +192,15 @@ GSL_CFLAGS = @GSL_CFLAGS@
 GSL_CONFIG = @GSL_CONFIG@
 GSL_LIBS = @GSL_LIBS@
 GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@
 GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
 GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
 GTKDOC_MKPDF = @GTKDOC_MKPDF@
 GTKDOC_REBASE = @GTKDOC_REBASE@
-GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
-GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
-GTKMM_CFLAGS = @GTKMM_CFLAGS@
-GTKMM_LIBS = @GTKMM_LIBS@
+GTKGLEXT_CFLAGS = @GTKGLEXT_CFLAGS@
+GTKGLEXT_LIBS = @GTKGLEXT_LIBS@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
 HTML_DIR = @HTML_DIR@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -292,7 +296,6 @@ localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
-opengl_LIBS = @opengl_LIBS@
 pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
diff --git a/gtk-doc.make b/gtk-doc.make
index 9841de4..e791656 100644
--- a/gtk-doc.make
+++ b/gtk-doc.make
@@ -49,9 +49,13 @@ REPORT_FILES = \
 	$(DOC_MODULE)-undeclared.txt \
 	$(DOC_MODULE)-unused.txt
 
-CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS)
+gtkdoc-check.test: Makefile
+	$(AM_V_GEN)echo "#!/bin/sh -e" > $@; \
+		echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \
+		chmod +x $@
+
+CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test
 
-if ENABLE_GTK_DOC
 if GTK_DOC_BUILD_HTML
 HTML_BUILD_STAMP=html-build.stamp
 else
@@ -63,9 +67,11 @@ else
 PDF_BUILD_STAMP=
 endif
 
-all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
-else
-all-local:
+all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
+.PHONY: all-gtk-doc
+
+if ENABLE_GTK_DOC
+all-local: all-gtk-doc
 endif
 
 docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
@@ -74,31 +80,42 @@ $(REPORT_FILES): sgml-build.stamp
 
 #### setup ####
 
+GTK_DOC_V_SETUP=$(GTK_DOC_V_SETUP_$(V))
+GTK_DOC_V_SETUP_=$(GTK_DOC_V_SETUP_$(AM_DEFAULT_VERBOSITY))
+GTK_DOC_V_SETUP_0=@echo "  DOC   Preparing build";
+
 setup-build.stamp:
-	- at if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
-	    echo '  DOC   Preparing build'; \
+	-$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
 	    files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \
 	    if test "x$$files" != "x" ; then \
 	        for file in $$files ; do \
+	            destdir=`dirname $(abs_builddir)/$$file`; \
+	            test -d "$$destdir" || mkdir -p "$$destdir"; \
 	            test -f $(abs_srcdir)/$$file && \
-	                cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \
+	                cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \
 	        done; \
 	    fi; \
 	fi
-	@touch setup-build.stamp
+	$(AM_V_at)touch setup-build.stamp
 
 
 #### scan ####
 
-scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
-	@echo '  DOC   Scanning header files'
-	@_source_dir='' ; \
+GTK_DOC_V_SCAN=$(GTK_DOC_V_SCAN_$(V))
+GTK_DOC_V_SCAN_=$(GTK_DOC_V_SCAN_$(AM_DEFAULT_VERBOSITY))
+GTK_DOC_V_SCAN_0=@echo "  DOC   Scanning header files";
+
+GTK_DOC_V_INTROSPECT=$(GTK_DOC_V_INTROSPECT_$(V))
+GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY))
+GTK_DOC_V_INTROSPECT_0=@echo "  DOC   Introspecting gobjects";
+
+scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB)
+	$(GTK_DOC_V_SCAN)_source_dir='' ; \
 	for i in $(DOC_SOURCE_DIR) ; do \
 	    _source_dir="$${_source_dir} --source-dir=$$i" ; \
 	done ; \
 	gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
-	@if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \
-	    echo "  DOC   Introspecting gobjects"; \
+	$(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \
 	    scanobj_options=""; \
 	    gtkdoc-scangobj 2>&1 --help | grep  >/dev/null "\-\-verbose"; \
 	    if test "$(?)" = "0"; then \
@@ -113,32 +130,41 @@ scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
 	        test -f $$i || touch $$i ; \
 	    done \
 	fi
-	@touch scan-build.stamp
+	$(AM_V_at)touch scan-build.stamp
 
 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp
 	@true
 
 #### xml ####
 
+GTK_DOC_V_XML=$(GTK_DOC_V_XML_$(V))
+GTK_DOC_V_XML_=$(GTK_DOC_V_XML_$(AM_DEFAULT_VERBOSITY))
+GTK_DOC_V_XML_0=@echo "  DOC   Building XML";
+
 sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files)
-	@echo '  DOC   Building XML'
-	@_source_dir='' ; \
+	$(GTK_DOC_V_XML)_source_dir='' ; \
 	for i in $(DOC_SOURCE_DIR) ; do \
 	    _source_dir="$${_source_dir} --source-dir=$$i" ; \
 	done ; \
 	gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS)
-	@touch sgml-build.stamp
+	$(AM_V_at)touch sgml-build.stamp
 
 sgml.stamp: sgml-build.stamp
 	@true
 
 #### html ####
 
+GTK_DOC_V_HTML=$(GTK_DOC_V_HTML_$(V))
+GTK_DOC_V_HTML_=$(GTK_DOC_V_HTML_$(AM_DEFAULT_VERBOSITY))
+GTK_DOC_V_HTML_0=@echo "  DOC   Building HTML";
+
+GTK_DOC_V_XREF=$(GTK_DOC_V_XREF_$(V))
+GTK_DOC_V_XREF_=$(GTK_DOC_V_XREF_$(AM_DEFAULT_VERBOSITY))
+GTK_DOC_V_XREF_0=@echo "  DOC   Fixing cross-references";
+
 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
-	@echo '  DOC   Building HTML'
-	@rm -rf html
-	@mkdir html
-	@mkhtml_options=""; \
+	$(GTK_DOC_V_HTML)rm -rf html && mkdir html && \
+	mkhtml_options=""; \
 	gtkdoc-mkhtml 2>&1 --help | grep  >/dev/null "\-\-verbose"; \
 	if test "$(?)" = "0"; then \
 	  if test "x$(V)" = "x1"; then \
@@ -159,16 +185,18 @@ html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
 	    cp $(abs_builddir)/$$file $(abs_builddir)/html; \
 	  fi; \
 	done;
-	@echo '  DOC   Fixing cross-references'
-	@gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
-	@touch html-build.stamp
+	$(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
+	$(AM_V_at)touch html-build.stamp
 
 #### pdf ####
 
+GTK_DOC_V_PDF=$(GTK_DOC_V_PDF_$(V))
+GTK_DOC_V_PDF_=$(GTK_DOC_V_PDF_$(AM_DEFAULT_VERBOSITY))
+GTK_DOC_V_PDF_0=@echo "  DOC   Building PDF";
+
 pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
-	@echo '  DOC   Building PDF'
-	@rm -f $(DOC_MODULE).pdf
-	@mkpdf_options=""; \
+	$(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \
+	mkpdf_options=""; \
 	gtkdoc-mkpdf 2>&1 --help | grep  >/dev/null "\-\-verbose"; \
 	if test "$(?)" = "0"; then \
 	  if test "x$(V)" = "x1"; then \
@@ -185,13 +213,16 @@ pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
 	  done; \
 	fi; \
 	gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
-	@touch pdf-build.stamp
+	$(AM_V_at)touch pdf-build.stamp
 
 ##############
 
 clean-local:
 	@rm -f *~ *.bak
 	@rm -rf .libs
+	@if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \
+	  rm -f $(DOC_MODULE).types; \
+	fi
 
 distclean-local:
 	@rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \
@@ -200,7 +231,7 @@ distclean-local:
 	    rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \
 	fi
 
-maintainer-clean-local: clean
+maintainer-clean-local:
 	@rm -rf xml html
 
 install-data-local:
@@ -236,15 +267,17 @@ uninstall-local:
 #
 # Require gtk-doc when making dist
 #
-if ENABLE_GTK_DOC
-dist-check-gtkdoc:
+if HAVE_GTK_DOC
+dist-check-gtkdoc: docs
 else
 dist-check-gtkdoc:
-	@echo "*** gtk-doc must be installed and enabled in order to make dist"
+	@echo "*** gtk-doc is needed to run 'make dist'.         ***"
+	@echo "*** gtk-doc was not found when 'configure' ran.   ***"
+	@echo "*** please install gtk-doc and rerun 'configure'. ***"
 	@false
 endif
 
-dist-hook: dist-check-gtkdoc dist-hook-local
+dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local
 	@mkdir $(distdir)/html
 	@cp ./html/* $(distdir)/html
 	@-cp ./$(DOC_MODULE).pdf $(distdir)/
diff --git a/gui/3d.ui b/gui/3d.ui
new file mode 100644
index 0000000..c07e60b
--- /dev/null
+++ b/gui/3d.ui
@@ -0,0 +1,260 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkFileChooserDialog" id="filechooserdialog1">
+    <property name="can_focus">False</property>
+    <property name="border_width">5</property>
+    <property name="type_hint">normal</property>
+    <property name="select_multiple">True</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">2</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="button2">
+                <property name="label">gtk-cancel</property>
+                <property name="use_action_appearance">False</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_stock">True</property>
+                <signal name="clicked" handler="hkl_gui_3d_button2_clicked_cb" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="button1">
+                <property name="label">gtk-apply</property>
+                <property name="use_action_appearance">False</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_stock">True</property>
+                <signal name="clicked" handler="hkl_gui_3d_button1_clicked_cb" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">button2</action-widget>
+      <action-widget response="0">button1</action-widget>
+    </action-widgets>
+  </object>
+  <object class="GtkFrame" id="frame1">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="label_xalign">0</property>
+    <property name="shadow_type">none</property>
+    <child>
+      <object class="GtkVPaned" id="vpaned1">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="position">181</property>
+        <property name="position_set">True</property>
+        <child>
+          <object class="GtkVBox" id="vbox1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <object class="GtkDrawingArea" id="drawingarea1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="events">GDK_EXPOSURE_MASK | GDK_STRUCTURE_MASK | GDK_SCROLL_MASK</property>
+                <signal name="scroll-event" handler="hkl_gui_3d_drawingarea1_scroll_event_cb" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="resize">False</property>
+            <property name="shrink">True</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkVBox" id="vbox2">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkToolbar" id="toolbar1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <child>
+                  <object class="GtkToolButton" id="toolbutton1">
+                    <property name="use_action_appearance">False</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="use_action_appearance">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="stock_id">gtk-add</property>
+                    <signal name="clicked" handler="hkl_gui_3d_toolbutton1_clicked_cb" swapped="no"/>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="homogeneous">True</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkToolButton" id="toolbutton2">
+                    <property name="use_action_appearance">False</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="use_action_appearance">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="stock_id">gtk-remove</property>
+                    <signal name="clicked" handler="hkl_gui_3d_toolbutton2_clicked_cb" swapped="no"/>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="homogeneous">True</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkToolButton" id="toolbutton3">
+                    <property name="use_action_appearance">False</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="use_action_appearance">False</property>
+                    <property name="label" translatable="yes">3D view Reinitialize</property>
+                    <property name="use_underline">True</property>
+                    <property name="stock_id">gtk-home</property>
+                    <signal name="clicked" handler="hkl_gui_3d_toolbutton3_clicked_cb" swapped="no"/>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="homogeneous">True</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkToggleToolButton" id="toolbutton4">
+                    <property name="use_action_appearance">False</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="use_action_appearance">False</property>
+                    <property name="label" translatable="yes">Aabb</property>
+                    <property name="use_underline">True</property>
+                    <property name="stock_id">gtk-apply</property>
+                    <signal name="toggled" handler="hkl_gui_3d_toolbutton4_toggled_cb" swapped="no"/>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="homogeneous">True</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkTreeView" id="treeview1">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="model">treestore1</property>
+                <property name="headers_clickable">False</property>
+                <property name="search_column">0</property>
+                <property name="enable_tree_lines">True</property>
+                <signal name="cursor-changed" handler="hkl_gui_3d_treeview1_cursor_changed_cb" swapped="no"/>
+                <child internal-child="selection">
+                  <object class="GtkTreeSelection" id="treeview-selection1"/>
+                </child>
+                <child>
+                  <object class="GtkTreeViewColumn" id="treeviewcolumn1">
+                    <property name="title">name</property>
+                    <child>
+                      <object class="GtkCellRendererText" id="cellrenderertext1"/>
+                      <attributes>
+                        <attribute name="text">0</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkTreeViewColumn" id="treeviewcolumn2">
+                    <property name="title">hide</property>
+                    <child>
+                      <object class="GtkCellRendererToggle" id="cellrenderertext2">
+                        <signal name="toggled" handler="hkl_gui_3d_cellrenderertext2_toggled_cb" swapped="no"/>
+                      </object>
+                      <attributes>
+                        <attribute name="active">1</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="resize">True</property>
+            <property name="shrink">True</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <child type="label">
+      <object class="GtkLabel" id="label2">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">3D</property>
+        <attributes>
+          <attribute name="weight" value="bold"/>
+        </attributes>
+      </object>
+    </child>
+  </object>
+  <object class="GtkTreeStore" id="treestore1">
+    <columns>
+      <!-- column-name name -->
+      <column type="gchararray"/>
+      <!-- column-name hide -->
+      <column type="gboolean"/>
+      <!-- column-name config -->
+      <column type="gpointer"/>
+      <!-- column-name object -->
+      <column type="gpointer"/>
+    </columns>
+  </object>
+</interface>
diff --git a/gui/Makefile.am b/gui/Makefile.am
index 6d25388..a16305f 100644
--- a/gui/Makefile.am
+++ b/gui/Makefile.am
@@ -1,64 +1,65 @@
-if HKL3D
-SUBDIRS = hkl3d
-endif
-
 bin_PROGRAMS = ghkl
 
-AM_CXXFLAGS = \
+AM_CFLAGS = \
 	-I$(top_srcdir) \
 	-I$(top_srcdir)/hkl \
 	-DPKGDATA=\""$(pkgdatadir)"\" \
 	$(GSL_CFLAGS) \
-	$(GTKMM_CFLAGS) \
-	-fpermissive
+	$(GLIB_CFLAGS) \
+	$(GTK_CFLAGS)
 
 AM_LDFLAGS = \
+	-Wl,--export-dynamic \
+	$(top_builddir)/hkl/libhkl.la \
 	$(GSL_LIBS) \
-	$(GTKMM_LIBS)
+	$(GLIB_LIBS) \
+	$(GTK_LIBS)
 
 ghkl_LDADD = \
 	$(top_builddir)/hkl/libhkl.la
 
 ghkl_SOURCES = \
-	hkl-gui.h \
-	hkl-gui.cpp \
-	hkl-gui-callbacks.cpp \
+	hkl-gui-macros.h \
+	hkl-gui-pseudoaxes.c \
 	hkl-gui-pseudoaxes.h \
-	hkl-gui-pseudoaxes.cpp \
-	hkl-gui-modelcolumns.h \
-	main.cpp
+	hkl-gui.c \
+	hkl-gui.h
+
+dist_pkgdata_DATA = ghkl.ui pseudo.ui
+
+appldir = ${datadir}/applications
+dist_appl_DATA = ghkl.desktop
 
 if HKL3D
-AM_CXXFLAGS += \
+AM_CFLAGS += \
 	-I$(top_srcdir)/hkl3d \
 	-I$(top_srcdir)/hkl3d/bullet/src \
-	-I$(top_srcdir)/gui/hkl3d \
-	-I$(top_srcdir)/gui/OpenGL \
 	-DHKL3D \
-	$(GTKGLEXTMM_CFLAGS)
+	$(G3D_CFLAGS) \
+	$(GTKGLEXT_CFLAGS) \
+	$(BULLET_CFLAGS)
 
-AM_LDFLAGS += \
-	$(GTKGLEXTMM_LIBS)
+AM_LDFLAGS += -lstdc++\
+	$(G3D_LIBS) \
+	$(GTKGLEXT_LIBS) \
+	$(BULLET_LIBS)
 
 ghkl_LDADD += \
-	$(top_builddir)/hkl3d/libhkl3d.la \
-	$(top_builddir)/gui/hkl3d/libhkl3d-gui.la \
-	$(top_builddir)/hkl3d/bullet/src/libbulletdynamics.la
+	$(top_builddir)/hkl3d/libhkl3d.la
 
 ghkl_SOURCES += \
-	hkl-gui-3d.h \
-	hkl-gui-3d.cpp
-
-endif
+	hkl-gui-3d-gl.c \
+	hkl-gui-3d-gl.h \
+	hkl-gui-3d.c \
+	hkl-gui-3d.h
 
-dist_pkgdata_DATA = ghkl.ui pseudo.ui
+dist_pkgdata_DATA += 3d.ui
 
-appldir = ${datadir}/applications
-dist_appl_DATA = ghkl.desktop
+endif
 
 # Support for GNU Flymake, in Emacs.
-check-syntax: AM_CXXFLAGS += -fsyntax-only -pipe
+check-syntax: AM_CFLAGS += -fsyntax-only -pipe
 check-syntax:
-	test -z "$(CHK_SOURCES)" || $(CXXCOMPILE) $(CHK_SOURCES)
+	test -z "$(CHK_SOURCES)" || $(COMPILE) $(CHK_SOURCES)
 
 .PHONY: check-syntax
diff --git a/gui/Makefile.in b/gui/Makefile.in
index 8f5e216..4944995 100644
--- a/gui/Makefile.in
+++ b/gui/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
@@ -83,27 +83,30 @@ bin_PROGRAMS = ghkl$(EXEEXT)
 @HKL3D_TRUE at am__append_1 = \
 @HKL3D_TRUE@	-I$(top_srcdir)/hkl3d \
 @HKL3D_TRUE@	-I$(top_srcdir)/hkl3d/bullet/src \
- at HKL3D_TRUE@	-I$(top_srcdir)/gui/hkl3d \
- at HKL3D_TRUE@	-I$(top_srcdir)/gui/OpenGL \
 @HKL3D_TRUE@	-DHKL3D \
- at HKL3D_TRUE@	$(GTKGLEXTMM_CFLAGS)
+ at HKL3D_TRUE@	$(G3D_CFLAGS) \
+ at HKL3D_TRUE@	$(GTKGLEXT_CFLAGS) \
+ at HKL3D_TRUE@	$(BULLET_CFLAGS)
 
- at HKL3D_TRUE@am__append_2 = \
- at HKL3D_TRUE@	$(GTKGLEXTMM_LIBS)
+ at HKL3D_TRUE@am__append_2 = -lstdc++\
+ at HKL3D_TRUE@	$(G3D_LIBS) \
+ at HKL3D_TRUE@	$(GTKGLEXT_LIBS) \
+ at HKL3D_TRUE@	$(BULLET_LIBS)
 
 @HKL3D_TRUE at am__append_3 = \
- at HKL3D_TRUE@	$(top_builddir)/hkl3d/libhkl3d.la \
- at HKL3D_TRUE@	$(top_builddir)/gui/hkl3d/libhkl3d-gui.la \
- at HKL3D_TRUE@	$(top_builddir)/hkl3d/bullet/src/libbulletdynamics.la
+ at HKL3D_TRUE@	$(top_builddir)/hkl3d/libhkl3d.la
 
 @HKL3D_TRUE at am__append_4 = \
- at HKL3D_TRUE@	hkl-gui-3d.h \
- at HKL3D_TRUE@	hkl-gui-3d.cpp
+ at HKL3D_TRUE@	hkl-gui-3d-gl.c \
+ at HKL3D_TRUE@	hkl-gui-3d-gl.h \
+ at HKL3D_TRUE@	hkl-gui-3d.c \
+ at HKL3D_TRUE@	hkl-gui-3d.h
 
+ at HKL3D_TRUE@am__append_5 = 3d.ui
 subdir = gui
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/config/depcomp $(dist_appl_DATA) \
-	$(dist_pkgdata_DATA)
+	$(am__dist_pkgdata_DATA_DIST)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
 	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
@@ -118,12 +121,13 @@ CONFIG_CLEAN_VPATH_FILES =
 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appldir)" \
 	"$(DESTDIR)$(pkgdatadir)"
 PROGRAMS = $(bin_PROGRAMS)
-am__ghkl_SOURCES_DIST = hkl-gui.h hkl-gui.cpp hkl-gui-callbacks.cpp \
-	hkl-gui-pseudoaxes.h hkl-gui-pseudoaxes.cpp \
-	hkl-gui-modelcolumns.h main.cpp hkl-gui-3d.h hkl-gui-3d.cpp
- at HKL3D_TRUE@am__objects_1 = hkl-gui-3d.$(OBJEXT)
-am_ghkl_OBJECTS = hkl-gui.$(OBJEXT) hkl-gui-callbacks.$(OBJEXT) \
-	hkl-gui-pseudoaxes.$(OBJEXT) main.$(OBJEXT) $(am__objects_1)
+am__ghkl_SOURCES_DIST = hkl-gui-macros.h hkl-gui-pseudoaxes.c \
+	hkl-gui-pseudoaxes.h hkl-gui.c hkl-gui.h hkl-gui-3d-gl.c \
+	hkl-gui-3d-gl.h hkl-gui-3d.c hkl-gui-3d.h
+ at HKL3D_TRUE@am__objects_1 = hkl-gui-3d-gl.$(OBJEXT) \
+ at HKL3D_TRUE@	hkl-gui-3d.$(OBJEXT)
+am_ghkl_OBJECTS = hkl-gui-pseudoaxes.$(OBJEXT) hkl-gui.$(OBJEXT) \
+	$(am__objects_1)
 ghkl_OBJECTS = $(am_ghkl_OBJECTS)
 ghkl_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la $(am__append_3)
 AM_V_lt = $(am__v_lt_ at AM_V@)
@@ -146,24 +150,6 @@ DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
 am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CXXFLAGS) $(CXXFLAGS)
-AM_V_CXX = $(am__v_CXX_ at AM_V@)
-am__v_CXX_ = $(am__v_CXX_ at AM_DEFAULT_V@)
-am__v_CXX_0 = @echo "  CXX     " $@;
-am__v_CXX_1 = 
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
-	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CXXLD = $(am__v_CXXLD_ at AM_V@)
-am__v_CXXLD_ = $(am__v_CXXLD_ at AM_DEFAULT_V@)
-am__v_CXXLD_0 = @echo "  CXXLD   " $@;
-am__v_CXXLD_1 = 
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
@@ -184,14 +170,6 @@ am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
 SOURCES = $(ghkl_SOURCES)
 DIST_SOURCES = $(am__ghkl_SOURCES_DIST)
-RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
-	ctags-recursive dvi-recursive html-recursive info-recursive \
-	install-data-recursive install-dvi-recursive \
-	install-exec-recursive install-html-recursive \
-	install-info-recursive install-pdf-recursive \
-	install-ps-recursive install-recursive installcheck-recursive \
-	installdirs-recursive pdf-recursive ps-recursive \
-	tags-recursive uninstall-recursive
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -224,15 +202,8 @@ am__uninstall_files_from_dir = { \
     || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
+am__dist_pkgdata_DATA_DIST = ghkl.ui pseudo.ui 3d.ui
 DATA = $(dist_appl_DATA) $(dist_pkgdata_DATA)
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-am__recursive_targets = \
-  $(RECURSIVE_TARGETS) \
-  $(RECURSIVE_CLEAN_TARGETS) \
-  $(am__extra_recursive_targets)
-AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
-	distdir
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
@@ -252,33 +223,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
-DIST_SUBDIRS = hkl3d
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
@@ -289,6 +234,8 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BULLET_CFLAGS = @BULLET_CFLAGS@
+BULLET_LIBS = @BULLET_LIBS@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
@@ -308,6 +255,7 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+EMACS = @EMACS@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
 G3D_CFLAGS = @G3D_CFLAGS@
@@ -327,14 +275,15 @@ GSL_CFLAGS = @GSL_CFLAGS@
 GSL_CONFIG = @GSL_CONFIG@
 GSL_LIBS = @GSL_LIBS@
 GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@
 GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
 GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
 GTKDOC_MKPDF = @GTKDOC_MKPDF@
 GTKDOC_REBASE = @GTKDOC_REBASE@
-GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
-GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
-GTKMM_CFLAGS = @GTKMM_CFLAGS@
-GTKMM_LIBS = @GTKMM_LIBS@
+GTKGLEXT_CFLAGS = @GTKGLEXT_CFLAGS@
+GTKGLEXT_LIBS = @GTKGLEXT_LIBS@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
 HTML_DIR = @HTML_DIR@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -430,7 +379,6 @@ localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
-opengl_LIBS = @opengl_LIBS@
 pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
@@ -445,22 +393,21 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 version_info = @version_info@
- at HKL3D_TRUE@SUBDIRS = hkl3d
-AM_CXXFLAGS = -I$(top_srcdir) -I$(top_srcdir)/hkl \
-	-DPKGDATA=\""$(pkgdatadir)"\" $(GSL_CFLAGS) $(GTKMM_CFLAGS) \
-	-fpermissive $(am__append_1)
-AM_LDFLAGS = $(GSL_LIBS) $(GTKMM_LIBS) $(am__append_2)
+AM_CFLAGS = -I$(top_srcdir) -I$(top_srcdir)/hkl \
+	-DPKGDATA=\""$(pkgdatadir)"\" $(GSL_CFLAGS) $(GLIB_CFLAGS) \
+	$(GTK_CFLAGS) $(am__append_1)
+AM_LDFLAGS = -Wl,--export-dynamic $(top_builddir)/hkl/libhkl.la \
+	$(GSL_LIBS) $(GLIB_LIBS) $(GTK_LIBS) $(am__append_2)
 ghkl_LDADD = $(top_builddir)/hkl/libhkl.la $(am__append_3)
-ghkl_SOURCES = hkl-gui.h hkl-gui.cpp hkl-gui-callbacks.cpp \
-	hkl-gui-pseudoaxes.h hkl-gui-pseudoaxes.cpp \
-	hkl-gui-modelcolumns.h main.cpp $(am__append_4)
-dist_pkgdata_DATA = ghkl.ui pseudo.ui
+ghkl_SOURCES = hkl-gui-macros.h hkl-gui-pseudoaxes.c \
+	hkl-gui-pseudoaxes.h hkl-gui.c hkl-gui.h $(am__append_4)
+dist_pkgdata_DATA = ghkl.ui pseudo.ui $(am__append_5)
 appldir = ${datadir}/applications
 dist_appl_DATA = ghkl.desktop
-all: all-recursive
+all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
+.SUFFIXES: .c .lo .o .obj
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
@@ -543,7 +490,7 @@ clean-binPROGRAMS:
 
 ghkl$(EXEEXT): $(ghkl_OBJECTS) $(ghkl_DEPENDENCIES) $(EXTRA_ghkl_DEPENDENCIES) 
 	@rm -f ghkl$(EXEEXT)
-	$(AM_V_CXXLD)$(CXXLINK) $(ghkl_OBJECTS) $(ghkl_LDADD) $(LIBS)
+	$(AM_V_CCLD)$(LINK) $(ghkl_OBJECTS) $(ghkl_LDADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -551,32 +498,34 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-gui-3d-gl.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-gui-3d.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-gui-callbacks.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-gui-pseudoaxes.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-gui.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/main.Po at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+ at am__fastdepCC_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+ at am__fastdepCC_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+ at am__fastdepCC_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -626,61 +575,14 @@ uninstall-dist_pkgdataDATA:
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
 	dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir)
 
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run 'make' without going through this Makefile.
-# To change the values of 'make' variables: instead of editing Makefiles,
-# (1) if the variable is set in 'config.status', edit 'config.status'
-#     (which will cause the Makefiles to be regenerated when you run 'make');
-# (2) otherwise, pass the desired values on the 'make' command line.
-$(am__recursive_targets):
-	@fail=; \
-	if $(am__make_keepgoing); then \
-	  failcom='fail=yes'; \
-	else \
-	  failcom='exit 1'; \
-	fi; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
 ID: $(am__tagged_files)
 	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-recursive
+tags: tags-am
 TAGS: tags
 
 tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	set x; \
 	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
 	$(am__define_uniq_tagged_files); \
 	shift; \
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
@@ -693,7 +595,7 @@ tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	      $$unique; \
 	  fi; \
 	fi
-ctags: ctags-recursive
+ctags: ctags-am
 
 CTAGS: ctags
 ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
@@ -706,7 +608,7 @@ GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-recursive
+cscopelist: cscopelist-am
 
 cscopelist-am: $(am__tagged_files)
 	list='$(am__tagged_files)'; \
@@ -755,48 +657,22 @@ distdir: $(DISTFILES)
 	    || exit 1; \
 	  fi; \
 	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    $(am__make_dryrun) \
-	      || test -d "$(distdir)/$$subdir" \
-	      || $(MKDIR_P) "$(distdir)/$$subdir" \
-	      || exit 1; \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
 check-am: all-am
-check: check-recursive
+check: check-am
 all-am: Makefile $(PROGRAMS) $(DATA)
-installdirs: installdirs-recursive
-installdirs-am:
+installdirs:
 	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appldir)" "$(DESTDIR)$(pkgdatadir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
 
 install-am: all-am
 	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
 
-installcheck: installcheck-recursive
+installcheck: installcheck-am
 install-strip:
 	if test -z '$(STRIP)'; then \
 	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
@@ -818,101 +694,100 @@ distclean-generic:
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
 	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
+clean: clean-am
 
 clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
 
-distclean: distclean-recursive
+distclean: distclean-am
 	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
 
-dvi: dvi-recursive
+dvi: dvi-am
 
 dvi-am:
 
-html: html-recursive
+html: html-am
 
 html-am:
 
-info: info-recursive
+info: info-am
 
 info-am:
 
 install-data-am: install-dist_applDATA install-dist_pkgdataDATA
 
-install-dvi: install-dvi-recursive
+install-dvi: install-dvi-am
 
 install-dvi-am:
 
 install-exec-am: install-binPROGRAMS
 
-install-html: install-html-recursive
+install-html: install-html-am
 
 install-html-am:
 
-install-info: install-info-recursive
+install-info: install-info-am
 
 install-info-am:
 
 install-man:
 
-install-pdf: install-pdf-recursive
+install-pdf: install-pdf-am
 
 install-pdf-am:
 
-install-ps: install-ps-recursive
+install-ps: install-ps-am
 
 install-ps-am:
 
 installcheck-am:
 
-maintainer-clean: maintainer-clean-recursive
+maintainer-clean: maintainer-clean-am
 	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
-mostlyclean: mostlyclean-recursive
+mostlyclean: mostlyclean-am
 
 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
 	mostlyclean-libtool
 
-pdf: pdf-recursive
+pdf: pdf-am
 
 pdf-am:
 
-ps: ps-recursive
+ps: ps-am
 
 ps-am:
 
 uninstall-am: uninstall-binPROGRAMS uninstall-dist_applDATA \
 	uninstall-dist_pkgdataDATA
 
-.MAKE: $(am__recursive_targets) install-am install-strip
-
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
-	check-am clean clean-binPROGRAMS clean-generic clean-libtool \
-	cscopelist-am ctags ctags-am distclean distclean-compile \
-	distclean-generic distclean-libtool distclean-tags distdir dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-binPROGRAMS install-data install-data-am \
-	install-dist_applDATA install-dist_pkgdataDATA install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	installdirs-am maintainer-clean maintainer-clean-generic \
-	mostlyclean mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
-	uninstall-am uninstall-binPROGRAMS uninstall-dist_applDATA \
-	uninstall-dist_pkgdataDATA
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+	clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
+	ctags ctags-am distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-binPROGRAMS \
+	install-data install-data-am install-dist_applDATA \
+	install-dist_pkgdataDATA install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \
+	uninstall-dist_applDATA uninstall-dist_pkgdataDATA
 
 
 # Support for GNU Flymake, in Emacs.
-check-syntax: AM_CXXFLAGS += -fsyntax-only -pipe
+check-syntax: AM_CFLAGS += -fsyntax-only -pipe
 check-syntax:
-	test -z "$(CHK_SOURCES)" || $(CXXCOMPILE) $(CHK_SOURCES)
+	test -z "$(CHK_SOURCES)" || $(COMPILE) $(CHK_SOURCES)
 
 .PHONY: check-syntax
 
diff --git a/gui/ghkl.ui b/gui/ghkl.ui
index 5c572fb..11881ed 100644
--- a/gui/ghkl.ui
+++ b/gui/ghkl.ui
@@ -1,233 +1,388 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <requires lib="gtk+" version="2.16"/>
-  <!-- interface-naming-policy project-wide -->
+  <!-- interface-requires gtk+ 3.0 -->
   <object class="GtkAdjustment" id="adjustment1">
-    <property name="value">1</property>
     <property name="lower">-100</property>
     <property name="upper">100</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment10">
-    <property name="value">1</property>
     <property name="lower">-180</property>
     <property name="upper">180</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment11">
-    <property name="value">1</property>
     <property name="lower">-180</property>
     <property name="upper">180</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment12">
-    <property name="value">1</property>
     <property name="lower">-180</property>
     <property name="upper">180</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment13">
-    <property name="value">1</property>
     <property name="lower">-180</property>
     <property name="upper">180</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment14">
-    <property name="value">1</property>
     <property name="lower">-180</property>
     <property name="upper">180</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment15">
-    <property name="value">1</property>
     <property name="lower">-180</property>
     <property name="upper">180</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment16">
-    <property name="value">1</property>
     <property name="lower">-180</property>
     <property name="upper">180</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment17">
-    <property name="value">1</property>
     <property name="lower">-180</property>
     <property name="upper">180</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment18">
-    <property name="value">1</property>
     <property name="lower">-180</property>
     <property name="upper">180</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment19">
-    <property name="value">1</property>
     <property name="lower">-180</property>
     <property name="upper">180</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment2">
-    <property name="value">1</property>
     <property name="lower">-100</property>
     <property name="upper">100</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment20">
-    <property name="value">1</property>
     <property name="lower">-180</property>
     <property name="upper">180</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment21">
-    <property name="value">1</property>
     <property name="lower">-180</property>
     <property name="upper">180</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment22">
-    <property name="value">1</property>
     <property name="lower">-180</property>
     <property name="upper">180</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment23">
-    <property name="value">1</property>
     <property name="lower">-180</property>
     <property name="upper">180</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment24">
-    <property name="value">1</property>
     <property name="upper">100</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment25">
-    <property name="value">1</property>
     <property name="upper">100</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment26">
-    <property name="value">1</property>
     <property name="upper">100</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment27">
-    <property name="value">1</property>
     <property name="upper">100</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment28">
-    <property name="value">1</property>
     <property name="upper">100</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment29">
-    <property name="value">1</property>
     <property name="upper">100</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment3">
+    <property name="lower">-100</property>
+    <property name="upper">100</property>
     <property name="value">-3</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment30">
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment31">
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment32">
+    <property name="lower">-180</property>
+    <property name="upper">180</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment33">
+    <property name="lower">-180</property>
+    <property name="upper">180</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment34">
+    <property name="lower">-180</property>
+    <property name="upper">180</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment35">
+    <property name="lower">-100</property>
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment36">
+    <property name="lower">-100</property>
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment37">
+    <property name="lower">-100</property>
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment38">
+    <property name="lower">-100</property>
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment39">
     <property name="lower">-100</property>
     <property name="upper">100</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment4">
+    <property name="upper">100</property>
     <property name="value">1</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment40">
+    <property name="lower">-100</property>
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment41">
+    <property name="lower">-100</property>
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment42">
+    <property name="lower">-100</property>
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment43">
+    <property name="lower">-100</property>
     <property name="upper">100</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment5">
-    <property name="value">1</property>
     <property name="upper">10000</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment6">
-    <property name="value">6</property>
     <property name="lower">-180</property>
     <property name="upper">180</property>
+    <property name="value">6</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment7">
-    <property name="value">1</property>
     <property name="lower">-180</property>
     <property name="upper">180</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment8">
-    <property name="value">1</property>
     <property name="lower">-180</property>
     <property name="upper">180</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment9">
-    <property name="value">1</property>
     <property name="lower">-180</property>
     <property name="upper">180</property>
+    <property name="value">1</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
-  <object class="GtkUIManager" id="uimanager1"/>
-  <object class="GtkListStore" id="liststore1">
+  <object class="GtkListStore" id="liststore_axis">
+    <columns>
+      <!-- column-name HklParameter -->
+      <column type="gpointer"/>
+      <!-- column-name name -->
+      <column type="gchararray"/>
+      <!-- column-name read -->
+      <column type="gdouble"/>
+      <!-- column-name write -->
+      <column type="gdouble"/>
+      <!-- column-name min -->
+      <column type="gdouble"/>
+      <!-- column-name max -->
+      <column type="gdouble"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="liststore_crystals">
+    <columns>
+      <!-- column-name sample -->
+      <column type="gpointer"/>
+      <!-- column-name name -->
+      <column type="gchararray"/>
+      <!-- column-name a -->
+      <column type="gdouble"/>
+      <!-- column-name b -->
+      <column type="gdouble"/>
+      <!-- column-name c -->
+      <column type="gdouble"/>
+      <!-- column-name alpha -->
+      <column type="gdouble"/>
+      <!-- column-name beta -->
+      <column type="gdouble"/>
+      <!-- column-name gamma -->
+      <column type="gdouble"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="liststore_diffractometer">
+    <columns>
+      <!-- column-name name -->
+      <column type="gchararray"/>
+      <!-- column-name HklFactory -->
+      <column type="gpointer"/>
+      <!-- column-name diffractometer_t -->
+      <column type="gpointer"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="liststore_pseudo_axes">
     <columns>
+      <!-- column-name idx -->
+      <column type="guint"/>
+      <!-- column-name HklEngine -->
+      <column type="gpointer"/>
       <!-- column-name name -->
       <column type="gchararray"/>
-      <!-- column-name type -->
-      <column type="gint"/>
+      <!-- column-name read -->
+      <column type="gdouble"/>
+      <!-- column-name write -->
+      <column type="gdouble"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="liststore_reflections">
+    <columns>
+      <!-- column-name index -->
+      <column type="guint"/>
+      <!-- column-name h -->
+      <column type="gdouble"/>
+      <!-- column-name k -->
+      <column type="gdouble"/>
+      <!-- column-name l -->
+      <column type="gdouble"/>
+      <!-- column-name flag -->
+      <column type="gboolean"/>
+      <!-- column-name reflection -->
+      <column type="gpointer"/>
     </columns>
   </object>
   <object class="GtkWindow" id="window1">
     <property name="visible">True</property>
+    <property name="can_focus">False</property>
     <property name="title" translatable="yes">gHKL</property>
     <child>
       <object class="GtkVBox" id="vbox1">
         <property name="visible">True</property>
-        <property name="orientation">vertical</property>
+        <property name="can_focus">False</property>
         <child>
           <object class="GtkMenuBar" id="menubar1">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
             <child>
               <object class="GtkMenuItem" id="menuitem1">
+                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="label" translatable="yes">_Fichier</property>
                 <property name="use_underline">True</property>
                 <child type="submenu">
                   <object class="GtkMenu" id="menu1">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <child>
                       <object class="GtkImageMenuItem" id="imagemenuitem1">
                         <property name="label">gtk-new</property>
+                        <property name="use_action_appearance">False</property>
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
                       </object>
@@ -235,7 +390,9 @@
                     <child>
                       <object class="GtkImageMenuItem" id="imagemenuitem2">
                         <property name="label">gtk-open</property>
+                        <property name="use_action_appearance">False</property>
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
                       </object>
@@ -243,7 +400,9 @@
                     <child>
                       <object class="GtkImageMenuItem" id="imagemenuitem3">
                         <property name="label">gtk-save</property>
+                        <property name="use_action_appearance">False</property>
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
                       </object>
@@ -251,7 +410,9 @@
                     <child>
                       <object class="GtkImageMenuItem" id="imagemenuitem4">
                         <property name="label">gtk-save-as</property>
+                        <property name="use_action_appearance">False</property>
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
                       </object>
@@ -259,15 +420,18 @@
                     <child>
                       <object class="GtkSeparatorMenuItem" id="separatormenuitem1">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                       </object>
                     </child>
                     <child>
                       <object class="GtkImageMenuItem" id="imagemenuitem5">
                         <property name="label">gtk-quit</property>
+                        <property name="use_action_appearance">False</property>
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
-                        <signal name="activate" handler="gtk_main_quit"/>
+                        <signal name="activate" handler="gtk_main_quit" swapped="no"/>
                       </object>
                     </child>
                   </object>
@@ -276,16 +440,21 @@
             </child>
             <child>
               <object class="GtkMenuItem" id="menuitem2">
+                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">&#xC9;_dition</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">É_dition</property>
                 <property name="use_underline">True</property>
                 <child type="submenu">
                   <object class="GtkMenu" id="menu2">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <child>
                       <object class="GtkImageMenuItem" id="imagemenuitem6">
                         <property name="label">gtk-cut</property>
+                        <property name="use_action_appearance">False</property>
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
                       </object>
@@ -293,7 +462,9 @@
                     <child>
                       <object class="GtkImageMenuItem" id="imagemenuitem7">
                         <property name="label">gtk-copy</property>
+                        <property name="use_action_appearance">False</property>
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
                       </object>
@@ -301,7 +472,9 @@
                     <child>
                       <object class="GtkImageMenuItem" id="imagemenuitem8">
                         <property name="label">gtk-paste</property>
+                        <property name="use_action_appearance">False</property>
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
                       </object>
@@ -309,7 +482,9 @@
                     <child>
                       <object class="GtkImageMenuItem" id="imagemenuitem9">
                         <property name="label">gtk-delete</property>
+                        <property name="use_action_appearance">False</property>
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
                       </object>
@@ -317,7 +492,9 @@
                     <child>
                       <object class="GtkImageMenuItem" id="menuitem5">
                         <property name="label">gtk-preferences</property>
+                        <property name="use_action_appearance">False</property>
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
                       </object>
@@ -328,23 +505,30 @@
             </child>
             <child>
               <object class="GtkMenuItem" id="menuitem3">
+                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="label" translatable="yes">_Affichage</property>
                 <property name="use_underline">True</property>
               </object>
             </child>
             <child>
               <object class="GtkMenuItem" id="menuitem4">
+                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="label" translatable="yes">Aid_e</property>
                 <property name="use_underline">True</property>
                 <child type="submenu">
                   <object class="GtkMenu" id="menu3">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <child>
                       <object class="GtkImageMenuItem" id="imagemenuitem10">
                         <property name="label">gtk-about</property>
+                        <property name="use_action_appearance">False</property>
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
                       </object>
@@ -356,97 +540,208 @@
           </object>
           <packing>
             <property name="expand">False</property>
+            <property name="fill">True</property>
             <property name="position">0</property>
           </packing>
         </child>
         <child>
           <object class="GtkHPaned" id="hpaned1">
             <property name="visible">True</property>
-            <property name="can_focus">True</property>
+            <property name="can_focus">False</property>
             <child>
               <object class="GtkVBox" id="vbox3">
                 <property name="visible">True</property>
-                <property name="orientation">vertical</property>
+                <property name="can_focus">False</property>
                 <child>
-                  <object class="GtkFrame" id="frame12">
+                  <object class="GtkHBox" id="box1">
                     <property name="visible">True</property>
-                    <property name="border_width">6</property>
-                    <property name="label_xalign">0</property>
-                    <property name="shadow_type">none</property>
+                    <property name="can_focus">False</property>
                     <child>
-                      <object class="GtkAlignment" id="alignment13">
+                      <object class="GtkFrame" id="frame2">
                         <property name="visible">True</property>
-                        <property name="top_padding">6</property>
-                        <property name="bottom_padding">6</property>
-                        <property name="left_padding">12</property>
+                        <property name="can_focus">False</property>
+                        <property name="label_xalign">0</property>
+                        <property name="shadow_type">none</property>
                         <child>
-                          <object class="GtkTreeView" id="treeview_axes">
+                          <object class="GtkAlignment" id="alignment3">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="rules_hint">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="left_padding">12</property>
+                            <child>
+                              <object class="GtkComboBox" id="combobox1">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="model">liststore_diffractometer</property>
+                                <property name="tearoff_title">Diffractometer Type</property>
+                                <signal name="changed" handler="hkl_gui_window_combobox1_changed_cb" swapped="no"/>
+                                <child>
+                                  <object class="GtkCellRendererText" id="cellrenderertext1"/>
+                                  <attributes>
+                                    <attribute name="text">0</attribute>
+                                  </attributes>
+                                </child>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                        <child type="label">
+                          <object class="GtkLabel" id="label17">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes"><b>Diffractometer</b></property>
+                            <property name="use_markup">True</property>
                           </object>
                         </child>
                       </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
                     </child>
-                    <child type="label">
-                      <object class="GtkLabel" id="label58">
+                    <child>
+                      <object class="GtkFrame" id="frame3">
                         <property name="visible">True</property>
-                        <property name="label" translatable="yes"><b>Axes</b></property>
-                        <property name="use_markup">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label_xalign">0</property>
+                        <property name="shadow_type">none</property>
+                        <child>
+                          <object class="GtkAlignment" id="alignment4">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="left_padding">12</property>
+                            <child>
+                              <object class="GtkSpinButton" id="spinbutton_lambda">
+                                <property name="visible">True</property>
+                                <property name="sensitive">False</property>
+                                <property name="can_focus">True</property>
+                                <property name="invisible_char">●</property>
+                                <property name="invisible_char_set">True</property>
+                                <property name="adjustment">adjustment4</property>
+                                <property name="climb_rate">1</property>
+                                <property name="digits">3</property>
+                                <signal name="value-changed" handler="hkl_gui_window_spinbutton_lambda_value_changed_cb" swapped="no"/>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                        <child type="label">
+                          <object class="GtkLabel" id="label1">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes"><b>Wave length</b></property>
+                            <property name="use_markup">True</property>
+                          </object>
+                        </child>
                       </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
                     </child>
                   </object>
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">False</property>
-                    <property name="position">0</property>
+                    <property name="position">1</property>
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkFrame" id="frame13">
+                  <object class="GtkFrame" id="frame12">
                     <property name="visible">True</property>
-                    <property name="no_show_all">True</property>
-                    <property name="border_width">6</property>
+                    <property name="can_focus">False</property>
                     <property name="label_xalign">0</property>
                     <property name="shadow_type">none</property>
                     <child>
-                      <object class="GtkAlignment" id="alignment14">
+                      <object class="GtkAlignment" id="alignment13">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="top_padding">6</property>
                         <property name="bottom_padding">6</property>
                         <property name="left_padding">12</property>
                         <child>
-                          <object class="GtkVBox" id="vbox8">
+                          <object class="GtkTreeView" id="treeview_axes">
                             <property name="visible">True</property>
-                            <property name="orientation">vertical</property>
+                            <property name="can_focus">True</property>
+                            <property name="model">liststore_axis</property>
+                            <property name="rules_hint">True</property>
+                            <child internal-child="selection">
+                              <object class="GtkTreeSelection" id="treeview-selection1"/>
+                            </child>
                             <child>
-                              <object class="GtkTreeView" id="treeview_pseudoAxes">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="rules_hint">True</property>
+                              <object class="GtkTreeViewColumn" id="treeviewcolumn1">
+                                <property name="title" translatable="yes">name</property>
+                                <child>
+                                  <object class="GtkCellRendererText" id="cellrenderertext2"/>
+                                  <attributes>
+                                    <attribute name="text">1</attribute>
+                                  </attributes>
+                                </child>
                               </object>
-                              <packing>
-                                <property name="position">0</property>
-                              </packing>
                             </child>
                             <child>
-                              <object class="GtkTreeView" id="treeview_pseudoAxes_parameters">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="rules_hint">True</property>
+                              <object class="GtkTreeViewColumn" id="treeviewcolumn2">
+                                <property name="title" translatable="yes">read</property>
+                                <child>
+                                  <object class="GtkCellRendererText" id="cellrendererspin1">
+                                    <property name="editable">True</property>
+                                    <signal name="edited" handler="hkl_gui_window_cellrendererspin1_edited_cb" swapped="no"/>
+                                  </object>
+                                  <attributes>
+                                    <attribute name="text">2</attribute>
+                                  </attributes>
+                                </child>
+                              </object>
+                            </child>
+                            <child>
+                              <object class="GtkTreeViewColumn" id="treeviewcolumn3">
+                                <property name="title" translatable="yes">write</property>
+                                <child>
+                                  <object class="GtkCellRendererSpin" id="cellrendererspin2"/>
+                                  <attributes>
+                                    <attribute name="text">3</attribute>
+                                  </attributes>
+                                </child>
+                              </object>
+                            </child>
+                            <child>
+                              <object class="GtkTreeViewColumn" id="treeviewcolumn6">
+                                <property name="title" translatable="yes">min</property>
+                                <child>
+                                  <object class="GtkCellRendererText" id="cellrendererspin3">
+                                    <property name="editable">True</property>
+                                    <signal name="edited" handler="hkl_gui_window_cellrendererspin3_edited_cb" swapped="no"/>
+                                  </object>
+                                  <attributes>
+                                    <attribute name="text">4</attribute>
+                                  </attributes>
+                                </child>
+                              </object>
+                            </child>
+                            <child>
+                              <object class="GtkTreeViewColumn" id="treeviewcolumn4">
+                                <property name="title" translatable="yes">max</property>
+                                <child>
+                                  <object class="GtkCellRendererText" id="cellrendererspin4">
+                                    <property name="editable">True</property>
+                                    <signal name="edited" handler="hkl_gui_window_cellrendererspin4_edited_cb" swapped="no"/>
+                                  </object>
+                                  <attributes>
+                                    <attribute name="text">5</attribute>
+                                  </attributes>
+                                </child>
                               </object>
-                              <packing>
-                                <property name="position">1</property>
-                              </packing>
                             </child>
                           </object>
                         </child>
                       </object>
                     </child>
                     <child type="label">
-                      <object class="GtkLabel" id="label59">
+                      <object class="GtkLabel" id="label58">
                         <property name="visible">True</property>
-                        <property name="label" translatable="yes"><b>PseudoAxes</b></property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes"><b>Axes</b></property>
                         <property name="use_markup">True</property>
                       </object>
                     </child>
@@ -454,25 +749,121 @@
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">False</property>
-                    <property name="position">1</property>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkFrame" id="frame13">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label_xalign">0</property>
+                    <property name="shadow_type">none</property>
+                    <child>
+                      <object class="GtkAlignment" id="alignment14">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="top_padding">6</property>
+                        <property name="bottom_padding">6</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <object class="GtkTreeView" id="treeview_pseudo_axes">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="model">liststore_pseudo_axes</property>
+                            <property name="rules_hint">True</property>
+                            <child internal-child="selection">
+                              <object class="GtkTreeSelection" id="treeview-selection2"/>
+                            </child>
+                            <child>
+                              <object class="GtkTreeViewColumn" id="treeviewcolumn5">
+                                <property name="title" translatable="yes">name</property>
+                                <child>
+                                  <object class="GtkCellRendererText" id="cellrenderertext3"/>
+                                  <attributes>
+                                    <attribute name="text">2</attribute>
+                                  </attributes>
+                                </child>
+                              </object>
+                            </child>
+                            <child>
+                              <object class="GtkTreeViewColumn" id="treeviewcolumn7">
+                                <property name="title" translatable="yes">read</property>
+                                <child>
+                                  <object class="GtkCellRendererText" id="cellrenderertext4"/>
+                                  <attributes>
+                                    <attribute name="text">3</attribute>
+                                  </attributes>
+                                </child>
+                              </object>
+                            </child>
+                            <child>
+                              <object class="GtkTreeViewColumn" id="treeviewcolumn8">
+                                <property name="title" translatable="yes">write</property>
+                                <child>
+                                  <object class="GtkCellRendererText" id="cellrenderertext5">
+                                    <property name="editable">True</property>
+                                    <signal name="edited" handler="hkl_gui_window_cellrenderertext5_edited_cb" swapped="no"/>
+                                  </object>
+                                  <attributes>
+                                    <attribute name="text">4</attribute>
+                                  </attributes>
+                                </child>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                    <child type="label">
+                      <object class="GtkLabel" id="label59">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes"><b>PseudoAxes</b></property>
+                        <property name="use_markup">True</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">3</property>
                   </packing>
                 </child>
                 <child>
-                  <placeholder/>
-                </child>
-                <child>
                   <object class="GtkFrame" id="frame1">
                     <property name="visible">True</property>
-                    <property name="border_width">6</property>
+                    <property name="can_focus">False</property>
                     <property name="label_xalign">0</property>
+                    <property name="shadow_type">none</property>
                     <child>
                       <object class="GtkAlignment" id="alignment1">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="left_padding">12</property>
                         <child>
-                          <object class="GtkTreeView" id="treeview1">
+                          <object class="GtkVBox" id="box_info_bar">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="spacing">2</property>
+                            <child>
+                              <object class="GtkTreeView" id="treeview_solutions">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="rules_hint">True</property>
+                                <signal name="cursor-changed" handler="hkl_gui_window_treeview_solutions_cursor_changed_cb" swapped="no"/>
+                                <child internal-child="selection">
+                                  <object class="GtkTreeSelection" id="treeview-selection4"/>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
                           </object>
                         </child>
                       </object>
@@ -480,13 +871,16 @@
                     <child type="label">
                       <object class="GtkLabel" id="label5">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="label" translatable="yes"><b>Solutions</b></property>
                         <property name="use_markup">True</property>
                       </object>
                     </child>
                   </object>
                   <packing>
-                    <property name="position">3</property>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
+                    <property name="position">4</property>
                   </packing>
                 </child>
               </object>
@@ -499,41 +893,26 @@
               <object class="GtkNotebook" id="notebook2">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <child>
-                  <object class="GtkVBox" id="vbox2">
-                    <property name="visible">True</property>
-                    <property name="orientation">vertical</property>
-                    <child>
-                      <placeholder/>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child type="tab">
-                  <object class="GtkLabel" id="label11">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">pseudo axes</property>
-                  </object>
-                  <packing>
-                    <property name="tab_fill">False</property>
-                  </packing>
-                </child>
+                <property name="scrollable">True</property>
                 <child>
                   <object class="GtkVBox" id="vbox_crystals">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="border_width">6</property>
-                    <property name="orientation">vertical</property>
                     <property name="spacing">6</property>
                     <child>
                       <object class="GtkToolbar" id="toolbar2">
                         <property name="visible">True</property>
+                        <property name="can_focus">False</property>
                         <property name="toolbar_style">both</property>
                         <child>
                           <object class="GtkToolButton" id="toolbutton_add_crystal">
+                            <property name="use_action_appearance">False</property>
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="use_action_appearance">False</property>
                             <property name="stock_id">gtk-add</property>
+                            <signal name="clicked" handler="hkl_gui_window_toolbutton_add_crystal_clicked_cb" swapped="no"/>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -542,8 +921,12 @@
                         </child>
                         <child>
                           <object class="GtkToolButton" id="toolbutton_copy_crystal">
+                            <property name="use_action_appearance">False</property>
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="use_action_appearance">False</property>
                             <property name="stock_id">gtk-copy</property>
+                            <signal name="clicked" handler="hkl_gui_window_toolbutton_copy_crystal_clicked_cb" swapped="no"/>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -552,8 +935,12 @@
                         </child>
                         <child>
                           <object class="GtkToolButton" id="toolbutton_del_crystal">
+                            <property name="use_action_appearance">False</property>
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="use_action_appearance">False</property>
                             <property name="stock_id">gtk-delete</property>
+                            <signal name="clicked" handler="hkl_gui_window_toolbutton_del_crystal_clicked_cb" swapped="no"/>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -563,6 +950,7 @@
                         <child>
                           <object class="GtkSeparatorToolItem" id="separatortoolitem2">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -570,10 +958,14 @@
                         </child>
                         <child>
                           <object class="GtkToolButton" id="toolbutton_setUB">
+                            <property name="use_action_appearance">False</property>
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="use_action_appearance">False</property>
                             <property name="label" translatable="yes">set UB</property>
                             <property name="use_underline">True</property>
                             <property name="stock_id">gtk-preferences</property>
+                            <signal name="clicked" handler="hkl_gui_window_toolbutton_setUB_clicked_cb" swapped="no"/>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -582,10 +974,14 @@
                         </child>
                         <child>
                           <object class="GtkToolButton" id="toolbutton_computeUB">
+                            <property name="use_action_appearance">False</property>
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="use_action_appearance">False</property>
                             <property name="label" translatable="yes">Compute UB</property>
                             <property name="use_underline">True</property>
                             <property name="stock_id">gtk-execute</property>
+                            <signal name="clicked" handler="hkl_gui_window_toolbutton_computeUB_clicked_cb" swapped="no"/>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -594,10 +990,14 @@
                         </child>
                         <child>
                           <object class="GtkToolButton" id="toolbutton_affiner">
+                            <property name="use_action_appearance">False</property>
                             <property name="visible">True</property>
-                            <property name="label" translatable="yes">Affiner</property>
+                            <property name="can_focus">False</property>
+                            <property name="use_action_appearance">False</property>
+                            <property name="label" translatable="yes">Refine</property>
                             <property name="use_underline">True</property>
                             <property name="stock_id">gtk-execute</property>
+                            <signal name="clicked" handler="hkl_gui_window_toolbutton_affiner_clicked_cb" swapped="no"/>
                           </object>
                           <packing>
                             <property name="expand">False</property>
@@ -621,10 +1021,97 @@
                           <object class="GtkTreeView" id="treeview_crystals">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
+                            <property name="model">liststore_crystals</property>
+                            <signal name="cursor-changed" handler="hkl_gui_window_treeview_crystals_cursor_changed_cb" swapped="no"/>
+                            <child internal-child="selection">
+                              <object class="GtkTreeSelection" id="treeview-selection5"/>
+                            </child>
+                            <child>
+                              <object class="GtkTreeViewColumn" id="treeviewcolumn14">
+                                <property name="title" translatable="yes">name</property>
+                                <child>
+                                  <object class="GtkCellRendererText" id="cellrenderertext10">
+                                    <property name="editable">True</property>
+                                    <signal name="edited" handler="hkl_gui_window_cellrenderertext10_edited_cb" swapped="no"/>
+                                  </object>
+                                  <attributes>
+                                    <attribute name="text">1</attribute>
+                                  </attributes>
+                                </child>
+                              </object>
+                            </child>
+                            <child>
+                              <object class="GtkTreeViewColumn" id="treeviewcolumn15">
+                                <property name="title" translatable="yes">a</property>
+                                <child>
+                                  <object class="GtkCellRendererText" id="cellrenderertext11"/>
+                                  <attributes>
+                                    <attribute name="text">2</attribute>
+                                  </attributes>
+                                </child>
+                              </object>
+                            </child>
+                            <child>
+                              <object class="GtkTreeViewColumn" id="treeviewcolumn16">
+                                <property name="title" translatable="yes">b</property>
+                                <child>
+                                  <object class="GtkCellRendererText" id="cellrenderertext12"/>
+                                  <attributes>
+                                    <attribute name="text">3</attribute>
+                                  </attributes>
+                                </child>
+                              </object>
+                            </child>
+                            <child>
+                              <object class="GtkTreeViewColumn" id="treeviewcolumn17">
+                                <property name="title" translatable="yes">c</property>
+                                <child>
+                                  <object class="GtkCellRendererText" id="cellrenderertext13"/>
+                                  <attributes>
+                                    <attribute name="text">4</attribute>
+                                  </attributes>
+                                </child>
+                              </object>
+                            </child>
+                            <child>
+                              <object class="GtkTreeViewColumn" id="treeviewcolumn18">
+                                <property name="title" translatable="yes">alpha</property>
+                                <child>
+                                  <object class="GtkCellRendererText" id="cellrenderertext14"/>
+                                  <attributes>
+                                    <attribute name="text">5</attribute>
+                                  </attributes>
+                                </child>
+                              </object>
+                            </child>
+                            <child>
+                              <object class="GtkTreeViewColumn" id="treeviewcolumn19">
+                                <property name="title" translatable="yes">beta</property>
+                                <child>
+                                  <object class="GtkCellRendererText" id="cellrenderertext15"/>
+                                  <attributes>
+                                    <attribute name="text">6</attribute>
+                                  </attributes>
+                                </child>
+                              </object>
+                            </child>
+                            <child>
+                              <object class="GtkTreeViewColumn" id="treeviewcolumn20">
+                                <property name="title" translatable="yes">gamma</property>
+                                <child>
+                                  <object class="GtkCellRendererText" id="cellrenderertext16"/>
+                                  <attributes>
+                                    <attribute name="text">7</attribute>
+                                  </attributes>
+                                </child>
+                              </object>
+                            </child>
                           </object>
                         </child>
                       </object>
                       <packing>
+                        <property name="expand">True</property>
+                        <property name="fill">True</property>
                         <property name="position">1</property>
                       </packing>
                     </child>
@@ -633,1090 +1120,1056 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <child>
-                          <object class="GtkVBox" id="vbox4">
+                          <object class="GtkVBox" id="vbox6">
                             <property name="visible">True</property>
-                            <property name="orientation">vertical</property>
-                            <property name="spacing">3</property>
+                            <property name="can_focus">False</property>
                             <child>
-                              <object class="GtkToolbar" id="toolbar1">
+                              <object class="GtkFrame" id="frame4">
                                 <property name="visible">True</property>
-                                <property name="toolbar_style">both</property>
+                                <property name="can_focus">False</property>
+                                <property name="label_xalign">0</property>
+                                <property name="shadow_type">none</property>
                                 <child>
-                                  <object class="GtkToolButton" id="toolbutton_add_reflection">
-                                    <property name="visible">True</property>
-                                    <property name="stock_id">gtk-add</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="homogeneous">True</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkToolButton" id="toolbutton_goto_reflection">
-                                    <property name="visible">True</property>
-                                    <property name="stock_id">gtk-jump-to</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="homogeneous">True</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkToolButton" id="toolbutton_del_reflection">
+                                  <object class="GtkAlignment" id="alignment5">
                                     <property name="visible">True</property>
-                                    <property name="stock_id">gtk-delete</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="left_padding">12</property>
+                                    <child>
+                                      <object class="GtkTable" id="table4">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="n_rows">4</property>
+                                        <property name="n_columns">4</property>
+                                        <property name="column_spacing">3</property>
+                                        <property name="row_spacing">3</property>
+                                        <child>
+                                          <object class="GtkLabel" id="label_UB23">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="xalign">0</property>
+                                            <property name="label" translatable="yes">label37</property>
+                                            <property name="use_markup">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="left_attach">3</property>
+                                            <property name="right_attach">4</property>
+                                            <property name="top_attach">2</property>
+                                            <property name="bottom_attach">3</property>
+                                            <property name="x_options">GTK_FILL</property>
+                                            <property name="y_options"/>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkLabel" id="label_UB13">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="xalign">0</property>
+                                            <property name="label" translatable="yes">label34</property>
+                                            <property name="use_markup">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="left_attach">3</property>
+                                            <property name="right_attach">4</property>
+                                            <property name="top_attach">1</property>
+                                            <property name="bottom_attach">2</property>
+                                            <property name="x_options">GTK_FILL</property>
+                                            <property name="y_options"/>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkLabel" id="label4">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label" translatable="yes"><b>z</b></property>
+                                            <property name="use_markup">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="top_attach">3</property>
+                                            <property name="bottom_attach">4</property>
+                                            <property name="x_options"/>
+                                            <property name="y_options"/>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkLabel" id="label3">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label" translatable="yes"><b>x</b></property>
+                                            <property name="use_markup">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="top_attach">1</property>
+                                            <property name="bottom_attach">2</property>
+                                            <property name="x_options"/>
+                                            <property name="y_options"/>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkLabel" id="label_UB33">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="xalign">0</property>
+                                            <property name="label" translatable="yes">label40</property>
+                                            <property name="use_markup">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="left_attach">3</property>
+                                            <property name="right_attach">4</property>
+                                            <property name="top_attach">3</property>
+                                            <property name="bottom_attach">4</property>
+                                            <property name="x_options">GTK_FILL</property>
+                                            <property name="y_options"/>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkLabel" id="label_UB32">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="xalign">0</property>
+                                            <property name="label" translatable="yes">label39</property>
+                                            <property name="use_markup">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="left_attach">2</property>
+                                            <property name="right_attach">3</property>
+                                            <property name="top_attach">3</property>
+                                            <property name="bottom_attach">4</property>
+                                            <property name="x_options">GTK_FILL</property>
+                                            <property name="y_options"/>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkLabel" id="label_UB31">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="xalign">0</property>
+                                            <property name="label" translatable="yes">label38</property>
+                                            <property name="use_markup">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="left_attach">1</property>
+                                            <property name="right_attach">2</property>
+                                            <property name="top_attach">3</property>
+                                            <property name="bottom_attach">4</property>
+                                            <property name="x_options">GTK_FILL</property>
+                                            <property name="y_options"/>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkLabel" id="label6">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label" translatable="yes"><b>y</b></property>
+                                            <property name="use_markup">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="top_attach">2</property>
+                                            <property name="bottom_attach">3</property>
+                                            <property name="x_options"/>
+                                            <property name="y_options"/>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkLabel" id="label_UB22">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="xalign">0</property>
+                                            <property name="label" translatable="yes">label36</property>
+                                            <property name="use_markup">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="left_attach">2</property>
+                                            <property name="right_attach">3</property>
+                                            <property name="top_attach">2</property>
+                                            <property name="bottom_attach">3</property>
+                                            <property name="x_options">GTK_FILL</property>
+                                            <property name="y_options"/>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkLabel" id="label_UB21">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="xalign">0</property>
+                                            <property name="label" translatable="yes">label35</property>
+                                            <property name="use_markup">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="left_attach">1</property>
+                                            <property name="right_attach">2</property>
+                                            <property name="top_attach">2</property>
+                                            <property name="bottom_attach">3</property>
+                                            <property name="x_options">GTK_FILL</property>
+                                            <property name="y_options"/>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkLabel" id="label_UB12">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="xalign">0</property>
+                                            <property name="label" translatable="yes">label33</property>
+                                            <property name="use_markup">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="left_attach">2</property>
+                                            <property name="right_attach">3</property>
+                                            <property name="top_attach">1</property>
+                                            <property name="bottom_attach">2</property>
+                                            <property name="x_options">GTK_FILL</property>
+                                            <property name="y_options"/>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkLabel" id="label_UB11">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="xalign">0</property>
+                                            <property name="label" translatable="yes">label32</property>
+                                            <property name="use_markup">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="left_attach">1</property>
+                                            <property name="right_attach">2</property>
+                                            <property name="top_attach">1</property>
+                                            <property name="bottom_attach">2</property>
+                                            <property name="x_options">GTK_FILL</property>
+                                            <property name="y_options"/>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkLabel" id="label12">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label" translatable="yes"><b>a*</b></property>
+                                            <property name="use_markup">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="left_attach">1</property>
+                                            <property name="right_attach">2</property>
+                                            <property name="x_options"/>
+                                            <property name="y_options"/>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkLabel" id="label13">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label" translatable="yes"><b>b*</b></property>
+                                            <property name="use_markup">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="left_attach">2</property>
+                                            <property name="right_attach">3</property>
+                                            <property name="x_options"/>
+                                            <property name="y_options"/>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkLabel" id="label14">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label" translatable="yes"><b>c*</b></property>
+                                            <property name="use_markup">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="left_attach">3</property>
+                                            <property name="right_attach">4</property>
+                                            <property name="x_options"/>
+                                            <property name="y_options"/>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                      </object>
+                                    </child>
                                   </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="homogeneous">True</property>
-                                  </packing>
                                 </child>
-                                <child>
-                                  <object class="GtkSeparatorToolItem" id="separatortoolitem1">
+                                <child type="label">
+                                  <object class="GtkLabel" id="label7">
                                     <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label" translatable="yes"><b>UB</b></property>
+                                    <property name="use_markup">True</property>
                                   </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                  </packing>
                                 </child>
                               </object>
                               <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
                                 <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkScrolledWindow" id="scrolledwindow1">
+                              <object class="GtkTable" id="table2">
                                 <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="hscrollbar_policy">never</property>
-                                <property name="shadow_type">in</property>
+                                <property name="can_focus">False</property>
+                                <property name="n_rows">10</property>
+                                <property name="n_columns">4</property>
                                 <child>
-                                  <object class="GtkTreeView" id="treeview_reflections">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="rules_hint">True</property>
-                                  </object>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
                                 </child>
-                              </object>
-                              <packing>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                          </object>
-                        </child>
-                        <child type="tab">
-                          <object class="GtkLabel" id="label16">
-                            <property name="visible">True</property>
-                            <property name="label" translatable="yes">reflections</property>
-                          </object>
-                          <packing>
-                            <property name="tab_fill">False</property>
-                            <property name="reorderable">True</property>
-                            <property name="detachable">True</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkVBox" id="vbox5">
-                            <property name="visible">True</property>
-                            <property name="orientation">vertical</property>
-                            <child>
-                              <object class="GtkTable" id="table4">
-                                <property name="visible">True</property>
-                                <property name="n_rows">4</property>
-                                <property name="n_columns">4</property>
-                                <property name="column_spacing">3</property>
-                                <property name="row_spacing">3</property>
                                 <child>
-                                  <object class="GtkLabel" id="label_UB23">
+                                  <object class="GtkSpinButton" id="spinbutton_a">
                                     <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">label37</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">●</property>
+                                    <property name="adjustment">adjustment6</property>
+                                    <property name="climb_rate">1</property>
+                                    <property name="digits">3</property>
+                                    <property name="numeric">True</property>
+                                    <property name="update_policy">if-valid</property>
                                   </object>
                                   <packing>
-                                    <property name="left_attach">3</property>
-                                    <property name="right_attach">4</property>
-                                    <property name="top_attach">2</property>
-                                    <property name="bottom_attach">3</property>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options"></property>
+                                    <property name="left_attach">1</property>
+                                    <property name="right_attach">2</property>
+                                    <property name="top_attach">1</property>
+                                    <property name="bottom_attach">2</property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkLabel" id="label_UB13">
+                                  <object class="GtkSpinButton" id="spinbutton_b">
                                     <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">label34</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">●</property>
+                                    <property name="adjustment">adjustment7</property>
+                                    <property name="climb_rate">1</property>
+                                    <property name="digits">3</property>
+                                    <property name="numeric">True</property>
+                                    <property name="update_policy">if-valid</property>
                                   </object>
                                   <packing>
-                                    <property name="left_attach">3</property>
-                                    <property name="right_attach">4</property>
-                                    <property name="top_attach">1</property>
-                                    <property name="bottom_attach">2</property>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options"></property>
+                                    <property name="left_attach">1</property>
+                                    <property name="right_attach">2</property>
+                                    <property name="top_attach">2</property>
+                                    <property name="bottom_attach">3</property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkLabel" id="label4">
+                                  <object class="GtkSpinButton" id="spinbutton_c">
                                     <property name="visible">True</property>
-                                    <property name="label" translatable="yes">z</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">●</property>
+                                    <property name="adjustment">adjustment8</property>
+                                    <property name="climb_rate">1</property>
+                                    <property name="digits">3</property>
+                                    <property name="numeric">True</property>
+                                    <property name="update_policy">if-valid</property>
                                   </object>
                                   <packing>
+                                    <property name="left_attach">1</property>
+                                    <property name="right_attach">2</property>
                                     <property name="top_attach">3</property>
                                     <property name="bottom_attach">4</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkLabel" id="label3">
+                                  <object class="GtkSpinButton" id="spinbutton_alpha">
                                     <property name="visible">True</property>
-                                    <property name="label" translatable="yes">x</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">●</property>
+                                    <property name="adjustment">adjustment9</property>
+                                    <property name="climb_rate">1</property>
+                                    <property name="digits">3</property>
+                                    <property name="numeric">True</property>
+                                    <property name="update_policy">if-valid</property>
                                   </object>
                                   <packing>
-                                    <property name="top_attach">1</property>
-                                    <property name="bottom_attach">2</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
+                                    <property name="left_attach">1</property>
+                                    <property name="right_attach">2</property>
+                                    <property name="top_attach">4</property>
+                                    <property name="bottom_attach">5</property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkLabel" id="label_UB33">
+                                  <object class="GtkSpinButton" id="spinbutton_beta">
                                     <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">label40</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">●</property>
+                                    <property name="adjustment">adjustment10</property>
+                                    <property name="climb_rate">1</property>
+                                    <property name="digits">3</property>
+                                    <property name="numeric">True</property>
+                                    <property name="update_policy">if-valid</property>
                                   </object>
                                   <packing>
-                                    <property name="left_attach">3</property>
-                                    <property name="right_attach">4</property>
-                                    <property name="top_attach">3</property>
-                                    <property name="bottom_attach">4</property>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options"></property>
+                                    <property name="left_attach">1</property>
+                                    <property name="right_attach">2</property>
+                                    <property name="top_attach">5</property>
+                                    <property name="bottom_attach">6</property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkLabel" id="label_UB32">
+                                  <object class="GtkSpinButton" id="spinbutton_gamma">
                                     <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">label39</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">●</property>
+                                    <property name="adjustment">adjustment11</property>
+                                    <property name="climb_rate">1</property>
+                                    <property name="digits">3</property>
+                                    <property name="numeric">True</property>
+                                    <property name="update_policy">if-valid</property>
                                   </object>
                                   <packing>
-                                    <property name="left_attach">2</property>
-                                    <property name="right_attach">3</property>
-                                    <property name="top_attach">3</property>
-                                    <property name="bottom_attach">4</property>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options"></property>
+                                    <property name="left_attach">1</property>
+                                    <property name="right_attach">2</property>
+                                    <property name="top_attach">6</property>
+                                    <property name="bottom_attach">7</property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkLabel" id="label_UB31">
+                                  <object class="GtkLabel" id="label46">
                                     <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
                                     <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">label38</property>
+                                    <property name="label" translatable="yes">Values</property>
+                                    <property name="justify">center</property>
                                   </object>
                                   <packing>
                                     <property name="left_attach">1</property>
                                     <property name="right_attach">2</property>
-                                    <property name="top_attach">3</property>
-                                    <property name="bottom_attach">4</property>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options"></property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkLabel" id="label6">
+                                  <object class="GtkLabel" id="label47">
                                     <property name="visible">True</property>
-                                    <property name="label" translatable="yes">y</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">Minimum</property>
+                                    <property name="justify">center</property>
                                   </object>
                                   <packing>
-                                    <property name="top_attach">2</property>
-                                    <property name="bottom_attach">3</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
+                                    <property name="left_attach">2</property>
+                                    <property name="right_attach">3</property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkLabel" id="label_UB22">
+                                  <object class="GtkLabel" id="label48">
                                     <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
                                     <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">label36</property>
+                                    <property name="label" translatable="yes">Maximum</property>
+                                    <property name="justify">center</property>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">3</property>
+                                    <property name="right_attach">4</property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkSpinButton" id="spinbutton_a_min">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">●</property>
+                                    <property name="adjustment">adjustment12</property>
+                                    <property name="climb_rate">1</property>
+                                    <property name="digits">3</property>
+                                    <property name="numeric">True</property>
+                                    <property name="update_policy">if-valid</property>
                                   </object>
                                   <packing>
                                     <property name="left_attach">2</property>
                                     <property name="right_attach">3</property>
-                                    <property name="top_attach">2</property>
-                                    <property name="bottom_attach">3</property>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options"></property>
+                                    <property name="top_attach">1</property>
+                                    <property name="bottom_attach">2</property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkLabel" id="label_UB21">
+                                  <object class="GtkSpinButton" id="spinbutton_b_min">
                                     <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">label35</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">●</property>
+                                    <property name="adjustment">adjustment13</property>
+                                    <property name="climb_rate">1</property>
+                                    <property name="digits">3</property>
+                                    <property name="numeric">True</property>
+                                    <property name="update_policy">if-valid</property>
                                   </object>
                                   <packing>
-                                    <property name="left_attach">1</property>
-                                    <property name="right_attach">2</property>
+                                    <property name="left_attach">2</property>
+                                    <property name="right_attach">3</property>
                                     <property name="top_attach">2</property>
                                     <property name="bottom_attach">3</property>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options"></property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkLabel" id="label_UB12">
+                                  <object class="GtkSpinButton" id="spinbutton_c_min">
                                     <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">label33</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">●</property>
+                                    <property name="adjustment">adjustment14</property>
+                                    <property name="climb_rate">1</property>
+                                    <property name="digits">3</property>
+                                    <property name="numeric">True</property>
+                                    <property name="update_policy">if-valid</property>
                                   </object>
                                   <packing>
                                     <property name="left_attach">2</property>
                                     <property name="right_attach">3</property>
-                                    <property name="top_attach">1</property>
-                                    <property name="bottom_attach">2</property>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options"></property>
+                                    <property name="top_attach">3</property>
+                                    <property name="bottom_attach">4</property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkLabel" id="label_UB11">
+                                  <object class="GtkSpinButton" id="spinbutton_alpha_min">
                                     <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">label32</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">●</property>
+                                    <property name="adjustment">adjustment15</property>
+                                    <property name="climb_rate">1</property>
+                                    <property name="digits">3</property>
+                                    <property name="numeric">True</property>
+                                    <property name="update_policy">if-valid</property>
                                   </object>
                                   <packing>
-                                    <property name="left_attach">1</property>
-                                    <property name="right_attach">2</property>
-                                    <property name="top_attach">1</property>
-                                    <property name="bottom_attach">2</property>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options"></property>
+                                    <property name="left_attach">2</property>
+                                    <property name="right_attach">3</property>
+                                    <property name="top_attach">4</property>
+                                    <property name="bottom_attach">5</property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkLabel" id="label12">
+                                  <object class="GtkSpinButton" id="spinbutton_beta_min">
                                     <property name="visible">True</property>
-                                    <property name="label" translatable="yes">a*</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">●</property>
+                                    <property name="adjustment">adjustment16</property>
+                                    <property name="climb_rate">1</property>
+                                    <property name="digits">3</property>
+                                    <property name="numeric">True</property>
+                                    <property name="update_policy">if-valid</property>
                                   </object>
                                   <packing>
-                                    <property name="left_attach">1</property>
-                                    <property name="right_attach">2</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
+                                    <property name="left_attach">2</property>
+                                    <property name="right_attach">3</property>
+                                    <property name="top_attach">5</property>
+                                    <property name="bottom_attach">6</property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkLabel" id="label13">
+                                  <object class="GtkSpinButton" id="spinbutton_gamma_min">
                                     <property name="visible">True</property>
-                                    <property name="label" translatable="yes">b*</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">●</property>
+                                    <property name="adjustment">adjustment17</property>
+                                    <property name="climb_rate">1</property>
+                                    <property name="digits">3</property>
+                                    <property name="numeric">True</property>
+                                    <property name="update_policy">if-valid</property>
                                   </object>
                                   <packing>
                                     <property name="left_attach">2</property>
                                     <property name="right_attach">3</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
+                                    <property name="top_attach">6</property>
+                                    <property name="bottom_attach">7</property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkLabel" id="label14">
+                                  <object class="GtkSpinButton" id="spinbutton_a_max">
                                     <property name="visible">True</property>
-                                    <property name="label" translatable="yes">c*</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">●</property>
+                                    <property name="adjustment">adjustment18</property>
+                                    <property name="climb_rate">1</property>
+                                    <property name="digits">3</property>
+                                    <property name="numeric">True</property>
+                                    <property name="update_policy">if-valid</property>
                                   </object>
                                   <packing>
                                     <property name="left_attach">3</property>
                                     <property name="right_attach">4</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
+                                    <property name="top_attach">1</property>
+                                    <property name="bottom_attach">2</property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <placeholder/>
-                                </child>
-                              </object>
-                              <packing>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkTable" id="table1">
-                                <property name="visible">True</property>
-                                <property name="n_rows">3</property>
-                                <property name="n_columns">3</property>
-                                <child>
-                                  <object class="GtkSpinButton" id="spinbutton_U11">
+                                  <object class="GtkSpinButton" id="spinbutton_b_max">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment35</property>
-                                    <property name="digits">4</property>
+                                    <property name="invisible_char">●</property>
+                                    <property name="adjustment">adjustment19</property>
+                                    <property name="climb_rate">1</property>
+                                    <property name="digits">3</property>
+                                    <property name="numeric">True</property>
+                                    <property name="update_policy">if-valid</property>
                                   </object>
                                   <packing>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
+                                    <property name="left_attach">3</property>
+                                    <property name="right_attach">4</property>
+                                    <property name="top_attach">2</property>
+                                    <property name="bottom_attach">3</property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkSpinButton" id="spinbutton_U12">
+                                  <object class="GtkSpinButton" id="spinbutton_c_max">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment36</property>
-                                    <property name="digits">4</property>
+                                    <property name="invisible_char">●</property>
+                                    <property name="adjustment">adjustment20</property>
+                                    <property name="climb_rate">1</property>
+                                    <property name="digits">3</property>
+                                    <property name="numeric">True</property>
+                                    <property name="update_policy">if-valid</property>
                                   </object>
                                   <packing>
-                                    <property name="left_attach">1</property>
-                                    <property name="right_attach">2</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
+                                    <property name="left_attach">3</property>
+                                    <property name="right_attach">4</property>
+                                    <property name="top_attach">3</property>
+                                    <property name="bottom_attach">4</property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkSpinButton" id="spinbutton_U13">
+                                  <object class="GtkSpinButton" id="spinbutton_alpha_max">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment37</property>
-                                    <property name="digits">4</property>
+                                    <property name="invisible_char">●</property>
+                                    <property name="adjustment">adjustment21</property>
+                                    <property name="climb_rate">1</property>
+                                    <property name="digits">3</property>
+                                    <property name="numeric">True</property>
+                                    <property name="update_policy">if-valid</property>
                                   </object>
                                   <packing>
-                                    <property name="left_attach">2</property>
-                                    <property name="right_attach">3</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
+                                    <property name="left_attach">3</property>
+                                    <property name="right_attach">4</property>
+                                    <property name="top_attach">4</property>
+                                    <property name="bottom_attach">5</property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkSpinButton" id="spinbutton_U21">
+                                  <object class="GtkSpinButton" id="spinbutton_beta_max">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment38</property>
-                                    <property name="digits">4</property>
+                                    <property name="invisible_char">●</property>
+                                    <property name="adjustment">adjustment22</property>
+                                    <property name="climb_rate">1</property>
+                                    <property name="digits">3</property>
+                                    <property name="numeric">True</property>
+                                    <property name="update_policy">if-valid</property>
                                   </object>
                                   <packing>
-                                    <property name="top_attach">1</property>
-                                    <property name="bottom_attach">2</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
+                                    <property name="left_attach">3</property>
+                                    <property name="right_attach">4</property>
+                                    <property name="top_attach">5</property>
+                                    <property name="bottom_attach">6</property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkSpinButton" id="spinbutton_U22">
+                                  <object class="GtkSpinButton" id="spinbutton_gamma_max">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment39</property>
-                                    <property name="digits">4</property>
+                                    <property name="invisible_char">●</property>
+                                    <property name="adjustment">adjustment23</property>
+                                    <property name="climb_rate">1</property>
+                                    <property name="digits">3</property>
+                                    <property name="numeric">True</property>
+                                    <property name="update_policy">if-valid</property>
                                   </object>
                                   <packing>
-                                    <property name="left_attach">1</property>
-                                    <property name="right_attach">2</property>
-                                    <property name="top_attach">1</property>
-                                    <property name="bottom_attach">2</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
+                                    <property name="left_attach">3</property>
+                                    <property name="right_attach">4</property>
+                                    <property name="top_attach">6</property>
+                                    <property name="bottom_attach">7</property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkSpinButton" id="spinbutton_U23">
+                                  <object class="GtkCheckButton" id="checkbutton_a">
+                                    <property name="label" translatable="yes">a</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment40</property>
-                                    <property name="digits">4</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="use_action_appearance">False</property>
+                                    <property name="use_underline">True</property>
+                                    <property name="xalign">0.5</property>
+                                    <property name="draw_indicator">True</property>
+                                    <signal name="toggled" handler="hkl_gui_window_checkbutton_a_toggled_cb" swapped="no"/>
                                   </object>
                                   <packing>
-                                    <property name="left_attach">2</property>
-                                    <property name="right_attach">3</property>
                                     <property name="top_attach">1</property>
                                     <property name="bottom_attach">2</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
+                                    <property name="x_options">GTK_FILL</property>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkSpinButton" id="spinbutton_U31">
+                                  <object class="GtkCheckButton" id="checkbutton_b">
+                                    <property name="label" translatable="yes">b</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment41</property>
-                                    <property name="digits">4</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="use_action_appearance">False</property>
+                                    <property name="use_underline">True</property>
+                                    <property name="xalign">0.5</property>
+                                    <property name="draw_indicator">True</property>
+                                    <signal name="toggled" handler="hkl_gui_window_checkbutton_b_toggled_cb" swapped="no"/>
                                   </object>
                                   <packing>
                                     <property name="top_attach">2</property>
                                     <property name="bottom_attach">3</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
+                                    <property name="x_options">GTK_FILL</property>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkSpinButton" id="spinbutton_U32">
+                                  <object class="GtkCheckButton" id="checkbutton_c">
+                                    <property name="label" translatable="yes">c</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment42</property>
-                                    <property name="digits">4</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="use_action_appearance">False</property>
+                                    <property name="use_underline">True</property>
+                                    <property name="xalign">0.5</property>
+                                    <property name="draw_indicator">True</property>
+                                    <signal name="toggled" handler="hkl_gui_window_checkbutton_c_toggled_cb" swapped="no"/>
                                   </object>
                                   <packing>
-                                    <property name="left_attach">1</property>
-                                    <property name="right_attach">2</property>
-                                    <property name="top_attach">2</property>
-                                    <property name="bottom_attach">3</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
+                                    <property name="top_attach">3</property>
+                                    <property name="bottom_attach">4</property>
+                                    <property name="x_options">GTK_FILL</property>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkSpinButton" id="spinbutton_U33">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment43</property>
-                                    <property name="digits">4</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">2</property>
-                                    <property name="right_attach">3</property>
-                                    <property name="top_attach">2</property>
-                                    <property name="bottom_attach">3</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                              </object>
-                              <packing>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="position">1</property>
-                            <property name="tab_fill">False</property>
-                          </packing>
-                        </child>
-                        <child type="tab">
-                          <object class="GtkLabel" id="label9">
-                            <property name="visible">True</property>
-                            <property name="label" translatable="yes">UB</property>
-                          </object>
-                          <packing>
-                            <property name="position">1</property>
-                            <property name="tab_fill">False</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkVBox" id="vbox6">
-                            <property name="visible">True</property>
-                            <property name="orientation">vertical</property>
-                            <child>
-                              <object class="GtkTable" id="table2">
-                                <property name="visible">True</property>
-                                <property name="n_rows">10</property>
-                                <property name="n_columns">4</property>
-                                <child>
-                                  <object class="GtkSpinButton" id="spinbutton_a">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment6</property>
-                                    <property name="climb_rate">1</property>
-                                    <property name="digits">3</property>
-                                    <property name="numeric">True</property>
-                                    <property name="update_policy">if-valid</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">1</property>
-                                    <property name="right_attach">2</property>
-                                    <property name="top_attach">1</property>
-                                    <property name="bottom_attach">2</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkSpinButton" id="spinbutton_b">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment7</property>
-                                    <property name="climb_rate">1</property>
-                                    <property name="digits">3</property>
-                                    <property name="numeric">True</property>
-                                    <property name="update_policy">if-valid</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">1</property>
-                                    <property name="right_attach">2</property>
-                                    <property name="top_attach">2</property>
-                                    <property name="bottom_attach">3</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkSpinButton" id="spinbutton_c">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment8</property>
-                                    <property name="climb_rate">1</property>
-                                    <property name="digits">3</property>
-                                    <property name="numeric">True</property>
-                                    <property name="update_policy">if-valid</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">1</property>
-                                    <property name="right_attach">2</property>
-                                    <property name="top_attach">3</property>
-                                    <property name="bottom_attach">4</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkSpinButton" id="spinbutton_alpha">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment9</property>
-                                    <property name="climb_rate">1</property>
-                                    <property name="digits">3</property>
-                                    <property name="numeric">True</property>
-                                    <property name="update_policy">if-valid</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">1</property>
-                                    <property name="right_attach">2</property>
-                                    <property name="top_attach">4</property>
-                                    <property name="bottom_attach">5</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkSpinButton" id="spinbutton_beta">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment10</property>
-                                    <property name="climb_rate">1</property>
-                                    <property name="digits">3</property>
-                                    <property name="numeric">True</property>
-                                    <property name="update_policy">if-valid</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">1</property>
-                                    <property name="right_attach">2</property>
-                                    <property name="top_attach">5</property>
-                                    <property name="bottom_attach">6</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkSpinButton" id="spinbutton_gamma">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment11</property>
-                                    <property name="climb_rate">1</property>
-                                    <property name="digits">3</property>
-                                    <property name="numeric">True</property>
-                                    <property name="update_policy">if-valid</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">1</property>
-                                    <property name="right_attach">2</property>
-                                    <property name="top_attach">6</property>
-                                    <property name="bottom_attach">7</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkLabel" id="label46">
-                                    <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">Values</property>
-                                    <property name="justify">center</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">1</property>
-                                    <property name="right_attach">2</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkLabel" id="label47">
-                                    <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">Minimum</property>
-                                    <property name="justify">center</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">2</property>
-                                    <property name="right_attach">3</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkLabel" id="label48">
-                                    <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">Maximum</property>
-                                    <property name="justify">center</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">3</property>
-                                    <property name="right_attach">4</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkSpinButton" id="spinbutton_a_min">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment12</property>
-                                    <property name="climb_rate">1</property>
-                                    <property name="digits">3</property>
-                                    <property name="numeric">True</property>
-                                    <property name="update_policy">if-valid</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">2</property>
-                                    <property name="right_attach">3</property>
-                                    <property name="top_attach">1</property>
-                                    <property name="bottom_attach">2</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkSpinButton" id="spinbutton_b_min">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment13</property>
-                                    <property name="climb_rate">1</property>
-                                    <property name="digits">3</property>
-                                    <property name="numeric">True</property>
-                                    <property name="update_policy">if-valid</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">2</property>
-                                    <property name="right_attach">3</property>
-                                    <property name="top_attach">2</property>
-                                    <property name="bottom_attach">3</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkSpinButton" id="spinbutton_c_min">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment14</property>
-                                    <property name="climb_rate">1</property>
-                                    <property name="digits">3</property>
-                                    <property name="numeric">True</property>
-                                    <property name="update_policy">if-valid</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">2</property>
-                                    <property name="right_attach">3</property>
-                                    <property name="top_attach">3</property>
-                                    <property name="bottom_attach">4</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkSpinButton" id="spinbutton_alpha_min">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment15</property>
-                                    <property name="climb_rate">1</property>
-                                    <property name="digits">3</property>
-                                    <property name="numeric">True</property>
-                                    <property name="update_policy">if-valid</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">2</property>
-                                    <property name="right_attach">3</property>
-                                    <property name="top_attach">4</property>
-                                    <property name="bottom_attach">5</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkSpinButton" id="spinbutton_beta_min">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment16</property>
-                                    <property name="climb_rate">1</property>
-                                    <property name="digits">3</property>
-                                    <property name="numeric">True</property>
-                                    <property name="update_policy">if-valid</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">2</property>
-                                    <property name="right_attach">3</property>
-                                    <property name="top_attach">5</property>
-                                    <property name="bottom_attach">6</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkSpinButton" id="spinbutton_gamma_min">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment17</property>
-                                    <property name="climb_rate">1</property>
-                                    <property name="digits">3</property>
-                                    <property name="numeric">True</property>
-                                    <property name="update_policy">if-valid</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">2</property>
-                                    <property name="right_attach">3</property>
-                                    <property name="top_attach">6</property>
-                                    <property name="bottom_attach">7</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkSpinButton" id="spinbutton_a_max">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment18</property>
-                                    <property name="climb_rate">1</property>
-                                    <property name="digits">3</property>
-                                    <property name="numeric">True</property>
-                                    <property name="update_policy">if-valid</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">3</property>
-                                    <property name="right_attach">4</property>
-                                    <property name="top_attach">1</property>
-                                    <property name="bottom_attach">2</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkSpinButton" id="spinbutton_b_max">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment19</property>
-                                    <property name="climb_rate">1</property>
-                                    <property name="digits">3</property>
-                                    <property name="numeric">True</property>
-                                    <property name="update_policy">if-valid</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">3</property>
-                                    <property name="right_attach">4</property>
-                                    <property name="top_attach">2</property>
-                                    <property name="bottom_attach">3</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkSpinButton" id="spinbutton_c_max">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment20</property>
-                                    <property name="climb_rate">1</property>
-                                    <property name="digits">3</property>
-                                    <property name="numeric">True</property>
-                                    <property name="update_policy">if-valid</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">3</property>
-                                    <property name="right_attach">4</property>
-                                    <property name="top_attach">3</property>
-                                    <property name="bottom_attach">4</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkSpinButton" id="spinbutton_alpha_max">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment21</property>
-                                    <property name="climb_rate">1</property>
-                                    <property name="digits">3</property>
-                                    <property name="numeric">True</property>
-                                    <property name="update_policy">if-valid</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">3</property>
-                                    <property name="right_attach">4</property>
-                                    <property name="top_attach">4</property>
-                                    <property name="bottom_attach">5</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkSpinButton" id="spinbutton_beta_max">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment22</property>
-                                    <property name="climb_rate">1</property>
-                                    <property name="digits">3</property>
-                                    <property name="numeric">True</property>
-                                    <property name="update_policy">if-valid</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">3</property>
-                                    <property name="right_attach">4</property>
-                                    <property name="top_attach">5</property>
-                                    <property name="bottom_attach">6</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkSpinButton" id="spinbutton_gamma_max">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
-                                    <property name="adjustment">adjustment23</property>
-                                    <property name="climb_rate">1</property>
-                                    <property name="digits">3</property>
-                                    <property name="numeric">True</property>
-                                    <property name="update_policy">if-valid</property>
-                                  </object>
-                                  <packing>
-                                    <property name="left_attach">3</property>
-                                    <property name="right_attach">4</property>
-                                    <property name="top_attach">6</property>
-                                    <property name="bottom_attach">7</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkCheckButton" id="checkbutton_a">
-                                    <property name="label" translatable="yes">a</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">False</property>
-                                    <property name="use_underline">True</property>
-                                    <property name="draw_indicator">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="top_attach">1</property>
-                                    <property name="bottom_attach">2</property>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkCheckButton" id="checkbutton_b">
-                                    <property name="label" translatable="yes">b</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">False</property>
-                                    <property name="use_underline">True</property>
-                                    <property name="draw_indicator">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="top_attach">2</property>
-                                    <property name="bottom_attach">3</property>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkCheckButton" id="checkbutton_c">
-                                    <property name="label" translatable="yes">c</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">False</property>
-                                    <property name="use_underline">True</property>
-                                    <property name="draw_indicator">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="top_attach">3</property>
-                                    <property name="bottom_attach">4</property>
-                                    <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options"></property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkCheckButton" id="checkbutton_alpha">
-                                    <property name="label" translatable="yes">alpha</property>
+                                  <object class="GtkCheckButton" id="checkbutton_alpha">
+                                    <property name="label" translatable="yes">alpha</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="use_underline">True</property>
+                                    <property name="xalign">0.5</property>
                                     <property name="draw_indicator">True</property>
+                                    <signal name="toggled" handler="hkl_gui_window_checkbutton_alpha_toggled_cb" swapped="no"/>
                                   </object>
                                   <packing>
                                     <property name="top_attach">4</property>
                                     <property name="bottom_attach">5</property>
                                     <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options"></property>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
                                   <object class="GtkCheckButton" id="checkbutton_beta">
                                     <property name="label" translatable="yes">beta</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="use_underline">True</property>
+                                    <property name="xalign">0.5</property>
                                     <property name="draw_indicator">True</property>
+                                    <signal name="toggled" handler="hkl_gui_window_checkbutton_beta_toggled_cb" swapped="no"/>
                                   </object>
                                   <packing>
                                     <property name="top_attach">5</property>
                                     <property name="bottom_attach">6</property>
                                     <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options"></property>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
                                   <object class="GtkCheckButton" id="checkbutton_gamma">
                                     <property name="label" translatable="yes">gamma</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="use_underline">True</property>
+                                    <property name="xalign">0.5</property>
                                     <property name="draw_indicator">True</property>
+                                    <signal name="toggled" handler="hkl_gui_window_checkbutton_gamma_toggled_cb" swapped="no"/>
                                   </object>
                                   <packing>
                                     <property name="top_attach">6</property>
                                     <property name="bottom_attach">7</property>
                                     <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options"></property>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
                                   <object class="GtkSpinButton" id="spinbutton_ux">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
+                                    <property name="invisible_char">●</property>
                                     <property name="adjustment">adjustment32</property>
                                     <property name="digits">3</property>
                                     <property name="numeric">True</property>
+                                    <signal name="value-changed" handler="hkl_gui_window_spinbutton_ux_value_changed_cb" swapped="no"/>
                                   </object>
                                   <packing>
                                     <property name="left_attach">1</property>
                                     <property name="right_attach">2</property>
                                     <property name="top_attach">7</property>
                                     <property name="bottom_attach">8</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
                                   <object class="GtkSpinButton" id="spinbutton_uy">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
+                                    <property name="invisible_char">●</property>
                                     <property name="adjustment">adjustment33</property>
                                     <property name="digits">3</property>
                                     <property name="numeric">True</property>
+                                    <signal name="value-changed" handler="hkl_gui_window_spinbutton_uy_value_changed_cb" swapped="no"/>
                                   </object>
                                   <packing>
                                     <property name="left_attach">1</property>
                                     <property name="right_attach">2</property>
                                     <property name="top_attach">8</property>
                                     <property name="bottom_attach">9</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
                                   <object class="GtkSpinButton" id="spinbutton_uz">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
-                                    <property name="invisible_char">&#x25CF;</property>
+                                    <property name="invisible_char">●</property>
                                     <property name="adjustment">adjustment34</property>
                                     <property name="digits">3</property>
                                     <property name="numeric">True</property>
+                                    <signal name="value-changed" handler="hkl_gui_window_spinbutton_uz_value_changed_cb" swapped="no"/>
                                   </object>
                                   <packing>
                                     <property name="left_attach">1</property>
                                     <property name="right_attach">2</property>
                                     <property name="top_attach">9</property>
                                     <property name="bottom_attach">10</property>
-                                    <property name="x_options"></property>
-                                    <property name="y_options"></property>
+                                    <property name="x_options"/>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
                                   <object class="GtkCheckButton" id="checkbutton_ux">
                                     <property name="label" translatable="yes">Ux</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="use_underline">True</property>
+                                    <property name="xalign">0.5</property>
                                     <property name="draw_indicator">True</property>
+                                    <signal name="toggled" handler="hkl_gui_window_checkbutton_ux_toggled_cb" swapped="no"/>
                                   </object>
                                   <packing>
                                     <property name="top_attach">7</property>
                                     <property name="bottom_attach">8</property>
                                     <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options"></property>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
                                   <object class="GtkCheckButton" id="checkbutton_uy">
                                     <property name="label" translatable="yes">Uy</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="use_underline">True</property>
+                                    <property name="xalign">0.5</property>
                                     <property name="draw_indicator">True</property>
+                                    <signal name="toggled" handler="hkl_gui_window_checkbutton_uy_toggled_cb" swapped="no"/>
                                   </object>
                                   <packing>
                                     <property name="top_attach">8</property>
                                     <property name="bottom_attach">9</property>
                                     <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options"></property>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
                                   <object class="GtkCheckButton" id="checkbutton_uz">
                                     <property name="label" translatable="yes">Uz</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">False</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="use_underline">True</property>
+                                    <property name="xalign">0.5</property>
                                     <property name="draw_indicator">True</property>
+                                    <signal name="toggled" handler="hkl_gui_window_checkbutton_uz_toggled_cb" swapped="no"/>
                                   </object>
                                   <packing>
                                     <property name="top_attach">9</property>
                                     <property name="bottom_attach">10</property>
                                     <property name="x_options">GTK_FILL</property>
-                                    <property name="y_options"></property>
+                                    <property name="y_options"/>
                                   </packing>
                                 </child>
                                 <child>
@@ -1740,21 +2193,126 @@
                                 <child>
                                   <placeholder/>
                                 </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
                               </object>
                               <packing>
-                                <property name="position">0</property>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkHButtonBox" id="hbuttonbox1">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <child>
                                   <object class="GtkButton" id="button2">
                                     <property name="label">gtk-apply</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
+                                    <property name="use_action_appearance">False</property>
                                     <property name="use_stock">True</property>
+                                    <signal name="clicked" handler="hkl_gui_window_button2_clicked_cb" swapped="no"/>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
@@ -1764,28 +2322,210 @@
                                 </child>
                               </object>
                               <packing>
-                                <property name="position">1</property>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkHBox" id="box2">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <object class="GtkTable" id="table1">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="n_rows">3</property>
+                                    <property name="n_columns">3</property>
+                                    <child>
+                                      <object class="GtkSpinButton" id="spinbutton_U11">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="invisible_char">●</property>
+                                        <property name="invisible_char_set">True</property>
+                                        <property name="adjustment">adjustment35</property>
+                                        <property name="digits">4</property>
+                                      </object>
+                                      <packing>
+                                        <property name="x_options"/>
+                                        <property name="y_options"/>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkSpinButton" id="spinbutton_U12">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="invisible_char">●</property>
+                                        <property name="invisible_char_set">True</property>
+                                        <property name="adjustment">adjustment36</property>
+                                        <property name="digits">4</property>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">1</property>
+                                        <property name="right_attach">2</property>
+                                        <property name="x_options"/>
+                                        <property name="y_options"/>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkSpinButton" id="spinbutton_U13">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="invisible_char">●</property>
+                                        <property name="invisible_char_set">True</property>
+                                        <property name="adjustment">adjustment37</property>
+                                        <property name="digits">4</property>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">2</property>
+                                        <property name="right_attach">3</property>
+                                        <property name="x_options"/>
+                                        <property name="y_options"/>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkSpinButton" id="spinbutton_U21">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="invisible_char">●</property>
+                                        <property name="invisible_char_set">True</property>
+                                        <property name="adjustment">adjustment38</property>
+                                        <property name="digits">4</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">1</property>
+                                        <property name="bottom_attach">2</property>
+                                        <property name="x_options"/>
+                                        <property name="y_options"/>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkSpinButton" id="spinbutton_U22">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="invisible_char">●</property>
+                                        <property name="invisible_char_set">True</property>
+                                        <property name="adjustment">adjustment39</property>
+                                        <property name="digits">4</property>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">1</property>
+                                        <property name="right_attach">2</property>
+                                        <property name="top_attach">1</property>
+                                        <property name="bottom_attach">2</property>
+                                        <property name="x_options"/>
+                                        <property name="y_options"/>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkSpinButton" id="spinbutton_U23">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="invisible_char">●</property>
+                                        <property name="invisible_char_set">True</property>
+                                        <property name="adjustment">adjustment40</property>
+                                        <property name="digits">4</property>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">2</property>
+                                        <property name="right_attach">3</property>
+                                        <property name="top_attach">1</property>
+                                        <property name="bottom_attach">2</property>
+                                        <property name="x_options"/>
+                                        <property name="y_options"/>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkSpinButton" id="spinbutton_U31">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="invisible_char">●</property>
+                                        <property name="invisible_char_set">True</property>
+                                        <property name="adjustment">adjustment41</property>
+                                        <property name="digits">4</property>
+                                      </object>
+                                      <packing>
+                                        <property name="top_attach">2</property>
+                                        <property name="bottom_attach">3</property>
+                                        <property name="x_options"/>
+                                        <property name="y_options"/>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkSpinButton" id="spinbutton_U32">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="invisible_char">●</property>
+                                        <property name="invisible_char_set">True</property>
+                                        <property name="adjustment">adjustment42</property>
+                                        <property name="digits">4</property>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">1</property>
+                                        <property name="right_attach">2</property>
+                                        <property name="top_attach">2</property>
+                                        <property name="bottom_attach">3</property>
+                                        <property name="x_options"/>
+                                        <property name="y_options"/>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkSpinButton" id="spinbutton_U33">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="invisible_char">●</property>
+                                        <property name="invisible_char_set">True</property>
+                                        <property name="adjustment">adjustment43</property>
+                                        <property name="digits">4</property>
+                                      </object>
+                                      <packing>
+                                        <property name="left_attach">2</property>
+                                        <property name="right_attach">3</property>
+                                        <property name="top_attach">2</property>
+                                        <property name="bottom_attach">3</property>
+                                        <property name="x_options"/>
+                                        <property name="y_options"/>
+                                      </packing>
+                                    </child>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">True</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">3</property>
                               </packing>
                             </child>
+                            <child>
+                              <placeholder/>
+                            </child>
                           </object>
                           <packing>
-                            <property name="position">2</property>
                             <property name="tab_fill">False</property>
                           </packing>
                         </child>
                         <child type="tab">
                           <object class="GtkLabel" id="label8">
                             <property name="visible">True</property>
-                            <property name="label" translatable="yes">fit parameters</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Parameters</property>
                           </object>
                           <packing>
-                            <property name="position">2</property>
                             <property name="tab_fill">False</property>
                           </packing>
                         </child>
                         <child>
                           <object class="GtkTable" id="table3">
                             <property name="visible">True</property>
+                            <property name="can_focus">False</property>
                             <property name="n_rows">4</property>
                             <property name="n_columns">3</property>
                             <property name="column_spacing">3</property>
@@ -1793,17 +2533,19 @@
                             <child>
                               <object class="GtkLabel" id="label20">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
                                 <property name="label" translatable="yes">a*</property>
                               </object>
                               <packing>
                                 <property name="x_options">GTK_FILL</property>
-                                <property name="y_options"></property>
+                                <property name="y_options"/>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkLabel" id="label21">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
                                 <property name="label" translatable="yes">b*</property>
                               </object>
@@ -1811,12 +2553,13 @@
                                 <property name="left_attach">1</property>
                                 <property name="right_attach">2</property>
                                 <property name="x_options">GTK_FILL</property>
-                                <property name="y_options"></property>
+                                <property name="y_options"/>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkLabel" id="label22">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
                                 <property name="label" translatable="yes">c*</property>
                               </object>
@@ -1824,12 +2567,13 @@
                                 <property name="left_attach">2</property>
                                 <property name="right_attach">3</property>
                                 <property name="x_options">GTK_FILL</property>
-                                <property name="y_options"></property>
+                                <property name="y_options"/>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkLabel" id="label26">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
                                 <property name="label" translatable="yes">alpha*</property>
                               </object>
@@ -1837,12 +2581,13 @@
                                 <property name="top_attach">2</property>
                                 <property name="bottom_attach">3</property>
                                 <property name="x_options">GTK_FILL</property>
-                                <property name="y_options"></property>
+                                <property name="y_options"/>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkLabel" id="label27">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
                                 <property name="label" translatable="yes">beta*</property>
                               </object>
@@ -1852,12 +2597,13 @@
                                 <property name="top_attach">2</property>
                                 <property name="bottom_attach">3</property>
                                 <property name="x_options">GTK_FILL</property>
-                                <property name="y_options"></property>
+                                <property name="y_options"/>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkLabel" id="label28">
                                 <property name="visible">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
                                 <property name="label" translatable="yes">gamma*</property>
                               </object>
@@ -1867,7 +2613,7 @@
                                 <property name="top_attach">2</property>
                                 <property name="bottom_attach">3</property>
                                 <property name="x_options">GTK_FILL</property>
-                                <property name="y_options"></property>
+                                <property name="y_options"/>
                               </packing>
                             </child>
                             <child>
@@ -1875,7 +2621,7 @@
                                 <property name="visible">True</property>
                                 <property name="sensitive">False</property>
                                 <property name="can_focus">True</property>
-                                <property name="invisible_char">&#x25CF;</property>
+                                <property name="invisible_char">●</property>
                                 <property name="adjustment">adjustment24</property>
                                 <property name="climb_rate">1</property>
                                 <property name="digits">3</property>
@@ -1884,8 +2630,8 @@
                               <packing>
                                 <property name="top_attach">1</property>
                                 <property name="bottom_attach">2</property>
-                                <property name="x_options"></property>
-                                <property name="y_options"></property>
+                                <property name="x_options"/>
+                                <property name="y_options"/>
                               </packing>
                             </child>
                             <child>
@@ -1893,7 +2639,7 @@
                                 <property name="visible">True</property>
                                 <property name="sensitive">False</property>
                                 <property name="can_focus">True</property>
-                                <property name="invisible_char">&#x25CF;</property>
+                                <property name="invisible_char">●</property>
                                 <property name="adjustment">adjustment25</property>
                                 <property name="climb_rate">1</property>
                                 <property name="digits">3</property>
@@ -1904,8 +2650,8 @@
                                 <property name="right_attach">3</property>
                                 <property name="top_attach">1</property>
                                 <property name="bottom_attach">2</property>
-                                <property name="x_options"></property>
-                                <property name="y_options"></property>
+                                <property name="x_options"/>
+                                <property name="y_options"/>
                               </packing>
                             </child>
                             <child>
@@ -1913,7 +2659,7 @@
                                 <property name="visible">True</property>
                                 <property name="sensitive">False</property>
                                 <property name="can_focus">True</property>
-                                <property name="invisible_char">&#x25CF;</property>
+                                <property name="invisible_char">●</property>
                                 <property name="adjustment">adjustment26</property>
                                 <property name="climb_rate">1</property>
                                 <property name="digits">3</property>
@@ -1922,8 +2668,8 @@
                               <packing>
                                 <property name="top_attach">3</property>
                                 <property name="bottom_attach">4</property>
-                                <property name="x_options"></property>
-                                <property name="y_options"></property>
+                                <property name="x_options"/>
+                                <property name="y_options"/>
                               </packing>
                             </child>
                             <child>
@@ -1931,7 +2677,7 @@
                                 <property name="visible">True</property>
                                 <property name="sensitive">False</property>
                                 <property name="can_focus">True</property>
-                                <property name="invisible_char">&#x25CF;</property>
+                                <property name="invisible_char">●</property>
                                 <property name="adjustment">adjustment27</property>
                                 <property name="climb_rate">1</property>
                                 <property name="digits">3</property>
@@ -1942,172 +2688,328 @@
                                 <property name="right_attach">2</property>
                                 <property name="top_attach">3</property>
                                 <property name="bottom_attach">4</property>
-                                <property name="x_options"></property>
-                                <property name="y_options"></property>
+                                <property name="x_options"/>
+                                <property name="y_options"/>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkSpinButton" id="spinbutton_gamma_star">
+                                <property name="visible">True</property>
+                                <property name="sensitive">False</property>
+                                <property name="can_focus">True</property>
+                                <property name="invisible_char">●</property>
+                                <property name="adjustment">adjustment28</property>
+                                <property name="climb_rate">1</property>
+                                <property name="digits">3</property>
+                                <property name="numeric">True</property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">2</property>
+                                <property name="right_attach">3</property>
+                                <property name="top_attach">3</property>
+                                <property name="bottom_attach">4</property>
+                                <property name="x_options"/>
+                                <property name="y_options"/>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkSpinButton" id="spinbutton_b_star">
+                                <property name="visible">True</property>
+                                <property name="sensitive">False</property>
+                                <property name="can_focus">True</property>
+                                <property name="invisible_char">●</property>
+                                <property name="adjustment">adjustment29</property>
+                                <property name="climb_rate">1</property>
+                                <property name="digits">3</property>
+                                <property name="numeric">True</property>
+                              </object>
+                              <packing>
+                                <property name="left_attach">1</property>
+                                <property name="right_attach">2</property>
+                                <property name="top_attach">1</property>
+                                <property name="bottom_attach">2</property>
+                                <property name="x_options"/>
+                                <property name="y_options"/>
                               </packing>
                             </child>
+                          </object>
+                          <packing>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
+                        <child type="tab">
+                          <object class="GtkLabel" id="label2">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">extra</property>
+                          </object>
+                          <packing>
+                            <property name="position">1</property>
+                            <property name="tab_fill">False</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkVBox" id="vbox4">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="spacing">3</property>
                             <child>
-                              <object class="GtkSpinButton" id="spinbutton_gamma_star">
+                              <object class="GtkToolbar" id="toolbar1">
                                 <property name="visible">True</property>
-                                <property name="sensitive">False</property>
-                                <property name="can_focus">True</property>
-                                <property name="invisible_char">&#x25CF;</property>
-                                <property name="adjustment">adjustment28</property>
-                                <property name="climb_rate">1</property>
-                                <property name="digits">3</property>
-                                <property name="numeric">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="toolbar_style">both</property>
+                                <child>
+                                  <object class="GtkToolButton" id="toolbutton_add_reflection">
+                                    <property name="use_action_appearance">False</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="use_action_appearance">False</property>
+                                    <property name="stock_id">gtk-add</property>
+                                    <signal name="clicked" handler="hkl_gui_window_toolbutton_add_reflection_clicked_cb" swapped="no"/>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="homogeneous">True</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkToolButton" id="toolbutton_goto_reflection">
+                                    <property name="use_action_appearance">False</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="use_action_appearance">False</property>
+                                    <property name="stock_id">gtk-jump-to</property>
+                                    <signal name="clicked" handler="hkl_gui_window_toolbutton_goto_reflection_clicked_cb" swapped="no"/>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="homogeneous">True</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkToolButton" id="toolbutton_del_reflection">
+                                    <property name="use_action_appearance">False</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="use_action_appearance">False</property>
+                                    <property name="stock_id">gtk-delete</property>
+                                    <signal name="clicked" handler="hkl_gui_window_toolbutton_del_reflection_clicked_cb" swapped="no"/>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="homogeneous">True</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkSeparatorToolItem" id="separatortoolitem1">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                  </packing>
+                                </child>
                               </object>
                               <packing>
-                                <property name="left_attach">2</property>
-                                <property name="right_attach">3</property>
-                                <property name="top_attach">3</property>
-                                <property name="bottom_attach">4</property>
-                                <property name="x_options"></property>
-                                <property name="y_options"></property>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkSpinButton" id="spinbutton_b_star">
+                              <object class="GtkScrolledWindow" id="scrolledwindow1">
                                 <property name="visible">True</property>
-                                <property name="sensitive">False</property>
                                 <property name="can_focus">True</property>
-                                <property name="invisible_char">&#x25CF;</property>
-                                <property name="adjustment">adjustment29</property>
-                                <property name="climb_rate">1</property>
-                                <property name="digits">3</property>
-                                <property name="numeric">True</property>
+                                <property name="hscrollbar_policy">never</property>
+                                <property name="shadow_type">in</property>
+                                <child>
+                                  <object class="GtkTreeView" id="treeview_reflections">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="model">liststore_reflections</property>
+                                    <property name="headers_clickable">False</property>
+                                    <property name="rules_hint">True</property>
+                                    <signal name="key-press-event" handler="hkl_gui_window_treeview_reflections_key_press_event_cb" swapped="no"/>
+                                    <child internal-child="selection">
+                                      <object class="GtkTreeSelection" id="treeview-selection6">
+                                        <property name="mode">multiple</property>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="treeviewcolumn9">
+                                        <property name="title" translatable="yes">index</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="cellrenderertext6"/>
+                                          <attributes>
+                                            <attribute name="text">0</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="treeviewcolumn10">
+                                        <property name="title" translatable="yes">h</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="cellrenderertext7">
+                                            <property name="editable">True</property>
+                                            <signal name="edited" handler="hkl_gui_window_cellrenderertext7_edited_cb" swapped="no"/>
+                                          </object>
+                                          <attributes>
+                                            <attribute name="text">1</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="treeviewcolumn11">
+                                        <property name="title" translatable="yes">k</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="cellrenderertext8">
+                                            <property name="editable">True</property>
+                                            <signal name="edited" handler="hkl_gui_window_cellrenderertext8_edited_cb" swapped="no"/>
+                                          </object>
+                                          <attributes>
+                                            <attribute name="text">2</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="treeviewcolumn12">
+                                        <property name="title" translatable="yes">l</property>
+                                        <child>
+                                          <object class="GtkCellRendererText" id="cellrenderertext9">
+                                            <property name="editable">True</property>
+                                            <signal name="edited" handler="hkl_gui_window_cellrenderertext9_edited_cb" swapped="no"/>
+                                          </object>
+                                          <attributes>
+                                            <attribute name="text">3</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child>
+                                      <object class="GtkTreeViewColumn" id="treeviewcolumn13">
+                                        <property name="title" translatable="yes">flag</property>
+                                        <child>
+                                          <object class="GtkCellRendererToggle" id="cellrenderertoggle1">
+                                            <signal name="toggled" handler="hkl_gui_window_cellrenderertoggle1_toggled_cb" swapped="no"/>
+                                          </object>
+                                          <attributes>
+                                            <attribute name="active">4</attribute>
+                                          </attributes>
+                                        </child>
+                                      </object>
+                                    </child>
+                                  </object>
+                                </child>
                               </object>
                               <packing>
-                                <property name="left_attach">1</property>
-                                <property name="right_attach">2</property>
-                                <property name="top_attach">1</property>
-                                <property name="bottom_attach">2</property>
-                                <property name="x_options"></property>
-                                <property name="y_options"></property>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">1</property>
                               </packing>
                             </child>
                           </object>
                           <packing>
-                            <property name="position">3</property>
+                            <property name="position">2</property>
                           </packing>
                         </child>
                         <child type="tab">
-                          <object class="GtkLabel" id="label2">
+                          <object class="GtkLabel" id="label16">
                             <property name="visible">True</property>
-                            <property name="label" translatable="yes">extra</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">reflections</property>
                           </object>
                           <packing>
-                            <property name="position">3</property>
+                            <property name="position">2</property>
                             <property name="tab_fill">False</property>
+                            <property name="reorderable">True</property>
+                            <property name="detachable">True</property>
                           </packing>
                         </child>
                       </object>
                       <packing>
+                        <property name="expand">True</property>
+                        <property name="fill">True</property>
                         <property name="position">2</property>
                       </packing>
                     </child>
                   </object>
-                  <packing>
-                    <property name="position">1</property>
-                  </packing>
                 </child>
                 <child type="tab">
                   <object class="GtkLabel" id="label10">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="margin_bottom">1</property>
                     <property name="label" translatable="yes">crystals</property>
                   </object>
                   <packing>
-                    <property name="position">1</property>
                     <property name="tab_fill">False</property>
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkFrame" id="frame10">
+                  <object class="GtkScrolledWindow" id="scrolledwindow3">
                     <property name="visible">True</property>
-                    <property name="no_show_all">True</property>
-                    <property name="border_width">6</property>
-                    <property name="label_xalign">0</property>
-                    <property name="shadow_type">none</property>
+                    <property name="can_focus">True</property>
+                    <property name="shadow_type">in</property>
                     <child>
-                      <object class="GtkAlignment" id="alignment10">
+                      <object class="GtkViewport" id="viewport1">
                         <property name="visible">True</property>
-                        <property name="left_padding">12</property>
+                        <property name="can_focus">False</property>
                         <child>
-                          <object class="GtkHBox" id="hbox6">
+                          <object class="GtkAlignment" id="alignment2">
                             <property name="visible">True</property>
-                            <property name="border_width">6</property>
-                            <child>
-                              <object class="GtkLabel" id="label42">
-                                <property name="visible">True</property>
-                                <property name="label" translatable="yes">Lambda : </property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
+                            <property name="can_focus">False</property>
                             <child>
-                              <object class="GtkSpinButton" id="spinbutton_lambda">
+                              <object class="GtkVBox" id="vbox2">
                                 <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="invisible_char">&#x25CF;</property>
-                                <property name="adjustment">adjustment4</property>
-                                <property name="climb_rate">1</property>
-                                <property name="digits">3</property>
+                                <property name="can_focus">False</property>
+                                <child>
+                                  <placeholder/>
+                                </child>
                               </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="position">1</property>
-                              </packing>
                             </child>
                           </object>
                         </child>
                       </object>
                     </child>
-                    <child type="label">
-                      <object class="GtkLabel" id="label41">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes"><b>Source</b></property>
-                        <property name="use_markup">True</property>
-                      </object>
-                    </child>
                   </object>
                   <packing>
-                    <property name="position">2</property>
-                    <property name="tab_fill">False</property>
+                    <property name="position">1</property>
                   </packing>
                 </child>
                 <child type="tab">
-                  <object class="GtkLabel" id="label7">
+                  <object class="GtkLabel" id="label11">
                     <property name="visible">True</property>
-                    <property name="label" translatable="yes">source</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">pseudo axes</property>
                   </object>
                   <packing>
-                    <property name="position">2</property>
+                    <property name="position">1</property>
                     <property name="tab_fill">False</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkVBox" id="vbox7">
                     <property name="visible">True</property>
-                    <property name="orientation">vertical</property>
+                    <property name="can_focus">False</property>
                     <child>
                       <placeholder/>
                     </child>
                   </object>
                   <packing>
-                    <property name="position">3</property>
+                    <property name="position">2</property>
                   </packing>
                 </child>
                 <child type="tab">
                   <object class="GtkLabel" id="label15">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="label" translatable="yes">3D</property>
                   </object>
                   <packing>
-                    <property name="position">3</property>
+                    <property name="position">2</property>
                     <property name="tab_fill">False</property>
                   </packing>
                 </child>
@@ -2119,12 +3021,15 @@
             </child>
           </object>
           <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
             <property name="position">1</property>
           </packing>
         </child>
         <child>
           <object class="GtkStatusbar" id="statusbar">
             <property name="visible">True</property>
+            <property name="can_focus">False</property>
           </object>
           <packing>
             <property name="expand">False</property>
@@ -2135,167 +3040,4 @@
       </object>
     </child>
   </object>
-  <object class="GtkAdjustment" id="adjustment30">
-    <property name="upper">100</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
-  <object class="GtkAdjustment" id="adjustment31">
-    <property name="upper">100</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
-  <object class="GtkAdjustment" id="adjustment32">
-    <property name="lower">-180</property>
-    <property name="upper">180</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
-  <object class="GtkAdjustment" id="adjustment33">
-    <property name="lower">-180</property>
-    <property name="upper">180</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
-  <object class="GtkAdjustment" id="adjustment34">
-    <property name="lower">-180</property>
-    <property name="upper">180</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
-  <object class="GtkDialog" id="dialog1">
-    <property name="visible">True</property>
-    <property name="border_width">5</property>
-    <property name="title" translatable="yes">Preferences</property>
-    <property name="resizable">False</property>
-    <property name="type_hint">normal</property>
-    <child internal-child="vbox">
-      <object class="GtkVBox" id="dialog-vbox1">
-        <property name="visible">True</property>
-        <property name="orientation">vertical</property>
-        <property name="spacing">2</property>
-        <child>
-          <object class="GtkHBox" id="hbox2">
-            <property name="visible">True</property>
-            <child>
-              <object class="GtkLabel" id="label1">
-                <property name="visible">True</property>
-                <property name="label" translatable="yes">Diffractometer type : </property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkComboBox" id="combobox1">
-                <property name="visible">True</property>
-                <property name="model">liststore1</property>
-                <child>
-                  <object class="GtkCellRendererText" id="cellrenderertext1"/>
-                  <attributes>
-                    <attribute name="text">0</attribute>
-                  </attributes>
-                </child>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area1">
-            <property name="visible">True</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="button1">
-                <property name="label">gtk-close</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="pack_type">end</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-      </object>
-    </child>
-    <action-widgets>
-      <action-widget response="0">button1</action-widget>
-    </action-widgets>
-  </object>
-  <object class="GtkAdjustment" id="adjustment35">
-    <property name="lower">-100</property>
-    <property name="upper">100</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
-  <object class="GtkAdjustment" id="adjustment36">
-    <property name="lower">-100</property>
-    <property name="upper">100</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
-  <object class="GtkAdjustment" id="adjustment37">
-    <property name="lower">-100</property>
-    <property name="upper">100</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
-  <object class="GtkAdjustment" id="adjustment38">
-    <property name="lower">-100</property>
-    <property name="upper">100</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
-  <object class="GtkAdjustment" id="adjustment39">
-    <property name="lower">-100</property>
-    <property name="upper">100</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
-  <object class="GtkAdjustment" id="adjustment40">
-    <property name="lower">-100</property>
-    <property name="upper">100</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
-  <object class="GtkAdjustment" id="adjustment41">
-    <property name="lower">-100</property>
-    <property name="upper">100</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
-  <object class="GtkAdjustment" id="adjustment42">
-    <property name="lower">-100</property>
-    <property name="upper">100</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
-  <object class="GtkAdjustment" id="adjustment43">
-    <property name="lower">-100</property>
-    <property name="upper">100</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
-  </object>
 </interface>
diff --git a/gui/hkl3d/hkl3d-gui-gl.c b/gui/hkl-gui-3d-gl.c
similarity index 99%
rename from gui/hkl3d/hkl3d-gui-gl.c
rename to gui/hkl-gui-3d-gl.c
index 92137a2..93869e9 100644
--- a/gui/hkl3d/hkl3d-gui-gl.c
+++ b/gui/hkl-gui-3d-gl.c
@@ -35,7 +35,7 @@
 #include <g3d/vector.h>
 #include <g3d/face.h>
 
-#include "hkl3d-gui-gl.h"
+#include "hkl-gui-3d-gl.h"
 
 struct _G3DGLRenderState {
 	gint32 gl_dlist, gl_dlist_shadow;
@@ -686,7 +686,6 @@ void gl_draw(G3DGLRenderOptions *options, G3DModel *model)
 	G3DVector plane[3] = { 0.0, -20.0, 0.0 };
 	G3DVector normal[3] = { 0.0, -1.0, 0.0 };
 
-
 	if(!options->initialized)
 	{
 		gl_init();
@@ -697,7 +696,7 @@ void gl_draw(G3DGLRenderOptions *options, G3DModel *model)
 	}
 
 	/* prepare viewport */
-	//gl_setup_view(options);
+	gl_setup_view(options);
 
 	/* reset texture */
 	glBindTexture (GL_TEXTURE_2D, 0);
@@ -742,7 +741,6 @@ void gl_draw(G3DGLRenderOptions *options, G3DModel *model)
 			gl_draw_objects(options, model->objects, 0.0, 1.0, TRUE);
 			glEndList();
 		}
-
 	}
 
 	g_return_if_fail(options->state != NULL);
@@ -789,9 +787,7 @@ void gl_draw(G3DGLRenderOptions *options, G3DModel *model)
 	/* execute display list */
 	glCallList(options->state->gl_dlist);
 
-
-/* get time to draw one frame to compare algorithms */
-#ifdef TIMING
+#ifdef TIMING /* get time to draw one frame to compare algorithms */
 	g_timer_stop(timer);
 
 	if(!ignore_timing) {
diff --git a/gui/hkl3d/hkl3d-gui-gl.h b/gui/hkl-gui-3d-gl.h
similarity index 100%
rename from gui/hkl3d/hkl3d-gui-gl.h
rename to gui/hkl-gui-3d-gl.h
diff --git a/gui/hkl-gui-3d.c b/gui/hkl-gui-3d.c
new file mode 100644
index 0000000..ad99a5b
--- /dev/null
+++ b/gui/hkl-gui-3d.c
@@ -0,0 +1,1147 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ *	    Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+ */
+#include <gtk/gtkgl.h>
+#include <GL/gl.h>
+#include <g3d/quat.h>
+
+#include "hkl3d.h"
+#include "hkl-gui.h"
+#include "hkl-gui-macros.h"
+#include "hkl-gui-3d.h"
+#include "hkl-gui-3d-gl.h"
+
+/*
+ * updates glarea widget (redraw)
+ */
+static void glarea_update(GtkWidget *glarea)
+{
+	gtk_widget_queue_draw_area(glarea,
+				   0, 0,
+				   glarea->allocation.width,
+				   glarea->allocation.height);
+}
+
+
+typedef enum  {
+	HKL_GUI_3D_COL_NAME = 0,
+	HKL_GUI_3D_COL_HIDE,
+	HKL_GUI_3D_COL_MODEL,
+	HKL_GUI_3D_COL_OBJECT,
+	HKL_GUI_3D_COL_NUM_COLS
+} HklGui3DCol;
+
+enum {
+	PROP_0,
+
+	PROP_FILENAME,
+	PROP_GEOMETRY,
+
+	N_PROPERTIES
+};
+
+/* Keep a pointer to the properties definition */
+static GParamSpec *obj_properties[N_PROPERTIES] = { NULL, };
+
+enum {
+	CHANGED,
+
+	N_SIGNALS
+};
+
+static guint signals[N_SIGNALS] = { 0 };
+
+
+struct _HklGui3D {
+	GObject parent_instance;
+
+	/*< private >*/
+	HklGui3DPrivate * priv;
+};
+
+struct _HklGui3DClass {
+	GObjectClass parent_class;
+
+};
+
+struct _HklGui3DPrivate {
+	/* Properties */
+	char *filename;
+	HklGeometry *geometry;
+	/* Properties */
+
+	GtkBuilder *builder;
+
+	GtkFrame *frame1;
+	GtkVBox *vbox1;
+	GtkTreeView *treeview1;
+	GtkToolButton *toolbutton1;
+	GtkToolButton *toolbutton2;
+	GtkToolButton *toolbutton3;
+	GtkFileChooserDialog *filechooserdialog1;
+	GtkButton *button1;
+	GtkButton *button2;
+	GtkTreeStore *treestore1;
+	GtkDrawingArea *drawingarea1;
+
+	Hkl3D *hkl3d;
+
+	/* opengl connected to the drawingarea1 */
+	G3DGLRenderOptions renderoptions;
+	struct {
+		gint32 beginx;
+		gint32 beginy;
+	} mouse;
+	gboolean aabb;
+};
+
+G_DEFINE_TYPE (HklGui3D, hkl_gui_3d, G_TYPE_OBJECT);
+
+#define HKL_GUI_3D_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), HKL_GUI_TYPE_3D, HklGui3DPrivate))
+
+
+static void hkl_gui_3d_update_hkl3d_objects_TreeStore(HklGui3D *self)
+{
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
+	size_t i;
+	size_t j;
+
+	gtk_tree_store_clear(priv->treestore1);
+
+	for(i=0; i<priv->hkl3d->config->len; ++i){
+		GtkTreeIter iter = {0};
+
+		gtk_tree_store_append(priv->treestore1, &iter, NULL);
+		gtk_tree_store_set(priv->treestore1, &iter,
+				   HKL_GUI_3D_COL_NAME, priv->hkl3d->config->models[i]->filename,
+				   HKL_GUI_3D_COL_MODEL, priv->hkl3d->config->models[i],
+				   HKL_GUI_3D_COL_OBJECT, NULL,
+				   -1);
+
+		for(j=0; j<priv->hkl3d->config->models[i]->len; ++j){
+			GtkTreeIter citer = {0};
+
+			gtk_tree_store_append(priv->treestore1, &citer, &iter);
+			gtk_tree_store_set(priv->treestore1, &citer,
+					   HKL_GUI_3D_COL_NAME, priv->hkl3d->config->models[i]->objects[j]->axis_name,
+					   HKL_GUI_3D_COL_HIDE, priv->hkl3d->config->models[i]->objects[j]->hide,
+					   HKL_GUI_3D_COL_MODEL, priv->hkl3d->config->models[i],
+					   HKL_GUI_3D_COL_OBJECT, priv->hkl3d->config->models[i]->objects[j],
+					   -1);
+		}
+	}
+}
+
+/* properties */
+
+static const char *
+hkl_gui_3d_get_filename(HklGui3D *self)
+{
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
+
+	return priv->filename;
+}
+
+static HklGeometry *
+hkl_gui_3d_get_geometry(HklGui3D *self)
+{
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
+
+	return priv->geometry;
+}
+
+void _filename_and_geometry(HklGui3D *self)
+{
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
+	if(priv->filename && priv->geometry){
+		if (priv->hkl3d)
+			hkl3d_free(priv->hkl3d);
+		priv->hkl3d = hkl3d_new(priv->filename, priv->geometry);
+		if(priv->hkl3d){
+			/* priv->scene = hkl_gui_3d_scene_new(priv->hkl3d, FALSE, FALSE, FALSE, FALSE); */
+
+			hkl_gui_3d_update_hkl3d_objects_TreeStore(self);
+			/* gtk_box_pack_start(GTK_BOX(priv->vbox1), */
+			/* 		   GTK_WIDGET(priv->scene), */
+			/* 		   TRUE, TRUE, 0); */
+			/* gtk_widget_show_all(GTK_WIDGET(priv->vbox1)); */
+		}
+	}
+}
+
+static void
+hkl_gui_3d_set_filename(HklGui3D *self, const char *filename)
+{
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
+
+	if(priv->filename)
+		g_free(priv->filename);
+	priv->filename = g_strdup(filename);
+
+	_filename_and_geometry(self);
+}
+
+static void
+hkl_gui_3d_set_geometry(HklGui3D *self, HklGeometry *geometry)
+{
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
+
+	priv->geometry = geometry;
+	_filename_and_geometry(self);
+}
+
+static void
+set_property (GObject *object, guint prop_id,
+	      const GValue *value, GParamSpec *pspec)
+{
+	HklGui3D *self = HKL_GUI_3D (object);
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
+
+	switch (prop_id) {
+	case PROP_FILENAME:
+		hkl_gui_3d_set_filename(self, g_value_get_string (value));
+		break;
+	case PROP_GEOMETRY:
+		hkl_gui_3d_set_geometry(self, g_value_get_pointer (value));
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+		break;
+	}
+}
+
+static void
+get_property (GObject *object, guint prop_id,
+	      GValue *value, GParamSpec *pspec)
+{
+	HklGui3D *self = HKL_GUI_3D (object);
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
+
+	switch (prop_id)
+	{
+	case PROP_FILENAME:
+		g_value_set_string (value, hkl_gui_3d_get_filename (self));
+		break;
+	case PROP_GEOMETRY:
+		g_value_set_pointer (value, hkl_gui_3d_get_geometry (self));
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+		break;
+	}
+}
+
+static void
+finalize (GObject* object)
+{
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(object);
+
+
+	g_free(priv->filename);
+
+	g_object_unref(priv->builder);
+
+	hkl3d_free(priv->hkl3d);
+
+	G_OBJECT_CLASS (hkl_gui_3d_parent_class)->finalize (object);
+}
+
+HklGui3D*
+hkl_gui_3d_new (const char *filename, HklGeometry *geometry)
+{
+	return g_object_new (HKL_GUI_TYPE_3D,
+			     "filename", filename,
+			     "geometry", geometry,
+			     NULL);
+}
+
+GtkFrame *hkl_gui_3d_frame_get(HklGui3D *self)
+{
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
+
+	return priv->frame1;
+}
+
+void hkl_gui_3d_is_colliding(HklGui3D *self)
+{
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
+
+	if(priv->hkl3d)
+		hkl3d_is_colliding(priv->hkl3d);
+}
+
+void hkl_gui_3d_invalidate(HklGui3D *self)
+{
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
+
+	priv->renderoptions.updated = TRUE;
+	glarea_update(GTK_WIDGET(priv->drawingarea1));
+}
+
+/************/
+/* Callback */
+/************/
+
+void hkl_gui_3d_cellrenderertext2_toggled_cb(GtkCellRendererToggle* renderer,
+					     const gchar* path, gpointer user_data)
+{
+	HklGui3D *self = HKL_GUI_3D(user_data);
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
+	guint hide;
+	Hkl3DObject *object;
+	GtkTreeIter iter = {0};
+
+
+	gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv->treestore1),
+					     &iter, path);
+	gtk_tree_model_get (GTK_TREE_MODEL(priv->treestore1),
+			    &iter,
+			    HKL_GUI_3D_COL_OBJECT, &object,
+			    -1);
+
+	hide = !gtk_cell_renderer_toggle_get_active(renderer);
+
+	if(object){
+		hkl3d_hide_object(priv->hkl3d, object, hide);
+		gtk_tree_store_set (priv->treestore1,
+				    &iter,
+				    HKL_GUI_3D_COL_HIDE, hide,
+				    -1);
+		hkl_gui_3d_is_colliding(self);
+		hkl_gui_3d_invalidate(self);
+	}else{
+		Hkl3DModel *model;
+
+		gtk_tree_model_get (GTK_TREE_MODEL(priv->treestore1),
+				    &iter,
+				    HKL_GUI_3D_COL_MODEL, &model,
+				    -1);
+		if(model){
+			GtkTreeIter children = {0};
+			gboolean valid;
+			size_t i = 0;
+
+			gtk_tree_store_set (priv->treestore1,
+					    &iter,
+					    HKL_GUI_3D_COL_HIDE, hide,
+					    -1);
+
+			/* set all the children rows */
+			valid = gtk_tree_model_iter_children(GTK_TREE_MODEL(priv->treestore1),
+							     &children, &iter);
+			while(valid){
+				hkl3d_hide_object(priv->hkl3d, model->objects[i++], hide);
+				gtk_tree_store_set (priv->treestore1,
+						    &children,
+						    HKL_GUI_3D_COL_HIDE, hide,
+						    -1);
+
+				valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(priv->treestore1), &children);
+			}
+			hkl_gui_3d_is_colliding(self);
+			hkl_gui_3d_invalidate(self);
+		}
+	}
+}
+
+void hkl_gui_3d_treeview1_cursor_changed_cb(GtkTreeView *tree_view,
+					    gpointer user_data)
+{
+	int i;
+	int j;
+	HklGui3D *self = user_data;
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
+	GtkTreeIter iter = {0};
+	Hkl3DObject *object;
+	GtkTreePath *path;
+	GtkTreeViewColumn * column;
+
+	gtk_tree_view_get_cursor(priv->treeview1, &path, &column);
+	gtk_tree_model_get_iter(GTK_TREE_MODEL(priv->treestore1), &iter, path);
+	gtk_tree_path_free(path);
+
+	/* need to unselect of objects of all 3d models */
+	for(i=0; i<priv->hkl3d->config->len; ++i)
+		for(j=0; j<priv->hkl3d->config->models[i]->len; ++j)
+			priv->hkl3d->config->models[i]->objects[j]->selected = FALSE;
+
+	/* now select the right object */
+	gtk_tree_model_get (GTK_TREE_MODEL(priv->treestore1),
+			    &iter,
+			    HKL_GUI_3D_COL_OBJECT, &object,
+			    -1);
+	if(object)
+		object->selected = TRUE;
+
+	hkl_gui_3d_invalidate(self);
+}
+
+void hkl_gui_3d_toolbutton1_clicked_cb(GtkToolButton *toolbutton,
+				       gpointer user_data)
+{
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
+
+	gtk_widget_show(GTK_WIDGET(priv->filechooserdialog1));
+}
+
+/* remove an object from the model */
+void hkl_gui_3d_toolbutton2_clicked_cb(GtkToolButton *toolbutton,
+				       gpointer user_data)
+{
+	HklGui3D *self = user_data;
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
+	GtkTreeIter iter = {0};
+	GtkTreePath *path;
+	GtkTreeViewColumn * column;
+	Hkl3DObject *object;
+	int i;
+	int j;
+
+	gtk_tree_view_get_cursor(priv->treeview1, &path, &column);
+	gtk_tree_model_get_iter(GTK_TREE_MODEL(priv->treestore1), &iter, path);
+	gtk_tree_path_free(path);
+
+	gtk_tree_model_get (GTK_TREE_MODEL(priv->treestore1),
+			    &iter,
+			    HKL_GUI_3D_COL_OBJECT, &object,
+			    -1);
+	if(object){
+		hkl3d_remove_object(priv->hkl3d, object);
+		hkl_gui_3d_update_hkl3d_objects_TreeStore(self);
+		hkl_gui_3d_invalidate(self);
+	}
+}
+
+static void
+reset_3d(G3DGLRenderOptions *renderoptions)
+{
+	/* renderoptions */
+	renderoptions->updated = TRUE;
+	renderoptions->initialized = FALSE;
+        renderoptions->zoom = 7;
+        renderoptions->bgcolor[0] = 0.9;
+        renderoptions->bgcolor[1] = 0.8;
+        renderoptions->bgcolor[2] = 0.6;
+        renderoptions->bgcolor[3] = 1.0;
+	renderoptions->glflags =
+//		G3D_FLAG_GL_ISOMETRIC |
+		G3D_FLAG_GL_SPECULAR |
+		G3D_FLAG_GL_SHININESS |
+		G3D_FLAG_GL_TEXTURES |
+		G3D_FLAG_GL_COLORS|
+		G3D_FLAG_GL_COORD_AXES;
+
+        g3d_quat_trackball(renderoptions->quat, 0.0, 0.0, 0.0, 0.0, 0.8);
+
+	/* rotate a little bit */
+	gfloat q1[4], q2[4];
+	gfloat a1[3] = { 0.0, 1.0, 0.0 }, a2[3] = {1.0, 0.0, 1.0};
+
+	g3d_quat_rotate(q1, a1, - 45.0 * G_PI / 180.0);
+	g3d_quat_rotate(q2, a2, - 45.0 * G_PI / 180.0);
+	g3d_quat_add(renderoptions->quat, q1, q2);
+}
+
+/* re-initialize the 3d view */
+void hkl_gui_3d_toolbutton3_clicked_cb(GtkToolButton *toolbutton,
+				       gpointer user_data)
+{
+	HklGui3D *self = user_data;
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
+
+	reset_3d(&priv->renderoptions);
+	hkl_gui_3d_invalidate(self);
+}
+
+void hkl_gui_3d_toolbutton4_toggled_cb(GtkToggleToolButton *toggle_tool_button,
+				       gpointer user_data)
+{
+	HklGui3D *self = user_data;
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
+
+	priv->aabb = gtk_toggle_tool_button_get_active(toggle_tool_button);
+	hkl_gui_3d_invalidate(self);
+}
+
+void hkl_gui_3d_button1_clicked_cb(GtkButton *button,
+				   gpointer user_data)
+{
+	HklGui3D *self = user_data;
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
+	size_t i;
+	GSList *filenames;
+	GSList *filename;
+
+	filenames = gtk_file_chooser_get_files(GTK_FILE_CHOOSER(priv->filechooserdialog1));
+	filename = filenames;
+	while(filename){
+		GFile *file = filename->data;
+		GFile *directory = g_file_get_parent(file);
+		char *basename = g_file_get_basename(file);
+		char *path = g_file_get_path(directory);
+
+		hkl3d_add_model_from_file(priv->hkl3d, basename, path);
+		hkl3d_connect_all_axes(priv->hkl3d);
+
+		g_free(path);
+		g_free(basename);
+		g_object_unref(G_OBJECT(directory));
+		g_object_unref(G_OBJECT(file));
+		filename = g_slist_next(filename);
+	};
+
+	hkl_gui_3d_update_hkl3d_objects_TreeStore(self);
+	gtk_widget_hide(GTK_WIDGET(priv->filechooserdialog1));
+	g_slist_free(filenames);
+}
+
+void hkl_gui_3d_button2_clicked_cb(GtkButton *button,
+				   gpointer user_data)
+{
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
+
+	gtk_widget_hide(GTK_WIDGET(priv->filechooserdialog1));
+}
+
+/***************/
+/* OpenGL part */
+/***************/
+
+enum DisplayList {
+	MODEL = 1,
+	BULLET,
+	COLLISION,
+	AABBBOX,
+	HIGHLIGHT
+};
+
+static void hkl_gui_3d_draw_g3dmodel(HklGui3D *self)
+{
+	int i;
+	int j;
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
+
+	/* set the alpha canal to 0.5 if there is a collision */
+	for(i=0; i<priv->hkl3d->config->len; i++)
+		for(j=0; j<priv->hkl3d->config->models[i]->len; j++){
+			GSList *faces;
+			G3DFace *face;
+			G3DMaterial *material;
+			double alpha;
+
+			if(priv->hkl3d->config->models[i]->objects[j]->is_colliding)
+				alpha = 0.5;
+			else
+				alpha = 1;
+
+			faces = priv->hkl3d->config->models[i]->objects[j]->g3d->faces;
+			while(faces){
+				face = (G3DFace *)(faces->data);
+				face->material->a = alpha;
+				faces = g_slist_next(faces);
+			}
+		}
+
+	/* draw the G3DObjects */
+	gl_draw(&priv->renderoptions, priv->hkl3d->model);
+}
+
+static void draw_g3dObject(G3DObject *object)
+{
+	GSList *faces;
+	G3DFace *face;
+	float *vertex;
+
+	faces = object->faces;
+	vertex = object->vertex_data;
+
+	glPushMatrix();
+
+	/* apply the transformation of the object */
+	if(object->transformation)
+		glMultMatrixf(object->transformation->matrix);
+
+	/* draw all faces with the current stencil */
+	while(faces){
+		G3DFace * face;
+
+		face = (G3DFace*)faces->data;
+		glBegin(GL_TRIANGLES);
+		glVertex3d(vertex[3*(face->vertex_indices[0])],
+			   vertex[3*(face->vertex_indices[0])+1],
+			   vertex[3*(face->vertex_indices[0])+2]);
+		glVertex3d(vertex[3*(face->vertex_indices[1])],
+			   vertex[3*(face->vertex_indices[1])+1],
+			   vertex[3*(face->vertex_indices[1])+2]);
+		glVertex3d(vertex[3*(face->vertex_indices[2])],
+			   vertex[3*(face->vertex_indices[2])+1],
+			   vertex[3*(face->vertex_indices[2])+2]);
+		glEnd();
+		faces = g_slist_next(faces);
+	}
+
+	glPopMatrix();
+}
+
+void hkl_gui_3d_draw_selected(HklGui3D *self)
+{
+	int i;
+	int j;
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
+
+	/* glDisable(GL_LIGHTING); */
+
+	for(i=0; i<priv->hkl3d->config->len; i++)
+		for(j=0; j<priv->hkl3d->config->models[i]->len; j++){
+			if(priv->hkl3d->config->models[i]->objects[j]->selected
+			   && !priv->hkl3d->config->models[i]->objects[j]->hide){
+				// Push the GL attribute bits so that we don't wreck any settings
+				glPushAttrib( GL_ALL_ATTRIB_BITS );
+
+				// Enable polygon offsets, and offset filled polygons forward by 2.5
+				glEnable( GL_POLYGON_OFFSET_FILL );
+				glPolygonOffset( -2.5, -2.5);
+
+				// Set the render mode to be line rendering with a thick line width
+				glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
+				glLineWidth( 3.f );
+				// Set the colour to be pink
+				glColor3f( 1.f, .0f, 1.f );
+				// Render the object
+				draw_g3dObject(priv->hkl3d->config->models[i]->objects[j]->g3d);
+				// Set the polygon mode to be filled triangles
+				glLineWidth( 1.f );
+				glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+				// Set the colour to the background
+				glCullFace(GL_FRONT);
+				glColor3f( 0.0f, 0.0f, 0.0f );
+				// Render the object
+				draw_g3dObject(priv->hkl3d->config->models[i]->objects[j]->g3d);
+
+				// Pop the state changes off the attribute
+				// to set things back how they were
+				glPopAttrib();
+			}
+		}
+	/* glEnable(GL_LIGHTING); */
+}
+
+static void draw_sphere(float radius, int lats, int longs)
+{
+	int i, j;
+	for(i=0;i<=lats;i++){
+		float lat0 = M_PI * (-0.5 + (float) (i - 1) / lats);
+		float z0  = radius * sin(lat0);
+		float zr0 =  radius * cos(lat0);
+
+		float lat1 = M_PI * (-0.5 + (float) i / lats);
+		float z1 = radius * sin(lat1);
+		float zr1 = radius * cos(lat1);
+
+		glBegin(GL_QUAD_STRIP);
+		for(j=0;j<=longs;j++) {
+			float lng = 2 * M_PI * (float) (j - 1) / longs;
+			float x = cos(lng);
+			float y = sin(lng);
+
+			glNormal3f(x * zr1, y * zr1, z1);
+			glVertex3f(x * zr1, y * zr1, z1);
+			glNormal3f(x * zr0, y * zr0, z0);
+			glVertex3f(x * zr0, y * zr0, z0);
+		}
+		glEnd();
+	}
+}
+
+void hkl_gui_3d_draw_collisions(HklGui3D *self)
+{
+	int i;
+	int numManifolds;
+	gboolean isColliding;
+	float m[16];
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
+
+	/* glDisable(GL_LIGHTING); */
+	///one way to draw all the contact points is iterating over contact manifolds / points:
+	numManifolds = hkl3d_get_nb_manifolds(priv->hkl3d);
+	for (i=0; i<numManifolds; i++){
+		int numContacts;
+		int j;
+
+		// now draw the manifolds / points
+		numContacts = hkl3d_get_nb_contacts(priv->hkl3d, i);
+		for (j=0; j<numContacts; j++){
+			double xa, ya, za;
+			double xb, yb, zb;
+
+			hkl3d_get_collision_coordinates(priv->hkl3d, i, j,
+							&xa, &ya, &za, &xb, &yb, &zb);
+
+			glDisable(GL_DEPTH_TEST);
+			glBegin(GL_LINES);
+			glColor4f(0, 0, 0, 1);
+			glVertex3d(xa, ya, za);
+			glVertex3d(xb, yb, zb);
+			glEnd();
+			glColor4f(1, 0, 0, 1);
+			glPushMatrix();
+			glTranslatef (xb, yb, zb);
+			glScaled(0.05,0.05,0.05);
+
+			draw_sphere(1, 10, 10);
+
+			glPopMatrix();
+			glColor4f(1, 1, 0, 1);
+			glPushMatrix();
+			glTranslatef (xa, ya, za);
+			glScaled(0.05,0.05,0.05);
+
+			draw_sphere(1, 10, 10);
+
+			glPopMatrix();
+			glEnable(GL_DEPTH_TEST);
+		}
+	}
+	glFlush();
+}
+
+static void draw_line(const float from[3], const float to[3],
+		      const float fromColor[3], const float toColor[3])
+{
+	glBegin(GL_LINES);
+	glColor3f(fromColor[0], fromColor[1], fromColor[2]);
+	glVertex3d(from[0], from[1], from[2]);
+	glColor3f(toColor[0], toColor[1], toColor[2]);
+	glVertex3d(to[0], to[1], to[2]);
+	glEnd();
+}
+
+static void draw_aabb(const float from[3], const float to[3], const float color[3])
+{
+	float halfExtents[3] = {
+		(to[0] - from[0]) * .5,
+		(to[1] - from[1]) * .5,
+		(to[2] - from[2]) * .5
+	};
+	float center[3] = {
+		(to[0] + from[0]) * .5,
+		(to[1] + from[1]) * .5,
+		(to[2] + from[2]) * .5
+	};
+	int i, j;
+
+	float edgecoord[3] = {1., 1., 1.};
+
+	for (i=0;i<4;i++){
+		for (j=0;j<3;j++){
+			float pa[3] = {
+				edgecoord[0] * halfExtents[0] + center[0],
+				edgecoord[1] * halfExtents[1] + center[1],
+				edgecoord[2] * halfExtents[2] + center[2]
+			};
+
+			int othercoord = j % 3;
+			edgecoord[othercoord] *= -1.f;
+
+			float pb[3] = {
+				edgecoord[0] * halfExtents[0] + center[0],
+				edgecoord[1] * halfExtents[1] + center[1],
+				edgecoord[2] * halfExtents[2] + center[2]
+			};
+			draw_line(pa, pb, color, color);
+		}
+		edgecoord[0] = -1;
+		edgecoord[1] = -1;
+		edgecoord[2] = -1;
+		if (i < 3)
+			edgecoord[i] *= -1;
+	}
+}
+
+static void
+hkl_gui_3d_draw_aabb_object(const Hkl3DObject *self)
+{
+	GLfloat from[3];
+	GLfloat to[3];
+	GLfloat color[3] = {1, 0, 0};
+
+	if(self->hide)
+		return;
+
+	hkl3d_object_aabb_get(self, from, to);
+	draw_aabb(from, to, color);
+}
+
+void
+hkl_gui_3d_draw_aabb(const HklGui3D *self)
+{
+	int i;
+	int j;
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
+
+	for(i=0; i<priv->hkl3d->config->len; i++)
+		for(j=0; j<priv->hkl3d->config->models[i]->len; j++)
+			hkl_gui_3d_draw_aabb_object(priv->hkl3d->config->models[i]->objects[j]);
+	glFlush();
+}
+
+
+/* void hkl_gui_3d_draw_bullet_object(const Hkl3DObject *self) */
+/* { */
+/* 	int i; */
+/* 	int j; */
+/* 	btScalar m[16]; */
+/* 	btVector3 worldBoundsMin; */
+/* 	btVector3 worldBoundsMax; */
+/* 	btVector3 aabbMin,aabbMax; */
+
+/* 	/\* get the bounding box from bullet *\/ */
+/* 	hkl3d_get_bounding_boxes(_hkl3d, &worldBoundsMin, &worldBoundsMax); */
+
+/* 	object = _hkl3d->config->models[i]->objects[j]; */
+/* 	if(!object->hide){ */
+/* 		btCollisionObject *btObject; */
+
+/* 		btObject = object->btObject; */
+/* 		btObject->getWorldTransform().getOpenGLMatrix( m ); */
+/* 		m_shapeDrawer.drawOpenGL(m, */
+/* 					 btObject->getCollisionShape(), */
+/* 					 *object->color, */
+/* 					 0, /\* debug mode *\/ */
+/* 					 worldBoundsMin, */
+/* 					 worldBoundsMax); */
+/* 	} */
+/* 	glFlush(); */
+/* } */
+
+/* void */
+/* hkl_gui_3d_draw_bullet(const HklGui3D *self) */
+/* { */
+/* 	int i; */
+/* 	int j; */
+/* 	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self); */
+
+/* 	for(i=0; i<priv->hkl3d->config->len; i++) */
+/* 		for(j=0; j<priv->hkl3d->config->models[i]->len; j++) */
+/* 			hkl_gui_3d_draw_bullet_object(priv->hkl3d->config->models[i]->objects[j]); */
+/* 	glFlush(); */
+/* } */
+
+gboolean
+hkl_gui_3d_drawingarea1_expose_cb(GtkWidget *drawing_area, GdkEventExpose *event, gpointer user_data)
+{
+	GtkAllocation alloc;
+	HklGui3D *self = HKL_GUI_3D(user_data);
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
+	GdkGLContext *gl_context = gtk_widget_get_gl_context(drawing_area);
+	GdkGLDrawable *gl_drawable = gtk_widget_get_gl_drawable(drawing_area);
+
+	/* Delimits the begining of the OpenGL execution. */
+	if (!gdk_gl_drawable_gl_begin(gl_drawable, gl_context))
+		g_assert_not_reached();
+
+	gtk_widget_get_allocation(drawing_area, &alloc);
+	glViewport(0,0, alloc.width, alloc.height);
+	priv->renderoptions.aspect = (gfloat)alloc.width / (gfloat)alloc.height;
+
+	hkl_gui_3d_draw_g3dmodel(self);
+	hkl_gui_3d_draw_selected(self);
+	hkl_gui_3d_draw_collisions(self);
+	if(priv->aabb)
+		hkl_gui_3d_draw_aabb(self);
+	/* hkl_gui_3d_draw_bullet(self); */
+
+	/* swap buffer if we're using double-buffering */
+	if (gdk_gl_drawable_is_double_buffered(gl_drawable))
+		gdk_gl_drawable_swap_buffers(gl_drawable);
+	else {
+		glFlush();
+	}
+
+	/* Delimits the end of the OpenGL execution. */
+	gdk_gl_drawable_gl_end(gl_drawable);
+
+	return FALSE;
+}
+
+gboolean
+hkl_gui_3d_drawingarea1_configure_event_cb(GtkWidget *drawing_area,
+					   GdkEventConfigure *event,
+					   gpointer user_data)
+{
+	GtkAllocation alloc;
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
+	GdkGLContext *gl_context = gtk_widget_get_gl_context(drawing_area);
+	GdkGLDrawable *gl_drawable = gtk_widget_get_gl_drawable(drawing_area);
+
+	/* Delimits the begining of the OpenGL execution. */
+	if (!gdk_gl_drawable_gl_begin(gl_drawable, gl_context))
+		g_assert_not_reached();
+
+	gtk_widget_get_allocation(drawing_area, &alloc);
+	glViewport(0,0, alloc.width, alloc.height);
+	priv->renderoptions.aspect = (gfloat)alloc.width / (gfloat)alloc.height;
+
+	/* Delimits the end of the OpenGL execution. */
+	gdk_gl_drawable_gl_end(gl_drawable);
+
+	return FALSE;
+}
+
+gboolean
+hkl_gui_3d_idle_cb(gpointer user_data)
+{
+	/* update control data/params in this function if needed */
+	GtkWidget *drawing_area = GTK_WIDGET(user_data);
+
+	glarea_update(drawing_area);
+
+	return FALSE;
+}
+
+gboolean
+hkl_gui_3d_drawingarea1_button_press_event_cb(GtkWidget *drawing_area,
+					      GdkEventButton* event,
+					      gpointer user_data)
+{
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
+
+	/* left mouse buttom: rotate object */
+	if(event->button == 1)
+	{
+		priv->mouse.beginx = event->x;
+		priv->mouse.beginy = event->y;
+		return TRUE;
+	}
+
+	// don't block
+	return FALSE;
+}
+
+gboolean
+hkl_gui_3d_drawingarea1_scroll_event_cb(GtkWidget *drawing_area,
+					GdkEventScroll *event,
+					gpointer user_data)
+{
+	GtkAllocation alloc;
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
+
+	gtk_widget_get_allocation(drawing_area, &alloc);
+
+#define ZOOM_BY 10
+	if(event->direction == GDK_SCROLL_DOWN)
+		priv->renderoptions.zoom += ZOOM_BY;
+	else
+		priv->renderoptions.zoom -= ZOOM_BY;
+#undef ZOOM_BY
+
+	if(priv->renderoptions.zoom < 1)
+		priv->renderoptions.zoom = 1;
+	if(priv->renderoptions.zoom > 120)
+		priv->renderoptions.zoom = 120;
+
+	glarea_update(drawing_area);
+
+	return FALSE;
+}
+
+gboolean
+hkl_gui_3d_drawingarea1_motion_notify_event_cb(GtkWidget *drawing_area,
+					       GdkEventMotion* event,
+					       gpointer user_data)
+{
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
+	GtkAllocation alloc;
+	gint x, y;
+	GdkModifierType state;
+	G3DFloat rx, ry, rz;
+
+	gtk_widget_get_allocation(drawing_area, &alloc);
+
+	if(event->is_hint)
+		gdk_window_get_pointer(event->window, &x, &y, &state);
+	else
+	{
+		x = event->x;
+		y = event->y;
+		state = event->state;
+	}
+
+	/* left button pressed */
+	if(state & GDK_BUTTON1_MASK)
+	{
+		if(state & GDK_SHIFT_MASK)
+		{
+			/* shift pressed, translate view */
+			priv->renderoptions.offx += (float)(x - priv->mouse.beginx) / alloc.width / priv->renderoptions.zoom;
+			priv->renderoptions.offy -= (float)(y - priv->mouse.beginy) / alloc.height / priv->renderoptions.zoom;
+		}
+		else
+		{
+			/* rotate view */
+			gfloat spin_quat[4];
+			g3d_quat_trackball(spin_quat,
+				(2.0 * priv->mouse.beginx - alloc.width) / alloc.width,
+				(alloc.height - 2.0 * priv->mouse.beginy) / alloc.height,
+				(2.0 * x - alloc.width) / alloc.width,
+				(alloc.height - 2.0 * y) / alloc.height,
+				0.8 /* trackball radius */);
+			g3d_quat_add(priv->renderoptions.quat,
+				spin_quat, priv->renderoptions.quat);
+			/* normalize quat some times */
+			priv->renderoptions.norm_count ++;
+			if(priv->renderoptions.norm_count > 97) {
+				priv->renderoptions.norm_count = 0;
+				g3d_quat_normalize(priv->renderoptions.quat);
+			}
+
+			/* g3d_quat_to_rotation_xyz(priv->renderoptions.quat, */
+			/* 	&rx, &ry, &rz); */
+			/* text = g_strdup_printf("%-.2f°, %-.2f°, %-.2f°", */
+			/* 	rx * 180.0 / G_PI, ry * 180.0 / G_PI, rz * 180.0 / G_PI); */
+			/* gui_glade_status(priv, text); */
+			/* g_free(text); */
+		}
+
+		glarea_update(GTK_WIDGET(priv->drawingarea1));
+	}
+
+	/* middle mouse button */
+	if(state & GDK_BUTTON2_MASK)
+	{
+		priv->renderoptions.zoom +=
+			((y - priv->mouse.beginy) / (gfloat)alloc.height) * 40;
+		if(priv->renderoptions.zoom < 1)
+			priv->renderoptions.zoom = 1;
+		if(priv->renderoptions.zoom > 120)
+			priv->renderoptions.zoom = 120;
+
+		glarea_update(GTK_WIDGET(priv->drawingarea1));
+	}
+	priv->mouse.beginx = x;
+	priv->mouse.beginy = y;
+
+	return FALSE;
+}
+
+/*********************************************/
+/* HklGui3D and HklGui3DClass initialization */
+/*********************************************/
+
+static void
+hkl_gui_3d_class_init (HklGui3DClass *class)
+{
+	GObjectClass *gobject_class = G_OBJECT_CLASS (class);
+
+	g_type_class_add_private (class, sizeof (HklGui3DPrivate));
+
+	/* virtual method */
+	gobject_class->finalize = finalize;
+	gobject_class->set_property = set_property;
+	gobject_class->get_property = get_property;
+
+	/* properties */
+	obj_properties[PROP_FILENAME] =
+		g_param_spec_string ("filename",
+				     "Filename",
+				     "The confuration filename",
+				     NULL,
+				     G_PARAM_CONSTRUCT_ONLY |
+				     G_PARAM_READWRITE |
+				     G_PARAM_STATIC_STRINGS);
+
+	obj_properties[PROP_GEOMETRY] =
+		g_param_spec_pointer ("geometry",
+				      "Geometry",
+				      "The Hkl Geometry used underneath",
+				      G_PARAM_CONSTRUCT_ONLY |
+				      G_PARAM_READWRITE |
+				      G_PARAM_STATIC_STRINGS);
+
+	g_object_class_install_properties (gobject_class,
+					   N_PROPERTIES,
+					   obj_properties);
+
+}
+
+static void hkl_gui_3d_init (HklGui3D * self)
+{
+	HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
+	GtkBuilder *builder;
+	G3DGLRenderOptions renderoptions = {0};
+
+	/* properties */
+	priv->filename = NULL;
+	priv->geometry = NULL;
+
+	priv->builder = builder = gtk_builder_new ();
+
+	get_ui(builder, "3d.ui");
+
+	// widgets
+	get_object(builder, GTK_FRAME, priv, frame1);
+	get_object(builder, GTK_VBOX, priv, vbox1);
+	get_object(builder, GTK_TREE_VIEW, priv, treeview1);
+	get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton1);
+	get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton2);
+	get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton3);
+	get_object(builder, GTK_FILE_CHOOSER_DIALOG, priv, filechooserdialog1);
+	get_object(builder, GTK_BUTTON, priv, button1);
+	get_object(builder, GTK_BUTTON, priv, button2);
+	get_object(builder, GTK_TREE_STORE, priv, treestore1);
+	get_object(builder, GTK_DRAWING_AREA, priv, drawingarea1);
+
+	gtk_builder_connect_signals (builder, self);
+
+	/* OPENGL */
+
+	/* renderoptions */
+	reset_3d(&priv->renderoptions);
+	priv->aabb = FALSE;
+
+	/* attache GL capability to drawingarea1 */
+	GdkGLConfig *gl_config = gdk_gl_config_new_by_mode(GDK_GL_MODE_RGBA |
+							   GDK_GL_MODE_DEPTH |
+							   GDK_GL_MODE_DOUBLE);
+	if (!gl_config)
+		g_assert_not_reached();
+	if (!gtk_widget_set_gl_capability(GTK_WIDGET(priv->drawingarea1), gl_config, NULL, TRUE,
+					  GDK_GL_RGBA_TYPE))
+		g_assert_not_reached();
+
+	gtk_widget_set_can_focus(GTK_WIDGET(priv->drawingarea1), TRUE);
+	gtk_widget_add_events(GTK_WIDGET(priv->drawingarea1),
+			      GDK_BUTTON1_MOTION_MASK |
+			      GDK_BUTTON2_MOTION_MASK |
+			      GDK_BUTTON_PRESS_MASK |
+			      GDK_VISIBILITY_NOTIFY_MASK);
+
+	/* connect the GL callbacks */
+	const gdouble TIMEOUT_PERIOD = 1000 / 60;
+	g_timeout_add(TIMEOUT_PERIOD, hkl_gui_3d_idle_cb, priv->drawingarea1);
+	g_signal_connect(priv->drawingarea1, "expose-event",
+			 G_CALLBACK(hkl_gui_3d_drawingarea1_expose_cb), self);
+	g_signal_connect(priv->drawingarea1, "button-press-event",
+			 G_CALLBACK(hkl_gui_3d_drawingarea1_button_press_event_cb), self);
+	g_signal_connect(priv->drawingarea1, "motion-notify-event",
+			 G_CALLBACK(hkl_gui_3d_drawingarea1_motion_notify_event_cb), self);
+}
diff --git a/gui/hkl-gui-3d.cpp b/gui/hkl-gui-3d.cpp
deleted file mode 100644
index 9d52d4e..0000000
--- a/gui/hkl-gui-3d.cpp
+++ /dev/null
@@ -1,244 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- *	    Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
- */
-#include "hkl-gui-3d.h"
-
-Hkl3DFrame::Hkl3DFrame(const char *filename, HklGeometry *geometry)
-{
-	Gtk::CellRenderer * renderer;
-
-	//Get Glade UI:
-	_refGlade = Gtk::Builder::create();
-	try{
-		_refGlade->add_from_file("3d.ui");
-	}catch(...){
-		std::string filename = Glib::build_filename(PKGDATA, "3d.ui");
-		if(!_refGlade->add_from_file(filename))
-			exit(1);
-	}
-
-	// widgets
-	_refGlade->get_widget("frame1", _frame1);
-	_refGlade->get_widget("vbox1", _vbox1);
-	_refGlade->get_widget("treeview1", _treeview1);
-	_refGlade->get_widget("toolbutton1", _toolbutton1);
-	_refGlade->get_widget("toolbutton2", _toolbutton2);
-	_refGlade->get_widget("filechooserdialog1", _filechooserdialog1);
-	_refGlade->get_widget("button1", _button1);
-	_refGlade->get_widget("button2", _button2);
-
-	// objects
-	_treestore1 = Glib::RefPtr<Gtk::TreeStore>::cast_dynamic(
-		_refGlade->get_object("treestore1"));
-
-	if(filename && geometry){
-		Gtk::CellRenderer * renderer;
-
-		_hkl3d = hkl3d_new(filename, geometry);
-		_Scene = new Hkl3dGui::Scene(_hkl3d, false, false, false);
-
-		this->update_hkl3d_objects_TreeStore();
-		this->_vbox1->pack_start(*_Scene);
-		this->_vbox1->show_all();
-
-		// connect signals
-
-		renderer = _treeview1->get_column_cell_renderer(1); // 1 is the index of the value column
-		dynamic_cast<Gtk::CellRendererToggle *>(renderer)->signal_toggled().connect(
-			sigc::mem_fun(*this, &Hkl3DFrame::on_cell_treeview1_toggled));
-
-		_treeview1->signal_cursor_changed().connect(
-			sigc::mem_fun(*this, &Hkl3DFrame::on_treeview1_cursor_changed));
-
-		_toolbutton1->signal_clicked().connect(
-			sigc::mem_fun(*this, &Hkl3DFrame::on_toolbutton1_clicked));
-		_toolbutton2->signal_clicked().connect(
-			sigc::mem_fun(*this, &Hkl3DFrame::on_toolbutton2_clicked));
-		_button1->signal_clicked().connect(
-			sigc::mem_fun(*this, &Hkl3DFrame::on_button1_clicked));
-		_button2->signal_clicked().connect(
-			sigc::mem_fun(*this, &Hkl3DFrame::on_button2_clicked));
-	}
-}
-
-Hkl3DFrame::~Hkl3DFrame(void)
-{
-	if(_hkl3d)
-		delete _hkl3d;
-	if(_Scene)
-		delete _Scene;
-}
-
-void Hkl3DFrame::is_colliding(void)
-{
-	if(_hkl3d)
-		hkl3d_is_colliding(_hkl3d);
-}
-
-void Hkl3DFrame::invalidate(void)
-{
-	if(_Scene)
-		_Scene->invalidate();
-}
-
-void Hkl3DFrame::update_hkl3d_objects_TreeStore(void)
-{
-	size_t i;
-	size_t j;
-
-	if(!_hkl3d)
-		return;
-
-	_treestore1->clear();
-	for(i=0; i<_hkl3d->config->len; ++i){
-		Gtk::TreeRow row = *(_treestore1->append());
-		row[_hkl3d_objects_columns.name] = _hkl3d->config->models[i]->filename;
-		row[_hkl3d_objects_columns.model] = _hkl3d->config->models[i];
-		row[_hkl3d_objects_columns.object] = NULL;
-		for(j=0; j<_hkl3d->config->models[i]->len; ++j){
-			Gtk::TreeRow crow = *(_treestore1->append(row.children()));
-
-			crow[_hkl3d_objects_columns.name] = _hkl3d->config->models[i]->objects[j]->axis_name;
-			crow[_hkl3d_objects_columns.hide] = _hkl3d->config->models[i]->objects[j]->hide;
-			crow[_hkl3d_objects_columns.model] = _hkl3d->config->models[i] ;
-			crow[_hkl3d_objects_columns.object] = _hkl3d->config->models[i]->objects[j];
-		}
-	}
-}
-
-/************/
-/* Callback */
-/************/
-
-void Hkl3DFrame::on_cell_treeview1_toggled(Glib::ustring const & spath)
-{
-	bool hide;
-	Hkl3DModel *model;
-	Hkl3DObject *object;
-
-	Gtk::TreePath path(spath);
-	Gtk::TreeModel::iterator iter = _treestore1->get_iter(path);
-	Gtk::TreeStore::Row row = *(iter);
-
-	hide = !row[_hkl3d_objects_columns.hide];
-	object = row[_hkl3d_objects_columns.object];
-	if(object){
-		hkl3d_hide_object(_hkl3d, object, hide);
-		row[_hkl3d_objects_columns.hide] = hide;
-		this->is_colliding();
-		this->invalidate();
-	}else{
-		model = row[_hkl3d_objects_columns.model];
-		if(model){
-			size_t i = 0;
-
-			row[_hkl3d_objects_columns.hide] = hide;
-			/* set all the children rows */
-			iter = row.children().begin();
-			Gtk::TreeModel::iterator end = row.children().end();
-			while(iter != end){
-				row = *(iter++);
-				hkl3d_hide_object(_hkl3d, model->objects[i++], hide);
-				row[_hkl3d_objects_columns.hide] = hide;
-			}
-			//_hkl3d->save_config(_hkl3d->filename);
-			this->is_colliding();
-			this->invalidate();
-		}
-	}
-}
-
-void Hkl3DFrame::on_treeview1_cursor_changed(void)
-{
-	Hkl3DObject *object;
-	int i;
-	int j;
-
-	Gtk::TreeModel::Path path;
-	Gtk::TreeViewColumn * column;
-	_treeview1->get_cursor(path, column);
-	Gtk::TreeModel::iterator iter = _treestore1->get_iter(path);
-	Gtk::ListStore::Row row = *(iter);
-
-	/* need to unselect of objects of all 3d models */
-	for(i=0; i<_hkl3d->config->len; ++i)
-		for(j=0; j<_hkl3d->config->models[i]->len; ++j)
-			_hkl3d->config->models[i]->objects[j]->selected = false;
-
-	/* now select the right object */
-	object = row[_hkl3d_objects_columns.object];
-	if(object)
-		object->selected = true;
-
-	this->invalidate();
-}
-
-void Hkl3DFrame::on_toolbutton1_clicked(void)
-{
-	_filechooserdialog1->show();
-}
-
-/* remove a object from the model */
-void Hkl3DFrame::on_toolbutton2_clicked(void)
-{
-	Hkl3DObject *object;
-	int i;
-	int j;
-
-	Gtk::TreeModel::Path path;
-	Gtk::TreeViewColumn * column;
-	_treeview1->get_cursor(path, column);
-	Gtk::TreeModel::iterator iter = _treestore1->get_iter(path);
-	Gtk::ListStore::Row row = *(iter);
-
-	object = row[_hkl3d_objects_columns.object];
-	if(object){
-		hkl3d_remove_object(_hkl3d, object);
-		this->update_hkl3d_objects_TreeStore();
-		this->invalidate();
-	}
-}
-
-void Hkl3DFrame::on_button1_clicked(void)
-{
-	size_t i;
-	std::string directory;
-
-	Glib::SListHandle<Glib::ustring> const & filenames = _filechooserdialog1->get_filenames();
-	directory = _filechooserdialog1->get_current_folder();
-	Glib::SListHandle<Glib::ustring>::const_iterator iter = filenames.begin();
-	Glib::SListHandle<Glib::ustring>::const_iterator const & end = filenames.end();
-	while(iter != end){
-		hkl3d_add_model_from_file(_hkl3d, (*iter).c_str(), directory.c_str());
-		hkl3d_connect_all_axes(_hkl3d);
-		++iter;
-	}
-
-	this->update_hkl3d_objects_TreeStore();
-	//_hkl3d->save_config(_hkl3d->filename);
-	_filechooserdialog1->hide();
-}
-
-void Hkl3DFrame::on_button2_clicked(void)
-{
-	_filechooserdialog1->hide();
-}
diff --git a/gui/hkl-gui-3d.h b/gui/hkl-gui-3d.h
index f14fbb5..6820498 100644
--- a/gui/hkl-gui-3d.h
+++ b/gui/hkl-gui-3d.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,70 +22,31 @@
 #ifndef __HKL_GUI_3D_H__
 #define __HKL_GUI_3D_H__
 
-#include <gtkmm.h>
+#include <gtk/gtk.h>
 
-#include "hkl3d.h"
-#include "hkl3d-gui-scene.h"
+G_BEGIN_DECLS
 
-class Hkl3DObjectsModelColumns : public Gtk::TreeModel::ColumnRecord
-{
-public:
-	Gtk::TreeModelColumn<Glib::ustring> name;
-	Gtk::TreeModelColumn<bool> hide;
-	Gtk::TreeModelColumn<Hkl3DModel *> model;
-	Gtk::TreeModelColumn<Hkl3DObject *> object;
+/* HklGui3D */
 
-	Hkl3DObjectsModelColumns()
-		{
-			this->add(name);
-			this->add(hide);
-			this->add(model);
-			this->add(object);
-		}
-};
+#define HKL_GUI_TYPE_3D            (hkl_gui_3d_get_type ())
+#define HKL_GUI_3D(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), HKL_GUI_TYPE_3D, HklGui3D))
+#define HKL_GUI_3D_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), HKL_GUI_TYPE_3D, HklGui3DClass))
+#define HKL_GUI_IS_3D(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HKL_GUI_TYPE_3D))
+#define HKL_GUI_IS_3D_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), HKL_GUI_TYPE_3D))
+#define HKL_GUI_3D_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), HKL_GUI_TYPE_3D, HklGuiEngineClass))
 
-class Hkl3DFrame
-{
-public:
-	Hkl3DFrame(const char *filename, HklGeometry *geometry);
-	virtual ~Hkl3DFrame(void);
+typedef struct _HklGui3D HklGui3D;
+typedef struct _HklGui3DClass HklGui3DClass;
+typedef struct _HklGui3DPrivate HklGui3DPrivate;
 
-	Gtk::Frame &frame(void) {return *_frame1;}
-	void is_colliding(void);
-	void invalidate(void);
+GType hkl_gui_3d_get_type (void) G_GNUC_CONST;
 
-// callback
-protected:
-	void on_cell_treeview1_toggled(Glib::ustring const & path);
-	void on_treeview1_cursor_changed(void);
-	void on_toolbutton1_clicked(void);
-	void on_toolbutton2_clicked(void);
-	void on_button1_clicked(void);
-	void on_button2_clicked(void);
+HklGui3D *hkl_gui_3d_new (const char *filename, HklGeometry *geometry);
 
-// non callback
-protected:
-	void update_hkl3d_objects_TreeStore(void);
+void hkl_gui_3d_is_colliding(HklGui3D *self);
 
-// members
-protected:
-	Hkl3D *_hkl3d;
-	Hkl3dGui::Scene *_Scene;
+void hkl_gui_3d_invalidate(HklGui3D *self);
 
-	/* widgets */
-	Gtk::Frame *_frame1;
-	Gtk::VBox *_vbox1;
-	Gtk::TreeView *_treeview1;
-	Gtk::ToolButton *_toolbutton1;
-	Gtk::ToolButton *_toolbutton2;
-	Gtk::FileChooserDialog *_filechooserdialog1;
-	Gtk::Button *_button1;
-	Gtk::Button *_button2;
-
-	/* objects */
-	Glib::RefPtr<Gtk::TreeStore> _treestore1; /* use to fill the hkl3d objects properties */
-	Hkl3DObjectsModelColumns _hkl3d_objects_columns;
-	Glib::RefPtr<Gtk::Builder> _refGlade;
-};
+GtkFrame *hkl_gui_3d_frame_get(HklGui3D *self);
 
 #endif // __HKL_GUI_3D_H__
diff --git a/gui/hkl-gui-callbacks.cpp b/gui/hkl-gui-callbacks.cpp
deleted file mode 100644
index a6ecde5..0000000
--- a/gui/hkl-gui-callbacks.cpp
+++ /dev/null
@@ -1,933 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-
-#include "hkl-gui.h"
-#include "hkl.h"
-
-void HKLWindow::on_treeView_pseudoAxes_cursor_changed(void)
-{
-	LOG;
-
-	Gtk::TreeModel::Path path;
-	Gtk::TreeViewColumn * column;
-	_TreeView_pseudoAxes->get_cursor(path, column);
-	Gtk::ListStore::Row row = *(_pseudoAxeModel->get_iter(path));
-	HklParameter *parameter = row[_pseudoAxeModelColumns.parameter];
-	_TreeView_pseudoAxes_parameters->set_model(_mapPseudoAxeParameterModel[parameter]);
-}
-
-void HKLWindow::on_treeViewCrystals_cursor_changed(void)
-{
-	LOG;
-
-	Gtk::TreeModel::Path path;
-	Gtk::TreeViewColumn * column;
-	_treeViewCrystals->get_cursor(path, column);
-	Gtk::TreeModel::iterator iter = _crystalModel->get_iter(path);
-	Gtk::ListStore::Row row = *(iter);
-
-	Glib::ustring name = row[_crystalModelColumns.name];
-	_sample = _samples[name];
-	hkl_engine_list_init(_engines, _geometry, _detector, _sample);
-	_treeViewReflections->set_model(_mapReflectionModel[name]);
-	this->updateLattice();
-	this->updateLatticeParameters();
-	this->updateReciprocalLattice();
-	this->updateUxUyUz();
-	this->updateUB();
-	this->updatePseudoAxes();
-	this->updatePseudoAxesFrames();
-}
-
-void HKLWindow::on_spinbutton_a_value_changed(void)
-{
-	LOG;
-	// TODO change the cell background color if not synchro
-}
-
-void HKLWindow::on_spinbutton_b_value_changed(void)
-{
-	LOG;
-	// TODO change the cell background color if not synchro
-}
-
-void HKLWindow::on_spinbutton_c_value_changed(void)
-{
-	LOG;
-	// TODO change the cell background color if not synchro
-}
-
-void HKLWindow::on_spinbutton_alpha_value_changed(void)
-{
-	LOG;
-	// TODO change the cell background color if not synchro
-}
-
-void HKLWindow::on_spinbutton_beta_value_changed(void)
-{
-	LOG;
-	// TODO change the cell background color if not synchro
-}
-
-void HKLWindow::on_spinbutton_gamma_value_changed(void)
-{
-	LOG;
-	// TODO change the cell background color if not synchro
-}
-
-void HKLWindow::on_spinbutton_a_min_value_changed(void)
-{
-	LOG;
-	// TODO change the cell background color if not synchro
-}
-
-void HKLWindow::on_spinbutton_b_min_value_changed(void)
-{
-	LOG;
-	// TODO change the cell background color if not synchro
-}
-
-void HKLWindow::on_spinbutton_c_min_value_changed(void)
-{
-	LOG;
-	// TODO change the cell background color if not synchro
-}
-
-void HKLWindow::on_spinbutton_alpha_min_value_changed(void)
-{
-	LOG;
-	// TODO change the cell background color if not synchro
-}
-
-void HKLWindow::on_spinbutton_beta_min_value_changed(void)
-{
-	LOG;
-	// TODO change the cell background color if not synchro
-}
-
-void HKLWindow::on_spinbutton_gamma_min_value_changed(void)
-{
-	LOG;
-	// TODO change the cell background color if not synchro
-}
-
-void HKLWindow::on_spinbutton_a_max_value_changed(void)
-{
-	LOG;
-	// TODO change the cell background color if not synchro
-}
-
-void HKLWindow::on_spinbutton_b_max_value_changed(void)
-{
-	LOG;
-	// TODO change the cell background color if not synchro
-}
-
-void HKLWindow::on_spinbutton_c_max_value_changed(void)
-{
-	LOG;
-	// TODO change the cell background color if not synchro
-}
-
-void HKLWindow::on_spinbutton_alpha_max_value_changed(void)
-{
-	LOG;
-	// TODO change the cell background color if not synchro
-}
-
-void HKLWindow::on_spinbutton_beta_max_value_changed(void)
-{
-	LOG;
-	// TODO change the cell background color if not synchro
-}
-
-void HKLWindow::on_spinbutton_gamma_max_value_changed(void)
-{
-	LOG;
-	// TODO change the cell background color if not synchro
-}
-
-void HKLWindow::on_spinbutton_lambda_value_changed(void)
-{
-	LOG;
-
-	if(_geometry){
-		hkl_geometry_wavelength_set(this->_geometry,
-					    _spinbutton_lambda->get_value());
-		this->updatePseudoAxes();
-		this->updatePseudoAxesFrames();
-	}
-}
-
-void HKLWindow::on_spinbutton_uxuyuz_value_changed(void)
-{
-	LOG;
-	// TODO change the cell background color if not synchro
-}
-
-void HKLWindow::on_button2_clicked(void)
-{
-	LOG;
-
-	if(_sample){
-		HklMatrix *U;
-		HklParameter *parameter;
-		HklLattice *lattice;
-
-		lattice = hkl_lattice_new(_spinbutton_a->get_value(),
-					  _spinbutton_b->get_value(),
-					  _spinbutton_c->get_value(),
-					  _spinbutton_alpha->get_value() * HKL_DEGTORAD,
-					  _spinbutton_beta->get_value() * HKL_DEGTORAD,
-					  _spinbutton_gamma->get_value() * HKL_DEGTORAD);
-
-		/* set min/max a */
-		parameter = hkl_parameter_new_copy(hkl_lattice_a_get(lattice));
-		hkl_parameter_min_max_unit_set(parameter,
-					       _spinbutton_a_min->get_value(),
-					       _spinbutton_a_max->get_value());
-		hkl_lattice_a_set(lattice, parameter);
-		hkl_parameter_free(parameter);
-
-		/* set min/max b */
-		parameter = hkl_parameter_new_copy(hkl_lattice_b_get(lattice));
-		hkl_parameter_min_max_unit_set(parameter,
-					       _spinbutton_b_min->get_value(),
-					       _spinbutton_b_max->get_value());
-		hkl_lattice_b_set(lattice, parameter);
-		hkl_parameter_free(parameter);
-
-		parameter = hkl_parameter_new_copy(hkl_lattice_c_get(lattice));
-		hkl_parameter_min_max_unit_set(parameter,
-					       _spinbutton_c_min->get_value(),
-					       _spinbutton_c_max->get_value());
-		hkl_lattice_c_set(lattice, parameter);
-		hkl_parameter_free(parameter);
-
-		parameter = hkl_parameter_new_copy(hkl_lattice_alpha_get(lattice));
-		hkl_parameter_min_max_unit_set(parameter,
-					       _spinbutton_alpha_min->get_value(),
-					       _spinbutton_alpha_max->get_value());
-		hkl_lattice_alpha_set(lattice, parameter);
-		hkl_parameter_free(parameter);
-
-		parameter = hkl_parameter_new_copy(hkl_lattice_beta_get(lattice));
-		hkl_parameter_min_max_unit_set(parameter,
-					       _spinbutton_beta_min->get_value(),
-					       _spinbutton_beta_max->get_value());
-		hkl_lattice_beta_set(lattice, parameter);
-		hkl_parameter_free(parameter);
-
-		parameter = hkl_parameter_new_copy(hkl_lattice_gamma_get(lattice));
-		hkl_parameter_min_max_unit_set(parameter,
-					       _spinbutton_gamma_min->get_value(),
-					       _spinbutton_gamma_max->get_value());
-		hkl_lattice_gamma_set(lattice, parameter);
-		hkl_parameter_free(parameter);
-
-
-		hkl_sample_lattice_set(_sample, lattice);
-		U = hkl_matrix_new_euler(_spinbutton_ux->get_value() * HKL_DEGTORAD,
-					 _spinbutton_uy->get_value() * HKL_DEGTORAD,
-					 _spinbutton_uz->get_value() * HKL_DEGTORAD);
-		hkl_sample_U_set(_sample, U);
-		hkl_matrix_free(U);
-		hkl_lattice_free(lattice);
-
-		this->updateCrystalModel(_sample);
-		this->updateReciprocalLattice();
-		this->updateUB();
-		this->updatePseudoAxes();
-		this->updatePseudoAxesFrames();
-	}
-}
-
-#define ON_CHECKBUTTON_LATTICE_PARAMETER_TOGGLE(p, sample)		\
-	void HKLWindow::on_checkbutton_##p##_toggled(void)		\
-	{								\
-		LOG;							\
-		if(_sample){						\
-			HklLattice *lattice = hkl_lattice_new_copy(hkl_sample_lattice_get((sample))); \
-			HklParameter *parameter = hkl_parameter_new_copy(hkl_lattice_##p##_get(lattice)); \
-			hkl_parameter_fit_set(parameter, _checkbutton_##p->get_active()); \
-			hkl_lattice_##p##_set(lattice, parameter);	\
-			hkl_sample_lattice_set((sample), lattice);	\
-			hkl_parameter_free(parameter);			\
-			hkl_lattice_free(lattice);			\
-		}							\
-	}
-
-ON_CHECKBUTTON_LATTICE_PARAMETER_TOGGLE(a, _sample);
-ON_CHECKBUTTON_LATTICE_PARAMETER_TOGGLE(b, _sample);
-ON_CHECKBUTTON_LATTICE_PARAMETER_TOGGLE(c, _sample);
-ON_CHECKBUTTON_LATTICE_PARAMETER_TOGGLE(alpha, _sample);
-ON_CHECKBUTTON_LATTICE_PARAMETER_TOGGLE(beta, _sample);
-ON_CHECKBUTTON_LATTICE_PARAMETER_TOGGLE(gamma, _sample);
-
-#define ON_CHECKBUTTON_UXUYUZ_TOGGLED(p, sample)			\
-	void HKLWindow::on_checkbutton_##p##_toggled(void)			\
-	{								\
-		LOG;							\
-		if(_sample){						\
-			HklParameter *parameter = hkl_parameter_new_copy(hkl_sample_##p##_get((sample))); \
-			hkl_parameter_fit_set(parameter, _checkbutton_##p->get_active()); \
-			hkl_sample_##p##_set(sample, parameter);	\
-			hkl_parameter_free(parameter);			\
-		}							\
-	}
-
-ON_CHECKBUTTON_UXUYUZ_TOGGLED(ux, _sample)
-ON_CHECKBUTTON_UXUYUZ_TOGGLED(uy, _sample)
-ON_CHECKBUTTON_UXUYUZ_TOGGLED(uz, _sample)
-
-void HKLWindow::on_cell_TreeView_axes_read_edited(Glib::ustring const & spath,
-						  Glib::ustring const & newText)
-{
-	LOG;
-
-	Gtk::TreePath path(spath);
-	Glib::RefPtr<Gtk::TreeModel> listStore = _TreeView_axes->get_model();
-	Gtk::TreeModel::iterator iter = listStore->get_iter(path);
-	Gtk::ListStore::Row row = *(iter);
-	HklParameter *axis = row[_axeModelColumns.axis];
-	double value;
-
-	sscanf(newText.c_str(), "%lf", &value);
-	hkl_parameter_value_unit_set(axis, value, NULL);
-	hkl_geometry_axis_set(this->_geometry, axis);
-
-	row[_axeModelColumns.read] = value;
-	this->updatePseudoAxes();
-	this->updatePseudoAxesFrames();
-
-#ifdef HKL3D
-	if(_Scene){
-		_Scene->is_colliding();
-		_Scene->invalidate();
-	}
-#endif
-}
-
-void HKLWindow::on_cell_TreeView_axes_write_edited(Glib::ustring const & spath,
-						   Glib::ustring const & newText)
-{
-	LOG;
-
-	Gtk::TreePath path(spath);
-	Glib::RefPtr<Gtk::TreeModel> listStore = _TreeView_axes->get_model();
-	Gtk::TreeModel::iterator iter = listStore->get_iter(path);
-	Gtk::ListStore::Row row = *(iter);
-
-	HklParameter *axis = row[_axeModelColumns.axis];
-	double value;
-	sscanf(newText.c_str(), "%lf", &value);
-	hkl_parameter_value_unit_set(axis, value, NULL);
-	hkl_geometry_axis_set(this->_geometry, axis);
-
-	row[_axeModelColumns.write] = value;
-	this->updatePseudoAxes();
-	this->updatePseudoAxesFrames();
-
-#ifdef HKL3D
-	if(_Scene){
-		_Scene->is_colliding();
-		_Scene->invalidate();
-	}
-#endif
-}
-
-void HKLWindow::on_cell_TreeView_axes_min_edited(Glib::ustring const & spath,
-						 Glib::ustring const & newText)
-{
-	LOG;
-
-	Gtk::TreePath path(spath);
-	Glib::RefPtr<Gtk::TreeModel> listStore = _TreeView_axes->get_model();
-	Gtk::TreeModel::iterator iter = listStore->get_iter(path);
-	Gtk::ListStore::Row row = *(iter);
-	HklParameter *axis = row[_axeModelColumns.axis];
-
-	double shit;
-	double max;
-	double value;
-
-	sscanf(newText.c_str(), "%lf", &value);
-
-	hkl_parameter_min_max_unit_get(axis, &shit, &max);
-	hkl_parameter_min_max_unit_set(axis, value, max);
-	hkl_geometry_axis_set(this->_geometry, axis);
-
-	row[_axeModelColumns.min] = value;
-	this->updatePseudoAxes();
-}
-
-void HKLWindow::on_cell_TreeView_axes_max_edited(Glib::ustring const & spath,
-						 Glib::ustring const & newText)
-{
-	LOG;
-
-	Gtk::TreePath path(spath);
-	Glib::RefPtr<Gtk::TreeModel> listStore = _TreeView_axes->get_model();
-	Gtk::TreeModel::iterator iter = listStore->get_iter(path);
-	Gtk::ListStore::Row row = *(iter);
-	HklParameter *axis = row[_axeModelColumns.axis];
-
-	double min, shit;
-	double value;
-
-	sscanf(newText.c_str(), "%lf", &value);
-
-	hkl_parameter_min_max_unit_get(axis, &min, &shit);
-	hkl_parameter_min_max_unit_set(axis, min, value);
-	hkl_geometry_axis_set(this->_geometry, axis);
-
-	row[_axeModelColumns.max] = value;
-	this->updatePseudoAxes();
-}
-
-// PseudoAxes
-void HKLWindow::on_cell_TreeView_pseudoAxes_write_edited(Glib::ustring const & spath,
-							 Glib::ustring const & newText)
-{
-	LOG;
-
-	double value;
-	HklParameter *parameter;
-	HklEngine *engine;
-	int res;
-
-	Gtk::TreePath path(spath);
-	Glib::RefPtr<Gtk::TreeModel> listStore = _TreeView_pseudoAxes->get_model();
-	Gtk::TreeModel::iterator iter = listStore->get_iter(path);
-	Gtk::ListStore::Row row = *(iter);
-
-	parameter = row[_pseudoAxeModelColumns.parameter];
-	engine = row[_pseudoAxeModelColumns.engine];
-	sscanf(newText.c_str(), "%lf", &value);
-
-	if(hkl_parameter_value_unit_set(parameter, value, NULL))
-		if(hkl_engine_set(engine, NULL)){
-			hkl_engine_list_select_solution(this->_engines, 0);
-
-			row[_pseudoAxeModelColumns.write] = value;
-			this->updateAxes();
-			this->updatePseudoAxes();
-			this->updatePseudoAxesFrames();
-			this->updateSolutions();
-
-#ifdef HKL3D
-			if(_Scene){
-				_Scene->is_colliding();
-				_Scene->invalidate();
-			}
-#endif
-		}
-}
-
-//PseudoAxes Parameters
-void HKLWindow::on_cell_TreeView_pseudoAxes_parameters_value_edited(Glib::ustring const & spath,
-								    Glib::ustring const & newText)
-{
-	LOG;
-
-	double value;
-	HklParameter *parameter;
-
-	Gtk::TreePath path(spath);
-	Glib::RefPtr<Gtk::TreeModel> listStore = _TreeView_pseudoAxes_parameters->get_model();
-	Gtk::ListStore::Row row = *(listStore->get_iter(path));
-	sscanf(newText.c_str(), "%lf", &value);
-
-	parameter = row[_parameterModelColumns.parameter];
-	/* TODO error check */
-	hkl_parameter_value_unit_set(parameter, value, NULL);
-
-	row[_parameterModelColumns.value] = value;
-	this->updatePseudoAxes();
-	this->update_pseudoAxes_parameters();
-}
-
-void HKLWindow::on_cell_TreeView_crystals_name_edited(Glib::ustring const & spath,
-						      Glib::ustring const & newText)
-{
-	LOG;
-
-	Gtk::TreePath path(spath);
-	Glib::RefPtr<Gtk::TreeModel> listStore = _treeViewCrystals->get_model();
-	Gtk::TreeModel::iterator iter = listStore->get_iter(path);
-	Gtk::ListStore::Row row = *(iter);
-	Glib::ustring name = row[_crystalModelColumns.name];
-	std::map<std::string, HklSample *>::iterator it = _samples.find(name);
-	if (it != _samples.end()){
-		HklSample *sample = it->second;
-
-		hkl_sample_name_set(sample, newText.c_str());
-		_samples.erase(it);
-		_samples.insert(std::pair<std::string, HklSample *>(hkl_sample_name_get(sample),
-								    sample));
-
-		this-> updateTreeViewCrystals();
-	}
-}
-
-void HKLWindow::on_cell_TreeView_reflections_h_edited(Glib::ustring const & spath,
-						      Glib::ustring const & newText)
-{
-	LOG;
-
-	Gtk::TreePath path(spath);
-	Glib::RefPtr<Gtk::TreeModel> listStore = _treeViewReflections->get_model();
-	Gtk::TreeModel::iterator iter = listStore->get_iter(path);
-	Gtk::ListStore::Row row = *(iter);
-
-	if(_sample){
-		double h;
-		double k;
-		double l;
-		HklSampleReflection *reflection;
-
-		reflection = row[_reflectionModelColumns.reflection];
-
-		hkl_sample_reflection_hkl_get(reflection, &h, &k, &l);
-		sscanf(newText.c_str(), "%lf", &h);
-		hkl_sample_reflection_hkl_set(reflection, h, k, l);
-		row[_reflectionModelColumns.h] = h;
-
-		row[_reflectionModelColumns.flag] = hkl_sample_reflection_flag_get(reflection);
-
-		this->updateCrystalModel(_sample);
-	}
-}
-
-void HKLWindow::on_cell_TreeView_reflections_k_edited(Glib::ustring const & spath,
-						      Glib::ustring const & newText)
-{
-	LOG;
-
-	Gtk::TreePath path(spath);
-	Glib::RefPtr<Gtk::TreeModel> listStore = _treeViewReflections->get_model();
-	Gtk::TreeModel::iterator iter = listStore->get_iter(path);
-	Gtk::ListStore::Row row = *(iter);
-
-	if(_sample){
-		double h;
-		double k;
-		double l;
-		HklSampleReflection *reflection;
-
-
-		reflection = row[_reflectionModelColumns.reflection];
-
-		hkl_sample_reflection_hkl_get(reflection, &h, &k, &l);
-		sscanf(newText.c_str(), "%lf", &k);
-		hkl_sample_reflection_hkl_set(reflection, h, k, l);
-		row[_reflectionModelColumns.k] = k;
-
-		row[_reflectionModelColumns.flag] = hkl_sample_reflection_flag_get(reflection);
-		this->updateCrystalModel(_sample);
-	}
-}
-
-void HKLWindow::on_cell_TreeView_reflections_l_edited(Glib::ustring const & spath,
-						      Glib::ustring const & newText)
-{
-	LOG;
-
-	Gtk::TreePath path(spath);
-	Glib::RefPtr<Gtk::TreeModel> listStore = _treeViewReflections->get_model();
-	Gtk::TreeModel::iterator iter = listStore->get_iter(path);
-	Gtk::ListStore::Row row = *(iter);
-
-	if(_sample){
-		double h;
-		double k;
-		double l;
-		HklSampleReflection *reflection;
-
-		reflection = row[_reflectionModelColumns.reflection];
-
-		hkl_sample_reflection_hkl_get(reflection, &h, &k, &l);
-		sscanf(newText.c_str(), "%lf", &l);
-		hkl_sample_reflection_hkl_set(reflection, h, k, l);
-		row[_reflectionModelColumns.l] = l;
-
-		row[_reflectionModelColumns.flag] = hkl_sample_reflection_flag_get(reflection);
-
-		this->updateCrystalModel(_sample);
-	}
-}
-
-void HKLWindow::on_cell_TreeView_reflections_flag_toggled(Glib::ustring const & spath)
-{
-	LOG;
-
-	Gtk::TreePath path(spath);
-	Glib::RefPtr<Gtk::TreeModel> listStore = _treeViewReflections->get_model();
-	Gtk::TreeModel::iterator iter = listStore->get_iter(path);
-	Gtk::ListStore::Row row = *(iter);
-
-	if(_sample){
-		int flag;
-		HklSampleReflection *reflection;
-
-		reflection = row[_reflectionModelColumns.reflection];
-		flag = !hkl_sample_reflection_flag_get(reflection);
-		hkl_sample_reflection_flag_set(reflection, flag);
-		row[_reflectionModelColumns.flag] = flag;
-	}
-}
-
-void HKLWindow::on_toolbutton_add_reflection_clicked(void)
-{
-	LOG;
-
-	if(_sample){
-		HklSampleReflection *reflection;
-		double h = 0;
-		double k = 0;
-		double l = 0;
-
-		reflection = hkl_sample_reflection_new(_geometry, _detector, h, k, l);
-		hkl_sample_add_reflection(_sample, reflection);
-
-		this->updateReflections(_sample,
-					_mapReflectionModel[hkl_sample_name_get(_sample)]);
-	}
-}
-
-void HKLWindow::on_toolbutton_goto_reflection_clicked(void)
-{
-	LOG;
-
-	if(_sample){
-		Glib::RefPtr<Gtk::TreeSelection> selection = _treeViewReflections->get_selection();
-		unsigned int nb_rows = selection->count_selected_rows();
-		if (nb_rows == 1){
-			Gtk::TreeSelection::ListHandle_Path list_path = selection->get_selected_rows();
-			Gtk::TreePath path = *(list_path.begin());
-			Glib::RefPtr<Gtk::ListStore> liststore = _mapReflectionModel[hkl_sample_name_get(_sample)];
-			Gtk::ListStore::Row row = *(liststore->get_iter(path));
-			HklSampleReflection *reflection = row[_reflectionModelColumns.reflection];
-
-			hkl_geometry_set(this->_geometry,
-					 hkl_sample_reflection_geometry_get(reflection));
-
-			this->updateSource();
-			this->updateAxes();
-			this->updatePseudoAxes();
-#ifdef HKL3D
-			if(_Scene){
-				_Scene->is_colliding();
-				_Scene->invalidate();
-			}
-#endif
-		}else{
-			if (nb_rows)
-				_statusBar->push("Please select only one reflection.");
-			else
-				_statusBar->push("Please select one reflection.");
-		}
-	}
-}
-
-void HKLWindow::on_toolbutton_del_reflection_clicked(void)
-{
-	LOG;
-
-	if(_sample){
-		Glib::RefPtr<Gtk::TreeSelection> selection = _treeViewReflections->get_selection();
-		unsigned int nb_rows = selection->count_selected_rows();
-		if (nb_rows){
-			Gtk::TreeSelection::ListHandle_Path list = selection->get_selected_rows();
-			Gtk::TreeSelection::ListHandle_Path::iterator iter = list.begin();
-			Gtk::TreeSelection::ListHandle_Path::iterator last = list.end();
-			Glib::RefPtr<Gtk::ListStore> liststore = _mapReflectionModel[hkl_sample_name_get(_sample)];
-			// fill indexes with the reflections index
-			std::vector<HklSampleReflection *> to_delete;
-			while(iter != last){
-				Gtk::ListStore::Row row = *(liststore->get_iter(*iter));
-				to_delete.push_back(row[_reflectionModelColumns.reflection]);
-				++iter;
-			}
-			std::ostringstream os;
-			os << "Are you sure you want to delete reflections :";
-			for(unsigned int i=0; i< to_delete.size();i++){
-				double h, k, l;
-
-				hkl_sample_reflection_hkl_get(to_delete[i], &h, &k, &l);
-				os << " "
-				   << " h: " << h
-				   << " k: " << k
-				   << " l: " << l;
-			}
-
-			_message = new Gtk::MessageDialog("", false,
-							  Gtk::MESSAGE_WARNING,
-							  Gtk::BUTTONS_YES_NO);
-			_message->set_message(os.str());
-			_message->show();
-			int respons = _message->run();
-			switch (respons){
-			case Gtk::RESPONSE_YES:
-				for(unsigned int i=0;i<to_delete.size();i++){
-					hkl_sample_del_reflection(_sample,
-								  to_delete[i]);
-				}
-				this->updateReflections(_sample, liststore);
-				break;
-			}
-			delete _message;
-		}else
-			_statusBar->push("Please select at least one reflection.");
-	}
-}
-void HKLWindow::on_toolbutton_setUB_clicked(void)
-{
-	LOG;
-
-	if(_sample){
-		HklMatrix *UB = hkl_matrix_new_full(
-			_spinbutton_U11->get_value(),
-			_spinbutton_U12->get_value(),
-			_spinbutton_U13->get_value(),
-			_spinbutton_U21->get_value(),
-			_spinbutton_U22->get_value(),
-			_spinbutton_U23->get_value(),
-			_spinbutton_U31->get_value(),
-			_spinbutton_U32->get_value(),
-			_spinbutton_U33->get_value());
-
-		hkl_sample_UB_set(_sample, UB);
-		hkl_matrix_free(UB);
-
-		this->updateLattice();
-		this->updateLatticeParameters();
-		this->updateReciprocalLattice();
-		this->updateCrystalModel(_sample);
-		this->updateUB();
-		this->updateUxUyUz();
-		this->updatePseudoAxes();
-		this->updatePseudoAxesFrames();
-	}
-}
-
-void HKLWindow::on_toolbutton_computeUB_clicked(void)
-{
-	LOG;
-
-	if(_sample){
-		const HklSampleReflection *r1 = hkl_sample_first_reflection_get(_sample);
-		const HklSampleReflection *r2 = hkl_sample_next_reflection_get(_sample, r1);
-
-		hkl_sample_compute_UB_busing_levy(_sample, r1, r2);
-		this->updateUB();
-		this->updateUxUyUz();
-		this->updatePseudoAxes();
-		this->updatePseudoAxesFrames();
-	}
-}
-
-void HKLWindow::on_toolbutton_add_crystal_clicked(void)
-{
-	LOG;
-
-	_sample = hkl_sample_new("new_sample");
-	if(_sample){
-		_samples.insert(std::pair<std::string, HklSample *>(hkl_sample_name_get(_sample),
-								    _sample));
-		this->updateTreeViewCrystals();
-
-		// activate for edition the name of the new crystal
-		Gtk::TreeModel::Path path;
-		Gtk::TreeView::Column * column;
-		_treeViewCrystals->get_cursor(path, column);
-		column = _treeViewCrystals->get_column(0);
-		_treeViewCrystals->set_cursor(path, *column, true);
-	}
-}
-
-void HKLWindow::on_toolbutton_copy_crystal_clicked(void)
-{
-	LOG;
-
-	Glib::ustring name;
-	Glib::ustring newname;
-	HklSample *old_sample = _sample;
-	HklSample *sample;
-	if(!old_sample){
-		_statusBar->push("Please select a crystal to copy.");
-		return;
-	}
-
-	sample = hkl_sample_new_copy(_sample);
-	hkl_sample_name_set(sample, "copy");
-	_samples.insert(std::pair<std::string, HklSample *>(hkl_sample_name_get(sample),
-							    sample));
-	_sample = sample;
-	this->updateTreeViewCrystals();
-
-	// activate for edition the name of the new crystal
-	Gtk::TreeModel::Path path;
-	Gtk::TreeView::Column * column;
-	_treeViewCrystals->get_cursor(path, column);
-	column = _treeViewCrystals->get_column(0);
-	_treeViewCrystals->set_cursor(path, *column, true);
-}
-
-void HKLWindow::on_toolbutton_del_crystal_clicked(void)
-{
-	LOG;
-
-	_samples.erase(_samples.find(hkl_sample_name_get(_sample)));
-	this->updateTreeViewCrystals();
-}
-
-void HKLWindow::on_toolbutton_affiner_clicked(void)
-{
-	LOG;
-
-	Glib::ustring name;
-	Glib::ustring method;
-	if(_sample)
-		hkl_sample_affine(_sample);
-
-	this->updateCrystalModel(_sample);
-	this->updateLattice();
-	this->updateReciprocalLattice();
-	this->updateUB();
-	this->updateUxUyUz();
-}
-
-bool HKLWindow::on_treeViewReflections_key_press_event(GdkEventKey * event)
-{
-	LOG;
-
-	switch (event->keyval)
-	{
-	case GDK_Insert:
-	case GDK_KP_Insert:
-		on_toolbutton_add_reflection_clicked();
-		break;
-	case GDK_Delete:
-	case GDK_KP_Delete:
-		on_toolbutton_del_reflection_clicked();
-		break;
-	}
-	return true;
-}
-
-bool HKLWindow::on_treeViewCrystals_key_press_event(GdkEventKey * event)
-{
-	LOG;
-
-	switch (event->keyval)
-	{
-	case GDK_Insert:
-	case GDK_KP_Insert:
-		on_toolbutton_add_crystal_clicked();
-		break;
-	case GDK_Delete:
-	case GDK_KP_Delete:
-		on_toolbutton_del_crystal_clicked();
-		break;
-	}
-	return true;
-}
-
-void HKLWindow::on_treeview1_cursor_changed(void)
-{
-	LOG;
-
-	Gtk::TreeModel::Path path;
-	Gtk::TreeViewColumn * column;
-	_treeview1->get_cursor(path, column);
-	Gtk::TreeModel::iterator iter = _solutionModel->get_iter(path);
-	Gtk::ListStore::Row row = *(iter);
-	const HklGeometryListItem *item = row[_solutionModelColumns->item];
-
-	const HklGeometry *geometry = hkl_geometry_list_item_geometry_get(item);
-	hkl_engine_list_geometry_set(this->_engines, geometry);
-
-	this->updateAxes();
-	this->updatePseudoAxes();
-	this->updatePseudoAxesFrames();
-#ifdef HKL3D
-	if(_Scene){
-		_Scene->is_colliding();
-		_Scene->invalidate();
-	}
-#endif
-}
-
-void HKLWindow::on_pseudoAxesFrame_changed(void)
-{
-	LOG;
-
-	this->updateAxes();
-	this->updatePseudoAxes();
-	this->updatePseudoAxesFrames();
-	this->updateSolutions();
-}
-
-void HKLWindow::on_menuitem5_activate(void)
-{
-	LOG;
-
-	_dialog1->show();
-}
-
-void HKLWindow::on_button1_clicked(void)
-{
-	LOG;
-
-	_dialog1->hide();
-}
-
-void HKLWindow::on_combobox1_changed(void)
-{
-	LOG;
-
-	size_t idx = _combobox1->get_active_row_number();
-	unsigned int n;
-	HklFactory **factories;
-
-	factories = hkl_factory_get_all(&n);
-	if(_geometry)
-		hkl_geometry_free(_geometry);
-	_geometry = hkl_factory_create_new_geometry(factories[idx]);
-
-	if(_engines)
-		hkl_engine_list_free(_engines);
-	_engines = hkl_factory_create_new_engine_list(factories[idx]);
-	hkl_engine_list_init(_engines, _geometry, _detector, _sample);
-
-	this->set_up_pseudo_axes_frames();
-	this->set_up_TreeView_axes();
-	this->set_up_TreeView_pseudoAxes_parameters();
-	this->set_up_TreeView_pseudoAxes();
-
-	_solutionModelColumns = 0;
-	this->set_up_TreeView_treeview1();
-#ifdef HKL3D
-	this->set_up_3D();
-#endif
-}
diff --git a/hkl/hkl-lattice-private.h b/gui/hkl-gui-macros.h
similarity index 56%
copy from hkl/hkl-lattice-private.h
copy to gui/hkl-gui-macros.h
index ff76acc..eda6157 100644
--- a/hkl/hkl-lattice-private.h
+++ b/gui/hkl-gui-macros.h
@@ -13,37 +13,40 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef __HKL_LATTICE_PRIVATE_H__
-#define __HKL_LATTICE_PRIVATE_H__
 
-#include <stdio.h>
+#ifndef __HKL_GUI_MACROS_H__
+#define __HKL_GUI_MACROS_H__
 
-#include "hkl.h"
-
-HKL_BEGIN_DECLS
+#include <gtk/gtk.h>
 
-struct _HklLattice
-{
-	HklParameter *a;
-	HklParameter *b;
-	HklParameter *c;
-	HklParameter *alpha;
-	HklParameter *beta;
-	HklParameter *gamma;
-};
+#include "hkl.h"
+#include "hkl-gui-pseudoaxes.h"
 
-extern void hkl_lattice_lattice_set(HklLattice *self, const HklLattice *lattice);
 
-extern void hkl_lattice_randomize(HklLattice *self);
+/* TODO put in a private common header */
+#define get_object(builder, type, priv, name) do{			\
+		priv->name = type(gtk_builder_get_object(builder, #name)); \
+		if(priv->name == NULL)					\
+			fprintf(stdout, "%s is NULL ???", #name);	\
+	}while(0);
 
-extern void hkl_lattice_fprintf(FILE *f, const HklLattice *self);
 
-HKL_END_DECLS
 
-#endif /* __HKL_LATTICE_PRIVATE_H__ */
+static void get_ui(GtkBuilder *builder, const char *filename)
+{
+	if (0 == access(filename, R_OK))
+		gtk_builder_add_from_file (builder, filename, NULL);
+	else{
+		char *ui = g_build_filename(PKGDATA, filename);
+		gtk_builder_add_from_file (builder, ui, NULL);
+		g_free(ui);
+	}
+}
+
+#endif /* __HKL_GUI_MACROS_H__ */
diff --git a/gui/hkl-gui-modelcolumns.h b/gui/hkl-gui-modelcolumns.h
deleted file mode 100644
index 11b97ff..0000000
--- a/gui/hkl-gui-modelcolumns.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#ifndef GTKMM_MODEL_COLUMNS_H
-#define GTKMM_MODEL_COLUMNS_H
-
-#include <gtkmm/treemodelcolumn.h>
-#include "hkl.h"
-
-class ReflectionModelColumns : public Gtk::TreeModel::ColumnRecord
-{
-public:
-	Gtk::TreeModelColumn<unsigned int> index;
-	Gtk::TreeModelColumn<HklSampleReflection *> reflection;
-	Gtk::TreeModelColumn<double> h;
-	Gtk::TreeModelColumn<double> k;
-	Gtk::TreeModelColumn<double> l;
-	Gtk::TreeModelColumn<bool> flag;
-
-	ReflectionModelColumns()
-		{
-			this->add(index);
-			this->add(reflection);
-			this->add(h);
-			this->add(k);
-			this->add(l);
-			this->add(flag);
-		}
-};
-
-class CrystalModelColumns : public Gtk::TreeModel::ColumnRecord
-{
-public:
-	Gtk::TreeModelColumn<Glib::ustring> name;
-	Gtk::TreeModelColumn<double> a;
-	Gtk::TreeModelColumn<double> b;
-	Gtk::TreeModelColumn<double> c;
-	Gtk::TreeModelColumn<double> alpha;
-	Gtk::TreeModelColumn<double> beta;
-	Gtk::TreeModelColumn<double> gamma;
-
-	CrystalModelColumns()
-		{
-			this->add(name);
-			this->add(a);
-			this->add(b);
-			this->add(c);
-			this->add(alpha);
-			this->add(beta);
-			this->add(gamma);
-		}
-};
-
-class AxeModelColumns : public Gtk::TreeModel::ColumnRecord
-{
-public:
-	Gtk::TreeModelColumn<HklParameter *> axis;
-	Gtk::TreeModelColumn<Glib::ustring> name;
-	Gtk::TreeModelColumn<double> read;
-	Gtk::TreeModelColumn<double> write;
-	Gtk::TreeModelColumn<double> min;
-	Gtk::TreeModelColumn<double> max;
-
-	AxeModelColumns()
-		{
-			add(axis);
-			add(name);
-			add(read);
-			add(write);
-			add(min);
-			add(max);
-		}
-};
-
-class PseudoAxeModelColumns : public Gtk::TreeModel::ColumnRecord
-{
-public:
-	Gtk::TreeModelColumn<HklParameter *> parameter;
-	Gtk::TreeModelColumn<Glib::ustring> name;
-	Gtk::TreeModelColumn<double> read;
-	Gtk::TreeModelColumn<double> write;
-	Gtk::TreeModelColumn<double> min;
-	Gtk::TreeModelColumn<double> max;
-	Gtk::TreeModelColumn<HklEngine *> engine;
-
-	PseudoAxeModelColumns()
-		{
-			this->add(parameter);
-			this->add(name);
-			this->add(read);
-			this->add(write);
-			this->add(min);
-			this->add(max);
-			this->add(engine);
-		}
-};
-
-class ParameterModelColumns : public Gtk::TreeModel::ColumnRecord
-{
-public:
-	Gtk::TreeModelColumn<HklParameter *> parameter;
-	Gtk::TreeModelColumn<Glib::ustring> name;
-	Gtk::TreeModelColumn<double> value;
-
-	ParameterModelColumns()
-		{
-			this->add(parameter);
-			this->add(name);
-			this->add(value);
-		}
-};
-
-class SolutionModelColumns : public Gtk::TreeModel::ColumnRecord
-{
-public:
-	Gtk::TreeModelColumn<gint> index;
-	Gtk::TreeModelColumn<const HklGeometryListItem *> item;
-	std::vector<Gtk::TreeModelColumn<gdouble> > axes;
-
-	SolutionModelColumns(HklGeometry *geometry)
-		{
-			const darray_parameter *axes;
-			HklParameter **axis;
-
-			this->add(this->index);
-			this->add(this->item);
-
-			axes = hkl_geometry_axes_get(geometry);
-			darray_foreach(axis, *axes){
-				this->axes.push_back(Gtk::TreeModelColumn<gdouble>());
-				this->add(this->axes.back());
-			}
-		}
-};
-
-class DiffractometerModelColumns : public Gtk::TreeModel::ColumnRecord
-{
-public:
-	Gtk::TreeModelColumn<Glib::ustring> name;
-	Gtk::TreeModelColumn<gint> type;
-
-	DiffractometerModelColumns(void)
-		{
-			this->add(name);
-			this->add(type);
-		}
-};
-
-#endif // GTKMM_MODEL_COLUMNS_H
diff --git a/gui/hkl-gui-pseudoaxes.c b/gui/hkl-gui-pseudoaxes.c
new file mode 100644
index 0000000..46cf067
--- /dev/null
+++ b/gui/hkl-gui-pseudoaxes.c
@@ -0,0 +1,454 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+
+#include "hkl-gui-macros.h"
+#include "hkl-gui-pseudoaxes.h"
+#include "hkl.h"
+#include <gtk/gtk.h>
+#include <stdlib.h>
+#include <string.h>
+#include <float.h>
+#include <math.h>
+
+G_DEFINE_TYPE (HklGuiEngine, hkl_gui_engine, G_TYPE_OBJECT);
+
+enum {
+  PROP_0,
+
+  PROP_ENGINE,
+  PROP_LISTSTORE,
+
+  N_PROPERTIES
+};
+
+/* Keep a pointer to the properties definition */
+static GParamSpec *obj_properties[N_PROPERTIES] = { NULL, };
+
+enum {
+	CHANGED,
+
+	N_SIGNALS
+};
+
+static guint signals[N_SIGNALS] = { 0 };
+
+struct _HklGuiEnginePrivate {
+	/* Properties */
+	HklEngine* engine;
+	/* Properties */
+
+	GtkBuilder *builder;
+	GtkFrame* frame1;
+	GtkLabel* label2;
+	GtkComboBox* combobox1;
+	GtkExpander* expander1;
+	GtkTreeView* treeview1;
+	GtkButton* button1;
+	GtkButton* button2;
+	GtkListStore* store_mode;
+	GtkListStore* store_pseudo;
+	GtkListStore* store_mode_parameter;
+};
+
+#define HKL_GUI_ENGINE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), HKL_GUI_TYPE_ENGINE, HklGuiEnginePrivate))
+
+static void
+set_property (GObject *object, guint prop_id,
+	      const GValue *value, GParamSpec *pspec)
+{
+	HklGuiEngine *self = HKL_GUI_ENGINE (object);
+	HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
+
+	switch (prop_id) {
+	case PROP_ENGINE:
+		hkl_gui_engine_set_engine(self, g_value_get_pointer (value));
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+		break;
+	}
+}
+
+static void
+get_property (GObject *object, guint prop_id,
+	      GValue *value, GParamSpec *pspec)
+{
+	HklGuiEngine *self = HKL_GUI_ENGINE (object);
+	HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
+
+	switch (prop_id)
+	{
+	case PROP_ENGINE:
+		g_value_set_pointer (value, hkl_gui_engine_get_engine (self));
+		break;
+	case PROP_LISTSTORE:
+		g_value_set_object(value, hkl_gui_engine_get_liststore (self));
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+		break;
+	}
+}
+
+static void
+finalize (GObject* object)
+{
+	HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(object);
+
+	g_object_unref(priv->builder);
+
+	G_OBJECT_CLASS (hkl_gui_engine_parent_class)->finalize (object);
+}
+
+
+HklGuiEngine*
+hkl_gui_engine_new (HklEngine* engine)
+{
+	return g_object_new (HKL_GUI_TYPE_ENGINE,
+			     "engine", engine,
+			     NULL);
+}
+
+
+HklEngine*
+hkl_gui_engine_get_engine (HklGuiEngine *self)
+{
+	HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
+
+	return priv->engine;
+}
+
+
+GtkListStore*
+hkl_gui_engine_get_liststore (HklGuiEngine *self)
+{
+	HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
+
+	return priv->store_pseudo;
+}
+
+GtkFrame*
+hkl_gui_engine_get_frame(HklGuiEngine *self)
+{
+	HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
+
+	return priv->frame1;
+}
+
+static void
+update_pseudo_axis (HklGuiEngine* self)
+{
+	HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
+	GtkTreeIter iter = {0};
+	const darray_string *parameters = hkl_engine_pseudo_axis_names_get (priv->engine);
+	unsigned int n_values = darray_size(*parameters);
+	double values[n_values];
+	GError *error = NULL;
+	unsigned int i;
+
+	g_return_if_fail (self != NULL);
+
+	gtk_list_store_clear (priv->store_pseudo);
+	if(!hkl_engine_pseudo_axis_values_get(priv->engine, values, n_values, HKL_UNIT_USER, &error)){
+		/* TODO check for the error */
+		g_clear_error(&error);
+		return;
+	}
+
+	for(i=0; i<n_values; ++i){
+		gtk_list_store_append (priv->store_pseudo,
+				       &iter);
+		gtk_list_store_set (priv->store_pseudo,
+				    &iter,
+				    PSEUDO_COL_NAME, darray_item(*parameters, i),
+				    PSEUDO_COL_IDX, i,
+				    PSEUDO_COL_VALUE, values[i],
+				    -1);
+	}
+}
+
+
+static void
+update_mode (HklGuiEngine* self)
+{
+	HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
+	GtkTreeIter iter = {0};
+	GtkTreeIter current = {0};
+	const darray_string *modes;
+	const char **mode;
+
+	g_return_if_fail (self != NULL);
+
+	modes = hkl_engine_modes_names_get(priv->engine);
+	gtk_list_store_clear (priv->store_mode);
+	darray_foreach(mode, *modes){
+		gtk_list_store_append (priv->store_mode,
+				       &iter);
+		gtk_list_store_set (priv->store_mode,
+				    &iter,
+				    MODE_COL_NAME, *mode,
+				    -1);
+		if(*mode == hkl_engine_current_mode_get(priv->engine))
+			current = iter;
+	}
+
+	/* now set the active row with the current mode */
+	gtk_combo_box_set_active_iter(priv->combobox1, &current);
+}
+
+
+static void
+update_mode_parameters (HklGuiEngine* self)
+{
+	HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
+	const darray_string *parameters = hkl_engine_parameters_names_get(priv->engine);
+	unsigned int n_values = darray_size(*parameters);
+	double values[n_values];
+	unsigned int i;
+
+	if(n_values){
+		GtkTreeIter iter = {0};
+
+		gtk_list_store_clear (priv->store_mode_parameter);
+		hkl_engine_parameters_values_get(priv->engine, values, n_values, HKL_UNIT_USER);
+		for(i=0; i<n_values; ++i){
+			gtk_list_store_append (priv->store_mode_parameter, &iter);
+			gtk_list_store_set (priv->store_mode_parameter,
+					    &iter,
+					    PSEUDO_COL_NAME, darray_item(*parameters, i),
+					    PSEUDO_COL_IDX, i,
+					    PSEUDO_COL_VALUE, values[i],
+					    -1);
+		}
+		gtk_expander_set_expanded (priv->expander1, TRUE);
+		gtk_widget_show (GTK_WIDGET (priv->expander1));
+	}else
+		gtk_widget_hide (GTK_WIDGET (priv->expander1));
+}
+
+
+void
+hkl_gui_engine_update (HklGuiEngine* self)
+{
+	HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
+	GtkTreeViewColumn* col;
+	GList* cells;
+
+	g_return_if_fail (self != NULL);
+
+	update_pseudo_axis (self);
+
+	col = gtk_tree_view_get_column(priv->treeview1, 1);
+	cells = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(col));
+	g_object_set (G_OBJECT(cells->data), "background", NULL, NULL);
+	g_list_free(cells);
+}
+
+
+void hkl_gui_engine_set_engine (HklGuiEngine *self,
+				HklEngine *engine)
+{
+	HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
+
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (engine != NULL);
+
+	priv->engine = engine;
+
+	gtk_label_set_label (priv->label2,
+			     hkl_engine_name_get(priv->engine));
+
+	update_pseudo_axis (self);
+	update_mode (self);
+	update_mode_parameters (self);
+
+	hkl_gui_engine_update(self);
+}
+
+static void
+combobox1_changed_cb (GtkComboBox* combobox, HklGuiEngine* self)
+{
+	HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
+	gchar *mode;
+	GtkTreeIter iter = {0};
+
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (combobox != NULL);
+
+	if(gtk_combo_box_get_active_iter(combobox, &iter)){
+		gtk_tree_model_get(GTK_TREE_MODEL(priv->store_mode),
+				   &iter,
+				   MODE_COL_NAME, &mode,
+				   -1);
+		if(!hkl_engine_current_mode_set(priv->engine, mode, NULL))
+			return;
+		update_mode_parameters(self);
+	}
+}
+
+static void
+button1_clicked_cb (GtkButton* button, HklGuiEngine* self)
+{
+	g_signal_emit(self, signals[CHANGED], 0);
+}
+
+
+static void
+button2_clicked_cb (GtkButton* button, HklGuiEngine* self)
+{
+	HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
+
+	if (HKL_ENGINE_CAPABILITIES_INITIALIZABLE & hkl_engine_capabilities_get(priv->engine)){
+		if(hkl_engine_initialized_set(priv->engine, TRUE, NULL)){
+			/* some init method update the parameters */
+			update_mode_parameters(self);
+		}
+	}
+}
+
+
+static void
+cell_tree_view_pseudo_axis_value_edited_cb (GtkCellRendererText* renderer,
+					    const gchar* path,
+					    const gchar* new_text,
+					    HklGuiEngine* self)
+{
+	HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
+	GtkTreeIter iter = {0};
+	GtkListStore* model = NULL;
+
+	if (gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv->store_pseudo),
+						 &iter, path)) {
+		gdouble value = 0.0;
+
+		value = atof(new_text);
+		g_object_set (G_OBJECT(renderer), "background", "red", NULL, NULL);
+		gtk_list_store_set (priv->store_pseudo,
+				    &iter,
+				    PSEUDO_COL_VALUE, value,
+				    -1);
+	}
+}
+
+static void hkl_gui_engine_class_init (HklGuiEngineClass * class)
+{
+	GObjectClass *gobject_class = G_OBJECT_CLASS (class);
+
+	g_type_class_add_private (class, sizeof (HklGuiEnginePrivate));
+
+	/* virtual methods */
+	gobject_class->finalize = finalize;
+	gobject_class->set_property = set_property;
+	gobject_class->get_property = get_property;
+
+	/* properties */
+	obj_properties[PROP_ENGINE] =
+		g_param_spec_pointer ("engine",
+				      "Engine",
+				      "The Hkl Engine used underneath",
+				      G_PARAM_CONSTRUCT_ONLY |
+				      G_PARAM_READWRITE |
+				      G_PARAM_STATIC_STRINGS);
+
+	obj_properties[PROP_LISTSTORE] =
+		g_param_spec_object ("liststore",
+				     "Liststore",
+				     "The liststore contaning all the pseudo axes values",
+				     GTK_TYPE_LIST_STORE,
+				     G_PARAM_READABLE |
+				     G_PARAM_STATIC_STRINGS);
+
+	g_object_class_install_properties (gobject_class,
+					   N_PROPERTIES,
+					   obj_properties);
+
+	/* signals */
+	signals[CHANGED] =
+		g_signal_new ("changed",
+			      HKL_GUI_TYPE_ENGINE,
+			      G_SIGNAL_RUN_LAST,
+			      0, /* class offset */
+			      NULL, /* accumulator */
+			      NULL, /* accu_data */
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, /* return_type */
+			      0);
+}
+
+
+static void _connect_renderer(gpointer data, gpointer user_data)
+{
+	GtkCellRenderer *renderer = GTK_CELL_RENDERER(data);
+	HklGuiEngine *self = HKL_GUI_ENGINE(user_data);
+
+	g_signal_connect_object (renderer,
+				 "edited",
+				 (GCallback) cell_tree_view_pseudo_axis_value_edited_cb,
+				 self, 0);
+}
+
+static void hkl_gui_engine_init (HklGuiEngine * self)
+{
+	HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
+	GtkBuilder *builder;
+	GtkTreeViewColumn* col;
+	GList* cells;
+
+	priv->engine = NULL;
+	priv->builder = builder = gtk_builder_new ();
+
+	get_ui(builder, "pseudo.ui");
+
+	get_object(builder, GTK_FRAME, priv, frame1);
+	get_object(builder, GTK_LABEL, priv, label2);
+	get_object(builder, GTK_COMBO_BOX, priv, combobox1);
+	get_object(builder, GTK_EXPANDER, priv, expander1);
+	get_object(builder, GTK_TREE_VIEW, priv, treeview1);
+	get_object(builder, GTK_BUTTON, priv, button1);
+	get_object(builder, GTK_BUTTON, priv, button2);
+
+	get_object(builder, GTK_LIST_STORE, priv, store_mode);
+	get_object(builder, GTK_LIST_STORE, priv, store_pseudo);
+	get_object(builder, GTK_LIST_STORE, priv, store_mode_parameter);
+
+	gtk_builder_connect_signals (builder, self);
+
+	g_signal_connect_object (priv->combobox1,
+				 "changed",
+				 (GCallback) combobox1_changed_cb,
+				 self, 0);
+
+	g_signal_connect_object (priv->button1,
+				 "clicked",
+				 (GCallback) button1_clicked_cb,
+				 self, 0);
+
+	g_signal_connect_object (priv->button2,
+				 "clicked",
+				 (GCallback) button2_clicked_cb,
+				 self, 0);
+
+	col = gtk_tree_view_get_column (priv->treeview1, 1);
+	cells = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(col));
+	g_list_foreach(cells, _connect_renderer, self);
+	g_list_free(cells);
+}
diff --git a/gui/hkl-gui-pseudoaxes.cpp b/gui/hkl-gui-pseudoaxes.cpp
deleted file mode 100644
index 946afc3..0000000
--- a/gui/hkl-gui-pseudoaxes.cpp
+++ /dev/null
@@ -1,236 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include "hkl-gui-pseudoaxes.h"
-
-PseudoAxesFrame::PseudoAxesFrame(HklEngine *engine)
-{
-	Gtk::CellRenderer * renderer;
-
-	_engine = engine;
-
-	//Get Glade UI:
-	_refGlade = Gtk::Builder::create();
-	try{
-		_refGlade->add_from_file("pseudo.ui");
-	}catch(...){
-		std::string filename = Glib::build_filename(PKGDATA, "pseudo.ui");
-		if(!_refGlade->add_from_file(filename))
-			exit(1);
-	}
-
-	// widgets
-	_refGlade->get_widget("frame1", _frame1);
-	_refGlade->get_widget("label2", _label2);
-	_refGlade->get_widget("combobox1", _combobox1);
-	_refGlade->get_widget("expander1", _expander1);
-	_refGlade->get_widget("treeview1", _treeview1);
-	_refGlade->get_widget("treeview2", _treeview2);
-	_refGlade->get_widget("button1", _button1);
-	_refGlade->get_widget("button2", _button2);
-
-	// objects
-	_mode_ListStore = Glib::RefPtr<Gtk::ListStore>::cast_dynamic(
-		_refGlade->get_object("liststore1"));
-	_pseudoAxis_ListStore = Glib::RefPtr<Gtk::ListStore>::cast_dynamic(
-		_refGlade->get_object("liststore2"));
-	_mode_parameter_ListStore = Glib::RefPtr<Gtk::ListStore>::cast_dynamic(
-		_refGlade->get_object("liststore3"));
-
-	// title
-	_label2->set_label(hkl_engine_name(engine));
-
-	// update all the liststore
-	this->updatePseudoAxis();
-	this->updateMode();
-	this->updateModeParameters();
-
-	// connect signals
-	_combobox1->signal_changed().connect(
-		sigc::mem_fun(*this, &PseudoAxesFrame::on_combobox1_changed) );
-
-	renderer = _treeview1->get_column_cell_renderer(1); // 1 is the index of the value column
-	dynamic_cast<Gtk::CellRendererText *>(renderer)->signal_edited().connect(
-		sigc::mem_fun(*this, &PseudoAxesFrame::on_cell_TreeView_pseudoAxis_value_edited));
-
-	_button1->signal_clicked ().connect (
-		sigc::mem_fun (*this, &PseudoAxesFrame::on_button1_clicked) );
-
-	_button2->signal_clicked ().connect (
-		sigc::mem_fun (*this, &PseudoAxesFrame::on_button2_clicked) );
-
-	renderer = _treeview2->get_column_cell_renderer(1); // 1 is the index of the value column
-	dynamic_cast<Gtk::CellRendererText *>(renderer)->signal_edited().connect(
-		sigc::mem_fun(*this, &PseudoAxesFrame::on_cell_treeview2_mode_parameter_value_edited));
-
-
-}
-
-PseudoAxesFrame::~PseudoAxesFrame(void)
-{
-}
-
-void PseudoAxesFrame::update(void)
-{
-	Gtk::CellRenderer *renderer;
-	this->updatePseudoAxis();
-
-	renderer = _treeview1->get_column_cell_renderer(1); // 1 is the index of the value column
-	renderer->property_cell_background().set_value("white");
-}
-
-/************/
-/* Callback */
-/************/
-
-void PseudoAxesFrame::on_combobox1_changed(void)
-{
-	Gtk::TreeModel::iterator iter = _combobox1->get_active();
-	Gtk::ListStore::Row row = *(iter);
-	hkl_engine_select_mode(_engine, row[_mode_columns.mode]);
-	this->updateModeParameters();
-	this->_signal_changed();
-}
-
-void PseudoAxesFrame::on_cell_TreeView_pseudoAxis_value_edited(Glib::ustring const & spath,
-							       Glib::ustring const & newText)
-{
-	double value;
-	HklParameter *parameter;
-
-	Gtk::TreePath path(spath);
-	Gtk::TreeModel::iterator iter = _pseudoAxis_ListStore->get_iter(path);
-	Gtk::ListStore::Row row = *(iter);
-
-	sscanf(newText.c_str(), "%lf", &value);
-
-	parameter = row[_pseudoAxis_columns.parameter];
-	if(parameter){
-		Gtk::CellRenderer *renderer;
-
-		renderer = _treeview1->get_column_cell_renderer(1); // 1 is the index of the value column
-		renderer->property_cell_background().set_value("red");
-		/* TODO check the error and change the meaning once
-		   the set method will do the computation */
-		hkl_parameter_value_unit_set(parameter, value, NULL);
-		row[_pseudoAxis_columns.value] = value;
-	}
-}
-
-void PseudoAxesFrame::on_button1_clicked(void)
-{
-	if(hkl_engine_set(_engine, NULL)){
-		HklEngineList *engines = hkl_engine_engines(this->_engine);
-		hkl_engine_list_select_solution(engines, 0);
-		this->_signal_changed();
-	}
-}
-
-void PseudoAxesFrame::on_button2_clicked(void)
-{
-	if(hkl_engine_initialize(_engine, NULL))
-		this->updateModeParameters(); //some initialize function modify the parameters
-}
-
-void PseudoAxesFrame::on_cell_treeview2_mode_parameter_value_edited(Glib::ustring const & spath,
-								    Glib::ustring const & newText)
-{
-	double value;
-	HklParameter *parameter;
-
-	Gtk::TreePath path(spath);
-	Gtk::TreeModel::iterator iter = _mode_parameter_ListStore->get_iter(path);
-	Gtk::ListStore::Row row = *(iter);
-
-	sscanf(newText.c_str(), "%lf", &value);
-
-	parameter = row[_mode_parameter_columns.parameter];
-	if(parameter){
-		/* TODO check the error */
-		hkl_parameter_value_unit_set(parameter, value, NULL);
-		row[_mode_parameter_columns.value] = value;
-	}
-}
-
-/****************/
-/* Non-Callback */
-/****************/
-
-void PseudoAxesFrame::updatePseudoAxis(void)
-{
-	HklParameter **parameter;
-	darray_parameter *pseudo_axes = (darray_parameter *)hkl_engine_pseudo_axes(this->_engine);
-
-	_pseudoAxis_ListStore->clear();
-	darray_foreach(parameter, *pseudo_axes){
-		Gtk::TreeRow row = *(_pseudoAxis_ListStore->append());
-		row[_pseudoAxis_columns.name] = hkl_parameter_name_get(*parameter);
-		row[_pseudoAxis_columns.value] = hkl_parameter_value_unit_get(*parameter);
-		row[_pseudoAxis_columns.parameter] = *parameter;
-	}
-}
-
-void PseudoAxesFrame::updateMode(void)
-{
-	HklMode **mode;
-	darray_mode *modes = hkl_engine_modes(this->_engine);
-
-	_mode_ListStore->clear();
-	darray_foreach(mode, *modes){
-		Gtk::TreeRow row = *(_mode_ListStore->append());
-		row[_mode_columns.name] = hkl_mode_name(*mode);
-		row[_mode_columns.mode] = *mode;
-	}
-}
-
-void PseudoAxesFrame::updateModeParameters(void)
-{
-	HklMode *mode = hkl_engine_mode(this->_engine);
-
-	if(mode){
-		darray_parameter *parameters = hkl_mode_parameters(mode);
-
-		if(darray_size(*parameters)){
-			HklParameter **parameter;
-
-			_mode_parameter_ListStore->clear();
-			darray_foreach(parameter, *parameters){
-				Gtk::TreeRow row = *(_mode_parameter_ListStore->append());
-				row[_mode_parameter_columns.name] = hkl_parameter_name_get(*parameter);
-				row[_mode_parameter_columns.value] = hkl_parameter_value_unit_get(*parameter);
-				row[_mode_parameter_columns.parameter] = *parameter;
-			}
-			_expander1->set_expanded(1);
-			_expander1->show();
-		}else
-			_expander1->hide();
-	}else
-		_expander1->hide();
-}
-
-/***********/
-/* signals */
-/***********/
-
-PseudoAxesFrame::type_signal_changed PseudoAxesFrame::signal_changed(void)
-{
-	return _signal_changed;
-}
diff --git a/gui/hkl-gui-pseudoaxes.h b/gui/hkl-gui-pseudoaxes.h
index 963dfb2..6d1f7f0 100644
--- a/gui/hkl-gui-pseudoaxes.h
+++ b/gui/hkl-gui-pseudoaxes.h
@@ -19,108 +19,68 @@
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef __PSEUDO_AXES_FRAME_H__
-#define __PSEUDO_AXES_FRAME_H__
-
-#include <gtkmm.h>
-#include "hkl.h"
-
-class ModeModelColumns : public Gtk::TreeModel::ColumnRecord
-{
-public:
-	Gtk::TreeModelColumn<Glib::ustring> name;
-	Gtk::TreeModelColumn<HklMode *> mode;
-
-	ModeModelColumns()
-		{
-			this->add(name);
-			this->add(mode);
-		}
-};
 
-class PseudoAxisModelColumns : public Gtk::TreeModel::ColumnRecord
-{
-public:
-	Gtk::TreeModelColumn<Glib::ustring> name;
-	Gtk::TreeModelColumn<double> value;
-	Gtk::TreeModelColumn<HklParameter *> parameter;
-
-	PseudoAxisModelColumns()
-		{
-			this->add(name);
-			this->add(value);
-			this->add(parameter);
-		}
-};
+#ifndef __HKL_GUI_ENGINE_H__
+#define __HKL_GUI_ENGINE_H__
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+#include <hkl.h>
+
+G_BEGIN_DECLS
+
+#define HKL_GUI_TYPE_ENGINE            (hkl_gui_engine_get_type ())
+#define HKL_GUI_ENGINE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), HKL_GUI_TYPE_ENGINE, HklGuiEngine))
+#define HKL_GUI_ENGINE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), HKL_GUI_TYPE_ENGINE, HklGuiEngineClass))
+#define HKL_GUI_IS_ENGINE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HKL_GUI_TYPE_ENGINE))
+#define HKL_GUI_IS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), HKL_GUI_TYPE_ENGINE))
+#define HKL_GUI_ENGINE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), HKL_GUI_TYPE_ENGINE, HklGuiEngineClass))
 
-class ModeParameterModelColumns : public Gtk::TreeModel::ColumnRecord
-{
-public:
-	Gtk::TreeModelColumn<Glib::ustring> name;
-	Gtk::TreeModelColumn<double> value;
-	Gtk::TreeModelColumn<HklParameter *> parameter;
-
-	ModeParameterModelColumns()
-		{
-			this->add(name);
-			this->add(value);
-			this->add(parameter);
-		}
+typedef struct _HklGuiEngine HklGuiEngine;
+typedef struct _HklGuiEngineClass HklGuiEngineClass;
+typedef struct _HklGuiEnginePrivate HklGuiEnginePrivate;
+
+typedef enum  {
+	MODE_COL_NAME = 0,
+	MODE_COL_NUM_COLS
+} ModeCol;
+
+typedef enum  {
+	PSEUDO_COL_NAME = 0,
+	PSEUDO_COL_IDX,
+	PSEUDO_COL_VALUE,
+	PSEUDO_COL_NUM_COLS
+} PseudoCol;
+
+struct _HklGuiEngine {
+	GObject parent_instance;
+
+	/*< private >*/
+	HklGuiEnginePrivate * priv;
 };
 
-class PseudoAxesFrame
-{
-public:
-	PseudoAxesFrame(HklEngine *engine);
-	Gtk::Frame &frame(void) {return *_frame1;}
-	virtual ~PseudoAxesFrame(void);
-
-	void update(void);
-
-	// signals emitted
-	typedef sigc::signal<void> type_signal_changed;
-	type_signal_changed signal_changed(void);
-
-// callback
-protected:
-	void on_combobox1_changed(void);
-	virtual void on_cell_TreeView_pseudoAxis_value_edited(Glib::ustring const &,
-							      Glib::ustring const &);
-	virtual void on_cell_treeview2_mode_parameter_value_edited(Glib::ustring const &,
-								   Glib::ustring const &);
-	void on_button1_clicked(void);
-	void on_button2_clicked(void);
-
-// non callback
-protected:
-	void updateMode(void);
-	void updatePseudoAxis(void);
-	void updateModeParameters(void);
-
-	type_signal_changed _signal_changed;
-
-// members
-protected:
-	HklEngine *_engine;
-
-	// widget
-	Glib::RefPtr<Gtk::Builder> _refGlade;
-	Gtk::Frame *_frame1;
-	Gtk::Label *_label2;
-	Gtk::ComboBox *_combobox1;
-	Gtk::Expander *_expander1;
-	Gtk::TreeView *_treeview1;
-	Gtk::TreeView *_treeview2;
-	Gtk::Button *_button1;
-	Gtk::Button *_button2;
-
-	// objects
-	Glib::RefPtr<Gtk::ListStore> _mode_ListStore;
-	Glib::RefPtr<Gtk::ListStore> _pseudoAxis_ListStore;
-	Glib::RefPtr<Gtk::ListStore> _mode_parameter_ListStore;
-	ModeModelColumns _mode_columns;
-	PseudoAxisModelColumns _pseudoAxis_columns;
-	ModeParameterModelColumns _mode_parameter_columns;
+struct _HklGuiEngineClass {
+	GObjectClass parent_class;
 };
 
-#endif // __PSEUDO_AXES_FRAME_H__
+GType hkl_gui_engine_get_type (void) G_GNUC_CONST;
+
+HklGuiEngine* hkl_gui_engine_new (HklEngine* engine);
+
+void hkl_gui_engine_set_engine (HklGuiEngine *gui_engine,
+				HklEngine *engine);
+
+HklEngine* hkl_gui_engine_get_engine (HklGuiEngine *gui_engine);
+
+GtkListStore* hkl_gui_engine_get_liststore (HklGuiEngine *gui_engine);
+
+GtkFrame *hkl_gui_engine_get_frame(HklGuiEngine *self);
+
+void hkl_gui_engine_update (HklGuiEngine* self);
+
+G_END_DECLS
+
+#endif /* __HKL_GUI_ENGINE_H__ */
+
+
diff --git a/gui/hkl-gui.c b/gui/hkl-gui.c
new file mode 100644
index 0000000..b896d5e
--- /dev/null
+++ b/gui/hkl-gui.c
@@ -0,0 +1,2376 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <float.h>
+#include <math.h>
+#include <stdio.h>
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+#include <gdk/gdk.h>
+
+#include "hkl.h"
+#include "hkl-gui.h"
+#include "hkl-gui-macros.h"
+#if HKL3D
+# include <gtk/gtkgl.h>
+# include "hkl-gui-3d.h"
+#endif
+#include "hkl-gui-pseudoaxes.h"
+
+#define HKL_GUI_TYPE_WINDOW (hkl_gui_window_get_type ())
+#define HKL_GUI_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HKL_GUI_TYPE_WINDOW, HklGuiWindow))
+#define HKL_GUI_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), HKL_GUI_TYPE_WINDOW, HklGuiWindowClass))
+#define HKL_GUI_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HKL_GUI_TYPE_WINDOW))
+#define HKL_GUI_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), HKL_GUI_TYPE_WINDOW))
+#define HKL_GUI_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), HKL_GUI_TYPE_WINDOW, HklGuiWindowClass))
+
+#define EMBED_BREAKPOINT  asm volatile ("int3;")
+
+G_DEFINE_TYPE (HklGuiWindow, hkl_gui_window, G_TYPE_OBJECT);
+
+typedef enum  {
+	REFLECTION_COL_INDEX = 0,
+	REFLECTION_COL_H,
+	REFLECTION_COL_K,
+	REFLECTION_COL_L,
+	REFLECTION_COL_FLAG,
+	REFLECTION_COL_REFLECTION,
+	REFLECTION_COL_N_COLUMNS
+} ReflectionCol;
+
+typedef enum  {
+	AXIS_COL_AXIS = 0,
+	AXIS_COL_NAME,
+	AXIS_COL_READ,
+	AXIS_COL_WRITE,
+	AXIS_COL_MIN,
+	AXIS_COL_MAX,
+	AXIS_COL_N_COLUMNS
+} AxisCol;
+
+typedef enum  {
+	PSEUDO_AXIS_COL_IDX = 0,
+	PSEUDO_AXIS_COL_ENGINE,
+	PSEUDO_AXIS_COL_NAME,
+	PSEUDO_AXIS_COL_READ,
+	PSEUDO_AXIS_COL_WRITE,
+	PSEUDO_AXIS_COL_N_COLUMNS
+} PseudoAxisCol;
+
+typedef enum  {
+	PARAMETER_COL_PARAMETER = 0,
+	PARAMETER_COL_NAME,
+	PARAMETER_COL_VALUE,
+	PARAMETER_COL_N_COLUMNS
+} ParameterCol;
+
+typedef enum  {
+	SAMPLE_COL_SAMPLE = 0,
+	SAMPLE_COL_NAME,
+	SAMPLE_COL_A,
+	SAMPLE_COL_B,
+	SAMPLE_COL_C,
+	SAMPLE_COL_ALPHA,
+	SAMPLE_COL_BETA,
+	SAMPLE_COL_GAMMA,
+	SAMPLE_COL_N_COLUMNS
+} SampleCol;
+
+typedef enum  {
+	SOLUTION_COL_INDEX = 0,
+	SOLUTION_COL_HKL_GEOMETRY_LIST_ITEM,
+	SOLUTION_COL_N_COLUMNS
+} SolutionCol;
+
+typedef enum  {
+	DIFFRACTOMETER_COL_NAME = 0,
+	DIFFRACTOMETER_COL_FACTORY,
+	DIFFRACTOMETER_COL_DIFFRACTOMETER,
+	DIFFRACTOMETER_COL_N_COLUMNS
+} DiffractometerCol;
+
+/******************/
+/* Diffractometer */
+/******************/
+
+struct diffractometer_t {
+	HklFactory *factory;
+	HklGeometry *geometry;
+	HklDetector *detector;
+	HklEngineList *engines;
+	HklGeometryList *solutions;
+};
+
+
+static struct diffractometer_t *
+create_diffractometer(HklFactory *factory)
+{
+	struct diffractometer_t *self;
+
+	self = malloc(sizeof(*self));
+
+	self->factory = factory;
+	self->geometry = hkl_factory_create_new_geometry (factory);
+	self->engines = hkl_factory_create_new_engine_list (factory);
+	self->detector = hkl_detector_factory_new (HKL_DETECTOR_TYPE_0D);
+	self->solutions = NULL;
+
+	return self;
+}
+
+static void
+delete_diffractometer(struct diffractometer_t *self)
+{
+	hkl_geometry_free(self->geometry);
+	hkl_engine_list_free(self->engines);
+	hkl_detector_free(self->detector);
+	if(self->solutions)
+		hkl_geometry_list_free(self->solutions);
+}
+
+
+static void
+dump_diffractometer(struct diffractometer_t *self)
+{
+	/* hkl_geometry_fprintf(stderr, self->geometry); */
+	/* hkl_engine_list_fprintf(stderr, self->engines); */
+	/* hkl_detector_fprintf(stderr, self->detector); */
+}
+
+static void
+diffractometer_set_sample(struct diffractometer_t *self,
+			  HklSample *sample)
+{
+	hkl_engine_list_init(self->engines,
+			     self->geometry,
+			     self->detector,
+			     sample);
+	hkl_engine_list_get(self->engines);
+}
+
+static void
+diffractometer_set_wavelength(struct diffractometer_t *self,
+			      double wavelength)
+{
+	if(hkl_geometry_wavelength_set(self->geometry,
+				       wavelength, HKL_UNIT_USER, NULL))
+		hkl_engine_list_get(self->engines);
+}
+
+static gboolean
+diffractometer_set_solutions(struct diffractometer_t *self, HklGeometryList *solutions)
+{
+	if(solutions){
+		if(self->solutions)
+			hkl_geometry_list_free(self->solutions);
+		self->solutions = solutions;
+	}
+
+	return NULL != solutions;
+}
+
+static gboolean
+diffractometer_pseudo_axis_values_set(struct diffractometer_t *self,
+				      HklEngine *engine, gdouble values[], guint n_values,
+				      GError **error)
+{
+	HklGeometryList *solutions;
+
+
+	solutions = hkl_engine_pseudo_axis_values_set(engine, values, n_values, HKL_UNIT_USER, error);
+
+	return diffractometer_set_solutions(self, solutions);
+}
+
+static void
+diffractometer_set_solution(struct diffractometer_t *self,
+			    const HklGeometryListItem *item)
+{
+	hkl_engine_list_select_solution(self->engines, item);
+}
+
+
+/****************/
+/* HklGuiWindow */
+/****************/
+
+struct _HklGuiWindowPrivate {
+	GtkBuilder* builder;
+	GtkLabel* label_UB11;
+	GtkLabel* label_UB12;
+	GtkLabel* label_UB13;
+	GtkLabel* label_UB21;
+	GtkLabel* label_UB22;
+	GtkLabel* label_UB23;
+	GtkLabel* label_UB31;
+	GtkLabel* label_UB32;
+	GtkLabel* label_UB33;
+	GtkButton* button2;
+	GtkSpinButton* spinbutton_a;
+	GtkSpinButton* spinbutton_b;
+	GtkSpinButton* spinbutton_c;
+	GtkSpinButton* spinbutton_alpha;
+	GtkSpinButton* spinbutton_beta;
+	GtkSpinButton* spinbutton_gamma;
+	GtkSpinButton* spinbutton_a_min;
+	GtkSpinButton* spinbutton_b_min;
+	GtkSpinButton* spinbutton_c_min;
+	GtkSpinButton* spinbutton_alpha_min;
+	GtkSpinButton* spinbutton_beta_min;
+	GtkSpinButton* spinbutton_gamma_min;
+	GtkSpinButton* spinbutton_a_max;
+	GtkSpinButton* spinbutton_b_max;
+	GtkSpinButton* spinbutton_c_max;
+	GtkSpinButton* spinbutton_alpha_max;
+	GtkSpinButton* spinbutton_beta_max;
+	GtkSpinButton* spinbutton_gamma_max;
+	GtkSpinButton* spinbutton_lambda;
+	GtkSpinButton* spinbutton_a_star;
+	GtkSpinButton* spinbutton_b_star;
+	GtkSpinButton* spinbutton_c_star;
+	GtkSpinButton* spinbutton_alpha_star;
+	GtkSpinButton* spinbutton_beta_star;
+	GtkSpinButton* spinbutton_gamma_star;
+	GtkSpinButton* spinbutton_ux;
+	GtkSpinButton* spinbutton_uy;
+	GtkSpinButton* spinbutton_uz;
+	GtkSpinButton* spinbutton_U11;
+	GtkSpinButton* spinbutton_U12;
+	GtkSpinButton* spinbutton_U13;
+	GtkSpinButton* spinbutton_U21;
+	GtkSpinButton* spinbutton_U22;
+	GtkSpinButton* spinbutton_U23;
+	GtkSpinButton* spinbutton_U31;
+	GtkSpinButton* spinbutton_U32;
+	GtkSpinButton* spinbutton_U33;
+	GtkCheckButton* checkbutton_a;
+	GtkCheckButton* checkbutton_b;
+	GtkCheckButton* checkbutton_c;
+	GtkCheckButton* checkbutton_alpha;
+	GtkCheckButton* checkbutton_beta;
+	GtkCheckButton* checkbutton_gamma;
+	GtkCheckButton* checkbutton_ux;
+	GtkCheckButton* checkbutton_uy;
+	GtkCheckButton* checkbutton_uz;
+	GtkTreeView* treeview_reflections;
+	GtkTreeView* treeview_crystals;
+	GtkTreeView* treeview_axes;
+	GtkTreeView* treeview_pseudo_axes;
+	GtkTreeView* treeview_solutions;
+	GtkToolButton* toolbutton_add_reflection;
+	GtkToolButton* toolbutton_goto_reflection;
+	GtkToolButton* toolbutton_del_reflection;
+	GtkToolButton* toolbutton_setUB;
+	GtkToolButton* toolbutton_computeUB;
+	GtkToolButton* toolbutton_add_crystal;
+	GtkToolButton* toolbutton_copy_crystal;
+	GtkToolButton* toolbutton_del_crystal;
+	GtkToolButton* toolbutton_affiner;
+	GtkStatusbar* statusbar;
+	GtkImageMenuItem* menuitem5;
+	GtkVBox* box_info_bar; /* fake for the infor bar */
+	GtkVBox* vbox7;
+	GtkVBox* vbox2;
+	GtkDialog* dialog1;
+	GtkButton* button1;
+	GtkComboBox* combobox1;
+	GtkListStore* liststore_diffractometer;
+	GtkListStore* liststore_axis;
+	GtkListStore* liststore_pseudo_axes;
+	GtkListStore* liststore_solutions;
+	GtkListStore* liststore_reflections;
+	GtkListStore* liststore_crystals;
+
+	GtkInfoBar *info_bar;
+	GtkLabel *info_message;
+
+	darray(HklGuiEngine *) pseudo_frames;
+
+#if HKL3D
+	HklGui3D *frame3d;
+#endif
+	struct diffractometer_t *diffractometer; /* unowned */
+	HklSample *sample; /* unowned */
+	HklLattice *reciprocal;
+};
+
+#define HKL_GUI_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), HKL_GUI_TYPE_WINDOW, HklGuiWindowPrivate))
+
+static gboolean
+finalize_liststore_diffractometer(GtkTreeModel *model,
+				  GtkTreePath *path,
+				  GtkTreeIter *iter,
+				  gpointer data)
+{
+	struct diffractometer_t *diffractometer;
+
+	gtk_tree_model_get(model, iter,
+			   DIFFRACTOMETER_COL_DIFFRACTOMETER, &diffractometer,
+			   -1);
+	delete_diffractometer(diffractometer);
+	return FALSE;
+}
+
+static gboolean
+finalize_liststore_samples(GtkTreeModel *model,
+			   GtkTreePath *path,
+			   GtkTreeIter *iter,
+			   gpointer data)
+{
+	HklSample *sample = NULL;
+
+	gtk_tree_model_get(model, iter,
+			   SAMPLE_COL_SAMPLE, &sample,
+			   -1);
+	hkl_sample_free(sample);
+	return FALSE;
+}
+
+static void
+finalize (GObject* object)
+{
+	HklGuiWindowPrivate *priv =  HKL_GUI_WINDOW_GET_PRIVATE(object);
+
+	g_object_unref(priv->builder);
+
+	darray_free(priv->pseudo_frames);
+
+	gtk_tree_model_foreach(GTK_TREE_MODEL(priv->liststore_diffractometer),
+			       finalize_liststore_diffractometer,
+			       NULL);
+
+	gtk_tree_model_foreach(GTK_TREE_MODEL(priv->liststore_crystals),
+			       finalize_liststore_samples,
+			       NULL);
+
+	G_OBJECT_CLASS (hkl_gui_window_parent_class)->finalize (object);
+}
+
+HklGuiWindow* hkl_gui_window_new (void)
+{
+	return g_object_new (HKL_GUI_TYPE_WINDOW, NULL);
+}
+
+static void
+hkl_gui_window_get_widgets_and_objects_from_ui (HklGuiWindow* self)
+{
+	HklGuiWindowPrivate *priv =  HKL_GUI_WINDOW_GET_PRIVATE(self);
+	GtkBuilder* builder;
+
+	g_return_if_fail (self != NULL);
+
+	priv->builder = builder = gtk_builder_new ();
+	get_ui(builder, "ghkl.ui");
+
+	get_object(builder, GTK_LIST_STORE, priv, liststore_diffractometer);
+	get_object(builder, GTK_LIST_STORE, priv, liststore_axis);
+	get_object(builder, GTK_LIST_STORE, priv, liststore_pseudo_axes);
+	get_object(builder, GTK_LIST_STORE, priv, liststore_reflections);
+	get_object(builder, GTK_LIST_STORE, priv, liststore_crystals);
+
+	get_object(builder, GTK_LABEL, priv, label_UB11);
+	get_object(builder, GTK_LABEL, priv, label_UB12);
+	get_object(builder, GTK_LABEL, priv, label_UB13);
+	get_object(builder, GTK_LABEL, priv, label_UB21);
+	get_object(builder, GTK_LABEL, priv, label_UB22);
+	get_object(builder, GTK_LABEL, priv, label_UB23);
+	get_object(builder, GTK_LABEL, priv, label_UB31);
+	get_object(builder, GTK_LABEL, priv, label_UB32);
+	get_object(builder, GTK_LABEL, priv, label_UB33);
+
+	get_object(builder, GTK_BUTTON, priv, button2);
+
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_a);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_a_min);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_a_max);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_a_star);
+
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_b);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_b_min);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_b_max);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_b_star);
+
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_c);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_c_min);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_c_max);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_c_star);
+
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_alpha);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_alpha_min);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_alpha_max);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_alpha_star);
+
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_beta);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_beta_min);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_beta_max);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_beta_star);
+
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_gamma);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_gamma_min);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_gamma_max);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_gamma_star);
+
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_lambda);
+
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_ux);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_uy);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_uz);
+
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_U11);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_U12);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_U13);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_U21);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_U22);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_U23);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_U31);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_U32);
+	get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_U33);
+
+
+	get_object(builder, GTK_CHECK_BUTTON, priv, checkbutton_a);
+	get_object(builder, GTK_CHECK_BUTTON, priv, checkbutton_b);
+	get_object(builder, GTK_CHECK_BUTTON, priv, checkbutton_c);
+	get_object(builder, GTK_CHECK_BUTTON, priv, checkbutton_alpha);
+	get_object(builder, GTK_CHECK_BUTTON, priv, checkbutton_beta);
+	get_object(builder, GTK_CHECK_BUTTON, priv, checkbutton_gamma);
+	get_object(builder, GTK_CHECK_BUTTON, priv, checkbutton_ux);
+	get_object(builder, GTK_CHECK_BUTTON, priv, checkbutton_uy);
+	get_object(builder, GTK_CHECK_BUTTON, priv, checkbutton_uz);
+
+
+	get_object(builder, GTK_TREE_VIEW, priv, treeview_reflections);
+	get_object(builder, GTK_TREE_VIEW, priv, treeview_crystals);
+	get_object(builder, GTK_TREE_VIEW, priv, treeview_axes);
+	get_object(builder, GTK_TREE_VIEW, priv, treeview_pseudo_axes);
+	get_object(builder, GTK_TREE_VIEW, priv, treeview_solutions);
+
+	get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton_add_reflection);
+	get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton_goto_reflection);
+	get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton_del_reflection);
+	get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton_setUB);
+	get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton_computeUB);
+	get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton_add_crystal);
+	get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton_copy_crystal);
+	get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton_del_crystal);
+	get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton_affiner);
+
+	get_object(builder, GTK_STATUSBAR, priv, statusbar);
+
+	get_object(builder, GTK_IMAGE_MENU_ITEM, priv, menuitem5);
+
+	get_object(builder, GTK_VBOX, priv, vbox7);
+	get_object(builder, GTK_VBOX, priv, vbox2);
+	get_object(builder, GTK_VBOX, priv, box_info_bar);
+
+	get_object(builder, GTK_DIALOG, priv, dialog1);
+
+	get_object(builder, GTK_COMBO_BOX, priv, combobox1);
+
+	gtk_builder_connect_signals (builder, self);
+}
+
+static void
+update_pseudo_axes_frames (HklGuiWindow* self)
+{
+	HklGuiWindowPrivate *priv =  HKL_GUI_WINDOW_GET_PRIVATE(self);
+	HklGuiEngine **engine;
+
+	g_return_if_fail (self != NULL);
+
+	darray_foreach(engine, priv->pseudo_frames){
+		hkl_gui_engine_update(*engine);
+	}
+}
+
+static void
+raise_error(HklGuiWindow *self, GError **error)
+{
+	HklGuiWindowPrivate *priv =  HKL_GUI_WINDOW_GET_PRIVATE(self);
+
+	g_return_if_fail (error != NULL);
+
+	/* show an error message */
+	gtk_label_set_text (GTK_LABEL (priv->info_message),
+			    (*error)->message);
+	gtk_info_bar_set_message_type (priv->info_bar,
+				       GTK_MESSAGE_ERROR);
+	gtk_widget_show (GTK_WIDGET(priv->info_bar));
+
+	g_clear_error(error);
+}
+
+static void
+clear_error(HklGuiWindow *self, GError **error)
+{
+	HklGuiWindowPrivate *priv =  HKL_GUI_WINDOW_GET_PRIVATE(self);
+
+	g_return_if_fail (self != NULL);
+
+	gtk_widget_hide(GTK_WIDGET(priv->info_bar));
+}
+
+static gboolean
+_update_axis (GtkTreeModel *model, GtkTreePath *path,
+	      GtkTreeIter *iter, gpointer data)
+{
+	HklGuiWindowPrivate *priv =  HKL_GUI_WINDOW_GET_PRIVATE(data);
+	const char *name;
+	const HklParameter *axis;
+	gdouble value, min, max;
+
+	gtk_tree_model_get (model, iter,
+			    AXIS_COL_NAME, &name,
+			    -1);
+
+	axis = hkl_geometry_axis_get(priv->diffractometer->geometry, name, NULL);
+	hkl_parameter_min_max_get(axis, &min, &max, HKL_UNIT_USER);
+	value = hkl_parameter_value_get(axis, HKL_UNIT_USER);
+
+	gtk_list_store_set(GTK_LIST_STORE(model), iter,
+			   AXIS_COL_READ, value,
+			   AXIS_COL_WRITE, value,
+			   AXIS_COL_MIN, min,
+			   AXIS_COL_MAX, max,
+			   -1);
+	return FALSE;
+}
+
+static void
+update_axes (HklGuiWindow* self)
+{
+	HklGuiWindowPrivate *priv =  HKL_GUI_WINDOW_GET_PRIVATE(self);
+
+	g_return_if_fail (self != NULL);
+
+	gtk_tree_model_foreach(GTK_TREE_MODEL(priv->liststore_axis),
+			       _update_axis,
+			       self);
+}
+
+static gboolean
+_update_pseudo_axes (GtkTreeModel *model, GtkTreePath *path,
+		     GtkTreeIter *iter, gpointer data)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(data);
+	const char *name;
+	const HklEngine *engine;
+	const HklParameter *pseudo_axis;
+	gdouble value, min, max;
+
+	gtk_tree_model_get (model, iter,
+			    PSEUDO_AXIS_COL_ENGINE, &engine,
+			    PSEUDO_AXIS_COL_NAME, &name,
+			    -1);
+
+	pseudo_axis = hkl_engine_pseudo_axis_get(engine, name, NULL);
+	hkl_parameter_min_max_get(pseudo_axis, &min, &max, HKL_UNIT_USER);
+	value = hkl_parameter_value_get(pseudo_axis, HKL_UNIT_USER);
+
+	gtk_list_store_set(GTK_LIST_STORE(model), iter,
+			   PSEUDO_AXIS_COL_READ, value,
+			   PSEUDO_AXIS_COL_WRITE, value,
+			   -1);
+	return FALSE;
+}
+
+static void
+update_pseudo_axes (HklGuiWindow* self)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+
+	g_return_if_fail (self != NULL);
+
+	gtk_tree_model_foreach(GTK_TREE_MODEL(priv->liststore_pseudo_axes),
+			       _update_pseudo_axes,
+			       self);
+}
+
+static void
+update_solutions (HklGuiWindow* self)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+	GtkTreeIter iter = {0};
+
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (priv->diffractometer->solutions != NULL);
+
+	const HklGeometryListItem *item;
+	gtk_list_store_clear(priv->liststore_solutions);
+
+	gint n_values = gtk_tree_model_get_n_columns (GTK_TREE_MODEL(priv->liststore_solutions));
+	GValue *values = g_new0(GValue, n_values);
+	gint *columns = g_new0(gint, n_values);
+	gint i;
+
+	/* prepare the GValue before using them */
+	g_value_init(&values[SOLUTION_COL_INDEX], G_TYPE_INT);
+	g_value_init(&values[SOLUTION_COL_HKL_GEOMETRY_LIST_ITEM], G_TYPE_POINTER);
+	for(i=SOLUTION_COL_N_COLUMNS; i<n_values; ++i)
+		g_value_init(&values[i], G_TYPE_DOUBLE);
+
+	i=0;
+	HKL_GEOMETRY_LIST_FOREACH(item, priv->diffractometer->solutions){
+		const HklGeometry *geometry = hkl_geometry_list_item_geometry_get(item);
+		unsigned int n_v = darray_size(*hkl_geometry_axis_names_get(geometry));
+		double v[n_v];
+
+		hkl_geometry_axis_values_get(geometry, v, n_v, HKL_UNIT_USER);
+
+		g_value_set_int(&values[SOLUTION_COL_INDEX], i);
+		g_value_set_pointer(&values[SOLUTION_COL_HKL_GEOMETRY_LIST_ITEM], (gpointer)item);
+		columns[SOLUTION_COL_INDEX] = SOLUTION_COL_INDEX;
+		columns[SOLUTION_COL_HKL_GEOMETRY_LIST_ITEM] = SOLUTION_COL_HKL_GEOMETRY_LIST_ITEM;
+
+		for(unsigned int j=0; j<n_v; ++j){
+			g_value_set_double(&values[SOLUTION_COL_N_COLUMNS + j], v[j]);
+			columns[SOLUTION_COL_N_COLUMNS + j] = SOLUTION_COL_N_COLUMNS + j;
+		}
+		gtk_list_store_insert_with_valuesv(priv->liststore_solutions,
+						   &iter, i,
+						   columns, values, n_values);
+		i++;
+	}
+	g_free(columns);
+	g_free(values);
+}
+
+static void
+update_source (HklGuiWindow* self)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+
+	g_return_if_fail (self != NULL);
+
+	gtk_spin_button_set_value (priv->spinbutton_lambda,
+				   hkl_geometry_wavelength_get(priv->diffractometer->geometry,
+							       HKL_UNIT_USER));
+}
+
+static void
+update_reflections (HklGuiWindow *self)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+
+	gtk_list_store_clear (priv->liststore_reflections);
+
+	if(priv->sample){
+		HklSampleReflection* reflection;
+		guint index = 0;
+
+		HKL_SAMPLE_REFLECTIONS_FOREACH(reflection, priv->sample){
+			GtkTreeIter iter = {0};
+			gdouble h, k, l;
+			gboolean flag;
+
+			hkl_sample_reflection_hkl_get(reflection, &h, &k, &l);
+			flag = hkl_sample_reflection_flag_get(reflection);
+
+			gtk_list_store_append (priv->liststore_reflections, &iter);
+
+			gtk_list_store_set (priv->liststore_reflections,
+					    &iter,
+					    REFLECTION_COL_INDEX, index++,
+					    REFLECTION_COL_H, h,
+					    REFLECTION_COL_K, k,
+					    REFLECTION_COL_L, l,
+					    REFLECTION_COL_FLAG, flag,
+					    REFLECTION_COL_REFLECTION, reflection,
+					    -1);
+		}
+	}
+}
+
+static void
+update_3d(HklGuiWindow *self)
+{
+#ifdef HKL3D
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+
+	if(priv->frame3d){
+		hkl_gui_3d_is_colliding(priv->frame3d);
+		hkl_gui_3d_invalidate(priv->frame3d);
+	}
+#endif
+}
+
+static void
+pseudo_axes_frame_changed_cb (HklGuiEngine *gui_engine, HklGuiWindow *self)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+	HklEngine *engine;
+	GtkListStore *liststore;
+	guint n_values;
+	GtkTreeIter iter = {0};
+	gboolean valid;
+	GError *error = NULL;
+
+	g_object_get(gui_engine,
+		     "engine", &engine,
+		     "liststore", &liststore,
+		     NULL);
+
+	n_values = darray_size(*hkl_engine_pseudo_axis_names_get(engine));
+	gdouble values[n_values];
+
+	/* extract all the values from the listore */
+	valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(liststore), &iter);
+	while(valid){
+		guint it_idx;
+		gdouble it_value;
+
+		gtk_tree_model_get (GTK_TREE_MODEL(liststore), &iter,
+				    PSEUDO_COL_IDX, &it_idx,
+				    PSEUDO_COL_VALUE, &it_value,
+				    -1);
+
+		values[it_idx] = it_value;
+
+		valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(liststore), &iter);
+	}
+
+	if(diffractometer_pseudo_axis_values_set(priv->diffractometer, engine,
+						 values, n_values, &error)){
+		update_axes (self);
+		update_pseudo_axes (self);
+		update_pseudo_axes_frames (self);
+		update_solutions (self);
+		update_3d(self);
+	}else
+		raise_error(self, &error);
+
+	g_object_unref(liststore);
+}
+
+
+static void
+set_up_pseudo_axes_frames (HklGuiWindow* self)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+	HklGuiEngine **pseudo;
+	GtkVBox* vbox2;
+	HklEngine **engine;
+	darray_engine *engines;
+
+	g_return_if_fail (self != NULL);
+
+	darray_foreach (pseudo, priv->pseudo_frames){
+		gtk_container_remove(GTK_CONTAINER(priv->vbox2),
+				     GTK_WIDGET (hkl_gui_engine_get_frame (*pseudo)));
+		g_object_unref(*pseudo);
+	}
+	darray_size (priv->pseudo_frames) = 0;
+
+	engines = hkl_engine_list_engines_get (priv->diffractometer->engines);
+	darray_foreach (engine, *engines){
+		HklGuiEngine *pseudo;
+
+		pseudo = hkl_gui_engine_new (*engine);
+		darray_append(priv->pseudo_frames, pseudo);
+		gtk_container_add (GTK_CONTAINER (priv->vbox2),
+				   GTK_WIDGET (hkl_gui_engine_get_frame(pseudo)));
+
+		g_signal_connect_object (pseudo,
+					 "changed",
+					 G_CALLBACK(pseudo_axes_frame_changed_cb),
+					 self, 0);
+	}
+
+	gtk_widget_show_all (GTK_WIDGET (priv->vbox2));
+}
+
+
+static void
+set_up_diffractometer_model (HklGuiWindow* self)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+	unsigned int i, n;
+	HklFactory **factories;
+
+	g_return_if_fail (self != NULL);
+
+	factories = hkl_factory_get_all(&n);
+	for(i=0; i<n; ++i){
+		GtkTreeIter iter = {0};
+
+		gtk_list_store_append (priv->liststore_diffractometer, &iter);
+		gtk_list_store_set (priv->liststore_diffractometer, &iter,
+				    DIFFRACTOMETER_COL_NAME, hkl_factory_name_get(factories[i]),
+				    DIFFRACTOMETER_COL_FACTORY, factories[i],
+				    DIFFRACTOMETER_COL_DIFFRACTOMETER, NULL,
+				    -1);
+	}
+}
+
+static void
+set_up_tree_view_axes (HklGuiWindow* self)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+	const darray_string *axes;
+	const char **axis;
+	GtkCellRenderer* renderer = NULL;
+	GtkTreeViewColumn* column = NULL;
+	GList* columns;
+	GtkTreeIter iter = {0};
+
+	gtk_list_store_clear (priv->liststore_axis);
+
+	axes = hkl_geometry_axis_names_get(priv->diffractometer->geometry);
+	darray_foreach (axis, *axes){
+		gtk_list_store_append (priv->liststore_axis, &iter);
+		gtk_list_store_set (priv->liststore_axis, &iter,
+				    AXIS_COL_NAME, *axis,
+				    -1);
+	}
+
+	update_axes (self);
+}
+
+static void
+set_up_tree_view_pseudo_axes (HklGuiWindow* self)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+	HklParameter **parameter;
+	HklEngine **engine;
+	const darray_engine *engines;
+
+	gtk_list_store_clear(priv->liststore_pseudo_axes);
+
+	engines = hkl_engine_list_engines_get(priv->diffractometer->engines);
+	darray_foreach(engine, *engines){
+		const darray_string *pseudo_axes = hkl_engine_pseudo_axis_names_get(*engine);
+		GtkTreeIter iter = {0};
+		guint idx;
+
+		for(idx=0; idx<darray_size(*pseudo_axes); ++idx){
+			gtk_list_store_append (priv->liststore_pseudo_axes, &iter);
+			gtk_list_store_set (priv->liststore_pseudo_axes, &iter,
+					    PSEUDO_AXIS_COL_IDX, idx,
+					    PSEUDO_AXIS_COL_ENGINE, *engine,
+					    PSEUDO_AXIS_COL_NAME, darray_item(*pseudo_axes, idx),
+					    -1);
+		}
+	}
+
+	update_pseudo_axes (self);
+}
+
+static void
+_delete_column(gpointer data,
+	       gpointer user_data)
+{
+	gtk_tree_view_remove_column (GTK_TREE_VIEW(user_data),
+				     GTK_TREE_VIEW_COLUMN(data));
+}
+
+static void
+set_up_tree_view_solutions (HklGuiWindow* self)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+	const darray_string *axes;
+	int i;
+	GtkCellRenderer* renderer = NULL;
+	GtkTreeViewColumn* column = NULL;
+	GList* columns;
+	GType* types;
+	gint n_columns;
+
+	axes = hkl_geometry_axis_names_get(priv->diffractometer->geometry);
+
+	n_columns = SOLUTION_COL_N_COLUMNS + darray_size(*axes);
+
+	/* prepare types for the liststore */
+	types = g_new0 (GType, n_columns);
+
+	/* first remove all the columns */
+	columns = gtk_tree_view_get_columns (priv->treeview_solutions);
+	g_list_foreach(columns, _delete_column, priv->treeview_solutions);
+	g_list_free(columns);
+
+	/* now add the index column */
+	renderer = gtk_cell_renderer_text_new ();
+	column = gtk_tree_view_column_new_with_attributes ("index",
+							   renderer, "text",
+							   SOLUTION_COL_INDEX, NULL);
+
+	gtk_tree_view_append_column (priv->treeview_solutions, column);
+
+	types[0] = G_TYPE_INT;
+	types[1] = G_TYPE_POINTER;
+
+	/* add the axes column */
+	for(i=SOLUTION_COL_N_COLUMNS; i<n_columns; ++i){
+		const char *axis;
+
+		axis = darray_item(*axes, i - SOLUTION_COL_N_COLUMNS);
+		renderer = gtk_cell_renderer_text_new ();
+		column = gtk_tree_view_column_new_with_attributes (axis,
+								   renderer, "text",
+								   i, NULL);
+
+		gtk_tree_view_append_column (priv->treeview_solutions, column);
+		types[i] = G_TYPE_DOUBLE;
+	}
+
+	if (priv->liststore_solutions)
+		g_object_unref(priv->liststore_solutions);
+	priv->liststore_solutions = gtk_list_store_newv (n_columns, types);
+	g_free (types);
+
+	gtk_tree_view_set_model (priv->treeview_solutions,
+				 GTK_TREE_MODEL(priv->liststore_solutions));
+
+	update_solutions (self);
+}
+
+void
+set_up_info_bar(HklGuiWindow *self)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+	GtkWidget *content_area;
+
+	g_return_if_fail (self != NULL);
+
+	/* set up info bar until we can use glade for this purpose or
+	 * switch to gtk3 */
+	if (priv->info_bar)
+		return;
+
+	priv->info_bar = GTK_INFO_BAR(gtk_info_bar_new ());
+	gtk_widget_set_no_show_all (GTK_WIDGET(priv->info_bar), TRUE);
+
+	priv->info_message = GTK_LABEL(gtk_label_new (""));
+	gtk_widget_show (GTK_WIDGET(priv->info_message));
+
+	content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (priv->info_bar));
+	gtk_container_add (GTK_CONTAINER (content_area),
+			   GTK_WIDGET(priv->info_message));
+	gtk_info_bar_add_button (priv->info_bar,
+				 GTK_STOCK_OK, GTK_RESPONSE_OK);
+	g_signal_connect (priv->info_bar, "response",
+			  G_CALLBACK (gtk_widget_hide), NULL);
+
+	gtk_box_pack_start(GTK_BOX(priv->box_info_bar),
+			   GTK_WIDGET(priv->info_bar),
+			   TRUE, TRUE, 0);
+}
+
+static void
+set_up_lambda(HklGuiWindow *self)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+
+	g_object_set(G_OBJECT(priv->spinbutton_lambda),
+		     "sensitive", TRUE,
+		     NULL);
+
+	gtk_spin_button_set_value(priv->spinbutton_lambda,
+				  hkl_geometry_wavelength_get(priv->diffractometer->geometry,
+							      HKL_UNIT_USER));
+}
+
+static void
+set_up_3D (HklGuiWindow* self)
+{
+#if HKL3D
+
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+	const char *filename = NULL;
+	const char *name = hkl_factory_name_get(priv->diffractometer->factory);
+
+	if(!strcmp("K6C", name))
+		filename = "../data/diffabs.yaml";
+	else if (!strcmp("K4CV", name))	
+		filename = "../data/cristal4C.yaml";
+
+	if(priv->frame3d){
+		gtk_widget_destroy(GTK_WIDGET(hkl_gui_3d_frame_get(priv->frame3d)));
+		g_object_unref(priv->frame3d);
+		priv->frame3d = NULL;
+	}
+
+	if (filename){
+		priv->frame3d = hkl_gui_3d_new(filename, priv->diffractometer->geometry);
+
+		gtk_box_pack_start (GTK_BOX(priv->vbox7),
+				    GTK_WIDGET(hkl_gui_3d_frame_get(priv->frame3d)),
+				    TRUE, TRUE, (guint) 0);
+
+		gtk_widget_show_all (GTK_WIDGET(priv->vbox7));
+	}
+#endif
+}
+
+/* select diffractometer */
+void
+hkl_gui_window_combobox1_changed_cb(GtkComboBox *combobox, gpointer *user_data)
+{
+	HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+	HklFactory *factory;
+	struct diffractometer_t *dif = NULL;
+
+	GtkTreeIter iter = {0};
+
+	if(gtk_combo_box_get_active_iter (combobox, &iter)){
+		gtk_tree_model_get(GTK_TREE_MODEL(priv->liststore_diffractometer),
+				   &iter,
+				   DIFFRACTOMETER_COL_FACTORY, &factory,
+				   DIFFRACTOMETER_COL_DIFFRACTOMETER, &dif,
+				   -1);
+
+		if (!dif){
+			dif = create_diffractometer(factory);
+			gtk_list_store_set(priv->liststore_diffractometer,
+					   &iter,
+					   DIFFRACTOMETER_COL_DIFFRACTOMETER, dif,
+					   -1);
+		}
+	}
+	if(dif != priv->diffractometer){
+		priv->diffractometer = dif;
+
+		diffractometer_set_sample(dif, priv->sample);
+
+		set_up_lambda(self);
+		set_up_pseudo_axes_frames(self);
+		set_up_tree_view_axes(self);
+		set_up_tree_view_pseudo_axes(self);
+		set_up_tree_view_solutions(self);
+		set_up_info_bar(self);
+		set_up_3D(self);
+	}
+}
+
+
+/* axis read cb */
+void
+hkl_gui_window_cellrendererspin1_edited_cb(GtkCellRendererText *renderer,
+					   gchar *path,
+					   gchar *new_text,
+					   gpointer user_data)
+{
+	HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+	GtkTreeIter iter = {0};
+	gdouble value = 0.0;
+	const char *axis;
+	HklParameter *parameter;
+
+	g_return_if_fail (renderer != NULL);
+	g_return_if_fail (path != NULL);
+	g_return_if_fail (new_text != NULL);
+	g_return_if_fail (user_data != NULL);
+
+	gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv->liststore_axis),
+					     &iter,
+					     path);
+	gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_axis), &iter,
+					   AXIS_COL_NAME, &axis,
+					   -1);
+
+	value = atof(new_text); /* TODO need to check for the right conversion */
+
+	/* set the axis value */
+	parameter = hkl_parameter_new_copy(hkl_geometry_axis_get(priv->diffractometer->geometry,
+								 axis, NULL));
+	hkl_parameter_value_set (parameter, value, HKL_UNIT_USER, NULL);
+	hkl_geometry_axis_set(priv->diffractometer->geometry,
+			      axis, parameter, NULL);
+	hkl_parameter_free(parameter);
+
+	hkl_engine_list_get(priv->diffractometer->engines);
+
+	/* ok so set the model with the new value */
+	gtk_list_store_set (priv->liststore_axis, &iter,
+			    AXIS_COL_READ, value,
+			    AXIS_COL_WRITE, value,
+			    -1);
+
+	update_pseudo_axes (self);
+	update_pseudo_axes_frames (self);
+	update_3d(self);
+}
+
+/* axis min cb */
+void
+hkl_gui_window_cellrendererspin3_edited_cb(GtkCellRendererText *renderer,
+					   gchar *path,
+					   gchar *new_text,
+					   gpointer user_data)
+{
+	HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+	GtkTreeIter iter = {0};
+	gdouble value = 0.0;
+	const char *axis;
+	HklParameter* parameter = NULL;
+	gdouble shit, max;
+
+	g_return_if_fail (renderer != NULL);
+	g_return_if_fail (path != NULL);
+	g_return_if_fail (new_text != NULL);
+	g_return_if_fail (user_data != NULL);
+
+	gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv->liststore_axis),
+					     &iter,
+					     path);
+	gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_axis), &iter,
+					   AXIS_COL_NAME, &axis,
+					   -1);
+
+	value = atof(new_text); /* TODO need to check for the right conversion */
+
+	parameter = hkl_parameter_new_copy(hkl_geometry_axis_get(priv->diffractometer->geometry,
+								 axis, NULL));
+	hkl_parameter_min_max_get (parameter, &shit, &max, HKL_UNIT_USER);
+	hkl_parameter_min_max_set (parameter, value, max, HKL_UNIT_USER, NULL); /* TODO error */
+	hkl_geometry_axis_set(priv->diffractometer->geometry,
+			      axis, parameter, NULL);
+	hkl_parameter_free(parameter);
+
+	gtk_list_store_set (priv->liststore_axis, &iter,
+			    AXIS_COL_MIN, value,
+			    -1);
+
+	update_pseudo_axes (self);
+}
+
+
+/* axis max cb */
+void
+hkl_gui_window_cellrendererspin4_edited_cb(GtkCellRendererText *renderer,
+					   gchar *path,
+					   gchar *new_text,
+					   gpointer user_data)
+{
+	HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+	GtkTreeIter iter = {0};
+	gdouble value = 0.0;
+	const char *axis;
+	HklParameter* parameter = NULL;
+	gdouble shit, min;
+
+	g_return_if_fail (renderer != NULL);
+	g_return_if_fail (path != NULL);
+	g_return_if_fail (new_text != NULL);
+	g_return_if_fail (user_data != NULL);
+
+	gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv->liststore_axis),
+					     &iter,
+					     path);
+	gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_axis), &iter,
+					   AXIS_COL_NAME, &axis,
+					   -1);
+
+	value = atof(new_text); /* TODO need to check for the right conversion */
+
+
+	parameter = hkl_parameter_new_copy(hkl_geometry_axis_get(priv->diffractometer->geometry,
+								 axis, NULL));
+	hkl_parameter_min_max_get (parameter, &min, &shit, HKL_UNIT_USER);
+	hkl_parameter_min_max_set (parameter, min, value, HKL_UNIT_USER, NULL);
+	hkl_geometry_axis_set(priv->diffractometer->geometry,
+			      axis, parameter, NULL);
+	hkl_parameter_free(parameter);
+
+
+	gtk_list_store_set (priv->liststore_axis, &iter,
+			    AXIS_COL_MAX, value,
+			    -1);
+
+	update_pseudo_axes (self);
+}
+
+
+/* pseudo axis write */
+void
+hkl_gui_window_cellrenderertext5_edited_cb(GtkCellRendererText *renderer,
+					   gchar *path,
+					   gchar *new_text,
+					   gpointer user_data)
+{
+	HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+	GtkTreeIter iter = {0};
+	gdouble value = 0.0;
+	gdouble old_value;
+	unsigned int idx;
+	HklEngine *engine = NULL;
+	gboolean valid;
+	GtkTreeIter it = {0};
+	guint n_values;
+	GError *error = NULL;
+
+	gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv->liststore_pseudo_axes),
+					     &iter,
+					     path);
+	gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_pseudo_axes), &iter,
+			    PSEUDO_AXIS_COL_IDX, &idx,
+			    PSEUDO_AXIS_COL_ENGINE, &engine,
+			    PSEUDO_AXIS_COL_WRITE, &old_value,
+			    -1);
+
+	n_values = darray_size(*hkl_engine_pseudo_axis_names_get(engine));
+	gdouble values[n_values];
+
+	/* extract all the values from the listore */
+
+	valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(priv->liststore_pseudo_axes), &it);
+	while(valid){
+		guint it_idx;
+		HklEngine *it_engine;
+		gdouble it_value;
+
+		gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_pseudo_axes), &it,
+				    PSEUDO_AXIS_COL_IDX, &it_idx,
+				    PSEUDO_AXIS_COL_ENGINE, &it_engine,
+				    PSEUDO_AXIS_COL_WRITE, &it_value,
+				    -1);
+
+		if(engine == it_engine)
+			values[it_idx] = it_value;
+
+		valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(priv->liststore_pseudo_axes), &it);
+	}
+
+	/* replace with the new value */
+	value = atof(new_text); /* TODO need to check for the right conversion */
+	values[idx] = value;
+
+	if(diffractometer_pseudo_axis_values_set(priv->diffractometer, engine,
+						 values, n_values, &error)){
+		gtk_list_store_set (priv->liststore_pseudo_axes,
+				    &iter,
+				    PSEUDO_AXIS_COL_WRITE, value,
+				    -1);
+
+		update_axes (self);
+		update_pseudo_axes (self);
+		update_pseudo_axes_frames (self);
+		update_solutions (self);
+		update_3d(self);
+	}else
+		raise_error(self, &error);
+}
+
+
+void
+hkl_gui_window_treeview_solutions_cursor_changed_cb (GtkTreeView *tree_view,
+						     gpointer     user_data)
+{
+	HklGuiWindow* self = HKL_GUI_WINDOW(user_data);
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+
+	GtkTreePath* path = NULL;
+	GtkTreeViewColumn* focus_column = NULL;
+	GtkTreeIter iter = {0};
+	const HklGeometryListItem *solution;
+
+	gtk_tree_view_get_cursor (tree_view, &path, &focus_column);
+	gtk_tree_model_get_iter (GTK_TREE_MODEL(priv->liststore_solutions), &iter, path);
+	gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_solutions), &iter,
+			    SOLUTION_COL_HKL_GEOMETRY_LIST_ITEM, &solution,
+			    -1);
+
+	diffractometer_set_solution(priv->diffractometer, solution);
+
+	update_axes (self);
+	update_pseudo_axes (self);
+	update_pseudo_axes_frames (self);
+	update_3d(self);
+
+	gtk_tree_path_free (path);
+}
+
+/* reflection h k l */
+#define HKL_GUI_WINDOW_CELLRENDERERTEXT_HKL_EDITED_CB(_number, _hkl, _HKL) \
+	void								\
+	hkl_gui_window_cellrenderertext ## _number ## _edited_cb(GtkCellRendererText* _sender, const gchar* path, \
+								 const gchar* new_text, gpointer user_data) \
+	{								\
+		HklGuiWindow *self = HKL_GUI_WINDOW(user_data);		\
+		HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data); \
+									\
+		g_return_if_fail (self != NULL);			\
+		g_return_if_fail (path != NULL);			\
+		g_return_if_fail (new_text != NULL);			\
+									\
+		if (priv->sample){					\
+			gdouble h = 0.0;				\
+			gdouble k = 0.0;				\
+			gdouble l = 0.0;				\
+			HklSampleReflection* reflection = NULL;		\
+			GtkTreeIter iter = {0};				\
+			GError *error = NULL;				\
+									\
+			gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv->liststore_reflections), \
+							     &iter, path); \
+			gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_reflections), \
+					    &iter,			\
+					    REFLECTION_COL_REFLECTION, &reflection, \
+					    -1);			\
+									\
+			hkl_sample_reflection_hkl_get (reflection, &h, &k, &l);	\
+			_hkl = atof(new_text);				\
+			if(!hkl_sample_reflection_hkl_set (reflection, h, k, l, NULL)) \
+				raise_error(self, &error);		\
+			else						\
+				gtk_list_store_set (priv->liststore_reflections, \
+						    &iter,		\
+						    REFLECTION_COL_ ## _HKL, _hkl, \
+						    -1);		\
+		}							\
+	}
+
+HKL_GUI_WINDOW_CELLRENDERERTEXT_HKL_EDITED_CB(7, h, H);
+HKL_GUI_WINDOW_CELLRENDERERTEXT_HKL_EDITED_CB(8, k, K);
+HKL_GUI_WINDOW_CELLRENDERERTEXT_HKL_EDITED_CB(9, l, L);
+
+
+/* reflection flag */
+void
+hkl_gui_window_cellrenderertoggle1_toggled_cb (GtkCellRendererToggle* renderer, const gchar* path,
+					       gpointer self)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+
+	g_return_if_fail (self != NULL);
+	g_return_if_fail (path != NULL);
+
+	if (priv->sample){
+		gboolean flag;
+		HklSampleReflection* reflection = NULL;
+		GtkTreeIter iter = {0};
+
+		gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv->liststore_reflections),
+						     &iter, path);
+		gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_reflections),
+				    &iter,
+				    REFLECTION_COL_REFLECTION, &reflection,
+				    -1);
+
+		flag = gtk_cell_renderer_toggle_get_active(renderer);
+		hkl_sample_reflection_flag_set (reflection, flag);
+		gtk_list_store_set (priv->liststore_reflections,
+				    &iter,
+				    REFLECTION_COL_FLAG, flag,
+				    -1);
+	}
+}
+
+gboolean
+hkl_gui_window_treeview_reflections_key_press_event_cb (GtkWidget* _sender, GdkEventKey* event,
+							gpointer self)
+{
+	return TRUE;
+}
+
+void
+hkl_gui_window_toolbutton_add_reflection_clicked_cb(GtkToolButton* _sender,
+						    gpointer self)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+
+	if (priv->diffractometer == NULL){
+		gtk_statusbar_push (priv->statusbar, 0,
+				    "Please select a diffractometer before adding reflections");
+		return;
+	}
+
+	if (priv->sample) {
+		HklSampleReflection *reflection = NULL;
+		GtkTreeIter iter = {0};
+		gboolean flag;
+		gint n_rows;
+		GError *error = NULL;
+
+		reflection = hkl_sample_reflection_new(priv->diffractometer->geometry,
+						       priv->diffractometer->detector,
+						       0, 0, 0, &error);
+		if(!reflection)
+			raise_error(self, &error);
+		else{
+			hkl_sample_add_reflection(priv->sample, reflection);
+			flag = hkl_sample_reflection_flag_get(reflection);
+
+			n_rows = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(priv->liststore_reflections),
+							NULL);
+			gtk_list_store_insert_with_values (priv->liststore_reflections,
+							   &iter, -1,
+							   REFLECTION_COL_INDEX, n_rows,
+							   REFLECTION_COL_H, 0.,
+							   REFLECTION_COL_K, 0.,
+							   REFLECTION_COL_L, 0.,
+							   REFLECTION_COL_FLAG, flag,
+							   REFLECTION_COL_REFLECTION, reflection,
+							   -1);
+		}
+	}
+}
+
+void
+hkl_gui_window_toolbutton_goto_reflection_clicked_cb (GtkToolButton* _sender, gpointer user_data)
+{
+	HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+
+	g_return_if_fail (self != NULL);
+
+	if (priv->sample) {
+		GtkTreeSelection* selection = NULL;
+		guint nb_rows = 0U;
+
+		selection = gtk_tree_view_get_selection (priv->treeview_reflections);
+		nb_rows = gtk_tree_selection_count_selected_rows (selection);
+
+		if (nb_rows == 1) {
+			HklSampleReflection *reflection;
+			GtkTreeIter iter = {0};
+			GtkTreeModel* model = NULL;
+			GtkTreePath *treepath;
+			GList* list;
+
+			model = GTK_TREE_MODEL(priv->liststore_reflections);
+
+			list = gtk_tree_selection_get_selected_rows (selection,
+								     &model);
+
+			treepath = g_list_nth_data(list, 0);
+
+			gtk_tree_model_get_iter (GTK_TREE_MODEL(priv->liststore_reflections),
+						 &iter, treepath);
+
+			gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_reflections),
+					    &iter,
+					    REFLECTION_COL_REFLECTION, &reflection,
+					    -1);
+
+			hkl_geometry_set (priv->diffractometer->geometry,
+					  hkl_sample_reflection_geometry_get(reflection));
+
+			update_source (self);
+			update_axes (self);
+			update_pseudo_axes (self);
+			update_3d(self);
+
+			g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free);
+		} else
+			if (nb_rows > 1)
+				gtk_statusbar_push (priv->statusbar, 0,
+						    "Please select only one reflection.");
+			else
+				gtk_statusbar_push (priv->statusbar, 0,
+						    "Please select at least one reflection.");
+	}
+}
+
+static void
+_del_reflection(gpointer data, gpointer user_data)
+{
+	HklSampleReflection *reflection;
+	GtkTreeIter iter = {0};
+	GtkTreePath *treepath = data;
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+
+	gtk_tree_model_get_iter (GTK_TREE_MODEL(priv->liststore_reflections),
+				 &iter, treepath);
+
+	gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_reflections),
+			    &iter,
+			    REFLECTION_COL_REFLECTION, &reflection,
+			    -1);
+	hkl_sample_del_reflection(priv->sample, reflection);
+}
+
+void
+hkl_gui_window_toolbutton_del_reflection_clicked_cb (GtkToolButton* _sender, gpointer user_data)
+{
+	HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+	HklSample* sample = NULL;
+
+	g_return_if_fail (self != NULL);
+
+	if (priv->sample) {
+		GtkTreeSelection* selection = NULL;
+		guint nb_rows = 0U;
+
+		selection = gtk_tree_view_get_selection (priv->treeview_reflections);
+		nb_rows = gtk_tree_selection_count_selected_rows (selection);
+		if (nb_rows > 0) {
+			GtkTreeModel* model = NULL;
+			GList* list;
+			guint* indexes;
+			gint i;
+			GtkMessageDialog* dialog;
+
+			model = GTK_TREE_MODEL(priv->liststore_reflections);
+			list = gtk_tree_selection_get_selected_rows (selection, &model);
+
+
+			dialog = GTK_MESSAGE_DIALOG(
+				gtk_message_dialog_new (NULL,
+							GTK_DIALOG_DESTROY_WITH_PARENT,
+							GTK_MESSAGE_WARNING,
+							GTK_BUTTONS_YES_NO,
+							"Are you sure that you want to delete reflections"));
+
+			switch (gtk_dialog_run (GTK_DIALOG(dialog))) {
+			case GTK_RESPONSE_YES:
+			{
+				g_list_foreach(list, _del_reflection, self);
+				update_reflections (self);
+				break;
+			}
+			default:
+				break;
+			}
+			gtk_widget_destroy (GTK_WIDGET(dialog));
+			g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free);
+		} else {
+			gtk_statusbar_push (priv->statusbar, 0,
+					    "Please select at least one reflection.");
+		}
+	}
+}
+
+static void
+set_up_tree_view_reflections(HklGuiWindow *self)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+	GtkTreeSelection* selection = NULL;
+
+	selection = gtk_tree_view_get_selection (priv->treeview_reflections);
+	gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
+}
+
+/* crystal name */
+void
+hkl_gui_window_cellrenderertext10_edited_cb(GtkCellRendererText* _sender, const gchar* path,
+					    const gchar* new_text, gpointer user_data)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+
+	GtkTreeModel* model = NULL;
+	GtkTreeIter iter = {0};
+	HklSample* sample = NULL;
+	gchar* name = NULL;
+
+	g_return_if_fail (user_data != NULL);
+	g_return_if_fail (path != NULL);
+	g_return_if_fail (new_text != NULL);
+
+	model = GTK_TREE_MODEL(priv->liststore_crystals);
+
+	gtk_tree_model_get_iter_from_string (model, &iter, path);
+
+	gtk_tree_model_get (model, &iter,
+			    SAMPLE_COL_SAMPLE, &sample,
+			    -1);
+
+	hkl_sample_name_set (sample, new_text);
+
+	gtk_list_store_set(priv->liststore_crystals, &iter,
+			   SAMPLE_COL_NAME, new_text,
+			   -1);
+}
+
+#define set_lattice(lattice, parameter) do{				\
+		const HklParameter *p;					\
+		gdouble min, max, value;				\
+		gboolean fit;						\
+		p = hkl_lattice_## parameter ##_get((lattice));		\
+		value = hkl_parameter_value_get(p, HKL_UNIT_USER);	\
+		hkl_parameter_min_max_get(p, &min, &max, HKL_UNIT_USER); \
+		fit = hkl_parameter_fit_get(p);				\
+		gtk_spin_button_set_value(priv->spinbutton_## parameter, value); \
+		gtk_spin_button_set_value(priv->spinbutton_## parameter ##_min, min); \
+		gtk_spin_button_set_value(priv->spinbutton_## parameter ##_max, max); \
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(priv->checkbutton_ ## parameter), fit); \
+	}while(0)
+
+static void
+update_lattice (HklGuiWindow* self)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+
+	g_return_if_fail (self != NULL);
+
+	if (priv->sample != NULL) {
+		const HklLattice *lattice;
+		lattice = hkl_sample_lattice_get(priv->sample);
+		set_lattice(lattice, a);
+		set_lattice(lattice, b);
+		set_lattice(lattice, c);
+		set_lattice(lattice, alpha);
+		set_lattice(lattice, beta);
+		set_lattice(lattice, gamma);
+	}
+}
+
+#define set_reciprocal_lattice(lattice, parameter) do{			\
+		const HklParameter *p;					\
+		gdouble value;						\
+		p = hkl_lattice_## parameter ##_get((lattice));		\
+		value = hkl_parameter_value_get(p, HKL_UNIT_USER);	\
+		gtk_spin_button_set_value(priv->spinbutton_## parameter ##_star, value); \
+	}while(0)
+
+static void
+update_reciprocal_lattice (HklGuiWindow* self)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+
+	g_return_if_fail (self != NULL);
+
+	if (priv->sample != NULL) {
+		hkl_lattice_reciprocal (hkl_sample_lattice_get(priv->sample),
+					priv->reciprocal);
+
+		set_reciprocal_lattice(priv->reciprocal, a);
+		set_reciprocal_lattice(priv->reciprocal, b);
+		set_reciprocal_lattice(priv->reciprocal, c);
+		set_reciprocal_lattice(priv->reciprocal, alpha);
+		set_reciprocal_lattice(priv->reciprocal, beta);
+		set_reciprocal_lattice(priv->reciprocal, gamma);
+	}
+}
+
+#define set_ux_uy_uz(sample, parameter) do {				\
+		const HklParameter *p;					\
+		p = hkl_sample_## parameter ##_get((sample));		\
+		gboolean fit = hkl_parameter_fit_get(p);		\
+		gtk_spin_button_set_value(priv->spinbutton_## parameter, \
+					  hkl_parameter_value_get(p, HKL_UNIT_USER)); \
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(priv->checkbutton_## parameter), fit); \
+	}while(0)
+
+static void
+update_ux_uy_uz (HklGuiWindow* self)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+
+	g_return_if_fail (self != NULL);
+
+	if (priv->sample != NULL) {
+		set_ux_uy_uz(priv->sample, ux);
+		set_ux_uy_uz(priv->sample, uy);
+		set_ux_uy_uz(priv->sample, uz);
+	}
+}
+
+#define set_UB(i, j) do{						\
+		gtk_label_set_markup(priv->label_UB ## i ## j,		\
+				     g_ascii_formatd(text,		\
+						     G_ASCII_DTOSTR_BUF_SIZE, \
+						     "<tt> %+.4f </tt>",	\
+						     hkl_matrix_get(UB, i - 1, j - 1))); \
+	}while(0)
+
+static void
+update_UB (HklGuiWindow* self)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+
+	g_return_if_fail (self != NULL);
+
+	if (priv->sample != NULL) {
+		const HklMatrix *UB = hkl_sample_UB_get (priv->sample);
+		gchar *text = g_new0 (gchar, G_ASCII_DTOSTR_BUF_SIZE);
+
+		set_UB(1, 1);
+		set_UB(1, 2);
+		set_UB(1, 3);
+		set_UB(2, 1);
+		set_UB(2, 2);
+		set_UB(2, 3);
+		set_UB(3, 1);
+		set_UB(3, 2);
+		set_UB(3, 3);
+
+		g_free(text);
+	}
+}
+
+void
+hkl_gui_window_treeview_crystals_cursor_changed_cb (GtkTreeView* _sender, gpointer user_data)
+{
+	GtkTreePath* path = NULL;
+	GtkTreeViewColumn* column = NULL;
+	GtkTreeIter iter = {0};
+
+	HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+	HklSample *sample;
+
+	g_return_if_fail (user_data != NULL);
+
+	gtk_tree_view_get_cursor (priv->treeview_crystals, &path, &column);
+	if(path){
+		if (gtk_tree_model_get_iter (GTK_TREE_MODEL(priv->liststore_crystals),
+					     &iter, path) == TRUE){
+			gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_crystals),
+					    &iter,
+					    SAMPLE_COL_SAMPLE, &sample,
+					    -1);
+
+			if(sample && sample != priv->sample){
+				priv->sample = sample;
+
+				update_reflections(self);
+				update_lattice(self);
+				update_reciprocal_lattice (self);
+				update_ux_uy_uz (self);
+				update_UB (self);
+
+				if(priv->diffractometer){
+					diffractometer_set_sample(priv->diffractometer,
+								  priv->sample);
+
+					update_pseudo_axes (self);
+					update_pseudo_axes_frames (self);
+					update_solutions(self);
+				}
+			}
+		}
+		gtk_tree_path_free (path);
+	}
+}
+
+
+
+static GtkTreeIter
+_add_sample(HklGuiWindow *self, HklSample *sample)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+	GtkTreeIter iter = {0};
+	const HklLattice *lattice;
+	gdouble a, b, c, alpha, beta, gamma;
+
+	g_return_val_if_fail (self != NULL, iter);
+
+	lattice = hkl_sample_lattice_get(sample);
+	a = hkl_parameter_value_get(hkl_lattice_a_get(lattice), HKL_UNIT_USER);
+	b = hkl_parameter_value_get(hkl_lattice_b_get(lattice), HKL_UNIT_USER);
+	c = hkl_parameter_value_get(hkl_lattice_c_get(lattice), HKL_UNIT_USER);
+	alpha = hkl_parameter_value_get(hkl_lattice_alpha_get(lattice),
+					HKL_UNIT_USER);
+	beta = hkl_parameter_value_get(hkl_lattice_beta_get(lattice),
+				       HKL_UNIT_USER);
+	gamma = hkl_parameter_value_get(hkl_lattice_gamma_get(lattice),
+					HKL_UNIT_USER);
+
+	gtk_list_store_insert_with_values(priv->liststore_crystals,
+					  &iter, -1,
+					  SAMPLE_COL_SAMPLE, sample,
+					  SAMPLE_COL_NAME, hkl_sample_name_get(sample),
+					  SAMPLE_COL_A, a,
+					  SAMPLE_COL_B, b,
+					  SAMPLE_COL_C, c,
+					  SAMPLE_COL_ALPHA, alpha,
+					  SAMPLE_COL_BETA, beta,
+					  SAMPLE_COL_GAMMA, gamma,
+					  -1);
+	return iter;
+}
+
+static void
+set_up_tree_view_crystals (HklGuiWindow* self)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+	GtkTreeIter iter = {0};
+	GtkTreePath *path = NULL;
+
+	g_return_if_fail (self != NULL);
+
+	iter = _add_sample(self, hkl_sample_new("default"));
+
+	path = gtk_tree_model_get_path(GTK_TREE_MODEL(priv->liststore_crystals),
+				       &iter);
+
+	gtk_tree_view_set_cursor(priv->treeview_crystals, path, NULL, FALSE);
+
+	gtk_tree_path_free(path);
+}
+
+static void
+_add_sample_and_edit_name(HklGuiWindow *self, HklSample *sample)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+	GtkTreeIter iter = {0};
+	GtkTreePath* path = NULL;
+	GtkTreeViewColumn* column = NULL;
+
+	iter = _add_sample(self, sample);
+
+	path = gtk_tree_model_get_path(GTK_TREE_MODEL(priv->liststore_crystals),
+				       &iter);
+	column = gtk_tree_view_get_column (priv->treeview_crystals, 0);
+	gtk_tree_view_set_cursor (priv->treeview_crystals, path, column, TRUE);
+
+	gtk_tree_path_free(path);
+}
+
+void
+hkl_gui_window_toolbutton_add_crystal_clicked_cb (GtkToolButton* _sender, gpointer user_data)
+{
+	HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+	HklSample *sample;
+
+	g_return_if_fail (user_data != NULL);
+
+	sample = hkl_sample_new ("new");
+	if(sample)
+		_add_sample_and_edit_name(self, sample);
+}
+
+void
+hkl_gui_window_toolbutton_copy_crystal_clicked_cb (GtkToolButton* _sender, gpointer user_data)
+{
+	HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+	HklSample *copy = NULL;
+
+	g_return_if_fail (self != NULL);
+
+	if(priv->sample) {
+		copy = hkl_sample_new_copy(priv->sample);
+		if (copy)
+			_add_sample_and_edit_name(self, copy);
+	}else
+		gtk_statusbar_push (priv->statusbar, (guint) 0, "Please select a crystal to copy.");
+}
+
+void
+hkl_gui_window_toolbutton_del_crystal_clicked_cb (GtkToolButton* _sender, gpointer user_data)
+{
+	HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+
+	g_return_if_fail (user_data != NULL);
+
+	if (priv->sample != NULL) {
+		guint n_rows;
+
+		n_rows = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(priv->liststore_crystals),
+							NULL );
+		if (n_rows == 1)
+			return;
+		else {
+			GtkTreeIter iter = {0};
+			GtkTreePath *path = NULL;
+			GtkTreeViewColumn *column = NULL;
+
+			gtk_tree_view_get_cursor(priv->treeview_crystals,
+						 &path, &column);
+			if (path){
+				if (gtk_tree_model_get_iter (GTK_TREE_MODEL(priv->liststore_crystals),
+							     &iter, path) == TRUE) {
+					gtk_tree_path_free(path);
+
+					hkl_sample_free(priv->sample);
+					if (gtk_list_store_remove(priv->liststore_crystals,
+								  &iter) == TRUE){
+						path = gtk_tree_model_get_path(GTK_TREE_MODEL(priv->liststore_crystals),
+									       &iter);
+						gtk_tree_view_set_cursor(priv->treeview_crystals,
+									 path, NULL, FALSE);
+					}
+				}
+			}
+		}
+	}
+}
+
+#define get_lattice_parameter(lattice, parameter, _error) do{		\
+		HklParameter *p = hkl_parameter_new_copy(hkl_lattice_## parameter ##_get(lattice)); \
+		if(!hkl_parameter_min_max_set(p,			\
+					      gtk_spin_button_get_value(priv->spinbutton_## parameter ##_min), \
+					      gtk_spin_button_get_value(priv->spinbutton_## parameter ##_max),	\
+					      HKL_UNIT_USER, _error)){	\
+			raise_error(self, _error);			\
+			hkl_parameter_free(p);				\
+			return;						\
+		}else{							\
+			hkl_parameter_fit_set(p, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->checkbutton_## parameter))); \
+			if(!hkl_lattice_ ## parameter ## _set(lattice, p, _error)){ \
+				raise_error(self, _error);		\
+				hkl_parameter_free(p);			\
+				return;					\
+			}						\
+		}							\
+		hkl_parameter_free(p);					\
+	} while(0)
+
+#define get_ux_uy_uz(sample, parameter, _error) do {			\
+		HklParameter *p;					\
+		p = hkl_parameter_new_copy(hkl_sample_## parameter ##_get(sample)); \
+		if(!hkl_parameter_value_set(p,				\
+					    gtk_spin_button_get_value (priv->spinbutton_## parameter), \
+					    HKL_UNIT_USER, _error)){	\
+			raise_error(self, _error);			\
+			hkl_parameter_free(p);				\
+			return;						\
+		}else{							\
+			hkl_parameter_fit_set(p,			\
+					      gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->checkbutton_## parameter))); \
+			if(!hkl_sample_ ## parameter ## _set(sample, p, _error)){ \
+				raise_error(self, _error);		\
+				hkl_parameter_free(p);			\
+				return;					\
+			}						\
+		}							\
+		hkl_parameter_free(p);					\
+	}while(0)
+
+
+static gboolean
+_update_crystal_model(GtkTreeModel *model,
+		      GtkTreePath *path,
+		      GtkTreeIter *iter,
+		      gpointer data)
+{
+	HklGuiWindow *self = HKL_GUI_WINDOW(data);
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(data);
+	HklSample *sample = NULL;
+
+	gtk_tree_model_get(model, iter,
+			   SAMPLE_COL_SAMPLE, &sample,
+			   -1);
+	if(priv->sample == sample){
+		const HklLattice *lattice;
+		gdouble a, b, c, alpha, beta, gamma;
+
+		lattice = hkl_sample_lattice_get(sample);
+		a = hkl_parameter_value_get(hkl_lattice_a_get(lattice),
+					    HKL_UNIT_USER);
+		b = hkl_parameter_value_get(hkl_lattice_b_get(lattice),
+					    HKL_UNIT_USER);
+		c = hkl_parameter_value_get(hkl_lattice_c_get(lattice),
+					    HKL_UNIT_USER);
+		alpha = hkl_parameter_value_get(hkl_lattice_alpha_get(lattice),
+						HKL_UNIT_USER);
+		beta = hkl_parameter_value_get(hkl_lattice_beta_get(lattice),
+					       HKL_UNIT_USER);
+		gamma = hkl_parameter_value_get(hkl_lattice_gamma_get(lattice),
+						HKL_UNIT_USER);
+
+		gtk_list_store_set(priv->liststore_crystals,
+				   iter,
+				   SAMPLE_COL_NAME, hkl_sample_name_get(sample),
+				   SAMPLE_COL_A, a,
+				   SAMPLE_COL_B, b,
+				   SAMPLE_COL_C, c,
+				   SAMPLE_COL_ALPHA, alpha,
+				   SAMPLE_COL_BETA, beta,
+				   SAMPLE_COL_GAMMA, gamma,
+				   -1);
+		return TRUE;
+	}
+	return FALSE;
+}
+
+static void
+update_crystal_model(HklGuiWindow *self)
+{
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
+
+	gtk_tree_model_foreach(GTK_TREE_MODEL(priv->liststore_crystals),
+			       _update_crystal_model,
+			       self);
+}
+
+/* apply crystal parameters */
+void
+hkl_gui_window_button2_clicked_cb (GtkButton* _sender, gpointer user_data)
+{
+	HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+
+	g_return_if_fail (self != NULL);
+
+	if (priv->sample != NULL) {
+		gdouble a, b, c, alpha, beta, gamma;
+		gdouble ux, uy, uz;
+		HklLattice *lattice;
+		HklParameter *p;
+		GError *error = NULL;
+
+		fprintf(stderr, "%s\n", __func__);
+		/* lattice parameters */
+		a = gtk_spin_button_get_value (priv->spinbutton_a);
+		b = gtk_spin_button_get_value (priv->spinbutton_b);
+		c = gtk_spin_button_get_value (priv->spinbutton_c);
+		alpha = gtk_spin_button_get_value (priv->spinbutton_alpha);
+		beta = gtk_spin_button_get_value (priv->spinbutton_beta);
+		gamma = gtk_spin_button_get_value (priv->spinbutton_gamma);
+
+		lattice = hkl_lattice_new(a, b, c,
+					  alpha * HKL_DEGTORAD,
+					  beta * HKL_DEGTORAD,
+					  gamma * HKL_DEGTORAD, &error);
+		if(!lattice)
+			raise_error(self, &error);
+		else{
+
+			get_lattice_parameter(lattice, a, &error);
+			get_lattice_parameter(lattice, b, &error);
+			get_lattice_parameter(lattice, c, &error);
+			get_lattice_parameter(lattice, alpha, &error);
+			get_lattice_parameter(lattice, beta, &error);
+			get_lattice_parameter(lattice, gamma, &error);
+
+			hkl_sample_lattice_set(priv->sample, lattice);
+
+			hkl_lattice_free(lattice);
+
+			/* UB */
+			get_ux_uy_uz(priv->sample, ux, &error);
+			get_ux_uy_uz(priv->sample, uy, &error);
+			get_ux_uy_uz(priv->sample, uz, &error);
+
+			if(priv->diffractometer)
+				diffractometer_set_sample(priv->diffractometer,
+							  priv->sample);
+
+			update_crystal_model (self);
+			update_reciprocal_lattice (self);
+			update_UB (self);
+			update_pseudo_axes (self);
+			update_pseudo_axes_frames (self);
+		}
+	}
+}
+
+void
+hkl_gui_window_spinbutton_lambda_value_changed_cb (GtkSpinButton* _sender, gpointer user_data)
+{
+	HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+
+	diffractometer_set_wavelength(priv->diffractometer,
+				      gtk_spin_button_get_value(_sender));
+	update_pseudo_axes (self);
+	update_pseudo_axes_frames (self);
+}
+
+void
+hkl_gui_window_spinbutton_ux_value_changed_cb (GtkSpinButton *_senser, gpointer user_data)
+{
+	HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+	GError *error = NULL;
+
+	get_ux_uy_uz(priv->sample, ux, &error);
+
+	if(priv->diffractometer)
+		diffractometer_set_sample(priv->diffractometer,
+					  priv->sample);
+
+	update_UB (self);
+	update_pseudo_axes (self);
+	update_pseudo_axes_frames (self);
+}
+
+void
+hkl_gui_window_spinbutton_uy_value_changed_cb (GtkSpinButton *_senser, gpointer user_data)
+{
+	HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+	GError *error = NULL;
+
+	get_ux_uy_uz(priv->sample, uy, &error);
+
+	if(priv->diffractometer)
+		diffractometer_set_sample(priv->diffractometer,
+					  priv->sample);
+
+	update_UB (self);
+	update_pseudo_axes (self);
+	update_pseudo_axes_frames (self);
+}
+
+void
+hkl_gui_window_spinbutton_uz_value_changed_cb (GtkSpinButton *_senser, gpointer user_data)
+{
+	HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+	GError *error = NULL;
+
+	get_ux_uy_uz(priv->sample, uz, &error);
+
+	if(priv->diffractometer)
+		diffractometer_set_sample(priv->diffractometer,
+					  priv->sample);
+
+	update_UB (self);
+	update_pseudo_axes (self);
+	update_pseudo_axes_frames (self);
+}
+
+void
+hkl_gui_window_toolbutton_setUB_clicked_cb(GtkToolButton* _sender, gpointer user_data)
+{
+	HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+
+	HklMatrix *UB;
+	GError *error = NULL;
+
+	UB = hkl_matrix_new_full(gtk_spin_button_get_value(priv->spinbutton_U11),
+				 gtk_spin_button_get_value(priv->spinbutton_U12),
+				 gtk_spin_button_get_value(priv->spinbutton_U13),
+				 gtk_spin_button_get_value(priv->spinbutton_U21),
+				 gtk_spin_button_get_value(priv->spinbutton_U22),
+				 gtk_spin_button_get_value(priv->spinbutton_U23),
+				 gtk_spin_button_get_value(priv->spinbutton_U31),
+				 gtk_spin_button_get_value(priv->spinbutton_U32),
+				 gtk_spin_button_get_value(priv->spinbutton_U33));
+
+	if(!hkl_sample_UB_set (priv->sample, UB, &error))
+		raise_error(self, &error);
+	else{
+		if(priv->diffractometer){
+			diffractometer_set_sample(priv->diffractometer,
+						  priv->sample);
+
+			update_lattice (self);
+			update_crystal_model (self);
+			update_reciprocal_lattice (self);
+			update_UB (self);
+			update_ux_uy_uz (self);
+			update_pseudo_axes (self);
+			update_pseudo_axes_frames (self);
+		}
+	}
+
+	hkl_matrix_free(UB);
+}
+
+void
+hkl_gui_window_toolbutton_computeUB_clicked_cb (GtkToolButton* _sender, gpointer user_data)
+{
+	HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+	GtkTreeSelection* selection = NULL;
+	guint nb_rows = 0U;
+
+	selection = gtk_tree_view_get_selection (priv->treeview_reflections);
+	nb_rows = gtk_tree_selection_count_selected_rows (selection);
+	if (nb_rows > 1) {
+		GtkTreeModel* model = NULL;
+		GList* list;
+		GtkTreeIter iter = {0};
+		GtkTreePath *path;
+		HklSampleReflection *ref1, *ref2;
+		GError *error = NULL;
+
+		model = GTK_TREE_MODEL(priv->liststore_reflections);
+		list = gtk_tree_selection_get_selected_rows (selection, &model);
+
+		/* get the first reflection */
+		path = g_list_nth_data(list, 0);
+		gtk_tree_model_get_iter (GTK_TREE_MODEL(priv->liststore_reflections),
+					 &iter,
+					 path);
+		gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_reflections), &iter,
+				    REFLECTION_COL_REFLECTION, &ref1,
+				    -1);
+
+		/* get the second one */
+		path = g_list_nth_data(list, 1);
+		gtk_tree_model_get_iter (GTK_TREE_MODEL(priv->liststore_reflections),
+					 &iter,
+					 path);
+		gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_reflections), &iter,
+				    REFLECTION_COL_REFLECTION, &ref2,
+				    -1);
+
+		if(!hkl_sample_compute_UB_busing_levy(priv->sample,
+						      ref1, ref2, &error)){
+			raise_error(self, &error);
+		}else{
+			if(priv->diffractometer)
+				diffractometer_set_sample(priv->diffractometer,
+							  priv->sample);
+
+			update_UB (self);
+			update_ux_uy_uz (self);
+			update_pseudo_axes (self);
+			update_pseudo_axes_frames (self);
+		}
+		g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free);
+	} else {
+		gtk_statusbar_push (priv->statusbar, 0,
+				    "Please select at least two reflection.");
+	}
+}
+
+void
+hkl_gui_window_toolbutton_affiner_clicked_cb (GtkToolButton* _sender, gpointer user_data)
+{
+	HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
+	HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
+	GError *error = NULL;
+
+	if(!hkl_sample_affine (priv->sample, &error)){
+		raise_error(self, &error);
+	}else{
+		if(priv->diffractometer)
+			diffractometer_set_sample(priv->diffractometer,
+						  priv->sample);
+
+		update_lattice (self);
+		update_crystal_model (self);
+		update_reciprocal_lattice (self);
+		update_UB (self);
+		update_ux_uy_uz (self);
+		update_pseudo_axes (self);
+		update_pseudo_axes_frames (self);
+	}
+}
+
+#define TOGGLE_LATTICE_CB(_parameter)					\
+	void hkl_gui_window_checkbutton_ ## _parameter ## _toggled_cb(GtkCheckButton *checkbutton, \
+								      gpointer user_data) \
+	{								\
+		HklGuiWindow *self = HKL_GUI_WINDOW(user_data);		\
+		HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data); \
+		HklLattice *lattice;					\
+		HklParameter *p;					\
+		GError *error = NULL;					\
+		lattice = hkl_lattice_new_copy(hkl_sample_lattice_get(priv->sample)); \
+		p = hkl_parameter_new_copy(hkl_lattice_## _parameter ##_get(lattice)); \
+		hkl_parameter_fit_set(p,				\
+				      gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(checkbutton))); \
+		if(!hkl_lattice_## _parameter ##_set(lattice, p, &error)){ \
+			raise_error(self, &error);			\
+		}else{							\
+			hkl_sample_lattice_set(priv->sample, lattice);	\
+		}							\
+		hkl_parameter_free(p);					\
+		hkl_lattice_free(lattice);				\
+	}
+
+TOGGLE_LATTICE_CB(a);
+TOGGLE_LATTICE_CB(b);
+TOGGLE_LATTICE_CB(c);
+TOGGLE_LATTICE_CB(alpha);
+TOGGLE_LATTICE_CB(beta);
+TOGGLE_LATTICE_CB(gamma);
+
+#define TOGGLE_UX_UY_UZ(_parameter)					\
+	void hkl_gui_window_checkbutton_ ## _parameter ## _toggled_cb(GtkCheckButton *checkbutton, \
+								      gpointer user_data) \
+	{								\
+		HklGuiWindow *self = HKL_GUI_WINDOW(user_data);		\
+		HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data); \
+		HklParameter *p;					\
+		GError *error = NULL;					\
+		p = hkl_parameter_new_copy(hkl_sample_ ## _parameter ## _get(priv->sample)); \
+		hkl_parameter_fit_set(p,				\
+				      gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(checkbutton))); \
+		if(!hkl_sample_ ## _parameter ## _set(priv->sample, p, &error)){ \
+			raise_error(self, &error);			\
+		}							\
+		hkl_parameter_free(p);					\
+	}
+
+TOGGLE_UX_UY_UZ(ux);
+TOGGLE_UX_UY_UZ(uy);
+TOGGLE_UX_UY_UZ(uz);
+
+/*
+
+static gboolean _hkl_gui_window_on_tree_view_crystals_key_press_event_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self) {
+	gboolean result;
+	result = hkl_gui_window_on_tree_view_crystals_key_press_event (event, self);
+
+	return result;
+
+}
+
+static gboolean hkl_gui_window_on_tree_view_crystals_key_press_event (GdkEventKey* event, HklGuiWindow* self) {
+	gboolean result = FALSE;
+
+	g_return_val_if_fail (self != NULL, FALSE);
+
+	g_return_val_if_fail (event != NULL, FALSE);
+
+	result = TRUE;
+
+	return result;
+
+}
+
+*/
+
+static void
+hkl_gui_window_class_init (HklGuiWindowClass *class)
+{
+	GObjectClass *gobject_class = G_OBJECT_CLASS (class);
+
+	g_type_class_add_private (class, sizeof (HklGuiWindowPrivate));
+
+	/* virtual method */
+	gobject_class->finalize = finalize;
+}
+
+
+static void hkl_gui_window_init (HklGuiWindow * self)
+{
+	HklGuiWindowPrivate *priv =  HKL_GUI_WINDOW_GET_PRIVATE(self);
+
+	priv->diffractometer = NULL;
+	priv->sample = NULL;
+
+	darray_init(priv->pseudo_frames);
+
+	priv->reciprocal = hkl_lattice_new_default ();
+
+	hkl_gui_window_get_widgets_and_objects_from_ui (self);
+
+	set_up_diffractometer_model (self);
+
+	set_up_tree_view_crystals (self);
+
+	set_up_tree_view_reflections(self);
+}
+
+int main (int argc, char ** argv)
+{
+	gtk_init (&argc, &argv);
+#ifdef HKL3D
+	gtk_gl_init(&argc, &argv);
+#endif
+	hkl_gui_window_new ();
+
+	gtk_main ();
+
+	return 0;
+}
diff --git a/gui/hkl-gui.cpp b/gui/hkl-gui.cpp
deleted file mode 100644
index eb1c650..0000000
--- a/gui/hkl-gui.cpp
+++ /dev/null
@@ -1,1020 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-
-#include "hkl-gui.h"
-
-HKLWindow::HKLWindow(void)
-{
-	LOG;
-
-	size_t i;
-
-	_geometry = NULL;
-	_engines = NULL;
-
-	_detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(_detector, 1);
-
-	// add a default crystal
-	_sample = hkl_sample_new("test");
-	_samples.insert(std::pair<std::string, HklSample *>(hkl_sample_name_get(_sample),
-							    _sample));
-
-	// create the reciprocal lattice
-	_reciprocal = hkl_lattice_new_default();
-
-#ifdef HKL3D
-	_Scene = NULL;
-#endif
-
-	// Sets the border width of the window.
-	this->set_border_width(10);
-
-	this->get_widgets_and_objects_from_ui();
-
-	_diffractometerModelColumns = NULL;
-	this->set_up_diffractometer_model();
-
-	this->set_up_TreeView_reflections();
-	this->set_up_TreeView_crystals();
-
-	//update the widgets
-	this->updateTreeViewCrystals();
-	this->updateSource();
-	this->updateLattice();
-	this->updateLatticeParameters();
-	this->updateReciprocalLattice();
-	this->updateUxUyUz();
-	this->updateUB();
-
-	this->connect_all_signals();
-
-	this->show_all_children();
-}
-
-HKLWindow::~HKLWindow()
-{
-	LOG;
-
-	hkl_geometry_free(_geometry);
-	hkl_detector_free(_detector);
-	hkl_engine_list_free(_engines);
-	hkl_lattice_free(_reciprocal);
-
-	//clear all the samples of the map
-	std::map<std::string, HklSample *>::iterator it;
-	for (it=_samples.begin(); it!=_samples.end(); ++it)
-		hkl_sample_free(it->second);
-
-	if(_diffractometerModelColumns)
-		delete _diffractometerModelColumns;
-
-	if(_solutionModelColumns)
-		delete _solutionModelColumns;
-}
-
-void HKLWindow::get_widgets_and_objects_from_ui(void)
-{
-	//Get Glade UI:
-	_refGlade = Gtk::Builder::create();
-	try{
-		_refGlade->add_from_file("ghkl.ui");
-	}catch(...){
-		std::string filename = Glib::build_filename(PKGDATA, "ghkl.ui");
-		if(!_refGlade->add_from_file(filename))
-			exit(1);
-	}
-
-	// objects
-	_diffractometerModel = Glib::RefPtr<Gtk::ListStore>::cast_dynamic(
-		_refGlade->get_object("liststore1"));
-
-	// window1
-	_refGlade->get_widget("label_UB11", _label_UB11);
-	_refGlade->get_widget("label_UB12", _label_UB12);
-	_refGlade->get_widget("label_UB13", _label_UB13);
-	_refGlade->get_widget("label_UB21", _label_UB21);
-	_refGlade->get_widget("label_UB22", _label_UB22);
-	_refGlade->get_widget("label_UB23", _label_UB23);
-	_refGlade->get_widget("label_UB31", _label_UB31);
-	_refGlade->get_widget("label_UB32", _label_UB32);
-	_refGlade->get_widget("label_UB33", _label_UB33);
-	_refGlade->get_widget("button2", _button2);
-	_refGlade->get_widget("spinbutton_a_star", _spinbutton_a_star);
-	_refGlade->get_widget("spinbutton_b_star", _spinbutton_b_star);
-	_refGlade->get_widget("spinbutton_c_star", _spinbutton_c_star);
-	_refGlade->get_widget("spinbutton_alpha_star", _spinbutton_alpha_star);
-	_refGlade->get_widget("spinbutton_beta_star", _spinbutton_beta_star);
-	_refGlade->get_widget("spinbutton_gamma_star", _spinbutton_gamma_star);
-	_refGlade->get_widget("spinbutton_a", _spinbutton_a);
-	_refGlade->get_widget("spinbutton_b", _spinbutton_b);
-	_refGlade->get_widget("spinbutton_c", _spinbutton_c);
-	_refGlade->get_widget("spinbutton_alpha", _spinbutton_alpha);
-	_refGlade->get_widget("spinbutton_beta", _spinbutton_beta);
-	_refGlade->get_widget("spinbutton_gamma", _spinbutton_gamma);
-	_refGlade->get_widget("spinbutton_a_min", _spinbutton_a_min);
-	_refGlade->get_widget("spinbutton_b_min", _spinbutton_b_min);
-	_refGlade->get_widget("spinbutton_c_min", _spinbutton_c_min);
-	_refGlade->get_widget("spinbutton_alpha_min", _spinbutton_alpha_min);
-	_refGlade->get_widget("spinbutton_beta_min", _spinbutton_beta_min);
-	_refGlade->get_widget("spinbutton_gamma_min", _spinbutton_gamma_min);
-	_refGlade->get_widget("spinbutton_a_max", _spinbutton_a_max);
-	_refGlade->get_widget("spinbutton_b_max", _spinbutton_b_max);
-	_refGlade->get_widget("spinbutton_c_max", _spinbutton_c_max);
-	_refGlade->get_widget("spinbutton_alpha_max", _spinbutton_alpha_max);
-	_refGlade->get_widget("spinbutton_beta_max", _spinbutton_beta_max);
-	_refGlade->get_widget("spinbutton_gamma_max", _spinbutton_gamma_max);
-	_refGlade->get_widget("spinbutton_lambda", _spinbutton_lambda);
-	_refGlade->get_widget("spinbutton_ux", _spinbutton_ux);
-	_refGlade->get_widget("spinbutton_uy", _spinbutton_uy);
-	_refGlade->get_widget("spinbutton_uz", _spinbutton_uz);
-	_refGlade->get_widget("spinbutton_U11", _spinbutton_U11);
-	_refGlade->get_widget("spinbutton_U12", _spinbutton_U12);
-	_refGlade->get_widget("spinbutton_U13", _spinbutton_U13);
-	_refGlade->get_widget("spinbutton_U21", _spinbutton_U21);
-	_refGlade->get_widget("spinbutton_U22", _spinbutton_U22);
-	_refGlade->get_widget("spinbutton_U23", _spinbutton_U23);
-	_refGlade->get_widget("spinbutton_U31", _spinbutton_U31);
-	_refGlade->get_widget("spinbutton_U32", _spinbutton_U32);
-	_refGlade->get_widget("spinbutton_U33", _spinbutton_U33);
-	_refGlade->get_widget("checkbutton_a", _checkbutton_a);
-	_refGlade->get_widget("checkbutton_b", _checkbutton_b);
-	_refGlade->get_widget("checkbutton_c", _checkbutton_c);
-	_refGlade->get_widget("checkbutton_alpha", _checkbutton_alpha);
-	_refGlade->get_widget("checkbutton_beta", _checkbutton_beta);
-	_refGlade->get_widget("checkbutton_gamma", _checkbutton_gamma);
-	_refGlade->get_widget("checkbutton_ux", _checkbutton_ux);
-	_refGlade->get_widget("checkbutton_uy", _checkbutton_uy);
-	_refGlade->get_widget("checkbutton_uz", _checkbutton_uz);
-	_refGlade->get_widget("treeview_reflections", _treeViewReflections);
-	_refGlade->get_widget("treeview_crystals", _treeViewCrystals);
-	_refGlade->get_widget("treeview_axes", _TreeView_axes);
-	_refGlade->get_widget("treeview_pseudoAxes", _TreeView_pseudoAxes);
-	_refGlade->get_widget("treeview_pseudoAxes_parameters", _TreeView_pseudoAxes_parameters);
-	_refGlade->get_widget("treeview1", _treeview1);
-	_refGlade->get_widget("toolbutton_add_reflection", _toolbutton_add_reflection);
-	_refGlade->get_widget("toolbutton_goto_reflection", _toolbutton_goto_reflection);
-	_refGlade->get_widget("toolbutton_del_reflection", _toolbutton_del_reflection);
-	_refGlade->get_widget("toolbutton_setUB", _toolbutton_setUB);
-	_refGlade->get_widget("toolbutton_computeUB", _toolbutton_computeUB);
-	_refGlade->get_widget("toolbutton_add_crystal", _toolbutton_add_crystal);
-	_refGlade->get_widget("toolbutton_copy_crystal", _toolbutton_copy_crystal);
-	_refGlade->get_widget("toolbutton_del_crystal", _toolbutton_del_crystal);
-	_refGlade->get_widget("toolbutton_affiner", _toolbutton_affiner);
-	_refGlade->get_widget("statusbar", _statusBar);
-	_refGlade->get_widget("menuitem5", _menuitem5);
-	_refGlade->get_widget("vbox7", _vbox7);
-	_refGlade->get_widget("imagemenuitem5", _imagemenuitem5);
-
-	// dialog1
-	_refGlade->get_widget("dialog1", _dialog1);
-	_refGlade->get_widget("button1", _button1);
-	_refGlade->get_widget("combobox1", _combobox1);
-}
-
-void HKLWindow::connect_all_signals(void)
-{
-	LOG;
-
-	_spinbutton_a->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_a_value_changed));
-	_spinbutton_b->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_b_value_changed));
-	_spinbutton_c->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_c_value_changed));
-	_spinbutton_alpha->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_alpha_value_changed));
-	_spinbutton_beta->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_beta_value_changed));
-	_spinbutton_gamma->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_gamma_value_changed));
-	_spinbutton_a_min->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_a_min_value_changed));
-	_spinbutton_b_min->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_b_min_value_changed));
-	_spinbutton_c_min->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_c_min_value_changed));
-	_spinbutton_alpha_min->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_alpha_min_value_changed));
-	_spinbutton_beta_min->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_beta_min_value_changed));
-	_spinbutton_gamma_min->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_gamma_min_value_changed));
-	_spinbutton_a_max->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_a_max_value_changed));
-	_spinbutton_b_max->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_b_max_value_changed));
-	_spinbutton_c_max->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_c_max_value_changed));
-	_spinbutton_alpha_max->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_alpha_max_value_changed));
-	_spinbutton_beta_max->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_beta_max_value_changed));
-	_spinbutton_gamma_max->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_gamma_max_value_changed));
-	_spinbutton_lambda->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_lambda_value_changed));
-	_spinbutton_ux->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_uxuyuz_value_changed));
-	_spinbutton_uy->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_uxuyuz_value_changed));
-	_spinbutton_uz->signal_value_changed().connect(
-		mem_fun(*this, &HKLWindow::on_spinbutton_uxuyuz_value_changed));
-
-	_button2->signal_clicked().connect(
-		mem_fun(*this, &HKLWindow::on_button2_clicked));
-
-	_checkbutton_a->signal_toggled().connect(
-		mem_fun(*this, &HKLWindow::on_checkbutton_a_toggled));
-	_checkbutton_b->signal_toggled().connect(
-		mem_fun(*this, &HKLWindow::on_checkbutton_b_toggled));
-	_checkbutton_c->signal_toggled().connect(
-		mem_fun(*this, &HKLWindow::on_checkbutton_c_toggled));
-	_checkbutton_alpha->signal_toggled().connect(
-		mem_fun(*this, &HKLWindow::on_checkbutton_alpha_toggled));
-	_checkbutton_beta->signal_toggled().connect(
-		mem_fun(*this, &HKLWindow::on_checkbutton_beta_toggled));
-	_checkbutton_gamma->signal_toggled().connect(
-		mem_fun(*this, &HKLWindow::on_checkbutton_gamma_toggled));
-	_checkbutton_ux->signal_toggled().connect(
-		mem_fun(*this, &HKLWindow::on_checkbutton_ux_toggled));
-	_checkbutton_uy->signal_toggled().connect(
-		mem_fun(*this, &HKLWindow::on_checkbutton_uy_toggled));
-	_checkbutton_uz->signal_toggled().connect(
-		mem_fun(*this, &HKLWindow::on_checkbutton_uz_toggled));
-
-	_treeViewReflections->signal_key_press_event().connect(
-		mem_fun(*this, &HKLWindow::on_treeViewReflections_key_press_event));
-	_TreeView_pseudoAxes->signal_cursor_changed().connect(
-		mem_fun(*this, &HKLWindow::on_treeView_pseudoAxes_cursor_changed));
-	_treeViewCrystals->signal_cursor_changed().connect(
-		mem_fun(*this, &HKLWindow::on_treeViewCrystals_cursor_changed));
-	_treeViewCrystals->signal_key_press_event().connect(
-		mem_fun(*this, &HKLWindow::on_treeViewCrystals_key_press_event));
-
-	_toolbutton_add_reflection->signal_clicked().connect(
-		mem_fun(*this, &HKLWindow::on_toolbutton_add_reflection_clicked));
-	_toolbutton_goto_reflection->signal_clicked().connect(
-		mem_fun(*this, &HKLWindow::on_toolbutton_goto_reflection_clicked));
-	_toolbutton_del_reflection->signal_clicked().connect(
-		mem_fun(*this, &HKLWindow::on_toolbutton_del_reflection_clicked));
-	_toolbutton_setUB->signal_clicked().connect(
-		mem_fun(*this, &HKLWindow::on_toolbutton_setUB_clicked));
-	_toolbutton_computeUB->signal_clicked().connect(
-		mem_fun(*this, &HKLWindow::on_toolbutton_computeUB_clicked));
-	_toolbutton_add_crystal->signal_clicked().connect(
-		mem_fun(*this, &HKLWindow::on_toolbutton_add_crystal_clicked));
-	_toolbutton_copy_crystal->signal_clicked().connect(
-		mem_fun(*this, &HKLWindow::on_toolbutton_copy_crystal_clicked));
-	_toolbutton_del_crystal->signal_clicked().connect(
-		mem_fun(*this, &HKLWindow::on_toolbutton_del_crystal_clicked));
-	_toolbutton_affiner->signal_clicked().connect(
-		mem_fun(*this, &HKLWindow::on_toolbutton_affiner_clicked));
-
-	_menuitem5->signal_activate().connect(
-		mem_fun(*this, &HKLWindow::on_menuitem5_activate));
-
-	_imagemenuitem5->signal_activate().connect(&gtk_main_quit);
-
-	// dialog1
-	_button1->signal_clicked().connect(
-		mem_fun(*this, &HKLWindow::on_button1_clicked));
-	_combobox1->signal_changed().connect(
-		mem_fun(*this, &HKLWindow::on_combobox1_changed));
-}
-
-void HKLWindow::set_up_pseudo_axes_frames(void)
-{
-	LOG;
-
-	size_t i;
-	HklEngine **engine;
-	Gtk::VBox *vbox2 = NULL;
-	PseudoAxesFrame *pseudo;
-	darray_engine *engines = hkl_engine_list_engines(this->_engines);
-
-	_refGlade->get_widget("vbox2", vbox2);
-
-	// first clear the previous frames
-	for(i=0; i<_pseudoAxesFrames.size(); ++i){
-		vbox2->remove(_pseudoAxesFrames[i]->frame());
-		delete _pseudoAxesFrames[i];
-	}
-	_pseudoAxesFrames.clear();
-
-	darray_foreach(engine, *engines){
-		pseudo = new PseudoAxesFrame (*engine);
-		_pseudoAxesFrames.push_back (pseudo);
-		vbox2->add (pseudo->frame());
-		pseudo->signal_changed ().connect (
-			sigc::mem_fun (*this, &HKLWindow::on_pseudoAxesFrame_changed) );
-	}
-	vbox2->show_all();
-}
-
-void HKLWindow::set_up_diffractometer_model(void)
-{
-	unsigned int i;
-	unsigned int n;
-	HklFactory **factories;
-
-	if(_diffractometerModelColumns)
-		delete _diffractometerModelColumns;
-	_diffractometerModelColumns = new DiffractometerModelColumns();
-
-	factories = hkl_factory_get_all(&n);
-	for (i=0; i<n; ++i){
-		Gtk::ListStore::Row row;
-
-		row = *(_diffractometerModel->append());
-		row[_diffractometerModelColumns->name] = hkl_factory_name(factories[i]);
-	}
-}
-
-void HKLWindow::set_up_TreeView_axes(void)
-{
-	LOG;
-
-	size_t i;
-	int index;
-	Gtk::CellRenderer * renderer;
-
-	//Create the Model
-	_axeModel = Gtk::ListStore::create(_axeModelColumns);
-
-	// add the columns
-	_TreeView_axes->remove_all_columns();
-
-	index = _TreeView_axes->append_column("name", _axeModelColumns.name);
-
-	index = _TreeView_axes->append_column_numeric_editable("read",
-							       _axeModelColumns.read, "%lf");
-	renderer = _TreeView_axes->get_column_cell_renderer(index-1);
-	dynamic_cast<Gtk::CellRendererText *>(renderer)->signal_edited().connect(
-		sigc::mem_fun(*this, &HKLWindow::on_cell_TreeView_axes_read_edited));
-
-	index = _TreeView_axes->append_column_numeric_editable("write",
-							       _axeModelColumns.write, "%lf");
-	renderer = _TreeView_axes->get_column_cell_renderer(index-1);
-	dynamic_cast<Gtk::CellRendererText *>(renderer)->signal_edited().connect(
-		sigc::mem_fun(*this, &HKLWindow::on_cell_TreeView_axes_write_edited));
-
-	index = _TreeView_axes->append_column_numeric_editable("min",
-							       _axeModelColumns.min, "%lf");
-	renderer = _TreeView_axes->get_column_cell_renderer(index-1);
-	dynamic_cast<Gtk::CellRendererText *>(renderer)->signal_edited().connect(
-		sigc::mem_fun(*this, &HKLWindow::on_cell_TreeView_axes_min_edited));
-
-	index = _TreeView_axes->append_column_numeric_editable("max",
-							       _axeModelColumns.max, "%lf");
-	renderer = _TreeView_axes->get_column_cell_renderer(index-1);
-	dynamic_cast<Gtk::CellRendererText *>(renderer)->signal_edited().connect(
-		sigc::mem_fun(*this, &HKLWindow::on_cell_TreeView_axes_max_edited));
-
-	//Fill the models from the diffractometerAxes
-	const darray_parameter *axes;
-	HklParameter **axis;
-
-	axes = hkl_geometry_axes_get(this->_geometry);
-	darray_foreach(axis, *axes){
-		Gtk::ListStore::Row row = *(_axeModel->append());
-		row[_axeModelColumns.axis] = *axis;
-		row[_axeModelColumns.name] = hkl_parameter_name_get(*axis);
-	}
-
-	//Set the model for the TreeView
-	_TreeView_axes->set_model(_axeModel);
-	this->updateAxes();
-}
-
-void HKLWindow::set_up_TreeView_pseudoAxes(void)
-{
-	LOG;
-
-	int index;
-	Gtk::CellRenderer * renderer;
-	HklEngine **engine;
-	HklParameter **pseudo_axis;
-	darray_engine *engines = hkl_engine_list_engines(this->_engines);
-
-	/* add the columns */
-	_TreeView_pseudoAxes->remove_all_columns();
-
-	_TreeView_pseudoAxes->append_column("name", _pseudoAxeModelColumns.name);
-
-	_TreeView_pseudoAxes->append_column_numeric("read", _pseudoAxeModelColumns.read, "%lf");
-
-	index = _TreeView_pseudoAxes->append_column_numeric_editable("write", _pseudoAxeModelColumns.write, "%lf");
-	renderer = _TreeView_pseudoAxes->get_column_cell_renderer(index-1);
-	dynamic_cast<Gtk::CellRendererText *>(renderer)->signal_edited().connect(
-		sigc::mem_fun(*this,
-			      &HKLWindow::on_cell_TreeView_pseudoAxes_write_edited));
-
-	_TreeView_pseudoAxes->append_column_numeric("min", _pseudoAxeModelColumns.min, "%lf");
-
-	_TreeView_pseudoAxes->append_column_numeric("max", _pseudoAxeModelColumns.max, "%lf");
-
-	//Create the Model
-	_pseudoAxeModel = Gtk::ListStore::create(_pseudoAxeModelColumns);
-
-	//Fill the models from the diffractometer pseudoAxes
-	darray_foreach(engine, *engines){
-		darray_parameter *pseudo_axes = (darray_parameter *)hkl_engine_pseudo_axes(*engine);
-		HklMode *mode = hkl_engine_mode(*engine);
-		darray_parameter *parameters = hkl_mode_parameters(mode);
-
-		darray_foreach(pseudo_axis, *pseudo_axes){
-			Gtk::ListStore::Row row = *(_pseudoAxeModel->append());
-			row[_pseudoAxeModelColumns.engine] = *engine;
-			row[_pseudoAxeModelColumns.parameter] = *pseudo_axis;
-			row[_pseudoAxeModelColumns.name] = hkl_parameter_name_get(*pseudo_axis);
-
-			if(darray_size(*parameters)){
-				Glib::RefPtr<Gtk::ListStore> model = Gtk::ListStore::create(_parameterModelColumns);
-				HklParameter **parameter;
-
-				darray_foreach(parameter, *parameters){
-					Glib::RefPtr<Gtk::ListStore> model = Gtk::ListStore::create(_parameterModelColumns);
-					row = *(model->append());
-					row[_parameterModelColumns.parameter] = *parameter;
-					row[_parameterModelColumns.name] = hkl_parameter_name_get(*parameter);
-					row[_parameterModelColumns.value] = hkl_parameter_value_unit_get(*parameter);
-				}
-				_mapPseudoAxeParameterModel.insert(std::pair<HklParameter *, Glib::RefPtr<Gtk::ListStore> >(*pseudo_axis, model));
-			}
-		}
-	}
-
-	//Set the model for the TreeView
-	_TreeView_pseudoAxes->set_model(_pseudoAxeModel);
-	this->updatePseudoAxes();
-}
-
-void HKLWindow::set_up_TreeView_pseudoAxes_parameters(void)
-{
-	LOG;
-
-	int index;
-	Gtk::CellRenderer * renderer;
-
-	// add the columns
-	_TreeView_pseudoAxes_parameters->remove_all_columns();
-
-	_TreeView_pseudoAxes_parameters->append_column(
-		"name", _parameterModelColumns.name);
-
-	index = _TreeView_pseudoAxes_parameters->append_column_numeric_editable(
-		"value", _parameterModelColumns.value, "%lf");
-	renderer = _TreeView_pseudoAxes_parameters->get_column_cell_renderer(index-1);
-
-	// connect the signal_edited
-	dynamic_cast<Gtk::CellRendererText *>(renderer)->signal_edited().connect(
-		sigc::mem_fun(*this,
-			      &HKLWindow::on_cell_TreeView_pseudoAxes_parameters_value_edited));
-}
-
-void HKLWindow::set_up_TreeView_treeview1(void)
-{
-	LOG;
-
-	int i=0;
-	const darray_parameter *axes;
-	HklParameter **axis;
-
-	//Create the Columns
-	if(_solutionModelColumns)
-		delete _solutionModelColumns;
-	_solutionModelColumns = new SolutionModelColumns(_geometry);
-
-	/* add the columns */
-	_treeview1->remove_all_columns();
-	axes = hkl_geometry_axes_get(this->_geometry);
-	darray_foreach(axis, *axes)
-		_treeview1->append_column_numeric(hkl_parameter_name_get(*axis),
-						  _solutionModelColumns->axes[i++],
-						  "%lf");
-
-	//Create the model from the columns
-	_solutionModel = Gtk::ListStore::create(*_solutionModelColumns);
-
-	_treeview1->set_model(_solutionModel);
-
-	_treeview1->signal_cursor_changed().connect(mem_fun(*this, &HKLWindow::on_treeview1_cursor_changed));
-
-	this->updateSolutions();
-}
-
-void HKLWindow::set_up_TreeView_reflections(void)
-{
-	LOG;
-
-	int index;
-	Gtk::CellRenderer *renderer;
-
-	//Set up the treeViewReflections
-	_treeViewReflections->remove_all_columns();
-
-	_treeViewReflections->append_column("index", _reflectionModelColumns.index);
-
-	index = _treeViewReflections->append_column_numeric_editable("h", _reflectionModelColumns.h, "%lf");
-	renderer = _treeViewReflections->get_column_cell_renderer(index-1);
-	dynamic_cast<Gtk::CellRendererText *>(renderer)->signal_edited().connect(
-		sigc::mem_fun(*this, &HKLWindow::on_cell_TreeView_reflections_h_edited));
-
-	index = _treeViewReflections->append_column_numeric_editable("k", _reflectionModelColumns.k, "%lf");
-	renderer = _treeViewReflections->get_column_cell_renderer(index-1);
-	dynamic_cast<Gtk::CellRendererText *>(renderer)->signal_edited().connect(
-		sigc::mem_fun(*this, &HKLWindow::on_cell_TreeView_reflections_k_edited));
-
-	index = _treeViewReflections->append_column_numeric_editable("l", _reflectionModelColumns.l, "%lf");
-	renderer = _treeViewReflections->get_column_cell_renderer(index-1);
-	dynamic_cast<Gtk::CellRendererText *>(renderer)->signal_edited().connect(
-		sigc::mem_fun(*this, &HKLWindow::on_cell_TreeView_reflections_l_edited));
-
-	index = _treeViewReflections->append_column_editable("flag", _reflectionModelColumns.flag);
-	renderer = _treeViewReflections->get_column_cell_renderer(index-1);
-	dynamic_cast<Gtk::CellRendererToggle *>(renderer)->signal_toggled().connect(
-		sigc::mem_fun(*this, &HKLWindow::on_cell_TreeView_reflections_flag_toggled));
-
-	_treeViewReflections->get_selection()->set_mode(Gtk::SELECTION_MULTIPLE);
-}
-
-void HKLWindow::set_up_TreeView_crystals(void)
-{
-	LOG;
-
-	int index;
-	Gtk::CellRenderer *renderer;
-
-	//Set up the treeViewCrystals
-	_treeViewCrystals->remove_all_columns();
-
-	index = _treeViewCrystals->append_column_editable("name", _crystalModelColumns.name);
-	renderer = _treeViewCrystals->get_column_cell_renderer(index-1);
-	dynamic_cast<Gtk::CellRendererText *>(renderer)->signal_edited().connect(
-		sigc::mem_fun(*this, &HKLWindow::on_cell_TreeView_crystals_name_edited));
-
-	_treeViewCrystals->append_column_numeric("a", _crystalModelColumns.a, "%lf");
-	_treeViewCrystals->append_column_numeric("b", _crystalModelColumns.b, "%lf");
-	_treeViewCrystals->append_column_numeric("c", _crystalModelColumns.c, "%lf");
-	_treeViewCrystals->append_column_numeric("alpha", _crystalModelColumns.alpha, "%lf");
-	_treeViewCrystals->append_column_numeric("beta", _crystalModelColumns.beta, "%lf");
-	_treeViewCrystals->append_column_numeric("gamma", _crystalModelColumns.gamma, "%lf");
-
-	_treeViewCrystals->get_selection()->set_mode(Gtk::SELECTION_MULTIPLE);
-}
-
-#ifdef HKL3D
-
-void HKLWindow::set_up_3D(void)
-{
-	LOG;
-	const char *model;
-
-	if(_Scene)
-		delete _Scene;
-
-	// for now the connection with the model is done in the part of the code
-	// It should be store in the config part of the geometry ?
-	const char *name = hkl_geometry_name_get(this->_geometry);
-	if (!strcmp("K6C", name))
-		model = "../data/diffabs.yaml";
-	else if(!strcmp("K4CV", name))
-		model = "../data/cristal4C.yaml";
-
-	if(model){
-		_Scene = new Hkl3DFrame(model, _geometry);
-		this->_vbox7->pack_start(_Scene->frame());
-		this->_vbox7->show_all();
-	}else
-		_Scene = NULL;
-}
-
-#endif
-
-void HKLWindow::updateSource(void)
-{
-	LOG;
-
-	if(_geometry){
-		double wavelength = hkl_geometry_wavelength_get(this->_geometry);
-		_spinbutton_lambda->set_value(wavelength);
-	}
-}
-
-void HKLWindow::updateAxes(void)
-{
-	LOG;
-
-	// update the model
-	Gtk::TreeModel::Children rows = _axeModel->children();
-	Gtk::TreeModel::Children::iterator iter = rows.begin();
-	Gtk::TreeModel::Children::iterator end = rows.end();
-	while(iter != end){
-		double min;
-		double max;
-		HklParameter * axis;
-
-		Gtk::TreeRow row = *iter;
-		axis = row[_axeModelColumns.axis];
-		row[_axeModelColumns.read] = hkl_parameter_value_unit_get(axis);
-		row[_axeModelColumns.write] = hkl_parameter_value_unit_get(axis);
-		hkl_parameter_min_max_unit_get(axis, &min, &max);
-		row[_axeModelColumns.min] = min;
-		row[_axeModelColumns.max] = max;
-		++iter;
-	}
-}
-
-void HKLWindow::updatePseudoAxes(void)
-{
-	LOG;
-
-	// first compute all the pseudoAxes values
-	hkl_engine_list_get(_engines);
-
-	// update the model
-	Gtk::TreeModel::Children rows = _pseudoAxeModel->children();
-	Gtk::TreeModel::Children::iterator iter = rows.begin();
-	Gtk::TreeModel::Children::iterator end = rows.end();
-	while(iter != end){
-		double min;
-		double max;
-		HklParameter *parameter;
-
-		Gtk::TreeRow row = *iter;
-		parameter = row[_pseudoAxeModelColumns.parameter];
-		row[_pseudoAxeModelColumns.read] = hkl_parameter_value_unit_get(parameter);
-		row[_pseudoAxeModelColumns.write] = hkl_parameter_value_unit_get(parameter);
-		hkl_parameter_min_max_unit_get(parameter, &min, &max);
-		row[_pseudoAxeModelColumns.min] = min;
-		row[_pseudoAxeModelColumns.max] = max;
-
-		++iter;
-	}
-}
-
-void HKLWindow::update_pseudoAxes_parameters(void)
-{
-	LOG;
-
-	std::map<HklParameter *, Glib::RefPtr<Gtk::ListStore> >::iterator iter = _mapPseudoAxeParameterModel.begin();
-	std::map<HklParameter *, Glib::RefPtr<Gtk::ListStore> >::iterator end = _mapPseudoAxeParameterModel.end();
-	while(iter != end){
-		Gtk::TreeModel::Children rows = iter->second->children();
-		Gtk::TreeModel::Children::iterator iter_row = rows.begin();
-		Gtk::TreeModel::Children::iterator end_row = rows.end();
-		while(iter_row != end_row){
-			Gtk::TreeRow row = *iter_row;
-			HklParameter *parameter = row[_parameterModelColumns.parameter];
-			row[_parameterModelColumns.name] = hkl_parameter_name_get(parameter);
-			row[_parameterModelColumns.value] = hkl_parameter_value_unit_get(parameter);
-			++iter_row;
-		}
-		++iter;
-	}
-}
-
-void HKLWindow::updateLattice(void)
-{
-	LOG;
-
-	if(_sample){
-		const HklLattice *lattice = hkl_sample_lattice_get(_sample);
-		double a = hkl_parameter_value_unit_get(hkl_lattice_a_get(lattice));
-		double b = hkl_parameter_value_unit_get(hkl_lattice_b_get(lattice));
-		double c = hkl_parameter_value_unit_get(hkl_lattice_c_get(lattice));
-		double alpha = hkl_parameter_value_unit_get(hkl_lattice_alpha_get(lattice));
-		double beta = hkl_parameter_value_unit_get(hkl_lattice_beta_get(lattice));
-		double gamma = hkl_parameter_value_unit_get(hkl_lattice_gamma_get(lattice));
-
-		_spinbutton_a->set_value(a);
-		_spinbutton_b->set_value(b);
-		_spinbutton_c->set_value(c);
-		_spinbutton_alpha->set_value(alpha);
-		_spinbutton_beta->set_value(beta);
-		_spinbutton_gamma->set_value(gamma);
-	}
-}
-
-void HKLWindow::updateLatticeParameters(void)
-{
-	LOG;
-
-	if(_sample){
-		double min;
-		double max;
-		bool to_fit;
-		const HklLattice *lattice = hkl_sample_lattice_get(_sample);
-		const HklParameter *parameter;
-
-		parameter = hkl_lattice_a_get(lattice);
-		hkl_parameter_min_max_unit_get(parameter, &min, &max);
-		to_fit = hkl_parameter_fit_get(parameter);
-		_spinbutton_a_min->set_value(min);
-		_spinbutton_a_max->set_value(max);
-		_checkbutton_a->set_active(to_fit);
-
-		parameter = hkl_lattice_b_get(lattice);
-		hkl_parameter_min_max_unit_get(parameter, &min, &max);
-		to_fit = hkl_parameter_fit_get(parameter);
-		_spinbutton_b_min->set_value(min);
-		_spinbutton_b_max->set_value(max);
-		_checkbutton_b->set_active(to_fit);
-
-		parameter = hkl_lattice_c_get(lattice);
-		hkl_parameter_min_max_unit_get(parameter, &min, &max);
-		to_fit = hkl_parameter_fit_get(parameter);
-		_spinbutton_c_min->set_value(min);
-		_spinbutton_c_max->set_value(max);
-		_checkbutton_c->set_active(to_fit);
-
-		parameter = hkl_lattice_alpha_get(lattice);
-		hkl_parameter_min_max_unit_get(parameter, &min, &max);
-		to_fit = hkl_parameter_fit_get(parameter);
-		_spinbutton_alpha_min->set_value(min);
-		_spinbutton_alpha_max->set_value(max);
-		_checkbutton_alpha->set_active(to_fit);
-
-		parameter = hkl_lattice_beta_get(lattice);
-		hkl_parameter_min_max_unit_get(parameter, &min, &max);
-		to_fit = hkl_parameter_fit_get(parameter);
-		_spinbutton_beta_min->set_value(min);
-		_spinbutton_beta_max->set_value(max);
-		_checkbutton_beta->set_active(to_fit);
-
-		parameter = hkl_lattice_gamma_get(lattice);
-		hkl_parameter_min_max_unit_get(parameter, &min, &max);
-		to_fit = hkl_parameter_fit_get(parameter);
-		_spinbutton_gamma_min->set_value(min);
-		_spinbutton_gamma_max->set_value(max);
-		_checkbutton_gamma->set_active(to_fit);
-	}
-}
-
-void HKLWindow::updateReciprocalLattice(void)
-{
-	LOG;
-
-	if(_sample){
-		hkl_lattice_reciprocal(hkl_sample_lattice_get(_sample),
-				       _reciprocal);
-
-		_spinbutton_a_star->set_value(
-			hkl_parameter_value_unit_get(
-				hkl_lattice_a_get(_reciprocal)));
-		_spinbutton_b_star->set_value(
-			hkl_parameter_value_unit_get(
-				hkl_lattice_b_get(_reciprocal)));
-		_spinbutton_c_star->set_value(
-			hkl_parameter_value_unit_get(
-				hkl_lattice_c_get(_reciprocal)));
-		_spinbutton_alpha_star->set_value(
-			hkl_parameter_value_unit_get(
-				hkl_lattice_alpha_get(_reciprocal)));
-		_spinbutton_beta_star->set_value(
-			hkl_parameter_value_unit_get(
-				hkl_lattice_beta_get(_reciprocal)));
-		_spinbutton_gamma_star->set_value(
-			hkl_parameter_value_unit_get(
-				hkl_lattice_gamma_get(_reciprocal)));
-	}
-}
-
-void HKLWindow::updateUB(void)
-{
-	LOG;
-
-	if(_sample){
-		static const char *format = "%f";
-		char tmp[100];
-		const HklMatrix *UB;
-
-		UB = hkl_sample_UB_get(_sample);
-		sprintf(tmp, format, hkl_matrix_get(UB, 0, 0));
-		_label_UB11->set_text(tmp);
-		sprintf(tmp, format, hkl_matrix_get(UB, 0, 1));
-		_label_UB12->set_text(tmp);
-		sprintf(tmp, format, hkl_matrix_get(UB, 0, 2));
-		_label_UB13->set_text(tmp);
-		sprintf(tmp, format, hkl_matrix_get(UB, 1, 0));
-		_label_UB21->set_text(tmp);
-		sprintf(tmp, format, hkl_matrix_get(UB, 1, 1));
-		_label_UB22->set_text(tmp);
-		sprintf(tmp, format, hkl_matrix_get(UB, 1, 2));
-		_label_UB23->set_text(tmp);
-		sprintf(tmp, format, hkl_matrix_get(UB, 2, 0));
-		_label_UB31->set_text(tmp);
-		sprintf(tmp, format, hkl_matrix_get(UB, 2, 1));
-		_label_UB32->set_text(tmp);
-		sprintf(tmp, format, hkl_matrix_get(UB, 2, 2));
-		_label_UB33->set_text(tmp);
-	}
-}
-
-void HKLWindow::updateUxUyUz(void)
-{
-	LOG;
-
-	if(_sample){
-		_spinbutton_ux->set_value(
-			hkl_parameter_value_unit_get(
-				hkl_sample_ux_get(_sample)));
-		_spinbutton_uy->set_value(
-			hkl_parameter_value_unit_get(
-				hkl_sample_uy_get(_sample)));
-		_spinbutton_uz->set_value(
-			hkl_parameter_value_unit_get(
-				hkl_sample_uz_get(_sample)));
-		_checkbutton_ux->set_active(
-			hkl_parameter_fit_get(
-				hkl_sample_ux_get(_sample)));
-		_checkbutton_uy->set_active(
-			hkl_parameter_fit_get(
-				hkl_sample_uy_get(_sample)));
-		_checkbutton_uz->set_active(
-			hkl_parameter_fit_get(
-				hkl_sample_uz_get(_sample)));
-	}
-}
-
-void HKLWindow::updateTreeViewCrystals(void)
-{
-	LOG;
-
-	size_t i;
-	HklSample *sample;
-
-	Gtk::ListStore::Row row;
-	Gtk::TreeModel::Children::iterator iter_row;
-	Gtk::TreeModel::Children::iterator iter_current;
-	Glib::ustring current_crystal_name;
-
-	bool is_current_crystal_set = false;
-
-	//clear all data in the models
-	_crystalModel = Gtk::ListStore::create(_crystalModelColumns);
-
-	// erase all reflections.
-	_mapReflectionModel.clear();
-
-	if(_sample){
-		is_current_crystal_set = true;
-		current_crystal_name = hkl_sample_name_get(_sample);
-	}
-
-	//Fill the models from the crystalList
-	std::map<std::string, HklSample *>::iterator it;
-	for(it=_samples.begin(); it!=_samples.end(); ++it){
-		const HklLattice *lattice;
-		const char *name;
-
-		sample = it->second;
-		lattice = hkl_sample_lattice_get(sample);
-		name = hkl_sample_name_get(sample);
-		iter_row = *(_crystalModel->append());
-		if (is_current_crystal_set && current_crystal_name == name)
-			iter_current = iter_row;
-		row = *(iter_row);
-		row[_crystalModelColumns.name] = name;
-		row[_crystalModelColumns.a] = hkl_parameter_value_unit_get(hkl_lattice_a_get(lattice));
-		row[_crystalModelColumns.b] = hkl_parameter_value_unit_get(hkl_lattice_b_get(lattice));
-		row[_crystalModelColumns.c] = hkl_parameter_value_unit_get(hkl_lattice_c_get(lattice));
-		row[_crystalModelColumns.alpha] = hkl_parameter_value_unit_get(hkl_lattice_alpha_get(lattice));
-		row[_crystalModelColumns.beta] = hkl_parameter_value_unit_get(hkl_lattice_beta_get(lattice));
-		row[_crystalModelColumns.gamma] = hkl_parameter_value_unit_get(hkl_lattice_gamma_get(lattice));
-
-		Glib::RefPtr<Gtk::ListStore> listStore = Gtk::ListStore::create(_reflectionModelColumns);
-		_mapReflectionModel[name] = listStore;
-		this->updateReflections(sample, listStore);
-	}
-
-	//Set the model for the TreeView
-	_treeViewCrystals->set_model(_crystalModel);
-	if (is_current_crystal_set)
-	{
-		Gtk::TreeModel::Path path = _crystalModel->get_path(iter_current);
-		_treeViewCrystals->set_cursor(path);
-		_treeViewReflections->set_model(_mapReflectionModel[current_crystal_name]);
-	}
-}
-
-void HKLWindow::updateReflections(const HklSample *sample,
-				  Glib::RefPtr<Gtk::ListStore> & listStore)
-{
-	LOG;
-
-	size_t i = 0;
-
-	listStore->clear();
-	Gtk::ListStore::Row row;
-	HklSampleReflection *reflection = hkl_sample_first_reflection_get(sample);
-	while(reflection){
-		double h, k, l;
-
-		hkl_sample_reflection_hkl_get(reflection, &h, &k, &l);
-
-		row = *(listStore->append());
-		row[_reflectionModelColumns.index] = i++;
-		row[_reflectionModelColumns.reflection] = reflection;
-		row[_reflectionModelColumns.h] = h;
-		row[_reflectionModelColumns.k] = k;
-		row[_reflectionModelColumns.l] = l;
-		row[_reflectionModelColumns.flag] = hkl_sample_reflection_flag_get(reflection);
-		reflection = hkl_sample_next_reflection_get(sample, reflection);
-	}
-}
-
-void HKLWindow::updateStatusBar(const HklError *error)
-{
-	LOG;
-
-	_statusBar->push(hkl_error_message_get(error));
-}
-
-void HKLWindow::updateCrystalModel(HklSample * sample)
-{
-	LOG;
-
-	Gtk::TreeModel::Children children = _crystalModel->children();
-	Gtk::TreeModel::Children::iterator iter = children.begin();
-	Gtk::TreeModel::Children::iterator end = children.end();
-	while (iter != end){
-		Gtk::TreeModel::Row const & row = *iter;
-		if (row[_crystalModelColumns.name] == hkl_sample_name_get(sample)){
-			const HklLattice *lattice = hkl_sample_lattice_get(sample);
-			row[_crystalModelColumns.a] = hkl_parameter_value_unit_get(
-				hkl_lattice_a_get(lattice));
-			row[_crystalModelColumns.b] = hkl_parameter_value_unit_get(
-				hkl_lattice_b_get(lattice));
-			row[_crystalModelColumns.c] = hkl_parameter_value_unit_get(
-				hkl_lattice_c_get(lattice));
-			row[_crystalModelColumns.alpha] = hkl_parameter_value_unit_get(
-				hkl_lattice_alpha_get(lattice));
-			row[_crystalModelColumns.beta] = hkl_parameter_value_unit_get(
-				hkl_lattice_beta_get(lattice));
-			row[_crystalModelColumns.gamma] = hkl_parameter_value_unit_get(
-				hkl_lattice_gamma_get(lattice));
-			iter = end;
-		}
-		else
-			++iter;
-	}
-}
-
-void HKLWindow::updatePseudoAxesFrames(void)
-{
-	LOG;
-
-	size_t i;
-
-	for(i=0; i<_pseudoAxesFrames.size(); ++i)
-		_pseudoAxesFrames[i]->update();
-}
-
-void HKLWindow::updateSolutions(void)
-{
-	LOG;
-
-	size_t i = 0;
-	const HklGeometryList *geometries = hkl_engine_list_geometries(this->_engines);
-	HklGeometryListItem **item;
-
-	_solutionModel->clear();
-	Gtk::ListStore::Row row;
-	const darray_item *items = hkl_geometry_list_items_get(geometries);
-	darray_foreach(item, *items){
-		HklParameter **axis;
-		int j = 0;
-
-		row = *(_solutionModel->append());
-		row[_solutionModelColumns->index] = i++;
-		row[_solutionModelColumns->item] = *item;
-
-		const HklGeometry *geometry = hkl_geometry_list_item_geometry_get(*item);
-		const darray_parameter *axes = hkl_geometry_axes_get(geometry);
-		darray_foreach(axis, *axes){
-			row[_solutionModelColumns->axes[j++]] =		\
-				hkl_parameter_value_unit_get(*axis);
-		}
-	}
-}
diff --git a/gui/hkl-gui.h b/gui/hkl-gui.h
index d71c2db..add4de3 100644
--- a/gui/hkl-gui.h
+++ b/gui/hkl-gui.h
@@ -13,272 +13,44 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef __GHKL_H__
-#define __GHKL_H__
 
-#include <map>
-#include <string>
-
-#include <iostream>
-
-#include <gtkmm.h>
-
-#include "hkl-gui-pseudoaxes.h"
-#include "hkl-gui-modelcolumns.h"
+#include <glib.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+#include <gdk/gdk.h>
 #include "hkl.h"
+#include "hkl-gui-pseudoaxes.h"
 
-#ifdef HKL3D
-# include "hkl-gui-3d.h"
-#endif
-
-#define LOG std::cout << __func__ << std::endl;
-
-class HKLWindow : public Gtk::Window
-{
-public:
-	HKLWindow(void);
-	virtual ~HKLWindow(void);
-
-protected:
-	//Signal handlers
-	virtual void on_button2_clicked(void);
-	virtual void on_spinbutton_a_value_changed(void);
-	virtual void on_spinbutton_b_value_changed(void);
-	virtual void on_spinbutton_c_value_changed(void);
-	virtual void on_spinbutton_alpha_value_changed(void);
-	virtual void on_spinbutton_beta_value_changed(void);
-	virtual void on_spinbutton_gamma_value_changed(void);
-	virtual void on_spinbutton_a_min_value_changed(void);
-	virtual void on_spinbutton_b_min_value_changed(void);
-	virtual void on_spinbutton_c_min_value_changed(void);
-	virtual void on_spinbutton_alpha_min_value_changed(void);
-	virtual void on_spinbutton_beta_min_value_changed(void);
-	virtual void on_spinbutton_gamma_min_value_changed(void);
-	virtual void on_spinbutton_a_max_value_changed(void);
-	virtual void on_spinbutton_b_max_value_changed(void);
-	virtual void on_spinbutton_c_max_value_changed(void);
-	virtual void on_spinbutton_alpha_max_value_changed(void);
-	virtual void on_spinbutton_beta_max_value_changed(void);
-	virtual void on_spinbutton_gamma_max_value_changed(void);
-	virtual void on_spinbutton_lambda_value_changed(void);
-	virtual void on_spinbutton_uxuyuz_value_changed(void);
-	virtual void on_checkbutton_a_toggled(void);
-	virtual void on_checkbutton_b_toggled(void);
-	virtual void on_checkbutton_c_toggled(void);
-	virtual void on_checkbutton_alpha_toggled(void);
-	virtual void on_checkbutton_beta_toggled(void);
-	virtual void on_checkbutton_gamma_toggled(void);
-	virtual void on_checkbutton_ux_toggled(void);
-	virtual void on_checkbutton_uy_toggled(void);
-	virtual void on_checkbutton_uz_toggled(void);
-
-	virtual void on_cell_TreeView_axes_read_edited(Glib::ustring const &,
-						       Glib::ustring const &);
-	virtual void on_cell_TreeView_axes_write_edited(Glib::ustring const &,
-							Glib::ustring const &);
-	virtual void on_cell_TreeView_axes_min_edited(Glib::ustring const &,
-						      Glib::ustring const &);
-	virtual void on_cell_TreeView_axes_max_edited(Glib::ustring const &,
-						      Glib::ustring const &);
-	virtual void on_cell_TreeView_pseudoAxes_write_edited(Glib::ustring const &,
-							      Glib::ustring const &);
-	virtual void on_cell_TreeView_pseudoAxes_parameters_value_edited(Glib::ustring const &,
-									 Glib::ustring const &);
-	virtual void on_cell_TreeView_crystals_name_edited(Glib::ustring const &,
-							   Glib::ustring const &);
-	virtual void on_cell_TreeView_reflections_h_edited(Glib::ustring const &,
-							   Glib::ustring const &);
-	virtual void on_cell_TreeView_reflections_k_edited(Glib::ustring const &,
-							   Glib::ustring const &);
-	virtual void on_cell_TreeView_reflections_l_edited(Glib::ustring const &,
-							   Glib::ustring const &);
-	virtual void on_cell_TreeView_reflections_flag_toggled(Glib::ustring const &);
-	virtual void on_toolbutton_add_reflection_clicked(void);
-	virtual void on_toolbutton_goto_reflection_clicked(void);
-	virtual void on_toolbutton_del_reflection_clicked(void);
-	virtual void on_toolbutton_setUB_clicked(void);
-	virtual void on_toolbutton_computeUB_clicked(void);
-	virtual void on_toolbutton_add_crystal_clicked(void);
-	virtual void on_toolbutton_copy_crystal_clicked(void);
-	virtual void on_toolbutton_del_crystal_clicked(void);
-	virtual void on_toolbutton_affiner_clicked(void);
-	virtual bool on_treeViewReflections_key_press_event(GdkEventKey *);
-	virtual void on_treeViewCrystals_cursor_changed(void);
-	virtual void on_treeView_pseudoAxes_cursor_changed(void);
-	virtual bool on_treeViewCrystals_key_press_event(GdkEventKey *);
-	virtual void on_treeview1_cursor_changed(void);
-	virtual void on_pseudoAxesFrame_changed(void);
-	virtual void on_menuitem5_activate(void);
-
-	// dialog1
-	virtual void on_button1_clicked(void);
-	virtual void on_combobox1_changed(void);
-
-protected:
-	//Non-Signal handlers
-	void set_up_TreeView_axes(void);
-	void set_up_TreeView_pseudoAxes(void);
-	void set_up_TreeView_pseudoAxes_parameters(void);
-	void set_up_TreeView_treeview1(void);
-	void set_up_TreeView_reflections(void);
-	void set_up_TreeView_crystals(void);
-	void set_up_3D(void);
-	void updateSource(void);
-	void updateAxes(void);
-	void updatePseudoAxes(void);
-	void update_pseudoAxes_parameters(void);
-	void updateLattice(void);
-	void updateLatticeParameters(void);
-	void updateReciprocalLattice(void);
-	void updateTreeViewCrystals(void);
-	void updateUB(void);
-	void updateUxUyUz(void);
-	void updateReflections(const HklSample *sample, Glib::RefPtr<Gtk::ListStore> &);
-	void updateStatusBar(const HklError *error);
-	void updateCrystalModel(HklSample *sample);
-	void updatePseudoAxesFrames(void);
-	void updateSolutions(void);
-
-	void get_widgets_and_objects_from_ui(void);
-	void connect_all_signals(void);
-	void set_up_pseudo_axes_frames(void);
-	void set_up_diffractometer_model(void);
-
-private:
-	//variables
-	Glib::RefPtr<Gtk::Builder> _refGlade;
-	// pointers on usefull widgets.
-	Gtk::Label *_label_UB11;
-	Gtk::Label *_label_UB12;
-	Gtk::Label *_label_UB13;
-	Gtk::Label *_label_UB21;
-	Gtk::Label *_label_UB22;
-	Gtk::Label *_label_UB23;
-	Gtk::Label *_label_UB31;
-	Gtk::Label *_label_UB32;
-	Gtk::Label *_label_UB33;
-	Gtk::Button *_button2;
-	Gtk::SpinButton *_spinbutton_a;
-	Gtk::SpinButton *_spinbutton_b;
-	Gtk::SpinButton *_spinbutton_c;
-	Gtk::SpinButton *_spinbutton_alpha;
-	Gtk::SpinButton *_spinbutton_beta;
-	Gtk::SpinButton *_spinbutton_gamma;
-	Gtk::SpinButton *_spinbutton_a_min;
-	Gtk::SpinButton *_spinbutton_b_min;
-	Gtk::SpinButton *_spinbutton_c_min;
-	Gtk::SpinButton *_spinbutton_alpha_min;
-	Gtk::SpinButton *_spinbutton_beta_min;
-	Gtk::SpinButton *_spinbutton_gamma_min;
-	Gtk::SpinButton *_spinbutton_a_max;
-	Gtk::SpinButton *_spinbutton_b_max;
-	Gtk::SpinButton *_spinbutton_c_max;
-	Gtk::SpinButton *_spinbutton_alpha_max;
-	Gtk::SpinButton *_spinbutton_beta_max;
-	Gtk::SpinButton *_spinbutton_gamma_max;
-	Gtk::SpinButton *_spinbutton_lambda;
-	Gtk::SpinButton *_spinbutton_a_star;
-	Gtk::SpinButton *_spinbutton_b_star;
-	Gtk::SpinButton *_spinbutton_c_star;
-	Gtk::SpinButton *_spinbutton_alpha_star;
-	Gtk::SpinButton *_spinbutton_beta_star;
-	Gtk::SpinButton *_spinbutton_gamma_star;
-	Gtk::SpinButton *_spinbutton_ux;
-	Gtk::SpinButton *_spinbutton_uy;
-	Gtk::SpinButton *_spinbutton_uz;
-	Gtk::SpinButton *_spinbutton_U11;
-	Gtk::SpinButton *_spinbutton_U12;
-	Gtk::SpinButton *_spinbutton_U13;
-	Gtk::SpinButton *_spinbutton_U21;
-	Gtk::SpinButton *_spinbutton_U22;
-	Gtk::SpinButton *_spinbutton_U23;
-	Gtk::SpinButton *_spinbutton_U31;
-	Gtk::SpinButton *_spinbutton_U32;
-	Gtk::SpinButton *_spinbutton_U33;
-	Gtk::CheckButton *_checkbutton_a;
-	Gtk::CheckButton *_checkbutton_b;
-	Gtk::CheckButton *_checkbutton_c;
-	Gtk::CheckButton *_checkbutton_alpha;
-	Gtk::CheckButton *_checkbutton_beta;
-	Gtk::CheckButton *_checkbutton_gamma;
-	Gtk::CheckButton *_checkbutton_ux;
-	Gtk::CheckButton *_checkbutton_uy;
-	Gtk::CheckButton *_checkbutton_uz;
-	Gtk::TreeView *_treeViewReflections;
-	Gtk::TreeView *_treeViewCrystals;
-	Gtk::TreeView *_TreeView_axes;
-	Gtk::TreeView *_TreeView_pseudoAxes;
-	Gtk::TreeView *_TreeView_pseudoAxes_parameters;
-	Gtk::TreeView *_treeview1; // attached to the _solutionModel
-	Gtk::ToolButton *_toolbutton_add_reflection;
-	Gtk::ToolButton *_toolbutton_goto_reflection;
-	Gtk::ToolButton *_toolbutton_del_reflection;
-	Gtk::ToolButton *_toolbutton_setUB;
-	Gtk::ToolButton *_toolbutton_computeUB;
-	Gtk::ToolButton *_toolbutton_add_crystal;
-	Gtk::ToolButton *_toolbutton_copy_crystal;
-	Gtk::ToolButton *_toolbutton_del_crystal;
-	Gtk::ToolButton *_toolbutton_affiner;
-	Gtk::Statusbar *_statusBar;
-	Gtk::ImageMenuItem *_menuitem5; // menu preferences
-	Gtk::VBox *_vbox7; // for the 3D
-	Gtk::ImageMenuItem *_imagemenuitem5; //quit
-
-	// dialog1 preferences
-	Gtk::Dialog *_dialog1;
-	Gtk::Button *_button1; // close
-	Gtk::ComboBox *_combobox1; // select diffractometer type
-
-	HklGeometry *_geometry;
-	HklDetector *_detector;
-	HklSample *_sample;
-	std::map<std::string, HklSample *> _samples;	
-	HklLattice *_reciprocal;
-	HklEngineList *_engines;
-
-	unsigned int _nb_axes;
-	unsigned int _nb_sampleAxes;
-	unsigned int _nb_detectorAxes;
-	std::vector<std::string> _sampleAxesNames;
-	std::vector<std::string> _detectorAxesNames;
-
-	unsigned int _nb_pseudoAxes;
-	std::vector<std::string> _pseudoAxesNames;
-
-	ReflectionModelColumns _reflectionModelColumns;
-	std::map<Glib::ustring, Glib::RefPtr<Gtk::ListStore> > _mapReflectionModel;
-
-	CrystalModelColumns _crystalModelColumns;
-	Glib::RefPtr<Gtk::ListStore> _crystalModel;
+#define HKL_GUI_TYPE_WINDOW (hkl_gui_window_get_type ())
+#define HKL_GUI_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HKL_GUI_TYPE_WINDOW, HklGuiWindow))
+#define HKL_GUI_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), HKL_GUI_TYPE_WINDOW, HklGuiWindowClass))
+#define HKL_GUI_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HKL_GUI_TYPE_WINDOW))
+#define HKL_GUI_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), HKL_GUI_TYPE_WINDOW))
+#define HKL_GUI_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), HKL_GUI_TYPE_WINDOW, HklGuiWindowClass))
 
-	AxeModelColumns _axeModelColumns;
-	Glib::RefPtr<Gtk::ListStore> _axeModel;
+typedef struct _HklGuiWindow HklGuiWindow;
+typedef struct _HklGuiWindowClass HklGuiWindowClass;
+typedef struct _HklGuiWindowPrivate HklGuiWindowPrivate;
 
-	PseudoAxeModelColumns _pseudoAxeModelColumns;
-	Glib::RefPtr<Gtk::ListStore> _pseudoAxeModel;
+struct _HklGuiWindow {
+	GObject parent_instance;
+	HklGuiWindowPrivate * priv;
+};
 
-	ParameterModelColumns _parameterModelColumns;
-	std::map<HklParameter *, Glib::RefPtr<Gtk::ListStore> > _mapPseudoAxeParameterModel;
+struct _HklGuiWindowClass {
+	GObjectClass parent_class;
+};
 
-	SolutionModelColumns *_solutionModelColumns;
-	Glib::RefPtr<Gtk::ListStore> _solutionModel;
+GType hkl_gui_window_get_type (void) G_GNUC_CONST;
 
-	DiffractometerModelColumns *_diffractometerModelColumns;
-	Glib::RefPtr<Gtk::ListStore> _diffractometerModel;
+HklGuiWindow* hkl_gui_window_new (void);
 
-	Gtk::MessageDialog *_message;
 
-	std::vector<PseudoAxesFrame *> _pseudoAxesFrames;
 
-#ifdef HKL3D
-	Hkl3DFrame *_Scene;
-#endif
-};
 
-#endif // __GHKL_H__
diff --git a/gui/hkl3d/GL_ShapeDrawer.cpp b/gui/hkl3d/GL_ShapeDrawer.cpp
deleted file mode 100644
index 1a0170d..0000000
--- a/gui/hkl3d/GL_ShapeDrawer.cpp
+++ /dev/null
@@ -1,805 +0,0 @@
-/*
-  Bullet Continuous Collision Detection and Physics Library
-  Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-  This software is provided 'as-is', without any express or implied warranty.
-  In no event will the authors be held liable for any damages arising from the use of this software.
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it freely,
-  subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-/*
- * This file is part of the hkl3d library.
- * inspired from logo-model.c of the GtkGLExt logo models.
- * written by Naofumi Yasufuku  <naofumi at users.sourceforge.net>
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2010-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-
-#include <stdio.h> //printf debugging
-#include <map>
-
-#include "GL_ShapeDrawer.h"
-#include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h"
-#include "BulletCollision/CollisionShapes/btTriangleMeshShape.h"
-#include "BulletCollision/CollisionShapes/btBoxShape.h"
-#include "BulletCollision/CollisionShapes/btSphereShape.h"
-#include "BulletCollision/CollisionShapes/btConeShape.h"
-#include "BulletCollision/CollisionShapes/btCylinderShape.h"
-#include "BulletCollision/CollisionShapes/btTetrahedronShape.h"
-#include "BulletCollision/CollisionShapes/btCompoundShape.h"
-#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
-#include "BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h"
-#include "BulletCollision/CollisionShapes/btUniformScalingShape.h"
-#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"
-#include "BulletCollision/CollisionShapes/btMultiSphereShape.h"
-
-
-///
-#include "BulletCollision/CollisionShapes/btShapeHull.h"
-#include "LinearMath/btTransformUtil.h"
-#include "LinearMath/btIDebugDraw.h"
-
-//#define USE_DISPLAY_LISTS 1
-#ifdef USE_DISPLAY_LISTS
-
-using namespace std;
-
-//Set for storing Display list per trimesh
-struct TRIMESH_KEY
-{
-	btCollisionShape* m_shape;
-	GLuint m_dlist;//OpenGL display list
-};
-
-typedef map<unsigned long,TRIMESH_KEY> TRIMESH_KEY_MAP;
-
-typedef pair<unsigned long,TRIMESH_KEY> TRIMESH_KEY_PAIR;
-
-TRIMESH_KEY_MAP g_display_lists;
-
-class GlDisplaylistDrawcallback : public btTriangleCallback
-{
-public:
-
-	virtual void processTriangle(btVector3* triangle,int partId, int triangleIndex)
-		{
-
-			btVector3 diff1 = triangle[1] - triangle[0];
-			btVector3 diff2 = triangle[2] - triangle[0];
-			btVector3 normal = diff1.cross(diff2);
-
-			normal.normalize();
-
-			glBegin(GL_TRIANGLES);
-			glColor3f(1, 1, 1);
-			glNormal3d(normal.getX(),normal.getY(),normal.getZ());
-			glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ());
-
-			//glColor3f(0, 1, 0);
-			glNormal3d(normal.getX(),normal.getY(),normal.getZ());
-			glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ());
-
-			//glColor3f(0, 1, 0);
-			glNormal3d(normal.getX(),normal.getY(),normal.getZ());
-			glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ());
-			glEnd();
-		}
-};
-
-GLuint  OGL_get_displaylist_for_shape(btCollisionShape * shape)
-{
-	TRIMESH_KEY_MAP::iterator map_iter;
-
-	unsigned long key = (unsigned long)shape;
-	map_iter = g_display_lists.find(key);
-	if(map_iter!=g_display_lists.end())
-		return map_iter->second.m_dlist;
-
-	return 0;
-}
-
-void OGL_displaylist_clean(void)
-{
-	TRIMESH_KEY_MAP::iterator map_iter,map_itend;
-
-	map_iter = g_display_lists.begin();
-
-	while(map_iter!=map_itend){
-		glDeleteLists(map_iter->second.m_dlist,1);
-		map_iter++;
-	}
-
-	g_display_lists.clear();
-}
-
-
-void OGL_displaylist_register_shape(btCollisionShape *shape)
-{
-	btVector3 aabbMax(btScalar(BT_LARGE_FLOAT), btScalar(BT_LARGE_FLOAT), btScalar(BT_LARGE_FLOAT));
-	btVector3 aabbMin(-btScalar(BT_LARGE_FLOAT), -btScalar(BT_LARGE_FLOAT), -btScalar(BT_LARGE_FLOAT));
-	GlDisplaylistDrawcallback drawCallback;
-	TRIMESH_KEY dlist;
-
-	dlist.m_dlist = glGenLists(1);
-	dlist.m_shape = shape;
-
-	unsigned long key = (unsigned long)shape;
-
-	g_display_lists.insert(TRIMESH_KEY_PAIR(key,dlist));
-
-	glNewList(dlist.m_dlist,GL_COMPILE);
-
-	glCullFace(GL_BACK);
-
-	if (shape->isConcave()){
-		btConcaveShape* concaveMesh = (btConcaveShape*) shape;
-		concaveMesh->processAllTriangles(&drawCallback,aabbMin,aabbMax);
-	}
-
-	glEndList();
-}
-#endif //USE_DISPLAY_LISTS
-
-void GL_ShapeDrawer::drawCoordSystem(void)  {
-	glBegin(GL_LINES);
-	glColor3f(1, 0, 0);
-	glVertex3d(0, 0, 0);
-	glVertex3d(1, 0, 0);
-	glColor3f(0, 1, 0);
-	glVertex3d(0, 0, 0);
-	glVertex3d(0, 1, 0);
-	glColor3f(0, 0, 1);
-	glVertex3d(0, 0, 0);
-	glVertex3d(0, 0, 1);
-	glEnd();
-}
-
-class GlDrawcallback : public btTriangleCallback
-{
-
-public:
-
-	bool m_wireframe;
-
-	GlDrawcallback()
-		:m_wireframe(false)
-		{
-		}
-
-	virtual void processTriangle(btVector3 *triangle, int partId, int triangleIndex)
-		{
-
-			(void)triangleIndex;
-			(void)partId;
-
-			if (m_wireframe){
-				glBegin(GL_LINES);
-				glColor3f(1, 0, 0);
-				glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ());
-				glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ());
-				glColor3f(0, 1, 0);
-				glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ());
-				glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ());
-				glColor3f(0, 0, 1);
-				glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ());
-				glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ());
-				glEnd();
-			}else{
-				glBegin(GL_TRIANGLES);
-
-				glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ());
-				glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ());
-				glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ());
-
-				glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ());
-				glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ());
-				glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ());
-				glEnd();
-			}
-		}
-};
-
-class TriangleGlDrawcallback : public btInternalTriangleIndexCallback
-{
-public:
-	virtual void internalProcessTriangleIndex(btVector3 *triangle, int partId, int triangleIndex)
-		{
-			(void)triangleIndex;
-			(void)partId;
-
-			glBegin(GL_TRIANGLES);//LINES);
-			glColor3f(1, 0, 0);
-			glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ());
-			glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ());
-			glColor3f(0, 1, 0);
-			glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ());
-			glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ());
-			glColor3f(0, 0, 1);
-			glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ());
-			glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ());
-			glEnd();
-		}
-};
-
-
-void GL_ShapeDrawer::drawSphere(btScalar radius, int lats, int longs)
-{
-	int i, j;
-	for(i=0;i<=lats;i++){
-		btScalar lat0 = SIMD_PI * (-btScalar(0.5) + (btScalar) (i - 1) / lats);
-		btScalar z0  = radius*sin(lat0);
-		btScalar zr0 =  radius*cos(lat0);
-
-		btScalar lat1 = SIMD_PI * (-btScalar(0.5) + (btScalar) i / lats);
-		btScalar z1 = radius*sin(lat1);
-		btScalar zr1 = radius*cos(lat1);
-
-		glBegin(GL_QUAD_STRIP);
-		for(j=0;j<=longs;j++) {
-			btScalar lng = 2 * SIMD_PI * (btScalar) (j - 1) / longs;
-			btScalar x = cos(lng);
-			btScalar y = sin(lng);
-			glNormal3f(x * zr1, y * zr1, z1);
-			glVertex3f(x * zr1, y * zr1, z1);
-			glNormal3f(x * zr0, y * zr0, z0);
-			glVertex3f(x * zr0, y * zr0, z0);
-		}
-		glEnd();
-	}
-}
-
-GL_ShapeDrawer::ShapeCache* GL_ShapeDrawer::cache(btConvexShape *shape)
-{
-	ShapeCache *sc = (ShapeCache*)shape->getUserPointer();
-	if(!sc){
-		sc = new(btAlignedAlloc(sizeof(ShapeCache),16)) ShapeCache(shape);
-		sc->m_shapehull.buildHull(shape->getMargin());
-		m_shapecaches.push_back(sc);
-		shape->setUserPointer(sc);
-		/* Build edges	*/
-		const int ni = sc->m_shapehull.numIndices();
-		const int nv = sc->m_shapehull.numVertices();
-		const unsigned int *pi = sc->m_shapehull.getIndexPointer();
-		const btVector3 *pv = sc->m_shapehull.getVertexPointer();
-		btAlignedObjectArray<ShapeCache::Edge*>	edges;
-		sc->m_edges.reserve(ni);
-		edges.resize(nv*nv,0);
-		for(int i=0;i<ni;i+=3){
-			const unsigned int *ti = pi+i;
-			const btVector3 nrm = btCross(pv[ti[1]]-pv[ti[0]],pv[ti[2]]-pv[ti[0]]).normalized();
-			for(int j=2,k=0;k<3;j=k++){
-				const unsigned int a=ti[j];
-				const unsigned int b=ti[k];
-				ShapeCache::Edge*& e=edges[btMin(a,b)*nv+btMax(a,b)];
-				if(!e){
-					sc->m_edges.push_back(ShapeCache::Edge());
-					e=&sc->m_edges[sc->m_edges.size()-1];
-					e->n[0]=nrm;e->n[1]=-nrm;
-					e->v[0]=a;e->v[1]=b;
-				}else{
-					e->n[1]=nrm;
-				}
-			}
-		}
-	}
-	return(sc);
-}
-
-void renderSquareA(float x, float y, float z)
-{
-	glBegin(GL_LINE_LOOP);
-	glVertex3f(x, y, z);
-	glVertex3f(x + 10.f, y, z);
-	glVertex3f(x + 10.f, y + 10.f, z);
-	glVertex3f(x, y + 10.f, z);
-	glEnd();
-}
-
-inline void glDrawVector(const btVector3& v) { glVertex3d(v[0], v[1], v[2]); }
-
-
-void GL_ShapeDrawer::drawOpenGL(btScalar *m, const btCollisionShape *shape,
-				const btVector3 & color,int debugMode,
-				const btVector3 & worldBoundsMin, const btVector3 & worldBoundsMax)
-{
-
-	if (shape->getShapeType() == CUSTOM_CONVEX_SHAPE_TYPE){
-		btVector3 org(m[12], m[13], m[14]);
-		btVector3 dx(m[0], m[1], m[2]);
-		btVector3 dy(m[4], m[5], m[6]);
-		const btBoxShape* boxShape = static_cast<const btBoxShape*>(shape);
-		btVector3 halfExtent = boxShape->getHalfExtentsWithMargin();
-		dx *= halfExtent[0];
-		dy *= halfExtent[1];
-		glColor3f(1,1,1);
-		glDisable(GL_LIGHTING);
-		glLineWidth(2);
-
-		glBegin(GL_LINE_LOOP);
-		glDrawVector(org - dx - dy);
-		glDrawVector(org - dx + dy);
-		glDrawVector(org + dx + dy);
-		glDrawVector(org + dx - dy);
-		glEnd();
-		return;
-	}else if((shape->getShapeType() == BOX_SHAPE_PROXYTYPE) && (debugMode & btIDebugDraw::DBG_FastWireframe)){
-		btVector3 org(m[12], m[13], m[14]);
-		btVector3 dx(m[0], m[1], m[2]);
-		btVector3 dy(m[4], m[5], m[6]);
-		btVector3 dz(m[8], m[9], m[10]);
-		const btBoxShape* boxShape = static_cast<const btBoxShape*>(shape);
-		btVector3 halfExtent = boxShape->getHalfExtentsWithMargin();
-		dx *= halfExtent[0];
-		dy *= halfExtent[1];
-		dz *= halfExtent[2];
-		glBegin(GL_LINE_LOOP);
-		glDrawVector(org - dx - dy - dz);
-		glDrawVector(org + dx - dy - dz);
-		glDrawVector(org + dx + dy - dz);
-		glDrawVector(org - dx + dy - dz);
-		glDrawVector(org - dx + dy + dz);
-		glDrawVector(org + dx + dy + dz);
-		glDrawVector(org + dx - dy + dz);
-		glDrawVector(org - dx - dy + dz);
-		glEnd();
-		glBegin(GL_LINES);
-		glDrawVector(org + dx - dy - dz);
-		glDrawVector(org + dx - dy + dz);
-		glDrawVector(org + dx + dy - dz);
-		glDrawVector(org + dx + dy + dz);
-		glDrawVector(org - dx - dy - dz);
-		glDrawVector(org - dx + dy - dz);
-		glDrawVector(org - dx - dy + dz);
-		glDrawVector(org - dx + dy + dz);
-		glEnd();
-		return;
-	}
-
-	glPushMatrix();
-	btglMultMatrix(m);
-
-	if (shape->getShapeType() == UNIFORM_SCALING_SHAPE_PROXYTYPE){
-		const btUniformScalingShape* scalingShape = static_cast<const btUniformScalingShape*>(shape);
-		const btConvexShape* convexShape = scalingShape->getChildShape();
-		float	scalingFactor = (float)scalingShape->getUniformScalingFactor();
-		{
-			btScalar tmpScaling[4][4]={{scalingFactor,0,0,0},
-						   {0,scalingFactor,0,0},
-						   {0,0,scalingFactor,0},
-						   {0,0,0,1}};
-
-			drawOpenGL( (btScalar*)tmpScaling,convexShape,color,debugMode,worldBoundsMin,worldBoundsMax);
-		}
-		glPopMatrix();
-		return;
-	}
-
-	if (shape->getShapeType() == COMPOUND_SHAPE_PROXYTYPE){
-		const btCompoundShape* compoundShape = static_cast<const btCompoundShape*>(shape);
-		for (int i=compoundShape->getNumChildShapes()-1;i>=0;i--){
-			btTransform childTrans = compoundShape->getChildTransform(i);
-			const btCollisionShape* colShape = compoundShape->getChildShape(i);
-			btScalar childMat[16];
-			childTrans.getOpenGLMatrix(childMat);
-			drawOpenGL(childMat,colShape,color,debugMode,worldBoundsMin,worldBoundsMax);
-		}
-
-	}else{
-		if(m_textureenabled&&(!m_textureinitialized)){
-			GLubyte *image = new GLubyte[256*256*3];
-			for(int y=0;y<256;++y){
-				const int t = y>>4;
-				GLubyte *pi = image+y*256*3;
-				for(int x=0;x<256;++x){
-					const int s = x>>4;
-					const GLubyte b = 180;
-					GLubyte c = b+((s+t&1)&1)*(255-b);
-					pi[0] = pi[1] = pi[2] = c;
-					pi += 3;
-				}
-			}
-
-			glGenTextures(1,(GLuint*)&m_texturehandle);
-			glBindTexture(GL_TEXTURE_2D,m_texturehandle);
-			glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
-			glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
-			glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR_MIPMAP_LINEAR);
-			glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
-			glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
-			gluBuild2DMipmaps(GL_TEXTURE_2D,3,256,256,GL_RGB,GL_UNSIGNED_BYTE,image);
-			delete[] image;
-
-
-		}
-
-		glMatrixMode(GL_TEXTURE);
-		glLoadIdentity();
-		glScalef(0.025f,0.025f,0.025f);
-		glMatrixMode(GL_MODELVIEW);
-
-		static const GLfloat planex[]={1,0,0,0};
-		//	static const GLfloat	planey[]={0,1,0,0};
-		static const GLfloat planez[]={0,0,1,0};
-		glTexGenfv(GL_S,GL_OBJECT_PLANE,planex);
-		glTexGenfv(GL_T,GL_OBJECT_PLANE,planez);
-		glTexGeni(GL_S,GL_TEXTURE_GEN_MODE,GL_OBJECT_LINEAR);
-		glTexGeni(GL_T,GL_TEXTURE_GEN_MODE,GL_OBJECT_LINEAR);
-		glEnable(GL_TEXTURE_GEN_S);
-		glEnable(GL_TEXTURE_GEN_T);
-		glEnable(GL_TEXTURE_GEN_R);
-		m_textureinitialized=true;
-
-		glEnable(GL_COLOR_MATERIAL);
-		if(m_textureenabled){
-			glEnable(GL_TEXTURE_2D);
-			glBindTexture(GL_TEXTURE_2D,m_texturehandle);
-		}else{
-			glDisable(GL_TEXTURE_2D);
-		}
-
-		glColor3f(color.x(),color.y(), color.z());
-
-		bool useWireframeFallback = true;
-
-		if (!(debugMode & btIDebugDraw::DBG_DrawWireframe)){
-			///you can comment out any of the specific cases, and use the default
-
-			///the benefit of 'default' is that it approximates the actual collision shape including collision margin
-			//int shapetype=m_textureenabled?MAX_BROADPHASE_COLLISION_TYPES:shape->getShapeType();
-			int shapetype=shape->getShapeType();
-			switch (shapetype){
-
-			case SPHERE_SHAPE_PROXYTYPE:
-			{
-				const btSphereShape* sphereShape = static_cast<const btSphereShape*>(shape);
-				float radius = sphereShape->getMargin();//radius doesn't include the margin, so draw with margin
-				drawSphere(radius,10,10);
-				useWireframeFallback = false;
-				break;
-			}
-
-			case BOX_SHAPE_PROXYTYPE:
-			{
-				const btBoxShape* boxShape = static_cast<const btBoxShape*>(shape);
-				btVector3 halfExtent = boxShape->getHalfExtentsWithMargin();
-
-				static int indices[36] = {
-					0,1,2,
-					3,2,1,
-					4,0,6,
-					6,0,2,
-					5,1,4,
-					4,1,0,
-					7,3,1,
-					7,1,5,
-					5,4,7,
-					7,4,6,
-					7,2,3,
-					7,6,2};
-
-				btVector3 vertices[8]={
-					btVector3(halfExtent[0],halfExtent[1],halfExtent[2]),
-					btVector3(-halfExtent[0],halfExtent[1],halfExtent[2]),
-					btVector3(halfExtent[0],-halfExtent[1],halfExtent[2]),
-					btVector3(-halfExtent[0],-halfExtent[1],halfExtent[2]),
-					btVector3(halfExtent[0],halfExtent[1],-halfExtent[2]),
-					btVector3(-halfExtent[0],halfExtent[1],-halfExtent[2]),
-					btVector3(halfExtent[0],-halfExtent[1],-halfExtent[2]),
-					btVector3(-halfExtent[0],-halfExtent[1],-halfExtent[2])};
-#if 1
-				glBegin (GL_TRIANGLES);
-				int si=36;
-				for (int i=0;i<si;i+=3){
-					const btVector3& v1 = vertices[indices[i]];;
-					const btVector3& v2 = vertices[indices[i+1]];
-					const btVector3& v3 = vertices[indices[i+2]];
-					btVector3 normal = (v3-v1).cross(v2-v1);
-					normal.normalize ();
-					glNormal3f(normal.getX(),normal.getY(),normal.getZ());
-					glVertex3f (v1.x(), v1.y(), v1.z());
-					glVertex3f (v2.x(), v2.y(), v2.z());
-					glVertex3f (v3.x(), v3.y(), v3.z());
-
-				}
-				glEnd();
-#endif
-
-				useWireframeFallback = false;
-				break;
-			}
-
-
-
-#if 0
-
-			case CONE_SHAPE_PROXYTYPE:
-			{
-				const btConeShape* coneShape = static_cast<const btConeShape*>(shape);
-				int upIndex = coneShape->getConeUpIndex();
-				float radius = coneShape->getRadius();//+coneShape->getMargin();
-				float height = coneShape->getHeight();//+coneShape->getMargin();
-				switch (upIndex)
-				{
-				case 0:
-					glRotatef(90.0, 0.0, 1.0, 0.0);
-					break;
-				case 1:
-					glRotatef(-90.0, 1.0, 0.0, 0.0);
-					break;
-				case 2:
-					break;
-				default:
-				{
-				}
-				};
-
-				glTranslatef(0.0, 0.0, -0.5*height);
-				glutSolidCone(radius,height,10,10);
-				useWireframeFallback = false;
-				break;
-
-			}
-#endif
-
-			case STATIC_PLANE_PROXYTYPE:
-			{
-				const btStaticPlaneShape* staticPlaneShape = static_cast<const btStaticPlaneShape*>(shape);
-				btScalar planeConst = staticPlaneShape->getPlaneConstant();
-				const btVector3& planeNormal = staticPlaneShape->getPlaneNormal();
-				btVector3 planeOrigin = planeNormal * planeConst;
-				btVector3 vec0,vec1;
-				btPlaneSpace1(planeNormal,vec0,vec1);
-				btScalar vecLen = 100.f;
-				btVector3 pt0 = planeOrigin + vec0*vecLen;
-				btVector3 pt1 = planeOrigin - vec0*vecLen;
-				btVector3 pt2 = planeOrigin + vec1*vecLen;
-				btVector3 pt3 = planeOrigin - vec1*vecLen;
-				glBegin(GL_LINES);
-				glVertex3f(pt0.getX(),pt0.getY(),pt0.getZ());
-				glVertex3f(pt1.getX(),pt1.getY(),pt1.getZ());
-				glVertex3f(pt2.getX(),pt2.getY(),pt2.getZ());
-				glVertex3f(pt3.getX(),pt3.getY(),pt3.getZ());
-				glEnd();
-
-
-				break;
-
-			}
-
-			case MULTI_SPHERE_SHAPE_PROXYTYPE:
-			{
-				const btMultiSphereShape* multiSphereShape = static_cast<const btMultiSphereShape*>(shape);
-
-				btTransform childTransform;
-				childTransform.setIdentity();
-
-
-				for (int i = multiSphereShape->getSphereCount()-1; i>=0;i--){
-					btSphereShape sc(multiSphereShape->getSphereRadius(i));
-					childTransform.setOrigin(multiSphereShape->getSpherePosition(i));
-					btScalar childMat[16];
-					childTransform.getOpenGLMatrix(childMat);
-					drawOpenGL(childMat,&sc,color,debugMode,worldBoundsMin,worldBoundsMax);
-				}
-
-				break;
-			}
-
-			default:
-			{
-				if (shape->isConvex()){
-					ShapeCache *sc = cache((btConvexShape*)shape);
-#if 0
-					btConvexShape *convexShape = (btConvexShape*)shape;
-					if (!shape->getUserPointer()){
-						//create a hull approximation
-						void *mem = btAlignedAlloc(sizeof(btShapeHull),16);
-						btShapeHull *hull = new(mem) btShapeHull(convexShape);
-
-						///cleanup memory
-						m_shapeHulls.push_back(hull);
-
-						btScalar margin = shape->getMargin();
-						hull->buildHull(margin);
-						convexShape->setUserPointer(hull);
-					}
-#endif
-					{
-						btShapeHull* hull = &sc->m_shapehull;
-
-						if (hull->numTriangles () > 0){
-							int index = 0;
-							const unsigned int* idx = hull->getIndexPointer();
-							const btVector3* vtx = hull->getVertexPointer();
-
-							glBegin (GL_TRIANGLES);
-
-							for (int i = 0; i < hull->numTriangles (); i++){
-								int i1 = index++;
-								int i2 = index++;
-								int i3 = index++;
-								btAssert(i1 < hull->numIndices () &&
-									 i2 < hull->numIndices () &&
-									 i3 < hull->numIndices ());
-
-								int index1 = idx[i1];
-								int index2 = idx[i2];
-								int index3 = idx[i3];
-								btAssert(index1 < hull->numVertices () &&
-									 index2 < hull->numVertices () &&
-									 index3 < hull->numVertices ());
-
-								btVector3 v1 = vtx[index1];
-								btVector3 v2 = vtx[index2];
-								btVector3 v3 = vtx[index3];
-								btVector3 normal = (v3-v1).cross(v2-v1);
-								normal.normalize ();
-								glNormal3f(normal.getX(),normal.getY(),normal.getZ());
-								glVertex3f (v1.x(), v1.y(), v1.z());
-								glVertex3f (v2.x(), v2.y(), v2.z());
-								glVertex3f (v3.x(), v3.y(), v3.z());
-
-							}
-							glEnd ();
-
-						}
-					}
-				}
-			}
-			}
-
-		}
-
-		glNormal3f(0,1,0);
-
-		/// for polyhedral shapes
-		if (debugMode==btIDebugDraw::DBG_DrawFeaturesText && (shape->isPolyhedral())){
-			btPolyhedralConvexShape *polyshape = (btPolyhedralConvexShape*) shape;
-			{
-
-				glColor3f(1.f, 1.f, 1.f);
-				int i;
-				for (i=0;i<polyshape->getNumVertices();i++){
-					btVector3 vtx;
-					polyshape->getVertex(i,vtx);
-					char buf[12];
-					sprintf(buf," %d",i);
-				}
-
-				for (i=0;i<polyshape->getNumPlanes();i++){
-					btVector3 normal;
-					btVector3 vtx;
-					polyshape->getPlane(normal,vtx,i);
-				}
-			}
-		}
-
-
-#ifdef USE_DISPLAY_LISTS
-
-		if (shape->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE||shape->getShapeType() == GIMPACT_SHAPE_PROXYTYPE){
-			GLuint dlist =   OGL_get_displaylist_for_shape((btCollisionShape * )shape);
-			if (dlist){
-				glCallList(dlist);
-			}else{
-#else
-				if (shape->isConcave() && !shape->isInfinite()){
-					btConcaveShape* concaveMesh = (btConcaveShape*) shape;
-
-					GlDrawcallback drawCallback;
-					drawCallback.m_wireframe = (debugMode & btIDebugDraw::DBG_DrawWireframe)!=0;
-
-					concaveMesh->processAllTriangles(&drawCallback,worldBoundsMin,worldBoundsMax);
-				}
-#endif
-
-#ifdef USE_DISPLAY_LISTS
-			}
-		}
-#endif
-	}
-	glPopMatrix();
-}
-
-//
-void GL_ShapeDrawer::drawShadow(btScalar *m, const btVector3 & extrusion, const btCollisionShape *shape,
-				const btVector3 & worldBoundsMin, const btVector3 & worldBoundsMax)
-{
-	glPushMatrix();
-	btglMultMatrix(m);
-	if(shape->getShapeType() == UNIFORM_SCALING_SHAPE_PROXYTYPE){
-		const btUniformScalingShape *scalingShape = static_cast<const btUniformScalingShape*>(shape);
-		const btConvexShape *convexShape = scalingShape->getChildShape();
-		float scalingFactor = (float)scalingShape->getUniformScalingFactor();
-		btScalar tmpScaling[4][4]={{scalingFactor,0,0,0},
-					   {0,scalingFactor,0,0},
-					   {0,0,scalingFactor,0},
-					   {0,0,0,1}};
-		drawShadow((btScalar*)tmpScaling,extrusion,convexShape,worldBoundsMin,worldBoundsMax);
-		glPopMatrix();
-		return;
-	}else if(shape->getShapeType()==COMPOUND_SHAPE_PROXYTYPE){
-		const btCompoundShape* compoundShape = static_cast<const btCompoundShape*>(shape);
-		for (int i=compoundShape->getNumChildShapes()-1;i>=0;i--){
-			btTransform childTrans = compoundShape->getChildTransform(i);
-			const btCollisionShape* colShape = compoundShape->getChildShape(i);
-			btScalar childMat[16];
-			childTrans.getOpenGLMatrix(childMat);
-			drawShadow(childMat,extrusion*childTrans.getBasis(),colShape,worldBoundsMin,worldBoundsMax);
-		}
-	}else{
-		//	bool useWireframeFallback = true;
-		if (shape->isConvex()){
-			ShapeCache *sc = cache((btConvexShape*)shape);
-			btShapeHull *hull = &sc->m_shapehull;
-			glBegin(GL_QUADS);
-			for(int i=0;i<sc->m_edges.size();++i){
-				const btScalar d = btDot(sc->m_edges[i].n[0],extrusion);
-				if((d*btDot(sc->m_edges[i].n[1],extrusion))<0){
-					const int q = d<0?1:0;
-					const btVector3 & a = hull->getVertexPointer()[sc->m_edges[i].v[q]];
-					const btVector3 & b = hull->getVertexPointer()[sc->m_edges[i].v[1-q]];
-					glVertex3f(a[0],a[1],a[2]);
-					glVertex3f(b[0],b[1],b[2]);
-					glVertex3f(b[0]+extrusion[0],b[1]+extrusion[1],b[2]+extrusion[2]);
-					glVertex3f(a[0]+extrusion[0],a[1]+extrusion[1],a[2]+extrusion[2]);
-				}
-			}
-			glEnd();
-		}
-
-	}
-
-	if (shape->isConcave()){
-		btConcaveShape *concaveMesh = (btConcaveShape*) shape;
-
-		GlDrawcallback drawCallback;
-		drawCallback.m_wireframe = false;
-
-		concaveMesh->processAllTriangles(&drawCallback,worldBoundsMin,worldBoundsMax);
-
-	}
-	glPopMatrix();
-}
-
-//
-GL_ShapeDrawer::GL_ShapeDrawer()
-{
-	m_texturehandle = 0;
-	m_textureenabled = false;
-	m_textureinitialized = false;
-}
-
-GL_ShapeDrawer::~GL_ShapeDrawer()
-{
-	int i;
-	for (i=0;i<m_shapecaches.size();i++){
-		m_shapecaches[i]->~ShapeCache();
-		btAlignedFree(m_shapecaches[i]);
-	}
-	m_shapecaches.clear();
-	if(m_textureinitialized)
-		glDeleteTextures(1,(const GLuint*) &m_texturehandle);
-}
diff --git a/gui/hkl3d/GL_ShapeDrawer.h b/gui/hkl3d/GL_ShapeDrawer.h
deleted file mode 100644
index 9473949..0000000
--- a/gui/hkl3d/GL_ShapeDrawer.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
-  Bullet Continuous Collision Detection and Physics Library
-  Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-  This software is provided 'as-is', without any express or implied warranty.
-  In no event will the authors be held liable for any damages arising from the use of this software.
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it freely,
-  subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-/*
- * This file is part of the hkl3d library.
- * inspired from logo-model.c of the GtkGLExt logo models.
- * written by Naofumi Yasufuku  <naofumi at users.sourceforge.net>
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2010-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-
-#ifndef GL_SHAPE_DRAWER_H
-#define GL_SHAPE_DRAWER_H
-
-#include <GL/gl.h>
-#include <GL/glu.h>
-
-/* forward declaration */
-class btCollisionShape;
-class btShapeHull;
-
-#include "LinearMath/btAlignedObjectArray.h"
-#include "LinearMath/btVector3.h"
-#include "BulletCollision/CollisionShapes/btShapeHull.h"
-
-#if defined(BT_USE_DOUBLE_PRECISION)
-#define btglLoadMatrix glLoadMatrixd
-#define btglMultMatrix glMultMatrixd
-#define btglColor3 glColor3d
-#define btglVertex3 glVertex3d
-#else
-#define btglLoadMatrix glLoadMatrixf
-#define btglMultMatrix glMultMatrixf
-#define btglColor3 glColor3f
-#define btglVertex3 glVertex3d
-#endif
-
-/// OpenGL shape drawing
-class GL_ShapeDrawer
-{
-protected:
-	struct ShapeCache
-	{
-		struct Edge
-		{
-			btVector3 n[2];
-			int v[2];
-		};
-	ShapeCache(btConvexShape* s) : m_shapehull(s) {}
-		btShapeHull m_shapehull;
-		btAlignedObjectArray<Edge> m_edges;
-	};
-	//clean-up memory of dynamically created shape hulls
-	btAlignedObjectArray<ShapeCache*> m_shapecaches;
-	unsigned int m_texturehandle;
-	bool m_textureenabled;
-	bool m_textureinitialized;
-
-	ShapeCache *cache(btConvexShape*);
-
-public:
-	GL_ShapeDrawer(void);
-	virtual ~GL_ShapeDrawer(void);
-
-	///drawOpenGL might allocate temporary memoty, stores pointer in shape userpointer
-	virtual void drawOpenGL(btScalar *m, const btCollisionShape *shape,
-				const btVector3 & color, int debugMode,
-				const btVector3 & worldBoundsMin, const btVector3 & worldBoundsMax);
-	virtual void drawShadow(btScalar *m, const btVector3 & extrusion, const btCollisionShape *shape,
-				const btVector3 & worldBoundsMin, const btVector3 & worldBoundsMax);
-
-	bool enableTexture(bool enable) {bool p=m_textureenabled;m_textureenabled=enable; return(p); }
-	bool hasTextureEnabled(void) const {return m_textureenabled;}
-
-	static void drawCylinder(float radius, float halfHeight, int upAxis);
-	void drawSphere(btScalar r, int lats, int longs);
-	static void drawCoordSystem(void);
-};
-
-void OGL_displaylist_register_shape(btCollisionShape *shape);
-void OGL_displaylist_clean(void);
-
-#endif //GL_SHAPE_DRAWER_H
diff --git a/gui/hkl3d/Makefile.am b/gui/hkl3d/Makefile.am
deleted file mode 100644
index b24db3e..0000000
--- a/gui/hkl3d/Makefile.am
+++ /dev/null
@@ -1,47 +0,0 @@
-AM_CXXFLAGS = \
-	-fpermissive \
-	-I$(top_srcdir) \
-	-I$(top_srcdir)/hkl \
-	-I$(top_srcdir)/hkl3d \
-	-I$(top_srcdir)/hkl3d/bullet/src \
-	-DPKGDATA=\""$(pkgdatadir)"\" \
-	$(G3D_CFLAGS) \
-	$(GTKGLEXTMM_CFLAGS) \
-	-DG_DISABLE_DEPRECATED \
-	-DGDK_DISABLE_DEPRECATED \
-	-DGDK_PIXBUF_DISABLE_DEPRECATED	\
-	-DGTK_DISABLE_DEPRECATED
-
-AM_CFLAGS = $(AM_CXXFLAGS)
-
-AM_LDFLAGS = \
-	$(top_builddir)/hkl/libhkl.la \
-	$(top_builddir)/hkl3d/libhkl3d.la \
-	$(top_builddir)/hkl3d/bullet/src/libbulletdynamics.la \
-	$(G3D_LIBS) \
-	$(GLU_LIBS) \
-	$(GTKGLEXTMM_LIBS)
-
-noinst_LTLIBRARIES = libhkl3d-gui.la
-libhkl3d_gui_la_SOURCES = \
-	texture.h \
-	texture.c \
-	hkl3d-gui-gl.h \
-	hkl3d-gui-gl.c \
-	hkl3d-gui-view.h \
-	hkl3d-gui-view.cpp \
-	hkl3d-gui-model.h \
-	hkl3d-gui-model.cpp \
-	hkl3d-gui-scene.h \
-	hkl3d-gui-scene.cpp \
-	trackball.h \
-	trackball.c \
-	GL_ShapeDrawer.h \
-	GL_ShapeDrawer.cpp
-
-# Support for GNU Flymake, in Emacs.
-check-syntax: AM_CXXFLAGS += -fsyntax-only -pipe
-check-syntax:
-	test -z "$(CHK_SOURCES)" || $(CXXCOMPILE) $(CHK_SOURCES)
-
-.PHONY: check-syntax
diff --git a/gui/hkl3d/Makefile.in b/gui/hkl3d/Makefile.in
deleted file mode 100644
index d87b214..0000000
--- a/gui/hkl3d/Makefile.in
+++ /dev/null
@@ -1,714 +0,0 @@
-# Makefile.in generated by automake 1.13.3 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = gui/hkl3d
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/config/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
-	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
-	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
-	$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libhkl3d_gui_la_LIBADD =
-am_libhkl3d_gui_la_OBJECTS = texture.lo hkl3d-gui-gl.lo \
-	hkl3d-gui-view.lo hkl3d-gui-model.lo hkl3d-gui-scene.lo \
-	trackball.lo GL_ShapeDrawer.lo
-libhkl3d_gui_la_OBJECTS = $(am_libhkl3d_gui_la_OBJECTS)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/config/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_ at AM_V@)
-am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 = 
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 = 
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CXXFLAGS) $(CXXFLAGS)
-AM_V_CXX = $(am__v_CXX_ at AM_V@)
-am__v_CXX_ = $(am__v_CXX_ at AM_DEFAULT_V@)
-am__v_CXX_0 = @echo "  CXX     " $@;
-am__v_CXX_1 = 
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
-	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CXXLD = $(am__v_CXXLD_ at AM_V@)
-am__v_CXXLD_ = $(am__v_CXXLD_ at AM_DEFAULT_V@)
-am__v_CXXLD_0 = @echo "  CXXLD   " $@;
-am__v_CXXLD_1 = 
-SOURCES = $(libhkl3d_gui_la_SOURCES)
-DIST_SOURCES = $(libhkl3d_gui_la_SOURCES)
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ASY = @ASY@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-G3D_CFLAGS = @G3D_CFLAGS@
-G3D_LIBS = @G3D_LIBS@
-GLIB_CFLAGS = @GLIB_CFLAGS@
-GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
-GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
-GLIB_LIBS = @GLIB_LIBS@
-GLIB_MKENUMS = @GLIB_MKENUMS@
-GLU_CFLAGS = @GLU_CFLAGS@
-GLU_LIBS = @GLU_LIBS@
-GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
-GOBJECT_LIBS = @GOBJECT_LIBS@
-GOBJECT_QUERY = @GOBJECT_QUERY@
-GREP = @GREP@
-GSL_CFLAGS = @GSL_CFLAGS@
-GSL_CONFIG = @GSL_CONFIG@
-GSL_LIBS = @GSL_LIBS@
-GTKDOC_CHECK = @GTKDOC_CHECK@
-GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
-GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
-GTKDOC_MKPDF = @GTKDOC_MKPDF@
-GTKDOC_REBASE = @GTKDOC_REBASE@
-GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
-GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
-GTKMM_CFLAGS = @GTKMM_CFLAGS@
-GTKMM_LIBS = @GTKMM_LIBS@
-HTML_DIR = @HTML_DIR@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
-INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
-INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
-INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
-INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
-INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
-INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
-INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LTP = @LTP@
-LTP_GENHTML = @LTP_GENHTML@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-SHTOOL = @SHTOOL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-VMAJ = @VMAJ@
-YAML_CFLAGS = @YAML_CFLAGS@
-YAML_LIBS = @YAML_LIBS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-opengl_LIBS = @opengl_LIBS@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-release_info = @release_info@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-version_info = @version_info@
-AM_CXXFLAGS = \
-	-fpermissive \
-	-I$(top_srcdir) \
-	-I$(top_srcdir)/hkl \
-	-I$(top_srcdir)/hkl3d \
-	-I$(top_srcdir)/hkl3d/bullet/src \
-	-DPKGDATA=\""$(pkgdatadir)"\" \
-	$(G3D_CFLAGS) \
-	$(GTKGLEXTMM_CFLAGS) \
-	-DG_DISABLE_DEPRECATED \
-	-DGDK_DISABLE_DEPRECATED \
-	-DGDK_PIXBUF_DISABLE_DEPRECATED	\
-	-DGTK_DISABLE_DEPRECATED
-
-AM_CFLAGS = $(AM_CXXFLAGS)
-AM_LDFLAGS = \
-	$(top_builddir)/hkl/libhkl.la \
-	$(top_builddir)/hkl3d/libhkl3d.la \
-	$(top_builddir)/hkl3d/bullet/src/libbulletdynamics.la \
-	$(G3D_LIBS) \
-	$(GLU_LIBS) \
-	$(GTKGLEXTMM_LIBS)
-
-noinst_LTLIBRARIES = libhkl3d-gui.la
-libhkl3d_gui_la_SOURCES = \
-	texture.h \
-	texture.c \
-	hkl3d-gui-gl.h \
-	hkl3d-gui-gl.c \
-	hkl3d-gui-view.h \
-	hkl3d-gui-view.cpp \
-	hkl3d-gui-model.h \
-	hkl3d-gui-model.cpp \
-	hkl3d-gui-scene.h \
-	hkl3d-gui-scene.cpp \
-	trackball.h \
-	trackball.c \
-	GL_ShapeDrawer.h \
-	GL_ShapeDrawer.cpp
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gui/hkl3d/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu gui/hkl3d/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstLTLIBRARIES:
-	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
-	@list='$(noinst_LTLIBRARIES)'; \
-	locs=`for p in $$list; do echo $$p; done | \
-	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
-	      sort -u`; \
-	test -z "$$locs" || { \
-	  echo rm -f $${locs}; \
-	  rm -f $${locs}; \
-	}
-
-libhkl3d-gui.la: $(libhkl3d_gui_la_OBJECTS) $(libhkl3d_gui_la_DEPENDENCIES) $(EXTRA_libhkl3d_gui_la_DEPENDENCIES) 
-	$(AM_V_CXXLD)$(CXXLINK)  $(libhkl3d_gui_la_OBJECTS) $(libhkl3d_gui_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GL_ShapeDrawer.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl3d-gui-gl.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl3d-gui-model.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl3d-gui-scene.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl3d-gui-view.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/texture.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/trackball.Plo at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
-	ctags-am distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am
-
-
-# Support for GNU Flymake, in Emacs.
-check-syntax: AM_CXXFLAGS += -fsyntax-only -pipe
-check-syntax:
-	test -z "$(CHK_SOURCES)" || $(CXXCOMPILE) $(CHK_SOURCES)
-
-.PHONY: check-syntax
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/gui/hkl3d/hkl3d-gui-model.cpp b/gui/hkl3d/hkl3d-gui-model.cpp
deleted file mode 100644
index b240f6b..0000000
--- a/gui/hkl3d/hkl3d-gui-model.cpp
+++ /dev/null
@@ -1,407 +0,0 @@
-/*
- * This file is part of the hkl3d library.
- * inspired from logo-model.c of the GtkGLExt logo models.
- * written by Naofumi Yasufuku  <naofumi at users.sourceforge.net>
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2010-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
- *          Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include "hkl3d-gui-model.h"
-#include "btBulletCollisionCommon.h"
-
-// Trackball utilities.
-
-namespace Trackball {
-	extern "C" {
-#include "trackball.h"
-	}
-}
-namespace GLDRAW {
-	extern "C" {
-#include "hkl3d-gui-gl.h"
-	}
-}
-namespace Hkl3dGui
-{
-	DrawingTools::DrawingTools(Hkl3D *hkl3d)
-		: _hkl3d(hkl3d)
-	{
-		m_shapeDrawer.enableTexture(true);
-	}
-
-	DrawingTools::~DrawingTools(void)
-	{
-	}
-
-	void DrawingTools::draw_line(const btVector3 & from, const btVector3 & to,
-				     const btVector3 & fromColor, const btVector3 & toColor)
-	{
-		glBegin(GL_LINES);
-		glColor3f(fromColor.getX(), fromColor.getY(), fromColor.getZ());
-		glVertex3d(from.getX(), from.getY(), from.getZ());
-		glColor3f(toColor.getX(), toColor.getY(), toColor.getZ());
-		glVertex3d(to.getX(), to.getY(), to.getZ());
-		glEnd();
-	}
-
-	void DrawingTools::draw_line(const btVector3 & from, const btVector3 & to, const btVector3 & color)
-	{
-		draw_line(from, to, color, color);
-	}
-
-	void DrawingTools::draw_Aabb(const btVector3 & from, const btVector3 & to, const btVector3 & color)
-        {
-                btVector3 halfExtents = (to-from)* 0.5f;
-                btVector3 center = (to+from) *0.5f;
-                int i,j;
-
-                btVector3 edgecoord(1.f,1.f,1.f), pa, pb;
-                for (i=0;i<4;i++){
-                        for (j=0;j<3;j++){
-                                pa = btVector3(edgecoord[0]*halfExtents[0], edgecoord[1]*halfExtents[1],
-					       edgecoord[2]*halfExtents[2]);
-                                pa += center;
-
-                                int othercoord = j%3;
-                                edgecoord[othercoord] *= -1.f;
-                                pb = btVector3(edgecoord[0]*halfExtents[0], edgecoord[1]*halfExtents[1],
-					       edgecoord[2]*halfExtents[2]);
-                                pb += center;
-
-                                this->draw_line(pa, pb, color);
-                        }
-                        edgecoord = btVector3(-1.f,-1.f,-1.f);
-                        if (i<3)
-                                edgecoord[i] *= -1.f;
-                }
-        }
-
-	void DrawingTools::draw_AAbbBoxes(void)
-	{
-		int i;
-		int j;
-		glDisable(GL_LIGHTING);
-		for(i=0; i<_hkl3d->config->len; i++)
-			for(j=0; j<_hkl3d->config->models[i]->len; j++){
-				if(!_hkl3d->config->models[i]->objects[j]->hide){
-					Hkl3DObject *object = _hkl3d->config->models[i]->objects[j];
-					btVector3 aabbMin, aabbMax;
-
-					object->btShape->getAabb(object->btObject->getWorldTransform(),
-								 aabbMin, aabbMax);
-					this->draw_Aabb(aabbMin, aabbMax, btVector3(1,0,0));
-				}
-			}
-
-		glFlush();
-	}
-
-	void DrawingTools::draw_collisions(void)
-	{
-		int i;
-		int numManifolds;
-		bool isColliding;
-		btScalar m[16];
-		btVector3 worldBoundsMin;
-		btVector3 worldBoundsMax;
-
-		glDisable(GL_LIGHTING);
-		// get the world bounding box from bullet
-		hkl3d_get_bounding_boxes(_hkl3d, &worldBoundsMin, &worldBoundsMax);
-		///one way to draw all the contact points is iterating over contact manifolds / points:
-		numManifolds = hkl3d_get_nb_manifolds(_hkl3d);
-		for (i=0; i<numManifolds; i++){
-			int numContacts;
-			int j;
-
-			// now draw the manifolds / points
-			numContacts = hkl3d_get_nb_contacts(_hkl3d, i);
-			for (j=0; j<numContacts; j++){
-				double xa, ya, za;
-				double xb, yb, zb;
-
-				hkl3d_get_collision_coordinates(_hkl3d, i, j,
-								&xa, &ya, &za, &xb, &yb, &zb);
-
-				glDisable(GL_DEPTH_TEST);
-				glBegin(GL_LINES);
-				glColor4f(0, 0, 0, 1);
-				glVertex3d(xa, ya, za);
-				glVertex3d(xb, yb, zb);
-				glEnd();
-				glColor4f(1, 0, 0, 1);
-				glPushMatrix();
-				glTranslatef (xb, yb, zb);
-				glScaled(0.05,0.05,0.05);
-				m_shapeDrawer.drawSphere(1, 10, 10);
-				glPopMatrix();
-				glColor4f(1, 1, 0, 1);
-				glPushMatrix();
-				glTranslatef (xa, ya, za);
-				glScaled(0.05,0.05,0.05);
-				m_shapeDrawer.drawSphere(1, 10, 10);
-				glPopMatrix();
-				glEnable(GL_DEPTH_TEST);
-			}
-		}
-		glFlush();
-	}
-
-	void DrawingTools::draw_bullet(void)
-	{
-		int i;
-		int j;
-		btScalar m[16];
-		btVector3 worldBoundsMin;
-		btVector3 worldBoundsMax;
-		btVector3 aabbMin,aabbMax;
-
-		GL_ShapeDrawer::drawCoordSystem();
-
-		/* get the bounding box from bullet */
-		hkl3d_get_bounding_boxes(_hkl3d, &worldBoundsMin, &worldBoundsMax);
-
-		/* draw all visible objects */
-		for(i=0; i<_hkl3d->config->len; i++){
-			for(j=0; j<_hkl3d->config->models[i]->len; j++){
-				Hkl3DObject *object;
-
-				object = _hkl3d->config->models[i]->objects[j];
-				if(!object->hide){
-					btCollisionObject *btObject;
-
-					btObject = object->btObject;
-					btObject->getWorldTransform().getOpenGLMatrix( m );
-					m_shapeDrawer.drawOpenGL(m,
-								 btObject->getCollisionShape(),
-								 *object->color,
-								 0, /* debug mode */
-								 worldBoundsMin,
-								 worldBoundsMax);
-				}
-			}
-		}
-		glFlush();
-	}
-
-	void DrawingTools::draw_g3dmodel(void)
-	{
-		int i;
-		int j;
-
-		/* set the alpha canal to 0.5 if there is a collision */
-		for(i=0; i<_hkl3d->config->len; i++)
-			for(j=0; j<_hkl3d->config->models[i]->len; j++){
-				GSList *faces;
-				G3DFace *face;
-				G3DMaterial *material;
-				double alpha;
-
-				if(_hkl3d->config->models[i]->objects[j]->is_colliding)
-					alpha = 0.5;
-				else
-					alpha = 1;
-
-				faces = _hkl3d->config->models[i]->objects[j]->g3d->faces;
-				while(faces){
-					face = (G3DFace *)(faces->data);
-					face->material->a = alpha;
-					faces = g_slist_next(faces);
-				}
-			}
-
-		/* draw the G3DObjects */
-		GLDRAW::G3DGLRenderOptions *options =  g_new0(GLDRAW::G3DGLRenderOptions, 1);
-		options->glflags = G3D_FLAG_GL_SPECULAR
-			| G3D_FLAG_GL_SHININESS
-			| G3D_FLAG_GL_TEXTURES
-			| G3D_FLAG_GL_COLORS;
-		options->updated = true;
-		options->initialized = false;
-		GL_ShapeDrawer::drawCoordSystem();
-		GLDRAW::gl_draw(options, _hkl3d->model);
-		glFlush();
-	}
-
-	static void draw_g3dObject(G3DObject *object)
-	{
-		GSList *faces;
-		G3DFace *face;
-		float *vertex;
-
-		faces = object->faces;
-		vertex = object->vertex_data;
-
-		glPushMatrix();
-
-		/* apply the transformation of the object */
-		if(object->transformation)
-			glMultMatrixf(object->transformation->matrix);
-
-		/* draw all faces with the current stencil */
-		while(faces){
-			G3DFace * face;
-
-			face = (G3DFace*)faces->data;
-			glBegin(GL_TRIANGLES);
-			glVertex3d(vertex[3*(face->vertex_indices[0])],
-				   vertex[3*(face->vertex_indices[0])+1],
-				   vertex[3*(face->vertex_indices[0])+2]);
-			glVertex3d(vertex[3*(face->vertex_indices[1])],
-				   vertex[3*(face->vertex_indices[1])+1],
-				   vertex[3*(face->vertex_indices[1])+2]);
-			glVertex3d(vertex[3*(face->vertex_indices[2])],
-				   vertex[3*(face->vertex_indices[2])+1],
-				   vertex[3*(face->vertex_indices[2])+2]);
-			glEnd();
-			faces = g_slist_next(faces);
-		}
-
-		glPopMatrix();
-	}
-
-	void DrawingTools::draw_selected(void)
-	{
-		int i;
-		int j;
-
-		for(i=0; i<_hkl3d->config->len; i++)
-			for(j=0; j<_hkl3d->config->models[i]->len; j++){
-				if(_hkl3d->config->models[i]->objects[j]->selected
-				   && !_hkl3d->config->models[i]->objects[j]->hide){
-					// Push the GL attribute bits so that we don't wreck any settings
-					glDisable(GL_LIGHTING);
-					glPushAttrib( GL_ALL_ATTRIB_BITS );
-
-					// Enable polygon offsets, and offset filled polygons forward by 2.5
-					glEnable( GL_POLYGON_OFFSET_FILL );
-					glPolygonOffset( -2.5, -2.5);
-
-					// Set the render mode to be line rendering with a thick line width
-					glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
-					glLineWidth( 3.f );
-					// Set the colour to be pink
-					glColor3f( 1.f, .0f, 1.f );
-					// Render the object
-					draw_g3dObject(_hkl3d->config->models[i]->objects[j]->g3d);
-					// Set the polygon mode to be filled triangles
-					glLineWidth( 1.f );
-					glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
-					// Set the colour to the background
-					glCullFace(GL_FRONT);
-					glColor3f( 0.0f, 0.0f, 0.0f );
-					// Render the object
-					draw_g3dObject(_hkl3d->config->models[i]->objects[j]->g3d);
-
-					// Pop the state changes off the attribute
-					// to set things back how they were
-					glPopAttrib();
-				}
-			}
-		glFlush();
-	}
-
-	ModelDraw::ModelDraw(Hkl3D *hkl3d,
-			     bool enableBulletDraw, bool enableWireframe,
-			     bool enableAAbbBoxDraw, bool enableOrtho)
-		: _hkl3d(hkl3d),
-		  model(new DrawingTools(hkl3d)),
-		  bullet(enableBulletDraw),
-		  wireframe(enableWireframe),
-		  aabb(enableAAbbBoxDraw),
-		  ortho(enableOrtho)
-	{
-		this->reset_anim();
-	}
-
-	ModelDraw::~ModelDraw(void)
-	{
-		delete this->model;
-	}
-
-	void ModelDraw::init_gl(DrawingTools* model)
-	{
-		glNewList(MODEL, GL_COMPILE);
-		this->model->draw_g3dmodel();
-		glEndList();
-		glNewList(BULLET, GL_COMPILE);
-		this->model->draw_bullet();
-		glEndList();
-		glNewList(COLLISION, GL_COMPILE);
-		this->model->draw_collisions();
-		glEndList();
-		glNewList(AABBBOX, GL_COMPILE);
-		this->model->draw_AAbbBoxes();
-		glEndList();
-		glNewList(HIGHLIGHT, GL_COMPILE);
-		this->model->draw_selected();
-		glEndList();
-	}
-
-	void ModelDraw::draw(void)
-	{
-		float m[4][4];
-
-		// Init GL context.
-		init_gl(model);
-
-		// Draw  model.
-		glPushMatrix();
-		glTranslatef(m_Pos[0], m_Pos[1], m_Pos[2]);
-
-		Trackball::build_rotmatrix(m, m_Quat);
-		glMultMatrixf(&m[0][0]);
-		glRotatef(0.0, 0.0, 0.0, 1.0);
-
-		// WireFrame
-		if(this->wireframe){
-			glPolygonMode(GL_FRONT, GL_LINE);
-			glPolygonMode(GL_BACK, GL_LINE);
-		}else{
-			glPolygonMode(GL_FRONT, GL_FILL);
-			glPolygonMode(GL_BACK, GL_FILL);
-		}
-		// AABB Box
-		if(this->aabb)
-			glCallList(AABBBOX);
-
-		// Bullet and G3DModel
-		if(this->bullet)
-			glCallList(BULLET);
-		else
-			glCallList(MODEL);
-		glCallList(COLLISION);
-		glCallList(HIGHLIGHT);
-		glPopMatrix();
-	}
-
-	void ModelDraw::reset_anim(void)
-	{
-		m_Pos[0] = 0.0;
-		m_Pos[1] = 0.0;
-		m_Pos[2] = 0.0;
-
-		m_Quat[0] = 0.0;
-		m_Quat[1] = 0.0;
-		m_Quat[2] = 0.0;
-		m_Quat[3] = 1.0;
-	}
-
-} // namespace Hkl3dGui
diff --git a/gui/hkl3d/hkl3d-gui-model.h b/gui/hkl3d/hkl3d-gui-model.h
deleted file mode 100644
index 41c916b..0000000
--- a/gui/hkl3d/hkl3d-gui-model.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * This file is part of the hkl3d library.
- * inspired from logo-model.c of the GtkGLExt logo models.
- * written by Naofumi Yasufuku  <naofumi at users.sourceforge.net>
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2010-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
- *          Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-
-#ifndef __HKL3D_GUI_MODEL_H__
-#define __HKL3D_GUI_MODEL_H__
-
-#include <gtkmm.h>
-#include <gtkglmm.h>
-
-#include "hkl3d.h"
-#include "GL_ShapeDrawer.h"
-
-namespace Hkl3dGui
-{
-	/* LogoModel class */
-	class DrawingTools
-	{
-	public:
-		DrawingTools(Hkl3D *hkl3d);
-		virtual ~DrawingTools(void);
-		void draw_collisions(void);
-		void draw_g3dmodel(void);
-		void draw_bullet(void);
-		void draw_AAbbBoxes(void);
-		void draw_selected(void);
-
-	private:
-		void draw_Aabb(const btVector3 & from, const btVector3 & to, const btVector3 & color);
-		void draw_line(const btVector3 & from, const btVector3 & to,
-			       const btVector3 & fromColor, const btVector3 & toColor);
-		void draw_line(const btVector3 & from,const btVector3 & to,const btVector3 & color);
-
-	private:
-		Hkl3D *_hkl3d;
-		GL_ShapeDrawer m_shapeDrawer;
-	};
-
-	/* ModelDraw class */
-	class ModelDraw
-	{
-		friend class Scene;
-		friend class DrawingTools;
-
-	public:
-		enum DisplayList {
-			MODEL = 1,
-			BULLET,
-			COLLISION,
-			AABBBOX,
-			HIGHLIGHT
-		};
-
-	public:
-
-		explicit ModelDraw(Hkl3D *hkl3d,
-				   bool enableBulletdraw=false, bool enableWireframe=false,
-				   bool enableAAbbBoxDraw=false, bool enableOrthoView=false);
-		virtual ~ModelDraw(void);
-
-		void draw(void);
-
-		void reset_anim(void);
-
-		void set_pos(float x, float y, float z)
-		{
-			m_Pos[0] = x;
-			m_Pos[1] = y;
-			m_Pos[2] = z;
-		}
-
-		void set_quat(float q0, float q1, float q2, float q3)
-		{
-			m_Quat[0] = q0;
-			m_Quat[1] = q1;
-			m_Quat[2] = q2;
-			m_Quat[3] = q3;
-		}
-
-	public:
-		bool wireframe;
-		bool bullet;
-		bool aabb;
-		bool ortho;
-
-	private:
-		void init_gl(DrawingTools* model);
-
-
-	private:
-		Hkl3D *_hkl3d;
-		DrawingTools *model;
-		float m_Pos[3];
-		float m_Quat[4];
-	};
-
-} // namespace Hkl3dGui
-
-#endif // __HKL3D_GUI_MODEL_H__
diff --git a/gui/hkl3d/hkl3d-gui-scene.cpp b/gui/hkl3d/hkl3d-gui-scene.cpp
deleted file mode 100644
index bb030a3..0000000
--- a/gui/hkl3d/hkl3d-gui-scene.cpp
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
- * This file is part of the hkl3d library.
- * inspired from logo-model.c of the GtkGLExt logo models.
- * written by Naofumi Yasufuku  <naofumi at users.sourceforge.net>
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2010-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
- *          Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-
-#include <iostream>
-
-#include "hkl3d-gui-scene.h"
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// OpenGL frame buffer configuration utilities.
-//
-///////////////////////////////////////////////////////////////////////////////
-
-struct GLConfigUtil
-{
-	static void print_gl_attrib(const Glib::RefPtr<const Gdk::GL::Config>& glconfig,
-				    const char* attrib_str,
-				    int attrib,
-				    bool is_boolean);
-
-	static void examine_gl_attrib(const Glib::RefPtr<const Gdk::GL::Config>& glconfig);
-};
-
-//
-// Print a configuration attribute.
-//
-void GLConfigUtil::print_gl_attrib(const Glib::RefPtr<const Gdk::GL::Config>& glconfig,
-                                   const char* attrib_str,
-                                   int attrib,
-                                   bool is_boolean)
-{
-	int value;
-
-	if (glconfig->get_attrib(attrib, value)){
-		std::cout << attrib_str << " = ";
-		if (is_boolean)
-			std::cout << (value == true ? "true" : "false") << std::endl;
-		else
-			std::cout << value << std::endl;
-	}else{
-		std::cout << "*** Cannot get "
-			  << attrib_str
-			  << " attribute value\n";
-	}
-}
-
-//
-// Print configuration attributes.
-//
-void GLConfigUtil::examine_gl_attrib(const Glib::RefPtr<const Gdk::GL::Config>& glconfig)
-{
-	std::cout << "\nOpenGL visual configurations :\n\n";
-
-	std::cout << "glconfig->is_rgba() = "
-		  << (glconfig->is_rgba() ? "true" : "false")
-		  << std::endl;
-	std::cout << "glconfig->is_double_buffered() = "
-		  << (glconfig->is_double_buffered() ? "true" : "false")
-		  << std::endl;
-	std::cout << "glconfig->is_stereo() = "
-		  << (glconfig->is_stereo() ? "true" : "false")
-		  << std::endl;
-	std::cout << "glconfig->has_alpha() = "
-		  << (glconfig->has_alpha() ? "true" : "false")
-		  << std::endl;
-	std::cout << "glconfig->has_depth_buffer() = "
-		  << (glconfig->has_depth_buffer() ? "true" : "false")
-		  << std::endl;
-	std::cout << "glconfig->has_stencil_buffer() = "
-		  << (glconfig->has_stencil_buffer() ? "true" : "false")
-		  << std::endl;
-	std::cout << "glconfig->has_accum_buffer() = "
-		  << (glconfig->has_accum_buffer() ? "true" : "false")
-		  << std::endl;
-
-	std::cout << std::endl;
-
-	print_gl_attrib(glconfig, "Gdk::GL::USE_GL",           Gdk::GL::USE_GL,           true);
-	print_gl_attrib(glconfig, "Gdk::GL::BUFFER_SIZE",      Gdk::GL::BUFFER_SIZE,      false);
-	print_gl_attrib(glconfig, "Gdk::GL::LEVEL",            Gdk::GL::LEVEL,            false);
-	print_gl_attrib(glconfig, "Gdk::GL::RGBA",             Gdk::GL::RGBA,             true);
-	print_gl_attrib(glconfig, "Gdk::GL::DOUBLEBUFFER",     Gdk::GL::DOUBLEBUFFER,     true);
-	print_gl_attrib(glconfig, "Gdk::GL::STEREO",           Gdk::GL::STEREO,           true);
-	print_gl_attrib(glconfig, "Gdk::GL::AUX_BUFFERS",      Gdk::GL::AUX_BUFFERS,      false);
-	print_gl_attrib(glconfig, "Gdk::GL::RED_SIZE",         Gdk::GL::RED_SIZE,         false);
-	print_gl_attrib(glconfig, "Gdk::GL::GREEN_SIZE",       Gdk::GL::GREEN_SIZE,       false);
-	print_gl_attrib(glconfig, "Gdk::GL::BLUE_SIZE",        Gdk::GL::BLUE_SIZE,        false);
-	print_gl_attrib(glconfig, "Gdk::GL::ALPHA_SIZE",       Gdk::GL::ALPHA_SIZE,       false);
-	print_gl_attrib(glconfig, "Gdk::GL::DEPTH_SIZE",       Gdk::GL::DEPTH_SIZE,       false);
-	print_gl_attrib(glconfig, "Gdk::GL::STENCIL_SIZE",     Gdk::GL::STENCIL_SIZE,     false);
-	print_gl_attrib(glconfig, "Gdk::GL::ACCUM_RED_SIZE",   Gdk::GL::ACCUM_RED_SIZE,   false);
-	print_gl_attrib(glconfig, "Gdk::GL::ACCUM_GREEN_SIZE", Gdk::GL::ACCUM_GREEN_SIZE, false);
-	print_gl_attrib(glconfig, "Gdk::GL::ACCUM_BLUE_SIZE",  Gdk::GL::ACCUM_BLUE_SIZE,  false);
-	print_gl_attrib(glconfig, "Gdk::GL::ACCUM_ALPHA_SIZE", Gdk::GL::ACCUM_ALPHA_SIZE, false);
-
-	std::cout << std::endl;
-}
-
-namespace  Hkl3dGui
-{
-	//
-	// Scene class implementation.
-	//
-	const unsigned int Scene::TIMEOUT_INTERVAL = 100000000;
-
-	const float Scene::CLEAR_COLOR[4] = { 0.9, 0.8, 0.6, 1.0 };
-	const float Scene::CLEAR_DEPTH    = 1.0;
-
-	const float Scene::LIGHT0_POSITION[4] = { 0.0, 0.0, 30.0, 0.0 };
-	const float Scene::LIGHT0_DIFFUSE[4]  = { 1.0, 1.0, 1.0, 1.0 };
-	const float Scene::LIGHT0_SPECULAR[4] = { 1.0, 1.0, 1.0, 1.0 };
-
-	Scene::Scene(Hkl3D *hkl3d, bool enableBulletDraw, bool enableWireframe, bool enableAAbbBoxDraw, bool enableOrthoView)
-		: m_Menu(0), m_Model(hkl3d, enableBulletDraw, enableWireframe, enableAAbbBoxDraw, enableOrthoView)
-	{
-		//
-		// Configure OpenGL-capable visual.
-		//
-		Glib::RefPtr<Gdk::GL::Config> glconfig;
-
-		// Try double-buffered visual
-		glconfig = Gdk::GL::Config::create(Gdk::GL::MODE_RGB    |
-						   Gdk::GL::MODE_DEPTH  |
-						   Gdk::GL::MODE_DOUBLE);
-		if (!glconfig) {
-			std::cerr << "*** Cannot find the double-buffered visual.\n"
-				  << "*** Trying single-buffered visual.\n";
-
-			// Try single-buffered visual
-			glconfig = Gdk::GL::Config::create(Gdk::GL::MODE_RGB   |
-							   Gdk::GL::MODE_DEPTH);
-			if (!glconfig) {
-				std::cerr << "*** Cannot find any OpenGL-capable visual.\n";
-				std::exit(1);
-			}
-		}
-
-		// print frame buffer attributes.
-		GLConfigUtil::examine_gl_attrib(glconfig);
-
-		//
-		// Set OpenGL-capability to the widget.
-		//
-		this->set_gl_capability(glconfig);
-
-		//
-		// Add events.
-		//
-		this->add_events(Gdk::BUTTON1_MOTION_MASK    |
-				 Gdk::BUTTON2_MOTION_MASK    |
-				 Gdk::BUTTON_PRESS_MASK      |
-				 Gdk::VISIBILITY_NOTIFY_MASK);
-
-		// View transformation signals.
-		signal_button_press_event().connect(
-			sigc::bind(sigc::mem_fun(m_View, &View::on_button_press_event), this));
-		signal_motion_notify_event().connect(
-			sigc::bind(sigc::mem_fun(m_View, &View::on_motion_notify_event), this));
-		signal_scroll_event().connect(
-			sigc::bind(sigc::mem_fun(m_View, &View::zoom_scroll), this));
-
-		//
-		// Popup menu.
-		//
-		m_Menu = this->create_popup_menu();
-	}
-
-	Scene::~Scene(void)
-	{
-	}
-
-	void Scene::on_realize(void)
-	{
-		// We need to call the base on_realize()
-		Gtk::DrawingArea::on_realize();
-
-		//
-		// Get GL::Drawable.
-		//
-		Glib::RefPtr<Gdk::GL::Drawable> gldrawable = this->get_gl_drawable();
-
-		//
-		// GL calls.
-		//
-		// *** OpenGL BEGIN ***
-		if (!gldrawable->gl_begin(this->get_gl_context()))
-			return;
-
-		glClearColor(CLEAR_COLOR[0], CLEAR_COLOR[1], CLEAR_COLOR[2], CLEAR_COLOR[3]);
-		glClearDepth(CLEAR_DEPTH);
-
-		glLightfv(GL_LIGHT0, GL_POSITION, LIGHT0_POSITION);
-		glLightfv(GL_LIGHT0, GL_DIFFUSE,  LIGHT0_DIFFUSE);
-		glLightfv(GL_LIGHT0, GL_SPECULAR, LIGHT0_SPECULAR);
-
-		glEnable(GL_LIGHTING);
-		glEnable(GL_LIGHT0);
-
-		glEnable(GL_DEPTH_TEST);
-
-		glShadeModel(GL_SMOOTH);
-
-		gldrawable->gl_end();
-		// *** OpenGL END ***
-	}
-
-	bool Scene::on_configure_event(GdkEventConfigure* event)
-	{
-		//
-		// Get GL::Drawable.
-		//
-		Glib::RefPtr<Gdk::GL::Drawable> gldrawable = this->get_gl_drawable();
-
-		//
-		// GL calls.
-		//
-		// *** OpenGL BEGIN ***
-		if (!gldrawable->gl_begin(this->get_gl_context()))
-			return false;
-
-		m_View.frustum(this->get_width(), this->get_height());
-
-		gldrawable->gl_end();
-		// *** OpenGL END ***
-
-		return true;
-	}
-
-	bool Scene::on_expose_event(GdkEventExpose* event)
-	{
-		//
-		// Get GL::Drawable.
-		//
-		Glib::RefPtr<Gdk::GL::Drawable> gldrawable = get_gl_drawable();
-
-		//
-		// GL calls.
-		//
-		// *** OpenGL BEGIN ***
-		if (!gldrawable->gl_begin(get_gl_context()))
-			return false;
-
-		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
-		glLoadIdentity();
-
-		// View transformation.
-		m_View.xform();
-
-		// model.
-		m_Model.draw();
-
-		// Swap buffers.
-		if (gldrawable->is_double_buffered())
-			gldrawable->swap_buffers();
-		else
-			glFlush();
-
-		gldrawable->gl_end();
-		// *** OpenGL END ***
-
-		return true;
-	}
-
-	bool Scene::on_button_press_event(GdkEventButton* event)
-	{
-		if (event->button == 3) {
-			m_Menu->popup(event->button, event->time);
-			return true;
-		}
-
-		// don't block
-		return false;
-	}
-
-	bool Scene::on_map_event(GdkEventAny* event)
-	{
-		if (m_Model.bullet)
-			this->timeout_add();
-
-		return true;
-	}
-
-	bool Scene::on_unmap_event(GdkEventAny* event)
-	{
-		this->timeout_remove();
-
-		return true;
-	}
-
-	bool Scene::on_visibility_notify_event(GdkEventVisibility* event)
-	{
-		if (m_Model.bullet) {
-			if (event->state == GDK_VISIBILITY_FULLY_OBSCURED)
-
-				this->timeout_add();
-		}
-
-		return true;
-	}
-
-	bool Scene::on_timeout(void)
-	{
-		// Invalidate whole window.
-		this->invalidate();
-		// Update window synchronously (fast).
-		this->update();
-
-		return true;
-	}
-
-	void Scene::timeout_add(void)
-	{
-		if (!m_ConnectionTimeout.connected())
-			m_ConnectionTimeout = Glib::signal_timeout().connect(
-				sigc::mem_fun(*this, &Scene::on_timeout), TIMEOUT_INTERVAL);
-	}
-
-	void Scene::timeout_remove(void)
-	{
-		if (m_ConnectionTimeout.connected())
-			m_ConnectionTimeout.disconnect();
-	}
-
-	void Scene::bulletDraw(void)
-	{
-		if (m_Model.bullet) {
-			m_Model.bullet = false;
-			this->timeout_remove();
-		}else{
-			m_Model.bullet = true;
-			this->timeout_add();
-		}
-	}
-
-	void Scene::wireframe_view(void)
-	{
-		m_Model.wireframe = !m_Model.wireframe;
-	}
-
-	void Scene::orthoView(void)
-	{
-		if (m_Model.ortho){
-			m_View.frustum(this->get_width(), this->get_height());
-			m_Model.ortho = false;
-		}else{
-			m_View.ortho(this->get_width(), this->get_height());
-			m_Model.ortho = true;
-		}
-	}
-
-	void Scene::AAbbBoxDraw(void)
-	{
-		if (m_Model.aabb) {
-			m_Model.aabb = false;
-			if (m_Model.bullet)
-				this->timeout_add();
-			else
-				this->timeout_remove();
-		}else{
-			m_Model.aabb = true;
-			this->timeout_add();
-		}
-	}
-
-	void Scene::init_anim(void)
-	{
-		m_View.reset();
-		m_Model.reset_anim();
-
-		this->invalidate();
-	}
-
-	Gtk::Menu* Scene::create_popup_menu(void)
-	{
-		Gtk::Menu* menu = Gtk::manage(new Gtk::Menu());
-
-		Gtk::Menu::MenuList& menu_list = menu->items();
-
-		// Enable/Disable Bullet Draw
-		menu_list.push_back(
-			Gtk::Menu_Helpers::MenuElem("Enable/Disable Bullet Draw",
-						    sigc::mem_fun(*this, &Scene::bulletDraw)));
-		// Wireframe
-		menu_list.push_back(
-			Gtk::Menu_Helpers::MenuElem("Wireframe",
-						    sigc::mem_fun(*this, &Scene::wireframe_view)));
-		// Ortho view
-		menu_list.push_back(
-			Gtk::Menu_Helpers::MenuElem("Enable/Disable Ortho View",
-						    sigc::mem_fun(*this, &Scene::orthoView)));
-		// AAbbBox
-		menu_list.push_back(
-			Gtk::Menu_Helpers::MenuElem("Render AABB box",
-						    sigc::mem_fun(*this, &Scene::AAbbBoxDraw)));
-		// Init orientation
-		menu_list.push_back(
-			Gtk::Menu_Helpers::MenuElem("Initialize",
-						    sigc::mem_fun(*this, &Scene::init_anim)));
-
-		// Quit
-		menu_list.push_back(
-			Gtk::Menu_Helpers::MenuElem("Quit",
-						    sigc::ptr_fun(&Gtk::Main::quit)));
-
-		return menu;
-	}
-
-} // namespace  Hkl3dGui
diff --git a/gui/hkl3d/hkl3d-gui-scene.h b/gui/hkl3d/hkl3d-gui-scene.h
deleted file mode 100644
index 0af4c6d..0000000
--- a/gui/hkl3d/hkl3d-gui-scene.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * This file is part of the hkl3d library.
- * inspired from logo-model.c of the GtkGLExt logo models.
- * written by Naofumi Yasufuku  <naofumi at users.sourceforge.net>
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2010-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
- *          Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-
-#ifndef __HKL3D_GUI_SCENE_H__
-#define __HKL3D_GUI_SCENE_H__
-
-#include <gtkmm.h>
-#include <gtkglmm.h>
-
-#include "hkl3d-gui-view.h"
-#include "hkl3d-gui-model.h"
-
-namespace Hkl3dGui
-{
-	class Scene : public Gtk::GL::DrawingArea
-	{
-	public:
-		static const unsigned int TIMEOUT_INTERVAL;
-
-		// OpenGL scene related constants:
-		static const float CLEAR_COLOR[4];
-		static const float CLEAR_DEPTH;
-
-		static const float LIGHT0_POSITION[4];
-		static const float LIGHT0_DIFFUSE[4];
-		static const float LIGHT0_SPECULAR[4];
-
-	public:
-		explicit Scene(Hkl3D *hkl3d,
-			       bool enableBulletDraw=false, bool enableWireframe=false,
-			       bool enableAAbbBoxDraw=false, bool enableOrthoView=false);
-		virtual ~Scene(void);
-
-	protected:
-		// signal handlers:
-		virtual void on_realize(void);
-		virtual bool on_configure_event(GdkEventConfigure* event);
-		virtual bool on_expose_event(GdkEventExpose* event);
-		virtual bool on_button_press_event(GdkEventButton* event);
-		virtual bool on_map_event(GdkEventAny* event);
-		virtual bool on_unmap_event(GdkEventAny* event);
-		virtual bool on_visibility_notify_event(GdkEventVisibility* event);
-		virtual bool on_timeout(void);
-
-	public:
-		// Invalidate whole window.
-		void invalidate(void)
-		{
-			this->get_window()->invalidate_rect(get_allocation(), false);
-		}
-
-		// Update window synchronously (fast).
-		void update(void)
-		{
-			this->get_window()->process_updates(false);
-		}
-
-	protected:
-		// timeout signal connection:
-		sigc::connection m_ConnectionTimeout;
-
-		void timeout_add(void);
-		void timeout_remove(void);
-
-	public:
-		// OpenGL scene related methods:
-		bool BulletDraw_is_enabled(void) const
-		{
-			return m_Model.bullet;
-		}
-		bool wireframe_is_enabled(void) const
-		{
-			return m_Model.wireframe;
-		}
-		bool aabbBoxDraw_is_enabled(void) const
-		{
-			return m_Model.aabb;
-		}
-		void orthoView(void);
-		void bulletDraw(void);
-		void wireframe_view(void);
-		void AAbbBoxDraw(void);
-		void init_anim(void);
-
-	protected:
-		Gtk::Menu* create_popup_menu(void);
-
-		// Popup menu:
-		Gtk::Menu* m_Menu;
-
-		// OpenGL scene related objects:
-		View m_View;
-		ModelDraw m_Model;
-	};
-}//namespace  Hkl3dGui
-
-#endif //__HKL3D_GUI_SCENE_H__
diff --git a/gui/hkl3d/hkl3d-gui-view.cpp b/gui/hkl3d/hkl3d-gui-view.cpp
deleted file mode 100644
index eb90965..0000000
--- a/gui/hkl3d/hkl3d-gui-view.cpp
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * This file is part of the hkl3d library.
- * inspired from logo-model.c of the GtkGLExt logo models.
- * written by Naofumi Yasufuku  <naofumi at users.sourceforge.net>
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2010-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
- *          Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-
-#include "hkl3d-gui-view.h"
-#include "hkl3d-gui-scene.h"
-
-//
-// Trackball utilities.
-//
-namespace Trackball {
-	extern "C" {
-#include "trackball.h"
-	}
-}
-
-#define DIG_2_RAD (G_PI / 180.0)
-#define RAD_2_DIG (180.0 / G_PI)
-
-namespace  Hkl3dGui
-{
-	//
-	// View class implementation.
-	//
-	const float View::NEAR_CLIP   = 2.0;
-	const float View::FAR_CLIP    = 60.0;
-
-	const float View::INIT_POS_X  = 0.0;
-	const float View::INIT_POS_Y  = 0.0;
-	const float View::INIT_POS_Z  = -30.0;
-
-	const float View::INIT_AXIS_X = 0.0;
-	const float View::INIT_AXIS_Y = 0.0;
-	const float View::INIT_AXIS_Z = 0.0;
-	const float View::INIT_ANGLE  = 0.0;
-
-	const float View::INIT_SCALE  = 7.0;
-
-	const float View::SCALE_MAX   = 50.0;
-	const float View::SCALE_MIN   = 1.0;
-
-	View::View(void)
-		: m_Scale(INIT_SCALE), m_BeginX(0.0), m_BeginY(0.0)
-	{
-		this->reset();
-	}
-
-	View::~View(void)
-	{
-	}
-
-	void View::frustum(int w, int h)
-	{
-		glViewport(0, 0, w, h);
-
-		glMatrixMode(GL_PROJECTION);
-		glLoadIdentity();
-
-		if (w > h) {
-			float aspect = static_cast<float>(w) / static_cast<float>(h);
-			glFrustum(-aspect, aspect, -1.0, 1.0, NEAR_CLIP, FAR_CLIP);
-		}else{
-			float aspect = static_cast<float>(h) / static_cast<float>(w);
-			glFrustum(-1.0, 1.0, -aspect, aspect, NEAR_CLIP, FAR_CLIP);
-		}
-
-		glMatrixMode(GL_MODELVIEW);
-	}
-	void View::ortho(int w, int h)
-	{
-		glMatrixMode(GL_PROJECTION);
-		glLoadIdentity();
-
-		glOrtho(-w/40, w/40 , -h/40 , h/40 , -1, 100);
-
-		glMatrixMode(GL_MODELVIEW);
-	}
-	void View::xform(void)
-	{
-		glTranslatef(m_Pos[0], m_Pos[1], m_Pos[2]);
-
-		glScalef(m_Scale, m_Scale, m_Scale);
-
-		float m[4][4];
-		Trackball::build_rotmatrix(m, m_Quat);
-		glMultMatrixf(&m[0][0]);
-
-	}
-
-	void View::reset(void)
-	{
-		m_Pos[0] = INIT_POS_X;
-		m_Pos[1] = INIT_POS_Y;
-		m_Pos[2] = INIT_POS_Z;
-
-		float sine = sin(0.5 * INIT_ANGLE * DIG_2_RAD);
-		m_Quat[0] = INIT_AXIS_X * sine;
-		m_Quat[1] = INIT_AXIS_Y * sine;
-		m_Quat[2] = INIT_AXIS_Z * sine;
-		m_Quat[3] = cos(0.5 * INIT_ANGLE * DIG_2_RAD);
-
-		m_Scale = INIT_SCALE;
-	}
-
-	bool View::on_button_press_event(GdkEventButton* event,
-					 Scene* scene)
-	{
-		m_BeginX = event->x;
-		m_BeginY = event->y;
-
-		// don't block
-		return false;
-	}
-	bool View::zoom_scroll(GdkEventScroll *event,Scene* scene)
-	{
-		float x = event->x;
-		float y = event->y;
-		float w = scene->get_width();
-		float h = scene->get_height();
-		bool redraw = false;
-
-		if (scene == 0)
-			return false;
-
-
-		if(event->direction == GDK_SCROLL_DOWN)
-			m_Scale +=1;
-		else
-			m_Scale -=1;
-
-		if (m_Scale > SCALE_MAX)
-			m_Scale = SCALE_MAX;
-		else if (m_Scale < SCALE_MIN)
-			m_Scale = SCALE_MIN;
-		redraw = true;
-
-		if (redraw && !scene->BulletDraw_is_enabled())
-			scene->invalidate();
-
-
-		return false;
-	}
-	bool View::on_motion_notify_event(GdkEventMotion* event,
-					  Scene* scene)
-	{
-		if (scene == 0)
-			return false;
-
-		float w = scene->get_width();
-		float h = scene->get_height();
-		float x = event->x;
-		float y = event->y;
-		float d_quat[4];
-		bool redraw = false;
-
-		// Translation && Rotation.
-		if (event->state & GDK_BUTTON1_MASK) {
-			if(event->state & GDK_SHIFT_MASK)
-			{
-				/* shift pressed, translate view */
-				m_Pos[0]+=
-					(gdouble)(x - m_BeginX ) /
-					(gdouble)(m_Scale * 10);
-				m_Pos[1]-=
-					(gdouble)(y - m_BeginY) /
-					(gdouble)(m_Scale * 10);
-				redraw = true;
-			}
-			else{
-				Trackball::trackball(d_quat,
-						     (2.0 * m_BeginX - w) / w,
-						     (h - 2.0 * m_BeginY) / h,
-						     (2.0 * x - w) / w,
-						     (h - 2.0 * y) / h);
-				Trackball::add_quats(d_quat, m_Quat, m_Quat);
-				redraw = true;
-			}
-
-		}
-
-		// Scaling.
-		if (event->state & GDK_BUTTON2_MASK) {
-			m_Scale = m_Scale * (1.0 + (y - m_BeginY) / h);
-			if (m_Scale > SCALE_MAX)
-				m_Scale = SCALE_MAX;
-			else if (m_Scale < SCALE_MIN)
-				m_Scale = SCALE_MIN;
-			redraw = true;
-		}
-
-		m_BeginX = x;
-		m_BeginY = y;
-
-		if (redraw && !scene->BulletDraw_is_enabled())
-			scene->invalidate();
-
-		// don't block
-		return false;
-	}
-} //namespace  Hkl3dGui
diff --git a/gui/hkl3d/hkl3d-gui-view.h b/gui/hkl3d/hkl3d-gui-view.h
deleted file mode 100644
index 7d8415e..0000000
--- a/gui/hkl3d/hkl3d-gui-view.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * This file is part of the hkl3d library.
- * inspired from logo-model.c of the GtkGLExt logo models.
- * written by Naofumi Yasufuku  <naofumi at users.sourceforge.net>
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2010-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
- *          Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-
-#ifndef __HKL3D_GUI_VIEW_H__
-#define __HKL3D_GUI_VIEW_H__
-
-#include <gtkmm.h>
-#include <gtkglmm.h>
-
-//#include "GlutDemoApplication.h"
-//#include "hkl3d.h"
-
-namespace  Hkl3dGui
-{
-	class Scene;
-
-	class View : public sigc::trackable
-	{
-		friend class Scene;
-
-	public:
-		static const float NEAR_CLIP;
-		static const float FAR_CLIP;
-
-		static const float INIT_POS_X;
-		static const float INIT_POS_Y;
-		static const float INIT_POS_Z;
-
-		static const float INIT_AXIS_X;
-		static const float INIT_AXIS_Y;
-		static const float INIT_AXIS_Z;
-		static const float INIT_ANGLE;
-
-		static const float INIT_SCALE;
-
-		static const float SCALE_MAX;
-		static const float SCALE_MIN;
-
-	public:
-		View(void);
-		virtual ~View(void);
-
-	public:
-		void frustum(int w, int h);
-		void ortho(int w, int h);
-		void xform(void);
-
-		void reset(void);
-
-		void set_pos(float x, float y, float z)
-		{
-			m_Pos[0] = x;
-			m_Pos[1] = y;
-			m_Pos[2] = z;
-		}
-
-		void set_quat(float q0, float q1, float q2, float q3)
-		{
-			m_Quat[0] = q0;
-			m_Quat[1] = q1;
-			m_Quat[2] = q2;
-			m_Quat[3] = q3;
-		}
-
-		void set_scale(float scale)
-		{
-			m_Scale = scale;
-		}
-
-	protected:
-		// Signal handlers:
-		virtual bool zoom_scroll(GdkEventScroll *event ,Scene* scene);
-		virtual bool on_button_press_event(GdkEventButton* event, Scene* scene);
-		virtual bool on_motion_notify_event(GdkEventMotion* event, Scene* scene);
-
-	private:
-		float m_Pos[3];
-		float m_Quat[4];
-		float m_Scale;
-
-		float m_BeginX;
-		float m_BeginY;
-	};
-} // namespace  Hkl3dGui
-
-#endif // __HKL3D_GUI_VIEW_H__
diff --git a/gui/hkl3d/texture.c b/gui/hkl3d/texture.c
deleted file mode 100644
index 0dfb83a..0000000
--- a/gui/hkl3d/texture.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* $Id: texture.c 42 2006-05-22 13:31:45Z mmmaddd $ */
-
-/*
-	G3DViewer - 3D object viewer
-
-	Copyright (C) 2005, 2006  Markus Dahms <mad at automagically.de>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#ifdef HAVE_CONFIG_H
-#	include <config.h>
-#endif
-
-#include <stdlib.h>
-
-#include <g3d/g3d.h>
-
-#include "hkl3d-gui-gl.h"
-
-int texture_load_all_textures(G3DModel *model)
-{
-	if(model == NULL) return EXIT_FAILURE;
-
-	if(model->tex_images != NULL)
-		g_hash_table_foreach(model->tex_images,
-			gl_load_texture, NULL);
-
-	return EXIT_SUCCESS;
-}
diff --git a/gui/hkl3d/texture.h b/gui/hkl3d/texture.h
deleted file mode 100644
index 327fed8..0000000
--- a/gui/hkl3d/texture.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* $Id: texture.h 84 2008-04-04 19:39:21Z mmmaddd $ */
-
-/*
-	G3DViewer - 3D object viewer
-
-	Copyright (C) 2005, 2006  Markus Dahms <mad at automagically.de>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#ifndef _TEXTURE_H
-#define _TEXTURE_H
-
-#include <g3d/g3d.h>
-
-int texture_load_all_textures(G3DModel *model);
-
-#endif
diff --git a/gui/hkl3d/trackball.c b/gui/hkl3d/trackball.c
deleted file mode 100644
index c984dd1..0000000
--- a/gui/hkl3d/trackball.c
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * (c) Copyright 1993, 1994, Silicon Graphics, Inc.
- * ALL RIGHTS RESERVED
- * Permission to use, copy, modify, and distribute this software for
- * any purpose and without fee is hereby granted, provided that the above
- * copyright notice appear in all copies and that both the copyright notice
- * and this permission notice appear in supporting documentation, and that
- * the name of Silicon Graphics, Inc. not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.
- *
- * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
- * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
- * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
- * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
- * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
- * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
- * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
- * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
- * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
- * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * US Government Users Restricted Rights
- * Use, duplication, or disclosure by the Government is subject to
- * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
- * (c)(1)(ii) of the Rights in Technical Data and Computer Software
- * clause at DFARS 252.227-7013 and/or in similar or successor
- * clauses in the FAR or the DOD or NASA FAR Supplement.
- * Unpublished-- rights reserved under the copyright laws of the
- * United States.  Contractor/manufacturer is Silicon Graphics,
- * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
- *
- * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
- */
-/*
- * Trackball code:
- *
- * Implementation of a virtual trackball.
- * Implemented by Gavin Bell, lots of ideas from Thant Tessman and
- *   the August '88 issue of Siggraph's "Computer Graphics," pp. 121-129.
- *
- * Vector manip code:
- *
- * Original code from:
- * David M. Ciemiewicz, Mark Grossman, Henry Moreton, and Paul Haeberli
- *
- * Much mucking with by:
- * Gavin Bell
- */
-#include <math.h>
-#include "trackball.h"
-
-/*
- * This size should really be based on the distance from the center of
- * rotation to the point on the object underneath the mouse.  That
- * point would then track the mouse as closely as possible.  This is a
- * simple example, though, so that is left as an Exercise for the
- * Programmer.
- */
-#define TRACKBALLSIZE  (0.8)
-
-/*
- * Local function prototypes (not defined in trackball.h)
- */
-static float tb_project_to_sphere(float, float, float);
-static void normalize_quat(float [4]);
-
-void
-vzero(float *v)
-{
-    v[0] = 0.0;
-    v[1] = 0.0;
-    v[2] = 0.0;
-}
-
-void
-vset(float *v, float x, float y, float z)
-{
-    v[0] = x;
-    v[1] = y;
-    v[2] = z;
-}
-
-void
-vsub(const float *src1, const float *src2, float *dst)
-{
-    dst[0] = src1[0] - src2[0];
-    dst[1] = src1[1] - src2[1];
-    dst[2] = src1[2] - src2[2];
-}
-
-void
-vcopy(const float *v1, float *v2)
-{
-    register int i;
-    for (i = 0 ; i < 3 ; i++)
-        v2[i] = v1[i];
-}
-
-void
-vcross(const float *v1, const float *v2, float *cross)
-{
-    float temp[3];
-
-    temp[0] = (v1[1] * v2[2]) - (v1[2] * v2[1]);
-    temp[1] = (v1[2] * v2[0]) - (v1[0] * v2[2]);
-    temp[2] = (v1[0] * v2[1]) - (v1[1] * v2[0]);
-    vcopy(temp, cross);
-}
-
-float
-vlength(const float *v)
-{
-    return sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
-}
-
-void
-vscale(float *v, float div)
-{
-    v[0] *= div;
-    v[1] *= div;
-    v[2] *= div;
-}
-
-void
-vnormal(float *v)
-{
-    vscale(v,1.0/vlength(v));
-}
-
-float
-vdot(const float *v1, const float *v2)
-{
-    return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2];
-}
-
-void
-vadd(const float *src1, const float *src2, float *dst)
-{
-    dst[0] = src1[0] + src2[0];
-    dst[1] = src1[1] + src2[1];
-    dst[2] = src1[2] + src2[2];
-}
-
-/*
- * Ok, simulate a track-ball.  Project the points onto the virtual
- * trackball, then figure out the axis of rotation, which is the cross
- * product of P1 P2 and O P1 (O is the center of the ball, 0,0,0)
- * Note:  This is a deformed trackball-- is a trackball in the center,
- * but is deformed into a hyperbolic sheet of rotation away from the
- * center.  This particular function was chosen after trying out
- * several variations.
- *
- * It is assumed that the arguments to this routine are in the range
- * (-1.0 ... 1.0)
- */
-void
-trackball(float q[4], float p1x, float p1y, float p2x, float p2y)
-{
-    float a[3]; /* Axis of rotation */
-    float phi;  /* how much to rotate about axis */
-    float p1[3], p2[3], d[3];
-    float t;
-
-    if (p1x == p2x && p1y == p2y) {
-        /* Zero rotation */
-        vzero(q);
-        q[3] = 1.0;
-        return;
-    }
-
-    /*
-     * First, figure out z-coordinates for projection of P1 and P2 to
-     * deformed sphere
-     */
-    vset(p1,p1x,p1y,tb_project_to_sphere(TRACKBALLSIZE,p1x,p1y));
-    vset(p2,p2x,p2y,tb_project_to_sphere(TRACKBALLSIZE,p2x,p2y));
-
-    /*
-     *  Now, we want the cross product of P1 and P2
-     */
-    vcross(p2,p1,a);
-
-    /*
-     *  Figure out how much to rotate around that axis.
-     */
-    vsub(p1,p2,d);
-    t = vlength(d) / (2.0*TRACKBALLSIZE);
-
-    /*
-     * Avoid problems with out-of-control values...
-     */
-    if (t > 1.0) t = 1.0;
-    if (t < -1.0) t = -1.0;
-    phi = 2.0 * asin(t);
-
-    axis_to_quat(a,phi,q);
-}
-
-/*
- *  Given an axis and angle, compute quaternion.
- */
-void
-axis_to_quat(float a[3], float phi, float q[4])
-{
-    vnormal(a);
-    vcopy(a,q);
-    vscale(q,sin(phi/2.0));
-    q[3] = cos(phi/2.0);
-}
-
-/*
- * Project an x,y pair onto a sphere of radius r OR a hyperbolic sheet
- * if we are away from the center of the sphere.
- */
-static float
-tb_project_to_sphere(float r, float x, float y)
-{
-    float d, t, z;
-
-    d = sqrt(x*x + y*y);
-    if (d < r * 0.70710678118654752440) {    /* Inside sphere */
-        z = sqrt(r*r - d*d);
-    } else {           /* On hyperbola */
-        t = r / 1.41421356237309504880;
-        z = t*t / d;
-    }
-    return z;
-}
-
-/*
- * Given two rotations, e1 and e2, expressed as quaternion rotations,
- * figure out the equivalent single rotation and stuff it into dest.
- *
- * This routine also normalizes the result every RENORMCOUNT times it is
- * called, to keep error from creeping in.
- *
- * NOTE: This routine is written so that q1 or q2 may be the same
- * as dest (or each other).
- */
-
-#define RENORMCOUNT 97
-
-void
-add_quats(float q1[4], float q2[4], float dest[4])
-{
-    static int count=0;
-    float t1[4], t2[4], t3[4];
-    float tf[4];
-
-    vcopy(q1,t1);
-    vscale(t1,q2[3]);
-
-    vcopy(q2,t2);
-    vscale(t2,q1[3]);
-
-    vcross(q2,q1,t3);
-    vadd(t1,t2,tf);
-    vadd(t3,tf,tf);
-    tf[3] = q1[3] * q2[3] - vdot(q1,q2);
-
-    dest[0] = tf[0];
-    dest[1] = tf[1];
-    dest[2] = tf[2];
-    dest[3] = tf[3];
-
-    if (++count > RENORMCOUNT) {
-        count = 0;
-        normalize_quat(dest);
-    }
-}
-
-/*
- * Quaternions always obey:  a^2 + b^2 + c^2 + d^2 = 1.0
- * If they don't add up to 1.0, dividing by their magnitued will
- * renormalize them.
- *
- * Note: See the following for more information on quaternions:
- *
- * - Shoemake, K., Animating rotation with quaternion curves, Computer
- *   Graphics 19, No 3 (Proc. SIGGRAPH'85), 245-254, 1985.
- * - Pletinckx, D., Quaternion calculus as a basic tool in computer
- *   graphics, The Visual Computer 5, 2-13, 1989.
- */
-static void
-normalize_quat(float q[4])
-{
-    int i;
-    float mag;
-
-    mag = (q[0]*q[0] + q[1]*q[1] + q[2]*q[2] + q[3]*q[3]);
-    for (i = 0; i < 4; i++) q[i] /= mag;
-}
-
-/*
- * Build a rotation matrix, given a quaternion rotation.
- *
- */
-void
-build_rotmatrix(float m[4][4], float q[4])
-{
-    m[0][0] = 1.0 - 2.0 * (q[1] * q[1] + q[2] * q[2]);
-    m[0][1] = 2.0 * (q[0] * q[1] - q[2] * q[3]);
-    m[0][2] = 2.0 * (q[2] * q[0] + q[1] * q[3]);
-    m[0][3] = 0.0;
-
-    m[1][0] = 2.0 * (q[0] * q[1] + q[2] * q[3]);
-    m[1][1]= 1.0 - 2.0 * (q[2] * q[2] + q[0] * q[0]);
-    m[1][2] = 2.0 * (q[1] * q[2] - q[0] * q[3]);
-    m[1][3] = 0.0;
-
-    m[2][0] = 2.0 * (q[2] * q[0] - q[1] * q[3]);
-    m[2][1] = 2.0 * (q[1] * q[2] + q[0] * q[3]);
-    m[2][2] = 1.0 - 2.0 * (q[1] * q[1] + q[0] * q[0]);
-    m[2][3] = 0.0;
-
-    m[3][0] = 0.0;
-    m[3][1] = 0.0;
-    m[3][2] = 0.0;
-    m[3][3] = 1.0;
-}
diff --git a/gui/hkl3d/trackball.h b/gui/hkl3d/trackball.h
deleted file mode 100644
index b9d9494..0000000
--- a/gui/hkl3d/trackball.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * (c) Copyright 1993, 1994, Silicon Graphics, Inc.
- * ALL RIGHTS RESERVED
- * Permission to use, copy, modify, and distribute this software for
- * any purpose and without fee is hereby granted, provided that the above
- * copyright notice appear in all copies and that both the copyright notice
- * and this permission notice appear in supporting documentation, and that
- * the name of Silicon Graphics, Inc. not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.
- *
- * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
- * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
- * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
- * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
- * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
- * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
- * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
- * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
- * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
- * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * US Government Users Restricted Rights
- * Use, duplication, or disclosure by the Government is subject to
- * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
- * (c)(1)(ii) of the Rights in Technical Data and Computer Software
- * clause at DFARS 252.227-7013 and/or in similar or successor
- * clauses in the FAR or the DOD or NASA FAR Supplement.
- * Unpublished-- rights reserved under the copyright laws of the
- * United States.  Contractor/manufacturer is Silicon Graphics,
- * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
- *
- * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
- */
-/*
- * trackball.h
- * A virtual trackball implementation
- * Written by Gavin Bell for Silicon Graphics, November 1988.
- */
-
-/*
- * Pass the x and y coordinates of the last and current positions of
- * the mouse, scaled so they are from (-1.0 ... 1.0).
- *
- * The resulting rotation is returned as a quaternion rotation in the
- * first paramater.
- */
-void
-trackball(float q[4], float p1x, float p1y, float p2x, float p2y);
-
-/*
- * Given two quaternions, add them together to get a third quaternion.
- * Adding quaternions to get a compound rotation is analagous to adding
- * translations to get a compound translation.  When incrementally
- * adding rotations, the first argument here should be the new
- * rotation, the second and third the total rotation (which will be
- * over-written with the resulting new total rotation).
- */
-void
-add_quats(float *q1, float *q2, float *dest);
-
-/*
- * A useful function, builds a rotation matrix in Matrix based on
- * given quaternion.
- */
-void
-build_rotmatrix(float m[4][4], float q[4]);
-
-/*
- * This function computes a quaternion based on an axis (defined by
- * the given vector) and an angle about which to rotate.  The angle is
- * expressed in radians.  The result is put into the third argument.
- */
-void
-axis_to_quat(float a[3], float phi, float q[4]);
diff --git a/gui/main.cpp b/gui/main.cpp
deleted file mode 100644
index 54a3909..0000000
--- a/gui/main.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include <gtkmm/main.h>
-
-#include "hkl-gui.h"
-
-int main(int argc, char *argv[])
-{
-	Gtk::Main kit(argc, argv);
-#ifdef HKL3D
-	Gtk::GL::init(argc, argv);
-#endif
-	HKLWindow window;
-	kit.run();
-
-	return 0;
-}
diff --git a/gui/pseudo.ui b/gui/pseudo.ui
index fcaba79..0fc90d2 100644
--- a/gui/pseudo.ui
+++ b/gui/pseudo.ui
@@ -1,33 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkListStore" id="liststore1">
-    <columns>
-      <!-- column-name name -->
-      <column type="gchararray"/>
-      <!-- column-name mode -->
-      <column type="gpointer"/>
-    </columns>
-  </object>
-  <object class="GtkListStore" id="liststore2">
-    <columns>
-      <!-- column-name name -->
-      <column type="gchararray"/>
-      <!-- column-name value -->
-      <column type="gdouble"/>
-      <!-- column-name pseudo -->
-      <column type="gpointer"/>
-    </columns>
-  </object>
-  <object class="GtkListStore" id="liststore3">
-    <columns>
-      <!-- column-name name -->
-      <column type="gchararray"/>
-      <!-- column-name value -->
-      <column type="gdouble"/>
-      <!-- column-name parameter -->
-      <column type="gpointer"/>
-    </columns>
+  <object class="GtkImage" id="image1">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="stock">gtk-goto-bottom</property>
   </object>
   <object class="GtkFrame" id="frame1">
     <property name="visible">True</property>
@@ -47,7 +24,7 @@
               <object class="GtkTreeView" id="treeview1">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="model">liststore2</property>
+                <property name="model">store_pseudo</property>
                 <property name="headers_clickable">False</property>
                 <property name="search_column">0</property>
                 <property name="enable_grid_lines">both</property>
@@ -74,15 +51,15 @@
                         <property name="editable">True</property>
                       </object>
                       <attributes>
-                        <attribute name="text">1</attribute>
+                        <attribute name="text">2</attribute>
                       </attributes>
                     </child>
                   </object>
                 </child>
               </object>
               <packing>
-                <property name="expand">True</property>
-                <property name="fill">True</property>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
                 <property name="position">0</property>
               </packing>
             </child>
@@ -107,7 +84,7 @@
                   <object class="GtkComboBox" id="combobox1">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="model">liststore1</property>
+                    <property name="model">store_mode</property>
                     <property name="add_tearoffs">True</property>
                     <child>
                       <object class="GtkCellRendererText" id="cellrenderertext2"/>
@@ -124,7 +101,7 @@
                 </child>
                 <child>
                   <object class="GtkButton" id="button1">
-                    <property name="label">gtk-jump-to</property>
+                    <property name="label">gtk-apply</property>
                     <property name="use_action_appearance">False</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
@@ -140,12 +117,14 @@
                 </child>
                 <child>
                   <object class="GtkButton" id="button2">
-                    <property name="label" translatable="yes">Initializer</property>
+                    <property name="label">Initialize</property>
                     <property name="use_action_appearance">False</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">True</property>
                     <property name="use_action_appearance">False</property>
+                    <property name="image">image1</property>
+                    <property name="image_position">right</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
@@ -168,7 +147,7 @@
                   <object class="GtkTreeView" id="treeview2">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                    <property name="model">liststore3</property>
+                    <property name="model">store_mode_parameter</property>
                     <property name="headers_visible">False</property>
                     <property name="headers_clickable">False</property>
                     <property name="rules_hint">True</property>
@@ -195,7 +174,7 @@
                             <property name="editable">True</property>
                           </object>
                           <attributes>
-                            <attribute name="text">1</attribute>
+                            <attribute name="text">2</attribute>
                           </attributes>
                         </child>
                       </object>
@@ -211,8 +190,8 @@
                 </child>
               </object>
               <packing>
-                <property name="expand">True</property>
-                <property name="fill">True</property>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
                 <property name="position">2</property>
               </packing>
             </child>
@@ -231,4 +210,32 @@
       </object>
     </child>
   </object>
+  <object class="GtkListStore" id="store_mode">
+    <columns>
+      <!-- column-name name -->
+      <column type="gchararray"/>
+      <!-- column-name mode -->
+      <column type="gpointer"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="store_pseudo">
+    <columns>
+      <!-- column-name name -->
+      <column type="gchararray"/>
+      <!-- column-name idx -->
+      <column type="guint"/>
+      <!-- column-name value -->
+      <column type="gdouble"/>
+    </columns>
+  </object>
+  <object class="GtkListStore" id="store_mode_parameter">
+    <columns>
+      <!-- column-name name -->
+      <column type="gchararray"/>
+      <!-- column-name idx -->
+      <column type="guint"/>
+      <!-- column-name value -->
+      <column type="gdouble"/>
+    </columns>
+  </object>
 </interface>
diff --git a/hkl.h b/hkl.h
index e523ac6..80d808e 100644
--- a/hkl.h
+++ b/hkl.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,20 +22,11 @@
 #ifndef __HKL_H__
 #define __HKL_H__
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <gsl/gsl_math.h>
-
-#include <hkl/ccan/darray/darray.h>
-
-/* Guard C code in headers, while including them from C++ */
-#ifdef __cplusplus
-# define HKL_BEGIN_DECLS  extern "C" {
-# define HKL_END_DECLS    }
-#else
-# define HKL_BEGIN_DECLS
-# define HKL_END_DECLS
-#endif
+#include <math.h>                       // for M_PI
+#include <stddef.h>                     // for size_t
+#include <stdio.h>                      // for FILE
+#include <glib.h>                       // for g_set_error, GError etc
+#include <hkl/ccan/darray/darray.h>     // for darray
 
 /* deprecated */
 #if    __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
@@ -54,9 +45,6 @@
 # define HKL_DEPRECATED_FOR(f) HKL_DEPRECATED
 #endif
 
-#define HKL_TRUE 1
-#define HKL_FALSE 0
-
 #define HKL_TINY 1e-7
 #define HKL_EPSILON 1e-6
 #define HKL_DEGTORAD (M_PI/180.)
@@ -78,7 +66,7 @@
 # endif
 #else
 /**
- * @def HKLEAPI
+ * @def HKLAPI
  * @brief Used to export functions(by changing visibility).
  */
 # define HKLAPI
@@ -90,9 +78,40 @@
 # define HKL_ARG_NONNULL(...)
 #endif
 
+# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#  define HKL_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__))
+# else
+#  define HKL_WARN_UNUSED_RESULT
+# endif
+
+
 #define _darray(type) type *item; size_t size; size_t alloc
 
-HKL_BEGIN_DECLS
+G_BEGIN_DECLS
+
+/**********/
+/* Vector */
+/**********/
+
+typedef struct _HklVector HklVector;
+
+struct _HklVector
+{
+	double data[3];
+};
+
+/**************/
+/* Quaternion */
+/**************/
+
+typedef struct _HklQuaternion HklQuaternion;
+
+struct _HklQuaternion
+{
+	double data[4];
+};
+
+typedef darray(const char *) darray_string;
 
 /**********/
 /* Matrix */
@@ -121,21 +140,21 @@ HKLAPI int hkl_matrix_cmp(const HklMatrix *self, const HklMatrix *m) HKL_ARG_NON
 
 HKLAPI void hkl_matrix_times_matrix(HklMatrix *self, const HklMatrix *m) HKL_ARG_NONNULL(1, 2);
 
-/*********/
-/* Error */
-/*********/
+/********/
+/* Unit */
+/********/
 
-typedef struct _HklError HklError;
-
-HKLAPI const char *hkl_error_message_get(const HklError *self) HKL_ARG_NONNULL(1);
+typedef enum _HklUnitEnum
+{
+	HKL_UNIT_DEFAULT,
+	HKL_UNIT_USER
+} HklUnitEnum;
 
 /*************/
 /* Parameter */
 /*************/
 
 typedef struct _HklParameter HklParameter;
-typedef struct _HklParameterList HklParameterList;
-typedef HklParameterList darray_parameter;
 
 /* HklParameter */
 
@@ -145,23 +164,21 @@ HKLAPI void hkl_parameter_free(HklParameter *self) HKL_ARG_NONNULL(1);
 
 HKLAPI const char *hkl_parameter_name_get(const HklParameter *self) HKL_ARG_NONNULL(1);
 
-HKLAPI double hkl_parameter_value_get(const HklParameter *self) HKL_ARG_NONNULL(1);
-
-HKLAPI int hkl_parameter_value_set(HklParameter *self, double value,
-				   HklError **error) HKL_ARG_NONNULL(1);
-
-HKLAPI double hkl_parameter_value_unit_get(const HklParameter *self) HKL_ARG_NONNULL(1);
+HKLAPI const char *hkl_parameter_default_unit_get(const HklParameter *self) HKL_ARG_NONNULL(1);
 
-HKLAPI int hkl_parameter_value_unit_set(HklParameter *self, double value,
-					HklError **error) HKL_ARG_NONNULL(1);
+HKLAPI const char *hkl_parameter_user_unit_get(const HklParameter *self) HKL_ARG_NONNULL(1);
 
-HKLAPI void hkl_parameter_min_max_get(const HklParameter *self, double *min, double *max) HKL_ARG_NONNULL(1, 2, 3);
+HKLAPI double hkl_parameter_value_get(const HklParameter *self,
+				      HklUnitEnum unit_type) HKL_ARG_NONNULL(1);
 
-HKLAPI void hkl_parameter_min_max_set(HklParameter *self, double min, double max) HKL_ARG_NONNULL(1);
+HKLAPI int hkl_parameter_value_set(HklParameter *self, double value,
+				   HklUnitEnum unit_type, GError **error) HKL_ARG_NONNULL(1) HKL_WARN_UNUSED_RESULT;
 
-HKLAPI void hkl_parameter_min_max_unit_get(const HklParameter *self, double *min, double *max) HKL_ARG_NONNULL(1, 2, 3);
+HKLAPI void hkl_parameter_min_max_get(const HklParameter *self, double *min, double *max,
+				      HklUnitEnum unit_type) HKL_ARG_NONNULL(1, 2, 3);
 
-HKLAPI void hkl_parameter_min_max_unit_set(HklParameter *self, double min, double max) HKL_ARG_NONNULL(1);
+HKLAPI int hkl_parameter_min_max_set(HklParameter *self, double min, double max,
+				     HklUnitEnum unit_type, GError **error) HKL_ARG_NONNULL(1) HKL_WARN_UNUSED_RESULT;
 
 HKLAPI int hkl_parameter_fit_get(const HklParameter *self) HKL_ARG_NONNULL(1);
 
@@ -169,21 +186,13 @@ HKLAPI void hkl_parameter_fit_set(HklParameter *self, int fit) HKL_ARG_NONNULL(1
 
 HKLAPI void hkl_parameter_randomize(HklParameter *self) HKL_ARG_NONNULL(1);
 
-/* HklParameterList */
-
-struct _HklParameterList {
-	_darray(HklParameter *);
-};
+/* getter and setter specific to certain type of HklParameter */
 
-HKLAPI unsigned int hkl_parameter_list_values_set(HklParameterList *self,
-						  double values[], unsigned int len,
-						  HklError **error) HKL_ARG_NONNULL(1);
+HKLAPI const HklVector *hkl_parameter_axis_v_get(const HklParameter *self) HKL_ARG_NONNULL(1);
 
-HKLAPI double *hkl_parameter_list_values_unit_get(const HklParameterList *self,
-						  unsigned int *len) HKL_ARG_NONNULL(1, 2);
+HKLAPI const HklQuaternion *hkl_parameter_quaternion_get(const HklParameter *self) HKL_ARG_NONNULL(1);
 
-/* only use in the test method for now */
-HKLAPI void hkl_parameter_list_randomize(HklParameterList *self) HKL_ARG_NONNULL(1);
+HKLAPI const char *hkl_parameter_description_get(const HklParameter *self) HKL_ARG_NONNULL(1);
 
 /************/
 /* Detector */
@@ -195,13 +204,13 @@ typedef enum _HklDetectorType
 	HKL_DETECTOR_TYPE_0D
 } HklDetectorType;
 
-HKLAPI void hkl_detector_free(HklDetector *self) HKL_ARG_NONNULL(1);
+HKLAPI HklDetector *hkl_detector_factory_new(HklDetectorType type);
 
-HKLAPI void hkl_detector_idx_set(HklDetector *self, int idx) HKL_ARG_NONNULL(1);
+HKLAPI HklDetector *hkl_detector_new_copy(const HklDetector *src) HKL_ARG_NONNULL(1);
 
-HKLAPI void hkl_detector_fprintf(FILE *f, const HklDetector *self) HKL_ARG_NONNULL(1, 2);
+HKLAPI void hkl_detector_free(HklDetector *self) HKL_ARG_NONNULL(1);
 
-HKLAPI HklDetector *hkl_detector_factory_new(HklDetectorType type);
+HKLAPI void hkl_detector_fprintf(FILE *f, const HklDetector *self) HKL_ARG_NONNULL(1, 2);
 
 /************/
 /* Geometry */
@@ -211,35 +220,62 @@ typedef struct _HklGeometry HklGeometry;
 typedef struct _HklGeometryList HklGeometryList;
 typedef struct _HklGeometryListItem HklGeometryListItem;
 
-typedef darray(HklGeometryListItem *) darray_item;
-
 /* HklGeometry */
 
+HKLAPI HklGeometry *hkl_geometry_new_copy(const HklGeometry *self) HKL_ARG_NONNULL(1);
+
 HKLAPI void hkl_geometry_free(HklGeometry *self) HKL_ARG_NONNULL(1);
 
-HKLAPI void hkl_geometry_set(HklGeometry *self, const HklGeometry *src) HKL_ARG_NONNULL(1, 2);
+HKLAPI int hkl_geometry_set(HklGeometry *self, const HklGeometry *src) HKL_ARG_NONNULL(1, 2);
 
-HKLAPI const darray_parameter *hkl_geometry_axes_get(const HklGeometry *self) HKL_ARG_NONNULL(1);
+HKLAPI const darray_string *hkl_geometry_axis_names_get(const HklGeometry *self) HKL_ARG_NONNULL(1);
 
-HKLAPI const HklParameter *hkl_geometry_axis_get(const HklGeometry *self, const char *name) HKL_ARG_NONNULL(1, 2);
+HKLAPI const HklParameter *hkl_geometry_axis_get(const HklGeometry *self, const char *name,
+						 GError **error) HKL_ARG_NONNULL(1, 2) HKL_WARN_UNUSED_RESULT;
 
-HKLAPI void hkl_geometry_axis_set(HklGeometry *self, const HklParameter *axis) HKL_ARG_NONNULL(1, 2);
+HKLAPI int hkl_geometry_axis_set(HklGeometry *self, const char *name,
+				 const HklParameter *axis,
+				 GError **error) HKL_ARG_NONNULL(1, 2, 3) HKL_WARN_UNUSED_RESULT;
+
+HKLAPI void hkl_geometry_axis_values_get(const HklGeometry *self,
+					 double values[], size_t n_values,
+					 HklUnitEnum unit_type) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI int hkl_geometry_axis_values_set(HklGeometry *self,
+					double values[], size_t n_values,
+					HklUnitEnum unit_type,
+					GError **error) HKL_ARG_NONNULL(1, 2) HKL_WARN_UNUSED_RESULT;
 
 HKLAPI const char *hkl_geometry_name_get(const HklGeometry *self) HKL_ARG_NONNULL(1);
 
-HKLAPI double hkl_geometry_wavelength_get(const HklGeometry *self) HKL_ARG_NONNULL(1);
+HKLAPI double hkl_geometry_wavelength_get(const HklGeometry *self,
+					  HklUnitEnum unit_type) HKL_ARG_NONNULL(1);
 
-HKLAPI void hkl_geometry_wavelength_set(HklGeometry *self, double wavelength) HKL_ARG_NONNULL(1);
+HKLAPI int hkl_geometry_wavelength_set(HklGeometry *self, double wavelength,
+				       HklUnitEnum unit_type, GError **error) HKL_ARG_NONNULL(1) HKL_WARN_UNUSED_RESULT;
 
 HKLAPI void hkl_geometry_randomize(HklGeometry *self) HKL_ARG_NONNULL(1);
 
-HKLAPI int hkl_geometry_set_values_unit_v(HklGeometry *self, ...) HKL_ARG_NONNULL(1);
+/* TODO after bissecting it seems that this method is slow (to replace) */
+HKLAPI int hkl_geometry_set_values_v(HklGeometry *self, HklUnitEnum unit_type,
+				     GError **error, ...) HKL_ARG_NONNULL(1) HKL_WARN_UNUSED_RESULT;
 
 HKLAPI void hkl_geometry_fprintf(FILE *file, const HklGeometry *self) HKL_ARG_NONNULL(1, 2);
 
 /* HklGeometryList */
 
-HKLAPI const darray_item *hkl_geometry_list_items_get(const HklGeometryList *self) HKL_ARG_NONNULL(1);
+#define HKL_GEOMETRY_LIST_FOREACH(item, list) for((item)=hkl_geometry_list_items_first_get((list)); \
+						  (item);		\
+						  (item)=hkl_geometry_list_items_next_get((list), (item)))
+
+HKLAPI void hkl_geometry_list_free(HklGeometryList *self) HKL_ARG_NONNULL(1);
+
+HKLAPI size_t hkl_geometry_list_n_items_get(const HklGeometryList *self) HKL_ARG_NONNULL(1);
+
+HKLAPI const HklGeometryListItem *hkl_geometry_list_items_first_get(const HklGeometryList *self) HKL_ARG_NONNULL(1);
+
+HKLAPI const HklGeometryListItem *hkl_geometry_list_items_next_get(const HklGeometryList *self,
+								   const HklGeometryListItem *item) HKL_ARG_NONNULL(1, 2);
 
 /* HklGeometryListItem */
 
@@ -256,7 +292,8 @@ typedef struct _HklSampleReflection HklSampleReflection;
 /* Lattice */
 
 HKLAPI HklLattice *hkl_lattice_new(double a, double b, double c,
-				   double alpha, double beta, double gamma);
+				   double alpha, double beta, double gamma,
+				   GError **error) HKL_WARN_UNUSED_RESULT;
 
 HKLAPI HklLattice *hkl_lattice_new_copy(const HklLattice *self) HKL_ARG_NONNULL(1);
 
@@ -266,35 +303,43 @@ HKLAPI void hkl_lattice_free(HklLattice *self) HKL_ARG_NONNULL(1);
 
 HKLAPI const HklParameter *hkl_lattice_a_get(const HklLattice *self) HKL_ARG_NONNULL(1);
 
-HKLAPI void hkl_lattice_a_set(HklLattice *self, const HklParameter *parameter) HKL_ARG_NONNULL(1, 2);
+HKLAPI int hkl_lattice_a_set(HklLattice *self, const HklParameter *parameter,
+			     GError **error) HKL_ARG_NONNULL(1, 2) HKL_WARN_UNUSED_RESULT;
 
 HKLAPI const HklParameter *hkl_lattice_b_get(const HklLattice *self) HKL_ARG_NONNULL(1);
 
-HKLAPI void hkl_lattice_b_set(HklLattice *self, const HklParameter *parameter) HKL_ARG_NONNULL(1, 2);
+HKLAPI int hkl_lattice_b_set(HklLattice *self, const HklParameter *parameter,
+			     GError **error) HKL_ARG_NONNULL(1, 2) HKL_WARN_UNUSED_RESULT;
 
 HKLAPI const HklParameter *hkl_lattice_c_get(const HklLattice *self) HKL_ARG_NONNULL(1);
 
-HKLAPI void hkl_lattice_c_set(HklLattice *self, const HklParameter *parameter) HKL_ARG_NONNULL(1, 2);
+HKLAPI int hkl_lattice_c_set(HklLattice *self, const HklParameter *parameter,
+			     GError **error) HKL_ARG_NONNULL(1, 2) HKL_WARN_UNUSED_RESULT;
 
 HKLAPI const HklParameter *hkl_lattice_alpha_get(const HklLattice *self) HKL_ARG_NONNULL(1);
 
-HKLAPI void hkl_lattice_alpha_set(HklLattice *self, const HklParameter *parameter) HKL_ARG_NONNULL(1, 2);
+HKLAPI int hkl_lattice_alpha_set(HklLattice *self, const HklParameter *parameter,
+				 GError **error) HKL_ARG_NONNULL(1, 2) HKL_WARN_UNUSED_RESULT;
 
 HKLAPI const HklParameter *hkl_lattice_beta_get(const HklLattice *self) HKL_ARG_NONNULL(1);
 
-HKLAPI void hkl_lattice_beta_set(HklLattice *self, const HklParameter *parameter) HKL_ARG_NONNULL(1, 2);
+HKLAPI int hkl_lattice_beta_set(HklLattice *self, const HklParameter *parameter,
+				GError **error) HKL_ARG_NONNULL(1, 2) HKL_WARN_UNUSED_RESULT;
 
 HKLAPI const HklParameter *hkl_lattice_gamma_get(const HklLattice *self) HKL_ARG_NONNULL(1);
 
-HKLAPI void hkl_lattice_gamma_set(HklLattice *self, const HklParameter *parameter) HKL_ARG_NONNULL(1, 2);
+HKLAPI int hkl_lattice_gamma_set(HklLattice *self, const HklParameter *parameter,
+				 GError **error) HKL_ARG_NONNULL(1, 2) HKL_WARN_UNUSED_RESULT;
 
 HKLAPI int hkl_lattice_set(HklLattice *self,
 			   double a, double b, double c,
-			   double alpha, double beta, double gamma) HKL_ARG_NONNULL(1);
+			   double alpha, double beta, double gamma,
+			   HklUnitEnum unit_type, GError **error) HKL_ARG_NONNULL(1) HKL_WARN_UNUSED_RESULT;
 
 HKLAPI void hkl_lattice_get(const HklLattice *self,
 			    double *a, double *b, double *c,
-			    double *alpha, double *beta, double *gamma) HKL_ARG_NONNULL(1, 2, 3, 4, 5, 6, 7);
+			    double *alpha, double *beta, double *gamma,
+			    HklUnitEnum unit_type) HKL_ARG_NONNULL(1, 2, 3, 4, 5, 6, 7);
 
 HKLAPI int hkl_lattice_get_B(const HklLattice *self, HklMatrix *B) HKL_ARG_NONNULL(1, 2);
 
@@ -320,28 +365,38 @@ HKLAPI void hkl_sample_lattice_set(HklSample *self, const HklLattice *lattice) H
 
 HKLAPI const HklParameter *hkl_sample_ux_get(const HklSample *self) HKL_ARG_NONNULL(1);
 
-HKLAPI void hkl_sample_ux_set(HklSample *self, const HklParameter *ux) HKL_ARG_NONNULL(1, 2);
+HKLAPI int hkl_sample_ux_set(HklSample *self, const HklParameter *ux,
+			     GError **error) HKL_ARG_NONNULL(1, 2) HKL_WARN_UNUSED_RESULT;
 
 HKLAPI const HklParameter *hkl_sample_uy_get(const HklSample *self) HKL_ARG_NONNULL(1);
 
-HKLAPI void hkl_sample_uy_set(HklSample *self, const HklParameter *uy) HKL_ARG_NONNULL(1, 2);
+HKLAPI int hkl_sample_uy_set(HklSample *self, const HklParameter *uy,
+			     GError **error) HKL_ARG_NONNULL(1, 2) HKL_WARN_UNUSED_RESULT;
 
 HKLAPI const HklParameter *hkl_sample_uz_get(const HklSample *self) HKL_ARG_NONNULL(1);
 
-HKLAPI void hkl_sample_uz_set(HklSample *self, const HklParameter *uz) HKL_ARG_NONNULL(1, 2);
+HKLAPI int hkl_sample_uz_set(HklSample *self, const HklParameter *uz,
+			     GError **error) HKL_ARG_NONNULL(1, 2) HKL_WARN_UNUSED_RESULT;
 
 HKLAPI const HklMatrix *hkl_sample_U_get(const HklSample *self) HKL_ARG_NONNULL(1);
 
-HKLAPI void hkl_sample_U_set(HklSample *self, const HklMatrix *U) HKL_ARG_NONNULL(1);
+HKLAPI void hkl_sample_U_set(HklSample *self, const HklMatrix *U, GError **error) HKL_ARG_NONNULL(1);
 
 HKLAPI const HklMatrix *hkl_sample_UB_get(const HklSample *self) HKL_ARG_NONNULL(1);
 
-HKLAPI double hkl_sample_UB_set(HklSample *self, const HklMatrix *UB) HKL_ARG_NONNULL(1, 2);
+HKLAPI int hkl_sample_UB_set(HklSample *self, const HklMatrix *UB,
+			     GError **error) HKL_ARG_NONNULL(1, 2) HKL_WARN_UNUSED_RESULT;
+
+HKLAPI size_t hkl_sample_n_reflections_get(const HklSample *self) HKL_ARG_NONNULL(1);
+
+#define HKL_SAMPLE_REFLECTIONS_FOREACH(_item, _list) for((_item)=hkl_sample_reflections_first_get((_list)); \
+							 (_item);	\
+							 (_item)=hkl_sample_reflections_next_get((_list), (_item)))
 
-HKLAPI HklSampleReflection *hkl_sample_first_reflection_get(const HklSample *self) HKL_ARG_NONNULL(1);
+HKLAPI HklSampleReflection *hkl_sample_reflections_first_get(HklSample *self) HKL_ARG_NONNULL(1);
 
-HKLAPI HklSampleReflection *hkl_sample_next_reflection_get(const HklSample *self,
-							   const HklSampleReflection *reflection) HKL_ARG_NONNULL(1, 2);
+HKLAPI HklSampleReflection *hkl_sample_reflections_next_get(HklSample *self,
+							    HklSampleReflection *reflection) HKL_ARG_NONNULL(1, 2);
 
 HKLAPI void hkl_sample_del_reflection(HklSample *self,
 				      HklSampleReflection *reflection) HKL_ARG_NONNULL(1, 2);
@@ -351,9 +406,10 @@ HKLAPI void hkl_sample_add_reflection(HklSample *self,
 
 HKLAPI int hkl_sample_compute_UB_busing_levy(HklSample *self,
 					     const HklSampleReflection *r1,
-					     const HklSampleReflection *r2) HKL_ARG_NONNULL(1, 2, 3);
+					     const HklSampleReflection *r2,
+					     GError **error) HKL_ARG_NONNULL(1, 2, 3) HKL_WARN_UNUSED_RESULT;
 
-HKLAPI double hkl_sample_get_reflection_mesured_angle(const HklSample *self,
+HKLAPI double hkl_sample_get_reflection_measured_angle(const HklSample *self,
 						      const HklSampleReflection *r1,
 						      const HklSampleReflection *r2) HKL_ARG_NONNULL(1, 2, 3);
 
@@ -361,19 +417,21 @@ HKLAPI double hkl_sample_get_reflection_theoretical_angle(const HklSample *self,
 							  const HklSampleReflection *r1,
 							  const HklSampleReflection *r2) HKL_ARG_NONNULL(1, 2, 3);
 
-HKLAPI double hkl_sample_affine(HklSample *self) HKL_ARG_NONNULL(1);
+HKLAPI int hkl_sample_affine(HklSample *self, GError **error) HKL_ARG_NONNULL(1) HKL_WARN_UNUSED_RESULT;
 
-/* hklSampleReflection */
+/* HklSampleReflection */
 
 HKLAPI HklSampleReflection *hkl_sample_reflection_new(const HklGeometry *geometry,
 						      const HklDetector *detector,
-						      double h, double k, double l) HKL_ARG_NONNULL(1, 2);
+						      double h, double k, double l,
+						      GError **error) HKL_ARG_NONNULL(1, 2) HKL_WARN_UNUSED_RESULT;
 
 HKLAPI void hkl_sample_reflection_hkl_get(const HklSampleReflection *self,
 					  double *h, double *k, double *l) HKL_ARG_NONNULL(1, 2, 3, 4);
 
-HKLAPI void hkl_sample_reflection_hkl_set(HklSampleReflection *self,
-					  double h, double k, double l) HKL_ARG_NONNULL(1);
+HKLAPI int hkl_sample_reflection_hkl_set(HklSampleReflection *self,
+					 double h, double k, double l,
+					 GError **error) HKL_ARG_NONNULL(1) HKL_WARN_UNUSED_RESULT;
 
 HKLAPI int hkl_sample_reflection_flag_get(const HklSampleReflection *self) HKL_ARG_NONNULL(1);
 
@@ -388,69 +446,97 @@ HKLAPI void hkl_sample_reflection_geometry_set(HklSampleReflection *self,
 /* PseudoAxis */
 /**************/
 
-typedef struct _HklPseudoAxis HklPseudoAxis;
-typedef struct _HklMode HklMode;
 typedef struct _HklEngine HklEngine;
 typedef struct _HklEngineList HklEngineList;
 
-typedef darray(HklMode *) darray_mode;
 typedef darray(HklEngine *) darray_engine;
 
-/* HklMode */
+/* HklEngine */
 
-HKLAPI const char * hkl_mode_name(const HklMode *self) HKL_ARG_NONNULL(1);
+HKLAPI const char *hkl_engine_name_get(const HklEngine *self) HKL_ARG_NONNULL(1);
 
-HKLAPI HklParameterList *hkl_mode_parameters(HklMode *self) HKL_ARG_NONNULL(1);
+HKLAPI unsigned int hkl_engine_len(const HklEngine *self) HKL_ARG_NONNULL(1);
 
-HKLAPI void hkl_mode_fprintf(FILE *f, const HklMode *self) HKL_ARG_NONNULL(1, 2);
+HKLAPI const darray_string *hkl_engine_pseudo_axis_names_get(HklEngine *self) HKL_ARG_NONNULL(1);
 
-/* HklEngine */
+HKLAPI int hkl_engine_pseudo_axis_values_get(HklEngine *self,
+					     double values[], size_t n_values,
+					     HklUnitEnum unit_type, GError **error) HKL_ARG_NONNULL(1, 2) HKL_WARN_UNUSED_RESULT;
 
-HKLAPI const char *hkl_engine_name(const HklEngine *self) HKL_ARG_NONNULL(1);
+HKLAPI HklGeometryList *hkl_engine_pseudo_axis_values_set(HklEngine *self,
+							  double values[], size_t n_values,
+							  HklUnitEnum unit_type, GError **error) HKL_ARG_NONNULL(1, 2) HKL_WARN_UNUSED_RESULT;
 
-HKLAPI unsigned int hkl_engine_len(const HklEngine *self) HKL_ARG_NONNULL(1);
+HKLAPI const HklParameter *hkl_engine_pseudo_axis_get(const HklEngine *self,
+						      const char *name,
+						      GError **error) HKL_ARG_NONNULL(1, 2) HKL_WARN_UNUSED_RESULT;
 
-HKLAPI HklParameterList *hkl_engine_pseudo_axes(HklEngine *self) HKL_ARG_NONNULL(1);
+typedef enum _HklEngineCapabilities
+{
+	HKL_ENGINE_CAPABILITIES_READABLE = 1u << 0,
+	HKL_ENGINE_CAPABILITIES_WRITABLE = 1u << 1,
+	HKL_ENGINE_CAPABILITIES_INITIALIZABLE = 1u << 2,
+} HklEngineCapabilities;
 
-HKLAPI HklMode *hkl_engine_mode(HklEngine *self) HKL_ARG_NONNULL(1);
+HKLAPI unsigned int hkl_engine_capabilities_get(const HklEngine *self) HKL_ARG_NONNULL(1);
 
-HKLAPI darray_mode *hkl_engine_modes(HklEngine *self) HKL_ARG_NONNULL(1);
+HKLAPI int hkl_engine_initialized_get(const HklEngine *self) HKL_ARG_NONNULL(1);
 
-HKLAPI HklEngineList *hkl_engine_engines(HklEngine *self) HKL_ARG_NONNULL(1);
+HKLAPI int hkl_engine_initialized_set(HklEngine *self, int initialized,
+				      GError **error) HKL_ARG_NONNULL(1) HKL_WARN_UNUSED_RESULT;
 
-HKLAPI void hkl_engine_select_mode(HklEngine *self,
-				   HklMode *mode) HKL_ARG_NONNULL(1, 2);
+HKLAPI void hkl_engine_fprintf(FILE *f, const HklEngine *self) HKL_ARG_NONNULL(1, 2);
 
-HKLAPI void hkl_engine_select_mode_by_name(HklEngine *self,
-					   const char *name) HKL_ARG_NONNULL(1, 2);
+/* mode */
 
-HKLAPI int hkl_engine_initialize(HklEngine *self, HklError **error) HKL_ARG_NONNULL(1);
+HKLAPI const darray_string *hkl_engine_modes_names_get(const HklEngine *self) HKL_ARG_NONNULL(1);
 
-HKLAPI int hkl_engine_set(HklEngine *self, HklError **error) HKL_ARG_NONNULL(1);
+HKLAPI const char *hkl_engine_current_mode_get(const HklEngine *self) HKL_ARG_NONNULL(1);
 
-HKLAPI int hkl_engine_get(HklEngine *self, HklError **error) HKL_ARG_NONNULL(1);
+HKLAPI int hkl_engine_current_mode_set(HklEngine *self, const char *name, GError **error) HKL_ARG_NONNULL(1, 2) HKL_WARN_UNUSED_RESULT;
 
-HKLAPI void hkl_engine_fprintf(FILE *f, const HklEngine *self) HKL_ARG_NONNULL(1, 2);
+typedef enum _HklEngineAxisNamesGet
+{
+	HKL_ENGINE_AXIS_NAMES_GET_READ,
+	HKL_ENGINE_AXIS_NAMES_GET_WRITE,
+} HklEngineAxisNamesGet;
 
-/* HklEngineList */
+HKLAPI const darray_string *hkl_engine_axis_names_get(const HklEngine *self,
+						      HklEngineAxisNamesGet mode) HKL_ARG_NONNULL(1);
 
-HKLAPI void hkl_engine_list_free(HklEngineList *self) HKL_ARG_NONNULL(1);
+HKLAPI const darray_string *hkl_engine_parameters_names_get(const HklEngine *self) HKL_ARG_NONNULL(1);
+
+HKLAPI const HklParameter *hkl_engine_parameter_get(const HklEngine *self, const char *name,
+						    GError **error) HKL_ARG_NONNULL(1, 2) HKL_WARN_UNUSED_RESULT;
+
+HKLAPI int hkl_engine_parameter_set(HklEngine *self,
+				    const char *name, const HklParameter *parameter,
+				    GError **error) HKL_ARG_NONNULL(1, 2, 3) HKL_WARN_UNUSED_RESULT;
 
-HKLAPI darray_engine *hkl_engine_list_engines(HklEngineList *self) HKL_ARG_NONNULL(1);
+HKLAPI void hkl_engine_parameters_values_get(const HklEngine *self,
+					     double values[], size_t n_values,
+					     HklUnitEnum unit_type) HKL_ARG_NONNULL(1, 2);
 
-HKLAPI void hkl_engine_list_geometry_set(HklEngineList *self, const HklGeometry *geometry) HKL_ARG_NONNULL(1, 2);
+HKLAPI int hkl_engine_parameters_values_set(HklEngine *self,
+					    double values[], size_t n_values,
+					    HklUnitEnum unit_type, GError **error) HKL_ARG_NONNULL(1, 2) HKL_WARN_UNUSED_RESULT;
+
+/* HklEngineList */
+
+HKLAPI void hkl_engine_list_free(HklEngineList *self) HKL_ARG_NONNULL(1);
 
-HKLAPI const HklGeometryList *hkl_engine_list_geometries(const HklEngineList *self) HKL_ARG_NONNULL(1);
+HKLAPI darray_engine *hkl_engine_list_engines_get(HklEngineList *self) HKL_ARG_NONNULL(1);
 
-HKLAPI HklGeometry *hkl_engine_list_get_geometry(HklEngineList *self) HKL_ARG_NONNULL(1);
+HKLAPI HklGeometry *hkl_engine_list_geometry_get(HklEngineList *self) HKL_ARG_NONNULL(1);
 
-HKLAPI void hkl_engine_list_select_solution(HklEngineList *self, unsigned int idx) HKL_ARG_NONNULL(1);
+HKLAPI int hkl_engine_list_geometry_set(HklEngineList *self, const HklGeometry *geometry) HKL_ARG_NONNULL(1, 2);
 
-HKLAPI HklEngine *hkl_engine_list_get_by_name(HklEngineList *self,
-					      const char *name) HKL_ARG_NONNULL(1, 2);
+HKLAPI int hkl_engine_list_select_solution(HklEngineList *self,
+					   const HklGeometryListItem *item) HKL_ARG_NONNULL(1);
 
-HKLAPI HklParameter *hkl_engine_list_get_pseudo_axis_by_name(const HklEngineList *self,
-							     const char *name) HKL_ARG_NONNULL(1, 2);
+HKLAPI HklEngine *hkl_engine_list_engine_get_by_name(HklEngineList *self,
+						     const char *name,
+						     GError **error) HKL_ARG_NONNULL(1, 2) HKL_WARN_UNUSED_RESULT;
 
 HKLAPI void hkl_engine_list_init(HklEngineList *self,
 				 HklGeometry *geometry,
@@ -468,16 +554,17 @@ HKLAPI void hkl_engine_list_fprintf(FILE *f,
 
 typedef struct _HklFactory HklFactory;
 
-HKLAPI HklFactory **hkl_factory_get_all(unsigned int *n) HKL_ARG_NONNULL(1);
+HKLAPI HklFactory **hkl_factory_get_all(size_t *n) HKL_ARG_NONNULL(1);
 
-HKLAPI HklFactory *hkl_factory_get_by_name(const char *name) HKL_ARG_NONNULL(1);
+HKLAPI HklFactory *hkl_factory_get_by_name(const char *name,
+					   GError **error) HKL_ARG_NONNULL(1) HKL_WARN_UNUSED_RESULT;
 
-HKLAPI const char *hkl_factory_name(const HklFactory *self) HKL_ARG_NONNULL(1);
+HKLAPI const char *hkl_factory_name_get(const HklFactory *self) HKL_ARG_NONNULL(1);
 
 HKLAPI HklGeometry *hkl_factory_create_new_geometry(const HklFactory *self) HKL_ARG_NONNULL(1);
 
 HKLAPI HklEngineList *hkl_factory_create_new_engine_list(const HklFactory *self) HKL_ARG_NONNULL(1);
 
-HKL_END_DECLS
+G_END_DECLS
 
 #endif
diff --git a/hkl/Makefile.am b/hkl/Makefile.am
index 2808ec3..f162757 100644
--- a/hkl/Makefile.am
+++ b/hkl/Makefile.am
@@ -1,15 +1,18 @@
 ## Process this file with automake to produce Makefile.in
 SUBDIRS = ccan
 
-AM_LDFLAGS = -no-undefined -version-info 5:0:0
-AM_LDFLAGS += $(GSL_LIBS)
-AM_CFLAGS = -I$(top_srcdir) \
+AM_LDFLAGS = \
+	-no-undefined -version-info 5:0:0 \
+	$(GLIB_LIBS) \
+	$(GSL_LIBS)
+AM_CFLAGS = \
+	-DG_LOG_DOMAIN=\"Hkl\" \
+	-I$(top_srcdir) \
 	-I$(top_builddir) \
+	$(GLIB_CFLAGS) \
 	$(GSL_CFLAGS)
-	-fvisibility=hiden
 
 hkl_c_sources = \
-	hkl-error.c \
 	hkl-axis.c \
 	hkl-detector.c \
 	hkl-detector-factory.c \
@@ -26,17 +29,15 @@ hkl_c_sources = \
 	hkl-pseudoaxis-common-hkl.c \
 	hkl-pseudoaxis-common-psi.c \
 	hkl-pseudoaxis-common-q.c \
-	hkl-pseudoaxis-e4c-hkl.c \
-	hkl-pseudoaxis-e4c-psi.c \
-	hkl-pseudoaxis-e6c-hkl.c \
-	hkl-pseudoaxis-e6c-psi.c \
-	hkl-pseudoaxis-k4cv-hkl.c \
-	hkl-pseudoaxis-k4cv-psi.c \
-	hkl-pseudoaxis-k6c-hkl.c \
-	hkl-pseudoaxis-k6c-psi.c \
-	hkl-pseudoaxis-zaxis-hkl.c \
-	hkl-pseudoaxis-soleil-sixs-med.c \
-	hkl-pseudoaxis-petra3-hkl.c \
+	hkl-engine-2c.c \
+	hkl-engine-e4c.c \
+	hkl-engine-k4c.c \
+	hkl-engine-e6c.c \
+	hkl-engine-k6c.c \
+	hkl-engine-petra3-p09-eh2.c \
+	hkl-engine-soleil-sirius-turret.c \
+	hkl-engine-soleil-sixs-med.c \
+	hkl-engine-zaxis.c \
 	hkl-quaternion.c \
 	hkl-sample.c \
 	hkl-source.c \
@@ -48,7 +49,6 @@ hkl_public_h_sources = ../hkl.h
 hkl_private_h_sources = \
 	hkl-axis-private.h \
 	hkl-detector-private.h \
-	hkl-error-private.h \
 	hkl-factory-private.h \
 	hkl-geometry-private.h \
 	hkl-interval-private.h \
@@ -62,13 +62,6 @@ hkl_private_h_sources = \
 	hkl-pseudoaxis-common-hkl-private.h \
 	hkl-pseudoaxis-common-q-private.h \
 	hkl-pseudoaxis-common-psi-private.h \
-	hkl-pseudoaxis-e4c-private.h \
-	hkl-pseudoaxis-e6c-private.h \
-	hkl-pseudoaxis-k4cv-private.h \
-	hkl-pseudoaxis-k6c-private.h \
-	hkl-pseudoaxis-zaxis-private.h \
-	hkl-pseudoaxis-soleil-sixs-med-private.h \
-	hkl-pseudoaxis-petra3-private.h \
 	hkl-quaternion-private.h \
 	hkl-sample-private.h \
 	hkl-source-private.h \
@@ -78,6 +71,15 @@ hkl_private_h_sources = \
 lib_LTLIBRARIES = libhkl.la
 libhkl_la_SOURCES = $(hkl_c_sources) $(hkl_private_h_sources)
 libhkl_la_LIBADD = ccan/libccan.la
+libhkl_la_CFLAGS = \
+	$(AM_CFLAGS) \
+	-Wno-initializer-overrides \
+	-Wno-unused-result # \ do not activate visibility yet.
+	-fvisibility=hidden
+
+# just compile the template diffractometer to be sure that it is valid
+noinst_LTLIBRARIES = libdummy.la
+libdummy_la_SOURCES = hkl-engine-template.c
 
 # introspection
 
@@ -105,7 +107,6 @@ introspection_files = \
 	../hkl.h \
 	hkl-binding-private.h \
 	hkl-types.h \
-	hkl-error.c \
 	hkl-matrix.c \
 	hkl-parameter.c \
 	hkl-axis.c \
@@ -171,4 +172,11 @@ check-syntax: AM_CFLAGS += -fsyntax-only -pipe
 check-syntax:
 	test -z "$(CHK_SOURCES)" || $(COMPILE) $(CHK_SOURCES)
 
-.PHONY: check-syntax
+# check for includes with iwyu
+iwyu:
+	@list='$(libhkl_la_SOURCES)';\
+	for p in $$list; do\
+		iwyu $(AM_CFLAGS) $$p; \
+	done;
+
+.PHONY: check-syntax iwyu
diff --git a/hkl/Makefile.in b/hkl/Makefile.in
index 9c92173..c7e1344 100644
--- a/hkl/Makefile.in
+++ b/hkl/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
@@ -133,64 +133,68 @@ am__uninstall_files_from_dir = { \
   }
 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(girdir)" \
 	"$(DESTDIR)$(typelibsdir)"
-LTLIBRARIES = $(lib_LTLIBRARIES)
+LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
+libdummy_la_LIBADD =
+am_libdummy_la_OBJECTS = hkl-engine-template.lo
+libdummy_la_OBJECTS = $(am_libdummy_la_OBJECTS)
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
 libhkl_la_DEPENDENCIES = ccan/libccan.la
-am__libhkl_la_SOURCES_DIST = hkl-error.c hkl-axis.c hkl-detector.c \
+am__libhkl_la_SOURCES_DIST = hkl-axis.c hkl-detector.c \
 	hkl-detector-factory.c hkl-factory.c hkl-geometry.c \
 	hkl-interval.c hkl-lattice.c hkl-macros.c hkl-matrix.c \
 	hkl-parameter.c hkl-pseudoaxis.c hkl-pseudoaxis-auto.c \
 	hkl-pseudoaxis-common-eulerians.c hkl-pseudoaxis-common-hkl.c \
 	hkl-pseudoaxis-common-psi.c hkl-pseudoaxis-common-q.c \
-	hkl-pseudoaxis-e4c-hkl.c hkl-pseudoaxis-e4c-psi.c \
-	hkl-pseudoaxis-e6c-hkl.c hkl-pseudoaxis-e6c-psi.c \
-	hkl-pseudoaxis-k4cv-hkl.c hkl-pseudoaxis-k4cv-psi.c \
-	hkl-pseudoaxis-k6c-hkl.c hkl-pseudoaxis-k6c-psi.c \
-	hkl-pseudoaxis-zaxis-hkl.c hkl-pseudoaxis-soleil-sixs-med.c \
-	hkl-pseudoaxis-petra3-hkl.c hkl-quaternion.c hkl-sample.c \
-	hkl-source.c hkl-unit.c hkl-vector.c hkl-axis-private.h \
-	hkl-detector-private.h hkl-error-private.h \
-	hkl-factory-private.h hkl-geometry-private.h \
-	hkl-interval-private.h hkl-lattice-private.h \
-	hkl-macros-private.h hkl-matrix-private.h \
-	hkl-parameter-private.h hkl-pseudoaxis-private.h \
-	hkl-pseudoaxis-auto-private.h \
+	hkl-engine-2c.c hkl-engine-e4c.c hkl-engine-k4c.c \
+	hkl-engine-e6c.c hkl-engine-k6c.c hkl-engine-petra3-p09-eh2.c \
+	hkl-engine-soleil-sirius-turret.c hkl-engine-soleil-sixs-med.c \
+	hkl-engine-zaxis.c hkl-quaternion.c hkl-sample.c hkl-source.c \
+	hkl-unit.c hkl-vector.c hkl-axis-private.h \
+	hkl-detector-private.h hkl-factory-private.h \
+	hkl-geometry-private.h hkl-interval-private.h \
+	hkl-lattice-private.h hkl-macros-private.h \
+	hkl-matrix-private.h hkl-parameter-private.h \
+	hkl-pseudoaxis-private.h hkl-pseudoaxis-auto-private.h \
 	hkl-pseudoaxis-common-eulerians-private.h \
 	hkl-pseudoaxis-common-hkl-private.h \
 	hkl-pseudoaxis-common-q-private.h \
-	hkl-pseudoaxis-common-psi-private.h \
-	hkl-pseudoaxis-e4c-private.h hkl-pseudoaxis-e6c-private.h \
-	hkl-pseudoaxis-k4cv-private.h hkl-pseudoaxis-k6c-private.h \
-	hkl-pseudoaxis-zaxis-private.h \
-	hkl-pseudoaxis-soleil-sixs-med-private.h \
-	hkl-pseudoaxis-petra3-private.h hkl-quaternion-private.h \
+	hkl-pseudoaxis-common-psi-private.h hkl-quaternion-private.h \
 	hkl-sample-private.h hkl-source-private.h hkl-unit-private.h \
 	hkl-vector-private.h hkl-types.c hkl-types.h \
 	hkl-type-builtins.c hkl-type-builtins.h hkl-binding.c \
 	hkl-binding-private.h
-am__objects_1 = hkl-error.lo hkl-axis.lo hkl-detector.lo \
-	hkl-detector-factory.lo hkl-factory.lo hkl-geometry.lo \
-	hkl-interval.lo hkl-lattice.lo hkl-macros.lo hkl-matrix.lo \
-	hkl-parameter.lo hkl-pseudoaxis.lo hkl-pseudoaxis-auto.lo \
-	hkl-pseudoaxis-common-eulerians.lo \
-	hkl-pseudoaxis-common-hkl.lo hkl-pseudoaxis-common-psi.lo \
-	hkl-pseudoaxis-common-q.lo hkl-pseudoaxis-e4c-hkl.lo \
-	hkl-pseudoaxis-e4c-psi.lo hkl-pseudoaxis-e6c-hkl.lo \
-	hkl-pseudoaxis-e6c-psi.lo hkl-pseudoaxis-k4cv-hkl.lo \
-	hkl-pseudoaxis-k4cv-psi.lo hkl-pseudoaxis-k6c-hkl.lo \
-	hkl-pseudoaxis-k6c-psi.lo hkl-pseudoaxis-zaxis-hkl.lo \
-	hkl-pseudoaxis-soleil-sixs-med.lo hkl-pseudoaxis-petra3-hkl.lo \
-	hkl-quaternion.lo hkl-sample.lo hkl-source.lo hkl-unit.lo \
-	hkl-vector.lo
+am__objects_1 = libhkl_la-hkl-axis.lo libhkl_la-hkl-detector.lo \
+	libhkl_la-hkl-detector-factory.lo libhkl_la-hkl-factory.lo \
+	libhkl_la-hkl-geometry.lo libhkl_la-hkl-interval.lo \
+	libhkl_la-hkl-lattice.lo libhkl_la-hkl-macros.lo \
+	libhkl_la-hkl-matrix.lo libhkl_la-hkl-parameter.lo \
+	libhkl_la-hkl-pseudoaxis.lo libhkl_la-hkl-pseudoaxis-auto.lo \
+	libhkl_la-hkl-pseudoaxis-common-eulerians.lo \
+	libhkl_la-hkl-pseudoaxis-common-hkl.lo \
+	libhkl_la-hkl-pseudoaxis-common-psi.lo \
+	libhkl_la-hkl-pseudoaxis-common-q.lo \
+	libhkl_la-hkl-engine-2c.lo libhkl_la-hkl-engine-e4c.lo \
+	libhkl_la-hkl-engine-k4c.lo libhkl_la-hkl-engine-e6c.lo \
+	libhkl_la-hkl-engine-k6c.lo \
+	libhkl_la-hkl-engine-petra3-p09-eh2.lo \
+	libhkl_la-hkl-engine-soleil-sirius-turret.lo \
+	libhkl_la-hkl-engine-soleil-sixs-med.lo \
+	libhkl_la-hkl-engine-zaxis.lo libhkl_la-hkl-quaternion.lo \
+	libhkl_la-hkl-sample.lo libhkl_la-hkl-source.lo \
+	libhkl_la-hkl-unit.lo libhkl_la-hkl-vector.lo
 am__objects_2 =
- at HAVE_INTROSPECTION_TRUE@am__objects_3 = hkl-types.lo \
- at HAVE_INTROSPECTION_TRUE@	hkl-type-builtins.lo hkl-binding.lo
+ at HAVE_INTROSPECTION_TRUE@am__objects_3 = libhkl_la-hkl-types.lo \
+ at HAVE_INTROSPECTION_TRUE@	libhkl_la-hkl-type-builtins.lo \
+ at HAVE_INTROSPECTION_TRUE@	libhkl_la-hkl-binding.lo
 am_libhkl_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
 	$(am__objects_3)
 libhkl_la_OBJECTS = $(am_libhkl_la_OBJECTS)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
+libhkl_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libhkl_la_CFLAGS) \
+	$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 AM_V_P = $(am__v_P_ at AM_V@)
 am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -225,8 +229,8 @@ AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
 am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
-SOURCES = $(libhkl_la_SOURCES)
-DIST_SOURCES = $(am__libhkl_la_SOURCES_DIST)
+SOURCES = $(libdummy_la_SOURCES) $(libhkl_la_SOURCES)
+DIST_SOURCES = $(libdummy_la_SOURCES) $(am__libhkl_la_SOURCES_DIST)
 RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
 	ctags-recursive dvi-recursive html-recursive info-recursive \
 	install-data-recursive install-dvi-recursive \
@@ -305,6 +309,8 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BULLET_CFLAGS = @BULLET_CFLAGS@
+BULLET_LIBS = @BULLET_LIBS@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
@@ -324,6 +330,7 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+EMACS = @EMACS@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
 G3D_CFLAGS = @G3D_CFLAGS@
@@ -343,14 +350,15 @@ GSL_CFLAGS = @GSL_CFLAGS@
 GSL_CONFIG = @GSL_CONFIG@
 GSL_LIBS = @GSL_LIBS@
 GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@
 GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
 GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
 GTKDOC_MKPDF = @GTKDOC_MKPDF@
 GTKDOC_REBASE = @GTKDOC_REBASE@
-GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
-GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
-GTKMM_CFLAGS = @GTKMM_CFLAGS@
-GTKMM_LIBS = @GTKMM_LIBS@
+GTKGLEXT_CFLAGS = @GTKGLEXT_CFLAGS@
+GTKGLEXT_LIBS = @GTKGLEXT_LIBS@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
 HTML_DIR = @HTML_DIR@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -446,7 +454,6 @@ localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
-opengl_LIBS = @opengl_LIBS@
 pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
@@ -462,12 +469,11 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 version_info = @version_info@
 SUBDIRS = ccan
-AM_LDFLAGS = -no-undefined -version-info 5:0:0 $(GSL_LIBS) \
-	$(am__append_2)
-AM_CFLAGS = -I$(top_srcdir) -I$(top_builddir) $(GSL_CFLAGS) \
-	$(am__append_3)
+AM_LDFLAGS = -no-undefined -version-info 5:0:0 $(GLIB_LIBS) \
+	$(GSL_LIBS) $(am__append_2)
+AM_CFLAGS = -DG_LOG_DOMAIN=\"Hkl\" -I$(top_srcdir) -I$(top_builddir) \
+	$(GLIB_CFLAGS) $(GSL_CFLAGS) $(am__append_3)
 hkl_c_sources = \
-	hkl-error.c \
 	hkl-axis.c \
 	hkl-detector.c \
 	hkl-detector-factory.c \
@@ -484,17 +490,15 @@ hkl_c_sources = \
 	hkl-pseudoaxis-common-hkl.c \
 	hkl-pseudoaxis-common-psi.c \
 	hkl-pseudoaxis-common-q.c \
-	hkl-pseudoaxis-e4c-hkl.c \
-	hkl-pseudoaxis-e4c-psi.c \
-	hkl-pseudoaxis-e6c-hkl.c \
-	hkl-pseudoaxis-e6c-psi.c \
-	hkl-pseudoaxis-k4cv-hkl.c \
-	hkl-pseudoaxis-k4cv-psi.c \
-	hkl-pseudoaxis-k6c-hkl.c \
-	hkl-pseudoaxis-k6c-psi.c \
-	hkl-pseudoaxis-zaxis-hkl.c \
-	hkl-pseudoaxis-soleil-sixs-med.c \
-	hkl-pseudoaxis-petra3-hkl.c \
+	hkl-engine-2c.c \
+	hkl-engine-e4c.c \
+	hkl-engine-k4c.c \
+	hkl-engine-e6c.c \
+	hkl-engine-k6c.c \
+	hkl-engine-petra3-p09-eh2.c \
+	hkl-engine-soleil-sirius-turret.c \
+	hkl-engine-soleil-sixs-med.c \
+	hkl-engine-zaxis.c \
 	hkl-quaternion.c \
 	hkl-sample.c \
 	hkl-source.c \
@@ -505,7 +509,6 @@ hkl_public_h_sources = ../hkl.h
 hkl_private_h_sources = \
 	hkl-axis-private.h \
 	hkl-detector-private.h \
-	hkl-error-private.h \
 	hkl-factory-private.h \
 	hkl-geometry-private.h \
 	hkl-interval-private.h \
@@ -519,13 +522,6 @@ hkl_private_h_sources = \
 	hkl-pseudoaxis-common-hkl-private.h \
 	hkl-pseudoaxis-common-q-private.h \
 	hkl-pseudoaxis-common-psi-private.h \
-	hkl-pseudoaxis-e4c-private.h \
-	hkl-pseudoaxis-e6c-private.h \
-	hkl-pseudoaxis-k4cv-private.h \
-	hkl-pseudoaxis-k6c-private.h \
-	hkl-pseudoaxis-zaxis-private.h \
-	hkl-pseudoaxis-soleil-sixs-med-private.h \
-	hkl-pseudoaxis-petra3-private.h \
 	hkl-quaternion-private.h \
 	hkl-sample-private.h \
 	hkl-source-private.h \
@@ -536,6 +532,15 @@ lib_LTLIBRARIES = libhkl.la
 libhkl_la_SOURCES = $(hkl_c_sources) $(hkl_private_h_sources) \
 	$(am__append_1)
 libhkl_la_LIBADD = ccan/libccan.la
+libhkl_la_CFLAGS = \
+	$(AM_CFLAGS) \
+	-Wno-initializer-overrides \
+	-Wno-unused-result # \ do not activate visibility yet.
+
+
+# just compile the template diffractometer to be sure that it is valid
+noinst_LTLIBRARIES = libdummy.la
+libdummy_la_SOURCES = hkl-engine-template.c
 INTROSPECTION_GIRS = $(am__append_4)
 INTROSPECTION_SCANNER_ARGS = \
 	--add-include-path=$(srcdir) \
@@ -550,7 +555,6 @@ INTROSPECTION_COMPILER_ARGS = \
 @HAVE_INTROSPECTION_TRUE@	../hkl.h \
 @HAVE_INTROSPECTION_TRUE@	hkl-binding-private.h \
 @HAVE_INTROSPECTION_TRUE@	hkl-types.h \
- at HAVE_INTROSPECTION_TRUE@	hkl-error.c \
 @HAVE_INTROSPECTION_TRUE@	hkl-matrix.c \
 @HAVE_INTROSPECTION_TRUE@	hkl-parameter.c \
 @HAVE_INTROSPECTION_TRUE@	hkl-axis.c \
@@ -653,8 +657,22 @@ clean-libLTLIBRARIES:
 	  rm -f $${locs}; \
 	}
 
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+
+libdummy.la: $(libdummy_la_OBJECTS) $(libdummy_la_DEPENDENCIES) $(EXTRA_libdummy_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(LINK)  $(libdummy_la_OBJECTS) $(libdummy_la_LIBADD) $(LIBS)
+
 libhkl.la: $(libhkl_la_OBJECTS) $(libhkl_la_DEPENDENCIES) $(EXTRA_libhkl_la_DEPENDENCIES) 
-	$(AM_V_CCLD)$(LINK) -rpath $(libdir) $(libhkl_la_OBJECTS) $(libhkl_la_LIBADD) $(LIBS)
+	$(AM_V_CCLD)$(libhkl_la_LINK) -rpath $(libdir) $(libhkl_la_OBJECTS) $(libhkl_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -662,64 +680,296 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-axis.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-binding.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-detector-factory.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-detector.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-error.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-factory.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-geometry.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-interval.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-lattice.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-macros.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-matrix.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-parameter.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-auto.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-common-eulerians.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-common-hkl.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-common-psi.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-common-q.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-e4c-hkl.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-e4c-psi.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-e6c-hkl.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-e6c-psi.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-k4cv-hkl.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-k4cv-psi.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-k6c-hkl.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-k6c-psi.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-petra3-hkl.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-soleil-sixs-med.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-zaxis-hkl.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-quaternion.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-sample.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-source.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-type-builtins.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-types.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-unit.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-vector.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-engine-template.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-axis.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-binding.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-detector-factory.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-detector.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-engine-2c.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-engine-e4c.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-engine-e6c.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-engine-k4c.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-engine-k6c.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-engine-petra3-p09-eh2.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-engine-soleil-sirius-turret.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-engine-soleil-sixs-med.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-engine-zaxis.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-factory.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-geometry.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-interval.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-lattice.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-macros.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-matrix.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-parameter.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-pseudoaxis-auto.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-pseudoaxis-common-eulerians.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-pseudoaxis-common-hkl.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-pseudoaxis-common-psi.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-pseudoaxis-common-q.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-pseudoaxis.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-quaternion.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-sample.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-source.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-type-builtins.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-types.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-unit.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libhkl_la-hkl-vector.Plo at am__quote@
 
 .c.o:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+ at am__fastdepCC_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c $<
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
 
 .c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+ at am__fastdepCC_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
 .c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at am__fastdepCC_TRUE@	$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+ at am__fastdepCC_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
+libhkl_la-hkl-axis.lo: hkl-axis.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-axis.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-axis.Tpo -c -o libhkl_la-hkl-axis.lo `test -f 'hkl-axis.c' || echo '$(srcdir)/'`hkl-axis.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-axis.Tpo $(DEPDIR)/libhkl_la-hkl-axis.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-axis.c' object='libhkl_la-hkl-axis.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-axis.lo `test -f 'hkl-axis.c' || echo '$(srcdir)/'`hkl-axis.c
+
+libhkl_la-hkl-detector.lo: hkl-detector.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-detector.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-detector.Tpo -c -o libhkl_la-hkl-detector.lo `test -f 'hkl-detector.c' || echo '$(srcdir)/'`hkl-detector.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-detector.Tpo $(DEPDIR)/libhkl_la-hkl-detector.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-detector.c' object='libhkl_la-hkl-detector.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-detector.lo `test -f 'hkl-detector.c' || echo '$(srcdir)/'`hkl-detector.c
+
+libhkl_la-hkl-detector-factory.lo: hkl-detector-factory.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-detector-factory.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-detector-factory.Tpo -c -o libhkl_la-hkl-detector-factory.lo `test -f 'hkl-detector-factory.c' || echo '$(srcdir)/'`hkl-detector-factory.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-detector-factory.Tpo $(DEPDIR)/libhkl_la-hkl-detector-factory.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-detector-factory.c' object='libhkl_la-hkl-detector-factory.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-detector-factory.lo `test -f 'hkl-detector-factory.c' || echo '$(srcdir)/'`hkl-detector-factory.c
+
+libhkl_la-hkl-factory.lo: hkl-factory.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-factory.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-factory.Tpo -c -o libhkl_la-hkl-factory.lo `test -f 'hkl-factory.c' || echo '$(srcdir)/'`hkl-factory.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-factory.Tpo $(DEPDIR)/libhkl_la-hkl-factory.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-factory.c' object='libhkl_la-hkl-factory.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-factory.lo `test -f 'hkl-factory.c' || echo '$(srcdir)/'`hkl-factory.c
+
+libhkl_la-hkl-geometry.lo: hkl-geometry.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-geometry.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-geometry.Tpo -c -o libhkl_la-hkl-geometry.lo `test -f 'hkl-geometry.c' || echo '$(srcdir)/'`hkl-geometry.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-geometry.Tpo $(DEPDIR)/libhkl_la-hkl-geometry.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-geometry.c' object='libhkl_la-hkl-geometry.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-geometry.lo `test -f 'hkl-geometry.c' || echo '$(srcdir)/'`hkl-geometry.c
+
+libhkl_la-hkl-interval.lo: hkl-interval.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-interval.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-interval.Tpo -c -o libhkl_la-hkl-interval.lo `test -f 'hkl-interval.c' || echo '$(srcdir)/'`hkl-interval.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-interval.Tpo $(DEPDIR)/libhkl_la-hkl-interval.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-interval.c' object='libhkl_la-hkl-interval.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-interval.lo `test -f 'hkl-interval.c' || echo '$(srcdir)/'`hkl-interval.c
+
+libhkl_la-hkl-lattice.lo: hkl-lattice.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-lattice.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-lattice.Tpo -c -o libhkl_la-hkl-lattice.lo `test -f 'hkl-lattice.c' || echo '$(srcdir)/'`hkl-lattice.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-lattice.Tpo $(DEPDIR)/libhkl_la-hkl-lattice.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-lattice.c' object='libhkl_la-hkl-lattice.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-lattice.lo `test -f 'hkl-lattice.c' || echo '$(srcdir)/'`hkl-lattice.c
+
+libhkl_la-hkl-macros.lo: hkl-macros.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-macros.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-macros.Tpo -c -o libhkl_la-hkl-macros.lo `test -f 'hkl-macros.c' || echo '$(srcdir)/'`hkl-macros.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-macros.Tpo $(DEPDIR)/libhkl_la-hkl-macros.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-macros.c' object='libhkl_la-hkl-macros.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-macros.lo `test -f 'hkl-macros.c' || echo '$(srcdir)/'`hkl-macros.c
+
+libhkl_la-hkl-matrix.lo: hkl-matrix.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-matrix.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-matrix.Tpo -c -o libhkl_la-hkl-matrix.lo `test -f 'hkl-matrix.c' || echo '$(srcdir)/'`hkl-matrix.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-matrix.Tpo $(DEPDIR)/libhkl_la-hkl-matrix.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-matrix.c' object='libhkl_la-hkl-matrix.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-matrix.lo `test -f 'hkl-matrix.c' || echo '$(srcdir)/'`hkl-matrix.c
+
+libhkl_la-hkl-parameter.lo: hkl-parameter.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-parameter.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-parameter.Tpo -c -o libhkl_la-hkl-parameter.lo `test -f 'hkl-parameter.c' || echo '$(srcdir)/'`hkl-parameter.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-parameter.Tpo $(DEPDIR)/libhkl_la-hkl-parameter.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-parameter.c' object='libhkl_la-hkl-parameter.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-parameter.lo `test -f 'hkl-parameter.c' || echo '$(srcdir)/'`hkl-parameter.c
+
+libhkl_la-hkl-pseudoaxis.lo: hkl-pseudoaxis.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-pseudoaxis.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-pseudoaxis.Tpo -c -o libhkl_la-hkl-pseudoaxis.lo `test -f 'hkl-pseudoaxis.c' || echo '$(srcdir)/'`hkl-pseudoaxis.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-pseudoaxis.Tpo $(DEPDIR)/libhkl_la-hkl-pseudoaxis.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-pseudoaxis.c' object='libhkl_la-hkl-pseudoaxis.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-pseudoaxis.lo `test -f 'hkl-pseudoaxis.c' || echo '$(srcdir)/'`hkl-pseudoaxis.c
+
+libhkl_la-hkl-pseudoaxis-auto.lo: hkl-pseudoaxis-auto.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-pseudoaxis-auto.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-pseudoaxis-auto.Tpo -c -o libhkl_la-hkl-pseudoaxis-auto.lo `test -f 'hkl-pseudoaxis-auto.c' || echo '$(srcdir)/'`hkl-pseudoaxis-auto.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-pseudoaxis-auto.Tpo $(DEPDIR)/libhkl_la-hkl-pseudoaxis-auto.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-pseudoaxis-auto.c' object='libhkl_la-hkl-pseudoaxis-auto.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-pseudoaxis-auto.lo `test -f 'hkl-pseudoaxis-auto.c' || echo '$(srcdir)/'`hkl-pseudoaxis-auto.c
+
+libhkl_la-hkl-pseudoaxis-common-eulerians.lo: hkl-pseudoaxis-common-eulerians.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-pseudoaxis-common-eulerians.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-pseudoaxis-common-eulerians.Tpo -c -o libhkl_la-hkl-pseudoaxis-common-eulerians.lo `test -f 'hkl-pseudoaxis-common-eulerians.c' || echo '$(srcdir)/'`hkl-pseudoaxis-common-eulerians.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-pseudoaxis-common-eulerians.Tpo $(DEPDIR)/libhkl_la-hkl-pseudoaxis-common-eulerians.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-pseudoaxis-common-eulerians.c' object='libhkl_la-hkl-pseudoaxis-common-eulerians.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-pseudoaxis-common-eulerians.lo `test -f 'hkl-pseudoaxis-common-eulerians.c' || echo '$(srcdir)/'`hkl-pseudoaxis-common-eulerians.c
+
+libhkl_la-hkl-pseudoaxis-common-hkl.lo: hkl-pseudoaxis-common-hkl.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-pseudoaxis-common-hkl.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-pseudoaxis-common-hkl.Tpo -c -o libhkl_la-hkl-pseudoaxis-common-hkl.lo `test -f 'hkl-pseudoaxis-common-hkl.c' || echo '$(srcdir)/'`hkl-pseudoaxis-common-hkl.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-pseudoaxis-common-hkl.Tpo $(DEPDIR)/libhkl_la-hkl-pseudoaxis-common-hkl.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-pseudoaxis-common-hkl.c' object='libhkl_la-hkl-pseudoaxis-common-hkl.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-pseudoaxis-common-hkl.lo `test -f 'hkl-pseudoaxis-common-hkl.c' || echo '$(srcdir)/'`hkl-pseudoaxis-common-hkl.c
+
+libhkl_la-hkl-pseudoaxis-common-psi.lo: hkl-pseudoaxis-common-psi.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-pseudoaxis-common-psi.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-pseudoaxis-common-psi.Tpo -c -o libhkl_la-hkl-pseudoaxis-common-psi.lo `test -f 'hkl-pseudoaxis-common-psi.c' || echo '$(srcdir)/'`hkl-pseudoaxis-common-psi.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-pseudoaxis-common-psi.Tpo $(DEPDIR)/libhkl_la-hkl-pseudoaxis-common-psi.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-pseudoaxis-common-psi.c' object='libhkl_la-hkl-pseudoaxis-common-psi.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-pseudoaxis-common-psi.lo `test -f 'hkl-pseudoaxis-common-psi.c' || echo '$(srcdir)/'`hkl-pseudoaxis-common-psi.c
+
+libhkl_la-hkl-pseudoaxis-common-q.lo: hkl-pseudoaxis-common-q.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-pseudoaxis-common-q.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-pseudoaxis-common-q.Tpo -c -o libhkl_la-hkl-pseudoaxis-common-q.lo `test -f 'hkl-pseudoaxis-common-q.c' || echo '$(srcdir)/'`hkl-pseudoaxis-common-q.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-pseudoaxis-common-q.Tpo $(DEPDIR)/libhkl_la-hkl-pseudoaxis-common-q.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-pseudoaxis-common-q.c' object='libhkl_la-hkl-pseudoaxis-common-q.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-pseudoaxis-common-q.lo `test -f 'hkl-pseudoaxis-common-q.c' || echo '$(srcdir)/'`hkl-pseudoaxis-common-q.c
+
+libhkl_la-hkl-engine-2c.lo: hkl-engine-2c.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-engine-2c.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-engine-2c.Tpo -c -o libhkl_la-hkl-engine-2c.lo `test -f 'hkl-engine-2c.c' || echo '$(srcdir)/'`hkl-engine-2c.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-engine-2c.Tpo $(DEPDIR)/libhkl_la-hkl-engine-2c.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-engine-2c.c' object='libhkl_la-hkl-engine-2c.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-engine-2c.lo `test -f 'hkl-engine-2c.c' || echo '$(srcdir)/'`hkl-engine-2c.c
+
+libhkl_la-hkl-engine-e4c.lo: hkl-engine-e4c.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-engine-e4c.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-engine-e4c.Tpo -c -o libhkl_la-hkl-engine-e4c.lo `test -f 'hkl-engine-e4c.c' || echo '$(srcdir)/'`hkl-engine-e4c.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-engine-e4c.Tpo $(DEPDIR)/libhkl_la-hkl-engine-e4c.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-engine-e4c.c' object='libhkl_la-hkl-engine-e4c.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-engine-e4c.lo `test -f 'hkl-engine-e4c.c' || echo '$(srcdir)/'`hkl-engine-e4c.c
+
+libhkl_la-hkl-engine-k4c.lo: hkl-engine-k4c.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-engine-k4c.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-engine-k4c.Tpo -c -o libhkl_la-hkl-engine-k4c.lo `test -f 'hkl-engine-k4c.c' || echo '$(srcdir)/'`hkl-engine-k4c.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-engine-k4c.Tpo $(DEPDIR)/libhkl_la-hkl-engine-k4c.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-engine-k4c.c' object='libhkl_la-hkl-engine-k4c.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-engine-k4c.lo `test -f 'hkl-engine-k4c.c' || echo '$(srcdir)/'`hkl-engine-k4c.c
+
+libhkl_la-hkl-engine-e6c.lo: hkl-engine-e6c.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-engine-e6c.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-engine-e6c.Tpo -c -o libhkl_la-hkl-engine-e6c.lo `test -f 'hkl-engine-e6c.c' || echo '$(srcdir)/'`hkl-engine-e6c.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-engine-e6c.Tpo $(DEPDIR)/libhkl_la-hkl-engine-e6c.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-engine-e6c.c' object='libhkl_la-hkl-engine-e6c.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-engine-e6c.lo `test -f 'hkl-engine-e6c.c' || echo '$(srcdir)/'`hkl-engine-e6c.c
+
+libhkl_la-hkl-engine-k6c.lo: hkl-engine-k6c.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-engine-k6c.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-engine-k6c.Tpo -c -o libhkl_la-hkl-engine-k6c.lo `test -f 'hkl-engine-k6c.c' || echo '$(srcdir)/'`hkl-engine-k6c.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-engine-k6c.Tpo $(DEPDIR)/libhkl_la-hkl-engine-k6c.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-engine-k6c.c' object='libhkl_la-hkl-engine-k6c.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-engine-k6c.lo `test -f 'hkl-engine-k6c.c' || echo '$(srcdir)/'`hkl-engine-k6c.c
+
+libhkl_la-hkl-engine-petra3-p09-eh2.lo: hkl-engine-petra3-p09-eh2.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-engine-petra3-p09-eh2.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-engine-petra3-p09-eh2.Tpo -c -o libhkl_la-hkl-engine-petra3-p09-eh2.lo `test -f 'hkl-engine-petra3-p09-eh2.c' || echo '$(srcdir)/'`hkl-engine-petra3-p09-eh2.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-engine-petra3-p09-eh2.Tpo $(DEPDIR)/libhkl_la-hkl-engine-petra3-p09-eh2.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-engine-petra3-p09-eh2.c' object='libhkl_la-hkl-engine-petra3-p09-eh2.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-engine-petra3-p09-eh2.lo `test -f 'hkl-engine-petra3-p09-eh2.c' || echo '$(srcdir)/'`hkl-engine-petra3-p09-eh2.c
+
+libhkl_la-hkl-engine-soleil-sirius-turret.lo: hkl-engine-soleil-sirius-turret.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-engine-soleil-sirius-turret.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-engine-soleil-sirius-turret.Tpo -c -o libhkl_la-hkl-engine-soleil-sirius-turret.lo `test -f 'hkl-engine-soleil-sirius-turret.c' || echo '$(srcdir)/'`hkl-engine-soleil-sirius-turret.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-engine-soleil-sirius-turret.Tpo $(DEPDIR)/libhkl_la-hkl-engine-soleil-sirius-turret.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-engine-soleil-sirius-turret.c' object='libhkl_la-hkl-engine-soleil-sirius-turret.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-engine-soleil-sirius-turret.lo `test -f 'hkl-engine-soleil-sirius-turret.c' || echo '$(srcdir)/'`hkl-engine-soleil-sirius-turret.c
+
+libhkl_la-hkl-engine-soleil-sixs-med.lo: hkl-engine-soleil-sixs-med.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-engine-soleil-sixs-med.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-engine-soleil-sixs-med.Tpo -c -o libhkl_la-hkl-engine-soleil-sixs-med.lo `test -f 'hkl-engine-soleil-sixs-med.c' || echo '$(srcdir)/'`hkl-engine-soleil-sixs-med.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-engine-soleil-sixs-med.Tpo $(DEPDIR)/libhkl_la-hkl-engine-soleil-sixs-med.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-engine-soleil-sixs-med.c' object='libhkl_la-hkl-engine-soleil-sixs-med.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-engine-soleil-sixs-med.lo `test -f 'hkl-engine-soleil-sixs-med.c' || echo '$(srcdir)/'`hkl-engine-soleil-sixs-med.c
+
+libhkl_la-hkl-engine-zaxis.lo: hkl-engine-zaxis.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-engine-zaxis.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-engine-zaxis.Tpo -c -o libhkl_la-hkl-engine-zaxis.lo `test -f 'hkl-engine-zaxis.c' || echo '$(srcdir)/'`hkl-engine-zaxis.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-engine-zaxis.Tpo $(DEPDIR)/libhkl_la-hkl-engine-zaxis.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-engine-zaxis.c' object='libhkl_la-hkl-engine-zaxis.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-engine-zaxis.lo `test -f 'hkl-engine-zaxis.c' || echo '$(srcdir)/'`hkl-engine-zaxis.c
+
+libhkl_la-hkl-quaternion.lo: hkl-quaternion.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-quaternion.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-quaternion.Tpo -c -o libhkl_la-hkl-quaternion.lo `test -f 'hkl-quaternion.c' || echo '$(srcdir)/'`hkl-quaternion.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-quaternion.Tpo $(DEPDIR)/libhkl_la-hkl-quaternion.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-quaternion.c' object='libhkl_la-hkl-quaternion.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-quaternion.lo `test -f 'hkl-quaternion.c' || echo '$(srcdir)/'`hkl-quaternion.c
+
+libhkl_la-hkl-sample.lo: hkl-sample.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-sample.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-sample.Tpo -c -o libhkl_la-hkl-sample.lo `test -f 'hkl-sample.c' || echo '$(srcdir)/'`hkl-sample.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-sample.Tpo $(DEPDIR)/libhkl_la-hkl-sample.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-sample.c' object='libhkl_la-hkl-sample.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-sample.lo `test -f 'hkl-sample.c' || echo '$(srcdir)/'`hkl-sample.c
+
+libhkl_la-hkl-source.lo: hkl-source.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-source.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-source.Tpo -c -o libhkl_la-hkl-source.lo `test -f 'hkl-source.c' || echo '$(srcdir)/'`hkl-source.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-source.Tpo $(DEPDIR)/libhkl_la-hkl-source.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-source.c' object='libhkl_la-hkl-source.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-source.lo `test -f 'hkl-source.c' || echo '$(srcdir)/'`hkl-source.c
+
+libhkl_la-hkl-unit.lo: hkl-unit.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-unit.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-unit.Tpo -c -o libhkl_la-hkl-unit.lo `test -f 'hkl-unit.c' || echo '$(srcdir)/'`hkl-unit.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-unit.Tpo $(DEPDIR)/libhkl_la-hkl-unit.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-unit.c' object='libhkl_la-hkl-unit.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-unit.lo `test -f 'hkl-unit.c' || echo '$(srcdir)/'`hkl-unit.c
+
+libhkl_la-hkl-vector.lo: hkl-vector.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-vector.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-vector.Tpo -c -o libhkl_la-hkl-vector.lo `test -f 'hkl-vector.c' || echo '$(srcdir)/'`hkl-vector.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-vector.Tpo $(DEPDIR)/libhkl_la-hkl-vector.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-vector.c' object='libhkl_la-hkl-vector.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-vector.lo `test -f 'hkl-vector.c' || echo '$(srcdir)/'`hkl-vector.c
+
+libhkl_la-hkl-types.lo: hkl-types.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-types.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-types.Tpo -c -o libhkl_la-hkl-types.lo `test -f 'hkl-types.c' || echo '$(srcdir)/'`hkl-types.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-types.Tpo $(DEPDIR)/libhkl_la-hkl-types.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-types.c' object='libhkl_la-hkl-types.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-types.lo `test -f 'hkl-types.c' || echo '$(srcdir)/'`hkl-types.c
+
+libhkl_la-hkl-type-builtins.lo: hkl-type-builtins.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-type-builtins.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-type-builtins.Tpo -c -o libhkl_la-hkl-type-builtins.lo `test -f 'hkl-type-builtins.c' || echo '$(srcdir)/'`hkl-type-builtins.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-type-builtins.Tpo $(DEPDIR)/libhkl_la-hkl-type-builtins.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-type-builtins.c' object='libhkl_la-hkl-type-builtins.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-type-builtins.lo `test -f 'hkl-type-builtins.c' || echo '$(srcdir)/'`hkl-type-builtins.c
+
+libhkl_la-hkl-binding.lo: hkl-binding.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -MT libhkl_la-hkl-binding.lo -MD -MP -MF $(DEPDIR)/libhkl_la-hkl-binding.Tpo -c -o libhkl_la-hkl-binding.lo `test -f 'hkl-binding.c' || echo '$(srcdir)/'`hkl-binding.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libhkl_la-hkl-binding.Tpo $(DEPDIR)/libhkl_la-hkl-binding.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='hkl-binding.c' object='libhkl_la-hkl-binding.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhkl_la_CFLAGS) $(CFLAGS) -c -o libhkl_la-hkl-binding.lo `test -f 'hkl-binding.c' || echo '$(srcdir)/'`hkl-binding.c
+
 mostlyclean-libtool:
 	-rm -f *.lo
 
@@ -964,7 +1214,7 @@ maintainer-clean-generic:
 clean: clean-recursive
 
 clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
-	mostlyclean-am
+	clean-noinstLTLIBRARIES mostlyclean-am
 
 distclean: distclean-recursive
 	-rm -rf ./$(DEPDIR)
@@ -1037,22 +1287,22 @@ uninstall-am: uninstall-girDATA uninstall-libLTLIBRARIES \
 
 .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
 	check-am clean clean-generic clean-libLTLIBRARIES \
-	clean-libtool cscopelist-am ctags ctags-am distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-girDATA \
-	install-html install-html-am install-info install-info-am \
-	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip install-typelibsDATA \
-	installcheck installcheck-am installdirs installdirs-am \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
-	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
-	uninstall-girDATA uninstall-libLTLIBRARIES \
-	uninstall-typelibsDATA
-
-	-fvisibility=hiden
+	clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
+	ctags-am distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-girDATA install-html install-html-am \
+	install-info install-info-am install-libLTLIBRARIES \
+	install-man install-pdf install-pdf-am install-ps \
+	install-ps-am install-strip install-typelibsDATA installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-am uninstall uninstall-am uninstall-girDATA \
+	uninstall-libLTLIBRARIES uninstall-typelibsDATA
+
+	-fvisibility=hidden
 
 # introspection
 
@@ -1080,7 +1330,14 @@ check-syntax: AM_CFLAGS += -fsyntax-only -pipe
 check-syntax:
 	test -z "$(CHK_SOURCES)" || $(COMPILE) $(CHK_SOURCES)
 
-.PHONY: check-syntax
+# check for includes with iwyu
+iwyu:
+	@list='$(libhkl_la_SOURCES)';\
+	for p in $$list; do\
+		iwyu $(AM_CFLAGS) $$p; \
+	done;
+
+.PHONY: check-syntax iwyu
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/hkl/ccan/Makefile.am b/hkl/ccan/Makefile.am
index 4725b8f..92605d1 100644
--- a/hkl/ccan/Makefile.am
+++ b/hkl/ccan/Makefile.am
@@ -2,20 +2,24 @@ AM_CFLAGS=-I$(top_srcdir)
 
 noinst_LTLIBRARIES=libccan.la
 libccan_la_SOURCES = \
-	list/list.h \
-	list/list.c \
-	noerr/noerr.c \
-	noerr/noerr.h \
+	str/debug.c \
+	str/str.c \
+	str/str.h \
+	str/str_debug.h \
+	build_assert/build_assert.h \
+	darray/darray.h \
 	ptr_valid/ptr_valid.c \
 	ptr_valid/ptr_valid.h \
-	check_type/check_type.h \
-	compiler/compiler.h \
+	noerr/noerr.h \
+	noerr/noerr.c \
 	autodata/autodata.c \
 	autodata/autodata.h \
-	container_of/container_of.h \
+	check_type/check_type.h \
+	compiler/compiler.h \
 	array_size/array_size.h \
-	darray/darray.h \
-	build_assert/build_assert.h
+	list/list.h \
+	list/list.c \
+	container_of/container_of.h
 
 ccanincludedir=$(includedir)/hkl- at VMAJ@/hkl/ccan
 nobase_ccaninclude_HEADERS= \
diff --git a/hkl/ccan/Makefile.in b/hkl/ccan/Makefile.in
index 414f1af..f4fb219 100644
--- a/hkl/ccan/Makefile.in
+++ b/hkl/ccan/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
@@ -95,7 +95,9 @@ CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 LTLIBRARIES = $(noinst_LTLIBRARIES)
 libccan_la_LIBADD =
-am_libccan_la_OBJECTS = list.lo noerr.lo ptr_valid.lo autodata.lo
+am__dirstamp = $(am__leading_dot)dirstamp
+am_libccan_la_OBJECTS = str/debug.lo str/str.lo ptr_valid/ptr_valid.lo \
+	noerr/noerr.lo autodata/autodata.lo list/list.lo
 libccan_la_OBJECTS = $(am_libccan_la_OBJECTS)
 AM_V_lt = $(am__v_lt_ at AM_V@)
 am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
@@ -201,6 +203,8 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BULLET_CFLAGS = @BULLET_CFLAGS@
+BULLET_LIBS = @BULLET_LIBS@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
@@ -220,6 +224,7 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+EMACS = @EMACS@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
 G3D_CFLAGS = @G3D_CFLAGS@
@@ -239,14 +244,15 @@ GSL_CFLAGS = @GSL_CFLAGS@
 GSL_CONFIG = @GSL_CONFIG@
 GSL_LIBS = @GSL_LIBS@
 GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@
 GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
 GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
 GTKDOC_MKPDF = @GTKDOC_MKPDF@
 GTKDOC_REBASE = @GTKDOC_REBASE@
-GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
-GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
-GTKMM_CFLAGS = @GTKMM_CFLAGS@
-GTKMM_LIBS = @GTKMM_LIBS@
+GTKGLEXT_CFLAGS = @GTKGLEXT_CFLAGS@
+GTKGLEXT_LIBS = @GTKGLEXT_LIBS@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
 HTML_DIR = @HTML_DIR@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -342,7 +348,6 @@ localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
-opengl_LIBS = @opengl_LIBS@
 pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
@@ -360,20 +365,24 @@ version_info = @version_info@
 AM_CFLAGS = -I$(top_srcdir)
 noinst_LTLIBRARIES = libccan.la
 libccan_la_SOURCES = \
-	list/list.h \
-	list/list.c \
-	noerr/noerr.c \
-	noerr/noerr.h \
+	str/debug.c \
+	str/str.c \
+	str/str.h \
+	str/str_debug.h \
+	build_assert/build_assert.h \
+	darray/darray.h \
 	ptr_valid/ptr_valid.c \
 	ptr_valid/ptr_valid.h \
-	check_type/check_type.h \
-	compiler/compiler.h \
+	noerr/noerr.h \
+	noerr/noerr.c \
 	autodata/autodata.c \
 	autodata/autodata.h \
-	container_of/container_of.h \
+	check_type/check_type.h \
+	compiler/compiler.h \
 	array_size/array_size.h \
-	darray/darray.h \
-	build_assert/build_assert.h
+	list/list.h \
+	list/list.c \
+	container_of/container_of.h
 
 ccanincludedir = $(includedir)/hkl- at VMAJ@/hkl/ccan
 nobase_ccaninclude_HEADERS = \
@@ -424,75 +433,105 @@ clean-noinstLTLIBRARIES:
 	  echo rm -f $${locs}; \
 	  rm -f $${locs}; \
 	}
+str/$(am__dirstamp):
+	@$(MKDIR_P) str
+	@: > str/$(am__dirstamp)
+str/$(DEPDIR)/$(am__dirstamp):
+	@$(MKDIR_P) str/$(DEPDIR)
+	@: > str/$(DEPDIR)/$(am__dirstamp)
+str/debug.lo: str/$(am__dirstamp) str/$(DEPDIR)/$(am__dirstamp)
+str/str.lo: str/$(am__dirstamp) str/$(DEPDIR)/$(am__dirstamp)
+ptr_valid/$(am__dirstamp):
+	@$(MKDIR_P) ptr_valid
+	@: > ptr_valid/$(am__dirstamp)
+ptr_valid/$(DEPDIR)/$(am__dirstamp):
+	@$(MKDIR_P) ptr_valid/$(DEPDIR)
+	@: > ptr_valid/$(DEPDIR)/$(am__dirstamp)
+ptr_valid/ptr_valid.lo: ptr_valid/$(am__dirstamp) \
+	ptr_valid/$(DEPDIR)/$(am__dirstamp)
+noerr/$(am__dirstamp):
+	@$(MKDIR_P) noerr
+	@: > noerr/$(am__dirstamp)
+noerr/$(DEPDIR)/$(am__dirstamp):
+	@$(MKDIR_P) noerr/$(DEPDIR)
+	@: > noerr/$(DEPDIR)/$(am__dirstamp)
+noerr/noerr.lo: noerr/$(am__dirstamp) noerr/$(DEPDIR)/$(am__dirstamp)
+autodata/$(am__dirstamp):
+	@$(MKDIR_P) autodata
+	@: > autodata/$(am__dirstamp)
+autodata/$(DEPDIR)/$(am__dirstamp):
+	@$(MKDIR_P) autodata/$(DEPDIR)
+	@: > autodata/$(DEPDIR)/$(am__dirstamp)
+autodata/autodata.lo: autodata/$(am__dirstamp) \
+	autodata/$(DEPDIR)/$(am__dirstamp)
+list/$(am__dirstamp):
+	@$(MKDIR_P) list
+	@: > list/$(am__dirstamp)
+list/$(DEPDIR)/$(am__dirstamp):
+	@$(MKDIR_P) list/$(DEPDIR)
+	@: > list/$(DEPDIR)/$(am__dirstamp)
+list/list.lo: list/$(am__dirstamp) list/$(DEPDIR)/$(am__dirstamp)
 
 libccan.la: $(libccan_la_OBJECTS) $(libccan_la_DEPENDENCIES) $(EXTRA_libccan_la_DEPENDENCIES) 
 	$(AM_V_CCLD)$(LINK)  $(libccan_la_OBJECTS) $(libccan_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
+	-rm -f autodata/*.$(OBJEXT)
+	-rm -f autodata/*.lo
+	-rm -f list/*.$(OBJEXT)
+	-rm -f list/*.lo
+	-rm -f noerr/*.$(OBJEXT)
+	-rm -f noerr/*.lo
+	-rm -f ptr_valid/*.$(OBJEXT)
+	-rm -f ptr_valid/*.lo
+	-rm -f str/*.$(OBJEXT)
+	-rm -f str/*.lo
 
 distclean-compile:
 	-rm -f *.tab.c
 
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/autodata.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/list.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/noerr.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ptr_valid.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at autodata/$(DEPDIR)/autodata.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at list/$(DEPDIR)/list.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at noerr/$(DEPDIR)/noerr.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ptr_valid/$(DEPDIR)/ptr_valid.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at str/$(DEPDIR)/debug.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at str/$(DEPDIR)/str.Plo at am__quote@
 
 .c.o:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+ at am__fastdepCC_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c $<
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
 
 .c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+ at am__fastdepCC_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
 .c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at am__fastdepCC_TRUE@	$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+ at am__fastdepCC_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
-list.lo: list/list.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT list.lo -MD -MP -MF $(DEPDIR)/list.Tpo -c -o list.lo `test -f 'list/list.c' || echo '$(srcdir)/'`list/list.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/list.Tpo $(DEPDIR)/list.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='list/list.c' object='list.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o list.lo `test -f 'list/list.c' || echo '$(srcdir)/'`list/list.c
-
-noerr.lo: noerr/noerr.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT noerr.lo -MD -MP -MF $(DEPDIR)/noerr.Tpo -c -o noerr.lo `test -f 'noerr/noerr.c' || echo '$(srcdir)/'`noerr/noerr.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/noerr.Tpo $(DEPDIR)/noerr.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='noerr/noerr.c' object='noerr.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o noerr.lo `test -f 'noerr/noerr.c' || echo '$(srcdir)/'`noerr/noerr.c
-
-ptr_valid.lo: ptr_valid/ptr_valid.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ptr_valid.lo -MD -MP -MF $(DEPDIR)/ptr_valid.Tpo -c -o ptr_valid.lo `test -f 'ptr_valid/ptr_valid.c' || echo '$(srcdir)/'`ptr_valid/ptr_valid.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/ptr_valid.Tpo $(DEPDIR)/ptr_valid.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='ptr_valid/ptr_valid.c' object='ptr_valid.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ptr_valid.lo `test -f 'ptr_valid/ptr_valid.c' || echo '$(srcdir)/'`ptr_valid/ptr_valid.c
-
-autodata.lo: autodata/autodata.c
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT autodata.lo -MD -MP -MF $(DEPDIR)/autodata.Tpo -c -o autodata.lo `test -f 'autodata/autodata.c' || echo '$(srcdir)/'`autodata/autodata.c
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/autodata.Tpo $(DEPDIR)/autodata.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='autodata/autodata.c' object='autodata.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o autodata.lo `test -f 'autodata/autodata.c' || echo '$(srcdir)/'`autodata/autodata.c
-
 mostlyclean-libtool:
 	-rm -f *.lo
 
 clean-libtool:
 	-rm -rf .libs _libs
+	-rm -rf autodata/.libs autodata/_libs
+	-rm -rf list/.libs list/_libs
+	-rm -rf noerr/.libs noerr/_libs
+	-rm -rf ptr_valid/.libs ptr_valid/_libs
+	-rm -rf str/.libs str/_libs
 install-nobase_ccanincludeHEADERS: $(nobase_ccaninclude_HEADERS)
 	@$(NORMAL_INSTALL)
 	@list='$(nobase_ccaninclude_HEADERS)'; test -n "$(ccanincludedir)" || list=; \
@@ -633,6 +672,16 @@ clean-generic:
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
 	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+	-rm -f autodata/$(DEPDIR)/$(am__dirstamp)
+	-rm -f autodata/$(am__dirstamp)
+	-rm -f list/$(DEPDIR)/$(am__dirstamp)
+	-rm -f list/$(am__dirstamp)
+	-rm -f noerr/$(DEPDIR)/$(am__dirstamp)
+	-rm -f noerr/$(am__dirstamp)
+	-rm -f ptr_valid/$(DEPDIR)/$(am__dirstamp)
+	-rm -f ptr_valid/$(am__dirstamp)
+	-rm -f str/$(DEPDIR)/$(am__dirstamp)
+	-rm -f str/$(am__dirstamp)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -643,7 +692,7 @@ clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
 	mostlyclean-am
 
 distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
+	-rm -rf autodata/$(DEPDIR) list/$(DEPDIR) noerr/$(DEPDIR) ptr_valid/$(DEPDIR) str/$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
@@ -689,7 +738,7 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
+	-rm -rf autodata/$(DEPDIR) list/$(DEPDIR) noerr/$(DEPDIR) ptr_valid/$(DEPDIR) str/$(DEPDIR)
 	-rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
diff --git a/hkl/ccan/autodata/autodata.h b/hkl/ccan/autodata/autodata.h
index b8a5273..f94fa74 100644
--- a/hkl/ccan/autodata/autodata.h
+++ b/hkl/ccan/autodata/autodata.h
@@ -59,7 +59,8 @@
  * Example:
  *	static void print_embedded_names(void)
  *	{
- *		unsigned int i, num;
+ *		unsigned int i;
+ *		size_t num;
  *		char **n = autodata_get(names, &num);
  *
  *		for (i = 0; i < num; i++)
diff --git a/hkl/ccan/compiler/compiler.h b/hkl/ccan/compiler/compiler.h
index 651b47c..bce4f25 100644
--- a/hkl/ccan/compiler/compiler.h
+++ b/hkl/ccan/compiler/compiler.h
@@ -17,7 +17,7 @@
  *	fprintf(stderr, "Error: %s (%s)\n", reason, strerror(errno));
  * }
  */
-#define COLD __attribute__((cold))
+#define COLD __attribute__((__cold__))
 #else
 #define COLD
 #endif
@@ -37,7 +37,7 @@
  *	exit(1);
  * }
  */
-#define NORETURN __attribute__((noreturn))
+#define NORETURN __attribute__((__noreturn__))
 #else
 #define NORETURN
 #endif
@@ -71,10 +71,24 @@
  * same value for the exact same arguments.  This implies that the function
  * must not use global variables, or dereference pointer arguments.
  */
-#define CONST_FUNCTION __attribute__((const))
+#define CONST_FUNCTION __attribute__((__const__))
 #else
 #define CONST_FUNCTION
 #endif
+
+#ifndef PURE_FUNCTION
+#if HAVE_ATTRIBUTE_PURE
+/**
+ * PURE_FUNCTION - a function is pure
+ *
+ * A pure function is one that has no side effects other than it's return value
+ * and uses no inputs other than it's arguments and global variables.
+ */
+#define PURE_FUNCTION __attribute__((__pure__))
+#else
+#define PURE_FUNCTION
+#endif
+#endif
 #endif
 
 #if HAVE_ATTRIBUTE_UNUSED
@@ -95,7 +109,7 @@
  *	counter += add;
  * }
  */
-#define UNNEEDED __attribute__((unused))
+#define UNNEEDED __attribute__((__unused__))
 #endif
 
 #ifndef NEEDED
@@ -114,10 +128,10 @@
  *		printf("Counter is %i\n", counter);
  *	}
  */
-#define NEEDED __attribute__((used))
+#define NEEDED __attribute__((__used__))
 #else
 /* Before used, unused functions and vars were always emitted. */
-#define NEEDED __attribute__((unused))
+#define NEEDED __attribute__((__unused__))
 #endif
 #endif
 
@@ -136,7 +150,7 @@
  *		return 0;
  *	}
  */
-#define UNUSED __attribute__((unused))
+#define UNUSED __attribute__((__unused__))
 #endif
 #else
 #ifndef UNNEEDED
@@ -209,7 +223,7 @@
  *	return realloc(buf, (*size) *= 2);
  * }
  */
-#define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
+#define WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))
 #else
 #define WARN_UNUSED_RESULT
 #endif
diff --git a/hkl/ccan/container_of/container_of.h b/hkl/ccan/container_of/container_of.h
index 8ccf836..ab73359 100644
--- a/hkl/ccan/container_of/container_of.h
+++ b/hkl/ccan/container_of/container_of.h
@@ -103,7 +103,7 @@
 	container_off(typeof(*var), member)
 #else
 #define container_off_var(var, member)			\
-	((char *)&(var)->member - (char *)(var))
+	((const char *)&(var)->member - (const char *)(var))
 #endif
 
 #endif /* CCAN_CONTAINER_OF_H */
diff --git a/hkl/ccan/list/list.h b/hkl/ccan/list/list.h
index ece2d22..4a15cd7 100644
--- a/hkl/ccan/list/list.h
+++ b/hkl/ccan/list/list.h
@@ -1,8 +1,10 @@
 /* Licensed under BSD-MIT - see LICENSE file for details */
 #ifndef CCAN_LIST_H
 #define CCAN_LIST_H
+//#define CCAN_LIST_DEBUG 1
 #include <stdbool.h>
 #include <assert.h>
+#include <hkl/ccan/str/str.h>
 #include <hkl/ccan/container_of/container_of.h>
 #include <hkl/ccan/check_type/check_type.h>
 
@@ -88,12 +90,13 @@ struct list_head *list_check(const struct list_head *h, const char *abortstr);
 struct list_node *list_check_node(const struct list_node *n,
 				  const char *abortstr);
 
+#define LIST_LOC __FILE__  ":" stringify(__LINE__)
 #ifdef CCAN_LIST_DEBUG
-#define list_debug(h) list_check((h), __func__)
-#define list_debug_node(n) list_check_node((n), __func__)
+#define list_debug(h, loc) list_check((h), loc)
+#define list_debug_node(n, loc) list_check_node((n), loc)
 #else
-#define list_debug(h) (h)
-#define list_debug_node(n) (n)
+#define list_debug(h, loc) (h)
+#define list_debug_node(n, loc) (n)
 #endif
 
 /**
@@ -155,13 +158,16 @@ static inline void list_head_init(struct list_head *h)
  *	list_add(&parent->children, &child->list);
  *	parent->num_children++;
  */
-static inline void list_add(struct list_head *h, struct list_node *n)
+#define list_add(h, n) list_add_(h, n, LIST_LOC)
+static inline void list_add_(struct list_head *h,
+			     struct list_node *n,
+			     const char *abortstr)
 {
 	n->next = h->n.next;
 	n->prev = &h->n;
 	h->n.next->prev = n;
 	h->n.next = n;
-	(void)list_debug(h);
+	(void)list_debug(h, abortstr);
 }
 
 /**
@@ -174,13 +180,16 @@ static inline void list_add(struct list_head *h, struct list_node *n)
  *	list_add_tail(&parent->children, &child->list);
  *	parent->num_children++;
  */
-static inline void list_add_tail(struct list_head *h, struct list_node *n)
+#define list_add_tail(h, n) list_add_tail_(h, n, LIST_LOC)
+static inline void list_add_tail_(struct list_head *h,
+				  struct list_node *n,
+				  const char *abortstr)
 {
 	n->next = &h->n;
 	n->prev = h->n.prev;
 	h->n.prev->next = n;
 	h->n.prev = n;
-	(void)list_debug(h);
+	(void)list_debug(h, abortstr);
 }
 
 /**
@@ -192,13 +201,35 @@ static inline void list_add_tail(struct list_head *h, struct list_node *n)
  * Example:
  *	assert(list_empty(&parent->children) == (parent->num_children == 0));
  */
-static inline bool list_empty(const struct list_head *h)
+#define list_empty(h) list_empty_(h, LIST_LOC)
+static inline bool list_empty_(const struct list_head *h, const char* abortstr)
 {
-	(void)list_debug(h);
+	(void)list_debug(h, abortstr);
 	return h->n.next == &h->n;
 }
 
 /**
+ * list_empty_nodebug - is a list empty (and don't perform debug checks)?
+ * @h: the list_head
+ *
+ * If the list is empty, returns true.
+ * This differs from list_empty() in that if CCAN_LIST_DEBUG is set it
+ * will NOT perform debug checks. Only use this function if you REALLY
+ * know what you're doing.
+ *
+ * Example:
+ *	assert(list_empty_nodebug(&parent->children) == (parent->num_children == 0));
+ */
+#ifndef CCAN_LIST_DEBUG
+#define list_empty_nodebug(h) list_empty(h)
+#else
+static inline bool list_empty_nodebug(const struct list_head *h)
+{
+	return h->n.next == &h->n;
+}
+#endif
+
+/**
  * list_del - delete an entry from an (unknown) linked list.
  * @n: the list_node to delete from the list.
  *
@@ -212,9 +243,10 @@ static inline bool list_empty(const struct list_head *h)
  *	list_del(&child->list);
  *	parent->num_children--;
  */
-static inline void list_del(struct list_node *n)
+#define list_del(n) list_del_(n, LIST_LOC)
+static inline void list_del_(struct list_node *n, const char* abortstr)
 {
-	(void)list_debug_node(n);
+	(void)list_debug_node(n, abortstr);
 	n->next->prev = n->prev;
 	n->prev->next = n->next;
 #ifdef CCAN_LIST_DEBUG
@@ -374,7 +406,7 @@ static inline const void *list_tail_(const struct list_head *h, size_t off)
  *		printf("Name: %s\n", child->name);
  */
 #define list_for_each_rev(h, i, member)					\
-	for (i = container_of_var(list_debug(h)->n.prev, i, member);	\
+	for (i = container_of_var(list_debug(h,	LIST_LOC)->n.prev, i, member); \
 	     &i->member != &(h)->n;					\
 	     i = container_of_var(i->member.prev, i, member))
 
@@ -400,6 +432,45 @@ static inline const void *list_tail_(const struct list_head *h, size_t off)
 	list_for_each_safe_off(h, i, nxt, list_off_var_(i, member))
 
 /**
+ * list_next - get the next entry in a list
+ * @h: the list_head
+ * @i: a pointer to an entry in the list.
+ * @member: the list_node member of the structure
+ *
+ * If @i was the last entry in the list, returns NULL.
+ *
+ * Example:
+ *	struct child *second;
+ *	second = list_next(&parent->children, first, list);
+ *	if (!second)
+ *		printf("No second child!\n");
+ */
+#define list_next(h, i, member)						\
+	((list_typeof(i))list_entry_or_null(list_debug(h,		\
+					    __FILE__ ":" stringify(__LINE__)), \
+					    (i)->member.next,		\
+					    list_off_var_((i), member)))
+
+/**
+ * list_prev - get the previous entry in a list
+ * @h: the list_head
+ * @i: a pointer to an entry in the list.
+ * @member: the list_node member of the structure
+ *
+ * If @i was the first entry in the list, returns NULL.
+ *
+ * Example:
+ *	first = list_prev(&parent->children, second, list);
+ *	if (!first)
+ *		printf("Can't go back to first child?!\n");
+ */
+#define list_prev(h, i, member)						\
+	((list_typeof(i))list_entry_or_null(list_debug(h,		\
+					    __FILE__ ":" stringify(__LINE__)), \
+					    (i)->member.prev,		\
+					    list_off_var_((i), member)))
+
+/**
  * list_append_list - empty one list onto the end of another.
  * @to: the list to append into
  * @from: the list to empty.
@@ -414,11 +485,14 @@ static inline const void *list_tail_(const struct list_head *h, size_t off)
  *	assert(list_empty(&parent->children));
  *	parent->num_children = 0;
  */
-static inline void list_append_list(struct list_head *to,
-				    struct list_head *from)
+#define list_append_list(t, f) list_append_list_(t, f,			\
+				   __FILE__ ":" stringify(__LINE__))
+static inline void list_append_list_(struct list_head *to,
+				     struct list_head *from,
+				     const char *abortstr)
 {
-	struct list_node *from_tail = list_debug(from)->n.prev;
-	struct list_node *to_tail = list_debug(to)->n.prev;
+	struct list_node *from_tail = list_debug(from, abortstr)->n.prev;
+	struct list_node *to_tail = list_debug(to, abortstr)->n.prev;
 
 	/* Sew in head and entire list. */
 	to->n.prev = from_tail;
@@ -444,11 +518,13 @@ static inline void list_append_list(struct list_head *to,
  *	assert(list_empty(&parent->children));
  *	parent->num_children = 0;
  */
-static inline void list_prepend_list(struct list_head *to,
-				     struct list_head *from)
+#define list_prepend_list(t, f) list_prepend_list_(t, f, LIST_LOC)
+static inline void list_prepend_list_(struct list_head *to,
+				      struct list_head *from,
+				      const char *abortstr)
 {
-	struct list_node *from_tail = list_debug(from)->n.prev;
-	struct list_node *to_head = list_debug(to)->n.next;
+	struct list_node *from_tail = list_debug(from, abortstr)->n.prev;
+	struct list_node *to_head = list_debug(to, abortstr)->n.next;
 
 	/* Sew in head and entire list. */
 	to->n.next = &from->n;
@@ -491,7 +567,8 @@ static inline void list_prepend_list(struct list_head *to,
  *		printf("Name: %s\n", child->name);
  */
 #define list_for_each_off(h, i, off)                                    \
-  for (i = list_node_to_off_(list_debug(h)->n.next, (off));             \
+	for (i = list_node_to_off_(list_debug(h, LIST_LOC)->n.next,	\
+				   (off));				\
        list_node_from_off_((void *)i, (off)) != &(h)->n;                \
        i = list_node_to_off_(list_node_from_off_((void *)i, (off))->next, \
                              (off)))
@@ -513,7 +590,8 @@ static inline void list_prepend_list(struct list_head *to,
  *		printf("Name: %s\n", child->name);
  */
 #define list_for_each_safe_off(h, i, nxt, off)                          \
-  for (i = list_node_to_off_(list_debug(h)->n.next, (off)),             \
+	for (i = list_node_to_off_(list_debug(h, LIST_LOC)->n.next,	\
+				   (off)),				\
          nxt = list_node_to_off_(list_node_from_off_(i, (off))->next,   \
                                  (off));                                \
        list_node_from_off_(i, (off)) != &(h)->n;                        \
@@ -560,4 +638,19 @@ static inline struct list_node *list_node_from_off_(void *ptr, size_t off)
 	(container_off_var(var, member) +		\
 	 check_type(var->member, struct list_node))
 
+#if HAVE_TYPEOF
+#define list_typeof(var) typeof(var)
+#else
+#define list_typeof(var) void *
+#endif
+
+/* Returns member, or NULL if at end of list. */
+static inline void *list_entry_or_null(const struct list_head *h,
+				       const struct list_node *n,
+				       size_t off)
+{
+	if (n == &h->n)
+		return NULL;
+	return (char *)n - off;
+}
 #endif /* CCAN_LIST_H */
diff --git a/hkl/ccan/str/debug.c b/hkl/ccan/str/debug.c
new file mode 100644
index 0000000..8722008
--- /dev/null
+++ b/hkl/ccan/str/debug.c
@@ -0,0 +1,108 @@
+/* CC0 (Public domain) - see LICENSE file for details */
+#include "config.h"
+#include <hkl/ccan/str/str_debug.h>
+#include <assert.h>
+#include <ctype.h>
+#include <string.h>
+
+#ifdef CCAN_STR_DEBUG
+/* Because we mug the real ones with macros, we need our own wrappers. */
+int str_isalnum(int i)
+{
+	assert(i >= -1 && i < 256);
+	return isalnum(i);
+}
+
+int str_isalpha(int i)
+{
+	assert(i >= -1 && i < 256);
+	return isalpha(i);
+}
+
+int str_isascii(int i)
+{
+	assert(i >= -1 && i < 256);
+	return isascii(i);
+}
+
+#if HAVE_ISBLANK
+int str_isblank(int i)
+{
+	assert(i >= -1 && i < 256);
+	return isblank(i);
+}
+#endif
+
+int str_iscntrl(int i)
+{
+	assert(i >= -1 && i < 256);
+	return iscntrl(i);
+}
+
+int str_isdigit(int i)
+{
+	assert(i >= -1 && i < 256);
+	return isdigit(i);
+}
+
+int str_isgraph(int i)
+{
+	assert(i >= -1 && i < 256);
+	return isgraph(i);
+}
+
+int str_islower(int i)
+{
+	assert(i >= -1 && i < 256);
+	return islower(i);
+}
+
+int str_isprint(int i)
+{
+	assert(i >= -1 && i < 256);
+	return isprint(i);
+}
+
+int str_ispunct(int i)
+{
+	assert(i >= -1 && i < 256);
+	return ispunct(i);
+}
+
+int str_isspace(int i)
+{
+	assert(i >= -1 && i < 256);
+	return isspace(i);
+}
+
+int str_isupper(int i)
+{
+	assert(i >= -1 && i < 256);
+	return isupper(i);
+}
+
+int str_isxdigit(int i)
+{
+	assert(i >= -1 && i < 256);
+	return isxdigit(i);
+}
+
+#undef strstr
+#undef strchr
+#undef strrchr
+
+char *str_strstr(const char *haystack, const char *needle)
+{
+	return strstr(haystack, needle);
+}
+
+char *str_strchr(const char *haystack, int c)
+{
+	return strchr(haystack, c);
+}
+
+char *str_strrchr(const char *haystack, int c)
+{
+	return strrchr(haystack, c);
+}
+#endif
diff --git a/hkl/ccan/str/str.c b/hkl/ccan/str/str.c
new file mode 100644
index 0000000..bde6cf2
--- /dev/null
+++ b/hkl/ccan/str/str.c
@@ -0,0 +1,13 @@
+/* CC0 (Public domain) - see LICENSE file for details */
+#include <hkl/ccan/str/str.h>
+
+size_t strcount(const char *haystack, const char *needle)
+{
+	size_t i = 0, nlen = strlen(needle);
+
+	while ((haystack = strstr(haystack, needle)) != NULL) {
+		i++;
+		haystack += nlen;
+	}
+	return i;
+}
diff --git a/hkl/ccan/str/str.h b/hkl/ccan/str/str.h
new file mode 100644
index 0000000..f2b4d3c
--- /dev/null
+++ b/hkl/ccan/str/str.h
@@ -0,0 +1,228 @@
+/* CC0 (Public domain) - see LICENSE file for details */
+#ifndef CCAN_STR_H
+#define CCAN_STR_H
+#include "config.h"
+#include <string.h>
+#include <stdbool.h>
+#include <limits.h>
+#include <ctype.h>
+
+/**
+ * streq - Are two strings equal?
+ * @a: first string
+ * @b: first string
+ *
+ * This macro is arguably more readable than "!strcmp(a, b)".
+ *
+ * Example:
+ *	if (streq(somestring, ""))
+ *		printf("String is empty!\n");
+ */
+#define streq(a,b) (strcmp((a),(b)) == 0)
+
+/**
+ * strstarts - Does this string start with this prefix?
+ * @str: string to test
+ * @prefix: prefix to look for at start of str
+ *
+ * Example:
+ *	if (strstarts(somestring, "foo"))
+ *		printf("String %s begins with 'foo'!\n", somestring);
+ */
+#define strstarts(str,prefix) (strncmp((str),(prefix),strlen(prefix)) == 0)
+
+/**
+ * strends - Does this string end with this postfix?
+ * @str: string to test
+ * @postfix: postfix to look for at end of str
+ *
+ * Example:
+ *	if (strends(somestring, "foo"))
+ *		printf("String %s end with 'foo'!\n", somestring);
+ */
+static inline bool strends(const char *str, const char *postfix)
+{
+	if (strlen(str) < strlen(postfix))
+		return false;
+
+	return streq(str + strlen(str) - strlen(postfix), postfix);
+}
+
+/**
+ * stringify - Turn expression into a string literal
+ * @expr: any C expression
+ *
+ * Example:
+ *	#define PRINT_COND_IF_FALSE(cond) \
+ *		((cond) || printf("%s is false!", stringify(cond)))
+ */
+#define stringify(expr)		stringify_1(expr)
+/* Double-indirection required to stringify expansions */
+#define stringify_1(expr)	#expr
+
+/**
+ * strcount - Count number of (non-overlapping) occurrences of a substring.
+ * @haystack: a C string
+ * @needle: a substring
+ *
+ * Example:
+ *      assert(strcount("aaa aaa", "a") == 6);
+ *      assert(strcount("aaa aaa", "ab") == 0);
+ *      assert(strcount("aaa aaa", "aa") == 2);
+ */
+size_t strcount(const char *haystack, const char *needle);
+
+/**
+ * STR_MAX_CHARS - Maximum possible size of numeric string for this type.
+ * @type_or_expr: a pointer or integer type or expression.
+ *
+ * This provides enough space for a nul-terminated string which represents the
+ * largest possible value for the type or expression.
+ *
+ * Note: The implementation adds extra space so hex values or negative
+ * values will fit (eg. sprintf(... "%p"). )
+ *
+ * Example:
+ *	char str[STR_MAX_CHARS(int)];
+ *
+ *	sprintf(str, "%i", 7);
+ */
+#define STR_MAX_CHARS(type_or_expr)				\
+	((sizeof(type_or_expr) * CHAR_BIT + 8) / 9 * 3 + 2	\
+	 + STR_MAX_CHARS_TCHECK_(type_or_expr))
+
+#if HAVE_TYPEOF
+/* Only a simple type can have 0 assigned, so test that. */
+#define STR_MAX_CHARS_TCHECK_(type_or_expr)		\
+	({ typeof(type_or_expr) x = 0; (void)x; 0; })
+#else
+#define STR_MAX_CHARS_TCHECK_(type_or_expr) 0
+#endif
+
+/**
+ * cisalnum - isalnum() which takes a char (and doesn't accept EOF)
+ * @c: a character
+ *
+ * Surprisingly, the standard ctype.h isalnum() takes an int, which
+ * must have the value of EOF (-1) or an unsigned char.  This variant
+ * takes a real char, and doesn't accept EOF.
+ */
+static inline bool cisalnum(char c)
+{
+	return isalnum((unsigned char)c);
+}
+static inline bool cisalpha(char c)
+{
+	return isalpha((unsigned char)c);
+}
+static inline bool cisascii(char c)
+{
+	return isascii((unsigned char)c);
+}
+#if HAVE_ISBLANK
+static inline bool cisblank(char c)
+{
+	return isblank((unsigned char)c);
+}
+#endif
+static inline bool ciscntrl(char c)
+{
+	return iscntrl((unsigned char)c);
+}
+static inline bool cisdigit(char c)
+{
+	return isdigit((unsigned char)c);
+}
+static inline bool cisgraph(char c)
+{
+	return isgraph((unsigned char)c);
+}
+static inline bool cislower(char c)
+{
+	return islower((unsigned char)c);
+}
+static inline bool cisprint(char c)
+{
+	return isprint((unsigned char)c);
+}
+static inline bool cispunct(char c)
+{
+	return ispunct((unsigned char)c);
+}
+static inline bool cisspace(char c)
+{
+	return isspace((unsigned char)c);
+}
+static inline bool cisupper(char c)
+{
+	return isupper((unsigned char)c);
+}
+static inline bool cisxdigit(char c)
+{
+	return isxdigit((unsigned char)c);
+}
+
+#include <hkl/ccan/str/str_debug.h>
+
+/* These checks force things out of line, hence they are under DEBUG. */
+#ifdef CCAN_STR_DEBUG
+#include <hkl/ccan/build_assert/build_assert.h>
+
+/* These are commonly misused: they take -1 or an *unsigned* char value. */
+#undef isalnum
+#undef isalpha
+#undef isascii
+#undef isblank
+#undef iscntrl
+#undef isdigit
+#undef isgraph
+#undef islower
+#undef isprint
+#undef ispunct
+#undef isspace
+#undef isupper
+#undef isxdigit
+
+/* You can use a char if char is unsigned. */
+#if HAVE_BUILTIN_TYPES_COMPATIBLE_P && HAVE_TYPEOF
+#define str_check_arg_(i)						\
+	((i) + BUILD_ASSERT_OR_ZERO(!__builtin_types_compatible_p(typeof(i), \
+								  char)	\
+				    || (char)255 > 0))
+#else
+#define str_check_arg_(i) (i)
+#endif
+
+#define isalnum(i) str_isalnum(str_check_arg_(i))
+#define isalpha(i) str_isalpha(str_check_arg_(i))
+#define isascii(i) str_isascii(str_check_arg_(i))
+#if HAVE_ISBLANK
+#define isblank(i) str_isblank(str_check_arg_(i))
+#endif
+#define iscntrl(i) str_iscntrl(str_check_arg_(i))
+#define isdigit(i) str_isdigit(str_check_arg_(i))
+#define isgraph(i) str_isgraph(str_check_arg_(i))
+#define islower(i) str_islower(str_check_arg_(i))
+#define isprint(i) str_isprint(str_check_arg_(i))
+#define ispunct(i) str_ispunct(str_check_arg_(i))
+#define isspace(i) str_isspace(str_check_arg_(i))
+#define isupper(i) str_isupper(str_check_arg_(i))
+#define isxdigit(i) str_isxdigit(str_check_arg_(i))
+
+#if HAVE_TYPEOF
+/* With GNU magic, we can make const-respecting standard string functions. */
+#undef strstr
+#undef strchr
+#undef strrchr
+
+/* + 0 is needed to decay array into pointer. */
+#define strstr(haystack, needle)					\
+	((typeof((haystack) + 0))str_strstr((haystack), (needle)))
+#define strchr(haystack, c)					\
+	((typeof((haystack) + 0))str_strchr((haystack), (c)))
+#define strrchr(haystack, c)					\
+	((typeof((haystack) + 0))str_strrchr((haystack), (c)))
+#endif
+#endif /* CCAN_STR_DEBUG */
+
+#endif /* CCAN_STR_H */
diff --git a/hkl/ccan/str/str_debug.h b/hkl/ccan/str/str_debug.h
new file mode 100644
index 0000000..92c10c4
--- /dev/null
+++ b/hkl/ccan/str/str_debug.h
@@ -0,0 +1,30 @@
+/* CC0 (Public domain) - see LICENSE file for details */
+#ifndef CCAN_STR_DEBUG_H
+#define CCAN_STR_DEBUG_H
+
+/* #define CCAN_STR_DEBUG 1 */
+
+#ifdef CCAN_STR_DEBUG
+/* Because we mug the real ones with macros, we need our own wrappers. */
+int str_isalnum(int i);
+int str_isalpha(int i);
+int str_isascii(int i);
+#if HAVE_ISBLANK
+int str_isblank(int i);
+#endif
+int str_iscntrl(int i);
+int str_isdigit(int i);
+int str_isgraph(int i);
+int str_islower(int i);
+int str_isprint(int i);
+int str_ispunct(int i);
+int str_isspace(int i);
+int str_isupper(int i);
+int str_isxdigit(int i);
+
+char *str_strstr(const char *haystack, const char *needle);
+char *str_strchr(const char *s, int c);
+char *str_strrchr(const char *s, int c);
+#endif /* CCAN_STR_DEBUG */
+
+#endif /* CCAN_STR_DEBUG_H */
diff --git a/hkl/hkl-axis-private.h b/hkl/hkl-axis-private.h
index 8cb8413..8f19ed7 100644
--- a/hkl/hkl-axis-private.h
+++ b/hkl/hkl-axis-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,12 +22,12 @@
 #ifndef __HKL_AXIS_PRIVATE_H__
 #define __HKL_AXIS_PRIVATE_H__
 
-#include "hkl.h"
-#include "hkl-vector-private.h"
-#include "hkl-quaternion-private.h"
-#include "hkl-parameter-private.h"
+#include "hkl-parameter-private.h"      // for _HklParameter
+#include "hkl-quaternion-private.h"     // for _HklQuaternion
+#include "hkl-vector-private.h"         // for HklVector, HklQuaternion
+#include "hkl.h"                        // for HklParameter, etc
 
-HKL_BEGIN_DECLS
+G_BEGIN_DECLS
 
 typedef struct _HklAxis HklAxis;
 
@@ -39,6 +39,6 @@ struct _HklAxis {
 
 extern HklParameter *hkl_parameter_new_axis(char const *name, HklVector const *axis_v);
 
-HKL_END_DECLS
+G_END_DECLS
 
 #endif /* __HKL_AXIS_PRIVATE_H__ */
diff --git a/hkl/hkl-axis.c b/hkl/hkl-axis.c
index 52382cd..58fab99 100644
--- a/hkl/hkl-axis.c
+++ b/hkl/hkl-axis.c
@@ -13,21 +13,26 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <stdlib.h>
-#include <math.h>
-
-#include <gsl/gsl_math.h>
-#include <gsl/gsl_sf_trig.h>
-
-#include "hkl/ccan/container_of/container_of.h"
-#include "hkl-axis-private.h"
-#include "hkl-parameter-private.h"
+#include <gsl/gsl_nan.h>                // for GSL_NAN
+#include <gsl/gsl_sf_trig.h>            // for gsl_sf_angle_restrict_symm
+#include <gsl/gsl_sys.h>                // for gsl_isnan
+#include <math.h>                       // for M_PI, ceil, fabs, floor
+#include <stdio.h>                      // for FILE
+#include <stdlib.h>                     // for NULL, free
+#include "hkl-axis-private.h"           // for HklAxis
+#include "hkl-interval-private.h"       // for HklInterval, etc
+#include "hkl-macros-private.h"         // for HKL_MALLOC
+#include "hkl-parameter-private.h"      // for _HklParameter, etc
+#include "hkl-quaternion-private.h"     // for hkl_quaternion_fprintf, etc
+#include "hkl-vector-private.h"         // for hkl_vector_fprintf, etc
+#include "hkl.h"                        // for HklParameter, TRUE, etc
+#include "hkl/ccan/container_of/container_of.h"  // for container_of
 
 /***********/
 /* HklAxis */
@@ -58,41 +63,36 @@ static inline void hkl_axis_update(HklAxis *self)
 					       &self->axis_v);
 }
 
-static inline void hkl_axis_init_copy_real(HklParameter *self, const HklParameter *src)
+static inline int hkl_axis_init_copy_real(HklParameter *self, const HklParameter *src,
+					  GError **error)
 {
 	HklAxis *axis_self = container_of(self, HklAxis, parameter);
 	HklAxis *axis_src = container_of(src, HklAxis, parameter);
 
-	*axis_self = *axis_src;
-	self->changed = HKL_TRUE;
-}
+	hkl_error (error == NULL || *error == NULL);
 
-static inline unsigned int hkl_axis_set_value_real(
-	HklParameter *self, double value,
-	HklError **error)
-{
-	HklAxis *axis = container_of(self, HklAxis, parameter);
-
-	if(!hkl_parameter_value_set_real(self, value, error))
-		return HKL_FALSE;
-
-	hkl_axis_update(axis);
+	*axis_self = *axis_src;
+	self->changed = TRUE;
 
-	return HKL_TRUE;
+	return TRUE;
 }
 
-static inline unsigned int hkl_axis_set_value_unit_real(
-	HklParameter *self, double value,
-	HklError **error)
+static inline int hkl_axis_set_value_real(HklParameter *self, double value,
+					  HklUnitEnum unit_type, GError **error)
 {
 	HklAxis *axis = container_of(self, HklAxis, parameter);
 
-	if(!hkl_parameter_value_unit_set_real(self, value, error))
-		return HKL_FALSE;
+	hkl_error (error == NULL || *error == NULL);
+
+	if(!hkl_parameter_value_set_real(self, value, unit_type, error)){
+		g_assert (error == NULL || *error != NULL);
+		return FALSE;
+	}
+	g_assert (error == NULL || *error == NULL);
 
 	hkl_axis_update(axis);
 
-	return HKL_TRUE;
+	return TRUE;
 }
 
 static inline void hkl_axis_set_value_smallest_in_range_real(HklParameter *self)
@@ -105,10 +105,12 @@ static inline void hkl_axis_set_value_smallest_in_range_real(HklParameter *self)
 	if(value < min)
 		hkl_axis_set_value_real(self,
 					value + 2*M_PI*ceil((min - value)/(2*M_PI)),
+					HKL_UNIT_DEFAULT,
 					NULL);
 	else
 		hkl_axis_set_value_real(self,
 					value - 2*M_PI*floor((value - min)/(2*M_PI)),
+					HKL_UNIT_DEFAULT,
 					NULL);
 }
 
@@ -179,21 +181,21 @@ static inline double hkl_axis_get_value_closest_real(const HklParameter *self,
 static inline int hkl_axis_is_valid_real(const HklParameter *self)
 {
 	double value = self->_value;
-	int res = HKL_FALSE;
+	int res = FALSE;
 	HklInterval range = self->range;
 
 	if(hkl_interval_length(&range) > 2*M_PI)
-		res = HKL_TRUE;
+		res = TRUE;
 	else{
 		hkl_interval_angle_restrict_symm(&range);
 		value = gsl_sf_angle_restrict_symm(value);
 
 		if(range.min <= range.max){
 			if(range.min <= value && range.max >= value)
-				res = HKL_TRUE;
+				res = TRUE;
 		}else{
 			if(value <= range.max || value >= range.min)
-				res = HKL_TRUE;
+				res = TRUE;
 		}
 	}
 	return res;
@@ -208,6 +210,16 @@ static inline void hkl_axis_fprintf_real(FILE *f, const HklParameter *self)
 	hkl_quaternion_fprintf(f, &axis->q);
 }
 
+static inline const HklVector *hkl_axis_axis_v_get_real(const HklParameter *self)
+{
+	return &container_of(self, HklAxis, parameter)->axis_v;
+}
+
+static inline const HklQuaternion *hkl_axis_quaternion_get_real(const HklParameter *self)
+{
+	return &container_of(self, HklAxis, parameter)->q;
+}
+
 static HklParameterOperations hkl_parameter_operations_axis = {
 	HKL_PARAMETER_OPERATIONS_DEFAULTS,
 	.copy = hkl_axis_copy_real,
@@ -215,11 +227,12 @@ static HklParameterOperations hkl_parameter_operations_axis = {
 	.init_copy = hkl_axis_init_copy_real,
 	.get_value_closest = hkl_axis_get_value_closest_real,
 	.set_value = hkl_axis_set_value_real,
-	.set_value_unit = hkl_axis_set_value_unit_real,
 	.set_value_smallest_in_range = hkl_axis_set_value_smallest_in_range_real,
 	.randomize = hkl_axis_randomize_real,
 	.is_valid = hkl_axis_is_valid_real,
-	.fprintf = hkl_axis_fprintf_real
+	.fprintf = hkl_axis_fprintf_real,
+	.axis_v_get = hkl_axis_axis_v_get_real,
+	.quaternion_get = hkl_axis_quaternion_get_real
 };
 
 HklParameter *hkl_parameter_new_axis(char const *name, HklVector const *axis_v)
diff --git a/hkl/hkl-binding-private.h b/hkl/hkl-binding-private.h
index f16d2ad..a8895cd 100644
--- a/hkl/hkl-binding-private.h
+++ b/hkl/hkl-binding-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2012-2013 Synchrotron SOLEIL
+ * Copyright (C) 2012-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,11 +22,11 @@
 #ifndef __HKL_BINDING_PRIVATE_H__
 #define __HKL_BINDING_PRIVATE_H__
 
-#include <glib.h>
+#include <glib.h>                       // for GError, GHashTable, etc
+#include <sys/types.h>                  // for uint
+#include "hkl.h"                        // for HKLAPI, HklGeometry, etc
 
-#include "hkl.h"
-
-HKL_BEGIN_DECLS
+G_BEGIN_DECLS
 
 /**************/
 /* HklFactory */
@@ -34,65 +34,61 @@ HKL_BEGIN_DECLS
 
 HKLAPI GHashTable *hkl_factories(void);
 
-/********************/
-/* HklParameterList */
-/********************/
-
-HKLAPI GSList* hkl_parameter_list_parameters(HklParameterList *self);
-
-HKLAPI gboolean hkl_parameter_list_values_unit_set_binding(HklParameterList *self,
-							   double *values, uint len,
-							   GError **error);
 /***************/
 /* HklGeometry */
 /***************/
 
-HKLAPI GSList* hkl_geometry_axes(HklGeometry *self);
+HKLAPI const char **hkl_geometry_axis_names_get_binding(const HklGeometry *self,
+							size_t *length) HKL_ARG_NONNULL(1, 2);
 
-HKLAPI double* hkl_geometry_get_axes_values_unit(const HklGeometry *self, unsigned int *len);
 
-HKLAPI void hkl_geometry_set_axes_values_unit(HklGeometry *self, double *values, unsigned int len);
+HKLAPI double* hkl_geometry_axis_values_get_binding(const HklGeometry *self, unsigned int *len,
+						    HklUnitEnum unit_type) HKL_ARG_NONNULL(1, 2);
 
 /*******************/
 /* HklGeometryList */
 /*******************/
 
-HKLAPI GSList* hkl_geometry_list_items(HklGeometryList *self);
+HKLAPI GSList* hkl_geometry_list_items(HklGeometryList *self) HKL_ARG_NONNULL(1);
+
+/*************/
+/* HklEngine */
+/*************/
 
-/***********************/
-/* HklGeometryListItem */
-/***********************/
+HKLAPI const char **hkl_engine_modes_names_get_binding(const HklEngine *self,
+						       size_t *length) HKL_ARG_NONNULL(1, 2);
 
-HKLAPI const HklGeometry *hkl_geometry_list_item_geometry(const HklGeometryListItem *self);
+HKLAPI const char **hkl_engine_pseudo_axis_names_get_binding(HklEngine *self,
+							     size_t *length) HKL_ARG_NONNULL(1, 2);
 
-/***********************/
-/* HklEngine */
-/***********************/
+HKLAPI const char **hkl_engine_parameters_names_get_binding(const HklEngine *self,
+							    size_t *length) HKL_ARG_NONNULL(1, 2);
 
-HKLAPI GSList* hkl_engine_modes_as_gslist(HklEngine *self);
+HKLAPI const char **hkl_engine_axis_names_get_binding(const HklEngine *self,
+						      HklEngineAxisNamesGet mode,
+						      size_t *length) HKL_ARG_NONNULL(1, 3);
 
-HKLAPI gboolean hkl_engine_set_values_unit(
-	HklEngine *self,
-	double values[], unsigned int len,
-	GError **error);
+HKLAPI double *hkl_engine_pseudo_axis_values_get_binding(const HklEngine *self,
+							 guint *len, HklUnitEnum unit_type);
 
 /***************************/
 /* HklPSeudoAxisEngineList */
 /***************************/
 
-HKLAPI GSList* hkl_engine_list_engines_as_gslist(HklEngineList *self);
+HKLAPI GSList* hkl_engine_list_engines_get_as_gslist(HklEngineList *self);
 
 /*************/
 /* HklSample */
 /*************/
 
-HKLAPI const GSList *hkl_sample_reflections_get(const HklSample *self);
+HKLAPI GSList *hkl_sample_reflections_get(const HklSample *self);
 
 HKLAPI HklSampleReflection *hkl_sample_add_reflection_binding(HklSample *self,
 							      const HklGeometry *geometry,
 							      const HklDetector *detector,
-							      double h, double k, double l);
+							      double h, double k, double l,
+							      GError **error);
 
-HKL_END_DECLS
+G_END_DECLS
 
 #endif /* __HKL_BINDING_PRIVATE_H__ */
diff --git a/hkl/hkl-binding.c b/hkl/hkl-binding.c
index ae6ec15..ddf089f 100644
--- a/hkl/hkl-binding.c
+++ b/hkl/hkl-binding.c
@@ -13,24 +13,25 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2012-2013 Synchrotron SOLEIL
+ * Copyright (C) 2012-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
 
-#include <glib.h>
-#include <string.h>
-
-#include "hkl/ccan/array_size/array_size.h"
-#include "hkl-axis-private.h"
-#include "hkl-binding-private.h"
-#include "hkl-error-private.h"
-#include "hkl-factory-private.h"
-#include "hkl-pseudoaxis-private.h"
-#include "hkl-sample-private.h"
-
+#include <stdlib.h>                     // for malloc
+#include <string.h>                     // for NULL, strdup
+#include <sys/types.h>                  // for uint
+#include "hkl-factory-private.h"        // for __start_xautodata_factories, etc
+#include "hkl-geometry-private.h"       // for _HklGeometry, etc
+#include "hkl-parameter-private.h"
+#include "hkl-pseudoaxis-private.h"     // for _HklEngine, HklEngineInfo
+#include "hkl-sample-private.h"         // for _HklSampleReflection, etc
+#include "hkl.h"                        // for HklGeometry, HklEngine, etc
+#include "hkl/ccan/autodata/autodata.h"  // for autodata_get
+#include "hkl/ccan/darray/darray.h"     // for darray_foreach, darray_size
+#include "hkl/ccan/list/list.h"             // for list_for_each, list_head
 
 /**************/
 /* HklFactory */
@@ -46,125 +47,58 @@
 GHashTable *hkl_factories(void)
 {
 	GHashTable *table = NULL;
-	unsigned int i;
-	unsigned int n;
+	size_t i, n;
 	HklFactory **factories;
 
 	table = g_hash_table_new(g_str_hash, g_str_equal);
 	factories = autodata_get(factories, &n);
 	for(i=0; i<n; ++i){
 		g_hash_table_insert(table,
-				    hkl_factory_name(factories[i]),
+				    (gpointer)hkl_factory_name_get(factories[i]),
 				    factories[i]);
 	}
 
 	return table;
 }
 
-/********************/
-/* HklParameterList */
-/********************/
-
-#define HKL_PARAMETER_LIST_ERROR hkl_parameter_list_error_quark ()
-
-GQuark hkl_parameter_list_error_quark (void)
-{
-	return g_quark_from_static_string ("hkl-parameter-list-error-quark");
-}
-
-typedef enum {
-	HKL_PARAMETER_LIST_ERROR_VALUES_SET /* can not set the parameter list values */
-} HklParameterListError;
-
-/**
- * hkl_parameter_list_values_unit_set_binding:
- * @self: the this ptr
- * @values: (array length=len): the values to set
- * @len: the length of the values
- * @error: error set if something goes wrong
- *
- * set the parameter list with the given values
- *
- * Rename to: hkl_parameter_list_values_unit_set
- *
- * Return value: true if succeed or false otherwise
- **/
-gboolean hkl_parameter_list_values_unit_set_binding(HklParameterList *self,
-						    double values[], uint len,
-						    GError **error)
-{
-	HklError *err = NULL;
-
-	g_return_val_if_fail(error == NULL ||*error == NULL, FALSE);
-
-	if(!hkl_parameter_list_values_unit_set(self,
-					       values, len, &err)){
-		g_assert(&err == NULL || err != NULL);
-
-		g_set_error(error,
-			    HKL_PARAMETER_LIST_ERROR,
-			    HKL_PARAMETER_LIST_ERROR_VALUES_SET,
-			    strdup(err->message));
-
-		hkl_error_clear(&err);
-
-		return FALSE;
-	}
-	return TRUE;
-}
-
-/**
- * hkl_parameter_list_parameters:
- * @self: the this ptr
- *
- * Return value: (element-type HklParameter) (transfer container): list of parameters
- *               free the list with g_slist_free when done.
- **/
-GSList* hkl_parameter_list_parameters(HklParameterList *self)
-{
-	GSList *list = NULL;
-	HklParameter **parameter;
-
-	darray_foreach(parameter, *self){
-		list = g_slist_append(list, *parameter);
-	}
-
-	return list;
-}
-
 /************/
 /* Geometry */
 /************/
 
 /**
- * hkl_geometry_axes:
+ * hkl_geometry_axis_names_get_binding:
  * @self: the this ptr
+ * @length: (out caller-allocates): the length of the returned array
+ *
+ * get all the axes of the given geometry.
+ *
+ * Rename to: hkl_geometry_axis_names_get
  *
- * Returns: (element-type HklParameter) (transfer container): list of HklParameter,
- *          free the list with g_slist_free when done.
+ * Returns: (array length=length) (transfer none): array of the axes names.
  **/
-GSList *hkl_geometry_axes(HklGeometry *self)
+const char **hkl_geometry_axis_names_get_binding(const HklGeometry *self,
+						 size_t *length)
 {
-	GSList *list = NULL;
-	HklParameter **axis;
+	const darray_string *axes = hkl_geometry_axis_names_get(self);
 
-	darray_foreach(axis, self->axes){
-		list = g_slist_append(list, *axis);
-	}
+	*length = darray_size(*axes);
 
-	return list;
+	return &darray_item(*axes, 0);
 }
 
-
 /**
- * hkl_geometry_get_axes_values_unit:
+ * hkl_geometry_axis_values_get_binding:
  * @self: the this ptr
  * @len: (out caller-allocates): the length of the returned array
+ * @unit_type: the unit type (default or user) of the returned value
+ *
+ * Rename to: hkl_geometry_axis_values_get
  *
  * Return value: (array length=len) (transfer container): list of axes values,
  *          free the list with free when done.
  **/
-double *hkl_geometry_get_axes_values_unit(const HklGeometry *self, guint *len)
+double *hkl_geometry_axis_values_get_binding(const HklGeometry *self, guint *len,
+					     HklUnitEnum unit_type)
 {
 	double *values;
 	uint i = 0;
@@ -177,35 +111,12 @@ double *hkl_geometry_get_axes_values_unit(const HklGeometry *self, guint *len)
 	values = malloc(darray_size(self->axes) * sizeof(*values));
 
 	darray_foreach(axis, self->axes){
-		values[i++] = hkl_parameter_value_unit_get(*axis);
+		values[i++] = hkl_parameter_value_get(*axis, unit_type);
 	}
 
 	return values;
 }
 
-/**
- * hkl_geometry_set_axes_values_unit:
- * @self: the this ptr
- * @values: (array length=len): the values to set.
- * @len: the length of the values array.
- **/
-void hkl_geometry_set_axes_values_unit(HklGeometry *self, double *values, unsigned int len)
-{
-	uint i = 0;
-	HklParameter **axis;
-
-	if (!self || !values || len != darray_size(self->axes))
-		return;
-
-	darray_foreach(axis, self->axes){
-		hkl_parameter_value_unit_set(*axis,
-					     values[i++],
-					     NULL);
-	}
-
-	hkl_geometry_update(self);
-}
-
 /*******************/
 /* HklGeometryList */
 /*******************/
@@ -220,132 +131,126 @@ void hkl_geometry_set_axes_values_unit(HklGeometry *self, double *values, unsign
 GSList* hkl_geometry_list_items(HklGeometryList *self)
 {
 	GSList *list = NULL;
-	HklGeometryListItem **item;
+	HklGeometryListItem *item;
 
-	darray_foreach(item, self->items){
-		list = g_slist_append(list, *item);
-	}
+	list_for_each(&self->items, item, list)
+		list = g_slist_append(list, item);
 
 	return list;
 }
 
-/***********************/
-/* HklGeometryListItem */
-/***********************/
+/*************/
+/* HklEngine */
+/*************/
 
 /**
- * hkl_geometry_list_item_geometry:
+ * hkl_engine_modes_names_get_binding:
  * @self: the this ptr
+ * @length: (out caller-allocates): return the length of the returned array.
+ *
+ * Rename to: hkl_engine_modes_names_get
  *
- * Return value: The geometry contain inside the HklGeometryListItem
+ * Return value: (array length=length) (transfer none): All the modes supported by the #HklEngine
  **/
-const HklGeometry *hkl_geometry_list_item_geometry(const HklGeometryListItem *self)
+const char **hkl_engine_modes_names_get_binding(const HklEngine *self, size_t *length)
 {
-	return hkl_geometry_list_item_geometry_get(self);
+	*length = darray_size(self->mode_names);
+	return &darray_item(self->mode_names, 0);
 }
 
-/*************/
-/* HklEngine */
-/*************/
-
-#define HKL_ENGINE_ERROR hkl_engine_error_quark ()
-
-GQuark hkl_engine_error_quark (void)
+/**
+ * hkl_engine_pseudo_axis_names_get_binding:
+ * @self: the this ptr
+ * @length: (out caller-allocates): return the length of the returned array.
+ *
+ * Rename to: hkl_engine_pseudo_axis_names_get
+ *
+ * Return value: (array length=length) (transfer none): All the pseudo_axes names of the #HklEngine
+ *
+ **/
+const char **hkl_engine_pseudo_axis_names_get_binding(HklEngine *self, size_t *length)
 {
-	return g_quark_from_static_string ("hkl-pseudo-axis-engine-error-quark");
+	*length = darray_size(self->pseudo_axis_names);
+	return &darray_item(self->pseudo_axis_names, 0);
 }
 
-typedef enum {
-	HKL_ENGINE_ERROR_SET /* can not set the pseudo axis engine */
-} HklEngineError;
-
+/**
+ * hkl_engine_parameters_names_get_binding:
+ * @self: the this ptr
+ * @length: (out caller-allocates): return the length of the returned array.
+ *
+ * Rename to: hkl_engine_parameters_names_get
+ *
+ * Return value: (array length=length) (transfer none): All the parameters of #HklEngine.
+ **/
+const char **hkl_engine_parameters_names_get_binding(const HklEngine *self, size_t *length)
+{
+	*length = darray_size(self->mode->parameters_names);
+	return &darray_item(self->mode->parameters_names, 0);
+}
 
 /**
- * hkl_engine_modes_as_gslist:
+ * hkl_engine_axis_names_get_binding:
  * @self: the this ptr
+ * @mode: the #HklEngineAxesNamesGet
+ * @length: (out caller-allocates): return the length of the returned array.
  *
- * Return value: (element-type HklMode) (transfer container): list of mdoe,
- *               free the list with g_slist_free when done.
+ * Rename to: hkl_engine_axis_names_get
  *
- * Rename to: hkl_engine_modes
+ * Return value: (array length=length) (transfer none): axes of the #HklEngine for the given mode.
  **/
-GSList* hkl_engine_modes_as_gslist(HklEngine *self)
+const char **hkl_engine_axis_names_get_binding(const HklEngine *self,
+					       HklEngineAxisNamesGet mode,
+					       size_t *length)
 {
-	GSList *list = NULL;
-	HklMode **mode;
+	const darray_string *axes = hkl_engine_axis_names_get(self, mode);
 
-	darray_foreach(mode, self->modes){
-		list = g_slist_append(list, *mode);
-	}
+	*length = darray_size(*axes);
 
-	return list;
+	return &darray_item(*axes, 0);
 }
 
 /**
- * hkl_engine_set_values_unit:
+ * hkl_engine_pseudo_axis_values_get_binding:
  * @self: the this ptr
- * @values: (array length=len): the values to set
- * @len: the len of the values array
- * @error: return location of a GError or NULL
+ * @len: (out caller-allocates): the length of the returned array
+ * @unit_type: the unit type (default or user) of the returned value
  *
- * compute the #HklGeometry angles for this #HklEngine
+ * Rename to: hkl_engine_pseudo_axis_values_get
  *
- * Return value: TRUE on success or FALSE if an error occurred
+ * Return value: (array length=len) (transfer container): list of pseudo axes values,
+ *          free the list with free when done.
  **/
-gboolean hkl_engine_set_values_unit(HklEngine *self,
-				    double values[], unsigned int len,
-				    GError **error)
+double *hkl_engine_pseudo_axis_values_get_binding(const HklEngine *self, guint *len,
+						  HklUnitEnum unit_type)
 {
-	HklParameter *parameter;
+	double *values;
 	uint i = 0;
-	HklError *err = NULL;
-
-	g_return_val_if_fail(error == NULL ||*error == NULL, FALSE);
-
-	if(len != self->info->n_pseudo_axes)
-		return FALSE;
-
-	if(!hkl_parameter_list_values_unit_set(&self->pseudo_axes,
-					       values, len, &err)){
-		g_assert(&err == NULL || err != NULL);
-
-		g_set_error(error,
-			    HKL_ENGINE_ERROR,
-			    HKL_ENGINE_ERROR_SET,
-			    strdup(err->message));
-
-		hkl_error_clear(&err);
-
-		return FALSE;
-	}
-
-	if(!hkl_engine_set(self, &err)){
-		g_assert(&err == NULL || err != NULL);
+	HklParameter **axis;
 
-		g_set_error(error,
-			    HKL_ENGINE_ERROR,
-			    HKL_ENGINE_ERROR_SET,
-			    strdup(err->message));
+	if(!self || !len || darray_size(self->pseudo_axes) == 0)
+		return NULL;
 
-		hkl_error_clear(&err);
+	*len = darray_size(self->pseudo_axes);
+	values = malloc(darray_size(self->pseudo_axes) * sizeof(*values));
 
-		return FALSE;
+	darray_foreach(axis, self->pseudo_axes){
+		values[i++] = hkl_parameter_value_get(*axis, unit_type);
 	}
-	g_assert(error != NULL ||*error != NULL);
 
-	return TRUE;
+	return values;
 }
 
 /**
- * hkl_engine_list_engines_as_gslist:
+ * hkl_engine_list_engines_get_as_gslist:
  * @self: the this ptr
  *
  * Return value: (element-type HklEngine) (transfer container): list of engines,
  *               free the list with g_slist_free when done.
  *
- * Rename to: hkl_engine_list_engines
+ * Rename to: hkl_engine_list_engines_get
  **/
-GSList* hkl_engine_list_engines_as_gslist(HklEngineList *self)
+GSList* hkl_engine_list_engines_get_as_gslist(HklEngineList *self)
 {
 	GSList *list = NULL;
 	HklEngine **engine;
@@ -365,10 +270,10 @@ GSList* hkl_engine_list_engines_as_gslist(HklEngineList *self)
  * hkl_sample_reflections_get:
  * @self: the this ptr
  *
- * Return value: (element-type HklSampleReflection) (transfer container): list of reflecions,
+ * Return value: (element-type HklSampleReflection) (transfer container): list of reflections,
  *               free the list with g_slist_free when done.
  */
-const GSList *hkl_sample_reflections_get(const HklSample *self)
+GSList *hkl_sample_reflections_get(const HklSample *self)
 {
 	GSList *list = NULL;
 	HklSampleReflection *reflection;
@@ -388,22 +293,31 @@ const GSList *hkl_sample_reflections_get(const HklSample *self)
  * @h: the h coordinate
  * @k: the k coordinate
  * @l: the l coordinate
+ * @error: return location for a GError, or NULL
  *
- * Return value: (element-type HklEngine) (transfer container): list of engines,
- *               free the list with g_slist_free when done.
+ * Return value: (transfer none): the newly created HklSampleReflection
  *
  * Rename to: hkl_sample_add_reflection
  **/
 HklSampleReflection *hkl_sample_add_reflection_binding(HklSample *self,
 						       const HklGeometry *geometry,
 						       const HklDetector *detector,
-						       double h, double k, double l)
+						       double h, double k, double l,
+						       GError **error)
 {
 	HklSampleReflection *reflection;
 
-	reflection = hkl_sample_reflection_new(geometry, detector, h, k, l);
+	hkl_error (error == NULL || *error == NULL);
+
+	reflection = hkl_sample_reflection_new(geometry, detector,
+					       h, k, l, error);
+	if(!reflection){
+		g_assert (error == NULL || *error != NULL);
+		return NULL;
+	}
+	g_assert (error == NULL || *error == NULL);
+
 	hkl_sample_add_reflection(self, reflection);
 
 	return reflection;
 }
-
diff --git a/hkl/hkl-detector-factory.c b/hkl/hkl-detector-factory.c
index 2db1bca..754c478 100644
--- a/hkl/hkl-detector-factory.c
+++ b/hkl/hkl-detector-factory.c
@@ -13,15 +13,15 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-
-#include "hkl.h"
-#include "hkl-detector-private.h"
+#include <stddef.h>                     // for NULL
+#include "hkl-detector-private.h"       // for hkl_detector_new
+#include "hkl.h"                        // for HklDetector, etc
 
 /**
  * hkl_detector_factory_new:
diff --git a/hkl/hkl-detector-private.h b/hkl/hkl-detector-private.h
index 0627315..152c76d 100644
--- a/hkl/hkl-detector-private.h
+++ b/hkl/hkl-detector-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,9 +22,12 @@
 #ifndef __HKL_DETECTOR_PRIVATE_H__
 #define __HKL_DETECTOR_PRIVATE_H__
 
-#include "hkl-geometry-private.h"
+#include <stddef.h>                     // for size_t
+#include "hkl-geometry-private.h"       // for HklHolder
+#include "hkl-vector-private.h"         // for HklVector
+#include "hkl.h"                        // for HklDetector, etc
 
-HKL_BEGIN_DECLS
+G_BEGIN_DECLS
 
 struct _HklDetector
 {
@@ -34,14 +37,12 @@ struct _HklDetector
 
 extern HklDetector *hkl_detector_new(void);
 
-extern HklDetector *hkl_detector_new_copy(HklDetector const *src) HKL_ARG_NONNULL(1);
-
 extern void hkl_detector_attach_to_holder(HklDetector *self,
 					  HklHolder const *holder) HKL_ARG_NONNULL(1, 2);
 
 extern int hkl_detector_compute_kf(HklDetector const *self, HklGeometry *g,
 				   HklVector *kf) HKL_ARG_NONNULL(1, 2, 3);
 
-HKL_END_DECLS
+G_END_DECLS
 
 #endif /* __HKL_DETECTOR_PRIVATE_H__ */
diff --git a/hkl/hkl-detector.c b/hkl/hkl-detector.c
index 9ca9f58..d58e534 100644
--- a/hkl/hkl-detector.c
+++ b/hkl/hkl-detector.c
@@ -13,15 +13,21 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <math.h>
-
-#include "hkl-detector-private.h"
+#include <stdio.h>                      // for fprintf, NULL, FILE
+#include <stdlib.h>                     // for free
+#include "hkl-detector-private.h"       // for _HklDetector
+#include "hkl-geometry-private.h"       // for HklHolder, _HklGeometry, etc
+#include "hkl-macros-private.h"         // for HKL_MALLOC
+#include "hkl-source-private.h"         // for HklSource
+#include "hkl-vector-private.h"         // for hkl_vector_init, etc
+#include "hkl.h"                        // for HklDetector, HklGeometry, etc
+#include "hkl/ccan/darray/darray.h"     // for darray_item
 
 /**
  * hkl_detector_new: (skip)
@@ -36,7 +42,7 @@ HklDetector *hkl_detector_new(void)
 
 	self = HKL_MALLOC(HklDetector);
 
-	self->idx = 0;
+	self->idx = 1;
 	self->holder = NULL;
 
 	return self;
@@ -73,18 +79,6 @@ void hkl_detector_free(HklDetector *self)
 }
 
 /**
- * hkl_detector_idx_set:
- * @self: the this ptr
- * @idx: the index of the holder
- *
- * Attach a detector to a given holder
- **/
-void hkl_detector_idx_set(HklDetector *self, int idx)
-{
-	self->idx = idx;
-}
-
-/**
  * hkl_detector_attach_to_holder: (skip)
  * @self:
  * @holder:
@@ -117,9 +111,9 @@ int hkl_detector_compute_kf(HklDetector const *self, HklGeometry *g,
 	if (holder) {
 		hkl_vector_init(kf, HKL_TAU / g->source.wave_length, 0, 0);
 		hkl_vector_rotated_quaternion(kf, &holder->q);
-		return HKL_TRUE;
+		return TRUE;
 	} else
-		return HKL_FALSE;
+		return FALSE;
 }
 
 /**
diff --git a/hkl/hkl-engine-2c.c b/hkl/hkl-engine-2c.c
new file mode 100644
index 0000000..5cbbc49
--- /dev/null
+++ b/hkl/hkl-engine-2c.c
@@ -0,0 +1,63 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include "hkl-macros-private.h"
+#include "hkl-factory-private.h"        // for autodata_factories_, etc
+#include "hkl-pseudoaxis-private.h"     // for hkl_engine_list_add, etc
+#include "hkl/ccan/array_size/array_size.h"
+
+#define AXIS_0_NAME "omega"
+#define AXIS_1_NAME "tth"
+
+#define HKL_GEOMETRY_TWOC_DESCRIPTION					\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 1 axes for the sample\n"					\
+	"\n"								\
+	"  + **" AXIS_0_NAME "** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"\n"								\
+	"+ 1 axis for the detector\n"					\
+	"\n"								\
+	"  + **" AXIS_1_NAME "** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
+
+static const char* hkl_geometry_twoC_axes[] = {AXIS_0_NAME, AXIS_1_NAME};
+
+static HklGeometry *hkl_geometry_new_twoC(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, AXIS_0_NAME, 0, -1, 0);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, AXIS_1_NAME, 0, -1, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_twoC(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(twoC, "TwoC", HKL_GEOMETRY_TWOC_DESCRIPTION);
diff --git a/hkl/hkl-engine-e4c.c b/hkl/hkl-engine-e4c.c
new file mode 100644
index 0000000..8541c56
--- /dev/null
+++ b/hkl/hkl-engine-e4c.c
@@ -0,0 +1,323 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include <gsl/gsl_sys.h>                // for gsl_isnan
+#include "hkl-factory-private.h"        // for autodata_factories_, etc
+#include "hkl-pseudoaxis-common-q-private.h"  // for hkl_engine_q2_new, etc
+#include "hkl-pseudoaxis-common-hkl-private.h"  // for hkl_mode_operations, etc
+#include "hkl-pseudoaxis-common-psi-private.h"  // for hkl_engine_psi_new, etc
+
+/* bissector */
+
+static int _bissector_func(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double omega = x->data[0];
+	const double tth = x->data[3];
+
+	CHECK_NAN(x->data, x->size);
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = tth - 2 * fmod(omega,M_PI);
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction bissector_func = {
+	.function = _bissector_func,
+	.size = 4,
+};
+
+static HklMode *bissector(void)
+{
+	static const char* axes[] = {"omega", "chi", "phi", "tth"};
+	static const HklFunction *functions[] = {&bissector_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *constant_omega(void)
+{
+	static const char* axes_r[] = {"omega", "chi", "phi", "tth"};
+	static const char* axes_w[] = {"chi", "phi", "tth"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *constant_chi(void)
+{
+	static const char* axes_r[] = {"omega", "chi", "phi", "tth"};
+	static const char* axes_w[] = {"omega", "phi", "tth"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *constant_phi(void)
+{
+	static const char* axes_r[] = {"omega", "chi", "phi", "tth"};
+	static const char* axes_w[] = {"omega", "chi", "tth"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *double_diffraction(void)
+{
+	static const char* axes[] = {"omega", "chi", "phi", "tth"};
+	static const HklFunction *functions[] = {&double_diffraction_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes, axes,
+					       functions, double_diffraction_parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *psi_constant(void)
+{
+	static const char* axes[] = {"omega", "chi", "phi", "tth"};
+	static const HklFunction *functions[] = {&psi_constant_vertical_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes, axes,
+					       functions, psi_constant_parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &psi_constant_vertical_mode_operations,
+				 TRUE);
+}
+
+/***********************/
+/* pseudo axes engines */
+/***********************/
+
+static HklEngine *hkl_engine_e4c_hkl_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_hkl_new();
+
+	default_mode = bissector();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_mode_set(self, default_mode);
+
+	hkl_engine_add_mode(self, constant_omega());
+	hkl_engine_add_mode(self, constant_chi());
+	hkl_engine_add_mode(self, constant_phi());
+	hkl_engine_add_mode(self, double_diffraction());
+	hkl_engine_add_mode(self, psi_constant());
+
+	return self;
+}
+
+static HklMode *psi(void)
+{
+	static const char *axes[] = {"omega", "chi", "phi", "tth"};
+	static const HklFunction *functions[] = {&psi_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes, axes,
+					       functions, psi_parameters),
+	};
+
+	return hkl_mode_psi_new(&info);
+}
+
+static HklEngine *hkl_engine_e4c_psi_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_psi_new();
+
+	default_mode = psi();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_mode_set(self, default_mode);
+
+	return self;
+}
+
+/********/
+/* E4CV */
+/********/
+
+#define HKL_GEOMETRY_EULERIAN4C_VERTICAL_DESCRIPTION			\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 3 axes for the sample\n"					\
+	"\n"								\
+	"  + **omega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **chi** : rotating around the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"  + **phi** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"\n"								\
+	"+ 1 axis for the detector\n"					\
+	"\n"								\
+	"  + **tth** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
+
+static const char* hkl_geometry_eulerian4C_vertical_axes[] = {"omega", "chi", "phi", "tth"};
+
+static HklGeometry *hkl_geometry_new_eulerian4C_vertical(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "chi", 1, 0, 0);
+	hkl_holder_add_rotation_axis(h, "phi", 0, -1, 0);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "tth", 0, -1, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_eulerian4C_vertical(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	hkl_engine_list_add(self, hkl_engine_e4c_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_e4c_psi_new());
+	hkl_engine_list_add(self, hkl_engine_q_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(eulerian4C_vertical, "E4CV", HKL_GEOMETRY_EULERIAN4C_VERTICAL_DESCRIPTION);
+
+
+/***************/
+/* SOLEIL MARS */
+/***************/
+
+#define HKL_GEOMETRY_TYPE_SOLEIL_MARS_DESCRIPTION			\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 3 axes for the sample\n"					\
+	"\n"								\
+	"  + **omega** : rotating around the :math:`\\vec{z}` direction (0, -1, 0)\n" \
+	"  + **chi** : rotating around the :math:`\\vec{x}` direction (-1, 0, 0)\n" \
+	"  + **phi** : rotating around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"\n"								\
+	"+ 1 axis for the detector\n"					\
+	"\n"								\
+	"  + **tth** : rotation around the :math:`\\vec{z}` direction (0, -1, 0)\n"
+
+static const char* hkl_geometry_soleil_mars_axes[] = {"omega", "chi", "phi", "tth"};
+
+static HklGeometry *hkl_geometry_new_soleil_mars(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "chi", -1, 0, 0);
+	hkl_holder_add_rotation_axis(h, "phi", 0, 0, 1);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "tth", 0, -1, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_soleil_mars(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	hkl_engine_list_add(self, hkl_engine_e4c_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_e4c_psi_new());
+	hkl_engine_list_add(self, hkl_engine_q_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(soleil_mars, "SOLEIL MARS", HKL_GEOMETRY_TYPE_SOLEIL_MARS_DESCRIPTION);
+
+/********/
+/* E4CH */
+/********/
+
+#define HKL_GEOMETRY_TYPE_EULERIAN4C_HORIZONTAL_DESCRIPTION		\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 3 axes for the sample\n"					\
+	"\n"								\
+	"  + **omega** : rotating around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **chi** : rotating around the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"  + **phi** : rotating around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"\n"								\
+	"+ 1 axis for the detector\n"					\
+	"\n"								\
+	"  + **tth** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n"
+
+static const char* hkl_geometry_eulerian4C_horizontal_axes[] = {"omega", "chi", "phi", "tth"};
+
+static HklGeometry *hkl_geometry_new_eulerian4C_horizontal(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "omega", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "chi", 1, 0, 0);
+	hkl_holder_add_rotation_axis(h, "phi", 0, 0, 1);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "tth", 0, 0, 1);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_eulerian4C_horizontal(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	hkl_engine_list_add(self, hkl_engine_e4c_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_e4c_psi_new());
+	hkl_engine_list_add(self, hkl_engine_q_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(eulerian4C_horizontal, "E4CH", HKL_GEOMETRY_TYPE_EULERIAN4C_HORIZONTAL_DESCRIPTION);
+
+
diff --git a/hkl/hkl-engine-e6c.c b/hkl/hkl-engine-e6c.c
new file mode 100644
index 0000000..59fc231
--- /dev/null
+++ b/hkl/hkl-engine-e6c.c
@@ -0,0 +1,376 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include <gsl/gsl_sys.h>                // for gsl_isnan
+#include "hkl-factory-private.h"        // for autodata_factories_, etc
+#include "hkl-pseudoaxis-common-q-private.h"  // for hkl_engine_q2_new, etc
+#include "hkl-pseudoaxis-common-hkl-private.h"  // for hkl_mode_operations, etc
+#include "hkl-pseudoaxis-common-psi-private.h"  // for hkl_engine_psi_new, etc
+
+/***********************/
+/* numerical functions */
+/***********************/
+
+static int _bissector_horizontal_func(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double mu = x->data[0];
+	const double omega = x->data[1];
+	const double gamma = x->data[4];
+
+	CHECK_NAN(x->data, x->size);
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = fmod(omega, M_PI);
+	f->data[4] = gamma - 2 * fmod(mu, M_PI);
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction bissector_horizontal_func = {
+	.function = _bissector_horizontal_func,
+	.size = 5,
+};
+
+static int _bissector_vertical_func(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double omega = x->data[0];
+	const double tth = x->data[3];
+
+	CHECK_NAN(x->data, x->size);
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = tth - 2 * fmod(omega,M_PI);
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction bissector_vertical_func = {
+	.function = _bissector_vertical_func,
+	.size = 4,
+};
+
+/*********/
+/* modes */
+/*********/
+
+static HklMode *bissector_vertical(void)
+{
+	static const char* axes_r[] = {"mu", "omega", "chi", "phi", "gamma", "delta"};
+	static const char* axes_w[] = {"omega", "chi", "phi", "delta"};
+	static const HklFunction *functions[] = {&bissector_vertical_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *constant_omega_vertical(void)
+{
+	static const char* axes_r[] = {"mu", "omega", "chi", "phi", "gamma", "delta"};
+	static const char* axes_w[] = {"chi", "phi", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *constant_chi_vertical(void)
+{
+	static const char* axes_r[] = {"mu", "omega", "chi", "phi", "gamma", "delta"};
+	static const char* axes_w[] = {"omega", "phi", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *constant_phi_vertical(void)
+{
+	static const char* axes_r[] = {"mu", "omega", "chi", "phi", "gamma", "delta"};
+	static const char* axes_w[] = {"omega", "chi", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *lifting_detector_phi(void)
+{
+	static const char* axes_r[] = {"mu", "omega", "chi", "phi", "gamma", "delta"};
+	static const char* axes_w[] = {"phi", "gamma", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *lifting_detector_omega(void)
+{
+	static const char* axes_r[] = {"mu", "omega", "chi", "phi", "gamma", "delta"};
+	static const char* axes_w[] = {"omega", "gamma", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *lifting_detector_mu(void)
+{
+	static const char* axes_r[] = {"mu", "omega", "chi", "phi", "gamma", "delta"};
+	static const char* axes_w[] = {"mu", "gamma", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *double_diffraction_vertical(void)
+{
+	static const char* axes_r[] = {"mu", "omega", "chi", "phi", "gamma", "delta"};
+	static const char* axes_w[] = {"omega", "chi", "phi", "delta"};
+	static const HklFunction *functions[] = {&double_diffraction_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w,
+					       functions, double_diffraction_parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *bissector_horizontal(void)
+{
+	static const char* axes_r[] = {"mu", "omega", "chi", "phi", "gamma", "delta"};
+	static const char* axes_w[] = {"mu", "omega", "chi", "phi", "gamma"};
+	static const HklFunction *functions[] = {&bissector_horizontal_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *double_diffraction_horizontal(void)
+{
+	static const char* axes_r[] = {"mu", "omega", "chi", "phi", "gamma", "delta"};
+	static const char* axes_w[] = {"mu", "chi", "phi", "gamma"};
+	static const HklFunction *functions[] = {&double_diffraction_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w,
+					       functions, double_diffraction_parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *psi_constant_vertical(void)
+{
+	static const char* axes_r[] = {"mu", "omega", "chi", "phi", "gamma", "delta"};
+	static const char* axes_w[] = {"omega", "chi", "phi", "delta"};
+	static const HklFunction *functions[] = {&psi_constant_vertical_func};
+	static const HklParameter parameters[] = { PSI_CONSTANT_PARAMETERS(1, 0, 0, 0) };
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w, functions, parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &psi_constant_vertical_mode_operations,
+				 TRUE);
+}
+
+static HklMode *psi_constant_horizontal(void)
+{
+	static const char* axes_r[] = {"mu", "omega", "chi", "phi", "gamma", "delta"};
+	static const char* axes_w[] = {"omega", "chi", "phi", "gamma"};
+	static const HklFunction *functions[] = {&psi_constant_vertical_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w,
+					       functions, psi_constant_parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &psi_constant_vertical_mode_operations,
+				 TRUE);
+}
+
+static HklMode *constant_mu_horizontal(void)
+{
+	static const char* axes_r[] = {"mu", "omega", "chi", "phi", "gamma", "delta"};
+	static const char* axes_w[] = {"chi", "phi", "gamma"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations,
+				 TRUE);
+}
+
+/***********************/
+/* E6C PseudoAxeEngine */
+/***********************/
+
+static HklEngine *hkl_engine_e6c_hkl_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_hkl_new();
+
+	default_mode = bissector_vertical();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_mode_set(self, default_mode);
+
+	hkl_engine_add_mode(self, constant_omega_vertical());
+	hkl_engine_add_mode(self, constant_chi_vertical());
+	hkl_engine_add_mode(self, constant_phi_vertical());
+	hkl_engine_add_mode(self, lifting_detector_phi());
+	hkl_engine_add_mode(self, lifting_detector_omega());
+	hkl_engine_add_mode(self, lifting_detector_mu());
+	hkl_engine_add_mode(self, double_diffraction_vertical());
+	hkl_engine_add_mode(self, bissector_horizontal());
+	hkl_engine_add_mode(self, double_diffraction_horizontal());
+	hkl_engine_add_mode(self, psi_constant_vertical());
+	hkl_engine_add_mode(self, psi_constant_horizontal());
+	hkl_engine_add_mode(self, constant_mu_horizontal());
+
+	return self;
+}
+
+/********/
+/* mode */
+/********/
+
+static HklMode* psi_vertical()
+{
+	static const char *axes_r[] = {"mu", "omega", "chi", "phi", "gamma", "delta"};
+	static const char *axes_w[] = {"omega", "chi", "phi", "delta"};
+	static const HklFunction *functions[] = {&psi_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w,
+					       functions, psi_parameters),
+	};
+
+	return hkl_mode_psi_new(&info);
+}
+
+/**********************/
+/* pseudo axis engine */
+/**********************/
+
+static HklEngine *hkl_engine_e6c_psi_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_psi_new();
+
+	default_mode = psi_vertical();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_mode_set(self, default_mode);
+
+	return self;
+}
+
+/*******/
+/* E6C */
+/*******/
+
+#define HKL_GEOMETRY_EULERIAN6C_DESCRIPTION				\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 4 axes for the sample\n"					\
+	"\n"								\
+	"  + **mu** : rotating around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **omega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **chi** : rotating around the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"  + **phi** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"\n"								\
+	"+ 2 axes for the detector\n"					\
+	"\n"								\
+	"  + **gamma** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **delta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
+
+static const char* hkl_geometry_eulerian6C_axes[] = {"mu", "omega", "chi", "phi", "gamma", "delta"};
+
+static HklGeometry *hkl_geometry_new_eulerian6C(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "chi", 1, 0, 0);
+	hkl_holder_add_rotation_axis(h, "phi", 0, -1, 0);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "gamma", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "delta", 0, -1, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_eulerian6C(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	hkl_engine_list_add(self, hkl_engine_e6c_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_e6c_psi_new());
+	hkl_engine_list_add(self, hkl_engine_q2_new());
+	hkl_engine_list_add(self, hkl_engine_qper_qpar_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(eulerian6C, "E6C", HKL_GEOMETRY_EULERIAN6C_DESCRIPTION);
diff --git a/hkl/hkl-pseudoaxis-k4cv-hkl.c b/hkl/hkl-engine-k4c.c
similarity index 55%
rename from hkl/hkl-pseudoaxis-k4cv-hkl.c
rename to hkl/hkl-engine-k4c.c
index b344010..82d2c3a 100644
--- a/hkl/hkl-pseudoaxis-k4cv-hkl.c
+++ b/hkl/hkl-engine-k4c.c
@@ -13,26 +13,51 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- *          Maria-Teresa Nunez-Pardo-de-Verra <tnunez at mail.desy.de>
- *          Jens Krüger <Jens.Krueger at frm2.tum.de>
  */
-#include <gsl/gsl_math.h>
-#include <gsl/gsl_vector.h>
-
-#include "hkl/ccan/array_size/array_size.h"
+#include <gsl/gsl_sys.h>                // for gsl_isnan
+#include "hkl-factory-private.h"        // for autodata_factories_, etc
+#include "hkl-pseudoaxis-common-eulerians-private.h"
+#include "hkl-pseudoaxis-common-q-private.h"  // for hkl_engine_q2_new, etc
+#include "hkl-pseudoaxis-common-hkl-private.h"  // for RUBh_minus_Q, etc
+#include "hkl-pseudoaxis-common-psi-private.h"  // for hkl_engine_psi_new, etc
+
+static void hkl_geometry_list_multiply_k4c_real(HklGeometryList *self,
+						HklGeometryListItem *item)
+{
+	HklGeometry *geometry;
+	HklGeometry *copy;
+	double komega, komegap;
+	double kappa, kappap;
+	double kphi, kphip;
+
+	geometry = item->geometry;
+	komega = hkl_parameter_value_get(darray_item(geometry->axes, 0), HKL_UNIT_DEFAULT);
+	kappa = hkl_parameter_value_get(darray_item(geometry->axes, 1), HKL_UNIT_DEFAULT);
+	kphi = hkl_parameter_value_get(darray_item(geometry->axes, 2), HKL_UNIT_DEFAULT);
+
+	kappa_2_kappap(komega, kappa, kphi, 50 * HKL_DEGTORAD, &komegap, &kappap, &kphip);
+
+	copy = hkl_geometry_new_copy(geometry);
+	/* TODO parameter list for the geometry */
+	hkl_parameter_value_set(darray_item(copy->axes, 0), komegap, HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(darray_item(copy->axes, 1), kappap, HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(darray_item(copy->axes, 2), kphip, HKL_UNIT_DEFAULT, NULL);
+
+	hkl_geometry_update(copy);
+	hkl_geometry_list_add(self, copy);
+	hkl_geometry_free(copy);
+}
 
-#include "hkl-parameter-private.h"
-#include "hkl-pseudoaxis-auto-private.h"
-#include "hkl-pseudoaxis-common-hkl-private.h"
+/************/
+/* hkl mode */
+/************/
 
-/***********************/
-/* numerical functions */
-/***********************/
+/* bissector */
 
 static int _bissector_f1(const gsl_vector *x, void *params, gsl_vector *f)
 {
@@ -78,16 +103,28 @@ static const HklFunction bissector_f2 = {
 	.size = 4,
 };
 
+static HklMode *bissector(void)
+{
+	static const char* axes[] = {"komega", "kappa", "kphi", "tth"};
+	static const HklFunction *functions[] = {&bissector_f1, &bissector_f2};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+/* constant omega */
+
 static int _constant_omega_f1(const gsl_vector *x, void *params, gsl_vector *f)
 {
 	double const komega = x->data[0];
 	double const kappa = x->data[1];
 	double omega;
 	HklEngine *engine = params;
-	double omega0;
-	uint shit;
-
-	hkl_parameter_list_values_get(&engine->mode->parameters, &omega0, &shit);
+	double omega0 = darray_item(engine->mode->parameters, 0)->_value;
 
 	CHECK_NAN(x->data, x->size);
 
@@ -110,10 +147,7 @@ static int _constant_omega_f2(const gsl_vector *x, void *params, gsl_vector *f)
 	const double kappa = x->data[1];
 	double omega;
 	HklEngine *engine = params;
-	double omega0;
-	uint shit;
-
-	hkl_parameter_list_values_get(&engine->mode->parameters, &omega0, &shit);
+	double omega0 = darray_item(engine->mode->parameters, 0)->_value;
 
 	CHECK_NAN(x->data, x->size);
 
@@ -130,15 +164,28 @@ static const HklFunction constant_omega_f2 = {
 	.size = 4,
 };
 
+static HklMode *constant_omega(void)
+{
+	static const char* axes[] = {"komega", "kappa", "kphi", "tth"};
+	static const HklFunction *functions[] = {&constant_omega_f1, &constant_omega_f2};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes, axes,
+					       functions, constant_omega_parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+/* constant chi */
+
 static int _constant_chi_f1(const gsl_vector *x, void *params, gsl_vector *f)
 {
 	const double kappa = x->data[1];
 	double chi;
 	HklEngine *engine = params;
-	double chi0;
-	uint shit;
-
-	hkl_parameter_list_values_get(&engine->mode->parameters, &chi0, &shit);
+	double chi0 = darray_item(engine->mode->parameters, 0)->_value;
 
 	CHECK_NAN(x->data, x->size);
 
@@ -160,10 +207,7 @@ static int _constant_chi_f2(const gsl_vector *x, void *params, gsl_vector *f)
 	const double kappa = x->data[1];
 	double chi;
 	HklEngine *engine = params;
-	double chi0;
-	uint shit;
-
-	hkl_parameter_list_values_get(&engine->mode->parameters, &chi0, &shit);
+	double chi0 = darray_item(engine->mode->parameters, 0)->_value;
 
 	CHECK_NAN(x->data, x->size);
 
@@ -180,16 +224,29 @@ static const HklFunction constant_chi_f2 = {
 	.size = 4,
 };
 
+static HklMode *constant_chi(void)
+{
+	static const char* axes[] = {"komega", "kappa", "kphi", "tth"};
+	static const HklFunction *functions[] = {&constant_chi_f1, &constant_chi_f2};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes, axes,
+					       functions, constant_chi_parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+/* constant phi */
+
 static int _constant_phi_f1(const gsl_vector *x, void *params, gsl_vector *f)
 {
 	const double kappa = x->data[1];
 	const double kphi = x->data[2];
 	double phi;
 	HklEngine *engine = params;
-	double phi0;
-	uint shit;
-
-	hkl_parameter_list_values_get(&engine->mode->parameters, &phi0, &shit);
+	double phi0 = darray_item(engine->mode->parameters, 0)->_value;
 
 	CHECK_NAN(x->data, x->size);
 
@@ -212,10 +269,7 @@ static int _constant_phi_f2(const gsl_vector *x, void *params, gsl_vector *f)
 	const double kphi = x->data[2];
 	double phi;
 	HklEngine *engine = params;
-	double phi0;
-	uint shit;
-
-	hkl_parameter_list_values_get(&engine->mode->parameters, &phi0, &shit);
+	double phi0 = darray_item(engine->mode->parameters, 0)->_value;
 
 	CHECK_NAN(x->data, x->size);
 
@@ -232,107 +286,49 @@ static const HklFunction constant_phi_f2 = {
 	.size = 4,
 };
 
-/********/
-/* mode */
-/********/
-
-static HklMode *bissector(void)
-{
-	static const char* axes[] = {"komega", "kappa", "kphi", "tth"};
-	static const HklFunction *functions[] = {&bissector_f1, &bissector_f2};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *constant_omega(void)
-{
-	static const char* axes[] = {"komega", "kappa", "kphi", "tth"};
-	static const HklFunction *functions[] = {&constant_omega_f1, &constant_omega_f2};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "omega"},
-	};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *constant_chi(void)
-{
-	static const char* axes[] = {"komega", "kappa", "kphi", "tth"};
-	static const HklFunction *functions[] = {&constant_chi_f1, &constant_chi_f2};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "chi"},
-	};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
 static HklMode *constant_phi(void)
 {
 	static const char* axes[] = {"komega", "kappa", "kphi", "tth"};
 	static const HklFunction *functions[] = {&constant_phi_f1, &constant_phi_f2};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "phi"},
-	};
 	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes, axes,
+					       functions, constant_phi_parameters),
 	};
 
 	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
+				 &hkl_mode_operations,
+				 TRUE);
 }
 
 static HklMode *double_diffraction(void)
 {
 	static const char* axes[] = {"komega", "kappa", "kphi", "tth"};
 	static const HklFunction *functions[] = {&double_diffraction_func};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 1,},
-	};
 	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes, axes,
+					       functions, double_diffraction_parameters),
 	};
 
 	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
+				 &hkl_mode_operations,
+				 TRUE);
 }
 
 static HklMode *psi_constant(void)
 {
 	static const char* axes[] = {"komega", "kappa", "kphi", "tth"};
 	static const HklFunction *functions[] = {&psi_constant_vertical_func};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 0,},
-		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 0,},
-		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "psi"},
-	};
 	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes, axes,
+					       functions, psi_constant_parameters),
 	};
 
 	return hkl_mode_auto_new(&info,
-				 &psi_constant_vertical_mode_operations);
+				 &psi_constant_vertical_mode_operations,
+				 TRUE);
 }
 
-/**********************/
-/* pseudo axis engine */
-/**********************/
-
-HklEngine *hkl_engine_k4cv_hkl_new(void)
+static HklEngine *hkl_engine_k4cv_hkl_new(void)
 {
 	HklEngine *self;
 	HklMode *default_mode;
@@ -341,7 +337,7 @@ HklEngine *hkl_engine_k4cv_hkl_new(void)
 
 	default_mode = bissector();
 	hkl_engine_add_mode(self, default_mode);
-	hkl_engine_select_mode(self, default_mode);
+	hkl_engine_mode_set(self, default_mode);
 
 	hkl_engine_add_mode(self, constant_omega());
 	hkl_engine_add_mode(self, constant_chi());
@@ -351,3 +347,88 @@ HklEngine *hkl_engine_k4cv_hkl_new(void)
 
 	return self;
 }
+
+/************/
+/* psi mode */
+/************/
+
+/* psi */
+static HklMode *psi()
+{
+	static const char *axes[] = {"komega", "kappa", "kphi", "tth"};
+	static const HklFunction *functions[] = {&psi_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes, axes,
+					       functions, psi_parameters),
+	};
+
+	return hkl_mode_psi_new(&info);
+}
+
+static HklEngine *hkl_engine_k4cv_psi_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_psi_new();
+
+	default_mode = psi();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_mode_set(self, default_mode);
+
+	return self;
+}
+
+/********/
+/* K4CV */
+/********/
+
+#define HKL_GEOMETRY_KAPPA4C_VERTICAL_DESCRIPTION			\
+	"For this geometry there is a special parameters called :math:`\\alpha` which is the\n" \
+	"angle between the kappa rotation axis and the  :math:`\\vec{y}` direction.\n" \
+	"\n"								\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 3 axes for the sample\n"					\
+	"\n"								\
+	"  + **komega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **kappa** : rotating around the :math:`\\vec{x}` direction (0, :math:`-\\cos\\alpha`, :math:`-\\sin\\alpha`)\n" \
+	"  + **kphi** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"\n"								\
+	"+ 1 axis for the detector\n"					\
+	"\n"								\
+	"  + **tth** : rotation around the :math:`-\\\vec{y}` direction (0, -1, 0)\n"
+
+static const char* hkl_geometry_kappa4C_vertical_axes[] = {"komega", "kappa", "kphi", "tth"};
+
+static HklGeometry *hkl_geometry_new_kappa4C_vertical(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	double alpha = 50 * HKL_DEGTORAD;
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "komega", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "kappa", 0, -cos(alpha), -sin(alpha));
+	hkl_holder_add_rotation_axis(h, "kphi", 0, -1, 0);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "tth", 0, -1, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_kappa4C_vertical(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	self->geometries->multiply = hkl_geometry_list_multiply_k4c_real;
+	hkl_engine_list_add(self, hkl_engine_k4cv_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_eulerians_new());
+	hkl_engine_list_add(self, hkl_engine_k4cv_psi_new());
+	hkl_engine_list_add(self, hkl_engine_q_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(kappa4C_vertical, "K4CV", HKL_GEOMETRY_KAPPA4C_VERTICAL_DESCRIPTION);
+
diff --git a/hkl/hkl-engine-k6c.c b/hkl/hkl-engine-k6c.c
new file mode 100644
index 0000000..f99b095
--- /dev/null
+++ b/hkl/hkl-engine-k6c.c
@@ -0,0 +1,1017 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include <gsl/gsl_sys.h>                // for gsl_isnan
+#include "hkl-factory-private.h"        // for autodata_factories_, etc
+#include "hkl-pseudoaxis-common-eulerians-private.h"
+#include "hkl-pseudoaxis-common-q-private.h"  // for hkl_engine_q2_new, etc
+#include "hkl-pseudoaxis-common-hkl-private.h"  // for RUBh_minus_Q, etc
+#include "hkl-pseudoaxis-common-psi-private.h"  // for hkl_engine_psi_new, etc
+
+static void hkl_geometry_list_multiply_k6c_real(HklGeometryList *self,
+						HklGeometryListItem *item)
+{
+	HklGeometry *geometry;
+	HklGeometry *copy;
+	double komega, komegap;
+	double kappa, kappap;
+	double kphi, kphip;
+
+	geometry = item->geometry;
+	komega = hkl_parameter_value_get(darray_item(geometry->axes, 1), HKL_UNIT_DEFAULT);
+	kappa = hkl_parameter_value_get(darray_item(geometry->axes, 2), HKL_UNIT_DEFAULT);
+	kphi = hkl_parameter_value_get(darray_item(geometry->axes, 3), HKL_UNIT_DEFAULT);
+
+	kappa_2_kappap(komega, kappa, kphi, 50 * HKL_DEGTORAD, &komegap, &kappap, &kphip);
+
+	copy = hkl_geometry_new_copy(geometry);
+	/* TODO parameter list for the geometry */
+	hkl_parameter_value_set(darray_item(copy->axes, 1), komegap, HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(darray_item(copy->axes, 2), kappap, HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(darray_item(copy->axes, 3), kphip, HKL_UNIT_DEFAULT, NULL);
+
+	hkl_geometry_update(copy);
+	hkl_geometry_list_add(self, copy);
+	hkl_geometry_free(copy);
+}
+
+
+/***********************/
+/* numerical functions */
+/***********************/
+
+static int _bissector_h_f1(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double mu = x->data[0];
+	const double komega = x->data[1];
+	const double kappa = x->data[2];
+	const double gamma = x->data[4];
+	double omega;
+
+	CHECK_NAN(x->data, x->size);
+
+	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) - M_PI_2;
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = fmod(omega, M_PI);
+	f->data[4] = fmod(gamma - 2 * fmod(mu, M_PI), 2*M_PI);
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction bissector_h_f1 = {
+	.function = _bissector_h_f1,
+	.size = 5,
+};
+
+static int _bissector_h_f2(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double mu = x->data[0];
+	const double komega = x->data[1];
+	const double kappa = x->data[2];
+	const double gamma = x->data[4];
+	double omega;
+
+	CHECK_NAN(x->data, x->size);
+
+	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) + M_PI_2;
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = fmod(omega, M_PI);
+	f->data[4] = fmod(gamma - 2 * fmod(mu, M_PI), 2*M_PI);
+
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction bissector_h_f2 = {
+	.function = _bissector_h_f2,
+	.size = 5,
+};
+
+static int _constant_kphi_h_f1(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double komega = x->data[1];
+	const double kappa = x->data[2];
+	double omega;
+
+	CHECK_NAN(x->data, x->size);
+
+	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) - M_PI_2;
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = fmod(omega, M_PI);
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction constant_kphi_h_f1 = {
+	.function = _constant_kphi_h_f1,
+	.size = 4,
+};
+
+static int _constant_kphi_h_f2(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double komega = x->data[1];
+	const double kappa = x->data[2];
+	double omega;
+
+	CHECK_NAN(x->data, x->size);
+
+	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) + M_PI_2;
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = fmod(omega, M_PI);
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction constant_kphi_h_f2 = {
+	.function = _constant_kphi_h_f2,
+	.size = 4,
+};
+
+static int _constant_phi_h_f1(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double komega = x->data[1];
+	const double kappa = x->data[2];
+	const double kphi = x->data[3];
+	double omega, phi, p;
+
+	CHECK_NAN(x->data, x->size);
+
+	p = atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD));
+	omega = komega + p - M_PI_2;
+	phi = kphi + p + M_PI_2;
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = fmod(omega, M_PI);
+	f->data[4] = phi;
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction constant_phi_h_f1 = {
+	.function = _constant_phi_h_f1,
+	.size = 5,
+};
+
+static int _constant_phi_h_f2(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double komega = x->data[1];
+	const double kappa = x->data[2];
+	const double kphi = x->data[3];
+	double omega, phi, p;
+
+	CHECK_NAN(x->data, x->size);
+
+	p = atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD));
+	omega = komega + p + M_PI_2;
+	phi = kphi + p - M_PI_2;
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = fmod(omega, M_PI);
+	f->data[4] = phi;
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction constant_phi_h_f2 = {
+	.function = _constant_phi_h_f2,
+	.size = 5,
+};
+
+static int _bissector_v(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double komega = x->data[0];
+	const double kappa = x->data[1];
+	const double delta = x->data[3];
+	double omega;
+
+	CHECK_NAN(x->data, x->size);
+
+	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) - M_PI_2;
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = fmod(delta - 2 * fmod(omega, M_PI), 2*M_PI);
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction bissector_v = {
+	.function = _bissector_v,
+	.size = 4,
+};
+
+static int _constant_omega_v(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double komega = x->data[0];
+	const double kappa = x->data[1];
+	double omega;
+	HklEngine *engine = params;
+	double omega0 = darray_item(engine->mode->parameters, 0)->_value;
+
+	CHECK_NAN(x->data, x->size);
+
+	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) - M_PI_2;
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = omega0 - omega;
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction constant_omega_v = {
+	.function = _constant_omega_v,
+	.size = 4,
+};
+
+static int _constant_chi_v(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double kappa = x->data[1];
+	double chi;
+	HklEngine *engine = params;
+	double chi0 = darray_item(engine->mode->parameters, 0)->_value;
+
+	CHECK_NAN(x->data, x->size);
+
+	chi = 2 * asin(sin(kappa/2.) * sin(50 * HKL_DEGTORAD));
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = chi0 - chi;
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction constant_chi_v = {
+	.function = _constant_chi_v,
+	.size = 4,
+};
+
+static int _constant_phi_v(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double kappa = x->data[1];
+	const double kphi = x->data[2];
+	double phi;
+	HklEngine *engine = params;
+	double phi0 = darray_item(engine->mode->parameters, 0)->_value;
+
+	CHECK_NAN(x->data, x->size);
+
+	phi = kphi + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) + M_PI_2;
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = phi0 - phi;
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction constant_phi_v = {
+	.function = _constant_phi_v,
+	.size = 4,
+};
+
+static int _double_diffraction_h(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double komega = x->data[1];
+	const double kappa = x->data[2];
+	double omega;
+
+	CHECK_NAN(x->data, x->size);
+
+	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) - M_PI_2;
+
+	_double_diffraction(x->data, params, f->data);
+	f->data[4] = fmod(omega, M_PI);
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction double_diffraction_h = {
+	.function = _double_diffraction_h,
+	.size = 5,
+};
+
+static int _constant_incidence_func(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	static const HklVector Y = {
+		.data = {0, 1, 0},
+	};
+	double incidence;
+	double azimuth;
+	HklEngine *engine = params;
+	HklModeAutoWithInit *mode = container_of(engine->mode, HklModeAutoWithInit, mode);
+	HklVector n;
+	double incidence0;
+	double azimuth0;
+	HklVector ki;
+
+	CHECK_NAN(x->data, x->size);
+
+	RUBh_minus_Q(x->data, params, f->data);
+
+	/* get the mode parameters */
+	n.data[0] = darray_item(engine->mode->parameters, 0)->_value;
+	n.data[1] = darray_item(engine->mode->parameters, 1)->_value;
+	n.data[2] = darray_item(engine->mode->parameters, 2)->_value;
+	incidence0 = darray_item(engine->mode->parameters, 3)->_value;
+	azimuth0 = darray_item(engine->mode->parameters, 4)->_value;
+
+	/* compute the two angles */
+
+
+	/* first check that the mode was already initialized if not
+	 * the surface is oriented along the nx, ny, nz axis for all
+	 * diffractometer angles equal to zero */
+	if(mode->geometry){
+		HklQuaternion q0 = darray_item(mode->geometry->holders, 0)->q;
+
+		hkl_quaternion_conjugate(&q0);
+		hkl_vector_rotated_quaternion(&n, &q0);
+	}
+
+	hkl_vector_rotated_quaternion(&n, &darray_item(engine->geometry->holders, 0)->q);
+
+	hkl_source_compute_ki(&engine->geometry->source, &ki);
+	incidence = M_PI_2 - hkl_vector_angle(&n, &ki);
+
+	hkl_vector_project_on_plan(&n, &ki);
+	azimuth = hkl_vector_angle(&n, &Y);
+
+	f->data[3] = incidence0 - incidence;
+	f->data[4] = azimuth0 - azimuth;
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction constant_incidence_func = {
+	.function = _constant_incidence_func,
+	.size = 5,
+};
+
+/********/
+/* mode */
+/********/
+
+static HklMode *bissector_vertical(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "gamma", "delta"};
+	static const char* axes_w[] = {"komega", "kappa", "kphi", "delta"};
+	static const HklFunction *functions[] = {&bissector_v};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *constant_omega_vertical(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "gamma", "delta"};
+	static const char* axes_w[] = {"komega", "kappa", "kphi", "delta"};
+	static const HklFunction *functions[] = {&constant_omega_v};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w,
+					       functions, constant_omega_parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *constant_chi_vertical(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "gamma", "delta"};
+	static const char* axes_w[] = {"komega", "kappa", "kphi", "delta"};
+	static const HklFunction *functions[] = {&constant_chi_v};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w,
+					       functions, constant_chi_parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *constant_phi_vertical(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "gamma", "delta"};
+	static const char* axes_w[] = {"komega", "kappa", "kphi", "delta"};
+	static const HklFunction *functions[] = {&constant_phi_v};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w,
+					       functions, constant_phi_parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *lifting_detector_kphi(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "gamma", "delta"};
+	static const char* axes_w[] = {"kphi", "gamma", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *lifting_detector_komega(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "gamma", "delta"};
+	static const char* axes_w[] = {"komega", "gamma", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *lifting_detector_mu(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "gamma", "delta"};
+	static const char* axes_w[] = {"mu", "gamma", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *double_diffraction_vertical(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "gamma", "delta"};
+	static const char* axes_w[] = {"komega", "kappa", "kphi", "delta"};
+	static const HklFunction *functions[] = {&double_diffraction_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w,
+					       functions, double_diffraction_parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *bissector_horizontal(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "gamma", "delta"};
+	static const char* axes_w[] = {"mu", "komega", "kappa", "kphi", "gamma"};
+	static const HklFunction *functions[] = {&bissector_h_f1, &bissector_h_f2};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *constant_phi_horizontal(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "gamma", "delta"};
+	static const char* axes_w[] = {"mu", "komega", "kappa", "kphi", "gamma"};
+	static const HklFunction *functions[] = {&constant_phi_h_f1, &constant_phi_h_f2};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w,
+					       functions, constant_phi_parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *constant_kphi_horizontal(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "gamma", "delta"};
+	static const char* axes_w[] = {"mu", "komega", "kappa", "gamma"};
+	static const HklFunction *functions[] = {&constant_kphi_h_f1, &constant_kphi_h_f2};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *double_diffraction_horizontal(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "gamma", "delta"};
+	static const char* axes_w[] = {"mu", "komega", "kappa", "kphi", "gamma"};
+	static const HklFunction *functions[] = {&double_diffraction_h};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w,
+					       functions, double_diffraction_parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *psi_constant_vertical(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "gamma", "delta"};
+	static const char* axes_w[] = {"komega", "kappa", "kphi", "delta"};
+	static const HklFunction *functions[] = {&psi_constant_vertical_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w,
+					       functions, psi_constant_parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &psi_constant_vertical_mode_operations,
+				 TRUE);
+}
+
+static HklMode *constant_incidence(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "gamma", "delta"};
+	static const char* axes_w[] = {"komega", "kappa", "kphi", "gamma", "delta"};
+	static const HklFunction *functions[] = {&constant_incidence_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w,
+					       functions, constant_incidence_parameters),
+	};
+
+	return hkl_mode_auto_with_init_new(&info,
+					   &constant_incidence_mode_operations,
+					   TRUE);
+}
+
+/**********************/
+/* pseudo axis engine */
+/**********************/
+
+static HklEngine *hkl_engine_k6c_hkl_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_hkl_new();
+
+	default_mode = bissector_vertical();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_mode_set(self, default_mode);
+
+	hkl_engine_add_mode(self, constant_omega_vertical());
+	hkl_engine_add_mode(self, constant_chi_vertical());
+	hkl_engine_add_mode(self, constant_phi_vertical());
+	hkl_engine_add_mode(self, lifting_detector_kphi());
+	hkl_engine_add_mode(self, lifting_detector_komega());
+	hkl_engine_add_mode(self, lifting_detector_mu());
+	hkl_engine_add_mode(self, double_diffraction_vertical());
+	hkl_engine_add_mode(self, bissector_horizontal());
+	hkl_engine_add_mode(self, constant_phi_horizontal());
+	hkl_engine_add_mode(self, constant_kphi_horizontal());
+	hkl_engine_add_mode(self, double_diffraction_horizontal());
+	hkl_engine_add_mode(self, psi_constant_vertical());
+	hkl_engine_add_mode(self, constant_incidence());
+
+	return self;
+}
+
+/***********************/
+/* SOLEIL sirius kappa */
+/***********************/
+
+/* mode */
+
+static HklMode *bissector_vertical_soleil_sirius_kappa(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "delta", "gamma"};
+	static const char* axes_w[] = {"komega", "kappa", "kphi", "gamma"};
+	static const HklFunction *functions[] = {&bissector_v};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO("bissector_vertical", axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *constant_omega_vertical_soleil_sirius_kappa(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "delta", "gamma"};
+	static const char* axes_w[] = {"komega", "kappa", "kphi", "gamma"};
+	static const HklFunction *functions[] = {&constant_omega_v};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS("constant_omega_vertical", axes_r, axes_w,
+					       functions, constant_omega_parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *constant_chi_vertical_soleil_sirius_kappa(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "delta", "gamma"};
+	static const char* axes_w[] = {"komega", "kappa", "kphi", "gamma"};
+	static const HklFunction *functions[] = {&constant_chi_v};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS("constant_chi_vertical", axes_r, axes_w,
+					       functions, constant_chi_parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *constant_phi_vertical_soleil_sirius_kappa(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "delta", "gamma"};
+	static const char* axes_w[] = {"komega", "kappa", "kphi", "gamma"};
+	static const HklFunction *functions[] = {&constant_phi_v};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS("constant_phi_vertical", axes_r, axes_w,
+					       functions, constant_phi_parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *lifting_detector_kphi_soleil_sirius_kappa(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "delta", "gamma"};
+	static const char* axes_w[] = {"kphi", "delta", "gamma"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO("lifting_detector_kphi", axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *lifting_detector_komega_soleil_sirius_kappa(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "delta", "gamma"};
+	static const char* axes_w[] = {"komega", "delta", "gamma"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO("lifting_detector_komega", axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *lifting_detector_mu_soleil_sirius_kappa(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "delta", "gamma"};
+	static const char* axes_w[] = {"mu", "delta", "gamma"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO("lifting_detector_mu", axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *double_diffraction_vertical_soleil_sirius_kappa(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "delta", "gamma"};
+	static const char* axes_w[] = {"komega", "kappa", "kphi", "gamma"};
+	static const HklFunction *functions[] = {&double_diffraction_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS("double_diffraction_vertical", axes_r, axes_w,
+					       functions, double_diffraction_parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *bissector_horizontal_soleil_sirius_kappa(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "delta", "gamma"};
+	static const char* axes_w[] = {"mu", "komega", "kappa", "kphi", "delta"};
+	static const HklFunction *functions[] = {&bissector_h_f1, &bissector_h_f2};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO("bissector_horizontal", axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *constant_phi_horizontal_soleil_sirius_kappa(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "delta", "gamma"};
+	static const char* axes_w[] = {"mu", "komega", "kappa", "kphi", "delta"};
+	static const HklFunction *functions[] = {&constant_phi_h_f1, &constant_phi_h_f2};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS("constant_phi_horizontal", axes_r, axes_w,
+					       functions, constant_phi_parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *constant_kphi_horizontal_soleil_sirius_kappa(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "delta", "gamma"};
+	static const char* axes_w[] = {"mu", "komega", "kappa", "delta"};
+	static const HklFunction *functions[] = {&constant_kphi_h_f1, &constant_kphi_h_f2};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO("constant_kphi_horizontal", axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *double_diffraction_horizontal_soleil_sirius_kappa(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "delta", "gamma"};
+	static const char* axes_w[] = {"mu", "komega", "kappa", "kphi", "delta"};
+	static const HklFunction *functions[] = {&double_diffraction_h};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS("double_diffraction_horizontal", axes_r, axes_w,
+					       functions, double_diffraction_parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode *psi_constant_vertical_soleil_sirius_kappa(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "delta", "gamma"};
+	static const char* axes_w[] = {"komega", "kappa", "kphi", "gamma"};
+	static const HklFunction *functions[] = {&psi_constant_vertical_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS("psi_constant_vertical", axes_r, axes_w,
+					       functions, psi_constant_parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &psi_constant_vertical_mode_operations,
+				 TRUE);
+}
+
+static HklMode *constant_incidence_soleil_sirius_kappa(void)
+{
+	static const char* axes_r[] = {"mu", "komega", "kappa", "kphi", "delta", "gamma"};
+	static const char* axes_w[] = {"komega", "kappa", "kphi", "delta", "gamma"};
+	static const HklFunction *functions[] = {&constant_incidence_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS("constant_incidence", axes_r, axes_w,
+					       functions, constant_incidence_parameters),
+	};
+
+	return hkl_mode_auto_with_init_new(&info,
+					   &constant_incidence_mode_operations,
+					   TRUE);
+}
+
+static HklEngine *hkl_engine_soleil_sirius_kappa_hkl_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_hkl_new();
+
+	default_mode = bissector_vertical_soleil_sirius_kappa();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_mode_set(self, default_mode);
+
+	hkl_engine_add_mode(self, constant_omega_vertical_soleil_sirius_kappa());
+	hkl_engine_add_mode(self, constant_chi_vertical_soleil_sirius_kappa());
+	hkl_engine_add_mode(self, constant_phi_vertical_soleil_sirius_kappa());
+	hkl_engine_add_mode(self, lifting_detector_kphi_soleil_sirius_kappa());
+	hkl_engine_add_mode(self, lifting_detector_komega_soleil_sirius_kappa());
+	hkl_engine_add_mode(self, lifting_detector_mu_soleil_sirius_kappa());
+	hkl_engine_add_mode(self, double_diffraction_vertical_soleil_sirius_kappa());
+	hkl_engine_add_mode(self, bissector_horizontal_soleil_sirius_kappa());
+	hkl_engine_add_mode(self, constant_phi_horizontal_soleil_sirius_kappa());
+	hkl_engine_add_mode(self, constant_kphi_horizontal_soleil_sirius_kappa());
+	hkl_engine_add_mode(self, double_diffraction_horizontal_soleil_sirius_kappa());
+	hkl_engine_add_mode(self, psi_constant_vertical_soleil_sirius_kappa());
+	hkl_engine_add_mode(self, constant_incidence_soleil_sirius_kappa());
+
+	return self;
+}
+
+static HklMode *psi_vertical()
+{
+	static const char *axes_r[] = {"mu", "komega", "kappa", "kphi", "gamma", "delta"};
+	static const char *axes_w[] = {"komega", "kappa", "kphi", "delta"};
+	static const HklFunction *functions[] = {&psi_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w,
+					       functions, psi_parameters),
+	};
+
+	return hkl_mode_psi_new(&info);
+}
+
+static HklEngine *hkl_engine_k6c_psi_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_psi_new();
+
+	default_mode = psi_vertical();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_mode_set(self, default_mode);
+
+	return self;
+}
+
+/***********************/
+/* SOLEIL SIRIUS KAPPA */
+/***********************/
+
+static HklMode *psi_vertical_soleil_sirius_kappa()
+{
+	static const char *axes_r[] = {"mu", "komega", "kappa", "kphi", "delta", "gamma"};
+	static const char *axes_w[] = {"komega", "kappa", "kphi", "gamma"};
+	static const HklFunction *functions[] = {&psi_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w,
+					       functions, psi_parameters),
+	};
+
+	return hkl_mode_psi_new(&info);
+}
+
+static HklEngine *hkl_engine_soleil_sirius_kappa_psi_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_psi_new();
+
+	default_mode = psi_vertical_soleil_sirius_kappa();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_mode_set(self, default_mode);
+
+	return self;
+}
+
+/*******/
+/* K6C */
+/*******/
+
+#define HKL_GEOMETRY_KAPPA6C_DESCRIPTION				\
+	"For this geometry there is a special parameters called :math:`\\alpha` which is the\n" \
+	"angle between the kappa rotation axis and the  :math:`\\vec{y}` direction.\n" \
+	"\n"								\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 4 axes for the sample\n"					\
+	"\n"								\
+	"  + **mu** : rotating around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **komega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **kappa** : rotating around the :math:`\\vec{x}` direction (0, :math:`-\\cos\\alpha`, :math:`-\\sin\\alpha`)\n" \
+	"  + **kphi** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"\n"								\
+	"+ 2 axes for the detector\n"					\
+	"\n"								\
+	"  + **gamma** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **delta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
+
+static const char* hkl_geometry_kappa6C_axes[] = {"mu", "komega", "kappa", "kphi", "gamma", "delta"};
+
+static HklGeometry *hkl_geometry_new_kappa6C(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	double alpha = 50 * HKL_DEGTORAD;
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "komega", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "kappa", 0, -cos(alpha), -sin(alpha));
+	hkl_holder_add_rotation_axis(h, "kphi", 0, -1, 0);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "gamma", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "delta", 0, -1, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_kappa6C(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	self->geometries->multiply = hkl_geometry_list_multiply_k6c_real;
+	hkl_engine_list_add(self, hkl_engine_k6c_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_eulerians_new());
+	hkl_engine_list_add(self, hkl_engine_k6c_psi_new());
+	hkl_engine_list_add(self, hkl_engine_q2_new());
+	hkl_engine_list_add(self, hkl_engine_qper_qpar_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(kappa6C, "K6C", HKL_GEOMETRY_KAPPA6C_DESCRIPTION);
+
+/***********************/
+/* SOLEIL SIRIUS KAPPA */
+/***********************/
+
+#define HKL_GEOMETRY_TYPE_SOLEIL_SIRIUS_KAPPA_DESCRIPTION		\
+	"+ xrays source fix along the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 4 axes for the sample\n"					\
+	"\n"								\
+	"  + **mu** : rotating around the :math:`-\\vec{z}` direction (0, 0, -1)\n" \
+	"  + **komega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **kappa** : rotating around the :math:`\\vec{x}` direction (0, :math:`-\\cos\\alpha`, :math:`-\\sin\\alpha`)\n" \
+	"  + **kphi** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"\n"								\
+	"+ 2 axes for the detector\n"					\
+	"\n"								\
+	"  + **delta** : rotation around the :math:`-\\vec{z}` direction (0, 0, -1)\n" \
+	"  + **gamma** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
+
+static const char* hkl_geometry_soleil_sirius_kappa_axes[] = {"mu", "komega", "kappa", "kphi", "delta", "gamma"};
+
+static HklGeometry *hkl_geometry_new_soleil_sirius_kappa(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	double alpha = 50 * HKL_DEGTORAD;
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "mu", 0, 0, -1);
+	hkl_holder_add_rotation_axis(h, "komega", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "kappa", 0, -cos(alpha), -sin(alpha));
+	hkl_holder_add_rotation_axis(h, "kphi", 0, -1, 0);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "delta", 0, 0, -1);
+	hkl_holder_add_rotation_axis(h, "gamma", 0, -1, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_soleil_sirius_kappa(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	self->geometries->multiply = hkl_geometry_list_multiply_k6c_real;
+	hkl_engine_list_add(self, hkl_engine_soleil_sirius_kappa_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_eulerians_new());
+	hkl_engine_list_add(self, hkl_engine_soleil_sirius_kappa_psi_new());
+	hkl_engine_list_add(self, hkl_engine_q2_new());
+	hkl_engine_list_add(self, hkl_engine_qper_qpar_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(soleil_sirius_kappa, "SOLEIL SIRIUS KAPPA", HKL_GEOMETRY_TYPE_SOLEIL_SIRIUS_KAPPA_DESCRIPTION);
diff --git a/hkl/hkl-engine-petra3-p09-eh2.c b/hkl/hkl-engine-petra3-p09-eh2.c
new file mode 100644
index 0000000..9afdf30
--- /dev/null
+++ b/hkl/hkl-engine-petra3-p09-eh2.c
@@ -0,0 +1,243 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include <gsl/gsl_sys.h>                // for gsl_isnan
+#include "hkl-factory-private.h"        // for autodata_factories_, etc
+#include "hkl-pseudoaxis-common-hkl-private.h"
+
+/********/
+/* mode */
+/********/
+
+static HklMode *zaxis_alpha_fixed()
+{
+	static const char *axes_r[] = {"mu", "omega", "chi", "phi", "delta", "gamma"};
+	static const char *axes_w[] = {"omega", "delta", "gamma"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO("zaxis + alpha-fixed", axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations,
+				 TRUE);
+}
+
+static HklMode *zaxis_beta_fixed()
+{
+	static const char *axes_r[] = {"mu", "omega", "chi", "phi", "delta", "gamma"};
+	static const char *axes_w[] = {"mu", "delta", "gamma"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO("zaxis + beta-fixed", axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations,
+				 TRUE);
+}
+
+/* zaxis + alpha=beta */
+
+static int _reflectivity(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double mu = x->data[0];
+	const double gamma = x->data[3];
+
+	CHECK_NAN(x->data, x->size);
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = mu - gamma;
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction reflectivity = {
+	.function = _reflectivity,
+	.size = 4,
+};
+
+
+static HklMode *zaxis_alpha_eq_beta()
+{
+	static const char *axes_r[] = {"mu", "omega", "chi", "phi", "delta", "gamma"};
+	static const char *axes_w[] = {"mu", "omega", "delta", "gamma"};
+	static const HklFunction *functions[] = {&reflectivity};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO("zaxis + alpha=beta", axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations,
+				 TRUE);
+}
+
+/* 4-circles bissecting horizontal */
+
+static int _bissector_horizontal(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double omega = x->data[0];
+	const double delta = x->data[3];
+
+	CHECK_NAN(x->data, x->size);
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = delta - 2 * fmod(omega, M_PI);
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction bissector_horizontal = {
+	.function = _bissector_horizontal,
+	.size = 4,
+};
+
+static HklMode *fourc_bissector_horizontal()
+{
+	static const char *axes_r[] = {"mu", "omega", "chi", "phi", "delta", "gamma"};
+	static const char *axes_w[] = {"omega", "chi", "phi", "delta"};
+	static const HklFunction *functions[] = {&bissector_horizontal};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO("4-circles bissecting horizontal", axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations,
+				 TRUE);
+}
+
+static HklMode *fourc_constant_omega_horizontal()
+{
+	static const char *axes_r[] = {"mu", "omega", "chi", "phi", "delta", "gamma"};
+	static const char *axes_w[] = {"chi", "phi", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO("4-circles constant omega horizontal", axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations,
+				 TRUE);
+}
+
+static HklMode *fourc_constant_chi_horizontal()
+{
+	static const char *axes_r[] = {"mu", "omega", "chi", "phi", "delta", "gamma"};
+	static const char *axes_w[] = {"omega", "phi", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO("4-circles constant chi horizontal", axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations,
+				 TRUE);
+}
+
+static HklMode *fourc_constant_phi_horizontal()
+{
+	static const char *axes_r[] = {"mu", "omega", "chi", "phi", "delta", "gamma"};
+	static const char *axes_w[] = {"omega", "chi", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO("4-circles constant phi horizontal", axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations,
+				 TRUE);
+}
+
+/**********************/
+/* pseudo axis engine */
+/**********************/
+
+static HklEngine *hkl_engine_petra3_p09_eh2_hkl_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_hkl_new();
+
+	default_mode = zaxis_alpha_fixed();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_mode_set(self, default_mode);
+
+	hkl_engine_add_mode(self, zaxis_beta_fixed());
+	hkl_engine_add_mode(self, zaxis_alpha_eq_beta());
+	hkl_engine_add_mode(self, fourc_bissector_horizontal());
+	hkl_engine_add_mode(self, fourc_constant_omega_horizontal());
+	hkl_engine_add_mode(self, fourc_constant_chi_horizontal());
+	hkl_engine_add_mode(self, fourc_constant_phi_horizontal());
+
+	return self;
+}
+
+/******************/
+/* PETRA3 P09 EH2 */
+/******************/
+
+#define HKL_GEOMETRY_TYPE_PETRA3_P09_EH2_DESCRIPTION			\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 4 axes for the sample\n"					\
+	"\n"								\
+	"  + **mu** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **omega** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **chi** : rotating around the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"  + **phi** : rotating around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"\n"								\
+	"+ 3 axis for the detector\n"					\
+	"\n"								\
+	"  + **mu** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **delta** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **gamma** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
+
+static const char* hkl_geometry_petra3_p09_eh2_axes[] = {"mu", "omega", "chi", "phi", "delta", "gamma"};
+
+static HklGeometry *hkl_geometry_new_petra3_p09_eh2(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "mu", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "omega", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "chi", 1, 0, 0);
+	hkl_holder_add_rotation_axis(h, "phi", 0, 0, 1);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "mu", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "delta", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "gamma", 0, -1, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_petra3_p09_eh2(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	hkl_engine_list_add(self, hkl_engine_petra3_p09_eh2_hkl_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(petra3_p09_eh2, "PETRA3 P09 EH2", HKL_GEOMETRY_TYPE_PETRA3_P09_EH2_DESCRIPTION);
diff --git a/hkl/hkl-engine-soleil-sirius-turret.c b/hkl/hkl-engine-soleil-sirius-turret.c
new file mode 100644
index 0000000..a5b9dbb
--- /dev/null
+++ b/hkl/hkl-engine-soleil-sirius-turret.c
@@ -0,0 +1,105 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include "hkl-factory-private.h"        // for autodata_factories_, etc
+#include "hkl-pseudoaxis-common-q-private.h"  // for hkl_engine_q2_new, etc
+#include "hkl-pseudoaxis-common-hkl-private.h"  // for hkl_engine_hkl_new, etc
+
+/**************************/
+/* TURRET PseudoAxeEngine */
+/**************************/
+
+static HklMode* lifting_detector_thetah()
+{
+	static const char *axes_r[] = {"thetah", "alphay", "alphax", "delta", "gamma"};
+	static const char* axes_w[] = {"thetah", "delta", "gamma"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations,
+				 TRUE);
+}
+
+static HklEngine *hkl_engine_soleil_sirius_turret_hkl_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_hkl_new();
+
+	default_mode = lifting_detector_thetah();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_mode_set(self, default_mode);
+
+	return self;
+}
+
+/************************/
+/* SOLEIL SIRIUS TURRET */
+/************************/
+
+#define HKL_GEOMETRY_TYPE_SOLEIL_SIRIUS_TURRET_DESCRIPTION		\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 3 axes for the sample\n"					\
+	"\n"								\
+	"  + **thetah** : rotation around the :math:`-\\vec{z}` direction (0, 0, -1)\n" \
+	"  + **alphay** : rotation around the :math:`\\vec{y}` direction (0, 1, 0)\n" \
+	"  + **alphax** : rotating around the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"\n"								\
+	"+ 2 axis for the detector\n"					\
+	"\n"								\
+	"  + **delta** : rotation around the :math:`-\\vec{y}` direction (0, 0, -1)\n" \
+	"  + **gamma** : rotation around the :math:`\\vec{z}` direction (0, -1, 0)\n"
+
+static const char* hkl_geometry_soleil_sirius_turret_axes[] = {"thetah", "alphay", "alphax", "delta", "gamma"};
+
+static HklGeometry *hkl_geometry_new_soleil_sirius_turret(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "thetah", 0, 0, -1);
+	hkl_holder_add_rotation_axis(h, "alphay", 0, 1, 0);
+	hkl_holder_add_rotation_axis(h, "alphax", 1, 0, 0);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "delta", 0, 0, -1);
+	hkl_holder_add_rotation_axis(h, "gamma", 0, -1, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_soleil_sirius_turret(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	hkl_engine_list_add(self, hkl_engine_soleil_sirius_turret_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_q2_new());
+	hkl_engine_list_add(self, hkl_engine_qper_qpar_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(soleil_sirius_turret, "SOLEIL SIRIUS TURRET", HKL_GEOMETRY_TYPE_SOLEIL_SIRIUS_TURRET_DESCRIPTION);
diff --git a/hkl/hkl-engine-soleil-sixs-med.c b/hkl/hkl-engine-soleil-sixs-med.c
new file mode 100644
index 0000000..77fc5e4
--- /dev/null
+++ b/hkl/hkl-engine-soleil-sixs-med.c
@@ -0,0 +1,451 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include <gsl/gsl_multiroots.h>
+#include "hkl-factory-private.h"        // for autodata_factories_, etc
+#include "hkl-axis-private.h"           // for HklAxis
+#include "hkl-pseudoaxis-common-q-private.h"  // for hkl_engine_q2_new, etc
+#include "hkl-pseudoaxis-common-hkl-private.h"  // for hkl_engine_hkl_new, etc
+
+/* #define DEBUG */
+
+/*********************/
+/* MED 2+2 HklEngine */
+/*********************/
+
+static int _reflectivity_func(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double mu = x->data[0];
+	const double gamma = x->data[2];
+
+	CHECK_NAN(x->data, x->size);
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = gamma - 2 * mu;
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction reflectivity_func = {
+	.function = _reflectivity_func,
+	.size = 4,
+};
+
+static HklMode* mu_fixed_2_2()
+{
+	static const char* axes_r[] = {"beta", "mu", "omega", "gamma", "delta"};
+	static const char* axes_w[] = {"omega", "gamma", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO("mu_fixed", axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations,
+				 TRUE);
+}
+
+static HklMode* reflectivity_2_2()
+{
+	static const char* axes_r[] = {"beta", "mu", "omega", "gamma", "delta"};
+	static const char* axes_w[] = {"mu", "omega", "gamma", "delta"};
+	static const HklFunction *functions[] = {&reflectivity_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO("reflectivity", axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations,
+				 TRUE);
+}
+
+static HklEngine *hkl_engine_soleil_sixs_med_2_2_hkl_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_hkl_new();
+
+	default_mode = mu_fixed_2_2();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_mode_set(self, default_mode);
+
+	hkl_engine_add_mode(self, reflectivity_2_2());
+
+	return self;
+}
+
+/*********************/
+/* MED 1+2 HklEngine */
+/*********************/
+
+static HklMode* pitch_fixed()
+{
+	static const char *axes_r[] = {"pitch", "mu", "gamma", "delta"};
+	static const char* axes_w[] = {"mu", "gamma", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations,
+				 TRUE);
+}
+
+static HklEngine *hkl_engine_soleil_sixs_med_1_2_hkl_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_hkl_new();
+
+	default_mode = pitch_fixed();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_mode_set(self, default_mode);
+
+	return self;
+}
+
+/*********************/
+/* MED 2+3 HklEngine */
+/*********************/
+
+typedef struct _HklSlitsFit HklSlitsFit;
+struct _HklSlitsFit
+{
+	HklGeometry *geometry;
+	HklVector surface;
+	unsigned int slits_id;
+	unsigned int len;
+	HklParameter *axis;
+};
+
+static int slits_func(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	double const *x_data = gsl_vector_const_ptr(x, 0);
+	double *f_data = gsl_vector_ptr(f, 0);
+	HklVector n_slits = {{0, 0, 1}};
+	HklSlitsFit *parameters = params;
+
+	hkl_parameter_value_set(parameters->axis, x_data[0], HKL_UNIT_DEFAULT, NULL);
+	hkl_geometry_update(parameters->geometry);
+
+	/* compute the orientation of the slits */
+	hkl_vector_rotated_quaternion(&n_slits,
+				      &darray_item(parameters->geometry->holders, 1)->q);
+
+	/* both directions must be perpendicular */
+	f_data[0] = hkl_vector_scalar_product(&parameters->surface, &n_slits);
+
+	return  GSL_SUCCESS;
+}
+
+static int fit_slits_orientation(HklSlitsFit *params)
+{
+	size_t i;
+	gsl_multiroot_fsolver_type const *T;
+	gsl_multiroot_fsolver *s;
+	gsl_multiroot_function f;
+	gsl_vector *x;
+	double *x_data;
+	int status;
+	int res = FALSE;
+	int iter;
+
+	/* now solve the system */
+	/* Initialize method  */
+	T = gsl_multiroot_fsolver_hybrid;
+	s = gsl_multiroot_fsolver_alloc (T, params->len);
+	x = gsl_vector_alloc(params->len);
+	x_data = gsl_vector_ptr(x, 0);
+
+	/* initialize x with the right values */
+	x_data[0] = params->axis->_value;
+
+	f.f = slits_func;
+	f.n = params->len;
+	f.params = params;
+	gsl_multiroot_fsolver_set (s, &f, x);
+
+	/* iterate to find the solution */
+	iter = 0;
+	do {
+		++iter;
+		status = gsl_multiroot_fsolver_iterate(s);
+		if (status || iter % 100 == 0) {
+			/* Restart from another point. */
+			for(i=0; i<params->len; ++i)
+				x_data[i] = (double)rand() / RAND_MAX * 180. / M_PI;
+			gsl_multiroot_fsolver_set(s, &f, x);
+			gsl_multiroot_fsolver_iterate(s);
+		}
+		status = gsl_multiroot_test_residual (s->f, HKL_EPSILON);
+	} while (status == GSL_CONTINUE && iter < 1000);
+
+#ifdef DEBUG
+	fprintf(stdout, "\n  fitting the detector position using thoses axes :");
+	for(i=0; i<params->len; ++i)
+		fprintf(stdout, " \"%s\"", params->axis->name);
+	fprintf(stdout, " status : %d iter : %d", status, iter);
+	fprintf(stdout, " x: [");
+	for(i=0; i<params->len; ++i)
+		fprintf(stdout, " %.7f", s->x->data[i]);
+	fprintf(stdout, "] f: [");
+	for(i=0; i<params->len; ++i)
+		fprintf(stdout, " %.7f", s->f->data[i]);
+	fprintf(stdout, "]\n");
+	hkl_geometry_fprintf(stdout, params->geometry);
+#endif
+	if(status != GSL_CONTINUE){
+		res = TRUE;
+		/* put the axes in the -pi, pi range. */
+		gsl_sf_angle_restrict_pos_e(&params->axis->_value);
+	}
+	/* release memory */
+	gsl_vector_free(x);
+	gsl_multiroot_fsolver_free(s);
+
+	return res;
+}
+
+static void hkl_geometry_list_multiply_soleil_sixs_med_2_3(HklGeometryList *self,
+							   HklGeometryListItem *item)
+{
+	unsigned int i;
+	unsigned int len;
+	HklSlitsFit params;
+	HklGeometry *geometry;
+	double slits_position;
+	HklHolder *sample_holder;
+	HklHolder *detector_holder;
+
+	/* For each solution already found we will generate another one */
+	/* we will set the right slit orientation for a given detector arm position */
+	geometry = item->geometry;
+	sample_holder = darray_item(geometry->holders, 0);
+	detector_holder = darray_item(geometry->holders, 1);
+
+	/* get the index of the axis corresponding to the slits */
+	/* for now the last holder is the detector one */
+	params.slits_id = detector_holder->config->idx[detector_holder->config->len-1];
+	params.len = 1; /* only one axis to fit */
+	params.geometry = geometry;
+	params.axis = darray_item(params.geometry->axes, params.slits_id);
+
+	/* compute the surface orientation fixed during the fit */
+	/* use the last sample axis as sample surface normal */
+	params.surface = container_of(darray_item(geometry->axes,
+						  sample_holder->config->idx[sample_holder->config->len - 1]),
+				      HklAxis, parameter)->axis_v;
+	hkl_vector_rotated_quaternion(&params.surface,
+				      &sample_holder->q);
+
+
+	/* we just need to fit the slits orientation */
+	/* save it's value before */
+	slits_position = hkl_parameter_value_get(params.axis, HKL_UNIT_DEFAULT);
+	if (fit_slits_orientation(&params) != TRUE)
+		hkl_parameter_value_set(params.axis, slits_position, HKL_UNIT_DEFAULT, NULL);
+}
+
+static HklMode* mu_fixed_2_3()
+{
+	static const char *axes_r[] = {"beta", "mu", "omega", "gamma", "delta", "eta_a"};
+	static const char* axes_w[] = {"omega", "gamma", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO("mu_fixed", axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations,
+				 TRUE);
+}
+
+static HklEngine *hkl_engine_soleil_sixs_med_2_3_hkl_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_hkl_new();
+
+	default_mode = mu_fixed_2_3();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_mode_set(self, default_mode);
+
+	return self;
+}
+
+/***********************/
+/* SOLEIL SIXS MED 2+2 */
+/***********************/
+
+#define HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_2_2_DESCRIPTION		\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 3 axes for the sample\n"					\
+	"\n"								\
+	"  + **beta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **mu** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **omega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"\n"								\
+	"+ 3 axis for the detector\n"					\
+	"\n"								\
+	"  + **beta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **gamma** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **delta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
+
+static const char* hkl_geometry_soleil_sixs_med_2_2_axes[] = {"beta", "mu", "omega", "gamma", "delta"};
+
+static HklGeometry *hkl_geometry_new_soleil_sixs_med_2_2(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "beta", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "beta", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "gamma", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "delta", 0, -1, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_soleil_sixs_med_2_2(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	hkl_engine_list_add(self, hkl_engine_soleil_sixs_med_2_2_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_q2_new());
+	hkl_engine_list_add(self, hkl_engine_qper_qpar_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(soleil_sixs_med_2_2,"SOLEIL SIXS MED2+2", HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_2_2_DESCRIPTION);
+
+/***********************/
+/* SOLEIL SIXS MED 1+2 */
+/***********************/
+
+#define HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_1_2_DESCRIPTION		\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 2 axes for the sample\n"					\
+	"\n"								\
+	"  + **pitch** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **mu** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"\n"								\
+	"+ 3 axis for the detector\n"					\
+	"\n"								\
+	"  + **pitch** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **gamma** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **delta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
+
+static const char* hkl_geometry_soleil_sixs_med_1_2_axes[] = {"pitch", "mu", "gamma", "delta"};
+
+static HklGeometry *hkl_geometry_new_soleil_sixs_med_1_2(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "pitch", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "pitch", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "gamma", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "delta", 0, -1, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_soleil_sixs_med_1_2(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	hkl_engine_list_add(self, hkl_engine_soleil_sixs_med_1_2_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_q2_new());
+	hkl_engine_list_add(self, hkl_engine_qper_qpar_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(soleil_sixs_med_1_2, "SOLEIL SIXS MED1+2", HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_1_2_DESCRIPTION);
+
+
+/***********************/
+/* SOLEIL SIXS MED 2+3 */
+/***********************/
+
+#define HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_2_3_DESCRIPTION		\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 3 axes for the sample\n"					\
+	"\n"								\
+	"  + **beta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **mu** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **omega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"\n"								\
+	"+ 4 axis for the detector\n"					\
+	"\n"								\
+	"  + **beta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **gamma** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **delta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **eta_a** : rotation around the :math:`-\\vec{x}` direction (-1, 0, 0)\n"
+
+static const char* hkl_geometry_soleil_sixs_med_2_3_axes[] = {"beta", "mu", "omega", "gamma", "delta", "eta_a"};
+
+static HklGeometry *hkl_geometry_new_soleil_sixs_med_2_3(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "beta", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "beta", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "gamma", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "delta", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "eta_a", -1, 0, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_soleil_sixs_med_2_3(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	self->geometries->multiply = hkl_geometry_list_multiply_soleil_sixs_med_2_3;
+	hkl_engine_list_add(self, hkl_engine_soleil_sixs_med_2_3_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_q2_new());
+	hkl_engine_list_add(self, hkl_engine_qper_qpar_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(soleil_sixs_med_2_3, "SOLEIL SIXS MED2+3", HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_2_3_DESCRIPTION);
diff --git a/hkl/hkl-engine-template.c b/hkl/hkl-engine-template.c
new file mode 100644
index 0000000..06d44d4
--- /dev/null
+++ b/hkl/hkl-engine-template.c
@@ -0,0 +1,224 @@
+/* COPY THIS FILE INTO hkl-engine-xxx.c and fill the XXX */
+/* This file is part of the hkl library.
+ *
+ * The hkl library is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ * Copyright (C) 2014      XXX copyright owner XXX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ *          XXXX <xxx at xxx>
+ */
+#include <gsl/gsl_sys.h>                // for gsl_isnan
+#include "hkl-factory-private.h"        // for autodata_factories_, etc
+#include "hkl-pseudoaxis-common-q-private.h"  // for hkl_engine_q2_new, etc
+#include "hkl-pseudoaxis-common-hkl-private.h"  // for hkl_mode_operations, etc
+#include "hkl-pseudoaxis-common-psi-private.h"  // for hkl_engine_psi_new, etc
+
+/**************/
+/* Axes names */
+/**************/
+
+#define MU "mu"
+#define OMEGA "omega"
+#define CHI "chi"
+#define PHI "phi"
+#define GAMMA "gamma"
+#define DELTA "delta"
+
+/************/
+/* Geometry */
+/************/
+
+#define HKL_GEOMETRY_EULERIAN6C_DESCRIPTION				\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 4 axes for the sample\n"					\
+	"\n"								\
+	"  + **"MU"** : rotating around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **"OMEGA"** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **"CHI"** : rotating around the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"  + **"PHI"** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"\n"								\
+	"+ 2 axes for the detector\n"					\
+	"\n"								\
+	"  + **"GAMMA"** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **"DELTA"** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
+
+static const char* hkl_geometry_eulerian6C_axes[] = {MU, OMEGA, CHI, PHI, GAMMA, DELTA};
+
+static HklGeometry *hkl_geometry_new_eulerian6C(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, MU, 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, OMEGA, 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, CHI, 1, 0, 0);
+	hkl_holder_add_rotation_axis(h, PHI, 0, -1, 0);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, GAMMA, 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, DELTA, 0, -1, 0);
+
+	return self;
+}
+
+/*********/
+/* Modes */
+/*********/
+
+/* exemple of a lowlevel gsl function use to compute an hkl bissector
+ * vertical mode for an E6C diffractometer */
+static int _bissector_vertical_func(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double omega = x->data[0];
+	const double tth = x->data[3];
+
+	/* this method check that all the x values are valid. Sometime
+	 * the computation produce NAN values. In that case
+	 * computation is skipped */
+	CHECK_NAN(x->data, x->size);
+
+	/* do the hkl computation which fill the f[0..2] values */
+	RUBh_minus_Q(x->data, params, f->data);
+
+	/* here a mode specific equation requiered due to the number
+	 * of axes to fit (4 in this case) */
+	f->data[3] = tth - 2 * fmod(omega,M_PI);
+
+	return  GSL_SUCCESS;
+}
+
+/* Declare the number of axes expected by the gsl low level
+ * function. So during the HklMode configuration there is a runtime
+ * check which ensure that the right number of axes are given to the
+ * HklMode. */
+static const HklFunction bissector_vertical_func = {
+	.function = _bissector_vertical_func,
+	.size = 4,
+};
+
+/* exemple of a mode with 4 axes. In that case you need the previously
+ * defined function */
+static HklMode *bissector_vertical(void)
+{
+	/* axes_r is the axes list requiered to compute the pseudo axes values */
+	static const char* axes_r[] = {MU, OMEGA, CHI, PHI, GAMMA, DELTA};
+
+	/* axes_w is the axes list use when you write the pseudo axes
+	 * values. You move only thoses axes when you use this
+	 * mode. */
+	static const char* axes_w[] = {OMEGA, CHI, PHI, DELTA};
+
+	/* here a list of functions use to solve the mode */
+	static const HklFunction *functions[] = {&bissector_vertical_func};
+
+	/* here just the description of the mode: name, axes_r, axes_w, functions */
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	/* instantiate a new mode */
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+/* here an exemple of a three axes hkl mode, a convenience function is
+ * provided to do the computation (RUBh_minus_Q_func). This funtion
+ * takes only three axes. So writing a generic hkl mode with only
+ * three axes is really simple */
+static HklMode *constant_omega_vertical(void)
+{
+	static const char* axes_r[] = {MU, OMEGA, CHI, PHI, GAMMA, DELTA};
+	static const char* axes_w[] = {CHI, PHI, DELTA};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations,
+				 TRUE);
+}
+
+static HklMode* psi_vertical()
+{
+	static const char *axes_r[] = {MU, OMEGA, CHI, PHI, GAMMA, DELTA};
+	static const char *axes_w[] = {OMEGA, CHI, PHI, DELTA};
+	static const HklFunction *functions[] = {&psi_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO_WITH_PARAMS(__func__, axes_r, axes_w,
+					       functions, psi_parameters),
+	};
+
+	return hkl_mode_psi_new(&info);
+}
+
+/***********/
+/* Engines */
+/***********/
+
+static HklEngine *hkl_engine_e6c_hkl_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_hkl_new();
+
+	default_mode = bissector_vertical();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_mode_set(self, default_mode);
+
+	hkl_engine_add_mode(self, constant_omega_vertical());
+
+	return self;
+}
+
+static HklEngine *hkl_engine_e6c_psi_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_psi_new();
+
+	default_mode = psi_vertical();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_mode_set(self, default_mode);
+
+	return self;
+}
+
+/***************/
+/* Engine list */
+/***************/
+
+static HklEngineList *hkl_engine_list_new_eulerian6C(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	hkl_engine_list_add(self, hkl_engine_e6c_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_e6c_psi_new());
+	hkl_engine_list_add(self, hkl_engine_q2_new());
+	hkl_engine_list_add(self, hkl_engine_qper_qpar_new());
+
+	return self;
+}
+
+/* Register the diffractometer into the factory */
+REGISTER_DIFFRACTOMETER(eulerian6C, "E6C", HKL_GEOMETRY_EULERIAN6C_DESCRIPTION);
+
diff --git a/hkl/hkl-engine-zaxis.c b/hkl/hkl-engine-zaxis.c
new file mode 100644
index 0000000..513451c
--- /dev/null
+++ b/hkl/hkl-engine-zaxis.c
@@ -0,0 +1,145 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include <gsl/gsl_sys.h>                // for gsl_isnan
+#include "hkl-factory-private.h"        // for autodata_factories_, etc
+#include "hkl-pseudoaxis-common-q-private.h"  // for hkl_engine_q2_new, etc
+#include "hkl-pseudoaxis-common-hkl-private.h"  // for RUBh_minus_Q, etc
+
+/* #define DEBUG */
+
+static HklMode* _zaxis()
+{
+	static const char *axes_r[] = {"mu", "omega", "delta", "gamma"};
+	static const char *axes_w[] = {"omega", "delta", "gamma"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO("zaxis", axes_r, axes_w, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations,
+				 TRUE);
+}
+
+/* reflectivity */
+
+static int _reflectivity_func(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double mu = x->data[0];
+	const double gamma = x->data[3];
+
+	CHECK_NAN(x->data, x->size);
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = mu - gamma;
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction reflectivity_func = {
+	.function = _reflectivity_func,
+	.size = 4,
+};
+
+static HklMode* reflectivity()
+{
+	static const char* axes[] = {"mu", "omega", "delta", "gamma"};
+	static const HklFunction *functions[] = {&reflectivity_func};
+	static const HklModeAutoInfo info = {
+		HKL_MODE_AUTO_INFO(__func__, axes, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations,
+				 TRUE);
+}
+
+/**********************/
+/* pseudo axis engine */
+/**********************/
+
+static HklEngine *hkl_engine_zaxis_hkl_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_hkl_new();
+
+	default_mode = _zaxis();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_mode_set(self, default_mode);
+
+	hkl_engine_add_mode(self, reflectivity());
+
+	return self;
+}
+
+/*********/
+/* ZAXIS */
+/*********/
+
+#define HKL_GEOMETRY_TYPE_ZAXIS_DESCRIPTION				\
+	"For this geometry the **mu** axis is common to the sample and the detector.\n" \
+	"\n"								\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 2 axes for the sample\n"					\
+	"\n"								\
+	"  + **mu** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **omega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"\n"								\
+	"+ 3 axis for the detector\n"					\
+	"\n"								\
+	"  + **mu** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **delta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **gamma** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n"
+
+static const char* hkl_geometry_zaxis_axes[] = {"mu", "omega", "delta", "gamma"};
+
+static HklGeometry *hkl_geometry_new_zaxis(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "delta", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "gamma", 0, 0, 1);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_zaxis(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	hkl_engine_list_add(self, hkl_engine_zaxis_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_q2_new());
+	hkl_engine_list_add(self, hkl_engine_qper_qpar_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(zaxis, "ZAXIS", HKL_GEOMETRY_TYPE_ZAXIS_DESCRIPTION);
diff --git a/hkl/hkl-error-private.h b/hkl/hkl-error-private.h
deleted file mode 100644
index bf668f2..0000000
--- a/hkl/hkl-error-private.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* gerror.h - Error reporting system
- *
- *  Copyright 2000 Red Hat, Inc.
- *
- * The Gnome Library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * The Gnome Library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with the Gnome Library; see the file COPYING.LIB.  If not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- *   Boston, MA 02111-1307, USA.
- */
-
-/*
- * modified by Picca Frédéric-emmanuel <picca at synchrotron-soleil.fr>
- * for the hkl project
- */
-#ifndef __HKL_ERROR_PRIVATE_H__
-#define __HKL_ERROR_PRIVATE_H__
-
-#include <stdarg.h>
-
-#include "hkl.h"
-#include "hkl-macros-private.h"
-
-HKL_BEGIN_DECLS
-
-struct _HklError /*<skip>*/
-{
-	char *message;
-};
-
-HklError* hkl_error_new (const char *format, ...) G_GNUC_PRINTF (1, 2);
-
-HklError* hkl_error_new_literal (const char *message);
-HklError* hkl_error_new_valist (const char *format, va_list args);
-
-void hkl_error_free (HklError *error);
-
-HklError* hkl_error_new_copy (const HklError *error);
-
-/* if (err) *err = hkl_error_new(domain, code, format, ...), also has
- * some sanity checks.
- */
-void hkl_error_set (HklError **err, const char *format, ...) G_GNUC_PRINTF (2, 3);
-
-void hkl_error_set_literal (HklError **err, const char *message);
-
-/* if (dest) *dest = src; also has some sanity checks.
- */
-void hkl_error_propagate (HklError **dest, HklError *src);
-
-/* if (err && *err) { hkl_error_free(*err); *err = NULL; } */
-void hkl_error_clear (HklError **err);
-
-/* if (err) prefix the formatted string to the ->message */
-void hkl_error_prefix (HklError **err, const char *format, ...) G_GNUC_PRINTF (2, 3);
-
-/* hkl_propagate_error then hkl_error_prefix on dest */
-void hkl_error_propagate_prefixed (HklError **dest, HklError *src,
-				   const char *format, ...) G_GNUC_PRINTF (3, 4);
-
-HKL_END_DECLS
-
-#endif /* __HKL_ERROR_H__ */
diff --git a/hkl/hkl-error.c b/hkl/hkl-error.c
deleted file mode 100644
index d72b801..0000000
--- a/hkl/hkl-error.c
+++ /dev/null
@@ -1,332 +0,0 @@
-/* GLIB - Library of useful routines for C programming
- * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/*
- * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
- * file for a list of people on the GLib Team.  See the ChangeLog
- * files for a list of changes.  These files are distributed with
- * GLib at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#define _GNU_SOURCE /* need for vasprintf */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "hkl-error-private.h"
-
-/**
- * hkl_error_new_valist: (skip)
- * @format: printf()-style format for error message
- * @args: #va_list of parameters for the message format
- *
- * Creates a new #HklError with the given message
- * formatted with @format.
- *
- * Returns: a new #HklError
- *
- * Since: 2.22
- */
-HklError* hkl_error_new_valist (const char *format, va_list args)
-{
-	HklError *error;
-
-	error = HKL_MALLOC(HklError);
-
-	vasprintf (&error->message, format, args);
-
-	return error;
-}
-
-/**
- * hkl_error_new: (skip)
- * @format: printf()-style format for error message
- * @Varargs: parameters for message format
- *
- * Creates a new #HklError with the given,
- * and a message formatted with @format.
- *
- * Return value: a new #HklError
- */
-HklError* hkl_error_new (const char *format, ...)
-{
-	HklError* error;
-	va_list args;
-
-	if (!format)
-		return NULL;
-
-	va_start (args, format);
-	error = hkl_error_new_valist (format, args);
-	va_end (args);
-
-	return error;
-}
-
-/**
- * hkl_error_new_literal: (skip)
- * @message: error message
- *
- * Creates a new #HklError; unlike hkl_error_new(), @message is not a
- * printf()-style format string. Use this function if @message
- * contains text you don't have control over, that could include
- * printf() escape sequences.
- *
- * Return value: a new #HklError
- **/
-HklError* hkl_error_new_literal (const char *message)
-{
-	HklError* err;
-
-	if(!message)
-		return NULL;
-
-	err = HKL_MALLOC (HklError);
-
-	err->message = strdup (message);
-
-	return err;
-}
-
-/**
- * hkl_error_free: (skip)
- * @error: a #HklError
- *
- * Frees a #HklError and associated resources.
- */
-void hkl_error_free (HklError *error)
-{
-	if (!error)
-		return;
-
-	free (error->message);
-	free (error);
-}
-
-/**
- * hkl_error_new_copy: (skip)
- * @error: a #HklError
- *
- * Makes a copy of @error.
- *
- * Return value: a new #HklError
- */
-HklError* hkl_error_new_copy (const HklError *error)
-{
-	HklError *copy;
-
-	if(!error)
-		return NULL;
-
-
-	copy = HKL_MALLOC (HklError);
-
-	*copy = *error;
-
-	copy->message = strdup (error->message);
-
-	return copy;
-}
-
-#define ERROR_OVERWRITTEN_WARNING "HklError set over the top of a previous HklError or uninitialized memory.\n" \
-	"This indicates a bug in someone's code. You must ensure an error is NULL before it's set.\n" \
-	"The overwriting error message was: %s"
-
-/**
- * hkl_error_set: (skip)
- * @err: a return location for a #HklError, or %NULL
- * @format: printf()-style format
- * @Varargs: args for @format
- *
- * Does nothing if @err is %NULL; if @err is non-%NULL, then *@err
- * must be %NULL. A new #HklError is created and assigned to *@err.
- */
-void hkl_error_set (HklError **err, const char  *format, ...)
-{
-	HklError *new;
-	va_list args;
-
-	if (err == NULL)
-		return;
-
-	va_start (args, format);
-	new = hkl_error_new_valist (format, args);
-	va_end (args);
-
-	if (*err == NULL)
-		*err = new;
-	else
-		fprintf (stderr, ERROR_OVERWRITTEN_WARNING, new->message);
-}
-
-/**
- * hkl_error_set_literal: (skip)
- * @err: a return location for a #HklError, or %NULL
- * @message: error message
- *
- * Does nothing if @err is %NULL; if @err is non-%NULL, then *@err
- * must be %NULL. A new #HklError is created and assigned to *@err.
- * Unlike hkl_set_error(), @message is not a printf()-style format
- * string.  Use this function if @message contains text you don't have
- * control over, that could include printf() escape sequences.
- *
- * Since: 2.18
- */
-void hkl_error_set_literal (HklError **err, const char *message)
-{
-	HklError *new;
-
-	if (err == NULL)
-		return;
-
-	new = hkl_error_new_literal (message);
-	if (*err == NULL)
-		*err = new;
-	else
-		fprintf (stderr, ERROR_OVERWRITTEN_WARNING, new->message);
-}
-
-/**
- * hkl_error_propagate: (skip)
- * @dest: error return location
- * @src: error to move into the return location
- *
- * If @dest is %NULL, free @src; otherwise, moves @src into *@dest.
- * The error variable @dest points to must be %NULL.
- */
-void hkl_error_propagate (HklError **dest, HklError  *src)
-{
-	if(!src)
-		return;
-
-	if (dest == NULL){
-		if (src)
-			hkl_error_free (src);
-		return;
-	}else{
-		if (*dest != NULL)
-			fprintf (stderr, ERROR_OVERWRITTEN_WARNING, src->message);
-		else
-			*dest = src;
-	}
-}
-
-/**
- * hkl_error_clear: (skip)
- * @err: a #HklError return location
- *
- * If @err is %NULL, does nothing. If @err is non-%NULL, calls
- * hkl_error_free() on *@err and sets *@err to %NULL.
- */
-void hkl_error_clear (HklError **err)
-{
-	if (err && *err){
-		hkl_error_free (*err);
-		*err = NULL;
-	}
-}
-
-static void hkl_error_add_prefix (char **string, const char *format, va_list ap)
-{
-	char *oldstring;
-	char *prefix;
-	size_t len;
-	size_t len_prefix;
-	size_t len_oldstring;
-
-	len_prefix = vasprintf (&prefix, format, ap);
-	oldstring = *string;
-	len_oldstring = strlen(*string);
-
-	len = len_prefix + len_oldstring;
-	*string = malloc (len *sizeof (char) + 1);
-#if _MSC_VER
-	strncpy_s (*string, len_prefix + 1, prefix, len_prefix);
-	strncat_s (*string, len + 1, oldstring, len_oldstring);
-#else
-	*string = strncpy (*string, prefix, len_prefix + 1);
-	*string = strncat (*string, oldstring, len_oldstring);
-#endif
-	free (oldstring);
-	free (prefix);
-}
-
-/**
- * hkl_error_prefix: (skip)
- * @err: a return location for a #HklError, or %NULL
- * @format: printf()-style format string
- * @...: arguments to @format
- *
- * Formats a string according to @format and prefix it to an existing
- * error message.  If @err is %NULL (ie: no error variable) then do
- * nothing.
- *
- * If *@err is %NULL (ie: an error variable is present but there is no
- * error condition) then also do nothing.  Whether or not it makes
- * sense to take advantage of this feature is up to you.
- *
- * Since: 2.16
- */
-void hkl_error_prefix (HklError **err, const char *format, ...)
-{
-	if (err && *err){
-		va_list ap;
-
-		va_start (ap, format);
-		hkl_error_add_prefix (&(*err)->message, format, ap);
-		va_end (ap);
-	}
-}
-
-/**
- * hkl_error_propagate_prefixed: (skip)
- * @dest: error return location
- * @src: error to move into the return location
- * @format: printf()-style format string
- * @...: arguments to @format
- *
- * If @dest is %NULL, free @src; otherwise, moves @src into
- * *@dest. *@dest must be %NULL.  After the move, add a prefix as with
- * hkl_prefix_error().
- *
- * Since: 2.16
- **/
-void hkl_error_propagate_prefixed (HklError **dest, HklError *src, const char *format, ...)
-{
-	hkl_error_propagate (dest, src);
-
-	if (dest && *dest){
-		va_list ap;
-
-		va_start (ap, format);
-		hkl_error_add_prefix (&(*dest)->message, format, ap);
-		va_end (ap);
-	}
-}
-
-/**
- * hkl_error_message_get:
- * @self: the this ptr
- *
- * Returns: the message of the HklError
- **/
-const char *hkl_error_message_get(const HklError *self)
-{
-	return self->message;
-}
diff --git a/hkl/hkl-factory-private.h b/hkl/hkl-factory-private.h
index 1dc61ea..d6be5b7 100644
--- a/hkl/hkl-factory-private.h
+++ b/hkl/hkl-factory-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -25,10 +25,32 @@
 #include "hkl.h"
 #include "hkl/ccan/autodata/autodata.h"
 
-HKL_BEGIN_DECLS
+G_BEGIN_DECLS
+
+typedef HklGeometry* (* HklFactoryGeometryFunction) (const HklFactory *factory);
+typedef HklEngineList* (* HklFactoryEngineListFunction) (const HklFactory *factory);
+
+struct _HklFactory
+{
+	const char *name;
+	const char *description;
+	const darray_string axes;
+	HklFactoryGeometryFunction create_new_geometry;
+	HklFactoryEngineListFunction create_new_engine_list;
+};
+
+#define REGISTER_DIFFRACTOMETER(name_, real_name_, description_)	\
+	static HklFactory name_ = {					\
+		.name = real_name_,					\
+		.description = description_,				\
+		.axes = DARRAY(hkl_geometry_ ## name_ ## _axes),	\
+		.create_new_geometry = &hkl_geometry_new_ ## name_,	\
+		.create_new_engine_list = &hkl_engine_list_new_ ## name_ \
+	};								\
+	AUTODATA(factories, &name_)
 
 AUTODATA_TYPE(factories, HklFactory);
 
-HKL_END_DECLS
+G_END_DECLS
 
 #endif /* __HKL_FACTORY_H__ */
diff --git a/hkl/hkl-factory.c b/hkl/hkl-factory.c
index 905fdb3..542f698 100644
--- a/hkl/hkl-factory.c
+++ b/hkl/hkl-factory.c
@@ -13,50 +13,22 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
+#include "hkl-factory-private.h"        // for autodata_factories_, etc
 
-#include <stdarg.h>
-#include <gsl/gsl_sf.h>
-
-#include "hkl.h"
-#include "hkl-axis-private.h"
-#include "hkl-factory-private.h"
-#include "hkl-pseudoaxis-private.h"
-#include "hkl-pseudoaxis-common-eulerians-private.h"
-#include "hkl-pseudoaxis-common-q-private.h"
-#include "hkl-pseudoaxis-e4c-private.h"
-#include "hkl-pseudoaxis-k4cv-private.h"
-#include "hkl-pseudoaxis-e6c-private.h"
-#include "hkl-pseudoaxis-k6c-private.h"
-#include "hkl-pseudoaxis-zaxis-private.h"
-#include "hkl-pseudoaxis-soleil-sixs-med-private.h"
-#include "hkl-pseudoaxis-petra3-private.h"
-
-
-typedef HklGeometry* (* HklFactoryGeometryFunction) (const HklFactory *factory);
-typedef HklEngineList* (* HklFactoryEngineListFunction) (const HklFactory *factory);
-
-struct _HklFactory
-{
-	const char *name;
-	const char *description;
-	HklFactoryGeometryFunction create_new_geometry;
-	HklFactoryEngineListFunction create_new_engine_list;
-};
-
-HklFactory **hkl_factory_get_all(unsigned int *n)
+HklFactory **hkl_factory_get_all(size_t *n)
 {
 	return autodata_get(factories, n);
 }
 
-HklFactory *hkl_factory_get_by_name(const char *name)
+HklFactory *hkl_factory_get_by_name(const char *name, GError **error)
 {
-	unsigned int i, n;
+	size_t i, n;
 	HklFactory **factories;
 
 	factories = autodata_get(factories, &n);
@@ -67,7 +39,7 @@ HklFactory *hkl_factory_get_by_name(const char *name)
 	return NULL;
 }
 
-const char *hkl_factory_name(const HklFactory *self)
+const char *hkl_factory_name_get(const HklFactory *self)
 {
 	return self->name;
 }
@@ -81,657 +53,3 @@ HklEngineList *hkl_factory_create_new_engine_list(const HklFactory *self)
 {
 	return self->create_new_engine_list(self);
 }
-
-#define REGISTER_DIFFRACTOMETER(name_, real_name_, description_)	\
-	static HklFactory name_ = {.name = real_name_,			\
-				   .description = description_,		\
-				   .create_new_geometry = &hkl_geometry_new_ ## name_, \
-				   .create_new_engine_list = &hkl_engine_list_new_ ## name_ \
-	};								\
-	AUTODATA(factories, &name_)
-
-static void kappa_2_kappap(double komega, double kappa, double kphi, double alpha,
-			   double *komegap, double *kappap, double *kphip)
-{
-	double p;
-	double omega;
-	double phi;
-
-	p = atan(tan(kappa/2.) * cos(alpha));
-	omega = komega + p - M_PI_2;
-	phi = kphi + p + M_PI_2;
-
-	*komegap = gsl_sf_angle_restrict_symm(2*omega - komega);
-	*kappap = -kappa;
-	*kphip = gsl_sf_angle_restrict_symm(2*phi - kphi);
-
-}
-
-static void hkl_geometry_list_multiply_k4c_real(HklGeometryList *self,
-						HklGeometryListItem *item)
-{
-	HklGeometry *geometry;
-	HklGeometry *copy;
-	double komega, komegap;
-	double kappa, kappap;
-	double kphi, kphip;
-
-	geometry = item->geometry;
-	komega = hkl_parameter_value_get(darray_item(geometry->axes, 0));
-	kappa = hkl_parameter_value_get(darray_item(geometry->axes, 1));
-	kphi = hkl_parameter_value_get(darray_item(geometry->axes, 2));
-
-	kappa_2_kappap(komega, kappa, kphi, 50 * HKL_DEGTORAD, &komegap, &kappap, &kphip);
-
-	copy = hkl_geometry_new_copy(geometry);
-	/* TODO parameter list for the geometry */
-	hkl_parameter_value_set(darray_item(copy->axes, 0), komegap, NULL);
-	hkl_parameter_value_set(darray_item(copy->axes, 1), kappap, NULL);
-	hkl_parameter_value_set(darray_item(copy->axes, 2), kphip, NULL);
-
-	hkl_geometry_update(copy);
-	hkl_geometry_list_add(self, copy);
-	hkl_geometry_free(copy);
-}
-
-static void hkl_geometry_list_multiply_k6c_real(HklGeometryList *self,
-						HklGeometryListItem *item)
-{
-	HklGeometry *geometry;
-	HklGeometry *copy;
-	double komega, komegap;
-	double kappa, kappap;
-	double kphi, kphip;
-
-	geometry = item->geometry;
-	komega = hkl_parameter_value_get(darray_item(geometry->axes, 1));
-	kappa = hkl_parameter_value_get(darray_item(geometry->axes, 2));
-	kphi = hkl_parameter_value_get(darray_item(geometry->axes, 3));
-
-	kappa_2_kappap(komega, kappa, kphi, 50 * HKL_DEGTORAD, &komegap, &kappap, &kphip);
-
-	copy = hkl_geometry_new_copy(geometry);
-	/* TODO parameter list for the geometry */
-	hkl_parameter_value_set(darray_item(copy->axes, 1), komegap, NULL);
-	hkl_parameter_value_set(darray_item(copy->axes, 2), kappap, NULL);
-	hkl_parameter_value_set(darray_item(copy->axes, 3), kphip, NULL);
-
-	hkl_geometry_update(copy);
-	hkl_geometry_list_add(self, copy);
-	hkl_geometry_free(copy);
-}
-
-
-/********/
-/* TwoC */
-/********/
-
-#define HKL_GEOMETRY_TWOC_DESCRIPTION					\
-	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
-	"+ 1 axes for the sample\n"					\
-	"\n"								\
-	"  + **omega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"\n"								\
-	"+ 1 axis for the detector\n"					\
-	"\n"								\
-	"  + **tth** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
-
-static HklGeometry *hkl_geometry_new_twoC(const HklFactory *factory)
-{
-	HklGeometry *self = hkl_geometry_new(factory);
-	HklHolder *h;
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "tth", 0, -1, 0);
-
-	return self;
-}
-
-static HklEngineList *hkl_engine_list_new_twoC(const HklFactory *factory)
-{
-	HklEngineList *self = hkl_engine_list_new();
-
-	return self;
-}
-
-REGISTER_DIFFRACTOMETER(twoC, "TwoC", HKL_GEOMETRY_TWOC_DESCRIPTION);
-
-/********/
-/* E4CV */
-/********/
-#define HKL_GEOMETRY_EULERIAN4C_VERTICAL_DESCRIPTION					\
-	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
-	"+ 3 axes for the sample\n"					\
-	"\n"								\
-	"  + **omega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"  + **chi** : rotating around the :math:`\\vec{x}` direction (1, 0, 0)\n"	\
-	"  + **phi** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"\n"								\
-	"+ 1 axis for the detector\n"					\
-	"\n"								\
-	"  + **tth** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
-
-static HklGeometry *hkl_geometry_new_eulerian4C_vertical(const HklFactory *factory)
-{
-	HklGeometry *self = hkl_geometry_new(factory);
-	HklHolder *h;
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
-	hkl_holder_add_rotation_axis(h, "chi", 1, 0, 0);
-	hkl_holder_add_rotation_axis(h, "phi", 0, -1, 0);
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "tth", 0, -1, 0);
-
-	return self;
-}
-
-static HklEngineList *hkl_engine_list_new_eulerian4C_vertical(const HklFactory *factory)
-{
-	HklEngineList *self = hkl_engine_list_new();
-
-	hkl_engine_list_add(self, hkl_engine_e4c_hkl_new());
-	hkl_engine_list_add(self, hkl_engine_e4c_psi_new());
-	hkl_engine_list_add(self, hkl_engine_q_new());
-
-	return self;
-}
-
-REGISTER_DIFFRACTOMETER(eulerian4C_vertical, "E4CV", HKL_GEOMETRY_EULERIAN4C_VERTICAL_DESCRIPTION);
-
-/********/
-/* K4CV */
-/********/
-
-#define HKL_GEOMETRY_KAPPA4C_VERTICAL_DESCRIPTION			\
-	"For this geometry there is a special parameters called :math:`\\alpha` which is the\n" \
-	"angle between the kappa rotation axis and the  :math:`\\vec{y}` direction.\n" \
-	"\n"								\
-	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
-	"+ 3 axes for the sample\n"					\
-	"\n"								\
-	"  + **komega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"  + **kappa** : rotating around the :math:`\\vec{x}` direction (0, :math:`-\\cos\\alpha`, :math:`-\\sin\\alpha`)\n"	\
-	"  + **kphi** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"\n"								\
-	"+ 1 axis for the detector\n"					\
-	"\n"								\
-	"  + **tth** : rotation around the :math:`-\\\vec{y}` direction (0, -1, 0)\n"
-
-static HklGeometry *hkl_geometry_new_kappa4C_vertical(const HklFactory *factory)
-{
-	HklGeometry *self = hkl_geometry_new(factory);
-	double alpha = 50 * HKL_DEGTORAD;
-	HklHolder *h;
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "komega", 0, -1, 0);
-	hkl_holder_add_rotation_axis(h, "kappa", 0, -cos(alpha), -sin(alpha));
-	hkl_holder_add_rotation_axis(h, "kphi", 0, -1, 0);
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "tth", 0, -1, 0);
-
-	return self;
-}
-
-static HklEngineList *hkl_engine_list_new_kappa4C_vertical(const HklFactory *factory)
-{
-	HklEngineList *self = hkl_engine_list_new();
-
-	self->geometries->multiply = hkl_geometry_list_multiply_k4c_real;
-	hkl_engine_list_add(self, hkl_engine_k4cv_hkl_new());
-	hkl_engine_list_add(self, hkl_engine_eulerians_new());
-	hkl_engine_list_add(self, hkl_engine_k4cv_psi_new());
-	hkl_engine_list_add(self, hkl_engine_q_new());
-
-	return self;
-}
-
-REGISTER_DIFFRACTOMETER(kappa4C_vertical, "K4CV", HKL_GEOMETRY_KAPPA4C_VERTICAL_DESCRIPTION);
-
-/*******/
-/* E6C */
-/*******/
-
-#define HKL_GEOMETRY_EULERIAN6C_DESCRIPTION				\
-	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
-	"+ 4 axes for the sample\n"					\
-	"\n"								\
-	"  + **mu** : rotating around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
-	"  + **omega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"  + **chi** : rotating around the :math:`\\vec{x}` direction (1, 0, 0)\n" \
-	"  + **phi** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"\n"								\
-	"+ 2 axes for the detector\n"					\
-	"\n"								\
-	"  + **gamma** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
-	"  + **delta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
-
-static HklGeometry *hkl_geometry_new_eulerian6C(const HklFactory *factory)
-{
-	HklGeometry *self = hkl_geometry_new(factory);
-	HklHolder *h;
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
-	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
-	hkl_holder_add_rotation_axis(h, "chi", 1, 0, 0);
-	hkl_holder_add_rotation_axis(h, "phi", 0, -1, 0);
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "gamma", 0, 0, 1);
-	hkl_holder_add_rotation_axis(h, "delta", 0, -1, 0);
-
-	return self;
-}
-
-static HklEngineList *hkl_engine_list_new_eulerian6C(const HklFactory *factory)
-{
-	HklEngineList *self = hkl_engine_list_new();
-
-	hkl_engine_list_add(self, hkl_engine_e6c_hkl_new());
-	hkl_engine_list_add(self, hkl_engine_e6c_psi_new());
-	hkl_engine_list_add(self, hkl_engine_q2_new());
-	hkl_engine_list_add(self, hkl_engine_qper_qpar_new());
-
-	return self;
-}
-
-REGISTER_DIFFRACTOMETER(eulerian6C, "E6C", HKL_GEOMETRY_EULERIAN6C_DESCRIPTION);
-
-/*******/
-/* K6C */
-/*******/
-
-#define HKL_GEOMETRY_KAPPA6C_DESCRIPTION				\
-	"For this geometry there is a special parameters called :math:`\\alpha` which is the\n" \
-	"angle between the kappa rotation axis and the  :math:`\\vec{y}` direction.\n" \
-	"\n"								\
-	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
-	"+ 4 axes for the sample\n"					\
-	"\n"								\
-	"  + **mu** : rotating around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
-	"  + **komega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"  + **kappa** : rotating around the :math:`\\vec{x}` direction (0, :math:`-\\cos\\alpha`, :math:`-\\sin\\alpha`)\n" \
-	"  + **kphi** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"\n"								\
-	"+ 2 axes for the detector\n"					\
-	"\n"								\
-	"  + **gamma** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
-	"  + **delta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
-
-static HklGeometry *hkl_geometry_new_kappa6C(const HklFactory *factory)
-{
-	HklGeometry *self = hkl_geometry_new(factory);
-	double alpha = 50 * HKL_DEGTORAD;
-	HklHolder *h;
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
-	hkl_holder_add_rotation_axis(h, "komega", 0, -1, 0);
-	hkl_holder_add_rotation_axis(h, "kappa", 0, -cos(alpha), -sin(alpha));
-	hkl_holder_add_rotation_axis(h, "kphi", 0, -1, 0);
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "gamma", 0, 0, 1);
-	hkl_holder_add_rotation_axis(h, "delta", 0, -1, 0);
-
-	return self;
-}
-
-static HklEngineList *hkl_engine_list_new_kappa6C(const HklFactory *factory)
-{
-	HklEngineList *self = hkl_engine_list_new();
-
-	self->geometries->multiply = hkl_geometry_list_multiply_k6c_real;
-	hkl_engine_list_add(self, hkl_engine_k6c_hkl_new());
-	hkl_engine_list_add(self, hkl_engine_eulerians_new());
-	hkl_engine_list_add(self, hkl_engine_k6c_psi_new());
-	hkl_engine_list_add(self, hkl_engine_q2_new());
-	hkl_engine_list_add(self, hkl_engine_qper_qpar_new());
-
-	return self;
-}
-
-REGISTER_DIFFRACTOMETER(kappa6C, "K6C", HKL_GEOMETRY_KAPPA6C_DESCRIPTION);
-
-/*********/
-/* ZAXIS */
-/*********/
-
-#define HKL_GEOMETRY_TYPE_ZAXIS_DESCRIPTION				\
-	"For this geometry the **mu** axis is common to the sample and the detector.\n" \
-	"\n"								\
-	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
-	"+ 2 axes for the sample\n"					\
-	"\n"								\
-	"  + **mu** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
-	"  + **omega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"\n"								\
-	"+ 3 axis for the detector\n"					\
-	"\n"								\
-	"  + **mu** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
-	"  + **delta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"  + **gamma** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n"
-
-static HklGeometry *hkl_geometry_new_zaxis(const HklFactory *factory)
-{
-	HklGeometry *self = hkl_geometry_new(factory);
-	HklHolder *h;
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
-	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
-	hkl_holder_add_rotation_axis(h, "delta", 0, -1, 0);
-	hkl_holder_add_rotation_axis(h, "gamma", 0, 0, 1);
-
-	return self;
-}
-
-static HklEngineList *hkl_engine_list_new_zaxis(const HklFactory *factory)
-{
-	HklEngineList *self = hkl_engine_list_new();
-
-	hkl_engine_list_add(self, hkl_engine_zaxis_hkl_new());
-	hkl_engine_list_add(self, hkl_engine_q2_new());
-	hkl_engine_list_add(self, hkl_engine_qper_qpar_new());
-
-	return self;
-}
-
-REGISTER_DIFFRACTOMETER(zaxis, "ZAXIS", HKL_GEOMETRY_TYPE_ZAXIS_DESCRIPTION);
-
-/***********************/
-/* SOLEIL SIXS MED 2+2 */
-/***********************/
-
-#define HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_2_2_DESCRIPTION		\
-	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
-	"+ 3 axes for the sample\n"					\
-	"\n"								\
-	"  + **beta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"  + **mu** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
-	"  + **omega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"\n"								\
-	"+ 3 axis for the detector\n"					\
-	"\n"								\
-	"  + **beta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"  + **gamma** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
-	"  + **delta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
-
-static HklGeometry *hkl_geometry_new_soleil_sixs_med_2_2(const HklFactory *factory)
-{
-	HklGeometry *self = hkl_geometry_new(factory);
-	HklHolder *h;
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "beta", 0, -1, 0);
-	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
-	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "beta", 0, -1, 0);
-	hkl_holder_add_rotation_axis(h, "gamma", 0, 0, 1);
-	hkl_holder_add_rotation_axis(h, "delta", 0, -1, 0);
-
-	return self;
-}
-
-static HklEngineList *hkl_engine_list_new_soleil_sixs_med_2_2(const HklFactory *factory)
-{
-	HklEngineList *self = hkl_engine_list_new();
-
-	hkl_engine_list_add(self, hkl_engine_soleil_sixs_med_2_2_hkl_new());
-	hkl_engine_list_add(self, hkl_engine_q2_new());
-	hkl_engine_list_add(self, hkl_engine_qper_qpar_new());
-
-	return self;
-}
-
-REGISTER_DIFFRACTOMETER(soleil_sixs_med_2_2,"SOLEIL SIXS MED2+2", HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_2_2_DESCRIPTION);
-
-/***************/
-/* SOLEIL MARS */
-/***************/
-
-#define HKL_GEOMETRY_TYPE_SOLEIL_MARS_DESCRIPTION			\
-	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
-	"+ 3 axes for the sample\n"					\
-	"\n"								\
-	"  + **omega** : rotating around the :math:`\\vec{z}` direction (0, -1, 0)\n" \
-	"  + **chi** : rotating around the :math:`\\vec{x}` direction (-1, 0, 0)\n" \
-	"  + **phi** : rotating around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
-	"\n"								\
-	"+ 1 axis for the detector\n"					\
-	"\n"								\
-	"  + **tth** : rotation around the :math:`\\vec{z}` direction (0, -1, 0)\n"
-
-static HklGeometry *hkl_geometry_new_soleil_mars(const HklFactory *factory)
-{
-	HklGeometry *self = hkl_geometry_new(factory);
-	HklHolder *h;
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
-	hkl_holder_add_rotation_axis(h, "chi", -1, 0, 0);
-	hkl_holder_add_rotation_axis(h, "phi", 0, 0, 1);
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "tth", 0, -1, 0);
-
-	return self;
-}
-
-static HklEngineList *hkl_engine_list_new_soleil_mars(const HklFactory *factory)
-{
-	HklEngineList *self = hkl_engine_list_new();
-
-	hkl_engine_list_add(self, hkl_engine_e4c_hkl_new());
-	hkl_engine_list_add(self, hkl_engine_e4c_psi_new());
-	hkl_engine_list_add(self, hkl_engine_q_new());
-
-	return self;
-}
-
-REGISTER_DIFFRACTOMETER(soleil_mars, "SOLEIL MARS", HKL_GEOMETRY_TYPE_SOLEIL_MARS_DESCRIPTION);
-
-/***********************/
-/* SOLEIL SIXS MED 1+2 */
-/***********************/
-
-#define HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_1_2_DESCRIPTION		\
-	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
-	"+ 2 axes for the sample\n"					\
-	"\n"								\
-	"  + **pitch** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"  + **mu** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
-	"\n"								\
-	"+ 3 axis for the detector\n"					\
-	"\n"								\
-	"  + **pitch** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"  + **gamma** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
-	"  + **delta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
-
-static HklGeometry *hkl_geometry_new_soleil_sixs_med_1_2(const HklFactory *factory)
-{
-	HklGeometry *self = hkl_geometry_new(factory);
-	HklHolder *h;
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "pitch", 0, -1, 0);
-	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "pitch", 0, -1, 0);
-	hkl_holder_add_rotation_axis(h, "gamma", 0, 0, 1);
-	hkl_holder_add_rotation_axis(h, "delta", 0, -1, 0);
-
-	return self;
-}
-
-static HklEngineList *hkl_engine_list_new_soleil_sixs_med_1_2(const HklFactory *factory)
-{
-	HklEngineList *self = hkl_engine_list_new();
-
-	hkl_engine_list_add(self, hkl_engine_soleil_sixs_med_1_2_hkl_new());
-	hkl_engine_list_add(self, hkl_engine_q2_new());
-	hkl_engine_list_add(self, hkl_engine_qper_qpar_new());
-
-	return self;
-}
-
-REGISTER_DIFFRACTOMETER(soleil_sixs_med_1_2, "SOLEIL SIXS MED1+2", HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_1_2_DESCRIPTION);
-
-/******************/
-/* PETRA3 P09 EH2 */
-/******************/
-
-#define HKL_GEOMETRY_TYPE_PETRA3_P09_EH2_DESCRIPTION			\
-	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
-	"+ 4 axes for the sample\n"					\
-	"\n"								\
-	"  + **mu** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"  + **omega** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
-	"  + **chi** : rotating around the :math:`\\vec{x}` direction (1, 0, 0)\n" \
-	"  + **phi** : rotating around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
-	"\n"								\
-	"+ 3 axis for the detector\n"					\
-	"\n"								\
-	"  + **mu** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"  + **delta** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
-	"  + **gamma** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
-
-static HklGeometry *hkl_geometry_new_petra3_p09_eh2(const HklFactory *factory)
-{
-	HklGeometry *self = hkl_geometry_new(factory);
-	HklHolder *h;
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "mu", 0, -1, 0);
-	hkl_holder_add_rotation_axis(h, "omega", 0, 0, 1);
-	hkl_holder_add_rotation_axis(h, "chi", 1, 0, 0);
-	hkl_holder_add_rotation_axis(h, "phi", 0, 0, 1);
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "mu", 0, -1, 0);
-	hkl_holder_add_rotation_axis(h, "delta", 0, 0, 1);
-	hkl_holder_add_rotation_axis(h, "gamma", 0, -1, 0);
-
-	return self;
-}
-
-static HklEngineList *hkl_engine_list_new_petra3_p09_eh2(const HklFactory *factory)
-{
-	HklEngineList *self = hkl_engine_list_new();
-
-	hkl_engine_list_add(self, hkl_engine_petra3_p09_eh2_hkl_new());
-
-	return self;
-}
-
-REGISTER_DIFFRACTOMETER(petra3_p09_eh2, "PETRA3 P09 EH2", HKL_GEOMETRY_TYPE_PETRA3_P09_EH2_DESCRIPTION);
-
-/***********************/
-/* SOLEIL SIXS MED 2+3 */
-/***********************/
-
-#define HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_2_3_DESCRIPTION		\
-	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
-	"+ 3 axes for the sample\n"					\
-	"\n"								\
-	"  + **beta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"  + **mu** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
-	"  + **omega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"\n"								\
-	"+ 4 axis for the detector\n"					\
-	"\n"								\
-	"  + **beta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"  + **gamma** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
-	"  + **delta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
-	"  + **eta_a** : rotation around the :math:`-\\vec{x}` direction (-1, 0, 0)\n"
-
-static HklGeometry *hkl_geometry_new_soleil_sixs_med_2_3(const HklFactory *factory)
-{
-	HklGeometry *self = hkl_geometry_new(factory);
-	HklHolder *h;
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "beta", 0, -1, 0);
-	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
-	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "beta", 0, -1, 0);
-	hkl_holder_add_rotation_axis(h, "gamma", 0, 0, 1);
-	hkl_holder_add_rotation_axis(h, "delta", 0, -1, 0);
-	hkl_holder_add_rotation_axis(h, "eta_a", -1, 0, 0);
-
-	return self;
-}
-
-static HklEngineList *hkl_engine_list_new_soleil_sixs_med_2_3(const HklFactory *factory)
-{
-	HklEngineList *self = hkl_engine_list_new();
-
-	self->geometries->multiply = hkl_geometry_list_multiply_soleil_sixs_med_2_3;
-	hkl_engine_list_add(self, hkl_engine_soleil_sixs_med_2_3_hkl_new());
-	hkl_engine_list_add(self, hkl_engine_q2_new());
-	hkl_engine_list_add(self, hkl_engine_qper_qpar_new());
-
-	return self;
-}
-
-REGISTER_DIFFRACTOMETER(soleil_sixs_med_2_3, "SOLEIL SIXS MED2+3", HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_2_3_DESCRIPTION);
-
-/********/
-/* E4CH */
-/********/
-
-#define HKL_GEOMETRY_TYPE_EULERIAN4C_HORIZONTAL_DESCRIPTION		\
-	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
-	"+ 3 axes for the sample\n"					\
-	"\n"								\
-	"  + **omega** : rotating around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
-	"  + **chi** : rotating around the :math:`\\vec{x}` direction (1, 0, 0)\n" \
-	"  + **phi** : rotating around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
-	"\n"								\
-	"+ 1 axis for the detector\n"					\
-	"\n"								\
-	"  + **tth** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n"
-
-static HklGeometry *hkl_geometry_new_eulerian4C_horizontal(const HklFactory *factory)
-{
-	HklGeometry *self = hkl_geometry_new(factory);
-	HklHolder *h;
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "omega", 0, 0, 1);
-	hkl_holder_add_rotation_axis(h, "chi", 1, 0, 0);
-	hkl_holder_add_rotation_axis(h, "phi", 0, 0, 1);
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "tth", 0, 0, 1);
-
-	return self;
-}
-
-static HklEngineList *hkl_engine_list_new_eulerian4C_horizontal(const HklFactory *factory)
-{
-	HklEngineList *self = hkl_engine_list_new();
-
-	hkl_engine_list_add(self, hkl_engine_e4c_hkl_new());
-	hkl_engine_list_add(self, hkl_engine_e4c_psi_new());
-	hkl_engine_list_add(self, hkl_engine_q_new());
-
-	return self;
-}
-
-REGISTER_DIFFRACTOMETER(eulerian4C_horizontal, "E4CH", HKL_GEOMETRY_TYPE_EULERIAN4C_HORIZONTAL_DESCRIPTION);
diff --git a/hkl/hkl-geometry-private.h b/hkl/hkl-geometry-private.h
index cf1edc9..126a99e 100644
--- a/hkl/hkl-geometry-private.h
+++ b/hkl/hkl-geometry-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,12 +22,17 @@
 #ifndef __HKL_GEOMETRY_PRIVATE_H__
 #define __HKL_GEOMETRY_PRIVATE_H__
 
-#include "hkl.h"
-#include "hkl-parameter-private.h"
-#include "hkl-quaternion-private.h"
-#include "hkl-source-private.h"
+#include <stddef.h>                     // for size_t
+#include <stdio.h>                      // for FILE
+#include "hkl-parameter-private.h"      // for darray_parameter
+#include "hkl-quaternion-private.h"     // for _HklQuaternion
+#include "hkl-source-private.h"         // for HklSource
+#include "hkl-vector-private.h"         // for HklQuaternion
+#include "hkl.h"                        // for HklGeometry, etc
+#include "hkl/ccan/darray/darray.h"     // for darray
+#include "hkl/ccan/list/list.h"
 
-HKL_BEGIN_DECLS
+G_BEGIN_DECLS
 
 typedef struct _HklHolder HklHolder;
 typedef void (* HklGeometryListMultiplyFunction) (HklGeometryList *self,
@@ -55,14 +60,28 @@ struct _HklGeometry
 	darray_holder holders;
 };
 
+#define HKL_GEOMETRY_ERROR hkl_geometry_error_quark ()
+
+static GQuark hkl_geometry_error_quark (void)
+{
+	return g_quark_from_static_string ("hkl-geometry-error-quark");
+}
+
+typedef enum {
+	HKL_GEOMETRY_ERROR_AXIS_GET, /* can not get the axis */
+	HKL_GEOMETRY_ERROR_AXIS_SET, /* can not set the axis */
+} HklGeometryError;
+
 struct _HklGeometryList
 {
 	HklGeometryListMultiplyFunction multiply;
-	darray_item items;
+	struct list_head items;
+	size_t n_items;
 };
 
 struct _HklGeometryListItem
 {
+	struct list_node list;
 	HklGeometry *geometry;
 };
 
@@ -79,10 +98,8 @@ extern HklParameter *hkl_holder_add_rotation_axis(HklHolder *self,
 
 extern HklGeometry *hkl_geometry_new(const HklFactory *factory);
 
-extern HklGeometry *hkl_geometry_new_copy(const HklGeometry *self);
-
-extern void hkl_geometry_init_geometry(HklGeometry *self,
-				       const HklGeometry *src);
+extern int hkl_geometry_init_geometry(HklGeometry *self,
+				      const HklGeometry *src);
 
 extern HklHolder *hkl_geometry_add_holder(HklGeometry *self);
 
@@ -91,12 +108,10 @@ extern void hkl_geometry_update(HklGeometry *self);
 extern int hkl_geometry_get_axis_idx_by_name(const HklGeometry *self,
 					     const char *name);
 
+/* internally require do not use the hkl_geometry_axis_get */
 extern HklParameter *hkl_geometry_get_axis_by_name(HklGeometry *self,
 						   const char *name);
 
-extern int hkl_geometry_set_values_v(HklGeometry *self,
-				     size_t len, ...);
-
 extern double hkl_geometry_distance(const HklGeometry *self,
 				    const HklGeometry *ref);
 
@@ -116,8 +131,6 @@ extern HklGeometryList *hkl_geometry_list_new(void);
 
 extern HklGeometryList *hkl_geometry_list_new_copy(const HklGeometryList *self);
 
-extern void hkl_geometry_list_free(HklGeometryList *self);
-
 extern void hkl_geometry_list_add(HklGeometryList *self, HklGeometry *geometry);
 
 extern void hkl_geometry_list_reset(HklGeometryList *self);
@@ -142,6 +155,6 @@ extern HklGeometryListItem *hkl_geometry_list_item_new_copy(const HklGeometryLis
 
 extern void hkl_geometry_list_item_free(HklGeometryListItem *self);
 
-HKL_END_DECLS
+G_END_DECLS
 
 #endif /* __HKL_GEOMETRY_PRIVATE_H__ */
diff --git a/hkl/hkl-geometry.c b/hkl/hkl-geometry.c
index 186dce9..fa39300 100644
--- a/hkl/hkl-geometry.c
+++ b/hkl/hkl-geometry.c
@@ -13,25 +13,35 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <math.h>
-#include <string.h>
-#include <stdarg.h>
-#ifndef _MSC_VER
-# include <alloca.h>
-#endif
-
-#include <gsl/gsl_math.h>
-#include <gsl/gsl_sf_trig.h>
-
-#include "hkl/ccan/container_of/container_of.h"
-#include "hkl-axis-private.h"
-#include "hkl-geometry-private.h"
+#include <alloca.h>                     // for alloca
+#include <gsl/gsl_sf_trig.h>            // for gsl_sf_angle_restrict_symm
+#include <gsl/gsl_sys.h>                // for gsl_isnan
+#include <math.h>                       // for fabs, M_PI
+#include <stdarg.h>                     // for va_arg, va_end, va_list, etc
+#include <stddef.h>                     // for size_t
+#include <stdio.h>                      // for fprintf, FILE, stderr
+#include <stdlib.h>                     // for free, exit, realloc
+#include <string.h>                     // for NULL, strcmp, memcpy
+#include <sys/types.h>                  // for uint
+#include "hkl-factory-private.h"
+#include "hkl-axis-private.h"           // for HklAxis, etc
+#include "hkl-geometry-private.h"       // for _HklGeometry, etc
+#include "hkl-interval-private.h"       // for HklInterval
+#include "hkl-macros-private.h"         // for HKL_MALLOC
+#include "hkl-parameter-private.h"      // for _HklParameter, etc
+#include "hkl-quaternion-private.h"     // for _HklQuaternion, etc
+#include "hkl-source-private.h"         // for HklSource, hkl_source_init
+#include "hkl-unit-private.h"           // for HklUnit, hkl_unit_factor
+#include "hkl-vector-private.h"         // for HklVector, HklQuaternion, etc
+#include "hkl.h"                        // for HklGeometry, etc
+#include "hkl/ccan/container_of/container_of.h"  // for container_of
+#include "hkl/ccan/darray/darray.h"     // for darray_foreach, darray_item, etc
 
 /*
  * Try to add a axis to the axes list,
@@ -266,82 +276,170 @@ void hkl_geometry_free(HklGeometry *self)
 	free(self);
 }
 
-void hkl_geometry_set(HklGeometry *self, const HklGeometry *src)
+/**
+ * hkl_geometry_set: (skip)
+ * @self: the this ptr
+ * @src: the other #HklGeometry to set from
+ *
+ * Set an #HklGeometry from another one.
+ *
+ * Returns: TRUE on success, FALSE if an error occurred
+ **/
+int hkl_geometry_set(HklGeometry *self, const HklGeometry *src)
 {
 	size_t i;
 
-	if(self->factory != src->factory)
-		return;
+	hkl_error(self->factory == src->factory);
 
-	self->factory = src->factory;
 	self->source = src->source;
 
 	/* copy the axes configuration and mark it as dirty */
 	for(i=0; i<darray_size(self->axes); ++i)
 		hkl_parameter_init_copy(darray_item(self->axes, i),
-					darray_item(src->axes, i));
+					darray_item(src->axes, i), NULL);
 
 	for(i=0; i<darray_size(src->holders); ++i)
 		darray_item(self->holders, i)->q = darray_item(src->holders, i)->q;
+
+	return TRUE;
 }
 
-const darray_parameter *hkl_geometry_axes_get(const HklGeometry *self)
+/**
+ * hkl_geometry_axis_names_get:
+ * @self: the this ptr
+ *
+ * get all the axes of the given #HklGeometry
+ *
+ * Returns: (type gpointer): array of the axes names.
+ **/
+const darray_string *hkl_geometry_axis_names_get(const HklGeometry *self)
 {
-	return &self->axes;
+	return &self->factory->axes;
 }
 
 /**
- * hkl_geometry_axis_get: (skip)
+ * hkl_geometry_axis_get:
  * @self: the this ptr
  * @name: the name of the axis your are requesting
+ * @error: return location for a GError, or NULL
  *
  * Return value: (allow-none): the parameter corresponding to the axis name.
  **/
 const HklParameter *hkl_geometry_axis_get(const HklGeometry *self,
-					  const char *name)
+					  const char *name,
+					  GError **error)
 {
 	HklParameter **axis;
 
+	hkl_error (error == NULL || *error == NULL);
+
 	darray_foreach(axis, self->axes){
 		if (!strcmp((*axis)->name, name))
 			return *axis;
 	}
+
+	g_set_error(error,
+		    HKL_GEOMETRY_ERROR,
+		    HKL_GEOMETRY_ERROR_AXIS_GET,
+		    "this geometry does not contain this axis \"%s\"",
+		    name);
+
 	return NULL;
 }
 
-void hkl_geometry_axis_set(HklGeometry *self, const HklParameter *axis)
+/**
+ * hkl_geometry_axis_set:
+ * @self: the this ptr
+ * @name: the name of the axis to set
+ * @axis: The #HklParameter to set
+ * @error: return location for a GError, or NULL
+ *
+ * Returns: TRUE on success, FALSE if an error occurred
+ **/
+int hkl_geometry_axis_set(HklGeometry *self, const char *name,
+			  const HklParameter *axis,
+			  GError **error)
 {
 	HklParameter **_axis;
 
+	hkl_error (error == NULL || *error == NULL);
+
+	if(name != axis->name && strcmp(name, axis->name)){
+		g_set_error(error,
+			    HKL_GEOMETRY_ERROR,
+			    HKL_GEOMETRY_ERROR_AXIS_SET,
+			    "The axis to set \"%s\" is different from the parameter name \"\"\n",
+			    name, axis->name);
+		return FALSE;
+	}
+
 	darray_foreach(_axis, self->axes){
 		if (*_axis == axis)
 			break;
-		if (!strcmp(axis->name, (*_axis)->name))
-			hkl_parameter_init_copy(*_axis, axis);
+		if (!strcmp(axis->name, (*_axis)->name)){
+			hkl_parameter_init_copy(*_axis, axis, NULL);
+			break;
+		}
 	}
 	hkl_geometry_update(self);
+
+	return TRUE;
 }
 
-double hkl_geometry_wavelength_get(const HklGeometry *self)
+/**
+ * hkl_geometry_wavelength_get:
+ * @self: the this ptr
+ * @unit_type: the unit type (default or user) of the returned value
+ *
+ * Get the wavelength of the HklGeometry
+ *
+ * Returns: the wavelength
+ **/
+double hkl_geometry_wavelength_get(const HklGeometry *self,
+				   HklUnitEnum unit_type)
 {
+	/* for now there is no unit convertion but the unit_type is
+	 * there */
 	return self->source.wave_length;
 }
 
-void hkl_geometry_wavelength_set(HklGeometry *self, double wavelength)
+
+/**
+ * hkl_geometry_wavelength_set:
+ * @self:
+ * @wavelength:
+ * @unit_type: the unit type (default or user) of the returned value
+ * @error: return location for a GError, or NULL
+ *
+ * Set the wavelength of the geometry
+ *
+ * Returns: TRUE on success, FALSE if an error occurred
+ **/
+int hkl_geometry_wavelength_set(HklGeometry *self, double wavelength,
+				HklUnitEnum unit_type, GError **error)
 {
+	hkl_error (error == NULL || *error == NULL);
+
+	/* for now there is no unit convertion but the unit_type is
+	 * there */
+
 	self->source.wave_length = wavelength;
+
+	return TRUE;
 }
 
 /**
  * hkl_geometry_init_geometry: (skip)
- * @self:
- * @src:
+ * @self: the this ptr
+ * @src: the #HklGeometry to set from
  *
  * initilize an HklGeometry
+ *
+ * Returns: TRUE on success, FALSE if an error occurred
  **/
-void hkl_geometry_init_geometry(HklGeometry *self, const HklGeometry *src)
+int hkl_geometry_init_geometry(HklGeometry *self, const HklGeometry *src)
 {
-	hkl_geometry_set(self, src);
+	return hkl_geometry_set(self, src);
 }
 
 /**
@@ -387,14 +485,14 @@ void hkl_geometry_update(HklGeometry *self)
 		}
 
 		darray_foreach(axis, self->axes){
-			(*axis)->changed = HKL_FALSE;
+			(*axis)->changed = FALSE;
 		}
 	}
 }
 
 const char *hkl_geometry_name_get(const HklGeometry *self)
 {
-	return hkl_factory_name(self->factory);
+	return hkl_factory_name_get(self->factory);
 }
 
 /**
@@ -444,6 +542,65 @@ HklParameter *hkl_geometry_get_axis_by_name(HklGeometry *self, const char *name)
 }
 
 /**
+ * hkl_geometry_axis_values_get:
+ * @self: the this ptr
+ * @values: (array length=n_values): the values to get
+ * @n_values: the size of the values array.
+ * @unit_type: the unit type (default or user) of the returned value
+ *
+ * fill the values array with the #HklGeometry axes.
+ **/
+void hkl_geometry_axis_values_get(const HklGeometry *self,
+				  double values[], size_t n_values,
+				  HklUnitEnum unit_type)
+{
+	size_t i = 0;
+	HklParameter **axis;
+
+	g_return_if_fail (n_values == darray_size(self->axes));
+
+	darray_foreach(axis, self->axes){
+		values[i++] = hkl_parameter_value_get(*axis, unit_type);
+	}
+}
+
+/**
+ * hkl_geometry_axis_values_set:
+ * @self: the this ptr
+ * @values: (array length=n_values): the values to set.
+ * @n_values: the length of the values array.
+ * @unit_type: the unit type (default or user) of the returned value
+ * @error: return location for a GError, or NULL
+ *
+ * Set the #HklGeometry axes values
+ *
+ * Returns: TRUE on success, FALSE if an error occurred
+ **/
+int hkl_geometry_axis_values_set(HklGeometry *self,
+				 double values[], size_t n_values,
+				 HklUnitEnum unit_type,
+				 GError **error)
+{
+	uint i = 0;
+	HklParameter **axis;
+
+	hkl_error (error == NULL || *error == NULL);
+	g_assert(n_values == darray_size(self->axes));
+
+	darray_foreach(axis, self->axes){
+		if(!hkl_parameter_value_set(*axis, values[i++], unit_type, error)){
+			g_assert (error == NULL || *error != NULL);
+			return FALSE;
+		}
+	}
+	g_assert (error == NULL || *error == NULL);
+
+	hkl_geometry_update(self);
+
+	return TRUE;
+}
+
+/**
  * hkl_geometry_randomize: (skip)
  * @self:
  *
@@ -462,48 +619,39 @@ void hkl_geometry_randomize(HklGeometry *self)
 /**
  * hkl_geometry_set_values_v: (skip)
  * @self:
- * @len:
+ * @unit_type: the unit type (default or user) of the returned value
+ * @error:
  * "...:
  *
  * set the axes values
  *
  * Returns:
  **/
-int hkl_geometry_set_values_v(HklGeometry *self, size_t len, ...)
+int hkl_geometry_set_values_v(HklGeometry *self, HklUnitEnum unit_type, GError **error, ...)
 {
 	va_list ap;
 	HklParameter **axis;
 
-	if (!self || darray_size(self->axes) != len)
-		return HKL_FALSE;
+	hkl_error (error == NULL || *error == NULL);
 
-	va_start(ap, len);
+	va_start(ap, error);
 	darray_foreach(axis, self->axes){
-		hkl_parameter_value_set(*axis,
-					va_arg(ap, double), NULL);
+		if(!hkl_parameter_value_set(*axis,
+					    va_arg(ap, double),
+					    unit_type, error)){
+			g_assert (error == NULL || *error != NULL);
+			va_end(ap);
+			hkl_geometry_update(self);
+			return FALSE;
+		}
 	}
-	va_end(ap);
-
-	hkl_geometry_update(self);
-
-	return HKL_TRUE;
-}
-
-int hkl_geometry_set_values_unit_v(HklGeometry *self, ...)
-{
-	va_list ap;
-	HklParameter **axis;
+	g_assert (error == NULL || *error == NULL);
 
-	va_start(ap, self);
-	darray_foreach(axis, self->axes){
-		hkl_parameter_value_unit_set(*axis,
-					     va_arg(ap, double), NULL);
-	}
 	va_end(ap);
 
 	hkl_geometry_update(self);
 
-	return HKL_TRUE;
+	return TRUE;
 }
 
 /**
@@ -580,10 +728,10 @@ int hkl_geometry_is_valid(const HklGeometry *self)
 
 	darray_foreach(axis, self->axes){
 		if(!hkl_parameter_is_valid(*axis))
-			return HKL_FALSE;
+			return FALSE;
 	}
 
-	return HKL_TRUE;
+	return TRUE;
 }
 
 /**
@@ -602,20 +750,21 @@ int hkl_geometry_closest_from_geometry_with_range(HklGeometry *self,
 	size_t i;
 	uint len = darray_size(self->axes);
 	double *values = alloca(len * sizeof(*values));
-	int ko = HKL_FALSE;
+	int ko = FALSE;
 
 	for(i=0;i<len;++i){
 		values[i] = hkl_parameter_value_get_closest(darray_item(self->axes, i),
 							    darray_item(ref->axes, i));
 		if(gsl_isnan(values[i])){
-			ko = HKL_TRUE;
+			ko = TRUE;
 			break;
 		}
 	}
 	if(!ko){
 		for(i=0;i<len;++i)
 			hkl_parameter_value_set(darray_item(self->axes, i),
-						values[i], NULL);
+						values[i],
+						HKL_UNIT_DEFAULT, NULL);
 		hkl_geometry_update(self);
 	}
 	return ko;
@@ -630,11 +779,11 @@ int hkl_geometry_closest_from_geometry_with_range(HklGeometry *self,
  **/
 void hkl_geometry_fprintf(FILE *file, const HklGeometry *self)
 {
-	uint i;
-
-	for(i=0; i<darray_size(self->axes); ++i){
-		if(i)
-			fprintf(file, "\n");
+	fprintf(file, " HklGeometry type: \"%s\" wavelength: %f",
+		self->factory->name,
+		self->source.wave_length);
+	for(unsigned int i=0; i<darray_size(self->axes); ++i){
+		fprintf(file, " ");
 		hkl_parameter_fprintf(file, darray_item(self->axes, i));
 	}
 }
@@ -656,7 +805,8 @@ HklGeometryList *hkl_geometry_list_new(void)
 
 	self = HKL_MALLOC(HklGeometryList);
 
-	darray_init(self->items);
+	list_head_init(&self->items);
+	self->n_items = 0;
 	self->multiply = NULL;
 
 	return self;
@@ -673,18 +823,20 @@ HklGeometryList *hkl_geometry_list_new(void)
 HklGeometryList *hkl_geometry_list_new_copy(const HklGeometryList *self)
 {
 	HklGeometryList *dup;
-	HklGeometryListItem **item;
+	HklGeometryListItem *item;
 
 	if (!self)
 		return NULL;
 
 	dup = HKL_MALLOC(HklGeometryList);
 
-	darray_init(dup->items);
+	list_head_init(&dup->items);
 	/* now copy the item arrays */
-	darray_foreach(item , self->items){
-		darray_append(dup->items, hkl_geometry_list_item_new_copy(*item));
+	list_for_each(&self->items, item, list){
+		list_add_tail(&dup->items,
+			      &hkl_geometry_list_item_new_copy(item)->list);
 	}
+	dup->n_items = self->n_items;
 	dup->multiply = self->multiply;
 
 	return dup;
@@ -716,39 +868,78 @@ void hkl_geometry_list_free(HklGeometryList *self)
  **/
 void hkl_geometry_list_add(HklGeometryList *self, HklGeometry *geometry)
 {
-	HklGeometryListItem **item;
+	HklGeometryListItem *item;
 
 	/* now check if the geometry is already in the geometry list */
-	darray_foreach(item, self->items){
+	list_for_each(&self->items, item, list){
 		if (hkl_geometry_distance_orthodromic(geometry,
-						      (*item)->geometry) < HKL_EPSILON)
+						      item->geometry) < HKL_EPSILON)
 			return;
 	}
 
-	darray_append(self->items, hkl_geometry_list_item_new(geometry));
+	list_add_tail(&self->items,
+		      &hkl_geometry_list_item_new(geometry)->list);
+	self->n_items += 1;
+}
+
+/**
+ * hkl_geometry_list_n_items_get: (skip)
+ * @self: the this ptr
+ *
+ * get the number of items in the #HklGeometryList
+ *
+ * Returns: the number of items in the list
+ **/
+size_t hkl_geometry_list_n_items_get(const HklGeometryList *self)
+{
+	return self->n_items;
+}
+
+/**
+ * hkl_geometry_list_items_first_get: (skip)
+ * @self: the this ptr
+ *
+ * get the first solution of the #HklGeometryList
+ *
+ * Returns: the first solution of the list
+ **/
+const HklGeometryListItem *hkl_geometry_list_items_first_get(const HklGeometryList *self)
+{
+	return list_top(&self->items, HklGeometryListItem, list);
 }
 
-const darray_item *hkl_geometry_list_items_get(const HklGeometryList *self)
+/**
+ * hkl_geometry_list_items_next_get: (skip)
+ * @self: the this ptr
+ * @item: the current #HklGeometryListItem solution of the #HklGeometryList
+ *
+ * get the next solution of the #HklGeometryList from the current item location.
+ *
+ * Returns: the next solution of the list
+ **/
+const HklGeometryListItem *hkl_geometry_list_items_next_get(const HklGeometryList *self,
+							    const HklGeometryListItem *item)
 {
-	return &self->items;
+	return list_next(&self->items, item, list);
 }
 
 /**
  * hkl_geometry_list_reset: (skip)
- * @self:
+ * @self: the this ptr
  *
  * reset the HklGeometry, in fact it is a sort of clean method remove
  * all the items of the list.
  **/
 void hkl_geometry_list_reset(HklGeometryList *self)
 {
-	HklGeometryListItem **item;
+	HklGeometryListItem *item;
+	HklGeometryListItem *next;
 
-	darray_foreach(item, self->items)
-		hkl_geometry_list_item_free(*item);
+	list_for_each_safe(&self->items, item, next, list)
+		hkl_geometry_list_item_free(item);
 
-	darray_free(self->items);
-	darray_init(self->items);
+	list_head_init(&self->items);
+	self->n_items = 0;
 }
 
 /**
@@ -761,25 +952,25 @@ void hkl_geometry_list_reset(HklGeometryList *self)
  **/
 void hkl_geometry_list_sort(HklGeometryList *self, HklGeometry *ref)
 {
-	double *distances = alloca(darray_size(self->items) * sizeof(*distances));
-	size_t *idx = alloca(darray_size(self->items) * sizeof(*idx));
-	HklGeometryListItem **items = alloca(darray_size(self->items) * sizeof(*items));
-	HklGeometryListItem **item;
+	double *distances = alloca(self->n_items * sizeof(*distances));
+	size_t *idx = alloca(self->n_items * sizeof(*idx));
+	HklGeometryListItem **items = alloca(self->n_items * sizeof(*items));
+	HklGeometryListItem *item;
+	HklGeometryListItem *next;
 	int i = 0;
 	size_t x;
 	int j, p;
 
-	memcpy(items, &darray_item(self->items, 0), darray_size(self->items) * sizeof(*items));
-
 	/* compute the distances once for all */
-	darray_foreach(item, self->items){
-		distances[i] = hkl_geometry_distance(ref, (*item)->geometry);
+	list_for_each(&self->items, item, list){
+		distances[i] = hkl_geometry_distance(ref, item->geometry);
 		idx[i] = i;
+		items[i] = item;
 		i++;
 	}
 
 	/* insertion sorting */
-	for(i=1; i<darray_size(self->items); ++i){
+	for(i=1; i<self->n_items; ++i){
 		x = idx[i];
 		/* find the smallest idx p lower than i with distance[idx[p]] >= distance[x] */
 		for(p = 0; distances[idx[p]] < distances[x] && fabs(distances[idx[p]] - distances[x]) > HKL_EPSILON; p++);
@@ -791,9 +982,10 @@ void hkl_geometry_list_sort(HklGeometryList *self, HklGeometry *ref)
 		idx[p] = x; /* insert the saved idx */
 	}
 
-	for(i=0; i<darray_size(self->items); ++i){
-		darray_item(self->items, i) = items[idx[i]];
-	}
+	list_head_init(&self->items);
+
+	for(i=0; i<self->n_items; ++i)
+		list_add_tail(&self->items, &items[idx[i]]->list);
 }
 
 /**
@@ -813,20 +1005,20 @@ void hkl_geometry_list_fprintf(FILE *f, const HklGeometryList *self)
 		return;
 
 	fprintf(f, "multiply method: %p \n", self->multiply);
-	if(darray_size(self->items)){
-		HklGeometryListItem **item;
+	if(self->n_items){
+		HklGeometryListItem *item;
 		HklParameter **axis;
 
 		fprintf(f, "    ");
-		darray_foreach(axis, darray_item(self->items, 0)->geometry->axes){
+		darray_foreach(axis, list_top(&self->items, HklGeometryListItem, list)->geometry->axes){
 			fprintf(f, "%19s", (*axis)->name);
 		}
 
 		/* geometries */
-		darray_foreach(item, self->items){
+		list_for_each(&self->items, item, list){
 			fprintf(f, "\n%d :", i++);
-			darray_foreach(axis, (*item)->geometry->axes){
-				value = hkl_parameter_value_unit_get(*axis);
+			darray_foreach(axis, item->geometry->axes){
+				value = hkl_parameter_value_get(*axis, HKL_UNIT_DEFAULT);
 				if ((*axis)->punit)
 					fprintf(f, " % 18.15f %s", value, (*axis)->punit->repr);
 				else
@@ -834,8 +1026,8 @@ void hkl_geometry_list_fprintf(FILE *f, const HklGeometryList *self)
 
 			}
 			fprintf(f, "\n   ");
-			darray_foreach(axis, (*item)->geometry->axes){
-				value = hkl_parameter_value_get(*axis);
+			darray_foreach(axis, item->geometry->axes){
+				value = hkl_parameter_value_get(*axis, HKL_UNIT_DEFAULT);
 				value = gsl_sf_angle_restrict_symm(value);
 				value *= hkl_unit_factor((*axis)->unit,
 							 (*axis)->punit);
@@ -857,8 +1049,9 @@ void hkl_geometry_list_fprintf(FILE *f, const HklGeometryList *self)
  **/
 void hkl_geometry_list_multiply(HklGeometryList *self)
 {
-	uint i;
-	uint len = darray_size(self->items);
+	uint i = 0;
+	uint len = self->n_items;
+	HklGeometryListItem *item;
 
 	if(!self || !self->multiply)
 		return;
@@ -867,8 +1060,10 @@ void hkl_geometry_list_multiply(HklGeometryList *self)
 	 * warning this method change the self->len so we need to save it
 	 * before using the recursive perm_r calls
 	 */
-	for(i=0; i<len; ++i)
-		self->multiply(self, darray_item(self->items, i));
+	for(i=0, item=list_top(&self->items, HklGeometryListItem, list);
+	    i<len;
+	    ++i, item=list_next(&self->items, item, list))
+		self->multiply(self, item);
 }
 
 static void perm_r(HklGeometryList *self, const HklGeometry *ref,
@@ -876,8 +1071,11 @@ static void perm_r(HklGeometryList *self, const HklGeometry *ref,
 		   const unsigned int axis_idx)
 {
 	if (axis_idx == darray_size(geometry->axes)){
-		if(hkl_geometry_distance(geometry, ref) > HKL_EPSILON)
-			darray_append(self->items, hkl_geometry_list_item_new(geometry));
+		if(hkl_geometry_distance(geometry, ref) > HKL_EPSILON){
+			list_add_tail(&self->items,
+				      &hkl_geometry_list_item_new(geometry)->list);
+			self->n_items++;
+		}
 	}else{
 		if(perm[axis_idx]){
 			HklParameter *axis = darray_item(geometry->axes, axis_idx);
@@ -911,9 +1109,10 @@ static void perm_r(HklGeometryList *self, const HklGeometry *ref,
 
 void hkl_geometry_list_multiply_from_range(HklGeometryList *self)
 {
-	uint i = 0;
-	uint len = darray_size(self->items);
+	uint i;
+	uint len = self->n_items;
 	size_t j = 0;
+	const HklGeometryListItem *item;
 
 	if(!self)
 		return;
@@ -922,13 +1121,15 @@ void hkl_geometry_list_multiply_from_range(HklGeometryList *self)
 	 * warning this method change the self->len so we need to save it
 	 * before using the recursive perm_r calls
 	 */
-	for(i=0; i<len; ++i){
+
+	for(i=0, item=list_top(&self->items, HklGeometryListItem, list);
+	    i<len;
+	    ++i, item=list_next(&self->items, item, list)){
 		HklGeometry *geometry;
 		HklParameter **axis;
-		const HklGeometry *ref = darray_item(self->items, i)->geometry;
 		int *perm;
 
-		geometry = hkl_geometry_new_copy(ref);
+		geometry = hkl_geometry_new_copy(item->geometry);
 		perm = alloca(darray_size(geometry->axes) * sizeof(*perm));
 
 		/* find axes to permute and the first solution of thoses axes */
@@ -944,7 +1145,7 @@ void hkl_geometry_list_multiply_from_range(HklGeometryList *self)
 		 * hkl_geometry_fprintf(stdout, geometry);
 		 */
 
-		perm_r(self, ref, geometry, perm, 0);
+		perm_r(self, item->geometry, geometry, perm, 0);
 		hkl_geometry_free(geometry);
 	}
 }
@@ -957,21 +1158,14 @@ void hkl_geometry_list_multiply_from_range(HklGeometryList *self)
  **/
 void hkl_geometry_list_remove_invalid(HklGeometryList *self)
 {
-	uint len = darray_size(self->items);
-	HklGeometryListItem **items = alloca(len * sizeof(*items));
-	uint i = 0;
-
-	if(!self)
-		return;
+	HklGeometryListItem *item, *next;
 
-	memcpy(items, &darray_item(self->items, 0), len * sizeof(*items));
-	darray_size(self->items) = 0;
-	for(i=0; i<len; ++i){
-		if(!hkl_geometry_is_valid(items[i]->geometry))
-			hkl_geometry_list_item_free(items[i]);
-		else
-			darray_append(self->items, items[i]);
-	}
+	list_for_each_safe(&self->items, item, next, list)
+		if(!hkl_geometry_is_valid(item->geometry)){
+			list_del(&item->list);
+			self->n_items--;
+			hkl_geometry_list_item_free(item);
+		}
 }
 
 /***********************/
@@ -1038,7 +1232,7 @@ void hkl_geometry_list_item_free(HklGeometryListItem *self)
 }
 
 /**
- * hkl_geometry_list_item_geometry_get: (skip)
+ * hkl_geometry_list_item_geometry_get:
  * @self: the this ptr
  *
  * Return value: The geometry contain inside the HklGeometryListItem
diff --git a/hkl/hkl-interval-private.h b/hkl/hkl-interval-private.h
index 75f9552..b848874 100644
--- a/hkl/hkl-interval-private.h
+++ b/hkl/hkl-interval-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,9 +22,9 @@
 #ifndef _HKL_INTERVAL_PRIVATE_H
 #define _HKL_INTERVAL_PRIVATE_H
 
-#include "hkl.h"
+#include "hkl.h"                        // for G_BEGIN_DECLS, etc
 
-HKL_BEGIN_DECLS
+G_BEGIN_DECLS
 
 typedef struct _HklInterval HklInterval;
 
@@ -72,6 +72,6 @@ extern double hkl_interval_length(const HklInterval *self);
 
 extern void hkl_interval_angle_restrict_symm(HklInterval *self);
 
-HKL_END_DECLS
+G_END_DECLS
 
 #endif
diff --git a/hkl/hkl-interval.c b/hkl/hkl-interval.c
index 231de19..a4fc71c 100644
--- a/hkl/hkl-interval.c
+++ b/hkl/hkl-interval.c
@@ -13,18 +13,19 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
 #define _GNU_SOURCE
-#include <math.h>
 #include <gsl/gsl_sf_trig.h>
-
-#include "hkl-interval-private.h"
-#include "hkl-macros-private.h"
+#include <math.h>                       // for floor, M_PI_2, acos, asin, etc
+#include <stdlib.h>                     // for free, NULL
+#include "hkl-interval-private.h"       // for HklInterval
+#include "hkl-macros-private.h"         // for HKL_MALLOC
+#include "hkl.h"                        // for FALSE, TRUE
 
 /**
  * hkl_interval_dup: (skip)
@@ -144,7 +145,7 @@ void hkl_interval_times_interval(HklInterval *self, const HklInterval *interval)
 
 	min = m1;
 	if (m2 < min)
-		min = m2;
+ 		min = m2;
 	if (m3 < min)
 		min = m3;
 	if (m4 < min)
@@ -215,9 +216,9 @@ void hkl_interval_divides_double(HklInterval *self, double const d)
 int hkl_interval_contain_zero(HklInterval const *self)
 {
 	if (self->min <= 0 && self->max >= 0)
-		return HKL_TRUE;
+		return TRUE;
 	else
-		return HKL_FALSE;
+		return FALSE;
 }
 
 /**
diff --git a/hkl/hkl-lattice-private.h b/hkl/hkl-lattice-private.h
index ff76acc..9ec6fc1 100644
--- a/hkl/hkl-lattice-private.h
+++ b/hkl/hkl-lattice-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -26,7 +26,7 @@
 
 #include "hkl.h"
 
-HKL_BEGIN_DECLS
+G_BEGIN_DECLS
 
 struct _HklLattice
 {
@@ -38,12 +38,23 @@ struct _HklLattice
 	HklParameter *gamma;
 };
 
+#define HKL_LATTICE_ERROR hkl_lattice_error_quark ()
+
+static GQuark hkl_lattice_error_quark (void)
+{
+	return g_quark_from_static_string ("hkl-lattice-error-quark");
+}
+
+typedef enum {
+	HKL_LATTICE_CHECK_LATTICE, /* the lattice parameters are not valid */
+} HklLatticeError;
+
 extern void hkl_lattice_lattice_set(HklLattice *self, const HklLattice *lattice);
 
 extern void hkl_lattice_randomize(HklLattice *self);
 
 extern void hkl_lattice_fprintf(FILE *f, const HklLattice *self);
 
-HKL_END_DECLS
+G_END_DECLS
 
 #endif /* __HKL_LATTICE_PRIVATE_H__ */
diff --git a/hkl/hkl-lattice.c b/hkl/hkl-lattice.c
index b03d3ac..59360f4 100644
--- a/hkl/hkl-lattice.c
+++ b/hkl/hkl-lattice.c
@@ -13,32 +13,52 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <stdlib.h>
-#include <math.h>
-
-#include "hkl-lattice-private.h"
-#include "hkl-parameter-private.h"
-#include "hkl-matrix-private.h"
-#include "hkl-unit-private.h"
+#include <math.h>                       // for cos, sin, M_PI, atan2, sqrt
+#include <stdio.h>                      // for fprintf, FILE
+#include <stdlib.h>                     // for NULL, free
+#include "hkl-lattice-private.h"        // for _HklLattice
+#include "hkl-macros-private.h"         // for HKL_MALLOC
+#include "hkl-matrix-private.h"         // for _HklMatrix
+#include "hkl-parameter-private.h"      // for hkl_parameter_init_copy, etc
+#include "hkl-unit-private.h"           // for hkl_unit_length_nm, etc
+#include "hkl-vector-private.h"         // for hkl_vector_angle, etc
+#include "hkl.h"                        // for HklLattice, etc
 
 /* private */
 
+static double convert_to_default(const HklParameter *p, double value, HklUnitEnum unit_type)
+{
+	switch(unit_type){
+	case HKL_UNIT_DEFAULT:
+		return value;
+	case HKL_UNIT_USER:
+		return value / hkl_unit_factor(p->unit, p->punit);
+	}
+}
+
 static int check_lattice_param(double a, double b, double c,
-			       double alpha, double beta, double gamma)
+			       double alpha, double beta, double gamma,
+			       GError **error)
 {
+	hkl_error (error == NULL || *error == NULL);
+
 	double D = 1. - cos(alpha)*cos(alpha) - cos(beta)*cos(beta)
 		- cos(gamma)*cos(gamma) + 2. * cos(alpha)*cos(beta)*cos(gamma);
 
-	if (D < 0.)
-		return HKL_FALSE;
-	else
-		return HKL_TRUE;
+	if (D < 0.){
+		g_set_error(error,
+			    HKL_LATTICE_ERROR,
+			    HKL_LATTICE_CHECK_LATTICE,
+			    "these lattice parameters are not valid, check alpha, beta and gamma");
+		return FALSE;
+	}else
+		return TRUE;
 }
 
 /* public */
@@ -51,44 +71,62 @@ static int check_lattice_param(double a, double b, double c,
  * @alpha: the angle between b and c (radian)
  * @beta: the angle between a and c (radian)
  * @gamma: the angle between a and b (radian)
+ * @error: return location for a GError, or NULL
  *
  * constructor
  *
  * Returns: a new HklLattice
  **/
 HklLattice *hkl_lattice_new(double a, double b, double c,
-			    double alpha, double beta, double gamma)
+			    double alpha, double beta, double gamma,
+			    GError **error)
 {
 	HklLattice *self = NULL;
-	if(check_lattice_param(a, b, c, alpha, beta, gamma)) {
-		self = HKL_MALLOC(HklLattice);
-
-		self->a = hkl_parameter_new("a", 0, a, a+10,
-					    HKL_TRUE, HKL_TRUE,
-					    &hkl_unit_length_nm,
-					    &hkl_unit_length_nm);
-		self->b = hkl_parameter_new("b", 0, b, b+10,
-					    HKL_TRUE, HKL_TRUE,
-					    &hkl_unit_length_nm,
-					    &hkl_unit_length_nm);
-		self->c = hkl_parameter_new("c", 0, c, c+10,
-					    HKL_TRUE, HKL_TRUE,
-					    &hkl_unit_length_nm,
-					    &hkl_unit_length_nm);
-		self->alpha = hkl_parameter_new("alpha", -M_PI, alpha, M_PI,
-						HKL_TRUE, HKL_TRUE,
-						&hkl_unit_angle_rad,
-						&hkl_unit_angle_deg);
-		self->beta = hkl_parameter_new("beta", -M_PI, beta, M_PI,
-					       HKL_TRUE, HKL_TRUE,
-					       &hkl_unit_angle_rad,
-					       &hkl_unit_angle_deg);
-		self->gamma = hkl_parameter_new("gamma", -M_PI, gamma, M_PI,
-						HKL_TRUE, HKL_TRUE,
-						&hkl_unit_angle_rad,
-						&hkl_unit_angle_deg);
-	}
 
+	hkl_error (error == NULL || *error == NULL);
+
+	if(!check_lattice_param(a, b, c, alpha, beta, gamma, error))
+	{
+		g_assert (error == NULL || *error != NULL);
+		return FALSE;
+	}
+	g_assert (error == NULL || *error == NULL);
+
+	self = HKL_MALLOC(HklLattice);
+
+	self->a = hkl_parameter_new("a", "The length of the first lattice vector",
+				    0, a, a+10,
+				    TRUE, TRUE,
+				    &hkl_unit_length_nm,
+				    &hkl_unit_length_nm);
+	self->b = hkl_parameter_new("b", "The length of the second lattice vector",
+				    0, b, b+10,
+				    TRUE, TRUE,
+				    &hkl_unit_length_nm,
+				    &hkl_unit_length_nm);
+	self->c = hkl_parameter_new("c", "The length of the third lattice vector",
+				    0, c, c+10,
+				    TRUE, TRUE,
+				    &hkl_unit_length_nm,
+				    &hkl_unit_length_nm);
+	self->alpha = hkl_parameter_new("alpha",
+					"The angle between the second and third lattice vector",
+					-M_PI, alpha, M_PI,
+					TRUE, TRUE,
+					&hkl_unit_angle_rad,
+					&hkl_unit_angle_deg);
+	self->beta = hkl_parameter_new("beta",
+					"The angle between the first and third lattice vector",
+				       -M_PI, beta, M_PI,
+				       TRUE, TRUE,
+				       &hkl_unit_angle_rad,
+				       &hkl_unit_angle_deg);
+	self->gamma = hkl_parameter_new("gamma",
+					"The angle between the first and second lattice vector",
+					-M_PI, gamma, M_PI,
+					TRUE, TRUE,
+					&hkl_unit_angle_rad,
+					&hkl_unit_angle_deg);
 	return self;
 }
 
@@ -126,7 +164,8 @@ HklLattice *hkl_lattice_new_copy(const HklLattice *self)
 HklLattice* hkl_lattice_new_default(void)
 {
 	return hkl_lattice_new(1.54, 1.54, 1.54,
-			       90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD);
+			       90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD,
+			       NULL);
 }
 
 /**
@@ -159,10 +198,16 @@ const HklParameter *hkl_lattice_a_get(const HklLattice *self)
  * hkl_lattice_a_set: (skip)
  * @self: the this ptr
  * @parameter: the parameter to set
+ * @error: return location for a GError, or NULL
+ *
+ * Returns: TRUE on success, FALSE if an error occurred
  **/
-void hkl_lattice_a_set(HklLattice *self, const HklParameter *parameter)
+int hkl_lattice_a_set(HklLattice *self, const HklParameter *parameter,
+		      GError **error)
 {
-	hkl_parameter_init_copy(self->a, parameter);
+	hkl_error (error == NULL || *error == NULL);
+
+	return hkl_parameter_init_copy(self->a, parameter, error);
 }
 
 /**
@@ -178,10 +223,16 @@ const HklParameter *hkl_lattice_b_get(const HklLattice *self)
  * hkl_lattice_b_set: (skip)
  * @self: the this ptr
  * @parameter: the parameter to set
+ * @error: return location for a GError, or NULL
+ *
+ * Returns: TRUE on success, FALSE if an error occurred
  **/
-void hkl_lattice_b_set(HklLattice *self, const HklParameter *parameter)
+int hkl_lattice_b_set(HklLattice *self, const HklParameter *parameter,
+		      GError **error)
 {
-	hkl_parameter_init_copy(self->b, parameter);
+	hkl_error (error == NULL || *error == NULL);
+
+	return hkl_parameter_init_copy(self->b, parameter, error);
 }
 
 /**
@@ -197,10 +248,16 @@ const HklParameter *hkl_lattice_c_get(const HklLattice *self)
  * hkl_lattice_c_set: (skip)
  * @self: the this ptr
  * @parameter: the parameter to set
+ * @error: return location for a GError, or NULL
+ *
+ * Returns: TRUE on success, FALSE if an error occurred
  **/
-void hkl_lattice_c_set(HklLattice *self, const HklParameter *parameter)
+int hkl_lattice_c_set(HklLattice *self, const HklParameter *parameter,
+		      GError **error)
 {
-	hkl_parameter_init_copy(self->c, parameter);
+	hkl_error (error == NULL || *error == NULL);
+
+	return hkl_parameter_init_copy(self->c, parameter, error);
 }
 
 /**
@@ -216,10 +273,16 @@ const HklParameter *hkl_lattice_alpha_get(const HklLattice *self)
  * hkl_lattice_alpha_set: (skip)
  * @self: the this ptr
  * @parameter: the parameter to set
+ * @error: return location for a GError, or NULL
+ *
+ * Returns: TRUE on success, FALSE if an error occurred
  **/
-void hkl_lattice_alpha_set(HklLattice *self, const HklParameter *parameter)
+int hkl_lattice_alpha_set(HklLattice *self, const HklParameter *parameter,
+			  GError **error)
 {
-	hkl_parameter_init_copy(self->alpha, parameter);
+	hkl_error (error == NULL || *error == NULL);
+
+	return hkl_parameter_init_copy(self->alpha, parameter, error);
 }
 
 /**
@@ -235,10 +298,16 @@ const HklParameter *hkl_lattice_beta_get(const HklLattice *self)
  * hkl_lattice_beta_set: (skip)
  * @self: the this ptr
  * @parameter: the parameter to set
+ * @error: return location for a GError, or NULL
+ *
+ * Returns: TRUE on success, FALSE if an error occurred
  **/
-void hkl_lattice_beta_set(HklLattice *self, const HklParameter *parameter)
+int hkl_lattice_beta_set(HklLattice *self, const HklParameter *parameter,
+			 GError **error)
 {
-	hkl_parameter_init_copy(self->beta, parameter);
+	hkl_error (error == NULL || *error == NULL);
+
+	return hkl_parameter_init_copy(self->beta, parameter, error);
 }
 
 /**
@@ -254,10 +323,16 @@ const HklParameter *hkl_lattice_gamma_get(const HklLattice *self)
  * hkl_lattice_gamma_set: (skip)
  * @self: the this ptr
  * @parameter: the parameter to set
+ * @error: return location for a GError, or NULL
+ *
+ * Returns: TRUE on success, FALSE if an error occurred
  **/
-void hkl_lattice_gamma_set(HklLattice *self, const HklParameter *parameter)
+int hkl_lattice_gamma_set(HklLattice *self, const HklParameter *parameter,
+			   GError **error)
 {
-	hkl_parameter_init_copy(self->gamma, parameter);
+	hkl_error (error == NULL || *error == NULL);
+
+	return hkl_parameter_init_copy(self->gamma, parameter, error);
 }
 
 /**
@@ -270,12 +345,12 @@ void hkl_lattice_lattice_set(HklLattice *self, const HklLattice *lattice)
 	if (self == lattice)
 		return;
 
-	hkl_parameter_init_copy(self->a, lattice->a);
-	hkl_parameter_init_copy(self->b, lattice->b);
-	hkl_parameter_init_copy(self->c, lattice->c);
-	hkl_parameter_init_copy(self->alpha, lattice->alpha);
-	hkl_parameter_init_copy(self->beta, lattice->beta);
-	hkl_parameter_init_copy(self->gamma, lattice->gamma);
+	hkl_parameter_init_copy(self->a, lattice->a, NULL);
+	hkl_parameter_init_copy(self->b, lattice->b, NULL);
+	hkl_parameter_init_copy(self->c, lattice->c, NULL);
+	hkl_parameter_init_copy(self->alpha, lattice->alpha, NULL);
+	hkl_parameter_init_copy(self->beta, lattice->beta, NULL);
+	hkl_parameter_init_copy(self->gamma, lattice->gamma, NULL);
 }
 
 /**
@@ -294,19 +369,35 @@ void hkl_lattice_lattice_set(HklLattice *self, const HklLattice *lattice)
  **/
 int hkl_lattice_set(HklLattice *self,
 		    double a, double b, double c,
-		    double alpha, double beta, double gamma)
+		    double alpha, double beta, double gamma,
+		    HklUnitEnum unit_type, GError **error)
 {
-	if(!check_lattice_param(a, b, c, alpha, beta, gamma))
-		return HKL_FALSE;
+	hkl_error (error == NULL || *error == NULL);
+
+	double _a, _b, _c, _alpha, _beta, _gamma;
+
+	_a = convert_to_default(self->a, a, unit_type);
+	_b = convert_to_default(self->b, b, unit_type);
+	_c = convert_to_default(self->c, c, unit_type);
+	_alpha = convert_to_default(self->alpha, alpha, unit_type);
+	_beta = convert_to_default(self->beta, beta, unit_type);
+	_gamma = convert_to_default(self->gamma, gamma, unit_type);
+
+	/* need to do the conversion before the check */
+	if(!check_lattice_param(_a, _b, _c, _alpha, _beta, _gamma, error)){
+		g_assert (error == NULL || *error != NULL);
+		return FALSE;
+	}
+	g_assert (error == NULL || *error == NULL);
 
-	hkl_parameter_value_set(self->a, a, NULL);
-	hkl_parameter_value_set(self->b, b, NULL);
-	hkl_parameter_value_set(self->c, c, NULL);
-	hkl_parameter_value_set(self->alpha, alpha, NULL);
-	hkl_parameter_value_set(self->beta, beta, NULL);
-	hkl_parameter_value_set(self->gamma, gamma, NULL);
+	hkl_parameter_value_set(self->a, _a, HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(self->b, _b, HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(self->c, _c, HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(self->alpha, _alpha, HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(self->beta, _beta, HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(self->gamma, _gamma, HKL_UNIT_DEFAULT, NULL);
 
-	return HKL_TRUE;
+	return TRUE;
 }
 
 /**
@@ -324,14 +415,15 @@ int hkl_lattice_set(HklLattice *self,
  **/
 void hkl_lattice_get(const HklLattice *self,
 		     double *a, double *b, double *c,
-		     double *alpha, double *beta, double *gamma)
+		     double *alpha, double *beta, double *gamma,
+		     HklUnitEnum unit_type)
 {
-	*a = hkl_parameter_value_get(self->a);
-	*b = hkl_parameter_value_get(self->b);
-	*c = hkl_parameter_value_get(self->c);
-	*alpha = hkl_parameter_value_get(self->alpha);
-	*beta = hkl_parameter_value_get(self->beta);
-	*gamma = hkl_parameter_value_get(self->gamma);
+	*a = hkl_parameter_value_get(self->a, unit_type);
+	*b = hkl_parameter_value_get(self->b, unit_type);
+	*c = hkl_parameter_value_get(self->c, unit_type);
+	*alpha = hkl_parameter_value_get(self->alpha, unit_type);
+	*beta = hkl_parameter_value_get(self->beta, unit_type);
+	*gamma = hkl_parameter_value_get(self->gamma, unit_type);
 }
 
 /**
@@ -351,26 +443,26 @@ int hkl_lattice_get_B(const HklLattice *self, HklMatrix *B)
 	double c_gamma, s_gamma;
 	double b11, b22, tmp;
 
-	c_alpha = cos(hkl_parameter_value_get(self->alpha));
-	c_beta = cos(hkl_parameter_value_get(self->beta));
-	c_gamma = cos(hkl_parameter_value_get(self->gamma));
+	c_alpha = cos(hkl_parameter_value_get(self->alpha, HKL_UNIT_DEFAULT));
+	c_beta = cos(hkl_parameter_value_get(self->beta, HKL_UNIT_DEFAULT));
+	c_gamma = cos(hkl_parameter_value_get(self->gamma, HKL_UNIT_DEFAULT));
 	D = 1 - c_alpha*c_alpha - c_beta*c_beta - c_gamma*c_gamma
 		+ 2*c_alpha*c_beta*c_gamma;
 
 	if (D > 0.)
 		D = sqrt(D);
 	else
-		return HKL_FALSE;
+		return FALSE;
 
-	s_alpha = sin(hkl_parameter_value_get(self->alpha));
-	s_beta  = sin(hkl_parameter_value_get(self->beta));
-	s_gamma = sin(hkl_parameter_value_get(self->gamma));
+	s_alpha = sin(hkl_parameter_value_get(self->alpha, HKL_UNIT_DEFAULT));
+	s_beta  = sin(hkl_parameter_value_get(self->beta, HKL_UNIT_DEFAULT));
+	s_gamma = sin(hkl_parameter_value_get(self->gamma, HKL_UNIT_DEFAULT));
 
-	b11 = HKL_TAU / (hkl_parameter_value_get(self->b) * s_alpha);
-	b22 = HKL_TAU / hkl_parameter_value_get(self->c);
+	b11 = HKL_TAU / (hkl_parameter_value_get(self->b, HKL_UNIT_DEFAULT) * s_alpha);
+	b22 = HKL_TAU / hkl_parameter_value_get(self->c, HKL_UNIT_DEFAULT);
 	tmp = b22 / s_alpha;
 
-	B->data[0][0] = HKL_TAU * s_alpha / (hkl_parameter_value_get(self->a) * D);
+	B->data[0][0] = HKL_TAU * s_alpha / (hkl_parameter_value_get(self->a, HKL_UNIT_DEFAULT) * D);
 	B->data[0][1] = b11 / D * (c_alpha*c_beta - c_gamma);
 	B->data[0][2] = tmp / D * (c_gamma*c_alpha - c_beta);
 
@@ -382,7 +474,7 @@ int hkl_lattice_get_B(const HklLattice *self, HklMatrix *B)
 	B->data[2][1] = 0;
 	B->data[2][2] = b22;
 
-	return HKL_TRUE;
+	return TRUE;
 }
 
 /**
@@ -393,7 +485,7 @@ int hkl_lattice_get_B(const HklLattice *self, HklMatrix *B)
  * Compute the invert of B (needed by the hkl_sample_UB_set method)
  * should be optimized
  *
- * Returns: HKL_TRUE or HKL_FALSE depending of the success of the
+ * Returns: TRUE or FALSE depending of the success of the
  * computation.
  **/
 int hkl_lattice_get_1_B(const HklLattice *self, HklMatrix *B)
@@ -407,7 +499,7 @@ int hkl_lattice_get_1_B(const HklLattice *self, HklMatrix *B)
 	double f;
 
 	if(!self || !B)
-		return HKL_FALSE;
+		return FALSE;
 
 	/*
 	 * first compute the B matrix
@@ -439,7 +531,7 @@ int hkl_lattice_get_1_B(const HklLattice *self, HklMatrix *B)
 	B->data[2][1] = 0;
 	B->data[2][2] = 1 / f;
 
-	return HKL_TRUE;
+	return TRUE;
 }
 
 /**
@@ -461,20 +553,20 @@ int hkl_lattice_reciprocal(const HklLattice *self, HklLattice *reciprocal)
 	double s_beta_s_gamma, s_gamma_s_alpha, s_alpha_s_beta;
 	double D;
 
-	c_alpha = cos(hkl_parameter_value_get(self->alpha));
-	c_beta  = cos(hkl_parameter_value_get(self->beta));
-	c_gamma = cos(hkl_parameter_value_get(self->gamma));
+	c_alpha = cos(hkl_parameter_value_get(self->alpha, HKL_UNIT_DEFAULT));
+	c_beta  = cos(hkl_parameter_value_get(self->beta, HKL_UNIT_DEFAULT));
+	c_gamma = cos(hkl_parameter_value_get(self->gamma, HKL_UNIT_DEFAULT));
 	D = 1 - c_alpha*c_alpha - c_beta*c_beta - c_gamma*c_gamma
 		+ 2*c_alpha*c_beta*c_gamma;
 
 	if (D > 0.)
 		D = sqrt(D);
 	else
-		return HKL_FALSE;
+		return FALSE;
 
-	s_alpha = sin(hkl_parameter_value_get(self->alpha));
-	s_beta  = sin(hkl_parameter_value_get(self->beta));
-	s_gamma = sin(hkl_parameter_value_get(self->gamma));
+	s_alpha = sin(hkl_parameter_value_get(self->alpha, HKL_UNIT_DEFAULT));
+	s_beta  = sin(hkl_parameter_value_get(self->beta, HKL_UNIT_DEFAULT));
+	s_gamma = sin(hkl_parameter_value_get(self->gamma, HKL_UNIT_DEFAULT));
 
 	s_beta_s_gamma  = s_beta  * s_gamma;
 	s_gamma_s_alpha = s_gamma * s_alpha;
@@ -488,14 +580,15 @@ int hkl_lattice_reciprocal(const HklLattice *self, HklLattice *reciprocal)
 	s_beta3 = D / s_alpha_s_beta;
 
 	hkl_lattice_set(reciprocal,
-			HKL_TAU * s_alpha / (hkl_parameter_value_get(self->a) * D),
-			HKL_TAU * s_beta  / (hkl_parameter_value_get(self->b) * D),
-			HKL_TAU * s_gamma / (hkl_parameter_value_get(self->c) * D),
+			HKL_TAU * s_alpha / (hkl_parameter_value_get(self->a, HKL_UNIT_DEFAULT) * D),
+			HKL_TAU * s_beta  / (hkl_parameter_value_get(self->b, HKL_UNIT_DEFAULT) * D),
+			HKL_TAU * s_gamma / (hkl_parameter_value_get(self->c, HKL_UNIT_DEFAULT) * D),
 			atan2(s_beta1, c_beta1),
 			atan2(s_beta2, c_beta2),
-			atan2(s_beta3, c_beta3));
+			atan2(s_beta3, c_beta3),
+			HKL_UNIT_DEFAULT, NULL);
 
-	return HKL_TRUE;
+	return TRUE;
 }
 
 /**
@@ -531,15 +624,18 @@ void hkl_lattice_randomize(HklLattice *self)
 			/* randomize b */
 			hkl_vector_randomize_vector(&axe, &a);
 			hkl_vector_rotated_around_vector(&b, &axe,
-							 hkl_parameter_value_get(self->gamma));
+							 hkl_parameter_value_get(self->gamma,
+										 HKL_UNIT_DEFAULT));
 
 			/* randomize c */
 			hkl_vector_randomize_vector(&axe, &a);
 			hkl_vector_rotated_around_vector(&c, &axe,
-							 hkl_parameter_value_get(self->beta));
+							 hkl_parameter_value_get(self->beta,
+										 HKL_UNIT_DEFAULT));
 
 			/* compute the alpha angle. */
-			hkl_parameter_value_set(self->alpha, hkl_vector_angle(&b, &c), NULL);
+			hkl_parameter_value_set(self->alpha, hkl_vector_angle(&b, &c),
+						HKL_UNIT_DEFAULT, NULL);
 		} else if (self->beta->fit) {
 			/* beta */
 			a = b = vector_x;
@@ -547,16 +643,19 @@ void hkl_lattice_randomize(HklLattice *self)
 			/* randomize b */
 			hkl_vector_randomize_vector(&axe, &a);
 			hkl_vector_rotated_around_vector(&b, &axe,
-							 hkl_parameter_value_get(self->gamma));
+							 hkl_parameter_value_get(self->gamma,
+										 HKL_UNIT_DEFAULT));
 
 			/* randomize c */
 			c = b;
 			hkl_vector_randomize_vector(&axe, &b);
 			hkl_vector_rotated_around_vector(&c, &axe,
-							 hkl_parameter_value_get(self->alpha));
+							 hkl_parameter_value_get(self->alpha,
+										 HKL_UNIT_DEFAULT));
 
 			/* compute beta */
-			hkl_parameter_value_set(self->beta, hkl_vector_angle(&a, &c), NULL);
+			hkl_parameter_value_set(self->beta, hkl_vector_angle(&a, &c),
+						HKL_UNIT_DEFAULT, NULL);
 		} else {
 			/* gamma */
 			a = c = vector_x;
@@ -564,16 +663,19 @@ void hkl_lattice_randomize(HklLattice *self)
 			/* randomize c */
 			hkl_vector_randomize_vector(&axe, &a);
 			hkl_vector_rotated_around_vector(&c, &axe,
-							 hkl_parameter_value_get(self->beta));
+							 hkl_parameter_value_get(self->beta,
+										 HKL_UNIT_DEFAULT));
 
 			/* randomize b */
 			b = c;
 			hkl_vector_randomize_vector(&axe, &c);
 			hkl_vector_rotated_around_vector(&b, &axe,
-							 hkl_parameter_value_get(self->alpha));
+							 hkl_parameter_value_get(self->alpha,
+										 HKL_UNIT_DEFAULT));
 
 			/* compute gamma */
-			hkl_parameter_value_set(self->gamma, hkl_vector_angle(&a, &b), NULL);
+			hkl_parameter_value_set(self->gamma, hkl_vector_angle(&a, &b),
+						HKL_UNIT_DEFAULT, NULL);
 		}
 		break;
 	case 2:
@@ -585,13 +687,16 @@ void hkl_lattice_randomize(HklLattice *self)
 				/* randomize b */
 				hkl_vector_randomize_vector(&axe, &a);
 				hkl_vector_rotated_around_vector(&b, &axe,
-								 hkl_parameter_value_get(self->gamma));
+								 hkl_parameter_value_get(self->gamma,
+											 HKL_UNIT_DEFAULT));
 
 				/* randomize c */
 				hkl_vector_randomize_vector_vector(&c, &a, &b);
 
-				hkl_parameter_value_set(self->alpha, hkl_vector_angle(&b, &c), NULL);
-				hkl_parameter_value_set(self->beta, hkl_vector_angle(&a, &c), NULL);
+				hkl_parameter_value_set(self->alpha, hkl_vector_angle(&b, &c),
+							HKL_UNIT_DEFAULT, NULL);
+				hkl_parameter_value_set(self->beta, hkl_vector_angle(&a, &c),
+							HKL_UNIT_DEFAULT, NULL);
 			} else {
 				/* alpha + gamma */
 				a = c = vector_x;
@@ -599,13 +704,16 @@ void hkl_lattice_randomize(HklLattice *self)
 				/* randomize c */
 				hkl_vector_randomize_vector(&axe, &a);
 				hkl_vector_rotated_around_vector(&c, &axe,
-								 hkl_parameter_value_get(self->beta));
+								 hkl_parameter_value_get(self->beta,
+											 HKL_UNIT_DEFAULT));
 
 				/* randomize c */
 				hkl_vector_randomize_vector_vector(&b, &a, &c);
 
-				hkl_parameter_value_set(self->alpha, hkl_vector_angle(&b, &c), NULL);
-				hkl_parameter_value_set(self->gamma, hkl_vector_angle(&a, &b), NULL);
+				hkl_parameter_value_set(self->alpha, hkl_vector_angle(&b, &c),
+							HKL_UNIT_DEFAULT, NULL);
+				hkl_parameter_value_set(self->gamma, hkl_vector_angle(&a, &b),
+							HKL_UNIT_DEFAULT, NULL);
 			}
 		} else {
 			/* beta + gamma */
@@ -614,13 +722,16 @@ void hkl_lattice_randomize(HklLattice *self)
 			/* randomize c */
 			hkl_vector_randomize_vector(&axe, &b);
 			hkl_vector_rotated_around_vector(&c, &axe,
-							 hkl_parameter_value_get(self->alpha));
+							 hkl_parameter_value_get(self->alpha,
+										 HKL_UNIT_DEFAULT));
 
 			/* randomize c */
 			hkl_vector_randomize_vector_vector(&a, &b, &c);
 
-			hkl_parameter_value_set(self->beta, hkl_vector_angle(&a, &c), NULL);
-			hkl_parameter_value_set(self->gamma, hkl_vector_angle(&a, &b), NULL);
+			hkl_parameter_value_set(self->beta, hkl_vector_angle(&a, &c),
+						HKL_UNIT_DEFAULT, NULL);
+			hkl_parameter_value_set(self->gamma, hkl_vector_angle(&a, &b),
+						HKL_UNIT_DEFAULT, NULL);
 		}
 		break;
 	case 3:
@@ -628,9 +739,12 @@ void hkl_lattice_randomize(HklLattice *self)
 		hkl_vector_randomize_vector(&b, &a);
 		hkl_vector_randomize_vector_vector(&c, &b, &a);
 
-		hkl_parameter_value_set(self->alpha, hkl_vector_angle(&b, &c), NULL);
-		hkl_parameter_value_set(self->beta, hkl_vector_angle(&a, &c), NULL);
-		hkl_parameter_value_set(self->gamma, hkl_vector_angle(&a, &b), NULL);
+		hkl_parameter_value_set(self->alpha, hkl_vector_angle(&b, &c),
+					HKL_UNIT_DEFAULT, NULL);
+		hkl_parameter_value_set(self->beta, hkl_vector_angle(&a, &c),
+					HKL_UNIT_DEFAULT, NULL);
+		hkl_parameter_value_set(self->gamma, hkl_vector_angle(&a, &b),
+					HKL_UNIT_DEFAULT, NULL);
 		break;
 	}
 }
diff --git a/hkl/hkl-macros-private.h b/hkl/hkl-macros-private.h
index 1924a92..76d3f7b 100644
--- a/hkl/hkl-macros-private.h
+++ b/hkl/hkl-macros-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,7 +22,8 @@
 #ifndef __HKL_MACROS_PRIVATE_H__
 #define __HKL_MACROS_PRIVATE_H__
 
-#include "hkl.h"
+#include <assert.h>                     // for assert
+#include "hkl.h"                        // for G_BEGIN_DECLS, etc
 
 /* specific part for the eulerian -> kappa conversion */
 #define HKL_EULERIAN_KAPPA_SOLUTION 1
@@ -36,6 +37,12 @@
 # define hkl_assert(x)
 #endif
 
+#define hkl_error(expr) do{				\
+		if(!(expr)){				\
+			g_error(__STRING(expr));	\
+		}					\
+	} while(0)
+
 /* use for the printf format methods took from glib */
 #define G_GNUC_PRINTF( format_idx, arg_idx )				\
 	__attribute__((__format__ (__printf__, format_idx, arg_idx)))
@@ -72,15 +79,15 @@
 # endif
 #endif
 
-#define hkl_return_val_if_fail(expr, val) if (expr) { } else return val
+#define DARRAY(_items) {.item=_items, .size=ARRAY_SIZE(_items), .alloc=ARRAY_SIZE(_items)}
 
-HKL_BEGIN_DECLS
+G_BEGIN_DECLS
 
 extern void hkl_printbt(void);
 
 void *_hkl_malloc(int size, const char *error);
 
-HKL_END_DECLS
+G_END_DECLS
 
 /* malloc method */
 #define HKL_MALLOC(type) (type *)_hkl_malloc(sizeof(type), "Can not allocate memory for a " #type)
diff --git a/hkl/hkl-macros.c b/hkl/hkl-macros.c
index 3b647f4..c7ec0ea 100644
--- a/hkl/hkl-macros.c
+++ b/hkl/hkl-macros.c
@@ -13,16 +13,15 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <stdio.h>
-
-#include "hkl.h"
-#include "hkl-macros-private.h"
+#include <execinfo.h>                   // for backtrace, etc
+#include <stdio.h>                      // for fprintf, printf, stderr
+#include <stdlib.h>                     // for calloc, exit, free
 
 #ifndef _MSC_VER
 void hkl_printbt(void)
@@ -56,7 +55,7 @@ int vasprintf(char **strp, const char *fmt, va_list ap)
 }
 #endif
 
-__inline__ void *_hkl_malloc(int size, const char *error)
+void *_hkl_malloc(int size, const char *error)
 {
 	void *tmp;
 
diff --git a/hkl/hkl-matrix-private.h b/hkl/hkl-matrix-private.h
index 4594663..5be2654 100644
--- a/hkl/hkl-matrix-private.h
+++ b/hkl/hkl-matrix-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -25,9 +25,8 @@
 #include <stdio.h>
 
 #include "hkl.h"
-#include "hkl-vector-private.h"
 
-HKL_BEGIN_DECLS
+G_BEGIN_DECLS
 
 struct _HklMatrix
 {
@@ -60,6 +59,6 @@ extern int hkl_matrix_solve(const HklMatrix *self,
 
 extern int hkl_matrix_is_null(const HklMatrix *self);
 
-HKL_END_DECLS
+G_END_DECLS
 
 #endif
diff --git a/hkl/hkl-matrix.c b/hkl/hkl-matrix.c
index 094d904..a5cec25 100644
--- a/hkl/hkl-matrix.c
+++ b/hkl/hkl-matrix.c
@@ -13,23 +13,24 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#include "hkl-macros-private.h"
-#include "hkl-matrix-private.h"
-#include "hkl-vector-private.h"
+#include <math.h>                       // for cos, fabs, atan2, sin, asin
+#include <stdio.h>                      // for fprintf, FILE
+#include <stdlib.h>                     // for free
+#include <string.h>                     // for memcpy
+#include "hkl-macros-private.h"         // for HKL_MALLOC
+#include "hkl-matrix-private.h"         // for _HklMatrix
+#include "hkl-vector-private.h"         // for HklVector, etc
+#include "hkl.h"                        // for HklMatrix, HKL_EPSILON, etc
 
 /**
  * hkl_matrix_new: (skip)
- * 
+ *
  * Returns: a new uninitialized HklMatrix
  */
 HklMatrix *hkl_matrix_new()
@@ -289,7 +290,7 @@ void hkl_matrix_to_euler(const HklMatrix *self,
  *
  * compare two #HklMatrix.
  *
- * Returns: return HKL_TRUE if | self - m | > HKL_EPSILON
+ * Returns: return TRUE if | self - m | > HKL_EPSILON
  **/
 int hkl_matrix_cmp(const HklMatrix *self, const HklMatrix *m)
 {
@@ -298,8 +299,8 @@ int hkl_matrix_cmp(const HklMatrix *self, const HklMatrix *m)
 	for(i=0;i<3;i++)
 		for(j=0;j<3;j++)
 			if( fabs(self->data[i][j] - m->data[i][j]) > HKL_EPSILON )
-				return HKL_FALSE;
-	return HKL_TRUE;
+				return FALSE;
+	return TRUE;
 }
 
 
@@ -438,7 +439,7 @@ int hkl_matrix_solve(const HklMatrix *self, HklVector *x, const HklVector *b)
  *
  * is all #hklMatrix elementes bellow #HKL_EPSILON
  *
- * Returns: HKL_TRUE if the self #HklMatrix is null
+ * Returns: TRUE if the self #HklMatrix is null
  * Todo: test
  **/
 int hkl_matrix_is_null(const HklMatrix *self)
@@ -448,6 +449,6 @@ int hkl_matrix_is_null(const HklMatrix *self)
 	for (i=0;i<3;i++)
 		for (j=0;j<3;j++)
 			if ( fabs(self->data[i][j]) > HKL_EPSILON )
-				return HKL_FALSE;
-	return HKL_TRUE;
+				return FALSE;
+	return TRUE;
 }
diff --git a/hkl/hkl-parameter-private.h b/hkl/hkl-parameter-private.h
index 44d8b20..53ed38e 100644
--- a/hkl/hkl-parameter-private.h
+++ b/hkl/hkl-parameter-private.h
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -23,19 +23,21 @@
 #ifndef __HKL_PARAMETER_PRIVATE_H__
 #define __HKL_PARAMETER_PRIVATE_H__
 
-#include <stdio.h>
+#include <math.h>                       // for M_PI
+#include <stdio.h>                      // for FILE, fprintf, NULL
+#include <stdlib.h>                     // for free, rand, RAND_MAX
+#include "hkl-interval-private.h"       // for HklInterval
+#include "hkl-macros-private.h"         // for HKL_MALLOC
+#include "hkl-unit-private.h"           // for HklUnit, hkl_unit_factor
+#include "hkl.h"                        // for HklParameter, TRUE, etc
 
-#include "hkl.h"
-#include "hkl-interval-private.h"
-#include "hkl-macros-private.h"
-#include "hkl-unit-private.h"
-
-HKL_BEGIN_DECLS
+G_BEGIN_DECLS
 
 typedef struct _HklParameterOperations HklParameterOperations;
 
 struct _HklParameter {
 	const char *name;
+	const char *description;
 	HklInterval range;
 	double _value;
 	const HklUnit *unit;
@@ -45,29 +47,40 @@ struct _HklParameter {
 	const HklParameterOperations *ops;
 };
 
-#define HKL_PARAMETER_DEFAULTS .name="dummy", .range={.min=0, .max=0}, ._value=0, .unit=NULL, .punit=NULL, .fit=HKL_TRUE, .changed=HKL_TRUE, .ops = &hkl_parameter_operations_defaults
+#define HKL_PARAMETER_DEFAULTS .name="dummy", .description="no description", .range={.min=0, .max=0}, ._value=0, .unit=NULL, .punit=NULL, .fit=TRUE, .changed=TRUE, .ops = &hkl_parameter_operations_defaults
 
 #define HKL_PARAMETER_DEFAULTS_ANGLE HKL_PARAMETER_DEFAULTS, .range={.min=-M_PI, .max=M_PI}, .unit = &hkl_unit_angle_rad, .punit = &hkl_unit_angle_deg
 
+#define HKL_PARAMETER_ERROR hkl_parameter_error_quark ()
+
+static GQuark hkl_parameter_error_quark (void)
+{
+	return g_quark_from_static_string ("hkl-parameter-error-quark");
+}
+
+typedef enum {
+	HKL_PARAMETER_ERROR_MIN_MAX_SET, /* can not set the min max */
+} HklParameterError;
 
 /****************/
 /* HklParameter */
 /****************/
 
 struct _HklParameterOperations {
-	HklParameter * (*copy)(const HklParameter *self);
-	void           (*free)(HklParameter *self);
-	void           (*init_copy)(HklParameter *self, const HklParameter *src);
-	double         (*get_value_closest)(const HklParameter *self,
-				    const HklParameter *other);
-	unsigned int   (*set_value)(HklParameter *self, double value,
-				  HklError **error);
-	unsigned int   (*set_value_unit)(HklParameter *self, double value,
-				       HklError **error);
-	void           (*set_value_smallest_in_range)(HklParameter *self);
-	void           (*randomize)(HklParameter *self);
-	int            (*is_valid)(const HklParameter *self);
-	void           (*fprintf)(FILE *f, const HklParameter *self);
+	HklParameter *        (*copy)(const HklParameter *self);
+	void                  (*free)(HklParameter *self);
+	int                   (*init_copy)(HklParameter *self, const HklParameter *src,
+					   GError **error);
+	double                (*get_value_closest)(const HklParameter *self,
+						   const HklParameter *other);
+	int                   (*set_value)(HklParameter *self, double value,
+					   HklUnitEnum unit_type, GError **error);
+	void                  (*set_value_smallest_in_range)(HklParameter *self);
+	void                  (*randomize)(HklParameter *self);
+	int                   (*is_valid)(const HklParameter *self);
+	void                  (*fprintf)(FILE *f, const HklParameter *self);
+	const HklVector *     (*axis_v_get)(const HklParameter *self);
+	const HklQuaternion * (*quaternion_get)(const HklParameter *self);
 };
 
 #define HKL_PARAMETER_OPERATIONS_DEFAULTS				\
@@ -76,11 +89,12 @@ struct _HklParameterOperations {
 		.init_copy = hkl_parameter_init_copy_real,		\
 		.get_value_closest = hkl_parameter_value_get_closest_real, \
 		.set_value = hkl_parameter_value_set_real,		\
-		.set_value_unit = hkl_parameter_value_unit_set_real,	\
 		.set_value_smallest_in_range = hkl_parameter_value_set_smallest_in_range_real, \
 		.randomize = hkl_parameter_randomize_real,		\
 		.is_valid = hkl_parameter_is_valid_real,		\
-		.fprintf = hkl_parameter_fprintf_real
+		.fprintf = hkl_parameter_fprintf_real,			\
+		.axis_v_get = hkl_parameter_axis_v_get_real,		\
+		.quaternion_get = hkl_parameter_quaternion_get_real
 
 static inline HklParameter *hkl_parameter_copy_real(const HklParameter *self)
 {
@@ -96,10 +110,16 @@ static inline void hkl_parameter_free_real(HklParameter *self)
 	free(self);
 }
 
-static inline void hkl_parameter_init_copy_real(HklParameter *self, const HklParameter *src)
+static inline int hkl_parameter_init_copy_real(HklParameter *self, const HklParameter *src,
+					       GError **error)
 {
+	hkl_error (error == NULL || *error == NULL);
+	hkl_error (self->name == src->name || strcmp(self->name, src->name) == 0);
+
 	*self = *src;
-	self->changed = HKL_TRUE;
+	self->changed = TRUE;
+
+	return TRUE;
 }
 
 static inline double hkl_parameter_value_get_closest_real(const HklParameter *self,
@@ -108,23 +128,22 @@ static inline double hkl_parameter_value_get_closest_real(const HklParameter *se
 	return self->_value;
 }
 
-static inline unsigned int hkl_parameter_value_set_real(
-	HklParameter *self, double value,
-	HklError **error)
-{
-	self->_value = value;
-	self->changed = HKL_TRUE;
-
-	return HKL_TRUE;
-}
-
-static inline unsigned int hkl_parameter_value_unit_set_real(
-	HklParameter *self, double value,
-	HklError **error)
+static inline int hkl_parameter_value_set_real(HklParameter *self, double value,
+					       HklUnitEnum unit_type, GError **error)
 {
-	double factor = hkl_unit_factor(self->unit, self->punit);
+	hkl_error (error == NULL || *error == NULL);
+
+	switch (unit_type) {
+	case HKL_UNIT_DEFAULT:
+		self->_value = value;
+		break;
+	case HKL_UNIT_USER:
+		self->_value = value / hkl_unit_factor(self->unit, self->punit);
+		break;
+	}
+	self->changed = TRUE;
 
-	return hkl_parameter_value_set_real(self, value / factor, error);
+	return TRUE;
 }
 
 static inline void hkl_parameter_value_set_smallest_in_range_real(HklParameter *self)
@@ -138,7 +157,7 @@ static inline void hkl_parameter_randomize_real(HklParameter *self)
 		double alea = (double)rand() / (RAND_MAX + 1.);
 		self->_value = self->range.min
 			+ (self->range.max - self->range.min) * alea;
-		self->changed = HKL_TRUE;
+		self->changed = TRUE;
 	}
 }
 
@@ -146,9 +165,9 @@ static inline int hkl_parameter_is_valid_real(const HklParameter *self)
 {
 	if(self->_value < (self->range.min - HKL_EPSILON)
 	   || self->_value > (self->range.max + HKL_EPSILON))
-		return HKL_FALSE;
+		return FALSE;
 	else
-		return HKL_TRUE;
+		return TRUE;
 }
 
 static inline void hkl_parameter_fprintf_real(FILE *f, const HklParameter *self)
@@ -171,18 +190,29 @@ static inline void hkl_parameter_fprintf_real(FILE *f, const HklParameter *self)
 			self->fit);
 }
 
+static inline const HklVector *hkl_parameter_axis_v_get_real(const HklParameter *self)
+{
+	return NULL;
+}
+
+static inline const HklQuaternion *hkl_parameter_quaternion_get_real(const HklParameter *self)
+{
+	return NULL;
+}
+
 static HklParameterOperations hkl_parameter_operations_defaults = {
 	HKL_PARAMETER_OPERATIONS_DEFAULTS,
 };
 
 
-extern HklParameter *hkl_parameter_new(const char *name,
+extern HklParameter *hkl_parameter_new(const char *name, const char *description,
 				       double min, double value, double max,
 				       int fit, int changed,
 				       const HklUnit *unit,
 				       const HklUnit *punit);
 
-extern void hkl_parameter_init_copy(HklParameter *self, const HklParameter *src);
+extern int hkl_parameter_init_copy(HklParameter *self, const HklParameter *src,
+				   GError **error);
 
 extern double hkl_parameter_value_get_closest(const HklParameter *self,
 					      const HklParameter *ref);
@@ -197,18 +227,8 @@ extern void hkl_parameter_fprintf(FILE *f, HklParameter *self);
 /* HklParameterList */
 /********************/
 
-extern void hkl_parameter_list_values_get(const HklParameterList *self,
-					  double values[], unsigned int *len);
-
-extern unsigned int hkl_parameter_list_values_unit_set(HklParameterList *self,
-						       double values[],
-						       unsigned int len,
-						       HklError **error);
-
-extern void hkl_parameter_list_free(HklParameterList *self);
-
-extern void hkl_parameter_list_fprintf(FILE *f, const HklParameterList *self);
+typedef darray(HklParameter *) darray_parameter;
 
-HKL_END_DECLS
+G_END_DECLS
 
 #endif /* __HKL_PARAMETER_PRIVATE_H__ */
diff --git a/hkl/hkl-parameter.c b/hkl/hkl-parameter.c
index 7c57b72..94cd2ac 100644
--- a/hkl/hkl-parameter.c
+++ b/hkl/hkl-parameter.c
@@ -13,22 +13,28 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <stdlib.h>
-#include <string.h>
-
-#include "hkl-parameter-private.h"
+#include <stdio.h>                      // for fprintf, FILE
+#include <stdlib.h>                     // for free, malloc, NULL
+#include <string.h>                     // for strcmp
+#include "hkl-interval-private.h"       // for HklInterval
+#include "hkl-macros-private.h"         // for HKL_MALLOC
+#include "hkl-parameter-private.h"      // for _HklParameter, etc
+#include "hkl-unit-private.h"           // for hkl_unit_factor, HklUnit, etc
+#include "hkl.h"                        // for HklParameter, etc
+#include "hkl/ccan/darray/darray.h"     // for darray_size, darray_item, etc
 
 /****************/
 /* HklParameter */
 /****************/
 
 static int hkl_parameter_init(HklParameter *self, const char *name,
+			      const char *description,
 			      double min, double value, double max,
 			      int fit, int changed,
 			      const HklUnit *unit, const HklUnit *punit)
@@ -36,8 +42,10 @@ static int hkl_parameter_init(HklParameter *self, const char *name,
 	if (min <= value
 	    && value <= max
 	    && strcmp(name, "")
+	    && strcmp(description, "")
 	    && hkl_unit_compatible(unit, punit)) {
 		self->name = name;
+		self->description = description;
 		self->range.min = min;
 		self->range.max = max;
 		self->_value = value;
@@ -47,9 +55,9 @@ static int hkl_parameter_init(HklParameter *self, const char *name,
 		self->changed = changed;
 		self->ops = &hkl_parameter_operations_defaults;
 	} else
-		return HKL_FALSE;
+		return FALSE;
 
-	return HKL_TRUE;
+	return TRUE;
 }
 
 /**
@@ -67,7 +75,7 @@ static int hkl_parameter_init(HklParameter *self, const char *name,
  *
  * Returns:
  **/
-HklParameter *hkl_parameter_new(const char *name,
+HklParameter *hkl_parameter_new(const char *name, const char *description,
 				double min, double value, double max,
 				int fit, int changed,
 				const HklUnit *unit, const HklUnit *punit)
@@ -77,7 +85,8 @@ HklParameter *hkl_parameter_new(const char *name,
 	self = HKL_MALLOC(HklParameter);
 
 	if (!hkl_parameter_init(self,
-				name, min, value, max,
+				name, description,
+				min, value, max,
 				fit, changed,
 				unit, punit)) {
 		free(self);
@@ -115,41 +124,68 @@ void hkl_parameter_free(HklParameter *self)
  * hkl_parameter_init_copy: (skip)
  * @self: the this ptr
  * @src: the parameter to copy from
+ * @error: return location for a GError, or NULL
+ *
+ * Returns: TRUE on success, FALSE if an error occurred
  **/
-void hkl_parameter_init_copy(HklParameter *self, const HklParameter *src)
+int hkl_parameter_init_copy(HklParameter *self, const HklParameter *src,
+			    GError **error)
 {
-	self->ops->init_copy(self, src);
+	return self->ops->init_copy(self, src, error);
 }
 
+/**
+ * hkl_parameter_name_get:
+ * @self: the this ptr
+ *
+ * Returns: the name of the #HklParameter
+ **/
 const char *hkl_parameter_name_get(const HklParameter *self)
 {
 	return self->name;
 }
 
 /**
- * hkl_parameter_value_get:
+ * hkl_parameter_default_unit_get:
  * @self: the this ptr
  *
- * Returns: the value of the #HklParameter
+ * Returns: the default unit of the #HklParameter
  **/
-inline double hkl_parameter_value_get(const HklParameter *self)
+const char *hkl_parameter_default_unit_get(const HklParameter *self)
 {
-	return self->_value;
+	return self->unit->name;
 }
 
 /**
- * hkl_parameter_value_unit_get:
+ * hkl_parameter_user_unit_get:
  * @self: the this ptr
  *
- * Returns: the value of the #HklParameter expressed in the user unit
+ * Returns: the user unit of the #HklParameter
  **/
-inline double hkl_parameter_value_unit_get(const HklParameter *self)
+const char *hkl_parameter_user_unit_get(const HklParameter *self)
 {
-	double factor = hkl_unit_factor(self->unit, self->punit);
-
-	return self->_value * factor;
+	return self->punit->name;
 }
 
+/**
+ * hkl_parameter_value_get:
+ * @self: the this ptr
+ * @unit_type: the unit type (default or user) of the returned value
+ *
+ * Returns: the value of the #HklParameter
+ **/
+inline double hkl_parameter_value_get(const HklParameter *self,
+				      HklUnitEnum unit_type)
+{
+	switch(unit_type){
+	case HKL_UNIT_DEFAULT:
+		return self->_value;
+		break;
+	case HKL_UNIT_USER:
+		return self->_value * hkl_unit_factor(self->unit, self->punit);
+		break;
+	}
+}
 
 /**
  * hkl_parameter_value_get_closest:
@@ -168,36 +204,20 @@ inline double hkl_parameter_value_get_closest(const HklParameter *self,
 }
 
 /**
- * hkl_parameter_value_set: (skip)
+ * hkl_parameter_value_set:
  * @self: this ptr
  * @value: the value to set
- * @error: the error set if something goes wrong
+ * @unit_type: the unit type (default or user) of the returned value
+ * @error: return location for a GError, or NULL
  *
  * set the value of an #HklParameter
  *
- * Return value: true if succeed or false otherwise
+ * Returns: TRUE on success, FALSE if an error occurred
  **/
 inline int hkl_parameter_value_set(HklParameter *self, double value,
-				    HklError **error)
-{
-	return self->ops->set_value(self, value, error);
-}
-
-/**
- * hkl_parameter_value_unit_set:
- * @self: the this ptr
- * @value: the value to set
- * @error: (allow-none): the error set if something goes wrong
- *
- * set the value of the parameter express in the punit #HklUnit
- * @todo test
- *
- * Return value: true if succeed or false otherwise
- **/
-inline int hkl_parameter_value_unit_set(HklParameter *self, double value,
-					 HklError **error)
+				   HklUnitEnum unit_type, GError **error)
 {
-	return self->ops->set_value_unit(self, value, error);
+	return self->ops->set_value(self, value, unit_type, error);
 }
 
 /**
@@ -210,64 +230,75 @@ inline void hkl_parameter_value_set_smallest_in_range(HklParameter *self)
 }
 
 /**
- * hkl_parameter_min_max_get: (skip)
- * @self:
- *
- * get the max value of the #HklParameter
+ * hkl_parameter_min_max_get:
+ * @self: the this ptr
+ * @min: (out caller-allocates): the returned minimum value
+ * @max: (out caller-allocates): the returned maximum value
+ * @unit_type: the unit type (default or user) of the returned values
  *
- **/
-void hkl_parameter_min_max_get(const HklParameter *self, double *min, double *max)
-{
-	*min = self->range.min;
-	*max = self->range.max;
-}
-
-/**
- * hkl_parameter_min_max_unit_get: (skip)
- * @self:
- * @min:
- * @max:
+ * get the min and max value of the #HklParameter
  *
- * get the #HklParameter range, min, max
- * @todo test
  **/
-void hkl_parameter_min_max_unit_get(const HklParameter *self, double *min, double *max)
+void hkl_parameter_min_max_get(const HklParameter *self, double *min, double *max,
+			       HklUnitEnum unit_type)
 {
-	double factor = hkl_unit_factor(self->unit, self->punit);
-
-	*min = factor * self->range.min;
-	*max = factor * self->range.max;
-}
-
-/**
- * hkl_parameter_min_max_set: (skip)
- * @self:
- * @min:
- * @max:
- *
- * set the #HklParameter range.
- * @todo test
- **/
-void hkl_parameter_min_max_set(HklParameter *self, double min, double max)
-{
-	self->range.min = min;
-	self->range.max = max;
+	double factor;
+
+	switch (unit_type){
+	case HKL_UNIT_DEFAULT:
+		*min = self->range.min;
+		*max = self->range.max;
+		break;
+	case HKL_UNIT_USER:
+		factor = hkl_unit_factor(self->unit, self->punit);
+		*min = factor * self->range.min;
+		*max = factor * self->range.max;
+		break;
+	}
 }
 
 /**
- * hkl_parameter_min_max_unit_set:
+ * hkl_parameter_min_max_set:
  * @self: the this ptr
  * @min: the minimum value to set
  * @max: the maximum value to set
+ * @unit_type: the unit type (default or user) of the min, max
+ * @error: return location for a GError, or NULL
  *
- * set the #HklParameter range express in the punit #HklUnit
- * @todo test
+ * set the #HklParameter range.
+ * @todo test and set the GError
+ *
+ * Returns: TRUE on success, FALSE if an error occurred
  **/
-void hkl_parameter_min_max_unit_set(HklParameter *self, double min, double max)
+int hkl_parameter_min_max_set(HklParameter *self, double min, double max,
+			      HklUnitEnum unit_type, GError **error)
 {
-	double factor = hkl_unit_factor(self->unit, self->punit);
-	self->range.min = min / factor;
-	self->range.max = max / factor;
+	double factor;
+
+	hkl_error (error == NULL || *error == NULL);
+
+	if (min > max){
+		g_set_error(error,
+			    HKL_PARAMETER_ERROR,
+			    HKL_PARAMETER_ERROR_MIN_MAX_SET,
+			    "can not set this range min > max\n");
+
+		return FALSE;
+	}
+
+	switch (unit_type){
+	case HKL_UNIT_DEFAULT:
+		self->range.min = min;
+		self->range.max = max;
+		break;
+	case HKL_UNIT_USER:
+		factor = hkl_unit_factor(self->unit, self->punit);
+		self->range.min = min / factor;
+		self->range.max = max / factor;
+		break;
+	}
+
+	return TRUE;
 }
 
 /**
@@ -346,127 +377,35 @@ void hkl_parameter_fprintf(FILE *f, HklParameter *self)
 			self->fit);
 }
 
-/********************/
-/* HklParameterList */
-/********************/
-
 /**
- * hkl_parameter_list_values_get: (skip)
+ * hkl_parameter_axis_v_get:
  * @self: the this ptr
- * @values: (array length=len): list of the paremetersc values.
- * @len: (out caller-allocates): the len of the returned list.
  *
- * get a list of all the #HklParameter values
+ * Returns: (allow-none):
  **/
-void hkl_parameter_list_values_get(const HklParameterList *self,
-				   double values[], unsigned int *len)
+const HklVector *hkl_parameter_axis_v_get(const HklParameter *self)
 {
-	for(unsigned int i; i<darray_size(*self); ++i)
-		values[i] = darray_item(*self, i)->_value;
-
-	*len = darray_size(*self);
+	return self->ops->axis_v_get(self);
 }
 
 /**
- * hkl_parameter_list_values_set:
+ * hkl_parameter_quaternion_get:
  * @self: the this ptr
- * @values: (array length=len): the values to set
- * @len: the length of the values
- * @error: error set if something goes wrong
- *
- * set the parameter list with the given values
  *
- * Return value: true if succeed or false otherwise
+ * Returns: (allow-none):
  **/
-unsigned int hkl_parameter_list_values_set(HklParameterList *self,
-					   double values[], unsigned int len,
-					   HklError **error)
+const HklQuaternion *hkl_parameter_quaternion_get(const HklParameter *self)
 {
-	unsigned int n = len < darray_size(*self) ? len : darray_size(*self);
-
-	for(unsigned int i=0; i<n; ++i)
-		if(!hkl_parameter_value_set(darray_item(*self, i),
-					    values[i], error))
-			return HKL_FALSE;
-
-	return HKL_TRUE;
+	return self->ops->quaternion_get(self);
 }
 
 /**
- * hkl_parameter_list_values_unit_get:
+ * hkl_parameter_description_get:
  * @self: the this ptr
- * @len: (out caller-allocates): the length of the returned array
  *
- * Return value: (array length=len) (transfer full): list of pseudo axes values with unit
- *               free the array with free when done
+ * Returns: the #HklParameter description
  **/
-double *hkl_parameter_list_values_unit_get(const HklParameterList *self,
-					   unsigned int *len)
+const char *hkl_parameter_description_get(const HklParameter *self)
 {
-	const unsigned int _len =  darray_size(*self);
-	double *values = (double *)malloc(sizeof(*values) * _len);
-
-	for(unsigned int i=0; i<_len; ++i)
-		values[i] = hkl_parameter_value_unit_get(darray_item(*self, i));
-	*len = _len;
-
-	return values;
-}
-
-/**
- * hkl_parameter_list_values_unit_set: (skip)
- * @self: the this ptr
- * @values: (array length=len): the values to set
- * @len: the length of the values
- * @error: error set if something goes wrong
- *
- * set the parameter list with the given values
- *
- * Return value: true if succeed or false otherwise
- **/
-unsigned int hkl_parameter_list_values_unit_set(HklParameterList *self,
-						double values[], unsigned int len,
-						HklError **error)
-{
-	for(unsigned int i=0; i<darray_size(*self); ++i)
-		if(!hkl_parameter_value_unit_set(
-			   darray_item(*self, i), values[i], error))
-			return HKL_FALSE;
-
-	return HKL_TRUE;
-}
-
-void hkl_parameter_list_free(HklParameterList *self)
-{
-	HklParameter **parameter;
-
-	darray_foreach(parameter, *self){
-		hkl_parameter_free(*parameter);
-	}
-	darray_free(*self);
-}
-
-void hkl_parameter_list_fprintf(FILE *f, const HklParameterList *self)
-{
-	HklParameter **parameter;
-
-	darray_foreach(parameter, *self){
-		fprintf(f, "\n     ");
-		hkl_parameter_fprintf(f, *parameter);
-	}
-}
-
-/**
- * hkl_parameter_list_randomize: (skip)
- * @self: the this ptr
- *
- * randomize all parameters of the list
- **/
-void hkl_parameter_list_randomize(HklParameterList *self)
-{
-	HklParameter **parameter;
-
-	darray_foreach(parameter, *self){
-		hkl_parameter_randomize(*parameter);
-	}
+	return self->description;
 }
diff --git a/hkl/hkl-pseudoaxis-auto-private.h b/hkl/hkl-pseudoaxis-auto-private.h
index a070ab7..a733399 100644
--- a/hkl/hkl-pseudoaxis-auto-private.h
+++ b/hkl/hkl-pseudoaxis-auto-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,29 +22,38 @@
 #ifndef __HKL_PSEUDOAXIS_AUTO_H__
 #define __HKL_PSEUDOAXIS_AUTO_H__
 
-#include <gsl/gsl_vector.h>
+#include <gsl/gsl_vector_double.h>      // for gsl_vector
+#include <stddef.h>                     // for NULL
+#include <sys/types.h>                  // for uint
+#include "hkl-detector-private.h"       // for hkl_detector_new_copy
+#include "hkl-geometry-private.h"       // for hkl_geometry_new_copy
+#include "hkl-macros-private.h"         // for hkl_assert, etc
+#include "hkl-pseudoaxis-private.h"     // for HklModeOperations, etc
+#include "hkl.h"                        // for HklMode, hkl_detector_free, etc
+#include "hkl/ccan/container_of/container_of.h"  // for container_of
+#include "hkl/ccan/array_size/array_size.h"  // ARRAY_SIZE
 
-#include "hkl/ccan/container_of/container_of.h"
-#include "hkl-detector-private.h"
-#include "hkl-error-private.h"
-#include "hkl-pseudoaxis-private.h"
-
-HKL_BEGIN_DECLS
+G_BEGIN_DECLS
 
 typedef struct _HklFunction HklFunction;
 typedef struct _HklModeAutoInfo HklModeAutoInfo;
 typedef struct _HklModeAutoWithInit HklModeAutoWithInit;
 
+/***************/
+/* HklModeAuto */
+/***************/
+
 struct _HklFunction
 {
 	const uint size;
 	int (* function) (const gsl_vector *x, void *params, gsl_vector *f);
 };
 
+typedef darray(const HklFunction*) darray_function;
+
 struct _HklModeAutoInfo {
-	const HklModeInfo mode;
-	const HklFunction **functions;
-	const uint n_functions;
+	const HklModeInfo info;
+	darray_function functions;
 };
 
 #define HKL_MODE_OPERATIONS_AUTO_DEFAULTS	\
@@ -54,30 +63,28 @@ struct _HklModeAutoInfo {
 #define CHECK_NAN(x, len) do{				\
 		for(uint i=0; i<len; ++i)		\
 			if(gsl_isnan(x[i]))		\
-				return GSL_ENOMEM;	\
+				return GSL_EINVAL;	\
 	}while(0)
 
-#define INFO_AUTO(name, axes, fn) .mode={INFO(name, axes),}, .functions=fn, .n_functions=ARRAY_SIZE(fn)
-#define INFO_AUTO_WITH_PARAMS(name, axes, fn, parameters) .mode={INFO_WITH_PARAMS(name, axes, parameters)}, .functions=fn, .n_functions=ARRAY_SIZE(fn)
+#define HKL_MODE_AUTO_INFO(_name, _axes_r, _axes_w, _fn) .info={HKL_MODE_INFO(_name, _axes_r, _axes_w),}, .functions=DARRAY(_fn)
 
-/***************/
-/* HklModeAuto */
-/***************/
+#define HKL_MODE_AUTO_INFO_WITH_PARAMS(_name, _axes_r, _axes_w, _fn, _parameters) .info={HKL_MODE_INFO_WITH_PARAMS(_name, _axes_r, _axes_w, _parameters)}, .functions=DARRAY(_fn)
 
-extern HklMode *hkl_mode_auto_new(
-	const HklModeAutoInfo *info,
-	const HklModeOperations *ops);
+extern HklMode *hkl_mode_auto_new(const HklModeAutoInfo *auto_info,
+				  const HklModeOperations *ops,
+				  int initialized);
 
-void hkl_mode_auto_init(HklMode *self,
-			const HklModeAutoInfo *info,
-			const HklModeOperations *ops);
+extern void hkl_mode_auto_init(HklMode *self,
+			       const HklModeAutoInfo *auto_info,
+			       const HklModeOperations *ops,
+			       int initialized);
 
 extern int hkl_mode_auto_set_real(HklMode *self,
 				  HklEngine *engine,
 				  HklGeometry *geometry,
 				  HklDetector *detector,
 				  HklSample *sample,
-				  HklError **error);
+				  GError **error);
 
 /***********************/
 /* HklModeAutoWithInit */
@@ -90,10 +97,22 @@ struct _HklModeAutoWithInit {
 	HklSample *sample;
 };
 
-#define HKL_MODE_OPERATIONS_AUTO_WITH_INIT_DEFAULTS		\
-	HKL_MODE_OPERATIONS_AUTO_DEFAULTS,			\
-		.free = hkl_mode_auto_with_init_free_real,	\
-		.init = hkl_mode_auto_with_init_init_real
+#define HKL_MODE_AUTO_WITH_INIT_ERROR hkl_mode_auto_with_init_error_quark ()
+
+static GQuark hkl_mode_auto_with_init_error_quark (void)
+{
+	return g_quark_from_static_string ("hkl-mode-auto-with-init-error-quark");
+}
+
+typedef enum {
+	HKL_MODE_AUTO_WITH_INIT_ERROR_INIT /* can not set the pseudo axis engine */
+} HklModeError;
+
+#define HKL_MODE_OPERATIONS_AUTO_WITH_INIT_DEFAULTS			\
+	HKL_MODE_OPERATIONS_AUTO_DEFAULTS,				\
+		.capabilities = HKL_ENGINE_CAPABILITIES_READABLE | HKL_ENGINE_CAPABILITIES_WRITABLE | HKL_ENGINE_CAPABILITIES_INITIALIZABLE, \
+		.free = hkl_mode_auto_with_init_free_real,		\
+		.initialized_set = hkl_mode_auto_with_init_initialized_set_real
 
 static void hkl_mode_auto_with_init_free_real(HklMode *mode)
 {
@@ -109,44 +128,46 @@ static void hkl_mode_auto_with_init_free_real(HklMode *mode)
 	hkl_mode_free_real(mode);
 }
 
-static int hkl_mode_auto_with_init_init_real(HklMode *mode,
-					     HklEngine *engine,
-					     HklGeometry *geometry,
-					     HklDetector *detector,
-					     HklSample *sample,
-					     HklError **error)
+
+static int hkl_mode_auto_with_init_initialized_set_real(HklMode *mode,
+							HklEngine *engine,
+							HklGeometry *geometry,
+							HklDetector *detector,
+							HklSample *sample,
+							int initialized,
+							GError **error)
 {
 	HklModeAutoWithInit *self = container_of(mode, HklModeAutoWithInit, mode);
 
-	hkl_return_val_if_fail(error == NULL || *error == NULL, HKL_FALSE);
-
-	if (!hkl_mode_init_real(mode, engine, geometry, detector, sample, error)){
-		hkl_error_set(error, "internal error");
+	hkl_error(error == NULL || *error == NULL);
+
+	if(initialized){
+		if(geometry){
+			if(self->geometry)
+				hkl_geometry_free(self->geometry);
+			self->geometry = hkl_geometry_new_copy(geometry);
+		}
+		if(detector){
+			if(self->detector)
+				hkl_detector_free(self->detector);
+			self->detector = hkl_detector_new_copy(detector);
+		}
+		if(sample){
+			if(self->sample)
+				hkl_sample_free(self->sample);
+			self->sample = hkl_sample_new_copy(sample);
+		}
 	}
-	hkl_assert(error == NULL || *error == NULL);
 
-	if(geometry){
-		if(self->geometry)
-			hkl_geometry_free(self->geometry);
-		self->geometry = hkl_geometry_new_copy(geometry);
-	}
-	if(detector){
-		if(self->detector)
-			hkl_detector_free(self->detector);
-		self->detector = hkl_detector_new_copy(detector);
-	}
-	if(sample){
-		if(self->sample)
-			hkl_sample_free(self->sample);
-		self->sample = hkl_sample_new_copy(sample);
-	}
+	mode->initialized = initialized;
 
-	return HKL_TRUE;
+	return TRUE;
 }
 
 extern HklMode *hkl_mode_auto_with_init_new(const HklModeAutoInfo *info,
-					    const HklModeOperations *ops);
+					    const HklModeOperations *ops,
+					    int initialized);
 
-HKL_END_DECLS
+G_END_DECLS
 
 #endif /* __HKL_PSEUDOAXIS_AUTO_H__ */
diff --git a/hkl/hkl-pseudoaxis-auto.c b/hkl/hkl-pseudoaxis-auto.c
index 908d557..10a985b 100644
--- a/hkl/hkl-pseudoaxis-auto.c
+++ b/hkl/hkl-pseudoaxis-auto.c
@@ -13,24 +13,45 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <string.h>
-#ifndef _MSC_VER
-# include <alloca.h>
-#endif
-#include <gsl/gsl_sf_trig.h>
-#include <gsl/gsl_multiroots.h>
-
-#include "hkl-pseudoaxis-auto-private.h"
-#include "hkl-error-private.h"
+#include <alloca.h>                     // for alloca
+#include <gsl/gsl_errno.h>              // for ::GSL_CONTINUE
+#include <gsl/gsl_machine.h>            // for GSL_SQRT_DBL_EPSILON
+#include <gsl/gsl_matrix_double.h>      // for gsl_matrix_alloc, etc
+#include <gsl/gsl_multiroots.h>         // for gsl_multiroot_function, etc
+#include <gsl/gsl_vector_double.h>      // for gsl_vector, etc
+#include <math.h>                       // for fabs, M_PI
+#include <stddef.h>                     // for size_t
+#include <stdlib.h>                     // for rand, RAND_MAX
+#include <string.h>                     // for NULL, memset, memcpy
+#include <sys/types.h>                  // for uint
+#include "hkl-geometry-private.h"       // for hkl_geometry_update
+#include "hkl-macros-private.h"         // for HKL_MALLOC, hkl_assert, etc
+#include "hkl-parameter-private.h"      // for _HklParameter
+#include "hkl-pseudoaxis-auto-private.h"  // for HklModeAutoInfo, etc
+#include "hkl-pseudoaxis-private.h"     // for _HklEngine, HklModeInfo, etc
+#include "hkl.h"                        // for HklEngine, HklMode, etc
+#include "hkl/ccan/container_of/container_of.h"  // for container_of
+#include "hkl/ccan/darray/darray.h"     // for darray_foreach
 
 /* #define DEBUG */
 
+#define HKL_MODE_AUTO_ERROR hkl_mode_auto_error_quark ()
+
+static GQuark hkl_mode_auto_error_quark (void)
+{
+	return g_quark_from_static_string ("hkl-mode-auto-error-quark");
+}
+
+typedef enum {
+	HKL_MODE_AUTO_ERROR_SET, /* can not set the engine */
+} HklModeAutoError;
+
 /*********************************************/
 /* methods use to solve numerical pseudoAxes */
 /*********************************************/
@@ -91,7 +112,7 @@ static void find_degenerated_axes(HklEngine *self,
  * If a solution was found it also check for degenerated axes.
  * A degenerated axes is an Axes with no effect on the function.
  * @see find_degenerated
- * @return HKL_TRUE or HKL_FALSE.
+ * @return TRUE or FALSE.
  */
 static int find_first_geometry(HklEngine *self,
 			       gsl_multiroot_function *f,
@@ -100,12 +121,12 @@ static int find_first_geometry(HklEngine *self,
 	gsl_multiroot_fsolver_type const *T;
 	gsl_multiroot_fsolver *s;
 	gsl_vector *x;
-	size_t len = self->mode->info->n_axes;
+	size_t len = darray_size(self->mode->info->axes_w);
 	double *x_data;
 	double *x_data0 = alloca(len * sizeof(*x_data0));
 	size_t iter = 0;
 	int status;
-	int res = HKL_FALSE;
+	int res = FALSE;
 	size_t i;
 	HklParameter **axis;
 
@@ -126,18 +147,47 @@ static int find_first_geometry(HklEngine *self,
 	s = gsl_multiroot_fsolver_alloc (T, len);
 	gsl_multiroot_fsolver_set (s, f, x);
 
+#ifdef DEBUG
+			fprintf(stdout, "Initial starting point: \n");
+			fprintf(stdout, "x: ");
+			for(i=0; i<len; ++i)
+				fprintf(stdout, " %.7f", s->x->data[i]);
+			fprintf(stdout, "\nf: ");
+			for(i=0; i<len; ++i)
+				fprintf(stdout, " %.7f", s->f->data[i]);
+#endif
+
 	/* iterate to find the solution */
 	do {
 		++iter;
 		status = gsl_multiroot_fsolver_iterate(s);
-		if (status || iter % 300 == 0) {
+#ifdef DEBUG
+		fprintf(stdout, "\nstatus : %d iter : %d\n", status, iter);
+#endif
+		if (status || (iter % 300) == 0) {
 			/* Restart from another point. */
 			for(i=0; i<len; ++i)
-				x_data[i] = (double)rand() / RAND_MAX * 180. / M_PI;
+				x_data[i] = (double)rand() / RAND_MAX / 180. * M_PI;
 			gsl_multiroot_fsolver_set(s, f, x);
 			gsl_multiroot_fsolver_iterate(s);
+#ifdef DEBUG
+			fprintf(stdout, "randomize the starting point: \n");
+			fprintf(stdout, "x: ");
+			for(i=0; i<len; ++i)
+				fprintf(stdout, " %.7f", s->x->data[i]);
+			fprintf(stdout, "\nf: ");
+			for(i=0; i<len; ++i)
+				fprintf(stdout, " %.7f", s->f->data[i]);
+#endif
 		}
-		status = gsl_multiroot_test_residual (s->f, HKL_EPSILON);
+		status = gsl_multiroot_test_residual (s->f, HKL_EPSILON / 10.);
+#ifdef DEBUG
+	fprintf(stdout, "\nstatus : %d iter : %d", status, iter);
+	for(i=0; i<len; ++i)
+		fprintf(stdout, " %.7f", s->f->data[i]);
+	fprintf(stdout, "\n");
+#endif
+
 	} while (status == GSL_CONTINUE && iter < 2000);
 
 #ifdef DEBUG
@@ -167,12 +217,13 @@ static int find_first_geometry(HklEngine *self,
 		darray_foreach(axis, self->axes){
 			hkl_parameter_value_set(*axis,
 						degenerated[i] ? x_data0[i] : x_data[i],
+						HKL_UNIT_DEFAULT,
 						NULL);
 			++i;
 		}
 
 		hkl_geometry_update(self->geometry);
-		res = HKL_TRUE;
+		res = TRUE;
 	}
 
 	/* release memory */
@@ -229,7 +280,7 @@ static int test_sector(gsl_vector const *x,
 		       gsl_multiroot_function *function,
 		       gsl_vector *f)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	size_t i;
 	double *f_data = f->data;
 
@@ -237,7 +288,7 @@ static int test_sector(gsl_vector const *x,
 
 	for(i=0; i<f->size; ++i)
 		if (fabs(f_data[i]) > HKL_EPSILON){
-			res = HKL_FALSE;
+			res = FALSE;
 			break;
 		}
 
@@ -251,7 +302,7 @@ static int test_sector(gsl_vector const *x,
 	for(i=0; i<f->size; ++i)
 		fprintf(stdout, "\t%f", gsl_sf_angle_restrict_symm(x->data[i]) * HKL_RADTODEG);
 
-	if(res == HKL_FALSE)
+	if(res == FALSE)
 		fprintf(stdout, "\t FAIL");
 	else
 		fprintf(stdout, "\t SUCCESS");
@@ -296,7 +347,7 @@ static void perm_r(size_t axes_len, size_t op_len[], int p[], size_t axes_idx,
  * @param self the current HklEngine
  * @param function The mode function
  *
- * @return HKL_TRUE or HKL_FALSE
+ * @return TRUE or FALSE
  *
  * This method find a first solution with a numerical method from the
  * GSL library (the multi root solver hybrid). Then it multiplicates the
@@ -345,28 +396,31 @@ static int solve_function(HklEngine *self,
 }
 
 /* check that the number of axis of the mode is the right number of variables expected by mode functions */
-static inline void check_validity(const HklModeAutoInfo *info)
+static inline void check_validity(const HklModeAutoInfo *auto_info)
 {
-	for(uint i=0; i<info->n_functions; ++i)
-		hkl_assert(info->functions[i]->size == info->mode.n_axes);
+	const HklFunction **function;
+	darray_foreach(function, auto_info->functions)
+		hkl_assert((*function)->size == darray_size(auto_info->info.axes_w));
 }
 
-HklMode *hkl_mode_auto_new(const HklModeAutoInfo *info,
-			   const HklModeOperations *ops)
+HklMode *hkl_mode_auto_new(const HklModeAutoInfo *auto_info,
+			   const HklModeOperations *ops,
+			   int initialized)
 {
-	check_validity(info);
+	check_validity(auto_info);
 
-	return hkl_mode_new(&info->mode, ops);
+	return hkl_mode_new(&auto_info->info, ops, initialized);
 
 }
 
 void hkl_mode_auto_init(HklMode *self,
-			const HklModeAutoInfo *info,
-			const HklModeOperations *ops)
+			const HklModeAutoInfo *auto_info,
+			const HklModeOperations *ops,
+			int initialized)
 {
-	check_validity(info);
+	check_validity(auto_info);
 
-	hkl_mode_init(self, &info->mode, ops);
+	hkl_mode_init(self, &auto_info->info, ops, initialized);
 
 }
 
@@ -375,40 +429,48 @@ int hkl_mode_auto_set_real(HklMode *self,
 			   HklGeometry *geometry,
 			   HklDetector *detector,
 			   HklSample *sample,
-			   HklError **error)
+			   GError **error)
 {
-	size_t i;
-	int ok = HKL_FALSE;
-	HklModeAutoInfo *info = container_of(self->info, HklModeAutoInfo, mode);
+	int ok = FALSE;
+	HklModeAutoInfo *auto_info = container_of(self->info, HklModeAutoInfo, info);
+	const HklFunction **function;
 
-	hkl_return_val_if_fail (error == NULL || *error == NULL, HKL_FALSE);
+	hkl_error (error == NULL || *error == NULL);
 
 	if(!self || !engine || !geometry || !detector || !sample){
-		hkl_error_set(error, "Internal error");
-		return HKL_FALSE;
+		g_set_error(error,
+			    HKL_MODE_AUTO_ERROR,
+			    HKL_MODE_AUTO_ERROR_SET,
+			    "Internal error");
+		return FALSE;
 	}
 
-	for(i=0;i<info->n_functions;++i)
-		ok |= solve_function(engine, info->functions[i]);
+	darray_foreach(function, auto_info->functions)
+		ok |= solve_function(engine, *function);
 
 	if(!ok){
-		hkl_error_set(error, "none of the functions were solved !!!");
-		return HKL_FALSE;
+		g_set_error(error,
+			    HKL_MODE_AUTO_ERROR,
+			    HKL_MODE_AUTO_ERROR_SET,
+			    "none of the functions were solved !!!");
+		return FALSE;
 	}
 
 #ifdef DEBUG
 	hkl_engine_fprintf(stdout, engine);
 #endif
 
-	return HKL_TRUE;
+	return TRUE;
 }
 
-HklMode *hkl_mode_auto_with_init_new(const HklModeAutoInfo *info,
-				     const HklModeOperations *ops)
+HklMode *hkl_mode_auto_with_init_new(const HklModeAutoInfo *auto_info,
+				     const HklModeOperations *ops,
+				     int initialized)
 {
 	HklModeAutoWithInit *self = HKL_MALLOC(HklModeAutoWithInit);
 
-	hkl_mode_auto_init(&self->mode, info, ops);
+	hkl_mode_auto_init(&self->mode, auto_info, ops, initialized);
+
 	self->geometry = NULL;
 	self->detector = NULL;
 	self->sample = NULL;
diff --git a/hkl/hkl-pseudoaxis-common-eulerians-private.h b/hkl/hkl-pseudoaxis-common-eulerians-private.h
index cbaf52e..55934d9 100644
--- a/hkl/hkl-pseudoaxis-common-eulerians-private.h
+++ b/hkl/hkl-pseudoaxis-common-eulerians-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,9 +22,10 @@
 #ifndef __HKL_PSEUDOAXIS_COMMON_EULERIANS_H__
 #define __HKL_PSEUDOAXIS_COMMON_EULERIANS_H__
 
-#include "hkl.h"
+#include "hkl.h"                        // for HklParameter, etc
+#include "hkl-pseudoaxis-auto-private.h"// for HklEngine
 
-HKL_BEGIN_DECLS
+G_BEGIN_DECLS
 
 typedef struct _HklEngineEulerians HklEngineEulerians;
 
@@ -38,6 +39,9 @@ struct _HklEngineEulerians
 
 extern HklEngine *hkl_engine_eulerians_new(void);
 
-HKL_END_DECLS
+extern void kappa_2_kappap(double komega, double kappa, double kphi, double alpha,
+			   double *komegap, double *kappap, double *kphip);
+
+G_END_DECLS
 
 #endif /* __HKL_PSEUDOAXIS_COMMON_EULERIANS_H__ */
diff --git a/hkl/hkl-pseudoaxis-common-eulerians.c b/hkl/hkl-pseudoaxis-common-eulerians.c
index 81c7b4f..ddce0f6 100644
--- a/hkl/hkl-pseudoaxis-common-eulerians.c
+++ b/hkl/hkl-pseudoaxis-common-eulerians.c
@@ -13,20 +13,37 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  *          Jens Krüger <Jens.Krueger at frm2.tum.de>
  */
-#include <gsl/gsl_sf_trig.h>
-#include "hkl/ccan/array_size/array_size.h"
-
-#include "hkl-error-private.h"
-#include "hkl-parameter-private.h"
-#include "hkl-pseudoaxis-auto-private.h"
+#include <gsl/gsl_sf_trig.h>            // for gsl_sf_angle_restrict_symm
+#include <math.h>                       // for sin, asin, M_PI_2, tan, etc
+#include <stdlib.h>                     // for free
+#include <sys/types.h>                  // for uint
+#include "hkl-geometry-private.h"
+#include "hkl-macros-private.h"         // for HKL_MALLOC
+#include "hkl-parameter-private.h"      // for _HklParameter, etc
 #include "hkl-pseudoaxis-common-eulerians-private.h"
+#include "hkl-pseudoaxis-private.h"     // for _HklPseudoAxis, etc
+#include "hkl.h"                        // for HklParameter, HklPseudoAxis, etc
+#include "hkl/ccan/array_size/array_size.h"  // for ARRAY_SIZE
+#include "hkl/ccan/container_of/container_of.h"  // for container_of
+#include "hkl/ccan/darray/darray.h"     // for darray_item
+
+#define HKL_MODE_EULERIANS_ERROR hkl_mode_eulerians_error_quark ()
+
+static GQuark hkl_mode_eulerians_error_quark (void)
+{
+	return g_quark_from_static_string ("hkl-mode-eulerians-error-quark");
+}
+
+typedef enum {
+	HKL_MODE_EULERIANS_ERROR_SET, /* can not set the engine */
+} HklModeEuleriansError;
 
 static int kappa_to_eulerian(const double angles[],
 			     double *omega, double *chi, double *phi,
@@ -47,14 +64,14 @@ static int kappa_to_eulerian(const double angles[],
 		*phi = kphi + p - M_PI_2;
 	}
 
-	return HKL_TRUE;
+	return TRUE;
 }
 
 static int eulerian_to_kappa(const double omega, const double chi, const double phi,
 			     double angles[],
 			     double alpha, double solution)
 {
-	int status = HKL_TRUE;
+	int status = TRUE;
 	double *komega = &angles[0];
 	double *kappa = &angles[1];
 	double *kphi = &angles[2];
@@ -72,30 +89,50 @@ static int eulerian_to_kappa(const double omega, const double chi, const double
 			*kphi = phi + p + M_PI_2;
 		}
 	}else
-		status = HKL_FALSE;
+		status = FALSE;
 
 	return status;
 }
 
-/***************************/
+void kappa_2_kappap(double komega, double kappa, double kphi, double alpha,
+		    double *komegap, double *kappap, double *kphip)
+{
+	double p;
+	double omega;
+	double phi;
+
+	p = atan(tan(kappa/2.) * cos(alpha));
+	omega = komega + p - M_PI_2;
+	phi = kphi + p + M_PI_2;
+
+	*komegap = gsl_sf_angle_restrict_symm(2*omega - komega);
+	*kappap = -kappa;
+	*kphip = gsl_sf_angle_restrict_symm(2*phi - kphi);
+
+}
+
+/***********/
 /* HklMode */
-/***************************/
+/***********/
 
 static int hkl_mode_get_eulerians_real(HklMode *self,
 				       HklEngine *engine,
 				       HklGeometry *geometry,
 				       HklDetector *detector,
 				       HklSample *sample,
-				       HklError **error)
+				       GError **error)
 {
 	HklEngineEulerians *eulerians;
 	const double angles[] = {
 		hkl_parameter_value_get(
-			hkl_geometry_get_axis_by_name(geometry, "komega")),
+			hkl_geometry_get_axis_by_name(geometry, "komega"),
+			HKL_UNIT_DEFAULT),
 		hkl_parameter_value_get(
-			hkl_geometry_get_axis_by_name(geometry, "kappa")),
+			hkl_geometry_get_axis_by_name(geometry, "kappa"),
+			HKL_UNIT_DEFAULT),
 		hkl_parameter_value_get(
-			hkl_geometry_get_axis_by_name(geometry, "kphi")),
+			hkl_geometry_get_axis_by_name(geometry, "kphi"),
+			HKL_UNIT_DEFAULT),
 	};
 	double values[3];
 	double solution;
@@ -112,7 +149,7 @@ static int hkl_mode_get_eulerians_real(HklMode *self,
 			  &eulerians->phi->_value,
 			  50 * HKL_DEGTORAD, solution);
 
-	return HKL_TRUE;
+	return TRUE;
 }
 
 static int hkl_mode_set_eulerians_real(HklMode *self,
@@ -120,10 +157,9 @@ static int hkl_mode_set_eulerians_real(HklMode *self,
 				       HklGeometry *geometry,
 				       HklDetector *detector,
 				       HklSample *sample,
-				       HklError **error)
+				       GError **error)
 {
 	double solution;
-	uint n_values = engine->info->n_pseudo_axes;
 	HklEngineEulerians *engine_eulerians;
 	double angles[3];
 
@@ -133,12 +169,15 @@ static int hkl_mode_set_eulerians_real(HklMode *self,
 			      engine_eulerians->chi->_value,
 			      engine_eulerians->phi->_value,
 			      angles, 50 * HKL_DEGTORAD, solution)){
-		hkl_error_set(error, "unreachable solution : 0° < chi < 50°");
-		return HKL_FALSE;
+		g_set_error(error,
+			    HKL_MODE_EULERIANS_ERROR,
+			    HKL_MODE_EULERIANS_ERROR_SET,
+			    "unreachable solution : 0° < chi < 50°");
+		return FALSE;
 	}else
 		hkl_engine_add_geometry(engine, angles);
 
-	return HKL_TRUE;
+	return TRUE;
 }
 
 
@@ -147,23 +186,26 @@ static HklMode *mode_eulerians()
 	HklMode *mode;
 	static const char *axes[] = {"komega", "kappa", "kphi"};
 	static const HklParameter parameters[] = {
-		{ HKL_PARAMETER_DEFAULTS, .name = "solution", .range = {.max = 1}, ._value = 1,},
+		{ HKL_PARAMETER_DEFAULTS,.name = "solutions", ._value = 1,
+		  .description = "(0/1) to select the first or second solution",
+		  .range = { .max = 1 },
+		},
 	};
 	static const HklModeInfo info = {
-		INFO_WITH_PARAMS("eulerians", axes, parameters),
+		HKL_MODE_INFO_WITH_PARAMS("eulerians", axes, axes, parameters),
 	};
 	static const HklModeOperations operations = {
 		HKL_MODE_OPERATIONS_DEFAULTS,
 		.get = hkl_mode_get_eulerians_real,
 		.set = hkl_mode_set_eulerians_real,
 	};
-
-	return hkl_mode_new(&info, &operations);
+ 
+	return hkl_mode_new(&info, &operations, TRUE);
 };
 
-/***********************/
+/*************/
 /* HklEngine */
-/***********************/
+/*************/
 
 static void hkl_engine_eulerians_free_real(HklEngine *base)
 {
@@ -179,19 +221,24 @@ HklEngine *hkl_engine_eulerians_new(void)
 	HklEngineEulerians *self;
 	HklMode *mode;
 	static const HklPseudoAxis omega = {
-		.parameter = { HKL_PARAMETER_DEFAULTS_ANGLE, .name = "omega"}
+		.parameter = { HKL_PARAMETER_DEFAULTS_ANGLE, .name = "omega",
+			       .description = "omega equivalent for a four circle eulerian geometry",
+		}
 	};
 	static const HklPseudoAxis chi = {
-		.parameter = { HKL_PARAMETER_DEFAULTS_ANGLE, .name = "chi"}
+		.parameter = { HKL_PARAMETER_DEFAULTS_ANGLE, .name = "chi",
+			       .description = "chi equivalent for a four circle eulerian geometry",
+		}
 	};
 	static const HklPseudoAxis phi = {
-		.parameter = {HKL_PARAMETER_DEFAULTS_ANGLE, .name = "phi"}
+		.parameter = { HKL_PARAMETER_DEFAULTS_ANGLE, .name = "phi",
+			       .description = "phi equivalent for a four circle eulerian geometry",
+		}
 	};
 	static const HklPseudoAxis *pseudo_axes[] = {&omega, &chi, &phi};
 	static HklEngineInfo info = {
 		.name = "eulerians",
-		.pseudo_axes = pseudo_axes,
-		.n_pseudo_axes = ARRAY_SIZE(pseudo_axes),
+		.pseudo_axes = DARRAY(pseudo_axes),
 	};
 	static HklEngineOperations operations = {
 		HKL_ENGINE_OPERATIONS_DEFAULTS,
@@ -209,7 +256,7 @@ HklEngine *hkl_engine_eulerians_new(void)
 	/* eulerians [default] */
 	mode = mode_eulerians();
 	hkl_engine_add_mode(&self->engine, mode);
-	hkl_engine_select_mode(&self->engine, mode);
+	hkl_engine_mode_set(&self->engine, mode);
 
 	return &self->engine;
 }
diff --git a/hkl/hkl-pseudoaxis-common-hkl-private.h b/hkl/hkl-pseudoaxis-common-hkl-private.h
index 6f93b40..4d5bbd6 100644
--- a/hkl/hkl-pseudoaxis-common-hkl-private.h
+++ b/hkl/hkl-pseudoaxis-common-hkl-private.h
@@ -13,15 +13,17 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  *          Maria-Teresa Nunez-Pardo-de-Verra <tnunez at mail.desy.de>
  */
-#include <gsl/gsl_vector.h>
+#include <gsl/gsl_vector_double.h>      // for gsl_vector
 #include "hkl-pseudoaxis-auto-private.h"
+#include "hkl-pseudoaxis-private.h"     // for HklModeOperations, etc
+#include "hkl.h"                        // for HklEngine, HklDetector, etc
 
 typedef struct _HklEngineHkl HklEngineHkl;
 struct _HklEngineHkl {
@@ -38,39 +40,27 @@ extern int _psi_constant_vertical_func(const gsl_vector *x, void *params, gsl_ve
 extern int RUBh_minus_Q(double const x[], void *params, double f[]);
 extern int _double_diffraction(double const x[], void *params, double f[]);
 
-/**
- * @brief Standard getter for the hkl pseudoAxis.
- *
- * @param self
- * @param geometry
- * @param detector
- * @param sample
- *
- * @return the status of the getter method.
- *
- * This method can be used with all geometries of diffractometers
- * in getter/setter.
- */
 extern int hkl_mode_get_hkl_real(HklMode *self,
 				 HklEngine *engine,
 				 HklGeometry *geometry,
 				 HklDetector *detector,
 				 HklSample *sample,
-				 HklError **error);
+				 GError **error);
 
 extern int hkl_mode_set_hkl_real(HklMode *self,
 				 HklEngine *engine,
 				 HklGeometry *geometry,
 				 HklDetector *detector,
 				 HklSample *sample,
-				 HklError **error);
+				 GError **error);
 
-extern int hkl_mode_init_psi_constant_vertical_real(HklMode *base,
-						    HklEngine *engine,
-						    HklGeometry *geometry,
-						    HklDetector *detector,
-						    HklSample *sample,
-						    HklError **error);
+extern int hkl_mode_initialized_set_psi_constant_vertical_real(HklMode *base,
+							       HklEngine *engine,
+							       HklGeometry *geometry,
+							       HklDetector *detector,
+							       HklSample *sample,
+							       int initialized,
+							       GError **error);
 
 extern HklEngine *hkl_engine_hkl_new(void);
 
@@ -89,7 +79,9 @@ static const HklModeOperations hkl_full_mode_operations = {
 
 static const HklModeOperations psi_constant_vertical_mode_operations = {
 	HKL_MODE_OPERATIONS_HKL_DEFAULTS,
-	.init = hkl_mode_init_psi_constant_vertical_real,
+	.capabilities = HKL_ENGINE_CAPABILITIES_READABLE | HKL_ENGINE_CAPABILITIES_WRITABLE | HKL_ENGINE_CAPABILITIES_INITIALIZABLE,
+	.initialized_set = hkl_mode_initialized_set_psi_constant_vertical_real,
+	.set = hkl_mode_set_hkl_real,
 };
 
 static const HklModeOperations constant_incidence_mode_operations = {
@@ -112,3 +104,83 @@ static const HklFunction psi_constant_vertical_func = {
 	.function = _psi_constant_vertical_func,
 	.size = 4,
 };
+
+/* mode parameters */
+
+#define CONSTANT_PARAMETER(_name)				\
+	{							\
+		HKL_PARAMETER_DEFAULTS_ANGLE, .name = #_name,	\
+			.description = "the freezed value",	\
+			}
+
+#define PSI_CONSTANT_PARAMETERS(_h2, _k2, _l2, _psi)			\
+	{								\
+		HKL_PARAMETER_DEFAULTS, .name = "h2", ._value = _h2,	\
+			.description = "h coordinate of the reference plan", \
+			.range = { .min=-1, .max=1 },			\
+			},						\
+	{								\
+		HKL_PARAMETER_DEFAULTS, .name = "k2", ._value = _k2,	\
+			.description = "k coordinate of the reference plan", \
+			.range = { .min=-1, .max=1 },			\
+			},						\
+	{								\
+		HKL_PARAMETER_DEFAULTS, .name = "l2", ._value = _l2,	\
+			.description = "l coordinate of the reference plan", \
+			.range = { .min=-1, .max=1 },			\
+			},						\
+	{								\
+		HKL_PARAMETER_DEFAULTS_ANGLE, .name = "psi", ._value = _psi, \
+			.description = "expected angle between the reference and the diffraction plans", \
+			}
+
+static const HklParameter constant_omega_parameters[] = { CONSTANT_PARAMETER(omega) };
+static const HklParameter constant_chi_parameters[] = { CONSTANT_PARAMETER(chi) };
+static const HklParameter constant_phi_parameters[] = { CONSTANT_PARAMETER(phi) };
+
+/* outside the mode because used in more than one mode */
+static const HklParameter double_diffraction_parameters[] = {
+	{
+		HKL_PARAMETER_DEFAULTS, .name = "h2", ._value = 1,
+		.description = "h coordinate of the second diffracting plan",
+		.range = {.min=-1, .max=1},
+	},
+	{
+		HKL_PARAMETER_DEFAULTS, .name = "k2", ._value = 1,
+		.description = "k coordinate of the second diffracting plan",
+		.range = {.min=-1, .max=1},
+	},
+	{
+		HKL_PARAMETER_DEFAULTS, .name = "l2", ._value = 1,
+		.description = "l coordinate of the second diffracting plan",
+		.range = {.min=-1, .max=1},
+	},
+};
+
+static const HklParameter psi_constant_parameters[] = { PSI_CONSTANT_PARAMETERS(1, 1, 1, 0) };
+
+static const HklParameter constant_incidence_parameters[] = {
+	{
+		HKL_PARAMETER_DEFAULTS, .name = "x", ._value = 1,
+		.description = "the x coordinate of the surface $\\vec{n}$",
+		.range = { .min=-1, .max=1 },
+	},
+	{
+		HKL_PARAMETER_DEFAULTS, .name = "y", ._value = 1,
+		.description = "the y coordinate of the surface $\\vec{n}$",
+		.range = { .min=-1, .max=1 },
+	},
+	{
+		HKL_PARAMETER_DEFAULTS, .name = "z", ._value = 1,
+		.description = "the z coordinate of the surface $\\vec{n}$",
+		.range = { .min=-1, .max=1 },
+	},
+	{
+		HKL_PARAMETER_DEFAULTS_ANGLE, .name = "incidence",
+		.description = "expected incidence of the incoming beam $\\vec{k_i}$ on the surface."
+	},
+	{
+		HKL_PARAMETER_DEFAULTS_ANGLE, .name = "azimuth", ._value = M_PI_2,
+		.description = "expected azimuth",
+	},
+};
diff --git a/hkl/hkl-pseudoaxis-common-hkl.c b/hkl/hkl-pseudoaxis-common-hkl.c
index d706c01..0557035 100644
--- a/hkl/hkl-pseudoaxis-common-hkl.c
+++ b/hkl/hkl-pseudoaxis-common-hkl.c
@@ -13,24 +13,40 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  *          Maria-Teresa Nunez-Pardo-de-Verra <tnunez at mail.desy.de>
  */
-#include <string.h>
-#include <gsl/gsl_sf_trig.h>
+#include <gsl/gsl_errno.h>              // for ::GSL_SUCCESS, etc
 #include <gsl/gsl_multiroots.h>
-#include "hkl/ccan/array_size/array_size.h"
-
-#include "hkl-axis-private.h"
-#include "hkl-error-private.h"
-#include "hkl-parameter-private.h"
-#include "hkl-pseudoaxis-auto-private.h"
-#include "hkl-pseudoaxis-common-hkl-private.h"
-#include "hkl-sample-private.h"
+#include <gsl/gsl_sf_trig.h>            // for gsl_sf_angle_restrict_pos
+#include <gsl/gsl_vector_double.h>      // for gsl_vector, etc
+#include <math.h>                       // for fabs, M_PI
+#include <stddef.h>                     // for size_t
+#include <stdlib.h>                     // for free, malloc, rand, etc
+#include <string.h>                     // for NULL
+#include <sys/types.h>                  // for uint
+#include "hkl-axis-private.h"           // for HklAxis
+#include "hkl-detector-private.h"       // for hkl_detector_compute_kf
+#include "hkl-geometry-private.h"       // for HklHolder, _HklGeometry, etc
+#include "hkl-macros-private.h"         // for hkl_assert, HKL_MALLOC, etc
+#include "hkl-matrix-private.h"         // for hkl_matrix_times_vector, etc
+#include "hkl-parameter-private.h"      // for _HklParameter, etc
+#include "hkl-pseudoaxis-auto-private.h"  // for CHECK_NAN, etc
+#include "hkl-pseudoaxis-common-hkl-private.h"  // for HklEngineHkl
+#include "hkl-pseudoaxis-common-q-private.h"  // for HklEngineHkl
+#include "hkl-pseudoaxis-private.h"     // for _HklEngine, _HklMode, etc
+#include "hkl-quaternion-private.h"     // for hkl_quaternion_init, etc
+#include "hkl-sample-private.h"         // for _HklSample
+#include "hkl-source-private.h"         // for hkl_source_compute_ki
+#include "hkl-vector-private.h"         // for HklVector, etc
+#include "hkl.h"                        // for HklEngine, HklGeometry, etc
+#include "hkl/ccan/array_size/array_size.h"  // for ARRAY_SIZE
+#include "hkl/ccan/container_of/container_of.h"  // for container_of
+#include "hkl/ccan/darray/darray.h"     // for darray_item, darray_size
 
 /* #define DEBUG */
 
@@ -60,7 +76,8 @@ static int fit_detector_function(const gsl_vector *x, void *params, gsl_vector *
 	/* update the workspace from x; */
 	for(i=0; i<fitp->len; ++i)
 		hkl_parameter_value_set(fitp->axes[i],
-					x->data[i], NULL);
+					x->data[i], 
+					HKL_UNIT_DEFAULT, NULL);
 
 	hkl_geometry_update(fitp->geometry);
 
@@ -91,14 +108,14 @@ static int fit_detector_function(const gsl_vector *x, void *params, gsl_vector *
 static int fit_detector_position(HklMode *mode, HklGeometry *geometry,
 				 HklDetector *detector, HklVector *kf)
 {
-	size_t i;
+	const char **axis_name;
 	HklDetectorFit params;
 	gsl_multiroot_fsolver_type const *T;
 	gsl_multiroot_fsolver *s;
 	gsl_multiroot_function f;
 	gsl_vector *x;
 	int status;
-	int res = HKL_FALSE;
+	int res = FALSE;
 	int iter;
 	HklHolder *sample_holder = darray_item(geometry->holders, 0);
 	HklHolder *detector_holder = darray_item(geometry->holders, 1);
@@ -115,11 +132,11 @@ static int fit_detector_position(HklMode *mode, HklGeometry *geometry,
 	params.axes = malloc(sizeof(*params.axes) * detector_holder->config->len);
 	params.len = 0;
 	/* for each axis of the mode */
-	for(i=0; i<mode->info->n_axes; ++i){
+	darray_foreach(axis_name, mode->info->axes_w){
 		size_t k;
 		size_t tmp;
 
-		tmp = hkl_geometry_get_axis_idx_by_name(params.geometry, mode->info->axes[i]);
+		tmp = hkl_geometry_get_axis_idx_by_name(params.geometry, *axis_name);
 		/* check that this axis is in the detector's holder */
 		for(k=0; k<detector_holder->config->len; ++k)
 			if(tmp == detector_holder->config->idx[k]){
@@ -141,6 +158,8 @@ static int fit_detector_position(HklMode *mode, HklGeometry *geometry,
 	/* if no detector axis found ???? abort */
 	/* maybe put this at the begining of the method */
 	if (params.len > 0){
+		size_t i;
+
 		/* now solve the system */
 		/* Initialize method  */
 		T = gsl_multiroot_fsolver_hybrid;
@@ -149,7 +168,7 @@ static int fit_detector_position(HklMode *mode, HklGeometry *geometry,
 
 		/* initialize x with the right values */
 		for(i=0; i<params.len; ++i)
-			x->data[i] = hkl_parameter_value_get(params.axes[i]);
+			x->data[i] = hkl_parameter_value_get(params.axes[i], HKL_UNIT_DEFAULT);
 
 		f.f = fit_detector_function;
 		f.n = params.len;
@@ -186,16 +205,16 @@ static int fit_detector_position(HklMode *mode, HklGeometry *geometry,
 		hkl_geometry_fprintf(stdout, params.geometry);
 #endif
 		if(status != GSL_CONTINUE){
-			res = HKL_TRUE;
+			res = TRUE;
 			/* put the axes in the -pi, pi range. */
 			for(i=0; i<params.len; ++i){
 				double value;
 
-				value = hkl_parameter_value_get(params.axes[i]);
+				value = hkl_parameter_value_get(params.axes[i], HKL_UNIT_DEFAULT);
 				/* TODO one day deal with the error for real */
 				hkl_parameter_value_set(params.axes[i],
 							gsl_sf_angle_restrict_pos(value),
-							NULL);
+							HKL_UNIT_DEFAULT, NULL);
 			}
 		}
 		/* release memory */
@@ -209,30 +228,54 @@ static int fit_detector_position(HklMode *mode, HklGeometry *geometry,
 
 /* get the highest index of the axis in a holder */
 /* BEWARE, NOT the axis index in the geometry->axes */
-/* which is part of the axes_names of the mode */
+/* which is part of the axis_names of the mode */
 /* return -1 if there is no axes of the mode in the sample part of the geometry */
-static int get_last_axis_idx(HklGeometry *geometry, int holder_idx, char const **axes_names, int len)
+static int get_last_axis_idx(HklGeometry *geometry, int holder_idx, const darray_string *axes)
 {
 	int last = -1;
-	int i;
+	const char **axis_name;
 	HklHolder *holder;
 
 	holder = darray_item(geometry->holders, holder_idx);
-	for(i=0; i<len; ++i){
-		size_t j;
+	darray_foreach(axis_name, *axes){
+		size_t i;
 		size_t idx;
 
 		/* FIXME for now the sample holder is the first one */
-		idx = hkl_geometry_get_axis_idx_by_name(geometry, axes_names[i]);
-		for(j=0; j<holder->config->len; ++j)
-			if(idx == holder->config->idx[j]){
-				last = last > (int)j ? last : (int)j;
+		idx = hkl_geometry_get_axis_idx_by_name(geometry, *axis_name);
+		for(i=0; i<holder->config->len; ++i)
+			if(idx == holder->config->idx[i]){
+				last = last > (int)i ? last : (int)i;
 				break;
 			}
 	}
 	return last;
 }
 
+
+static int hkl_is_reachable(HklEngine *engine, double wavelength, GError **error)
+{
+	HklEngineHkl *engine_hkl = container_of(engine, HklEngineHkl, engine);
+	HklVector Hkl = {
+		.data = {
+			engine_hkl->h->_value,
+			engine_hkl->k->_value,
+			engine_hkl->l->_value,
+		},
+	};
+
+	hkl_matrix_times_vector(&engine->sample->UB, &Hkl);
+	if (hkl_vector_norm2(&Hkl) > qmax(wavelength)){
+		g_set_error(error,
+			    HKL_ENGINE_ERROR,
+			    HKL_ENGINE_ERROR_SET,
+			    "unreachable hkl, try to change the wavelength");
+		return FALSE;
+	}
+
+	return TRUE;
+}
+
 /**
  * RUBh_minus_Q_func: (skip)
  * @x:
@@ -247,9 +290,7 @@ int _RUBh_minus_Q_func(const gsl_vector *x, void *params, gsl_vector *f)
 {
 	CHECK_NAN(x->data, x->size);
 
-	RUBh_minus_Q(x->data, params, f->data);
-
-	return  GSL_SUCCESS;
+	return RUBh_minus_Q(x->data, params, f->data);
 }
 
 /**
@@ -304,7 +345,7 @@ int hkl_mode_get_hkl_real(HklMode *self,
 			  HklGeometry *geometry,
 			  HklDetector *detector,
 			  HklSample *sample,
-			  HklError **error)
+			  GError **error)
 {
 	HklHolder *sample_holder;
 	HklMatrix RUB;
@@ -331,7 +372,7 @@ int hkl_mode_get_hkl_real(HklMode *self,
 	engine_hkl->k->_value = hkl.data[1];
 	engine_hkl->l->_value = hkl.data[2];
 
-	return HKL_TRUE;
+	return TRUE;
 }
 
 int hkl_mode_set_hkl_real(HklMode *self,
@@ -339,27 +380,37 @@ int hkl_mode_set_hkl_real(HklMode *self,
 			  HklGeometry *geometry,
 			  HklDetector *detector,
 			  HklSample *sample,
-			  HklError **error)
+			  GError **error)
 {
 	int last_axis;
 
-	hkl_return_val_if_fail (error == NULL || *error == NULL, HKL_FALSE);
+	hkl_error (error == NULL || *error == NULL);
 
+	/* check the input parameters */
+	if(!hkl_is_reachable(engine, geometry->source.wave_length,
+			     error)){
+		hkl_assert(error == NULL || *error != NULL);
+		return FALSE;
+	}
+	hkl_assert(error == NULL || *error == NULL);
+
+	/* compute the mode */
 	if(!hkl_mode_auto_set_real(self, engine,
 				   geometry, detector, sample,
 				   error)){
 		hkl_assert(error == NULL || *error != NULL);
 		//fprintf(stdout, "message :%s\n", (*error)->message);
-		return HKL_FALSE;
+		return FALSE;
 	}
 	hkl_assert(error == NULL || *error == NULL);
 
 	/* check that the mode allow to move a sample axis */
 	/* FIXME for now the sample holder is the first one */
-	last_axis = get_last_axis_idx(geometry, 0, self->info->axes, self->info->n_axes);
+	last_axis = get_last_axis_idx(geometry, 0, &self->info->axes_w);
 	if(last_axis >= 0){
 		uint i;
-		uint len = darray_size(engine->engines->geometries->items);
+		const HklGeometryListItem *item;
+		uint len = engine->engines->geometries->n_items;
 
 		/* For each solution already found we will generate another one */
 		/* using the Ewalds construction by rotating Q around the last sample */
@@ -380,9 +431,10 @@ int hkl_mode_set_hkl_real(HklMode *self,
 		/* at the end we just need to solve numerically the position of the detector */
 
 		/* we will add solution to the geometries so save its length before */
-		for(i=0; i<len; ++i){
+		for(i=0, item=list_top(&engine->engines->geometries->items, HklGeometryListItem, list);
+		    i<len;
+		    ++i, item=list_next(&engine->engines->geometries->items, item, list)){
 			int j;
-			HklGeometry *geom;
 			HklVector ki;
 			HklVector kf;
 			HklVector kf2;
@@ -393,8 +445,9 @@ int hkl_mode_set_hkl_real(HklMode *self,
 			HklVector cp = {0};
 			HklVector op = {0};
 			double angle;
+			HklGeometry *geom;
 
-			geom = hkl_geometry_new_copy(darray_item(engine->engines->geometries->items, i)->geometry);
+			geom = hkl_geometry_new_copy(item->geometry);
 
 			/* get the Q vector kf - ki */
 			hkl_detector_compute_kf(detector, geom, &q);
@@ -426,9 +479,9 @@ int hkl_mode_set_hkl_real(HklMode *self,
 			angle = hkl_vector_oriented_angle_points(&q, &op, &kf2, &axis_v);
 			/* TODO parameter list for geometry */
 			if(!hkl_parameter_value_set(&axis->parameter,
-						    hkl_parameter_value_get(&axis->parameter) + angle,
-						    error))
-				return HKL_FALSE;
+						    hkl_parameter_value_get(&axis->parameter, HKL_UNIT_DEFAULT) + angle,
+						    HKL_UNIT_DEFAULT, error))
+				return FALSE;
 			hkl_geometry_update(geom);
 #ifdef DEBUG
 			fprintf(stdout, "\n- try to add a solution by rotating Q <%f, %f, %f> around the \"%s\" axis <%f, %f, %f> of %f radian",
@@ -440,14 +493,16 @@ int hkl_mode_set_hkl_real(HklMode *self,
 			fprintf(stdout, "\n   q2: <%f, %f, %f>", kf2.data[0], kf2.data[1], kf2.data[2]);
 #endif
 			hkl_vector_add_vector(&kf2, &ki);
+
 			/* at the end we just need to solve numerically the position of the detector */
 			if(fit_detector_position(self, geom, detector, &kf2))
-				hkl_geometry_list_add(engine->engines->geometries, geom);
+				hkl_geometry_list_add(engine->engines->geometries,
+						      geom);
 
 			hkl_geometry_free(geom);
 		}
 	}
-	return HKL_TRUE;
+	return TRUE;
 }
 
 /***************************************/
@@ -590,7 +645,7 @@ int _psi_constant_vertical_func(gsl_vector const *x, void *params, gsl_vector *f
 
 		/* project hkl on the plan of normal Q */
 		hkl_vector_project_on_plan(&hkl, &Q);
-#if DEBUG
+#ifdef DEBUG
 		fprintf(stdout, "\n");
 		hkl_geometry_fprintf(stdout, engine->geometry);
 		fprintf(stdout, "\n");
@@ -608,80 +663,95 @@ int _psi_constant_vertical_func(gsl_vector const *x, void *params, gsl_vector *f
 	return  GSL_SUCCESS;
 }
 
-int hkl_mode_init_psi_constant_vertical_real(HklMode *self,
-					     HklEngine *engine,
-					     HklGeometry *geometry,
-					     HklDetector *detector,
-					     HklSample *sample,
-					     HklError **error)
+#define HKL_MODE_PSI_CONSTANT_VERTICAL_ERROR hkl_mode_psi_constant_vertical_error_quark ()
+
+static GQuark hkl_mode_psi_constant_vertical_error_quark (void)
+{
+	return g_quark_from_static_string ("hkl-mode-psi-constant-vertical-error-quark");
+}
+
+typedef enum {
+	HKL_MODE_PSI_CONSTANT_VERTICAL_ERROR_INITIALIZED_SET, /* can not init the engine */
+} HklModePsiConstantVerticalError;
+
+int hkl_mode_initialized_set_psi_constant_vertical_real(HklMode *self,
+							HklEngine *engine,
+							HklGeometry *geometry,
+							HklDetector *detector,
+							HklSample *sample,
+							int initialized,
+							GError **error)
 {
 	HklVector hkl;
 	HklVector ki, kf, Q, n;
 
-	if (!self || !engine || !engine->mode || !geometry || !detector || !sample
-	    || !hkl_mode_init_real(self, engine, geometry, detector, sample, error)){
-		hkl_error_set(error, "internal error");
-		return HKL_FALSE;
-	}
-
-	/* kf - ki = Q */
-	hkl_source_compute_ki(&geometry->source, &ki);
-	hkl_detector_compute_kf(detector, geometry, &kf);
-	Q = kf;
-	hkl_vector_minus_vector(&Q, &ki);
-
-	if (hkl_vector_is_null(&Q)){
-		hkl_error_set(error, "can not initialize the \"%s\" mode with a null hkl (kf == ki)"
-			      "\nplease select a non-null hkl", engine->mode->info->name);
-		return HKL_FALSE;
-	}else{
-		/* needed for a problem of precision */
-		hkl_vector_normalize(&Q);
-
-		/* compute the intersection of the plan P(kf, ki) and PQ (normal Q) */
-		n = kf;
-		hkl_vector_vectorial_product(&n, &ki);
-		hkl_vector_vectorial_product(&n, &Q);
-
-		/* compute hkl in the laboratory referentiel */
-		/* the geometry was already updated in the detector compute kf */
-		/* for now the 0 holder is the sample holder */
-		hkl.data[0] = darray_item(self->parameters, 0)->_value;
-		hkl.data[1] = darray_item(self->parameters, 1)->_value;
-		hkl.data[2] = darray_item(self->parameters, 2)->_value;
-		hkl_matrix_times_vector(&sample->UB, &hkl);
-		hkl_vector_rotated_quaternion(&hkl,
-					      &darray_item(geometry->holders, 0)->q);
-
-		/* project hkl on the plan of normal Q */
-		hkl_vector_project_on_plan(&hkl, &Q);
-
-		if (hkl_vector_is_null(&hkl)){
-			hkl_error_set(error, "can not initialize the \"%s\" mode"
-				      "\nwhen Q and the <h2, k2, l2> ref vector are colinear."
-				      "\nplease change one or both of them", engine->mode->info->name);
-			return HKL_FALSE;
+	if(initialized){
+		/* kf - ki = Q */
+		hkl_source_compute_ki(&geometry->source, &ki);
+		hkl_detector_compute_kf(detector, geometry, &kf);
+		Q = kf;
+		hkl_vector_minus_vector(&Q, &ki);
+
+		if (hkl_vector_is_null(&Q)){
+			g_set_error(error,
+				    HKL_MODE_PSI_CONSTANT_VERTICAL_ERROR,
+				    HKL_MODE_PSI_CONSTANT_VERTICAL_ERROR_INITIALIZED_SET,
+				    "can not initialize the \"%s\" mode with a null hkl (kf == ki)"
+				    "\nplease select a non-null hkl", self->info->name);
+			return FALSE;
 		}else{
-			/* compute the angle beetween hkl and n and
-			 * store in in the fourth parameter */
-			if (!hkl_parameter_value_set(
-				    darray_item(self->parameters, 3),
-				    hkl_vector_oriented_angle(&n, &hkl, &Q),
-				    error))
-				return HKL_FALSE;
+			/* needed for a problem of precision */
+			hkl_vector_normalize(&Q);
+
+			/* compute the intersection of the plan P(kf, ki) and PQ (normal Q) */
+			n = kf;
+			hkl_vector_vectorial_product(&n, &ki);
+			hkl_vector_vectorial_product(&n, &Q);
+
+			/* compute hkl in the laboratory referentiel */
+			/* the geometry was already updated in the detector compute kf */
+			/* for now the 0 holder is the sample holder */
+			hkl.data[0] = darray_item(self->parameters, 0)->_value;
+			hkl.data[1] = darray_item(self->parameters, 1)->_value;
+			hkl.data[2] = darray_item(self->parameters, 2)->_value;
+			hkl_matrix_times_vector(&sample->UB, &hkl);
+			hkl_vector_rotated_quaternion(&hkl,
+						      &darray_item(geometry->holders, 0)->q);
+
+			/* project hkl on the plan of normal Q */
+			hkl_vector_project_on_plan(&hkl, &Q);
+
+			if (hkl_vector_is_null(&hkl)){
+				g_set_error(error,
+					    HKL_MODE_PSI_CONSTANT_VERTICAL_ERROR,
+					    HKL_MODE_PSI_CONSTANT_VERTICAL_ERROR_INITIALIZED_SET,
+					    "can not initialize the \"%s\" mode"
+					    "\nwhen Q and the <h2, k2, l2> ref vector are colinear."
+					    "\nplease change one or both of them", engine->mode->info->name);
+				return FALSE;
+			}else{
+				/* compute the angle beetween hkl and n and
+				 * store in in the fourth parameter */
+				if (!hkl_parameter_value_set(darray_item(self->parameters, 3),
+							     hkl_vector_oriented_angle(&n, &hkl, &Q),
+							     HKL_UNIT_DEFAULT, error))
+					return FALSE;
+			}
 		}
 	}
 
-	return HKL_TRUE;
+	self->initialized = initialized;
+
+	return TRUE;
 }
 
-/***********************/
+/*************/
 /* HklEngine */
-/***********************/
+/*************/
 
 static void hkl_engine_hkl_free_real(HklEngine *base)
 {
-	HklEngineHkl *self=container_of(base, HklEngineHkl, engine);
+	HklEngineHkl *self = container_of(base, HklEngineHkl, engine);
 	hkl_engine_release(&self->engine);
 	free(self);
 }
@@ -690,19 +760,27 @@ HklEngine *hkl_engine_hkl_new(void)
 {
 	HklEngineHkl *self;
 	static const HklPseudoAxis h = {
-		.parameter = { HKL_PARAMETER_DEFAULTS, .name = "h", .range={.min=-1, .max=1}}
+		.parameter = { HKL_PARAMETER_DEFAULTS, .name = "h",
+			       .description = "h coordinate of the diffracting plan",
+			       .range = { .min=-1, .max=1 },
+		},
 	};
 	static const HklPseudoAxis k = {
-		.parameter = { HKL_PARAMETER_DEFAULTS, .name = "k", .range={.min=-1, .max=1}}
+		.parameter = { HKL_PARAMETER_DEFAULTS, .name = "k",
+			       .description = "k coordinate of the diffracting plan",
+			       .range = { .min=-1, .max=1 },
+		},
 	};
 	static const HklPseudoAxis l = {
-		.parameter = { HKL_PARAMETER_DEFAULTS, .name = "l", .range={.min=-1, .max=1}}
+		.parameter = { HKL_PARAMETER_DEFAULTS, .name = "l",
+			       .description = "l coordinate of the diffracting plan",
+			       .range={ .min=-1, .max=1 },
+		},
 	};
 	static const HklPseudoAxis *pseudo_axes[] = {&h, &k, &l};
 	static HklEngineInfo info = {
 		.name = "hkl",
-		.pseudo_axes = pseudo_axes,
-		.n_pseudo_axes = ARRAY_SIZE(pseudo_axes),
+		.pseudo_axes = DARRAY(pseudo_axes),
 	};
 	static HklEngineOperations operations = {
 		HKL_ENGINE_OPERATIONS_DEFAULTS,
diff --git a/hkl/hkl-pseudoaxis-common-psi-private.h b/hkl/hkl-pseudoaxis-common-psi-private.h
index 15fcccf..48c9712 100644
--- a/hkl/hkl-pseudoaxis-common-psi-private.h
+++ b/hkl/hkl-pseudoaxis-common-psi-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,13 +22,13 @@
 #ifndef __HKL_PSEUDOAXIS_COMMON_PSI_PRIVATE_H__
 #define __HKL_PSEUDOAXIS_COMMON_PSI_PRIVATE_H__
 
-#include <gsl/gsl_math.h>
-#include <gsl/gsl_vector.h>
-#include <gsl/gsl_sf_trig.h>
+#include <gsl/gsl_vector_double.h>      // for gsl_vector
+#include "hkl-pseudoaxis-auto-private.h"  // for HklFunction, etc
+#include "hkl-pseudoaxis-private.h"     // for _HklEngine, _HklMode
+#include "hkl-vector-private.h"         // for HklVector
+#include "hkl.h"                        // for HklEngine, HklMode, etc
 
-#include "hkl-pseudoaxis-auto-private.h"
-
-HKL_BEGIN_DECLS
+G_BEGIN_DECLS
 
 typedef struct _HklModePsi HklModePsi;
 typedef struct _HklEnginePsi HklEnginePsi;
@@ -58,6 +58,24 @@ static const HklFunction psi_func = {
 	.size = 4,
 };
 
-HKL_END_DECLS
+static const HklParameter psi_parameters[] = {
+	{
+		HKL_PARAMETER_DEFAULTS, .name = "h2", ._value = 1,
+		.description = "h coordinate of the reference plan",
+		.range = { .min=-1, .max=1 },
+	},
+	{
+		HKL_PARAMETER_DEFAULTS, .name = "k2", ._value = 1,
+		.description = "k coordinate of the reference plan",
+		.range = { .min=-1, .max=1 },
+	},
+	{
+		HKL_PARAMETER_DEFAULTS, .name = "l2", ._value = 1,
+		.description = "l coordinate of the reference plan",
+		.range = { .min=-1, .max=1 },
+	},
+};
+
+G_END_DECLS
 
 #endif /* __HKL_PSEUDOAXIS_COMMON_PSI_PRIVATE_H__ */
diff --git a/hkl/hkl-pseudoaxis-common-psi.c b/hkl/hkl-pseudoaxis-common-psi.c
index 8e88958..99febce 100644
--- a/hkl/hkl-pseudoaxis-common-psi.c
+++ b/hkl/hkl-pseudoaxis-common-psi.c
@@ -13,23 +13,46 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <gsl/gsl_math.h>
-#include <gsl/gsl_vector.h>
-#include <gsl/gsl_sf_trig.h>
-
-#include "hkl/ccan/array_size/array_size.h"
-
-#include "hkl-error-private.h"
+#include <gsl/gsl_errno.h>              // for ::GSL_SUCCESS
+#include <gsl/gsl_vector_double.h>      // for gsl_vector
+#include <gsl/gsl_sys.h>                // for gsl_isnan
+#include <stdio.h>                      // for fprintf, stderr
+#include <stdlib.h>                     // for NULL, exit, free
+#include <sys/types.h>                  // for uint
+#include "hkl-detector-private.h"       // for hkl_detector_compute_kf
+#include "hkl-geometry-private.h"       // for HklHolder, _HklGeometry, etc
+#include "hkl-macros-private.h"         // for HKL_MALLOC, hkl_assert, etc
+#include "hkl-matrix-private.h"         // for hkl_matrix_solve, etc
 #include "hkl-parameter-private.h"
-#include "hkl-pseudoaxis-auto-private.h"
-#include "hkl-pseudoaxis-common-psi-private.h"
-#include "hkl-sample-private.h"
+#include "hkl-pseudoaxis-auto-private.h"  // for HklModeAutoInfo, etc
+#include "hkl-pseudoaxis-common-psi-private.h"  // for HklEnginePsi, etc
+#include "hkl-pseudoaxis-private.h"     // for _HklEngine, HklEngineInfo, etc
+#include "hkl-quaternion-private.h"     // for hkl_quaternion_to_matrix
+#include "hkl-sample-private.h"         // for _HklSample
+#include "hkl-source-private.h"         // for hkl_source_compute_ki
+#include "hkl-vector-private.h"         // for HklVector, etc
+#include "hkl.h"                        // for HklEngine, HklGeometry, etc
+#include "hkl/ccan/array_size/array_size.h"  // for ARRAY_SIZE
+#include "hkl/ccan/container_of/container_of.h"  // for container_of
+#include "hkl/ccan/darray/darray.h"     // for darray_item
+
+#define HKL_MODE_PSI_ERROR hkl_mode_psi_error_quark ()
+
+static GQuark hkl_mode_psi_error_quark (void)
+{
+	return g_quark_from_static_string ("hkl-mode-psi-error-quark");
+}
+
+typedef enum {
+	HKL_MODE_PSI_ERROR_INIT, /* can not init the engine */
+	HKL_MODE_PSI_ERROR_GET, /* can not get the engine */
+} HklModePsiError;
 
 /***********************/
 /* numerical functions */
@@ -62,8 +85,6 @@ int _psi_func(const gsl_vector *x, void *params, gsl_vector *f)
 		f->data[2] = 1;
 		f->data[3] = 1;
 	}else{
-		uint len;
-
 		/* R * UB */
 		/* for now the 0 holder is the sample holder. */
 		sample_holder = darray_item(engine->geometry->holders, 0);
@@ -86,7 +107,9 @@ int _psi_func(const gsl_vector *x, void *params, gsl_vector *f)
 
 		/* compute hkl1 in the laboratory referentiel */
 		/* for now the 0 holder is the sample holder. */
-		hkl_parameter_list_values_get(&engine->mode->parameters, hkl1.data, &len);
+		for(unsigned int i=0; i<3; ++i)
+			hkl1.data[i] = darray_item(engine->mode->parameters, i)->_value;
+
 		hkl_matrix_times_vector(&engine->sample->UB, &hkl1);
 		hkl_vector_rotated_quaternion(&hkl1, &sample_holder->q);
 
@@ -108,48 +131,50 @@ int _psi_func(const gsl_vector *x, void *params, gsl_vector *f)
 	return GSL_SUCCESS;
 }
 
-static int hkl_mode_init_psi_real(HklMode *base,
-				  HklEngine *engine,
-				  HklGeometry *geometry,
-				  HklDetector *detector,
-				  HklSample *sample,
-				  HklError **error)
+static int hkl_mode_initialized_set_psi_real(HklMode *self,
+					     HklEngine *engine,
+					     HklGeometry *geometry,
+					     HklDetector *detector,
+					     HklSample *sample,
+					     int initialized,
+					     GError **error)
 {
 	HklVector ki;
 	HklMatrix RUB;
-	HklModePsi *self = container_of(base, HklModePsi, parent);
+	HklModePsi *psi_mode = container_of(self, HklModePsi, parent);
 	HklHolder *sample_holder;
 
-	hkl_return_val_if_fail (error == NULL || *error == NULL, HKL_FALSE);
+	hkl_error (error == NULL || *error == NULL);
 
-	if (!hkl_mode_init_real(base, engine, geometry, detector, sample, error)){
-		hkl_error_set(error, "internal error");
-		return HKL_FALSE;
-	}
-	hkl_assert(error == NULL || *error == NULL);
+	if(initialized){
+		/* update the geometry internals */
+		hkl_geometry_update(geometry);
 
-	/* update the geometry internals */
-	hkl_geometry_update(geometry);
+		/* R * UB */
+		/* for now the 0 holder is the sample holder. */
+		sample_holder = darray_item(geometry->holders, 0);
+		hkl_quaternion_to_matrix(&sample_holder->q, &RUB);
+		hkl_matrix_times_matrix(&RUB, &sample->UB);
+
+		/* kf - ki = Q0 */
+		hkl_source_compute_ki(&geometry->source, &ki);
+		hkl_detector_compute_kf(detector, geometry, &psi_mode->Q0);
+		hkl_vector_minus_vector(&psi_mode->Q0, &ki);
+		if (hkl_vector_is_null(&psi_mode->Q0)){
+			g_set_error(error,
+				    HKL_MODE_PSI_ERROR,
+				    HKL_MODE_PSI_ERROR_INIT,
+				    "can not initialize the \"%s\" engine when hkl is null",
+				    engine->info->name);
+			return FALSE;
+		}else
+			/* compute hkl0 */
+			hkl_matrix_solve(&RUB, &psi_mode->hkl0, &psi_mode->Q0);
+	}
 
-	/* R * UB */
-	/* for now the 0 holder is the sample holder. */
-	sample_holder = darray_item(geometry->holders, 0);
-	hkl_quaternion_to_matrix(&sample_holder->q, &RUB);
-	hkl_matrix_times_matrix(&RUB, &sample->UB);
+	self->initialized = initialized;
 
-	/* kf - ki = Q0 */
-	hkl_source_compute_ki(&geometry->source, &ki);
-	hkl_detector_compute_kf(detector, geometry, &self->Q0);
-	hkl_vector_minus_vector(&self->Q0, &ki);
-	if (hkl_vector_is_null(&self->Q0)){
-		hkl_error_set(error, "can not initialize the \"%s\" engine when hkl is null",
-			      engine->info->name);
-		return HKL_FALSE;
-	}else
-		/* compute hkl0 */
-		hkl_matrix_solve(&RUB, &self->hkl0, &self->Q0);
-
-	return HKL_TRUE;
+	return TRUE;
 }
 
 static int hkl_mode_get_psi_real(HklMode *base,
@@ -157,7 +182,7 @@ static int hkl_mode_get_psi_real(HklMode *base,
 				 HklGeometry *geometry,
 				 HklDetector *detector,
 				 HklSample *sample,
-				 HklError **error)
+				 GError **error)
 {
 	HklVector ki;
 	HklVector kf;
@@ -166,8 +191,11 @@ static int hkl_mode_get_psi_real(HklMode *base,
 	HklVector n;
 
 	if (!base || !engine || !engine->mode || !geometry || !detector || !sample){
-		hkl_error_set(error, "internal error");
-		return HKL_FALSE;
+		g_set_error(error,
+			    HKL_MODE_PSI_ERROR,
+			    HKL_MODE_PSI_ERROR_GET,
+			    "internal error");
+		return FALSE;
 	}
 
 	/* get kf, ki and Q */
@@ -176,11 +204,12 @@ static int hkl_mode_get_psi_real(HklMode *base,
 	Q = kf;
 	hkl_vector_minus_vector(&Q, &ki);
 	if (hkl_vector_is_null(&Q)){
-		hkl_error_set(error, "can not compute psi when hkl is null (kf == ki)");
-		return HKL_FALSE;
+		g_set_error(error,
+			    HKL_MODE_PSI_ERROR,
+			    HKL_MODE_PSI_ERROR_GET,
+			    "can not compute psi when hkl is null (kf == ki)");
+		return FALSE;
 	}else{
-		uint shit;
-
 		/* needed for a problem of precision */
 		hkl_vector_normalize(&Q);
 
@@ -192,7 +221,9 @@ static int hkl_mode_get_psi_real(HklMode *base,
 		/* compute hkl1 in the laboratory referentiel */
 		/* the geometry was already updated in the detector compute kf */
 		/* for now the 0 holder is the sample holder. */
-		hkl_parameter_list_values_get(&base->parameters, hkl1.data, &shit);
+		for(unsigned int i=0; i<3; ++i)
+			hkl1.data[i] = darray_item(base->parameters, i)->_value;
+
 		hkl_matrix_times_vector(&sample->UB, &hkl1);
 		hkl_vector_rotated_quaternion(&hkl1, &darray_item(geometry->holders, 0)->q);
 
@@ -200,8 +231,11 @@ static int hkl_mode_get_psi_real(HklMode *base,
 		hkl_vector_project_on_plan(&hkl1, &Q);
 
 		if (hkl_vector_is_null(&hkl1)){
-			hkl_error_set(error, "can not compute psi when Q and the ref vector are colinear");
-			return HKL_FALSE;
+			g_set_error(error,
+				    HKL_MODE_PSI_ERROR,
+				    HKL_MODE_PSI_ERROR_GET,
+				    "can not compute psi when Q and the ref vector are colinear");
+			return FALSE;
 		}else{
 			HklEnginePsi *psi_engine = container_of(engine, HklEnginePsi, engine);
 
@@ -210,19 +244,20 @@ static int hkl_mode_get_psi_real(HklMode *base,
 		}
 	}
 
-	return HKL_TRUE;
+	return TRUE;
 }
 
-HklMode *hkl_mode_psi_new(const HklModeAutoInfo *info)
+HklMode *hkl_mode_psi_new(const HklModeAutoInfo *auto_info)
 {
 	static const HklModeOperations operations = {
 		HKL_MODE_OPERATIONS_AUTO_DEFAULTS,
-		.init = hkl_mode_init_psi_real,
+		.capabilities = HKL_ENGINE_CAPABILITIES_READABLE | HKL_ENGINE_CAPABILITIES_WRITABLE | HKL_ENGINE_CAPABILITIES_INITIALIZABLE,
+		.initialized_set = hkl_mode_initialized_set_psi_real,
 		.get = hkl_mode_get_psi_real,
 	};
 	HklModePsi *self;
 
-	if (info->mode.n_axes != 4){
+	if (darray_size(auto_info->info.axes_w) != 4){
 		fprintf(stderr, "This generic HklModePsi need exactly 4 axes");
 		exit(128);
 	}
@@ -231,15 +266,15 @@ HklMode *hkl_mode_psi_new(const HklModeAutoInfo *info)
 
 	/* the base constructor; */
 	hkl_mode_auto_init(&self->parent,
-			   info,
-			   &operations);
+			   auto_info,
+			   &operations, FALSE);
 
 	return &self->parent;
 }
 
-/***********************/
+/*************/
 /* HklEngine */
-/***********************/
+/*************/
 
 static void hkl_engine_psi_free_real(HklEngine *base)
 {
@@ -252,13 +287,14 @@ HklEngine *hkl_engine_psi_new(void)
 {
 	HklEnginePsi *self;
 	static const HklPseudoAxis psi = {
-		.parameter = { HKL_PARAMETER_DEFAULTS_ANGLE, .name = "psi"}
+		.parameter = { HKL_PARAMETER_DEFAULTS_ANGLE, .name = "psi",
+			       .description = "angle between the reference vector and the diffraction plan",
+		},
 	};
 	static const HklPseudoAxis *pseudo_axes[] = {&psi};
 	static const HklEngineInfo info = {
 		.name = "psi",
-		.pseudo_axes = pseudo_axes,
-		.n_pseudo_axes = ARRAY_SIZE(pseudo_axes),
+		.pseudo_axes = DARRAY(pseudo_axes),
 	};
 	static const HklEngineOperations operations = {
 		HKL_ENGINE_OPERATIONS_DEFAULTS,
diff --git a/hkl/hkl-pseudoaxis-common-q-private.h b/hkl/hkl-pseudoaxis-common-q-private.h
index af7356d..97fa679 100644
--- a/hkl/hkl-pseudoaxis-common-q-private.h
+++ b/hkl/hkl-pseudoaxis-common-q-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -24,16 +24,18 @@
 
 #include "hkl.h"
 
-HKL_BEGIN_DECLS
+G_BEGIN_DECLS
 
 typedef struct _HklEngineQ HklEngineQ;
 typedef struct _HklEngineQ2 HklEngineQ2;
 typedef struct _HklEngineQperQpar HklEngineQperQpar;
 
+extern double qmax(double wavelength);
+
 extern HklEngine *hkl_engine_q_new(void);
 extern HklEngine *hkl_engine_q2_new(void);
 extern HklEngine *hkl_engine_qper_qpar_new(void);
 
-HKL_END_DECLS
+G_END_DECLS
 
 #endif
diff --git a/hkl/hkl-pseudoaxis-common-q.c b/hkl/hkl-pseudoaxis-common-q.c
index d1e5190..93b4e2c 100644
--- a/hkl/hkl-pseudoaxis-common-q.c
+++ b/hkl/hkl-pseudoaxis-common-q.c
@@ -13,22 +13,38 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  *          Jens Krüger <Jens.Krueger at frm2.tum.de>
  */
-#include <gsl/gsl_sf_trig.h>
-
-#include <string.h>
-#include "hkl/ccan/array_size/array_size.h"
-#include <gsl/gsl_sf_trig.h>
-
-#include "hkl-parameter-private.h"
-#include "hkl-pseudoaxis-auto-private.h"
-#include "hkl-pseudoaxis-common-q-private.h"
+#include <gsl/gsl_errno.h>              // for ::GSL_SUCCESS
+#include <gsl/gsl_sf_trig.h>            // for gsl_sf_angle_restrict_symm
+#include <gsl/gsl_sys.h>                // for gsl_isnan
+#include <gsl/gsl_vector_double.h>      // for gsl_vector
+#include <math.h>                       // for sin, atan2, signbit
+#include <stdlib.h>                     // for free
+#include "hkl-detector-private.h"       // for hkl_detector_compute_kf
+#include "hkl-geometry-private.h"       // for _HklGeometry, HklHolder
+#include "hkl-macros-private.h"         // for HKL_MALLOC
+#include "hkl-parameter-private.h"      // for _HklParameter, etc
+#include "hkl-pseudoaxis-auto-private.h"  // for HklFunction, etc
+#include "hkl-pseudoaxis-common-q-private.h"  // for HklEngineQ2, etc
+#include "hkl-pseudoaxis-private.h"     // for _HklEngine, etc
+#include "hkl-source-private.h"         // for hkl_source_compute_ki, etc
+#include "hkl-vector-private.h"         // for HklVector, hkl_vector_angle, etc
+#include "hkl.h"                        // for HklEngine, HklParameter, etc
+#include "hkl/ccan/array_size/array_size.h"  // for ARRAY_SIZE
+#include "hkl/ccan/container_of/container_of.h"  // for container_of
+#include "hkl/ccan/darray/darray.h"     // for darray_item
+
+
+double qmax(double wavelength)
+{
+	return 2 * HKL_TAU / wavelength;
+}
 
 /*****/
 /* q */
@@ -53,7 +69,7 @@ static int _q_func(const gsl_vector *x, void *params, gsl_vector *f)
 	set_geometry_axes(engine, x->data);
 
 	tth = gsl_sf_angle_restrict_symm(x->data[0]);
-	q = 2 * HKL_TAU / hkl_source_get_wavelength(&engine->geometry->source) * sin(tth/2.);
+	q = qmax(hkl_source_get_wavelength(&engine->geometry->source)) * sin(tth/2.);
 
 	f->data[0] = engine_q->q->_value - q;
 
@@ -70,7 +86,7 @@ static int get_q_real(HklMode *self,
 		      HklGeometry *geometry,
 		      HklDetector *detector,
 		      HklSample *sample,
-		      HklError **error)
+		      GError **error)
 {
 	double wavelength;
 	double theta;
@@ -88,15 +104,18 @@ static int get_q_real(HklMode *self,
 		theta = -theta;
 
 	/* update q */
-	engine->q->_value = 2 * HKL_TAU / wavelength * sin(theta);
+	engine->q->_value = qmax(wavelength) * sin(theta);
 
-	return HKL_TRUE;
+	return TRUE;
 }
 
 /* not declared in the constructor as it is used also in the q2 pseudo
  * axis engine */
 static const HklPseudoAxis q = {
-	.parameter = {HKL_PARAMETER_DEFAULTS, .name="q", .range={.max=1}},
+	.parameter = { HKL_PARAMETER_DEFAULTS, .name="q",
+		       .description = "the norm of $\\vec{q}$",
+		       .range = { .max=1 },
+	},
 };
 
 static HklMode *mode_q(void)
@@ -104,14 +123,14 @@ static HklMode *mode_q(void)
 	static const char *axes[] = {"tth"};
 	static const HklFunction *functions[] = {&q_func};
 	static HklModeAutoInfo info = {
-		INFO_AUTO("q", axes, functions),
+		HKL_MODE_AUTO_INFO("q", axes, axes, functions),
 	};
 	static const HklModeOperations operations = {
 		HKL_MODE_OPERATIONS_AUTO_DEFAULTS,
 		.get = get_q_real,
 	};
 
-	return hkl_mode_auto_new(&info, &operations);
+	return hkl_mode_auto_new(&info, &operations, TRUE);
 }
 
 static void hkl_engine_q_free_real(HklEngine *base)
@@ -128,8 +147,7 @@ HklEngine *hkl_engine_q_new(void)
 	static const HklPseudoAxis *pseudo_axes[] = {&q};
 	static const HklEngineInfo info = {
 		.name = "q",
-		.pseudo_axes = pseudo_axes,
-		.n_pseudo_axes = ARRAY_SIZE(pseudo_axes),
+		.pseudo_axes = DARRAY(pseudo_axes),
 	};
 	static const HklEngineOperations operations = {
 		HKL_ENGINE_OPERATIONS_DEFAULTS,
@@ -144,7 +162,7 @@ HklEngine *hkl_engine_q_new(void)
 	/* q [default] */
 	mode = mode_q();
 	hkl_engine_add_mode(&self->engine, mode);
-	hkl_engine_select_mode(&self->engine, mode);
+	hkl_engine_mode_set(&self->engine, mode);
 
 	return &self->engine;
 }
@@ -174,7 +192,7 @@ static void _q2(HklGeometry *geometry, HklDetector *detector,
 	hkl_detector_compute_kf(detector, geometry, &kf);
 	theta = hkl_vector_angle(&ki, &kf) / 2.;
 
-	*q = 2 * HKL_TAU / wavelength * sin(theta);
+	*q = qmax(wavelength) * sin(theta);
 
 	/* project kf on the x plan to compute alpha */
 	hkl_vector_project_on_plan(&kf, &x);
@@ -213,13 +231,13 @@ static int get_q2_real(HklMode *self,
 		       HklGeometry *geometry,
 		       HklDetector *detector,
 		       HklSample *sample,
-		       HklError **error)
+		       GError **error)
 {
 	HklEngineQ2 *engine_q2 = container_of(engine, HklEngineQ2, engine);
 
 	_q2(geometry, detector, &engine_q2->q->_value, &engine_q2->alpha->_value);
 
-	return HKL_TRUE;
+	return TRUE;
 }
 
 static HklMode *mode_q2(void)
@@ -227,18 +245,20 @@ static HklMode *mode_q2(void)
 	static const char* axes[] = {"gamma", "delta"};
 	static const HklFunction *functions[] = {&q2_func};
 	static const HklModeAutoInfo info = {
-		INFO_AUTO("q2", axes, functions),
+		HKL_MODE_AUTO_INFO("q2", axes, axes, functions),
 	};
 	static const HklModeOperations operations = {
 		HKL_MODE_OPERATIONS_AUTO_DEFAULTS,
 		.get = get_q2_real,
 	};
 
-	return hkl_mode_auto_new(&info, &operations);
+	return hkl_mode_auto_new(&info, &operations, TRUE);
 }
 
 static const HklPseudoAxis alpha = {
-	.parameter = {HKL_PARAMETER_DEFAULTS_ANGLE, .name="alpha"},
+	.parameter = { HKL_PARAMETER_DEFAULTS_ANGLE, .name = "alpha",
+		       .description = "angle of the projection of $\\vec{q}$ on the $yOz$ plan and $\\vec{y}$",
+	},
 };
 
 static void hkl_engine_q2_free_real(HklEngine *base)
@@ -255,8 +275,7 @@ HklEngine *hkl_engine_q2_new(void)
 	static const HklPseudoAxis *pseudo_axes[] = {&q, &alpha};
 	static const HklEngineInfo info = {
 		.name = "q2",
-		.pseudo_axes = pseudo_axes,
-		.n_pseudo_axes = ARRAY_SIZE(pseudo_axes),
+		.pseudo_axes = DARRAY(pseudo_axes),
 	};
 	static const HklEngineOperations operations = {
 		HKL_ENGINE_OPERATIONS_DEFAULTS,
@@ -272,7 +291,7 @@ HklEngine *hkl_engine_q2_new(void)
 	/* q2 [default] */
 	mode = mode_q2();
 	hkl_engine_add_mode(&self->engine, mode);
-	hkl_engine_select_mode(&self->engine, mode);
+	hkl_engine_mode_set(&self->engine, mode);
 
 	return &self->engine;
 }
@@ -367,7 +386,7 @@ static int get_qper_qpar_real(HklMode *self,
 			      HklGeometry *geometry,
 			      HklDetector *detector,
 			      HklSample *sample,
-			      HklError **error)
+			      GError **error)
 {
 	HklEngineQperQpar *engine_qper_qpar = container_of(engine, HklEngineQperQpar, engine);
 
@@ -375,7 +394,7 @@ static int get_qper_qpar_real(HklMode *self,
 		   &engine_qper_qpar->qper->_value,
 		   &engine_qper_qpar->qpar->_value);
 
-	return HKL_TRUE;
+	return TRUE;
 }
 
 static HklMode *mode_qper_qpar(void)
@@ -383,19 +402,31 @@ static HklMode *mode_qper_qpar(void)
 	static const char* axes[] = {"gamma", "delta"};
 	static const HklFunction *functions[] = {&qper_qpar_func};
 	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS, .name = "x", .range = {.min=-1, .max=1}, ._value = 0,},
-		{HKL_PARAMETER_DEFAULTS, .name = "y", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "z", .range = {.min=-1, .max=1}, ._value = 0,},
+		{
+			HKL_PARAMETER_DEFAULTS,	.name = "x", ._value = 0,
+			.description = "the first coordinate of the surface vector",
+			.range = { .min=-1, .max=1 },
+		},
+		{
+			HKL_PARAMETER_DEFAULTS, .name = "y", ._value = 1,
+			.description = "the second coordinate of the surface vector",
+			.range = { .min=-1, .max=1 },
+		},
+		{
+			HKL_PARAMETER_DEFAULTS, .name = "z", ._value = 0,
+			.description = "the third coordinate of the surface vector",
+			.range = { .min=-1, .max=1 },
+		},
 	};
 	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS("qper_qpar", axes, functions, parameters),
+		HKL_MODE_AUTO_INFO_WITH_PARAMS("qper_qpar", axes, axes, functions, parameters),
 	};
 	static const HklModeOperations operations = {
 		HKL_MODE_OPERATIONS_AUTO_DEFAULTS,
 		.get = get_qper_qpar_real,
 	};
 
-	return hkl_mode_auto_new(&info, &operations);
+	return hkl_mode_auto_new(&info, &operations, TRUE);
 }
 
 static void hkl_engine_qper_qpar_free_real(HklEngine *base)
@@ -408,16 +439,21 @@ static void hkl_engine_qper_qpar_free_real(HklEngine *base)
 HklEngine *hkl_engine_qper_qpar_new(void)
 {
 	static const HklPseudoAxis qper = {
-		.parameter = {HKL_PARAMETER_DEFAULTS, .name="qper", .range={.min=-1, .max=1}},
+		.parameter = { HKL_PARAMETER_DEFAULTS, .name = "qper",
+			       .description = "perpendicular component of $\\vec{q}$ along the normal of the sample surface",
+			       .range = { .min=-1, .max=1 },
+		},
 	};
 	static const HklPseudoAxis qpar = {
-		.parameter = {HKL_PARAMETER_DEFAULTS, .name="qpar", .range={.min=-1, .max=1}},
+		.parameter = { HKL_PARAMETER_DEFAULTS, .name = "qpar",
+			       .description = "parallel component of $\\vec{q}$",
+			       .range = { .min=-1, .max=1 },
+		},
 	};
 	static const HklPseudoAxis *pseudo_axes[] = {&qper, &qpar};
 	static const HklEngineInfo info = {
 		.name = "qper_qpar",
-		.pseudo_axes = pseudo_axes,
-		.n_pseudo_axes = ARRAY_SIZE(pseudo_axes),
+		.pseudo_axes = DARRAY(pseudo_axes),
 	};
 	static const HklEngineOperations operations = {
 		HKL_ENGINE_OPERATIONS_DEFAULTS,
@@ -435,7 +471,7 @@ HklEngine *hkl_engine_qper_qpar_new(void)
 	/* qper_qpar [default] */
 	mode = mode_qper_qpar();
 	hkl_engine_add_mode(&self->engine, mode);
-	hkl_engine_select_mode(&self->engine, mode);
+	hkl_engine_mode_set(&self->engine, mode);
 
 	return &self->engine;
 }
diff --git a/hkl/hkl-pseudoaxis-e4c-hkl.c b/hkl/hkl-pseudoaxis-e4c-hkl.c
deleted file mode 100644
index 5780fcf..0000000
--- a/hkl/hkl-pseudoaxis-e4c-hkl.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- *          Maria-Teresa Nunez-Pardo-de-Verra <tnunez at mail.desy.de>
- *          Jens Krüger <Jens.Krueger at frm2.tum.de>
- */
-#include <gsl/gsl_math.h>
-#include <gsl/gsl_vector.h>
-
-#include "hkl/ccan/array_size/array_size.h"
-
-#include "hkl-parameter-private.h"
-#include "hkl-pseudoaxis-auto-private.h"
-#include "hkl-pseudoaxis-common-hkl-private.h"
-
-/***********************/
-/* numerical functions */
-/***********************/
-
-static int _bissector_func(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	const double omega = x->data[0];
-	const double tth = x->data[3];
-
-	CHECK_NAN(x->data, x->size);
-
-	RUBh_minus_Q(x->data, params, f->data);
-	f->data[3] = tth - 2 * fmod(omega,M_PI);
-
-	return  GSL_SUCCESS;
-}
-
-static const HklFunction bissector_func = {
-	.function = _bissector_func,
-	.size = 4,
-};
-
-/*********/
-/* modes */
-/*********/
-
-static HklMode *bissector(void)
-{
-	static const char* axes[] = {"omega", "chi", "phi", "tth"};
-	static const HklFunction *functions[] = {&bissector_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *constant_omega(void)
-{
-	static const char* axes[] = {"chi", "phi", "tth"};
-	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *constant_chi(void)
-{
-	static const char* axes[] = {"omega", "phi", "tth"};
-	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *constant_phi(void)
-{
-	static const char* axes[] = {"omega", "chi", "tth"};
-	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *double_diffraction(void)
-{
-	static const char* axes[] = {"omega", "chi", "phi", "tth"};
-	static const HklFunction *functions[] = {&double_diffraction_func};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 1,},
-	};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions,
-				      parameters),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *psi_constant(void)
-{
-	static const char* axes[] = {"omega", "chi", "phi", "tth"};
-	static const HklFunction *functions[] = {&psi_constant_vertical_func};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "psi"},
-	};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions,
-				      parameters),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &psi_constant_vertical_mode_operations);
-}
-
-/***********************/
-/* pseudo axes engines */
-/***********************/
-
-HklEngine *hkl_engine_e4c_hkl_new(void)
-{
-	HklEngine *self;
-	HklMode *default_mode;
-
-	self = hkl_engine_hkl_new();
-
-	default_mode = bissector();
-	hkl_engine_add_mode(self, default_mode);
-	hkl_engine_select_mode(self, default_mode);
-
-	hkl_engine_add_mode(self, constant_omega());
-	hkl_engine_add_mode(self, constant_chi());
-	hkl_engine_add_mode(self, constant_phi());
-	hkl_engine_add_mode(self, double_diffraction());
-	hkl_engine_add_mode(self, psi_constant());
-
-	return self;
-}
diff --git a/hkl/hkl-pseudoaxis-e4c-private.h b/hkl/hkl-pseudoaxis-e4c-private.h
deleted file mode 100644
index 8577c0f..0000000
--- a/hkl/hkl-pseudoaxis-e4c-private.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#ifndef __HKL_PSEUDOAXIS_E4C_H__
-#define __HKL_PSEUDOAXIS_E4C_H__
-
-#include <hkl/hkl-pseudoaxis-auto-private.h>
-
-HKL_BEGIN_DECLS
-
-extern HklEngine *hkl_engine_e4c_hkl_new(void);
-extern HklEngine *hkl_engine_e4c_psi_new(void);
-
-HKL_END_DECLS
-
-#endif /* __HKL_PSEUDOAXIS_E4C_H__ */
diff --git a/hkl/hkl-pseudoaxis-e4c-psi.c b/hkl/hkl-pseudoaxis-e4c-psi.c
deleted file mode 100644
index fddab8e..0000000
--- a/hkl/hkl-pseudoaxis-e4c-psi.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include "hkl/ccan/array_size/array_size.h"
-
-#include "hkl-parameter-private.h"
-#include "hkl-pseudoaxis-auto-private.h"
-#include "hkl-pseudoaxis-e4c-private.h"
-#include "hkl-pseudoaxis-common-psi-private.h"
-
-static HklMode *psi(void)
-{
-	static const char *axes[] = {"omega", "chi", "phi", "tth"};
-	static const HklFunction *functions[] = {&psi_func};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS, .name = "h1", .range = {.min=-1, .max=1}, ._value=1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "k1", .range = {.min=-1, .max=1}, ._value=1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "l1", .range = {.min=-1, .max=1}, ._value=1,},
-	};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
-	};
-
-	return hkl_mode_psi_new(&info);
-}
-
-HklEngine *hkl_engine_e4c_psi_new(void)
-{
-	HklEngine *self;
-	HklMode *default_mode;
-
-	self = hkl_engine_psi_new();
-
-	default_mode = psi();
-	hkl_engine_add_mode(self, default_mode);
-	hkl_engine_select_mode(self, default_mode);
-
-	return self;
-}
diff --git a/hkl/hkl-pseudoaxis-e6c-hkl.c b/hkl/hkl-pseudoaxis-e6c-hkl.c
deleted file mode 100644
index 214da40..0000000
--- a/hkl/hkl-pseudoaxis-e6c-hkl.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- *          Maria-Teresa Nunez-Pardo-de-Verra <tnunez at mail.desy.de>
- *          Jens Krüger <Jens.Krueger at frm2.tum.de>
- */
-#include <gsl/gsl_math.h>
-#include <gsl/gsl_vector.h>
-
-#include "hkl/ccan/array_size/array_size.h"
-
-#include "hkl-parameter-private.h"
-#include "hkl-pseudoaxis-auto-private.h"
-#include "hkl-pseudoaxis-common-hkl-private.h"
-
-/***********************/
-/* numerical functions */
-/***********************/
-
-static int _bissector_horizontal_func(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	const double mu = x->data[0];
-	const double omega = x->data[1];
-	const double gamma = x->data[4];
-
-	CHECK_NAN(x->data, x->size);
-
-	RUBh_minus_Q(x->data, params, f->data);
-	f->data[3] = fmod(omega, M_PI);
-	f->data[4] = gamma - 2 * fmod(mu, M_PI);
-
-	return  GSL_SUCCESS;
-}
-
-static const HklFunction bissector_horizontal_func = {
-	.function = _bissector_horizontal_func,
-	.size = 5,
-};
-
-static int _bissector_vertical_func(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	const double omega = x->data[0];
-	const double tth = x->data[3];
-
-	CHECK_NAN(x->data, x->size);
-
-	RUBh_minus_Q(x->data, params, f->data);
-	f->data[3] = tth - 2 * fmod(omega,M_PI);
-
-	return  GSL_SUCCESS;
-}
-
-static const HklFunction bissector_vertical_func = {
-	.function = _bissector_vertical_func,
-	.size = 4,
-};
-
-/*********/
-/* modes */
-/*********/
-
-static HklMode *bissector_vertical(void)
-{
-	static const char* axes[] = {"omega", "chi", "phi", "delta"};
-	static const HklFunction *functions[] = {&bissector_vertical_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *constant_omega_vertical(void)
-{
-	static const char* axes[] = {"chi", "phi", "delta"};
-	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *constant_chi_vertical(void)
-{
-	static const char* axes[] = {"omega", "phi", "delta"};
-	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *constant_phi_vertical(void)
-{
-	static const char* axes[] = {"omega", "chi", "delta"};
-	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *lifting_detector_phi(void)
-{
-	static const char* axes[] = {"phi", "gamma", "delta"};
-	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *lifting_detector_omega(void)
-{
-	static const char* axes[] = {"omega", "gamma", "delta"};
-	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *lifting_detector_mu(void)
-{
-	static const char* axes[] = {"mu", "gamma", "delta"};
-	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *double_diffraction_vertical(void)
-{
-	static const char* axes[] = {"omega", "chi", "phi", "delta"};
-	static const HklFunction *functions[] = {&double_diffraction_func};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 1,},
-	};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *bissector_horizontal(void)
-{
-	static const char* axes[] = {"mu", "omega", "chi", "phi", "gamma"};
-	static const HklFunction *functions[] = {&bissector_horizontal_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *double_diffraction_horizontal(void)
-{
-	static const char* axes[] = {"mu", "chi", "phi", "gamma"};
-	static const HklFunction *functions[] = {&double_diffraction_func};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 1,},
-	};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *psi_constant_vertical(void)
-{
-	static const char* axes[] = {"omega", "chi", "phi", "delta"};
-	static const HklFunction *functions[] = {&psi_constant_vertical_func};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 0,},
-		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 0,},
-		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "psi"},
-	};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &psi_constant_vertical_mode_operations);
-}
-
-static HklMode *psi_constant_horizontal(void)
-{
-	static const char* axes[] = {"omega", "chi", "phi", "gamma"};
-	static const HklFunction *functions[] = {&psi_constant_vertical_func};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 0,},
-		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 0,},
-		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "psi"},
-	};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &psi_constant_vertical_mode_operations);
-}
-
-static HklMode *constant_mu_horizontal(void)
-{
-	static const char* axes[] = {"chi", "phi", "gamma"};
-	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_full_mode_operations);
-}
-
-/***********************/
-/* E6C PseudoAxeEngine */
-/***********************/
-
-HklEngine *hkl_engine_e6c_hkl_new(void)
-{
-	HklEngine *self;
-	HklMode *default_mode;
-
-	self = hkl_engine_hkl_new();
-
-	default_mode = bissector_vertical();
-	hkl_engine_add_mode(self, default_mode);
-	hkl_engine_select_mode(self, default_mode);
-
-	hkl_engine_add_mode(self, constant_omega_vertical());
-	hkl_engine_add_mode(self, constant_chi_vertical());
-	hkl_engine_add_mode(self, constant_phi_vertical());
-	hkl_engine_add_mode(self, lifting_detector_phi());
-	hkl_engine_add_mode(self, lifting_detector_omega());
-	hkl_engine_add_mode(self, lifting_detector_mu());
-	hkl_engine_add_mode(self, double_diffraction_vertical());
-	hkl_engine_add_mode(self, bissector_horizontal());
-	hkl_engine_add_mode(self, double_diffraction_horizontal());
-	hkl_engine_add_mode(self, psi_constant_vertical());
-	hkl_engine_add_mode(self, psi_constant_horizontal());
-	hkl_engine_add_mode(self, constant_mu_horizontal());
-
-	return self;
-}
diff --git a/hkl/hkl-pseudoaxis-e6c-private.h b/hkl/hkl-pseudoaxis-e6c-private.h
deleted file mode 100644
index 880e048..0000000
--- a/hkl/hkl-pseudoaxis-e6c-private.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#ifndef __HKL_PSEUDOAXIS_E6C_H__
-#define __HKL_PSEUDOAXIS_E6C_H__
-
-#include "hkl-pseudoaxis-auto-private.h"
-
-HKL_BEGIN_DECLS
-
-extern HklEngine *hkl_engine_e6c_hkl_new(void);
-extern HklEngine *hkl_engine_e6c_psi_new(void);
-
-HKL_END_DECLS
-
-#endif /* __HKL_PSEUDOAXIS_E6C_H__ */
diff --git a/hkl/hkl-pseudoaxis-e6c-psi.c b/hkl/hkl-pseudoaxis-e6c-psi.c
deleted file mode 100644
index 3898810..0000000
--- a/hkl/hkl-pseudoaxis-e6c-psi.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include "hkl/ccan/array_size/array_size.h"
-
-#include "hkl-parameter-private.h"
-#include "hkl-pseudoaxis-auto-private.h"
-#include "hkl-pseudoaxis-common-psi-private.h"
-
-/********/
-/* mode */
-/********/
-
-static HklMode* psi_vertical()
-{
-	static const char *axes[] = {"omega", "chi", "phi", "delta"};
-	static const HklFunction *functions[] = {&psi_func};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS, .name = "h1", .range = {.min=-1, .max=1}, ._value=1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "k1", .range = {.min=-1, .max=1}, ._value=1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "l1", .range = {.min=-1, .max=1}, ._value=1,},
-	};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
-	};
-
-	return hkl_mode_psi_new(&info);
-}
-
-/**********************/
-/* pseudo axis engine */
-/**********************/
-
-HklEngine *hkl_engine_e6c_psi_new(void)
-{
-	HklEngine *self;
-	HklMode *default_mode;
-
-	self = hkl_engine_psi_new();
-
-	default_mode = psi_vertical();
-	hkl_engine_add_mode(self, default_mode);
-	hkl_engine_select_mode(self, default_mode);
-
-	return self;
-}
diff --git a/hkl/hkl-pseudoaxis-k4cv-private.h b/hkl/hkl-pseudoaxis-k4cv-private.h
deleted file mode 100644
index d5e5750..0000000
--- a/hkl/hkl-pseudoaxis-k4cv-private.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#ifndef __HKL_PSEUDOAXIS_K4CV_H__
-#define __HKL_PSEUDOAXIS_K4CV_H__
-
-#include <hkl/hkl-pseudoaxis-auto-private.h>
-
-HKL_BEGIN_DECLS
-
-extern HklEngine *hkl_engine_k4cv_hkl_new(void);
-extern HklEngine *hkl_engine_k4cv_psi_new(void);
-
-HKL_END_DECLS
-
-#endif /* __HKL_PSEUDOAXIS_K4CV_H__ */
diff --git a/hkl/hkl-pseudoaxis-k4cv-psi.c b/hkl/hkl-pseudoaxis-k4cv-psi.c
deleted file mode 100644
index d2958bc..0000000
--- a/hkl/hkl-pseudoaxis-k4cv-psi.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include "hkl/ccan/array_size/array_size.h"
-
-#include "hkl-parameter-private.h"
-#include "hkl-pseudoaxis-auto-private.h"
-#include "hkl-pseudoaxis-common-psi-private.h"
-
-/********/
-/* mode */
-/********/
-
-static HklMode *psi()
-{
-	static const char *axes[] = {"komega", "kappa", "kphi", "tth"};
-	static const HklFunction *functions[] = {&psi_func};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS, .name = "h1", .range = {.min=-1, .max=1}, ._value=1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "k1", .range = {.min=-1, .max=1}, ._value=1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "l1", .range = {.min=-1, .max=1}, ._value=1,},
-	};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
-	};
-
-	return hkl_mode_psi_new(&info);
-}
-
-/**********************/
-/* pseudo axis engine */
-/**********************/
-
-HklEngine *hkl_engine_k4cv_psi_new(void)
-{
-	HklEngine *self;
-	HklMode *default_mode;
-
-	self = hkl_engine_psi_new();
-
-	default_mode = psi();
-	hkl_engine_add_mode(self, default_mode);
-	hkl_engine_select_mode(self, default_mode);
-
-	return self;
-}
diff --git a/hkl/hkl-pseudoaxis-k6c-hkl.c b/hkl/hkl-pseudoaxis-k6c-hkl.c
deleted file mode 100644
index b095450..0000000
--- a/hkl/hkl-pseudoaxis-k6c-hkl.c
+++ /dev/null
@@ -1,597 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- *          Maria-Teresa Nunez-Pardo-de-Verra <tnunez at mail.desy.de>
- *          Jens Krüger <Jens.Krueger at frm2.tum.de>
- */
-#include <gsl/gsl_math.h>
-#include <gsl/gsl_vector.h>
-#include <gsl/gsl_sf.h>
-
-#include "hkl/ccan/array_size/array_size.h"
-
-#include "hkl-parameter-private.h"
-#include "hkl-pseudoaxis-auto-private.h"
-#include "hkl-pseudoaxis-common-hkl-private.h"
-
-/***********************/
-/* numerical functions */
-/***********************/
-
-static int _bissector_h_f1(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	const double mu = x->data[0];
-	const double komega = x->data[1];
-	const double kappa = x->data[2];
-	const double gamma = x->data[4];
-	double omega;
-
-	CHECK_NAN(x->data, x->size);
-
-	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) - M_PI_2;
-
-	RUBh_minus_Q(x->data, params, f->data);
-	f->data[3] = fmod(omega, M_PI);
-	f->data[4] = fmod(gamma - 2 * fmod(mu, M_PI), 2*M_PI);
-
-	return  GSL_SUCCESS;
-}
-
-static const HklFunction bissector_h_f1 = {
-	.function = _bissector_h_f1,
-	.size = 5,
-};
-
-static int _bissector_h_f2(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	const double mu = x->data[0];
-	const double komega = x->data[1];
-	const double kappa = x->data[2];
-	const double gamma = x->data[4];
-	double omega;
-
-	CHECK_NAN(x->data, x->size);
-
-	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) + M_PI_2;
-
-	RUBh_minus_Q(x->data, params, f->data);
-	f->data[3] = fmod(omega, M_PI);
-	f->data[4] = fmod(gamma - 2 * fmod(mu, M_PI), 2*M_PI);
-
-
-	return  GSL_SUCCESS;
-}
-
-static const HklFunction bissector_h_f2 = {
-	.function = _bissector_h_f2,
-	.size = 5,
-};
-
-static int _constant_kphi_h_f1(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	const double komega = x->data[1];
-	const double kappa = x->data[2];
-	double omega;
-
-	CHECK_NAN(x->data, x->size);
-
-	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) - M_PI_2;
-
-	RUBh_minus_Q(x->data, params, f->data);
-	f->data[3] = fmod(omega, M_PI);
-
-	return  GSL_SUCCESS;
-}
-
-static const HklFunction constant_kphi_h_f1 = {
-	.function = _constant_kphi_h_f1,
-	.size = 4,
-};
-
-static int _constant_kphi_h_f2(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	const double komega = x->data[1];
-	const double kappa = x->data[2];
-	double omega;
-
-	CHECK_NAN(x->data, x->size);
-
-	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) + M_PI_2;
-
-	RUBh_minus_Q(x->data, params, f->data);
-	f->data[3] = fmod(omega, M_PI);
-
-	return  GSL_SUCCESS;
-}
-
-static const HklFunction constant_kphi_h_f2 = {
-	.function = _constant_kphi_h_f2,
-	.size = 4,
-};
-
-static int _constant_phi_h_f1(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	const double komega = x->data[1];
-	const double kappa = x->data[2];
-	const double kphi = x->data[3];
-	double omega, phi, p;
-
-	CHECK_NAN(x->data, x->size);
-
-	p = atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD));
-	omega = komega + p - M_PI_2;
-	phi = kphi + p + M_PI_2;
-
-	RUBh_minus_Q(x->data, params, f->data);
-	f->data[3] = fmod(omega, M_PI);
-	f->data[4] = phi;
-
-	return  GSL_SUCCESS;
-}
-
-static const HklFunction constant_phi_h_f1 = {
-	.function = _constant_phi_h_f1,
-	.size = 5,
-};
-
-static int _constant_phi_h_f2(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	const double komega = x->data[1];
-	const double kappa = x->data[2];
-	const double kphi = x->data[3];
-	double omega, phi, p;
-
-	CHECK_NAN(x->data, x->size);
-
-	p = atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD));
-	omega = komega + p + M_PI_2;
-	phi = kphi + p - M_PI_2;
-
-	RUBh_minus_Q(x->data, params, f->data);
-	f->data[3] = fmod(omega, M_PI);
-	f->data[4] = phi;
-
-	return  GSL_SUCCESS;
-}
-
-static const HklFunction constant_phi_h_f2 = {
-	.function = _constant_phi_h_f2,
-	.size = 5,
-};
-
-static int _bissector_v(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	const double komega = x->data[0];
-	const double kappa = x->data[1];
-	const double delta = x->data[3];
-	double omega;
-
-	CHECK_NAN(x->data, x->size);
-
-	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) - M_PI_2;
-
-	RUBh_minus_Q(x->data, params, f->data);
-	f->data[3] = fmod(delta - 2 * fmod(omega, M_PI), 2*M_PI);
-
-	return  GSL_SUCCESS;
-}
-
-static const HklFunction bissector_v = {
-	.function = _bissector_v,
-	.size = 4,
-};
-
-static int _constant_omega_v(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	const double komega = x->data[0];
-	const double kappa = x->data[1];
-	double omega;
-	HklEngine *engine = params;
-	double omega0;
-	uint shit;
-
-	hkl_parameter_list_values_get(&engine->mode->parameters, &omega0, &shit);
-
-	CHECK_NAN(x->data, x->size);
-
-	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) - M_PI_2;
-
-	RUBh_minus_Q(x->data, params, f->data);
-	f->data[3] = omega0 - omega;
-
-	return  GSL_SUCCESS;
-}
-
-static const HklFunction constant_omega_v = {
-	.function = _constant_omega_v,
-	.size = 4,
-};
-
-static int _constant_chi_v(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	const double kappa = x->data[1];
-	double chi;
-	HklEngine *engine = params;
-	double chi0;
-	uint shit;
-
-	hkl_parameter_list_values_get(&engine->mode->parameters, &chi0, &shit);
-
-	CHECK_NAN(x->data, x->size);
-
-	chi = 2 * asin(sin(kappa/2.) * sin(50 * HKL_DEGTORAD));
-
-	RUBh_minus_Q(x->data, params, f->data);
-	f->data[3] = chi0 - chi;
-
-	return  GSL_SUCCESS;
-}
-
-static const HklFunction constant_chi_v = {
-	.function = _constant_chi_v,
-	.size = 4,
-};
-
-static int _constant_phi_v(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	const double kappa = x->data[1];
-	const double kphi = x->data[2];
-	double phi;
-	HklEngine *engine = params;
-	double phi0;
-	uint shit;
-
-	hkl_parameter_list_values_get(&engine->mode->parameters, &phi0, &shit);
-
-	CHECK_NAN(x->data, x->size);
-
-	phi = kphi + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) + M_PI_2;
-
-	RUBh_minus_Q(x->data, params, f->data);
-	f->data[3] = phi0 - phi;
-
-	return  GSL_SUCCESS;
-}
-
-static const HklFunction constant_phi_v = {
-	.function = _constant_phi_v,
-	.size = 4,
-};
-
-static int _double_diffraction_h(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	const double komega = x->data[1];
-	const double kappa = x->data[2];
-	double omega;
-
-	CHECK_NAN(x->data, x->size);
-
-	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) - M_PI_2;
-
-	_double_diffraction(x->data, params, f->data);
-	f->data[4] = fmod(omega, M_PI);
-
-	return  GSL_SUCCESS;
-}
-
-static const HklFunction double_diffraction_h = {
-	.function = _double_diffraction_h,
-	.size = 5,
-};
-
-static int _constant_incidence_func(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	static const HklVector Y = {
-		.data = {0, 1, 0},
-	};
-	double incidence;
-	double azimuth;
-	HklEngine *engine = params;
-	HklModeAutoWithInit *mode = container_of(engine->mode, HklModeAutoWithInit, mode);
-	double parameters[5];
-	uint shit;
-	HklVector n;
-	double incidence0;
-	double azimuth0;
-	HklVector ki;
-
-	CHECK_NAN(x->data, x->size);
-
-	RUBh_minus_Q(x->data, params, f->data);
-
-	/* get the mode parameters */
-	hkl_parameter_list_values_get(&engine->mode->parameters,
-				      parameters, &shit);
-	n.data[0] = parameters[0];
-	n.data[1] = parameters[1];
-	n.data[2] = parameters[2];
-	incidence0 = parameters[3];
-	azimuth0 = parameters[4];
-
-	/* compute the two angles */
-
-
-	/* first check that the mode was already initialized if not
-	 * the surface is oriented along the nx, ny, nz axis for all
-	 * diffractometer angles equal to zero */
-	if(mode->geometry){
-		HklQuaternion q0 = darray_item(mode->geometry->holders, 0)->q;
-
-		hkl_quaternion_conjugate(&q0);
-		hkl_vector_rotated_quaternion(&n, &q0);
-	}
-
-	hkl_vector_rotated_quaternion(&n, &darray_item(engine->geometry->holders, 0)->q);
-
-	hkl_source_compute_ki(&engine->geometry->source, &ki);
-	incidence = M_PI_2 - hkl_vector_angle(&n, &ki);
-
-	hkl_vector_project_on_plan(&n, &ki);
-	azimuth = hkl_vector_angle(&n, &Y);
-
-	f->data[3] = incidence0 - incidence;
-	f->data[4] = azimuth0 - azimuth;
-
-	return  GSL_SUCCESS;
-}
-
-static const HklFunction constant_incidence_func = {
-	.function = _constant_incidence_func,
-	.size = 5,
-};
-
-/********/
-/* mode */
-/********/
-
-static HklMode *bissector_vertical(void)
-{
-	static const char* axes[] = {"komega", "kappa", "kphi", "delta"};
-	static const HklFunction *functions[] = {&bissector_v};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *constant_omega_vertical(void)
-{
-	static const char* axes[] = {"komega", "kappa", "kphi", "delta"};
-	static const HklFunction *functions[] = {&constant_omega_v};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "omega"},
-	};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *constant_chi_vertical(void)
-{
-	static const char* axes[] = {"komega", "kappa", "kphi", "delta"};
-	static const HklFunction *functions[] = {&constant_chi_v};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "chi"},
-	};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *constant_phi_vertical(void)
-{
-	static const char* axes[] = {"komega", "kappa", "kphi", "delta"};
-	static const HklFunction *functions[] = {&constant_phi_v};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "phi"},
-	};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *lifting_detector_kphi(void)
-{
-	static const char* axes[] = {"kphi", "gamma", "delta"};
-	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *lifting_detector_komega(void)
-{
-	static const char* axes[] = {"komega", "gamma", "delta"};
-	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *lifting_detector_mu(void)
-{
-	static const char* axes[] = {"mu", "gamma", "delta"};
-	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *double_diffraction_vertical(void)
-{
-	static const char* axes[] = {"komega", "kappa", "kphi", "delta"};
-	static const HklFunction *functions[] = {&double_diffraction_func};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 1,},
-	};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *bissector_horizontal(void)
-{
-	static const char* axes[] = {"mu", "komega", "kappa", "kphi", "gamma"};
-	static const HklFunction *functions[] = {&bissector_h_f1, &bissector_h_f2};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *constant_phi_horizontal(void)
-{
-	static const char* axes[] = {"mu", "komega", "kappa", "kphi", "gamma"};
-	static const HklFunction *functions[] = {&constant_phi_h_f1, &constant_phi_h_f2};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "phi",},
-	};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *constant_kphi_horizontal(void)
-{
-	static const char* axes[] = {"mu", "komega", "kappa", "gamma"};
-	static const HklFunction *functions[] = {&constant_kphi_h_f1, &constant_kphi_h_f2};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *double_diffraction_horizontal(void)
-{
-	static const char* axes[] = {"mu", "komega", "kappa", "kphi", "gamma"};
-	static const HklFunction *functions[] = {&double_diffraction_h};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 1,},
-	};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_mode_operations);
-}
-
-static HklMode *psi_constant_vertical(void)
-{
-	static const char* axes[] = {"komega", "kappa", "kphi", "delta"};
-	static const HklFunction *functions[] = {&psi_constant_vertical_func};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 0,},
-		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 0,},
-		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "psi"},
-	};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &psi_constant_vertical_mode_operations);
-}
-
-static HklMode *constant_incidence(void)
-{
-	static const char* axes[] = {"komega", "kappa", "kphi", "gamma", "delta"};
-	static const HklFunction *functions[] = {&constant_incidence_func};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS, .name = "x", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "y", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "z", .range = {.min=-1, .max=1}, ._value = 1,},
-		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "incidence"},
-		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "aximuth", ._value = M_PI_2,},
-	};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
-	};
-
-	return hkl_mode_auto_with_init_new(&info,
-					   &constant_incidence_mode_operations);
-}
-
-/**********************/
-/* pseudo axis engine */
-/**********************/
-
-HklEngine *hkl_engine_k6c_hkl_new(void)
-{
-	HklEngine *self;
-	HklMode *default_mode;
-
-	self = hkl_engine_hkl_new();
-
-	default_mode = bissector_vertical();
-	hkl_engine_add_mode(self, default_mode);
-	hkl_engine_select_mode(self, default_mode);
-
-	hkl_engine_add_mode(self, constant_omega_vertical());
-	hkl_engine_add_mode(self, constant_chi_vertical());
-	hkl_engine_add_mode(self, constant_phi_vertical());
-	hkl_engine_add_mode(self, lifting_detector_kphi());
-	hkl_engine_add_mode(self, lifting_detector_komega());
-	hkl_engine_add_mode(self, lifting_detector_mu());
-	hkl_engine_add_mode(self, double_diffraction_vertical());
-	hkl_engine_add_mode(self, bissector_horizontal());
-	hkl_engine_add_mode(self, constant_phi_horizontal());
-	hkl_engine_add_mode(self, constant_kphi_horizontal());
-	hkl_engine_add_mode(self, double_diffraction_horizontal());
-	hkl_engine_add_mode(self, psi_constant_vertical());
-	hkl_engine_add_mode(self, constant_incidence());
-
-	return self;
-}
diff --git a/hkl/hkl-pseudoaxis-k6c-private.h b/hkl/hkl-pseudoaxis-k6c-private.h
deleted file mode 100644
index fafa31d..0000000
--- a/hkl/hkl-pseudoaxis-k6c-private.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#ifndef __HKL_PSEUDOAXIS_K6C_H__
-#define __HKL_PSEUDOAXIS_K6C_H__
-
-#include "hkl-pseudoaxis-auto-private.h"
-
-HKL_BEGIN_DECLS
-
-extern HklEngine *hkl_engine_k6c_hkl_new(void);
-extern HklEngine *hkl_engine_k6c_psi_new(void);
-
-HKL_END_DECLS
-
-#endif /* __HKL_PSEUDOAXIS_K6C_H__ */
diff --git a/hkl/hkl-pseudoaxis-k6c-psi.c b/hkl/hkl-pseudoaxis-k6c-psi.c
deleted file mode 100644
index d5914b7..0000000
--- a/hkl/hkl-pseudoaxis-k6c-psi.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include "hkl/ccan/array_size/array_size.h"
-
-#include "hkl-parameter-private.h"
-#include "hkl-pseudoaxis-auto-private.h"
-#include "hkl-pseudoaxis-common-psi-private.h"
-
-static HklMode *psi_vertical()
-{
-	static const HklFunction *functions[] = {&psi_func};
-	static const char *axes[] = {"komega", "kappa", "kphi", "delta"};
-	static const HklParameter parameters[] = {
-		{HKL_PARAMETER_DEFAULTS, .name = "h1", .range = {.min=-1, .max=1}, ._value=1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "k1", .range = {.min=-1, .max=1}, ._value=1,},
-		{HKL_PARAMETER_DEFAULTS, .name = "l1", .range = {.min=-1, .max=1}, ._value=1,},
-	};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
-	};
-
-	return hkl_mode_psi_new(&info);
-}
-
-HklEngine *hkl_engine_k6c_psi_new(void)
-{
-	HklEngine *self;
-	HklMode *default_mode;
-
-	self = hkl_engine_psi_new();
-
-	default_mode = psi_vertical();
-	hkl_engine_add_mode(self, default_mode);
-	hkl_engine_select_mode(self, default_mode);
-
-	return self;
-}
diff --git a/hkl/hkl-pseudoaxis-petra3-hkl.c b/hkl/hkl-pseudoaxis-petra3-hkl.c
deleted file mode 100644
index be48244..0000000
--- a/hkl/hkl-pseudoaxis-petra3-hkl.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2010-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include <gsl/gsl_math.h>
-#include <gsl/gsl_vector.h>
-
-#include "hkl/ccan/array_size/array_size.h"
-
-#include "hkl-pseudoaxis-auto-private.h"
-#include "hkl-pseudoaxis-common-hkl-private.h"
-
-/***********************/
-/* numerical functions */
-/***********************/
-
-static int _reflectivity(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	const double mu = x->data[0];
-	const double gamma = x->data[3];
-
-	CHECK_NAN(x->data, x->size);
-
-	RUBh_minus_Q(x->data, params, f->data);
-	f->data[3] = mu - gamma;
-
-	return  GSL_SUCCESS;
-}
-
-static const HklFunction reflectivity = {
-	.function = _reflectivity,
-	.size = 4,
-};
-
-static int _bissector_horizontal(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	const double omega = x->data[0];
-	const double delta = x->data[3];
-
-	CHECK_NAN(x->data, x->size);
-
-	RUBh_minus_Q(x->data, params, f->data);
-	f->data[3] = delta - 2 * fmod(omega, M_PI);
-
-	return  GSL_SUCCESS;
-}
-
-static const HklFunction bissector_horizontal = {
-	.function = _bissector_horizontal,
-	.size = 4,
-};
-
-/********/
-/* mode */
-/********/
-
-static HklMode *zaxis_alpha_fixed()
-{
-	static const char *axes[] = {"omega", "delta", "gamma"};
-	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO("zaxis + alpha-fixed", axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_full_mode_operations);
-}
-
-static HklMode *zaxis_beta_fixed()
-{
-	static const char *axes[] = {"mu", "delta", "gamma"};
-	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO("zaxis + beta-fixed", axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_full_mode_operations);
-}
-
-static HklMode *zaxis_alpha_eq_beta()
-{
-	static const char *axes[] = {"mu", "omega", "delta", "gamma"};
-	static const HklFunction *functions[] = {&reflectivity};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO("zaxis + alpha=beta", axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_full_mode_operations);
-}
-
-static HklMode *fourc_bissector_horizontal()
-{
-	static const char *axes[] = {"omega", "chi", "phi", "delta"};
-	static const HklFunction *functions[] = {&bissector_horizontal};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO("4-circles bissecting horizontal", axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_full_mode_operations);
-}
-
-static HklMode *fourc_constant_omega_horizontal()
-{
-	static const char *axes[] = {"chi", "phi", "delta"};
-	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO("4-circles constant omega horizontal", axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_full_mode_operations);
-}
-
-static HklMode *fourc_constant_chi_horizontal()
-{
-	static const char *axes[] = {"omega", "phi", "delta"};
-	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO("4-circles constant chi horizontal", axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_full_mode_operations);
-}
-
-static HklMode *fourc_constant_phi_horizontal()
-{
-	static const char *axes[] = {"omega", "chi", "delta"};
-	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO("4-circles constant phi horizontal", axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_full_mode_operations);
-}
-
-/**********************/
-/* pseudo axis engine */
-/**********************/
-
-HklEngine *hkl_engine_petra3_p09_eh2_hkl_new(void)
-{
-	HklEngine *self;
-	HklMode *default_mode;
-
-	self = hkl_engine_hkl_new();
-
-	default_mode = zaxis_alpha_fixed();
-	hkl_engine_add_mode(self, default_mode);
-	hkl_engine_select_mode(self, default_mode);
-
-	hkl_engine_add_mode(self, zaxis_beta_fixed());
-	hkl_engine_add_mode(self, zaxis_alpha_eq_beta());
-	hkl_engine_add_mode(self, fourc_bissector_horizontal());
-	hkl_engine_add_mode(self, fourc_constant_omega_horizontal());
-	hkl_engine_add_mode(self, fourc_constant_chi_horizontal());
-	hkl_engine_add_mode(self, fourc_constant_phi_horizontal());
-
-	return self;
-}
diff --git a/hkl/hkl-pseudoaxis-petra3-private.h b/hkl/hkl-pseudoaxis-petra3-private.h
deleted file mode 100644
index 678f8d6..0000000
--- a/hkl/hkl-pseudoaxis-petra3-private.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2011-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#ifndef __HKL_PSEUDOAXIS_PETRA3_H__
-#define __HKL_PSEUDOAXIS_PETRA3_H__
-
-#include "hkl-pseudoaxis-auto-private.h"
-
-HKL_BEGIN_DECLS
-
-extern HklEngine *hkl_engine_petra3_p09_eh2_hkl_new(void);
-
-HKL_END_DECLS
-
-#endif /* __HKL_PSEUDOAXIS_PETRA3_H__ */
diff --git a/hkl/hkl-pseudoaxis-private.h b/hkl/hkl-pseudoaxis-private.h
index 892322b..e09ecd8 100644
--- a/hkl/hkl-pseudoaxis-private.h
+++ b/hkl/hkl-pseudoaxis-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,207 +22,272 @@
 #ifndef __HKL_PSEUDOAXIS_PRIVATE_H__
 #define __HKL_PSEUDOAXIS_PRIVATE_H__
 
-#include <string.h>
-#include <gsl/gsl_vector.h>
-#include <gsl/gsl_sf_trig.h>
-
-#include "hkl.h"
-#include "hkl-geometry-private.h"
-#include "hkl-parameter-private.h"
-
-HKL_BEGIN_DECLS
-
+#include <gsl/gsl_sf_trig.h>            // for gsl_sf_angle_restrict_symm
+#include <stddef.h>                     // for size_t
+#include <stdlib.h>                     // for free
+#include <string.h>                     // for NULL
+#include <sys/types.h>                  // for uint
+#include "hkl-detector-private.h"
+#include "hkl-geometry-private.h"       // for hkl_geometry_update, etc
+#include "hkl-macros-private.h"         // for HKL_MALLOC
+#include "hkl-parameter-private.h"      // for hkl_parameter_list_free, etc
+#include "hkl.h"                        // for HklEngine, HklMode, etc
+#include "hkl/ccan/darray/darray.h"     // for darray_foreach, etc
+
+G_BEGIN_DECLS
+
+typedef struct _HklPseudoAxis HklPseudoAxis;
 typedef struct _HklModeOperations HklModeOperations;
 typedef struct _HklModeInfo HklModeInfo;
+typedef struct _HklMode HklMode;
 typedef struct _HklEngineInfo HklEngineInfo;
 typedef struct _HklEngineOperations HklEngineOperations;
 
-struct _HklModeInfo {
-	const char *name;
-	const char **axes;
-	uint n_axes;
-	const HklParameter *parameters;
-	uint n_parameters;
-};
+typedef darray(HklMode *) darray_mode;
 
-struct _HklMode
+/*****************/
+/* HklPseudoAxis */
+/*****************/
+
+struct _HklPseudoAxis
 {
-	const HklModeInfo *info;
-	const HklModeOperations *ops;
-	darray_parameter parameters;
+	HklParameter parameter;
+	HklEngine *engine;
 };
 
-struct _HklEngineInfo {
-	const char *name;
-	const HklPseudoAxis **pseudo_axes;
-	uint n_pseudo_axes;
-};
 
-struct _HklEngine
+#define HKL_PARAMETER_OPERATIONS_PSEUDOAXIS_DEFAULTS HKL_PARAMETER_OPERATIONS_DEFAULTS,	\
+		.copy = hkl_parameter_copy_pseudo_axis_real,		\
+		.free = hkl_parameter_free_pseudo_axis_real,		\
+		.fprintf = hkl_parameter_fprintf_pseudo_axis_real
+
+
+static inline HklParameter *hkl_parameter_copy_pseudo_axis_real(const HklParameter *self)
 {
-	const HklEngineInfo *info;
-	const HklEngineOperations *ops;
-	HklGeometry *geometry;
-	HklDetector *detector;
-	HklSample *sample;
-	HklMode *mode; /* not owned */
-	HklEngineList *engines; /* not owned */
-	darray_parameter pseudo_axes;
-	darray_mode modes;
-	darray_parameter axes;
-};
+	HklPseudoAxis *pseudo_axis = container_of(self, HklPseudoAxis, parameter);
+	HklPseudoAxis *dup = HKL_MALLOC(HklPseudoAxis);
 
-struct _HklEngineList
+	*dup = *pseudo_axis;
+
+	return &dup->parameter;
+}
+
+
+static inline void hkl_parameter_free_pseudo_axis_real(HklParameter *self)
 {
-	_darray(HklEngine *);
-	HklGeometryList *geometries;
-	HklGeometry *geometry;
-	HklDetector *detector;
-	HklSample *sample;
-};
+	HklPseudoAxis *pseudo_axis = container_of(self, HklPseudoAxis, parameter);
 
-#define INFO(n, ax) .name = n, .axes=ax, .n_axes=ARRAY_SIZE(ax)
-#define INFO_WITH_PARAMS(name, axes, parameters) INFO(name, axes), .parameters=parameters, .n_parameters=ARRAY_SIZE(parameters)
+	free(pseudo_axis);
+}
 
-static inline void set_geometry_axes(HklEngine *engine, const double values[])
+
+static inline void hkl_parameter_fprintf_pseudo_axis_real(FILE *f, const HklParameter *self)
 {
-	HklParameter **axis;
-	uint i = 0;
+	HklPseudoAxis *pseudo_axis = container_of(self, HklPseudoAxis, parameter);
 
-	darray_foreach(axis, engine->axes){
-		hkl_parameter_value_set(*axis, values[i++], NULL);
-	}
-	hkl_geometry_update(engine->geometry);
+	hkl_parameter_fprintf_real(f, self);
+	fprintf(f, " %p", pseudo_axis->engine);
 }
 
-/*****************/
-/* HklPseudoAxis */
-/*****************/
 
-struct _HklPseudoAxis
+static inline HklParameter *hkl_parameter_new_pseudo_axis(const HklParameter *parameter,
+							  HklEngine *engine)
 {
-	HklParameter parameter;
-	HklEngine *engine;
-};
+	HklPseudoAxis *self;
+	static HklParameterOperations ops = {HKL_PARAMETER_OPERATIONS_PSEUDOAXIS_DEFAULTS};
+
+	self = HKL_MALLOC(HklPseudoAxis);
 
-extern HklParameter *hkl_parameter_new_pseudo_axis(
-	const HklParameter *parameter,
-	HklEngine *engine);
+	self->parameter = *parameter;
+	self->parameter.ops = &ops;
+	self->engine = engine;
+
+	return &self->parameter;
+}
 
 /***********/
 /* HklMode */
 /***********/
 
+struct _HklModeInfo {
+	const char *name;
+	const darray_string axes_r;
+	const darray_string axes_w;
+	const darray(const HklParameter) parameters;
+};
+
+#define HKL_MODE_INFO(_name, _axes_r, _axes_w) .name=_name, .axes_r=DARRAY(_axes_r), .axes_w=DARRAY(_axes_w)
+
+#define HKL_MODE_INFO_WITH_PARAMS(_name, _axes_r, _axes_w, _parameters)	\
+	HKL_MODE_INFO(_name, _axes_r, _axes_w), .parameters=DARRAY(_parameters)
+
 struct _HklModeOperations
 {
+	unsigned long capabilities;
+
 	void (* free)(HklMode *self);
-	int (* init)(HklMode *self,
-		     HklEngine *engine,
-		     HklGeometry *geometry,
-		     HklDetector *detector,
-		     HklSample *sample,
-		     HklError **error);
+	int (* initialized_get)(const HklMode *self);
+	int (* initialized_set)(HklMode *self,
+				HklEngine *engine,
+				HklGeometry *geometry,
+				HklDetector *detector,
+				HklSample *sample,
+				int initialized,
+				GError **error);
 	int (* get)(HklMode *self,
 		    HklEngine *engine,
 		    HklGeometry *geometry,
 		    HklDetector *detector,
 		    HklSample *sample,
-		    HklError **error);
+		    GError **error);
 	int (* set)(HklMode *self,
 		    HklEngine *engine,
 		    HklGeometry *geometry,
 		    HklDetector *detector,
 		    HklSample *sample,
-		    HklError **error);
+		    GError **error);
 };
 
-#define HKL_MODE_OPERATIONS_DEFAULTS		\
-	.free=hkl_mode_free_real,		\
-		.init=hkl_mode_init_real,	\
-		.get=hkl_mode_get_real,		\
+
+#define HKL_MODE_OPERATIONS_DEFAULTS .capabilities=HKL_ENGINE_CAPABILITIES_READABLE | HKL_ENGINE_CAPABILITIES_WRITABLE, \
+		.free=hkl_mode_free_real,				\
+		.initialized_get=hkl_mode_initialized_get_real,		\
+		.initialized_set=hkl_mode_initialized_set_real,		\
+		.get=hkl_mode_get_real,					\
 		.set=hkl_mode_set_real
 
+
+struct _HklMode
+{
+	const HklModeInfo *info;
+	const HklModeOperations *ops;
+	darray_parameter parameters;
+	darray_string parameters_names;
+	int initialized;
+};
+
+
 static inline void hkl_mode_free_real(HklMode *self)
 {
-	hkl_parameter_list_free(&self->parameters);
+	HklParameter **parameter;
+
+	darray_foreach(parameter, self->parameters){
+		hkl_parameter_free(*parameter);
+	}
+	darray_free(self->parameters);
+
+	darray_free(self->parameters_names);
 
 	free(self);
 }
 
-static int hkl_mode_init_real(HklMode *mode,
-			      HklEngine *self,
-			      HklGeometry *geometry,
-			      HklDetector *detector,
-			      HklSample *sample,
-			      HklError **error)
+
+static inline int hkl_mode_initialized_get_real(const HklMode *self)
+{
+	return self->initialized;
+}
+
+
+static inline int hkl_mode_initialized_get(const HklMode *self)
 {
-	if (!self || !mode || !geometry || !detector || !sample)
-		return HKL_FALSE;
+	return self->ops->initialized_get(self);
+}
 
-	/* update the geometry internals */
-	hkl_geometry_update(geometry);
 
-	return HKL_TRUE;
+static inline int hkl_mode_initialized_set_real(HklMode *self,
+						HklEngine *engine,
+						HklGeometry *geometry,
+						HklDetector *detector,
+						HklSample *sample,
+						int initialized,
+						GError **error)
+{
+	/* by default do nothing and no error */
+	return TRUE;
 }
 
-static int hkl_mode_get_real(HklMode *self,
-			     HklEngine *engine,
-			     HklGeometry *geometry,
-			     HklDetector *detector,
-			     HklSample *sample,
-			     HklError **error)
+
+static inline int hkl_mode_initialized_set(HklMode *self,
+					   HklEngine *engine,
+					   HklGeometry *geometry,
+					   HklDetector *detector,
+					   HklSample *sample,
+					   int initialized,
+					   GError **error)
 {
-	return HKL_TRUE;
+	return self->ops->initialized_set(self,
+					  engine, geometry, detector, sample,
+					  initialized, error);
 }
 
-static int hkl_mode_set_real(HklMode *self,
-			     HklEngine *engine,
-			     HklGeometry *geometry,
-			     HklDetector *detector,
-			     HklSample *sample,
-			     HklError **error)
+
+static inline int hkl_mode_get_real(HklMode *self,
+				    HklEngine *engine,
+				    HklGeometry *geometry,
+				    HklDetector *detector,
+				    HklSample *sample,
+				    GError **error)
 {
-	return HKL_TRUE;
+	/* by default do nothing and no error */
+	return TRUE;
 }
 
-static inline int hkl_mode_init(
-	HklMode *self,
-	const HklModeInfo *info,
-	const HklModeOperations *ops)
+
+static inline int hkl_mode_set_real(HklMode *self,
+				    HklEngine *engine,
+				    HklGeometry *geometry,
+				    HklDetector *detector,
+				    HklSample *sample,
+				    GError **error)
+{
+	/* by default do nothing and no error */
+	return TRUE;
+}
+
+
+static inline int hkl_mode_init(HklMode *self,
+				const HklModeInfo *info,
+				const HklModeOperations *ops,
+				int initialized)
 {
 	size_t i;
+	const HklParameter *parameter;
 
 	/* ensure part */
 	if (!self)
-		return HKL_FALSE;
+		return FALSE;
 
 	self->info = info;
 	self->ops = ops;
 
 	/* parameters */
 	darray_init(self->parameters);
-	for(i=0; i<self->info->n_parameters; ++i){
-		darray_append(self->parameters,
-			      hkl_parameter_new_copy(&self->info->parameters[i]));
+	darray_init(self->parameters_names);
+	darray_foreach(parameter, self->info->parameters){
+		darray_append(self->parameters, hkl_parameter_new_copy(parameter));
+		darray_append(self->parameters_names, parameter->name);
 	}
 
-	return HKL_TRUE;
+	self->initialized = initialized;
+
+	return TRUE;
 }
 
-static inline HklMode *hkl_mode_new(
-	const HklModeInfo *info,
-	const HklModeOperations *op)
+
+static inline HklMode *hkl_mode_new(const HklModeInfo *info,
+				    const HklModeOperations *op,
+				    int initialized)
 {
 	HklMode *self = NULL;
 
-
 	self = HKL_MALLOC(HklMode);
 
-	hkl_mode_init(self, info, op);
+	hkl_mode_init(self, info, op, initialized);
 
 	return self;
 }
 
+
 /**
  * hkl_mode_free: (skip)
  * @self:
@@ -238,9 +303,78 @@ static inline void hkl_mode_free(HklMode *self)
 /* HklEngine */
 /*************/
 
-static void hkl_engine_release(HklEngine *self)
+
+struct _HklEngineInfo {
+	const char *name;
+	const darray(const HklPseudoAxis *) pseudo_axes;
+};
+
+
+struct _HklEngine
+{
+	const HklEngineInfo *info;
+	const HklEngineOperations *ops;
+	HklGeometry *geometry;
+	HklDetector *detector;
+	HklSample *sample;
+	HklMode *mode; /* not owned */
+	HklEngineList *engines; /* not owned */
+	darray_parameter axes;
+	darray_parameter pseudo_axes;
+	darray_string pseudo_axis_names;
+	darray_mode modes;
+	darray_string mode_names;
+};
+
+
+struct _HklEngineList
+{
+	_darray(HklEngine *);
+	HklGeometryList *geometries;
+	HklGeometry *geometry;
+	HklDetector *detector;
+	HklSample *sample;
+};
+
+
+#define HKL_ENGINE_ERROR hkl_engine_error_quark ()
+
+
+static GQuark hkl_engine_error_quark (void)
+{
+	return g_quark_from_static_string ("hkl-engine-error-quark");
+}
+
+
+typedef enum {
+	HKL_ENGINE_ERROR_PSEUDO_AXIS_VALUES_GET, /* can not get the engine pseudo axes values */
+	HKL_ENGINE_ERROR_PSEUDO_AXIS_VALUES_SET, /* can not set the engine pseudo axes values */
+	HKL_ENGINE_ERROR_PSEUDO_AXIS_SET, /* can not set the pseudo axis */
+	HKL_ENGINE_ERROR_INITIALIZE, /* can not initialize the engine */
+	HKL_ENGINE_ERROR_SET, /* can not set the engine */
+	HKL_ENGINE_ERROR_GET, /* can not get the engine */
+	HKL_ENGINE_ERROR_PARAMETER_GET, /* can not get the parameter */
+	HKL_ENGINE_ERROR_PARAMETER_SET, /* can not set the parameter */
+	HKL_ENGINE_ERROR_CURRENT_MODE_SET, /* can not select the mode */
+} HklEngineError;
+
+
+static inline void set_geometry_axes(HklEngine *engine, const double values[])
+{
+	HklParameter **axis;
+	uint i = 0;
+
+	darray_foreach(axis, engine->axes){
+		hkl_parameter_value_set(*axis, values[i++], HKL_UNIT_DEFAULT, NULL);
+	}
+	hkl_geometry_update(engine->geometry);
+}
+
+
+static inline void hkl_engine_release(HklEngine *self)
 {
 	HklMode **mode;
+	HklParameter **pseudo_axis;
 
 	if(self->geometry)
 		hkl_geometry_free(self->geometry);
@@ -260,35 +394,70 @@ static void hkl_engine_release(HklEngine *self)
 	darray_free(self->axes);
 
 	/* release the HklPseudoAxe memory */
-	hkl_parameter_list_free(&self->pseudo_axes);
+	darray_foreach(pseudo_axis, self->pseudo_axes){
+		hkl_parameter_free(*pseudo_axis);
+	}
+	darray_free(self->pseudo_axes);
+
+	darray_free(self->pseudo_axis_names);
+
+	darray_free(self->mode_names);
 }
 
+
 struct _HklEngineOperations
 {
 	void (*free)(HklEngine *self);
 };
 
-#define HKL_ENGINE_OPERATIONS_DEFAULTS		\
-	.free=hkl_engine_free_real
+
+#define HKL_ENGINE_OPERATIONS_DEFAULTS .free=hkl_engine_free_real
+
 
 static inline void hkl_engine_free_real(HklEngine *self)
 {
 }
 
-static void hkl_engine_free(HklEngine *self)
+
+static inline void hkl_engine_free(HklEngine *self)
 {
 	self->ops->free(self);
 }
 
-extern void hkl_engine_init(HklEngine *engine,
-			    const HklEngineInfo *info,
-			    const HklEngineOperations *ops);
 
+static inline void hkl_engine_init(HklEngine *self,
+				   const HklEngineInfo *info,
+				   const HklEngineOperations *ops)
+{
+	self->info = info;
+	self->ops = ops;
+	darray_init(self->modes);
+	darray_init(self->pseudo_axes);
+	darray_init(self->pseudo_axis_names);
+	darray_init(self->mode_names);
+	self->geometry = NULL;
+	self->detector = NULL;
+	self->sample = NULL;
+}
+
+
+static inline void unregister_pseudo_axis(HklParameter *pseudo_axis)
+{
+	hkl_parameter_free(pseudo_axis);
+}
 
-extern void unregister_pseudo_axis(HklParameter *pseudo_axis);
 
-extern HklParameter *register_pseudo_axis(HklEngine *self,
-					  const HklParameter *parameter);
+static inline HklParameter *register_pseudo_axis(HklEngine *self,
+						 const HklParameter *pseudo_axis)
+{
+	HklParameter *parameter;
+
+	parameter = hkl_parameter_new_pseudo_axis(pseudo_axis, self);
+	darray_append(self->pseudo_axes, parameter);
+	darray_append(self->pseudo_axis_names, parameter->name);
+	
+	return parameter;
+}
 
 /**
  * hkl_engine_add_mode: (skip)
@@ -301,6 +470,7 @@ static inline void hkl_engine_add_mode(HklEngine *self,
 				       HklMode *mode)
 {
 	darray_append(self->modes, mode);
+	darray_append(self->mode_names, mode->info->name);
 }
 
 /**
@@ -324,25 +494,253 @@ static inline void hkl_engine_add_geometry(HklEngine *self,
 	darray_foreach(axis, self->axes){
 		hkl_parameter_value_set(*axis,
 					gsl_sf_angle_restrict_symm(x[i++]),
+					HKL_UNIT_DEFAULT,
 					NULL);
 	}
 
 	hkl_geometry_list_add(self->engines->geometries, self->geometry);
 }
 
-/*****************/
+
+static inline void hkl_engine_prepare_internal(HklEngine *self)
+{
+	uint i;
+
+	if(!self || !self->engines)
+		return;
+
+	/* set */
+	if(self->geometry)
+		hkl_geometry_free(self->geometry);
+	self->geometry = hkl_geometry_new_copy(self->engines->geometry);
+
+	if(self->detector)
+		hkl_detector_free(self->detector);
+	self->detector = hkl_detector_new_copy(self->engines->detector);
+
+	if(self->sample)
+		hkl_sample_free(self->sample);
+	self->sample = hkl_sample_new_copy(self->engines->sample);
+
+	/* fill the axes member from the function */
+	if(self->mode){
+		const char **axis_name;
+
+		darray_free(self->axes);
+		darray_init(self->axes);
+		darray_foreach(axis_name, self->mode->info->axes_w){
+			HklParameter *axis = hkl_geometry_get_axis_by_name(self->geometry,
+									   *axis_name);
+			darray_append(self->axes, axis);
+		}
+	}
+
+	/* reset the geometries len */
+	hkl_geometry_list_reset(self->engines->geometries);
+}
+
+/**
+ * hkl_engine_mode_set: (skip)
+ * @self: the HklEngine
+ * @name: the mode to select
+ *
+ * This method also populate the self->axes from the mode->axis_names.
+ * this is to speed the computation of the numerical axes.
+ **/
+static inline void hkl_engine_mode_set(HklEngine *self, HklMode *mode)
+{
+	self->mode = mode;
+	hkl_engine_prepare_internal(self);
+}
+
+
+static inline int hkl_engine_get(HklEngine *self,
+				 GError **error) HKL_ARG_NONNULL(1);
+/**
+ * hkl_engine_get: (skip)
+ * @self: The HklEngine
+ * @error: return location for a GError, or NULL
+ *
+ * get the values of the pseudo-axes from the real-axes values
+ *
+ * return value: TRUE if succeded or FALSE otherwise.
+ **/
+static inline int hkl_engine_get(HklEngine *self, GError **error)
+{
+	hkl_error (error == NULL || *error == NULL);
+
+	if(!self->engines || !self->engines->geometry || !self->engines->detector
+	   || !self->engines->sample || !self->mode || !self->mode->ops->get){
+		g_set_error(error,
+			    HKL_ENGINE_ERROR,
+			    HKL_ENGINE_ERROR_GET,
+			    "Internal error");
+		return FALSE;
+	}
+
+	if (!self->mode->ops->get(self->mode,
+				  self,
+				  self->engines->geometry,
+				  self->engines->detector,
+				  self->engines->sample,
+				  error)){
+		hkl_assert(error == NULL || *error != NULL);
+		return FALSE;
+	}
+	hkl_assert(error == NULL || *error == NULL);
+
+	return TRUE;
+}
+
+
+/**
+ * hkl_engine_set: (skip)
+ * @self: the HklEngine
+ * @error: return location for a GError, or NULL
+ *
+ * use the HklPseudoaxisEngine values to compute the real axes values.
+ *
+ * return value: TRUE if succeded or FALSE otherwise.
+ **/
+static inline int hkl_engine_set(HklEngine *self, GError **error)
+{
+	hkl_error (error == NULL || *error == NULL);
+
+	if(!self->geometry || !self->detector || !self->sample
+	   || !self->mode || !self->mode->ops->set){
+		g_set_error(error,
+			    HKL_ENGINE_ERROR,
+			    HKL_ENGINE_ERROR_SET,
+			    "Internal error");
+		return FALSE;
+	}
+
+	hkl_engine_prepare_internal(self);
+
+	if (!self->mode->ops->set(self->mode, self,
+				  self->geometry,
+				  self->detector,
+				  self->sample,
+				  error)){
+		hkl_assert(error == NULL || *error != NULL);
+		return FALSE;
+	}
+	hkl_assert(error == NULL || *error == NULL);
+
+	hkl_geometry_list_multiply(self->engines->geometries);
+	hkl_geometry_list_multiply_from_range(self->engines->geometries);
+	hkl_geometry_list_remove_invalid(self->engines->geometries);
+	hkl_geometry_list_sort(self->engines->geometries, self->engines->geometry);
+
+	if(self->engines->geometries->n_items == 0){
+		g_set_error(error,
+			    HKL_ENGINE_ERROR,
+			    HKL_ENGINE_ERROR_SET,
+			    "no remaining solutions");
+		return FALSE;
+	}
+
+	return TRUE;
+}
+
 /* HklEngineList */
-/*****************/
 
-extern HklEngineList *hkl_engine_list_new(void);
 
-extern const HklEngineList *hkl_engine_list_new_copy(const HklEngineList *self);
+#define HKL_ENGINE_LIST_ERROR hkl_engine_list_error_quark ()
+
+
+static GQuark hkl_engine_list_error_quark (void)
+{
+	return g_quark_from_static_string ("hkl-engine-list-error-quark");
+}
+
+
+typedef enum {
+	HKL_ENGINE_LIST_ERROR_ENGINE_GET_BY_NAME, /* can not set this geometry */
+	HKL_ENGINE_LIST_ERROR_PSEUDO_AXIS_GET_BY_NAME, /* can not set this geometry */
+} HklEngineListError;
+
+
+/**
+ * hkl_engine_list_new: (skip)
+ *
+ * default constructor
+ *
+ * Returns:
+ **/
+static inline HklEngineList *hkl_engine_list_new(void)
+{
+	HklEngineList *self = NULL;
+
+	self = HKL_MALLOC(HklEngineList);
+
+	darray_init(*self);
 
-extern int hkl_engine_list_add(HklEngineList *self,
-			       HklEngine *engine);
+	self->geometries = hkl_geometry_list_new();
+
+	self->geometry = NULL;
+	self->detector = NULL;
+	self->sample = NULL;
+
+	return self;
+}
+
+
+/**
+ * hkl_engine_list_new_copy: (skip)
+ * @self:
+ *
+ * dummy copy constructor for the binding
+ *
+ * Returns: (transfer none): NULL all the time the structure is non-copyable
+ **/
+static inline const HklEngineList *hkl_engine_list_new_copy(const HklEngineList *self)
+{
+	return NULL;
+}
+
+
+/**
+ * hkl_engine_list_add: (skip)
+ * @self: the engine list
+ * @engine: the engine to add
+ *
+ * add an #HklEngine to the #HklEngineList
+ *
+ * Returns: HKL_SUCCESS or HKL_FAIL
+ **/
+static inline int hkl_engine_list_add(HklEngineList *self,
+				      HklEngine *engine)
+{
+	if (!engine)
+		return FALSE;
+
+	/* set the engines to access the Geometries list. */
+	engine->engines = self;
+
+	darray_append(*self, engine);
+
+	return TRUE;
+}
+
+
+/**
+ * hkl_engine_list_clear: (skip)
+ * @self: the engine list to clear
+ *
+ * remove all engine from the engine list
+ **/
+static inline void hkl_engine_list_clear(HklEngineList *self)
+{
+	HklEngine **engine;
+
+	darray_foreach(engine, *self){
+		hkl_engine_free(*engine);
+	}
+	darray_free(*self);
+}
 
-extern void hkl_engine_list_clear(HklEngineList *self);
 
-HKL_END_DECLS
+G_END_DECLS
 
 #endif /* __HKL_PSEUDOAXIS_PRIVATE_H__ */
diff --git a/hkl/hkl-pseudoaxis-soleil-sixs-med-private.h b/hkl/hkl-pseudoaxis-soleil-sixs-med-private.h
deleted file mode 100644
index 14b4b54..0000000
--- a/hkl/hkl-pseudoaxis-soleil-sixs-med-private.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2011-2013 Synchrotron SOLEIL
- *                    L'Orme des Merisiers Saint-Aubin
- *                    BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#ifndef __HKL_PSEUDOAXIS_SOLEIL_SIXS_MED_H__
-#define __HKL_PSEUDOAXIS_SOLEIL_SIXS_MED_H__
-
-#include "hkl-pseudoaxis-auto-private.h"
-
-HKL_BEGIN_DECLS
-
-extern HklEngine *hkl_engine_soleil_sixs_med_2_2_hkl_new(void);
-extern HklEngine *hkl_engine_soleil_sixs_med_1_2_hkl_new(void);
-extern HklEngine *hkl_engine_soleil_sixs_med_2_3_hkl_new(void);
-
-extern void hkl_geometry_list_multiply_soleil_sixs_med_2_3(HklGeometryList *self,
-							   HklGeometryListItem *item);
-
-HKL_END_DECLS
-
-#endif /* __HKL_PSEUDOAXIS_SOLEIL_SIXS_MED_H__ */
diff --git a/hkl/hkl-pseudoaxis-soleil-sixs-med.c b/hkl/hkl-pseudoaxis-soleil-sixs-med.c
deleted file mode 100644
index 3b4d54b..0000000
--- a/hkl/hkl-pseudoaxis-soleil-sixs-med.c
+++ /dev/null
@@ -1,285 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2011-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include "hkl/ccan/array_size/array_size.h"
-#include <gsl/gsl_multiroots.h>
-#include <gsl/gsl_sf_trig.h>
-
-#include "hkl-axis-private.h"
-#include "hkl-pseudoaxis-auto-private.h"
-#include "hkl-pseudoaxis-common-hkl-private.h"
-
-/***********************/
-/* numerical functions */
-/***********************/
-
-static int _reflectivity_func(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	const double mu = x->data[0];
-	const double gamma = x->data[2];
-
-	CHECK_NAN(x->data, x->size);
-
-	RUBh_minus_Q(x->data, params, f->data);
-	f->data[3] = gamma - 2 * mu;
-
-	return  GSL_SUCCESS;
-}
-
-static const HklFunction reflectivity_func = {
-	.function = _reflectivity_func,
-	.size = 4,
-};
-
-/***********/
-/* HklMode */
-/***********/
-
-static HklMode* mu_fixed()
-{
-	static const char* axes[] = {"omega", "gamma", "delta"};
-	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_full_mode_operations);
-}
-
-static HklMode* reflectivity()
-{
-	static const char* axes[] = {"mu", "omega", "gamma", "delta"};
-	static const HklFunction *functions[] = {&reflectivity_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_full_mode_operations);
-}
-
-/*********************/
-/* MED 2+2 HklEngine */
-/*********************/
-
-HklEngine *hkl_engine_soleil_sixs_med_2_2_hkl_new(void)
-{
-	HklEngine *self;
-	HklMode *default_mode;
-
-	self = hkl_engine_hkl_new();
-
-	default_mode = mu_fixed();
-	hkl_engine_add_mode(self, default_mode);
-	hkl_engine_select_mode(self, default_mode);
-
-	hkl_engine_add_mode(self, reflectivity());
-
-	return self;
-}
-
-/*********************/
-/* MED 1+2 HklEngine */
-/*********************/
-
-static HklMode* pitch_fixed()
-{
-	static const char* axes[] = {"mu", "gamma", "delta"};
-	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_full_mode_operations);
-}
-
-HklEngine *hkl_engine_soleil_sixs_med_1_2_hkl_new(void)
-{
-	HklEngine *self;
-	HklMode *default_mode;
-
-	self = hkl_engine_hkl_new();
-
-	default_mode = pitch_fixed();
-	hkl_engine_add_mode(self, default_mode);
-	hkl_engine_select_mode(self, default_mode);
-
-	return self;
-}
-
-/*********************/
-/* MED 2+3 HklEngine */
-/*********************/
-
-typedef struct _HklSlitsFit HklSlitsFit;
-struct _HklSlitsFit
-{
-	HklGeometry *geometry;
-	HklVector surface;
-	unsigned int slits_id;
-	unsigned int len;
-	HklParameter *axis;
-};
-
-static int slits_func(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	double const *x_data = gsl_vector_const_ptr(x, 0);
-	double *f_data = gsl_vector_ptr(f, 0);
-	HklVector n_slits = {{0, 0, 1}};
-	HklSlitsFit *parameters = params;
-
-	hkl_parameter_value_set(parameters->axis, x_data[0], NULL);
-	hkl_geometry_update(parameters->geometry);
-
-	/* compute the orientation of the slits */
-	hkl_vector_rotated_quaternion(&n_slits,
-				      &darray_item(parameters->geometry->holders, 1)->q);
-
-	/* both directions must be perpendicular */
-	f_data[0] = hkl_vector_scalar_product(&parameters->surface, &n_slits);
-
-	return  GSL_SUCCESS;
-}
-
-static int fit_slits_orientation(HklSlitsFit *params)
-{
-	size_t i;
-	gsl_multiroot_fsolver_type const *T;
-	gsl_multiroot_fsolver *s;
-	gsl_multiroot_function f;
-	gsl_vector *x;
-	double *x_data;
-	int status;
-	int res = HKL_FALSE;
-	int iter;
-
-	/* now solve the system */
-	/* Initialize method  */
-	T = gsl_multiroot_fsolver_hybrid;
-	s = gsl_multiroot_fsolver_alloc (T, params->len);
-	x = gsl_vector_alloc(params->len);
-	x_data = gsl_vector_ptr(x, 0);
-
-	/* initialize x with the right values */
-	x_data[0] = params->axis->_value;
-
-	f.f = slits_func;
-	f.n = params->len;
-	f.params = params;
-	gsl_multiroot_fsolver_set (s, &f, x);
-
-	/* iterate to find the solution */
-	iter = 0;
-	do {
-		++iter;
-		status = gsl_multiroot_fsolver_iterate(s);
-		if (status || iter % 100 == 0) {
-			/* Restart from another point. */
-			for(i=0; i<params->len; ++i)
-				x_data[i] = (double)rand() / RAND_MAX * 180. / M_PI;
-			gsl_multiroot_fsolver_set(s, &f, x);
-			gsl_multiroot_fsolver_iterate(s);
-		}
-		status = gsl_multiroot_test_residual (s->f, HKL_EPSILON);
-	} while (status == GSL_CONTINUE && iter < 1000);
-
-#ifdef DEBUG
-	fprintf(stdout, "\n  fitting the detector position using thoses axes :");
-	for(i=0; i<params.len; ++i)
-		fprintf(stdout, " \"%s\"", ((HklParameter *)params.axes[i])->name);
-	fprintf(stdout, " status : %d iter : %d", status, iter);
-	fprintf(stdout, " x: [");
-	for(i=0; i<params.len; ++i)
-		fprintf(stdout, " %.7f", s->x->data[i]);
-	fprintf(stdout, "] f: [");
-	for(i=0; i<params.len; ++i)
-		fprintf(stdout, " %.7f", s->f->data[i]);
-	fprintf(stdout, "]\n");
-	hkl_geometry_fprintf(stdout, params.geometry);
-#endif
-	if(status != GSL_CONTINUE){
-		res = HKL_TRUE;
-		/* put the axes in the -pi, pi range. */
-		gsl_sf_angle_restrict_pos_e(&params->axis->_value);
-	}
-	/* release memory */
-	gsl_vector_free(x);
-	gsl_multiroot_fsolver_free(s);
-
-	return res;
-}
-
-void hkl_geometry_list_multiply_soleil_sixs_med_2_3(HklGeometryList *self,
-						    HklGeometryListItem *item)
-{
-	unsigned int i;
-	unsigned int len;
-	HklSlitsFit params;
-	HklGeometry *geometry;
-	double slits_position;
-	HklHolder *sample_holder;
-	HklHolder *detector_holder;
-
-	/* For each solution already found we will generate another one */
-	/* we will set the right slit orientation for a given detector arm position */
-	geometry = item->geometry;
-	sample_holder = darray_item(geometry->holders, 0);
-	detector_holder = darray_item(geometry->holders, 1);
-
-	/* get the index of the axis corresponding to the slits */
-	/* for now the last holder is the detector one */
-	params.slits_id = detector_holder->config->idx[detector_holder->config->len-1];
-	params.len = 1; /* only one axis to fit */
-	params.geometry = geometry;
-	params.axis = darray_item(params.geometry->axes, params.slits_id);
-
-	/* compute the surface orientation fixed during the fit */
-	/* use the last sample axis as sample surface normal */
-	params.surface = container_of(darray_item(geometry->axes,
-						  sample_holder->config->idx[sample_holder->config->len - 1]),
-				      HklAxis, parameter)->axis_v;
-	hkl_vector_rotated_quaternion(&params.surface,
-				      &sample_holder->q);
-
-
-	/* we just need to fit the slits orientation */
-	/* save it's value before */
-	slits_position = hkl_parameter_value_get(params.axis);
-	if (fit_slits_orientation(&params) != HKL_TRUE)
-		hkl_parameter_value_set(params.axis, slits_position, NULL);
-}
-
-
-HklEngine *hkl_engine_soleil_sixs_med_2_3_hkl_new(void)
-{
-	HklEngine *self;
-	HklMode *default_mode;
-
-	self = hkl_engine_hkl_new();
-
-	default_mode = mu_fixed();
-	hkl_engine_add_mode(self, default_mode);
-	hkl_engine_select_mode(self, default_mode);
-
-	return self;
-}
diff --git a/hkl/hkl-pseudoaxis-zaxis-hkl.c b/hkl/hkl-pseudoaxis-zaxis-hkl.c
deleted file mode 100644
index 48279f4..0000000
--- a/hkl/hkl-pseudoaxis-zaxis-hkl.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include <gsl/gsl_math.h>
-#include <gsl/gsl_vector.h>
-
-#include "hkl/ccan/array_size/array_size.h"
-
-#include "hkl-pseudoaxis-auto-private.h"
-#include "hkl-pseudoaxis-common-hkl-private.h"
-
-/* #define DEBUG */
-
-/***********************/
-/* numerical functions */
-/***********************/
-
-static int _reflectivity_func(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	const double mu = x->data[0];
-	const double gamma = x->data[3];
-
-	CHECK_NAN(x->data, x->size);
-
-	RUBh_minus_Q(x->data, params, f->data);
-	f->data[3] = mu - gamma;
-
-	return  GSL_SUCCESS;
-}
-
-static const HklFunction reflectivity_func = {
-	.function = _reflectivity_func,
-	.size = 4,
-};
-
-/********/
-/* mode */
-/********/
-
-static HklMode* zaxis()
-{
-	static const char* axes[] = {"omega", "delta", "gamma"};
-	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_full_mode_operations);
-}
-
-static HklMode* reflectivity()
-{
-	static const char* axes[] = {"mu", "omega", "delta", "gamma"};
-	static const HklFunction *functions[] = {&reflectivity_func};
-	static const HklModeAutoInfo info = {
-		INFO_AUTO(__func__, axes, functions),
-	};
-
-	return hkl_mode_auto_new(&info,
-				 &hkl_full_mode_operations);
-}
-
-/**********************/
-/* pseudo axis engine */
-/**********************/
-
-HklEngine *hkl_engine_zaxis_hkl_new(void)
-{
-	HklEngine *self;
-	HklMode *default_mode;
-
-	self = hkl_engine_hkl_new();
-
-	default_mode = zaxis();
-	hkl_engine_add_mode(self, default_mode);
-	hkl_engine_select_mode(self, default_mode);
-
-	hkl_engine_add_mode(self, reflectivity());
-
-	return self;
-}
diff --git a/hkl/hkl-pseudoaxis-zaxis-private.h b/hkl/hkl-pseudoaxis-zaxis-private.h
deleted file mode 100644
index f6046c6..0000000
--- a/hkl/hkl-pseudoaxis-zaxis-private.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#ifndef __HKL_PSEUDOAXIS_ZAXIS_H__
-#define __HKL_PSEUDOAXIS_ZAXIS_H__
-
-#include "hkl-pseudoaxis-auto-private.h"
-
-HKL_BEGIN_DECLS
-
-extern HklEngine *hkl_engine_zaxis_hkl_new(void);
-
-HKL_END_DECLS
-
-#endif /* __HKL_PSEUDOAXIS_ZAXIS_H__ */
diff --git a/hkl/hkl-pseudoaxis.c b/hkl/hkl-pseudoaxis.c
index 849fea5..008967c 100644
--- a/hkl/hkl-pseudoaxis.c
+++ b/hkl/hkl-pseudoaxis.c
@@ -14,101 +14,36 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <string.h>
-#ifndef _MSC_VER
-# include <alloca.h>
-#endif
-#include <gsl/gsl_sf_trig.h>
-
-#include "hkl/ccan/container_of/container_of.h"
-#include "hkl-detector-private.h"
-#include "hkl-pseudoaxis-private.h"
-#include "hkl-error-private.h"
+#include <stdio.h>                      // for fprintf, FILE
+#include <stdlib.h>                     // for free
+#include <string.h>                     // for NULL, strcmp
+#include <sys/types.h>                  // for uint
+#include "hkl-detector-private.h"       // for hkl_detector_new_copy
+#include "hkl-geometry-private.h"       // for _HklGeometryList, etc
+#include "hkl-macros-private.h"         // for hkl_assert, HKL_MALLOC, etc
+#include "hkl-parameter-private.h"      // for hkl_parameter_list_fprintf, etc
+#include "hkl-pseudoaxis-private.h"     // for _HklEngine, _HklEngineList, etc
+#include "hkl-sample-private.h"
+#include "hkl.h"                        // for HklEngine, HklEngineList, etc
+#include "hkl/ccan/container_of/container_of.h"  // for container_of
+#include "hkl/ccan/darray/darray.h"     // for darray_foreach, darray_init, etc
 
 /*****************/
 /* HklPseudoAxis */
 /*****************/
 
-static inline HklParameter *hkl_pseudo_axis_copy_real(const HklParameter *base)
-{
-	HklPseudoAxis *self = container_of(base, HklPseudoAxis, parameter);
-	HklPseudoAxis *dup = HKL_MALLOC(HklPseudoAxis);
-
-	*dup = *self;
-
-	return &dup->parameter;
-}
-
-static inline void hkl_pseudo_axis_free_real(HklParameter *self)
-{
-	HklPseudoAxis *pseudo_axis = container_of(self, HklPseudoAxis, parameter);
-
-	free(pseudo_axis);
-}
-
-static inline void hkl_pseudo_axis_fprintf_real(FILE *f, const HklParameter *self)
-{
-	HklPseudoAxis *pseudo_axis = container_of(self, HklPseudoAxis, parameter);
-
-	hkl_parameter_fprintf_real(f, self);
-	fprintf(f, " %p", pseudo_axis->engine);
-}
-
-static HklParameterOperations hkl_parameter_operations_pseudo_axis = {
-	HKL_PARAMETER_OPERATIONS_DEFAULTS,
-	.copy = hkl_pseudo_axis_copy_real,
-	.free = hkl_pseudo_axis_free_real,
-	.fprintf = hkl_pseudo_axis_fprintf_real,
-};
-
-HklParameter *hkl_parameter_new_pseudo_axis(
-	const HklParameter *parameter,
-	HklEngine *engine)
-{
-	HklPseudoAxis *self;
-
-	self = HKL_MALLOC(HklPseudoAxis);
-
-	self->parameter = *parameter;
-	self->parameter.ops = &hkl_parameter_operations_pseudo_axis;
-	self->engine = engine;
-
-	return &self->parameter;
-}
 
 /***********/
 /* HklMode */
 /***********/
 
 /**
- * hkl_mode_name:
- * @self: the this ptr
- *
- * Return value: the name of the HklMode
- **/
-const char *hkl_mode_name(const HklMode *self)
-{
-	return self->info->name;
-}
-
-/**
- * hkl_mode_parameters:
- * @self: the this ptr
- *
- * Return value: (transfer none): the parameters of the HklMode
- **/
-HklParameterList *hkl_mode_parameters(HklMode *self)
-{
-	return &self->parameters;
-}
-
-/**
  * hkl_mode_fprintf: (skip)
  * @f:
  * @self:
@@ -118,294 +53,532 @@ HklParameterList *hkl_mode_parameters(HklMode *self)
 void hkl_mode_fprintf(FILE *f, const HklMode *self)
 {
 	unsigned int i;
+	HklParameter **parameter;
+	const char **axis;
 
 	fprintf(f, "mode: \"%s\"\n", self->info->name);
-	fprintf(f, "initialize: %p\n", self->ops->init);
+	fprintf(f, "initialized_get: %p\n", self->ops->initialized_get);
+	fprintf(f, "initialized_set: %p\n", self->ops->initialized_set);
 	fprintf(f, "get: %p\n", self->ops->get);
 	fprintf(f, "set: %p\n", self->ops->set);
-	hkl_parameter_list_fprintf(f, &self->parameters);
-	if(self->info->axes){
-		fprintf(f, "axes names:");
-		for(i=0; i<self->info->n_axes; ++i)
-			fprintf(f, " %s", self->info->axes[i]);
-		fprintf(f, "\n");
+
+	darray_foreach(parameter, self->parameters){
+		fprintf(f, "\n     ");
+		hkl_parameter_fprintf(f, *parameter);
 	}
+
+	fprintf(f, "axes (read) names:");
+	darray_foreach(axis, self->info->axes_r)
+		fprintf(f, " %s", *axis);
+	fprintf(f, "\n");
+
+	fprintf(f, "axes (write) names:");
+	darray_foreach(axis, self->info->axes_w)
+		fprintf(f, " %s", *axis);
+	fprintf(f, "\n");
 }
 
 /*************/
 /* HklEngine */
 /*************/
 
-void hkl_engine_init(HklEngine *self,
-		     const HklEngineInfo *info,
-		     const HklEngineOperations *ops)
+/**
+ * hkl_engine_name_get:
+ * @self: the this ptr
+ *
+ * Return value: the name of the HklEngine
+ **/
+const char *hkl_engine_name_get(const HklEngine *self)
 {
-	self->info = info;
-	self->ops = ops;
-	darray_init(self->modes);
-	darray_init(self->pseudo_axes);
-	self->geometry = NULL;
-	self->detector = NULL;
-	self->sample = NULL;
+	return self->info->name;
 }
 
-void unregister_pseudo_axis(HklParameter *pseudo_axis)
+/**
+ * hkl_engine_len: (skip)
+ * @self: the this ptr
+ *
+ * Return value: the len of the pseudo axes of the HklEngine
+ **/
+unsigned int hkl_engine_len(const HklEngine *self)
 {
-	hkl_parameter_free(pseudo_axis);
+	return darray_size(self->info->pseudo_axes);
 }
 
-HklParameter *register_pseudo_axis(HklEngine *self,
-				   const HklParameter *conf)
+/**
+ * hkl_engine_pseudo_axis_names_get:
+ * @self: the this ptr
+ *
+ * Return value: (type gpointer): the pseudo_axes managed by this #HklEngine
+ **/
+const darray_string *hkl_engine_pseudo_axis_names_get(HklEngine *self)
 {
-	HklParameter *parameter;
-
-	parameter = hkl_parameter_new_pseudo_axis(conf, self);
-	darray_append(self->pseudo_axes, parameter);
-
-	return parameter;
+	return &self->pseudo_axis_names;
 }
 
-static void hkl_engine_prepare_internal(HklEngine *self)
-{
-	uint i;
-
-	if(!self || !self->engines)
-		return;
+/**
+ * hkl_engine_pseudo_axis_values_get:
+ * @self: the this ptr
+ * @values: (array length=n_values): the values to get
+ * @n_values: the size of the values array.
+ * @unit_type: the unit type (default or user) of the returned value
+ *
+ * Get the engine pseudo axes values
+ *
+ * return value: TRUE if succeded or FALSE otherwise.
+ **/
+int hkl_engine_pseudo_axis_values_get(HklEngine *self,
+				       double values[], size_t n_values,
+				       HklUnitEnum unit_type, GError **error)
+{
+	hkl_error(error == NULL ||*error == NULL);
+
+	if(n_values != darray_size(self->info->pseudo_axes)){
+		g_set_error(error,
+			    HKL_ENGINE_ERROR,
+			    HKL_ENGINE_ERROR_PSEUDO_AXIS_VALUES_GET,
+			    "cannot get engine pseudo axes, wrong number of parameter (%d) given, (%d) expected\n",
+			    n_values, darray_size(self->info->pseudo_axes));
+		return FALSE;
+	}
 
-	/* set */
-	if(self->geometry)
-		hkl_geometry_free(self->geometry);
-	self->geometry = hkl_geometry_new_copy(self->engines->geometry);
+	if(!hkl_engine_get(self, error)){
+		g_assert(error == NULL || *error != NULL);
+		return FALSE;
+	}
+	g_assert(error == NULL || *error == NULL);
 
-	if(self->detector)
-		hkl_detector_free(self->detector);
-	self->detector = hkl_detector_new_copy(self->engines->detector);
+	for(size_t i=0; i<n_values; ++i){
+		values[i] = hkl_parameter_value_get(darray_item(self->pseudo_axes, i),
+						    unit_type);
+	}
+	return TRUE;
+}
 
-	if(self->sample)
-		hkl_sample_free(self->sample);
-	self->sample = hkl_sample_new_copy(self->engines->sample);
+/**
+ * hkl_engine_pseudo_axis_values_set:
+ * @self: the this ptr
+ * @values: (array length=n_values): the values to set
+ * @n_values: the size of the values array.
+ * @unit_type: the unit type (default or user) of the returned value
+ * @error: return location for a GError, or NULL
+ *
+ * Set the engine pseudo axes values
+ *
+ * Return value: #HklGeometryList or NULL if no solution was found,
+ *               use hkl_geometry_list_free to release the memory once done.
+ **/
+HklGeometryList *hkl_engine_pseudo_axis_values_set(HklEngine *self,
+						   double values[], size_t n_values,
+						   HklUnitEnum unit_type, GError **error)
+{
+	char *msg;
+	size_t msg_size;
+	FILE *stream;
+	HklGeometryList *solutions = NULL;
+
+	hkl_error(error == NULL ||*error == NULL);
+
+	if(n_values != darray_size(self->info->pseudo_axes)){
+		g_set_error(error,
+			    HKL_ENGINE_ERROR,
+			    HKL_ENGINE_ERROR_PSEUDO_AXIS_VALUES_SET,
+			    "cannot set engine pseudo axes, wrong number of parameter (%d) given, (%d) expected\n",
+			    n_values,  darray_size(self->info->pseudo_axes));
+		goto out;
+	}
 
-	/* fill the axes member from the function */
-	if(self->mode){
-		darray_free(self->axes);
-		darray_init(self->axes);
-		for(i=0; i<self->mode->info->n_axes; ++i){
-			HklParameter *axis;
+#if LOGGING
+	stream = open_memstream(&msg, &msg_size);
 
-			axis = hkl_geometry_get_axis_by_name(self->geometry,
-							     self->mode->info->axes[i]);
+	fprintf(stream, "%s(", __func__);
+	fprintf(stream, "self: %s, values: [", hkl_engine_name_get(self));
+	for(size_t i=0; i<n_values; ++i)
+		fprintf(stream, " %f", values[i]);
+	fprintf(stream, "], n_values: %d unit_type: %d, error: %p)", n_values, unit_type, error);
 
-			darray_append(self->axes, axis);
+	hkl_geometry_fprintf(stream, self->geometry);
+	hkl_sample_fprintf(stream, self->sample);
+	hkl_engine_fprintf(stream, self);
+#endif
+	for(size_t i=0; i<n_values; ++i){
+		if(!hkl_parameter_value_set(darray_item(self->pseudo_axes, i),
+					    values[i],
+					    unit_type, error)){
+			goto clean_stream_out;
 		}
 	}
 
-	/* reset the geometries len */
-	hkl_geometry_list_reset(self->engines->geometries);
+	if(!hkl_engine_set(self, error)){
+#if LOGGING
+		fflush(stream);
+		g_message(msg);
+		if(error && *error != NULL)
+			g_warning("%s", (*error)->message);
+#endif
+		goto clean_stream_out;
+	}
+
+	solutions = hkl_geometry_list_new_copy(self->engines->geometries);
+
+clean_stream_out:
+#if LOGGING
+	fclose(stream);
+	free(msg);
+#endif
+out:
+	return solutions;
 }
 
 /**
- * hkl_engine_name:
+ * hkl_engine_pseudo_axis_get:
  * @self: the this ptr
+ * @name: the name of the expected psudo_axis
+ * @error: return location for a GError, or NULL
  *
- * Return value: the name of the HklEngine
+ * get the #HklParameter with the given @name.
+ *
+ * Returns: (allow-none): retun the parameter or NULL if the engine
+ *                        does not contain this pseudo_axis.
+ * TODO: unit test
  **/
-const char *hkl_engine_name(const HklEngine *self)
+const HklParameter *hkl_engine_pseudo_axis_get(const HklEngine *self,
+					       const char *name,
+					       GError **error)
 {
-	return self->info->name;
+	HklParameter **parameter;
+
+	hkl_error (error == NULL || *error == NULL);
+
+	darray_foreach(parameter, self->pseudo_axes)
+		if(!strcmp((*parameter)->name, name))
+			return *parameter;
+
+	g_set_error(error,
+		    HKL_ENGINE_ERROR,
+		    HKL_ENGINE_ERROR_PSEUDO_AXIS_SET,
+		    "This pseudo axis doesn not contain this pseudo axis \"%s\"\n",
+		    name);
+
+	return NULL;
 }
 
 /**
- * hkl_engine_len: (skip)
+ * hkl_engine_pseudo_axis_set: (skip)
  * @self: the this ptr
+ * @name: the name of the pseudo_axis to set
+ * @parameter: the parameter to set.
+ * @error: return location for a GError, or NULL
  *
- * Return value: the len of the pseudo axes of the HklEngine
+ * set a parameter of the #HklEngine
+ *
+ * Return value: #HklGeometryList or NULL if no solution was found,
+ *               use hkl_geometry_list_free to release the memory once done.
  **/
-unsigned int hkl_engine_len(const HklEngine *self)
-{
-	return self->info->n_pseudo_axes;
+HklGeometryList *hkl_engine_pseudo_axis_set(HklEngine *self,
+					    const char *name,
+					    const HklParameter *parameter,
+					    GError **error)
+{
+	HklParameter **p;
+
+	hkl_error (error == NULL || *error == NULL);
+	hkl_error (strcmp(name, parameter->name) == 0);
+
+	darray_foreach(p, self->pseudo_axes)
+		if(!strcmp((*p)->name, parameter->name)){
+			/* todo save the previous value to restore this value */
+			hkl_parameter_init_copy(*p, parameter, NULL);
+			if(!hkl_engine_set(self, error)){
+				g_assert(error == NULL || *error != NULL);
+				return NULL;
+			}
+			g_assert(error == NULL || *error == NULL);
+
+			return hkl_geometry_list_new_copy(self->engines->geometries);
+		}
+
+	g_set_error(error,
+		    HKL_ENGINE_ERROR,
+		    HKL_ENGINE_ERROR_PSEUDO_AXIS_SET,
+		    "Can not find the pseudo axis \"%s\" in the \"%s\" engine\n",
+		    parameter->name, self->info->name);
+
+	return NULL;
 }
 
 /**
- * hkl_engine_pseudo_axes:
+ * hkl_engine_capabilities_get:
  * @self: the this ptr
  *
- * Return value: (transfer none): the pseudo_axes managed by this HklEngine
+ * return the capabilities of the engine. Theses capabilities can
+ * change, from on mode to the other. for now there is three kind of
+ * capabilities.
+ *
+ * HKL_ENGINE_CAP_READABLE: pseudo axes values can be read from the HklEngine
+ *
+ * HKL_ENGINE_CAP_WRITABLE: pseudo axes values can be set for this #HklEngine
+ *
+ * HKL_ENGINE_CAP_INITIALISABLE: this pseudo axes must be initialized
+ *                               with hkl_engine_initialize before
+ *                               reading or writing on it.
+ *
+ * Returns: 
  **/
-HklParameterList *hkl_engine_pseudo_axes(HklEngine *self)
+unsigned int hkl_engine_capabilities_get(const HklEngine *self)
 {
-	return &self->pseudo_axes;
+	return self->mode->ops->capabilities;
 }
 
+
 /**
- * hkl_engine_mode:
+ * hkl_engine_modes_names_get:
  * @self: the this ptr
  *
- * Return value: (transfer none): the current mode of the HklEngine
+ * Return value: (type gpointer): All the modes supported by the #HklEngine
  **/
-HklMode *hkl_engine_mode(HklEngine *self)
+const darray_string *hkl_engine_modes_names_get(const HklEngine *self)
 {
-	return self->mode;
+	return &self->mode_names;
 }
 
 /**
- * hkl_engine_modes: (skip)
+ * hkl_engine_parameters_names_get:
  * @self: the this ptr
  *
- * Return value: (transfer none): the current mode of the HklEngine
+ * Return value: (type gpointer): All the parameters of #HklEngine.
  **/
-darray_mode *hkl_engine_modes(HklEngine *self)
+const darray_string *hkl_engine_parameters_names_get(const HklEngine *self)
 {
-	return &self->modes;
+	return &self->mode->parameters_names;
 }
 
 /**
- * hkl_engine_engines:
+ * hkl_engine_parameters_values_get: (skip)
  * @self: the this ptr
+ * @values: (array length=n_values): the values to get
+ * @n_values: the size of the values array.
+ * @unit_type: the unit type (default or user) of the returned value
+ *
+ * Get the engine parameters values
  *
- * Return value: (transfer none): the HklEngineList which contain this HklEngine
+ * return value: TRUE if succeded or FALSE otherwise.
  **/
-HklEngineList *hkl_engine_engines(HklEngine *self)
+void hkl_engine_parameters_values_get(const HklEngine *self,
+				      double values[], size_t n_values,
+				      HklUnitEnum unit_type)
 {
-	return self->engines;
+	g_return_if_fail (n_values == darray_size(self->mode->parameters));
+
+	for(size_t i=0; i<n_values; ++i)
+		values[i] = hkl_parameter_value_get(darray_item(self->mode->parameters, i),
+						    unit_type);
 }
 
 /**
- * hkl_engine_select_mode:
- * @self: the HklEngine
- * @mode: the #HklPseudoAxisMode to select
+ * hkl_engine_parameters_values_set: (skip)
+ * @self: the this ptr
+ * @values: (array length=n_values): the values to set
+ * @n_values: the size of the values array.
+ * @unit_type: the unit type (default or user) of the returned value
+ * @error: return location for a GError, or NULL
  *
- * This method also populate the self->axes from the mode->axes_names.
- * this is to speed the computation of the numerical axes.
+ * Set the engine parameters values
+ *
+ * return value: TRUE if succeded or FALSE otherwise.
  **/
-void hkl_engine_select_mode(HklEngine *self,
-			    HklMode *mode)
+int hkl_engine_parameters_values_set(HklEngine *self,
+				     double values[], size_t n_values,
+				     HklUnitEnum unit_type, GError **error)
 {
-	self->mode = mode;
-	hkl_engine_prepare_internal(self);
-}
+	hkl_error (error == NULL || *error == NULL && n_values == darray_size(self->mode->parameters));
 
-void hkl_engine_select_mode_by_name(HklEngine *self,
-				    const char *name)
-{
-	HklMode **mode;
-
-	darray_foreach(mode, self->modes){
-		if(!strcmp((*mode)->info->name, name))
-			hkl_engine_select_mode(self, (*mode));
+	for(size_t i=0; i<n_values; ++i){
+		if(!hkl_parameter_value_set(darray_item(self->mode->parameters, i),
+					    values[i], unit_type, error)){
+			g_assert (error == NULL || *error != NULL);
+			return FALSE;
+		}
 	}
+	g_assert (error == NULL || *error == NULL);
+
+	return TRUE;
 }
 
 /**
- * hkl_engine_initialize: (skip)
- * @self: the HklEngine
- * @error: (allow-none): NULL or an HklError to check for error's during the initialization
+ * hkl_engine_parameter_get:
+ * @self: the this ptr
+ * @name: the name of the expected parameter
+ * @error: return location for a GError, or NULL
  *
- * initialize the HklEngine
+ * get the #HklParameter with the given @name.
  *
- * Returns:
+ * Returns: (allow-none): return the parameter or NULL if the engine
+ *                        does not contain this parameter.
  **/
-int hkl_engine_initialize(HklEngine *self, HklError **error)
+const HklParameter *hkl_engine_parameter_get(const HklEngine *self,
+					     const char *name,
+					     GError **error)
 {
-	hkl_return_val_if_fail (error == NULL || *error == NULL, HKL_FALSE);
+	HklParameter **parameter;
 
-	if(!self->geometry || !self->detector || !self->sample
-	   || !self->mode) {
-		hkl_error_set(error, "Internal error");
-		return HKL_FALSE;
-	}
+	hkl_error (error == NULL || *error == NULL);
 
-	/* a NULL initialize method is valid */
-	if(self->mode->ops->init
-	   && !self->mode->ops->init(self->mode,
-				     self,
-				     self->engines->geometry,
-				     self->engines->detector,
-				     self->engines->sample,
-				     error)){
-		hkl_assert(error == NULL || *error != NULL);
-		return HKL_FALSE;
-	}
+	darray_foreach(parameter, self->mode->parameters)
+		if(!strcmp((*parameter)->name, name))
+			return *parameter;
+
+	g_set_error(error,
+		    HKL_ENGINE_ERROR,
+		    HKL_ENGINE_ERROR_PARAMETER_GET,
+		    "this engine does not contain this parameter \"%s\"\n",
+		    name);
+
+	return NULL;
+}
+
+/**
+ * hkl_engine_parameter_set: (skip)
+ * @self: the this ptr
+ * @name: the name of the parameter to set. 
+ * @parameter: the parameter to set.
+ * @error: return location for a GError, or NULL
+ *
+ * set a parameter of the #HklEngine
+ * TODO add an error
+ *
+ * return value: TRUE if succeded or FALSE otherwise.
+ **/
+int hkl_engine_parameter_set(HklEngine *self,
+			     const char *name,
+			     const HklParameter *parameter,
+			     GError **error)
+{
+	HklParameter **p;
+
+	hkl_error (error == NULL || *error == NULL);
+
+	darray_foreach(p, self->mode->parameters)
+		if(!strcmp(name, (*p)->name)){
+			hkl_parameter_init_copy(*p, parameter, NULL);
+			/* we do not check if the name is identical so force the right name */
+			/* TODO rethink this HklParameter assignement */
+			(*p)->name = name;
+			return TRUE;
+		}
 
-	hkl_assert(error == NULL || *error == NULL);
+	g_set_error(error,
+		    HKL_ENGINE_ERROR,
+		    HKL_ENGINE_ERROR_PARAMETER_SET,
+		    "this engine does not contain this parameter \"%s\"\n",
+		    parameter->name);
 
-	return HKL_TRUE;
+	return FALSE;
 }
 
 /**
- * hkl_engine_set: (skip)
+ * hkl_engine_current_mode_get:
+ * @self: the this ptr
+ *
+ * Returns: the current HklEngine mode
+ **/
+const char *hkl_engine_current_mode_get(const HklEngine *self)
+{
+	return self->mode->info->name;
+}
+
+/**
+ * hkl_engine_current_mode_set:
  * @self: the HklEngine
- * @error: (allow-none): NULL or an HklError
+ * @name: the mode to select
+ * @error: return location for a GError, or NULL
  *
- * use the HklPseudoaxisEngine values to compute the real axes values.
+ * This method also populate the self->axes from the mode->axis_names.
+ * this is to speed the computation of the numerical axes.
  *
- * Returns:
+ * return value: TRUE if succeded or FALSE otherwise.
  **/
-int hkl_engine_set(HklEngine *self, HklError **error)
+int hkl_engine_current_mode_set(HklEngine *self, const char *name,
+				GError **error)
 {
-	hkl_return_val_if_fail (error == NULL || *error == NULL, HKL_FALSE);
+	HklMode **mode;
 
-	if(!self->geometry || !self->detector || !self->sample
-	   || !self->mode || !self->mode->ops->set){
-		hkl_error_set(error, "Internal error");
-		return HKL_FALSE;
-	}
+	hkl_error (error == NULL || *error == NULL);
 
-	hkl_engine_prepare_internal(self);
+	darray_foreach(mode, self->modes)
+		if(!strcmp((*mode)->info->name, name)){
+			hkl_engine_mode_set(self, *mode);
+			return TRUE;
+		}
 
-	if (!self->mode->ops->set(self->mode, self,
-				  self->geometry,
-				  self->detector,
-				  self->sample,
-				  error)){
-		hkl_assert(error == NULL || *error != NULL);
-		return HKL_FALSE;
-	}
-	hkl_assert(error == NULL || *error == NULL);
+	g_set_error(error,
+		    HKL_ENGINE_ERROR,
+		    HKL_ENGINE_ERROR_CURRENT_MODE_SET,
+		    "this engine does not contain this mode \"%s\"\n",
+		    name);
 
-	hkl_geometry_list_multiply(self->engines->geometries);
-	hkl_geometry_list_multiply_from_range(self->engines->geometries);
-	hkl_geometry_list_remove_invalid(self->engines->geometries);
-	hkl_geometry_list_sort(self->engines->geometries, self->engines->geometry);
+	return FALSE;
+}
 
-	if(darray_empty(self->engines->geometries->items)){
-		hkl_error_set(error, "no remaining solutions");
-		return HKL_FALSE;
+/**
+ * hkl_engine_axis_names_get:
+ * @self: the this ptr
+ * @mode: 
+ *
+ * return a list of axes relevant when reading or writing on the
+ * #HklEngine.
+ *
+ * exemple, for a K6C diffractometer in "lifting detector" mode, your
+ * Engine control only 3 motors when writing, but the hkl values
+ * depends on the 6 motors when reading.
+ *
+ * Returns: (type gpointer): 
+ **/
+const darray_string *hkl_engine_axis_names_get(const HklEngine *self,
+					       HklEngineAxisNamesGet mode)
+{
+	switch(mode){
+	case HKL_ENGINE_AXIS_NAMES_GET_READ:
+		return &self->mode->info->axes_r;
+	case HKL_ENGINE_AXIS_NAMES_GET_WRITE:
+		return &self->mode->info->axes_w;
 	}
+}
 
-	return HKL_TRUE;
+int hkl_engine_initialized_get(const HklEngine *self)
+{
+	return hkl_mode_initialized_get(self->mode);
 }
 
 /**
- * hkl_engine_get: (skip)
- * @self: The HklEngine
- * @error: (allow-none): NULL or an HklError
+ * hkl_engine_initialized_set:
+ * @self: the HklEngine
+ * @initialized: TRUE or FALSE to activated or deactivate the HklEngine
+ * @error: return location for a GError, or NULL
  *
- * get the values of the pseudo-axes from the real-axes values
+ * initialize the HklEngine
  *
- * Returns:
+ * return value: TRUE if succeded or FALSE otherwise.
  **/
-int hkl_engine_get(HklEngine *self, HklError **error)
+int hkl_engine_initialized_set(HklEngine *self, int initialized, GError **error)
 {
-	hkl_return_val_if_fail (error == NULL || *error == NULL, HKL_FALSE);
-
-	if(!self->engines || !self->engines->geometry || !self->engines->detector
-	   || !self->engines->sample || !self->mode || !self->mode->ops->get){
-		hkl_error_set(error, "Internal error");
-		return HKL_FALSE;
-	}
+	hkl_error (error == NULL || *error == NULL);
 
-	if (!self->mode->ops->get(self->mode,
-				  self,
-				  self->engines->geometry,
-				  self->engines->detector,
-				  self->engines->sample,
-				  error)){
-		hkl_assert(error == NULL || *error != NULL);
-		return HKL_FALSE;
+	if(!self->geometry || !self->detector || !self->sample
+	   || !self->mode) {
+		g_set_error(error,
+			    HKL_ENGINE_ERROR,
+			    HKL_ENGINE_ERROR_INITIALIZE,
+			    "Internal error");
+		return FALSE;
 	}
-	hkl_assert(error == NULL || *error == NULL);
 
-	return HKL_TRUE;
+	return hkl_mode_initialized_set(self->mode,
+					self,
+					self->engines->geometry,
+					self->engines->detector,
+					self->engines->sample,
+					initialized,
+					error);
 }
 
 /**
@@ -417,6 +590,8 @@ int hkl_engine_get(HklEngine *self, HklError **error)
  **/
 void hkl_engine_fprintf(FILE *f, const HklEngine *self)
 {
+	HklParameter **pseudo_axis;
+
 	fprintf(f, "\nPseudoAxesEngine : \"%s\"", self->info->name);
 
 	/* mode */
@@ -432,9 +607,12 @@ void hkl_engine_fprintf(FILE *f, const HklEngine *self)
 	}
 
 	/* the pseudoAxes part */
-	hkl_parameter_list_fprintf(f, &self->pseudo_axes);
+	darray_foreach(pseudo_axis, self->pseudo_axes){
+		fprintf(f, "\n     ");
+		hkl_parameter_fprintf(f, *pseudo_axis);
+	}
 
-	if(darray_empty(self->engines->geometries->items)){
+	if(self->engines->geometries->n_items != 0){
 		fprintf(f, "\n   ");
 		hkl_geometry_list_fprintf(f, self->engines->geometries);
 	}
@@ -446,43 +624,6 @@ void hkl_engine_fprintf(FILE *f, const HklEngine *self)
 /*****************/
 
 /**
- * hkl_engine_list_new: (skip)
- *
- * default constructor
- *
- * Returns:
- **/
-HklEngineList *hkl_engine_list_new(void)
-{
-	HklEngineList *self = NULL;
-
-	self = HKL_MALLOC(HklEngineList);
-
-	darray_init(*self);
-
-	self->geometries = hkl_geometry_list_new();
-
-	self->geometry = NULL;
-	self->detector = NULL;
-	self->sample = NULL;
-
-	return self;
-}
-
-/**
- * hkl_engine_list_new_copy: (skip)
- * @self:
- *
- * dummy copy constructor for the binding
- *
- * Returns: (transfer none): NULL all the time the structure is non-copyable
- **/
-const HklEngineList *hkl_engine_list_new_copy(const HklEngineList *self)
-{
-	return NULL;
-}
-
-/**
  * hkl_engine_list_free: (skip)
  * @self: the #HklEngineList to destroy
  *
@@ -496,146 +637,85 @@ void hkl_engine_list_free(HklEngineList *self)
 }
 
 /**
- * hkl_engine_list_add: (skip)
- * @self: the engine list
- * @engine: the engine to add
- *
- * add an #HklEngine to the #HklEngineList
- *
- * Returns: HKL_SUCCESS or HKL_FAIL
- **/
-int hkl_engine_list_add(HklEngineList *self,
-			HklEngine *engine)
-{
-	if (!engine)
-		return HKL_FALSE;
-
-	/* set the engines to access the Geometries list. */
-	engine->engines = self;
-
-	darray_append(*self, engine);
-
-	return HKL_TRUE;
-}
-
-/**
- * hkl_engine_list_engines: (skip)
+ * hkl_engine_list_engines_get: (skip)
  * @self: the this ptr
  *
  * Return: a pointer on the engine array
  **/
-darray_engine *hkl_engine_list_engines(HklEngineList *self)
+darray_engine *hkl_engine_list_engines_get(HklEngineList *self)
 {
 	return (darray_engine *)self;
 }
 
 /**
- * hkl_engine_list_geometries:
- * @self: the this ptr
- *
- * Return: a pointer on the engine array
- **/
-const HklGeometryList *hkl_engine_list_geometries(const HklEngineList *self)
-{
-	return self->geometries;
-}
-
-/**
- * hkl_engine_list_get_geometry: (skip)
+ * hkl_engine_list_geometry_get: (skip)
  * @self: the this ptr
  *
  * Return: a pointer on the geometry member
  **/
-HklGeometry *hkl_engine_list_get_geometry(HklEngineList *self)
+HklGeometry *hkl_engine_list_geometry_get(HklEngineList *self)
 {
 	return self->geometry;
 }
 
-void hkl_engine_list_geometry_set(HklEngineList *self, const HklGeometry *geometry)
+int hkl_engine_list_geometry_set(HklEngineList *self, const HklGeometry *geometry)
 {
-	hkl_geometry_set(self->geometry, geometry);
+	if(!hkl_geometry_set(self->geometry, geometry))
+		return FALSE;
+
 	hkl_engine_list_get(self);
+
+	return TRUE;
 }
 
 /**
  * hkl_engine_list_select_solution:
  * @self: the this ptr
- * @idx: the index of the solution to select
+ * @item: the #HklGeoemtryListItem selected.
  *
- * this method set the geometry member with the ith selected solution.
- * if the index is out of range (idx > number of solution) the method
- * do nothing.
+ * this method set the geometry member with the selected solution.
+ *
+ * return value: TRUE if succeded or FALSE otherwise.
  **/
-void hkl_engine_list_select_solution(HklEngineList *self, unsigned int idx)
+int hkl_engine_list_select_solution(HklEngineList *self,
+				    const HklGeometryListItem *item)
 {
-	hkl_geometry_init_geometry(self->geometry,
-				   darray_item(self->geometries->items, idx)->geometry);
+	return hkl_geometry_init_geometry(self->geometry, item->geometry);
 }
 
 /**
- * hkl_engine_list_get_by_name:
+ * hkl_engine_list_engine_get_by_name:
  * @self: the this ptr
  * @name: the name of the requested #HklPseudoAxisEngin
+ * @error: return location for a GError, or NULL
  *
  * get the #HklEngine by its name from the list.
  *
  * Returns: (transfer none) (allow-none): the requested engine
  **/
-HklEngine *hkl_engine_list_get_by_name(HklEngineList *self,
-				       const char *name)
+HklEngine *hkl_engine_list_engine_get_by_name(HklEngineList *self,
+					      const char *name,
+					      GError **error)
 {
 	HklEngine **engine;
 
+	hkl_error (error == NULL || *error == NULL);
+
 	darray_foreach(engine, *self){
 		if (!strcmp((*engine)->info->name, name))
 			return *engine;
 	}
 
-	return NULL;
-}
-
-/**
- * hkl_engine_list_get_pseudo_axis_by_name:
- * @self: the engine list
- * @name: the name of the requested #HklPseudoAxis
- *
- * Todo: test
- *
- * Returns: (transfer none) (allow-none): the requested #HklPseudoAxis
- **/
-HklParameter *hkl_engine_list_get_pseudo_axis_by_name(
-	const HklEngineList *self, const char *name)
-{
-	HklEngine **engine;
-	HklParameter **parameter;
-
-	darray_foreach(engine, *self){
-		darray_foreach(parameter, (*engine)->pseudo_axes){
-			if (!strcmp((*parameter)->name, name))
-				return *parameter;
-		}
-	}
+	g_set_error(error,
+		    HKL_ENGINE_LIST_ERROR,
+		    HKL_ENGINE_LIST_ERROR_ENGINE_GET_BY_NAME,
+		    "this engine list does not contain this engine \"%s\"",
+		    name);
 
 	return NULL;
 }
 
 /**
- * hkl_engine_list_clear: (skip)
- * @self: the engine list to clear
- *
- * remove all engine from the engine list
- **/
-void hkl_engine_list_clear(HklEngineList *self)
-{
-	HklEngine **engine;
-
-	darray_foreach(engine, *self){
-		hkl_engine_free(*engine);
-	}
-	darray_free(*self);
-}
-
-/**
  * hkl_engine_list_init:
  * @self: the engine list
  * @geometry: the associated #HklGeometry
@@ -674,7 +754,7 @@ void hkl_engine_list_init(HklEngineList *self,
 int hkl_engine_list_get(HklEngineList *self)
 {
 	HklEngine **engine;
-	int res = HKL_TRUE;
+	int res = TRUE;
 
 	darray_foreach(engine, *self){
 		res &= hkl_engine_get(*engine, NULL);
diff --git a/hkl/hkl-quaternion-private.h b/hkl/hkl-quaternion-private.h
index 863b15f..a2dc158 100644
--- a/hkl/hkl-quaternion-private.h
+++ b/hkl/hkl-quaternion-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,18 +22,10 @@
 #ifndef __HKL_QUATERNION_PRIVATE_H__
 #define __HKL_QUATERNION_PRIVATE_H__
 
-#include <stdio.h>
-#include <math.h>
+#include <stdio.h>                      // for FILE
+#include "hkl.h"                        // for G_BEGIN_DECLS, etc
 
-#include "hkl.h"
-#include "hkl-vector-private.h"
-
-HKL_BEGIN_DECLS
-
-struct _HklQuaternion
-{
-	double data[4];
-};
+G_BEGIN_DECLS
 
 extern HklQuaternion *hkl_quaternion_dup(const HklQuaternion* self);
 
@@ -66,6 +58,6 @@ extern void hkl_quaternion_to_matrix(const HklQuaternion *self, HklMatrix *m);
 extern void hkl_quaternion_to_angle_and_axe(const HklQuaternion *self,
 					    double *angle, HklVector *v);
 
-HKL_END_DECLS
+G_END_DECLS
 
 #endif
diff --git a/hkl/hkl-quaternion.c b/hkl/hkl-quaternion.c
index a26636d..7da8520 100644
--- a/hkl/hkl-quaternion.c
+++ b/hkl/hkl-quaternion.c
@@ -13,21 +13,21 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#include "hkl.h"
-#include "hkl-vector-private.h"
-#include "hkl-macros-private.h"
-#include "hkl-matrix-private.h"
-#include "hkl-quaternion-private.h"
+#include <math.h>                       // for fabs, sin, M_PI, acos, cos, etc
+#include <stdio.h>                      // for fprintf, FILE
+#include <stdlib.h>                     // for free
+#include <string.h>                     // for memcpy, memset
+#include "hkl-macros-private.h"         // for hkl_assert, HKL_MALLOC
+#include "hkl-matrix-private.h"         // for _HklMatrix
+#include "hkl-quaternion-private.h"     // for _HklQuaternion
+#include "hkl-vector-private.h"         // for HklQuaternion, HklVector, etc
+#include "hkl.h"                        // for HklMatrix, HKL_EPSILON, etc
 
 /* public */
 /**
@@ -143,7 +143,7 @@ void hkl_quaternion_init_from_angle_and_axe(HklQuaternion *self,
  *
  * compare two #HklQuaternion.
  *
- * Returns: #HKL_TRUE if both are equal, #HKL_FALSE otherwise.
+ * Returns: #TRUE if both are equal, #FALSE otherwise.
  **/
 int hkl_quaternion_cmp(HklQuaternion const *self, HklQuaternion const *q)
 {
@@ -151,8 +151,8 @@ int hkl_quaternion_cmp(HklQuaternion const *self, HklQuaternion const *q)
 
 	for (i=0;i<4;i++)
 		if ( fabs(self->data[i] - q->data[i]) > HKL_EPSILON )
-			return HKL_FALSE;
-	return HKL_TRUE;
+			return FALSE;
+	return TRUE;
 }
 
 /**
diff --git a/hkl/hkl-sample-private.h b/hkl/hkl-sample-private.h
index be748b7..4250db7 100644
--- a/hkl/hkl-sample-private.h
+++ b/hkl/hkl-sample-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,11 +22,13 @@
 #ifndef __HKL_SAMPLE_PRIVATE_H__
 #define __HKL_SAMPLE_PRIVATE_H__
 
-#include "ccan/list/list.h"
-#include "hkl.h"
-#include "hkl-matrix-private.h"
+#include <stdio.h>                      // for FILE
+#include "ccan/list/list.h"             // for list_head, list_node
+#include "hkl-matrix-private.h"         // for _HklMatrix
+#include "hkl-vector-private.h"         // for HklVector
+#include "hkl.h"                        // for HklParameter, etc
 
-HKL_BEGIN_DECLS
+G_BEGIN_DECLS
 
 /*************/
 /* HklSample */
@@ -41,8 +43,22 @@ struct _HklSample {
 	HklParameter *uy;
 	HklParameter *uz;
 	struct list_head reflections;
+	size_t n_reflections;
 };
 
+#define HKL_SAMPLE_ERROR hkl_sample_error_quark ()
+
+static GQuark hkl_sample_error_quark (void)
+{
+	return g_quark_from_static_string ("hkl-sample-error-quark");
+}
+
+typedef enum {
+	HKL_SAMPLE_ERROR_MINIMIZED, /* can not minimize the sample */
+	HKL_SAMPLE_ERROR_COMPUTE_UB_BUSING_LEVY, /* can not compute UB */
+} HklSampleError;
+
+
 extern void hkl_sample_fprintf(FILE *f, const HklSample *self);
 
 
@@ -59,10 +75,21 @@ struct _HklSampleReflection {
 	struct list_node list;
 };
 
+#define HKL_SAMPLE_REFLECTION_ERROR hkl_sample_reflection_error_quark ()
+
+static GQuark hkl_sample_reflection_error_quark (void)
+{
+	return g_quark_from_static_string ("hkl-sample-reflection-error-quark");
+}
+
+typedef enum {
+	HKL_SAMPLE_REFLECTION_ERROR_HKL_SET, /* can not set the hkl part of the reflection */
+} HklSampleReflectionError;
+
 extern HklSampleReflection *hkl_sample_reflection_new_copy(const HklSampleReflection *self);
 
 extern void hkl_sample_reflection_free(HklSampleReflection *self);
 
-HKL_END_DECLS
+G_END_DECLS
 
 #endif
diff --git a/hkl/hkl-sample.c b/hkl/hkl-sample.c
index e1742ec..5bf688b 100644
--- a/hkl/hkl-sample.c
+++ b/hkl/hkl-sample.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,19 +22,78 @@
 
 /* for strdup */
 #define _XOPEN_SOURCE 500
-#include <string.h>
-#include <gsl/gsl_multimin.h>
+#include <gsl/gsl_errno.h>              // for gsl_set_error_handler, etc
+#include <gsl/gsl_multimin.h>           // for gsl_multimin_function, etc
+#include <gsl/gsl_nan.h>                // for GSL_NAN
+#include <gsl/gsl_vector_double.h>      // for gsl_vector_get, etc
+#include <math.h>                       // for M_PI, fabs
+#include <stddef.h>                     // for size_t
+#include <stdio.h>                      // for fprintf, FILE
+#include <stdlib.h>                     // for free
+#include <string.h>                     // for NULL, strdup
+#include "hkl-detector-private.h"       // for hkl_detector_new_copy, etc
+#include "hkl-geometry-private.h"       // for _HklGeometry, etc
+#include "hkl-lattice-private.h"        // for _HklLattice, etc
+#include "hkl-macros-private.h"         // for HKL_MALLOC
+#include "hkl-matrix-private.h"         // for hkl_matrix_init_from_euler, etc
+#include "hkl-parameter-private.h"      // for hkl_parameter_fprintf, etc
+#include "hkl-quaternion-private.h"     // for hkl_quaternion_conjugate, etc
+#include "hkl-sample-private.h"         // for _HklSample, etc
+#include "hkl-source-private.h"         // for hkl_source_compute_ki
+#include "hkl-unit-private.h"           // for hkl_unit_angle_deg, etc
+#include "hkl-vector-private.h"         // for HklVector, hkl_vector_angle, etc
+#include "hkl.h"                        // for HklSample, etc
+#include "hkl/ccan/darray/darray.h"     // for darray_foreach, darray_item
+#include "hkl/ccan/list/list.h"         // for list_head, list_add_tail, etc
+
+/* #define DEBUG */
+#define ITER_MAX 10000
 
-#include "hkl.h"
+/* private */
+static void hkl_sample_clear_all_reflections(HklSample *self)
+{
+	HklSampleReflection *reflection;
+	HklSampleReflection *next;
 
-#include "hkl-axis-private.h"
-#include "hkl-detector-private.h"
-#include "hkl-lattice-private.h"
-#include "hkl-parameter-private.h"
-#include "hkl-geometry-private.h"
-#include "hkl-sample-private.h"
+	list_for_each_safe(&self->reflections, reflection, next, list){
+		list_del(&reflection->list);
+		hkl_sample_reflection_free(reflection);
+	}
+}
+
+
+static void hkl_sample_copy_all_reflections(HklSample *self, const  HklSample *src)
+{
+	HklSampleReflection *reflection;
+
+	list_head_init(&self->reflections);
+	list_for_each(&src->reflections, reflection, list){
+		list_add_tail(&self->reflections,
+			      &hkl_sample_reflection_new_copy(reflection)->list);
+	}
+	self->n_reflections = src->n_reflections;
+}
+
+
+static void hkl_sample_sample_set(HklSample *self, const HklSample *src)
+{
+	if(self->name)
+		free(self->name);
+	self->name = strdup(src->name);
+
+	hkl_lattice_lattice_set(self->lattice, src->lattice);
+	self->U = src->U;
+	self->UB = src->UB;
+
+	hkl_parameter_init_copy(self->ux, src->ux, NULL);
+	hkl_parameter_init_copy(self->uy, src->uy, NULL);
+	hkl_parameter_init_copy(self->uz, src->uz, NULL);
+
+	/* copy all the reflections */
+	hkl_sample_clear_all_reflections(self);
+	hkl_sample_copy_all_reflections(self, src);
+}
 
-/* private */
 
 static void hkl_sample_reflection_update(HklSampleReflection *self)
 {
@@ -64,9 +123,9 @@ static void hkl_sample_compute_UxUyUz(HklSample *self)
 	double uz;
 
 	hkl_matrix_to_euler(&self->U, &ux, &uy, &uz);
-	hkl_parameter_value_set(self->ux, ux, NULL);
-	hkl_parameter_value_set(self->uy, uy, NULL);
-	hkl_parameter_value_set(self->uz, uz, NULL);
+	hkl_parameter_value_set(self->ux, ux, HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(self->uy, uy, HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(self->uz, uz, HKL_UNIT_DEFAULT, NULL);
 }
 
 static int hkl_sample_compute_UB(HklSample *self)
@@ -74,12 +133,12 @@ static int hkl_sample_compute_UB(HklSample *self)
 	HklMatrix B;
 
 	if (!hkl_lattice_get_B(self->lattice, &B))
-		return HKL_FALSE;
+		return FALSE;
 
 	self->UB = self->U;
 	hkl_matrix_times_matrix(&self->UB, &B);
 
-	return HKL_TRUE;
+	return TRUE;
 }
 
 /*
@@ -89,44 +148,66 @@ static int hkl_sample_compute_UB(HklSample *self)
 struct set_UB_t
 {
 	HklSample *sample;
-	const HklMatrix *UB;
+	const HklMatrix UB;
 };
 
-static double set_UB_fitness(const gsl_vector *x, void *params)
+static int hkl_sample_init_from_gsl_vector(HklSample *self, const gsl_vector *x)
 {
-	size_t i, j;
-	double fitness;
-	double euler_x;
-	double euler_y;
-	double euler_z;
-	struct set_UB_t *parameters = params;
-	HklSample *sample = parameters->sample;
-	const HklMatrix *UB = parameters->UB;
+	double euler_x, euler_y, euler_z;
 
 	euler_x = gsl_vector_get(x, 0);
 	euler_y = gsl_vector_get(x, 1);
 	euler_z = gsl_vector_get(x, 2);
 
-	hkl_parameter_value_set(sample->ux, euler_x, NULL);
-	hkl_parameter_value_set(sample->uy, euler_y, NULL);
-	hkl_parameter_value_set(sample->uz, euler_z, NULL);
-	hkl_parameter_value_set(sample->lattice->a, gsl_vector_get(x, 3), NULL);
-	hkl_parameter_value_set(sample->lattice->b, gsl_vector_get(x, 4), NULL);
-	hkl_parameter_value_set(sample->lattice->c, gsl_vector_get(x, 5), NULL);
-	hkl_parameter_value_set(sample->lattice->alpha, gsl_vector_get(x, 6), NULL);
-	hkl_parameter_value_set(sample->lattice->beta, gsl_vector_get(x, 7), NULL);
-	hkl_parameter_value_set(sample->lattice->gamma, gsl_vector_get(x, 8), NULL);
-
-	hkl_matrix_init_from_euler(&sample->U, euler_x, euler_y, euler_z);
-	if (!hkl_sample_compute_UB(sample))
+	hkl_parameter_value_set(self->ux, euler_x, HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(self->uy, euler_y, HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(self->uz, euler_z, HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(self->lattice->a, gsl_vector_get(x, 3), HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(self->lattice->b, gsl_vector_get(x, 4), HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(self->lattice->c, gsl_vector_get(x, 5), HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(self->lattice->alpha, gsl_vector_get(x, 6), HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(self->lattice->beta, gsl_vector_get(x, 7), HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(self->lattice->gamma, gsl_vector_get(x, 8), HKL_UNIT_DEFAULT, NULL);
+
+	hkl_matrix_init_from_euler(&self->U, euler_x, euler_y, euler_z);
+	if (!hkl_sample_compute_UB(self))
+		return FALSE;
+
+	return TRUE;
+}
+
+static void hkl_sample_to_gsl_vector(HklSample *self, gsl_vector *x)
+{
+	gsl_vector_set (x, 0, hkl_parameter_value_get(self->ux, HKL_UNIT_DEFAULT));
+	gsl_vector_set (x, 1, hkl_parameter_value_get(self->uy, HKL_UNIT_DEFAULT));
+	gsl_vector_set (x, 2, hkl_parameter_value_get(self->uz, HKL_UNIT_DEFAULT));
+	gsl_vector_set (x, 3, hkl_parameter_value_get(self->lattice->a, HKL_UNIT_DEFAULT));
+	gsl_vector_set (x, 4, hkl_parameter_value_get(self->lattice->b, HKL_UNIT_DEFAULT));
+	gsl_vector_set (x, 5, hkl_parameter_value_get(self->lattice->c, HKL_UNIT_DEFAULT));
+	gsl_vector_set (x, 6, hkl_parameter_value_get(self->lattice->alpha, HKL_UNIT_DEFAULT));
+	gsl_vector_set (x, 7, hkl_parameter_value_get(self->lattice->beta, HKL_UNIT_DEFAULT));
+	gsl_vector_set (x, 8, hkl_parameter_value_get(self->lattice->gamma, HKL_UNIT_DEFAULT));
+
+}
+
+static double set_UB_fitness(const gsl_vector *x, void *params)
+{
+	size_t i, j;
+	double fitness = 0.;
+	struct set_UB_t *parameters = params;
+	HklSample *sample = parameters->sample;
+
+	if (!hkl_sample_init_from_gsl_vector(sample, x))
 		return GSL_NAN;
 
-	fitness = 0.;
 	for(i=0; i<3; ++i)
 		for(j=0; j<3; ++j){
-			double tmp = UB->data[i][j] - sample->UB.data[i][j];
+			double tmp = parameters->UB.data[i][j] - sample->UB.data[i][j];
 			fitness += tmp * tmp;
 		}
+#ifdef DEBUG
+	fprintf(stderr, "fitness: %f\n", fitness);
+#endif
 	return fitness;
 }
 
@@ -134,27 +215,10 @@ static double mono_crystal_fitness(const gsl_vector *x, void *params)
 {
 	size_t i, j;
 	double fitness;
-	double euler_x;
-	double euler_y;
-	double euler_z;
 	HklSample *sample = params;
 	HklSampleReflection *reflection;
 
-	euler_x = gsl_vector_get(x, 0);
-	euler_y = gsl_vector_get(x, 1);
-	euler_z = gsl_vector_get(x, 2);
-
-	hkl_parameter_value_set(sample->ux, euler_x, NULL);
-	hkl_parameter_value_set(sample->uy, euler_y, NULL);
-	hkl_parameter_value_set(sample->uz, euler_z, NULL);
-	hkl_parameter_value_set(sample->lattice->a, gsl_vector_get(x, 3), NULL);
-	hkl_parameter_value_set(sample->lattice->b, gsl_vector_get(x, 4), NULL);
-	hkl_parameter_value_set(sample->lattice->c, gsl_vector_get(x, 5), NULL);
-	hkl_parameter_value_set(sample->lattice->alpha, gsl_vector_get(x, 6), NULL);
-	hkl_parameter_value_set(sample->lattice->beta, gsl_vector_get(x, 7), NULL);
-	hkl_parameter_value_set(sample->lattice->gamma, gsl_vector_get(x, 8), NULL);
-	hkl_matrix_init_from_euler(&sample->U, euler_x, euler_y, euler_z);
-	if (!hkl_sample_compute_UB(sample))
+	if (!hkl_sample_init_from_gsl_vector(sample, x))
 		return GSL_NAN;
 
 	fitness = 0.;
@@ -174,8 +238,11 @@ static double mono_crystal_fitness(const gsl_vector *x, void *params)
 	return fitness;
 }
 
-static double minimize(HklSample *sample, double (* f) (const gsl_vector * x, void * params), void *params)
+static int minimize(HklSample *sample,
+		    double (* f) (const gsl_vector * x, void * params),
+		    void *params, GError **error)
 {
+	HklSample *saved;
 	gsl_multimin_fminimizer_type const *T = gsl_multimin_fminimizer_nmsimplex;
 	gsl_multimin_fminimizer *s = NULL;
 	gsl_vector *ss, *x;
@@ -183,21 +250,16 @@ static double minimize(HklSample *sample, double (* f) (const gsl_vector * x, vo
 	size_t iter = 0;
 	int status;
 	double size = 0;
+	int res = TRUE;
 
-	if (!sample)
-		return GSL_NAN;
+	hkl_error (error == NULL || *error == NULL);
+
+	/* save the sample state */
+	saved = hkl_sample_new_copy(sample);
 
 	/* Starting point */
 	x = gsl_vector_alloc (9);
-	gsl_vector_set (x, 0, hkl_parameter_value_get(sample->ux));
-	gsl_vector_set (x, 1, hkl_parameter_value_get(sample->uy));
-	gsl_vector_set (x, 2, hkl_parameter_value_get(sample->uz));
-	gsl_vector_set (x, 3, hkl_parameter_value_get(sample->lattice->a));
-	gsl_vector_set (x, 4, hkl_parameter_value_get(sample->lattice->b));
-	gsl_vector_set (x, 5, hkl_parameter_value_get(sample->lattice->c));
-	gsl_vector_set (x, 6, hkl_parameter_value_get(sample->lattice->alpha));
-	gsl_vector_set (x, 7, hkl_parameter_value_get(sample->lattice->beta));
-	gsl_vector_set (x, 8, hkl_parameter_value_get(sample->lattice->gamma));
+	hkl_sample_to_gsl_vector(sample, x);
 
 	/* Set initial step sizes to 1 */
 	ss = gsl_vector_alloc (9);
@@ -221,17 +283,39 @@ static double minimize(HklSample *sample, double (* f) (const gsl_vector * x, vo
 	do {
 		++iter;
 		status = gsl_multimin_fminimizer_iterate(s);
+#ifdef DEBUG
+		fprintf(stderr, "status iterate: %d (%d): %s\n", status, iter, gsl_strerror(status));
+#endif
 		if (status)
 			break;
 		size = gsl_multimin_fminimizer_size (s);
 		status = gsl_multimin_test_size (size, HKL_EPSILON / 2.);
-	} while (status == GSL_CONTINUE && iter < 10000);
+#ifdef DEBUG
+		fprintf(stderr, "status test: %d size: %f :%s\n", status, size, gsl_strerror(status));
+		fprintf(stderr, " x:");
+		for(int i=0; i<9; ++i)
+			fprintf(stderr, " %f", gsl_vector_get(s->x, i));
+		fprintf(stderr, "\n");
+#endif
+	} while (status == GSL_CONTINUE && iter < ITER_MAX);
 	gsl_vector_free(x);
 	gsl_vector_free(ss);
 	gsl_multimin_fminimizer_free(s);
 	gsl_set_error_handler (NULL);
 
-	return size;
+	if (status == GSL_CONTINUE){
+		hkl_sample_sample_set(sample, saved); /* restore the saved sample */
+		g_set_error(error,
+			    HKL_SAMPLE_ERROR,
+			    HKL_SAMPLE_ERROR_MINIMIZED,
+			    "Minimization failed after %d iterations.",
+			    ITER_MAX);
+		res = FALSE;
+	}
+
+	hkl_sample_free(saved);
+
+	return res;
 }
 
 /*************/
@@ -261,21 +345,25 @@ HklSample* hkl_sample_new(const char *name)
 	hkl_matrix_init(&self->U,1, 0, 0, 0, 1, 0, 0, 0, 1);
 	hkl_matrix_init(&self->UB,1, 0, 0, 0, 1, 0, 0, 0, 1);
 
-	self->ux = hkl_parameter_new("ux", -M_PI, 0., M_PI,
-				     HKL_TRUE, HKL_TRUE,
+	self->ux = hkl_parameter_new("ux", "the sample rotation around $\vec{x}$",
+				     -M_PI, 0., M_PI,
+				     TRUE, TRUE,
 				     &hkl_unit_angle_rad,
 				     &hkl_unit_angle_deg);
-	self->uy = hkl_parameter_new("uy", -M_PI, 0., M_PI,
-				     HKL_TRUE, HKL_TRUE,
+	self->uy = hkl_parameter_new("uy", "the sample rotation around $\vec{y}$",
+				     -M_PI, 0., M_PI,
+				     TRUE, TRUE,
 				     &hkl_unit_angle_rad,
 				     &hkl_unit_angle_deg);
-	self->uz = hkl_parameter_new("uz", -M_PI, 0., M_PI,
-				     HKL_TRUE, HKL_TRUE,
+	self->uz = hkl_parameter_new("uz", "the sample rotation around $\vec{z}$",
+				     -M_PI, 0., M_PI,
+				     TRUE, TRUE,
 				     &hkl_unit_angle_rad,
 				     &hkl_unit_angle_deg);
 
 	hkl_sample_compute_UB(self);
 	list_head_init(&self->reflections);
+	self->n_reflections = 0;
 
 	return self;
 }
@@ -291,7 +379,6 @@ HklSample* hkl_sample_new(const char *name)
 HklSample *hkl_sample_new_copy(const HklSample *self)
 {
 	HklSample *dup = NULL;
-	HklSampleReflection *reflection;
 
 	/* check parameters */
 	if(!self)
@@ -307,12 +394,7 @@ HklSample *hkl_sample_new_copy(const HklSample *self)
 	dup->uy = hkl_parameter_new_copy(self->uy);
 	dup->uz = hkl_parameter_new_copy(self->uz);
 
-	/* copy the reflections */
-	list_head_init(&dup->reflections);
-	list_for_each(&self->reflections, reflection, list){
-		list_add_tail(&dup->reflections,
-			      &hkl_sample_reflection_new_copy(reflection)->list);
-	}
+	hkl_sample_copy_all_reflections(dup, self);
 
 	return dup;
 }
@@ -325,9 +407,6 @@ HklSample *hkl_sample_new_copy(const HklSample *self)
  **/
 void hkl_sample_free(HklSample *self)
 {
-	HklSampleReflection *reflection;
-	HklSampleReflection *next;
-
 	if (!self)
 		return;
 
@@ -336,10 +415,7 @@ void hkl_sample_free(HklSample *self)
 	hkl_parameter_free(self->ux);
 	hkl_parameter_free(self->uy);
 	hkl_parameter_free(self->uz);
-	list_for_each_safe(&self->reflections, reflection, next, list){
-		list_del(&reflection->list);
-		hkl_sample_reflection_free(reflection);
-	}
+	hkl_sample_clear_all_reflections(self);
 	free(self);
 }
 
@@ -427,35 +503,58 @@ const HklParameter *hkl_sample_uz_get(const HklSample *self)
  * hkl_sample_ux_set:
  * @self: the this ptr
  * @ux: the ux parameter to set
-
+ * @error: return location for a GError, or NULL
+ *
  * set the ux part of the U matrix.
+ *
+ * Returns: TRUE on success, FALSE if an error occurred
  **/
-void hkl_sample_ux_set(HklSample *self,
-		       const HklParameter *ux)
+int hkl_sample_ux_set(HklSample *self,
+		      const HklParameter *ux,
+		      GError **error)
 {
-	hkl_parameter_init_copy(self->ux, ux);
+	hkl_error (error == NULL || *error == NULL);
+
+	if(!hkl_parameter_init_copy(self->ux, ux, error)){
+		g_assert (error == NULL || *error != NULL);
+		return FALSE;
+	}
+	g_assert (error == NULL || *error == NULL);
+
 	hkl_matrix_init_from_euler(&self->U,
-				   hkl_parameter_value_get(self->ux),
-				   hkl_parameter_value_get(self->uy),
-				   hkl_parameter_value_get(self->uz));
+				   hkl_parameter_value_get(self->ux, HKL_UNIT_DEFAULT),
+				   hkl_parameter_value_get(self->uy, HKL_UNIT_DEFAULT),
+				   hkl_parameter_value_get(self->uz, HKL_UNIT_DEFAULT));
 	hkl_sample_compute_UB(self);
+
+	return TRUE;
 }
 
 /**
  * hkl_sample_uy_set:
  * @self: the this ptr
  * @uy: the uy parameter to set
-
+ * @error: return location for a GError, or NULL
+ *
  * set the uy part of the U matrix.
+ *
+ * Returns: TRUE on success, FALSE if an error occurred
  **/
-void hkl_sample_uy_set(HklSample *self,
-		       const HklParameter *uy)
+int hkl_sample_uy_set(HklSample *self, const HklParameter *uy,
+		      GError **error)
 {
-	hkl_parameter_init_copy(self->uy, uy);
+	hkl_error (error == NULL || *error == NULL);
+
+	if(!hkl_parameter_init_copy(self->uy, uy, error)){
+		g_assert (error == NULL || *error != NULL);
+		return FALSE;
+	}
+	g_assert (error == NULL || *error == NULL);
+
 	hkl_matrix_init_from_euler(&self->U,
-				   hkl_parameter_value_get(self->ux),
-				   hkl_parameter_value_get(self->uy),
-				   hkl_parameter_value_get(self->uz));
+				   hkl_parameter_value_get(self->ux, HKL_UNIT_DEFAULT),
+				   hkl_parameter_value_get(self->uy, HKL_UNIT_DEFAULT),
+				   hkl_parameter_value_get(self->uz, HKL_UNIT_DEFAULT));
 	hkl_sample_compute_UB(self);
 }
 
@@ -463,17 +562,27 @@ void hkl_sample_uy_set(HklSample *self,
  * hkl_sample_uz_set:
  * @self: the this ptr
  * @uz: the uz parameter to set
-
+ * @error: return location for a GError, or NULL
+ *
  * set the uz part of the U matrix.
+ *
+ * Returns: TRUE on success, FALSE if an error occurred
  **/
-void hkl_sample_uz_set(HklSample *self,
-		       const HklParameter *uz)
+int hkl_sample_uz_set(HklSample *self, const HklParameter *uz,
+		      GError **error)
 {
-	hkl_parameter_init_copy(self->uz, uz);
+	hkl_error (error == NULL || *error == NULL);
+
+	if(!hkl_parameter_init_copy(self->uz, uz, error)){
+		g_assert (error == NULL || *error != NULL);
+		return FALSE;
+	}
+	g_assert (error == NULL || *error == NULL);
+
 	hkl_matrix_init_from_euler(&self->U,
-				   hkl_parameter_value_get(self->ux),
-				   hkl_parameter_value_get(self->uy),
-				   hkl_parameter_value_get(self->uz));
+				   hkl_parameter_value_get(self->ux, HKL_UNIT_DEFAULT),
+				   hkl_parameter_value_get(self->uy, HKL_UNIT_DEFAULT),
+				   hkl_parameter_value_get(self->uz, HKL_UNIT_DEFAULT));
 	hkl_sample_compute_UB(self);
 }
 
@@ -488,16 +597,19 @@ const HklMatrix *hkl_sample_U_get(const HklSample *self)
 	return &self->U;
 }
 
-void hkl_sample_U_set(HklSample *self, const HklMatrix *U)
+/*
+ * TODO implemente the error
+ */
+void hkl_sample_U_set(HklSample *self, const HklMatrix *U, GError **error)
 {
 	double x, y, z;
 
 	hkl_matrix_matrix_set(&self->U, U);
 	hkl_sample_compute_UB(self);
 	hkl_matrix_to_euler(&self->U, &x, &y, &z);
-	hkl_parameter_value_set(self->ux, x, NULL);
-	hkl_parameter_value_set(self->uy, y, NULL);
-	hkl_parameter_value_set(self->uz, z, NULL);
+	hkl_parameter_value_set(self->ux, x, HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(self->uy, y, HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(self->uz, z, HKL_UNIT_DEFAULT, NULL);
 }
 
 /**
@@ -515,51 +627,64 @@ const HklMatrix *hkl_sample_UB_get(const HklSample *self)
  * hkl_sample_UB_set:
  * @self: the sample to modify
  * @UB: the UB matrix to set
+ * @error: error set in case of impossibility
  *
  * Set the UB matrix using an external UB matrix. In fact you give
  * the UB matrix but only the U matrix of the sample is affected by
  * this operation. We keep the B matrix constant.
  * U * B = UB -> U = UB * B^-1
+ * TODO implemente the error
  **/
-double hkl_sample_UB_set(HklSample *self, const HklMatrix *UB)
+int hkl_sample_UB_set(HklSample *self, const HklMatrix *UB,
+		      GError **error)
 {
 	struct set_UB_t params = {
 		.sample = self,
-		.UB = UB
+		.UB = *UB
 	};
 
-	return minimize(self, set_UB_fitness, &params);
+	return minimize(self, set_UB_fitness, &params, error);
+}
+
+/**
+ * hkl_sample_n_reflections_get: (skip)
+ * @self: the this ptr
+ *
+ * return the number of reflections of the sample
+ *
+ * Returns:
+ **/
+size_t hkl_sample_n_reflections_get(const HklSample *self)
+{
+	return self->n_reflections;
 }
 
 /**
- * hkl_sample_first_reflection_get: (skip)
+ * hkl_sample_reflections_first_get: (skip)
  * @self: the this ptr
  *
  * Return value: the first HklSampleReflection of the sample.
- **/ 
-HklSampleReflection *hkl_sample_first_reflection_get(const HklSample *self)
+ **/
+HklSampleReflection *hkl_sample_reflections_first_get(HklSample *self)
 {
 	return list_top(&self->reflections, HklSampleReflection, list);
 }
 
 /**
- * hkl_sample_next_reflection_get: (skip)
+ * hkl_sample_reflections_next_get: (skip)
  * @self: the this ptr
  * @reflection: the current reflection
  *
  * Return value: (allow-none): the next reflection or NULL if no more reflection
  **/
-HklSampleReflection *hkl_sample_next_reflection_get(const HklSample *self,
-						    const HklSampleReflection *reflection)
+HklSampleReflection *hkl_sample_reflections_next_get(HklSample *self,
+						     HklSampleReflection *reflection)
 {
-	if (&self->reflections.n == reflection->list.next)
-		return NULL;
-	else
-		return list_entry(reflection->list.next, HklSampleReflection, list);
+	return list_next(&self->reflections, reflection, list);
 }
 
 /**
- * hkl_sample_add_reflection: (skip)
+ * hkl_sample_add_reflection:
  * @self: the this ptr
  * @reflection: The reflection to add
  *
@@ -577,6 +702,7 @@ void hkl_sample_add_reflection(HklSample *self,
 	}
 
 	list_add_tail(&self->reflections, &reflection->list);
+	self->n_reflections++;
 }
 
 /**
@@ -591,6 +717,7 @@ void hkl_sample_del_reflection(HklSample *self,
 {
 	list_del(&reflection->list);
 	hkl_sample_reflection_free(reflection);
+	self->n_reflections--;
 }
 
 /**
@@ -606,9 +733,12 @@ void hkl_sample_del_reflection(HklSample *self,
  **/
 int hkl_sample_compute_UB_busing_levy(HklSample *self,
 				      const HklSampleReflection *r1,
-				      const HklSampleReflection *r2)
+				      const HklSampleReflection *r2,
+				      GError **error)
 
 {
+	hkl_error (error == NULL || *error == NULL);
+
 	if (!hkl_vector_is_colinear(&r1->hkl, &r2->hkl)) {
 		HklVector h1c;
 		HklVector h2c;
@@ -630,10 +760,17 @@ int hkl_sample_compute_UB_busing_levy(HklSample *self,
 		hkl_matrix_times_matrix(&self->U, &Tc);
 		hkl_sample_compute_UxUyUz(self);
 		hkl_sample_compute_UB(self);
-	} else
-		return HKL_FALSE;
+	}else{
+		g_set_error(error,
+			    HKL_SAMPLE_ERROR,
+			    HKL_SAMPLE_ERROR_COMPUTE_UB_BUSING_LEVY,
+			    "It is not possible to compute the UB matrix when the given reflections are colinear");
 
-	return HKL_TRUE;
+		return FALSE;
+	}
+	g_assert (error == NULL || *error == NULL);
+
+	return TRUE;
 }
 
 /**
@@ -644,22 +781,22 @@ int hkl_sample_compute_UB_busing_levy(HklSample *self,
  *
  * Returns: the fitness of the affined #HklSample
  **/
-double hkl_sample_affine(HklSample *self)
+int hkl_sample_affine(HklSample *self, GError **error)
 {
-	return minimize(self, mono_crystal_fitness, self);
+	return minimize(self, mono_crystal_fitness, self, error);
 }
 
 /**
- * hkl_sample_get_reflection_mesured_angle:
+ * hkl_sample_get_reflection_measured_angle:
  * @self: the this ptr
  * @r1: the first #HklSampleReflection
  * @r2: the second #HklSampleReflection
  *
- * get the mesured angles between two #HklSampleReflection
+ * get the measured angles between two #HklSampleReflection
  *
- * Returns: the mesured angle beetween them
+ * Returns: the measured angle beetween them
  **/
-double hkl_sample_get_reflection_mesured_angle(const HklSample *self,
+double hkl_sample_get_reflection_measured_angle(const HklSample *self,
 					       const HklSampleReflection *r1,
 					       const HklSampleReflection *r2)
 {
@@ -747,7 +884,7 @@ void hkl_sample_fprintf(FILE *f, const HklSample *self)
 				reflection->hkl.data[1],
 				reflection->hkl.data[2]);
 			darray_foreach(axis, reflection->geometry->axes){
-				fprintf(f, " %-10.6f", hkl_parameter_value_unit_get(*axis));
+				fprintf(f, " %-10.6f", hkl_parameter_value_get(*axis, HKL_UNIT_USER));
 			}
 		}
 	}
@@ -771,7 +908,8 @@ void hkl_sample_fprintf(FILE *f, const HklSample *self)
  **/
 HklSampleReflection *hkl_sample_reflection_new(const HklGeometry *geometry,
 					       const HklDetector *detector,
-					       double h, double k, double l)
+					       double h, double k, double l,
+					       GError **error)
 {
 	HklSampleReflection *self;
 
@@ -785,7 +923,7 @@ HklSampleReflection *hkl_sample_reflection_new(const HklGeometry *geometry,
 	self->hkl.data[0] = h;
 	self->hkl.data[1] = k;
 	self->hkl.data[2] = l;
-	self->flag = HKL_TRUE;
+	self->flag = TRUE;
 
 	hkl_sample_reflection_update(self);
 
@@ -851,17 +989,31 @@ void hkl_sample_reflection_hkl_get(const HklSampleReflection *self,
  * @h: the h-coordinate of the #HklSampleReflection
  * @k: the k-coordinate of the #HklSampleReflection
  * @l: the l-coordinate of the #HklSampleReflection
+ * @error: return location for a GError, or NULL
  *
  * set the hkl coordinates of the #HklSampleReflection
+ *
+ * Returns: TRUE on success, FALSE if an error occurred
  **/
-void hkl_sample_reflection_hkl_set(HklSampleReflection *self, double h, double k, double l)
+int hkl_sample_reflection_hkl_set(HklSampleReflection *self,
+				  double h, double k, double l,
+				  GError **error)
 {
-	if((fabs(h) + fabs(k) + fabs(l) < HKL_EPSILON))
-		return;
+	hkl_error (error == NULL || *error == NULL);
+
+	if((fabs(h) + fabs(k) + fabs(l) < HKL_EPSILON)){
+		g_set_error(error,
+			    HKL_SAMPLE_REFLECTION_ERROR,
+			    HKL_SAMPLE_REFLECTION_ERROR_HKL_SET,
+			    "it is not allow to set a null hkl reflection\n");
+		return FALSE;
+	}
 
 	self->hkl.data[0] = h;
 	self->hkl.data[1] = k;
 	self->hkl.data[2] = l;
+
+	return TRUE;
 }
 
 /**
diff --git a/hkl/hkl-source-private.h b/hkl/hkl-source-private.h
index 3c45209..fc69633 100644
--- a/hkl/hkl-source-private.h
+++ b/hkl/hkl-source-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,9 +22,11 @@
 #ifndef __HKL_SOURCE_PRIVATE_H__
 #define __HKL_SOURCE_PRIVATE_H__
 
-#include "hkl-vector-private.h"
+#include <stdio.h>                      // for FILE
+#include "hkl-vector-private.h"         // for HklVector
+#include "hkl.h"                        // for G_BEGIN_DECLS, etc
 
-HKL_BEGIN_DECLS
+G_BEGIN_DECLS
 
 #define HKL_SOURCE_DEFAULT_WAVE_LENGTH (1.54)
 
@@ -51,6 +53,6 @@ extern double hkl_source_get_wavelength(HklSource const *self);
 
 extern void hkl_source_fprintf(FILE *f, HklSource const *self);
 
-HKL_END_DECLS
+G_END_DECLS
 
 #endif /* __HKL_SOURCE_PRIVATE_H__ */
diff --git a/hkl/hkl-source.c b/hkl/hkl-source.c
index 7135cda..10bef32 100644
--- a/hkl/hkl-source.c
+++ b/hkl/hkl-source.c
@@ -13,17 +13,19 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <stdlib.h>
-#include <math.h>
-
-#include "hkl-macros-private.h"
-#include "hkl-source-private.h"
+#include <math.h>                       // for fabs, sqrt
+#include <stdio.h>                      // for fprintf, FILE
+#include <stdlib.h>                     // for free
+#include "hkl-macros-private.h"         // for HKL_MALLOC
+#include "hkl-source-private.h"         // for HklSource
+#include "hkl-vector-private.h"         // for hkl_vector_div_double, etc
+#include "hkl.h"                        // for HKL_EPSILON, FALSE, etc
 
 /**
  * hkl_source_dup:
@@ -80,9 +82,9 @@ int hkl_source_init(HklSource *self,
 		self->wave_length = wave_length;
 		hkl_vector_init(&self->direction, x, y, z);
 		hkl_vector_div_double(&self->direction, norm);
-		return HKL_TRUE;
+		return TRUE;
 	} else
-		return HKL_FALSE;
+		return FALSE;
 }
 
 /**
diff --git a/hkl/hkl-type-builtins.c b/hkl/hkl-type-builtins.c
index 56745f3..b6ad45a 100644
--- a/hkl/hkl-type-builtins.c
+++ b/hkl/hkl-type-builtins.c
@@ -8,6 +8,21 @@
 #include "hkl-type-builtins.h"
 /* enumerations from "../hkl.h" */
 GType
+hkl_unit_enum_get_type (void)
+{
+    static GType etype = 0;
+    if (G_UNLIKELY(etype == 0)) {
+        static const GEnumValue values[] = {
+            { HKL_UNIT_DEFAULT, "HKL_UNIT_DEFAULT", "default" },
+            { HKL_UNIT_USER, "HKL_UNIT_USER", "user" },
+            { 0, NULL, NULL }
+        };
+        etype = g_enum_register_static (g_intern_static_string ("HklUnitEnum"), values);
+    }
+    return etype;
+}
+
+GType
 hkl_detector_type_get_type (void)
 {
     static GType etype = 0;
@@ -21,6 +36,37 @@ hkl_detector_type_get_type (void)
     return etype;
 }
 
+GType
+hkl_engine_capabilities_get_type (void)
+{
+    static GType etype = 0;
+    if (G_UNLIKELY(etype == 0)) {
+        static const GFlagsValue values[] = {
+            { HKL_ENGINE_CAPABILITIES_READABLE, "HKL_ENGINE_CAPABILITIES_READABLE", "readable" },
+            { HKL_ENGINE_CAPABILITIES_WRITABLE, "HKL_ENGINE_CAPABILITIES_WRITABLE", "writable" },
+            { HKL_ENGINE_CAPABILITIES_INITIALIZABLE, "HKL_ENGINE_CAPABILITIES_INITIALIZABLE", "initializable" },
+            { 0, NULL, NULL }
+        };
+        etype = g_flags_register_static (g_intern_static_string ("HklEngineCapabilities"), values);
+    }
+    return etype;
+}
+
+GType
+hkl_engine_axis_names_get_get_type (void)
+{
+    static GType etype = 0;
+    if (G_UNLIKELY(etype == 0)) {
+        static const GEnumValue values[] = {
+            { HKL_ENGINE_AXIS_NAMES_GET_READ, "HKL_ENGINE_AXIS_NAMES_GET_READ", "read" },
+            { HKL_ENGINE_AXIS_NAMES_GET_WRITE, "HKL_ENGINE_AXIS_NAMES_GET_WRITE", "write" },
+            { 0, NULL, NULL }
+        };
+        etype = g_enum_register_static (g_intern_static_string ("HklEngineAxisNamesGet"), values);
+    }
+    return etype;
+}
+
 #define __HKL_TYPE_BUILTINS_C__
 
 /* Generated data ends here */
diff --git a/hkl/hkl-type-builtins.h b/hkl/hkl-type-builtins.h
index e8e7c9b..2150eb0 100644
--- a/hkl/hkl-type-builtins.h
+++ b/hkl/hkl-type-builtins.h
@@ -4,13 +4,21 @@
 #ifndef __HKL_TYPE_BUILTINS_H__
 #define __HKL_TYPE_BUILTINS_H__
 
-#include <glib-object.h>
+#include <glib.h>               // for G_BEGIN_DECLS, G_END_DECLS, etc
+#include <glib-object.h>	// GType
+#include "hkl.h"                // for HKLAPI
 
 G_BEGIN_DECLS
 
 /* enumerations from "../hkl.h" */
+HKLAPI GType hkl_unit_enum_get_type (void) G_GNUC_CONST;
+#define HKL_TYPE_UNIT_ENUM (hkl_unit_enum_get_type ())
 HKLAPI GType hkl_detector_type_get_type (void) G_GNUC_CONST;
 #define HKL_TYPE_DETECTOR_TYPE (hkl_detector_type_get_type ())
+HKLAPI GType hkl_engine_capabilities_get_type (void) G_GNUC_CONST;
+#define HKL_TYPE_ENGINE_CAPABILITIES (hkl_engine_capabilities_get_type ())
+HKLAPI GType hkl_engine_axis_names_get_get_type (void) G_GNUC_CONST;
+#define HKL_TYPE_ENGINE_AXIS_NAMES_GET (hkl_engine_axis_names_get_get_type ())
 G_END_DECLS
 
 #endif /* __HKL_TYPE_BUILTINS_H__ */
diff --git a/hkl/hkl-type-builtins.h.template b/hkl/hkl-type-builtins.h.template
index b256013..a6537f8 100644
--- a/hkl/hkl-type-builtins.h.template
+++ b/hkl/hkl-type-builtins.h.template
@@ -2,7 +2,9 @@
 #ifndef __HKL_TYPE_BUILTINS_H__
 #define __HKL_TYPE_BUILTINS_H__
 
-#include <glib-object.h>
+#include <glib.h>               // for G_BEGIN_DECLS, G_END_DECLS, etc
+#include <glib-object.h>	// GType
+#include "hkl.h"                // for HKLAPI
 
 G_BEGIN_DECLS
 /*** END file-header ***/
diff --git a/hkl/hkl-types.c b/hkl/hkl-types.c
index 02890e7..c62e7a0 100644
--- a/hkl/hkl-types.c
+++ b/hkl/hkl-types.c
@@ -13,241 +13,53 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2011-2013 Synchrotron SOLEIL
+ * Copyright (C) 2011-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include "hkl-detector-private.h"
-#include "hkl-error-private.h"
-#include "hkl-lattice-private.h"
-#include "hkl-pseudoaxis-private.h"
-#include "hkl-sample-private.h"
+#include <glib-object.h>
 #include "hkl-types.h"
-
-GType hkl_error_get_type (void) {
-        static volatile gsize hkl_error_type_id__volatile = 0;
-        if (g_once_init_enter (&hkl_error_type_id__volatile)) {
-                GType hkl_error_type_id;
-                hkl_error_type_id = g_boxed_type_register_static ("HklError",
-								  (GBoxedCopyFunc) hkl_error_new_copy,
-								  (GBoxedFreeFunc) hkl_error_free);
-                g_once_init_leave (&hkl_error_type_id__volatile, hkl_error_type_id);
-        }
-        return hkl_error_type_id__volatile;
-}
-
-GType hkl_vector_get_type (void) {
-        static volatile gsize hkl_vector_type_id__volatile = 0;
-        if (g_once_init_enter (&hkl_vector_type_id__volatile)) {
-                GType hkl_vector_type_id;
-                hkl_vector_type_id = g_boxed_type_register_static ("HklVector",
-								   (GBoxedCopyFunc) hkl_vector_dup,
-								   (GBoxedFreeFunc) hkl_vector_free);
-                g_once_init_leave (&hkl_vector_type_id__volatile, hkl_vector_type_id);
-        }
-        return hkl_vector_type_id__volatile;
-}
-
-GType hkl_matrix_get_type (void) {
-        static volatile gsize hkl_matrix_type_id__volatile = 0;
-        if (g_once_init_enter (&hkl_matrix_type_id__volatile)) {
-                GType hkl_matrix_type_id;
-                hkl_matrix_type_id = g_boxed_type_register_static ("HklMatrix",
-								   (GBoxedCopyFunc) hkl_matrix_dup,
-								   (GBoxedFreeFunc) hkl_matrix_free);
-                g_once_init_leave (&hkl_matrix_type_id__volatile, hkl_matrix_type_id);
-        }
-        return hkl_matrix_type_id__volatile;
-}
-
-GType hkl_unit_get_type (void) {
-        static volatile gsize hkl_unit_type_id__volatile = 0;
-        if (g_once_init_enter (&hkl_unit_type_id__volatile)) {
-                GType hkl_unit_type_id;
-                hkl_unit_type_id = g_boxed_type_register_static ("HklUnit",
-								 (GBoxedCopyFunc) hkl_unit_dup,
-								 (GBoxedFreeFunc) hkl_unit_free);
-                g_once_init_leave (&hkl_unit_type_id__volatile, hkl_unit_type_id);
-        }
-        return hkl_unit_type_id__volatile;
-}
-
-GType hkl_parameter_get_type (void) {
-        static volatile gsize hkl_parameter_type_id__volatile = 0;
-        if (g_once_init_enter (&hkl_parameter_type_id__volatile)) {
-                GType hkl_parameter_type_id;
-                hkl_parameter_type_id = g_boxed_type_register_static ("HklParameter",
-								      (GBoxedCopyFunc) hkl_parameter_new_copy,
-								      (GBoxedFreeFunc) hkl_parameter_free);
-                g_once_init_leave (&hkl_parameter_type_id__volatile, hkl_parameter_type_id);
-        }
-        return hkl_parameter_type_id__volatile;
-}
-
-static HklEngine* hkl_parameter_list_fake_ref(HklEngine *src)
-{
-	return src;
-}
-
-static void hkl_parameter_list_fake_unref(HklEngine *src)
-{
-	return;
-}
-
-GType hkl_parameter_list_get_type (void) {
-        static volatile gsize hkl_parameter_list_type_id__volatile = 0;
-        if (g_once_init_enter (&hkl_parameter_list_type_id__volatile)) {
-                GType hkl_parameter_list_type_id;
-                hkl_parameter_list_type_id = g_boxed_type_register_static ("HklParameterList",
-									   (GBoxedCopyFunc) hkl_parameter_list_fake_ref,
-									   (GBoxedFreeFunc) hkl_parameter_list_fake_unref);
-                g_once_init_leave (&hkl_parameter_list_type_id__volatile, hkl_parameter_list_type_id);
-        }
-        return hkl_parameter_list_type_id__volatile;
-}
-
-GType hkl_axis_get_type (void) {
-        static volatile gsize hkl_axis_type_id__volatile = 0;
-        if (g_once_init_enter (&hkl_axis_type_id__volatile)) {
-                GType hkl_axis_type_id;
-                hkl_axis_type_id = g_boxed_type_register_static ("HklAxis",
-								 (GBoxedCopyFunc) hkl_parameter_new_copy,
-								 (GBoxedFreeFunc) hkl_parameter_free);
-                g_once_init_leave (&hkl_axis_type_id__volatile, hkl_axis_type_id);
-        }
-        return hkl_axis_type_id__volatile;
-}
-
-GType hkl_geometry_get_type (void) {
-        static volatile gsize hkl_geometry_type_id__volatile = 0;
-        if (g_once_init_enter (&hkl_geometry_type_id__volatile)) {
-                GType hkl_geometry_type_id;
-                hkl_geometry_type_id = g_boxed_type_register_static ("HklGeometry",
-								     (GBoxedCopyFunc) hkl_geometry_new_copy,
-								     (GBoxedFreeFunc) hkl_geometry_free);
-                g_once_init_leave (&hkl_geometry_type_id__volatile, hkl_geometry_type_id);
-        }
-        return hkl_geometry_type_id__volatile;
-}
-
-GType hkl_geometry_list_item_get_type (void) {
-        static volatile gsize hkl_geometry_list_item_type_id__volatile = 0;
-        if (g_once_init_enter (&hkl_geometry_list_item_type_id__volatile)) {
-                GType hkl_geometry_list_item_type_id;
-                hkl_geometry_list_item_type_id = g_boxed_type_register_static ("HklGeometryListItem",
-									       (GBoxedCopyFunc) hkl_geometry_list_item_new_copy,
-									       (GBoxedFreeFunc) hkl_geometry_list_item_free);
-                g_once_init_leave (&hkl_geometry_list_item_type_id__volatile, hkl_geometry_list_item_type_id);
-        }
-        return hkl_geometry_list_item_type_id__volatile;
-}
-
-GType hkl_geometry_list_get_type (void) {
-        static volatile gsize hkl_geometry_list_type_id__volatile = 0;
-        if (g_once_init_enter (&hkl_geometry_list_type_id__volatile)) {
-                GType hkl_geometry_list_type_id;
-                hkl_geometry_list_type_id = g_boxed_type_register_static ("HklGeometryList",
-									  (GBoxedCopyFunc) hkl_geometry_list_new_copy,
-									  (GBoxedFreeFunc) hkl_geometry_list_free);
-                g_once_init_leave (&hkl_geometry_list_type_id__volatile, hkl_geometry_list_type_id);
-        }
-        return hkl_geometry_list_type_id__volatile;
-}
-
-GType hkl_detector_get_type (void) {
-        static volatile gsize hkl_detector_type_id__volatile = 0;
-        if (g_once_init_enter (&hkl_detector_type_id__volatile)) {
-                GType hkl_detector_type_id;
-                hkl_detector_type_id = g_boxed_type_register_static ("HklDetector",
-								     (GBoxedCopyFunc) hkl_detector_new_copy,
-								     (GBoxedFreeFunc) hkl_detector_free);
-                g_once_init_leave (&hkl_detector_type_id__volatile, hkl_detector_type_id);
-        }
-        return hkl_detector_type_id__volatile;
-}
-
-GType hkl_lattice_get_type (void) {
-        static volatile gsize hkl_lattice_type_id__volatile = 0;
-        if (g_once_init_enter (&hkl_lattice_type_id__volatile)) {
-                GType hkl_lattice_type_id;
-                hkl_lattice_type_id = g_boxed_type_register_static ("HklLattice",
-								    (GBoxedCopyFunc) hkl_lattice_new_copy,
-								    (GBoxedFreeFunc) hkl_lattice_free);
-                g_once_init_leave (&hkl_lattice_type_id__volatile, hkl_lattice_type_id);
-        }
-        return hkl_lattice_type_id__volatile;
-}
-
-GType hkl_sample_reflection_get_type (void) {
-        static volatile gsize hkl_sample_reflection_type_id__volatile = 0;
-        if (g_once_init_enter (&hkl_sample_reflection_type_id__volatile)) {
-                GType hkl_sample_reflection_type_id;
-                hkl_sample_reflection_type_id = g_boxed_type_register_static ("HklSampleReflection",
-									      (GBoxedCopyFunc) hkl_sample_reflection_new_copy,
-									      (GBoxedFreeFunc) hkl_sample_reflection_free);
-                g_once_init_leave (&hkl_sample_reflection_type_id__volatile, hkl_sample_reflection_type_id);
-        }
-        return hkl_sample_reflection_type_id__volatile;
-}
-
-GType hkl_sample_get_type (void) {
-        static volatile gsize hkl_sample_type_id__volatile = 0;
-        if (g_once_init_enter (&hkl_sample_type_id__volatile)) {
-                GType hkl_sample_type_id;
-                hkl_sample_type_id = g_boxed_type_register_static ("HklSample",
-								   (GBoxedCopyFunc) hkl_sample_new_copy,
-								   (GBoxedFreeFunc) hkl_sample_free);
-                g_once_init_leave (&hkl_sample_type_id__volatile, hkl_sample_type_id);
-        }
-        return hkl_sample_type_id__volatile;
-}
-
-GType hkl_pseudo_axis_get_type (void) {
-        static volatile gsize hkl_pseudo_axis_type_id__volatile = 0;
-        if (g_once_init_enter (&hkl_pseudo_axis_type_id__volatile)) {
-                GType hkl_pseudo_axis_type_id;
-                hkl_pseudo_axis_type_id = g_boxed_type_register_static ("HklPseudoAxis",
-									(GBoxedCopyFunc) hkl_parameter_new_copy,
-									(GBoxedFreeFunc) hkl_parameter_free);
-                g_once_init_leave (&hkl_pseudo_axis_type_id__volatile, hkl_pseudo_axis_type_id);
-        }
-        return hkl_pseudo_axis_type_id__volatile;
-}
-
-static HklEngine* hkl_engine_fake_ref(HklEngine *src)
-{
-	return src;
-}
-
-static void hkl_engine_fake_unref(HklEngine *src)
-{
-	return;
-}
-
-GType hkl_engine_get_type (void) {
-        static volatile gsize hkl_engine_type_id__volatile = 0;
-        if (g_once_init_enter (&hkl_engine_type_id__volatile)) {
-                GType hkl_engine_type_id;
-                hkl_engine_type_id = g_boxed_type_register_static (
-			"HklEngine",
-			(GBoxedCopyFunc) hkl_engine_fake_ref,
-			(GBoxedFreeFunc) hkl_engine_fake_unref);
-                g_once_init_leave (&hkl_engine_type_id__volatile, hkl_engine_type_id);
-        }
-        return hkl_engine_type_id__volatile;
-}
-
-GType hkl_engine_list_get_type (void) {
-        static volatile gsize hkl_engine_list_type_id__volatile = 0;
-        if (g_once_init_enter (&hkl_engine_list_type_id__volatile)) {
-                GType hkl_engine_list_type_id;
-                hkl_engine_list_type_id = g_boxed_type_register_static (
-			"HklEngineList",
-			(GBoxedCopyFunc) hkl_engine_list_new_copy,
-			(GBoxedFreeFunc) hkl_engine_list_free);
-                g_once_init_leave (&hkl_engine_list_type_id__volatile, hkl_engine_list_type_id);
-        }
-        return hkl_engine_list_type_id__volatile;
-}
+#include "glib/gthread.h"               // for g_once_init_enter, etc
+#include "glibconfig.h"                 // for gsize
+#include "hkl-detector-private.h"       // for hkl_detector_new_copy
+#include "hkl-geometry-private.h"       // for hkl_geometry_list_free, etc
+#include "hkl-matrix-private.h"         // for hkl_matrix_dup
+#include "hkl-pseudoaxis-private.h"     // for hkl_engine_list_new_copy
+#include "hkl-sample-private.h"         // for hkl_sample_reflection_free, etc
+#include "hkl-unit-private.h"           // for hkl_unit_dup, hkl_unit_free
+#include "hkl-vector-private.h"         // for hkl_vector_dup, etc
+
+#define HKL_TYPE(type, camelcase_type, copy, free)			\
+	GType hkl_## type ## _get_type (void) {				\
+		static volatile gsize hkl_type_id__volatile = 0;	\
+		if (g_once_init_enter (&hkl_type_id__volatile)) {	\
+			GType hkl_type_id;			\
+			hkl_type_id = g_boxed_type_register_static (	\
+				#camelcase_type,			\
+				(GBoxedCopyFunc) copy,			\
+				(GBoxedFreeFunc) free);			\
+			g_once_init_leave (&hkl_type_id__volatile, hkl_type_id); \
+		}							\
+		return hkl_type_id__volatile;				\
+	}
+
+static void * hkl_fake_ref(void *src) { return src; }
+static void hkl_fake_unref(void *src) { return; }
+
+HKL_TYPE(detector, HklDetector, hkl_detector_new_copy, hkl_detector_free);
+HKL_TYPE(engine, HklEngine, hkl_fake_ref, hkl_fake_unref);
+HKL_TYPE(engine_list, HklEngineList, hkl_engine_list_new_copy, hkl_engine_list_free);
+HKL_TYPE(factory, HklFactory, hkl_fake_ref, hkl_fake_unref);
+HKL_TYPE(geometry, HklGeometry, hkl_geometry_new_copy, hkl_geometry_free);
+HKL_TYPE(geometry_list, HklGeometryList, hkl_geometry_list_new_copy, hkl_geometry_list_free);
+HKL_TYPE(geometry_list_item, HklGeometryListItem, hkl_geometry_list_item_new_copy, hkl_geometry_list_item_free);
+HKL_TYPE(lattice, HklLattice, hkl_lattice_new_copy, hkl_lattice_free);
+HKL_TYPE(matrix, HklMatrix, hkl_matrix_dup, hkl_matrix_free);
+HKL_TYPE(parameter, HklParameter, hkl_parameter_new_copy, hkl_parameter_free);
+HKL_TYPE(quaternion, HklQuaternion, hkl_quaternion_dup, hkl_quaternion_free);
+HKL_TYPE(sample, HklSample, hkl_sample_new_copy, hkl_sample_free);
+HKL_TYPE(sample_reflection, HklSampleReflection, hkl_fake_ref, hkl_fake_unref);
+HKL_TYPE(unit, HklUnit, hkl_unit_dup, hkl_unit_free);
+HKL_TYPE(vector, HklVector, hkl_vector_dup, hkl_vector_free);
diff --git a/hkl/hkl-types.h b/hkl/hkl-types.h
index d22f91c..5ff7708 100644
--- a/hkl/hkl-types.h
+++ b/hkl/hkl-types.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,63 +22,52 @@
 #ifndef __HKL_GLIB_H__
 #define __HKL_GLIB_H__
 
-#include <glib.h>
-#include <glib-object.h>
-
-#include "hkl.h"
+#include <glib-object.h>               // for GType
+#include "hkl.h"                        // for HKLAPI
 
 G_BEGIN_DECLS
 
-#define TYPE_HKL_ERROR (hkl_error_get_type ())
-HKLAPI GType hkl_error_get_type (void) G_GNUC_CONST;
-
-#define TYPE_HKL_VECTOR (hkl_vector_get_type ())
-HKLAPI GType hkl_vector_get_type (void) G_GNUC_CONST;
-
-#define TYPE_HKL_MATRIX (hkl_matrix_get_type ())
-HKLAPI GType hkl_matrix_get_type (void) G_GNUC_CONST;
-
-#define TYPE_HKL_UNIT (hkl_unit_get_type ())
-HKLAPI GType hkl_unit_get_type (void) G_GNUC_CONST;
+#define TYPE_HKL_DETECTOR (hkl_detector_get_type ())
+HKLAPI GType hkl_detector_get_type (void) G_GNUC_CONST;
 
-#define TYPE_HKL_PARAMETER (hkl_parameter_get_type ())
-HKLAPI GType hkl_parameter_get_type (void) G_GNUC_CONST;
+#define TYPE_HKL_ENGINE (hkl_engine_get_type ())
+HKLAPI GType hkl_engine_get_type (void) G_GNUC_CONST;
 
-#define TYPE_HKL_PARAMETER_LIST (hkl_parameter_list_get_type ())
-HKLAPI GType hkl_parameter_list_get_type (void) G_GNUC_CONST;
+#define TYPE_HKL_ENGINE_LIST (hkl_engine_list_get_type ())
+HKLAPI GType hkl_engine_list_get_type (void) G_GNUC_CONST;
 
-#define TYPE_HKL_AXIS (hkl_axis_get_type ())
-HKLAPI GType hkl_axis_get_type (void) G_GNUC_CONST;
+#define TYPE_HKL_FACTORY (hkl_factory_get_type ())
+HKLAPI GType hkl_factory_get_type (void) G_GNUC_CONST;
 
 #define TYPE_HKL_GEOMETRY (hkl_geometry_get_type ())
 HKLAPI GType hkl_geometry_get_type (void) G_GNUC_CONST;
 
-#define TYPE_HKL_GEOMETRY_LIST_ITEM (hkl_geometry_list_item_get_type ())
-HKLAPI GType hkl_geometry_list_item_get_type (void) G_GNUC_CONST;
-
 #define TYPE_HKL_GEOMETRY_LIST (hkl_geometry_list_get_type ())
 HKLAPI GType hkl_geometry_list_get_type (void) G_GNUC_CONST;
 
-#define TYPE_HKL_DETECTOR (hkl_detector_get_type ())
-HKLAPI GType hkl_detector_get_type (void) G_GNUC_CONST;
+#define TYPE_HKL_GEOMETRY_LIST_ITEM (hkl_geometry_list_item_get_type ())
+HKLAPI GType hkl_geometry_list_item_get_type (void) G_GNUC_CONST;
 
 #define TYPE_HKL_LATTICE (hkl_lattice_get_type ())
 HKLAPI GType hkl_lattice_get_type (void) G_GNUC_CONST;
 
+#define TYPE_HKL_MATRIX (hkl_matrix_get_type ())
+HKLAPI GType hkl_matrix_get_type (void) G_GNUC_CONST;
+
+#define TYPE_HKL_PARAMETER (hkl_parameter_get_type ())
+HKLAPI GType hkl_parameter_get_type (void) G_GNUC_CONST;
+
 #define TYPE_HKL_SAMPLE_REFLECTION (hkl_sample_reflection_get_type ())
 HKLAPI GType hkl_sample_reflection_get_type (void) G_GNUC_CONST;
 
 #define TYPE_HKL_SAMPLE (hkl_sample_get_type ())
 HKLAPI GType hkl_sample_get_type (void) G_GNUC_CONST;
 
-#define TYPE_HKL_PSEUDO_AXIS (hkl_pseudo_axis_get_type ())
-HKLAPI GType hkl_pseudo_axis_get_type (void) G_GNUC_CONST;
-
-#define TYPE_HKL_ENGINE (hkl_engine_get_type ())
-HKLAPI GType hkl_engine_get_type (void) G_GNUC_CONST;
+#define TYPE_HKL_UNIT (hkl_unit_get_type ())
+HKLAPI GType hkl_unit_get_type (void) G_GNUC_CONST;
 
-#define TYPE_HKL_ENGINE_LIST (hkl_engine_list_get_type ())
-HKLAPI GType hkl_engine_list_get_type (void) G_GNUC_CONST;
+#define TYPE_HKL_VECTOR (hkl_vector_get_type ())
+HKLAPI GType hkl_vector_get_type (void) G_GNUC_CONST;
 
 G_END_DECLS
 
diff --git a/hkl/hkl-unit-private.h b/hkl/hkl-unit-private.h
index 96e5d80..8e8cc5e 100644
--- a/hkl/hkl-unit-private.h
+++ b/hkl/hkl-unit-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,9 +22,9 @@
 #ifndef __HKL_UNIT_PRIVATE_H__
 #define __HKL_UNIT_PRIVATE_H__
 
-#include "hkl.h"
+#include "hkl.h"                        // for G_BEGIN_DECLS, etc
 
-HKL_BEGIN_DECLS
+G_BEGIN_DECLS
 
 typedef struct _HklUnit HklUnit;
 
@@ -44,7 +44,7 @@ struct _HklUnit
 
 static HklUnit const hkl_unit_angle_deg = {HKL_UNIT_ANGLE_DEG, "Degree", "°"};
 static HklUnit const hkl_unit_angle_rad = {HKL_UNIT_ANGLE_RAD, "Radian", "rad"};
-static HklUnit const hkl_unit_length_nm = {HKL_UNIT_LENGTH_NM, "Nano Meter", "nm"};
+static HklUnit const hkl_unit_length_nm = {HKL_UNIT_LENGTH_NM, "NanoMeter", "nm"};
 
 extern HklUnit *hkl_unit_dup(const HklUnit *self);
 extern void hkl_unit_free(HklUnit *self);
@@ -53,6 +53,6 @@ extern int hkl_unit_compatible(const HklUnit *self, const HklUnit *unit);
 
 extern double hkl_unit_factor(const HklUnit *self, const HklUnit *unit);
 
-HKL_END_DECLS
+G_END_DECLS
 
 #endif /* __HKL_UNIT_PRIVATE_H__ */
diff --git a/hkl/hkl-unit.c b/hkl/hkl-unit.c
index ff0014a..36d65da 100644
--- a/hkl/hkl-unit.c
+++ b/hkl/hkl-unit.c
@@ -13,18 +13,18 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <math.h>
-#include <gsl/gsl_nan.h>
-#include <gsl/gsl_sys.h> /* gsl_nan()! */
-
-#include "hkl-macros-private.h"
-#include "hkl-unit-private.h"
+#include <gsl/gsl_nan.h>                // for GSL_NAN
+#include <gsl/gsl_sys.h>                // for gsl_isnan
+#include <stdlib.h>                     // for free, NULL
+#include "hkl-macros-private.h"         // for HKL_MALLOC
+#include "hkl-unit-private.h"           // for HklUnit, etc
+#include "hkl.h"                        // for FALSE, HKL_DEGTORAD, etc
 
 /**
  * hkl_unit_dup: (skip)
@@ -65,11 +65,11 @@ void hkl_unit_free(HklUnit *self)
  *
  * check if two units are compatible.
  *
- * Returns: HKL_TRUE or HKL_FALSE
+ * Returns: TRUE or FALSE
  **/
 int hkl_unit_compatible(const HklUnit *self, const HklUnit *unit)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	if (self && unit){
 		switch(self->type){
 		case HKL_UNIT_ANGLE_DEG:
@@ -78,7 +78,7 @@ int hkl_unit_compatible(const HklUnit *self, const HklUnit *unit)
 			case HKL_UNIT_ANGLE_RAD:
 				break;
 			default:
-				res = HKL_FALSE;
+				res = FALSE;
 				break;
 			}
 			break;
@@ -88,7 +88,7 @@ int hkl_unit_compatible(const HklUnit *self, const HklUnit *unit)
 			case HKL_UNIT_ANGLE_RAD:
 				break;
 			default:
-				res = HKL_FALSE;
+				res = FALSE;
 				break;
 			}
 			break;
@@ -97,7 +97,7 @@ int hkl_unit_compatible(const HklUnit *self, const HklUnit *unit)
 			case HKL_UNIT_LENGTH_NM:
 				break;
 			default:
-				res = HKL_FALSE;
+				res = FALSE;
 				break;
 			}
 		}
diff --git a/hkl/hkl-vector-private.h b/hkl/hkl-vector-private.h
index 17b5754..1edbbe1 100644
--- a/hkl/hkl-vector-private.h
+++ b/hkl/hkl-vector-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,29 +22,10 @@
 #ifndef __HKL_VECTOR_PRIVATE_H__
 #define __HKL_VECTOR_PRIVATE_H__
 
-#include <stdio.h>
-#include <math.h>
+#include <stdio.h>                      // for FILE
+#include "hkl.h"                        // for G_BEGIN_DECLS, etc
 
-#include "hkl.h"
-
-HKL_BEGIN_DECLS
-
-/* forward declaration begin */
-typedef struct _HklQuaternion HklQuaternion;
-/* forward declaration end */
-
-typedef struct _HklVector HklVector;
-
-/**
- * HklVector:
- * @data: (skip): contain the vector data
-
- *  A struct containing a 3D space coordinates.
- **/
-struct _HklVector
-{
-	double data[3];
-};
+G_BEGIN_DECLS
 
 HklVector* hkl_vector_dup(const HklVector* self);
 
@@ -126,6 +107,6 @@ extern void hkl_vector_project_on_plan_with_point(HklVector *self,
 						  const HklVector *normal,
 						  const HklVector *point);
 
-HKL_END_DECLS
+G_END_DECLS
 
 #endif
diff --git a/hkl/hkl-vector.c b/hkl/hkl-vector.c
index 4a55123..ec8260f 100644
--- a/hkl/hkl-vector.c
+++ b/hkl/hkl-vector.c
@@ -13,21 +13,21 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <stdlib.h>
-#include <string.h>
-
-#include <gsl/gsl_math.h>
-
-#include "hkl-vector-private.h"
-#include "hkl-macros-private.h"
-#include "hkl-matrix-private.h"
-#include "hkl-quaternion-private.h"
+#include <math.h>                       // for fabs, acos, cos, sin, sqrt, etc
+#include <stdio.h>                      // for fprintf, FILE
+#include <stdlib.h>                     // for rand, RAND_MAX, free
+#include <string.h>                     // for memcpy
+#include "hkl-macros-private.h"         // for HKL_MALLOC
+#include "hkl-matrix-private.h"         // for _HklMatrix
+#include "hkl-quaternion-private.h"     // for _HklQuaternion
+#include "hkl-vector-private.h"         // for HklVector, HklQuaternion
+#include "hkl.h"                        // for HklMatrix, HKL_EPSILON, etc
 
 /**
  * hkl_vector_dup: (skip)
@@ -91,7 +91,7 @@ void hkl_vector_fprintf(FILE *file, const HklVector *self)
  * compare two #HklVector. this comparison use HKL_EPSILON
  * to do the comparison.
  *
- * Returns: HKL_FALSE if both are equals, HKL_TRUE otherwise.
+ * Returns: FALSE if both are equals, TRUE otherwise.
  **/
 int hkl_vector_cmp(const HklVector *self, const HklVector *vector)
 {
@@ -99,8 +99,8 @@ int hkl_vector_cmp(const HklVector *self, const HklVector *vector)
 
 	for (i=0; i<3; i++)
 		if ( fabs(self->data[i] - vector->data[i]) > HKL_EPSILON )
-			return HKL_TRUE;
-	return HKL_FALSE;
+			return TRUE;
+	return FALSE;
 }
 
 /**
@@ -110,7 +110,7 @@ int hkl_vector_cmp(const HklVector *self, const HklVector *vector)
  *
  * Check if two vectors are oposite.
  *
- * Returns: HKL_TRUE is vector are oposite vectors.
+ * Returns: TRUE is vector are oposite vectors.
  **/
 int hkl_vector_is_opposite(const HklVector *self, const HklVector *vector)
 {
@@ -118,8 +118,8 @@ int hkl_vector_is_opposite(const HklVector *self, const HklVector *vector)
 
 	for (i=0; i<3; i++)
 		if ( fabs(self->data[i] + vector->data[i]) > HKL_EPSILON )
-			return HKL_FALSE;
-	return HKL_TRUE;
+			return FALSE;
+	return TRUE;
 }
 
 /**
@@ -365,17 +365,17 @@ double hkl_vector_oriented_angle_points(const HklVector *self,
  *
  * normalize a hkl_vector
  *
- * Returns: HKL_TRUE if the #HklVector can be normalized, HKL_FALSE otherwise
+ * Returns: TRUE if the #HklVector can be normalized, FALSE otherwise
  **/
 int hkl_vector_normalize(HklVector *self)
 {
 	double norm = hkl_vector_norm2(self);
 	if ( norm <= HKL_EPSILON )
-		return HKL_FALSE;
+		return FALSE;
 
 	hkl_vector_div_double(self, norm);
 
-	return HKL_TRUE;
+	return TRUE;
 }
 
 /**
@@ -385,7 +385,7 @@ int hkl_vector_normalize(HklVector *self)
  *
  * check if two #HklVector are colinears
  *
- * Returns: HKL_TRUE if both are colinear.
+ * Returns: TRUE if both are colinear.
  **/
 int hkl_vector_is_colinear(const HklVector *self, const HklVector *vector)
 {
@@ -572,8 +572,8 @@ int hkl_vector_is_null(const HklVector *self)
 	unsigned int i;
 	for (i=0; i<3; i++)
 		if ( fabs(self->data[i]) > HKL_EPSILON )
-			return HKL_FALSE;
-	return HKL_TRUE;
+			return FALSE;
+	return TRUE;
 }
 
 /**
diff --git a/hkl3d/Makefile.am b/hkl3d/Makefile.am
index 1c24a89..4f577bb 100644
--- a/hkl3d/Makefile.am
+++ b/hkl3d/Makefile.am
@@ -1,6 +1,4 @@
-
 # Process this file with automake to produce Makefile.in
-SUBDIRS = bullet
 
 AM_CXXFLAGS = \
 	-fpermissive \
@@ -9,29 +7,21 @@ AM_CXXFLAGS = \
 	-I$(top_srcdir)/hkl3d \
 	-I$(top_srcdir)/hkl3d/bullet/src\
 	-DPKGDATA=\""$(pkgdatadir)"\" \
-	$(G3D_CFLAGS)\
-	$(YAML_CFLAGS)
+	$(G3D_CFLAGS) \
+	$(YAML_CFLAGS) \
+	$(BULLET_CFLAGS)
 
 AM_LDFLAGS = -version-info 0:0:0 \
-	$(G3D_LIBS)\
-	$(YAML_LIBS)
-
-lib_LTLIBRARIES = \
-	libhkl3d.la
-
-include_HEADERS = hkl3d.h
+	$(G3D_LIBS) \
+	$(YAML_LIBS) \
+	$(BULLET_LIBS)
 
+lib_LTLIBRARIES = libhkl3d.la
 libhkl3d_la_SOURCES = hkl3d.cpp
-
 libhkl3d_la_LIBADD = \
-	$(top_builddir)/hkl/libhkl.la \
-	$(top_builddir)/hkl3d/bullet/src/libbulletmath.la \
-	$(top_builddir)/hkl3d/bullet/src/libbulletcollision.la
+	$(top_builddir)/hkl/libhkl.la
 
-if CONDITIONAL_BUILD_MULTITHREADED
-AM_CXXFLAGS += -DUSE_PARALLEL_DISPATCHER=1
-libhkl3d_la_LIBADD += $(top_builddir)/hkl3d/bullet/src/libbulletmultithreaded.la
-endif
+noinst_HEADERS = hkl3d.h
 
 # Support for GNU Flymake, in Emacs.
 check-syntax: AM_CXXFLAGS += -fsyntax-only -pipe
diff --git a/hkl3d/Makefile.in b/hkl3d/Makefile.in
index fb87ceb..4eede81 100644
--- a/hkl3d/Makefile.in
+++ b/hkl3d/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
@@ -14,6 +14,8 @@
 
 @SET_MAKE@
 
+# Process this file with automake to produce Makefile.in
+
 
 VPATH = @srcdir@
 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
@@ -79,11 +81,9 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@am__append_1 = -DUSE_PARALLEL_DISPATCHER=1
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@am__append_2 = $(top_builddir)/hkl3d/bullet/src/libbulletmultithreaded.la
 subdir = hkl3d
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/config/depcomp $(include_HEADERS)
+	$(top_srcdir)/config/depcomp $(noinst_HEADERS)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
 	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
@@ -122,12 +122,9 @@ am__uninstall_files_from_dir = { \
     || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
+am__installdirs = "$(DESTDIR)$(libdir)"
 LTLIBRARIES = $(lib_LTLIBRARIES)
-libhkl3d_la_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
-	$(top_builddir)/hkl3d/bullet/src/libbulletmath.la \
-	$(top_builddir)/hkl3d/bullet/src/libbulletcollision.la \
-	$(am__append_2)
+libhkl3d_la_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la
 am_libhkl3d_la_OBJECTS = hkl3d.lo
 libhkl3d_la_OBJECTS = $(am_libhkl3d_la_OBJECTS)
 AM_V_lt = $(am__v_lt_ at AM_V@)
@@ -170,28 +167,12 @@ am__v_CXXLD_0 = @echo "  CXXLD   " $@;
 am__v_CXXLD_1 = 
 SOURCES = $(libhkl3d_la_SOURCES)
 DIST_SOURCES = $(libhkl3d_la_SOURCES)
-RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
-	ctags-recursive dvi-recursive html-recursive info-recursive \
-	install-data-recursive install-dvi-recursive \
-	install-exec-recursive install-html-recursive \
-	install-info-recursive install-pdf-recursive \
-	install-ps-recursive install-recursive installcheck-recursive \
-	installdirs-recursive pdf-recursive ps-recursive \
-	tags-recursive uninstall-recursive
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
-HEADERS = $(include_HEADERS)
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-am__recursive_targets = \
-  $(RECURSIVE_TARGETS) \
-  $(RECURSIVE_CLEAN_TARGETS) \
-  $(am__extra_recursive_targets)
-AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
-	distdir
+HEADERS = $(noinst_HEADERS)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
@@ -211,33 +192,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
@@ -248,6 +203,8 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BULLET_CFLAGS = @BULLET_CFLAGS@
+BULLET_LIBS = @BULLET_LIBS@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
@@ -267,6 +224,7 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+EMACS = @EMACS@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
 G3D_CFLAGS = @G3D_CFLAGS@
@@ -286,14 +244,15 @@ GSL_CFLAGS = @GSL_CFLAGS@
 GSL_CONFIG = @GSL_CONFIG@
 GSL_LIBS = @GSL_LIBS@
 GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@
 GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
 GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
 GTKDOC_MKPDF = @GTKDOC_MKPDF@
 GTKDOC_REBASE = @GTKDOC_REBASE@
-GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
-GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
-GTKMM_CFLAGS = @GTKMM_CFLAGS@
-GTKMM_LIBS = @GTKMM_LIBS@
+GTKGLEXT_CFLAGS = @GTKGLEXT_CFLAGS@
+GTKGLEXT_LIBS = @GTKGLEXT_LIBS@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
 HTML_DIR = @HTML_DIR@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -389,7 +348,6 @@ localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
-opengl_LIBS = @opengl_LIBS@
 pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
@@ -404,27 +362,29 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 version_info = @version_info@
+AM_CXXFLAGS = \
+	-fpermissive \
+	-I$(top_srcdir) \
+	-I$(top_srcdir)/hkl \
+	-I$(top_srcdir)/hkl3d \
+	-I$(top_srcdir)/hkl3d/bullet/src\
+	-DPKGDATA=\""$(pkgdatadir)"\" \
+	$(G3D_CFLAGS) \
+	$(YAML_CFLAGS) \
+	$(BULLET_CFLAGS)
 
-# Process this file with automake to produce Makefile.in
-SUBDIRS = bullet
-AM_CXXFLAGS = -fpermissive -I$(top_srcdir) -I$(top_srcdir)/hkl \
-	-I$(top_srcdir)/hkl3d -I$(top_srcdir)/hkl3d/bullet/src \
-	-DPKGDATA=\""$(pkgdatadir)"\" $(G3D_CFLAGS) $(YAML_CFLAGS) \
-	$(am__append_1)
 AM_LDFLAGS = -version-info 0:0:0 \
-	$(G3D_LIBS)\
-	$(YAML_LIBS)
-
-lib_LTLIBRARIES = \
-	libhkl3d.la
+	$(G3D_LIBS) \
+	$(YAML_LIBS) \
+	$(BULLET_LIBS)
 
-include_HEADERS = hkl3d.h
+lib_LTLIBRARIES = libhkl3d.la
 libhkl3d_la_SOURCES = hkl3d.cpp
-libhkl3d_la_LIBADD = $(top_builddir)/hkl/libhkl.la \
-	$(top_builddir)/hkl3d/bullet/src/libbulletmath.la \
-	$(top_builddir)/hkl3d/bullet/src/libbulletcollision.la \
-	$(am__append_2)
-all: all-recursive
+libhkl3d_la_LIBADD = \
+	$(top_builddir)/hkl/libhkl.la
+
+noinst_HEADERS = hkl3d.h
+all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .cpp .lo .o .obj
@@ -506,22 +466,25 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl3d.Plo at am__quote@
 
 .cpp.o:
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+ at am__fastdepCXX_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Po
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ $<
 
 .cpp.obj:
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+ at am__fastdepCXX_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Po
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
 .cpp.lo:
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+ at am__fastdepCXX_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Plo
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
@@ -531,83 +494,15 @@ mostlyclean-libtool:
 
 clean-libtool:
 	-rm -rf .libs _libs
-install-includeHEADERS: $(include_HEADERS)
-	@$(NORMAL_INSTALL)
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
-	if test -n "$$list"; then \
-	  echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
-	  $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
-	fi; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(am__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
-	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
-	done
-
-uninstall-includeHEADERS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run 'make' without going through this Makefile.
-# To change the values of 'make' variables: instead of editing Makefiles,
-# (1) if the variable is set in 'config.status', edit 'config.status'
-#     (which will cause the Makefiles to be regenerated when you run 'make');
-# (2) otherwise, pass the desired values on the 'make' command line.
-$(am__recursive_targets):
-	@fail=; \
-	if $(am__make_keepgoing); then \
-	  failcom='fail=yes'; \
-	else \
-	  failcom='exit 1'; \
-	fi; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
 
 ID: $(am__tagged_files)
 	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-recursive
+tags: tags-am
 TAGS: tags
 
 tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	set x; \
 	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
 	$(am__define_uniq_tagged_files); \
 	shift; \
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
@@ -620,7 +515,7 @@ tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	      $$unique; \
 	  fi; \
 	fi
-ctags: ctags-recursive
+ctags: ctags-am
 
 CTAGS: ctags
 ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
@@ -633,7 +528,7 @@ GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-recursive
+cscopelist: cscopelist-am
 
 cscopelist-am: $(am__tagged_files)
 	list='$(am__tagged_files)'; \
@@ -682,48 +577,22 @@ distdir: $(DISTFILES)
 	    || exit 1; \
 	  fi; \
 	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    $(am__make_dryrun) \
-	      || test -d "$(distdir)/$$subdir" \
-	      || $(MKDIR_P) "$(distdir)/$$subdir" \
-	      || exit 1; \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
 check-am: all-am
-check: check-recursive
+check: check-am
 all-am: Makefile $(LTLIBRARIES) $(HEADERS)
-installdirs: installdirs-recursive
-installdirs-am:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
+installdirs:
+	for dir in "$(DESTDIR)$(libdir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
 
 install-am: all-am
 	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
 
-installcheck: installcheck-recursive
+installcheck: installcheck-am
 install-strip:
 	if test -z '$(STRIP)'; then \
 	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
@@ -745,94 +614,92 @@ distclean-generic:
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
 	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
+clean: clean-am
 
 clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
 	mostlyclean-am
 
-distclean: distclean-recursive
+distclean: distclean-am
 	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
 
-dvi: dvi-recursive
+dvi: dvi-am
 
 dvi-am:
 
-html: html-recursive
+html: html-am
 
 html-am:
 
-info: info-recursive
+info: info-am
 
 info-am:
 
-install-data-am: install-includeHEADERS
+install-data-am:
 
-install-dvi: install-dvi-recursive
+install-dvi: install-dvi-am
 
 install-dvi-am:
 
 install-exec-am: install-libLTLIBRARIES
 
-install-html: install-html-recursive
+install-html: install-html-am
 
 install-html-am:
 
-install-info: install-info-recursive
+install-info: install-info-am
 
 install-info-am:
 
 install-man:
 
-install-pdf: install-pdf-recursive
+install-pdf: install-pdf-am
 
 install-pdf-am:
 
-install-ps: install-ps-recursive
+install-ps: install-ps-am
 
 install-ps-am:
 
 installcheck-am:
 
-maintainer-clean: maintainer-clean-recursive
+maintainer-clean: maintainer-clean-am
 	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
-mostlyclean: mostlyclean-recursive
+mostlyclean: mostlyclean-am
 
 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
 	mostlyclean-libtool
 
-pdf: pdf-recursive
+pdf: pdf-am
 
 pdf-am:
 
-ps: ps-recursive
+ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
+uninstall-am: uninstall-libLTLIBRARIES
 
-.MAKE: $(am__recursive_targets) install-am install-strip
+.MAKE: install-am install-strip
 
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
-	check-am clean clean-generic clean-libLTLIBRARIES \
-	clean-libtool cscopelist-am ctags ctags-am distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-includeHEADERS install-info \
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+	clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
+	ctags-am distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
 	install-info-am install-libLTLIBRARIES install-man install-pdf \
 	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs installdirs-am \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
-	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
-	uninstall-includeHEADERS uninstall-libLTLIBRARIES
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES
 
 
 # Support for GNU Flymake, in Emacs.
diff --git a/hkl3d/bullet/AUTHORS b/hkl3d/bullet/AUTHORS
deleted file mode 100644
index f2cc86d..0000000
--- a/hkl3d/bullet/AUTHORS
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Bullet Physics Library is an open source project with help from the community at the Physics Forum
-See the forum at http://bulletphysics.com
-
-The project was started by Erwin Coumans
-
-Following people contributed to Bullet
-(random order, please let us know on the forum if your name should be in this list)
-
-Gino van den Bergen: LinearMath classes
-Christer Ericson: parts of the voronoi simplex solver
-Simon Hobbs: 3d axis sweep and prune, Extras/SATCollision, separating axis theorem + SIMD code
-Dirk Gregorius: generic D6 constraint
-Erin Catto: accumulated impulse in sequential impulse
-Nathanael Presson: EPA penetration depth calculation
-Francisco Leon: GIMPACT Concave Concave collision
-Joerg Henrichs: make buildsystem (work in progress)
-Eric Sunshine: jam + msvcgen buildsystem
-Steve Baker: GPU physics and general implementation improvements
-Jay Lee: Double precision support
-KleMiX, aka Vsevolod Klementjev, managed version, rewritten in C# for XNA
-Erwin Coumans: most other source code
diff --git a/hkl3d/bullet/COPYING b/hkl3d/bullet/COPYING
deleted file mode 100644
index 94a9ed0..0000000
--- a/hkl3d/bullet/COPYING
+++ /dev/null
@@ -1,674 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/hkl3d/bullet/ChangeLog b/hkl3d/bullet/ChangeLog
deleted file mode 100644
index 1c10933..0000000
--- a/hkl3d/bullet/ChangeLog
+++ /dev/null
@@ -1,755 +0,0 @@
-Bullet Continuous Collision Detection and Physics Library
-Primary author and maintainer: Erwin Coumans
-
-This ChangeLog is incomplete, for an up-to-date list of all fixed issues see http://bullet.googlecode.com
-using http://tinyurl.com/yabmjjj
-
-
-2010 February
-	- Bullet 2.76 release, revision 2010
-	- support for the .bullet binary file format
-	- btInternalEdgeUtility to adjust unwanted collisions against internal triangle edges
-	- Improved Maya Dynamica plugin with better constraint authoring and .bullet file export
-
-
-2009 September 17
-	- Minor update to Bullet 2.75 release, revision 1776
-	- Support for btConvex2dShape, check out Bullet/Demos/Box2dDemo
-	- Fixes in build systems
-	- Minor fix in btGjkPairDetector
-	- Initialize world transform for btCollisionShape in constructor
-
-
-2009 September 6
-	- Bullet 2.75 release
-	- Added SPH fluid simulation in Extras, not integrated with rigid body / soft body yet
-	Thanks to Rama Hoetzlein to make this contribution available under the ZLib license
-	- add special capsule-capsule collider code in btConvexConvexCollisionAlgorithm, to speed up capsule-ragdolls
-	- soft body improvement: faster building of bending constraints
-	- soft body improvement: allow to disable/enable cluster self-collision
-	- soft body fix: 'exploding' soft bodies when using cluster collision
-	- fix some degenerate cases in continuous convex cast, could impact ray cast/convex cast
-	Thanks to Jacob Langford for the report and reproduction cases, see http://code.google.com/p/bullet/issues/detail?id=250&can=1&start=200
-	- re-enabled split impulse
-	- added btHinge2Constraint, btUniversalConstraint, btGeneric6DofSpringConstraint
-	- demonstrate 2D physics with 2D/3D object interaction
-	
-
-2008 December 2
-	- Fix contact refresh issues with btCompoundShape, introduced with btDbvt acceleration structure in btCompoundCollisionAlgorithm
-	- Made btSequentialImpulseConstraintSolver 100% compatible with ODE quickstep
-	constraints can use 'solveConstraint' method or 'getInfo/getInfo2'
-
-2008 November 30
-	- Add highly optimized SIMD branchless PGS/SI solver innerloop 
-
-2008 November 12
-	- Add compound shape export to BulletColladaConverter
-	Thanks to JamesH for the report: http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=12&t=2840
-	- Fix compiler build for Visual Studio 6
-	Thanks to JoF for the report: http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2841
-
-2008 November 11
-	- Add CProfileManager::dumpAll() to dump performance statistics to console using printf.
-	- Add support for interaction between btSoftBody and btCollisionObject/btGhostObject
-
-2008 November 8
-	- Fix PosixThreadSupport
-	- Add improved btHeightfieldTerrainShape support and new Demos/TerrainDemo
-	Thanks to tomva, http://code.google.com/p/bullet/issues/detail?id=63&can=1
-	- Moved kinematic character controller from Demos/CharacterDemo into src/BulletDynamics/Character/btKinematicCharacterController.cpp
-
-2008 November 6
-	- reduced default memory pool allocation from 40Mb to 3Mb. This should be more suitable for all platforms, including iPhone
-	- improved CUDA broadphase
-	- IBM Cell SDK 3.x support, fix ibmsdk Makefiles
-	- improved CMake support with 'install' and 'framework option
-	
-2008 November 4
-	- add btAxisSweep::resetPool to avoid non-determinism due to shuffled linked list
-	Thanks to Ole for the contribution, 
-
-2008 October 30
-	- disabled btTriangleMesh duplicate search by default, it is extremely slow
-	- added Extras/IFF binary chunk serialization library as preparation for in-game native platform serialization (planned COLLADA DOM -> IFF converter)
-
-2008 October 20
-	- added SCE Physics Effects box-box collision detection for SPU/BulletMultiThreaded version
-	See Bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp
-	Thanks to Sony Computer Entertainment Japan, SCEI for the contribution
-
-2008 October 17
-	- Added btGhostObject support, this helps character controller, explosions, triggers and other local spatial queries
-
-2008 October 10
-	- Moved aabb to btBroadphaseProxy, improves rayTest dramatically. Further raytest improvements using the broadphase acceleration structures are planned
-	- Moved BulletMultiThreaded from Extras to /src/BulletMultiThreaded for better integration
-
-
-2008 October 3
-	- Add support for autoconf automake
-	./autogen.sh and ./configure will create both Makefile and Jamfile. CMake and autogenerated Visual Studio projectfiles remain supported too.
-	- Improved ColladaConverter: plane shape export, and callback for shape construction to allow deletion of memory
-	
-2008 Sept 30
-	- Improved Soft Body support, fixed issues related to soft body colliding against concave triangle meshes
-	- Shared more code between regular version and SPU/BulletMultiThreaded, in particular GJK/EPA
-
-2008 Sept 28
-	- Fixed rotation issues in Dynamic Maya Plugin
-
-2008 Sept 11
-	- Enable CCD motion clamping for btDiscreteDynamicsWorld, to avoid tunneling. A more advanced solution will be implemented in btContinuousDynamicsWorld.
-
-2008 Sept 7
-	- Add btScaledBvhTriangleMeshShape, to allow re-use of btBvhTriangleMeshShape of different sizes, without copying of the BVH data.
-
-2008 Sept 5
-	- Enabled Demos/ForkLiftDemo
-	Thanks Roman Ponomarev.
-
-2008 Sept 4
-	- Added btCudaBroadphase in Extras/CUDA: some research into accelerating Bullet using CUDA.
-	Thanks to the particle demo from the NVidia CUDA SDK.
-	
-2008 Sept 3
-	- Several bug fixes and contributions related to inertia tensor, memory leaks etc.
-	Thanks to Ole K.
-
-2008 Sept 1
-	- Updated CDTestFramework, with latest version of OPCODE Array SAP. See Extras/CDTestFramework
-	Thanks to Pierre Terdiman for the update
-
-2008 August 25
-	- Walt Disney Studios contributes their in-house Maya Plugin for simulating Bullet physics, with options for other engines such as PhysBam or PhysX.
-	Thanks to Nicola Candussi and Arthur Shek
-	
-2008 August 14
-	- Improved performance for btDbvtBroadphase, based on dual dynamic AABB trees (one for static, one for dynamic objects, where objects can move from one to the other tree)
-	Thanks to Nathanael Presson again, for all his work.
-	
-2008 July 31
-	- Added Havok .hkx to COLLADA Physics .dae converter patch+information
-	- Fix btSubsimplexConvexCast
-	Thanks to Nacho, http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2422)
-	- Fix in rendering, GL_STENCIL
-	- btTriangleIndexVertexArray indices should be unsigned int/unsigned short int,
-	- Made InternalProcessAllTriangles virtual, thanks to
-	Both thank to Fullmetalcoder, http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2401
-	- clamp impulse for btPoint2PointConstraint
-	Thanks to Martijn Reuvers, http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2418
-	- Free memory of bvh, pass in scaling factor (optional)
-	Thanks to Roy Eltham, http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2375
-
-2008 July 27
-
-btDbvtBroadphase:
-	- Fixed a performance issues reported by 'reltham'
-	- Added btDbvtBroadphase::optimize() for people who want good performances right
-away or don't do dynamics.
-	- fixed compilation issues when DBVT_BP_PROFILE was set.
-btSoftBody:
-	- Fixed singular matrix issues related to polar decomposition (flat meshes).
-DemoApplication:
-	- Shadows (enable/disable through 'g' or DemoApplication::setShadows(bool)).
-	- Texture can be enable/disable through 'u'
-CDFramework:
-	- fixed compilation issues.
-	All thanks to Nathanael Presson
-
-2008 July 10
-	- Added btMultimaterialTriangleMeshShape and MultiMaterialDemo
-	Thanks to Alex Silverman for the contribution
-
-2008 June 30
-	- Added initial support for kinematic character controller
-	Thanks to John McCutchan
-
-2008 April 14
-	- Added ray cast support for Soft Bodies
-	Thanks to Nathanael Presson for the contribution
-	
-2008 April 9
-	- Cleanup of Stan Melax ConvexHull, removed Extras/ConvexHull, moved sources into LinearMath/BulletCollision
-
-2008 April 4
-	- Added btSliderConstraint and demo
-	Thanks Roman Ponomarev
-	
-2008 April 3
-	- Fixed btMinkowskiSumShape, and added hitpoint to btSubsimplexConvexCast
-
-2008 April 2
-	- Added Extras/CdTestFrameWork
-	Thanks Pierre Terdiman
-
-2008 April 1
-	- Added posix thread (pthread) support
-	Thanks Enrico
-
-2008 March 30
-	- Added Soft Body, cloth, rope and deformable volumes, including demos and interaction
-	Thanks Nathanael Presson for this great contribution
-	
-	2008 March 17
-	- Improved BulletColladaConverter
-	Thanks John McCutchan
-
-2008 March 15
-	- btMultiSapBroadphase in a working state. Needs more optimizations to be fully useable.
-	- Allow btOptimizedBvh to be used for arbitrary objects, not just triangles
-	- added quicksort to btAlignedObjectArray
-	- removed btTypedUserInfo, added btHashMap
-
-2008 March 30
-	- Moved quickstep solver and boxbox into Bullet/src folder
-	Thanks Russell L. Smith for permission to redistribute Open Dynamics Engine quickstep and box-box under the ZLib license	
-
-2008 Feb 27
-	- Added initial version for Character Control Demo
-	- Applied fixes to IBM Cell SDK 3.0 build makefiles
-	Thanks Jochen and mojo for reporting/providing patch: http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1922
-
-2008 Feb 8
-	- Bugfixes in ConvexCast support against the world.
-	Thanks to Isgmasa for reporting/providing fix: http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1823
-
-2008 Feb 6
-	- Added btCapsuleShapeX and btCapsuleShapeZ for capsules around X and Z axis (default capsule is around Y)
-	
-2008 Feb 3
-	- Added btTypedUserInfo, useful for serialization
-
-2008 Jan 31
-	- Add support for 16 and 32-bit indices for SPU / BulletMultiThreaded version.
-
-2008 Jan 29
-	- Added COLLADA Physics export/serialization/snapshot from any Bullet btDynamicsWorld. Saving the physics world into a text .xml file is useful for debugging etc.
-
-2008 Jan 23
-	- Added Stan Melax Convex Hull utility library in Extras/ConvexHull. This is useful to render non-polyhedral convex objects, and to simplify convex polyhedra.
-	
-2008 Jan 14
-	- Add support for batch raycasting on SPU / BulletMultiThreaded
-	
-2007 Dec 16
-	- Added btRigidBodyConstructionInfo, to make it easier to set individual setting (and leave other untouched) during rigid body construction.
-	Thanks Vangelis Kokkevis for pointing this out.
-	- Fixed memoryleak in the ConstraintDemo and Raytracer demo.
-	- Fixed issue with clearing forces/gravity at the end of the stepSimulation, instead of during internalSingleStepSimulation.
-	Thanks chunky for pointing this out: http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1780
-	- Disabled additional damping in rigid body by default, but enable it in most demos. Set btRigidBodyConstructionInfo m_additionalDamping to true to enable this.
-	- Removed obsolete QUICKPROF BEGIN/END_PROFILE, and enabled BT_PROFILE. Profiling is enabled by default (see Bullet/Demos/OpenGL/DemoApplication.cpp how to use this).
-	User can switch off profiling by enabling define BT_NO_PROFILE in Bullet/src/btQuickprof.h.
-
-2007 Dec 14
-	- Added Hello World and BulletMultiThreaded demos
-	- Add portable version of BulletMultiThreaded, through SequentialThreadSupport (non-parallel but sharing the same code-path)
-	- Add Cmake support for AllBulletDemos
-	
-
-2007 Dec 11
-	- Moved the 'btRigidBody::clearForce' to the end of the stepSimulation, instead of in each substep.
-	See discussion http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1601
-	- Added btConvexPlaneCollisionAlgorithm, makes planes perform better, and prevents tunneling
-	Thanks Andy O'Neil for reporting the performance/functionality issue
-	- Fixes for IBM Cell SDK 3.0
-	Thanks to Jochen Roth for the patch.
-
-2007 Dec 10
-	- Fixes in btHeightfieldTerrainShape
-	Thanks to Jay Lee for the patch.
-
-2007	Dec 9
-	- Only update aabb of active objects
-	Thanks Peter Tchernev for reporting (http://bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1764 )
-	- Added workaround to compile libxml under Visual Studio 2008 Beta 2
-	- Make glui compile under MSVC 9.0 beta (vsnprintf is already defined)
-
-2007 Dec 6
-	- Added DynamicControlDemo, showing dynamic control through constraint motors
-		Thanks to Eddy Boxerman
-	- Add support for generic concave shapes for convex cast.
-	- Added convex cast query to collision world.
-	- Added workaround for OpenGL bug in Mac OS X 10.5.0 (Leopard)
-	- Added concave raycast demo
-		All above thanks to John McCutchan (JMC)
-	- Fixed issues that prevent Linux version to compile. 
-	Thanks to Enrico for reporting and patch, see
-	- Fixed misleading name 'numTriangleIndices' into 'numTriangles'
-	Thanks Sean Tasker for reporting:
-
-2007 Nov 28:
-	- Added raycast against trianglemesh. Will be extended to object cast soon.
-	Thanks John McCutchan (JMC)
-	- make getNumPoints const correct, add const getPoints(). 
-	Thanks Dirk Gregorius
-	- Bugfix: allow btCollisionObjects (non-btRigidBody) to interact properly with btRigidBody for cache-friendly btSequentialImpulseConstraintSolver.
-	Thanks Andy O'Neil for pointing this out.
-	- Bugfix: don't fail if spheres have identical center, use arbitrary separating normal (1,0,0)
-	Thanks Sean Tasker for reporting! http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1681
-
-
-2007, November 20
-	- Added hierarchical profiling
-	- Fixed memory leak in btMultiSapBroadphase,
-	- Fixed hash function (typo, should use 2 proxies)
-	Thanks to Stephen (shatcher) for reporting and fixes! http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1696
-
-2007 Nov 11
-	- Fixed parallel solver (BulletMultiThreaded) friction issue
-	- Terminate Win32 Threads when closing the CcdPhysicsDemo (when USE_PARALLEL_SOLVER/USE_PARALLEL_DISPATCHER is defined)
-
-2007 Nov 6
-	- Added support for 16-bit indices for triangle meshes
-	- Added support for multiple mesh parts using btBvhTriangleMeshShape.
-	Thanks to Tim Johansson
-	
-2007 Oct 22
-	- All memory allocations go through btAlignedAlloc/btAlignedFree. User can override this to verify memory leaks
-	- added a few more demos to AllBulletDemos
-	- fix for one of the constructors of btHingeConstraint
-	Thanks Marcus Hennix
-	
-2007 Oct 20
-	- included glui, a GLUT/OpenGL based toolkit for some graphical user elements
-	Removed dynamic_cast from glui, to allow linkage without rtti
-	- added Box2D framework using glui, allowing all demos to run within one executable
-	Thanks Erin Catto for the FrameWork skeleton (http://www.box2d.org)
-
-2007 Ocy 17
-	- Allow user to pass in their own memory (stack and pool) allocators, through collisionConfiguration. See demos how to use this
-
-2007 Oct 14
-	- Included working version of Cell SPU parallel optimized version for Libspe2 SPU task scheduler.
-	This version compiles and runs on Playstation 3 Linux and IBM CellBlade, see BulletSpuOptimized.pdf for build instructions
-	(Official Playstation 3 developers can request a SPURS version through Sony PS3 Devnet.)
-	Thanks to IBM 'Extreme Blue' project for the contribution
-	http://www-913.ibm.com/employment/us/extremeblue/ 
-	Thanks Minh Cuong Tran, Benjamin Hoeferlin, Frederick Roth and Martina Huellmann
-	for various contributions to get this initial Libspe2 parallel version up and running.
-
-2007 Oct 13
-	- made 'btCollisionShape::calculateLocalInertia' const
-	Thanks to cgripeos, see http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1514
-	- applied a large patch to remove warnings
-	Thanks to Enrico, see http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1568
-	- removed SSE includes, added #incude <string.h> for memset in Extras/quickstep, thanks Eternl Knight
-
-2007 Oct 11
-	- added Hashed Overlapping Pair Cache, recommended by Pierre Terdiman. It works like a charm, thanks Pierre and Erin Catto (code from Box2D)
-	- modified some margins inside btBoxShape, btCylinderShape and btSphereShape
-	- added cone debug rendering (for cones with x, y and z up-axis)
-	- added improvements for optional Extra/quickstep, thanks to Remotion
-	- some performance improvements for Bullet constraint solver
-
-2007 Sept 28
-	- upgraded GIMPACT to version 0.3
-	Thanks to Francisco Leon
-
-2007 Sept 27
-	- added contribution from IBM Extreme Blue project for Libspe2 support. This allow to execute BulletMultiThreaded on Cell SPU under PS3 Linux and Cell Blade. See http://www-913.ibm.com/employment/us/extremeblue
-	Thanks to Minh Cuong Tran, Frederick Roth, Martina Heullmann and Benjamin Hoeferlin.
-
-2007 Sept 13
-	- Improved btGenericD6Constraint. It can be used to create ragdolls (similar to the new btConeTwistConstraint). See GenericJointDemo
-	- Added support for Bullet constraints in the optional Extras/quickstep ODE solver. See CcdPhysicsDemo, enable #COMPARE_WITH_QUICKSTEP and add libquickstep to the dependencies.
-	For both patches/improvements thanks Francisco Leon/projectileman
-		
-2007 Sept 10
-	- removed union from btQuadWordStorage, it caused issues under certain version of gcc/Linux
-
-2007 Sept 10
-	- Reverted constraint solver, due to some issues. Need to review the recent memory allocation changes.
-	- Fixed issue with kinematic objects rotating at low speed: quaternion was de-normalized, passing value > 1 into acosf returns #IND00 invalid values
-	- 16 byte memory alignment for BVH serialization
-	- memory cleanup for btPoolAllocator
-
-2007 Sept 9
-	- Added serialization for BVH/btBvhTriangleMeshShape, including endian swapping. See ConcaveDemo for an example.
-	Thanks to Phil Knight for the contribution.
-	- Fixed issues related to stack allocator/compound collision algorithm
-	Thanks Proctoid, http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=18&t=1460
-	- Increase some default memory pool settings, and added a fallback for the constraints solver to use heap memory
-	- Removed accidential testing code in btScalar.h related to operator new.	
-	- Enable btAxis3Sweep and bt32BitAxis3Sweep to be linked in at the same time, using template
-	
-2007 Sept 7
-	- Replaced several dynamic memory allocations by stack allocation and pool allocations
-	- Added branch-free quantized aabb bounding box overlap check, works better on Playstation 3 and XBox 360
-	Thanks to Phil Knight. Also see www.cellperformance.com for related articles
-	- Collision algorithms and settings for the memory/stack allocator can be done using btDefaultCollisionConfiguration
-	This is an API change. See demos how to modify existing implementations with a one-liner.
-	- Register several collision algorithms by default (sphere-sphere, sphere-box, sphere-triangle)
-	- Use other traveral method for BVH by default, this improves triangle mesh collision performance.
-	
-2007 Aug 31
-	- fixed MSVC 6 build
-	Thanks Proctoid, http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1375
-	- fixed double precision build issues
-	Thanks Alex Silverman, http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1434
-
-2007 Aug 24
-	- fixed bug in btMatrix3x3::transposeTimes(const btMatrix3x3& m) const. Luckily it wasn't used in core parts of the library (yet).
-	Thanks to Jay Lee
-	
-2007 Aug 15
-	- fixed bug in Extras/GIMPACT 0.2 related to moving triangle meshes
-	Thanks Thomas, http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1368
-
-2007 Aug 14
-	- added parallel constraint solver. Works on Playstation 3 Cell SPU and multi core (Win Threads on PC and XBox 360).
-	  See Extras/BulletMultiThreaded for SpuSolverTask subfolder and SpuParallelSolver.cpp
-	  Thanks Marten Svanfeldt (Starbreeze Studios)	
-	- fixed some bugs related to parallel collision detection (Extras/BulletMultiThreaded)
-	  Thanks Marten Svanfeldt (Starbreeze Studios)	
-	
-2007 Aug 2
-	- added compound and concave-convex (swapped) case for BulletMultiThreaded collision detection, thanks to Marten Svanfeldt
-	- refactored broadphase and overlapping pair cache. This allows performance improvement by combining multiple broadphases. This helps add/remove of large batches of objects and large worlds. See also Pierre Terdiman forum topic:
-	http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1329
-
-
-2007 July 27
-	- added Ragdoll Demo
-		Thanks to Marten Svanfeldt (Starbreeze Studios)
-
-	- added Vector Math library for SIMD 3D graphics linear algebra (vector, matrix, quaternion)
-		See Bullet/Extras/vectormathlibrary
-		Supports SIMD SSE, PowerPC PPU and Cell SPU (including PS3 Linux and CellBlade), as well as generic portable scalar version
-		Will be used to improve BulletMultiThreaded performance
-		Open Sourced by Sony Computer Entertainment Inc. under the new BSD license
-	- added SIMD math library
-		4-way SIMD for common math functions like atan2f4, cosf4, floorf4, fabsf4, rsqrtf4 etc. Used by Vector Math library under PPU and SPU.
-		Supports PowerPC (PPU) and Cell SPU, including PS3 Linux and CellBlade.
-		See Bullet/Extras/simdmathlibrary
-		Open sourced by Sony Computer Entertainment Inc. under the new BSD license
-
-	
-2007 July 25
-	- added several patches: per-rigidbody sleeping threshold. added Assert to prevent deletion of rigidbody while constraints are still pointing at it
-		Thanks to Marten Svanfeldt (Starbreeze Studios)
-	
-2007 July 13
-	- fixed relative #include paths again. We can't use "../" relative paths: some compilers choke on it (it causes extreme long paths)
-		Within the libraries, we always need to start with "BulletCollision/" or "BulletDynamics/ or "LinearMath/"
-
-2007 July 10
-	- Updated Bullet User Manual
-
-2007 July 5
-	- added btConeTwistConstraint, especially useful for ragdolls. See Demos/RagdollDemo
-		Thanks to Marten Svanfeldt (Starbreeze Studios)
-
-2007 June 29
-	- btHeightfieldTerrainShape: Added heightfield support, with customizations
-	- Upgraded to GIMPACT 0.2, see Extras/GIMPACT and MovingConcaveDemo
-	- Several patches from Marten Svanfeldt (Starbreeze Studios)
-		Improved collision filtering (in broadphase and rigidbody)
-		Improved debug rendering
-		Allow to set collision filter group/mask in addRigidBody
-		
-		
-2007 June 15
-	- Changed btAlignedObjectArray to call copy constructor/replacement new for duplication, rather then assignment operator (operator=).
-
-2007 June 11
-	- Added multi-threading. Originally for Playstation 3 Cell SPU, but the same code can run using Win32 Threads using fake DMA transfers (memcpy)
-		Libspe2 support for Cell Blade / PS3 Linux is upcoming
-		See Extras/BulletMultiThreaded. Usage: replace btCollisionDispatcher by btSpuGatheringCollisionDispatcher
-
-	- Added managed Bullet library, entirely rewritten in C# for Windows and XBox 360 XNA
-		See Extras/BulletX
-		Thanks to KleMiX, aka Vsevolod Klementjev
-
-2007 May 31
-	- sign-bit went wrong in case of 32-bit broadphase, causing quantization problems. 
-		Thanks DevO for reporting.
-
-2007 May 23
-	- Fixed quantization problem for planar triangle meshes in btOptimizedBvh
-		Thanks Phil Knight for reporting and helping to fix this bug.
-		
-2007 May 20
-	- btAxisSweep3: Fixed a bug in btAxisSweep3 (sweep and prune) related to object removal. Only showed up when at least one btStaticPlaneShape was inserted.
-		Thanks tbp for more details on reproducing case.
-	- btAxisSweep3: Fixed issue with full 32bit precision btAxisSweep3 (define BP_USE_FIXEDPOINT_INT_32), it used only 0xffff/65536 for quantization instead of full integer space (0xffffffff)
-	- btRaycastVehicle: Added 'getForwardVector' and getCurrentSpeedKmHour utility functions
-	- Fixed local scaling issues (btConvexTriangleMeshShape, btBvhTriangleMeshShape, removed scaling from btMatrix3x3). 
-		Thanks Volker for reporting!
-	- Added second filename search, so that starting BspDemo and ConvexDecompositionDemo from within Visual Studio (without setting the starting path) still works
-
-2007 April 22
-	- Added braking functionality to btRaycastVehicle
-	- Removed tons of warnings, under MSVC 2005 compilation in -W4
-	
-2007 March 21
-	- Fixed issues: comma at end of enum causes errors for some compilers
-	- Fixed initialization bug in LocalRayResult (	m_localShapeInfo(localShapeInfo) )
-	
-2007 March 20
-	- Added refit tree to quantized stackless tree, and updated ConcaveDemo as example.
-	
-2007 March 17
-	- Added constraint solver optimizations, avoiding cross products during iterations, and gather rigidbody/constraint info in contiguous memory (btSolverBody/btSolverConstraint)
-	- These optimizations don't give large benefit yet, but it has good potential. Turned on by default. Can be switched off using solver->setSolverMode(SOLVER_RANDMIZE_ORDER).
-	- Enabled anti-jitter for rigid bodies. This is experimental, and can be switched off by setting a global (it is experimental so no proper interface) gJitterVelocityDampingFactor = 1.0;
-	- Fixed bug in islandmanifold.heapSort(btPersistentManifoldSortPredicate()); , thanks Noehrgel for reporting this (affected Sun Solaris)
-	
-2007 March 12
-	- Added compile-time toggle between on 16-bit and 32-bit fixed-point SAP broadphase. 
-		This allows the number of bodies to exceed 32767
-	- Enable useQuantizedAabbCompression on btTriangleMesh, see ColladaDemo
-	
-2007 March 8
-	- Fixed bug in constraint/island sorting (caused by replacing STL by dedicated btAlignedObjectArray with heapSort)
-		Thanks Clemens Unterkofler for pointing this out!
-
-2007 March 6
-	- removed STL from the Bullet library: replace std::vector by btAlignedObjectArray. Also removed the std::set for overlapping pair set, and turned it into an overlapping pair array. The SAP only adds objects, never removed. Removal is postponed for during traversal of overlapping pairs (duplicates and non-overlapping pairs are removed during that traversal).
-	- added heap sort and binary search/linear search to btAlignedObjectArray
-	- fixed wrong cast, thanks Hamstray, http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1015
-
-
-2007 Feb 25
-	- Improved performance of convex collision shapes, cache local AABB instead of recomputation. This fixes issue with very slow performance in larger .bsp levels
-	
-2007 Feb 24
-	- Added compressed/quantized AABB tree, 16 bytes per node, while supporting 32-bit (triangle) indices. 
-	  Should be faster and smaller then original version (quantized aabb check is done in integer space)
-		Original aabb tree nodes are still supported. They are 44 bytes, with full floating point precision and additional subPart index.
-	- added meter-unit scaling support in ColladaConverter.cpp
-
-2007 Feb 21
-	- Build system: updated bullet.pc.in library names
-	- Updated EPA comparison integration (missing parameter)
-	
-2007 Jan 04
-	- fixed optimized AABB tree building: in some cases the tree building fails due to unbalanced trees, which generated stack overflow
-	
-2006 Dec 15
-	- added contribution to allow double precision collision detection/dynamics. Define BT_USE_DOUBLE_PRECISION in your project and libraries that include Bullet
-
-2006 Dec 14
-	- merged contact and non-contact constraint solving into one loop, will improve stability of jointed bodies during collisions
-	- added first draft for hingeConstraint motor
-	
-2006 Dec 8, Erwin Coumans
-	- preparation for SIMD: added btAlignedAllocator and btAlignedObjectArray, to replace stl std::vector, same interface, but compatible with 16 byte alignment
-	- cleaned up dependencies in autogenerated msvc projectfiles
-	- aligned btVector3 on 16 bytes boundary, under win32. see if developers will come up with problems
-
-2006 Dec 04, Erwin Coumans
-	Added btNearCallback. This is similar to Open Dynamics Engine (ODE) dNearCallback, but important differences:
-	- contact points are persistent (lifetime more then one frame, for warmstarting/incremental contact point management)
-	- continuous collision detection, time of impact
-	Added btRigidBody::isInWorld(), returns true if btRigidBody is inside a btCollisionWorld/btDynamicsWorld derived class
-	Added angularFactor to btRigidbody, this helps some character control (no angular impulse applied)
-
-
-2006 Nov 28
-	Moved StackAlloc from EPA into LinearMath/btStackAlloc
-	renamed internal class ConcaveShape into btConcaveShape
-	added btHeightfieldTerrainShape (not completed yet)
-		
-2006 Nov 15 Nathanael Presson
-	Added EPA penetration depth algorithm, Expanding Polytope Algorithm
-	Added Pierre Terdiman penetration depth comparison/test DEMO
-	Fixed Bullet's Minkowski sampling penetration depth solver
-	Contributed by Nathanael Presson
-	
-2006 Nov 11 Francisco Le�n N�jera
-	Added GIMPACT trimesh collision detection: concave versus concave,
-	Contributed by Francisco Le�n N�jera
-
-2006 Nov 2
-	Minor refactoring: btCollisionObject changes from struct into class, added accessor methods
-	Force use of btMotionState to synchronize graphics transform, disabled old btRigidBody constructor that accepts btTransform
-	Renamed treshold into threshold throughout the code
-	
-2006 Oct 30
-	Enable decoupling of physics and graphics framerate using interpolation and internal fixed timestep, based on btMotionState
-	Enabled raycast vehicle demo (still needs tuning)
-	Refresh contact points, even when they are already persistent.
-	Fixed debugDraw colors (thanks pc0de for reporting)
-	Use Dispatcher in ConcaveConvexCollisionAlgorithm (so it uses the registered collision algorithm, not hardcoded convexconcave)
-	Improved performance of constraint solver by precalculating the cross product/impulse arm
-	Added collision comparison code: ODE box-box, also sphere-triangle
-	Added safety check into GJK, and an assert for AABB's that are very large
-	Fixed kinematic support (deriving velocities for animated objects)
-	Updated comparison/optional quickstep solver in Extras
-	UserCollisionAlgorithm demonstrates btTriangleMesh usage (easier trimesh compared to index array version)
-	Removed scaling from btTransform (we only want to deal with rigid transforms)
-	
-2006 Oct 4
-	Fixed minor leak in btOptimizeBVH
-	Cleanup of btRigidBody construction
-	added getW() in btQuaternion
-	assert when setLinearVelocity is called on btRigidBody
-	renamed projectfile library from collada-dom to colladadom (to make VC6 happy)
-	
-2006 Sept 27
-	Big Refactoring: renamed and moved files, create a replacement for CcdPhysicsEnvironment/CcdPhysicsController.
-	All Bullet classes in LinearMath, BulletCollision and BulletDynamics start with bt, and methods start with lowercase.
-	Moved classes into src folder, which is the only include folder needed.
-	Added 2 headerfiles in src: btBulletCollisionCommon.h and btBulletDynamicsCommon.h
-
-2006 Sept 23
-	Fixed 2 bugs, causing crashes when removing objects. Should do better unit-testing. UnionFind and 3D SAP were involved.
-	
-2006 Sept 19
-	Allow programmable friction and contact solver model. User can register their own functions for several interaction types.
-	Improved performance, and removed hardcoded maximum overlaps (switched from C-array to stl::set)
-	
-2006 Sept 16
-	Added Bullet 2.0  User Manual
-	Allow registration of custom user collision algorithms
-
-2006 Sept 10
-	Started cleaning up demos
-	
-2006 Sept 4
-	Fixed concave collision bug (caused instability/missing collisions in meshes/compounds)
-	Fixed memoryleak in OptimizedBvh, added RayTestSingle to CollisionWorld
-	Prepared for VehicleDemo
-	Increased Performance (island generation for sleeping objects took too much time)
-	Better COLLADA 1.4.1 physics conformance in ColladaDemo
-
-2006 August 11
-	Added Quake BspDemo
-	Improved CCD for compound and non-convex objects
-
-2006 August 10
-	Added per-triangle material (friction/restitution) support for non-convex meshes. See ConcaveDemo for usage.
-
-2006 August 9
-	Added CMake support (see http://cmake.org)
-	This can autogenerate makefiles, projectfiles cross platform (including MacOS X Xcode )
-	Just run cmake . in the root folder and it will autogenerate build files
-	
-2006 July 26 Erwin Coumans
-	Upgraded to COLLADA-DOM 1.4.1, latest SVN version
-	ColladaDemo can export snapshots to .dae
-	
-2006 July 24 Erwin Coumans
-	Added Compound CollisionShape support
-	(this is still low performance -> requires stackless tree-versus-tree traversal for better performance)
-
-2006 July 15 Erwin Coumans
-	Added initial support for Parallel execution (collision detection, constraint solving)
-	See ParallelPhysicsEnvironment in Extras\PhysicsInterface\CcdPhysics
-	
-2006 July 10 Erwin Coumans
-	Added MacOS X support (some build issues mainly)
-		
-2006 July 5 Erwin Coumans
-	Improved COLLADA 1.4 physics import, both COLLADA-DOM and FCollada
-
-2006 June 29 Erwin Coumans
-	Refactoring of the broadphase
-	Moved some optional files to Extras: Algebraic ccd and EPA, quickstep
-	Moved the limits on bodies/overlap to 32k and 65k
-	
-2006 June 25 Erwin Coumans
-	Added basic Collision Filtering, during broadphase
-	Allow adding meshes to the TriangleIndexVertexArray,
-	(input for TriangleMeshShape) 
-	Preparation for CompoundShape
-
-2006 June 19 Erwin Coumans
-	Added support for COLLADA Physics Import.
-	Both jam and Visual Studio can compile ColladaDemo
-
-2006 June 18 Dirk Gregorius <dirk at dirkgregorius.de>
-	Started implementing Generic6DOF joint and setup basic interface
-
-
-2006 June 17 Frank Richter <resqu at gmx.ch>
-	Bumped version in configure.ac to 1.5.6 (assuming that "1.5f" is
-	  the next version released).
-	Updated files in mk/autoconf and mk/jam with copies from CS; fixes a 
-	  GLU detection issue on MinGW.
-	Set msvc/bullet_ico.ico as the default application icon.
-	Disabled exceptions for gcc builds.
-	Applied a patch from Michael D. Adams to fix a warning with gcc.
-2006 jUNE 16 Erwin Coumans
-	Constraints now merge simulation islands.
-
-2006 May 24
-	Improved GJK accuracy, fixed GjkConvexCast issue, thanks to ~MyXa~ for reporting
-	
-2006 May 19
-	Added restitution support
-	Moved out Friction and Dynamics info from ManifoldPoint (removed logical dependency)
-	Added a void* m_userPersistentData in ManifoldPoint.
-	Added a ContactDestroyedCallback, to allow user to handle destruction of m_userPersistentData
-
-2006 May 13
-	Fixed some bugs in friction / jacobian calculations. Reported by Dirk Gregorius. Thanks!
-
-2006 May 9
-	Fixed raycasting filtering
-	Moved repository to SVN at https://svn.sourceforge.net/svnroot/bullet
-		
-2006 April 27
-	Moved raycasting to CollisionWorld, to make it more generic
-	Added basic CCD option in the CcdCollisionDemo
-	Fixed 'noResponse' mode, for triggering rigidbodies (useful for Artificial Intelligence queries)
-	Improved Bullet/ODE sample (in Extras)
-		
-2006 April 10
-	Separating Axis Test (SAT) convex hull collision detector, contribution by Simon Hobbs
-	Added SIMD SSE Math classes (for above SAT)
-	Added Mouse picking in CcdPhysicsDemo
-	Improved penetration depth estimation in MinkowskiPenetrationDepthSolver, both accuracy and performance
-	Added Hinge constraint
-	Added quickprof profiling (see http://sourceforge.net/projects/quickprof )
-		
-2006 March 21 Frank Richter <resqu at gmx.ch>
-	Removed VC manifest files.
-	Removed superfluous "grpplugins" projects.
-
-2006 March 20 Erwin Coumans
-	Clamped the acculumated impulse rather then intermediate impulse (within the iteration)
-	Use the persistent contacts for reusing the impulse
-	Separated friction and normal solving for better stability
-	Decreased the default number of iterations of the constraint solver from 10 to 4
-
-2006 March 19 Frank Richter <resqu at gmx.ch>
-	Removed a couple of CSisms from the VC projects.
-	Fixed VC include & lib paths to go to the Addtional* options
-	  instead the command line arguments.
-	Added pkgconfig support.
-
-2006 March 14 Frank Richter <resqu at gmx.ch>
-	Added support for shipped GLUT on MinGW.
-	Fixed GLUT support on MinGW.
-
-2006 March 13 Frank Richter <resqu at gmx.ch>
-	Bolted on Jam-based build system.
-	Generated VC project files.
-	Fixed GCC warnings.
-	Fixed Linux build issues.
-
-2006 March 13
-Added 3D Sweep and Prune Broadphase Collision Detection, Contribution from Simon Hobbs.
-
-2006 March 2
-	Minor change in license to ZLib/LibPNG
-	This makes it legally a bit easier to deploy on Playstation 3
-	Prepared for more generic constraints, added ConstraintsDemo
-
-2006 Feb 23
-	Rearranged files and dependencies to allow for easier standalone Collision Detection without Bullet Dynamics.
-	See Demos/CollisionInterfaceDemo and Extras/ode/ode/test/test_BulletGjk.cpp for examples how to use.
-
-2005 August 6
-	Bullet 0.2 release with demos, sources, doxygen, draft manual
-
-2005 June 1
-	First public release of Bullet
-	
-
-... todo: add history
-
-2003 Initial version (continuous collision detection)
diff --git a/hkl3d/bullet/Makefile.am b/hkl3d/bullet/Makefile.am
deleted file mode 100644
index 2d304a7..0000000
--- a/hkl3d/bullet/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-ACLOCAL_AMFLAGS = -I m4
-
-SUBDIRS=src
diff --git a/hkl3d/bullet/Makefile.in b/hkl3d/bullet/Makefile.in
deleted file mode 100644
index de1a594..0000000
--- a/hkl3d/bullet/Makefile.in
+++ /dev/null
@@ -1,656 +0,0 @@
-# Makefile.in generated by automake 1.13.3 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = hkl3d/bullet
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am AUTHORS \
-	COPYING ChangeLog NEWS README
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
-	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
-	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
-	$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
-	ctags-recursive dvi-recursive html-recursive info-recursive \
-	install-data-recursive install-dvi-recursive \
-	install-exec-recursive install-html-recursive \
-	install-info-recursive install-pdf-recursive \
-	install-ps-recursive install-recursive installcheck-recursive \
-	installdirs-recursive pdf-recursive ps-recursive \
-	tags-recursive uninstall-recursive
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-am__recursive_targets = \
-  $(RECURSIVE_TARGETS) \
-  $(RECURSIVE_CLEAN_TARGETS) \
-  $(am__extra_recursive_targets)
-AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
-	distdir
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ASY = @ASY@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-G3D_CFLAGS = @G3D_CFLAGS@
-G3D_LIBS = @G3D_LIBS@
-GLIB_CFLAGS = @GLIB_CFLAGS@
-GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
-GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
-GLIB_LIBS = @GLIB_LIBS@
-GLIB_MKENUMS = @GLIB_MKENUMS@
-GLU_CFLAGS = @GLU_CFLAGS@
-GLU_LIBS = @GLU_LIBS@
-GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
-GOBJECT_LIBS = @GOBJECT_LIBS@
-GOBJECT_QUERY = @GOBJECT_QUERY@
-GREP = @GREP@
-GSL_CFLAGS = @GSL_CFLAGS@
-GSL_CONFIG = @GSL_CONFIG@
-GSL_LIBS = @GSL_LIBS@
-GTKDOC_CHECK = @GTKDOC_CHECK@
-GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
-GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
-GTKDOC_MKPDF = @GTKDOC_MKPDF@
-GTKDOC_REBASE = @GTKDOC_REBASE@
-GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
-GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
-GTKMM_CFLAGS = @GTKMM_CFLAGS@
-GTKMM_LIBS = @GTKMM_LIBS@
-HTML_DIR = @HTML_DIR@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
-INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
-INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
-INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
-INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
-INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
-INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
-INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LTP = @LTP@
-LTP_GENHTML = @LTP_GENHTML@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-SHTOOL = @SHTOOL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-VMAJ = @VMAJ@
-YAML_CFLAGS = @YAML_CFLAGS@
-YAML_LIBS = @YAML_LIBS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-opengl_LIBS = @opengl_LIBS@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-release_info = @release_info@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-version_info = @version_info@
-ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = src
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu hkl3d/bullet/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu hkl3d/bullet/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run 'make' without going through this Makefile.
-# To change the values of 'make' variables: instead of editing Makefiles,
-# (1) if the variable is set in 'config.status', edit 'config.status'
-#     (which will cause the Makefiles to be regenerated when you run 'make');
-# (2) otherwise, pass the desired values on the 'make' command line.
-$(am__recursive_targets):
-	@fail=; \
-	if $(am__make_keepgoing); then \
-	  failcom='fail=yes'; \
-	else \
-	  failcom='exit 1'; \
-	fi; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-recursive
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-recursive
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-recursive
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    $(am__make_dryrun) \
-	      || test -d "$(distdir)/$$subdir" \
-	      || $(MKDIR_P) "$(distdir)/$$subdir" \
-	      || exit 1; \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: $(am__recursive_targets) install-am install-strip
-
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
-	check-am clean clean-generic clean-libtool cscopelist-am ctags \
-	ctags-am distclean distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	installdirs-am maintainer-clean maintainer-clean-generic \
-	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
-	ps ps-am tags tags-am uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/hkl3d/bullet/NEWS b/hkl3d/bullet/NEWS
deleted file mode 100644
index d976ae4..0000000
--- a/hkl3d/bullet/NEWS
+++ /dev/null
@@ -1,4 +0,0 @@
-
-For news, visit the Bullet Physics Forum at
-http://www.continuousphysics.com/Bullet/phpBB2/viewforum.php?f=9
-
diff --git a/hkl3d/bullet/README b/hkl3d/bullet/README
deleted file mode 100644
index 8f37053..0000000
--- a/hkl3d/bullet/README
+++ /dev/null
@@ -1,7 +0,0 @@
-
-Bullet is a 3D Collision Detection and Rigid Body Dynamics Library for games and animation.
-Free for commercial use, including Playstation 3, open source under the ZLib License.
-Discrete and continuous collision detection, integrated into Blender 3D, and COLLADA 1.4 Physics import. 
-
-See the Bullet_User_Manual.pdf for more info and visit the Bullet Physics Forum at
-http://bulletphysics.com
diff --git a/hkl3d/bullet/src/Bullet-C-Api.h b/hkl3d/bullet/src/Bullet-C-Api.h
deleted file mode 100644
index f27a17d..0000000
--- a/hkl3d/bullet/src/Bullet-C-Api.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
-	Draft high-level generic physics C-API. For low-level access, use the physics SDK native API's.
-	Work in progress, functionality will be added on demand.
-
-	If possible, use the richer Bullet C++ API, by including "btBulletDynamicsCommon.h"
-*/
-
-#ifndef BULLET_C_API_H
-#define BULLET_C_API_H
-
-#define PL_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name
-
-#ifdef BT_USE_DOUBLE_PRECISION
-typedef double	plReal;
-#else
-typedef float	plReal;
-#endif
-
-typedef plReal	plVector3[3];
-typedef plReal	plQuaternion[4];
-
-#ifdef __cplusplus
-extern "C" { 
-#endif
-
-/**	Particular physics SDK (C-API) */
-	PL_DECLARE_HANDLE(plPhysicsSdkHandle);
-
-/** 	Dynamics world, belonging to some physics SDK (C-API)*/
-	PL_DECLARE_HANDLE(plDynamicsWorldHandle);
-
-/** Rigid Body that can be part of a Dynamics World (C-API)*/	
-	PL_DECLARE_HANDLE(plRigidBodyHandle);
-
-/** 	Collision Shape/Geometry, property of a Rigid Body (C-API)*/
-	PL_DECLARE_HANDLE(plCollisionShapeHandle);
-
-/** Constraint for Rigid Bodies (C-API)*/
-	PL_DECLARE_HANDLE(plConstraintHandle);
-
-/** Triangle Mesh interface (C-API)*/
-	PL_DECLARE_HANDLE(plMeshInterfaceHandle);
-
-/** Broadphase Scene/Proxy Handles (C-API)*/
-	PL_DECLARE_HANDLE(plCollisionBroadphaseHandle);
-	PL_DECLARE_HANDLE(plBroadphaseProxyHandle);
-	PL_DECLARE_HANDLE(plCollisionWorldHandle);
-
-/**
-	Create and Delete a Physics SDK	
-*/
-
-	extern	plPhysicsSdkHandle	plNewBulletSdk(void); //this could be also another sdk, like ODE, PhysX etc.
-	extern	void		plDeletePhysicsSdk(plPhysicsSdkHandle	physicsSdk);
-
-/** Collision World, not strictly necessary, you can also just create a Dynamics World with Rigid Bodies which internally manages the Collision World with Collision Objects */
-
-	typedef void(*btBroadphaseCallback)(void* clientData, void* object1,void* object2);
-
-	extern plCollisionBroadphaseHandle	plCreateSapBroadphase(btBroadphaseCallback beginCallback,btBroadphaseCallback endCallback);
-
-	extern void	plDestroyBroadphase(plCollisionBroadphaseHandle bp);
-
-	extern 	plBroadphaseProxyHandle plCreateProxy(plCollisionBroadphaseHandle bp, void* clientData, plReal minX,plReal minY,plReal minZ, plReal maxX,plReal maxY, plReal maxZ);
-
-	extern void plDestroyProxy(plCollisionBroadphaseHandle bp, plBroadphaseProxyHandle proxyHandle);
-
-	extern void plSetBoundingBox(plBroadphaseProxyHandle proxyHandle, plReal minX,plReal minY,plReal minZ, plReal maxX,plReal maxY, plReal maxZ);
-
-/* todo: add pair cache support with queries like add/remove/find pair */
-	
-	extern plCollisionWorldHandle plCreateCollisionWorld(plPhysicsSdkHandle physicsSdk);
-
-/* todo: add/remove objects */
-	
-
-/* Dynamics World */
-
-	extern  plDynamicsWorldHandle plCreateDynamicsWorld(plPhysicsSdkHandle physicsSdk);
-
-	extern  void           plDeleteDynamicsWorld(plDynamicsWorldHandle world);
-
-	extern	void	plStepSimulation(plDynamicsWorldHandle,	plReal	timeStep);
-
-	extern  void plAddRigidBody(plDynamicsWorldHandle world, plRigidBodyHandle object);
-
-	extern  void plRemoveRigidBody(plDynamicsWorldHandle world, plRigidBodyHandle object);
-
-
-/* Rigid Body  */
-
-	extern  plRigidBodyHandle plCreateRigidBody(	void* user_data,  float mass, plCollisionShapeHandle cshape );
-
-	extern  void plDeleteRigidBody(plRigidBodyHandle body);
-
-
-/* Collision Shape definition */
-
-	extern  plCollisionShapeHandle plNewSphereShape(plReal radius);
-	extern  plCollisionShapeHandle plNewBoxShape(plReal x, plReal y, plReal z);
-	extern  plCollisionShapeHandle plNewCapsuleShape(plReal radius, plReal height);	
-	extern  plCollisionShapeHandle plNewConeShape(plReal radius, plReal height);
-	extern  plCollisionShapeHandle plNewCylinderShape(plReal radius, plReal height);
-	extern	plCollisionShapeHandle plNewCompoundShape(void);
-	extern	void	plAddChildShape(plCollisionShapeHandle compoundShape,plCollisionShapeHandle childShape, plVector3 childPos,plQuaternion childOrn);
-
-	extern  void plDeleteShape(plCollisionShapeHandle shape);
-
-	/* Convex Meshes */
-	extern  plCollisionShapeHandle plNewConvexHullShape(void);
-	extern  void		plAddVertex(plCollisionShapeHandle convexHull, plReal x,plReal y,plReal z);
-/* Concave static triangle meshes */
-	extern  plMeshInterfaceHandle		   plNewMeshInterface(void);
-	extern  void		plAddTriangle(plMeshInterfaceHandle meshHandle, plVector3 v0,plVector3 v1,plVector3 v2);
-	extern  plCollisionShapeHandle plNewStaticTriangleMeshShape(plMeshInterfaceHandle);
-
-	extern  void plSetScaling(plCollisionShapeHandle shape, plVector3 scaling);
-
-/* SOLID has Response Callback/Table/Management */
-/* PhysX has Triggers, User Callbacks and filtering */
-/* ODE has the typedef void dNearCallback (void *data, dGeomID o1, dGeomID o2); */
-
-/*	typedef void plUpdatedPositionCallback(void* userData, plRigidBodyHandle	rbHandle, plVector3 pos); */
-/*	typedef void plUpdatedOrientationCallback(void* userData, plRigidBodyHandle	rbHandle, plQuaternion orientation); */
-
-	/* get world transform */
-	extern void	plGetOpenGLMatrix(plRigidBodyHandle object, plReal* matrix);
-	extern void	plGetPosition(plRigidBodyHandle object,plVector3 position);
-	extern void plGetOrientation(plRigidBodyHandle object,plQuaternion orientation);
-
-	/* set world transform (position/orientation) */
-	extern  void plSetPosition(plRigidBodyHandle object, const plVector3 position);
-	extern  void plSetOrientation(plRigidBodyHandle object, const plQuaternion orientation);
-	extern	void plSetEuler(plReal yaw,plReal pitch,plReal roll, plQuaternion orient);
-	extern	void plSetOpenGLMatrix(plRigidBodyHandle object, plReal* matrix);
-
-	typedef struct plRayCastResult {
-		plRigidBodyHandle		m_body;  
-		plCollisionShapeHandle	m_shape; 		
-		plVector3				m_positionWorld; 		
-		plVector3				m_normalWorld;
-	} plRayCastResult;
-
-	extern  int plRayCast(plDynamicsWorldHandle world, const plVector3 rayStart, const plVector3 rayEnd, plRayCastResult res);
-
-	/* Sweep API */
-
-	/* extern  plRigidBodyHandle plObjectCast(plDynamicsWorldHandle world, const plVector3 rayStart, const plVector3 rayEnd, plVector3 hitpoint, plVector3 normal); */
-
-	/* Continuous Collision Detection API */
-	
-	// needed for source/blender/blenkernel/intern/collision.c
-	double plNearestPoints(float p1[3], float p2[3], float p3[3], float q1[3], float q2[3], float q3[3], float *pa, float *pb, float normal[3]);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif //BULLET_C_API_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp
deleted file mode 100644
index 7776330..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-
-//Bullet Continuous Collision Detection and Physics Library
-//Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-
-//
-// btAxisSweep3
-//
-// Copyright (c) 2006 Simon Hobbs
-//
-// This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-#include "btAxisSweep3.h"
-
-
-btAxisSweep3::btAxisSweep3(const btVector3& worldAabbMin,const btVector3& worldAabbMax, unsigned short int maxHandles, btOverlappingPairCache* pairCache, bool disableRaycastAccelerator)
-:btAxisSweep3Internal<unsigned short int>(worldAabbMin,worldAabbMax,0xfffe,0xffff,maxHandles,pairCache,disableRaycastAccelerator)
-{
-	// 1 handle is reserved as sentinel
-	btAssert(maxHandles > 1 && maxHandles < 32767);
-
-}
-
-
-bt32BitAxisSweep3::bt32BitAxisSweep3(const btVector3& worldAabbMin,const btVector3& worldAabbMax, unsigned int maxHandles , btOverlappingPairCache* pairCache , bool disableRaycastAccelerator)
-:btAxisSweep3Internal<unsigned int>(worldAabbMin,worldAabbMax,0xfffffffe,0x7fffffff,maxHandles,pairCache,disableRaycastAccelerator)
-{
-	// 1 handle is reserved as sentinel
-	btAssert(maxHandles > 1 && maxHandles < 2147483647);
-}
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h
deleted file mode 100644
index 4f4d94b..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h
+++ /dev/null
@@ -1,1051 +0,0 @@
-//Bullet Continuous Collision Detection and Physics Library
-//Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-//
-// btAxisSweep3.h
-//
-// Copyright (c) 2006 Simon Hobbs
-//
-// This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-
-#ifndef BT_AXIS_SWEEP_3_H
-#define BT_AXIS_SWEEP_3_H
-
-#include "LinearMath/btVector3.h"
-#include "btOverlappingPairCache.h"
-#include "btBroadphaseInterface.h"
-#include "btBroadphaseProxy.h"
-#include "btOverlappingPairCallback.h"
-#include "btDbvtBroadphase.h"
-
-//#define DEBUG_BROADPHASE 1
-#define USE_OVERLAP_TEST_ON_REMOVES 1
-
-/// The internal templace class btAxisSweep3Internal implements the sweep and prune broadphase.
-/// It uses quantized integers to represent the begin and end points for each of the 3 axis.
-/// Dont use this class directly, use btAxisSweep3 or bt32BitAxisSweep3 instead.
-template <typename BP_FP_INT_TYPE>
-class btAxisSweep3Internal : public btBroadphaseInterface
-{
-protected:
-
-	BP_FP_INT_TYPE	m_bpHandleMask;
-	BP_FP_INT_TYPE	m_handleSentinel;
-
-public:
-	
- BT_DECLARE_ALIGNED_ALLOCATOR();
-
-	class Edge
-	{
-	public:
-		BP_FP_INT_TYPE m_pos;			// low bit is min/max
-		BP_FP_INT_TYPE m_handle;
-
-		BP_FP_INT_TYPE IsMax() const {return static_cast<BP_FP_INT_TYPE>(m_pos & 1);}
-	};
-
-public:
-	class	Handle : public btBroadphaseProxy
-	{
-	public:
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-	
-		// indexes into the edge arrays
-		BP_FP_INT_TYPE m_minEdges[3], m_maxEdges[3];		// 6 * 2 = 12
-//		BP_FP_INT_TYPE m_uniqueId;
-		btBroadphaseProxy*	m_dbvtProxy;//for faster raycast
-		//void* m_pOwner; this is now in btBroadphaseProxy.m_clientObject
-	
-		SIMD_FORCE_INLINE void SetNextFree(BP_FP_INT_TYPE next) {m_minEdges[0] = next;}
-		SIMD_FORCE_INLINE BP_FP_INT_TYPE GetNextFree() const {return m_minEdges[0];}
-	};		// 24 bytes + 24 for Edge structures = 44 bytes total per entry
-
-	
-protected:
-	btVector3 m_worldAabbMin;						// overall system bounds
-	btVector3 m_worldAabbMax;						// overall system bounds
-
-	btVector3 m_quantize;						// scaling factor for quantization
-
-	BP_FP_INT_TYPE m_numHandles;						// number of active handles
-	BP_FP_INT_TYPE m_maxHandles;						// max number of handles
-	Handle* m_pHandles;						// handles pool
-	
-	BP_FP_INT_TYPE m_firstFreeHandle;		// free handles list
-
-	Edge* m_pEdges[3];						// edge arrays for the 3 axes (each array has m_maxHandles * 2 + 2 sentinel entries)
-	void* m_pEdgesRawPtr[3];
-
-	btOverlappingPairCache* m_pairCache;
-
-	///btOverlappingPairCallback is an additional optional user callback for adding/removing overlapping pairs, similar interface to btOverlappingPairCache.
-	btOverlappingPairCallback* m_userPairCallback;
-	
-	bool	m_ownsPairCache;
-
-	int	m_invalidPair;
-
-	///additional dynamic aabb structure, used to accelerate ray cast queries.
-	///can be disabled using a optional argument in the constructor
-	btDbvtBroadphase*	m_raycastAccelerator;
-	btOverlappingPairCache*	m_nullPairCache;
-
-
-	// allocation/deallocation
-	BP_FP_INT_TYPE allocHandle();
-	void freeHandle(BP_FP_INT_TYPE handle);
-	
-
-	bool testOverlap2D(const Handle* pHandleA, const Handle* pHandleB,int axis0,int axis1);
-
-#ifdef DEBUG_BROADPHASE
-	void debugPrintAxis(int axis,bool checkCardinality=true);
-#endif //DEBUG_BROADPHASE
-
-	//Overlap* AddOverlap(BP_FP_INT_TYPE handleA, BP_FP_INT_TYPE handleB);
-	//void RemoveOverlap(BP_FP_INT_TYPE handleA, BP_FP_INT_TYPE handleB);
-
-	
-
-	void sortMinDown(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps );
-	void sortMinUp(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps );
-	void sortMaxDown(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps );
-	void sortMaxUp(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps );
-
-public:
-
-	btAxisSweep3Internal(const btVector3& worldAabbMin,const btVector3& worldAabbMax, BP_FP_INT_TYPE handleMask, BP_FP_INT_TYPE handleSentinel, BP_FP_INT_TYPE maxHandles = 16384, btOverlappingPairCache* pairCache=0,bool disableRaycastAccelerator = false);
-
-	virtual	~btAxisSweep3Internal();
-
-	BP_FP_INT_TYPE getNumHandles() const
-	{
-		return m_numHandles;
-	}
-
-	virtual void	calculateOverlappingPairs(btDispatcher* dispatcher);
-	
-	BP_FP_INT_TYPE addHandle(const btVector3& aabbMin,const btVector3& aabbMax, void* pOwner,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy);
-	void removeHandle(BP_FP_INT_TYPE handle,btDispatcher* dispatcher);
-	void updateHandle(BP_FP_INT_TYPE handle, const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher);
-	SIMD_FORCE_INLINE Handle* getHandle(BP_FP_INT_TYPE index) const {return m_pHandles + index;}
-
-	virtual void resetPool(btDispatcher* dispatcher);
-
-	void	processAllOverlappingPairs(btOverlapCallback* callback);
-
-	//Broadphase Interface
-	virtual btBroadphaseProxy*	createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy);
-	virtual void	destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
-	virtual void	setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher);
-	virtual void  getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;
-	
-	virtual void	rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0), const btVector3& aabbMax = btVector3(0,0,0));
-	virtual void	aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback);
-
-	
-	void quantize(BP_FP_INT_TYPE* out, const btVector3& point, int isMax) const;
-	///unQuantize should be conservative: aabbMin/aabbMax should be larger then 'getAabb' result
-	void unQuantize(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;
-	
-	bool	testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);
-
-	btOverlappingPairCache*	getOverlappingPairCache()
-	{
-		return m_pairCache;
-	}
-	const btOverlappingPairCache*	getOverlappingPairCache() const
-	{
-		return m_pairCache;
-	}
-
-	void	setOverlappingPairUserCallback(btOverlappingPairCallback* pairCallback)
-	{
-		m_userPairCallback = pairCallback;
-	}
-	const btOverlappingPairCallback*	getOverlappingPairUserCallback() const
-	{
-		return m_userPairCallback;
-	}
-
-	///getAabb returns the axis aligned bounding box in the 'global' coordinate frame
-	///will add some transform later
-	virtual void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const
-	{
-		aabbMin = m_worldAabbMin;
-		aabbMax = m_worldAabbMax;
-	}
-
-	virtual void	printStats()
-	{
-/*		printf("btAxisSweep3.h\n");
-		printf("numHandles = %d, maxHandles = %d\n",m_numHandles,m_maxHandles);
-		printf("aabbMin=%f,%f,%f,aabbMax=%f,%f,%f\n",m_worldAabbMin.getX(),m_worldAabbMin.getY(),m_worldAabbMin.getZ(),
-			m_worldAabbMax.getX(),m_worldAabbMax.getY(),m_worldAabbMax.getZ());
-			*/
-
-	}
-
-};
-
-////////////////////////////////////////////////////////////////////
-
-
-
-
-#ifdef DEBUG_BROADPHASE
-#include <stdio.h>
-
-template <typename BP_FP_INT_TYPE>
-void btAxisSweep3<BP_FP_INT_TYPE>::debugPrintAxis(int axis, bool checkCardinality)
-{
-	int numEdges = m_pHandles[0].m_maxEdges[axis];
-	printf("SAP Axis %d, numEdges=%d\n",axis,numEdges);
-
-	int i;
-	for (i=0;i<numEdges+1;i++)
-	{
-		Edge* pEdge = m_pEdges[axis] + i;
-		Handle* pHandlePrev = getHandle(pEdge->m_handle);
-		int handleIndex = pEdge->IsMax()? pHandlePrev->m_maxEdges[axis] : pHandlePrev->m_minEdges[axis];
-		char beginOrEnd;
-		beginOrEnd=pEdge->IsMax()?'E':'B';
-		printf("	[%c,h=%d,p=%x,i=%d]\n",beginOrEnd,pEdge->m_handle,pEdge->m_pos,handleIndex);
-	}
-
-	if (checkCardinality)
-		btAssert(numEdges == m_numHandles*2+1);
-}
-#endif //DEBUG_BROADPHASE
-
-template <typename BP_FP_INT_TYPE>
-btBroadphaseProxy*	btAxisSweep3Internal<BP_FP_INT_TYPE>::createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy)
-{
-		(void)shapeType;
-		BP_FP_INT_TYPE handleId = addHandle(aabbMin,aabbMax, userPtr,collisionFilterGroup,collisionFilterMask,dispatcher,multiSapProxy);
-		
-		Handle* handle = getHandle(handleId);
-		
-		if (m_raycastAccelerator)
-		{
-			btBroadphaseProxy* rayProxy = m_raycastAccelerator->createProxy(aabbMin,aabbMax,shapeType,userPtr,collisionFilterGroup,collisionFilterMask,dispatcher,0);
-			handle->m_dbvtProxy = rayProxy;
-		}
-		return handle;
-}
-
-
-
-template <typename BP_FP_INT_TYPE>
-void	btAxisSweep3Internal<BP_FP_INT_TYPE>::destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher)
-{
-	Handle* handle = static_cast<Handle*>(proxy);
-	if (m_raycastAccelerator)
-		m_raycastAccelerator->destroyProxy(handle->m_dbvtProxy,dispatcher);
-	removeHandle(static_cast<BP_FP_INT_TYPE>(handle->m_uniqueId), dispatcher);
-}
-
-template <typename BP_FP_INT_TYPE>
-void	btAxisSweep3Internal<BP_FP_INT_TYPE>::setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher)
-{
-	Handle* handle = static_cast<Handle*>(proxy);
-	handle->m_aabbMin = aabbMin;
-	handle->m_aabbMax = aabbMax;
-	updateHandle(static_cast<BP_FP_INT_TYPE>(handle->m_uniqueId), aabbMin, aabbMax,dispatcher);
-	if (m_raycastAccelerator)
-		m_raycastAccelerator->setAabb(handle->m_dbvtProxy,aabbMin,aabbMax,dispatcher);
-
-}
-
-template <typename BP_FP_INT_TYPE>
-void	btAxisSweep3Internal<BP_FP_INT_TYPE>::rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback,const btVector3& aabbMin,const btVector3& aabbMax)
-{
-	if (m_raycastAccelerator)
-	{
-		m_raycastAccelerator->rayTest(rayFrom,rayTo,rayCallback,aabbMin,aabbMax);
-	} else
-	{
-		//choose axis?
-		BP_FP_INT_TYPE axis = 0;
-		//for each proxy
-		for (BP_FP_INT_TYPE i=1;i<m_numHandles*2+1;i++)
-		{
-			if (m_pEdges[axis][i].IsMax())
-			{
-				rayCallback.process(getHandle(m_pEdges[axis][i].m_handle));
-			}
-		}
-	}
-}
-
-template <typename BP_FP_INT_TYPE>
-void	btAxisSweep3Internal<BP_FP_INT_TYPE>::aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback)
-{
-	if (m_raycastAccelerator)
-	{
-		m_raycastAccelerator->aabbTest(aabbMin,aabbMax,callback);
-	} else
-	{
-		//choose axis?
-		BP_FP_INT_TYPE axis = 0;
-		//for each proxy
-		for (BP_FP_INT_TYPE i=1;i<m_numHandles*2+1;i++)
-		{
-			if (m_pEdges[axis][i].IsMax())
-			{
-				Handle* handle = getHandle(m_pEdges[axis][i].m_handle);
-				if (TestAabbAgainstAabb2(aabbMin,aabbMax,handle->m_aabbMin,handle->m_aabbMax))
-				{
-					callback.process(handle);
-				}
-			}
-		}
-	}
-}
-
-
-
-template <typename BP_FP_INT_TYPE>
-void btAxisSweep3Internal<BP_FP_INT_TYPE>::getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const
-{
-	Handle* pHandle = static_cast<Handle*>(proxy);
-	aabbMin = pHandle->m_aabbMin;
-	aabbMax = pHandle->m_aabbMax;
-}
-
-
-template <typename BP_FP_INT_TYPE>
-void btAxisSweep3Internal<BP_FP_INT_TYPE>::unQuantize(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const
-{
-	Handle* pHandle = static_cast<Handle*>(proxy);
-
-	unsigned short vecInMin[3];
-	unsigned short vecInMax[3];
-
-	vecInMin[0] = m_pEdges[0][pHandle->m_minEdges[0]].m_pos ;
-	vecInMax[0] = m_pEdges[0][pHandle->m_maxEdges[0]].m_pos +1 ;
-	vecInMin[1] = m_pEdges[1][pHandle->m_minEdges[1]].m_pos ;
-	vecInMax[1] = m_pEdges[1][pHandle->m_maxEdges[1]].m_pos +1 ;
-	vecInMin[2] = m_pEdges[2][pHandle->m_minEdges[2]].m_pos ;
-	vecInMax[2] = m_pEdges[2][pHandle->m_maxEdges[2]].m_pos +1 ;
-	
-	aabbMin.setValue((btScalar)(vecInMin[0]) / (m_quantize.getX()),(btScalar)(vecInMin[1]) / (m_quantize.getY()),(btScalar)(vecInMin[2]) / (m_quantize.getZ()));
-	aabbMin += m_worldAabbMin;
-	
-	aabbMax.setValue((btScalar)(vecInMax[0]) / (m_quantize.getX()),(btScalar)(vecInMax[1]) / (m_quantize.getY()),(btScalar)(vecInMax[2]) / (m_quantize.getZ()));
-	aabbMax += m_worldAabbMin;
-}
-
-
-
-
-template <typename BP_FP_INT_TYPE>
-btAxisSweep3Internal<BP_FP_INT_TYPE>::btAxisSweep3Internal(const btVector3& worldAabbMin,const btVector3& worldAabbMax, BP_FP_INT_TYPE handleMask, BP_FP_INT_TYPE handleSentinel,BP_FP_INT_TYPE userMaxHandles, btOverlappingPairCache* pairCache , bool disableRaycastAccelerator)
-:m_bpHandleMask(handleMask),
-m_handleSentinel(handleSentinel),
-m_pairCache(pairCache),
-m_userPairCallback(0),
-m_ownsPairCache(false),
-m_invalidPair(0),
-m_raycastAccelerator(0)
-{
-	BP_FP_INT_TYPE maxHandles = static_cast<BP_FP_INT_TYPE>(userMaxHandles+1);//need to add one sentinel handle
-
-	if (!m_pairCache)
-	{
-		void* ptr = btAlignedAlloc(sizeof(btHashedOverlappingPairCache),16);
-		m_pairCache = new(ptr) btHashedOverlappingPairCache();
-		m_ownsPairCache = true;
-	}
-
-	if (!disableRaycastAccelerator)
-	{
-		m_nullPairCache = new (btAlignedAlloc(sizeof(btNullPairCache),16)) btNullPairCache();
-		m_raycastAccelerator = new (btAlignedAlloc(sizeof(btDbvtBroadphase),16)) btDbvtBroadphase(m_nullPairCache);//m_pairCache);
-		m_raycastAccelerator->m_deferedcollide = true;//don't add/remove pairs
-	}
-
-	//btAssert(bounds.HasVolume());
-
-	// init bounds
-	m_worldAabbMin = worldAabbMin;
-	m_worldAabbMax = worldAabbMax;
-
-	btVector3 aabbSize = m_worldAabbMax - m_worldAabbMin;
-
-	BP_FP_INT_TYPE	maxInt = m_handleSentinel;
-
-	m_quantize = btVector3(btScalar(maxInt),btScalar(maxInt),btScalar(maxInt)) / aabbSize;
-
-	// allocate handles buffer, using btAlignedAlloc, and put all handles on free list
-	m_pHandles = new Handle[maxHandles];
-	
-	m_maxHandles = maxHandles;
-	m_numHandles = 0;
-
-	// handle 0 is reserved as the null index, and is also used as the sentinel
-	m_firstFreeHandle = 1;
-	{
-		for (BP_FP_INT_TYPE i = m_firstFreeHandle; i < maxHandles; i++)
-			m_pHandles[i].SetNextFree(static_cast<BP_FP_INT_TYPE>(i + 1));
-		m_pHandles[maxHandles - 1].SetNextFree(0);
-	}
-
-	{
-		// allocate edge buffers
-		for (int i = 0; i < 3; i++)
-		{
-			m_pEdgesRawPtr[i] = btAlignedAlloc(sizeof(Edge)*maxHandles*2,16);
-			m_pEdges[i] = new(m_pEdgesRawPtr[i]) Edge[maxHandles * 2];
-		}
-	}
-	//removed overlap management
-
-	// make boundary sentinels
-	
-	m_pHandles[0].m_clientObject = 0;
-
-	for (int axis = 0; axis < 3; axis++)
-	{
-		m_pHandles[0].m_minEdges[axis] = 0;
-		m_pHandles[0].m_maxEdges[axis] = 1;
-
-		m_pEdges[axis][0].m_pos = 0;
-		m_pEdges[axis][0].m_handle = 0;
-		m_pEdges[axis][1].m_pos = m_handleSentinel;
-		m_pEdges[axis][1].m_handle = 0;
-#ifdef DEBUG_BROADPHASE
-		debugPrintAxis(axis);
-#endif //DEBUG_BROADPHASE
-
-	}
-
-}
-
-template <typename BP_FP_INT_TYPE>
-btAxisSweep3Internal<BP_FP_INT_TYPE>::~btAxisSweep3Internal()
-{
-	if (m_raycastAccelerator)
-	{
-		m_nullPairCache->~btOverlappingPairCache();
-		btAlignedFree(m_nullPairCache);
-		m_raycastAccelerator->~btDbvtBroadphase();
-		btAlignedFree (m_raycastAccelerator);
-	}
-
-	for (int i = 2; i >= 0; i--)
-	{
-		btAlignedFree(m_pEdgesRawPtr[i]);
-	}
-	delete [] m_pHandles;
-
-	if (m_ownsPairCache)
-	{
-		m_pairCache->~btOverlappingPairCache();
-		btAlignedFree(m_pairCache);
-	}
-}
-
-template <typename BP_FP_INT_TYPE>
-void btAxisSweep3Internal<BP_FP_INT_TYPE>::quantize(BP_FP_INT_TYPE* out, const btVector3& point, int isMax) const
-{
-#ifdef OLD_CLAMPING_METHOD
-	///problem with this clamping method is that the floating point during quantization might still go outside the range [(0|isMax) .. (m_handleSentinel&m_bpHandleMask]|isMax]
-	///see http://code.google.com/p/bullet/issues/detail?id=87
-	btVector3 clampedPoint(point);
-	clampedPoint.setMax(m_worldAabbMin);
-	clampedPoint.setMin(m_worldAabbMax);
-	btVector3 v = (clampedPoint - m_worldAabbMin) * m_quantize;
-	out[0] = (BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v.getX() & m_bpHandleMask) | isMax);
-	out[1] = (BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v.getY() & m_bpHandleMask) | isMax);
-	out[2] = (BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v.getZ() & m_bpHandleMask) | isMax);
-#else
-	btVector3 v = (point - m_worldAabbMin) * m_quantize;
-	out[0]=(v[0]<=0)?(BP_FP_INT_TYPE)isMax:(v[0]>=m_handleSentinel)?(BP_FP_INT_TYPE)((m_handleSentinel&m_bpHandleMask)|isMax):(BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v[0]&m_bpHandleMask)|isMax);
-	out[1]=(v[1]<=0)?(BP_FP_INT_TYPE)isMax:(v[1]>=m_handleSentinel)?(BP_FP_INT_TYPE)((m_handleSentinel&m_bpHandleMask)|isMax):(BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v[1]&m_bpHandleMask)|isMax);
-	out[2]=(v[2]<=0)?(BP_FP_INT_TYPE)isMax:(v[2]>=m_handleSentinel)?(BP_FP_INT_TYPE)((m_handleSentinel&m_bpHandleMask)|isMax):(BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v[2]&m_bpHandleMask)|isMax);
-#endif //OLD_CLAMPING_METHOD
-}
-
-
-template <typename BP_FP_INT_TYPE>
-BP_FP_INT_TYPE btAxisSweep3Internal<BP_FP_INT_TYPE>::allocHandle()
-{
-	btAssert(m_firstFreeHandle);
-
-	BP_FP_INT_TYPE handle = m_firstFreeHandle;
-	m_firstFreeHandle = getHandle(handle)->GetNextFree();
-	m_numHandles++;
-
-	return handle;
-}
-
-template <typename BP_FP_INT_TYPE>
-void btAxisSweep3Internal<BP_FP_INT_TYPE>::freeHandle(BP_FP_INT_TYPE handle)
-{
-	btAssert(handle > 0 && handle < m_maxHandles);
-
-	getHandle(handle)->SetNextFree(m_firstFreeHandle);
-	m_firstFreeHandle = handle;
-
-	m_numHandles--;
-}
-
-
-template <typename BP_FP_INT_TYPE>
-BP_FP_INT_TYPE btAxisSweep3Internal<BP_FP_INT_TYPE>::addHandle(const btVector3& aabbMin,const btVector3& aabbMax, void* pOwner,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy)
-{
-	// quantize the bounds
-	BP_FP_INT_TYPE min[3], max[3];
-	quantize(min, aabbMin, 0);
-	quantize(max, aabbMax, 1);
-
-	// allocate a handle
-	BP_FP_INT_TYPE handle = allocHandle();
-	
-
-	Handle* pHandle = getHandle(handle);
-	
-	pHandle->m_uniqueId = static_cast<int>(handle);
-	//pHandle->m_pOverlaps = 0;
-	pHandle->m_clientObject = pOwner;
-	pHandle->m_collisionFilterGroup = collisionFilterGroup;
-	pHandle->m_collisionFilterMask = collisionFilterMask;
-	pHandle->m_multiSapParentProxy = multiSapProxy;
-
-	// compute current limit of edge arrays
-	BP_FP_INT_TYPE limit = static_cast<BP_FP_INT_TYPE>(m_numHandles * 2);
-
-	
-	// insert new edges just inside the max boundary edge
-	for (BP_FP_INT_TYPE axis = 0; axis < 3; axis++)
-	{
-
-		m_pHandles[0].m_maxEdges[axis] += 2;
-
-		m_pEdges[axis][limit + 1] = m_pEdges[axis][limit - 1];
-
-		m_pEdges[axis][limit - 1].m_pos = min[axis];
-		m_pEdges[axis][limit - 1].m_handle = handle;
-
-		m_pEdges[axis][limit].m_pos = max[axis];
-		m_pEdges[axis][limit].m_handle = handle;
-
-		pHandle->m_minEdges[axis] = static_cast<BP_FP_INT_TYPE>(limit - 1);
-		pHandle->m_maxEdges[axis] = limit;
-	}
-
-	// now sort the new edges to their correct position
-	sortMinDown(0, pHandle->m_minEdges[0], dispatcher,false);
-	sortMaxDown(0, pHandle->m_maxEdges[0], dispatcher,false);
-	sortMinDown(1, pHandle->m_minEdges[1], dispatcher,false);
-	sortMaxDown(1, pHandle->m_maxEdges[1], dispatcher,false);
-	sortMinDown(2, pHandle->m_minEdges[2], dispatcher,true);
-	sortMaxDown(2, pHandle->m_maxEdges[2], dispatcher,true);
-
-
-	return handle;
-}
-
-
-template <typename BP_FP_INT_TYPE>
-void btAxisSweep3Internal<BP_FP_INT_TYPE>::removeHandle(BP_FP_INT_TYPE handle,btDispatcher* dispatcher)
-{
-
-	Handle* pHandle = getHandle(handle);
-
-	//explicitly remove the pairs containing the proxy
-	//we could do it also in the sortMinUp (passing true)
-	///@todo: compare performance
-	if (!m_pairCache->hasDeferredRemoval())
-	{
-		m_pairCache->removeOverlappingPairsContainingProxy(pHandle,dispatcher);
-	}
-
-	// compute current limit of edge arrays
-	int limit = static_cast<int>(m_numHandles * 2);
-	
-	int axis;
-
-	for (axis = 0;axis<3;axis++)
-	{
-		m_pHandles[0].m_maxEdges[axis] -= 2;
-	}
-
-	// remove the edges by sorting them up to the end of the list
-	for ( axis = 0; axis < 3; axis++)
-	{
-		Edge* pEdges = m_pEdges[axis];
-		BP_FP_INT_TYPE max = pHandle->m_maxEdges[axis];
-		pEdges[max].m_pos = m_handleSentinel;
-
-		sortMaxUp(axis,max,dispatcher,false);
-
-
-		BP_FP_INT_TYPE i = pHandle->m_minEdges[axis];
-		pEdges[i].m_pos = m_handleSentinel;
-
-
-		sortMinUp(axis,i,dispatcher,false);
-
-		pEdges[limit-1].m_handle = 0;
-		pEdges[limit-1].m_pos = m_handleSentinel;
-		
-#ifdef DEBUG_BROADPHASE
-			debugPrintAxis(axis,false);
-#endif //DEBUG_BROADPHASE
-
-
-	}
-
-
-	// free the handle
-	freeHandle(handle);
-
-	
-}
-
-template <typename BP_FP_INT_TYPE>
-void btAxisSweep3Internal<BP_FP_INT_TYPE>::resetPool(btDispatcher* dispatcher)
-{
-	if (m_numHandles == 0)
-	{
-		m_firstFreeHandle = 1;
-		{
-			for (BP_FP_INT_TYPE i = m_firstFreeHandle; i < m_maxHandles; i++)
-				m_pHandles[i].SetNextFree(static_cast<BP_FP_INT_TYPE>(i + 1));
-			m_pHandles[m_maxHandles - 1].SetNextFree(0);
-		}
-	}
-}       
-
-
-extern int gOverlappingPairs;
-//#include <stdio.h>
-
-template <typename BP_FP_INT_TYPE>
-void	btAxisSweep3Internal<BP_FP_INT_TYPE>::calculateOverlappingPairs(btDispatcher* dispatcher)
-{
-
-	if (m_pairCache->hasDeferredRemoval())
-	{
-	
-		btBroadphasePairArray&	overlappingPairArray = m_pairCache->getOverlappingPairArray();
-
-		//perform a sort, to find duplicates and to sort 'invalid' pairs to the end
-		overlappingPairArray.quickSort(btBroadphasePairSortPredicate());
-
-		overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair);
-		m_invalidPair = 0;
-
-		
-		int i;
-
-		btBroadphasePair previousPair;
-		previousPair.m_pProxy0 = 0;
-		previousPair.m_pProxy1 = 0;
-		previousPair.m_algorithm = 0;
-		
-		
-		for (i=0;i<overlappingPairArray.size();i++)
-		{
-		
-			btBroadphasePair& pair = overlappingPairArray[i];
-
-			bool isDuplicate = (pair == previousPair);
-
-			previousPair = pair;
-
-			bool needsRemoval = false;
-
-			if (!isDuplicate)
-			{
-				///important to use an AABB test that is consistent with the broadphase
-				bool hasOverlap = testAabbOverlap(pair.m_pProxy0,pair.m_pProxy1);
-
-				if (hasOverlap)
-				{
-					needsRemoval = false;//callback->processOverlap(pair);
-				} else
-				{
-					needsRemoval = true;
-				}
-			} else
-			{
-				//remove duplicate
-				needsRemoval = true;
-				//should have no algorithm
-				btAssert(!pair.m_algorithm);
-			}
-			
-			if (needsRemoval)
-			{
-				m_pairCache->cleanOverlappingPair(pair,dispatcher);
-
-		//		m_overlappingPairArray.swap(i,m_overlappingPairArray.size()-1);
-		//		m_overlappingPairArray.pop_back();
-				pair.m_pProxy0 = 0;
-				pair.m_pProxy1 = 0;
-				m_invalidPair++;
-				gOverlappingPairs--;
-			} 
-			
-		}
-
-	///if you don't like to skip the invalid pairs in the array, execute following code:
-	#define CLEAN_INVALID_PAIRS 1
-	#ifdef CLEAN_INVALID_PAIRS
-
-		//perform a sort, to sort 'invalid' pairs to the end
-		overlappingPairArray.quickSort(btBroadphasePairSortPredicate());
-
-		overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair);
-		m_invalidPair = 0;
-	#endif//CLEAN_INVALID_PAIRS
-		
-		//printf("overlappingPairArray.size()=%d\n",overlappingPairArray.size());
-	}
-
-}
-
-
-template <typename BP_FP_INT_TYPE>
-bool btAxisSweep3Internal<BP_FP_INT_TYPE>::testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1)
-{
-	const Handle* pHandleA = static_cast<Handle*>(proxy0);
-	const Handle* pHandleB = static_cast<Handle*>(proxy1);
-	
-	//optimization 1: check the array index (memory address), instead of the m_pos
-
-	for (int axis = 0; axis < 3; axis++)
-	{ 
-		if (pHandleA->m_maxEdges[axis] < pHandleB->m_minEdges[axis] || 
-			pHandleB->m_maxEdges[axis] < pHandleA->m_minEdges[axis]) 
-		{ 
-			return false; 
-		} 
-	} 
-	return true;
-}
-
-template <typename BP_FP_INT_TYPE>
-bool btAxisSweep3Internal<BP_FP_INT_TYPE>::testOverlap2D(const Handle* pHandleA, const Handle* pHandleB,int axis0,int axis1)
-{
-	//optimization 1: check the array index (memory address), instead of the m_pos
-
-	if (pHandleA->m_maxEdges[axis0] < pHandleB->m_minEdges[axis0] || 
-		pHandleB->m_maxEdges[axis0] < pHandleA->m_minEdges[axis0] ||
-		pHandleA->m_maxEdges[axis1] < pHandleB->m_minEdges[axis1] ||
-		pHandleB->m_maxEdges[axis1] < pHandleA->m_minEdges[axis1]) 
-	{ 
-		return false; 
-	} 
-	return true;
-}
-
-template <typename BP_FP_INT_TYPE>
-void btAxisSweep3Internal<BP_FP_INT_TYPE>::updateHandle(BP_FP_INT_TYPE handle, const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher)
-{
-//	btAssert(bounds.IsFinite());
-	//btAssert(bounds.HasVolume());
-
-	Handle* pHandle = getHandle(handle);
-
-	// quantize the new bounds
-	BP_FP_INT_TYPE min[3], max[3];
-	quantize(min, aabbMin, 0);
-	quantize(max, aabbMax, 1);
-
-	// update changed edges
-	for (int axis = 0; axis < 3; axis++)
-	{
-		BP_FP_INT_TYPE emin = pHandle->m_minEdges[axis];
-		BP_FP_INT_TYPE emax = pHandle->m_maxEdges[axis];
-
-		int dmin = (int)min[axis] - (int)m_pEdges[axis][emin].m_pos;
-		int dmax = (int)max[axis] - (int)m_pEdges[axis][emax].m_pos;
-
-		m_pEdges[axis][emin].m_pos = min[axis];
-		m_pEdges[axis][emax].m_pos = max[axis];
-
-		// expand (only adds overlaps)
-		if (dmin < 0)
-			sortMinDown(axis, emin,dispatcher,true);
-
-		if (dmax > 0)
-			sortMaxUp(axis, emax,dispatcher,true);
-
-		// shrink (only removes overlaps)
-		if (dmin > 0)
-			sortMinUp(axis, emin,dispatcher,true);
-
-		if (dmax < 0)
-			sortMaxDown(axis, emax,dispatcher,true);
-
-#ifdef DEBUG_BROADPHASE
-	debugPrintAxis(axis);
-#endif //DEBUG_BROADPHASE
-	}
-
-	
-}
-
-
-
-
-// sorting a min edge downwards can only ever *add* overlaps
-template <typename BP_FP_INT_TYPE>
-void btAxisSweep3Internal<BP_FP_INT_TYPE>::sortMinDown(int axis, BP_FP_INT_TYPE edge, btDispatcher* /* dispatcher */, bool updateOverlaps)
-{
-
-	Edge* pEdge = m_pEdges[axis] + edge;
-	Edge* pPrev = pEdge - 1;
-	Handle* pHandleEdge = getHandle(pEdge->m_handle);
-
-	while (pEdge->m_pos < pPrev->m_pos)
-	{
-		Handle* pHandlePrev = getHandle(pPrev->m_handle);
-
-		if (pPrev->IsMax())
-		{
-			// if previous edge is a maximum check the bounds and add an overlap if necessary
-			const int axis1 = (1  << axis) & 3;
-			const int axis2 = (1  << axis1) & 3;
-			if (updateOverlaps && testOverlap2D(pHandleEdge, pHandlePrev,axis1,axis2))
-			{
-				m_pairCache->addOverlappingPair(pHandleEdge,pHandlePrev);
-				if (m_userPairCallback)
-					m_userPairCallback->addOverlappingPair(pHandleEdge,pHandlePrev);
-
-				//AddOverlap(pEdge->m_handle, pPrev->m_handle);
-
-			}
-
-			// update edge reference in other handle
-			pHandlePrev->m_maxEdges[axis]++;
-		}
-		else
-			pHandlePrev->m_minEdges[axis]++;
-
-		pHandleEdge->m_minEdges[axis]--;
-
-		// swap the edges
-		Edge swap = *pEdge;
-		*pEdge = *pPrev;
-		*pPrev = swap;
-
-		// decrement
-		pEdge--;
-		pPrev--;
-	}
-
-#ifdef DEBUG_BROADPHASE
-	debugPrintAxis(axis);
-#endif //DEBUG_BROADPHASE
-
-}
-
-// sorting a min edge upwards can only ever *remove* overlaps
-template <typename BP_FP_INT_TYPE>
-void btAxisSweep3Internal<BP_FP_INT_TYPE>::sortMinUp(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps)
-{
-	Edge* pEdge = m_pEdges[axis] + edge;
-	Edge* pNext = pEdge + 1;
-	Handle* pHandleEdge = getHandle(pEdge->m_handle);
-
-	while (pNext->m_handle && (pEdge->m_pos >= pNext->m_pos))
-	{
-		Handle* pHandleNext = getHandle(pNext->m_handle);
-
-		if (pNext->IsMax())
-		{
-			Handle* handle0 = getHandle(pEdge->m_handle);
-			Handle* handle1 = getHandle(pNext->m_handle);
-			const int axis1 = (1  << axis) & 3;
-			const int axis2 = (1  << axis1) & 3;
-			
-			// if next edge is maximum remove any overlap between the two handles
-			if (updateOverlaps 
-#ifdef USE_OVERLAP_TEST_ON_REMOVES
-				&& testOverlap2D(handle0,handle1,axis1,axis2)
-#endif //USE_OVERLAP_TEST_ON_REMOVES
-				)
-			{
-				
-
-				m_pairCache->removeOverlappingPair(handle0,handle1,dispatcher);	
-				if (m_userPairCallback)
-					m_userPairCallback->removeOverlappingPair(handle0,handle1,dispatcher);
-				
-			}
-
-
-			// update edge reference in other handle
-			pHandleNext->m_maxEdges[axis]--;
-		}
-		else
-			pHandleNext->m_minEdges[axis]--;
-
-		pHandleEdge->m_minEdges[axis]++;
-
-		// swap the edges
-		Edge swap = *pEdge;
-		*pEdge = *pNext;
-		*pNext = swap;
-
-		// increment
-		pEdge++;
-		pNext++;
-	}
-
-
-}
-
-// sorting a max edge downwards can only ever *remove* overlaps
-template <typename BP_FP_INT_TYPE>
-void btAxisSweep3Internal<BP_FP_INT_TYPE>::sortMaxDown(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps)
-{
-
-	Edge* pEdge = m_pEdges[axis] + edge;
-	Edge* pPrev = pEdge - 1;
-	Handle* pHandleEdge = getHandle(pEdge->m_handle);
-
-	while (pEdge->m_pos < pPrev->m_pos)
-	{
-		Handle* pHandlePrev = getHandle(pPrev->m_handle);
-
-		if (!pPrev->IsMax())
-		{
-			// if previous edge was a minimum remove any overlap between the two handles
-			Handle* handle0 = getHandle(pEdge->m_handle);
-			Handle* handle1 = getHandle(pPrev->m_handle);
-			const int axis1 = (1  << axis) & 3;
-			const int axis2 = (1  << axis1) & 3;
-
-			if (updateOverlaps  
-#ifdef USE_OVERLAP_TEST_ON_REMOVES
-				&& testOverlap2D(handle0,handle1,axis1,axis2)
-#endif //USE_OVERLAP_TEST_ON_REMOVES
-				)
-			{
-				//this is done during the overlappingpairarray iteration/narrowphase collision
-
-				
-				m_pairCache->removeOverlappingPair(handle0,handle1,dispatcher);
-				if (m_userPairCallback)
-					m_userPairCallback->removeOverlappingPair(handle0,handle1,dispatcher);
-			
-
-
-			}
-
-			// update edge reference in other handle
-			pHandlePrev->m_minEdges[axis]++;;
-		}
-		else
-			pHandlePrev->m_maxEdges[axis]++;
-
-		pHandleEdge->m_maxEdges[axis]--;
-
-		// swap the edges
-		Edge swap = *pEdge;
-		*pEdge = *pPrev;
-		*pPrev = swap;
-
-		// decrement
-		pEdge--;
-		pPrev--;
-	}
-
-	
-#ifdef DEBUG_BROADPHASE
-	debugPrintAxis(axis);
-#endif //DEBUG_BROADPHASE
-
-}
-
-// sorting a max edge upwards can only ever *add* overlaps
-template <typename BP_FP_INT_TYPE>
-void btAxisSweep3Internal<BP_FP_INT_TYPE>::sortMaxUp(int axis, BP_FP_INT_TYPE edge, btDispatcher* /* dispatcher */, bool updateOverlaps)
-{
-	Edge* pEdge = m_pEdges[axis] + edge;
-	Edge* pNext = pEdge + 1;
-	Handle* pHandleEdge = getHandle(pEdge->m_handle);
-
-	while (pNext->m_handle && (pEdge->m_pos >= pNext->m_pos))
-	{
-		Handle* pHandleNext = getHandle(pNext->m_handle);
-
-		const int axis1 = (1  << axis) & 3;
-		const int axis2 = (1  << axis1) & 3;
-
-		if (!pNext->IsMax())
-		{
-			// if next edge is a minimum check the bounds and add an overlap if necessary
-			if (updateOverlaps && testOverlap2D(pHandleEdge, pHandleNext,axis1,axis2))
-			{
-				Handle* handle0 = getHandle(pEdge->m_handle);
-				Handle* handle1 = getHandle(pNext->m_handle);
-				m_pairCache->addOverlappingPair(handle0,handle1);
-				if (m_userPairCallback)
-					m_userPairCallback->addOverlappingPair(handle0,handle1);
-			}
-
-			// update edge reference in other handle
-			pHandleNext->m_minEdges[axis]--;
-		}
-		else
-			pHandleNext->m_maxEdges[axis]--;
-
-		pHandleEdge->m_maxEdges[axis]++;
-
-		// swap the edges
-		Edge swap = *pEdge;
-		*pEdge = *pNext;
-		*pNext = swap;
-
-		// increment
-		pEdge++;
-		pNext++;
-	}
-	
-}
-
-
-
-////////////////////////////////////////////////////////////////////
-
-
-/// The btAxisSweep3 is an efficient implementation of the 3d axis sweep and prune broadphase.
-/// It uses arrays rather then lists for storage of the 3 axis. Also it operates using 16 bit integer coordinates instead of floats.
-/// For large worlds and many objects, use bt32BitAxisSweep3 or btDbvtBroadphase instead. bt32BitAxisSweep3 has higher precision and allows more then 16384 objects at the cost of more memory and bit of performance.
-class btAxisSweep3 : public btAxisSweep3Internal<unsigned short int>
-{
-public:
-
-	btAxisSweep3(const btVector3& worldAabbMin,const btVector3& worldAabbMax, unsigned short int maxHandles = 16384, btOverlappingPairCache* pairCache = 0, bool disableRaycastAccelerator = false);
-
-};
-
-/// The bt32BitAxisSweep3 allows higher precision quantization and more objects compared to the btAxisSweep3 sweep and prune.
-/// This comes at the cost of more memory per handle, and a bit slower performance.
-/// It uses arrays rather then lists for storage of the 3 axis.
-class bt32BitAxisSweep3 : public btAxisSweep3Internal<unsigned int>
-{
-public:
-
-	bt32BitAxisSweep3(const btVector3& worldAabbMin,const btVector3& worldAabbMax, unsigned int maxHandles = 1500000, btOverlappingPairCache* pairCache = 0, bool disableRaycastAccelerator = false);
-
-};
-
-#endif
-
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h
deleted file mode 100644
index f1bf005..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef		BT_BROADPHASE_INTERFACE_H
-#define 	BT_BROADPHASE_INTERFACE_H
-
-
-
-struct btDispatcherInfo;
-class btDispatcher;
-#include "btBroadphaseProxy.h"
-
-class btOverlappingPairCache;
-
-
-
-struct	btBroadphaseAabbCallback
-{
-	virtual ~btBroadphaseAabbCallback() {}
-	virtual bool	process(const btBroadphaseProxy* proxy) = 0;
-};
-
-
-struct	btBroadphaseRayCallback : public btBroadphaseAabbCallback
-{
-	///added some cached data to accelerate ray-AABB tests
-	btVector3		m_rayDirectionInverse;
-	unsigned int	m_signs[3];
-	btScalar		m_lambda_max;
-
-	virtual ~btBroadphaseRayCallback() {}
-};
-
-#include "LinearMath/btVector3.h"
-
-///The btBroadphaseInterface class provides an interface to detect aabb-overlapping object pairs.
-///Some implementations for this broadphase interface include btAxisSweep3, bt32BitAxisSweep3 and btDbvtBroadphase.
-///The actual overlapping pair management, storage, adding and removing of pairs is dealt by the btOverlappingPairCache class.
-class btBroadphaseInterface
-{
-public:
-	virtual ~btBroadphaseInterface() {}
-
-	virtual btBroadphaseProxy*	createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher,void* multiSapProxy) =0;
-	virtual void	destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher)=0;
-	virtual void	setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher)=0;
-	virtual void	getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const =0;
-
-	virtual void	rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0), const btVector3& aabbMax = btVector3(0,0,0)) = 0;
-
-	virtual void	aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback) = 0;
-
-	///calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb
-	virtual void	calculateOverlappingPairs(btDispatcher* dispatcher)=0;
-
-	virtual	btOverlappingPairCache*	getOverlappingPairCache()=0;
-	virtual	const btOverlappingPairCache*	getOverlappingPairCache() const =0;
-
-	///getAabb returns the axis aligned bounding box in the 'global' coordinate frame
-	///will add some transform later
-	virtual void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const =0;
-
-	///reset broadphase internal structures, to ensure determinism/reproducability
-	virtual void resetPool(btDispatcher* dispatcher) { (void) dispatcher; };
-
-	virtual void	printStats() = 0;
-
-};
-
-#endif //BT_BROADPHASE_INTERFACE_H
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp
deleted file mode 100644
index f4d7341..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btBroadphaseProxy.h"
-
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h
deleted file mode 100644
index 32e8f03..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_BROADPHASE_PROXY_H
-#define BT_BROADPHASE_PROXY_H
-
-#include "LinearMath/btScalar.h" //for SIMD_FORCE_INLINE
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btAlignedAllocator.h"
-
-
-/// btDispatcher uses these types
-/// IMPORTANT NOTE:The types are ordered polyhedral, implicit convex and concave
-/// to facilitate type checking
-/// CUSTOM_POLYHEDRAL_SHAPE_TYPE,CUSTOM_CONVEX_SHAPE_TYPE and CUSTOM_CONCAVE_SHAPE_TYPE can be used to extend Bullet without modifying source code
-enum BroadphaseNativeTypes
-{
-	// polyhedral convex shapes
-	BOX_SHAPE_PROXYTYPE,
-	TRIANGLE_SHAPE_PROXYTYPE,
-	TETRAHEDRAL_SHAPE_PROXYTYPE,
-	CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE,
-	CONVEX_HULL_SHAPE_PROXYTYPE,
-	CONVEX_POINT_CLOUD_SHAPE_PROXYTYPE,
-	CUSTOM_POLYHEDRAL_SHAPE_TYPE,
-//implicit convex shapes
-IMPLICIT_CONVEX_SHAPES_START_HERE,
-	SPHERE_SHAPE_PROXYTYPE,
-	MULTI_SPHERE_SHAPE_PROXYTYPE,
-	CAPSULE_SHAPE_PROXYTYPE,
-	CONE_SHAPE_PROXYTYPE,
-	CONVEX_SHAPE_PROXYTYPE,
-	CYLINDER_SHAPE_PROXYTYPE,
-	UNIFORM_SCALING_SHAPE_PROXYTYPE,
-	MINKOWSKI_SUM_SHAPE_PROXYTYPE,
-	MINKOWSKI_DIFFERENCE_SHAPE_PROXYTYPE,
-	BOX_2D_SHAPE_PROXYTYPE,
-	CONVEX_2D_SHAPE_PROXYTYPE,
-	CUSTOM_CONVEX_SHAPE_TYPE,
-//concave shapes
-CONCAVE_SHAPES_START_HERE,
-	//keep all the convex shapetype below here, for the check IsConvexShape in broadphase proxy!
-	TRIANGLE_MESH_SHAPE_PROXYTYPE,
-	SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE,
-	///used for demo integration FAST/Swift collision library and Bullet
-	FAST_CONCAVE_MESH_PROXYTYPE,
-	//terrain
-	TERRAIN_SHAPE_PROXYTYPE,
-///Used for GIMPACT Trimesh integration
-	GIMPACT_SHAPE_PROXYTYPE,
-///Multimaterial mesh
-    MULTIMATERIAL_TRIANGLE_MESH_PROXYTYPE,
-	
-	EMPTY_SHAPE_PROXYTYPE,
-	STATIC_PLANE_PROXYTYPE,
-	CUSTOM_CONCAVE_SHAPE_TYPE,
-CONCAVE_SHAPES_END_HERE,
-
-	COMPOUND_SHAPE_PROXYTYPE,
-
-	SOFTBODY_SHAPE_PROXYTYPE,
-	HFFLUID_SHAPE_PROXYTYPE,
-	HFFLUID_BUOYANT_CONVEX_SHAPE_PROXYTYPE,
-	INVALID_SHAPE_PROXYTYPE,
-
-	MAX_BROADPHASE_COLLISION_TYPES
-	
-};
-
-
-///The btBroadphaseProxy is the main class that can be used with the Bullet broadphases. 
-///It stores collision shape type information, collision filter information and a client object, typically a btCollisionObject or btRigidBody.
-ATTRIBUTE_ALIGNED16(struct) btBroadphaseProxy
-{
-
-BT_DECLARE_ALIGNED_ALLOCATOR();
-	
-	///optional filtering to cull potential collisions
-	enum CollisionFilterGroups
-	{
-	        DefaultFilter = 1,
-	        StaticFilter = 2,
-	        KinematicFilter = 4,
-	        DebrisFilter = 8,
-			SensorTrigger = 16,
-			CharacterFilter = 32,
-	        AllFilter = -1 //all bits sets: DefaultFilter | StaticFilter | KinematicFilter | DebrisFilter | SensorTrigger
-	};
-
-	//Usually the client btCollisionObject or Rigidbody class
-	void*	m_clientObject;
-	short int m_collisionFilterGroup;
-	short int m_collisionFilterMask;
-	void*	m_multiSapParentProxy;		
-	int			m_uniqueId;//m_uniqueId is introduced for paircache. could get rid of this, by calculating the address offset etc.
-
-	btVector3	m_aabbMin;
-	btVector3	m_aabbMax;
-
-	SIMD_FORCE_INLINE int getUid() const
-	{
-		return m_uniqueId;
-	}
-
-	//used for memory pools
-	btBroadphaseProxy() :m_clientObject(0),m_multiSapParentProxy(0)
-	{
-	}
-
-	btBroadphaseProxy(const btVector3& aabbMin,const btVector3& aabbMax,void* userPtr,short int collisionFilterGroup, short int collisionFilterMask,void* multiSapParentProxy=0)
-		:m_clientObject(userPtr),
-		m_collisionFilterGroup(collisionFilterGroup),
-		m_collisionFilterMask(collisionFilterMask),
-		m_aabbMin(aabbMin),
-		m_aabbMax(aabbMax)
-	{
-		m_multiSapParentProxy = multiSapParentProxy;
-	}
-
-	
-
-	static SIMD_FORCE_INLINE bool isPolyhedral(int proxyType)
-	{
-		return (proxyType  < IMPLICIT_CONVEX_SHAPES_START_HERE);
-	}
-
-	static SIMD_FORCE_INLINE bool	isConvex(int proxyType)
-	{
-		return (proxyType < CONCAVE_SHAPES_START_HERE);
-	}
-
-	static SIMD_FORCE_INLINE bool	isNonMoving(int proxyType)
-	{
-		return (isConcave(proxyType) && !(proxyType==GIMPACT_SHAPE_PROXYTYPE));
-	}
-
-	static SIMD_FORCE_INLINE bool	isConcave(int proxyType)
-	{
-		return ((proxyType > CONCAVE_SHAPES_START_HERE) &&
-			(proxyType < CONCAVE_SHAPES_END_HERE));
-	}
-	static SIMD_FORCE_INLINE bool	isCompound(int proxyType)
-	{
-		return (proxyType == COMPOUND_SHAPE_PROXYTYPE);
-	}
-
-	static SIMD_FORCE_INLINE bool	isSoftBody(int proxyType)
-	{
-		return (proxyType == SOFTBODY_SHAPE_PROXYTYPE);
-	}
-
-	static SIMD_FORCE_INLINE bool isInfinite(int proxyType)
-	{
-		return (proxyType == STATIC_PLANE_PROXYTYPE);
-	}
-
-	static SIMD_FORCE_INLINE bool isConvex2d(int proxyType)
-	{
-		return (proxyType == BOX_2D_SHAPE_PROXYTYPE) ||	(proxyType == CONVEX_2D_SHAPE_PROXYTYPE);
-	}
-
-	
-}
-;
-
-class btCollisionAlgorithm;
-
-struct btBroadphaseProxy;
-
-
-
-///The btBroadphasePair class contains a pair of aabb-overlapping objects.
-///A btDispatcher can search a btCollisionAlgorithm that performs exact/narrowphase collision detection on the actual collision shapes.
-ATTRIBUTE_ALIGNED16(struct) btBroadphasePair
-{
-	btBroadphasePair ()
-		:
-	m_pProxy0(0),
-		m_pProxy1(0),
-		m_algorithm(0),
-		m_internalInfo1(0)
-	{
-	}
-
-BT_DECLARE_ALIGNED_ALLOCATOR();
-
-	btBroadphasePair(const btBroadphasePair& other)
-		:		m_pProxy0(other.m_pProxy0),
-				m_pProxy1(other.m_pProxy1),
-				m_algorithm(other.m_algorithm),
-				m_internalInfo1(other.m_internalInfo1)
-	{
-	}
-	btBroadphasePair(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1)
-	{
-
-		//keep them sorted, so the std::set operations work
-		if (proxy0.m_uniqueId < proxy1.m_uniqueId)
-        { 
-            m_pProxy0 = &proxy0; 
-            m_pProxy1 = &proxy1; 
-        }
-        else 
-        { 
-			m_pProxy0 = &proxy1; 
-            m_pProxy1 = &proxy0; 
-        }
-
-		m_algorithm = 0;
-		m_internalInfo1 = 0;
-
-	}
-	
-	btBroadphaseProxy* m_pProxy0;
-	btBroadphaseProxy* m_pProxy1;
-	
-	mutable btCollisionAlgorithm* m_algorithm;
-	union { void* m_internalInfo1; int m_internalTmpValue;};//don't use this data, it will be removed in future version.
-
-};
-
-/*
-//comparison for set operation, see Solid DT_Encounter
-SIMD_FORCE_INLINE bool operator<(const btBroadphasePair& a, const btBroadphasePair& b) 
-{ 
-    return a.m_pProxy0 < b.m_pProxy0 || 
-        (a.m_pProxy0 == b.m_pProxy0 && a.m_pProxy1 < b.m_pProxy1); 
-}
-*/
-
-
-
-class btBroadphasePairSortPredicate
-{
-	public:
-
-		bool operator() ( const btBroadphasePair& a, const btBroadphasePair& b )
-		{
-			const int uidA0 = a.m_pProxy0 ? a.m_pProxy0->m_uniqueId : -1;
-			const int uidB0 = b.m_pProxy0 ? b.m_pProxy0->m_uniqueId : -1;
-			const int uidA1 = a.m_pProxy1 ? a.m_pProxy1->m_uniqueId : -1;
-			const int uidB1 = b.m_pProxy1 ? b.m_pProxy1->m_uniqueId : -1;
-
-			 return uidA0 > uidB0 || 
-				(a.m_pProxy0 == b.m_pProxy0 && uidA1 > uidB1) ||
-				(a.m_pProxy0 == b.m_pProxy0 && a.m_pProxy1 == b.m_pProxy1 && a.m_algorithm > b.m_algorithm); 
-		}
-};
-
-
-SIMD_FORCE_INLINE bool operator==(const btBroadphasePair& a, const btBroadphasePair& b) 
-{
-	 return (a.m_pProxy0 == b.m_pProxy0) && (a.m_pProxy1 == b.m_pProxy1);
-}
-
-
-#endif //BT_BROADPHASE_PROXY_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp
deleted file mode 100644
index c95d1be..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btCollisionAlgorithm.h"
-#include "btDispatcher.h"
-
-btCollisionAlgorithm::btCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci)
-{
-	m_dispatcher = ci.m_dispatcher1;
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h
deleted file mode 100644
index 36eec97..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_COLLISION_ALGORITHM_H
-#define BT_COLLISION_ALGORITHM_H
-
-#include "LinearMath/btScalar.h"
-#include "LinearMath/btAlignedObjectArray.h"
-
-struct btBroadphaseProxy;
-class btDispatcher;
-class btManifoldResult;
-class btCollisionObject;
-struct btDispatcherInfo;
-class	btPersistentManifold;
-
-typedef btAlignedObjectArray<btPersistentManifold*>	btManifoldArray;
-
-struct btCollisionAlgorithmConstructionInfo
-{
-	btCollisionAlgorithmConstructionInfo()
-		:m_dispatcher1(0),
-		m_manifold(0)
-	{
-	}
-	btCollisionAlgorithmConstructionInfo(btDispatcher* dispatcher,int temp)
-		:m_dispatcher1(dispatcher)
-	{
-		(void)temp;
-	}
-
-	btDispatcher*	m_dispatcher1;
-	btPersistentManifold*	m_manifold;
-
-//	int	getDispatcherId();
-
-};
-
-
-///btCollisionAlgorithm is an collision interface that is compatible with the Broadphase and btDispatcher.
-///It is persistent over frames
-class btCollisionAlgorithm
-{
-
-protected:
-
-	btDispatcher*	m_dispatcher;
-
-protected:
-//	int	getDispatcherId();
-	
-public:
-
-	btCollisionAlgorithm() {};
-
-	btCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci);
-
-	virtual ~btCollisionAlgorithm() {};
-
-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) = 0;
-
-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) = 0;
-
-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray) = 0;
-};
-
-
-#endif //BT_COLLISION_ALGORITHM_H
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvt.cpp b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvt.cpp
deleted file mode 100644
index 95443af..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvt.cpp
+++ /dev/null
@@ -1,1295 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-///btDbvt implementation by Nathanael Presson
-
-#include "btDbvt.h"
-
-//
-typedef btAlignedObjectArray<btDbvtNode*>			tNodeArray;
-typedef btAlignedObjectArray<const btDbvtNode*>	tConstNodeArray;
-
-//
-struct btDbvtNodeEnumerator : btDbvt::ICollide
-{
-	tConstNodeArray	nodes;
-	void Process(const btDbvtNode* n) { nodes.push_back(n); }
-};
-
-//
-static DBVT_INLINE int			indexof(const btDbvtNode* node)
-{
-	return(node->parent->childs[1]==node);
-}
-
-//
-static DBVT_INLINE btDbvtVolume	merge(	const btDbvtVolume& a,
-									  const btDbvtVolume& b)
-{
-#if (DBVT_MERGE_IMPL==DBVT_IMPL_SSE)
-	ATTRIBUTE_ALIGNED16(char locals[sizeof(btDbvtAabbMm)]);
-	btDbvtVolume&	res=*(btDbvtVolume*)locals;
-#else
-		btDbvtVolume	res;
-#endif
-	Merge(a,b,res);
-	return(res);
-}
-
-// volume+edge lengths
-static DBVT_INLINE btScalar		size(const btDbvtVolume& a)
-{
-	const btVector3	edges=a.Lengths();
-	return(	edges.x()*edges.y()*edges.z()+
-		edges.x()+edges.y()+edges.z());
-}
-
-//
-static void						getmaxdepth(const btDbvtNode* node,int depth,int& maxdepth)
-{
-	if(node->isinternal())
-	{
-		getmaxdepth(node->childs[0],depth+1,maxdepth);
-		getmaxdepth(node->childs[1],depth+1,maxdepth);
-	} else maxdepth=btMax(maxdepth,depth);
-}
-
-//
-static DBVT_INLINE void			deletenode(	btDbvt* pdbvt,
-										   btDbvtNode* node)
-{
-	btAlignedFree(pdbvt->m_free);
-	pdbvt->m_free=node;
-}
-
-//
-static void						recursedeletenode(	btDbvt* pdbvt,
-												  btDbvtNode* node)
-{
-	if(!node->isleaf())
-	{
-		recursedeletenode(pdbvt,node->childs[0]);
-		recursedeletenode(pdbvt,node->childs[1]);
-	}
-	if(node==pdbvt->m_root) pdbvt->m_root=0;
-	deletenode(pdbvt,node);
-}
-
-//
-static DBVT_INLINE btDbvtNode*	createnode(	btDbvt* pdbvt,
-										   btDbvtNode* parent,
-										   void* data)
-{
-	btDbvtNode*	node;
-	if(pdbvt->m_free)
-	{ node=pdbvt->m_free;pdbvt->m_free=0; }
-	else
-	{ node=new(btAlignedAlloc(sizeof(btDbvtNode),16)) btDbvtNode(); }
-	node->parent	=	parent;
-	node->data		=	data;
-	node->childs[1]	=	0;
-	return(node);
-}
-
-//
-static DBVT_INLINE btDbvtNode*	createnode(	btDbvt* pdbvt,
-										   btDbvtNode* parent,
-										   const btDbvtVolume& volume,
-										   void* data)
-{
-	btDbvtNode*	node=createnode(pdbvt,parent,data);
-	node->volume=volume;
-	return(node);
-}
-
-//
-static DBVT_INLINE btDbvtNode*	createnode(	btDbvt* pdbvt,
-										   btDbvtNode* parent,
-										   const btDbvtVolume& volume0,
-										   const btDbvtVolume& volume1,
-										   void* data)
-{
-	btDbvtNode*	node=createnode(pdbvt,parent,data);
-	Merge(volume0,volume1,node->volume);
-	return(node);
-}
-
-//
-static void						insertleaf(	btDbvt* pdbvt,
-										   btDbvtNode* root,
-										   btDbvtNode* leaf)
-{
-	if(!pdbvt->m_root)
-	{
-		pdbvt->m_root	=	leaf;
-		leaf->parent	=	0;
-	}
-	else
-	{
-		if(!root->isleaf())
-		{
-			do	{
-				root=root->childs[Select(	leaf->volume,
-					root->childs[0]->volume,
-					root->childs[1]->volume)];
-			} while(!root->isleaf());
-		}
-		btDbvtNode*	prev=root->parent;
-		btDbvtNode*	node=createnode(pdbvt,prev,leaf->volume,root->volume,0);
-		if(prev)
-		{
-			prev->childs[indexof(root)]	=	node;
-			node->childs[0]				=	root;root->parent=node;
-			node->childs[1]				=	leaf;leaf->parent=node;
-			do	{
-				if(!prev->volume.Contain(node->volume))
-					Merge(prev->childs[0]->volume,prev->childs[1]->volume,prev->volume);
-				else
-					break;
-				node=prev;
-			} while(0!=(prev=node->parent));
-		}
-		else
-		{
-			node->childs[0]	=	root;root->parent=node;
-			node->childs[1]	=	leaf;leaf->parent=node;
-			pdbvt->m_root	=	node;
-		}
-	}
-}
-
-//
-static btDbvtNode*				removeleaf(	btDbvt* pdbvt,
-										   btDbvtNode* leaf)
-{
-	if(leaf==pdbvt->m_root)
-	{
-		pdbvt->m_root=0;
-		return(0);
-	}
-	else
-	{
-		btDbvtNode*	parent=leaf->parent;
-		btDbvtNode*	prev=parent->parent;
-		btDbvtNode*	sibling=parent->childs[1-indexof(leaf)];			
-		if(prev)
-		{
-			prev->childs[indexof(parent)]=sibling;
-			sibling->parent=prev;
-			deletenode(pdbvt,parent);
-			while(prev)
-			{
-				const btDbvtVolume	pb=prev->volume;
-				Merge(prev->childs[0]->volume,prev->childs[1]->volume,prev->volume);
-				if(NotEqual(pb,prev->volume))
-				{
-					prev=prev->parent;
-				} else break;
-			}
-			return(prev?prev:pdbvt->m_root);
-		}
-		else
-		{								
-			pdbvt->m_root=sibling;
-			sibling->parent=0;
-			deletenode(pdbvt,parent);
-			return(pdbvt->m_root);
-		}			
-	}
-}
-
-//
-static void						fetchleaves(btDbvt* pdbvt,
-											btDbvtNode* root,
-											tNodeArray& leaves,
-											int depth=-1)
-{
-	if(root->isinternal()&&depth)
-	{
-		fetchleaves(pdbvt,root->childs[0],leaves,depth-1);
-		fetchleaves(pdbvt,root->childs[1],leaves,depth-1);
-		deletenode(pdbvt,root);
-	}
-	else
-	{
-		leaves.push_back(root);
-	}
-}
-
-//
-static void						split(	const tNodeArray& leaves,
-									  tNodeArray& left,
-									  tNodeArray& right,
-									  const btVector3& org,
-									  const btVector3& axis)
-{
-	left.resize(0);
-	right.resize(0);
-	for(int i=0,ni=leaves.size();i<ni;++i)
-	{
-		if(btDot(axis,leaves[i]->volume.Center()-org)<0)
-			left.push_back(leaves[i]);
-		else
-			right.push_back(leaves[i]);
-	}
-}
-
-//
-static btDbvtVolume				bounds(	const tNodeArray& leaves)
-{
-#if DBVT_MERGE_IMPL==DBVT_IMPL_SSE
-	ATTRIBUTE_ALIGNED16(char	locals[sizeof(btDbvtVolume)]);
-	btDbvtVolume&	volume=*(btDbvtVolume*)locals;
-	volume=leaves[0]->volume;
-#else
-	btDbvtVolume volume=leaves[0]->volume;
-#endif
-	for(int i=1,ni=leaves.size();i<ni;++i)
-	{
-		Merge(volume,leaves[i]->volume,volume);
-	}
-	return(volume);
-}
-
-//
-static void						bottomup(	btDbvt* pdbvt,
-										 tNodeArray& leaves)
-{
-	while(leaves.size()>1)
-	{
-		btScalar	minsize=SIMD_INFINITY;
-		int			minidx[2]={-1,-1};
-		for(int i=0;i<leaves.size();++i)
-		{
-			for(int j=i+1;j<leaves.size();++j)
-			{
-				const btScalar	sz=size(merge(leaves[i]->volume,leaves[j]->volume));
-				if(sz<minsize)
-				{
-					minsize		=	sz;
-					minidx[0]	=	i;
-					minidx[1]	=	j;
-				}
-			}
-		}
-		btDbvtNode*	n[]	=	{leaves[minidx[0]],leaves[minidx[1]]};
-		btDbvtNode*	p	=	createnode(pdbvt,0,n[0]->volume,n[1]->volume,0);
-		p->childs[0]		=	n[0];
-		p->childs[1]		=	n[1];
-		n[0]->parent		=	p;
-		n[1]->parent		=	p;
-		leaves[minidx[0]]	=	p;
-		leaves.swap(minidx[1],leaves.size()-1);
-		leaves.pop_back();
-	}
-}
-
-//
-static btDbvtNode*			topdown(btDbvt* pdbvt,
-									tNodeArray& leaves,
-									int bu_treshold)
-{
-	static const btVector3	axis[]={btVector3(1,0,0),
-		btVector3(0,1,0),
-		btVector3(0,0,1)};
-	if(leaves.size()>1)
-	{
-		if(leaves.size()>bu_treshold)
-		{
-			const btDbvtVolume	vol=bounds(leaves);
-			const btVector3			org=vol.Center();
-			tNodeArray				sets[2];
-			int						bestaxis=-1;
-			int						bestmidp=leaves.size();
-			int						splitcount[3][2]={{0,0},{0,0},{0,0}};
-			int i;
-			for( i=0;i<leaves.size();++i)
-			{
-				const btVector3	x=leaves[i]->volume.Center()-org;
-				for(int j=0;j<3;++j)
-				{
-					++splitcount[j][btDot(x,axis[j])>0?1:0];
-				}
-			}
-			for( i=0;i<3;++i)
-			{
-				if((splitcount[i][0]>0)&&(splitcount[i][1]>0))
-				{
-					const int	midp=(int)btFabs(btScalar(splitcount[i][0]-splitcount[i][1]));
-					if(midp<bestmidp)
-					{
-						bestaxis=i;
-						bestmidp=midp;
-					}
-				}
-			}
-			if(bestaxis>=0)
-			{
-				sets[0].reserve(splitcount[bestaxis][0]);
-				sets[1].reserve(splitcount[bestaxis][1]);
-				split(leaves,sets[0],sets[1],org,axis[bestaxis]);
-			}
-			else
-			{
-				sets[0].reserve(leaves.size()/2+1);
-				sets[1].reserve(leaves.size()/2);
-				for(int i=0,ni=leaves.size();i<ni;++i)
-				{
-					sets[i&1].push_back(leaves[i]);
-				}
-			}
-			btDbvtNode*	node=createnode(pdbvt,0,vol,0);
-			node->childs[0]=topdown(pdbvt,sets[0],bu_treshold);
-			node->childs[1]=topdown(pdbvt,sets[1],bu_treshold);
-			node->childs[0]->parent=node;
-			node->childs[1]->parent=node;
-			return(node);
-		}
-		else
-		{
-			bottomup(pdbvt,leaves);
-			return(leaves[0]);
-		}
-	}
-	return(leaves[0]);
-}
-
-//
-static DBVT_INLINE btDbvtNode*	sort(btDbvtNode* n,btDbvtNode*& r)
-{
-	btDbvtNode*	p=n->parent;
-	btAssert(n->isinternal());
-	if(p>n)
-	{
-		const int		i=indexof(n);
-		const int		j=1-i;
-		btDbvtNode*	s=p->childs[j];
-		btDbvtNode*	q=p->parent;
-		btAssert(n==p->childs[i]);
-		if(q) q->childs[indexof(p)]=n; else r=n;
-		s->parent=n;
-		p->parent=n;
-		n->parent=q;
-		p->childs[0]=n->childs[0];
-		p->childs[1]=n->childs[1];
-		n->childs[0]->parent=p;
-		n->childs[1]->parent=p;
-		n->childs[i]=p;
-		n->childs[j]=s;
-		btSwap(p->volume,n->volume);
-		return(p);
-	}
-	return(n);
-}
-
-#if 0
-static DBVT_INLINE btDbvtNode*	walkup(btDbvtNode* n,int count)
-{
-	while(n&&(count--)) n=n->parent;
-	return(n);
-}
-#endif
-
-//
-// Api
-//
-
-//
-btDbvt::btDbvt()
-{
-	m_root		=	0;
-	m_free		=	0;
-	m_lkhd		=	-1;
-	m_leaves	=	0;
-	m_opath		=	0;
-}
-
-//
-btDbvt::~btDbvt()
-{
-	clear();
-}
-
-//
-void			btDbvt::clear()
-{
-	if(m_root)	
-		recursedeletenode(this,m_root);
-	btAlignedFree(m_free);
-	m_free=0;
-	m_lkhd		=	-1;
-	m_stkStack.clear();
-	m_opath		=	0;
-	
-}
-
-//
-void			btDbvt::optimizeBottomUp()
-{
-	if(m_root)
-	{
-		tNodeArray leaves;
-		leaves.reserve(m_leaves);
-		fetchleaves(this,m_root,leaves);
-		bottomup(this,leaves);
-		m_root=leaves[0];
-	}
-}
-
-//
-void			btDbvt::optimizeTopDown(int bu_treshold)
-{
-	if(m_root)
-	{
-		tNodeArray	leaves;
-		leaves.reserve(m_leaves);
-		fetchleaves(this,m_root,leaves);
-		m_root=topdown(this,leaves,bu_treshold);
-	}
-}
-
-//
-void			btDbvt::optimizeIncremental(int passes)
-{
-	if(passes<0) passes=m_leaves;
-	if(m_root&&(passes>0))
-	{
-		do	{
-			btDbvtNode*		node=m_root;
-			unsigned	bit=0;
-			while(node->isinternal())
-			{
-				node=sort(node,m_root)->childs[(m_opath>>bit)&1];
-				bit=(bit+1)&(sizeof(unsigned)*8-1);
-			}
-			update(node);
-			++m_opath;
-		} while(--passes);
-	}
-}
-
-//
-btDbvtNode*	btDbvt::insert(const btDbvtVolume& volume,void* data)
-{
-	btDbvtNode*	leaf=createnode(this,0,volume,data);
-	insertleaf(this,m_root,leaf);
-	++m_leaves;
-	return(leaf);
-}
-
-//
-void			btDbvt::update(btDbvtNode* leaf,int lookahead)
-{
-	btDbvtNode*	root=removeleaf(this,leaf);
-	if(root)
-	{
-		if(lookahead>=0)
-		{
-			for(int i=0;(i<lookahead)&&root->parent;++i)
-			{
-				root=root->parent;
-			}
-		} else root=m_root;
-	}
-	insertleaf(this,root,leaf);
-}
-
-//
-void			btDbvt::update(btDbvtNode* leaf,btDbvtVolume& volume)
-{
-	btDbvtNode*	root=removeleaf(this,leaf);
-	if(root)
-	{
-		if(m_lkhd>=0)
-		{
-			for(int i=0;(i<m_lkhd)&&root->parent;++i)
-			{
-				root=root->parent;
-			}
-		} else root=m_root;
-	}
-	leaf->volume=volume;
-	insertleaf(this,root,leaf);
-}
-
-//
-bool			btDbvt::update(btDbvtNode* leaf,btDbvtVolume& volume,const btVector3& velocity,btScalar margin)
-{
-	if(leaf->volume.Contain(volume)) return(false);
-	volume.Expand(btVector3(margin,margin,margin));
-	volume.SignedExpand(velocity);
-	update(leaf,volume);
-	return(true);
-}
-
-//
-bool			btDbvt::update(btDbvtNode* leaf,btDbvtVolume& volume,const btVector3& velocity)
-{
-	if(leaf->volume.Contain(volume)) return(false);
-	volume.SignedExpand(velocity);
-	update(leaf,volume);
-	return(true);
-}
-
-//
-bool			btDbvt::update(btDbvtNode* leaf,btDbvtVolume& volume,btScalar margin)
-{
-	if(leaf->volume.Contain(volume)) return(false);
-	volume.Expand(btVector3(margin,margin,margin));
-	update(leaf,volume);
-	return(true);
-}
-
-//
-void			btDbvt::remove(btDbvtNode* leaf)
-{
-	removeleaf(this,leaf);
-	deletenode(this,leaf);
-	--m_leaves;
-}
-
-//
-void			btDbvt::write(IWriter* iwriter) const
-{
-	btDbvtNodeEnumerator	nodes;
-	nodes.nodes.reserve(m_leaves*2);
-	enumNodes(m_root,nodes);
-	iwriter->Prepare(m_root,nodes.nodes.size());
-	for(int i=0;i<nodes.nodes.size();++i)
-	{
-		const btDbvtNode* n=nodes.nodes[i];
-		int			p=-1;
-		if(n->parent) p=nodes.nodes.findLinearSearch(n->parent);
-		if(n->isinternal())
-		{
-			const int	c0=nodes.nodes.findLinearSearch(n->childs[0]);
-			const int	c1=nodes.nodes.findLinearSearch(n->childs[1]);
-			iwriter->WriteNode(n,i,p,c0,c1);
-		}
-		else
-		{
-			iwriter->WriteLeaf(n,i,p);
-		}	
-	}
-}
-
-//
-void			btDbvt::clone(btDbvt& dest,IClone* iclone) const
-{
-	dest.clear();
-	if(m_root!=0)
-	{	
-		btAlignedObjectArray<sStkCLN>	stack;
-		stack.reserve(m_leaves);
-		stack.push_back(sStkCLN(m_root,0));
-		do	{
-			const int		i=stack.size()-1;
-			const sStkCLN	e=stack[i];
-			btDbvtNode*			n=createnode(&dest,e.parent,e.node->volume,e.node->data);
-			stack.pop_back();
-			if(e.parent!=0)
-				e.parent->childs[i&1]=n;
-			else
-				dest.m_root=n;
-			if(e.node->isinternal())
-			{
-				stack.push_back(sStkCLN(e.node->childs[0],n));
-				stack.push_back(sStkCLN(e.node->childs[1],n));
-			}
-			else
-			{
-				iclone->CloneLeaf(n);
-			}
-		} while(stack.size()>0);
-	}
-}
-
-//
-int				btDbvt::maxdepth(const btDbvtNode* node)
-{
-	int	depth=0;
-	if(node) getmaxdepth(node,1,depth);
-	return(depth);
-}
-
-//
-int				btDbvt::countLeaves(const btDbvtNode* node)
-{
-	if(node->isinternal())
-		return(countLeaves(node->childs[0])+countLeaves(node->childs[1]));
-	else
-		return(1);
-}
-
-//
-void			btDbvt::extractLeaves(const btDbvtNode* node,btAlignedObjectArray<const btDbvtNode*>& leaves)
-{
-	if(node->isinternal())
-	{
-		extractLeaves(node->childs[0],leaves);
-		extractLeaves(node->childs[1],leaves);
-	}
-	else
-	{
-		leaves.push_back(node);
-	}	
-}
-
-//
-#if DBVT_ENABLE_BENCHMARK
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "LinearMath/btQuickProf.h"
-
-/*
-q6600,2.4ghz
-
-/Ox /Ob2 /Oi /Ot /I "." /I "..\.." /I "..\..\src" /D "NDEBUG" /D "_LIB" /D "_WINDOWS" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "WIN32"
-/GF /FD /MT /GS- /Gy /arch:SSE2 /Zc:wchar_t- /Fp"..\..\out\release8\build\libbulletcollision\libbulletcollision.pch"
-/Fo"..\..\out\release8\build\libbulletcollision\\"
-/Fd"..\..\out\release8\build\libbulletcollision\bulletcollision.pdb"
-/W3 /nologo /c /Wp64 /Zi /errorReport:prompt
-
-Benchmarking dbvt...
-World scale: 100.000000
-Extents base: 1.000000
-Extents range: 4.000000
-Leaves: 8192
-sizeof(btDbvtVolume): 32 bytes
-sizeof(btDbvtNode):   44 bytes
-[1] btDbvtVolume intersections: 3499 ms (-1%)
-[2] btDbvtVolume merges: 1934 ms (0%)
-[3] btDbvt::collideTT: 5485 ms (-21%)
-[4] btDbvt::collideTT self: 2814 ms (-20%)
-[5] btDbvt::collideTT xform: 7379 ms (-1%)
-[6] btDbvt::collideTT xform,self: 7270 ms (-2%)
-[7] btDbvt::rayTest: 6314 ms (0%),(332143 r/s)
-[8] insert/remove: 2093 ms (0%),(1001983 ir/s)
-[9] updates (teleport): 1879 ms (-3%),(1116100 u/s)
-[10] updates (jitter): 1244 ms (-4%),(1685813 u/s)
-[11] optimize (incremental): 2514 ms (0%),(1668000 o/s)
-[12] btDbvtVolume notequal: 3659 ms (0%)
-[13] culling(OCL+fullsort): 2218 ms (0%),(461 t/s)
-[14] culling(OCL+qsort): 3688 ms (5%),(2221 t/s)
-[15] culling(KDOP+qsort): 1139 ms (-1%),(7192 t/s)
-[16] insert/remove batch(256): 5092 ms (0%),(823704 bir/s)
-[17] btDbvtVolume select: 3419 ms (0%)
-*/
-
-struct btDbvtBenchmark
-{
-	struct NilPolicy : btDbvt::ICollide
-	{
-		NilPolicy() : m_pcount(0),m_depth(-SIMD_INFINITY),m_checksort(true)		{}
-		void	Process(const btDbvtNode*,const btDbvtNode*)				{ ++m_pcount; }
-		void	Process(const btDbvtNode*)									{ ++m_pcount; }
-		void	Process(const btDbvtNode*,btScalar depth)
-		{
-			++m_pcount;
-			if(m_checksort)
-			{ if(depth>=m_depth) m_depth=depth; else printf("wrong depth: %f (should be >= %f)\r\n",depth,m_depth); }
-		}
-		int			m_pcount;
-		btScalar	m_depth;
-		bool		m_checksort;
-	};
-	struct P14 : btDbvt::ICollide
-	{
-		struct Node
-		{
-			const btDbvtNode*	leaf;
-			btScalar			depth;
-		};
-		void Process(const btDbvtNode* leaf,btScalar depth)
-		{
-			Node	n;
-			n.leaf	=	leaf;
-			n.depth	=	depth;
-		}
-		static int sortfnc(const Node& a,const Node& b)
-		{
-			if(a.depth<b.depth) return(+1);
-			if(a.depth>b.depth) return(-1);
-			return(0);
-		}
-		btAlignedObjectArray<Node>		m_nodes;
-	};
-	struct P15 : btDbvt::ICollide
-	{
-		struct Node
-		{
-			const btDbvtNode*	leaf;
-			btScalar			depth;
-		};
-		void Process(const btDbvtNode* leaf)
-		{
-			Node	n;
-			n.leaf	=	leaf;
-			n.depth	=	dot(leaf->volume.Center(),m_axis);
-		}
-		static int sortfnc(const Node& a,const Node& b)
-		{
-			if(a.depth<b.depth) return(+1);
-			if(a.depth>b.depth) return(-1);
-			return(0);
-		}
-		btAlignedObjectArray<Node>		m_nodes;
-		btVector3						m_axis;
-	};
-	static btScalar			RandUnit()
-	{
-		return(rand()/(btScalar)RAND_MAX);
-	}
-	static btVector3		RandVector3()
-	{
-		return(btVector3(RandUnit(),RandUnit(),RandUnit()));
-	}
-	static btVector3		RandVector3(btScalar cs)
-	{
-		return(RandVector3()*cs-btVector3(cs,cs,cs)/2);
-	}
-	static btDbvtVolume	RandVolume(btScalar cs,btScalar eb,btScalar es)
-	{
-		return(btDbvtVolume::FromCE(RandVector3(cs),btVector3(eb,eb,eb)+RandVector3()*es));
-	}
-	static btTransform		RandTransform(btScalar cs)
-	{
-		btTransform	t;
-		t.setOrigin(RandVector3(cs));
-		t.setRotation(btQuaternion(RandUnit()*SIMD_PI*2,RandUnit()*SIMD_PI*2,RandUnit()*SIMD_PI*2).normalized());
-		return(t);
-	}
-	static void				RandTree(btScalar cs,btScalar eb,btScalar es,int leaves,btDbvt& dbvt)
-	{
-		dbvt.clear();
-		for(int i=0;i<leaves;++i)
-		{
-			dbvt.insert(RandVolume(cs,eb,es),0);
-		}
-	}
-};
-
-void			btDbvt::benchmark()
-{
-	static const btScalar	cfgVolumeCenterScale		=	100;
-	static const btScalar	cfgVolumeExentsBase			=	1;
-	static const btScalar	cfgVolumeExentsScale		=	4;
-	static const int		cfgLeaves					=	8192;
-	static const bool		cfgEnable					=	true;
-
-	//[1] btDbvtVolume intersections
-	bool					cfgBenchmark1_Enable		=	cfgEnable;
-	static const int		cfgBenchmark1_Iterations	=	8;
-	static const int		cfgBenchmark1_Reference		=	3499;
-	//[2] btDbvtVolume merges
-	bool					cfgBenchmark2_Enable		=	cfgEnable;
-	static const int		cfgBenchmark2_Iterations	=	4;
-	static const int		cfgBenchmark2_Reference		=	1945;
-	//[3] btDbvt::collideTT
-	bool					cfgBenchmark3_Enable		=	cfgEnable;
-	static const int		cfgBenchmark3_Iterations	=	512;
-	static const int		cfgBenchmark3_Reference		=	5485;
-	//[4] btDbvt::collideTT self
-	bool					cfgBenchmark4_Enable		=	cfgEnable;
-	static const int		cfgBenchmark4_Iterations	=	512;
-	static const int		cfgBenchmark4_Reference		=	2814;
-	//[5] btDbvt::collideTT xform
-	bool					cfgBenchmark5_Enable		=	cfgEnable;
-	static const int		cfgBenchmark5_Iterations	=	512;
-	static const btScalar	cfgBenchmark5_OffsetScale	=	2;
-	static const int		cfgBenchmark5_Reference		=	7379;
-	//[6] btDbvt::collideTT xform,self
-	bool					cfgBenchmark6_Enable		=	cfgEnable;
-	static const int		cfgBenchmark6_Iterations	=	512;
-	static const btScalar	cfgBenchmark6_OffsetScale	=	2;
-	static const int		cfgBenchmark6_Reference		=	7270;
-	//[7] btDbvt::rayTest
-	bool					cfgBenchmark7_Enable		=	cfgEnable;
-	static const int		cfgBenchmark7_Passes		=	32;
-	static const int		cfgBenchmark7_Iterations	=	65536;
-	static const int		cfgBenchmark7_Reference		=	6307;
-	//[8] insert/remove
-	bool					cfgBenchmark8_Enable		=	cfgEnable;
-	static const int		cfgBenchmark8_Passes		=	32;
-	static const int		cfgBenchmark8_Iterations	=	65536;
-	static const int		cfgBenchmark8_Reference		=	2105;
-	//[9] updates (teleport)
-	bool					cfgBenchmark9_Enable		=	cfgEnable;
-	static const int		cfgBenchmark9_Passes		=	32;
-	static const int		cfgBenchmark9_Iterations	=	65536;
-	static const int		cfgBenchmark9_Reference		=	1879;
-	//[10] updates (jitter)
-	bool					cfgBenchmark10_Enable		=	cfgEnable;
-	static const btScalar	cfgBenchmark10_Scale		=	cfgVolumeCenterScale/10000;
-	static const int		cfgBenchmark10_Passes		=	32;
-	static const int		cfgBenchmark10_Iterations	=	65536;
-	static const int		cfgBenchmark10_Reference	=	1244;
-	//[11] optimize (incremental)
-	bool					cfgBenchmark11_Enable		=	cfgEnable;
-	static const int		cfgBenchmark11_Passes		=	64;
-	static const int		cfgBenchmark11_Iterations	=	65536;
-	static const int		cfgBenchmark11_Reference	=	2510;
-	//[12] btDbvtVolume notequal
-	bool					cfgBenchmark12_Enable		=	cfgEnable;
-	static const int		cfgBenchmark12_Iterations	=	32;
-	static const int		cfgBenchmark12_Reference	=	3677;
-	//[13] culling(OCL+fullsort)
-	bool					cfgBenchmark13_Enable		=	cfgEnable;
-	static const int		cfgBenchmark13_Iterations	=	1024;
-	static const int		cfgBenchmark13_Reference	=	2231;
-	//[14] culling(OCL+qsort)
-	bool					cfgBenchmark14_Enable		=	cfgEnable;
-	static const int		cfgBenchmark14_Iterations	=	8192;
-	static const int		cfgBenchmark14_Reference	=	3500;
-	//[15] culling(KDOP+qsort)
-	bool					cfgBenchmark15_Enable		=	cfgEnable;
-	static const int		cfgBenchmark15_Iterations	=	8192;
-	static const int		cfgBenchmark15_Reference	=	1151;
-	//[16] insert/remove batch
-	bool					cfgBenchmark16_Enable		=	cfgEnable;
-	static const int		cfgBenchmark16_BatchCount	=	256;
-	static const int		cfgBenchmark16_Passes		=	16384;
-	static const int		cfgBenchmark16_Reference	=	5138;
-	//[17] select
-	bool					cfgBenchmark17_Enable		=	cfgEnable;
-	static const int		cfgBenchmark17_Iterations	=	4;
-	static const int		cfgBenchmark17_Reference	=	3390;
-
-	btClock					wallclock;
-	printf("Benchmarking dbvt...\r\n");
-	printf("\tWorld scale: %f\r\n",cfgVolumeCenterScale);
-	printf("\tExtents base: %f\r\n",cfgVolumeExentsBase);
-	printf("\tExtents range: %f\r\n",cfgVolumeExentsScale);
-	printf("\tLeaves: %u\r\n",cfgLeaves);
-	printf("\tsizeof(btDbvtVolume): %u bytes\r\n",sizeof(btDbvtVolume));
-	printf("\tsizeof(btDbvtNode):   %u bytes\r\n",sizeof(btDbvtNode));
-	if(cfgBenchmark1_Enable)
-	{// Benchmark 1	
-		srand(380843);
-		btAlignedObjectArray<btDbvtVolume>	volumes;
-		btAlignedObjectArray<bool>			results;
-		volumes.resize(cfgLeaves);
-		results.resize(cfgLeaves);
-		for(int i=0;i<cfgLeaves;++i)
-		{
-			volumes[i]=btDbvtBenchmark::RandVolume(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale);
-		}
-		printf("[1] btDbvtVolume intersections: ");
-		wallclock.reset();
-		for(int i=0;i<cfgBenchmark1_Iterations;++i)
-		{
-			for(int j=0;j<cfgLeaves;++j)
-			{
-				for(int k=0;k<cfgLeaves;++k)
-				{
-					results[k]=Intersect(volumes[j],volumes[k]);
-				}
-			}
-		}
-		const int time=(int)wallclock.getTimeMilliseconds();
-		printf("%u ms (%i%%)\r\n",time,(time-cfgBenchmark1_Reference)*100/time);
-	}
-	if(cfgBenchmark2_Enable)
-	{// Benchmark 2	
-		srand(380843);
-		btAlignedObjectArray<btDbvtVolume>	volumes;
-		btAlignedObjectArray<btDbvtVolume>	results;
-		volumes.resize(cfgLeaves);
-		results.resize(cfgLeaves);
-		for(int i=0;i<cfgLeaves;++i)
-		{
-			volumes[i]=btDbvtBenchmark::RandVolume(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale);
-		}
-		printf("[2] btDbvtVolume merges: ");
-		wallclock.reset();
-		for(int i=0;i<cfgBenchmark2_Iterations;++i)
-		{
-			for(int j=0;j<cfgLeaves;++j)
-			{
-				for(int k=0;k<cfgLeaves;++k)
-				{
-					Merge(volumes[j],volumes[k],results[k]);
-				}
-			}
-		}
-		const int time=(int)wallclock.getTimeMilliseconds();
-		printf("%u ms (%i%%)\r\n",time,(time-cfgBenchmark2_Reference)*100/time);
-	}
-	if(cfgBenchmark3_Enable)
-	{// Benchmark 3	
-		srand(380843);
-		btDbvt						dbvt[2];
-		btDbvtBenchmark::NilPolicy	policy;
-		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt[0]);
-		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt[1]);
-		dbvt[0].optimizeTopDown();
-		dbvt[1].optimizeTopDown();
-		printf("[3] btDbvt::collideTT: ");
-		wallclock.reset();
-		for(int i=0;i<cfgBenchmark3_Iterations;++i)
-		{
-			btDbvt::collideTT(dbvt[0].m_root,dbvt[1].m_root,policy);
-		}
-		const int time=(int)wallclock.getTimeMilliseconds();
-		printf("%u ms (%i%%)\r\n",time,(time-cfgBenchmark3_Reference)*100/time);
-	}
-	if(cfgBenchmark4_Enable)
-	{// Benchmark 4
-		srand(380843);
-		btDbvt						dbvt;
-		btDbvtBenchmark::NilPolicy	policy;
-		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
-		dbvt.optimizeTopDown();
-		printf("[4] btDbvt::collideTT self: ");
-		wallclock.reset();
-		for(int i=0;i<cfgBenchmark4_Iterations;++i)
-		{
-			btDbvt::collideTT(dbvt.m_root,dbvt.m_root,policy);
-		}
-		const int time=(int)wallclock.getTimeMilliseconds();
-		printf("%u ms (%i%%)\r\n",time,(time-cfgBenchmark4_Reference)*100/time);
-	}
-	if(cfgBenchmark5_Enable)
-	{// Benchmark 5	
-		srand(380843);
-		btDbvt								dbvt[2];
-		btAlignedObjectArray<btTransform>	transforms;
-		btDbvtBenchmark::NilPolicy			policy;
-		transforms.resize(cfgBenchmark5_Iterations);
-		for(int i=0;i<transforms.size();++i)
-		{
-			transforms[i]=btDbvtBenchmark::RandTransform(cfgVolumeCenterScale*cfgBenchmark5_OffsetScale);
-		}
-		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt[0]);
-		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt[1]);
-		dbvt[0].optimizeTopDown();
-		dbvt[1].optimizeTopDown();
-		printf("[5] btDbvt::collideTT xform: ");
-		wallclock.reset();
-		for(int i=0;i<cfgBenchmark5_Iterations;++i)
-		{
-			btDbvt::collideTT(dbvt[0].m_root,dbvt[1].m_root,transforms[i],policy);
-		}
-		const int time=(int)wallclock.getTimeMilliseconds();
-		printf("%u ms (%i%%)\r\n",time,(time-cfgBenchmark5_Reference)*100/time);
-	}
-	if(cfgBenchmark6_Enable)
-	{// Benchmark 6	
-		srand(380843);
-		btDbvt								dbvt;
-		btAlignedObjectArray<btTransform>	transforms;
-		btDbvtBenchmark::NilPolicy			policy;
-		transforms.resize(cfgBenchmark6_Iterations);
-		for(int i=0;i<transforms.size();++i)
-		{
-			transforms[i]=btDbvtBenchmark::RandTransform(cfgVolumeCenterScale*cfgBenchmark6_OffsetScale);
-		}
-		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
-		dbvt.optimizeTopDown();
-		printf("[6] btDbvt::collideTT xform,self: ");
-		wallclock.reset();
-		for(int i=0;i<cfgBenchmark6_Iterations;++i)
-		{
-			btDbvt::collideTT(dbvt.m_root,dbvt.m_root,transforms[i],policy);		
-		}
-		const int time=(int)wallclock.getTimeMilliseconds();
-		printf("%u ms (%i%%)\r\n",time,(time-cfgBenchmark6_Reference)*100/time);
-	}
-	if(cfgBenchmark7_Enable)
-	{// Benchmark 7	
-		srand(380843);
-		btDbvt								dbvt;
-		btAlignedObjectArray<btVector3>		rayorg;
-		btAlignedObjectArray<btVector3>		raydir;
-		btDbvtBenchmark::NilPolicy			policy;
-		rayorg.resize(cfgBenchmark7_Iterations);
-		raydir.resize(cfgBenchmark7_Iterations);
-		for(int i=0;i<rayorg.size();++i)
-		{
-			rayorg[i]=btDbvtBenchmark::RandVector3(cfgVolumeCenterScale*2);
-			raydir[i]=btDbvtBenchmark::RandVector3(cfgVolumeCenterScale*2);
-		}
-		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
-		dbvt.optimizeTopDown();
-		printf("[7] btDbvt::rayTest: ");
-		wallclock.reset();
-		for(int i=0;i<cfgBenchmark7_Passes;++i)
-		{
-			for(int j=0;j<cfgBenchmark7_Iterations;++j)
-			{
-				btDbvt::rayTest(dbvt.m_root,rayorg[j],rayorg[j]+raydir[j],policy);
-			}
-		}
-		const int	time=(int)wallclock.getTimeMilliseconds();
-		unsigned	rays=cfgBenchmark7_Passes*cfgBenchmark7_Iterations;
-		printf("%u ms (%i%%),(%u r/s)\r\n",time,(time-cfgBenchmark7_Reference)*100/time,(rays*1000)/time);
-	}
-	if(cfgBenchmark8_Enable)
-	{// Benchmark 8	
-		srand(380843);
-		btDbvt								dbvt;
-		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
-		dbvt.optimizeTopDown();
-		printf("[8] insert/remove: ");
-		wallclock.reset();
-		for(int i=0;i<cfgBenchmark8_Passes;++i)
-		{
-			for(int j=0;j<cfgBenchmark8_Iterations;++j)
-			{
-				dbvt.remove(dbvt.insert(btDbvtBenchmark::RandVolume(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale),0));
-			}
-		}
-		const int	time=(int)wallclock.getTimeMilliseconds();
-		const int	ir=cfgBenchmark8_Passes*cfgBenchmark8_Iterations;
-		printf("%u ms (%i%%),(%u ir/s)\r\n",time,(time-cfgBenchmark8_Reference)*100/time,ir*1000/time);
-	}
-	if(cfgBenchmark9_Enable)
-	{// Benchmark 9	
-		srand(380843);
-		btDbvt										dbvt;
-		btAlignedObjectArray<const btDbvtNode*>	leaves;
-		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
-		dbvt.optimizeTopDown();
-		dbvt.extractLeaves(dbvt.m_root,leaves);
-		printf("[9] updates (teleport): ");
-		wallclock.reset();
-		for(int i=0;i<cfgBenchmark9_Passes;++i)
-		{
-			for(int j=0;j<cfgBenchmark9_Iterations;++j)
-			{
-				dbvt.update(const_cast<btDbvtNode*>(leaves[rand()%cfgLeaves]),
-					btDbvtBenchmark::RandVolume(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale));
-			}
-		}
-		const int	time=(int)wallclock.getTimeMilliseconds();
-		const int	up=cfgBenchmark9_Passes*cfgBenchmark9_Iterations;
-		printf("%u ms (%i%%),(%u u/s)\r\n",time,(time-cfgBenchmark9_Reference)*100/time,up*1000/time);
-	}
-	if(cfgBenchmark10_Enable)
-	{// Benchmark 10	
-		srand(380843);
-		btDbvt										dbvt;
-		btAlignedObjectArray<const btDbvtNode*>	leaves;
-		btAlignedObjectArray<btVector3>				vectors;
-		vectors.resize(cfgBenchmark10_Iterations);
-		for(int i=0;i<vectors.size();++i)
-		{
-			vectors[i]=(btDbvtBenchmark::RandVector3()*2-btVector3(1,1,1))*cfgBenchmark10_Scale;
-		}
-		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
-		dbvt.optimizeTopDown();
-		dbvt.extractLeaves(dbvt.m_root,leaves);
-		printf("[10] updates (jitter): ");
-		wallclock.reset();
-
-		for(int i=0;i<cfgBenchmark10_Passes;++i)
-		{
-			for(int j=0;j<cfgBenchmark10_Iterations;++j)
-			{			
-				const btVector3&	d=vectors[j];
-				btDbvtNode*		l=const_cast<btDbvtNode*>(leaves[rand()%cfgLeaves]);
-				btDbvtVolume		v=btDbvtVolume::FromMM(l->volume.Mins()+d,l->volume.Maxs()+d);
-				dbvt.update(l,v);
-			}
-		}
-		const int	time=(int)wallclock.getTimeMilliseconds();
-		const int	up=cfgBenchmark10_Passes*cfgBenchmark10_Iterations;
-		printf("%u ms (%i%%),(%u u/s)\r\n",time,(time-cfgBenchmark10_Reference)*100/time,up*1000/time);
-	}
-	if(cfgBenchmark11_Enable)
-	{// Benchmark 11	
-		srand(380843);
-		btDbvt										dbvt;
-		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
-		dbvt.optimizeTopDown();
-		printf("[11] optimize (incremental): ");
-		wallclock.reset();	
-		for(int i=0;i<cfgBenchmark11_Passes;++i)
-		{
-			dbvt.optimizeIncremental(cfgBenchmark11_Iterations);
-		}
-		const int	time=(int)wallclock.getTimeMilliseconds();
-		const int	op=cfgBenchmark11_Passes*cfgBenchmark11_Iterations;
-		printf("%u ms (%i%%),(%u o/s)\r\n",time,(time-cfgBenchmark11_Reference)*100/time,op/time*1000);
-	}
-	if(cfgBenchmark12_Enable)
-	{// Benchmark 12	
-		srand(380843);
-		btAlignedObjectArray<btDbvtVolume>	volumes;
-		btAlignedObjectArray<bool>				results;
-		volumes.resize(cfgLeaves);
-		results.resize(cfgLeaves);
-		for(int i=0;i<cfgLeaves;++i)
-		{
-			volumes[i]=btDbvtBenchmark::RandVolume(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale);
-		}
-		printf("[12] btDbvtVolume notequal: ");
-		wallclock.reset();
-		for(int i=0;i<cfgBenchmark12_Iterations;++i)
-		{
-			for(int j=0;j<cfgLeaves;++j)
-			{
-				for(int k=0;k<cfgLeaves;++k)
-				{
-					results[k]=NotEqual(volumes[j],volumes[k]);
-				}
-			}
-		}
-		const int time=(int)wallclock.getTimeMilliseconds();
-		printf("%u ms (%i%%)\r\n",time,(time-cfgBenchmark12_Reference)*100/time);
-	}
-	if(cfgBenchmark13_Enable)
-	{// Benchmark 13	
-		srand(380843);
-		btDbvt								dbvt;
-		btAlignedObjectArray<btVector3>		vectors;
-		btDbvtBenchmark::NilPolicy			policy;
-		vectors.resize(cfgBenchmark13_Iterations);
-		for(int i=0;i<vectors.size();++i)
-		{
-			vectors[i]=(btDbvtBenchmark::RandVector3()*2-btVector3(1,1,1)).normalized();
-		}
-		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
-		dbvt.optimizeTopDown();
-		printf("[13] culling(OCL+fullsort): ");
-		wallclock.reset();	
-		for(int i=0;i<cfgBenchmark13_Iterations;++i)
-		{
-			static const btScalar	offset=0;
-			policy.m_depth=-SIMD_INFINITY;
-			dbvt.collideOCL(dbvt.m_root,&vectors[i],&offset,vectors[i],1,policy);
-		}
-		const int	time=(int)wallclock.getTimeMilliseconds();
-		const int	t=cfgBenchmark13_Iterations;
-		printf("%u ms (%i%%),(%u t/s)\r\n",time,(time-cfgBenchmark13_Reference)*100/time,(t*1000)/time);
-	}
-	if(cfgBenchmark14_Enable)
-	{// Benchmark 14	
-		srand(380843);
-		btDbvt								dbvt;
-		btAlignedObjectArray<btVector3>		vectors;
-		btDbvtBenchmark::P14				policy;
-		vectors.resize(cfgBenchmark14_Iterations);
-		for(int i=0;i<vectors.size();++i)
-		{
-			vectors[i]=(btDbvtBenchmark::RandVector3()*2-btVector3(1,1,1)).normalized();
-		}
-		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
-		dbvt.optimizeTopDown();
-		policy.m_nodes.reserve(cfgLeaves);
-		printf("[14] culling(OCL+qsort): ");
-		wallclock.reset();	
-		for(int i=0;i<cfgBenchmark14_Iterations;++i)
-		{
-			static const btScalar	offset=0;
-			policy.m_nodes.resize(0);
-			dbvt.collideOCL(dbvt.m_root,&vectors[i],&offset,vectors[i],1,policy,false);
-			policy.m_nodes.quickSort(btDbvtBenchmark::P14::sortfnc);
-		}
-		const int	time=(int)wallclock.getTimeMilliseconds();
-		const int	t=cfgBenchmark14_Iterations;
-		printf("%u ms (%i%%),(%u t/s)\r\n",time,(time-cfgBenchmark14_Reference)*100/time,(t*1000)/time);
-	}
-	if(cfgBenchmark15_Enable)
-	{// Benchmark 15	
-		srand(380843);
-		btDbvt								dbvt;
-		btAlignedObjectArray<btVector3>		vectors;
-		btDbvtBenchmark::P15				policy;
-		vectors.resize(cfgBenchmark15_Iterations);
-		for(int i=0;i<vectors.size();++i)
-		{
-			vectors[i]=(btDbvtBenchmark::RandVector3()*2-btVector3(1,1,1)).normalized();
-		}
-		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
-		dbvt.optimizeTopDown();
-		policy.m_nodes.reserve(cfgLeaves);
-		printf("[15] culling(KDOP+qsort): ");
-		wallclock.reset();	
-		for(int i=0;i<cfgBenchmark15_Iterations;++i)
-		{
-			static const btScalar	offset=0;
-			policy.m_nodes.resize(0);
-			policy.m_axis=vectors[i];
-			dbvt.collideKDOP(dbvt.m_root,&vectors[i],&offset,1,policy);
-			policy.m_nodes.quickSort(btDbvtBenchmark::P15::sortfnc);
-		}
-		const int	time=(int)wallclock.getTimeMilliseconds();
-		const int	t=cfgBenchmark15_Iterations;
-		printf("%u ms (%i%%),(%u t/s)\r\n",time,(time-cfgBenchmark15_Reference)*100/time,(t*1000)/time);
-	}
-	if(cfgBenchmark16_Enable)
-	{// Benchmark 16	
-		srand(380843);
-		btDbvt								dbvt;
-		btAlignedObjectArray<btDbvtNode*>	batch;
-		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
-		dbvt.optimizeTopDown();
-		batch.reserve(cfgBenchmark16_BatchCount);
-		printf("[16] insert/remove batch(%u): ",cfgBenchmark16_BatchCount);
-		wallclock.reset();
-		for(int i=0;i<cfgBenchmark16_Passes;++i)
-		{
-			for(int j=0;j<cfgBenchmark16_BatchCount;++j)
-			{
-				batch.push_back(dbvt.insert(btDbvtBenchmark::RandVolume(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale),0));
-			}
-			for(int j=0;j<cfgBenchmark16_BatchCount;++j)
-			{
-				dbvt.remove(batch[j]);
-			}
-			batch.resize(0);
-		}
-		const int	time=(int)wallclock.getTimeMilliseconds();
-		const int	ir=cfgBenchmark16_Passes*cfgBenchmark16_BatchCount;
-		printf("%u ms (%i%%),(%u bir/s)\r\n",time,(time-cfgBenchmark16_Reference)*100/time,int(ir*1000.0/time));
-	}
-	if(cfgBenchmark17_Enable)
-	{// Benchmark 17
-		srand(380843);
-		btAlignedObjectArray<btDbvtVolume>	volumes;
-		btAlignedObjectArray<int>			results;
-		btAlignedObjectArray<int>			indices;
-		volumes.resize(cfgLeaves);
-		results.resize(cfgLeaves);
-		indices.resize(cfgLeaves);
-		for(int i=0;i<cfgLeaves;++i)
-		{
-			indices[i]=i;
-			volumes[i]=btDbvtBenchmark::RandVolume(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale);
-		}
-		for(int i=0;i<cfgLeaves;++i)
-		{
-			btSwap(indices[i],indices[rand()%cfgLeaves]);
-		}
-		printf("[17] btDbvtVolume select: ");
-		wallclock.reset();
-		for(int i=0;i<cfgBenchmark17_Iterations;++i)
-		{
-			for(int j=0;j<cfgLeaves;++j)
-			{
-				for(int k=0;k<cfgLeaves;++k)
-				{
-					const int idx=indices[k];
-					results[idx]=Select(volumes[idx],volumes[j],volumes[k]);
-				}
-			}
-		}
-		const int time=(int)wallclock.getTimeMilliseconds();
-		printf("%u ms (%i%%)\r\n",time,(time-cfgBenchmark17_Reference)*100/time);
-	}
-	printf("\r\n\r\n");
-}
-#endif
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvt.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvt.h
deleted file mode 100644
index 2bb8ef5..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvt.h
+++ /dev/null
@@ -1,1256 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-///btDbvt implementation by Nathanael Presson
-
-#ifndef BT_DYNAMIC_BOUNDING_VOLUME_TREE_H
-#define BT_DYNAMIC_BOUNDING_VOLUME_TREE_H
-
-#include "LinearMath/btAlignedObjectArray.h"
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btTransform.h"
-#include "LinearMath/btAabbUtil2.h"
-
-//
-// Compile time configuration
-//
-
-
-// Implementation profiles
-#define DBVT_IMPL_GENERIC		0	// Generic implementation	
-#define DBVT_IMPL_SSE			1	// SSE
-
-// Template implementation of ICollide
-#ifdef _WIN32
-#if (defined (_MSC_VER) && _MSC_VER >= 1400)
-#define	DBVT_USE_TEMPLATE		1
-#else
-#define	DBVT_USE_TEMPLATE		0
-#endif
-#else
-#define	DBVT_USE_TEMPLATE		0
-#endif
-
-// Use only intrinsics instead of inline asm
-#define DBVT_USE_INTRINSIC_SSE	1
-
-// Using memmov for collideOCL
-#define DBVT_USE_MEMMOVE		1
-
-// Enable benchmarking code
-#define	DBVT_ENABLE_BENCHMARK	0
-
-// Inlining
-#define DBVT_INLINE				SIMD_FORCE_INLINE
-
-// Specific methods implementation
-
-//SSE gives errors on a MSVC 7.1
-#if defined (BT_USE_SSE) && defined (_WIN32)
-#define DBVT_SELECT_IMPL		DBVT_IMPL_SSE
-#define DBVT_MERGE_IMPL			DBVT_IMPL_SSE
-#define DBVT_INT0_IMPL			DBVT_IMPL_SSE
-#else
-#define DBVT_SELECT_IMPL		DBVT_IMPL_GENERIC
-#define DBVT_MERGE_IMPL			DBVT_IMPL_GENERIC
-#define DBVT_INT0_IMPL			DBVT_IMPL_GENERIC
-#endif
-
-#if	(DBVT_SELECT_IMPL==DBVT_IMPL_SSE)||	\
-	(DBVT_MERGE_IMPL==DBVT_IMPL_SSE)||	\
-	(DBVT_INT0_IMPL==DBVT_IMPL_SSE)
-#include <emmintrin.h>
-#endif
-
-//
-// Auto config and checks
-//
-
-#if DBVT_USE_TEMPLATE
-#define	DBVT_VIRTUAL
-#define DBVT_VIRTUAL_DTOR(a)
-#define DBVT_PREFIX					template <typename T>
-#define DBVT_IPOLICY				T& policy
-#define DBVT_CHECKTYPE				static const ICollide&	typechecker=*(T*)1;(void)typechecker;
-#else
-#define	DBVT_VIRTUAL_DTOR(a)		virtual ~a() {}
-#define DBVT_VIRTUAL				virtual
-#define DBVT_PREFIX
-#define DBVT_IPOLICY				ICollide& policy
-#define DBVT_CHECKTYPE
-#endif
-
-#if DBVT_USE_MEMMOVE
-#if !defined( __CELLOS_LV2__) && !defined(__MWERKS__)
-#include <memory.h>
-#endif
-#include <string.h>
-#endif
-
-#ifndef DBVT_USE_TEMPLATE
-#error "DBVT_USE_TEMPLATE undefined"
-#endif
-
-#ifndef DBVT_USE_MEMMOVE
-#error "DBVT_USE_MEMMOVE undefined"
-#endif
-
-#ifndef DBVT_ENABLE_BENCHMARK
-#error "DBVT_ENABLE_BENCHMARK undefined"
-#endif
-
-#ifndef DBVT_SELECT_IMPL
-#error "DBVT_SELECT_IMPL undefined"
-#endif
-
-#ifndef DBVT_MERGE_IMPL
-#error "DBVT_MERGE_IMPL undefined"
-#endif
-
-#ifndef DBVT_INT0_IMPL
-#error "DBVT_INT0_IMPL undefined"
-#endif
-
-//
-// Defaults volumes
-//
-
-/* btDbvtAabbMm			*/ 
-struct	btDbvtAabbMm
-{
-	DBVT_INLINE btVector3			Center() const	{ return((mi+mx)/2); }
-	DBVT_INLINE btVector3			Lengths() const	{ return(mx-mi); }
-	DBVT_INLINE btVector3			Extents() const	{ return((mx-mi)/2); }
-	DBVT_INLINE const btVector3&	Mins() const	{ return(mi); }
-	DBVT_INLINE const btVector3&	Maxs() const	{ return(mx); }
-	static inline btDbvtAabbMm		FromCE(const btVector3& c,const btVector3& e);
-	static inline btDbvtAabbMm		FromCR(const btVector3& c,btScalar r);
-	static inline btDbvtAabbMm		FromMM(const btVector3& mi,const btVector3& mx);
-	static inline btDbvtAabbMm		FromPoints(const btVector3* pts,int n);
-	static inline btDbvtAabbMm		FromPoints(const btVector3** ppts,int n);
-	DBVT_INLINE void				Expand(const btVector3& e);
-	DBVT_INLINE void				SignedExpand(const btVector3& e);
-	DBVT_INLINE bool				Contain(const btDbvtAabbMm& a) const;
-	DBVT_INLINE int					Classify(const btVector3& n,btScalar o,int s) const;
-	DBVT_INLINE btScalar			ProjectMinimum(const btVector3& v,unsigned signs) const;
-	DBVT_INLINE friend bool			Intersect(	const btDbvtAabbMm& a,
-		const btDbvtAabbMm& b);
-	
-	DBVT_INLINE friend bool			Intersect(	const btDbvtAabbMm& a,
-		const btVector3& b);
-
-	DBVT_INLINE friend btScalar		Proximity(	const btDbvtAabbMm& a,
-		const btDbvtAabbMm& b);
-	DBVT_INLINE friend int			Select(		const btDbvtAabbMm& o,
-		const btDbvtAabbMm& a,
-		const btDbvtAabbMm& b);
-	DBVT_INLINE friend void			Merge(		const btDbvtAabbMm& a,
-		const btDbvtAabbMm& b,
-		btDbvtAabbMm& r);
-	DBVT_INLINE friend bool			NotEqual(	const btDbvtAabbMm& a,
-		const btDbvtAabbMm& b);
-private:
-	DBVT_INLINE void				AddSpan(const btVector3& d,btScalar& smi,btScalar& smx) const;
-private:
-	btVector3	mi,mx;
-};
-
-// Types	
-typedef	btDbvtAabbMm	btDbvtVolume;
-
-/* btDbvtNode				*/ 
-struct	btDbvtNode
-{
-	btDbvtVolume	volume;
-	btDbvtNode*		parent;
-	DBVT_INLINE bool	isleaf() const		{ return(childs[1]==0); }
-	DBVT_INLINE bool	isinternal() const	{ return(!isleaf()); }
-	union
-	{
-		btDbvtNode*	childs[2];
-		void*	data;
-		int		dataAsInt;
-	};
-};
-
-///The btDbvt class implements a fast dynamic bounding volume tree based on axis aligned bounding boxes (aabb tree).
-///This btDbvt is used for soft body collision detection and for the btDbvtBroadphase. It has a fast insert, remove and update of nodes.
-///Unlike the btQuantizedBvh, nodes can be dynamically moved around, which allows for change in topology of the underlying data structure.
-struct	btDbvt
-{
-	/* Stack element	*/ 
-	struct	sStkNN
-	{
-		const btDbvtNode*	a;
-		const btDbvtNode*	b;
-		sStkNN() {}
-		sStkNN(const btDbvtNode* na,const btDbvtNode* nb) : a(na),b(nb) {}
-	};
-	struct	sStkNP
-	{
-		const btDbvtNode*	node;
-		int			mask;
-		sStkNP(const btDbvtNode* n,unsigned m) : node(n),mask(m) {}
-	};
-	struct	sStkNPS
-	{
-		const btDbvtNode*	node;
-		int			mask;
-		btScalar	value;
-		sStkNPS() {}
-		sStkNPS(const btDbvtNode* n,unsigned m,btScalar v) : node(n),mask(m),value(v) {}
-	};
-	struct	sStkCLN
-	{
-		const btDbvtNode*	node;
-		btDbvtNode*		parent;
-		sStkCLN(const btDbvtNode* n,btDbvtNode* p) : node(n),parent(p) {}
-	};
-	// Policies/Interfaces
-
-	/* ICollide	*/ 
-	struct	ICollide
-	{		
-		DBVT_VIRTUAL_DTOR(ICollide)
-			DBVT_VIRTUAL void	Process(const btDbvtNode*,const btDbvtNode*)		{}
-		DBVT_VIRTUAL void	Process(const btDbvtNode*)					{}
-		DBVT_VIRTUAL void	Process(const btDbvtNode* n,btScalar)			{ Process(n); }
-		DBVT_VIRTUAL bool	Descent(const btDbvtNode*)					{ return(true); }
-		DBVT_VIRTUAL bool	AllLeaves(const btDbvtNode*)					{ return(true); }
-	};
-	/* IWriter	*/ 
-	struct	IWriter
-	{
-		virtual ~IWriter() {}
-		virtual void		Prepare(const btDbvtNode* root,int numnodes)=0;
-		virtual void		WriteNode(const btDbvtNode*,int index,int parent,int child0,int child1)=0;
-		virtual void		WriteLeaf(const btDbvtNode*,int index,int parent)=0;
-	};
-	/* IClone	*/ 
-	struct	IClone
-	{
-		virtual ~IClone()	{}
-		virtual void		CloneLeaf(btDbvtNode*) {}
-	};
-
-	// Constants
-	enum	{
-		SIMPLE_STACKSIZE	=	64,
-		DOUBLE_STACKSIZE	=	SIMPLE_STACKSIZE*2
-	};
-
-	// Fields
-	btDbvtNode*		m_root;
-	btDbvtNode*		m_free;
-	int				m_lkhd;
-	int				m_leaves;
-	unsigned		m_opath;
-
-	
-	btAlignedObjectArray<sStkNN>	m_stkStack;
-
-
-	// Methods
-	btDbvt();
-	~btDbvt();
-	void			clear();
-	bool			empty() const { return(0==m_root); }
-	void			optimizeBottomUp();
-	void			optimizeTopDown(int bu_treshold=128);
-	void			optimizeIncremental(int passes);
-	btDbvtNode*		insert(const btDbvtVolume& box,void* data);
-	void			update(btDbvtNode* leaf,int lookahead=-1);
-	void			update(btDbvtNode* leaf,btDbvtVolume& volume);
-	bool			update(btDbvtNode* leaf,btDbvtVolume& volume,const btVector3& velocity,btScalar margin);
-	bool			update(btDbvtNode* leaf,btDbvtVolume& volume,const btVector3& velocity);
-	bool			update(btDbvtNode* leaf,btDbvtVolume& volume,btScalar margin);	
-	void			remove(btDbvtNode* leaf);
-	void			write(IWriter* iwriter) const;
-	void			clone(btDbvt& dest,IClone* iclone=0) const;
-	static int		maxdepth(const btDbvtNode* node);
-	static int		countLeaves(const btDbvtNode* node);
-	static void		extractLeaves(const btDbvtNode* node,btAlignedObjectArray<const btDbvtNode*>& leaves);
-#if DBVT_ENABLE_BENCHMARK
-	static void		benchmark();
-#else
-	static void		benchmark(){}
-#endif
-	// DBVT_IPOLICY must support ICollide policy/interface
-	DBVT_PREFIX
-		static void		enumNodes(	const btDbvtNode* root,
-		DBVT_IPOLICY);
-	DBVT_PREFIX
-		static void		enumLeaves(	const btDbvtNode* root,
-		DBVT_IPOLICY);
-	DBVT_PREFIX
-		void		collideTT(	const btDbvtNode* root0,
-		const btDbvtNode* root1,
-		DBVT_IPOLICY);
-
-	DBVT_PREFIX
-		void		collideTTpersistentStack(	const btDbvtNode* root0,
-		  const btDbvtNode* root1,
-		  DBVT_IPOLICY);
-#if 0
-	DBVT_PREFIX
-		void		collideTT(	const btDbvtNode* root0,
-		const btDbvtNode* root1,
-		const btTransform& xform,
-		DBVT_IPOLICY);
-	DBVT_PREFIX
-		void		collideTT(	const btDbvtNode* root0,
-		const btTransform& xform0,
-		const btDbvtNode* root1,
-		const btTransform& xform1,
-		DBVT_IPOLICY);
-#endif
-
-	DBVT_PREFIX
-		void		collideTV(	const btDbvtNode* root,
-		const btDbvtVolume& volume,
-		DBVT_IPOLICY);
-	///rayTest is a re-entrant ray test, and can be called in parallel as long as the btAlignedAlloc is thread-safe (uses locking etc)
-	///rayTest is slower than rayTestInternal, because it builds a local stack, using memory allocations, and it recomputes signs/rayDirectionInverses each time
-	DBVT_PREFIX
-		static void		rayTest(	const btDbvtNode* root,
-		const btVector3& rayFrom,
-		const btVector3& rayTo,
-		DBVT_IPOLICY);
-	///rayTestInternal is faster than rayTest, because it uses a persistent stack (to reduce dynamic memory allocations to a minimum) and it uses precomputed signs/rayInverseDirections
-	///rayTestInternal is used by btDbvtBroadphase to accelerate world ray casts
-	DBVT_PREFIX
-		void		rayTestInternal(	const btDbvtNode* root,
-								const btVector3& rayFrom,
-								const btVector3& rayTo,
-								const btVector3& rayDirectionInverse,
-								unsigned int signs[3],
-								btScalar lambda_max,
-								const btVector3& aabbMin,
-								const btVector3& aabbMax,
-								DBVT_IPOLICY) const;
-
-	DBVT_PREFIX
-		static void		collideKDOP(const btDbvtNode* root,
-		const btVector3* normals,
-		const btScalar* offsets,
-		int count,
-		DBVT_IPOLICY);
-	DBVT_PREFIX
-		static void		collideOCL(	const btDbvtNode* root,
-		const btVector3* normals,
-		const btScalar* offsets,
-		const btVector3& sortaxis,
-		int count,								
-		DBVT_IPOLICY,
-		bool fullsort=true);
-	DBVT_PREFIX
-		static void		collideTU(	const btDbvtNode* root,
-		DBVT_IPOLICY);
-	// Helpers	
-	static DBVT_INLINE int	nearest(const int* i,const btDbvt::sStkNPS* a,btScalar v,int l,int h)
-	{
-		int	m=0;
-		while(l<h)
-		{
-			m=(l+h)>>1;
-			if(a[i[m]].value>=v) l=m+1; else h=m;
-		}
-		return(h);
-	}
-	static DBVT_INLINE int	allocate(	btAlignedObjectArray<int>& ifree,
-		btAlignedObjectArray<sStkNPS>& stock,
-		const sStkNPS& value)
-	{
-		int	i;
-		if(ifree.size()>0)
-		{ i=ifree[ifree.size()-1];ifree.pop_back();stock[i]=value; }
-		else
-		{ i=stock.size();stock.push_back(value); }
-		return(i); 
-	}
-	//
-private:
-	btDbvt(const btDbvt&)	{}	
-};
-
-//
-// Inline's
-//
-
-//
-inline btDbvtAabbMm			btDbvtAabbMm::FromCE(const btVector3& c,const btVector3& e)
-{
-	btDbvtAabbMm box;
-	box.mi=c-e;box.mx=c+e;
-	return(box);
-}
-
-//
-inline btDbvtAabbMm			btDbvtAabbMm::FromCR(const btVector3& c,btScalar r)
-{
-	return(FromCE(c,btVector3(r,r,r)));
-}
-
-//
-inline btDbvtAabbMm			btDbvtAabbMm::FromMM(const btVector3& mi,const btVector3& mx)
-{
-	btDbvtAabbMm box;
-	box.mi=mi;box.mx=mx;
-	return(box);
-}
-
-//
-inline btDbvtAabbMm			btDbvtAabbMm::FromPoints(const btVector3* pts,int n)
-{
-	btDbvtAabbMm box;
-	box.mi=box.mx=pts[0];
-	for(int i=1;i<n;++i)
-	{
-		box.mi.setMin(pts[i]);
-		box.mx.setMax(pts[i]);
-	}
-	return(box);
-}
-
-//
-inline btDbvtAabbMm			btDbvtAabbMm::FromPoints(const btVector3** ppts,int n)
-{
-	btDbvtAabbMm box;
-	box.mi=box.mx=*ppts[0];
-	for(int i=1;i<n;++i)
-	{
-		box.mi.setMin(*ppts[i]);
-		box.mx.setMax(*ppts[i]);
-	}
-	return(box);
-}
-
-//
-DBVT_INLINE void		btDbvtAabbMm::Expand(const btVector3& e)
-{
-	mi-=e;mx+=e;
-}
-
-//
-DBVT_INLINE void		btDbvtAabbMm::SignedExpand(const btVector3& e)
-{
-	if(e.x()>0) mx.setX(mx.x()+e[0]); else mi.setX(mi.x()+e[0]);
-	if(e.y()>0) mx.setY(mx.y()+e[1]); else mi.setY(mi.y()+e[1]);
-	if(e.z()>0) mx.setZ(mx.z()+e[2]); else mi.setZ(mi.z()+e[2]);
-}
-
-//
-DBVT_INLINE bool		btDbvtAabbMm::Contain(const btDbvtAabbMm& a) const
-{
-	return(	(mi.x()<=a.mi.x())&&
-		(mi.y()<=a.mi.y())&&
-		(mi.z()<=a.mi.z())&&
-		(mx.x()>=a.mx.x())&&
-		(mx.y()>=a.mx.y())&&
-		(mx.z()>=a.mx.z()));
-}
-
-//
-DBVT_INLINE int		btDbvtAabbMm::Classify(const btVector3& n,btScalar o,int s) const
-{
-	btVector3			pi,px;
-	switch(s)
-	{
-	case	(0+0+0):	px=btVector3(mi.x(),mi.y(),mi.z());
-		pi=btVector3(mx.x(),mx.y(),mx.z());break;
-	case	(1+0+0):	px=btVector3(mx.x(),mi.y(),mi.z());
-		pi=btVector3(mi.x(),mx.y(),mx.z());break;
-	case	(0+2+0):	px=btVector3(mi.x(),mx.y(),mi.z());
-		pi=btVector3(mx.x(),mi.y(),mx.z());break;
-	case	(1+2+0):	px=btVector3(mx.x(),mx.y(),mi.z());
-		pi=btVector3(mi.x(),mi.y(),mx.z());break;
-	case	(0+0+4):	px=btVector3(mi.x(),mi.y(),mx.z());
-		pi=btVector3(mx.x(),mx.y(),mi.z());break;
-	case	(1+0+4):	px=btVector3(mx.x(),mi.y(),mx.z());
-		pi=btVector3(mi.x(),mx.y(),mi.z());break;
-	case	(0+2+4):	px=btVector3(mi.x(),mx.y(),mx.z());
-		pi=btVector3(mx.x(),mi.y(),mi.z());break;
-	case	(1+2+4):	px=btVector3(mx.x(),mx.y(),mx.z());
-		pi=btVector3(mi.x(),mi.y(),mi.z());break;
-	}
-	if((btDot(n,px)+o)<0)		return(-1);
-	if((btDot(n,pi)+o)>=0)	return(+1);
-	return(0);
-}
-
-//
-DBVT_INLINE btScalar	btDbvtAabbMm::ProjectMinimum(const btVector3& v,unsigned signs) const
-{
-	const btVector3*	b[]={&mx,&mi};
-	const btVector3		p(	b[(signs>>0)&1]->x(),
-		b[(signs>>1)&1]->y(),
-		b[(signs>>2)&1]->z());
-	return(btDot(p,v));
-}
-
-//
-DBVT_INLINE void		btDbvtAabbMm::AddSpan(const btVector3& d,btScalar& smi,btScalar& smx) const
-{
-	for(int i=0;i<3;++i)
-	{
-		if(d[i]<0)
-		{ smi+=mx[i]*d[i];smx+=mi[i]*d[i]; }
-		else
-		{ smi+=mi[i]*d[i];smx+=mx[i]*d[i]; }
-	}
-}
-
-//
-DBVT_INLINE bool		Intersect(	const btDbvtAabbMm& a,
-								  const btDbvtAabbMm& b)
-{
-#if	DBVT_INT0_IMPL == DBVT_IMPL_SSE
-	const __m128	rt(_mm_or_ps(	_mm_cmplt_ps(_mm_load_ps(b.mx),_mm_load_ps(a.mi)),
-		_mm_cmplt_ps(_mm_load_ps(a.mx),_mm_load_ps(b.mi))));
-	const __int32*	pu((const __int32*)&rt);
-	return((pu[0]|pu[1]|pu[2])==0);
-#else
-	return(	(a.mi.x()<=b.mx.x())&&
-		(a.mx.x()>=b.mi.x())&&
-		(a.mi.y()<=b.mx.y())&&
-		(a.mx.y()>=b.mi.y())&&
-		(a.mi.z()<=b.mx.z())&&		
-		(a.mx.z()>=b.mi.z()));
-#endif
-}
-
-
-
-//
-DBVT_INLINE bool		Intersect(	const btDbvtAabbMm& a,
-								  const btVector3& b)
-{
-	return(	(b.x()>=a.mi.x())&&
-		(b.y()>=a.mi.y())&&
-		(b.z()>=a.mi.z())&&
-		(b.x()<=a.mx.x())&&
-		(b.y()<=a.mx.y())&&
-		(b.z()<=a.mx.z()));
-}
-
-
-
-
-
-//////////////////////////////////////
-
-
-//
-DBVT_INLINE btScalar	Proximity(	const btDbvtAabbMm& a,
-								  const btDbvtAabbMm& b)
-{
-	const btVector3	d=(a.mi+a.mx)-(b.mi+b.mx);
-	return(btFabs(d.x())+btFabs(d.y())+btFabs(d.z()));
-}
-
-
-
-//
-DBVT_INLINE int			Select(	const btDbvtAabbMm& o,
-							   const btDbvtAabbMm& a,
-							   const btDbvtAabbMm& b)
-{
-#if	DBVT_SELECT_IMPL == DBVT_IMPL_SSE
-	static ATTRIBUTE_ALIGNED16(const unsigned __int32)	mask[]={0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff};
-	///@todo: the intrinsic version is 11% slower
-#if DBVT_USE_INTRINSIC_SSE
-
-	union btSSEUnion ///NOTE: if we use more intrinsics, move btSSEUnion into the LinearMath directory
-	{
-	   __m128		ssereg;
-	   float		floats[4];
-	   int			ints[4];
-	};
-
-	__m128	omi(_mm_load_ps(o.mi));
-	omi=_mm_add_ps(omi,_mm_load_ps(o.mx));
-	__m128	ami(_mm_load_ps(a.mi));
-	ami=_mm_add_ps(ami,_mm_load_ps(a.mx));
-	ami=_mm_sub_ps(ami,omi);
-	ami=_mm_and_ps(ami,_mm_load_ps((const float*)mask));
-	__m128	bmi(_mm_load_ps(b.mi));
-	bmi=_mm_add_ps(bmi,_mm_load_ps(b.mx));
-	bmi=_mm_sub_ps(bmi,omi);
-	bmi=_mm_and_ps(bmi,_mm_load_ps((const float*)mask));
-	__m128	t0(_mm_movehl_ps(ami,ami));
-	ami=_mm_add_ps(ami,t0);
-	ami=_mm_add_ss(ami,_mm_shuffle_ps(ami,ami,1));
-	__m128 t1(_mm_movehl_ps(bmi,bmi));
-	bmi=_mm_add_ps(bmi,t1);
-	bmi=_mm_add_ss(bmi,_mm_shuffle_ps(bmi,bmi,1));
-	
-	btSSEUnion tmp;
-	tmp.ssereg = _mm_cmple_ss(bmi,ami);
-	return tmp.ints[0]&1;
-
-#else
-	ATTRIBUTE_ALIGNED16(__int32	r[1]);
-	__asm
-	{
-		mov		eax,o
-			mov		ecx,a
-			mov		edx,b
-			movaps	xmm0,[eax]
-		movaps	xmm5,mask
-			addps	xmm0,[eax+16]	
-		movaps	xmm1,[ecx]
-		movaps	xmm2,[edx]
-		addps	xmm1,[ecx+16]
-		addps	xmm2,[edx+16]
-		subps	xmm1,xmm0
-			subps	xmm2,xmm0
-			andps	xmm1,xmm5
-			andps	xmm2,xmm5
-			movhlps	xmm3,xmm1
-			movhlps	xmm4,xmm2
-			addps	xmm1,xmm3
-			addps	xmm2,xmm4
-			pshufd	xmm3,xmm1,1
-			pshufd	xmm4,xmm2,1
-			addss	xmm1,xmm3
-			addss	xmm2,xmm4
-			cmpless	xmm2,xmm1
-			movss	r,xmm2
-	}
-	return(r[0]&1);
-#endif
-#else
-	return(Proximity(o,a)<Proximity(o,b)?0:1);
-#endif
-}
-
-//
-DBVT_INLINE void		Merge(	const btDbvtAabbMm& a,
-							  const btDbvtAabbMm& b,
-							  btDbvtAabbMm& r)
-{
-#if DBVT_MERGE_IMPL==DBVT_IMPL_SSE
-	__m128	ami(_mm_load_ps(a.mi));
-	__m128	amx(_mm_load_ps(a.mx));
-	__m128	bmi(_mm_load_ps(b.mi));
-	__m128	bmx(_mm_load_ps(b.mx));
-	ami=_mm_min_ps(ami,bmi);
-	amx=_mm_max_ps(amx,bmx);
-	_mm_store_ps(r.mi,ami);
-	_mm_store_ps(r.mx,amx);
-#else
-	for(int i=0;i<3;++i)
-	{
-		if(a.mi[i]<b.mi[i]) r.mi[i]=a.mi[i]; else r.mi[i]=b.mi[i];
-		if(a.mx[i]>b.mx[i]) r.mx[i]=a.mx[i]; else r.mx[i]=b.mx[i];
-	}
-#endif
-}
-
-//
-DBVT_INLINE bool		NotEqual(	const btDbvtAabbMm& a,
-								 const btDbvtAabbMm& b)
-{
-	return(	(a.mi.x()!=b.mi.x())||
-		(a.mi.y()!=b.mi.y())||
-		(a.mi.z()!=b.mi.z())||
-		(a.mx.x()!=b.mx.x())||
-		(a.mx.y()!=b.mx.y())||
-		(a.mx.z()!=b.mx.z()));
-}
-
-//
-// Inline's
-//
-
-//
-DBVT_PREFIX
-inline void		btDbvt::enumNodes(	const btDbvtNode* root,
-								  DBVT_IPOLICY)
-{
-	DBVT_CHECKTYPE
-		policy.Process(root);
-	if(root->isinternal())
-	{
-		enumNodes(root->childs[0],policy);
-		enumNodes(root->childs[1],policy);
-	}
-}
-
-//
-DBVT_PREFIX
-inline void		btDbvt::enumLeaves(	const btDbvtNode* root,
-								   DBVT_IPOLICY)
-{
-	DBVT_CHECKTYPE
-		if(root->isinternal())
-		{
-			enumLeaves(root->childs[0],policy);
-			enumLeaves(root->childs[1],policy);
-		}
-		else
-		{
-			policy.Process(root);
-		}
-}
-
-//
-DBVT_PREFIX
-inline void		btDbvt::collideTT(	const btDbvtNode* root0,
-								  const btDbvtNode* root1,
-								  DBVT_IPOLICY)
-{
-	DBVT_CHECKTYPE
-		if(root0&&root1)
-		{
-			int								depth=1;
-			int								treshold=DOUBLE_STACKSIZE-4;
-			btAlignedObjectArray<sStkNN>	stkStack;
-			stkStack.resize(DOUBLE_STACKSIZE);
-			stkStack[0]=sStkNN(root0,root1);
-			do	{		
-				sStkNN	p=stkStack[--depth];
-				if(depth>treshold)
-				{
-					stkStack.resize(stkStack.size()*2);
-					treshold=stkStack.size()-4;
-				}
-				if(p.a==p.b)
-				{
-					if(p.a->isinternal())
-					{
-						stkStack[depth++]=sStkNN(p.a->childs[0],p.a->childs[0]);
-						stkStack[depth++]=sStkNN(p.a->childs[1],p.a->childs[1]);
-						stkStack[depth++]=sStkNN(p.a->childs[0],p.a->childs[1]);
-					}
-				}
-				else if(Intersect(p.a->volume,p.b->volume))
-				{
-					if(p.a->isinternal())
-					{
-						if(p.b->isinternal())
-						{
-							stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[0]);
-							stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[0]);
-							stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[1]);
-							stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[1]);
-						}
-						else
-						{
-							stkStack[depth++]=sStkNN(p.a->childs[0],p.b);
-							stkStack[depth++]=sStkNN(p.a->childs[1],p.b);
-						}
-					}
-					else
-					{
-						if(p.b->isinternal())
-						{
-							stkStack[depth++]=sStkNN(p.a,p.b->childs[0]);
-							stkStack[depth++]=sStkNN(p.a,p.b->childs[1]);
-						}
-						else
-						{
-							policy.Process(p.a,p.b);
-						}
-					}
-				}
-			} while(depth);
-		}
-}
-
-
-
-DBVT_PREFIX
-inline void		btDbvt::collideTTpersistentStack(	const btDbvtNode* root0,
-								  const btDbvtNode* root1,
-								  DBVT_IPOLICY)
-{
-	DBVT_CHECKTYPE
-		if(root0&&root1)
-		{
-			int								depth=1;
-			int								treshold=DOUBLE_STACKSIZE-4;
-			
-			m_stkStack.resize(DOUBLE_STACKSIZE);
-			m_stkStack[0]=sStkNN(root0,root1);
-			do	{		
-				sStkNN	p=m_stkStack[--depth];
-				if(depth>treshold)
-				{
-					m_stkStack.resize(m_stkStack.size()*2);
-					treshold=m_stkStack.size()-4;
-				}
-				if(p.a==p.b)
-				{
-					if(p.a->isinternal())
-					{
-						m_stkStack[depth++]=sStkNN(p.a->childs[0],p.a->childs[0]);
-						m_stkStack[depth++]=sStkNN(p.a->childs[1],p.a->childs[1]);
-						m_stkStack[depth++]=sStkNN(p.a->childs[0],p.a->childs[1]);
-					}
-				}
-				else if(Intersect(p.a->volume,p.b->volume))
-				{
-					if(p.a->isinternal())
-					{
-						if(p.b->isinternal())
-						{
-							m_stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[0]);
-							m_stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[0]);
-							m_stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[1]);
-							m_stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[1]);
-						}
-						else
-						{
-							m_stkStack[depth++]=sStkNN(p.a->childs[0],p.b);
-							m_stkStack[depth++]=sStkNN(p.a->childs[1],p.b);
-						}
-					}
-					else
-					{
-						if(p.b->isinternal())
-						{
-							m_stkStack[depth++]=sStkNN(p.a,p.b->childs[0]);
-							m_stkStack[depth++]=sStkNN(p.a,p.b->childs[1]);
-						}
-						else
-						{
-							policy.Process(p.a,p.b);
-						}
-					}
-				}
-			} while(depth);
-		}
-}
-
-#if 0
-//
-DBVT_PREFIX
-inline void		btDbvt::collideTT(	const btDbvtNode* root0,
-								  const btDbvtNode* root1,
-								  const btTransform& xform,
-								  DBVT_IPOLICY)
-{
-	DBVT_CHECKTYPE
-		if(root0&&root1)
-		{
-			int								depth=1;
-			int								treshold=DOUBLE_STACKSIZE-4;
-			btAlignedObjectArray<sStkNN>	stkStack;
-			stkStack.resize(DOUBLE_STACKSIZE);
-			stkStack[0]=sStkNN(root0,root1);
-			do	{
-				sStkNN	p=stkStack[--depth];
-				if(Intersect(p.a->volume,p.b->volume,xform))
-				{
-					if(depth>treshold)
-					{
-						stkStack.resize(stkStack.size()*2);
-						treshold=stkStack.size()-4;
-					}
-					if(p.a->isinternal())
-					{
-						if(p.b->isinternal())
-						{					
-							stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[0]);
-							stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[0]);
-							stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[1]);
-							stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[1]);
-						}
-						else
-						{
-							stkStack[depth++]=sStkNN(p.a->childs[0],p.b);
-							stkStack[depth++]=sStkNN(p.a->childs[1],p.b);
-						}
-					}
-					else
-					{
-						if(p.b->isinternal())
-						{
-							stkStack[depth++]=sStkNN(p.a,p.b->childs[0]);
-							stkStack[depth++]=sStkNN(p.a,p.b->childs[1]);
-						}
-						else
-						{
-							policy.Process(p.a,p.b);
-						}
-					}
-				}
-			} while(depth);
-		}
-}
-//
-DBVT_PREFIX
-inline void		btDbvt::collideTT(	const btDbvtNode* root0,
-								  const btTransform& xform0,
-								  const btDbvtNode* root1,
-								  const btTransform& xform1,
-								  DBVT_IPOLICY)
-{
-	const btTransform	xform=xform0.inverse()*xform1;
-	collideTT(root0,root1,xform,policy);
-}
-#endif 
-
-//
-DBVT_PREFIX
-inline void		btDbvt::collideTV(	const btDbvtNode* root,
-								  const btDbvtVolume& vol,
-								  DBVT_IPOLICY)
-{
-	DBVT_CHECKTYPE
-		if(root)
-		{
-			ATTRIBUTE_ALIGNED16(btDbvtVolume)		volume(vol);
-			btAlignedObjectArray<const btDbvtNode*>	stack;
-			stack.resize(0);
-			stack.reserve(SIMPLE_STACKSIZE);
-			stack.push_back(root);
-			do	{
-				const btDbvtNode*	n=stack[stack.size()-1];
-				stack.pop_back();
-				if(Intersect(n->volume,volume))
-				{
-					if(n->isinternal())
-					{
-						stack.push_back(n->childs[0]);
-						stack.push_back(n->childs[1]);
-					}
-					else
-					{
-						policy.Process(n);
-					}
-				}
-			} while(stack.size()>0);
-		}
-}
-
-DBVT_PREFIX
-inline void		btDbvt::rayTestInternal(	const btDbvtNode* root,
-								const btVector3& rayFrom,
-								const btVector3& rayTo,
-								const btVector3& rayDirectionInverse,
-								unsigned int signs[3],
-								btScalar lambda_max,
-								const btVector3& aabbMin,
-								const btVector3& aabbMax,
-								DBVT_IPOLICY) const
-{
-        (void) rayTo;
-	DBVT_CHECKTYPE
-	if(root)
-	{
-		btVector3 resultNormal;
-
-		int								depth=1;
-		int								treshold=DOUBLE_STACKSIZE-2;
-		btAlignedObjectArray<const btDbvtNode*>	stack;
-		stack.resize(DOUBLE_STACKSIZE);
-		stack[0]=root;
-		btVector3 bounds[2];
-		do	
-		{
-			const btDbvtNode*	node=stack[--depth];
-			bounds[0] = node->volume.Mins()-aabbMax;
-			bounds[1] = node->volume.Maxs()-aabbMin;
-			btScalar tmin=1.f,lambda_min=0.f;
-			unsigned int result1=false;
-			result1 = btRayAabb2(rayFrom,rayDirectionInverse,signs,bounds,tmin,lambda_min,lambda_max);
-			if(result1)
-			{
-				if(node->isinternal())
-				{
-					if(depth>treshold)
-					{
-						stack.resize(stack.size()*2);
-						treshold=stack.size()-2;
-					}
-					stack[depth++]=node->childs[0];
-					stack[depth++]=node->childs[1];
-				}
-				else
-				{
-					policy.Process(node);
-				}
-			}
-		} while(depth);
-	}
-}
-
-//
-DBVT_PREFIX
-inline void		btDbvt::rayTest(	const btDbvtNode* root,
-								const btVector3& rayFrom,
-								const btVector3& rayTo,
-								DBVT_IPOLICY)
-{
-	DBVT_CHECKTYPE
-		if(root)
-		{
-			btVector3 rayDir = (rayTo-rayFrom);
-			rayDir.normalize ();
-
-			///what about division by zero? --> just set rayDirection[i] to INF/BT_LARGE_FLOAT
-			btVector3 rayDirectionInverse;
-			rayDirectionInverse[0] = rayDir[0] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[0];
-			rayDirectionInverse[1] = rayDir[1] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[1];
-			rayDirectionInverse[2] = rayDir[2] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[2];
-			unsigned int signs[3] = { rayDirectionInverse[0] < 0.0, rayDirectionInverse[1] < 0.0, rayDirectionInverse[2] < 0.0};
-
-			btScalar lambda_max = rayDir.dot(rayTo-rayFrom);
-
-			btVector3 resultNormal;
-
-			btAlignedObjectArray<const btDbvtNode*>	stack;
-
-			int								depth=1;
-			int								treshold=DOUBLE_STACKSIZE-2;
-
-			stack.resize(DOUBLE_STACKSIZE);
-			stack[0]=root;
-			btVector3 bounds[2];
-			do	{
-				const btDbvtNode*	node=stack[--depth];
-
-				bounds[0] = node->volume.Mins();
-				bounds[1] = node->volume.Maxs();
-				
-				btScalar tmin=1.f,lambda_min=0.f;
-				unsigned int result1 = btRayAabb2(rayFrom,rayDirectionInverse,signs,bounds,tmin,lambda_min,lambda_max);
-
-#ifdef COMPARE_BTRAY_AABB2
-				btScalar param=1.f;
-				bool result2 = btRayAabb(rayFrom,rayTo,node->volume.Mins(),node->volume.Maxs(),param,resultNormal);
-				btAssert(result1 == result2);
-#endif //TEST_BTRAY_AABB2
-
-				if(result1)
-				{
-					if(node->isinternal())
-					{
-						if(depth>treshold)
-						{
-							stack.resize(stack.size()*2);
-							treshold=stack.size()-2;
-						}
-						stack[depth++]=node->childs[0];
-						stack[depth++]=node->childs[1];
-					}
-					else
-					{
-						policy.Process(node);
-					}
-				}
-			} while(depth);
-
-		}
-}
-
-//
-DBVT_PREFIX
-inline void		btDbvt::collideKDOP(const btDbvtNode* root,
-									const btVector3* normals,
-									const btScalar* offsets,
-									int count,
-									DBVT_IPOLICY)
-{
-	DBVT_CHECKTYPE
-		if(root)
-		{
-			const int						inside=(1<<count)-1;
-			btAlignedObjectArray<sStkNP>	stack;
-			int								signs[sizeof(unsigned)*8];
-			btAssert(count<int (sizeof(signs)/sizeof(signs[0])));
-			for(int i=0;i<count;++i)
-			{
-				signs[i]=	((normals[i].x()>=0)?1:0)+
-					((normals[i].y()>=0)?2:0)+
-					((normals[i].z()>=0)?4:0);
-			}
-			stack.reserve(SIMPLE_STACKSIZE);
-			stack.push_back(sStkNP(root,0));
-			do	{
-				sStkNP	se=stack[stack.size()-1];
-				bool	out=false;
-				stack.pop_back();
-				for(int i=0,j=1;(!out)&&(i<count);++i,j<<=1)
-				{
-					if(0==(se.mask&j))
-					{
-						const int	side=se.node->volume.Classify(normals[i],offsets[i],signs[i]);
-						switch(side)
-						{
-						case	-1:	out=true;break;
-						case	+1:	se.mask|=j;break;
-						}
-					}
-				}
-				if(!out)
-				{
-					if((se.mask!=inside)&&(se.node->isinternal()))
-					{
-						stack.push_back(sStkNP(se.node->childs[0],se.mask));
-						stack.push_back(sStkNP(se.node->childs[1],se.mask));
-					}
-					else
-					{
-						if(policy.AllLeaves(se.node)) enumLeaves(se.node,policy);
-					}
-				}
-			} while(stack.size());
-		}
-}
-
-//
-DBVT_PREFIX
-inline void		btDbvt::collideOCL(	const btDbvtNode* root,
-								   const btVector3* normals,
-								   const btScalar* offsets,
-								   const btVector3& sortaxis,
-								   int count,
-								   DBVT_IPOLICY,
-								   bool fsort)
-{
-	DBVT_CHECKTYPE
-		if(root)
-		{
-			const unsigned					srtsgns=(sortaxis[0]>=0?1:0)+
-				(sortaxis[1]>=0?2:0)+
-				(sortaxis[2]>=0?4:0);
-			const int						inside=(1<<count)-1;
-			btAlignedObjectArray<sStkNPS>	stock;
-			btAlignedObjectArray<int>		ifree;
-			btAlignedObjectArray<int>		stack;
-			int								signs[sizeof(unsigned)*8];
-			btAssert(count<int (sizeof(signs)/sizeof(signs[0])));
-			for(int i=0;i<count;++i)
-			{
-				signs[i]=	((normals[i].x()>=0)?1:0)+
-					((normals[i].y()>=0)?2:0)+
-					((normals[i].z()>=0)?4:0);
-			}
-			stock.reserve(SIMPLE_STACKSIZE);
-			stack.reserve(SIMPLE_STACKSIZE);
-			ifree.reserve(SIMPLE_STACKSIZE);
-			stack.push_back(allocate(ifree,stock,sStkNPS(root,0,root->volume.ProjectMinimum(sortaxis,srtsgns))));
-			do	{
-				const int	id=stack[stack.size()-1];
-				sStkNPS		se=stock[id];
-				stack.pop_back();ifree.push_back(id);
-				if(se.mask!=inside)
-				{
-					bool	out=false;
-					for(int i=0,j=1;(!out)&&(i<count);++i,j<<=1)
-					{
-						if(0==(se.mask&j))
-						{
-							const int	side=se.node->volume.Classify(normals[i],offsets[i],signs[i]);
-							switch(side)
-							{
-							case	-1:	out=true;break;
-							case	+1:	se.mask|=j;break;
-							}
-						}
-					}
-					if(out) continue;
-				}
-				if(policy.Descent(se.node))
-				{
-					if(se.node->isinternal())
-					{
-						const btDbvtNode* pns[]={	se.node->childs[0],se.node->childs[1]};
-						sStkNPS		nes[]={	sStkNPS(pns[0],se.mask,pns[0]->volume.ProjectMinimum(sortaxis,srtsgns)),
-							sStkNPS(pns[1],se.mask,pns[1]->volume.ProjectMinimum(sortaxis,srtsgns))};
-						const int	q=nes[0].value<nes[1].value?1:0;				
-						int			j=stack.size();
-						if(fsort&&(j>0))
-						{
-							/* Insert 0	*/ 
-							j=nearest(&stack[0],&stock[0],nes[q].value,0,stack.size());
-							stack.push_back(0);
-#if DBVT_USE_MEMMOVE
-							memmove(&stack[j+1],&stack[j],sizeof(int)*(stack.size()-j-1));
-#else
-							for(int k=stack.size()-1;k>j;--k) stack[k]=stack[k-1];
-#endif
-							stack[j]=allocate(ifree,stock,nes[q]);
-							/* Insert 1	*/ 
-							j=nearest(&stack[0],&stock[0],nes[1-q].value,j,stack.size());
-							stack.push_back(0);
-#if DBVT_USE_MEMMOVE
-							memmove(&stack[j+1],&stack[j],sizeof(int)*(stack.size()-j-1));
-#else
-							for(int k=stack.size()-1;k>j;--k) stack[k]=stack[k-1];
-#endif
-							stack[j]=allocate(ifree,stock,nes[1-q]);
-						}
-						else
-						{
-							stack.push_back(allocate(ifree,stock,nes[q]));
-							stack.push_back(allocate(ifree,stock,nes[1-q]));
-						}
-					}
-					else
-					{
-						policy.Process(se.node,se.value);
-					}
-				}
-			} while(stack.size());
-		}
-}
-
-//
-DBVT_PREFIX
-inline void		btDbvt::collideTU(	const btDbvtNode* root,
-								  DBVT_IPOLICY)
-{
-	DBVT_CHECKTYPE
-		if(root)
-		{
-			btAlignedObjectArray<const btDbvtNode*>	stack;
-			stack.reserve(SIMPLE_STACKSIZE);
-			stack.push_back(root);
-			do	{
-				const btDbvtNode*	n=stack[stack.size()-1];
-				stack.pop_back();
-				if(policy.Descent(n))
-				{
-					if(n->isinternal())
-					{ stack.push_back(n->childs[0]);stack.push_back(n->childs[1]); }
-					else
-					{ policy.Process(n); }
-				}
-			} while(stack.size()>0);
-		}
-}
-
-//
-// PP Cleanup
-//
-
-#undef DBVT_USE_MEMMOVE
-#undef DBVT_USE_TEMPLATE
-#undef DBVT_VIRTUAL_DTOR
-#undef DBVT_VIRTUAL
-#undef DBVT_PREFIX
-#undef DBVT_IPOLICY
-#undef DBVT_CHECKTYPE
-#undef DBVT_IMPL_GENERIC
-#undef DBVT_IMPL_SSE
-#undef DBVT_USE_INTRINSIC_SSE
-#undef DBVT_SELECT_IMPL
-#undef DBVT_MERGE_IMPL
-#undef DBVT_INT0_IMPL
-
-#endif
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp
deleted file mode 100644
index 75cfac6..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp
+++ /dev/null
@@ -1,796 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-///btDbvtBroadphase implementation by Nathanael Presson
-
-#include "btDbvtBroadphase.h"
-
-//
-// Profiling
-//
-
-#if DBVT_BP_PROFILE||DBVT_BP_ENABLE_BENCHMARK
-#include <stdio.h>
-#endif
-
-#if DBVT_BP_PROFILE
-struct	ProfileScope
-{
-	__forceinline ProfileScope(btClock& clock,unsigned long& value) :
-	m_clock(&clock),m_value(&value),m_base(clock.getTimeMicroseconds())
-	{
-	}
-	__forceinline ~ProfileScope()
-	{
-		(*m_value)+=m_clock->getTimeMicroseconds()-m_base;
-	}
-	btClock*		m_clock;
-	unsigned long*	m_value;
-	unsigned long	m_base;
-};
-#define	SPC(_value_)	ProfileScope	spc_scope(m_clock,_value_)
-#else
-#define	SPC(_value_)
-#endif
-
-//
-// Helpers
-//
-
-//
-template <typename T>
-static inline void	listappend(T* item,T*& list)
-{
-	item->links[0]=0;
-	item->links[1]=list;
-	if(list) list->links[0]=item;
-	list=item;
-}
-
-//
-template <typename T>
-static inline void	listremove(T* item,T*& list)
-{
-	if(item->links[0]) item->links[0]->links[1]=item->links[1]; else list=item->links[1];
-	if(item->links[1]) item->links[1]->links[0]=item->links[0];
-}
-
-//
-template <typename T>
-static inline int	listcount(T* root)
-{
-	int	n=0;
-	while(root) { ++n;root=root->links[1]; }
-	return(n);
-}
-
-//
-template <typename T>
-static inline void	clear(T& value)
-{
-	static const struct ZeroDummy : T {} zerodummy;
-	value=zerodummy;
-}
-
-//
-// Colliders
-//
-
-/* Tree collider	*/ 
-struct	btDbvtTreeCollider : btDbvt::ICollide
-{
-	btDbvtBroadphase*	pbp;
-	btDbvtProxy*		proxy;
-	btDbvtTreeCollider(btDbvtBroadphase* p) : pbp(p) {}
-	void	Process(const btDbvtNode* na,const btDbvtNode* nb)
-	{
-		if(na!=nb)
-		{
-			btDbvtProxy*	pa=(btDbvtProxy*)na->data;
-			btDbvtProxy*	pb=(btDbvtProxy*)nb->data;
-#if DBVT_BP_SORTPAIRS
-			if(pa->m_uniqueId>pb->m_uniqueId) 
-				btSwap(pa,pb);
-#endif
-			pbp->m_paircache->addOverlappingPair(pa,pb);
-			++pbp->m_newpairs;
-		}
-	}
-	void	Process(const btDbvtNode* n)
-	{
-		Process(n,proxy->leaf);
-	}
-};
-
-//
-// btDbvtBroadphase
-//
-
-//
-btDbvtBroadphase::btDbvtBroadphase(btOverlappingPairCache* paircache)
-{
-	m_deferedcollide	=	false;
-	m_needcleanup		=	true;
-	m_releasepaircache	=	(paircache!=0)?false:true;
-	m_prediction		=	0;
-	m_stageCurrent		=	0;
-	m_fixedleft			=	0;
-	m_fupdates			=	1;
-	m_dupdates			=	0;
-	m_cupdates			=	10;
-	m_newpairs			=	1;
-	m_updates_call		=	0;
-	m_updates_done		=	0;
-	m_updates_ratio		=	0;
-	m_paircache			=	paircache? paircache	: new(btAlignedAlloc(sizeof(btHashedOverlappingPairCache),16)) btHashedOverlappingPairCache();
-	m_gid				=	0;
-	m_pid				=	0;
-	m_cid				=	0;
-	for(int i=0;i<=STAGECOUNT;++i)
-	{
-		m_stageRoots[i]=0;
-	}
-#if DBVT_BP_PROFILE
-	clear(m_profiling);
-#endif
-}
-
-//
-btDbvtBroadphase::~btDbvtBroadphase()
-{
-	if(m_releasepaircache) 
-	{
-		m_paircache->~btOverlappingPairCache();
-		btAlignedFree(m_paircache);
-	}
-}
-
-//
-btBroadphaseProxy*				btDbvtBroadphase::createProxy(	const btVector3& aabbMin,
-															  const btVector3& aabbMax,
-															  int /*shapeType*/,
-															  void* userPtr,
-															  short int collisionFilterGroup,
-															  short int collisionFilterMask,
-															  btDispatcher* /*dispatcher*/,
-															  void* /*multiSapProxy*/)
-{
-	btDbvtProxy*		proxy=new(btAlignedAlloc(sizeof(btDbvtProxy),16)) btDbvtProxy(	aabbMin,aabbMax,userPtr,
-		collisionFilterGroup,
-		collisionFilterMask);
-
-	btDbvtAabbMm aabb = btDbvtVolume::FromMM(aabbMin,aabbMax);
-
-	//bproxy->aabb			=	btDbvtVolume::FromMM(aabbMin,aabbMax);
-	proxy->stage		=	m_stageCurrent;
-	proxy->m_uniqueId	=	++m_gid;
-	proxy->leaf			=	m_sets[0].insert(aabb,proxy);
-	listappend(proxy,m_stageRoots[m_stageCurrent]);
-	if(!m_deferedcollide)
-	{
-		btDbvtTreeCollider	collider(this);
-		collider.proxy=proxy;
-		m_sets[0].collideTV(m_sets[0].m_root,aabb,collider);
-		m_sets[1].collideTV(m_sets[1].m_root,aabb,collider);
-	}
-	return(proxy);
-}
-
-//
-void							btDbvtBroadphase::destroyProxy(	btBroadphaseProxy* absproxy,
-															   btDispatcher* dispatcher)
-{
-	btDbvtProxy*	proxy=(btDbvtProxy*)absproxy;
-	if(proxy->stage==STAGECOUNT)
-		m_sets[1].remove(proxy->leaf);
-	else
-		m_sets[0].remove(proxy->leaf);
-	listremove(proxy,m_stageRoots[proxy->stage]);
-	m_paircache->removeOverlappingPairsContainingProxy(proxy,dispatcher);
-	btAlignedFree(proxy);
-	m_needcleanup=true;
-}
-
-void	btDbvtBroadphase::getAabb(btBroadphaseProxy* absproxy,btVector3& aabbMin, btVector3& aabbMax ) const
-{
-	btDbvtProxy*						proxy=(btDbvtProxy*)absproxy;
-	aabbMin = proxy->m_aabbMin;
-	aabbMax = proxy->m_aabbMax;
-}
-
-struct	BroadphaseRayTester : btDbvt::ICollide
-{
-	btBroadphaseRayCallback& m_rayCallback;
-	BroadphaseRayTester(btBroadphaseRayCallback& orgCallback)
-		:m_rayCallback(orgCallback)
-	{
-	}
-	void					Process(const btDbvtNode* leaf)
-	{
-		btDbvtProxy*	proxy=(btDbvtProxy*)leaf->data;
-		m_rayCallback.process(proxy);
-	}
-};	
-
-void	btDbvtBroadphase::rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback,const btVector3& aabbMin,const btVector3& aabbMax)
-{
-	BroadphaseRayTester callback(rayCallback);
-
-	m_sets[0].rayTestInternal(	m_sets[0].m_root,
-		rayFrom,
-		rayTo,
-		rayCallback.m_rayDirectionInverse,
-		rayCallback.m_signs,
-		rayCallback.m_lambda_max,
-		aabbMin,
-		aabbMax,
-		callback);
-
-	m_sets[1].rayTestInternal(	m_sets[1].m_root,
-		rayFrom,
-		rayTo,
-		rayCallback.m_rayDirectionInverse,
-		rayCallback.m_signs,
-		rayCallback.m_lambda_max,
-		aabbMin,
-		aabbMax,
-		callback);
-
-}
-
-
-struct	BroadphaseAabbTester : btDbvt::ICollide
-{
-	btBroadphaseAabbCallback& m_aabbCallback;
-	BroadphaseAabbTester(btBroadphaseAabbCallback& orgCallback)
-		:m_aabbCallback(orgCallback)
-	{
-	}
-	void					Process(const btDbvtNode* leaf)
-	{
-		btDbvtProxy*	proxy=(btDbvtProxy*)leaf->data;
-		m_aabbCallback.process(proxy);
-	}
-};	
-
-void	btDbvtBroadphase::aabbTest(const btVector3& aabbMin,const btVector3& aabbMax,btBroadphaseAabbCallback& aabbCallback)
-{
-	BroadphaseAabbTester callback(aabbCallback);
-
-	const ATTRIBUTE_ALIGNED16(btDbvtVolume)	bounds=btDbvtVolume::FromMM(aabbMin,aabbMax);
-		//process all children, that overlap with  the given AABB bounds
-	m_sets[0].collideTV(m_sets[0].m_root,bounds,callback);
-	m_sets[1].collideTV(m_sets[1].m_root,bounds,callback);
-
-}
-
-
-
-//
-void							btDbvtBroadphase::setAabb(		btBroadphaseProxy* absproxy,
-														  const btVector3& aabbMin,
-														  const btVector3& aabbMax,
-														  btDispatcher* /*dispatcher*/)
-{
-	btDbvtProxy*						proxy=(btDbvtProxy*)absproxy;
-	ATTRIBUTE_ALIGNED16(btDbvtVolume)	aabb=btDbvtVolume::FromMM(aabbMin,aabbMax);
-#if DBVT_BP_PREVENTFALSEUPDATE
-	if(NotEqual(aabb,proxy->leaf->volume))
-#endif
-	{
-		bool	docollide=false;
-		if(proxy->stage==STAGECOUNT)
-		{/* fixed -> dynamic set	*/ 
-			m_sets[1].remove(proxy->leaf);
-			proxy->leaf=m_sets[0].insert(aabb,proxy);
-			docollide=true;
-		}
-		else
-		{/* dynamic set				*/ 
-			++m_updates_call;
-			if(Intersect(proxy->leaf->volume,aabb))
-			{/* Moving				*/ 
-
-				const btVector3	delta=aabbMin-proxy->m_aabbMin;
-				btVector3		velocity(((proxy->m_aabbMax-proxy->m_aabbMin)/2)*m_prediction);
-				if(delta[0]<0) velocity[0]=-velocity[0];
-				if(delta[1]<0) velocity[1]=-velocity[1];
-				if(delta[2]<0) velocity[2]=-velocity[2];
-				if	(
-#ifdef DBVT_BP_MARGIN				
-					m_sets[0].update(proxy->leaf,aabb,velocity,DBVT_BP_MARGIN)
-#else
-					m_sets[0].update(proxy->leaf,aabb,velocity)
-#endif
-					)
-				{
-					++m_updates_done;
-					docollide=true;
-				}
-			}
-			else
-			{/* Teleporting			*/ 
-				m_sets[0].update(proxy->leaf,aabb);
-				++m_updates_done;
-				docollide=true;
-			}	
-		}
-		listremove(proxy,m_stageRoots[proxy->stage]);
-		proxy->m_aabbMin = aabbMin;
-		proxy->m_aabbMax = aabbMax;
-		proxy->stage	=	m_stageCurrent;
-		listappend(proxy,m_stageRoots[m_stageCurrent]);
-		if(docollide)
-		{
-			m_needcleanup=true;
-			if(!m_deferedcollide)
-			{
-				btDbvtTreeCollider	collider(this);
-				m_sets[1].collideTTpersistentStack(m_sets[1].m_root,proxy->leaf,collider);
-				m_sets[0].collideTTpersistentStack(m_sets[0].m_root,proxy->leaf,collider);
-			}
-		}	
-	}
-}
-
-
-//
-void							btDbvtBroadphase::setAabbForceUpdate(		btBroadphaseProxy* absproxy,
-														  const btVector3& aabbMin,
-														  const btVector3& aabbMax,
-														  btDispatcher* /*dispatcher*/)
-{
-	btDbvtProxy*						proxy=(btDbvtProxy*)absproxy;
-	ATTRIBUTE_ALIGNED16(btDbvtVolume)	aabb=btDbvtVolume::FromMM(aabbMin,aabbMax);
-	bool	docollide=false;
-	if(proxy->stage==STAGECOUNT)
-	{/* fixed -> dynamic set	*/ 
-		m_sets[1].remove(proxy->leaf);
-		proxy->leaf=m_sets[0].insert(aabb,proxy);
-		docollide=true;
-	}
-	else
-	{/* dynamic set				*/ 
-		++m_updates_call;
-		/* Teleporting			*/ 
-		m_sets[0].update(proxy->leaf,aabb);
-		++m_updates_done;
-		docollide=true;
-	}
-	listremove(proxy,m_stageRoots[proxy->stage]);
-	proxy->m_aabbMin = aabbMin;
-	proxy->m_aabbMax = aabbMax;
-	proxy->stage	=	m_stageCurrent;
-	listappend(proxy,m_stageRoots[m_stageCurrent]);
-	if(docollide)
-	{
-		m_needcleanup=true;
-		if(!m_deferedcollide)
-		{
-			btDbvtTreeCollider	collider(this);
-			m_sets[1].collideTTpersistentStack(m_sets[1].m_root,proxy->leaf,collider);
-			m_sets[0].collideTTpersistentStack(m_sets[0].m_root,proxy->leaf,collider);
-		}
-	}	
-}
-
-//
-void							btDbvtBroadphase::calculateOverlappingPairs(btDispatcher* dispatcher)
-{
-	collide(dispatcher);
-#if DBVT_BP_PROFILE
-	if(0==(m_pid%DBVT_BP_PROFILING_RATE))
-	{	
-		printf("fixed(%u) dynamics(%u) pairs(%u)\r\n",m_sets[1].m_leaves,m_sets[0].m_leaves,m_paircache->getNumOverlappingPairs());
-		unsigned int	total=m_profiling.m_total;
-		if(total<=0) total=1;
-		printf("ddcollide: %u%% (%uus)\r\n",(50+m_profiling.m_ddcollide*100)/total,m_profiling.m_ddcollide/DBVT_BP_PROFILING_RATE);
-		printf("fdcollide: %u%% (%uus)\r\n",(50+m_profiling.m_fdcollide*100)/total,m_profiling.m_fdcollide/DBVT_BP_PROFILING_RATE);
-		printf("cleanup:   %u%% (%uus)\r\n",(50+m_profiling.m_cleanup*100)/total,m_profiling.m_cleanup/DBVT_BP_PROFILING_RATE);
-		printf("total:     %uus\r\n",total/DBVT_BP_PROFILING_RATE);
-		const unsigned long	sum=m_profiling.m_ddcollide+
-			m_profiling.m_fdcollide+
-			m_profiling.m_cleanup;
-		printf("leaked: %u%% (%uus)\r\n",100-((50+sum*100)/total),(total-sum)/DBVT_BP_PROFILING_RATE);
-		printf("job counts: %u%%\r\n",(m_profiling.m_jobcount*100)/((m_sets[0].m_leaves+m_sets[1].m_leaves)*DBVT_BP_PROFILING_RATE));
-		clear(m_profiling);
-		m_clock.reset();
-	}
-#endif
-
-	performDeferredRemoval(dispatcher);
-
-}
-
-void btDbvtBroadphase::performDeferredRemoval(btDispatcher* dispatcher)
-{
-
-	if (m_paircache->hasDeferredRemoval())
-	{
-
-		btBroadphasePairArray&	overlappingPairArray = m_paircache->getOverlappingPairArray();
-
-		//perform a sort, to find duplicates and to sort 'invalid' pairs to the end
-		overlappingPairArray.quickSort(btBroadphasePairSortPredicate());
-
-		int invalidPair = 0;
-
-		
-		int i;
-
-		btBroadphasePair previousPair;
-		previousPair.m_pProxy0 = 0;
-		previousPair.m_pProxy1 = 0;
-		previousPair.m_algorithm = 0;
-		
-		
-		for (i=0;i<overlappingPairArray.size();i++)
-		{
-		
-			btBroadphasePair& pair = overlappingPairArray[i];
-
-			bool isDuplicate = (pair == previousPair);
-
-			previousPair = pair;
-
-			bool needsRemoval = false;
-
-			if (!isDuplicate)
-			{
-				//important to perform AABB check that is consistent with the broadphase
-				btDbvtProxy*		pa=(btDbvtProxy*)pair.m_pProxy0;
-				btDbvtProxy*		pb=(btDbvtProxy*)pair.m_pProxy1;
-				bool hasOverlap = Intersect(pa->leaf->volume,pb->leaf->volume);
-
-				if (hasOverlap)
-				{
-					needsRemoval = false;
-				} else
-				{
-					needsRemoval = true;
-				}
-			} else
-			{
-				//remove duplicate
-				needsRemoval = true;
-				//should have no algorithm
-				btAssert(!pair.m_algorithm);
-			}
-			
-			if (needsRemoval)
-			{
-				m_paircache->cleanOverlappingPair(pair,dispatcher);
-
-				pair.m_pProxy0 = 0;
-				pair.m_pProxy1 = 0;
-				invalidPair++;
-			} 
-			
-		}
-
-		//perform a sort, to sort 'invalid' pairs to the end
-		overlappingPairArray.quickSort(btBroadphasePairSortPredicate());
-		overlappingPairArray.resize(overlappingPairArray.size() - invalidPair);
-	}
-}
-
-//
-void							btDbvtBroadphase::collide(btDispatcher* dispatcher)
-{
-	/*printf("---------------------------------------------------------\n");
-	printf("m_sets[0].m_leaves=%d\n",m_sets[0].m_leaves);
-	printf("m_sets[1].m_leaves=%d\n",m_sets[1].m_leaves);
-	printf("numPairs = %d\n",getOverlappingPairCache()->getNumOverlappingPairs());
-	{
-		int i;
-		for (i=0;i<getOverlappingPairCache()->getNumOverlappingPairs();i++)
-		{
-			printf("pair[%d]=(%d,%d),",i,getOverlappingPairCache()->getOverlappingPairArray()[i].m_pProxy0->getUid(),
-				getOverlappingPairCache()->getOverlappingPairArray()[i].m_pProxy1->getUid());
-		}
-		printf("\n");
-	}
-*/
-
-
-
-	SPC(m_profiling.m_total);
-	/* optimize				*/ 
-	m_sets[0].optimizeIncremental(1+(m_sets[0].m_leaves*m_dupdates)/100);
-	if(m_fixedleft)
-	{
-		const int count=1+(m_sets[1].m_leaves*m_fupdates)/100;
-		m_sets[1].optimizeIncremental(1+(m_sets[1].m_leaves*m_fupdates)/100);
-		m_fixedleft=btMax<int>(0,m_fixedleft-count);
-	}
-	/* dynamic -> fixed set	*/ 
-	m_stageCurrent=(m_stageCurrent+1)%STAGECOUNT;
-	btDbvtProxy*	current=m_stageRoots[m_stageCurrent];
-	if(current)
-	{
-		btDbvtTreeCollider	collider(this);
-		do	{
-			btDbvtProxy*	next=current->links[1];
-			listremove(current,m_stageRoots[current->stage]);
-			listappend(current,m_stageRoots[STAGECOUNT]);
-#if DBVT_BP_ACCURATESLEEPING
-			m_paircache->removeOverlappingPairsContainingProxy(current,dispatcher);
-			collider.proxy=current;
-			btDbvt::collideTV(m_sets[0].m_root,current->aabb,collider);
-			btDbvt::collideTV(m_sets[1].m_root,current->aabb,collider);
-#endif
-			m_sets[0].remove(current->leaf);
-			ATTRIBUTE_ALIGNED16(btDbvtVolume)	curAabb=btDbvtVolume::FromMM(current->m_aabbMin,current->m_aabbMax);
-			current->leaf	=	m_sets[1].insert(curAabb,current);
-			current->stage	=	STAGECOUNT;	
-			current			=	next;
-		} while(current);
-		m_fixedleft=m_sets[1].m_leaves;
-		m_needcleanup=true;
-	}
-	/* collide dynamics		*/ 
-	{
-		btDbvtTreeCollider	collider(this);
-		if(m_deferedcollide)
-		{
-			SPC(m_profiling.m_fdcollide);
-			m_sets[0].collideTTpersistentStack(m_sets[0].m_root,m_sets[1].m_root,collider);
-		}
-		if(m_deferedcollide)
-		{
-			SPC(m_profiling.m_ddcollide);
-			m_sets[0].collideTTpersistentStack(m_sets[0].m_root,m_sets[0].m_root,collider);
-		}
-	}
-	/* clean up				*/ 
-	if(m_needcleanup)
-	{
-		SPC(m_profiling.m_cleanup);
-		btBroadphasePairArray&	pairs=m_paircache->getOverlappingPairArray();
-		if(pairs.size()>0)
-		{
-
-			int			ni=btMin(pairs.size(),btMax<int>(m_newpairs,(pairs.size()*m_cupdates)/100));
-			for(int i=0;i<ni;++i)
-			{
-				btBroadphasePair&	p=pairs[(m_cid+i)%pairs.size()];
-				btDbvtProxy*		pa=(btDbvtProxy*)p.m_pProxy0;
-				btDbvtProxy*		pb=(btDbvtProxy*)p.m_pProxy1;
-				if(!Intersect(pa->leaf->volume,pb->leaf->volume))
-				{
-#if DBVT_BP_SORTPAIRS
-					if(pa->m_uniqueId>pb->m_uniqueId) 
-						btSwap(pa,pb);
-#endif
-					m_paircache->removeOverlappingPair(pa,pb,dispatcher);
-					--ni;--i;
-				}
-			}
-			if(pairs.size()>0) m_cid=(m_cid+ni)%pairs.size(); else m_cid=0;
-		}
-	}
-	++m_pid;
-	m_newpairs=1;
-	m_needcleanup=false;
-	if(m_updates_call>0)
-	{ m_updates_ratio=m_updates_done/(btScalar)m_updates_call; }
-	else
-	{ m_updates_ratio=0; }
-	m_updates_done/=2;
-	m_updates_call/=2;
-}
-
-//
-void							btDbvtBroadphase::optimize()
-{
-	m_sets[0].optimizeTopDown();
-	m_sets[1].optimizeTopDown();
-}
-
-//
-btOverlappingPairCache*			btDbvtBroadphase::getOverlappingPairCache()
-{
-	return(m_paircache);
-}
-
-//
-const btOverlappingPairCache*	btDbvtBroadphase::getOverlappingPairCache() const
-{
-	return(m_paircache);
-}
-
-//
-void							btDbvtBroadphase::getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const
-{
-
-	ATTRIBUTE_ALIGNED16(btDbvtVolume)	bounds;
-
-	if(!m_sets[0].empty())
-		if(!m_sets[1].empty())	Merge(	m_sets[0].m_root->volume,
-			m_sets[1].m_root->volume,bounds);
-		else
-			bounds=m_sets[0].m_root->volume;
-	else if(!m_sets[1].empty())	bounds=m_sets[1].m_root->volume;
-	else
-		bounds=btDbvtVolume::FromCR(btVector3(0,0,0),0);
-	aabbMin=bounds.Mins();
-	aabbMax=bounds.Maxs();
-}
-
-void btDbvtBroadphase::resetPool(btDispatcher* dispatcher)
-{
-	
-	int totalObjects = m_sets[0].m_leaves + m_sets[1].m_leaves;
-	if (!totalObjects)
-	{
-		//reset internal dynamic tree data structures
-		m_sets[0].clear();
-		m_sets[1].clear();
-		
-		m_deferedcollide	=	false;
-		m_needcleanup		=	true;
-		m_stageCurrent		=	0;
-		m_fixedleft			=	0;
-		m_fupdates			=	1;
-		m_dupdates			=	0;
-		m_cupdates			=	10;
-		m_newpairs			=	1;
-		m_updates_call		=	0;
-		m_updates_done		=	0;
-		m_updates_ratio		=	0;
-		
-		m_gid				=	0;
-		m_pid				=	0;
-		m_cid				=	0;
-		for(int i=0;i<=STAGECOUNT;++i)
-		{
-			m_stageRoots[i]=0;
-		}
-	}
-}
-
-//
-void							btDbvtBroadphase::printStats()
-{}
-
-//
-#if DBVT_BP_ENABLE_BENCHMARK
-
-struct	btBroadphaseBenchmark
-{
-	struct	Experiment
-	{
-		const char*			name;
-		int					object_count;
-		int					update_count;
-		int					spawn_count;
-		int					iterations;
-		btScalar			speed;
-		btScalar			amplitude;
-	};
-	struct	Object
-	{
-		btVector3			center;
-		btVector3			extents;
-		btBroadphaseProxy*	proxy;
-		btScalar			time;
-		void				update(btScalar speed,btScalar amplitude,btBroadphaseInterface* pbi)
-		{
-			time		+=	speed;
-			center[0]	=	btCos(time*(btScalar)2.17)*amplitude+
-				btSin(time)*amplitude/2;
-			center[1]	=	btCos(time*(btScalar)1.38)*amplitude+
-				btSin(time)*amplitude;
-			center[2]	=	btSin(time*(btScalar)0.777)*amplitude;
-			pbi->setAabb(proxy,center-extents,center+extents,0);
-		}
-	};
-	static int		UnsignedRand(int range=RAND_MAX-1)	{ return(rand()%(range+1)); }
-	static btScalar	UnitRand()							{ return(UnsignedRand(16384)/(btScalar)16384); }
-	static void		OutputTime(const char* name,btClock& c,unsigned count=0)
-	{
-		const unsigned long	us=c.getTimeMicroseconds();
-		const unsigned long	ms=(us+500)/1000;
-		const btScalar		sec=us/(btScalar)(1000*1000);
-		if(count>0)
-			printf("%s : %u us (%u ms), %.2f/s\r\n",name,us,ms,count/sec);
-		else
-			printf("%s : %u us (%u ms)\r\n",name,us,ms);
-	}
-};
-
-void							btDbvtBroadphase::benchmark(btBroadphaseInterface* pbi)
-{
-	static const btBroadphaseBenchmark::Experiment		experiments[]=
-	{
-		{"1024o.10%",1024,10,0,8192,(btScalar)0.005,(btScalar)100},
-		/*{"4096o.10%",4096,10,0,8192,(btScalar)0.005,(btScalar)100},
-		{"8192o.10%",8192,10,0,8192,(btScalar)0.005,(btScalar)100},*/
-	};
-	static const int										nexperiments=sizeof(experiments)/sizeof(experiments[0]);
-	btAlignedObjectArray<btBroadphaseBenchmark::Object*>	objects;
-	btClock													wallclock;
-	/* Begin			*/ 
-	for(int iexp=0;iexp<nexperiments;++iexp)
-	{
-		const btBroadphaseBenchmark::Experiment&	experiment=experiments[iexp];
-		const int									object_count=experiment.object_count;
-		const int									update_count=(object_count*experiment.update_count)/100;
-		const int									spawn_count=(object_count*experiment.spawn_count)/100;
-		const btScalar								speed=experiment.speed;	
-		const btScalar								amplitude=experiment.amplitude;
-		printf("Experiment #%u '%s':\r\n",iexp,experiment.name);
-		printf("\tObjects: %u\r\n",object_count);
-		printf("\tUpdate: %u\r\n",update_count);
-		printf("\tSpawn: %u\r\n",spawn_count);
-		printf("\tSpeed: %f\r\n",speed);
-		printf("\tAmplitude: %f\r\n",amplitude);
-		srand(180673);
-		/* Create objects	*/ 
-		wallclock.reset();
-		objects.reserve(object_count);
-		for(int i=0;i<object_count;++i)
-		{
-			btBroadphaseBenchmark::Object*	po=new btBroadphaseBenchmark::Object();
-			po->center[0]=btBroadphaseBenchmark::UnitRand()*50;
-			po->center[1]=btBroadphaseBenchmark::UnitRand()*50;
-			po->center[2]=btBroadphaseBenchmark::UnitRand()*50;
-			po->extents[0]=btBroadphaseBenchmark::UnitRand()*2+2;
-			po->extents[1]=btBroadphaseBenchmark::UnitRand()*2+2;
-			po->extents[2]=btBroadphaseBenchmark::UnitRand()*2+2;
-			po->time=btBroadphaseBenchmark::UnitRand()*2000;
-			po->proxy=pbi->createProxy(po->center-po->extents,po->center+po->extents,0,po,1,1,0,0);
-			objects.push_back(po);
-		}
-		btBroadphaseBenchmark::OutputTime("\tInitialization",wallclock);
-		/* First update		*/ 
-		wallclock.reset();
-		for(int i=0;i<objects.size();++i)
-		{
-			objects[i]->update(speed,amplitude,pbi);
-		}
-		btBroadphaseBenchmark::OutputTime("\tFirst update",wallclock);
-		/* Updates			*/ 
-		wallclock.reset();
-		for(int i=0;i<experiment.iterations;++i)
-		{
-			for(int j=0;j<update_count;++j)
-			{				
-				objects[j]->update(speed,amplitude,pbi);
-			}
-			pbi->calculateOverlappingPairs(0);
-		}
-		btBroadphaseBenchmark::OutputTime("\tUpdate",wallclock,experiment.iterations);
-		/* Clean up			*/ 
-		wallclock.reset();
-		for(int i=0;i<objects.size();++i)
-		{
-			pbi->destroyProxy(objects[i]->proxy,0);
-			delete objects[i];
-		}
-		objects.resize(0);
-		btBroadphaseBenchmark::OutputTime("\tRelease",wallclock);
-	}
-
-}
-#else
-void							btDbvtBroadphase::benchmark(btBroadphaseInterface*)
-{}
-#endif
-
-#if DBVT_BP_PROFILE
-#undef	SPC
-#endif
-
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.h
deleted file mode 100644
index 18b64ad..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-///btDbvtBroadphase implementation by Nathanael Presson
-#ifndef BT_DBVT_BROADPHASE_H
-#define BT_DBVT_BROADPHASE_H
-
-#include "BulletCollision/BroadphaseCollision/btDbvt.h"
-#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"
-
-//
-// Compile time config
-//
-
-#define	DBVT_BP_PROFILE					0
-//#define DBVT_BP_SORTPAIRS				1
-#define DBVT_BP_PREVENTFALSEUPDATE		0
-#define DBVT_BP_ACCURATESLEEPING		0
-#define DBVT_BP_ENABLE_BENCHMARK		0
-#define DBVT_BP_MARGIN					(btScalar)0.05
-
-#if DBVT_BP_PROFILE
-#define	DBVT_BP_PROFILING_RATE	256
-#include "LinearMath/btQuickprof.h"
-#endif
-
-//
-// btDbvtProxy
-//
-struct btDbvtProxy : btBroadphaseProxy
-{
-	/* Fields		*/ 
-	//btDbvtAabbMm	aabb;
-	btDbvtNode*		leaf;
-	btDbvtProxy*	links[2];
-	int				stage;
-	/* ctor			*/ 
-	btDbvtProxy(const btVector3& aabbMin,const btVector3& aabbMax,void* userPtr,short int collisionFilterGroup, short int collisionFilterMask) :
-	btBroadphaseProxy(aabbMin,aabbMax,userPtr,collisionFilterGroup,collisionFilterMask)
-	{
-		links[0]=links[1]=0;
-	}
-};
-
-typedef btAlignedObjectArray<btDbvtProxy*>	btDbvtProxyArray;
-
-///The btDbvtBroadphase implements a broadphase using two dynamic AABB bounding volume hierarchies/trees (see btDbvt).
-///One tree is used for static/non-moving objects, and another tree is used for dynamic objects. Objects can move from one tree to the other.
-///This is a very fast broadphase, especially for very dynamic worlds where many objects are moving. Its insert/add and remove of objects is generally faster than the sweep and prune broadphases btAxisSweep3 and bt32BitAxisSweep3.
-struct	btDbvtBroadphase : btBroadphaseInterface
-{
-	/* Config		*/ 
-	enum	{
-		DYNAMIC_SET			=	0,	/* Dynamic set index	*/ 
-		FIXED_SET			=	1,	/* Fixed set index		*/ 
-		STAGECOUNT			=	2	/* Number of stages		*/ 
-	};
-	/* Fields		*/ 
-	btDbvt					m_sets[2];					// Dbvt sets
-	btDbvtProxy*			m_stageRoots[STAGECOUNT+1];	// Stages list
-	btOverlappingPairCache*	m_paircache;				// Pair cache
-	btScalar				m_prediction;				// Velocity prediction
-	int						m_stageCurrent;				// Current stage
-	int						m_fupdates;					// % of fixed updates per frame
-	int						m_dupdates;					// % of dynamic updates per frame
-	int						m_cupdates;					// % of cleanup updates per frame
-	int						m_newpairs;					// Number of pairs created
-	int						m_fixedleft;				// Fixed optimization left
-	unsigned				m_updates_call;				// Number of updates call
-	unsigned				m_updates_done;				// Number of updates done
-	btScalar				m_updates_ratio;			// m_updates_done/m_updates_call
-	int						m_pid;						// Parse id
-	int						m_cid;						// Cleanup index
-	int						m_gid;						// Gen id
-	bool					m_releasepaircache;			// Release pair cache on delete
-	bool					m_deferedcollide;			// Defere dynamic/static collision to collide call
-	bool					m_needcleanup;				// Need to run cleanup?
-#if DBVT_BP_PROFILE
-	btClock					m_clock;
-	struct	{
-		unsigned long		m_total;
-		unsigned long		m_ddcollide;
-		unsigned long		m_fdcollide;
-		unsigned long		m_cleanup;
-		unsigned long		m_jobcount;
-	}				m_profiling;
-#endif
-	/* Methods		*/ 
-	btDbvtBroadphase(btOverlappingPairCache* paircache=0);
-	~btDbvtBroadphase();
-	void							collide(btDispatcher* dispatcher);
-	void							optimize();
-	
-	/* btBroadphaseInterface Implementation	*/
-	btBroadphaseProxy*				createProxy(const btVector3& aabbMin,const btVector3& aabbMax,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy);
-	virtual void					destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
-	virtual void					setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher);
-	virtual void					rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0), const btVector3& aabbMax = btVector3(0,0,0));
-	virtual void					aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback);
-
-	virtual void					getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;
-	virtual	void					calculateOverlappingPairs(btDispatcher* dispatcher);
-	virtual	btOverlappingPairCache*	getOverlappingPairCache();
-	virtual	const btOverlappingPairCache*	getOverlappingPairCache() const;
-	virtual	void					getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const;
-	virtual	void					printStats();
-
-
-	///reset broadphase internal structures, to ensure determinism/reproducability
-	virtual void resetPool(btDispatcher* dispatcher);
-
-	void	performDeferredRemoval(btDispatcher* dispatcher);
-	
-	void	setVelocityPrediction(btScalar prediction)
-	{
-		m_prediction = prediction;
-	}
-	btScalar getVelocityPrediction() const
-	{
-		return m_prediction;
-	}
-
-	///this setAabbForceUpdate is similar to setAabb but always forces the aabb update. 
-	///it is not part of the btBroadphaseInterface but specific to btDbvtBroadphase.
-	///it bypasses certain optimizations that prevent aabb updates (when the aabb shrinks), see
-	///http://code.google.com/p/bullet/issues/detail?id=223
-	void							setAabbForceUpdate(		btBroadphaseProxy* absproxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* /*dispatcher*/);
-
-	static void						benchmark(btBroadphaseInterface*);
-
-
-};
-
-#endif
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDispatcher.cpp b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDispatcher.cpp
deleted file mode 100644
index 2076822..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDispatcher.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btDispatcher.h"
-
-btDispatcher::~btDispatcher()
-{
-
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDispatcher.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDispatcher.h
deleted file mode 100644
index a79cf94..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDispatcher.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_DISPATCHER_H
-#define BT_DISPATCHER_H
-#include "LinearMath/btScalar.h"
-
-class btCollisionAlgorithm;
-struct btBroadphaseProxy;
-class btRigidBody;
-class	btCollisionObject;
-class btOverlappingPairCache;
-
-
-class btPersistentManifold;
-class btStackAlloc;
-class btPoolAllocator;
-
-struct btDispatcherInfo
-{
-	enum DispatchFunc
-	{
-		DISPATCH_DISCRETE = 1,
-		DISPATCH_CONTINUOUS
-	};
-	btDispatcherInfo()
-		:m_timeStep(btScalar(0.)),
-		m_stepCount(0),
-		m_dispatchFunc(DISPATCH_DISCRETE),
-		m_timeOfImpact(btScalar(1.)),
-		m_useContinuous(true),
-		m_debugDraw(0),
-		m_enableSatConvex(false),
-		m_enableSPU(true),
-		m_useEpa(true),
-		m_allowedCcdPenetration(btScalar(0.04)),
-		m_useConvexConservativeDistanceUtil(false),
-		m_convexConservativeDistanceThreshold(0.0f),
-		m_stackAllocator(0)
-	{
-
-	}
-	btScalar	m_timeStep;
-	int			m_stepCount;
-	int			m_dispatchFunc;
-	mutable btScalar	m_timeOfImpact;
-	bool		m_useContinuous;
-	class btIDebugDraw*	m_debugDraw;
-	bool		m_enableSatConvex;
-	bool		m_enableSPU;
-	bool		m_useEpa;
-	btScalar	m_allowedCcdPenetration;
-	bool		m_useConvexConservativeDistanceUtil;
-	btScalar	m_convexConservativeDistanceThreshold;
-	btStackAlloc*	m_stackAllocator;
-};
-
-///The btDispatcher interface class can be used in combination with broadphase to dispatch calculations for overlapping pairs.
-///For example for pairwise collision detection, calculating contact points stored in btPersistentManifold or user callbacks (game logic).
-class btDispatcher
-{
-
-
-public:
-	virtual ~btDispatcher() ;
-
-	virtual btCollisionAlgorithm* findAlgorithm(btCollisionObject* body0,btCollisionObject* body1,btPersistentManifold* sharedManifold=0) = 0;
-
-	virtual btPersistentManifold*	getNewManifold(void* body0,void* body1)=0;
-
-	virtual void releaseManifold(btPersistentManifold* manifold)=0;
-
-	virtual void clearManifold(btPersistentManifold* manifold)=0;
-
-	virtual bool	needsCollision(btCollisionObject* body0,btCollisionObject* body1) = 0;
-
-	virtual bool	needsResponse(btCollisionObject* body0,btCollisionObject* body1)=0;
-
-	virtual void	dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher)  =0;
-
-	virtual int getNumManifolds() const = 0;
-
-	virtual btPersistentManifold* getManifoldByIndexInternal(int index) = 0;
-
-	virtual	btPersistentManifold**	getInternalManifoldPointer() = 0;
-
-	virtual	btPoolAllocator*	getInternalManifoldPool() = 0;
-
-	virtual	const btPoolAllocator*	getInternalManifoldPool() const = 0;
-
-	virtual	void* allocateCollisionAlgorithm(int size)  = 0;
-
-	virtual	void freeCollisionAlgorithm(void* ptr) = 0;
-
-};
-
-
-#endif //BT_DISPATCHER_H
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp
deleted file mode 100644
index 6712f52..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp
+++ /dev/null
@@ -1,489 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btMultiSapBroadphase.h"
-
-#include "btSimpleBroadphase.h"
-#include "LinearMath/btAabbUtil2.h"
-#include "btQuantizedBvh.h"
-
-///	btSapBroadphaseArray	m_sapBroadphases;
-
-///	btOverlappingPairCache*	m_overlappingPairs;
-extern int gOverlappingPairs;
-
-/*
-class btMultiSapSortedOverlappingPairCache : public btSortedOverlappingPairCache
-{
-public:
-
-	virtual btBroadphasePair*	addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1)
-	{
-		return btSortedOverlappingPairCache::addOverlappingPair((btBroadphaseProxy*)proxy0->m_multiSapParentProxy,(btBroadphaseProxy*)proxy1->m_multiSapParentProxy);
-	}
-};
-
-*/
-
-btMultiSapBroadphase::btMultiSapBroadphase(int /*maxProxies*/,btOverlappingPairCache* pairCache)
-:m_overlappingPairs(pairCache),
-m_optimizedAabbTree(0),
-m_ownsPairCache(false),
-m_invalidPair(0)
-{
-	if (!m_overlappingPairs)
-	{
-		m_ownsPairCache = true;
-		void* mem = btAlignedAlloc(sizeof(btSortedOverlappingPairCache),16);
-		m_overlappingPairs = new (mem)btSortedOverlappingPairCache();
-	}
-
-	struct btMultiSapOverlapFilterCallback : public btOverlapFilterCallback
-	{
-		virtual ~btMultiSapOverlapFilterCallback()
-		{}
-		// return true when pairs need collision
-		virtual bool	needBroadphaseCollision(btBroadphaseProxy* childProxy0,btBroadphaseProxy* childProxy1) const
-		{
-			btBroadphaseProxy* multiProxy0 = (btBroadphaseProxy*)childProxy0->m_multiSapParentProxy;
-			btBroadphaseProxy* multiProxy1 = (btBroadphaseProxy*)childProxy1->m_multiSapParentProxy;
-			
-			bool collides = (multiProxy0->m_collisionFilterGroup & multiProxy1->m_collisionFilterMask) != 0;
-			collides = collides && (multiProxy1->m_collisionFilterGroup & multiProxy0->m_collisionFilterMask);
-	
-			return collides;
-		}
-	};
-
-	void* mem = btAlignedAlloc(sizeof(btMultiSapOverlapFilterCallback),16);
-	m_filterCallback = new (mem)btMultiSapOverlapFilterCallback();
-
-	m_overlappingPairs->setOverlapFilterCallback(m_filterCallback);
-//	mem = btAlignedAlloc(sizeof(btSimpleBroadphase),16);
-//	m_simpleBroadphase = new (mem) btSimpleBroadphase(maxProxies,m_overlappingPairs);
-}
-
-btMultiSapBroadphase::~btMultiSapBroadphase()
-{
-	if (m_ownsPairCache)
-	{
-		m_overlappingPairs->~btOverlappingPairCache();
-		btAlignedFree(m_overlappingPairs);
-	}
-}
-
-
-void	btMultiSapBroadphase::buildTree(const btVector3& bvhAabbMin,const btVector3& bvhAabbMax)
-{
-	m_optimizedAabbTree = new btQuantizedBvh();
-	m_optimizedAabbTree->setQuantizationValues(bvhAabbMin,bvhAabbMax);
-	QuantizedNodeArray&	nodes = m_optimizedAabbTree->getLeafNodeArray();
-	for (int i=0;i<m_sapBroadphases.size();i++)
-	{
-		btQuantizedBvhNode node;
-		btVector3 aabbMin,aabbMax;
-		m_sapBroadphases[i]->getBroadphaseAabb(aabbMin,aabbMax);
-		m_optimizedAabbTree->quantize(&node.m_quantizedAabbMin[0],aabbMin,0);
-		m_optimizedAabbTree->quantize(&node.m_quantizedAabbMax[0],aabbMax,1);
-		int partId = 0;
-		node.m_escapeIndexOrTriangleIndex = (partId<<(31-MAX_NUM_PARTS_IN_BITS)) | i;
-		nodes.push_back(node);
-	}
-	m_optimizedAabbTree->buildInternal();
-}
-
-btBroadphaseProxy*	btMultiSapBroadphase::createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher,void* /*ignoreMe*/)
-{
-	//void* ignoreMe -> we could think of recursive multi-sap, if someone is interested
-
-	void* mem = btAlignedAlloc(sizeof(btMultiSapProxy),16);
-	btMultiSapProxy* proxy = new (mem)btMultiSapProxy(aabbMin,  aabbMax,shapeType,userPtr, collisionFilterGroup,collisionFilterMask);
-	m_multiSapProxies.push_back(proxy);
-
-	///this should deal with inserting/removal into child broadphases
-	setAabb(proxy,aabbMin,aabbMax,dispatcher);
-	return proxy;
-}
-
-void	btMultiSapBroadphase::destroyProxy(btBroadphaseProxy* /*proxy*/,btDispatcher* /*dispatcher*/)
-{
-	///not yet
-	btAssert(0);
-
-}
-
-
-void	btMultiSapBroadphase::addToChildBroadphase(btMultiSapProxy* parentMultiSapProxy, btBroadphaseProxy* childProxy, btBroadphaseInterface*	childBroadphase)
-{
-	void* mem = btAlignedAlloc(sizeof(btBridgeProxy),16);
-	btBridgeProxy* bridgeProxyRef = new(mem) btBridgeProxy;
-	bridgeProxyRef->m_childProxy = childProxy;
-	bridgeProxyRef->m_childBroadphase = childBroadphase;
-	parentMultiSapProxy->m_bridgeProxies.push_back(bridgeProxyRef);
-}
-
-
-bool boxIsContainedWithinBox(const btVector3& amin,const btVector3& amax,const btVector3& bmin,const btVector3& bmax);
-bool boxIsContainedWithinBox(const btVector3& amin,const btVector3& amax,const btVector3& bmin,const btVector3& bmax)
-{
-return
-amin.getX() >= bmin.getX() && amax.getX() <= bmax.getX() &&
-amin.getY() >= bmin.getY() && amax.getY() <= bmax.getY() &&
-amin.getZ() >= bmin.getZ() && amax.getZ() <= bmax.getZ();
-}
-
-
-
-
-
-
-void	btMultiSapBroadphase::getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const
-{
-	btMultiSapProxy* multiProxy = static_cast<btMultiSapProxy*>(proxy);
-	aabbMin = multiProxy->m_aabbMin;
-	aabbMax = multiProxy->m_aabbMax;
-}
-
-void	btMultiSapBroadphase::rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin,const btVector3& aabbMax)
-{
-	for (int i=0;i<m_multiSapProxies.size();i++)
-	{
-		rayCallback.process(m_multiSapProxies[i]);
-	}
-}
-
-
-//#include <stdio.h>
-
-void	btMultiSapBroadphase::setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher)
-{
-	btMultiSapProxy* multiProxy = static_cast<btMultiSapProxy*>(proxy);
-	multiProxy->m_aabbMin = aabbMin;
-	multiProxy->m_aabbMax = aabbMax;
-	
-	
-//	bool fullyContained = false;
-//	bool alreadyInSimple = false;
-	
-
-
-	
-	struct MyNodeOverlapCallback : public btNodeOverlapCallback
-	{
-		btMultiSapBroadphase*	m_multiSap;
-		btMultiSapProxy*		m_multiProxy;
-		btDispatcher*			m_dispatcher;
-
-		MyNodeOverlapCallback(btMultiSapBroadphase* multiSap,btMultiSapProxy* multiProxy,btDispatcher* dispatcher)
-			:m_multiSap(multiSap),
-			m_multiProxy(multiProxy),
-			m_dispatcher(dispatcher)
-		{
-
-		}
-
-		virtual void processNode(int /*nodeSubPart*/, int broadphaseIndex)
-		{
-			btBroadphaseInterface* childBroadphase = m_multiSap->getBroadphaseArray()[broadphaseIndex];
-
-			int containingBroadphaseIndex = -1;
-			//already found?
-			for (int i=0;i<m_multiProxy->m_bridgeProxies.size();i++)
-			{
-
-				if (m_multiProxy->m_bridgeProxies[i]->m_childBroadphase == childBroadphase)
-				{
-					containingBroadphaseIndex = i;
-					break;
-				}
-			}
-			if (containingBroadphaseIndex<0)
-			{
-				//add it
-				btBroadphaseProxy* childProxy = childBroadphase->createProxy(m_multiProxy->m_aabbMin,m_multiProxy->m_aabbMax,m_multiProxy->m_shapeType,m_multiProxy->m_clientObject,m_multiProxy->m_collisionFilterGroup,m_multiProxy->m_collisionFilterMask, m_dispatcher,m_multiProxy);
-				m_multiSap->addToChildBroadphase(m_multiProxy,childProxy,childBroadphase);
-
-			}
-		}
-	};
-
-	MyNodeOverlapCallback	myNodeCallback(this,multiProxy,dispatcher);
-
-
-
-	
-	if (m_optimizedAabbTree)
-		m_optimizedAabbTree->reportAabbOverlappingNodex(&myNodeCallback,aabbMin,aabbMax);
-
-	int i;
-
-	for ( i=0;i<multiProxy->m_bridgeProxies.size();i++)
-	{
-		btVector3 worldAabbMin,worldAabbMax;
-		multiProxy->m_bridgeProxies[i]->m_childBroadphase->getBroadphaseAabb(worldAabbMin,worldAabbMax);
-		bool overlapsBroadphase = TestAabbAgainstAabb2(worldAabbMin,worldAabbMax,multiProxy->m_aabbMin,multiProxy->m_aabbMax);
-		if (!overlapsBroadphase)
-		{
-			//remove it now
-			btBridgeProxy* bridgeProxy = multiProxy->m_bridgeProxies[i];
-
-			btBroadphaseProxy* childProxy = bridgeProxy->m_childProxy;
-			bridgeProxy->m_childBroadphase->destroyProxy(childProxy,dispatcher);
-			
-			multiProxy->m_bridgeProxies.swap( i,multiProxy->m_bridgeProxies.size()-1);
-			multiProxy->m_bridgeProxies.pop_back();
-
-		}
-	}
-
-
-	/*
-
-	if (1)
-	{
-
-		//find broadphase that contain this multiProxy
-		int numChildBroadphases = getBroadphaseArray().size();
-		for (int i=0;i<numChildBroadphases;i++)
-		{
-			btBroadphaseInterface* childBroadphase = getBroadphaseArray()[i];
-			btVector3 worldAabbMin,worldAabbMax;
-			childBroadphase->getBroadphaseAabb(worldAabbMin,worldAabbMax);
-			bool overlapsBroadphase = TestAabbAgainstAabb2(worldAabbMin,worldAabbMax,multiProxy->m_aabbMin,multiProxy->m_aabbMax);
-			
-		//	fullyContained = fullyContained || boxIsContainedWithinBox(worldAabbMin,worldAabbMax,multiProxy->m_aabbMin,multiProxy->m_aabbMax);
-			int containingBroadphaseIndex = -1;
-			
-			//if already contains this
-			
-			for (int i=0;i<multiProxy->m_bridgeProxies.size();i++)
-			{
-				if (multiProxy->m_bridgeProxies[i]->m_childBroadphase == childBroadphase)
-				{
-					containingBroadphaseIndex = i;
-				}
-				alreadyInSimple = alreadyInSimple || (multiProxy->m_bridgeProxies[i]->m_childBroadphase == m_simpleBroadphase);
-			}
-
-			if (overlapsBroadphase)
-			{
-				if (containingBroadphaseIndex<0)
-				{
-					btBroadphaseProxy* childProxy = childBroadphase->createProxy(aabbMin,aabbMax,multiProxy->m_shapeType,multiProxy->m_clientObject,multiProxy->m_collisionFilterGroup,multiProxy->m_collisionFilterMask, dispatcher);
-					childProxy->m_multiSapParentProxy = multiProxy;
-					addToChildBroadphase(multiProxy,childProxy,childBroadphase);
-				}
-			} else
-			{
-				if (containingBroadphaseIndex>=0)
-				{
-					//remove
-					btBridgeProxy* bridgeProxy = multiProxy->m_bridgeProxies[containingBroadphaseIndex];
-
-					btBroadphaseProxy* childProxy = bridgeProxy->m_childProxy;
-					bridgeProxy->m_childBroadphase->destroyProxy(childProxy,dispatcher);
-					
-					multiProxy->m_bridgeProxies.swap( containingBroadphaseIndex,multiProxy->m_bridgeProxies.size()-1);
-					multiProxy->m_bridgeProxies.pop_back();
-				}
-			}
-		}
-
-
-		///If we are in no other child broadphase, stick the proxy in the global 'simple' broadphase (brute force)
-		///hopefully we don't end up with many entries here (can assert/provide feedback on stats)
-		if (0)//!multiProxy->m_bridgeProxies.size())
-		{
-			///we don't pass the userPtr but our multisap proxy. We need to patch this, before processing an actual collision
-			///this is needed to be able to calculate the aabb overlap
-			btBroadphaseProxy* childProxy = m_simpleBroadphase->createProxy(aabbMin,aabbMax,multiProxy->m_shapeType,multiProxy->m_clientObject,multiProxy->m_collisionFilterGroup,multiProxy->m_collisionFilterMask, dispatcher);
-			childProxy->m_multiSapParentProxy = multiProxy;
-			addToChildBroadphase(multiProxy,childProxy,m_simpleBroadphase);
-		}
-	}
-
-	if (!multiProxy->m_bridgeProxies.size())
-	{
-		///we don't pass the userPtr but our multisap proxy. We need to patch this, before processing an actual collision
-		///this is needed to be able to calculate the aabb overlap
-		btBroadphaseProxy* childProxy = m_simpleBroadphase->createProxy(aabbMin,aabbMax,multiProxy->m_shapeType,multiProxy->m_clientObject,multiProxy->m_collisionFilterGroup,multiProxy->m_collisionFilterMask, dispatcher);
-		childProxy->m_multiSapParentProxy = multiProxy;
-		addToChildBroadphase(multiProxy,childProxy,m_simpleBroadphase);
-	}
-*/
-
-
-	//update
-	for ( i=0;i<multiProxy->m_bridgeProxies.size();i++)
-	{
-		btBridgeProxy* bridgeProxyRef = multiProxy->m_bridgeProxies[i];
-		bridgeProxyRef->m_childBroadphase->setAabb(bridgeProxyRef->m_childProxy,aabbMin,aabbMax,dispatcher);
-	}
-
-}
-bool stopUpdating=false;
-
-
-
-class btMultiSapBroadphasePairSortPredicate
-{
-	public:
-
-		bool operator() ( const btBroadphasePair& a1, const btBroadphasePair& b1 )
-		{
-				btMultiSapBroadphase::btMultiSapProxy* aProxy0 = a1.m_pProxy0 ? (btMultiSapBroadphase::btMultiSapProxy*)a1.m_pProxy0->m_multiSapParentProxy : 0;
-				btMultiSapBroadphase::btMultiSapProxy* aProxy1 = a1.m_pProxy1 ? (btMultiSapBroadphase::btMultiSapProxy*)a1.m_pProxy1->m_multiSapParentProxy : 0;
-				btMultiSapBroadphase::btMultiSapProxy* bProxy0 = b1.m_pProxy0 ? (btMultiSapBroadphase::btMultiSapProxy*)b1.m_pProxy0->m_multiSapParentProxy : 0;
-				btMultiSapBroadphase::btMultiSapProxy* bProxy1 = b1.m_pProxy1 ? (btMultiSapBroadphase::btMultiSapProxy*)b1.m_pProxy1->m_multiSapParentProxy : 0;
-
-				 return aProxy0 > bProxy0 || 
-					(aProxy0 == bProxy0 && aProxy1 > bProxy1) ||
-					(aProxy0 == bProxy0 && aProxy1 == bProxy1 && a1.m_algorithm > b1.m_algorithm); 
-		}
-};
-
-
-        ///calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb
-void    btMultiSapBroadphase::calculateOverlappingPairs(btDispatcher* dispatcher)
-{
-
-//	m_simpleBroadphase->calculateOverlappingPairs(dispatcher);
-
-	if (!stopUpdating && getOverlappingPairCache()->hasDeferredRemoval())
-	{
-	
-		btBroadphasePairArray&	overlappingPairArray = getOverlappingPairCache()->getOverlappingPairArray();
-
-	//	quicksort(overlappingPairArray,0,overlappingPairArray.size());
-
-		overlappingPairArray.quickSort(btMultiSapBroadphasePairSortPredicate());
-
-		//perform a sort, to find duplicates and to sort 'invalid' pairs to the end
-	//	overlappingPairArray.heapSort(btMultiSapBroadphasePairSortPredicate());
-
-		overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair);
-		m_invalidPair = 0;
-
-		
-		int i;
-
-		btBroadphasePair previousPair;
-		previousPair.m_pProxy0 = 0;
-		previousPair.m_pProxy1 = 0;
-		previousPair.m_algorithm = 0;
-		
-		
-		for (i=0;i<overlappingPairArray.size();i++)
-		{
-		
-			btBroadphasePair& pair = overlappingPairArray[i];
-
-			btMultiSapProxy* aProxy0 = pair.m_pProxy0 ? (btMultiSapProxy*)pair.m_pProxy0->m_multiSapParentProxy : 0;
-			btMultiSapProxy* aProxy1 = pair.m_pProxy1 ? (btMultiSapProxy*)pair.m_pProxy1->m_multiSapParentProxy : 0;
-			btMultiSapProxy* bProxy0 = previousPair.m_pProxy0 ? (btMultiSapProxy*)previousPair.m_pProxy0->m_multiSapParentProxy : 0;
-			btMultiSapProxy* bProxy1 = previousPair.m_pProxy1 ? (btMultiSapProxy*)previousPair.m_pProxy1->m_multiSapParentProxy : 0;
-
-			bool isDuplicate = (aProxy0 == bProxy0) && (aProxy1 == bProxy1);
-			
-			previousPair = pair;
-
-			bool needsRemoval = false;
-
-			if (!isDuplicate)
-			{
-				bool hasOverlap = testAabbOverlap(pair.m_pProxy0,pair.m_pProxy1);
-
-				if (hasOverlap)
-				{
-					needsRemoval = false;//callback->processOverlap(pair);
-				} else
-				{
-					needsRemoval = true;
-				}
-			} else
-			{
-				//remove duplicate
-				needsRemoval = true;
-				//should have no algorithm
-				btAssert(!pair.m_algorithm);
-			}
-			
-			if (needsRemoval)
-			{
-				getOverlappingPairCache()->cleanOverlappingPair(pair,dispatcher);
-
-		//		m_overlappingPairArray.swap(i,m_overlappingPairArray.size()-1);
-		//		m_overlappingPairArray.pop_back();
-				pair.m_pProxy0 = 0;
-				pair.m_pProxy1 = 0;
-				m_invalidPair++;
-				gOverlappingPairs--;
-			} 
-			
-		}
-
-	///if you don't like to skip the invalid pairs in the array, execute following code:
-	#define CLEAN_INVALID_PAIRS 1
-	#ifdef CLEAN_INVALID_PAIRS
-
-		//perform a sort, to sort 'invalid' pairs to the end
-		//overlappingPairArray.heapSort(btMultiSapBroadphasePairSortPredicate());
-		overlappingPairArray.quickSort(btMultiSapBroadphasePairSortPredicate());
-
-		overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair);
-		m_invalidPair = 0;
-	#endif//CLEAN_INVALID_PAIRS
-		
-		//printf("overlappingPairArray.size()=%d\n",overlappingPairArray.size());
-	}
-
-
-}
-
-
-bool	btMultiSapBroadphase::testAabbOverlap(btBroadphaseProxy* childProxy0,btBroadphaseProxy* childProxy1)
-{
-	btMultiSapProxy* multiSapProxy0 = (btMultiSapProxy*)childProxy0->m_multiSapParentProxy;
-		btMultiSapProxy* multiSapProxy1 = (btMultiSapProxy*)childProxy1->m_multiSapParentProxy;
-
-		return	TestAabbAgainstAabb2(multiSapProxy0->m_aabbMin,multiSapProxy0->m_aabbMax,
-			multiSapProxy1->m_aabbMin,multiSapProxy1->m_aabbMax);
-		
-}
-
-
-void	btMultiSapBroadphase::printStats()
-{
-/*	printf("---------------------------------\n");
-	
-		printf("btMultiSapBroadphase.h\n");
-		printf("numHandles = %d\n",m_multiSapProxies.size());
-			//find broadphase that contain this multiProxy
-		int numChildBroadphases = getBroadphaseArray().size();
-		for (int i=0;i<numChildBroadphases;i++)
-		{
-
-			btBroadphaseInterface* childBroadphase = getBroadphaseArray()[i];
-			childBroadphase->printStats();
-
-		}
-		*/
-
-}
-
-void btMultiSapBroadphase::resetPool(btDispatcher* dispatcher)
-{
-	// not yet
-}
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h
deleted file mode 100644
index 7bcfe6b..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-#ifndef BT_MULTI_SAP_BROADPHASE
-#define BT_MULTI_SAP_BROADPHASE
-
-#include "btBroadphaseInterface.h"
-#include "LinearMath/btAlignedObjectArray.h"
-#include "btOverlappingPairCache.h"
-
-
-class btBroadphaseInterface;
-class btSimpleBroadphase;
-
-
-typedef btAlignedObjectArray<btBroadphaseInterface*> btSapBroadphaseArray;
-
-///The btMultiSapBroadphase is a research project, not recommended to use in production. Use btAxisSweep3 or btDbvtBroadphase instead.
-///The btMultiSapBroadphase is a broadphase that contains multiple SAP broadphases.
-///The user can add SAP broadphases that cover the world. A btBroadphaseProxy can be in multiple child broadphases at the same time.
-///A btQuantizedBvh acceleration structures finds overlapping SAPs for each btBroadphaseProxy.
-///See http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=328
-///and http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1329
-class btMultiSapBroadphase :public btBroadphaseInterface
-{
-	btSapBroadphaseArray	m_sapBroadphases;
-	
-	btSimpleBroadphase*		m_simpleBroadphase;
-
-	btOverlappingPairCache*	m_overlappingPairs;
-
-	class btQuantizedBvh*			m_optimizedAabbTree;
-
-
-	bool					m_ownsPairCache;
-	
-	btOverlapFilterCallback*	m_filterCallback;
-
-	int			m_invalidPair;
-
-	struct	btBridgeProxy
-	{
-		btBroadphaseProxy*		m_childProxy;
-		btBroadphaseInterface*	m_childBroadphase;
-	};
-
-
-public:
-
-	struct	btMultiSapProxy	: public btBroadphaseProxy
-	{
-
-		///array with all the entries that this proxy belongs to
-		btAlignedObjectArray<btBridgeProxy*> m_bridgeProxies;
-		btVector3	m_aabbMin;
-		btVector3	m_aabbMax;
-
-		int	m_shapeType;
-
-/*		void*	m_userPtr;
-		short int	m_collisionFilterGroup;
-		short int	m_collisionFilterMask;
-*/
-		btMultiSapProxy(const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask)
-			:btBroadphaseProxy(aabbMin,aabbMax,userPtr,collisionFilterGroup,collisionFilterMask),
-			m_aabbMin(aabbMin),
-			m_aabbMax(aabbMax),
-			m_shapeType(shapeType)
-		{
-			m_multiSapParentProxy =this;
-		}
-
-		
-	};
-
-protected:
-
-
-	btAlignedObjectArray<btMultiSapProxy*> m_multiSapProxies;
-
-public:
-
-	btMultiSapBroadphase(int maxProxies = 16384,btOverlappingPairCache* pairCache=0);
-
-
-	btSapBroadphaseArray&	getBroadphaseArray()
-	{
-		return m_sapBroadphases;
-	}
-
-	const btSapBroadphaseArray&	getBroadphaseArray() const
-	{
-		return m_sapBroadphases;
-	}
-
-	virtual ~btMultiSapBroadphase();
-
-	virtual btBroadphaseProxy*	createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher,void* multiSapProxy);
-	virtual void	destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
-	virtual void	setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher);
-	virtual void	getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;
-
-	virtual void	rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback,const btVector3& aabbMin=btVector3(0,0,0),const btVector3& aabbMax=btVector3(0,0,0));
-
-	void	addToChildBroadphase(btMultiSapProxy* parentMultiSapProxy, btBroadphaseProxy* childProxy, btBroadphaseInterface*	childBroadphase);
-
-	///calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb
-	virtual void	calculateOverlappingPairs(btDispatcher* dispatcher);
-
-	bool	testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);
-
-	virtual	btOverlappingPairCache*	getOverlappingPairCache()
-	{
-		return m_overlappingPairs;
-	}
-	virtual	const btOverlappingPairCache*	getOverlappingPairCache() const
-	{
-		return m_overlappingPairs;
-	}
-
-	///getAabb returns the axis aligned bounding box in the 'global' coordinate frame
-	///will add some transform later
-	virtual void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const
-	{
-		aabbMin.setValue(-BT_LARGE_FLOAT,-BT_LARGE_FLOAT,-BT_LARGE_FLOAT);
-		aabbMax.setValue(BT_LARGE_FLOAT,BT_LARGE_FLOAT,BT_LARGE_FLOAT);
-	}
-
-	void	buildTree(const btVector3& bvhAabbMin,const btVector3& bvhAabbMax);
-
-	virtual void	printStats();
-
-	void quicksort (btBroadphasePairArray& a, int lo, int hi);
-
-	///reset broadphase internal structures, to ensure determinism/reproducability
-	virtual void resetPool(btDispatcher* dispatcher);
-
-};
-
-#endif //BT_MULTI_SAP_BROADPHASE
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp
deleted file mode 100644
index 041bbe0..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp
+++ /dev/null
@@ -1,633 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-#include "btOverlappingPairCache.h"
-
-#include "btDispatcher.h"
-#include "btCollisionAlgorithm.h"
-#include "LinearMath/btAabbUtil2.h"
-
-#include <stdio.h>
-
-int	gOverlappingPairs = 0;
-
-int gRemovePairs =0;
-int gAddedPairs =0;
-int gFindPairs =0;
-
-
-
-
-btHashedOverlappingPairCache::btHashedOverlappingPairCache():
-	m_overlapFilterCallback(0),
-	m_blockedForChanges(false),
-	m_ghostPairCallback(0)
-{
-	int initialAllocatedSize= 2;
-	m_overlappingPairArray.reserve(initialAllocatedSize);
-	growTables();
-}
-
-
-
-
-btHashedOverlappingPairCache::~btHashedOverlappingPairCache()
-{
-}
-
-
-
-void	btHashedOverlappingPairCache::cleanOverlappingPair(btBroadphasePair& pair,btDispatcher* dispatcher)
-{
-	if (pair.m_algorithm)
-	{
-		{
-			pair.m_algorithm->~btCollisionAlgorithm();
-			dispatcher->freeCollisionAlgorithm(pair.m_algorithm);
-			pair.m_algorithm=0;
-		}
-	}
-}
-
-
-
-
-void	btHashedOverlappingPairCache::cleanProxyFromPairs(btBroadphaseProxy* proxy,btDispatcher* dispatcher)
-{
-
-	class	CleanPairCallback : public btOverlapCallback
-	{
-		btBroadphaseProxy* m_cleanProxy;
-		btOverlappingPairCache*	m_pairCache;
-		btDispatcher* m_dispatcher;
-
-	public:
-		CleanPairCallback(btBroadphaseProxy* cleanProxy,btOverlappingPairCache* pairCache,btDispatcher* dispatcher)
-			:m_cleanProxy(cleanProxy),
-			m_pairCache(pairCache),
-			m_dispatcher(dispatcher)
-		{
-		}
-		virtual	bool	processOverlap(btBroadphasePair& pair)
-		{
-			if ((pair.m_pProxy0 == m_cleanProxy) ||
-				(pair.m_pProxy1 == m_cleanProxy))
-			{
-				m_pairCache->cleanOverlappingPair(pair,m_dispatcher);
-			}
-			return false;
-		}
-		
-	};
-
-	CleanPairCallback cleanPairs(proxy,this,dispatcher);
-
-	processAllOverlappingPairs(&cleanPairs,dispatcher);
-
-}
-
-
-
-
-void	btHashedOverlappingPairCache::removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher)
-{
-
-	class	RemovePairCallback : public btOverlapCallback
-	{
-		btBroadphaseProxy* m_obsoleteProxy;
-
-	public:
-		RemovePairCallback(btBroadphaseProxy* obsoleteProxy)
-			:m_obsoleteProxy(obsoleteProxy)
-		{
-		}
-		virtual	bool	processOverlap(btBroadphasePair& pair)
-		{
-			return ((pair.m_pProxy0 == m_obsoleteProxy) ||
-				(pair.m_pProxy1 == m_obsoleteProxy));
-		}
-		
-	};
-
-
-	RemovePairCallback removeCallback(proxy);
-
-	processAllOverlappingPairs(&removeCallback,dispatcher);
-}
-
-
-
-
-
-btBroadphasePair* btHashedOverlappingPairCache::findPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1)
-{
-	gFindPairs++;
-	if(proxy0->m_uniqueId>proxy1->m_uniqueId) 
-		btSwap(proxy0,proxy1);
-	int proxyId1 = proxy0->getUid();
-	int proxyId2 = proxy1->getUid();
-
-	/*if (proxyId1 > proxyId2) 
-		btSwap(proxyId1, proxyId2);*/
-
-	int hash = static_cast<int>(getHash(static_cast<unsigned int>(proxyId1), static_cast<unsigned int>(proxyId2)) & (m_overlappingPairArray.capacity()-1));
-
-	if (hash >= m_hashTable.size())
-	{
-		return NULL;
-	}
-
-	int index = m_hashTable[hash];
-	while (index != BT_NULL_PAIR && equalsPair(m_overlappingPairArray[index], proxyId1, proxyId2) == false)
-	{
-		index = m_next[index];
-	}
-
-	if (index == BT_NULL_PAIR)
-	{
-		return NULL;
-	}
-
-	btAssert(index < m_overlappingPairArray.size());
-
-	return &m_overlappingPairArray[index];
-}
-
-//#include <stdio.h>
-
-void	btHashedOverlappingPairCache::growTables()
-{
-
-	int newCapacity = m_overlappingPairArray.capacity();
-
-	if (m_hashTable.size() < newCapacity)
-	{
-		//grow hashtable and next table
-		int curHashtableSize = m_hashTable.size();
-
-		m_hashTable.resize(newCapacity);
-		m_next.resize(newCapacity);
-
-
-		int i;
-
-		for (i= 0; i < newCapacity; ++i)
-		{
-			m_hashTable[i] = BT_NULL_PAIR;
-		}
-		for (i = 0; i < newCapacity; ++i)
-		{
-			m_next[i] = BT_NULL_PAIR;
-		}
-
-		for(i=0;i<curHashtableSize;i++)
-		{
-	
-			const btBroadphasePair& pair = m_overlappingPairArray[i];
-			int proxyId1 = pair.m_pProxy0->getUid();
-			int proxyId2 = pair.m_pProxy1->getUid();
-			/*if (proxyId1 > proxyId2) 
-				btSwap(proxyId1, proxyId2);*/
-			int	hashValue = static_cast<int>(getHash(static_cast<unsigned int>(proxyId1),static_cast<unsigned int>(proxyId2)) & (m_overlappingPairArray.capacity()-1));	// New hash value with new mask
-			m_next[i] = m_hashTable[hashValue];
-			m_hashTable[hashValue] = i;
-		}
-
-
-	}
-}
-
-btBroadphasePair* btHashedOverlappingPairCache::internalAddPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1)
-{
-	if(proxy0->m_uniqueId>proxy1->m_uniqueId) 
-		btSwap(proxy0,proxy1);
-	int proxyId1 = proxy0->getUid();
-	int proxyId2 = proxy1->getUid();
-
-	/*if (proxyId1 > proxyId2) 
-		btSwap(proxyId1, proxyId2);*/
-
-	int	hash = static_cast<int>(getHash(static_cast<unsigned int>(proxyId1),static_cast<unsigned int>(proxyId2)) & (m_overlappingPairArray.capacity()-1));	// New hash value with new mask
-
-
-	btBroadphasePair* pair = internalFindPair(proxy0, proxy1, hash);
-	if (pair != NULL)
-	{
-		return pair;
-	}
-	/*for(int i=0;i<m_overlappingPairArray.size();++i)
-		{
-		if(	(m_overlappingPairArray[i].m_pProxy0==proxy0)&&
-			(m_overlappingPairArray[i].m_pProxy1==proxy1))
-			{
-			printf("Adding duplicated %u<>%u\r\n",proxyId1,proxyId2);
-			internalFindPair(proxy0, proxy1, hash);
-			}
-		}*/
-	int count = m_overlappingPairArray.size();
-	int oldCapacity = m_overlappingPairArray.capacity();
-	void* mem = &m_overlappingPairArray.expandNonInitializing();
-
-	//this is where we add an actual pair, so also call the 'ghost'
-	if (m_ghostPairCallback)
-		m_ghostPairCallback->addOverlappingPair(proxy0,proxy1);
-
-	int newCapacity = m_overlappingPairArray.capacity();
-
-	if (oldCapacity < newCapacity)
-	{
-		growTables();
-		//hash with new capacity
-		hash = static_cast<int>(getHash(static_cast<unsigned int>(proxyId1),static_cast<unsigned int>(proxyId2)) & (m_overlappingPairArray.capacity()-1));
-	}
-	
-	pair = new (mem) btBroadphasePair(*proxy0,*proxy1);
-//	pair->m_pProxy0 = proxy0;
-//	pair->m_pProxy1 = proxy1;
-	pair->m_algorithm = 0;
-	pair->m_internalTmpValue = 0;
-	
-
-	m_next[count] = m_hashTable[hash];
-	m_hashTable[hash] = count;
-
-	return pair;
-}
-
-
-
-void* btHashedOverlappingPairCache::removeOverlappingPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1,btDispatcher* dispatcher)
-{
-	gRemovePairs++;
-	if(proxy0->m_uniqueId>proxy1->m_uniqueId) 
-		btSwap(proxy0,proxy1);
-	int proxyId1 = proxy0->getUid();
-	int proxyId2 = proxy1->getUid();
-
-	/*if (proxyId1 > proxyId2) 
-		btSwap(proxyId1, proxyId2);*/
-
-	int	hash = static_cast<int>(getHash(static_cast<unsigned int>(proxyId1),static_cast<unsigned int>(proxyId2)) & (m_overlappingPairArray.capacity()-1));
-
-	btBroadphasePair* pair = internalFindPair(proxy0, proxy1, hash);
-	if (pair == NULL)
-	{
-		return 0;
-	}
-
-	cleanOverlappingPair(*pair,dispatcher);
-
-	void* userData = pair->m_internalInfo1;
-
-	btAssert(pair->m_pProxy0->getUid() == proxyId1);
-	btAssert(pair->m_pProxy1->getUid() == proxyId2);
-
-	int pairIndex = int(pair - &m_overlappingPairArray[0]);
-	btAssert(pairIndex < m_overlappingPairArray.size());
-
-	// Remove the pair from the hash table.
-	int index = m_hashTable[hash];
-	btAssert(index != BT_NULL_PAIR);
-
-	int previous = BT_NULL_PAIR;
-	while (index != pairIndex)
-	{
-		previous = index;
-		index = m_next[index];
-	}
-
-	if (previous != BT_NULL_PAIR)
-	{
-		btAssert(m_next[previous] == pairIndex);
-		m_next[previous] = m_next[pairIndex];
-	}
-	else
-	{
-		m_hashTable[hash] = m_next[pairIndex];
-	}
-
-	// We now move the last pair into spot of the
-	// pair being removed. We need to fix the hash
-	// table indices to support the move.
-
-	int lastPairIndex = m_overlappingPairArray.size() - 1;
-
-	if (m_ghostPairCallback)
-		m_ghostPairCallback->removeOverlappingPair(proxy0, proxy1,dispatcher);
-
-	// If the removed pair is the last pair, we are done.
-	if (lastPairIndex == pairIndex)
-	{
-		m_overlappingPairArray.pop_back();
-		return userData;
-	}
-
-	// Remove the last pair from the hash table.
-	const btBroadphasePair* last = &m_overlappingPairArray[lastPairIndex];
-		/* missing swap here too, Nat. */ 
-	int lastHash = static_cast<int>(getHash(static_cast<unsigned int>(last->m_pProxy0->getUid()), static_cast<unsigned int>(last->m_pProxy1->getUid())) & (m_overlappingPairArray.capacity()-1));
-
-	index = m_hashTable[lastHash];
-	btAssert(index != BT_NULL_PAIR);
-
-	previous = BT_NULL_PAIR;
-	while (index != lastPairIndex)
-	{
-		previous = index;
-		index = m_next[index];
-	}
-
-	if (previous != BT_NULL_PAIR)
-	{
-		btAssert(m_next[previous] == lastPairIndex);
-		m_next[previous] = m_next[lastPairIndex];
-	}
-	else
-	{
-		m_hashTable[lastHash] = m_next[lastPairIndex];
-	}
-
-	// Copy the last pair into the remove pair's spot.
-	m_overlappingPairArray[pairIndex] = m_overlappingPairArray[lastPairIndex];
-
-	// Insert the last pair into the hash table
-	m_next[pairIndex] = m_hashTable[lastHash];
-	m_hashTable[lastHash] = pairIndex;
-
-	m_overlappingPairArray.pop_back();
-
-	return userData;
-}
-//#include <stdio.h>
-
-void	btHashedOverlappingPairCache::processAllOverlappingPairs(btOverlapCallback* callback,btDispatcher* dispatcher)
-{
-
-	int i;
-
-//	printf("m_overlappingPairArray.size()=%d\n",m_overlappingPairArray.size());
-	for (i=0;i<m_overlappingPairArray.size();)
-	{
-	
-		btBroadphasePair* pair = &m_overlappingPairArray[i];
-		if (callback->processOverlap(*pair))
-		{
-			removeOverlappingPair(pair->m_pProxy0,pair->m_pProxy1,dispatcher);
-
-			gOverlappingPairs--;
-		} else
-		{
-			i++;
-		}
-	}
-}
-
-void	btHashedOverlappingPairCache::sortOverlappingPairs(btDispatcher* dispatcher)
-{
-	///need to keep hashmap in sync with pair address, so rebuild all
-	btBroadphasePairArray tmpPairs;
-	int i;
-	for (i=0;i<m_overlappingPairArray.size();i++)
-	{
-		tmpPairs.push_back(m_overlappingPairArray[i]);
-	}
-
-	for (i=0;i<tmpPairs.size();i++)
-	{
-		removeOverlappingPair(tmpPairs[i].m_pProxy0,tmpPairs[i].m_pProxy1,dispatcher);
-	}
-	
-	for (i = 0; i < m_next.size(); i++)
-	{
-		m_next[i] = BT_NULL_PAIR;
-	}
-
-	tmpPairs.quickSort(btBroadphasePairSortPredicate());
-
-	for (i=0;i<tmpPairs.size();i++)
-	{
-		addOverlappingPair(tmpPairs[i].m_pProxy0,tmpPairs[i].m_pProxy1);
-	}
-
-	
-}
-
-
-void*	btSortedOverlappingPairCache::removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1, btDispatcher* dispatcher )
-{
-	if (!hasDeferredRemoval())
-	{
-		btBroadphasePair findPair(*proxy0,*proxy1);
-
-		int findIndex = m_overlappingPairArray.findLinearSearch(findPair);
-		if (findIndex < m_overlappingPairArray.size())
-		{
-			gOverlappingPairs--;
-			btBroadphasePair& pair = m_overlappingPairArray[findIndex];
-			void* userData = pair.m_internalInfo1;
-			cleanOverlappingPair(pair,dispatcher);
-			if (m_ghostPairCallback)
-				m_ghostPairCallback->removeOverlappingPair(proxy0, proxy1,dispatcher);
-			
-			m_overlappingPairArray.swap(findIndex,m_overlappingPairArray.capacity()-1);
-			m_overlappingPairArray.pop_back();
-			return userData;
-		}
-	}
-
-	return 0;
-}
-
-
-
-
-
-
-
-
-btBroadphasePair*	btSortedOverlappingPairCache::addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1)
-{
-	//don't add overlap with own
-	btAssert(proxy0 != proxy1);
-
-	if (!needsBroadphaseCollision(proxy0,proxy1))
-		return 0;
-	
-	void* mem = &m_overlappingPairArray.expandNonInitializing();
-	btBroadphasePair* pair = new (mem) btBroadphasePair(*proxy0,*proxy1);
-	
-	gOverlappingPairs++;
-	gAddedPairs++;
-	
-	if (m_ghostPairCallback)
-		m_ghostPairCallback->addOverlappingPair(proxy0, proxy1);
-	return pair;
-	
-}
-
-///this findPair becomes really slow. Either sort the list to speedup the query, or
-///use a different solution. It is mainly used for Removing overlapping pairs. Removal could be delayed.
-///we could keep a linked list in each proxy, and store pair in one of the proxies (with lowest memory address)
-///Also we can use a 2D bitmap, which can be useful for a future GPU implementation
- btBroadphasePair*	btSortedOverlappingPairCache::findPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1)
-{
-	if (!needsBroadphaseCollision(proxy0,proxy1))
-		return 0;
-
-	btBroadphasePair tmpPair(*proxy0,*proxy1);
-	int findIndex = m_overlappingPairArray.findLinearSearch(tmpPair);
-
-	if (findIndex < m_overlappingPairArray.size())
-	{
-		//btAssert(it != m_overlappingPairSet.end());
-		 btBroadphasePair* pair = &m_overlappingPairArray[findIndex];
-		return pair;
-	}
-	return 0;
-}
-
-
-
-
-
-
-
-
-
-
-//#include <stdio.h>
-
-void	btSortedOverlappingPairCache::processAllOverlappingPairs(btOverlapCallback* callback,btDispatcher* dispatcher)
-{
-
-	int i;
-
-	for (i=0;i<m_overlappingPairArray.size();)
-	{
-	
-		btBroadphasePair* pair = &m_overlappingPairArray[i];
-		if (callback->processOverlap(*pair))
-		{
-			cleanOverlappingPair(*pair,dispatcher);
-			pair->m_pProxy0 = 0;
-			pair->m_pProxy1 = 0;
-			m_overlappingPairArray.swap(i,m_overlappingPairArray.size()-1);
-			m_overlappingPairArray.pop_back();
-			gOverlappingPairs--;
-		} else
-		{
-			i++;
-		}
-	}
-}
-
-
-
-
-btSortedOverlappingPairCache::btSortedOverlappingPairCache():
-	m_blockedForChanges(false),
-	m_hasDeferredRemoval(true),
-	m_overlapFilterCallback(0),
-	m_ghostPairCallback(0)
-{
-	int initialAllocatedSize= 2;
-	m_overlappingPairArray.reserve(initialAllocatedSize);
-}
-
-btSortedOverlappingPairCache::~btSortedOverlappingPairCache()
-{
-}
-
-void	btSortedOverlappingPairCache::cleanOverlappingPair(btBroadphasePair& pair,btDispatcher* dispatcher)
-{
-	if (pair.m_algorithm)
-	{
-		{
-			pair.m_algorithm->~btCollisionAlgorithm();
-			dispatcher->freeCollisionAlgorithm(pair.m_algorithm);
-			pair.m_algorithm=0;
-			gRemovePairs--;
-		}
-	}
-}
-
-
-void	btSortedOverlappingPairCache::cleanProxyFromPairs(btBroadphaseProxy* proxy,btDispatcher* dispatcher)
-{
-
-	class	CleanPairCallback : public btOverlapCallback
-	{
-		btBroadphaseProxy* m_cleanProxy;
-		btOverlappingPairCache*	m_pairCache;
-		btDispatcher* m_dispatcher;
-
-	public:
-		CleanPairCallback(btBroadphaseProxy* cleanProxy,btOverlappingPairCache* pairCache,btDispatcher* dispatcher)
-			:m_cleanProxy(cleanProxy),
-			m_pairCache(pairCache),
-			m_dispatcher(dispatcher)
-		{
-		}
-		virtual	bool	processOverlap(btBroadphasePair& pair)
-		{
-			if ((pair.m_pProxy0 == m_cleanProxy) ||
-				(pair.m_pProxy1 == m_cleanProxy))
-			{
-				m_pairCache->cleanOverlappingPair(pair,m_dispatcher);
-			}
-			return false;
-		}
-		
-	};
-
-	CleanPairCallback cleanPairs(proxy,this,dispatcher);
-
-	processAllOverlappingPairs(&cleanPairs,dispatcher);
-
-}
-
-
-void	btSortedOverlappingPairCache::removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher)
-{
-
-	class	RemovePairCallback : public btOverlapCallback
-	{
-		btBroadphaseProxy* m_obsoleteProxy;
-
-	public:
-		RemovePairCallback(btBroadphaseProxy* obsoleteProxy)
-			:m_obsoleteProxy(obsoleteProxy)
-		{
-		}
-		virtual	bool	processOverlap(btBroadphasePair& pair)
-		{
-			return ((pair.m_pProxy0 == m_obsoleteProxy) ||
-				(pair.m_pProxy1 == m_obsoleteProxy));
-		}
-		
-	};
-
-	RemovePairCallback removeCallback(proxy);
-
-	processAllOverlappingPairs(&removeCallback,dispatcher);
-}
-
-void	btSortedOverlappingPairCache::sortOverlappingPairs(btDispatcher* dispatcher)
-{
-	//should already be sorted
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h
deleted file mode 100644
index 7a3806c..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h
+++ /dev/null
@@ -1,469 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_OVERLAPPING_PAIR_CACHE_H
-#define BT_OVERLAPPING_PAIR_CACHE_H
-
-
-#include "btBroadphaseInterface.h"
-#include "btBroadphaseProxy.h"
-#include "btOverlappingPairCallback.h"
-
-#include "LinearMath/btAlignedObjectArray.h"
-class btDispatcher;
-
-typedef btAlignedObjectArray<btBroadphasePair>	btBroadphasePairArray;
-
-struct	btOverlapCallback
-{
-	virtual ~btOverlapCallback()
-	{}
-	//return true for deletion of the pair
-	virtual bool	processOverlap(btBroadphasePair& pair) = 0;
-
-};
-
-struct btOverlapFilterCallback
-{
-	virtual ~btOverlapFilterCallback()
-	{}
-	// return true when pairs need collision
-	virtual bool	needBroadphaseCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const = 0;
-};
-
-
-
-
-
-
-
-extern int gRemovePairs;
-extern int gAddedPairs;
-extern int gFindPairs;
-
-const int BT_NULL_PAIR=0xffffffff;
-
-///The btOverlappingPairCache provides an interface for overlapping pair management (add, remove, storage), used by the btBroadphaseInterface broadphases.
-///The btHashedOverlappingPairCache and btSortedOverlappingPairCache classes are two implementations.
-class btOverlappingPairCache : public btOverlappingPairCallback
-{
-public:
-	virtual ~btOverlappingPairCache() {} // this is needed so we can get to the derived class destructor
-
-	virtual btBroadphasePair*	getOverlappingPairArrayPtr() = 0;
-	
-	virtual const btBroadphasePair*	getOverlappingPairArrayPtr() const = 0;
-
-	virtual btBroadphasePairArray&	getOverlappingPairArray() = 0;
-
-	virtual	void	cleanOverlappingPair(btBroadphasePair& pair,btDispatcher* dispatcher) = 0;
-
-	virtual int getNumOverlappingPairs() const = 0;
-
-	virtual void	cleanProxyFromPairs(btBroadphaseProxy* proxy,btDispatcher* dispatcher) = 0;
-
-	virtual	void setOverlapFilterCallback(btOverlapFilterCallback* callback) = 0;
-
-	virtual void	processAllOverlappingPairs(btOverlapCallback*,btDispatcher* dispatcher) = 0;
-
-	virtual btBroadphasePair* findPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1) = 0;
-
-	virtual bool	hasDeferredRemoval() = 0;
-
-	virtual	void	setInternalGhostPairCallback(btOverlappingPairCallback* ghostPairCallback)=0;
-
-	virtual void	sortOverlappingPairs(btDispatcher* dispatcher) = 0;
-
-
-};
-
-/// Hash-space based Pair Cache, thanks to Erin Catto, Box2D, http://www.box2d.org, and Pierre Terdiman, Codercorner, http://codercorner.com
-class btHashedOverlappingPairCache : public btOverlappingPairCache
-{
-	btBroadphasePairArray	m_overlappingPairArray;
-	btOverlapFilterCallback* m_overlapFilterCallback;
-	bool		m_blockedForChanges;
-
-
-public:
-	btHashedOverlappingPairCache();
-	virtual ~btHashedOverlappingPairCache();
-
-	
-	void	removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
-
-	virtual void*	removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,btDispatcher* dispatcher);
-	
-	SIMD_FORCE_INLINE bool needsBroadphaseCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const
-	{
-		if (m_overlapFilterCallback)
-			return m_overlapFilterCallback->needBroadphaseCollision(proxy0,proxy1);
-
-		bool collides = (proxy0->m_collisionFilterGroup & proxy1->m_collisionFilterMask) != 0;
-		collides = collides && (proxy1->m_collisionFilterGroup & proxy0->m_collisionFilterMask);
-		
-		return collides;
-	}
-
-	// Add a pair and return the new pair. If the pair already exists,
-	// no new pair is created and the old one is returned.
-	virtual btBroadphasePair* 	addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1)
-	{
-		gAddedPairs++;
-
-		if (!needsBroadphaseCollision(proxy0,proxy1))
-			return 0;
-
-		return internalAddPair(proxy0,proxy1);
-	}
-
-	
-
-	void	cleanProxyFromPairs(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
-
-	
-	virtual void	processAllOverlappingPairs(btOverlapCallback*,btDispatcher* dispatcher);
-
-	virtual btBroadphasePair*	getOverlappingPairArrayPtr()
-	{
-		return &m_overlappingPairArray[0];
-	}
-
-	const btBroadphasePair*	getOverlappingPairArrayPtr() const
-	{
-		return &m_overlappingPairArray[0];
-	}
-
-	btBroadphasePairArray&	getOverlappingPairArray()
-	{
-		return m_overlappingPairArray;
-	}
-
-	const btBroadphasePairArray&	getOverlappingPairArray() const
-	{
-		return m_overlappingPairArray;
-	}
-
-	void	cleanOverlappingPair(btBroadphasePair& pair,btDispatcher* dispatcher);
-
-
-
-	btBroadphasePair* findPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1);
-
-	int GetCount() const { return m_overlappingPairArray.size(); }
-//	btBroadphasePair* GetPairs() { return m_pairs; }
-
-	btOverlapFilterCallback* getOverlapFilterCallback()
-	{
-		return m_overlapFilterCallback;
-	}
-
-	void setOverlapFilterCallback(btOverlapFilterCallback* callback)
-	{
-		m_overlapFilterCallback = callback;
-	}
-
-	int	getNumOverlappingPairs() const
-	{
-		return m_overlappingPairArray.size();
-	}
-private:
-	
-	btBroadphasePair* 	internalAddPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);
-
-	void	growTables();
-
-	SIMD_FORCE_INLINE bool equalsPair(const btBroadphasePair& pair, int proxyId1, int proxyId2)
-	{	
-		return pair.m_pProxy0->getUid() == proxyId1 && pair.m_pProxy1->getUid() == proxyId2;
-	}
-
-	/*
-	// Thomas Wang's hash, see: http://www.concentric.net/~Ttwang/tech/inthash.htm
-	// This assumes proxyId1 and proxyId2 are 16-bit.
-	SIMD_FORCE_INLINE int getHash(int proxyId1, int proxyId2)
-	{
-		int key = (proxyId2 << 16) | proxyId1;
-		key = ~key + (key << 15);
-		key = key ^ (key >> 12);
-		key = key + (key << 2);
-		key = key ^ (key >> 4);
-		key = key * 2057;
-		key = key ^ (key >> 16);
-		return key;
-	}
-	*/
-
-
-	
-	SIMD_FORCE_INLINE	unsigned int getHash(unsigned int proxyId1, unsigned int proxyId2)
-	{
-		int key = static_cast<int>(((unsigned int)proxyId1) | (((unsigned int)proxyId2) <<16));
-		// Thomas Wang's hash
-
-		key += ~(key << 15);
-		key ^=  (key >> 10);
-		key +=  (key << 3);
-		key ^=  (key >> 6);
-		key += ~(key << 11);
-		key ^=  (key >> 16);
-		return static_cast<unsigned int>(key);
-	}
-	
-
-
-
-
-	SIMD_FORCE_INLINE btBroadphasePair* internalFindPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1, int hash)
-	{
-		int proxyId1 = proxy0->getUid();
-		int proxyId2 = proxy1->getUid();
-		#if 0 // wrong, 'equalsPair' use unsorted uids, copy-past devil striked again. Nat.
-		if (proxyId1 > proxyId2) 
-			btSwap(proxyId1, proxyId2);
-		#endif
-
-		int index = m_hashTable[hash];
-		
-		while( index != BT_NULL_PAIR && equalsPair(m_overlappingPairArray[index], proxyId1, proxyId2) == false)
-		{
-			index = m_next[index];
-		}
-
-		if ( index == BT_NULL_PAIR )
-		{
-			return NULL;
-		}
-
-		btAssert(index < m_overlappingPairArray.size());
-
-		return &m_overlappingPairArray[index];
-	}
-
-	virtual bool	hasDeferredRemoval()
-	{
-		return false;
-	}
-
-	virtual	void	setInternalGhostPairCallback(btOverlappingPairCallback* ghostPairCallback)
-	{
-		m_ghostPairCallback = ghostPairCallback;
-	}
-
-	virtual void	sortOverlappingPairs(btDispatcher* dispatcher);
-	
-
-protected:
-	
-	btAlignedObjectArray<int>	m_hashTable;
-	btAlignedObjectArray<int>	m_next;
-	btOverlappingPairCallback*	m_ghostPairCallback;
-	
-};
-
-
-
-
-///btSortedOverlappingPairCache maintains the objects with overlapping AABB
-///Typically managed by the Broadphase, Axis3Sweep or btSimpleBroadphase
-class	btSortedOverlappingPairCache : public btOverlappingPairCache
-{
-	protected:
-		//avoid brute-force finding all the time
-		btBroadphasePairArray	m_overlappingPairArray;
-
-		//during the dispatch, check that user doesn't destroy/create proxy
-		bool		m_blockedForChanges;
-
-		///by default, do the removal during the pair traversal
-		bool		m_hasDeferredRemoval;
-		
-		//if set, use the callback instead of the built in filter in needBroadphaseCollision
-		btOverlapFilterCallback* m_overlapFilterCallback;
-
-		btOverlappingPairCallback*	m_ghostPairCallback;
-
-	public:
-			
-		btSortedOverlappingPairCache();	
-		virtual ~btSortedOverlappingPairCache();
-
-		virtual void	processAllOverlappingPairs(btOverlapCallback*,btDispatcher* dispatcher);
-
-		void*	removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,btDispatcher* dispatcher);
-
-		void	cleanOverlappingPair(btBroadphasePair& pair,btDispatcher* dispatcher);
-		
-		btBroadphasePair*	addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);
-
-		btBroadphasePair*	findPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);
-			
-		
-		void	cleanProxyFromPairs(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
-
-		void	removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
-
-
-		inline bool needsBroadphaseCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const
-		{
-			if (m_overlapFilterCallback)
-				return m_overlapFilterCallback->needBroadphaseCollision(proxy0,proxy1);
-
-			bool collides = (proxy0->m_collisionFilterGroup & proxy1->m_collisionFilterMask) != 0;
-			collides = collides && (proxy1->m_collisionFilterGroup & proxy0->m_collisionFilterMask);
-			
-			return collides;
-		}
-		
-		btBroadphasePairArray&	getOverlappingPairArray()
-		{
-			return m_overlappingPairArray;
-		}
-
-		const btBroadphasePairArray&	getOverlappingPairArray() const
-		{
-			return m_overlappingPairArray;
-		}
-
-		
-
-
-		btBroadphasePair*	getOverlappingPairArrayPtr()
-		{
-			return &m_overlappingPairArray[0];
-		}
-
-		const btBroadphasePair*	getOverlappingPairArrayPtr() const
-		{
-			return &m_overlappingPairArray[0];
-		}
-
-		int	getNumOverlappingPairs() const
-		{
-			return m_overlappingPairArray.size();
-		}
-		
-		btOverlapFilterCallback* getOverlapFilterCallback()
-		{
-			return m_overlapFilterCallback;
-		}
-
-		void setOverlapFilterCallback(btOverlapFilterCallback* callback)
-		{
-			m_overlapFilterCallback = callback;
-		}
-
-		virtual bool	hasDeferredRemoval()
-		{
-			return m_hasDeferredRemoval;
-		}
-
-		virtual	void	setInternalGhostPairCallback(btOverlappingPairCallback* ghostPairCallback)
-		{
-			m_ghostPairCallback = ghostPairCallback;
-		}
-
-		virtual void	sortOverlappingPairs(btDispatcher* dispatcher);
-		
-
-};
-
-
-
-///btNullPairCache skips add/removal of overlapping pairs. Userful for benchmarking and unit testing.
-class btNullPairCache : public btOverlappingPairCache
-{
-
-	btBroadphasePairArray	m_overlappingPairArray;
-
-public:
-
-	virtual btBroadphasePair*	getOverlappingPairArrayPtr()
-	{
-		return &m_overlappingPairArray[0];
-	}
-	const btBroadphasePair*	getOverlappingPairArrayPtr() const
-	{
-		return &m_overlappingPairArray[0];
-	}
-	btBroadphasePairArray&	getOverlappingPairArray()
-	{
-		return m_overlappingPairArray;
-	}
-	
-	virtual	void	cleanOverlappingPair(btBroadphasePair& /*pair*/,btDispatcher* /*dispatcher*/)
-	{
-
-	}
-
-	virtual int getNumOverlappingPairs() const
-	{
-		return 0;
-	}
-
-	virtual void	cleanProxyFromPairs(btBroadphaseProxy* /*proxy*/,btDispatcher* /*dispatcher*/)
-	{
-
-	}
-
-	virtual	void setOverlapFilterCallback(btOverlapFilterCallback* /*callback*/)
-	{
-	}
-
-	virtual void	processAllOverlappingPairs(btOverlapCallback*,btDispatcher* /*dispatcher*/)
-	{
-	}
-
-	virtual btBroadphasePair* findPair(btBroadphaseProxy* /*proxy0*/, btBroadphaseProxy* /*proxy1*/)
-	{
-		return 0;
-	}
-
-	virtual bool	hasDeferredRemoval()
-	{
-		return true;
-	}
-
-	virtual	void	setInternalGhostPairCallback(btOverlappingPairCallback* /* ghostPairCallback */)
-	{
-
-	}
-
-	virtual btBroadphasePair*	addOverlappingPair(btBroadphaseProxy* /*proxy0*/,btBroadphaseProxy* /*proxy1*/)
-	{
-		return 0;
-	}
-
-	virtual void*	removeOverlappingPair(btBroadphaseProxy* /*proxy0*/,btBroadphaseProxy* /*proxy1*/,btDispatcher* /*dispatcher*/)
-	{
-		return 0;
-	}
-
-	virtual void	removeOverlappingPairsContainingProxy(btBroadphaseProxy* /*proxy0*/,btDispatcher* /*dispatcher*/)
-	{
-	}
-	
-	virtual void	sortOverlappingPairs(btDispatcher* dispatcher)
-	{
-        (void) dispatcher;
-	}
-
-
-};
-
-
-#endif //BT_OVERLAPPING_PAIR_CACHE_H
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h
deleted file mode 100644
index 9c7b6f8..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h
+++ /dev/null
@@ -1,40 +0,0 @@
-
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef OVERLAPPING_PAIR_CALLBACK_H
-#define OVERLAPPING_PAIR_CALLBACK_H
-
-class btDispatcher;
-struct  btBroadphasePair;
-
-///The btOverlappingPairCallback class is an additional optional broadphase user callback for adding/removing overlapping pairs, similar interface to btOverlappingPairCache.
-class btOverlappingPairCallback
-{
-public:
-	virtual ~btOverlappingPairCallback()
-	{
-
-	}
-	
-	virtual btBroadphasePair*	addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) = 0;
-
-	virtual void*	removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,btDispatcher* dispatcher) = 0;
-
-	virtual void	removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy0,btDispatcher* dispatcher) = 0;
-
-};
-
-#endif //OVERLAPPING_PAIR_CALLBACK_H
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp
deleted file mode 100644
index c911435..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp
+++ /dev/null
@@ -1,1375 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btQuantizedBvh.h"
-
-#include "LinearMath/btAabbUtil2.h"
-#include "LinearMath/btIDebugDraw.h"
-#include "LinearMath/btSerializer.h"
-
-#define RAYAABB2
-
-btQuantizedBvh::btQuantizedBvh() : 
-					m_bulletVersion(BT_BULLET_VERSION),
-					m_useQuantization(false), 
-					//m_traversalMode(TRAVERSAL_STACKLESS_CACHE_FRIENDLY)
-					m_traversalMode(TRAVERSAL_STACKLESS)
-					//m_traversalMode(TRAVERSAL_RECURSIVE)
-					,m_subtreeHeaderCount(0) //PCK: add this line
-{
-	m_bvhAabbMin.setValue(-SIMD_INFINITY,-SIMD_INFINITY,-SIMD_INFINITY);
-	m_bvhAabbMax.setValue(SIMD_INFINITY,SIMD_INFINITY,SIMD_INFINITY);
-}
-
-
-
-
-
-void btQuantizedBvh::buildInternal()
-{
-	///assumes that caller filled in the m_quantizedLeafNodes
-	m_useQuantization = true;
-	int numLeafNodes = 0;
-	
-	if (m_useQuantization)
-	{
-		//now we have an array of leafnodes in m_leafNodes
-		numLeafNodes = m_quantizedLeafNodes.size();
-
-		m_quantizedContiguousNodes.resize(2*numLeafNodes);
-
-	}
-
-	m_curNodeIndex = 0;
-
-	buildTree(0,numLeafNodes);
-
-	///if the entire tree is small then subtree size, we need to create a header info for the tree
-	if(m_useQuantization && !m_SubtreeHeaders.size())
-	{
-		btBvhSubtreeInfo& subtree = m_SubtreeHeaders.expand();
-		subtree.setAabbFromQuantizeNode(m_quantizedContiguousNodes[0]);
-		subtree.m_rootNodeIndex = 0;
-		subtree.m_subtreeSize = m_quantizedContiguousNodes[0].isLeafNode() ? 1 : m_quantizedContiguousNodes[0].getEscapeIndex();
-	}
-
-	//PCK: update the copy of the size
-	m_subtreeHeaderCount = m_SubtreeHeaders.size();
-
-	//PCK: clear m_quantizedLeafNodes and m_leafNodes, they are temporary
-	m_quantizedLeafNodes.clear();
-	m_leafNodes.clear();
-}
-
-
-
-///just for debugging, to visualize the individual patches/subtrees
-#ifdef DEBUG_PATCH_COLORS
-btVector3 color[4]=
-{
-	btVector3(1,0,0),
-	btVector3(0,1,0),
-	btVector3(0,0,1),
-	btVector3(0,1,1)
-};
-#endif //DEBUG_PATCH_COLORS
-
-
-
-void	btQuantizedBvh::setQuantizationValues(const btVector3& bvhAabbMin,const btVector3& bvhAabbMax,btScalar quantizationMargin)
-{
-	//enlarge the AABB to avoid division by zero when initializing the quantization values
-	btVector3 clampValue(quantizationMargin,quantizationMargin,quantizationMargin);
-	m_bvhAabbMin = bvhAabbMin - clampValue;
-	m_bvhAabbMax = bvhAabbMax + clampValue;
-	btVector3 aabbSize = m_bvhAabbMax - m_bvhAabbMin;
-	m_bvhQuantization = btVector3(btScalar(65533.0),btScalar(65533.0),btScalar(65533.0)) / aabbSize;
-	m_useQuantization = true;
-}
-
-
-
-
-btQuantizedBvh::~btQuantizedBvh()
-{
-}
-
-#ifdef DEBUG_TREE_BUILDING
-int gStackDepth = 0;
-int gMaxStackDepth = 0;
-#endif //DEBUG_TREE_BUILDING
-
-void	btQuantizedBvh::buildTree	(int startIndex,int endIndex)
-{
-#ifdef DEBUG_TREE_BUILDING
-	gStackDepth++;
-	if (gStackDepth > gMaxStackDepth)
-		gMaxStackDepth = gStackDepth;
-#endif //DEBUG_TREE_BUILDING
-
-
-	int splitAxis, splitIndex, i;
-	int numIndices =endIndex-startIndex;
-	int curIndex = m_curNodeIndex;
-
-	btAssert(numIndices>0);
-
-	if (numIndices==1)
-	{
-#ifdef DEBUG_TREE_BUILDING
-		gStackDepth--;
-#endif //DEBUG_TREE_BUILDING
-		
-		assignInternalNodeFromLeafNode(m_curNodeIndex,startIndex);
-
-		m_curNodeIndex++;
-		return;	
-	}
-	//calculate Best Splitting Axis and where to split it. Sort the incoming 'leafNodes' array within range 'startIndex/endIndex'.
-	
-	splitAxis = calcSplittingAxis(startIndex,endIndex);
-
-	splitIndex = sortAndCalcSplittingIndex(startIndex,endIndex,splitAxis);
-
-	int internalNodeIndex = m_curNodeIndex;
-	
-	//set the min aabb to 'inf' or a max value, and set the max aabb to a -inf/minimum value.
-	//the aabb will be expanded during buildTree/mergeInternalNodeAabb with actual node values
-	setInternalNodeAabbMin(m_curNodeIndex,m_bvhAabbMax);//can't use btVector3(SIMD_INFINITY,SIMD_INFINITY,SIMD_INFINITY)) because of quantization
-	setInternalNodeAabbMax(m_curNodeIndex,m_bvhAabbMin);//can't use btVector3(-SIMD_INFINITY,-SIMD_INFINITY,-SIMD_INFINITY)) because of quantization
-	
-	
-	for (i=startIndex;i<endIndex;i++)
-	{
-		mergeInternalNodeAabb(m_curNodeIndex,getAabbMin(i),getAabbMax(i));
-	}
-
-	m_curNodeIndex++;
-	
-
-	//internalNode->m_escapeIndex;
-	
-	int leftChildNodexIndex = m_curNodeIndex;
-
-	//build left child tree
-	buildTree(startIndex,splitIndex);
-
-	int rightChildNodexIndex = m_curNodeIndex;
-	//build right child tree
-	buildTree(splitIndex,endIndex);
-
-#ifdef DEBUG_TREE_BUILDING
-	gStackDepth--;
-#endif //DEBUG_TREE_BUILDING
-
-	int escapeIndex = m_curNodeIndex - curIndex;
-
-	if (m_useQuantization)
-	{
-		//escapeIndex is the number of nodes of this subtree
-		const int sizeQuantizedNode =sizeof(btQuantizedBvhNode);
-		const int treeSizeInBytes = escapeIndex * sizeQuantizedNode;
-		if (treeSizeInBytes > MAX_SUBTREE_SIZE_IN_BYTES)
-		{
-			updateSubtreeHeaders(leftChildNodexIndex,rightChildNodexIndex);
-		}
-	} else
-	{
-
-	}
-
-	setInternalNodeEscapeIndex(internalNodeIndex,escapeIndex);
-
-}
-
-void	btQuantizedBvh::updateSubtreeHeaders(int leftChildNodexIndex,int rightChildNodexIndex)
-{
-	btAssert(m_useQuantization);
-
-	btQuantizedBvhNode& leftChildNode = m_quantizedContiguousNodes[leftChildNodexIndex];
-	int leftSubTreeSize = leftChildNode.isLeafNode() ? 1 : leftChildNode.getEscapeIndex();
-	int leftSubTreeSizeInBytes =  leftSubTreeSize * static_cast<int>(sizeof(btQuantizedBvhNode));
-	
-	btQuantizedBvhNode& rightChildNode = m_quantizedContiguousNodes[rightChildNodexIndex];
-	int rightSubTreeSize = rightChildNode.isLeafNode() ? 1 : rightChildNode.getEscapeIndex();
-	int rightSubTreeSizeInBytes =  rightSubTreeSize *  static_cast<int>(sizeof(btQuantizedBvhNode));
-
-	if(leftSubTreeSizeInBytes <= MAX_SUBTREE_SIZE_IN_BYTES)
-	{
-		btBvhSubtreeInfo& subtree = m_SubtreeHeaders.expand();
-		subtree.setAabbFromQuantizeNode(leftChildNode);
-		subtree.m_rootNodeIndex = leftChildNodexIndex;
-		subtree.m_subtreeSize = leftSubTreeSize;
-	}
-
-	if(rightSubTreeSizeInBytes <= MAX_SUBTREE_SIZE_IN_BYTES)
-	{
-		btBvhSubtreeInfo& subtree = m_SubtreeHeaders.expand();
-		subtree.setAabbFromQuantizeNode(rightChildNode);
-		subtree.m_rootNodeIndex = rightChildNodexIndex;
-		subtree.m_subtreeSize = rightSubTreeSize;
-	}
-
-	//PCK: update the copy of the size
-	m_subtreeHeaderCount = m_SubtreeHeaders.size();
-}
-
-
-int	btQuantizedBvh::sortAndCalcSplittingIndex(int startIndex,int endIndex,int splitAxis)
-{
-	int i;
-	int splitIndex =startIndex;
-	int numIndices = endIndex - startIndex;
-	btScalar splitValue;
-
-	btVector3 means(btScalar(0.),btScalar(0.),btScalar(0.));
-	for (i=startIndex;i<endIndex;i++)
-	{
-		btVector3 center = btScalar(0.5)*(getAabbMax(i)+getAabbMin(i));
-		means+=center;
-	}
-	means *= (btScalar(1.)/(btScalar)numIndices);
-	
-	splitValue = means[splitAxis];
-	
-	//sort leafNodes so all values larger then splitValue comes first, and smaller values start from 'splitIndex'.
-	for (i=startIndex;i<endIndex;i++)
-	{
-		btVector3 center = btScalar(0.5)*(getAabbMax(i)+getAabbMin(i));
-		if (center[splitAxis] > splitValue)
-		{
-			//swap
-			swapLeafNodes(i,splitIndex);
-			splitIndex++;
-		}
-	}
-
-	//if the splitIndex causes unbalanced trees, fix this by using the center in between startIndex and endIndex
-	//otherwise the tree-building might fail due to stack-overflows in certain cases.
-	//unbalanced1 is unsafe: it can cause stack overflows
-	//bool unbalanced1 = ((splitIndex==startIndex) || (splitIndex == (endIndex-1)));
-
-	//unbalanced2 should work too: always use center (perfect balanced trees)	
-	//bool unbalanced2 = true;
-
-	//this should be safe too:
-	int rangeBalancedIndices = numIndices/3;
-	bool unbalanced = ((splitIndex<=(startIndex+rangeBalancedIndices)) || (splitIndex >=(endIndex-1-rangeBalancedIndices)));
-	
-	if (unbalanced)
-	{
-		splitIndex = startIndex+ (numIndices>>1);
-	}
-
-	bool unbal = (splitIndex==startIndex) || (splitIndex == (endIndex));
-	(void)unbal;
-	btAssert(!unbal);
-
-	return splitIndex;
-}
-
-
-int	btQuantizedBvh::calcSplittingAxis(int startIndex,int endIndex)
-{
-	int i;
-
-	btVector3 means(btScalar(0.),btScalar(0.),btScalar(0.));
-	btVector3 variance(btScalar(0.),btScalar(0.),btScalar(0.));
-	int numIndices = endIndex-startIndex;
-
-	for (i=startIndex;i<endIndex;i++)
-	{
-		btVector3 center = btScalar(0.5)*(getAabbMax(i)+getAabbMin(i));
-		means+=center;
-	}
-	means *= (btScalar(1.)/(btScalar)numIndices);
-		
-	for (i=startIndex;i<endIndex;i++)
-	{
-		btVector3 center = btScalar(0.5)*(getAabbMax(i)+getAabbMin(i));
-		btVector3 diff2 = center-means;
-		diff2 = diff2 * diff2;
-		variance += diff2;
-	}
-	variance *= (btScalar(1.)/	((btScalar)numIndices-1)	);
-	
-	return variance.maxAxis();
-}
-
-
-
-void	btQuantizedBvh::reportAabbOverlappingNodex(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const
-{
-	//either choose recursive traversal (walkTree) or stackless (walkStacklessTree)
-
-	if (m_useQuantization)
-	{
-		///quantize query AABB
-		unsigned short int quantizedQueryAabbMin[3];
-		unsigned short int quantizedQueryAabbMax[3];
-		quantizeWithClamp(quantizedQueryAabbMin,aabbMin,0);
-		quantizeWithClamp(quantizedQueryAabbMax,aabbMax,1);
-
-		switch (m_traversalMode)
-		{
-		case TRAVERSAL_STACKLESS:
-				walkStacklessQuantizedTree(nodeCallback,quantizedQueryAabbMin,quantizedQueryAabbMax,0,m_curNodeIndex);
-			break;
-		case TRAVERSAL_STACKLESS_CACHE_FRIENDLY:
-				walkStacklessQuantizedTreeCacheFriendly(nodeCallback,quantizedQueryAabbMin,quantizedQueryAabbMax);
-			break;
-		case TRAVERSAL_RECURSIVE:
-			{
-				const btQuantizedBvhNode* rootNode = &m_quantizedContiguousNodes[0];
-				walkRecursiveQuantizedTreeAgainstQueryAabb(rootNode,nodeCallback,quantizedQueryAabbMin,quantizedQueryAabbMax);
-			}
-			break;
-		default:
-			//unsupported
-			btAssert(0);
-		}
-	} else
-	{
-		walkStacklessTree(nodeCallback,aabbMin,aabbMax);
-	}
-}
-
-
-int maxIterations = 0;
-
-
-void	btQuantizedBvh::walkStacklessTree(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const
-{
-	btAssert(!m_useQuantization);
-
-	const btOptimizedBvhNode* rootNode = &m_contiguousNodes[0];
-	int escapeIndex, curIndex = 0;
-	int walkIterations = 0;
-	bool isLeafNode;
-	//PCK: unsigned instead of bool
-	unsigned aabbOverlap;
-
-	while (curIndex < m_curNodeIndex)
-	{
-		//catch bugs in tree data
-		btAssert (walkIterations < m_curNodeIndex);
-
-		walkIterations++;
-		aabbOverlap = TestAabbAgainstAabb2(aabbMin,aabbMax,rootNode->m_aabbMinOrg,rootNode->m_aabbMaxOrg);
-		isLeafNode = rootNode->m_escapeIndex == -1;
-		
-		//PCK: unsigned instead of bool
-		if (isLeafNode && (aabbOverlap != 0))
-		{
-			nodeCallback->processNode(rootNode->m_subPart,rootNode->m_triangleIndex);
-		} 
-		
-		//PCK: unsigned instead of bool
-		if ((aabbOverlap != 0) || isLeafNode)
-		{
-			rootNode++;
-			curIndex++;
-		} else
-		{
-			escapeIndex = rootNode->m_escapeIndex;
-			rootNode += escapeIndex;
-			curIndex += escapeIndex;
-		}
-	}
-	if (maxIterations < walkIterations)
-		maxIterations = walkIterations;
-
-}
-
-/*
-///this was the original recursive traversal, before we optimized towards stackless traversal
-void	btQuantizedBvh::walkTree(btOptimizedBvhNode* rootNode,btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const
-{
-	bool isLeafNode, aabbOverlap = TestAabbAgainstAabb2(aabbMin,aabbMax,rootNode->m_aabbMin,rootNode->m_aabbMax);
-	if (aabbOverlap)
-	{
-		isLeafNode = (!rootNode->m_leftChild && !rootNode->m_rightChild);
-		if (isLeafNode)
-		{
-			nodeCallback->processNode(rootNode);
-		} else
-		{
-			walkTree(rootNode->m_leftChild,nodeCallback,aabbMin,aabbMax);
-			walkTree(rootNode->m_rightChild,nodeCallback,aabbMin,aabbMax);
-		}
-	}
-
-}
-*/
-
-void btQuantizedBvh::walkRecursiveQuantizedTreeAgainstQueryAabb(const btQuantizedBvhNode* currentNode,btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax) const
-{
-	btAssert(m_useQuantization);
-	
-	bool isLeafNode;
-	//PCK: unsigned instead of bool
-	unsigned aabbOverlap;
-
-	//PCK: unsigned instead of bool
-	aabbOverlap = testQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,currentNode->m_quantizedAabbMin,currentNode->m_quantizedAabbMax);
-	isLeafNode = currentNode->isLeafNode();
-		
-	//PCK: unsigned instead of bool
-	if (aabbOverlap != 0)
-	{
-		if (isLeafNode)
-		{
-			nodeCallback->processNode(currentNode->getPartId(),currentNode->getTriangleIndex());
-		} else
-		{
-			//process left and right children
-			const btQuantizedBvhNode* leftChildNode = currentNode+1;
-			walkRecursiveQuantizedTreeAgainstQueryAabb(leftChildNode,nodeCallback,quantizedQueryAabbMin,quantizedQueryAabbMax);
-
-			const btQuantizedBvhNode* rightChildNode = leftChildNode->isLeafNode() ? leftChildNode+1:leftChildNode+leftChildNode->getEscapeIndex();
-			walkRecursiveQuantizedTreeAgainstQueryAabb(rightChildNode,nodeCallback,quantizedQueryAabbMin,quantizedQueryAabbMax);
-		}
-	}		
-}
-
-
-
-void	btQuantizedBvh::walkStacklessTreeAgainstRay(btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget, const btVector3& aabbMin, const btVector3& aabbMax, int startNodeIndex,int endNodeIndex) const
-{
-	btAssert(!m_useQuantization);
-
-	const btOptimizedBvhNode* rootNode = &m_contiguousNodes[0];
-	int escapeIndex, curIndex = 0;
-	int walkIterations = 0;
-	bool isLeafNode;
-	//PCK: unsigned instead of bool
-	unsigned aabbOverlap=0;
-	unsigned rayBoxOverlap=0;
-	btScalar lambda_max = 1.0;
-	
-		/* Quick pruning by quantized box */
-	btVector3 rayAabbMin = raySource;
-	btVector3 rayAabbMax = raySource;
-	rayAabbMin.setMin(rayTarget);
-	rayAabbMax.setMax(rayTarget);
-
-	/* Add box cast extents to bounding box */
-	rayAabbMin += aabbMin;
-	rayAabbMax += aabbMax;
-
-#ifdef RAYAABB2
-	btVector3 rayDir = (rayTarget-raySource);
-	rayDir.normalize ();
-	lambda_max = rayDir.dot(rayTarget-raySource);
-	///what about division by zero? --> just set rayDirection[i] to 1.0
-	btVector3 rayDirectionInverse;
-	rayDirectionInverse[0] = rayDir[0] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[0];
-	rayDirectionInverse[1] = rayDir[1] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[1];
-	rayDirectionInverse[2] = rayDir[2] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[2];
-	unsigned int sign[3] = { rayDirectionInverse[0] < 0.0, rayDirectionInverse[1] < 0.0, rayDirectionInverse[2] < 0.0};
-#endif
-
-	btVector3 bounds[2];
-
-	while (curIndex < m_curNodeIndex)
-	{
-		btScalar param = 1.0;
-		//catch bugs in tree data
-		btAssert (walkIterations < m_curNodeIndex);
-
-		walkIterations++;
-
-		bounds[0] = rootNode->m_aabbMinOrg;
-		bounds[1] = rootNode->m_aabbMaxOrg;
-		/* Add box cast extents */
-		bounds[0] -= aabbMax;
-		bounds[1] -= aabbMin;
-
-		aabbOverlap = TestAabbAgainstAabb2(rayAabbMin,rayAabbMax,rootNode->m_aabbMinOrg,rootNode->m_aabbMaxOrg);
-		//perhaps profile if it is worth doing the aabbOverlap test first
-
-#ifdef RAYAABB2
-			///careful with this check: need to check division by zero (above) and fix the unQuantize method
-			///thanks Joerg/hiker for the reproduction case!
-			///http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1858
-		rayBoxOverlap = aabbOverlap ? btRayAabb2 (raySource, rayDirectionInverse, sign, bounds, param, 0.0f, lambda_max) : false;
-
-#else
-		btVector3 normal;
-		rayBoxOverlap = btRayAabb(raySource, rayTarget,bounds[0],bounds[1],param, normal);
-#endif
-
-		isLeafNode = rootNode->m_escapeIndex == -1;
-		
-		//PCK: unsigned instead of bool
-		if (isLeafNode && (rayBoxOverlap != 0))
-		{
-			nodeCallback->processNode(rootNode->m_subPart,rootNode->m_triangleIndex);
-		} 
-		
-		//PCK: unsigned instead of bool
-		if ((rayBoxOverlap != 0) || isLeafNode)
-		{
-			rootNode++;
-			curIndex++;
-		} else
-		{
-			escapeIndex = rootNode->m_escapeIndex;
-			rootNode += escapeIndex;
-			curIndex += escapeIndex;
-		}
-	}
-	if (maxIterations < walkIterations)
-		maxIterations = walkIterations;
-
-}
-
-
-
-void	btQuantizedBvh::walkStacklessQuantizedTreeAgainstRay(btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget, const btVector3& aabbMin, const btVector3& aabbMax, int startNodeIndex,int endNodeIndex) const
-{
-	btAssert(m_useQuantization);
-	
-	int curIndex = startNodeIndex;
-	int walkIterations = 0;
-	int subTreeSize = endNodeIndex - startNodeIndex;
-	(void)subTreeSize;
-
-	const btQuantizedBvhNode* rootNode = &m_quantizedContiguousNodes[startNodeIndex];
-	int escapeIndex;
-	
-	bool isLeafNode;
-	//PCK: unsigned instead of bool
-	unsigned boxBoxOverlap = 0;
-	unsigned rayBoxOverlap = 0;
-
-	btScalar lambda_max = 1.0;
-
-#ifdef RAYAABB2
-	btVector3 rayDirection = (rayTarget-raySource);
-	rayDirection.normalize ();
-	lambda_max = rayDirection.dot(rayTarget-raySource);
-	///what about division by zero? --> just set rayDirection[i] to 1.0
-	rayDirection[0] = rayDirection[0] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDirection[0];
-	rayDirection[1] = rayDirection[1] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDirection[1];
-	rayDirection[2] = rayDirection[2] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDirection[2];
-	unsigned int sign[3] = { rayDirection[0] < 0.0, rayDirection[1] < 0.0, rayDirection[2] < 0.0};
-#endif
-
-	/* Quick pruning by quantized box */
-	btVector3 rayAabbMin = raySource;
-	btVector3 rayAabbMax = raySource;
-	rayAabbMin.setMin(rayTarget);
-	rayAabbMax.setMax(rayTarget);
-
-	/* Add box cast extents to bounding box */
-	rayAabbMin += aabbMin;
-	rayAabbMax += aabbMax;
-
-	unsigned short int quantizedQueryAabbMin[3];
-	unsigned short int quantizedQueryAabbMax[3];
-	quantizeWithClamp(quantizedQueryAabbMin,rayAabbMin,0);
-	quantizeWithClamp(quantizedQueryAabbMax,rayAabbMax,1);
-
-	while (curIndex < endNodeIndex)
-	{
-
-//#define VISUALLY_ANALYZE_BVH 1
-#ifdef VISUALLY_ANALYZE_BVH
-		//some code snippet to debugDraw aabb, to visually analyze bvh structure
-		static int drawPatch = 0;
-		//need some global access to a debugDrawer
-		extern btIDebugDraw* debugDrawerPtr;
-		if (curIndex==drawPatch)
-		{
-			btVector3 aabbMin,aabbMax;
-			aabbMin = unQuantize(rootNode->m_quantizedAabbMin);
-			aabbMax = unQuantize(rootNode->m_quantizedAabbMax);
-			btVector3	color(1,0,0);
-			debugDrawerPtr->drawAabb(aabbMin,aabbMax,color);
-		}
-#endif//VISUALLY_ANALYZE_BVH
-
-		//catch bugs in tree data
-		btAssert (walkIterations < subTreeSize);
-
-		walkIterations++;
-		//PCK: unsigned instead of bool
-		// only interested if this is closer than any previous hit
-		btScalar param = 1.0;
-		rayBoxOverlap = 0;
-		boxBoxOverlap = testQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,rootNode->m_quantizedAabbMin,rootNode->m_quantizedAabbMax);
-		isLeafNode = rootNode->isLeafNode();
-		if (boxBoxOverlap)
-		{
-			btVector3 bounds[2];
-			bounds[0] = unQuantize(rootNode->m_quantizedAabbMin);
-			bounds[1] = unQuantize(rootNode->m_quantizedAabbMax);
-			/* Add box cast extents */
-			bounds[0] -= aabbMax;
-			bounds[1] -= aabbMin;
-			btVector3 normal;
-#if 0
-			bool ra2 = btRayAabb2 (raySource, rayDirection, sign, bounds, param, 0.0, lambda_max);
-			bool ra = btRayAabb (raySource, rayTarget, bounds[0], bounds[1], param, normal);
-			if (ra2 != ra)
-			{
-				printf("functions don't match\n");
-			}
-#endif
-#ifdef RAYAABB2
-			///careful with this check: need to check division by zero (above) and fix the unQuantize method
-			///thanks Joerg/hiker for the reproduction case!
-			///http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1858
-
-			//BT_PROFILE("btRayAabb2");
-			rayBoxOverlap = btRayAabb2 (raySource, rayDirection, sign, bounds, param, 0.0f, lambda_max);
-			
-#else
-			rayBoxOverlap = true;//btRayAabb(raySource, rayTarget, bounds[0], bounds[1], param, normal);
-#endif
-		}
-		
-		if (isLeafNode && rayBoxOverlap)
-		{
-			nodeCallback->processNode(rootNode->getPartId(),rootNode->getTriangleIndex());
-		}
-		
-		//PCK: unsigned instead of bool
-		if ((rayBoxOverlap != 0) || isLeafNode)
-		{
-			rootNode++;
-			curIndex++;
-		} else
-		{
-			escapeIndex = rootNode->getEscapeIndex();
-			rootNode += escapeIndex;
-			curIndex += escapeIndex;
-		}
-	}
-	if (maxIterations < walkIterations)
-		maxIterations = walkIterations;
-
-}
-
-void	btQuantizedBvh::walkStacklessQuantizedTree(btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax,int startNodeIndex,int endNodeIndex) const
-{
-	btAssert(m_useQuantization);
-	
-	int curIndex = startNodeIndex;
-	int walkIterations = 0;
-	int subTreeSize = endNodeIndex - startNodeIndex;
-	(void)subTreeSize;
-
-	const btQuantizedBvhNode* rootNode = &m_quantizedContiguousNodes[startNodeIndex];
-	int escapeIndex;
-	
-	bool isLeafNode;
-	//PCK: unsigned instead of bool
-	unsigned aabbOverlap;
-
-	while (curIndex < endNodeIndex)
-	{
-
-//#define VISUALLY_ANALYZE_BVH 1
-#ifdef VISUALLY_ANALYZE_BVH
-		//some code snippet to debugDraw aabb, to visually analyze bvh structure
-		static int drawPatch = 0;
-		//need some global access to a debugDrawer
-		extern btIDebugDraw* debugDrawerPtr;
-		if (curIndex==drawPatch)
-		{
-			btVector3 aabbMin,aabbMax;
-			aabbMin = unQuantize(rootNode->m_quantizedAabbMin);
-			aabbMax = unQuantize(rootNode->m_quantizedAabbMax);
-			btVector3	color(1,0,0);
-			debugDrawerPtr->drawAabb(aabbMin,aabbMax,color);
-		}
-#endif//VISUALLY_ANALYZE_BVH
-
-		//catch bugs in tree data
-		btAssert (walkIterations < subTreeSize);
-
-		walkIterations++;
-		//PCK: unsigned instead of bool
-		aabbOverlap = testQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,rootNode->m_quantizedAabbMin,rootNode->m_quantizedAabbMax);
-		isLeafNode = rootNode->isLeafNode();
-		
-		if (isLeafNode && aabbOverlap)
-		{
-			nodeCallback->processNode(rootNode->getPartId(),rootNode->getTriangleIndex());
-		} 
-		
-		//PCK: unsigned instead of bool
-		if ((aabbOverlap != 0) || isLeafNode)
-		{
-			rootNode++;
-			curIndex++;
-		} else
-		{
-			escapeIndex = rootNode->getEscapeIndex();
-			rootNode += escapeIndex;
-			curIndex += escapeIndex;
-		}
-	}
-	if (maxIterations < walkIterations)
-		maxIterations = walkIterations;
-
-}
-
-//This traversal can be called from Playstation 3 SPU
-void	btQuantizedBvh::walkStacklessQuantizedTreeCacheFriendly(btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax) const
-{
-	btAssert(m_useQuantization);
-
-	int i;
-
-
-	for (i=0;i<this->m_SubtreeHeaders.size();i++)
-	{
-		const btBvhSubtreeInfo& subtree = m_SubtreeHeaders[i];
-
-		//PCK: unsigned instead of bool
-		unsigned overlap = testQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,subtree.m_quantizedAabbMin,subtree.m_quantizedAabbMax);
-		if (overlap != 0)
-		{
-			walkStacklessQuantizedTree(nodeCallback,quantizedQueryAabbMin,quantizedQueryAabbMax,
-				subtree.m_rootNodeIndex,
-				subtree.m_rootNodeIndex+subtree.m_subtreeSize);
-		}
-	}
-}
-
-
-void	btQuantizedBvh::reportRayOverlappingNodex (btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget) const
-{
-	reportBoxCastOverlappingNodex(nodeCallback,raySource,rayTarget,btVector3(0,0,0),btVector3(0,0,0));
-}
-
-
-void	btQuantizedBvh::reportBoxCastOverlappingNodex(btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget, const btVector3& aabbMin,const btVector3& aabbMax) const
-{
-	//always use stackless
-
-	if (m_useQuantization)
-	{
-		walkStacklessQuantizedTreeAgainstRay(nodeCallback, raySource, rayTarget, aabbMin, aabbMax, 0, m_curNodeIndex);
-	}
-	else
-	{
-		walkStacklessTreeAgainstRay(nodeCallback, raySource, rayTarget, aabbMin, aabbMax, 0, m_curNodeIndex);
-	}
-	/*
-	{
-		//recursive traversal
-		btVector3 qaabbMin = raySource;
-		btVector3 qaabbMax = raySource;
-		qaabbMin.setMin(rayTarget);
-		qaabbMax.setMax(rayTarget);
-		qaabbMin += aabbMin;
-		qaabbMax += aabbMax;
-		reportAabbOverlappingNodex(nodeCallback,qaabbMin,qaabbMax);
-	}
-	*/
-
-}
-
-
-void	btQuantizedBvh::swapLeafNodes(int i,int splitIndex)
-{
-	if (m_useQuantization)
-	{
-			btQuantizedBvhNode tmp = m_quantizedLeafNodes[i];
-			m_quantizedLeafNodes[i] = m_quantizedLeafNodes[splitIndex];
-			m_quantizedLeafNodes[splitIndex] = tmp;
-	} else
-	{
-			btOptimizedBvhNode tmp = m_leafNodes[i];
-			m_leafNodes[i] = m_leafNodes[splitIndex];
-			m_leafNodes[splitIndex] = tmp;
-	}
-}
-
-void	btQuantizedBvh::assignInternalNodeFromLeafNode(int internalNode,int leafNodeIndex)
-{
-	if (m_useQuantization)
-	{
-		m_quantizedContiguousNodes[internalNode] = m_quantizedLeafNodes[leafNodeIndex];
-	} else
-	{
-		m_contiguousNodes[internalNode] = m_leafNodes[leafNodeIndex];
-	}
-}
-
-//PCK: include
-#include <new>
-
-#if 0
-//PCK: consts
-static const unsigned BVH_ALIGNMENT = 16;
-static const unsigned BVH_ALIGNMENT_MASK = BVH_ALIGNMENT-1;
-
-static const unsigned BVH_ALIGNMENT_BLOCKS = 2;
-#endif
-
-
-unsigned int btQuantizedBvh::getAlignmentSerializationPadding()
-{
-	// I changed this to 0 since the extra padding is not needed or used.
-	return 0;//BVH_ALIGNMENT_BLOCKS * BVH_ALIGNMENT;
-}
-
-unsigned btQuantizedBvh::calculateSerializeBufferSize() const
-{
-	unsigned baseSize = sizeof(btQuantizedBvh) + getAlignmentSerializationPadding();
-	baseSize += sizeof(btBvhSubtreeInfo) * m_subtreeHeaderCount;
-	if (m_useQuantization)
-	{
-		return baseSize + m_curNodeIndex * sizeof(btQuantizedBvhNode);
-	}
-	return baseSize + m_curNodeIndex * sizeof(btOptimizedBvhNode);
-}
-
-bool btQuantizedBvh::serialize(void *o_alignedDataBuffer, unsigned /*i_dataBufferSize */, bool i_swapEndian) const
-{
-	btAssert(m_subtreeHeaderCount == m_SubtreeHeaders.size());
-	m_subtreeHeaderCount = m_SubtreeHeaders.size();
-
-/*	if (i_dataBufferSize < calculateSerializeBufferSize() || o_alignedDataBuffer == NULL || (((unsigned)o_alignedDataBuffer & BVH_ALIGNMENT_MASK) != 0))
-	{
-		///check alignedment for buffer?
-		btAssert(0);
-		return false;
-	}
-*/
-
-	btQuantizedBvh *targetBvh = (btQuantizedBvh *)o_alignedDataBuffer;
-
-	// construct the class so the virtual function table, etc will be set up
-	// Also, m_leafNodes and m_quantizedLeafNodes will be initialized to default values by the constructor
-	new (targetBvh) btQuantizedBvh;
-
-	if (i_swapEndian)
-	{
-		targetBvh->m_curNodeIndex = static_cast<int>(btSwapEndian(m_curNodeIndex));
-
-
-		btSwapVector3Endian(m_bvhAabbMin,targetBvh->m_bvhAabbMin);
-		btSwapVector3Endian(m_bvhAabbMax,targetBvh->m_bvhAabbMax);
-		btSwapVector3Endian(m_bvhQuantization,targetBvh->m_bvhQuantization);
-
-		targetBvh->m_traversalMode = (btTraversalMode)btSwapEndian(m_traversalMode);
-		targetBvh->m_subtreeHeaderCount = static_cast<int>(btSwapEndian(m_subtreeHeaderCount));
-	}
-	else
-	{
-		targetBvh->m_curNodeIndex = m_curNodeIndex;
-		targetBvh->m_bvhAabbMin = m_bvhAabbMin;
-		targetBvh->m_bvhAabbMax = m_bvhAabbMax;
-		targetBvh->m_bvhQuantization = m_bvhQuantization;
-		targetBvh->m_traversalMode = m_traversalMode;
-		targetBvh->m_subtreeHeaderCount = m_subtreeHeaderCount;
-	}
-
-	targetBvh->m_useQuantization = m_useQuantization;
-
-	unsigned char *nodeData = (unsigned char *)targetBvh;
-	nodeData += sizeof(btQuantizedBvh);
-	
-	unsigned sizeToAdd = 0;//(BVH_ALIGNMENT-((unsigned)nodeData & BVH_ALIGNMENT_MASK))&BVH_ALIGNMENT_MASK;
-	nodeData += sizeToAdd;
-	
-	int nodeCount = m_curNodeIndex;
-
-	if (m_useQuantization)
-	{
-		targetBvh->m_quantizedContiguousNodes.initializeFromBuffer(nodeData, nodeCount, nodeCount);
-
-		if (i_swapEndian)
-		{
-			for (int nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++)
-			{
-				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0] = btSwapEndian(m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0]);
-				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[1] = btSwapEndian(m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[1]);
-				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[2] = btSwapEndian(m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[2]);
-
-				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0] = btSwapEndian(m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0]);
-				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[1] = btSwapEndian(m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[1]);
-				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[2] = btSwapEndian(m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[2]);
-
-				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex = static_cast<int>(btSwapEndian(m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex));
-			}
-		}
-		else
-		{
-			for (int nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++)
-			{
-	
-				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0] = m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0];
-				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[1] = m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[1];
-				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[2] = m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[2];
-
-				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0] = m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0];
-				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[1] = m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[1];
-				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[2] = m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[2];
-
-				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex = m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex;
-
-
-			}
-		}
-		nodeData += sizeof(btQuantizedBvhNode) * nodeCount;
-
-		// this clears the pointer in the member variable it doesn't really do anything to the data
-		// it does call the destructor on the contained objects, but they are all classes with no destructor defined
-		// so the memory (which is not freed) is left alone
-		targetBvh->m_quantizedContiguousNodes.initializeFromBuffer(NULL, 0, 0);
-	}
-	else
-	{
-		targetBvh->m_contiguousNodes.initializeFromBuffer(nodeData, nodeCount, nodeCount);
-
-		if (i_swapEndian)
-		{
-			for (int nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++)
-			{
-				btSwapVector3Endian(m_contiguousNodes[nodeIndex].m_aabbMinOrg, targetBvh->m_contiguousNodes[nodeIndex].m_aabbMinOrg);
-				btSwapVector3Endian(m_contiguousNodes[nodeIndex].m_aabbMaxOrg, targetBvh->m_contiguousNodes[nodeIndex].m_aabbMaxOrg);
-
-				targetBvh->m_contiguousNodes[nodeIndex].m_escapeIndex = static_cast<int>(btSwapEndian(m_contiguousNodes[nodeIndex].m_escapeIndex));
-				targetBvh->m_contiguousNodes[nodeIndex].m_subPart = static_cast<int>(btSwapEndian(m_contiguousNodes[nodeIndex].m_subPart));
-				targetBvh->m_contiguousNodes[nodeIndex].m_triangleIndex = static_cast<int>(btSwapEndian(m_contiguousNodes[nodeIndex].m_triangleIndex));
-			}
-		}
-		else
-		{
-			for (int nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++)
-			{
-				targetBvh->m_contiguousNodes[nodeIndex].m_aabbMinOrg = m_contiguousNodes[nodeIndex].m_aabbMinOrg;
-				targetBvh->m_contiguousNodes[nodeIndex].m_aabbMaxOrg = m_contiguousNodes[nodeIndex].m_aabbMaxOrg;
-
-				targetBvh->m_contiguousNodes[nodeIndex].m_escapeIndex = m_contiguousNodes[nodeIndex].m_escapeIndex;
-				targetBvh->m_contiguousNodes[nodeIndex].m_subPart = m_contiguousNodes[nodeIndex].m_subPart;
-				targetBvh->m_contiguousNodes[nodeIndex].m_triangleIndex = m_contiguousNodes[nodeIndex].m_triangleIndex;
-			}
-		}
-		nodeData += sizeof(btOptimizedBvhNode) * nodeCount;
-
-		// this clears the pointer in the member variable it doesn't really do anything to the data
-		// it does call the destructor on the contained objects, but they are all classes with no destructor defined
-		// so the memory (which is not freed) is left alone
-		targetBvh->m_contiguousNodes.initializeFromBuffer(NULL, 0, 0);
-	}
-
-	sizeToAdd = 0;//(BVH_ALIGNMENT-((unsigned)nodeData & BVH_ALIGNMENT_MASK))&BVH_ALIGNMENT_MASK;
-	nodeData += sizeToAdd;
-
-	// Now serialize the subtree headers
-	targetBvh->m_SubtreeHeaders.initializeFromBuffer(nodeData, m_subtreeHeaderCount, m_subtreeHeaderCount);
-	if (i_swapEndian)
-	{
-		for (int i = 0; i < m_subtreeHeaderCount; i++)
-		{
-			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMin[0] = btSwapEndian(m_SubtreeHeaders[i].m_quantizedAabbMin[0]);
-			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMin[1] = btSwapEndian(m_SubtreeHeaders[i].m_quantizedAabbMin[1]);
-			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMin[2] = btSwapEndian(m_SubtreeHeaders[i].m_quantizedAabbMin[2]);
-
-			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMax[0] = btSwapEndian(m_SubtreeHeaders[i].m_quantizedAabbMax[0]);
-			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMax[1] = btSwapEndian(m_SubtreeHeaders[i].m_quantizedAabbMax[1]);
-			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMax[2] = btSwapEndian(m_SubtreeHeaders[i].m_quantizedAabbMax[2]);
-
-			targetBvh->m_SubtreeHeaders[i].m_rootNodeIndex = static_cast<int>(btSwapEndian(m_SubtreeHeaders[i].m_rootNodeIndex));
-			targetBvh->m_SubtreeHeaders[i].m_subtreeSize = static_cast<int>(btSwapEndian(m_SubtreeHeaders[i].m_subtreeSize));
-		}
-	}
-	else
-	{
-		for (int i = 0; i < m_subtreeHeaderCount; i++)
-		{
-			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMin[0] = (m_SubtreeHeaders[i].m_quantizedAabbMin[0]);
-			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMin[1] = (m_SubtreeHeaders[i].m_quantizedAabbMin[1]);
-			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMin[2] = (m_SubtreeHeaders[i].m_quantizedAabbMin[2]);
-
-			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMax[0] = (m_SubtreeHeaders[i].m_quantizedAabbMax[0]);
-			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMax[1] = (m_SubtreeHeaders[i].m_quantizedAabbMax[1]);
-			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMax[2] = (m_SubtreeHeaders[i].m_quantizedAabbMax[2]);
-
-			targetBvh->m_SubtreeHeaders[i].m_rootNodeIndex = (m_SubtreeHeaders[i].m_rootNodeIndex);
-			targetBvh->m_SubtreeHeaders[i].m_subtreeSize = (m_SubtreeHeaders[i].m_subtreeSize);
-
-			// need to clear padding in destination buffer
-			targetBvh->m_SubtreeHeaders[i].m_padding[0] = 0;
-			targetBvh->m_SubtreeHeaders[i].m_padding[1] = 0;
-			targetBvh->m_SubtreeHeaders[i].m_padding[2] = 0;
-		}
-	}
-	nodeData += sizeof(btBvhSubtreeInfo) * m_subtreeHeaderCount;
-
-	// this clears the pointer in the member variable it doesn't really do anything to the data
-	// it does call the destructor on the contained objects, but they are all classes with no destructor defined
-	// so the memory (which is not freed) is left alone
-	targetBvh->m_SubtreeHeaders.initializeFromBuffer(NULL, 0, 0);
-
-	// this wipes the virtual function table pointer at the start of the buffer for the class
-	*((void**)o_alignedDataBuffer) = NULL;
-
-	return true;
-}
-
-btQuantizedBvh *btQuantizedBvh::deSerializeInPlace(void *i_alignedDataBuffer, unsigned int i_dataBufferSize, bool i_swapEndian)
-{
-
-	if (i_alignedDataBuffer == NULL)// || (((unsigned)i_alignedDataBuffer & BVH_ALIGNMENT_MASK) != 0))
-	{
-		return NULL;
-	}
-	btQuantizedBvh *bvh = (btQuantizedBvh *)i_alignedDataBuffer;
-
-	if (i_swapEndian)
-	{
-		bvh->m_curNodeIndex = static_cast<int>(btSwapEndian(bvh->m_curNodeIndex));
-
-		btUnSwapVector3Endian(bvh->m_bvhAabbMin);
-		btUnSwapVector3Endian(bvh->m_bvhAabbMax);
-		btUnSwapVector3Endian(bvh->m_bvhQuantization);
-
-		bvh->m_traversalMode = (btTraversalMode)btSwapEndian(bvh->m_traversalMode);
-		bvh->m_subtreeHeaderCount = static_cast<int>(btSwapEndian(bvh->m_subtreeHeaderCount));
-	}
-
-	unsigned int calculatedBufSize = bvh->calculateSerializeBufferSize();
-	btAssert(calculatedBufSize <= i_dataBufferSize);
-
-	if (calculatedBufSize > i_dataBufferSize)
-	{
-		return NULL;
-	}
-
-	unsigned char *nodeData = (unsigned char *)bvh;
-	nodeData += sizeof(btQuantizedBvh);
-	
-	unsigned sizeToAdd = 0;//(BVH_ALIGNMENT-((unsigned)nodeData & BVH_ALIGNMENT_MASK))&BVH_ALIGNMENT_MASK;
-	nodeData += sizeToAdd;
-	
-	int nodeCount = bvh->m_curNodeIndex;
-
-	// Must call placement new to fill in virtual function table, etc, but we don't want to overwrite most data, so call a special version of the constructor
-	// Also, m_leafNodes and m_quantizedLeafNodes will be initialized to default values by the constructor
-	new (bvh) btQuantizedBvh(*bvh, false);
-
-	if (bvh->m_useQuantization)
-	{
-		bvh->m_quantizedContiguousNodes.initializeFromBuffer(nodeData, nodeCount, nodeCount);
-
-		if (i_swapEndian)
-		{
-			for (int nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++)
-			{
-				bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0] = btSwapEndian(bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0]);
-				bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[1] = btSwapEndian(bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[1]);
-				bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[2] = btSwapEndian(bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[2]);
-
-				bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0] = btSwapEndian(bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0]);
-				bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[1] = btSwapEndian(bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[1]);
-				bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[2] = btSwapEndian(bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[2]);
-
-				bvh->m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex = static_cast<int>(btSwapEndian(bvh->m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex));
-			}
-		}
-		nodeData += sizeof(btQuantizedBvhNode) * nodeCount;
-	}
-	else
-	{
-		bvh->m_contiguousNodes.initializeFromBuffer(nodeData, nodeCount, nodeCount);
-
-		if (i_swapEndian)
-		{
-			for (int nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++)
-			{
-				btUnSwapVector3Endian(bvh->m_contiguousNodes[nodeIndex].m_aabbMinOrg);
-				btUnSwapVector3Endian(bvh->m_contiguousNodes[nodeIndex].m_aabbMaxOrg);
-				
-				bvh->m_contiguousNodes[nodeIndex].m_escapeIndex = static_cast<int>(btSwapEndian(bvh->m_contiguousNodes[nodeIndex].m_escapeIndex));
-				bvh->m_contiguousNodes[nodeIndex].m_subPart = static_cast<int>(btSwapEndian(bvh->m_contiguousNodes[nodeIndex].m_subPart));
-				bvh->m_contiguousNodes[nodeIndex].m_triangleIndex = static_cast<int>(btSwapEndian(bvh->m_contiguousNodes[nodeIndex].m_triangleIndex));
-			}
-		}
-		nodeData += sizeof(btOptimizedBvhNode) * nodeCount;
-	}
-
-	sizeToAdd = 0;//(BVH_ALIGNMENT-((unsigned)nodeData & BVH_ALIGNMENT_MASK))&BVH_ALIGNMENT_MASK;
-	nodeData += sizeToAdd;
-
-	// Now serialize the subtree headers
-	bvh->m_SubtreeHeaders.initializeFromBuffer(nodeData, bvh->m_subtreeHeaderCount, bvh->m_subtreeHeaderCount);
-	if (i_swapEndian)
-	{
-		for (int i = 0; i < bvh->m_subtreeHeaderCount; i++)
-		{
-			bvh->m_SubtreeHeaders[i].m_quantizedAabbMin[0] = btSwapEndian(bvh->m_SubtreeHeaders[i].m_quantizedAabbMin[0]);
-			bvh->m_SubtreeHeaders[i].m_quantizedAabbMin[1] = btSwapEndian(bvh->m_SubtreeHeaders[i].m_quantizedAabbMin[1]);
-			bvh->m_SubtreeHeaders[i].m_quantizedAabbMin[2] = btSwapEndian(bvh->m_SubtreeHeaders[i].m_quantizedAabbMin[2]);
-
-			bvh->m_SubtreeHeaders[i].m_quantizedAabbMax[0] = btSwapEndian(bvh->m_SubtreeHeaders[i].m_quantizedAabbMax[0]);
-			bvh->m_SubtreeHeaders[i].m_quantizedAabbMax[1] = btSwapEndian(bvh->m_SubtreeHeaders[i].m_quantizedAabbMax[1]);
-			bvh->m_SubtreeHeaders[i].m_quantizedAabbMax[2] = btSwapEndian(bvh->m_SubtreeHeaders[i].m_quantizedAabbMax[2]);
-
-			bvh->m_SubtreeHeaders[i].m_rootNodeIndex = static_cast<int>(btSwapEndian(bvh->m_SubtreeHeaders[i].m_rootNodeIndex));
-			bvh->m_SubtreeHeaders[i].m_subtreeSize = static_cast<int>(btSwapEndian(bvh->m_SubtreeHeaders[i].m_subtreeSize));
-		}
-	}
-
-	return bvh;
-}
-
-// Constructor that prevents btVector3's default constructor from being called
-btQuantizedBvh::btQuantizedBvh(btQuantizedBvh &self, bool /* ownsMemory */) :
-m_bvhAabbMin(self.m_bvhAabbMin),
-m_bvhAabbMax(self.m_bvhAabbMax),
-m_bvhQuantization(self.m_bvhQuantization),
-m_bulletVersion(BT_BULLET_VERSION)
-{
-
-}
-
-void btQuantizedBvh::deSerializeFloat(struct btQuantizedBvhFloatData& quantizedBvhFloatData)
-{
-	m_bvhAabbMax.deSerializeFloat(quantizedBvhFloatData.m_bvhAabbMax);
-	m_bvhAabbMin.deSerializeFloat(quantizedBvhFloatData.m_bvhAabbMin);
-	m_bvhQuantization.deSerializeFloat(quantizedBvhFloatData.m_bvhQuantization);
-
-	m_curNodeIndex = quantizedBvhFloatData.m_curNodeIndex;
-	m_useQuantization = quantizedBvhFloatData.m_useQuantization!=0;
-	
-	{
-		int numElem = quantizedBvhFloatData.m_numContiguousLeafNodes;
-		m_contiguousNodes.resize(numElem);
-
-		if (numElem)
-		{
-			btOptimizedBvhNodeFloatData* memPtr = quantizedBvhFloatData.m_contiguousNodesPtr;
-
-			for (int i=0;i<numElem;i++,memPtr++)
-			{
-				m_contiguousNodes[i].m_aabbMaxOrg.deSerializeFloat(memPtr->m_aabbMaxOrg);
-				m_contiguousNodes[i].m_aabbMinOrg.deSerializeFloat(memPtr->m_aabbMinOrg);
-				m_contiguousNodes[i].m_escapeIndex = memPtr->m_escapeIndex;
-				m_contiguousNodes[i].m_subPart = memPtr->m_subPart;
-				m_contiguousNodes[i].m_triangleIndex = memPtr->m_triangleIndex;
-			}
-		}
-	}
-
-	{
-		int numElem = quantizedBvhFloatData.m_numQuantizedContiguousNodes;
-		m_quantizedContiguousNodes.resize(numElem);
-		
-		if (numElem)
-		{
-			btQuantizedBvhNodeData* memPtr = quantizedBvhFloatData.m_quantizedContiguousNodesPtr;
-			for (int i=0;i<numElem;i++,memPtr++)
-			{
-				m_quantizedContiguousNodes[i].m_escapeIndexOrTriangleIndex = memPtr->m_escapeIndexOrTriangleIndex;
-				m_quantizedContiguousNodes[i].m_quantizedAabbMax[0] = memPtr->m_quantizedAabbMax[0];
-				m_quantizedContiguousNodes[i].m_quantizedAabbMax[1] = memPtr->m_quantizedAabbMax[1];
-				m_quantizedContiguousNodes[i].m_quantizedAabbMax[2] = memPtr->m_quantizedAabbMax[2];
-				m_quantizedContiguousNodes[i].m_quantizedAabbMin[0] = memPtr->m_quantizedAabbMin[0];
-				m_quantizedContiguousNodes[i].m_quantizedAabbMin[1] = memPtr->m_quantizedAabbMin[1];
-				m_quantizedContiguousNodes[i].m_quantizedAabbMin[2] = memPtr->m_quantizedAabbMin[2];
-			}
-		}
-	}
-
-	m_traversalMode = btTraversalMode(quantizedBvhFloatData.m_traversalMode);
-	
-	{
-		int numElem = quantizedBvhFloatData.m_numSubtreeHeaders;
-		m_SubtreeHeaders.resize(numElem);
-		if (numElem)
-		{
-			btBvhSubtreeInfoData* memPtr = quantizedBvhFloatData.m_subTreeInfoPtr;
-			for (int i=0;i<numElem;i++,memPtr++)
-			{
-				m_SubtreeHeaders[i].m_quantizedAabbMax[0] = memPtr->m_quantizedAabbMax[0] ;
-				m_SubtreeHeaders[i].m_quantizedAabbMax[1] = memPtr->m_quantizedAabbMax[1];
-				m_SubtreeHeaders[i].m_quantizedAabbMax[2] = memPtr->m_quantizedAabbMax[2];
-				m_SubtreeHeaders[i].m_quantizedAabbMin[0] = memPtr->m_quantizedAabbMin[0];
-				m_SubtreeHeaders[i].m_quantizedAabbMin[1] = memPtr->m_quantizedAabbMin[1];
-				m_SubtreeHeaders[i].m_quantizedAabbMin[2] = memPtr->m_quantizedAabbMin[2];
-				m_SubtreeHeaders[i].m_rootNodeIndex = memPtr->m_rootNodeIndex;
-				m_SubtreeHeaders[i].m_subtreeSize = memPtr->m_subtreeSize;
-			}
-		}
-	}
-}
-
-void btQuantizedBvh::deSerializeDouble(struct btQuantizedBvhDoubleData& quantizedBvhDoubleData)
-{
-	m_bvhAabbMax.deSerializeDouble(quantizedBvhDoubleData.m_bvhAabbMax);
-	m_bvhAabbMin.deSerializeDouble(quantizedBvhDoubleData.m_bvhAabbMin);
-	m_bvhQuantization.deSerializeDouble(quantizedBvhDoubleData.m_bvhQuantization);
-
-	m_curNodeIndex = quantizedBvhDoubleData.m_curNodeIndex;
-	m_useQuantization = quantizedBvhDoubleData.m_useQuantization!=0;
-	
-	{
-		int numElem = quantizedBvhDoubleData.m_numContiguousLeafNodes;
-		m_contiguousNodes.resize(numElem);
-
-		if (numElem)
-		{
-			btOptimizedBvhNodeDoubleData* memPtr = quantizedBvhDoubleData.m_contiguousNodesPtr;
-
-			for (int i=0;i<numElem;i++,memPtr++)
-			{
-				m_contiguousNodes[i].m_aabbMaxOrg.deSerializeDouble(memPtr->m_aabbMaxOrg);
-				m_contiguousNodes[i].m_aabbMinOrg.deSerializeDouble(memPtr->m_aabbMinOrg);
-				m_contiguousNodes[i].m_escapeIndex = memPtr->m_escapeIndex;
-				m_contiguousNodes[i].m_subPart = memPtr->m_subPart;
-				m_contiguousNodes[i].m_triangleIndex = memPtr->m_triangleIndex;
-			}
-		}
-	}
-
-	{
-		int numElem = quantizedBvhDoubleData.m_numQuantizedContiguousNodes;
-		m_quantizedContiguousNodes.resize(numElem);
-		
-		if (numElem)
-		{
-			btQuantizedBvhNodeData* memPtr = quantizedBvhDoubleData.m_quantizedContiguousNodesPtr;
-			for (int i=0;i<numElem;i++,memPtr++)
-			{
-				m_quantizedContiguousNodes[i].m_escapeIndexOrTriangleIndex = memPtr->m_escapeIndexOrTriangleIndex;
-				m_quantizedContiguousNodes[i].m_quantizedAabbMax[0] = memPtr->m_quantizedAabbMax[0];
-				m_quantizedContiguousNodes[i].m_quantizedAabbMax[1] = memPtr->m_quantizedAabbMax[1];
-				m_quantizedContiguousNodes[i].m_quantizedAabbMax[2] = memPtr->m_quantizedAabbMax[2];
-				m_quantizedContiguousNodes[i].m_quantizedAabbMin[0] = memPtr->m_quantizedAabbMin[0];
-				m_quantizedContiguousNodes[i].m_quantizedAabbMin[1] = memPtr->m_quantizedAabbMin[1];
-				m_quantizedContiguousNodes[i].m_quantizedAabbMin[2] = memPtr->m_quantizedAabbMin[2];
-			}
-		}
-	}
-
-	m_traversalMode = btTraversalMode(quantizedBvhDoubleData.m_traversalMode);
-	
-	{
-		int numElem = quantizedBvhDoubleData.m_numSubtreeHeaders;
-		m_SubtreeHeaders.resize(numElem);
-		if (numElem)
-		{
-			btBvhSubtreeInfoData* memPtr = quantizedBvhDoubleData.m_subTreeInfoPtr;
-			for (int i=0;i<numElem;i++,memPtr++)
-			{
-				m_SubtreeHeaders[i].m_quantizedAabbMax[0] = memPtr->m_quantizedAabbMax[0] ;
-				m_SubtreeHeaders[i].m_quantizedAabbMax[1] = memPtr->m_quantizedAabbMax[1];
-				m_SubtreeHeaders[i].m_quantizedAabbMax[2] = memPtr->m_quantizedAabbMax[2];
-				m_SubtreeHeaders[i].m_quantizedAabbMin[0] = memPtr->m_quantizedAabbMin[0];
-				m_SubtreeHeaders[i].m_quantizedAabbMin[1] = memPtr->m_quantizedAabbMin[1];
-				m_SubtreeHeaders[i].m_quantizedAabbMin[2] = memPtr->m_quantizedAabbMin[2];
-				m_SubtreeHeaders[i].m_rootNodeIndex = memPtr->m_rootNodeIndex;
-				m_SubtreeHeaders[i].m_subtreeSize = memPtr->m_subtreeSize;
-			}
-		}
-	}
-
-}
-
-
-
-///fills the dataBuffer and returns the struct name (and 0 on failure)
-const char*	btQuantizedBvh::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-	btQuantizedBvhData* quantizedData = (btQuantizedBvhData*)dataBuffer;
-	
-	m_bvhAabbMax.serialize(quantizedData->m_bvhAabbMax);
-	m_bvhAabbMin.serialize(quantizedData->m_bvhAabbMin);
-	m_bvhQuantization.serialize(quantizedData->m_bvhQuantization);
-
-	quantizedData->m_curNodeIndex = m_curNodeIndex;
-	quantizedData->m_useQuantization = m_useQuantization;
-	
-	quantizedData->m_numContiguousLeafNodes = m_contiguousNodes.size();
-	quantizedData->m_contiguousNodesPtr = (btOptimizedBvhNodeData*) (m_contiguousNodes.size() ? serializer->getUniquePointer((void*)&m_contiguousNodes[0]) : 0);
-	if (quantizedData->m_contiguousNodesPtr)
-	{
-		int sz = sizeof(btOptimizedBvhNodeData);
-		int numElem = m_contiguousNodes.size();
-		btChunk* chunk = serializer->allocate(sz,numElem);
-		btOptimizedBvhNodeData* memPtr = (btOptimizedBvhNodeData*)chunk->m_oldPtr;
-		for (int i=0;i<numElem;i++,memPtr++)
-		{
-			m_contiguousNodes[i].m_aabbMaxOrg.serialize(memPtr->m_aabbMaxOrg);
-			m_contiguousNodes[i].m_aabbMinOrg.serialize(memPtr->m_aabbMinOrg);
-			memPtr->m_escapeIndex = m_contiguousNodes[i].m_escapeIndex;
-			memPtr->m_subPart = m_contiguousNodes[i].m_subPart;
-			memPtr->m_triangleIndex = m_contiguousNodes[i].m_triangleIndex;
-		}
-		serializer->finalizeChunk(chunk,"btOptimizedBvhNodeData",BT_ARRAY_CODE,(void*)&m_contiguousNodes[0]);
-	}
-
-	quantizedData->m_numQuantizedContiguousNodes = m_quantizedContiguousNodes.size();
-//	printf("quantizedData->m_numQuantizedContiguousNodes=%d\n",quantizedData->m_numQuantizedContiguousNodes);
-	quantizedData->m_quantizedContiguousNodesPtr =(btQuantizedBvhNodeData*) (m_quantizedContiguousNodes.size() ? serializer->getUniquePointer((void*)&m_quantizedContiguousNodes[0]) : 0);
-	if (quantizedData->m_quantizedContiguousNodesPtr)
-	{
-		int sz = sizeof(btQuantizedBvhNodeData);
-		int numElem = m_quantizedContiguousNodes.size();
-		btChunk* chunk = serializer->allocate(sz,numElem);
-		btQuantizedBvhNodeData* memPtr = (btQuantizedBvhNodeData*)chunk->m_oldPtr;
-		for (int i=0;i<numElem;i++,memPtr++)
-		{
-			memPtr->m_escapeIndexOrTriangleIndex = m_quantizedContiguousNodes[i].m_escapeIndexOrTriangleIndex;
-			memPtr->m_quantizedAabbMax[0] = m_quantizedContiguousNodes[i].m_quantizedAabbMax[0];
-			memPtr->m_quantizedAabbMax[1] = m_quantizedContiguousNodes[i].m_quantizedAabbMax[1];
-			memPtr->m_quantizedAabbMax[2] = m_quantizedContiguousNodes[i].m_quantizedAabbMax[2];
-			memPtr->m_quantizedAabbMin[0] = m_quantizedContiguousNodes[i].m_quantizedAabbMin[0];
-			memPtr->m_quantizedAabbMin[1] = m_quantizedContiguousNodes[i].m_quantizedAabbMin[1];
-			memPtr->m_quantizedAabbMin[2] = m_quantizedContiguousNodes[i].m_quantizedAabbMin[2];
-		}
-		serializer->finalizeChunk(chunk,"btQuantizedBvhNodeData",BT_ARRAY_CODE,(void*)&m_quantizedContiguousNodes[0]);
-	}
-
-	quantizedData->m_traversalMode = int(m_traversalMode);
-	quantizedData->m_numSubtreeHeaders = m_SubtreeHeaders.size();
-
-	quantizedData->m_subTreeInfoPtr = (btBvhSubtreeInfoData*) (m_SubtreeHeaders.size() ? serializer->getUniquePointer((void*)&m_SubtreeHeaders[0]) : 0);
-	if (quantizedData->m_subTreeInfoPtr)
-	{
-		int sz = sizeof(btBvhSubtreeInfoData);
-		int numElem = m_SubtreeHeaders.size();
-		btChunk* chunk = serializer->allocate(sz,numElem);
-		btBvhSubtreeInfoData* memPtr = (btBvhSubtreeInfoData*)chunk->m_oldPtr;
-		for (int i=0;i<numElem;i++,memPtr++)
-		{
-			memPtr->m_quantizedAabbMax[0] = m_SubtreeHeaders[i].m_quantizedAabbMax[0];
-			memPtr->m_quantizedAabbMax[1] = m_SubtreeHeaders[i].m_quantizedAabbMax[1];
-			memPtr->m_quantizedAabbMax[2] = m_SubtreeHeaders[i].m_quantizedAabbMax[2];
-			memPtr->m_quantizedAabbMin[0] = m_SubtreeHeaders[i].m_quantizedAabbMin[0];
-			memPtr->m_quantizedAabbMin[1] = m_SubtreeHeaders[i].m_quantizedAabbMin[1];
-			memPtr->m_quantizedAabbMin[2] = m_SubtreeHeaders[i].m_quantizedAabbMin[2];
-
-			memPtr->m_rootNodeIndex = m_SubtreeHeaders[i].m_rootNodeIndex;
-			memPtr->m_subtreeSize = m_SubtreeHeaders[i].m_subtreeSize;
-		}
-		serializer->finalizeChunk(chunk,"btBvhSubtreeInfoData",BT_ARRAY_CODE,(void*)&m_SubtreeHeaders[0]);
-	}
-	return btQuantizedBvhDataName;
-}
-
-
-
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h
deleted file mode 100644
index bedb100..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h
+++ /dev/null
@@ -1,579 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_QUANTIZED_BVH_H
-#define BT_QUANTIZED_BVH_H
-
-class btSerializer;
-
-//#define DEBUG_CHECK_DEQUANTIZATION 1
-#ifdef DEBUG_CHECK_DEQUANTIZATION
-#ifdef __SPU__
-#define printf spu_printf
-#endif //__SPU__
-
-#include <stdio.h>
-#include <stdlib.h>
-#endif //DEBUG_CHECK_DEQUANTIZATION
-
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btAlignedAllocator.h"
-
-#ifdef BT_USE_DOUBLE_PRECISION
-#define btQuantizedBvhData btQuantizedBvhDoubleData
-#define btOptimizedBvhNodeData btOptimizedBvhNodeDoubleData
-#define btQuantizedBvhDataName "btQuantizedBvhDoubleData"
-#else
-#define btQuantizedBvhData btQuantizedBvhFloatData
-#define btOptimizedBvhNodeData btOptimizedBvhNodeFloatData
-#define btQuantizedBvhDataName "btQuantizedBvhFloatData"
-#endif
-
-
-
-//http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/vclrf__m128.asp
-
-
-//Note: currently we have 16 bytes per quantized node
-#define MAX_SUBTREE_SIZE_IN_BYTES  2048
-
-// 10 gives the potential for 1024 parts, with at most 2^21 (2097152) (minus one
-// actually) triangles each (since the sign bit is reserved
-#define MAX_NUM_PARTS_IN_BITS 10
-
-///btQuantizedBvhNode is a compressed aabb node, 16 bytes.
-///Node can be used for leafnode or internal node. Leafnodes can point to 32-bit triangle index (non-negative range).
-ATTRIBUTE_ALIGNED16	(struct) btQuantizedBvhNode
-{
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-
-	//12 bytes
-	unsigned short int	m_quantizedAabbMin[3];
-	unsigned short int	m_quantizedAabbMax[3];
-	//4 bytes
-	int	m_escapeIndexOrTriangleIndex;
-
-	bool isLeafNode() const
-	{
-		//skipindex is negative (internal node), triangleindex >=0 (leafnode)
-		return (m_escapeIndexOrTriangleIndex >= 0);
-	}
-	int getEscapeIndex() const
-	{
-		btAssert(!isLeafNode());
-		return -m_escapeIndexOrTriangleIndex;
-	}
-	int	getTriangleIndex() const
-	{
-		btAssert(isLeafNode());
-		// Get only the lower bits where the triangle index is stored
-		return (m_escapeIndexOrTriangleIndex&~((~0)<<(31-MAX_NUM_PARTS_IN_BITS)));
-	}
-	int	getPartId() const
-	{
-		btAssert(isLeafNode());
-		// Get only the highest bits where the part index is stored
-		return (m_escapeIndexOrTriangleIndex>>(31-MAX_NUM_PARTS_IN_BITS));
-	}
-}
-;
-
-/// btOptimizedBvhNode contains both internal and leaf node information.
-/// Total node size is 44 bytes / node. You can use the compressed version of 16 bytes.
-ATTRIBUTE_ALIGNED16 (struct) btOptimizedBvhNode
-{
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-
-	//32 bytes
-	btVector3	m_aabbMinOrg;
-	btVector3	m_aabbMaxOrg;
-
-	//4
-	int	m_escapeIndex;
-
-	//8
-	//for child nodes
-	int	m_subPart;
-	int	m_triangleIndex;
-	int	m_padding[5];//bad, due to alignment
-
-
-};
-
-
-///btBvhSubtreeInfo provides info to gather a subtree of limited size
-ATTRIBUTE_ALIGNED16(class) btBvhSubtreeInfo
-{
-public:
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-
-	//12 bytes
-	unsigned short int	m_quantizedAabbMin[3];
-	unsigned short int	m_quantizedAabbMax[3];
-	//4 bytes, points to the root of the subtree
-	int			m_rootNodeIndex;
-	//4 bytes
-	int			m_subtreeSize;
-	int			m_padding[3];
-
-	btBvhSubtreeInfo()
-	{
-		//memset(&m_padding[0], 0, sizeof(m_padding));
-	}
-
-
-	void	setAabbFromQuantizeNode(const btQuantizedBvhNode& quantizedNode)
-	{
-		m_quantizedAabbMin[0] = quantizedNode.m_quantizedAabbMin[0];
-		m_quantizedAabbMin[1] = quantizedNode.m_quantizedAabbMin[1];
-		m_quantizedAabbMin[2] = quantizedNode.m_quantizedAabbMin[2];
-		m_quantizedAabbMax[0] = quantizedNode.m_quantizedAabbMax[0];
-		m_quantizedAabbMax[1] = quantizedNode.m_quantizedAabbMax[1];
-		m_quantizedAabbMax[2] = quantizedNode.m_quantizedAabbMax[2];
-	}
-}
-;
-
-
-class btNodeOverlapCallback
-{
-public:
-	virtual ~btNodeOverlapCallback() {};
-
-	virtual void processNode(int subPart, int triangleIndex) = 0;
-};
-
-#include "LinearMath/btAlignedAllocator.h"
-#include "LinearMath/btAlignedObjectArray.h"
-
-
-
-///for code readability:
-typedef btAlignedObjectArray<btOptimizedBvhNode>	NodeArray;
-typedef btAlignedObjectArray<btQuantizedBvhNode>	QuantizedNodeArray;
-typedef btAlignedObjectArray<btBvhSubtreeInfo>		BvhSubtreeInfoArray;
-
-
-///The btQuantizedBvh class stores an AABB tree that can be quickly traversed on CPU and Cell SPU.
-///It is used by the btBvhTriangleMeshShape as midphase, and by the btMultiSapBroadphase.
-///It is recommended to use quantization for better performance and lower memory requirements.
-ATTRIBUTE_ALIGNED16(class) btQuantizedBvh
-{
-public:
-	enum btTraversalMode
-	{
-		TRAVERSAL_STACKLESS = 0,
-		TRAVERSAL_STACKLESS_CACHE_FRIENDLY,
-		TRAVERSAL_RECURSIVE
-	};
-
-protected:
-
-
-	btVector3			m_bvhAabbMin;
-	btVector3			m_bvhAabbMax;
-	btVector3			m_bvhQuantization;
-
-	int					m_bulletVersion;	//for serialization versioning. It could also be used to detect endianess.
-
-	int					m_curNodeIndex;
-	//quantization data
-	bool				m_useQuantization;
-
-
-
-	NodeArray			m_leafNodes;
-	NodeArray			m_contiguousNodes;
-	QuantizedNodeArray	m_quantizedLeafNodes;
-	QuantizedNodeArray	m_quantizedContiguousNodes;
-	
-	btTraversalMode	m_traversalMode;
-	BvhSubtreeInfoArray		m_SubtreeHeaders;
-
-	//This is only used for serialization so we don't have to add serialization directly to btAlignedObjectArray
-	mutable int m_subtreeHeaderCount;
-
-	
-
-
-
-	///two versions, one for quantized and normal nodes. This allows code-reuse while maintaining readability (no template/macro!)
-	///this might be refactored into a virtual, it is usually not calculated at run-time
-	void	setInternalNodeAabbMin(int nodeIndex, const btVector3& aabbMin)
-	{
-		if (m_useQuantization)
-		{
-			quantize(&m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0] ,aabbMin,0);
-		} else
-		{
-			m_contiguousNodes[nodeIndex].m_aabbMinOrg = aabbMin;
-
-		}
-	}
-	void	setInternalNodeAabbMax(int nodeIndex,const btVector3& aabbMax)
-	{
-		if (m_useQuantization)
-		{
-			quantize(&m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0],aabbMax,1);
-		} else
-		{
-			m_contiguousNodes[nodeIndex].m_aabbMaxOrg = aabbMax;
-		}
-	}
-
-	btVector3 getAabbMin(int nodeIndex) const
-	{
-		if (m_useQuantization)
-		{
-			return unQuantize(&m_quantizedLeafNodes[nodeIndex].m_quantizedAabbMin[0]);
-		}
-		//non-quantized
-		return m_leafNodes[nodeIndex].m_aabbMinOrg;
-
-	}
-	btVector3 getAabbMax(int nodeIndex) const
-	{
-		if (m_useQuantization)
-		{
-			return unQuantize(&m_quantizedLeafNodes[nodeIndex].m_quantizedAabbMax[0]);
-		} 
-		//non-quantized
-		return m_leafNodes[nodeIndex].m_aabbMaxOrg;
-		
-	}
-
-	
-	void	setInternalNodeEscapeIndex(int nodeIndex, int escapeIndex)
-	{
-		if (m_useQuantization)
-		{
-			m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex = -escapeIndex;
-		} 
-		else
-		{
-			m_contiguousNodes[nodeIndex].m_escapeIndex = escapeIndex;
-		}
-
-	}
-
-	void mergeInternalNodeAabb(int nodeIndex,const btVector3& newAabbMin,const btVector3& newAabbMax) 
-	{
-		if (m_useQuantization)
-		{
-			unsigned short int quantizedAabbMin[3];
-			unsigned short int quantizedAabbMax[3];
-			quantize(quantizedAabbMin,newAabbMin,0);
-			quantize(quantizedAabbMax,newAabbMax,1);
-			for (int i=0;i<3;i++)
-			{
-				if (m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[i] > quantizedAabbMin[i])
-					m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[i] = quantizedAabbMin[i];
-
-				if (m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[i] < quantizedAabbMax[i])
-					m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[i] = quantizedAabbMax[i];
-
-			}
-		} else
-		{
-			//non-quantized
-			m_contiguousNodes[nodeIndex].m_aabbMinOrg.setMin(newAabbMin);
-			m_contiguousNodes[nodeIndex].m_aabbMaxOrg.setMax(newAabbMax);		
-		}
-	}
-
-	void	swapLeafNodes(int firstIndex,int secondIndex);
-
-	void	assignInternalNodeFromLeafNode(int internalNode,int leafNodeIndex);
-
-protected:
-
-	
-
-	void	buildTree	(int startIndex,int endIndex);
-
-	int	calcSplittingAxis(int startIndex,int endIndex);
-
-	int	sortAndCalcSplittingIndex(int startIndex,int endIndex,int splitAxis);
-	
-	void	walkStacklessTree(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const;
-
-	void	walkStacklessQuantizedTreeAgainstRay(btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget, const btVector3& aabbMin, const btVector3& aabbMax, int startNodeIndex,int endNodeIndex) const;
-	void	walkStacklessQuantizedTree(btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax,int startNodeIndex,int endNodeIndex) const;
-	void	walkStacklessTreeAgainstRay(btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget, const btVector3& aabbMin, const btVector3& aabbMax, int startNodeIndex,int endNodeIndex) const;
-
-	///tree traversal designed for small-memory processors like PS3 SPU
-	void	walkStacklessQuantizedTreeCacheFriendly(btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax) const;
-
-	///use the 16-byte stackless 'skipindex' node tree to do a recursive traversal
-	void	walkRecursiveQuantizedTreeAgainstQueryAabb(const btQuantizedBvhNode* currentNode,btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax) const;
-
-	///use the 16-byte stackless 'skipindex' node tree to do a recursive traversal
-	void	walkRecursiveQuantizedTreeAgainstQuantizedTree(const btQuantizedBvhNode* treeNodeA,const btQuantizedBvhNode* treeNodeB,btNodeOverlapCallback* nodeCallback) const;
-	
-
-
-
-	void	updateSubtreeHeaders(int leftChildNodexIndex,int rightChildNodexIndex);
-
-public:
-	
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-
-	btQuantizedBvh();
-
-	virtual ~btQuantizedBvh();
-
-	
-	///***************************************** expert/internal use only *************************
-	void	setQuantizationValues(const btVector3& bvhAabbMin,const btVector3& bvhAabbMax,btScalar quantizationMargin=btScalar(1.0));
-	QuantizedNodeArray&	getLeafNodeArray() {			return	m_quantizedLeafNodes;	}
-	///buildInternal is expert use only: assumes that setQuantizationValues and LeafNodeArray are initialized
-	void	buildInternal();
-	///***************************************** expert/internal use only *************************
-
-	void	reportAabbOverlappingNodex(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const;
-	void	reportRayOverlappingNodex (btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget) const;
-	void	reportBoxCastOverlappingNodex(btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget, const btVector3& aabbMin,const btVector3& aabbMax) const;
-
-		SIMD_FORCE_INLINE void quantize(unsigned short* out, const btVector3& point,int isMax) const
-	{
-
-		btAssert(m_useQuantization);
-
-		btAssert(point.getX() <= m_bvhAabbMax.getX());
-		btAssert(point.getY() <= m_bvhAabbMax.getY());
-		btAssert(point.getZ() <= m_bvhAabbMax.getZ());
-
-		btAssert(point.getX() >= m_bvhAabbMin.getX());
-		btAssert(point.getY() >= m_bvhAabbMin.getY());
-		btAssert(point.getZ() >= m_bvhAabbMin.getZ());
-
-		btVector3 v = (point - m_bvhAabbMin) * m_bvhQuantization;
-		///Make sure rounding is done in a way that unQuantize(quantizeWithClamp(...)) is conservative
-		///end-points always set the first bit, so that they are sorted properly (so that neighbouring AABBs overlap properly)
-		///@todo: double-check this
-		if (isMax)
-		{
-			out[0] = (unsigned short) (((unsigned short)(v.getX()+btScalar(1.)) | 1));
-			out[1] = (unsigned short) (((unsigned short)(v.getY()+btScalar(1.)) | 1));
-			out[2] = (unsigned short) (((unsigned short)(v.getZ()+btScalar(1.)) | 1));
-		} else
-		{
-			out[0] = (unsigned short) (((unsigned short)(v.getX()) & 0xfffe));
-			out[1] = (unsigned short) (((unsigned short)(v.getY()) & 0xfffe));
-			out[2] = (unsigned short) (((unsigned short)(v.getZ()) & 0xfffe));
-		}
-
-
-#ifdef DEBUG_CHECK_DEQUANTIZATION
-		btVector3 newPoint = unQuantize(out);
-		if (isMax)
-		{
-			if (newPoint.getX() < point.getX())
-			{
-				printf("unconservative X, diffX = %f, oldX=%f,newX=%f\n",newPoint.getX()-point.getX(), newPoint.getX(),point.getX());
-			}
-			if (newPoint.getY() < point.getY())
-			{
-				printf("unconservative Y, diffY = %f, oldY=%f,newY=%f\n",newPoint.getY()-point.getY(), newPoint.getY(),point.getY());
-			}
-			if (newPoint.getZ() < point.getZ())
-			{
-
-				printf("unconservative Z, diffZ = %f, oldZ=%f,newZ=%f\n",newPoint.getZ()-point.getZ(), newPoint.getZ(),point.getZ());
-			}
-		} else
-		{
-			if (newPoint.getX() > point.getX())
-			{
-				printf("unconservative X, diffX = %f, oldX=%f,newX=%f\n",newPoint.getX()-point.getX(), newPoint.getX(),point.getX());
-			}
-			if (newPoint.getY() > point.getY())
-			{
-				printf("unconservative Y, diffY = %f, oldY=%f,newY=%f\n",newPoint.getY()-point.getY(), newPoint.getY(),point.getY());
-			}
-			if (newPoint.getZ() > point.getZ())
-			{
-				printf("unconservative Z, diffZ = %f, oldZ=%f,newZ=%f\n",newPoint.getZ()-point.getZ(), newPoint.getZ(),point.getZ());
-			}
-		}
-#endif //DEBUG_CHECK_DEQUANTIZATION
-
-	}
-
-
-	SIMD_FORCE_INLINE void quantizeWithClamp(unsigned short* out, const btVector3& point2,int isMax) const
-	{
-
-		btAssert(m_useQuantization);
-
-		btVector3 clampedPoint(point2);
-		clampedPoint.setMax(m_bvhAabbMin);
-		clampedPoint.setMin(m_bvhAabbMax);
-
-		quantize(out,clampedPoint,isMax);
-
-	}
-	
-	SIMD_FORCE_INLINE btVector3	unQuantize(const unsigned short* vecIn) const
-	{
-			btVector3	vecOut;
-			vecOut.setValue(
-			(btScalar)(vecIn[0]) / (m_bvhQuantization.getX()),
-			(btScalar)(vecIn[1]) / (m_bvhQuantization.getY()),
-			(btScalar)(vecIn[2]) / (m_bvhQuantization.getZ()));
-			vecOut += m_bvhAabbMin;
-			return vecOut;
-	}
-
-	///setTraversalMode let's you choose between stackless, recursive or stackless cache friendly tree traversal. Note this is only implemented for quantized trees.
-	void	setTraversalMode(btTraversalMode	traversalMode)
-	{
-		m_traversalMode = traversalMode;
-	}
-
-
-	SIMD_FORCE_INLINE QuantizedNodeArray&	getQuantizedNodeArray()
-	{	
-		return	m_quantizedContiguousNodes;
-	}
-
-
-	SIMD_FORCE_INLINE BvhSubtreeInfoArray&	getSubtreeInfoArray()
-	{
-		return m_SubtreeHeaders;
-	}
-
-////////////////////////////////////////////////////////////////////
-
-	/////Calculate space needed to store BVH for serialization
-	unsigned calculateSerializeBufferSize() const;
-
-	/// Data buffer MUST be 16 byte aligned
-	virtual bool serialize(void *o_alignedDataBuffer, unsigned i_dataBufferSize, bool i_swapEndian) const;
-
-	///deSerializeInPlace loads and initializes a BVH from a buffer in memory 'in place'
-	static btQuantizedBvh *deSerializeInPlace(void *i_alignedDataBuffer, unsigned int i_dataBufferSize, bool i_swapEndian);
-
-	static unsigned int getAlignmentSerializationPadding();
-//////////////////////////////////////////////////////////////////////
-
-	
-	virtual	int	calculateSerializeBufferSizeNew() const;
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
-
-	virtual	void deSerializeFloat(struct btQuantizedBvhFloatData& quantizedBvhFloatData);
-
-	virtual	void deSerializeDouble(struct btQuantizedBvhDoubleData& quantizedBvhDoubleData);
-
-
-////////////////////////////////////////////////////////////////////
-
-	SIMD_FORCE_INLINE bool isQuantized()
-	{
-		return m_useQuantization;
-	}
-
-private:
-	// Special "copy" constructor that allows for in-place deserialization
-	// Prevents btVector3's default constructor from being called, but doesn't inialize much else
-	// ownsMemory should most likely be false if deserializing, and if you are not, don't call this (it also changes the function signature, which we need)
-	btQuantizedBvh(btQuantizedBvh &other, bool ownsMemory);
-
-}
-;
-
-
-struct	btBvhSubtreeInfoData
-{
-	int			m_rootNodeIndex;
-	int			m_subtreeSize;
-	unsigned short m_quantizedAabbMin[3];
-	unsigned short m_quantizedAabbMax[3];
-};
-
-struct btOptimizedBvhNodeFloatData
-{
-	btVector3FloatData	m_aabbMinOrg;
-	btVector3FloatData	m_aabbMaxOrg;
-	int	m_escapeIndex;
-	int	m_subPart;
-	int	m_triangleIndex;
-	char m_pad[4];
-};
-
-struct btOptimizedBvhNodeDoubleData
-{
-	btVector3DoubleData	m_aabbMinOrg;
-	btVector3DoubleData	m_aabbMaxOrg;
-	int	m_escapeIndex;
-	int	m_subPart;
-	int	m_triangleIndex;
-	char	m_pad[4];
-};
-
-
-struct btQuantizedBvhNodeData
-{
-	unsigned short m_quantizedAabbMin[3];
-	unsigned short m_quantizedAabbMax[3];
-	int	m_escapeIndexOrTriangleIndex;
-};
-
-struct	btQuantizedBvhFloatData
-{
-	btVector3FloatData			m_bvhAabbMin;
-	btVector3FloatData			m_bvhAabbMax;
-	btVector3FloatData			m_bvhQuantization;
-	int					m_curNodeIndex;
-	int					m_useQuantization;
-	int					m_numContiguousLeafNodes;
-	int					m_numQuantizedContiguousNodes;
-	btOptimizedBvhNodeFloatData	*m_contiguousNodesPtr;
-	btQuantizedBvhNodeData		*m_quantizedContiguousNodesPtr;
-	btBvhSubtreeInfoData	*m_subTreeInfoPtr;
-	int					m_traversalMode;
-	int					m_numSubtreeHeaders;
-	
-};
-
-struct	btQuantizedBvhDoubleData
-{
-	btVector3DoubleData			m_bvhAabbMin;
-	btVector3DoubleData			m_bvhAabbMax;
-	btVector3DoubleData			m_bvhQuantization;
-	int							m_curNodeIndex;
-	int							m_useQuantization;
-	int							m_numContiguousLeafNodes;
-	int							m_numQuantizedContiguousNodes;
-	btOptimizedBvhNodeDoubleData	*m_contiguousNodesPtr;
-	btQuantizedBvhNodeData			*m_quantizedContiguousNodesPtr;
-
-	int							m_traversalMode;
-	int							m_numSubtreeHeaders;
-	btBvhSubtreeInfoData		*m_subTreeInfoPtr;
-};
-
-
-SIMD_FORCE_INLINE	int	btQuantizedBvh::calculateSerializeBufferSizeNew() const
-{
-	return sizeof(btQuantizedBvhData);
-}
-
-
-
-#endif //BT_QUANTIZED_BVH_H
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp
deleted file mode 100644
index 752fcd0..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btSimpleBroadphase.h"
-#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
-#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
-
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btTransform.h"
-#include "LinearMath/btMatrix3x3.h"
-#include "LinearMath/btAabbUtil2.h"
-
-#include <new>
-
-extern int gOverlappingPairs;
-
-void	btSimpleBroadphase::validate()
-{
-	for (int i=0;i<m_numHandles;i++)
-	{
-		for (int j=i+1;j<m_numHandles;j++)
-		{
-			btAssert(&m_pHandles[i] != &m_pHandles[j]);
-		}
-	}
-	
-}
-
-btSimpleBroadphase::btSimpleBroadphase(int maxProxies, btOverlappingPairCache* overlappingPairCache)
-	:m_pairCache(overlappingPairCache),
-	m_ownsPairCache(false),
-	m_invalidPair(0)
-{
-
-	if (!overlappingPairCache)
-	{
-		void* mem = btAlignedAlloc(sizeof(btHashedOverlappingPairCache),16);
-		m_pairCache = new (mem)btHashedOverlappingPairCache();
-		m_ownsPairCache = true;
-	}
-
-	// allocate handles buffer and put all handles on free list
-	m_pHandlesRawPtr = btAlignedAlloc(sizeof(btSimpleBroadphaseProxy)*maxProxies,16);
-	m_pHandles = new(m_pHandlesRawPtr) btSimpleBroadphaseProxy[maxProxies];
-	m_maxHandles = maxProxies;
-	m_numHandles = 0;
-	m_firstFreeHandle = 0;
-	m_LastHandleIndex = -1;
-	
-
-	{
-		for (int i = m_firstFreeHandle; i < maxProxies; i++)
-		{
-			m_pHandles[i].SetNextFree(i + 1);
-			m_pHandles[i].m_uniqueId = i+2;//any UID will do, we just avoid too trivial values (0,1) for debugging purposes
-		}
-		m_pHandles[maxProxies - 1].SetNextFree(0);
-	
-	}
-
-}
-
-btSimpleBroadphase::~btSimpleBroadphase()
-{
-	btAlignedFree(m_pHandlesRawPtr);
-
-	if (m_ownsPairCache)
-	{
-		m_pairCache->~btOverlappingPairCache();
-		btAlignedFree(m_pairCache);
-	}
-}
-
-
-btBroadphaseProxy*	btSimpleBroadphase::createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* /*dispatcher*/,void* multiSapProxy)
-{
-	if (m_numHandles >= m_maxHandles)
-	{
-		btAssert(0);
-		return 0; //should never happen, but don't let the game crash ;-)
-	}
-	btAssert(aabbMin[0]<= aabbMax[0] && aabbMin[1]<= aabbMax[1] && aabbMin[2]<= aabbMax[2]);
-
-	int newHandleIndex = allocHandle();
-	btSimpleBroadphaseProxy* proxy = new (&m_pHandles[newHandleIndex])btSimpleBroadphaseProxy(aabbMin,aabbMax,shapeType,userPtr,collisionFilterGroup,collisionFilterMask,multiSapProxy);
-
-	return proxy;
-}
-
-class	RemovingOverlapCallback : public btOverlapCallback
-{
-protected:
-	virtual bool	processOverlap(btBroadphasePair& pair)
-	{
-		(void)pair;
-		btAssert(0);
-		return false;
-	}
-};
-
-class RemovePairContainingProxy
-{
-
-	btBroadphaseProxy*	m_targetProxy;
-	public:
-	virtual ~RemovePairContainingProxy()
-	{
-	}
-protected:
-	virtual bool processOverlap(btBroadphasePair& pair)
-	{
-		btSimpleBroadphaseProxy* proxy0 = static_cast<btSimpleBroadphaseProxy*>(pair.m_pProxy0);
-		btSimpleBroadphaseProxy* proxy1 = static_cast<btSimpleBroadphaseProxy*>(pair.m_pProxy1);
-
-		return ((m_targetProxy == proxy0 || m_targetProxy == proxy1));
-	};
-};
-
-void	btSimpleBroadphase::destroyProxy(btBroadphaseProxy* proxyOrg,btDispatcher* dispatcher)
-{
-		
-		btSimpleBroadphaseProxy* proxy0 = static_cast<btSimpleBroadphaseProxy*>(proxyOrg);
-		freeHandle(proxy0);
-
-		m_pairCache->removeOverlappingPairsContainingProxy(proxyOrg,dispatcher);
-
-		//validate();
-		
-}
-
-void	btSimpleBroadphase::getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const
-{
-	const btSimpleBroadphaseProxy* sbp = getSimpleProxyFromProxy(proxy);
-	aabbMin = sbp->m_aabbMin;
-	aabbMax = sbp->m_aabbMax;
-}
-
-void	btSimpleBroadphase::setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* /*dispatcher*/)
-{
-	btSimpleBroadphaseProxy* sbp = getSimpleProxyFromProxy(proxy);
-	sbp->m_aabbMin = aabbMin;
-	sbp->m_aabbMax = aabbMax;
-}
-
-void	btSimpleBroadphase::rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin,const btVector3& aabbMax)
-{
-	for (int i=0; i <= m_LastHandleIndex; i++)
-	{
-		btSimpleBroadphaseProxy* proxy = &m_pHandles[i];
-		if(!proxy->m_clientObject)
-		{
-			continue;
-		}
-		rayCallback.process(proxy);
-	}
-}
-
-
-void	btSimpleBroadphase::aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback)
-{
-	for (int i=0; i <= m_LastHandleIndex; i++)
-	{
-		btSimpleBroadphaseProxy* proxy = &m_pHandles[i];
-		if(!proxy->m_clientObject)
-		{
-			continue;
-		}
-		if (TestAabbAgainstAabb2(aabbMin,aabbMax,proxy->m_aabbMin,proxy->m_aabbMax))
-		{
-			callback.process(proxy);
-		}
-	}
-}
-
-
-
-	
-
-
-
-bool	btSimpleBroadphase::aabbOverlap(btSimpleBroadphaseProxy* proxy0,btSimpleBroadphaseProxy* proxy1)
-{
-	return proxy0->m_aabbMin[0] <= proxy1->m_aabbMax[0] && proxy1->m_aabbMin[0] <= proxy0->m_aabbMax[0] && 
-		   proxy0->m_aabbMin[1] <= proxy1->m_aabbMax[1] && proxy1->m_aabbMin[1] <= proxy0->m_aabbMax[1] &&
-		   proxy0->m_aabbMin[2] <= proxy1->m_aabbMax[2] && proxy1->m_aabbMin[2] <= proxy0->m_aabbMax[2];
-
-}
-
-
-
-//then remove non-overlapping ones
-class CheckOverlapCallback : public btOverlapCallback
-{
-public:
-	virtual bool processOverlap(btBroadphasePair& pair)
-	{
-		return (!btSimpleBroadphase::aabbOverlap(static_cast<btSimpleBroadphaseProxy*>(pair.m_pProxy0),static_cast<btSimpleBroadphaseProxy*>(pair.m_pProxy1)));
-	}
-};
-
-void	btSimpleBroadphase::calculateOverlappingPairs(btDispatcher* dispatcher)
-{
-	//first check for new overlapping pairs
-	int i,j;
-	if (m_numHandles >= 0)
-	{
-		int new_largest_index = -1;
-		for (i=0; i <= m_LastHandleIndex; i++)
-		{
-			btSimpleBroadphaseProxy* proxy0 = &m_pHandles[i];
-			if(!proxy0->m_clientObject)
-			{
-				continue;
-			}
-			new_largest_index = i;
-			for (j=i+1; j <= m_LastHandleIndex; j++)
-			{
-				btSimpleBroadphaseProxy* proxy1 = &m_pHandles[j];
-				btAssert(proxy0 != proxy1);
-				if(!proxy1->m_clientObject)
-				{
-					continue;
-				}
-
-				btSimpleBroadphaseProxy* p0 = getSimpleProxyFromProxy(proxy0);
-				btSimpleBroadphaseProxy* p1 = getSimpleProxyFromProxy(proxy1);
-
-				if (aabbOverlap(p0,p1))
-				{
-					if ( !m_pairCache->findPair(proxy0,proxy1))
-					{
-						m_pairCache->addOverlappingPair(proxy0,proxy1);
-					}
-				} else
-				{
-					if (!m_pairCache->hasDeferredRemoval())
-					{
-						if ( m_pairCache->findPair(proxy0,proxy1))
-						{
-							m_pairCache->removeOverlappingPair(proxy0,proxy1,dispatcher);
-						}
-					}
-				}
-			}
-		}
-
-		m_LastHandleIndex = new_largest_index;
-
-		if (m_ownsPairCache && m_pairCache->hasDeferredRemoval())
-		{
-
-			btBroadphasePairArray&	overlappingPairArray = m_pairCache->getOverlappingPairArray();
-
-			//perform a sort, to find duplicates and to sort 'invalid' pairs to the end
-			overlappingPairArray.quickSort(btBroadphasePairSortPredicate());
-
-			overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair);
-			m_invalidPair = 0;
-
-
-			btBroadphasePair previousPair;
-			previousPair.m_pProxy0 = 0;
-			previousPair.m_pProxy1 = 0;
-			previousPair.m_algorithm = 0;
-
-
-			for (i=0;i<overlappingPairArray.size();i++)
-			{
-
-				btBroadphasePair& pair = overlappingPairArray[i];
-
-				bool isDuplicate = (pair == previousPair);
-
-				previousPair = pair;
-
-				bool needsRemoval = false;
-
-				if (!isDuplicate)
-				{
-					bool hasOverlap = testAabbOverlap(pair.m_pProxy0,pair.m_pProxy1);
-
-					if (hasOverlap)
-					{
-						needsRemoval = false;//callback->processOverlap(pair);
-					} else
-					{
-						needsRemoval = true;
-					}
-				} else
-				{
-					//remove duplicate
-					needsRemoval = true;
-					//should have no algorithm
-					btAssert(!pair.m_algorithm);
-				}
-
-				if (needsRemoval)
-				{
-					m_pairCache->cleanOverlappingPair(pair,dispatcher);
-
-					//		m_overlappingPairArray.swap(i,m_overlappingPairArray.size()-1);
-					//		m_overlappingPairArray.pop_back();
-					pair.m_pProxy0 = 0;
-					pair.m_pProxy1 = 0;
-					m_invalidPair++;
-					gOverlappingPairs--;
-				} 
-
-			}
-
-			///if you don't like to skip the invalid pairs in the array, execute following code:
-#define CLEAN_INVALID_PAIRS 1
-#ifdef CLEAN_INVALID_PAIRS
-
-			//perform a sort, to sort 'invalid' pairs to the end
-			overlappingPairArray.quickSort(btBroadphasePairSortPredicate());
-
-			overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair);
-			m_invalidPair = 0;
-#endif//CLEAN_INVALID_PAIRS
-
-		}
-	}
-}
-
-
-bool btSimpleBroadphase::testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1)
-{
-	btSimpleBroadphaseProxy* p0 = getSimpleProxyFromProxy(proxy0);
-	btSimpleBroadphaseProxy* p1 = getSimpleProxyFromProxy(proxy1);
-	return aabbOverlap(p0,p1);
-}
-
-void	btSimpleBroadphase::resetPool(btDispatcher* dispatcher)
-{
-	//not yet
-}
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h
deleted file mode 100644
index 7cb3c40..0000000
--- a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_SIMPLE_BROADPHASE_H
-#define BT_SIMPLE_BROADPHASE_H
-
-
-#include "btOverlappingPairCache.h"
-
-
-struct btSimpleBroadphaseProxy : public btBroadphaseProxy
-{
-	int			m_nextFree;
-	
-//	int			m_handleId;
-
-	
-	btSimpleBroadphaseProxy() {};
-
-	btSimpleBroadphaseProxy(const btVector3& minpt,const btVector3& maxpt,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask,void* multiSapProxy)
-	:btBroadphaseProxy(minpt,maxpt,userPtr,collisionFilterGroup,collisionFilterMask,multiSapProxy)
-	{
-		(void)shapeType;
-	}
-	
-	
-	SIMD_FORCE_INLINE void SetNextFree(int next) {m_nextFree = next;}
-	SIMD_FORCE_INLINE int GetNextFree() const {return m_nextFree;}
-
-	
-
-
-};
-
-///The SimpleBroadphase is just a unit-test for btAxisSweep3, bt32BitAxisSweep3, or btDbvtBroadphase, so use those classes instead.
-///It is a brute force aabb culling broadphase based on O(n^2) aabb checks
-class btSimpleBroadphase : public btBroadphaseInterface
-{
-
-protected:
-
-	int		m_numHandles;						// number of active handles
-	int		m_maxHandles;						// max number of handles
-	int		m_LastHandleIndex;							
-	
-	btSimpleBroadphaseProxy* m_pHandles;						// handles pool
-
-	void* m_pHandlesRawPtr;
-	int		m_firstFreeHandle;		// free handles list
-	
-	int allocHandle()
-	{
-		btAssert(m_numHandles < m_maxHandles);
-		int freeHandle = m_firstFreeHandle;
-		m_firstFreeHandle = m_pHandles[freeHandle].GetNextFree();
-		m_numHandles++;
-		if(freeHandle > m_LastHandleIndex)
-		{
-			m_LastHandleIndex = freeHandle;
-		}
-		return freeHandle;
-	}
-
-	void freeHandle(btSimpleBroadphaseProxy* proxy)
-	{
-		int handle = int(proxy-m_pHandles);
-		btAssert(handle >= 0 && handle < m_maxHandles);
-		if(handle == m_LastHandleIndex)
-		{
-			m_LastHandleIndex--;
-		}
-		proxy->SetNextFree(m_firstFreeHandle);
-		m_firstFreeHandle = handle;
-
-		proxy->m_clientObject = 0;
-
-		m_numHandles--;
-	}
-
-	btOverlappingPairCache*	m_pairCache;
-	bool	m_ownsPairCache;
-
-	int	m_invalidPair;
-
-	
-	
-	inline btSimpleBroadphaseProxy*	getSimpleProxyFromProxy(btBroadphaseProxy* proxy)
-	{
-		btSimpleBroadphaseProxy* proxy0 = static_cast<btSimpleBroadphaseProxy*>(proxy);
-		return proxy0;
-	}
-
-	inline const btSimpleBroadphaseProxy*	getSimpleProxyFromProxy(btBroadphaseProxy* proxy) const
-	{
-		const btSimpleBroadphaseProxy* proxy0 = static_cast<const btSimpleBroadphaseProxy*>(proxy);
-		return proxy0;
-	}
-
-	///reset broadphase internal structures, to ensure determinism/reproducability
-	virtual void resetPool(btDispatcher* dispatcher);
-
-
-	void	validate();
-
-protected:
-
-
-	
-
-public:
-	btSimpleBroadphase(int maxProxies=16384,btOverlappingPairCache* overlappingPairCache=0);
-	virtual ~btSimpleBroadphase();
-
-
-		static bool	aabbOverlap(btSimpleBroadphaseProxy* proxy0,btSimpleBroadphaseProxy* proxy1);
-
-
-	virtual btBroadphaseProxy*	createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher,void* multiSapProxy);
-
-	virtual void	calculateOverlappingPairs(btDispatcher* dispatcher);
-
-	virtual void	destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
-	virtual void	setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher);
-	virtual void	getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;
-
-	virtual void	rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0),const btVector3& aabbMax=btVector3(0,0,0));
-	virtual void	aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback);
-		
-	btOverlappingPairCache*	getOverlappingPairCache()
-	{
-		return m_pairCache;
-	}
-	const btOverlappingPairCache*	getOverlappingPairCache() const
-	{
-		return m_pairCache;
-	}
-
-	bool	testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);
-
-
-	///getAabb returns the axis aligned bounding box in the 'global' coordinate frame
-	///will add some transform later
-	virtual void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const
-	{
-		aabbMin.setValue(-BT_LARGE_FLOAT,-BT_LARGE_FLOAT,-BT_LARGE_FLOAT);
-		aabbMax.setValue(BT_LARGE_FLOAT,BT_LARGE_FLOAT,BT_LARGE_FLOAT);
-	}
-
-	virtual void	printStats()
-	{
-//		printf("btSimpleBroadphase.h\n");
-//		printf("numHandles = %d, maxHandles = %d\n",m_numHandles,m_maxHandles);
-	}
-};
-
-
-
-#endif //BT_SIMPLE_BROADPHASE_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp
deleted file mode 100644
index 23a5c75..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "LinearMath/btScalar.h"
-#include "SphereTriangleDetector.h"
-#include "BulletCollision/CollisionShapes/btTriangleShape.h"
-#include "BulletCollision/CollisionShapes/btSphereShape.h"
-
-
-SphereTriangleDetector::SphereTriangleDetector(btSphereShape* sphere,btTriangleShape* triangle,btScalar contactBreakingThreshold)
-:m_sphere(sphere),
-m_triangle(triangle),
-m_contactBreakingThreshold(contactBreakingThreshold)
-{
-
-}
-
-void	SphereTriangleDetector::getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw,bool swapResults)
-{
-
-	(void)debugDraw;
-	const btTransform& transformA = input.m_transformA;
-	const btTransform& transformB = input.m_transformB;
-
-	btVector3 point,normal;
-	btScalar timeOfImpact = btScalar(1.);
-	btScalar depth = btScalar(0.);
-//	output.m_distance = btScalar(BT_LARGE_FLOAT);
-	//move sphere into triangle space
-	btTransform	sphereInTr = transformB.inverseTimes(transformA);
-
-	if (collide(sphereInTr.getOrigin(),point,normal,depth,timeOfImpact,m_contactBreakingThreshold))
-	{
-		if (swapResults)
-		{
-			btVector3 normalOnB = transformB.getBasis()*normal;
-			btVector3 normalOnA = -normalOnB;
-			btVector3 pointOnA = transformB*point+normalOnB*depth;
-			output.addContactPoint(normalOnA,pointOnA,depth);
-		} else
-		{
-			output.addContactPoint(transformB.getBasis()*normal,transformB*point,depth);
-		}
-	}
-
-}
-
-
-
-// See also geometrictools.com
-// Basic idea: D = |p - (lo + t0*lv)| where t0 = lv . (p - lo) / lv . lv
-btScalar SegmentSqrDistance(const btVector3& from, const btVector3& to,const btVector3 &p, btVector3 &nearest);
-
-btScalar SegmentSqrDistance(const btVector3& from, const btVector3& to,const btVector3 &p, btVector3 &nearest) {
-	btVector3 diff = p - from;
-	btVector3 v = to - from;
-	btScalar t = v.dot(diff);
-	
-	if (t > 0) {
-		btScalar dotVV = v.dot(v);
-		if (t < dotVV) {
-			t /= dotVV;
-			diff -= t*v;
-		} else {
-			t = 1;
-			diff -= v;
-		}
-	} else
-		t = 0;
-
-	nearest = from + t*v;
-	return diff.dot(diff);	
-}
-
-bool SphereTriangleDetector::facecontains(const btVector3 &p,const btVector3* vertices,btVector3& normal)  {
-	btVector3 lp(p);
-	btVector3 lnormal(normal);
-	
-	return pointInTriangle(vertices, lnormal, &lp);
-}
-
-bool SphereTriangleDetector::collide(const btVector3& sphereCenter,btVector3 &point, btVector3& resultNormal, btScalar& depth, btScalar &timeOfImpact, btScalar contactBreakingThreshold)
-{
-
-	const btVector3* vertices = &m_triangle->getVertexPtr(0);
-	
-	btScalar radius = m_sphere->getRadius();
-	btScalar radiusWithThreshold = radius + contactBreakingThreshold;
-
-	btVector3 normal = (vertices[1]-vertices[0]).cross(vertices[2]-vertices[0]);
-	normal.normalize();
-	btVector3 p1ToCentre = sphereCenter - vertices[0];
-	btScalar distanceFromPlane = p1ToCentre.dot(normal);
-
-	if (distanceFromPlane < btScalar(0.))
-	{
-		//triangle facing the other way
-		distanceFromPlane *= btScalar(-1.);
-		normal *= btScalar(-1.);
-	}
-
-	bool isInsideContactPlane = distanceFromPlane < radiusWithThreshold;
-	
-	// Check for contact / intersection
-	bool hasContact = false;
-	btVector3 contactPoint;
-	if (isInsideContactPlane) {
-		if (facecontains(sphereCenter,vertices,normal)) {
-			// Inside the contact wedge - touches a point on the shell plane
-			hasContact = true;
-			contactPoint = sphereCenter - normal*distanceFromPlane;
-		} else {
-			// Could be inside one of the contact capsules
-			btScalar contactCapsuleRadiusSqr = radiusWithThreshold*radiusWithThreshold;
-			btVector3 nearestOnEdge;
-			for (int i = 0; i < m_triangle->getNumEdges(); i++) {
-				
-				btVector3 pa;
-				btVector3 pb;
-				
-				m_triangle->getEdge(i,pa,pb);
-
-				btScalar distanceSqr = SegmentSqrDistance(pa,pb,sphereCenter, nearestOnEdge);
-				if (distanceSqr < contactCapsuleRadiusSqr) {
-					// Yep, we're inside a capsule
-					hasContact = true;
-					contactPoint = nearestOnEdge;
-				}
-				
-			}
-		}
-	}
-
-	if (hasContact) {
-		btVector3 contactToCentre = sphereCenter - contactPoint;
-		btScalar distanceSqr = contactToCentre.length2();
-
-		if (distanceSqr < radiusWithThreshold*radiusWithThreshold)
-		{
-			if (distanceSqr>SIMD_EPSILON)
-			{
-				btScalar distance = btSqrt(distanceSqr);
-				resultNormal = contactToCentre;
-				resultNormal.normalize();
-				point = contactPoint;
-				depth = -(radius-distance);
-			} else
-			{
-				btScalar distance = 0.f;
-				resultNormal = normal;
-				point = contactPoint;
-				depth = -radius;
-			}
-			return true;
-		}
-	}
-	
-	return false;
-}
-
-
-bool SphereTriangleDetector::pointInTriangle(const btVector3 vertices[], const btVector3 &normal, btVector3 *p )
-{
-	const btVector3* p1 = &vertices[0];
-	const btVector3* p2 = &vertices[1];
-	const btVector3* p3 = &vertices[2];
-
-	btVector3 edge1( *p2 - *p1 );
-	btVector3 edge2( *p3 - *p2 );
-	btVector3 edge3( *p1 - *p3 );
-
-	btVector3 p1_to_p( *p - *p1 );
-	btVector3 p2_to_p( *p - *p2 );
-	btVector3 p3_to_p( *p - *p3 );
-
-	btVector3 edge1_normal( edge1.cross(normal));
-	btVector3 edge2_normal( edge2.cross(normal));
-	btVector3 edge3_normal( edge3.cross(normal));
-	
-	btScalar r1, r2, r3;
-	r1 = edge1_normal.dot( p1_to_p );
-	r2 = edge2_normal.dot( p2_to_p );
-	r3 = edge3_normal.dot( p3_to_p );
-	if ( ( r1 > 0 && r2 > 0 && r3 > 0 ) ||
-	     ( r1 <= 0 && r2 <= 0 && r3 <= 0 ) )
-		return true;
-	return false;
-
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.h
deleted file mode 100644
index 22953af..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_SPHERE_TRIANGLE_DETECTOR_H
-#define BT_SPHERE_TRIANGLE_DETECTOR_H
-
-#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"
-
-
-
-class btSphereShape;
-class btTriangleShape;
-
-
-
-/// sphere-triangle to match the btDiscreteCollisionDetectorInterface
-struct SphereTriangleDetector : public btDiscreteCollisionDetectorInterface
-{
-	virtual void	getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw,bool swapResults=false);
-
-	SphereTriangleDetector(btSphereShape* sphere,btTriangleShape* triangle, btScalar contactBreakingThreshold);
-
-	virtual ~SphereTriangleDetector() {};
-
-	bool collide(const btVector3& sphereCenter,btVector3 &point, btVector3& resultNormal, btScalar& depth, btScalar &timeOfImpact, btScalar	contactBreakingThreshold);
-
-private:
-
-	
-	bool pointInTriangle(const btVector3 vertices[], const btVector3 &normal, btVector3 *p );
-	bool facecontains(const btVector3 &p,const btVector3* vertices,btVector3& normal);
-
-	btSphereShape* m_sphere;
-	btTriangleShape* m_triangle;
-	btScalar	m_contactBreakingThreshold;
-	
-};
-#endif //BT_SPHERE_TRIANGLE_DETECTOR_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp
deleted file mode 100644
index 7e5da6c..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2008 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btActivatingCollisionAlgorithm.h"
-#include "btCollisionDispatcher.h"
-#include "btCollisionObject.h"
-
-btActivatingCollisionAlgorithm::btActivatingCollisionAlgorithm (const btCollisionAlgorithmConstructionInfo& ci)
-:btCollisionAlgorithm(ci)
-//,
-//m_colObj0(0),
-//m_colObj1(0)
-{
-}
-btActivatingCollisionAlgorithm::btActivatingCollisionAlgorithm (const btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* colObj0,btCollisionObject* colObj1)
-:btCollisionAlgorithm(ci)
-//,
-//m_colObj0(0),
-//m_colObj1(0)
-{
-//	if (ci.m_dispatcher1->needsCollision(colObj0,colObj1))
-//	{
-//		m_colObj0 = colObj0;
-//		m_colObj1 = colObj1;
-//		
-//		m_colObj0->activate();
-//		m_colObj1->activate();
-//	}
-}
-
-btActivatingCollisionAlgorithm::~btActivatingCollisionAlgorithm()
-{
-//		m_colObj0->activate();
-//		m_colObj1->activate();
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h
deleted file mode 100644
index 25fe088..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2008 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef __BT_ACTIVATING_COLLISION_ALGORITHM_H
-#define __BT_ACTIVATING_COLLISION_ALGORITHM_H
-
-#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
-
-///This class is not enabled yet (work-in-progress) to more aggressively activate objects.
-class btActivatingCollisionAlgorithm : public btCollisionAlgorithm
-{
-//	btCollisionObject* m_colObj0;
-//	btCollisionObject* m_colObj1;
-
-public:
-
-	btActivatingCollisionAlgorithm (const btCollisionAlgorithmConstructionInfo& ci);
-
-	btActivatingCollisionAlgorithm (const btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* colObj0,btCollisionObject* colObj1);
-
-	virtual ~btActivatingCollisionAlgorithm();
-
-};
-#endif //__BT_ACTIVATING_COLLISION_ALGORITHM_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp
deleted file mode 100644
index 2182d0d..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp
+++ /dev/null
@@ -1,435 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-* The b2CollidePolygons routines are Copyright (c) 2006-2007 Erin Catto http://www.gphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-///btBox2dBox2dCollisionAlgorithm, with modified b2CollidePolygons routines from the Box2D library.
-///The modifications include: switching from b2Vec to btVector3, redefinition of b2Dot, b2Cross
-
-#include "btBox2dBox2dCollisionAlgorithm.h"
-#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
-#include "BulletCollision/CollisionShapes/btBoxShape.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-#include "BulletCollision/CollisionDispatch/btBoxBoxDetector.h"
-#include "BulletCollision/CollisionShapes/btBox2dShape.h"
-
-#define USE_PERSISTENT_CONTACTS 1
-
-btBox2dBox2dCollisionAlgorithm::btBox2dBox2dCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* obj0,btCollisionObject* obj1)
-: btActivatingCollisionAlgorithm(ci,obj0,obj1),
-m_ownManifold(false),
-m_manifoldPtr(mf)
-{
-	if (!m_manifoldPtr && m_dispatcher->needsCollision(obj0,obj1))
-	{
-		m_manifoldPtr = m_dispatcher->getNewManifold(obj0,obj1);
-		m_ownManifold = true;
-	}
-}
-
-btBox2dBox2dCollisionAlgorithm::~btBox2dBox2dCollisionAlgorithm()
-{
-	
-	if (m_ownManifold)
-	{
-		if (m_manifoldPtr)
-			m_dispatcher->releaseManifold(m_manifoldPtr);
-	}
-	
-}
-
-
-void b2CollidePolygons(btManifoldResult* manifold,  const btBox2dShape* polyA, const btTransform& xfA, const btBox2dShape* polyB, const btTransform& xfB);
-
-//#include <stdio.h>
-void btBox2dBox2dCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-	if (!m_manifoldPtr)
-		return;
-
-	btCollisionObject*	col0 = body0;
-	btCollisionObject*	col1 = body1;
-	btBox2dShape* box0 = (btBox2dShape*)col0->getCollisionShape();
-	btBox2dShape* box1 = (btBox2dShape*)col1->getCollisionShape();
-
-	resultOut->setPersistentManifold(m_manifoldPtr);
-
-	b2CollidePolygons(resultOut,box0,col0->getWorldTransform(),box1,col1->getWorldTransform());
-
-	//  refreshContactPoints is only necessary when using persistent contact points. otherwise all points are newly added
-	if (m_ownManifold)
-	{
-		resultOut->refreshContactPoints();
-	}
-
-}
-
-btScalar btBox2dBox2dCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* /*body0*/,btCollisionObject* /*body1*/,const btDispatcherInfo& /*dispatchInfo*/,btManifoldResult* /*resultOut*/)
-{
-	//not yet
-	return 1.f;
-}
-
-
-struct ClipVertex
-{
-	btVector3 v;
-	int id;
-	//b2ContactID id;
-	//b2ContactID id;
-};
-
-#define b2Dot(a,b) (a).dot(b)
-#define b2Mul(a,b) (a)*(b)
-#define b2MulT(a,b) (a).transpose()*(b)
-#define b2Cross(a,b) (a).cross(b)
-#define btCrossS(a,s) btVector3(s * a.getY(), -s * a.getX(),0.f)
-
-int b2_maxManifoldPoints =2;
-
-static int ClipSegmentToLine(ClipVertex vOut[2], ClipVertex vIn[2],
-					  const btVector3& normal, btScalar offset)
-{
-	// Start with no output points
-	int numOut = 0;
-
-	// Calculate the distance of end points to the line
-	btScalar distance0 = b2Dot(normal, vIn[0].v) - offset;
-	btScalar distance1 = b2Dot(normal, vIn[1].v) - offset;
-
-	// If the points are behind the plane
-	if (distance0 <= 0.0f) vOut[numOut++] = vIn[0];
-	if (distance1 <= 0.0f) vOut[numOut++] = vIn[1];
-
-	// If the points are on different sides of the plane
-	if (distance0 * distance1 < 0.0f)
-	{
-		// Find intersection point of edge and plane
-		btScalar interp = distance0 / (distance0 - distance1);
-		vOut[numOut].v = vIn[0].v + interp * (vIn[1].v - vIn[0].v);
-		if (distance0 > 0.0f)
-		{
-			vOut[numOut].id = vIn[0].id;
-		}
-		else
-		{
-			vOut[numOut].id = vIn[1].id;
-		}
-		++numOut;
-	}
-
-	return numOut;
-}
-
-// Find the separation between poly1 and poly2 for a give edge normal on poly1.
-static btScalar EdgeSeparation(const btBox2dShape* poly1, const btTransform& xf1, int edge1,
-							  const btBox2dShape* poly2, const btTransform& xf2)
-{
-	const btVector3* vertices1 = poly1->getVertices();
-	const btVector3* normals1 = poly1->getNormals();
-
-	int count2 = poly2->getVertexCount();
-	const btVector3* vertices2 = poly2->getVertices();
-
-	btAssert(0 <= edge1 && edge1 < poly1->getVertexCount());
-
-	// Convert normal from poly1's frame into poly2's frame.
-	btVector3 normal1World = b2Mul(xf1.getBasis(), normals1[edge1]);
-	btVector3 normal1 = b2MulT(xf2.getBasis(), normal1World);
-
-	// Find support vertex on poly2 for -normal.
-	int index = 0;
-	btScalar minDot = BT_LARGE_FLOAT;
-
-	for (int i = 0; i < count2; ++i)
-	{
-		btScalar dot = b2Dot(vertices2[i], normal1);
-		if (dot < minDot)
-		{
-			minDot = dot;
-			index = i;
-		}
-	}
-
-	btVector3 v1 = b2Mul(xf1, vertices1[edge1]);
-	btVector3 v2 = b2Mul(xf2, vertices2[index]);
-	btScalar separation = b2Dot(v2 - v1, normal1World);
-	return separation;
-}
-
-// Find the max separation between poly1 and poly2 using edge normals from poly1.
-static btScalar FindMaxSeparation(int* edgeIndex,
-								 const btBox2dShape* poly1, const btTransform& xf1,
-								 const btBox2dShape* poly2, const btTransform& xf2)
-{
-	int count1 = poly1->getVertexCount();
-	const btVector3* normals1 = poly1->getNormals();
-
-	// Vector pointing from the centroid of poly1 to the centroid of poly2.
-	btVector3 d = b2Mul(xf2, poly2->getCentroid()) - b2Mul(xf1, poly1->getCentroid());
-	btVector3 dLocal1 = b2MulT(xf1.getBasis(), d);
-
-	// Find edge normal on poly1 that has the largest projection onto d.
-	int edge = 0;
-	btScalar maxDot = -BT_LARGE_FLOAT;
-	for (int i = 0; i < count1; ++i)
-	{
-		btScalar dot = b2Dot(normals1[i], dLocal1);
-		if (dot > maxDot)
-		{
-			maxDot = dot;
-			edge = i;
-		}
-	}
-
-	// Get the separation for the edge normal.
-	btScalar s = EdgeSeparation(poly1, xf1, edge, poly2, xf2);
-	if (s > 0.0f)
-	{
-		return s;
-	}
-
-	// Check the separation for the previous edge normal.
-	int prevEdge = edge - 1 >= 0 ? edge - 1 : count1 - 1;
-	btScalar sPrev = EdgeSeparation(poly1, xf1, prevEdge, poly2, xf2);
-	if (sPrev > 0.0f)
-	{
-		return sPrev;
-	}
-
-	// Check the separation for the next edge normal.
-	int nextEdge = edge + 1 < count1 ? edge + 1 : 0;
-	btScalar sNext = EdgeSeparation(poly1, xf1, nextEdge, poly2, xf2);
-	if (sNext > 0.0f)
-	{
-		return sNext;
-	}
-
-	// Find the best edge and the search direction.
-	int bestEdge;
-	btScalar bestSeparation;
-	int increment;
-	if (sPrev > s && sPrev > sNext)
-	{
-		increment = -1;
-		bestEdge = prevEdge;
-		bestSeparation = sPrev;
-	}
-	else if (sNext > s)
-	{
-		increment = 1;
-		bestEdge = nextEdge;
-		bestSeparation = sNext;
-	}
-	else
-	{
-		*edgeIndex = edge;
-		return s;
-	}
-
-	// Perform a local search for the best edge normal.
-	for ( ; ; )
-	{
-		if (increment == -1)
-			edge = bestEdge - 1 >= 0 ? bestEdge - 1 : count1 - 1;
-		else
-			edge = bestEdge + 1 < count1 ? bestEdge + 1 : 0;
-
-		s = EdgeSeparation(poly1, xf1, edge, poly2, xf2);
-		if (s > 0.0f)
-		{
-			return s;
-		}
-
-		if (s > bestSeparation)
-		{
-			bestEdge = edge;
-			bestSeparation = s;
-		}
-		else
-		{
-			break;
-		}
-	}
-
-	*edgeIndex = bestEdge;
-	return bestSeparation;
-}
-
-static void FindIncidentEdge(ClipVertex c[2],
-							 const btBox2dShape* poly1, const btTransform& xf1, int edge1,
-							 const btBox2dShape* poly2, const btTransform& xf2)
-{
-	const btVector3* normals1 = poly1->getNormals();
-
-	int count2 = poly2->getVertexCount();
-	const btVector3* vertices2 = poly2->getVertices();
-	const btVector3* normals2 = poly2->getNormals();
-
-	btAssert(0 <= edge1 && edge1 < poly1->getVertexCount());
-
-	// Get the normal of the reference edge in poly2's frame.
-	btVector3 normal1 = b2MulT(xf2.getBasis(), b2Mul(xf1.getBasis(), normals1[edge1]));
-
-	// Find the incident edge on poly2.
-	int index = 0;
-	btScalar minDot = BT_LARGE_FLOAT;
-	for (int i = 0; i < count2; ++i)
-	{
-		btScalar dot = b2Dot(normal1, normals2[i]);
-		if (dot < minDot)
-		{
-			minDot = dot;
-			index = i;
-		}
-	}
-
-	// Build the clip vertices for the incident edge.
-	int i1 = index;
-	int i2 = i1 + 1 < count2 ? i1 + 1 : 0;
-
-	c[0].v = b2Mul(xf2, vertices2[i1]);
-//	c[0].id.features.referenceEdge = (unsigned char)edge1;
-//	c[0].id.features.incidentEdge = (unsigned char)i1;
-//	c[0].id.features.incidentVertex = 0;
-
-	c[1].v = b2Mul(xf2, vertices2[i2]);
-//	c[1].id.features.referenceEdge = (unsigned char)edge1;
-//	c[1].id.features.incidentEdge = (unsigned char)i2;
-//	c[1].id.features.incidentVertex = 1;
-}
-
-// Find edge normal of max separation on A - return if separating axis is found
-// Find edge normal of max separation on B - return if separation axis is found
-// Choose reference edge as min(minA, minB)
-// Find incident edge
-// Clip
-
-// The normal points from 1 to 2
-void b2CollidePolygons(btManifoldResult* manifold,
-					  const btBox2dShape* polyA, const btTransform& xfA,
-					  const btBox2dShape* polyB, const btTransform& xfB)
-{
-
-	int edgeA = 0;
-	btScalar separationA = FindMaxSeparation(&edgeA, polyA, xfA, polyB, xfB);
-	if (separationA > 0.0f)
-		return;
-
-	int edgeB = 0;
-	btScalar separationB = FindMaxSeparation(&edgeB, polyB, xfB, polyA, xfA);
-	if (separationB > 0.0f)
-		return;
-
-	const btBox2dShape* poly1;	// reference poly
-	const btBox2dShape* poly2;	// incident poly
-	btTransform xf1, xf2;
-	int edge1;		// reference edge
-	unsigned char flip;
-	const btScalar k_relativeTol = 0.98f;
-	const btScalar k_absoluteTol = 0.001f;
-
-	// TODO_ERIN use "radius" of poly for absolute tolerance.
-	if (separationB > k_relativeTol * separationA + k_absoluteTol)
-	{
-		poly1 = polyB;
-		poly2 = polyA;
-		xf1 = xfB;
-		xf2 = xfA;
-		edge1 = edgeB;
-		flip = 1;
-	}
-	else
-	{
-		poly1 = polyA;
-		poly2 = polyB;
-		xf1 = xfA;
-		xf2 = xfB;
-		edge1 = edgeA;
-		flip = 0;
-	}
-
-	ClipVertex incidentEdge[2];
-	FindIncidentEdge(incidentEdge, poly1, xf1, edge1, poly2, xf2);
-
-	int count1 = poly1->getVertexCount();
-	const btVector3* vertices1 = poly1->getVertices();
-
-	btVector3 v11 = vertices1[edge1];
-	btVector3 v12 = edge1 + 1 < count1 ? vertices1[edge1+1] : vertices1[0];
-
-	btVector3 dv = v12 - v11;
-	btVector3 sideNormal = b2Mul(xf1.getBasis(), v12 - v11);
-	sideNormal.normalize();
-	btVector3 frontNormal = btCrossS(sideNormal, 1.0f);
-	
-	
-	v11 = b2Mul(xf1, v11);
-	v12 = b2Mul(xf1, v12);
-
-	btScalar frontOffset = b2Dot(frontNormal, v11);
-	btScalar sideOffset1 = -b2Dot(sideNormal, v11);
-	btScalar sideOffset2 = b2Dot(sideNormal, v12);
-
-	// Clip incident edge against extruded edge1 side edges.
-	ClipVertex clipPoints1[2];
-	clipPoints1[0].v.setValue(0,0,0);
-	clipPoints1[1].v.setValue(0,0,0);
-
-	ClipVertex clipPoints2[2];
-	clipPoints2[0].v.setValue(0,0,0);
-	clipPoints2[1].v.setValue(0,0,0);
-
-
-	int np;
-
-	// Clip to box side 1
-	np = ClipSegmentToLine(clipPoints1, incidentEdge, -sideNormal, sideOffset1);
-
-	if (np < 2)
-		return;
-
-	// Clip to negative box side 1
-	np = ClipSegmentToLine(clipPoints2, clipPoints1,  sideNormal, sideOffset2);
-
-	if (np < 2)
-	{
-		return;
-	}
-
-	// Now clipPoints2 contains the clipped points.
-	btVector3 manifoldNormal = flip ? -frontNormal : frontNormal;
-
-	int pointCount = 0;
-	for (int i = 0; i < b2_maxManifoldPoints; ++i)
-	{
-		btScalar separation = b2Dot(frontNormal, clipPoints2[i].v) - frontOffset;
-
-		if (separation <= 0.0f)
-		{
-			
-			//b2ManifoldPoint* cp = manifold->points + pointCount;
-			//btScalar separation = separation;
-			//cp->localPoint1 = b2MulT(xfA, clipPoints2[i].v);
-			//cp->localPoint2 = b2MulT(xfB, clipPoints2[i].v);
-
-			manifold->addContactPoint(-manifoldNormal,clipPoints2[i].v,separation);
-
-//			cp->id = clipPoints2[i].id;
-//			cp->id.features.flip = flip;
-			++pointCount;
-		}
-	}
-
-//	manifold->pointCount = pointCount;}
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h
deleted file mode 100644
index 97c5be7..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_BOX_2D_BOX_2D__COLLISION_ALGORITHM_H
-#define BT_BOX_2D_BOX_2D__COLLISION_ALGORITHM_H
-
-#include "BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
-#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"
-
-class btPersistentManifold;
-
-///box-box collision detection
-class btBox2dBox2dCollisionAlgorithm : public btActivatingCollisionAlgorithm
-{
-	bool	m_ownManifold;
-	btPersistentManifold*	m_manifoldPtr;
-	
-public:
-	btBox2dBox2dCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci)
-		: btActivatingCollisionAlgorithm(ci) {}
-
-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	btBox2dBox2dCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1);
-
-	virtual ~btBox2dBox2dCollisionAlgorithm();
-
-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
-	{
-		if (m_manifoldPtr && m_ownManifold)
-		{
-			manifoldArray.push_back(m_manifoldPtr);
-		}
-	}
-
-
-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
-	{
-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
-		{
-			int bbsize = sizeof(btBox2dBox2dCollisionAlgorithm);
-			void* ptr = ci.m_dispatcher1->allocateCollisionAlgorithm(bbsize);
-			return new(ptr) btBox2dBox2dCollisionAlgorithm(0,ci,body0,body1);
-		}
-	};
-
-};
-
-#endif //BT_BOX_2D_BOX_2D__COLLISION_ALGORITHM_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp
deleted file mode 100644
index 4962885..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btBoxBoxCollisionAlgorithm.h"
-#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
-#include "BulletCollision/CollisionShapes/btBoxShape.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-#include "btBoxBoxDetector.h"
-
-#define USE_PERSISTENT_CONTACTS 1
-
-btBoxBoxCollisionAlgorithm::btBoxBoxCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* obj0,btCollisionObject* obj1)
-: btActivatingCollisionAlgorithm(ci,obj0,obj1),
-m_ownManifold(false),
-m_manifoldPtr(mf)
-{
-	if (!m_manifoldPtr && m_dispatcher->needsCollision(obj0,obj1))
-	{
-		m_manifoldPtr = m_dispatcher->getNewManifold(obj0,obj1);
-		m_ownManifold = true;
-	}
-}
-
-btBoxBoxCollisionAlgorithm::~btBoxBoxCollisionAlgorithm()
-{
-	if (m_ownManifold)
-	{
-		if (m_manifoldPtr)
-			m_dispatcher->releaseManifold(m_manifoldPtr);
-	}
-}
-
-void btBoxBoxCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-	if (!m_manifoldPtr)
-		return;
-
-	btCollisionObject*	col0 = body0;
-	btCollisionObject*	col1 = body1;
-	btBoxShape* box0 = (btBoxShape*)col0->getCollisionShape();
-	btBoxShape* box1 = (btBoxShape*)col1->getCollisionShape();
-
-
-
-	/// report a contact. internally this will be kept persistent, and contact reduction is done
-	resultOut->setPersistentManifold(m_manifoldPtr);
-#ifndef USE_PERSISTENT_CONTACTS	
-	m_manifoldPtr->clearManifold();
-#endif //USE_PERSISTENT_CONTACTS
-
-	btDiscreteCollisionDetectorInterface::ClosestPointInput input;
-	input.m_maximumDistanceSquared = BT_LARGE_FLOAT;
-	input.m_transformA = body0->getWorldTransform();
-	input.m_transformB = body1->getWorldTransform();
-
-	btBoxBoxDetector detector(box0,box1);
-	detector.getClosestPoints(input,*resultOut,dispatchInfo.m_debugDraw);
-
-#ifdef USE_PERSISTENT_CONTACTS
-	//  refreshContactPoints is only necessary when using persistent contact points. otherwise all points are newly added
-	if (m_ownManifold)
-	{
-		resultOut->refreshContactPoints();
-	}
-#endif //USE_PERSISTENT_CONTACTS
-
-}
-
-btScalar btBoxBoxCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* /*body0*/,btCollisionObject* /*body1*/,const btDispatcherInfo& /*dispatchInfo*/,btManifoldResult* /*resultOut*/)
-{
-	//not yet
-	return 1.f;
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.h
deleted file mode 100644
index f0bbae6..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_BOX_BOX__COLLISION_ALGORITHM_H
-#define BT_BOX_BOX__COLLISION_ALGORITHM_H
-
-#include "btActivatingCollisionAlgorithm.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
-#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"
-
-class btPersistentManifold;
-
-///box-box collision detection
-class btBoxBoxCollisionAlgorithm : public btActivatingCollisionAlgorithm
-{
-	bool	m_ownManifold;
-	btPersistentManifold*	m_manifoldPtr;
-	
-public:
-	btBoxBoxCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci)
-		: btActivatingCollisionAlgorithm(ci) {}
-
-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	btBoxBoxCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1);
-
-	virtual ~btBoxBoxCollisionAlgorithm();
-
-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
-	{
-		if (m_manifoldPtr && m_ownManifold)
-		{
-			manifoldArray.push_back(m_manifoldPtr);
-		}
-	}
-
-
-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
-	{
-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
-		{
-			int bbsize = sizeof(btBoxBoxCollisionAlgorithm);
-			void* ptr = ci.m_dispatcher1->allocateCollisionAlgorithm(bbsize);
-			return new(ptr) btBoxBoxCollisionAlgorithm(0,ci,body0,body1);
-		}
-	};
-
-};
-
-#endif //BT_BOX_BOX__COLLISION_ALGORITHM_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp
deleted file mode 100644
index a7c8cf1..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp
+++ /dev/null
@@ -1,718 +0,0 @@
-/*
- * Box-Box collision detection re-distributed under the ZLib license with permission from Russell L. Smith
- * Original version is from Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith.
- * All rights reserved.  Email: russ at q12.org   Web: www.q12.org
- Bullet Continuous Collision Detection and Physics Library
- Bullet is Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-///ODE box-box collision detection is adapted to work with Bullet
-
-#include "btBoxBoxDetector.h"
-#include "BulletCollision/CollisionShapes/btBoxShape.h"
-
-#include <float.h>
-#include <string.h>
-
-btBoxBoxDetector::btBoxBoxDetector(btBoxShape* box1,btBoxShape* box2)
-: m_box1(box1),
-m_box2(box2)
-{
-
-}
-
-
-// given two boxes (p1,R1,side1) and (p2,R2,side2), collide them together and
-// generate contact points. this returns 0 if there is no contact otherwise
-// it returns the number of contacts generated.
-// `normal' returns the contact normal.
-// `depth' returns the maximum penetration depth along that normal.
-// `return_code' returns a number indicating the type of contact that was
-// detected:
-//        1,2,3 = box 2 intersects with a face of box 1
-//        4,5,6 = box 1 intersects with a face of box 2
-//        7..15 = edge-edge contact
-// `maxc' is the maximum number of contacts allowed to be generated, i.e.
-// the size of the `contact' array.
-// `contact' and `skip' are the contact array information provided to the
-// collision functions. this function only fills in the position and depth
-// fields.
-struct dContactGeom;
-#define dDOTpq(a,b,p,q) ((a)[0]*(b)[0] + (a)[p]*(b)[q] + (a)[2*(p)]*(b)[2*(q)])
-#define dInfinity FLT_MAX
-
-
-/*PURE_INLINE btScalar dDOT   (const btScalar *a, const btScalar *b) { return dDOTpq(a,b,1,1); }
-PURE_INLINE btScalar dDOT13 (const btScalar *a, const btScalar *b) { return dDOTpq(a,b,1,3); }
-PURE_INLINE btScalar dDOT31 (const btScalar *a, const btScalar *b) { return dDOTpq(a,b,3,1); }
-PURE_INLINE btScalar dDOT33 (const btScalar *a, const btScalar *b) { return dDOTpq(a,b,3,3); }
-*/
-static btScalar dDOT   (const btScalar *a, const btScalar *b) { return dDOTpq(a,b,1,1); }
-static btScalar dDOT44 (const btScalar *a, const btScalar *b) { return dDOTpq(a,b,4,4); }
-static btScalar dDOT41 (const btScalar *a, const btScalar *b) { return dDOTpq(a,b,4,1); }
-static btScalar dDOT14 (const btScalar *a, const btScalar *b) { return dDOTpq(a,b,1,4); }
-#define dMULTIPLYOP1_331(A,op,B,C) \
-{\
-  (A)[0] op dDOT41((B),(C)); \
-  (A)[1] op dDOT41((B+1),(C)); \
-  (A)[2] op dDOT41((B+2),(C)); \
-}
-
-#define dMULTIPLYOP0_331(A,op,B,C) \
-{ \
-  (A)[0] op dDOT((B),(C)); \
-  (A)[1] op dDOT((B+4),(C)); \
-  (A)[2] op dDOT((B+8),(C)); \
-} 
-
-#define dMULTIPLY1_331(A,B,C) dMULTIPLYOP1_331(A,=,B,C)
-#define dMULTIPLY0_331(A,B,C) dMULTIPLYOP0_331(A,=,B,C)
-
-typedef btScalar dMatrix3[4*3];
-
-void dLineClosestApproach (const btVector3& pa, const btVector3& ua,
-			   const btVector3& pb, const btVector3& ub,
-			   btScalar *alpha, btScalar *beta);
-void dLineClosestApproach (const btVector3& pa, const btVector3& ua,
-			   const btVector3& pb, const btVector3& ub,
-			   btScalar *alpha, btScalar *beta)
-{
-  btVector3 p;
-  p[0] = pb[0] - pa[0];
-  p[1] = pb[1] - pa[1];
-  p[2] = pb[2] - pa[2];
-  btScalar uaub = dDOT(ua,ub);
-  btScalar q1 =  dDOT(ua,p);
-  btScalar q2 = -dDOT(ub,p);
-  btScalar d = 1-uaub*uaub;
-  if (d <= btScalar(0.0001f)) {
-    // @@@ this needs to be made more robust
-    *alpha = 0;
-    *beta  = 0;
-  }
-  else {
-    d = 1.f/d;
-    *alpha = (q1 + uaub*q2)*d;
-    *beta  = (uaub*q1 + q2)*d;
-  }
-}
-
-
-
-// find all the intersection points between the 2D rectangle with vertices
-// at (+/-h[0],+/-h[1]) and the 2D quadrilateral with vertices (p[0],p[1]),
-// (p[2],p[3]),(p[4],p[5]),(p[6],p[7]).
-//
-// the intersection points are returned as x,y pairs in the 'ret' array.
-// the number of intersection points is returned by the function (this will
-// be in the range 0 to 8).
-
-static int intersectRectQuad2 (btScalar h[2], btScalar p[8], btScalar ret[16])
-{
-  // q (and r) contain nq (and nr) coordinate points for the current (and
-  // chopped) polygons
-  int nq=4,nr=0;
-  btScalar buffer[16];
-  btScalar *q = p;
-  btScalar *r = ret;
-  for (int dir=0; dir <= 1; dir++) {
-    // direction notation: xy[0] = x axis, xy[1] = y axis
-    for (int sign=-1; sign <= 1; sign += 2) {
-      // chop q along the line xy[dir] = sign*h[dir]
-      btScalar *pq = q;
-      btScalar *pr = r;
-      nr = 0;
-      for (int i=nq; i > 0; i--) {
-	// go through all points in q and all lines between adjacent points
-	if (sign*pq[dir] < h[dir]) {
-	  // this point is inside the chopping line
-	  pr[0] = pq[0];
-	  pr[1] = pq[1];
-	  pr += 2;
-	  nr++;
-	  if (nr & 8) {
-	    q = r;
-	    goto done;
-	  }
-	}
-	btScalar *nextq = (i > 1) ? pq+2 : q;
-	if ((sign*pq[dir] < h[dir]) ^ (sign*nextq[dir] < h[dir])) {
-	  // this line crosses the chopping line
-	  pr[1-dir] = pq[1-dir] + (nextq[1-dir]-pq[1-dir]) /
-	    (nextq[dir]-pq[dir]) * (sign*h[dir]-pq[dir]);
-	  pr[dir] = sign*h[dir];
-	  pr += 2;
-	  nr++;
-	  if (nr & 8) {
-	    q = r;
-	    goto done;
-	  }
-	}
-	pq += 2;
-      }
-      q = r;
-      r = (q==ret) ? buffer : ret;
-      nq = nr;
-    }
-  }
- done:
-  if (q != ret) memcpy (ret,q,nr*2*sizeof(btScalar));
-  return nr;
-}
-
-
-#define M__PI 3.14159265f
-
-// given n points in the plane (array p, of size 2*n), generate m points that
-// best represent the whole set. the definition of 'best' here is not
-// predetermined - the idea is to select points that give good box-box
-// collision detection behavior. the chosen point indexes are returned in the
-// array iret (of size m). 'i0' is always the first entry in the array.
-// n must be in the range [1..8]. m must be in the range [1..n]. i0 must be
-// in the range [0..n-1].
-
-void cullPoints2 (int n, btScalar p[], int m, int i0, int iret[]);
-void cullPoints2 (int n, btScalar p[], int m, int i0, int iret[])
-{
-  // compute the centroid of the polygon in cx,cy
-  int i,j;
-  btScalar a,cx,cy,q;
-  if (n==1) {
-    cx = p[0];
-    cy = p[1];
-  }
-  else if (n==2) {
-    cx = btScalar(0.5)*(p[0] + p[2]);
-    cy = btScalar(0.5)*(p[1] + p[3]);
-  }
-  else {
-    a = 0;
-    cx = 0;
-    cy = 0;
-    for (i=0; i<(n-1); i++) {
-      q = p[i*2]*p[i*2+3] - p[i*2+2]*p[i*2+1];
-      a += q;
-      cx += q*(p[i*2]+p[i*2+2]);
-      cy += q*(p[i*2+1]+p[i*2+3]);
-    }
-    q = p[n*2-2]*p[1] - p[0]*p[n*2-1];
-	if (btFabs(a+q) > SIMD_EPSILON)
-	{
-		a = 1.f/(btScalar(3.0)*(a+q));
-	} else
-	{
-		a=BT_LARGE_FLOAT;
-	}
-    cx = a*(cx + q*(p[n*2-2]+p[0]));
-    cy = a*(cy + q*(p[n*2-1]+p[1]));
-  }
-
-  // compute the angle of each point w.r.t. the centroid
-  btScalar A[8];
-  for (i=0; i<n; i++) A[i] = btAtan2(p[i*2+1]-cy,p[i*2]-cx);
-
-  // search for points that have angles closest to A[i0] + i*(2*pi/m).
-  int avail[8];
-  for (i=0; i<n; i++) avail[i] = 1;
-  avail[i0] = 0;
-  iret[0] = i0;
-  iret++;
-  for (j=1; j<m; j++) {
-    a = btScalar(j)*(2*M__PI/m) + A[i0];
-    if (a > M__PI) a -= 2*M__PI;
-    btScalar maxdiff=1e9,diff;
-
-    *iret = i0;			// iret is not allowed to keep this value, but it sometimes does, when diff=#QNAN0
-
-    for (i=0; i<n; i++) {
-      if (avail[i]) {
-	diff = btFabs (A[i]-a);
-	if (diff > M__PI) diff = 2*M__PI - diff;
-	if (diff < maxdiff) {
-	  maxdiff = diff;
-	  *iret = i;
-	}
-      }
-    }
-#if defined(DEBUG) || defined (_DEBUG)
-    btAssert (*iret != i0);	// ensure iret got set
-#endif
-    avail[*iret] = 0;
-    iret++;
-  }
-}
-
-
-
-int dBoxBox2 (const btVector3& p1, const dMatrix3 R1,
-	     const btVector3& side1, const btVector3& p2,
-	     const dMatrix3 R2, const btVector3& side2,
-	     btVector3& normal, btScalar *depth, int *return_code,
-		 int maxc, dContactGeom * /*contact*/, int /*skip*/,btDiscreteCollisionDetectorInterface::Result& output);
-int dBoxBox2 (const btVector3& p1, const dMatrix3 R1,
-	     const btVector3& side1, const btVector3& p2,
-	     const dMatrix3 R2, const btVector3& side2,
-	     btVector3& normal, btScalar *depth, int *return_code,
-		 int maxc, dContactGeom * /*contact*/, int /*skip*/,btDiscreteCollisionDetectorInterface::Result& output)
-{
-  const btScalar fudge_factor = btScalar(1.05);
-  btVector3 p,pp,normalC(0.f,0.f,0.f);
-  const btScalar *normalR = 0;
-  btScalar A[3],B[3],R11,R12,R13,R21,R22,R23,R31,R32,R33,
-    Q11,Q12,Q13,Q21,Q22,Q23,Q31,Q32,Q33,s,s2,l;
-  int i,j,invert_normal,code;
-
-  // get vector from centers of box 1 to box 2, relative to box 1
-  p = p2 - p1;
-  dMULTIPLY1_331 (pp,R1,p);		// get pp = p relative to body 1
-
-  // get side lengths / 2
-  A[0] = side1[0]*btScalar(0.5);
-  A[1] = side1[1]*btScalar(0.5);
-  A[2] = side1[2]*btScalar(0.5);
-  B[0] = side2[0]*btScalar(0.5);
-  B[1] = side2[1]*btScalar(0.5);
-  B[2] = side2[2]*btScalar(0.5);
-
-  // Rij is R1'*R2, i.e. the relative rotation between R1 and R2
-  R11 = dDOT44(R1+0,R2+0); R12 = dDOT44(R1+0,R2+1); R13 = dDOT44(R1+0,R2+2);
-  R21 = dDOT44(R1+1,R2+0); R22 = dDOT44(R1+1,R2+1); R23 = dDOT44(R1+1,R2+2);
-  R31 = dDOT44(R1+2,R2+0); R32 = dDOT44(R1+2,R2+1); R33 = dDOT44(R1+2,R2+2);
-
-  Q11 = btFabs(R11); Q12 = btFabs(R12); Q13 = btFabs(R13);
-  Q21 = btFabs(R21); Q22 = btFabs(R22); Q23 = btFabs(R23);
-  Q31 = btFabs(R31); Q32 = btFabs(R32); Q33 = btFabs(R33);
-
-  // for all 15 possible separating axes:
-  //   * see if the axis separates the boxes. if so, return 0.
-  //   * find the depth of the penetration along the separating axis (s2)
-  //   * if this is the largest depth so far, record it.
-  // the normal vector will be set to the separating axis with the smallest
-  // depth. note: normalR is set to point to a column of R1 or R2 if that is
-  // the smallest depth normal so far. otherwise normalR is 0 and normalC is
-  // set to a vector relative to body 1. invert_normal is 1 if the sign of
-  // the normal should be flipped.
-
-#define TST(expr1,expr2,norm,cc) \
-  s2 = btFabs(expr1) - (expr2); \
-  if (s2 > 0) return 0; \
-  if (s2 > s) { \
-    s = s2; \
-    normalR = norm; \
-    invert_normal = ((expr1) < 0); \
-    code = (cc); \
-  }
-
-  s = -dInfinity;
-  invert_normal = 0;
-  code = 0;
-
-  // separating axis = u1,u2,u3
-  TST (pp[0],(A[0] + B[0]*Q11 + B[1]*Q12 + B[2]*Q13),R1+0,1);
-  TST (pp[1],(A[1] + B[0]*Q21 + B[1]*Q22 + B[2]*Q23),R1+1,2);
-  TST (pp[2],(A[2] + B[0]*Q31 + B[1]*Q32 + B[2]*Q33),R1+2,3);
-
-  // separating axis = v1,v2,v3
-  TST (dDOT41(R2+0,p),(A[0]*Q11 + A[1]*Q21 + A[2]*Q31 + B[0]),R2+0,4);
-  TST (dDOT41(R2+1,p),(A[0]*Q12 + A[1]*Q22 + A[2]*Q32 + B[1]),R2+1,5);
-  TST (dDOT41(R2+2,p),(A[0]*Q13 + A[1]*Q23 + A[2]*Q33 + B[2]),R2+2,6);
-
-  // note: cross product axes need to be scaled when s is computed.
-  // normal (n1,n2,n3) is relative to box 1.
-#undef TST
-#define TST(expr1,expr2,n1,n2,n3,cc) \
-  s2 = btFabs(expr1) - (expr2); \
-  if (s2 > SIMD_EPSILON) return 0; \
-  l = btSqrt((n1)*(n1) + (n2)*(n2) + (n3)*(n3)); \
-  if (l > SIMD_EPSILON) { \
-    s2 /= l; \
-    if (s2*fudge_factor > s) { \
-      s = s2; \
-      normalR = 0; \
-      normalC[0] = (n1)/l; normalC[1] = (n2)/l; normalC[2] = (n3)/l; \
-      invert_normal = ((expr1) < 0); \
-      code = (cc); \
-    } \
-  }
-
-  btScalar fudge2 (1.0e-5f);
-
-  Q11 += fudge2;
-  Q12 += fudge2;
-  Q13 += fudge2;
-
-  Q21 += fudge2;
-  Q22 += fudge2;
-  Q23 += fudge2;
-
-  Q31 += fudge2;
-  Q32 += fudge2;
-  Q33 += fudge2;
-
-  // separating axis = u1 x (v1,v2,v3)
-  TST(pp[2]*R21-pp[1]*R31,(A[1]*Q31+A[2]*Q21+B[1]*Q13+B[2]*Q12),0,-R31,R21,7);
-  TST(pp[2]*R22-pp[1]*R32,(A[1]*Q32+A[2]*Q22+B[0]*Q13+B[2]*Q11),0,-R32,R22,8);
-  TST(pp[2]*R23-pp[1]*R33,(A[1]*Q33+A[2]*Q23+B[0]*Q12+B[1]*Q11),0,-R33,R23,9);
-
-  // separating axis = u2 x (v1,v2,v3)
-  TST(pp[0]*R31-pp[2]*R11,(A[0]*Q31+A[2]*Q11+B[1]*Q23+B[2]*Q22),R31,0,-R11,10);
-  TST(pp[0]*R32-pp[2]*R12,(A[0]*Q32+A[2]*Q12+B[0]*Q23+B[2]*Q21),R32,0,-R12,11);
-  TST(pp[0]*R33-pp[2]*R13,(A[0]*Q33+A[2]*Q13+B[0]*Q22+B[1]*Q21),R33,0,-R13,12);
-
-  // separating axis = u3 x (v1,v2,v3)
-  TST(pp[1]*R11-pp[0]*R21,(A[0]*Q21+A[1]*Q11+B[1]*Q33+B[2]*Q32),-R21,R11,0,13);
-  TST(pp[1]*R12-pp[0]*R22,(A[0]*Q22+A[1]*Q12+B[0]*Q33+B[2]*Q31),-R22,R12,0,14);
-  TST(pp[1]*R13-pp[0]*R23,(A[0]*Q23+A[1]*Q13+B[0]*Q32+B[1]*Q31),-R23,R13,0,15);
-
-#undef TST
-
-  if (!code) return 0;
-
-  // if we get to this point, the boxes interpenetrate. compute the normal
-  // in global coordinates.
-  if (normalR) {
-    normal[0] = normalR[0];
-    normal[1] = normalR[4];
-    normal[2] = normalR[8];
-  }
-  else {
-    dMULTIPLY0_331 (normal,R1,normalC);
-  }
-  if (invert_normal) {
-    normal[0] = -normal[0];
-    normal[1] = -normal[1];
-    normal[2] = -normal[2];
-  }
-  *depth = -s;
-
-  // compute contact point(s)
-
-  if (code > 6) {
-    // an edge from box 1 touches an edge from box 2.
-    // find a point pa on the intersecting edge of box 1
-    btVector3 pa;
-    btScalar sign;
-    for (i=0; i<3; i++) pa[i] = p1[i];
-    for (j=0; j<3; j++) {
-      sign = (dDOT14(normal,R1+j) > 0) ? btScalar(1.0) : btScalar(-1.0);
-      for (i=0; i<3; i++) pa[i] += sign * A[j] * R1[i*4+j];
-    }
-
-    // find a point pb on the intersecting edge of box 2
-    btVector3 pb;
-    for (i=0; i<3; i++) pb[i] = p2[i];
-    for (j=0; j<3; j++) {
-      sign = (dDOT14(normal,R2+j) > 0) ? btScalar(-1.0) : btScalar(1.0);
-      for (i=0; i<3; i++) pb[i] += sign * B[j] * R2[i*4+j];
-    }
-
-    btScalar alpha,beta;
-    btVector3 ua,ub;
-    for (i=0; i<3; i++) ua[i] = R1[((code)-7)/3 + i*4];
-    for (i=0; i<3; i++) ub[i] = R2[((code)-7)%3 + i*4];
-
-    dLineClosestApproach (pa,ua,pb,ub,&alpha,&beta);
-    for (i=0; i<3; i++) pa[i] += ua[i]*alpha;
-    for (i=0; i<3; i++) pb[i] += ub[i]*beta;
-
-	{
-		
-		//contact[0].pos[i] = btScalar(0.5)*(pa[i]+pb[i]);
-		//contact[0].depth = *depth;
-		btVector3 pointInWorld;
-
-#ifdef USE_CENTER_POINT
-	    for (i=0; i<3; i++) 
-			pointInWorld[i] = (pa[i]+pb[i])*btScalar(0.5);
-		output.addContactPoint(-normal,pointInWorld,-*depth);
-#else
-		output.addContactPoint(-normal,pb,-*depth);
-
-#endif //
-		*return_code = code;
-	}
-    return 1;
-  }
-
-  // okay, we have a face-something intersection (because the separating
-  // axis is perpendicular to a face). define face 'a' to be the reference
-  // face (i.e. the normal vector is perpendicular to this) and face 'b' to be
-  // the incident face (the closest face of the other box).
-
-  const btScalar *Ra,*Rb,*pa,*pb,*Sa,*Sb;
-  if (code <= 3) {
-    Ra = R1;
-    Rb = R2;
-    pa = p1;
-    pb = p2;
-    Sa = A;
-    Sb = B;
-  }
-  else {
-    Ra = R2;
-    Rb = R1;
-    pa = p2;
-    pb = p1;
-    Sa = B;
-    Sb = A;
-  }
-
-  // nr = normal vector of reference face dotted with axes of incident box.
-  // anr = absolute values of nr.
-  btVector3 normal2,nr,anr;
-  if (code <= 3) {
-    normal2[0] = normal[0];
-    normal2[1] = normal[1];
-    normal2[2] = normal[2];
-  }
-  else {
-    normal2[0] = -normal[0];
-    normal2[1] = -normal[1];
-    normal2[2] = -normal[2];
-  }
-  dMULTIPLY1_331 (nr,Rb,normal2);
-  anr[0] = btFabs (nr[0]);
-  anr[1] = btFabs (nr[1]);
-  anr[2] = btFabs (nr[2]);
-
-  // find the largest compontent of anr: this corresponds to the normal
-  // for the indident face. the other axis numbers of the indicent face
-  // are stored in a1,a2.
-  int lanr,a1,a2;
-  if (anr[1] > anr[0]) {
-    if (anr[1] > anr[2]) {
-      a1 = 0;
-      lanr = 1;
-      a2 = 2;
-    }
-    else {
-      a1 = 0;
-      a2 = 1;
-      lanr = 2;
-    }
-  }
-  else {
-    if (anr[0] > anr[2]) {
-      lanr = 0;
-      a1 = 1;
-      a2 = 2;
-    }
-    else {
-      a1 = 0;
-      a2 = 1;
-      lanr = 2;
-    }
-  }
-
-  // compute center point of incident face, in reference-face coordinates
-  btVector3 center;
-  if (nr[lanr] < 0) {
-    for (i=0; i<3; i++) center[i] = pb[i] - pa[i] + Sb[lanr] * Rb[i*4+lanr];
-  }
-  else {
-    for (i=0; i<3; i++) center[i] = pb[i] - pa[i] - Sb[lanr] * Rb[i*4+lanr];
-  }
-
-  // find the normal and non-normal axis numbers of the reference box
-  int codeN,code1,code2;
-  if (code <= 3) codeN = code-1; else codeN = code-4;
-  if (codeN==0) {
-    code1 = 1;
-    code2 = 2;
-  }
-  else if (codeN==1) {
-    code1 = 0;
-    code2 = 2;
-  }
-  else {
-    code1 = 0;
-    code2 = 1;
-  }
-
-  // find the four corners of the incident face, in reference-face coordinates
-  btScalar quad[8];	// 2D coordinate of incident face (x,y pairs)
-  btScalar c1,c2,m11,m12,m21,m22;
-  c1 = dDOT14 (center,Ra+code1);
-  c2 = dDOT14 (center,Ra+code2);
-  // optimize this? - we have already computed this data above, but it is not
-  // stored in an easy-to-index format. for now it's quicker just to recompute
-  // the four dot products.
-  m11 = dDOT44 (Ra+code1,Rb+a1);
-  m12 = dDOT44 (Ra+code1,Rb+a2);
-  m21 = dDOT44 (Ra+code2,Rb+a1);
-  m22 = dDOT44 (Ra+code2,Rb+a2);
-  {
-    btScalar k1 = m11*Sb[a1];
-    btScalar k2 = m21*Sb[a1];
-    btScalar k3 = m12*Sb[a2];
-    btScalar k4 = m22*Sb[a2];
-    quad[0] = c1 - k1 - k3;
-    quad[1] = c2 - k2 - k4;
-    quad[2] = c1 - k1 + k3;
-    quad[3] = c2 - k2 + k4;
-    quad[4] = c1 + k1 + k3;
-    quad[5] = c2 + k2 + k4;
-    quad[6] = c1 + k1 - k3;
-    quad[7] = c2 + k2 - k4;
-  }
-
-  // find the size of the reference face
-  btScalar rect[2];
-  rect[0] = Sa[code1];
-  rect[1] = Sa[code2];
-
-  // intersect the incident and reference faces
-  btScalar ret[16];
-  int n = intersectRectQuad2 (rect,quad,ret);
-  if (n < 1) return 0;		// this should never happen
-
-  // convert the intersection points into reference-face coordinates,
-  // and compute the contact position and depth for each point. only keep
-  // those points that have a positive (penetrating) depth. delete points in
-  // the 'ret' array as necessary so that 'point' and 'ret' correspond.
-  btScalar point[3*8];		// penetrating contact points
-  btScalar dep[8];			// depths for those points
-  btScalar det1 = 1.f/(m11*m22 - m12*m21);
-  m11 *= det1;
-  m12 *= det1;
-  m21 *= det1;
-  m22 *= det1;
-  int cnum = 0;			// number of penetrating contact points found
-  for (j=0; j < n; j++) {
-    btScalar k1 =  m22*(ret[j*2]-c1) - m12*(ret[j*2+1]-c2);
-    btScalar k2 = -m21*(ret[j*2]-c1) + m11*(ret[j*2+1]-c2);
-    for (i=0; i<3; i++) point[cnum*3+i] =
-			  center[i] + k1*Rb[i*4+a1] + k2*Rb[i*4+a2];
-    dep[cnum] = Sa[codeN] - dDOT(normal2,point+cnum*3);
-    if (dep[cnum] >= 0) {
-      ret[cnum*2] = ret[j*2];
-      ret[cnum*2+1] = ret[j*2+1];
-      cnum++;
-    }
-  }
-  if (cnum < 1) return 0;	// this should never happen
-
-  // we can't generate more contacts than we actually have
-  if (maxc > cnum) maxc = cnum;
-  if (maxc < 1) maxc = 1;
-
-  if (cnum <= maxc) {
-
-	  if (code<4) 
-	  {
-    // we have less contacts than we need, so we use them all
-    for (j=0; j < cnum; j++) 
-	{
-		btVector3 pointInWorld;
-		for (i=0; i<3; i++) 
-			pointInWorld[i] = point[j*3+i] + pa[i];
-		output.addContactPoint(-normal,pointInWorld,-dep[j]);
-
-    }
-	  } else
-	  {
-		  // we have less contacts than we need, so we use them all
-		for (j=0; j < cnum; j++) 
-		{
-			btVector3 pointInWorld;
-			for (i=0; i<3; i++) 
-				pointInWorld[i] = point[j*3+i] + pa[i]-normal[i]*dep[j];
-				//pointInWorld[i] = point[j*3+i] + pa[i];
-			output.addContactPoint(-normal,pointInWorld,-dep[j]);
-		}
-	  }
-  }
-  else {
-    // we have more contacts than are wanted, some of them must be culled.
-    // find the deepest point, it is always the first contact.
-    int i1 = 0;
-    btScalar maxdepth = dep[0];
-    for (i=1; i<cnum; i++) {
-      if (dep[i] > maxdepth) {
-	maxdepth = dep[i];
-	i1 = i;
-      }
-    }
-
-    int iret[8];
-    cullPoints2 (cnum,ret,maxc,i1,iret);
-
-    for (j=0; j < maxc; j++) {
-//      dContactGeom *con = CONTACT(contact,skip*j);
-  //    for (i=0; i<3; i++) con->pos[i] = point[iret[j]*3+i] + pa[i];
-    //  con->depth = dep[iret[j]];
-
-		btVector3 posInWorld;
-		for (i=0; i<3; i++) 
-			posInWorld[i] = point[iret[j]*3+i] + pa[i];
-		if (code<4) 
-	   {
-			output.addContactPoint(-normal,posInWorld,-dep[iret[j]]);
-		} else
-		{
-			output.addContactPoint(-normal,posInWorld-normal*dep[iret[j]],-dep[iret[j]]);
-		}
-    }
-    cnum = maxc;
-  }
-
-  *return_code = code;
-  return cnum;
-}
-
-void	btBoxBoxDetector::getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* /*debugDraw*/,bool /*swapResults*/)
-{
-	
-	const btTransform& transformA = input.m_transformA;
-	const btTransform& transformB = input.m_transformB;
-	
-	int skip = 0;
-	dContactGeom *contact = 0;
-
-	dMatrix3 R1;
-	dMatrix3 R2;
-
-	for (int j=0;j<3;j++)
-	{
-		R1[0+4*j] = transformA.getBasis()[j].x();
-		R2[0+4*j] = transformB.getBasis()[j].x();
-
-		R1[1+4*j] = transformA.getBasis()[j].y();
-		R2[1+4*j] = transformB.getBasis()[j].y();
-
-
-		R1[2+4*j] = transformA.getBasis()[j].z();
-		R2[2+4*j] = transformB.getBasis()[j].z();
-
-	}
-
-	
-
-	btVector3 normal;
-	btScalar depth;
-	int return_code;
-	int maxc = 4;
-
-
-	dBoxBox2 (transformA.getOrigin(), 
-	R1,
-	2.f*m_box1->getHalfExtentsWithMargin(),
-	transformB.getOrigin(),
-	R2, 
-	2.f*m_box2->getHalfExtentsWithMargin(),
-	normal, &depth, &return_code,
-	maxc, contact, skip,
-	output
-	);
-
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.h
deleted file mode 100644
index 3c941f7..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Box-Box collision detection re-distributed under the ZLib license with permission from Russell L. Smith
- * Original version is from Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith.
- * All rights reserved.  Email: russ at q12.org   Web: www.q12.org
-
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-#ifndef BT_BOX_BOX_DETECTOR_H
-#define BT_BOX_BOX_DETECTOR_H
-
-
-class btBoxShape;
-#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"
-
-
-/// btBoxBoxDetector wraps the ODE box-box collision detector
-/// re-distributed under the Zlib license with permission from Russell L. Smith
-struct btBoxBoxDetector : public btDiscreteCollisionDetectorInterface
-{
-	btBoxShape* m_box1;
-	btBoxShape* m_box2;
-
-public:
-
-	btBoxBoxDetector(btBoxShape* box1,btBoxShape* box2);
-
-	virtual ~btBoxBoxDetector() {};
-
-	virtual void	getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw,bool swapResults=false);
-
-};
-
-#endif //BT_BOX_BOX_DETECTOR_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionConfiguration.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionConfiguration.h
deleted file mode 100644
index f63e092..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionConfiguration.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_COLLISION_CONFIGURATION
-#define BT_COLLISION_CONFIGURATION
-
-struct btCollisionAlgorithmCreateFunc;
-
-class btStackAlloc;
-class btPoolAllocator;
-
-///btCollisionConfiguration allows to configure Bullet collision detection
-///stack allocator size, default collision algorithms and persistent manifold pool size
-///@todo: describe the meaning
-class	btCollisionConfiguration
-{
-
-public:
-
-	virtual ~btCollisionConfiguration()
-	{
-	}
-
-	///memory pools
-	virtual btPoolAllocator* getPersistentManifoldPool() = 0;
-
-	virtual btPoolAllocator* getCollisionAlgorithmPool() = 0;
-
-	virtual btStackAlloc*	getStackAllocator() = 0;
-
-	virtual btCollisionAlgorithmCreateFunc* getCollisionAlgorithmCreateFunc(int proxyType0,int proxyType1) =0;
-
-};
-
-#endif //BT_COLLISION_CONFIGURATION
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h
deleted file mode 100644
index 1d7e744..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_COLLISION_CREATE_FUNC
-#define BT_COLLISION_CREATE_FUNC
-
-#include "LinearMath/btAlignedObjectArray.h"
-class btCollisionAlgorithm;
-class btCollisionObject;
-
-struct btCollisionAlgorithmConstructionInfo;
-
-///Used by the btCollisionDispatcher to register and create instances for btCollisionAlgorithm
-struct btCollisionAlgorithmCreateFunc
-{
-	bool m_swapped;
-	
-	btCollisionAlgorithmCreateFunc()
-		:m_swapped(false)
-	{
-	}
-	virtual ~btCollisionAlgorithmCreateFunc(){};
-
-	virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& , btCollisionObject* body0,btCollisionObject* body1)
-	{
-		
-		(void)body0;
-		(void)body1;
-		return 0;
-	}
-};
-#endif //BT_COLLISION_CREATE_FUNC
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp
deleted file mode 100644
index 29674f3..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-#include "btCollisionDispatcher.h"
-
-
-#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
-
-#include "BulletCollision/CollisionShapes/btCollisionShape.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"
-#include "LinearMath/btPoolAllocator.h"
-#include "BulletCollision/CollisionDispatch/btCollisionConfiguration.h"
-
-int gNumManifold = 0;
-
-#ifdef BT_DEBUG
-#include <stdio.h>
-#endif
-
-
-btCollisionDispatcher::btCollisionDispatcher (btCollisionConfiguration* collisionConfiguration): 
-m_dispatcherFlags(btCollisionDispatcher::CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD),
-	m_collisionConfiguration(collisionConfiguration)
-{
-	int i;
-
-	setNearCallback(defaultNearCallback);
-	
-	m_collisionAlgorithmPoolAllocator = collisionConfiguration->getCollisionAlgorithmPool();
-
-	m_persistentManifoldPoolAllocator = collisionConfiguration->getPersistentManifoldPool();
-
-	for (i=0;i<MAX_BROADPHASE_COLLISION_TYPES;i++)
-	{
-		for (int j=0;j<MAX_BROADPHASE_COLLISION_TYPES;j++)
-		{
-			m_doubleDispatch[i][j] = m_collisionConfiguration->getCollisionAlgorithmCreateFunc(i,j);
-			btAssert(m_doubleDispatch[i][j]);
-		}
-	}
-	
-	
-}
-
-
-void btCollisionDispatcher::registerCollisionCreateFunc(int proxyType0, int proxyType1, btCollisionAlgorithmCreateFunc *createFunc)
-{
-	m_doubleDispatch[proxyType0][proxyType1] = createFunc;
-}
-
-btCollisionDispatcher::~btCollisionDispatcher()
-{
-}
-
-btPersistentManifold*	btCollisionDispatcher::getNewManifold(void* b0,void* b1) 
-{ 
-	gNumManifold++;
-	
-	//btAssert(gNumManifold < 65535);
-	
-
-	btCollisionObject* body0 = (btCollisionObject*)b0;
-	btCollisionObject* body1 = (btCollisionObject*)b1;
-
-	//optional relative contact breaking threshold, turned on by default (use setDispatcherFlags to switch off feature for improved performance)
-	
-	btScalar contactBreakingThreshold =  (m_dispatcherFlags & btCollisionDispatcher::CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD) ? 
-		btMin(body0->getCollisionShape()->getContactBreakingThreshold(gContactBreakingThreshold) , body1->getCollisionShape()->getContactBreakingThreshold(gContactBreakingThreshold))
-		: gContactBreakingThreshold ;
-
-	btScalar contactProcessingThreshold = btMin(body0->getContactProcessingThreshold(),body1->getContactProcessingThreshold());
-		
-	void* mem = 0;
-	
-	if (m_persistentManifoldPoolAllocator->getFreeCount())
-	{
-		mem = m_persistentManifoldPoolAllocator->allocate(sizeof(btPersistentManifold));
-	} else
-	{
-		//we got a pool memory overflow, by default we fallback to dynamically allocate memory. If we require a contiguous contact pool then assert.
-		if ((m_dispatcherFlags&CD_DISABLE_CONTACTPOOL_DYNAMIC_ALLOCATION)==0)
-		{
-			mem = btAlignedAlloc(sizeof(btPersistentManifold),16);
-		} else
-		{
-			btAssert(0);
-			//make sure to increase the m_defaultMaxPersistentManifoldPoolSize in the btDefaultCollisionConstructionInfo/btDefaultCollisionConfiguration
-			return 0;
-		}
-	}
-	btPersistentManifold* manifold = new(mem) btPersistentManifold (body0,body1,0,contactBreakingThreshold,contactProcessingThreshold);
-	manifold->m_index1a = m_manifoldsPtr.size();
-	m_manifoldsPtr.push_back(manifold);
-
-	return manifold;
-}
-
-void btCollisionDispatcher::clearManifold(btPersistentManifold* manifold)
-{
-	manifold->clearManifold();
-}
-
-	
-void btCollisionDispatcher::releaseManifold(btPersistentManifold* manifold)
-{
-	
-	gNumManifold--;
-
-	//printf("releaseManifold: gNumManifold %d\n",gNumManifold);
-	clearManifold(manifold);
-
-	int findIndex = manifold->m_index1a;
-	btAssert(findIndex < m_manifoldsPtr.size());
-	m_manifoldsPtr.swap(findIndex,m_manifoldsPtr.size()-1);
-	m_manifoldsPtr[findIndex]->m_index1a = findIndex;
-	m_manifoldsPtr.pop_back();
-
-	manifold->~btPersistentManifold();
-	if (m_persistentManifoldPoolAllocator->validPtr(manifold))
-	{
-		m_persistentManifoldPoolAllocator->freeMemory(manifold);
-	} else
-	{
-		btAlignedFree(manifold);
-	}
-	
-}
-
-	
-
-btCollisionAlgorithm* btCollisionDispatcher::findAlgorithm(btCollisionObject* body0,btCollisionObject* body1,btPersistentManifold* sharedManifold)
-{
-	
-	btCollisionAlgorithmConstructionInfo ci;
-
-	ci.m_dispatcher1 = this;
-	ci.m_manifold = sharedManifold;
-	btCollisionAlgorithm* algo = m_doubleDispatch[body0->getCollisionShape()->getShapeType()][body1->getCollisionShape()->getShapeType()]->CreateCollisionAlgorithm(ci,body0,body1);
-
-	return algo;
-}
-
-
-
-
-bool	btCollisionDispatcher::needsResponse(btCollisionObject* body0,btCollisionObject* body1)
-{
-	//here you can do filtering
-	bool hasResponse = 
-		(body0->hasContactResponse() && body1->hasContactResponse());
-	//no response between two static/kinematic bodies:
-	hasResponse = hasResponse &&
-		((!body0->isStaticOrKinematicObject()) ||(! body1->isStaticOrKinematicObject()));
-	return hasResponse;
-}
-
-bool	btCollisionDispatcher::needsCollision(btCollisionObject* body0,btCollisionObject* body1)
-{
-	btAssert(body0);
-	btAssert(body1);
-
-	bool needsCollision = true;
-
-#ifdef BT_DEBUG
-	if (!(m_dispatcherFlags & btCollisionDispatcher::CD_STATIC_STATIC_REPORTED))
-	{
-		//broadphase filtering already deals with this
-		if (body0->isStaticOrKinematicObject() && body1->isStaticOrKinematicObject())
-		{
-			m_dispatcherFlags |= btCollisionDispatcher::CD_STATIC_STATIC_REPORTED;
-			printf("warning btCollisionDispatcher::needsCollision: static-static collision!\n");
-		}
-	}
-#endif //BT_DEBUG
-
-	if ((!body0->isActive()) && (!body1->isActive()))
-		needsCollision = false;
-	else if (!body0->checkCollideWith(body1))
-		needsCollision = false;
-	
-	return needsCollision ;
-
-}
-
-
-
-///interface for iterating all overlapping collision pairs, no matter how those pairs are stored (array, set, map etc)
-///this is useful for the collision dispatcher.
-class btCollisionPairCallback : public btOverlapCallback
-{
-	const btDispatcherInfo& m_dispatchInfo;
-	btCollisionDispatcher*	m_dispatcher;
-
-public:
-
-	btCollisionPairCallback(const btDispatcherInfo& dispatchInfo,btCollisionDispatcher*	dispatcher)
-	:m_dispatchInfo(dispatchInfo),
-	m_dispatcher(dispatcher)
-	{
-	}
-
-	/*btCollisionPairCallback& operator=(btCollisionPairCallback& other)
-	{
-		m_dispatchInfo = other.m_dispatchInfo;
-		m_dispatcher = other.m_dispatcher;
-		return *this;
-	}
-	*/
-
-
-	virtual ~btCollisionPairCallback() {}
-
-
-	virtual bool	processOverlap(btBroadphasePair& pair)
-	{
-		(*m_dispatcher->getNearCallback())(pair,*m_dispatcher,m_dispatchInfo);
-
-		return false;
-	}
-};
-
-
-
-void	btCollisionDispatcher::dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher) 
-{
-	//m_blockedForChanges = true;
-
-	btCollisionPairCallback	collisionCallback(dispatchInfo,this);
-
-	pairCache->processAllOverlappingPairs(&collisionCallback,dispatcher);
-
-	//m_blockedForChanges = false;
-
-}
-
-
-
-
-//by default, Bullet will use this near callback
-void btCollisionDispatcher::defaultNearCallback(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, const btDispatcherInfo& dispatchInfo)
-{
-		btCollisionObject* colObj0 = (btCollisionObject*)collisionPair.m_pProxy0->m_clientObject;
-		btCollisionObject* colObj1 = (btCollisionObject*)collisionPair.m_pProxy1->m_clientObject;
-
-		if (dispatcher.needsCollision(colObj0,colObj1))
-		{
-			//dispatcher will keep algorithms persistent in the collision pair
-			if (!collisionPair.m_algorithm)
-			{
-				collisionPair.m_algorithm = dispatcher.findAlgorithm(colObj0,colObj1);
-			}
-
-			if (collisionPair.m_algorithm)
-			{
-				btManifoldResult contactPointResult(colObj0,colObj1);
-				
-				if (dispatchInfo.m_dispatchFunc == 		btDispatcherInfo::DISPATCH_DISCRETE)
-				{
-					//discrete collision detection query
-					collisionPair.m_algorithm->processCollision(colObj0,colObj1,dispatchInfo,&contactPointResult);
-				} else
-				{
-					//continuous collision detection query, time of impact (toi)
-					btScalar toi = collisionPair.m_algorithm->calculateTimeOfImpact(colObj0,colObj1,dispatchInfo,&contactPointResult);
-					if (dispatchInfo.m_timeOfImpact > toi)
-						dispatchInfo.m_timeOfImpact = toi;
-
-				}
-			}
-		}
-
-}
-
-
-void* btCollisionDispatcher::allocateCollisionAlgorithm(int size)
-{
-	if (m_collisionAlgorithmPoolAllocator->getFreeCount())
-	{
-		return m_collisionAlgorithmPoolAllocator->allocate(size);
-	}
-	
-	//warn user for overflow?
-	return	btAlignedAlloc(static_cast<size_t>(size), 16);
-}
-
-void btCollisionDispatcher::freeCollisionAlgorithm(void* ptr)
-{
-	if (m_collisionAlgorithmPoolAllocator->validPtr(ptr))
-	{
-		m_collisionAlgorithmPoolAllocator->freeMemory(ptr);
-	} else
-	{
-		btAlignedFree(ptr);
-	}
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.h
deleted file mode 100644
index 2fca43f..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_COLLISION__DISPATCHER_H
-#define BT_COLLISION__DISPATCHER_H
-
-#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
-#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
-
-#include "BulletCollision/CollisionDispatch/btManifoldResult.h"
-
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-#include "LinearMath/btAlignedObjectArray.h"
-
-class btIDebugDraw;
-class btOverlappingPairCache;
-class btPoolAllocator;
-class btCollisionConfiguration;
-
-#include "btCollisionCreateFunc.h"
-
-#define USE_DISPATCH_REGISTRY_ARRAY 1
-
-class btCollisionDispatcher;
-///user can override this nearcallback for collision filtering and more finegrained control over collision detection
-typedef void (*btNearCallback)(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, const btDispatcherInfo& dispatchInfo);
-
-
-///btCollisionDispatcher supports algorithms that handle ConvexConvex and ConvexConcave collision pairs.
-///Time of Impact, Closest Points and Penetration Depth.
-class btCollisionDispatcher : public btDispatcher
-{
-
-protected:
-
-	int		m_dispatcherFlags;
-
-	btAlignedObjectArray<btPersistentManifold*>	m_manifoldsPtr;
-
-	btManifoldResult	m_defaultManifoldResult;
-
-	btNearCallback		m_nearCallback;
-	
-	btPoolAllocator*	m_collisionAlgorithmPoolAllocator;
-
-	btPoolAllocator*	m_persistentManifoldPoolAllocator;
-
-	btCollisionAlgorithmCreateFunc* m_doubleDispatch[MAX_BROADPHASE_COLLISION_TYPES][MAX_BROADPHASE_COLLISION_TYPES];
-
-	btCollisionConfiguration*	m_collisionConfiguration;
-
-
-public:
-
-	enum DispatcherFlags
-	{
-		CD_STATIC_STATIC_REPORTED = 1,
-		CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD = 2,
-		CD_DISABLE_CONTACTPOOL_DYNAMIC_ALLOCATION = 4
-	};
-
-	int	getDispatcherFlags() const
-	{
-		return m_dispatcherFlags;
-	}
-
-	void	setDispatcherFlags(int flags)
-	{
-		m_dispatcherFlags = flags;
-	}
-
-	///registerCollisionCreateFunc allows registration of custom/alternative collision create functions
-	void	registerCollisionCreateFunc(int proxyType0,int proxyType1, btCollisionAlgorithmCreateFunc* createFunc);
-
-	int	getNumManifolds() const
-	{ 
-		return int( m_manifoldsPtr.size());
-	}
-
-	btPersistentManifold**	getInternalManifoldPointer()
-	{
-		return &m_manifoldsPtr[0];
-	}
-
-	 btPersistentManifold* getManifoldByIndexInternal(int index)
-	{
-		return m_manifoldsPtr[index];
-	}
-
-	 const btPersistentManifold* getManifoldByIndexInternal(int index) const
-	{
-		return m_manifoldsPtr[index];
-	}
-
-	btCollisionDispatcher (btCollisionConfiguration* collisionConfiguration);
-
-	virtual ~btCollisionDispatcher();
-
-	virtual btPersistentManifold*	getNewManifold(void* b0,void* b1);
-	
-	virtual void releaseManifold(btPersistentManifold* manifold);
-
-
-	virtual void clearManifold(btPersistentManifold* manifold);
-
-			
-	btCollisionAlgorithm* findAlgorithm(btCollisionObject* body0,btCollisionObject* body1,btPersistentManifold* sharedManifold = 0);
-		
-	virtual bool	needsCollision(btCollisionObject* body0,btCollisionObject* body1);
-	
-	virtual bool	needsResponse(btCollisionObject* body0,btCollisionObject* body1);
-	
-	virtual void	dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher) ;
-
-	void	setNearCallback(btNearCallback	nearCallback)
-	{
-		m_nearCallback = nearCallback; 
-	}
-
-	btNearCallback	getNearCallback() const
-	{
-		return m_nearCallback;
-	}
-
-	//by default, Bullet will use this near callback
-	static void  defaultNearCallback(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, const btDispatcherInfo& dispatchInfo);
-
-	virtual	void* allocateCollisionAlgorithm(int size);
-
-	virtual	void freeCollisionAlgorithm(void* ptr);
-
-	btCollisionConfiguration*	getCollisionConfiguration()
-	{
-		return m_collisionConfiguration;
-	}
-
-	const btCollisionConfiguration*	getCollisionConfiguration() const
-	{
-		return m_collisionConfiguration;
-	}
-
-	void	setCollisionConfiguration(btCollisionConfiguration* config)
-	{
-		m_collisionConfiguration = config;
-	}
-
-	virtual	btPoolAllocator*	getInternalManifoldPool()
-	{
-		return m_persistentManifoldPoolAllocator;
-	}
-
-	virtual	const btPoolAllocator*	getInternalManifoldPool() const
-	{
-		return m_persistentManifoldPoolAllocator;
-	}
-
-};
-
-#endif //BT_COLLISION__DISPATCHER_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp
deleted file mode 100644
index 580ea34..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "btCollisionObject.h"
-#include "LinearMath/btSerializer.h"
-
-btCollisionObject::btCollisionObject()
-	:	m_anisotropicFriction(1.f,1.f,1.f),
-	m_hasAnisotropicFriction(false),
-	m_contactProcessingThreshold(BT_LARGE_FLOAT),
-		m_broadphaseHandle(0),
-		m_collisionShape(0),
-		m_extensionPointer(0),
-		m_rootCollisionShape(0),
-		m_collisionFlags(btCollisionObject::CF_STATIC_OBJECT),
-		m_islandTag1(-1),
-		m_companionId(-1),
-		m_activationState1(1),
-		m_deactivationTime(btScalar(0.)),
-		m_friction(btScalar(0.5)),
-		m_restitution(btScalar(0.)),
-		m_internalType(CO_COLLISION_OBJECT),
-		m_userObjectPointer(0),
-		m_hitFraction(btScalar(1.)),
-		m_ccdSweptSphereRadius(btScalar(0.)),
-		m_ccdMotionThreshold(btScalar(0.)),
-		m_checkCollideWith(false)
-{
-	m_worldTransform.setIdentity();
-}
-
-btCollisionObject::~btCollisionObject()
-{
-}
-
-void btCollisionObject::setActivationState(int newState) 
-{ 
-	if ( (m_activationState1 != DISABLE_DEACTIVATION) && (m_activationState1 != DISABLE_SIMULATION))
-		m_activationState1 = newState;
-}
-
-void btCollisionObject::forceActivationState(int newState)
-{
-	m_activationState1 = newState;
-}
-
-void btCollisionObject::activate(bool forceActivation)
-{
-	if (forceActivation || !(m_collisionFlags & (CF_STATIC_OBJECT|CF_KINEMATIC_OBJECT)))
-	{
-		setActivationState(ACTIVE_TAG);
-		m_deactivationTime = btScalar(0.);
-	}
-}
-
-const char* btCollisionObject::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-
-	btCollisionObjectData* dataOut = (btCollisionObjectData*)dataBuffer;
-
-	m_worldTransform.serialize(dataOut->m_worldTransform);
-	m_interpolationWorldTransform.serialize(dataOut->m_interpolationWorldTransform);
-	m_interpolationLinearVelocity.serialize(dataOut->m_interpolationLinearVelocity);
-	m_interpolationAngularVelocity.serialize(dataOut->m_interpolationAngularVelocity);
-	m_anisotropicFriction.serialize(dataOut->m_anisotropicFriction);
-	dataOut->m_hasAnisotropicFriction = m_hasAnisotropicFriction;
-	dataOut->m_contactProcessingThreshold = m_contactProcessingThreshold;
-	dataOut->m_broadphaseHandle = 0;
-	dataOut->m_collisionShape = serializer->getUniquePointer(m_collisionShape);
-	dataOut->m_rootCollisionShape = 0;//@todo
-	dataOut->m_collisionFlags = m_collisionFlags;
-	dataOut->m_islandTag1 = m_islandTag1;
-	dataOut->m_companionId = m_companionId;
-	dataOut->m_activationState1 = m_activationState1;
-	dataOut->m_activationState1 = m_activationState1;
-	dataOut->m_deactivationTime = m_deactivationTime;
-	dataOut->m_friction = m_friction;
-	dataOut->m_restitution = m_restitution;
-	dataOut->m_internalType = m_internalType;
-	
-	char* name = (char*) serializer->findNameForPointer(this);
-	dataOut->m_name = (char*)serializer->getUniquePointer(name);
-	if (dataOut->m_name)
-	{
-		serializer->serializeName(name);
-	}
-	dataOut->m_hitFraction = m_hitFraction;
-	dataOut->m_ccdSweptSphereRadius = m_ccdSweptSphereRadius;
-	dataOut->m_ccdMotionThreshold = m_ccdMotionThreshold;
-	dataOut->m_ccdMotionThreshold = m_ccdMotionThreshold;
-	dataOut->m_checkCollideWith = m_checkCollideWith;
-
-	return btCollisionObjectDataName;
-}
-
-
-void btCollisionObject::serializeSingleObject(class btSerializer* serializer) const
-{
-	int len = calculateSerializeBufferSize();
-	btChunk* chunk = serializer->allocate(len,1);
-	const char* structType = serialize(chunk->m_oldPtr, serializer);
-	serializer->finalizeChunk(chunk,structType,BT_COLLISIONOBJECT_CODE,(void*)this);
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionObject.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionObject.h
deleted file mode 100644
index 3a11c96..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionObject.h
+++ /dev/null
@@ -1,524 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_COLLISION_OBJECT_H
-#define BT_COLLISION_OBJECT_H
-
-#include "LinearMath/btTransform.h"
-
-//island management, m_activationState1
-#define ACTIVE_TAG 1
-#define ISLAND_SLEEPING 2
-#define WANTS_DEACTIVATION 3
-#define DISABLE_DEACTIVATION 4
-#define DISABLE_SIMULATION 5
-
-struct	btBroadphaseProxy;
-class	btCollisionShape;
-struct btCollisionShapeData;
-#include "LinearMath/btMotionState.h"
-#include "LinearMath/btAlignedAllocator.h"
-#include "LinearMath/btAlignedObjectArray.h"
-
-typedef btAlignedObjectArray<class btCollisionObject*> btCollisionObjectArray;
-
-#ifdef BT_USE_DOUBLE_PRECISION
-#define btCollisionObjectData btCollisionObjectDoubleData
-#define btCollisionObjectDataName "btCollisionObjectDoubleData"
-#else
-#define btCollisionObjectData btCollisionObjectFloatData
-#define btCollisionObjectDataName "btCollisionObjectFloatData"
-#endif
-
-
-/// btCollisionObject can be used to manage collision detection objects. 
-/// btCollisionObject maintains all information that is needed for a collision detection: Shape, Transform and AABB proxy.
-/// They can be added to the btCollisionWorld.
-ATTRIBUTE_ALIGNED16(class)	btCollisionObject
-{
-
-protected:
-
-	btTransform	m_worldTransform;
-
-	///m_interpolationWorldTransform is used for CCD and interpolation
-	///it can be either previous or future (predicted) transform
-	btTransform	m_interpolationWorldTransform;
-	//those two are experimental: just added for bullet time effect, so you can still apply impulses (directly modifying velocities) 
-	//without destroying the continuous interpolated motion (which uses this interpolation velocities)
-	btVector3	m_interpolationLinearVelocity;
-	btVector3	m_interpolationAngularVelocity;
-	
-	btVector3	m_anisotropicFriction;
-	int			m_hasAnisotropicFriction;
-	btScalar	m_contactProcessingThreshold;	
-
-	btBroadphaseProxy*		m_broadphaseHandle;
-	btCollisionShape*		m_collisionShape;
-	///m_extensionPointer is used by some internal low-level Bullet extensions.
-	void*					m_extensionPointer;
-	
-	///m_rootCollisionShape is temporarily used to store the original collision shape
-	///The m_collisionShape might be temporarily replaced by a child collision shape during collision detection purposes
-	///If it is NULL, the m_collisionShape is not temporarily replaced.
-	btCollisionShape*		m_rootCollisionShape;
-
-	int				m_collisionFlags;
-
-	int				m_islandTag1;
-	int				m_companionId;
-
-	int				m_activationState1;
-	btScalar			m_deactivationTime;
-
-	btScalar		m_friction;
-	btScalar		m_restitution;
-
-	///m_internalType is reserved to distinguish Bullet's btCollisionObject, btRigidBody, btSoftBody, btGhostObject etc.
-	///do not assign your own m_internalType unless you write a new dynamics object class.
-	int				m_internalType;
-
-	///users can point to their objects, m_userPointer is not used by Bullet, see setUserPointer/getUserPointer
-	void*			m_userObjectPointer;
-
-	///time of impact calculation
-	btScalar		m_hitFraction; 
-	
-	///Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm::
-	btScalar		m_ccdSweptSphereRadius;
-
-	/// Don't do continuous collision detection if the motion (in one step) is less then m_ccdMotionThreshold
-	btScalar		m_ccdMotionThreshold;
-	
-	/// If some object should have elaborate collision filtering by sub-classes
-	int			m_checkCollideWith;
-
-	virtual bool	checkCollideWithOverride(btCollisionObject* /* co */)
-	{
-		return true;
-	}
-
-public:
-
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-
-	enum CollisionFlags
-	{
-		CF_STATIC_OBJECT= 1,
-		CF_KINEMATIC_OBJECT= 2,
-		CF_NO_CONTACT_RESPONSE = 4,
-		CF_CUSTOM_MATERIAL_CALLBACK = 8,//this allows per-triangle material (friction/restitution)
-		CF_CHARACTER_OBJECT = 16,
-		CF_DISABLE_VISUALIZE_OBJECT = 32, //disable debug drawing
-		CF_DISABLE_SPU_COLLISION_PROCESSING = 64//disable parallel/SPU processing
-	};
-
-	enum	CollisionObjectTypes
-	{
-		CO_COLLISION_OBJECT =1,
-		CO_RIGID_BODY=2,
-		///CO_GHOST_OBJECT keeps track of all objects overlapping its AABB and that pass its collision filter
-		///It is useful for collision sensors, explosion objects, character controller etc.
-		CO_GHOST_OBJECT=4,
-		CO_SOFT_BODY=8,
-		CO_HF_FLUID=16,
-		CO_USER_TYPE=32
-	};
-
-	SIMD_FORCE_INLINE bool mergesSimulationIslands() const
-	{
-		///static objects, kinematic and object without contact response don't merge islands
-		return  ((m_collisionFlags & (CF_STATIC_OBJECT | CF_KINEMATIC_OBJECT | CF_NO_CONTACT_RESPONSE) )==0);
-	}
-
-	const btVector3& getAnisotropicFriction() const
-	{
-		return m_anisotropicFriction;
-	}
-	void	setAnisotropicFriction(const btVector3& anisotropicFriction)
-	{
-		m_anisotropicFriction = anisotropicFriction;
-		m_hasAnisotropicFriction = (anisotropicFriction[0]!=1.f) || (anisotropicFriction[1]!=1.f) || (anisotropicFriction[2]!=1.f);
-	}
-	bool	hasAnisotropicFriction() const
-	{
-		return m_hasAnisotropicFriction!=0;
-	}
-
-	///the constraint solver can discard solving contacts, if the distance is above this threshold. 0 by default.
-	///Note that using contacts with positive distance can improve stability. It increases, however, the chance of colliding with degerate contacts, such as 'interior' triangle edges
-	void	setContactProcessingThreshold( btScalar contactProcessingThreshold)
-	{
-		m_contactProcessingThreshold = contactProcessingThreshold;
-	}
-	btScalar	getContactProcessingThreshold() const
-	{
-		return m_contactProcessingThreshold;
-	}
-
-	SIMD_FORCE_INLINE bool		isStaticObject() const {
-		return (m_collisionFlags & CF_STATIC_OBJECT) != 0;
-	}
-
-	SIMD_FORCE_INLINE bool		isKinematicObject() const
-	{
-		return (m_collisionFlags & CF_KINEMATIC_OBJECT) != 0;
-	}
-
-	SIMD_FORCE_INLINE bool		isStaticOrKinematicObject() const
-	{
-		return (m_collisionFlags & (CF_KINEMATIC_OBJECT | CF_STATIC_OBJECT)) != 0 ;
-	}
-
-	SIMD_FORCE_INLINE bool		hasContactResponse() const {
-		return (m_collisionFlags & CF_NO_CONTACT_RESPONSE)==0;
-	}
-
-	
-	btCollisionObject();
-
-	virtual ~btCollisionObject();
-
-	virtual void	setCollisionShape(btCollisionShape* collisionShape)
-	{
-		m_collisionShape = collisionShape;
-		m_rootCollisionShape = collisionShape;
-	}
-
-	SIMD_FORCE_INLINE const btCollisionShape*	getCollisionShape() const
-	{
-		return m_collisionShape;
-	}
-
-	SIMD_FORCE_INLINE btCollisionShape*	getCollisionShape()
-	{
-		return m_collisionShape;
-	}
-
-	SIMD_FORCE_INLINE const btCollisionShape*	getRootCollisionShape() const
-	{
-		return m_rootCollisionShape;
-	}
-
-	SIMD_FORCE_INLINE btCollisionShape*	getRootCollisionShape()
-	{
-		return m_rootCollisionShape;
-	}
-
-	///Avoid using this internal API call
-	///internalSetTemporaryCollisionShape is used to temporary replace the actual collision shape by a child collision shape.
-	void	internalSetTemporaryCollisionShape(btCollisionShape* collisionShape)
-	{
-		m_collisionShape = collisionShape;
-	}
-
-	///Avoid using this internal API call, the extension pointer is used by some Bullet extensions. 
-	///If you need to store your own user pointer, use 'setUserPointer/getUserPointer' instead.
-	void*		internalGetExtensionPointer() const
-	{
-		return m_extensionPointer;
-	}
-	///Avoid using this internal API call, the extension pointer is used by some Bullet extensions
-	///If you need to store your own user pointer, use 'setUserPointer/getUserPointer' instead.
-	void	internalSetExtensionPointer(void* pointer)
-	{
-		m_extensionPointer = pointer;
-	}
-
-	SIMD_FORCE_INLINE	int	getActivationState() const { return m_activationState1;}
-	
-	void setActivationState(int newState);
-
-	void	setDeactivationTime(btScalar time)
-	{
-		m_deactivationTime = time;
-	}
-	btScalar	getDeactivationTime() const
-	{
-		return m_deactivationTime;
-	}
-
-	void forceActivationState(int newState);
-
-	void	activate(bool forceActivation = false);
-
-	SIMD_FORCE_INLINE bool isActive() const
-	{
-		return ((getActivationState() != ISLAND_SLEEPING) && (getActivationState() != DISABLE_SIMULATION));
-	}
-
-	void	setRestitution(btScalar rest)
-	{
-		m_restitution = rest;
-	}
-	btScalar	getRestitution() const
-	{
-		return m_restitution;
-	}
-	void	setFriction(btScalar frict)
-	{
-		m_friction = frict;
-	}
-	btScalar	getFriction() const
-	{
-		return m_friction;
-	}
-
-	///reserved for Bullet internal usage
-	int	getInternalType() const
-	{
-		return m_internalType;
-	}
-
-	btTransform&	getWorldTransform()
-	{
-		return m_worldTransform;
-	}
-
-	const btTransform&	getWorldTransform() const
-	{
-		return m_worldTransform;
-	}
-
-	void	setWorldTransform(const btTransform& worldTrans)
-	{
-		m_worldTransform = worldTrans;
-	}
-
-
-	SIMD_FORCE_INLINE btBroadphaseProxy*	getBroadphaseHandle()
-	{
-		return m_broadphaseHandle;
-	}
-
-	SIMD_FORCE_INLINE const btBroadphaseProxy*	getBroadphaseHandle() const
-	{
-		return m_broadphaseHandle;
-	}
-
-	void	setBroadphaseHandle(btBroadphaseProxy* handle)
-	{
-		m_broadphaseHandle = handle;
-	}
-
-
-	const btTransform&	getInterpolationWorldTransform() const
-	{
-		return m_interpolationWorldTransform;
-	}
-
-	btTransform&	getInterpolationWorldTransform()
-	{
-		return m_interpolationWorldTransform;
-	}
-
-	void	setInterpolationWorldTransform(const btTransform&	trans)
-	{
-		m_interpolationWorldTransform = trans;
-	}
-
-	void	setInterpolationLinearVelocity(const btVector3& linvel)
-	{
-		m_interpolationLinearVelocity = linvel;
-	}
-
-	void	setInterpolationAngularVelocity(const btVector3& angvel)
-	{
-		m_interpolationAngularVelocity = angvel;
-	}
-
-	const btVector3&	getInterpolationLinearVelocity() const
-	{
-		return m_interpolationLinearVelocity;
-	}
-
-	const btVector3&	getInterpolationAngularVelocity() const
-	{
-		return m_interpolationAngularVelocity;
-	}
-
-	SIMD_FORCE_INLINE int getIslandTag() const
-	{
-		return	m_islandTag1;
-	}
-
-	void	setIslandTag(int tag)
-	{
-		m_islandTag1 = tag;
-	}
-
-	SIMD_FORCE_INLINE int getCompanionId() const
-	{
-		return	m_companionId;
-	}
-
-	void	setCompanionId(int id)
-	{
-		m_companionId = id;
-	}
-
-	SIMD_FORCE_INLINE btScalar			getHitFraction() const
-	{
-		return m_hitFraction; 
-	}
-
-	void	setHitFraction(btScalar hitFraction)
-	{
-		m_hitFraction = hitFraction;
-	}
-
-	
-	SIMD_FORCE_INLINE int	getCollisionFlags() const
-	{
-		return m_collisionFlags;
-	}
-
-	void	setCollisionFlags(int flags)
-	{
-		m_collisionFlags = flags;
-	}
-	
-	///Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm::
-	btScalar			getCcdSweptSphereRadius() const
-	{
-		return m_ccdSweptSphereRadius;
-	}
-
-	///Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm::
-	void	setCcdSweptSphereRadius(btScalar radius)
-	{
-		m_ccdSweptSphereRadius = radius;
-	}
-
-	btScalar 	getCcdMotionThreshold() const
-	{
-		return m_ccdMotionThreshold;
-	}
-
-	btScalar 	getCcdSquareMotionThreshold() const
-	{
-		return m_ccdMotionThreshold*m_ccdMotionThreshold;
-	}
-
-
-
-	/// Don't do continuous collision detection if the motion (in one step) is less then m_ccdMotionThreshold
-	void	setCcdMotionThreshold(btScalar ccdMotionThreshold)
-	{
-		m_ccdMotionThreshold = ccdMotionThreshold;
-	}
-
-	///users can point to their objects, userPointer is not used by Bullet
-	void*	getUserPointer() const
-	{
-		return m_userObjectPointer;
-	}
-	
-	///users can point to their objects, userPointer is not used by Bullet
-	void	setUserPointer(void* userPointer)
-	{
-		m_userObjectPointer = userPointer;
-	}
-
-
-	inline bool checkCollideWith(btCollisionObject* co)
-	{
-		if (m_checkCollideWith)
-			return checkCollideWithOverride(co);
-
-		return true;
-	}
-
-	virtual	int	calculateSerializeBufferSize()	const;
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer, class btSerializer* serializer) const;
-
-	virtual void serializeSingleObject(class btSerializer* serializer) const;
-
-};
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btCollisionObjectDoubleData
-{
-	void					*m_broadphaseHandle;
-	void					*m_collisionShape;
-	btCollisionShapeData	*m_rootCollisionShape;
-	char					*m_name;
-
-	btTransformDoubleData	m_worldTransform;
-	btTransformDoubleData	m_interpolationWorldTransform;
-	btVector3DoubleData		m_interpolationLinearVelocity;
-	btVector3DoubleData		m_interpolationAngularVelocity;
-	btVector3DoubleData		m_anisotropicFriction;
-	double					m_contactProcessingThreshold;	
-	double					m_deactivationTime;
-	double					m_friction;
-	double					m_restitution;
-	double					m_hitFraction; 
-	double					m_ccdSweptSphereRadius;
-	double					m_ccdMotionThreshold;
-
-	int						m_hasAnisotropicFriction;
-	int						m_collisionFlags;
-	int						m_islandTag1;
-	int						m_companionId;
-	int						m_activationState1;
-	int						m_internalType;
-	int						m_checkCollideWith;
-
-	char	m_padding[4];
-};
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btCollisionObjectFloatData
-{
-	void					*m_broadphaseHandle;
-	void					*m_collisionShape;
-	btCollisionShapeData	*m_rootCollisionShape;
-	char					*m_name;
-
-	btTransformFloatData	m_worldTransform;
-	btTransformFloatData	m_interpolationWorldTransform;
-	btVector3FloatData		m_interpolationLinearVelocity;
-	btVector3FloatData		m_interpolationAngularVelocity;
-	btVector3FloatData		m_anisotropicFriction;
-	float					m_contactProcessingThreshold;	
-	float					m_deactivationTime;
-	float					m_friction;
-	float					m_restitution;
-	float					m_hitFraction; 
-	float					m_ccdSweptSphereRadius;
-	float					m_ccdMotionThreshold;
-
-	int						m_hasAnisotropicFriction;
-	int						m_collisionFlags;
-	int						m_islandTag1;
-	int						m_companionId;
-	int						m_activationState1;
-	int						m_internalType;
-	int						m_checkCollideWith;
-};
-
-
-
-SIMD_FORCE_INLINE	int	btCollisionObject::calculateSerializeBufferSize() const
-{
-	return sizeof(btCollisionObjectData);
-}
-
-
-
-#endif //BT_COLLISION_OBJECT_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
deleted file mode 100644
index 807b3d6..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
+++ /dev/null
@@ -1,1513 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btCollisionWorld.h"
-#include "btCollisionDispatcher.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-#include "BulletCollision/CollisionShapes/btCollisionShape.h"
-#include "BulletCollision/CollisionShapes/btConvexShape.h"
-#include "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h"
-#include "BulletCollision/CollisionShapes/btSphereShape.h" //for raycasting
-#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h" //for raycasting
-#include "BulletCollision/NarrowPhaseCollision/btRaycastCallback.h"
-#include "BulletCollision/CollisionShapes/btCompoundShape.h"
-#include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h"
-#include "BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h"
-#include "BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h"
-#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
-#include "BulletCollision/BroadphaseCollision/btDbvt.h"
-#include "LinearMath/btAabbUtil2.h"
-#include "LinearMath/btQuickprof.h"
-#include "LinearMath/btStackAlloc.h"
-#include "LinearMath/btSerializer.h"
-#include "BulletCollision/CollisionShapes/btConvexPolyhedron.h"
-
-//#define DISABLE_DBVT_COMPOUNDSHAPE_RAYCAST_ACCELERATION
-
-
-//#define USE_BRUTEFORCE_RAYBROADPHASE 1
-//RECALCULATE_AABB is slower, but benefit is that you don't need to call 'stepSimulation'  or 'updateAabbs' before using a rayTest
-//#define RECALCULATE_AABB_RAYCAST 1
-
-//When the user doesn't provide dispatcher or broadphase, create basic versions (and delete them in destructor)
-#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
-#include "BulletCollision/BroadphaseCollision/btSimpleBroadphase.h"
-#include "BulletCollision/CollisionDispatch/btCollisionConfiguration.h"
-
-
-///for debug drawing
-
-//for debug rendering
-#include "BulletCollision/CollisionShapes/btBoxShape.h"
-#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
-#include "BulletCollision/CollisionShapes/btCompoundShape.h"
-#include "BulletCollision/CollisionShapes/btConeShape.h"
-#include "BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h"
-#include "BulletCollision/CollisionShapes/btCylinderShape.h"
-#include "BulletCollision/CollisionShapes/btMultiSphereShape.h"
-#include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h"
-#include "BulletCollision/CollisionShapes/btSphereShape.h"
-#include "BulletCollision/CollisionShapes/btTriangleCallback.h"
-#include "BulletCollision/CollisionShapes/btTriangleMeshShape.h"
-#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"
-
-
-
-btCollisionWorld::btCollisionWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache, btCollisionConfiguration* collisionConfiguration)
-:m_dispatcher1(dispatcher),
-m_broadphasePairCache(pairCache),
-m_debugDrawer(0),
-m_forceUpdateAllAabbs(true)
-{
-	m_stackAlloc = collisionConfiguration->getStackAllocator();
-	m_dispatchInfo.m_stackAllocator = m_stackAlloc;
-}
-
-
-btCollisionWorld::~btCollisionWorld()
-{
-
-	//clean up remaining objects
-	int i;
-	for (i=0;i<m_collisionObjects.size();i++)
-	{
-		btCollisionObject* collisionObject= m_collisionObjects[i];
-
-		btBroadphaseProxy* bp = collisionObject->getBroadphaseHandle();
-		if (bp)
-		{
-			//
-			// only clear the cached algorithms
-			//
-			getBroadphase()->getOverlappingPairCache()->cleanProxyFromPairs(bp,m_dispatcher1);
-			getBroadphase()->destroyProxy(bp,m_dispatcher1);
-			collisionObject->setBroadphaseHandle(0);
-		}
-	}
-
-
-}
-
-
-
-
-
-
-
-
-
-
-void	btCollisionWorld::addCollisionObject(btCollisionObject* collisionObject,short int collisionFilterGroup,short int collisionFilterMask)
-{
-
-	btAssert(collisionObject);
-
-	//check that the object isn't already added
-	btAssert( m_collisionObjects.findLinearSearch(collisionObject)  == m_collisionObjects.size());
-
-	m_collisionObjects.push_back(collisionObject);
-
-	//calculate new AABB
-	btTransform trans = collisionObject->getWorldTransform();
-
-	btVector3	minAabb;
-	btVector3	maxAabb;
-	collisionObject->getCollisionShape()->getAabb(trans,minAabb,maxAabb);
-
-	int type = collisionObject->getCollisionShape()->getShapeType();
-	collisionObject->setBroadphaseHandle( getBroadphase()->createProxy(
-		minAabb,
-		maxAabb,
-		type,
-		collisionObject,
-		collisionFilterGroup,
-		collisionFilterMask,
-		m_dispatcher1,0
-		))	;
-
-
-
-
-
-}
-
-
-
-void	btCollisionWorld::updateSingleAabb(btCollisionObject* colObj)
-{
-	btVector3 minAabb,maxAabb;
-	colObj->getCollisionShape()->getAabb(colObj->getWorldTransform(), minAabb,maxAabb);
-	//need to increase the aabb for contact thresholds
-	btVector3 contactThreshold(gContactBreakingThreshold,gContactBreakingThreshold,gContactBreakingThreshold);
-	minAabb -= contactThreshold;
-	maxAabb += contactThreshold;
-
-	if(getDispatchInfo().m_useContinuous && colObj->getInternalType()==btCollisionObject::CO_RIGID_BODY)
-	{
-		btVector3 minAabb2,maxAabb2;
-		colObj->getCollisionShape()->getAabb(colObj->getInterpolationWorldTransform(),minAabb2,maxAabb2);
-		minAabb2 -= contactThreshold;
-		maxAabb2 += contactThreshold;
-		minAabb.setMin(minAabb2);
-		maxAabb.setMax(maxAabb2);
-	}
-
-	btBroadphaseInterface* bp = (btBroadphaseInterface*)m_broadphasePairCache;
-
-	//moving objects should be moderately sized, probably something wrong if not
-	if ( colObj->isStaticObject() || ((maxAabb-minAabb).length2() < btScalar(1e12)))
-	{
-		bp->setAabb(colObj->getBroadphaseHandle(),minAabb,maxAabb, m_dispatcher1);
-	} else
-	{
-		//something went wrong, investigate
-		//this assert is unwanted in 3D modelers (danger of loosing work)
-		colObj->setActivationState(DISABLE_SIMULATION);
-
-		static bool reportMe = true;
-		if (reportMe && m_debugDrawer)
-		{
-			reportMe = false;
-			m_debugDrawer->reportErrorWarning("Overflow in AABB, object removed from simulation");
-			m_debugDrawer->reportErrorWarning("If you can reproduce this, please email bugs at continuousphysics.com\n");
-			m_debugDrawer->reportErrorWarning("Please include above information, your Platform, version of OS.\n");
-			m_debugDrawer->reportErrorWarning("Thanks.\n");
-		}
-	}
-}
-
-void	btCollisionWorld::updateAabbs()
-{
-	BT_PROFILE("updateAabbs");
-
-	btTransform predictedTrans;
-	for ( int i=0;i<m_collisionObjects.size();i++)
-	{
-		btCollisionObject* colObj = m_collisionObjects[i];
-
-		//only update aabb of active objects
-		if (m_forceUpdateAllAabbs || colObj->isActive())
-		{
-			updateSingleAabb(colObj);
-		}
-	}
-}
-
-
-
-void	btCollisionWorld::performDiscreteCollisionDetection()
-{
-	BT_PROFILE("performDiscreteCollisionDetection");
-
-	btDispatcherInfo& dispatchInfo = getDispatchInfo();
-
-	updateAabbs();
-
-	{
-		BT_PROFILE("calculateOverlappingPairs");
-		m_broadphasePairCache->calculateOverlappingPairs(m_dispatcher1);
-	}
-
-
-	btDispatcher* dispatcher = getDispatcher();
-	{
-		BT_PROFILE("dispatchAllCollisionPairs");
-		if (dispatcher)
-			dispatcher->dispatchAllCollisionPairs(m_broadphasePairCache->getOverlappingPairCache(),dispatchInfo,m_dispatcher1);
-	}
-
-}
-
-
-
-void	btCollisionWorld::removeCollisionObject(btCollisionObject* collisionObject)
-{
-
-
-	//bool removeFromBroadphase = false;
-
-	{
-
-		btBroadphaseProxy* bp = collisionObject->getBroadphaseHandle();
-		if (bp)
-		{
-			//
-			// only clear the cached algorithms
-			//
-			getBroadphase()->getOverlappingPairCache()->cleanProxyFromPairs(bp,m_dispatcher1);
-			getBroadphase()->destroyProxy(bp,m_dispatcher1);
-			collisionObject->setBroadphaseHandle(0);
-		}
-	}
-
-
-	//swapremove
-	m_collisionObjects.remove(collisionObject);
-
-}
-
-
-
-void	btCollisionWorld::rayTestSingle(const btTransform& rayFromTrans,const btTransform& rayToTrans,
-										btCollisionObject* collisionObject,
-										const btCollisionShape* collisionShape,
-										const btTransform& colObjWorldTransform,
-										RayResultCallback& resultCallback)
-{
-	btSphereShape pointShape(btScalar(0.0));
-	pointShape.setMargin(0.f);
-	const btConvexShape* castShape = &pointShape;
-
-	if (collisionShape->isConvex())
-	{
-		//		BT_PROFILE("rayTestConvex");
-		btConvexCast::CastResult castResult;
-		castResult.m_fraction = resultCallback.m_closestHitFraction;
-
-		btConvexShape* convexShape = (btConvexShape*) collisionShape;
-		btVoronoiSimplexSolver	simplexSolver;
-#define USE_SUBSIMPLEX_CONVEX_CAST 1
-#ifdef USE_SUBSIMPLEX_CONVEX_CAST
-		btSubsimplexConvexCast convexCaster(castShape,convexShape,&simplexSolver);
-#else
-		//btGjkConvexCast	convexCaster(castShape,convexShape,&simplexSolver);
-		//btContinuousConvexCollision convexCaster(castShape,convexShape,&simplexSolver,0);
-#endif //#USE_SUBSIMPLEX_CONVEX_CAST
-
-		if (convexCaster.calcTimeOfImpact(rayFromTrans,rayToTrans,colObjWorldTransform,colObjWorldTransform,castResult))
-		{
-			//add hit
-			if (castResult.m_normal.length2() > btScalar(0.0001))
-			{
-				if (castResult.m_fraction < resultCallback.m_closestHitFraction)
-				{
-#ifdef USE_SUBSIMPLEX_CONVEX_CAST
-					//rotate normal into worldspace
-					castResult.m_normal = rayFromTrans.getBasis() * castResult.m_normal;
-#endif //USE_SUBSIMPLEX_CONVEX_CAST
-
-					castResult.m_normal.normalize();
-					btCollisionWorld::LocalRayResult localRayResult
-						(
-						collisionObject,
-						0,
-						castResult.m_normal,
-						castResult.m_fraction
-						);
-
-					bool normalInWorldSpace = true;
-					resultCallback.addSingleResult(localRayResult, normalInWorldSpace);
-
-				}
-			}
-		}
-	} else {
-		if (collisionShape->isConcave())
-		{
-			//			BT_PROFILE("rayTestConcave");
-			if (collisionShape->getShapeType()==TRIANGLE_MESH_SHAPE_PROXYTYPE)
-			{
-				///optimized version for btBvhTriangleMeshShape
-				btBvhTriangleMeshShape* triangleMesh = (btBvhTriangleMeshShape*)collisionShape;
-				btTransform worldTocollisionObject = colObjWorldTransform.inverse();
-				btVector3 rayFromLocal = worldTocollisionObject * rayFromTrans.getOrigin();
-				btVector3 rayToLocal = worldTocollisionObject * rayToTrans.getOrigin();
-
-				//ConvexCast::CastResult
-				struct BridgeTriangleRaycastCallback : public btTriangleRaycastCallback
-				{
-					btCollisionWorld::RayResultCallback* m_resultCallback;
-					btCollisionObject*	m_collisionObject;
-					btTriangleMeshShape*	m_triangleMesh;
-
-					btTransform m_colObjWorldTransform;
-
-					BridgeTriangleRaycastCallback( const btVector3& from,const btVector3& to,
-						btCollisionWorld::RayResultCallback* resultCallback, btCollisionObject* collisionObject,btTriangleMeshShape*	triangleMesh,const btTransform& colObjWorldTransform):
-					//@BP Mod
-					btTriangleRaycastCallback(from,to, resultCallback->m_flags),
-						m_resultCallback(resultCallback),
-						m_collisionObject(collisionObject),
-						m_triangleMesh(triangleMesh),
-						m_colObjWorldTransform(colObjWorldTransform)
-					{
-					}
-
-
-					virtual btScalar reportHit(const btVector3& hitNormalLocal, btScalar hitFraction, int partId, int triangleIndex )
-					{
-						btCollisionWorld::LocalShapeInfo	shapeInfo;
-						shapeInfo.m_shapePart = partId;
-						shapeInfo.m_triangleIndex = triangleIndex;
-
-						btVector3 hitNormalWorld = m_colObjWorldTransform.getBasis() * hitNormalLocal;
-
-						btCollisionWorld::LocalRayResult rayResult
-							(m_collisionObject,
-							&shapeInfo,
-							hitNormalWorld,
-							hitFraction);
-
-						bool	normalInWorldSpace = true;
-						return m_resultCallback->addSingleResult(rayResult,normalInWorldSpace);
-					}
-
-				};
-
-				BridgeTriangleRaycastCallback rcb(rayFromLocal,rayToLocal,&resultCallback,collisionObject,triangleMesh,colObjWorldTransform);
-				rcb.m_hitFraction = resultCallback.m_closestHitFraction;
-				triangleMesh->performRaycast(&rcb,rayFromLocal,rayToLocal);
-			} else
-			{
-				//generic (slower) case
-				btConcaveShape* concaveShape = (btConcaveShape*)collisionShape;
-
-				btTransform worldTocollisionObject = colObjWorldTransform.inverse();
-
-				btVector3 rayFromLocal = worldTocollisionObject * rayFromTrans.getOrigin();
-				btVector3 rayToLocal = worldTocollisionObject * rayToTrans.getOrigin();
-
-				//ConvexCast::CastResult
-
-				struct BridgeTriangleRaycastCallback : public btTriangleRaycastCallback
-				{
-					btCollisionWorld::RayResultCallback* m_resultCallback;
-					btCollisionObject*	m_collisionObject;
-					btConcaveShape*	m_triangleMesh;
-
-					btTransform m_colObjWorldTransform;
-
-					BridgeTriangleRaycastCallback( const btVector3& from,const btVector3& to,
-						btCollisionWorld::RayResultCallback* resultCallback, btCollisionObject* collisionObject,btConcaveShape*	triangleMesh, const btTransform& colObjWorldTransform):
-					//@BP Mod
-					btTriangleRaycastCallback(from,to, resultCallback->m_flags),
-						m_resultCallback(resultCallback),
-						m_collisionObject(collisionObject),
-						m_triangleMesh(triangleMesh),
-						m_colObjWorldTransform(colObjWorldTransform)
-					{
-					}
-
-
-					virtual btScalar reportHit(const btVector3& hitNormalLocal, btScalar hitFraction, int partId, int triangleIndex )
-					{
-						btCollisionWorld::LocalShapeInfo	shapeInfo;
-						shapeInfo.m_shapePart = partId;
-						shapeInfo.m_triangleIndex = triangleIndex;
-
-						btVector3 hitNormalWorld = m_colObjWorldTransform.getBasis() * hitNormalLocal;
-
-						btCollisionWorld::LocalRayResult rayResult
-							(m_collisionObject,
-							&shapeInfo,
-							hitNormalWorld,
-							hitFraction);
-
-						bool	normalInWorldSpace = true;
-						return m_resultCallback->addSingleResult(rayResult,normalInWorldSpace);
-					}
-
-				};
-
-
-				BridgeTriangleRaycastCallback	rcb(rayFromLocal,rayToLocal,&resultCallback,collisionObject,concaveShape, colObjWorldTransform);
-				rcb.m_hitFraction = resultCallback.m_closestHitFraction;
-
-				btVector3 rayAabbMinLocal = rayFromLocal;
-				rayAabbMinLocal.setMin(rayToLocal);
-				btVector3 rayAabbMaxLocal = rayFromLocal;
-				rayAabbMaxLocal.setMax(rayToLocal);
-
-				concaveShape->processAllTriangles(&rcb,rayAabbMinLocal,rayAabbMaxLocal);
-			}
-		} else {
-			//			BT_PROFILE("rayTestCompound");
-			if (collisionShape->isCompound())
-			{
-				struct LocalInfoAdder2 : public RayResultCallback
-				{
-					RayResultCallback* m_userCallback;
-					int m_i;
-					
-					LocalInfoAdder2 (int i, RayResultCallback *user)
-						: m_userCallback(user), m_i(i)
-					{ 
-						m_closestHitFraction = m_userCallback->m_closestHitFraction;
-					}
-					virtual bool needsCollision(btBroadphaseProxy* p) const
-					{
-						return m_userCallback->needsCollision(p);
-					}
-
-					virtual btScalar addSingleResult (btCollisionWorld::LocalRayResult &r, bool b)
-					{
-						btCollisionWorld::LocalShapeInfo shapeInfo;
-						shapeInfo.m_shapePart = -1;
-						shapeInfo.m_triangleIndex = m_i;
-						if (r.m_localShapeInfo == NULL)
-							r.m_localShapeInfo = &shapeInfo;
-
-						const btScalar result = m_userCallback->addSingleResult(r, b);
-						m_closestHitFraction = m_userCallback->m_closestHitFraction;
-						return result;
-					}
-				};
-				
-				struct RayTester : btDbvt::ICollide
-				{
-					btCollisionObject* m_collisionObject;
-					const btCompoundShape* m_compoundShape;
-					const btTransform& m_colObjWorldTransform;
-					const btTransform& m_rayFromTrans;
-					const btTransform& m_rayToTrans;
-					RayResultCallback& m_resultCallback;
-					
-					RayTester(btCollisionObject* collisionObject,
-							const btCompoundShape* compoundShape,
-							const btTransform& colObjWorldTransform,
-							const btTransform& rayFromTrans,
-							const btTransform& rayToTrans,
-							RayResultCallback& resultCallback):
-						m_collisionObject(collisionObject),
-						m_compoundShape(compoundShape),
-						m_colObjWorldTransform(colObjWorldTransform),
-						m_rayFromTrans(rayFromTrans),
-						m_rayToTrans(rayToTrans),
-						m_resultCallback(resultCallback)
-					{
-						
-					}
-					
-					void Process(int i)
-					{
-						const btCollisionShape* childCollisionShape = m_compoundShape->getChildShape(i);
-						const btTransform& childTrans = m_compoundShape->getChildTransform(i);
-						btTransform childWorldTrans = m_colObjWorldTransform * childTrans;
-						
-						// replace collision shape so that callback can determine the triangle
-						btCollisionShape* saveCollisionShape = m_collisionObject->getCollisionShape();
-						m_collisionObject->internalSetTemporaryCollisionShape((btCollisionShape*)childCollisionShape);
-
-						LocalInfoAdder2 my_cb(i, &m_resultCallback);
-
-						rayTestSingle(
-							m_rayFromTrans,
-							m_rayToTrans,
-							m_collisionObject,
-							childCollisionShape,
-							childWorldTrans,
-							my_cb);
-						
-						// restore
-						m_collisionObject->internalSetTemporaryCollisionShape(saveCollisionShape);
-					}
-					
-					void Process(const btDbvtNode* leaf)
-					{
-						Process(leaf->dataAsInt);
-					}
-				};
-				
-				const btCompoundShape* compoundShape = static_cast<const btCompoundShape*>(collisionShape);
-				const btDbvt* dbvt = compoundShape->getDynamicAabbTree();
-
-
-				RayTester rayCB(
-					collisionObject,
-					compoundShape,
-					colObjWorldTransform,
-					rayFromTrans,
-					rayToTrans,
-					resultCallback);
-#ifndef	DISABLE_DBVT_COMPOUNDSHAPE_RAYCAST_ACCELERATION
-				if (dbvt)
-				{
-					btVector3 localRayFrom = colObjWorldTransform.inverseTimes(rayFromTrans).getOrigin();
-					btVector3 localRayTo = colObjWorldTransform.inverseTimes(rayToTrans).getOrigin();
-					btDbvt::rayTest(dbvt->m_root, localRayFrom , localRayTo, rayCB);
-				}
-				else
-#endif //DISABLE_DBVT_COMPOUNDSHAPE_RAYCAST_ACCELERATION
-				{
-					for (int i = 0, n = compoundShape->getNumChildShapes(); i < n; ++i)
-					{
-						rayCB.Process(i);
-					}	
-				}
-			}
-		}
-	}
-}
-
-void	btCollisionWorld::objectQuerySingle(const btConvexShape* castShape,const btTransform& convexFromTrans,const btTransform& convexToTrans,
-											btCollisionObject* collisionObject,
-											const btCollisionShape* collisionShape,
-											const btTransform& colObjWorldTransform,
-											ConvexResultCallback& resultCallback, btScalar allowedPenetration)
-{
-	if (collisionShape->isConvex())
-	{
-		//BT_PROFILE("convexSweepConvex");
-		btConvexCast::CastResult castResult;
-		castResult.m_allowedPenetration = allowedPenetration;
-		castResult.m_fraction = resultCallback.m_closestHitFraction;//btScalar(1.);//??
-
-		btConvexShape* convexShape = (btConvexShape*) collisionShape;
-		btVoronoiSimplexSolver	simplexSolver;
-		btGjkEpaPenetrationDepthSolver	gjkEpaPenetrationSolver;
-
-		btContinuousConvexCollision convexCaster1(castShape,convexShape,&simplexSolver,&gjkEpaPenetrationSolver);
-		//btGjkConvexCast convexCaster2(castShape,convexShape,&simplexSolver);
-		//btSubsimplexConvexCast convexCaster3(castShape,convexShape,&simplexSolver);
-
-		btConvexCast* castPtr = &convexCaster1;
-
-
-
-		if (castPtr->calcTimeOfImpact(convexFromTrans,convexToTrans,colObjWorldTransform,colObjWorldTransform,castResult))
-		{
-			//add hit
-			if (castResult.m_normal.length2() > btScalar(0.0001))
-			{
-				if (castResult.m_fraction < resultCallback.m_closestHitFraction)
-				{
-					castResult.m_normal.normalize();
-					btCollisionWorld::LocalConvexResult localConvexResult
-						(
-						collisionObject,
-						0,
-						castResult.m_normal,
-						castResult.m_hitPoint,
-						castResult.m_fraction
-						);
-
-					bool normalInWorldSpace = true;
-					resultCallback.addSingleResult(localConvexResult, normalInWorldSpace);
-
-				}
-			}
-		}
-	} else {
-		if (collisionShape->isConcave())
-		{
-			if (collisionShape->getShapeType()==TRIANGLE_MESH_SHAPE_PROXYTYPE)
-			{
-				//BT_PROFILE("convexSweepbtBvhTriangleMesh");
-				btBvhTriangleMeshShape* triangleMesh = (btBvhTriangleMeshShape*)collisionShape;
-				btTransform worldTocollisionObject = colObjWorldTransform.inverse();
-				btVector3 convexFromLocal = worldTocollisionObject * convexFromTrans.getOrigin();
-				btVector3 convexToLocal = worldTocollisionObject * convexToTrans.getOrigin();
-				// rotation of box in local mesh space = MeshRotation^-1 * ConvexToRotation
-				btTransform rotationXform = btTransform(worldTocollisionObject.getBasis() * convexToTrans.getBasis());
-
-				//ConvexCast::CastResult
-				struct BridgeTriangleConvexcastCallback : public btTriangleConvexcastCallback
-				{
-					btCollisionWorld::ConvexResultCallback* m_resultCallback;
-					btCollisionObject*	m_collisionObject;
-					btTriangleMeshShape*	m_triangleMesh;
-
-					BridgeTriangleConvexcastCallback(const btConvexShape* castShape, const btTransform& from,const btTransform& to,
-						btCollisionWorld::ConvexResultCallback* resultCallback, btCollisionObject* collisionObject,btTriangleMeshShape*	triangleMesh, const btTransform& triangleToWorld):
-					btTriangleConvexcastCallback(castShape, from,to, triangleToWorld, triangleMesh->getMargin()),
-						m_resultCallback(resultCallback),
-						m_collisionObject(collisionObject),
-						m_triangleMesh(triangleMesh)
-					{
-					}
-
-
-					virtual btScalar reportHit(const btVector3& hitNormalLocal, const btVector3& hitPointLocal, btScalar hitFraction, int partId, int triangleIndex )
-					{
-						btCollisionWorld::LocalShapeInfo	shapeInfo;
-						shapeInfo.m_shapePart = partId;
-						shapeInfo.m_triangleIndex = triangleIndex;
-						if (hitFraction <= m_resultCallback->m_closestHitFraction)
-						{
-
-							btCollisionWorld::LocalConvexResult convexResult
-								(m_collisionObject,
-								&shapeInfo,
-								hitNormalLocal,
-								hitPointLocal,
-								hitFraction);
-
-							bool	normalInWorldSpace = true;
-
-
-							return m_resultCallback->addSingleResult(convexResult,normalInWorldSpace);
-						}
-						return hitFraction;
-					}
-
-				};
-
-				BridgeTriangleConvexcastCallback tccb(castShape, convexFromTrans,convexToTrans,&resultCallback,collisionObject,triangleMesh, colObjWorldTransform);
-				tccb.m_hitFraction = resultCallback.m_closestHitFraction;
-				tccb.m_allowedPenetration = allowedPenetration;
-				btVector3 boxMinLocal, boxMaxLocal;
-				castShape->getAabb(rotationXform, boxMinLocal, boxMaxLocal);
-				triangleMesh->performConvexcast(&tccb,convexFromLocal,convexToLocal,boxMinLocal, boxMaxLocal);
-			} else
-			{
-				if (collisionShape->getShapeType()==STATIC_PLANE_PROXYTYPE)
-				{
-					btConvexCast::CastResult castResult;
-					castResult.m_allowedPenetration = allowedPenetration;
-					castResult.m_fraction = resultCallback.m_closestHitFraction;
-					btStaticPlaneShape* planeShape = (btStaticPlaneShape*) collisionShape;
-					btContinuousConvexCollision convexCaster1(castShape,planeShape);
-					btConvexCast* castPtr = &convexCaster1;
-
-					if (castPtr->calcTimeOfImpact(convexFromTrans,convexToTrans,colObjWorldTransform,colObjWorldTransform,castResult))
-					{
-						//add hit
-						if (castResult.m_normal.length2() > btScalar(0.0001))
-						{
-							if (castResult.m_fraction < resultCallback.m_closestHitFraction)
-							{
-								castResult.m_normal.normalize();
-								btCollisionWorld::LocalConvexResult localConvexResult
-									(
-									collisionObject,
-									0,
-									castResult.m_normal,
-									castResult.m_hitPoint,
-									castResult.m_fraction
-									);
-
-								bool normalInWorldSpace = true;
-								resultCallback.addSingleResult(localConvexResult, normalInWorldSpace);
-							}
-						}
-					}
-
-				} else
-				{
-					//BT_PROFILE("convexSweepConcave");
-					btConcaveShape* concaveShape = (btConcaveShape*)collisionShape;
-					btTransform worldTocollisionObject = colObjWorldTransform.inverse();
-					btVector3 convexFromLocal = worldTocollisionObject * convexFromTrans.getOrigin();
-					btVector3 convexToLocal = worldTocollisionObject * convexToTrans.getOrigin();
-					// rotation of box in local mesh space = MeshRotation^-1 * ConvexToRotation
-					btTransform rotationXform = btTransform(worldTocollisionObject.getBasis() * convexToTrans.getBasis());
-
-					//ConvexCast::CastResult
-					struct BridgeTriangleConvexcastCallback : public btTriangleConvexcastCallback
-					{
-						btCollisionWorld::ConvexResultCallback* m_resultCallback;
-						btCollisionObject*	m_collisionObject;
-						btConcaveShape*	m_triangleMesh;
-
-						BridgeTriangleConvexcastCallback(const btConvexShape* castShape, const btTransform& from,const btTransform& to,
-							btCollisionWorld::ConvexResultCallback* resultCallback, btCollisionObject* collisionObject,btConcaveShape*	triangleMesh, const btTransform& triangleToWorld):
-						btTriangleConvexcastCallback(castShape, from,to, triangleToWorld, triangleMesh->getMargin()),
-							m_resultCallback(resultCallback),
-							m_collisionObject(collisionObject),
-							m_triangleMesh(triangleMesh)
-						{
-						}
-
-
-						virtual btScalar reportHit(const btVector3& hitNormalLocal, const btVector3& hitPointLocal, btScalar hitFraction, int partId, int triangleIndex )
-						{
-							btCollisionWorld::LocalShapeInfo	shapeInfo;
-							shapeInfo.m_shapePart = partId;
-							shapeInfo.m_triangleIndex = triangleIndex;
-							if (hitFraction <= m_resultCallback->m_closestHitFraction)
-							{
-
-								btCollisionWorld::LocalConvexResult convexResult
-									(m_collisionObject,
-									&shapeInfo,
-									hitNormalLocal,
-									hitPointLocal,
-									hitFraction);
-
-								bool	normalInWorldSpace = false;
-
-								return m_resultCallback->addSingleResult(convexResult,normalInWorldSpace);
-							}
-							return hitFraction;
-						}
-
-					};
-
-					BridgeTriangleConvexcastCallback tccb(castShape, convexFromTrans,convexToTrans,&resultCallback,collisionObject,concaveShape, colObjWorldTransform);
-					tccb.m_hitFraction = resultCallback.m_closestHitFraction;
-					tccb.m_allowedPenetration = allowedPenetration;
-					btVector3 boxMinLocal, boxMaxLocal;
-					castShape->getAabb(rotationXform, boxMinLocal, boxMaxLocal);
-
-					btVector3 rayAabbMinLocal = convexFromLocal;
-					rayAabbMinLocal.setMin(convexToLocal);
-					btVector3 rayAabbMaxLocal = convexFromLocal;
-					rayAabbMaxLocal.setMax(convexToLocal);
-					rayAabbMinLocal += boxMinLocal;
-					rayAabbMaxLocal += boxMaxLocal;
-					concaveShape->processAllTriangles(&tccb,rayAabbMinLocal,rayAabbMaxLocal);
-				}
-			}
-		} else {
-			///@todo : use AABB tree or other BVH acceleration structure!
-			if (collisionShape->isCompound())
-			{
-				BT_PROFILE("convexSweepCompound");
-				const btCompoundShape* compoundShape = static_cast<const btCompoundShape*>(collisionShape);
-				int i=0;
-				for (i=0;i<compoundShape->getNumChildShapes();i++)
-				{
-					btTransform childTrans = compoundShape->getChildTransform(i);
-					const btCollisionShape* childCollisionShape = compoundShape->getChildShape(i);
-					btTransform childWorldTrans = colObjWorldTransform * childTrans;
-					// replace collision shape so that callback can determine the triangle
-					btCollisionShape* saveCollisionShape = collisionObject->getCollisionShape();
-					collisionObject->internalSetTemporaryCollisionShape((btCollisionShape*)childCollisionShape);
-                    struct	LocalInfoAdder : public ConvexResultCallback {
-                            ConvexResultCallback* m_userCallback;
-							int m_i;
-
-                            LocalInfoAdder (int i, ConvexResultCallback *user)
-								: m_userCallback(user), m_i(i)
-							{
-								m_closestHitFraction = m_userCallback->m_closestHitFraction;
-							}
-							virtual bool needsCollision(btBroadphaseProxy* p) const
-							{
-								return m_userCallback->needsCollision(p);
-							}
-                            virtual btScalar addSingleResult (btCollisionWorld::LocalConvexResult&	r,	bool b)
-                            {
-                                    btCollisionWorld::LocalShapeInfo	shapeInfo;
-                                    shapeInfo.m_shapePart = -1;
-                                    shapeInfo.m_triangleIndex = m_i;
-                                    if (r.m_localShapeInfo == NULL)
-                                        r.m_localShapeInfo = &shapeInfo;
-									const btScalar result = m_userCallback->addSingleResult(r, b);
-									m_closestHitFraction = m_userCallback->m_closestHitFraction;
-									return result;
-                                    
-                            }
-                    };
-
-                    LocalInfoAdder my_cb(i, &resultCallback);
-					
-
-					objectQuerySingle(castShape, convexFromTrans,convexToTrans,
-						collisionObject,
-						childCollisionShape,
-						childWorldTrans,
-						my_cb, allowedPenetration);
-					// restore
-					collisionObject->internalSetTemporaryCollisionShape(saveCollisionShape);
-				}
-			}
-		}
-	}
-}
-
-
-struct btSingleRayCallback : public btBroadphaseRayCallback
-{
-
-	btVector3	m_rayFromWorld;
-	btVector3	m_rayToWorld;
-	btTransform	m_rayFromTrans;
-	btTransform	m_rayToTrans;
-	btVector3	m_hitNormal;
-
-	const btCollisionWorld*	m_world;
-	btCollisionWorld::RayResultCallback&	m_resultCallback;
-
-	btSingleRayCallback(const btVector3& rayFromWorld,const btVector3& rayToWorld,const btCollisionWorld* world,btCollisionWorld::RayResultCallback& resultCallback)
-		:m_rayFromWorld(rayFromWorld),
-		m_rayToWorld(rayToWorld),
-		m_world(world),
-		m_resultCallback(resultCallback)
-	{
-		m_rayFromTrans.setIdentity();
-		m_rayFromTrans.setOrigin(m_rayFromWorld);
-		m_rayToTrans.setIdentity();
-		m_rayToTrans.setOrigin(m_rayToWorld);
-
-		btVector3 rayDir = (rayToWorld-rayFromWorld);
-
-		rayDir.normalize ();
-		///what about division by zero? --> just set rayDirection[i] to INF/BT_LARGE_FLOAT
-		m_rayDirectionInverse[0] = rayDir[0] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[0];
-		m_rayDirectionInverse[1] = rayDir[1] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[1];
-		m_rayDirectionInverse[2] = rayDir[2] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[2];
-		m_signs[0] = m_rayDirectionInverse[0] < 0.0;
-		m_signs[1] = m_rayDirectionInverse[1] < 0.0;
-		m_signs[2] = m_rayDirectionInverse[2] < 0.0;
-
-		m_lambda_max = rayDir.dot(m_rayToWorld-m_rayFromWorld);
-
-	}
-
-
-
-	virtual bool	process(const btBroadphaseProxy* proxy)
-	{
-		///terminate further ray tests, once the closestHitFraction reached zero
-		if (m_resultCallback.m_closestHitFraction == btScalar(0.f))
-			return false;
-
-		btCollisionObject*	collisionObject = (btCollisionObject*)proxy->m_clientObject;
-
-		//only perform raycast if filterMask matches
-		if(m_resultCallback.needsCollision(collisionObject->getBroadphaseHandle())) 
-		{
-			//RigidcollisionObject* collisionObject = ctrl->GetRigidcollisionObject();
-			//btVector3 collisionObjectAabbMin,collisionObjectAabbMax;
-#if 0
-#ifdef RECALCULATE_AABB
-			btVector3 collisionObjectAabbMin,collisionObjectAabbMax;
-			collisionObject->getCollisionShape()->getAabb(collisionObject->getWorldTransform(),collisionObjectAabbMin,collisionObjectAabbMax);
-#else
-			//getBroadphase()->getAabb(collisionObject->getBroadphaseHandle(),collisionObjectAabbMin,collisionObjectAabbMax);
-			const btVector3& collisionObjectAabbMin = collisionObject->getBroadphaseHandle()->m_aabbMin;
-			const btVector3& collisionObjectAabbMax = collisionObject->getBroadphaseHandle()->m_aabbMax;
-#endif
-#endif
-			//btScalar hitLambda = m_resultCallback.m_closestHitFraction;
-			//culling already done by broadphase
-			//if (btRayAabb(m_rayFromWorld,m_rayToWorld,collisionObjectAabbMin,collisionObjectAabbMax,hitLambda,m_hitNormal))
-			{
-				m_world->rayTestSingle(m_rayFromTrans,m_rayToTrans,
-					collisionObject,
-					collisionObject->getCollisionShape(),
-					collisionObject->getWorldTransform(),
-					m_resultCallback);
-			}
-		}
-		return true;
-	}
-};
-
-void	btCollisionWorld::rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback) const
-{
-	//BT_PROFILE("rayTest");
-	/// use the broadphase to accelerate the search for objects, based on their aabb
-	/// and for each object with ray-aabb overlap, perform an exact ray test
-	btSingleRayCallback rayCB(rayFromWorld,rayToWorld,this,resultCallback);
-
-#ifndef USE_BRUTEFORCE_RAYBROADPHASE
-	m_broadphasePairCache->rayTest(rayFromWorld,rayToWorld,rayCB);
-#else
-	for (int i=0;i<this->getNumCollisionObjects();i++)
-	{
-		rayCB.process(m_collisionObjects[i]->getBroadphaseHandle());
-	}	
-#endif //USE_BRUTEFORCE_RAYBROADPHASE
-
-}
-
-
-struct btSingleSweepCallback : public btBroadphaseRayCallback
-{
-
-	btTransform	m_convexFromTrans;
-	btTransform	m_convexToTrans;
-	btVector3	m_hitNormal;
-	const btCollisionWorld*	m_world;
-	btCollisionWorld::ConvexResultCallback&	m_resultCallback;
-	btScalar	m_allowedCcdPenetration;
-	const btConvexShape* m_castShape;
-
-
-	btSingleSweepCallback(const btConvexShape* castShape, const btTransform& convexFromTrans,const btTransform& convexToTrans,const btCollisionWorld* world,btCollisionWorld::ConvexResultCallback& resultCallback,btScalar allowedPenetration)
-		:m_convexFromTrans(convexFromTrans),
-		m_convexToTrans(convexToTrans),
-		m_world(world),
-		m_resultCallback(resultCallback),
-		m_allowedCcdPenetration(allowedPenetration),
-		m_castShape(castShape)
-	{
-		btVector3 unnormalizedRayDir = (m_convexToTrans.getOrigin()-m_convexFromTrans.getOrigin());
-		btVector3 rayDir = unnormalizedRayDir.normalized();
-		///what about division by zero? --> just set rayDirection[i] to INF/BT_LARGE_FLOAT
-		m_rayDirectionInverse[0] = rayDir[0] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[0];
-		m_rayDirectionInverse[1] = rayDir[1] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[1];
-		m_rayDirectionInverse[2] = rayDir[2] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[2];
-		m_signs[0] = m_rayDirectionInverse[0] < 0.0;
-		m_signs[1] = m_rayDirectionInverse[1] < 0.0;
-		m_signs[2] = m_rayDirectionInverse[2] < 0.0;
-
-		m_lambda_max = rayDir.dot(unnormalizedRayDir);
-
-	}
-
-	virtual bool	process(const btBroadphaseProxy* proxy)
-	{
-		///terminate further convex sweep tests, once the closestHitFraction reached zero
-		if (m_resultCallback.m_closestHitFraction == btScalar(0.f))
-			return false;
-
-		btCollisionObject*	collisionObject = (btCollisionObject*)proxy->m_clientObject;
-
-		//only perform raycast if filterMask matches
-		if(m_resultCallback.needsCollision(collisionObject->getBroadphaseHandle())) {
-			//RigidcollisionObject* collisionObject = ctrl->GetRigidcollisionObject();
-			m_world->objectQuerySingle(m_castShape, m_convexFromTrans,m_convexToTrans,
-				collisionObject,
-				collisionObject->getCollisionShape(),
-				collisionObject->getWorldTransform(),
-				m_resultCallback,
-				m_allowedCcdPenetration);
-		}
-
-		return true;
-	}
-};
-
-
-
-void	btCollisionWorld::convexSweepTest(const btConvexShape* castShape, const btTransform& convexFromWorld, const btTransform& convexToWorld, ConvexResultCallback& resultCallback, btScalar allowedCcdPenetration) const
-{
-
-	BT_PROFILE("convexSweepTest");
-	/// use the broadphase to accelerate the search for objects, based on their aabb
-	/// and for each object with ray-aabb overlap, perform an exact ray test
-	/// unfortunately the implementation for rayTest and convexSweepTest duplicated, albeit practically identical
-
-
-
-	btTransform	convexFromTrans,convexToTrans;
-	convexFromTrans = convexFromWorld;
-	convexToTrans = convexToWorld;
-	btVector3 castShapeAabbMin, castShapeAabbMax;
-	/* Compute AABB that encompasses angular movement */
-	{
-		btVector3 linVel, angVel;
-		btTransformUtil::calculateVelocity (convexFromTrans, convexToTrans, 1.0, linVel, angVel);
-		btVector3 zeroLinVel;
-		zeroLinVel.setValue(0,0,0);
-		btTransform R;
-		R.setIdentity ();
-		R.setRotation (convexFromTrans.getRotation());
-		castShape->calculateTemporalAabb (R, zeroLinVel, angVel, 1.0, castShapeAabbMin, castShapeAabbMax);
-	}
-
-#ifndef USE_BRUTEFORCE_RAYBROADPHASE
-
-	btSingleSweepCallback	convexCB(castShape,convexFromWorld,convexToWorld,this,resultCallback,allowedCcdPenetration);
-
-	m_broadphasePairCache->rayTest(convexFromTrans.getOrigin(),convexToTrans.getOrigin(),convexCB,castShapeAabbMin,castShapeAabbMax);
-
-#else
-	/// go over all objects, and if the ray intersects their aabb + cast shape aabb,
-	// do a ray-shape query using convexCaster (CCD)
-	int i;
-	for (i=0;i<m_collisionObjects.size();i++)
-	{
-		btCollisionObject*	collisionObject= m_collisionObjects[i];
-		//only perform raycast if filterMask matches
-		if(resultCallback.needsCollision(collisionObject->getBroadphaseHandle())) {
-			//RigidcollisionObject* collisionObject = ctrl->GetRigidcollisionObject();
-			btVector3 collisionObjectAabbMin,collisionObjectAabbMax;
-			collisionObject->getCollisionShape()->getAabb(collisionObject->getWorldTransform(),collisionObjectAabbMin,collisionObjectAabbMax);
-			AabbExpand (collisionObjectAabbMin, collisionObjectAabbMax, castShapeAabbMin, castShapeAabbMax);
-			btScalar hitLambda = btScalar(1.); //could use resultCallback.m_closestHitFraction, but needs testing
-			btVector3 hitNormal;
-			if (btRayAabb(convexFromWorld.getOrigin(),convexToWorld.getOrigin(),collisionObjectAabbMin,collisionObjectAabbMax,hitLambda,hitNormal))
-			{
-				objectQuerySingle(castShape, convexFromTrans,convexToTrans,
-					collisionObject,
-					collisionObject->getCollisionShape(),
-					collisionObject->getWorldTransform(),
-					resultCallback,
-					allowedCcdPenetration);
-			}
-		}
-	}
-#endif //USE_BRUTEFORCE_RAYBROADPHASE
-}
-
-
-
-struct btBridgedManifoldResult : public btManifoldResult
-{
-
-	btCollisionWorld::ContactResultCallback&	m_resultCallback;
-
-	btBridgedManifoldResult( btCollisionObject* obj0,btCollisionObject* obj1,btCollisionWorld::ContactResultCallback& resultCallback )
-		:btManifoldResult(obj0,obj1),
-		m_resultCallback(resultCallback)
-	{
-	}
-
-	virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)
-	{
-		bool isSwapped = m_manifoldPtr->getBody0() != m_body0;
-		btVector3 pointA = pointInWorld + normalOnBInWorld * depth;
-		btVector3 localA;
-		btVector3 localB;
-		if (isSwapped)
-		{
-			localA = m_rootTransB.invXform(pointA );
-			localB = m_rootTransA.invXform(pointInWorld);
-		} else
-		{
-			localA = m_rootTransA.invXform(pointA );
-			localB = m_rootTransB.invXform(pointInWorld);
-		}
-		
-		btManifoldPoint newPt(localA,localB,normalOnBInWorld,depth);
-		newPt.m_positionWorldOnA = pointA;
-		newPt.m_positionWorldOnB = pointInWorld;
-		
-	   //BP mod, store contact triangles.
-		if (isSwapped)
-		{
-			newPt.m_partId0 = m_partId1;
-			newPt.m_partId1 = m_partId0;
-			newPt.m_index0  = m_index1;
-			newPt.m_index1  = m_index0;
-		} else
-		{
-			newPt.m_partId0 = m_partId0;
-			newPt.m_partId1 = m_partId1;
-			newPt.m_index0  = m_index0;
-			newPt.m_index1  = m_index1;
-		}
-
-		//experimental feature info, for per-triangle material etc.
-		btCollisionObject* obj0 = isSwapped? m_body1 : m_body0;
-		btCollisionObject* obj1 = isSwapped? m_body0 : m_body1;
-		m_resultCallback.addSingleResult(newPt,obj0,newPt.m_partId0,newPt.m_index0,obj1,newPt.m_partId1,newPt.m_index1);
-
-	}
-	
-};
-
-
-
-struct btSingleContactCallback : public btBroadphaseAabbCallback
-{
-
-	btCollisionObject* m_collisionObject;
-	btCollisionWorld*	m_world;
-	btCollisionWorld::ContactResultCallback&	m_resultCallback;
-	
-	
-	btSingleContactCallback(btCollisionObject* collisionObject, btCollisionWorld* world,btCollisionWorld::ContactResultCallback& resultCallback)
-		:m_collisionObject(collisionObject),
-		m_world(world),
-		m_resultCallback(resultCallback)
-	{
-	}
-
-	virtual bool	process(const btBroadphaseProxy* proxy)
-	{
-		btCollisionObject*	collisionObject = (btCollisionObject*)proxy->m_clientObject;
-		if (collisionObject == m_collisionObject)
-			return true;
-
-		//only perform raycast if filterMask matches
-		if(m_resultCallback.needsCollision(collisionObject->getBroadphaseHandle())) 
-		{
-			btCollisionAlgorithm* algorithm = m_world->getDispatcher()->findAlgorithm(m_collisionObject,collisionObject);
-			if (algorithm)
-			{
-				btBridgedManifoldResult contactPointResult(m_collisionObject,collisionObject, m_resultCallback);
-				//discrete collision detection query
-				algorithm->processCollision(m_collisionObject,collisionObject, m_world->getDispatchInfo(),&contactPointResult);
-
-				algorithm->~btCollisionAlgorithm();
-				m_world->getDispatcher()->freeCollisionAlgorithm(algorithm);
-			}
-		}
-		return true;
-	}
-};
-
-
-///contactTest performs a discrete collision test against all objects in the btCollisionWorld, and calls the resultCallback.
-///it reports one or more contact points for every overlapping object (including the one with deepest penetration)
-void	btCollisionWorld::contactTest( btCollisionObject* colObj, ContactResultCallback& resultCallback)
-{
-	btVector3 aabbMin,aabbMax;
-	colObj->getCollisionShape()->getAabb(colObj->getWorldTransform(),aabbMin,aabbMax);
-	btSingleContactCallback	contactCB(colObj,this,resultCallback);
-	
-	m_broadphasePairCache->aabbTest(aabbMin,aabbMax,contactCB);
-}
-
-
-///contactTest performs a discrete collision test between two collision objects and calls the resultCallback if overlap if detected.
-///it reports one or more contact points (including the one with deepest penetration)
-void	btCollisionWorld::contactPairTest(btCollisionObject* colObjA, btCollisionObject* colObjB, ContactResultCallback& resultCallback)
-{
-	btCollisionAlgorithm* algorithm = getDispatcher()->findAlgorithm(colObjA,colObjB);
-	if (algorithm)
-	{
-		btBridgedManifoldResult contactPointResult(colObjA,colObjB, resultCallback);
-		//discrete collision detection query
-		algorithm->processCollision(colObjA,colObjB, getDispatchInfo(),&contactPointResult);
-
-		algorithm->~btCollisionAlgorithm();
-		getDispatcher()->freeCollisionAlgorithm(algorithm);
-	}
-
-}
-
-
-
-
-class DebugDrawcallback : public btTriangleCallback, public btInternalTriangleIndexCallback
-{
-	btIDebugDraw*	m_debugDrawer;
-	btVector3	m_color;
-	btTransform	m_worldTrans;
-
-public:
-
-	DebugDrawcallback(btIDebugDraw*	debugDrawer,const btTransform& worldTrans,const btVector3& color) :
-	  m_debugDrawer(debugDrawer),
-		  m_color(color),
-		  m_worldTrans(worldTrans)
-	  {
-	  }
-
-	  virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int  triangleIndex)
-	  {
-		  processTriangle(triangle,partId,triangleIndex);
-	  }
-
-	  virtual void processTriangle(btVector3* triangle,int partId, int triangleIndex)
-	  {
-		  (void)partId;
-		  (void)triangleIndex;
-
-		  btVector3 wv0,wv1,wv2;
-		  wv0 = m_worldTrans*triangle[0];
-		  wv1 = m_worldTrans*triangle[1];
-		  wv2 = m_worldTrans*triangle[2];
-		  btVector3 center = (wv0+wv1+wv2)*btScalar(1./3.);
-
-		  btVector3 normal = (wv1-wv0).cross(wv2-wv0);
-		  normal.normalize();
-		  btVector3 normalColor(1,1,0);
-		  m_debugDrawer->drawLine(center,center+normal,normalColor);
-
-
-
-		 
-		  m_debugDrawer->drawLine(wv0,wv1,m_color);
-		  m_debugDrawer->drawLine(wv1,wv2,m_color);
-		  m_debugDrawer->drawLine(wv2,wv0,m_color);
-	  }
-};
-
-
-void btCollisionWorld::debugDrawObject(const btTransform& worldTransform, const btCollisionShape* shape, const btVector3& color)
-{
-	// Draw a small simplex at the center of the object
-	getDebugDrawer()->drawTransform(worldTransform,1);
-
-	if (shape->getShapeType() == COMPOUND_SHAPE_PROXYTYPE)
-	{
-		const btCompoundShape* compoundShape = static_cast<const btCompoundShape*>(shape);
-		for (int i=compoundShape->getNumChildShapes()-1;i>=0;i--)
-		{
-			btTransform childTrans = compoundShape->getChildTransform(i);
-			const btCollisionShape* colShape = compoundShape->getChildShape(i);
-			debugDrawObject(worldTransform*childTrans,colShape,color);
-		}
-
-	} else
-	{
-		switch (shape->getShapeType())
-		{
-
-		case BOX_SHAPE_PROXYTYPE:
-			{
-				const btBoxShape* boxShape = static_cast<const btBoxShape*>(shape);
-				btVector3 halfExtents = boxShape->getHalfExtentsWithMargin();
-				getDebugDrawer()->drawBox(-halfExtents,halfExtents,worldTransform,color);
-				break;
-			}
-
-		case SPHERE_SHAPE_PROXYTYPE:
-			{
-				const btSphereShape* sphereShape = static_cast<const btSphereShape*>(shape);
-				btScalar radius = sphereShape->getMargin();//radius doesn't include the margin, so draw with margin
-
-				getDebugDrawer()->drawSphere(radius, worldTransform, color);
-				break;
-			}
-		case MULTI_SPHERE_SHAPE_PROXYTYPE:
-			{
-				const btMultiSphereShape* multiSphereShape = static_cast<const btMultiSphereShape*>(shape);
-
-				btTransform childTransform;
-				childTransform.setIdentity();
-
-				for (int i = multiSphereShape->getSphereCount()-1; i>=0;i--)
-				{
-					childTransform.setOrigin(multiSphereShape->getSpherePosition(i));
-					getDebugDrawer()->drawSphere(multiSphereShape->getSphereRadius(i), worldTransform*childTransform, color);
-				}
-
-				break;
-			}
-		case CAPSULE_SHAPE_PROXYTYPE:
-			{
-				const btCapsuleShape* capsuleShape = static_cast<const btCapsuleShape*>(shape);
-
-				btScalar radius = capsuleShape->getRadius();
-				btScalar halfHeight = capsuleShape->getHalfHeight();
-
-				int upAxis = capsuleShape->getUpAxis();
-				getDebugDrawer()->drawCapsule(radius, halfHeight, upAxis, worldTransform, color);
-				break;
-			}
-		case CONE_SHAPE_PROXYTYPE:
-			{
-				const btConeShape* coneShape = static_cast<const btConeShape*>(shape);
-				btScalar radius = coneShape->getRadius();//+coneShape->getMargin();
-				btScalar height = coneShape->getHeight();//+coneShape->getMargin();
-
-				int upAxis= coneShape->getConeUpIndex();
-				getDebugDrawer()->drawCone(radius, height, upAxis, worldTransform, color);
-				break;
-
-			}
-		case CYLINDER_SHAPE_PROXYTYPE:
-			{
-				const btCylinderShape* cylinder = static_cast<const btCylinderShape*>(shape);
-				int upAxis = cylinder->getUpAxis();
-				btScalar radius = cylinder->getRadius();
-				btScalar halfHeight = cylinder->getHalfExtentsWithMargin()[upAxis];
-				getDebugDrawer()->drawCylinder(radius, halfHeight, upAxis, worldTransform, color);
-				break;
-			}
-
-		case STATIC_PLANE_PROXYTYPE:
-			{
-				const btStaticPlaneShape* staticPlaneShape = static_cast<const btStaticPlaneShape*>(shape);
-				btScalar planeConst = staticPlaneShape->getPlaneConstant();
-				const btVector3& planeNormal = staticPlaneShape->getPlaneNormal();
-				getDebugDrawer()->drawPlane(planeNormal, planeConst,worldTransform, color);
-				break;
-
-			}
-		default:
-			{
-
-				if (shape->isConcave())
-				{
-					btConcaveShape* concaveMesh = (btConcaveShape*) shape;
-
-					///@todo pass camera, for some culling? no -> we are not a graphics lib
-					btVector3 aabbMax(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
-					btVector3 aabbMin(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT));
-
-					DebugDrawcallback drawCallback(getDebugDrawer(),worldTransform,color);
-					concaveMesh->processAllTriangles(&drawCallback,aabbMin,aabbMax);
-
-				}
-
-				if (shape->getShapeType() == CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE)
-				{
-					btConvexTriangleMeshShape* convexMesh = (btConvexTriangleMeshShape*) shape;
-					//todo: pass camera for some culling			
-					btVector3 aabbMax(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
-					btVector3 aabbMin(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT));
-					//DebugDrawcallback drawCallback;
-					DebugDrawcallback drawCallback(getDebugDrawer(),worldTransform,color);
-					convexMesh->getMeshInterface()->InternalProcessAllTriangles(&drawCallback,aabbMin,aabbMax);
-				}
-
-
-				/// for polyhedral shapes
-				if (shape->isPolyhedral())
-				{
-					btPolyhedralConvexShape* polyshape = (btPolyhedralConvexShape*) shape;
-
-					int i;
-					if (polyshape->getConvexPolyhedron())
-					{
-						const btConvexPolyhedron* poly = polyshape->getConvexPolyhedron();
-						for (i=0;i<poly->m_faces.size();i++)
-						{
-							btVector3 centroid(0,0,0);
-							int numVerts = poly->m_faces[i].m_indices.size();
-							if (numVerts)
-							{
-								int lastV = poly->m_faces[i].m_indices[numVerts-1];
-								for (int v=0;v<poly->m_faces[i].m_indices.size();v++)
-								{
-									int curVert = poly->m_faces[i].m_indices[v];
-									centroid+=poly->m_vertices[curVert];
-									getDebugDrawer()->drawLine(worldTransform*poly->m_vertices[lastV],worldTransform*poly->m_vertices[curVert],color);
-									lastV = curVert;
-								}
-							}
-							centroid*= 1./btScalar(numVerts);
-
-							btVector3 normalColor(1,1,0);
-							btVector3 faceNormal(poly->m_faces[i].m_plane[0],poly->m_faces[i].m_plane[1],poly->m_faces[i].m_plane[2]);
-							getDebugDrawer()->drawLine(worldTransform*centroid,worldTransform*(centroid+faceNormal),normalColor);
-							
-							
-						}
-
-						
-					} else
-					{
-						for (i=0;i<polyshape->getNumEdges();i++)
-						{
-							btVector3 a,b;
-							polyshape->getEdge(i,a,b);
-							btVector3 wa = worldTransform * a;
-							btVector3 wb = worldTransform * b;
-							getDebugDrawer()->drawLine(wa,wb,color);
-						}
-					}
-
-
-				}
-			}
-		}
-	}
-}
-
-
-void	btCollisionWorld::debugDrawWorld()
-{
-	if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & btIDebugDraw::DBG_DrawContactPoints)
-	{
-		int numManifolds = getDispatcher()->getNumManifolds();
-		btVector3 color(0,0,0);
-		for (int i=0;i<numManifolds;i++)
-		{
-			btPersistentManifold* contactManifold = getDispatcher()->getManifoldByIndexInternal(i);
-			//btCollisionObject* obA = static_cast<btCollisionObject*>(contactManifold->getBody0());
-			//btCollisionObject* obB = static_cast<btCollisionObject*>(contactManifold->getBody1());
-
-			int numContacts = contactManifold->getNumContacts();
-			for (int j=0;j<numContacts;j++)
-			{
-				btManifoldPoint& cp = contactManifold->getContactPoint(j);
-				getDebugDrawer()->drawContactPoint(cp.m_positionWorldOnB,cp.m_normalWorldOnB,cp.getDistance(),cp.getLifeTime(),color);
-			}
-		}
-	}
-
-	if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe | btIDebugDraw::DBG_DrawAabb))
-	{
-		int i;
-
-		for (  i=0;i<m_collisionObjects.size();i++)
-		{
-			btCollisionObject* colObj = m_collisionObjects[i];
-			if ((colObj->getCollisionFlags() & btCollisionObject::CF_DISABLE_VISUALIZE_OBJECT)==0)
-			{
-				if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & btIDebugDraw::DBG_DrawWireframe)
-				{
-					btVector3 color(btScalar(1.),btScalar(1.),btScalar(1.));
-					switch(colObj->getActivationState())
-					{
-					case  ACTIVE_TAG:
-						color = btVector3(btScalar(1.),btScalar(1.),btScalar(1.)); break;
-					case ISLAND_SLEEPING:
-						color =  btVector3(btScalar(0.),btScalar(1.),btScalar(0.));break;
-					case WANTS_DEACTIVATION:
-						color = btVector3(btScalar(0.),btScalar(1.),btScalar(1.));break;
-					case DISABLE_DEACTIVATION:
-						color = btVector3(btScalar(1.),btScalar(0.),btScalar(0.));break;
-					case DISABLE_SIMULATION:
-						color = btVector3(btScalar(1.),btScalar(1.),btScalar(0.));break;
-					default:
-						{
-							color = btVector3(btScalar(1),btScalar(0.),btScalar(0.));
-						}
-					};
-
-					debugDrawObject(colObj->getWorldTransform(),colObj->getCollisionShape(),color);
-				}
-				if (m_debugDrawer && (m_debugDrawer->getDebugMode() & btIDebugDraw::DBG_DrawAabb))
-				{
-					btVector3 minAabb,maxAabb;
-					btVector3 colorvec(1,0,0);
-					colObj->getCollisionShape()->getAabb(colObj->getWorldTransform(), minAabb,maxAabb);
-					btVector3 contactThreshold(gContactBreakingThreshold,gContactBreakingThreshold,gContactBreakingThreshold);
-					minAabb -= contactThreshold;
-					maxAabb += contactThreshold;
-
-					btVector3 minAabb2,maxAabb2;
-
-					if(colObj->getInternalType()==btCollisionObject::CO_RIGID_BODY)
-					{
-						colObj->getCollisionShape()->getAabb(colObj->getInterpolationWorldTransform(),minAabb2,maxAabb2);
-						minAabb2 -= contactThreshold;
-						maxAabb2 += contactThreshold;
-						minAabb.setMin(minAabb2);
-						maxAabb.setMax(maxAabb2);
-					}
-
-					m_debugDrawer->drawAabb(minAabb,maxAabb,colorvec);
-				}
-			}
-
-		}
-	}
-}
-
-
-void	btCollisionWorld::serializeCollisionObjects(btSerializer* serializer)
-{
-	int i;
-	//serialize all collision objects
-	for (i=0;i<m_collisionObjects.size();i++)
-	{
-		btCollisionObject* colObj = m_collisionObjects[i];
-		if (colObj->getInternalType() == btCollisionObject::CO_COLLISION_OBJECT)
-		{
-			colObj->serializeSingleObject(serializer);
-		}
-	}
-
-	///keep track of shapes already serialized
-	btHashMap<btHashPtr,btCollisionShape*>	serializedShapes;
-
-	for (i=0;i<m_collisionObjects.size();i++)
-	{
-		btCollisionObject* colObj = m_collisionObjects[i];
-		btCollisionShape* shape = colObj->getCollisionShape();
-
-		if (!serializedShapes.find(shape))
-		{
-			serializedShapes.insert(shape,shape);
-			shape->serializeSingleShape(serializer);
-		}
-	}
-
-}
-
-
-void	btCollisionWorld::serialize(btSerializer* serializer)
-{
-
-	serializer->startSerialization();
-	
-	serializeCollisionObjects(serializer);
-	
-	serializer->finishSerialization();
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
deleted file mode 100644
index 0a92d2d..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
+++ /dev/null
@@ -1,509 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://bulletphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-/**
- * @mainpage Bullet Documentation
- *
- * @section intro_sec Introduction
- * Bullet Collision Detection & Physics SDK
- *
- * Bullet is a Collision Detection and Rigid Body Dynamics Library. The Library is Open Source and free for commercial use, under the ZLib license ( http://opensource.org/licenses/zlib-license.php ).
- *
- * The main documentation is Bullet_User_Manual.pdf, included in the source code distribution.
- * There is the Physics Forum for feedback and general Collision Detection and Physics discussions.
- * Please visit http://www.bulletphysics.com
- *
- * @section install_sec Installation
- *
- * @subsection step1 Step 1: Download
- * You can download the Bullet Physics Library from the Google Code repository: http://code.google.com/p/bullet/downloads/list
- *
- * @subsection step2 Step 2: Building
- * Bullet main build system for all platforms is cmake, you can download http://www.cmake.org
- * cmake can autogenerate projectfiles for Microsoft Visual Studio, Apple Xcode, KDevelop and Unix Makefiles.
- * The easiest is to run the CMake cmake-gui graphical user interface and choose the options and generate projectfiles.
- * You can also use cmake in the command-line. Here are some examples for various platforms:
- * cmake . -G "Visual Studio 9 2008"
- * cmake . -G Xcode
- * cmake . -G "Unix Makefiles"
- * Although cmake is recommended, you can also use autotools for UNIX: ./autogen.sh ./configure to create a Makefile and then run make.
- * 
- * @subsection step3 Step 3: Testing demos
- * Try to run and experiment with BasicDemo executable as a starting point.
- * Bullet can be used in several ways, as Full Rigid Body simulation, as Collision Detector Library or Low Level / Snippets like the GJK Closest Point calculation.
- * The Dependencies can be seen in this documentation under Directories
- * 
- * @subsection step4 Step 4: Integrating in your application, full Rigid Body and Soft Body simulation
- * Check out BasicDemo how to create a btDynamicsWorld, btRigidBody and btCollisionShape, Stepping the simulation and synchronizing your graphics object transform.
- * Check out SoftDemo how to use soft body dynamics, using btSoftRigidDynamicsWorld.
- * @subsection step5 Step 5 : Integrate the Collision Detection Library (without Dynamics and other Extras)
- * Bullet Collision Detection can also be used without the Dynamics/Extras.
- * Check out btCollisionWorld and btCollisionObject, and the CollisionInterfaceDemo.
- * @subsection step6 Step 6 : Use Snippets like the GJK Closest Point calculation.
- * Bullet has been designed in a modular way keeping dependencies to a minimum. The ConvexHullDistance demo demonstrates direct use of btGjkPairDetector.
- *
- * @section copyright Copyright
- * For up-to-data information and copyright and contributors list check out the Bullet_User_Manual.pdf
- * 
- */
- 
- 
-
-#ifndef BT_COLLISION_WORLD_H
-#define BT_COLLISION_WORLD_H
-
-class btStackAlloc;
-class btCollisionShape;
-class btConvexShape;
-class btBroadphaseInterface;
-class btSerializer;
-
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btTransform.h"
-#include "btCollisionObject.h"
-#include "btCollisionDispatcher.h"
-#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"
-#include "LinearMath/btAlignedObjectArray.h"
-
-///CollisionWorld is interface and container for the collision detection
-class btCollisionWorld
-{
-
-	
-protected:
-
-	btAlignedObjectArray<btCollisionObject*>	m_collisionObjects;
-	
-	btDispatcher*	m_dispatcher1;
-
-	btDispatcherInfo	m_dispatchInfo;
-
-	btStackAlloc*	m_stackAlloc;
-
-	btBroadphaseInterface*	m_broadphasePairCache;
-
-	btIDebugDraw*	m_debugDrawer;
-
-	///m_forceUpdateAllAabbs can be set to false as an optimization to only update active object AABBs
-	///it is true by default, because it is error-prone (setting the position of static objects wouldn't update their AABB)
-	bool m_forceUpdateAllAabbs;
-
-	void	serializeCollisionObjects(btSerializer* serializer);
-
-public:
-
-	//this constructor doesn't own the dispatcher and paircache/broadphase
-	btCollisionWorld(btDispatcher* dispatcher,btBroadphaseInterface* broadphasePairCache, btCollisionConfiguration* collisionConfiguration);
-
-	virtual ~btCollisionWorld();
-
-	void	setBroadphase(btBroadphaseInterface*	pairCache)
-	{
-		m_broadphasePairCache = pairCache;
-	}
-
-	const btBroadphaseInterface*	getBroadphase() const
-	{
-		return m_broadphasePairCache;
-	}
-
-	btBroadphaseInterface*	getBroadphase()
-	{
-		return m_broadphasePairCache;
-	}
-
-	btOverlappingPairCache*	getPairCache()
-	{
-		return m_broadphasePairCache->getOverlappingPairCache();
-	}
-
-
-	btDispatcher*	getDispatcher()
-	{
-		return m_dispatcher1;
-	}
-
-	const btDispatcher*	getDispatcher() const
-	{
-		return m_dispatcher1;
-	}
-
-	void	updateSingleAabb(btCollisionObject* colObj);
-
-	virtual void	updateAabbs();
-	
-	virtual void	setDebugDrawer(btIDebugDraw*	debugDrawer)
-	{
-			m_debugDrawer = debugDrawer;
-	}
-
-	virtual btIDebugDraw*	getDebugDrawer()
-	{
-		return m_debugDrawer;
-	}
-
-	virtual void	debugDrawWorld();
-
-	virtual void debugDrawObject(const btTransform& worldTransform, const btCollisionShape* shape, const btVector3& color);
-
-
-	///LocalShapeInfo gives extra information for complex shapes
-	///Currently, only btTriangleMeshShape is available, so it just contains triangleIndex and subpart
-	struct	LocalShapeInfo
-	{
-		int	m_shapePart;
-		int	m_triangleIndex;
-		
-		//const btCollisionShape*	m_shapeTemp;
-		//const btTransform*	m_shapeLocalTransform;
-	};
-
-	struct	LocalRayResult
-	{
-		LocalRayResult(btCollisionObject*	collisionObject, 
-			LocalShapeInfo*	localShapeInfo,
-			const btVector3&		hitNormalLocal,
-			btScalar hitFraction)
-		:m_collisionObject(collisionObject),
-		m_localShapeInfo(localShapeInfo),
-		m_hitNormalLocal(hitNormalLocal),
-		m_hitFraction(hitFraction)
-		{
-		}
-
-		btCollisionObject*		m_collisionObject;
-		LocalShapeInfo*			m_localShapeInfo;
-		btVector3				m_hitNormalLocal;
-		btScalar				m_hitFraction;
-
-	};
-
-	///RayResultCallback is used to report new raycast results
-	struct	RayResultCallback
-	{
-		btScalar	m_closestHitFraction;
-		btCollisionObject*		m_collisionObject;
-		short int	m_collisionFilterGroup;
-		short int	m_collisionFilterMask;
-      //@BP Mod - Custom flags, currently used to enable backface culling on tri-meshes, see btRaycastCallback
-      unsigned int m_flags;
-
-		virtual ~RayResultCallback()
-		{
-		}
-		bool	hasHit() const
-		{
-			return (m_collisionObject != 0);
-		}
-
-		RayResultCallback()
-			:m_closestHitFraction(btScalar(1.)),
-			m_collisionObject(0),
-			m_collisionFilterGroup(btBroadphaseProxy::DefaultFilter),
-			m_collisionFilterMask(btBroadphaseProxy::AllFilter),
-         //@BP Mod
-         m_flags(0)
-		{
-		}
-
-		virtual bool needsCollision(btBroadphaseProxy* proxy0) const
-		{
-			bool collides = (proxy0->m_collisionFilterGroup & m_collisionFilterMask) != 0;
-			collides = collides && (m_collisionFilterGroup & proxy0->m_collisionFilterMask);
-			return collides;
-		}
-
-
-		virtual	btScalar	addSingleResult(LocalRayResult& rayResult,bool normalInWorldSpace) = 0;
-	};
-
-	struct	ClosestRayResultCallback : public RayResultCallback
-	{
-		ClosestRayResultCallback(const btVector3&	rayFromWorld,const btVector3&	rayToWorld)
-		:m_rayFromWorld(rayFromWorld),
-		m_rayToWorld(rayToWorld)
-		{
-		}
-
-		btVector3	m_rayFromWorld;//used to calculate hitPointWorld from hitFraction
-		btVector3	m_rayToWorld;
-
-		btVector3	m_hitNormalWorld;
-		btVector3	m_hitPointWorld;
-			
-		virtual	btScalar	addSingleResult(LocalRayResult& rayResult,bool normalInWorldSpace)
-		{
-			//caller already does the filter on the m_closestHitFraction
-			btAssert(rayResult.m_hitFraction <= m_closestHitFraction);
-			
-			m_closestHitFraction = rayResult.m_hitFraction;
-			m_collisionObject = rayResult.m_collisionObject;
-			if (normalInWorldSpace)
-			{
-				m_hitNormalWorld = rayResult.m_hitNormalLocal;
-			} else
-			{
-				///need to transform normal into worldspace
-				m_hitNormalWorld = m_collisionObject->getWorldTransform().getBasis()*rayResult.m_hitNormalLocal;
-			}
-			m_hitPointWorld.setInterpolate3(m_rayFromWorld,m_rayToWorld,rayResult.m_hitFraction);
-			return rayResult.m_hitFraction;
-		}
-	};
-
-	struct	AllHitsRayResultCallback : public RayResultCallback
-	{
-		AllHitsRayResultCallback(const btVector3&	rayFromWorld,const btVector3&	rayToWorld)
-		:m_rayFromWorld(rayFromWorld),
-		m_rayToWorld(rayToWorld)
-		{
-		}
-
-		btAlignedObjectArray<btCollisionObject*>		m_collisionObjects;
-
-		btVector3	m_rayFromWorld;//used to calculate hitPointWorld from hitFraction
-		btVector3	m_rayToWorld;
-
-		btAlignedObjectArray<btVector3>	m_hitNormalWorld;
-		btAlignedObjectArray<btVector3>	m_hitPointWorld;
-		btAlignedObjectArray<btScalar> m_hitFractions;
-			
-		virtual	btScalar	addSingleResult(LocalRayResult& rayResult,bool normalInWorldSpace)
-		{
-			m_collisionObject = rayResult.m_collisionObject;
-			m_collisionObjects.push_back(rayResult.m_collisionObject);
-			btVector3 hitNormalWorld;
-			if (normalInWorldSpace)
-			{
-				hitNormalWorld = rayResult.m_hitNormalLocal;
-			} else
-			{
-				///need to transform normal into worldspace
-				hitNormalWorld = m_collisionObject->getWorldTransform().getBasis()*rayResult.m_hitNormalLocal;
-			}
-			m_hitNormalWorld.push_back(hitNormalWorld);
-			btVector3 hitPointWorld;
-			hitPointWorld.setInterpolate3(m_rayFromWorld,m_rayToWorld,rayResult.m_hitFraction);
-			m_hitPointWorld.push_back(hitPointWorld);
-			m_hitFractions.push_back(rayResult.m_hitFraction);
-			return m_closestHitFraction;
-		}
-	};
-
-
-	struct LocalConvexResult
-	{
-		LocalConvexResult(btCollisionObject*	hitCollisionObject, 
-			LocalShapeInfo*	localShapeInfo,
-			const btVector3&		hitNormalLocal,
-			const btVector3&		hitPointLocal,
-			btScalar hitFraction
-			)
-		:m_hitCollisionObject(hitCollisionObject),
-		m_localShapeInfo(localShapeInfo),
-		m_hitNormalLocal(hitNormalLocal),
-		m_hitPointLocal(hitPointLocal),
-		m_hitFraction(hitFraction)
-		{
-		}
-
-		btCollisionObject*		m_hitCollisionObject;
-		LocalShapeInfo*			m_localShapeInfo;
-		btVector3				m_hitNormalLocal;
-		btVector3				m_hitPointLocal;
-		btScalar				m_hitFraction;
-	};
-
-	///RayResultCallback is used to report new raycast results
-	struct	ConvexResultCallback
-	{
-		btScalar	m_closestHitFraction;
-		short int	m_collisionFilterGroup;
-		short int	m_collisionFilterMask;
-		
-		ConvexResultCallback()
-			:m_closestHitFraction(btScalar(1.)),
-			m_collisionFilterGroup(btBroadphaseProxy::DefaultFilter),
-			m_collisionFilterMask(btBroadphaseProxy::AllFilter)
-		{
-		}
-
-		virtual ~ConvexResultCallback()
-		{
-		}
-		
-		bool	hasHit() const
-		{
-			return (m_closestHitFraction < btScalar(1.));
-		}
-
-		
-
-		virtual bool needsCollision(btBroadphaseProxy* proxy0) const
-		{
-			bool collides = (proxy0->m_collisionFilterGroup & m_collisionFilterMask) != 0;
-			collides = collides && (m_collisionFilterGroup & proxy0->m_collisionFilterMask);
-			return collides;
-		}
-
-		virtual	btScalar	addSingleResult(LocalConvexResult& convexResult,bool normalInWorldSpace) = 0;
-	};
-
-	struct	ClosestConvexResultCallback : public ConvexResultCallback
-	{
-		ClosestConvexResultCallback(const btVector3&	convexFromWorld,const btVector3&	convexToWorld)
-		:m_convexFromWorld(convexFromWorld),
-		m_convexToWorld(convexToWorld),
-		m_hitCollisionObject(0)
-		{
-		}
-
-		btVector3	m_convexFromWorld;//used to calculate hitPointWorld from hitFraction
-		btVector3	m_convexToWorld;
-
-		btVector3	m_hitNormalWorld;
-		btVector3	m_hitPointWorld;
-		btCollisionObject*	m_hitCollisionObject;
-		
-		virtual	btScalar	addSingleResult(LocalConvexResult& convexResult,bool normalInWorldSpace)
-		{
-//caller already does the filter on the m_closestHitFraction
-			btAssert(convexResult.m_hitFraction <= m_closestHitFraction);
-						
-			m_closestHitFraction = convexResult.m_hitFraction;
-			m_hitCollisionObject = convexResult.m_hitCollisionObject;
-			if (normalInWorldSpace)
-			{
-				m_hitNormalWorld = convexResult.m_hitNormalLocal;
-			} else
-			{
-				///need to transform normal into worldspace
-				m_hitNormalWorld = m_hitCollisionObject->getWorldTransform().getBasis()*convexResult.m_hitNormalLocal;
-			}
-			m_hitPointWorld = convexResult.m_hitPointLocal;
-			return convexResult.m_hitFraction;
-		}
-	};
-
-	///ContactResultCallback is used to report contact points
-	struct	ContactResultCallback
-	{
-		short int	m_collisionFilterGroup;
-		short int	m_collisionFilterMask;
-		
-		ContactResultCallback()
-			:m_collisionFilterGroup(btBroadphaseProxy::DefaultFilter),
-			m_collisionFilterMask(btBroadphaseProxy::AllFilter)
-		{
-		}
-
-		virtual ~ContactResultCallback()
-		{
-		}
-		
-		virtual bool needsCollision(btBroadphaseProxy* proxy0) const
-		{
-			bool collides = (proxy0->m_collisionFilterGroup & m_collisionFilterMask) != 0;
-			collides = collides && (m_collisionFilterGroup & proxy0->m_collisionFilterMask);
-			return collides;
-		}
-
-		virtual	btScalar	addSingleResult(btManifoldPoint& cp,	const btCollisionObject* colObj0,int partId0,int index0,const btCollisionObject* colObj1,int partId1,int index1) = 0;
-	};
-
-
-
-	int	getNumCollisionObjects() const
-	{
-		return int(m_collisionObjects.size());
-	}
-
-	/// rayTest performs a raycast on all objects in the btCollisionWorld, and calls the resultCallback
-	/// This allows for several queries: first hit, all hits, any hit, dependent on the value returned by the callback.
-	virtual void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback) const; 
-
-	/// convexTest performs a swept convex cast on all objects in the btCollisionWorld, and calls the resultCallback
-	/// This allows for several queries: first hit, all hits, any hit, dependent on the value return by the callback.
-	void    convexSweepTest (const btConvexShape* castShape, const btTransform& from, const btTransform& to, ConvexResultCallback& resultCallback,  btScalar allowedCcdPenetration = btScalar(0.)) const;
-
-	///contactTest performs a discrete collision test between colObj against all objects in the btCollisionWorld, and calls the resultCallback.
-	///it reports one or more contact points for every overlapping object (including the one with deepest penetration)
-	void	contactTest(btCollisionObject* colObj, ContactResultCallback& resultCallback);
-
-	///contactTest performs a discrete collision test between two collision objects and calls the resultCallback if overlap if detected.
-	///it reports one or more contact points (including the one with deepest penetration)
-	void	contactPairTest(btCollisionObject* colObjA, btCollisionObject* colObjB, ContactResultCallback& resultCallback);
-
-
-	/// rayTestSingle performs a raycast call and calls the resultCallback. It is used internally by rayTest.
-	/// In a future implementation, we consider moving the ray test as a virtual method in btCollisionShape.
-	/// This allows more customization.
-	static void	rayTestSingle(const btTransform& rayFromTrans,const btTransform& rayToTrans,
-					  btCollisionObject* collisionObject,
-					  const btCollisionShape* collisionShape,
-					  const btTransform& colObjWorldTransform,
-					  RayResultCallback& resultCallback);
-
-	/// objectQuerySingle performs a collision detection query and calls the resultCallback. It is used internally by rayTest.
-	static void	objectQuerySingle(const btConvexShape* castShape, const btTransform& rayFromTrans,const btTransform& rayToTrans,
-					  btCollisionObject* collisionObject,
-					  const btCollisionShape* collisionShape,
-					  const btTransform& colObjWorldTransform,
-					  ConvexResultCallback& resultCallback, btScalar	allowedPenetration);
-
-	virtual void	addCollisionObject(btCollisionObject* collisionObject,short int collisionFilterGroup=btBroadphaseProxy::DefaultFilter,short int collisionFilterMask=btBroadphaseProxy::AllFilter);
-
-	btCollisionObjectArray& getCollisionObjectArray()
-	{
-		return m_collisionObjects;
-	}
-
-	const btCollisionObjectArray& getCollisionObjectArray() const
-	{
-		return m_collisionObjects;
-	}
-
-
-	virtual void	removeCollisionObject(btCollisionObject* collisionObject);
-
-	virtual void	performDiscreteCollisionDetection();
-
-	btDispatcherInfo& getDispatchInfo()
-	{
-		return m_dispatchInfo;
-	}
-
-	const btDispatcherInfo& getDispatchInfo() const
-	{
-		return m_dispatchInfo;
-	}
-	
-	bool	getForceUpdateAllAabbs() const
-	{
-		return m_forceUpdateAllAabbs;
-	}
-	void setForceUpdateAllAabbs( bool forceUpdateAllAabbs)
-	{
-		m_forceUpdateAllAabbs = forceUpdateAllAabbs;
-	}
-
-	///Preliminary serialization test for Bullet 2.76. Loading those files requires a separate parser (Bullet/Demos/SerializeDemo)
-	virtual	void	serialize(btSerializer* serializer);
-
-};
-
-
-#endif //BT_COLLISION_WORLD_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp
deleted file mode 100644
index 54889a6..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-#include "BulletCollision/CollisionShapes/btCompoundShape.h"
-#include "BulletCollision/BroadphaseCollision/btDbvt.h"
-#include "LinearMath/btIDebugDraw.h"
-#include "LinearMath/btAabbUtil2.h"
-#include "btManifoldResult.h"
-
-btCompoundCollisionAlgorithm::btCompoundCollisionAlgorithm( const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1,bool isSwapped)
-:btActivatingCollisionAlgorithm(ci,body0,body1),
-m_isSwapped(isSwapped),
-m_sharedManifold(ci.m_manifold)
-{
-	m_ownsManifold = false;
-
-	btCollisionObject* colObj = m_isSwapped? body1 : body0;
-	btAssert (colObj->getCollisionShape()->isCompound());
-	
-	btCompoundShape* compoundShape = static_cast<btCompoundShape*>(colObj->getCollisionShape());
-	m_compoundShapeRevision = compoundShape->getUpdateRevision();
-	
-	preallocateChildAlgorithms(body0,body1);
-}
-
-void	btCompoundCollisionAlgorithm::preallocateChildAlgorithms(btCollisionObject* body0,btCollisionObject* body1)
-{
-	btCollisionObject* colObj = m_isSwapped? body1 : body0;
-	btCollisionObject* otherObj = m_isSwapped? body0 : body1;
-	btAssert (colObj->getCollisionShape()->isCompound());
-	
-	btCompoundShape* compoundShape = static_cast<btCompoundShape*>(colObj->getCollisionShape());
-
-	int numChildren = compoundShape->getNumChildShapes();
-	int i;
-	
-	m_childCollisionAlgorithms.resize(numChildren);
-	for (i=0;i<numChildren;i++)
-	{
-		if (compoundShape->getDynamicAabbTree())
-		{
-			m_childCollisionAlgorithms[i] = 0;
-		} else
-		{
-			btCollisionShape* tmpShape = colObj->getCollisionShape();
-			btCollisionShape* childShape = compoundShape->getChildShape(i);
-			colObj->internalSetTemporaryCollisionShape( childShape );
-			m_childCollisionAlgorithms[i] = m_dispatcher->findAlgorithm(colObj,otherObj,m_sharedManifold);
-			colObj->internalSetTemporaryCollisionShape( tmpShape );
-		}
-	}
-}
-
-void	btCompoundCollisionAlgorithm::removeChildAlgorithms()
-{
-	int numChildren = m_childCollisionAlgorithms.size();
-	int i;
-	for (i=0;i<numChildren;i++)
-	{
-		if (m_childCollisionAlgorithms[i])
-		{
-			m_childCollisionAlgorithms[i]->~btCollisionAlgorithm();
-			m_dispatcher->freeCollisionAlgorithm(m_childCollisionAlgorithms[i]);
-		}
-	}
-}
-
-btCompoundCollisionAlgorithm::~btCompoundCollisionAlgorithm()
-{
-	removeChildAlgorithms();
-}
-
-
-
-
-struct	btCompoundLeafCallback : btDbvt::ICollide
-{
-
-public:
-
-	btCollisionObject* m_compoundColObj;
-	btCollisionObject* m_otherObj;
-	btDispatcher* m_dispatcher;
-	const btDispatcherInfo& m_dispatchInfo;
-	btManifoldResult*	m_resultOut;
-	btCollisionAlgorithm**	m_childCollisionAlgorithms;
-	btPersistentManifold*	m_sharedManifold;
-
-
-
-
-	btCompoundLeafCallback (btCollisionObject* compoundObj,btCollisionObject* otherObj,btDispatcher* dispatcher,const btDispatcherInfo& dispatchInfo,btManifoldResult*	resultOut,btCollisionAlgorithm**	childCollisionAlgorithms,btPersistentManifold*	sharedManifold)
-		:m_compoundColObj(compoundObj),m_otherObj(otherObj),m_dispatcher(dispatcher),m_dispatchInfo(dispatchInfo),m_resultOut(resultOut),
-		m_childCollisionAlgorithms(childCollisionAlgorithms),
-		m_sharedManifold(sharedManifold)
-	{
-
-	}
-
-
-	void	ProcessChildShape(btCollisionShape* childShape,int index)
-	{
-		btAssert(index>=0);
-		btCompoundShape* compoundShape = static_cast<btCompoundShape*>(m_compoundColObj->getCollisionShape());
-		btAssert(index<compoundShape->getNumChildShapes());
-
-
-		//backup
-		btTransform	orgTrans = m_compoundColObj->getWorldTransform();
-		btTransform	orgInterpolationTrans = m_compoundColObj->getInterpolationWorldTransform();
-		const btTransform& childTrans = compoundShape->getChildTransform(index);
-		btTransform	newChildWorldTrans = orgTrans*childTrans ;
-
-		//perform an AABB check first
-		btVector3 aabbMin0,aabbMax0,aabbMin1,aabbMax1;
-		childShape->getAabb(newChildWorldTrans,aabbMin0,aabbMax0);
-		m_otherObj->getCollisionShape()->getAabb(m_otherObj->getWorldTransform(),aabbMin1,aabbMax1);
-
-		if (TestAabbAgainstAabb2(aabbMin0,aabbMax0,aabbMin1,aabbMax1))
-		{
-
-			m_compoundColObj->setWorldTransform( newChildWorldTrans);
-			m_compoundColObj->setInterpolationWorldTransform(newChildWorldTrans);
-
-			//the contactpoint is still projected back using the original inverted worldtrans
-			btCollisionShape* tmpShape = m_compoundColObj->getCollisionShape();
-			m_compoundColObj->internalSetTemporaryCollisionShape( childShape );
-
-			if (!m_childCollisionAlgorithms[index])
-				m_childCollisionAlgorithms[index] = m_dispatcher->findAlgorithm(m_compoundColObj,m_otherObj,m_sharedManifold);
-
-			///detect swapping case
-			if (m_resultOut->getBody0Internal() == m_compoundColObj)
-			{
-				m_resultOut->setShapeIdentifiersA(-1,index);
-			} else
-			{
-				m_resultOut->setShapeIdentifiersB(-1,index);
-			}
-
-			m_childCollisionAlgorithms[index]->processCollision(m_compoundColObj,m_otherObj,m_dispatchInfo,m_resultOut);
-			if (m_dispatchInfo.m_debugDraw && (m_dispatchInfo.m_debugDraw->getDebugMode() & btIDebugDraw::DBG_DrawAabb))
-			{
-				btVector3 worldAabbMin,worldAabbMax;
-				m_dispatchInfo.m_debugDraw->drawAabb(aabbMin0,aabbMax0,btVector3(1,1,1));
-				m_dispatchInfo.m_debugDraw->drawAabb(aabbMin1,aabbMax1,btVector3(1,1,1));
-			}
-			
-			//revert back transform
-			m_compoundColObj->internalSetTemporaryCollisionShape( tmpShape);
-			m_compoundColObj->setWorldTransform(  orgTrans );
-			m_compoundColObj->setInterpolationWorldTransform(orgInterpolationTrans);
-		}
-	}
-	void		Process(const btDbvtNode* leaf)
-	{
-		int index = leaf->dataAsInt;
-
-		btCompoundShape* compoundShape = static_cast<btCompoundShape*>(m_compoundColObj->getCollisionShape());
-		btCollisionShape* childShape = compoundShape->getChildShape(index);
-		if (m_dispatchInfo.m_debugDraw && (m_dispatchInfo.m_debugDraw->getDebugMode() & btIDebugDraw::DBG_DrawAabb))
-		{
-			btVector3 worldAabbMin,worldAabbMax;
-			btTransform	orgTrans = m_compoundColObj->getWorldTransform();
-			btTransformAabb(leaf->volume.Mins(),leaf->volume.Maxs(),0.,orgTrans,worldAabbMin,worldAabbMax);
-			m_dispatchInfo.m_debugDraw->drawAabb(worldAabbMin,worldAabbMax,btVector3(1,0,0));
-		}
-		ProcessChildShape(childShape,index);
-
-	}
-};
-
-
-
-
-
-
-void btCompoundCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-	btCollisionObject* colObj = m_isSwapped? body1 : body0;
-	btCollisionObject* otherObj = m_isSwapped? body0 : body1;
-
-	
-
-	btAssert (colObj->getCollisionShape()->isCompound());
-	btCompoundShape* compoundShape = static_cast<btCompoundShape*>(colObj->getCollisionShape());
-
-	///btCompoundShape might have changed:
-	////make sure the internal child collision algorithm caches are still valid
-	if (compoundShape->getUpdateRevision() != m_compoundShapeRevision)
-	{
-		///clear and update all
-		removeChildAlgorithms();
-		
-		preallocateChildAlgorithms(body0,body1);
-	}
-
-
-	btDbvt* tree = compoundShape->getDynamicAabbTree();
-	//use a dynamic aabb tree to cull potential child-overlaps
-	btCompoundLeafCallback  callback(colObj,otherObj,m_dispatcher,dispatchInfo,resultOut,&m_childCollisionAlgorithms[0],m_sharedManifold);
-
-	///we need to refresh all contact manifolds
-	///note that we should actually recursively traverse all children, btCompoundShape can nested more then 1 level deep
-	///so we should add a 'refreshManifolds' in the btCollisionAlgorithm
-	{
-		int i;
-		btManifoldArray manifoldArray;
-		for (i=0;i<m_childCollisionAlgorithms.size();i++)
-		{
-			if (m_childCollisionAlgorithms[i])
-			{
-				m_childCollisionAlgorithms[i]->getAllContactManifolds(manifoldArray);
-				for (int m=0;m<manifoldArray.size();m++)
-				{
-					if (manifoldArray[m]->getNumContacts())
-					{
-						resultOut->setPersistentManifold(manifoldArray[m]);
-						resultOut->refreshContactPoints();
-						resultOut->setPersistentManifold(0);//??necessary?
-					}
-				}
-				manifoldArray.resize(0);
-			}
-		}
-	}
-
-	if (tree)
-	{
-
-		btVector3 localAabbMin,localAabbMax;
-		btTransform otherInCompoundSpace;
-		otherInCompoundSpace = colObj->getWorldTransform().inverse() * otherObj->getWorldTransform();
-		otherObj->getCollisionShape()->getAabb(otherInCompoundSpace,localAabbMin,localAabbMax);
-
-		const ATTRIBUTE_ALIGNED16(btDbvtVolume)	bounds=btDbvtVolume::FromMM(localAabbMin,localAabbMax);
-		//process all children, that overlap with  the given AABB bounds
-		tree->collideTV(tree->m_root,bounds,callback);
-
-	} else
-	{
-		//iterate over all children, perform an AABB check inside ProcessChildShape
-		int numChildren = m_childCollisionAlgorithms.size();
-		int i;
-		for (i=0;i<numChildren;i++)
-		{
-			callback.ProcessChildShape(compoundShape->getChildShape(i),i);
-		}
-	}
-
-	{
-				//iterate over all children, perform an AABB check inside ProcessChildShape
-		int numChildren = m_childCollisionAlgorithms.size();
-		int i;
-		btManifoldArray	manifoldArray;
-        btCollisionShape* childShape = 0;
-        btTransform	orgTrans;
-        btTransform	orgInterpolationTrans;
-        btTransform	newChildWorldTrans;
-        btVector3 aabbMin0,aabbMax0,aabbMin1,aabbMax1;        
-        
-		for (i=0;i<numChildren;i++)
-		{
-			if (m_childCollisionAlgorithms[i])
-			{
-				childShape = compoundShape->getChildShape(i);
-			//if not longer overlapping, remove the algorithm
-                orgTrans = colObj->getWorldTransform();
-                orgInterpolationTrans = colObj->getInterpolationWorldTransform();
-				const btTransform& childTrans = compoundShape->getChildTransform(i);
-                newChildWorldTrans = orgTrans*childTrans ;
-
-				//perform an AABB check first
-				childShape->getAabb(newChildWorldTrans,aabbMin0,aabbMax0);
-				otherObj->getCollisionShape()->getAabb(otherObj->getWorldTransform(),aabbMin1,aabbMax1);
-
-				if (!TestAabbAgainstAabb2(aabbMin0,aabbMax0,aabbMin1,aabbMax1))
-				{
-					m_childCollisionAlgorithms[i]->~btCollisionAlgorithm();
-					m_dispatcher->freeCollisionAlgorithm(m_childCollisionAlgorithms[i]);
-					m_childCollisionAlgorithms[i] = 0;
-				}
-			}
-		}
-	}
-}
-
-btScalar	btCompoundCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-
-	btCollisionObject* colObj = m_isSwapped? body1 : body0;
-	btCollisionObject* otherObj = m_isSwapped? body0 : body1;
-
-	btAssert (colObj->getCollisionShape()->isCompound());
-	
-	btCompoundShape* compoundShape = static_cast<btCompoundShape*>(colObj->getCollisionShape());
-
-	//We will use the OptimizedBVH, AABB tree to cull potential child-overlaps
-	//If both proxies are Compound, we will deal with that directly, by performing sequential/parallel tree traversals
-	//given Proxy0 and Proxy1, if both have a tree, Tree0 and Tree1, this means:
-	//determine overlapping nodes of Proxy1 using Proxy0 AABB against Tree1
-	//then use each overlapping node AABB against Tree0
-	//and vise versa.
-
-	btScalar hitFraction = btScalar(1.);
-
-	int numChildren = m_childCollisionAlgorithms.size();
-	int i;
-    btTransform	orgTrans;
-    btScalar frac;
-	for (i=0;i<numChildren;i++)
-	{
-		//temporarily exchange parent btCollisionShape with childShape, and recurse
-		btCollisionShape* childShape = compoundShape->getChildShape(i);
-
-		//backup
-        orgTrans = colObj->getWorldTransform();
-	
-		const btTransform& childTrans = compoundShape->getChildTransform(i);
-		//btTransform	newChildWorldTrans = orgTrans*childTrans ;
-		colObj->setWorldTransform( orgTrans*childTrans );
-
-		btCollisionShape* tmpShape = colObj->getCollisionShape();
-		colObj->internalSetTemporaryCollisionShape( childShape );
-        frac = m_childCollisionAlgorithms[i]->calculateTimeOfImpact(colObj,otherObj,dispatchInfo,resultOut);
-		if (frac<hitFraction)
-		{
-			hitFraction = frac;
-		}
-		//revert back
-		colObj->internalSetTemporaryCollisionShape( tmpShape);
-		colObj->setWorldTransform( orgTrans);
-	}
-	return hitFraction;
-
-}
-
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h
deleted file mode 100644
index 4045749..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_COMPOUND_COLLISION_ALGORITHM_H
-#define BT_COMPOUND_COLLISION_ALGORITHM_H
-
-#include "btActivatingCollisionAlgorithm.h"
-#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
-
-#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
-class btDispatcher;
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-#include "btCollisionCreateFunc.h"
-#include "LinearMath/btAlignedObjectArray.h"
-class btDispatcher;
-class btCollisionObject;
-
-/// btCompoundCollisionAlgorithm  supports collision between CompoundCollisionShapes and other collision shapes
-class btCompoundCollisionAlgorithm  : public btActivatingCollisionAlgorithm
-{
-	btAlignedObjectArray<btCollisionAlgorithm*> m_childCollisionAlgorithms;
-	bool m_isSwapped;
-
-	class btPersistentManifold*	m_sharedManifold;
-	bool					m_ownsManifold;
-
-	int	m_compoundShapeRevision;//to keep track of changes, so that childAlgorithm array can be updated
-	
-	void	removeChildAlgorithms();
-	
-	void	preallocateChildAlgorithms(btCollisionObject* body0,btCollisionObject* body1);
-
-public:
-
-	btCompoundCollisionAlgorithm( const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1,bool isSwapped);
-
-	virtual ~btCompoundCollisionAlgorithm();
-
-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	btScalar	calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
-	{
-		int i;
-		for (i=0;i<m_childCollisionAlgorithms.size();i++)
-		{
-			if (m_childCollisionAlgorithms[i])
-				m_childCollisionAlgorithms[i]->getAllContactManifolds(manifoldArray);
-		}
-	}
-
-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
-	{
-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
-		{
-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btCompoundCollisionAlgorithm));
-			return new(mem) btCompoundCollisionAlgorithm(ci,body0,body1,false);
-		}
-	};
-
-	struct SwappedCreateFunc :public 	btCollisionAlgorithmCreateFunc
-	{
-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
-		{
-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btCompoundCollisionAlgorithm));
-			return new(mem) btCompoundCollisionAlgorithm(ci,body0,body1,true);
-		}
-	};
-
-};
-
-#endif //BT_COMPOUND_COLLISION_ALGORITHM_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp
deleted file mode 100644
index db7f884..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btConvex2dConvex2dAlgorithm.h"
-
-//#include <stdio.h>
-#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-#include "BulletCollision/CollisionShapes/btConvexShape.h"
-#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
-
-
-#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
-#include "BulletCollision/CollisionShapes/btBoxShape.h"
-#include "BulletCollision/CollisionDispatch/btManifoldResult.h"
-
-#include "BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h"
-#include "BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h"
-#include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h"
-#include "BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h"
-
-
-
-#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
-#include "BulletCollision/CollisionShapes/btSphereShape.h"
-
-#include "BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h"
-
-#include "BulletCollision/NarrowPhaseCollision/btGjkEpa2.h"
-#include "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h"
-
-
-btConvex2dConvex2dAlgorithm::CreateFunc::CreateFunc(btSimplexSolverInterface*			simplexSolver, btConvexPenetrationDepthSolver* pdSolver)
-{
-	m_numPerturbationIterations = 0;
-	m_minimumPointsPerturbationThreshold = 3;
-	m_simplexSolver = simplexSolver;
-	m_pdSolver = pdSolver;
-}
-
-btConvex2dConvex2dAlgorithm::CreateFunc::~CreateFunc() 
-{ 
-}
-
-btConvex2dConvex2dAlgorithm::btConvex2dConvex2dAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1,btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* pdSolver,int numPerturbationIterations, int minimumPointsPerturbationThreshold)
-: btActivatingCollisionAlgorithm(ci,body0,body1),
-m_simplexSolver(simplexSolver),
-m_pdSolver(pdSolver),
-m_ownManifold (false),
-m_manifoldPtr(mf),
-m_lowLevelOfDetail(false),
- m_numPerturbationIterations(numPerturbationIterations),
-m_minimumPointsPerturbationThreshold(minimumPointsPerturbationThreshold)
-{
-	(void)body0;
-	(void)body1;
-}
-
-
-
-
-btConvex2dConvex2dAlgorithm::~btConvex2dConvex2dAlgorithm()
-{
-	if (m_ownManifold)
-	{
-		if (m_manifoldPtr)
-			m_dispatcher->releaseManifold(m_manifoldPtr);
-	}
-}
-
-void	btConvex2dConvex2dAlgorithm ::setLowLevelOfDetail(bool useLowLevel)
-{
-	m_lowLevelOfDetail = useLowLevel;
-}
-
-
-
-extern btScalar gContactBreakingThreshold;
-
-
-//
-// Convex-Convex collision algorithm
-//
-void btConvex2dConvex2dAlgorithm ::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-
-	if (!m_manifoldPtr)
-	{
-		//swapped?
-		m_manifoldPtr = m_dispatcher->getNewManifold(body0,body1);
-		m_ownManifold = true;
-	}
-	resultOut->setPersistentManifold(m_manifoldPtr);
-
-	//comment-out next line to test multi-contact generation
-	//resultOut->getPersistentManifold()->clearManifold();
-
-
-	btConvexShape* min0 = static_cast<btConvexShape*>(body0->getCollisionShape());
-	btConvexShape* min1 = static_cast<btConvexShape*>(body1->getCollisionShape());
-
-	btVector3  normalOnB;
-	btVector3  pointOnBWorld;
-
-	{
-
-
-		btGjkPairDetector::ClosestPointInput input;
-
-		btGjkPairDetector	gjkPairDetector(min0,min1,m_simplexSolver,m_pdSolver);
-		//TODO: if (dispatchInfo.m_useContinuous)
-		gjkPairDetector.setMinkowskiA(min0);
-		gjkPairDetector.setMinkowskiB(min1);
-
-		{
-			input.m_maximumDistanceSquared = min0->getMargin() + min1->getMargin() + m_manifoldPtr->getContactBreakingThreshold();
-			input.m_maximumDistanceSquared*= input.m_maximumDistanceSquared;
-		}
-
-		input.m_stackAlloc = dispatchInfo.m_stackAllocator;
-		input.m_transformA = body0->getWorldTransform();
-		input.m_transformB = body1->getWorldTransform();
-
-		gjkPairDetector.getClosestPoints(input,*resultOut,dispatchInfo.m_debugDraw);
-
-		btVector3 v0,v1;
-		btVector3 sepNormalWorldSpace;
-
-	}
-
-	if (m_ownManifold)
-	{
-		resultOut->refreshContactPoints();
-	}
-
-}
-
-
-
-
-btScalar	btConvex2dConvex2dAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-	(void)resultOut;
-	(void)dispatchInfo;
-	///Rather then checking ALL pairs, only calculate TOI when motion exceeds threshold
-
-	///Linear motion for one of objects needs to exceed m_ccdSquareMotionThreshold
-	///col0->m_worldTransform,
-	btScalar resultFraction = btScalar(1.);
-
-
-	btScalar squareMot0 = (col0->getInterpolationWorldTransform().getOrigin() - col0->getWorldTransform().getOrigin()).length2();
-	btScalar squareMot1 = (col1->getInterpolationWorldTransform().getOrigin() - col1->getWorldTransform().getOrigin()).length2();
-
-	if (squareMot0 < col0->getCcdSquareMotionThreshold() &&
-		squareMot1 < col1->getCcdSquareMotionThreshold())
-		return resultFraction;
-
-
-	//An adhoc way of testing the Continuous Collision Detection algorithms
-	//One object is approximated as a sphere, to simplify things
-	//Starting in penetration should report no time of impact
-	//For proper CCD, better accuracy and handling of 'allowed' penetration should be added
-	//also the mainloop of the physics should have a kind of toi queue (something like Brian Mirtich's application of Timewarp for Rigidbodies)
-
-
-	/// Convex0 against sphere for Convex1
-	{
-		btConvexShape* convex0 = static_cast<btConvexShape*>(col0->getCollisionShape());
-
-		btSphereShape	sphere1(col1->getCcdSweptSphereRadius()); //todo: allow non-zero sphere sizes, for better approximation
-		btConvexCast::CastResult result;
-		btVoronoiSimplexSolver voronoiSimplex;
-		//SubsimplexConvexCast ccd0(&sphere,min0,&voronoiSimplex);
-		///Simplification, one object is simplified as a sphere
-		btGjkConvexCast ccd1( convex0 ,&sphere1,&voronoiSimplex);
-		//ContinuousConvexCollision ccd(min0,min1,&voronoiSimplex,0);
-		if (ccd1.calcTimeOfImpact(col0->getWorldTransform(),col0->getInterpolationWorldTransform(),
-			col1->getWorldTransform(),col1->getInterpolationWorldTransform(),result))
-		{
-
-			//store result.m_fraction in both bodies
-
-			if (col0->getHitFraction()> result.m_fraction)
-				col0->setHitFraction( result.m_fraction );
-
-			if (col1->getHitFraction() > result.m_fraction)
-				col1->setHitFraction( result.m_fraction);
-
-			if (resultFraction > result.m_fraction)
-				resultFraction = result.m_fraction;
-
-		}
-
-
-
-
-	}
-
-	/// Sphere (for convex0) against Convex1
-	{
-		btConvexShape* convex1 = static_cast<btConvexShape*>(col1->getCollisionShape());
-
-		btSphereShape	sphere0(col0->getCcdSweptSphereRadius()); //todo: allow non-zero sphere sizes, for better approximation
-		btConvexCast::CastResult result;
-		btVoronoiSimplexSolver voronoiSimplex;
-		//SubsimplexConvexCast ccd0(&sphere,min0,&voronoiSimplex);
-		///Simplification, one object is simplified as a sphere
-		btGjkConvexCast ccd1(&sphere0,convex1,&voronoiSimplex);
-		//ContinuousConvexCollision ccd(min0,min1,&voronoiSimplex,0);
-		if (ccd1.calcTimeOfImpact(col0->getWorldTransform(),col0->getInterpolationWorldTransform(),
-			col1->getWorldTransform(),col1->getInterpolationWorldTransform(),result))
-		{
-
-			//store result.m_fraction in both bodies
-
-			if (col0->getHitFraction()	> result.m_fraction)
-				col0->setHitFraction( result.m_fraction);
-
-			if (col1->getHitFraction() > result.m_fraction)
-				col1->setHitFraction( result.m_fraction);
-
-			if (resultFraction > result.m_fraction)
-				resultFraction = result.m_fraction;
-
-		}
-	}
-
-	return resultFraction;
-
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h
deleted file mode 100644
index 53d13b8..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_CONVEX_2D_CONVEX_2D_ALGORITHM_H
-#define BT_CONVEX_2D_CONVEX_2D_ALGORITHM_H
-
-#include "BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h"
-#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h"
-#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
-#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"
-#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
-#include "LinearMath/btTransformUtil.h" //for btConvexSeparatingDistanceUtil
-
-class btConvexPenetrationDepthSolver;
-
-
-///The convex2dConvex2dAlgorithm collision algorithm support 2d collision detection for btConvex2dShape
-///Currently it requires the btMinkowskiPenetrationDepthSolver, it has support for 2d penetration depth computation
-class btConvex2dConvex2dAlgorithm : public btActivatingCollisionAlgorithm
-{
-	btSimplexSolverInterface*		m_simplexSolver;
-	btConvexPenetrationDepthSolver* m_pdSolver;
-
-	
-	bool	m_ownManifold;
-	btPersistentManifold*	m_manifoldPtr;
-	bool			m_lowLevelOfDetail;
-	
-	int m_numPerturbationIterations;
-	int m_minimumPointsPerturbationThreshold;
-
-public:
-
-	btConvex2dConvex2dAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1, btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* pdSolver, int numPerturbationIterations, int minimumPointsPerturbationThreshold);
-
-
-	virtual ~btConvex2dConvex2dAlgorithm();
-
-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
-	{
-		///should we use m_ownManifold to avoid adding duplicates?
-		if (m_manifoldPtr && m_ownManifold)
-			manifoldArray.push_back(m_manifoldPtr);
-	}
-
-
-	void	setLowLevelOfDetail(bool useLowLevel);
-
-
-	const btPersistentManifold*	getManifold()
-	{
-		return m_manifoldPtr;
-	}
-
-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
-	{
-
-		btConvexPenetrationDepthSolver*		m_pdSolver;
-		btSimplexSolverInterface*			m_simplexSolver;
-		int m_numPerturbationIterations;
-		int m_minimumPointsPerturbationThreshold;
-
-		CreateFunc(btSimplexSolverInterface*			simplexSolver, btConvexPenetrationDepthSolver* pdSolver);
-		
-		virtual ~CreateFunc();
-
-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
-		{
-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btConvex2dConvex2dAlgorithm));
-			return new(mem) btConvex2dConvex2dAlgorithm(ci.m_manifold,ci,body0,body1,m_simplexSolver,m_pdSolver,m_numPerturbationIterations,m_minimumPointsPerturbationThreshold);
-		}
-	};
-
-
-};
-
-#endif //BT_CONVEX_2D_CONVEX_2D_ALGORITHM_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp
deleted file mode 100644
index d2b2c22..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "btConvexConcaveCollisionAlgorithm.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-#include "BulletCollision/CollisionShapes/btMultiSphereShape.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-#include "BulletCollision/CollisionShapes/btConcaveShape.h"
-#include "BulletCollision/CollisionDispatch/btManifoldResult.h"
-#include "BulletCollision/NarrowPhaseCollision/btRaycastCallback.h"
-#include "BulletCollision/CollisionShapes/btTriangleShape.h"
-#include "BulletCollision/CollisionShapes/btSphereShape.h"
-#include "LinearMath/btIDebugDraw.h"
-#include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h"
-
-btConvexConcaveCollisionAlgorithm::btConvexConcaveCollisionAlgorithm( const btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1,bool isSwapped)
-: btActivatingCollisionAlgorithm(ci,body0,body1),
-m_isSwapped(isSwapped),
-m_btConvexTriangleCallback(ci.m_dispatcher1,body0,body1,isSwapped)
-{
-}
-
-btConvexConcaveCollisionAlgorithm::~btConvexConcaveCollisionAlgorithm()
-{
-}
-
-void	btConvexConcaveCollisionAlgorithm::getAllContactManifolds(btManifoldArray&	manifoldArray)
-{
-	if (m_btConvexTriangleCallback.m_manifoldPtr)
-	{
-		manifoldArray.push_back(m_btConvexTriangleCallback.m_manifoldPtr);
-	}
-}
-
-
-btConvexTriangleCallback::btConvexTriangleCallback(btDispatcher*  dispatcher,btCollisionObject* body0,btCollisionObject* body1,bool isSwapped):
-	  m_dispatcher(dispatcher),
-	m_dispatchInfoPtr(0)
-{
-	m_convexBody = isSwapped? body1:body0;
-	m_triBody = isSwapped? body0:body1;
-	
-	  //
-	  // create the manifold from the dispatcher 'manifold pool'
-	  //
-	  m_manifoldPtr = m_dispatcher->getNewManifold(m_convexBody,m_triBody);
-
-  	  clearCache();
-}
-
-btConvexTriangleCallback::~btConvexTriangleCallback()
-{
-	clearCache();
-	m_dispatcher->releaseManifold( m_manifoldPtr );
-  
-}
-  
-
-void	btConvexTriangleCallback::clearCache()
-{
-	m_dispatcher->clearManifold(m_manifoldPtr);
-}
-
-
-
-void btConvexTriangleCallback::processTriangle(btVector3* triangle,int partId, int triangleIndex)
-{
- 
-	//just for debugging purposes
-	//printf("triangle %d",m_triangleCount++);
-
-
-	//aabb filter is already applied!	
-
-	btCollisionAlgorithmConstructionInfo ci;
-	ci.m_dispatcher1 = m_dispatcher;
-
-	btCollisionObject* ob = static_cast<btCollisionObject*>(m_triBody);
-
-
-#if 0	
-	///debug drawing of the overlapping triangles
-	if (m_dispatchInfoPtr && m_dispatchInfoPtr->m_debugDraw && (m_dispatchInfoPtr->m_debugDraw->getDebugMode() &btIDebugDraw::DBG_DrawWireframe ))
-	{
-		btVector3 color(1,1,0);
-		btTransform& tr = ob->getWorldTransform();
-		m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[0]),tr(triangle[1]),color);
-		m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[1]),tr(triangle[2]),color);
-		m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[2]),tr(triangle[0]),color);
-	}
-#endif
-	
-	if (m_convexBody->getCollisionShape()->isConvex())
-	{
-		btTriangleShape tm(triangle[0],triangle[1],triangle[2]);	
-		tm.setMargin(m_collisionMarginTriangle);
-		
-		btCollisionShape* tmpShape = ob->getCollisionShape();
-		ob->internalSetTemporaryCollisionShape( &tm );
-
-		btCollisionAlgorithm* colAlgo = ci.m_dispatcher1->findAlgorithm(m_convexBody,m_triBody,m_manifoldPtr);
-
-		if (m_resultOut->getBody0Internal() == m_triBody)
-		{
-			m_resultOut->setShapeIdentifiersA(partId,triangleIndex);
-		}
-		else
-		{
-			m_resultOut->setShapeIdentifiersB(partId,triangleIndex);
-		}
-	
-		colAlgo->processCollision(m_convexBody,m_triBody,*m_dispatchInfoPtr,m_resultOut);
-		colAlgo->~btCollisionAlgorithm();
-		ci.m_dispatcher1->freeCollisionAlgorithm(colAlgo);
-		ob->internalSetTemporaryCollisionShape( tmpShape);
-	}
-
-
-}
-
-
-
-void	btConvexTriangleCallback::setTimeStepAndCounters(btScalar collisionMarginTriangle,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-	m_dispatchInfoPtr = &dispatchInfo;
-	m_collisionMarginTriangle = collisionMarginTriangle;
-	m_resultOut = resultOut;
-
-	//recalc aabbs
-	btTransform convexInTriangleSpace;
-	convexInTriangleSpace = m_triBody->getWorldTransform().inverse() * m_convexBody->getWorldTransform();
-	btCollisionShape* convexShape = static_cast<btCollisionShape*>(m_convexBody->getCollisionShape());
-	//CollisionShape* triangleShape = static_cast<btCollisionShape*>(triBody->m_collisionShape);
-	convexShape->getAabb(convexInTriangleSpace,m_aabbMin,m_aabbMax);
-	btScalar extraMargin = collisionMarginTriangle;
-	btVector3 extra(extraMargin,extraMargin,extraMargin);
-
-	m_aabbMax += extra;
-	m_aabbMin -= extra;
-	
-}
-
-void btConvexConcaveCollisionAlgorithm::clearCache()
-{
-	m_btConvexTriangleCallback.clearCache();
-
-}
-
-void btConvexConcaveCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-	
-	
-	btCollisionObject* convexBody = m_isSwapped ? body1 : body0;
-	btCollisionObject* triBody = m_isSwapped ? body0 : body1;
-
-	if (triBody->getCollisionShape()->isConcave())
-	{
-
-
-		btCollisionObject*	triOb = triBody;
-		btConcaveShape* concaveShape = static_cast<btConcaveShape*>( triOb->getCollisionShape());
-		
-		if (convexBody->getCollisionShape()->isConvex())
-		{
-			btScalar collisionMarginTriangle = concaveShape->getMargin();
-					
-			resultOut->setPersistentManifold(m_btConvexTriangleCallback.m_manifoldPtr);
-			m_btConvexTriangleCallback.setTimeStepAndCounters(collisionMarginTriangle,dispatchInfo,resultOut);
-
-			//Disable persistency. previously, some older algorithm calculated all contacts in one go, so you can clear it here.
-			//m_dispatcher->clearManifold(m_btConvexTriangleCallback.m_manifoldPtr);
-
-			m_btConvexTriangleCallback.m_manifoldPtr->setBodies(convexBody,triBody);
-
-			concaveShape->processAllTriangles( &m_btConvexTriangleCallback,m_btConvexTriangleCallback.getAabbMin(),m_btConvexTriangleCallback.getAabbMax());
-			
-			resultOut->refreshContactPoints();
-	
-		}
-	
-	}
-
-}
-
-
-btScalar btConvexConcaveCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-	(void)resultOut;
-	(void)dispatchInfo;
-	btCollisionObject* convexbody = m_isSwapped ? body1 : body0;
-	btCollisionObject* triBody = m_isSwapped ? body0 : body1;
-
-
-	//quick approximation using raycast, todo: hook up to the continuous collision detection (one of the btConvexCast)
-
-	//only perform CCD above a certain threshold, this prevents blocking on the long run
-	//because object in a blocked ccd state (hitfraction<1) get their linear velocity halved each frame...
-	btScalar squareMot0 = (convexbody->getInterpolationWorldTransform().getOrigin() - convexbody->getWorldTransform().getOrigin()).length2();
-	if (squareMot0 < convexbody->getCcdSquareMotionThreshold())
-	{
-		return btScalar(1.);
-	}
-
-	//const btVector3& from = convexbody->m_worldTransform.getOrigin();
-	//btVector3 to = convexbody->m_interpolationWorldTransform.getOrigin();
-	//todo: only do if the motion exceeds the 'radius'
-
-	btTransform triInv = triBody->getWorldTransform().inverse();
-	btTransform convexFromLocal = triInv * convexbody->getWorldTransform();
-	btTransform convexToLocal = triInv * convexbody->getInterpolationWorldTransform();
-
-	struct LocalTriangleSphereCastCallback	: public btTriangleCallback
-	{
-		btTransform m_ccdSphereFromTrans;
-		btTransform m_ccdSphereToTrans;
-		btTransform	m_meshTransform;
-
-		btScalar	m_ccdSphereRadius;
-		btScalar	m_hitFraction;
-	
-
-		LocalTriangleSphereCastCallback(const btTransform& from,const btTransform& to,btScalar ccdSphereRadius,btScalar hitFraction)
-			:m_ccdSphereFromTrans(from),
-			m_ccdSphereToTrans(to),
-			m_ccdSphereRadius(ccdSphereRadius),
-			m_hitFraction(hitFraction)
-		{			
-		}
-		
-		
-		virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex)
-		{
-			(void)partId;
-			(void)triangleIndex;
-			//do a swept sphere for now
-			btTransform ident;
-			ident.setIdentity();
-			btConvexCast::CastResult castResult;
-			castResult.m_fraction = m_hitFraction;
-			btSphereShape	pointShape(m_ccdSphereRadius);
-			btTriangleShape	triShape(triangle[0],triangle[1],triangle[2]);
-			btVoronoiSimplexSolver	simplexSolver;
-			btSubsimplexConvexCast convexCaster(&pointShape,&triShape,&simplexSolver);
-			//GjkConvexCast	convexCaster(&pointShape,convexShape,&simplexSolver);
-			//ContinuousConvexCollision convexCaster(&pointShape,convexShape,&simplexSolver,0);
-			//local space?
-
-			if (convexCaster.calcTimeOfImpact(m_ccdSphereFromTrans,m_ccdSphereToTrans,
-				ident,ident,castResult))
-			{
-				if (m_hitFraction > castResult.m_fraction)
-					m_hitFraction = castResult.m_fraction;
-			}
-
-		}
-
-	};
-
-
-	
-
-	
-	if (triBody->getCollisionShape()->isConcave())
-	{
-		btVector3 rayAabbMin = convexFromLocal.getOrigin();
-		rayAabbMin.setMin(convexToLocal.getOrigin());
-		btVector3 rayAabbMax = convexFromLocal.getOrigin();
-		rayAabbMax.setMax(convexToLocal.getOrigin());
-		btScalar ccdRadius0 = convexbody->getCcdSweptSphereRadius();
-		rayAabbMin -= btVector3(ccdRadius0,ccdRadius0,ccdRadius0);
-		rayAabbMax += btVector3(ccdRadius0,ccdRadius0,ccdRadius0);
-
-		btScalar curHitFraction = btScalar(1.); //is this available?
-		LocalTriangleSphereCastCallback raycastCallback(convexFromLocal,convexToLocal,
-			convexbody->getCcdSweptSphereRadius(),curHitFraction);
-
-		raycastCallback.m_hitFraction = convexbody->getHitFraction();
-
-		btCollisionObject* concavebody = triBody;
-
-		btConcaveShape* triangleMesh = (btConcaveShape*) concavebody->getCollisionShape();
-		
-		if (triangleMesh)
-		{
-			triangleMesh->processAllTriangles(&raycastCallback,rayAabbMin,rayAabbMax);
-		}
-	
-
-
-		if (raycastCallback.m_hitFraction < convexbody->getHitFraction())
-		{
-			convexbody->setHitFraction( raycastCallback.m_hitFraction);
-			return raycastCallback.m_hitFraction;
-		}
-	}
-
-	return btScalar(1.);
-
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h
deleted file mode 100644
index f718d1d..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_CONVEX_CONCAVE_COLLISION_ALGORITHM_H
-#define BT_CONVEX_CONCAVE_COLLISION_ALGORITHM_H
-
-#include "btActivatingCollisionAlgorithm.h"
-#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
-#include "BulletCollision/CollisionShapes/btTriangleCallback.h"
-#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
-class btDispatcher;
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-#include "btCollisionCreateFunc.h"
-
-///For each triangle in the concave mesh that overlaps with the AABB of a convex (m_convexProxy), processTriangle is called.
-class btConvexTriangleCallback : public btTriangleCallback
-{
-	btCollisionObject* m_convexBody;
-	btCollisionObject* m_triBody;
-
-	btVector3	m_aabbMin;
-	btVector3	m_aabbMax ;
-
-
-	btManifoldResult* m_resultOut;
-	btDispatcher*	m_dispatcher;
-	const btDispatcherInfo* m_dispatchInfoPtr;
-	btScalar m_collisionMarginTriangle;
-	
-public:
-int	m_triangleCount;
-	
-	btPersistentManifold*	m_manifoldPtr;
-
-	btConvexTriangleCallback(btDispatcher* dispatcher,btCollisionObject* body0,btCollisionObject* body1,bool isSwapped);
-
-	void	setTimeStepAndCounters(btScalar collisionMarginTriangle,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	virtual ~btConvexTriangleCallback();
-
-	virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex);
-	
-	void clearCache();
-
-	SIMD_FORCE_INLINE const btVector3& getAabbMin() const
-	{
-		return m_aabbMin;
-	}
-	SIMD_FORCE_INLINE const btVector3& getAabbMax() const
-	{
-		return m_aabbMax;
-	}
-
-};
-
-
-
-
-/// btConvexConcaveCollisionAlgorithm  supports collision between convex shapes and (concave) trianges meshes.
-class btConvexConcaveCollisionAlgorithm  : public btActivatingCollisionAlgorithm
-{
-
-	bool	m_isSwapped;
-
-	btConvexTriangleCallback m_btConvexTriangleCallback;
-
-
-
-public:
-
-	btConvexConcaveCollisionAlgorithm( const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1,bool isSwapped);
-
-	virtual ~btConvexConcaveCollisionAlgorithm();
-
-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	btScalar	calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray);
-	
-	void	clearCache();
-
-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
-	{
-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
-		{
-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btConvexConcaveCollisionAlgorithm));
-			return new(mem) btConvexConcaveCollisionAlgorithm(ci,body0,body1,false);
-		}
-	};
-
-	struct SwappedCreateFunc :public 	btCollisionAlgorithmCreateFunc
-	{
-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
-		{
-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btConvexConcaveCollisionAlgorithm));
-			return new(mem) btConvexConcaveCollisionAlgorithm(ci,body0,body1,true);
-		}
-	};
-
-};
-
-#endif //BT_CONVEX_CONCAVE_COLLISION_ALGORITHM_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp
deleted file mode 100644
index 79353a4..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp
+++ /dev/null
@@ -1,679 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-///Specialized capsule-capsule collision algorithm has been added for Bullet 2.75 release to increase ragdoll performance
-///If you experience problems with capsule-capsule collision, try to define BT_DISABLE_CAPSULE_CAPSULE_COLLIDER and report it in the Bullet forums
-///with reproduction case
-//define BT_DISABLE_CAPSULE_CAPSULE_COLLIDER 1
-
-#include "btConvexConvexAlgorithm.h"
-
-//#include <stdio.h>
-#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-#include "BulletCollision/CollisionShapes/btConvexShape.h"
-#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
-#include "BulletCollision/CollisionShapes/btTriangleShape.h"
-
-
-
-#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
-#include "BulletCollision/CollisionShapes/btBoxShape.h"
-#include "BulletCollision/CollisionDispatch/btManifoldResult.h"
-
-#include "BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h"
-#include "BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h"
-#include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h"
-#include "BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h"
-
-
-
-#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
-#include "BulletCollision/CollisionShapes/btSphereShape.h"
-
-#include "BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h"
-
-#include "BulletCollision/NarrowPhaseCollision/btGjkEpa2.h"
-#include "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h"
-#include "BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.h"
-
-
-///////////
-
-
-
-static SIMD_FORCE_INLINE void segmentsClosestPoints(
-	btVector3& ptsVector,
-	btVector3& offsetA,
-	btVector3& offsetB,
-	btScalar& tA, btScalar& tB,
-	const btVector3& translation,
-	const btVector3& dirA, btScalar hlenA,
-	const btVector3& dirB, btScalar hlenB )
-{
-	// compute the parameters of the closest points on each line segment
-
-	btScalar dirA_dot_dirB = btDot(dirA,dirB);
-	btScalar dirA_dot_trans = btDot(dirA,translation);
-	btScalar dirB_dot_trans = btDot(dirB,translation);
-
-	btScalar denom = 1.0f - dirA_dot_dirB * dirA_dot_dirB;
-
-	if ( denom == 0.0f ) {
-		tA = 0.0f;
-	} else {
-		tA = ( dirA_dot_trans - dirB_dot_trans * dirA_dot_dirB ) / denom;
-		if ( tA < -hlenA )
-			tA = -hlenA;
-		else if ( tA > hlenA )
-			tA = hlenA;
-	}
-
-	tB = tA * dirA_dot_dirB - dirB_dot_trans;
-
-	if ( tB < -hlenB ) {
-		tB = -hlenB;
-		tA = tB * dirA_dot_dirB + dirA_dot_trans;
-
-		if ( tA < -hlenA )
-			tA = -hlenA;
-		else if ( tA > hlenA )
-			tA = hlenA;
-	} else if ( tB > hlenB ) {
-		tB = hlenB;
-		tA = tB * dirA_dot_dirB + dirA_dot_trans;
-
-		if ( tA < -hlenA )
-			tA = -hlenA;
-		else if ( tA > hlenA )
-			tA = hlenA;
-	}
-
-	// compute the closest points relative to segment centers.
-
-	offsetA = dirA * tA;
-	offsetB = dirB * tB;
-
-	ptsVector = translation - offsetA + offsetB;
-}
-
-
-static SIMD_FORCE_INLINE btScalar capsuleCapsuleDistance(
-	btVector3& normalOnB,
-	btVector3& pointOnB,
-	btScalar capsuleLengthA,
-	btScalar	capsuleRadiusA,
-	btScalar capsuleLengthB,
-	btScalar	capsuleRadiusB,
-	int capsuleAxisA,
-	int capsuleAxisB,
-	const btTransform& transformA,
-	const btTransform& transformB,
-	btScalar distanceThreshold )
-{
-	btVector3 directionA = transformA.getBasis().getColumn(capsuleAxisA);
-	btVector3 translationA = transformA.getOrigin();
-	btVector3 directionB = transformB.getBasis().getColumn(capsuleAxisB);
-	btVector3 translationB = transformB.getOrigin();
-
-	// translation between centers
-
-	btVector3 translation = translationB - translationA;
-
-	// compute the closest points of the capsule line segments
-
-	btVector3 ptsVector;           // the vector between the closest points
-	
-	btVector3 offsetA, offsetB;    // offsets from segment centers to their closest points
-	btScalar tA, tB;              // parameters on line segment
-
-	segmentsClosestPoints( ptsVector, offsetA, offsetB, tA, tB, translation,
-						   directionA, capsuleLengthA, directionB, capsuleLengthB );
-
-	btScalar distance = ptsVector.length() - capsuleRadiusA - capsuleRadiusB;
-
-	if ( distance > distanceThreshold )
-		return distance;
-
-	btScalar lenSqr = ptsVector.length2();
-	if (lenSqr<= (SIMD_EPSILON*SIMD_EPSILON))
-	{
-		//degenerate case where 2 capsules are likely at the same location: take a vector tangential to 'directionA'
-		btVector3 q;
-		btPlaneSpace1(directionA,normalOnB,q);
-	} else
-	{
-		// compute the contact normal
-		normalOnB = ptsVector*-btRecipSqrt(lenSqr);
-	}
-	pointOnB = transformB.getOrigin()+offsetB + normalOnB * capsuleRadiusB;
-
-	return distance;
-}
-
-
-
-
-
-
-
-//////////
-
-
-
-
-
-btConvexConvexAlgorithm::CreateFunc::CreateFunc(btSimplexSolverInterface*			simplexSolver, btConvexPenetrationDepthSolver* pdSolver)
-{
-	m_numPerturbationIterations = 0;
-	m_minimumPointsPerturbationThreshold = 3;
-	m_simplexSolver = simplexSolver;
-	m_pdSolver = pdSolver;
-}
-
-btConvexConvexAlgorithm::CreateFunc::~CreateFunc() 
-{ 
-}
-
-btConvexConvexAlgorithm::btConvexConvexAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1,btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* pdSolver,int numPerturbationIterations, int minimumPointsPerturbationThreshold)
-: btActivatingCollisionAlgorithm(ci,body0,body1),
-m_simplexSolver(simplexSolver),
-m_pdSolver(pdSolver),
-m_ownManifold (false),
-m_manifoldPtr(mf),
-m_lowLevelOfDetail(false),
-#ifdef USE_SEPDISTANCE_UTIL2
-m_sepDistance((static_cast<btConvexShape*>(body0->getCollisionShape()))->getAngularMotionDisc(),
-			  (static_cast<btConvexShape*>(body1->getCollisionShape()))->getAngularMotionDisc()),
-#endif
-m_numPerturbationIterations(numPerturbationIterations),
-m_minimumPointsPerturbationThreshold(minimumPointsPerturbationThreshold)
-{
-	(void)body0;
-	(void)body1;
-}
-
-
-
-
-btConvexConvexAlgorithm::~btConvexConvexAlgorithm()
-{
-	if (m_ownManifold)
-	{
-		if (m_manifoldPtr)
-			m_dispatcher->releaseManifold(m_manifoldPtr);
-	}
-}
-
-void	btConvexConvexAlgorithm ::setLowLevelOfDetail(bool useLowLevel)
-{
-	m_lowLevelOfDetail = useLowLevel;
-}
-
-
-struct btPerturbedContactResult : public btManifoldResult
-{
-	btManifoldResult* m_originalManifoldResult;
-	btTransform m_transformA;
-	btTransform m_transformB;
-	btTransform	m_unPerturbedTransform;
-	bool	m_perturbA;
-	btIDebugDraw*	m_debugDrawer;
-
-
-	btPerturbedContactResult(btManifoldResult* originalResult,const btTransform& transformA,const btTransform& transformB,const btTransform& unPerturbedTransform,bool perturbA,btIDebugDraw* debugDrawer)
-		:m_originalManifoldResult(originalResult),
-		m_transformA(transformA),
-		m_transformB(transformB),
-		m_unPerturbedTransform(unPerturbedTransform),
-		m_perturbA(perturbA),
-		m_debugDrawer(debugDrawer)
-	{
-	}
-	virtual ~ btPerturbedContactResult()
-	{
-	}
-
-	virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar orgDepth)
-	{
-		btVector3 endPt,startPt;
-		btScalar newDepth;
-		btVector3 newNormal;
-
-		if (m_perturbA)
-		{
-			btVector3 endPtOrg = pointInWorld + normalOnBInWorld*orgDepth;
-			endPt = (m_unPerturbedTransform*m_transformA.inverse())(endPtOrg);
-			newDepth = (endPt -  pointInWorld).dot(normalOnBInWorld);
-			startPt = endPt+normalOnBInWorld*newDepth;
-		} else
-		{
-			endPt = pointInWorld + normalOnBInWorld*orgDepth;
-			startPt = (m_unPerturbedTransform*m_transformB.inverse())(pointInWorld);
-			newDepth = (endPt -  startPt).dot(normalOnBInWorld);
-			
-		}
-
-//#define DEBUG_CONTACTS 1
-#ifdef DEBUG_CONTACTS
-		m_debugDrawer->drawLine(startPt,endPt,btVector3(1,0,0));
-		m_debugDrawer->drawSphere(startPt,0.05,btVector3(0,1,0));
-		m_debugDrawer->drawSphere(endPt,0.05,btVector3(0,0,1));
-#endif //DEBUG_CONTACTS
-
-		
-		m_originalManifoldResult->addContactPoint(normalOnBInWorld,startPt,newDepth);
-	}
-
-};
-
-extern btScalar gContactBreakingThreshold;
-
-
-//
-// Convex-Convex collision algorithm
-//
-void btConvexConvexAlgorithm ::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-
-	if (!m_manifoldPtr)
-	{
-		//swapped?
-		m_manifoldPtr = m_dispatcher->getNewManifold(body0,body1);
-		m_ownManifold = true;
-	}
-	resultOut->setPersistentManifold(m_manifoldPtr);
-
-	//comment-out next line to test multi-contact generation
-	//resultOut->getPersistentManifold()->clearManifold();
-	
-
-	btConvexShape* min0 = static_cast<btConvexShape*>(body0->getCollisionShape());
-	btConvexShape* min1 = static_cast<btConvexShape*>(body1->getCollisionShape());
-
-	btVector3  normalOnB;
-		btVector3  pointOnBWorld;
-#ifndef BT_DISABLE_CAPSULE_CAPSULE_COLLIDER
-	if ((min0->getShapeType() == CAPSULE_SHAPE_PROXYTYPE) && (min1->getShapeType() == CAPSULE_SHAPE_PROXYTYPE))
-	{
-		btCapsuleShape* capsuleA = (btCapsuleShape*) min0;
-		btCapsuleShape* capsuleB = (btCapsuleShape*) min1;
-		btVector3 localScalingA = capsuleA->getLocalScaling();
-		btVector3 localScalingB = capsuleB->getLocalScaling();
-		
-		btScalar threshold = m_manifoldPtr->getContactBreakingThreshold();
-
-		btScalar dist = capsuleCapsuleDistance(normalOnB,	pointOnBWorld,capsuleA->getHalfHeight(),capsuleA->getRadius(),
-			capsuleB->getHalfHeight(),capsuleB->getRadius(),capsuleA->getUpAxis(),capsuleB->getUpAxis(),
-			body0->getWorldTransform(),body1->getWorldTransform(),threshold);
-
-		if (dist<threshold)
-		{
-			btAssert(normalOnB.length2()>=(SIMD_EPSILON*SIMD_EPSILON));
-			resultOut->addContactPoint(normalOnB,pointOnBWorld,dist);	
-		}
-		resultOut->refreshContactPoints();
-		return;
-	}
-#endif //BT_DISABLE_CAPSULE_CAPSULE_COLLIDER
-
-
-
-
-#ifdef USE_SEPDISTANCE_UTIL2
-	if (dispatchInfo.m_useConvexConservativeDistanceUtil)
-	{
-		m_sepDistance.updateSeparatingDistance(body0->getWorldTransform(),body1->getWorldTransform());
-	}
-
-	if (!dispatchInfo.m_useConvexConservativeDistanceUtil || m_sepDistance.getConservativeSeparatingDistance()<=0.f)
-#endif //USE_SEPDISTANCE_UTIL2
-
-	{
-
-	
-	btGjkPairDetector::ClosestPointInput input;
-
-	btGjkPairDetector	gjkPairDetector(min0,min1,m_simplexSolver,m_pdSolver);
-	//TODO: if (dispatchInfo.m_useContinuous)
-	gjkPairDetector.setMinkowskiA(min0);
-	gjkPairDetector.setMinkowskiB(min1);
-
-#ifdef USE_SEPDISTANCE_UTIL2
-	if (dispatchInfo.m_useConvexConservativeDistanceUtil)
-	{
-		input.m_maximumDistanceSquared = BT_LARGE_FLOAT;
-	} else
-#endif //USE_SEPDISTANCE_UTIL2
-	{
-		//if (dispatchInfo.m_convexMaxDistanceUseCPT)
-		//{
-		//	input.m_maximumDistanceSquared = min0->getMargin() + min1->getMargin() + m_manifoldPtr->getContactProcessingThreshold();
-		//} else
-		//{
-		input.m_maximumDistanceSquared = min0->getMargin() + min1->getMargin() + m_manifoldPtr->getContactBreakingThreshold();
-//		}
-
-		input.m_maximumDistanceSquared*= input.m_maximumDistanceSquared;
-	}
-
-	input.m_stackAlloc = dispatchInfo.m_stackAllocator;
-	input.m_transformA = body0->getWorldTransform();
-	input.m_transformB = body1->getWorldTransform();
-
-
-
-	
-
-#ifdef USE_SEPDISTANCE_UTIL2
-	btScalar sepDist = 0.f;
-	if (dispatchInfo.m_useConvexConservativeDistanceUtil)
-	{
-		sepDist = gjkPairDetector.getCachedSeparatingDistance();
-		if (sepDist>SIMD_EPSILON)
-		{
-			sepDist += dispatchInfo.m_convexConservativeDistanceThreshold;
-			//now perturbe directions to get multiple contact points
-			
-		}
-	}
-#endif //USE_SEPDISTANCE_UTIL2
-
-	if (min0->isPolyhedral() && min1->isPolyhedral())
-	{
-
-
-		struct btDummyResult : public btDiscreteCollisionDetectorInterface::Result
-		{
-			virtual void setShapeIdentifiersA(int partId0,int index0){}
-			virtual void setShapeIdentifiersB(int partId1,int index1){}
-			virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth) 
-			{
-			}
-		};
-		
-		btDummyResult dummy;
-
-
-		btPolyhedralConvexShape* polyhedronA = (btPolyhedralConvexShape*) min0;
-		btPolyhedralConvexShape* polyhedronB = (btPolyhedralConvexShape*) min1;
-		if (polyhedronA->getConvexPolyhedron() && polyhedronB->getConvexPolyhedron())
-		{
-
-
-			gjkPairDetector.getClosestPoints(input,dummy,dispatchInfo.m_debugDraw);
-			
-
-			btScalar threshold = m_manifoldPtr->getContactBreakingThreshold();
-
-			btScalar minDist = 0.f;
-			btVector3 sepNormalWorldSpace;
-			bool foundSepAxis  = true;
-
-			if (dispatchInfo.m_enableSatConvex)
-			{
-				foundSepAxis = btPolyhedralContactClipping::findSeparatingAxis(
-					*polyhedronA->getConvexPolyhedron(), *polyhedronB->getConvexPolyhedron(),
-					body0->getWorldTransform(), 
-					body1->getWorldTransform(),
-					sepNormalWorldSpace);
-			} else
-			{
-				sepNormalWorldSpace = gjkPairDetector.getCachedSeparatingAxis().normalized();
-				minDist = gjkPairDetector.getCachedSeparatingDistance();
-			}
-			if (foundSepAxis)
-			{
-//				printf("sepNormalWorldSpace=%f,%f,%f\n",sepNormalWorldSpace.getX(),sepNormalWorldSpace.getY(),sepNormalWorldSpace.getZ());
-
-				btPolyhedralContactClipping::clipHullAgainstHull(sepNormalWorldSpace, *polyhedronA->getConvexPolyhedron(), *polyhedronB->getConvexPolyhedron(),
-					body0->getWorldTransform(), 
-					body1->getWorldTransform(), minDist-threshold, threshold, *resultOut);
- 				
-			}
-			if (m_ownManifold)
-			{
-				resultOut->refreshContactPoints();
-			}
-			return;
-
-		} else
-		{
-			//we can also deal with convex versus triangle (without connectivity data)
-			if (polyhedronA->getConvexPolyhedron() && polyhedronB->getShapeType()==TRIANGLE_SHAPE_PROXYTYPE)
-			{
-				gjkPairDetector.getClosestPoints(input,dummy,dispatchInfo.m_debugDraw);
-		
-				btVector3 sepNormalWorldSpace = gjkPairDetector.getCachedSeparatingAxis().normalized();
-
-				btVertexArray vertices;
-				btTriangleShape* tri = (btTriangleShape*)polyhedronB;
-				vertices.push_back(	body1->getWorldTransform()*tri->m_vertices1[0]);
-				vertices.push_back(	body1->getWorldTransform()*tri->m_vertices1[1]);
-				vertices.push_back(	body1->getWorldTransform()*tri->m_vertices1[2]);
-
-				btScalar threshold = m_manifoldPtr->getContactBreakingThreshold();
-				btScalar minDist = gjkPairDetector.getCachedSeparatingDistance();
-				btPolyhedralContactClipping::clipFaceAgainstHull(sepNormalWorldSpace, *polyhedronA->getConvexPolyhedron(), 
-					body0->getWorldTransform(), vertices, minDist-threshold, threshold, *resultOut);
-				
-				
-				if (m_ownManifold)
-				{
-					resultOut->refreshContactPoints();
-				}
-				
-				return;
-			}
-			
-		}
-
-
-	}
-	
-	gjkPairDetector.getClosestPoints(input,*resultOut,dispatchInfo.m_debugDraw);
-
-	//now perform 'm_numPerturbationIterations' collision queries with the perturbated collision objects
-	
-	//perform perturbation when more then 'm_minimumPointsPerturbationThreshold' points
-	if (m_numPerturbationIterations && resultOut->getPersistentManifold()->getNumContacts() < m_minimumPointsPerturbationThreshold)
-	{
-		
-		int i;
-		btVector3 v0,v1;
-		btVector3 sepNormalWorldSpace;
-	
-		sepNormalWorldSpace = gjkPairDetector.getCachedSeparatingAxis().normalized();
-		btPlaneSpace1(sepNormalWorldSpace,v0,v1);
-
-
-		bool perturbeA = true;
-		const btScalar angleLimit = 0.125f * SIMD_PI;
-		btScalar perturbeAngle;
-		btScalar radiusA = min0->getAngularMotionDisc();
-		btScalar radiusB = min1->getAngularMotionDisc();
-		if (radiusA < radiusB)
-		{
-			perturbeAngle = gContactBreakingThreshold /radiusA;
-			perturbeA = true;
-		} else
-		{
-			perturbeAngle = gContactBreakingThreshold / radiusB;
-			perturbeA = false;
-		}
-		if ( perturbeAngle > angleLimit ) 
-				perturbeAngle = angleLimit;
-
-		btTransform unPerturbedTransform;
-		if (perturbeA)
-		{
-			unPerturbedTransform = input.m_transformA;
-		} else
-		{
-			unPerturbedTransform = input.m_transformB;
-		}
-		
-		for ( i=0;i<m_numPerturbationIterations;i++)
-		{
-			if (v0.length2()>SIMD_EPSILON)
-			{
-			btQuaternion perturbeRot(v0,perturbeAngle);
-			btScalar iterationAngle = i*(SIMD_2_PI/btScalar(m_numPerturbationIterations));
-			btQuaternion rotq(sepNormalWorldSpace,iterationAngle);
-			
-			
-			if (perturbeA)
-			{
-				input.m_transformA.setBasis(  btMatrix3x3(rotq.inverse()*perturbeRot*rotq)*body0->getWorldTransform().getBasis());
-				input.m_transformB = body1->getWorldTransform();
-#ifdef DEBUG_CONTACTS
-				dispatchInfo.m_debugDraw->drawTransform(input.m_transformA,10.0);
-#endif //DEBUG_CONTACTS
-			} else
-			{
-				input.m_transformA = body0->getWorldTransform();
-				input.m_transformB.setBasis( btMatrix3x3(rotq.inverse()*perturbeRot*rotq)*body1->getWorldTransform().getBasis());
-#ifdef DEBUG_CONTACTS
-				dispatchInfo.m_debugDraw->drawTransform(input.m_transformB,10.0);
-#endif
-			}
-			
-			btPerturbedContactResult perturbedResultOut(resultOut,input.m_transformA,input.m_transformB,unPerturbedTransform,perturbeA,dispatchInfo.m_debugDraw);
-			gjkPairDetector.getClosestPoints(input,perturbedResultOut,dispatchInfo.m_debugDraw);
-			}
-			
-		}
-	}
-
-	
-
-#ifdef USE_SEPDISTANCE_UTIL2
-	if (dispatchInfo.m_useConvexConservativeDistanceUtil && (sepDist>SIMD_EPSILON))
-	{
-		m_sepDistance.initSeparatingDistance(gjkPairDetector.getCachedSeparatingAxis(),sepDist,body0->getWorldTransform(),body1->getWorldTransform());
-	}
-#endif //USE_SEPDISTANCE_UTIL2
-
-
-	}
-
-	if (m_ownManifold)
-	{
-		resultOut->refreshContactPoints();
-	}
-
-}
-
-
-
-bool disableCcd = false;
-btScalar	btConvexConvexAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-	(void)resultOut;
-	(void)dispatchInfo;
-	///Rather then checking ALL pairs, only calculate TOI when motion exceeds threshold
-    
-	///Linear motion for one of objects needs to exceed m_ccdSquareMotionThreshold
-	///col0->m_worldTransform,
-	btScalar resultFraction = btScalar(1.);
-
-
-	btScalar squareMot0 = (col0->getInterpolationWorldTransform().getOrigin() - col0->getWorldTransform().getOrigin()).length2();
-	btScalar squareMot1 = (col1->getInterpolationWorldTransform().getOrigin() - col1->getWorldTransform().getOrigin()).length2();
-    
-	if (squareMot0 < col0->getCcdSquareMotionThreshold() &&
-		squareMot1 < col1->getCcdSquareMotionThreshold())
-		return resultFraction;
-
-	if (disableCcd)
-		return btScalar(1.);
-
-
-	//An adhoc way of testing the Continuous Collision Detection algorithms
-	//One object is approximated as a sphere, to simplify things
-	//Starting in penetration should report no time of impact
-	//For proper CCD, better accuracy and handling of 'allowed' penetration should be added
-	//also the mainloop of the physics should have a kind of toi queue (something like Brian Mirtich's application of Timewarp for Rigidbodies)
-
-		
-	/// Convex0 against sphere for Convex1
-	{
-		btConvexShape* convex0 = static_cast<btConvexShape*>(col0->getCollisionShape());
-
-		btSphereShape	sphere1(col1->getCcdSweptSphereRadius()); //todo: allow non-zero sphere sizes, for better approximation
-		btConvexCast::CastResult result;
-		btVoronoiSimplexSolver voronoiSimplex;
-		//SubsimplexConvexCast ccd0(&sphere,min0,&voronoiSimplex);
-		///Simplification, one object is simplified as a sphere
-		btGjkConvexCast ccd1( convex0 ,&sphere1,&voronoiSimplex);
-		//ContinuousConvexCollision ccd(min0,min1,&voronoiSimplex,0);
-		if (ccd1.calcTimeOfImpact(col0->getWorldTransform(),col0->getInterpolationWorldTransform(),
-			col1->getWorldTransform(),col1->getInterpolationWorldTransform(),result))
-		{
-		
-			//store result.m_fraction in both bodies
-		
-			if (col0->getHitFraction()> result.m_fraction)
-				col0->setHitFraction( result.m_fraction );
-
-			if (col1->getHitFraction() > result.m_fraction)
-				col1->setHitFraction( result.m_fraction);
-
-			if (resultFraction > result.m_fraction)
-				resultFraction = result.m_fraction;
-
-		}
-		
-		
-
-
-	}
-
-	/// Sphere (for convex0) against Convex1
-	{
-		btConvexShape* convex1 = static_cast<btConvexShape*>(col1->getCollisionShape());
-
-		btSphereShape	sphere0(col0->getCcdSweptSphereRadius()); //todo: allow non-zero sphere sizes, for better approximation
-		btConvexCast::CastResult result;
-		btVoronoiSimplexSolver voronoiSimplex;
-		//SubsimplexConvexCast ccd0(&sphere,min0,&voronoiSimplex);
-		///Simplification, one object is simplified as a sphere
-		btGjkConvexCast ccd1(&sphere0,convex1,&voronoiSimplex);
-		//ContinuousConvexCollision ccd(min0,min1,&voronoiSimplex,0);
-		if (ccd1.calcTimeOfImpact(col0->getWorldTransform(),col0->getInterpolationWorldTransform(),
-			col1->getWorldTransform(),col1->getInterpolationWorldTransform(),result))
-		{
-		
-			//store result.m_fraction in both bodies
-		
-			if (col0->getHitFraction()	> result.m_fraction)
-				col0->setHitFraction( result.m_fraction);
-
-			if (col1->getHitFraction() > result.m_fraction)
-				col1->setHitFraction( result.m_fraction);
-
-			if (resultFraction > result.m_fraction)
-				resultFraction = result.m_fraction;
-
-		}
-	}
-	
-	return resultFraction;
-
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h
deleted file mode 100644
index 4380b80..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_CONVEX_CONVEX_ALGORITHM_H
-#define BT_CONVEX_CONVEX_ALGORITHM_H
-
-#include "btActivatingCollisionAlgorithm.h"
-#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h"
-#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
-#include "btCollisionCreateFunc.h"
-#include "btCollisionDispatcher.h"
-#include "LinearMath/btTransformUtil.h" //for btConvexSeparatingDistanceUtil
-
-class btConvexPenetrationDepthSolver;
-
-///Enabling USE_SEPDISTANCE_UTIL2 requires 100% reliable distance computation. However, when using large size ratios GJK can be imprecise
-///so the distance is not conservative. In that case, enabling this USE_SEPDISTANCE_UTIL2 would result in failing/missing collisions.
-///Either improve GJK for large size ratios (testing a 100 units versus a 0.1 unit object) or only enable the util
-///for certain pairs that have a small size ratio
-
-//#define USE_SEPDISTANCE_UTIL2 1
-
-///The convexConvexAlgorithm collision algorithm implements time of impact, convex closest points and penetration depth calculations between two convex objects.
-///Multiple contact points are calculated by perturbing the orientation of the smallest object orthogonal to the separating normal.
-///This idea was described by Gino van den Bergen in this forum topic http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=4&t=288&p=888#p888
-class btConvexConvexAlgorithm : public btActivatingCollisionAlgorithm
-{
-#ifdef USE_SEPDISTANCE_UTIL2
-	btConvexSeparatingDistanceUtil	m_sepDistance;
-#endif
-	btSimplexSolverInterface*		m_simplexSolver;
-	btConvexPenetrationDepthSolver* m_pdSolver;
-
-	
-	bool	m_ownManifold;
-	btPersistentManifold*	m_manifoldPtr;
-	bool			m_lowLevelOfDetail;
-	
-	int m_numPerturbationIterations;
-	int m_minimumPointsPerturbationThreshold;
-
-
-	///cache separating vector to speedup collision detection
-	
-
-public:
-
-	btConvexConvexAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1, btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* pdSolver, int numPerturbationIterations, int minimumPointsPerturbationThreshold);
-
-
-	virtual ~btConvexConvexAlgorithm();
-
-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
-	{
-		///should we use m_ownManifold to avoid adding duplicates?
-		if (m_manifoldPtr && m_ownManifold)
-			manifoldArray.push_back(m_manifoldPtr);
-	}
-
-
-	void	setLowLevelOfDetail(bool useLowLevel);
-
-
-	const btPersistentManifold*	getManifold()
-	{
-		return m_manifoldPtr;
-	}
-
-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
-	{
-
-		btConvexPenetrationDepthSolver*		m_pdSolver;
-		btSimplexSolverInterface*			m_simplexSolver;
-		int m_numPerturbationIterations;
-		int m_minimumPointsPerturbationThreshold;
-
-		CreateFunc(btSimplexSolverInterface*			simplexSolver, btConvexPenetrationDepthSolver* pdSolver);
-		
-		virtual ~CreateFunc();
-
-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
-		{
-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btConvexConvexAlgorithm));
-			return new(mem) btConvexConvexAlgorithm(ci.m_manifold,ci,body0,body1,m_simplexSolver,m_pdSolver,m_numPerturbationIterations,m_minimumPointsPerturbationThreshold);
-		}
-	};
-
-
-};
-
-#endif //BT_CONVEX_CONVEX_ALGORITHM_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp
deleted file mode 100644
index dda85dc..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btConvexPlaneCollisionAlgorithm.h"
-
-#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-#include "BulletCollision/CollisionShapes/btConvexShape.h"
-#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"
-
-//#include <stdio.h>
-
-btConvexPlaneCollisionAlgorithm::btConvexPlaneCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* col0,btCollisionObject* col1, bool isSwapped, int numPerturbationIterations,int minimumPointsPerturbationThreshold)
-: btCollisionAlgorithm(ci),
-m_ownManifold(false),
-m_manifoldPtr(mf),
-m_isSwapped(isSwapped),
-m_numPerturbationIterations(numPerturbationIterations),
-m_minimumPointsPerturbationThreshold(minimumPointsPerturbationThreshold)
-{
-	btCollisionObject* convexObj = m_isSwapped? col1 : col0;
-	btCollisionObject* planeObj = m_isSwapped? col0 : col1;
-
-	if (!m_manifoldPtr && m_dispatcher->needsCollision(convexObj,planeObj))
-	{
-		m_manifoldPtr = m_dispatcher->getNewManifold(convexObj,planeObj);
-		m_ownManifold = true;
-	}
-}
-
-
-btConvexPlaneCollisionAlgorithm::~btConvexPlaneCollisionAlgorithm()
-{
-	if (m_ownManifold)
-	{
-		if (m_manifoldPtr)
-			m_dispatcher->releaseManifold(m_manifoldPtr);
-	}
-}
-
-void btConvexPlaneCollisionAlgorithm::collideSingleContact (const btQuaternion& perturbeRot, btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-    btCollisionObject* convexObj = m_isSwapped? body1 : body0;
-	btCollisionObject* planeObj = m_isSwapped? body0: body1;
-
-	btConvexShape* convexShape = (btConvexShape*) convexObj->getCollisionShape();
-	btStaticPlaneShape* planeShape = (btStaticPlaneShape*) planeObj->getCollisionShape();
-
-    bool hasCollision = false;
-	const btVector3& planeNormal = planeShape->getPlaneNormal();
-	const btScalar& planeConstant = planeShape->getPlaneConstant();
-	
-	btTransform convexWorldTransform = convexObj->getWorldTransform();
-	btTransform convexInPlaneTrans;
-	convexInPlaneTrans= planeObj->getWorldTransform().inverse() * convexWorldTransform;
-	//now perturbe the convex-world transform
-	convexWorldTransform.getBasis()*=btMatrix3x3(perturbeRot);
-	btTransform planeInConvex;
-	planeInConvex= convexWorldTransform.inverse() * planeObj->getWorldTransform();
-	
-	btVector3 vtx = convexShape->localGetSupportingVertex(planeInConvex.getBasis()*-planeNormal);
-
-	btVector3 vtxInPlane = convexInPlaneTrans(vtx);
-	btScalar distance = (planeNormal.dot(vtxInPlane) - planeConstant);
-
-	btVector3 vtxInPlaneProjected = vtxInPlane - distance*planeNormal;
-	btVector3 vtxInPlaneWorld = planeObj->getWorldTransform() * vtxInPlaneProjected;
-
-	hasCollision = distance < m_manifoldPtr->getContactBreakingThreshold();
-	resultOut->setPersistentManifold(m_manifoldPtr);
-	if (hasCollision)
-	{
-		/// report a contact. internally this will be kept persistent, and contact reduction is done
-		btVector3 normalOnSurfaceB = planeObj->getWorldTransform().getBasis() * planeNormal;
-		btVector3 pOnB = vtxInPlaneWorld;
-		resultOut->addContactPoint(normalOnSurfaceB,pOnB,distance);
-	}
-}
-
-
-void btConvexPlaneCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-	(void)dispatchInfo;
-	if (!m_manifoldPtr)
-		return;
-
-    btCollisionObject* convexObj = m_isSwapped? body1 : body0;
-	btCollisionObject* planeObj = m_isSwapped? body0: body1;
-
-	btConvexShape* convexShape = (btConvexShape*) convexObj->getCollisionShape();
-	btStaticPlaneShape* planeShape = (btStaticPlaneShape*) planeObj->getCollisionShape();
-
-    
-	const btVector3& planeNormal = planeShape->getPlaneNormal();
-	//const btScalar& planeConstant = planeShape->getPlaneConstant();
-
-	//first perform a collision query with the non-perturbated collision objects
-	{
-		btQuaternion rotq(0,0,0,1);
-		collideSingleContact(rotq,body0,body1,dispatchInfo,resultOut);
-	}
-
-	if (resultOut->getPersistentManifold()->getNumContacts()<m_minimumPointsPerturbationThreshold)
-	{
-		btVector3 v0,v1;
-		btPlaneSpace1(planeNormal,v0,v1);
-		//now perform 'm_numPerturbationIterations' collision queries with the perturbated collision objects
-
-		const btScalar angleLimit = 0.125f * SIMD_PI;
-		btScalar perturbeAngle;
-		btScalar radius = convexShape->getAngularMotionDisc();
-		perturbeAngle = gContactBreakingThreshold / radius;
-		if ( perturbeAngle > angleLimit ) 
-				perturbeAngle = angleLimit;
-
-		btQuaternion perturbeRot(v0,perturbeAngle);
-		for (int i=0;i<m_numPerturbationIterations;i++)
-		{
-			btScalar iterationAngle = i*(SIMD_2_PI/btScalar(m_numPerturbationIterations));
-			btQuaternion rotq(planeNormal,iterationAngle);
-			collideSingleContact(rotq.inverse()*perturbeRot*rotq,body0,body1,dispatchInfo,resultOut);
-		}
-	}
-
-	if (m_ownManifold)
-	{
-		if (m_manifoldPtr->getNumContacts())
-		{
-			resultOut->refreshContactPoints();
-		}
-	}
-}
-
-btScalar btConvexPlaneCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-	(void)resultOut;
-	(void)dispatchInfo;
-	(void)col0;
-	(void)col1;
-
-	//not yet
-	return btScalar(1.);
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.h
deleted file mode 100644
index a3d59f4..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_CONVEX_PLANE_COLLISION_ALGORITHM_H
-#define BT_CONVEX_PLANE_COLLISION_ALGORITHM_H
-
-#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"
-class btPersistentManifold;
-#include "btCollisionDispatcher.h"
-
-#include "LinearMath/btVector3.h"
-
-/// btSphereBoxCollisionAlgorithm  provides sphere-box collision detection.
-/// Other features are frame-coherency (persistent data) and collision response.
-class btConvexPlaneCollisionAlgorithm : public btCollisionAlgorithm
-{
-	bool		m_ownManifold;
-	btPersistentManifold*	m_manifoldPtr;
-	bool		m_isSwapped;
-	int			m_numPerturbationIterations;
-	int			m_minimumPointsPerturbationThreshold;
-
-public:
-
-	btConvexPlaneCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* col0,btCollisionObject* col1, bool isSwapped, int numPerturbationIterations,int minimumPointsPerturbationThreshold);
-
-	virtual ~btConvexPlaneCollisionAlgorithm();
-
-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	void collideSingleContact (const btQuaternion& perturbeRot, btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
-	{
-		if (m_manifoldPtr && m_ownManifold)
-		{
-			manifoldArray.push_back(m_manifoldPtr);
-		}
-	}
-
-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
-	{
-		int	m_numPerturbationIterations;
-		int m_minimumPointsPerturbationThreshold;
-			
-		CreateFunc() 
-			: m_numPerturbationIterations(1),
-			m_minimumPointsPerturbationThreshold(1)
-		{
-		}
-		
-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
-		{
-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btConvexPlaneCollisionAlgorithm));
-			if (!m_swapped)
-			{
-				return new(mem) btConvexPlaneCollisionAlgorithm(0,ci,body0,body1,false,m_numPerturbationIterations,m_minimumPointsPerturbationThreshold);
-			} else
-			{
-				return new(mem) btConvexPlaneCollisionAlgorithm(0,ci,body0,body1,true,m_numPerturbationIterations,m_minimumPointsPerturbationThreshold);
-			}
-		}
-	};
-
-};
-
-#endif //BT_CONVEX_PLANE_COLLISION_ALGORITHM_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp
deleted file mode 100644
index c27d8ce..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btDefaultCollisionConfiguration.h"
-
-#include "BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h"
-#include "BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h"
-#include "BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h"
-#include "BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h"
-#include "BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.h"
-#include "BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.h"
-#include "BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h"
-#ifdef USE_BUGGY_SPHERE_BOX_ALGORITHM
-#include "BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h"
-#endif //USE_BUGGY_SPHERE_BOX_ALGORITHM
-#include "BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h"
-#include "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h"
-#include "BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h"
-#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
-
-
-
-#include "LinearMath/btStackAlloc.h"
-#include "LinearMath/btPoolAllocator.h"
-
-
-
-
-
-btDefaultCollisionConfiguration::btDefaultCollisionConfiguration(const btDefaultCollisionConstructionInfo& constructionInfo)
-//btDefaultCollisionConfiguration::btDefaultCollisionConfiguration(btStackAlloc*	stackAlloc,btPoolAllocator*	persistentManifoldPool,btPoolAllocator*	collisionAlgorithmPool)
-{
-
-	void* mem = btAlignedAlloc(sizeof(btVoronoiSimplexSolver),16);
-	m_simplexSolver = new (mem)btVoronoiSimplexSolver();
-
-	if (constructionInfo.m_useEpaPenetrationAlgorithm)
-	{
-		mem = btAlignedAlloc(sizeof(btGjkEpaPenetrationDepthSolver),16);
-		m_pdSolver = new (mem)btGjkEpaPenetrationDepthSolver;
-	}else
-	{
-		mem = btAlignedAlloc(sizeof(btMinkowskiPenetrationDepthSolver),16);
-		m_pdSolver = new (mem)btMinkowskiPenetrationDepthSolver;
-	}
-	
-	//default CreationFunctions, filling the m_doubleDispatch table
-	mem = btAlignedAlloc(sizeof(btConvexConvexAlgorithm::CreateFunc),16);
-	m_convexConvexCreateFunc = new(mem) btConvexConvexAlgorithm::CreateFunc(m_simplexSolver,m_pdSolver);
-	mem = btAlignedAlloc(sizeof(btConvexConcaveCollisionAlgorithm::CreateFunc),16);
-	m_convexConcaveCreateFunc = new (mem)btConvexConcaveCollisionAlgorithm::CreateFunc;
-	mem = btAlignedAlloc(sizeof(btConvexConcaveCollisionAlgorithm::CreateFunc),16);
-	m_swappedConvexConcaveCreateFunc = new (mem)btConvexConcaveCollisionAlgorithm::SwappedCreateFunc;
-	mem = btAlignedAlloc(sizeof(btCompoundCollisionAlgorithm::CreateFunc),16);
-	m_compoundCreateFunc = new (mem)btCompoundCollisionAlgorithm::CreateFunc;
-	mem = btAlignedAlloc(sizeof(btCompoundCollisionAlgorithm::SwappedCreateFunc),16);
-	m_swappedCompoundCreateFunc = new (mem)btCompoundCollisionAlgorithm::SwappedCreateFunc;
-	mem = btAlignedAlloc(sizeof(btEmptyAlgorithm::CreateFunc),16);
-	m_emptyCreateFunc = new(mem) btEmptyAlgorithm::CreateFunc;
-	
-	mem = btAlignedAlloc(sizeof(btSphereSphereCollisionAlgorithm::CreateFunc),16);
-	m_sphereSphereCF = new(mem) btSphereSphereCollisionAlgorithm::CreateFunc;
-#ifdef USE_BUGGY_SPHERE_BOX_ALGORITHM
-	mem = btAlignedAlloc(sizeof(btSphereBoxCollisionAlgorithm::CreateFunc),16);
-	m_sphereBoxCF = new(mem) btSphereBoxCollisionAlgorithm::CreateFunc;
-	mem = btAlignedAlloc(sizeof(btSphereBoxCollisionAlgorithm::CreateFunc),16);
-	m_boxSphereCF = new (mem)btSphereBoxCollisionAlgorithm::CreateFunc;
-	m_boxSphereCF->m_swapped = true;
-#endif //USE_BUGGY_SPHERE_BOX_ALGORITHM
-
-	mem = btAlignedAlloc(sizeof(btSphereTriangleCollisionAlgorithm::CreateFunc),16);
-	m_sphereTriangleCF = new (mem)btSphereTriangleCollisionAlgorithm::CreateFunc;
-	mem = btAlignedAlloc(sizeof(btSphereTriangleCollisionAlgorithm::CreateFunc),16);
-	m_triangleSphereCF = new (mem)btSphereTriangleCollisionAlgorithm::CreateFunc;
-	m_triangleSphereCF->m_swapped = true;
-	
-	mem = btAlignedAlloc(sizeof(btBoxBoxCollisionAlgorithm::CreateFunc),16);
-	m_boxBoxCF = new(mem)btBoxBoxCollisionAlgorithm::CreateFunc;
-
-	//convex versus plane
-	mem = btAlignedAlloc (sizeof(btConvexPlaneCollisionAlgorithm::CreateFunc),16);
-	m_convexPlaneCF = new (mem) btConvexPlaneCollisionAlgorithm::CreateFunc;
-	mem = btAlignedAlloc (sizeof(btConvexPlaneCollisionAlgorithm::CreateFunc),16);
-	m_planeConvexCF = new (mem) btConvexPlaneCollisionAlgorithm::CreateFunc;
-	m_planeConvexCF->m_swapped = true;
-	
-	///calculate maximum element size, big enough to fit any collision algorithm in the memory pool
-	int maxSize = sizeof(btConvexConvexAlgorithm);
-	int maxSize2 = sizeof(btConvexConcaveCollisionAlgorithm);
-	int maxSize3 = sizeof(btCompoundCollisionAlgorithm);
-	int sl = sizeof(btConvexSeparatingDistanceUtil);
-	sl = sizeof(btGjkPairDetector);
-	int	collisionAlgorithmMaxElementSize = btMax(maxSize,constructionInfo.m_customCollisionAlgorithmMaxElementSize);
-	collisionAlgorithmMaxElementSize = btMax(collisionAlgorithmMaxElementSize,maxSize2);
-	collisionAlgorithmMaxElementSize = btMax(collisionAlgorithmMaxElementSize,maxSize3);
-
-	if (constructionInfo.m_stackAlloc)
-	{
-		m_ownsStackAllocator = false;
-		this->m_stackAlloc = constructionInfo.m_stackAlloc;
-	} else
-	{
-		m_ownsStackAllocator = true;
-		void* mem = btAlignedAlloc(sizeof(btStackAlloc),16);
-		m_stackAlloc = new(mem)btStackAlloc(constructionInfo.m_defaultStackAllocatorSize);
-	}
-		
-	if (constructionInfo.m_persistentManifoldPool)
-	{
-		m_ownsPersistentManifoldPool = false;
-		m_persistentManifoldPool = constructionInfo.m_persistentManifoldPool;
-	} else
-	{
-		m_ownsPersistentManifoldPool = true;
-		void* mem = btAlignedAlloc(sizeof(btPoolAllocator),16);
-		m_persistentManifoldPool = new (mem) btPoolAllocator(sizeof(btPersistentManifold),constructionInfo.m_defaultMaxPersistentManifoldPoolSize);
-	}
-	
-	if (constructionInfo.m_collisionAlgorithmPool)
-	{
-		m_ownsCollisionAlgorithmPool = false;
-		m_collisionAlgorithmPool = constructionInfo.m_collisionAlgorithmPool;
-	} else
-	{
-		m_ownsCollisionAlgorithmPool = true;
-		void* mem = btAlignedAlloc(sizeof(btPoolAllocator),16);
-		m_collisionAlgorithmPool = new(mem) btPoolAllocator(collisionAlgorithmMaxElementSize,constructionInfo.m_defaultMaxCollisionAlgorithmPoolSize);
-	}
-
-
-}
-
-btDefaultCollisionConfiguration::~btDefaultCollisionConfiguration()
-{
-	if (m_ownsStackAllocator)
-	{
-		m_stackAlloc->destroy();
-		m_stackAlloc->~btStackAlloc();
-		btAlignedFree(m_stackAlloc);
-	}
-	if (m_ownsCollisionAlgorithmPool)
-	{
-		m_collisionAlgorithmPool->~btPoolAllocator();
-		btAlignedFree(m_collisionAlgorithmPool);
-	}
-	if (m_ownsPersistentManifoldPool)
-	{
-		m_persistentManifoldPool->~btPoolAllocator();
-		btAlignedFree(m_persistentManifoldPool);
-	}
-
-	m_convexConvexCreateFunc->~btCollisionAlgorithmCreateFunc();
-	btAlignedFree(	m_convexConvexCreateFunc);
-
-	m_convexConcaveCreateFunc->~btCollisionAlgorithmCreateFunc();
-	btAlignedFree( m_convexConcaveCreateFunc);
-	m_swappedConvexConcaveCreateFunc->~btCollisionAlgorithmCreateFunc();
-	btAlignedFree( m_swappedConvexConcaveCreateFunc);
-
-	m_compoundCreateFunc->~btCollisionAlgorithmCreateFunc();
-	btAlignedFree( m_compoundCreateFunc);
-
-	m_swappedCompoundCreateFunc->~btCollisionAlgorithmCreateFunc();
-	btAlignedFree( m_swappedCompoundCreateFunc);
-
-	m_emptyCreateFunc->~btCollisionAlgorithmCreateFunc();
-	btAlignedFree( m_emptyCreateFunc);
-
-	m_sphereSphereCF->~btCollisionAlgorithmCreateFunc();
-	btAlignedFree( m_sphereSphereCF);
-
-#ifdef USE_BUGGY_SPHERE_BOX_ALGORITHM
-	m_sphereBoxCF->~btCollisionAlgorithmCreateFunc();
-	btAlignedFree( m_sphereBoxCF);
-	m_boxSphereCF->~btCollisionAlgorithmCreateFunc();
-	btAlignedFree( m_boxSphereCF);
-#endif //USE_BUGGY_SPHERE_BOX_ALGORITHM
-
-	m_sphereTriangleCF->~btCollisionAlgorithmCreateFunc();
-	btAlignedFree( m_sphereTriangleCF);
-	m_triangleSphereCF->~btCollisionAlgorithmCreateFunc();
-	btAlignedFree( m_triangleSphereCF);
-	m_boxBoxCF->~btCollisionAlgorithmCreateFunc();
-	btAlignedFree( m_boxBoxCF);
-
-	m_convexPlaneCF->~btCollisionAlgorithmCreateFunc();
-	btAlignedFree( m_convexPlaneCF);
-	m_planeConvexCF->~btCollisionAlgorithmCreateFunc();
-	btAlignedFree( m_planeConvexCF);
-
-	m_simplexSolver->~btVoronoiSimplexSolver();
-	btAlignedFree(m_simplexSolver);
-
-	m_pdSolver->~btConvexPenetrationDepthSolver();
-	
-	btAlignedFree(m_pdSolver);
-
-
-}
-
-
-btCollisionAlgorithmCreateFunc* btDefaultCollisionConfiguration::getCollisionAlgorithmCreateFunc(int proxyType0,int proxyType1)
-{
-
-
-
-	if ((proxyType0 == SPHERE_SHAPE_PROXYTYPE) && (proxyType1==SPHERE_SHAPE_PROXYTYPE))
-	{
-		return	m_sphereSphereCF;
-	}
-#ifdef USE_BUGGY_SPHERE_BOX_ALGORITHM
-	if ((proxyType0 == SPHERE_SHAPE_PROXYTYPE) && (proxyType1==BOX_SHAPE_PROXYTYPE))
-	{
-		return	m_sphereBoxCF;
-	}
-
-	if ((proxyType0 == BOX_SHAPE_PROXYTYPE ) && (proxyType1==SPHERE_SHAPE_PROXYTYPE))
-	{
-		return	m_boxSphereCF;
-	}
-#endif //USE_BUGGY_SPHERE_BOX_ALGORITHM
-
-
-	if ((proxyType0 == SPHERE_SHAPE_PROXYTYPE ) && (proxyType1==TRIANGLE_SHAPE_PROXYTYPE))
-	{
-		return	m_sphereTriangleCF;
-	}
-
-	if ((proxyType0 == TRIANGLE_SHAPE_PROXYTYPE  ) && (proxyType1==SPHERE_SHAPE_PROXYTYPE))
-	{
-		return	m_triangleSphereCF;
-	} 
-
-	if ((proxyType0 == BOX_SHAPE_PROXYTYPE) && (proxyType1 == BOX_SHAPE_PROXYTYPE))
-	{
-		return m_boxBoxCF;
-	}
-	
-	if (btBroadphaseProxy::isConvex(proxyType0) && (proxyType1 == STATIC_PLANE_PROXYTYPE))
-	{
-		return m_convexPlaneCF;
-	}
-
-	if (btBroadphaseProxy::isConvex(proxyType1) && (proxyType0 == STATIC_PLANE_PROXYTYPE))
-	{
-		return m_planeConvexCF;
-	}
-	
-
-
-	if (btBroadphaseProxy::isConvex(proxyType0) && btBroadphaseProxy::isConvex(proxyType1))
-	{
-		return m_convexConvexCreateFunc;
-	}
-
-	if (btBroadphaseProxy::isConvex(proxyType0) && btBroadphaseProxy::isConcave(proxyType1))
-	{
-		return m_convexConcaveCreateFunc;
-	}
-
-	if (btBroadphaseProxy::isConvex(proxyType1) && btBroadphaseProxy::isConcave(proxyType0))
-	{
-		return m_swappedConvexConcaveCreateFunc;
-	}
-
-	if (btBroadphaseProxy::isCompound(proxyType0))
-	{
-		return m_compoundCreateFunc;
-	} else
-	{
-		if (btBroadphaseProxy::isCompound(proxyType1))
-		{
-			return m_swappedCompoundCreateFunc;
-		}
-	}
-
-	//failed to find an algorithm
-	return m_emptyCreateFunc;
-}
-
-void btDefaultCollisionConfiguration::setConvexConvexMultipointIterations(int numPerturbationIterations, int minimumPointsPerturbationThreshold)
-{
-	btConvexConvexAlgorithm::CreateFunc* convexConvex = (btConvexConvexAlgorithm::CreateFunc*) m_convexConvexCreateFunc;
-	convexConvex->m_numPerturbationIterations = numPerturbationIterations;
-	convexConvex->m_minimumPointsPerturbationThreshold = minimumPointsPerturbationThreshold;
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h
deleted file mode 100644
index 6aa0d8c..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_DEFAULT_COLLISION_CONFIGURATION
-#define BT_DEFAULT_COLLISION_CONFIGURATION
-
-#include "btCollisionConfiguration.h"
-class btVoronoiSimplexSolver;
-class btConvexPenetrationDepthSolver;
-
-struct	btDefaultCollisionConstructionInfo
-{
-	btStackAlloc*		m_stackAlloc;
-	btPoolAllocator*	m_persistentManifoldPool;
-	btPoolAllocator*	m_collisionAlgorithmPool;
-	int					m_defaultMaxPersistentManifoldPoolSize;
-	int					m_defaultMaxCollisionAlgorithmPoolSize;
-	int					m_customCollisionAlgorithmMaxElementSize;
-	int					m_defaultStackAllocatorSize;
-	int					m_useEpaPenetrationAlgorithm;
-
-	btDefaultCollisionConstructionInfo()
-		:m_stackAlloc(0),
-		m_persistentManifoldPool(0),
-		m_collisionAlgorithmPool(0),
-		m_defaultMaxPersistentManifoldPoolSize(4096),
-		m_defaultMaxCollisionAlgorithmPoolSize(4096),
-		m_customCollisionAlgorithmMaxElementSize(0),
-		m_defaultStackAllocatorSize(0),
-		m_useEpaPenetrationAlgorithm(true)
-	{
-	}
-};
-
-
-
-///btCollisionConfiguration allows to configure Bullet collision detection
-///stack allocator, pool memory allocators
-///@todo: describe the meaning
-class	btDefaultCollisionConfiguration : public btCollisionConfiguration
-{
-
-protected:
-
-	int	m_persistentManifoldPoolSize;
-	
-	btStackAlloc*	m_stackAlloc;
-	bool	m_ownsStackAllocator;
-
-	btPoolAllocator*	m_persistentManifoldPool;
-	bool	m_ownsPersistentManifoldPool;
-
-
-	btPoolAllocator*	m_collisionAlgorithmPool;
-	bool	m_ownsCollisionAlgorithmPool;
-
-	//default simplex/penetration depth solvers
-	btVoronoiSimplexSolver*	m_simplexSolver;
-	btConvexPenetrationDepthSolver*	m_pdSolver;
-	
-	//default CreationFunctions, filling the m_doubleDispatch table
-	btCollisionAlgorithmCreateFunc*	m_convexConvexCreateFunc;
-	btCollisionAlgorithmCreateFunc*	m_convexConcaveCreateFunc;
-	btCollisionAlgorithmCreateFunc*	m_swappedConvexConcaveCreateFunc;
-	btCollisionAlgorithmCreateFunc*	m_compoundCreateFunc;
-	btCollisionAlgorithmCreateFunc*	m_swappedCompoundCreateFunc;
-	btCollisionAlgorithmCreateFunc* m_emptyCreateFunc;
-	btCollisionAlgorithmCreateFunc* m_sphereSphereCF;
-#ifdef USE_BUGGY_SPHERE_BOX_ALGORITHM
-	btCollisionAlgorithmCreateFunc* m_sphereBoxCF;
-	btCollisionAlgorithmCreateFunc* m_boxSphereCF;
-#endif //USE_BUGGY_SPHERE_BOX_ALGORITHM
-
-	btCollisionAlgorithmCreateFunc* m_boxBoxCF;
-	btCollisionAlgorithmCreateFunc*	m_sphereTriangleCF;
-	btCollisionAlgorithmCreateFunc*	m_triangleSphereCF;
-	btCollisionAlgorithmCreateFunc*	m_planeConvexCF;
-	btCollisionAlgorithmCreateFunc*	m_convexPlaneCF;
-	
-public:
-
-
-	btDefaultCollisionConfiguration(const btDefaultCollisionConstructionInfo& constructionInfo = btDefaultCollisionConstructionInfo());
-
-	virtual ~btDefaultCollisionConfiguration();
-
-		///memory pools
-	virtual btPoolAllocator* getPersistentManifoldPool()
-	{
-		return m_persistentManifoldPool;
-	}
-
-	virtual btPoolAllocator* getCollisionAlgorithmPool()
-	{
-		return m_collisionAlgorithmPool;
-	}
-
-	virtual btStackAlloc*	getStackAllocator()
-	{
-		return m_stackAlloc;
-	}
-
-	virtual	btVoronoiSimplexSolver*	getSimplexSolver()
-	{
-		return m_simplexSolver;
-	}
-
-
-	virtual btCollisionAlgorithmCreateFunc* getCollisionAlgorithmCreateFunc(int proxyType0,int proxyType1);
-
-	///Use this method to allow to generate multiple contact points between at once, between two objects using the generic convex-convex algorithm.
-	///By default, this feature is disabled for best performance.
-	///@param numPerturbationIterations controls the number of collision queries. Set it to zero to disable the feature.
-	///@param minimumPointsPerturbationThreshold is the minimum number of points in the contact cache, above which the feature is disabled
-	///3 is a good value for both params, if you want to enable the feature. This is because the default contact cache contains a maximum of 4 points, and one collision query at the unperturbed orientation is performed first.
-	///See Bullet/Demos/CollisionDemo for an example how this feature gathers multiple points.
-	///@todo we could add a per-object setting of those parameters, for level-of-detail collision detection.
-	void	setConvexConvexMultipointIterations(int numPerturbationIterations=3, int minimumPointsPerturbationThreshold = 3);
-
-};
-
-#endif //BT_DEFAULT_COLLISION_CONFIGURATION
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp
deleted file mode 100644
index 9360543..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btEmptyCollisionAlgorithm.h"
-
-
-
-btEmptyAlgorithm::btEmptyAlgorithm(const btCollisionAlgorithmConstructionInfo& ci)
-	: btCollisionAlgorithm(ci)
-{
-}
-
-void btEmptyAlgorithm::processCollision (btCollisionObject* ,btCollisionObject* ,const btDispatcherInfo& ,btManifoldResult* )
-{
-}
-
-btScalar btEmptyAlgorithm::calculateTimeOfImpact(btCollisionObject* ,btCollisionObject* ,const btDispatcherInfo& ,btManifoldResult* )
-{
-	return btScalar(1.);
-}
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h
deleted file mode 100644
index f03c9dc..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_EMPTY_ALGORITH
-#define BT_EMPTY_ALGORITH
-#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
-#include "btCollisionCreateFunc.h"
-#include "btCollisionDispatcher.h"
-
-#define ATTRIBUTE_ALIGNED(a)
-
-///EmptyAlgorithm is a stub for unsupported collision pairs.
-///The dispatcher can dispatch a persistent btEmptyAlgorithm to avoid a search every frame.
-class btEmptyAlgorithm : public btCollisionAlgorithm
-{
-
-public:
-	
-	btEmptyAlgorithm(const btCollisionAlgorithmConstructionInfo& ci);
-
-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
-	{
-	}
-
-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
-	{
-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
-		{
-			(void)body0;
-			(void)body1;
-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btEmptyAlgorithm));
-			return new(mem) btEmptyAlgorithm(ci);
-		}
-	};
-
-} ATTRIBUTE_ALIGNED(16);
-
-#endif //BT_EMPTY_ALGORITH
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btGhostObject.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btGhostObject.cpp
deleted file mode 100644
index 86141fa..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btGhostObject.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2008 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btGhostObject.h"
-#include "btCollisionWorld.h"
-#include "BulletCollision/CollisionShapes/btConvexShape.h"
-#include "LinearMath/btAabbUtil2.h"
-
-btGhostObject::btGhostObject()
-{
-	m_internalType = CO_GHOST_OBJECT;
-}
-
-btGhostObject::~btGhostObject()
-{
-	///btGhostObject should have been removed from the world, so no overlapping objects
-	btAssert(!m_overlappingObjects.size());
-}
-
-
-void btGhostObject::addOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btBroadphaseProxy* thisProxy)
-{
-	btCollisionObject* otherObject = (btCollisionObject*)otherProxy->m_clientObject;
-	btAssert(otherObject);
-	///if this linearSearch becomes too slow (too many overlapping objects) we should add a more appropriate data structure
-	int index = m_overlappingObjects.findLinearSearch(otherObject);
-	if (index==m_overlappingObjects.size())
-	{
-		//not found
-		m_overlappingObjects.push_back(otherObject);
-	}
-}
-
-void btGhostObject::removeOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btDispatcher* dispatcher,btBroadphaseProxy* thisProxy)
-{
-	btCollisionObject* otherObject = (btCollisionObject*)otherProxy->m_clientObject;
-	btAssert(otherObject);
-	int index = m_overlappingObjects.findLinearSearch(otherObject);
-	if (index<m_overlappingObjects.size())
-	{
-		m_overlappingObjects[index] = m_overlappingObjects[m_overlappingObjects.size()-1];
-		m_overlappingObjects.pop_back();
-	}
-}
-
-
-btPairCachingGhostObject::btPairCachingGhostObject()
-{
-	m_hashPairCache = new (btAlignedAlloc(sizeof(btHashedOverlappingPairCache),16)) btHashedOverlappingPairCache();
-}
-
-btPairCachingGhostObject::~btPairCachingGhostObject()
-{
-	m_hashPairCache->~btHashedOverlappingPairCache();
-	btAlignedFree( m_hashPairCache );
-}
-
-void btPairCachingGhostObject::addOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btBroadphaseProxy* thisProxy)
-{
-	btBroadphaseProxy*actualThisProxy = thisProxy ? thisProxy : getBroadphaseHandle();
-	btAssert(actualThisProxy);
-
-	btCollisionObject* otherObject = (btCollisionObject*)otherProxy->m_clientObject;
-	btAssert(otherObject);
-	int index = m_overlappingObjects.findLinearSearch(otherObject);
-	if (index==m_overlappingObjects.size())
-	{
-		m_overlappingObjects.push_back(otherObject);
-		m_hashPairCache->addOverlappingPair(actualThisProxy,otherProxy);
-	}
-}
-
-void btPairCachingGhostObject::removeOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btDispatcher* dispatcher,btBroadphaseProxy* thisProxy1)
-{
-	btCollisionObject* otherObject = (btCollisionObject*)otherProxy->m_clientObject;
-	btBroadphaseProxy* actualThisProxy = thisProxy1 ? thisProxy1 : getBroadphaseHandle();
-	btAssert(actualThisProxy);
-
-	btAssert(otherObject);
-	int index = m_overlappingObjects.findLinearSearch(otherObject);
-	if (index<m_overlappingObjects.size())
-	{
-		m_overlappingObjects[index] = m_overlappingObjects[m_overlappingObjects.size()-1];
-		m_overlappingObjects.pop_back();
-		m_hashPairCache->removeOverlappingPair(actualThisProxy,otherProxy,dispatcher);
-	}
-}
-
-
-void	btGhostObject::convexSweepTest(const btConvexShape* castShape, const btTransform& convexFromWorld, const btTransform& convexToWorld, btCollisionWorld::ConvexResultCallback& resultCallback, btScalar allowedCcdPenetration) const
-{
-	btTransform	convexFromTrans,convexToTrans;
-	convexFromTrans = convexFromWorld;
-	convexToTrans = convexToWorld;
-	btVector3 castShapeAabbMin, castShapeAabbMax;
-	/* Compute AABB that encompasses angular movement */
-	{
-		btVector3 linVel, angVel;
-		btTransformUtil::calculateVelocity (convexFromTrans, convexToTrans, 1.0, linVel, angVel);
-		btTransform R;
-		R.setIdentity ();
-		R.setRotation (convexFromTrans.getRotation());
-		castShape->calculateTemporalAabb (R, linVel, angVel, 1.0, castShapeAabbMin, castShapeAabbMax);
-	}
-
-	/// go over all objects, and if the ray intersects their aabb + cast shape aabb,
-	// do a ray-shape query using convexCaster (CCD)
-	int i;
-	for (i=0;i<m_overlappingObjects.size();i++)
-	{
-		btCollisionObject*	collisionObject= m_overlappingObjects[i];
-		//only perform raycast if filterMask matches
-		if(resultCallback.needsCollision(collisionObject->getBroadphaseHandle())) {
-			//RigidcollisionObject* collisionObject = ctrl->GetRigidcollisionObject();
-			btVector3 collisionObjectAabbMin,collisionObjectAabbMax;
-			collisionObject->getCollisionShape()->getAabb(collisionObject->getWorldTransform(),collisionObjectAabbMin,collisionObjectAabbMax);
-			AabbExpand (collisionObjectAabbMin, collisionObjectAabbMax, castShapeAabbMin, castShapeAabbMax);
-			btScalar hitLambda = btScalar(1.); //could use resultCallback.m_closestHitFraction, but needs testing
-			btVector3 hitNormal;
-			if (btRayAabb(convexFromWorld.getOrigin(),convexToWorld.getOrigin(),collisionObjectAabbMin,collisionObjectAabbMax,hitLambda,hitNormal))
-			{
-				btCollisionWorld::objectQuerySingle(castShape, convexFromTrans,convexToTrans,
-					collisionObject,
-						collisionObject->getCollisionShape(),
-						collisionObject->getWorldTransform(),
-						resultCallback,
-						allowedCcdPenetration);
-			}
-		}
-	}
-
-}
-
-void	btGhostObject::rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, btCollisionWorld::RayResultCallback& resultCallback) const
-{
-	btTransform rayFromTrans;
-	rayFromTrans.setIdentity();
-	rayFromTrans.setOrigin(rayFromWorld);
-	btTransform  rayToTrans;
-	rayToTrans.setIdentity();
-	rayToTrans.setOrigin(rayToWorld);
-
-
-	int i;
-	for (i=0;i<m_overlappingObjects.size();i++)
-	{
-		btCollisionObject*	collisionObject= m_overlappingObjects[i];
-		//only perform raycast if filterMask matches
-		if(resultCallback.needsCollision(collisionObject->getBroadphaseHandle())) 
-		{
-			btCollisionWorld::rayTestSingle(rayFromTrans,rayToTrans,
-							collisionObject,
-								collisionObject->getCollisionShape(),
-								collisionObject->getWorldTransform(),
-								resultCallback);
-		}
-	}
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btGhostObject.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btGhostObject.h
deleted file mode 100644
index 8ec8613..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btGhostObject.h
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2008 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_GHOST_OBJECT_H
-#define BT_GHOST_OBJECT_H
-
-
-#include "btCollisionObject.h"
-#include "BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h"
-#include "LinearMath/btAlignedAllocator.h"
-#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"
-#include "btCollisionWorld.h"
-
-class btConvexShape;
-
-class btDispatcher;
-
-///The btGhostObject can keep track of all objects that are overlapping
-///By default, this overlap is based on the AABB
-///This is useful for creating a character controller, collision sensors/triggers, explosions etc.
-///We plan on adding rayTest and other queries for the btGhostObject
-ATTRIBUTE_ALIGNED16(class) btGhostObject : public btCollisionObject
-{
-protected:
-
-	btAlignedObjectArray<btCollisionObject*> m_overlappingObjects;
-
-public:
-
-	btGhostObject();
-
-	virtual ~btGhostObject();
-
-	void	convexSweepTest(const class btConvexShape* castShape, const btTransform& convexFromWorld, const btTransform& convexToWorld, btCollisionWorld::ConvexResultCallback& resultCallback, btScalar allowedCcdPenetration = 0.f) const;
-
-	void	rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, btCollisionWorld::RayResultCallback& resultCallback) const; 
-
-	///this method is mainly for expert/internal use only.
-	virtual void	addOverlappingObjectInternal(btBroadphaseProxy* otherProxy, btBroadphaseProxy* thisProxy=0);
-	///this method is mainly for expert/internal use only.
-	virtual void	removeOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btDispatcher* dispatcher,btBroadphaseProxy* thisProxy=0);
-
-	int	getNumOverlappingObjects() const
-	{
-		return m_overlappingObjects.size();
-	}
-
-	btCollisionObject*	getOverlappingObject(int index)
-	{
-		return m_overlappingObjects[index];
-	}
-
-	const btCollisionObject*	getOverlappingObject(int index) const
-	{
-		return m_overlappingObjects[index];
-	}
-
-	btAlignedObjectArray<btCollisionObject*>&	getOverlappingPairs()
-	{
-		return m_overlappingObjects;
-	}
-
-	const btAlignedObjectArray<btCollisionObject*>	getOverlappingPairs() const
-	{
-		return m_overlappingObjects;
-	}
-
-	//
-	// internal cast
-	//
-
-	static const btGhostObject*	upcast(const btCollisionObject* colObj)
-	{
-		if (colObj->getInternalType()==CO_GHOST_OBJECT)
-			return (const btGhostObject*)colObj;
-		return 0;
-	}
-	static btGhostObject*			upcast(btCollisionObject* colObj)
-	{
-		if (colObj->getInternalType()==CO_GHOST_OBJECT)
-			return (btGhostObject*)colObj;
-		return 0;
-	}
-
-};
-
-class	btPairCachingGhostObject : public btGhostObject
-{
-	btHashedOverlappingPairCache*	m_hashPairCache;
-
-public:
-
-	btPairCachingGhostObject();
-
-	virtual ~btPairCachingGhostObject();
-
-	///this method is mainly for expert/internal use only.
-	virtual void	addOverlappingObjectInternal(btBroadphaseProxy* otherProxy, btBroadphaseProxy* thisProxy=0);
-
-	virtual void	removeOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btDispatcher* dispatcher,btBroadphaseProxy* thisProxy=0);
-
-	btHashedOverlappingPairCache*	getOverlappingPairCache()
-	{
-		return m_hashPairCache;
-	}
-
-};
-
-
-
-///The btGhostPairCallback interfaces and forwards adding and removal of overlapping pairs from the btBroadphaseInterface to btGhostObject.
-class btGhostPairCallback : public btOverlappingPairCallback
-{
-	
-public:
-	btGhostPairCallback()
-	{
-	}
-
-	virtual ~btGhostPairCallback()
-	{
-		
-	}
-
-	virtual btBroadphasePair*	addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1)
-	{
-		btCollisionObject* colObj0 = (btCollisionObject*) proxy0->m_clientObject;
-		btCollisionObject* colObj1 = (btCollisionObject*) proxy1->m_clientObject;
-		btGhostObject* ghost0 = 		btGhostObject::upcast(colObj0);
-		btGhostObject* ghost1 = 		btGhostObject::upcast(colObj1);
-		if (ghost0)
-			ghost0->addOverlappingObjectInternal(proxy1, proxy0);
-		if (ghost1)
-			ghost1->addOverlappingObjectInternal(proxy0, proxy1);
-		return 0;
-	}
-
-	virtual void*	removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,btDispatcher* dispatcher)
-	{
-		btCollisionObject* colObj0 = (btCollisionObject*) proxy0->m_clientObject;
-		btCollisionObject* colObj1 = (btCollisionObject*) proxy1->m_clientObject;
-		btGhostObject* ghost0 = 		btGhostObject::upcast(colObj0);
-		btGhostObject* ghost1 = 		btGhostObject::upcast(colObj1);
-		if (ghost0)
-			ghost0->removeOverlappingObjectInternal(proxy1,dispatcher,proxy0);
-		if (ghost1)
-			ghost1->removeOverlappingObjectInternal(proxy0,dispatcher,proxy1);
-		return 0;
-	}
-
-	virtual void	removeOverlappingPairsContainingProxy(btBroadphaseProxy* /*proxy0*/,btDispatcher* /*dispatcher*/)
-	{
-		btAssert(0);
-		//need to keep track of all ghost objects and call them here
-		//m_hashPairCache->removeOverlappingPairsContainingProxy(proxy0,dispatcher);
-	}
-
-	
-
-};
-
-#endif
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp
deleted file mode 100644
index 3ebe3ed..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp
+++ /dev/null
@@ -1,842 +0,0 @@
-#include "btInternalEdgeUtility.h"
-
-#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h"
-#include "BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h"
-#include "BulletCollision/CollisionShapes/btTriangleShape.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-#include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h"
-#include "LinearMath/btIDebugDraw.h"
-
-
-//#define DEBUG_INTERNAL_EDGE
-
-#ifdef DEBUG_INTERNAL_EDGE
-#include <stdio.h>
-#endif //DEBUG_INTERNAL_EDGE
-
-
-#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
-static btIDebugDraw* gDebugDrawer = 0;
-
-void	btSetDebugDrawer(btIDebugDraw* debugDrawer)
-{
-	gDebugDrawer = debugDrawer;
-}
-
-static void    btDebugDrawLine(const btVector3& from,const btVector3& to, const btVector3& color)
-{
-	if (gDebugDrawer)
-		gDebugDrawer->drawLine(from,to,color);
-}
-#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
-
-
-static int	btGetHash(int partId, int triangleIndex)
-{
-	int hash = (partId<<(31-MAX_NUM_PARTS_IN_BITS)) | triangleIndex;
-	return hash;
-}
-
-
-
-static btScalar btGetAngle(const btVector3& edgeA, const btVector3& normalA,const btVector3& normalB)
-{
-	const btVector3 refAxis0  = edgeA;
-	const btVector3 refAxis1  = normalA;
-	const btVector3 swingAxis = normalB;
-	btScalar angle = btAtan2(swingAxis.dot(refAxis0), swingAxis.dot(refAxis1));
-	return  angle;
-}
-
-
-struct btConnectivityProcessor : public btTriangleCallback
-{
-	int				m_partIdA;
-	int				m_triangleIndexA;
-	btVector3*		m_triangleVerticesA;
-	btTriangleInfoMap*	m_triangleInfoMap;
-
-
-	virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex)
-	{
-		//skip self-collisions
-		if ((m_partIdA == partId) && (m_triangleIndexA == triangleIndex))
-			return;
-
-		//skip duplicates (disabled for now)
-		//if ((m_partIdA <= partId) && (m_triangleIndexA <= triangleIndex))
-		//	return;
-
-		//search for shared vertices and edges
-		int numshared = 0;
-		int sharedVertsA[3]={-1,-1,-1};
-		int sharedVertsB[3]={-1,-1,-1};
-
-		///skip degenerate triangles
-		btScalar crossBSqr = ((triangle[1]-triangle[0]).cross(triangle[2]-triangle[0])).length2();
-		if (crossBSqr < m_triangleInfoMap->m_equalVertexThreshold)
-			return;
-
-
-		btScalar crossASqr = ((m_triangleVerticesA[1]-m_triangleVerticesA[0]).cross(m_triangleVerticesA[2]-m_triangleVerticesA[0])).length2();
-		///skip degenerate triangles
-		if (crossASqr< m_triangleInfoMap->m_equalVertexThreshold)
-			return;
-
-#if 0
-		printf("triangle A[0]	=	(%f,%f,%f)\ntriangle A[1]	=	(%f,%f,%f)\ntriangle A[2]	=	(%f,%f,%f)\n",
-			m_triangleVerticesA[0].getX(),m_triangleVerticesA[0].getY(),m_triangleVerticesA[0].getZ(),
-			m_triangleVerticesA[1].getX(),m_triangleVerticesA[1].getY(),m_triangleVerticesA[1].getZ(),
-			m_triangleVerticesA[2].getX(),m_triangleVerticesA[2].getY(),m_triangleVerticesA[2].getZ());
-
-		printf("partId=%d, triangleIndex=%d\n",partId,triangleIndex);
-		printf("triangle B[0]	=	(%f,%f,%f)\ntriangle B[1]	=	(%f,%f,%f)\ntriangle B[2]	=	(%f,%f,%f)\n",
-			triangle[0].getX(),triangle[0].getY(),triangle[0].getZ(),
-			triangle[1].getX(),triangle[1].getY(),triangle[1].getZ(),
-			triangle[2].getX(),triangle[2].getY(),triangle[2].getZ());
-#endif
-
-		for (int i=0;i<3;i++)
-		{
-			for (int j=0;j<3;j++)
-			{
-				if ( (m_triangleVerticesA[i]-triangle[j]).length2() < m_triangleInfoMap->m_equalVertexThreshold)
-				{
-					sharedVertsA[numshared] = i;
-					sharedVertsB[numshared] = j;
-					numshared++;
-					///degenerate case
-					if(numshared >= 3)
-						return;
-				}
-			}
-			///degenerate case
-			if(numshared >= 3)
-				return;
-		}
-		switch (numshared)
-		{
-		case 0:
-			{
-				break;
-			}
-		case 1:
-			{
-				//shared vertex
-				break;
-			}
-		case 2:
-			{
-				//shared edge
-				//we need to make sure the edge is in the order V2V0 and not V0V2 so that the signs are correct
-				if (sharedVertsA[0] == 0 && sharedVertsA[1] == 2)
-				{
-					sharedVertsA[0] = 2;
-					sharedVertsA[1] = 0;
-					int tmp = sharedVertsB[1];
-					sharedVertsB[1] = sharedVertsB[0];
-					sharedVertsB[0] = tmp;
-				}
-
-				int hash = btGetHash(m_partIdA,m_triangleIndexA);
-
-				btTriangleInfo* info = m_triangleInfoMap->find(hash);
-				if (!info)
-				{
-					btTriangleInfo tmp;
-					m_triangleInfoMap->insert(hash,tmp);
-					info = m_triangleInfoMap->find(hash);
-				}
-
-				int sumvertsA = sharedVertsA[0]+sharedVertsA[1];
-				int otherIndexA = 3-sumvertsA;
-
-				
-				btVector3 edge(m_triangleVerticesA[sharedVertsA[1]]-m_triangleVerticesA[sharedVertsA[0]]);
-
-				btTriangleShape tA(m_triangleVerticesA[0],m_triangleVerticesA[1],m_triangleVerticesA[2]);
-				int otherIndexB = 3-(sharedVertsB[0]+sharedVertsB[1]);
-
-				btTriangleShape tB(triangle[sharedVertsB[1]],triangle[sharedVertsB[0]],triangle[otherIndexB]);
-				//btTriangleShape tB(triangle[0],triangle[1],triangle[2]);
-
-				btVector3 normalA;
-				btVector3 normalB;
-				tA.calcNormal(normalA);
-				tB.calcNormal(normalB);
-				edge.normalize();
-				btVector3 edgeCrossA = edge.cross(normalA).normalize();
-
-				{
-					btVector3 tmp = m_triangleVerticesA[otherIndexA]-m_triangleVerticesA[sharedVertsA[0]];
-					if (edgeCrossA.dot(tmp) < 0)
-					{
-						edgeCrossA*=-1;
-					}
-				}
-
-				btVector3 edgeCrossB = edge.cross(normalB).normalize();
-
-				{
-					btVector3 tmp = triangle[otherIndexB]-triangle[sharedVertsB[0]];
-					if (edgeCrossB.dot(tmp) < 0)
-					{
-						edgeCrossB*=-1;
-					}
-				}
-
-				btScalar	angle2 = 0;
-				btScalar	ang4 = 0.f;
-
-
-				btVector3 calculatedEdge = edgeCrossA.cross(edgeCrossB);
-				btScalar len2 = calculatedEdge.length2();
-
-				btScalar correctedAngle(0);
-				btVector3 calculatedNormalB = normalA;
-				bool isConvex = false;
-
-				if (len2<m_triangleInfoMap->m_planarEpsilon)
-				{
-					angle2 = 0.f;
-					ang4 = 0.f;
-				} else
-				{
-
-					calculatedEdge.normalize();
-					btVector3 calculatedNormalA = calculatedEdge.cross(edgeCrossA);
-					calculatedNormalA.normalize();
-					angle2 = btGetAngle(calculatedNormalA,edgeCrossA,edgeCrossB);
-					ang4 = SIMD_PI-angle2;
-					btScalar dotA = normalA.dot(edgeCrossB);
-					///@todo: check if we need some epsilon, due to floating point imprecision
-					isConvex = (dotA<0.);
-
-					correctedAngle = isConvex ? ang4 : -ang4;
-					btQuaternion orn2(calculatedEdge,-correctedAngle);
-					calculatedNormalB = btMatrix3x3(orn2)*normalA;
-
-
-				}
-
-				
-
-				
-							
-				//alternatively use 
-				//btVector3 calculatedNormalB2 = quatRotate(orn,normalA);
-
-
-				switch (sumvertsA)
-				{
-				case 1:
-					{
-						btVector3 edge = m_triangleVerticesA[0]-m_triangleVerticesA[1];
-						btQuaternion orn(edge,-correctedAngle);
-						btVector3 computedNormalB = quatRotate(orn,normalA);
-						btScalar bla = computedNormalB.dot(normalB);
-						if (bla<0)
-						{
-							computedNormalB*=-1;
-							info->m_flags |= TRI_INFO_V0V1_SWAP_NORMALB;
-						}
-#ifdef DEBUG_INTERNAL_EDGE
-						if ((computedNormalB-normalB).length()>0.0001)
-						{
-							printf("warning: normals not identical\n");
-						}
-#endif//DEBUG_INTERNAL_EDGE
-
-						info->m_edgeV0V1Angle = -correctedAngle;
-
-						if (isConvex)
-							info->m_flags |= TRI_INFO_V0V1_CONVEX;
-						break;
-					}
-				case 2:
-					{
-						btVector3 edge = m_triangleVerticesA[2]-m_triangleVerticesA[0];
-						btQuaternion orn(edge,-correctedAngle);
-						btVector3 computedNormalB = quatRotate(orn,normalA);
-						if (computedNormalB.dot(normalB)<0)
-						{
-							computedNormalB*=-1;
-							info->m_flags |= TRI_INFO_V2V0_SWAP_NORMALB;
-						}
-
-#ifdef DEBUG_INTERNAL_EDGE
-						if ((computedNormalB-normalB).length()>0.0001)
-						{
-							printf("warning: normals not identical\n");
-						}
-#endif //DEBUG_INTERNAL_EDGE
-						info->m_edgeV2V0Angle = -correctedAngle;
-						if (isConvex)
-							info->m_flags |= TRI_INFO_V2V0_CONVEX;
-						break;	
-					}
-				case 3:
-					{
-						btVector3 edge = m_triangleVerticesA[1]-m_triangleVerticesA[2];
-						btQuaternion orn(edge,-correctedAngle);
-						btVector3 computedNormalB = quatRotate(orn,normalA);
-						if (computedNormalB.dot(normalB)<0)
-						{
-							info->m_flags |= TRI_INFO_V1V2_SWAP_NORMALB;
-							computedNormalB*=-1;
-						}
-#ifdef DEBUG_INTERNAL_EDGE
-						if ((computedNormalB-normalB).length()>0.0001)
-						{
-							printf("warning: normals not identical\n");
-						}
-#endif //DEBUG_INTERNAL_EDGE
-						info->m_edgeV1V2Angle = -correctedAngle;
-
-						if (isConvex)
-							info->m_flags |= TRI_INFO_V1V2_CONVEX;
-						break;
-					}
-				}
-
-				break;
-			}
-		default:
-			{
-				//				printf("warning: duplicate triangle\n");
-			}
-
-		}
-	}
-};
-/////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////
-
-void btGenerateInternalEdgeInfo (btBvhTriangleMeshShape*trimeshShape, btTriangleInfoMap* triangleInfoMap)
-{
-	//the user pointer shouldn't already be used for other purposes, we intend to store connectivity info there!
-	if (trimeshShape->getTriangleInfoMap())
-		return;
-
-	trimeshShape->setTriangleInfoMap(triangleInfoMap);
-
-	btStridingMeshInterface* meshInterface = trimeshShape->getMeshInterface();
-	const btVector3& meshScaling = meshInterface->getScaling();
-
-	for (int partId = 0; partId< meshInterface->getNumSubParts();partId++)
-	{
-		const unsigned char *vertexbase = 0;
-		int numverts = 0;
-		PHY_ScalarType type = PHY_INTEGER;
-		int stride = 0;
-		const unsigned char *indexbase = 0;
-		int indexstride = 0;
-		int numfaces = 0;
-		PHY_ScalarType indicestype = PHY_INTEGER;
-		//PHY_ScalarType indexType=0;
-
-		btVector3 triangleVerts[3];
-		meshInterface->getLockedReadOnlyVertexIndexBase(&vertexbase,numverts,	type,stride,&indexbase,indexstride,numfaces,indicestype,partId);
-		btVector3 aabbMin,aabbMax;
-
-		for (int triangleIndex = 0 ; triangleIndex < numfaces;triangleIndex++)
-		{
-			unsigned int* gfxbase = (unsigned int*)(indexbase+triangleIndex*indexstride);
-
-			for (int j=2;j>=0;j--)
-			{
-
-				int graphicsindex = indicestype==PHY_SHORT?((unsigned short*)gfxbase)[j]:gfxbase[j];
-				if (type == PHY_FLOAT)
-				{
-					float* graphicsbase = (float*)(vertexbase+graphicsindex*stride);
-					triangleVerts[j] = btVector3(
-						graphicsbase[0]*meshScaling.getX(),
-						graphicsbase[1]*meshScaling.getY(),
-						graphicsbase[2]*meshScaling.getZ());
-				}
-				else
-				{
-					double* graphicsbase = (double*)(vertexbase+graphicsindex*stride);
-					triangleVerts[j] = btVector3( btScalar(graphicsbase[0]*meshScaling.getX()), btScalar(graphicsbase[1]*meshScaling.getY()), btScalar(graphicsbase[2]*meshScaling.getZ()));
-				}
-			}
-			aabbMin.setValue(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
-			aabbMax.setValue(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT)); 
-			aabbMin.setMin(triangleVerts[0]);
-			aabbMax.setMax(triangleVerts[0]);
-			aabbMin.setMin(triangleVerts[1]);
-			aabbMax.setMax(triangleVerts[1]);
-			aabbMin.setMin(triangleVerts[2]);
-			aabbMax.setMax(triangleVerts[2]);
-
-			btConnectivityProcessor connectivityProcessor;
-			connectivityProcessor.m_partIdA = partId;
-			connectivityProcessor.m_triangleIndexA = triangleIndex;
-			connectivityProcessor.m_triangleVerticesA = &triangleVerts[0];
-			connectivityProcessor.m_triangleInfoMap  = triangleInfoMap;
-
-			trimeshShape->processAllTriangles(&connectivityProcessor,aabbMin,aabbMax);
-		}
-
-	}
-
-}
-
-
-
-
-// Given a point and a line segment (defined by two points), compute the closest point
-// in the line.  Cap the point at the endpoints of the line segment.
-void btNearestPointInLineSegment(const btVector3 &point, const btVector3& line0, const btVector3& line1, btVector3& nearestPoint)
-{
-	btVector3 lineDelta     = line1 - line0;
-
-	// Handle degenerate lines
-	if ( lineDelta.fuzzyZero())
-	{
-		nearestPoint = line0;
-	}
-	else
-	{
-		btScalar delta = (point-line0).dot(lineDelta) / (lineDelta).dot(lineDelta);
-
-		// Clamp the point to conform to the segment's endpoints
-		if ( delta < 0 )
-			delta = 0;
-		else if ( delta > 1 )
-			delta = 1;
-
-		nearestPoint = line0 + lineDelta*delta;
-	}
-}
-
-
-
-
-bool	btClampNormal(const btVector3& edge,const btVector3& tri_normal_org,const btVector3& localContactNormalOnB, btScalar correctedEdgeAngle, btVector3 & clampedLocalNormal)
-{
-	btVector3 tri_normal = tri_normal_org;
-	//we only have a local triangle normal, not a local contact normal -> only normal in world space...
-	//either compute the current angle all in local space, or all in world space
-
-	btVector3 edgeCross = edge.cross(tri_normal).normalize();
-	btScalar curAngle = btGetAngle(edgeCross,tri_normal,localContactNormalOnB);
-
-	if (correctedEdgeAngle<0)
-	{
-		if (curAngle < correctedEdgeAngle)
-		{
-			btScalar diffAngle = correctedEdgeAngle-curAngle;
-			btQuaternion rotation(edge,diffAngle );
-			clampedLocalNormal = btMatrix3x3(rotation)*localContactNormalOnB;
-			return true;
-		}
-	}
-
-	if (correctedEdgeAngle>=0)
-	{
-		if (curAngle > correctedEdgeAngle)
-		{
-			btScalar diffAngle = correctedEdgeAngle-curAngle;
-			btQuaternion rotation(edge,diffAngle );
-			clampedLocalNormal = btMatrix3x3(rotation)*localContactNormalOnB;
-			return true;
-		}
-	}
-	return false;
-}
-
-
-
-/// Changes a btManifoldPoint collision normal to the normal from the mesh.
-void btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObject* colObj0,const btCollisionObject* colObj1, int partId0, int index0, int normalAdjustFlags)
-{
-	//btAssert(colObj0->getCollisionShape()->getShapeType() == TRIANGLE_SHAPE_PROXYTYPE);
-	if (colObj0->getCollisionShape()->getShapeType() != TRIANGLE_SHAPE_PROXYTYPE)
-		return;
-
-	btBvhTriangleMeshShape* trimesh = 0;
-	
-	if( colObj0->getRootCollisionShape()->getShapeType() == SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE )
-	   trimesh = ((btScaledBvhTriangleMeshShape*)colObj0->getRootCollisionShape())->getChildShape();
-   else	   
-	   trimesh = (btBvhTriangleMeshShape*)colObj0->getRootCollisionShape();
-	   
-   	btTriangleInfoMap* triangleInfoMapPtr = (btTriangleInfoMap*) trimesh->getTriangleInfoMap();
-	if (!triangleInfoMapPtr)
-		return;
-
-	int hash = btGetHash(partId0,index0);
-
-
-	btTriangleInfo* info = triangleInfoMapPtr->find(hash);
-	if (!info)
-		return;
-
-	btScalar frontFacing = (normalAdjustFlags & BT_TRIANGLE_CONVEX_BACKFACE_MODE)==0? 1.f : -1.f;
-	
-	const btTriangleShape* tri_shape = static_cast<const btTriangleShape*>(colObj0->getCollisionShape());
-	btVector3 v0,v1,v2;
-	tri_shape->getVertex(0,v0);
-	tri_shape->getVertex(1,v1);
-	tri_shape->getVertex(2,v2);
-
-	btVector3 center = (v0+v1+v2)*btScalar(1./3.);
-
-	btVector3 red(1,0,0), green(0,1,0),blue(0,0,1),white(1,1,1),black(0,0,0);
-	btVector3 tri_normal;
-	tri_shape->calcNormal(tri_normal);
-
-	//btScalar dot = tri_normal.dot(cp.m_normalWorldOnB);
-	btVector3 nearest;
-	btNearestPointInLineSegment(cp.m_localPointB,v0,v1,nearest);
-
-	btVector3 contact = cp.m_localPointB;
-#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
-	const btTransform& tr = colObj0->getWorldTransform();
-	btDebugDrawLine(tr*nearest,tr*cp.m_localPointB,red);
-#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
-
-
-
-	bool isNearEdge = false;
-
-	int numConcaveEdgeHits = 0;
-	int numConvexEdgeHits = 0;
-
-	btVector3 localContactNormalOnB = colObj0->getWorldTransform().getBasis().transpose() * cp.m_normalWorldOnB;
-	localContactNormalOnB.normalize();//is this necessary?
-	
-	// Get closest edge
-	int      bestedge=-1;
-	float    disttobestedge=BT_LARGE_FLOAT;
-	//
-	// Edge 0 -> 1
-	if (btFabs(info->m_edgeV0V1Angle)< triangleInfoMapPtr->m_maxEdgeAngleThreshold)
-	{	
-	   btVector3 nearest;
-	   btNearestPointInLineSegment( cp.m_localPointB, v0, v1, nearest );
-	   float     len=(contact-nearest).length();
-	   //
-	   if( len < disttobestedge )
-	   {
-	      bestedge=0;
-	      disttobestedge=len;
-      }	      
-   }	   
-	// Edge 1 -> 2
-	if (btFabs(info->m_edgeV1V2Angle)< triangleInfoMapPtr->m_maxEdgeAngleThreshold)
-	{	
-	   btVector3 nearest;
-	   btNearestPointInLineSegment( cp.m_localPointB, v1, v2, nearest );
-	   float     len=(contact-nearest).length();
-	   //
-	   if( len < disttobestedge )
-	   {
-	      bestedge=1;
-	      disttobestedge=len;
-      }	      
-   }	   
-	// Edge 2 -> 0
-	if (btFabs(info->m_edgeV2V0Angle)< triangleInfoMapPtr->m_maxEdgeAngleThreshold)
-	{	
-	   btVector3 nearest;
-	   btNearestPointInLineSegment( cp.m_localPointB, v2, v0, nearest );
-	   float     len=(contact-nearest).length();
-	   //
-	   if( len < disttobestedge )
-	   {
-	      bestedge=2;
-	      disttobestedge=len;
-      }	      
-   }   	      	
-	
-#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
-   btVector3 upfix=tri_normal * btVector3(0.1f,0.1f,0.1f);
-   btDebugDrawLine(tr * v0 + upfix, tr * v1 + upfix, red );
-#endif   
-	if (btFabs(info->m_edgeV0V1Angle)< triangleInfoMapPtr->m_maxEdgeAngleThreshold)
-	{
-#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
-		btDebugDrawLine(tr*contact,tr*(contact+cp.m_normalWorldOnB*10),black);
-#endif
-		btScalar len = (contact-nearest).length();
-		if(len<triangleInfoMapPtr->m_edgeDistanceThreshold)
-		if( bestedge==0 )
-		{
-			btVector3 edge(v0-v1);
-			isNearEdge = true;
-
-			if (info->m_edgeV0V1Angle==btScalar(0))
-			{
-				numConcaveEdgeHits++;
-			} else
-			{
-
-				bool isEdgeConvex = (info->m_flags & TRI_INFO_V0V1_CONVEX);
-				btScalar swapFactor = isEdgeConvex ? btScalar(1) : btScalar(-1);
-	#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
-				btDebugDrawLine(tr*nearest,tr*(nearest+swapFactor*tri_normal*10),white);
-	#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
-
-				btVector3 nA = swapFactor * tri_normal;
-
-				btQuaternion orn(edge,info->m_edgeV0V1Angle);
-				btVector3 computedNormalB = quatRotate(orn,tri_normal);
-				if (info->m_flags & TRI_INFO_V0V1_SWAP_NORMALB)
-					computedNormalB*=-1;
-				btVector3 nB = swapFactor*computedNormalB;
-
-				btScalar	NdotA = localContactNormalOnB.dot(nA);
-				btScalar	NdotB = localContactNormalOnB.dot(nB);
-				bool backFacingNormal = (NdotA< triangleInfoMapPtr->m_convexEpsilon) && (NdotB<triangleInfoMapPtr->m_convexEpsilon);
-
-#ifdef DEBUG_INTERNAL_EDGE
-				{
-					
-					btDebugDrawLine(cp.getPositionWorldOnB(),cp.getPositionWorldOnB()+tr.getBasis()*(nB*20),red);
-				}
-#endif //DEBUG_INTERNAL_EDGE
-
-
-				if (backFacingNormal)
-				{
-					numConcaveEdgeHits++;
-				}
-				else
-				{
-					numConvexEdgeHits++;
-					btVector3 clampedLocalNormal;
-					bool isClamped = btClampNormal(edge,swapFactor*tri_normal,localContactNormalOnB, info->m_edgeV0V1Angle,clampedLocalNormal);
-					if (isClamped)
-					{
-						if (((normalAdjustFlags & BT_TRIANGLE_CONVEX_DOUBLE_SIDED)!=0) || (clampedLocalNormal.dot(frontFacing*tri_normal)>0))
-						{
-							btVector3 newNormal = colObj0->getWorldTransform().getBasis() * clampedLocalNormal;
-							//					cp.m_distance1 = cp.m_distance1 * newNormal.dot(cp.m_normalWorldOnB);
-							cp.m_normalWorldOnB = newNormal;
-							// Reproject collision point along normal. (what about cp.m_distance1?)
-							cp.m_positionWorldOnB = cp.m_positionWorldOnA - cp.m_normalWorldOnB * cp.m_distance1;
-							cp.m_localPointB = colObj0->getWorldTransform().invXform(cp.m_positionWorldOnB);
-							
-						}
-					}
-				}
-			}
-		}
-	}
-
-	btNearestPointInLineSegment(contact,v1,v2,nearest);
-#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
-	btDebugDrawLine(tr*nearest,tr*cp.m_localPointB,green);
-#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
-
-#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
-   btDebugDrawLine(tr * v1 + upfix, tr * v2 + upfix , green );
-#endif   
-
-	if (btFabs(info->m_edgeV1V2Angle)< triangleInfoMapPtr->m_maxEdgeAngleThreshold)
-	{
-#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
-		btDebugDrawLine(tr*contact,tr*(contact+cp.m_normalWorldOnB*10),black);
-#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
-
-
-
-		btScalar len = (contact-nearest).length();
-		if(len<triangleInfoMapPtr->m_edgeDistanceThreshold)
-		if( bestedge==1 )
-		{
-			isNearEdge = true;
-#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
-			btDebugDrawLine(tr*nearest,tr*(nearest+tri_normal*10),white);
-#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
-
-			btVector3 edge(v1-v2);
-
-			isNearEdge = true;
-
-			if (info->m_edgeV1V2Angle == btScalar(0))
-			{
-				numConcaveEdgeHits++;
-			} else
-			{
-				bool isEdgeConvex = (info->m_flags & TRI_INFO_V1V2_CONVEX)!=0;
-				btScalar swapFactor = isEdgeConvex ? btScalar(1) : btScalar(-1);
-	#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
-				btDebugDrawLine(tr*nearest,tr*(nearest+swapFactor*tri_normal*10),white);
-	#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
-
-				btVector3 nA = swapFactor * tri_normal;
-				
-				btQuaternion orn(edge,info->m_edgeV1V2Angle);
-				btVector3 computedNormalB = quatRotate(orn,tri_normal);
-				if (info->m_flags & TRI_INFO_V1V2_SWAP_NORMALB)
-					computedNormalB*=-1;
-				btVector3 nB = swapFactor*computedNormalB;
-
-#ifdef DEBUG_INTERNAL_EDGE
-				{
-					btDebugDrawLine(cp.getPositionWorldOnB(),cp.getPositionWorldOnB()+tr.getBasis()*(nB*20),red);
-				}
-#endif //DEBUG_INTERNAL_EDGE
-
-
-				btScalar	NdotA = localContactNormalOnB.dot(nA);
-				btScalar	NdotB = localContactNormalOnB.dot(nB);
-				bool backFacingNormal = (NdotA< triangleInfoMapPtr->m_convexEpsilon) && (NdotB<triangleInfoMapPtr->m_convexEpsilon);
-
-				if (backFacingNormal)
-				{
-					numConcaveEdgeHits++;
-				}
-				else
-				{
-					numConvexEdgeHits++;
-					btVector3 localContactNormalOnB = colObj0->getWorldTransform().getBasis().transpose() * cp.m_normalWorldOnB;
-					btVector3 clampedLocalNormal;
-					bool isClamped = btClampNormal(edge,swapFactor*tri_normal,localContactNormalOnB, info->m_edgeV1V2Angle,clampedLocalNormal);
-					if (isClamped)
-					{
-						if (((normalAdjustFlags & BT_TRIANGLE_CONVEX_DOUBLE_SIDED)!=0) || (clampedLocalNormal.dot(frontFacing*tri_normal)>0))
-						{
-							btVector3 newNormal = colObj0->getWorldTransform().getBasis() * clampedLocalNormal;
-							//					cp.m_distance1 = cp.m_distance1 * newNormal.dot(cp.m_normalWorldOnB);
-							cp.m_normalWorldOnB = newNormal;
-							// Reproject collision point along normal.
-							cp.m_positionWorldOnB = cp.m_positionWorldOnA - cp.m_normalWorldOnB * cp.m_distance1;
-							cp.m_localPointB = colObj0->getWorldTransform().invXform(cp.m_positionWorldOnB);
-						}
-					}
-				}
-			}
-		}
-	}
-
-	btNearestPointInLineSegment(contact,v2,v0,nearest);
-#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
-	btDebugDrawLine(tr*nearest,tr*cp.m_localPointB,blue);
-#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
-#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
-   btDebugDrawLine(tr * v2 + upfix, tr * v0 + upfix , blue );
-#endif   
-
-	if (btFabs(info->m_edgeV2V0Angle)< triangleInfoMapPtr->m_maxEdgeAngleThreshold)
-	{
-
-#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
-		btDebugDrawLine(tr*contact,tr*(contact+cp.m_normalWorldOnB*10),black);
-#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
-
-		btScalar len = (contact-nearest).length();
-		if(len<triangleInfoMapPtr->m_edgeDistanceThreshold)
-		if( bestedge==2 )
-		{
-			isNearEdge = true;
-#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
-			btDebugDrawLine(tr*nearest,tr*(nearest+tri_normal*10),white);
-#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
-
-			btVector3 edge(v2-v0);
-
-			if (info->m_edgeV2V0Angle==btScalar(0))
-			{
-				numConcaveEdgeHits++;
-			} else
-			{
-
-				bool isEdgeConvex = (info->m_flags & TRI_INFO_V2V0_CONVEX)!=0;
-				btScalar swapFactor = isEdgeConvex ? btScalar(1) : btScalar(-1);
-	#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
-				btDebugDrawLine(tr*nearest,tr*(nearest+swapFactor*tri_normal*10),white);
-	#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
-
-				btVector3 nA = swapFactor * tri_normal;
-				btQuaternion orn(edge,info->m_edgeV2V0Angle);
-				btVector3 computedNormalB = quatRotate(orn,tri_normal);
-				if (info->m_flags & TRI_INFO_V2V0_SWAP_NORMALB)
-					computedNormalB*=-1;
-				btVector3 nB = swapFactor*computedNormalB;
-
-#ifdef DEBUG_INTERNAL_EDGE
-				{
-					btDebugDrawLine(cp.getPositionWorldOnB(),cp.getPositionWorldOnB()+tr.getBasis()*(nB*20),red);
-				}
-#endif //DEBUG_INTERNAL_EDGE
-
-				btScalar	NdotA = localContactNormalOnB.dot(nA);
-				btScalar	NdotB = localContactNormalOnB.dot(nB);
-				bool backFacingNormal = (NdotA< triangleInfoMapPtr->m_convexEpsilon) && (NdotB<triangleInfoMapPtr->m_convexEpsilon);
-
-				if (backFacingNormal)
-				{
-					numConcaveEdgeHits++;
-				}
-				else
-				{
-					numConvexEdgeHits++;
-					//				printf("hitting convex edge\n");
-
-
-					btVector3 localContactNormalOnB = colObj0->getWorldTransform().getBasis().transpose() * cp.m_normalWorldOnB;
-					btVector3 clampedLocalNormal;
-					bool isClamped = btClampNormal(edge,swapFactor*tri_normal,localContactNormalOnB,info->m_edgeV2V0Angle,clampedLocalNormal);
-					if (isClamped)
-					{
-						if (((normalAdjustFlags & BT_TRIANGLE_CONVEX_DOUBLE_SIDED)!=0) || (clampedLocalNormal.dot(frontFacing*tri_normal)>0))
-						{
-							btVector3 newNormal = colObj0->getWorldTransform().getBasis() * clampedLocalNormal;
-							//					cp.m_distance1 = cp.m_distance1 * newNormal.dot(cp.m_normalWorldOnB);
-							cp.m_normalWorldOnB = newNormal;
-							// Reproject collision point along normal.
-							cp.m_positionWorldOnB = cp.m_positionWorldOnA - cp.m_normalWorldOnB * cp.m_distance1;
-							cp.m_localPointB = colObj0->getWorldTransform().invXform(cp.m_positionWorldOnB);
-						}
-					}
-				} 
-			}
-			
-
-		}
-	}
-
-#ifdef DEBUG_INTERNAL_EDGE
-	{
-		btVector3 color(0,1,1);
-		btDebugDrawLine(cp.getPositionWorldOnB(),cp.getPositionWorldOnB()+cp.m_normalWorldOnB*10,color);
-	}
-#endif //DEBUG_INTERNAL_EDGE
-
-	if (isNearEdge)
-	{
-
-		if (numConcaveEdgeHits>0)
-		{
-			if ((normalAdjustFlags & BT_TRIANGLE_CONCAVE_DOUBLE_SIDED)!=0)
-			{
-				//fix tri_normal so it pointing the same direction as the current local contact normal
-				if (tri_normal.dot(localContactNormalOnB) < 0)
-				{
-					tri_normal *= -1;
-				}
-				cp.m_normalWorldOnB = colObj0->getWorldTransform().getBasis()*tri_normal;
-			} else
-			{
-				btVector3 newNormal = tri_normal *frontFacing;
-				//if the tri_normal is pointing opposite direction as the current local contact normal, skip it
-				btScalar d = newNormal.dot(localContactNormalOnB) ;
-				if (d< 0)
-				{
-					return;
-				}
-				//modify the normal to be the triangle normal (or backfacing normal)
-				cp.m_normalWorldOnB = colObj0->getWorldTransform().getBasis() *newNormal;
-			}
-						
-			// Reproject collision point along normal.
-			cp.m_positionWorldOnB = cp.m_positionWorldOnA - cp.m_normalWorldOnB * cp.m_distance1;
-			cp.m_localPointB = colObj0->getWorldTransform().invXform(cp.m_positionWorldOnB);
-		}
-	}
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.h
deleted file mode 100644
index 9efb012..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.h
+++ /dev/null
@@ -1,46 +0,0 @@
-
-#ifndef BT_INTERNAL_EDGE_UTILITY_H
-#define BT_INTERNAL_EDGE_UTILITY_H
-
-#include "LinearMath/btHashMap.h"
-#include "LinearMath/btVector3.h"
-
-#include "BulletCollision/CollisionShapes/btTriangleInfoMap.h"
-
-///The btInternalEdgeUtility helps to avoid or reduce artifacts due to wrong collision normals caused by internal edges.
-///See also http://code.google.com/p/bullet/issues/detail?id=27
-
-class btBvhTriangleMeshShape;
-class btCollisionObject;
-class btManifoldPoint;
-class btIDebugDraw;
-
-
-
-enum btInternalEdgeAdjustFlags
-{
-	BT_TRIANGLE_CONVEX_BACKFACE_MODE = 1,
-	BT_TRIANGLE_CONCAVE_DOUBLE_SIDED = 2, //double sided options are experimental, single sided is recommended
-	BT_TRIANGLE_CONVEX_DOUBLE_SIDED = 4
-};
-
-
-///Call btGenerateInternalEdgeInfo to create triangle info, store in the shape 'userInfo'
-void	btGenerateInternalEdgeInfo (btBvhTriangleMeshShape*trimeshShape, btTriangleInfoMap* triangleInfoMap);
-
-
-///Call the btFixMeshNormal to adjust the collision normal, using the triangle info map (generated using btGenerateInternalEdgeInfo)
-///If this info map is missing, or the triangle is not store in this map, nothing will be done
-void	btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObject* trimeshColObj0,const btCollisionObject* otherColObj1, int partId0, int index0, int normalAdjustFlags = 0);
-
-///Enable the BT_INTERNAL_EDGE_DEBUG_DRAW define and call btSetDebugDrawer, to get visual info to see if the internal edge utility works properly.
-///If the utility doesn't work properly, you might have to adjust the threshold values in btTriangleInfoMap
-//#define BT_INTERNAL_EDGE_DEBUG_DRAW
-
-#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
-void	btSetDebugDrawer(btIDebugDraw* debugDrawer);
-#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
-
-
-#endif //BT_INTERNAL_EDGE_UTILITY_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp
deleted file mode 100644
index fd684c0..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "btManifoldResult.h"
-#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-
-
-///This is to allow MaterialCombiner/Custom Friction/Restitution values
-ContactAddedCallback		gContactAddedCallback=0;
-
-///User can override this material combiner by implementing gContactAddedCallback and setting body0->m_collisionFlags |= btCollisionObject::customMaterialCallback;
-inline btScalar	calculateCombinedFriction(const btCollisionObject* body0,const btCollisionObject* body1)
-{
-	btScalar friction = body0->getFriction() * body1->getFriction();
-
-	const btScalar MAX_FRICTION  = btScalar(10.);
-	if (friction < -MAX_FRICTION)
-		friction = -MAX_FRICTION;
-	if (friction > MAX_FRICTION)
-		friction = MAX_FRICTION;
-	return friction;
-
-}
-
-inline btScalar	calculateCombinedRestitution(const btCollisionObject* body0,const btCollisionObject* body1)
-{
-	return body0->getRestitution() * body1->getRestitution();
-}
-
-
-
-btManifoldResult::btManifoldResult(btCollisionObject* body0,btCollisionObject* body1)
-		:m_manifoldPtr(0),
-		m_body0(body0),
-		m_body1(body1)
-#ifdef DEBUG_PART_INDEX
-		,m_partId0(-1),
-	m_partId1(-1),
-	m_index0(-1),
-	m_index1(-1)
-#endif //DEBUG_PART_INDEX
-{
-	m_rootTransA = body0->getWorldTransform();
-	m_rootTransB = body1->getWorldTransform();
-}
-
-
-void btManifoldResult::addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)
-{
-	btAssert(m_manifoldPtr);
-	//order in manifold needs to match
-
-//	if (depth > m_manifoldPtr->getContactBreakingThreshold())
-	if (depth > m_manifoldPtr->getContactProcessingThreshold())
-		return;
-
-	bool isSwapped = m_manifoldPtr->getBody0() != m_body0;
-
-	btVector3 pointA = pointInWorld + normalOnBInWorld * depth;
-
-	btVector3 localA;
-	btVector3 localB;
-	
-	if (isSwapped)
-	{
-		localA = m_rootTransB.invXform(pointA );
-		localB = m_rootTransA.invXform(pointInWorld);
-	} else
-	{
-		localA = m_rootTransA.invXform(pointA );
-		localB = m_rootTransB.invXform(pointInWorld);
-	}
-
-	btManifoldPoint newPt(localA,localB,normalOnBInWorld,depth);
-	newPt.m_positionWorldOnA = pointA;
-	newPt.m_positionWorldOnB = pointInWorld;
-	
-	int insertIndex = m_manifoldPtr->getCacheEntry(newPt);
-
-	newPt.m_combinedFriction = calculateCombinedFriction(m_body0,m_body1);
-	newPt.m_combinedRestitution = calculateCombinedRestitution(m_body0,m_body1);
-
-   //BP mod, store contact triangles.
-	if (isSwapped)
-	{
-		newPt.m_partId0 = m_partId1;
-		newPt.m_partId1 = m_partId0;
-		newPt.m_index0  = m_index1;
-		newPt.m_index1  = m_index0;
-	} else
-	{
-		newPt.m_partId0 = m_partId0;
-		newPt.m_partId1 = m_partId1;
-		newPt.m_index0  = m_index0;
-		newPt.m_index1  = m_index1;
-	}
-	//printf("depth=%f\n",depth);
-	///@todo, check this for any side effects
-	if (insertIndex >= 0)
-	{
-		//const btManifoldPoint& oldPoint = m_manifoldPtr->getContactPoint(insertIndex);
-		m_manifoldPtr->replaceContactPoint(newPt,insertIndex);
-	} else
-	{
-		insertIndex = m_manifoldPtr->addManifoldPoint(newPt);
-	}
-	
-	//User can override friction and/or restitution
-	if (gContactAddedCallback &&
-		//and if either of the two bodies requires custom material
-		 ((m_body0->getCollisionFlags() & btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK) ||
-		   (m_body1->getCollisionFlags() & btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK)))
-	{
-		//experimental feature info, for per-triangle material etc.
-		btCollisionObject* obj0 = isSwapped? m_body1 : m_body0;
-		btCollisionObject* obj1 = isSwapped? m_body0 : m_body1;
-		(*gContactAddedCallback)(m_manifoldPtr->getContactPoint(insertIndex),obj0,newPt.m_partId0,newPt.m_index0,obj1,newPt.m_partId1,newPt.m_index1);
-	}
-
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btManifoldResult.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btManifoldResult.h
deleted file mode 100644
index 18199b4..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btManifoldResult.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef BT_MANIFOLD_RESULT_H
-#define BT_MANIFOLD_RESULT_H
-
-class btCollisionObject;
-#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
-class btManifoldPoint;
-
-#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"
-
-#include "LinearMath/btTransform.h"
-
-typedef bool (*ContactAddedCallback)(btManifoldPoint& cp,	const btCollisionObject* colObj0,int partId0,int index0,const btCollisionObject* colObj1,int partId1,int index1);
-extern ContactAddedCallback		gContactAddedCallback;
-
-//#define DEBUG_PART_INDEX 1
-
-
-///btManifoldResult is a helper class to manage  contact results.
-class btManifoldResult : public btDiscreteCollisionDetectorInterface::Result
-{
-protected:
-
-	btPersistentManifold* m_manifoldPtr;
-
-	//we need this for compounds
-	btTransform	m_rootTransA;
-	btTransform	m_rootTransB;
-
-	btCollisionObject* m_body0;
-	btCollisionObject* m_body1;
-	int	m_partId0;
-	int m_partId1;
-	int m_index0;
-	int m_index1;
-	
-
-public:
-
-	btManifoldResult()
-#ifdef DEBUG_PART_INDEX
-		:
-	m_partId0(-1),
-	m_partId1(-1),
-	m_index0(-1),
-	m_index1(-1)
-#endif //DEBUG_PART_INDEX
-	{
-	}
-
-	btManifoldResult(btCollisionObject* body0,btCollisionObject* body1);
-
-	virtual ~btManifoldResult() {};
-
-	void	setPersistentManifold(btPersistentManifold* manifoldPtr)
-	{
-		m_manifoldPtr = manifoldPtr;
-	}
-
-	const btPersistentManifold*	getPersistentManifold() const
-	{
-		return m_manifoldPtr;
-	}
-	btPersistentManifold*	getPersistentManifold()
-	{
-		return m_manifoldPtr;
-	}
-
-	virtual void setShapeIdentifiersA(int partId0,int index0)
-	{
-		m_partId0=partId0;
-		m_index0=index0;
-	}
-
-	virtual void setShapeIdentifiersB(	int partId1,int index1)
-	{
-		m_partId1=partId1;
-		m_index1=index1;
-	}
-
-
-	virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth);
-
-	SIMD_FORCE_INLINE	void refreshContactPoints()
-	{
-		btAssert(m_manifoldPtr);
-		if (!m_manifoldPtr->getNumContacts())
-			return;
-
-		bool isSwapped = m_manifoldPtr->getBody0() != m_body0;
-
-		if (isSwapped)
-		{
-			m_manifoldPtr->refreshContactPoints(m_rootTransB,m_rootTransA);
-		} else
-		{
-			m_manifoldPtr->refreshContactPoints(m_rootTransA,m_rootTransB);
-		}
-	}
-
-	const btCollisionObject* getBody0Internal() const
-	{
-		return m_body0;
-	}
-
-	const btCollisionObject* getBody1Internal() const
-	{
-		return m_body1;
-	}
-	
-};
-
-#endif //BT_MANIFOLD_RESULT_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp
deleted file mode 100644
index bb2a7f2..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp
+++ /dev/null
@@ -1,443 +0,0 @@
-
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "LinearMath/btScalar.h"
-#include "btSimulationIslandManager.h"
-#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
-#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-#include "BulletCollision/CollisionDispatch/btCollisionWorld.h"
-
-//#include <stdio.h>
-#include "LinearMath/btQuickprof.h"
-
-btSimulationIslandManager::btSimulationIslandManager():
-m_splitIslands(true)
-{
-}
-
-btSimulationIslandManager::~btSimulationIslandManager()
-{
-}
-
-
-void btSimulationIslandManager::initUnionFind(int n)
-{
-		m_unionFind.reset(n);
-}
-		
-
-void btSimulationIslandManager::findUnions(btDispatcher* /* dispatcher */,btCollisionWorld* colWorld)
-{
-	
-	{
-		btOverlappingPairCache* pairCachePtr = colWorld->getPairCache();
-		const int numOverlappingPairs = pairCachePtr->getNumOverlappingPairs();
-		btBroadphasePair* pairPtr = pairCachePtr->getOverlappingPairArrayPtr();
-		
-		for (int i=0;i<numOverlappingPairs;i++)
-		{
-			const btBroadphasePair& collisionPair = pairPtr[i];
-			btCollisionObject* colObj0 = (btCollisionObject*)collisionPair.m_pProxy0->m_clientObject;
-			btCollisionObject* colObj1 = (btCollisionObject*)collisionPair.m_pProxy1->m_clientObject;
-
-			if (((colObj0) && ((colObj0)->mergesSimulationIslands())) &&
-				((colObj1) && ((colObj1)->mergesSimulationIslands())))
-			{
-
-				m_unionFind.unite((colObj0)->getIslandTag(),
-					(colObj1)->getIslandTag());
-			}
-		}
-	}
-}
-
-#ifdef STATIC_SIMULATION_ISLAND_OPTIMIZATION
-void   btSimulationIslandManager::updateActivationState(btCollisionWorld* colWorld,btDispatcher* dispatcher)
-{
-
-	// put the index into m_controllers into m_tag   
-	int index = 0;
-	{
-
-		int i;
-		for (i=0;i<colWorld->getCollisionObjectArray().size(); i++)
-		{
-			btCollisionObject*   collisionObject= colWorld->getCollisionObjectArray()[i];
-			//Adding filtering here
-			if (!collisionObject->isStaticOrKinematicObject())
-			{
-				collisionObject->setIslandTag(index++);
-			}
-			collisionObject->setCompanionId(-1);
-			collisionObject->setHitFraction(btScalar(1.));
-		}
-	}
-	// do the union find
-
-	initUnionFind( index );
-
-	findUnions(dispatcher,colWorld);
-}
-
-void   btSimulationIslandManager::storeIslandActivationState(btCollisionWorld* colWorld)
-{
-	// put the islandId ('find' value) into m_tag   
-	{
-		int index = 0;
-		int i;
-		for (i=0;i<colWorld->getCollisionObjectArray().size();i++)
-		{
-			btCollisionObject* collisionObject= colWorld->getCollisionObjectArray()[i];
-			if (!collisionObject->isStaticOrKinematicObject())
-			{
-				collisionObject->setIslandTag( m_unionFind.find(index) );
-				//Set the correct object offset in Collision Object Array
-				m_unionFind.getElement(index).m_sz = i;
-				collisionObject->setCompanionId(-1);
-				index++;
-			} else
-			{
-				collisionObject->setIslandTag(-1);
-				collisionObject->setCompanionId(-2);
-			}
-		}
-	}
-}
-
-
-#else //STATIC_SIMULATION_ISLAND_OPTIMIZATION
-void	btSimulationIslandManager::updateActivationState(btCollisionWorld* colWorld,btDispatcher* dispatcher)
-{
-
-	initUnionFind( int (colWorld->getCollisionObjectArray().size()));
-
-	// put the index into m_controllers into m_tag	
-	{
-
-		int index = 0;
-		int i;
-		for (i=0;i<colWorld->getCollisionObjectArray().size(); i++)
-		{
-			btCollisionObject*	collisionObject= colWorld->getCollisionObjectArray()[i];
-			collisionObject->setIslandTag(index);
-			collisionObject->setCompanionId(-1);
-			collisionObject->setHitFraction(btScalar(1.));
-			index++;
-
-		}
-	}
-	// do the union find
-
-	findUnions(dispatcher,colWorld);
-}
-
-void	btSimulationIslandManager::storeIslandActivationState(btCollisionWorld* colWorld)
-{
-	// put the islandId ('find' value) into m_tag	
-	{
-
-
-		int index = 0;
-		int i;
-		for (i=0;i<colWorld->getCollisionObjectArray().size();i++)
-		{
-			btCollisionObject* collisionObject= colWorld->getCollisionObjectArray()[i];
-			if (!collisionObject->isStaticOrKinematicObject())
-			{
-				collisionObject->setIslandTag( m_unionFind.find(index) );
-				collisionObject->setCompanionId(-1);
-			} else
-			{
-				collisionObject->setIslandTag(-1);
-				collisionObject->setCompanionId(-2);
-			}
-			index++;
-		}
-	}
-}
-
-#endif //STATIC_SIMULATION_ISLAND_OPTIMIZATION
-
-inline	int	getIslandId(const btPersistentManifold* lhs)
-{
-	int islandId;
-	const btCollisionObject* rcolObj0 = static_cast<const btCollisionObject*>(lhs->getBody0());
-	const btCollisionObject* rcolObj1 = static_cast<const btCollisionObject*>(lhs->getBody1());
-	islandId= rcolObj0->getIslandTag()>=0?rcolObj0->getIslandTag():rcolObj1->getIslandTag();
-	return islandId;
-
-}
-
-
-
-/// function object that routes calls to operator<
-class btPersistentManifoldSortPredicate
-{
-	public:
-
-		SIMD_FORCE_INLINE bool operator() ( const btPersistentManifold* lhs, const btPersistentManifold* rhs )
-		{
-			return getIslandId(lhs) < getIslandId(rhs);
-		}
-};
-
-
-void btSimulationIslandManager::buildIslands(btDispatcher* dispatcher,btCollisionWorld* collisionWorld)
-{
-
-	BT_PROFILE("islandUnionFindAndQuickSort");
-	
-	btCollisionObjectArray& collisionObjects = collisionWorld->getCollisionObjectArray();
-
-	m_islandmanifold.resize(0);
-
-	//we are going to sort the unionfind array, and store the element id in the size
-	//afterwards, we clean unionfind, to make sure no-one uses it anymore
-	
-	getUnionFind().sortIslands();
-	int numElem = getUnionFind().getNumElements();
-
-	int endIslandIndex=1;
-	int startIslandIndex;
-
-
-	//update the sleeping state for bodies, if all are sleeping
-	for ( startIslandIndex=0;startIslandIndex<numElem;startIslandIndex = endIslandIndex)
-	{
-		int islandId = getUnionFind().getElement(startIslandIndex).m_id;
-		for (endIslandIndex = startIslandIndex+1;(endIslandIndex<numElem) && (getUnionFind().getElement(endIslandIndex).m_id == islandId);endIslandIndex++)
-		{
-		}
-
-		//int numSleeping = 0;
-
-		bool allSleeping = true;
-
-		int idx;
-		for (idx=startIslandIndex;idx<endIslandIndex;idx++)
-		{
-			int i = getUnionFind().getElement(idx).m_sz;
-
-			btCollisionObject* colObj0 = collisionObjects[i];
-			if ((colObj0->getIslandTag() != islandId) && (colObj0->getIslandTag() != -1))
-			{
-//				printf("error in island management\n");
-			}
-
-			btAssert((colObj0->getIslandTag() == islandId) || (colObj0->getIslandTag() == -1));
-			if (colObj0->getIslandTag() == islandId)
-			{
-				if (colObj0->getActivationState()== ACTIVE_TAG)
-				{
-					allSleeping = false;
-				}
-				if (colObj0->getActivationState()== DISABLE_DEACTIVATION)
-				{
-					allSleeping = false;
-				}
-			}
-		}
-			
-
-		if (allSleeping)
-		{
-			int idx;
-			for (idx=startIslandIndex;idx<endIslandIndex;idx++)
-			{
-				int i = getUnionFind().getElement(idx).m_sz;
-				btCollisionObject* colObj0 = collisionObjects[i];
-				if ((colObj0->getIslandTag() != islandId) && (colObj0->getIslandTag() != -1))
-				{
-//					printf("error in island management\n");
-				}
-
-				btAssert((colObj0->getIslandTag() == islandId) || (colObj0->getIslandTag() == -1));
-
-				if (colObj0->getIslandTag() == islandId)
-				{
-					colObj0->setActivationState( ISLAND_SLEEPING );
-				}
-			}
-		} else
-		{
-
-			int idx;
-			for (idx=startIslandIndex;idx<endIslandIndex;idx++)
-			{
-				int i = getUnionFind().getElement(idx).m_sz;
-
-				btCollisionObject* colObj0 = collisionObjects[i];
-				if ((colObj0->getIslandTag() != islandId) && (colObj0->getIslandTag() != -1))
-				{
-//					printf("error in island management\n");
-				}
-
-				btAssert((colObj0->getIslandTag() == islandId) || (colObj0->getIslandTag() == -1));
-
-				if (colObj0->getIslandTag() == islandId)
-				{
-					if ( colObj0->getActivationState() == ISLAND_SLEEPING)
-					{
-						colObj0->setActivationState( WANTS_DEACTIVATION);
-						colObj0->setDeactivationTime(0.f);
-					}
-				}
-			}
-		}
-	}
-
-	
-	int i;
-	int maxNumManifolds = dispatcher->getNumManifolds();
-
-//#define SPLIT_ISLANDS 1
-//#ifdef SPLIT_ISLANDS
-
-	
-//#endif //SPLIT_ISLANDS
-
-	
-	for (i=0;i<maxNumManifolds ;i++)
-	{
-		 btPersistentManifold* manifold = dispatcher->getManifoldByIndexInternal(i);
-		 
-		 btCollisionObject* colObj0 = static_cast<btCollisionObject*>(manifold->getBody0());
-		 btCollisionObject* colObj1 = static_cast<btCollisionObject*>(manifold->getBody1());
-		
-		 ///@todo: check sleeping conditions!
-		 if (((colObj0) && colObj0->getActivationState() != ISLAND_SLEEPING) ||
-			((colObj1) && colObj1->getActivationState() != ISLAND_SLEEPING))
-		{
-		
-			//kinematic objects don't merge islands, but wake up all connected objects
-			if (colObj0->isKinematicObject() && colObj0->getActivationState() != ISLAND_SLEEPING)
-			{
-				colObj1->activate();
-			}
-			if (colObj1->isKinematicObject() && colObj1->getActivationState() != ISLAND_SLEEPING)
-			{
-				colObj0->activate();
-			}
-			if(m_splitIslands)
-			{ 
-				//filtering for response
-				if (dispatcher->needsResponse(colObj0,colObj1))
-					m_islandmanifold.push_back(manifold);
-			}
-		}
-	}
-}
-
-
-
-///@todo: this is random access, it can be walked 'cache friendly'!
-void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher,btCollisionWorld* collisionWorld, IslandCallback* callback)
-{
-	btCollisionObjectArray& collisionObjects = collisionWorld->getCollisionObjectArray();
-
-	buildIslands(dispatcher,collisionWorld);
-
-	int endIslandIndex=1;
-	int startIslandIndex;
-	int numElem = getUnionFind().getNumElements();
-
-	BT_PROFILE("processIslands");
-
-	if(!m_splitIslands)
-	{
-		btPersistentManifold** manifold = dispatcher->getInternalManifoldPointer();
-		int maxNumManifolds = dispatcher->getNumManifolds();
-		callback->ProcessIsland(&collisionObjects[0],collisionObjects.size(),manifold,maxNumManifolds, -1);
-	}
-	else
-	{
-		// Sort manifolds, based on islands
-		// Sort the vector using predicate and std::sort
-		//std::sort(islandmanifold.begin(), islandmanifold.end(), btPersistentManifoldSortPredicate);
-
-		int numManifolds = int (m_islandmanifold.size());
-
-		//we should do radix sort, it it much faster (O(n) instead of O (n log2(n))
-		m_islandmanifold.quickSort(btPersistentManifoldSortPredicate());
-
-		//now process all active islands (sets of manifolds for now)
-
-		int startManifoldIndex = 0;
-		int endManifoldIndex = 1;
-
-		//int islandId;
-
-		
-
-	//	printf("Start Islands\n");
-
-		//traverse the simulation islands, and call the solver, unless all objects are sleeping/deactivated
-		for ( startIslandIndex=0;startIslandIndex<numElem;startIslandIndex = endIslandIndex)
-		{
-			int islandId = getUnionFind().getElement(startIslandIndex).m_id;
-
-
-			   bool islandSleeping = true;
-	                
-					for (endIslandIndex = startIslandIndex;(endIslandIndex<numElem) && (getUnionFind().getElement(endIslandIndex).m_id == islandId);endIslandIndex++)
-					{
-							int i = getUnionFind().getElement(endIslandIndex).m_sz;
-							btCollisionObject* colObj0 = collisionObjects[i];
-							m_islandBodies.push_back(colObj0);
-							if (colObj0->isActive())
-									islandSleeping = false;
-					}
-	                
-
-			//find the accompanying contact manifold for this islandId
-			int numIslandManifolds = 0;
-			btPersistentManifold** startManifold = 0;
-
-			if (startManifoldIndex<numManifolds)
-			{
-				int curIslandId = getIslandId(m_islandmanifold[startManifoldIndex]);
-				if (curIslandId == islandId)
-				{
-					startManifold = &m_islandmanifold[startManifoldIndex];
-				
-					for (endManifoldIndex = startManifoldIndex+1;(endManifoldIndex<numManifolds) && (islandId == getIslandId(m_islandmanifold[endManifoldIndex]));endManifoldIndex++)
-					{
-
-					}
-					/// Process the actual simulation, only if not sleeping/deactivated
-					numIslandManifolds = endManifoldIndex-startManifoldIndex;
-				}
-
-			}
-
-			if (!islandSleeping)
-			{
-				callback->ProcessIsland(&m_islandBodies[0],m_islandBodies.size(),startManifold,numIslandManifolds, islandId);
-	//			printf("Island callback of size:%d bodies, %d manifolds\n",islandBodies.size(),numIslandManifolds);
-			}
-			
-			if (numIslandManifolds)
-			{
-				startManifoldIndex = endManifoldIndex;
-			}
-
-			m_islandBodies.resize(0);
-		}
-	} // else if(!splitIslands) 
-
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.h
deleted file mode 100644
index 84b0c6a..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_SIMULATION_ISLAND_MANAGER_H
-#define BT_SIMULATION_ISLAND_MANAGER_H
-
-#include "BulletCollision/CollisionDispatch/btUnionFind.h"
-#include "btCollisionCreateFunc.h"
-#include "LinearMath/btAlignedObjectArray.h"
-#include "btCollisionObject.h"
-
-class btCollisionObject;
-class btCollisionWorld;
-class btDispatcher;
-class btPersistentManifold;
-
-
-///SimulationIslandManager creates and handles simulation islands, using btUnionFind
-class btSimulationIslandManager
-{
-	btUnionFind m_unionFind;
-
-	btAlignedObjectArray<btPersistentManifold*>  m_islandmanifold;
-	btAlignedObjectArray<btCollisionObject* >  m_islandBodies;
-	
-	bool m_splitIslands;
-	
-public:
-	btSimulationIslandManager();
-	virtual ~btSimulationIslandManager();
-
-
-	void initUnionFind(int n);	
-	
-		
-	btUnionFind& getUnionFind() { return m_unionFind;}
-
-	virtual	void	updateActivationState(btCollisionWorld* colWorld,btDispatcher* dispatcher);
-	virtual	void	storeIslandActivationState(btCollisionWorld* world);
-
-
-	void	findUnions(btDispatcher* dispatcher,btCollisionWorld* colWorld);
-
-	
-
-	struct	IslandCallback
-	{
-		virtual ~IslandCallback() {};
-
-		virtual	void	ProcessIsland(btCollisionObject** bodies,int numBodies,class btPersistentManifold**	manifolds,int numManifolds, int islandId) = 0;
-	};
-
-	void	buildAndProcessIslands(btDispatcher* dispatcher,btCollisionWorld* collisionWorld, IslandCallback* callback);
-
-	void buildIslands(btDispatcher* dispatcher,btCollisionWorld* colWorld);
-
-	bool getSplitIslands()
-	{
-		return m_splitIslands;
-	}
-	void setSplitIslands(bool doSplitIslands)
-	{
-		m_splitIslands = doSplitIslands;
-	}
-
-};
-
-#endif //BT_SIMULATION_ISLAND_MANAGER_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp
deleted file mode 100644
index 8df8769..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btSphereBoxCollisionAlgorithm.h"
-#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
-#include "BulletCollision/CollisionShapes/btSphereShape.h"
-#include "BulletCollision/CollisionShapes/btBoxShape.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-//#include <stdio.h>
-
-btSphereBoxCollisionAlgorithm::btSphereBoxCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* col0,btCollisionObject* col1, bool isSwapped)
-: btActivatingCollisionAlgorithm(ci,col0,col1),
-m_ownManifold(false),
-m_manifoldPtr(mf),
-m_isSwapped(isSwapped)
-{
-	btCollisionObject* sphereObj = m_isSwapped? col1 : col0;
-	btCollisionObject* boxObj = m_isSwapped? col0 : col1;
-	
-	if (!m_manifoldPtr && m_dispatcher->needsCollision(sphereObj,boxObj))
-	{
-		m_manifoldPtr = m_dispatcher->getNewManifold(sphereObj,boxObj);
-		m_ownManifold = true;
-	}
-}
-
-
-btSphereBoxCollisionAlgorithm::~btSphereBoxCollisionAlgorithm()
-{
-	if (m_ownManifold)
-	{
-		if (m_manifoldPtr)
-			m_dispatcher->releaseManifold(m_manifoldPtr);
-	}
-}
-
-
-
-void btSphereBoxCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-	(void)dispatchInfo;
-	(void)resultOut;
-	if (!m_manifoldPtr)
-		return;
-
-	btCollisionObject* sphereObj = m_isSwapped? body1 : body0;
-	btCollisionObject* boxObj = m_isSwapped? body0 : body1;
-
-
-	btSphereShape* sphere0 = (btSphereShape*)sphereObj->getCollisionShape();
-
-	btVector3 normalOnSurfaceB;
-	btVector3 pOnBox,pOnSphere;
-	btVector3 sphereCenter = sphereObj->getWorldTransform().getOrigin();
-	btScalar radius = sphere0->getRadius();
-	
-	btScalar dist = getSphereDistance(boxObj,pOnBox,pOnSphere,sphereCenter,radius);
-
-	resultOut->setPersistentManifold(m_manifoldPtr);
-
-	if (dist < SIMD_EPSILON)
-	{
-		btVector3 normalOnSurfaceB = (pOnBox- pOnSphere).normalize();
-
-		/// report a contact. internally this will be kept persistent, and contact reduction is done
-
-		resultOut->addContactPoint(normalOnSurfaceB,pOnBox,dist);
-		
-	}
-
-	if (m_ownManifold)
-	{
-		if (m_manifoldPtr->getNumContacts())
-		{
-			resultOut->refreshContactPoints();
-		}
-	}
-
-}
-
-btScalar btSphereBoxCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-	(void)resultOut;
-	(void)dispatchInfo;
-	(void)col0;
-	(void)col1;
-
-	//not yet
-	return btScalar(1.);
-}
-
-
-btScalar btSphereBoxCollisionAlgorithm::getSphereDistance(btCollisionObject* boxObj, btVector3& pointOnBox, btVector3& v3PointOnSphere, const btVector3& sphereCenter, btScalar fRadius ) 
-{
-
-	btScalar margins;
-	btVector3 bounds[2];
-	btBoxShape* boxShape= (btBoxShape*)boxObj->getCollisionShape();
-	
-	bounds[0] = -boxShape->getHalfExtentsWithoutMargin();
-	bounds[1] = boxShape->getHalfExtentsWithoutMargin();
-
-	margins = boxShape->getMargin();//also add sphereShape margin?
-
-	const btTransform&	m44T = boxObj->getWorldTransform();
-
-	btVector3	boundsVec[2];
-	btScalar	fPenetration;
-
-	boundsVec[0] = bounds[0];
-	boundsVec[1] = bounds[1];
-
-	btVector3	marginsVec( margins, margins, margins );
-
-	// add margins
-	bounds[0] += marginsVec;
-	bounds[1] -= marginsVec;
-
-	/////////////////////////////////////////////////
-
-	btVector3	tmp, prel, n[6], normal, v3P;
-	btScalar   fSep = btScalar(10000000.0), fSepThis;
-
-	n[0].setValue( btScalar(-1.0),  btScalar(0.0),  btScalar(0.0) );
-	n[1].setValue(  btScalar(0.0), btScalar(-1.0),  btScalar(0.0) );
-	n[2].setValue(  btScalar(0.0),  btScalar(0.0), btScalar(-1.0) );
-	n[3].setValue(  btScalar(1.0),  btScalar(0.0),  btScalar(0.0) );
-	n[4].setValue(  btScalar(0.0),  btScalar(1.0),  btScalar(0.0) );
-	n[5].setValue(  btScalar(0.0),  btScalar(0.0),  btScalar(1.0) );
-
-	// convert  point in local space
-	prel = m44T.invXform( sphereCenter);
-	
-	bool	bFound = false;
-
-	v3P = prel;
-
-	for (int i=0;i<6;i++)
-	{
-		int j = i<3? 0:1;
-		if ( (fSepThis = ((v3P-bounds[j]) .dot(n[i]))) > btScalar(0.0) )
-		{
-			v3P = v3P - n[i]*fSepThis;		
-			bFound = true;
-		}
-	}
-	
-	//
-
-	if ( bFound )
-	{
-		bounds[0] = boundsVec[0];
-		bounds[1] = boundsVec[1];
-
-		normal = (prel - v3P).normalize();
-		pointOnBox = v3P + normal*margins;
-		v3PointOnSphere = prel - normal*fRadius;
-
-		if ( ((v3PointOnSphere - pointOnBox) .dot (normal)) > btScalar(0.0) )
-		{
-			return btScalar(1.0);
-		}
-
-		// transform back in world space
-		tmp = m44T( pointOnBox);
-		pointOnBox    = tmp;
-		tmp  = m44T( v3PointOnSphere);		
-		v3PointOnSphere = tmp;
-		btScalar fSeps2 = (pointOnBox-v3PointOnSphere).length2();
-		
-		//if this fails, fallback into deeper penetration case, below
-		if (fSeps2 > SIMD_EPSILON)
-		{
-			fSep = - btSqrt(fSeps2);
-			normal = (pointOnBox-v3PointOnSphere);
-			normal *= btScalar(1.)/fSep;
-		}
-
-		return fSep;
-	}
-
-	//////////////////////////////////////////////////
-	// Deep penetration case
-
-	fPenetration = getSpherePenetration( boxObj,pointOnBox, v3PointOnSphere, sphereCenter, fRadius,bounds[0],bounds[1] );
-
-	bounds[0] = boundsVec[0];
-	bounds[1] = boundsVec[1];
-
-	if ( fPenetration <= btScalar(0.0) )
-		return (fPenetration-margins);
-	else
-		return btScalar(1.0);
-}
-
-btScalar btSphereBoxCollisionAlgorithm::getSpherePenetration( btCollisionObject* boxObj,btVector3& pointOnBox, btVector3& v3PointOnSphere, const btVector3& sphereCenter, btScalar fRadius, const btVector3& aabbMin, const btVector3& aabbMax) 
-{
-
-	btVector3 bounds[2];
-
-	bounds[0] = aabbMin;
-	bounds[1] = aabbMax;
-
-	btVector3	p0, tmp, prel, n[6], normal;
-	btScalar   fSep = btScalar(-10000000.0), fSepThis;
-
-	// set p0 and normal to a default value to shup up GCC
-	p0.setValue(btScalar(0.), btScalar(0.), btScalar(0.));
-	normal.setValue(btScalar(0.), btScalar(0.), btScalar(0.));
-
-	n[0].setValue( btScalar(-1.0),  btScalar(0.0),  btScalar(0.0) );
-	n[1].setValue(  btScalar(0.0), btScalar(-1.0),  btScalar(0.0) );
-	n[2].setValue(  btScalar(0.0),  btScalar(0.0), btScalar(-1.0) );
-	n[3].setValue(  btScalar(1.0),  btScalar(0.0),  btScalar(0.0) );
-	n[4].setValue(  btScalar(0.0),  btScalar(1.0),  btScalar(0.0) );
-	n[5].setValue(  btScalar(0.0),  btScalar(0.0),  btScalar(1.0) );
-
-	const btTransform&	m44T = boxObj->getWorldTransform();
-
-	// convert  point in local space
-	prel = m44T.invXform( sphereCenter);
-
-	///////////
-
-	for (int i=0;i<6;i++)
-	{
-		int j = i<3 ? 0:1;
-		if ( (fSepThis = ((prel-bounds[j]) .dot( n[i]))-fRadius) > btScalar(0.0) )	return btScalar(1.0);
-		if ( fSepThis > fSep )
-		{
-			p0 = bounds[j];	normal = (btVector3&)n[i];
-			fSep = fSepThis;
-		}
-	}
-
-	pointOnBox = prel - normal*(normal.dot((prel-p0)));
-	v3PointOnSphere = pointOnBox + normal*fSep;
-
-	// transform back in world space
-	tmp  = m44T( pointOnBox);		
-	pointOnBox    = tmp;
-	tmp  = m44T( v3PointOnSphere);		v3PointOnSphere = tmp;
-	normal = (pointOnBox-v3PointOnSphere).normalize();
-
-	return fSep;
-
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h
deleted file mode 100644
index 60286ae..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_SPHERE_BOX_COLLISION_ALGORITHM_H
-#define BT_SPHERE_BOX_COLLISION_ALGORITHM_H
-
-#include "btActivatingCollisionAlgorithm.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"
-class btPersistentManifold;
-#include "btCollisionDispatcher.h"
-
-#include "LinearMath/btVector3.h"
-
-/// btSphereBoxCollisionAlgorithm  provides sphere-box collision detection.
-/// Other features are frame-coherency (persistent data) and collision response.
-class btSphereBoxCollisionAlgorithm : public btActivatingCollisionAlgorithm
-{
-	bool	m_ownManifold;
-	btPersistentManifold*	m_manifoldPtr;
-	bool	m_isSwapped;
-	
-public:
-
-	btSphereBoxCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* col0,btCollisionObject* col1, bool isSwapped);
-
-	virtual ~btSphereBoxCollisionAlgorithm();
-
-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
-	{
-		if (m_manifoldPtr && m_ownManifold)
-		{
-			manifoldArray.push_back(m_manifoldPtr);
-		}
-	}
-
-	btScalar getSphereDistance( btCollisionObject* boxObj,btVector3& v3PointOnBox, btVector3& v3PointOnSphere, const btVector3& v3SphereCenter, btScalar fRadius );
-
-	btScalar getSpherePenetration( btCollisionObject* boxObj, btVector3& v3PointOnBox, btVector3& v3PointOnSphere, const btVector3& v3SphereCenter, btScalar fRadius, const btVector3& aabbMin, const btVector3& aabbMax);
-	
-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
-	{
-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
-		{
-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btSphereBoxCollisionAlgorithm));
-			if (!m_swapped)
-			{
-				return new(mem) btSphereBoxCollisionAlgorithm(0,ci,body0,body1,false);
-			} else
-			{
-				return new(mem) btSphereBoxCollisionAlgorithm(0,ci,body0,body1,true);
-			}
-		}
-	};
-
-};
-
-#endif //BT_SPHERE_BOX_COLLISION_ALGORITHM_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp
deleted file mode 100644
index 5c4e78f..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btSphereSphereCollisionAlgorithm.h"
-#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
-#include "BulletCollision/CollisionShapes/btSphereShape.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-
-btSphereSphereCollisionAlgorithm::btSphereSphereCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* col0,btCollisionObject* col1)
-: btActivatingCollisionAlgorithm(ci,col0,col1),
-m_ownManifold(false),
-m_manifoldPtr(mf)
-{
-	if (!m_manifoldPtr)
-	{
-		m_manifoldPtr = m_dispatcher->getNewManifold(col0,col1);
-		m_ownManifold = true;
-	}
-}
-
-btSphereSphereCollisionAlgorithm::~btSphereSphereCollisionAlgorithm()
-{
-	if (m_ownManifold)
-	{
-		if (m_manifoldPtr)
-			m_dispatcher->releaseManifold(m_manifoldPtr);
-	}
-}
-
-void btSphereSphereCollisionAlgorithm::processCollision (btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-	(void)dispatchInfo;
-
-	if (!m_manifoldPtr)
-		return;
-
-	resultOut->setPersistentManifold(m_manifoldPtr);
-
-	btSphereShape* sphere0 = (btSphereShape*)col0->getCollisionShape();
-	btSphereShape* sphere1 = (btSphereShape*)col1->getCollisionShape();
-
-	btVector3 diff = col0->getWorldTransform().getOrigin()-  col1->getWorldTransform().getOrigin();
-	btScalar len = diff.length();
-	btScalar radius0 = sphere0->getRadius();
-	btScalar radius1 = sphere1->getRadius();
-
-#ifdef CLEAR_MANIFOLD
-	m_manifoldPtr->clearManifold(); //don't do this, it disables warmstarting
-#endif
-
-	///iff distance positive, don't generate a new contact
-	if ( len > (radius0+radius1))
-	{
-#ifndef CLEAR_MANIFOLD
-		resultOut->refreshContactPoints();
-#endif //CLEAR_MANIFOLD
-		return;
-	}
-	///distance (negative means penetration)
-	btScalar dist = len - (radius0+radius1);
-
-	btVector3 normalOnSurfaceB(1,0,0);
-	if (len > SIMD_EPSILON)
-	{
-		normalOnSurfaceB = diff / len;
-	}
-
-	///point on A (worldspace)
-	///btVector3 pos0 = col0->getWorldTransform().getOrigin() - radius0 * normalOnSurfaceB;
-	///point on B (worldspace)
-	btVector3 pos1 = col1->getWorldTransform().getOrigin() + radius1* normalOnSurfaceB;
-
-	/// report a contact. internally this will be kept persistent, and contact reduction is done
-	
-	
-	resultOut->addContactPoint(normalOnSurfaceB,pos1,dist);
-
-#ifndef CLEAR_MANIFOLD
-	resultOut->refreshContactPoints();
-#endif //CLEAR_MANIFOLD
-
-}
-
-btScalar btSphereSphereCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-	(void)col0;
-	(void)col1;
-	(void)dispatchInfo;
-	(void)resultOut;
-
-	//not yet
-	return btScalar(1.);
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h
deleted file mode 100644
index e55acf2..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_SPHERE_SPHERE_COLLISION_ALGORITHM_H
-#define BT_SPHERE_SPHERE_COLLISION_ALGORITHM_H
-
-#include "btActivatingCollisionAlgorithm.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"
-#include "btCollisionDispatcher.h"
-
-class btPersistentManifold;
-
-/// btSphereSphereCollisionAlgorithm  provides sphere-sphere collision detection.
-/// Other features are frame-coherency (persistent data) and collision response.
-/// Also provides the most basic sample for custom/user btCollisionAlgorithm
-class btSphereSphereCollisionAlgorithm : public btActivatingCollisionAlgorithm
-{
-	bool	m_ownManifold;
-	btPersistentManifold*	m_manifoldPtr;
-	
-public:
-	btSphereSphereCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1);
-
-	btSphereSphereCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci)
-		: btActivatingCollisionAlgorithm(ci) {}
-
-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
-	{
-		if (m_manifoldPtr && m_ownManifold)
-		{
-			manifoldArray.push_back(m_manifoldPtr);
-		}
-	}
-	
-	virtual ~btSphereSphereCollisionAlgorithm();
-
-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
-	{
-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
-		{
-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btSphereSphereCollisionAlgorithm));
-			return new(mem) btSphereSphereCollisionAlgorithm(0,ci,body0,body1);
-		}
-	};
-
-};
-
-#endif //BT_SPHERE_SPHERE_COLLISION_ALGORITHM_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp
deleted file mode 100644
index c327c3f..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "btSphereTriangleCollisionAlgorithm.h"
-#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
-#include "BulletCollision/CollisionShapes/btSphereShape.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-#include "SphereTriangleDetector.h"
-
-
-btSphereTriangleCollisionAlgorithm::btSphereTriangleCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* col0,btCollisionObject* col1,bool swapped)
-: btActivatingCollisionAlgorithm(ci,col0,col1),
-m_ownManifold(false),
-m_manifoldPtr(mf),
-m_swapped(swapped)
-{
-	if (!m_manifoldPtr)
-	{
-		m_manifoldPtr = m_dispatcher->getNewManifold(col0,col1);
-		m_ownManifold = true;
-	}
-}
-
-btSphereTriangleCollisionAlgorithm::~btSphereTriangleCollisionAlgorithm()
-{
-	if (m_ownManifold)
-	{
-		if (m_manifoldPtr)
-			m_dispatcher->releaseManifold(m_manifoldPtr);
-	}
-}
-
-void btSphereTriangleCollisionAlgorithm::processCollision (btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-	if (!m_manifoldPtr)
-		return;
-
-	btCollisionObject* sphereObj = m_swapped? col1 : col0;
-	btCollisionObject* triObj = m_swapped? col0 : col1;
-
-	btSphereShape* sphere = (btSphereShape*)sphereObj->getCollisionShape();
-	btTriangleShape* triangle = (btTriangleShape*)triObj->getCollisionShape();
-	
-	/// report a contact. internally this will be kept persistent, and contact reduction is done
-	resultOut->setPersistentManifold(m_manifoldPtr);
-	SphereTriangleDetector detector(sphere,triangle, m_manifoldPtr->getContactBreakingThreshold());
-	
-	btDiscreteCollisionDetectorInterface::ClosestPointInput input;
-	input.m_maximumDistanceSquared = btScalar(BT_LARGE_FLOAT);///@todo: tighter bounds
-	input.m_transformA = sphereObj->getWorldTransform();
-	input.m_transformB = triObj->getWorldTransform();
-
-	bool swapResults = m_swapped;
-
-	detector.getClosestPoints(input,*resultOut,dispatchInfo.m_debugDraw,swapResults);
-
-	if (m_ownManifold)
-		resultOut->refreshContactPoints();
-	
-}
-
-btScalar btSphereTriangleCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-	(void)resultOut;
-	(void)dispatchInfo;
-	(void)col0;
-	(void)col1;
-
-	//not yet
-	return btScalar(1.);
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h
deleted file mode 100644
index 7c6c4d8..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_SPHERE_TRIANGLE_COLLISION_ALGORITHM_H
-#define BT_SPHERE_TRIANGLE_COLLISION_ALGORITHM_H
-
-#include "btActivatingCollisionAlgorithm.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"
-class btPersistentManifold;
-#include "btCollisionDispatcher.h"
-
-/// btSphereSphereCollisionAlgorithm  provides sphere-sphere collision detection.
-/// Other features are frame-coherency (persistent data) and collision response.
-/// Also provides the most basic sample for custom/user btCollisionAlgorithm
-class btSphereTriangleCollisionAlgorithm : public btActivatingCollisionAlgorithm
-{
-	bool	m_ownManifold;
-	btPersistentManifold*	m_manifoldPtr;
-	bool	m_swapped;
-	
-public:
-	btSphereTriangleCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1,bool swapped);
-
-	btSphereTriangleCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci)
-		: btActivatingCollisionAlgorithm(ci) {}
-
-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
-	{
-		if (m_manifoldPtr && m_ownManifold)
-		{
-			manifoldArray.push_back(m_manifoldPtr);
-		}
-	}
-	
-	virtual ~btSphereTriangleCollisionAlgorithm();
-
-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
-	{
-		
-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
-		{
-			
-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btSphereTriangleCollisionAlgorithm));
-
-			return new(mem) btSphereTriangleCollisionAlgorithm(ci.m_manifold,ci,body0,body1,m_swapped);
-		}
-	};
-
-};
-
-#endif //BT_SPHERE_TRIANGLE_COLLISION_ALGORITHM_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btUnionFind.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btUnionFind.cpp
deleted file mode 100644
index 4c4f58d..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btUnionFind.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btUnionFind.h"
-
-
-
-btUnionFind::~btUnionFind()
-{
-	Free();
-
-}
-
-btUnionFind::btUnionFind()
-{ 
-
-}
-
-void	btUnionFind::allocate(int N)
-{
-	m_elements.resize(N);
-}
-void	btUnionFind::Free()
-{
-	m_elements.clear();
-}
-
-
-void	btUnionFind::reset(int N)
-{
-	allocate(N);
-
-	for (int i = 0; i < N; i++) 
-	{ 
-		m_elements[i].m_id = i; m_elements[i].m_sz = 1; 
-	} 
-}
-
-
-class btUnionFindElementSortPredicate
-{
-	public:
-
-		bool operator() ( const btElement& lhs, const btElement& rhs )
-		{
-			return lhs.m_id < rhs.m_id;
-		}
-};
-
-///this is a special operation, destroying the content of btUnionFind.
-///it sorts the elements, based on island id, in order to make it easy to iterate over islands
-void	btUnionFind::sortIslands()
-{
-
-	//first store the original body index, and islandId
-	int numElements = m_elements.size();
-	
-	for (int i=0;i<numElements;i++)
-	{
-		m_elements[i].m_id = find(i);
-#ifndef STATIC_SIMULATION_ISLAND_OPTIMIZATION
-		m_elements[i].m_sz = i;
-#endif //STATIC_SIMULATION_ISLAND_OPTIMIZATION
-	}
-	
-	 // Sort the vector using predicate and std::sort
-	  //std::sort(m_elements.begin(), m_elements.end(), btUnionFindElementSortPredicate);
-	  m_elements.quickSort(btUnionFindElementSortPredicate());
-
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btUnionFind.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btUnionFind.h
deleted file mode 100644
index ef2a292..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btUnionFind.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_UNION_FIND_H
-#define BT_UNION_FIND_H
-
-#include "LinearMath/btAlignedObjectArray.h"
-
-#define USE_PATH_COMPRESSION 1
-
-///see for discussion of static island optimizations by Vroonsh here: http://code.google.com/p/bullet/issues/detail?id=406
-#define STATIC_SIMULATION_ISLAND_OPTIMIZATION 1
-
-struct	btElement
-{
-	int	m_id;
-	int	m_sz;
-};
-
-///UnionFind calculates connected subsets
-// Implements weighted Quick Union with path compression
-// optimization: could use short ints instead of ints (halving memory, would limit the number of rigid bodies to 64k, sounds reasonable)
-class btUnionFind
-  {
-    private:
-		btAlignedObjectArray<btElement>	m_elements;
-
-    public:
-	  
-		btUnionFind();
-		~btUnionFind();
-
-	
-		//this is a special operation, destroying the content of btUnionFind.
-		//it sorts the elements, based on island id, in order to make it easy to iterate over islands
-		void	sortIslands();
-
-	  void	reset(int N);
-
-	  SIMD_FORCE_INLINE int	getNumElements() const
-	  {
-		  return int(m_elements.size());
-	  }
-	  SIMD_FORCE_INLINE bool  isRoot(int x) const
-	  {
-		  return (x == m_elements[x].m_id);
-	  }
-
-	  btElement&	getElement(int index)
-	  {
-		  return m_elements[index];
-	  }
-	  const btElement& getElement(int index) const
-	  {
-		  return m_elements[index];
-	  }
-   
-	  void	allocate(int N);
-	  void	Free();
-
-
-
-
-	  int find(int p, int q)
-		{ 
-			return (find(p) == find(q)); 
-		}
-
-		void unite(int p, int q)
-		{
-			int i = find(p), j = find(q);
-			if (i == j) 
-				return;
-
-#ifndef USE_PATH_COMPRESSION
-			//weighted quick union, this keeps the 'trees' balanced, and keeps performance of unite O( log(n) )
-			if (m_elements[i].m_sz < m_elements[j].m_sz)
-			{ 
-				m_elements[i].m_id = j; m_elements[j].m_sz += m_elements[i].m_sz; 
-			}
-			else 
-			{ 
-				m_elements[j].m_id = i; m_elements[i].m_sz += m_elements[j].m_sz; 
-			}
-#else
-			m_elements[i].m_id = j; m_elements[j].m_sz += m_elements[i].m_sz; 
-#endif //USE_PATH_COMPRESSION
-		}
-
-		int find(int x)
-		{ 
-			//btAssert(x < m_N);
-			//btAssert(x >= 0);
-
-			while (x != m_elements[x].m_id) 
-			{
-		//not really a reason not to use path compression, and it flattens the trees/improves find performance dramatically
-	
-		#ifdef USE_PATH_COMPRESSION
-				const btElement* elementPtr = &m_elements[m_elements[x].m_id];
-				m_elements[x].m_id = elementPtr->m_id;
-				x = elementPtr->m_id;			
-		#else//
-				x = m_elements[x].m_id;
-		#endif		
-				//btAssert(x < m_N);
-				//btAssert(x >= 0);
-
-			}
-			return x; 
-		}
-
-
-  };
-
-
-#endif //BT_UNION_FIND_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBox2dShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBox2dShape.cpp
deleted file mode 100644
index ecce028..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBox2dShape.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btBox2dShape.h"
-
-
-//{ 
-
-
-void btBox2dShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
-{
-	btTransformAabb(getHalfExtentsWithoutMargin(),getMargin(),t,aabbMin,aabbMax);
-}
-
-
-void	btBox2dShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
-{
-	//btScalar margin = btScalar(0.);
-	btVector3 halfExtents = getHalfExtentsWithMargin();
-
-	btScalar lx=btScalar(2.)*(halfExtents.x());
-	btScalar ly=btScalar(2.)*(halfExtents.y());
-	btScalar lz=btScalar(2.)*(halfExtents.z());
-
-	inertia.setValue(mass/(btScalar(12.0)) * (ly*ly + lz*lz),
-					mass/(btScalar(12.0)) * (lx*lx + lz*lz),
-					mass/(btScalar(12.0)) * (lx*lx + ly*ly));
-
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBox2dShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBox2dShape.h
deleted file mode 100644
index 93e8fab..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBox2dShape.h
+++ /dev/null
@@ -1,363 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_OBB_BOX_2D_SHAPE_H
-#define BT_OBB_BOX_2D_SHAPE_H
-
-#include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h"
-#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btMinMax.h"
-
-///The btBox2dShape is a box primitive around the origin, its sides axis aligned with length specified by half extents, in local shape coordinates. When used as part of a btCollisionObject or btRigidBody it will be an oriented box in world space.
-class btBox2dShape: public btPolyhedralConvexShape
-{
-
-	//btVector3	m_boxHalfExtents1; //use m_implicitShapeDimensions instead
-
-	btVector3 m_centroid;
-	btVector3 m_vertices[4];
-	btVector3 m_normals[4];
-
-public:
-
-	btVector3 getHalfExtentsWithMargin() const
-	{
-		btVector3 halfExtents = getHalfExtentsWithoutMargin();
-		btVector3 margin(getMargin(),getMargin(),getMargin());
-		halfExtents += margin;
-		return halfExtents;
-	}
-	
-	const btVector3& getHalfExtentsWithoutMargin() const
-	{
-		return m_implicitShapeDimensions;//changed in Bullet 2.63: assume the scaling and margin are included
-	}
-	
-
-	virtual btVector3	localGetSupportingVertex(const btVector3& vec) const
-	{
-		btVector3 halfExtents = getHalfExtentsWithoutMargin();
-		btVector3 margin(getMargin(),getMargin(),getMargin());
-		halfExtents += margin;
-		
-		return btVector3(btFsels(vec.x(), halfExtents.x(), -halfExtents.x()),
-			btFsels(vec.y(), halfExtents.y(), -halfExtents.y()),
-			btFsels(vec.z(), halfExtents.z(), -halfExtents.z()));
-	}
-
-	SIMD_FORCE_INLINE  btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const
-	{
-		const btVector3& halfExtents = getHalfExtentsWithoutMargin();
-		
-		return btVector3(btFsels(vec.x(), halfExtents.x(), -halfExtents.x()),
-			btFsels(vec.y(), halfExtents.y(), -halfExtents.y()),
-			btFsels(vec.z(), halfExtents.z(), -halfExtents.z()));
-	}
-
-	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
-	{
-		const btVector3& halfExtents = getHalfExtentsWithoutMargin();
-	
-		for (int i=0;i<numVectors;i++)
-		{
-			const btVector3& vec = vectors[i];
-			supportVerticesOut[i].setValue(btFsels(vec.x(), halfExtents.x(), -halfExtents.x()),
-				btFsels(vec.y(), halfExtents.y(), -halfExtents.y()),
-				btFsels(vec.z(), halfExtents.z(), -halfExtents.z())); 
-		}
-
-	}
-
-
-	btBox2dShape( const btVector3& boxHalfExtents) 
-		: btPolyhedralConvexShape(),
-		m_centroid(0,0,0)
-	{
-		m_vertices[0].setValue(-boxHalfExtents.getX(),-boxHalfExtents.getY(),0);
-		m_vertices[1].setValue(boxHalfExtents.getX(),-boxHalfExtents.getY(),0);
-		m_vertices[2].setValue(boxHalfExtents.getX(),boxHalfExtents.getY(),0);
-		m_vertices[3].setValue(-boxHalfExtents.getX(),boxHalfExtents.getY(),0);
-
-		m_normals[0].setValue(0,-1,0);
-		m_normals[1].setValue(1,0,0);
-		m_normals[2].setValue(0,1,0);
-		m_normals[3].setValue(-1,0,0);
-
-		m_shapeType = BOX_2D_SHAPE_PROXYTYPE;
-		btVector3 margin(getMargin(),getMargin(),getMargin());
-		m_implicitShapeDimensions = (boxHalfExtents * m_localScaling) - margin;
-	};
-
-	virtual void setMargin(btScalar collisionMargin)
-	{
-		//correct the m_implicitShapeDimensions for the margin
-		btVector3 oldMargin(getMargin(),getMargin(),getMargin());
-		btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions+oldMargin;
-		
-		btConvexInternalShape::setMargin(collisionMargin);
-		btVector3 newMargin(getMargin(),getMargin(),getMargin());
-		m_implicitShapeDimensions = implicitShapeDimensionsWithMargin - newMargin;
-
-	}
-	virtual void	setLocalScaling(const btVector3& scaling)
-	{
-		btVector3 oldMargin(getMargin(),getMargin(),getMargin());
-		btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions+oldMargin;
-		btVector3 unScaledImplicitShapeDimensionsWithMargin = implicitShapeDimensionsWithMargin / m_localScaling;
-
-		btConvexInternalShape::setLocalScaling(scaling);
-
-		m_implicitShapeDimensions = (unScaledImplicitShapeDimensionsWithMargin * m_localScaling) - oldMargin;
-
-	}
-
-	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
-
-	
-
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
-
-
-
-
-
-	int	getVertexCount() const
-	{
-		return 4;
-	}
-
-	virtual int getNumVertices()const
-	{
-		return 4;
-	}
-
-	const btVector3* getVertices() const
-	{
-		return &m_vertices[0];
-	}
-
-	const btVector3* getNormals() const
-	{
-		return &m_normals[0];
-	}
-
-
-
-
-
-
-
-	virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i ) const
-	{
-		//this plane might not be aligned...
-		btVector4 plane ;
-		getPlaneEquation(plane,i);
-		planeNormal = btVector3(plane.getX(),plane.getY(),plane.getZ());
-		planeSupport = localGetSupportingVertex(-planeNormal);
-	}
-
-
-	const btVector3& getCentroid() const
-	{
-		return m_centroid;
-	}
-	
-	virtual int getNumPlanes() const
-	{
-		return 6;
-	}	
-	
-	
-
-	virtual int getNumEdges() const
-	{
-		return 12;
-	}
-
-
-	virtual void getVertex(int i,btVector3& vtx) const
-	{
-		btVector3 halfExtents = getHalfExtentsWithoutMargin();
-
-		vtx = btVector3(
-				halfExtents.x() * (1-(i&1)) - halfExtents.x() * (i&1),
-				halfExtents.y() * (1-((i&2)>>1)) - halfExtents.y() * ((i&2)>>1),
-				halfExtents.z() * (1-((i&4)>>2)) - halfExtents.z() * ((i&4)>>2));
-	}
-	
-
-	virtual void	getPlaneEquation(btVector4& plane,int i) const
-	{
-		btVector3 halfExtents = getHalfExtentsWithoutMargin();
-
-		switch (i)
-		{
-		case 0:
-			plane.setValue(btScalar(1.),btScalar(0.),btScalar(0.),-halfExtents.x());
-			break;
-		case 1:
-			plane.setValue(btScalar(-1.),btScalar(0.),btScalar(0.),-halfExtents.x());
-			break;
-		case 2:
-			plane.setValue(btScalar(0.),btScalar(1.),btScalar(0.),-halfExtents.y());
-			break;
-		case 3:
-			plane.setValue(btScalar(0.),btScalar(-1.),btScalar(0.),-halfExtents.y());
-			break;
-		case 4:
-			plane.setValue(btScalar(0.),btScalar(0.),btScalar(1.),-halfExtents.z());
-			break;
-		case 5:
-			plane.setValue(btScalar(0.),btScalar(0.),btScalar(-1.),-halfExtents.z());
-			break;
-		default:
-			btAssert(0);
-		}
-	}
-
-	
-	virtual void getEdge(int i,btVector3& pa,btVector3& pb) const
-	//virtual void getEdge(int i,Edge& edge) const
-	{
-		int edgeVert0 = 0;
-		int edgeVert1 = 0;
-
-		switch (i)
-		{
-		case 0:
-				edgeVert0 = 0;
-				edgeVert1 = 1;
-			break;
-		case 1:
-				edgeVert0 = 0;
-				edgeVert1 = 2;
-			break;
-		case 2:
-			edgeVert0 = 1;
-			edgeVert1 = 3;
-
-			break;
-		case 3:
-			edgeVert0 = 2;
-			edgeVert1 = 3;
-			break;
-		case 4:
-			edgeVert0 = 0;
-			edgeVert1 = 4;
-			break;
-		case 5:
-			edgeVert0 = 1;
-			edgeVert1 = 5;
-
-			break;
-		case 6:
-			edgeVert0 = 2;
-			edgeVert1 = 6;
-			break;
-		case 7:
-			edgeVert0 = 3;
-			edgeVert1 = 7;
-			break;
-		case 8:
-			edgeVert0 = 4;
-			edgeVert1 = 5;
-			break;
-		case 9:
-			edgeVert0 = 4;
-			edgeVert1 = 6;
-			break;
-		case 10:
-			edgeVert0 = 5;
-			edgeVert1 = 7;
-			break;
-		case 11:
-			edgeVert0 = 6;
-			edgeVert1 = 7;
-			break;
-		default:
-			btAssert(0);
-
-		}
-
-		getVertex(edgeVert0,pa );
-		getVertex(edgeVert1,pb );
-	}
-
-
-
-
-	
-	virtual	bool isInside(const btVector3& pt,btScalar tolerance) const
-	{
-		btVector3 halfExtents = getHalfExtentsWithoutMargin();
-
-		//btScalar minDist = 2*tolerance;
-		
-		bool result =	(pt.x() <= (halfExtents.x()+tolerance)) &&
-						(pt.x() >= (-halfExtents.x()-tolerance)) &&
-						(pt.y() <= (halfExtents.y()+tolerance)) &&
-						(pt.y() >= (-halfExtents.y()-tolerance)) &&
-						(pt.z() <= (halfExtents.z()+tolerance)) &&
-						(pt.z() >= (-halfExtents.z()-tolerance));
-		
-		return result;
-	}
-
-
-	//debugging
-	virtual const char*	getName()const
-	{
-		return "Box2d";
-	}
-
-	virtual int		getNumPreferredPenetrationDirections() const
-	{
-		return 6;
-	}
-	
-	virtual void	getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const
-	{
-		switch (index)
-		{
-		case 0:
-			penetrationVector.setValue(btScalar(1.),btScalar(0.),btScalar(0.));
-			break;
-		case 1:
-			penetrationVector.setValue(btScalar(-1.),btScalar(0.),btScalar(0.));
-			break;
-		case 2:
-			penetrationVector.setValue(btScalar(0.),btScalar(1.),btScalar(0.));
-			break;
-		case 3:
-			penetrationVector.setValue(btScalar(0.),btScalar(-1.),btScalar(0.));
-			break;
-		case 4:
-			penetrationVector.setValue(btScalar(0.),btScalar(0.),btScalar(1.));
-			break;
-		case 5:
-			penetrationVector.setValue(btScalar(0.),btScalar(0.),btScalar(-1.));
-			break;
-		default:
-			btAssert(0);
-		}
-	}
-
-};
-
-#endif //BT_OBB_BOX_2D_SHAPE_H
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBoxShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBoxShape.cpp
deleted file mode 100644
index c6644ef..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBoxShape.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-#include "btBoxShape.h"
-
-
-//{ 
-
-
-void btBoxShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
-{
-	btTransformAabb(getHalfExtentsWithoutMargin(),getMargin(),t,aabbMin,aabbMax);
-}
-
-
-void	btBoxShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
-{
-	//btScalar margin = btScalar(0.);
-	btVector3 halfExtents = getHalfExtentsWithMargin();
-
-	btScalar lx=btScalar(2.)*(halfExtents.x());
-	btScalar ly=btScalar(2.)*(halfExtents.y());
-	btScalar lz=btScalar(2.)*(halfExtents.z());
-
-	inertia.setValue(mass/(btScalar(12.0)) * (ly*ly + lz*lz),
-					mass/(btScalar(12.0)) * (lx*lx + lz*lz),
-					mass/(btScalar(12.0)) * (lx*lx + ly*ly));
-
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBoxShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBoxShape.h
deleted file mode 100644
index 8b8525d..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBoxShape.h
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_OBB_BOX_MINKOWSKI_H
-#define BT_OBB_BOX_MINKOWSKI_H
-
-#include "btPolyhedralConvexShape.h"
-#include "btCollisionMargin.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btMinMax.h"
-
-///The btBoxShape is a box primitive around the origin, its sides axis aligned with length specified by half extents, in local shape coordinates. When used as part of a btCollisionObject or btRigidBody it will be an oriented box in world space.
-class btBoxShape: public btPolyhedralConvexShape
-{
-
-	//btVector3	m_boxHalfExtents1; //use m_implicitShapeDimensions instead
-
-
-public:
-
-	btVector3 getHalfExtentsWithMargin() const
-	{
-		btVector3 halfExtents = getHalfExtentsWithoutMargin();
-		btVector3 margin(getMargin(),getMargin(),getMargin());
-		halfExtents += margin;
-		return halfExtents;
-	}
-	
-	const btVector3& getHalfExtentsWithoutMargin() const
-	{
-		return m_implicitShapeDimensions;//scaling is included, margin is not
-	}
-	
-
-	virtual btVector3	localGetSupportingVertex(const btVector3& vec) const
-	{
-		btVector3 halfExtents = getHalfExtentsWithoutMargin();
-		btVector3 margin(getMargin(),getMargin(),getMargin());
-		halfExtents += margin;
-		
-		return btVector3(btFsels(vec.x(), halfExtents.x(), -halfExtents.x()),
-			btFsels(vec.y(), halfExtents.y(), -halfExtents.y()),
-			btFsels(vec.z(), halfExtents.z(), -halfExtents.z()));
-	}
-
-	SIMD_FORCE_INLINE  btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const
-	{
-		const btVector3& halfExtents = getHalfExtentsWithoutMargin();
-		
-		return btVector3(btFsels(vec.x(), halfExtents.x(), -halfExtents.x()),
-			btFsels(vec.y(), halfExtents.y(), -halfExtents.y()),
-			btFsels(vec.z(), halfExtents.z(), -halfExtents.z()));
-	}
-
-	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
-	{
-		const btVector3& halfExtents = getHalfExtentsWithoutMargin();
-	
-		for (int i=0;i<numVectors;i++)
-		{
-			const btVector3& vec = vectors[i];
-			supportVerticesOut[i].setValue(btFsels(vec.x(), halfExtents.x(), -halfExtents.x()),
-				btFsels(vec.y(), halfExtents.y(), -halfExtents.y()),
-				btFsels(vec.z(), halfExtents.z(), -halfExtents.z())); 
-		}
-
-	}
-
-
-	btBoxShape( const btVector3& boxHalfExtents) 
-		: btPolyhedralConvexShape()
-	{
-		m_shapeType = BOX_SHAPE_PROXYTYPE;
-		btVector3 margin(getMargin(),getMargin(),getMargin());
-		m_implicitShapeDimensions = (boxHalfExtents * m_localScaling) - margin;
-	};
-
-	virtual void setMargin(btScalar collisionMargin)
-	{
-		//correct the m_implicitShapeDimensions for the margin
-		btVector3 oldMargin(getMargin(),getMargin(),getMargin());
-		btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions+oldMargin;
-		
-		btConvexInternalShape::setMargin(collisionMargin);
-		btVector3 newMargin(getMargin(),getMargin(),getMargin());
-		m_implicitShapeDimensions = implicitShapeDimensionsWithMargin - newMargin;
-
-	}
-	virtual void	setLocalScaling(const btVector3& scaling)
-	{
-		btVector3 oldMargin(getMargin(),getMargin(),getMargin());
-		btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions+oldMargin;
-		btVector3 unScaledImplicitShapeDimensionsWithMargin = implicitShapeDimensionsWithMargin / m_localScaling;
-
-		btConvexInternalShape::setLocalScaling(scaling);
-
-		m_implicitShapeDimensions = (unScaledImplicitShapeDimensionsWithMargin * m_localScaling) - oldMargin;
-
-	}
-
-	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
-
-	
-
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
-
-	virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i ) const
-	{
-		//this plane might not be aligned...
-		btVector4 plane ;
-		getPlaneEquation(plane,i);
-		planeNormal = btVector3(plane.getX(),plane.getY(),plane.getZ());
-		planeSupport = localGetSupportingVertex(-planeNormal);
-	}
-
-	
-	virtual int getNumPlanes() const
-	{
-		return 6;
-	}	
-	
-	virtual int	getNumVertices() const 
-	{
-		return 8;
-	}
-
-	virtual int getNumEdges() const
-	{
-		return 12;
-	}
-
-
-	virtual void getVertex(int i,btVector3& vtx) const
-	{
-		btVector3 halfExtents = getHalfExtentsWithMargin();
-
-		vtx = btVector3(
-				halfExtents.x() * (1-(i&1)) - halfExtents.x() * (i&1),
-				halfExtents.y() * (1-((i&2)>>1)) - halfExtents.y() * ((i&2)>>1),
-				halfExtents.z() * (1-((i&4)>>2)) - halfExtents.z() * ((i&4)>>2));
-	}
-	
-
-	virtual void	getPlaneEquation(btVector4& plane,int i) const
-	{
-		btVector3 halfExtents = getHalfExtentsWithoutMargin();
-
-		switch (i)
-		{
-		case 0:
-			plane.setValue(btScalar(1.),btScalar(0.),btScalar(0.),-halfExtents.x());
-			break;
-		case 1:
-			plane.setValue(btScalar(-1.),btScalar(0.),btScalar(0.),-halfExtents.x());
-			break;
-		case 2:
-			plane.setValue(btScalar(0.),btScalar(1.),btScalar(0.),-halfExtents.y());
-			break;
-		case 3:
-			plane.setValue(btScalar(0.),btScalar(-1.),btScalar(0.),-halfExtents.y());
-			break;
-		case 4:
-			plane.setValue(btScalar(0.),btScalar(0.),btScalar(1.),-halfExtents.z());
-			break;
-		case 5:
-			plane.setValue(btScalar(0.),btScalar(0.),btScalar(-1.),-halfExtents.z());
-			break;
-		default:
-			btAssert(0);
-		}
-	}
-
-	
-	virtual void getEdge(int i,btVector3& pa,btVector3& pb) const
-	//virtual void getEdge(int i,Edge& edge) const
-	{
-		int edgeVert0 = 0;
-		int edgeVert1 = 0;
-
-		switch (i)
-		{
-		case 0:
-				edgeVert0 = 0;
-				edgeVert1 = 1;
-			break;
-		case 1:
-				edgeVert0 = 0;
-				edgeVert1 = 2;
-			break;
-		case 2:
-			edgeVert0 = 1;
-			edgeVert1 = 3;
-
-			break;
-		case 3:
-			edgeVert0 = 2;
-			edgeVert1 = 3;
-			break;
-		case 4:
-			edgeVert0 = 0;
-			edgeVert1 = 4;
-			break;
-		case 5:
-			edgeVert0 = 1;
-			edgeVert1 = 5;
-
-			break;
-		case 6:
-			edgeVert0 = 2;
-			edgeVert1 = 6;
-			break;
-		case 7:
-			edgeVert0 = 3;
-			edgeVert1 = 7;
-			break;
-		case 8:
-			edgeVert0 = 4;
-			edgeVert1 = 5;
-			break;
-		case 9:
-			edgeVert0 = 4;
-			edgeVert1 = 6;
-			break;
-		case 10:
-			edgeVert0 = 5;
-			edgeVert1 = 7;
-			break;
-		case 11:
-			edgeVert0 = 6;
-			edgeVert1 = 7;
-			break;
-		default:
-			btAssert(0);
-
-		}
-
-		getVertex(edgeVert0,pa );
-		getVertex(edgeVert1,pb );
-	}
-
-
-
-
-	
-	virtual	bool isInside(const btVector3& pt,btScalar tolerance) const
-	{
-		btVector3 halfExtents = getHalfExtentsWithoutMargin();
-
-		//btScalar minDist = 2*tolerance;
-		
-		bool result =	(pt.x() <= (halfExtents.x()+tolerance)) &&
-						(pt.x() >= (-halfExtents.x()-tolerance)) &&
-						(pt.y() <= (halfExtents.y()+tolerance)) &&
-						(pt.y() >= (-halfExtents.y()-tolerance)) &&
-						(pt.z() <= (halfExtents.z()+tolerance)) &&
-						(pt.z() >= (-halfExtents.z()-tolerance));
-		
-		return result;
-	}
-
-
-	//debugging
-	virtual const char*	getName()const
-	{
-		return "Box";
-	}
-
-	virtual int		getNumPreferredPenetrationDirections() const
-	{
-		return 6;
-	}
-	
-	virtual void	getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const
-	{
-		switch (index)
-		{
-		case 0:
-			penetrationVector.setValue(btScalar(1.),btScalar(0.),btScalar(0.));
-			break;
-		case 1:
-			penetrationVector.setValue(btScalar(-1.),btScalar(0.),btScalar(0.));
-			break;
-		case 2:
-			penetrationVector.setValue(btScalar(0.),btScalar(1.),btScalar(0.));
-			break;
-		case 3:
-			penetrationVector.setValue(btScalar(0.),btScalar(-1.),btScalar(0.));
-			break;
-		case 4:
-			penetrationVector.setValue(btScalar(0.),btScalar(0.),btScalar(1.));
-			break;
-		case 5:
-			penetrationVector.setValue(btScalar(0.),btScalar(0.),btScalar(-1.));
-			break;
-		default:
-			btAssert(0);
-		}
-	}
-
-};
-
-
-#endif //BT_OBB_BOX_MINKOWSKI_H
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp
deleted file mode 100644
index ace4cfa..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp
+++ /dev/null
@@ -1,466 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-//#define DISABLE_BVH
-
-#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h"
-#include "BulletCollision/CollisionShapes/btOptimizedBvh.h"
-#include "LinearMath/btSerializer.h"
-
-///Bvh Concave triangle mesh is a static-triangle mesh shape with Bounding Volume Hierarchy optimization.
-///Uses an interface to access the triangles to allow for sharing graphics/physics triangles.
-btBvhTriangleMeshShape::btBvhTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression, bool buildBvh)
-:btTriangleMeshShape(meshInterface),
-m_bvh(0),
-m_triangleInfoMap(0),
-m_useQuantizedAabbCompression(useQuantizedAabbCompression),
-m_ownsBvh(false)
-{
-	m_shapeType = TRIANGLE_MESH_SHAPE_PROXYTYPE;
-	//construct bvh from meshInterface
-#ifndef DISABLE_BVH
-
-	if (buildBvh)
-	{
-		buildOptimizedBvh();
-	}
-
-#endif //DISABLE_BVH
-
-}
-
-btBvhTriangleMeshShape::btBvhTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression,const btVector3& bvhAabbMin,const btVector3& bvhAabbMax,bool buildBvh)
-:btTriangleMeshShape(meshInterface),
-m_bvh(0),
-m_triangleInfoMap(0),
-m_useQuantizedAabbCompression(useQuantizedAabbCompression),
-m_ownsBvh(false)
-{
-	m_shapeType = TRIANGLE_MESH_SHAPE_PROXYTYPE;
-	//construct bvh from meshInterface
-#ifndef DISABLE_BVH
-
-	if (buildBvh)
-	{
-		void* mem = btAlignedAlloc(sizeof(btOptimizedBvh),16);
-		m_bvh = new (mem) btOptimizedBvh();
-		
-		m_bvh->build(meshInterface,m_useQuantizedAabbCompression,bvhAabbMin,bvhAabbMax);
-		m_ownsBvh = true;
-	}
-
-#endif //DISABLE_BVH
-
-}
-
-void	btBvhTriangleMeshShape::partialRefitTree(const btVector3& aabbMin,const btVector3& aabbMax)
-{
-	m_bvh->refitPartial( m_meshInterface,aabbMin,aabbMax );
-	
-	m_localAabbMin.setMin(aabbMin);
-	m_localAabbMax.setMax(aabbMax);
-}
-
-
-void	btBvhTriangleMeshShape::refitTree(const btVector3& aabbMin,const btVector3& aabbMax)
-{
-	m_bvh->refit( m_meshInterface, aabbMin,aabbMax );
-	
-	recalcLocalAabb();
-}
-
-btBvhTriangleMeshShape::~btBvhTriangleMeshShape()
-{
-	if (m_ownsBvh)
-	{
-		m_bvh->~btOptimizedBvh();
-		btAlignedFree(m_bvh);
-	}
-}
-
-void	btBvhTriangleMeshShape::performRaycast (btTriangleCallback* callback, const btVector3& raySource, const btVector3& rayTarget)
-{
-	struct	MyNodeOverlapCallback : public btNodeOverlapCallback
-	{
-		btStridingMeshInterface*	m_meshInterface;
-		btTriangleCallback* m_callback;
-
-		MyNodeOverlapCallback(btTriangleCallback* callback,btStridingMeshInterface* meshInterface)
-			:m_meshInterface(meshInterface),
-			m_callback(callback)
-		{
-		}
-				
-		virtual void processNode(int nodeSubPart, int nodeTriangleIndex)
-		{
-			btVector3 m_triangle[3];
-			const unsigned char *vertexbase;
-			int numverts;
-			PHY_ScalarType type;
-			int stride;
-			const unsigned char *indexbase;
-			int indexstride;
-			int numfaces;
-			PHY_ScalarType indicestype;
-
-			m_meshInterface->getLockedReadOnlyVertexIndexBase(
-				&vertexbase,
-				numverts,
-				type,
-				stride,
-				&indexbase,
-				indexstride,
-				numfaces,
-				indicestype,
-				nodeSubPart);
-
-			unsigned int* gfxbase = (unsigned int*)(indexbase+nodeTriangleIndex*indexstride);
-			btAssert(indicestype==PHY_INTEGER||indicestype==PHY_SHORT);
-	
-			const btVector3& meshScaling = m_meshInterface->getScaling();
-			for (int j=2;j>=0;j--)
-			{
-				int graphicsindex = indicestype==PHY_SHORT?((unsigned short*)gfxbase)[j]:gfxbase[j];
-				
-				if (type == PHY_FLOAT)
-				{
-					float* graphicsbase = (float*)(vertexbase+graphicsindex*stride);
-					
-					m_triangle[j] = btVector3(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),graphicsbase[2]*meshScaling.getZ());		
-				}
-				else
-				{
-					double* graphicsbase = (double*)(vertexbase+graphicsindex*stride);
-					
-					m_triangle[j] = btVector3(btScalar(graphicsbase[0])*meshScaling.getX(),btScalar(graphicsbase[1])*meshScaling.getY(),btScalar(graphicsbase[2])*meshScaling.getZ());		
-				}
-			}
-
-			/* Perform ray vs. triangle collision here */
-			m_callback->processTriangle(m_triangle,nodeSubPart,nodeTriangleIndex);
-			m_meshInterface->unLockReadOnlyVertexBase(nodeSubPart);
-		}
-	};
-
-	MyNodeOverlapCallback	myNodeCallback(callback,m_meshInterface);
-
-	m_bvh->reportRayOverlappingNodex(&myNodeCallback,raySource,rayTarget);
-}
-
-void	btBvhTriangleMeshShape::performConvexcast (btTriangleCallback* callback, const btVector3& raySource, const btVector3& rayTarget, const btVector3& aabbMin, const btVector3& aabbMax)
-{
-	struct	MyNodeOverlapCallback : public btNodeOverlapCallback
-	{
-		btStridingMeshInterface*	m_meshInterface;
-		btTriangleCallback* m_callback;
-
-		MyNodeOverlapCallback(btTriangleCallback* callback,btStridingMeshInterface* meshInterface)
-			:m_meshInterface(meshInterface),
-			m_callback(callback)
-		{
-		}
-				
-		virtual void processNode(int nodeSubPart, int nodeTriangleIndex)
-		{
-			btVector3 m_triangle[3];
-			const unsigned char *vertexbase;
-			int numverts;
-			PHY_ScalarType type;
-			int stride;
-			const unsigned char *indexbase;
-			int indexstride;
-			int numfaces;
-			PHY_ScalarType indicestype;
-
-			m_meshInterface->getLockedReadOnlyVertexIndexBase(
-				&vertexbase,
-				numverts,
-				type,
-				stride,
-				&indexbase,
-				indexstride,
-				numfaces,
-				indicestype,
-				nodeSubPart);
-
-			unsigned int* gfxbase = (unsigned int*)(indexbase+nodeTriangleIndex*indexstride);
-			btAssert(indicestype==PHY_INTEGER||indicestype==PHY_SHORT);
-	
-			const btVector3& meshScaling = m_meshInterface->getScaling();
-			for (int j=2;j>=0;j--)
-			{
-				int graphicsindex = indicestype==PHY_SHORT?((unsigned short*)gfxbase)[j]:gfxbase[j];
-
-				if (type == PHY_FLOAT)
-				{
-					float* graphicsbase = (float*)(vertexbase+graphicsindex*stride);
-
-					m_triangle[j] = btVector3(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),graphicsbase[2]*meshScaling.getZ());		
-				}
-				else
-				{
-					double* graphicsbase = (double*)(vertexbase+graphicsindex*stride);
-					
-					m_triangle[j] = btVector3(btScalar(graphicsbase[0])*meshScaling.getX(),btScalar(graphicsbase[1])*meshScaling.getY(),btScalar(graphicsbase[2])*meshScaling.getZ());		
-				}
-			}
-
-			/* Perform ray vs. triangle collision here */
-			m_callback->processTriangle(m_triangle,nodeSubPart,nodeTriangleIndex);
-			m_meshInterface->unLockReadOnlyVertexBase(nodeSubPart);
-		}
-	};
-
-	MyNodeOverlapCallback	myNodeCallback(callback,m_meshInterface);
-
-	m_bvh->reportBoxCastOverlappingNodex (&myNodeCallback, raySource, rayTarget, aabbMin, aabbMax);
-}
-
-//perform bvh tree traversal and report overlapping triangles to 'callback'
-void	btBvhTriangleMeshShape::processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const
-{
-
-#ifdef DISABLE_BVH
-	//brute force traverse all triangles
-	btTriangleMeshShape::processAllTriangles(callback,aabbMin,aabbMax);
-#else
-
-	//first get all the nodes
-
-	
-	struct	MyNodeOverlapCallback : public btNodeOverlapCallback
-	{
-		btStridingMeshInterface*	m_meshInterface;
-		btTriangleCallback*		m_callback;
-		btVector3				m_triangle[3];
-
-
-		MyNodeOverlapCallback(btTriangleCallback* callback,btStridingMeshInterface* meshInterface)
-			:m_meshInterface(meshInterface),
-			m_callback(callback)
-		{
-		}
-				
-		virtual void processNode(int nodeSubPart, int nodeTriangleIndex)
-		{
-			const unsigned char *vertexbase;
-			int numverts;
-			PHY_ScalarType type;
-			int stride;
-			const unsigned char *indexbase;
-			int indexstride;
-			int numfaces;
-			PHY_ScalarType indicestype;
-			
-
-			m_meshInterface->getLockedReadOnlyVertexIndexBase(
-				&vertexbase,
-				numverts,
-				type,
-				stride,
-				&indexbase,
-				indexstride,
-				numfaces,
-				indicestype,
-				nodeSubPart);
-
-			unsigned int* gfxbase = (unsigned int*)(indexbase+nodeTriangleIndex*indexstride);
-			btAssert(indicestype==PHY_INTEGER||indicestype==PHY_SHORT||indicestype==PHY_UCHAR);
-	
-			const btVector3& meshScaling = m_meshInterface->getScaling();
-			for (int j=2;j>=0;j--)
-			{
-				
-				int graphicsindex = indicestype==PHY_SHORT?((unsigned short*)gfxbase)[j]:indicestype==PHY_INTEGER?gfxbase[j]:((unsigned char*)gfxbase)[j];
-
-
-#ifdef DEBUG_TRIANGLE_MESH
-				printf("%d ,",graphicsindex);
-#endif //DEBUG_TRIANGLE_MESH
-				if (type == PHY_FLOAT)
-				{
-					float* graphicsbase = (float*)(vertexbase+graphicsindex*stride);
-					
-					m_triangle[j] = btVector3(
-																		graphicsbase[0]*meshScaling.getX(),
-																		graphicsbase[1]*meshScaling.getY(),
-																		graphicsbase[2]*meshScaling.getZ());
-				}
-				else
-				{
-					double* graphicsbase = (double*)(vertexbase+graphicsindex*stride);
-
-					m_triangle[j] = btVector3(
-						btScalar(graphicsbase[0])*meshScaling.getX(),
-						btScalar(graphicsbase[1])*meshScaling.getY(),
-						btScalar(graphicsbase[2])*meshScaling.getZ());
-				}
-#ifdef DEBUG_TRIANGLE_MESH
-				printf("triangle vertices:%f,%f,%f\n",triangle[j].x(),triangle[j].y(),triangle[j].z());
-#endif //DEBUG_TRIANGLE_MESH
-			}
-
-			m_callback->processTriangle(m_triangle,nodeSubPart,nodeTriangleIndex);
-			m_meshInterface->unLockReadOnlyVertexBase(nodeSubPart);
-		}
-
-	};
-
-	MyNodeOverlapCallback	myNodeCallback(callback,m_meshInterface);
-
-	m_bvh->reportAabbOverlappingNodex(&myNodeCallback,aabbMin,aabbMax);
-
-
-#endif//DISABLE_BVH
-
-
-}
-
-void   btBvhTriangleMeshShape::setLocalScaling(const btVector3& scaling)
-{
-   if ((getLocalScaling() -scaling).length2() > SIMD_EPSILON)
-   {
-      btTriangleMeshShape::setLocalScaling(scaling);
-	  buildOptimizedBvh();
-   }
-}
-
-void   btBvhTriangleMeshShape::buildOptimizedBvh()
-{
-	if (m_ownsBvh)
-	{
-		m_bvh->~btOptimizedBvh();
-		btAlignedFree(m_bvh);
-	}
-	///m_localAabbMin/m_localAabbMax is already re-calculated in btTriangleMeshShape. We could just scale aabb, but this needs some more work
-	void* mem = btAlignedAlloc(sizeof(btOptimizedBvh),16);
-	m_bvh = new(mem) btOptimizedBvh();
-	//rebuild the bvh...
-	m_bvh->build(m_meshInterface,m_useQuantizedAabbCompression,m_localAabbMin,m_localAabbMax);
-	m_ownsBvh = true;
-}
-
-void   btBvhTriangleMeshShape::setOptimizedBvh(btOptimizedBvh* bvh, const btVector3& scaling)
-{
-   btAssert(!m_bvh);
-   btAssert(!m_ownsBvh);
-
-   m_bvh = bvh;
-   m_ownsBvh = false;
-   // update the scaling without rebuilding the bvh
-   if ((getLocalScaling() -scaling).length2() > SIMD_EPSILON)
-   {
-      btTriangleMeshShape::setLocalScaling(scaling);
-   }
-}
-
-
-
-///fills the dataBuffer and returns the struct name (and 0 on failure)
-const char*	btBvhTriangleMeshShape::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-	btTriangleMeshShapeData* trimeshData = (btTriangleMeshShapeData*) dataBuffer;
-
-	btCollisionShape::serialize(&trimeshData->m_collisionShapeData,serializer);
-
-	m_meshInterface->serialize(&trimeshData->m_meshInterface, serializer);
-
-	trimeshData->m_collisionMargin = float(m_collisionMargin);
-
-	
-
-	if (m_bvh && !(serializer->getSerializationFlags()&BT_SERIALIZE_NO_BVH))
-	{
-		void* chunk = serializer->findPointer(m_bvh);
-		if (chunk)
-		{
-#ifdef BT_USE_DOUBLE_PRECISION
-			trimeshData->m_quantizedDoubleBvh = (btQuantizedBvhData*)chunk;
-			trimeshData->m_quantizedFloatBvh = 0;
-#else
-			trimeshData->m_quantizedFloatBvh  = (btQuantizedBvhData*)chunk;
-			trimeshData->m_quantizedDoubleBvh= 0;
-#endif //BT_USE_DOUBLE_PRECISION
-		} else
-		{
-
-#ifdef BT_USE_DOUBLE_PRECISION
-			trimeshData->m_quantizedDoubleBvh = (btQuantizedBvhData*)serializer->getUniquePointer(m_bvh);
-			trimeshData->m_quantizedFloatBvh = 0;
-#else
-			trimeshData->m_quantizedFloatBvh  = (btQuantizedBvhData*)serializer->getUniquePointer(m_bvh);
-			trimeshData->m_quantizedDoubleBvh= 0;
-#endif //BT_USE_DOUBLE_PRECISION
-	
-			int sz = m_bvh->calculateSerializeBufferSizeNew();
-			btChunk* chunk = serializer->allocate(sz,1);
-			const char* structType = m_bvh->serialize(chunk->m_oldPtr, serializer);
-			serializer->finalizeChunk(chunk,structType,BT_QUANTIZED_BVH_CODE,m_bvh);
-		}
-	} else
-	{
-		trimeshData->m_quantizedFloatBvh = 0;
-		trimeshData->m_quantizedDoubleBvh = 0;
-	}
-
-	
-
-	if (m_triangleInfoMap && !(serializer->getSerializationFlags()&BT_SERIALIZE_NO_TRIANGLEINFOMAP))
-	{
-		void* chunk = serializer->findPointer(m_triangleInfoMap);
-		if (chunk)
-		{
-			trimeshData->m_triangleInfoMap = (btTriangleInfoMapData*)chunk;
-		} else
-		{
-			trimeshData->m_triangleInfoMap = (btTriangleInfoMapData*)serializer->getUniquePointer(m_triangleInfoMap);
-			int sz = m_triangleInfoMap->calculateSerializeBufferSize();
-			btChunk* chunk = serializer->allocate(sz,1);
-			const char* structType = m_triangleInfoMap->serialize(chunk->m_oldPtr, serializer);
-			serializer->finalizeChunk(chunk,structType,BT_TRIANLGE_INFO_MAP,m_triangleInfoMap);
-		}
-	} else
-	{
-		trimeshData->m_triangleInfoMap = 0;
-	}
-
-	return "btTriangleMeshShapeData";
-}
-
-void	btBvhTriangleMeshShape::serializeSingleBvh(btSerializer* serializer) const
-{
-	if (m_bvh)
-	{
-		int len = m_bvh->calculateSerializeBufferSizeNew(); //make sure not to use calculateSerializeBufferSize because it is used for in-place
-		btChunk* chunk = serializer->allocate(len,1);
-		const char* structType = m_bvh->serialize(chunk->m_oldPtr, serializer);
-		serializer->finalizeChunk(chunk,structType,BT_QUANTIZED_BVH_CODE,(void*)m_bvh);
-	}
-}
-
-void	btBvhTriangleMeshShape::serializeSingleTriangleInfoMap(btSerializer* serializer) const
-{
-	if (m_triangleInfoMap)
-	{
-		int len = m_triangleInfoMap->calculateSerializeBufferSize();
-		btChunk* chunk = serializer->allocate(len,1);
-		const char* structType = m_triangleInfoMap->serialize(chunk->m_oldPtr, serializer);
-		serializer->finalizeChunk(chunk,structType,BT_TRIANLGE_INFO_MAP,(void*)m_triangleInfoMap);
-	}
-}
-
-
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h
deleted file mode 100644
index d1c2162..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_BVH_TRIANGLE_MESH_SHAPE_H
-#define BT_BVH_TRIANGLE_MESH_SHAPE_H
-
-#include "btTriangleMeshShape.h"
-#include "btOptimizedBvh.h"
-#include "LinearMath/btAlignedAllocator.h"
-#include "btTriangleInfoMap.h"
-
-///The btBvhTriangleMeshShape is a static-triangle mesh shape with several optimizations, such as bounding volume hierarchy and cache friendly traversal for PlayStation 3 Cell SPU. It is recommended to enable useQuantizedAabbCompression for better memory usage.
-///It takes a triangle mesh as input, for example a btTriangleMesh or btTriangleIndexVertexArray. The btBvhTriangleMeshShape class allows for triangle mesh deformations by a refit or partialRefit method.
-///Instead of building the bounding volume hierarchy acceleration structure, it is also possible to serialize (save) and deserialize (load) the structure from disk.
-///See Demos\ConcaveDemo\ConcavePhysicsDemo.cpp for an example.
-ATTRIBUTE_ALIGNED16(class) btBvhTriangleMeshShape : public btTriangleMeshShape
-{
-
-	btOptimizedBvh*	m_bvh;
-	btTriangleInfoMap*	m_triangleInfoMap;
-
-	bool m_useQuantizedAabbCompression;
-	bool m_ownsBvh;
-	bool m_pad[11];////need padding due to alignment
-
-public:
-
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-
-	
-	btBvhTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression, bool buildBvh = true);
-
-	///optionally pass in a larger bvh aabb, used for quantization. This allows for deformations within this aabb
-	btBvhTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression,const btVector3& bvhAabbMin,const btVector3& bvhAabbMax, bool buildBvh = true);
-	
-	virtual ~btBvhTriangleMeshShape();
-
-	bool getOwnsBvh () const
-	{
-		return m_ownsBvh;
-	}
-
-
-	
-	void performRaycast (btTriangleCallback* callback, const btVector3& raySource, const btVector3& rayTarget);
-	void performConvexcast (btTriangleCallback* callback, const btVector3& boxSource, const btVector3& boxTarget, const btVector3& boxMin, const btVector3& boxMax);
-
-	virtual void	processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const;
-
-	void	refitTree(const btVector3& aabbMin,const btVector3& aabbMax);
-
-	///for a fast incremental refit of parts of the tree. Note: the entire AABB of the tree will become more conservative, it never shrinks
-	void	partialRefitTree(const btVector3& aabbMin,const btVector3& aabbMax);
-
-	//debugging
-	virtual const char*	getName()const {return "BVHTRIANGLEMESH";}
-
-
-	virtual void	setLocalScaling(const btVector3& scaling);
-	
-	btOptimizedBvh*	getOptimizedBvh()
-	{
-		return m_bvh;
-	}
-
-	void	setOptimizedBvh(btOptimizedBvh* bvh, const btVector3& localScaling=btVector3(1,1,1));
-
-	void    buildOptimizedBvh();
-
-	bool	usesQuantizedAabbCompression() const
-	{
-		return	m_useQuantizedAabbCompression;
-	}
-
-	void	setTriangleInfoMap(btTriangleInfoMap* triangleInfoMap)
-	{
-		m_triangleInfoMap = triangleInfoMap;
-	}
-
-	const btTriangleInfoMap*	getTriangleInfoMap() const
-	{
-		return m_triangleInfoMap;
-	}
-	
-	btTriangleInfoMap*	getTriangleInfoMap()
-	{
-		return m_triangleInfoMap;
-	}
-
-	virtual	int	calculateSerializeBufferSize() const;
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
-
-	virtual void	serializeSingleBvh(btSerializer* serializer) const;
-
-	virtual void	serializeSingleTriangleInfoMap(btSerializer* serializer) const;
-
-};
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btTriangleMeshShapeData
-{
-	btCollisionShapeData	m_collisionShapeData;
-
-	btStridingMeshInterfaceData m_meshInterface;
-
-	btQuantizedBvhFloatData		*m_quantizedFloatBvh;
-	btQuantizedBvhDoubleData	*m_quantizedDoubleBvh;
-
-	btTriangleInfoMapData	*m_triangleInfoMap;
-	
-	float	m_collisionMargin;
-
-	char m_pad3[4];
-	
-};
-
-
-SIMD_FORCE_INLINE	int	btBvhTriangleMeshShape::calculateSerializeBufferSize() const
-{
-	return sizeof(btTriangleMeshShapeData);
-}
-
-
-
-#endif //BT_BVH_TRIANGLE_MESH_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp
deleted file mode 100644
index 2faa11d..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "btCapsuleShape.h"
-
-#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
-#include "LinearMath/btQuaternion.h"
-
-btCapsuleShape::btCapsuleShape(btScalar radius, btScalar height) : btConvexInternalShape ()
-{
-	m_shapeType = CAPSULE_SHAPE_PROXYTYPE;
-	m_upAxis = 1;
-	m_implicitShapeDimensions.setValue(radius,0.5f*height,radius);
-}
-
- 
- btVector3	btCapsuleShape::localGetSupportingVertexWithoutMargin(const btVector3& vec0)const
-{
-
-	btVector3 supVec(0,0,0);
-
-	btScalar maxDot(btScalar(-BT_LARGE_FLOAT));
-
-	btVector3 vec = vec0;
-	btScalar lenSqr = vec.length2();
-	if (lenSqr < btScalar(0.0001))
-	{
-		vec.setValue(1,0,0);
-	} else
-	{
-		btScalar rlen = btScalar(1.) / btSqrt(lenSqr );
-		vec *= rlen;
-	}
-
-	btVector3 vtx;
-	btScalar newDot;
-	
-	btScalar radius = getRadius();
-
-
-	{
-		btVector3 pos(0,0,0);
-		pos[getUpAxis()] = getHalfHeight();
-
-		vtx = pos +vec*m_localScaling*(radius) - vec * getMargin();
-		newDot = vec.dot(vtx);
-		if (newDot > maxDot)
-		{
-			maxDot = newDot;
-			supVec = vtx;
-		}
-	}
-	{
-		btVector3 pos(0,0,0);
-		pos[getUpAxis()] = -getHalfHeight();
-
-		vtx = pos +vec*m_localScaling*(radius) - vec * getMargin();
-		newDot = vec.dot(vtx);
-		if (newDot > maxDot)
-		{
-			maxDot = newDot;
-			supVec = vtx;
-		}
-	}
-
-	return supVec;
-
-}
-
- void	btCapsuleShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
-{
-
-	
-	btScalar radius = getRadius();
-
-	for (int j=0;j<numVectors;j++)
-	{
-		btScalar maxDot(btScalar(-BT_LARGE_FLOAT));
-		const btVector3& vec = vectors[j];
-
-		btVector3 vtx;
-		btScalar newDot;
-		{
-			btVector3 pos(0,0,0);
-			pos[getUpAxis()] = getHalfHeight();
-			vtx = pos +vec*m_localScaling*(radius) - vec * getMargin();
-			newDot = vec.dot(vtx);
-			if (newDot > maxDot)
-			{
-				maxDot = newDot;
-				supportVerticesOut[j] = vtx;
-			}
-		}
-		{
-			btVector3 pos(0,0,0);
-			pos[getUpAxis()] = -getHalfHeight();
-			vtx = pos +vec*m_localScaling*(radius) - vec * getMargin();
-			newDot = vec.dot(vtx);
-			if (newDot > maxDot)
-			{
-				maxDot = newDot;
-				supportVerticesOut[j] = vtx;
-			}
-		}
-		
-	}
-}
-
-
-void	btCapsuleShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
-{
-	//as an approximation, take the inertia of the box that bounds the spheres
-
-	btTransform ident;
-	ident.setIdentity();
-
-	
-	btScalar radius = getRadius();
-
-	btVector3 halfExtents(radius,radius,radius);
-	halfExtents[getUpAxis()]+=getHalfHeight();
-
-	btScalar margin = CONVEX_DISTANCE_MARGIN;
-
-	btScalar lx=btScalar(2.)*(halfExtents[0]+margin);
-	btScalar ly=btScalar(2.)*(halfExtents[1]+margin);
-	btScalar lz=btScalar(2.)*(halfExtents[2]+margin);
-	const btScalar x2 = lx*lx;
-	const btScalar y2 = ly*ly;
-	const btScalar z2 = lz*lz;
-	const btScalar scaledmass = mass * btScalar(.08333333);
-
-	inertia[0] = scaledmass * (y2+z2);
-	inertia[1] = scaledmass * (x2+z2);
-	inertia[2] = scaledmass * (x2+y2);
-
-}
-
-btCapsuleShapeX::btCapsuleShapeX(btScalar radius,btScalar height)
-{
-	m_upAxis = 0;
-	m_implicitShapeDimensions.setValue(0.5f*height, radius,radius);
-}
-
-
-
-
-
-
-btCapsuleShapeZ::btCapsuleShapeZ(btScalar radius,btScalar height)
-{
-	m_upAxis = 2;
-	m_implicitShapeDimensions.setValue(radius,radius,0.5f*height);
-}
-
-
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.h
deleted file mode 100644
index ab763ab..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_CAPSULE_SHAPE_H
-#define BT_CAPSULE_SHAPE_H
-
-#include "btConvexInternalShape.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
-
-
-///The btCapsuleShape represents a capsule around the Y axis, there is also the btCapsuleShapeX aligned around the X axis and btCapsuleShapeZ around the Z axis.
-///The total height is height+2*radius, so the height is just the height between the center of each 'sphere' of the capsule caps.
-///The btCapsuleShape is a convex hull of two spheres. The btMultiSphereShape is a more general collision shape that takes the convex hull of multiple sphere, so it can also represent a capsule when just using two spheres.
-class btCapsuleShape : public btConvexInternalShape
-{
-protected:
-	int	m_upAxis;
-
-protected:
-	///only used for btCapsuleShapeZ and btCapsuleShapeX subclasses.
-	btCapsuleShape() : btConvexInternalShape() {m_shapeType = CAPSULE_SHAPE_PROXYTYPE;};
-
-public:
-	btCapsuleShape(btScalar radius,btScalar height);
-
-	///CollisionShape Interface
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
-
-	/// btConvexShape Interface
-	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
-
-	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
-	
-	virtual void setMargin(btScalar collisionMargin)
-	{
-		//correct the m_implicitShapeDimensions for the margin
-		btVector3 oldMargin(getMargin(),getMargin(),getMargin());
-		btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions+oldMargin;
-		
-		btConvexInternalShape::setMargin(collisionMargin);
-		btVector3 newMargin(getMargin(),getMargin(),getMargin());
-		m_implicitShapeDimensions = implicitShapeDimensionsWithMargin - newMargin;
-
-	}
-
-	virtual void getAabb (const btTransform& t, btVector3& aabbMin, btVector3& aabbMax) const
-	{
-			btVector3 halfExtents(getRadius(),getRadius(),getRadius());
-			halfExtents[m_upAxis] = getRadius() + getHalfHeight();
-			halfExtents += btVector3(getMargin(),getMargin(),getMargin());
-			btMatrix3x3 abs_b = t.getBasis().absolute();  
-			btVector3 center = t.getOrigin();
-			btVector3 extent = btVector3(abs_b[0].dot(halfExtents),abs_b[1].dot(halfExtents),abs_b[2].dot(halfExtents));		  
-			
-			aabbMin = center - extent;
-			aabbMax = center + extent;
-	}
-
-	virtual const char*	getName()const 
-	{
-		return "CapsuleShape";
-	}
-
-	int	getUpAxis() const
-	{
-		return m_upAxis;
-	}
-
-	btScalar	getRadius() const
-	{
-		int radiusAxis = (m_upAxis+2)%3;
-		return m_implicitShapeDimensions[radiusAxis];
-	}
-
-	btScalar	getHalfHeight() const
-	{
-		return m_implicitShapeDimensions[m_upAxis];
-	}
-
-	virtual void	setLocalScaling(const btVector3& scaling)
-	{
-		btVector3 oldMargin(getMargin(),getMargin(),getMargin());
-		btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions+oldMargin;
-		btVector3 unScaledImplicitShapeDimensionsWithMargin = implicitShapeDimensionsWithMargin / m_localScaling;
-
-		btConvexInternalShape::setLocalScaling(scaling);
-
-		m_implicitShapeDimensions = (unScaledImplicitShapeDimensionsWithMargin * m_localScaling) - oldMargin;
-
-	}
-
-	virtual	int	calculateSerializeBufferSize() const;
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
-
-
-};
-
-///btCapsuleShapeX represents a capsule around the Z axis
-///the total height is height+2*radius, so the height is just the height between the center of each 'sphere' of the capsule caps.
-class btCapsuleShapeX : public btCapsuleShape
-{
-public:
-
-	btCapsuleShapeX(btScalar radius,btScalar height);
-		
-	//debugging
-	virtual const char*	getName()const
-	{
-		return "CapsuleX";
-	}
-
-	
-
-};
-
-///btCapsuleShapeZ represents a capsule around the Z axis
-///the total height is height+2*radius, so the height is just the height between the center of each 'sphere' of the capsule caps.
-class btCapsuleShapeZ : public btCapsuleShape
-{
-public:
-	btCapsuleShapeZ(btScalar radius,btScalar height);
-
-		//debugging
-	virtual const char*	getName()const
-	{
-		return "CapsuleZ";
-	}
-
-	
-};
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btCapsuleShapeData
-{
-	btConvexInternalShapeData	m_convexInternalShapeData;
-
-	int	m_upAxis;
-
-	char	m_padding[4];
-};
-
-SIMD_FORCE_INLINE	int	btCapsuleShape::calculateSerializeBufferSize() const
-{
-	return sizeof(btCapsuleShapeData);
-}
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-SIMD_FORCE_INLINE	const char*	btCapsuleShape::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-	btCapsuleShapeData* shapeData = (btCapsuleShapeData*) dataBuffer;
-	
-	btConvexInternalShape::serialize(&shapeData->m_convexInternalShapeData,serializer);
-
-	shapeData->m_upAxis = m_upAxis;
-	
-	return "btCapsuleShapeData";
-}
-
-#endif //BT_CAPSULE_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCollisionMargin.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCollisionMargin.h
deleted file mode 100644
index e9736ee..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCollisionMargin.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_COLLISION_MARGIN_H
-#define BT_COLLISION_MARGIN_H
-
-//used by Gjk and some other algorithms
-
-#define CONVEX_DISTANCE_MARGIN btScalar(0.04)// btScalar(0.1)//;//btScalar(0.01)
-
-
-
-#endif //BT_COLLISION_MARGIN_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCollisionShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCollisionShape.cpp
deleted file mode 100644
index 39ee21c..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCollisionShape.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-#include "BulletCollision/CollisionShapes/btCollisionShape.h"
-#include "LinearMath/btSerializer.h"
-
-/*
-  Make sure this dummy function never changes so that it
-  can be used by probes that are checking whether the
-  library is actually installed.
-*/
-extern "C" 
-{
-void btBulletCollisionProbe ();
-
-void btBulletCollisionProbe () {}
-}
-
-
-
-void	btCollisionShape::getBoundingSphere(btVector3& center,btScalar& radius) const
-{
-	btTransform tr;
-	tr.setIdentity();
-	btVector3 aabbMin,aabbMax;
-
-	getAabb(tr,aabbMin,aabbMax);
-
-	radius = (aabbMax-aabbMin).length()*btScalar(0.5);
-	center = (aabbMin+aabbMax)*btScalar(0.5);
-}
-
-
-btScalar	btCollisionShape::getContactBreakingThreshold(btScalar defaultContactThreshold) const
-{
-	return getAngularMotionDisc() * defaultContactThreshold;
-}
-
-btScalar	btCollisionShape::getAngularMotionDisc() const
-{
-	///@todo cache this value, to improve performance
-	btVector3	center;
-	btScalar disc;
-	getBoundingSphere(center,disc);
-	disc += (center).length();
-	return disc;
-}
-
-void btCollisionShape::calculateTemporalAabb(const btTransform& curTrans,const btVector3& linvel,const btVector3& angvel,btScalar timeStep, btVector3& temporalAabbMin,btVector3& temporalAabbMax) const
-{
-	//start with static aabb
-	getAabb(curTrans,temporalAabbMin,temporalAabbMax);
-
-	btScalar temporalAabbMaxx = temporalAabbMax.getX();
-	btScalar temporalAabbMaxy = temporalAabbMax.getY();
-	btScalar temporalAabbMaxz = temporalAabbMax.getZ();
-	btScalar temporalAabbMinx = temporalAabbMin.getX();
-	btScalar temporalAabbMiny = temporalAabbMin.getY();
-	btScalar temporalAabbMinz = temporalAabbMin.getZ();
-
-	// add linear motion
-	btVector3 linMotion = linvel*timeStep;
-	///@todo: simd would have a vector max/min operation, instead of per-element access
-	if (linMotion.x() > btScalar(0.))
-		temporalAabbMaxx += linMotion.x(); 
-	else
-		temporalAabbMinx += linMotion.x();
-	if (linMotion.y() > btScalar(0.))
-		temporalAabbMaxy += linMotion.y(); 
-	else
-		temporalAabbMiny += linMotion.y();
-	if (linMotion.z() > btScalar(0.))
-		temporalAabbMaxz += linMotion.z(); 
-	else
-		temporalAabbMinz += linMotion.z();
-
-	//add conservative angular motion
-	btScalar angularMotion = angvel.length() * getAngularMotionDisc() * timeStep;
-	btVector3 angularMotion3d(angularMotion,angularMotion,angularMotion);
-	temporalAabbMin = btVector3(temporalAabbMinx,temporalAabbMiny,temporalAabbMinz);
-	temporalAabbMax = btVector3(temporalAabbMaxx,temporalAabbMaxy,temporalAabbMaxz);
-
-	temporalAabbMin -= angularMotion3d;
-	temporalAabbMax += angularMotion3d;
-}
-
-///fills the dataBuffer and returns the struct name (and 0 on failure)
-const char*	btCollisionShape::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-	btCollisionShapeData* shapeData = (btCollisionShapeData*) dataBuffer;
-	char* name = (char*) serializer->findNameForPointer(this);
-	shapeData->m_name = (char*)serializer->getUniquePointer(name);
-	if (shapeData->m_name)
-	{
-		serializer->serializeName(name);
-	}
-	shapeData->m_shapeType = m_shapeType;
-	//shapeData->m_padding//??
-	return "btCollisionShapeData";
-}
-
-void	btCollisionShape::serializeSingleShape(btSerializer* serializer) const
-{
-	int len = calculateSerializeBufferSize();
-	btChunk* chunk = serializer->allocate(len,1);
-	const char* structType = serialize(chunk->m_oldPtr, serializer);
-	serializer->finalizeChunk(chunk,structType,BT_SHAPE_CODE,(void*)this);
-}
\ No newline at end of file
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCollisionShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCollisionShape.h
deleted file mode 100644
index 865c106..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCollisionShape.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_COLLISION_SHAPE_H
-#define BT_COLLISION_SHAPE_H
-
-#include "LinearMath/btTransform.h"
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btMatrix3x3.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" //for the shape types
-class btSerializer;
-
-
-///The btCollisionShape class provides an interface for collision shapes that can be shared among btCollisionObjects.
-class btCollisionShape
-{
-protected:
-	int m_shapeType;
-	void* m_userPointer;
-
-public:
-
-	btCollisionShape() : m_shapeType (INVALID_SHAPE_PROXYTYPE), m_userPointer(0)
-	{
-	}
-
-	virtual ~btCollisionShape()
-	{
-	}
-
-	///getAabb returns the axis aligned bounding box in the coordinate frame of the given transform t.
-	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const =0;
-
-	virtual void	getBoundingSphere(btVector3& center,btScalar& radius) const;
-
-	///getAngularMotionDisc returns the maximus radius needed for Conservative Advancement to handle time-of-impact with rotations.
-	virtual btScalar	getAngularMotionDisc() const;
-
-	virtual btScalar	getContactBreakingThreshold(btScalar defaultContactThresholdFactor) const;
-
-
-	///calculateTemporalAabb calculates the enclosing aabb for the moving object over interval [0..timeStep)
-	///result is conservative
-	void calculateTemporalAabb(const btTransform& curTrans,const btVector3& linvel,const btVector3& angvel,btScalar timeStep, btVector3& temporalAabbMin,btVector3& temporalAabbMax) const;
-
-
-
-	SIMD_FORCE_INLINE bool	isPolyhedral() const
-	{
-		return btBroadphaseProxy::isPolyhedral(getShapeType());
-	}
-
-	SIMD_FORCE_INLINE bool	isConvex2d() const
-	{
-		return btBroadphaseProxy::isConvex2d(getShapeType());
-	}
-
-	SIMD_FORCE_INLINE bool	isConvex() const
-	{
-		return btBroadphaseProxy::isConvex(getShapeType());
-	}
-	SIMD_FORCE_INLINE bool	isNonMoving() const
-	{
-		return btBroadphaseProxy::isNonMoving(getShapeType());
-	}
-	SIMD_FORCE_INLINE bool	isConcave() const
-	{
-		return btBroadphaseProxy::isConcave(getShapeType());
-	}
-	SIMD_FORCE_INLINE bool	isCompound() const
-	{
-		return btBroadphaseProxy::isCompound(getShapeType());
-	}
-
-	SIMD_FORCE_INLINE bool	isSoftBody() const
-	{
-		return btBroadphaseProxy::isSoftBody(getShapeType());
-	}
-
-	///isInfinite is used to catch simulation error (aabb check)
-	SIMD_FORCE_INLINE bool isInfinite() const
-	{
-		return btBroadphaseProxy::isInfinite(getShapeType());
-	}
-
-#ifndef __SPU__
-	virtual void	setLocalScaling(const btVector3& scaling) =0;
-	virtual const btVector3& getLocalScaling() const =0;
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const = 0;
-
-
-//debugging support
-	virtual const char*	getName()const =0 ;
-#endif //__SPU__
-
-	
-	int		getShapeType() const { return m_shapeType; }
-	virtual void	setMargin(btScalar margin) = 0;
-	virtual btScalar	getMargin() const = 0;
-
-	
-	///optional user data pointer
-	void	setUserPointer(void*  userPtr)
-	{
-		m_userPointer = userPtr;
-	}
-
-	void*	getUserPointer() const
-	{
-		return m_userPointer;
-	}
-
-	virtual	int	calculateSerializeBufferSize() const;
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
-
-	virtual void	serializeSingleShape(btSerializer* serializer) const;
-
-};	
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btCollisionShapeData
-{
-	char	*m_name;
-	int		m_shapeType;
-	char	m_padding[4];
-};
-
-SIMD_FORCE_INLINE	int	btCollisionShape::calculateSerializeBufferSize() const
-{
-	return sizeof(btCollisionShapeData);
-}
-
-
-
-#endif //BT_COLLISION_SHAPE_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCompoundShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCompoundShape.cpp
deleted file mode 100644
index 4eb860c..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCompoundShape.cpp
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btCompoundShape.h"
-#include "btCollisionShape.h"
-#include "BulletCollision/BroadphaseCollision/btDbvt.h"
-#include "LinearMath/btSerializer.h"
-
-btCompoundShape::btCompoundShape(bool enableDynamicAabbTree)
-: m_localAabbMin(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT)),
-m_localAabbMax(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT)),
-m_dynamicAabbTree(0),
-m_updateRevision(1),
-m_collisionMargin(btScalar(0.)),
-m_localScaling(btScalar(1.),btScalar(1.),btScalar(1.))
-{
-	m_shapeType = COMPOUND_SHAPE_PROXYTYPE;
-
-	if (enableDynamicAabbTree)
-	{
-		void* mem = btAlignedAlloc(sizeof(btDbvt),16);
-		m_dynamicAabbTree = new(mem) btDbvt();
-		btAssert(mem==m_dynamicAabbTree);
-	}
-}
-
-
-btCompoundShape::~btCompoundShape()
-{
-	if (m_dynamicAabbTree)
-	{
-		m_dynamicAabbTree->~btDbvt();
-		btAlignedFree(m_dynamicAabbTree);
-	}
-}
-
-void	btCompoundShape::addChildShape(const btTransform& localTransform,btCollisionShape* shape)
-{
-	m_updateRevision++;
-	//m_childTransforms.push_back(localTransform);
-	//m_childShapes.push_back(shape);
-	btCompoundShapeChild child;
-	child.m_node = 0;
-	child.m_transform = localTransform;
-	child.m_childShape = shape;
-	child.m_childShapeType = shape->getShapeType();
-	child.m_childMargin = shape->getMargin();
-
-	
-	//extend the local aabbMin/aabbMax
-	btVector3 localAabbMin,localAabbMax;
-	shape->getAabb(localTransform,localAabbMin,localAabbMax);
-	for (int i=0;i<3;i++)
-	{
-		if (m_localAabbMin[i] > localAabbMin[i])
-		{
-			m_localAabbMin[i] = localAabbMin[i];
-		}
-		if (m_localAabbMax[i] < localAabbMax[i])
-		{
-			m_localAabbMax[i] = localAabbMax[i];
-		}
-
-	}
-	if (m_dynamicAabbTree)
-	{
-		const btDbvtVolume	bounds=btDbvtVolume::FromMM(localAabbMin,localAabbMax);
-		int index = m_children.size();
-		child.m_node = m_dynamicAabbTree->insert(bounds,(void*)index);
-	}
-
-	m_children.push_back(child);
-
-}
-
-void	btCompoundShape::updateChildTransform(int childIndex, const btTransform& newChildTransform,bool shouldRecalculateLocalAabb)
-{
-	m_children[childIndex].m_transform = newChildTransform;
-
-	if (m_dynamicAabbTree)
-	{
-		///update the dynamic aabb tree
-		btVector3 localAabbMin,localAabbMax;
-		m_children[childIndex].m_childShape->getAabb(newChildTransform,localAabbMin,localAabbMax);
-		ATTRIBUTE_ALIGNED16(btDbvtVolume)	bounds=btDbvtVolume::FromMM(localAabbMin,localAabbMax);
-		//int index = m_children.size()-1;
-		m_dynamicAabbTree->update(m_children[childIndex].m_node,bounds);
-	}
-
-	if (shouldRecalculateLocalAabb)
-	{
-		recalculateLocalAabb();
-	}
-}
-
-void btCompoundShape::removeChildShapeByIndex(int childShapeIndex)
-{
-	m_updateRevision++;
-	btAssert(childShapeIndex >=0 && childShapeIndex < m_children.size());
-	if (m_dynamicAabbTree)
-	{
-		m_dynamicAabbTree->remove(m_children[childShapeIndex].m_node);
-	}
-	m_children.swap(childShapeIndex,m_children.size()-1);
-    if (m_dynamicAabbTree) 
-		m_children[childShapeIndex].m_node->dataAsInt = childShapeIndex;
-	m_children.pop_back();
-
-}
-
-
-
-void btCompoundShape::removeChildShape(btCollisionShape* shape)
-{
-	m_updateRevision++;
-	// Find the children containing the shape specified, and remove those children.
-	//note: there might be multiple children using the same shape!
-	for(int i = m_children.size()-1; i >= 0 ; i--)
-	{
-		if(m_children[i].m_childShape == shape)
-		{
-			removeChildShapeByIndex(i);
-		}
-	}
-
-
-
-	recalculateLocalAabb();
-}
-
-void btCompoundShape::recalculateLocalAabb()
-{
-	// Recalculate the local aabb
-	// Brute force, it iterates over all the shapes left.
-
-	m_localAabbMin = btVector3(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
-	m_localAabbMax = btVector3(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT));
-
-	//extend the local aabbMin/aabbMax
-	for (int j = 0; j < m_children.size(); j++)
-	{
-		btVector3 localAabbMin,localAabbMax;
-		m_children[j].m_childShape->getAabb(m_children[j].m_transform, localAabbMin, localAabbMax);
-		for (int i=0;i<3;i++)
-		{
-			if (m_localAabbMin[i] > localAabbMin[i])
-				m_localAabbMin[i] = localAabbMin[i];
-			if (m_localAabbMax[i] < localAabbMax[i])
-				m_localAabbMax[i] = localAabbMax[i];
-		}
-	}
-}
-
-///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
-void btCompoundShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const
-{
-	btVector3 localHalfExtents = btScalar(0.5)*(m_localAabbMax-m_localAabbMin);
-	btVector3 localCenter = btScalar(0.5)*(m_localAabbMax+m_localAabbMin);
-	
-	//avoid an illegal AABB when there are no children
-	if (!m_children.size())
-	{
-		localHalfExtents.setValue(0,0,0);
-		localCenter.setValue(0,0,0);
-	}
-	localHalfExtents += btVector3(getMargin(),getMargin(),getMargin());
-		
-
-	btMatrix3x3 abs_b = trans.getBasis().absolute();  
-
-	btVector3 center = trans(localCenter);
-
-	btVector3 extent = btVector3(abs_b[0].dot(localHalfExtents),
-		abs_b[1].dot(localHalfExtents),
-		abs_b[2].dot(localHalfExtents));
-	aabbMin = center-extent;
-	aabbMax = center+extent;
-	
-}
-
-void	btCompoundShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
-{
-	//approximation: take the inertia from the aabb for now
-	btTransform ident;
-	ident.setIdentity();
-	btVector3 aabbMin,aabbMax;
-	getAabb(ident,aabbMin,aabbMax);
-
-	btVector3 halfExtents = (aabbMax-aabbMin)*btScalar(0.5);
-
-	btScalar lx=btScalar(2.)*(halfExtents.x());
-	btScalar ly=btScalar(2.)*(halfExtents.y());
-	btScalar lz=btScalar(2.)*(halfExtents.z());
-
-	inertia[0] = mass/(btScalar(12.0)) * (ly*ly + lz*lz);
-	inertia[1] = mass/(btScalar(12.0)) * (lx*lx + lz*lz);
-	inertia[2] = mass/(btScalar(12.0)) * (lx*lx + ly*ly);
-
-}
-
-
-
-
-void btCompoundShape::calculatePrincipalAxisTransform(btScalar* masses, btTransform& principal, btVector3& inertia) const
-{
-	int n = m_children.size();
-
-	btScalar totalMass = 0;
-	btVector3 center(0, 0, 0);
-	int k;
-
-	for (k = 0; k < n; k++)
-	{
-		btAssert(masses[k]>0);
-		center += m_children[k].m_transform.getOrigin() * masses[k];
-		totalMass += masses[k];
-	}
-
-	btAssert(totalMass>0);
-
-	center /= totalMass;
-	principal.setOrigin(center);
-
-	btMatrix3x3 tensor(0, 0, 0, 0, 0, 0, 0, 0, 0);
-	for ( k = 0; k < n; k++)
-	{
-		btVector3 i;
-		m_children[k].m_childShape->calculateLocalInertia(masses[k], i);
-
-		const btTransform& t = m_children[k].m_transform;
-		btVector3 o = t.getOrigin() - center;
-
-		//compute inertia tensor in coordinate system of compound shape
-		btMatrix3x3 j = t.getBasis().transpose();
-		j[0] *= i[0];
-		j[1] *= i[1];
-		j[2] *= i[2];
-		j = t.getBasis() * j;
-
-		//add inertia tensor
-		tensor[0] += j[0];
-		tensor[1] += j[1];
-		tensor[2] += j[2];
-
-		//compute inertia tensor of pointmass at o
-		btScalar o2 = o.length2();
-		j[0].setValue(o2, 0, 0);
-		j[1].setValue(0, o2, 0);
-		j[2].setValue(0, 0, o2);
-		j[0] += o * -o.x(); 
-		j[1] += o * -o.y(); 
-		j[2] += o * -o.z();
-
-		//add inertia tensor of pointmass
-		tensor[0] += masses[k] * j[0];
-		tensor[1] += masses[k] * j[1];
-		tensor[2] += masses[k] * j[2];
-	}
-
-	tensor.diagonalize(principal.getBasis(), btScalar(0.00001), 20);
-	inertia.setValue(tensor[0][0], tensor[1][1], tensor[2][2]);
-}
-
-
-
-void btCompoundShape::setLocalScaling(const btVector3& scaling)
-{
-
-	for(int i = 0; i < m_children.size(); i++)
-	{
-		btTransform childTrans = getChildTransform(i);
-		btVector3 childScale = m_children[i].m_childShape->getLocalScaling();
-//		childScale = childScale * (childTrans.getBasis() * scaling);
-		childScale = childScale * scaling / m_localScaling;
-		m_children[i].m_childShape->setLocalScaling(childScale);
-		childTrans.setOrigin((childTrans.getOrigin())*scaling);
-		updateChildTransform(i, childTrans,false);
-	}
-	
-	m_localScaling = scaling;
-	recalculateLocalAabb();
-
-}
-
-
-void btCompoundShape::createAabbTreeFromChildren()
-{
-    if ( !m_dynamicAabbTree )
-    {
-        void* mem = btAlignedAlloc(sizeof(btDbvt),16);
-        m_dynamicAabbTree = new(mem) btDbvt();
-        btAssert(mem==m_dynamicAabbTree);
-
-        for ( int index = 0; index < m_children.size(); index++ )
-        {
-            btCompoundShapeChild &child = m_children[index];
-
-            //extend the local aabbMin/aabbMax
-            btVector3 localAabbMin,localAabbMax;
-            child.m_childShape->getAabb(child.m_transform,localAabbMin,localAabbMax);
-
-            const btDbvtVolume  bounds=btDbvtVolume::FromMM(localAabbMin,localAabbMax);
-            child.m_node = m_dynamicAabbTree->insert(bounds,(void*)index);
-        }
-    }
-}
-
-
-///fills the dataBuffer and returns the struct name (and 0 on failure)
-const char*	btCompoundShape::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-
-	btCompoundShapeData* shapeData = (btCompoundShapeData*) dataBuffer;
-	btCollisionShape::serialize(&shapeData->m_collisionShapeData, serializer);
-
-	shapeData->m_collisionMargin = float(m_collisionMargin);
-	shapeData->m_numChildShapes = m_children.size();
-	shapeData->m_childShapePtr = 0;
-	if (shapeData->m_numChildShapes)
-	{
-		btChunk* chunk = serializer->allocate(sizeof(btCompoundShapeChildData),shapeData->m_numChildShapes);
-		btCompoundShapeChildData* memPtr = (btCompoundShapeChildData*)chunk->m_oldPtr;
-		shapeData->m_childShapePtr = (btCompoundShapeChildData*)serializer->getUniquePointer(memPtr);
-
-		for (int i=0;i<shapeData->m_numChildShapes;i++,memPtr++)
-		{
-			memPtr->m_childMargin = float(m_children[i].m_childMargin);
-			memPtr->m_childShape = (btCollisionShapeData*)serializer->getUniquePointer(m_children[i].m_childShape);
-			//don't serialize shapes that already have been serialized
-			if (!serializer->findPointer(m_children[i].m_childShape))
-			{
-				btChunk* chunk = serializer->allocate(m_children[i].m_childShape->calculateSerializeBufferSize(),1);
-				const char* structType = m_children[i].m_childShape->serialize(chunk->m_oldPtr,serializer);
-				serializer->finalizeChunk(chunk,structType,BT_SHAPE_CODE,m_children[i].m_childShape);
-			} 
-
-			memPtr->m_childShapeType = m_children[i].m_childShapeType;
-			m_children[i].m_transform.serializeFloat(memPtr->m_transform);
-		}
-		serializer->finalizeChunk(chunk,"btCompoundShapeChildData",BT_ARRAY_CODE,chunk->m_oldPtr);
-	}
-	return "btCompoundShapeData";
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCompoundShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCompoundShape.h
deleted file mode 100644
index 141034a..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCompoundShape.h
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_COMPOUND_SHAPE_H
-#define BT_COMPOUND_SHAPE_H
-
-#include "btCollisionShape.h"
-
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btTransform.h"
-#include "LinearMath/btMatrix3x3.h"
-#include "btCollisionMargin.h"
-#include "LinearMath/btAlignedObjectArray.h"
-
-//class btOptimizedBvh;
-struct btDbvt;
-
-ATTRIBUTE_ALIGNED16(struct) btCompoundShapeChild
-{
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-
-	btTransform			m_transform;
-	btCollisionShape*	m_childShape;
-	int					m_childShapeType;
-	btScalar			m_childMargin;
-	struct btDbvtNode*	m_node;
-};
-
-SIMD_FORCE_INLINE bool operator==(const btCompoundShapeChild& c1, const btCompoundShapeChild& c2)
-{
-	return  ( c1.m_transform      == c2.m_transform &&
-		c1.m_childShape     == c2.m_childShape &&
-		c1.m_childShapeType == c2.m_childShapeType &&
-		c1.m_childMargin    == c2.m_childMargin );
-}
-
-/// The btCompoundShape allows to store multiple other btCollisionShapes
-/// This allows for moving concave collision objects. This is more general then the static concave btBvhTriangleMeshShape.
-/// It has an (optional) dynamic aabb tree to accelerate early rejection tests. 
-/// @todo: This aabb tree can also be use to speed up ray tests on btCompoundShape, see http://code.google.com/p/bullet/issues/detail?id=25
-/// Currently, removal of child shapes is only supported when disabling the aabb tree (pass 'false' in the constructor of btCompoundShape)
-ATTRIBUTE_ALIGNED16(class) btCompoundShape	: public btCollisionShape
-{
-	btAlignedObjectArray<btCompoundShapeChild> m_children;
-	btVector3						m_localAabbMin;
-	btVector3						m_localAabbMax;
-
-	btDbvt*							m_dynamicAabbTree;
-
-	///increment m_updateRevision when adding/removing/replacing child shapes, so that some caches can be updated
-	int								m_updateRevision;
-
-	btScalar	m_collisionMargin;
-
-protected:
-	btVector3	m_localScaling;
-
-public:
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-
-	btCompoundShape(bool enableDynamicAabbTree = true);
-
-	virtual ~btCompoundShape();
-
-	void	addChildShape(const btTransform& localTransform,btCollisionShape* shape);
-
-	/// Remove all children shapes that contain the specified shape
-	virtual void removeChildShape(btCollisionShape* shape);
-
-	void removeChildShapeByIndex(int childShapeindex);
-
-
-	int		getNumChildShapes() const
-	{
-		return int (m_children.size());
-	}
-
-	btCollisionShape* getChildShape(int index)
-	{
-		return m_children[index].m_childShape;
-	}
-	const btCollisionShape* getChildShape(int index) const
-	{
-		return m_children[index].m_childShape;
-	}
-
-	btTransform&	getChildTransform(int index)
-	{
-		return m_children[index].m_transform;
-	}
-	const btTransform&	getChildTransform(int index) const
-	{
-		return m_children[index].m_transform;
-	}
-
-	///set a new transform for a child, and update internal data structures (local aabb and dynamic tree)
-	void	updateChildTransform(int childIndex, const btTransform& newChildTransform, bool shouldRecalculateLocalAabb = true);
-
-
-	btCompoundShapeChild* getChildList()
-	{
-		return &m_children[0];
-	}
-
-	///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
-	virtual	void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
-
-	/** Re-calculate the local Aabb. Is called at the end of removeChildShapes. 
-	Use this yourself if you modify the children or their transforms. */
-	virtual void recalculateLocalAabb(); 
-
-	virtual void	setLocalScaling(const btVector3& scaling);
-
-	virtual const btVector3& getLocalScaling() const 
-	{
-		return m_localScaling;
-	}
-
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
-
-	virtual void	setMargin(btScalar margin)
-	{
-		m_collisionMargin = margin;
-	}
-	virtual btScalar	getMargin() const
-	{
-		return m_collisionMargin;
-	}
-	virtual const char*	getName()const
-	{
-		return "Compound";
-	}
-
-	const btDbvt*	getDynamicAabbTree() const
-	{
-		return m_dynamicAabbTree;
-	}
-	
-	btDbvt*	getDynamicAabbTree()
-	{
-		return m_dynamicAabbTree;
-	}
-
-	void createAabbTreeFromChildren();
-
-	///computes the exact moment of inertia and the transform from the coordinate system defined by the principal axes of the moment of inertia
-	///and the center of mass to the current coordinate system. "masses" points to an array of masses of the children. The resulting transform
-	///"principal" has to be applied inversely to all children transforms in order for the local coordinate system of the compound
-	///shape to be centered at the center of mass and to coincide with the principal axes. This also necessitates a correction of the world transform
-	///of the collision object by the principal transform.
-	void calculatePrincipalAxisTransform(btScalar* masses, btTransform& principal, btVector3& inertia) const;
-
-	int	getUpdateRevision() const
-	{
-		return m_updateRevision;
-	}
-
-	virtual	int	calculateSerializeBufferSize() const;
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
-
-
-};
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct btCompoundShapeChildData
-{
-	btTransformFloatData	m_transform;
-	btCollisionShapeData	*m_childShape;
-	int						m_childShapeType;
-	float					m_childMargin;
-};
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btCompoundShapeData
-{
-	btCollisionShapeData		m_collisionShapeData;
-
-	btCompoundShapeChildData	*m_childShapePtr;
-
-	int							m_numChildShapes;
-
-	float	m_collisionMargin;
-
-};
-
-
-SIMD_FORCE_INLINE	int	btCompoundShape::calculateSerializeBufferSize() const
-{
-	return sizeof(btCompoundShapeData);
-}
-
-
-
-
-
-
-
-#endif //BT_COMPOUND_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConcaveShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConcaveShape.cpp
deleted file mode 100644
index 58ff84a..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConcaveShape.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "btConcaveShape.h"
-
-btConcaveShape::btConcaveShape() : m_collisionMargin(btScalar(0.))
-{
-
-}
-
-btConcaveShape::~btConcaveShape()
-{
-
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConcaveShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConcaveShape.h
deleted file mode 100644
index 2a03241..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConcaveShape.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_CONCAVE_SHAPE_H
-#define BT_CONCAVE_SHAPE_H
-
-#include "btCollisionShape.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
-#include "btTriangleCallback.h"
-
-/// PHY_ScalarType enumerates possible scalar types.
-/// See the btStridingMeshInterface or btHeightfieldTerrainShape for its use
-typedef enum PHY_ScalarType {
-	PHY_FLOAT,
-	PHY_DOUBLE,
-	PHY_INTEGER,
-	PHY_SHORT,
-	PHY_FIXEDPOINT88,
-	PHY_UCHAR
-} PHY_ScalarType;
-
-///The btConcaveShape class provides an interface for non-moving (static) concave shapes.
-///It has been implemented by the btStaticPlaneShape, btBvhTriangleMeshShape and btHeightfieldTerrainShape.
-class btConcaveShape : public btCollisionShape
-{
-protected:
-	btScalar m_collisionMargin;
-
-public:
-	btConcaveShape();
-
-	virtual ~btConcaveShape();
-
-	virtual void	processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const = 0;
-
-	virtual btScalar getMargin() const {
-		return m_collisionMargin;
-	}
-	virtual void setMargin(btScalar collisionMargin)
-	{
-		m_collisionMargin = collisionMargin;
-	}
-
-
-
-};
-
-#endif //BT_CONCAVE_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConeShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConeShape.cpp
deleted file mode 100644
index 5e83087..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConeShape.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btConeShape.h"
-
-
-
-btConeShape::btConeShape (btScalar radius,btScalar height): btConvexInternalShape (),
-m_radius (radius),
-m_height(height)
-{
-	m_shapeType = CONE_SHAPE_PROXYTYPE;
-	setConeUpIndex(1);
-	btVector3 halfExtents;
-	m_sinAngle = (m_radius / btSqrt(m_radius * m_radius + m_height * m_height));
-}
-
-btConeShapeZ::btConeShapeZ (btScalar radius,btScalar height):
-btConeShape(radius,height)
-{
-	setConeUpIndex(2);
-}
-
-btConeShapeX::btConeShapeX (btScalar radius,btScalar height):
-btConeShape(radius,height)
-{
-	setConeUpIndex(0);
-}
-
-///choose upAxis index
-void	btConeShape::setConeUpIndex(int upIndex)
-{
-	switch (upIndex)
-	{
-	case 0:
-			m_coneIndices[0] = 1;
-			m_coneIndices[1] = 0;
-			m_coneIndices[2] = 2;
-		break;
-	case 1:
-			m_coneIndices[0] = 0;
-			m_coneIndices[1] = 1;
-			m_coneIndices[2] = 2;
-		break;
-	case 2:
-			m_coneIndices[0] = 0;
-			m_coneIndices[1] = 2;
-			m_coneIndices[2] = 1;
-		break;
-	default:
-		btAssert(0);
-	};
-}
-
-btVector3 btConeShape::coneLocalSupport(const btVector3& v) const
-{
-	
-	btScalar halfHeight = m_height * btScalar(0.5);
-
- if (v[m_coneIndices[1]] > v.length() * m_sinAngle)
- {
-	btVector3 tmp;
-
-	tmp[m_coneIndices[0]] = btScalar(0.);
-	tmp[m_coneIndices[1]] = halfHeight;
-	tmp[m_coneIndices[2]] = btScalar(0.);
-	return tmp;
- }
-  else {
-    btScalar s = btSqrt(v[m_coneIndices[0]] * v[m_coneIndices[0]] + v[m_coneIndices[2]] * v[m_coneIndices[2]]);
-    if (s > SIMD_EPSILON) {
-      btScalar d = m_radius / s;
-	  btVector3 tmp;
-	  tmp[m_coneIndices[0]] = v[m_coneIndices[0]] * d;
-	  tmp[m_coneIndices[1]] = -halfHeight;
-	  tmp[m_coneIndices[2]] = v[m_coneIndices[2]] * d;
-	  return tmp;
-    }
-    else  {
-		btVector3 tmp;
-		tmp[m_coneIndices[0]] = btScalar(0.);
-		tmp[m_coneIndices[1]] = -halfHeight;
-		tmp[m_coneIndices[2]] = btScalar(0.);
-		return tmp;
-	}
-  }
-
-}
-
-btVector3	btConeShape::localGetSupportingVertexWithoutMargin(const btVector3& vec) const
-{
-		return coneLocalSupport(vec);
-}
-
-void	btConeShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
-{
-	for (int i=0;i<numVectors;i++)
-	{
-		const btVector3& vec = vectors[i];
-		supportVerticesOut[i] = coneLocalSupport(vec);
-	}
-}
-
-
-btVector3	btConeShape::localGetSupportingVertex(const btVector3& vec)  const
-{
-	btVector3 supVertex = coneLocalSupport(vec);
-	if ( getMargin()!=btScalar(0.) )
-	{
-		btVector3 vecnorm = vec;
-		if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
-		{
-			vecnorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.));
-		} 
-		vecnorm.normalize();
-		supVertex+= getMargin() * vecnorm;
-	}
-	return supVertex;
-}
-
-
-void	btConeShape::setLocalScaling(const btVector3& scaling)
-{
-	int axis = m_coneIndices[1];
-	int r1 = m_coneIndices[0];
-	int r2 = m_coneIndices[2];
-	m_height *= scaling[axis] / m_localScaling[axis];
-	m_radius *= (scaling[r1] / m_localScaling[r1] + scaling[r2] / m_localScaling[r2]) / 2;
-	m_sinAngle = (m_radius / btSqrt(m_radius * m_radius + m_height * m_height));
-	btConvexInternalShape::setLocalScaling(scaling);
-}
\ No newline at end of file
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConeShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConeShape.h
deleted file mode 100644
index b69b5c5..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConeShape.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_CONE_MINKOWSKI_H
-#define BT_CONE_MINKOWSKI_H
-
-#include "btConvexInternalShape.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
-
-///The btConeShape implements a cone shape primitive, centered around the origin and aligned with the Y axis. The btConeShapeX is aligned around the X axis and btConeShapeZ around the Z axis.
-class btConeShape : public btConvexInternalShape
-
-{
-
-	btScalar m_sinAngle;
-	btScalar m_radius;
-	btScalar m_height;
-	int		m_coneIndices[3];
-	btVector3 coneLocalSupport(const btVector3& v) const;
-
-
-public:
-	btConeShape (btScalar radius,btScalar height);
-	
-	virtual btVector3	localGetSupportingVertex(const btVector3& vec) const;
-	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec) const;
-	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
-
-	btScalar getRadius() const { return m_radius;}
-	btScalar getHeight() const { return m_height;}
-
-
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const
-	{
-		btTransform identity;
-		identity.setIdentity();
-		btVector3 aabbMin,aabbMax;
-		getAabb(identity,aabbMin,aabbMax);
-
-		btVector3 halfExtents = (aabbMax-aabbMin)*btScalar(0.5);
-
-		btScalar margin = getMargin();
-
-		btScalar lx=btScalar(2.)*(halfExtents.x()+margin);
-		btScalar ly=btScalar(2.)*(halfExtents.y()+margin);
-		btScalar lz=btScalar(2.)*(halfExtents.z()+margin);
-		const btScalar x2 = lx*lx;
-		const btScalar y2 = ly*ly;
-		const btScalar z2 = lz*lz;
-		const btScalar scaledmass = mass * btScalar(0.08333333);
-
-		inertia = scaledmass * (btVector3(y2+z2,x2+z2,x2+y2));
-
-//		inertia.x() = scaledmass * (y2+z2);
-//		inertia.y() = scaledmass * (x2+z2);
-//		inertia.z() = scaledmass * (x2+y2);
-	}
-
-
-		virtual const char*	getName()const 
-		{
-			return "Cone";
-		}
-		
-		///choose upAxis index
-		void	setConeUpIndex(int upIndex);
-		
-		int	getConeUpIndex() const
-		{
-			return m_coneIndices[1];
-		}
-
-	virtual void	setLocalScaling(const btVector3& scaling);
-
-};
-
-///btConeShape implements a Cone shape, around the X axis
-class btConeShapeX : public btConeShape
-{
-	public:
-		btConeShapeX(btScalar radius,btScalar height);
-};
-
-///btConeShapeZ implements a Cone shape, around the Z axis
-class btConeShapeZ : public btConeShape
-{
-	public:
-		btConeShapeZ(btScalar radius,btScalar height);
-};
-#endif //BT_CONE_MINKOWSKI_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvex2dShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvex2dShape.cpp
deleted file mode 100644
index 10ea3e9..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvex2dShape.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btConvex2dShape.h"
-
-btConvex2dShape::btConvex2dShape(	btConvexShape* convexChildShape):
-btConvexShape (), m_childConvexShape(convexChildShape)
-{
-	m_shapeType = CONVEX_2D_SHAPE_PROXYTYPE;
-}
-	
-btConvex2dShape::~btConvex2dShape()
-{
-}
-
-	
-
-btVector3	btConvex2dShape::localGetSupportingVertexWithoutMargin(const btVector3& vec)const
-{
-	return m_childConvexShape->localGetSupportingVertexWithoutMargin(vec);
-}
-
-void	btConvex2dShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
-{
-	m_childConvexShape->batchedUnitVectorGetSupportingVertexWithoutMargin(vectors,supportVerticesOut,numVectors);
-}
-
-
-btVector3	btConvex2dShape::localGetSupportingVertex(const btVector3& vec)const
-{
-	return m_childConvexShape->localGetSupportingVertex(vec);
-}
-
-
-void	btConvex2dShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
-{
-	///this linear upscaling is not realistic, but we don't deal with large mass ratios...
-	m_childConvexShape->calculateLocalInertia(mass,inertia);
-}
-
-
-	///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
-void btConvex2dShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
-{
-	m_childConvexShape->getAabb(t,aabbMin,aabbMax);
-}
-
-void btConvex2dShape::getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
-{
-	m_childConvexShape->getAabbSlow(t,aabbMin,aabbMax);
-}
-
-void	btConvex2dShape::setLocalScaling(const btVector3& scaling) 
-{
-	m_childConvexShape->setLocalScaling(scaling);
-}
-
-const btVector3& btConvex2dShape::getLocalScaling() const
-{
-	return m_childConvexShape->getLocalScaling();
-}
-
-void	btConvex2dShape::setMargin(btScalar margin)
-{
-	m_childConvexShape->setMargin(margin);
-}
-btScalar	btConvex2dShape::getMargin() const
-{
-	return m_childConvexShape->getMargin();
-}
-
-int		btConvex2dShape::getNumPreferredPenetrationDirections() const
-{
-	return m_childConvexShape->getNumPreferredPenetrationDirections();
-}
-	
-void	btConvex2dShape::getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const
-{
-	m_childConvexShape->getPreferredPenetrationDirection(index,penetrationVector);
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvex2dShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvex2dShape.h
deleted file mode 100644
index caf5432..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvex2dShape.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_CONVEX_2D_SHAPE_H
-#define BT_CONVEX_2D_SHAPE_H
-
-#include "BulletCollision/CollisionShapes/btConvexShape.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
-
-///The btConvex2dShape allows to use arbitrary convex shapes as 2d convex shapes, with the Z component assumed to be 0.
-///For 2d boxes, the btBox2dShape is recommended.
-class btConvex2dShape : public btConvexShape
-{
-	btConvexShape*	m_childConvexShape;
-
-	public:
-	
-	btConvex2dShape(	btConvexShape* convexChildShape);
-	
-	virtual ~btConvex2dShape();
-	
-	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
-
-	virtual btVector3	localGetSupportingVertex(const btVector3& vec)const;
-
-	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
-
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
-
-	btConvexShape*	getChildShape() 
-	{
-		return m_childConvexShape;
-	}
-
-	const btConvexShape*	getChildShape() const
-	{
-		return m_childConvexShape;
-	}
-
-	virtual const char*	getName()const 
-	{
-		return "Convex2dShape";
-	}
-	
-
-
-	///////////////////////////
-
-
-	///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
-	void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
-
-	virtual void getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
-
-	virtual void	setLocalScaling(const btVector3& scaling) ;
-	virtual const btVector3& getLocalScaling() const ;
-
-	virtual void	setMargin(btScalar margin);
-	virtual btScalar	getMargin() const;
-
-	virtual int		getNumPreferredPenetrationDirections() const;
-	
-	virtual void	getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const;
-
-
-};
-
-#endif //BT_CONVEX_2D_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp
deleted file mode 100644
index 69bc67c..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btConvexHullShape.h"
-#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
-
-#include "LinearMath/btQuaternion.h"
-#include "LinearMath/btSerializer.h"
-
-btConvexHullShape ::btConvexHullShape (const btScalar* points,int numPoints,int stride) : btPolyhedralConvexAabbCachingShape ()
-{
-	m_shapeType = CONVEX_HULL_SHAPE_PROXYTYPE;
-	m_unscaledPoints.resize(numPoints);
-
-	unsigned char* pointsAddress = (unsigned char*)points;
-
-	for (int i=0;i<numPoints;i++)
-	{
-		btScalar* point = (btScalar*)pointsAddress;
-		m_unscaledPoints[i] = btVector3(point[0], point[1], point[2]);
-		pointsAddress += stride;
-	}
-
-	recalcLocalAabb();
-
-}
-
-
-
-void btConvexHullShape::setLocalScaling(const btVector3& scaling)
-{
-	m_localScaling = scaling;
-	recalcLocalAabb();
-}
-
-void btConvexHullShape::addPoint(const btVector3& point)
-{
-	m_unscaledPoints.push_back(point);
-	recalcLocalAabb();
-
-}
-
-btVector3	btConvexHullShape::localGetSupportingVertexWithoutMargin(const btVector3& vec)const
-{
-	btVector3 supVec(btScalar(0.),btScalar(0.),btScalar(0.));
-	btScalar newDot,maxDot = btScalar(-BT_LARGE_FLOAT);
-
-	for (int i=0;i<m_unscaledPoints.size();i++)
-	{
-		btVector3 vtx = m_unscaledPoints[i] * m_localScaling;
-
-		newDot = vec.dot(vtx);
-		if (newDot > maxDot)
-		{
-			maxDot = newDot;
-			supVec = vtx;
-		}
-	}
-	return supVec;
-}
-
-void	btConvexHullShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
-{
-	btScalar newDot;
-	//use 'w' component of supportVerticesOut?
-	{
-		for (int i=0;i<numVectors;i++)
-		{
-			supportVerticesOut[i][3] = btScalar(-BT_LARGE_FLOAT);
-		}
-	}
-	for (int i=0;i<m_unscaledPoints.size();i++)
-	{
-		btVector3 vtx = getScaledPoint(i);
-
-		for (int j=0;j<numVectors;j++)
-		{
-			const btVector3& vec = vectors[j];
-			
-			newDot = vec.dot(vtx);
-			if (newDot > supportVerticesOut[j][3])
-			{
-				//WARNING: don't swap next lines, the w component would get overwritten!
-				supportVerticesOut[j] = vtx;
-				supportVerticesOut[j][3] = newDot;
-			}
-		}
-	}
-
-
-
-}
-	
-
-
-btVector3	btConvexHullShape::localGetSupportingVertex(const btVector3& vec)const
-{
-	btVector3 supVertex = localGetSupportingVertexWithoutMargin(vec);
-
-	if ( getMargin()!=btScalar(0.) )
-	{
-		btVector3 vecnorm = vec;
-		if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
-		{
-			vecnorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.));
-		} 
-		vecnorm.normalize();
-		supVertex+= getMargin() * vecnorm;
-	}
-	return supVertex;
-}
-
-
-
-
-
-
-
-
-
-//currently just for debugging (drawing), perhaps future support for algebraic continuous collision detection
-//Please note that you can debug-draw btConvexHullShape with the Raytracer Demo
-int	btConvexHullShape::getNumVertices() const
-{
-	return m_unscaledPoints.size();
-}
-
-int btConvexHullShape::getNumEdges() const
-{
-	return m_unscaledPoints.size();
-}
-
-void btConvexHullShape::getEdge(int i,btVector3& pa,btVector3& pb) const
-{
-
-	int index0 = i%m_unscaledPoints.size();
-	int index1 = (i+1)%m_unscaledPoints.size();
-	pa = getScaledPoint(index0);
-	pb = getScaledPoint(index1);
-}
-
-void btConvexHullShape::getVertex(int i,btVector3& vtx) const
-{
-	vtx = getScaledPoint(i);
-}
-
-int	btConvexHullShape::getNumPlanes() const
-{
-	return 0;
-}
-
-void btConvexHullShape::getPlane(btVector3& ,btVector3& ,int ) const
-{
-
-	btAssert(0);
-}
-
-//not yet
-bool btConvexHullShape::isInside(const btVector3& ,btScalar ) const
-{
-	btAssert(0);
-	return false;
-}
-
-///fills the dataBuffer and returns the struct name (and 0 on failure)
-const char*	btConvexHullShape::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-	//int szc = sizeof(btConvexHullShapeData);
-	btConvexHullShapeData* shapeData = (btConvexHullShapeData*) dataBuffer;
-	btConvexInternalShape::serialize(&shapeData->m_convexInternalShapeData, serializer);
-
-	int numElem = m_unscaledPoints.size();
-	shapeData->m_numUnscaledPoints = numElem;
-#ifdef BT_USE_DOUBLE_PRECISION
-	shapeData->m_unscaledPointsFloatPtr = 0;
-	shapeData->m_unscaledPointsDoublePtr = numElem ? (btVector3Data*)serializer->getUniquePointer((void*)&m_unscaledPoints[0]):  0;
-#else
-	shapeData->m_unscaledPointsFloatPtr = numElem ? (btVector3Data*)serializer->getUniquePointer((void*)&m_unscaledPoints[0]):  0;
-	shapeData->m_unscaledPointsDoublePtr = 0;
-#endif
-	
-	if (numElem)
-	{
-		int sz = sizeof(btVector3Data);
-	//	int sz2 = sizeof(btVector3DoubleData);
-	//	int sz3 = sizeof(btVector3FloatData);
-		btChunk* chunk = serializer->allocate(sz,numElem);
-		btVector3Data* memPtr = (btVector3Data*)chunk->m_oldPtr;
-		for (int i=0;i<numElem;i++,memPtr++)
-		{
-			m_unscaledPoints[i].serialize(*memPtr);
-		}
-		serializer->finalizeChunk(chunk,btVector3DataName,BT_ARRAY_CODE,(void*)&m_unscaledPoints[0]);
-	}
-	
-	return "btConvexHullShapeData";
-}
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexHullShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexHullShape.h
deleted file mode 100644
index 1f7c89d..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexHullShape.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_CONVEX_HULL_SHAPE_H
-#define BT_CONVEX_HULL_SHAPE_H
-
-#include "btPolyhedralConvexShape.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
-#include "LinearMath/btAlignedObjectArray.h"
-
-
-///The btConvexHullShape implements an implicit convex hull of an array of vertices.
-///Bullet provides a general and fast collision detector for convex shapes based on GJK and EPA using localGetSupportingVertex.
-ATTRIBUTE_ALIGNED16(class) btConvexHullShape : public btPolyhedralConvexAabbCachingShape
-{
-	btAlignedObjectArray<btVector3>	m_unscaledPoints;
-
-public:
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-
-	
-	///this constructor optionally takes in a pointer to points. Each point is assumed to be 3 consecutive btScalar (x,y,z), the striding defines the number of bytes between each point, in memory.
-	///It is easier to not pass any points in the constructor, and just add one point at a time, using addPoint.
-	///btConvexHullShape make an internal copy of the points.
-	btConvexHullShape(const btScalar* points=0,int numPoints=0, int stride=sizeof(btVector3));
-
-	void addPoint(const btVector3& point);
-
-	
-	btVector3* getUnscaledPoints()
-	{
-		return &m_unscaledPoints[0];
-	}
-
-	const btVector3* getUnscaledPoints() const
-	{
-		return &m_unscaledPoints[0];
-	}
-
-	///getPoints is obsolete, please use getUnscaledPoints
-	const btVector3* getPoints() const
-	{
-		return getUnscaledPoints();
-	}
-
-	
-
-
-	SIMD_FORCE_INLINE	btVector3 getScaledPoint(int i) const
-	{
-		return m_unscaledPoints[i] * m_localScaling;
-	}
-
-	SIMD_FORCE_INLINE	int getNumPoints() const 
-	{
-		return m_unscaledPoints.size();
-	}
-
-	virtual btVector3	localGetSupportingVertex(const btVector3& vec)const;
-	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
-	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
-	
-
-
-	//debugging
-	virtual const char*	getName()const {return "Convex";}
-
-	
-	virtual int	getNumVertices() const;
-	virtual int getNumEdges() const;
-	virtual void getEdge(int i,btVector3& pa,btVector3& pb) const;
-	virtual void getVertex(int i,btVector3& vtx) const;
-	virtual int	getNumPlanes() const;
-	virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i ) const;
-	virtual	bool isInside(const btVector3& pt,btScalar tolerance) const;
-
-	///in case we receive negative scaling
-	virtual void	setLocalScaling(const btVector3& scaling);
-
-	virtual	int	calculateSerializeBufferSize() const;
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
-
-};
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btConvexHullShapeData
-{
-	btConvexInternalShapeData	m_convexInternalShapeData;
-
-	btVector3FloatData	*m_unscaledPointsFloatPtr;
-	btVector3DoubleData	*m_unscaledPointsDoublePtr;
-
-	int		m_numUnscaledPoints;
-	char m_padding3[4];
-
-};
-
-
-SIMD_FORCE_INLINE	int	btConvexHullShape::calculateSerializeBufferSize() const
-{
-	return sizeof(btConvexHullShapeData);
-}
-
-
-#endif //BT_CONVEX_HULL_SHAPE_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexInternalShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexInternalShape.cpp
deleted file mode 100644
index 083d60b..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexInternalShape.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "btConvexInternalShape.h"
-
-
-
-btConvexInternalShape::btConvexInternalShape()
-: m_localScaling(btScalar(1.),btScalar(1.),btScalar(1.)),
-m_collisionMargin(CONVEX_DISTANCE_MARGIN)
-{
-}
-
-
-void	btConvexInternalShape::setLocalScaling(const btVector3& scaling)
-{
-	m_localScaling = scaling.absolute();
-}
-
-
-
-void	btConvexInternalShape::getAabbSlow(const btTransform& trans,btVector3&minAabb,btVector3&maxAabb) const
-{
-#ifndef __SPU__
-	//use localGetSupportingVertexWithoutMargin?
-	btScalar margin = getMargin();
-	for (int i=0;i<3;i++)
-	{
-		btVector3 vec(btScalar(0.),btScalar(0.),btScalar(0.));
-		vec[i] = btScalar(1.);
-
-		btVector3 sv = localGetSupportingVertex(vec*trans.getBasis());
-
-		btVector3 tmp = trans(sv);
-		maxAabb[i] = tmp[i]+margin;
-		vec[i] = btScalar(-1.);
-		tmp = trans(localGetSupportingVertex(vec*trans.getBasis()));
-		minAabb[i] = tmp[i]-margin;
-	}
-#endif
-}
-
-
-
-btVector3	btConvexInternalShape::localGetSupportingVertex(const btVector3& vec)const
-{
-#ifndef __SPU__
-
-	 btVector3	supVertex = localGetSupportingVertexWithoutMargin(vec);
-
-	if ( getMargin()!=btScalar(0.) )
-	{
-		btVector3 vecnorm = vec;
-		if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
-		{
-			vecnorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.));
-		} 
-		vecnorm.normalize();
-		supVertex+= getMargin() * vecnorm;
-	}
-	return supVertex;
-
-#else
-	btAssert(0);
-	return btVector3(0,0,0);
-#endif //__SPU__
-
- }
-
-
-btConvexInternalAabbCachingShape::btConvexInternalAabbCachingShape()
-	:	btConvexInternalShape(),
-m_localAabbMin(1,1,1),
-m_localAabbMax(-1,-1,-1),
-m_isLocalAabbValid(false)
-{
-}
-
-
-void btConvexInternalAabbCachingShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const
-{
-	getNonvirtualAabb(trans,aabbMin,aabbMax,getMargin());
-}
-
-void	btConvexInternalAabbCachingShape::setLocalScaling(const btVector3& scaling)
-{
-	btConvexInternalShape::setLocalScaling(scaling);
-	recalcLocalAabb();
-}
-
-
-void	btConvexInternalAabbCachingShape::recalcLocalAabb()
-{
-	m_isLocalAabbValid = true;
-	
-	#if 1
-	static const btVector3 _directions[] =
-	{
-		btVector3( 1.,  0.,  0.),
-		btVector3( 0.,  1.,  0.),
-		btVector3( 0.,  0.,  1.),
-		btVector3( -1., 0.,  0.),
-		btVector3( 0., -1.,  0.),
-		btVector3( 0.,  0., -1.)
-	};
-	
-	btVector3 _supporting[] =
-	{
-		btVector3( 0., 0., 0.),
-		btVector3( 0., 0., 0.),
-		btVector3( 0., 0., 0.),
-		btVector3( 0., 0., 0.),
-		btVector3( 0., 0., 0.),
-		btVector3( 0., 0., 0.)
-	};
-	
-	batchedUnitVectorGetSupportingVertexWithoutMargin(_directions, _supporting, 6);
-	
-	for ( int i = 0; i < 3; ++i )
-	{
-		m_localAabbMax[i] = _supporting[i][i] + m_collisionMargin;
-		m_localAabbMin[i] = _supporting[i + 3][i] - m_collisionMargin;
-	}
-	
-	#else
-
-	for (int i=0;i<3;i++)
-	{
-		btVector3 vec(btScalar(0.),btScalar(0.),btScalar(0.));
-		vec[i] = btScalar(1.);
-		btVector3 tmp = localGetSupportingVertex(vec);
-		m_localAabbMax[i] = tmp[i]+m_collisionMargin;
-		vec[i] = btScalar(-1.);
-		tmp = localGetSupportingVertex(vec);
-		m_localAabbMin[i] = tmp[i]-m_collisionMargin;
-	}
-	#endif
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexInternalShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexInternalShape.h
deleted file mode 100644
index 1252773..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexInternalShape.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_CONVEX_INTERNAL_SHAPE_H
-#define BT_CONVEX_INTERNAL_SHAPE_H
-
-#include "btConvexShape.h"
-#include "LinearMath/btAabbUtil2.h"
-
-
-///The btConvexInternalShape is an internal base class, shared by most convex shape implementations.
-class btConvexInternalShape : public btConvexShape
-{
-
-	protected:
-
-	//local scaling. collisionMargin is not scaled !
-	btVector3	m_localScaling;
-
-	btVector3	m_implicitShapeDimensions;
-	
-	btScalar	m_collisionMargin;
-
-	btScalar	m_padding;
-
-	btConvexInternalShape();
-
-public:
-
-	
-
-	virtual ~btConvexInternalShape()
-	{
-
-	}
-
-	virtual btVector3	localGetSupportingVertex(const btVector3& vec)const;
-
-	const btVector3& getImplicitShapeDimensions() const
-	{
-		return m_implicitShapeDimensions;
-	}
-
-	///warning: use setImplicitShapeDimensions with care
-	///changing a collision shape while the body is in the world is not recommended,
-	///it is best to remove the body from the world, then make the change, and re-add it
-	///alternatively flush the contact points, see documentation for 'cleanProxyFromPairs'
-	void	setImplicitShapeDimensions(const btVector3& dimensions)
-	{
-		m_implicitShapeDimensions = dimensions;
-	}
-
-	///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
-	void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
-	{
-		getAabbSlow(t,aabbMin,aabbMax);
-	}
-
-
-	
-	virtual void getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
-
-
-	virtual void	setLocalScaling(const btVector3& scaling);
-	virtual const btVector3& getLocalScaling() const 
-	{
-		return m_localScaling;
-	}
-
-	const btVector3& getLocalScalingNV() const 
-	{
-		return m_localScaling;
-	}
-
-	virtual void	setMargin(btScalar margin)
-	{
-		m_collisionMargin = margin;
-	}
-	virtual btScalar	getMargin() const
-	{
-		return m_collisionMargin;
-	}
-
-	btScalar	getMarginNV() const
-	{
-		return m_collisionMargin;
-	}
-
-	virtual int		getNumPreferredPenetrationDirections() const
-	{
-		return 0;
-	}
-	
-	virtual void	getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const
-	{
-		(void)penetrationVector;
-		(void)index;
-		btAssert(0);
-	}
-
-	virtual	int	calculateSerializeBufferSize() const;
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
-
-	
-};
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btConvexInternalShapeData
-{
-	btCollisionShapeData	m_collisionShapeData;
-
-	btVector3FloatData	m_localScaling;
-
-	btVector3FloatData	m_implicitShapeDimensions;
-	
-	float			m_collisionMargin;
-
-	int	m_padding;
-
-};
-
-
-
-SIMD_FORCE_INLINE	int	btConvexInternalShape::calculateSerializeBufferSize() const
-{
-	return sizeof(btConvexInternalShapeData);
-}
-
-///fills the dataBuffer and returns the struct name (and 0 on failure)
-SIMD_FORCE_INLINE	const char*	btConvexInternalShape::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-	btConvexInternalShapeData* shapeData = (btConvexInternalShapeData*) dataBuffer;
-	btCollisionShape::serialize(&shapeData->m_collisionShapeData, serializer);
-
-	m_implicitShapeDimensions.serializeFloat(shapeData->m_implicitShapeDimensions);
-	m_localScaling.serializeFloat(shapeData->m_localScaling);
-	shapeData->m_collisionMargin = float(m_collisionMargin);
-
-	return "btConvexInternalShapeData";
-}
-
-
-
-
-///btConvexInternalAabbCachingShape adds local aabb caching for convex shapes, to avoid expensive bounding box calculations
-class btConvexInternalAabbCachingShape : public btConvexInternalShape
-{
-	btVector3	m_localAabbMin;
-	btVector3	m_localAabbMax;
-	bool		m_isLocalAabbValid;
-	
-protected:
-					
-	btConvexInternalAabbCachingShape();
-	
-	void setCachedLocalAabb (const btVector3& aabbMin, const btVector3& aabbMax)
-	{
-		m_isLocalAabbValid = true;
-		m_localAabbMin = aabbMin;
-		m_localAabbMax = aabbMax;
-	}
-
-	inline void getCachedLocalAabb (btVector3& aabbMin, btVector3& aabbMax) const
-	{
-		btAssert(m_isLocalAabbValid);
-		aabbMin = m_localAabbMin;
-		aabbMax = m_localAabbMax;
-	}
-
-	inline void getNonvirtualAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax, btScalar margin) const
-	{
-
-		//lazy evaluation of local aabb
-		btAssert(m_isLocalAabbValid);
-		btTransformAabb(m_localAabbMin,m_localAabbMax,margin,trans,aabbMin,aabbMax);
-	}
-		
-public:
-		
-	virtual void	setLocalScaling(const btVector3& scaling);
-
-	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
-
-	void	recalcLocalAabb();
-
-};
-
-#endif //BT_CONVEX_INTERNAL_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp
deleted file mode 100644
index c1b155a..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btConvexPointCloudShape.h"
-#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
-
-#include "LinearMath/btQuaternion.h"
-
-void btConvexPointCloudShape::setLocalScaling(const btVector3& scaling)
-{
-	m_localScaling = scaling;
-	recalcLocalAabb();
-}
-
-#ifndef __SPU__
-btVector3	btConvexPointCloudShape::localGetSupportingVertexWithoutMargin(const btVector3& vec0)const
-{
-	btVector3 supVec(btScalar(0.),btScalar(0.),btScalar(0.));
-	btScalar newDot,maxDot = btScalar(-BT_LARGE_FLOAT);
-
-	btVector3 vec = vec0;
-	btScalar lenSqr = vec.length2();
-	if (lenSqr < btScalar(0.0001))
-	{
-		vec.setValue(1,0,0);
-	} else
-	{
-		btScalar rlen = btScalar(1.) / btSqrt(lenSqr );
-		vec *= rlen;
-	}
-
-
-	for (int i=0;i<m_numPoints;i++)
-	{
-		btVector3 vtx = getScaledPoint(i);
-
-		newDot = vec.dot(vtx);
-		if (newDot > maxDot)
-		{
-			maxDot = newDot;
-			supVec = vtx;
-		}
-	}
-	return supVec;
-}
-
-void	btConvexPointCloudShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
-{
-	btScalar newDot;
-	//use 'w' component of supportVerticesOut?
-	{
-		for (int i=0;i<numVectors;i++)
-		{
-			supportVerticesOut[i][3] = btScalar(-BT_LARGE_FLOAT);
-		}
-	}
-	for (int i=0;i<m_numPoints;i++)
-	{
-		btVector3 vtx = getScaledPoint(i);
-
-		for (int j=0;j<numVectors;j++)
-		{
-			const btVector3& vec = vectors[j];
-			
-			newDot = vec.dot(vtx);
-			if (newDot > supportVerticesOut[j][3])
-			{
-				//WARNING: don't swap next lines, the w component would get overwritten!
-				supportVerticesOut[j] = vtx;
-				supportVerticesOut[j][3] = newDot;
-			}
-		}
-	}
-
-
-
-}
-	
-
-
-btVector3	btConvexPointCloudShape::localGetSupportingVertex(const btVector3& vec)const
-{
-	btVector3 supVertex = localGetSupportingVertexWithoutMargin(vec);
-
-	if ( getMargin()!=btScalar(0.) )
-	{
-		btVector3 vecnorm = vec;
-		if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
-		{
-			vecnorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.));
-		} 
-		vecnorm.normalize();
-		supVertex+= getMargin() * vecnorm;
-	}
-	return supVertex;
-}
-
-
-#endif
-
-
-
-
-
-
-//currently just for debugging (drawing), perhaps future support for algebraic continuous collision detection
-//Please note that you can debug-draw btConvexHullShape with the Raytracer Demo
-int	btConvexPointCloudShape::getNumVertices() const
-{
-	return m_numPoints;
-}
-
-int btConvexPointCloudShape::getNumEdges() const
-{
-	return 0;
-}
-
-void btConvexPointCloudShape::getEdge(int i,btVector3& pa,btVector3& pb) const
-{
-	btAssert (0);
-}
-
-void btConvexPointCloudShape::getVertex(int i,btVector3& vtx) const
-{
-	vtx = m_unscaledPoints[i]*m_localScaling;
-}
-
-int	btConvexPointCloudShape::getNumPlanes() const
-{
-	return 0;
-}
-
-void btConvexPointCloudShape::getPlane(btVector3& ,btVector3& ,int ) const
-{
-
-	btAssert(0);
-}
-
-//not yet
-bool btConvexPointCloudShape::isInside(const btVector3& ,btScalar ) const
-{
-	btAssert(0);
-	return false;
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.h
deleted file mode 100644
index 54b5afa..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_CONVEX_POINT_CLOUD_SHAPE_H
-#define BT_CONVEX_POINT_CLOUD_SHAPE_H
-
-#include "btPolyhedralConvexShape.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
-#include "LinearMath/btAlignedObjectArray.h"
-
-///The btConvexPointCloudShape implements an implicit convex hull of an array of vertices.
-ATTRIBUTE_ALIGNED16(class) btConvexPointCloudShape : public btPolyhedralConvexAabbCachingShape
-{
-	btVector3* m_unscaledPoints;
-	int m_numPoints;
-
-public:
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-
-	btConvexPointCloudShape()
-	{
-		m_localScaling.setValue(1.f,1.f,1.f);
-		m_shapeType = CONVEX_POINT_CLOUD_SHAPE_PROXYTYPE;
-		m_unscaledPoints = 0;
-		m_numPoints = 0;
-	}
-
-	btConvexPointCloudShape(btVector3* points,int numPoints, const btVector3& localScaling,bool computeAabb = true)
-	{
-		m_localScaling = localScaling;
-		m_shapeType = CONVEX_POINT_CLOUD_SHAPE_PROXYTYPE;
-		m_unscaledPoints = points;
-		m_numPoints = numPoints;
-
-		if (computeAabb)
-			recalcLocalAabb();
-	}
-
-	void setPoints (btVector3* points, int numPoints, bool computeAabb = true,const btVector3& localScaling=btVector3(1.f,1.f,1.f))
-	{
-		m_unscaledPoints = points;
-		m_numPoints = numPoints;
-		m_localScaling = localScaling;
-
-		if (computeAabb)
-			recalcLocalAabb();
-	}
-
-	SIMD_FORCE_INLINE	btVector3* getUnscaledPoints()
-	{
-		return m_unscaledPoints;
-	}
-
-	SIMD_FORCE_INLINE	const btVector3* getUnscaledPoints() const
-	{
-		return m_unscaledPoints;
-	}
-
-	SIMD_FORCE_INLINE	int getNumPoints() const 
-	{
-		return m_numPoints;
-	}
-
-	SIMD_FORCE_INLINE	btVector3	getScaledPoint( int index) const
-	{
-		return m_unscaledPoints[index] * m_localScaling;
-	}
-
-#ifndef __SPU__
-	virtual btVector3	localGetSupportingVertex(const btVector3& vec)const;
-	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
-	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
-#endif
-
-
-	//debugging
-	virtual const char*	getName()const {return "ConvexPointCloud";}
-
-	virtual int	getNumVertices() const;
-	virtual int getNumEdges() const;
-	virtual void getEdge(int i,btVector3& pa,btVector3& pb) const;
-	virtual void getVertex(int i,btVector3& vtx) const;
-	virtual int	getNumPlanes() const;
-	virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i ) const;
-	virtual	bool isInside(const btVector3& pt,btScalar tolerance) const;
-
-	///in case we receive negative scaling
-	virtual void	setLocalScaling(const btVector3& scaling);
-};
-
-
-#endif //BT_CONVEX_POINT_CLOUD_SHAPE_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPolyhedron.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPolyhedron.cpp
deleted file mode 100644
index 6fceb6f..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPolyhedron.cpp
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2011 Advanced Micro Devices, Inc.  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-///This file was written by Erwin Coumans
-///Separating axis rest based on work from Pierre Terdiman, see
-///And contact clipping based on work from Simon Hobbs
-
-
-#include "btConvexPolyhedron.h"
-#include "LinearMath/btHashMap.h"
-
-btConvexPolyhedron::btConvexPolyhedron()
-{
-
-}
-btConvexPolyhedron::~btConvexPolyhedron()
-{
-
-}
-
-
-inline bool IsAlmostZero(const btVector3& v)
-{
-	if(fabsf(v.x())>1e-6 || fabsf(v.y())>1e-6 || fabsf(v.z())>1e-6)	return false;
-	return true;
-}
-
-struct btInternalVertexPair
-{
-	btInternalVertexPair(short int v0,short int v1)
-		:m_v0(v0),
-		m_v1(v1)
-	{
-		if (m_v1>m_v0)
-			btSwap(m_v0,m_v1);
-	}
-	short int m_v0;
-	short int m_v1;
-	int getHash() const
-	{
-		return m_v0+(m_v1<<16);
-	}
-	bool equals(const btInternalVertexPair& other) const
-	{
-		return m_v0==other.m_v0 && m_v1==other.m_v1;
-	}
-};
-
-struct btInternalEdge
-{
-	btInternalEdge()
-		:m_face0(-1),
-		m_face1(-1)
-	{
-	}
-	short int m_face0;
-	short int m_face1;
-};
-
-//
-
-void	btConvexPolyhedron::initialize()
-{
-	btHashMap<btInternalVertexPair,btInternalEdge> edges;
-
-	float TotalArea = 0.0f;
-	
-	m_localCenter.setValue(0, 0, 0);
-	for(int i=0;i<m_faces.size();i++)
-	{
-		int numVertices = m_faces[i].m_indices.size();
-		int NbTris = numVertices;
-		for(int j=0;j<NbTris;j++)
-		{
-			int k = (j+1)%numVertices;
-			btInternalVertexPair vp(m_faces[i].m_indices[j],m_faces[i].m_indices[k]);
-			btInternalEdge* edptr = edges.find(vp);
-			btVector3 edge = m_vertices[vp.m_v1]-m_vertices[vp.m_v0];
-			edge.normalize();
-
-			bool found = false;
-
-			for (int p=0;p<m_uniqueEdges.size();p++)
-			{
-				
-				if (IsAlmostZero(m_uniqueEdges[p]-edge) || 
-					IsAlmostZero(m_uniqueEdges[p]+edge))
-				{
-					found = true;
-					break;
-				}
-			}
-
-			if (!found)
-			{
-				m_uniqueEdges.push_back(edge);
-			}
-
-			if (edptr)
-			{
-				btAssert(edptr->m_face0>=0);
-				btAssert(edptr->m_face1<0);
-				edptr->m_face1 = i;
-			} else
-			{
-				btInternalEdge ed;
-				ed.m_face0 = i;
-				edges.insert(vp,ed);
-			}
-		}
-	}
-
-	for(int i=0;i<m_faces.size();i++)
-	{
-		int numVertices = m_faces[i].m_indices.size();
-		m_faces[i].m_connectedFaces.resize(numVertices);
-
-		for(int j=0;j<numVertices;j++)
-		{
-			int k = (j+1)%numVertices;
-			btInternalVertexPair vp(m_faces[i].m_indices[j],m_faces[i].m_indices[k]);
-			btInternalEdge* edptr = edges.find(vp);
-			btAssert(edptr);
-			btAssert(edptr->m_face0>=0);
-			btAssert(edptr->m_face1>=0);
-
-			int connectedFace = (edptr->m_face0==i)?edptr->m_face1:edptr->m_face0;
-			m_faces[i].m_connectedFaces[j] = connectedFace;
-		}
-	}
-
-	for(int i=0;i<m_faces.size();i++)
-	{
-		int numVertices = m_faces[i].m_indices.size();
-		int NbTris = numVertices-2;
-		
-		const btVector3& p0 = m_vertices[m_faces[i].m_indices[0]];
-		for(int j=1;j<=NbTris;j++)
-		{
-			int k = (j+1)%numVertices;
-			const btVector3& p1 = m_vertices[m_faces[i].m_indices[j]];
-			const btVector3& p2 = m_vertices[m_faces[i].m_indices[k]];
-			float Area = ((p0 - p1).cross(p0 - p2)).length() * 0.5f;
-			btVector3 Center = (p0+p1+p2)/3.0f;
-			m_localCenter += Area * Center;
-			TotalArea += Area;
-		}
-	}
-	m_localCenter /= TotalArea;
-
-}
-
-
-void btConvexPolyhedron::project(const btTransform& trans, const btVector3& dir, float& min, float& max) const
-{
-	min = FLT_MAX;
-	max = -FLT_MAX;
-	int numVerts = m_vertices.size();
-	for(int i=0;i<numVerts;i++)
-	{
-		btVector3 pt = trans * m_vertices[i];
-		float dp = pt.dot(dir);
-		if(dp < min)	min = dp;
-		if(dp > max)	max = dp;
-	}
-	if(min>max)
-	{
-		float tmp = min;
-		min = max;
-		max = tmp;
-	}
-}
\ No newline at end of file
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPolyhedron.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPolyhedron.h
deleted file mode 100644
index a64cdbf..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPolyhedron.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2011 Advanced Micro Devices, Inc.  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-///This file was written by Erwin Coumans
-
-
-#ifndef _BT_POLYHEDRAL_FEATURES_H
-#define _BT_POLYHEDRAL_FEATURES_H
-
-#include "LinearMath/btTransform.h"
-#include "LinearMath/btAlignedObjectArray.h"
-
-
-struct btFace
-{
-	btAlignedObjectArray<int>	m_indices;
-	btAlignedObjectArray<int>	m_connectedFaces;
-	float	m_plane[4];
-};
-
-
-class btConvexPolyhedron
-{
-	public:
-	btConvexPolyhedron();
-	virtual	~btConvexPolyhedron();
-
-	btAlignedObjectArray<btVector3>	m_vertices;
-	btAlignedObjectArray<btFace>	m_faces;
-	btAlignedObjectArray<btVector3> m_uniqueEdges;
-	btVector3		m_localCenter;
-
-	void	initialize();
-
-	void project(const btTransform& trans, const btVector3& dir, float& min, float& max) const;
-};
-
-	
-#endif //_BT_POLYHEDRAL_FEATURES_H
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexShape.cpp
deleted file mode 100644
index f5f3aa5..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexShape.cpp
+++ /dev/null
@@ -1,429 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btConvexShape.h"
-#include "btTriangleShape.h"
-#include "btSphereShape.h"
-#include "btCylinderShape.h"
-#include "btCapsuleShape.h"
-#include "btConvexHullShape.h"
-#include "btConvexPointCloudShape.h"
-
-///not supported on IBM SDK, until we fix the alignment of btVector3
-#if defined (__CELLOS_LV2__) && defined (__SPU__)
-#include <spu_intrinsics.h>
-static inline vec_float4 vec_dot3( vec_float4 vec0, vec_float4 vec1 )
-{
-    vec_float4 result;
-    result = spu_mul( vec0, vec1 );
-    result = spu_madd( spu_rlqwbyte( vec0, 4 ), spu_rlqwbyte( vec1, 4 ), result );
-    return spu_madd( spu_rlqwbyte( vec0, 8 ), spu_rlqwbyte( vec1, 8 ), result );
-}
-#endif //__SPU__
-
-btConvexShape::btConvexShape ()
-{
-}
-
-btConvexShape::~btConvexShape()
-{
-
-}
-
-
-
-static btVector3 convexHullSupport (const btVector3& localDirOrg, const btVector3* points, int numPoints, const btVector3& localScaling)
-{	
-
-	btVector3 vec = localDirOrg * localScaling;
-
-#if defined (__CELLOS_LV2__) && defined (__SPU__)
-
-	btVector3 localDir = vec;
-
-	vec_float4 v_distMax = {-FLT_MAX,0,0,0};
-	vec_int4 v_idxMax = {-999,0,0,0};
-	int v=0;
-	int numverts = numPoints;
-
-	for(;v<(int)numverts-4;v+=4) {
-		vec_float4 p0 = vec_dot3(points[v  ].get128(),localDir.get128());
-		vec_float4 p1 = vec_dot3(points[v+1].get128(),localDir.get128());
-		vec_float4 p2 = vec_dot3(points[v+2].get128(),localDir.get128());
-		vec_float4 p3 = vec_dot3(points[v+3].get128(),localDir.get128());
-		const vec_int4 i0 = {v  ,0,0,0};
-		const vec_int4 i1 = {v+1,0,0,0};
-		const vec_int4 i2 = {v+2,0,0,0};
-		const vec_int4 i3 = {v+3,0,0,0};
-		vec_uint4  retGt01 = spu_cmpgt(p0,p1);
-		vec_float4 pmax01 = spu_sel(p1,p0,retGt01);
-		vec_int4   imax01 = spu_sel(i1,i0,retGt01);
-		vec_uint4  retGt23 = spu_cmpgt(p2,p3);
-		vec_float4 pmax23 = spu_sel(p3,p2,retGt23);
-		vec_int4   imax23 = spu_sel(i3,i2,retGt23);
-		vec_uint4  retGt0123 = spu_cmpgt(pmax01,pmax23);
-		vec_float4 pmax0123 = spu_sel(pmax23,pmax01,retGt0123);
-		vec_int4   imax0123 = spu_sel(imax23,imax01,retGt0123);
-		vec_uint4  retGtMax = spu_cmpgt(v_distMax,pmax0123);
-		v_distMax = spu_sel(pmax0123,v_distMax,retGtMax);
-		v_idxMax = spu_sel(imax0123,v_idxMax,retGtMax);
-	}
-	for(;v<(int)numverts;v++) {
-		vec_float4 p = vec_dot3(points[v].get128(),localDir.get128());
-		const vec_int4 i = {v,0,0,0};
-		vec_uint4  retGtMax = spu_cmpgt(v_distMax,p);
-		v_distMax = spu_sel(p,v_distMax,retGtMax);
-		v_idxMax = spu_sel(i,v_idxMax,retGtMax);
-	}
-	int ptIndex = spu_extract(v_idxMax,0);
-	const btVector3& supVec= points[ptIndex] * localScaling;
-	return supVec;
-#else
-
-	btScalar newDot,maxDot = btScalar(-BT_LARGE_FLOAT);
-	int ptIndex = -1;
-
-	for (int i=0;i<numPoints;i++)
-	{
-
-		newDot = vec.dot(points[i]);
-		if (newDot > maxDot)
-		{
-			maxDot = newDot;
-			ptIndex = i;
-		}
-	}
-	btAssert(ptIndex >= 0);
-	btVector3 supVec = points[ptIndex] * localScaling;
-	return supVec;
-#endif //__SPU__
-}
-
-btVector3 btConvexShape::localGetSupportVertexWithoutMarginNonVirtual (const btVector3& localDir) const
-{
-	switch (m_shapeType)
-	{
-    case SPHERE_SHAPE_PROXYTYPE:
-	{
-		return btVector3(0,0,0);
-    }
-	case BOX_SHAPE_PROXYTYPE:
-	{
-		btBoxShape* convexShape = (btBoxShape*)this;
-		const btVector3& halfExtents = convexShape->getImplicitShapeDimensions();
-
-		return btVector3(btFsels(localDir.x(), halfExtents.x(), -halfExtents.x()),
-			btFsels(localDir.y(), halfExtents.y(), -halfExtents.y()),
-			btFsels(localDir.z(), halfExtents.z(), -halfExtents.z()));
-	}
-	case TRIANGLE_SHAPE_PROXYTYPE:
-	{
-		btTriangleShape* triangleShape = (btTriangleShape*)this;
-		btVector3 dir(localDir.getX(),localDir.getY(),localDir.getZ());
-		btVector3* vertices = &triangleShape->m_vertices1[0];
-		btVector3 dots(dir.dot(vertices[0]), dir.dot(vertices[1]), dir.dot(vertices[2]));
-		btVector3 sup = vertices[dots.maxAxis()];
-		return btVector3(sup.getX(),sup.getY(),sup.getZ());
-	}
-	case CYLINDER_SHAPE_PROXYTYPE:
-	{
-		btCylinderShape* cylShape = (btCylinderShape*)this;
-		//mapping of halfextents/dimension onto radius/height depends on how cylinder local orientation is (upAxis)
-
-		btVector3 halfExtents = cylShape->getImplicitShapeDimensions();
-		btVector3 v(localDir.getX(),localDir.getY(),localDir.getZ());
-		int cylinderUpAxis = cylShape->getUpAxis();
-		int XX(1),YY(0),ZZ(2);
-
-		switch (cylinderUpAxis)
-		{
-		case 0:
-		{
-			XX = 1;
-			YY = 0;
-			ZZ = 2;
-		}
-		break;
-		case 1:
-		{
-			XX = 0;
-			YY = 1;
-			ZZ = 2;	
-		}
-		break;
-		case 2:
-		{
-			XX = 0;
-			YY = 2;
-			ZZ = 1;
-			
-		}
-		break;
-		default:
-			btAssert(0);
-		break;
-		};
-
-		btScalar radius = halfExtents[XX];
-		btScalar halfHeight = halfExtents[cylinderUpAxis];
-
-		btVector3 tmp;
-		btScalar d ;
-
-		btScalar s = btSqrt(v[XX] * v[XX] + v[ZZ] * v[ZZ]);
-		if (s != btScalar(0.0))
-		{
-			d = radius / s;  
-			tmp[XX] = v[XX] * d;
-			tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
-			tmp[ZZ] = v[ZZ] * d;
-			return btVector3(tmp.getX(),tmp.getY(),tmp.getZ());
-		} else {
-			tmp[XX] = radius;
-			tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
-			tmp[ZZ] = btScalar(0.0);
-			return btVector3(tmp.getX(),tmp.getY(),tmp.getZ());
-		}
-	}
-	case CAPSULE_SHAPE_PROXYTYPE:
-	{
-		btVector3 vec0(localDir.getX(),localDir.getY(),localDir.getZ());
-
-		btCapsuleShape* capsuleShape = (btCapsuleShape*)this;
-		btScalar halfHeight = capsuleShape->getHalfHeight();
-		int capsuleUpAxis = capsuleShape->getUpAxis();
-
-		btScalar radius = capsuleShape->getRadius();
-		btVector3 supVec(0,0,0);
-
-		btScalar maxDot(btScalar(-BT_LARGE_FLOAT));
-
-		btVector3 vec = vec0;
-		btScalar lenSqr = vec.length2();
-		if (lenSqr < btScalar(0.0001))
-		{
-			vec.setValue(1,0,0);
-		} else
-		{
-			btScalar rlen = btScalar(1.) / btSqrt(lenSqr );
-			vec *= rlen;
-		}
-		btVector3 vtx;
-		btScalar newDot;
-		{
-			btVector3 pos(0,0,0);
-			pos[capsuleUpAxis] = halfHeight;
-
-			//vtx = pos +vec*(radius);
-			vtx = pos +vec*capsuleShape->getLocalScalingNV()*(radius) - vec * capsuleShape->getMarginNV();
-			newDot = vec.dot(vtx);
-			
-
-			if (newDot > maxDot)
-			{
-				maxDot = newDot;
-				supVec = vtx;
-			}
-		}
-		{
-			btVector3 pos(0,0,0);
-			pos[capsuleUpAxis] = -halfHeight;
-
-			//vtx = pos +vec*(radius);
-			vtx = pos +vec*capsuleShape->getLocalScalingNV()*(radius) - vec * capsuleShape->getMarginNV();
-			newDot = vec.dot(vtx);
-			if (newDot > maxDot)
-			{
-				maxDot = newDot;
-				supVec = vtx;
-			}
-		}
-		return btVector3(supVec.getX(),supVec.getY(),supVec.getZ());	
-	}
-	case CONVEX_POINT_CLOUD_SHAPE_PROXYTYPE:
-	{
-		btConvexPointCloudShape* convexPointCloudShape = (btConvexPointCloudShape*)this;
-		btVector3* points = convexPointCloudShape->getUnscaledPoints ();
-		int numPoints = convexPointCloudShape->getNumPoints ();
-		return convexHullSupport (localDir, points, numPoints,convexPointCloudShape->getLocalScalingNV());
-	}
-	case CONVEX_HULL_SHAPE_PROXYTYPE:
-	{
-		btConvexHullShape* convexHullShape = (btConvexHullShape*)this;
-		btVector3* points = convexHullShape->getUnscaledPoints();
-		int numPoints = convexHullShape->getNumPoints ();
-		return convexHullSupport (localDir, points, numPoints,convexHullShape->getLocalScalingNV());
-	}
-    default:
-#ifndef __SPU__
-		return this->localGetSupportingVertexWithoutMargin (localDir);
-#else
-		btAssert (0);
-#endif
-	}
-
-	// should never reach here
-	btAssert (0);
-	return btVector3 (btScalar(0.0f), btScalar(0.0f), btScalar(0.0f));
-}
-
-btVector3 btConvexShape::localGetSupportVertexNonVirtual (const btVector3& localDir) const
-{
-	btVector3 localDirNorm = localDir;
-	if (localDirNorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
-	{
-		localDirNorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.));
-	}
-	localDirNorm.normalize ();
-
-	return localGetSupportVertexWithoutMarginNonVirtual(localDirNorm)+ getMarginNonVirtual() * localDirNorm;
-}
-
-/* TODO: This should be bumped up to btCollisionShape () */
-btScalar btConvexShape::getMarginNonVirtual () const
-{
-	switch (m_shapeType)
-	{
-    case SPHERE_SHAPE_PROXYTYPE:
-	{
-		btSphereShape* sphereShape = (btSphereShape*)this;
-		return sphereShape->getRadius ();
-	}
-	case BOX_SHAPE_PROXYTYPE:
-	{
-		btBoxShape* convexShape = (btBoxShape*)this;
-		return convexShape->getMarginNV ();
-	}
-	case TRIANGLE_SHAPE_PROXYTYPE:
-	{
-		btTriangleShape* triangleShape = (btTriangleShape*)this;
-		return triangleShape->getMarginNV ();
-	}
-	case CYLINDER_SHAPE_PROXYTYPE:
-	{
-		btCylinderShape* cylShape = (btCylinderShape*)this;
-		return cylShape->getMarginNV();
-	}
-	case CAPSULE_SHAPE_PROXYTYPE:
-	{
-		btCapsuleShape* capsuleShape = (btCapsuleShape*)this;
-		return capsuleShape->getMarginNV();
-	}
-	case CONVEX_POINT_CLOUD_SHAPE_PROXYTYPE:
-	/* fall through */
-	case CONVEX_HULL_SHAPE_PROXYTYPE:
-	{
-		btPolyhedralConvexShape* convexHullShape = (btPolyhedralConvexShape*)this;
-		return convexHullShape->getMarginNV();
-	}
-    default:
-#ifndef __SPU__
-		return this->getMargin ();
-#else
-		btAssert (0);
-#endif
-	}
-
-	// should never reach here
-	btAssert (0);
-	return btScalar(0.0f);
-}
-#ifndef __SPU__
-void btConvexShape::getAabbNonVirtual (const btTransform& t, btVector3& aabbMin, btVector3& aabbMax) const
-{
-	switch (m_shapeType)
-	{
-    case SPHERE_SHAPE_PROXYTYPE:
-	{
-		btSphereShape* sphereShape = (btSphereShape*)this;
-		btScalar radius = sphereShape->getImplicitShapeDimensions().getX();// * convexShape->getLocalScaling().getX();
-		btScalar margin = radius + sphereShape->getMarginNonVirtual();
-		const btVector3& center = t.getOrigin();
-		btVector3 extent(margin,margin,margin);
-		aabbMin = center - extent;
-		aabbMax = center + extent;
-    }
-	break;
-	case CYLINDER_SHAPE_PROXYTYPE:
-	/* fall through */
-	case BOX_SHAPE_PROXYTYPE:
-	{
-		btBoxShape* convexShape = (btBoxShape*)this;
-		btScalar margin=convexShape->getMarginNonVirtual();
-		btVector3 halfExtents = convexShape->getImplicitShapeDimensions();
-		halfExtents += btVector3(margin,margin,margin);
-		btMatrix3x3 abs_b = t.getBasis().absolute();  
-		btVector3 center = t.getOrigin();
-		btVector3 extent = btVector3(abs_b[0].dot(halfExtents),abs_b[1].dot(halfExtents),abs_b[2].dot(halfExtents));
-		
-		aabbMin = center - extent;
-		aabbMax = center + extent;
-		break;
-	}
-	case TRIANGLE_SHAPE_PROXYTYPE:
-	{
-		btTriangleShape* triangleShape = (btTriangleShape*)this;
-		btScalar margin = triangleShape->getMarginNonVirtual();
-		for (int i=0;i<3;i++)
-		{
-			btVector3 vec(btScalar(0.),btScalar(0.),btScalar(0.));
-			vec[i] = btScalar(1.);
-
-			btVector3 sv = localGetSupportVertexWithoutMarginNonVirtual(vec*t.getBasis());
-
-			btVector3 tmp = t(sv);
-			aabbMax[i] = tmp[i]+margin;
-			vec[i] = btScalar(-1.);
-			tmp = t(localGetSupportVertexWithoutMarginNonVirtual(vec*t.getBasis()));
-			aabbMin[i] = tmp[i]-margin;
-		}	
-	}
-	break;
-	case CAPSULE_SHAPE_PROXYTYPE:
-	{
-		btCapsuleShape* capsuleShape = (btCapsuleShape*)this;
-		btVector3 halfExtents(capsuleShape->getRadius(),capsuleShape->getRadius(),capsuleShape->getRadius());
-		int m_upAxis = capsuleShape->getUpAxis();
-		halfExtents[m_upAxis] = capsuleShape->getRadius() + capsuleShape->getHalfHeight();
-		halfExtents += btVector3(capsuleShape->getMarginNonVirtual(),capsuleShape->getMarginNonVirtual(),capsuleShape->getMarginNonVirtual());
-		btMatrix3x3 abs_b = t.getBasis().absolute();  
-		btVector3 center = t.getOrigin();
-		btVector3 extent = btVector3(abs_b[0].dot(halfExtents),abs_b[1].dot(halfExtents),abs_b[2].dot(halfExtents));		  	
-		aabbMin = center - extent;
-		aabbMax = center + extent;
-	}
-	break;
-	case CONVEX_POINT_CLOUD_SHAPE_PROXYTYPE:
-	case CONVEX_HULL_SHAPE_PROXYTYPE:
-	{
-		btPolyhedralConvexAabbCachingShape* convexHullShape = (btPolyhedralConvexAabbCachingShape*)this;
-		btScalar margin = convexHullShape->getMarginNonVirtual();
-		convexHullShape->getNonvirtualAabb (t, aabbMin, aabbMax, margin);
-	}
-	break;
-    default:
-#ifndef __SPU__
-		this->getAabb (t, aabbMin, aabbMax);
-#else
-		btAssert (0);
-#endif
-	break;
-	}
-
-	// should never reach here
-	btAssert (0);
-}
-
-#endif //__SPU__
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexShape.h
deleted file mode 100644
index cab4bb6..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexShape.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_CONVEX_SHAPE_INTERFACE1
-#define BT_CONVEX_SHAPE_INTERFACE1
-
-#include "btCollisionShape.h"
-
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btTransform.h"
-#include "LinearMath/btMatrix3x3.h"
-#include "btCollisionMargin.h"
-#include "LinearMath/btAlignedAllocator.h"
-
-#define MAX_PREFERRED_PENETRATION_DIRECTIONS 10
-
-/// The btConvexShape is an abstract shape interface, implemented by all convex shapes such as btBoxShape, btConvexHullShape etc.
-/// It describes general convex shapes using the localGetSupportingVertex interface, used by collision detectors such as btGjkPairDetector.
-ATTRIBUTE_ALIGNED16(class) btConvexShape : public btCollisionShape
-{
-
-
-public:
-
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-
-	btConvexShape ();
-
-	virtual ~btConvexShape();
-
-	virtual btVector3	localGetSupportingVertex(const btVector3& vec)const = 0;
-
-	////////
-	#ifndef __SPU__
-	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec) const=0;
-	#endif //#ifndef __SPU__
-
-	btVector3 localGetSupportVertexWithoutMarginNonVirtual (const btVector3& vec) const;
-	btVector3 localGetSupportVertexNonVirtual (const btVector3& vec) const;
-	btScalar getMarginNonVirtual () const;
-	void getAabbNonVirtual (const btTransform& t, btVector3& aabbMin, btVector3& aabbMax) const;
-
-	
-	//notice that the vectors should be unit length
-	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const= 0;
-
-	///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
-	void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const =0;
-
-	virtual void getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const =0;
-
-	virtual void	setLocalScaling(const btVector3& scaling) =0;
-	virtual const btVector3& getLocalScaling() const =0;
-
-	virtual void	setMargin(btScalar margin)=0;
-
-	virtual btScalar	getMargin() const=0;
-
-	virtual int		getNumPreferredPenetrationDirections() const=0;
-	
-	virtual void	getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const=0;
-
-
-	
-	
-};
-
-
-
-#endif //BT_CONVEX_SHAPE_INTERFACE1
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp
deleted file mode 100644
index 0f9ced5..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btConvexTriangleMeshShape.h"
-#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
-
-#include "LinearMath/btQuaternion.h"
-#include "BulletCollision/CollisionShapes/btStridingMeshInterface.h"
-
-
-btConvexTriangleMeshShape ::btConvexTriangleMeshShape (btStridingMeshInterface* meshInterface, bool calcAabb)
-: btPolyhedralConvexAabbCachingShape(), m_stridingMesh(meshInterface)
-{
-	m_shapeType = CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE;
-	if ( calcAabb )
-		recalcLocalAabb();
-}
-
-
-
-
-///It's not nice to have all this virtual function overhead, so perhaps we can also gather the points once
-///but then we are duplicating
-class LocalSupportVertexCallback: public btInternalTriangleIndexCallback
-{
-
-	btVector3 m_supportVertexLocal;
-public:
-
-	btScalar m_maxDot;
-	btVector3 m_supportVecLocal;
-
-	LocalSupportVertexCallback(const btVector3& supportVecLocal)
-		: m_supportVertexLocal(btScalar(0.),btScalar(0.),btScalar(0.)),
-		m_maxDot(btScalar(-BT_LARGE_FLOAT)),
-                m_supportVecLocal(supportVecLocal)
-	{
-	}
-
-	virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int  triangleIndex)
-	{
-		(void)triangleIndex;
-		(void)partId;
-
-		for (int i=0;i<3;i++)
-		{
-			btScalar dot = m_supportVecLocal.dot(triangle[i]);
-			if (dot > m_maxDot)
-			{
-				m_maxDot = dot;
-				m_supportVertexLocal = triangle[i];
-			}
-		}
-	}
-	
-	btVector3	GetSupportVertexLocal()
-	{
-		return m_supportVertexLocal;
-	}
-
-};
-
-
-
-
-
-btVector3	btConvexTriangleMeshShape::localGetSupportingVertexWithoutMargin(const btVector3& vec0)const
-{
-	btVector3 supVec(btScalar(0.),btScalar(0.),btScalar(0.));
-
-	btVector3 vec = vec0;
-	btScalar lenSqr = vec.length2();
-	if (lenSqr < btScalar(0.0001))
-	{
-		vec.setValue(1,0,0);
-	} else
-	{
-		btScalar rlen = btScalar(1.) / btSqrt(lenSqr );
-		vec *= rlen;
-	}
-
-	LocalSupportVertexCallback	supportCallback(vec);
-	btVector3 aabbMax(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
-	m_stridingMesh->InternalProcessAllTriangles(&supportCallback,-aabbMax,aabbMax);
-	supVec = supportCallback.GetSupportVertexLocal();
-
-	return supVec;
-}
-
-void	btConvexTriangleMeshShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
-{
-	//use 'w' component of supportVerticesOut?
-	{
-		for (int i=0;i<numVectors;i++)
-		{
-			supportVerticesOut[i][3] = btScalar(-BT_LARGE_FLOAT);
-		}
-	}
-	
-	///@todo: could do the batch inside the callback!
-
-
-	for (int j=0;j<numVectors;j++)
-	{
-		const btVector3& vec = vectors[j];
-		LocalSupportVertexCallback	supportCallback(vec);
-		btVector3 aabbMax(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
-		m_stridingMesh->InternalProcessAllTriangles(&supportCallback,-aabbMax,aabbMax);
-		supportVerticesOut[j] = supportCallback.GetSupportVertexLocal();
-	}
-	
-}
-	
-
-
-btVector3	btConvexTriangleMeshShape::localGetSupportingVertex(const btVector3& vec)const
-{
-	btVector3 supVertex = localGetSupportingVertexWithoutMargin(vec);
-
-	if ( getMargin()!=btScalar(0.) )
-	{
-		btVector3 vecnorm = vec;
-		if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
-		{
-			vecnorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.));
-		} 
-		vecnorm.normalize();
-		supVertex+= getMargin() * vecnorm;
-	}
-	return supVertex;
-}
-
-
-
-
-
-
-
-
-
-//currently just for debugging (drawing), perhaps future support for algebraic continuous collision detection
-//Please note that you can debug-draw btConvexTriangleMeshShape with the Raytracer Demo
-int	btConvexTriangleMeshShape::getNumVertices() const
-{
-	//cache this?
-	return 0;
-	
-}
-
-int btConvexTriangleMeshShape::getNumEdges() const
-{
-	return 0;
-}
-
-void btConvexTriangleMeshShape::getEdge(int ,btVector3& ,btVector3& ) const
-{
-	btAssert(0);	
-}
-
-void btConvexTriangleMeshShape::getVertex(int ,btVector3& ) const
-{
-	btAssert(0);
-}
-
-int	btConvexTriangleMeshShape::getNumPlanes() const
-{
-	return 0;
-}
-
-void btConvexTriangleMeshShape::getPlane(btVector3& ,btVector3& ,int  ) const
-{
-	btAssert(0);
-}
-
-//not yet
-bool btConvexTriangleMeshShape::isInside(const btVector3& ,btScalar ) const
-{
-	btAssert(0);
-	return false;
-}
-
-
-
-void	btConvexTriangleMeshShape::setLocalScaling(const btVector3& scaling)
-{
-	m_stridingMesh->setScaling(scaling);
-	
-	recalcLocalAabb();
-	
-}
-
-
-const btVector3& btConvexTriangleMeshShape::getLocalScaling() const
-{
-	return m_stridingMesh->getScaling();
-}
-
-void btConvexTriangleMeshShape::calculatePrincipalAxisTransform(btTransform& principal, btVector3& inertia, btScalar& volume) const
-{
-   class CenterCallback: public btInternalTriangleIndexCallback
-   {
-      bool first;
-      btVector3 ref;
-      btVector3 sum;
-      btScalar volume;
-
-   public:
-
-      CenterCallback() : first(true), ref(0, 0, 0), sum(0, 0, 0), volume(0)
-      {
-      }
-
-      virtual void internalProcessTriangleIndex(btVector3* triangle, int partId, int triangleIndex)
-      {
-         (void) triangleIndex;
-         (void) partId;
-         if (first)
-         {
-            ref = triangle[0];
-            first = false;
-         }
-         else
-         {
-            btScalar vol = btFabs((triangle[0] - ref).triple(triangle[1] - ref, triangle[2] - ref));
-            sum += (btScalar(0.25) * vol) * ((triangle[0] + triangle[1] + triangle[2] + ref));
-            volume += vol;
-         }
-      }
-      
-      btVector3 getCenter()
-      {
-         return (volume > 0) ? sum / volume : ref;
-      }
-
-      btScalar getVolume()
-      {
-         return volume * btScalar(1. / 6);
-      }
-
-   };
-
-   class InertiaCallback: public btInternalTriangleIndexCallback
-   {
-      btMatrix3x3 sum;
-      btVector3 center;
-
-   public:
-
-      InertiaCallback(btVector3& center) : sum(0, 0, 0, 0, 0, 0, 0, 0, 0), center(center)
-      {
-      }
-
-      virtual void internalProcessTriangleIndex(btVector3* triangle, int partId, int triangleIndex)
-      {
-         (void) triangleIndex;
-         (void) partId;
-         btMatrix3x3 i;
-         btVector3 a = triangle[0] - center;
-         btVector3 b = triangle[1] - center;
-         btVector3 c = triangle[2] - center;
-         btScalar volNeg = -btFabs(a.triple(b, c)) * btScalar(1. / 6);
-         for (int j = 0; j < 3; j++)
-         {
-            for (int k = 0; k <= j; k++)
-            {
-               i[j][k] = i[k][j] = volNeg * (btScalar(0.1) * (a[j] * a[k] + b[j] * b[k] + c[j] * c[k])
-                  + btScalar(0.05) * (a[j] * b[k] + a[k] * b[j] + a[j] * c[k] + a[k] * c[j] + b[j] * c[k] + b[k] * c[j]));
-            }
-         }
-         btScalar i00 = -i[0][0];
-         btScalar i11 = -i[1][1];
-         btScalar i22 = -i[2][2];
-         i[0][0] = i11 + i22; 
-         i[1][1] = i22 + i00; 
-         i[2][2] = i00 + i11;
-         sum[0] += i[0];
-         sum[1] += i[1];
-         sum[2] += i[2];
-      }
-      
-      btMatrix3x3& getInertia()
-      {
-         return sum;
-      }
-
-   };
-
-   CenterCallback centerCallback;
-   btVector3 aabbMax(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
-   m_stridingMesh->InternalProcessAllTriangles(&centerCallback, -aabbMax, aabbMax);
-   btVector3 center = centerCallback.getCenter();
-   principal.setOrigin(center);
-   volume = centerCallback.getVolume();
-
-   InertiaCallback inertiaCallback(center);
-   m_stridingMesh->InternalProcessAllTriangles(&inertiaCallback, -aabbMax, aabbMax);
-
-   btMatrix3x3& i = inertiaCallback.getInertia();
-   i.diagonalize(principal.getBasis(), btScalar(0.00001), 20);
-   inertia.setValue(i[0][0], i[1][1], i[2][2]);
-   inertia /= volume;
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h
deleted file mode 100644
index af5d003..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-#ifndef BT_CONVEX_TRIANGLEMESH_SHAPE_H
-#define BT_CONVEX_TRIANGLEMESH_SHAPE_H
-
-
-#include "btPolyhedralConvexShape.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
-
-
-/// The btConvexTriangleMeshShape is a convex hull of a triangle mesh, but the performance is not as good as btConvexHullShape.
-/// A small benefit of this class is that it uses the btStridingMeshInterface, so you can avoid the duplication of the triangle mesh data. Nevertheless, most users should use the much better performing btConvexHullShape instead.
-class btConvexTriangleMeshShape : public btPolyhedralConvexAabbCachingShape
-{
-
-	class btStridingMeshInterface*	m_stridingMesh;
-
-public:
-	btConvexTriangleMeshShape(btStridingMeshInterface* meshInterface, bool calcAabb = true);
-
-	class btStridingMeshInterface*	getMeshInterface()
-	{
-		return m_stridingMesh;
-	}
-	const class btStridingMeshInterface* getMeshInterface() const
-	{
-		return m_stridingMesh;
-	}
-	
-	virtual btVector3	localGetSupportingVertex(const btVector3& vec)const;
-	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
-	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
-	
-	//debugging
-	virtual const char*	getName()const {return "ConvexTrimesh";}
-	
-	virtual int	getNumVertices() const;
-	virtual int getNumEdges() const;
-	virtual void getEdge(int i,btVector3& pa,btVector3& pb) const;
-	virtual void getVertex(int i,btVector3& vtx) const;
-	virtual int	getNumPlanes() const;
-	virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i ) const;
-	virtual	bool isInside(const btVector3& pt,btScalar tolerance) const;
-
-	
-	virtual void	setLocalScaling(const btVector3& scaling);
-	virtual const btVector3& getLocalScaling() const;
-
-	///computes the exact moment of inertia and the transform from the coordinate system defined by the principal axes of the moment of inertia
-	///and the center of mass to the current coordinate system. A mass of 1 is assumed, for other masses just multiply the computed "inertia"
-	///by the mass. The resulting transform "principal" has to be applied inversely to the mesh in order for the local coordinate system of the
-	///shape to be centered at the center of mass and to coincide with the principal axes. This also necessitates a correction of the world transform
-	///of the collision object by the principal transform. This method also computes the volume of the convex mesh.
-	void calculatePrincipalAxisTransform(btTransform& principal, btVector3& inertia, btScalar& volume) const;
-
-};
-
-
-
-#endif //BT_CONVEX_TRIANGLEMESH_SHAPE_H
-
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCylinderShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCylinderShape.cpp
deleted file mode 100644
index c2e534b..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCylinderShape.cpp
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btCylinderShape.h"
-
-btCylinderShape::btCylinderShape (const btVector3& halfExtents)
-:btConvexInternalShape(),
-m_upAxis(1)
-{
-	btVector3 margin(getMargin(),getMargin(),getMargin());
-	m_implicitShapeDimensions = (halfExtents * m_localScaling) - margin;
-	m_shapeType = CYLINDER_SHAPE_PROXYTYPE;
-}
-
-
-btCylinderShapeX::btCylinderShapeX (const btVector3& halfExtents)
-:btCylinderShape(halfExtents)
-{
-	m_upAxis = 0;
-
-}
-
-
-btCylinderShapeZ::btCylinderShapeZ (const btVector3& halfExtents)
-:btCylinderShape(halfExtents)
-{
-	m_upAxis = 2;
-
-}
-
-void btCylinderShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
-{
-	btTransformAabb(getHalfExtentsWithoutMargin(),getMargin(),t,aabbMin,aabbMax);
-}
-
-void	btCylinderShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
-{
-
-//Until Bullet 2.77 a box approximation was used, so uncomment this if you need backwards compatibility
-//#define USE_BOX_INERTIA_APPROXIMATION 1
-#ifndef USE_BOX_INERTIA_APPROXIMATION
-
-	/*
-	cylinder is defined as following:
-	*
-	* - principle axis aligned along y by default, radius in x, z-value not used
-	* - for btCylinderShapeX: principle axis aligned along x, radius in y direction, z-value not used
-	* - for btCylinderShapeZ: principle axis aligned along z, radius in x direction, y-value not used
-	*
-	*/
-
-	btScalar radius2;	// square of cylinder radius
-	btScalar height2;	// square of cylinder height
-	btVector3 halfExtents = getHalfExtentsWithMargin();	// get cylinder dimension
-	btScalar div12 = mass / 12.f;
-	btScalar div4 = mass / 4.f;
-	btScalar div2 = mass / 2.f;
-	int idxRadius, idxHeight;
-
-	switch (m_upAxis)	// get indices of radius and height of cylinder
-	{
-		case 0:		// cylinder is aligned along x
-			idxRadius = 1;
-			idxHeight = 0;
-			break;
-		case 2:		// cylinder is aligned along z
-			idxRadius = 0;
-			idxHeight = 2;
-			break;
-		default:	// cylinder is aligned along y
-			idxRadius = 0;
-			idxHeight = 1;
-	}
-
-	// calculate squares
-	radius2 = halfExtents[idxRadius] * halfExtents[idxRadius];
-	height2 = btScalar(4.) * halfExtents[idxHeight] * halfExtents[idxHeight];
-
-	// calculate tensor terms
-	btScalar t1 = div12 * height2 + div4 * radius2;
-	btScalar t2 = div2 * radius2;
-
-	switch (m_upAxis)	// set diagonal elements of inertia tensor
-	{
-		case 0:		// cylinder is aligned along x
-			inertia.setValue(t2,t1,t1);
-			break;
-		case 2:		// cylinder is aligned along z
-			inertia.setValue(t1,t1,t2);
-			break;
-		default:	// cylinder is aligned along y
-			inertia.setValue(t1,t2,t1);
-	}
-#else //USE_BOX_INERTIA_APPROXIMATION
-	//approximation of box shape
-	btVector3 halfExtents = getHalfExtentsWithMargin();
-
-	btScalar lx=btScalar(2.)*(halfExtents.x());
-	btScalar ly=btScalar(2.)*(halfExtents.y());
-	btScalar lz=btScalar(2.)*(halfExtents.z());
-
-	inertia.setValue(mass/(btScalar(12.0)) * (ly*ly + lz*lz),
-					mass/(btScalar(12.0)) * (lx*lx + lz*lz),
-					mass/(btScalar(12.0)) * (lx*lx + ly*ly));
-#endif //USE_BOX_INERTIA_APPROXIMATION
-}
-
-
-SIMD_FORCE_INLINE btVector3 CylinderLocalSupportX(const btVector3& halfExtents,const btVector3& v) 
-{
-const int cylinderUpAxis = 0;
-const int XX = 1;
-const int YY = 0;
-const int ZZ = 2;
-
-	//mapping depends on how cylinder local orientation is
-	// extents of the cylinder is: X,Y is for radius, and Z for height
-
-
-	btScalar radius = halfExtents[XX];
-	btScalar halfHeight = halfExtents[cylinderUpAxis];
-
-
-    btVector3 tmp;
-	btScalar d ;
-
-    btScalar s = btSqrt(v[XX] * v[XX] + v[ZZ] * v[ZZ]);
-    if (s != btScalar(0.0))
-	{
-        d = radius / s;  
-		tmp[XX] = v[XX] * d;
-		tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
-		tmp[ZZ] = v[ZZ] * d;
-		return tmp;
-	}
-    else
-	{
-	    tmp[XX] = radius;
-		tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
-		tmp[ZZ] = btScalar(0.0);
-		return tmp;
-    }
-
-
-}
-
-
-
-
-
-
-inline  btVector3 CylinderLocalSupportY(const btVector3& halfExtents,const btVector3& v) 
-{
-
-const int cylinderUpAxis = 1;
-const int XX = 0;
-const int YY = 1;
-const int ZZ = 2;
-
-
-	btScalar radius = halfExtents[XX];
-	btScalar halfHeight = halfExtents[cylinderUpAxis];
-
-
-    btVector3 tmp;
-	btScalar d ;
-
-    btScalar s = btSqrt(v[XX] * v[XX] + v[ZZ] * v[ZZ]);
-    if (s != btScalar(0.0))
-	{
-        d = radius / s;  
-		tmp[XX] = v[XX] * d;
-		tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
-		tmp[ZZ] = v[ZZ] * d;
-		return tmp;
-	}
-    else
-	{
-	    tmp[XX] = radius;
-		tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
-		tmp[ZZ] = btScalar(0.0);
-		return tmp;
-    }
-
-}
-
-inline btVector3 CylinderLocalSupportZ(const btVector3& halfExtents,const btVector3& v) 
-{
-const int cylinderUpAxis = 2;
-const int XX = 0;
-const int YY = 2;
-const int ZZ = 1;
-
-	//mapping depends on how cylinder local orientation is
-	// extents of the cylinder is: X,Y is for radius, and Z for height
-
-
-	btScalar radius = halfExtents[XX];
-	btScalar halfHeight = halfExtents[cylinderUpAxis];
-
-
-    btVector3 tmp;
-	btScalar d ;
-
-    btScalar s = btSqrt(v[XX] * v[XX] + v[ZZ] * v[ZZ]);
-    if (s != btScalar(0.0))
-	{
-        d = radius / s;  
-		tmp[XX] = v[XX] * d;
-		tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
-		tmp[ZZ] = v[ZZ] * d;
-		return tmp;
-	}
-    else
-	{
-	    tmp[XX] = radius;
-		tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
-		tmp[ZZ] = btScalar(0.0);
-		return tmp;
-    }
-
-
-}
-
-btVector3	btCylinderShapeX::localGetSupportingVertexWithoutMargin(const btVector3& vec)const
-{
-	return CylinderLocalSupportX(getHalfExtentsWithoutMargin(),vec);
-}
-
-
-btVector3	btCylinderShapeZ::localGetSupportingVertexWithoutMargin(const btVector3& vec)const
-{
-	return CylinderLocalSupportZ(getHalfExtentsWithoutMargin(),vec);
-}
-btVector3	btCylinderShape::localGetSupportingVertexWithoutMargin(const btVector3& vec)const
-{
-	return CylinderLocalSupportY(getHalfExtentsWithoutMargin(),vec);
-}
-
-void	btCylinderShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
-{
-	for (int i=0;i<numVectors;i++)
-	{
-		supportVerticesOut[i] = CylinderLocalSupportY(getHalfExtentsWithoutMargin(),vectors[i]);
-	}
-}
-
-void	btCylinderShapeZ::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
-{
-	for (int i=0;i<numVectors;i++)
-	{
-		supportVerticesOut[i] = CylinderLocalSupportZ(getHalfExtentsWithoutMargin(),vectors[i]);
-	}
-}
-
-
-
-
-void	btCylinderShapeX::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
-{
-	for (int i=0;i<numVectors;i++)
-	{
-		supportVerticesOut[i] = CylinderLocalSupportX(getHalfExtentsWithoutMargin(),vectors[i]);
-	}
-}
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCylinderShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCylinderShape.h
deleted file mode 100644
index 125bfc7..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCylinderShape.h
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_CYLINDER_MINKOWSKI_H
-#define BT_CYLINDER_MINKOWSKI_H
-
-#include "btBoxShape.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
-#include "LinearMath/btVector3.h"
-
-/// The btCylinderShape class implements a cylinder shape primitive, centered around the origin. Its central axis aligned with the Y axis. btCylinderShapeX is aligned with the X axis and btCylinderShapeZ around the Z axis.
-class btCylinderShape : public btConvexInternalShape
-
-{
-
-protected:
-
-	int	m_upAxis;
-
-public:
-
-	btVector3 getHalfExtentsWithMargin() const
-	{
-		btVector3 halfExtents = getHalfExtentsWithoutMargin();
-		btVector3 margin(getMargin(),getMargin(),getMargin());
-		halfExtents += margin;
-		return halfExtents;
-	}
-	
-	const btVector3& getHalfExtentsWithoutMargin() const
-	{
-		return m_implicitShapeDimensions;//changed in Bullet 2.63: assume the scaling and margin are included
-	}
-
-	btCylinderShape (const btVector3& halfExtents);
-	
-	void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
-
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
-
-	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
-
-	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
-
-	virtual void setMargin(btScalar collisionMargin)
-	{
-		//correct the m_implicitShapeDimensions for the margin
-		btVector3 oldMargin(getMargin(),getMargin(),getMargin());
-		btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions+oldMargin;
-		
-		btConvexInternalShape::setMargin(collisionMargin);
-		btVector3 newMargin(getMargin(),getMargin(),getMargin());
-		m_implicitShapeDimensions = implicitShapeDimensionsWithMargin - newMargin;
-
-	}
-
-	virtual btVector3	localGetSupportingVertex(const btVector3& vec) const
-	{
-
-		btVector3 supVertex;
-		supVertex = localGetSupportingVertexWithoutMargin(vec);
-		
-		if ( getMargin()!=btScalar(0.) )
-		{
-			btVector3 vecnorm = vec;
-			if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
-			{
-				vecnorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.));
-			} 
-			vecnorm.normalize();
-			supVertex+= getMargin() * vecnorm;
-		}
-		return supVertex;
-	}
-
-
-	//use box inertia
-	//	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
-
-
-	int	getUpAxis() const
-	{
-		return m_upAxis;
-	}
-
-	virtual btScalar getRadius() const
-	{
-		return getHalfExtentsWithMargin().getX();
-	}
-
-	virtual void	setLocalScaling(const btVector3& scaling)
-	{
-		btVector3 oldMargin(getMargin(),getMargin(),getMargin());
-		btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions+oldMargin;
-		btVector3 unScaledImplicitShapeDimensionsWithMargin = implicitShapeDimensionsWithMargin / m_localScaling;
-
-		btConvexInternalShape::setLocalScaling(scaling);
-
-		m_implicitShapeDimensions = (unScaledImplicitShapeDimensionsWithMargin * m_localScaling) - oldMargin;
-
-	}
-
-	//debugging
-	virtual const char*	getName()const
-	{
-		return "CylinderY";
-	}
-
-	virtual	int	calculateSerializeBufferSize() const;
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
-
-};
-
-class btCylinderShapeX : public btCylinderShape
-{
-public:
-	btCylinderShapeX (const btVector3& halfExtents);
-
-	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
-	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
-	
-		//debugging
-	virtual const char*	getName()const
-	{
-		return "CylinderX";
-	}
-
-	virtual btScalar getRadius() const
-	{
-		return getHalfExtentsWithMargin().getY();
-	}
-
-};
-
-class btCylinderShapeZ : public btCylinderShape
-{
-public:
-	btCylinderShapeZ (const btVector3& halfExtents);
-
-	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
-	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
-
-		//debugging
-	virtual const char*	getName()const
-	{
-		return "CylinderZ";
-	}
-
-	virtual btScalar getRadius() const
-	{
-		return getHalfExtentsWithMargin().getX();
-	}
-
-};
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btCylinderShapeData
-{
-	btConvexInternalShapeData	m_convexInternalShapeData;
-
-	int	m_upAxis;
-
-	char	m_padding[4];
-};
-
-SIMD_FORCE_INLINE	int	btCylinderShape::calculateSerializeBufferSize() const
-{
-	return sizeof(btCylinderShapeData);
-}
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-SIMD_FORCE_INLINE	const char*	btCylinderShape::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-	btCylinderShapeData* shapeData = (btCylinderShapeData*) dataBuffer;
-	
-	btConvexInternalShape::serialize(&shapeData->m_convexInternalShapeData,serializer);
-
-	shapeData->m_upAxis = m_upAxis;
-	
-	return "btCylinderShapeData";
-}
-
-
-
-#endif //BT_CYLINDER_MINKOWSKI_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btEmptyShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btEmptyShape.cpp
deleted file mode 100644
index a9e6df5..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btEmptyShape.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btEmptyShape.h"
-
-
-#include "btCollisionShape.h"
-
-
-btEmptyShape::btEmptyShape() : btConcaveShape ()
-{
-	m_shapeType = EMPTY_SHAPE_PROXYTYPE;
-}
-
-
-btEmptyShape::~btEmptyShape()
-{
-}
-
-
-	///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
-void btEmptyShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
-{
-	btVector3 margin(getMargin(),getMargin(),getMargin());
-
-	aabbMin = t.getOrigin() - margin;
-
-	aabbMax = t.getOrigin() + margin;
-
-}
-
-void	btEmptyShape::calculateLocalInertia(btScalar ,btVector3& ) const
-{
-	btAssert(0);
-}
-
-	
-	
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btEmptyShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btEmptyShape.h
deleted file mode 100644
index 87b7b66..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btEmptyShape.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_EMPTY_SHAPE_H
-#define BT_EMPTY_SHAPE_H
-
-#include "btConcaveShape.h"
-
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btTransform.h"
-#include "LinearMath/btMatrix3x3.h"
-#include "btCollisionMargin.h"
-
-
-
-
-/// The btEmptyShape is a collision shape without actual collision detection shape, so most users should ignore this class.
-/// It can be replaced by another shape during runtime, but the inertia tensor should be recomputed.
-class btEmptyShape	: public btConcaveShape
-{
-public:
-	btEmptyShape();
-
-	virtual ~btEmptyShape();
-
-
-	///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
-	void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
-
-
-	virtual void	setLocalScaling(const btVector3& scaling)
-	{
-		m_localScaling = scaling;
-	}
-	virtual const btVector3& getLocalScaling() const 
-	{
-		return m_localScaling;
-	}
-
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
-	
-	virtual const char*	getName()const
-	{
-		return "Empty";
-	}
-
-	virtual void processAllTriangles(btTriangleCallback* ,const btVector3& ,const btVector3& ) const
-	{
-	}
-
-protected:
-	btVector3	m_localScaling;
-
-};
-
-
-
-#endif //BT_EMPTY_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp
deleted file mode 100644
index 3a1e6f4..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btHeightfieldTerrainShape.h"
-
-#include "LinearMath/btTransformUtil.h"
-
-
-
-btHeightfieldTerrainShape::btHeightfieldTerrainShape
-(
-int heightStickWidth, int heightStickLength, void* heightfieldData,
-btScalar heightScale, btScalar minHeight, btScalar maxHeight,int upAxis,
-PHY_ScalarType hdt, bool flipQuadEdges
-)
-{
-	initialize(heightStickWidth, heightStickLength, heightfieldData,
-	           heightScale, minHeight, maxHeight, upAxis, hdt,
-	           flipQuadEdges);
-}
-
-
-
-btHeightfieldTerrainShape::btHeightfieldTerrainShape(int heightStickWidth, int heightStickLength,void* heightfieldData,btScalar maxHeight,int upAxis,bool useFloatData,bool flipQuadEdges)
-{
-	// legacy constructor: support only float or unsigned char,
-	// 	and min height is zero
-	PHY_ScalarType hdt = (useFloatData) ? PHY_FLOAT : PHY_UCHAR;
-	btScalar minHeight = 0.0;
-
-	// previously, height = uchar * maxHeight / 65535.
-	// So to preserve legacy behavior, heightScale = maxHeight / 65535
-	btScalar heightScale = maxHeight / 65535;
-
-	initialize(heightStickWidth, heightStickLength, heightfieldData,
-	           heightScale, minHeight, maxHeight, upAxis, hdt,
-	           flipQuadEdges);
-}
-
-
-
-void btHeightfieldTerrainShape::initialize
-(
-int heightStickWidth, int heightStickLength, void* heightfieldData,
-btScalar heightScale, btScalar minHeight, btScalar maxHeight, int upAxis,
-PHY_ScalarType hdt, bool flipQuadEdges
-)
-{
-	// validation
-	btAssert(heightStickWidth > 1 && "bad width");
-	btAssert(heightStickLength > 1 && "bad length");
-	btAssert(heightfieldData && "null heightfield data");
-	// btAssert(heightScale) -- do we care?  Trust caller here
-	btAssert(minHeight <= maxHeight && "bad min/max height");
-	btAssert(upAxis >= 0 && upAxis < 3 &&
-	    "bad upAxis--should be in range [0,2]");
-	btAssert(hdt != PHY_UCHAR || hdt != PHY_FLOAT || hdt != PHY_SHORT &&
-	    "Bad height data type enum");
-
-	// initialize member variables
-	m_shapeType = TERRAIN_SHAPE_PROXYTYPE;
-	m_heightStickWidth = heightStickWidth;
-	m_heightStickLength = heightStickLength;
-	m_minHeight = minHeight;
-	m_maxHeight = maxHeight;
-	m_width = (btScalar) (heightStickWidth - 1);
-	m_length = (btScalar) (heightStickLength - 1);
-	m_heightScale = heightScale;
-	m_heightfieldDataUnknown = heightfieldData;
-	m_heightDataType = hdt;
-	m_flipQuadEdges = flipQuadEdges;
-	m_useDiamondSubdivision = false;
-	m_upAxis = upAxis;
-	m_localScaling.setValue(btScalar(1.), btScalar(1.), btScalar(1.));
-
-	// determine min/max axis-aligned bounding box (aabb) values
-	switch (m_upAxis)
-	{
-	case 0:
-		{
-			m_localAabbMin.setValue(m_minHeight, 0, 0);
-			m_localAabbMax.setValue(m_maxHeight, m_width, m_length);
-			break;
-		}
-	case 1:
-		{
-			m_localAabbMin.setValue(0, m_minHeight, 0);
-			m_localAabbMax.setValue(m_width, m_maxHeight, m_length);
-			break;
-		};
-	case 2:
-		{
-			m_localAabbMin.setValue(0, 0, m_minHeight);
-			m_localAabbMax.setValue(m_width, m_length, m_maxHeight);
-			break;
-		}
-	default:
-		{
-			//need to get valid m_upAxis
-			btAssert(0 && "Bad m_upAxis");
-		}
-	}
-
-	// remember origin (defined as exact middle of aabb)
-	m_localOrigin = btScalar(0.5) * (m_localAabbMin + m_localAabbMax);
-}
-
-
-
-btHeightfieldTerrainShape::~btHeightfieldTerrainShape()
-{
-}
-
-
-
-void btHeightfieldTerrainShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
-{
-	btVector3 halfExtents = (m_localAabbMax-m_localAabbMin)* m_localScaling * btScalar(0.5);
-
-	btVector3 localOrigin(0, 0, 0);
-	localOrigin[m_upAxis] = (m_minHeight + m_maxHeight) * btScalar(0.5);
-	localOrigin *= m_localScaling;
-
-	btMatrix3x3 abs_b = t.getBasis().absolute();  
-	btVector3 center = t.getOrigin();
-	btVector3 extent = btVector3(abs_b[0].dot(halfExtents),
-		   abs_b[1].dot(halfExtents),
-		  abs_b[2].dot(halfExtents));
-	extent += btVector3(getMargin(),getMargin(),getMargin());
-
-	aabbMin = center - extent;
-	aabbMax = center + extent;
-}
-
-
-/// This returns the "raw" (user's initial) height, not the actual height.
-/// The actual height needs to be adjusted to be relative to the center
-///   of the heightfield's AABB.
-btScalar
-btHeightfieldTerrainShape::getRawHeightFieldValue(int x,int y) const
-{
-	btScalar val = 0.f;
-	switch (m_heightDataType)
-	{
-	case PHY_FLOAT:
-		{
-			val = m_heightfieldDataFloat[(y*m_heightStickWidth)+x];
-			break;
-		}
-
-	case PHY_UCHAR:
-		{
-			unsigned char heightFieldValue = m_heightfieldDataUnsignedChar[(y*m_heightStickWidth)+x];
-			val = heightFieldValue * m_heightScale;
-			break;
-		}
-
-	case PHY_SHORT:
-		{
-			short hfValue = m_heightfieldDataShort[(y * m_heightStickWidth) + x];
-			val = hfValue * m_heightScale;
-			break;
-		}
-
-	default:
-		{
-			btAssert(!"Bad m_heightDataType");
-		}
-	}
-
-	return val;
-}
-
-
-
-
-/// this returns the vertex in bullet-local coordinates
-void	btHeightfieldTerrainShape::getVertex(int x,int y,btVector3& vertex) const
-{
-	btAssert(x>=0);
-	btAssert(y>=0);
-	btAssert(x<m_heightStickWidth);
-	btAssert(y<m_heightStickLength);
-
-	btScalar	height = getRawHeightFieldValue(x,y);
-
-	switch (m_upAxis)
-	{
-	case 0:
-		{
-		vertex.setValue(
-			height - m_localOrigin.getX(),
-			(-m_width/btScalar(2.0)) + x,
-			(-m_length/btScalar(2.0) ) + y
-			);
-			break;
-		}
-	case 1:
-		{
-			vertex.setValue(
-			(-m_width/btScalar(2.0)) + x,
-			height - m_localOrigin.getY(),
-			(-m_length/btScalar(2.0)) + y
-			);
-			break;
-		};
-	case 2:
-		{
-			vertex.setValue(
-			(-m_width/btScalar(2.0)) + x,
-			(-m_length/btScalar(2.0)) + y,
-			height - m_localOrigin.getZ()
-			);
-			break;
-		}
-	default:
-		{
-			//need to get valid m_upAxis
-			btAssert(0);
-		}
-	}
-
-	vertex*=m_localScaling;
-}
-
-
-
-static inline int
-getQuantized
-(
-btScalar x
-)
-{
-	if (x < 0.0) {
-		return (int) (x - 0.5);
-	}
-	return (int) (x + 0.5);
-}
-
-
-
-/// given input vector, return quantized version
-/**
-  This routine is basically determining the gridpoint indices for a given
-  input vector, answering the question: "which gridpoint is closest to the
-  provided point?".
-
-  "with clamp" means that we restrict the point to be in the heightfield's
-  axis-aligned bounding box.
- */
-void btHeightfieldTerrainShape::quantizeWithClamp(int* out, const btVector3& point,int /*isMax*/) const
-{
-	btVector3 clampedPoint(point);
-	clampedPoint.setMax(m_localAabbMin);
-	clampedPoint.setMin(m_localAabbMax);
-
-	out[0] = getQuantized(clampedPoint.getX());
-	out[1] = getQuantized(clampedPoint.getY());
-	out[2] = getQuantized(clampedPoint.getZ());
-		
-}
-
-
-
-/// process all triangles within the provided axis-aligned bounding box
-/**
-  basic algorithm:
-    - convert input aabb to local coordinates (scale down and shift for local origin)
-    - convert input aabb to a range of heightfield grid points (quantize)
-    - iterate over all triangles in that subset of the grid
- */
-void	btHeightfieldTerrainShape::processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const
-{
-	// scale down the input aabb's so they are in local (non-scaled) coordinates
-	btVector3	localAabbMin = aabbMin*btVector3(1.f/m_localScaling[0],1.f/m_localScaling[1],1.f/m_localScaling[2]);
-	btVector3	localAabbMax = aabbMax*btVector3(1.f/m_localScaling[0],1.f/m_localScaling[1],1.f/m_localScaling[2]);
-
-	// account for local origin
-	localAabbMin += m_localOrigin;
-	localAabbMax += m_localOrigin;
-
-	//quantize the aabbMin and aabbMax, and adjust the start/end ranges
-	int	quantizedAabbMin[3];
-	int	quantizedAabbMax[3];
-	quantizeWithClamp(quantizedAabbMin, localAabbMin,0);
-	quantizeWithClamp(quantizedAabbMax, localAabbMax,1);
-	
-	// expand the min/max quantized values
-	// this is to catch the case where the input aabb falls between grid points!
-	for (int i = 0; i < 3; ++i) {
-		quantizedAabbMin[i]--;
-		quantizedAabbMax[i]++;
-	}	
-
-	int startX=0;
-	int endX=m_heightStickWidth-1;
-	int startJ=0;
-	int endJ=m_heightStickLength-1;
-
-	switch (m_upAxis)
-	{
-	case 0:
-		{
-			if (quantizedAabbMin[1]>startX)
-				startX = quantizedAabbMin[1];
-			if (quantizedAabbMax[1]<endX)
-				endX = quantizedAabbMax[1];
-			if (quantizedAabbMin[2]>startJ)
-				startJ = quantizedAabbMin[2];
-			if (quantizedAabbMax[2]<endJ)
-				endJ = quantizedAabbMax[2];
-			break;
-		}
-	case 1:
-		{
-			if (quantizedAabbMin[0]>startX)
-				startX = quantizedAabbMin[0];
-			if (quantizedAabbMax[0]<endX)
-				endX = quantizedAabbMax[0];
-			if (quantizedAabbMin[2]>startJ)
-				startJ = quantizedAabbMin[2];
-			if (quantizedAabbMax[2]<endJ)
-				endJ = quantizedAabbMax[2];
-			break;
-		};
-	case 2:
-		{
-			if (quantizedAabbMin[0]>startX)
-				startX = quantizedAabbMin[0];
-			if (quantizedAabbMax[0]<endX)
-				endX = quantizedAabbMax[0];
-			if (quantizedAabbMin[1]>startJ)
-				startJ = quantizedAabbMin[1];
-			if (quantizedAabbMax[1]<endJ)
-				endJ = quantizedAabbMax[1];
-			break;
-		}
-	default:
-		{
-			//need to get valid m_upAxis
-			btAssert(0);
-		}
-	}
-
-	
-  
-
-	for(int j=startJ; j<endJ; j++)
-	{
-		for(int x=startX; x<endX; x++)
-		{
-			btVector3 vertices[3];
-			if (m_flipQuadEdges || (m_useDiamondSubdivision && !((j+x) & 1)))
-			{
-        //first triangle
-        getVertex(x,j,vertices[0]);
-        getVertex(x+1,j,vertices[1]);
-        getVertex(x+1,j+1,vertices[2]);
-        callback->processTriangle(vertices,x,j);
-        //second triangle
-        getVertex(x,j,vertices[0]);
-        getVertex(x+1,j+1,vertices[1]);
-        getVertex(x,j+1,vertices[2]);
-        callback->processTriangle(vertices,x,j);				
-			} else
-			{
-        //first triangle
-        getVertex(x,j,vertices[0]);
-        getVertex(x,j+1,vertices[1]);
-        getVertex(x+1,j,vertices[2]);
-        callback->processTriangle(vertices,x,j);
-        //second triangle
-        getVertex(x+1,j,vertices[0]);
-        getVertex(x,j+1,vertices[1]);
-        getVertex(x+1,j+1,vertices[2]);
-        callback->processTriangle(vertices,x,j);
-			}
-		}
-	}
-
-	
-
-}
-
-void	btHeightfieldTerrainShape::calculateLocalInertia(btScalar ,btVector3& inertia) const
-{
-	//moving concave objects not supported
-	
-	inertia.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
-}
-
-void	btHeightfieldTerrainShape::setLocalScaling(const btVector3& scaling)
-{
-	m_localScaling = scaling;
-}
-const btVector3& btHeightfieldTerrainShape::getLocalScaling() const
-{
-	return m_localScaling;
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h
deleted file mode 100644
index 710c29e..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_HEIGHTFIELD_TERRAIN_SHAPE_H
-#define BT_HEIGHTFIELD_TERRAIN_SHAPE_H
-
-#include "btConcaveShape.h"
-
-///btHeightfieldTerrainShape simulates a 2D heightfield terrain
-/**
-  The caller is responsible for maintaining the heightfield array; this
-  class does not make a copy.
-
-  The heightfield can be dynamic so long as the min/max height values
-  capture the extremes (heights must always be in that range).
-
-  The local origin of the heightfield is assumed to be the exact
-  center (as determined by width and length and height, with each
-  axis multiplied by the localScaling).
-
-  \b NOTE: be careful with coordinates.  If you have a heightfield with a local
-  min height of -100m, and a max height of +500m, you may be tempted to place it
-  at the origin (0,0) and expect the heights in world coordinates to be
-  -100 to +500 meters.
-  Actually, the heights will be -300 to +300m, because bullet will re-center
-  the heightfield based on its AABB (which is determined by the min/max
-  heights).  So keep in mind that once you create a btHeightfieldTerrainShape
-  object, the heights will be adjusted relative to the center of the AABB.  This
-  is different to the behavior of many rendering engines, but is useful for
-  physics engines.
-
-  Most (but not all) rendering and heightfield libraries assume upAxis = 1
-  (that is, the y-axis is "up").  This class allows any of the 3 coordinates
-  to be "up".  Make sure your choice of axis is consistent with your rendering
-  system.
-
-  The heightfield heights are determined from the data type used for the
-  heightfieldData array.  
-
-   - PHY_UCHAR: height at a point is the uchar value at the
-       grid point, multipled by heightScale.  uchar isn't recommended
-       because of its inability to deal with negative values, and
-       low resolution (8-bit).
-
-   - PHY_SHORT: height at a point is the short int value at that grid
-       point, multipled by heightScale.
-
-   - PHY_FLOAT: height at a point is the float value at that grid
-       point.  heightScale is ignored when using the float heightfield
-       data type.
-
-  Whatever the caller specifies as minHeight and maxHeight will be honored.
-  The class will not inspect the heightfield to discover the actual minimum
-  or maximum heights.  These values are used to determine the heightfield's
-  axis-aligned bounding box, multiplied by localScaling.
-
-  For usage and testing see the TerrainDemo.
- */
-class btHeightfieldTerrainShape : public btConcaveShape
-{
-protected:
-	btVector3	m_localAabbMin;
-	btVector3	m_localAabbMax;
-	btVector3	m_localOrigin;
-
-	///terrain data
-	int	m_heightStickWidth;
-	int m_heightStickLength;
-	btScalar	m_minHeight;
-	btScalar	m_maxHeight;
-	btScalar m_width;
-	btScalar m_length;
-	btScalar m_heightScale;
-	union
-	{
-		unsigned char*	m_heightfieldDataUnsignedChar;
-		short*		m_heightfieldDataShort;
-		btScalar*			m_heightfieldDataFloat;
-		void*			m_heightfieldDataUnknown;
-	};
-
-	PHY_ScalarType	m_heightDataType;	
-	bool	m_flipQuadEdges;
-  bool  m_useDiamondSubdivision;
-
-	int	m_upAxis;
-	
-	btVector3	m_localScaling;
-
-	virtual btScalar	getRawHeightFieldValue(int x,int y) const;
-	void		quantizeWithClamp(int* out, const btVector3& point,int isMax) const;
-	void		getVertex(int x,int y,btVector3& vertex) const;
-
-
-
-	/// protected initialization
-	/**
-	  Handles the work of constructors so that public constructors can be
-	  backwards-compatible without a lot of copy/paste.
-	 */
-	void initialize(int heightStickWidth, int heightStickLength,
-	                void* heightfieldData, btScalar heightScale,
-	                btScalar minHeight, btScalar maxHeight, int upAxis,
-	                PHY_ScalarType heightDataType, bool flipQuadEdges);
-
-public:
-	/// preferred constructor
-	/**
-	  This constructor supports a range of heightfield
-	  data types, and allows for a non-zero minimum height value.
-	  heightScale is needed for any integer-based heightfield data types.
-	 */
-	btHeightfieldTerrainShape(int heightStickWidth,int heightStickLength,
-	                          void* heightfieldData, btScalar heightScale,
-	                          btScalar minHeight, btScalar maxHeight,
-	                          int upAxis, PHY_ScalarType heightDataType,
-	                          bool flipQuadEdges);
-
-	/// legacy constructor
-	/**
-	  The legacy constructor assumes the heightfield has a minimum height
-	  of zero.  Only unsigned char or floats are supported.  For legacy
-	  compatibility reasons, heightScale is calculated as maxHeight / 65535 
-	  (and is only used when useFloatData = false).
- 	 */
-	btHeightfieldTerrainShape(int heightStickWidth,int heightStickLength,void* heightfieldData, btScalar maxHeight,int upAxis,bool useFloatData,bool flipQuadEdges);
-
-	virtual ~btHeightfieldTerrainShape();
-
-
-	void setUseDiamondSubdivision(bool useDiamondSubdivision=true) { m_useDiamondSubdivision = useDiamondSubdivision;}
-
-
-	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
-
-	virtual void	processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const;
-
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
-
-	virtual void	setLocalScaling(const btVector3& scaling);
-	
-	virtual const btVector3& getLocalScaling() const;
-	
-	//debugging
-	virtual const char*	getName()const {return "HEIGHTFIELD";}
-
-};
-
-#endif //BT_HEIGHTFIELD_TERRAIN_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMaterial.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMaterial.h
deleted file mode 100644
index 866f9b4..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMaterial.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-/// This file was created by Alex Silverman
-
-#ifndef BT_MATERIAL_H
-#define BT_MATERIAL_H
-
-// Material class to be used by btMultimaterialTriangleMeshShape to store triangle properties
-class btMaterial
-{
-    // public members so that materials can change due to world events
-public:
-    btScalar m_friction;
-    btScalar m_restitution;
-    int pad[2];
-
-    btMaterial(){}
-    btMaterial(btScalar fric, btScalar rest) { m_friction = fric; m_restitution = rest; }
-};
-
-#endif // BT_MATERIAL_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp
deleted file mode 100644
index 06707e2..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "btMinkowskiSumShape.h"
-
-
-btMinkowskiSumShape::btMinkowskiSumShape(const btConvexShape* shapeA,const btConvexShape* shapeB)
-: btConvexInternalShape (),
-m_shapeA(shapeA),
-m_shapeB(shapeB)
-{
-	m_shapeType = MINKOWSKI_DIFFERENCE_SHAPE_PROXYTYPE;
-	m_transA.setIdentity();
-	m_transB.setIdentity();
-}
-
-btVector3 btMinkowskiSumShape::localGetSupportingVertexWithoutMargin(const btVector3& vec)const
-{
-	btVector3 supVertexA = m_transA(m_shapeA->localGetSupportingVertexWithoutMargin(vec*m_transA.getBasis()));
-	btVector3 supVertexB = m_transB(m_shapeB->localGetSupportingVertexWithoutMargin(-vec*m_transB.getBasis()));
-	return  supVertexA - supVertexB;
-}
-
-void	btMinkowskiSumShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
-{
-	///@todo: could make recursive use of batching. probably this shape is not used frequently.
-	for (int i=0;i<numVectors;i++)
-	{
-		supportVerticesOut[i] = localGetSupportingVertexWithoutMargin(vectors[i]);
-	}
-
-}
-
-
-
-btScalar	btMinkowskiSumShape::getMargin() const
-{
-	return m_shapeA->getMargin() + m_shapeB->getMargin();
-}
-
-
-void	btMinkowskiSumShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
-{
-	(void)mass;
-	btAssert(0);
-	inertia.setValue(0,0,0);
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.h
deleted file mode 100644
index 6c844e8..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_MINKOWSKI_SUM_SHAPE_H
-#define BT_MINKOWSKI_SUM_SHAPE_H
-
-#include "btConvexInternalShape.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
-
-/// The btMinkowskiSumShape is only for advanced users. This shape represents implicit based minkowski sum of two convex implicit shapes.
-class btMinkowskiSumShape : public btConvexInternalShape
-{
-
-	btTransform	m_transA;
-	btTransform	m_transB;
-	const btConvexShape*	m_shapeA;
-	const btConvexShape*	m_shapeB;
-
-public:
-
-	btMinkowskiSumShape(const btConvexShape* shapeA,const btConvexShape* shapeB);
-
-	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
-
-	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
-
-
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
-
-	void	setTransformA(const btTransform&	transA) { m_transA = transA;}
-	void	setTransformB(const btTransform&	transB) { m_transB = transB;}
-
-	const btTransform& getTransformA()const  { return m_transA;}
-	const btTransform& GetTransformB()const  { return m_transB;}
-
-
-	virtual btScalar	getMargin() const;
-
-	const btConvexShape*	getShapeA() const { return m_shapeA;}
-	const btConvexShape*	getShapeB() const { return m_shapeB;}
-
-	virtual const char*	getName()const 
-	{
-		return "MinkowskiSum";
-	}
-};
-
-#endif //BT_MINKOWSKI_SUM_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp
deleted file mode 100644
index c996bfc..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-#include "btMultiSphereShape.h"
-#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
-#include "LinearMath/btQuaternion.h"
-#include "LinearMath/btSerializer.h"
-
-btMultiSphereShape::btMultiSphereShape (const btVector3* positions,const btScalar* radi,int numSpheres)
-:btConvexInternalAabbCachingShape ()
-{
-	m_shapeType = MULTI_SPHERE_SHAPE_PROXYTYPE;
-	//btScalar startMargin = btScalar(BT_LARGE_FLOAT);
-
-	m_localPositionArray.resize(numSpheres);
-	m_radiArray.resize(numSpheres);
-	for (int i=0;i<numSpheres;i++)
-	{
-		m_localPositionArray[i] = positions[i];
-		m_radiArray[i] = radi[i];
-		
-	}
-
-	recalcLocalAabb();
-
-}
-
- 
- btVector3	btMultiSphereShape::localGetSupportingVertexWithoutMargin(const btVector3& vec0)const
-{
-	int i;
-	btVector3 supVec(0,0,0);
-
-	btScalar maxDot(btScalar(-BT_LARGE_FLOAT));
-
-
-	btVector3 vec = vec0;
-	btScalar lenSqr = vec.length2();
-	if (lenSqr < (SIMD_EPSILON*SIMD_EPSILON))
-	{
-		vec.setValue(1,0,0);
-	} else
-	{
-		btScalar rlen = btScalar(1.) / btSqrt(lenSqr );
-		vec *= rlen;
-	}
-
-	btVector3 vtx;
-	btScalar newDot;
-
-	const btVector3* pos = &m_localPositionArray[0];
-	const btScalar* rad = &m_radiArray[0];
-	int numSpheres = m_localPositionArray.size();
-
-	for (i=0;i<numSpheres;i++)
-	{
-		vtx = (*pos) +vec*m_localScaling*(*rad) - vec * getMargin();
-		pos++;
-		rad++;
-		newDot = vec.dot(vtx);
-		if (newDot > maxDot)
-		{
-			maxDot = newDot;
-			supVec = vtx;
-		}
-	}
-
-	return supVec;
-
-}
-
- void	btMultiSphereShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
-{
-
-	for (int j=0;j<numVectors;j++)
-	{
-		btScalar maxDot(btScalar(-BT_LARGE_FLOAT));
-
-		const btVector3& vec = vectors[j];
-
-		btVector3 vtx;
-		btScalar newDot;
-
-		const btVector3* pos = &m_localPositionArray[0];
-		const btScalar* rad = &m_radiArray[0];
-		int numSpheres = m_localPositionArray.size();
-		for (int i=0;i<numSpheres;i++)
-		{
-			vtx = (*pos) +vec*m_localScaling*(*rad) - vec * getMargin();
-			pos++;
-			rad++;
-			newDot = vec.dot(vtx);
-			if (newDot > maxDot)
-			{
-				maxDot = newDot;
-				supportVerticesOut[j] = vtx;
-			}
-		}
-	}
-}
-
-
-
-
-
-
-
-
-void	btMultiSphereShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
-{
-	//as an approximation, take the inertia of the box that bounds the spheres
-
-	btVector3 localAabbMin,localAabbMax;
-	getCachedLocalAabb(localAabbMin,localAabbMax);
-	btVector3 halfExtents = (localAabbMax-localAabbMin)*btScalar(0.5);
-
-	btScalar lx=btScalar(2.)*(halfExtents.x());
-	btScalar ly=btScalar(2.)*(halfExtents.y());
-	btScalar lz=btScalar(2.)*(halfExtents.z());
-
-	inertia.setValue(mass/(btScalar(12.0)) * (ly*ly + lz*lz),
-					mass/(btScalar(12.0)) * (lx*lx + lz*lz),
-					mass/(btScalar(12.0)) * (lx*lx + ly*ly));
-
-}
-
-
-///fills the dataBuffer and returns the struct name (and 0 on failure)
-const char*	btMultiSphereShape::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-	btMultiSphereShapeData* shapeData = (btMultiSphereShapeData*) dataBuffer;
-	btConvexInternalShape::serialize(&shapeData->m_convexInternalShapeData, serializer);
-
-	int numElem = m_localPositionArray.size();
-	shapeData->m_localPositionArrayPtr = numElem ? (btPositionAndRadius*)serializer->getUniquePointer((void*)&m_localPositionArray[0]):  0;
-	
-	shapeData->m_localPositionArraySize = numElem;
-	if (numElem)
-	{
-		btChunk* chunk = serializer->allocate(sizeof(btPositionAndRadius),numElem);
-		btPositionAndRadius* memPtr = (btPositionAndRadius*)chunk->m_oldPtr;
-		for (int i=0;i<numElem;i++,memPtr++)
-		{
-			m_localPositionArray[i].serializeFloat(memPtr->m_pos);
-			memPtr->m_radius = float(m_radiArray[i]);
-		}
-		serializer->finalizeChunk(chunk,"btPositionAndRadius",BT_ARRAY_CODE,(void*)&m_localPositionArray[0]);
-	}
-	
-	return "btMultiSphereShapeData";
-}
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultiSphereShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultiSphereShape.h
deleted file mode 100644
index 06c5d16..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultiSphereShape.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_MULTI_SPHERE_MINKOWSKI_H
-#define BT_MULTI_SPHERE_MINKOWSKI_H
-
-#include "btConvexInternalShape.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
-#include "LinearMath/btAlignedObjectArray.h"
-#include "LinearMath/btAabbUtil2.h"
-
-
-
-///The btMultiSphereShape represents the convex hull of a collection of spheres. You can create special capsules or other smooth volumes.
-///It is possible to animate the spheres for deformation, but call 'recalcLocalAabb' after changing any sphere position/radius
-class btMultiSphereShape : public btConvexInternalAabbCachingShape
-{
-	
-	btAlignedObjectArray<btVector3> m_localPositionArray;
-	btAlignedObjectArray<btScalar>  m_radiArray;
-	
-public:
-	btMultiSphereShape (const btVector3* positions,const btScalar* radi,int numSpheres);
-
-	///CollisionShape Interface
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
-
-	/// btConvexShape Interface
-	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
-
-	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
-	
-	int	getSphereCount() const
-	{
-		return m_localPositionArray.size();
-	}
-
-	const btVector3&	getSpherePosition(int index) const
-	{
-		return m_localPositionArray[index];
-	}
-
-	btScalar	getSphereRadius(int index) const
-	{
-		return m_radiArray[index];
-	}
-
-
-	virtual const char*	getName()const 
-	{
-		return "MultiSphere";
-	}
-
-	virtual	int	calculateSerializeBufferSize() const;
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
-
-
-};
-
-
-struct	btPositionAndRadius
-{
-	btVector3FloatData	m_pos;
-	float		m_radius;
-};
-
-struct	btMultiSphereShapeData
-{
-	btConvexInternalShapeData	m_convexInternalShapeData;
-
-	btPositionAndRadius	*m_localPositionArrayPtr;
-	int				m_localPositionArraySize;
-	char	m_padding[4];
-};
-
-
-
-SIMD_FORCE_INLINE	int	btMultiSphereShape::calculateSerializeBufferSize() const
-{
-	return sizeof(btMultiSphereShapeData);
-}
-
-
-
-#endif //BT_MULTI_SPHERE_MINKOWSKI_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp
deleted file mode 100644
index 58799ac..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-/// This file was created by Alex Silverman
-
-#include "BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.h"
-#include "BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.h"
-//#include "BulletCollision/CollisionShapes/btOptimizedBvh.h"
-
-
-///Obtains the material for a specific triangle
-const btMaterial * btMultimaterialTriangleMeshShape::getMaterialProperties(int partID, int triIndex)
-{
-    const unsigned char * materialBase = 0;
-    int numMaterials;
-    PHY_ScalarType materialType;
-    int materialStride;
-    const unsigned char * triangleMaterialBase = 0;
-    int numTriangles;
-    int triangleMaterialStride;
-    PHY_ScalarType triangleType;
-
-    ((btTriangleIndexVertexMaterialArray*)m_meshInterface)->getLockedReadOnlyMaterialBase(&materialBase, numMaterials, materialType, materialStride,
-        &triangleMaterialBase, numTriangles, triangleMaterialStride, triangleType, partID);
-
-    // return the pointer to the place with the friction for the triangle
-    // TODO: This depends on whether it's a moving mesh or not
-    // BUG IN GIMPACT
-    //return (btScalar*)(&materialBase[triangleMaterialBase[(triIndex-1) * triangleMaterialStride] * materialStride]);
-    int * matInd = (int *)(&(triangleMaterialBase[(triIndex * triangleMaterialStride)]));
-    btMaterial *matVal = (btMaterial *)(&(materialBase[*matInd * materialStride]));
-    return (matVal);
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.h
deleted file mode 100644
index 2b92ab7..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-/// This file was created by Alex Silverman
-
-#ifndef BT_BVH_TRIANGLE_MATERIAL_MESH_SHAPE_H
-#define BT_BVH_TRIANGLE_MATERIAL_MESH_SHAPE_H
-
-#include "btBvhTriangleMeshShape.h"
-#include "btMaterial.h"
-
-///The BvhTriangleMaterialMeshShape extends the btBvhTriangleMeshShape. Its main contribution is the interface into a material array, which allows per-triangle friction and restitution.
-ATTRIBUTE_ALIGNED16(class) btMultimaterialTriangleMeshShape : public btBvhTriangleMeshShape
-{
-    btAlignedObjectArray <btMaterial*> m_materialList;
-    int ** m_triangleMaterials;
-
-public:
-
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-
-    btMultimaterialTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression, bool buildBvh = true):
-        btBvhTriangleMeshShape(meshInterface, useQuantizedAabbCompression, buildBvh)
-        {
-            m_shapeType = MULTIMATERIAL_TRIANGLE_MESH_PROXYTYPE;
-
-            const unsigned char *vertexbase;
-            int numverts;
-            PHY_ScalarType type;
-            int stride;
-            const unsigned char *indexbase;
-            int indexstride;
-            int numfaces;
-            PHY_ScalarType indicestype;
-
-            //m_materialLookup = (int**)(btAlignedAlloc(sizeof(int*) * meshInterface->getNumSubParts(), 16));
-
-            for(int i = 0; i < meshInterface->getNumSubParts(); i++)
-            {
-                m_meshInterface->getLockedReadOnlyVertexIndexBase(
-                    &vertexbase,
-                    numverts,
-                    type,
-                    stride,
-                    &indexbase,
-                    indexstride,
-                    numfaces,
-                    indicestype,
-                    i);
-                //m_materialLookup[i] = (int*)(btAlignedAlloc(sizeof(int) * numfaces, 16));
-            }
-        }
-
-	///optionally pass in a larger bvh aabb, used for quantization. This allows for deformations within this aabb
-	btMultimaterialTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression,const btVector3& bvhAabbMin,const btVector3& bvhAabbMax, bool buildBvh = true):
-        btBvhTriangleMeshShape(meshInterface, useQuantizedAabbCompression, bvhAabbMin, bvhAabbMax, buildBvh)
-        {
-            m_shapeType = MULTIMATERIAL_TRIANGLE_MESH_PROXYTYPE;
-
-            const unsigned char *vertexbase;
-            int numverts;
-            PHY_ScalarType type;
-            int stride;
-            const unsigned char *indexbase;
-            int indexstride;
-            int numfaces;
-            PHY_ScalarType indicestype;
-
-            //m_materialLookup = (int**)(btAlignedAlloc(sizeof(int*) * meshInterface->getNumSubParts(), 16));
-
-            for(int i = 0; i < meshInterface->getNumSubParts(); i++)
-            {
-                m_meshInterface->getLockedReadOnlyVertexIndexBase(
-                    &vertexbase,
-                    numverts,
-                    type,
-                    stride,
-                    &indexbase,
-                    indexstride,
-                    numfaces,
-                    indicestype,
-                    i);
-                //m_materialLookup[i] = (int*)(btAlignedAlloc(sizeof(int) * numfaces * 2, 16));
-            }
-        }
-	
-    virtual ~btMultimaterialTriangleMeshShape()
-    {
-/*
-        for(int i = 0; i < m_meshInterface->getNumSubParts(); i++)
-        {
-            btAlignedFree(m_materialValues[i]);
-            m_materialLookup[i] = NULL;
-        }
-        btAlignedFree(m_materialValues);
-        m_materialLookup = NULL;
-*/
-    }
-	//debugging
-	virtual const char*	getName()const {return "MULTIMATERIALTRIANGLEMESH";}
-
-    ///Obtains the material for a specific triangle
-    const btMaterial * getMaterialProperties(int partID, int triIndex);
-
-}
-;
-
-#endif //BT_BVH_TRIANGLE_MATERIAL_MESH_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp
deleted file mode 100644
index 981b8a2..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp
+++ /dev/null
@@ -1,391 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "btOptimizedBvh.h"
-#include "btStridingMeshInterface.h"
-#include "LinearMath/btAabbUtil2.h"
-#include "LinearMath/btIDebugDraw.h"
-
-
-btOptimizedBvh::btOptimizedBvh()
-{ 
-}
-
-btOptimizedBvh::~btOptimizedBvh()
-{
-}
-
-
-void btOptimizedBvh::build(btStridingMeshInterface* triangles, bool useQuantizedAabbCompression, const btVector3& bvhAabbMin, const btVector3& bvhAabbMax)
-{
-	m_useQuantization = useQuantizedAabbCompression;
-
-
-	// NodeArray	triangleNodes;
-
-	struct	NodeTriangleCallback : public btInternalTriangleIndexCallback
-	{
-
-		NodeArray&	m_triangleNodes;
-
-		NodeTriangleCallback& operator=(NodeTriangleCallback& other)
-		{
-			m_triangleNodes = other.m_triangleNodes;
-			return *this;
-		}
-		
-		NodeTriangleCallback(NodeArray&	triangleNodes)
-			:m_triangleNodes(triangleNodes)
-		{
-		}
-
-		virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int  triangleIndex)
-		{
-			btOptimizedBvhNode node;
-			btVector3	aabbMin,aabbMax;
-			aabbMin.setValue(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
-			aabbMax.setValue(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT)); 
-			aabbMin.setMin(triangle[0]);
-			aabbMax.setMax(triangle[0]);
-			aabbMin.setMin(triangle[1]);
-			aabbMax.setMax(triangle[1]);
-			aabbMin.setMin(triangle[2]);
-			aabbMax.setMax(triangle[2]);
-
-			//with quantization?
-			node.m_aabbMinOrg = aabbMin;
-			node.m_aabbMaxOrg = aabbMax;
-
-			node.m_escapeIndex = -1;
-	
-			//for child nodes
-			node.m_subPart = partId;
-			node.m_triangleIndex = triangleIndex;
-			m_triangleNodes.push_back(node);
-		}
-	};
-	struct	QuantizedNodeTriangleCallback : public btInternalTriangleIndexCallback
-	{
-		QuantizedNodeArray&	m_triangleNodes;
-		const btQuantizedBvh* m_optimizedTree; // for quantization
-
-		QuantizedNodeTriangleCallback& operator=(QuantizedNodeTriangleCallback& other)
-		{
-			m_triangleNodes = other.m_triangleNodes;
-			m_optimizedTree = other.m_optimizedTree;
-			return *this;
-		}
-
-		QuantizedNodeTriangleCallback(QuantizedNodeArray&	triangleNodes,const btQuantizedBvh* tree)
-			:m_triangleNodes(triangleNodes),m_optimizedTree(tree)
-		{
-		}
-
-		virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int  triangleIndex)
-		{
-			// The partId and triangle index must fit in the same (positive) integer
-			btAssert(partId < (1<<MAX_NUM_PARTS_IN_BITS));
-			btAssert(triangleIndex < (1<<(31-MAX_NUM_PARTS_IN_BITS)));
-			//negative indices are reserved for escapeIndex
-			btAssert(triangleIndex>=0);
-
-			btQuantizedBvhNode node;
-			btVector3	aabbMin,aabbMax;
-			aabbMin.setValue(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
-			aabbMax.setValue(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT)); 
-			aabbMin.setMin(triangle[0]);
-			aabbMax.setMax(triangle[0]);
-			aabbMin.setMin(triangle[1]);
-			aabbMax.setMax(triangle[1]);
-			aabbMin.setMin(triangle[2]);
-			aabbMax.setMax(triangle[2]);
-
-			//PCK: add these checks for zero dimensions of aabb
-			const btScalar MIN_AABB_DIMENSION = btScalar(0.002);
-			const btScalar MIN_AABB_HALF_DIMENSION = btScalar(0.001);
-			if (aabbMax.x() - aabbMin.x() < MIN_AABB_DIMENSION)
-			{
-				aabbMax.setX(aabbMax.x() + MIN_AABB_HALF_DIMENSION);
-				aabbMin.setX(aabbMin.x() - MIN_AABB_HALF_DIMENSION);
-			}
-			if (aabbMax.y() - aabbMin.y() < MIN_AABB_DIMENSION)
-			{
-				aabbMax.setY(aabbMax.y() + MIN_AABB_HALF_DIMENSION);
-				aabbMin.setY(aabbMin.y() - MIN_AABB_HALF_DIMENSION);
-			}
-			if (aabbMax.z() - aabbMin.z() < MIN_AABB_DIMENSION)
-			{
-				aabbMax.setZ(aabbMax.z() + MIN_AABB_HALF_DIMENSION);
-				aabbMin.setZ(aabbMin.z() - MIN_AABB_HALF_DIMENSION);
-			}
-
-			m_optimizedTree->quantize(&node.m_quantizedAabbMin[0],aabbMin,0);
-			m_optimizedTree->quantize(&node.m_quantizedAabbMax[0],aabbMax,1);
-
-			node.m_escapeIndexOrTriangleIndex = (partId<<(31-MAX_NUM_PARTS_IN_BITS)) | triangleIndex;
-
-			m_triangleNodes.push_back(node);
-		}
-	};
-	
-
-
-	int numLeafNodes = 0;
-
-	
-	if (m_useQuantization)
-	{
-
-		//initialize quantization values
-		setQuantizationValues(bvhAabbMin,bvhAabbMax);
-
-		QuantizedNodeTriangleCallback	callback(m_quantizedLeafNodes,this);
-
-	
-		triangles->InternalProcessAllTriangles(&callback,m_bvhAabbMin,m_bvhAabbMax);
-
-		//now we have an array of leafnodes in m_leafNodes
-		numLeafNodes = m_quantizedLeafNodes.size();
-
-
-		m_quantizedContiguousNodes.resize(2*numLeafNodes);
-
-
-	} else
-	{
-		NodeTriangleCallback	callback(m_leafNodes);
-
-		btVector3 aabbMin(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT));
-		btVector3 aabbMax(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
-
-		triangles->InternalProcessAllTriangles(&callback,aabbMin,aabbMax);
-
-		//now we have an array of leafnodes in m_leafNodes
-		numLeafNodes = m_leafNodes.size();
-
-		m_contiguousNodes.resize(2*numLeafNodes);
-	}
-
-	m_curNodeIndex = 0;
-
-	buildTree(0,numLeafNodes);
-
-	///if the entire tree is small then subtree size, we need to create a header info for the tree
-	if(m_useQuantization && !m_SubtreeHeaders.size())
-	{
-		btBvhSubtreeInfo& subtree = m_SubtreeHeaders.expand();
-		subtree.setAabbFromQuantizeNode(m_quantizedContiguousNodes[0]);
-		subtree.m_rootNodeIndex = 0;
-		subtree.m_subtreeSize = m_quantizedContiguousNodes[0].isLeafNode() ? 1 : m_quantizedContiguousNodes[0].getEscapeIndex();
-	}
-
-	//PCK: update the copy of the size
-	m_subtreeHeaderCount = m_SubtreeHeaders.size();
-
-	//PCK: clear m_quantizedLeafNodes and m_leafNodes, they are temporary
-	m_quantizedLeafNodes.clear();
-	m_leafNodes.clear();
-}
-
-
-
-
-void	btOptimizedBvh::refit(btStridingMeshInterface* meshInterface,const btVector3& aabbMin,const btVector3& aabbMax)
-{
-	if (m_useQuantization)
-	{
-
-		setQuantizationValues(aabbMin,aabbMax);
-
-		updateBvhNodes(meshInterface,0,m_curNodeIndex,0);
-
-		///now update all subtree headers
-
-		int i;
-		for (i=0;i<m_SubtreeHeaders.size();i++)
-		{
-			btBvhSubtreeInfo& subtree = m_SubtreeHeaders[i];
-			subtree.setAabbFromQuantizeNode(m_quantizedContiguousNodes[subtree.m_rootNodeIndex]);
-		}
-
-	} else
-	{
-
-	}
-}
-
-
-
-
-void	btOptimizedBvh::refitPartial(btStridingMeshInterface* meshInterface,const btVector3& aabbMin,const btVector3& aabbMax)
-{
-	//incrementally initialize quantization values
-	btAssert(m_useQuantization);
-
-	btAssert(aabbMin.getX() > m_bvhAabbMin.getX());
-	btAssert(aabbMin.getY() > m_bvhAabbMin.getY());
-	btAssert(aabbMin.getZ() > m_bvhAabbMin.getZ());
-
-	btAssert(aabbMax.getX() < m_bvhAabbMax.getX());
-	btAssert(aabbMax.getY() < m_bvhAabbMax.getY());
-	btAssert(aabbMax.getZ() < m_bvhAabbMax.getZ());
-
-	///we should update all quantization values, using updateBvhNodes(meshInterface);
-	///but we only update chunks that overlap the given aabb
-	
-	unsigned short	quantizedQueryAabbMin[3];
-	unsigned short	quantizedQueryAabbMax[3];
-
-	quantize(&quantizedQueryAabbMin[0],aabbMin,0);
-	quantize(&quantizedQueryAabbMax[0],aabbMax,1);
-
-	int i;
-	for (i=0;i<this->m_SubtreeHeaders.size();i++)
-	{
-		btBvhSubtreeInfo& subtree = m_SubtreeHeaders[i];
-
-		//PCK: unsigned instead of bool
-		unsigned overlap = testQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,subtree.m_quantizedAabbMin,subtree.m_quantizedAabbMax);
-		if (overlap != 0)
-		{
-			updateBvhNodes(meshInterface,subtree.m_rootNodeIndex,subtree.m_rootNodeIndex+subtree.m_subtreeSize,i);
-
-			subtree.setAabbFromQuantizeNode(m_quantizedContiguousNodes[subtree.m_rootNodeIndex]);
-		}
-	}
-	
-}
-
-void	btOptimizedBvh::updateBvhNodes(btStridingMeshInterface* meshInterface,int firstNode,int endNode,int index)
-{
-	(void)index;
-
-	btAssert(m_useQuantization);
-
-	int curNodeSubPart=-1;
-
-	//get access info to trianglemesh data
-		const unsigned char *vertexbase = 0;
-		int numverts = 0;
-		PHY_ScalarType type = PHY_INTEGER;
-		int stride = 0;
-		const unsigned char *indexbase = 0;
-		int indexstride = 0;
-		int numfaces = 0;
-		PHY_ScalarType indicestype = PHY_INTEGER;
-
-		btVector3	triangleVerts[3];
-		btVector3	aabbMin,aabbMax;
-		const btVector3& meshScaling = meshInterface->getScaling();
-		
-		int i;
-		for (i=endNode-1;i>=firstNode;i--)
-		{
-
-
-			btQuantizedBvhNode& curNode = m_quantizedContiguousNodes[i];
-			if (curNode.isLeafNode())
-			{
-				//recalc aabb from triangle data
-				int nodeSubPart = curNode.getPartId();
-				int nodeTriangleIndex = curNode.getTriangleIndex();
-				if (nodeSubPart != curNodeSubPart)
-				{
-					if (curNodeSubPart >= 0)
-						meshInterface->unLockReadOnlyVertexBase(curNodeSubPart);
-					meshInterface->getLockedReadOnlyVertexIndexBase(&vertexbase,numverts,	type,stride,&indexbase,indexstride,numfaces,indicestype,nodeSubPart);
-
-					curNodeSubPart = nodeSubPart;
-					btAssert(indicestype==PHY_INTEGER||indicestype==PHY_SHORT);
-				}
-				//triangles->getLockedReadOnlyVertexIndexBase(vertexBase,numVerts,
-
-				unsigned int* gfxbase = (unsigned int*)(indexbase+nodeTriangleIndex*indexstride);
-				
-				
-				for (int j=2;j>=0;j--)
-				{
-					
-					int graphicsindex = indicestype==PHY_SHORT?((unsigned short*)gfxbase)[j]:gfxbase[j];
-					if (type == PHY_FLOAT)
-					{
-						float* graphicsbase = (float*)(vertexbase+graphicsindex*stride);
-						triangleVerts[j] = btVector3(
-							graphicsbase[0]*meshScaling.getX(),
-							graphicsbase[1]*meshScaling.getY(),
-							graphicsbase[2]*meshScaling.getZ());
-					}
-					else
-					{
-						double* graphicsbase = (double*)(vertexbase+graphicsindex*stride);
-						triangleVerts[j] = btVector3( btScalar(graphicsbase[0]*meshScaling.getX()), btScalar(graphicsbase[1]*meshScaling.getY()), btScalar(graphicsbase[2]*meshScaling.getZ()));
-					}
-				}
-
-
-				
-				aabbMin.setValue(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
-				aabbMax.setValue(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT)); 
-				aabbMin.setMin(triangleVerts[0]);
-				aabbMax.setMax(triangleVerts[0]);
-				aabbMin.setMin(triangleVerts[1]);
-				aabbMax.setMax(triangleVerts[1]);
-				aabbMin.setMin(triangleVerts[2]);
-				aabbMax.setMax(triangleVerts[2]);
-
-				quantize(&curNode.m_quantizedAabbMin[0],aabbMin,0);
-				quantize(&curNode.m_quantizedAabbMax[0],aabbMax,1);
-				
-			} else
-			{
-				//combine aabb from both children
-
-				btQuantizedBvhNode* leftChildNode = &m_quantizedContiguousNodes[i+1];
-				
-				btQuantizedBvhNode* rightChildNode = leftChildNode->isLeafNode() ? &m_quantizedContiguousNodes[i+2] :
-					&m_quantizedContiguousNodes[i+1+leftChildNode->getEscapeIndex()];
-				
-
-				{
-					for (int i=0;i<3;i++)
-					{
-						curNode.m_quantizedAabbMin[i] = leftChildNode->m_quantizedAabbMin[i];
-						if (curNode.m_quantizedAabbMin[i]>rightChildNode->m_quantizedAabbMin[i])
-							curNode.m_quantizedAabbMin[i]=rightChildNode->m_quantizedAabbMin[i];
-
-						curNode.m_quantizedAabbMax[i] = leftChildNode->m_quantizedAabbMax[i];
-						if (curNode.m_quantizedAabbMax[i] < rightChildNode->m_quantizedAabbMax[i])
-							curNode.m_quantizedAabbMax[i] = rightChildNode->m_quantizedAabbMax[i];
-					}
-				}
-			}
-
-		}
-
-		if (curNodeSubPart >= 0)
-			meshInterface->unLockReadOnlyVertexBase(curNodeSubPart);
-
-		
-}
-
-///deSerializeInPlace loads and initializes a BVH from a buffer in memory 'in place'
-btOptimizedBvh* btOptimizedBvh::deSerializeInPlace(void *i_alignedDataBuffer, unsigned int i_dataBufferSize, bool i_swapEndian)
-{
-	btQuantizedBvh* bvh = btQuantizedBvh::deSerializeInPlace(i_alignedDataBuffer,i_dataBufferSize,i_swapEndian);
-	
-	//we don't add additional data so just do a static upcast
-	return static_cast<btOptimizedBvh*>(bvh);
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btOptimizedBvh.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btOptimizedBvh.h
deleted file mode 100644
index 715961f..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btOptimizedBvh.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-///Contains contributions from Disney Studio's
-
-#ifndef BT_OPTIMIZED_BVH_H
-#define BT_OPTIMIZED_BVH_H
-
-#include "BulletCollision/BroadphaseCollision/btQuantizedBvh.h"
-
-class btStridingMeshInterface;
-
-
-///The btOptimizedBvh extends the btQuantizedBvh to create AABB tree for triangle meshes, through the btStridingMeshInterface.
-ATTRIBUTE_ALIGNED16(class) btOptimizedBvh : public btQuantizedBvh
-{
-	
-public:
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-
-protected:
-
-public:
-
-	btOptimizedBvh();
-
-	virtual ~btOptimizedBvh();
-
-	void	build(btStridingMeshInterface* triangles,bool useQuantizedAabbCompression, const btVector3& bvhAabbMin, const btVector3& bvhAabbMax);
-
-	void	refit(btStridingMeshInterface* triangles,const btVector3& aabbMin,const btVector3& aabbMax);
-
-	void	refitPartial(btStridingMeshInterface* triangles,const btVector3& aabbMin, const btVector3& aabbMax);
-
-	void	updateBvhNodes(btStridingMeshInterface* meshInterface,int firstNode,int endNode,int index);
-
-	/// Data buffer MUST be 16 byte aligned
-	virtual bool serializeInPlace(void *o_alignedDataBuffer, unsigned i_dataBufferSize, bool i_swapEndian) const
-	{
-		return btQuantizedBvh::serialize(o_alignedDataBuffer,i_dataBufferSize,i_swapEndian);
-
-	}
-
-	///deSerializeInPlace loads and initializes a BVH from a buffer in memory 'in place'
-	static btOptimizedBvh *deSerializeInPlace(void *i_alignedDataBuffer, unsigned int i_dataBufferSize, bool i_swapEndian);
-
-
-};
-
-
-#endif //BT_OPTIMIZED_BVH_H
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp
deleted file mode 100644
index e84767e..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h"
-#include "btConvexPolyhedron.h"
-#include "LinearMath/btConvexHullComputer.h"
-#include <new>
-
-btPolyhedralConvexShape::btPolyhedralConvexShape() :btConvexInternalShape(),
-m_polyhedron(0)
-{
-
-}
-
-btPolyhedralConvexShape::~btPolyhedralConvexShape()
-{
-	if (m_polyhedron)
-	{
-		btAlignedFree(m_polyhedron);
-	}
-}
-
-bool	btPolyhedralConvexShape::initializePolyhedralFeatures()
-{
-	if (m_polyhedron)
-		btAlignedFree(m_polyhedron);
-	
-	void* mem = btAlignedAlloc(sizeof(btConvexPolyhedron),16);
-	m_polyhedron = new (mem) btConvexPolyhedron;
-
-	btAlignedObjectArray<btVector3> tmpVertices;
-	for (int i=0;i<getNumVertices();i++)
-	{
-		btVector3& newVertex = tmpVertices.expand();
-		getVertex(i,newVertex);
-	}
-
-	btConvexHullComputer conv;
-	conv.compute(&tmpVertices[0].getX(), sizeof(btVector3),tmpVertices.size(),0.f,0.f);
-
-	
-
-	btAlignedObjectArray<btVector3> faceNormals;
-	int numFaces = conv.faces.size();
-	faceNormals.resize(numFaces);
-	btConvexHullComputer* convexUtil = &conv;
-
-	
-	
-	m_polyhedron->m_faces.resize(numFaces);
-	int numVertices = convexUtil->vertices.size();
-	m_polyhedron->m_vertices.resize(numVertices);
-	for (int p=0;p<numVertices;p++)
-	{
-		m_polyhedron->m_vertices[p] = convexUtil->vertices[p];
-	}
-
-	for (int i=0;i<numFaces;i++)
-	{
-		int face = convexUtil->faces[i];
-		//printf("face=%d\n",face);
-		const btConvexHullComputer::Edge*  firstEdge = &convexUtil->edges[face];
-		const btConvexHullComputer::Edge*  edge = firstEdge;
-
-		btVector3 edges[3];
-		int numEdges = 0;
-		//compute face normals
-
-		btScalar maxCross2 = 0.f;
-		int chosenEdge = -1;
-
-		do
-		{
-			
-			int src = edge->getSourceVertex();
-			m_polyhedron->m_faces[i].m_indices.push_back(src);
-			int targ = edge->getTargetVertex();
-			btVector3 wa = convexUtil->vertices[src];
-
-			btVector3 wb = convexUtil->vertices[targ];
-			btVector3 newEdge = wb-wa;
-			newEdge.normalize();
-			if (numEdges<2)
-				edges[numEdges++] = newEdge;
-
-			edge = edge->getNextEdgeOfFace();
-		} while (edge!=firstEdge);
-
-		btScalar planeEq = 1e30f;
-
-		
-		if (numEdges==2)
-		{
-			faceNormals[i] = edges[0].cross(edges[1]);
-			faceNormals[i].normalize();
-			m_polyhedron->m_faces[i].m_plane[0] = -faceNormals[i].getX();
-			m_polyhedron->m_faces[i].m_plane[1] = -faceNormals[i].getY();
-			m_polyhedron->m_faces[i].m_plane[2] = -faceNormals[i].getZ();
-			m_polyhedron->m_faces[i].m_plane[3] = planeEq;
-
-		}
-		else
-		{
-			btAssert(0);//degenerate?
-			faceNormals[i].setZero();
-		}
-
-		for (int v=0;v<m_polyhedron->m_faces[i].m_indices.size();v++)
-		{
-			btScalar eq = m_polyhedron->m_vertices[m_polyhedron->m_faces[i].m_indices[v]].dot(faceNormals[i]);
-			if (planeEq>eq)
-			{
-				planeEq=eq;
-			}
-		}
-		m_polyhedron->m_faces[i].m_plane[3] = planeEq;
-	}
-
-
-	if (m_polyhedron->m_faces.size() && conv.vertices.size())
-	{
-
-		for (int f=0;f<m_polyhedron->m_faces.size();f++)
-		{
-			
-			btVector3 planeNormal(m_polyhedron->m_faces[f].m_plane[0],m_polyhedron->m_faces[f].m_plane[1],m_polyhedron->m_faces[f].m_plane[2]);
-			btScalar planeEq = m_polyhedron->m_faces[f].m_plane[3];
-
-			btVector3 supVec = localGetSupportingVertex(-planeNormal);
-
-			if (supVec.dot(planeNormal)<planeEq)
-			{
-				m_polyhedron->m_faces[f].m_plane[0] *= -1;
-				m_polyhedron->m_faces[f].m_plane[1] *= -1;
-				m_polyhedron->m_faces[f].m_plane[2] *= -1;
-				m_polyhedron->m_faces[f].m_plane[3] *= -1;
-				int numVerts = m_polyhedron->m_faces[f].m_indices.size();
-				for (int v=0;v<numVerts/2;v++)
-				{
-					btSwap(m_polyhedron->m_faces[f].m_indices[v],m_polyhedron->m_faces[f].m_indices[numVerts-1-v]);
-				}
-			}
-		}
-	}
-
-	
-
-	m_polyhedron->initialize();
-
-	return true;
-}
-
-
-btVector3	btPolyhedralConvexShape::localGetSupportingVertexWithoutMargin(const btVector3& vec0)const
-{
-
-
-	btVector3 supVec(0,0,0);
-#ifndef __SPU__
-	int i;
-	btScalar maxDot(btScalar(-BT_LARGE_FLOAT));
-
-	btVector3 vec = vec0;
-	btScalar lenSqr = vec.length2();
-	if (lenSqr < btScalar(0.0001))
-	{
-		vec.setValue(1,0,0);
-	} else
-	{
-		btScalar rlen = btScalar(1.) / btSqrt(lenSqr );
-		vec *= rlen;
-	}
-
-	btVector3 vtx;
-	btScalar newDot;
-
-	for (i=0;i<getNumVertices();i++)
-	{
-		getVertex(i,vtx);
-		newDot = vec.dot(vtx);
-		if (newDot > maxDot)
-		{
-			maxDot = newDot;
-			supVec = vtx;
-		}
-	}
-
-	
-#endif //__SPU__
-	return supVec;
-}
-
-
-
-void	btPolyhedralConvexShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
-{
-#ifndef __SPU__
-	int i;
-
-	btVector3 vtx;
-	btScalar newDot;
-
-	for (i=0;i<numVectors;i++)
-	{
-		supportVerticesOut[i][3] = btScalar(-BT_LARGE_FLOAT);
-	}
-
-	for (int j=0;j<numVectors;j++)
-	{
-	
-		const btVector3& vec = vectors[j];
-
-		for (i=0;i<getNumVertices();i++)
-		{
-			getVertex(i,vtx);
-			newDot = vec.dot(vtx);
-			if (newDot > supportVerticesOut[j][3])
-			{
-				//WARNING: don't swap next lines, the w component would get overwritten!
-				supportVerticesOut[j] = vtx;
-				supportVerticesOut[j][3] = newDot;
-			}
-		}
-	}
-#endif //__SPU__
-}
-
-
-
-void	btPolyhedralConvexShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
-{
-#ifndef __SPU__
-	//not yet, return box inertia
-
-	btScalar margin = getMargin();
-
-	btTransform ident;
-	ident.setIdentity();
-	btVector3 aabbMin,aabbMax;
-	getAabb(ident,aabbMin,aabbMax);
-	btVector3 halfExtents = (aabbMax-aabbMin)*btScalar(0.5);
-
-	btScalar lx=btScalar(2.)*(halfExtents.x()+margin);
-	btScalar ly=btScalar(2.)*(halfExtents.y()+margin);
-	btScalar lz=btScalar(2.)*(halfExtents.z()+margin);
-	const btScalar x2 = lx*lx;
-	const btScalar y2 = ly*ly;
-	const btScalar z2 = lz*lz;
-	const btScalar scaledmass = mass * btScalar(0.08333333);
-
-	inertia = scaledmass * (btVector3(y2+z2,x2+z2,x2+y2));
-#endif //__SPU__
-}
-
-
-
-void	btPolyhedralConvexAabbCachingShape::setLocalScaling(const btVector3& scaling)
-{
-	btConvexInternalShape::setLocalScaling(scaling);
-	recalcLocalAabb();
-}
-
-btPolyhedralConvexAabbCachingShape::btPolyhedralConvexAabbCachingShape()
-:btPolyhedralConvexShape(),
-m_localAabbMin(1,1,1),
-m_localAabbMax(-1,-1,-1),
-m_isLocalAabbValid(false)
-{
-}
-
-void btPolyhedralConvexAabbCachingShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const
-{
-	getNonvirtualAabb(trans,aabbMin,aabbMax,getMargin());
-}
-
-void	btPolyhedralConvexAabbCachingShape::recalcLocalAabb()
-{
-	m_isLocalAabbValid = true;
-	
-	#if 1
-	static const btVector3 _directions[] =
-	{
-		btVector3( 1.,  0.,  0.),
-		btVector3( 0.,  1.,  0.),
-		btVector3( 0.,  0.,  1.),
-		btVector3( -1., 0.,  0.),
-		btVector3( 0., -1.,  0.),
-		btVector3( 0.,  0., -1.)
-	};
-	
-	btVector3 _supporting[] =
-	{
-		btVector3( 0., 0., 0.),
-		btVector3( 0., 0., 0.),
-		btVector3( 0., 0., 0.),
-		btVector3( 0., 0., 0.),
-		btVector3( 0., 0., 0.),
-		btVector3( 0., 0., 0.)
-	};
-	
-	batchedUnitVectorGetSupportingVertexWithoutMargin(_directions, _supporting, 6);
-	
-	for ( int i = 0; i < 3; ++i )
-	{
-		m_localAabbMax[i] = _supporting[i][i] + m_collisionMargin;
-		m_localAabbMin[i] = _supporting[i + 3][i] - m_collisionMargin;
-	}
-	
-	#else
-
-	for (int i=0;i<3;i++)
-	{
-		btVector3 vec(btScalar(0.),btScalar(0.),btScalar(0.));
-		vec[i] = btScalar(1.);
-		btVector3 tmp = localGetSupportingVertex(vec);
-		m_localAabbMax[i] = tmp[i]+m_collisionMargin;
-		vec[i] = btScalar(-1.);
-		tmp = localGetSupportingVertex(vec);
-		m_localAabbMin[i] = tmp[i]-m_collisionMargin;
-	}
-	#endif
-}
-
-
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h
deleted file mode 100644
index ee2e1e2..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_POLYHEDRAL_CONVEX_SHAPE_H
-#define BT_POLYHEDRAL_CONVEX_SHAPE_H
-
-#include "LinearMath/btMatrix3x3.h"
-#include "btConvexInternalShape.h"
-class btConvexPolyhedron;
-
-
-///The btPolyhedralConvexShape is an internal interface class for polyhedral convex shapes.
-class btPolyhedralConvexShape : public btConvexInternalShape
-{
-	
-
-protected:
-	
-	btConvexPolyhedron* m_polyhedron;
-
-public:
-
-	btPolyhedralConvexShape();
-
-	virtual ~btPolyhedralConvexShape();
-
-	///optional method mainly used to generate multiple contact points by clipping polyhedral features (faces/edges)
-	virtual bool	initializePolyhedralFeatures();
-
-	const btConvexPolyhedron*	getConvexPolyhedron() const
-	{
-		return m_polyhedron;
-	}
-
-	//brute force implementations
-
-	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
-	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
-	
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
-	
-	
-	virtual int	getNumVertices() const = 0 ;
-	virtual int getNumEdges() const = 0;
-	virtual void getEdge(int i,btVector3& pa,btVector3& pb) const = 0;
-	virtual void getVertex(int i,btVector3& vtx) const = 0;
-	virtual int	getNumPlanes() const = 0;
-	virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i ) const = 0;
-//	virtual int getIndex(int i) const = 0 ; 
-
-	virtual	bool isInside(const btVector3& pt,btScalar tolerance) const = 0;
-	
-};
-
-
-///The btPolyhedralConvexAabbCachingShape adds aabb caching to the btPolyhedralConvexShape
-class btPolyhedralConvexAabbCachingShape : public btPolyhedralConvexShape
-{
-
-	btVector3	m_localAabbMin;
-	btVector3	m_localAabbMax;
-	bool		m_isLocalAabbValid;
-		
-protected:
-
-	void setCachedLocalAabb (const btVector3& aabbMin, const btVector3& aabbMax)
-	{
-		m_isLocalAabbValid = true;
-		m_localAabbMin = aabbMin;
-		m_localAabbMax = aabbMax;
-	}
-
-	inline void getCachedLocalAabb (btVector3& aabbMin, btVector3& aabbMax) const
-	{
-		btAssert(m_isLocalAabbValid);
-		aabbMin = m_localAabbMin;
-		aabbMax = m_localAabbMax;
-	}
-
-public:
-
-	btPolyhedralConvexAabbCachingShape();
-	
-	inline void getNonvirtualAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax, btScalar margin) const
-	{
-
-		//lazy evaluation of local aabb
-		btAssert(m_isLocalAabbValid);
-		btTransformAabb(m_localAabbMin,m_localAabbMax,margin,trans,aabbMin,aabbMax);
-	}
-
-	virtual void	setLocalScaling(const btVector3& scaling);
-
-	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
-
-	void	recalcLocalAabb();
-
-};
-
-#endif //BT_POLYHEDRAL_CONVEX_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp
deleted file mode 100644
index 25d58d6..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "btScaledBvhTriangleMeshShape.h"
-
-btScaledBvhTriangleMeshShape::btScaledBvhTriangleMeshShape(btBvhTriangleMeshShape* childShape,const btVector3& localScaling)
-:m_localScaling(localScaling),m_bvhTriMeshShape(childShape)
-{
-	m_shapeType = SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE;
-}
-
-btScaledBvhTriangleMeshShape::~btScaledBvhTriangleMeshShape()
-{
-}
-
-
-class btScaledTriangleCallback : public btTriangleCallback
-{
-	btTriangleCallback* m_originalCallback;
-
-	btVector3	m_localScaling;
-
-public:
-
-	btScaledTriangleCallback(btTriangleCallback* originalCallback,const btVector3& localScaling)
-		:m_originalCallback(originalCallback),
-		m_localScaling(localScaling)
-	{
-	}
-
-	virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex)
-	{
-		btVector3 newTriangle[3];
-		newTriangle[0] = triangle[0]*m_localScaling;
-		newTriangle[1] = triangle[1]*m_localScaling;
-		newTriangle[2] = triangle[2]*m_localScaling;
-		m_originalCallback->processTriangle(&newTriangle[0],partId,triangleIndex);
-	}
-};
-
-void	btScaledBvhTriangleMeshShape::processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const
-{
-	btScaledTriangleCallback scaledCallback(callback,m_localScaling);
-	
-	btVector3 invLocalScaling(1.f/m_localScaling.getX(),1.f/m_localScaling.getY(),1.f/m_localScaling.getZ());
-	btVector3 scaledAabbMin,scaledAabbMax;
-
-	///support negative scaling
-	scaledAabbMin[0] = m_localScaling.getX() >= 0. ? aabbMin[0] * invLocalScaling[0] : aabbMax[0] * invLocalScaling[0];
-	scaledAabbMin[1] = m_localScaling.getY() >= 0. ? aabbMin[1] * invLocalScaling[1] : aabbMax[1] * invLocalScaling[1];
-	scaledAabbMin[2] = m_localScaling.getZ() >= 0. ? aabbMin[2] * invLocalScaling[2] : aabbMax[2] * invLocalScaling[2];
-	scaledAabbMin[3] = 0.f;
-	
-	scaledAabbMax[0] = m_localScaling.getX() <= 0. ? aabbMin[0] * invLocalScaling[0] : aabbMax[0] * invLocalScaling[0];
-	scaledAabbMax[1] = m_localScaling.getY() <= 0. ? aabbMin[1] * invLocalScaling[1] : aabbMax[1] * invLocalScaling[1];
-	scaledAabbMax[2] = m_localScaling.getZ() <= 0. ? aabbMin[2] * invLocalScaling[2] : aabbMax[2] * invLocalScaling[2];
-	scaledAabbMax[3] = 0.f;
-	
-	
-	m_bvhTriMeshShape->processAllTriangles(&scaledCallback,scaledAabbMin,scaledAabbMax);
-}
-
-
-void	btScaledBvhTriangleMeshShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const
-{
-	btVector3 localAabbMin = m_bvhTriMeshShape->getLocalAabbMin();
-	btVector3 localAabbMax = m_bvhTriMeshShape->getLocalAabbMax();
-
-	btVector3 tmpLocalAabbMin = localAabbMin * m_localScaling;
-	btVector3 tmpLocalAabbMax = localAabbMax * m_localScaling;
-
-	localAabbMin[0] = (m_localScaling.getX() >= 0.) ? tmpLocalAabbMin[0] : tmpLocalAabbMax[0];
-	localAabbMin[1] = (m_localScaling.getY() >= 0.) ? tmpLocalAabbMin[1] : tmpLocalAabbMax[1];
-	localAabbMin[2] = (m_localScaling.getZ() >= 0.) ? tmpLocalAabbMin[2] : tmpLocalAabbMax[2];
-	localAabbMax[0] = (m_localScaling.getX() <= 0.) ? tmpLocalAabbMin[0] : tmpLocalAabbMax[0];
-	localAabbMax[1] = (m_localScaling.getY() <= 0.) ? tmpLocalAabbMin[1] : tmpLocalAabbMax[1];
-	localAabbMax[2] = (m_localScaling.getZ() <= 0.) ? tmpLocalAabbMin[2] : tmpLocalAabbMax[2];
-
-	btVector3 localHalfExtents = btScalar(0.5)*(localAabbMax-localAabbMin);
-	btScalar margin = m_bvhTriMeshShape->getMargin();
-	localHalfExtents += btVector3(margin,margin,margin);
-	btVector3 localCenter = btScalar(0.5)*(localAabbMax+localAabbMin);
-	
-	btMatrix3x3 abs_b = trans.getBasis().absolute();  
-
-	btVector3 center = trans(localCenter);
-
-	btVector3 extent = btVector3(abs_b[0].dot(localHalfExtents),
-		   abs_b[1].dot(localHalfExtents),
-		  abs_b[2].dot(localHalfExtents));
-	aabbMin = center - extent;
-	aabbMax = center + extent;
-
-}
-
-void	btScaledBvhTriangleMeshShape::setLocalScaling(const btVector3& scaling)
-{
-	m_localScaling = scaling;
-}
-
-const btVector3& btScaledBvhTriangleMeshShape::getLocalScaling() const
-{
-	return m_localScaling;
-}
-
-void	btScaledBvhTriangleMeshShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
-{
-	///don't make this a movable object!
-//	btAssert(0);
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h
deleted file mode 100644
index ff86ef3..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_SCALED_BVH_TRIANGLE_MESH_SHAPE_H
-#define BT_SCALED_BVH_TRIANGLE_MESH_SHAPE_H
-
-#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h"
-
-
-///The btScaledBvhTriangleMeshShape allows to instance a scaled version of an existing btBvhTriangleMeshShape.
-///Note that each btBvhTriangleMeshShape still can have its own local scaling, independent from this btScaledBvhTriangleMeshShape 'localScaling'
-ATTRIBUTE_ALIGNED16(class) btScaledBvhTriangleMeshShape : public btConcaveShape
-{
-	
-	
-	btVector3	m_localScaling;
-
-	btBvhTriangleMeshShape*	m_bvhTriMeshShape;
-
-public:
-
-
-	btScaledBvhTriangleMeshShape(btBvhTriangleMeshShape* childShape,const btVector3& localScaling);
-
-	virtual ~btScaledBvhTriangleMeshShape();
-
-
-	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
-	virtual void	setLocalScaling(const btVector3& scaling);
-	virtual const btVector3& getLocalScaling() const;
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
-
-	virtual void	processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const;
-
-	btBvhTriangleMeshShape*	getChildShape()
-	{
-		return m_bvhTriMeshShape;
-	}
-
-	const btBvhTriangleMeshShape*	getChildShape() const
-	{
-		return m_bvhTriMeshShape;
-	}
-
-	//debugging
-	virtual const char*	getName()const {return "SCALEDBVHTRIANGLEMESH";}
-
-	virtual	int	calculateSerializeBufferSize() const;
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
-
-};
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btScaledTriangleMeshShapeData
-{
-	btTriangleMeshShapeData	m_trimeshShapeData;
-
-	btVector3FloatData	m_localScaling;
-};
-
-
-SIMD_FORCE_INLINE	int	btScaledBvhTriangleMeshShape::calculateSerializeBufferSize() const
-{
-	return sizeof(btScaledTriangleMeshShapeData);
-}
-
-
-///fills the dataBuffer and returns the struct name (and 0 on failure)
-SIMD_FORCE_INLINE	const char*	btScaledBvhTriangleMeshShape::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-	btScaledTriangleMeshShapeData* scaledMeshData = (btScaledTriangleMeshShapeData*) dataBuffer;
-	m_bvhTriMeshShape->serialize(&scaledMeshData->m_trimeshShapeData,serializer);
-	scaledMeshData->m_trimeshShapeData.m_collisionShapeData.m_shapeType = SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE;
-	m_localScaling.serializeFloat(scaledMeshData->m_localScaling);
-	return "btScaledTriangleMeshShapeData";
-}
-
-
-#endif //BT_SCALED_BVH_TRIANGLE_MESH_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btShapeHull.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btShapeHull.cpp
deleted file mode 100644
index 3beaf86..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btShapeHull.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-//btShapeHull was implemented by John McCutchan.
-
-
-#include "btShapeHull.h"
-#include "LinearMath/btConvexHull.h"
-
-#define NUM_UNITSPHERE_POINTS 42
-
-btShapeHull::btShapeHull (const btConvexShape* shape)
-{
-	m_shape = shape;
-	m_vertices.clear ();
-	m_indices.clear();
-	m_numIndices = 0;
-}
-
-btShapeHull::~btShapeHull ()
-{
-	m_indices.clear();	
-	m_vertices.clear ();
-}
-
-bool
-btShapeHull::buildHull (btScalar /*margin*/)
-{
-	int numSampleDirections = NUM_UNITSPHERE_POINTS;
-	{
-		int numPDA = m_shape->getNumPreferredPenetrationDirections();
-		if (numPDA)
-		{
-			for (int i=0;i<numPDA;i++)
-			{
-				btVector3 norm;
-				m_shape->getPreferredPenetrationDirection(i,norm);
-				getUnitSpherePoints()[numSampleDirections] = norm;
-				numSampleDirections++;
-			}
-		}
-	}
-
-	btVector3 supportPoints[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2];
-	int i;
-	for (i = 0; i < numSampleDirections; i++)
-	{
-		supportPoints[i] = m_shape->localGetSupportingVertex(getUnitSpherePoints()[i]);
-	}
-
-	HullDesc hd;
-	hd.mFlags = QF_TRIANGLES;
-	hd.mVcount = static_cast<unsigned int>(numSampleDirections);
-
-#ifdef BT_USE_DOUBLE_PRECISION
-	hd.mVertices = &supportPoints[0];
-	hd.mVertexStride = sizeof(btVector3);
-#else
-	hd.mVertices = &supportPoints[0];
-	hd.mVertexStride = sizeof (btVector3);
-#endif
-
-	HullLibrary hl;
-	HullResult hr;
-	if (hl.CreateConvexHull (hd, hr) == QE_FAIL)
-	{
-		return false;
-	}
-
-	m_vertices.resize (static_cast<int>(hr.mNumOutputVertices));
-
-
-	for (i = 0; i < static_cast<int>(hr.mNumOutputVertices); i++)
-	{
-		m_vertices[i] = hr.m_OutputVertices[i];
-	}
-	m_numIndices = hr.mNumIndices;
-	m_indices.resize(static_cast<int>(m_numIndices));
-	for (i = 0; i < static_cast<int>(m_numIndices); i++)
-	{
-		m_indices[i] = hr.m_Indices[i];
-	}
-
-	// free temporary hull result that we just copied
-	hl.ReleaseResult (hr);
-
-	return true;
-}
-
-int
-btShapeHull::numTriangles () const
-{
-	return static_cast<int>(m_numIndices / 3);
-}
-
-int
-btShapeHull::numVertices () const
-{
-	return m_vertices.size ();
-}
-
-int
-btShapeHull::numIndices () const
-{
-	return static_cast<int>(m_numIndices);
-}
-
-
-btVector3* btShapeHull::getUnitSpherePoints()
-{
-	static btVector3 sUnitSpherePoints[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2] = 
-	{
-		btVector3(btScalar(0.000000) , btScalar(-0.000000),btScalar(-1.000000)),
-		btVector3(btScalar(0.723608) , btScalar(-0.525725),btScalar(-0.447219)),
-		btVector3(btScalar(-0.276388) , btScalar(-0.850649),btScalar(-0.447219)),
-		btVector3(btScalar(-0.894426) , btScalar(-0.000000),btScalar(-0.447216)),
-		btVector3(btScalar(-0.276388) , btScalar(0.850649),btScalar(-0.447220)),
-		btVector3(btScalar(0.723608) , btScalar(0.525725),btScalar(-0.447219)),
-		btVector3(btScalar(0.276388) , btScalar(-0.850649),btScalar(0.447220)),
-		btVector3(btScalar(-0.723608) , btScalar(-0.525725),btScalar(0.447219)),
-		btVector3(btScalar(-0.723608) , btScalar(0.525725),btScalar(0.447219)),
-		btVector3(btScalar(0.276388) , btScalar(0.850649),btScalar(0.447219)),
-		btVector3(btScalar(0.894426) , btScalar(0.000000),btScalar(0.447216)),
-		btVector3(btScalar(-0.000000) , btScalar(0.000000),btScalar(1.000000)),
-		btVector3(btScalar(0.425323) , btScalar(-0.309011),btScalar(-0.850654)),
-		btVector3(btScalar(-0.162456) , btScalar(-0.499995),btScalar(-0.850654)),
-		btVector3(btScalar(0.262869) , btScalar(-0.809012),btScalar(-0.525738)),
-		btVector3(btScalar(0.425323) , btScalar(0.309011),btScalar(-0.850654)),
-		btVector3(btScalar(0.850648) , btScalar(-0.000000),btScalar(-0.525736)),
-		btVector3(btScalar(-0.525730) , btScalar(-0.000000),btScalar(-0.850652)),
-		btVector3(btScalar(-0.688190) , btScalar(-0.499997),btScalar(-0.525736)),
-		btVector3(btScalar(-0.162456) , btScalar(0.499995),btScalar(-0.850654)),
-		btVector3(btScalar(-0.688190) , btScalar(0.499997),btScalar(-0.525736)),
-		btVector3(btScalar(0.262869) , btScalar(0.809012),btScalar(-0.525738)),
-		btVector3(btScalar(0.951058) , btScalar(0.309013),btScalar(0.000000)),
-		btVector3(btScalar(0.951058) , btScalar(-0.309013),btScalar(0.000000)),
-		btVector3(btScalar(0.587786) , btScalar(-0.809017),btScalar(0.000000)),
-		btVector3(btScalar(0.000000) , btScalar(-1.000000),btScalar(0.000000)),
-		btVector3(btScalar(-0.587786) , btScalar(-0.809017),btScalar(0.000000)),
-		btVector3(btScalar(-0.951058) , btScalar(-0.309013),btScalar(-0.000000)),
-		btVector3(btScalar(-0.951058) , btScalar(0.309013),btScalar(-0.000000)),
-		btVector3(btScalar(-0.587786) , btScalar(0.809017),btScalar(-0.000000)),
-		btVector3(btScalar(-0.000000) , btScalar(1.000000),btScalar(-0.000000)),
-		btVector3(btScalar(0.587786) , btScalar(0.809017),btScalar(-0.000000)),
-		btVector3(btScalar(0.688190) , btScalar(-0.499997),btScalar(0.525736)),
-		btVector3(btScalar(-0.262869) , btScalar(-0.809012),btScalar(0.525738)),
-		btVector3(btScalar(-0.850648) , btScalar(0.000000),btScalar(0.525736)),
-		btVector3(btScalar(-0.262869) , btScalar(0.809012),btScalar(0.525738)),
-		btVector3(btScalar(0.688190) , btScalar(0.499997),btScalar(0.525736)),
-		btVector3(btScalar(0.525730) , btScalar(0.000000),btScalar(0.850652)),
-		btVector3(btScalar(0.162456) , btScalar(-0.499995),btScalar(0.850654)),
-		btVector3(btScalar(-0.425323) , btScalar(-0.309011),btScalar(0.850654)),
-		btVector3(btScalar(-0.425323) , btScalar(0.309011),btScalar(0.850654)),
-		btVector3(btScalar(0.162456) , btScalar(0.499995),btScalar(0.850654))
-	};
-	return sUnitSpherePoints;
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btShapeHull.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btShapeHull.h
deleted file mode 100644
index 642a288..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btShapeHull.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-///btShapeHull implemented by John McCutchan.
-
-#ifndef BT_SHAPE_HULL_H
-#define BT_SHAPE_HULL_H
-
-#include "LinearMath/btAlignedObjectArray.h"
-#include "BulletCollision/CollisionShapes/btConvexShape.h"
-
-
-///The btShapeHull class takes a btConvexShape, builds a simplified convex hull using btConvexHull and provides triangle indices and vertices.
-///It can be useful for to simplify a complex convex object and for visualization of a non-polyhedral convex object.
-///It approximates the convex hull using the supporting vertex of 42 directions.
-class btShapeHull
-{
-protected:
-
-	btAlignedObjectArray<btVector3> m_vertices;
-	btAlignedObjectArray<unsigned int> m_indices;
-	unsigned int m_numIndices;
-	const btConvexShape* m_shape;
-
-	static btVector3* getUnitSpherePoints();
-
-public:
-	btShapeHull (const btConvexShape* shape);
-	~btShapeHull ();
-
-	bool buildHull (btScalar margin);
-
-	int numTriangles () const;
-	int numVertices () const;
-	int numIndices () const;
-
-	const btVector3* getVertexPointer() const
-	{
-		return &m_vertices[0];
-	}
-	const unsigned int* getIndexPointer() const
-	{
-		return &m_indices[0];
-	}
-};
-
-#endif //BT_SHAPE_HULL_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btSphereShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btSphereShape.cpp
deleted file mode 100644
index b9a736c..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btSphereShape.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btSphereShape.h"
-#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
-
-#include "LinearMath/btQuaternion.h"
-
-btVector3	btSphereShape::localGetSupportingVertexWithoutMargin(const btVector3& vec)const
-{
-	(void)vec;
-	return btVector3(btScalar(0.),btScalar(0.),btScalar(0.));
-}
-
-void	btSphereShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
-{
-	(void)vectors;
-
-	for (int i=0;i<numVectors;i++)
-	{
-		supportVerticesOut[i].setValue(btScalar(0.),btScalar(0.),btScalar(0.));
-	}
-}
-
-
-btVector3	btSphereShape::localGetSupportingVertex(const btVector3& vec)const
-{
-	btVector3 supVertex;
-	supVertex = localGetSupportingVertexWithoutMargin(vec);
-
-	btVector3 vecnorm = vec;
-	if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
-	{
-		vecnorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.));
-	} 
-	vecnorm.normalize();
-	supVertex+= getMargin() * vecnorm;
-	return supVertex;
-}
-
-
-//broken due to scaling
-void btSphereShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
-{
-	const btVector3& center = t.getOrigin();
-	btVector3 extent(getMargin(),getMargin(),getMargin());
-	aabbMin = center - extent;
-	aabbMax = center + extent;
-}
-
-
-
-void	btSphereShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
-{
-	btScalar elem = btScalar(0.4) * mass * getMargin()*getMargin();
-	inertia.setValue(elem,elem,elem);
-
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btSphereShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btSphereShape.h
deleted file mode 100644
index b192efe..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btSphereShape.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-#ifndef BT_SPHERE_MINKOWSKI_H
-#define BT_SPHERE_MINKOWSKI_H
-
-#include "btConvexInternalShape.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
-
-///The btSphereShape implements an implicit sphere, centered around a local origin with radius.
-ATTRIBUTE_ALIGNED16(class) btSphereShape : public btConvexInternalShape
-
-{
-	
-public:
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-
-	btSphereShape (btScalar radius) : btConvexInternalShape ()
-	{
-		m_shapeType = SPHERE_SHAPE_PROXYTYPE;
-		m_implicitShapeDimensions.setX(radius);
-		m_collisionMargin = radius;
-	}
-	
-	virtual btVector3	localGetSupportingVertex(const btVector3& vec)const;
-	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
-	//notice that the vectors should be unit length
-	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
-
-
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
-
-	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
-
-
-	btScalar	getRadius() const { return m_implicitShapeDimensions.getX() * m_localScaling.getX();}
-
-	void	setUnscaledRadius(btScalar	radius)
-	{
-		m_implicitShapeDimensions.setX(radius);
-		btConvexInternalShape::setMargin(radius);
-	}
-
-	//debugging
-	virtual const char*	getName()const {return "SPHERE";}
-
-	virtual void	setMargin(btScalar margin)
-	{
-		btConvexInternalShape::setMargin(margin);
-	}
-	virtual btScalar	getMargin() const
-	{
-		//to improve gjk behaviour, use radius+margin as the full margin, so never get into the penetration case
-		//this means, non-uniform scaling is not supported anymore
-		return getRadius();
-	}
-
-
-};
-
-
-#endif //BT_SPHERE_MINKOWSKI_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStaticPlaneShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStaticPlaneShape.cpp
deleted file mode 100644
index 38ef8f0..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStaticPlaneShape.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btStaticPlaneShape.h"
-
-#include "LinearMath/btTransformUtil.h"
-
-
-btStaticPlaneShape::btStaticPlaneShape(const btVector3& planeNormal,btScalar planeConstant)
-: btConcaveShape (), m_planeNormal(planeNormal.normalized()),
-m_planeConstant(planeConstant),
-m_localScaling(btScalar(0.),btScalar(0.),btScalar(0.))
-{
-	m_shapeType = STATIC_PLANE_PROXYTYPE;
-	//	btAssert( btFuzzyZero(m_planeNormal.length() - btScalar(1.)) );
-}
-
-
-btStaticPlaneShape::~btStaticPlaneShape()
-{
-}
-
-
-
-void btStaticPlaneShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
-{
-	(void)t;
-	/*
-	btVector3 infvec (btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
-
-	btVector3 center = m_planeNormal*m_planeConstant;
-	aabbMin = center + infvec*m_planeNormal;
-	aabbMax = aabbMin;
-	aabbMin.setMin(center - infvec*m_planeNormal);
-	aabbMax.setMax(center - infvec*m_planeNormal); 
-	*/
-
-	aabbMin.setValue(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT));
-	aabbMax.setValue(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
-
-}
-
-
-
-
-void	btStaticPlaneShape::processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const
-{
-
-	btVector3 halfExtents = (aabbMax - aabbMin) * btScalar(0.5);
-	btScalar radius = halfExtents.length();
-	btVector3 center = (aabbMax + aabbMin) * btScalar(0.5);
-	
-	//this is where the triangles are generated, given AABB and plane equation (normal/constant)
-
-	btVector3 tangentDir0,tangentDir1;
-
-	//tangentDir0/tangentDir1 can be precalculated
-	btPlaneSpace1(m_planeNormal,tangentDir0,tangentDir1);
-
-	btVector3 supVertex0,supVertex1;
-
-	btVector3 projectedCenter = center - (m_planeNormal.dot(center) - m_planeConstant)*m_planeNormal;
-	
-	btVector3 triangle[3];
-	triangle[0] = projectedCenter + tangentDir0*radius + tangentDir1*radius;
-	triangle[1] = projectedCenter + tangentDir0*radius - tangentDir1*radius;
-	triangle[2] = projectedCenter - tangentDir0*radius - tangentDir1*radius;
-
-	callback->processTriangle(triangle,0,0);
-
-	triangle[0] = projectedCenter - tangentDir0*radius - tangentDir1*radius;
-	triangle[1] = projectedCenter - tangentDir0*radius + tangentDir1*radius;
-	triangle[2] = projectedCenter + tangentDir0*radius + tangentDir1*radius;
-
-	callback->processTriangle(triangle,0,1);
-
-}
-
-void	btStaticPlaneShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
-{
-	(void)mass;
-
-	//moving concave objects not supported
-	
-	inertia.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
-}
-
-void	btStaticPlaneShape::setLocalScaling(const btVector3& scaling)
-{
-	m_localScaling = scaling;
-}
-const btVector3& btStaticPlaneShape::getLocalScaling() const
-{
-	return m_localScaling;
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStaticPlaneShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStaticPlaneShape.h
deleted file mode 100644
index b13825e..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStaticPlaneShape.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_STATIC_PLANE_SHAPE_H
-#define BT_STATIC_PLANE_SHAPE_H
-
-#include "btConcaveShape.h"
-
-
-///The btStaticPlaneShape simulates an infinite non-moving (static) collision plane.
-ATTRIBUTE_ALIGNED16(class) btStaticPlaneShape : public btConcaveShape
-{
-protected:
-	btVector3	m_localAabbMin;
-	btVector3	m_localAabbMax;
-	
-	btVector3	m_planeNormal;
-	btScalar      m_planeConstant;
-	btVector3	m_localScaling;
-
-public:
-	btStaticPlaneShape(const btVector3& planeNormal,btScalar planeConstant);
-
-	virtual ~btStaticPlaneShape();
-
-
-	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
-
-	virtual void	processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const;
-
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
-
-	virtual void	setLocalScaling(const btVector3& scaling);
-	virtual const btVector3& getLocalScaling() const;
-	
-	const btVector3&	getPlaneNormal() const
-	{
-		return	m_planeNormal;
-	}
-
-	const btScalar&	getPlaneConstant() const
-	{
-		return	m_planeConstant;
-	}
-
-	//debugging
-	virtual const char*	getName()const {return "STATICPLANE";}
-
-	virtual	int	calculateSerializeBufferSize() const;
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
-
-
-};
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btStaticPlaneShapeData
-{
-	btCollisionShapeData	m_collisionShapeData;
-
-	btVector3FloatData	m_localScaling;
-	btVector3FloatData	m_planeNormal;
-	float			m_planeConstant;
-	char	m_pad[4];
-};
-
-
-SIMD_FORCE_INLINE	int	btStaticPlaneShape::calculateSerializeBufferSize() const
-{
-	return sizeof(btStaticPlaneShapeData);
-}
-
-///fills the dataBuffer and returns the struct name (and 0 on failure)
-SIMD_FORCE_INLINE	const char*	btStaticPlaneShape::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-	btStaticPlaneShapeData* planeData = (btStaticPlaneShapeData*) dataBuffer;
-	btCollisionShape::serialize(&planeData->m_collisionShapeData,serializer);
-
-	m_localScaling.serializeFloat(planeData->m_localScaling);
-	m_planeNormal.serializeFloat(planeData->m_planeNormal);
-	planeData->m_planeConstant = float(m_planeConstant);
-		
-	return "btStaticPlaneShapeData";
-}
-
-
-#endif //BT_STATIC_PLANE_SHAPE_H
-
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp
deleted file mode 100644
index bc2f9f2..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btStridingMeshInterface.h"
-#include "LinearMath/btSerializer.h"
-
-btStridingMeshInterface::~btStridingMeshInterface()
-{
-
-}
-
-
-void	btStridingMeshInterface::InternalProcessAllTriangles(btInternalTriangleIndexCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const
-{
-	(void)aabbMin;
-	(void)aabbMax;
-	int numtotalphysicsverts = 0;
-	int part,graphicssubparts = getNumSubParts();
-	const unsigned char * vertexbase;
-	const unsigned char * indexbase;
-	int indexstride;
-	PHY_ScalarType type;
-	PHY_ScalarType gfxindextype;
-	int stride,numverts,numtriangles;
-	int gfxindex;
-	btVector3 triangle[3];
-
-	btVector3 meshScaling = getScaling();
-
-	///if the number of parts is big, the performance might drop due to the innerloop switch on indextype
-	for (part=0;part<graphicssubparts ;part++)
-	{
-		getLockedReadOnlyVertexIndexBase(&vertexbase,numverts,type,stride,&indexbase,indexstride,numtriangles,gfxindextype,part);
-		numtotalphysicsverts+=numtriangles*3; //upper bound
-
-		///unlike that developers want to pass in double-precision meshes in single-precision Bullet build
-		///so disable this feature by default
-		///see patch http://code.google.com/p/bullet/issues/detail?id=213
-
-		switch (type)
-		{
-		case PHY_FLOAT:
-		 {
-
-			 float* graphicsbase;
-
-			 switch (gfxindextype)
-			 {
-			 case PHY_INTEGER:
-				 {
-					 for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
-					 {
-						 unsigned int* tri_indices= (unsigned int*)(indexbase+gfxindex*indexstride);
-						 graphicsbase = (float*)(vertexbase+tri_indices[0]*stride);
-						 triangle[0].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),graphicsbase[2]*meshScaling.getZ());
-						 graphicsbase = (float*)(vertexbase+tri_indices[1]*stride);
-						 triangle[1].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),	graphicsbase[2]*meshScaling.getZ());
-						 graphicsbase = (float*)(vertexbase+tri_indices[2]*stride);
-						 triangle[2].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),	graphicsbase[2]*meshScaling.getZ());
-						 callback->internalProcessTriangleIndex(triangle,part,gfxindex);
-					 }
-					 break;
-				 }
-			 case PHY_SHORT:
-				 {
-					 for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
-					 {
-						 unsigned short int* tri_indices= (unsigned short int*)(indexbase+gfxindex*indexstride);
-						 graphicsbase = (float*)(vertexbase+tri_indices[0]*stride);
-						 triangle[0].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),graphicsbase[2]*meshScaling.getZ());
-						 graphicsbase = (float*)(vertexbase+tri_indices[1]*stride);
-						 triangle[1].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),	graphicsbase[2]*meshScaling.getZ());
-						 graphicsbase = (float*)(vertexbase+tri_indices[2]*stride);
-						 triangle[2].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),	graphicsbase[2]*meshScaling.getZ());
-						 callback->internalProcessTriangleIndex(triangle,part,gfxindex);
-					 }
-					 break;
-				 }
-			case PHY_UCHAR:
-				 {
-					 for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
-					 {
-						 unsigned char* tri_indices= (unsigned char*)(indexbase+gfxindex*indexstride);
-						 graphicsbase = (float*)(vertexbase+tri_indices[0]*stride);
-						 triangle[0].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),graphicsbase[2]*meshScaling.getZ());
-						 graphicsbase = (float*)(vertexbase+tri_indices[1]*stride);
-						 triangle[1].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),	graphicsbase[2]*meshScaling.getZ());
-						 graphicsbase = (float*)(vertexbase+tri_indices[2]*stride);
-						 triangle[2].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),	graphicsbase[2]*meshScaling.getZ());
-						 callback->internalProcessTriangleIndex(triangle,part,gfxindex);
-					 }
-					 break;
-				 }
-			 default:
-				 btAssert((gfxindextype == PHY_INTEGER) || (gfxindextype == PHY_SHORT));
-			 }
-			 break;
-		 }
-
-		case PHY_DOUBLE:
-			{
-				double* graphicsbase;
-
-				switch (gfxindextype)
-				{
-				case PHY_INTEGER:
-					{
-						for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
-						{
-							unsigned int* tri_indices= (unsigned int*)(indexbase+gfxindex*indexstride);
-							graphicsbase = (double*)(vertexbase+tri_indices[0]*stride);
-							triangle[0].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),(btScalar)graphicsbase[2]*meshScaling.getZ());
-							graphicsbase = (double*)(vertexbase+tri_indices[1]*stride);
-							triangle[1].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),  (btScalar)graphicsbase[2]*meshScaling.getZ());
-							graphicsbase = (double*)(vertexbase+tri_indices[2]*stride);
-							triangle[2].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),  (btScalar)graphicsbase[2]*meshScaling.getZ());
-							callback->internalProcessTriangleIndex(triangle,part,gfxindex);
-						}
-						break;
-					}
-				case PHY_SHORT:
-					{
-						for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
-						{
-							unsigned short int* tri_indices= (unsigned short int*)(indexbase+gfxindex*indexstride);
-							graphicsbase = (double*)(vertexbase+tri_indices[0]*stride);
-							triangle[0].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),(btScalar)graphicsbase[2]*meshScaling.getZ());
-							graphicsbase = (double*)(vertexbase+tri_indices[1]*stride);
-							triangle[1].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),  (btScalar)graphicsbase[2]*meshScaling.getZ());
-							graphicsbase = (double*)(vertexbase+tri_indices[2]*stride);
-							triangle[2].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),  (btScalar)graphicsbase[2]*meshScaling.getZ());
-							callback->internalProcessTriangleIndex(triangle,part,gfxindex);
-						}
-						break;
-					}
-				case PHY_UCHAR:
-					{
-						for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
-						{
-							unsigned char* tri_indices= (unsigned char*)(indexbase+gfxindex*indexstride);
-							graphicsbase = (double*)(vertexbase+tri_indices[0]*stride);
-							triangle[0].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),(btScalar)graphicsbase[2]*meshScaling.getZ());
-							graphicsbase = (double*)(vertexbase+tri_indices[1]*stride);
-							triangle[1].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),  (btScalar)graphicsbase[2]*meshScaling.getZ());
-							graphicsbase = (double*)(vertexbase+tri_indices[2]*stride);
-							triangle[2].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),  (btScalar)graphicsbase[2]*meshScaling.getZ());
-							callback->internalProcessTriangleIndex(triangle,part,gfxindex);
-						}
-						break;
-					}
-				default:
-					btAssert((gfxindextype == PHY_INTEGER) || (gfxindextype == PHY_SHORT));
-				}
-				break;
-			}
-		default:
-			btAssert((type == PHY_FLOAT) || (type == PHY_DOUBLE));
-		}
-
-		unLockReadOnlyVertexBase(part);
-	}
-}
-
-void	btStridingMeshInterface::calculateAabbBruteForce(btVector3& aabbMin,btVector3& aabbMax)
-{
-
-	struct	AabbCalculationCallback : public btInternalTriangleIndexCallback
-	{
-		btVector3	m_aabbMin;
-		btVector3	m_aabbMax;
-
-		AabbCalculationCallback()
-		{
-			m_aabbMin.setValue(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
-			m_aabbMax.setValue(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT));
-		}
-
-		virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int  triangleIndex)
-		{
-			(void)partId;
-			(void)triangleIndex;
-
-			m_aabbMin.setMin(triangle[0]);
-			m_aabbMax.setMax(triangle[0]);
-			m_aabbMin.setMin(triangle[1]);
-			m_aabbMax.setMax(triangle[1]);
-			m_aabbMin.setMin(triangle[2]);
-			m_aabbMax.setMax(triangle[2]);
-		}
-	};
-
-	//first calculate the total aabb for all triangles
-	AabbCalculationCallback	aabbCallback;
-	aabbMin.setValue(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT));
-	aabbMax.setValue(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
-	InternalProcessAllTriangles(&aabbCallback,aabbMin,aabbMax);
-
-	aabbMin = aabbCallback.m_aabbMin;
-	aabbMax = aabbCallback.m_aabbMax;
-}
-
-
-
-///fills the dataBuffer and returns the struct name (and 0 on failure)
-const char*	btStridingMeshInterface::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-	btStridingMeshInterfaceData* trimeshData = (btStridingMeshInterfaceData*) dataBuffer;
-
-	trimeshData->m_numMeshParts = getNumSubParts();
-
-	//void* uniquePtr = 0;
-
-	trimeshData->m_meshPartsPtr = 0;
-
-	if (trimeshData->m_numMeshParts)
-	{
-		btChunk* chunk = serializer->allocate(sizeof(btMeshPartData),trimeshData->m_numMeshParts);
-		btMeshPartData* memPtr = (btMeshPartData*)chunk->m_oldPtr;
-		trimeshData->m_meshPartsPtr = (btMeshPartData *)serializer->getUniquePointer(memPtr);
-
-
-	//	int numtotalphysicsverts = 0;
-		int part,graphicssubparts = getNumSubParts();
-		const unsigned char * vertexbase;
-		const unsigned char * indexbase;
-		int indexstride;
-		PHY_ScalarType type;
-		PHY_ScalarType gfxindextype;
-		int stride,numverts,numtriangles;
-		int gfxindex;
-	//	btVector3 triangle[3];
-
-		btVector3 meshScaling = getScaling();
-
-		///if the number of parts is big, the performance might drop due to the innerloop switch on indextype
-		for (part=0;part<graphicssubparts ;part++,memPtr++)
-		{
-			getLockedReadOnlyVertexIndexBase(&vertexbase,numverts,type,stride,&indexbase,indexstride,numtriangles,gfxindextype,part);
-			memPtr->m_numTriangles = numtriangles;//indices = 3*numtriangles
-			memPtr->m_numVertices = numverts;
-			memPtr->m_indices16 = 0;
-			memPtr->m_indices32 = 0;
-			memPtr->m_3indices16 = 0;
-			memPtr->m_vertices3f = 0;
-			memPtr->m_vertices3d = 0;
-
-			switch (gfxindextype)
-			{
-			case PHY_INTEGER:
-				{
-					int numindices = numtriangles*3;
-				
-					if (numindices)
-					{
-						btChunk* chunk = serializer->allocate(sizeof(btIntIndexData),numindices);
-						btIntIndexData* tmpIndices = (btIntIndexData*)chunk->m_oldPtr;
-						memPtr->m_indices32 = (btIntIndexData*)serializer->getUniquePointer(tmpIndices);
-						for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
-						{
-							unsigned int* tri_indices= (unsigned int*)(indexbase+gfxindex*indexstride);
-							tmpIndices[gfxindex*3].m_value = tri_indices[0];
-							tmpIndices[gfxindex*3+1].m_value = tri_indices[1];
-							tmpIndices[gfxindex*3+2].m_value = tri_indices[2];
-						}
-						serializer->finalizeChunk(chunk,"btIntIndexData",BT_ARRAY_CODE,(void*)chunk->m_oldPtr);
-					}
-					break;
-				}
-			case PHY_SHORT:
-				{
-					if (numtriangles)
-					{
-						btChunk* chunk = serializer->allocate(sizeof(btShortIntIndexTripletData),numtriangles);
-						btShortIntIndexTripletData* tmpIndices = (btShortIntIndexTripletData*)chunk->m_oldPtr;
-						memPtr->m_3indices16 = (btShortIntIndexTripletData*) serializer->getUniquePointer(tmpIndices);
-						for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
-						{
-							unsigned short int* tri_indices= (unsigned short int*)(indexbase+gfxindex*indexstride);
-							tmpIndices[gfxindex].m_values[0] = tri_indices[0];
-							tmpIndices[gfxindex].m_values[1] = tri_indices[1];
-							tmpIndices[gfxindex].m_values[2] = tri_indices[2];
-						}
-						serializer->finalizeChunk(chunk,"btShortIntIndexTripletData",BT_ARRAY_CODE,(void*)chunk->m_oldPtr);
-					}
-					break;
-				}
-				case PHY_UCHAR:
-				{
-					if (numtriangles)
-					{
-						btChunk* chunk = serializer->allocate(sizeof(btCharIndexTripletData),numtriangles);
-						btCharIndexTripletData* tmpIndices = (btCharIndexTripletData*)chunk->m_oldPtr;
-						memPtr->m_3indices8 = (btCharIndexTripletData*) serializer->getUniquePointer(tmpIndices);
-						for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
-						{
-							unsigned char* tri_indices= (unsigned char*)(indexbase+gfxindex*indexstride);
-							tmpIndices[gfxindex].m_values[0] = tri_indices[0];
-							tmpIndices[gfxindex].m_values[1] = tri_indices[1];
-							tmpIndices[gfxindex].m_values[2] = tri_indices[2];
-						}
-						serializer->finalizeChunk(chunk,"btCharIndexTripletData",BT_ARRAY_CODE,(void*)chunk->m_oldPtr);
-					}
-					break;
-				}
-			default:
-				{
-					btAssert(0);
-					//unknown index type
-				}
-			}
-
-			switch (type)
-			{
-			case PHY_FLOAT:
-			 {
-				 float* graphicsbase;
-
-				 if (numverts)
-				 {
-					 btChunk* chunk = serializer->allocate(sizeof(btVector3FloatData),numverts);
-					 btVector3FloatData* tmpVertices = (btVector3FloatData*) chunk->m_oldPtr;
-					 memPtr->m_vertices3f = (btVector3FloatData *)serializer->getUniquePointer(tmpVertices);
-					 for (int i=0;i<numverts;i++)
-					 {
-						 graphicsbase = (float*)(vertexbase+i*stride);
-						 tmpVertices[i].m_floats[0] = graphicsbase[0];
-						 tmpVertices[i].m_floats[1] = graphicsbase[1];
-						 tmpVertices[i].m_floats[2] = graphicsbase[2];
-					 }
-					 serializer->finalizeChunk(chunk,"btVector3FloatData",BT_ARRAY_CODE,(void*)chunk->m_oldPtr);
-				 }
-				 break;
-				}
-
-			case PHY_DOUBLE:
-				{
-					if (numverts)
-					{
-						btChunk* chunk = serializer->allocate(sizeof(btVector3DoubleData),numverts);
-						btVector3DoubleData* tmpVertices = (btVector3DoubleData*) chunk->m_oldPtr;
-						memPtr->m_vertices3d = (btVector3DoubleData *) serializer->getUniquePointer(tmpVertices);
-						for (int i=0;i<numverts;i++)
-					 {
-						 double* graphicsbase = (double*)(vertexbase+i*stride);//for now convert to float, might leave it at double
-						 tmpVertices[i].m_floats[0] = graphicsbase[0];
-						 tmpVertices[i].m_floats[1] = graphicsbase[1];
-						 tmpVertices[i].m_floats[2] = graphicsbase[2];
-					 }
-						serializer->finalizeChunk(chunk,"btVector3DoubleData",BT_ARRAY_CODE,(void*)chunk->m_oldPtr);
-					}
-					break;
-				}
-
-			default:
-				btAssert((type == PHY_FLOAT) || (type == PHY_DOUBLE));
-			}
-
-			unLockReadOnlyVertexBase(part);
-		}
-
-		serializer->finalizeChunk(chunk,"btMeshPartData",BT_ARRAY_CODE,chunk->m_oldPtr);
-	}
-
-
-	m_scaling.serializeFloat(trimeshData->m_scaling);
-	return "btStridingMeshInterfaceData";
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStridingMeshInterface.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStridingMeshInterface.h
deleted file mode 100644
index f2b27ad..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStridingMeshInterface.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_STRIDING_MESHINTERFACE_H
-#define BT_STRIDING_MESHINTERFACE_H
-
-#include "LinearMath/btVector3.h"
-#include "btTriangleCallback.h"
-#include "btConcaveShape.h"
-
-
-
-
-
-///	The btStridingMeshInterface is the interface class for high performance generic access to triangle meshes, used in combination with btBvhTriangleMeshShape and some other collision shapes.
-/// Using index striding of 3*sizeof(integer) it can use triangle arrays, using index striding of 1*sizeof(integer) it can handle triangle strips.
-/// It allows for sharing graphics and collision meshes. Also it provides locking/unlocking of graphics meshes that are in gpu memory.
-class  btStridingMeshInterface
-{
-	protected:
-	
-		btVector3 m_scaling;
-
-	public:
-		btStridingMeshInterface() :m_scaling(btScalar(1.),btScalar(1.),btScalar(1.))
-		{
-
-		}
-
-		virtual ~btStridingMeshInterface();
-
-
-
-		virtual void	InternalProcessAllTriangles(btInternalTriangleIndexCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const;
-
-		///brute force method to calculate aabb
-		void	calculateAabbBruteForce(btVector3& aabbMin,btVector3& aabbMax);
-
-		/// get read and write access to a subpart of a triangle mesh
-		/// this subpart has a continuous array of vertices and indices
-		/// in this way the mesh can be handled as chunks of memory with striding
-		/// very similar to OpenGL vertexarray support
-		/// make a call to unLockVertexBase when the read and write access is finished	
-		virtual void	getLockedVertexIndexBase(unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0)=0;
-		
-		virtual void	getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,const unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0) const=0;
-	
-		/// unLockVertexBase finishes the access to a subpart of the triangle mesh
-		/// make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished
-		virtual void	unLockVertexBase(int subpart)=0;
-
-		virtual void	unLockReadOnlyVertexBase(int subpart) const=0;
-
-
-		/// getNumSubParts returns the number of seperate subparts
-		/// each subpart has a continuous array of vertices and indices
-		virtual int		getNumSubParts() const=0;
-
-		virtual void	preallocateVertices(int numverts)=0;
-		virtual void	preallocateIndices(int numindices)=0;
-
-		virtual bool	hasPremadeAabb() const { return false; }
-		virtual void	setPremadeAabb(const btVector3& aabbMin, const btVector3& aabbMax ) const
-                {
-                        (void) aabbMin;
-                        (void) aabbMax;
-                }
-		virtual void	getPremadeAabb(btVector3* aabbMin, btVector3* aabbMax ) const
-        {
-            (void) aabbMin;
-            (void) aabbMax;
-        }
-
-		const btVector3&	getScaling() const {
-			return m_scaling;
-		}
-		void	setScaling(const btVector3& scaling)
-		{
-			m_scaling = scaling;
-		}
-
-		virtual	int	calculateSerializeBufferSize() const;
-
-		///fills the dataBuffer and returns the struct name (and 0 on failure)
-		virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
-
-
-};
-
-struct	btIntIndexData
-{
-	int	m_value;
-};
-
-struct	btShortIntIndexData
-{
-	short m_value;
-	char m_pad[2];
-};
-
-struct	btShortIntIndexTripletData
-{
-	short	m_values[3];
-	char	m_pad[2];
-};
-
-struct	btCharIndexTripletData
-{
-	unsigned char m_values[3];
-	char	m_pad;
-};
-
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btMeshPartData
-{
-	btVector3FloatData			*m_vertices3f;
-	btVector3DoubleData			*m_vertices3d;
-
-	btIntIndexData				*m_indices32;
-	btShortIntIndexTripletData	*m_3indices16;
-	btCharIndexTripletData		*m_3indices8;
-
-	btShortIntIndexData			*m_indices16;//backwards compatibility
-
-	int                     m_numTriangles;//length of m_indices = m_numTriangles
-	int                     m_numVertices;
-};
-
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btStridingMeshInterfaceData
-{
-	btMeshPartData	*m_meshPartsPtr;
-	btVector3FloatData	m_scaling;
-	int	m_numMeshParts;
-	char m_padding[4];
-};
-
-
-
-
-SIMD_FORCE_INLINE	int	btStridingMeshInterface::calculateSerializeBufferSize() const
-{
-	return sizeof(btStridingMeshInterfaceData);
-}
-
-
-
-#endif //BT_STRIDING_MESHINTERFACE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTetrahedronShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTetrahedronShape.cpp
deleted file mode 100644
index 52f346b..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTetrahedronShape.cpp
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btTetrahedronShape.h"
-#include "LinearMath/btMatrix3x3.h"
-
-btBU_Simplex1to4::btBU_Simplex1to4() : btPolyhedralConvexAabbCachingShape (),
-m_numVertices(0)
-{
-	m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
-}
-
-btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0) : btPolyhedralConvexAabbCachingShape (),
-m_numVertices(0)
-{
-	m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
-	addVertex(pt0);
-}
-
-btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1) : btPolyhedralConvexAabbCachingShape (),
-m_numVertices(0)
-{
-	m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
-	addVertex(pt0);
-	addVertex(pt1);
-}
-
-btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2) : btPolyhedralConvexAabbCachingShape (),
-m_numVertices(0)
-{
-	m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
-	addVertex(pt0);
-	addVertex(pt1);
-	addVertex(pt2);
-}
-
-btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2,const btVector3& pt3) : btPolyhedralConvexAabbCachingShape (),
-m_numVertices(0)
-{
-	m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
-	addVertex(pt0);
-	addVertex(pt1);
-	addVertex(pt2);
-	addVertex(pt3);
-}
-
-
-void btBU_Simplex1to4::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
-{
-#if 1
-	btPolyhedralConvexAabbCachingShape::getAabb(t,aabbMin,aabbMax);
-#else
-	aabbMin.setValue(BT_LARGE_FLOAT,BT_LARGE_FLOAT,BT_LARGE_FLOAT);
-	aabbMax.setValue(-BT_LARGE_FLOAT,-BT_LARGE_FLOAT,-BT_LARGE_FLOAT);
-
-	//just transform the vertices in worldspace, and take their AABB
-	for (int i=0;i<m_numVertices;i++)
-	{
-		btVector3 worldVertex = t(m_vertices[i]);
-		aabbMin.setMin(worldVertex);
-		aabbMax.setMax(worldVertex);
-	}
-#endif
-}
-
-
-
-
-
-void btBU_Simplex1to4::addVertex(const btVector3& pt)
-{
-	m_vertices[m_numVertices++] = pt;
-	recalcLocalAabb();
-}
-
-
-int	btBU_Simplex1to4::getNumVertices() const
-{
-	return m_numVertices;
-}
-
-int btBU_Simplex1to4::getNumEdges() const
-{
-	//euler formula, F-E+V = 2, so E = F+V-2
-
-	switch (m_numVertices)
-	{
-	case 0:
-		return 0;
-	case 1: return 0;
-	case 2: return 1;
-	case 3: return 3;
-	case 4: return 6;
-
-
-	}
-
-	return 0;
-}
-
-void btBU_Simplex1to4::getEdge(int i,btVector3& pa,btVector3& pb) const
-{
-	
-    switch (m_numVertices)
-	{
-
-	case 2: 
-		pa = m_vertices[0];
-		pb = m_vertices[1];
-		break;
-	case 3:  
-		switch (i)
-		{
-		case 0:
-			pa = m_vertices[0];
-			pb = m_vertices[1];
-			break;
-		case 1:
-			pa = m_vertices[1];
-			pb = m_vertices[2];
-			break;
-		case 2:
-			pa = m_vertices[2];
-			pb = m_vertices[0];
-			break;
-
-		}
-		break;
-	case 4: 
-		switch (i)
-		{
-		case 0:
-			pa = m_vertices[0];
-			pb = m_vertices[1];
-			break;
-		case 1:
-			pa = m_vertices[1];
-			pb = m_vertices[2];
-			break;
-		case 2:
-			pa = m_vertices[2];
-			pb = m_vertices[0];
-			break;
-		case 3:
-			pa = m_vertices[0];
-			pb = m_vertices[3];
-			break;
-		case 4:
-			pa = m_vertices[1];
-			pb = m_vertices[3];
-			break;
-		case 5:
-			pa = m_vertices[2];
-			pb = m_vertices[3];
-			break;
-		}
-
-	}
-
-
-
-
-}
-
-void btBU_Simplex1to4::getVertex(int i,btVector3& vtx) const
-{
-	vtx = m_vertices[i];
-}
-
-int	btBU_Simplex1to4::getNumPlanes() const
-{
-	switch (m_numVertices)
-	{
-	case 0:
-			return 0;
-	case 1:
-			return 0;
-	case 2:
-			return 0;
-	case 3:
-			return 2;
-	case 4:
-			return 4;
-	default:
-		{
-		}
-	}
-	return 0;
-}
-
-
-void btBU_Simplex1to4::getPlane(btVector3&, btVector3& ,int ) const
-{
-	
-}
-
-int btBU_Simplex1to4::getIndex(int ) const
-{
-	return 0;
-}
-
-bool btBU_Simplex1to4::isInside(const btVector3& ,btScalar ) const
-{
-	return false;
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTetrahedronShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTetrahedronShape.h
deleted file mode 100644
index 6b7128e..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTetrahedronShape.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_SIMPLEX_1TO4_SHAPE
-#define BT_SIMPLEX_1TO4_SHAPE
-
-
-#include "btPolyhedralConvexShape.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-
-
-///The btBU_Simplex1to4 implements tetrahedron, triangle, line, vertex collision shapes. In most cases it is better to use btConvexHullShape instead.
-class btBU_Simplex1to4 : public btPolyhedralConvexAabbCachingShape
-{
-protected:
-
-	int	m_numVertices;
-	btVector3	m_vertices[4];
-
-public:
-	btBU_Simplex1to4();
-
-	btBU_Simplex1to4(const btVector3& pt0);
-	btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1);
-	btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2);
-	btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2,const btVector3& pt3);
-
-    
-	void	reset()
-	{
-		m_numVertices = 0;
-	}
-	
-	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
-
-	void addVertex(const btVector3& pt);
-
-	//PolyhedralConvexShape interface
-
-	virtual int	getNumVertices() const;
-
-	virtual int getNumEdges() const;
-
-	virtual void getEdge(int i,btVector3& pa,btVector3& pb) const;
-	
-	virtual void getVertex(int i,btVector3& vtx) const;
-
-	virtual int	getNumPlanes() const;
-
-	virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i) const;
-
-	virtual int getIndex(int i) const;
-
-	virtual	bool isInside(const btVector3& pt,btScalar tolerance) const;
-
-
-	///getName is for debugging
-	virtual const char*	getName()const { return "btBU_Simplex1to4";}
-
-};
-
-#endif //BT_SIMPLEX_1TO4_SHAPE
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleBuffer.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleBuffer.cpp
deleted file mode 100644
index 3027e65..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleBuffer.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btTriangleBuffer.h"
-
-
-
-
-
-
-
-void btTriangleBuffer::processTriangle(btVector3* triangle,int partId,int  triangleIndex)
-{
-		btTriangle	tri;
-		tri.m_vertex0 = triangle[0];
-		tri.m_vertex1 = triangle[1];
-		tri.m_vertex2 = triangle[2];
-		tri.m_partId = partId;
-		tri.m_triangleIndex = triangleIndex;
-			
-		m_triangleBuffer.push_back(tri);
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleBuffer.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleBuffer.h
deleted file mode 100644
index b71fc8b..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleBuffer.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_TRIANGLE_BUFFER_H
-#define BT_TRIANGLE_BUFFER_H
-
-#include "btTriangleCallback.h"
-#include "LinearMath/btAlignedObjectArray.h"
-
-struct	btTriangle
-{
-	btVector3	m_vertex0;
-	btVector3	m_vertex1;
-	btVector3	m_vertex2;
-	int	m_partId;
-	int	m_triangleIndex;
-};
-
-///The btTriangleBuffer callback can be useful to collect and store overlapping triangles between AABB and concave objects that support 'processAllTriangles'
-///Example usage of this class:
-///			btTriangleBuffer	triBuf;
-///			concaveShape->processAllTriangles(&triBuf,aabbMin, aabbMax);
-///			for (int i=0;i<triBuf.getNumTriangles();i++)
-///			{
-///				const btTriangle& tri = triBuf.getTriangle(i);
-///				//do something useful here with the triangle
-///			}
-class btTriangleBuffer : public btTriangleCallback
-{
-
-	btAlignedObjectArray<btTriangle>	m_triangleBuffer;
-	
-public:
-
-
-	virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex);
-	
-	int	getNumTriangles() const
-	{
-		return int(m_triangleBuffer.size());
-	}
-	
-	const btTriangle&	getTriangle(int index) const
-	{
-		return m_triangleBuffer[index];
-	}
-
-	void	clearBuffer()
-	{
-		m_triangleBuffer.clear();
-	}
-	
-};
-
-
-#endif //BT_TRIANGLE_BUFFER_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleCallback.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleCallback.cpp
deleted file mode 100644
index f558bf6..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleCallback.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btTriangleCallback.h"
-
-btTriangleCallback::~btTriangleCallback()
-{
-
-}
-
-
-btInternalTriangleIndexCallback::~btInternalTriangleIndexCallback()
-{
-
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleCallback.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleCallback.h
deleted file mode 100644
index 461c57f..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleCallback.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_TRIANGLE_CALLBACK_H
-#define BT_TRIANGLE_CALLBACK_H
-
-#include "LinearMath/btVector3.h"
-
-
-///The btTriangleCallback provides a callback for each overlapping triangle when calling processAllTriangles.
-///This callback is called by processAllTriangles for all btConcaveShape derived class, such as  btBvhTriangleMeshShape, btStaticPlaneShape and btHeightfieldTerrainShape.
-class btTriangleCallback
-{
-public:
-
-	virtual ~btTriangleCallback();
-	virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex) = 0;
-};
-
-class btInternalTriangleIndexCallback
-{
-public:
-
-	virtual ~btInternalTriangleIndexCallback();
-	virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int  triangleIndex) = 0;
-};
-
-
-
-#endif //BT_TRIANGLE_CALLBACK_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp
deleted file mode 100644
index a665024..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btTriangleIndexVertexArray.h"
-
-btTriangleIndexVertexArray::btTriangleIndexVertexArray(int numTriangles,int* triangleIndexBase,int triangleIndexStride,int numVertices,btScalar* vertexBase,int vertexStride)
-: m_hasAabb(0)
-{
-	btIndexedMesh mesh;
-
-	mesh.m_numTriangles = numTriangles;
-	mesh.m_triangleIndexBase = (const unsigned char *)triangleIndexBase;
-	mesh.m_triangleIndexStride = triangleIndexStride;
-	mesh.m_numVertices = numVertices;
-	mesh.m_vertexBase = (const unsigned char *)vertexBase;
-	mesh.m_vertexStride = vertexStride;
-
-	addIndexedMesh(mesh);
-
-}
-
-btTriangleIndexVertexArray::~btTriangleIndexVertexArray()
-{
-
-}
-
-void	btTriangleIndexVertexArray::getLockedVertexIndexBase(unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& vertexStride,unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart)
-{
-	btAssert(subpart< getNumSubParts() );
-
-	btIndexedMesh& mesh = m_indexedMeshes[subpart];
-
-	numverts = mesh.m_numVertices;
-	(*vertexbase) = (unsigned char *) mesh.m_vertexBase;
-
-   type = mesh.m_vertexType;
-
-	vertexStride = mesh.m_vertexStride;
-
-	numfaces = mesh.m_numTriangles;
-
-	(*indexbase) = (unsigned char *)mesh.m_triangleIndexBase;
-	indexstride = mesh.m_triangleIndexStride;
-	indicestype = mesh.m_indexType;
-}
-
-void	btTriangleIndexVertexArray::getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& vertexStride,const unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart) const
-{
-	const btIndexedMesh& mesh = m_indexedMeshes[subpart];
-
-	numverts = mesh.m_numVertices;
-	(*vertexbase) = (const unsigned char *)mesh.m_vertexBase;
-
-   type = mesh.m_vertexType;
-   
-	vertexStride = mesh.m_vertexStride;
-
-	numfaces = mesh.m_numTriangles;
-	(*indexbase) = (const unsigned char *)mesh.m_triangleIndexBase;
-	indexstride = mesh.m_triangleIndexStride;
-	indicestype = mesh.m_indexType;
-}
-
-bool	btTriangleIndexVertexArray::hasPremadeAabb() const
-{
-	return (m_hasAabb == 1);
-}
-
-
-void	btTriangleIndexVertexArray::setPremadeAabb(const btVector3& aabbMin, const btVector3& aabbMax ) const
-{
-	m_aabbMin = aabbMin;
-	m_aabbMax = aabbMax;
-	m_hasAabb = 1; // this is intentionally an int see notes in header
-}
-
-void	btTriangleIndexVertexArray::getPremadeAabb(btVector3* aabbMin, btVector3* aabbMax ) const
-{
-	*aabbMin = m_aabbMin;
-	*aabbMax = m_aabbMax;
-}
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h
deleted file mode 100644
index c64ea6e..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_TRIANGLE_INDEX_VERTEX_ARRAY_H
-#define BT_TRIANGLE_INDEX_VERTEX_ARRAY_H
-
-#include "btStridingMeshInterface.h"
-#include "LinearMath/btAlignedObjectArray.h"
-#include "LinearMath/btScalar.h"
-
-
-///The btIndexedMesh indexes a single vertex and index array. Multiple btIndexedMesh objects can be passed into a btTriangleIndexVertexArray using addIndexedMesh.
-///Instead of the number of indices, we pass the number of triangles.
-ATTRIBUTE_ALIGNED16( struct)	btIndexedMesh
-{
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-
-   int                     m_numTriangles;
-   const unsigned char *   m_triangleIndexBase;
-   int                     m_triangleIndexStride;
-   int                     m_numVertices;
-   const unsigned char *   m_vertexBase;
-   int                     m_vertexStride;
-
-   // The index type is set when adding an indexed mesh to the
-   // btTriangleIndexVertexArray, do not set it manually
-   PHY_ScalarType m_indexType;
-
-   // The vertex type has a default type similar to Bullet's precision mode (float or double)
-   // but can be set manually if you for example run Bullet with double precision but have
-   // mesh data in single precision..
-   PHY_ScalarType m_vertexType;
-
-
-   btIndexedMesh()
-	   :m_indexType(PHY_INTEGER),
-#ifdef BT_USE_DOUBLE_PRECISION
-      m_vertexType(PHY_DOUBLE)
-#else // BT_USE_DOUBLE_PRECISION
-      m_vertexType(PHY_FLOAT)
-#endif // BT_USE_DOUBLE_PRECISION
-      {
-      }
-}
-;
-
-
-typedef btAlignedObjectArray<btIndexedMesh>	IndexedMeshArray;
-
-///The btTriangleIndexVertexArray allows to access multiple triangle meshes, by indexing into existing triangle/index arrays.
-///Additional meshes can be added using addIndexedMesh
-///No duplcate is made of the vertex/index data, it only indexes into external vertex/index arrays.
-///So keep those arrays around during the lifetime of this btTriangleIndexVertexArray.
-ATTRIBUTE_ALIGNED16( class) btTriangleIndexVertexArray : public btStridingMeshInterface
-{
-protected:
-	IndexedMeshArray	m_indexedMeshes;
-	int m_pad[2];
-	mutable int m_hasAabb; // using int instead of bool to maintain alignment
-	mutable btVector3 m_aabbMin;
-	mutable btVector3 m_aabbMax;
-
-public:
-
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-
-	btTriangleIndexVertexArray() : m_hasAabb(0)
-	{
-	}
-
-	virtual ~btTriangleIndexVertexArray();
-
-	//just to be backwards compatible
-	btTriangleIndexVertexArray(int numTriangles,int* triangleIndexBase,int triangleIndexStride,int numVertices,btScalar* vertexBase,int vertexStride);
-	
-	void	addIndexedMesh(const btIndexedMesh& mesh, PHY_ScalarType indexType = PHY_INTEGER)
-	{
-		m_indexedMeshes.push_back(mesh);
-		m_indexedMeshes[m_indexedMeshes.size()-1].m_indexType = indexType;
-	}
-	
-	
-	virtual void	getLockedVertexIndexBase(unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& vertexStride,unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0);
-
-	virtual void	getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& vertexStride,const unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0) const;
-
-	/// unLockVertexBase finishes the access to a subpart of the triangle mesh
-	/// make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished
-	virtual void	unLockVertexBase(int subpart) {(void)subpart;}
-
-	virtual void	unLockReadOnlyVertexBase(int subpart) const {(void)subpart;}
-
-	/// getNumSubParts returns the number of seperate subparts
-	/// each subpart has a continuous array of vertices and indices
-	virtual int		getNumSubParts() const { 
-		return (int)m_indexedMeshes.size();
-	}
-
-	IndexedMeshArray&	getIndexedMeshArray()
-	{
-		return m_indexedMeshes;
-	}
-
-	const IndexedMeshArray&	getIndexedMeshArray() const
-	{
-		return m_indexedMeshes;
-	}
-
-	virtual void	preallocateVertices(int numverts){(void) numverts;}
-	virtual void	preallocateIndices(int numindices){(void) numindices;}
-
-	virtual bool	hasPremadeAabb() const;
-	virtual void	setPremadeAabb(const btVector3& aabbMin, const btVector3& aabbMax ) const;
-	virtual void	getPremadeAabb(btVector3* aabbMin, btVector3* aabbMax ) const;
-
-}
-;
-
-#endif //BT_TRIANGLE_INDEX_VERTEX_ARRAY_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp
deleted file mode 100644
index dc56294..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-///This file was created by Alex Silverman
-
-#include "btTriangleIndexVertexMaterialArray.h"
-
-btTriangleIndexVertexMaterialArray::btTriangleIndexVertexMaterialArray(int numTriangles,int* triangleIndexBase,int triangleIndexStride,
-                                   int numVertices,btScalar* vertexBase,int vertexStride,
-                                   int numMaterials, unsigned char* materialBase, int materialStride,
-                                   int* triangleMaterialsBase, int materialIndexStride) :
-btTriangleIndexVertexArray(numTriangles, triangleIndexBase, triangleIndexStride, numVertices, vertexBase, vertexStride)
-{
-    btMaterialProperties mat;
-
-    mat.m_numMaterials = numMaterials;
-    mat.m_materialBase = materialBase;
-    mat.m_materialStride = materialStride;
-#ifdef BT_USE_DOUBLE_PRECISION
-    mat.m_materialType = PHY_DOUBLE;
-#else
-    mat.m_materialType = PHY_FLOAT;
-#endif
-
-    mat.m_numTriangles = numTriangles;
-    mat.m_triangleMaterialsBase = (unsigned char *)triangleMaterialsBase;
-    mat.m_triangleMaterialStride = materialIndexStride;
-    mat.m_triangleType = PHY_INTEGER;
-
-    addMaterialProperties(mat);
-}
-
-
-void btTriangleIndexVertexMaterialArray::getLockedMaterialBase(unsigned char **materialBase, int& numMaterials, PHY_ScalarType& materialType, int& materialStride,
-                                   unsigned char ** triangleMaterialBase, int& numTriangles, int& triangleMaterialStride, PHY_ScalarType& triangleType, int subpart)
-{
-    btAssert(subpart< getNumSubParts() );
-
-    btMaterialProperties& mats = m_materials[subpart];
-
-    numMaterials = mats.m_numMaterials;
-    (*materialBase) = (unsigned char *) mats.m_materialBase;
-#ifdef BT_USE_DOUBLE_PRECISION
-    materialType = PHY_DOUBLE;
-#else
-    materialType = PHY_FLOAT;
-#endif
-    materialStride = mats.m_materialStride;
-
-    numTriangles = mats.m_numTriangles;
-    (*triangleMaterialBase) = (unsigned char *)mats.m_triangleMaterialsBase;
-    triangleMaterialStride = mats.m_triangleMaterialStride;
-    triangleType = mats.m_triangleType;
-}
-
-void btTriangleIndexVertexMaterialArray::getLockedReadOnlyMaterialBase(const unsigned char **materialBase, int& numMaterials, PHY_ScalarType& materialType, int& materialStride,
-                                           const unsigned char ** triangleMaterialBase, int& numTriangles, int& triangleMaterialStride, PHY_ScalarType& triangleType, int subpart)
-{
-    btMaterialProperties& mats = m_materials[subpart];
-
-    numMaterials = mats.m_numMaterials;
-    (*materialBase) = (const unsigned char *) mats.m_materialBase;
-#ifdef BT_USE_DOUBLE_PRECISION
-    materialType = PHY_DOUBLE;
-#else
-    materialType = PHY_FLOAT;
-#endif
-    materialStride = mats.m_materialStride;
-
-    numTriangles = mats.m_numTriangles;
-    (*triangleMaterialBase) = (const unsigned char *)mats.m_triangleMaterialsBase;
-    triangleMaterialStride = mats.m_triangleMaterialStride;
-    triangleType = mats.m_triangleType;
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.h
deleted file mode 100644
index ba4f7b4..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-///This file was created by Alex Silverman
-
-#ifndef BT_MULTIMATERIAL_TRIANGLE_INDEX_VERTEX_ARRAY_H
-#define BT_MULTIMATERIAL_TRIANGLE_INDEX_VERTEX_ARRAY_H
-
-#include "btTriangleIndexVertexArray.h"
-
-
-ATTRIBUTE_ALIGNED16( struct)	btMaterialProperties
-{
-    ///m_materialBase ==========> 2 btScalar values make up one material, friction then restitution
-    int m_numMaterials;
-    const unsigned char * m_materialBase;
-    int m_materialStride;
-    PHY_ScalarType m_materialType;
-    ///m_numTriangles <=========== This exists in the btIndexedMesh object for the same subpart, but since we're
-    ///                           padding the structure, it can be reproduced at no real cost
-    ///m_triangleMaterials =====> 1 integer value makes up one entry
-    ///                           eg: m_triangleMaterials[1] = 5; // This will set triangle 2 to use material 5
-    int m_numTriangles; 
-    const unsigned char * m_triangleMaterialsBase;
-    int m_triangleMaterialStride;
-    ///m_triangleType <========== Automatically set in addMaterialProperties
-    PHY_ScalarType m_triangleType;
-};
-
-typedef btAlignedObjectArray<btMaterialProperties>	MaterialArray;
-
-///Teh btTriangleIndexVertexMaterialArray is built on TriangleIndexVertexArray
-///The addition of a material array allows for the utilization of the partID and
-///triangleIndex that are returned in the ContactAddedCallback.  As with
-///TriangleIndexVertexArray, no duplicate is made of the material data, so it
-///is the users responsibility to maintain the array during the lifetime of the
-///TriangleIndexVertexMaterialArray.
-ATTRIBUTE_ALIGNED16(class) btTriangleIndexVertexMaterialArray : public btTriangleIndexVertexArray
-{
-protected:
-    MaterialArray       m_materials;
-		
-public:
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-
-    btTriangleIndexVertexMaterialArray()
-	{
-	}
-
-    btTriangleIndexVertexMaterialArray(int numTriangles,int* triangleIndexBase,int triangleIndexStride,
-        int numVertices,btScalar* vertexBase,int vertexStride,
-        int numMaterials, unsigned char* materialBase, int materialStride,
-        int* triangleMaterialsBase, int materialIndexStride);
-
-    virtual ~btTriangleIndexVertexMaterialArray() {}
-
-    void	addMaterialProperties(const btMaterialProperties& mat, PHY_ScalarType triangleType = PHY_INTEGER)
-    {
-        m_materials.push_back(mat);
-        m_materials[m_materials.size()-1].m_triangleType = triangleType;
-    }
-
-    virtual void getLockedMaterialBase(unsigned char **materialBase, int& numMaterials, PHY_ScalarType& materialType, int& materialStride,
-        unsigned char ** triangleMaterialBase, int& numTriangles, int& triangleMaterialStride, PHY_ScalarType& triangleType ,int subpart = 0);
-
-    virtual void getLockedReadOnlyMaterialBase(const unsigned char **materialBase, int& numMaterials, PHY_ScalarType& materialType, int& materialStride,
-        const unsigned char ** triangleMaterialBase, int& numTriangles, int& triangleMaterialStride, PHY_ScalarType& triangleType, int subpart = 0);
-
-}
-;
-
-#endif //BT_MULTIMATERIAL_TRIANGLE_INDEX_VERTEX_ARRAY_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleInfoMap.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleInfoMap.h
deleted file mode 100644
index 5aadfc6..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleInfoMap.h
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2010 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _BT_TRIANGLE_INFO_MAP_H
-#define _BT_TRIANGLE_INFO_MAP_H
-
-
-#include "LinearMath/btHashMap.h"
-#include "LinearMath/btSerializer.h"
-
-
-///for btTriangleInfo m_flags
-#define TRI_INFO_V0V1_CONVEX 1
-#define TRI_INFO_V1V2_CONVEX 2
-#define TRI_INFO_V2V0_CONVEX 4
-
-#define TRI_INFO_V0V1_SWAP_NORMALB 8
-#define TRI_INFO_V1V2_SWAP_NORMALB 16
-#define TRI_INFO_V2V0_SWAP_NORMALB 32
-
-
-///The btTriangleInfo structure stores information to adjust collision normals to avoid collisions against internal edges
-///it can be generated using 
-struct	btTriangleInfo
-{
-	btTriangleInfo()
-	{
-		m_edgeV0V1Angle = SIMD_2_PI;
-		m_edgeV1V2Angle = SIMD_2_PI;
-		m_edgeV2V0Angle = SIMD_2_PI;
-		m_flags=0;
-	}
-
-	int			m_flags;
-
-	btScalar	m_edgeV0V1Angle;
-	btScalar	m_edgeV1V2Angle;
-	btScalar	m_edgeV2V0Angle;
-
-};
-
-typedef btHashMap<btHashInt,btTriangleInfo> btInternalTriangleInfoMap;
-
-
-///The btTriangleInfoMap stores edge angle information for some triangles. You can compute this information yourself or using btGenerateInternalEdgeInfo.
-struct	btTriangleInfoMap : public btInternalTriangleInfoMap
-{
-	btScalar	m_convexEpsilon;///used to determine if an edge or contact normal is convex, using the dot product
-	btScalar	m_planarEpsilon; ///used to determine if a triangle edge is planar with zero angle
-	btScalar	m_equalVertexThreshold; ///used to compute connectivity: if the distance between two vertices is smaller than m_equalVertexThreshold, they are considered to be 'shared'
-	btScalar	m_edgeDistanceThreshold; ///used to determine edge contacts: if the closest distance between a contact point and an edge is smaller than this distance threshold it is considered to "hit the edge"
-	btScalar	m_maxEdgeAngleThreshold; //ignore edges that connect triangles at an angle larger than this m_maxEdgeAngleThreshold
-	btScalar	m_zeroAreaThreshold; ///used to determine if a triangle is degenerate (length squared of cross product of 2 triangle edges < threshold)
-	
-	
-	btTriangleInfoMap()
-	{
-		m_convexEpsilon = 0.00f;
-		m_planarEpsilon = 0.0001f;
-		m_equalVertexThreshold = btScalar(0.0001)*btScalar(0.0001);
-		m_edgeDistanceThreshold = btScalar(0.1);
-		m_zeroAreaThreshold = btScalar(0.0001)*btScalar(0.0001);
-		m_maxEdgeAngleThreshold = SIMD_2_PI;
-	}
-	virtual ~btTriangleInfoMap() {}
-
-	virtual	int	calculateSerializeBufferSize() const;
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
-
-	void	deSerialize(struct btTriangleInfoMapData& data);
-
-};
-
-struct	btTriangleInfoData
-{
-	int			m_flags;
-	float	m_edgeV0V1Angle;
-	float	m_edgeV1V2Angle;
-	float	m_edgeV2V0Angle;
-};
-
-struct	btTriangleInfoMapData
-{
-	int					*m_hashTablePtr;
-	int					*m_nextPtr;
-	btTriangleInfoData	*m_valueArrayPtr;
-	int					*m_keyArrayPtr;
-
-	float	m_convexEpsilon;
-	float	m_planarEpsilon;
-	float	m_equalVertexThreshold; 
-	float	m_edgeDistanceThreshold;
-	float	m_zeroAreaThreshold;
-
-	int		m_nextSize;
-	int		m_hashTableSize;
-	int		m_numValues;
-	int		m_numKeys;
-	char	m_padding[4];
-};
-
-SIMD_FORCE_INLINE	int	btTriangleInfoMap::calculateSerializeBufferSize() const
-{
-	return sizeof(btTriangleInfoMapData);
-}
-
-///fills the dataBuffer and returns the struct name (and 0 on failure)
-SIMD_FORCE_INLINE	const char*	btTriangleInfoMap::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-	btTriangleInfoMapData* tmapData = (btTriangleInfoMapData*) dataBuffer;
-	tmapData->m_convexEpsilon = m_convexEpsilon;
-	tmapData->m_planarEpsilon = m_planarEpsilon;
-	tmapData->m_equalVertexThreshold = m_equalVertexThreshold;
-	tmapData->m_edgeDistanceThreshold = m_edgeDistanceThreshold;
-	tmapData->m_zeroAreaThreshold = m_zeroAreaThreshold;
-	
-	tmapData->m_hashTableSize = m_hashTable.size();
-
-	tmapData->m_hashTablePtr = tmapData->m_hashTableSize ? (int*)serializer->getUniquePointer((void*)&m_hashTable[0]) : 0;
-	if (tmapData->m_hashTablePtr)
-	{ 
-		//serialize an int buffer
-		int sz = sizeof(int);
-		int numElem = tmapData->m_hashTableSize;
-		btChunk* chunk = serializer->allocate(sz,numElem);
-		int* memPtr = (int*)chunk->m_oldPtr;
-		for (int i=0;i<numElem;i++,memPtr++)
-		{
-			*memPtr = m_hashTable[i];
-		}
-		serializer->finalizeChunk(chunk,"int",BT_ARRAY_CODE,(void*)&m_hashTable[0]);
-
-	}
-
-	tmapData->m_nextSize = m_next.size();
-	tmapData->m_nextPtr = tmapData->m_nextSize? (int*)serializer->getUniquePointer((void*)&m_next[0]): 0;
-	if (tmapData->m_nextPtr)
-	{
-		int sz = sizeof(int);
-		int numElem = tmapData->m_nextSize;
-		btChunk* chunk = serializer->allocate(sz,numElem);
-		int* memPtr = (int*)chunk->m_oldPtr;
-		for (int i=0;i<numElem;i++,memPtr++)
-		{
-			*memPtr = m_next[i];
-		}
-		serializer->finalizeChunk(chunk,"int",BT_ARRAY_CODE,(void*)&m_next[0]);
-	}
-	
-	tmapData->m_numValues = m_valueArray.size();
-	tmapData->m_valueArrayPtr = tmapData->m_numValues ? (btTriangleInfoData*)serializer->getUniquePointer((void*)&m_valueArray[0]): 0;
-	if (tmapData->m_valueArrayPtr)
-	{
-		int sz = sizeof(btTriangleInfoData);
-		int numElem = tmapData->m_numValues;
-		btChunk* chunk = serializer->allocate(sz,numElem);
-		btTriangleInfoData* memPtr = (btTriangleInfoData*)chunk->m_oldPtr;
-		for (int i=0;i<numElem;i++,memPtr++)
-		{
-			memPtr->m_edgeV0V1Angle = m_valueArray[i].m_edgeV0V1Angle;
-			memPtr->m_edgeV1V2Angle = m_valueArray[i].m_edgeV1V2Angle;
-			memPtr->m_edgeV2V0Angle = m_valueArray[i].m_edgeV2V0Angle;
-			memPtr->m_flags = m_valueArray[i].m_flags;
-		}
-		serializer->finalizeChunk(chunk,"btTriangleInfoData",BT_ARRAY_CODE,(void*) &m_valueArray[0]);
-	}
-	
-	tmapData->m_numKeys = m_keyArray.size();
-	tmapData->m_keyArrayPtr = tmapData->m_numKeys ? (int*)serializer->getUniquePointer((void*)&m_keyArray[0]) : 0;
-	if (tmapData->m_keyArrayPtr)
-	{
-		int sz = sizeof(int);
-		int numElem = tmapData->m_numValues;
-		btChunk* chunk = serializer->allocate(sz,numElem);
-		int* memPtr = (int*)chunk->m_oldPtr;
-		for (int i=0;i<numElem;i++,memPtr++)
-		{
-			*memPtr = m_keyArray[i].getUid1();
-		}
-		serializer->finalizeChunk(chunk,"int",BT_ARRAY_CODE,(void*) &m_keyArray[0]);
-
-	}
-	return "btTriangleInfoMapData";
-}
-
-
-
-///fills the dataBuffer and returns the struct name (and 0 on failure)
-SIMD_FORCE_INLINE	void	btTriangleInfoMap::deSerialize(btTriangleInfoMapData& tmapData )
-{
-
-
-	m_convexEpsilon = tmapData.m_convexEpsilon;
-	m_planarEpsilon = tmapData.m_planarEpsilon;
-	m_equalVertexThreshold = tmapData.m_equalVertexThreshold;
-	m_edgeDistanceThreshold = tmapData.m_edgeDistanceThreshold;
-	m_zeroAreaThreshold = tmapData.m_zeroAreaThreshold;
-	m_hashTable.resize(tmapData.m_hashTableSize);
-	int i =0;
-	for (i=0;i<tmapData.m_hashTableSize;i++)
-	{
-		m_hashTable[i] = tmapData.m_hashTablePtr[i];
-	}
-	m_next.resize(tmapData.m_nextSize);
-	for (i=0;i<tmapData.m_nextSize;i++)
-	{
-		m_next[i] = tmapData.m_nextPtr[i];
-	}
-	m_valueArray.resize(tmapData.m_numValues);
-	for (i=0;i<tmapData.m_numValues;i++)
-	{
-		m_valueArray[i].m_edgeV0V1Angle = tmapData.m_valueArrayPtr[i].m_edgeV0V1Angle;
-		m_valueArray[i].m_edgeV1V2Angle = tmapData.m_valueArrayPtr[i].m_edgeV1V2Angle;
-		m_valueArray[i].m_edgeV2V0Angle = tmapData.m_valueArrayPtr[i].m_edgeV2V0Angle;
-		m_valueArray[i].m_flags = tmapData.m_valueArrayPtr[i].m_flags;
-	}
-	
-	m_keyArray.resize(tmapData.m_numKeys,btHashInt(0));
-	for (i=0;i<tmapData.m_numKeys;i++)
-	{
-		m_keyArray[i].setUid1(tmapData.m_keyArrayPtr[i]);
-	}
-}
-
-
-#endif //_BT_TRIANGLE_INFO_MAP_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMesh.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMesh.cpp
deleted file mode 100644
index b29e0f7..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMesh.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "btTriangleMesh.h"
-
-
-
-btTriangleMesh::btTriangleMesh (bool use32bitIndices,bool use4componentVertices)
-:m_use32bitIndices(use32bitIndices),
-m_use4componentVertices(use4componentVertices),
-m_weldingThreshold(0.0)
-{
-	btIndexedMesh meshIndex;
-	meshIndex.m_numTriangles = 0;
-	meshIndex.m_numVertices = 0;
-	meshIndex.m_indexType = PHY_INTEGER;
-	meshIndex.m_triangleIndexBase = 0;
-	meshIndex.m_triangleIndexStride = 3*sizeof(int);
-	meshIndex.m_vertexBase = 0;
-	meshIndex.m_vertexStride = sizeof(btVector3);
-	m_indexedMeshes.push_back(meshIndex);
-
-	if (m_use32bitIndices)
-	{
-		m_indexedMeshes[0].m_numTriangles = m_32bitIndices.size()/3;
-		m_indexedMeshes[0].m_triangleIndexBase = 0;
-		m_indexedMeshes[0].m_indexType = PHY_INTEGER;
-		m_indexedMeshes[0].m_triangleIndexStride = 3*sizeof(int);
-	} else
-	{
-		m_indexedMeshes[0].m_numTriangles = m_16bitIndices.size()/3;
-		m_indexedMeshes[0].m_triangleIndexBase = 0;
-		m_indexedMeshes[0].m_indexType = PHY_SHORT;
-		m_indexedMeshes[0].m_triangleIndexStride = 3*sizeof(short int);
-	}
-
-	if (m_use4componentVertices)
-	{
-		m_indexedMeshes[0].m_numVertices = m_4componentVertices.size();
-		m_indexedMeshes[0].m_vertexBase = 0;
-		m_indexedMeshes[0].m_vertexStride = sizeof(btVector3);
-	} else
-	{
-		m_indexedMeshes[0].m_numVertices = m_3componentVertices.size()/3;
-		m_indexedMeshes[0].m_vertexBase = 0;
-		m_indexedMeshes[0].m_vertexStride = 3*sizeof(btScalar);
-	}
-
-
-}
-
-void	btTriangleMesh::addIndex(int index)
-{
-	if (m_use32bitIndices)
-	{
-		m_32bitIndices.push_back(index);
-		m_indexedMeshes[0].m_triangleIndexBase = (unsigned char*) &m_32bitIndices[0];
-	} else
-	{
-		m_16bitIndices.push_back(index);
-		m_indexedMeshes[0].m_triangleIndexBase = (unsigned char*) &m_16bitIndices[0];
-	}
-}
-
-
-int	btTriangleMesh::findOrAddVertex(const btVector3& vertex, bool removeDuplicateVertices)
-{
-	//return index of new/existing vertex
-	///@todo: could use acceleration structure for this
-	if (m_use4componentVertices)
-	{
-		if (removeDuplicateVertices)
-			{
-			for (int i=0;i< m_4componentVertices.size();i++)
-			{
-				if ((m_4componentVertices[i]-vertex).length2() <= m_weldingThreshold)
-				{
-					return i;
-				}
-			}
-		}
-		m_indexedMeshes[0].m_numVertices++;
-		m_4componentVertices.push_back(vertex);
-		m_indexedMeshes[0].m_vertexBase = (unsigned char*)&m_4componentVertices[0];
-
-		return m_4componentVertices.size()-1;
-		
-	} else
-	{
-		
-		if (removeDuplicateVertices)
-		{
-			for (int i=0;i< m_3componentVertices.size();i+=3)
-			{
-				btVector3 vtx(m_3componentVertices[i],m_3componentVertices[i+1],m_3componentVertices[i+2]);
-				if ((vtx-vertex).length2() <= m_weldingThreshold)
-				{
-					return i/3;
-				}
-			}
-	}
-		m_3componentVertices.push_back((float)vertex.getX());
-		m_3componentVertices.push_back((float)vertex.getY());
-		m_3componentVertices.push_back((float)vertex.getZ());
-		m_indexedMeshes[0].m_numVertices++;
-		m_indexedMeshes[0].m_vertexBase = (unsigned char*)&m_3componentVertices[0];
-		return (m_3componentVertices.size()/3)-1;
-	}
-
-}
-		
-void	btTriangleMesh::addTriangle(const btVector3& vertex0,const btVector3& vertex1,const btVector3& vertex2,bool removeDuplicateVertices)
-{
-	m_indexedMeshes[0].m_numTriangles++;
-	addIndex(findOrAddVertex(vertex0,removeDuplicateVertices));
-	addIndex(findOrAddVertex(vertex1,removeDuplicateVertices));
-	addIndex(findOrAddVertex(vertex2,removeDuplicateVertices));
-}
-
-int btTriangleMesh::getNumTriangles() const
-{
-	if (m_use32bitIndices)
-	{
-		return m_32bitIndices.size() / 3;
-	}
-	return m_16bitIndices.size() / 3;
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMesh.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMesh.h
deleted file mode 100644
index f623157..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMesh.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_TRIANGLE_MESH_H
-#define BT_TRIANGLE_MESH_H
-
-#include "btTriangleIndexVertexArray.h"
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btAlignedObjectArray.h"
-
-///The btTriangleMesh class is a convenience class derived from btTriangleIndexVertexArray, that provides storage for a concave triangle mesh. It can be used as data for the btBvhTriangleMeshShape.
-///It allows either 32bit or 16bit indices, and 4 (x-y-z-w) or 3 (x-y-z) component vertices.
-///If you want to share triangle/index data between graphics mesh and collision mesh (btBvhTriangleMeshShape), you can directly use btTriangleIndexVertexArray or derive your own class from btStridingMeshInterface.
-///Performance of btTriangleMesh and btTriangleIndexVertexArray used in a btBvhTriangleMeshShape is the same.
-class btTriangleMesh : public btTriangleIndexVertexArray
-{
-	btAlignedObjectArray<btVector3>	m_4componentVertices;
-	btAlignedObjectArray<float>		m_3componentVertices;
-
-	btAlignedObjectArray<unsigned int>		m_32bitIndices;
-	btAlignedObjectArray<unsigned short int>		m_16bitIndices;
-	bool	m_use32bitIndices;
-	bool	m_use4componentVertices;
-	
-
-	public:
-		btScalar	m_weldingThreshold;
-
-		btTriangleMesh (bool use32bitIndices=true,bool use4componentVertices=true);
-
-		bool	getUse32bitIndices() const
-		{
-			return m_use32bitIndices;
-		}
-
-		bool	getUse4componentVertices() const
-		{
-			return m_use4componentVertices;
-		}
-		///By default addTriangle won't search for duplicate vertices, because the search is very slow for large triangle meshes.
-		///In general it is better to directly use btTriangleIndexVertexArray instead.
-		void	addTriangle(const btVector3& vertex0,const btVector3& vertex1,const btVector3& vertex2, bool removeDuplicateVertices=false);
-		
-		int getNumTriangles() const;
-
-		virtual void	preallocateVertices(int numverts){(void) numverts;}
-		virtual void	preallocateIndices(int numindices){(void) numindices;}
-
-		///findOrAddVertex is an internal method, use addTriangle instead
-		int		findOrAddVertex(const btVector3& vertex, bool removeDuplicateVertices);
-		///addIndex is an internal method, use addTriangle instead
-		void	addIndex(int index);
-		
-};
-
-#endif //BT_TRIANGLE_MESH_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp
deleted file mode 100644
index 683684d..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btTriangleMeshShape.h"
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btQuaternion.h"
-#include "btStridingMeshInterface.h"
-#include "LinearMath/btAabbUtil2.h"
-#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
-
-
-btTriangleMeshShape::btTriangleMeshShape(btStridingMeshInterface* meshInterface)
-: btConcaveShape (), m_meshInterface(meshInterface)
-{
-	m_shapeType = TRIANGLE_MESH_SHAPE_PROXYTYPE;
-	if(meshInterface->hasPremadeAabb())
-	{
-		meshInterface->getPremadeAabb(&m_localAabbMin, &m_localAabbMax);
-	}
-	else
-	{
-		recalcLocalAabb();
-	}
-}
-
-
-btTriangleMeshShape::~btTriangleMeshShape()
-{
-		
-}
-
-
-
-
-void btTriangleMeshShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const
-{
-
-	btVector3 localHalfExtents = btScalar(0.5)*(m_localAabbMax-m_localAabbMin);
-	localHalfExtents += btVector3(getMargin(),getMargin(),getMargin());
-	btVector3 localCenter = btScalar(0.5)*(m_localAabbMax+m_localAabbMin);
-	
-	btMatrix3x3 abs_b = trans.getBasis().absolute();  
-
-	btVector3 center = trans(localCenter);
-
-	btVector3 extent = btVector3(abs_b[0].dot(localHalfExtents),
-		   abs_b[1].dot(localHalfExtents),
-		  abs_b[2].dot(localHalfExtents));
-	aabbMin = center - extent;
-	aabbMax = center + extent;
-
-
-}
-
-void	btTriangleMeshShape::recalcLocalAabb()
-{
-	for (int i=0;i<3;i++)
-	{
-		btVector3 vec(btScalar(0.),btScalar(0.),btScalar(0.));
-		vec[i] = btScalar(1.);
-		btVector3 tmp = localGetSupportingVertex(vec);
-		m_localAabbMax[i] = tmp[i]+m_collisionMargin;
-		vec[i] = btScalar(-1.);
-		tmp = localGetSupportingVertex(vec);
-		m_localAabbMin[i] = tmp[i]-m_collisionMargin;
-	}
-}
-
-
-
-class SupportVertexCallback : public btTriangleCallback
-{
-
-	btVector3 m_supportVertexLocal;
-public:
-
-	btTransform	m_worldTrans;
-	btScalar m_maxDot;
-	btVector3 m_supportVecLocal;
-
-	SupportVertexCallback(const btVector3& supportVecWorld,const btTransform& trans)
-		: m_supportVertexLocal(btScalar(0.),btScalar(0.),btScalar(0.)), m_worldTrans(trans) ,m_maxDot(btScalar(-BT_LARGE_FLOAT))
-		
-	{
-		m_supportVecLocal = supportVecWorld * m_worldTrans.getBasis();
-	}
-
-	virtual void processTriangle( btVector3* triangle,int partId, int triangleIndex)
-	{
-		(void)partId;
-		(void)triangleIndex;
-		for (int i=0;i<3;i++)
-		{
-			btScalar dot = m_supportVecLocal.dot(triangle[i]);
-			if (dot > m_maxDot)
-			{
-				m_maxDot = dot;
-				m_supportVertexLocal = triangle[i];
-			}
-		}
-	}
-
-	btVector3 GetSupportVertexWorldSpace()
-	{
-		return m_worldTrans(m_supportVertexLocal);
-	}
-
-	btVector3	GetSupportVertexLocal()
-	{
-		return m_supportVertexLocal;
-	}
-
-};
-
-	
-void btTriangleMeshShape::setLocalScaling(const btVector3& scaling)
-{
-	m_meshInterface->setScaling(scaling);
-	recalcLocalAabb();
-}
-
-const btVector3& btTriangleMeshShape::getLocalScaling() const
-{
-	return m_meshInterface->getScaling();
-}
-
-
-
-
-
-
-//#define DEBUG_TRIANGLE_MESH
-
-
-
-void	btTriangleMeshShape::processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const
-{
-		struct FilteredCallback : public btInternalTriangleIndexCallback
-	{
-		btTriangleCallback* m_callback;
-		btVector3 m_aabbMin;
-		btVector3 m_aabbMax;
-
-		FilteredCallback(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax)
-			:m_callback(callback),
-			m_aabbMin(aabbMin),
-			m_aabbMax(aabbMax)
-		{
-		}
-
-		virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex)
-		{
-			if (TestTriangleAgainstAabb2(&triangle[0],m_aabbMin,m_aabbMax))
-			{
-				//check aabb in triangle-space, before doing this
-				m_callback->processTriangle(triangle,partId,triangleIndex);
-			}
-			
-		}
-
-	};
-
-	FilteredCallback filterCallback(callback,aabbMin,aabbMax);
-
-	m_meshInterface->InternalProcessAllTriangles(&filterCallback,aabbMin,aabbMax);
-}
-
-
-
-
-
-void	btTriangleMeshShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
-{
-	(void)mass;
-	//moving concave objects not supported
-	btAssert(0);
-	inertia.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
-}
-
-
-btVector3 btTriangleMeshShape::localGetSupportingVertex(const btVector3& vec) const
-{
-	btVector3 supportVertex;
-
-	btTransform ident;
-	ident.setIdentity();
-
-	SupportVertexCallback supportCallback(vec,ident);
-
-	btVector3 aabbMax(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
-	
-	processAllTriangles(&supportCallback,-aabbMax,aabbMax);
-		
-	supportVertex = supportCallback.GetSupportVertexLocal();
-
-	return supportVertex;
-}
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMeshShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMeshShape.h
deleted file mode 100644
index c8caf8f..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMeshShape.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_TRIANGLE_MESH_SHAPE_H
-#define BT_TRIANGLE_MESH_SHAPE_H
-
-#include "btConcaveShape.h"
-#include "btStridingMeshInterface.h"
-
-
-///The btTriangleMeshShape is an internal concave triangle mesh interface. Don't use this class directly, use btBvhTriangleMeshShape instead.
-class btTriangleMeshShape : public btConcaveShape
-{
-protected:
-	btVector3	m_localAabbMin;
-	btVector3	m_localAabbMax;
-	btStridingMeshInterface* m_meshInterface;
-
-	///btTriangleMeshShape constructor has been disabled/protected, so that users will not mistakenly use this class.
-	///Don't use btTriangleMeshShape but use btBvhTriangleMeshShape instead!
-	btTriangleMeshShape(btStridingMeshInterface* meshInterface);
-
-public:
-
-	virtual ~btTriangleMeshShape();
-
-	virtual btVector3 localGetSupportingVertex(const btVector3& vec) const;
-
-	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const
-	{
-		btAssert(0);
-		return localGetSupportingVertex(vec);
-	}
-
-	void	recalcLocalAabb();
-
-	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
-
-	virtual void	processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const;
-
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
-
-	virtual void	setLocalScaling(const btVector3& scaling);
-	virtual const btVector3& getLocalScaling() const;
-	
-	btStridingMeshInterface* getMeshInterface()
-	{
-		return m_meshInterface;
-	}
-
-	const btStridingMeshInterface* getMeshInterface() const
-	{
-		return m_meshInterface;
-	}
-
-	const btVector3& getLocalAabbMin() const
-	{
-		return m_localAabbMin;
-	}
-	const btVector3& getLocalAabbMax() const
-	{
-		return m_localAabbMax;
-	}
-
-
-
-	//debugging
-	virtual const char*	getName()const {return "TRIANGLEMESH";}
-
-	
-
-};
-
-
-
-
-#endif //BT_TRIANGLE_MESH_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleShape.h
deleted file mode 100644
index 71b0557..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleShape.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_OBB_TRIANGLE_MINKOWSKI_H
-#define BT_OBB_TRIANGLE_MINKOWSKI_H
-
-#include "btConvexShape.h"
-#include "btBoxShape.h"
-
-ATTRIBUTE_ALIGNED16(class) btTriangleShape : public btPolyhedralConvexShape
-{
-
-
-public:
-
-	btVector3	m_vertices1[3];
-
-	virtual int getNumVertices() const
-	{
-		return 3;
-	}
-
-	btVector3& getVertexPtr(int index)
-	{
-		return m_vertices1[index];
-	}
-
-	const btVector3& getVertexPtr(int index) const
-	{
-		return m_vertices1[index];
-	}
-	virtual void getVertex(int index,btVector3& vert) const
-	{
-		vert = m_vertices1[index];
-	}
-
-	virtual int getNumEdges() const
-	{
-		return 3;
-	}
-	
-	virtual void getEdge(int i,btVector3& pa,btVector3& pb) const
-	{
-		getVertex(i,pa);
-		getVertex((i+1)%3,pb);
-	}
-
-
-	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax)const 
-	{
-//		btAssert(0);
-		getAabbSlow(t,aabbMin,aabbMax);
-	}
-
-	btVector3 localGetSupportingVertexWithoutMargin(const btVector3& dir)const 
-	{
-		btVector3 dots(dir.dot(m_vertices1[0]), dir.dot(m_vertices1[1]), dir.dot(m_vertices1[2]));
-	  	return m_vertices1[dots.maxAxis()];
-
-	}
-
-	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
-	{
-		for (int i=0;i<numVectors;i++)
-		{
-			const btVector3& dir = vectors[i];
-			btVector3 dots(dir.dot(m_vertices1[0]), dir.dot(m_vertices1[1]), dir.dot(m_vertices1[2]));
-  			supportVerticesOut[i] = m_vertices1[dots.maxAxis()];
-		}
-
-	}
-
-	btTriangleShape() : btPolyhedralConvexShape ()
-    {
-		m_shapeType = TRIANGLE_SHAPE_PROXYTYPE;
-	}
-
-	btTriangleShape(const btVector3& p0,const btVector3& p1,const btVector3& p2) : btPolyhedralConvexShape ()
-    {
-		m_shapeType = TRIANGLE_SHAPE_PROXYTYPE;
-        m_vertices1[0] = p0;
-        m_vertices1[1] = p1;
-        m_vertices1[2] = p2;
-    }
-
-
-	virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i) const
-	{
-		getPlaneEquation(i,planeNormal,planeSupport);
-	}
-
-	virtual int	getNumPlanes() const
-	{
-		return 1;
-	}
-
-	void calcNormal(btVector3& normal) const
-	{
-		normal = (m_vertices1[1]-m_vertices1[0]).cross(m_vertices1[2]-m_vertices1[0]);
-		normal.normalize();
-	}
-
-	virtual void getPlaneEquation(int i, btVector3& planeNormal,btVector3& planeSupport) const
-	{
-		(void)i;
-		calcNormal(planeNormal);
-		planeSupport = m_vertices1[0];
-	}
-
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const
-	{
-		(void)mass;
-		btAssert(0);
-		inertia.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
-	}
-
-		virtual	bool isInside(const btVector3& pt,btScalar tolerance) const
-	{
-		btVector3 normal;
-		calcNormal(normal);
-		//distance to plane
-		btScalar dist = pt.dot(normal);
-		btScalar planeconst = m_vertices1[0].dot(normal);
-		dist -= planeconst;
-		if (dist >= -tolerance && dist <= tolerance)
-		{
-			//inside check on edge-planes
-			int i;
-			for (i=0;i<3;i++)
-			{
-				btVector3 pa,pb;
-				getEdge(i,pa,pb);
-				btVector3 edge = pb-pa;
-				btVector3 edgeNormal = edge.cross(normal);
-				edgeNormal.normalize();
-				btScalar dist = pt.dot( edgeNormal);
-				btScalar edgeConst = pa.dot(edgeNormal);
-				dist -= edgeConst;
-				if (dist < -tolerance)
-					return false;
-			}
-			
-			return true;
-		}
-
-		return false;
-	}
-		//debugging
-		virtual const char*	getName()const
-		{
-			return "Triangle";
-		}
-
-		virtual int		getNumPreferredPenetrationDirections() const
-		{
-			return 2;
-		}
-		
-		virtual void	getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const
-		{
-			calcNormal(penetrationVector);
-			if (index)
-				penetrationVector *= btScalar(-1.);
-		}
-
-
-};
-
-#endif //BT_OBB_TRIANGLE_MINKOWSKI_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btUniformScalingShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btUniformScalingShape.cpp
deleted file mode 100644
index b148bbd..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btUniformScalingShape.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btUniformScalingShape.h"
-
-btUniformScalingShape::btUniformScalingShape(	btConvexShape* convexChildShape,btScalar uniformScalingFactor):
-btConvexShape (), m_childConvexShape(convexChildShape),
-m_uniformScalingFactor(uniformScalingFactor)
-{
-	m_shapeType = UNIFORM_SCALING_SHAPE_PROXYTYPE;
-}
-	
-btUniformScalingShape::~btUniformScalingShape()
-{
-}
-	
-
-btVector3	btUniformScalingShape::localGetSupportingVertexWithoutMargin(const btVector3& vec)const
-{
-	btVector3 tmpVertex;
-	tmpVertex = m_childConvexShape->localGetSupportingVertexWithoutMargin(vec);
-	return tmpVertex*m_uniformScalingFactor;
-}
-
-void	btUniformScalingShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
-{
-	m_childConvexShape->batchedUnitVectorGetSupportingVertexWithoutMargin(vectors,supportVerticesOut,numVectors);
-	int i;
-	for (i=0;i<numVectors;i++)
-	{
-		supportVerticesOut[i] = supportVerticesOut[i] * m_uniformScalingFactor;
-	}
-}
-
-
-btVector3	btUniformScalingShape::localGetSupportingVertex(const btVector3& vec)const
-{
-	btVector3 tmpVertex;
-	tmpVertex = m_childConvexShape->localGetSupportingVertex(vec);
-	return tmpVertex*m_uniformScalingFactor;
-}
-
-
-void	btUniformScalingShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
-{
-
-	///this linear upscaling is not realistic, but we don't deal with large mass ratios...
-	btVector3 tmpInertia;
-	m_childConvexShape->calculateLocalInertia(mass,tmpInertia);
-	inertia = tmpInertia * m_uniformScalingFactor;
-}
-
-
-	///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
-void btUniformScalingShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const
-{
-	getAabbSlow(trans,aabbMin,aabbMax);
-
-}
-
-void btUniformScalingShape::getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
-{
-#if 1
-	btVector3 _directions[] =
-	{
-		btVector3( 1.,  0.,  0.),
-		btVector3( 0.,  1.,  0.),
-		btVector3( 0.,  0.,  1.),
-		btVector3( -1., 0.,  0.),
-		btVector3( 0., -1.,  0.),
-		btVector3( 0.,  0., -1.)
-	};
-	
-	btVector3 _supporting[] =
-	{
-		btVector3( 0., 0., 0.),
-		btVector3( 0., 0., 0.),
-		btVector3( 0., 0., 0.),
-		btVector3( 0., 0., 0.),
-		btVector3( 0., 0., 0.),
-		btVector3( 0., 0., 0.)
-	};
-
-	for (int i=0;i<6;i++)
-	{
-		_directions[i] = _directions[i]*t.getBasis();
-	}
-	
-	batchedUnitVectorGetSupportingVertexWithoutMargin(_directions, _supporting, 6);
-	
-	btVector3 aabbMin1(0,0,0),aabbMax1(0,0,0);
-
-	for ( int i = 0; i < 3; ++i )
-	{
-		aabbMax1[i] = t(_supporting[i])[i];
-		aabbMin1[i] = t(_supporting[i + 3])[i];
-	}
-	btVector3 marginVec(getMargin(),getMargin(),getMargin());
-	aabbMin = aabbMin1-marginVec;
-	aabbMax = aabbMax1+marginVec;
-	
-#else
-
-	btScalar margin = getMargin();
-	for (int i=0;i<3;i++)
-	{
-		btVector3 vec(btScalar(0.),btScalar(0.),btScalar(0.));
-		vec[i] = btScalar(1.);
-		btVector3 sv = localGetSupportingVertex(vec*t.getBasis());
-		btVector3 tmp = t(sv);
-		aabbMax[i] = tmp[i]+margin;
-		vec[i] = btScalar(-1.);
-		sv = localGetSupportingVertex(vec*t.getBasis());
-		tmp = t(sv);
-		aabbMin[i] = tmp[i]-margin;
-	}
-
-#endif
-}
-
-void	btUniformScalingShape::setLocalScaling(const btVector3& scaling) 
-{
-	m_childConvexShape->setLocalScaling(scaling);
-}
-
-const btVector3& btUniformScalingShape::getLocalScaling() const
-{
-	return m_childConvexShape->getLocalScaling();
-}
-
-void	btUniformScalingShape::setMargin(btScalar margin)
-{
-	m_childConvexShape->setMargin(margin);
-}
-btScalar	btUniformScalingShape::getMargin() const
-{
-	return m_childConvexShape->getMargin() * m_uniformScalingFactor;
-}
-
-int		btUniformScalingShape::getNumPreferredPenetrationDirections() const
-{
-	return m_childConvexShape->getNumPreferredPenetrationDirections();
-}
-	
-void	btUniformScalingShape::getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const
-{
-	m_childConvexShape->getPreferredPenetrationDirection(index,penetrationVector);
-}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btUniformScalingShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btUniformScalingShape.h
deleted file mode 100644
index cbf7e6f..0000000
--- a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btUniformScalingShape.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_UNIFORM_SCALING_SHAPE_H
-#define BT_UNIFORM_SCALING_SHAPE_H
-
-#include "btConvexShape.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
-
-///The btUniformScalingShape allows to re-use uniform scaled instances of btConvexShape in a memory efficient way.
-///Istead of using btUniformScalingShape, it is better to use the non-uniform setLocalScaling method on convex shapes that implement it.
-class btUniformScalingShape : public btConvexShape
-{
-	btConvexShape*	m_childConvexShape;
-
-	btScalar	m_uniformScalingFactor;
-	
-	public:
-	
-	btUniformScalingShape(	btConvexShape* convexChildShape, btScalar uniformScalingFactor);
-	
-	virtual ~btUniformScalingShape();
-	
-	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
-
-	virtual btVector3	localGetSupportingVertex(const btVector3& vec)const;
-
-	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
-
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
-
-	btScalar	getUniformScalingFactor() const
-	{
-		return m_uniformScalingFactor;
-	}
-
-	btConvexShape*	getChildShape() 
-	{
-		return m_childConvexShape;
-	}
-
-	const btConvexShape*	getChildShape() const
-	{
-		return m_childConvexShape;
-	}
-
-	virtual const char*	getName()const 
-	{
-		return "UniformScalingShape";
-	}
-	
-
-
-	///////////////////////////
-
-
-	///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
-	void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
-
-	virtual void getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
-
-	virtual void	setLocalScaling(const btVector3& scaling) ;
-	virtual const btVector3& getLocalScaling() const ;
-
-	virtual void	setMargin(btScalar margin);
-	virtual btScalar	getMargin() const;
-
-	virtual int		getNumPreferredPenetrationDirections() const;
-	
-	virtual void	getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const;
-
-
-};
-
-#endif //BT_UNIFORM_SCALING_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btBoxCollision.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btBoxCollision.h
deleted file mode 100644
index d5676aa..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/btBoxCollision.h
+++ /dev/null
@@ -1,647 +0,0 @@
-#ifndef BT_BOX_COLLISION_H_INCLUDED
-#define BT_BOX_COLLISION_H_INCLUDED
-
-/*! \file gim_box_collision.h
-\author Francisco Leon Najera
-*/
-/*
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "LinearMath/btTransform.h"
-
-
-///Swap numbers
-#define BT_SWAP_NUMBERS(a,b){ \
-    a = a+b; \
-    b = a-b; \
-    a = a-b; \
-}\
-
-
-#define BT_MAX(a,b) (a<b?b:a)
-#define BT_MIN(a,b) (a>b?b:a)
-
-#define BT_GREATER(x, y)	btFabs(x) > (y)
-
-#define BT_MAX3(a,b,c) BT_MAX(a,BT_MAX(b,c))
-#define BT_MIN3(a,b,c) BT_MIN(a,BT_MIN(b,c))
-
-
-
-
-
-
-enum eBT_PLANE_INTERSECTION_TYPE
-{
-	BT_CONST_BACK_PLANE = 0,
-	BT_CONST_COLLIDE_PLANE,
-	BT_CONST_FRONT_PLANE
-};
-
-//SIMD_FORCE_INLINE bool test_cross_edge_box(
-//	const btVector3 & edge,
-//	const btVector3 & absolute_edge,
-//	const btVector3 & pointa,
-//	const btVector3 & pointb, const btVector3 & extend,
-//	int dir_index0,
-//	int dir_index1
-//	int component_index0,
-//	int component_index1)
-//{
-//	// dir coords are -z and y
-//
-//	const btScalar dir0 = -edge[dir_index0];
-//	const btScalar dir1 = edge[dir_index1];
-//	btScalar pmin = pointa[component_index0]*dir0 + pointa[component_index1]*dir1;
-//	btScalar pmax = pointb[component_index0]*dir0 + pointb[component_index1]*dir1;
-//	//find minmax
-//	if(pmin>pmax)
-//	{
-//		BT_SWAP_NUMBERS(pmin,pmax);
-//	}
-//	//find extends
-//	const btScalar rad = extend[component_index0] * absolute_edge[dir_index0] +
-//					extend[component_index1] * absolute_edge[dir_index1];
-//
-//	if(pmin>rad || -rad>pmax) return false;
-//	return true;
-//}
-//
-//SIMD_FORCE_INLINE bool test_cross_edge_box_X_axis(
-//	const btVector3 & edge,
-//	const btVector3 & absolute_edge,
-//	const btVector3 & pointa,
-//	const btVector3 & pointb, btVector3 & extend)
-//{
-//
-//	return test_cross_edge_box(edge,absolute_edge,pointa,pointb,extend,2,1,1,2);
-//}
-//
-//
-//SIMD_FORCE_INLINE bool test_cross_edge_box_Y_axis(
-//	const btVector3 & edge,
-//	const btVector3 & absolute_edge,
-//	const btVector3 & pointa,
-//	const btVector3 & pointb, btVector3 & extend)
-//{
-//
-//	return test_cross_edge_box(edge,absolute_edge,pointa,pointb,extend,0,2,2,0);
-//}
-//
-//SIMD_FORCE_INLINE bool test_cross_edge_box_Z_axis(
-//	const btVector3 & edge,
-//	const btVector3 & absolute_edge,
-//	const btVector3 & pointa,
-//	const btVector3 & pointb, btVector3 & extend)
-//{
-//
-//	return test_cross_edge_box(edge,absolute_edge,pointa,pointb,extend,1,0,0,1);
-//}
-
-
-#define TEST_CROSS_EDGE_BOX_MCR(edge,absolute_edge,pointa,pointb,_extend,i_dir_0,i_dir_1,i_comp_0,i_comp_1)\
-{\
-	const btScalar dir0 = -edge[i_dir_0];\
-	const btScalar dir1 = edge[i_dir_1];\
-	btScalar pmin = pointa[i_comp_0]*dir0 + pointa[i_comp_1]*dir1;\
-	btScalar pmax = pointb[i_comp_0]*dir0 + pointb[i_comp_1]*dir1;\
-	if(pmin>pmax)\
-	{\
-		BT_SWAP_NUMBERS(pmin,pmax); \
-	}\
-	const btScalar abs_dir0 = absolute_edge[i_dir_0];\
-	const btScalar abs_dir1 = absolute_edge[i_dir_1];\
-	const btScalar rad = _extend[i_comp_0] * abs_dir0 + _extend[i_comp_1] * abs_dir1;\
-	if(pmin>rad || -rad>pmax) return false;\
-}\
-
-
-#define TEST_CROSS_EDGE_BOX_X_AXIS_MCR(edge,absolute_edge,pointa,pointb,_extend)\
-{\
-	TEST_CROSS_EDGE_BOX_MCR(edge,absolute_edge,pointa,pointb,_extend,2,1,1,2);\
-}\
-
-#define TEST_CROSS_EDGE_BOX_Y_AXIS_MCR(edge,absolute_edge,pointa,pointb,_extend)\
-{\
-	TEST_CROSS_EDGE_BOX_MCR(edge,absolute_edge,pointa,pointb,_extend,0,2,2,0);\
-}\
-
-#define TEST_CROSS_EDGE_BOX_Z_AXIS_MCR(edge,absolute_edge,pointa,pointb,_extend)\
-{\
-	TEST_CROSS_EDGE_BOX_MCR(edge,absolute_edge,pointa,pointb,_extend,1,0,0,1);\
-}\
-
-
-//! Returns the dot product between a vec3f and the col of a matrix
-SIMD_FORCE_INLINE btScalar bt_mat3_dot_col(
-const btMatrix3x3 & mat, const btVector3 & vec3, int colindex)
-{
-	return vec3[0]*mat[0][colindex] + vec3[1]*mat[1][colindex] + vec3[2]*mat[2][colindex];
-}
-
-
-//!  Class for transforming a model1 to the space of model0
-ATTRIBUTE_ALIGNED16	(class) BT_BOX_BOX_TRANSFORM_CACHE
-{
-public:
-    btVector3  m_T1to0;//!< Transforms translation of model1 to model 0
-	btMatrix3x3 m_R1to0;//!< Transforms Rotation of model1 to model 0, equal  to R0' * R1
-	btMatrix3x3 m_AR;//!< Absolute value of m_R1to0
-
-	SIMD_FORCE_INLINE void calc_absolute_matrix()
-	{
-//		static const btVector3 vepsi(1e-6f,1e-6f,1e-6f);
-//		m_AR[0] = vepsi + m_R1to0[0].absolute();
-//		m_AR[1] = vepsi + m_R1to0[1].absolute();
-//		m_AR[2] = vepsi + m_R1to0[2].absolute();
-
-		int i,j;
-
-        for(i=0;i<3;i++)
-        {
-            for(j=0;j<3;j++ )
-            {
-            	m_AR[i][j] = 1e-6f + btFabs(m_R1to0[i][j]);
-            }
-        }
-
-	}
-
-	BT_BOX_BOX_TRANSFORM_CACHE()
-	{
-	}
-
-
-
-	//! Calc the transformation relative  1 to 0. Inverts matrics by transposing
-	SIMD_FORCE_INLINE void calc_from_homogenic(const btTransform & trans0,const btTransform & trans1)
-	{
-
-		btTransform temp_trans = trans0.inverse();
-		temp_trans = temp_trans * trans1;
-
-		m_T1to0 = temp_trans.getOrigin();
-		m_R1to0 = temp_trans.getBasis();
-
-
-		calc_absolute_matrix();
-	}
-
-	//! Calcs the full invertion of the matrices. Useful for scaling matrices
-	SIMD_FORCE_INLINE void calc_from_full_invert(const btTransform & trans0,const btTransform & trans1)
-	{
-		m_R1to0 = trans0.getBasis().inverse();
-		m_T1to0 = m_R1to0 * (-trans0.getOrigin());
-
-		m_T1to0 += m_R1to0*trans1.getOrigin();
-		m_R1to0 *= trans1.getBasis();
-
-		calc_absolute_matrix();
-	}
-
-	SIMD_FORCE_INLINE btVector3 transform(const btVector3 & point) const
-	{
-		return btVector3(m_R1to0[0].dot(point) + m_T1to0.x(),
-			m_R1to0[1].dot(point) + m_T1to0.y(),
-			m_R1to0[2].dot(point) + m_T1to0.z());
-	}
-};
-
-
-#define BOX_PLANE_EPSILON 0.000001f
-
-//! Axis aligned box
-ATTRIBUTE_ALIGNED16	(class) btAABB
-{
-public:
-	btVector3 m_min;
-	btVector3 m_max;
-
-	btAABB()
-	{}
-
-
-	btAABB(const btVector3 & V1,
-			 const btVector3 & V2,
-			 const btVector3 & V3)
-	{
-		m_min[0] = BT_MIN3(V1[0],V2[0],V3[0]);
-		m_min[1] = BT_MIN3(V1[1],V2[1],V3[1]);
-		m_min[2] = BT_MIN3(V1[2],V2[2],V3[2]);
-
-		m_max[0] = BT_MAX3(V1[0],V2[0],V3[0]);
-		m_max[1] = BT_MAX3(V1[1],V2[1],V3[1]);
-		m_max[2] = BT_MAX3(V1[2],V2[2],V3[2]);
-	}
-
-	btAABB(const btVector3 & V1,
-			 const btVector3 & V2,
-			 const btVector3 & V3,
-			 btScalar margin)
-	{
-		m_min[0] = BT_MIN3(V1[0],V2[0],V3[0]);
-		m_min[1] = BT_MIN3(V1[1],V2[1],V3[1]);
-		m_min[2] = BT_MIN3(V1[2],V2[2],V3[2]);
-
-		m_max[0] = BT_MAX3(V1[0],V2[0],V3[0]);
-		m_max[1] = BT_MAX3(V1[1],V2[1],V3[1]);
-		m_max[2] = BT_MAX3(V1[2],V2[2],V3[2]);
-
-		m_min[0] -= margin;
-		m_min[1] -= margin;
-		m_min[2] -= margin;
-		m_max[0] += margin;
-		m_max[1] += margin;
-		m_max[2] += margin;
-	}
-
-	btAABB(const btAABB &other):
-		m_min(other.m_min),m_max(other.m_max)
-	{
-	}
-
-	btAABB(const btAABB &other,btScalar margin ):
-		m_min(other.m_min),m_max(other.m_max)
-	{
-		m_min[0] -= margin;
-		m_min[1] -= margin;
-		m_min[2] -= margin;
-		m_max[0] += margin;
-		m_max[1] += margin;
-		m_max[2] += margin;
-	}
-
-	SIMD_FORCE_INLINE void invalidate()
-	{
-		m_min[0] = SIMD_INFINITY;
-		m_min[1] = SIMD_INFINITY;
-		m_min[2] = SIMD_INFINITY;
-		m_max[0] = -SIMD_INFINITY;
-		m_max[1] = -SIMD_INFINITY;
-		m_max[2] = -SIMD_INFINITY;
-	}
-
-	SIMD_FORCE_INLINE void increment_margin(btScalar margin)
-	{
-		m_min[0] -= margin;
-		m_min[1] -= margin;
-		m_min[2] -= margin;
-		m_max[0] += margin;
-		m_max[1] += margin;
-		m_max[2] += margin;
-	}
-
-	SIMD_FORCE_INLINE void copy_with_margin(const btAABB &other, btScalar margin)
-	{
-		m_min[0] = other.m_min[0] - margin;
-		m_min[1] = other.m_min[1] - margin;
-		m_min[2] = other.m_min[2] - margin;
-
-		m_max[0] = other.m_max[0] + margin;
-		m_max[1] = other.m_max[1] + margin;
-		m_max[2] = other.m_max[2] + margin;
-	}
-
-	template<typename CLASS_POINT>
-	SIMD_FORCE_INLINE void calc_from_triangle(
-							const CLASS_POINT & V1,
-							const CLASS_POINT & V2,
-							const CLASS_POINT & V3)
-	{
-		m_min[0] = BT_MIN3(V1[0],V2[0],V3[0]);
-		m_min[1] = BT_MIN3(V1[1],V2[1],V3[1]);
-		m_min[2] = BT_MIN3(V1[2],V2[2],V3[2]);
-
-		m_max[0] = BT_MAX3(V1[0],V2[0],V3[0]);
-		m_max[1] = BT_MAX3(V1[1],V2[1],V3[1]);
-		m_max[2] = BT_MAX3(V1[2],V2[2],V3[2]);
-	}
-
-	template<typename CLASS_POINT>
-	SIMD_FORCE_INLINE void calc_from_triangle_margin(
-							const CLASS_POINT & V1,
-							const CLASS_POINT & V2,
-							const CLASS_POINT & V3, btScalar margin)
-	{
-		m_min[0] = BT_MIN3(V1[0],V2[0],V3[0]);
-		m_min[1] = BT_MIN3(V1[1],V2[1],V3[1]);
-		m_min[2] = BT_MIN3(V1[2],V2[2],V3[2]);
-
-		m_max[0] = BT_MAX3(V1[0],V2[0],V3[0]);
-		m_max[1] = BT_MAX3(V1[1],V2[1],V3[1]);
-		m_max[2] = BT_MAX3(V1[2],V2[2],V3[2]);
-
-		m_min[0] -= margin;
-		m_min[1] -= margin;
-		m_min[2] -= margin;
-		m_max[0] += margin;
-		m_max[1] += margin;
-		m_max[2] += margin;
-	}
-
-	//! Apply a transform to an AABB
-	SIMD_FORCE_INLINE void appy_transform(const btTransform & trans)
-	{
-		btVector3 center = (m_max+m_min)*0.5f;
-		btVector3 extends = m_max - center;
-		// Compute new center
-		center = trans(center);
-
-		btVector3 textends(extends.dot(trans.getBasis().getRow(0).absolute()),
- 				 extends.dot(trans.getBasis().getRow(1).absolute()),
-				 extends.dot(trans.getBasis().getRow(2).absolute()));
-
-		m_min = center - textends;
-		m_max = center + textends;
-	}
-
-
-	//! Apply a transform to an AABB
-	SIMD_FORCE_INLINE void appy_transform_trans_cache(const BT_BOX_BOX_TRANSFORM_CACHE & trans)
-	{
-		btVector3 center = (m_max+m_min)*0.5f;
-		btVector3 extends = m_max - center;
-		// Compute new center
-		center = trans.transform(center);
-
-		btVector3 textends(extends.dot(trans.m_R1to0.getRow(0).absolute()),
- 				 extends.dot(trans.m_R1to0.getRow(1).absolute()),
-				 extends.dot(trans.m_R1to0.getRow(2).absolute()));
-
-		m_min = center - textends;
-		m_max = center + textends;
-	}
-
-	//! Merges a Box
-	SIMD_FORCE_INLINE void merge(const btAABB & box)
-	{
-		m_min[0] = BT_MIN(m_min[0],box.m_min[0]);
-		m_min[1] = BT_MIN(m_min[1],box.m_min[1]);
-		m_min[2] = BT_MIN(m_min[2],box.m_min[2]);
-
-		m_max[0] = BT_MAX(m_max[0],box.m_max[0]);
-		m_max[1] = BT_MAX(m_max[1],box.m_max[1]);
-		m_max[2] = BT_MAX(m_max[2],box.m_max[2]);
-	}
-
-	//! Merges a point
-	template<typename CLASS_POINT>
-	SIMD_FORCE_INLINE void merge_point(const CLASS_POINT & point)
-	{
-		m_min[0] = BT_MIN(m_min[0],point[0]);
-		m_min[1] = BT_MIN(m_min[1],point[1]);
-		m_min[2] = BT_MIN(m_min[2],point[2]);
-
-		m_max[0] = BT_MAX(m_max[0],point[0]);
-		m_max[1] = BT_MAX(m_max[1],point[1]);
-		m_max[2] = BT_MAX(m_max[2],point[2]);
-	}
-
-	//! Gets the extend and center
-	SIMD_FORCE_INLINE void get_center_extend(btVector3 & center,btVector3 & extend)  const
-	{
-		center = (m_max+m_min)*0.5f;
-		extend = m_max - center;
-	}
-
-	//! Finds the intersecting box between this box and the other.
-	SIMD_FORCE_INLINE void find_intersection(const btAABB & other, btAABB & intersection)  const
-	{
-		intersection.m_min[0] = BT_MAX(other.m_min[0],m_min[0]);
-		intersection.m_min[1] = BT_MAX(other.m_min[1],m_min[1]);
-		intersection.m_min[2] = BT_MAX(other.m_min[2],m_min[2]);
-
-		intersection.m_max[0] = BT_MIN(other.m_max[0],m_max[0]);
-		intersection.m_max[1] = BT_MIN(other.m_max[1],m_max[1]);
-		intersection.m_max[2] = BT_MIN(other.m_max[2],m_max[2]);
-	}
-
-
-	SIMD_FORCE_INLINE bool has_collision(const btAABB & other) const
-	{
-		if(m_min[0] > other.m_max[0] ||
-		   m_max[0] < other.m_min[0] ||
-		   m_min[1] > other.m_max[1] ||
-		   m_max[1] < other.m_min[1] ||
-		   m_min[2] > other.m_max[2] ||
-		   m_max[2] < other.m_min[2])
-		{
-			return false;
-		}
-		return true;
-	}
-
-	/*! \brief Finds the Ray intersection parameter.
-	\param aabb Aligned box
-	\param vorigin A vec3f with the origin of the ray
-	\param vdir A vec3f with the direction of the ray
-	*/
-	SIMD_FORCE_INLINE bool collide_ray(const btVector3 & vorigin,const btVector3 & vdir)  const
-	{
-		btVector3 extents,center;
-		this->get_center_extend(center,extents);;
-
-		btScalar Dx = vorigin[0] - center[0];
-		if(BT_GREATER(Dx, extents[0]) && Dx*vdir[0]>=0.0f)	return false;
-		btScalar Dy = vorigin[1] - center[1];
-		if(BT_GREATER(Dy, extents[1]) && Dy*vdir[1]>=0.0f)	return false;
-		btScalar Dz = vorigin[2] - center[2];
-		if(BT_GREATER(Dz, extents[2]) && Dz*vdir[2]>=0.0f)	return false;
-
-
-		btScalar f = vdir[1] * Dz - vdir[2] * Dy;
-		if(btFabs(f) > extents[1]*btFabs(vdir[2]) + extents[2]*btFabs(vdir[1])) return false;
-		f = vdir[2] * Dx - vdir[0] * Dz;
-		if(btFabs(f) > extents[0]*btFabs(vdir[2]) + extents[2]*btFabs(vdir[0]))return false;
-		f = vdir[0] * Dy - vdir[1] * Dx;
-		if(btFabs(f) > extents[0]*btFabs(vdir[1]) + extents[1]*btFabs(vdir[0]))return false;
-		return true;
-	}
-
-
-	SIMD_FORCE_INLINE void projection_interval(const btVector3 & direction, btScalar &vmin, btScalar &vmax) const
-	{
-		btVector3 center = (m_max+m_min)*0.5f;
-		btVector3 extend = m_max-center;
-
-		btScalar _fOrigin =  direction.dot(center);
-		btScalar _fMaximumExtent = extend.dot(direction.absolute());
-		vmin = _fOrigin - _fMaximumExtent;
-		vmax = _fOrigin + _fMaximumExtent;
-	}
-
-	SIMD_FORCE_INLINE eBT_PLANE_INTERSECTION_TYPE plane_classify(const btVector4 &plane) const
-	{
-		btScalar _fmin,_fmax;
-		this->projection_interval(plane,_fmin,_fmax);
-
-		if(plane[3] > _fmax + BOX_PLANE_EPSILON)
-		{
-			return BT_CONST_BACK_PLANE; // 0
-		}
-
-		if(plane[3]+BOX_PLANE_EPSILON >=_fmin)
-		{
-			return BT_CONST_COLLIDE_PLANE; //1
-		}
-		return BT_CONST_FRONT_PLANE;//2
-	}
-
-	SIMD_FORCE_INLINE bool overlapping_trans_conservative(const btAABB & box, btTransform & trans1_to_0) const
-	{
-		btAABB tbox = box;
-		tbox.appy_transform(trans1_to_0);
-		return has_collision(tbox);
-	}
-
-	SIMD_FORCE_INLINE bool overlapping_trans_conservative2(const btAABB & box,
-		const BT_BOX_BOX_TRANSFORM_CACHE & trans1_to_0) const
-	{
-		btAABB tbox = box;
-		tbox.appy_transform_trans_cache(trans1_to_0);
-		return has_collision(tbox);
-	}
-
-	//! transcache is the transformation cache from box to this AABB
-	SIMD_FORCE_INLINE bool overlapping_trans_cache(
-		const btAABB & box,const BT_BOX_BOX_TRANSFORM_CACHE & transcache, bool fulltest) const
-	{
-
-		//Taken from OPCODE
-		btVector3 ea,eb;//extends
-		btVector3 ca,cb;//extends
-		get_center_extend(ca,ea);
-		box.get_center_extend(cb,eb);
-
-
-		btVector3 T;
-		btScalar t,t2;
-		int i;
-
-		// Class I : A's basis vectors
-		for(i=0;i<3;i++)
-		{
-			T[i] =  transcache.m_R1to0[i].dot(cb) + transcache.m_T1to0[i] - ca[i];
-			t = transcache.m_AR[i].dot(eb) + ea[i];
-			if(BT_GREATER(T[i], t))	return false;
-		}
-		// Class II : B's basis vectors
-		for(i=0;i<3;i++)
-		{
-			t = bt_mat3_dot_col(transcache.m_R1to0,T,i);
-			t2 = bt_mat3_dot_col(transcache.m_AR,ea,i) + eb[i];
-			if(BT_GREATER(t,t2))	return false;
-		}
-		// Class III : 9 cross products
-		if(fulltest)
-		{
-			int j,m,n,o,p,q,r;
-			for(i=0;i<3;i++)
-			{
-				m = (i+1)%3;
-				n = (i+2)%3;
-				o = i==0?1:0;
-				p = i==2?1:2;
-				for(j=0;j<3;j++)
-				{
-					q = j==2?1:2;
-					r = j==0?1:0;
-					t = T[n]*transcache.m_R1to0[m][j] - T[m]*transcache.m_R1to0[n][j];
-					t2 = ea[o]*transcache.m_AR[p][j] + ea[p]*transcache.m_AR[o][j] +
-						eb[r]*transcache.m_AR[i][q] + eb[q]*transcache.m_AR[i][r];
-					if(BT_GREATER(t,t2))	return false;
-				}
-			}
-		}
-		return true;
-	}
-
-	//! Simple test for planes.
-	SIMD_FORCE_INLINE bool collide_plane(
-		const btVector4 & plane) const
-	{
-		eBT_PLANE_INTERSECTION_TYPE classify = plane_classify(plane);
-		return (classify == BT_CONST_COLLIDE_PLANE);
-	}
-
-	//! test for a triangle, with edges
-	SIMD_FORCE_INLINE bool collide_triangle_exact(
-		const btVector3 & p1,
-		const btVector3 & p2,
-		const btVector3 & p3,
-		const btVector4 & triangle_plane) const
-	{
-		if(!collide_plane(triangle_plane)) return false;
-
-		btVector3 center,extends;
-		this->get_center_extend(center,extends);
-
-		const btVector3 v1(p1 - center);
-		const btVector3 v2(p2 - center);
-		const btVector3 v3(p3 - center);
-
-		//First axis
-		btVector3 diff(v2 - v1);
-		btVector3 abs_diff = diff.absolute();
-		//Test With X axis
-		TEST_CROSS_EDGE_BOX_X_AXIS_MCR(diff,abs_diff,v1,v3,extends);
-		//Test With Y axis
-		TEST_CROSS_EDGE_BOX_Y_AXIS_MCR(diff,abs_diff,v1,v3,extends);
-		//Test With Z axis
-		TEST_CROSS_EDGE_BOX_Z_AXIS_MCR(diff,abs_diff,v1,v3,extends);
-
-
-		diff = v3 - v2;
-		abs_diff = diff.absolute();
-		//Test With X axis
-		TEST_CROSS_EDGE_BOX_X_AXIS_MCR(diff,abs_diff,v2,v1,extends);
-		//Test With Y axis
-		TEST_CROSS_EDGE_BOX_Y_AXIS_MCR(diff,abs_diff,v2,v1,extends);
-		//Test With Z axis
-		TEST_CROSS_EDGE_BOX_Z_AXIS_MCR(diff,abs_diff,v2,v1,extends);
-
-		diff = v1 - v3;
-		abs_diff = diff.absolute();
-		//Test With X axis
-		TEST_CROSS_EDGE_BOX_X_AXIS_MCR(diff,abs_diff,v3,v2,extends);
-		//Test With Y axis
-		TEST_CROSS_EDGE_BOX_Y_AXIS_MCR(diff,abs_diff,v3,v2,extends);
-		//Test With Z axis
-		TEST_CROSS_EDGE_BOX_Z_AXIS_MCR(diff,abs_diff,v3,v2,extends);
-
-		return true;
-	}
-};
-
-
-//! Compairison of transformation objects
-SIMD_FORCE_INLINE bool btCompareTransformsEqual(const btTransform & t1,const btTransform & t2)
-{
-	if(!(t1.getOrigin() == t2.getOrigin()) ) return false;
-
-	if(!(t1.getBasis().getRow(0) == t2.getBasis().getRow(0)) ) return false;
-	if(!(t1.getBasis().getRow(1) == t2.getBasis().getRow(1)) ) return false;
-	if(!(t1.getBasis().getRow(2) == t2.getBasis().getRow(2)) ) return false;
-	return true;
-}
-
-
-
-#endif // GIM_BOX_COLLISION_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btClipPolygon.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btClipPolygon.h
deleted file mode 100644
index de0a523..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/btClipPolygon.h
+++ /dev/null
@@ -1,182 +0,0 @@
-#ifndef BT_CLIP_POLYGON_H_INCLUDED
-#define BT_CLIP_POLYGON_H_INCLUDED
-
-/*! \file btClipPolygon.h
-\author Francisco Leon Najera
-*/
-/*
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "LinearMath/btTransform.h"
-#include "LinearMath/btGeometryUtil.h"
-
-
-SIMD_FORCE_INLINE btScalar bt_distance_point_plane(const btVector4 & plane,const btVector3 &point)
-{
-	return point.dot(plane) - plane[3];
-}
-
-/*! Vector blending
-Takes two vectors a, b, blends them together*/
-SIMD_FORCE_INLINE void bt_vec_blend(btVector3 &vr, const btVector3 &va,const btVector3 &vb, btScalar blend_factor)
-{
-	vr = (1-blend_factor)*va + blend_factor*vb;
-}
-
-//! This function calcs the distance from a 3D plane
-SIMD_FORCE_INLINE void bt_plane_clip_polygon_collect(
-						const btVector3 & point0,
-						const btVector3 & point1,
-						btScalar dist0,
-						btScalar dist1,
-						btVector3 * clipped,
-						int & clipped_count)
-{
-	bool _prevclassif = (dist0>SIMD_EPSILON);
-	bool _classif = (dist1>SIMD_EPSILON);
-	if(_classif!=_prevclassif)
-	{
-		btScalar blendfactor = -dist0/(dist1-dist0);
-		bt_vec_blend(clipped[clipped_count],point0,point1,blendfactor);
-		clipped_count++;
-	}
-	if(!_classif)
-	{
-		clipped[clipped_count] = point1;
-		clipped_count++;
-	}
-}
-
-
-//! Clips a polygon by a plane
-/*!
-*\return The count of the clipped counts
-*/
-SIMD_FORCE_INLINE int bt_plane_clip_polygon(
-						const btVector4 & plane,
-						const btVector3 * polygon_points,
-						int polygon_point_count,
-						btVector3 * clipped)
-{
-    int clipped_count = 0;
-
-
-    //clip first point
-	btScalar firstdist = bt_distance_point_plane(plane,polygon_points[0]);;
-	if(!(firstdist>SIMD_EPSILON))
-	{
-		clipped[clipped_count] = polygon_points[0];
-		clipped_count++;
-	}
-
-	btScalar olddist = firstdist;
-	for(int i=1;i<polygon_point_count;i++)
-	{
-		btScalar dist = bt_distance_point_plane(plane,polygon_points[i]);
-
-		bt_plane_clip_polygon_collect(
-						polygon_points[i-1],polygon_points[i],
-						olddist,
-						dist,
-						clipped,
-						clipped_count);
-
-
-		olddist = dist;
-	}
-
-	//RETURN TO FIRST  point
-
-	bt_plane_clip_polygon_collect(
-					polygon_points[polygon_point_count-1],polygon_points[0],
-					olddist,
-					firstdist,
-					clipped,
-					clipped_count);
-
-	return clipped_count;
-}
-
-//! Clips a polygon by a plane
-/*!
-*\param clipped must be an array of 16 points.
-*\return The count of the clipped counts
-*/
-SIMD_FORCE_INLINE int bt_plane_clip_triangle(
-						const btVector4 & plane,
-						const btVector3 & point0,
-						const btVector3 & point1,
-						const btVector3& point2,
-						btVector3 * clipped // an allocated array of 16 points at least
-						)
-{
-    int clipped_count = 0;
-
-    //clip first point0
-	btScalar firstdist = bt_distance_point_plane(plane,point0);;
-	if(!(firstdist>SIMD_EPSILON))
-	{
-		clipped[clipped_count] = point0;
-		clipped_count++;
-	}
-
-	// point 1
-	btScalar olddist = firstdist;
-	btScalar dist = bt_distance_point_plane(plane,point1);
-
-	bt_plane_clip_polygon_collect(
-					point0,point1,
-					olddist,
-					dist,
-					clipped,
-					clipped_count);
-
-	olddist = dist;
-
-
-	// point 2
-	dist = bt_distance_point_plane(plane,point2);
-
-	bt_plane_clip_polygon_collect(
-					point1,point2,
-					olddist,
-					dist,
-					clipped,
-					clipped_count);
-	olddist = dist;
-
-
-
-	//RETURN TO FIRST  point0
-	bt_plane_clip_polygon_collect(
-					point2,point0,
-					olddist,
-					firstdist,
-					clipped,
-					clipped_count);
-
-	return clipped_count;
-}
-
-
-
-
-
-#endif // GIM_TRI_COLLISION_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btContactProcessing.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btContactProcessing.h
deleted file mode 100644
index 0c66f8e..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/btContactProcessing.h
+++ /dev/null
@@ -1,145 +0,0 @@
-#ifndef BT_CONTACT_H_INCLUDED
-#define BT_CONTACT_H_INCLUDED
-
-/*! \file gim_contact.h
-\author Francisco Leon Najera
-*/
-/*
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "LinearMath/btTransform.h"
-#include "LinearMath/btAlignedObjectArray.h"
-#include "btTriangleShapeEx.h"
-
-
-
-/**
-Configuration var for applying interpolation of  contact normals
-*/
-#define NORMAL_CONTACT_AVERAGE 1
-
-#define CONTACT_DIFF_EPSILON 0.00001f
-
-///The GIM_CONTACT is an internal GIMPACT structure, similar to btManifoldPoint.
-///@todo: remove and replace GIM_CONTACT by btManifoldPoint.
-class GIM_CONTACT
-{
-public:
-    btVector3 m_point;
-    btVector3 m_normal;
-    btScalar m_depth;//Positive value indicates interpenetration
-    btScalar m_distance;//Padding not for use
-    int m_feature1;//Face number
-    int m_feature2;//Face number
-public:
-    GIM_CONTACT()
-    {
-    }
-
-    GIM_CONTACT(const GIM_CONTACT & contact):
-				m_point(contact.m_point),
-				m_normal(contact.m_normal),
-				m_depth(contact.m_depth),
-				m_feature1(contact.m_feature1),
-				m_feature2(contact.m_feature2)
-    {
-    }
-
-    GIM_CONTACT(const btVector3 &point,const btVector3 & normal,
-    	 			btScalar depth, int feature1, int feature2):
-				m_point(point),
-				m_normal(normal),
-				m_depth(depth),
-				m_feature1(feature1),
-				m_feature2(feature2)
-    {
-    }
-
-	//! Calcs key for coord classification
-    SIMD_FORCE_INLINE unsigned int calc_key_contact() const
-    {
-    	int _coords[] = {
-    		(int)(m_point[0]*1000.0f+1.0f),
-    		(int)(m_point[1]*1333.0f),
-    		(int)(m_point[2]*2133.0f+3.0f)};
-		unsigned int _hash=0;
-		unsigned int *_uitmp = (unsigned int *)(&_coords[0]);
-		_hash = *_uitmp;
-		_uitmp++;
-		_hash += (*_uitmp)<<4;
-		_uitmp++;
-		_hash += (*_uitmp)<<8;
-		return _hash;
-    }
-
-    SIMD_FORCE_INLINE void interpolate_normals( btVector3 * normals,int normal_count)
-    {
-    	btVector3 vec_sum(m_normal);
-		for(int i=0;i<normal_count;i++)
-		{
-			vec_sum += normals[i];
-		}
-
-		btScalar vec_sum_len = vec_sum.length2();
-		if(vec_sum_len <CONTACT_DIFF_EPSILON) return;
-
-		//GIM_INV_SQRT(vec_sum_len,vec_sum_len); // 1/sqrt(vec_sum_len)
-
-		m_normal = vec_sum/btSqrt(vec_sum_len);
-    }
-
-};
-
-
-class btContactArray:public btAlignedObjectArray<GIM_CONTACT>
-{
-public:
-	btContactArray()
-	{
-		reserve(64);
-	}
-
-	SIMD_FORCE_INLINE void push_contact(
-		const btVector3 &point,const btVector3 & normal,
-		btScalar depth, int feature1, int feature2)
-	{
-		push_back( GIM_CONTACT(point,normal,depth,feature1,feature2) );
-	}
-
-	SIMD_FORCE_INLINE void push_triangle_contacts(
-		const GIM_TRIANGLE_CONTACT & tricontact,
-		int feature1,int feature2)
-	{
-		for(int i = 0;i<tricontact.m_point_count ;i++ )
-		{
-			push_contact(
-				tricontact.m_points[i],
-				tricontact.m_separating_normal,
-				tricontact.m_penetration_depth,feature1,feature2);
-		}
-	}
-
-	void merge_contacts(const btContactArray & contacts, bool normal_contact_average = true);
-
-	void merge_contacts_unique(const btContactArray & contacts);
-};
-
-
-#endif // GIM_CONTACT_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactBvh.cpp b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactBvh.cpp
deleted file mode 100644
index 8632331..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactBvh.cpp
+++ /dev/null
@@ -1,498 +0,0 @@
-/*! \file gim_box_set.h
-\author Francisco Leon Najera
-*/
-/*
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-#include "btGImpactBvh.h"
-#include "LinearMath/btQuickprof.h"
-
-#ifdef TRI_COLLISION_PROFILING
-
-btClock g_tree_clock;
-
-float g_accum_tree_collision_time = 0;
-int g_count_traversing = 0;
-
-
-void bt_begin_gim02_tree_time()
-{
-	g_tree_clock.reset();
-}
-
-void bt_end_gim02_tree_time()
-{
-	g_accum_tree_collision_time += g_tree_clock.getTimeMicroseconds();
-	g_count_traversing++;
-}
-
-//! Gets the average time in miliseconds of tree collisions
-float btGImpactBvh::getAverageTreeCollisionTime()
-{
-	if(g_count_traversing == 0) return 0;
-
-	float avgtime = g_accum_tree_collision_time;
-	avgtime /= (float)g_count_traversing;
-
-	g_accum_tree_collision_time = 0;
-	g_count_traversing = 0;
-	return avgtime;
-
-//	float avgtime = g_count_traversing;
-//	g_count_traversing = 0;
-//	return avgtime;
-
-}
-
-#endif //TRI_COLLISION_PROFILING
-
-/////////////////////// btBvhTree /////////////////////////////////
-
-int btBvhTree::_calc_splitting_axis(
-	GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,  int endIndex)
-{
-
-	int i;
-
-	btVector3 means(btScalar(0.),btScalar(0.),btScalar(0.));
-	btVector3 variance(btScalar(0.),btScalar(0.),btScalar(0.));
-	int numIndices = endIndex-startIndex;
-
-	for (i=startIndex;i<endIndex;i++)
-	{
-		btVector3 center = btScalar(0.5)*(primitive_boxes[i].m_bound.m_max +
-					 primitive_boxes[i].m_bound.m_min);
-		means+=center;
-	}
-	means *= (btScalar(1.)/(btScalar)numIndices);
-
-	for (i=startIndex;i<endIndex;i++)
-	{
-		btVector3 center = btScalar(0.5)*(primitive_boxes[i].m_bound.m_max +
-					 primitive_boxes[i].m_bound.m_min);
-		btVector3 diff2 = center-means;
-		diff2 = diff2 * diff2;
-		variance += diff2;
-	}
-	variance *= (btScalar(1.)/	((btScalar)numIndices-1)	);
-
-	return variance.maxAxis();
-}
-
-
-int btBvhTree::_sort_and_calc_splitting_index(
-	GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,
-	int endIndex, int splitAxis)
-{
-	int i;
-	int splitIndex =startIndex;
-	int numIndices = endIndex - startIndex;
-
-	// average of centers
-	btScalar splitValue = 0.0f;
-
-	btVector3 means(btScalar(0.),btScalar(0.),btScalar(0.));
-	for (i=startIndex;i<endIndex;i++)
-	{
-		btVector3 center = btScalar(0.5)*(primitive_boxes[i].m_bound.m_max +
-					 primitive_boxes[i].m_bound.m_min);
-		means+=center;
-	}
-	means *= (btScalar(1.)/(btScalar)numIndices);
-
-	splitValue = means[splitAxis];
-
-
-	//sort leafNodes so all values larger then splitValue comes first, and smaller values start from 'splitIndex'.
-	for (i=startIndex;i<endIndex;i++)
-	{
-		btVector3 center = btScalar(0.5)*(primitive_boxes[i].m_bound.m_max +
-					 primitive_boxes[i].m_bound.m_min);
-		if (center[splitAxis] > splitValue)
-		{
-			//swap
-			primitive_boxes.swap(i,splitIndex);
-			//swapLeafNodes(i,splitIndex);
-			splitIndex++;
-		}
-	}
-
-	//if the splitIndex causes unbalanced trees, fix this by using the center in between startIndex and endIndex
-	//otherwise the tree-building might fail due to stack-overflows in certain cases.
-	//unbalanced1 is unsafe: it can cause stack overflows
-	//bool unbalanced1 = ((splitIndex==startIndex) || (splitIndex == (endIndex-1)));
-
-	//unbalanced2 should work too: always use center (perfect balanced trees)
-	//bool unbalanced2 = true;
-
-	//this should be safe too:
-	int rangeBalancedIndices = numIndices/3;
-	bool unbalanced = ((splitIndex<=(startIndex+rangeBalancedIndices)) || (splitIndex >=(endIndex-1-rangeBalancedIndices)));
-
-	if (unbalanced)
-	{
-		splitIndex = startIndex+ (numIndices>>1);
-	}
-
-	btAssert(!((splitIndex==startIndex) || (splitIndex == (endIndex))));
-
-	return splitIndex;
-
-}
-
-
-void btBvhTree::_build_sub_tree(GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,  int endIndex)
-{
-	int curIndex = m_num_nodes;
-	m_num_nodes++;
-
-	btAssert((endIndex-startIndex)>0);
-
-	if ((endIndex-startIndex)==1)
-	{
-	    //We have a leaf node
-	    setNodeBound(curIndex,primitive_boxes[startIndex].m_bound);
-		m_node_array[curIndex].setDataIndex(primitive_boxes[startIndex].m_data);
-
-		return;
-	}
-	//calculate Best Splitting Axis and where to split it. Sort the incoming 'leafNodes' array within range 'startIndex/endIndex'.
-
-	//split axis
-	int splitIndex = _calc_splitting_axis(primitive_boxes,startIndex,endIndex);
-
-	splitIndex = _sort_and_calc_splitting_index(
-			primitive_boxes,startIndex,endIndex,
-			splitIndex//split axis
-			);
-
-
-	//calc this node bounding box
-
-	btAABB node_bound;
-	node_bound.invalidate();
-
-	for (int i=startIndex;i<endIndex;i++)
-	{
-		node_bound.merge(primitive_boxes[i].m_bound);
-	}
-
-	setNodeBound(curIndex,node_bound);
-
-
-	//build left branch
-	_build_sub_tree(primitive_boxes, startIndex, splitIndex );
-
-
-	//build right branch
-	 _build_sub_tree(primitive_boxes, splitIndex ,endIndex);
-
-	m_node_array[curIndex].setEscapeIndex(m_num_nodes - curIndex);
-
-
-}
-
-//! stackless build tree
-void btBvhTree::build_tree(
-	GIM_BVH_DATA_ARRAY & primitive_boxes)
-{
-	// initialize node count to 0
-	m_num_nodes = 0;
-	// allocate nodes
-	m_node_array.resize(primitive_boxes.size()*2);
-
-	_build_sub_tree(primitive_boxes, 0, primitive_boxes.size());
-}
-
-////////////////////////////////////class btGImpactBvh
-
-void btGImpactBvh::refit()
-{
-	int nodecount = getNodeCount();
-	while(nodecount--)
-	{
-		if(isLeafNode(nodecount))
-		{
-			btAABB leafbox;
-			m_primitive_manager->get_primitive_box(getNodeData(nodecount),leafbox);
-			setNodeBound(nodecount,leafbox);
-		}
-		else
-		{
-			//const GIM_BVH_TREE_NODE * nodepointer = get_node_pointer(nodecount);
-			//get left bound
-			btAABB bound;
-			bound.invalidate();
-
-			btAABB temp_box;
-
-			int child_node = getLeftNode(nodecount);
-			if(child_node)
-			{
-				getNodeBound(child_node,temp_box);
-				bound.merge(temp_box);
-			}
-
-			child_node = getRightNode(nodecount);
-			if(child_node)
-			{
-				getNodeBound(child_node,temp_box);
-				bound.merge(temp_box);
-			}
-
-			setNodeBound(nodecount,bound);
-		}
-	}
-}
-
-//! this rebuild the entire set
-void btGImpactBvh::buildSet()
-{
-	//obtain primitive boxes
-	GIM_BVH_DATA_ARRAY primitive_boxes;
-	primitive_boxes.resize(m_primitive_manager->get_primitive_count());
-
-	for (int i = 0;i<primitive_boxes.size() ;i++ )
-	{
-		 m_primitive_manager->get_primitive_box(i,primitive_boxes[i].m_bound);
-		 primitive_boxes[i].m_data = i;
-	}
-
-	m_box_tree.build_tree(primitive_boxes);
-}
-
-//! returns the indices of the primitives in the m_primitive_manager
-bool btGImpactBvh::boxQuery(const btAABB & box, btAlignedObjectArray<int> & collided_results) const
-{
-	int curIndex = 0;
-	int numNodes = getNodeCount();
-
-	while (curIndex < numNodes)
-	{
-		btAABB bound;
-		getNodeBound(curIndex,bound);
-
-		//catch bugs in tree data
-
-		bool aabbOverlap = bound.has_collision(box);
-		bool isleafnode = isLeafNode(curIndex);
-
-		if (isleafnode && aabbOverlap)
-		{
-			collided_results.push_back(getNodeData(curIndex));
-		}
-
-		if (aabbOverlap || isleafnode)
-		{
-			//next subnode
-			curIndex++;
-		}
-		else
-		{
-			//skip node
-			curIndex+= getEscapeNodeIndex(curIndex);
-		}
-	}
-	if(collided_results.size()>0) return true;
-	return false;
-}
-
-
-
-//! returns the indices of the primitives in the m_primitive_manager
-bool btGImpactBvh::rayQuery(
-	const btVector3 & ray_dir,const btVector3 & ray_origin ,
-	btAlignedObjectArray<int> & collided_results) const
-{
-	int curIndex = 0;
-	int numNodes = getNodeCount();
-
-	while (curIndex < numNodes)
-	{
-		btAABB bound;
-		getNodeBound(curIndex,bound);
-
-		//catch bugs in tree data
-
-		bool aabbOverlap = bound.collide_ray(ray_origin,ray_dir);
-		bool isleafnode = isLeafNode(curIndex);
-
-		if (isleafnode && aabbOverlap)
-		{
-			collided_results.push_back(getNodeData( curIndex));
-		}
-
-		if (aabbOverlap || isleafnode)
-		{
-			//next subnode
-			curIndex++;
-		}
-		else
-		{
-			//skip node
-			curIndex+= getEscapeNodeIndex(curIndex);
-		}
-	}
-	if(collided_results.size()>0) return true;
-	return false;
-}
-
-
-SIMD_FORCE_INLINE bool _node_collision(
-	btGImpactBvh * boxset0, btGImpactBvh * boxset1,
-	const BT_BOX_BOX_TRANSFORM_CACHE & trans_cache_1to0,
-	int node0 ,int node1, bool complete_primitive_tests)
-{
-	btAABB box0;
-	boxset0->getNodeBound(node0,box0);
-	btAABB box1;
-	boxset1->getNodeBound(node1,box1);
-
-	return box0.overlapping_trans_cache(box1,trans_cache_1to0,complete_primitive_tests );
-//	box1.appy_transform_trans_cache(trans_cache_1to0);
-//	return box0.has_collision(box1);
-
-}
-
-
-//stackless recursive collision routine
-static void _find_collision_pairs_recursive(
-	btGImpactBvh * boxset0, btGImpactBvh * boxset1,
-	btPairSet * collision_pairs,
-	const BT_BOX_BOX_TRANSFORM_CACHE & trans_cache_1to0,
-	int node0, int node1, bool complete_primitive_tests)
-{
-
-
-
-	if( _node_collision(
-		boxset0,boxset1,trans_cache_1to0,
-		node0,node1,complete_primitive_tests) ==false) return;//avoid colliding internal nodes
-
-	if(boxset0->isLeafNode(node0))
-	{
-		if(boxset1->isLeafNode(node1))
-		{
-			// collision result
-			collision_pairs->push_pair(
-				boxset0->getNodeData(node0),boxset1->getNodeData(node1));
-			return;
-		}
-		else
-		{
-
-			//collide left recursive
-
-			_find_collision_pairs_recursive(
-								boxset0,boxset1,
-								collision_pairs,trans_cache_1to0,
-								node0,boxset1->getLeftNode(node1),false);
-
-			//collide right recursive
-			_find_collision_pairs_recursive(
-								boxset0,boxset1,
-								collision_pairs,trans_cache_1to0,
-								node0,boxset1->getRightNode(node1),false);
-
-
-		}
-	}
-	else
-	{
-		if(boxset1->isLeafNode(node1))
-		{
-
-			//collide left recursive
-			_find_collision_pairs_recursive(
-								boxset0,boxset1,
-								collision_pairs,trans_cache_1to0,
-								boxset0->getLeftNode(node0),node1,false);
-
-
-			//collide right recursive
-
-			_find_collision_pairs_recursive(
-								boxset0,boxset1,
-								collision_pairs,trans_cache_1to0,
-								boxset0->getRightNode(node0),node1,false);
-
-
-		}
-		else
-		{
-			//collide left0 left1
-
-
-
-			_find_collision_pairs_recursive(
-				boxset0,boxset1,
-				collision_pairs,trans_cache_1to0,
-				boxset0->getLeftNode(node0),boxset1->getLeftNode(node1),false);
-
-			//collide left0 right1
-
-			_find_collision_pairs_recursive(
-				boxset0,boxset1,
-				collision_pairs,trans_cache_1to0,
-				boxset0->getLeftNode(node0),boxset1->getRightNode(node1),false);
-
-
-			//collide right0 left1
-
-			_find_collision_pairs_recursive(
-				boxset0,boxset1,
-				collision_pairs,trans_cache_1to0,
-				boxset0->getRightNode(node0),boxset1->getLeftNode(node1),false);
-
-			//collide right0 right1
-
-			_find_collision_pairs_recursive(
-				boxset0,boxset1,
-				collision_pairs,trans_cache_1to0,
-				boxset0->getRightNode(node0),boxset1->getRightNode(node1),false);
-
-		}// else if node1 is not a leaf
-	}// else if node0 is not a leaf
-}
-
-
-void btGImpactBvh::find_collision(btGImpactBvh * boxset0, const btTransform & trans0,
-		btGImpactBvh * boxset1, const btTransform & trans1,
-		btPairSet & collision_pairs)
-{
-
-	if(boxset0->getNodeCount()==0 || boxset1->getNodeCount()==0 ) return;
-
-	BT_BOX_BOX_TRANSFORM_CACHE trans_cache_1to0;
-
-	trans_cache_1to0.calc_from_homogenic(trans0,trans1);
-
-#ifdef TRI_COLLISION_PROFILING
-	bt_begin_gim02_tree_time();
-#endif //TRI_COLLISION_PROFILING
-
-	_find_collision_pairs_recursive(
-		boxset0,boxset1,
-		&collision_pairs,trans_cache_1to0,0,0,true);
-#ifdef TRI_COLLISION_PROFILING
-	bt_end_gim02_tree_time();
-#endif //TRI_COLLISION_PROFILING
-
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactBvh.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactBvh.h
deleted file mode 100644
index 6174ae9..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactBvh.h
+++ /dev/null
@@ -1,396 +0,0 @@
-#ifndef GIM_BOX_SET_H_INCLUDED
-#define GIM_BOX_SET_H_INCLUDED
-
-/*! \file gim_box_set.h
-\author Francisco Leon Najera
-*/
-/*
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "LinearMath/btAlignedObjectArray.h"
-
-#include "btBoxCollision.h"
-#include "btTriangleShapeEx.h"
-
-
-
-
-
-//! Overlapping pair
-struct GIM_PAIR
-{
-    int m_index1;
-    int m_index2;
-    GIM_PAIR()
-    {}
-
-    GIM_PAIR(const GIM_PAIR & p)
-    {
-    	m_index1 = p.m_index1;
-    	m_index2 = p.m_index2;
-	}
-
-	GIM_PAIR(int index1, int index2)
-    {
-    	m_index1 = index1;
-    	m_index2 = index2;
-	}
-};
-
-//! A pairset array
-class btPairSet: public btAlignedObjectArray<GIM_PAIR>
-{
-public:
-	btPairSet()
-	{
-		reserve(32);
-	}
-	inline void push_pair(int index1,int index2)
-	{
-		push_back(GIM_PAIR(index1,index2));
-	}
-
-	inline void push_pair_inv(int index1,int index2)
-	{
-		push_back(GIM_PAIR(index2,index1));
-	}
-};
-
-
-///GIM_BVH_DATA is an internal GIMPACT collision structure to contain axis aligned bounding box
-struct GIM_BVH_DATA
-{
-	btAABB m_bound;
-	int m_data;
-};
-
-//! Node Structure for trees
-class GIM_BVH_TREE_NODE
-{
-public:
-	btAABB m_bound;
-protected:
-	int	m_escapeIndexOrDataIndex;
-public:
-	GIM_BVH_TREE_NODE()
-	{
-		m_escapeIndexOrDataIndex = 0;
-	}
-
-	SIMD_FORCE_INLINE bool isLeafNode() const
-	{
-		//skipindex is negative (internal node), triangleindex >=0 (leafnode)
-		return (m_escapeIndexOrDataIndex>=0);
-	}
-
-	SIMD_FORCE_INLINE int getEscapeIndex() const
-	{
-		//btAssert(m_escapeIndexOrDataIndex < 0);
-		return -m_escapeIndexOrDataIndex;
-	}
-
-	SIMD_FORCE_INLINE void setEscapeIndex(int index)
-	{
-		m_escapeIndexOrDataIndex = -index;
-	}
-
-	SIMD_FORCE_INLINE int getDataIndex() const
-	{
-		//btAssert(m_escapeIndexOrDataIndex >= 0);
-
-		return m_escapeIndexOrDataIndex;
-	}
-
-	SIMD_FORCE_INLINE void setDataIndex(int index)
-	{
-		m_escapeIndexOrDataIndex = index;
-	}
-
-};
-
-
-class GIM_BVH_DATA_ARRAY:public btAlignedObjectArray<GIM_BVH_DATA>
-{
-};
-
-
-class GIM_BVH_TREE_NODE_ARRAY:public btAlignedObjectArray<GIM_BVH_TREE_NODE>
-{
-};
-
-
-
-
-//! Basic Box tree structure
-class btBvhTree
-{
-protected:
-	int m_num_nodes;
-	GIM_BVH_TREE_NODE_ARRAY m_node_array;
-protected:
-	int _sort_and_calc_splitting_index(
-		GIM_BVH_DATA_ARRAY & primitive_boxes,
-		 int startIndex,  int endIndex, int splitAxis);
-
-	int _calc_splitting_axis(GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,  int endIndex);
-
-	void _build_sub_tree(GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,  int endIndex);
-public:
-	btBvhTree()
-	{
-		m_num_nodes = 0;
-	}
-
-	//! prototype functions for box tree management
-	//!@{
-	void build_tree(GIM_BVH_DATA_ARRAY & primitive_boxes);
-
-	SIMD_FORCE_INLINE void clearNodes()
-	{
-		m_node_array.clear();
-		m_num_nodes = 0;
-	}
-
-	//! node count
-	SIMD_FORCE_INLINE int getNodeCount() const
-	{
-		return m_num_nodes;
-	}
-
-	//! tells if the node is a leaf
-	SIMD_FORCE_INLINE bool isLeafNode(int nodeindex) const
-	{
-		return m_node_array[nodeindex].isLeafNode();
-	}
-
-	SIMD_FORCE_INLINE int getNodeData(int nodeindex) const
-	{
-		return m_node_array[nodeindex].getDataIndex();
-	}
-
-	SIMD_FORCE_INLINE void getNodeBound(int nodeindex, btAABB & bound) const
-	{
-		bound = m_node_array[nodeindex].m_bound;
-	}
-
-	SIMD_FORCE_INLINE void setNodeBound(int nodeindex, const btAABB & bound)
-	{
-		m_node_array[nodeindex].m_bound = bound;
-	}
-
-	SIMD_FORCE_INLINE int getLeftNode(int nodeindex) const
-	{
-		return nodeindex+1;
-	}
-
-	SIMD_FORCE_INLINE int getRightNode(int nodeindex) const
-	{
-		if(m_node_array[nodeindex+1].isLeafNode()) return nodeindex+2;
-		return nodeindex+1 + m_node_array[nodeindex+1].getEscapeIndex();
-	}
-
-	SIMD_FORCE_INLINE int getEscapeNodeIndex(int nodeindex) const
-	{
-		return m_node_array[nodeindex].getEscapeIndex();
-	}
-
-	SIMD_FORCE_INLINE const GIM_BVH_TREE_NODE * get_node_pointer(int index = 0) const
-	{
-		return &m_node_array[index];
-	}
-
-	//!@}
-};
-
-
-//! Prototype Base class for primitive classification
-/*!
-This class is a wrapper for primitive collections.
-This tells relevant info for the Bounding Box set classes, which take care of space classification.
-This class can manage Compound shapes and trimeshes, and if it is managing trimesh then the  Hierarchy Bounding Box classes will take advantage of primitive Vs Box overlapping tests for getting optimal results and less Per Box compairisons.
-*/
-class btPrimitiveManagerBase
-{
-public:
-
-	virtual ~btPrimitiveManagerBase() {}
-
-	//! determines if this manager consist on only triangles, which special case will be optimized
-	virtual bool is_trimesh() const = 0;
-	virtual int get_primitive_count() const = 0;
-	virtual void get_primitive_box(int prim_index ,btAABB & primbox) const = 0;
-	//! retrieves only the points of the triangle, and the collision margin
-	virtual void get_primitive_triangle(int prim_index,btPrimitiveTriangle & triangle) const= 0;
-};
-
-
-//! Structure for containing Boxes
-/*!
-This class offers an structure for managing a box tree of primitives.
-Requires a Primitive prototype (like btPrimitiveManagerBase )
-*/
-class btGImpactBvh
-{
-protected:
-	btBvhTree m_box_tree;
-	btPrimitiveManagerBase * m_primitive_manager;
-
-protected:
-	//stackless refit
-	void refit();
-public:
-
-	//! this constructor doesn't build the tree. you must call	buildSet
-	btGImpactBvh()
-	{
-		m_primitive_manager = NULL;
-	}
-
-	//! this constructor doesn't build the tree. you must call	buildSet
-	btGImpactBvh(btPrimitiveManagerBase * primitive_manager)
-	{
-		m_primitive_manager = primitive_manager;
-	}
-
-	SIMD_FORCE_INLINE btAABB getGlobalBox()  const
-	{
-		btAABB totalbox;
-		getNodeBound(0, totalbox);
-		return totalbox;
-	}
-
-	SIMD_FORCE_INLINE void setPrimitiveManager(btPrimitiveManagerBase * primitive_manager)
-	{
-		m_primitive_manager = primitive_manager;
-	}
-
-	SIMD_FORCE_INLINE btPrimitiveManagerBase * getPrimitiveManager() const
-	{
-		return m_primitive_manager;
-	}
-
-
-//! node manager prototype functions
-///@{
-
-	//! this attemps to refit the box set.
-	SIMD_FORCE_INLINE void update()
-	{
-		refit();
-	}
-
-	//! this rebuild the entire set
-	void buildSet();
-
-	//! returns the indices of the primitives in the m_primitive_manager
-	bool boxQuery(const btAABB & box, btAlignedObjectArray<int> & collided_results) const;
-
-	//! returns the indices of the primitives in the m_primitive_manager
-	SIMD_FORCE_INLINE bool boxQueryTrans(const btAABB & box,
-		 const btTransform & transform, btAlignedObjectArray<int> & collided_results) const
-	{
-		btAABB transbox=box;
-		transbox.appy_transform(transform);
-		return boxQuery(transbox,collided_results);
-	}
-
-	//! returns the indices of the primitives in the m_primitive_manager
-	bool rayQuery(
-		const btVector3 & ray_dir,const btVector3 & ray_origin ,
-		btAlignedObjectArray<int> & collided_results) const;
-
-	//! tells if this set has hierarcht
-	SIMD_FORCE_INLINE bool hasHierarchy() const
-	{
-		return true;
-	}
-
-	//! tells if this set is a trimesh
-	SIMD_FORCE_INLINE bool isTrimesh()  const
-	{
-		return m_primitive_manager->is_trimesh();
-	}
-
-	//! node count
-	SIMD_FORCE_INLINE int getNodeCount() const
-	{
-		return m_box_tree.getNodeCount();
-	}
-
-	//! tells if the node is a leaf
-	SIMD_FORCE_INLINE bool isLeafNode(int nodeindex) const
-	{
-		return m_box_tree.isLeafNode(nodeindex);
-	}
-
-	SIMD_FORCE_INLINE int getNodeData(int nodeindex) const
-	{
-		return m_box_tree.getNodeData(nodeindex);
-	}
-
-	SIMD_FORCE_INLINE void getNodeBound(int nodeindex, btAABB & bound)  const
-	{
-		m_box_tree.getNodeBound(nodeindex, bound);
-	}
-
-	SIMD_FORCE_INLINE void setNodeBound(int nodeindex, const btAABB & bound)
-	{
-		m_box_tree.setNodeBound(nodeindex, bound);
-	}
-
-
-	SIMD_FORCE_INLINE int getLeftNode(int nodeindex) const
-	{
-		return m_box_tree.getLeftNode(nodeindex);
-	}
-
-	SIMD_FORCE_INLINE int getRightNode(int nodeindex) const
-	{
-		return m_box_tree.getRightNode(nodeindex);
-	}
-
-	SIMD_FORCE_INLINE int getEscapeNodeIndex(int nodeindex) const
-	{
-		return m_box_tree.getEscapeNodeIndex(nodeindex);
-	}
-
-	SIMD_FORCE_INLINE void getNodeTriangle(int nodeindex,btPrimitiveTriangle & triangle) const
-	{
-		m_primitive_manager->get_primitive_triangle(getNodeData(nodeindex),triangle);
-	}
-
-
-	SIMD_FORCE_INLINE const GIM_BVH_TREE_NODE * get_node_pointer(int index = 0) const
-	{
-		return m_box_tree.get_node_pointer(index);
-	}
-
-#ifdef TRI_COLLISION_PROFILING
-	static float getAverageTreeCollisionTime();
-#endif //TRI_COLLISION_PROFILING
-
-	static void find_collision(btGImpactBvh * boxset1, const btTransform & trans1,
-		btGImpactBvh * boxset2, const btTransform & trans2,
-		btPairSet & collision_pairs);
-};
-
-
-#endif // GIM_BOXPRUNING_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp
deleted file mode 100644
index 2f2c09f..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp
+++ /dev/null
@@ -1,904 +0,0 @@
-/*
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-/*
-Author: Francisco Len N�jera
-Concave-Concave Collision
-
-*/
-
-#include "BulletCollision/CollisionDispatch/btManifoldResult.h"
-#include "LinearMath/btIDebugDraw.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-#include "BulletCollision/CollisionShapes/btBoxShape.h"
-#include "btGImpactCollisionAlgorithm.h"
-#include "btContactProcessing.h"
-#include "LinearMath/btQuickprof.h"
-
-
-//! Class for accessing the plane equation
-class btPlaneShape : public btStaticPlaneShape
-{
-public:
-
-	btPlaneShape(const btVector3& v, float f)
-		:btStaticPlaneShape(v,f)
-	{
-	}
-
-	void get_plane_equation(btVector4 &equation)
-	{
-		equation[0] = m_planeNormal[0];
-		equation[1] = m_planeNormal[1];
-		equation[2] = m_planeNormal[2];
-		equation[3] = m_planeConstant;
-	}
-
-
-	void get_plane_equation_transformed(const btTransform & trans,btVector4 &equation)
-	{
-		equation[0] = trans.getBasis().getRow(0).dot(m_planeNormal);
-		equation[1] = trans.getBasis().getRow(1).dot(m_planeNormal);
-		equation[2] = trans.getBasis().getRow(2).dot(m_planeNormal);
-		equation[3] = trans.getOrigin().dot(m_planeNormal) + m_planeConstant;
-	}
-};
-
-
-
-//////////////////////////////////////////////////////////////////////////////////////////////
-#ifdef TRI_COLLISION_PROFILING
-
-btClock g_triangle_clock;
-
-float g_accum_triangle_collision_time = 0;
-int g_count_triangle_collision = 0;
-
-void bt_begin_gim02_tri_time()
-{
-	g_triangle_clock.reset();
-}
-
-void bt_end_gim02_tri_time()
-{
-	g_accum_triangle_collision_time += g_triangle_clock.getTimeMicroseconds();
-	g_count_triangle_collision++;
-}
-#endif //TRI_COLLISION_PROFILING
-//! Retrieving shapes shapes
-/*!
-Declared here due of insuficent space on Pool allocators
-*/
-//!@{
-class GIM_ShapeRetriever
-{
-public:
-	btGImpactShapeInterface * m_gim_shape;
-	btTriangleShapeEx m_trishape;
-	btTetrahedronShapeEx m_tetrashape;
-
-public:
-	class ChildShapeRetriever
-	{
-	public:
-		GIM_ShapeRetriever * m_parent;
-		virtual btCollisionShape * getChildShape(int index)
-		{
-			return m_parent->m_gim_shape->getChildShape(index);
-		}
-		virtual ~ChildShapeRetriever() {}
-	};
-
-	class TriangleShapeRetriever:public ChildShapeRetriever
-	{
-	public:
-
-		virtual btCollisionShape * getChildShape(int index)
-		{
-			m_parent->m_gim_shape->getBulletTriangle(index,m_parent->m_trishape);
-			return &m_parent->m_trishape;
-		}
-		virtual ~TriangleShapeRetriever() {}
-	};
-
-	class TetraShapeRetriever:public ChildShapeRetriever
-	{
-	public:
-
-		virtual btCollisionShape * getChildShape(int index)
-		{
-			m_parent->m_gim_shape->getBulletTetrahedron(index,m_parent->m_tetrashape);
-			return &m_parent->m_tetrashape;
-		}
-	};
-public:
-	ChildShapeRetriever m_child_retriever;
-	TriangleShapeRetriever m_tri_retriever;
-	TetraShapeRetriever  m_tetra_retriever;
-	ChildShapeRetriever * m_current_retriever;
-
-	GIM_ShapeRetriever(btGImpactShapeInterface * gim_shape)
-	{
-		m_gim_shape = gim_shape;
-		//select retriever
-		if(m_gim_shape->needsRetrieveTriangles())
-		{
-			m_current_retriever = &m_tri_retriever;
-		}
-		else if(m_gim_shape->needsRetrieveTetrahedrons())
-		{
-			m_current_retriever = &m_tetra_retriever;
-		}
-		else
-		{
-			m_current_retriever = &m_child_retriever;
-		}
-
-		m_current_retriever->m_parent = this;
-	}
-
-	btCollisionShape * getChildShape(int index)
-	{
-		return m_current_retriever->getChildShape(index);
-	}
-
-
-};
-
-
-
-//!@}
-
-
-#ifdef TRI_COLLISION_PROFILING
-
-//! Gets the average time in miliseconds of tree collisions
-float btGImpactCollisionAlgorithm::getAverageTreeCollisionTime()
-{
-	return btGImpactBoxSet::getAverageTreeCollisionTime();
-
-}
-
-//! Gets the average time in miliseconds of triangle collisions
-float btGImpactCollisionAlgorithm::getAverageTriangleCollisionTime()
-{
-	if(g_count_triangle_collision == 0) return 0;
-
-	float avgtime = g_accum_triangle_collision_time;
-	avgtime /= (float)g_count_triangle_collision;
-
-	g_accum_triangle_collision_time = 0;
-	g_count_triangle_collision = 0;
-
-	return avgtime;
-}
-
-#endif //TRI_COLLISION_PROFILING
-
-
-
-btGImpactCollisionAlgorithm::btGImpactCollisionAlgorithm( const btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
-: btActivatingCollisionAlgorithm(ci,body0,body1)
-{
-	m_manifoldPtr = NULL;
-	m_convex_algorithm = NULL;
-}
-
-btGImpactCollisionAlgorithm::~btGImpactCollisionAlgorithm()
-{
-	clearCache();
-}
-
-
-
-
-
-void btGImpactCollisionAlgorithm::addContactPoint(btCollisionObject * body0,
-				btCollisionObject * body1,
-				const btVector3 & point,
-				const btVector3 & normal,
-				btScalar distance)
-{
-	m_resultOut->setShapeIdentifiersA(m_part0,m_triface0);
-	m_resultOut->setShapeIdentifiersB(m_part1,m_triface1);
-	checkManifold(body0,body1);
-	m_resultOut->addContactPoint(normal,point,distance);
-}
-
-
-void btGImpactCollisionAlgorithm::shape_vs_shape_collision(
-					  btCollisionObject * body0,
-					  btCollisionObject * body1,
-					  btCollisionShape * shape0,
-					  btCollisionShape * shape1)
-{
-
-	btCollisionShape* tmpShape0 = body0->getCollisionShape();
-	btCollisionShape* tmpShape1 = body1->getCollisionShape();
-	
-	body0->internalSetTemporaryCollisionShape(shape0);
-	body1->internalSetTemporaryCollisionShape(shape1);
-
-	{
-		btCollisionAlgorithm* algor = newAlgorithm(body0,body1);
-		// post :	checkManifold is called
-
-		m_resultOut->setShapeIdentifiersA(m_part0,m_triface0);
-		m_resultOut->setShapeIdentifiersB(m_part1,m_triface1);
-
-		algor->processCollision(body0,body1,*m_dispatchInfo,m_resultOut);
-
-		algor->~btCollisionAlgorithm();
-		m_dispatcher->freeCollisionAlgorithm(algor);
-	}
-
-	body0->internalSetTemporaryCollisionShape(tmpShape0);
-	body1->internalSetTemporaryCollisionShape(tmpShape1);
-}
-
-void btGImpactCollisionAlgorithm::convex_vs_convex_collision(
-					  btCollisionObject * body0,
-					  btCollisionObject * body1,
-					  btCollisionShape * shape0,
-					  btCollisionShape * shape1)
-{
-
-	btCollisionShape* tmpShape0 = body0->getCollisionShape();
-	btCollisionShape* tmpShape1 = body1->getCollisionShape();
-	
-	body0->internalSetTemporaryCollisionShape(shape0);
-	body1->internalSetTemporaryCollisionShape(shape1);
-
-
-	m_resultOut->setShapeIdentifiersA(m_part0,m_triface0);
-	m_resultOut->setShapeIdentifiersB(m_part1,m_triface1);
-
-	checkConvexAlgorithm(body0,body1);
-	m_convex_algorithm->processCollision(body0,body1,*m_dispatchInfo,m_resultOut);
-
-	body0->internalSetTemporaryCollisionShape(tmpShape0);
-	body1->internalSetTemporaryCollisionShape(tmpShape1);
-
-}
-
-
-
-
-void btGImpactCollisionAlgorithm::gimpact_vs_gimpact_find_pairs(
-					  const btTransform & trans0,
-					  const btTransform & trans1,
-					  btGImpactShapeInterface * shape0,
-					  btGImpactShapeInterface * shape1,btPairSet & pairset)
-{
-	if(shape0->hasBoxSet() && shape1->hasBoxSet())
-	{
-		btGImpactBoxSet::find_collision(shape0->getBoxSet(),trans0,shape1->getBoxSet(),trans1,pairset);
-	}
-	else
-	{
-		btAABB boxshape0;
-		btAABB boxshape1;
-		int i = shape0->getNumChildShapes();
-
-		while(i--)
-		{
-			shape0->getChildAabb(i,trans0,boxshape0.m_min,boxshape0.m_max);
-
-			int j = shape1->getNumChildShapes();
-			while(j--)
-			{
-				shape1->getChildAabb(i,trans1,boxshape1.m_min,boxshape1.m_max);
-
-				if(boxshape1.has_collision(boxshape0))
-				{
-					pairset.push_pair(i,j);
-				}
-			}
-		}
-	}
-
-
-}
-
-
-void btGImpactCollisionAlgorithm::gimpact_vs_shape_find_pairs(
-					  const btTransform & trans0,
-					  const btTransform & trans1,
-					  btGImpactShapeInterface * shape0,
-					  btCollisionShape * shape1,
-					  btAlignedObjectArray<int> & collided_primitives)
-{
-
-	btAABB boxshape;
-
-
-	if(shape0->hasBoxSet())
-	{
-		btTransform trans1to0 = trans0.inverse();
-		trans1to0 *= trans1;
-
-		shape1->getAabb(trans1to0,boxshape.m_min,boxshape.m_max);
-
-		shape0->getBoxSet()->boxQuery(boxshape, collided_primitives);
-	}
-	else
-	{
-		shape1->getAabb(trans1,boxshape.m_min,boxshape.m_max);
-
-		btAABB boxshape0;
-		int i = shape0->getNumChildShapes();
-
-		while(i--)
-		{
-			shape0->getChildAabb(i,trans0,boxshape0.m_min,boxshape0.m_max);
-
-			if(boxshape.has_collision(boxshape0))
-			{
-				collided_primitives.push_back(i);
-			}
-		}
-
-	}
-
-}
-
-
-void btGImpactCollisionAlgorithm::collide_gjk_triangles(btCollisionObject * body0,
-				  btCollisionObject * body1,
-				  btGImpactMeshShapePart * shape0,
-				  btGImpactMeshShapePart * shape1,
-				  const int * pairs, int pair_count)
-{
-	btTriangleShapeEx tri0;
-	btTriangleShapeEx tri1;
-
-	shape0->lockChildShapes();
-	shape1->lockChildShapes();
-
-	const int * pair_pointer = pairs;
-
-	while(pair_count--)
-	{
-
-		m_triface0 = *(pair_pointer);
-		m_triface1 = *(pair_pointer+1);
-		pair_pointer+=2;
-
-
-
-		shape0->getBulletTriangle(m_triface0,tri0);
-		shape1->getBulletTriangle(m_triface1,tri1);
-
-
-		//collide two convex shapes
-		if(tri0.overlap_test_conservative(tri1))
-		{
-			convex_vs_convex_collision(body0,body1,&tri0,&tri1);
-		}
-
-	}
-
-	shape0->unlockChildShapes();
-	shape1->unlockChildShapes();
-}
-
-void btGImpactCollisionAlgorithm::collide_sat_triangles(btCollisionObject * body0,
-					  btCollisionObject * body1,
-					  btGImpactMeshShapePart * shape0,
-					  btGImpactMeshShapePart * shape1,
-					  const int * pairs, int pair_count)
-{
-	btTransform orgtrans0 = body0->getWorldTransform();
-	btTransform orgtrans1 = body1->getWorldTransform();
-
-	btPrimitiveTriangle ptri0;
-	btPrimitiveTriangle ptri1;
-	GIM_TRIANGLE_CONTACT contact_data;
-
-	shape0->lockChildShapes();
-	shape1->lockChildShapes();
-
-	const int * pair_pointer = pairs;
-
-	while(pair_count--)
-	{
-
-		m_triface0 = *(pair_pointer);
-		m_triface1 = *(pair_pointer+1);
-		pair_pointer+=2;
-
-
-		shape0->getPrimitiveTriangle(m_triface0,ptri0);
-		shape1->getPrimitiveTriangle(m_triface1,ptri1);
-
-		#ifdef TRI_COLLISION_PROFILING
-		bt_begin_gim02_tri_time();
-		#endif
-
-		ptri0.applyTransform(orgtrans0);
-		ptri1.applyTransform(orgtrans1);
-
-
-		//build planes
-		ptri0.buildTriPlane();
-		ptri1.buildTriPlane();
-		// test conservative
-
-
-
-		if(ptri0.overlap_test_conservative(ptri1))
-		{
-			if(ptri0.find_triangle_collision_clip_method(ptri1,contact_data))
-			{
-
-				int j = contact_data.m_point_count;
-				while(j--)
-				{
-
-					addContactPoint(body0, body1,
-								contact_data.m_points[j],
-								contact_data.m_separating_normal,
-								-contact_data.m_penetration_depth);
-				}
-			}
-		}
-
-		#ifdef TRI_COLLISION_PROFILING
-		bt_end_gim02_tri_time();
-		#endif
-
-	}
-
-	shape0->unlockChildShapes();
-	shape1->unlockChildShapes();
-
-}
-
-
-void btGImpactCollisionAlgorithm::gimpact_vs_gimpact(
-						btCollisionObject * body0,
-					   	btCollisionObject * body1,
-					  	btGImpactShapeInterface * shape0,
-					  	btGImpactShapeInterface * shape1)
-{
-
-	if(shape0->getGImpactShapeType()==CONST_GIMPACT_TRIMESH_SHAPE)
-	{
-		btGImpactMeshShape * meshshape0 = static_cast<btGImpactMeshShape *>(shape0);
-		m_part0 = meshshape0->getMeshPartCount();
-
-		while(m_part0--)
-		{
-			gimpact_vs_gimpact(body0,body1,meshshape0->getMeshPart(m_part0),shape1);
-		}
-
-		return;
-	}
-
-	if(shape1->getGImpactShapeType()==CONST_GIMPACT_TRIMESH_SHAPE)
-	{
-		btGImpactMeshShape * meshshape1 = static_cast<btGImpactMeshShape *>(shape1);
-		m_part1 = meshshape1->getMeshPartCount();
-
-		while(m_part1--)
-		{
-
-			gimpact_vs_gimpact(body0,body1,shape0,meshshape1->getMeshPart(m_part1));
-
-		}
-
-		return;
-	}
-
-
-	btTransform orgtrans0 = body0->getWorldTransform();
-	btTransform orgtrans1 = body1->getWorldTransform();
-
-	btPairSet pairset;
-
-	gimpact_vs_gimpact_find_pairs(orgtrans0,orgtrans1,shape0,shape1,pairset);
-
-	if(pairset.size()== 0) return;
-
-	if(shape0->getGImpactShapeType() == CONST_GIMPACT_TRIMESH_SHAPE_PART &&
-		shape1->getGImpactShapeType() == CONST_GIMPACT_TRIMESH_SHAPE_PART)
-	{
-		btGImpactMeshShapePart * shapepart0 = static_cast<btGImpactMeshShapePart * >(shape0);
-		btGImpactMeshShapePart * shapepart1 = static_cast<btGImpactMeshShapePart * >(shape1);
-		//specialized function
-		#ifdef BULLET_TRIANGLE_COLLISION
-		collide_gjk_triangles(body0,body1,shapepart0,shapepart1,&pairset[0].m_index1,pairset.size());
-		#else
-		collide_sat_triangles(body0,body1,shapepart0,shapepart1,&pairset[0].m_index1,pairset.size());
-		#endif
-
-		return;
-	}
-
-	//general function
-
-	shape0->lockChildShapes();
-	shape1->lockChildShapes();
-
-	GIM_ShapeRetriever retriever0(shape0);
-	GIM_ShapeRetriever retriever1(shape1);
-
-	bool child_has_transform0 = shape0->childrenHasTransform();
-	bool child_has_transform1 = shape1->childrenHasTransform();
-
-	int i = pairset.size();
-	while(i--)
-	{
-		GIM_PAIR * pair = &pairset[i];
-		m_triface0 = pair->m_index1;
-		m_triface1 = pair->m_index2;
-		btCollisionShape * colshape0 = retriever0.getChildShape(m_triface0);
-		btCollisionShape * colshape1 = retriever1.getChildShape(m_triface1);
-
-		if(child_has_transform0)
-		{
-			body0->setWorldTransform(orgtrans0*shape0->getChildTransform(m_triface0));
-		}
-
-		if(child_has_transform1)
-		{
-			body1->setWorldTransform(orgtrans1*shape1->getChildTransform(m_triface1));
-		}
-
-		//collide two convex shapes
-		convex_vs_convex_collision(body0,body1,colshape0,colshape1);
-
-
-		if(child_has_transform0)
-		{
-			body0->setWorldTransform(orgtrans0);
-		}
-
-		if(child_has_transform1)
-		{
-			body1->setWorldTransform(orgtrans1);
-		}
-
-	}
-
-	shape0->unlockChildShapes();
-	shape1->unlockChildShapes();
-}
-
-void btGImpactCollisionAlgorithm::gimpact_vs_shape(btCollisionObject * body0,
-				  btCollisionObject * body1,
-				  btGImpactShapeInterface * shape0,
-				  btCollisionShape * shape1,bool swapped)
-{
-	if(shape0->getGImpactShapeType()==CONST_GIMPACT_TRIMESH_SHAPE)
-	{
-		btGImpactMeshShape * meshshape0 = static_cast<btGImpactMeshShape *>(shape0);
-		int& part = swapped ? m_part1 : m_part0;
-		part = meshshape0->getMeshPartCount();
-
-		while(part--)
-		{
-
-			gimpact_vs_shape(body0,
-				  body1,
-				  meshshape0->getMeshPart(part),
-				  shape1,swapped);
-
-		}
-
-		return;
-	}
-
-	#ifdef GIMPACT_VS_PLANE_COLLISION
-	if(shape0->getGImpactShapeType() == CONST_GIMPACT_TRIMESH_SHAPE_PART &&
-		shape1->getShapeType() == STATIC_PLANE_PROXYTYPE)
-	{
-		btGImpactMeshShapePart * shapepart = static_cast<btGImpactMeshShapePart *>(shape0);
-		btStaticPlaneShape * planeshape = static_cast<btStaticPlaneShape * >(shape1);
-		gimpacttrimeshpart_vs_plane_collision(body0,body1,shapepart,planeshape,swapped);
-		return;
-	}
-
-	#endif
-
-
-
-	if(shape1->isCompound())
-	{
-		btCompoundShape * compoundshape = static_cast<btCompoundShape *>(shape1);
-		gimpact_vs_compoundshape(body0,body1,shape0,compoundshape,swapped);
-		return;
-	}
-	else if(shape1->isConcave())
-	{
-		btConcaveShape * concaveshape = static_cast<btConcaveShape *>(shape1);
-		gimpact_vs_concave(body0,body1,shape0,concaveshape,swapped);
-		return;
-	}
-
-
-	btTransform orgtrans0 = body0->getWorldTransform();
-
-	btTransform orgtrans1 = body1->getWorldTransform();
-
-	btAlignedObjectArray<int> collided_results;
-
-	gimpact_vs_shape_find_pairs(orgtrans0,orgtrans1,shape0,shape1,collided_results);
-
-	if(collided_results.size() == 0) return;
-
-
-	shape0->lockChildShapes();
-
-	GIM_ShapeRetriever retriever0(shape0);
-
-
-	bool child_has_transform0 = shape0->childrenHasTransform();
-
-
-	int i = collided_results.size();
-
-	while(i--)
-	{
-		int child_index = collided_results[i];
-        if(swapped)
-    		m_triface1 = child_index;
-        else
-            m_triface0 = child_index;
-
-		btCollisionShape * colshape0 = retriever0.getChildShape(child_index);
-
-		if(child_has_transform0)
-		{
-			body0->setWorldTransform(orgtrans0*shape0->getChildTransform(child_index));
-		}
-
-		//collide two shapes
-		if(swapped)
-		{
-			shape_vs_shape_collision(body1,body0,shape1,colshape0);
-		}
-		else
-		{
-			shape_vs_shape_collision(body0,body1,colshape0,shape1);
-		}
-
-		//restore transforms
-		if(child_has_transform0)
-		{
-			body0->setWorldTransform(orgtrans0);
-		}
-
-	}
-
-	shape0->unlockChildShapes();
-
-}
-
-void btGImpactCollisionAlgorithm::gimpact_vs_compoundshape(btCollisionObject * body0,
-				  btCollisionObject * body1,
-				  btGImpactShapeInterface * shape0,
-				  btCompoundShape * shape1,bool swapped)
-{
-	btTransform orgtrans1 = body1->getWorldTransform();
-
-	int i = shape1->getNumChildShapes();
-	while(i--)
-	{
-
-		btCollisionShape * colshape1 = shape1->getChildShape(i);
-		btTransform childtrans1 = orgtrans1*shape1->getChildTransform(i);
-
-		body1->setWorldTransform(childtrans1);
-
-		//collide child shape
-		gimpact_vs_shape(body0, body1,
-					  shape0,colshape1,swapped);
-
-
-		//restore transforms
-		body1->setWorldTransform(orgtrans1);
-	}
-}
-
-void btGImpactCollisionAlgorithm::gimpacttrimeshpart_vs_plane_collision(
-					  btCollisionObject * body0,
-					  btCollisionObject * body1,
-					  btGImpactMeshShapePart * shape0,
-					  btStaticPlaneShape * shape1,bool swapped)
-{
-
-
-	btTransform orgtrans0 = body0->getWorldTransform();
-	btTransform orgtrans1 = body1->getWorldTransform();
-
-	btPlaneShape * planeshape = static_cast<btPlaneShape *>(shape1);
-	btVector4 plane;
-	planeshape->get_plane_equation_transformed(orgtrans1,plane);
-
-	//test box against plane
-
-	btAABB tribox;
-	shape0->getAabb(orgtrans0,tribox.m_min,tribox.m_max);
-	tribox.increment_margin(planeshape->getMargin());
-
-	if( tribox.plane_classify(plane)!= BT_CONST_COLLIDE_PLANE) return;
-
-	shape0->lockChildShapes();
-
-	btScalar margin = shape0->getMargin() + planeshape->getMargin();
-
-	btVector3 vertex;
-	int vi = shape0->getVertexCount();
-	while(vi--)
-	{
-		shape0->getVertex(vi,vertex);
-		vertex = orgtrans0(vertex);
-
-		btScalar distance = vertex.dot(plane) - plane[3] - margin;
-
-		if(distance<0.0)//add contact
-		{
-			if(swapped)
-			{
-				addContactPoint(body1, body0,
-					vertex,
-					-plane,
-					distance);
-			}
-			else
-			{
-				addContactPoint(body0, body1,
-					vertex,
-					plane,
-					distance);
-			}
-		}
-	}
-
-	shape0->unlockChildShapes();
-}
-
-
-
-
-class btGImpactTriangleCallback: public btTriangleCallback
-{
-public:
-	btGImpactCollisionAlgorithm * algorithm;
-	btCollisionObject * body0;
-	btCollisionObject * body1;
-	btGImpactShapeInterface * gimpactshape0;
-	bool swapped;
-	btScalar margin;
-
-	virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex)
-	{
-		btTriangleShapeEx tri1(triangle[0],triangle[1],triangle[2]);
-		tri1.setMargin(margin);
-        if(swapped)
-        {
-            algorithm->setPart0(partId);
-            algorithm->setFace0(triangleIndex);
-        }
-        else
-        {
-            algorithm->setPart1(partId);
-            algorithm->setFace1(triangleIndex);
-        }
-		algorithm->gimpact_vs_shape(
-							body0,body1,gimpactshape0,&tri1,swapped);
-	}
-};
-
-
-
-
-void btGImpactCollisionAlgorithm::gimpact_vs_concave(
-				  btCollisionObject * body0,
-				  btCollisionObject * body1,
-				  btGImpactShapeInterface * shape0,
-				  btConcaveShape * shape1,bool swapped)
-{
-	//create the callback
-	btGImpactTriangleCallback tricallback;
-	tricallback.algorithm = this;
-	tricallback.body0 = body0;
-	tricallback.body1 = body1;
-	tricallback.gimpactshape0 = shape0;
-	tricallback.swapped = swapped;
-	tricallback.margin = shape1->getMargin();
-
-	//getting the trimesh AABB
-	btTransform gimpactInConcaveSpace;
-
-	gimpactInConcaveSpace = body1->getWorldTransform().inverse() * body0->getWorldTransform();
-
-	btVector3 minAABB,maxAABB;
-	shape0->getAabb(gimpactInConcaveSpace,minAABB,maxAABB);
-
-	shape1->processAllTriangles(&tricallback,minAABB,maxAABB);
-
-}
-
-
-
-void btGImpactCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-    clearCache();
-
-    m_resultOut = resultOut;
-	m_dispatchInfo = &dispatchInfo;
-    btGImpactShapeInterface * gimpactshape0;
-    btGImpactShapeInterface * gimpactshape1;
-
-	if (body0->getCollisionShape()->getShapeType()==GIMPACT_SHAPE_PROXYTYPE)
-	{
-		gimpactshape0 = static_cast<btGImpactShapeInterface *>(body0->getCollisionShape());
-
-		if( body1->getCollisionShape()->getShapeType()==GIMPACT_SHAPE_PROXYTYPE )
-		{
-			gimpactshape1 = static_cast<btGImpactShapeInterface *>(body1->getCollisionShape());
-
-			gimpact_vs_gimpact(body0,body1,gimpactshape0,gimpactshape1);
-		}
-		else
-		{
-			gimpact_vs_shape(body0,body1,gimpactshape0,body1->getCollisionShape(),false);
-		}
-
-	}
-	else if (body1->getCollisionShape()->getShapeType()==GIMPACT_SHAPE_PROXYTYPE )
-	{
-		gimpactshape1 = static_cast<btGImpactShapeInterface *>(body1->getCollisionShape());
-
-		gimpact_vs_shape(body1,body0,gimpactshape1,body0->getCollisionShape(),true);
-	}
-}
-
-
-btScalar btGImpactCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-	return 1.f;
-
-}
-
-///////////////////////////////////// REGISTERING ALGORITHM //////////////////////////////////////////////
-
-
-
-//! Use this function for register the algorithm externally
-void btGImpactCollisionAlgorithm::registerAlgorithm(btCollisionDispatcher * dispatcher)
-{
-
-	static btGImpactCollisionAlgorithm::CreateFunc s_gimpact_cf;
-
-	int i;
-
-	for ( i = 0;i < MAX_BROADPHASE_COLLISION_TYPES ;i++ )
-	{
-		dispatcher->registerCollisionCreateFunc(GIMPACT_SHAPE_PROXYTYPE,i ,&s_gimpact_cf);
-	}
-
-	for ( i = 0;i < MAX_BROADPHASE_COLLISION_TYPES ;i++ )
-	{
-		dispatcher->registerCollisionCreateFunc(i,GIMPACT_SHAPE_PROXYTYPE ,&s_gimpact_cf);
-	}
-
-}
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.h
deleted file mode 100644
index 6b6e07c..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.h
+++ /dev/null
@@ -1,306 +0,0 @@
-/*! \file btGImpactShape.h
-\author Francisco Leon Najera
-*/
-/*
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_GIMPACT_BVH_CONCAVE_COLLISION_ALGORITHM_H
-#define BT_GIMPACT_BVH_CONCAVE_COLLISION_ALGORITHM_H
-
-#include "BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h"
-#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
-#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
-class btDispatcher;
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"
-#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
-
-#include "LinearMath/btAlignedObjectArray.h"
-
-#include "btGImpactShape.h"
-#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"
-#include "BulletCollision/CollisionShapes/btCompoundShape.h"
-#include "BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h"
-#include "LinearMath/btIDebugDraw.h"
-
-
-
-//! Collision Algorithm for GImpact Shapes
-/*!
-For register this algorithm in Bullet, proceed as following:
- \code
-btCollisionDispatcher * dispatcher = static_cast<btCollisionDispatcher *>(m_dynamicsWorld ->getDispatcher());
-btGImpactCollisionAlgorithm::registerAlgorithm(dispatcher);
- \endcode
-*/
-class btGImpactCollisionAlgorithm : public btActivatingCollisionAlgorithm
-{
-protected:
-	btCollisionAlgorithm * m_convex_algorithm;
-    btPersistentManifold * m_manifoldPtr;
-	btManifoldResult* m_resultOut;
-	const btDispatcherInfo * m_dispatchInfo;
-	int m_triface0;
-	int m_part0;
-	int m_triface1;
-	int m_part1;
-
-
-	//! Creates a new contact point
-	SIMD_FORCE_INLINE btPersistentManifold* newContactManifold(btCollisionObject* body0,btCollisionObject* body1)
-	{
-		m_manifoldPtr = m_dispatcher->getNewManifold(body0,body1);
-		return m_manifoldPtr;
-	}
-
-	SIMD_FORCE_INLINE void destroyConvexAlgorithm()
-	{
-		if(m_convex_algorithm)
-		{
-			m_convex_algorithm->~btCollisionAlgorithm();
-			m_dispatcher->freeCollisionAlgorithm( m_convex_algorithm);
-			m_convex_algorithm = NULL;
-		}
-	}
-
-	SIMD_FORCE_INLINE void destroyContactManifolds()
-	{
-		if(m_manifoldPtr == NULL) return;
-		m_dispatcher->releaseManifold(m_manifoldPtr);
-		m_manifoldPtr = NULL;
-	}
-
-	SIMD_FORCE_INLINE void clearCache()
-	{
-		destroyContactManifolds();
-		destroyConvexAlgorithm();
-
-		m_triface0 = -1;
-		m_part0 = -1;
-		m_triface1 = -1;
-		m_part1 = -1;
-	}
-
-	SIMD_FORCE_INLINE btPersistentManifold* getLastManifold()
-	{
-		return m_manifoldPtr;
-	}
-
-
-	// Call before process collision
-	SIMD_FORCE_INLINE void checkManifold(btCollisionObject* body0,btCollisionObject* body1)
-	{
-		if(getLastManifold() == 0)
-		{
-			newContactManifold(body0,body1);
-		}
-
-		m_resultOut->setPersistentManifold(getLastManifold());
-	}
-
-	// Call before process collision
-	SIMD_FORCE_INLINE btCollisionAlgorithm * newAlgorithm(btCollisionObject* body0,btCollisionObject* body1)
-	{
-		checkManifold(body0,body1);
-
-		btCollisionAlgorithm * convex_algorithm = m_dispatcher->findAlgorithm(
-				body0,body1,getLastManifold());
-		return convex_algorithm ;
-	}
-
-	// Call before process collision
-	SIMD_FORCE_INLINE void checkConvexAlgorithm(btCollisionObject* body0,btCollisionObject* body1)
-	{
-		if(m_convex_algorithm) return;
-		m_convex_algorithm = newAlgorithm(body0,body1);
-	}
-
-
-
-
-	void addContactPoint(btCollisionObject * body0,
-					btCollisionObject * body1,
-					const btVector3 & point,
-					const btVector3 & normal,
-					btScalar distance);
-
-//! Collision routines
-//!@{
-
-	void collide_gjk_triangles(btCollisionObject * body0,
-				  btCollisionObject * body1,
-				  btGImpactMeshShapePart * shape0,
-				  btGImpactMeshShapePart * shape1,
-				  const int * pairs, int pair_count);
-
-	void collide_sat_triangles(btCollisionObject * body0,
-					  btCollisionObject * body1,
-					  btGImpactMeshShapePart * shape0,
-					  btGImpactMeshShapePart * shape1,
-					  const int * pairs, int pair_count);
-
-
-
-
-	void shape_vs_shape_collision(
-					  btCollisionObject * body0,
-					  btCollisionObject * body1,
-					  btCollisionShape * shape0,
-					  btCollisionShape * shape1);
-
-	void convex_vs_convex_collision(btCollisionObject * body0,
-					  btCollisionObject * body1,
-					  btCollisionShape * shape0,
-					  btCollisionShape * shape1);
-
-
-
-	void gimpact_vs_gimpact_find_pairs(
-					  const btTransform & trans0,
-					  const btTransform & trans1,
-					  btGImpactShapeInterface * shape0,
-					  btGImpactShapeInterface * shape1,btPairSet & pairset);
-
-	void gimpact_vs_shape_find_pairs(
-					  const btTransform & trans0,
-					  const btTransform & trans1,
-					  btGImpactShapeInterface * shape0,
-					  btCollisionShape * shape1,
-					  btAlignedObjectArray<int> & collided_primitives);
-
-
-	void gimpacttrimeshpart_vs_plane_collision(
-					  btCollisionObject * body0,
-					  btCollisionObject * body1,
-					  btGImpactMeshShapePart * shape0,
-					  btStaticPlaneShape * shape1,bool swapped);
-
-
-public:
-
-	btGImpactCollisionAlgorithm( const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1);
-
-	virtual ~btGImpactCollisionAlgorithm();
-
-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	btScalar	calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
-	{
-		if (m_manifoldPtr)
-			manifoldArray.push_back(m_manifoldPtr);
-	}
-
-
-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
-	{
-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
-		{
-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btGImpactCollisionAlgorithm));
-			return new(mem) btGImpactCollisionAlgorithm(ci,body0,body1);
-		}
-	};
-
-	//! Use this function for register the algorithm externally
-	static void registerAlgorithm(btCollisionDispatcher * dispatcher);
-#ifdef TRI_COLLISION_PROFILING
-	//! Gets the average time in miliseconds of tree collisions
-	static float getAverageTreeCollisionTime();
-
-	//! Gets the average time in miliseconds of triangle collisions
-	static float getAverageTriangleCollisionTime();
-#endif //TRI_COLLISION_PROFILING
-
-	//! Collides two gimpact shapes
-	/*!
-	\pre shape0 and shape1 couldn't be btGImpactMeshShape objects
-	*/
-
-
-	void gimpact_vs_gimpact(btCollisionObject * body0,
-					  btCollisionObject * body1,
-					  btGImpactShapeInterface * shape0,
-					  btGImpactShapeInterface * shape1);
-
-	void gimpact_vs_shape(btCollisionObject * body0,
-					  btCollisionObject * body1,
-					  btGImpactShapeInterface * shape0,
-					  btCollisionShape * shape1,bool swapped);
-
-	void gimpact_vs_compoundshape(btCollisionObject * body0,
-					  btCollisionObject * body1,
-					  btGImpactShapeInterface * shape0,
-					  btCompoundShape * shape1,bool swapped);
-
-	void gimpact_vs_concave(
-					  btCollisionObject * body0,
-					  btCollisionObject * body1,
-					  btGImpactShapeInterface * shape0,
-					  btConcaveShape * shape1,bool swapped);
-
-
-
-
-		/// Accessor/Mutator pairs for Part and triangleID
-    void 	setFace0(int value) 
-    { 
-    	m_triface0 = value; 
-    }
-    int getFace0() 
-    { 
-    	return m_triface0; 
-    }
-    void setFace1(int value) 
-    { 
-    	m_triface1 = value; 
-    }
-    int getFace1() 
-    { 
-    	return m_triface1; 
-    }
-    void setPart0(int value) 
-    { 
-    	m_part0 = value; 
-    }
-    int getPart0() 
-    { 
-    	return m_part0; 
-    }
-    void setPart1(int value) 
-    { 
-    	m_part1 = value; 
-		}
-    int getPart1() 
-    { 
-    	return m_part1; 
-    }
-
-};
-
-
-//algorithm details
-//#define BULLET_TRIANGLE_COLLISION 1
-#define GIMPACT_VS_PLANE_COLLISION 1
-
-
-
-#endif //BT_GIMPACT_BVH_CONCAVE_COLLISION_ALGORITHM_H
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactMassUtil.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactMassUtil.h
deleted file mode 100644
index 2543aef..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactMassUtil.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*! \file btGImpactMassUtil.h
-\author Francisco Leon Najera
-*/
-/*
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef GIMPACT_MASS_UTIL_H
-#define GIMPACT_MASS_UTIL_H
-
-#include "LinearMath/btTransform.h"
-
-
-
-SIMD_FORCE_INLINE btVector3 gim_inertia_add_transformed(
-	const btVector3 & source_inertia, const btVector3 & added_inertia, const btTransform & transform)
-{
-	btMatrix3x3  rotatedTensor = transform.getBasis().scaled(added_inertia) * transform.getBasis().transpose();
-
-	btScalar x2 = transform.getOrigin()[0];
-	x2*= x2;
-	btScalar y2 = transform.getOrigin()[1];
-	y2*= y2;
-	btScalar z2 = transform.getOrigin()[2];
-	z2*= z2;
-
-	btScalar ix = rotatedTensor[0][0]*(y2+z2);
-	btScalar iy = rotatedTensor[1][1]*(x2+z2);
-	btScalar iz = rotatedTensor[2][2]*(x2+y2);
-
-	return btVector3(source_inertia[0]+ix,source_inertia[1]+iy,source_inertia[2] + iz);
-}
-
-SIMD_FORCE_INLINE btVector3 gim_get_point_inertia(const btVector3 & point, btScalar mass)
-{
-	btScalar x2 = point[0]*point[0];
-	btScalar y2 = point[1]*point[1];
-	btScalar z2 = point[2]*point[2];
-	return btVector3(mass*(y2+z2),mass*(x2+z2),mass*(x2+y2));
-}
-
-
-#endif //GIMPACT_MESH_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp
deleted file mode 100644
index cd4dfdb..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp
+++ /dev/null
@@ -1,528 +0,0 @@
-/*! \file gim_box_set.h
-\author Francisco Leon Najera
-*/
-/*
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btGImpactQuantizedBvh.h"
-#include "LinearMath/btQuickprof.h"
-
-#ifdef TRI_COLLISION_PROFILING
-btClock g_q_tree_clock;
-
-
-float g_q_accum_tree_collision_time = 0;
-int g_q_count_traversing = 0;
-
-
-void bt_begin_gim02_q_tree_time()
-{
-	g_q_tree_clock.reset();
-}
-
-void bt_end_gim02_q_tree_time()
-{
-	g_q_accum_tree_collision_time += g_q_tree_clock.getTimeMicroseconds();
-	g_q_count_traversing++;
-}
-
-
-//! Gets the average time in miliseconds of tree collisions
-float btGImpactQuantizedBvh::getAverageTreeCollisionTime()
-{
-	if(g_q_count_traversing == 0) return 0;
-
-	float avgtime = g_q_accum_tree_collision_time;
-	avgtime /= (float)g_q_count_traversing;
-
-	g_q_accum_tree_collision_time = 0;
-	g_q_count_traversing = 0;
-	return avgtime;
-
-//	float avgtime = g_q_count_traversing;
-//	g_q_count_traversing = 0;
-//	return avgtime;
-
-}
-
-#endif //TRI_COLLISION_PROFILING
-
-/////////////////////// btQuantizedBvhTree /////////////////////////////////
-
-void btQuantizedBvhTree::calc_quantization(
-	GIM_BVH_DATA_ARRAY & primitive_boxes, btScalar boundMargin)
-{
-	//calc globa box
-	btAABB global_bound;
-	global_bound.invalidate();
-
-	for (int i=0;i<primitive_boxes.size() ;i++ )
-	{
-		global_bound.merge(primitive_boxes[i].m_bound);
-	}
-
-	bt_calc_quantization_parameters(
-		m_global_bound.m_min,m_global_bound.m_max,m_bvhQuantization,global_bound.m_min,global_bound.m_max,boundMargin);
-
-}
-
-
-
-int btQuantizedBvhTree::_calc_splitting_axis(
-	GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,  int endIndex)
-{
-
-	int i;
-
-	btVector3 means(btScalar(0.),btScalar(0.),btScalar(0.));
-	btVector3 variance(btScalar(0.),btScalar(0.),btScalar(0.));
-	int numIndices = endIndex-startIndex;
-
-	for (i=startIndex;i<endIndex;i++)
-	{
-		btVector3 center = btScalar(0.5)*(primitive_boxes[i].m_bound.m_max +
-					 primitive_boxes[i].m_bound.m_min);
-		means+=center;
-	}
-	means *= (btScalar(1.)/(btScalar)numIndices);
-
-	for (i=startIndex;i<endIndex;i++)
-	{
-		btVector3 center = btScalar(0.5)*(primitive_boxes[i].m_bound.m_max +
-					 primitive_boxes[i].m_bound.m_min);
-		btVector3 diff2 = center-means;
-		diff2 = diff2 * diff2;
-		variance += diff2;
-	}
-	variance *= (btScalar(1.)/	((btScalar)numIndices-1)	);
-
-	return variance.maxAxis();
-}
-
-
-int btQuantizedBvhTree::_sort_and_calc_splitting_index(
-	GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,
-	int endIndex, int splitAxis)
-{
-	int i;
-	int splitIndex =startIndex;
-	int numIndices = endIndex - startIndex;
-
-	// average of centers
-	btScalar splitValue = 0.0f;
-
-	btVector3 means(btScalar(0.),btScalar(0.),btScalar(0.));
-	for (i=startIndex;i<endIndex;i++)
-	{
-		btVector3 center = btScalar(0.5)*(primitive_boxes[i].m_bound.m_max +
-					 primitive_boxes[i].m_bound.m_min);
-		means+=center;
-	}
-	means *= (btScalar(1.)/(btScalar)numIndices);
-
-	splitValue = means[splitAxis];
-
-
-	//sort leafNodes so all values larger then splitValue comes first, and smaller values start from 'splitIndex'.
-	for (i=startIndex;i<endIndex;i++)
-	{
-		btVector3 center = btScalar(0.5)*(primitive_boxes[i].m_bound.m_max +
-					 primitive_boxes[i].m_bound.m_min);
-		if (center[splitAxis] > splitValue)
-		{
-			//swap
-			primitive_boxes.swap(i,splitIndex);
-			//swapLeafNodes(i,splitIndex);
-			splitIndex++;
-		}
-	}
-
-	//if the splitIndex causes unbalanced trees, fix this by using the center in between startIndex and endIndex
-	//otherwise the tree-building might fail due to stack-overflows in certain cases.
-	//unbalanced1 is unsafe: it can cause stack overflows
-	//bool unbalanced1 = ((splitIndex==startIndex) || (splitIndex == (endIndex-1)));
-
-	//unbalanced2 should work too: always use center (perfect balanced trees)
-	//bool unbalanced2 = true;
-
-	//this should be safe too:
-	int rangeBalancedIndices = numIndices/3;
-	bool unbalanced = ((splitIndex<=(startIndex+rangeBalancedIndices)) || (splitIndex >=(endIndex-1-rangeBalancedIndices)));
-
-	if (unbalanced)
-	{
-		splitIndex = startIndex+ (numIndices>>1);
-	}
-
-	btAssert(!((splitIndex==startIndex) || (splitIndex == (endIndex))));
-
-	return splitIndex;
-
-}
-
-
-void btQuantizedBvhTree::_build_sub_tree(GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,  int endIndex)
-{
-	int curIndex = m_num_nodes;
-	m_num_nodes++;
-
-	btAssert((endIndex-startIndex)>0);
-
-	if ((endIndex-startIndex)==1)
-	{
-	    //We have a leaf node
-	    setNodeBound(curIndex,primitive_boxes[startIndex].m_bound);
-		m_node_array[curIndex].setDataIndex(primitive_boxes[startIndex].m_data);
-
-		return;
-	}
-	//calculate Best Splitting Axis and where to split it. Sort the incoming 'leafNodes' array within range 'startIndex/endIndex'.
-
-	//split axis
-	int splitIndex = _calc_splitting_axis(primitive_boxes,startIndex,endIndex);
-
-	splitIndex = _sort_and_calc_splitting_index(
-			primitive_boxes,startIndex,endIndex,
-			splitIndex//split axis
-			);
-
-
-	//calc this node bounding box
-
-	btAABB node_bound;
-	node_bound.invalidate();
-
-	for (int i=startIndex;i<endIndex;i++)
-	{
-		node_bound.merge(primitive_boxes[i].m_bound);
-	}
-
-	setNodeBound(curIndex,node_bound);
-
-
-	//build left branch
-	_build_sub_tree(primitive_boxes, startIndex, splitIndex );
-
-
-	//build right branch
-	 _build_sub_tree(primitive_boxes, splitIndex ,endIndex);
-
-	m_node_array[curIndex].setEscapeIndex(m_num_nodes - curIndex);
-
-
-}
-
-//! stackless build tree
-void btQuantizedBvhTree::build_tree(
-	GIM_BVH_DATA_ARRAY & primitive_boxes)
-{
-	calc_quantization(primitive_boxes);
-	// initialize node count to 0
-	m_num_nodes = 0;
-	// allocate nodes
-	m_node_array.resize(primitive_boxes.size()*2);
-
-	_build_sub_tree(primitive_boxes, 0, primitive_boxes.size());
-}
-
-////////////////////////////////////class btGImpactQuantizedBvh
-
-void btGImpactQuantizedBvh::refit()
-{
-	int nodecount = getNodeCount();
-	while(nodecount--)
-	{
-		if(isLeafNode(nodecount))
-		{
-			btAABB leafbox;
-			m_primitive_manager->get_primitive_box(getNodeData(nodecount),leafbox);
-			setNodeBound(nodecount,leafbox);
-		}
-		else
-		{
-			//const GIM_BVH_TREE_NODE * nodepointer = get_node_pointer(nodecount);
-			//get left bound
-			btAABB bound;
-			bound.invalidate();
-
-			btAABB temp_box;
-
-			int child_node = getLeftNode(nodecount);
-			if(child_node)
-			{
-				getNodeBound(child_node,temp_box);
-				bound.merge(temp_box);
-			}
-
-			child_node = getRightNode(nodecount);
-			if(child_node)
-			{
-				getNodeBound(child_node,temp_box);
-				bound.merge(temp_box);
-			}
-
-			setNodeBound(nodecount,bound);
-		}
-	}
-}
-
-//! this rebuild the entire set
-void btGImpactQuantizedBvh::buildSet()
-{
-	//obtain primitive boxes
-	GIM_BVH_DATA_ARRAY primitive_boxes;
-	primitive_boxes.resize(m_primitive_manager->get_primitive_count());
-
-	for (int i = 0;i<primitive_boxes.size() ;i++ )
-	{
-		 m_primitive_manager->get_primitive_box(i,primitive_boxes[i].m_bound);
-		 primitive_boxes[i].m_data = i;
-	}
-
-	m_box_tree.build_tree(primitive_boxes);
-}
-
-//! returns the indices of the primitives in the m_primitive_manager
-bool btGImpactQuantizedBvh::boxQuery(const btAABB & box, btAlignedObjectArray<int> & collided_results) const
-{
-	int curIndex = 0;
-	int numNodes = getNodeCount();
-
-	//quantize box
-
-	unsigned short quantizedMin[3];
-	unsigned short quantizedMax[3];
-
-	m_box_tree.quantizePoint(quantizedMin,box.m_min);
-	m_box_tree.quantizePoint(quantizedMax,box.m_max);
-
-
-	while (curIndex < numNodes)
-	{
-
-		//catch bugs in tree data
-
-		bool aabbOverlap = m_box_tree.testQuantizedBoxOverlapp(curIndex, quantizedMin,quantizedMax);
-		bool isleafnode = isLeafNode(curIndex);
-
-		if (isleafnode && aabbOverlap)
-		{
-			collided_results.push_back(getNodeData(curIndex));
-		}
-
-		if (aabbOverlap || isleafnode)
-		{
-			//next subnode
-			curIndex++;
-		}
-		else
-		{
-			//skip node
-			curIndex+= getEscapeNodeIndex(curIndex);
-		}
-	}
-	if(collided_results.size()>0) return true;
-	return false;
-}
-
-
-
-//! returns the indices of the primitives in the m_primitive_manager
-bool btGImpactQuantizedBvh::rayQuery(
-	const btVector3 & ray_dir,const btVector3 & ray_origin ,
-	btAlignedObjectArray<int> & collided_results) const
-{
-	int curIndex = 0;
-	int numNodes = getNodeCount();
-
-	while (curIndex < numNodes)
-	{
-		btAABB bound;
-		getNodeBound(curIndex,bound);
-
-		//catch bugs in tree data
-
-		bool aabbOverlap = bound.collide_ray(ray_origin,ray_dir);
-		bool isleafnode = isLeafNode(curIndex);
-
-		if (isleafnode && aabbOverlap)
-		{
-			collided_results.push_back(getNodeData( curIndex));
-		}
-
-		if (aabbOverlap || isleafnode)
-		{
-			//next subnode
-			curIndex++;
-		}
-		else
-		{
-			//skip node
-			curIndex+= getEscapeNodeIndex(curIndex);
-		}
-	}
-	if(collided_results.size()>0) return true;
-	return false;
-}
-
-
-SIMD_FORCE_INLINE bool _quantized_node_collision(
-	btGImpactQuantizedBvh * boxset0, btGImpactQuantizedBvh * boxset1,
-	const BT_BOX_BOX_TRANSFORM_CACHE & trans_cache_1to0,
-	int node0 ,int node1, bool complete_primitive_tests)
-{
-	btAABB box0;
-	boxset0->getNodeBound(node0,box0);
-	btAABB box1;
-	boxset1->getNodeBound(node1,box1);
-
-	return box0.overlapping_trans_cache(box1,trans_cache_1to0,complete_primitive_tests );
-//	box1.appy_transform_trans_cache(trans_cache_1to0);
-//	return box0.has_collision(box1);
-
-}
-
-
-//stackless recursive collision routine
-static void _find_quantized_collision_pairs_recursive(
-	btGImpactQuantizedBvh * boxset0, btGImpactQuantizedBvh * boxset1,
-	btPairSet * collision_pairs,
-	const BT_BOX_BOX_TRANSFORM_CACHE & trans_cache_1to0,
-	int node0, int node1, bool complete_primitive_tests)
-{
-
-
-
-	if( _quantized_node_collision(
-		boxset0,boxset1,trans_cache_1to0,
-		node0,node1,complete_primitive_tests) ==false) return;//avoid colliding internal nodes
-
-	if(boxset0->isLeafNode(node0))
-	{
-		if(boxset1->isLeafNode(node1))
-		{
-			// collision result
-			collision_pairs->push_pair(
-				boxset0->getNodeData(node0),boxset1->getNodeData(node1));
-			return;
-		}
-		else
-		{
-
-			//collide left recursive
-
-			_find_quantized_collision_pairs_recursive(
-								boxset0,boxset1,
-								collision_pairs,trans_cache_1to0,
-								node0,boxset1->getLeftNode(node1),false);
-
-			//collide right recursive
-			_find_quantized_collision_pairs_recursive(
-								boxset0,boxset1,
-								collision_pairs,trans_cache_1to0,
-								node0,boxset1->getRightNode(node1),false);
-
-
-		}
-	}
-	else
-	{
-		if(boxset1->isLeafNode(node1))
-		{
-
-			//collide left recursive
-			_find_quantized_collision_pairs_recursive(
-								boxset0,boxset1,
-								collision_pairs,trans_cache_1to0,
-								boxset0->getLeftNode(node0),node1,false);
-
-
-			//collide right recursive
-
-			_find_quantized_collision_pairs_recursive(
-								boxset0,boxset1,
-								collision_pairs,trans_cache_1to0,
-								boxset0->getRightNode(node0),node1,false);
-
-
-		}
-		else
-		{
-			//collide left0 left1
-
-
-
-			_find_quantized_collision_pairs_recursive(
-				boxset0,boxset1,
-				collision_pairs,trans_cache_1to0,
-				boxset0->getLeftNode(node0),boxset1->getLeftNode(node1),false);
-
-			//collide left0 right1
-
-			_find_quantized_collision_pairs_recursive(
-				boxset0,boxset1,
-				collision_pairs,trans_cache_1to0,
-				boxset0->getLeftNode(node0),boxset1->getRightNode(node1),false);
-
-
-			//collide right0 left1
-
-			_find_quantized_collision_pairs_recursive(
-				boxset0,boxset1,
-				collision_pairs,trans_cache_1to0,
-				boxset0->getRightNode(node0),boxset1->getLeftNode(node1),false);
-
-			//collide right0 right1
-
-			_find_quantized_collision_pairs_recursive(
-				boxset0,boxset1,
-				collision_pairs,trans_cache_1to0,
-				boxset0->getRightNode(node0),boxset1->getRightNode(node1),false);
-
-		}// else if node1 is not a leaf
-	}// else if node0 is not a leaf
-}
-
-
-void btGImpactQuantizedBvh::find_collision(btGImpactQuantizedBvh * boxset0, const btTransform & trans0,
-		btGImpactQuantizedBvh * boxset1, const btTransform & trans1,
-		btPairSet & collision_pairs)
-{
-
-	if(boxset0->getNodeCount()==0 || boxset1->getNodeCount()==0 ) return;
-
-	BT_BOX_BOX_TRANSFORM_CACHE trans_cache_1to0;
-
-	trans_cache_1to0.calc_from_homogenic(trans0,trans1);
-
-#ifdef TRI_COLLISION_PROFILING
-	bt_begin_gim02_q_tree_time();
-#endif //TRI_COLLISION_PROFILING
-
-	_find_quantized_collision_pairs_recursive(
-		boxset0,boxset1,
-		&collision_pairs,trans_cache_1to0,0,0,true);
-#ifdef TRI_COLLISION_PROFILING
-	bt_end_gim02_q_tree_time();
-#endif //TRI_COLLISION_PROFILING
-
-}
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactQuantizedBvh.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactQuantizedBvh.h
deleted file mode 100644
index 9c99077..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactQuantizedBvh.h
+++ /dev/null
@@ -1,372 +0,0 @@
-#ifndef GIM_QUANTIZED_SET_H_INCLUDED
-#define GIM_QUANTIZED_SET_H_INCLUDED
-
-/*! \file btGImpactQuantizedBvh.h
-\author Francisco Leon Najera
-*/
-/*
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btGImpactBvh.h"
-#include "btQuantization.h"
-
-
-
-
-
-///btQuantizedBvhNode is a compressed aabb node, 16 bytes.
-///Node can be used for leafnode or internal node. Leafnodes can point to 32-bit triangle index (non-negative range).
-ATTRIBUTE_ALIGNED16	(struct) BT_QUANTIZED_BVH_NODE
-{
-	//12 bytes
-	unsigned short int	m_quantizedAabbMin[3];
-	unsigned short int	m_quantizedAabbMax[3];
-	//4 bytes
-	int	m_escapeIndexOrDataIndex;
-
-	BT_QUANTIZED_BVH_NODE()
-	{
-		m_escapeIndexOrDataIndex = 0;
-	}
-
-	SIMD_FORCE_INLINE bool isLeafNode() const
-	{
-		//skipindex is negative (internal node), triangleindex >=0 (leafnode)
-		return (m_escapeIndexOrDataIndex>=0);
-	}
-
-	SIMD_FORCE_INLINE int getEscapeIndex() const
-	{
-		//btAssert(m_escapeIndexOrDataIndex < 0);
-		return -m_escapeIndexOrDataIndex;
-	}
-
-	SIMD_FORCE_INLINE void setEscapeIndex(int index)
-	{
-		m_escapeIndexOrDataIndex = -index;
-	}
-
-	SIMD_FORCE_INLINE int getDataIndex() const
-	{
-		//btAssert(m_escapeIndexOrDataIndex >= 0);
-
-		return m_escapeIndexOrDataIndex;
-	}
-
-	SIMD_FORCE_INLINE void setDataIndex(int index)
-	{
-		m_escapeIndexOrDataIndex = index;
-	}
-
-	SIMD_FORCE_INLINE bool testQuantizedBoxOverlapp(
-		unsigned short * quantizedMin,unsigned short * quantizedMax) const
-	{
-		if(m_quantizedAabbMin[0] > quantizedMax[0] ||
-		   m_quantizedAabbMax[0] < quantizedMin[0] ||
-		   m_quantizedAabbMin[1] > quantizedMax[1] ||
-		   m_quantizedAabbMax[1] < quantizedMin[1] ||
-		   m_quantizedAabbMin[2] > quantizedMax[2] ||
-		   m_quantizedAabbMax[2] < quantizedMin[2])
-		{
-			return false;
-		}
-		return true;
-	}
-
-};
-
-
-
-class GIM_QUANTIZED_BVH_NODE_ARRAY:public btAlignedObjectArray<BT_QUANTIZED_BVH_NODE>
-{
-};
-
-
-
-
-//! Basic Box tree structure
-class btQuantizedBvhTree
-{
-protected:
-	int m_num_nodes;
-	GIM_QUANTIZED_BVH_NODE_ARRAY m_node_array;
-	btAABB m_global_bound;
-	btVector3 m_bvhQuantization;
-protected:
-	void calc_quantization(GIM_BVH_DATA_ARRAY & primitive_boxes, btScalar boundMargin = btScalar(1.0) );
-
-	int _sort_and_calc_splitting_index(
-		GIM_BVH_DATA_ARRAY & primitive_boxes,
-		 int startIndex,  int endIndex, int splitAxis);
-
-	int _calc_splitting_axis(GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,  int endIndex);
-
-	void _build_sub_tree(GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,  int endIndex);
-public:
-	btQuantizedBvhTree()
-	{
-		m_num_nodes = 0;
-	}
-
-	//! prototype functions for box tree management
-	//!@{
-	void build_tree(GIM_BVH_DATA_ARRAY & primitive_boxes);
-
-	SIMD_FORCE_INLINE void quantizePoint(
-		unsigned short * quantizedpoint, const btVector3 & point) const
-	{
-		bt_quantize_clamp(quantizedpoint,point,m_global_bound.m_min,m_global_bound.m_max,m_bvhQuantization);
-	}
-
-
-	SIMD_FORCE_INLINE bool testQuantizedBoxOverlapp(
-		int node_index,
-		unsigned short * quantizedMin,unsigned short * quantizedMax) const
-	{
-		return m_node_array[node_index].testQuantizedBoxOverlapp(quantizedMin,quantizedMax);
-	}
-
-	SIMD_FORCE_INLINE void clearNodes()
-	{
-		m_node_array.clear();
-		m_num_nodes = 0;
-	}
-
-	//! node count
-	SIMD_FORCE_INLINE int getNodeCount() const
-	{
-		return m_num_nodes;
-	}
-
-	//! tells if the node is a leaf
-	SIMD_FORCE_INLINE bool isLeafNode(int nodeindex) const
-	{
-		return m_node_array[nodeindex].isLeafNode();
-	}
-
-	SIMD_FORCE_INLINE int getNodeData(int nodeindex) const
-	{
-		return m_node_array[nodeindex].getDataIndex();
-	}
-
-	SIMD_FORCE_INLINE void getNodeBound(int nodeindex, btAABB & bound) const
-	{
-		bound.m_min = bt_unquantize(
-			m_node_array[nodeindex].m_quantizedAabbMin,
-			m_global_bound.m_min,m_bvhQuantization);
-
-		bound.m_max = bt_unquantize(
-			m_node_array[nodeindex].m_quantizedAabbMax,
-			m_global_bound.m_min,m_bvhQuantization);
-	}
-
-	SIMD_FORCE_INLINE void setNodeBound(int nodeindex, const btAABB & bound)
-	{
-		bt_quantize_clamp(	m_node_array[nodeindex].m_quantizedAabbMin,
-							bound.m_min,
-							m_global_bound.m_min,
-							m_global_bound.m_max,
-							m_bvhQuantization);
-
-		bt_quantize_clamp(	m_node_array[nodeindex].m_quantizedAabbMax,
-							bound.m_max,
-							m_global_bound.m_min,
-							m_global_bound.m_max,
-							m_bvhQuantization);
-	}
-
-	SIMD_FORCE_INLINE int getLeftNode(int nodeindex) const
-	{
-		return nodeindex+1;
-	}
-
-	SIMD_FORCE_INLINE int getRightNode(int nodeindex) const
-	{
-		if(m_node_array[nodeindex+1].isLeafNode()) return nodeindex+2;
-		return nodeindex+1 + m_node_array[nodeindex+1].getEscapeIndex();
-	}
-
-	SIMD_FORCE_INLINE int getEscapeNodeIndex(int nodeindex) const
-	{
-		return m_node_array[nodeindex].getEscapeIndex();
-	}
-
-	SIMD_FORCE_INLINE const BT_QUANTIZED_BVH_NODE * get_node_pointer(int index = 0) const
-	{
-		return &m_node_array[index];
-	}
-
-	//!@}
-};
-
-
-
-//! Structure for containing Boxes
-/*!
-This class offers an structure for managing a box tree of primitives.
-Requires a Primitive prototype (like btPrimitiveManagerBase )
-*/
-class btGImpactQuantizedBvh
-{
-protected:
-	btQuantizedBvhTree m_box_tree;
-	btPrimitiveManagerBase * m_primitive_manager;
-
-protected:
-	//stackless refit
-	void refit();
-public:
-
-	//! this constructor doesn't build the tree. you must call	buildSet
-	btGImpactQuantizedBvh()
-	{
-		m_primitive_manager = NULL;
-	}
-
-	//! this constructor doesn't build the tree. you must call	buildSet
-	btGImpactQuantizedBvh(btPrimitiveManagerBase * primitive_manager)
-	{
-		m_primitive_manager = primitive_manager;
-	}
-
-	SIMD_FORCE_INLINE btAABB getGlobalBox()  const
-	{
-		btAABB totalbox;
-		getNodeBound(0, totalbox);
-		return totalbox;
-	}
-
-	SIMD_FORCE_INLINE void setPrimitiveManager(btPrimitiveManagerBase * primitive_manager)
-	{
-		m_primitive_manager = primitive_manager;
-	}
-
-	SIMD_FORCE_INLINE btPrimitiveManagerBase * getPrimitiveManager() const
-	{
-		return m_primitive_manager;
-	}
-
-
-//! node manager prototype functions
-///@{
-
-	//! this attemps to refit the box set.
-	SIMD_FORCE_INLINE void update()
-	{
-		refit();
-	}
-
-	//! this rebuild the entire set
-	void buildSet();
-
-	//! returns the indices of the primitives in the m_primitive_manager
-	bool boxQuery(const btAABB & box, btAlignedObjectArray<int> & collided_results) const;
-
-	//! returns the indices of the primitives in the m_primitive_manager
-	SIMD_FORCE_INLINE bool boxQueryTrans(const btAABB & box,
-		 const btTransform & transform, btAlignedObjectArray<int> & collided_results) const
-	{
-		btAABB transbox=box;
-		transbox.appy_transform(transform);
-		return boxQuery(transbox,collided_results);
-	}
-
-	//! returns the indices of the primitives in the m_primitive_manager
-	bool rayQuery(
-		const btVector3 & ray_dir,const btVector3 & ray_origin ,
-		btAlignedObjectArray<int> & collided_results) const;
-
-	//! tells if this set has hierarcht
-	SIMD_FORCE_INLINE bool hasHierarchy() const
-	{
-		return true;
-	}
-
-	//! tells if this set is a trimesh
-	SIMD_FORCE_INLINE bool isTrimesh()  const
-	{
-		return m_primitive_manager->is_trimesh();
-	}
-
-	//! node count
-	SIMD_FORCE_INLINE int getNodeCount() const
-	{
-		return m_box_tree.getNodeCount();
-	}
-
-	//! tells if the node is a leaf
-	SIMD_FORCE_INLINE bool isLeafNode(int nodeindex) const
-	{
-		return m_box_tree.isLeafNode(nodeindex);
-	}
-
-	SIMD_FORCE_INLINE int getNodeData(int nodeindex) const
-	{
-		return m_box_tree.getNodeData(nodeindex);
-	}
-
-	SIMD_FORCE_INLINE void getNodeBound(int nodeindex, btAABB & bound)  const
-	{
-		m_box_tree.getNodeBound(nodeindex, bound);
-	}
-
-	SIMD_FORCE_INLINE void setNodeBound(int nodeindex, const btAABB & bound)
-	{
-		m_box_tree.setNodeBound(nodeindex, bound);
-	}
-
-
-	SIMD_FORCE_INLINE int getLeftNode(int nodeindex) const
-	{
-		return m_box_tree.getLeftNode(nodeindex);
-	}
-
-	SIMD_FORCE_INLINE int getRightNode(int nodeindex) const
-	{
-		return m_box_tree.getRightNode(nodeindex);
-	}
-
-	SIMD_FORCE_INLINE int getEscapeNodeIndex(int nodeindex) const
-	{
-		return m_box_tree.getEscapeNodeIndex(nodeindex);
-	}
-
-	SIMD_FORCE_INLINE void getNodeTriangle(int nodeindex,btPrimitiveTriangle & triangle) const
-	{
-		m_primitive_manager->get_primitive_triangle(getNodeData(nodeindex),triangle);
-	}
-
-
-	SIMD_FORCE_INLINE const BT_QUANTIZED_BVH_NODE * get_node_pointer(int index = 0) const
-	{
-		return m_box_tree.get_node_pointer(index);
-	}
-
-#ifdef TRI_COLLISION_PROFILING
-	static float getAverageTreeCollisionTime();
-#endif //TRI_COLLISION_PROFILING
-
-	static void find_collision(btGImpactQuantizedBvh * boxset1, const btTransform & trans1,
-		btGImpactQuantizedBvh * boxset2, const btTransform & trans2,
-		btPairSet & collision_pairs);
-};
-
-
-#endif // GIM_BOXPRUNING_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactShape.cpp b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactShape.cpp
deleted file mode 100644
index cceace5..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactShape.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "btGImpactShape.h"
-#include "btGImpactMassUtil.h"
-
-
-#define CALC_EXACT_INERTIA 1
-
-void btGImpactCompoundShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
-{
-	lockChildShapes();
-#ifdef CALC_EXACT_INERTIA
-	inertia.setValue(0.f,0.f,0.f);
-
-	int i = this->getNumChildShapes();
-	btScalar shapemass = mass/btScalar(i);
-
-	while(i--)
-	{
-		btVector3 temp_inertia;
-		m_childShapes[i]->calculateLocalInertia(shapemass,temp_inertia);
-		if(childrenHasTransform())
-		{
-			inertia = gim_inertia_add_transformed( inertia,temp_inertia,m_childTransforms[i]);
-		}
-		else
-		{
-			inertia = gim_inertia_add_transformed( inertia,temp_inertia,btTransform::getIdentity());
-		}
-
-	}
-
-#else
-
-	// Calc box inertia
-
-	btScalar lx= m_localAABB.m_max[0] - m_localAABB.m_min[0];
-	btScalar ly= m_localAABB.m_max[1] - m_localAABB.m_min[1];
-	btScalar lz= m_localAABB.m_max[2] - m_localAABB.m_min[2];
-	const btScalar x2 = lx*lx;
-	const btScalar y2 = ly*ly;
-	const btScalar z2 = lz*lz;
-	const btScalar scaledmass = mass * btScalar(0.08333333);
-
-	inertia = scaledmass * (btVector3(y2+z2,x2+z2,x2+y2));
-
-#endif
-	unlockChildShapes();
-}
-
-
-
-void btGImpactMeshShapePart::calculateLocalInertia(btScalar mass,btVector3& inertia) const
-{
-	lockChildShapes();
-
-
-#ifdef CALC_EXACT_INERTIA
-	inertia.setValue(0.f,0.f,0.f);
-
-	int i = this->getVertexCount();
-	btScalar pointmass = mass/btScalar(i);
-
-	while(i--)
-	{
-		btVector3 pointintertia;
-		this->getVertex(i,pointintertia);
-		pointintertia = gim_get_point_inertia(pointintertia,pointmass);
-		inertia+=pointintertia;
-	}
-
-#else
-
-	// Calc box inertia
-
-	btScalar lx= m_localAABB.m_max[0] - m_localAABB.m_min[0];
-	btScalar ly= m_localAABB.m_max[1] - m_localAABB.m_min[1];
-	btScalar lz= m_localAABB.m_max[2] - m_localAABB.m_min[2];
-	const btScalar x2 = lx*lx;
-	const btScalar y2 = ly*ly;
-	const btScalar z2 = lz*lz;
-	const btScalar scaledmass = mass * btScalar(0.08333333);
-
-	inertia = scaledmass * (btVector3(y2+z2,x2+z2,x2+y2));
-
-#endif
-
-	unlockChildShapes();
-}
-
-void btGImpactMeshShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
-{
-
-#ifdef CALC_EXACT_INERTIA
-	inertia.setValue(0.f,0.f,0.f);
-
-	int i = this->getMeshPartCount();
-	btScalar partmass = mass/btScalar(i);
-
-	while(i--)
-	{
-		btVector3 partinertia;
-		getMeshPart(i)->calculateLocalInertia(partmass,partinertia);
-		inertia+=partinertia;
-	}
-
-#else
-
-	// Calc box inertia
-
-	btScalar lx= m_localAABB.m_max[0] - m_localAABB.m_min[0];
-	btScalar ly= m_localAABB.m_max[1] - m_localAABB.m_min[1];
-	btScalar lz= m_localAABB.m_max[2] - m_localAABB.m_min[2];
-	const btScalar x2 = lx*lx;
-	const btScalar y2 = ly*ly;
-	const btScalar z2 = lz*lz;
-	const btScalar scaledmass = mass * btScalar(0.08333333);
-
-	inertia = scaledmass * (btVector3(y2+z2,x2+z2,x2+y2));
-
-#endif
-}
-
-void btGImpactMeshShape::rayTest(const btVector3& rayFrom, const btVector3& rayTo, btCollisionWorld::RayResultCallback& resultCallback) const
-{
-}
-
-
-void btGImpactMeshShapePart::processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const
-{
-	lockChildShapes();
-	btAABB box;
-	box.m_min = aabbMin;
-	box.m_max = aabbMax;
-
-	btAlignedObjectArray<int> collided;
-	m_box_set.boxQuery(box,collided);
-
-	if(collided.size()==0)
-	{
-		unlockChildShapes();
-		return;
-	}
-
-	int part = (int)getPart();
-	btPrimitiveTriangle triangle;
-	int i = collided.size();
-	while(i--)
-	{
-		this->getPrimitiveTriangle(collided[i],triangle);
-		callback->processTriangle(triangle.m_vertices,part,collided[i]);
-	}
-	unlockChildShapes();
-
-}
-
-void btGImpactMeshShape::processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const
-{
-	int i = m_mesh_parts.size();
-	while(i--)
-	{
-		m_mesh_parts[i]->processAllTriangles(callback,aabbMin,aabbMax);
-	}
-}
-
-
-///fills the dataBuffer and returns the struct name (and 0 on failure)
-const char*	btGImpactMeshShape::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-	btGImpactMeshShapeData* trimeshData = (btGImpactMeshShapeData*) dataBuffer;
-
-	btCollisionShape::serialize(&trimeshData->m_collisionShapeData,serializer);
-
-	m_meshInterface->serialize(&trimeshData->m_meshInterface, serializer);
-
-	trimeshData->m_collisionMargin = float(m_collisionMargin);
-
-	localScaling.serializeFloat(trimeshData->m_localScaling);
-
-	trimeshData->m_gimpactSubType = int(getGImpactShapeType());
-
-	return "btGImpactMeshShapeData";
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactShape.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactShape.h
deleted file mode 100644
index 90015bb..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactShape.h
+++ /dev/null
@@ -1,1171 +0,0 @@
-/*! \file btGImpactShape.h
-\author Francisco Len N�jera
-*/
-/*
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef GIMPACT_SHAPE_H
-#define GIMPACT_SHAPE_H
-
-#include "BulletCollision/CollisionShapes/btCollisionShape.h"
-#include "BulletCollision/CollisionShapes/btTriangleShape.h"
-#include "BulletCollision/CollisionShapes/btStridingMeshInterface.h"
-#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
-#include "BulletCollision/CollisionDispatch/btCollisionWorld.h"
-#include "BulletCollision/CollisionShapes/btConcaveShape.h"
-#include "BulletCollision/CollisionShapes/btTetrahedronShape.h"
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btTransform.h"
-#include "LinearMath/btMatrix3x3.h"
-#include "LinearMath/btAlignedObjectArray.h"
-
-#include "btGImpactQuantizedBvh.h" // box tree class
-
-
-//! declare Quantized trees, (you can change to float based trees)
-typedef btGImpactQuantizedBvh btGImpactBoxSet;
-
-enum eGIMPACT_SHAPE_TYPE
-{
-	CONST_GIMPACT_COMPOUND_SHAPE = 0,
-	CONST_GIMPACT_TRIMESH_SHAPE_PART,
-	CONST_GIMPACT_TRIMESH_SHAPE
-};
-
-
-//! Helper class for tetrahedrons
-class btTetrahedronShapeEx:public btBU_Simplex1to4
-{
-public:
-	btTetrahedronShapeEx()
-	{
-		m_numVertices = 4;
-	}
-
-
-	SIMD_FORCE_INLINE void setVertices(
-		const btVector3 & v0,const btVector3 & v1,
-		const btVector3 & v2,const btVector3 & v3)
-	{
-		m_vertices[0] = v0;
-		m_vertices[1] = v1;
-		m_vertices[2] = v2;
-		m_vertices[3] = v3;
-		recalcLocalAabb();
-	}
-};
-
-
-//! Base class for gimpact shapes
-class btGImpactShapeInterface : public btConcaveShape
-{
-protected:
-    btAABB m_localAABB;
-    bool m_needs_update;
-    btVector3  localScaling;
-    btGImpactBoxSet m_box_set;// optionally boxset
-
-	//! use this function for perfofm refit in bounding boxes
-    //! use this function for perfofm refit in bounding boxes
-    virtual void calcLocalAABB()
-    {
-		lockChildShapes();
-    	if(m_box_set.getNodeCount() == 0)
-    	{
-    		m_box_set.buildSet();
-    	}
-    	else
-    	{
-    		m_box_set.update();
-    	}
-    	unlockChildShapes();
-
-    	m_localAABB = m_box_set.getGlobalBox();
-    }
-
-
-public:
-	btGImpactShapeInterface()
-	{
-		m_shapeType=GIMPACT_SHAPE_PROXYTYPE;
-		m_localAABB.invalidate();
-		m_needs_update = true;
-		localScaling.setValue(1.f,1.f,1.f);
-	}
-
-
-	//! performs refit operation
-	/*!
-	Updates the entire Box set of this shape.
-	\pre postUpdate() must be called for attemps to calculating the box set, else this function
-		will does nothing.
-	\post if m_needs_update == true, then it calls calcLocalAABB();
-	*/
-    SIMD_FORCE_INLINE void updateBound()
-    {
-    	if(!m_needs_update) return;
-    	calcLocalAABB();
-    	m_needs_update  = false;
-    }
-
-    //! If the Bounding box is not updated, then this class attemps to calculate it.
-    /*!
-    \post Calls updateBound() for update the box set.
-    */
-    void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
-    {
-        btAABB transformedbox = m_localAABB;
-        transformedbox.appy_transform(t);
-        aabbMin = transformedbox.m_min;
-        aabbMax = transformedbox.m_max;
-    }
-
-    //! Tells to this object that is needed to refit the box set
-    virtual void postUpdate()
-    {
-    	m_needs_update = true;
-    }
-
-	//! Obtains the local box, which is the global calculated box of the total of subshapes
-	SIMD_FORCE_INLINE const btAABB & getLocalBox()
-	{
-		return m_localAABB;
-	}
-
-
-    virtual int	getShapeType() const
-    {
-        return GIMPACT_SHAPE_PROXYTYPE;
-    }
-
-    /*!
-	\post You must call updateBound() for update the box set.
-	*/
-	virtual void	setLocalScaling(const btVector3& scaling)
-	{
-		localScaling = scaling;
-		postUpdate();
-	}
-
-	virtual const btVector3& getLocalScaling() const
-	{
-		return localScaling;
-	}
-
-
-	virtual void setMargin(btScalar margin)
-    {
-    	m_collisionMargin = margin;
-    	int i = getNumChildShapes();
-    	while(i--)
-    	{
-			btCollisionShape* child = getChildShape(i);
-			child->setMargin(margin);
-    	}
-
-		m_needs_update = true;
-    }
-
-
-	//! Subshape member functions
-	//!@{
-
-	//! Base method for determinig which kind of GIMPACT shape we get
-	virtual eGIMPACT_SHAPE_TYPE getGImpactShapeType() const = 0 ;
-
-	//! gets boxset
-	SIMD_FORCE_INLINE btGImpactBoxSet * getBoxSet()
-	{
-		return &m_box_set;
-	}
-
-	//! Determines if this class has a hierarchy structure for sorting its primitives
-	SIMD_FORCE_INLINE bool hasBoxSet()  const
-	{
-		if(m_box_set.getNodeCount() == 0) return false;
-		return true;
-	}
-
-	//! Obtains the primitive manager
-	virtual const btPrimitiveManagerBase * getPrimitiveManager()  const = 0;
-
-
-	//! Gets the number of children
-	virtual int	getNumChildShapes() const  = 0;
-
-	//! if true, then its children must get transforms.
-	virtual bool childrenHasTransform() const = 0;
-
-	//! Determines if this shape has triangles
-	virtual bool needsRetrieveTriangles() const = 0;
-
-	//! Determines if this shape has tetrahedrons
-	virtual bool needsRetrieveTetrahedrons() const = 0;
-
-	virtual void getBulletTriangle(int prim_index,btTriangleShapeEx & triangle) const = 0;
-
-	virtual void getBulletTetrahedron(int prim_index,btTetrahedronShapeEx & tetrahedron) const = 0;
-
-
-
-	//! call when reading child shapes
-	virtual void lockChildShapes() const
-	{
-	}
-
-	virtual void unlockChildShapes() const
-	{
-	}
-
-	//! if this trimesh
-	SIMD_FORCE_INLINE void getPrimitiveTriangle(int index,btPrimitiveTriangle & triangle) const
-	{
-		getPrimitiveManager()->get_primitive_triangle(index,triangle);
-	}
-
-
-	//! Retrieves the bound from a child
-    /*!
-    */
-    virtual void getChildAabb(int child_index,const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
-    {
-        btAABB child_aabb;
-        getPrimitiveManager()->get_primitive_box(child_index,child_aabb);
-        child_aabb.appy_transform(t);
-        aabbMin = child_aabb.m_min;
-        aabbMax = child_aabb.m_max;
-    }
-
-	//! Gets the children
-	virtual btCollisionShape* getChildShape(int index) = 0;
-
-
-	//! Gets the child
-	virtual const btCollisionShape* getChildShape(int index) const = 0;
-
-	//! Gets the children transform
-	virtual btTransform	getChildTransform(int index) const = 0;
-
-	//! Sets the children transform
-	/*!
-	\post You must call updateBound() for update the box set.
-	*/
-	virtual void setChildTransform(int index, const btTransform & transform) = 0;
-
-	//!@}
-
-
-	//! virtual method for ray collision
-	virtual void rayTest(const btVector3& rayFrom, const btVector3& rayTo, btCollisionWorld::RayResultCallback& resultCallback)  const
-	{
-        (void) rayFrom; (void) rayTo; (void) resultCallback;
-	}
-
-	//! Function for retrieve triangles.
-	/*!
-	It gives the triangles in local space
-	*/
-	virtual void	processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const
-	{
-        (void) callback; (void) aabbMin; (void) aabbMax;
-	}
-
-	//!@}
-
-};
-
-
-//! btGImpactCompoundShape allows to handle multiple btCollisionShape objects at once
-/*!
-This class only can manage Convex subshapes
-*/
-class btGImpactCompoundShape	: public btGImpactShapeInterface
-{
-public:
-	//! compound primitive manager
-	class CompoundPrimitiveManager:public btPrimitiveManagerBase
-	{
-	public:
-		virtual ~CompoundPrimitiveManager() {}
-		btGImpactCompoundShape * m_compoundShape;
-
-
-		CompoundPrimitiveManager(const CompoundPrimitiveManager& compound)
-            : btPrimitiveManagerBase()
-		{
-			m_compoundShape = compound.m_compoundShape;
-		}
-
-		CompoundPrimitiveManager(btGImpactCompoundShape * compoundShape)
-		{
-			m_compoundShape = compoundShape;
-		}
-
-		CompoundPrimitiveManager()
-		{
-			m_compoundShape = NULL;
-		}
-
-		virtual bool is_trimesh() const
-		{
-			return false;
-		}
-
-		virtual int get_primitive_count() const
-		{
-			return (int )m_compoundShape->getNumChildShapes();
-		}
-
-		virtual void get_primitive_box(int prim_index ,btAABB & primbox) const
-		{
-			btTransform prim_trans;
-			if(m_compoundShape->childrenHasTransform())
-			{
-				prim_trans = m_compoundShape->getChildTransform(prim_index);
-			}
-			else
-			{
-				prim_trans.setIdentity();
-			}
-			const btCollisionShape* shape = m_compoundShape->getChildShape(prim_index);
-			shape->getAabb(prim_trans,primbox.m_min,primbox.m_max);
-		}
-
-		virtual void get_primitive_triangle(int prim_index,btPrimitiveTriangle & triangle) const
-		{
-			btAssert(0);
-            (void) prim_index; (void) triangle;
-		}
-
-	};
-
-
-
-protected:
-	CompoundPrimitiveManager m_primitive_manager;
-	btAlignedObjectArray<btTransform>		m_childTransforms;
-	btAlignedObjectArray<btCollisionShape*>	m_childShapes;
-
-
-public:
-
-	btGImpactCompoundShape(bool children_has_transform = true)
-	{
-        (void) children_has_transform;
-		m_primitive_manager.m_compoundShape = this;
-		m_box_set.setPrimitiveManager(&m_primitive_manager);
-	}
-
-	virtual ~btGImpactCompoundShape()
-	{
-	}
-
-
-	//! if true, then its children must get transforms.
-	virtual bool childrenHasTransform() const
-	{
-		if(m_childTransforms.size()==0) return false;
-		return true;
-	}
-
-
-	//! Obtains the primitive manager
-	virtual const btPrimitiveManagerBase * getPrimitiveManager()  const
-	{
-		return &m_primitive_manager;
-	}
-
-	//! Obtains the compopund primitive manager
-	SIMD_FORCE_INLINE CompoundPrimitiveManager * getCompoundPrimitiveManager()
-	{
-		return &m_primitive_manager;
-	}
-
-	//! Gets the number of children
-	virtual int	getNumChildShapes() const
-	{
-		return m_childShapes.size();
-	}
-
-
-	//! Use this method for adding children. Only Convex shapes are allowed.
-	void addChildShape(const btTransform& localTransform,btCollisionShape* shape)
-	{
-		btAssert(shape->isConvex());
-		m_childTransforms.push_back(localTransform);
-		m_childShapes.push_back(shape);
-	}
-
-	//! Use this method for adding children. Only Convex shapes are allowed.
-	void addChildShape(btCollisionShape* shape)
-	{
-		btAssert(shape->isConvex());
-		m_childShapes.push_back(shape);
-	}
-
-	//! Gets the children
-	virtual btCollisionShape* getChildShape(int index)
-	{
-		return m_childShapes[index];
-	}
-
-	//! Gets the children
-	virtual const btCollisionShape* getChildShape(int index) const
-	{
-		return m_childShapes[index];
-	}
-
-	//! Retrieves the bound from a child
-    /*!
-    */
-    virtual void getChildAabb(int child_index,const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
-    {
-
-    	if(childrenHasTransform())
-    	{
-    		m_childShapes[child_index]->getAabb(t*m_childTransforms[child_index],aabbMin,aabbMax);
-    	}
-    	else
-    	{
-    		m_childShapes[child_index]->getAabb(t,aabbMin,aabbMax);
-    	}
-    }
-
-
-	//! Gets the children transform
-	virtual btTransform	getChildTransform(int index) const
-	{
-		btAssert(m_childTransforms.size() == m_childShapes.size());
-		return m_childTransforms[index];
-	}
-
-	//! Sets the children transform
-	/*!
-	\post You must call updateBound() for update the box set.
-	*/
-	virtual void setChildTransform(int index, const btTransform & transform)
-	{
-		btAssert(m_childTransforms.size() == m_childShapes.size());
-		m_childTransforms[index] = transform;
-		postUpdate();
-	}
-
-	//! Determines if this shape has triangles
-	virtual bool needsRetrieveTriangles() const
-	{
-		return false;
-	}
-
-	//! Determines if this shape has tetrahedrons
-	virtual bool needsRetrieveTetrahedrons() const
-	{
-		return false;
-	}
-
-
-	virtual void getBulletTriangle(int prim_index,btTriangleShapeEx & triangle) const
-	{
-        (void) prim_index; (void) triangle;
-		btAssert(0);
-	}
-
-	virtual void getBulletTetrahedron(int prim_index,btTetrahedronShapeEx & tetrahedron) const
-	{
-        (void) prim_index; (void) tetrahedron;
-		btAssert(0);
-	}
-
-
-	//! Calculates the exact inertia tensor for this shape
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
-
-	virtual const char*	getName()const
-	{
-		return "GImpactCompound";
-	}
-
-	virtual eGIMPACT_SHAPE_TYPE getGImpactShapeType() const
-	{
-		return CONST_GIMPACT_COMPOUND_SHAPE;
-	}
-
-};
-
-
-
-//! This class manages a sub part of a mesh supplied by the btStridingMeshInterface interface.
-/*!
-- Simply create this shape by passing the btStridingMeshInterface to the constructor btGImpactMeshShapePart, then you must call updateBound() after creating the mesh
-- When making operations with this shape, you must call <b>lock</b> before accessing to the trimesh primitives, and then call <b>unlock</b>
-- You can handle deformable meshes with this shape, by calling postUpdate() every time when changing the mesh vertices.
-
-*/
-class btGImpactMeshShapePart : public btGImpactShapeInterface
-{
-public:
-	//! Trimesh primitive manager
-	/*!
-	Manages the info from btStridingMeshInterface object and controls the Lock/Unlock mechanism
-	*/
-	class TrimeshPrimitiveManager:public btPrimitiveManagerBase
-	{
-	public:
-		btScalar m_margin;
-		btStridingMeshInterface * m_meshInterface;
-		btVector3 m_scale;
-		int m_part;
-		int m_lock_count;
-		const unsigned char *vertexbase;
-		int numverts;
-		PHY_ScalarType type;
-		int stride;
-		const unsigned char *indexbase;
-		int indexstride;
-		int  numfaces;
-		PHY_ScalarType indicestype;
-
-		TrimeshPrimitiveManager()
-		{
-			m_meshInterface = NULL;
-			m_part = 0;
-			m_margin = 0.01f;
-			m_scale = btVector3(1.f,1.f,1.f);
-			m_lock_count = 0;
-			vertexbase = 0;
-			numverts = 0;
-			stride = 0;
-			indexbase = 0;
-			indexstride = 0;
-			numfaces = 0;
-		}
-
- 		TrimeshPrimitiveManager(const TrimeshPrimitiveManager & manager)
-            : btPrimitiveManagerBase()
-		{
-			m_meshInterface = manager.m_meshInterface;
-			m_part = manager.m_part;
-			m_margin = manager.m_margin;
-			m_scale = manager.m_scale;
-			m_lock_count = 0;
-			vertexbase = 0;
-			numverts = 0;
-			stride = 0;
-			indexbase = 0;
-			indexstride = 0;
-			numfaces = 0;
-
-		}
-
-		TrimeshPrimitiveManager(
-			btStridingMeshInterface * meshInterface,	int part)
-		{
-			m_meshInterface = meshInterface;
-			m_part = part;
-			m_scale = m_meshInterface->getScaling();
-			m_margin = 0.1f;
-			m_lock_count = 0;
-			vertexbase = 0;
-			numverts = 0;
-			stride = 0;
-			indexbase = 0;
-			indexstride = 0;
-			numfaces = 0;
-
-		}
-
-		virtual ~TrimeshPrimitiveManager() {}
-
-		void lock()
-		{
-			if(m_lock_count>0)
-			{
-				m_lock_count++;
-				return;
-			}
-			m_meshInterface->getLockedReadOnlyVertexIndexBase(
-				&vertexbase,numverts,
-				type, stride,&indexbase, indexstride, numfaces,indicestype,m_part);
-
-			m_lock_count = 1;
-		}
-
-		void unlock()
-		{
-			if(m_lock_count == 0) return;
-			if(m_lock_count>1)
-			{
-				--m_lock_count;
-				return;
-			}
-			m_meshInterface->unLockReadOnlyVertexBase(m_part);
-			vertexbase = NULL;
-			m_lock_count = 0;
-		}
-
-		virtual bool is_trimesh() const
-		{
-			return true;
-		}
-
-		virtual int get_primitive_count() const
-		{
-			return (int )numfaces;
-		}
-
-		SIMD_FORCE_INLINE int get_vertex_count() const
-		{
-			return (int )numverts;
-		}
-
-		SIMD_FORCE_INLINE void get_indices(int face_index,int &i0,int &i1,int &i2) const
-		{
-			if(indicestype == PHY_SHORT)
-			{
-				short * s_indices = (short *)(indexbase + face_index*indexstride);
-				i0 = s_indices[0];
-				i1 = s_indices[1];
-				i2 = s_indices[2];
-			}
-			else
-			{
-				int * i_indices = (int *)(indexbase + face_index*indexstride);
-				i0 = i_indices[0];
-				i1 = i_indices[1];
-				i2 = i_indices[2];
-			}
-		}
-
-		SIMD_FORCE_INLINE void get_vertex(int vertex_index, btVector3 & vertex) const
-		{
-			if(type == PHY_DOUBLE)
-			{
-				double * dvertices = (double *)(vertexbase + vertex_index*stride);
-				vertex[0] = btScalar(dvertices[0]*m_scale[0]);
-				vertex[1] = btScalar(dvertices[1]*m_scale[1]);
-				vertex[2] = btScalar(dvertices[2]*m_scale[2]);
-			}
-			else
-			{
-				float * svertices = (float *)(vertexbase + vertex_index*stride);
-				vertex[0] = svertices[0]*m_scale[0];
-				vertex[1] = svertices[1]*m_scale[1];
-				vertex[2] = svertices[2]*m_scale[2];
-			}
-		}
-
-		virtual void get_primitive_box(int prim_index ,btAABB & primbox) const
-		{
-			btPrimitiveTriangle  triangle;
-			get_primitive_triangle(prim_index,triangle);
-			primbox.calc_from_triangle_margin(
-				triangle.m_vertices[0],
-				triangle.m_vertices[1],triangle.m_vertices[2],triangle.m_margin);
-		}
-
-		virtual void get_primitive_triangle(int prim_index,btPrimitiveTriangle & triangle) const
-		{
-			int indices[3];
-			get_indices(prim_index,indices[0],indices[1],indices[2]);
-			get_vertex(indices[0],triangle.m_vertices[0]);
-			get_vertex(indices[1],triangle.m_vertices[1]);
-			get_vertex(indices[2],triangle.m_vertices[2]);
-			triangle.m_margin = m_margin;
-		}
-
-		SIMD_FORCE_INLINE void get_bullet_triangle(int prim_index,btTriangleShapeEx & triangle) const
-		{
-			int indices[3];
-			get_indices(prim_index,indices[0],indices[1],indices[2]);
-			get_vertex(indices[0],triangle.m_vertices1[0]);
-			get_vertex(indices[1],triangle.m_vertices1[1]);
-			get_vertex(indices[2],triangle.m_vertices1[2]);
-			triangle.setMargin(m_margin);
-		}
-
-	};
-
-
-protected:
-	TrimeshPrimitiveManager m_primitive_manager;
-public:
-
-	btGImpactMeshShapePart()
-	{
-		m_box_set.setPrimitiveManager(&m_primitive_manager);
-	}
-
-
-	btGImpactMeshShapePart(btStridingMeshInterface * meshInterface,	int part)
-	{
-		m_primitive_manager.m_meshInterface = meshInterface;
-		m_primitive_manager.m_part = part;
-		m_box_set.setPrimitiveManager(&m_primitive_manager);
-	}
-
-	virtual ~btGImpactMeshShapePart()
-	{
-	}
-
-	//! if true, then its children must get transforms.
-	virtual bool childrenHasTransform() const
-	{
-		return false;
-	}
-
-
-	//! call when reading child shapes
-	virtual void lockChildShapes() const
-	{
-		void * dummy = (void*)(m_box_set.getPrimitiveManager());
-		TrimeshPrimitiveManager * dummymanager = static_cast<TrimeshPrimitiveManager *>(dummy);
-		dummymanager->lock();
-	}
-
-	virtual void unlockChildShapes()  const
-	{
-		void * dummy = (void*)(m_box_set.getPrimitiveManager());
-		TrimeshPrimitiveManager * dummymanager = static_cast<TrimeshPrimitiveManager *>(dummy);
-		dummymanager->unlock();
-	}
-
-	//! Gets the number of children
-	virtual int	getNumChildShapes() const
-	{
-		return m_primitive_manager.get_primitive_count();
-	}
-
-
-	//! Gets the children
-	virtual btCollisionShape* getChildShape(int index)
-	{
-        (void) index;
-		btAssert(0);
-		return NULL;
-	}
-
-
-
-	//! Gets the child
-	virtual const btCollisionShape* getChildShape(int index) const
-	{
-        (void) index;
-		btAssert(0);
-		return NULL;
-	}
-
-	//! Gets the children transform
-	virtual btTransform	getChildTransform(int index) const
-	{
-        (void) index;
-		btAssert(0);
-		return btTransform();
-	}
-
-	//! Sets the children transform
-	/*!
-	\post You must call updateBound() for update the box set.
-	*/
-	virtual void setChildTransform(int index, const btTransform & transform)
-	{
-        (void) index;
-        (void) transform;
-		btAssert(0);
-	}
-
-
-	//! Obtains the primitive manager
-	virtual const btPrimitiveManagerBase * getPrimitiveManager()  const
-	{
-		return &m_primitive_manager;
-	}
-
-	SIMD_FORCE_INLINE TrimeshPrimitiveManager * getTrimeshPrimitiveManager()
-	{
-		return &m_primitive_manager;
-	}
-
-
-
-
-
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
-
-
-
-
-	virtual const char*	getName()const
-	{
-		return "GImpactMeshShapePart";
-	}
-
-	virtual eGIMPACT_SHAPE_TYPE getGImpactShapeType() const
-	{
-		return CONST_GIMPACT_TRIMESH_SHAPE_PART;
-	}
-
-	//! Determines if this shape has triangles
-	virtual bool needsRetrieveTriangles() const
-	{
-		return true;
-	}
-
-	//! Determines if this shape has tetrahedrons
-	virtual bool needsRetrieveTetrahedrons() const
-	{
-		return false;
-	}
-
-	virtual void getBulletTriangle(int prim_index,btTriangleShapeEx & triangle) const
-	{
-		m_primitive_manager.get_bullet_triangle(prim_index,triangle);
-	}
-
-	virtual void getBulletTetrahedron(int prim_index,btTetrahedronShapeEx & tetrahedron) const
-	{
-        (void) prim_index;
-        (void) tetrahedron;
-		btAssert(0);
-	}
-
-
-
-	SIMD_FORCE_INLINE int getVertexCount() const
-	{
-		return m_primitive_manager.get_vertex_count();
-	}
-
-	SIMD_FORCE_INLINE void getVertex(int vertex_index, btVector3 & vertex) const
-	{
-		m_primitive_manager.get_vertex(vertex_index,vertex);
-	}
-
-	SIMD_FORCE_INLINE void setMargin(btScalar margin)
-    {
-    	m_primitive_manager.m_margin = margin;
-    	postUpdate();
-    }
-
-    SIMD_FORCE_INLINE btScalar getMargin() const
-    {
-    	return m_primitive_manager.m_margin;
-    }
-
-    virtual void	setLocalScaling(const btVector3& scaling)
-    {
-    	m_primitive_manager.m_scale = scaling;
-    	postUpdate();
-    }
-
-    virtual const btVector3& getLocalScaling() const
-    {
-    	return m_primitive_manager.m_scale;
-    }
-
-    SIMD_FORCE_INLINE int getPart() const
-    {
-    	return (int)m_primitive_manager.m_part;
-    }
-
-	virtual void	processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const;
-};
-
-
-//! This class manages a mesh supplied by the btStridingMeshInterface interface.
-/*!
-Set of btGImpactMeshShapePart parts
-- Simply create this shape by passing the btStridingMeshInterface to the constructor btGImpactMeshShape, then you must call updateBound() after creating the mesh
-
-- You can handle deformable meshes with this shape, by calling postUpdate() every time when changing the mesh vertices.
-
-*/
-class btGImpactMeshShape : public btGImpactShapeInterface
-{
-	btStridingMeshInterface* m_meshInterface;
-
-protected:
-	btAlignedObjectArray<btGImpactMeshShapePart*> m_mesh_parts;
-	void buildMeshParts(btStridingMeshInterface * meshInterface)
-	{
-		for (int i=0;i<meshInterface->getNumSubParts() ;++i )
-		{
-			btGImpactMeshShapePart * newpart = new btGImpactMeshShapePart(meshInterface,i);
-			m_mesh_parts.push_back(newpart);
-		}
-	}
-
-	//! use this function for perfofm refit in bounding boxes
-    virtual void calcLocalAABB()
-    {
-    	m_localAABB.invalidate();
-    	int i = m_mesh_parts.size();
-    	while(i--)
-    	{
-    		m_mesh_parts[i]->updateBound();
-    		m_localAABB.merge(m_mesh_parts[i]->getLocalBox());
-    	}
-    }
-
-public:
-	btGImpactMeshShape(btStridingMeshInterface * meshInterface)
-	{
-		m_meshInterface = meshInterface;
-		buildMeshParts(meshInterface);
-	}
-
-	virtual ~btGImpactMeshShape()
-	{
-		int i = m_mesh_parts.size();
-    	while(i--)
-    	{
-			btGImpactMeshShapePart * part = m_mesh_parts[i];
-			delete part;
-    	}
-		m_mesh_parts.clear();
-	}
-
-
-	btStridingMeshInterface* getMeshInterface()
-	{
-		return m_meshInterface;
-	}
-
-	const btStridingMeshInterface* getMeshInterface() const
-	{
-		return m_meshInterface;
-	}
-
-	int getMeshPartCount() const
-	{
-		return m_mesh_parts.size();
-	}
-
-	btGImpactMeshShapePart * getMeshPart(int index)
-	{
-		return m_mesh_parts[index];
-	}
-
-
-
-	const btGImpactMeshShapePart * getMeshPart(int index) const
-	{
-		return m_mesh_parts[index];
-	}
-
-
-	virtual void	setLocalScaling(const btVector3& scaling)
-	{
-		localScaling = scaling;
-
-		int i = m_mesh_parts.size();
-    	while(i--)
-    	{
-			btGImpactMeshShapePart * part = m_mesh_parts[i];
-			part->setLocalScaling(scaling);
-    	}
-
-		m_needs_update = true;
-	}
-
-	virtual void setMargin(btScalar margin)
-    {
-    	m_collisionMargin = margin;
-
-		int i = m_mesh_parts.size();
-    	while(i--)
-    	{
-			btGImpactMeshShapePart * part = m_mesh_parts[i];
-			part->setMargin(margin);
-    	}
-
-		m_needs_update = true;
-    }
-
-	//! Tells to this object that is needed to refit all the meshes
-    virtual void postUpdate()
-    {
-		int i = m_mesh_parts.size();
-    	while(i--)
-    	{
-			btGImpactMeshShapePart * part = m_mesh_parts[i];
-			part->postUpdate();
-    	}
-
-    	m_needs_update = true;
-    }
-
-	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
-
-
-	//! Obtains the primitive manager
-	virtual const btPrimitiveManagerBase * getPrimitiveManager()  const
-	{
-		btAssert(0);
-		return NULL;
-	}
-
-
-	//! Gets the number of children
-	virtual int	getNumChildShapes() const
-	{
-		btAssert(0);
-		return 0;
-	}
-
-
-	//! if true, then its children must get transforms.
-	virtual bool childrenHasTransform() const
-	{
-		btAssert(0);
-		return false;
-	}
-
-	//! Determines if this shape has triangles
-	virtual bool needsRetrieveTriangles() const
-	{
-		btAssert(0);
-		return false;
-	}
-
-	//! Determines if this shape has tetrahedrons
-	virtual bool needsRetrieveTetrahedrons() const
-	{
-		btAssert(0);
-		return false;
-	}
-
-	virtual void getBulletTriangle(int prim_index,btTriangleShapeEx & triangle) const
-	{
-        (void) prim_index; (void) triangle;
-		btAssert(0);
-	}
-
-	virtual void getBulletTetrahedron(int prim_index,btTetrahedronShapeEx & tetrahedron) const
-	{
-        (void) prim_index; (void) tetrahedron;
-		btAssert(0);
-	}
-
-	//! call when reading child shapes
-	virtual void lockChildShapes() const
-	{
-		btAssert(0);
-	}
-
-	virtual void unlockChildShapes() const
-	{
-		btAssert(0);
-	}
-
-
-
-
-	//! Retrieves the bound from a child
-    /*!
-    */
-    virtual void getChildAabb(int child_index,const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
-    {
-        (void) child_index; (void) t; (void) aabbMin; (void) aabbMax;
-        btAssert(0);
-    }
-
-	//! Gets the children
-	virtual btCollisionShape* getChildShape(int index)
-	{
-        (void) index;
-		btAssert(0);
-		return NULL;
-	}
-
-
-	//! Gets the child
-	virtual const btCollisionShape* getChildShape(int index) const
-	{
-        (void) index;
-		btAssert(0);
-		return NULL;
-	}
-
-	//! Gets the children transform
-	virtual btTransform	getChildTransform(int index) const
-	{
-        (void) index;
-		btAssert(0);
-		return btTransform();
-	}
-
-	//! Sets the children transform
-	/*!
-	\post You must call updateBound() for update the box set.
-	*/
-	virtual void setChildTransform(int index, const btTransform & transform)
-	{
-        (void) index; (void) transform;
-		btAssert(0);
-	}
-
-
-	virtual eGIMPACT_SHAPE_TYPE getGImpactShapeType() const
-	{
-		return CONST_GIMPACT_TRIMESH_SHAPE;
-	}
-
-
-	virtual const char*	getName()const
-	{
-		return "GImpactMesh";
-	}
-
-	virtual void rayTest(const btVector3& rayFrom, const btVector3& rayTo, btCollisionWorld::RayResultCallback& resultCallback)  const;
-
-	//! Function for retrieve triangles.
-	/*!
-	It gives the triangles in local space
-	*/
-	virtual void	processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const;
-
-	virtual	int	calculateSerializeBufferSize() const;
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
-
-};
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btGImpactMeshShapeData
-{
-	btCollisionShapeData	m_collisionShapeData;
-
-	btStridingMeshInterfaceData m_meshInterface;
-
-	btVector3FloatData	m_localScaling;
-
-	float	m_collisionMargin;
-
-	int		m_gimpactSubType;
-};
-
-SIMD_FORCE_INLINE	int	btGImpactMeshShape::calculateSerializeBufferSize() const
-{
-	return sizeof(btGImpactMeshShapeData);
-}
-
-
-#endif //GIMPACT_MESH_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGenericPoolAllocator.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btGenericPoolAllocator.h
deleted file mode 100644
index b46d851..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/btGenericPoolAllocator.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/*! \file btGenericPoolAllocator.h
-\author Francisco Leon Najera. email projectileman at yahoo.com
-
-General purpose allocator class
-*/
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_GENERIC_POOL_ALLOCATOR_H
-#define BT_GENERIC_POOL_ALLOCATOR_H
-
-#include <limits.h>
-#include <stdio.h>
-#include <string.h>
-#include "LinearMath/btAlignedAllocator.h"
-
-#define BT_UINT_MAX UINT_MAX
-#define BT_DEFAULT_MAX_POOLS 16
-
-
-//! Generic Pool class
-class btGenericMemoryPool
-{
-public:
-	unsigned char * m_pool; //[m_element_size*m_max_element_count];
-	size_t * m_free_nodes; //[m_max_element_count];//! free nodes
-	size_t * m_allocated_sizes;//[m_max_element_count];//! Number of elements allocated per node
-	size_t m_allocated_count;
-	size_t m_free_nodes_count;
-protected:
-	size_t m_element_size;
-	size_t m_max_element_count;
-
-	size_t allocate_from_free_nodes(size_t num_elements);
-	size_t allocate_from_pool(size_t num_elements);
-
-public:
-
-	void init_pool(size_t element_size, size_t element_count);
-
-	void end_pool();
-
-
-	btGenericMemoryPool(size_t element_size, size_t element_count)
-	{
-		init_pool(element_size, element_count);
-	}
-
-	~btGenericMemoryPool()
-	{
-		end_pool();
-	}
-
-
-	inline size_t get_pool_capacity()
-	{
-		return m_element_size*m_max_element_count;
-	}
-
-	inline size_t gem_element_size()
-	{
-		return m_element_size;
-	}
-
-	inline size_t get_max_element_count()
-	{
-		return m_max_element_count;
-	}
-
-	inline size_t get_allocated_count()
-	{
-		return m_allocated_count;
-	}
-
-	inline size_t get_free_positions_count()
-	{
-		return m_free_nodes_count;
-	}
-
-	inline void * get_element_data(size_t element_index)
-	{
-		return &m_pool[element_index*m_element_size];
-	}
-
-	//! Allocates memory in pool
-	/*!
-	\param size_bytes size in bytes of the buffer
-	*/
-	void * allocate(size_t size_bytes);
-
-	bool freeMemory(void * pointer);
-};
-
-
-
-
-//! Generic Allocator with pools
-/*!
-General purpose Allocator which can create Memory Pools dynamiacally as needed.
-*/
-class btGenericPoolAllocator
-{
-protected:
-	size_t m_pool_element_size;
-	size_t m_pool_element_count;
-public:
-	btGenericMemoryPool * m_pools[BT_DEFAULT_MAX_POOLS];
-	size_t m_pool_count;
-
-
-	inline size_t get_pool_capacity()
-	{
-		return m_pool_element_size*m_pool_element_count;
-	}
-
-
-protected:
-	// creates a pool
-	btGenericMemoryPool * push_new_pool();
-
-	void * failback_alloc(size_t size_bytes);
-
-	bool failback_free(void * pointer);
-public:
-
-	btGenericPoolAllocator(size_t pool_element_size, size_t pool_element_count)
-	{
-		m_pool_count = 0;
-		m_pool_element_size = pool_element_size;
-		m_pool_element_count = pool_element_count;
-	}
-
-	virtual ~btGenericPoolAllocator();
-
-	//! Allocates memory in pool
-	/*!
-	\param size_bytes size in bytes of the buffer
-	*/
-	void * allocate(size_t size_bytes);
-
-	bool freeMemory(void * pointer);
-};
-
-
-
-void * btPoolAlloc(size_t size);
-void * btPoolRealloc(void *ptr, size_t oldsize, size_t newsize);
-void btPoolFree(void *ptr);
-
-
-#endif
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGeometryOperations.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btGeometryOperations.h
deleted file mode 100644
index 60f0651..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/btGeometryOperations.h
+++ /dev/null
@@ -1,212 +0,0 @@
-#ifndef BT_BASIC_GEOMETRY_OPERATIONS_H_INCLUDED
-#define BT_BASIC_GEOMETRY_OPERATIONS_H_INCLUDED
-
-/*! \file btGeometryOperations.h
-*\author Francisco Leon Najera
-
-*/
-/*
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btBoxCollision.h"
-
-
-
-
-
-#define PLANEDIREPSILON 0.0000001f
-#define PARALELENORMALS 0.000001f
-
-
-#define BT_CLAMP(number,minval,maxval) (number<minval?minval:(number>maxval?maxval:number))
-
-/// Calc a plane from a triangle edge an a normal. plane is a vec4f
-SIMD_FORCE_INLINE void bt_edge_plane(const btVector3 & e1,const btVector3 &  e2, const btVector3 & normal,btVector4 & plane)
-{
-	btVector3 planenormal = (e2-e1).cross(normal);
-	planenormal.normalize();
-	plane.setValue(planenormal[0],planenormal[1],planenormal[2],e2.dot(planenormal));
-}
-
-
-
-//***************** SEGMENT and LINE FUNCTIONS **********************************///
-
-/*! Finds the closest point(cp) to (v) on a segment (e1,e2)
- */
-SIMD_FORCE_INLINE void bt_closest_point_on_segment(
-	btVector3 & cp, const btVector3 & v,
-	const btVector3  &e1,const btVector3 &e2)
-{
-    btVector3 n = e2-e1;
-    cp = v - e1;
-	btScalar _scalar = cp.dot(n)/n.dot(n);
-	if(_scalar <0.0f)
-	{
-	    cp = e1;
-	}
-	else if(_scalar >1.0f)
-	{
-	    cp = e2;
-	}
-	else
-	{
-		cp = _scalar*n + e1;
-	}
-}
-
-
-//! line plane collision
-/*!
-*\return
-	-0  if the ray never intersects
-	-1 if the ray collides in front
-	-2 if the ray collides in back
-*/
-
-SIMD_FORCE_INLINE int bt_line_plane_collision(
-	const btVector4 & plane,
-	const btVector3 & vDir,
-	const btVector3 & vPoint,
-	btVector3 & pout,
-	btScalar &tparam,
-	btScalar tmin, btScalar tmax)
-{
-
-	btScalar _dotdir = vDir.dot(plane);
-
-	if(btFabs(_dotdir)<PLANEDIREPSILON)
-	{
-		tparam = tmax;
-	    return 0;
-	}
-
-	btScalar _dis = bt_distance_point_plane(plane,vPoint);
-	char returnvalue = _dis<0.0f? 2:1;
-	tparam = -_dis/_dotdir;
-
-	if(tparam<tmin)
-	{
-		returnvalue = 0;
-		tparam = tmin;
-	}
-	else if(tparam>tmax)
-	{
-		returnvalue = 0;
-		tparam = tmax;
-	}
-	pout = tparam*vDir + vPoint;
-	return returnvalue;
-}
-
-
-//! Find closest points on segments
-SIMD_FORCE_INLINE void bt_segment_collision(
-	const btVector3 & vA1,
-	const btVector3 & vA2,
-	const btVector3 & vB1,
-	const btVector3 & vB2,
-	btVector3 & vPointA,
-	btVector3 & vPointB)
-{
-    btVector3 AD = vA2 - vA1;
-    btVector3 BD = vB2 - vB1;
-    btVector3 N = AD.cross(BD);
-    btScalar tp = N.length2();
-
-    btVector4 _M;//plane
-
-    if(tp<SIMD_EPSILON)//ARE PARALELE
-    {
-    	//project B over A
-    	bool invert_b_order = false;
-    	_M[0] = vB1.dot(AD);
-    	_M[1] = vB2.dot(AD);
-
-    	if(_M[0]>_M[1])
-    	{
-    		invert_b_order  = true;
-    		BT_SWAP_NUMBERS(_M[0],_M[1]);
-    	}
-    	_M[2] = vA1.dot(AD);
-    	_M[3] = vA2.dot(AD);
-    	//mid points
-    	N[0] = (_M[0]+_M[1])*0.5f;
-    	N[1] = (_M[2]+_M[3])*0.5f;
-
-    	if(N[0]<N[1])
-    	{
-    		if(_M[1]<_M[2])
-    		{
-    			vPointB = invert_b_order?vB1:vB2;
-    			vPointA = vA1;
-    		}
-    		else if(_M[1]<_M[3])
-    		{
-    			vPointB = invert_b_order?vB1:vB2;
-    			bt_closest_point_on_segment(vPointA,vPointB,vA1,vA2);
-    		}
-    		else
-    		{
-    			vPointA = vA2;
-    			bt_closest_point_on_segment(vPointB,vPointA,vB1,vB2);
-    		}
-    	}
-    	else
-    	{
-    		if(_M[3]<_M[0])
-    		{
-    			vPointB = invert_b_order?vB2:vB1;
-    			vPointA = vA2;
-    		}
-    		else if(_M[3]<_M[1])
-    		{
-    			vPointA = vA2;
-    			bt_closest_point_on_segment(vPointB,vPointA,vB1,vB2);
-    		}
-    		else
-    		{
-    			vPointB = invert_b_order?vB1:vB2;
-    			bt_closest_point_on_segment(vPointA,vPointB,vA1,vA2);
-    		}
-    	}
-    	return;
-    }
-
-    N = N.cross(BD);
-    _M.setValue(N[0],N[1],N[2],vB1.dot(N));
-
-	// get point A as the plane collision point
-    bt_line_plane_collision(_M,AD,vA1,vPointA,tp,btScalar(0), btScalar(1));
-
-    /*Closest point on segment*/
-    vPointB = vPointA - vB1;
-	tp = vPointB.dot(BD);
-	tp/= BD.dot(BD);
-	tp = BT_CLAMP(tp,0.0f,1.0f);
-
-	vPointB = tp*BD + vB1;
-}
-
-
-
-
-
-#endif // GIM_VECTOR_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btQuantization.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btQuantization.h
deleted file mode 100644
index bd2633c..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/btQuantization.h
+++ /dev/null
@@ -1,88 +0,0 @@
-#ifndef BT_GIMPACT_QUANTIZATION_H_INCLUDED
-#define BT_GIMPACT_QUANTIZATION_H_INCLUDED
-
-/*! \file btQuantization.h
-*\author Francisco Leon Najera
-
-*/
-/*
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "LinearMath/btTransform.h"
-
-
-
-
-
-
-SIMD_FORCE_INLINE void bt_calc_quantization_parameters(
-	btVector3 & outMinBound,
-	btVector3 & outMaxBound,
-	btVector3 & bvhQuantization,
-	const btVector3& srcMinBound,const btVector3& srcMaxBound,
-	btScalar quantizationMargin)
-{
-	//enlarge the AABB to avoid division by zero when initializing the quantization values
-	btVector3 clampValue(quantizationMargin,quantizationMargin,quantizationMargin);
-	outMinBound = srcMinBound - clampValue;
-	outMaxBound = srcMaxBound + clampValue;
-	btVector3 aabbSize = outMaxBound - outMinBound;
-	bvhQuantization = btVector3(btScalar(65535.0),
-								btScalar(65535.0),
-								btScalar(65535.0)) / aabbSize;
-}
-
-
-SIMD_FORCE_INLINE void bt_quantize_clamp(
-	unsigned short* out,
-	const btVector3& point,
-	const btVector3 & min_bound,
-	const btVector3 & max_bound,
-	const btVector3 & bvhQuantization)
-{
-
-	btVector3 clampedPoint(point);
-	clampedPoint.setMax(min_bound);
-	clampedPoint.setMin(max_bound);
-
-	btVector3 v = (clampedPoint - min_bound) * bvhQuantization;
-	out[0] = (unsigned short)(v.getX()+0.5f);
-	out[1] = (unsigned short)(v.getY()+0.5f);
-	out[2] = (unsigned short)(v.getZ()+0.5f);
-}
-
-
-SIMD_FORCE_INLINE btVector3 bt_unquantize(
-	const unsigned short* vecIn,
-	const btVector3 & offset,
-	const btVector3 & bvhQuantization)
-{
-	btVector3	vecOut;
-	vecOut.setValue(
-		(btScalar)(vecIn[0]) / (bvhQuantization.getX()),
-		(btScalar)(vecIn[1]) / (bvhQuantization.getY()),
-		(btScalar)(vecIn[2]) / (bvhQuantization.getZ()));
-	vecOut += offset;
-	return vecOut;
-}
-
-
-
-#endif // BT_GIMPACT_QUANTIZATION_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btTriangleShapeEx.cpp b/hkl3d/bullet/src/BulletCollision/Gimpact/btTriangleShapeEx.cpp
deleted file mode 100644
index ca76cc5..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/btTriangleShapeEx.cpp
+++ /dev/null
@@ -1,218 +0,0 @@
-/*! \file btGImpactTriangleShape.h
-\author Francisco Leon Najera
-*/
-/*
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btTriangleShapeEx.h"
-
-
-
-void GIM_TRIANGLE_CONTACT::merge_points(const btVector4 & plane,
-                                       btScalar margin, const btVector3 * points, int point_count)
-{
-    m_point_count = 0;
-    m_penetration_depth= -1000.0f;
-
-    int point_indices[MAX_TRI_CLIPPING];
-
-	int _k;
-
-    for ( _k=0;_k<point_count;_k++)
-    {
-        btScalar _dist = - bt_distance_point_plane(plane,points[_k]) + margin;
-
-        if (_dist>=0.0f)
-        {
-            if (_dist>m_penetration_depth)
-            {
-                m_penetration_depth = _dist;
-                point_indices[0] = _k;
-                m_point_count=1;
-            }
-            else if ((_dist+SIMD_EPSILON)>=m_penetration_depth)
-            {
-                point_indices[m_point_count] = _k;
-                m_point_count++;
-            }
-        }
-    }
-
-    for ( _k=0;_k<m_point_count;_k++)
-    {
-        m_points[_k] = points[point_indices[_k]];
-    }
-}
-
-///class btPrimitiveTriangle
-bool btPrimitiveTriangle::overlap_test_conservative(const btPrimitiveTriangle& other)
-{
-    btScalar total_margin = m_margin + other.m_margin;
-    // classify points on other triangle
-    btScalar dis0 = bt_distance_point_plane(m_plane,other.m_vertices[0]) - total_margin;
-
-    btScalar dis1 = bt_distance_point_plane(m_plane,other.m_vertices[1]) - total_margin;
-
-    btScalar dis2 = bt_distance_point_plane(m_plane,other.m_vertices[2]) - total_margin;
-
-    if (dis0>0.0f&&dis1>0.0f&&dis2>0.0f) return false;
-
-    // classify points on this triangle
-    dis0 = bt_distance_point_plane(other.m_plane,m_vertices[0]) - total_margin;
-
-    dis1 = bt_distance_point_plane(other.m_plane,m_vertices[1]) - total_margin;
-
-    dis2 = bt_distance_point_plane(other.m_plane,m_vertices[2]) - total_margin;
-
-    if (dis0>0.0f&&dis1>0.0f&&dis2>0.0f) return false;
-
-    return true;
-}
-
-int btPrimitiveTriangle::clip_triangle(btPrimitiveTriangle & other, btVector3 * clipped_points )
-{
-    // edge 0
-
-    btVector3 temp_points[MAX_TRI_CLIPPING];
-
-
-    btVector4 edgeplane;
-
-    get_edge_plane(0,edgeplane);
-
-
-    int clipped_count = bt_plane_clip_triangle(
-                            edgeplane,other.m_vertices[0],other.m_vertices[1],other.m_vertices[2],temp_points);
-
-    if (clipped_count == 0) return 0;
-
-    btVector3 temp_points1[MAX_TRI_CLIPPING];
-
-
-    // edge 1
-    get_edge_plane(1,edgeplane);
-
-
-    clipped_count = bt_plane_clip_polygon(edgeplane,temp_points,clipped_count,temp_points1);
-
-    if (clipped_count == 0) return 0;
-
-    // edge 2
-    get_edge_plane(2,edgeplane);
-
-    clipped_count = bt_plane_clip_polygon(
-                        edgeplane,temp_points1,clipped_count,clipped_points);
-
-    return clipped_count;
-}
-
-bool btPrimitiveTriangle::find_triangle_collision_clip_method(btPrimitiveTriangle & other, GIM_TRIANGLE_CONTACT & contacts)
-{
-    btScalar margin = m_margin + other.m_margin;
-
-    btVector3 clipped_points[MAX_TRI_CLIPPING];
-    int clipped_count;
-    //create planes
-    // plane v vs U points
-
-    GIM_TRIANGLE_CONTACT contacts1;
-
-    contacts1.m_separating_normal = m_plane;
-
-
-    clipped_count = clip_triangle(other,clipped_points);
-
-    if (clipped_count == 0 )
-    {
-        return false;//Reject
-    }
-
-    //find most deep interval face1
-    contacts1.merge_points(contacts1.m_separating_normal,margin,clipped_points,clipped_count);
-    if (contacts1.m_point_count == 0) return false; // too far
-    //Normal pointing to this triangle
-    contacts1.m_separating_normal *= -1.f;
-
-
-    //Clip tri1 by tri2 edges
-    GIM_TRIANGLE_CONTACT contacts2;
-    contacts2.m_separating_normal = other.m_plane;
-
-    clipped_count = other.clip_triangle(*this,clipped_points);
-
-    if (clipped_count == 0 )
-    {
-        return false;//Reject
-    }
-
-    //find most deep interval face1
-    contacts2.merge_points(contacts2.m_separating_normal,margin,clipped_points,clipped_count);
-    if (contacts2.m_point_count == 0) return false; // too far
-
-
-
-
-    ////check most dir for contacts
-    if (contacts2.m_penetration_depth<contacts1.m_penetration_depth)
-    {
-        contacts.copy_from(contacts2);
-    }
-    else
-    {
-        contacts.copy_from(contacts1);
-    }
-    return true;
-}
-
-
-
-///class btTriangleShapeEx: public btTriangleShape
-
-bool btTriangleShapeEx::overlap_test_conservative(const btTriangleShapeEx& other)
-{
-    btScalar total_margin = getMargin() + other.getMargin();
-
-    btVector4 plane0;
-    buildTriPlane(plane0);
-    btVector4 plane1;
-    other.buildTriPlane(plane1);
-
-    // classify points on other triangle
-    btScalar dis0 = bt_distance_point_plane(plane0,other.m_vertices1[0]) - total_margin;
-
-    btScalar dis1 = bt_distance_point_plane(plane0,other.m_vertices1[1]) - total_margin;
-
-    btScalar dis2 = bt_distance_point_plane(plane0,other.m_vertices1[2]) - total_margin;
-
-    if (dis0>0.0f&&dis1>0.0f&&dis2>0.0f) return false;
-
-    // classify points on this triangle
-    dis0 = bt_distance_point_plane(plane1,m_vertices1[0]) - total_margin;
-
-    dis1 = bt_distance_point_plane(plane1,m_vertices1[1]) - total_margin;
-
-    dis2 = bt_distance_point_plane(plane1,m_vertices1[2]) - total_margin;
-
-    if (dis0>0.0f&&dis1>0.0f&&dis2>0.0f) return false;
-
-    return true;
-}
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btTriangleShapeEx.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btTriangleShapeEx.h
deleted file mode 100644
index 973c2ed..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/btTriangleShapeEx.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/*! \file btGImpactShape.h
-\author Francisco Leon Najera
-*/
-/*
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef GIMPACT_TRIANGLE_SHAPE_EX_H
-#define GIMPACT_TRIANGLE_SHAPE_EX_H
-
-#include "BulletCollision/CollisionShapes/btCollisionShape.h"
-#include "BulletCollision/CollisionShapes/btTriangleShape.h"
-#include "btBoxCollision.h"
-#include "btClipPolygon.h"
-#include "btGeometryOperations.h"
-
-
-#define MAX_TRI_CLIPPING 16
-
-//! Structure for collision
-struct GIM_TRIANGLE_CONTACT
-{
-    btScalar m_penetration_depth;
-    int m_point_count;
-    btVector4 m_separating_normal;
-    btVector3 m_points[MAX_TRI_CLIPPING];
-
-	SIMD_FORCE_INLINE void copy_from(const GIM_TRIANGLE_CONTACT& other)
-	{
-		m_penetration_depth = other.m_penetration_depth;
-		m_separating_normal = other.m_separating_normal;
-		m_point_count = other.m_point_count;
-		int i = m_point_count;
-		while(i--)
-		{
-			m_points[i] = other.m_points[i];
-		}
-	}
-
-	GIM_TRIANGLE_CONTACT()
-	{
-	}
-
-	GIM_TRIANGLE_CONTACT(const GIM_TRIANGLE_CONTACT& other)
-	{
-		copy_from(other);
-	}
-
-    //! classify points that are closer
-    void merge_points(const btVector4 & plane,
-    				btScalar margin, const btVector3 * points, int point_count);
-
-};
-
-
-
-class btPrimitiveTriangle
-{
-public:
-	btVector3 m_vertices[3];
-	btVector4 m_plane;
-	btScalar m_margin;
-	btScalar m_dummy;
-	btPrimitiveTriangle():m_margin(0.01f)
-	{
-
-	}
-
-
-	SIMD_FORCE_INLINE void buildTriPlane()
-	{
-		btVector3 normal = (m_vertices[1]-m_vertices[0]).cross(m_vertices[2]-m_vertices[0]);
-		normal.normalize();
-		m_plane.setValue(normal[0],normal[1],normal[2],m_vertices[0].dot(normal));
-	}
-
-	//! Test if triangles could collide
-	bool overlap_test_conservative(const btPrimitiveTriangle& other);
-
-	//! Calcs the plane which is paralele to the edge and perpendicular to the triangle plane
-	/*!
-	\pre this triangle must have its plane calculated.
-	*/
-	SIMD_FORCE_INLINE void get_edge_plane(int edge_index, btVector4 &plane)  const
-    {
-		const btVector3 & e0 = m_vertices[edge_index];
-		const btVector3 & e1 = m_vertices[(edge_index+1)%3];
-		bt_edge_plane(e0,e1,m_plane,plane);
-    }
-
-    void applyTransform(const btTransform& t)
-	{
-		m_vertices[0] = t(m_vertices[0]);
-		m_vertices[1] = t(m_vertices[1]);
-		m_vertices[2] = t(m_vertices[2]);
-	}
-
-	//! Clips the triangle against this
-	/*!
-	\pre clipped_points must have MAX_TRI_CLIPPING size, and this triangle must have its plane calculated.
-	\return the number of clipped points
-	*/
-    int clip_triangle(btPrimitiveTriangle & other, btVector3 * clipped_points );
-
-	//! Find collision using the clipping method
-	/*!
-	\pre this triangle and other must have their triangles calculated
-	*/
-    bool find_triangle_collision_clip_method(btPrimitiveTriangle & other, GIM_TRIANGLE_CONTACT & contacts);
-};
-
-
-
-//! Helper class for colliding Bullet Triangle Shapes
-/*!
-This class implements a better getAabb method than the previous btTriangleShape class
-*/
-class btTriangleShapeEx: public btTriangleShape
-{
-public:
-
-	btTriangleShapeEx():btTriangleShape(btVector3(0,0,0),btVector3(0,0,0),btVector3(0,0,0))
-	{
-	}
-
-	btTriangleShapeEx(const btVector3& p0,const btVector3& p1,const btVector3& p2):	btTriangleShape(p0,p1,p2)
-	{
-	}
-
-	btTriangleShapeEx(const btTriangleShapeEx & other):	btTriangleShape(other.m_vertices1[0],other.m_vertices1[1],other.m_vertices1[2])
-	{
-	}
-
-	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax)const
-	{
-		btVector3 tv0 = t(m_vertices1[0]);
-		btVector3 tv1 = t(m_vertices1[1]);
-		btVector3 tv2 = t(m_vertices1[2]);
-
-		btAABB trianglebox(tv0,tv1,tv2,m_collisionMargin);
-		aabbMin = trianglebox.m_min;
-		aabbMax = trianglebox.m_max;
-	}
-
-	void applyTransform(const btTransform& t)
-	{
-		m_vertices1[0] = t(m_vertices1[0]);
-		m_vertices1[1] = t(m_vertices1[1]);
-		m_vertices1[2] = t(m_vertices1[2]);
-	}
-
-	SIMD_FORCE_INLINE void buildTriPlane(btVector4 & plane) const
-	{
-		btVector3 normal = (m_vertices1[1]-m_vertices1[0]).cross(m_vertices1[2]-m_vertices1[0]);
-		normal.normalize();
-		plane.setValue(normal[0],normal[1],normal[2],m_vertices1[0].dot(normal));
-	}
-
-	bool overlap_test_conservative(const btTriangleShapeEx& other);
-};
-
-
-#endif //GIMPACT_TRIANGLE_MESH_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_array.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_array.h
deleted file mode 100644
index cfd5da8..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_array.h
+++ /dev/null
@@ -1,326 +0,0 @@
-#ifndef GIM_ARRAY_H_INCLUDED
-#define GIM_ARRAY_H_INCLUDED
-/*! \file gim_array.h
-\author Francisco Leon Najera
-*/
-/*
------------------------------------------------------------------------------
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of EITHER:
-   (1) The GNU Lesser General Public License as published by the Free
-       Software Foundation; either version 2.1 of the License, or (at
-       your option) any later version. The text of the GNU Lesser
-       General Public License is included with this library in the
-       file GIMPACT-LICENSE-LGPL.TXT.
-   (2) The BSD-style license that is included with this library in
-       the file GIMPACT-LICENSE-BSD.TXT.
-   (3) The zlib/libpng license that is included with this library in
-       the file GIMPACT-LICENSE-ZLIB.TXT.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
-
------------------------------------------------------------------------------
-*/
-
-#include "gim_memory.h"
-
-
-#define GIM_ARRAY_GROW_INCREMENT 2
-#define GIM_ARRAY_GROW_FACTOR 2
-
-//!	Very simple array container with fast access and simd memory
-template<typename T>
-class gim_array
-{
-public:
-//! properties
-//!@{
-    T *m_data;
-    GUINT m_size;
-    GUINT m_allocated_size;
-//!@}
-//! protected operations
-//!@{
-
-    inline void destroyData()
-	{
-	    m_allocated_size = 0;
-		if(m_data==NULL) return;
-		gim_free(m_data);
-		m_data = NULL;
-	}
-
-	inline bool resizeData(GUINT newsize)
-	{
-		if(newsize==0)
-		{
-			destroyData();
-			return true;
-		}
-
-		if(m_size>0)
-		{
-            m_data = (T*)gim_realloc(m_data,m_size*sizeof(T),newsize*sizeof(T));
-		}
-		else
-		{
-		    m_data = (T*)gim_alloc(newsize*sizeof(T));
-		}
-		m_allocated_size = newsize;
-		return true;
-	}
-
-	inline bool growingCheck()
-	{
-		if(m_allocated_size<=m_size)
-		{
-		    GUINT requestsize = m_size;
-		    m_size = m_allocated_size;
-			if(resizeData((requestsize+GIM_ARRAY_GROW_INCREMENT)*GIM_ARRAY_GROW_FACTOR)==false) return false;
-		}
-		return true;
-	}
-
-//!@}
-//! public operations
-//!@{
-    inline  bool reserve(GUINT size)
-    {
-        if(m_allocated_size>=size) return false;
-        return resizeData(size);
-    }
-
-    inline void clear_range(GUINT start_range)
-    {
-        while(m_size>start_range)
-        {
-            m_data[--m_size].~T();
-        }
-    }
-
-    inline void clear()
-    {
-        if(m_size==0)return;
-        clear_range(0);
-    }
-
-    inline void clear_memory()
-    {
-        clear();
-        destroyData();
-    }
-
-    gim_array()
-    {
-        m_data = 0;
-        m_size = 0;
-        m_allocated_size = 0;
-    }
-
-    gim_array(GUINT reservesize)
-    {
-        m_data = 0;
-        m_size = 0;
-
-        m_allocated_size = 0;
-        reserve(reservesize);
-    }
-
-    ~gim_array()
-    {
-        clear_memory();
-    }
-
-    inline GUINT size() const
-    {
-        return m_size;
-    }
-
-    inline GUINT max_size() const
-    {
-        return m_allocated_size;
-    }
-
-    inline T & operator[](size_t i)
-	{
-		return m_data[i];
-	}
-	inline  const T & operator[](size_t i) const
-	{
-		return m_data[i];
-	}
-
-    inline T * pointer(){ return m_data;}
-    inline const T * pointer() const
-    { return m_data;}
-
-
-    inline T * get_pointer_at(GUINT i)
-	{
-		return m_data + i;
-	}
-
-	inline const T * get_pointer_at(GUINT i) const
-	{
-		return m_data + i;
-	}
-
-	inline T & at(GUINT i)
-	{
-		return m_data[i];
-	}
-
-	inline const T & at(GUINT i) const
-	{
-		return m_data[i];
-	}
-
-	inline T & front()
-	{
-		return *m_data;
-	}
-
-	inline const T & front() const
-	{
-		return *m_data;
-	}
-
-	inline T & back()
-	{
-		return m_data[m_size-1];
-	}
-
-	inline const T & back() const
-	{
-		return m_data[m_size-1];
-	}
-
-
-	inline void swap(GUINT i, GUINT j)
-	{
-	    gim_swap_elements(m_data,i,j);
-	}
-
-	inline void push_back(const T & obj)
-	{
-	    this->growingCheck();
-	    m_data[m_size] = obj;
-	    m_size++;
-	}
-
-	//!Simply increase the m_size, doesn't call the new element constructor
-	inline void push_back_mem()
-	{
-	    this->growingCheck();
-	    m_size++;
-	}
-
-	inline void push_back_memcpy(const T & obj)
-	{
-	    this->growingCheck();
-	    irr_simd_memcpy(&m_data[m_size],&obj,sizeof(T));
-	    m_size++;
-	}
-
-	inline void pop_back()
-	{
-	    m_size--;
-        m_data[m_size].~T();
-	}
-
-	//!Simply decrease the m_size, doesn't call the deleted element destructor
-	inline void pop_back_mem()
-	{
-	    m_size--;
-	}
-
-    //! fast erase
-	inline void erase(GUINT index)
-	{
-	    if(index<m_size-1)
-	    {
-	        swap(index,m_size-1);
-	    }
-	    pop_back();
-	}
-
-	inline void erase_sorted_mem(GUINT index)
-	{
-	    m_size--;
-	    for(GUINT i = index;i<m_size;i++)
-	    {
-	        gim_simd_memcpy(m_data+i,m_data+i+1,sizeof(T));
-	    }
-	}
-
-	inline void erase_sorted(GUINT index)
-	{
-	    m_data[index].~T();
-	    erase_sorted_mem(index);
-	}
-
-	inline void insert_mem(GUINT index)
-	{
-	    this->growingCheck();
-	    for(GUINT i = m_size;i>index;i--)
-	    {
-	        gim_simd_memcpy(m_data+i,m_data+i-1,sizeof(T));
-	    }
-	    m_size++;
-	}
-
-	inline void insert(const T & obj,GUINT index)
-	{
-	    insert_mem(index);
-	    m_data[index] = obj;
-	}
-
-	inline void resize(GUINT size, bool call_constructor = true)
-	{
-
-	    if(size>m_size)
-	    {
-            reserve(size);
-            if(call_constructor)
-            {
-            	T obj;
-                while(m_size<size)
-                {
-                    m_data[m_size] = obj;
-                    m_size++;
-                }
-            }
-            else
-            {
-            	m_size = size;
-            }
-	    }
-	    else if(size<m_size)
-	    {
-	        if(call_constructor) clear_range(size);
-	        m_size = size;
-	    }
-	}
-
-	inline void refit()
-	{
-	    resizeData(m_size);
-	}
-
-};
-
-
-
-
-
-#endif // GIM_CONTAINERS_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_basic_geometry_operations.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_basic_geometry_operations.h
deleted file mode 100644
index 9152774..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_basic_geometry_operations.h
+++ /dev/null
@@ -1,543 +0,0 @@
-#ifndef GIM_BASIC_GEOMETRY_OPERATIONS_H_INCLUDED
-#define GIM_BASIC_GEOMETRY_OPERATIONS_H_INCLUDED
-
-/*! \file gim_basic_geometry_operations.h
-*\author Francisco Leon Najera
-type independant geometry routines
-
-*/
-/*
------------------------------------------------------------------------------
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of EITHER:
-   (1) The GNU Lesser General Public License as published by the Free
-       Software Foundation; either version 2.1 of the License, or (at
-       your option) any later version. The text of the GNU Lesser
-       General Public License is included with this library in the
-       file GIMPACT-LICENSE-LGPL.TXT.
-   (2) The BSD-style license that is included with this library in
-       the file GIMPACT-LICENSE-BSD.TXT.
-   (3) The zlib/libpng license that is included with this library in
-       the file GIMPACT-LICENSE-ZLIB.TXT.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
-
------------------------------------------------------------------------------
-*/
-
-
-#include "gim_linear_math.h"
-
-
-
-
-
-#define PLANEDIREPSILON 0.0000001f
-#define PARALELENORMALS 0.000001f
-
-
-#define TRIANGLE_NORMAL(v1,v2,v3,n)\
-{\
-	vec3f _dif1,_dif2;\
-    VEC_DIFF(_dif1,v2,v1);\
-    VEC_DIFF(_dif2,v3,v1);\
-    VEC_CROSS(n,_dif1,_dif2);\
-    VEC_NORMALIZE(n);\
-}\
-
-#define TRIANGLE_NORMAL_FAST(v1,v2,v3,n){\
-    vec3f _dif1,_dif2; \
-    VEC_DIFF(_dif1,v2,v1); \
-    VEC_DIFF(_dif2,v3,v1); \
-    VEC_CROSS(n,_dif1,_dif2); \
-}\
-
-/// plane is a vec4f
-#define TRIANGLE_PLANE(v1,v2,v3,plane) {\
-    TRIANGLE_NORMAL(v1,v2,v3,plane);\
-    plane[3] = VEC_DOT(v1,plane);\
-}\
-
-/// plane is a vec4f
-#define TRIANGLE_PLANE_FAST(v1,v2,v3,plane) {\
-    TRIANGLE_NORMAL_FAST(v1,v2,v3,plane);\
-    plane[3] = VEC_DOT(v1,plane);\
-}\
-
-/// Calc a plane from an edge an a normal. plane is a vec4f
-#define EDGE_PLANE(e1,e2,n,plane) {\
-    vec3f _dif; \
-    VEC_DIFF(_dif,e2,e1); \
-    VEC_CROSS(plane,_dif,n); \
-    VEC_NORMALIZE(plane); \
-    plane[3] = VEC_DOT(e1,plane);\
-}\
-
-#define DISTANCE_PLANE_POINT(plane,point) (VEC_DOT(plane,point) - plane[3])
-
-#define PROJECT_POINT_PLANE(point,plane,projected) {\
-	GREAL _dis;\
-	_dis = DISTANCE_PLANE_POINT(plane,point);\
-	VEC_SCALE(projected,-_dis,plane);\
-	VEC_SUM(projected,projected,point);	\
-}\
-
-//! Verifies if a point is in the plane hull
-template<typename CLASS_POINT,typename CLASS_PLANE>
-SIMD_FORCE_INLINE bool POINT_IN_HULL(
-	const CLASS_POINT& point,const CLASS_PLANE * planes,GUINT plane_count)
-{
-	GREAL _dis;
-	for (GUINT _i = 0;_i< plane_count;++_i)
-	{
-		_dis = DISTANCE_PLANE_POINT(planes[_i],point);
-	    if(_dis>0.0f) return false;
-	}
-	return true;
-}
-
-template<typename CLASS_POINT,typename CLASS_PLANE>
-SIMD_FORCE_INLINE void PLANE_CLIP_SEGMENT(
-	const CLASS_POINT& s1,
-	const CLASS_POINT &s2,const CLASS_PLANE &plane,CLASS_POINT &clipped)
-{
-	GREAL _dis1,_dis2;
-	_dis1 = DISTANCE_PLANE_POINT(plane,s1);
-	VEC_DIFF(clipped,s2,s1);
-	_dis2 = VEC_DOT(clipped,plane);
-	VEC_SCALE(clipped,-_dis1/_dis2,clipped);
-	VEC_SUM(clipped,clipped,s1);
-}
-
-enum ePLANE_INTERSECTION_TYPE
-{
-	G_BACK_PLANE = 0,
-	G_COLLIDE_PLANE,
-	G_FRONT_PLANE
-};
-
-enum eLINE_PLANE_INTERSECTION_TYPE
-{
-	G_FRONT_PLANE_S1 = 0,
-	G_FRONT_PLANE_S2,
-	G_BACK_PLANE_S1,
-	G_BACK_PLANE_S2,
-	G_COLLIDE_PLANE_S1,
-	G_COLLIDE_PLANE_S2
-};
-
-//! Confirms if the plane intersect the edge or nor
-/*!
-intersection type must have the following values
-<ul>
-<li> 0 : Segment in front of plane, s1 closest
-<li> 1 : Segment in front of plane, s2 closest
-<li> 2 : Segment in back of plane, s1 closest
-<li> 3 : Segment in back of plane, s2 closest
-<li> 4 : Segment collides plane, s1 in back
-<li> 5 : Segment collides plane, s2 in back
-</ul>
-*/
-
-template<typename CLASS_POINT,typename CLASS_PLANE>
-SIMD_FORCE_INLINE eLINE_PLANE_INTERSECTION_TYPE PLANE_CLIP_SEGMENT2(
-	const CLASS_POINT& s1,
-	const CLASS_POINT &s2,
-	const CLASS_PLANE &plane,CLASS_POINT &clipped)
-{
-	GREAL _dis1 = DISTANCE_PLANE_POINT(plane,s1);
-	GREAL _dis2 = DISTANCE_PLANE_POINT(plane,s2);
-	if(_dis1 >-G_EPSILON && _dis2 >-G_EPSILON)
-	{
-	    if(_dis1<_dis2) return G_FRONT_PLANE_S1;
-	    return G_FRONT_PLANE_S2;
-	}
-	else if(_dis1 <G_EPSILON && _dis2 <G_EPSILON)
-	{
-	    if(_dis1>_dis2) return G_BACK_PLANE_S1;
-	    return G_BACK_PLANE_S2;
-	}
-
-	VEC_DIFF(clipped,s2,s1);
-	_dis2 = VEC_DOT(clipped,plane);
-	VEC_SCALE(clipped,-_dis1/_dis2,clipped);
-	VEC_SUM(clipped,clipped,s1);
-	if(_dis1<_dis2) return G_COLLIDE_PLANE_S1;
-	return G_COLLIDE_PLANE_S2;
-}
-
-//! Confirms if the plane intersect the edge or not
-/*!
-clipped1 and clipped2 are the vertices behind the plane.
-clipped1 is the closest
-
-intersection_type must have the following values
-<ul>
-<li> 0 : Segment in front of plane, s1 closest
-<li> 1 : Segment in front of plane, s2 closest
-<li> 2 : Segment in back of plane, s1 closest
-<li> 3 : Segment in back of plane, s2 closest
-<li> 4 : Segment collides plane, s1 in back
-<li> 5 : Segment collides plane, s2 in back
-</ul>
-*/
-template<typename CLASS_POINT,typename CLASS_PLANE>
-SIMD_FORCE_INLINE eLINE_PLANE_INTERSECTION_TYPE PLANE_CLIP_SEGMENT_CLOSEST(
-	const CLASS_POINT& s1,
-	const CLASS_POINT &s2,
-	const CLASS_PLANE &plane,
-	CLASS_POINT &clipped1,CLASS_POINT &clipped2)
-{
-	eLINE_PLANE_INTERSECTION_TYPE intersection_type = PLANE_CLIP_SEGMENT2(s1,s2,plane,clipped1);
-	switch(intersection_type)
-	{
-	case G_FRONT_PLANE_S1:
-		VEC_COPY(clipped1,s1);
-	    VEC_COPY(clipped2,s2);
-		break;
-	case G_FRONT_PLANE_S2:
-		VEC_COPY(clipped1,s2);
-	    VEC_COPY(clipped2,s1);
-		break;
-	case G_BACK_PLANE_S1:
-		VEC_COPY(clipped1,s1);
-	    VEC_COPY(clipped2,s2);
-		break;
-	case G_BACK_PLANE_S2:
-		VEC_COPY(clipped1,s2);
-	    VEC_COPY(clipped2,s1);
-		break;
-	case G_COLLIDE_PLANE_S1:
-		VEC_COPY(clipped2,s1);
-		break;
-	case G_COLLIDE_PLANE_S2:
-		VEC_COPY(clipped2,s2);
-		break;
-	}
-	return intersection_type;
-}
-
-
-//! Finds the 2 smallest cartesian coordinates of a plane normal
-#define PLANE_MINOR_AXES(plane, i0, i1) VEC_MINOR_AXES(plane, i0, i1)
-
-//! Ray plane collision in one way
-/*!
-Intersects plane in one way only. The ray must face the plane (normals must be in opossite directions).<br/>
-It uses the PLANEDIREPSILON constant.
-*/
-template<typename T,typename CLASS_POINT,typename CLASS_PLANE>
-SIMD_FORCE_INLINE bool RAY_PLANE_COLLISION(
-	const CLASS_PLANE & plane,
-	const CLASS_POINT & vDir,
-	const CLASS_POINT & vPoint,
-	CLASS_POINT & pout,T &tparam)
-{
-	GREAL _dis,_dotdir;
-	_dotdir = VEC_DOT(plane,vDir);
-	if(_dotdir<PLANEDIREPSILON)
-	{
-	    return false;
-	}
-	_dis = DISTANCE_PLANE_POINT(plane,vPoint);
-	tparam = -_dis/_dotdir;
-	VEC_SCALE(pout,tparam,vDir);
-	VEC_SUM(pout,vPoint,pout);
-	return true;
-}
-
-//! line collision
-/*!
-*\return
-	-0  if the ray never intersects
-	-1 if the ray collides in front
-	-2 if the ray collides in back
-*/
-template<typename T,typename CLASS_POINT,typename CLASS_PLANE>
-SIMD_FORCE_INLINE GUINT LINE_PLANE_COLLISION(
-	const CLASS_PLANE & plane,
-	const CLASS_POINT & vDir,
-	const CLASS_POINT & vPoint,
-	CLASS_POINT & pout,
-	T &tparam,
-	T tmin, T tmax)
-{
-	GREAL _dis,_dotdir;
-	_dotdir = VEC_DOT(plane,vDir);
-	if(btFabs(_dotdir)<PLANEDIREPSILON)
-	{
-		tparam = tmax;
-	    return 0;
-	}
-	_dis = DISTANCE_PLANE_POINT(plane,vPoint);
-	char returnvalue = _dis<0.0f?2:1;
-	tparam = -_dis/_dotdir;
-
-	if(tparam<tmin)
-	{
-		returnvalue = 0;
-		tparam = tmin;
-	}
-	else if(tparam>tmax)
-	{
-		returnvalue = 0;
-		tparam = tmax;
-	}
-
-	VEC_SCALE(pout,tparam,vDir);
-	VEC_SUM(pout,vPoint,pout);
-	return returnvalue;
-}
-
-/*! \brief Returns the Ray on which 2 planes intersect if they do.
-    Written by Rodrigo Hernandez on ODE convex collision
-
-  \param p1 Plane 1
-  \param p2 Plane 2
-  \param p Contains the origin of the ray upon returning if planes intersect
-  \param d Contains the direction of the ray upon returning if planes intersect
-  \return true if the planes intersect, 0 if paralell.
-
-*/
-template<typename CLASS_POINT,typename CLASS_PLANE>
-SIMD_FORCE_INLINE bool INTERSECT_PLANES(
-		const CLASS_PLANE &p1,
-		const CLASS_PLANE &p2,
-		CLASS_POINT &p,
-		CLASS_POINT &d)
-{
-	VEC_CROSS(d,p1,p2);
-  	GREAL denom = VEC_DOT(d, d);
-  	if(GIM_IS_ZERO(denom)) return false;
-	vec3f _n;
-	_n[0]=p1[3]*p2[0] - p2[3]*p1[0];
-	_n[1]=p1[3]*p2[1] - p2[3]*p1[1];
-	_n[2]=p1[3]*p2[2] - p2[3]*p1[2];
-	VEC_CROSS(p,_n,d);
-	p[0]/=denom;
-	p[1]/=denom;
-	p[2]/=denom;
-	return true;
-}
-
-//***************** SEGMENT and LINE FUNCTIONS **********************************///
-
-/*! Finds the closest point(cp) to (v) on a segment (e1,e2)
- */
-template<typename CLASS_POINT>
-SIMD_FORCE_INLINE void CLOSEST_POINT_ON_SEGMENT(
-	CLASS_POINT & cp, const CLASS_POINT & v,
-	const CLASS_POINT &e1,const CLASS_POINT &e2)
-{
-    vec3f _n;
-    VEC_DIFF(_n,e2,e1);
-    VEC_DIFF(cp,v,e1);
-	GREAL _scalar = VEC_DOT(cp, _n);
-	_scalar/= VEC_DOT(_n, _n);
-	if(_scalar <0.0f)
-	{
-	    VEC_COPY(cp,e1);
-	}
-	else if(_scalar >1.0f)
-	{
-	    VEC_COPY(cp,e2);
-	}
-	else
-	{
-        VEC_SCALE(cp,_scalar,_n);
-        VEC_SUM(cp,cp,e1);
-	}
-}
-
-
-/*! \brief Finds the line params where these lines intersect.
-
-\param dir1 Direction of line 1
-\param point1 Point of line 1
-\param dir2 Direction of line 2
-\param point2 Point of line 2
-\param t1 Result Parameter for line 1
-\param t2 Result Parameter for line 2
-\param dointersect  0  if the lines won't intersect, else 1
-
-*/
-template<typename T,typename CLASS_POINT>
-SIMD_FORCE_INLINE bool LINE_INTERSECTION_PARAMS(
-	const CLASS_POINT & dir1,
-	CLASS_POINT & point1,
-	const CLASS_POINT & dir2,
-	CLASS_POINT &  point2,
-	T& t1,T& t2)
-{
-    GREAL det;
-	GREAL e1e1 = VEC_DOT(dir1,dir1);
-	GREAL e1e2 = VEC_DOT(dir1,dir2);
-	GREAL e2e2 = VEC_DOT(dir2,dir2);
-	vec3f p1p2;
-    VEC_DIFF(p1p2,point1,point2);
-    GREAL p1p2e1 = VEC_DOT(p1p2,dir1);
-	GREAL p1p2e2 = VEC_DOT(p1p2,dir2);
-	det = e1e2*e1e2 - e1e1*e2e2;
-	if(GIM_IS_ZERO(det)) return false;
-	t1 = (e1e2*p1p2e2 - e2e2*p1p2e1)/det;
-	t2 = (e1e1*p1p2e2 - e1e2*p1p2e1)/det;
-	return true;
-}
-
-//! Find closest points on segments
-template<typename CLASS_POINT>
-SIMD_FORCE_INLINE void SEGMENT_COLLISION(
-	const CLASS_POINT & vA1,
-	const CLASS_POINT & vA2,
-	const CLASS_POINT & vB1,
-	const CLASS_POINT & vB2,
-	CLASS_POINT & vPointA,
-	CLASS_POINT & vPointB)
-{
-    CLASS_POINT _AD,_BD,_N;
-    vec4f _M;//plane
-    VEC_DIFF(_AD,vA2,vA1);
-    VEC_DIFF(_BD,vB2,vB1);
-    VEC_CROSS(_N,_AD,_BD);
-    GREAL _tp = VEC_DOT(_N,_N);
-    if(_tp<G_EPSILON)//ARE PARALELE
-    {
-    	//project B over A
-    	bool invert_b_order = false;
-    	_M[0] = VEC_DOT(vB1,_AD);
-    	_M[1] = VEC_DOT(vB2,_AD);
-    	if(_M[0]>_M[1])
-    	{
-    		invert_b_order  = true;
-    		GIM_SWAP_NUMBERS(_M[0],_M[1]);
-    	}
-    	_M[2] = VEC_DOT(vA1,_AD);
-    	_M[3] = VEC_DOT(vA2,_AD);
-    	//mid points
-    	_N[0] = (_M[0]+_M[1])*0.5f;
-    	_N[1] = (_M[2]+_M[3])*0.5f;
-
-    	if(_N[0]<_N[1])
-    	{
-    		if(_M[1]<_M[2])
-    		{
-    			vPointB = invert_b_order?vB1:vB2;
-    			vPointA = vA1;
-    		}
-    		else if(_M[1]<_M[3])
-    		{
-    			vPointB = invert_b_order?vB1:vB2;
-    			CLOSEST_POINT_ON_SEGMENT(vPointA,vPointB,vA1,vA2);
-    		}
-    		else
-    		{
-    			vPointA = vA2;
-    			CLOSEST_POINT_ON_SEGMENT(vPointB,vPointA,vB1,vB2);
-    		}
-    	}
-    	else
-    	{
-    		if(_M[3]<_M[0])
-    		{
-    			vPointB = invert_b_order?vB2:vB1;
-    			vPointA = vA2;
-    		}
-    		else if(_M[3]<_M[1])
-    		{
-    			vPointA = vA2;
-    			CLOSEST_POINT_ON_SEGMENT(vPointB,vPointA,vB1,vB2);
-    		}
-    		else
-    		{
-    			vPointB = invert_b_order?vB1:vB2;
-    			CLOSEST_POINT_ON_SEGMENT(vPointA,vPointB,vA1,vA2);
-    		}
-    	}
-    	return;
-    }
-
-
-    VEC_CROSS(_M,_N,_BD);
-    _M[3] = VEC_DOT(_M,vB1);
-
-    LINE_PLANE_COLLISION(_M,_AD,vA1,vPointA,_tp,btScalar(0), btScalar(1));
-    /*Closest point on segment*/
-    VEC_DIFF(vPointB,vPointA,vB1);
-	_tp = VEC_DOT(vPointB, _BD);
-	_tp/= VEC_DOT(_BD, _BD);
-	_tp = GIM_CLAMP(_tp,0.0f,1.0f);
-    VEC_SCALE(vPointB,_tp,_BD);
-    VEC_SUM(vPointB,vPointB,vB1);
-}
-
-
-
-
-//! Line box intersection in one dimension
-/*!
-
-*\param pos Position of the ray
-*\param dir Projection of the Direction of the ray
-*\param bmin Minimum bound of the box
-*\param bmax Maximum bound of the box
-*\param tfirst the minimum projection. Assign to 0 at first.
-*\param tlast the maximum projection. Assign to INFINITY at first.
-*\return true if there is an intersection.
-*/
-template<typename T>
-SIMD_FORCE_INLINE bool BOX_AXIS_INTERSECT(T pos, T dir,T bmin, T bmax, T & tfirst, T & tlast)
-{
-	if(GIM_IS_ZERO(dir))
-	{
-        return !(pos < bmin || pos > bmax);
-	}
-	GREAL a0 = (bmin - pos) / dir;
-	GREAL a1 = (bmax - pos) / dir;
-	if(a0 > a1)   GIM_SWAP_NUMBERS(a0, a1);
-	tfirst = GIM_MAX(a0, tfirst);
-	tlast = GIM_MIN(a1, tlast);
-	if (tlast < tfirst) return false;
-	return true;
-}
-
-
-//! Sorts 3 componets
-template<typename T>
-SIMD_FORCE_INLINE void SORT_3_INDICES(
-		const T * values,
-		GUINT * order_indices)
-{
-	//get minimum
-	order_indices[0] = values[0] < values[1] ? (values[0] < values[2] ? 0 : 2) : (values[1] < values[2] ? 1 : 2);
-
-	//get second and third
-	GUINT i0 = (order_indices[0] + 1)%3;
-	GUINT i1 = (i0 + 1)%3;
-
-	if(values[i0] < values[i1])
-	{
-		order_indices[1] = i0;
-		order_indices[2] = i1;
-	}
-	else
-	{
-		order_indices[1] = i1;
-		order_indices[2] = i0;
-	}
-}
-
-
-
-
-
-#endif // GIM_VECTOR_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_bitset.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_bitset.h
deleted file mode 100644
index 7dee48a..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_bitset.h
+++ /dev/null
@@ -1,123 +0,0 @@
-#ifndef GIM_BITSET_H_INCLUDED
-#define GIM_BITSET_H_INCLUDED
-/*! \file gim_bitset.h
-\author Francisco Leon Najera
-*/
-/*
------------------------------------------------------------------------------
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of EITHER:
-   (1) The GNU Lesser General Public License as published by the Free
-       Software Foundation; either version 2.1 of the License, or (at
-       your option) any later version. The text of the GNU Lesser
-       General Public License is included with this library in the
-       file GIMPACT-LICENSE-LGPL.TXT.
-   (2) The BSD-style license that is included with this library in
-       the file GIMPACT-LICENSE-BSD.TXT.
-   (3) The zlib/libpng license that is included with this library in
-       the file GIMPACT-LICENSE-ZLIB.TXT.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
-
------------------------------------------------------------------------------
-*/
-
-#include "gim_array.h"
-
-
-#define GUINT_BIT_COUNT 32
-#define GUINT_EXPONENT 5
-
-class gim_bitset
-{
-public:
-    gim_array<GUINT> m_container;
-
-    gim_bitset()
-    {
-
-    }
-
-    gim_bitset(GUINT bits_count)
-    {
-        resize(bits_count);
-    }
-
-    ~gim_bitset()
-    {
-    }
-
-	inline bool resize(GUINT newsize)
-	{
-		GUINT oldsize = m_container.size();
-		m_container.resize(newsize/GUINT_BIT_COUNT + 1,false);
-		while(oldsize<m_container.size())
-		{
-			m_container[oldsize] = 0;
-		}
-		return true;
-	}
-
-	inline GUINT size()
-	{
-		return m_container.size()*GUINT_BIT_COUNT;
-	}
-
-	inline void set_all()
-	{
-		for(GUINT i = 0;i<m_container.size();++i)
-		{
-			m_container[i] = 0xffffffff;
-		}
-	}
-
-	inline void clear_all()
-	{
-	    for(GUINT i = 0;i<m_container.size();++i)
-		{
-			m_container[i] = 0;
-		}
-	}
-
-	inline void set(GUINT bit_index)
-	{
-		if(bit_index>=size())
-		{
-			resize(bit_index);
-		}
-		m_container[bit_index >> GUINT_EXPONENT] |= (1 << (bit_index & (GUINT_BIT_COUNT-1)));
-	}
-
-	///Return 0 or 1
-	inline char get(GUINT bit_index)
-	{
-		if(bit_index>=size())
-		{
-			return 0;
-		}
-		char value = m_container[bit_index >> GUINT_EXPONENT] &
-					 (1 << (bit_index & (GUINT_BIT_COUNT-1)));
-		return value;
-	}
-
-	inline void clear(GUINT bit_index)
-	{
-	    m_container[bit_index >> GUINT_EXPONENT] &= ~(1 << (bit_index & (GUINT_BIT_COUNT-1)));
-	}
-};
-
-
-
-
-
-#endif // GIM_CONTAINERS_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_box_collision.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_box_collision.h
deleted file mode 100644
index b360dd4..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_box_collision.h
+++ /dev/null
@@ -1,590 +0,0 @@
-#ifndef GIM_BOX_COLLISION_H_INCLUDED
-#define GIM_BOX_COLLISION_H_INCLUDED
-
-/*! \file gim_box_collision.h
-\author Francisco Leon Najera
-*/
-/*
------------------------------------------------------------------------------
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of EITHER:
-   (1) The GNU Lesser General Public License as published by the Free
-       Software Foundation; either version 2.1 of the License, or (at
-       your option) any later version. The text of the GNU Lesser
-       General Public License is included with this library in the
-       file GIMPACT-LICENSE-LGPL.TXT.
-   (2) The BSD-style license that is included with this library in
-       the file GIMPACT-LICENSE-BSD.TXT.
-   (3) The zlib/libpng license that is included with this library in
-       the file GIMPACT-LICENSE-ZLIB.TXT.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
-
------------------------------------------------------------------------------
-*/
-#include "gim_basic_geometry_operations.h"
-#include "LinearMath/btTransform.h"
-
-
-
-//SIMD_FORCE_INLINE bool test_cross_edge_box(
-//	const btVector3 & edge,
-//	const btVector3 & absolute_edge,
-//	const btVector3 & pointa,
-//	const btVector3 & pointb, const btVector3 & extend,
-//	int dir_index0,
-//	int dir_index1
-//	int component_index0,
-//	int component_index1)
-//{
-//	// dir coords are -z and y
-//
-//	const btScalar dir0 = -edge[dir_index0];
-//	const btScalar dir1 = edge[dir_index1];
-//	btScalar pmin = pointa[component_index0]*dir0 + pointa[component_index1]*dir1;
-//	btScalar pmax = pointb[component_index0]*dir0 + pointb[component_index1]*dir1;
-//	//find minmax
-//	if(pmin>pmax)
-//	{
-//		GIM_SWAP_NUMBERS(pmin,pmax);
-//	}
-//	//find extends
-//	const btScalar rad = extend[component_index0] * absolute_edge[dir_index0] +
-//					extend[component_index1] * absolute_edge[dir_index1];
-//
-//	if(pmin>rad || -rad>pmax) return false;
-//	return true;
-//}
-//
-//SIMD_FORCE_INLINE bool test_cross_edge_box_X_axis(
-//	const btVector3 & edge,
-//	const btVector3 & absolute_edge,
-//	const btVector3 & pointa,
-//	const btVector3 & pointb, btVector3 & extend)
-//{
-//
-//	return test_cross_edge_box(edge,absolute_edge,pointa,pointb,extend,2,1,1,2);
-//}
-//
-//
-//SIMD_FORCE_INLINE bool test_cross_edge_box_Y_axis(
-//	const btVector3 & edge,
-//	const btVector3 & absolute_edge,
-//	const btVector3 & pointa,
-//	const btVector3 & pointb, btVector3 & extend)
-//{
-//
-//	return test_cross_edge_box(edge,absolute_edge,pointa,pointb,extend,0,2,2,0);
-//}
-//
-//SIMD_FORCE_INLINE bool test_cross_edge_box_Z_axis(
-//	const btVector3 & edge,
-//	const btVector3 & absolute_edge,
-//	const btVector3 & pointa,
-//	const btVector3 & pointb, btVector3 & extend)
-//{
-//
-//	return test_cross_edge_box(edge,absolute_edge,pointa,pointb,extend,1,0,0,1);
-//}
-
-#define TEST_CROSS_EDGE_BOX_MCR(edge,absolute_edge,pointa,pointb,_extend,i_dir_0,i_dir_1,i_comp_0,i_comp_1)\
-{\
-	const btScalar dir0 = -edge[i_dir_0];\
-	const btScalar dir1 = edge[i_dir_1];\
-	btScalar pmin = pointa[i_comp_0]*dir0 + pointa[i_comp_1]*dir1;\
-	btScalar pmax = pointb[i_comp_0]*dir0 + pointb[i_comp_1]*dir1;\
-	if(pmin>pmax)\
-	{\
-		GIM_SWAP_NUMBERS(pmin,pmax); \
-	}\
-	const btScalar abs_dir0 = absolute_edge[i_dir_0];\
-	const btScalar abs_dir1 = absolute_edge[i_dir_1];\
-	const btScalar rad = _extend[i_comp_0] * abs_dir0 + _extend[i_comp_1] * abs_dir1;\
-	if(pmin>rad || -rad>pmax) return false;\
-}\
-
-
-#define TEST_CROSS_EDGE_BOX_X_AXIS_MCR(edge,absolute_edge,pointa,pointb,_extend)\
-{\
-	TEST_CROSS_EDGE_BOX_MCR(edge,absolute_edge,pointa,pointb,_extend,2,1,1,2);\
-}\
-
-#define TEST_CROSS_EDGE_BOX_Y_AXIS_MCR(edge,absolute_edge,pointa,pointb,_extend)\
-{\
-	TEST_CROSS_EDGE_BOX_MCR(edge,absolute_edge,pointa,pointb,_extend,0,2,2,0);\
-}\
-
-#define TEST_CROSS_EDGE_BOX_Z_AXIS_MCR(edge,absolute_edge,pointa,pointb,_extend)\
-{\
-	TEST_CROSS_EDGE_BOX_MCR(edge,absolute_edge,pointa,pointb,_extend,1,0,0,1);\
-}\
-
-
-
-//!  Class for transforming a model1 to the space of model0
-class GIM_BOX_BOX_TRANSFORM_CACHE
-{
-public:
-    btVector3  m_T1to0;//!< Transforms translation of model1 to model 0
-	btMatrix3x3 m_R1to0;//!< Transforms Rotation of model1 to model 0, equal  to R0' * R1
-	btMatrix3x3 m_AR;//!< Absolute value of m_R1to0
-
-	SIMD_FORCE_INLINE void calc_absolute_matrix()
-	{
-		static const btVector3 vepsi(1e-6f,1e-6f,1e-6f);
-		m_AR[0] = vepsi + m_R1to0[0].absolute();
-		m_AR[1] = vepsi + m_R1to0[1].absolute();
-		m_AR[2] = vepsi + m_R1to0[2].absolute();
-	}
-
-	GIM_BOX_BOX_TRANSFORM_CACHE()
-	{
-	}
-
-
-	GIM_BOX_BOX_TRANSFORM_CACHE(mat4f  trans1_to_0)
-	{
-		COPY_MATRIX_3X3(m_R1to0,trans1_to_0)
-        MAT_GET_TRANSLATION(trans1_to_0,m_T1to0)
-		calc_absolute_matrix();
-	}
-
-	//! Calc the transformation relative  1 to 0. Inverts matrics by transposing
-	SIMD_FORCE_INLINE void calc_from_homogenic(const btTransform & trans0,const btTransform & trans1)
-	{
-
-		m_R1to0 = trans0.getBasis().transpose();
-		m_T1to0 = m_R1to0 * (-trans0.getOrigin());
-
-		m_T1to0 += m_R1to0*trans1.getOrigin();
-		m_R1to0 *= trans1.getBasis();
-
-		calc_absolute_matrix();
-	}
-
-	//! Calcs the full invertion of the matrices. Useful for scaling matrices
-	SIMD_FORCE_INLINE void calc_from_full_invert(const btTransform & trans0,const btTransform & trans1)
-	{
-		m_R1to0 = trans0.getBasis().inverse();
-		m_T1to0 = m_R1to0 * (-trans0.getOrigin());
-
-		m_T1to0 += m_R1to0*trans1.getOrigin();
-		m_R1to0 *= trans1.getBasis();
-
-		calc_absolute_matrix();
-	}
-
-	SIMD_FORCE_INLINE btVector3 transform(const btVector3 & point)
-	{
-		return btVector3(m_R1to0[0].dot(point) + m_T1to0.x(),
-			m_R1to0[1].dot(point) + m_T1to0.y(),
-			m_R1to0[2].dot(point) + m_T1to0.z());
-	}
-};
-
-
-#define BOX_PLANE_EPSILON 0.000001f
-
-//! Axis aligned box
-class GIM_AABB
-{
-public:
-	btVector3 m_min;
-	btVector3 m_max;
-
-	GIM_AABB()
-	{}
-
-
-	GIM_AABB(const btVector3 & V1,
-			 const btVector3 & V2,
-			 const btVector3 & V3)
-	{
-		m_min[0] = GIM_MIN3(V1[0],V2[0],V3[0]);
-		m_min[1] = GIM_MIN3(V1[1],V2[1],V3[1]);
-		m_min[2] = GIM_MIN3(V1[2],V2[2],V3[2]);
-
-		m_max[0] = GIM_MAX3(V1[0],V2[0],V3[0]);
-		m_max[1] = GIM_MAX3(V1[1],V2[1],V3[1]);
-		m_max[2] = GIM_MAX3(V1[2],V2[2],V3[2]);
-	}
-
-	GIM_AABB(const btVector3 & V1,
-			 const btVector3 & V2,
-			 const btVector3 & V3,
-			 GREAL margin)
-	{
-		m_min[0] = GIM_MIN3(V1[0],V2[0],V3[0]);
-		m_min[1] = GIM_MIN3(V1[1],V2[1],V3[1]);
-		m_min[2] = GIM_MIN3(V1[2],V2[2],V3[2]);
-
-		m_max[0] = GIM_MAX3(V1[0],V2[0],V3[0]);
-		m_max[1] = GIM_MAX3(V1[1],V2[1],V3[1]);
-		m_max[2] = GIM_MAX3(V1[2],V2[2],V3[2]);
-
-		m_min[0] -= margin;
-		m_min[1] -= margin;
-		m_min[2] -= margin;
-		m_max[0] += margin;
-		m_max[1] += margin;
-		m_max[2] += margin;
-	}
-
-	GIM_AABB(const GIM_AABB &other):
-		m_min(other.m_min),m_max(other.m_max)
-	{
-	}
-
-	GIM_AABB(const GIM_AABB &other,btScalar margin ):
-		m_min(other.m_min),m_max(other.m_max)
-	{
-		m_min[0] -= margin;
-		m_min[1] -= margin;
-		m_min[2] -= margin;
-		m_max[0] += margin;
-		m_max[1] += margin;
-		m_max[2] += margin;
-	}
-
-	SIMD_FORCE_INLINE void invalidate()
-	{
-		m_min[0] = G_REAL_INFINITY;
-		m_min[1] = G_REAL_INFINITY;
-		m_min[2] = G_REAL_INFINITY;
-		m_max[0] = -G_REAL_INFINITY;
-		m_max[1] = -G_REAL_INFINITY;
-		m_max[2] = -G_REAL_INFINITY;
-	}
-
-	SIMD_FORCE_INLINE void increment_margin(btScalar margin)
-	{
-		m_min[0] -= margin;
-		m_min[1] -= margin;
-		m_min[2] -= margin;
-		m_max[0] += margin;
-		m_max[1] += margin;
-		m_max[2] += margin;
-	}
-
-	SIMD_FORCE_INLINE void copy_with_margin(const GIM_AABB &other, btScalar margin)
-	{
-		m_min[0] = other.m_min[0] - margin;
-		m_min[1] = other.m_min[1] - margin;
-		m_min[2] = other.m_min[2] - margin;
-
-		m_max[0] = other.m_max[0] + margin;
-		m_max[1] = other.m_max[1] + margin;
-		m_max[2] = other.m_max[2] + margin;
-	}
-
-	template<typename CLASS_POINT>
-	SIMD_FORCE_INLINE void calc_from_triangle(
-							const CLASS_POINT & V1,
-							const CLASS_POINT & V2,
-							const CLASS_POINT & V3)
-	{
-		m_min[0] = GIM_MIN3(V1[0],V2[0],V3[0]);
-		m_min[1] = GIM_MIN3(V1[1],V2[1],V3[1]);
-		m_min[2] = GIM_MIN3(V1[2],V2[2],V3[2]);
-
-		m_max[0] = GIM_MAX3(V1[0],V2[0],V3[0]);
-		m_max[1] = GIM_MAX3(V1[1],V2[1],V3[1]);
-		m_max[2] = GIM_MAX3(V1[2],V2[2],V3[2]);
-	}
-
-	template<typename CLASS_POINT>
-	SIMD_FORCE_INLINE void calc_from_triangle_margin(
-							const CLASS_POINT & V1,
-							const CLASS_POINT & V2,
-							const CLASS_POINT & V3, btScalar margin)
-	{
-		m_min[0] = GIM_MIN3(V1[0],V2[0],V3[0]);
-		m_min[1] = GIM_MIN3(V1[1],V2[1],V3[1]);
-		m_min[2] = GIM_MIN3(V1[2],V2[2],V3[2]);
-
-		m_max[0] = GIM_MAX3(V1[0],V2[0],V3[0]);
-		m_max[1] = GIM_MAX3(V1[1],V2[1],V3[1]);
-		m_max[2] = GIM_MAX3(V1[2],V2[2],V3[2]);
-
-		m_min[0] -= margin;
-		m_min[1] -= margin;
-		m_min[2] -= margin;
-		m_max[0] += margin;
-		m_max[1] += margin;
-		m_max[2] += margin;
-	}
-
-	//! Apply a transform to an AABB
-	SIMD_FORCE_INLINE void appy_transform(const btTransform & trans)
-	{
-		btVector3 center = (m_max+m_min)*0.5f;
-		btVector3 extends = m_max - center;
-		// Compute new center
-		center = trans(center);
-
-		btVector3 textends(extends.dot(trans.getBasis().getRow(0).absolute()),
- 				 extends.dot(trans.getBasis().getRow(1).absolute()),
-				 extends.dot(trans.getBasis().getRow(2).absolute()));
-
-		m_min = center - textends;
-		m_max = center + textends;
-	}
-
-	//! Merges a Box
-	SIMD_FORCE_INLINE void merge(const GIM_AABB & box)
-	{
-		m_min[0] = GIM_MIN(m_min[0],box.m_min[0]);
-		m_min[1] = GIM_MIN(m_min[1],box.m_min[1]);
-		m_min[2] = GIM_MIN(m_min[2],box.m_min[2]);
-
-		m_max[0] = GIM_MAX(m_max[0],box.m_max[0]);
-		m_max[1] = GIM_MAX(m_max[1],box.m_max[1]);
-		m_max[2] = GIM_MAX(m_max[2],box.m_max[2]);
-	}
-
-	//! Merges a point
-	template<typename CLASS_POINT>
-	SIMD_FORCE_INLINE void merge_point(const CLASS_POINT & point)
-	{
-		m_min[0] = GIM_MIN(m_min[0],point[0]);
-		m_min[1] = GIM_MIN(m_min[1],point[1]);
-		m_min[2] = GIM_MIN(m_min[2],point[2]);
-
-		m_max[0] = GIM_MAX(m_max[0],point[0]);
-		m_max[1] = GIM_MAX(m_max[1],point[1]);
-		m_max[2] = GIM_MAX(m_max[2],point[2]);
-	}
-
-	//! Gets the extend and center
-	SIMD_FORCE_INLINE void get_center_extend(btVector3 & center,btVector3 & extend)  const
-	{
-		center = (m_max+m_min)*0.5f;
-		extend = m_max - center;
-	}
-
-	//! Finds the intersecting box between this box and the other.
-	SIMD_FORCE_INLINE void find_intersection(const GIM_AABB & other, GIM_AABB & intersection)  const
-	{
-		intersection.m_min[0] = GIM_MAX(other.m_min[0],m_min[0]);
-		intersection.m_min[1] = GIM_MAX(other.m_min[1],m_min[1]);
-		intersection.m_min[2] = GIM_MAX(other.m_min[2],m_min[2]);
-
-		intersection.m_max[0] = GIM_MIN(other.m_max[0],m_max[0]);
-		intersection.m_max[1] = GIM_MIN(other.m_max[1],m_max[1]);
-		intersection.m_max[2] = GIM_MIN(other.m_max[2],m_max[2]);
-	}
-
-
-	SIMD_FORCE_INLINE bool has_collision(const GIM_AABB & other) const
-	{
-		if(m_min[0] > other.m_max[0] ||
-		   m_max[0] < other.m_min[0] ||
-		   m_min[1] > other.m_max[1] ||
-		   m_max[1] < other.m_min[1] ||
-		   m_min[2] > other.m_max[2] ||
-		   m_max[2] < other.m_min[2])
-		{
-			return false;
-		}
-		return true;
-	}
-
-	/*! \brief Finds the Ray intersection parameter.
-	\param aabb Aligned box
-	\param vorigin A vec3f with the origin of the ray
-	\param vdir A vec3f with the direction of the ray
-	*/
-	SIMD_FORCE_INLINE bool collide_ray(const btVector3 & vorigin,const btVector3 & vdir)
-	{
-		btVector3 extents,center;
-		this->get_center_extend(center,extents);;
-
-		btScalar Dx = vorigin[0] - center[0];
-		if(GIM_GREATER(Dx, extents[0]) && Dx*vdir[0]>=0.0f)	return false;
-		btScalar Dy = vorigin[1] - center[1];
-		if(GIM_GREATER(Dy, extents[1]) && Dy*vdir[1]>=0.0f)	return false;
-		btScalar Dz = vorigin[2] - center[2];
-		if(GIM_GREATER(Dz, extents[2]) && Dz*vdir[2]>=0.0f)	return false;
-
-
-		btScalar f = vdir[1] * Dz - vdir[2] * Dy;
-		if(btFabs(f) > extents[1]*btFabs(vdir[2]) + extents[2]*btFabs(vdir[1])) return false;
-		f = vdir[2] * Dx - vdir[0] * Dz;
-		if(btFabs(f) > extents[0]*btFabs(vdir[2]) + extents[2]*btFabs(vdir[0]))return false;
-		f = vdir[0] * Dy - vdir[1] * Dx;
-		if(btFabs(f) > extents[0]*btFabs(vdir[1]) + extents[1]*btFabs(vdir[0]))return false;
-		return true;
-	}
-
-
-	SIMD_FORCE_INLINE void projection_interval(const btVector3 & direction, btScalar &vmin, btScalar &vmax) const
-	{
-		btVector3 center = (m_max+m_min)*0.5f;
-		btVector3 extend = m_max-center;
-
-		btScalar _fOrigin =  direction.dot(center);
-		btScalar _fMaximumExtent = extend.dot(direction.absolute());
-		vmin = _fOrigin - _fMaximumExtent;
-		vmax = _fOrigin + _fMaximumExtent;
-	}
-
-	SIMD_FORCE_INLINE ePLANE_INTERSECTION_TYPE plane_classify(const btVector4 &plane) const
-	{
-		btScalar _fmin,_fmax;
-		this->projection_interval(plane,_fmin,_fmax);
-
-		if(plane[3] > _fmax + BOX_PLANE_EPSILON)
-		{
-			return G_BACK_PLANE; // 0
-		}
-
-		if(plane[3]+BOX_PLANE_EPSILON >=_fmin)
-		{
-			return G_COLLIDE_PLANE; //1
-		}
-		return G_FRONT_PLANE;//2
-	}
-
-	SIMD_FORCE_INLINE bool overlapping_trans_conservative(const GIM_AABB & box, btTransform & trans1_to_0)
-	{
-		GIM_AABB tbox = box;
-		tbox.appy_transform(trans1_to_0);
-		return has_collision(tbox);
-	}
-
-	//! transcache is the transformation cache from box to this AABB
-	SIMD_FORCE_INLINE bool overlapping_trans_cache(
-		const GIM_AABB & box,const GIM_BOX_BOX_TRANSFORM_CACHE & transcache, bool fulltest)
-	{
-
-		//Taken from OPCODE
-		btVector3 ea,eb;//extends
-		btVector3 ca,cb;//extends
-		get_center_extend(ca,ea);
-		box.get_center_extend(cb,eb);
-
-
-		btVector3 T;
-		btScalar t,t2;
-		int i;
-
-		// Class I : A's basis vectors
-		for(i=0;i<3;i++)
-		{
-			T[i] =  transcache.m_R1to0[i].dot(cb) + transcache.m_T1to0[i] - ca[i];
-			t = transcache.m_AR[i].dot(eb) + ea[i];
-			if(GIM_GREATER(T[i], t))	return false;
-		}
-		// Class II : B's basis vectors
-		for(i=0;i<3;i++)
-		{
-			t = MAT_DOT_COL(transcache.m_R1to0,T,i);
-			t2 = MAT_DOT_COL(transcache.m_AR,ea,i) + eb[i];
-			if(GIM_GREATER(t,t2))	return false;
-		}
-		// Class III : 9 cross products
-		if(fulltest)
-		{
-			int j,m,n,o,p,q,r;
-			for(i=0;i<3;i++)
-			{
-				m = (i+1)%3;
-				n = (i+2)%3;
-				o = i==0?1:0;
-				p = i==2?1:2;
-				for(j=0;j<3;j++)
-				{
-					q = j==2?1:2;
-					r = j==0?1:0;
-					t = T[n]*transcache.m_R1to0[m][j] - T[m]*transcache.m_R1to0[n][j];
-					t2 = ea[o]*transcache.m_AR[p][j] + ea[p]*transcache.m_AR[o][j] +
-						eb[r]*transcache.m_AR[i][q] + eb[q]*transcache.m_AR[i][r];
-					if(GIM_GREATER(t,t2))	return false;
-				}
-			}
-		}
-		return true;
-	}
-
-	//! Simple test for planes.
-	SIMD_FORCE_INLINE bool collide_plane(
-		const btVector4 & plane)
-	{
-		ePLANE_INTERSECTION_TYPE classify = plane_classify(plane);
-		return (classify == G_COLLIDE_PLANE);
-	}
-
-	//! test for a triangle, with edges
-	SIMD_FORCE_INLINE bool collide_triangle_exact(
-		const btVector3 & p1,
-		const btVector3 & p2,
-		const btVector3 & p3,
-		const btVector4 & triangle_plane)
-	{
-		if(!collide_plane(triangle_plane)) return false;
-
-		btVector3 center,extends;
-		this->get_center_extend(center,extends);
-
-		const btVector3 v1(p1 - center);
-		const btVector3 v2(p2 - center);
-		const btVector3 v3(p3 - center);
-
-		//First axis
-		btVector3 diff(v2 - v1);
-		btVector3 abs_diff = diff.absolute();
-		//Test With X axis
-		TEST_CROSS_EDGE_BOX_X_AXIS_MCR(diff,abs_diff,v1,v3,extends);
-		//Test With Y axis
-		TEST_CROSS_EDGE_BOX_Y_AXIS_MCR(diff,abs_diff,v1,v3,extends);
-		//Test With Z axis
-		TEST_CROSS_EDGE_BOX_Z_AXIS_MCR(diff,abs_diff,v1,v3,extends);
-
-
-		diff = v3 - v2;
-		abs_diff = diff.absolute();
-		//Test With X axis
-		TEST_CROSS_EDGE_BOX_X_AXIS_MCR(diff,abs_diff,v2,v1,extends);
-		//Test With Y axis
-		TEST_CROSS_EDGE_BOX_Y_AXIS_MCR(diff,abs_diff,v2,v1,extends);
-		//Test With Z axis
-		TEST_CROSS_EDGE_BOX_Z_AXIS_MCR(diff,abs_diff,v2,v1,extends);
-
-		diff = v1 - v3;
-		abs_diff = diff.absolute();
-		//Test With X axis
-		TEST_CROSS_EDGE_BOX_X_AXIS_MCR(diff,abs_diff,v3,v2,extends);
-		//Test With Y axis
-		TEST_CROSS_EDGE_BOX_Y_AXIS_MCR(diff,abs_diff,v3,v2,extends);
-		//Test With Z axis
-		TEST_CROSS_EDGE_BOX_Z_AXIS_MCR(diff,abs_diff,v3,v2,extends);
-
-		return true;
-	}
-};
-
-
-//! Compairison of transformation objects
-SIMD_FORCE_INLINE bool btCompareTransformsEqual(const btTransform & t1,const btTransform & t2)
-{
-	if(!(t1.getOrigin() == t2.getOrigin()) ) return false;
-
-	if(!(t1.getBasis().getRow(0) == t2.getBasis().getRow(0)) ) return false;
-	if(!(t1.getBasis().getRow(1) == t2.getBasis().getRow(1)) ) return false;
-	if(!(t1.getBasis().getRow(2) == t2.getBasis().getRow(2)) ) return false;
-	return true;
-}
-
-
-
-#endif // GIM_BOX_COLLISION_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_box_set.cpp b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_box_set.cpp
deleted file mode 100644
index 0c3d7ba..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_box_set.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-
-/*
------------------------------------------------------------------------------
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of EITHER:
-   (1) The GNU Lesser General Public License as published by the Free
-       Software Foundation; either version 2.1 of the License, or (at
-       your option) any later version. The text of the GNU Lesser
-       General Public License is included with this library in the
-       file GIMPACT-LICENSE-LGPL.TXT.
-   (2) The BSD-style license that is included with this library in
-       the file GIMPACT-LICENSE-BSD.TXT.
-   (3) The zlib/libpng license that is included with this library in
-       the file GIMPACT-LICENSE-ZLIB.TXT.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
-
------------------------------------------------------------------------------
-*/
-
-
-#include "gim_box_set.h"
-
-
-GUINT GIM_BOX_TREE::_calc_splitting_axis(
-	gim_array<GIM_AABB_DATA> & primitive_boxes, GUINT startIndex,  GUINT endIndex)
-{
-	GUINT i;
-
-	btVector3 means(btScalar(0.),btScalar(0.),btScalar(0.));
-	btVector3 variance(btScalar(0.),btScalar(0.),btScalar(0.));
-	GUINT numIndices = endIndex-startIndex;
-
-	for (i=startIndex;i<endIndex;i++)
-	{
-		btVector3 center = btScalar(0.5)*(primitive_boxes[i].m_bound.m_max +
-					 primitive_boxes[i].m_bound.m_min);
-		means+=center;
-	}
-	means *= (btScalar(1.)/(btScalar)numIndices);
-
-	for (i=startIndex;i<endIndex;i++)
-	{
-		btVector3 center = btScalar(0.5)*(primitive_boxes[i].m_bound.m_max +
-					 primitive_boxes[i].m_bound.m_min);
-		btVector3 diff2 = center-means;
-		diff2 = diff2 * diff2;
-		variance += diff2;
-	}
-	variance *= (btScalar(1.)/	((btScalar)numIndices-1)	);
-
-	return variance.maxAxis();
-}
-
-
-GUINT GIM_BOX_TREE::_sort_and_calc_splitting_index(
-	gim_array<GIM_AABB_DATA> & primitive_boxes, GUINT startIndex,
-	GUINT endIndex, GUINT splitAxis)
-{
-	GUINT i;
-	GUINT splitIndex =startIndex;
-	GUINT numIndices = endIndex - startIndex;
-
-	// average of centers
-	btScalar splitValue = 0.0f;
-	for (i=startIndex;i<endIndex;i++)
-	{
-		splitValue+= 0.5f*(primitive_boxes[i].m_bound.m_max[splitAxis] +
-					 primitive_boxes[i].m_bound.m_min[splitAxis]);
-	}
-	splitValue /= (btScalar)numIndices;
-
-	//sort leafNodes so all values larger then splitValue comes first, and smaller values start from 'splitIndex'.
-	for (i=startIndex;i<endIndex;i++)
-	{
-		btScalar center = 0.5f*(primitive_boxes[i].m_bound.m_max[splitAxis] +
-					 primitive_boxes[i].m_bound.m_min[splitAxis]);
-		if (center > splitValue)
-		{
-			//swap
-			primitive_boxes.swap(i,splitIndex);
-			splitIndex++;
-		}
-	}
-
-	//if the splitIndex causes unbalanced trees, fix this by using the center in between startIndex and endIndex
-	//otherwise the tree-building might fail due to stack-overflows in certain cases.
-	//unbalanced1 is unsafe: it can cause stack overflows
-	//bool unbalanced1 = ((splitIndex==startIndex) || (splitIndex == (endIndex-1)));
-
-	//unbalanced2 should work too: always use center (perfect balanced trees)
-	//bool unbalanced2 = true;
-
-	//this should be safe too:
-	GUINT rangeBalancedIndices = numIndices/3;
-	bool unbalanced = ((splitIndex<=(startIndex+rangeBalancedIndices)) || (splitIndex >=(endIndex-1-rangeBalancedIndices)));
-
-	if (unbalanced)
-	{
-		splitIndex = startIndex+ (numIndices>>1);
-	}
-
-	btAssert(!((splitIndex==startIndex) || (splitIndex == (endIndex))));
-
-	return splitIndex;
-}
-
-
-void GIM_BOX_TREE::_build_sub_tree(gim_array<GIM_AABB_DATA> & primitive_boxes, GUINT startIndex,  GUINT endIndex)
-{
-	GUINT current_index = m_num_nodes++;
-
-	btAssert((endIndex-startIndex)>0);
-
-	if((endIndex-startIndex) == 1) //we got a leaf
-	{		
-		m_node_array[current_index].m_left = 0;
-		m_node_array[current_index].m_right = 0;
-		m_node_array[current_index].m_escapeIndex = 0;
-
-		m_node_array[current_index].m_bound = primitive_boxes[startIndex].m_bound;
-		m_node_array[current_index].m_data = primitive_boxes[startIndex].m_data;
-		return;
-	}
-
-	//configure inner node
-
-	GUINT splitIndex;
-
-	//calc this node bounding box
-	m_node_array[current_index].m_bound.invalidate();	
-	for (splitIndex=startIndex;splitIndex<endIndex;splitIndex++)
-	{
-		m_node_array[current_index].m_bound.merge(primitive_boxes[splitIndex].m_bound);
-	}
-
-	//calculate Best Splitting Axis and where to split it. Sort the incoming 'leafNodes' array within range 'startIndex/endIndex'.
-
-	//split axis
-	splitIndex = _calc_splitting_axis(primitive_boxes,startIndex,endIndex);
-
-	splitIndex = _sort_and_calc_splitting_index(
-			primitive_boxes,startIndex,endIndex,splitIndex);
-
-	//configure this inner node : the left node index
-	m_node_array[current_index].m_left = m_num_nodes;
-	//build left child tree
-	_build_sub_tree(primitive_boxes, startIndex, splitIndex );
-
-	//configure this inner node : the right node index
-	m_node_array[current_index].m_right = m_num_nodes;
-
-	//build right child tree
-	_build_sub_tree(primitive_boxes, splitIndex ,endIndex);
-
-	//configure this inner node : the escape index
-	m_node_array[current_index].m_escapeIndex  = m_num_nodes - current_index;
-}
-
-//! stackless build tree
-void GIM_BOX_TREE::build_tree(
-	gim_array<GIM_AABB_DATA> & primitive_boxes)
-{
-	// initialize node count to 0
-	m_num_nodes = 0;
-	// allocate nodes
-	m_node_array.resize(primitive_boxes.size()*2);
-	
-	_build_sub_tree(primitive_boxes, 0, primitive_boxes.size());
-}
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_box_set.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_box_set.h
deleted file mode 100644
index 61d190a..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_box_set.h
+++ /dev/null
@@ -1,674 +0,0 @@
-#ifndef GIM_BOX_SET_H_INCLUDED
-#define GIM_BOX_SET_H_INCLUDED
-
-/*! \file gim_box_set.h
-\author Francisco Leon Najera
-*/
-/*
------------------------------------------------------------------------------
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of EITHER:
-   (1) The GNU Lesser General Public License as published by the Free
-       Software Foundation; either version 2.1 of the License, or (at
-       your option) any later version. The text of the GNU Lesser
-       General Public License is included with this library in the
-       file GIMPACT-LICENSE-LGPL.TXT.
-   (2) The BSD-style license that is included with this library in
-       the file GIMPACT-LICENSE-BSD.TXT.
-   (3) The zlib/libpng license that is included with this library in
-       the file GIMPACT-LICENSE-ZLIB.TXT.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
-
------------------------------------------------------------------------------
-*/
-
-
-#include "gim_array.h"
-#include "gim_radixsort.h"
-#include "gim_box_collision.h"
-#include "gim_tri_collision.h"
-
-
-
-//! Overlapping pair
-struct GIM_PAIR
-{
-    GUINT m_index1;
-    GUINT m_index2;
-    GIM_PAIR()
-    {}
-
-    GIM_PAIR(const GIM_PAIR & p)
-    {
-    	m_index1 = p.m_index1;
-    	m_index2 = p.m_index2;
-	}
-
-	GIM_PAIR(GUINT index1, GUINT index2)
-    {
-    	m_index1 = index1;
-    	m_index2 = index2;
-	}
-};
-
-//! A pairset array
-class gim_pair_set: public gim_array<GIM_PAIR>
-{
-public:
-	gim_pair_set():gim_array<GIM_PAIR>(32)
-	{
-	}
-	inline void push_pair(GUINT index1,GUINT index2)
-	{
-		push_back(GIM_PAIR(index1,index2));
-	}
-
-	inline void push_pair_inv(GUINT index1,GUINT index2)
-	{
-		push_back(GIM_PAIR(index2,index1));
-	}
-};
-
-
-//! Prototype Base class for primitive classification
-/*!
-This class is a wrapper for primitive collections.
-This tells relevant info for the Bounding Box set classes, which take care of space classification.
-This class can manage Compound shapes and trimeshes, and if it is managing trimesh then the  Hierarchy Bounding Box classes will take advantage of primitive Vs Box overlapping tests for getting optimal results and less Per Box compairisons.
-*/
-class GIM_PRIMITIVE_MANAGER_PROTOTYPE
-{
-public:
-
-	virtual ~GIM_PRIMITIVE_MANAGER_PROTOTYPE() {}
-	//! determines if this manager consist on only triangles, which special case will be optimized
-	virtual bool is_trimesh() = 0;
-	virtual GUINT get_primitive_count() = 0;
-	virtual void get_primitive_box(GUINT prim_index ,GIM_AABB & primbox) = 0;
-	virtual void get_primitive_triangle(GUINT prim_index,GIM_TRIANGLE & triangle) = 0;
-};
-
-
-struct GIM_AABB_DATA
-{
-	GIM_AABB m_bound;
-	GUINT m_data;
-};
-
-//! Node Structure for trees
-struct GIM_BOX_TREE_NODE
-{
-	GIM_AABB m_bound;
-	GUINT m_left;//!< Left subtree
-	GUINT m_right;//!< Right subtree
-	GUINT m_escapeIndex;//!< Scape index for traversing
-	GUINT m_data;//!< primitive index if apply
-
-	GIM_BOX_TREE_NODE()
-	{
-	    m_left = 0;
-	    m_right = 0;
-	    m_escapeIndex = 0;
-	    m_data = 0;
-	}
-
-	SIMD_FORCE_INLINE bool is_leaf_node() const
-	{
-	    return  (!m_left && !m_right);
-	}
-};
-
-//! Basic Box tree structure
-class GIM_BOX_TREE
-{
-protected:
-	GUINT m_num_nodes;
-	gim_array<GIM_BOX_TREE_NODE> m_node_array;
-protected:
-	GUINT _sort_and_calc_splitting_index(
-		gim_array<GIM_AABB_DATA> & primitive_boxes,
-		 GUINT startIndex,  GUINT endIndex, GUINT splitAxis);
-
-	GUINT _calc_splitting_axis(gim_array<GIM_AABB_DATA> & primitive_boxes, GUINT startIndex,  GUINT endIndex);
-
-	void _build_sub_tree(gim_array<GIM_AABB_DATA> & primitive_boxes, GUINT startIndex,  GUINT endIndex);
-public:
-	GIM_BOX_TREE()
-	{
-		m_num_nodes = 0;
-	}
-
-	//! prototype functions for box tree management
-	//!@{
-	void build_tree(gim_array<GIM_AABB_DATA> & primitive_boxes);
-
-	SIMD_FORCE_INLINE void clearNodes()
-	{
-		m_node_array.clear();
-		m_num_nodes = 0;
-	}
-
-	//! node count
-	SIMD_FORCE_INLINE GUINT getNodeCount() const
-	{
-		return m_num_nodes;
-	}
-
-	//! tells if the node is a leaf
-	SIMD_FORCE_INLINE bool isLeafNode(GUINT nodeindex) const
-	{
-		return m_node_array[nodeindex].is_leaf_node();
-	}
-
-	SIMD_FORCE_INLINE GUINT getNodeData(GUINT nodeindex) const
-	{
-		return m_node_array[nodeindex].m_data;
-	}
-
-	SIMD_FORCE_INLINE void getNodeBound(GUINT nodeindex, GIM_AABB & bound) const
-	{
-		bound = m_node_array[nodeindex].m_bound;
-	}
-
-	SIMD_FORCE_INLINE void setNodeBound(GUINT nodeindex, const GIM_AABB & bound)
-	{
-		m_node_array[nodeindex].m_bound = bound;
-	}
-
-	SIMD_FORCE_INLINE GUINT getLeftNodeIndex(GUINT nodeindex)  const
-	{
-		return m_node_array[nodeindex].m_left;
-	}
-
-	SIMD_FORCE_INLINE GUINT getRightNodeIndex(GUINT nodeindex)  const
-	{
-		return m_node_array[nodeindex].m_right;
-	}
-
-	SIMD_FORCE_INLINE GUINT getScapeNodeIndex(GUINT nodeindex) const
-	{
-		return m_node_array[nodeindex].m_escapeIndex;
-	}
-
-	//!@}
-};
-
-
-//! Generic Box Tree Template
-/*!
-This class offers an structure for managing a box tree of primitives.
-Requires a Primitive prototype (like GIM_PRIMITIVE_MANAGER_PROTOTYPE ) and
-a Box tree structure ( like GIM_BOX_TREE).
-*/
-template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
-class GIM_BOX_TREE_TEMPLATE_SET
-{
-protected:
-	_GIM_PRIMITIVE_MANAGER_PROTOTYPE m_primitive_manager;
-	_GIM_BOX_TREE_PROTOTYPE m_box_tree;
-protected:
-	//stackless refit
-	SIMD_FORCE_INLINE void refit()
-	{
-		GUINT nodecount = getNodeCount();
-		while(nodecount--)
-		{
-			if(isLeafNode(nodecount))
-			{
-				GIM_AABB leafbox;
-				m_primitive_manager.get_primitive_box(getNodeData(nodecount),leafbox);
-				setNodeBound(nodecount,leafbox);
-			}
-			else
-			{
-				//get left bound
-				GUINT childindex = getLeftNodeIndex(nodecount);
-				GIM_AABB bound;
-				getNodeBound(childindex,bound);
-				//get right bound
-				childindex = getRightNodeIndex(nodecount);
-				GIM_AABB bound2;
-				getNodeBound(childindex,bound2);
-				bound.merge(bound2);
-
-				setNodeBound(nodecount,bound);
-			}
-		}
-	}
-public:
-
-	GIM_BOX_TREE_TEMPLATE_SET()
-	{
-	}
-
-	SIMD_FORCE_INLINE GIM_AABB getGlobalBox()  const
-	{
-		GIM_AABB totalbox;
-		getNodeBound(0, totalbox);
-		return totalbox;
-	}
-
-	SIMD_FORCE_INLINE void setPrimitiveManager(const _GIM_PRIMITIVE_MANAGER_PROTOTYPE & primitive_manager)
-	{
-		m_primitive_manager = primitive_manager;
-	}
-
-	const _GIM_PRIMITIVE_MANAGER_PROTOTYPE & getPrimitiveManager() const
-	{
-		return m_primitive_manager;
-	}
-
-	_GIM_PRIMITIVE_MANAGER_PROTOTYPE & getPrimitiveManager()
-	{
-		return m_primitive_manager;
-	}
-
-//! node manager prototype functions
-///@{
-
-	//! this attemps to refit the box set.
-	SIMD_FORCE_INLINE void update()
-	{
-		refit();
-	}
-
-	//! this rebuild the entire set
-	SIMD_FORCE_INLINE void buildSet()
-	{
-		//obtain primitive boxes
-		gim_array<GIM_AABB_DATA> primitive_boxes;
-		primitive_boxes.resize(m_primitive_manager.get_primitive_count(),false);
-
-		for (GUINT i = 0;i<primitive_boxes.size() ;i++ )
-		{
-			 m_primitive_manager.get_primitive_box(i,primitive_boxes[i].m_bound);
-			 primitive_boxes[i].m_data = i;
-		}
-
-		m_box_tree.build_tree(primitive_boxes);
-	}
-
-	//! returns the indices of the primitives in the m_primitive_manager
-	SIMD_FORCE_INLINE bool boxQuery(const GIM_AABB & box, gim_array<GUINT> & collided_results) const
-	{
-		GUINT curIndex = 0;
-		GUINT numNodes = getNodeCount();
-
-		while (curIndex < numNodes)
-		{
-			GIM_AABB bound;
-			getNodeBound(curIndex,bound);
-
-			//catch bugs in tree data
-
-			bool aabbOverlap = bound.has_collision(box);
-			bool isleafnode = isLeafNode(curIndex);
-
-			if (isleafnode && aabbOverlap)
-			{
-				collided_results.push_back(getNodeData(curIndex));
-			}
-
-			if (aabbOverlap || isleafnode)
-			{
-				//next subnode
-				curIndex++;
-			}
-			else
-			{
-				//skip node
-				curIndex+= getScapeNodeIndex(curIndex);
-			}
-		}
-		if(collided_results.size()>0) return true;
-		return false;
-	}
-
-	//! returns the indices of the primitives in the m_primitive_manager
-	SIMD_FORCE_INLINE bool boxQueryTrans(const GIM_AABB & box,
-		 const btTransform & transform, gim_array<GUINT> & collided_results) const
-	{
-		GIM_AABB transbox=box;
-		transbox.appy_transform(transform);
-		return boxQuery(transbox,collided_results);
-	}
-
-	//! returns the indices of the primitives in the m_primitive_manager
-	SIMD_FORCE_INLINE bool rayQuery(
-		const btVector3 & ray_dir,const btVector3 & ray_origin ,
-		gim_array<GUINT> & collided_results) const
-	{
-		GUINT curIndex = 0;
-		GUINT numNodes = getNodeCount();
-
-		while (curIndex < numNodes)
-		{
-			GIM_AABB bound;
-			getNodeBound(curIndex,bound);
-
-			//catch bugs in tree data
-
-			bool aabbOverlap = bound.collide_ray(ray_origin,ray_dir);
-			bool isleafnode = isLeafNode(curIndex);
-
-			if (isleafnode && aabbOverlap)
-			{
-				collided_results.push_back(getNodeData( curIndex));
-			}
-
-			if (aabbOverlap || isleafnode)
-			{
-				//next subnode
-				curIndex++;
-			}
-			else
-			{
-				//skip node
-				curIndex+= getScapeNodeIndex(curIndex);
-			}
-		}
-		if(collided_results.size()>0) return true;
-		return false;
-	}
-
-	//! tells if this set has hierarcht
-	SIMD_FORCE_INLINE bool hasHierarchy() const
-	{
-		return true;
-	}
-
-	//! tells if this set is a trimesh
-	SIMD_FORCE_INLINE bool isTrimesh()  const
-	{
-		return m_primitive_manager.is_trimesh();
-	}
-
-	//! node count
-	SIMD_FORCE_INLINE GUINT getNodeCount() const
-	{
-		return m_box_tree.getNodeCount();
-	}
-
-	//! tells if the node is a leaf
-	SIMD_FORCE_INLINE bool isLeafNode(GUINT nodeindex) const
-	{
-		return m_box_tree.isLeafNode(nodeindex);
-	}
-
-	SIMD_FORCE_INLINE GUINT getNodeData(GUINT nodeindex) const
-	{
-		return m_box_tree.getNodeData(nodeindex);
-	}
-
-	SIMD_FORCE_INLINE void getNodeBound(GUINT nodeindex, GIM_AABB & bound)  const
-	{
-		m_box_tree.getNodeBound(nodeindex, bound);
-	}
-
-	SIMD_FORCE_INLINE void setNodeBound(GUINT nodeindex, const GIM_AABB & bound)
-	{
-		m_box_tree.setNodeBound(nodeindex, bound);
-	}
-
-	SIMD_FORCE_INLINE GUINT getLeftNodeIndex(GUINT nodeindex) const
-	{
-		return m_box_tree.getLeftNodeIndex(nodeindex);
-	}
-
-	SIMD_FORCE_INLINE GUINT getRightNodeIndex(GUINT nodeindex) const
-	{
-		return m_box_tree.getRightNodeIndex(nodeindex);
-	}
-
-	SIMD_FORCE_INLINE GUINT getScapeNodeIndex(GUINT nodeindex) const
-	{
-		return m_box_tree.getScapeNodeIndex(nodeindex);
-	}
-
-	SIMD_FORCE_INLINE void getNodeTriangle(GUINT nodeindex,GIM_TRIANGLE & triangle) const
-	{
-		m_primitive_manager.get_primitive_triangle(getNodeData(nodeindex),triangle);
-	}
-
-};
-
-//! Class for Box Tree Sets
-/*!
-this has the GIM_BOX_TREE implementation for bounding boxes.
-*/
-template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE>
-class GIM_BOX_TREE_SET: public GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, GIM_BOX_TREE>
-{
-public:
-
-};
-
-
-
-
-
-/// GIM_BOX_SET collision methods
-template<typename BOX_SET_CLASS0,typename BOX_SET_CLASS1>
-class GIM_TREE_TREE_COLLIDER
-{
-public:
-	gim_pair_set * m_collision_pairs;
-	BOX_SET_CLASS0 * m_boxset0;
-	BOX_SET_CLASS1 * m_boxset1;
-	GUINT current_node0;
-	GUINT current_node1;
-	bool node0_is_leaf;
-	bool node1_is_leaf;
-	bool t0_is_trimesh;
-	bool t1_is_trimesh;
-	bool node0_has_triangle;
-	bool node1_has_triangle;
-	GIM_AABB m_box0;
-	GIM_AABB m_box1;
-	GIM_BOX_BOX_TRANSFORM_CACHE trans_cache_1to0;
-	btTransform trans_cache_0to1;
-	GIM_TRIANGLE m_tri0;
-	btVector4 m_tri0_plane;
-	GIM_TRIANGLE m_tri1;
-	btVector4 m_tri1_plane;
-
-
-public:
-	GIM_TREE_TREE_COLLIDER()
-	{
-		current_node0 = G_UINT_INFINITY;
-		current_node1 = G_UINT_INFINITY;
-	}
-protected:
-	SIMD_FORCE_INLINE void retrieve_node0_triangle(GUINT node0)
-	{
-		if(node0_has_triangle) return;
-		m_boxset0->getNodeTriangle(node0,m_tri0);
-		//transform triangle
-		m_tri0.m_vertices[0] = trans_cache_0to1(m_tri0.m_vertices[0]);
-		m_tri0.m_vertices[1] = trans_cache_0to1(m_tri0.m_vertices[1]);
-		m_tri0.m_vertices[2] = trans_cache_0to1(m_tri0.m_vertices[2]);
-		m_tri0.get_plane(m_tri0_plane);
-
-		node0_has_triangle = true;
-	}
-
-	SIMD_FORCE_INLINE void retrieve_node1_triangle(GUINT node1)
-	{
-		if(node1_has_triangle) return;
-		m_boxset1->getNodeTriangle(node1,m_tri1);
-		//transform triangle
-		m_tri1.m_vertices[0] = trans_cache_1to0.transform(m_tri1.m_vertices[0]);
-		m_tri1.m_vertices[1] = trans_cache_1to0.transform(m_tri1.m_vertices[1]);
-		m_tri1.m_vertices[2] = trans_cache_1to0.transform(m_tri1.m_vertices[2]);
-		m_tri1.get_plane(m_tri1_plane);
-
-		node1_has_triangle = true;
-	}
-
-	SIMD_FORCE_INLINE void retrieve_node0_info(GUINT node0)
-	{
-		if(node0 == current_node0) return;
-		m_boxset0->getNodeBound(node0,m_box0);
-		node0_is_leaf = m_boxset0->isLeafNode(node0);
-		node0_has_triangle = false;
-		current_node0 = node0;
-	}
-
-	SIMD_FORCE_INLINE void retrieve_node1_info(GUINT node1)
-	{
-		if(node1 == current_node1) return;
-		m_boxset1->getNodeBound(node1,m_box1);
-		node1_is_leaf = m_boxset1->isLeafNode(node1);
-		node1_has_triangle = false;
-		current_node1 = node1;
-	}
-
-	SIMD_FORCE_INLINE bool node_collision(GUINT node0 ,GUINT node1)
-	{
-		retrieve_node0_info(node0);
-		retrieve_node1_info(node1);
-		bool result = m_box0.overlapping_trans_cache(m_box1,trans_cache_1to0,true);
-		if(!result) return false;
-
-		if(t0_is_trimesh && node0_is_leaf)
-		{
-			//perform primitive vs box collision
-			retrieve_node0_triangle(node0);
-			//do triangle vs box collision
-			m_box1.increment_margin(m_tri0.m_margin);
-
-			result = m_box1.collide_triangle_exact(
-				m_tri0.m_vertices[0],m_tri0.m_vertices[1],m_tri0.m_vertices[2],m_tri0_plane);
-
-			m_box1.increment_margin(-m_tri0.m_margin);
-
-			if(!result) return false;
-			return true;
-		}
-		else if(t1_is_trimesh && node1_is_leaf)
-		{
-			//perform primitive vs box collision
-			retrieve_node1_triangle(node1);
-			//do triangle vs box collision
-			m_box0.increment_margin(m_tri1.m_margin);
-
-			result = m_box0.collide_triangle_exact(
-				m_tri1.m_vertices[0],m_tri1.m_vertices[1],m_tri1.m_vertices[2],m_tri1_plane);
-
-			m_box0.increment_margin(-m_tri1.m_margin);
-
-			if(!result) return false;
-			return true;
-		}
-		return true;
-	}
-
-	//stackless collision routine
-	void find_collision_pairs()
-	{
-		gim_pair_set stack_collisions;
-		stack_collisions.reserve(32);
-
-		//add the first pair
-		stack_collisions.push_pair(0,0);
-
-
-		while(stack_collisions.size())
-		{
-			//retrieve the last pair and pop
-			GUINT node0 = stack_collisions.back().m_index1;
-			GUINT node1 = stack_collisions.back().m_index2;
-			stack_collisions.pop_back();
-			if(node_collision(node0,node1)) // a collision is found
-			{
-				if(node0_is_leaf)
-				{
-					if(node1_is_leaf)
-					{
-						m_collision_pairs->push_pair(m_boxset0->getNodeData(node0),m_boxset1->getNodeData(node1));
-					}
-					else
-					{
-						//collide left
-						stack_collisions.push_pair(node0,m_boxset1->getLeftNodeIndex(node1));
-
-						//collide right
-						stack_collisions.push_pair(node0,m_boxset1->getRightNodeIndex(node1));
-					}
-				}
-				else
-				{
-					if(node1_is_leaf)
-					{
-						//collide left
-						stack_collisions.push_pair(m_boxset0->getLeftNodeIndex(node0),node1);
-						//collide right
-						stack_collisions.push_pair(m_boxset0->getRightNodeIndex(node0),node1);
-					}
-					else
-					{
-						GUINT left0 = m_boxset0->getLeftNodeIndex(node0);
-						GUINT right0 = m_boxset0->getRightNodeIndex(node0);
-						GUINT left1 = m_boxset1->getLeftNodeIndex(node1);
-						GUINT right1 = m_boxset1->getRightNodeIndex(node1);
-						//collide left
-						stack_collisions.push_pair(left0,left1);
-						//collide right
-						stack_collisions.push_pair(left0,right1);
-						//collide left
-						stack_collisions.push_pair(right0,left1);
-						//collide right
-						stack_collisions.push_pair(right0,right1);
-
-					}// else if node1 is not a leaf
-				}// else if node0 is not a leaf
-
-			}// if(node_collision(node0,node1))
-		}//while(stack_collisions.size())
-	}
-public:
-	void find_collision(BOX_SET_CLASS0 * boxset1, const btTransform & trans1,
-		BOX_SET_CLASS1 * boxset2, const btTransform & trans2,
-		gim_pair_set & collision_pairs, bool complete_primitive_tests = true)
-	{
-		m_collision_pairs = &collision_pairs;
-		m_boxset0 = boxset1;
-		m_boxset1 = boxset2;
-
-		trans_cache_1to0.calc_from_homogenic(trans1,trans2);
-
-		trans_cache_0to1 =  trans2.inverse();
-		trans_cache_0to1 *= trans1;
-
-
-		if(complete_primitive_tests)
-		{
-			t0_is_trimesh = boxset1->getPrimitiveManager().is_trimesh();
-			t1_is_trimesh = boxset2->getPrimitiveManager().is_trimesh();
-		}
-		else
-		{
-			t0_is_trimesh = false;
-			t1_is_trimesh = false;
-		}
-
-		find_collision_pairs();
-	}
-};
-
-
-#endif // GIM_BOXPRUNING_H_INCLUDED
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_clip_polygon.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_clip_polygon.h
deleted file mode 100644
index e342459..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_clip_polygon.h
+++ /dev/null
@@ -1,210 +0,0 @@
-#ifndef GIM_CLIP_POLYGON_H_INCLUDED
-#define GIM_CLIP_POLYGON_H_INCLUDED
-
-/*! \file gim_tri_collision.h
-\author Francisco Leon Najera
-*/
-/*
------------------------------------------------------------------------------
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of EITHER:
-   (1) The GNU Lesser General Public License as published by the Free
-       Software Foundation; either version 2.1 of the License, or (at
-       your option) any later version. The text of the GNU Lesser
-       General Public License is included with this library in the
-       file GIMPACT-LICENSE-LGPL.TXT.
-   (2) The BSD-style license that is included with this library in
-       the file GIMPACT-LICENSE-BSD.TXT.
-   (3) The zlib/libpng license that is included with this library in
-       the file GIMPACT-LICENSE-ZLIB.TXT.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
-
------------------------------------------------------------------------------
-*/
-
-
-//! This function calcs the distance from a 3D plane
-class DISTANCE_PLANE_3D_FUNC
-{
-public:
-	template<typename CLASS_POINT,typename CLASS_PLANE>
-	inline GREAL operator()(const CLASS_PLANE & plane, const CLASS_POINT & point)
-	{
-		return DISTANCE_PLANE_POINT(plane, point);
-	}
-};
-
-
-
-template<typename CLASS_POINT>
-SIMD_FORCE_INLINE void PLANE_CLIP_POLYGON_COLLECT(
-						const CLASS_POINT & point0,
-						const CLASS_POINT & point1,
-						GREAL dist0,
-						GREAL dist1,
-						CLASS_POINT * clipped,
-						GUINT & clipped_count)
-{
-	GUINT _prevclassif = (dist0>G_EPSILON);
-	GUINT _classif = (dist1>G_EPSILON);
-	if(_classif!=_prevclassif)
-	{
-		GREAL blendfactor = -dist0/(dist1-dist0);
-		VEC_BLEND(clipped[clipped_count],point0,point1,blendfactor);
-		clipped_count++;
-	}
-	if(!_classif)
-	{
-		VEC_COPY(clipped[clipped_count],point1);
-		clipped_count++;
-	}
-}
-
-
-//! Clips a polygon by a plane
-/*!
-*\return The count of the clipped counts
-*/
-template<typename CLASS_POINT,typename CLASS_PLANE, typename DISTANCE_PLANE_FUNC>
-SIMD_FORCE_INLINE GUINT PLANE_CLIP_POLYGON_GENERIC(
-						const CLASS_PLANE & plane,
-						const CLASS_POINT * polygon_points,
-						GUINT polygon_point_count,
-						CLASS_POINT * clipped,DISTANCE_PLANE_FUNC distance_func)
-{
-    GUINT clipped_count = 0;
-
-
-    //clip first point
-	GREAL firstdist = distance_func(plane,polygon_points[0]);;
-	if(!(firstdist>G_EPSILON))
-	{
-		VEC_COPY(clipped[clipped_count],polygon_points[0]);
-		clipped_count++;
-	}
-
-	GREAL olddist = firstdist;
-	for(GUINT _i=1;_i<polygon_point_count;_i++)
-	{		
-		GREAL dist = distance_func(plane,polygon_points[_i]);
-
-		PLANE_CLIP_POLYGON_COLLECT(
-						polygon_points[_i-1],polygon_points[_i],
-						olddist,
-						dist,
-						clipped,
-						clipped_count);
-
-
-		olddist = dist;		
-	}
-
-	//RETURN TO FIRST  point	
-
-	PLANE_CLIP_POLYGON_COLLECT(
-					polygon_points[polygon_point_count-1],polygon_points[0],
-					olddist,
-					firstdist,
-					clipped,
-					clipped_count);
-
-	return clipped_count;
-}
-
-//! Clips a polygon by a plane
-/*!
-*\return The count of the clipped counts
-*/
-template<typename CLASS_POINT,typename CLASS_PLANE, typename DISTANCE_PLANE_FUNC>
-SIMD_FORCE_INLINE GUINT PLANE_CLIP_TRIANGLE_GENERIC(
-						const CLASS_PLANE & plane,
-						const CLASS_POINT & point0,
-						const CLASS_POINT & point1,
-						const CLASS_POINT & point2,
-						CLASS_POINT * clipped,DISTANCE_PLANE_FUNC distance_func)
-{
-    GUINT clipped_count = 0;
-
-    //clip first point
-	GREAL firstdist = distance_func(plane,point0);;
-	if(!(firstdist>G_EPSILON))
-	{
-		VEC_COPY(clipped[clipped_count],point0);
-		clipped_count++;
-	}
-
-	// point 1
-	GREAL olddist = firstdist;
-	GREAL dist = distance_func(plane,point1);
-
-	PLANE_CLIP_POLYGON_COLLECT(
-					point0,point1,
-					olddist,
-					dist,
-					clipped,
-					clipped_count);
-
-	olddist = dist;
-
-
-	// point 2
-	dist = distance_func(plane,point2);
-
-	PLANE_CLIP_POLYGON_COLLECT(
-					point1,point2,
-					olddist,
-					dist,
-					clipped,
-					clipped_count);
-	olddist = dist;
-
-
-
-	//RETURN TO FIRST  point
-	PLANE_CLIP_POLYGON_COLLECT(
-					point2,point0,
-					olddist,
-					firstdist,
-					clipped,
-					clipped_count);
-
-	return clipped_count;
-}
-
-
-template<typename CLASS_POINT,typename CLASS_PLANE>
-SIMD_FORCE_INLINE GUINT PLANE_CLIP_POLYGON3D(
-						const CLASS_PLANE & plane,
-						const CLASS_POINT * polygon_points,
-						GUINT polygon_point_count,
-						CLASS_POINT * clipped)
-{
-	return PLANE_CLIP_POLYGON_GENERIC<CLASS_POINT,CLASS_PLANE>(plane,polygon_points,polygon_point_count,clipped,DISTANCE_PLANE_3D_FUNC());
-}
-
-
-template<typename CLASS_POINT,typename CLASS_PLANE>
-SIMD_FORCE_INLINE GUINT PLANE_CLIP_TRIANGLE3D(
-						const CLASS_PLANE & plane,
-						const CLASS_POINT & point0,
-						const CLASS_POINT & point1,
-						const CLASS_POINT & point2,
-						CLASS_POINT * clipped)
-{
-	return PLANE_CLIP_TRIANGLE_GENERIC<CLASS_POINT,CLASS_PLANE>(plane,point0,point1,point2,clipped,DISTANCE_PLANE_3D_FUNC());
-}
-
-
-
-#endif // GIM_TRI_COLLISION_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_contact.cpp b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_contact.cpp
deleted file mode 100644
index 20e41de..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_contact.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-
-/*
------------------------------------------------------------------------------
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of EITHER:
-   (1) The GNU Lesser General Public License as published by the Free
-       Software Foundation; either version 2.1 of the License, or (at
-       your option) any later version. The text of the GNU Lesser
-       General Public License is included with this library in the
-       file GIMPACT-LICENSE-LGPL.TXT.
-   (2) The BSD-style license that is included with this library in
-       the file GIMPACT-LICENSE-BSD.TXT.
-   (3) The zlib/libpng license that is included with this library in
-       the file GIMPACT-LICENSE-ZLIB.TXT.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
-
------------------------------------------------------------------------------
-*/
-
-#include "gim_contact.h"
-
-#define MAX_COINCIDENT 8
-
-void gim_contact_array::merge_contacts(
-	const gim_contact_array & contacts, bool normal_contact_average)
-{
-	clear();
-
-	if(contacts.size()==1)
-	{
-		push_back(contacts.back());
-		return;
-	}
-
-	gim_array<GIM_RSORT_TOKEN> keycontacts(contacts.size());
-	keycontacts.resize(contacts.size(),false);
-
-	//fill key contacts
-
-	GUINT i;
-
-	for (i = 0;i<contacts.size() ;i++ )
-	{
-		keycontacts[i].m_key = contacts[i].calc_key_contact();
-		keycontacts[i].m_value = i;
-	}
-
-	//sort keys
-	gim_heap_sort(keycontacts.pointer(),keycontacts.size(),GIM_RSORT_TOKEN_COMPARATOR());
-
-	// Merge contacts
-
-	GUINT coincident_count=0;
-	btVector3 coincident_normals[MAX_COINCIDENT];
-
-	GUINT last_key = keycontacts[0].m_key;
-	GUINT key = 0;
-
-	push_back(contacts[keycontacts[0].m_value]);
-	GIM_CONTACT * pcontact = &back();
-
-
-
-	for( i=1;i<keycontacts.size();i++)
-	{
-	    key = keycontacts[i].m_key;
-		const GIM_CONTACT * scontact = &contacts[keycontacts[i].m_value];
-
-		if(last_key ==  key)//same points
-		{
-			//merge contact
-			if(pcontact->m_depth - CONTACT_DIFF_EPSILON > scontact->m_depth)//)
-			{
-				*pcontact = *scontact;
-                coincident_count = 0;
-			}
-			else if(normal_contact_average)
-			{
-				if(btFabs(pcontact->m_depth - scontact->m_depth)<CONTACT_DIFF_EPSILON)
-                {
-                    if(coincident_count<MAX_COINCIDENT)
-                    {
-                    	coincident_normals[coincident_count] = scontact->m_normal;
-                        coincident_count++;
-                    }
-                }
-			}
-		}
-		else
-		{//add new contact
-
-		    if(normal_contact_average && coincident_count>0)
-		    {
-		    	pcontact->interpolate_normals(coincident_normals,coincident_count);
-		        coincident_count = 0;
-		    }
-
-		    push_back(*scontact);
-		    pcontact = &back();
-        }
-		last_key = key;
-	}
-}
-
-void gim_contact_array::merge_contacts_unique(const gim_contact_array & contacts)
-{
-	clear();
-
-	if(contacts.size()==1)
-	{
-		push_back(contacts.back());
-		return;
-	}
-
-	GIM_CONTACT average_contact = contacts.back();
-
-	for (GUINT i=1;i<contacts.size() ;i++ )
-	{
-		average_contact.m_point += contacts[i].m_point;
-		average_contact.m_normal += contacts[i].m_normal * contacts[i].m_depth;
-	}
-
-	//divide
-	GREAL divide_average = 1.0f/((GREAL)contacts.size());
-
-	average_contact.m_point *= divide_average;
-
-	average_contact.m_normal *= divide_average;
-
-	average_contact.m_depth = average_contact.m_normal.length();
-
-	average_contact.m_normal /= average_contact.m_depth;
-
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_contact.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_contact.h
deleted file mode 100644
index 5d9f8ef..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_contact.h
+++ /dev/null
@@ -1,164 +0,0 @@
-#ifndef GIM_CONTACT_H_INCLUDED
-#define GIM_CONTACT_H_INCLUDED
-
-/*! \file gim_contact.h
-\author Francisco Leon Najera
-*/
-/*
------------------------------------------------------------------------------
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of EITHER:
-   (1) The GNU Lesser General Public License as published by the Free
-       Software Foundation; either version 2.1 of the License, or (at
-       your option) any later version. The text of the GNU Lesser
-       General Public License is included with this library in the
-       file GIMPACT-LICENSE-LGPL.TXT.
-   (2) The BSD-style license that is included with this library in
-       the file GIMPACT-LICENSE-BSD.TXT.
-   (3) The zlib/libpng license that is included with this library in
-       the file GIMPACT-LICENSE-ZLIB.TXT.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
-
------------------------------------------------------------------------------
-*/
-#include "gim_geometry.h"
-#include "gim_radixsort.h"
-#include "gim_array.h"
-
-
-/**
-Configuration var for applying interpolation of  contact normals
-*/
-#define NORMAL_CONTACT_AVERAGE 1
-#define CONTACT_DIFF_EPSILON 0.00001f
-
-/// Structure for collision results
-///Functions for managing and sorting contacts resulting from a collision query.
-///Contact lists must be create by calling \ref GIM_CREATE_CONTACT_LIST
-///After querys, contact lists must be destroy by calling \ref GIM_DYNARRAY_DESTROY
-///Contacts can be merge for avoid duplicate results by calling \ref gim_merge_contacts
-class GIM_CONTACT
-{
-public:
-    btVector3 m_point;
-    btVector3 m_normal;
-    GREAL m_depth;//Positive value indicates interpenetration
-    GREAL m_distance;//Padding not for use
-    GUINT m_feature1;//Face number
-    GUINT m_feature2;//Face number
-public:
-    GIM_CONTACT()
-    {
-    }
-
-    GIM_CONTACT(const GIM_CONTACT & contact):
-				m_point(contact.m_point),
-				m_normal(contact.m_normal),
-				m_depth(contact.m_depth),
-				m_feature1(contact.m_feature1),
-				m_feature2(contact.m_feature2)
-    {
-    	m_point = contact.m_point;
-    	m_normal = contact.m_normal;
-    	m_depth = contact.m_depth;
-    	m_feature1 = contact.m_feature1;
-    	m_feature2 = contact.m_feature2;
-    }
-
-    GIM_CONTACT(const btVector3 &point,const btVector3 & normal,
-    	 			GREAL depth, GUINT feature1, GUINT feature2):
-				m_point(point),
-				m_normal(normal),
-				m_depth(depth),
-				m_feature1(feature1),
-				m_feature2(feature2)
-    {
-    }
-
-	//! Calcs key for coord classification
-    SIMD_FORCE_INLINE GUINT calc_key_contact() const
-    {
-    	GINT _coords[] = {
-    		(GINT)(m_point[0]*1000.0f+1.0f),
-    		(GINT)(m_point[1]*1333.0f),
-    		(GINT)(m_point[2]*2133.0f+3.0f)};
-		GUINT _hash=0;
-		GUINT *_uitmp = (GUINT *)(&_coords[0]);
-		_hash = *_uitmp;
-		_uitmp++;
-		_hash += (*_uitmp)<<4;
-		_uitmp++;
-		_hash += (*_uitmp)<<8;
-		return _hash;
-    }
-
-    SIMD_FORCE_INLINE void interpolate_normals( btVector3 * normals,GUINT normal_count)
-    {
-    	btVector3 vec_sum(m_normal);
-		for(GUINT i=0;i<normal_count;i++)
-		{
-			vec_sum += normals[i];
-		}
-
-		GREAL vec_sum_len = vec_sum.length2();
-		if(vec_sum_len <CONTACT_DIFF_EPSILON) return;
-
-		GIM_INV_SQRT(vec_sum_len,vec_sum_len); // 1/sqrt(vec_sum_len)
-
-		m_normal = vec_sum*vec_sum_len;
-    }
-
-};
-
-
-class gim_contact_array:public gim_array<GIM_CONTACT>
-{
-public:
-	gim_contact_array():gim_array<GIM_CONTACT>(64)
-	{
-	}
-
-	SIMD_FORCE_INLINE void push_contact(const btVector3 &point,const btVector3 & normal,
-    	 			GREAL depth, GUINT feature1, GUINT feature2)
-	{
-		push_back_mem();
-		GIM_CONTACT & newele = back();
-		newele.m_point = point;
-		newele.m_normal = normal;
-		newele.m_depth = depth;
-		newele.m_feature1 = feature1;
-		newele.m_feature2 = feature2;
-	}
-
-	SIMD_FORCE_INLINE void push_triangle_contacts(
-		const GIM_TRIANGLE_CONTACT_DATA & tricontact,
-		GUINT feature1,GUINT feature2)
-	{
-		for(GUINT i = 0;i<tricontact.m_point_count ;i++ )
-		{
-			push_back_mem();
-			GIM_CONTACT & newele = back();
-			newele.m_point = tricontact.m_points[i];
-			newele.m_normal = tricontact.m_separating_normal;
-			newele.m_depth = tricontact.m_penetration_depth;
-			newele.m_feature1 = feature1;
-			newele.m_feature2 = feature2;
-		}
-	}
-
-	void merge_contacts(const gim_contact_array & contacts, bool normal_contact_average = true);
-	void merge_contacts_unique(const gim_contact_array & contacts);
-};
-
-#endif // GIM_CONTACT_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_geom_types.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_geom_types.h
deleted file mode 100644
index 6b8f9ea..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_geom_types.h
+++ /dev/null
@@ -1,97 +0,0 @@
-#ifndef GIM_GEOM_TYPES_H_INCLUDED
-#define GIM_GEOM_TYPES_H_INCLUDED
-
-/*! \file gim_geom_types.h
-\author Francisco Leon Najera
-*/
-/*
------------------------------------------------------------------------------
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of EITHER:
-   (1) The GNU Lesser General Public License as published by the Free
-       Software Foundation; either version 2.1 of the License, or (at
-       your option) any later version. The text of the GNU Lesser
-       General Public License is included with this library in the
-       file GIMPACT-LICENSE-LGPL.TXT.
-   (2) The BSD-style license that is included with this library in
-       the file GIMPACT-LICENSE-BSD.TXT.
-   (3) The zlib/libpng license that is included with this library in
-       the file GIMPACT-LICENSE-ZLIB.TXT.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
-
------------------------------------------------------------------------------
-*/
-
-
-#include "gim_math.h"
-
-
-
-//! Short Integer vector 2D
-typedef GSHORT vec2s[2];
-//! Integer vector 3D
-typedef GSHORT vec3s[3];
-//! Integer vector 4D
-typedef GSHORT vec4s[4];
-
-//! Short Integer vector 2D
-typedef GUSHORT vec2us[2];
-//! Integer vector 3D
-typedef GUSHORT vec3us[3];
-//! Integer vector 4D
-typedef GUSHORT vec4us[4];
-
-//! Integer vector 2D
-typedef GINT vec2i[2];
-//! Integer vector 3D
-typedef GINT vec3i[3];
-//! Integer vector 4D
-typedef GINT vec4i[4];
-
-//! Unsigned Integer vector 2D
-typedef GUINT vec2ui[2];
-//! Unsigned Integer vector 3D
-typedef GUINT vec3ui[3];
-//! Unsigned Integer vector 4D
-typedef GUINT vec4ui[4];
-
-//! Float vector 2D
-typedef GREAL vec2f[2];
-//! Float vector 3D
-typedef GREAL vec3f[3];
-//! Float vector 4D
-typedef GREAL vec4f[4];
-
-//! Double vector 2D
-typedef GREAL2 vec2d[2];
-//! Float vector 3D
-typedef GREAL2 vec3d[3];
-//! Float vector 4D
-typedef GREAL2 vec4d[4];
-
-//! Matrix 2D, row ordered
-typedef GREAL mat2f[2][2];
-//! Matrix 3D, row ordered
-typedef GREAL mat3f[3][3];
-//! Matrix 4D, row ordered
-typedef GREAL mat4f[4][4];
-
-//! Quaternion
-typedef GREAL quatf[4];
-
-//typedef struct _aabb3f aabb3f;
-
-
-
-#endif // GIM_GEOM_TYPES_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_geometry.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_geometry.h
deleted file mode 100644
index c67a699..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_geometry.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef GIM_GEOMETRY_H_INCLUDED
-#define GIM_GEOMETRY_H_INCLUDED
-
-/*! \file gim_geometry.h
-\author Francisco Leon Najera
-*/
-/*
------------------------------------------------------------------------------
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of EITHER:
-   (1) The GNU Lesser General Public License as published by the Free
-       Software Foundation; either version 2.1 of the License, or (at
-       your option) any later version. The text of the GNU Lesser
-       General Public License is included with this library in the
-       file GIMPACT-LICENSE-LGPL.TXT.
-   (2) The BSD-style license that is included with this library in
-       the file GIMPACT-LICENSE-BSD.TXT.
-   (3) The zlib/libpng license that is included with this library in
-       the file GIMPACT-LICENSE-ZLIB.TXT.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
-
------------------------------------------------------------------------------
-*/
-
-///Additional Headers for Collision
-#include "gim_basic_geometry_operations.h"
-#include "gim_clip_polygon.h"
-#include "gim_box_collision.h"
-#include "gim_tri_collision.h"
-
-#endif // GIM_VECTOR_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_hash_table.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_hash_table.h
deleted file mode 100644
index e4237c2..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_hash_table.h
+++ /dev/null
@@ -1,902 +0,0 @@
-#ifndef GIM_HASH_TABLE_H_INCLUDED
-#define GIM_HASH_TABLE_H_INCLUDED
-/*! \file gim_trimesh_data.h
-\author Francisco Leon Najera
-*/
-/*
------------------------------------------------------------------------------
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of EITHER:
-   (1) The GNU Lesser General Public License as published by the Free
-       Software Foundation; either version 2.1 of the License, or (at
-       your option) any later version. The text of the GNU Lesser
-       General Public License is included with this library in the
-       file GIMPACT-LICENSE-LGPL.TXT.
-   (2) The BSD-style license that is included with this library in
-       the file GIMPACT-LICENSE-BSD.TXT.
-   (3) The zlib/libpng license that is included with this library in
-       the file GIMPACT-LICENSE-ZLIB.TXT.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
-
------------------------------------------------------------------------------
-*/
-
-#include "gim_radixsort.h"
-
-
-#define GIM_INVALID_HASH 0xffffffff //!< A very very high value
-#define GIM_DEFAULT_HASH_TABLE_SIZE 380
-#define GIM_DEFAULT_HASH_TABLE_NODE_SIZE 4
-#define GIM_HASH_TABLE_GROW_FACTOR 2
-
-#define GIM_MIN_RADIX_SORT_SIZE 860 //!< calibrated on a PIII
-
-template<typename T>
-struct GIM_HASH_TABLE_NODE
-{
-    GUINT m_key;
-    T m_data;
-    GIM_HASH_TABLE_NODE()
-    {
-    }
-
-    GIM_HASH_TABLE_NODE(const GIM_HASH_TABLE_NODE & value)
-    {
-        m_key = value.m_key;
-        m_data = value.m_data;
-    }
-
-    GIM_HASH_TABLE_NODE(GUINT key, const T & data)
-    {
-        m_key = key;
-        m_data = data;
-    }
-
-    bool operator <(const GIM_HASH_TABLE_NODE<T> & other) const
-	{
-		///inverse order, further objects are first
-		if(m_key <  other.m_key) return true;
-		return false;
-	}
-
-	bool operator >(const GIM_HASH_TABLE_NODE<T> & other) const
-	{
-		///inverse order, further objects are first
-		if(m_key >  other.m_key) return true;
-		return false;
-	}
-
-	bool operator ==(const GIM_HASH_TABLE_NODE<T> & other) const
-	{
-		///inverse order, further objects are first
-		if(m_key ==  other.m_key) return true;
-		return false;
-	}
-};
-
-///Macro for getting the key
-class GIM_HASH_NODE_GET_KEY
-{
-public:
-	template<class T>
-	inline GUINT operator()( const T& a)
-	{
-		return a.m_key;
-	}
-};
-
-
-
-///Macro for comparing the key and the element
-class GIM_HASH_NODE_CMP_KEY_MACRO
-{
-public:
-	template<class T>
-	inline int operator() ( const T& a, GUINT key)
-	{
-		return ((int)(a.m_key - key));
-	}
-};
-
-///Macro for comparing Hash nodes
-class GIM_HASH_NODE_CMP_MACRO
-{
-public:
-	template<class T>
-	inline int operator() ( const T& a, const T& b )
-	{
-		return ((int)(a.m_key - b.m_key));
-	}
-};
-
-
-
-
-
-//! Sorting for hash table
-/*!
-switch automatically between quicksort and radixsort
-*/
-template<typename T>
-void gim_sort_hash_node_array(T * array, GUINT array_count)
-{
-    if(array_count<GIM_MIN_RADIX_SORT_SIZE)
-    {
-    	gim_heap_sort(array,array_count,GIM_HASH_NODE_CMP_MACRO());
-    }
-    else
-    {
-    	memcopy_elements_func cmpfunc;
-    	gim_radix_sort(array,array_count,GIM_HASH_NODE_GET_KEY(),cmpfunc);
-    }
-}
-
-
-
-
-
-
-// Note: assumes long is at least 32 bits.
-#define GIM_NUM_PRIME 28
-
-static const GUINT gim_prime_list[GIM_NUM_PRIME] =
-{
-  53ul,         97ul,         193ul,       389ul,       769ul,
-  1543ul,       3079ul,       6151ul,      12289ul,     24593ul,
-  49157ul,      98317ul,      196613ul,    393241ul,    786433ul,
-  1572869ul,    3145739ul,    6291469ul,   12582917ul,  25165843ul,
-  50331653ul,   100663319ul,  201326611ul, 402653189ul, 805306457ul,
-  1610612741ul, 3221225473ul, 4294967291ul
-};
-
-inline GUINT gim_next_prime(GUINT number)
-{
-    //Find nearest upper prime
-    GUINT result_ind = 0;
-    gim_binary_search(gim_prime_list,0,(GIM_NUM_PRIME-2),number,result_ind);
-
-    // inv: result_ind < 28
-    return gim_prime_list[result_ind];
-}
-
-
-
-//! A compact hash table implementation
-/*!
-A memory aligned compact hash table that coud be treated as an array.
-It could be a simple sorted array without the overhead of the hash key bucked, or could
-be a formely hash table with an array of keys.
-You can use switch_to_hashtable() and switch_to_sorted_array for saving space or increase speed.
-</br>
-
-<ul>
-<li> if node_size = 0, then this container becomes a simple sorted array allocator. reserve_size is used for reserve memory in m_nodes.
-When the array size reaches the size equivalent to 'min_hash_table_size', then it becomes a hash table by calling check_for_switching_to_hashtable.
-<li> If node_size != 0, then this container becomes a hash table for ever
-</ul>
-
-*/
-template<class T>
-class gim_hash_table
-{
-protected:
-    typedef GIM_HASH_TABLE_NODE<T> _node_type;
-
-    //!The nodes
-    //array< _node_type, SuperAllocator<_node_type> > m_nodes;
-    gim_array< _node_type > m_nodes;
-    //SuperBufferedArray< _node_type > m_nodes;
-    bool m_sorted;
-
-    ///Hash table data management. The hash table has the indices to the corresponding m_nodes array
-    GUINT * m_hash_table;//!<
-    GUINT m_table_size;//!<
-    GUINT m_node_size;//!<
-    GUINT m_min_hash_table_size;
-
-
-
-    //! Returns the cell index
-    inline GUINT _find_cell(GUINT hashkey)
-    {
-        _node_type * nodesptr = m_nodes.pointer();
-        GUINT start_index = (hashkey%m_table_size)*m_node_size;
-        GUINT end_index = start_index + m_node_size;
-
-        while(start_index<end_index)
-        {
-            GUINT value = m_hash_table[start_index];
-            if(value != GIM_INVALID_HASH)
-            {
-                if(nodesptr[value].m_key == hashkey) return start_index;
-            }
-            start_index++;
-        }
-        return GIM_INVALID_HASH;
-    }
-
-    //! Find the avaliable cell for the hashkey, and return an existing cell if it has the same hash key
-    inline GUINT _find_avaliable_cell(GUINT hashkey)
-    {
-        _node_type * nodesptr = m_nodes.pointer();
-        GUINT avaliable_index = GIM_INVALID_HASH;
-        GUINT start_index = (hashkey%m_table_size)*m_node_size;
-        GUINT end_index = start_index + m_node_size;
-
-        while(start_index<end_index)
-        {
-            GUINT value = m_hash_table[start_index];
-            if(value == GIM_INVALID_HASH)
-            {
-                if(avaliable_index==GIM_INVALID_HASH)
-                {
-                    avaliable_index = start_index;
-                }
-            }
-            else if(nodesptr[value].m_key == hashkey)
-            {
-                return start_index;
-            }
-            start_index++;
-        }
-        return avaliable_index;
-    }
-
-
-
-    //! reserves the memory for the hash table.
-    /*!
-    \pre hash table must be empty
-    \post reserves the memory for the hash table, an initializes all elements to GIM_INVALID_HASH.
-    */
-    inline void _reserve_table_memory(GUINT newtablesize)
-    {
-        if(newtablesize==0) return;
-        if(m_node_size==0) return;
-
-        //Get a Prime size
-
-        m_table_size = gim_next_prime(newtablesize);
-
-        GUINT datasize = m_table_size*m_node_size;
-        //Alloc the data buffer
-        m_hash_table =  (GUINT *)gim_alloc(datasize*sizeof(GUINT));
-    }
-
-    inline void _invalidate_keys()
-    {
-        GUINT datasize = m_table_size*m_node_size;
-        for(GUINT i=0;i<datasize;i++)
-        {
-            m_hash_table[i] = GIM_INVALID_HASH;// invalidate keys
-        }
-    }
-
-    //! Clear all memory for the hash table
-    inline void _clear_table_memory()
-    {
-        if(m_hash_table==NULL) return;
-        gim_free(m_hash_table);
-        m_hash_table = NULL;
-        m_table_size = 0;
-    }
-
-    //! Invalidates the keys (Assigning GIM_INVALID_HASH to all) Reorders the hash keys
-    inline void _rehash()
-    {
-        _invalidate_keys();
-
-        _node_type * nodesptr = m_nodes.pointer();
-        for(GUINT i=0;i<(GUINT)m_nodes.size();i++)
-        {
-            GUINT nodekey = nodesptr[i].m_key;
-            if(nodekey != GIM_INVALID_HASH)
-            {
-                //Search for the avaliable cell in buffer
-                GUINT index = _find_avaliable_cell(nodekey);
-
-
-				if(m_hash_table[index]!=GIM_INVALID_HASH)
-				{//The new index is alreade used... discard this new incomming object, repeated key
-				    btAssert(m_hash_table[index]==nodekey);
-					nodesptr[i].m_key = GIM_INVALID_HASH;
-				}
-				else
-				{
-					//;
-					//Assign the value for alloc
-					m_hash_table[index] = i;
-				}
-            }
-        }
-    }
-
-    //! Resize hash table indices
-    inline void _resize_table(GUINT newsize)
-    {
-        //Clear memory
-        _clear_table_memory();
-        //Alloc the data
-        _reserve_table_memory(newsize);
-        //Invalidate keys and rehash
-        _rehash();
-    }
-
-    //! Destroy hash table memory
-    inline void _destroy()
-    {
-        if(m_hash_table==NULL) return;
-        _clear_table_memory();
-    }
-
-    //! Finds an avaliable hash table cell, and resizes the table if there isn't space
-    inline GUINT _assign_hash_table_cell(GUINT hashkey)
-    {
-        GUINT cell_index = _find_avaliable_cell(hashkey);
-
-        if(cell_index==GIM_INVALID_HASH)
-        {
-            //rehashing
-            _resize_table(m_table_size+1);
-            GUINT cell_index = _find_avaliable_cell(hashkey);
-            btAssert(cell_index!=GIM_INVALID_HASH);
-        }
-        return cell_index;
-    }
-
-    //! erase by index in hash table
-    inline bool _erase_by_index_hash_table(GUINT index)
-    {
-        if(index >= m_nodes.size()) return false;
-        if(m_nodes[index].m_key != GIM_INVALID_HASH)
-        {
-            //Search for the avaliable cell in buffer
-            GUINT cell_index = _find_cell(m_nodes[index].m_key);
-
-            btAssert(cell_index!=GIM_INVALID_HASH);
-            btAssert(m_hash_table[cell_index]==index);
-
-            m_hash_table[cell_index] = GIM_INVALID_HASH;
-        }
-
-        return this->_erase_unsorted(index);
-    }
-
-    //! erase by key in hash table
-    inline bool _erase_hash_table(GUINT hashkey)
-    {
-        if(hashkey == GIM_INVALID_HASH) return false;
-
-        //Search for the avaliable cell in buffer
-        GUINT cell_index = _find_cell(hashkey);
-        if(cell_index ==GIM_INVALID_HASH) return false;
-
-        GUINT index = m_hash_table[cell_index];
-        m_hash_table[cell_index] = GIM_INVALID_HASH;
-
-        return this->_erase_unsorted(index);
-    }
-
-
-
-    //! insert an element in hash table
-    /*!
-    If the element exists, this won't insert the element
-    \return the index in the array of the existing element,or GIM_INVALID_HASH if the element has been inserted
-    If so, the element has been inserted at the last position of the array.
-    */
-    inline GUINT _insert_hash_table(GUINT hashkey, const T & value)
-    {
-        if(hashkey==GIM_INVALID_HASH)
-        {
-            //Insert anyway
-            _insert_unsorted(hashkey,value);
-            return GIM_INVALID_HASH;
-        }
-
-        GUINT cell_index = _assign_hash_table_cell(hashkey);
-
-        GUINT value_key = m_hash_table[cell_index];
-
-        if(value_key!= GIM_INVALID_HASH) return value_key;// Not overrited
-
-        m_hash_table[cell_index] = m_nodes.size();
-
-        _insert_unsorted(hashkey,value);
-        return GIM_INVALID_HASH;
-    }
-
-    //! insert an element in hash table.
-    /*!
-    If the element exists, this replaces the element.
-    \return the index in the array of the existing element,or GIM_INVALID_HASH if the element has been inserted
-    If so, the element has been inserted at the last position of the array.
-    */
-    inline GUINT _insert_hash_table_replace(GUINT hashkey, const T & value)
-    {
-        if(hashkey==GIM_INVALID_HASH)
-        {
-            //Insert anyway
-            _insert_unsorted(hashkey,value);
-            return GIM_INVALID_HASH;
-        }
-
-        GUINT cell_index = _assign_hash_table_cell(hashkey);
-
-        GUINT value_key = m_hash_table[cell_index];
-
-        if(value_key!= GIM_INVALID_HASH)
-        {//replaces the existing
-            m_nodes[value_key] = _node_type(hashkey,value);
-            return value_key;// index of the replaced element
-        }
-
-        m_hash_table[cell_index] = m_nodes.size();
-
-        _insert_unsorted(hashkey,value);
-        return GIM_INVALID_HASH;
-
-    }
-
-    
-    ///Sorted array data management. The hash table has the indices to the corresponding m_nodes array
-    inline bool _erase_sorted(GUINT index)
-    {
-        if(index>=(GUINT)m_nodes.size()) return false;
-        m_nodes.erase_sorted(index);
-		if(m_nodes.size()<2) m_sorted = false;
-        return true;
-    }
-
-    //! faster, but unsorted
-    inline bool _erase_unsorted(GUINT index)
-    {
-        if(index>=m_nodes.size()) return false;
-
-        GUINT lastindex = m_nodes.size()-1;
-        if(index<lastindex && m_hash_table!=0)
-        {
-			GUINT hashkey =  m_nodes[lastindex].m_key;
-			if(hashkey!=GIM_INVALID_HASH)
-			{
-				//update the new position of the last element
-				GUINT cell_index = _find_cell(hashkey);
-				btAssert(cell_index!=GIM_INVALID_HASH);
-				//new position of the last element which will be swaped
-				m_hash_table[cell_index] = index;
-			}
-        }
-        m_nodes.erase(index);
-        m_sorted = false;
-        return true;
-    }
-
-    //! Insert in position ordered
-    /*!
-    Also checks if it is needed to transform this container to a hash table, by calling check_for_switching_to_hashtable
-    */
-    inline void _insert_in_pos(GUINT hashkey, const T & value, GUINT pos)
-    {
-        m_nodes.insert(_node_type(hashkey,value),pos);
-        this->check_for_switching_to_hashtable();
-    }
-
-    //! Insert an element in an ordered array
-    inline GUINT _insert_sorted(GUINT hashkey, const T & value)
-    {
-        if(hashkey==GIM_INVALID_HASH || size()==0)
-        {
-            m_nodes.push_back(_node_type(hashkey,value));
-            return GIM_INVALID_HASH;
-        }
-        //Insert at last position
-        //Sort element
-
-
-        GUINT result_ind=0;
-        GUINT last_index = m_nodes.size()-1;
-        _node_type * ptr = m_nodes.pointer();
-
-        bool found = gim_binary_search_ex(
-        	ptr,0,last_index,result_ind,hashkey,GIM_HASH_NODE_CMP_KEY_MACRO());
-
-
-        //Insert before found index
-        if(found)
-        {
-            return result_ind;
-        }
-        else
-        {
-            _insert_in_pos(hashkey, value, result_ind);
-        }
-        return GIM_INVALID_HASH;
-    }
-
-    inline GUINT _insert_sorted_replace(GUINT hashkey, const T & value)
-    {
-        if(hashkey==GIM_INVALID_HASH || size()==0)
-        {
-            m_nodes.push_back(_node_type(hashkey,value));
-            return GIM_INVALID_HASH;
-        }
-        //Insert at last position
-        //Sort element
-        GUINT result_ind;
-        GUINT last_index = m_nodes.size()-1;
-        _node_type * ptr = m_nodes.pointer();
-
-        bool found = gim_binary_search_ex(
-        	ptr,0,last_index,result_ind,hashkey,GIM_HASH_NODE_CMP_KEY_MACRO());
-
-        //Insert before found index
-        if(found)
-        {
-            m_nodes[result_ind] = _node_type(hashkey,value);
-        }
-        else
-        {
-            _insert_in_pos(hashkey, value, result_ind);
-        }
-        return result_ind;
-    }
-
-    //! Fast insertion in m_nodes array
-    inline GUINT  _insert_unsorted(GUINT hashkey, const T & value)
-    {
-        m_nodes.push_back(_node_type(hashkey,value));
-        m_sorted = false;
-        return GIM_INVALID_HASH;
-    }
-
-    
-
-public:
-
-    /*!
-        <li> if node_size = 0, then this container becomes a simple sorted array allocator. reserve_size is used for reserve memory in m_nodes.
-        When the array size reaches the size equivalent to 'min_hash_table_size', then it becomes a hash table by calling check_for_switching_to_hashtable.
-        <li> If node_size != 0, then this container becomes a hash table for ever
-        </ul>
-    */
-    gim_hash_table(GUINT reserve_size = GIM_DEFAULT_HASH_TABLE_SIZE,
-                     GUINT node_size = GIM_DEFAULT_HASH_TABLE_NODE_SIZE,
-                     GUINT min_hash_table_size = GIM_INVALID_HASH)
-    {
-        m_hash_table = NULL;
-        m_table_size = 0;
-        m_sorted = false;
-        m_node_size = node_size;
-        m_min_hash_table_size = min_hash_table_size;
-
-        if(m_node_size!=0)
-        {
-            if(reserve_size!=0)
-            {
-                m_nodes.reserve(reserve_size);
-                _reserve_table_memory(reserve_size);
-                _invalidate_keys();
-            }
-            else
-            {
-                m_nodes.reserve(GIM_DEFAULT_HASH_TABLE_SIZE);
-                _reserve_table_memory(GIM_DEFAULT_HASH_TABLE_SIZE);
-                _invalidate_keys();
-            }
-        }
-        else if(reserve_size!=0)
-        {
-            m_nodes.reserve(reserve_size);
-        }
-
-    }
-
-    ~gim_hash_table()
-    {
-        _destroy();
-    }
-
-    inline bool is_hash_table()
-    {
-        if(m_hash_table) return true;
-        return false;
-    }
-
-    inline bool is_sorted()
-    {
-        if(size()<2) return true;
-        return m_sorted;
-    }
-
-    bool sort()
-    {
-        if(is_sorted()) return true;
-        if(m_nodes.size()<2) return false;
-
-
-        _node_type * ptr = m_nodes.pointer();
-        GUINT siz = m_nodes.size();
-        gim_sort_hash_node_array(ptr,siz);
-        m_sorted=true;
-
-
-
-        if(m_hash_table)
-        {
-            _rehash();
-        }
-        return true;
-    }
-
-    bool switch_to_hashtable()
-    {
-        if(m_hash_table) return false;
-        if(m_node_size==0) m_node_size = GIM_DEFAULT_HASH_TABLE_NODE_SIZE;
-        if(m_nodes.size()<GIM_DEFAULT_HASH_TABLE_SIZE)
-        {
-            _resize_table(GIM_DEFAULT_HASH_TABLE_SIZE);
-        }
-        else
-        {
-            _resize_table(m_nodes.size()+1);
-        }
-
-        return true;
-    }
-
-    bool switch_to_sorted_array()
-    {
-        if(m_hash_table==NULL) return true;
-        _clear_table_memory();
-        return sort();
-    }
-
-    //!If the container reaches the
-    bool check_for_switching_to_hashtable()
-    {
-        if(this->m_hash_table) return true;
-
-        if(!(m_nodes.size()< m_min_hash_table_size))
-        {
-            if(m_node_size == 0)
-            {
-                m_node_size = GIM_DEFAULT_HASH_TABLE_NODE_SIZE;
-            }
-
-            _resize_table(m_nodes.size()+1);
-            return true;
-        }
-        return false;
-    }
-
-    inline void set_sorted(bool value)
-    {
-    	m_sorted = value;
-    }
-
-    //! Retrieves the amount of keys.
-    inline GUINT size() const
-    {
-        return m_nodes.size();
-    }
-
-    //! Retrieves the hash key.
-    inline GUINT get_key(GUINT index) const
-    {
-        return m_nodes[index].m_key;
-    }
-
-    //! Retrieves the value by index
-    /*!
-    */
-    inline T * get_value_by_index(GUINT index)
-    {
-        return &m_nodes[index].m_data;
-    }
-
-    inline const T& operator[](GUINT index) const
-    {
-        return m_nodes[index].m_data;
-    }
-
-    inline T& operator[](GUINT index)
-    {
-        return m_nodes[index].m_data;
-    }
-
-    //! Finds the index of the element with the key
-    /*!
-    \return the index in the array of the existing element,or GIM_INVALID_HASH if the element has been inserted
-    If so, the element has been inserted at the last position of the array.
-    */
-    inline GUINT find(GUINT hashkey)
-    {
-        if(m_hash_table)
-        {
-            GUINT cell_index = _find_cell(hashkey);
-            if(cell_index==GIM_INVALID_HASH) return GIM_INVALID_HASH;
-            return m_hash_table[cell_index];
-        }
-		GUINT last_index = m_nodes.size();
-        if(last_index<2)
-        {
-			if(last_index==0) return GIM_INVALID_HASH;
-            if(m_nodes[0].m_key == hashkey) return 0;
-            return GIM_INVALID_HASH;
-        }
-        else if(m_sorted)
-        {
-            //Binary search
-            GUINT result_ind = 0;
-			last_index--;
-            _node_type *  ptr =  m_nodes.pointer();
-
-            bool found = gim_binary_search_ex(ptr,0,last_index,result_ind,hashkey,GIM_HASH_NODE_CMP_KEY_MACRO());
-
-
-            if(found) return result_ind;
-        }
-        return GIM_INVALID_HASH;
-    }
-
-    //! Retrieves the value associated with the index
-    /*!
-    \return the found element, or null
-    */
-    inline T * get_value(GUINT hashkey)
-    {
-        GUINT index = find(hashkey);
-        if(index == GIM_INVALID_HASH) return NULL;
-        return &m_nodes[index].m_data;
-    }
-
-
-    /*!
-    */
-    inline bool erase_by_index(GUINT index)
-    {
-        if(index > m_nodes.size()) return false;
-
-        if(m_hash_table == NULL)
-        {
-            if(is_sorted())
-            {
-                return this->_erase_sorted(index);
-            }
-            else
-            {
-                return this->_erase_unsorted(index);
-            }
-        }
-        else
-        {
-            return this->_erase_by_index_hash_table(index);
-        }
-        return false;
-    }
-
-
-
-    inline bool erase_by_index_unsorted(GUINT index)
-    {
-        if(index > m_nodes.size()) return false;
-
-        if(m_hash_table == NULL)
-        {
-            return this->_erase_unsorted(index);
-        }
-        else
-        {
-            return this->_erase_by_index_hash_table(index);
-        }
-        return false;
-    }
-
-
-
-    /*!
-
-    */
-    inline bool erase_by_key(GUINT hashkey)
-    {
-        if(size()==0) return false;
-
-        if(m_hash_table)
-        {
-            return this->_erase_hash_table(hashkey);
-        }
-        //Binary search
-
-        if(is_sorted()==false) return false;
-
-        GUINT result_ind = find(hashkey);
-        if(result_ind!= GIM_INVALID_HASH)
-        {
-            return this->_erase_sorted(result_ind);
-        }
-        return false;
-    }
-
-    void clear()
-    {
-        m_nodes.clear();
-
-        if(m_hash_table==NULL) return;
-        GUINT datasize = m_table_size*m_node_size;
-        //Initialize the hashkeys.
-        GUINT i;
-        for(i=0;i<datasize;i++)
-        {
-            m_hash_table[i] = GIM_INVALID_HASH;// invalidate keys
-        }
-		m_sorted = false;
-    }
-
-    //! Insert an element into the hash
-    /*!
-    \return If GIM_INVALID_HASH, the object has been inserted succesfully. Else it returns the position
-    of the existing element.
-    */
-    inline GUINT insert(GUINT hashkey, const T & element)
-    {
-        if(m_hash_table)
-        {
-            return this->_insert_hash_table(hashkey,element);
-        }
-        if(this->is_sorted())
-        {
-            return this->_insert_sorted(hashkey,element);
-        }
-        return this->_insert_unsorted(hashkey,element);
-    }
-
-    //! Insert an element into the hash, and could overrite an existing object with the same hash.
-    /*!
-    \return If GIM_INVALID_HASH, the object has been inserted succesfully. Else it returns the position
-    of the replaced element.
-    */
-    inline GUINT insert_override(GUINT hashkey, const T & element)
-    {
-        if(m_hash_table)
-        {
-            return this->_insert_hash_table_replace(hashkey,element);
-        }
-        if(this->is_sorted())
-        {
-            return this->_insert_sorted_replace(hashkey,element);
-        }
-        this->_insert_unsorted(hashkey,element);
-        return m_nodes.size();
-    }
-
-
-
-    //! Insert an element into the hash,But if this container is a sorted array, this inserts it unsorted
-    /*!
-    */
-    inline GUINT insert_unsorted(GUINT hashkey,const T & element)
-    {
-        if(m_hash_table)
-        {
-            return this->_insert_hash_table(hashkey,element);
-        }
-        return this->_insert_unsorted(hashkey,element);
-    }
-
-
-};
-
-
-
-#endif // GIM_CONTAINERS_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_linear_math.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_linear_math.h
deleted file mode 100644
index 64f11b4..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_linear_math.h
+++ /dev/null
@@ -1,1573 +0,0 @@
-#ifndef GIM_LINEAR_H_INCLUDED
-#define GIM_LINEAR_H_INCLUDED
-
-/*! \file gim_linear_math.h
-*\author Francisco Leon Najera
-Type Independant Vector and matrix operations.
-*/
-/*
------------------------------------------------------------------------------
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of EITHER:
-   (1) The GNU Lesser General Public License as published by the Free
-       Software Foundation; either version 2.1 of the License, or (at
-       your option) any later version. The text of the GNU Lesser
-       General Public License is included with this library in the
-       file GIMPACT-LICENSE-LGPL.TXT.
-   (2) The BSD-style license that is included with this library in
-       the file GIMPACT-LICENSE-BSD.TXT.
-   (3) The zlib/libpng license that is included with this library in
-       the file GIMPACT-LICENSE-ZLIB.TXT.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
-
------------------------------------------------------------------------------
-*/
-
-
-#include "gim_math.h"
-#include "gim_geom_types.h"
-
-
-
-
-//! Zero out a 2D vector
-#define VEC_ZERO_2(a)				\
-{						\
-   (a)[0] = (a)[1] = 0.0f;			\
-}\
-
-
-//! Zero out a 3D vector
-#define VEC_ZERO(a)				\
-{						\
-   (a)[0] = (a)[1] = (a)[2] = 0.0f;		\
-}\
-
-
-/// Zero out a 4D vector
-#define VEC_ZERO_4(a)				\
-{						\
-   (a)[0] = (a)[1] = (a)[2] = (a)[3] = 0.0f;	\
-}\
-
-
-/// Vector copy
-#define VEC_COPY_2(b,a)				\
-{						\
-   (b)[0] = (a)[0];				\
-   (b)[1] = (a)[1];				\
-}\
-
-
-/// Copy 3D vector
-#define VEC_COPY(b,a)				\
-{						\
-   (b)[0] = (a)[0];				\
-   (b)[1] = (a)[1];				\
-   (b)[2] = (a)[2];				\
-}\
-
-
-/// Copy 4D vector
-#define VEC_COPY_4(b,a)				\
-{						\
-   (b)[0] = (a)[0];				\
-   (b)[1] = (a)[1];				\
-   (b)[2] = (a)[2];				\
-   (b)[3] = (a)[3];				\
-}\
-
-/// VECTOR SWAP
-#define VEC_SWAP(b,a)				\
-{  \
-    GIM_SWAP_NUMBERS((b)[0],(a)[0]);\
-    GIM_SWAP_NUMBERS((b)[1],(a)[1]);\
-    GIM_SWAP_NUMBERS((b)[2],(a)[2]);\
-}\
-
-/// Vector difference
-#define VEC_DIFF_2(v21,v2,v1)			\
-{						\
-   (v21)[0] = (v2)[0] - (v1)[0];		\
-   (v21)[1] = (v2)[1] - (v1)[1];		\
-}\
-
-
-/// Vector difference
-#define VEC_DIFF(v21,v2,v1)			\
-{						\
-   (v21)[0] = (v2)[0] - (v1)[0];		\
-   (v21)[1] = (v2)[1] - (v1)[1];		\
-   (v21)[2] = (v2)[2] - (v1)[2];		\
-}\
-
-
-/// Vector difference
-#define VEC_DIFF_4(v21,v2,v1)			\
-{						\
-   (v21)[0] = (v2)[0] - (v1)[0];		\
-   (v21)[1] = (v2)[1] - (v1)[1];		\
-   (v21)[2] = (v2)[2] - (v1)[2];		\
-   (v21)[3] = (v2)[3] - (v1)[3];		\
-}\
-
-
-/// Vector sum
-#define VEC_SUM_2(v21,v2,v1)			\
-{						\
-   (v21)[0] = (v2)[0] + (v1)[0];		\
-   (v21)[1] = (v2)[1] + (v1)[1];		\
-}\
-
-
-/// Vector sum
-#define VEC_SUM(v21,v2,v1)			\
-{						\
-   (v21)[0] = (v2)[0] + (v1)[0];		\
-   (v21)[1] = (v2)[1] + (v1)[1];		\
-   (v21)[2] = (v2)[2] + (v1)[2];		\
-}\
-
-
-/// Vector sum
-#define VEC_SUM_4(v21,v2,v1)			\
-{						\
-   (v21)[0] = (v2)[0] + (v1)[0];		\
-   (v21)[1] = (v2)[1] + (v1)[1];		\
-   (v21)[2] = (v2)[2] + (v1)[2];		\
-   (v21)[3] = (v2)[3] + (v1)[3];		\
-}\
-
-
-/// scalar times vector
-#define VEC_SCALE_2(c,a,b)			\
-{						\
-   (c)[0] = (a)*(b)[0];				\
-   (c)[1] = (a)*(b)[1];				\
-}\
-
-
-/// scalar times vector
-#define VEC_SCALE(c,a,b)			\
-{						\
-   (c)[0] = (a)*(b)[0];				\
-   (c)[1] = (a)*(b)[1];				\
-   (c)[2] = (a)*(b)[2];				\
-}\
-
-
-/// scalar times vector
-#define VEC_SCALE_4(c,a,b)			\
-{						\
-   (c)[0] = (a)*(b)[0];				\
-   (c)[1] = (a)*(b)[1];				\
-   (c)[2] = (a)*(b)[2];				\
-   (c)[3] = (a)*(b)[3];				\
-}\
-
-
-/// accumulate scaled vector
-#define VEC_ACCUM_2(c,a,b)			\
-{						\
-   (c)[0] += (a)*(b)[0];			\
-   (c)[1] += (a)*(b)[1];			\
-}\
-
-
-/// accumulate scaled vector
-#define VEC_ACCUM(c,a,b)			\
-{						\
-   (c)[0] += (a)*(b)[0];			\
-   (c)[1] += (a)*(b)[1];			\
-   (c)[2] += (a)*(b)[2];			\
-}\
-
-
-/// accumulate scaled vector
-#define VEC_ACCUM_4(c,a,b)			\
-{						\
-   (c)[0] += (a)*(b)[0];			\
-   (c)[1] += (a)*(b)[1];			\
-   (c)[2] += (a)*(b)[2];			\
-   (c)[3] += (a)*(b)[3];			\
-}\
-
-
-/// Vector dot product
-#define VEC_DOT_2(a,b) ((a)[0]*(b)[0] + (a)[1]*(b)[1])
-
-
-/// Vector dot product
-#define VEC_DOT(a,b) ((a)[0]*(b)[0] + (a)[1]*(b)[1] + (a)[2]*(b)[2])
-
-/// Vector dot product
-#define VEC_DOT_4(a,b)	((a)[0]*(b)[0] + (a)[1]*(b)[1] + (a)[2]*(b)[2] + (a)[3]*(b)[3])
-
-/// vector impact parameter (squared)
-#define VEC_IMPACT_SQ(bsq,direction,position) {\
-   GREAL _llel_ = VEC_DOT(direction, position);\
-   bsq = VEC_DOT(position, position) - _llel_*_llel_;\
-}\
-
-
-/// vector impact parameter
-#define VEC_IMPACT(bsq,direction,position)	{\
-   VEC_IMPACT_SQ(bsq,direction,position);		\
-   GIM_SQRT(bsq,bsq);					\
-}\
-
-/// Vector length
-#define VEC_LENGTH_2(a,l)\
-{\
-    GREAL _pp = VEC_DOT_2(a,a);\
-    GIM_SQRT(_pp,l);\
-}\
-
-
-/// Vector length
-#define VEC_LENGTH(a,l)\
-{\
-    GREAL _pp = VEC_DOT(a,a);\
-    GIM_SQRT(_pp,l);\
-}\
-
-
-/// Vector length
-#define VEC_LENGTH_4(a,l)\
-{\
-    GREAL _pp = VEC_DOT_4(a,a);\
-    GIM_SQRT(_pp,l);\
-}\
-
-/// Vector inv length
-#define VEC_INV_LENGTH_2(a,l)\
-{\
-    GREAL _pp = VEC_DOT_2(a,a);\
-    GIM_INV_SQRT(_pp,l);\
-}\
-
-
-/// Vector inv length
-#define VEC_INV_LENGTH(a,l)\
-{\
-    GREAL _pp = VEC_DOT(a,a);\
-    GIM_INV_SQRT(_pp,l);\
-}\
-
-
-/// Vector inv length
-#define VEC_INV_LENGTH_4(a,l)\
-{\
-    GREAL _pp = VEC_DOT_4(a,a);\
-    GIM_INV_SQRT(_pp,l);\
-}\
-
-
-
-/// distance between two points
-#define VEC_DISTANCE(_len,_va,_vb) {\
-    vec3f _tmp_;				\
-    VEC_DIFF(_tmp_, _vb, _va);			\
-    VEC_LENGTH(_tmp_,_len);			\
-}\
-
-
-/// Vector length
-#define VEC_CONJUGATE_LENGTH(a,l)\
-{\
-    GREAL _pp = 1.0 - a[0]*a[0] - a[1]*a[1] - a[2]*a[2];\
-    GIM_SQRT(_pp,l);\
-}\
-
-
-/// Vector length
-#define VEC_NORMALIZE(a) {	\
-    GREAL len;\
-    VEC_INV_LENGTH(a,len); \
-    if(len<G_REAL_INFINITY)\
-    {\
-        a[0] *= len;				\
-        a[1] *= len;				\
-        a[2] *= len;				\
-    }						\
-}\
-
-/// Set Vector size
-#define VEC_RENORMALIZE(a,newlen) {	\
-    GREAL len;\
-    VEC_INV_LENGTH(a,len); \
-    if(len<G_REAL_INFINITY)\
-    {\
-        len *= newlen;\
-        a[0] *= len;				\
-        a[1] *= len;				\
-        a[2] *= len;				\
-    }						\
-}\
-
-/// Vector cross
-#define VEC_CROSS(c,a,b)		\
-{						\
-   c[0] = (a)[1] * (b)[2] - (a)[2] * (b)[1];	\
-   c[1] = (a)[2] * (b)[0] - (a)[0] * (b)[2];	\
-   c[2] = (a)[0] * (b)[1] - (a)[1] * (b)[0];	\
-}\
-
-
-/*! Vector perp -- assumes that n is of unit length
- * accepts vector v, subtracts out any component parallel to n */
-#define VEC_PERPENDICULAR(vp,v,n)			\
-{						\
-   GREAL dot = VEC_DOT(v, n);			\
-   vp[0] = (v)[0] - dot*(n)[0];		\
-   vp[1] = (v)[1] - dot*(n)[1];		\
-   vp[2] = (v)[2] - dot*(n)[2];		\
-}\
-
-
-/*! Vector parallel -- assumes that n is of unit length */
-#define VEC_PARALLEL(vp,v,n)			\
-{						\
-   GREAL dot = VEC_DOT(v, n);			\
-   vp[0] = (dot) * (n)[0];			\
-   vp[1] = (dot) * (n)[1];			\
-   vp[2] = (dot) * (n)[2];			\
-}\
-
-/*! Same as Vector parallel --  n can have any length
- * accepts vector v, subtracts out any component perpendicular to n */
-#define VEC_PROJECT(vp,v,n)			\
-{ \
-	GREAL scalar = VEC_DOT(v, n);			\
-	scalar/= VEC_DOT(n, n); \
-	vp[0] = (scalar) * (n)[0];			\
-    vp[1] = (scalar) * (n)[1];			\
-    vp[2] = (scalar) * (n)[2];			\
-}\
-
-
-/*! accepts vector v*/
-#define VEC_UNPROJECT(vp,v,n)			\
-{ \
-	GREAL scalar = VEC_DOT(v, n);			\
-	scalar = VEC_DOT(n, n)/scalar; \
-	vp[0] = (scalar) * (n)[0];			\
-    vp[1] = (scalar) * (n)[1];			\
-    vp[2] = (scalar) * (n)[2];			\
-}\
-
-
-/*! Vector reflection -- assumes n is of unit length
- Takes vector v, reflects it against reflector n, and returns vr */
-#define VEC_REFLECT(vr,v,n)			\
-{						\
-   GREAL dot = VEC_DOT(v, n);			\
-   vr[0] = (v)[0] - 2.0 * (dot) * (n)[0];	\
-   vr[1] = (v)[1] - 2.0 * (dot) * (n)[1];	\
-   vr[2] = (v)[2] - 2.0 * (dot) * (n)[2];	\
-}\
-
-
-/*! Vector blending
-Takes two vectors a, b, blends them together with two scalars */
-#define VEC_BLEND_AB(vr,sa,a,sb,b)			\
-{						\
-   vr[0] = (sa) * (a)[0] + (sb) * (b)[0];	\
-   vr[1] = (sa) * (a)[1] + (sb) * (b)[1];	\
-   vr[2] = (sa) * (a)[2] + (sb) * (b)[2];	\
-}\
-
-/*! Vector blending
-Takes two vectors a, b, blends them together with s <=1 */
-#define VEC_BLEND(vr,a,b,s) VEC_BLEND_AB(vr,(1-s),a,s,b)
-
-#define VEC_SET3(a,b,op,c) a[0]=b[0] op c[0]; a[1]=b[1] op c[1]; a[2]=b[2] op c[2];
-
-//! Finds the bigger cartesian coordinate from a vector
-#define VEC_MAYOR_COORD(vec, maxc)\
-{\
-	GREAL A[] = {fabs(vec[0]),fabs(vec[1]),fabs(vec[2])};\
-    maxc =  A[0]>A[1]?(A[0]>A[2]?0:2):(A[1]>A[2]?1:2);\
-}\
-
-//! Finds the 2 smallest cartesian coordinates from a vector
-#define VEC_MINOR_AXES(vec, i0, i1)\
-{\
-	VEC_MAYOR_COORD(vec,i0);\
-	i0 = (i0+1)%3;\
-	i1 = (i0+1)%3;\
-}\
-
-
-
-
-#define VEC_EQUAL(v1,v2) (v1[0]==v2[0]&&v1[1]==v2[1]&&v1[2]==v2[2])
-
-#define VEC_NEAR_EQUAL(v1,v2) (GIM_NEAR_EQUAL(v1[0],v2[0])&&GIM_NEAR_EQUAL(v1[1],v2[1])&&GIM_NEAR_EQUAL(v1[2],v2[2]))
-
-
-/// Vector cross
-#define X_AXIS_CROSS_VEC(dst,src)\
-{					   \
-	dst[0] = 0.0f;     \
-	dst[1] = -src[2];  \
-	dst[2] = src[1];  \
-}\
-
-#define Y_AXIS_CROSS_VEC(dst,src)\
-{					   \
-	dst[0] = src[2];     \
-	dst[1] = 0.0f;  \
-	dst[2] = -src[0];  \
-}\
-
-#define Z_AXIS_CROSS_VEC(dst,src)\
-{					   \
-	dst[0] = -src[1];     \
-	dst[1] = src[0];  \
-	dst[2] = 0.0f;  \
-}\
-
-
-
-
-
-
-/// initialize matrix
-#define IDENTIFY_MATRIX_3X3(m)			\
-{						\
-   m[0][0] = 1.0;				\
-   m[0][1] = 0.0;				\
-   m[0][2] = 0.0;				\
-						\
-   m[1][0] = 0.0;				\
-   m[1][1] = 1.0;				\
-   m[1][2] = 0.0;				\
-						\
-   m[2][0] = 0.0;				\
-   m[2][1] = 0.0;				\
-   m[2][2] = 1.0;				\
-}\
-
-/*! initialize matrix */
-#define IDENTIFY_MATRIX_4X4(m)			\
-{						\
-   m[0][0] = 1.0;				\
-   m[0][1] = 0.0;				\
-   m[0][2] = 0.0;				\
-   m[0][3] = 0.0;				\
-						\
-   m[1][0] = 0.0;				\
-   m[1][1] = 1.0;				\
-   m[1][2] = 0.0;				\
-   m[1][3] = 0.0;				\
-						\
-   m[2][0] = 0.0;				\
-   m[2][1] = 0.0;				\
-   m[2][2] = 1.0;				\
-   m[2][3] = 0.0;				\
-						\
-   m[3][0] = 0.0;				\
-   m[3][1] = 0.0;				\
-   m[3][2] = 0.0;				\
-   m[3][3] = 1.0;				\
-}\
-
-/*! initialize matrix */
-#define ZERO_MATRIX_4X4(m)			\
-{						\
-   m[0][0] = 0.0;				\
-   m[0][1] = 0.0;				\
-   m[0][2] = 0.0;				\
-   m[0][3] = 0.0;				\
-						\
-   m[1][0] = 0.0;				\
-   m[1][1] = 0.0;				\
-   m[1][2] = 0.0;				\
-   m[1][3] = 0.0;				\
-						\
-   m[2][0] = 0.0;				\
-   m[2][1] = 0.0;				\
-   m[2][2] = 0.0;				\
-   m[2][3] = 0.0;				\
-						\
-   m[3][0] = 0.0;				\
-   m[3][1] = 0.0;				\
-   m[3][2] = 0.0;				\
-   m[3][3] = 0.0;				\
-}\
-
-/*! matrix rotation  X */
-#define ROTX_CS(m,cosine,sine)		\
-{					\
-   /* rotation about the x-axis */	\
-					\
-   m[0][0] = 1.0;			\
-   m[0][1] = 0.0;			\
-   m[0][2] = 0.0;			\
-   m[0][3] = 0.0;			\
-					\
-   m[1][0] = 0.0;			\
-   m[1][1] = (cosine);			\
-   m[1][2] = (sine);			\
-   m[1][3] = 0.0;			\
-					\
-   m[2][0] = 0.0;			\
-   m[2][1] = -(sine);			\
-   m[2][2] = (cosine);			\
-   m[2][3] = 0.0;			\
-					\
-   m[3][0] = 0.0;			\
-   m[3][1] = 0.0;			\
-   m[3][2] = 0.0;			\
-   m[3][3] = 1.0;			\
-}\
-
-/*! matrix rotation  Y */
-#define ROTY_CS(m,cosine,sine)		\
-{					\
-   /* rotation about the y-axis */	\
-					\
-   m[0][0] = (cosine);			\
-   m[0][1] = 0.0;			\
-   m[0][2] = -(sine);			\
-   m[0][3] = 0.0;			\
-					\
-   m[1][0] = 0.0;			\
-   m[1][1] = 1.0;			\
-   m[1][2] = 0.0;			\
-   m[1][3] = 0.0;			\
-					\
-   m[2][0] = (sine);			\
-   m[2][1] = 0.0;			\
-   m[2][2] = (cosine);			\
-   m[2][3] = 0.0;			\
-					\
-   m[3][0] = 0.0;			\
-   m[3][1] = 0.0;			\
-   m[3][2] = 0.0;			\
-   m[3][3] = 1.0;			\
-}\
-
-/*! matrix rotation  Z */
-#define ROTZ_CS(m,cosine,sine)		\
-{					\
-   /* rotation about the z-axis */	\
-					\
-   m[0][0] = (cosine);			\
-   m[0][1] = (sine);			\
-   m[0][2] = 0.0;			\
-   m[0][3] = 0.0;			\
-					\
-   m[1][0] = -(sine);			\
-   m[1][1] = (cosine);			\
-   m[1][2] = 0.0;			\
-   m[1][3] = 0.0;			\
-					\
-   m[2][0] = 0.0;			\
-   m[2][1] = 0.0;			\
-   m[2][2] = 1.0;			\
-   m[2][3] = 0.0;			\
-					\
-   m[3][0] = 0.0;			\
-   m[3][1] = 0.0;			\
-   m[3][2] = 0.0;			\
-   m[3][3] = 1.0;			\
-}\
-
-/*! matrix copy */
-#define COPY_MATRIX_2X2(b,a)	\
-{				\
-   b[0][0] = a[0][0];		\
-   b[0][1] = a[0][1];		\
-				\
-   b[1][0] = a[1][0];		\
-   b[1][1] = a[1][1];		\
-				\
-}\
-
-
-/*! matrix copy */
-#define COPY_MATRIX_2X3(b,a)	\
-{				\
-   b[0][0] = a[0][0];		\
-   b[0][1] = a[0][1];		\
-   b[0][2] = a[0][2];		\
-				\
-   b[1][0] = a[1][0];		\
-   b[1][1] = a[1][1];		\
-   b[1][2] = a[1][2];		\
-}\
-
-
-/*! matrix copy */
-#define COPY_MATRIX_3X3(b,a)	\
-{				\
-   b[0][0] = a[0][0];		\
-   b[0][1] = a[0][1];		\
-   b[0][2] = a[0][2];		\
-				\
-   b[1][0] = a[1][0];		\
-   b[1][1] = a[1][1];		\
-   b[1][2] = a[1][2];		\
-				\
-   b[2][0] = a[2][0];		\
-   b[2][1] = a[2][1];		\
-   b[2][2] = a[2][2];		\
-}\
-
-
-/*! matrix copy */
-#define COPY_MATRIX_4X4(b,a)	\
-{				\
-   b[0][0] = a[0][0];		\
-   b[0][1] = a[0][1];		\
-   b[0][2] = a[0][2];		\
-   b[0][3] = a[0][3];		\
-				\
-   b[1][0] = a[1][0];		\
-   b[1][1] = a[1][1];		\
-   b[1][2] = a[1][2];		\
-   b[1][3] = a[1][3];		\
-				\
-   b[2][0] = a[2][0];		\
-   b[2][1] = a[2][1];		\
-   b[2][2] = a[2][2];		\
-   b[2][3] = a[2][3];		\
-				\
-   b[3][0] = a[3][0];		\
-   b[3][1] = a[3][1];		\
-   b[3][2] = a[3][2];		\
-   b[3][3] = a[3][3];		\
-}\
-
-
-/*! matrix transpose */
-#define TRANSPOSE_MATRIX_2X2(b,a)	\
-{				\
-   b[0][0] = a[0][0];		\
-   b[0][1] = a[1][0];		\
-				\
-   b[1][0] = a[0][1];		\
-   b[1][1] = a[1][1];		\
-}\
-
-
-/*! matrix transpose */
-#define TRANSPOSE_MATRIX_3X3(b,a)	\
-{				\
-   b[0][0] = a[0][0];		\
-   b[0][1] = a[1][0];		\
-   b[0][2] = a[2][0];		\
-				\
-   b[1][0] = a[0][1];		\
-   b[1][1] = a[1][1];		\
-   b[1][2] = a[2][1];		\
-				\
-   b[2][0] = a[0][2];		\
-   b[2][1] = a[1][2];		\
-   b[2][2] = a[2][2];		\
-}\
-
-
-/*! matrix transpose */
-#define TRANSPOSE_MATRIX_4X4(b,a)	\
-{				\
-   b[0][0] = a[0][0];		\
-   b[0][1] = a[1][0];		\
-   b[0][2] = a[2][0];		\
-   b[0][3] = a[3][0];		\
-				\
-   b[1][0] = a[0][1];		\
-   b[1][1] = a[1][1];		\
-   b[1][2] = a[2][1];		\
-   b[1][3] = a[3][1];		\
-				\
-   b[2][0] = a[0][2];		\
-   b[2][1] = a[1][2];		\
-   b[2][2] = a[2][2];		\
-   b[2][3] = a[3][2];		\
-				\
-   b[3][0] = a[0][3];		\
-   b[3][1] = a[1][3];		\
-   b[3][2] = a[2][3];		\
-   b[3][3] = a[3][3];		\
-}\
-
-
-/*! multiply matrix by scalar */
-#define SCALE_MATRIX_2X2(b,s,a)		\
-{					\
-   b[0][0] = (s) * a[0][0];		\
-   b[0][1] = (s) * a[0][1];		\
-					\
-   b[1][0] = (s) * a[1][0];		\
-   b[1][1] = (s) * a[1][1];		\
-}\
-
-
-/*! multiply matrix by scalar */
-#define SCALE_MATRIX_3X3(b,s,a)		\
-{					\
-   b[0][0] = (s) * a[0][0];		\
-   b[0][1] = (s) * a[0][1];		\
-   b[0][2] = (s) * a[0][2];		\
-					\
-   b[1][0] = (s) * a[1][0];		\
-   b[1][1] = (s) * a[1][1];		\
-   b[1][2] = (s) * a[1][2];		\
-					\
-   b[2][0] = (s) * a[2][0];		\
-   b[2][1] = (s) * a[2][1];		\
-   b[2][2] = (s) * a[2][2];		\
-}\
-
-
-/*! multiply matrix by scalar */
-#define SCALE_MATRIX_4X4(b,s,a)		\
-{					\
-   b[0][0] = (s) * a[0][0];		\
-   b[0][1] = (s) * a[0][1];		\
-   b[0][2] = (s) * a[0][2];		\
-   b[0][3] = (s) * a[0][3];		\
-					\
-   b[1][0] = (s) * a[1][0];		\
-   b[1][1] = (s) * a[1][1];		\
-   b[1][2] = (s) * a[1][2];		\
-   b[1][3] = (s) * a[1][3];		\
-					\
-   b[2][0] = (s) * a[2][0];		\
-   b[2][1] = (s) * a[2][1];		\
-   b[2][2] = (s) * a[2][2];		\
-   b[2][3] = (s) * a[2][3];		\
-					\
-   b[3][0] = s * a[3][0];		\
-   b[3][1] = s * a[3][1];		\
-   b[3][2] = s * a[3][2];		\
-   b[3][3] = s * a[3][3];		\
-}\
-
-
-/*! multiply matrix by scalar */
-#define SCALE_VEC_MATRIX_2X2(b,svec,a)		\
-{					\
-   b[0][0] = svec[0] * a[0][0];		\
-   b[1][0] = svec[0] * a[1][0];		\
-					\
-   b[0][1] = svec[1] * a[0][1];		\
-   b[1][1] = svec[1] * a[1][1];		\
-}\
-
-
-/*! multiply matrix by scalar. Each columns is scaled by each scalar vector component */
-#define SCALE_VEC_MATRIX_3X3(b,svec,a)		\
-{					\
-   b[0][0] = svec[0] * a[0][0];		\
-   b[1][0] = svec[0] * a[1][0];		\
-   b[2][0] = svec[0] * a[2][0];		\
-					\
-   b[0][1] = svec[1] * a[0][1];		\
-   b[1][1] = svec[1] * a[1][1];		\
-   b[2][1] = svec[1] * a[2][1];		\
-					\
-   b[0][2] = svec[2] * a[0][2];		\
-   b[1][2] = svec[2] * a[1][2];		\
-   b[2][2] = svec[2] * a[2][2];		\
-}\
-
-
-/*! multiply matrix by scalar */
-#define SCALE_VEC_MATRIX_4X4(b,svec,a)		\
-{					\
-   b[0][0] = svec[0] * a[0][0];		\
-   b[1][0] = svec[0] * a[1][0];		\
-   b[2][0] = svec[0] * a[2][0];		\
-   b[3][0] = svec[0] * a[3][0];		\
-					\
-   b[0][1] = svec[1] * a[0][1];		\
-   b[1][1] = svec[1] * a[1][1];		\
-   b[2][1] = svec[1] * a[2][1];		\
-   b[3][1] = svec[1] * a[3][1];		\
-					\
-   b[0][2] = svec[2] * a[0][2];		\
-   b[1][2] = svec[2] * a[1][2];		\
-   b[2][2] = svec[2] * a[2][2];		\
-   b[3][2] = svec[2] * a[3][2];		\
-   \
-   b[0][3] = svec[3] * a[0][3];		\
-   b[1][3] = svec[3] * a[1][3];		\
-   b[2][3] = svec[3] * a[2][3];		\
-   b[3][3] = svec[3] * a[3][3];		\
-}\
-
-
-/*! multiply matrix by scalar */
-#define ACCUM_SCALE_MATRIX_2X2(b,s,a)		\
-{					\
-   b[0][0] += (s) * a[0][0];		\
-   b[0][1] += (s) * a[0][1];		\
-					\
-   b[1][0] += (s) * a[1][0];		\
-   b[1][1] += (s) * a[1][1];		\
-}\
-
-
-/*! multiply matrix by scalar */
-#define ACCUM_SCALE_MATRIX_3X3(b,s,a)		\
-{					\
-   b[0][0] += (s) * a[0][0];		\
-   b[0][1] += (s) * a[0][1];		\
-   b[0][2] += (s) * a[0][2];		\
-					\
-   b[1][0] += (s) * a[1][0];		\
-   b[1][1] += (s) * a[1][1];		\
-   b[1][2] += (s) * a[1][2];		\
-					\
-   b[2][0] += (s) * a[2][0];		\
-   b[2][1] += (s) * a[2][1];		\
-   b[2][2] += (s) * a[2][2];		\
-}\
-
-
-/*! multiply matrix by scalar */
-#define ACCUM_SCALE_MATRIX_4X4(b,s,a)		\
-{					\
-   b[0][0] += (s) * a[0][0];		\
-   b[0][1] += (s) * a[0][1];		\
-   b[0][2] += (s) * a[0][2];		\
-   b[0][3] += (s) * a[0][3];		\
-					\
-   b[1][0] += (s) * a[1][0];		\
-   b[1][1] += (s) * a[1][1];		\
-   b[1][2] += (s) * a[1][2];		\
-   b[1][3] += (s) * a[1][3];		\
-					\
-   b[2][0] += (s) * a[2][0];		\
-   b[2][1] += (s) * a[2][1];		\
-   b[2][2] += (s) * a[2][2];		\
-   b[2][3] += (s) * a[2][3];		\
-					\
-   b[3][0] += (s) * a[3][0];		\
-   b[3][1] += (s) * a[3][1];		\
-   b[3][2] += (s) * a[3][2];		\
-   b[3][3] += (s) * a[3][3];		\
-}\
-
-/*! matrix product */
-/*! c[x][y] = a[x][0]*b[0][y]+a[x][1]*b[1][y]+a[x][2]*b[2][y]+a[x][3]*b[3][y];*/
-#define MATRIX_PRODUCT_2X2(c,a,b)		\
-{						\
-   c[0][0] = a[0][0]*b[0][0]+a[0][1]*b[1][0];	\
-   c[0][1] = a[0][0]*b[0][1]+a[0][1]*b[1][1];	\
-						\
-   c[1][0] = a[1][0]*b[0][0]+a[1][1]*b[1][0];	\
-   c[1][1] = a[1][0]*b[0][1]+a[1][1]*b[1][1];	\
-						\
-}\
-
-/*! matrix product */
-/*! c[x][y] = a[x][0]*b[0][y]+a[x][1]*b[1][y]+a[x][2]*b[2][y]+a[x][3]*b[3][y];*/
-#define MATRIX_PRODUCT_3X3(c,a,b)				\
-{								\
-   c[0][0] = a[0][0]*b[0][0]+a[0][1]*b[1][0]+a[0][2]*b[2][0];	\
-   c[0][1] = a[0][0]*b[0][1]+a[0][1]*b[1][1]+a[0][2]*b[2][1];	\
-   c[0][2] = a[0][0]*b[0][2]+a[0][1]*b[1][2]+a[0][2]*b[2][2];	\
-								\
-   c[1][0] = a[1][0]*b[0][0]+a[1][1]*b[1][0]+a[1][2]*b[2][0];	\
-   c[1][1] = a[1][0]*b[0][1]+a[1][1]*b[1][1]+a[1][2]*b[2][1];	\
-   c[1][2] = a[1][0]*b[0][2]+a[1][1]*b[1][2]+a[1][2]*b[2][2];	\
-								\
-   c[2][0] = a[2][0]*b[0][0]+a[2][1]*b[1][0]+a[2][2]*b[2][0];	\
-   c[2][1] = a[2][0]*b[0][1]+a[2][1]*b[1][1]+a[2][2]*b[2][1];	\
-   c[2][2] = a[2][0]*b[0][2]+a[2][1]*b[1][2]+a[2][2]*b[2][2];	\
-}\
-
-
-/*! matrix product */
-/*! c[x][y] = a[x][0]*b[0][y]+a[x][1]*b[1][y]+a[x][2]*b[2][y]+a[x][3]*b[3][y];*/
-#define MATRIX_PRODUCT_4X4(c,a,b)		\
-{						\
-   c[0][0] = a[0][0]*b[0][0]+a[0][1]*b[1][0]+a[0][2]*b[2][0]+a[0][3]*b[3][0];\
-   c[0][1] = a[0][0]*b[0][1]+a[0][1]*b[1][1]+a[0][2]*b[2][1]+a[0][3]*b[3][1];\
-   c[0][2] = a[0][0]*b[0][2]+a[0][1]*b[1][2]+a[0][2]*b[2][2]+a[0][3]*b[3][2];\
-   c[0][3] = a[0][0]*b[0][3]+a[0][1]*b[1][3]+a[0][2]*b[2][3]+a[0][3]*b[3][3];\
-						\
-   c[1][0] = a[1][0]*b[0][0]+a[1][1]*b[1][0]+a[1][2]*b[2][0]+a[1][3]*b[3][0];\
-   c[1][1] = a[1][0]*b[0][1]+a[1][1]*b[1][1]+a[1][2]*b[2][1]+a[1][3]*b[3][1];\
-   c[1][2] = a[1][0]*b[0][2]+a[1][1]*b[1][2]+a[1][2]*b[2][2]+a[1][3]*b[3][2];\
-   c[1][3] = a[1][0]*b[0][3]+a[1][1]*b[1][3]+a[1][2]*b[2][3]+a[1][3]*b[3][3];\
-						\
-   c[2][0] = a[2][0]*b[0][0]+a[2][1]*b[1][0]+a[2][2]*b[2][0]+a[2][3]*b[3][0];\
-   c[2][1] = a[2][0]*b[0][1]+a[2][1]*b[1][1]+a[2][2]*b[2][1]+a[2][3]*b[3][1];\
-   c[2][2] = a[2][0]*b[0][2]+a[2][1]*b[1][2]+a[2][2]*b[2][2]+a[2][3]*b[3][2];\
-   c[2][3] = a[2][0]*b[0][3]+a[2][1]*b[1][3]+a[2][2]*b[2][3]+a[2][3]*b[3][3];\
-						\
-   c[3][0] = a[3][0]*b[0][0]+a[3][1]*b[1][0]+a[3][2]*b[2][0]+a[3][3]*b[3][0];\
-   c[3][1] = a[3][0]*b[0][1]+a[3][1]*b[1][1]+a[3][2]*b[2][1]+a[3][3]*b[3][1];\
-   c[3][2] = a[3][0]*b[0][2]+a[3][1]*b[1][2]+a[3][2]*b[2][2]+a[3][3]*b[3][2];\
-   c[3][3] = a[3][0]*b[0][3]+a[3][1]*b[1][3]+a[3][2]*b[2][3]+a[3][3]*b[3][3];\
-}\
-
-
-/*! matrix times vector */
-#define MAT_DOT_VEC_2X2(p,m,v)					\
-{								\
-   p[0] = m[0][0]*v[0] + m[0][1]*v[1];				\
-   p[1] = m[1][0]*v[0] + m[1][1]*v[1];				\
-}\
-
-
-/*! matrix times vector */
-#define MAT_DOT_VEC_3X3(p,m,v)					\
-{								\
-   p[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2];		\
-   p[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2];		\
-   p[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2];		\
-}\
-
-
-/*! matrix times vector
-v is a vec4f
-*/
-#define MAT_DOT_VEC_4X4(p,m,v)					\
-{								\
-   p[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2] + m[0][3]*v[3];	\
-   p[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2] + m[1][3]*v[3];	\
-   p[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2] + m[2][3]*v[3];	\
-   p[3] = m[3][0]*v[0] + m[3][1]*v[1] + m[3][2]*v[2] + m[3][3]*v[3];	\
-}\
-
-/*! matrix times vector
-v is a vec3f
-and m is a mat4f<br>
-Last column is added as the position
-*/
-#define MAT_DOT_VEC_3X4(p,m,v)					\
-{								\
-   p[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2] + m[0][3];	\
-   p[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2] + m[1][3];	\
-   p[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2] + m[2][3];	\
-}\
-
-
-/*! vector transpose times matrix */
-/*! p[j] = v[0]*m[0][j] + v[1]*m[1][j] + v[2]*m[2][j]; */
-#define VEC_DOT_MAT_3X3(p,v,m)					\
-{								\
-   p[0] = v[0]*m[0][0] + v[1]*m[1][0] + v[2]*m[2][0];		\
-   p[1] = v[0]*m[0][1] + v[1]*m[1][1] + v[2]*m[2][1];		\
-   p[2] = v[0]*m[0][2] + v[1]*m[1][2] + v[2]*m[2][2];		\
-}\
-
-
-/*! affine matrix times vector */
-/** The matrix is assumed to be an affine matrix, with last two
- * entries representing a translation */
-#define MAT_DOT_VEC_2X3(p,m,v)					\
-{								\
-   p[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2];		\
-   p[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2];		\
-}\
-
-//! Transform a plane
-#define MAT_TRANSFORM_PLANE_4X4(pout,m,plane)\
-{								\
-   pout[0] = m[0][0]*plane[0] + m[0][1]*plane[1]  + m[0][2]*plane[2];\
-   pout[1] = m[1][0]*plane[0] + m[1][1]*plane[1]  + m[1][2]*plane[2];\
-   pout[2] = m[2][0]*plane[0] + m[2][1]*plane[1]  + m[2][2]*plane[2];\
-   pout[3] = m[0][3]*pout[0] + m[1][3]*pout[1]  + m[2][3]*pout[2] + plane[3];\
-}\
-
-
-
-/** inverse transpose of matrix times vector
- *
- * This macro computes inverse transpose of matrix m,
- * and multiplies vector v into it, to yeild vector p
- *
- * DANGER !!! Do Not use this on normal vectors!!!
- * It will leave normals the wrong length !!!
- * See macro below for use on normals.
- */
-#define INV_TRANSP_MAT_DOT_VEC_2X2(p,m,v)			\
-{								\
-   GREAL det;						\
-								\
-   det = m[0][0]*m[1][1] - m[0][1]*m[1][0];			\
-   p[0] = m[1][1]*v[0] - m[1][0]*v[1];				\
-   p[1] = - m[0][1]*v[0] + m[0][0]*v[1];			\
-								\
-   /* if matrix not singular, and not orthonormal, then renormalize */ \
-   if ((det!=1.0f) && (det != 0.0f)) {				\
-      det = 1.0f / det;						\
-      p[0] *= det;						\
-      p[1] *= det;						\
-   }								\
-}\
-
-
-/** transform normal vector by inverse transpose of matrix
- * and then renormalize the vector
- *
- * This macro computes inverse transpose of matrix m,
- * and multiplies vector v into it, to yeild vector p
- * Vector p is then normalized.
- */
-#define NORM_XFORM_2X2(p,m,v)					\
-{								\
-   GREAL len;							\
-								\
-   /* do nothing if off-diagonals are zero and diagonals are 	\
-    * equal */							\
-   if ((m[0][1] != 0.0) || (m[1][0] != 0.0) || (m[0][0] != m[1][1])) { \
-      p[0] = m[1][1]*v[0] - m[1][0]*v[1];			\
-      p[1] = - m[0][1]*v[0] + m[0][0]*v[1];			\
-								\
-      len = p[0]*p[0] + p[1]*p[1];				\
-      GIM_INV_SQRT(len,len);					\
-      p[0] *= len;						\
-      p[1] *= len;						\
-   } else {							\
-      VEC_COPY_2 (p, v);					\
-   }								\
-}\
-
-
-/** outer product of vector times vector transpose
- *
- * The outer product of vector v and vector transpose t yeilds
- * dyadic matrix m.
- */
-#define OUTER_PRODUCT_2X2(m,v,t)				\
-{								\
-   m[0][0] = v[0] * t[0];					\
-   m[0][1] = v[0] * t[1];					\
-								\
-   m[1][0] = v[1] * t[0];					\
-   m[1][1] = v[1] * t[1];					\
-}\
-
-
-/** outer product of vector times vector transpose
- *
- * The outer product of vector v and vector transpose t yeilds
- * dyadic matrix m.
- */
-#define OUTER_PRODUCT_3X3(m,v,t)				\
-{								\
-   m[0][0] = v[0] * t[0];					\
-   m[0][1] = v[0] * t[1];					\
-   m[0][2] = v[0] * t[2];					\
-								\
-   m[1][0] = v[1] * t[0];					\
-   m[1][1] = v[1] * t[1];					\
-   m[1][2] = v[1] * t[2];					\
-								\
-   m[2][0] = v[2] * t[0];					\
-   m[2][1] = v[2] * t[1];					\
-   m[2][2] = v[2] * t[2];					\
-}\
-
-
-/** outer product of vector times vector transpose
- *
- * The outer product of vector v and vector transpose t yeilds
- * dyadic matrix m.
- */
-#define OUTER_PRODUCT_4X4(m,v,t)				\
-{								\
-   m[0][0] = v[0] * t[0];					\
-   m[0][1] = v[0] * t[1];					\
-   m[0][2] = v[0] * t[2];					\
-   m[0][3] = v[0] * t[3];					\
-								\
-   m[1][0] = v[1] * t[0];					\
-   m[1][1] = v[1] * t[1];					\
-   m[1][2] = v[1] * t[2];					\
-   m[1][3] = v[1] * t[3];					\
-								\
-   m[2][0] = v[2] * t[0];					\
-   m[2][1] = v[2] * t[1];					\
-   m[2][2] = v[2] * t[2];					\
-   m[2][3] = v[2] * t[3];					\
-								\
-   m[3][0] = v[3] * t[0];					\
-   m[3][1] = v[3] * t[1];					\
-   m[3][2] = v[3] * t[2];					\
-   m[3][3] = v[3] * t[3];					\
-}\
-
-
-/** outer product of vector times vector transpose
- *
- * The outer product of vector v and vector transpose t yeilds
- * dyadic matrix m.
- */
-#define ACCUM_OUTER_PRODUCT_2X2(m,v,t)				\
-{								\
-   m[0][0] += v[0] * t[0];					\
-   m[0][1] += v[0] * t[1];					\
-								\
-   m[1][0] += v[1] * t[0];					\
-   m[1][1] += v[1] * t[1];					\
-}\
-
-
-/** outer product of vector times vector transpose
- *
- * The outer product of vector v and vector transpose t yeilds
- * dyadic matrix m.
- */
-#define ACCUM_OUTER_PRODUCT_3X3(m,v,t)				\
-{								\
-   m[0][0] += v[0] * t[0];					\
-   m[0][1] += v[0] * t[1];					\
-   m[0][2] += v[0] * t[2];					\
-								\
-   m[1][0] += v[1] * t[0];					\
-   m[1][1] += v[1] * t[1];					\
-   m[1][2] += v[1] * t[2];					\
-								\
-   m[2][0] += v[2] * t[0];					\
-   m[2][1] += v[2] * t[1];					\
-   m[2][2] += v[2] * t[2];					\
-}\
-
-
-/** outer product of vector times vector transpose
- *
- * The outer product of vector v and vector transpose t yeilds
- * dyadic matrix m.
- */
-#define ACCUM_OUTER_PRODUCT_4X4(m,v,t)				\
-{								\
-   m[0][0] += v[0] * t[0];					\
-   m[0][1] += v[0] * t[1];					\
-   m[0][2] += v[0] * t[2];					\
-   m[0][3] += v[0] * t[3];					\
-								\
-   m[1][0] += v[1] * t[0];					\
-   m[1][1] += v[1] * t[1];					\
-   m[1][2] += v[1] * t[2];					\
-   m[1][3] += v[1] * t[3];					\
-								\
-   m[2][0] += v[2] * t[0];					\
-   m[2][1] += v[2] * t[1];					\
-   m[2][2] += v[2] * t[2];					\
-   m[2][3] += v[2] * t[3];					\
-								\
-   m[3][0] += v[3] * t[0];					\
-   m[3][1] += v[3] * t[1];					\
-   m[3][2] += v[3] * t[2];					\
-   m[3][3] += v[3] * t[3];					\
-}\
-
-
-/** determinant of matrix
- *
- * Computes determinant of matrix m, returning d
- */
-#define DETERMINANT_2X2(d,m)					\
-{								\
-   d = m[0][0] * m[1][1] - m[0][1] * m[1][0];			\
-}\
-
-
-/** determinant of matrix
- *
- * Computes determinant of matrix m, returning d
- */
-#define DETERMINANT_3X3(d,m)					\
-{								\
-   d = m[0][0] * (m[1][1]*m[2][2] - m[1][2] * m[2][1]);		\
-   d -= m[0][1] * (m[1][0]*m[2][2] - m[1][2] * m[2][0]);	\
-   d += m[0][2] * (m[1][0]*m[2][1] - m[1][1] * m[2][0]);	\
-}\
-
-
-/** i,j,th cofactor of a 4x4 matrix
- *
- */
-#define COFACTOR_4X4_IJ(fac,m,i,j) 				\
-{								\
-   GUINT __ii[4], __jj[4], __k;						\
-								\
-   for (__k=0; __k<i; __k++) __ii[__k] = __k;				\
-   for (__k=i; __k<3; __k++) __ii[__k] = __k+1;				\
-   for (__k=0; __k<j; __k++) __jj[__k] = __k;				\
-   for (__k=j; __k<3; __k++) __jj[__k] = __k+1;				\
-								\
-   (fac) = m[__ii[0]][__jj[0]] * (m[__ii[1]][__jj[1]]*m[__ii[2]][__jj[2]] 	\
-                            - m[__ii[1]][__jj[2]]*m[__ii[2]][__jj[1]]); \
-   (fac) -= m[__ii[0]][__jj[1]] * (m[__ii[1]][__jj[0]]*m[__ii[2]][__jj[2]]	\
-                             - m[__ii[1]][__jj[2]]*m[__ii[2]][__jj[0]]);\
-   (fac) += m[__ii[0]][__jj[2]] * (m[__ii[1]][__jj[0]]*m[__ii[2]][__jj[1]]	\
-                             - m[__ii[1]][__jj[1]]*m[__ii[2]][__jj[0]]);\
-								\
-   __k = i+j;							\
-   if ( __k != (__k/2)*2) {						\
-      (fac) = -(fac);						\
-   }								\
-}\
-
-
-/** determinant of matrix
- *
- * Computes determinant of matrix m, returning d
- */
-#define DETERMINANT_4X4(d,m)					\
-{								\
-   GREAL cofac;						\
-   COFACTOR_4X4_IJ (cofac, m, 0, 0);				\
-   d = m[0][0] * cofac;						\
-   COFACTOR_4X4_IJ (cofac, m, 0, 1);				\
-   d += m[0][1] * cofac;					\
-   COFACTOR_4X4_IJ (cofac, m, 0, 2);				\
-   d += m[0][2] * cofac;					\
-   COFACTOR_4X4_IJ (cofac, m, 0, 3);				\
-   d += m[0][3] * cofac;					\
-}\
-
-
-/** cofactor of matrix
- *
- * Computes cofactor of matrix m, returning a
- */
-#define COFACTOR_2X2(a,m)					\
-{								\
-   a[0][0] = (m)[1][1];						\
-   a[0][1] = - (m)[1][0];						\
-   a[1][0] = - (m)[0][1];						\
-   a[1][1] = (m)[0][0];						\
-}\
-
-
-/** cofactor of matrix
- *
- * Computes cofactor of matrix m, returning a
- */
-#define COFACTOR_3X3(a,m)					\
-{								\
-   a[0][0] = m[1][1]*m[2][2] - m[1][2]*m[2][1];			\
-   a[0][1] = - (m[1][0]*m[2][2] - m[2][0]*m[1][2]);		\
-   a[0][2] = m[1][0]*m[2][1] - m[1][1]*m[2][0];			\
-   a[1][0] = - (m[0][1]*m[2][2] - m[0][2]*m[2][1]);		\
-   a[1][1] = m[0][0]*m[2][2] - m[0][2]*m[2][0];			\
-   a[1][2] = - (m[0][0]*m[2][1] - m[0][1]*m[2][0]);		\
-   a[2][0] = m[0][1]*m[1][2] - m[0][2]*m[1][1];			\
-   a[2][1] = - (m[0][0]*m[1][2] - m[0][2]*m[1][0]);		\
-   a[2][2] = m[0][0]*m[1][1] - m[0][1]*m[1][0]);		\
-}\
-
-
-/** cofactor of matrix
- *
- * Computes cofactor of matrix m, returning a
- */
-#define COFACTOR_4X4(a,m)					\
-{								\
-   int i,j;							\
-								\
-   for (i=0; i<4; i++) {					\
-      for (j=0; j<4; j++) {					\
-         COFACTOR_4X4_IJ (a[i][j], m, i, j);			\
-      }								\
-   }								\
-}\
-
-
-/** adjoint of matrix
- *
- * Computes adjoint of matrix m, returning a
- * (Note that adjoint is just the transpose of the cofactor matrix)
- */
-#define ADJOINT_2X2(a,m)					\
-{								\
-   a[0][0] = (m)[1][1];						\
-   a[1][0] = - (m)[1][0];						\
-   a[0][1] = - (m)[0][1];						\
-   a[1][1] = (m)[0][0];						\
-}\
-
-
-/** adjoint of matrix
- *
- * Computes adjoint of matrix m, returning a
- * (Note that adjoint is just the transpose of the cofactor matrix)
- */
-#define ADJOINT_3X3(a,m)					\
-{								\
-   a[0][0] = m[1][1]*m[2][2] - m[1][2]*m[2][1];			\
-   a[1][0] = - (m[1][0]*m[2][2] - m[2][0]*m[1][2]);		\
-   a[2][0] = m[1][0]*m[2][1] - m[1][1]*m[2][0];			\
-   a[0][1] = - (m[0][1]*m[2][2] - m[0][2]*m[2][1]);		\
-   a[1][1] = m[0][0]*m[2][2] - m[0][2]*m[2][0];			\
-   a[2][1] = - (m[0][0]*m[2][1] - m[0][1]*m[2][0]);		\
-   a[0][2] = m[0][1]*m[1][2] - m[0][2]*m[1][1];			\
-   a[1][2] = - (m[0][0]*m[1][2] - m[0][2]*m[1][0]);		\
-   a[2][2] = m[0][0]*m[1][1] - m[0][1]*m[1][0]);		\
-}\
-
-
-/** adjoint of matrix
- *
- * Computes adjoint of matrix m, returning a
- * (Note that adjoint is just the transpose of the cofactor matrix)
- */
-#define ADJOINT_4X4(a,m)					\
-{								\
-   char _i_,_j_;							\
-								\
-   for (_i_=0; _i_<4; _i_++) {					\
-      for (_j_=0; _j_<4; _j_++) {					\
-         COFACTOR_4X4_IJ (a[_j_][_i_], m, _i_, _j_);			\
-      }								\
-   }								\
-}\
-
-
-/** compute adjoint of matrix and scale
- *
- * Computes adjoint of matrix m, scales it by s, returning a
- */
-#define SCALE_ADJOINT_2X2(a,s,m)				\
-{								\
-   a[0][0] = (s) * m[1][1];					\
-   a[1][0] = - (s) * m[1][0];					\
-   a[0][1] = - (s) * m[0][1];					\
-   a[1][1] = (s) * m[0][0];					\
-}\
-
-
-/** compute adjoint of matrix and scale
- *
- * Computes adjoint of matrix m, scales it by s, returning a
- */
-#define SCALE_ADJOINT_3X3(a,s,m)				\
-{								\
-   a[0][0] = (s) * (m[1][1] * m[2][2] - m[1][2] * m[2][1]);	\
-   a[1][0] = (s) * (m[1][2] * m[2][0] - m[1][0] * m[2][2]);	\
-   a[2][0] = (s) * (m[1][0] * m[2][1] - m[1][1] * m[2][0]);	\
-								\
-   a[0][1] = (s) * (m[0][2] * m[2][1] - m[0][1] * m[2][2]);	\
-   a[1][1] = (s) * (m[0][0] * m[2][2] - m[0][2] * m[2][0]);	\
-   a[2][1] = (s) * (m[0][1] * m[2][0] - m[0][0] * m[2][1]);	\
-								\
-   a[0][2] = (s) * (m[0][1] * m[1][2] - m[0][2] * m[1][1]);	\
-   a[1][2] = (s) * (m[0][2] * m[1][0] - m[0][0] * m[1][2]);	\
-   a[2][2] = (s) * (m[0][0] * m[1][1] - m[0][1] * m[1][0]);	\
-}\
-
-
-/** compute adjoint of matrix and scale
- *
- * Computes adjoint of matrix m, scales it by s, returning a
- */
-#define SCALE_ADJOINT_4X4(a,s,m)				\
-{								\
-   char _i_,_j_; \
-   for (_i_=0; _i_<4; _i_++) {					\
-      for (_j_=0; _j_<4; _j_++) {					\
-         COFACTOR_4X4_IJ (a[_j_][_i_], m, _i_, _j_);			\
-         a[_j_][_i_] *= s;						\
-      }								\
-   }								\
-}\
-
-/** inverse of matrix
- *
- * Compute inverse of matrix a, returning determinant m and
- * inverse b
- */
-#define INVERT_2X2(b,det,a)			\
-{						\
-   GREAL _tmp_;					\
-   DETERMINANT_2X2 (det, a);			\
-   _tmp_ = 1.0 / (det);				\
-   SCALE_ADJOINT_2X2 (b, _tmp_, a);		\
-}\
-
-
-/** inverse of matrix
- *
- * Compute inverse of matrix a, returning determinant m and
- * inverse b
- */
-#define INVERT_3X3(b,det,a)			\
-{						\
-   GREAL _tmp_;					\
-   DETERMINANT_3X3 (det, a);			\
-   _tmp_ = 1.0 / (det);				\
-   SCALE_ADJOINT_3X3 (b, _tmp_, a);		\
-}\
-
-
-/** inverse of matrix
- *
- * Compute inverse of matrix a, returning determinant m and
- * inverse b
- */
-#define INVERT_4X4(b,det,a)			\
-{						\
-   GREAL _tmp_;					\
-   DETERMINANT_4X4 (det, a);			\
-   _tmp_ = 1.0 / (det);				\
-   SCALE_ADJOINT_4X4 (b, _tmp_, a);		\
-}\
-
-//! Get the triple(3) row of a transform matrix
-#define MAT_GET_ROW(mat,vec3,rowindex)\
-{\
-    vec3[0] = mat[rowindex][0];\
-    vec3[1] = mat[rowindex][1];\
-    vec3[2] = mat[rowindex][2]; \
-}\
-
-//! Get the tuple(2) row of a transform matrix
-#define MAT_GET_ROW2(mat,vec2,rowindex)\
-{\
-    vec2[0] = mat[rowindex][0];\
-    vec2[1] = mat[rowindex][1];\
-}\
-
-
-//! Get the quad (4) row of a transform matrix
-#define MAT_GET_ROW4(mat,vec4,rowindex)\
-{\
-    vec4[0] = mat[rowindex][0];\
-    vec4[1] = mat[rowindex][1];\
-    vec4[2] = mat[rowindex][2];\
-    vec4[3] = mat[rowindex][3];\
-}\
-
-//! Get the triple(3) col of a transform matrix
-#define MAT_GET_COL(mat,vec3,colindex)\
-{\
-    vec3[0] = mat[0][colindex];\
-    vec3[1] = mat[1][colindex];\
-    vec3[2] = mat[2][colindex]; \
-}\
-
-//! Get the tuple(2) col of a transform matrix
-#define MAT_GET_COL2(mat,vec2,colindex)\
-{\
-    vec2[0] = mat[0][colindex];\
-    vec2[1] = mat[1][colindex];\
-}\
-
-
-//! Get the quad (4) col of a transform matrix
-#define MAT_GET_COL4(mat,vec4,colindex)\
-{\
-    vec4[0] = mat[0][colindex];\
-    vec4[1] = mat[1][colindex];\
-    vec4[2] = mat[2][colindex];\
-    vec4[3] = mat[3][colindex];\
-}\
-
-//! Get the triple(3) col of a transform matrix
-#define MAT_GET_X(mat,vec3)\
-{\
-    MAT_GET_COL(mat,vec3,0);\
-}\
-
-//! Get the triple(3) col of a transform matrix
-#define MAT_GET_Y(mat,vec3)\
-{\
-    MAT_GET_COL(mat,vec3,1);\
-}\
-
-//! Get the triple(3) col of a transform matrix
-#define MAT_GET_Z(mat,vec3)\
-{\
-    MAT_GET_COL(mat,vec3,2);\
-}\
-
-
-//! Get the triple(3) col of a transform matrix
-#define MAT_SET_X(mat,vec3)\
-{\
-    mat[0][0] = vec3[0];\
-    mat[1][0] = vec3[1];\
-    mat[2][0] = vec3[2];\
-}\
-
-//! Get the triple(3) col of a transform matrix
-#define MAT_SET_Y(mat,vec3)\
-{\
-    mat[0][1] = vec3[0];\
-    mat[1][1] = vec3[1];\
-    mat[2][1] = vec3[2];\
-}\
-
-//! Get the triple(3) col of a transform matrix
-#define MAT_SET_Z(mat,vec3)\
-{\
-    mat[0][2] = vec3[0];\
-    mat[1][2] = vec3[1];\
-    mat[2][2] = vec3[2];\
-}\
-
-
-//! Get the triple(3) col of a transform matrix
-#define MAT_GET_TRANSLATION(mat,vec3)\
-{\
-    vec3[0] = mat[0][3];\
-    vec3[1] = mat[1][3];\
-    vec3[2] = mat[2][3]; \
-}\
-
-//! Set the triple(3) col of a transform matrix
-#define MAT_SET_TRANSLATION(mat,vec3)\
-{\
-    mat[0][3] = vec3[0];\
-    mat[1][3] = vec3[1];\
-    mat[2][3] = vec3[2]; \
-}\
-
-
-
-//! Returns the dot product between a vec3f and the row of a matrix
-#define MAT_DOT_ROW(mat,vec3,rowindex) (vec3[0]*mat[rowindex][0] + vec3[1]*mat[rowindex][1] + vec3[2]*mat[rowindex][2])
-
-//! Returns the dot product between a vec2f and the row of a matrix
-#define MAT_DOT_ROW2(mat,vec2,rowindex) (vec2[0]*mat[rowindex][0] + vec2[1]*mat[rowindex][1])
-
-//! Returns the dot product between a vec4f and the row of a matrix
-#define MAT_DOT_ROW4(mat,vec4,rowindex) (vec4[0]*mat[rowindex][0] + vec4[1]*mat[rowindex][1] + vec4[2]*mat[rowindex][2] + vec4[3]*mat[rowindex][3])
-
-
-//! Returns the dot product between a vec3f and the col of a matrix
-#define MAT_DOT_COL(mat,vec3,colindex) (vec3[0]*mat[0][colindex] + vec3[1]*mat[1][colindex] + vec3[2]*mat[2][colindex])
-
-//! Returns the dot product between a vec2f and the col of a matrix
-#define MAT_DOT_COL2(mat,vec2,colindex) (vec2[0]*mat[0][colindex] + vec2[1]*mat[1][colindex])
-
-//! Returns the dot product between a vec4f and the col of a matrix
-#define MAT_DOT_COL4(mat,vec4,colindex) (vec4[0]*mat[0][colindex] + vec4[1]*mat[1][colindex] + vec4[2]*mat[2][colindex] + vec4[3]*mat[3][colindex])
-
-/*!Transpose matrix times vector
-v is a vec3f
-and m is a mat4f<br>
-*/
-#define INV_MAT_DOT_VEC_3X3(p,m,v)					\
-{								\
-   p[0] = MAT_DOT_COL(m,v,0); \
-   p[1] = MAT_DOT_COL(m,v,1);	\
-   p[2] = MAT_DOT_COL(m,v,2);	\
-}\
-
-
-
-#endif // GIM_VECTOR_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_math.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_math.h
deleted file mode 100644
index 939079e..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_math.h
+++ /dev/null
@@ -1,157 +0,0 @@
-#ifndef GIM_MATH_H_INCLUDED
-#define GIM_MATH_H_INCLUDED
-/*! \file gim_math.h
-\author Francisco Leon Najera
-*/
-/*
------------------------------------------------------------------------------
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of EITHER:
-   (1) The GNU Lesser General Public License as published by the Free
-       Software Foundation; either version 2.1 of the License, or (at
-       your option) any later version. The text of the GNU Lesser
-       General Public License is included with this library in the
-       file GIMPACT-LICENSE-LGPL.TXT.
-   (2) The BSD-style license that is included with this library in
-       the file GIMPACT-LICENSE-BSD.TXT.
-   (3) The zlib/libpng license that is included with this library in
-       the file GIMPACT-LICENSE-ZLIB.TXT.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
-
------------------------------------------------------------------------------
-*/
-
-#include "LinearMath/btScalar.h"
-
-
-
-#define GREAL btScalar
-#define GREAL2 double
-#define GINT int
-#define GUINT unsigned int
-#define GSHORT short
-#define GUSHORT unsigned short
-#define GINT64 long long
-#define GUINT64 unsigned long long
-
-
-
-#define G_PI 3.14159265358979f
-#define G_HALF_PI 1.5707963f
-//267948966
-#define G_TWO_PI 6.28318530f
-//71795864
-#define G_ROOT3 1.73205f
-#define G_ROOT2 1.41421f
-#define G_UINT_INFINITY 0xffffffff //!< A very very high value
-#define G_REAL_INFINITY FLT_MAX
-#define	G_SIGN_BITMASK			0x80000000
-#define G_EPSILON SIMD_EPSILON
-
-
-
-enum GIM_SCALAR_TYPES
-{
-	G_STYPE_REAL =0,
-	G_STYPE_REAL2,
-	G_STYPE_SHORT,
-	G_STYPE_USHORT,
-	G_STYPE_INT,
-	G_STYPE_UINT,
-	G_STYPE_INT64,
-	G_STYPE_UINT64
-};
-
-
-
-#define G_DEGTORAD(X) ((X)*3.1415926f/180.0f)
-#define G_RADTODEG(X) ((X)*180.0f/3.1415926f)
-
-//! Integer representation of a floating-point value.
-#define GIM_IR(x)					((GUINT&)(x))
-
-//! Signed integer representation of a floating-point value.
-#define GIM_SIR(x)					((GINT&)(x))
-
-//! Absolute integer representation of a floating-point value
-#define GIM_AIR(x)					(GIM_IR(x)&0x7fffffff)
-
-//! Floating-point representation of an integer value.
-#define GIM_FR(x)					((GREAL&)(x))
-
-#define GIM_MAX(a,b) (a<b?b:a)
-#define GIM_MIN(a,b) (a>b?b:a)
-
-#define GIM_MAX3(a,b,c) GIM_MAX(a,GIM_MAX(b,c))
-#define GIM_MIN3(a,b,c) GIM_MIN(a,GIM_MIN(b,c))
-
-#define GIM_IS_ZERO(value) (value < G_EPSILON &&  value > -G_EPSILON)
-
-#define GIM_IS_NEGATIVE(value) (value <= -G_EPSILON)
-
-#define GIM_IS_POSISITVE(value) (value >= G_EPSILON)
-
-#define GIM_NEAR_EQUAL(v1,v2) GIM_IS_ZERO((v1-v2))
-
-///returns a clamped number
-#define GIM_CLAMP(number,minval,maxval) (number<minval?minval:(number>maxval?maxval:number))
-
-#define GIM_GREATER(x, y)	btFabs(x) > (y)
-
-///Swap numbers
-#define GIM_SWAP_NUMBERS(a,b){ \
-    a = a+b; \
-    b = a-b; \
-    a = a-b; \
-}\
-
-#define GIM_INV_SQRT(va,isva)\
-{\
-    if(va<=0.0000001f)\
-    {\
-        isva = G_REAL_INFINITY;\
-    }\
-    else\
-    {\
-        GREAL _x = va * 0.5f;\
-        GUINT _y = 0x5f3759df - ( GIM_IR(va) >> 1);\
-        isva = GIM_FR(_y);\
-        isva  = isva * ( 1.5f - ( _x * isva * isva ) );\
-    }\
-}\
-
-#define GIM_SQRT(va,sva)\
-{\
-    GIM_INV_SQRT(va,sva);\
-    sva = 1.0f/sva;\
-}\
-
-//! Computes 1.0f / sqrtf(x). Comes from Quake3. See http://www.magic-software.com/3DGEDInvSqrt.html
-inline GREAL gim_inv_sqrt(GREAL f)
-{
-    GREAL r;
-    GIM_INV_SQRT(f,r);
-    return r;
-}
-
-inline GREAL gim_sqrt(GREAL f)
-{
-    GREAL r;
-    GIM_SQRT(f,r);
-    return r;
-}
-
-
-
-#endif // GIM_MATH_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_memory.cpp b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_memory.cpp
deleted file mode 100644
index 1636eb7..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_memory.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
------------------------------------------------------------------------------
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of EITHER:
-   (1) The GNU Lesser General Public License as published by the Free
-       Software Foundation; either version 2.1 of the License, or (at
-       your option) any later version. The text of the GNU Lesser
-       General Public License is included with this library in the
-       file GIMPACT-LICENSE-LGPL.TXT.
-   (2) The BSD-style license that is included with this library in
-       the file GIMPACT-LICENSE-BSD.TXT.
-   (3) The zlib/libpng license that is included with this library in
-       the file GIMPACT-LICENSE-ZLIB.TXT.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
-
------------------------------------------------------------------------------
-*/
-
-
-#include "gim_memory.h"
-#include "stdlib.h"
-
-#ifdef GIM_SIMD_MEMORY
-#include "LinearMath/btAlignedAllocator.h"
-#endif
-
-static gim_alloc_function *g_allocfn = 0;
-static gim_alloca_function *g_allocafn = 0;
-static gim_realloc_function *g_reallocfn = 0;
-static gim_free_function *g_freefn = 0;
-
-void gim_set_alloc_handler (gim_alloc_function *fn)
-{
-  g_allocfn = fn;
-}
-
-void gim_set_alloca_handler (gim_alloca_function *fn)
-{
-  g_allocafn = fn;
-}
-
-void gim_set_realloc_handler (gim_realloc_function *fn)
-{
-  g_reallocfn = fn;
-}
-
-void gim_set_free_handler (gim_free_function *fn)
-{
-  g_freefn = fn;
-}
-
-gim_alloc_function *gim_get_alloc_handler()
-{
-  return g_allocfn;
-}
-
-gim_alloca_function *gim_get_alloca_handler()
-{
-  return g_allocafn;
-}
-
-
-gim_realloc_function *gim_get_realloc_handler ()
-{
-  return g_reallocfn;
-}
-
-
-gim_free_function  *gim_get_free_handler ()
-{
-  return g_freefn;
-}
-
-
-void * gim_alloc(size_t size)
-{
-	void * ptr;
-	if (g_allocfn)
-	{
-		ptr = g_allocfn(size);
-	}
-	else
-	{
-#ifdef GIM_SIMD_MEMORY
-		ptr = btAlignedAlloc(size,16);
-#else
-		ptr = malloc(size);
-#endif
-	}
-  	return ptr;
-}
-
-void * gim_alloca(size_t size)
-{
-  if (g_allocafn) return g_allocafn(size); else return gim_alloc(size);
-}
-
-
-void * gim_realloc(void *ptr, size_t oldsize, size_t newsize)
-{
- 	void * newptr = gim_alloc(newsize);
-    size_t copysize = oldsize<newsize?oldsize:newsize;
-    gim_simd_memcpy(newptr,ptr,copysize);
-    gim_free(ptr);
-    return newptr;
-}
-
-void gim_free(void *ptr)
-{
-	if (!ptr) return;
-	if (g_freefn)
-	{
-	   g_freefn(ptr);
-	}
-	else
-	{
-	#ifdef GIM_SIMD_MEMORY
-		btAlignedFree(ptr);
-	#else
-		free(ptr);
-	#endif
-	}
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_memory.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_memory.h
deleted file mode 100644
index e203888..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_memory.h
+++ /dev/null
@@ -1,190 +0,0 @@
-#ifndef GIM_MEMORY_H_INCLUDED
-#define GIM_MEMORY_H_INCLUDED
-/*! \file gim_memory.h
-\author Francisco Leon Najera
-*/
-/*
------------------------------------------------------------------------------
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of EITHER:
-   (1) The GNU Lesser General Public License as published by the Free
-       Software Foundation; either version 2.1 of the License, or (at
-       your option) any later version. The text of the GNU Lesser
-       General Public License is included with this library in the
-       file GIMPACT-LICENSE-LGPL.TXT.
-   (2) The BSD-style license that is included with this library in
-       the file GIMPACT-LICENSE-BSD.TXT.
-   (3) The zlib/libpng license that is included with this library in
-       the file GIMPACT-LICENSE-ZLIB.TXT.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
-
------------------------------------------------------------------------------
-*/
-
-
-#include "gim_math.h"
-#include <string.h>
-
-#ifdef PREFETCH
-#include <xmmintrin.h>	// for prefetch
-#define pfval	64
-#define pfval2	128
-//! Prefetch 64
-#define pf(_x,_i)	_mm_prefetch((void *)(_x + _i + pfval), 0)
-//! Prefetch 128
-#define pf2(_x,_i)	_mm_prefetch((void *)(_x + _i + pfval2), 0)
-#else
-//! Prefetch 64
-#define pf(_x,_i)
-//! Prefetch 128
-#define pf2(_x,_i)
-#endif
-
-
-///Functions for manip packed arrays of numbers
-#define GIM_COPY_ARRAYS(dest_array,source_array,element_count)\
-{\
-    for (GUINT _i_=0;_i_<element_count ;++_i_)\
-    {\
-    	dest_array[_i_] = source_array[_i_];\
-    }\
-}\
-
-#define GIM_COPY_ARRAYS_1(dest_array,source_array,element_count,copy_macro)\
-{\
-    for (GUINT _i_=0;_i_<element_count ;++_i_)\
-    {\
-    	copy_macro(dest_array[_i_],source_array[_i_]);\
-    }\
-}\
-
-
-#define GIM_ZERO_ARRAY(array,element_count)\
-{\
-    for (GUINT _i_=0;_i_<element_count ;++_i_)\
-    {\
-    	array[_i_] = 0;\
-    }\
-}\
-
-#define GIM_CONSTANT_ARRAY(array,element_count,constant)\
-{\
-    for (GUINT _i_=0;_i_<element_count ;++_i_)\
-    {\
-    	array[_i_] = constant;\
-    }\
-}\
-
-
-///Function prototypes to allocate and free memory.
-typedef void * gim_alloc_function (size_t size);
-typedef void * gim_alloca_function (size_t size);//Allocs on the heap
-typedef void * gim_realloc_function (void *ptr, size_t oldsize, size_t newsize);
-typedef void gim_free_function (void *ptr);
-
-
-///Memory Function Handlers
-///set new memory management functions. if fn is 0, the default handlers are used.
-void gim_set_alloc_handler (gim_alloc_function *fn);
-void gim_set_alloca_handler (gim_alloca_function *fn);
-void gim_set_realloc_handler (gim_realloc_function *fn);
-void gim_set_free_handler (gim_free_function *fn);
-
-
-///get current memory management functions.
-gim_alloc_function *gim_get_alloc_handler (void);
-gim_alloca_function *gim_get_alloca_handler(void);
-gim_realloc_function *gim_get_realloc_handler (void);
-gim_free_function  *gim_get_free_handler (void);
-
-
-///Standar Memory functions
-void * gim_alloc(size_t size);
-void * gim_alloca(size_t size);
-void * gim_realloc(void *ptr, size_t oldsize, size_t newsize);
-void gim_free(void *ptr);
-
-
-
-#if defined (_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__)
-    #define GIM_SIMD_MEMORY 1
-#endif
-
-//! SIMD POINTER INTEGER
-#define SIMD_T GUINT64
-//! SIMD INTEGER SIZE
-#define SIMD_T_SIZE sizeof(SIMD_T)
-
-
-inline void gim_simd_memcpy(void * dst, const void * src, size_t copysize)
-{
-#ifdef GIM_SIMD_MEMORY
-/*
-//'long long int' is incompatible with visual studio 6...
-    //copy words
-    SIMD_T * ui_src_ptr = (SIMD_T *)src;
-    SIMD_T * ui_dst_ptr = (SIMD_T *)dst;
-    while(copysize>=SIMD_T_SIZE)
-    {
-        *(ui_dst_ptr++) = *(ui_src_ptr++);
-        copysize-=SIMD_T_SIZE;
-    }
-    if(copysize==0) return;
-*/
-
-    char * c_src_ptr = (char *)src;
-    char * c_dst_ptr = (char *)dst;
-    while(copysize>0)
-    {
-        *(c_dst_ptr++) = *(c_src_ptr++);
-        copysize--;
-    }
-    return;
-#else
-    memcpy(dst,src,copysize);
-#endif
-}
-
-
-
-template<class T>
-inline void gim_swap_elements(T* _array,size_t _i,size_t _j)
-{
-	T _e_tmp_ = _array[_i];
-	_array[_i] = _array[_j];
-	_array[_j] = _e_tmp_;
-}
-
-
-template<class T>
-inline void gim_swap_elements_memcpy(T* _array,size_t _i,size_t _j)
-{
-	char _e_tmp_[sizeof(T)];
-	gim_simd_memcpy(_e_tmp_,&_array[_i],sizeof(T));
-	gim_simd_memcpy(&_array[_i],&_array[_j],sizeof(T));
-	gim_simd_memcpy(&_array[_j],_e_tmp_,sizeof(T));
-}
-
-template <int SIZE>
-inline void gim_swap_elements_ptr(char * _array,size_t _i,size_t _j)
-{
-	char _e_tmp_[SIZE];
-	_i*=SIZE;
-	_j*=SIZE;
-	gim_simd_memcpy(_e_tmp_,_array+_i,SIZE);
-	gim_simd_memcpy(_array+_i,_array+_j,SIZE);
-	gim_simd_memcpy(_array+_j,_e_tmp_,SIZE);
-}
-
-#endif // GIM_MEMORY_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_radixsort.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_radixsort.h
deleted file mode 100644
index c246ef1..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_radixsort.h
+++ /dev/null
@@ -1,406 +0,0 @@
-#ifndef GIM_RADIXSORT_H_INCLUDED
-#define GIM_RADIXSORT_H_INCLUDED
-/*! \file gim_radixsort.h
-\author Francisco Leon Najera.
-Based on the work of Michael Herf : "fast floating-point radix sort"
-Avaliable on http://www.stereopsis.com/radix.html
-*/
-/*
------------------------------------------------------------------------------
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of EITHER:
-   (1) The GNU Lesser General Public License as published by the Free
-       Software Foundation; either version 2.1 of the License, or (at
-       your option) any later version. The text of the GNU Lesser
-       General Public License is included with this library in the
-       file GIMPACT-LICENSE-LGPL.TXT.
-   (2) The BSD-style license that is included with this library in
-       the file GIMPACT-LICENSE-BSD.TXT.
-   (3) The zlib/libpng license that is included with this library in
-       the file GIMPACT-LICENSE-ZLIB.TXT.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
-
------------------------------------------------------------------------------
-*/
-
-#include "gim_memory.h"
-
-///Macros for sorting.
-//! Prototype for comparators
-class less_comparator
-{
-	public:
-
-	template<class T,class Z>
-	inline int operator() ( const T& a, const Z& b )
-	{
-		return ( a<b?-1:(a>b?1:0));
-	}
-};
-
-//! Prototype for comparators
-class integer_comparator
-{
-	public:
-
-	template<class T>
-	inline int operator() ( const T& a, const T& b )
-	{
-		return (int)(a-b);
-	}
-};
-
-//!Prototype for getting the integer representation of an object
-class uint_key_func
-{
-public:
-	template<class T>
-	inline GUINT operator()( const T& a)
-	{
-		return (GUINT)a;
-	}
-};
-
-
-//!Prototype for copying elements
-class copy_elements_func
-{
-public:
-	template<class T>
-	inline void operator()(T& a,T& b)
-	{
-		a = b;
-	}
-};
-
-//!Prototype for copying elements
-class memcopy_elements_func
-{
-public:
-	template<class T>
-	inline void operator()(T& a,T& b)
-	{
-		gim_simd_memcpy(&a,&b,sizeof(T));
-	}
-};
-
-
-//! @{
-struct GIM_RSORT_TOKEN
-{
-    GUINT m_key;
-    GUINT m_value;
-    GIM_RSORT_TOKEN()
-    {
-    }
-    GIM_RSORT_TOKEN(const GIM_RSORT_TOKEN& rtoken)
-    {
-    	m_key = rtoken.m_key;
-    	m_value = rtoken.m_value;
-    }
-
-    inline bool operator <(const GIM_RSORT_TOKEN& other) const
-	{
-		return (m_key < other.m_key);
-	}
-
-	inline bool operator >(const GIM_RSORT_TOKEN& other) const
-	{
-		return (m_key > other.m_key);
-	}
-};
-
-//! Prototype for comparators
-class GIM_RSORT_TOKEN_COMPARATOR
-{
-	public:
-
-	inline int operator()( const GIM_RSORT_TOKEN& a, const GIM_RSORT_TOKEN& b )
-	{
-		return (int)((a.m_key) - (b.m_key));
-	}
-};
-
-
-
-#define kHist 2048
-// ---- utils for accessing 11-bit quantities
-#define D11_0(x)	(x & 0x7FF)
-#define D11_1(x)	(x >> 11 & 0x7FF)
-#define D11_2(x)	(x >> 22 )
-
-
-
-///Radix sort for unsigned integer keys
-inline void gim_radix_sort_rtokens(
-				GIM_RSORT_TOKEN * array,
-				GIM_RSORT_TOKEN * sorted, GUINT element_count)
-{
-	GUINT i;
-	GUINT b0[kHist * 3];
-	GUINT *b1 = b0 + kHist;
-	GUINT *b2 = b1 + kHist;
-	for (i = 0; i < kHist * 3; ++i)
-	{
-		b0[i] = 0;
-	}
-	GUINT fi;
-	GUINT pos;
-	for (i = 0; i < element_count; ++i)
-	{
-	    fi = array[i].m_key;
-		b0[D11_0(fi)] ++;
-		b1[D11_1(fi)] ++;
-		b2[D11_2(fi)] ++;
-	}
-	{
-		GUINT sum0 = 0, sum1 = 0, sum2 = 0;
-		GUINT tsum;
-		for (i = 0; i < kHist; ++i)
-		{
-			tsum = b0[i] + sum0;
-			b0[i] = sum0 - 1;
-			sum0 = tsum;
-			tsum = b1[i] + sum1;
-			b1[i] = sum1 - 1;
-			sum1 = tsum;
-			tsum = b2[i] + sum2;
-			b2[i] = sum2 - 1;
-			sum2 = tsum;
-		}
-	}
-	for (i = 0; i < element_count; ++i)
-	{
-        fi = array[i].m_key;
-		pos = D11_0(fi);
-		pos = ++b0[pos];
-		sorted[pos].m_key = array[i].m_key;
-		sorted[pos].m_value = array[i].m_value;
-	}
-	for (i = 0; i < element_count; ++i)
-	{
-        fi = sorted[i].m_key;
-		pos = D11_1(fi);
-		pos = ++b1[pos];
-		array[pos].m_key = sorted[i].m_key;
-		array[pos].m_value = sorted[i].m_value;
-	}
-	for (i = 0; i < element_count; ++i)
-	{
-        fi = array[i].m_key;
-		pos = D11_2(fi);
-		pos = ++b2[pos];
-		sorted[pos].m_key = array[i].m_key;
-		sorted[pos].m_value = array[i].m_value;
-	}
-}
-
-
-
-
-/// Get the sorted tokens from an array. For generic use. Tokens are IRR_RSORT_TOKEN
-/*!
-*\param array Array of elements to sort
-*\param sorted_tokens Tokens of sorted elements
-*\param element_count element count
-*\param uintkey_macro Functor which retrieves the integer representation of an array element
-*/
-template<typename T, class GETKEY_CLASS>
-void gim_radix_sort_array_tokens(
-			T* array ,
-			GIM_RSORT_TOKEN * sorted_tokens,
-			GUINT element_count,GETKEY_CLASS uintkey_macro)
-{
-	GIM_RSORT_TOKEN * _unsorted = (GIM_RSORT_TOKEN *) gim_alloc(sizeof(GIM_RSORT_TOKEN)*element_count);
-    for (GUINT _i=0;_i<element_count;++_i)
-    {
-        _unsorted[_i].m_key = uintkey_macro(array[_i]);
-        _unsorted[_i].m_value = _i;
-    }
-    gim_radix_sort_rtokens(_unsorted,sorted_tokens,element_count);
-    gim_free(_unsorted);
-    gim_free(_unsorted);
-}
-
-/// Sorts array in place. For generic use
-/*!
-\param type Type of the array
-\param array
-\param element_count
-\param get_uintkey_macro Macro for extract the Integer value of the element. Similar to SIMPLE_GET_UINTKEY
-\param copy_elements_macro Macro for copy elements, similar to SIMPLE_COPY_ELEMENTS
-*/
-template<typename T, class GETKEY_CLASS, class COPY_CLASS>
-void gim_radix_sort(
-	T * array, GUINT element_count,
-	GETKEY_CLASS get_uintkey_macro, COPY_CLASS copy_elements_macro)
-{
-	GIM_RSORT_TOKEN * _sorted = (GIM_RSORT_TOKEN  *) gim_alloc(sizeof(GIM_RSORT_TOKEN)*element_count);
-    gim_radix_sort_array_tokens(array,_sorted,element_count,get_uintkey_macro);
-    T * _original_array = (T *) gim_alloc(sizeof(T)*element_count);
-    gim_simd_memcpy(_original_array,array,sizeof(T)*element_count);
-    for (GUINT _i=0;_i<element_count;++_i)
-    {
-        copy_elements_macro(array[_i],_original_array[_sorted[_i].m_value]);
-    }
-    gim_free(_original_array);
-    gim_free(_sorted);
-}
-
-//! Failsafe Iterative binary search,
-/*!
-If the element is not found, it returns the nearest upper element position, may be the further position after the last element.
-\param _array
-\param _start_i the beginning of the array
-\param _end_i the ending  index of the array
-\param _search_key Value to find
-\param _comp_macro macro for comparing elements
-\param _found If true the value has found. Boolean
-\param _result_index the index of the found element, or if not found then it will get the index of the  closest bigger value
-*/
-template<class T, typename KEYCLASS, typename COMP_CLASS>
-bool  gim_binary_search_ex(
-		const T* _array, GUINT _start_i,
-		GUINT _end_i,GUINT & _result_index,
-		const KEYCLASS & _search_key,
-		COMP_CLASS _comp_macro)
-{
-	GUINT _k;
-	int _comp_result;
-	GUINT _i = _start_i;
-	GUINT _j = _end_i+1;
-	while (_i < _j)
-	{
-		_k = (_j+_i-1)/2;
-		_comp_result = _comp_macro(_array[_k], _search_key);
-		if (_comp_result == 0)
-		{
-			_result_index = _k;
-			return true;
-		}
-		else if (_comp_result < 0)
-		{
-			_i = _k+1;
-		}
-		else
-		{
-			_j = _k;
-		}
-	}
-	_result_index = _i;
-	return false;
-}
-
-
-
-//! Failsafe Iterative binary search,Template version
-/*!
-If the element is not found, it returns the nearest upper element position, may be the further position after the last element.
-\param _array
-\param _start_i the beginning of the array
-\param _end_i the ending  index of the array
-\param _search_key Value to find
-\param _result_index the index of the found element, or if not found then it will get the index of the  closest bigger value
-\return true if found, else false
-*/
-template<class T>
-bool gim_binary_search(
-	const T*_array,GUINT _start_i,
-	GUINT _end_i,const T & _search_key,
-	GUINT & _result_index)
-{
-	GUINT _i = _start_i;
-	GUINT _j = _end_i+1;
-	GUINT _k;
-	while(_i < _j)
-	{
-		_k = (_j+_i-1)/2;
-		if(_array[_k]==_search_key)
-		{
-			_result_index = _k;
-			return true;
-		}
-		else if (_array[_k]<_search_key)
-		{
-			_i = _k+1;
-		}
-		else
-		{
-			_j = _k;
-		}
-	}
-	_result_index = _i;
-	return false;
-}
-
-
-
-///heap sort from http://www.csse.monash.edu.au/~lloyd/tildeAlgDS/Sort/Heap/
-template <typename T, typename COMP_CLASS>
-void gim_down_heap(T *pArr, GUINT k, GUINT n,COMP_CLASS CompareFunc)
-{
-	/*  PRE: a[k+1..N] is a heap */
-	/* POST:  a[k..N]  is a heap */
-
-	T temp = pArr[k - 1];
-	/* k has child(s) */
-	while (k <= n/2)
-	{
-		int child = 2*k;
-
-		if ((child < (int)n) && CompareFunc(pArr[child - 1] , pArr[child])<0)
-		{
-			child++;
-		}
-		/* pick larger child */
-		if (CompareFunc(temp , pArr[child - 1])<0)
-		{
-			/* move child up */
-			pArr[k - 1] = pArr[child - 1];
-			k = child;
-		}
-		else
-		{
-			break;
-		}
-	}
-	pArr[k - 1] = temp;
-} /*downHeap*/
-
-
-template <typename T, typename COMP_CLASS>
-void gim_heap_sort(T *pArr, GUINT element_count, COMP_CLASS CompareFunc)
-{
-	/* sort a[0..N-1],  N.B. 0 to N-1 */
-	GUINT k;
-	GUINT n = element_count;
-	for (k = n/2; k > 0; k--)
-	{
-		gim_down_heap(pArr, k, n, CompareFunc);
-	}
-
-	/* a[1..N] is now a heap */
-	while ( n>=2 )
-	{
-		gim_swap_elements(pArr,0,n-1); /* largest of a[0..n-1] */
-		--n;
-		/* restore a[1..i-1] heap */
-		gim_down_heap(pArr, 1, n, CompareFunc);
-	}
-}
-
-
-
-
-#endif // GIM_RADIXSORT_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_tri_collision.cpp b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_tri_collision.cpp
deleted file mode 100644
index f9727e1..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_tri_collision.cpp
+++ /dev/null
@@ -1,640 +0,0 @@
-
-/*! \file gim_tri_collision.h
-\author Francisco Leon Najera
-*/
-/*
------------------------------------------------------------------------------
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of EITHER:
-   (1) The GNU Lesser General Public License as published by the Free
-       Software Foundation; either version 2.1 of the License, or (at
-       your option) any later version. The text of the GNU Lesser
-       General Public License is included with this library in the
-       file GIMPACT-LICENSE-LGPL.TXT.
-   (2) The BSD-style license that is included with this library in
-       the file GIMPACT-LICENSE-BSD.TXT.
-   (3) The zlib/libpng license that is included with this library in
-       the file GIMPACT-LICENSE-ZLIB.TXT.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
-
------------------------------------------------------------------------------
-*/
-
-#include "gim_tri_collision.h"
-
-
-#define TRI_LOCAL_EPSILON 0.000001f
-#define MIN_EDGE_EDGE_DIS 0.00001f
-
-
-class GIM_TRIANGLE_CALCULATION_CACHE
-{
-public:
-	GREAL margin;	
-	btVector3 tu_vertices[3];
-	btVector3 tv_vertices[3];
-	btVector4 tu_plane;
-	btVector4 tv_plane;
-	btVector3 closest_point_u;
-	btVector3 closest_point_v;
-	btVector3 edge_edge_dir;
-	btVector3 distances;
-	GREAL du[4];
-	GREAL du0du1;
-	GREAL du0du2;
-	GREAL dv[4];
-	GREAL dv0dv1;
-	GREAL dv0dv2;	
-	btVector3 temp_points[MAX_TRI_CLIPPING];
-	btVector3 temp_points1[MAX_TRI_CLIPPING];
-	btVector3 contact_points[MAX_TRI_CLIPPING];
-	
-
-
-	//! if returns false, the faces are paralele
-	SIMD_FORCE_INLINE bool compute_intervals(
-					const GREAL &D0,
-					const GREAL &D1,
-					const GREAL &D2,
-					const GREAL &D0D1,
-					const GREAL &D0D2,
-					GREAL & scale_edge0,
-					GREAL & scale_edge1,
-					GUINT &edge_index0,
-					GUINT &edge_index1)
-	{
-		if(D0D1>0.0f)
-		{
-			/* here we know that D0D2<=0.0 */
-			/* that is D0, D1 are on the same side, D2 on the other or on the plane */
-			scale_edge0 = -D2/(D0-D2);
-			scale_edge1 = -D1/(D2-D1);
-			edge_index0 = 2;edge_index1 = 1;
-		}
-		else if(D0D2>0.0f)
-		{
-			/* here we know that d0d1<=0.0 */
-			scale_edge0 = -D0/(D1-D0);
-			scale_edge1 = -D1/(D2-D1);
-			edge_index0 = 0;edge_index1 = 1;
-		}
-		else if(D1*D2>0.0f || D0!=0.0f)
-		{
-			/* here we know that d0d1<=0.0 or that D0!=0.0 */
-			scale_edge0 = -D0/(D1-D0);
-			scale_edge1 = -D2/(D0-D2);
-			edge_index0 = 0 ;edge_index1 = 2;
-		}
-		else
-		{
-			return false;
-		}
-		return true;
-	}
-
-
-	//! clip triangle
-	/*!
-	*/
-	SIMD_FORCE_INLINE GUINT clip_triangle(
-		const btVector4 & tri_plane,
-		const btVector3 * tripoints,
-		const btVector3 * srcpoints,
-		btVector3 * clip_points)
-	{
-		// edge 0
-
-		btVector4 edgeplane;
-
-		EDGE_PLANE(tripoints[0],tripoints[1],tri_plane,edgeplane);
-
-		GUINT clipped_count = PLANE_CLIP_TRIANGLE3D(
-			edgeplane,srcpoints[0],srcpoints[1],srcpoints[2],temp_points);
-
-		if(clipped_count == 0) return 0;
-
-		// edge 1
-
-		EDGE_PLANE(tripoints[1],tripoints[2],tri_plane,edgeplane);
-
-		clipped_count = PLANE_CLIP_POLYGON3D(
-			edgeplane,temp_points,clipped_count,temp_points1);
-
-		if(clipped_count == 0) return 0;
-
-		// edge 2
-
-		EDGE_PLANE(tripoints[2],tripoints[0],tri_plane,edgeplane);
-
-		clipped_count = PLANE_CLIP_POLYGON3D(
-			edgeplane,temp_points1,clipped_count,clip_points);
-
-		return clipped_count;
-
-
-		/*GUINT i0 = (tri_plane.closestAxis()+1)%3;
-		GUINT i1 = (i0+1)%3;
-		// edge 0
-		btVector3 temp_points[MAX_TRI_CLIPPING];
-		btVector3 temp_points1[MAX_TRI_CLIPPING];
-
-		GUINT clipped_count= PLANE_CLIP_TRIANGLE_GENERIC(
-			0,srcpoints[0],srcpoints[1],srcpoints[2],temp_points,
-			DISTANCE_EDGE(tripoints[0],tripoints[1],i0,i1));
-		
-		
-		if(clipped_count == 0) return 0;
-
-		// edge 1
-		clipped_count = PLANE_CLIP_POLYGON_GENERIC(
-			0,temp_points,clipped_count,temp_points1,
-			DISTANCE_EDGE(tripoints[1],tripoints[2],i0,i1));
-
-		if(clipped_count == 0) return 0;
-
-		// edge 2
-		clipped_count = PLANE_CLIP_POLYGON_GENERIC(
-			0,temp_points1,clipped_count,clipped_points,
-			DISTANCE_EDGE(tripoints[2],tripoints[0],i0,i1));
-
-		return clipped_count;*/
-	}
-
-	SIMD_FORCE_INLINE void sort_isect(
-		GREAL & isect0,GREAL & isect1,GUINT &e0,GUINT &e1,btVector3 & vec0,btVector3 & vec1)
-	{
-		if(isect1<isect0)
-		{
-			//swap
-			GIM_SWAP_NUMBERS(isect0,isect1);
-			GIM_SWAP_NUMBERS(e0,e1);
-			btVector3 tmp = vec0;
-			vec0 = vec1;
-			vec1 = tmp;
-		}
-	}
-
-	//! Test verifying interval intersection with the direction between planes
-	/*!
-	\pre tv_plane and tu_plane must be set
-	\post
-	distances[2] is set with the distance
-	closest_point_u, closest_point_v, edge_edge_dir are set too
-	\return
-	- 0: faces are paralele
-	- 1: face U casts face V
-	- 2: face V casts face U
-	- 3: nearest edges
-	*/
-	SIMD_FORCE_INLINE GUINT cross_line_intersection_test()
-	{
-		// Compute direction of intersection line
-		edge_edge_dir = tu_plane.cross(tv_plane);
-		GREAL Dlen;
-		VEC_LENGTH(edge_edge_dir,Dlen);
-
-		if(Dlen<0.0001)
-		{
-			return 0; //faces near paralele
-		}
-
-		edge_edge_dir*= 1/Dlen;//normalize
-
-
-		// Compute interval for triangle 1
-		GUINT tu_e0,tu_e1;//edge indices
-		GREAL tu_scale_e0,tu_scale_e1;//edge scale
-		if(!compute_intervals(du[0],du[1],du[2],
-			du0du1,du0du2,tu_scale_e0,tu_scale_e1,tu_e0,tu_e1)) return 0;
-
-		// Compute interval for triangle 2
-		GUINT tv_e0,tv_e1;//edge indices
-		GREAL tv_scale_e0,tv_scale_e1;//edge scale
-
-		if(!compute_intervals(dv[0],dv[1],dv[2],
-			dv0dv1,dv0dv2,tv_scale_e0,tv_scale_e1,tv_e0,tv_e1)) return 0;
-
-		//proyected vertices
-		btVector3 up_e0 = tu_vertices[tu_e0].lerp(tu_vertices[(tu_e0+1)%3],tu_scale_e0);
-		btVector3 up_e1 = tu_vertices[tu_e1].lerp(tu_vertices[(tu_e1+1)%3],tu_scale_e1);
-
-		btVector3 vp_e0 = tv_vertices[tv_e0].lerp(tv_vertices[(tv_e0+1)%3],tv_scale_e0);
-		btVector3 vp_e1 = tv_vertices[tv_e1].lerp(tv_vertices[(tv_e1+1)%3],tv_scale_e1);
-
-		//proyected intervals
-		GREAL isect_u[] = {up_e0.dot(edge_edge_dir),up_e1.dot(edge_edge_dir)};
-		GREAL isect_v[] = {vp_e0.dot(edge_edge_dir),vp_e1.dot(edge_edge_dir)};
-
-		sort_isect(isect_u[0],isect_u[1],tu_e0,tu_e1,up_e0,up_e1);
-		sort_isect(isect_v[0],isect_v[1],tv_e0,tv_e1,vp_e0,vp_e1);
-
-		const GREAL midpoint_u = 0.5f*(isect_u[0]+isect_u[1]); // midpoint
-		const GREAL midpoint_v = 0.5f*(isect_v[0]+isect_v[1]); // midpoint
-
-		if(midpoint_u<midpoint_v)
-		{
-			if(isect_u[1]>=isect_v[1]) // face U casts face V
-			{
-				return 1;
-			}
-			else if(isect_v[0]<=isect_u[0]) // face V casts face U
-			{
-				return 2;
-			}
-			// closest points
-			closest_point_u = up_e1;
-			closest_point_v = vp_e0;
-			// calc edges and separation
-
-			if(isect_u[1]+ MIN_EDGE_EDGE_DIS<isect_v[0]) //calc distance between two lines instead
-			{
-				SEGMENT_COLLISION(
-					tu_vertices[tu_e1],tu_vertices[(tu_e1+1)%3],
-					tv_vertices[tv_e0],tv_vertices[(tv_e0+1)%3],
-					closest_point_u,
-					closest_point_v);
-
-				edge_edge_dir = closest_point_u-closest_point_v;
-				VEC_LENGTH(edge_edge_dir,distances[2]);
-				edge_edge_dir *= 1.0f/distances[2];// normalize
-			}
-			else
-			{
-				distances[2] = isect_v[0]-isect_u[1];//distance negative
-				//edge_edge_dir *= -1.0f; //normal pointing from V to U
-			}
-
-		}
-		else
-		{
-			if(isect_v[1]>=isect_u[1]) // face V casts face U
-			{
-				return 2;
-			}
-			else if(isect_u[0]<=isect_v[0]) // face U casts face V
-			{
-				return 1;
-			}
-			// closest points
-			closest_point_u = up_e0;
-			closest_point_v = vp_e1;
-			// calc edges and separation
-
-			if(isect_v[1]+MIN_EDGE_EDGE_DIS<isect_u[0]) //calc distance between two lines instead
-			{
-				SEGMENT_COLLISION(
-					tu_vertices[tu_e0],tu_vertices[(tu_e0+1)%3],
-					tv_vertices[tv_e1],tv_vertices[(tv_e1+1)%3],
-					closest_point_u,
-					closest_point_v);
-
-				edge_edge_dir = closest_point_u-closest_point_v;
-				VEC_LENGTH(edge_edge_dir,distances[2]);
-				edge_edge_dir *= 1.0f/distances[2];// normalize
-			}
-			else
-			{
-				distances[2] = isect_u[0]-isect_v[1];//distance negative
-				//edge_edge_dir *= -1.0f; //normal pointing from V to U
-			}
-		}
-		return 3;
-	}
-
-
-	//! collides by two sides
-	SIMD_FORCE_INLINE bool triangle_collision(
-					const btVector3 & u0,
-					const btVector3 & u1,
-					const btVector3 & u2,
-					GREAL margin_u,
-					const btVector3 & v0,
-					const btVector3 & v1,
-					const btVector3 & v2,
-					GREAL margin_v,
-					GIM_TRIANGLE_CONTACT_DATA & contacts)
-	{
-
-		margin = margin_u + margin_v;
-
-		tu_vertices[0] = u0;
-		tu_vertices[1] = u1;
-		tu_vertices[2] = u2;
-
-		tv_vertices[0] = v0;
-		tv_vertices[1] = v1;
-		tv_vertices[2] = v2;
-
-		//create planes
-		// plane v vs U points
-
-		TRIANGLE_PLANE(tv_vertices[0],tv_vertices[1],tv_vertices[2],tv_plane);
-
-		du[0] = DISTANCE_PLANE_POINT(tv_plane,tu_vertices[0]);
-		du[1] = DISTANCE_PLANE_POINT(tv_plane,tu_vertices[1]);
-		du[2] = DISTANCE_PLANE_POINT(tv_plane,tu_vertices[2]);
-
-
-		du0du1 = du[0] * du[1];
-		du0du2 = du[0] * du[2];
-
-
-		if(du0du1>0.0f && du0du2>0.0f)	// same sign on all of them + not equal 0 ?
-		{
-			if(du[0]<0) //we need test behind the triangle plane
-			{
-				distances[0] = GIM_MAX3(du[0],du[1],du[2]);
-				distances[0] = -distances[0];
-				if(distances[0]>margin) return false; //never intersect
-
-				//reorder triangle v
-				VEC_SWAP(tv_vertices[0],tv_vertices[1]);
-				VEC_SCALE_4(tv_plane,-1.0f,tv_plane);
-			}
-			else
-			{
-				distances[0] = GIM_MIN3(du[0],du[1],du[2]);
-				if(distances[0]>margin) return false; //never intersect
-			}
-		}
-		else
-		{
-			//Look if we need to invert the triangle
-			distances[0] = (du[0]+du[1]+du[2])/3.0f; //centroid
-
-			if(distances[0]<0.0f)
-			{
-				//reorder triangle v
-				VEC_SWAP(tv_vertices[0],tv_vertices[1]);
-				VEC_SCALE_4(tv_plane,-1.0f,tv_plane);
-
-				distances[0] = GIM_MAX3(du[0],du[1],du[2]);
-				distances[0] = -distances[0];
-			}
-			else
-			{
-				distances[0] = GIM_MIN3(du[0],du[1],du[2]);
-			}
-		}
-
-
-		// plane U vs V points
-
-		TRIANGLE_PLANE(tu_vertices[0],tu_vertices[1],tu_vertices[2],tu_plane);
-
-		dv[0] = DISTANCE_PLANE_POINT(tu_plane,tv_vertices[0]);
-		dv[1] = DISTANCE_PLANE_POINT(tu_plane,tv_vertices[1]);
-		dv[2] = DISTANCE_PLANE_POINT(tu_plane,tv_vertices[2]);
-
-		dv0dv1 = dv[0] * dv[1];
-		dv0dv2 = dv[0] * dv[2];
-
-
-		if(dv0dv1>0.0f && dv0dv2>0.0f)	// same sign on all of them + not equal 0 ?
-		{
-			if(dv[0]<0) //we need test behind the triangle plane
-			{
-				distances[1] = GIM_MAX3(dv[0],dv[1],dv[2]);
-				distances[1] = -distances[1];
-				if(distances[1]>margin) return false; //never intersect
-
-				//reorder triangle u
-				VEC_SWAP(tu_vertices[0],tu_vertices[1]);
-				VEC_SCALE_4(tu_plane,-1.0f,tu_plane);
-			}
-			else
-			{
-				distances[1] = GIM_MIN3(dv[0],dv[1],dv[2]);
-				if(distances[1]>margin) return false; //never intersect
-			}
-		}
-		else
-		{
-			//Look if we need to invert the triangle
-			distances[1] = (dv[0]+dv[1]+dv[2])/3.0f; //centroid
-
-			if(distances[1]<0.0f)
-			{
-				//reorder triangle v
-				VEC_SWAP(tu_vertices[0],tu_vertices[1]);
-				VEC_SCALE_4(tu_plane,-1.0f,tu_plane);
-
-				distances[1] = GIM_MAX3(dv[0],dv[1],dv[2]);
-				distances[1] = -distances[1];
-			}
-			else
-			{
-				distances[1] = GIM_MIN3(dv[0],dv[1],dv[2]);
-			}
-		}
-
-		GUINT bl;
-		/* bl = cross_line_intersection_test();
-		if(bl==3)
-		{
-			//take edge direction too
-			bl = distances.maxAxis();
-		}
-		else
-		{*/
-			bl = 0;
-			if(distances[0]<distances[1]) bl = 1;
-		//}
-
-		if(bl==2) //edge edge separation
-		{
-			if(distances[2]>margin) return false;
-
-			contacts.m_penetration_depth = -distances[2] + margin;
-			contacts.m_points[0] = closest_point_v;
-			contacts.m_point_count = 1;
-			VEC_COPY(contacts.m_separating_normal,edge_edge_dir);
-
-			return true;
-		}
-
-		//clip face against other
-
-		
-		GUINT point_count;
-		//TODO
-		if(bl == 0) //clip U points against V
-		{
-			point_count = clip_triangle(tv_plane,tv_vertices,tu_vertices,contact_points);
-			if(point_count == 0) return false;						
-			contacts.merge_points(tv_plane,margin,contact_points,point_count);			
-		}
-		else //clip V points against U
-		{
-			point_count = clip_triangle(tu_plane,tu_vertices,tv_vertices,contact_points);
-			if(point_count == 0) return false;			
-			contacts.merge_points(tu_plane,margin,contact_points,point_count);
-			contacts.m_separating_normal *= -1.f;
-		}
-		if(contacts.m_point_count == 0) return false;
-		return true;
-	}
-
-};
-
-
-/*class GIM_TRIANGLE_CALCULATION_CACHE
-{
-public:
-	GREAL margin;
-	GUINT clipped_count;
-	btVector3 tu_vertices[3];
-	btVector3 tv_vertices[3];
-	btVector3 temp_points[MAX_TRI_CLIPPING];
-	btVector3 temp_points1[MAX_TRI_CLIPPING];
-	btVector3 clipped_points[MAX_TRI_CLIPPING];
-	GIM_TRIANGLE_CONTACT_DATA contacts1;
-	GIM_TRIANGLE_CONTACT_DATA contacts2;
-
-
-	//! clip triangle
-	GUINT clip_triangle(
-		const btVector4 & tri_plane,
-		const btVector3 * tripoints,
-		const btVector3 * srcpoints,
-		btVector3 * clipped_points)
-	{
-		// edge 0
-
-		btVector4 edgeplane;
-
-		EDGE_PLANE(tripoints[0],tripoints[1],tri_plane,edgeplane);
-
-		GUINT clipped_count = PLANE_CLIP_TRIANGLE3D(
-			edgeplane,srcpoints[0],srcpoints[1],srcpoints[2],temp_points);
-
-		if(clipped_count == 0) return 0;
-
-		// edge 1
-
-		EDGE_PLANE(tripoints[1],tripoints[2],tri_plane,edgeplane);
-
-		clipped_count = PLANE_CLIP_POLYGON3D(
-			edgeplane,temp_points,clipped_count,temp_points1);
-
-		if(clipped_count == 0) return 0;
-
-		// edge 2
-
-		EDGE_PLANE(tripoints[2],tripoints[0],tri_plane,edgeplane);
-
-		clipped_count = PLANE_CLIP_POLYGON3D(
-			edgeplane,temp_points1,clipped_count,clipped_points);
-
-		return clipped_count;
-	}
-
-
-
-
-	//! collides only on one side
-	bool triangle_collision(
-					const btVector3 & u0,
-					const btVector3 & u1,
-					const btVector3 & u2,
-					GREAL margin_u,
-					const btVector3 & v0,
-					const btVector3 & v1,
-					const btVector3 & v2,
-					GREAL margin_v,
-					GIM_TRIANGLE_CONTACT_DATA & contacts)
-	{
-
-		margin = margin_u + margin_v;
-
-		
-		tu_vertices[0] = u0;
-		tu_vertices[1] = u1;
-		tu_vertices[2] = u2;
-
-		tv_vertices[0] = v0;
-		tv_vertices[1] = v1;
-		tv_vertices[2] = v2;
-
-		//create planes
-		// plane v vs U points
-
-
-		TRIANGLE_PLANE(tv_vertices[0],tv_vertices[1],tv_vertices[2],contacts1.m_separating_normal);
-
-		clipped_count = clip_triangle(
-			contacts1.m_separating_normal,tv_vertices,tu_vertices,clipped_points);
-
-		if(clipped_count == 0 )
-		{
-			 return false;//Reject
-		}
-
-		//find most deep interval face1
-		contacts1.merge_points(contacts1.m_separating_normal,margin,clipped_points,clipped_count);
-		if(contacts1.m_point_count == 0) return false; // too far
-
-		//Normal pointing to triangle1
-		//contacts1.m_separating_normal *= -1.f;
-
-		//Clip tri1 by tri2 edges
-
-		TRIANGLE_PLANE(tu_vertices[0],tu_vertices[1],tu_vertices[2],contacts2.m_separating_normal);
-
-		clipped_count = clip_triangle(
-			contacts2.m_separating_normal,tu_vertices,tv_vertices,clipped_points);
-
-		if(clipped_count == 0 )
-		{
-			 return false;//Reject
-		}
-
-		//find most deep interval face1
-		contacts2.merge_points(contacts2.m_separating_normal,margin,clipped_points,clipped_count);
-		if(contacts2.m_point_count == 0) return false; // too far
-
-		contacts2.m_separating_normal *= -1.f;
-
-		////check most dir for contacts
-		if(contacts2.m_penetration_depth<contacts1.m_penetration_depth)
-		{
-			contacts.copy_from(contacts2);
-		}
-		else
-		{
-			contacts.copy_from(contacts1);
-		}
-		return true;
-	}
-
-
-};*/
-
-
-
-bool GIM_TRIANGLE::collide_triangle_hard_test(
-		const GIM_TRIANGLE & other,
-		GIM_TRIANGLE_CONTACT_DATA & contact_data) const
-{
-	GIM_TRIANGLE_CALCULATION_CACHE calc_cache;	
-	return calc_cache.triangle_collision(
-					m_vertices[0],m_vertices[1],m_vertices[2],m_margin,
-					other.m_vertices[0],other.m_vertices[1],other.m_vertices[2],other.m_margin,
-					contact_data);
-
-}
-
-
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_tri_collision.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_tri_collision.h
deleted file mode 100644
index 5b552a1..0000000
--- a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_tri_collision.h
+++ /dev/null
@@ -1,379 +0,0 @@
-#ifndef GIM_TRI_COLLISION_H_INCLUDED
-#define GIM_TRI_COLLISION_H_INCLUDED
-
-/*! \file gim_tri_collision.h
-\author Francisco Leon Najera
-*/
-/*
------------------------------------------------------------------------------
-This source file is part of GIMPACT Library.
-
-For the latest info, see http://gimpact.sourceforge.net/
-
-Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
-email: projectileman at yahoo.com
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of EITHER:
-   (1) The GNU Lesser General Public License as published by the Free
-       Software Foundation; either version 2.1 of the License, or (at
-       your option) any later version. The text of the GNU Lesser
-       General Public License is included with this library in the
-       file GIMPACT-LICENSE-LGPL.TXT.
-   (2) The BSD-style license that is included with this library in
-       the file GIMPACT-LICENSE-BSD.TXT.
-   (3) The zlib/libpng license that is included with this library in
-       the file GIMPACT-LICENSE-ZLIB.TXT.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files
- GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
-
------------------------------------------------------------------------------
-*/
-
-#include "gim_box_collision.h"
-#include "gim_clip_polygon.h"
-
-
-
-
-#define MAX_TRI_CLIPPING 16
-
-//! Structure for collision
-struct GIM_TRIANGLE_CONTACT_DATA
-{
-    GREAL m_penetration_depth;
-    GUINT m_point_count;
-    btVector4 m_separating_normal;
-    btVector3 m_points[MAX_TRI_CLIPPING];
-
-	SIMD_FORCE_INLINE void copy_from(const GIM_TRIANGLE_CONTACT_DATA& other)
-	{
-		m_penetration_depth = other.m_penetration_depth;
-		m_separating_normal = other.m_separating_normal;
-		m_point_count = other.m_point_count;
-		GUINT i = m_point_count;
-		while(i--)
-		{
-			m_points[i] = other.m_points[i];
-		}
-	}
-
-	GIM_TRIANGLE_CONTACT_DATA()
-	{
-	}
-
-	GIM_TRIANGLE_CONTACT_DATA(const GIM_TRIANGLE_CONTACT_DATA& other)
-	{
-		copy_from(other);
-	}
-
-	
-	
-
-    //! classify points that are closer
-    template<typename DISTANCE_FUNC,typename CLASS_PLANE>
-    SIMD_FORCE_INLINE void mergepoints_generic(const CLASS_PLANE & plane,
-    				GREAL margin, const btVector3 * points, GUINT point_count, DISTANCE_FUNC distance_func)
-    {	
-    	m_point_count = 0;
-    	m_penetration_depth= -1000.0f;
-
-		GUINT point_indices[MAX_TRI_CLIPPING];
-
-		GUINT _k;
-
-		for(_k=0;_k<point_count;_k++)
-		{
-			GREAL _dist = -distance_func(plane,points[_k]) + margin;
-
-			if(_dist>=0.0f)
-			{
-				if(_dist>m_penetration_depth)
-				{
-					m_penetration_depth = _dist;
-					point_indices[0] = _k;
-					m_point_count=1;
-				}
-				else if((_dist+G_EPSILON)>=m_penetration_depth)
-				{
-					point_indices[m_point_count] = _k;
-					m_point_count++;
-				}
-			}
-		}
-
-		for( _k=0;_k<m_point_count;_k++)
-		{
-			m_points[_k] = points[point_indices[_k]];
-		}
-	}
-
-	//! classify points that are closer
-	SIMD_FORCE_INLINE void merge_points(const btVector4 & plane, GREAL margin,
-										 const btVector3 * points, GUINT point_count)
-	{
-		m_separating_normal = plane;
-		mergepoints_generic(plane, margin, points, point_count, DISTANCE_PLANE_3D_FUNC());
-	}
-};
-
-
-//! Class for colliding triangles
-class GIM_TRIANGLE
-{
-public:
-	btScalar m_margin;
-    btVector3 m_vertices[3];
-
-    GIM_TRIANGLE():m_margin(0.1f)
-    {
-    }
-
-    SIMD_FORCE_INLINE GIM_AABB get_box()  const
-    {
-    	return GIM_AABB(m_vertices[0],m_vertices[1],m_vertices[2],m_margin);
-    }
-
-    SIMD_FORCE_INLINE void get_normal(btVector3 &normal)  const
-    {
-    	TRIANGLE_NORMAL(m_vertices[0],m_vertices[1],m_vertices[2],normal);
-    }
-
-    SIMD_FORCE_INLINE void get_plane(btVector4 &plane)  const
-    {
-    	TRIANGLE_PLANE(m_vertices[0],m_vertices[1],m_vertices[2],plane);;
-    }
-
-    SIMD_FORCE_INLINE void apply_transform(const btTransform & trans)
-    {
-    	m_vertices[0] = trans(m_vertices[0]);
-    	m_vertices[1] = trans(m_vertices[1]);
-    	m_vertices[2] = trans(m_vertices[2]);
-    }
-
-    SIMD_FORCE_INLINE void get_edge_plane(GUINT edge_index,const btVector3 &triangle_normal,btVector4 &plane)  const
-    {
-		const btVector3 & e0 = m_vertices[edge_index];
-		const btVector3 & e1 = m_vertices[(edge_index+1)%3];
-		EDGE_PLANE(e0,e1,triangle_normal,plane);
-    }
-
-    //! Gets the relative transformation of this triangle
-    /*!
-    The transformation is oriented to the triangle normal , and aligned to the 1st edge of this triangle. The position corresponds to vertice 0:
-    - triangle normal corresponds to Z axis.
-    - 1st normalized edge corresponds to X axis,
-
-    */
-    SIMD_FORCE_INLINE void get_triangle_transform(btTransform & triangle_transform)  const
-    {
-    	btMatrix3x3 & matrix = triangle_transform.getBasis();
-
-    	btVector3 zaxis;
-    	get_normal(zaxis);
-    	MAT_SET_Z(matrix,zaxis);
-
-    	btVector3 xaxis = m_vertices[1] - m_vertices[0];
-    	VEC_NORMALIZE(xaxis);
-    	MAT_SET_X(matrix,xaxis);
-
-    	//y axis
-    	xaxis = zaxis.cross(xaxis);
-    	MAT_SET_Y(matrix,xaxis);
-
-    	triangle_transform.setOrigin(m_vertices[0]);
-    }
-
-
-	//! Test triangles by finding separating axis
-	/*!
-	\param other Triangle for collide
-	\param contact_data Structure for holding contact points, normal and penetration depth; The normal is pointing toward this triangle from the other triangle
-	*/
-	bool collide_triangle_hard_test(
-		const GIM_TRIANGLE & other,
-		GIM_TRIANGLE_CONTACT_DATA & contact_data) const;
-
-	//! Test boxes before doing hard test
-	/*!
-	\param other Triangle for collide
-	\param contact_data Structure for holding contact points, normal and penetration depth; The normal is pointing toward this triangle from the other triangle
-	\
-	*/
-	SIMD_FORCE_INLINE bool collide_triangle(
-		const GIM_TRIANGLE & other,
-		GIM_TRIANGLE_CONTACT_DATA & contact_data) const
-	{
-		//test box collisioin
-		GIM_AABB boxu(m_vertices[0],m_vertices[1],m_vertices[2],m_margin);
-		GIM_AABB boxv(other.m_vertices[0],other.m_vertices[1],other.m_vertices[2],other.m_margin);
-		if(!boxu.has_collision(boxv)) return false;
-
-		//do hard test
-		return collide_triangle_hard_test(other,contact_data);
-	}
-
-	/*!
-
-	Solve the System for u,v parameters:
-
-	u*axe1[i1] + v*axe2[i1] = vecproj[i1]
-	u*axe1[i2] + v*axe2[i2] = vecproj[i2]
-
-	sustitute:
-	v = (vecproj[i2] - u*axe1[i2])/axe2[i2]
-
-	then the first equation in terms of 'u':
-
-	--> u*axe1[i1] + ((vecproj[i2] - u*axe1[i2])/axe2[i2])*axe2[i1] = vecproj[i1]
-
-	--> u*axe1[i1] + vecproj[i2]*axe2[i1]/axe2[i2] - u*axe1[i2]*axe2[i1]/axe2[i2] = vecproj[i1]
-
-	--> u*(axe1[i1]  - axe1[i2]*axe2[i1]/axe2[i2]) = vecproj[i1] - vecproj[i2]*axe2[i1]/axe2[i2]
-
-	--> u*((axe1[i1]*axe2[i2]  - axe1[i2]*axe2[i1])/axe2[i2]) = (vecproj[i1]*axe2[i2] - vecproj[i2]*axe2[i1])/axe2[i2]
-
-	--> u*(axe1[i1]*axe2[i2]  - axe1[i2]*axe2[i1]) = vecproj[i1]*axe2[i2] - vecproj[i2]*axe2[i1]
-
-	--> u = (vecproj[i1]*axe2[i2] - vecproj[i2]*axe2[i1]) /(axe1[i1]*axe2[i2]  - axe1[i2]*axe2[i1])
-
-if 0.0<= u+v <=1.0 then they are inside of triangle
-
-	\return false if the point is outside of triangle.This function  doesn't take the margin
-	*/
-	SIMD_FORCE_INLINE bool get_uv_parameters(
-			const btVector3 & point,
-			const btVector3 & tri_plane,
-			GREAL & u, GREAL & v) const
-	{
-		btVector3 _axe1 = m_vertices[1]-m_vertices[0];
-		btVector3 _axe2 = m_vertices[2]-m_vertices[0];
-		btVector3 _vecproj = point - m_vertices[0];
-		GUINT _i1 = (tri_plane.closestAxis()+1)%3;
-		GUINT _i2 = (_i1+1)%3;
-		if(btFabs(_axe2[_i2])<G_EPSILON)
-		{
-			u = (_vecproj[_i2]*_axe2[_i1] - _vecproj[_i1]*_axe2[_i2]) /(_axe1[_i2]*_axe2[_i1]  - _axe1[_i1]*_axe2[_i2]);
-			v = (_vecproj[_i1] - u*_axe1[_i1])/_axe2[_i1];
-		}
-		else
-		{
-			u = (_vecproj[_i1]*_axe2[_i2] - _vecproj[_i2]*_axe2[_i1]) /(_axe1[_i1]*_axe2[_i2]  - _axe1[_i2]*_axe2[_i1]);
-			v = (_vecproj[_i2] - u*_axe1[_i2])/_axe2[_i2];
-		}
-
-		if(u<-G_EPSILON)
-		{
-			return false;
-		}
-		else if(v<-G_EPSILON)
-		{
-			return false;
-		}
-		else
-		{
-			btScalar sumuv;
-			sumuv = u+v;
-			if(sumuv<-G_EPSILON)
-			{
-				return false;
-			}
-			else if(sumuv-1.0f>G_EPSILON)
-			{
-				return false;
-			}
-		}
-		return true;
-	}
-
-	//! is point in triangle beam?
-	/*!
-	Test if point is in triangle, with m_margin tolerance
-	*/
-	SIMD_FORCE_INLINE bool is_point_inside(const btVector3 & point, const btVector3 & tri_normal) const
-	{
-		//Test with edge 0
-		btVector4 edge_plane;
-		this->get_edge_plane(0,tri_normal,edge_plane);
-		GREAL dist = DISTANCE_PLANE_POINT(edge_plane,point);
-		if(dist-m_margin>0.0f) return false; // outside plane
-
-		this->get_edge_plane(1,tri_normal,edge_plane);
-		dist = DISTANCE_PLANE_POINT(edge_plane,point);
-		if(dist-m_margin>0.0f) return false; // outside plane
-
-		this->get_edge_plane(2,tri_normal,edge_plane);
-		dist = DISTANCE_PLANE_POINT(edge_plane,point);
-		if(dist-m_margin>0.0f) return false; // outside plane
-		return true;
-	}
-
-
-	//! Bidireccional ray collision
-	SIMD_FORCE_INLINE bool ray_collision(
-		const btVector3 & vPoint,
-		const btVector3 & vDir, btVector3 & pout, btVector3 & triangle_normal,
-		GREAL & tparam, GREAL tmax = G_REAL_INFINITY)
-	{
-		btVector4 faceplane;
-		{
-			btVector3 dif1 = m_vertices[1] - m_vertices[0];
-			btVector3 dif2 = m_vertices[2] - m_vertices[0];
-    		VEC_CROSS(faceplane,dif1,dif2);
-    		faceplane[3] = m_vertices[0].dot(faceplane);
-		}
-
-		GUINT res = LINE_PLANE_COLLISION(faceplane,vDir,vPoint,pout,tparam, btScalar(0), tmax);
-		if(res == 0) return false;
-		if(! is_point_inside(pout,faceplane)) return false;
-
-		if(res==2) //invert normal
-		{
-			triangle_normal.setValue(-faceplane[0],-faceplane[1],-faceplane[2]);
-		}
-		else
-		{
-			triangle_normal.setValue(faceplane[0],faceplane[1],faceplane[2]);
-		}
-
-		VEC_NORMALIZE(triangle_normal);
-
-		return true;
-	}
-
-
-	//! one direccion ray collision
-	SIMD_FORCE_INLINE bool ray_collision_front_side(
-		const btVector3 & vPoint,
-		const btVector3 & vDir, btVector3 & pout, btVector3 & triangle_normal,
-		GREAL & tparam, GREAL tmax = G_REAL_INFINITY)
-	{
-		btVector4 faceplane;
-		{
-			btVector3 dif1 = m_vertices[1] - m_vertices[0];
-			btVector3 dif2 = m_vertices[2] - m_vertices[0];
-    		VEC_CROSS(faceplane,dif1,dif2);
-    		faceplane[3] = m_vertices[0].dot(faceplane);
-		}
-
-		GUINT res = LINE_PLANE_COLLISION(faceplane,vDir,vPoint,pout,tparam, btScalar(0), tmax);
-		if(res != 1) return false;
-
-		if(!is_point_inside(pout,faceplane)) return false;
-
-		triangle_normal.setValue(faceplane[0],faceplane[1],faceplane[2]);
-
-		VEC_NORMALIZE(triangle_normal);
-
-		return true;
-	}
-
-};
-
-
-
-
-#endif // GIM_TRI_COLLISION_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp
deleted file mode 100644
index 91fcea5..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "btContinuousConvexCollision.h"
-#include "BulletCollision/CollisionShapes/btConvexShape.h"
-#include "BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h"
-#include "LinearMath/btTransformUtil.h"
-#include "BulletCollision/CollisionShapes/btSphereShape.h"
-
-#include "btGjkPairDetector.h"
-#include "btPointCollector.h"
-#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"
-
-
-
-btContinuousConvexCollision::btContinuousConvexCollision ( const btConvexShape*	convexA,const btConvexShape*	convexB,btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* penetrationDepthSolver)
-:m_simplexSolver(simplexSolver),
-m_penetrationDepthSolver(penetrationDepthSolver),
-m_convexA(convexA),m_convexB1(convexB),m_planeShape(0)
-{
-}
-
-
-btContinuousConvexCollision::btContinuousConvexCollision( const btConvexShape*	convexA,const btStaticPlaneShape*	plane)
-:m_simplexSolver(0),
-m_penetrationDepthSolver(0),
-m_convexA(convexA),m_convexB1(0),m_planeShape(plane)
-{
-}
-
-
-/// This maximum should not be necessary. It allows for untested/degenerate cases in production code.
-/// You don't want your game ever to lock-up.
-#define MAX_ITERATIONS 64
-
-void btContinuousConvexCollision::computeClosestPoints( const btTransform& transA, const btTransform& transB,btPointCollector& pointCollector)
-{
-	if (m_convexB1)
-	{
-		m_simplexSolver->reset();
-		btGjkPairDetector gjk(m_convexA,m_convexB1,m_convexA->getShapeType(),m_convexB1->getShapeType(),m_convexA->getMargin(),m_convexB1->getMargin(),m_simplexSolver,m_penetrationDepthSolver);		
-		btGjkPairDetector::ClosestPointInput input;
-		input.m_transformA = transA;
-		input.m_transformB = transB;
-		gjk.getClosestPoints(input,pointCollector,0);
-	} else
-	{
-		//convex versus plane
-		const btConvexShape* convexShape = m_convexA;
-		const btStaticPlaneShape* planeShape = m_planeShape;
-		
-		bool hasCollision = false;
-		const btVector3& planeNormal = planeShape->getPlaneNormal();
-		const btScalar& planeConstant = planeShape->getPlaneConstant();
-		
-		btTransform convexWorldTransform = transA;
-		btTransform convexInPlaneTrans;
-		convexInPlaneTrans= transB.inverse() * convexWorldTransform;
-		btTransform planeInConvex;
-		planeInConvex= convexWorldTransform.inverse() * transB;
-		
-		btVector3 vtx = convexShape->localGetSupportingVertex(planeInConvex.getBasis()*-planeNormal);
-
-		btVector3 vtxInPlane = convexInPlaneTrans(vtx);
-		btScalar distance = (planeNormal.dot(vtxInPlane) - planeConstant);
-
-		btVector3 vtxInPlaneProjected = vtxInPlane - distance*planeNormal;
-		btVector3 vtxInPlaneWorld = transB * vtxInPlaneProjected;
-		btVector3 normalOnSurfaceB = transB.getBasis() * planeNormal;
-
-		pointCollector.addContactPoint(
-			normalOnSurfaceB,
-			vtxInPlaneWorld,
-			distance);
-	}
-}
-
-bool	btContinuousConvexCollision::calcTimeOfImpact(
-				const btTransform& fromA,
-				const btTransform& toA,
-				const btTransform& fromB,
-				const btTransform& toB,
-				CastResult& result)
-{
-
-
-	/// compute linear and angular velocity for this interval, to interpolate
-	btVector3 linVelA,angVelA,linVelB,angVelB;
-	btTransformUtil::calculateVelocity(fromA,toA,btScalar(1.),linVelA,angVelA);
-	btTransformUtil::calculateVelocity(fromB,toB,btScalar(1.),linVelB,angVelB);
-
-
-	btScalar boundingRadiusA = m_convexA->getAngularMotionDisc();
-	btScalar boundingRadiusB = m_convexB1?m_convexB1->getAngularMotionDisc():0.f;
-
-	btScalar maxAngularProjectedVelocity = angVelA.length() * boundingRadiusA + angVelB.length() * boundingRadiusB;
-	btVector3 relLinVel = (linVelB-linVelA);
-
-	btScalar relLinVelocLength = (linVelB-linVelA).length();
-	
-	if ((relLinVelocLength+maxAngularProjectedVelocity) == 0.f)
-		return false;
-
-
-
-	btScalar lambda = btScalar(0.);
-	btVector3 v(1,0,0);
-
-	int maxIter = MAX_ITERATIONS;
-
-	btVector3 n;
-	n.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
-	bool hasResult = false;
-	btVector3 c;
-
-	btScalar lastLambda = lambda;
-	//btScalar epsilon = btScalar(0.001);
-
-	int numIter = 0;
-	//first solution, using GJK
-
-
-	btScalar radius = 0.001f;
-//	result.drawCoordSystem(sphereTr);
-
-	btPointCollector	pointCollector1;
-
-	{
-	
-		computeClosestPoints(fromA,fromB,pointCollector1);
-
-		hasResult = pointCollector1.m_hasResult;
-		c = pointCollector1.m_pointInWorld;
-	}
-
-	if (hasResult)
-	{
-		btScalar dist;
-		dist = pointCollector1.m_distance + result.m_allowedPenetration;
-		n = pointCollector1.m_normalOnBInWorld;
-		btScalar projectedLinearVelocity = relLinVel.dot(n);
-		if ((projectedLinearVelocity+ maxAngularProjectedVelocity)<=SIMD_EPSILON)
-			return false;
-
-		//not close enough
-		while (dist > radius)
-		{
-			if (result.m_debugDrawer)
-			{
-				result.m_debugDrawer->drawSphere(c,0.2f,btVector3(1,1,1));
-			}
-			btScalar dLambda = btScalar(0.);
-
-			projectedLinearVelocity = relLinVel.dot(n);
-
-			
-			//don't report time of impact for motion away from the contact normal (or causes minor penetration)
-			if ((projectedLinearVelocity+ maxAngularProjectedVelocity)<=SIMD_EPSILON)
-				return false;
-			
-			dLambda = dist / (projectedLinearVelocity+ maxAngularProjectedVelocity);
-
-			
-			
-			lambda = lambda + dLambda;
-
-			if (lambda > btScalar(1.))
-				return false;
-
-			if (lambda < btScalar(0.))
-				return false;
-
-
-			//todo: next check with relative epsilon
-			if (lambda <= lastLambda)
-			{
-				return false;
-				//n.setValue(0,0,0);
-				break;
-			}
-			lastLambda = lambda;
-
-			
-
-			//interpolate to next lambda
-			btTransform interpolatedTransA,interpolatedTransB,relativeTrans;
-
-			btTransformUtil::integrateTransform(fromA,linVelA,angVelA,lambda,interpolatedTransA);
-			btTransformUtil::integrateTransform(fromB,linVelB,angVelB,lambda,interpolatedTransB);
-			relativeTrans = interpolatedTransB.inverseTimes(interpolatedTransA);
-
-			if (result.m_debugDrawer)
-			{
-				result.m_debugDrawer->drawSphere(interpolatedTransA.getOrigin(),0.2f,btVector3(1,0,0));
-			}
-
-			result.DebugDraw( lambda );
-
-			btPointCollector	pointCollector;
-			computeClosestPoints(interpolatedTransA,interpolatedTransB,pointCollector);
-
-			if (pointCollector.m_hasResult)
-			{
-				dist = pointCollector.m_distance+result.m_allowedPenetration;
-				c = pointCollector.m_pointInWorld;		
-				n = pointCollector.m_normalOnBInWorld;
-			} else
-			{
-				result.reportFailure(-1, numIter);
-				return false;
-			}
-
-			numIter++;
-			if (numIter > maxIter)
-			{
-				result.reportFailure(-2, numIter);
-				return false;
-			}
-		}
-	
-		result.m_fraction = lambda;
-		result.m_normal = n;
-		result.m_hitPoint = c;
-		return true;
-	}
-
-	return false;
-
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h
deleted file mode 100644
index bdc0572..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef BT_CONTINUOUS_COLLISION_CONVEX_CAST_H
-#define BT_CONTINUOUS_COLLISION_CONVEX_CAST_H
-
-#include "btConvexCast.h"
-#include "btSimplexSolverInterface.h"
-class btConvexPenetrationDepthSolver;
-class btConvexShape;
-class btStaticPlaneShape;
-
-/// btContinuousConvexCollision implements angular and linear time of impact for convex objects.
-/// Based on Brian Mirtich's Conservative Advancement idea (PhD thesis).
-/// Algorithm operates in worldspace, in order to keep inbetween motion globally consistent.
-/// It uses GJK at the moment. Future improvement would use minkowski sum / supporting vertex, merging innerloops
-class btContinuousConvexCollision : public btConvexCast
-{
-	btSimplexSolverInterface* m_simplexSolver;
-	btConvexPenetrationDepthSolver*	m_penetrationDepthSolver;
-	const btConvexShape*	m_convexA;
-	//second object is either a convex or a plane (code sharing)
-	const btConvexShape*	m_convexB1;
-	const btStaticPlaneShape*	m_planeShape;
-
-	void computeClosestPoints( const btTransform& transA, const btTransform& transB,struct btPointCollector& pointCollector);
-
-public:
-
-	btContinuousConvexCollision (const btConvexShape*	shapeA,const btConvexShape*	shapeB ,btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver* penetrationDepthSolver);
-
-	btContinuousConvexCollision(const btConvexShape*	shapeA,const btStaticPlaneShape*	plane );
-
-	virtual bool	calcTimeOfImpact(
-				const btTransform& fromA,
-				const btTransform& toA,
-				const btTransform& fromB,
-				const btTransform& toB,
-				CastResult& result);
-
-
-};
-
-
-#endif //BT_CONTINUOUS_COLLISION_CONVEX_CAST_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexCast.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexCast.cpp
deleted file mode 100644
index d2a1310..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexCast.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btConvexCast.h"
-
-btConvexCast::~btConvexCast()
-{
-}
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexCast.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexCast.h
deleted file mode 100644
index bfd79d0..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexCast.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef BT_CONVEX_CAST_H
-#define BT_CONVEX_CAST_H
-
-#include "LinearMath/btTransform.h"
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btScalar.h"
-class btMinkowskiSumShape;
-#include "LinearMath/btIDebugDraw.h"
-
-/// btConvexCast is an interface for Casting
-class btConvexCast
-{
-public:
-
-
-	virtual ~btConvexCast();
-
-	///RayResult stores the closest result
-	/// alternatively, add a callback method to decide about closest/all results
-	struct	CastResult
-	{
-		//virtual bool	addRayResult(const btVector3& normal,btScalar	fraction) = 0;
-				
-		virtual void	DebugDraw(btScalar	fraction) {(void)fraction;}
-		virtual void	drawCoordSystem(const btTransform& trans) {(void)trans;}
-		virtual void	reportFailure(int errNo, int numIterations) {(void)errNo;(void)numIterations;}
-		CastResult()
-			:m_fraction(btScalar(BT_LARGE_FLOAT)),
-			m_debugDrawer(0),
-			m_allowedPenetration(btScalar(0))
-		{
-		}
-
-
-		virtual ~CastResult() {};
-
-		btTransform	m_hitTransformA;
-		btTransform	m_hitTransformB;
-		btVector3	m_normal;
-		btVector3   m_hitPoint;
-		btScalar	m_fraction; //input and output
-		btIDebugDraw* m_debugDrawer;
-		btScalar	m_allowedPenetration;
-
-	};
-
-
-	/// cast a convex against another convex object
-	virtual bool	calcTimeOfImpact(
-					const btTransform& fromA,
-					const btTransform& toA,
-					const btTransform& fromB,
-					const btTransform& toB,
-					CastResult& result) = 0;
-};
-
-#endif //BT_CONVEX_CAST_H
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h
deleted file mode 100644
index 72eb5ae..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef BT_CONVEX_PENETRATION_DEPTH_H
-#define BT_CONVEX_PENETRATION_DEPTH_H
-
-class btStackAlloc;
-class btVector3;
-#include "btSimplexSolverInterface.h"
-class btConvexShape;
-class btTransform;
-
-///ConvexPenetrationDepthSolver provides an interface for penetration depth calculation.
-class btConvexPenetrationDepthSolver
-{
-public:	
-	
-	virtual ~btConvexPenetrationDepthSolver() {};
-	virtual bool calcPenDepth( btSimplexSolverInterface& simplexSolver,
-		const btConvexShape* convexA,const btConvexShape* convexB,
-					const btTransform& transA,const btTransform& transB,
-				btVector3& v, btVector3& pa, btVector3& pb,
-				class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc
-				) = 0;
-
-
-};
-#endif //BT_CONVEX_PENETRATION_DEPTH_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h
deleted file mode 100644
index f958cc5..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef BT_DISCRETE_COLLISION_DETECTOR1_INTERFACE_H
-#define BT_DISCRETE_COLLISION_DETECTOR1_INTERFACE_H
-
-#include "LinearMath/btTransform.h"
-#include "LinearMath/btVector3.h"
-class btStackAlloc;
-
-/// This interface is made to be used by an iterative approach to do TimeOfImpact calculations
-/// This interface allows to query for closest points and penetration depth between two (convex) objects
-/// the closest point is on the second object (B), and the normal points from the surface on B towards A.
-/// distance is between closest points on B and closest point on A. So you can calculate closest point on A
-/// by taking closestPointInA = closestPointInB + m_distance * m_normalOnSurfaceB
-struct btDiscreteCollisionDetectorInterface
-{
-	
-	struct Result
-	{
-	
-		virtual ~Result(){}	
-
-		///setShapeIdentifiersA/B provides experimental support for per-triangle material / custom material combiner
-		virtual void setShapeIdentifiersA(int partId0,int index0)=0;
-		virtual void setShapeIdentifiersB(int partId1,int index1)=0;
-		virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)=0;
-	};
-
-	struct ClosestPointInput
-	{
-		ClosestPointInput()
-			:m_maximumDistanceSquared(btScalar(BT_LARGE_FLOAT)),
-			m_stackAlloc(0)
-		{
-		}
-
-		btTransform m_transformA;
-		btTransform m_transformB;
-		btScalar	m_maximumDistanceSquared;
-		btStackAlloc* m_stackAlloc;
-	};
-
-	virtual ~btDiscreteCollisionDetectorInterface() {};
-
-	//
-	// give either closest points (distance > 0) or penetration (distance)
-	// the normal always points from B towards A
-	//
-	virtual void	getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw,bool swapResults=false) = 0;
-
-};
-
-struct btStorageResult : public btDiscreteCollisionDetectorInterface::Result
-{
-		btVector3	m_normalOnSurfaceB;
-		btVector3	m_closestPointInB;
-		btScalar	m_distance; //negative means penetration !
-
-		btStorageResult() : m_distance(btScalar(BT_LARGE_FLOAT))
-		{
-
-		}
-		virtual ~btStorageResult() {};
-
-		virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)
-		{
-			if (depth < m_distance)
-			{
-				m_normalOnSurfaceB = normalOnBInWorld;
-				m_closestPointInB = pointInWorld;
-				m_distance = depth;
-			}
-		}
-};
-
-#endif //BT_DISCRETE_COLLISION_DETECTOR1_INTERFACE_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp
deleted file mode 100644
index bef697a..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-#include "btGjkConvexCast.h"
-#include "BulletCollision/CollisionShapes/btSphereShape.h"
-#include "btGjkPairDetector.h"
-#include "btPointCollector.h"
-#include "LinearMath/btTransformUtil.h"
-
-#ifdef BT_USE_DOUBLE_PRECISION
-#define MAX_ITERATIONS 64
-#else
-#define MAX_ITERATIONS 32
-#endif
-
-btGjkConvexCast::btGjkConvexCast(const btConvexShape* convexA,const btConvexShape* convexB,btSimplexSolverInterface* simplexSolver)
-:m_simplexSolver(simplexSolver),
-m_convexA(convexA),
-m_convexB(convexB)
-{
-}
-
-bool	btGjkConvexCast::calcTimeOfImpact(
-					const btTransform& fromA,
-					const btTransform& toA,
-					const btTransform& fromB,
-					const btTransform& toB,
-					CastResult& result)
-{
-
-
-	m_simplexSolver->reset();
-
-	/// compute linear velocity for this interval, to interpolate
-	//assume no rotation/angular velocity, assert here?
-	btVector3 linVelA,linVelB;
-	linVelA = toA.getOrigin()-fromA.getOrigin();
-	linVelB = toB.getOrigin()-fromB.getOrigin();
-
-	btScalar radius = btScalar(0.001);
-	btScalar lambda = btScalar(0.);
-	btVector3 v(1,0,0);
-
-	int maxIter = MAX_ITERATIONS;
-
-	btVector3 n;
-	n.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
-	bool hasResult = false;
-	btVector3 c;
-	btVector3 r = (linVelA-linVelB);
-
-	btScalar lastLambda = lambda;
-	//btScalar epsilon = btScalar(0.001);
-
-	int numIter = 0;
-	//first solution, using GJK
-
-
-	btTransform identityTrans;
-	identityTrans.setIdentity();
-
-
-//	result.drawCoordSystem(sphereTr);
-
-	btPointCollector	pointCollector;
-
-		
-	btGjkPairDetector gjk(m_convexA,m_convexB,m_simplexSolver,0);//m_penetrationDepthSolver);		
-	btGjkPairDetector::ClosestPointInput input;
-
-	//we don't use margins during CCD
-	//	gjk.setIgnoreMargin(true);
-
-	input.m_transformA = fromA;
-	input.m_transformB = fromB;
-	gjk.getClosestPoints(input,pointCollector,0);
-
-	hasResult = pointCollector.m_hasResult;
-	c = pointCollector.m_pointInWorld;
-
-	if (hasResult)
-	{
-		btScalar dist;
-		dist = pointCollector.m_distance;
-		n = pointCollector.m_normalOnBInWorld;
-
-	
-
-		//not close enough
-		while (dist > radius)
-		{
-			numIter++;
-			if (numIter > maxIter)
-			{
-				return false; //todo: report a failure
-			}
-			btScalar dLambda = btScalar(0.);
-
-			btScalar projectedLinearVelocity = r.dot(n);
-			
-			dLambda = dist / (projectedLinearVelocity);
-
-			lambda = lambda - dLambda;
-
-			if (lambda > btScalar(1.))
-				return false;
-
-			if (lambda < btScalar(0.))
-				return false;
-
-			//todo: next check with relative epsilon
-			if (lambda <= lastLambda)
-			{
-				return false;
-				//n.setValue(0,0,0);
-				break;
-			}
-			lastLambda = lambda;
-
-			//interpolate to next lambda
-			result.DebugDraw( lambda );
-			input.m_transformA.getOrigin().setInterpolate3(fromA.getOrigin(),toA.getOrigin(),lambda);
-			input.m_transformB.getOrigin().setInterpolate3(fromB.getOrigin(),toB.getOrigin(),lambda);
-			
-			gjk.getClosestPoints(input,pointCollector,0);
-			if (pointCollector.m_hasResult)
-			{
-				if (pointCollector.m_distance < btScalar(0.))
-				{
-					result.m_fraction = lastLambda;
-					n = pointCollector.m_normalOnBInWorld;
-					result.m_normal=n;
-					result.m_hitPoint = pointCollector.m_pointInWorld;
-					return true;
-				}
-				c = pointCollector.m_pointInWorld;		
-				n = pointCollector.m_normalOnBInWorld;
-				dist = pointCollector.m_distance;
-			} else
-			{
-				//??
-				return false;
-			}
-
-		}
-
-		//is n normalized?
-		//don't report time of impact for motion away from the contact normal (or causes minor penetration)
-		if (n.dot(r)>=-result.m_allowedPenetration)
-			return false;
-
-		result.m_fraction = lambda;
-		result.m_normal = n;
-		result.m_hitPoint = c;
-		return true;
-	}
-
-	return false;
-
-
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h
deleted file mode 100644
index 6a42ee6..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-#ifndef BT_GJK_CONVEX_CAST_H
-#define BT_GJK_CONVEX_CAST_H
-
-#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
-
-#include "LinearMath/btVector3.h"
-#include "btConvexCast.h"
-class btConvexShape;
-class btMinkowskiSumShape;
-#include "btSimplexSolverInterface.h"
-
-///GjkConvexCast performs a raycast on a convex object using support mapping.
-class btGjkConvexCast : public btConvexCast
-{
-	btSimplexSolverInterface*	m_simplexSolver;
-	const btConvexShape*	m_convexA;
-	const btConvexShape*	m_convexB;
-
-public:
-
-	btGjkConvexCast(const btConvexShape*	convexA,const btConvexShape* convexB,btSimplexSolverInterface* simplexSolver);
-
-	/// cast a convex against another convex object
-	virtual bool	calcTimeOfImpact(
-					const btTransform& fromA,
-					const btTransform& toA,
-					const btTransform& fromB,
-					const btTransform& toB,
-					CastResult& result);
-
-};
-
-#endif //BT_GJK_CONVEX_CAST_H
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp
deleted file mode 100644
index f74261d..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp
+++ /dev/null
@@ -1,989 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2008 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the
-use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it
-freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not
-claim that you wrote the original software. If you use this software in a
-product, an acknowledgment in the product documentation would be appreciated
-but is not required.
-2. Altered source versions must be plainly marked as such, and must not be
-misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
-GJK-EPA collision solver by Nathanael Presson, 2008
-*/
-#include "BulletCollision/CollisionShapes/btConvexInternalShape.h"
-#include "BulletCollision/CollisionShapes/btSphereShape.h"
-#include "btGjkEpa2.h"
-
-#if defined(DEBUG) || defined (_DEBUG)
-#include <stdio.h> //for debug printf
-#ifdef __SPU__
-#include <spu_printf.h>
-#define printf spu_printf
-#endif //__SPU__
-#endif
-
-namespace gjkepa2_impl
-{
-
-	// Config
-
-	/* GJK	*/ 
-#define GJK_MAX_ITERATIONS	128
-#define GJK_ACCURARY		((btScalar)0.0001)
-#define GJK_MIN_DISTANCE	((btScalar)0.0001)
-#define GJK_DUPLICATED_EPS	((btScalar)0.0001)
-#define GJK_SIMPLEX2_EPS	((btScalar)0.0)
-#define GJK_SIMPLEX3_EPS	((btScalar)0.0)
-#define GJK_SIMPLEX4_EPS	((btScalar)0.0)
-
-	/* EPA	*/ 
-#define EPA_MAX_VERTICES	64
-#define EPA_MAX_FACES		(EPA_MAX_VERTICES*2)
-#define EPA_MAX_ITERATIONS	255
-#define EPA_ACCURACY		((btScalar)0.0001)
-#define EPA_FALLBACK		(10*EPA_ACCURACY)
-#define EPA_PLANE_EPS		((btScalar)0.00001)
-#define EPA_INSIDE_EPS		((btScalar)0.01)
-
-
-	// Shorthands
-	typedef unsigned int	U;
-	typedef unsigned char	U1;
-
-	// MinkowskiDiff
-	struct	MinkowskiDiff
-	{
-		const btConvexShape*	m_shapes[2];
-		btMatrix3x3				m_toshape1;
-		btTransform				m_toshape0;
-#ifdef __SPU__
-		bool					m_enableMargin;
-#else
-		btVector3				(btConvexShape::*Ls)(const btVector3&) const;
-#endif//__SPU__
-		
-
-		MinkowskiDiff()
-		{
-
-		}
-#ifdef __SPU__
-			void					EnableMargin(bool enable)
-		{
-			m_enableMargin = enable;
-		}	
-		inline btVector3		Support0(const btVector3& d) const
-		{
-			if (m_enableMargin)
-			{
-				return m_shapes[0]->localGetSupportVertexNonVirtual(d);
-			} else
-			{
-				return m_shapes[0]->localGetSupportVertexWithoutMarginNonVirtual(d);
-			}
-		}
-		inline btVector3		Support1(const btVector3& d) const
-		{
-			if (m_enableMargin)
-			{
-				return m_toshape0*(m_shapes[1]->localGetSupportVertexNonVirtual(m_toshape1*d));
-			} else
-			{
-				return m_toshape0*(m_shapes[1]->localGetSupportVertexWithoutMarginNonVirtual(m_toshape1*d));
-			}
-		}
-#else
-		void					EnableMargin(bool enable)
-		{
-			if(enable)
-				Ls=&btConvexShape::localGetSupportVertexNonVirtual;
-			else
-				Ls=&btConvexShape::localGetSupportVertexWithoutMarginNonVirtual;
-		}	
-		inline btVector3		Support0(const btVector3& d) const
-		{
-			return(((m_shapes[0])->*(Ls))(d));
-		}
-		inline btVector3		Support1(const btVector3& d) const
-		{
-			return(m_toshape0*((m_shapes[1])->*(Ls))(m_toshape1*d));
-		}
-#endif //__SPU__
-
-		inline btVector3		Support(const btVector3& d) const
-		{
-			return(Support0(d)-Support1(-d));
-		}
-		btVector3				Support(const btVector3& d,U index) const
-		{
-			if(index)
-				return(Support1(d));
-			else
-				return(Support0(d));
-		}
-	};
-
-	typedef	MinkowskiDiff	tShape;
-
-
-	// GJK
-	struct	GJK
-	{
-		/* Types		*/ 
-		struct	sSV
-		{
-			btVector3	d,w;
-		};
-		struct	sSimplex
-		{
-			sSV*		c[4];
-			btScalar	p[4];
-			U			rank;
-		};
-		struct	eStatus	{ enum _ {
-			Valid,
-			Inside,
-			Failed		};};
-			/* Fields		*/ 
-			tShape			m_shape;
-			btVector3		m_ray;
-			btScalar		m_distance;
-			sSimplex		m_simplices[2];
-			sSV				m_store[4];
-			sSV*			m_free[4];
-			U				m_nfree;
-			U				m_current;
-			sSimplex*		m_simplex;
-			eStatus::_		m_status;
-			/* Methods		*/ 
-			GJK()
-			{
-				Initialize();
-			}
-			void				Initialize()
-			{
-				m_ray		=	btVector3(0,0,0);
-				m_nfree		=	0;
-				m_status	=	eStatus::Failed;
-				m_current	=	0;
-				m_distance	=	0;
-			}
-			eStatus::_			Evaluate(const tShape& shapearg,const btVector3& guess)
-			{
-				U			iterations=0;
-				btScalar	sqdist=0;
-				btScalar	alpha=0;
-				btVector3	lastw[4];
-				U			clastw=0;
-				/* Initialize solver		*/ 
-				m_free[0]			=	&m_store[0];
-				m_free[1]			=	&m_store[1];
-				m_free[2]			=	&m_store[2];
-				m_free[3]			=	&m_store[3];
-				m_nfree				=	4;
-				m_current			=	0;
-				m_status			=	eStatus::Valid;
-				m_shape				=	shapearg;
-				m_distance			=	0;
-				/* Initialize simplex		*/ 
-				m_simplices[0].rank	=	0;
-				m_ray				=	guess;
-				const btScalar	sqrl=	m_ray.length2();
-				appendvertice(m_simplices[0],sqrl>0?-m_ray:btVector3(1,0,0));
-				m_simplices[0].p[0]	=	1;
-				m_ray				=	m_simplices[0].c[0]->w;	
-				sqdist				=	sqrl;
-				lastw[0]			=
-					lastw[1]			=
-					lastw[2]			=
-					lastw[3]			=	m_ray;
-				/* Loop						*/ 
-				do	{
-					const U		next=1-m_current;
-					sSimplex&	cs=m_simplices[m_current];
-					sSimplex&	ns=m_simplices[next];
-					/* Check zero							*/ 
-					const btScalar	rl=m_ray.length();
-					if(rl<GJK_MIN_DISTANCE)
-					{/* Touching or inside				*/ 
-						m_status=eStatus::Inside;
-						break;
-					}
-					/* Append new vertice in -'v' direction	*/ 
-					appendvertice(cs,-m_ray);
-					const btVector3&	w=cs.c[cs.rank-1]->w;
-					bool				found=false;
-					for(U i=0;i<4;++i)
-					{
-						if((w-lastw[i]).length2()<GJK_DUPLICATED_EPS)
-						{ found=true;break; }
-					}
-					if(found)
-					{/* Return old simplex				*/ 
-						removevertice(m_simplices[m_current]);
-						break;
-					}
-					else
-					{/* Update lastw					*/ 
-						lastw[clastw=(clastw+1)&3]=w;
-					}
-					/* Check for termination				*/ 
-					const btScalar	omega=btDot(m_ray,w)/rl;
-					alpha=btMax(omega,alpha);
-					if(((rl-alpha)-(GJK_ACCURARY*rl))<=0)
-					{/* Return old simplex				*/ 
-						removevertice(m_simplices[m_current]);
-						break;
-					}		
-					/* Reduce simplex						*/ 
-					btScalar	weights[4];
-					U			mask=0;
-					switch(cs.rank)
-					{
-					case	2:	sqdist=projectorigin(	cs.c[0]->w,
-									cs.c[1]->w,
-									weights,mask);break;
-					case	3:	sqdist=projectorigin(	cs.c[0]->w,
-									cs.c[1]->w,
-									cs.c[2]->w,
-									weights,mask);break;
-					case	4:	sqdist=projectorigin(	cs.c[0]->w,
-									cs.c[1]->w,
-									cs.c[2]->w,
-									cs.c[3]->w,
-									weights,mask);break;
-					}
-					if(sqdist>=0)
-					{/* Valid	*/ 
-						ns.rank		=	0;
-						m_ray		=	btVector3(0,0,0);
-						m_current	=	next;
-						for(U i=0,ni=cs.rank;i<ni;++i)
-						{
-							if(mask&(1<<i))
-							{
-								ns.c[ns.rank]		=	cs.c[i];
-								ns.p[ns.rank++]		=	weights[i];
-								m_ray				+=	cs.c[i]->w*weights[i];
-							}
-							else
-							{
-								m_free[m_nfree++]	=	cs.c[i];
-							}
-						}
-						if(mask==15) m_status=eStatus::Inside;
-					}
-					else
-					{/* Return old simplex				*/ 
-						removevertice(m_simplices[m_current]);
-						break;
-					}
-					m_status=((++iterations)<GJK_MAX_ITERATIONS)?m_status:eStatus::Failed;
-				} while(m_status==eStatus::Valid);
-				m_simplex=&m_simplices[m_current];
-				switch(m_status)
-				{
-				case	eStatus::Valid:		m_distance=m_ray.length();break;
-				case	eStatus::Inside:	m_distance=0;break;
-				default:
-					{
-					}
-				}	
-				return(m_status);
-			}
-			bool					EncloseOrigin()
-			{
-				switch(m_simplex->rank)
-				{
-				case	1:
-					{
-						for(U i=0;i<3;++i)
-						{
-							btVector3		axis=btVector3(0,0,0);
-							axis[i]=1;
-							appendvertice(*m_simplex, axis);
-							if(EncloseOrigin())	return(true);
-							removevertice(*m_simplex);
-							appendvertice(*m_simplex,-axis);
-							if(EncloseOrigin())	return(true);
-							removevertice(*m_simplex);
-						}
-					}
-					break;
-				case	2:
-					{
-						const btVector3	d=m_simplex->c[1]->w-m_simplex->c[0]->w;
-						for(U i=0;i<3;++i)
-						{
-							btVector3		axis=btVector3(0,0,0);
-							axis[i]=1;
-							const btVector3	p=btCross(d,axis);
-							if(p.length2()>0)
-							{
-								appendvertice(*m_simplex, p);
-								if(EncloseOrigin())	return(true);
-								removevertice(*m_simplex);
-								appendvertice(*m_simplex,-p);
-								if(EncloseOrigin())	return(true);
-								removevertice(*m_simplex);
-							}
-						}
-					}
-					break;
-				case	3:
-					{
-						const btVector3	n=btCross(m_simplex->c[1]->w-m_simplex->c[0]->w,
-							m_simplex->c[2]->w-m_simplex->c[0]->w);
-						if(n.length2()>0)
-						{
-							appendvertice(*m_simplex,n);
-							if(EncloseOrigin())	return(true);
-							removevertice(*m_simplex);
-							appendvertice(*m_simplex,-n);
-							if(EncloseOrigin())	return(true);
-							removevertice(*m_simplex);
-						}
-					}
-					break;
-				case	4:
-					{
-						if(btFabs(det(	m_simplex->c[0]->w-m_simplex->c[3]->w,
-							m_simplex->c[1]->w-m_simplex->c[3]->w,
-							m_simplex->c[2]->w-m_simplex->c[3]->w))>0)
-							return(true);
-					}
-					break;
-				}
-				return(false);
-			}
-			/* Internals	*/ 
-			void				getsupport(const btVector3& d,sSV& sv) const
-			{
-				sv.d	=	d/d.length();
-				sv.w	=	m_shape.Support(sv.d);
-			}
-			void				removevertice(sSimplex& simplex)
-			{
-				m_free[m_nfree++]=simplex.c[--simplex.rank];
-			}
-			void				appendvertice(sSimplex& simplex,const btVector3& v)
-			{
-				simplex.p[simplex.rank]=0;
-				simplex.c[simplex.rank]=m_free[--m_nfree];
-				getsupport(v,*simplex.c[simplex.rank++]);
-			}
-			static btScalar		det(const btVector3& a,const btVector3& b,const btVector3& c)
-			{
-				return(	a.y()*b.z()*c.x()+a.z()*b.x()*c.y()-
-					a.x()*b.z()*c.y()-a.y()*b.x()*c.z()+
-					a.x()*b.y()*c.z()-a.z()*b.y()*c.x());
-			}
-			static btScalar		projectorigin(	const btVector3& a,
-				const btVector3& b,
-				btScalar* w,U& m)
-			{
-				const btVector3	d=b-a;
-				const btScalar	l=d.length2();
-				if(l>GJK_SIMPLEX2_EPS)
-				{
-					const btScalar	t(l>0?-btDot(a,d)/l:0);
-					if(t>=1)		{ w[0]=0;w[1]=1;m=2;return(b.length2()); }
-					else if(t<=0)	{ w[0]=1;w[1]=0;m=1;return(a.length2()); }
-					else			{ w[0]=1-(w[1]=t);m=3;return((a+d*t).length2()); }
-				}
-				return(-1);
-			}
-			static btScalar		projectorigin(	const btVector3& a,
-				const btVector3& b,
-				const btVector3& c,
-				btScalar* w,U& m)
-			{
-				static const U		imd3[]={1,2,0};
-				const btVector3*	vt[]={&a,&b,&c};
-				const btVector3		dl[]={a-b,b-c,c-a};
-				const btVector3		n=btCross(dl[0],dl[1]);
-				const btScalar		l=n.length2();
-				if(l>GJK_SIMPLEX3_EPS)
-				{
-					btScalar	mindist=-1;
-					btScalar	subw[2]={0.f,0.f};
-					U			subm(0);
-					for(U i=0;i<3;++i)
-					{
-						if(btDot(*vt[i],btCross(dl[i],n))>0)
-						{
-							const U			j=imd3[i];
-							const btScalar	subd(projectorigin(*vt[i],*vt[j],subw,subm));
-							if((mindist<0)||(subd<mindist))
-							{
-								mindist		=	subd;
-								m			=	static_cast<U>(((subm&1)?1<<i:0)+((subm&2)?1<<j:0));
-								w[i]		=	subw[0];
-								w[j]		=	subw[1];
-								w[imd3[j]]	=	0;				
-							}
-						}
-					}
-					if(mindist<0)
-					{
-						const btScalar	d=btDot(a,n);	
-						const btScalar	s=btSqrt(l);
-						const btVector3	p=n*(d/l);
-						mindist	=	p.length2();
-						m		=	7;
-						w[0]	=	(btCross(dl[1],b-p)).length()/s;
-						w[1]	=	(btCross(dl[2],c-p)).length()/s;
-						w[2]	=	1-(w[0]+w[1]);
-					}
-					return(mindist);
-				}
-				return(-1);
-			}
-			static btScalar		projectorigin(	const btVector3& a,
-				const btVector3& b,
-				const btVector3& c,
-				const btVector3& d,
-				btScalar* w,U& m)
-			{
-				static const U		imd3[]={1,2,0};
-				const btVector3*	vt[]={&a,&b,&c,&d};
-				const btVector3		dl[]={a-d,b-d,c-d};
-				const btScalar		vl=det(dl[0],dl[1],dl[2]);
-				const bool			ng=(vl*btDot(a,btCross(b-c,a-b)))<=0;
-				if(ng&&(btFabs(vl)>GJK_SIMPLEX4_EPS))
-				{
-					btScalar	mindist=-1;
-					btScalar	subw[3]={0.f,0.f,0.f};
-					U			subm(0);
-					for(U i=0;i<3;++i)
-					{
-						const U			j=imd3[i];
-						const btScalar	s=vl*btDot(d,btCross(dl[i],dl[j]));
-						if(s>0)
-						{
-							const btScalar	subd=projectorigin(*vt[i],*vt[j],d,subw,subm);
-							if((mindist<0)||(subd<mindist))
-							{
-								mindist		=	subd;
-								m			=	static_cast<U>((subm&1?1<<i:0)+
-									(subm&2?1<<j:0)+
-									(subm&4?8:0));
-								w[i]		=	subw[0];
-								w[j]		=	subw[1];
-								w[imd3[j]]	=	0;
-								w[3]		=	subw[2];
-							}
-						}
-					}
-					if(mindist<0)
-					{
-						mindist	=	0;
-						m		=	15;
-						w[0]	=	det(c,b,d)/vl;
-						w[1]	=	det(a,c,d)/vl;
-						w[2]	=	det(b,a,d)/vl;
-						w[3]	=	1-(w[0]+w[1]+w[2]);
-					}
-					return(mindist);
-				}
-				return(-1);
-			}
-	};
-
-	// EPA
-	struct	EPA
-	{
-		/* Types		*/ 
-		typedef	GJK::sSV	sSV;
-		struct	sFace
-		{
-			btVector3	n;
-			btScalar	d;
-			btScalar	p;
-			sSV*		c[3];
-			sFace*		f[3];
-			sFace*		l[2];
-			U1			e[3];
-			U1			pass;
-		};
-		struct	sList
-		{
-			sFace*		root;
-			U			count;
-			sList() : root(0),count(0)	{}
-		};
-		struct	sHorizon
-		{
-			sFace*		cf;
-			sFace*		ff;
-			U			nf;
-			sHorizon() : cf(0),ff(0),nf(0)	{}
-		};
-		struct	eStatus { enum _ {
-			Valid,
-			Touching,
-			Degenerated,
-			NonConvex,
-			InvalidHull,		
-			OutOfFaces,
-			OutOfVertices,
-			AccuraryReached,
-			FallBack,
-			Failed		};};
-			/* Fields		*/ 
-			eStatus::_		m_status;
-			GJK::sSimplex	m_result;
-			btVector3		m_normal;
-			btScalar		m_depth;
-			sSV				m_sv_store[EPA_MAX_VERTICES];
-			sFace			m_fc_store[EPA_MAX_FACES];
-			U				m_nextsv;
-			sList			m_hull;
-			sList			m_stock;
-			/* Methods		*/ 
-			EPA()
-			{
-				Initialize();	
-			}
-
-
-			static inline void		bind(sFace* fa,U ea,sFace* fb,U eb)
-			{
-				fa->e[ea]=(U1)eb;fa->f[ea]=fb;
-				fb->e[eb]=(U1)ea;fb->f[eb]=fa;
-			}
-			static inline void		append(sList& list,sFace* face)
-			{
-				face->l[0]	=	0;
-				face->l[1]	=	list.root;
-				if(list.root) list.root->l[0]=face;
-				list.root	=	face;
-				++list.count;
-			}
-			static inline void		remove(sList& list,sFace* face)
-			{
-				if(face->l[1]) face->l[1]->l[0]=face->l[0];
-				if(face->l[0]) face->l[0]->l[1]=face->l[1];
-				if(face==list.root) list.root=face->l[1];
-				--list.count;
-			}
-
-
-			void				Initialize()
-			{
-				m_status	=	eStatus::Failed;
-				m_normal	=	btVector3(0,0,0);
-				m_depth		=	0;
-				m_nextsv	=	0;
-				for(U i=0;i<EPA_MAX_FACES;++i)
-				{
-					append(m_stock,&m_fc_store[EPA_MAX_FACES-i-1]);
-				}
-			}
-			eStatus::_			Evaluate(GJK& gjk,const btVector3& guess)
-			{
-				GJK::sSimplex&	simplex=*gjk.m_simplex;
-				if((simplex.rank>1)&&gjk.EncloseOrigin())
-				{
-
-					/* Clean up				*/ 
-					while(m_hull.root)
-					{
-						sFace*	f = m_hull.root;
-						remove(m_hull,f);
-						append(m_stock,f);
-					}
-					m_status	=	eStatus::Valid;
-					m_nextsv	=	0;
-					/* Orient simplex		*/ 
-					if(gjk.det(	simplex.c[0]->w-simplex.c[3]->w,
-						simplex.c[1]->w-simplex.c[3]->w,
-						simplex.c[2]->w-simplex.c[3]->w)<0)
-					{
-						btSwap(simplex.c[0],simplex.c[1]);
-						btSwap(simplex.p[0],simplex.p[1]);
-					}
-					/* Build initial hull	*/ 
-					sFace*	tetra[]={newface(simplex.c[0],simplex.c[1],simplex.c[2],true),
-						newface(simplex.c[1],simplex.c[0],simplex.c[3],true),
-						newface(simplex.c[2],simplex.c[1],simplex.c[3],true),
-						newface(simplex.c[0],simplex.c[2],simplex.c[3],true)};
-					if(m_hull.count==4)
-					{
-						sFace*		best=findbest();
-						sFace		outer=*best;
-						U			pass=0;
-						U			iterations=0;
-						bind(tetra[0],0,tetra[1],0);
-						bind(tetra[0],1,tetra[2],0);
-						bind(tetra[0],2,tetra[3],0);
-						bind(tetra[1],1,tetra[3],2);
-						bind(tetra[1],2,tetra[2],1);
-						bind(tetra[2],2,tetra[3],1);
-						m_status=eStatus::Valid;
-						for(;iterations<EPA_MAX_ITERATIONS;++iterations)
-						{
-							if(m_nextsv<EPA_MAX_VERTICES)
-							{	
-								sHorizon		horizon;
-								sSV*			w=&m_sv_store[m_nextsv++];
-								bool			valid=true;					
-								best->pass	=	(U1)(++pass);
-								gjk.getsupport(best->n,*w);
-								const btScalar	wdist=btDot(best->n,w->w)-best->d;
-								if(wdist>EPA_ACCURACY)
-								{
-									for(U j=0;(j<3)&&valid;++j)
-									{
-										valid&=expand(	pass,w,
-											best->f[j],best->e[j],
-											horizon);
-									}
-									if(valid&&(horizon.nf>=3))
-									{
-										bind(horizon.cf,1,horizon.ff,2);
-										remove(m_hull,best);
-										append(m_stock,best);
-										best=findbest();
-										if(best->p>=outer.p) outer=*best;
-									} else { m_status=eStatus::InvalidHull;break; }
-								} else { m_status=eStatus::AccuraryReached;break; }
-							} else { m_status=eStatus::OutOfVertices;break; }
-						}
-						const btVector3	projection=outer.n*outer.d;
-						m_normal	=	outer.n;
-						m_depth		=	outer.d;
-						m_result.rank	=	3;
-						m_result.c[0]	=	outer.c[0];
-						m_result.c[1]	=	outer.c[1];
-						m_result.c[2]	=	outer.c[2];
-						m_result.p[0]	=	btCross(	outer.c[1]->w-projection,
-							outer.c[2]->w-projection).length();
-						m_result.p[1]	=	btCross(	outer.c[2]->w-projection,
-							outer.c[0]->w-projection).length();
-						m_result.p[2]	=	btCross(	outer.c[0]->w-projection,
-							outer.c[1]->w-projection).length();
-						const btScalar	sum=m_result.p[0]+m_result.p[1]+m_result.p[2];
-						m_result.p[0]	/=	sum;
-						m_result.p[1]	/=	sum;
-						m_result.p[2]	/=	sum;
-						return(m_status);
-					}
-				}
-				/* Fallback		*/ 
-				m_status	=	eStatus::FallBack;
-				m_normal	=	-guess;
-				const btScalar	nl=m_normal.length();
-				if(nl>0)
-					m_normal	=	m_normal/nl;
-				else
-					m_normal	=	btVector3(1,0,0);
-				m_depth	=	0;
-				m_result.rank=1;
-				m_result.c[0]=simplex.c[0];
-				m_result.p[0]=1;	
-				return(m_status);
-			}
-			sFace*				newface(sSV* a,sSV* b,sSV* c,bool forced)
-			{
-				if(m_stock.root)
-				{
-					sFace*	face=m_stock.root;
-					remove(m_stock,face);
-					append(m_hull,face);
-					face->pass	=	0;
-					face->c[0]	=	a;
-					face->c[1]	=	b;
-					face->c[2]	=	c;
-					face->n		=	btCross(b->w-a->w,c->w-a->w);
-					const btScalar	l=face->n.length();
-					const bool		v=l>EPA_ACCURACY;
-					face->p		=	btMin(btMin(
-						btDot(a->w,btCross(face->n,a->w-b->w)),
-						btDot(b->w,btCross(face->n,b->w-c->w))),
-						btDot(c->w,btCross(face->n,c->w-a->w)))	/
-						(v?l:1);
-					face->p		=	face->p>=-EPA_INSIDE_EPS?0:face->p;
-					if(v)
-					{
-						face->d		=	btDot(a->w,face->n)/l;
-						face->n		/=	l;
-						if(forced||(face->d>=-EPA_PLANE_EPS))
-						{
-							return(face);
-						} else m_status=eStatus::NonConvex;
-					} else m_status=eStatus::Degenerated;
-					remove(m_hull,face);
-					append(m_stock,face);
-					return(0);
-				}
-				m_status=m_stock.root?eStatus::OutOfVertices:eStatus::OutOfFaces;
-				return(0);
-			}
-			sFace*				findbest()
-			{
-				sFace*		minf=m_hull.root;
-				btScalar	mind=minf->d*minf->d;
-				btScalar	maxp=minf->p;
-				for(sFace* f=minf->l[1];f;f=f->l[1])
-				{
-					const btScalar	sqd=f->d*f->d;
-					if((f->p>=maxp)&&(sqd<mind))
-					{
-						minf=f;
-						mind=sqd;
-						maxp=f->p;
-					}
-				}
-				return(minf);
-			}
-			bool				expand(U pass,sSV* w,sFace* f,U e,sHorizon& horizon)
-			{
-				static const U	i1m3[]={1,2,0};
-				static const U	i2m3[]={2,0,1};
-				if(f->pass!=pass)
-				{
-					const U	e1=i1m3[e];
-					if((btDot(f->n,w->w)-f->d)<-EPA_PLANE_EPS)
-					{
-						sFace*	nf=newface(f->c[e1],f->c[e],w,false);
-						if(nf)
-						{
-							bind(nf,0,f,e);
-							if(horizon.cf) bind(horizon.cf,1,nf,2); else horizon.ff=nf;
-							horizon.cf=nf;
-							++horizon.nf;
-							return(true);
-						}
-					}
-					else
-					{
-						const U	e2=i2m3[e];
-						f->pass		=	(U1)pass;
-						if(	expand(pass,w,f->f[e1],f->e[e1],horizon)&&
-							expand(pass,w,f->f[e2],f->e[e2],horizon))
-						{
-							remove(m_hull,f);
-							append(m_stock,f);
-							return(true);
-						}
-					}
-				}
-				return(false);
-			}
-
-	};
-
-	//
-	static void	Initialize(	const btConvexShape* shape0,const btTransform& wtrs0,
-		const btConvexShape* shape1,const btTransform& wtrs1,
-		btGjkEpaSolver2::sResults& results,
-		tShape& shape,
-		bool withmargins)
-	{
-		/* Results		*/ 
-		results.witnesses[0]	=
-			results.witnesses[1]	=	btVector3(0,0,0);
-		results.status			=	btGjkEpaSolver2::sResults::Separated;
-		/* Shape		*/ 
-		shape.m_shapes[0]		=	shape0;
-		shape.m_shapes[1]		=	shape1;
-		shape.m_toshape1		=	wtrs1.getBasis().transposeTimes(wtrs0.getBasis());
-		shape.m_toshape0		=	wtrs0.inverseTimes(wtrs1);
-		shape.EnableMargin(withmargins);
-	}
-
-}
-
-//
-// Api
-//
-
-using namespace	gjkepa2_impl;
-
-//
-int			btGjkEpaSolver2::StackSizeRequirement()
-{
-	return(sizeof(GJK)+sizeof(EPA));
-}
-
-//
-bool		btGjkEpaSolver2::Distance(	const btConvexShape*	shape0,
-									  const btTransform&		wtrs0,
-									  const btConvexShape*	shape1,
-									  const btTransform&		wtrs1,
-									  const btVector3&		guess,
-									  sResults&				results)
-{
-	tShape			shape;
-	Initialize(shape0,wtrs0,shape1,wtrs1,results,shape,false);
-	GJK				gjk;
-	GJK::eStatus::_	gjk_status=gjk.Evaluate(shape,guess);
-	if(gjk_status==GJK::eStatus::Valid)
-	{
-		btVector3	w0=btVector3(0,0,0);
-		btVector3	w1=btVector3(0,0,0);
-		for(U i=0;i<gjk.m_simplex->rank;++i)
-		{
-			const btScalar	p=gjk.m_simplex->p[i];
-			w0+=shape.Support( gjk.m_simplex->c[i]->d,0)*p;
-			w1+=shape.Support(-gjk.m_simplex->c[i]->d,1)*p;
-		}
-		results.witnesses[0]	=	wtrs0*w0;
-		results.witnesses[1]	=	wtrs0*w1;
-		results.normal			=	w0-w1;
-		results.distance		=	results.normal.length();
-		results.normal			/=	results.distance>GJK_MIN_DISTANCE?results.distance:1;
-		return(true);
-	}
-	else
-	{
-		results.status	=	gjk_status==GJK::eStatus::Inside?
-			sResults::Penetrating	:
-		sResults::GJK_Failed	;
-		return(false);
-	}
-}
-
-//
-bool	btGjkEpaSolver2::Penetration(	const btConvexShape*	shape0,
-									 const btTransform&		wtrs0,
-									 const btConvexShape*	shape1,
-									 const btTransform&		wtrs1,
-									 const btVector3&		guess,
-									 sResults&				results,
-									 bool					usemargins)
-{
-	tShape			shape;
-	Initialize(shape0,wtrs0,shape1,wtrs1,results,shape,usemargins);
-	GJK				gjk;	
-	GJK::eStatus::_	gjk_status=gjk.Evaluate(shape,-guess);
-	switch(gjk_status)
-	{
-	case	GJK::eStatus::Inside:
-		{
-			EPA				epa;
-			EPA::eStatus::_	epa_status=epa.Evaluate(gjk,-guess);
-			if(epa_status!=EPA::eStatus::Failed)
-			{
-				btVector3	w0=btVector3(0,0,0);
-				for(U i=0;i<epa.m_result.rank;++i)
-				{
-					w0+=shape.Support(epa.m_result.c[i]->d,0)*epa.m_result.p[i];
-				}
-				results.status			=	sResults::Penetrating;
-				results.witnesses[0]	=	wtrs0*w0;
-				results.witnesses[1]	=	wtrs0*(w0-epa.m_normal*epa.m_depth);
-				results.normal			=	-epa.m_normal;
-				results.distance		=	-epa.m_depth;
-				return(true);
-			} else results.status=sResults::EPA_Failed;
-		}
-		break;
-	case	GJK::eStatus::Failed:
-		results.status=sResults::GJK_Failed;
-		break;
-		default:
-					{
-					}
-	}
-	return(false);
-}
-
-#ifndef __SPU__
-//
-btScalar	btGjkEpaSolver2::SignedDistance(const btVector3& position,
-											btScalar margin,
-											const btConvexShape* shape0,
-											const btTransform& wtrs0,
-											sResults& results)
-{
-	tShape			shape;
-	btSphereShape	shape1(margin);
-	btTransform		wtrs1(btQuaternion(0,0,0,1),position);
-	Initialize(shape0,wtrs0,&shape1,wtrs1,results,shape,false);
-	GJK				gjk;	
-	GJK::eStatus::_	gjk_status=gjk.Evaluate(shape,btVector3(1,1,1));
-	if(gjk_status==GJK::eStatus::Valid)
-	{
-		btVector3	w0=btVector3(0,0,0);
-		btVector3	w1=btVector3(0,0,0);
-		for(U i=0;i<gjk.m_simplex->rank;++i)
-		{
-			const btScalar	p=gjk.m_simplex->p[i];
-			w0+=shape.Support( gjk.m_simplex->c[i]->d,0)*p;
-			w1+=shape.Support(-gjk.m_simplex->c[i]->d,1)*p;
-		}
-		results.witnesses[0]	=	wtrs0*w0;
-		results.witnesses[1]	=	wtrs0*w1;
-		const btVector3	delta=	results.witnesses[1]-
-			results.witnesses[0];
-		const btScalar	margin=	shape0->getMarginNonVirtual()+
-			shape1.getMarginNonVirtual();
-		const btScalar	length=	delta.length();	
-		results.normal			=	delta/length;
-		results.witnesses[0]	+=	results.normal*margin;
-		return(length-margin);
-	}
-	else
-	{
-		if(gjk_status==GJK::eStatus::Inside)
-		{
-			if(Penetration(shape0,wtrs0,&shape1,wtrs1,gjk.m_ray,results))
-			{
-				const btVector3	delta=	results.witnesses[0]-
-					results.witnesses[1];
-				const btScalar	length=	delta.length();
-				if (length >= SIMD_EPSILON)
-					results.normal	=	delta/length;			
-				return(-length);
-			}
-		}	
-	}
-	return(SIMD_INFINITY);
-}
-
-//
-bool	btGjkEpaSolver2::SignedDistance(const btConvexShape*	shape0,
-										const btTransform&		wtrs0,
-										const btConvexShape*	shape1,
-										const btTransform&		wtrs1,
-										const btVector3&		guess,
-										sResults&				results)
-{
-	if(!Distance(shape0,wtrs0,shape1,wtrs1,guess,results))
-		return(Penetration(shape0,wtrs0,shape1,wtrs1,guess,results,false));
-	else
-		return(true);
-}
-#endif //__SPU__
-
-/* Symbols cleanup		*/ 
-
-#undef GJK_MAX_ITERATIONS
-#undef GJK_ACCURARY
-#undef GJK_MIN_DISTANCE
-#undef GJK_DUPLICATED_EPS
-#undef GJK_SIMPLEX2_EPS
-#undef GJK_SIMPLEX3_EPS
-#undef GJK_SIMPLEX4_EPS
-
-#undef EPA_MAX_VERTICES
-#undef EPA_MAX_FACES
-#undef EPA_MAX_ITERATIONS
-#undef EPA_ACCURACY
-#undef EPA_FALLBACK
-#undef EPA_PLANE_EPS
-#undef EPA_INSIDE_EPS
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.h
deleted file mode 100644
index ac501d5..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2008 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the
-use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it
-freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not
-claim that you wrote the original software. If you use this software in a
-product, an acknowledgment in the product documentation would be appreciated
-but is not required.
-2. Altered source versions must be plainly marked as such, and must not be
-misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
-GJK-EPA collision solver by Nathanael Presson, 2008
-*/
-#ifndef BT_GJK_EPA2_H
-#define BT_GJK_EPA2_H
-
-#include "BulletCollision/CollisionShapes/btConvexShape.h"
-
-///btGjkEpaSolver contributed under zlib by Nathanael Presson
-struct	btGjkEpaSolver2
-{
-struct	sResults
-	{
-	enum eStatus
-		{
-		Separated,		/* Shapes doesnt penetrate												*/ 
-		Penetrating,	/* Shapes are penetrating												*/ 
-		GJK_Failed,		/* GJK phase fail, no big issue, shapes are probably just 'touching'	*/ 
-		EPA_Failed		/* EPA phase fail, bigger problem, need to save parameters, and debug	*/ 
-		}		status;
-	btVector3	witnesses[2];
-	btVector3	normal;
-	btScalar	distance;
-	};
-
-static int		StackSizeRequirement();
-
-static bool		Distance(	const btConvexShape* shape0,const btTransform& wtrs0,
-							const btConvexShape* shape1,const btTransform& wtrs1,
-							const btVector3& guess,
-							sResults& results);
-
-static bool		Penetration(const btConvexShape* shape0,const btTransform& wtrs0,
-							const btConvexShape* shape1,const btTransform& wtrs1,
-							const btVector3& guess,
-							sResults& results,
-							bool usemargins=true);
-#ifndef __SPU__
-static btScalar	SignedDistance(	const btVector3& position,
-								btScalar margin,
-								const btConvexShape* shape,
-								const btTransform& wtrs,
-								sResults& results);
-							
-static bool		SignedDistance(	const btConvexShape* shape0,const btTransform& wtrs0,
-								const btConvexShape* shape1,const btTransform& wtrs1,
-								const btVector3& guess,
-								sResults& results);
-#endif //__SPU__
-
-};
-
-#endif //BT_GJK_EPA2_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp
deleted file mode 100644
index c6dc3f3..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-EPA Copyright (c) Ricardo Padrela 2006
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "BulletCollision/CollisionShapes/btConvexShape.h"
-#include "btGjkEpaPenetrationDepthSolver.h"
-
-
-#include "BulletCollision/NarrowPhaseCollision/btGjkEpa2.h"
-
-bool btGjkEpaPenetrationDepthSolver::calcPenDepth( btSimplexSolverInterface& simplexSolver,
-											  const btConvexShape* pConvexA, const btConvexShape* pConvexB,
-											  const btTransform& transformA, const btTransform& transformB,
-											  btVector3& v, btVector3& wWitnessOnA, btVector3& wWitnessOnB,
-											  class btIDebugDraw* debugDraw, btStackAlloc* stackAlloc )
-{
-
-	(void)debugDraw;
-	(void)v;
-	(void)simplexSolver;
-
-//	const btScalar				radialmargin(btScalar(0.));
-	
-	btVector3	guessVector(transformA.getOrigin()-transformB.getOrigin());
-	btGjkEpaSolver2::sResults	results;
-	
-
-	if(btGjkEpaSolver2::Penetration(pConvexA,transformA,
-								pConvexB,transformB,
-								guessVector,results))
-	
-		{
-	//	debugDraw->drawLine(results.witnesses[1],results.witnesses[1]+results.normal,btVector3(255,0,0));
-		//resultOut->addContactPoint(results.normal,results.witnesses[1],-results.depth);
-		wWitnessOnA = results.witnesses[0];
-		wWitnessOnB = results.witnesses[1];
-		v = results.normal;
-		return true;		
-		} else
-	{
-		if(btGjkEpaSolver2::Distance(pConvexA,transformA,pConvexB,transformB,guessVector,results))
-		{
-			wWitnessOnA = results.witnesses[0];
-			wWitnessOnB = results.witnesses[1];
-			v = results.normal;
-			return false;
-		}
-	}
-
-	return false;
-}
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h
deleted file mode 100644
index a49689a..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-EPA Copyright (c) Ricardo Padrela 2006 
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-#ifndef BT_GJP_EPA_PENETRATION_DEPTH_H
-#define BT_GJP_EPA_PENETRATION_DEPTH_H
-
-#include "btConvexPenetrationDepthSolver.h"
-
-///EpaPenetrationDepthSolver uses the Expanding Polytope Algorithm to
-///calculate the penetration depth between two convex shapes.
-class btGjkEpaPenetrationDepthSolver : public btConvexPenetrationDepthSolver
-{
-	public :
-
-		btGjkEpaPenetrationDepthSolver()
-		{
-		}
-
-		bool			calcPenDepth( btSimplexSolverInterface& simplexSolver,
-									  const btConvexShape* pConvexA, const btConvexShape* pConvexB,
-									  const btTransform& transformA, const btTransform& transformB,
-									  btVector3& v, btVector3& wWitnessOnA, btVector3& wWitnessOnB,
-									  class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc );
-
-	private :
-
-};
-
-#endif	// BT_GJP_EPA_PENETRATION_DEPTH_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp
deleted file mode 100644
index 8af16b9..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp
+++ /dev/null
@@ -1,457 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btGjkPairDetector.h"
-#include "BulletCollision/CollisionShapes/btConvexShape.h"
-#include "BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h"
-#include "BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h"
-
-
-
-#if defined(DEBUG) || defined (_DEBUG)
-//#define TEST_NON_VIRTUAL 1
-#include <stdio.h> //for debug printf
-#ifdef __SPU__
-#include <spu_printf.h>
-#define printf spu_printf
-//#define DEBUG_SPU_COLLISION_DETECTION 1
-#endif //__SPU__
-#endif
-
-//must be above the machine epsilon
-#define REL_ERROR2 btScalar(1.0e-6)
-
-//temp globals, to improve GJK/EPA/penetration calculations
-int gNumDeepPenetrationChecks = 0;
-int gNumGjkChecks = 0;
-
-
-btGjkPairDetector::btGjkPairDetector(const btConvexShape* objectA,const btConvexShape* objectB,btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver*	penetrationDepthSolver)
-:m_cachedSeparatingAxis(btScalar(0.),btScalar(1.),btScalar(0.)),
-m_penetrationDepthSolver(penetrationDepthSolver),
-m_simplexSolver(simplexSolver),
-m_minkowskiA(objectA),
-m_minkowskiB(objectB),
-m_shapeTypeA(objectA->getShapeType()),
-m_shapeTypeB(objectB->getShapeType()),
-m_marginA(objectA->getMargin()),
-m_marginB(objectB->getMargin()),
-m_ignoreMargin(false),
-m_lastUsedMethod(-1),
-m_catchDegeneracies(1)
-{
-}
-btGjkPairDetector::btGjkPairDetector(const btConvexShape* objectA,const btConvexShape* objectB,int shapeTypeA,int shapeTypeB,btScalar marginA, btScalar marginB, btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver*	penetrationDepthSolver)
-:m_cachedSeparatingAxis(btScalar(0.),btScalar(1.),btScalar(0.)),
-m_penetrationDepthSolver(penetrationDepthSolver),
-m_simplexSolver(simplexSolver),
-m_minkowskiA(objectA),
-m_minkowskiB(objectB),
-m_shapeTypeA(shapeTypeA),
-m_shapeTypeB(shapeTypeB),
-m_marginA(marginA),
-m_marginB(marginB),
-m_ignoreMargin(false),
-m_lastUsedMethod(-1),
-m_catchDegeneracies(1)
-{
-}
-
-void	btGjkPairDetector::getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw,bool swapResults)
-{
-	(void)swapResults;
-
-	getClosestPointsNonVirtual(input,output,debugDraw);
-}
-
-#ifdef __SPU__
-void btGjkPairDetector::getClosestPointsNonVirtual(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw)
-#else
-void btGjkPairDetector::getClosestPointsNonVirtual(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw)
-#endif
-{
-	m_cachedSeparatingDistance = 0.f;
-
-	btScalar distance=btScalar(0.);
-	btVector3	normalInB(btScalar(0.),btScalar(0.),btScalar(0.));
-	btVector3 pointOnA,pointOnB;
-	btTransform	localTransA = input.m_transformA;
-	btTransform localTransB = input.m_transformB;
-	btVector3 positionOffset = (localTransA.getOrigin() + localTransB.getOrigin()) * btScalar(0.5);
-	localTransA.getOrigin() -= positionOffset;
-	localTransB.getOrigin() -= positionOffset;
-
-	bool check2d = m_minkowskiA->isConvex2d() && m_minkowskiB->isConvex2d();
-
-	btScalar marginA = m_marginA;
-	btScalar marginB = m_marginB;
-
-	gNumGjkChecks++;
-
-#ifdef DEBUG_SPU_COLLISION_DETECTION
-	spu_printf("inside gjk\n");
-#endif
-	//for CCD we don't use margins
-	if (m_ignoreMargin)
-	{
-		marginA = btScalar(0.);
-		marginB = btScalar(0.);
-#ifdef DEBUG_SPU_COLLISION_DETECTION
-		spu_printf("ignoring margin\n");
-#endif
-	}
-
-	m_curIter = 0;
-	int gGjkMaxIter = 1000;//this is to catch invalid input, perhaps check for #NaN?
-	m_cachedSeparatingAxis.setValue(0,1,0);
-
-	bool isValid = false;
-	bool checkSimplex = false;
-	bool checkPenetration = true;
-	m_degenerateSimplex = 0;
-
-	m_lastUsedMethod = -1;
-
-	{
-		btScalar squaredDistance = BT_LARGE_FLOAT;
-		btScalar delta = btScalar(0.);
-		
-		btScalar margin = marginA + marginB;
-		
-		
-
-		m_simplexSolver->reset();
-		
-		for ( ; ; )
-		//while (true)
-		{
-
-			btVector3 seperatingAxisInA = (-m_cachedSeparatingAxis)* input.m_transformA.getBasis();
-			btVector3 seperatingAxisInB = m_cachedSeparatingAxis* input.m_transformB.getBasis();
-
-#if 1
-
-			btVector3 pInA = m_minkowskiA->localGetSupportVertexWithoutMarginNonVirtual(seperatingAxisInA);
-			btVector3 qInB = m_minkowskiB->localGetSupportVertexWithoutMarginNonVirtual(seperatingAxisInB);
-
-//			btVector3 pInA  = localGetSupportingVertexWithoutMargin(m_shapeTypeA, m_minkowskiA, seperatingAxisInA,input.m_convexVertexData[0]);//, &featureIndexA);
-//			btVector3 qInB  = localGetSupportingVertexWithoutMargin(m_shapeTypeB, m_minkowskiB, seperatingAxisInB,input.m_convexVertexData[1]);//, &featureIndexB);
-
-#else
-#ifdef __SPU__
-			btVector3 pInA = m_minkowskiA->localGetSupportVertexWithoutMarginNonVirtual(seperatingAxisInA);
-			btVector3 qInB = m_minkowskiB->localGetSupportVertexWithoutMarginNonVirtual(seperatingAxisInB);
-#else
-			btVector3 pInA = m_minkowskiA->localGetSupportingVertexWithoutMargin(seperatingAxisInA);
-			btVector3 qInB = m_minkowskiB->localGetSupportingVertexWithoutMargin(seperatingAxisInB);
-#ifdef TEST_NON_VIRTUAL
-			btVector3 pInAv = m_minkowskiA->localGetSupportingVertexWithoutMargin(seperatingAxisInA);
-			btVector3 qInBv = m_minkowskiB->localGetSupportingVertexWithoutMargin(seperatingAxisInB);
-			btAssert((pInAv-pInA).length() < 0.0001);
-			btAssert((qInBv-qInB).length() < 0.0001);
-#endif //
-#endif //__SPU__
-#endif
-
-
-			btVector3  pWorld = localTransA(pInA);	
-			btVector3  qWorld = localTransB(qInB);
-
-#ifdef DEBUG_SPU_COLLISION_DETECTION
-		spu_printf("got local supporting vertices\n");
-#endif
-
-			if (check2d)
-			{
-				pWorld[2] = 0.f;
-				qWorld[2] = 0.f;
-			}
-
-			btVector3 w	= pWorld - qWorld;
-			delta = m_cachedSeparatingAxis.dot(w);
-
-			// potential exit, they don't overlap
-			if ((delta > btScalar(0.0)) && (delta * delta > squaredDistance * input.m_maximumDistanceSquared)) 
-			{
-				m_degenerateSimplex = 10;
-				checkSimplex=true;
-				//checkPenetration = false;
-				break;
-			}
-
-			//exit 0: the new point is already in the simplex, or we didn't come any closer
-			if (m_simplexSolver->inSimplex(w))
-			{
-				m_degenerateSimplex = 1;
-				checkSimplex = true;
-				break;
-			}
-			// are we getting any closer ?
-			btScalar f0 = squaredDistance - delta;
-			btScalar f1 = squaredDistance * REL_ERROR2;
-
-			if (f0 <= f1)
-			{
-				if (f0 <= btScalar(0.))
-				{
-					m_degenerateSimplex = 2;
-				} else
-				{
-					m_degenerateSimplex = 11;
-				}
-				checkSimplex = true;
-				break;
-			}
-
-#ifdef DEBUG_SPU_COLLISION_DETECTION
-		spu_printf("addVertex 1\n");
-#endif
-			//add current vertex to simplex
-			m_simplexSolver->addVertex(w, pWorld, qWorld);
-#ifdef DEBUG_SPU_COLLISION_DETECTION
-		spu_printf("addVertex 2\n");
-#endif
-			btVector3 newCachedSeparatingAxis;
-
-			//calculate the closest point to the origin (update vector v)
-			if (!m_simplexSolver->closest(newCachedSeparatingAxis))
-			{
-				m_degenerateSimplex = 3;
-				checkSimplex = true;
-				break;
-			}
-
-			if(newCachedSeparatingAxis.length2()<REL_ERROR2)
-            {
-				m_cachedSeparatingAxis = newCachedSeparatingAxis;
-                m_degenerateSimplex = 6;
-                checkSimplex = true;
-                break;
-            }
-
-			btScalar previousSquaredDistance = squaredDistance;
-			squaredDistance = newCachedSeparatingAxis.length2();
-#if 0
-///warning: this termination condition leads to some problems in 2d test case see Bullet/Demos/Box2dDemo
-			if (squaredDistance>previousSquaredDistance)
-			{
-				m_degenerateSimplex = 7;
-				squaredDistance = previousSquaredDistance;
-                checkSimplex = false;
-                break;
-			}
-#endif //
-			
-
-			//redundant m_simplexSolver->compute_points(pointOnA, pointOnB);
-
-			//are we getting any closer ?
-			if (previousSquaredDistance - squaredDistance <= SIMD_EPSILON * previousSquaredDistance) 
-			{ 
-//				m_simplexSolver->backup_closest(m_cachedSeparatingAxis);
-				checkSimplex = true;
-				m_degenerateSimplex = 12;
-				
-				break;
-			}
-
-			m_cachedSeparatingAxis = newCachedSeparatingAxis;
-
-			  //degeneracy, this is typically due to invalid/uninitialized worldtransforms for a btCollisionObject   
-              if (m_curIter++ > gGjkMaxIter)   
-              {   
-                      #if defined(DEBUG) || defined (_DEBUG) || defined (DEBUG_SPU_COLLISION_DETECTION)
-
-                              printf("btGjkPairDetector maxIter exceeded:%i\n",m_curIter);   
-                              printf("sepAxis=(%f,%f,%f), squaredDistance = %f, shapeTypeA=%i,shapeTypeB=%i\n",   
-                              m_cachedSeparatingAxis.getX(),   
-                              m_cachedSeparatingAxis.getY(),   
-                              m_cachedSeparatingAxis.getZ(),   
-                              squaredDistance,   
-                              m_minkowskiA->getShapeType(),   
-                              m_minkowskiB->getShapeType());   
-
-                      #endif   
-                      break;   
-
-              } 
-
-
-			bool check = (!m_simplexSolver->fullSimplex());
-			//bool check = (!m_simplexSolver->fullSimplex() && squaredDistance > SIMD_EPSILON * m_simplexSolver->maxVertex());
-
-			if (!check)
-			{
-				//do we need this backup_closest here ?
-//				m_simplexSolver->backup_closest(m_cachedSeparatingAxis);
-				m_degenerateSimplex = 13;
-				break;
-			}
-		}
-
-		if (checkSimplex)
-		{
-			m_simplexSolver->compute_points(pointOnA, pointOnB);
-			normalInB = m_cachedSeparatingAxis;
-			btScalar lenSqr =m_cachedSeparatingAxis.length2();
-			
-			//valid normal
-			if (lenSqr < 0.0001)
-			{
-				m_degenerateSimplex = 5;
-			} 
-			if (lenSqr > SIMD_EPSILON*SIMD_EPSILON)
-			{
-				btScalar rlen = btScalar(1.) / btSqrt(lenSqr );
-				normalInB *= rlen; //normalize
-				btScalar s = btSqrt(squaredDistance);
-			
-				btAssert(s > btScalar(0.0));
-				pointOnA -= m_cachedSeparatingAxis * (marginA / s);
-				pointOnB += m_cachedSeparatingAxis * (marginB / s);
-				distance = ((btScalar(1.)/rlen) - margin);
-				isValid = true;
-				
-				m_lastUsedMethod = 1;
-			} else
-			{
-				m_lastUsedMethod = 2;
-			}
-		}
-
-		bool catchDegeneratePenetrationCase = 
-			(m_catchDegeneracies && m_penetrationDepthSolver && m_degenerateSimplex && ((distance+margin) < 0.01));
-
-		//if (checkPenetration && !isValid)
-		if (checkPenetration && (!isValid || catchDegeneratePenetrationCase ))
-		{
-			//penetration case
-
-			//if there is no way to handle penetrations, bail out
-			if (m_penetrationDepthSolver)
-			{
-				// Penetration depth case.
-				btVector3 tmpPointOnA,tmpPointOnB;
-				
-				gNumDeepPenetrationChecks++;
-				m_cachedSeparatingAxis.setZero();
-
-				bool isValid2 = m_penetrationDepthSolver->calcPenDepth( 
-					*m_simplexSolver, 
-					m_minkowskiA,m_minkowskiB,
-					localTransA,localTransB,
-					m_cachedSeparatingAxis, tmpPointOnA, tmpPointOnB,
-					debugDraw,input.m_stackAlloc
-					);
-
-
-				if (isValid2)
-				{
-					btVector3 tmpNormalInB = tmpPointOnB-tmpPointOnA;
-					btScalar lenSqr = tmpNormalInB.length2();
-					if (lenSqr <= (SIMD_EPSILON*SIMD_EPSILON))
-					{
-						tmpNormalInB = m_cachedSeparatingAxis;
-						lenSqr = m_cachedSeparatingAxis.length2();
-					}
-
-					if (lenSqr > (SIMD_EPSILON*SIMD_EPSILON))
-					{
-						tmpNormalInB /= btSqrt(lenSqr);
-						btScalar distance2 = -(tmpPointOnA-tmpPointOnB).length();
-						//only replace valid penetrations when the result is deeper (check)
-						if (!isValid || (distance2 < distance))
-						{
-							distance = distance2;
-							pointOnA = tmpPointOnA;
-							pointOnB = tmpPointOnB;
-							normalInB = tmpNormalInB;
-							isValid = true;
-							m_lastUsedMethod = 3;
-						} else
-						{
-							m_lastUsedMethod = 8;
-						}
-					} else
-					{
-						m_lastUsedMethod = 9;
-					}
-				} else
-
-				{
-					///this is another degenerate case, where the initial GJK calculation reports a degenerate case
-					///EPA reports no penetration, and the second GJK (using the supporting vector without margin)
-					///reports a valid positive distance. Use the results of the second GJK instead of failing.
-					///thanks to Jacob.Langford for the reproduction case
-					///http://code.google.com/p/bullet/issues/detail?id=250
-
-				
-					if (m_cachedSeparatingAxis.length2() > btScalar(0.))
-					{
-						btScalar distance2 = (tmpPointOnA-tmpPointOnB).length()-margin;
-						//only replace valid distances when the distance is less
-						if (!isValid || (distance2 < distance))
-						{
-							distance = distance2;
-							pointOnA = tmpPointOnA;
-							pointOnB = tmpPointOnB;
-							pointOnA -= m_cachedSeparatingAxis * marginA ;
-							pointOnB += m_cachedSeparatingAxis * marginB ;
-							normalInB = m_cachedSeparatingAxis;
-							normalInB.normalize();
-							isValid = true;
-							m_lastUsedMethod = 6;
-						} else
-						{
-							m_lastUsedMethod = 5;
-						}
-					}
-				}
-				
-			}
-
-		}
-	}
-
-	
-
-	if (isValid && ((distance < 0) || (distance*distance < input.m_maximumDistanceSquared)))
-	{
-#if 0
-///some debugging
-//		if (check2d)
-		{
-			printf("n = %2.3f,%2.3f,%2.3f. ",normalInB[0],normalInB[1],normalInB[2]);
-			printf("distance = %2.3f exit=%d deg=%d\n",distance,m_lastUsedMethod,m_degenerateSimplex);
-		}
-#endif 
-
-		m_cachedSeparatingAxis = normalInB;
-		m_cachedSeparatingDistance = distance;
-
-		output.addContactPoint(
-			normalInB,
-			pointOnB+positionOffset,
-			distance);
-
-	}
-
-
-}
-
-
-
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h
deleted file mode 100644
index 2277a19..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-
-#ifndef BT_GJK_PAIR_DETECTOR_H
-#define BT_GJK_PAIR_DETECTOR_H
-
-#include "btDiscreteCollisionDetectorInterface.h"
-#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
-
-class btConvexShape;
-#include "btSimplexSolverInterface.h"
-class btConvexPenetrationDepthSolver;
-
-/// btGjkPairDetector uses GJK to implement the btDiscreteCollisionDetectorInterface
-class btGjkPairDetector : public btDiscreteCollisionDetectorInterface
-{
-	
-
-	btVector3	m_cachedSeparatingAxis;
-	btConvexPenetrationDepthSolver*	m_penetrationDepthSolver;
-	btSimplexSolverInterface* m_simplexSolver;
-	const btConvexShape* m_minkowskiA;
-	const btConvexShape* m_minkowskiB;
-	int	m_shapeTypeA;
-	int m_shapeTypeB;
-	btScalar	m_marginA;
-	btScalar	m_marginB;
-
-	bool		m_ignoreMargin;
-	btScalar	m_cachedSeparatingDistance;
-	
-
-public:
-
-	//some debugging to fix degeneracy problems
-	int			m_lastUsedMethod;
-	int			m_curIter;
-	int			m_degenerateSimplex;
-	int			m_catchDegeneracies;
-
-
-	btGjkPairDetector(const btConvexShape* objectA,const btConvexShape* objectB,btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver*	penetrationDepthSolver);
-	btGjkPairDetector(const btConvexShape* objectA,const btConvexShape* objectB,int shapeTypeA,int shapeTypeB,btScalar marginA, btScalar marginB, btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver*	penetrationDepthSolver);
-	virtual ~btGjkPairDetector() {};
-
-	virtual void	getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw,bool swapResults=false);
-
-	void	getClosestPointsNonVirtual(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw);
-	
-
-	void setMinkowskiA(btConvexShape* minkA)
-	{
-		m_minkowskiA = minkA;
-	}
-
-	void setMinkowskiB(btConvexShape* minkB)
-	{
-		m_minkowskiB = minkB;
-	}
-	void setCachedSeperatingAxis(const btVector3& seperatingAxis)
-	{
-		m_cachedSeparatingAxis = seperatingAxis;
-	}
-
-	const btVector3& getCachedSeparatingAxis() const
-	{
-		return m_cachedSeparatingAxis;
-	}
-	btScalar	getCachedSeparatingDistance() const
-	{
-		return m_cachedSeparatingDistance;
-	}
-
-	void	setPenetrationDepthSolver(btConvexPenetrationDepthSolver*	penetrationDepthSolver)
-	{
-		m_penetrationDepthSolver = penetrationDepthSolver;
-	}
-
-	///don't use setIgnoreMargin, it's for Bullet's internal use
-	void	setIgnoreMargin(bool ignoreMargin)
-	{
-		m_ignoreMargin = ignoreMargin;
-	}
-
-
-};
-
-#endif //BT_GJK_PAIR_DETECTOR_H
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h
deleted file mode 100644
index 0ce9dd2..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_MANIFOLD_CONTACT_POINT_H
-#define BT_MANIFOLD_CONTACT_POINT_H
-
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btTransformUtil.h"
-
-#ifdef PFX_USE_FREE_VECTORMATH
-	#include "physics_effects/base_level/solver/pfx_constraint_row.h"
-typedef sce::PhysicsEffects::PfxConstraintRow btConstraintRow;
-#else
-	// Don't change following order of parameters
-	ATTRIBUTE_ALIGNED16(struct) btConstraintRow {
-		btScalar m_normal[3];
-		btScalar m_rhs;
-		btScalar m_jacDiagInv;
-		btScalar m_lowerLimit;
-		btScalar m_upperLimit;
-		btScalar m_accumImpulse;
-	};
-	typedef btConstraintRow PfxConstraintRow;
-#endif //PFX_USE_FREE_VECTORMATH
-
-
-
-/// ManifoldContactPoint collects and maintains persistent contactpoints.
-/// used to improve stability and performance of rigidbody dynamics response.
-class btManifoldPoint
-	{
-		public:
-			btManifoldPoint()
-				:m_userPersistentData(0),
-				m_appliedImpulse(0.f),
-				m_lateralFrictionInitialized(false),
-				m_appliedImpulseLateral1(0.f),
-				m_appliedImpulseLateral2(0.f),
-				m_contactMotion1(0.f),
-				m_contactMotion2(0.f),
-				m_contactCFM1(0.f),
-				m_contactCFM2(0.f),
-				m_lifeTime(0)
-			{
-			}
-
-			btManifoldPoint( const btVector3 &pointA, const btVector3 &pointB, 
-					const btVector3 &normal, 
-					btScalar distance ) :
-					m_localPointA( pointA ), 
-					m_localPointB( pointB ), 
-					m_normalWorldOnB( normal ), 
-					m_distance1( distance ),
-					m_combinedFriction(btScalar(0.)),
-					m_combinedRestitution(btScalar(0.)),
-					m_userPersistentData(0),
-					m_appliedImpulse(0.f),
-					m_lateralFrictionInitialized(false),
-					m_appliedImpulseLateral1(0.f),
-					m_appliedImpulseLateral2(0.f),
-					m_contactMotion1(0.f),
-					m_contactMotion2(0.f),
-					m_contactCFM1(0.f),
-					m_contactCFM2(0.f),
-					m_lifeTime(0)
-			{
-				mConstraintRow[0].m_accumImpulse = 0.f;
-				mConstraintRow[1].m_accumImpulse = 0.f;
-				mConstraintRow[2].m_accumImpulse = 0.f;
-			}
-
-			
-
-			btVector3 m_localPointA;			
-			btVector3 m_localPointB;			
-			btVector3	m_positionWorldOnB;
-			///m_positionWorldOnA is redundant information, see getPositionWorldOnA(), but for clarity
-			btVector3	m_positionWorldOnA;
-			btVector3 m_normalWorldOnB;
-		
-			btScalar	m_distance1;
-			btScalar	m_combinedFriction;
-			btScalar	m_combinedRestitution;
-
-         //BP mod, store contact triangles.
-         int	   m_partId0;
-         int      m_partId1;
-         int      m_index0;
-         int      m_index1;
-				
-			mutable void*	m_userPersistentData;
-			btScalar		m_appliedImpulse;
-
-			bool			m_lateralFrictionInitialized;
-			btScalar		m_appliedImpulseLateral1;
-			btScalar		m_appliedImpulseLateral2;
-			btScalar		m_contactMotion1;
-			btScalar		m_contactMotion2;
-			btScalar		m_contactCFM1;
-			btScalar		m_contactCFM2;
-
-			int				m_lifeTime;//lifetime of the contactpoint in frames
-			
-			btVector3		m_lateralFrictionDir1;
-			btVector3		m_lateralFrictionDir2;
-
-
-
-			btConstraintRow mConstraintRow[3];
-
-
-			btScalar getDistance() const
-			{
-				return m_distance1;
-			}
-			int	getLifeTime() const
-			{
-				return m_lifeTime;
-			}
-
-			const btVector3& getPositionWorldOnA() const {
-				return m_positionWorldOnA;
-//				return m_positionWorldOnB + m_normalWorldOnB * m_distance1;
-			}
-
-			const btVector3& getPositionWorldOnB() const
-			{
-				return m_positionWorldOnB;
-			}
-
-			void	setDistance(btScalar dist)
-			{
-				m_distance1 = dist;
-			}
-			
-			///this returns the most recent applied impulse, to satisfy contact constraints by the constraint solver
-			btScalar	getAppliedImpulse() const
-			{
-				return m_appliedImpulse;
-			}
-
-			
-
-	};
-
-#endif //BT_MANIFOLD_CONTACT_POINT_H
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp
deleted file mode 100644
index fe31f08..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btMinkowskiPenetrationDepthSolver.h"
-#include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h"
-#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
-#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h"
-#include "BulletCollision/CollisionShapes/btConvexShape.h"
-
-#define NUM_UNITSPHERE_POINTS 42
-
-
-bool btMinkowskiPenetrationDepthSolver::calcPenDepth(btSimplexSolverInterface& simplexSolver,
-												   const btConvexShape* convexA,const btConvexShape* convexB,
-												   const btTransform& transA,const btTransform& transB,
-												   btVector3& v, btVector3& pa, btVector3& pb,
-												   class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc
-												   )
-{
-
-	(void)stackAlloc;
-	(void)v;
-	
-	bool check2d= convexA->isConvex2d() && convexB->isConvex2d();
-
-	struct btIntermediateResult : public btDiscreteCollisionDetectorInterface::Result
-	{
-
-		btIntermediateResult():m_hasResult(false)
-		{
-		}
-		
-		btVector3 m_normalOnBInWorld;
-		btVector3 m_pointInWorld;
-		btScalar m_depth;
-		bool	m_hasResult;
-
-		virtual void setShapeIdentifiersA(int partId0,int index0)
-		{
-			(void)partId0;
-			(void)index0;
-		}
-		virtual void setShapeIdentifiersB(int partId1,int index1)
-		{
-			(void)partId1;
-			(void)index1;
-		}
-		void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)
-		{
-			m_normalOnBInWorld = normalOnBInWorld;
-			m_pointInWorld = pointInWorld;
-			m_depth = depth;
-			m_hasResult = true;
-		}
-	};
-
-	//just take fixed number of orientation, and sample the penetration depth in that direction
-	btScalar minProj = btScalar(BT_LARGE_FLOAT);
-	btVector3 minNorm(btScalar(0.), btScalar(0.), btScalar(0.));
-	btVector3 minA,minB;
-	btVector3 seperatingAxisInA,seperatingAxisInB;
-	btVector3 pInA,qInB,pWorld,qWorld,w;
-
-#ifndef __SPU__
-#define USE_BATCHED_SUPPORT 1
-#endif
-#ifdef USE_BATCHED_SUPPORT
-
-	btVector3	supportVerticesABatch[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2];
-	btVector3	supportVerticesBBatch[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2];
-	btVector3	seperatingAxisInABatch[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2];
-	btVector3	seperatingAxisInBBatch[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2];
-	int i;
-
-	int numSampleDirections = NUM_UNITSPHERE_POINTS;
-
-	for (i=0;i<numSampleDirections;i++)
-	{
-		btVector3 norm = getPenetrationDirections()[i];
-		seperatingAxisInABatch[i] =  (-norm) * transA.getBasis() ;
-		seperatingAxisInBBatch[i] =  norm   * transB.getBasis() ;
-	}
-
-	{
-		int numPDA = convexA->getNumPreferredPenetrationDirections();
-		if (numPDA)
-		{
-			for (int i=0;i<numPDA;i++)
-			{
-				btVector3 norm;
-				convexA->getPreferredPenetrationDirection(i,norm);
-				norm  = transA.getBasis() * norm;
-				getPenetrationDirections()[numSampleDirections] = norm;
-				seperatingAxisInABatch[numSampleDirections] = (-norm) * transA.getBasis();
-				seperatingAxisInBBatch[numSampleDirections] = norm * transB.getBasis();
-				numSampleDirections++;
-			}
-		}
-	}
-
-	{
-		int numPDB = convexB->getNumPreferredPenetrationDirections();
-		if (numPDB)
-		{
-			for (int i=0;i<numPDB;i++)
-			{
-				btVector3 norm;
-				convexB->getPreferredPenetrationDirection(i,norm);
-				norm  = transB.getBasis() * norm;
-				getPenetrationDirections()[numSampleDirections] = norm;
-				seperatingAxisInABatch[numSampleDirections] = (-norm) * transA.getBasis();
-				seperatingAxisInBBatch[numSampleDirections] = norm * transB.getBasis();
-				numSampleDirections++;
-			}
-		}
-	}
-
-
-
-
-	convexA->batchedUnitVectorGetSupportingVertexWithoutMargin(seperatingAxisInABatch,supportVerticesABatch,numSampleDirections);
-	convexB->batchedUnitVectorGetSupportingVertexWithoutMargin(seperatingAxisInBBatch,supportVerticesBBatch,numSampleDirections);
-
-	for (i=0;i<numSampleDirections;i++)
-	{
-		btVector3 norm = getPenetrationDirections()[i];
-		if (check2d)
-		{
-			norm[2] = 0.f;
-		}
-		if (norm.length2()>0.01)
-		{
-
-			seperatingAxisInA = seperatingAxisInABatch[i];
-			seperatingAxisInB = seperatingAxisInBBatch[i];
-
-			pInA = supportVerticesABatch[i];
-			qInB = supportVerticesBBatch[i];
-
-			pWorld = transA(pInA);	
-			qWorld = transB(qInB);
-			if (check2d)
-			{
-				pWorld[2] = 0.f;
-				qWorld[2] = 0.f;
-			}
-
-			w	= qWorld - pWorld;
-			btScalar delta = norm.dot(w);
-			//find smallest delta
-			if (delta < minProj)
-			{
-				minProj = delta;
-				minNorm = norm;
-				minA = pWorld;
-				minB = qWorld;
-			}
-		}
-	}	
-#else
-
-	int numSampleDirections = NUM_UNITSPHERE_POINTS;
-
-#ifndef __SPU__
-	{
-		int numPDA = convexA->getNumPreferredPenetrationDirections();
-		if (numPDA)
-		{
-			for (int i=0;i<numPDA;i++)
-			{
-				btVector3 norm;
-				convexA->getPreferredPenetrationDirection(i,norm);
-				norm  = transA.getBasis() * norm;
-				getPenetrationDirections()[numSampleDirections] = norm;
-				numSampleDirections++;
-			}
-		}
-	}
-
-	{
-		int numPDB = convexB->getNumPreferredPenetrationDirections();
-		if (numPDB)
-		{
-			for (int i=0;i<numPDB;i++)
-			{
-				btVector3 norm;
-				convexB->getPreferredPenetrationDirection(i,norm);
-				norm  = transB.getBasis() * norm;
-				getPenetrationDirections()[numSampleDirections] = norm;
-				numSampleDirections++;
-			}
-		}
-	}
-#endif // __SPU__
-
-	for (int i=0;i<numSampleDirections;i++)
-	{
-		const btVector3& norm = getPenetrationDirections()[i];
-		seperatingAxisInA = (-norm)* transA.getBasis();
-		seperatingAxisInB = norm* transB.getBasis();
-		pInA = convexA->localGetSupportVertexWithoutMarginNonVirtual(seperatingAxisInA);
-		qInB = convexB->localGetSupportVertexWithoutMarginNonVirtual(seperatingAxisInB);
-		pWorld = transA(pInA);	
-		qWorld = transB(qInB);
-		w	= qWorld - pWorld;
-		btScalar delta = norm.dot(w);
-		//find smallest delta
-		if (delta < minProj)
-		{
-			minProj = delta;
-			minNorm = norm;
-			minA = pWorld;
-			minB = qWorld;
-		}
-	}
-#endif //USE_BATCHED_SUPPORT
-
-	//add the margins
-
-	minA += minNorm*convexA->getMarginNonVirtual();
-	minB -= minNorm*convexB->getMarginNonVirtual();
-	//no penetration
-	if (minProj < btScalar(0.))
-		return false;
-
-	btScalar extraSeparation = 0.5f;///scale dependent
-	minProj += extraSeparation+(convexA->getMarginNonVirtual() + convexB->getMarginNonVirtual());
-
-
-
-
-
-//#define DEBUG_DRAW 1
-#ifdef DEBUG_DRAW
-	if (debugDraw)
-	{
-		btVector3 color(0,1,0);
-		debugDraw->drawLine(minA,minB,color);
-		color = btVector3 (1,1,1);
-		btVector3 vec = minB-minA;
-		btScalar prj2 = minNorm.dot(vec);
-		debugDraw->drawLine(minA,minA+(minNorm*minProj),color);
-
-	}
-#endif //DEBUG_DRAW
-
-	
-
-	btGjkPairDetector gjkdet(convexA,convexB,&simplexSolver,0);
-
-	btScalar offsetDist = minProj;
-	btVector3 offset = minNorm * offsetDist;
-	
-
-
-	btGjkPairDetector::ClosestPointInput input;
-		
-	btVector3 newOrg = transA.getOrigin() + offset;
-
-	btTransform displacedTrans = transA;
-	displacedTrans.setOrigin(newOrg);
-
-	input.m_transformA = displacedTrans;
-	input.m_transformB = transB;
-	input.m_maximumDistanceSquared = btScalar(BT_LARGE_FLOAT);//minProj;
-	
-	btIntermediateResult res;
-	gjkdet.setCachedSeperatingAxis(-minNorm);
-	gjkdet.getClosestPoints(input,res,debugDraw);
-
-	btScalar correctedMinNorm = minProj - res.m_depth;
-
-
-	//the penetration depth is over-estimated, relax it
-	btScalar penetration_relaxation= btScalar(1.);
-	minNorm*=penetration_relaxation;
-	
-
-	if (res.m_hasResult)
-	{
-
-		pa = res.m_pointInWorld - minNorm * correctedMinNorm;
-		pb = res.m_pointInWorld;
-		v = minNorm;
-		
-#ifdef DEBUG_DRAW
-		if (debugDraw)
-		{
-			btVector3 color(1,0,0);
-			debugDraw->drawLine(pa,pb,color);
-		}
-#endif//DEBUG_DRAW
-
-
-	}
-	return res.m_hasResult;
-}
-
-btVector3*	btMinkowskiPenetrationDepthSolver::getPenetrationDirections()
-{
-	static btVector3	sPenetrationDirections[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2] = 
-	{
-	btVector3(btScalar(0.000000) , btScalar(-0.000000),btScalar(-1.000000)),
-	btVector3(btScalar(0.723608) , btScalar(-0.525725),btScalar(-0.447219)),
-	btVector3(btScalar(-0.276388) , btScalar(-0.850649),btScalar(-0.447219)),
-	btVector3(btScalar(-0.894426) , btScalar(-0.000000),btScalar(-0.447216)),
-	btVector3(btScalar(-0.276388) , btScalar(0.850649),btScalar(-0.447220)),
-	btVector3(btScalar(0.723608) , btScalar(0.525725),btScalar(-0.447219)),
-	btVector3(btScalar(0.276388) , btScalar(-0.850649),btScalar(0.447220)),
-	btVector3(btScalar(-0.723608) , btScalar(-0.525725),btScalar(0.447219)),
-	btVector3(btScalar(-0.723608) , btScalar(0.525725),btScalar(0.447219)),
-	btVector3(btScalar(0.276388) , btScalar(0.850649),btScalar(0.447219)),
-	btVector3(btScalar(0.894426) , btScalar(0.000000),btScalar(0.447216)),
-	btVector3(btScalar(-0.000000) , btScalar(0.000000),btScalar(1.000000)),
-	btVector3(btScalar(0.425323) , btScalar(-0.309011),btScalar(-0.850654)),
-	btVector3(btScalar(-0.162456) , btScalar(-0.499995),btScalar(-0.850654)),
-	btVector3(btScalar(0.262869) , btScalar(-0.809012),btScalar(-0.525738)),
-	btVector3(btScalar(0.425323) , btScalar(0.309011),btScalar(-0.850654)),
-	btVector3(btScalar(0.850648) , btScalar(-0.000000),btScalar(-0.525736)),
-	btVector3(btScalar(-0.525730) , btScalar(-0.000000),btScalar(-0.850652)),
-	btVector3(btScalar(-0.688190) , btScalar(-0.499997),btScalar(-0.525736)),
-	btVector3(btScalar(-0.162456) , btScalar(0.499995),btScalar(-0.850654)),
-	btVector3(btScalar(-0.688190) , btScalar(0.499997),btScalar(-0.525736)),
-	btVector3(btScalar(0.262869) , btScalar(0.809012),btScalar(-0.525738)),
-	btVector3(btScalar(0.951058) , btScalar(0.309013),btScalar(0.000000)),
-	btVector3(btScalar(0.951058) , btScalar(-0.309013),btScalar(0.000000)),
-	btVector3(btScalar(0.587786) , btScalar(-0.809017),btScalar(0.000000)),
-	btVector3(btScalar(0.000000) , btScalar(-1.000000),btScalar(0.000000)),
-	btVector3(btScalar(-0.587786) , btScalar(-0.809017),btScalar(0.000000)),
-	btVector3(btScalar(-0.951058) , btScalar(-0.309013),btScalar(-0.000000)),
-	btVector3(btScalar(-0.951058) , btScalar(0.309013),btScalar(-0.000000)),
-	btVector3(btScalar(-0.587786) , btScalar(0.809017),btScalar(-0.000000)),
-	btVector3(btScalar(-0.000000) , btScalar(1.000000),btScalar(-0.000000)),
-	btVector3(btScalar(0.587786) , btScalar(0.809017),btScalar(-0.000000)),
-	btVector3(btScalar(0.688190) , btScalar(-0.499997),btScalar(0.525736)),
-	btVector3(btScalar(-0.262869) , btScalar(-0.809012),btScalar(0.525738)),
-	btVector3(btScalar(-0.850648) , btScalar(0.000000),btScalar(0.525736)),
-	btVector3(btScalar(-0.262869) , btScalar(0.809012),btScalar(0.525738)),
-	btVector3(btScalar(0.688190) , btScalar(0.499997),btScalar(0.525736)),
-	btVector3(btScalar(0.525730) , btScalar(0.000000),btScalar(0.850652)),
-	btVector3(btScalar(0.162456) , btScalar(-0.499995),btScalar(0.850654)),
-	btVector3(btScalar(-0.425323) , btScalar(-0.309011),btScalar(0.850654)),
-	btVector3(btScalar(-0.425323) , btScalar(0.309011),btScalar(0.850654)),
-	btVector3(btScalar(0.162456) , btScalar(0.499995),btScalar(0.850654))
-	};
-
-	return sPenetrationDirections;
-}
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h
deleted file mode 100644
index 6a8fe52..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
-#define BT_MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
-
-#include "btConvexPenetrationDepthSolver.h"
-
-///MinkowskiPenetrationDepthSolver implements bruteforce penetration depth estimation.
-///Implementation is based on sampling the depth using support mapping, and using GJK step to get the witness points.
-class btMinkowskiPenetrationDepthSolver : public btConvexPenetrationDepthSolver
-{
-protected:
-
-	static btVector3*	getPenetrationDirections();
-
-public:
-
-	virtual bool calcPenDepth( btSimplexSolverInterface& simplexSolver,
-	const btConvexShape* convexA,const btConvexShape* convexB,
-				const btTransform& transA,const btTransform& transB,
-			btVector3& v, btVector3& pa, btVector3& pb,
-			class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc
-			);
-};
-
-#endif //BT_MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp
deleted file mode 100644
index 924a8af..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "btPersistentManifold.h"
-#include "LinearMath/btTransform.h"
-
-
-btScalar					gContactBreakingThreshold = btScalar(0.02);
-ContactDestroyedCallback	gContactDestroyedCallback = 0;
-ContactProcessedCallback	gContactProcessedCallback = 0;
-
-
-
-btPersistentManifold::btPersistentManifold()
-:btTypedObject(BT_PERSISTENT_MANIFOLD_TYPE),
-m_body0(0),
-m_body1(0),
-m_cachedPoints (0),
-m_index1a(0)
-{
-}
-
-
-
-
-#ifdef DEBUG_PERSISTENCY
-#include <stdio.h>
-void	btPersistentManifold::DebugPersistency()
-{
-	int i;
-	printf("DebugPersistency : numPoints %d\n",m_cachedPoints);
-	for (i=0;i<m_cachedPoints;i++)
-	{
-		printf("m_pointCache[%d].m_userPersistentData = %x\n",i,m_pointCache[i].m_userPersistentData);
-	}
-}
-#endif //DEBUG_PERSISTENCY
-
-void btPersistentManifold::clearUserCache(btManifoldPoint& pt)
-{
-
-	void* oldPtr = pt.m_userPersistentData;
-	if (oldPtr)
-	{
-#ifdef DEBUG_PERSISTENCY
-		int i;
-		int occurance = 0;
-		for (i=0;i<m_cachedPoints;i++)
-		{
-			if (m_pointCache[i].m_userPersistentData == oldPtr)
-			{
-				occurance++;
-				if (occurance>1)
-					printf("error in clearUserCache\n");
-			}
-		}
-		btAssert(occurance<=0);
-#endif //DEBUG_PERSISTENCY
-
-		if (pt.m_userPersistentData && gContactDestroyedCallback)
-		{
-			(*gContactDestroyedCallback)(pt.m_userPersistentData);
-			pt.m_userPersistentData = 0;
-		}
-		
-#ifdef DEBUG_PERSISTENCY
-		DebugPersistency();
-#endif
-	}
-
-	
-}
-
-
-int btPersistentManifold::sortCachedPoints(const btManifoldPoint& pt) 
-{
-
-		//calculate 4 possible cases areas, and take biggest area
-		//also need to keep 'deepest'
-		
-		int maxPenetrationIndex = -1;
-#define KEEP_DEEPEST_POINT 1
-#ifdef KEEP_DEEPEST_POINT
-		btScalar maxPenetration = pt.getDistance();
-		for (int i=0;i<4;i++)
-		{
-			if (m_pointCache[i].getDistance() < maxPenetration)
-			{
-				maxPenetrationIndex = i;
-				maxPenetration = m_pointCache[i].getDistance();
-			}
-		}
-#endif //KEEP_DEEPEST_POINT
-		
-		btScalar res0(btScalar(0.)),res1(btScalar(0.)),res2(btScalar(0.)),res3(btScalar(0.));
-		if (maxPenetrationIndex != 0)
-		{
-			btVector3 a0 = pt.m_localPointA-m_pointCache[1].m_localPointA;
-			btVector3 b0 = m_pointCache[3].m_localPointA-m_pointCache[2].m_localPointA;
-			btVector3 cross = a0.cross(b0);
-			res0 = cross.length2();
-		}
-		if (maxPenetrationIndex != 1)
-		{
-			btVector3 a1 = pt.m_localPointA-m_pointCache[0].m_localPointA;
-			btVector3 b1 = m_pointCache[3].m_localPointA-m_pointCache[2].m_localPointA;
-			btVector3 cross = a1.cross(b1);
-			res1 = cross.length2();
-		}
-
-		if (maxPenetrationIndex != 2)
-		{
-			btVector3 a2 = pt.m_localPointA-m_pointCache[0].m_localPointA;
-			btVector3 b2 = m_pointCache[3].m_localPointA-m_pointCache[1].m_localPointA;
-			btVector3 cross = a2.cross(b2);
-			res2 = cross.length2();
-		}
-
-		if (maxPenetrationIndex != 3)
-		{
-			btVector3 a3 = pt.m_localPointA-m_pointCache[0].m_localPointA;
-			btVector3 b3 = m_pointCache[2].m_localPointA-m_pointCache[1].m_localPointA;
-			btVector3 cross = a3.cross(b3);
-			res3 = cross.length2();
-		}
-
-		btVector4 maxvec(res0,res1,res2,res3);
-		int biggestarea = maxvec.closestAxis4();
-		return biggestarea;
-}
-
-
-int btPersistentManifold::getCacheEntry(const btManifoldPoint& newPoint) const
-{
-	btScalar shortestDist =  getContactBreakingThreshold() * getContactBreakingThreshold();
-	int size = getNumContacts();
-	int nearestPoint = -1;
-	for( int i = 0; i < size; i++ )
-	{
-		const btManifoldPoint &mp = m_pointCache[i];
-
-		btVector3 diffA =  mp.m_localPointA- newPoint.m_localPointA;
-		const btScalar distToManiPoint = diffA.dot(diffA);
-		if( distToManiPoint < shortestDist )
-		{
-			shortestDist = distToManiPoint;
-			nearestPoint = i;
-		}
-	}
-	return nearestPoint;
-}
-
-int btPersistentManifold::addManifoldPoint(const btManifoldPoint& newPoint)
-{
-	btAssert(validContactDistance(newPoint));
-
-	int insertIndex = getNumContacts();
-	if (insertIndex == MANIFOLD_CACHE_SIZE)
-	{
-#if MANIFOLD_CACHE_SIZE >= 4
-		//sort cache so best points come first, based on area
-		insertIndex = sortCachedPoints(newPoint);
-#else
-		insertIndex = 0;
-#endif
-		clearUserCache(m_pointCache[insertIndex]);
-		
-	} else
-	{
-		m_cachedPoints++;
-
-		
-	}
-	if (insertIndex<0)
-		insertIndex=0;
-
-	btAssert(m_pointCache[insertIndex].m_userPersistentData==0);
-	m_pointCache[insertIndex] = newPoint;
-	return insertIndex;
-}
-
-btScalar	btPersistentManifold::getContactBreakingThreshold() const
-{
-	return m_contactBreakingThreshold;
-}
-
-
-
-void btPersistentManifold::refreshContactPoints(const btTransform& trA,const btTransform& trB)
-{
-	int i;
-#ifdef DEBUG_PERSISTENCY
-	printf("refreshContactPoints posA = (%f,%f,%f) posB = (%f,%f,%f)\n",
-		trA.getOrigin().getX(),
-		trA.getOrigin().getY(),
-		trA.getOrigin().getZ(),
-		trB.getOrigin().getX(),
-		trB.getOrigin().getY(),
-		trB.getOrigin().getZ());
-#endif //DEBUG_PERSISTENCY
-	/// first refresh worldspace positions and distance
-	for (i=getNumContacts()-1;i>=0;i--)
-	{
-		btManifoldPoint &manifoldPoint = m_pointCache[i];
-		manifoldPoint.m_positionWorldOnA = trA( manifoldPoint.m_localPointA );
-		manifoldPoint.m_positionWorldOnB = trB( manifoldPoint.m_localPointB );
-		manifoldPoint.m_distance1 = (manifoldPoint.m_positionWorldOnA -  manifoldPoint.m_positionWorldOnB).dot(manifoldPoint.m_normalWorldOnB);
-		manifoldPoint.m_lifeTime++;
-	}
-
-	/// then 
-	btScalar distance2d;
-	btVector3 projectedDifference,projectedPoint;
-	for (i=getNumContacts()-1;i>=0;i--)
-	{
-		
-		btManifoldPoint &manifoldPoint = m_pointCache[i];
-		//contact becomes invalid when signed distance exceeds margin (projected on contactnormal direction)
-		if (!validContactDistance(manifoldPoint))
-		{
-			removeContactPoint(i);
-		} else
-		{
-			//contact also becomes invalid when relative movement orthogonal to normal exceeds margin
-			projectedPoint = manifoldPoint.m_positionWorldOnA - manifoldPoint.m_normalWorldOnB * manifoldPoint.m_distance1;
-			projectedDifference = manifoldPoint.m_positionWorldOnB - projectedPoint;
-			distance2d = projectedDifference.dot(projectedDifference);
-			if (distance2d  > getContactBreakingThreshold()*getContactBreakingThreshold() )
-			{
-				removeContactPoint(i);
-			} else
-			{
-				//contact point processed callback
-				if (gContactProcessedCallback)
-					(*gContactProcessedCallback)(manifoldPoint,m_body0,m_body1);
-			}
-		}
-	}
-#ifdef DEBUG_PERSISTENCY
-	DebugPersistency();
-#endif //
-}
-
-
-
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h
deleted file mode 100644
index 83d17f2..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_PERSISTENT_MANIFOLD_H
-#define BT_PERSISTENT_MANIFOLD_H
-
-
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btTransform.h"
-#include "btManifoldPoint.h"
-#include "LinearMath/btAlignedAllocator.h"
-
-struct btCollisionResult;
-
-///maximum contact breaking and merging threshold
-extern btScalar gContactBreakingThreshold;
-
-typedef bool (*ContactDestroyedCallback)(void* userPersistentData);
-typedef bool (*ContactProcessedCallback)(btManifoldPoint& cp,void* body0,void* body1);
-extern ContactDestroyedCallback	gContactDestroyedCallback;
-extern ContactProcessedCallback gContactProcessedCallback;
-
-//the enum starts at 1024 to avoid type conflicts with btTypedConstraint
-enum btContactManifoldTypes
-{
-	MIN_CONTACT_MANIFOLD_TYPE = 1024,
-	BT_PERSISTENT_MANIFOLD_TYPE
-};
-
-#define MANIFOLD_CACHE_SIZE 4
-
-///btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping in the broadphase.
-///Those contact points are created by the collision narrow phase.
-///The cache can be empty, or hold 1,2,3 or 4 points. Some collision algorithms (GJK) might only add one point at a time.
-///updates/refreshes old contact points, and throw them away if necessary (distance becomes too large)
-///reduces the cache to 4 points, when more then 4 points are added, using following rules:
-///the contact point with deepest penetration is always kept, and it tries to maximuze the area covered by the points
-///note that some pairs of objects might have more then one contact manifold.
-
-
-ATTRIBUTE_ALIGNED128( class) btPersistentManifold : public btTypedObject
-//ATTRIBUTE_ALIGNED16( class) btPersistentManifold : public btTypedObject
-{
-
-	btManifoldPoint m_pointCache[MANIFOLD_CACHE_SIZE];
-
-	/// this two body pointers can point to the physics rigidbody class.
-	/// void* will allow any rigidbody class
-	void* m_body0;
-	void* m_body1;
-
-	int	m_cachedPoints;
-
-	btScalar	m_contactBreakingThreshold;
-	btScalar	m_contactProcessingThreshold;
-
-	
-	/// sort cached points so most isolated points come first
-	int	sortCachedPoints(const btManifoldPoint& pt);
-
-	int		findContactPoint(const btManifoldPoint* unUsed, int numUnused,const btManifoldPoint& pt);
-
-public:
-
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-
-	int	m_companionIdA;
-	int	m_companionIdB;
-
-	int m_index1a;
-
-	btPersistentManifold();
-
-	btPersistentManifold(void* body0,void* body1,int , btScalar contactBreakingThreshold,btScalar contactProcessingThreshold)
-		: btTypedObject(BT_PERSISTENT_MANIFOLD_TYPE),
-	m_body0(body0),m_body1(body1),m_cachedPoints(0),
-		m_contactBreakingThreshold(contactBreakingThreshold),
-		m_contactProcessingThreshold(contactProcessingThreshold)
-	{
-	}
-
-	SIMD_FORCE_INLINE void* getBody0() { return m_body0;}
-	SIMD_FORCE_INLINE void* getBody1() { return m_body1;}
-
-	SIMD_FORCE_INLINE const void* getBody0() const { return m_body0;}
-	SIMD_FORCE_INLINE const void* getBody1() const { return m_body1;}
-
-	void	setBodies(void* body0,void* body1)
-	{
-		m_body0 = body0;
-		m_body1 = body1;
-	}
-
-	void clearUserCache(btManifoldPoint& pt);
-
-#ifdef DEBUG_PERSISTENCY
-	void	DebugPersistency();
-#endif //
-	
-	SIMD_FORCE_INLINE int	getNumContacts() const { return m_cachedPoints;}
-
-	SIMD_FORCE_INLINE const btManifoldPoint& getContactPoint(int index) const
-	{
-		btAssert(index < m_cachedPoints);
-		return m_pointCache[index];
-	}
-
-	SIMD_FORCE_INLINE btManifoldPoint& getContactPoint(int index)
-	{
-		btAssert(index < m_cachedPoints);
-		return m_pointCache[index];
-	}
-
-	///@todo: get this margin from the current physics / collision environment
-	btScalar	getContactBreakingThreshold() const;
-
-	btScalar	getContactProcessingThreshold() const
-	{
-		return m_contactProcessingThreshold;
-	}
-	
-	int getCacheEntry(const btManifoldPoint& newPoint) const;
-
-	int addManifoldPoint( const btManifoldPoint& newPoint);
-
-	void removeContactPoint (int index)
-	{
-		clearUserCache(m_pointCache[index]);
-
-		int lastUsedIndex = getNumContacts() - 1;
-//		m_pointCache[index] = m_pointCache[lastUsedIndex];
-		if(index != lastUsedIndex) 
-		{
-			m_pointCache[index] = m_pointCache[lastUsedIndex]; 
-			//get rid of duplicated userPersistentData pointer
-			m_pointCache[lastUsedIndex].m_userPersistentData = 0;
-			m_pointCache[lastUsedIndex].mConstraintRow[0].m_accumImpulse = 0.f;
-			m_pointCache[lastUsedIndex].mConstraintRow[1].m_accumImpulse = 0.f;
-			m_pointCache[lastUsedIndex].mConstraintRow[2].m_accumImpulse = 0.f;
-
-			m_pointCache[lastUsedIndex].m_appliedImpulse = 0.f;
-			m_pointCache[lastUsedIndex].m_lateralFrictionInitialized = false;
-			m_pointCache[lastUsedIndex].m_appliedImpulseLateral1 = 0.f;
-			m_pointCache[lastUsedIndex].m_appliedImpulseLateral2 = 0.f;
-			m_pointCache[lastUsedIndex].m_lifeTime = 0;
-		}
-
-		btAssert(m_pointCache[lastUsedIndex].m_userPersistentData==0);
-		m_cachedPoints--;
-	}
-	void replaceContactPoint(const btManifoldPoint& newPoint,int insertIndex)
-	{
-		btAssert(validContactDistance(newPoint));
-
-#define MAINTAIN_PERSISTENCY 1
-#ifdef MAINTAIN_PERSISTENCY
-		int	lifeTime = m_pointCache[insertIndex].getLifeTime();
-		btScalar	appliedImpulse = m_pointCache[insertIndex].mConstraintRow[0].m_accumImpulse;
-		btScalar	appliedLateralImpulse1 = m_pointCache[insertIndex].mConstraintRow[1].m_accumImpulse;
-		btScalar	appliedLateralImpulse2 = m_pointCache[insertIndex].mConstraintRow[2].m_accumImpulse;
-//		bool isLateralFrictionInitialized = m_pointCache[insertIndex].m_lateralFrictionInitialized;
-		
-		
-			
-		btAssert(lifeTime>=0);
-		void* cache = m_pointCache[insertIndex].m_userPersistentData;
-		
-		m_pointCache[insertIndex] = newPoint;
-
-		m_pointCache[insertIndex].m_userPersistentData = cache;
-		m_pointCache[insertIndex].m_appliedImpulse = appliedImpulse;
-		m_pointCache[insertIndex].m_appliedImpulseLateral1 = appliedLateralImpulse1;
-		m_pointCache[insertIndex].m_appliedImpulseLateral2 = appliedLateralImpulse2;
-		
-		m_pointCache[insertIndex].mConstraintRow[0].m_accumImpulse =  appliedImpulse;
-		m_pointCache[insertIndex].mConstraintRow[1].m_accumImpulse = appliedLateralImpulse1;
-		m_pointCache[insertIndex].mConstraintRow[2].m_accumImpulse = appliedLateralImpulse2;
-
-
-		m_pointCache[insertIndex].m_lifeTime = lifeTime;
-#else
-		clearUserCache(m_pointCache[insertIndex]);
-		m_pointCache[insertIndex] = newPoint;
-	
-#endif
-	}
-
-	bool validContactDistance(const btManifoldPoint& pt) const
-	{
-		if (pt.m_lifeTime >1)
-		{
-			return pt.m_distance1 <= getContactBreakingThreshold();
-		}
-		return pt.m_distance1 <= getContactProcessingThreshold();
-	
-	}
-	/// calculated new worldspace coordinates and depth, and reject points that exceed the collision margin
-	void	refreshContactPoints(  const btTransform& trA,const btTransform& trB);
-
-	
-	SIMD_FORCE_INLINE	void	clearManifold()
-	{
-		int i;
-		for (i=0;i<m_cachedPoints;i++)
-		{
-			clearUserCache(m_pointCache[i]);
-		}
-		m_cachedPoints = 0;
-	}
-
-
-
-}
-;
-
-
-
-
-
-#endif //BT_PERSISTENT_MANIFOLD_H
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPointCollector.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPointCollector.h
deleted file mode 100644
index 18da171..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPointCollector.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_POINT_COLLECTOR_H
-#define BT_POINT_COLLECTOR_H
-
-#include "btDiscreteCollisionDetectorInterface.h"
-
-
-
-struct btPointCollector : public btDiscreteCollisionDetectorInterface::Result
-{
-	
-	
-	btVector3 m_normalOnBInWorld;
-	btVector3 m_pointInWorld;
-	btScalar	m_distance;//negative means penetration
-
-	bool	m_hasResult;
-
-	btPointCollector () 
-		: m_distance(btScalar(BT_LARGE_FLOAT)),m_hasResult(false)
-	{
-	}
-
-	virtual void setShapeIdentifiersA(int partId0,int index0)
-	{
-		(void)partId0;
-		(void)index0;
-			
-	}
-	virtual void setShapeIdentifiersB(int partId1,int index1)
-	{
-		(void)partId1;
-		(void)index1;
-	}
-
-	virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)
-	{
-		if (depth< m_distance)
-		{
-			m_hasResult = true;
-			m_normalOnBInWorld = normalOnBInWorld;
-			m_pointInWorld = pointInWorld;
-			//negative means penetration
-			m_distance = depth;
-		}
-	}
-};
-
-#endif //BT_POINT_COLLECTOR_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp
deleted file mode 100644
index 31fe7da..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2011 Advanced Micro Devices, Inc.  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-///This file was written by Erwin Coumans
-///Separating axis rest based on work from Pierre Terdiman, see
-///And contact clipping based on work from Simon Hobbs
-
-
-#include "btPolyhedralContactClipping.h"
-#include "BulletCollision/CollisionShapes/btConvexPolyhedron.h"
-
-#include <float.h> //for FLT_MAX
-
-
-// Clips a face to the back of a plane
-void btPolyhedralContactClipping::clipFace(const btVertexArray& pVtxIn, btVertexArray& ppVtxOut, const btVector3& planeNormalWS,btScalar planeEqWS)
-{
-	
-	int ve;
-	btScalar ds, de;
-	int numVerts = pVtxIn.size();
-	if (numVerts < 2)
-		return;
-
-	btVector3 firstVertex=pVtxIn[pVtxIn.size()-1];
-	btVector3 endVertex = pVtxIn[0];
-	
-	ds = planeNormalWS.dot(firstVertex)+planeEqWS;
-
-	for (ve = 0; ve < numVerts; ve++)
-	{
-		endVertex=pVtxIn[ve];
-
-		de = planeNormalWS.dot(endVertex)+planeEqWS;
-
-		if (ds<0)
-		{
-			if (de<0)
-			{
-				// Start < 0, end < 0, so output endVertex
-				ppVtxOut.push_back(endVertex);
-			}
-			else
-			{
-				// Start < 0, end >= 0, so output intersection
-				ppVtxOut.push_back( 	firstVertex.lerp(endVertex,btScalar(ds * 1.f/(ds - de))));
-			}
-		}
-		else
-		{
-			if (de<0)
-			{
-				// Start >= 0, end < 0 so output intersection and end
-				ppVtxOut.push_back(firstVertex.lerp(endVertex,btScalar(ds * 1.f/(ds - de))));
-				ppVtxOut.push_back(endVertex);
-			}
-		}
-		firstVertex = endVertex;
-		ds = de;
-	}
-}
-#include <stdio.h>
-
-
-static bool TestSepAxis(const btConvexPolyhedron& hullA, const btConvexPolyhedron& hullB, const btTransform& transA,const btTransform& transB, const btVector3& sep_axis, float& depth)
-{
-	float Min0,Max0;
-	float Min1,Max1;
-	hullA.project(transA,sep_axis, Min0, Max0);
-	hullB.project(transB, sep_axis, Min1, Max1);
-
-	if(Max0<Min1 || Max1<Min0)
-		return false;
-
-	float d0 = Max0 - Min1;
-	assert(d0>=0.0f);
-	float d1 = Max1 - Min0;
-	assert(d1>=0.0f);
-	depth = d0<d1 ? d0:d1;
-	return true;
-}
-
-
-
-static int gActualSATPairTests=0;
-
-inline bool IsAlmostZero(const btVector3& v)
-{
-	if(fabsf(v.x())>1e-6 || fabsf(v.y())>1e-6 || fabsf(v.z())>1e-6)	return false;
-	return true;
-}
-
-
-bool btPolyhedralContactClipping::findSeparatingAxis(	const btConvexPolyhedron& hullA, const btConvexPolyhedron& hullB, const btTransform& transA,const btTransform& transB, btVector3& sep)
-{
-	gActualSATPairTests++;
-
-#ifdef TEST_INTERNAL_OBJECTS
-	const btVector3 c0 = transA * hullA.mLocalCenter;
-	const btVector3 c1 = transB * hullB.mLocalCenter;
-	const btVector3 DeltaC2 = c0 - c1;
-#endif
-
-	float dmin = FLT_MAX;
-	int curPlaneTests=0;
-
-	int numFacesA = hullA.m_faces.size();
-	// Test normals from hullA
-	for(int i=0;i<numFacesA;i++)
-	{
-		const btVector3 Normal(hullA.m_faces[i].m_plane[0], hullA.m_faces[i].m_plane[1], hullA.m_faces[i].m_plane[2]);
-		const btVector3 faceANormalWS = transA.getBasis() * Normal;
-
-		curPlaneTests++;
-#ifdef TEST_INTERNAL_OBJECTS
-		gExpectedNbTests++;
-		if(gUseInternalObject && !TestInternalObjects(transA,transB,DeltaC2, faceANormalWS, hullA, hullB, dmin))
-			continue;
-		gActualNbTests++;
-#endif
-
-		float d;
-		if(!TestSepAxis( hullA, hullB, transA,transB, faceANormalWS, d))
-			return false;
-
-		if(d<dmin)
-		{
-			dmin = d;
-			sep = faceANormalWS;
-		}
-	}
-
-	int numFacesB = hullB.m_faces.size();
-	// Test normals from hullB
-	for(int i=0;i<numFacesB;i++)
-	{
-		const btVector3 Normal(hullB.m_faces[i].m_plane[0], hullB.m_faces[i].m_plane[1], hullB.m_faces[i].m_plane[2]);
-		const btVector3 WorldNormal = transB.getBasis() * Normal;
-
-		curPlaneTests++;
-#ifdef TEST_INTERNAL_OBJECTS
-		gExpectedNbTests++;
-		if(gUseInternalObject && !TestInternalObjects(transA,transB,DeltaC2, WorldNormal, hullA, hullB, dmin))
-			continue;
-		gActualNbTests++;
-#endif
-
-		float d;
-		if(!TestSepAxis(hullA, hullB,transA,transB, WorldNormal,d))
-			return false;
-
-		if(d<dmin)
-		{
-			dmin = d;
-			sep = WorldNormal;
-		}
-	}
-
-	btVector3 edgeAstart,edgeAend,edgeBstart,edgeBend;
-
-	int curEdgeEdge = 0;
-	// Test edges
-	for(int e0=0;e0<hullA.m_uniqueEdges.size();e0++)
-	{
-		const btVector3 edge0 = hullA.m_uniqueEdges[e0];
-		const btVector3 WorldEdge0 = transA.getBasis() * edge0;
-		for(int e1=0;e1<hullB.m_uniqueEdges.size();e1++)
-		{
-			const btVector3 edge1 = hullB.m_uniqueEdges[e1];
-			const btVector3 WorldEdge1 = transB.getBasis() * edge1;
-
-			btVector3 Cross = WorldEdge0.cross(WorldEdge1);
-			curEdgeEdge++;
-			if(!IsAlmostZero(Cross))
-			{
-				Cross = Cross.normalize();
-
-#ifdef TEST_INTERNAL_OBJECTS
-				gExpectedNbTests++;
-				if(gUseInternalObject && !TestInternalObjects(transA,transB,DeltaC2, Cross, hullA, hullB, dmin))
-					continue;
-				gActualNbTests++;
-#endif
-
-				float dist;
-				if(!TestSepAxis( hullA, hullB, transA,transB, Cross, dist))
-					return false;
-
-				if(dist<dmin)
-				{
-					dmin = dist;
-					sep = Cross;
-				}
-			}
-		}
-
-	}
-
-	const btVector3 deltaC = transB.getOrigin() - transA.getOrigin();
-	if((deltaC.dot(sep))>0.0f)
-		sep = -sep;
-
-	return true;
-}
-
-void	btPolyhedralContactClipping::clipFaceAgainstHull(const btVector3& separatingNormal, const btConvexPolyhedron& hullA,  const btTransform& transA, btVertexArray& worldVertsB1, const btScalar minDist, btScalar maxDist,btDiscreteCollisionDetectorInterface::Result& resultOut)
-{
-	btVertexArray worldVertsB2;
-	btVertexArray* pVtxIn = &worldVertsB1;
-	btVertexArray* pVtxOut = &worldVertsB2;
-	pVtxOut->reserve(pVtxIn->size());
-
-	int closestFaceA=-1;
-	{
-		btScalar dmin = FLT_MAX;
-		for(int face=0;face<hullA.m_faces.size();face++)
-		{
-			const btVector3 Normal(hullA.m_faces[face].m_plane[0], hullA.m_faces[face].m_plane[1], hullA.m_faces[face].m_plane[2]);
-			const btVector3 faceANormalWS = transA.getBasis() * Normal;
-		
-			btScalar d = faceANormalWS.dot(separatingNormal);
-			if (d < dmin)
-			{
-				dmin = d;
-				closestFaceA = face;
-			}
-		}
-	}
-	if (closestFaceA<0)
-		return;
-
-	const btFace& polyA = hullA.m_faces[closestFaceA];
-
-		// clip polygon to back of planes of all faces of hull A that are adjacent to witness face
-	int numContacts = pVtxIn->size();
-	int numVerticesA = polyA.m_indices.size();
-	for(int e0=0;e0<numVerticesA;e0++)
-	{
-		/*const btVector3& a = hullA.m_vertices[polyA.m_indices[e0]];
-		const btVector3& b = hullA.m_vertices[polyA.m_indices[(e0+1)%numVerticesA]];
-		const btVector3 edge0 = a - b;
-		const btVector3 WorldEdge0 = transA.getBasis() * edge0;
-		*/
-
-		int otherFace = polyA.m_connectedFaces[e0];
-		btVector3 localPlaneNormal (hullA.m_faces[otherFace].m_plane[0],hullA.m_faces[otherFace].m_plane[1],hullA.m_faces[otherFace].m_plane[2]);
-		btScalar localPlaneEq = hullA.m_faces[otherFace].m_plane[3];
-
-		btVector3 planeNormalWS = transA.getBasis()*localPlaneNormal;
-		btScalar planeEqWS=localPlaneEq-planeNormalWS.dot(transA.getOrigin());
-		//clip face
-
-		clipFace(*pVtxIn, *pVtxOut,planeNormalWS,planeEqWS);
-		btSwap(pVtxIn,pVtxOut);
-		pVtxOut->resize(0);
-	}
-
-
-
-//#define ONLY_REPORT_DEEPEST_POINT
-
-	btVector3 point;
-	
-
-	// only keep points that are behind the witness face
-	{
-		btVector3 localPlaneNormal (polyA.m_plane[0],polyA.m_plane[1],polyA.m_plane[2]);
-		btScalar localPlaneEq = polyA.m_plane[3];
-		btVector3 planeNormalWS = transA.getBasis()*localPlaneNormal;
-		btScalar planeEqWS=localPlaneEq-planeNormalWS.dot(transA.getOrigin());
-		for (int i=0;i<pVtxIn->size();i++)
-		{
-			
-			btScalar depth = planeNormalWS.dot(pVtxIn->at(i))+planeEqWS;
-			if (depth <=maxDist && depth >=minDist)
-			{
-				btVector3 point = pVtxIn->at(i);
-#ifdef ONLY_REPORT_DEEPEST_POINT
-				curMaxDist = depth;
-#else
-#if 0
-				if (depth<-3)
-				{
-					printf("error in btPolyhedralContactClipping depth = %f\n", depth);
-					printf("likely wrong separatingNormal passed in\n");
-				} 
-#endif				
-				resultOut.addContactPoint(separatingNormal,point,depth);
-#endif
-			}
-		}
-	}
-#ifdef ONLY_REPORT_DEEPEST_POINT
-	if (curMaxDist<maxDist)
-	{
-		resultOut.addContactPoint(separatingNormal,point,curMaxDist);
-	}
-#endif //ONLY_REPORT_DEEPEST_POINT
-
-}
-
-void	btPolyhedralContactClipping::clipHullAgainstHull(const btVector3& separatingNormal, const btConvexPolyhedron& hullA, const btConvexPolyhedron& hullB, const btTransform& transA,const btTransform& transB, const btScalar minDist, btScalar maxDist,btDiscreteCollisionDetectorInterface::Result& resultOut)
-{
-
-	btScalar curMaxDist=maxDist;
-	int closestFaceB=-1;
-
-	{
-		btScalar dmax = -FLT_MAX;
-		for(int face=0;face<hullB.m_faces.size();face++)
-		{
-			const btVector3 Normal(hullB.m_faces[face].m_plane[0], hullB.m_faces[face].m_plane[1], hullB.m_faces[face].m_plane[2]);
-			const btVector3 WorldNormal = transB.getBasis() * Normal;
-
-			btScalar d = WorldNormal.dot(separatingNormal);
-			if (d > dmax)
-			{
-				dmax = d;
-				closestFaceB = face;
-			}
-		}
-	}
-
-
-
-	if (closestFaceB<0)
-	{
-		return;
-	}
-
-
-
-	// setup initial clip face (minimizing face from hull B)
-	btVertexArray worldVertsB1;
-	{
-		const btFace& polyB = hullB.m_faces[closestFaceB];
-		const int numVertices = polyB.m_indices.size();
-		for(int e0=0;e0<numVertices;e0++)
-		{
-			const btVector3& b = hullB.m_vertices[polyB.m_indices[e0]];
-			worldVertsB1.push_back(transB*b);
-		}
-	}
-
-	clipFaceAgainstHull(separatingNormal, hullA, transA,worldVertsB1, minDist, maxDist,resultOut);
-
-}
\ No newline at end of file
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.h
deleted file mode 100644
index 7ab9c1e..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2011 Advanced Micro Devices, Inc.  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-///This file was written by Erwin Coumans
-
-
-#ifndef BT_POLYHEDRAL_CONTACT_CLIPPING_H
-#define BT_POLYHEDRAL_CONTACT_CLIPPING_H
-
-
-#include "LinearMath/btAlignedObjectArray.h"
-#include "LinearMath/btTransform.h"
-#include "btDiscreteCollisionDetectorInterface.h"
-
-class btConvexPolyhedron;
-
-typedef btAlignedObjectArray<btVector3> btVertexArray;
-
-// Clips a face to the back of a plane
-struct btPolyhedralContactClipping
-{
-	static void clipHullAgainstHull(const btVector3& separatingNormal, const btConvexPolyhedron& hullA, const btConvexPolyhedron& hullB, const btTransform& transA,const btTransform& transB, const btScalar minDist, btScalar maxDist, btDiscreteCollisionDetectorInterface::Result& resultOut);
-	static void	clipFaceAgainstHull(const btVector3& separatingNormal, const btConvexPolyhedron& hullA,  const btTransform& transA, btVertexArray& worldVertsB1, const btScalar minDist, btScalar maxDist,btDiscreteCollisionDetectorInterface::Result& resultOut);
-
-	static bool findSeparatingAxis(	const btConvexPolyhedron& hullA, const btConvexPolyhedron& hullB, const btTransform& transA,const btTransform& transB, btVector3& sep);
-
-	///the clipFace method is used internally
-	static void clipFace(const btVertexArray& pVtxIn, btVertexArray& ppVtxOut, const btVector3& planeNormalWS,btScalar planeEqWS);
-
-};
-
-#endif // BT_POLYHEDRAL_CONTACT_CLIPPING_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
deleted file mode 100644
index fbe579c..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-//#include <stdio.h>
-
-#include "BulletCollision/CollisionShapes/btConvexShape.h"
-#include "BulletCollision/CollisionShapes/btTriangleShape.h"
-#include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h"
-#include "BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h"
-#include "BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h"
-#include "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h"
-#include "btRaycastCallback.h"
-
-btTriangleRaycastCallback::btTriangleRaycastCallback(const btVector3& from,const btVector3& to, unsigned int flags)
-	:
-	m_from(from),
-	m_to(to),
-   //@BP Mod
-   m_flags(flags),
-	m_hitFraction(btScalar(1.))
-{
-
-}
-
-
-
-void btTriangleRaycastCallback::processTriangle(btVector3* triangle,int partId, int triangleIndex)
-{
-	const btVector3 &vert0=triangle[0];
-	const btVector3 &vert1=triangle[1];
-	const btVector3 &vert2=triangle[2];
-
-	btVector3 v10; v10 = vert1 - vert0 ;
-	btVector3 v20; v20 = vert2 - vert0 ;
-
-	btVector3 triangleNormal; triangleNormal = v10.cross( v20 );
-	
-	const btScalar dist = vert0.dot(triangleNormal);
-	btScalar dist_a = triangleNormal.dot(m_from) ;
-	dist_a-= dist;
-	btScalar dist_b = triangleNormal.dot(m_to);
-	dist_b -= dist;
-
-	if ( dist_a * dist_b >= btScalar(0.0) )
-	{
-		return ; // same sign
-	}
-   //@BP Mod - Backface filtering
-   if (((m_flags & kF_FilterBackfaces) != 0) && (dist_a > btScalar(0.0)))
-   {
-      // Backface, skip check
-      return;
-   }
-	
-	const btScalar proj_length=dist_a-dist_b;
-	const btScalar distance = (dist_a)/(proj_length);
-	// Now we have the intersection point on the plane, we'll see if it's inside the triangle
-	// Add an epsilon as a tolerance for the raycast,
-	// in case the ray hits exacly on the edge of the triangle.
-	// It must be scaled for the triangle size.
-	
-	if(distance < m_hitFraction)
-	{
-		
-
-		btScalar edge_tolerance =triangleNormal.length2();		
-		edge_tolerance *= btScalar(-0.0001);
-		btVector3 point; point.setInterpolate3( m_from, m_to, distance);
-		{
-			btVector3 v0p; v0p = vert0 - point;
-			btVector3 v1p; v1p = vert1 - point;
-			btVector3 cp0; cp0 = v0p.cross( v1p );
-
-			if ( (btScalar)(cp0.dot(triangleNormal)) >=edge_tolerance) 
-			{
-						
-
-				btVector3 v2p; v2p = vert2 -  point;
-				btVector3 cp1;
-				cp1 = v1p.cross( v2p);
-				if ( (btScalar)(cp1.dot(triangleNormal)) >=edge_tolerance) 
-				{
-					btVector3 cp2;
-					cp2 = v2p.cross(v0p);
-					
-					if ( (btScalar)(cp2.dot(triangleNormal)) >=edge_tolerance) 
-					{
-                  //@BP Mod
-                  // Triangle normal isn't normalized
-				      triangleNormal.normalize();
-
-                  //@BP Mod - Allow for unflipped normal when raycasting against backfaces
-                  if (((m_flags & kF_KeepUnflippedNormal) != 0) || (dist_a <= btScalar(0.0)))
-						{
-							m_hitFraction = reportHit(-triangleNormal,distance,partId,triangleIndex);
-						}
-						else
-						{
-                     m_hitFraction = reportHit(triangleNormal,distance,partId,triangleIndex);
-						}
-					}
-				}
-			}
-		}
-	}
-}
-
-
-btTriangleConvexcastCallback::btTriangleConvexcastCallback (const btConvexShape* convexShape, const btTransform& convexShapeFrom, const btTransform& convexShapeTo, const btTransform& triangleToWorld, const btScalar triangleCollisionMargin)
-{
-	m_convexShape = convexShape;
-	m_convexShapeFrom = convexShapeFrom;
-	m_convexShapeTo = convexShapeTo;
-	m_triangleToWorld = triangleToWorld;
-	m_hitFraction = 1.0f;
-	m_triangleCollisionMargin = triangleCollisionMargin;
-	m_allowedPenetration = 0.f;
-}
-
-void
-btTriangleConvexcastCallback::processTriangle (btVector3* triangle, int partId, int triangleIndex)
-{
-	btTriangleShape triangleShape (triangle[0], triangle[1], triangle[2]);
-    triangleShape.setMargin(m_triangleCollisionMargin);
-
-	btVoronoiSimplexSolver	simplexSolver;
-	btGjkEpaPenetrationDepthSolver	gjkEpaPenetrationSolver;
-
-//#define  USE_SUBSIMPLEX_CONVEX_CAST 1
-//if you reenable USE_SUBSIMPLEX_CONVEX_CAST see commented out code below
-#ifdef USE_SUBSIMPLEX_CONVEX_CAST
-	btSubsimplexConvexCast convexCaster(m_convexShape, &triangleShape, &simplexSolver);
-#else
-	//btGjkConvexCast	convexCaster(m_convexShape,&triangleShape,&simplexSolver);
-	btContinuousConvexCollision convexCaster(m_convexShape,&triangleShape,&simplexSolver,&gjkEpaPenetrationSolver);
-#endif //#USE_SUBSIMPLEX_CONVEX_CAST
-	
-	btConvexCast::CastResult castResult;
-	castResult.m_fraction = btScalar(1.);
-	castResult.m_allowedPenetration = m_allowedPenetration;
-	if (convexCaster.calcTimeOfImpact(m_convexShapeFrom,m_convexShapeTo,m_triangleToWorld, m_triangleToWorld, castResult))
-	{
-		//add hit
-		if (castResult.m_normal.length2() > btScalar(0.0001))
-		{					
-			if (castResult.m_fraction < m_hitFraction)
-			{
-/* btContinuousConvexCast's normal is already in world space */
-/*
-#ifdef USE_SUBSIMPLEX_CONVEX_CAST
-				//rotate normal into worldspace
-				castResult.m_normal = m_convexShapeFrom.getBasis() * castResult.m_normal;
-#endif //USE_SUBSIMPLEX_CONVEX_CAST
-*/
-				castResult.m_normal.normalize();
-
-				reportHit (castResult.m_normal,
-							castResult.m_hitPoint,
-							castResult.m_fraction,
-							partId,
-							triangleIndex);
-			}
-		}
-	}
-}
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h
deleted file mode 100644
index f012889..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_RAYCAST_TRI_CALLBACK_H
-#define BT_RAYCAST_TRI_CALLBACK_H
-
-#include "BulletCollision/CollisionShapes/btTriangleCallback.h"
-#include "LinearMath/btTransform.h"
-struct btBroadphaseProxy;
-class btConvexShape;
-
-class  btTriangleRaycastCallback: public btTriangleCallback
-{
-public:
-
-	//input
-	btVector3 m_from;
-	btVector3 m_to;
-
-   //@BP Mod - allow backface filtering and unflipped normals
-   enum EFlags
-   {
-      kF_None                 = 0,
-      kF_FilterBackfaces      = 1 << 0,
-      kF_KeepUnflippedNormal  = 1 << 1,   // Prevents returned face normal getting flipped when a ray hits a back-facing triangle
-
-      kF_Terminator        = 0xFFFFFFFF
-   };
-   unsigned int m_flags;
-
-	btScalar	m_hitFraction;
-
-	btTriangleRaycastCallback(const btVector3& from,const btVector3& to, unsigned int flags=0);
-	
-	virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex);
-
-	virtual btScalar reportHit(const btVector3& hitNormalLocal, btScalar hitFraction, int partId, int triangleIndex ) = 0;
-	
-};
-
-class btTriangleConvexcastCallback : public btTriangleCallback
-{
-public:
-	const btConvexShape* m_convexShape;
-	btTransform m_convexShapeFrom;
-	btTransform m_convexShapeTo;
-	btTransform m_triangleToWorld;
-	btScalar m_hitFraction;
-	btScalar m_triangleCollisionMargin;
-	btScalar m_allowedPenetration;
-
-	btTriangleConvexcastCallback (const btConvexShape* convexShape, const btTransform& convexShapeFrom, const btTransform& convexShapeTo, const btTransform& triangleToWorld, const btScalar triangleCollisionMargin);
-
-	virtual void processTriangle (btVector3* triangle, int partId, int triangleIndex);
-
-	virtual btScalar reportHit (const btVector3& hitNormalLocal, const btVector3& hitPointLocal, btScalar hitFraction, int partId, int triangleIndex) = 0;
-};
-
-#endif //BT_RAYCAST_TRI_CALLBACK_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h
deleted file mode 100644
index da8a139..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-#ifndef BT_SIMPLEX_SOLVER_INTERFACE_H
-#define BT_SIMPLEX_SOLVER_INTERFACE_H
-
-#include "LinearMath/btVector3.h"
-
-#define NO_VIRTUAL_INTERFACE 1
-#ifdef NO_VIRTUAL_INTERFACE
-#include "btVoronoiSimplexSolver.h"
-#define btSimplexSolverInterface btVoronoiSimplexSolver
-#else
-
-/// btSimplexSolverInterface can incrementally calculate distance between origin and up to 4 vertices
-/// Used by GJK or Linear Casting. Can be implemented by the Johnson-algorithm or alternative approaches based on
-/// voronoi regions or barycentric coordinates
-class btSimplexSolverInterface
-{
-	public:
-		virtual ~btSimplexSolverInterface() {};
-
-	virtual void reset() = 0;
-
-	virtual void addVertex(const btVector3& w, const btVector3& p, const btVector3& q) = 0;
-	
-	virtual bool closest(btVector3& v) = 0;
-
-	virtual btScalar maxVertex() = 0;
-
-	virtual bool fullSimplex() const = 0;
-
-	virtual int getSimplex(btVector3 *pBuf, btVector3 *qBuf, btVector3 *yBuf) const = 0;
-
-	virtual bool inSimplex(const btVector3& w) = 0;
-	
-	virtual void backup_closest(btVector3& v) = 0;
-
-	virtual bool emptySimplex() const = 0;
-
-	virtual void compute_points(btVector3& p1, btVector3& p2) = 0;
-
-	virtual int numVertices() const =0;
-
-
-};
-#endif
-#endif //BT_SIMPLEX_SOLVER_INTERFACE_H
-
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp
deleted file mode 100644
index 18eb662..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "btSubSimplexConvexCast.h"
-#include "BulletCollision/CollisionShapes/btConvexShape.h"
-
-#include "BulletCollision/CollisionShapes/btMinkowskiSumShape.h"
-#include "BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h"
-#include "btPointCollector.h"
-#include "LinearMath/btTransformUtil.h"
-
-btSubsimplexConvexCast::btSubsimplexConvexCast (const btConvexShape* convexA,const btConvexShape* convexB,btSimplexSolverInterface* simplexSolver)
-:m_simplexSolver(simplexSolver),
-m_convexA(convexA),m_convexB(convexB)
-{
-}
-
-///Typically the conservative advancement reaches solution in a few iterations, clip it to 32 for degenerate cases.
-///See discussion about this here http://continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=565
-#ifdef BT_USE_DOUBLE_PRECISION
-#define MAX_ITERATIONS 64
-#else
-#define MAX_ITERATIONS 32
-#endif
-bool	btSubsimplexConvexCast::calcTimeOfImpact(
-		const btTransform& fromA,
-		const btTransform& toA,
-		const btTransform& fromB,
-		const btTransform& toB,
-		CastResult& result)
-{
-
-	m_simplexSolver->reset();
-
-	btVector3 linVelA,linVelB;
-	linVelA = toA.getOrigin()-fromA.getOrigin();
-	linVelB = toB.getOrigin()-fromB.getOrigin();
-
-	btScalar lambda = btScalar(0.);
-
-	btTransform interpolatedTransA = fromA;
-	btTransform interpolatedTransB = fromB;
-
-	///take relative motion
-	btVector3 r = (linVelA-linVelB);
-	btVector3 v;
-	
-	btVector3 supVertexA = fromA(m_convexA->localGetSupportingVertex(-r*fromA.getBasis()));
-	btVector3 supVertexB = fromB(m_convexB->localGetSupportingVertex(r*fromB.getBasis()));
-	v = supVertexA-supVertexB;
-	int maxIter = MAX_ITERATIONS;
-
-	btVector3 n;
-	n.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
-	bool hasResult = false;
-	btVector3 c;
-
-	btScalar lastLambda = lambda;
-
-
-	btScalar dist2 = v.length2();
-#ifdef BT_USE_DOUBLE_PRECISION
-	btScalar epsilon = btScalar(0.0001);
-#else
-	btScalar epsilon = btScalar(0.0001);
-#endif //BT_USE_DOUBLE_PRECISION
-	btVector3	w,p;
-	btScalar VdotR;
-	
-	while ( (dist2 > epsilon) && maxIter--)
-	{
-		supVertexA = interpolatedTransA(m_convexA->localGetSupportingVertex(-v*interpolatedTransA.getBasis()));
-		supVertexB = interpolatedTransB(m_convexB->localGetSupportingVertex(v*interpolatedTransB.getBasis()));
-		w = supVertexA-supVertexB;
-
-		btScalar VdotW = v.dot(w);
-
-		if (lambda > btScalar(1.0))
-		{
-			return false;
-		}
-
-		if ( VdotW > btScalar(0.))
-		{
-			VdotR = v.dot(r);
-
-			if (VdotR >= -(SIMD_EPSILON*SIMD_EPSILON))
-				return false;
-			else
-			{
-				lambda = lambda - VdotW / VdotR;
-				//interpolate to next lambda
-				//	x = s + lambda * r;
-				interpolatedTransA.getOrigin().setInterpolate3(fromA.getOrigin(),toA.getOrigin(),lambda);
-				interpolatedTransB.getOrigin().setInterpolate3(fromB.getOrigin(),toB.getOrigin(),lambda);
-				//m_simplexSolver->reset();
-				//check next line
-				 w = supVertexA-supVertexB;
-				lastLambda = lambda;
-				n = v;
-				hasResult = true;
-			}
-		} 
-		///Just like regular GJK only add the vertex if it isn't already (close) to current vertex, it would lead to divisions by zero and NaN etc.
-		if (!m_simplexSolver->inSimplex(w))
-			m_simplexSolver->addVertex( w, supVertexA , supVertexB);
-
-		if (m_simplexSolver->closest(v))
-		{
-			dist2 = v.length2();
-			hasResult = true;
-			//todo: check this normal for validity
-			//n=v;
-			//printf("V=%f , %f, %f\n",v[0],v[1],v[2]);
-			//printf("DIST2=%f\n",dist2);
-			//printf("numverts = %i\n",m_simplexSolver->numVertices());
-		} else
-		{
-			dist2 = btScalar(0.);
-		} 
-	}
-
-	//int numiter = MAX_ITERATIONS - maxIter;
-//	printf("number of iterations: %d", numiter);
-	
-	//don't report a time of impact when moving 'away' from the hitnormal
-	
-
-	result.m_fraction = lambda;
-	if (n.length2() >= (SIMD_EPSILON*SIMD_EPSILON))
-		result.m_normal = n.normalized();
-	else
-		result.m_normal = btVector3(btScalar(0.0), btScalar(0.0), btScalar(0.0));
-
-	//don't report time of impact for motion away from the contact normal (or causes minor penetration)
-	if (result.m_normal.dot(r)>=-result.m_allowedPenetration)
-		return false;
-
-	btVector3 hitA,hitB;
-	m_simplexSolver->compute_points(hitA,hitB);
-	result.m_hitPoint=hitB;
-	return true;
-}
-
-
-
-
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h
deleted file mode 100644
index 6c81279..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef BT_SUBSIMPLEX_CONVEX_CAST_H
-#define BT_SUBSIMPLEX_CONVEX_CAST_H
-
-#include "btConvexCast.h"
-#include "btSimplexSolverInterface.h"
-class btConvexShape;
-
-/// btSubsimplexConvexCast implements Gino van den Bergens' paper
-///"Ray Casting against bteral Convex Objects with Application to Continuous Collision Detection"
-/// GJK based Ray Cast, optimized version
-/// Objects should not start in overlap, otherwise results are not defined.
-class btSubsimplexConvexCast : public btConvexCast
-{
-	btSimplexSolverInterface* m_simplexSolver;
-	const btConvexShape*	m_convexA;
-	const btConvexShape*	m_convexB;
-
-public:
-
-	btSubsimplexConvexCast (const btConvexShape*	shapeA,const btConvexShape*	shapeB,btSimplexSolverInterface* simplexSolver);
-
-	//virtual ~btSubsimplexConvexCast();
-	///SimsimplexConvexCast calculateTimeOfImpact calculates the time of impact+normal for the linear cast (sweep) between two moving objects.
-	///Precondition is that objects should not penetration/overlap at the start from the interval. Overlap can be tested using btGjkPairDetector.
-	virtual bool	calcTimeOfImpact(
-			const btTransform& fromA,
-			const btTransform& toA,
-			const btTransform& fromB,
-			const btTransform& toB,
-			CastResult& result);
-
-};
-
-#endif //BT_SUBSIMPLEX_CONVEX_CAST_H
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp
deleted file mode 100644
index a775198..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp
+++ /dev/null
@@ -1,609 +0,0 @@
-
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-	
-	Elsevier CDROM license agreements grants nonexclusive license to use the software
-	for any purpose, commercial or non-commercial as long as the following credit is included
-	identifying the original source of the software:
-
-	Parts of the source are "from the book Real-Time Collision Detection by
-	Christer Ericson, published by Morgan Kaufmann Publishers,
-	(c) 2005 Elsevier Inc."
-		
-*/
-
-
-#include "btVoronoiSimplexSolver.h"
-
-#define VERTA  0
-#define VERTB  1
-#define VERTC  2
-#define VERTD  3
-
-#define CATCH_DEGENERATE_TETRAHEDRON 1
-void	btVoronoiSimplexSolver::removeVertex(int index)
-{
-	
-	btAssert(m_numVertices>0);
-	m_numVertices--;
-	m_simplexVectorW[index] = m_simplexVectorW[m_numVertices];
-	m_simplexPointsP[index] = m_simplexPointsP[m_numVertices];
-	m_simplexPointsQ[index] = m_simplexPointsQ[m_numVertices];
-}
-
-void	btVoronoiSimplexSolver::reduceVertices (const btUsageBitfield& usedVerts)
-{
-	if ((numVertices() >= 4) && (!usedVerts.usedVertexD))
-		removeVertex(3);
-
-	if ((numVertices() >= 3) && (!usedVerts.usedVertexC))
-		removeVertex(2);
-
-	if ((numVertices() >= 2) && (!usedVerts.usedVertexB))
-		removeVertex(1);
-	
-	if ((numVertices() >= 1) && (!usedVerts.usedVertexA))
-		removeVertex(0);
-
-}
-
-
-
-
-
-//clear the simplex, remove all the vertices
-void btVoronoiSimplexSolver::reset()
-{
-	m_cachedValidClosest = false;
-	m_numVertices = 0;
-	m_needsUpdate = true;
-	m_lastW = btVector3(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
-	m_cachedBC.reset();
-}
-
-
-
-	//add a vertex
-void btVoronoiSimplexSolver::addVertex(const btVector3& w, const btVector3& p, const btVector3& q)
-{
-	m_lastW = w;
-	m_needsUpdate = true;
-
-	m_simplexVectorW[m_numVertices] = w;
-	m_simplexPointsP[m_numVertices] = p;
-	m_simplexPointsQ[m_numVertices] = q;
-
-	m_numVertices++;
-}
-
-bool	btVoronoiSimplexSolver::updateClosestVectorAndPoints()
-{
-	
-	if (m_needsUpdate)
-	{
-		m_cachedBC.reset();
-
-		m_needsUpdate = false;
-
-		switch (numVertices())
-		{
-		case 0:
-				m_cachedValidClosest = false;
-				break;
-		case 1:
-			{
-				m_cachedP1 = m_simplexPointsP[0];
-				m_cachedP2 = m_simplexPointsQ[0];
-				m_cachedV = m_cachedP1-m_cachedP2; //== m_simplexVectorW[0]
-				m_cachedBC.reset();
-				m_cachedBC.setBarycentricCoordinates(btScalar(1.),btScalar(0.),btScalar(0.),btScalar(0.));
-				m_cachedValidClosest = m_cachedBC.isValid();
-				break;
-			};
-		case 2:
-			{
-			//closest point origin from line segment
-					const btVector3& from = m_simplexVectorW[0];
-					const btVector3& to = m_simplexVectorW[1];
-					btVector3 nearest;
-
-					btVector3 p (btScalar(0.),btScalar(0.),btScalar(0.));
-					btVector3 diff = p - from;
-					btVector3 v = to - from;
-					btScalar t = v.dot(diff);
-					
-					if (t > 0) {
-						btScalar dotVV = v.dot(v);
-						if (t < dotVV) {
-							t /= dotVV;
-							diff -= t*v;
-							m_cachedBC.m_usedVertices.usedVertexA = true;
-							m_cachedBC.m_usedVertices.usedVertexB = true;
-						} else {
-							t = 1;
-							diff -= v;
-							//reduce to 1 point
-							m_cachedBC.m_usedVertices.usedVertexB = true;
-						}
-					} else
-					{
-						t = 0;
-						//reduce to 1 point
-						m_cachedBC.m_usedVertices.usedVertexA = true;
-					}
-					m_cachedBC.setBarycentricCoordinates(1-t,t);
-					nearest = from + t*v;
-
-					m_cachedP1 = m_simplexPointsP[0] + t * (m_simplexPointsP[1] - m_simplexPointsP[0]);
-					m_cachedP2 = m_simplexPointsQ[0] + t * (m_simplexPointsQ[1] - m_simplexPointsQ[0]);
-					m_cachedV = m_cachedP1 - m_cachedP2;
-					
-					reduceVertices(m_cachedBC.m_usedVertices);
-
-					m_cachedValidClosest = m_cachedBC.isValid();
-					break;
-			}
-		case 3: 
-			{ 
-				//closest point origin from triangle 
-				btVector3 p (btScalar(0.),btScalar(0.),btScalar(0.)); 
-
-				const btVector3& a = m_simplexVectorW[0]; 
-				const btVector3& b = m_simplexVectorW[1]; 
-				const btVector3& c = m_simplexVectorW[2]; 
-
-				closestPtPointTriangle(p,a,b,c,m_cachedBC); 
-				m_cachedP1 = m_simplexPointsP[0] * m_cachedBC.m_barycentricCoords[0] + 
-				m_simplexPointsP[1] * m_cachedBC.m_barycentricCoords[1] + 
-				m_simplexPointsP[2] * m_cachedBC.m_barycentricCoords[2]; 
-
-				m_cachedP2 = m_simplexPointsQ[0] * m_cachedBC.m_barycentricCoords[0] + 
-				m_simplexPointsQ[1] * m_cachedBC.m_barycentricCoords[1] + 
-				m_simplexPointsQ[2] * m_cachedBC.m_barycentricCoords[2]; 
-
-				m_cachedV = m_cachedP1-m_cachedP2; 
-
-				reduceVertices (m_cachedBC.m_usedVertices); 
-				m_cachedValidClosest = m_cachedBC.isValid(); 
-
-				break; 
-			}
-		case 4:
-			{
-
-				
-				btVector3 p (btScalar(0.),btScalar(0.),btScalar(0.));
-				
-				const btVector3& a = m_simplexVectorW[0];
-				const btVector3& b = m_simplexVectorW[1];
-				const btVector3& c = m_simplexVectorW[2];
-				const btVector3& d = m_simplexVectorW[3];
-
-				bool hasSeperation = closestPtPointTetrahedron(p,a,b,c,d,m_cachedBC);
-
-				if (hasSeperation)
-				{
-
-					m_cachedP1 = m_simplexPointsP[0] * m_cachedBC.m_barycentricCoords[0] +
-						m_simplexPointsP[1] * m_cachedBC.m_barycentricCoords[1] +
-						m_simplexPointsP[2] * m_cachedBC.m_barycentricCoords[2] +
-						m_simplexPointsP[3] * m_cachedBC.m_barycentricCoords[3];
-
-					m_cachedP2 = m_simplexPointsQ[0] * m_cachedBC.m_barycentricCoords[0] +
-						m_simplexPointsQ[1] * m_cachedBC.m_barycentricCoords[1] +
-						m_simplexPointsQ[2] * m_cachedBC.m_barycentricCoords[2] +
-						m_simplexPointsQ[3] * m_cachedBC.m_barycentricCoords[3];
-
-					m_cachedV = m_cachedP1-m_cachedP2;
-					reduceVertices (m_cachedBC.m_usedVertices);
-				} else
-				{
-//					printf("sub distance got penetration\n");
-
-					if (m_cachedBC.m_degenerate)
-					{
-						m_cachedValidClosest = false;
-					} else
-					{
-						m_cachedValidClosest = true;
-						//degenerate case == false, penetration = true + zero
-						m_cachedV.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
-					}
-					break;
-				}
-
-				m_cachedValidClosest = m_cachedBC.isValid();
-
-				//closest point origin from tetrahedron
-				break;
-			}
-		default:
-			{
-				m_cachedValidClosest = false;
-			}
-		};
-	}
-
-	return m_cachedValidClosest;
-
-}
-
-//return/calculate the closest vertex
-bool btVoronoiSimplexSolver::closest(btVector3& v)
-{
-	bool succes = updateClosestVectorAndPoints();
-	v = m_cachedV;
-	return succes;
-}
-
-
-
-btScalar btVoronoiSimplexSolver::maxVertex()
-{
-	int i, numverts = numVertices();
-	btScalar maxV = btScalar(0.);
-	for (i=0;i<numverts;i++)
-	{
-		btScalar curLen2 = m_simplexVectorW[i].length2();
-		if (maxV < curLen2)
-			maxV = curLen2;
-	}
-	return maxV;
-}
-
-
-
-	//return the current simplex
-int btVoronoiSimplexSolver::getSimplex(btVector3 *pBuf, btVector3 *qBuf, btVector3 *yBuf) const
-{
-	int i;
-	for (i=0;i<numVertices();i++)
-	{
-		yBuf[i] = m_simplexVectorW[i];
-		pBuf[i] = m_simplexPointsP[i];
-		qBuf[i] = m_simplexPointsQ[i];
-	}
-	return numVertices();
-}
-
-
-
-
-bool btVoronoiSimplexSolver::inSimplex(const btVector3& w)
-{
-	bool found = false;
-	int i, numverts = numVertices();
-	//btScalar maxV = btScalar(0.);
-	
-	//w is in the current (reduced) simplex
-	for (i=0;i<numverts;i++)
-	{
-#ifdef BT_USE_EQUAL_VERTEX_THRESHOLD
-		if ( m_simplexVectorW[i].distance2(w) <= m_equalVertexThreshold)
-#else
-		if (m_simplexVectorW[i] == w)
-#endif
-			found = true;
-	}
-
-	//check in case lastW is already removed
-	if (w == m_lastW)
-		return true;
-    	
-	return found;
-}
-
-void btVoronoiSimplexSolver::backup_closest(btVector3& v) 
-{
-	v = m_cachedV;
-}
-
-
-bool btVoronoiSimplexSolver::emptySimplex() const 
-{
-	return (numVertices() == 0);
-
-}
-
-void btVoronoiSimplexSolver::compute_points(btVector3& p1, btVector3& p2) 
-{
-	updateClosestVectorAndPoints();
-	p1 = m_cachedP1;
-	p2 = m_cachedP2;
-
-}
-
-
-
-
-bool	btVoronoiSimplexSolver::closestPtPointTriangle(const btVector3& p, const btVector3& a, const btVector3& b, const btVector3& c,btSubSimplexClosestResult& result)
-{
-	result.m_usedVertices.reset();
-
-    // Check if P in vertex region outside A
-    btVector3 ab = b - a;
-    btVector3 ac = c - a;
-    btVector3 ap = p - a;
-    btScalar d1 = ab.dot(ap);
-    btScalar d2 = ac.dot(ap);
-    if (d1 <= btScalar(0.0) && d2 <= btScalar(0.0)) 
-	{
-		result.m_closestPointOnSimplex = a;
-		result.m_usedVertices.usedVertexA = true;
-		result.setBarycentricCoordinates(1,0,0);
-		return true;// a; // barycentric coordinates (1,0,0)
-	}
-
-    // Check if P in vertex region outside B
-    btVector3 bp = p - b;
-    btScalar d3 = ab.dot(bp);
-    btScalar d4 = ac.dot(bp);
-    if (d3 >= btScalar(0.0) && d4 <= d3) 
-	{
-		result.m_closestPointOnSimplex = b;
-		result.m_usedVertices.usedVertexB = true;
-		result.setBarycentricCoordinates(0,1,0);
-
-		return true; // b; // barycentric coordinates (0,1,0)
-	}
-    // Check if P in edge region of AB, if so return projection of P onto AB
-    btScalar vc = d1*d4 - d3*d2;
-    if (vc <= btScalar(0.0) && d1 >= btScalar(0.0) && d3 <= btScalar(0.0)) {
-        btScalar v = d1 / (d1 - d3);
-		result.m_closestPointOnSimplex = a + v * ab;
-		result.m_usedVertices.usedVertexA = true;
-		result.m_usedVertices.usedVertexB = true;
-		result.setBarycentricCoordinates(1-v,v,0);
-		return true;
-        //return a + v * ab; // barycentric coordinates (1-v,v,0)
-    }
-
-    // Check if P in vertex region outside C
-    btVector3 cp = p - c;
-    btScalar d5 = ab.dot(cp);
-    btScalar d6 = ac.dot(cp);
-    if (d6 >= btScalar(0.0) && d5 <= d6) 
-	{
-		result.m_closestPointOnSimplex = c;
-		result.m_usedVertices.usedVertexC = true;
-		result.setBarycentricCoordinates(0,0,1);
-		return true;//c; // barycentric coordinates (0,0,1)
-	}
-
-    // Check if P in edge region of AC, if so return projection of P onto AC
-    btScalar vb = d5*d2 - d1*d6;
-    if (vb <= btScalar(0.0) && d2 >= btScalar(0.0) && d6 <= btScalar(0.0)) {
-        btScalar w = d2 / (d2 - d6);
-		result.m_closestPointOnSimplex = a + w * ac;
-		result.m_usedVertices.usedVertexA = true;
-		result.m_usedVertices.usedVertexC = true;
-		result.setBarycentricCoordinates(1-w,0,w);
-		return true;
-        //return a + w * ac; // barycentric coordinates (1-w,0,w)
-    }
-
-    // Check if P in edge region of BC, if so return projection of P onto BC
-    btScalar va = d3*d6 - d5*d4;
-    if (va <= btScalar(0.0) && (d4 - d3) >= btScalar(0.0) && (d5 - d6) >= btScalar(0.0)) {
-        btScalar w = (d4 - d3) / ((d4 - d3) + (d5 - d6));
-		
-		result.m_closestPointOnSimplex = b + w * (c - b);
-		result.m_usedVertices.usedVertexB = true;
-		result.m_usedVertices.usedVertexC = true;
-		result.setBarycentricCoordinates(0,1-w,w);
-		return true;		
-       // return b + w * (c - b); // barycentric coordinates (0,1-w,w)
-    }
-
-    // P inside face region. Compute Q through its barycentric coordinates (u,v,w)
-    btScalar denom = btScalar(1.0) / (va + vb + vc);
-    btScalar v = vb * denom;
-    btScalar w = vc * denom;
-    
-	result.m_closestPointOnSimplex = a + ab * v + ac * w;
-	result.m_usedVertices.usedVertexA = true;
-	result.m_usedVertices.usedVertexB = true;
-	result.m_usedVertices.usedVertexC = true;
-	result.setBarycentricCoordinates(1-v-w,v,w);
-	
-	return true;
-//	return a + ab * v + ac * w; // = u*a + v*b + w*c, u = va * denom = btScalar(1.0) - v - w
-
-}
-
-
-
-
-
-/// Test if point p and d lie on opposite sides of plane through abc
-int btVoronoiSimplexSolver::pointOutsideOfPlane(const btVector3& p, const btVector3& a, const btVector3& b, const btVector3& c, const btVector3& d)
-{
-	btVector3 normal = (b-a).cross(c-a);
-
-    btScalar signp = (p - a).dot(normal); // [AP AB AC]
-    btScalar signd = (d - a).dot( normal); // [AD AB AC]
-
-#ifdef CATCH_DEGENERATE_TETRAHEDRON
-#ifdef BT_USE_DOUBLE_PRECISION
-if (signd * signd < (btScalar(1e-8) * btScalar(1e-8)))
-	{
-		return -1;
-	}
-#else
-	if (signd * signd < (btScalar(1e-4) * btScalar(1e-4)))
-	{
-//		printf("affine dependent/degenerate\n");//
-		return -1;
-	}
-#endif
-
-#endif
-	// Points on opposite sides if expression signs are opposite
-    return signp * signd < btScalar(0.);
-}
-
-
-bool	btVoronoiSimplexSolver::closestPtPointTetrahedron(const btVector3& p, const btVector3& a, const btVector3& b, const btVector3& c, const btVector3& d, btSubSimplexClosestResult& finalResult)
-{
-	btSubSimplexClosestResult tempResult;
-
-    // Start out assuming point inside all halfspaces, so closest to itself
-	finalResult.m_closestPointOnSimplex = p;
-	finalResult.m_usedVertices.reset();
-    finalResult.m_usedVertices.usedVertexA = true;
-	finalResult.m_usedVertices.usedVertexB = true;
-	finalResult.m_usedVertices.usedVertexC = true;
-	finalResult.m_usedVertices.usedVertexD = true;
-
-    int pointOutsideABC = pointOutsideOfPlane(p, a, b, c, d);
-	int pointOutsideACD = pointOutsideOfPlane(p, a, c, d, b);
-  	int	pointOutsideADB = pointOutsideOfPlane(p, a, d, b, c);
-	int	pointOutsideBDC = pointOutsideOfPlane(p, b, d, c, a);
-
-   if (pointOutsideABC < 0 || pointOutsideACD < 0 || pointOutsideADB < 0 || pointOutsideBDC < 0)
-   {
-	   finalResult.m_degenerate = true;
-	   return false;
-   }
-
-   if (!pointOutsideABC  && !pointOutsideACD && !pointOutsideADB && !pointOutsideBDC)
-	 {
-		 return false;
-	 }
-
-
-    btScalar bestSqDist = FLT_MAX;
-    // If point outside face abc then compute closest point on abc
-	if (pointOutsideABC) 
-	{
-        closestPtPointTriangle(p, a, b, c,tempResult);
-		btVector3 q = tempResult.m_closestPointOnSimplex;
-		
-        btScalar sqDist = (q - p).dot( q - p);
-        // Update best closest point if (squared) distance is less than current best
-        if (sqDist < bestSqDist) {
-			bestSqDist = sqDist;
-			finalResult.m_closestPointOnSimplex = q;
-			//convert result bitmask!
-			finalResult.m_usedVertices.reset();
-			finalResult.m_usedVertices.usedVertexA = tempResult.m_usedVertices.usedVertexA;
-			finalResult.m_usedVertices.usedVertexB = tempResult.m_usedVertices.usedVertexB;
-			finalResult.m_usedVertices.usedVertexC = tempResult.m_usedVertices.usedVertexC;
-			finalResult.setBarycentricCoordinates(
-					tempResult.m_barycentricCoords[VERTA],
-					tempResult.m_barycentricCoords[VERTB],
-					tempResult.m_barycentricCoords[VERTC],
-					0
-			);
-
-		}
-    }
-  
-
-	// Repeat test for face acd
-	if (pointOutsideACD) 
-	{
-        closestPtPointTriangle(p, a, c, d,tempResult);
-		btVector3 q = tempResult.m_closestPointOnSimplex;
-		//convert result bitmask!
-
-        btScalar sqDist = (q - p).dot( q - p);
-        if (sqDist < bestSqDist) 
-		{
-			bestSqDist = sqDist;
-			finalResult.m_closestPointOnSimplex = q;
-			finalResult.m_usedVertices.reset();
-			finalResult.m_usedVertices.usedVertexA = tempResult.m_usedVertices.usedVertexA;
-
-			finalResult.m_usedVertices.usedVertexC = tempResult.m_usedVertices.usedVertexB;
-			finalResult.m_usedVertices.usedVertexD = tempResult.m_usedVertices.usedVertexC;
-			finalResult.setBarycentricCoordinates(
-					tempResult.m_barycentricCoords[VERTA],
-					0,
-					tempResult.m_barycentricCoords[VERTB],
-					tempResult.m_barycentricCoords[VERTC]
-			);
-
-		}
-    }
-    // Repeat test for face adb
-
-	
-	if (pointOutsideADB)
-	{
-		closestPtPointTriangle(p, a, d, b,tempResult);
-		btVector3 q = tempResult.m_closestPointOnSimplex;
-		//convert result bitmask!
-
-        btScalar sqDist = (q - p).dot( q - p);
-        if (sqDist < bestSqDist) 
-		{
-			bestSqDist = sqDist;
-			finalResult.m_closestPointOnSimplex = q;
-			finalResult.m_usedVertices.reset();
-			finalResult.m_usedVertices.usedVertexA = tempResult.m_usedVertices.usedVertexA;
-			finalResult.m_usedVertices.usedVertexB = tempResult.m_usedVertices.usedVertexC;
-			
-			finalResult.m_usedVertices.usedVertexD = tempResult.m_usedVertices.usedVertexB;
-			finalResult.setBarycentricCoordinates(
-					tempResult.m_barycentricCoords[VERTA],
-					tempResult.m_barycentricCoords[VERTC],
-					0,
-					tempResult.m_barycentricCoords[VERTB]
-			);
-
-		}
-    }
-    // Repeat test for face bdc
-    
-
-	if (pointOutsideBDC)
-	{
-        closestPtPointTriangle(p, b, d, c,tempResult);
-		btVector3 q = tempResult.m_closestPointOnSimplex;
-		//convert result bitmask!
-        btScalar sqDist = (q - p).dot( q - p);
-        if (sqDist < bestSqDist) 
-		{
-			bestSqDist = sqDist;
-			finalResult.m_closestPointOnSimplex = q;
-			finalResult.m_usedVertices.reset();
-			//
-			finalResult.m_usedVertices.usedVertexB = tempResult.m_usedVertices.usedVertexA;
-			finalResult.m_usedVertices.usedVertexC = tempResult.m_usedVertices.usedVertexC;
-			finalResult.m_usedVertices.usedVertexD = tempResult.m_usedVertices.usedVertexB;
-
-			finalResult.setBarycentricCoordinates(
-					0,
-					tempResult.m_barycentricCoords[VERTA],
-					tempResult.m_barycentricCoords[VERTC],
-					tempResult.m_barycentricCoords[VERTB]
-			);
-
-		}
-    }
-
-	//help! we ended up full !
-	
-	if (finalResult.m_usedVertices.usedVertexA &&
-		finalResult.m_usedVertices.usedVertexB &&
-		finalResult.m_usedVertices.usedVertexC &&
-		finalResult.m_usedVertices.usedVertexD) 
-	{
-		return true;
-	}
-
-    return true;
-}
-
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h
deleted file mode 100644
index f1c7613..0000000
--- a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-#ifndef BT_VORONOI_SIMPLEX_SOLVER_H
-#define BT_VORONOI_SIMPLEX_SOLVER_H
-
-#include "btSimplexSolverInterface.h"
-
-
-
-#define VORONOI_SIMPLEX_MAX_VERTS 5
-
-///disable next define, or use defaultCollisionConfiguration->getSimplexSolver()->setEqualVertexThreshold(0.f) to disable/configure
-#define BT_USE_EQUAL_VERTEX_THRESHOLD
-#define VORONOI_DEFAULT_EQUAL_VERTEX_THRESHOLD 0.0001f
-
-
-struct btUsageBitfield{
-	btUsageBitfield()
-	{
-		reset();
-	}
-
-	void reset()
-	{
-		usedVertexA = false;
-		usedVertexB = false;
-		usedVertexC = false;
-		usedVertexD = false;
-	}
-	unsigned short usedVertexA	: 1;
-	unsigned short usedVertexB	: 1;
-	unsigned short usedVertexC	: 1;
-	unsigned short usedVertexD	: 1;
-	unsigned short unused1		: 1;
-	unsigned short unused2		: 1;
-	unsigned short unused3		: 1;
-	unsigned short unused4		: 1;
-};
-
-
-struct	btSubSimplexClosestResult
-{
-	btVector3	m_closestPointOnSimplex;
-	//MASK for m_usedVertices
-	//stores the simplex vertex-usage, using the MASK, 
-	// if m_usedVertices & MASK then the related vertex is used
-	btUsageBitfield	m_usedVertices;
-	btScalar	m_barycentricCoords[4];
-	bool m_degenerate;
-
-	void	reset()
-	{
-		m_degenerate = false;
-		setBarycentricCoordinates();
-		m_usedVertices.reset();
-	}
-	bool	isValid()
-	{
-		bool valid = (m_barycentricCoords[0] >= btScalar(0.)) &&
-			(m_barycentricCoords[1] >= btScalar(0.)) &&
-			(m_barycentricCoords[2] >= btScalar(0.)) &&
-			(m_barycentricCoords[3] >= btScalar(0.));
-
-
-		return valid;
-	}
-	void	setBarycentricCoordinates(btScalar a=btScalar(0.),btScalar b=btScalar(0.),btScalar c=btScalar(0.),btScalar d=btScalar(0.))
-	{
-		m_barycentricCoords[0] = a;
-		m_barycentricCoords[1] = b;
-		m_barycentricCoords[2] = c;
-		m_barycentricCoords[3] = d;
-	}
-
-};
-
-/// btVoronoiSimplexSolver is an implementation of the closest point distance algorithm from a 1-4 points simplex to the origin.
-/// Can be used with GJK, as an alternative to Johnson distance algorithm.
-#ifdef NO_VIRTUAL_INTERFACE
-class btVoronoiSimplexSolver
-#else
-class btVoronoiSimplexSolver : public btSimplexSolverInterface
-#endif
-{
-public:
-
-	int	m_numVertices;
-
-	btVector3	m_simplexVectorW[VORONOI_SIMPLEX_MAX_VERTS];
-	btVector3	m_simplexPointsP[VORONOI_SIMPLEX_MAX_VERTS];
-	btVector3	m_simplexPointsQ[VORONOI_SIMPLEX_MAX_VERTS];
-
-	
-
-	btVector3	m_cachedP1;
-	btVector3	m_cachedP2;
-	btVector3	m_cachedV;
-	btVector3	m_lastW;
-	
-	btScalar	m_equalVertexThreshold;
-	bool		m_cachedValidClosest;
-
-
-	btSubSimplexClosestResult m_cachedBC;
-
-	bool	m_needsUpdate;
-	
-	void	removeVertex(int index);
-	void	reduceVertices (const btUsageBitfield& usedVerts);
-	bool	updateClosestVectorAndPoints();
-
-	bool	closestPtPointTetrahedron(const btVector3& p, const btVector3& a, const btVector3& b, const btVector3& c, const btVector3& d, btSubSimplexClosestResult& finalResult);
-	int		pointOutsideOfPlane(const btVector3& p, const btVector3& a, const btVector3& b, const btVector3& c, const btVector3& d);
-	bool	closestPtPointTriangle(const btVector3& p, const btVector3& a, const btVector3& b, const btVector3& c,btSubSimplexClosestResult& result);
-
-public:
-
-	btVoronoiSimplexSolver()
-		:  m_equalVertexThreshold(VORONOI_DEFAULT_EQUAL_VERTEX_THRESHOLD)
-	{
-	}
-	 void reset();
-
-	 void addVertex(const btVector3& w, const btVector3& p, const btVector3& q);
-
-	 void	setEqualVertexThreshold(btScalar threshold)
-	 {
-		 m_equalVertexThreshold = threshold;
-	 }
-
-	 btScalar	getEqualVertexThreshold() const
-	 {
-		 return m_equalVertexThreshold;
-	 }
-
-	 bool closest(btVector3& v);
-
-	 btScalar maxVertex();
-
-	 bool fullSimplex() const
-	 {
-		 return (m_numVertices == 4);
-	 }
-
-	 int getSimplex(btVector3 *pBuf, btVector3 *qBuf, btVector3 *yBuf) const;
-
-	 bool inSimplex(const btVector3& w);
-	
-	 void backup_closest(btVector3& v) ;
-
-	 bool emptySimplex() const ;
-
-	 void compute_points(btVector3& p1, btVector3& p2) ;
-
-	 int numVertices() const 
-	 {
-		 return m_numVertices;
-	 }
-
-
-};
-
-#endif //BT_VORONOI_SIMPLEX_SOLVER_H
-
diff --git a/hkl3d/bullet/src/BulletDynamics/Character/btCharacterControllerInterface.h b/hkl3d/bullet/src/BulletDynamics/Character/btCharacterControllerInterface.h
deleted file mode 100644
index c81813c..0000000
--- a/hkl3d/bullet/src/BulletDynamics/Character/btCharacterControllerInterface.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2008 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_CHARACTER_CONTROLLER_INTERFACE_H
-#define BT_CHARACTER_CONTROLLER_INTERFACE_H
-
-#include "LinearMath/btVector3.h"
-#include "BulletDynamics/Dynamics/btActionInterface.h"
-
-class btCollisionShape;
-class btRigidBody;
-class btCollisionWorld;
-
-class btCharacterControllerInterface : public btActionInterface
-{
-public:
-	btCharacterControllerInterface () {};
-	virtual ~btCharacterControllerInterface () {};
-	
-	virtual void	setWalkDirection(const btVector3& walkDirection) = 0;
-	virtual void	setVelocityForTimeInterval(const btVector3& velocity, btScalar timeInterval) = 0;
-	virtual void	reset () = 0;
-	virtual void	warp (const btVector3& origin) = 0;
-
-	virtual void	preStep ( btCollisionWorld* collisionWorld) = 0;
-	virtual void	playerStep (btCollisionWorld* collisionWorld, btScalar dt) = 0;
-	virtual bool	canJump () const = 0;
-	virtual void	jump () = 0;
-
-	virtual bool	onGround () const = 0;
-};
-
-#endif //BT_CHARACTER_CONTROLLER_INTERFACE_H
-
diff --git a/hkl3d/bullet/src/BulletDynamics/Character/btKinematicCharacterController.cpp b/hkl3d/bullet/src/BulletDynamics/Character/btKinematicCharacterController.cpp
deleted file mode 100644
index f733dc0..0000000
--- a/hkl3d/bullet/src/BulletDynamics/Character/btKinematicCharacterController.cpp
+++ /dev/null
@@ -1,641 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2008 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "LinearMath/btIDebugDraw.h"
-#include "BulletCollision/CollisionDispatch/btGhostObject.h"
-#include "BulletCollision/CollisionShapes/btMultiSphereShape.h"
-#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"
-#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
-#include "BulletCollision/CollisionDispatch/btCollisionWorld.h"
-#include "LinearMath/btDefaultMotionState.h"
-#include "btKinematicCharacterController.h"
-
-
-// static helper method
-static btVector3
-getNormalizedVector(const btVector3& v)
-{
-	btVector3 n = v.normalized();
-	if (n.length() < SIMD_EPSILON) {
-		n.setValue(0, 0, 0);
-	}
-	return n;
-}
-
-
-///@todo Interact with dynamic objects,
-///Ride kinematicly animated platforms properly
-///More realistic (or maybe just a config option) falling
-/// -> Should integrate falling velocity manually and use that in stepDown()
-///Support jumping
-///Support ducking
-class btKinematicClosestNotMeRayResultCallback : public btCollisionWorld::ClosestRayResultCallback
-{
-public:
-	btKinematicClosestNotMeRayResultCallback (btCollisionObject* me) : btCollisionWorld::ClosestRayResultCallback(btVector3(0.0, 0.0, 0.0), btVector3(0.0, 0.0, 0.0))
-	{
-		m_me = me;
-	}
-
-	virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult,bool normalInWorldSpace)
-	{
-		if (rayResult.m_collisionObject == m_me)
-			return 1.0;
-
-		return ClosestRayResultCallback::addSingleResult (rayResult, normalInWorldSpace);
-	}
-protected:
-	btCollisionObject* m_me;
-};
-
-class btKinematicClosestNotMeConvexResultCallback : public btCollisionWorld::ClosestConvexResultCallback
-{
-public:
-	btKinematicClosestNotMeConvexResultCallback (btCollisionObject* me, const btVector3& up, btScalar minSlopeDot)
-	: btCollisionWorld::ClosestConvexResultCallback(btVector3(0.0, 0.0, 0.0), btVector3(0.0, 0.0, 0.0))
-	, m_me(me)
-	, m_up(up)
-	, m_minSlopeDot(minSlopeDot)
-	{
-	}
-
-	virtual btScalar addSingleResult(btCollisionWorld::LocalConvexResult& convexResult,bool normalInWorldSpace)
-	{
-		if (convexResult.m_hitCollisionObject == m_me)
-			return btScalar(1.0);
-
-		btVector3 hitNormalWorld;
-		if (normalInWorldSpace)
-		{
-			hitNormalWorld = convexResult.m_hitNormalLocal;
-		} else
-		{
-			///need to transform normal into worldspace
-			hitNormalWorld = convexResult.m_hitCollisionObject->getWorldTransform().getBasis()*convexResult.m_hitNormalLocal;
-		}
-
-		btScalar dotUp = m_up.dot(hitNormalWorld);
-		if (dotUp < m_minSlopeDot) {
-			return btScalar(1.0);
-		}
-
-		return ClosestConvexResultCallback::addSingleResult (convexResult, normalInWorldSpace);
-	}
-protected:
-	btCollisionObject* m_me;
-	const btVector3 m_up;
-	btScalar m_minSlopeDot;
-};
-
-/*
- * Returns the reflection direction of a ray going 'direction' hitting a surface with normal 'normal'
- *
- * from: http://www-cs-students.stanford.edu/~adityagp/final/node3.html
- */
-btVector3 btKinematicCharacterController::computeReflectionDirection (const btVector3& direction, const btVector3& normal)
-{
-	return direction - (btScalar(2.0) * direction.dot(normal)) * normal;
-}
-
-/*
- * Returns the portion of 'direction' that is parallel to 'normal'
- */
-btVector3 btKinematicCharacterController::parallelComponent (const btVector3& direction, const btVector3& normal)
-{
-	btScalar magnitude = direction.dot(normal);
-	return normal * magnitude;
-}
-
-/*
- * Returns the portion of 'direction' that is perpindicular to 'normal'
- */
-btVector3 btKinematicCharacterController::perpindicularComponent (const btVector3& direction, const btVector3& normal)
-{
-	return direction - parallelComponent(direction, normal);
-}
-
-btKinematicCharacterController::btKinematicCharacterController (btPairCachingGhostObject* ghostObject,btConvexShape* convexShape,btScalar stepHeight, int upAxis)
-{
-	m_upAxis = upAxis;
-	m_addedMargin = 0.02;
-	m_walkDirection.setValue(0,0,0);
-	m_useGhostObjectSweepTest = true;
-	m_ghostObject = ghostObject;
-	m_stepHeight = stepHeight;
-	m_turnAngle = btScalar(0.0);
-	m_convexShape=convexShape;	
-	m_useWalkDirection = true;	// use walk direction by default, legacy behavior
-	m_velocityTimeInterval = 0.0;
-	m_verticalVelocity = 0.0;
-	m_verticalOffset = 0.0;
-	m_gravity = 9.8 * 3 ; // 3G acceleration.
-	m_fallSpeed = 55.0; // Terminal velocity of a sky diver in m/s.
-	m_jumpSpeed = 10.0; // ?
-	m_wasOnGround = false;
-	m_wasJumping = false;
-	setMaxSlope(btRadians(45.0));
-}
-
-btKinematicCharacterController::~btKinematicCharacterController ()
-{
-}
-
-btPairCachingGhostObject* btKinematicCharacterController::getGhostObject()
-{
-	return m_ghostObject;
-}
-
-bool btKinematicCharacterController::recoverFromPenetration ( btCollisionWorld* collisionWorld)
-{
-
-	bool penetration = false;
-
-	collisionWorld->getDispatcher()->dispatchAllCollisionPairs(m_ghostObject->getOverlappingPairCache(), collisionWorld->getDispatchInfo(), collisionWorld->getDispatcher());
-
-	m_currentPosition = m_ghostObject->getWorldTransform().getOrigin();
-	
-	btScalar maxPen = btScalar(0.0);
-	for (int i = 0; i < m_ghostObject->getOverlappingPairCache()->getNumOverlappingPairs(); i++)
-	{
-		m_manifoldArray.resize(0);
-
-		btBroadphasePair* collisionPair = &m_ghostObject->getOverlappingPairCache()->getOverlappingPairArray()[i];
-		
-		if (collisionPair->m_algorithm)
-			collisionPair->m_algorithm->getAllContactManifolds(m_manifoldArray);
-
-		
-		for (int j=0;j<m_manifoldArray.size();j++)
-		{
-			btPersistentManifold* manifold = m_manifoldArray[j];
-			btScalar directionSign = manifold->getBody0() == m_ghostObject ? btScalar(-1.0) : btScalar(1.0);
-			for (int p=0;p<manifold->getNumContacts();p++)
-			{
-				const btManifoldPoint&pt = manifold->getContactPoint(p);
-
-				btScalar dist = pt.getDistance();
-
-				if (dist < 0.0)
-				{
-					if (dist < maxPen)
-					{
-						maxPen = dist;
-						m_touchingNormal = pt.m_normalWorldOnB * directionSign;//??
-
-					}
-					m_currentPosition += pt.m_normalWorldOnB * directionSign * dist * btScalar(0.2);
-					penetration = true;
-				} else {
-					//printf("touching %f\n", dist);
-				}
-			}
-			
-			//manifold->clearManifold();
-		}
-	}
-	btTransform newTrans = m_ghostObject->getWorldTransform();
-	newTrans.setOrigin(m_currentPosition);
-	m_ghostObject->setWorldTransform(newTrans);
-//	printf("m_touchingNormal = %f,%f,%f\n",m_touchingNormal[0],m_touchingNormal[1],m_touchingNormal[2]);
-	return penetration;
-}
-
-void btKinematicCharacterController::stepUp ( btCollisionWorld* world)
-{
-	// phase 1: up
-	btTransform start, end;
-	m_targetPosition = m_currentPosition + getUpAxisDirections()[m_upAxis] * (m_stepHeight + (m_verticalOffset > 0.f?m_verticalOffset:0.f));
-
-	start.setIdentity ();
-	end.setIdentity ();
-
-	/* FIXME: Handle penetration properly */
-	start.setOrigin (m_currentPosition + getUpAxisDirections()[m_upAxis] * (m_convexShape->getMargin() + m_addedMargin));
-	end.setOrigin (m_targetPosition);
-
-	btKinematicClosestNotMeConvexResultCallback callback (m_ghostObject, -getUpAxisDirections()[m_upAxis], btScalar(0.7071));
-	callback.m_collisionFilterGroup = getGhostObject()->getBroadphaseHandle()->m_collisionFilterGroup;
-	callback.m_collisionFilterMask = getGhostObject()->getBroadphaseHandle()->m_collisionFilterMask;
-	
-	if (m_useGhostObjectSweepTest)
-	{
-		m_ghostObject->convexSweepTest (m_convexShape, start, end, callback, world->getDispatchInfo().m_allowedCcdPenetration);
-	}
-	else
-	{
-		world->convexSweepTest (m_convexShape, start, end, callback);
-	}
-	
-	if (callback.hasHit())
-	{
-		// Only modify the position if the hit was a slope and not a wall or ceiling.
-		if(callback.m_hitNormalWorld.dot(getUpAxisDirections()[m_upAxis]) > 0.0)
-		{
-			// we moved up only a fraction of the step height
-			m_currentStepOffset = m_stepHeight * callback.m_closestHitFraction;
-			m_currentPosition.setInterpolate3 (m_currentPosition, m_targetPosition, callback.m_closestHitFraction);
-		}
-		m_verticalVelocity = 0.0;
-		m_verticalOffset = 0.0;
-	} else {
-		m_currentStepOffset = m_stepHeight;
-		m_currentPosition = m_targetPosition;
-	}
-}
-
-void btKinematicCharacterController::updateTargetPositionBasedOnCollision (const btVector3& hitNormal, btScalar tangentMag, btScalar normalMag)
-{
-	btVector3 movementDirection = m_targetPosition - m_currentPosition;
-	btScalar movementLength = movementDirection.length();
-	if (movementLength>SIMD_EPSILON)
-	{
-		movementDirection.normalize();
-
-		btVector3 reflectDir = computeReflectionDirection (movementDirection, hitNormal);
-		reflectDir.normalize();
-
-		btVector3 parallelDir, perpindicularDir;
-
-		parallelDir = parallelComponent (reflectDir, hitNormal);
-		perpindicularDir = perpindicularComponent (reflectDir, hitNormal);
-
-		m_targetPosition = m_currentPosition;
-		if (0)//tangentMag != 0.0)
-		{
-			btVector3 parComponent = parallelDir * btScalar (tangentMag*movementLength);
-//			printf("parComponent=%f,%f,%f\n",parComponent[0],parComponent[1],parComponent[2]);
-			m_targetPosition +=  parComponent;
-		}
-
-		if (normalMag != 0.0)
-		{
-			btVector3 perpComponent = perpindicularDir * btScalar (normalMag*movementLength);
-//			printf("perpComponent=%f,%f,%f\n",perpComponent[0],perpComponent[1],perpComponent[2]);
-			m_targetPosition += perpComponent;
-		}
-	} else
-	{
-//		printf("movementLength don't normalize a zero vector\n");
-	}
-}
-
-void btKinematicCharacterController::stepForwardAndStrafe ( btCollisionWorld* collisionWorld, const btVector3& walkMove)
-{
-	// printf("m_normalizedDirection=%f,%f,%f\n",
-	// 	m_normalizedDirection[0],m_normalizedDirection[1],m_normalizedDirection[2]);
-	// phase 2: forward and strafe
-	btTransform start, end;
-	m_targetPosition = m_currentPosition + walkMove;
-
-	start.setIdentity ();
-	end.setIdentity ();
-	
-	btScalar fraction = 1.0;
-	btScalar distance2 = (m_currentPosition-m_targetPosition).length2();
-//	printf("distance2=%f\n",distance2);
-
-	if (m_touchingContact)
-	{
-		if (m_normalizedDirection.dot(m_touchingNormal) > btScalar(0.0))
-		{
-			updateTargetPositionBasedOnCollision (m_touchingNormal);
-		}
-	}
-
-	int maxIter = 10;
-
-	while (fraction > btScalar(0.01) && maxIter-- > 0)
-	{
-		start.setOrigin (m_currentPosition);
-		end.setOrigin (m_targetPosition);
-		btVector3 sweepDirNegative(m_currentPosition - m_targetPosition);
-
-		btKinematicClosestNotMeConvexResultCallback callback (m_ghostObject, sweepDirNegative, btScalar(0.0));
-		callback.m_collisionFilterGroup = getGhostObject()->getBroadphaseHandle()->m_collisionFilterGroup;
-		callback.m_collisionFilterMask = getGhostObject()->getBroadphaseHandle()->m_collisionFilterMask;
-
-
-		btScalar margin = m_convexShape->getMargin();
-		m_convexShape->setMargin(margin + m_addedMargin);
-
-
-		if (m_useGhostObjectSweepTest)
-		{
-			m_ghostObject->convexSweepTest (m_convexShape, start, end, callback, collisionWorld->getDispatchInfo().m_allowedCcdPenetration);
-		} else
-		{
-			collisionWorld->convexSweepTest (m_convexShape, start, end, callback, collisionWorld->getDispatchInfo().m_allowedCcdPenetration);
-		}
-		
-		m_convexShape->setMargin(margin);
-
-		
-		fraction -= callback.m_closestHitFraction;
-
-		if (callback.hasHit())
-		{	
-			// we moved only a fraction
-			btScalar hitDistance;
-			hitDistance = (callback.m_hitPointWorld - m_currentPosition).length();
-
-//			m_currentPosition.setInterpolate3 (m_currentPosition, m_targetPosition, callback.m_closestHitFraction);
-
-			updateTargetPositionBasedOnCollision (callback.m_hitNormalWorld);
-			btVector3 currentDir = m_targetPosition - m_currentPosition;
-			distance2 = currentDir.length2();
-			if (distance2 > SIMD_EPSILON)
-			{
-				currentDir.normalize();
-				/* See Quake2: "If velocity is against original velocity, stop ead to avoid tiny oscilations in sloping corners." */
-				if (currentDir.dot(m_normalizedDirection) <= btScalar(0.0))
-				{
-					break;
-				}
-			} else
-			{
-//				printf("currentDir: don't normalize a zero vector\n");
-				break;
-			}
-
-		} else {
-			// we moved whole way
-			m_currentPosition = m_targetPosition;
-		}
-
-	//	if (callback.m_closestHitFraction == 0.f)
-	//		break;
-
-	}
-}
-
-void btKinematicCharacterController::stepDown ( btCollisionWorld* collisionWorld, btScalar dt)
-{
-	btTransform start, end;
-
-	// phase 3: down
-	/*btScalar additionalDownStep = (m_wasOnGround && !onGround()) ? m_stepHeight : 0.0;
-	btVector3 step_drop = getUpAxisDirections()[m_upAxis] * (m_currentStepOffset + additionalDownStep);
-	btScalar downVelocity = (additionalDownStep == 0.0 && m_verticalVelocity<0.0?-m_verticalVelocity:0.0) * dt;
-	btVector3 gravity_drop = getUpAxisDirections()[m_upAxis] * downVelocity; 
-	m_targetPosition -= (step_drop + gravity_drop);*/
-
-	btScalar downVelocity = (m_verticalVelocity<0.f?-m_verticalVelocity:0.f) * dt;
-	if(downVelocity > 0.0 && downVelocity < m_stepHeight
-		&& (m_wasOnGround || !m_wasJumping))
-	{
-		downVelocity = m_stepHeight;
-	}
-
-	btVector3 step_drop = getUpAxisDirections()[m_upAxis] * (m_currentStepOffset + downVelocity);
-	m_targetPosition -= step_drop;
-
-	start.setIdentity ();
-	end.setIdentity ();
-
-	start.setOrigin (m_currentPosition);
-	end.setOrigin (m_targetPosition);
-
-	btKinematicClosestNotMeConvexResultCallback callback (m_ghostObject, getUpAxisDirections()[m_upAxis], m_maxSlopeCosine);
-	callback.m_collisionFilterGroup = getGhostObject()->getBroadphaseHandle()->m_collisionFilterGroup;
-	callback.m_collisionFilterMask = getGhostObject()->getBroadphaseHandle()->m_collisionFilterMask;
-	
-	if (m_useGhostObjectSweepTest)
-	{
-		m_ghostObject->convexSweepTest (m_convexShape, start, end, callback, collisionWorld->getDispatchInfo().m_allowedCcdPenetration);
-	} else
-	{
-		collisionWorld->convexSweepTest (m_convexShape, start, end, callback, collisionWorld->getDispatchInfo().m_allowedCcdPenetration);
-	}
-
-	if (callback.hasHit())
-	{
-		// we dropped a fraction of the height -> hit floor
-		m_currentPosition.setInterpolate3 (m_currentPosition, m_targetPosition, callback.m_closestHitFraction);
-		m_verticalVelocity = 0.0;
-		m_verticalOffset = 0.0;
-		m_wasJumping = false;
-	} else {
-		// we dropped the full height
-		
-		m_currentPosition = m_targetPosition;
-	}
-}
-
-
-
-void btKinematicCharacterController::setWalkDirection
-(
-const btVector3& walkDirection
-)
-{
-	m_useWalkDirection = true;
-	m_walkDirection = walkDirection;
-	m_normalizedDirection = getNormalizedVector(m_walkDirection);
-}
-
-
-
-void btKinematicCharacterController::setVelocityForTimeInterval
-(
-const btVector3& velocity,
-btScalar timeInterval
-)
-{
-//	printf("setVelocity!\n");
-//	printf("  interval: %f\n", timeInterval);
-//	printf("  velocity: (%f, %f, %f)\n",
-//		 velocity.x(), velocity.y(), velocity.z());
-
-	m_useWalkDirection = false;
-	m_walkDirection = velocity;
-	m_normalizedDirection = getNormalizedVector(m_walkDirection);
-	m_velocityTimeInterval = timeInterval;
-}
-
-
-
-void btKinematicCharacterController::reset ()
-{
-}
-
-void btKinematicCharacterController::warp (const btVector3& origin)
-{
-	btTransform xform;
-	xform.setIdentity();
-	xform.setOrigin (origin);
-	m_ghostObject->setWorldTransform (xform);
-}
-
-
-void btKinematicCharacterController::preStep (  btCollisionWorld* collisionWorld)
-{
-	
-	int numPenetrationLoops = 0;
-	m_touchingContact = false;
-	while (recoverFromPenetration (collisionWorld))
-	{
-		numPenetrationLoops++;
-		m_touchingContact = true;
-		if (numPenetrationLoops > 4)
-		{
-			//printf("character could not recover from penetration = %d\n", numPenetrationLoops);
-			break;
-		}
-	}
-
-	m_currentPosition = m_ghostObject->getWorldTransform().getOrigin();
-	m_targetPosition = m_currentPosition;
-//	printf("m_targetPosition=%f,%f,%f\n",m_targetPosition[0],m_targetPosition[1],m_targetPosition[2]);
-
-	
-}
-
-#include <stdio.h>
-
-void btKinematicCharacterController::playerStep (  btCollisionWorld* collisionWorld, btScalar dt)
-{
-//	printf("playerStep(): ");
-//	printf("  dt = %f", dt);
-
-	// quick check...
-	if (!m_useWalkDirection && m_velocityTimeInterval <= 0.0) {
-//		printf("\n");
-		return;		// no motion
-	}
-
-	m_wasOnGround = onGround();
-
-	// Update fall velocity.
-	m_verticalVelocity -= m_gravity * dt;
-	if(m_verticalVelocity > 0.0 && m_verticalVelocity > m_jumpSpeed)
-	{
-		m_verticalVelocity = m_jumpSpeed;
-	}
-	if(m_verticalVelocity < 0.0 && btFabs(m_verticalVelocity) > btFabs(m_fallSpeed))
-	{
-		m_verticalVelocity = -btFabs(m_fallSpeed);
-	}
-	m_verticalOffset = m_verticalVelocity * dt;
-
-
-	btTransform xform;
-	xform = m_ghostObject->getWorldTransform ();
-
-//	printf("walkDirection(%f,%f,%f)\n",walkDirection[0],walkDirection[1],walkDirection[2]);
-//	printf("walkSpeed=%f\n",walkSpeed);
-
-	stepUp (collisionWorld);
-	if (m_useWalkDirection) {
-		stepForwardAndStrafe (collisionWorld, m_walkDirection);
-	} else {
-		//printf("  time: %f", m_velocityTimeInterval);
-		// still have some time left for moving!
-		btScalar dtMoving =
-			(dt < m_velocityTimeInterval) ? dt : m_velocityTimeInterval;
-		m_velocityTimeInterval -= dt;
-
-		// how far will we move while we are moving?
-		btVector3 move = m_walkDirection * dtMoving;
-
-		//printf("  dtMoving: %f", dtMoving);
-
-		// okay, step
-		stepForwardAndStrafe(collisionWorld, move);
-	}
-	stepDown (collisionWorld, dt);
-
-	// printf("\n");
-
-	xform.setOrigin (m_currentPosition);
-	m_ghostObject->setWorldTransform (xform);
-}
-
-void btKinematicCharacterController::setFallSpeed (btScalar fallSpeed)
-{
-	m_fallSpeed = fallSpeed;
-}
-
-void btKinematicCharacterController::setJumpSpeed (btScalar jumpSpeed)
-{
-	m_jumpSpeed = jumpSpeed;
-}
-
-void btKinematicCharacterController::setMaxJumpHeight (btScalar maxJumpHeight)
-{
-	m_maxJumpHeight = maxJumpHeight;
-}
-
-bool btKinematicCharacterController::canJump () const
-{
-	return onGround();
-}
-
-void btKinematicCharacterController::jump ()
-{
-	if (!canJump())
-		return;
-
-	m_verticalVelocity = m_jumpSpeed;
-	m_wasJumping = true;
-
-#if 0
-	currently no jumping.
-	btTransform xform;
-	m_rigidBody->getMotionState()->getWorldTransform (xform);
-	btVector3 up = xform.getBasis()[1];
-	up.normalize ();
-	btScalar magnitude = (btScalar(1.0)/m_rigidBody->getInvMass()) * btScalar(8.0);
-	m_rigidBody->applyCentralImpulse (up * magnitude);
-#endif
-}
-
-void btKinematicCharacterController::setGravity(btScalar gravity)
-{
-	m_gravity = gravity;
-}
-
-btScalar btKinematicCharacterController::getGravity() const
-{
-	return m_gravity;
-}
-
-void btKinematicCharacterController::setMaxSlope(btScalar slopeRadians)
-{
-	m_maxSlopeRadians = slopeRadians;
-	m_maxSlopeCosine = btCos(slopeRadians);
-}
-
-btScalar btKinematicCharacterController::getMaxSlope() const
-{
-	return m_maxSlopeRadians;
-}
-
-bool btKinematicCharacterController::onGround () const
-{
-	return m_verticalVelocity == 0.0 && m_verticalOffset == 0.0;
-}
-
-
-btVector3* btKinematicCharacterController::getUpAxisDirections()
-{
-	static btVector3 sUpAxisDirection[3] = { btVector3(1.0f, 0.0f, 0.0f), btVector3(0.0f, 1.0f, 0.0f), btVector3(0.0f, 0.0f, 1.0f) };
-	
-	return sUpAxisDirection;
-}
-
-void btKinematicCharacterController::debugDraw(btIDebugDraw* debugDrawer)
-{
-}
diff --git a/hkl3d/bullet/src/BulletDynamics/Character/btKinematicCharacterController.h b/hkl3d/bullet/src/BulletDynamics/Character/btKinematicCharacterController.h
deleted file mode 100644
index ad2f9f1..0000000
--- a/hkl3d/bullet/src/BulletDynamics/Character/btKinematicCharacterController.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2008 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef BT_KINEMATIC_CHARACTER_CONTROLLER_H
-#define BT_KINEMATIC_CHARACTER_CONTROLLER_H
-
-#include "LinearMath/btVector3.h"
-
-#include "btCharacterControllerInterface.h"
-
-#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
-
-
-class btCollisionShape;
-class btRigidBody;
-class btCollisionWorld;
-class btCollisionDispatcher;
-class btPairCachingGhostObject;
-
-///btKinematicCharacterController is an object that supports a sliding motion in a world.
-///It uses a ghost object and convex sweep test to test for upcoming collisions. This is combined with discrete collision detection to recover from penetrations.
-///Interaction between btKinematicCharacterController and dynamic rigid bodies needs to be explicity implemented by the user.
-class btKinematicCharacterController : public btCharacterControllerInterface
-{
-protected:
-
-	btScalar m_halfHeight;
-	
-	btPairCachingGhostObject* m_ghostObject;
-	btConvexShape*	m_convexShape;//is also in m_ghostObject, but it needs to be convex, so we store it here to avoid upcast
-	
-	btScalar m_verticalVelocity;
-	btScalar m_verticalOffset;
-	btScalar m_fallSpeed;
-	btScalar m_jumpSpeed;
-	btScalar m_maxJumpHeight;
-	btScalar m_maxSlopeRadians; // Slope angle that is set (used for returning the exact value)
-	btScalar m_maxSlopeCosine;  // Cosine equivalent of m_maxSlopeRadians (calculated once when set, for optimization)
-	btScalar m_gravity;
-
-	btScalar m_turnAngle;
-	
-	btScalar m_stepHeight;
-
-	btScalar	m_addedMargin;//@todo: remove this and fix the code
-
-	///this is the desired walk direction, set by the user
-	btVector3	m_walkDirection;
-	btVector3	m_normalizedDirection;
-
-	//some internal variables
-	btVector3 m_currentPosition;
-	btScalar  m_currentStepOffset;
-	btVector3 m_targetPosition;
-
-	///keep track of the contact manifolds
-	btManifoldArray	m_manifoldArray;
-
-	bool m_touchingContact;
-	btVector3 m_touchingNormal;
-
-	bool  m_wasOnGround;
-	bool  m_wasJumping;
-	bool	m_useGhostObjectSweepTest;
-	bool	m_useWalkDirection;
-	btScalar	m_velocityTimeInterval;
-	int m_upAxis;
-
-	static btVector3* getUpAxisDirections();
-
-	btVector3 computeReflectionDirection (const btVector3& direction, const btVector3& normal);
-	btVector3 parallelComponent (const btVector3& direction, const btVector3& normal);
-	btVector3 perpindicularComponent (const btVector3& direction, const btVector3& normal);
-
-	bool recoverFromPenetration ( btCollisionWorld* collisionWorld);
-	void stepUp (btCollisionWorld* collisionWorld);
-	void updateTargetPositionBasedOnCollision (const btVector3& hit_normal, btScalar tangentMag = btScalar(0.0), btScalar normalMag = btScalar(1.0));
-	void stepForwardAndStrafe (btCollisionWorld* collisionWorld, const btVector3& walkMove);
-	void stepDown (btCollisionWorld* collisionWorld, btScalar dt);
-public:
-	btKinematicCharacterController (btPairCachingGhostObject* ghostObject,btConvexShape* convexShape,btScalar stepHeight, int upAxis = 1);
-	~btKinematicCharacterController ();
-	
-
-	///btActionInterface interface
-	virtual void updateAction( btCollisionWorld* collisionWorld,btScalar deltaTime)
-	{
-		preStep ( collisionWorld);
-		playerStep (collisionWorld, deltaTime);
-	}
-	
-	///btActionInterface interface
-	void	debugDraw(btIDebugDraw* debugDrawer);
-
-	void setUpAxis (int axis)
-	{
-		if (axis < 0)
-			axis = 0;
-		if (axis > 2)
-			axis = 2;
-		m_upAxis = axis;
-	}
-
-	/// This should probably be called setPositionIncrementPerSimulatorStep.
-	/// This is neither a direction nor a velocity, but the amount to
-	///	increment the position each simulation iteration, regardless
-	///	of dt.
-	/// This call will reset any velocity set by setVelocityForTimeInterval().
-	virtual void	setWalkDirection(const btVector3& walkDirection);
-
-	/// Caller provides a velocity with which the character should move for
-	///	the given time period.  After the time period, velocity is reset
-	///	to zero.
-	/// This call will reset any walk direction set by setWalkDirection().
-	/// Negative time intervals will result in no motion.
-	virtual void setVelocityForTimeInterval(const btVector3& velocity,
-				btScalar timeInterval);
-
-	void reset ();
-	void warp (const btVector3& origin);
-
-	void preStep (  btCollisionWorld* collisionWorld);
-	void playerStep ( btCollisionWorld* collisionWorld, btScalar dt);
-
-	void setFallSpeed (btScalar fallSpeed);
-	void setJumpSpeed (btScalar jumpSpeed);
-	void setMaxJumpHeight (btScalar maxJumpHeight);
-	bool canJump () const;
-
-	void jump ();
-
-	void setGravity(btScalar gravity);
-	btScalar getGravity() const;
-
-	/// The max slope determines the maximum angle that the controller can walk up.
-	/// The slope angle is measured in radians.
-	void setMaxSlope(btScalar slopeRadians);
-	btScalar getMaxSlope() const;
-
-	btPairCachingGhostObject* getGhostObject();
-	void	setUseGhostSweepTest(bool useGhostObjectSweepTest)
-	{
-		m_useGhostObjectSweepTest = useGhostObjectSweepTest;
-	}
-
-	bool onGround () const;
-};
-
-#endif // BT_KINEMATIC_CHARACTER_CONTROLLER_H
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp
deleted file mode 100644
index bc371e4..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp
+++ /dev/null
@@ -1,1127 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-btConeTwistConstraint is Copyright (c) 2007 Starbreeze Studios
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-
-Written by: Marcus Hennix
-*/
-
-
-#include "btConeTwistConstraint.h"
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-#include "LinearMath/btTransformUtil.h"
-#include "LinearMath/btMinMax.h"
-#include <new>
-
-
-
-//#define CONETWIST_USE_OBSOLETE_SOLVER true
-#define CONETWIST_USE_OBSOLETE_SOLVER false
-#define CONETWIST_DEF_FIX_THRESH btScalar(.05f)
-
-
-SIMD_FORCE_INLINE btScalar computeAngularImpulseDenominator(const btVector3& axis, const btMatrix3x3& invInertiaWorld)
-{
-	btVector3 vec = axis * invInertiaWorld;
-	return axis.dot(vec);
-}
-
-
-
-
-btConeTwistConstraint::btConeTwistConstraint(btRigidBody& rbA,btRigidBody& rbB, 
-											 const btTransform& rbAFrame,const btTransform& rbBFrame)
-											 :btTypedConstraint(CONETWIST_CONSTRAINT_TYPE, rbA,rbB),m_rbAFrame(rbAFrame),m_rbBFrame(rbBFrame),
-											 m_angularOnly(false),
-											 m_useSolveConstraintObsolete(CONETWIST_USE_OBSOLETE_SOLVER)
-{
-	init();
-}
-
-btConeTwistConstraint::btConeTwistConstraint(btRigidBody& rbA,const btTransform& rbAFrame)
-											:btTypedConstraint(CONETWIST_CONSTRAINT_TYPE,rbA),m_rbAFrame(rbAFrame),
-											 m_angularOnly(false),
-											 m_useSolveConstraintObsolete(CONETWIST_USE_OBSOLETE_SOLVER)
-{
-	m_rbBFrame = m_rbAFrame;
-	init();	
-}
-
-
-void btConeTwistConstraint::init()
-{
-	m_angularOnly = false;
-	m_solveTwistLimit = false;
-	m_solveSwingLimit = false;
-	m_bMotorEnabled = false;
-	m_maxMotorImpulse = btScalar(-1);
-
-	setLimit(btScalar(BT_LARGE_FLOAT), btScalar(BT_LARGE_FLOAT), btScalar(BT_LARGE_FLOAT));
-	m_damping = btScalar(0.01);
-	m_fixThresh = CONETWIST_DEF_FIX_THRESH;
-	m_flags = 0;
-	m_linCFM = btScalar(0.f);
-	m_linERP = btScalar(0.7f);
-	m_angCFM = btScalar(0.f);
-}
-
-
-void btConeTwistConstraint::getInfo1 (btConstraintInfo1* info)
-{
-	if (m_useSolveConstraintObsolete)
-	{
-		info->m_numConstraintRows = 0;
-		info->nub = 0;
-	} 
-	else
-	{
-		info->m_numConstraintRows = 3;
-		info->nub = 3;
-		calcAngleInfo2(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform(),m_rbA.getInvInertiaTensorWorld(),m_rbB.getInvInertiaTensorWorld());
-		if(m_solveSwingLimit)
-		{
-			info->m_numConstraintRows++;
-			info->nub--;
-			if((m_swingSpan1 < m_fixThresh) && (m_swingSpan2 < m_fixThresh))
-			{
-				info->m_numConstraintRows++;
-				info->nub--;
-			}
-		}
-		if(m_solveTwistLimit)
-		{
-			info->m_numConstraintRows++;
-			info->nub--;
-		}
-	}
-}
-
-void btConeTwistConstraint::getInfo1NonVirtual (btConstraintInfo1* info)
-{
-	//always reserve 6 rows: object transform is not available on SPU
-	info->m_numConstraintRows = 6;
-	info->nub = 0;
-		
-}
-	
-
-void btConeTwistConstraint::getInfo2 (btConstraintInfo2* info)
-{
-	getInfo2NonVirtual(info,m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform(),m_rbA.getInvInertiaTensorWorld(),m_rbB.getInvInertiaTensorWorld());
-}
-
-void btConeTwistConstraint::getInfo2NonVirtual (btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btMatrix3x3& invInertiaWorldA,const btMatrix3x3& invInertiaWorldB)
-{
-	calcAngleInfo2(transA,transB,invInertiaWorldA,invInertiaWorldB);
-	
-	btAssert(!m_useSolveConstraintObsolete);
-    // set jacobian
-    info->m_J1linearAxis[0] = 1;
-    info->m_J1linearAxis[info->rowskip+1] = 1;
-    info->m_J1linearAxis[2*info->rowskip+2] = 1;
-	btVector3 a1 = transA.getBasis() * m_rbAFrame.getOrigin();
-	{
-		btVector3* angular0 = (btVector3*)(info->m_J1angularAxis);
-		btVector3* angular1 = (btVector3*)(info->m_J1angularAxis+info->rowskip);
-		btVector3* angular2 = (btVector3*)(info->m_J1angularAxis+2*info->rowskip);
-		btVector3 a1neg = -a1;
-		a1neg.getSkewSymmetricMatrix(angular0,angular1,angular2);
-	}
-	btVector3 a2 = transB.getBasis() * m_rbBFrame.getOrigin();
-	{
-		btVector3* angular0 = (btVector3*)(info->m_J2angularAxis);
-		btVector3* angular1 = (btVector3*)(info->m_J2angularAxis+info->rowskip);
-		btVector3* angular2 = (btVector3*)(info->m_J2angularAxis+2*info->rowskip);
-		a2.getSkewSymmetricMatrix(angular0,angular1,angular2);
-	}
-    // set right hand side
-	btScalar linERP = (m_flags & BT_CONETWIST_FLAGS_LIN_ERP) ? m_linERP : info->erp;
-    btScalar k = info->fps * linERP;
-    int j;
-	for (j=0; j<3; j++)
-    {
-        info->m_constraintError[j*info->rowskip] = k * (a2[j] + transB.getOrigin()[j] - a1[j] - transA.getOrigin()[j]);
-		info->m_lowerLimit[j*info->rowskip] = -SIMD_INFINITY;
-		info->m_upperLimit[j*info->rowskip] = SIMD_INFINITY;
-		if(m_flags & BT_CONETWIST_FLAGS_LIN_CFM)
-		{
-			info->cfm[j*info->rowskip] = m_linCFM;
-		}
-    }
-	int row = 3;
-    int srow = row * info->rowskip;
-	btVector3 ax1;
-	// angular limits
-	if(m_solveSwingLimit)
-	{
-		btScalar *J1 = info->m_J1angularAxis;
-		btScalar *J2 = info->m_J2angularAxis;
-		if((m_swingSpan1 < m_fixThresh) && (m_swingSpan2 < m_fixThresh))
-		{
-			btTransform trA = transA*m_rbAFrame;
-			btVector3 p = trA.getBasis().getColumn(1);
-			btVector3 q = trA.getBasis().getColumn(2);
-			int srow1 = srow + info->rowskip;
-			J1[srow+0] = p[0];
-			J1[srow+1] = p[1];
-			J1[srow+2] = p[2];
-			J1[srow1+0] = q[0];
-			J1[srow1+1] = q[1];
-			J1[srow1+2] = q[2];
-			J2[srow+0] = -p[0];
-			J2[srow+1] = -p[1];
-			J2[srow+2] = -p[2];
-			J2[srow1+0] = -q[0];
-			J2[srow1+1] = -q[1];
-			J2[srow1+2] = -q[2];
-			btScalar fact = info->fps * m_relaxationFactor;
-			info->m_constraintError[srow] =   fact * m_swingAxis.dot(p);
-			info->m_constraintError[srow1] =  fact * m_swingAxis.dot(q);
-			info->m_lowerLimit[srow] = -SIMD_INFINITY;
-			info->m_upperLimit[srow] = SIMD_INFINITY;
-			info->m_lowerLimit[srow1] = -SIMD_INFINITY;
-			info->m_upperLimit[srow1] = SIMD_INFINITY;
-			srow = srow1 + info->rowskip;
-		}
-		else
-		{
-			ax1 = m_swingAxis * m_relaxationFactor * m_relaxationFactor;
-			J1[srow+0] = ax1[0];
-			J1[srow+1] = ax1[1];
-			J1[srow+2] = ax1[2];
-			J2[srow+0] = -ax1[0];
-			J2[srow+1] = -ax1[1];
-			J2[srow+2] = -ax1[2];
-			btScalar k = info->fps * m_biasFactor;
-
-			info->m_constraintError[srow] = k * m_swingCorrection;
-			if(m_flags & BT_CONETWIST_FLAGS_ANG_CFM)
-			{
-				info->cfm[srow] = m_angCFM;
-			}
-			// m_swingCorrection is always positive or 0
-			info->m_lowerLimit[srow] = 0;
-			info->m_upperLimit[srow] = SIMD_INFINITY;
-			srow += info->rowskip;
-		}
-	}
-	if(m_solveTwistLimit)
-	{
-		ax1 = m_twistAxis * m_relaxationFactor * m_relaxationFactor;
-		btScalar *J1 = info->m_J1angularAxis;
-		btScalar *J2 = info->m_J2angularAxis;
-		J1[srow+0] = ax1[0];
-		J1[srow+1] = ax1[1];
-		J1[srow+2] = ax1[2];
-		J2[srow+0] = -ax1[0];
-		J2[srow+1] = -ax1[1];
-		J2[srow+2] = -ax1[2];
-		btScalar k = info->fps * m_biasFactor;
-		info->m_constraintError[srow] = k * m_twistCorrection;
-		if(m_flags & BT_CONETWIST_FLAGS_ANG_CFM)
-		{
-			info->cfm[srow] = m_angCFM;
-		}
-		if(m_twistSpan > 0.0f)
-		{
-
-			if(m_twistCorrection > 0.0f)
-			{
-				info->m_lowerLimit[srow] = 0;
-				info->m_upperLimit[srow] = SIMD_INFINITY;
-			} 
-			else
-			{
-				info->m_lowerLimit[srow] = -SIMD_INFINITY;
-				info->m_upperLimit[srow] = 0;
-			} 
-		}
-		else
-		{
-			info->m_lowerLimit[srow] = -SIMD_INFINITY;
-			info->m_upperLimit[srow] = SIMD_INFINITY;
-		}
-		srow += info->rowskip;
-	}
-}
-	
-
-
-void	btConeTwistConstraint::buildJacobian()
-{
-	if (m_useSolveConstraintObsolete)
-	{
-		m_appliedImpulse = btScalar(0.);
-		m_accTwistLimitImpulse = btScalar(0.);
-		m_accSwingLimitImpulse = btScalar(0.);
-		m_accMotorImpulse = btVector3(0.,0.,0.);
-
-		if (!m_angularOnly)
-		{
-			btVector3 pivotAInW = m_rbA.getCenterOfMassTransform()*m_rbAFrame.getOrigin();
-			btVector3 pivotBInW = m_rbB.getCenterOfMassTransform()*m_rbBFrame.getOrigin();
-			btVector3 relPos = pivotBInW - pivotAInW;
-
-			btVector3 normal[3];
-			if (relPos.length2() > SIMD_EPSILON)
-			{
-				normal[0] = relPos.normalized();
-			}
-			else
-			{
-				normal[0].setValue(btScalar(1.0),0,0);
-			}
-
-			btPlaneSpace1(normal[0], normal[1], normal[2]);
-
-			for (int i=0;i<3;i++)
-			{
-				new (&m_jac[i]) btJacobianEntry(
-				m_rbA.getCenterOfMassTransform().getBasis().transpose(),
-				m_rbB.getCenterOfMassTransform().getBasis().transpose(),
-				pivotAInW - m_rbA.getCenterOfMassPosition(),
-				pivotBInW - m_rbB.getCenterOfMassPosition(),
-				normal[i],
-				m_rbA.getInvInertiaDiagLocal(),
-				m_rbA.getInvMass(),
-				m_rbB.getInvInertiaDiagLocal(),
-				m_rbB.getInvMass());
-			}
-		}
-
-		calcAngleInfo2(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform(),m_rbA.getInvInertiaTensorWorld(),m_rbB.getInvInertiaTensorWorld());
-	}
-}
-
-
-
-void	btConeTwistConstraint::solveConstraintObsolete(btRigidBody& bodyA,btRigidBody& bodyB,btScalar	timeStep)
-{
-	#ifndef __SPU__
-	if (m_useSolveConstraintObsolete)
-	{
-		btVector3 pivotAInW = m_rbA.getCenterOfMassTransform()*m_rbAFrame.getOrigin();
-		btVector3 pivotBInW = m_rbB.getCenterOfMassTransform()*m_rbBFrame.getOrigin();
-
-		btScalar tau = btScalar(0.3);
-
-		//linear part
-		if (!m_angularOnly)
-		{
-			btVector3 rel_pos1 = pivotAInW - m_rbA.getCenterOfMassPosition(); 
-			btVector3 rel_pos2 = pivotBInW - m_rbB.getCenterOfMassPosition();
-
-			btVector3 vel1;
-			bodyA.internalGetVelocityInLocalPointObsolete(rel_pos1,vel1);
-			btVector3 vel2;
-			bodyB.internalGetVelocityInLocalPointObsolete(rel_pos2,vel2);
-			btVector3 vel = vel1 - vel2;
-
-			for (int i=0;i<3;i++)
-			{		
-				const btVector3& normal = m_jac[i].m_linearJointAxis;
-				btScalar jacDiagABInv = btScalar(1.) / m_jac[i].getDiagonal();
-
-				btScalar rel_vel;
-				rel_vel = normal.dot(vel);
-				//positional error (zeroth order error)
-				btScalar depth = -(pivotAInW - pivotBInW).dot(normal); //this is the error projected on the normal
-				btScalar impulse = depth*tau/timeStep  * jacDiagABInv -  rel_vel * jacDiagABInv;
-				m_appliedImpulse += impulse;
-				
-				btVector3 ftorqueAxis1 = rel_pos1.cross(normal);
-				btVector3 ftorqueAxis2 = rel_pos2.cross(normal);
-				bodyA.internalApplyImpulse(normal*m_rbA.getInvMass(), m_rbA.getInvInertiaTensorWorld()*ftorqueAxis1,impulse);
-				bodyB.internalApplyImpulse(normal*m_rbB.getInvMass(), m_rbB.getInvInertiaTensorWorld()*ftorqueAxis2,-impulse);
-		
-			}
-		}
-
-		// apply motor
-		if (m_bMotorEnabled)
-		{
-			// compute current and predicted transforms
-			btTransform trACur = m_rbA.getCenterOfMassTransform();
-			btTransform trBCur = m_rbB.getCenterOfMassTransform();
-			btVector3 omegaA; bodyA.internalGetAngularVelocity(omegaA);
-			btVector3 omegaB; bodyB.internalGetAngularVelocity(omegaB);
-			btTransform trAPred; trAPred.setIdentity(); 
-			btVector3 zerovec(0,0,0);
-			btTransformUtil::integrateTransform(
-				trACur, zerovec, omegaA, timeStep, trAPred);
-			btTransform trBPred; trBPred.setIdentity(); 
-			btTransformUtil::integrateTransform(
-				trBCur, zerovec, omegaB, timeStep, trBPred);
-
-			// compute desired transforms in world
-			btTransform trPose(m_qTarget);
-			btTransform trABDes = m_rbBFrame * trPose * m_rbAFrame.inverse();
-			btTransform trADes = trBPred * trABDes;
-			btTransform trBDes = trAPred * trABDes.inverse();
-
-			// compute desired omegas in world
-			btVector3 omegaADes, omegaBDes;
-			
-			btTransformUtil::calculateVelocity(trACur, trADes, timeStep, zerovec, omegaADes);
-			btTransformUtil::calculateVelocity(trBCur, trBDes, timeStep, zerovec, omegaBDes);
-
-			// compute delta omegas
-			btVector3 dOmegaA = omegaADes - omegaA;
-			btVector3 dOmegaB = omegaBDes - omegaB;
-
-			// compute weighted avg axis of dOmega (weighting based on inertias)
-			btVector3 axisA, axisB;
-			btScalar kAxisAInv = 0, kAxisBInv = 0;
-
-			if (dOmegaA.length2() > SIMD_EPSILON)
-			{
-				axisA = dOmegaA.normalized();
-				kAxisAInv = getRigidBodyA().computeAngularImpulseDenominator(axisA);
-			}
-
-			if (dOmegaB.length2() > SIMD_EPSILON)
-			{
-				axisB = dOmegaB.normalized();
-				kAxisBInv = getRigidBodyB().computeAngularImpulseDenominator(axisB);
-			}
-
-			btVector3 avgAxis = kAxisAInv * axisA + kAxisBInv * axisB;
-
-			static bool bDoTorque = true;
-			if (bDoTorque && avgAxis.length2() > SIMD_EPSILON)
-			{
-				avgAxis.normalize();
-				kAxisAInv = getRigidBodyA().computeAngularImpulseDenominator(avgAxis);
-				kAxisBInv = getRigidBodyB().computeAngularImpulseDenominator(avgAxis);
-				btScalar kInvCombined = kAxisAInv + kAxisBInv;
-
-				btVector3 impulse = (kAxisAInv * dOmegaA - kAxisBInv * dOmegaB) /
-									(kInvCombined * kInvCombined);
-
-				if (m_maxMotorImpulse >= 0)
-				{
-					btScalar fMaxImpulse = m_maxMotorImpulse;
-					if (m_bNormalizedMotorStrength)
-						fMaxImpulse = fMaxImpulse/kAxisAInv;
-
-					btVector3 newUnclampedAccImpulse = m_accMotorImpulse + impulse;
-					btScalar  newUnclampedMag = newUnclampedAccImpulse.length();
-					if (newUnclampedMag > fMaxImpulse)
-					{
-						newUnclampedAccImpulse.normalize();
-						newUnclampedAccImpulse *= fMaxImpulse;
-						impulse = newUnclampedAccImpulse - m_accMotorImpulse;
-					}
-					m_accMotorImpulse += impulse;
-				}
-
-				btScalar  impulseMag  = impulse.length();
-				btVector3 impulseAxis =  impulse / impulseMag;
-
-				bodyA.internalApplyImpulse(btVector3(0,0,0), m_rbA.getInvInertiaTensorWorld()*impulseAxis, impulseMag);
-				bodyB.internalApplyImpulse(btVector3(0,0,0), m_rbB.getInvInertiaTensorWorld()*impulseAxis, -impulseMag);
-
-			}
-		}
-		else if (m_damping > SIMD_EPSILON) // no motor: do a little damping
-		{
-			btVector3 angVelA; bodyA.internalGetAngularVelocity(angVelA);
-			btVector3 angVelB; bodyB.internalGetAngularVelocity(angVelB);
-			btVector3 relVel = angVelB - angVelA;
-			if (relVel.length2() > SIMD_EPSILON)
-			{
-				btVector3 relVelAxis = relVel.normalized();
-				btScalar m_kDamping =  btScalar(1.) /
-					(getRigidBodyA().computeAngularImpulseDenominator(relVelAxis) +
-					 getRigidBodyB().computeAngularImpulseDenominator(relVelAxis));
-				btVector3 impulse = m_damping * m_kDamping * relVel;
-
-				btScalar  impulseMag  = impulse.length();
-				btVector3 impulseAxis = impulse / impulseMag;
-				bodyA.internalApplyImpulse(btVector3(0,0,0), m_rbA.getInvInertiaTensorWorld()*impulseAxis, impulseMag);
-				bodyB.internalApplyImpulse(btVector3(0,0,0), m_rbB.getInvInertiaTensorWorld()*impulseAxis, -impulseMag);
-			}
-		}
-
-		// joint limits
-		{
-			///solve angular part
-			btVector3 angVelA;
-			bodyA.internalGetAngularVelocity(angVelA);
-			btVector3 angVelB;
-			bodyB.internalGetAngularVelocity(angVelB);
-
-			// solve swing limit
-			if (m_solveSwingLimit)
-			{
-				btScalar amplitude = m_swingLimitRatio * m_swingCorrection*m_biasFactor/timeStep;
-				btScalar relSwingVel = (angVelB - angVelA).dot(m_swingAxis);
-				if (relSwingVel > 0)
-					amplitude += m_swingLimitRatio * relSwingVel * m_relaxationFactor;
-				btScalar impulseMag = amplitude * m_kSwing;
-
-				// Clamp the accumulated impulse
-				btScalar temp = m_accSwingLimitImpulse;
-				m_accSwingLimitImpulse = btMax(m_accSwingLimitImpulse + impulseMag, btScalar(0.0) );
-				impulseMag = m_accSwingLimitImpulse - temp;
-
-				btVector3 impulse = m_swingAxis * impulseMag;
-
-				// don't let cone response affect twist
-				// (this can happen since body A's twist doesn't match body B's AND we use an elliptical cone limit)
-				{
-					btVector3 impulseTwistCouple = impulse.dot(m_twistAxisA) * m_twistAxisA;
-					btVector3 impulseNoTwistCouple = impulse - impulseTwistCouple;
-					impulse = impulseNoTwistCouple;
-				}
-
-				impulseMag = impulse.length();
-				btVector3 noTwistSwingAxis = impulse / impulseMag;
-
-				bodyA.internalApplyImpulse(btVector3(0,0,0), m_rbA.getInvInertiaTensorWorld()*noTwistSwingAxis, impulseMag);
-				bodyB.internalApplyImpulse(btVector3(0,0,0), m_rbB.getInvInertiaTensorWorld()*noTwistSwingAxis, -impulseMag);
-			}
-
-
-			// solve twist limit
-			if (m_solveTwistLimit)
-			{
-				btScalar amplitude = m_twistLimitRatio * m_twistCorrection*m_biasFactor/timeStep;
-				btScalar relTwistVel = (angVelB - angVelA).dot( m_twistAxis );
-				if (relTwistVel > 0) // only damp when moving towards limit (m_twistAxis flipping is important)
-					amplitude += m_twistLimitRatio * relTwistVel * m_relaxationFactor;
-				btScalar impulseMag = amplitude * m_kTwist;
-
-				// Clamp the accumulated impulse
-				btScalar temp = m_accTwistLimitImpulse;
-				m_accTwistLimitImpulse = btMax(m_accTwistLimitImpulse + impulseMag, btScalar(0.0) );
-				impulseMag = m_accTwistLimitImpulse - temp;
-
-				btVector3 impulse = m_twistAxis * impulseMag;
-
-				bodyA.internalApplyImpulse(btVector3(0,0,0), m_rbA.getInvInertiaTensorWorld()*m_twistAxis,impulseMag);
-				bodyB.internalApplyImpulse(btVector3(0,0,0), m_rbB.getInvInertiaTensorWorld()*m_twistAxis,-impulseMag);
-			}		
-		}
-	}
-#else
-btAssert(0);
-#endif //__SPU__
-}
-
-
-
-
-void	btConeTwistConstraint::updateRHS(btScalar	timeStep)
-{
-	(void)timeStep;
-
-}
-
-
-#ifndef __SPU__
-void btConeTwistConstraint::calcAngleInfo()
-{
-	m_swingCorrection = btScalar(0.);
-	m_twistLimitSign = btScalar(0.);
-	m_solveTwistLimit = false;
-	m_solveSwingLimit = false;
-
-	btVector3 b1Axis1,b1Axis2,b1Axis3;
-	btVector3 b2Axis1,b2Axis2;
-
-	b1Axis1 = getRigidBodyA().getCenterOfMassTransform().getBasis() * this->m_rbAFrame.getBasis().getColumn(0);
-	b2Axis1 = getRigidBodyB().getCenterOfMassTransform().getBasis() * this->m_rbBFrame.getBasis().getColumn(0);
-
-	btScalar swing1=btScalar(0.),swing2 = btScalar(0.);
-
-	btScalar swx=btScalar(0.),swy = btScalar(0.);
-	btScalar thresh = btScalar(10.);
-	btScalar fact;
-
-	// Get Frame into world space
-	if (m_swingSpan1 >= btScalar(0.05f))
-	{
-		b1Axis2 = getRigidBodyA().getCenterOfMassTransform().getBasis() * this->m_rbAFrame.getBasis().getColumn(1);
-		swx = b2Axis1.dot(b1Axis1);
-		swy = b2Axis1.dot(b1Axis2);
-		swing1  = btAtan2Fast(swy, swx);
-		fact = (swy*swy + swx*swx) * thresh * thresh;
-		fact = fact / (fact + btScalar(1.0));
-		swing1 *= fact; 
-	}
-
-	if (m_swingSpan2 >= btScalar(0.05f))
-	{
-		b1Axis3 = getRigidBodyA().getCenterOfMassTransform().getBasis() * this->m_rbAFrame.getBasis().getColumn(2);			
-		swx = b2Axis1.dot(b1Axis1);
-		swy = b2Axis1.dot(b1Axis3);
-		swing2  = btAtan2Fast(swy, swx);
-		fact = (swy*swy + swx*swx) * thresh * thresh;
-		fact = fact / (fact + btScalar(1.0));
-		swing2 *= fact; 
-	}
-
-	btScalar RMaxAngle1Sq = 1.0f / (m_swingSpan1*m_swingSpan1);		
-	btScalar RMaxAngle2Sq = 1.0f / (m_swingSpan2*m_swingSpan2);	
-	btScalar EllipseAngle = btFabs(swing1*swing1)* RMaxAngle1Sq + btFabs(swing2*swing2) * RMaxAngle2Sq;
-
-	if (EllipseAngle > 1.0f)
-	{
-		m_swingCorrection = EllipseAngle-1.0f;
-		m_solveSwingLimit = true;
-		// Calculate necessary axis & factors
-		m_swingAxis = b2Axis1.cross(b1Axis2* b2Axis1.dot(b1Axis2) + b1Axis3* b2Axis1.dot(b1Axis3));
-		m_swingAxis.normalize();
-		btScalar swingAxisSign = (b2Axis1.dot(b1Axis1) >= 0.0f) ? 1.0f : -1.0f;
-		m_swingAxis *= swingAxisSign;
-	}
-
-	// Twist limits
-	if (m_twistSpan >= btScalar(0.))
-	{
-		btVector3 b2Axis2 = getRigidBodyB().getCenterOfMassTransform().getBasis() * this->m_rbBFrame.getBasis().getColumn(1);
-		btQuaternion rotationArc = shortestArcQuat(b2Axis1,b1Axis1);
-		btVector3 TwistRef = quatRotate(rotationArc,b2Axis2); 
-		btScalar twist = btAtan2Fast( TwistRef.dot(b1Axis3), TwistRef.dot(b1Axis2) );
-		m_twistAngle = twist;
-
-//		btScalar lockedFreeFactor = (m_twistSpan > btScalar(0.05f)) ? m_limitSoftness : btScalar(0.);
-		btScalar lockedFreeFactor = (m_twistSpan > btScalar(0.05f)) ? btScalar(1.0f) : btScalar(0.);
-		if (twist <= -m_twistSpan*lockedFreeFactor)
-		{
-			m_twistCorrection = -(twist + m_twistSpan);
-			m_solveTwistLimit = true;
-			m_twistAxis = (b2Axis1 + b1Axis1) * 0.5f;
-			m_twistAxis.normalize();
-			m_twistAxis *= -1.0f;
-		}
-		else if (twist >  m_twistSpan*lockedFreeFactor)
-		{
-			m_twistCorrection = (twist - m_twistSpan);
-			m_solveTwistLimit = true;
-			m_twistAxis = (b2Axis1 + b1Axis1) * 0.5f;
-			m_twistAxis.normalize();
-		}
-	}
-}
-#endif //__SPU__
-
-static btVector3 vTwist(1,0,0); // twist axis in constraint's space
-
-
-
-void btConeTwistConstraint::calcAngleInfo2(const btTransform& transA, const btTransform& transB, const btMatrix3x3& invInertiaWorldA,const btMatrix3x3& invInertiaWorldB)
-{
-	m_swingCorrection = btScalar(0.);
-	m_twistLimitSign = btScalar(0.);
-	m_solveTwistLimit = false;
-	m_solveSwingLimit = false;
-	// compute rotation of A wrt B (in constraint space)
-	if (m_bMotorEnabled && (!m_useSolveConstraintObsolete))
-	{	// it is assumed that setMotorTarget() was alredy called 
-		// and motor target m_qTarget is within constraint limits
-		// TODO : split rotation to pure swing and pure twist
-		// compute desired transforms in world
-		btTransform trPose(m_qTarget);
-		btTransform trA = transA * m_rbAFrame;
-		btTransform trB = transB * m_rbBFrame;
-		btTransform trDeltaAB = trB * trPose * trA.inverse();
-		btQuaternion qDeltaAB = trDeltaAB.getRotation();
-		btVector3 swingAxis = 	btVector3(qDeltaAB.x(), qDeltaAB.y(), qDeltaAB.z());
-		m_swingAxis = swingAxis;
-		m_swingAxis.normalize();
-		m_swingCorrection = qDeltaAB.getAngle();
-		if(!btFuzzyZero(m_swingCorrection))
-		{
-			m_solveSwingLimit = true;
-		}
-		return;
-	}
-
-
-	{
-		// compute rotation of A wrt B (in constraint space)
-		btQuaternion qA = transA.getRotation() * m_rbAFrame.getRotation();
-		btQuaternion qB = transB.getRotation() * m_rbBFrame.getRotation();
-		btQuaternion qAB = qB.inverse() * qA;
-		// split rotation into cone and twist
-		// (all this is done from B's perspective. Maybe I should be averaging axes...)
-		btVector3 vConeNoTwist = quatRotate(qAB, vTwist); vConeNoTwist.normalize();
-		btQuaternion qABCone  = shortestArcQuat(vTwist, vConeNoTwist); qABCone.normalize();
-		btQuaternion qABTwist = qABCone.inverse() * qAB; qABTwist.normalize();
-
-		if (m_swingSpan1 >= m_fixThresh && m_swingSpan2 >= m_fixThresh)
-		{
-			btScalar swingAngle, swingLimit = 0; btVector3 swingAxis;
-			computeConeLimitInfo(qABCone, swingAngle, swingAxis, swingLimit);
-
-			if (swingAngle > swingLimit * m_limitSoftness)
-			{
-				m_solveSwingLimit = true;
-
-				// compute limit ratio: 0->1, where
-				// 0 == beginning of soft limit
-				// 1 == hard/real limit
-				m_swingLimitRatio = 1.f;
-				if (swingAngle < swingLimit && m_limitSoftness < 1.f - SIMD_EPSILON)
-				{
-					m_swingLimitRatio = (swingAngle - swingLimit * m_limitSoftness)/
-										(swingLimit - swingLimit * m_limitSoftness);
-				}				
-
-				// swing correction tries to get back to soft limit
-				m_swingCorrection = swingAngle - (swingLimit * m_limitSoftness);
-
-				// adjustment of swing axis (based on ellipse normal)
-				adjustSwingAxisToUseEllipseNormal(swingAxis);
-
-				// Calculate necessary axis & factors		
-				m_swingAxis = quatRotate(qB, -swingAxis);
-
-				m_twistAxisA.setValue(0,0,0);
-
-				m_kSwing =  btScalar(1.) /
-					(computeAngularImpulseDenominator(m_swingAxis,invInertiaWorldA) +
-					 computeAngularImpulseDenominator(m_swingAxis,invInertiaWorldB));
-			}
-		}
-		else
-		{
-			// you haven't set any limits;
-			// or you're trying to set at least one of the swing limits too small. (if so, do you really want a conetwist constraint?)
-			// anyway, we have either hinge or fixed joint
-			btVector3 ivA = transA.getBasis() * m_rbAFrame.getBasis().getColumn(0);
-			btVector3 jvA = transA.getBasis() * m_rbAFrame.getBasis().getColumn(1);
-			btVector3 kvA = transA.getBasis() * m_rbAFrame.getBasis().getColumn(2);
-			btVector3 ivB = transB.getBasis() * m_rbBFrame.getBasis().getColumn(0);
-			btVector3 target;
-			btScalar x = ivB.dot(ivA);
-			btScalar y = ivB.dot(jvA);
-			btScalar z = ivB.dot(kvA);
-			if((m_swingSpan1 < m_fixThresh) && (m_swingSpan2 < m_fixThresh))
-			{ // fixed. We'll need to add one more row to constraint
-				if((!btFuzzyZero(y)) || (!(btFuzzyZero(z))))
-				{
-					m_solveSwingLimit = true;
-					m_swingAxis = -ivB.cross(ivA);
-				}
-			}
-			else
-			{
-				if(m_swingSpan1 < m_fixThresh)
-				{ // hinge around Y axis
-					if(!(btFuzzyZero(y)))
-					{
-						m_solveSwingLimit = true;
-						if(m_swingSpan2 >= m_fixThresh)
-						{
-							y = btScalar(0.f);
-							btScalar span2 = btAtan2(z, x);
-							if(span2 > m_swingSpan2)
-							{
-								x = btCos(m_swingSpan2);
-								z = btSin(m_swingSpan2);
-							}
-							else if(span2 < -m_swingSpan2)
-							{
-								x =  btCos(m_swingSpan2);
-								z = -btSin(m_swingSpan2);
-							}
-						}
-					}
-				}
-				else
-				{ // hinge around Z axis
-					if(!btFuzzyZero(z))
-					{
-						m_solveSwingLimit = true;
-						if(m_swingSpan1 >= m_fixThresh)
-						{
-							z = btScalar(0.f);
-							btScalar span1 = btAtan2(y, x);
-							if(span1 > m_swingSpan1)
-							{
-								x = btCos(m_swingSpan1);
-								y = btSin(m_swingSpan1);
-							}
-							else if(span1 < -m_swingSpan1)
-							{
-								x =  btCos(m_swingSpan1);
-								y = -btSin(m_swingSpan1);
-							}
-						}
-					}
-				}
-				target[0] = x * ivA[0] + y * jvA[0] + z * kvA[0];
-				target[1] = x * ivA[1] + y * jvA[1] + z * kvA[1];
-				target[2] = x * ivA[2] + y * jvA[2] + z * kvA[2];
-				target.normalize();
-				m_swingAxis = -ivB.cross(target);
-				m_swingCorrection = m_swingAxis.length();
-				m_swingAxis.normalize();
-			}
-		}
-
-		if (m_twistSpan >= btScalar(0.f))
-		{
-			btVector3 twistAxis;
-			computeTwistLimitInfo(qABTwist, m_twistAngle, twistAxis);
-
-			if (m_twistAngle > m_twistSpan*m_limitSoftness)
-			{
-				m_solveTwistLimit = true;
-
-				m_twistLimitRatio = 1.f;
-				if (m_twistAngle < m_twistSpan && m_limitSoftness < 1.f - SIMD_EPSILON)
-				{
-					m_twistLimitRatio = (m_twistAngle - m_twistSpan * m_limitSoftness)/
-										(m_twistSpan  - m_twistSpan * m_limitSoftness);
-				}
-
-				// twist correction tries to get back to soft limit
-				m_twistCorrection = m_twistAngle - (m_twistSpan * m_limitSoftness);
-
-				m_twistAxis = quatRotate(qB, -twistAxis);
-
-				m_kTwist = btScalar(1.) /
-					(computeAngularImpulseDenominator(m_twistAxis,invInertiaWorldA) +
-					 computeAngularImpulseDenominator(m_twistAxis,invInertiaWorldB));
-			}
-
-			if (m_solveSwingLimit)
-				m_twistAxisA = quatRotate(qA, -twistAxis);
-		}
-		else
-		{
-			m_twistAngle = btScalar(0.f);
-		}
-	}
-}
-
-
-
-// given a cone rotation in constraint space, (pre: twist must already be removed)
-// this method computes its corresponding swing angle and axis.
-// more interestingly, it computes the cone/swing limit (angle) for this cone "pose".
-void btConeTwistConstraint::computeConeLimitInfo(const btQuaternion& qCone,
-												 btScalar& swingAngle, // out
-												 btVector3& vSwingAxis, // out
-												 btScalar& swingLimit) // out
-{
-	swingAngle = qCone.getAngle();
-	if (swingAngle > SIMD_EPSILON)
-	{
-		vSwingAxis = btVector3(qCone.x(), qCone.y(), qCone.z());
-		vSwingAxis.normalize();
-		if (fabs(vSwingAxis.x()) > SIMD_EPSILON)
-		{
-			// non-zero twist?! this should never happen.
-			int wtf = 0; wtf = wtf;
-		}
-
-		// Compute limit for given swing. tricky:
-		// Given a swing axis, we're looking for the intersection with the bounding cone ellipse.
-		// (Since we're dealing with angles, this ellipse is embedded on the surface of a sphere.)
-
-		// For starters, compute the direction from center to surface of ellipse.
-		// This is just the perpendicular (ie. rotate 2D vector by PI/2) of the swing axis.
-		// (vSwingAxis is the cone rotation (in z,y); change vars and rotate to (x,y) coords.)
-		btScalar xEllipse =  vSwingAxis.y();
-		btScalar yEllipse = -vSwingAxis.z();
-
-		// Now, we use the slope of the vector (using x/yEllipse) and find the length
-		// of the line that intersects the ellipse:
-		//  x^2   y^2
-		//  --- + --- = 1, where a and b are semi-major axes 2 and 1 respectively (ie. the limits)
-		//  a^2   b^2
-		// Do the math and it should be clear.
-
-		swingLimit = m_swingSpan1; // if xEllipse == 0, we have a pure vSwingAxis.z rotation: just use swingspan1
-		if (fabs(xEllipse) > SIMD_EPSILON)
-		{
-			btScalar surfaceSlope2 = (yEllipse*yEllipse)/(xEllipse*xEllipse);
-			btScalar norm = 1 / (m_swingSpan2 * m_swingSpan2);
-			norm += surfaceSlope2 / (m_swingSpan1 * m_swingSpan1);
-			btScalar swingLimit2 = (1 + surfaceSlope2) / norm;
-			swingLimit = sqrt(swingLimit2);
-		}
-
-		// test!
-		/*swingLimit = m_swingSpan2;
-		if (fabs(vSwingAxis.z()) > SIMD_EPSILON)
-		{
-		btScalar mag_2 = m_swingSpan1*m_swingSpan1 + m_swingSpan2*m_swingSpan2;
-		btScalar sinphi = m_swingSpan2 / sqrt(mag_2);
-		btScalar phi = asin(sinphi);
-		btScalar theta = atan2(fabs(vSwingAxis.y()),fabs(vSwingAxis.z()));
-		btScalar alpha = 3.14159f - theta - phi;
-		btScalar sinalpha = sin(alpha);
-		swingLimit = m_swingSpan1 * sinphi/sinalpha;
-		}*/
-	}
-	else if (swingAngle < 0)
-	{
-		// this should never happen!
-		int wtf = 0; wtf = wtf;
-	}
-}
-
-btVector3 btConeTwistConstraint::GetPointForAngle(btScalar fAngleInRadians, btScalar fLength) const
-{
-	// compute x/y in ellipse using cone angle (0 -> 2*PI along surface of cone)
-	btScalar xEllipse = btCos(fAngleInRadians);
-	btScalar yEllipse = btSin(fAngleInRadians);
-
-	// Use the slope of the vector (using x/yEllipse) and find the length
-	// of the line that intersects the ellipse:
-	//  x^2   y^2
-	//  --- + --- = 1, where a and b are semi-major axes 2 and 1 respectively (ie. the limits)
-	//  a^2   b^2
-	// Do the math and it should be clear.
-
-	float swingLimit = m_swingSpan1; // if xEllipse == 0, just use axis b (1)
-	if (fabs(xEllipse) > SIMD_EPSILON)
-	{
-		btScalar surfaceSlope2 = (yEllipse*yEllipse)/(xEllipse*xEllipse);
-		btScalar norm = 1 / (m_swingSpan2 * m_swingSpan2);
-		norm += surfaceSlope2 / (m_swingSpan1 * m_swingSpan1);
-		btScalar swingLimit2 = (1 + surfaceSlope2) / norm;
-		swingLimit = sqrt(swingLimit2);
-	}
-
-	// convert into point in constraint space:
-	// note: twist is x-axis, swing 1 and 2 are along the z and y axes respectively
-	btVector3 vSwingAxis(0, xEllipse, -yEllipse);
-	btQuaternion qSwing(vSwingAxis, swingLimit);
-	btVector3 vPointInConstraintSpace(fLength,0,0);
-	return quatRotate(qSwing, vPointInConstraintSpace);
-}
-
-// given a twist rotation in constraint space, (pre: cone must already be removed)
-// this method computes its corresponding angle and axis.
-void btConeTwistConstraint::computeTwistLimitInfo(const btQuaternion& qTwist,
-												  btScalar& twistAngle, // out
-												  btVector3& vTwistAxis) // out
-{
-	btQuaternion qMinTwist = qTwist;
-	twistAngle = qTwist.getAngle();
-
-	if (twistAngle > SIMD_PI) // long way around. flip quat and recalculate.
-	{
-		qMinTwist = operator-(qTwist);
-		twistAngle = qMinTwist.getAngle();
-	}
-	if (twistAngle < 0)
-	{
-		// this should never happen
-		int wtf = 0; wtf = wtf;			
-	}
-
-	vTwistAxis = btVector3(qMinTwist.x(), qMinTwist.y(), qMinTwist.z());
-	if (twistAngle > SIMD_EPSILON)
-		vTwistAxis.normalize();
-}
-
-
-void btConeTwistConstraint::adjustSwingAxisToUseEllipseNormal(btVector3& vSwingAxis) const
-{
-	// the swing axis is computed as the "twist-free" cone rotation,
-	// but the cone limit is not circular, but elliptical (if swingspan1 != swingspan2).
-	// so, if we're outside the limits, the closest way back inside the cone isn't 
-	// along the vector back to the center. better (and more stable) to use the ellipse normal.
-
-	// convert swing axis to direction from center to surface of ellipse
-	// (ie. rotate 2D vector by PI/2)
-	btScalar y = -vSwingAxis.z();
-	btScalar z =  vSwingAxis.y();
-
-	// do the math...
-	if (fabs(z) > SIMD_EPSILON) // avoid division by 0. and we don't need an update if z == 0.
-	{
-		// compute gradient/normal of ellipse surface at current "point"
-		btScalar grad = y/z;
-		grad *= m_swingSpan2 / m_swingSpan1;
-
-		// adjust y/z to represent normal at point (instead of vector to point)
-		if (y > 0)
-			y =  fabs(grad * z);
-		else
-			y = -fabs(grad * z);
-
-		// convert ellipse direction back to swing axis
-		vSwingAxis.setZ(-y);
-		vSwingAxis.setY( z);
-		vSwingAxis.normalize();
-	}
-}
-
-
-
-void btConeTwistConstraint::setMotorTarget(const btQuaternion &q)
-{
-	btTransform trACur = m_rbA.getCenterOfMassTransform();
-	btTransform trBCur = m_rbB.getCenterOfMassTransform();
-	btTransform trABCur = trBCur.inverse() * trACur;
-	btQuaternion qABCur = trABCur.getRotation();
-	btTransform trConstraintCur = (trBCur * m_rbBFrame).inverse() * (trACur * m_rbAFrame);
-	btQuaternion qConstraintCur = trConstraintCur.getRotation();
-
-	btQuaternion qConstraint = m_rbBFrame.getRotation().inverse() * q * m_rbAFrame.getRotation();
-	setMotorTargetInConstraintSpace(qConstraint);
-}
-
-
-void btConeTwistConstraint::setMotorTargetInConstraintSpace(const btQuaternion &q)
-{
-	m_qTarget = q;
-
-	// clamp motor target to within limits
-	{
-		btScalar softness = 1.f;//m_limitSoftness;
-
-		// split into twist and cone
-		btVector3 vTwisted = quatRotate(m_qTarget, vTwist);
-		btQuaternion qTargetCone  = shortestArcQuat(vTwist, vTwisted); qTargetCone.normalize();
-		btQuaternion qTargetTwist = qTargetCone.inverse() * m_qTarget; qTargetTwist.normalize();
-
-		// clamp cone
-		if (m_swingSpan1 >= btScalar(0.05f) && m_swingSpan2 >= btScalar(0.05f))
-		{
-			btScalar swingAngle, swingLimit; btVector3 swingAxis;
-			computeConeLimitInfo(qTargetCone, swingAngle, swingAxis, swingLimit);
-
-			if (fabs(swingAngle) > SIMD_EPSILON)
-			{
-				if (swingAngle > swingLimit*softness)
-					swingAngle = swingLimit*softness;
-				else if (swingAngle < -swingLimit*softness)
-					swingAngle = -swingLimit*softness;
-				qTargetCone = btQuaternion(swingAxis, swingAngle);
-			}
-		}
-
-		// clamp twist
-		if (m_twistSpan >= btScalar(0.05f))
-		{
-			btScalar twistAngle; btVector3 twistAxis;
-			computeTwistLimitInfo(qTargetTwist, twistAngle, twistAxis);
-
-			if (fabs(twistAngle) > SIMD_EPSILON)
-			{
-				// eddy todo: limitSoftness used here???
-				if (twistAngle > m_twistSpan*softness)
-					twistAngle = m_twistSpan*softness;
-				else if (twistAngle < -m_twistSpan*softness)
-					twistAngle = -m_twistSpan*softness;
-				qTargetTwist = btQuaternion(twistAxis, twistAngle);
-			}
-		}
-
-		m_qTarget = qTargetCone * qTargetTwist;
-	}
-}
-
-///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
-///If no axis is provided, it uses the default axis for this constraint.
-void btConeTwistConstraint::setParam(int num, btScalar value, int axis)
-{
-	switch(num)
-	{
-		case BT_CONSTRAINT_ERP :
-		case BT_CONSTRAINT_STOP_ERP :
-			if((axis >= 0) && (axis < 3)) 
-			{
-				m_linERP = value;
-				m_flags |= BT_CONETWIST_FLAGS_LIN_ERP;
-			}
-			else
-			{
-				m_biasFactor = value;
-			}
-			break;
-		case BT_CONSTRAINT_CFM :
-		case BT_CONSTRAINT_STOP_CFM :
-			if((axis >= 0) && (axis < 3)) 
-			{
-				m_linCFM = value;
-				m_flags |= BT_CONETWIST_FLAGS_LIN_CFM;
-			}
-			else
-			{
-				m_angCFM = value;
-				m_flags |= BT_CONETWIST_FLAGS_ANG_CFM;
-			}
-			break;
-		default:
-			btAssertConstrParams(0);
-			break;
-	}
-}
-
-///return the local value of parameter
-btScalar btConeTwistConstraint::getParam(int num, int axis) const 
-{
-	btScalar retVal = 0;
-	switch(num)
-	{
-		case BT_CONSTRAINT_ERP :
-		case BT_CONSTRAINT_STOP_ERP :
-			if((axis >= 0) && (axis < 3)) 
-			{
-				btAssertConstrParams(m_flags & BT_CONETWIST_FLAGS_LIN_ERP);
-				retVal = m_linERP;
-			}
-			else if((axis >= 3) && (axis < 6)) 
-			{
-				retVal = m_biasFactor;
-			}
-			else
-			{
-				btAssertConstrParams(0);
-			}
-			break;
-		case BT_CONSTRAINT_CFM :
-		case BT_CONSTRAINT_STOP_CFM :
-			if((axis >= 0) && (axis < 3)) 
-			{
-				btAssertConstrParams(m_flags & BT_CONETWIST_FLAGS_LIN_CFM);
-				retVal = m_linCFM;
-			}
-			else if((axis >= 3) && (axis < 6)) 
-			{
-				btAssertConstrParams(m_flags & BT_CONETWIST_FLAGS_ANG_CFM);
-				retVal = m_angCFM;
-			}
-			else
-			{
-				btAssertConstrParams(0);
-			}
-			break;
-		default : 
-			btAssertConstrParams(0);
-	}
-	return retVal;
-}
-
-
-void btConeTwistConstraint::setFrames(const btTransform & frameA, const btTransform & frameB)
-{
-	m_rbAFrame = frameA;
-	m_rbBFrame = frameB;
-	buildJacobian();
-	//calculateTransforms();
-}
-
- 
-
-
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h
deleted file mode 100644
index 868e62f..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-btConeTwistConstraint is Copyright (c) 2007 Starbreeze Studios
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-
-Written by: Marcus Hennix
-*/
-
-
-
-/*
-Overview:
-
-btConeTwistConstraint can be used to simulate ragdoll joints (upper arm, leg etc).
-It is a fixed translation, 3 degree-of-freedom (DOF) rotational "joint".
-It divides the 3 rotational DOFs into swing (movement within a cone) and twist.
-Swing is divided into swing1 and swing2 which can have different limits, giving an elliptical shape.
-(Note: the cone's base isn't flat, so this ellipse is "embedded" on the surface of a sphere.)
-
-In the contraint's frame of reference:
-twist is along the x-axis,
-and swing 1 and 2 are along the z and y axes respectively.
-*/
-
-
-
-#ifndef BT_CONETWISTCONSTRAINT_H
-#define BT_CONETWISTCONSTRAINT_H
-
-#include "LinearMath/btVector3.h"
-#include "btJacobianEntry.h"
-#include "btTypedConstraint.h"
-
-class btRigidBody;
-
-enum btConeTwistFlags
-{
-	BT_CONETWIST_FLAGS_LIN_CFM = 1,
-	BT_CONETWIST_FLAGS_LIN_ERP = 2,
-	BT_CONETWIST_FLAGS_ANG_CFM = 4
-};
-
-///btConeTwistConstraint can be used to simulate ragdoll joints (upper arm, leg etc)
-class btConeTwistConstraint : public btTypedConstraint
-{
-#ifdef IN_PARALLELL_SOLVER
-public:
-#endif
-	btJacobianEntry	m_jac[3]; //3 orthogonal linear constraints
-
-	btTransform m_rbAFrame; 
-	btTransform m_rbBFrame;
-
-	btScalar	m_limitSoftness;
-	btScalar	m_biasFactor;
-	btScalar	m_relaxationFactor;
-
-	btScalar	m_damping;
-
-	btScalar	m_swingSpan1;
-	btScalar	m_swingSpan2;
-	btScalar	m_twistSpan;
-
-	btScalar	m_fixThresh;
-
-	btVector3   m_swingAxis;
-	btVector3	m_twistAxis;
-
-	btScalar	m_kSwing;
-	btScalar	m_kTwist;
-
-	btScalar	m_twistLimitSign;
-	btScalar	m_swingCorrection;
-	btScalar	m_twistCorrection;
-
-	btScalar	m_twistAngle;
-
-	btScalar	m_accSwingLimitImpulse;
-	btScalar	m_accTwistLimitImpulse;
-
-	bool		m_angularOnly;
-	bool		m_solveTwistLimit;
-	bool		m_solveSwingLimit;
-
-	bool	m_useSolveConstraintObsolete;
-
-	// not yet used...
-	btScalar	m_swingLimitRatio;
-	btScalar	m_twistLimitRatio;
-	btVector3   m_twistAxisA;
-
-	// motor
-	bool		 m_bMotorEnabled;
-	bool		 m_bNormalizedMotorStrength;
-	btQuaternion m_qTarget;
-	btScalar	 m_maxMotorImpulse;
-	btVector3	 m_accMotorImpulse;
-	
-	// parameters
-	int			m_flags;
-	btScalar	m_linCFM;
-	btScalar	m_linERP;
-	btScalar	m_angCFM;
-	
-protected:
-
-	void init();
-
-	void computeConeLimitInfo(const btQuaternion& qCone, // in
-		btScalar& swingAngle, btVector3& vSwingAxis, btScalar& swingLimit); // all outs
-
-	void computeTwistLimitInfo(const btQuaternion& qTwist, // in
-		btScalar& twistAngle, btVector3& vTwistAxis); // all outs
-
-	void adjustSwingAxisToUseEllipseNormal(btVector3& vSwingAxis) const;
-
-
-public:
-
-	btConeTwistConstraint(btRigidBody& rbA,btRigidBody& rbB,const btTransform& rbAFrame, const btTransform& rbBFrame);
-	
-	btConeTwistConstraint(btRigidBody& rbA,const btTransform& rbAFrame);
-
-	virtual void	buildJacobian();
-
-	virtual void getInfo1 (btConstraintInfo1* info);
-
-	void	getInfo1NonVirtual(btConstraintInfo1* info);
-	
-	virtual void getInfo2 (btConstraintInfo2* info);
-	
-	void	getInfo2NonVirtual(btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btMatrix3x3& invInertiaWorldA,const btMatrix3x3& invInertiaWorldB);
-
-	virtual	void	solveConstraintObsolete(btRigidBody& bodyA,btRigidBody& bodyB,btScalar	timeStep);
-
-	void	updateRHS(btScalar	timeStep);
-
-
-	const btRigidBody& getRigidBodyA() const
-	{
-		return m_rbA;
-	}
-	const btRigidBody& getRigidBodyB() const
-	{
-		return m_rbB;
-	}
-
-	void	setAngularOnly(bool angularOnly)
-	{
-		m_angularOnly = angularOnly;
-	}
-
-	void	setLimit(int limitIndex,btScalar limitValue)
-	{
-		switch (limitIndex)
-		{
-		case 3:
-			{
-				m_twistSpan = limitValue;
-				break;
-			}
-		case 4:
-			{
-				m_swingSpan2 = limitValue;
-				break;
-			}
-		case 5:
-			{
-				m_swingSpan1 = limitValue;
-				break;
-			}
-		default:
-			{
-			}
-		};
-	}
-
-	// setLimit(), a few notes:
-	// _softness:
-	//		0->1, recommend ~0.8->1.
-	//		describes % of limits where movement is free.
-	//		beyond this softness %, the limit is gradually enforced until the "hard" (1.0) limit is reached.
-	// _biasFactor:
-	//		0->1?, recommend 0.3 +/-0.3 or so.
-	//		strength with which constraint resists zeroth order (angular, not angular velocity) limit violation.
-	// __relaxationFactor:
-	//		0->1, recommend to stay near 1.
-	//		the lower the value, the less the constraint will fight velocities which violate the angular limits.
-	void	setLimit(btScalar _swingSpan1,btScalar _swingSpan2,btScalar _twistSpan, btScalar _softness = 1.f, btScalar _biasFactor = 0.3f, btScalar _relaxationFactor = 1.0f)
-	{
-		m_swingSpan1 = _swingSpan1;
-		m_swingSpan2 = _swingSpan2;
-		m_twistSpan  = _twistSpan;
-
-		m_limitSoftness =  _softness;
-		m_biasFactor = _biasFactor;
-		m_relaxationFactor = _relaxationFactor;
-	}
-
-	const btTransform& getAFrame() { return m_rbAFrame; };	
-	const btTransform& getBFrame() { return m_rbBFrame; };
-
-	inline int getSolveTwistLimit()
-	{
-		return m_solveTwistLimit;
-	}
-
-	inline int getSolveSwingLimit()
-	{
-		return m_solveTwistLimit;
-	}
-
-	inline btScalar getTwistLimitSign()
-	{
-		return m_twistLimitSign;
-	}
-
-	void calcAngleInfo();
-	void calcAngleInfo2(const btTransform& transA, const btTransform& transB,const btMatrix3x3& invInertiaWorldA,const btMatrix3x3& invInertiaWorldB);
-
-	inline btScalar getSwingSpan1()
-	{
-		return m_swingSpan1;
-	}
-	inline btScalar getSwingSpan2()
-	{
-		return m_swingSpan2;
-	}
-	inline btScalar getTwistSpan()
-	{
-		return m_twistSpan;
-	}
-	inline btScalar getTwistAngle()
-	{
-		return m_twistAngle;
-	}
-	bool isPastSwingLimit() { return m_solveSwingLimit; }
-
-	void setDamping(btScalar damping) { m_damping = damping; }
-
-	void enableMotor(bool b) { m_bMotorEnabled = b; }
-	void setMaxMotorImpulse(btScalar maxMotorImpulse) { m_maxMotorImpulse = maxMotorImpulse; m_bNormalizedMotorStrength = false; }
-	void setMaxMotorImpulseNormalized(btScalar maxMotorImpulse) { m_maxMotorImpulse = maxMotorImpulse; m_bNormalizedMotorStrength = true; }
-
-	btScalar getFixThresh() { return m_fixThresh; }
-	void setFixThresh(btScalar fixThresh) { m_fixThresh = fixThresh; }
-
-	// setMotorTarget:
-	// q: the desired rotation of bodyA wrt bodyB.
-	// note: if q violates the joint limits, the internal target is clamped to avoid conflicting impulses (very bad for stability)
-	// note: don't forget to enableMotor()
-	void setMotorTarget(const btQuaternion &q);
-
-	// same as above, but q is the desired rotation of frameA wrt frameB in constraint space
-	void setMotorTargetInConstraintSpace(const btQuaternion &q);
-
-	btVector3 GetPointForAngle(btScalar fAngleInRadians, btScalar fLength) const;
-
-	///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
-	///If no axis is provided, it uses the default axis for this constraint.
-	virtual	void setParam(int num, btScalar value, int axis = -1);
-
-	virtual void setFrames(const btTransform& frameA, const btTransform& frameB);
-
-	const btTransform& getFrameOffsetA() const
-	{
-		return m_rbAFrame;
-	}
-
-	const btTransform& getFrameOffsetB() const
-	{
-		return m_rbBFrame;
-	}
-
-
-	///return the local value of parameter
-	virtual	btScalar getParam(int num, int axis = -1) const;
-
-	virtual	int	calculateSerializeBufferSize() const;
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
-
-};
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btConeTwistConstraintData
-{
-	btTypedConstraintData	m_typeConstraintData;
-	btTransformFloatData m_rbAFrame;
-	btTransformFloatData m_rbBFrame;
-
-	//limits
-	float	m_swingSpan1;
-	float	m_swingSpan2;
-	float	m_twistSpan;
-	float	m_limitSoftness;
-	float	m_biasFactor;
-	float	m_relaxationFactor;
-
-	float	m_damping;
-		
-	char m_pad[4];
-
-};
-	
-
-
-SIMD_FORCE_INLINE int	btConeTwistConstraint::calculateSerializeBufferSize() const
-{
-	return sizeof(btConeTwistConstraintData);
-
-}
-
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-SIMD_FORCE_INLINE const char*	btConeTwistConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-	btConeTwistConstraintData* cone = (btConeTwistConstraintData*) dataBuffer;
-	btTypedConstraint::serialize(&cone->m_typeConstraintData,serializer);
-
-	m_rbAFrame.serializeFloat(cone->m_rbAFrame);
-	m_rbBFrame.serializeFloat(cone->m_rbBFrame);
-	
-	cone->m_swingSpan1 = float(m_swingSpan1);
-	cone->m_swingSpan2 = float(m_swingSpan2);
-	cone->m_twistSpan = float(m_twistSpan);
-	cone->m_limitSoftness = float(m_limitSoftness);
-	cone->m_biasFactor = float(m_biasFactor);
-	cone->m_relaxationFactor = float(m_relaxationFactor);
-	cone->m_damping = float(m_damping);
-
-	return "btConeTwistConstraintData";
-}
-
-
-#endif //BT_CONETWISTCONSTRAINT_H
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h
deleted file mode 100644
index 6f67310..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_CONSTRAINT_SOLVER_H
-#define BT_CONSTRAINT_SOLVER_H
-
-#include "LinearMath/btScalar.h"
-
-class btPersistentManifold;
-class btRigidBody;
-class btCollisionObject;
-class btTypedConstraint;
-struct btContactSolverInfo;
-struct btBroadphaseProxy;
-class btIDebugDraw;
-class btStackAlloc;
-class	btDispatcher;
-/// btConstraintSolver provides solver interface
-class btConstraintSolver
-{
-
-public:
-
-	virtual ~btConstraintSolver() {}
-	
-	virtual void prepareSolve (int /* numBodies */, int /* numManifolds */) {;}
-
-	///solve a group of constraints
-	virtual btScalar solveGroup(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifold,int numManifolds,btTypedConstraint** constraints,int numConstraints, const btContactSolverInfo& info,class btIDebugDraw* debugDrawer, btStackAlloc* stackAlloc,btDispatcher* dispatcher) = 0;
-
-	virtual void allSolved (const btContactSolverInfo& /* info */,class btIDebugDraw* /* debugDrawer */, btStackAlloc* /* stackAlloc */) {;}
-
-	///clear internal cached data and reset random seed
-	virtual	void	reset() = 0;
-};
-
-
-
-
-#endif //BT_CONSTRAINT_SOLVER_H
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp
deleted file mode 100644
index 8885918..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "btContactConstraint.h"
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-#include "LinearMath/btVector3.h"
-#include "btJacobianEntry.h"
-#include "btContactSolverInfo.h"
-#include "LinearMath/btMinMax.h"
-#include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h"
-
-
-
-btContactConstraint::btContactConstraint(btPersistentManifold* contactManifold,btRigidBody& rbA,btRigidBody& rbB)
-:btTypedConstraint(CONTACT_CONSTRAINT_TYPE,rbA,rbB),
-	m_contactManifold(*contactManifold)
-{
-
-}
-
-btContactConstraint::~btContactConstraint()
-{
-
-}
-
-void	btContactConstraint::setContactManifold(btPersistentManifold* contactManifold)
-{
-	m_contactManifold = *contactManifold;
-}
-
-void btContactConstraint::getInfo1 (btConstraintInfo1* info)
-{
-
-}
-
-void btContactConstraint::getInfo2 (btConstraintInfo2* info)
-{
-
-}
-
-void	btContactConstraint::buildJacobian()
-{
-
-}
-
-
-
-
-
-#include "btContactConstraint.h"
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-#include "LinearMath/btVector3.h"
-#include "btJacobianEntry.h"
-#include "btContactSolverInfo.h"
-#include "LinearMath/btMinMax.h"
-#include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h"
-
-
-
-//response  between two dynamic objects without friction, assuming 0 penetration depth
-btScalar resolveSingleCollision(
-        btRigidBody* body1,
-        btCollisionObject* colObj2,
-		const btVector3& contactPositionWorld,
-		const btVector3& contactNormalOnB,
-        const btContactSolverInfo& solverInfo,
-		btScalar distance)
-{
-	btRigidBody* body2 = btRigidBody::upcast(colObj2);
-    
-	
-    const btVector3& normal = contactNormalOnB;
-
-    btVector3 rel_pos1 = contactPositionWorld - body1->getWorldTransform().getOrigin(); 
-    btVector3 rel_pos2 = contactPositionWorld - colObj2->getWorldTransform().getOrigin();
-    
-    btVector3 vel1 = body1->getVelocityInLocalPoint(rel_pos1);
-	btVector3 vel2 = body2? body2->getVelocityInLocalPoint(rel_pos2) : btVector3(0,0,0);
-    btVector3 vel = vel1 - vel2;
-    btScalar rel_vel;
-    rel_vel = normal.dot(vel);
-    
-    btScalar combinedRestitution = body1->getRestitution() * colObj2->getRestitution();
-    btScalar restitution = combinedRestitution* -rel_vel;
-
-    btScalar positionalError = solverInfo.m_erp *-distance /solverInfo.m_timeStep ;
-    btScalar velocityError = -(1.0f + restitution) * rel_vel;// * damping;
-	btScalar denom0 = body1->computeImpulseDenominator(contactPositionWorld,normal);
-	btScalar denom1 = body2? body2->computeImpulseDenominator(contactPositionWorld,normal) : 0.f;
-	btScalar relaxation = 1.f;
-	btScalar jacDiagABInv = relaxation/(denom0+denom1);
-
-    btScalar penetrationImpulse = positionalError * jacDiagABInv;
-    btScalar velocityImpulse = velocityError * jacDiagABInv;
-
-    btScalar normalImpulse = penetrationImpulse+velocityImpulse;
-    normalImpulse = 0.f > normalImpulse ? 0.f: normalImpulse;
-
-	body1->applyImpulse(normal*(normalImpulse), rel_pos1);
-    if (body2)
-		body2->applyImpulse(-normal*(normalImpulse), rel_pos2);
-    
-    return normalImpulse;
-}
-
-
-//bilateral constraint between two dynamic objects
-void resolveSingleBilateral(btRigidBody& body1, const btVector3& pos1,
-                      btRigidBody& body2, const btVector3& pos2,
-                      btScalar distance, const btVector3& normal,btScalar& impulse ,btScalar timeStep)
-{
-	(void)timeStep;
-	(void)distance;
-
-
-	btScalar normalLenSqr = normal.length2();
-	btAssert(btFabs(normalLenSqr) < btScalar(1.1));
-	if (normalLenSqr > btScalar(1.1))
-	{
-		impulse = btScalar(0.);
-		return;
-	}
-	btVector3 rel_pos1 = pos1 - body1.getCenterOfMassPosition(); 
-	btVector3 rel_pos2 = pos2 - body2.getCenterOfMassPosition();
-	//this jacobian entry could be re-used for all iterations
-	
-	btVector3 vel1 = body1.getVelocityInLocalPoint(rel_pos1);
-	btVector3 vel2 = body2.getVelocityInLocalPoint(rel_pos2);
-	btVector3 vel = vel1 - vel2;
-	
-
-	   btJacobianEntry jac(body1.getCenterOfMassTransform().getBasis().transpose(),
-		body2.getCenterOfMassTransform().getBasis().transpose(),
-		rel_pos1,rel_pos2,normal,body1.getInvInertiaDiagLocal(),body1.getInvMass(),
-		body2.getInvInertiaDiagLocal(),body2.getInvMass());
-
-	btScalar jacDiagAB = jac.getDiagonal();
-	btScalar jacDiagABInv = btScalar(1.) / jacDiagAB;
-	
-	  btScalar rel_vel = jac.getRelativeVelocity(
-		body1.getLinearVelocity(),
-		body1.getCenterOfMassTransform().getBasis().transpose() * body1.getAngularVelocity(),
-		body2.getLinearVelocity(),
-		body2.getCenterOfMassTransform().getBasis().transpose() * body2.getAngularVelocity()); 
-	btScalar a;
-	a=jacDiagABInv;
-
-
-	rel_vel = normal.dot(vel);
-	
-	//todo: move this into proper structure
-	btScalar contactDamping = btScalar(0.2);
-
-#ifdef ONLY_USE_LINEAR_MASS
-	btScalar massTerm = btScalar(1.) / (body1.getInvMass() + body2.getInvMass());
-	impulse = - contactDamping * rel_vel * massTerm;
-#else	
-	btScalar velocityImpulse = -contactDamping * rel_vel * jacDiagABInv;
-	impulse = velocityImpulse;
-#endif
-}
-
-
-
-
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btContactConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btContactConstraint.h
deleted file mode 100644
index 477c79d..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btContactConstraint.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_CONTACT_CONSTRAINT_H
-#define BT_CONTACT_CONSTRAINT_H
-
-#include "LinearMath/btVector3.h"
-#include "btJacobianEntry.h"
-#include "btTypedConstraint.h"
-#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
-
-///btContactConstraint can be automatically created to solve contact constraints using the unified btTypedConstraint interface
-ATTRIBUTE_ALIGNED16(class) btContactConstraint : public btTypedConstraint
-{
-protected:
-
-	btPersistentManifold m_contactManifold;
-
-public:
-
-
-	btContactConstraint(btPersistentManifold* contactManifold,btRigidBody& rbA,btRigidBody& rbB);
-
-	void	setContactManifold(btPersistentManifold* contactManifold);
-
-	btPersistentManifold* getContactManifold()
-	{
-		return &m_contactManifold;
-	}
-
-	const btPersistentManifold* getContactManifold() const
-	{
-		return &m_contactManifold;
-	}
-
-	virtual ~btContactConstraint();
-
-	virtual void getInfo1 (btConstraintInfo1* info);
-
-	virtual void getInfo2 (btConstraintInfo2* info);
-
-	///obsolete methods
-	virtual void	buildJacobian();
-
-
-};
-
-///very basic collision resolution without friction
-btScalar resolveSingleCollision(btRigidBody* body1, class btCollisionObject* colObj2, const btVector3& contactPositionWorld,const btVector3& contactNormalOnB, const struct btContactSolverInfo& solverInfo,btScalar distance);
-
-
-///resolveSingleBilateral is an obsolete methods used for vehicle friction between two dynamic objects
-void resolveSingleBilateral(btRigidBody& body1, const btVector3& pos1,
-                      btRigidBody& body2, const btVector3& pos2,
-                      btScalar distance, const btVector3& normal,btScalar& impulse ,btScalar timeStep);
-
-
-
-#endif //BT_CONTACT_CONSTRAINT_H
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btContactSolverInfo.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btContactSolverInfo.h
deleted file mode 100644
index 6204cb3..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btContactSolverInfo.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_CONTACT_SOLVER_INFO
-#define BT_CONTACT_SOLVER_INFO
-
-enum	btSolverMode
-{
-	SOLVER_RANDMIZE_ORDER = 1,
-	SOLVER_FRICTION_SEPARATE = 2,
-	SOLVER_USE_WARMSTARTING = 4,
-	SOLVER_USE_FRICTION_WARMSTARTING = 8,
-	SOLVER_USE_2_FRICTION_DIRECTIONS = 16,
-	SOLVER_ENABLE_FRICTION_DIRECTION_CACHING = 32,
-	SOLVER_DISABLE_VELOCITY_DEPENDENT_FRICTION_DIRECTION = 64,
-	SOLVER_CACHE_FRIENDLY = 128,
-	SOLVER_SIMD = 256,	//enabled for Windows, the solver innerloop is branchless SIMD, 40% faster than FPU/scalar version
-	SOLVER_CUDA = 512	//will be open sourced during Game Developers Conference 2009. Much faster.
-};
-
-struct btContactSolverInfoData
-{
-	
-
-	btScalar	m_tau;
-	btScalar	m_damping;//global non-contact constraint damping, can be locally overridden by constraints during 'getInfo2'.
-	btScalar	m_friction;
-	btScalar	m_timeStep;
-	btScalar	m_restitution;
-	int		m_numIterations;
-	btScalar	m_maxErrorReduction;
-	btScalar	m_sor;
-	btScalar	m_erp;//used as Baumgarte factor
-	btScalar	m_erp2;//used in Split Impulse
-	btScalar	m_globalCfm;//constraint force mixing
-	int			m_splitImpulse;
-	btScalar	m_splitImpulsePenetrationThreshold;
-	btScalar	m_linearSlop;
-	btScalar	m_warmstartingFactor;
-
-	int			m_solverMode;
-	int	m_restingContactRestitutionThreshold;
-	int			m_minimumSolverBatchSize;
-
-
-};
-
-struct btContactSolverInfo : public btContactSolverInfoData
-{
-
-	
-
-	inline btContactSolverInfo()
-	{
-		m_tau = btScalar(0.6);
-		m_damping = btScalar(1.0);
-		m_friction = btScalar(0.3);
-		m_restitution = btScalar(0.);
-		m_maxErrorReduction = btScalar(20.);
-		m_numIterations = 10;
-		m_erp = btScalar(0.2);
-		m_erp2 = btScalar(0.1);
-		m_globalCfm = btScalar(0.);
-		m_sor = btScalar(1.);
-		m_splitImpulse = false;
-		m_splitImpulsePenetrationThreshold = -0.02f;
-		m_linearSlop = btScalar(0.0);
-		m_warmstartingFactor=btScalar(0.85);
-		m_solverMode = SOLVER_USE_WARMSTARTING | SOLVER_SIMD;// | SOLVER_RANDMIZE_ORDER;
-		m_restingContactRestitutionThreshold = 2;//resting contact lifetime threshold to disable restitution
-		m_minimumSolverBatchSize = 128; //try to combine islands until the amount of constraints reaches this limit
-	}
-};
-
-#endif //BT_CONTACT_SOLVER_INFO
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp
deleted file mode 100644
index 7c5e4f6..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp
+++ /dev/null
@@ -1,1070 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-/*
-2007-09-09
-Refactored by Francisco Le?n
-email: projectileman at yahoo.com
-http://gimpact.sf.net
-*/
-
-#include "btGeneric6DofConstraint.h"
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-#include "LinearMath/btTransformUtil.h"
-#include "LinearMath/btTransformUtil.h"
-#include <new>
-
-
-
-#define D6_USE_OBSOLETE_METHOD false
-#define D6_USE_FRAME_OFFSET true
-
-
-
-
-
-
-btGeneric6DofConstraint::btGeneric6DofConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB, bool useLinearReferenceFrameA)
-: btTypedConstraint(D6_CONSTRAINT_TYPE, rbA, rbB)
-, m_frameInA(frameInA)
-, m_frameInB(frameInB),
-m_useLinearReferenceFrameA(useLinearReferenceFrameA),
-m_useOffsetForConstraintFrame(D6_USE_FRAME_OFFSET),
-m_flags(0),
-m_useSolveConstraintObsolete(D6_USE_OBSOLETE_METHOD)
-{
-	calculateTransforms();
-}
-
-
-
-btGeneric6DofConstraint::btGeneric6DofConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB)
-        : btTypedConstraint(D6_CONSTRAINT_TYPE, getFixedBody(), rbB),
-		m_frameInB(frameInB),
-		m_useLinearReferenceFrameA(useLinearReferenceFrameB),
-		m_useOffsetForConstraintFrame(D6_USE_FRAME_OFFSET),
-		m_flags(0),
-		m_useSolveConstraintObsolete(false)
-{
-	///not providing rigidbody A means implicitly using worldspace for body A
-	m_frameInA = rbB.getCenterOfMassTransform() * m_frameInB;
-	calculateTransforms();
-}
-
-
-
-
-#define GENERIC_D6_DISABLE_WARMSTARTING 1
-
-
-
-btScalar btGetMatrixElem(const btMatrix3x3& mat, int index);
-btScalar btGetMatrixElem(const btMatrix3x3& mat, int index)
-{
-	int i = index%3;
-	int j = index/3;
-	return mat[i][j];
-}
-
-
-
-///MatrixToEulerXYZ from http://www.geometrictools.com/LibFoundation/Mathematics/Wm4Matrix3.inl.html
-bool	matrixToEulerXYZ(const btMatrix3x3& mat,btVector3& xyz);
-bool	matrixToEulerXYZ(const btMatrix3x3& mat,btVector3& xyz)
-{
-	//	// rot =  cy*cz          -cy*sz           sy
-	//	//        cz*sx*sy+cx*sz  cx*cz-sx*sy*sz -cy*sx
-	//	//       -cx*cz*sy+sx*sz  cz*sx+cx*sy*sz  cx*cy
-	//
-
-	btScalar fi = btGetMatrixElem(mat,2);
-	if (fi < btScalar(1.0f))
-	{
-		if (fi > btScalar(-1.0f))
-		{
-			xyz[0] = btAtan2(-btGetMatrixElem(mat,5),btGetMatrixElem(mat,8));
-			xyz[1] = btAsin(btGetMatrixElem(mat,2));
-			xyz[2] = btAtan2(-btGetMatrixElem(mat,1),btGetMatrixElem(mat,0));
-			return true;
-		}
-		else
-		{
-			// WARNING.  Not unique.  XA - ZA = -atan2(r10,r11)
-			xyz[0] = -btAtan2(btGetMatrixElem(mat,3),btGetMatrixElem(mat,4));
-			xyz[1] = -SIMD_HALF_PI;
-			xyz[2] = btScalar(0.0);
-			return false;
-		}
-	}
-	else
-	{
-		// WARNING.  Not unique.  XAngle + ZAngle = atan2(r10,r11)
-		xyz[0] = btAtan2(btGetMatrixElem(mat,3),btGetMatrixElem(mat,4));
-		xyz[1] = SIMD_HALF_PI;
-		xyz[2] = 0.0;
-	}
-	return false;
-}
-
-//////////////////////////// btRotationalLimitMotor ////////////////////////////////////
-
-int btRotationalLimitMotor::testLimitValue(btScalar test_value)
-{
-	if(m_loLimit>m_hiLimit)
-	{
-		m_currentLimit = 0;//Free from violation
-		return 0;
-	}
-	if (test_value < m_loLimit)
-	{
-		m_currentLimit = 1;//low limit violation
-		m_currentLimitError =  test_value - m_loLimit;
-		return 1;
-	}
-	else if (test_value> m_hiLimit)
-	{
-		m_currentLimit = 2;//High limit violation
-		m_currentLimitError = test_value - m_hiLimit;
-		return 2;
-	};
-
-	m_currentLimit = 0;//Free from violation
-	return 0;
-
-}
-
-
-
-btScalar btRotationalLimitMotor::solveAngularLimits(
-	btScalar timeStep,btVector3& axis,btScalar jacDiagABInv,
-	btRigidBody * body0, btRigidBody * body1 )
-{
-	if (needApplyTorques()==false) return 0.0f;
-
-	btScalar target_velocity = m_targetVelocity;
-	btScalar maxMotorForce = m_maxMotorForce;
-
-	//current error correction
-	if (m_currentLimit!=0)
-	{
-		target_velocity = -m_stopERP*m_currentLimitError/(timeStep);
-		maxMotorForce = m_maxLimitForce;
-	}
-
-	maxMotorForce *= timeStep;
-
-	// current velocity difference
-
-	btVector3 angVelA;
-	body0->internalGetAngularVelocity(angVelA);
-	btVector3 angVelB;
-	body1->internalGetAngularVelocity(angVelB);
-
-	btVector3 vel_diff;
-	vel_diff = angVelA-angVelB;
-
-
-
-	btScalar rel_vel = axis.dot(vel_diff);
-
-	// correction velocity
-	btScalar motor_relvel = m_limitSoftness*(target_velocity  - m_damping*rel_vel);
-
-
-	if ( motor_relvel < SIMD_EPSILON && motor_relvel > -SIMD_EPSILON  )
-	{
-		return 0.0f;//no need for applying force
-	}
-
-
-	// correction impulse
-	btScalar unclippedMotorImpulse = (1+m_bounce)*motor_relvel*jacDiagABInv;
-
-	// clip correction impulse
-	btScalar clippedMotorImpulse;
-
-	///@todo: should clip against accumulated impulse
-	if (unclippedMotorImpulse>0.0f)
-	{
-		clippedMotorImpulse =  unclippedMotorImpulse > maxMotorForce? maxMotorForce: unclippedMotorImpulse;
-	}
-	else
-	{
-		clippedMotorImpulse =  unclippedMotorImpulse < -maxMotorForce ? -maxMotorForce: unclippedMotorImpulse;
-	}
-
-
-	// sort with accumulated impulses
-	btScalar	lo = btScalar(-BT_LARGE_FLOAT);
-	btScalar	hi = btScalar(BT_LARGE_FLOAT);
-
-	btScalar oldaccumImpulse = m_accumulatedImpulse;
-	btScalar sum = oldaccumImpulse + clippedMotorImpulse;
-	m_accumulatedImpulse = sum > hi ? btScalar(0.) : sum < lo ? btScalar(0.) : sum;
-
-	clippedMotorImpulse = m_accumulatedImpulse - oldaccumImpulse;
-
-	btVector3 motorImp = clippedMotorImpulse * axis;
-
-	//body0->applyTorqueImpulse(motorImp);
-	//body1->applyTorqueImpulse(-motorImp);
-
-	body0->internalApplyImpulse(btVector3(0,0,0), body0->getInvInertiaTensorWorld()*axis,clippedMotorImpulse);
-	body1->internalApplyImpulse(btVector3(0,0,0), body1->getInvInertiaTensorWorld()*axis,-clippedMotorImpulse);
-
-
-	return clippedMotorImpulse;
-
-
-}
-
-//////////////////////////// End btRotationalLimitMotor ////////////////////////////////////
-
-
-
-
-//////////////////////////// btTranslationalLimitMotor ////////////////////////////////////
-
-
-int btTranslationalLimitMotor::testLimitValue(int limitIndex, btScalar test_value)
-{
-	btScalar loLimit = m_lowerLimit[limitIndex];
-	btScalar hiLimit = m_upperLimit[limitIndex];
-	if(loLimit > hiLimit)
-	{
-		m_currentLimit[limitIndex] = 0;//Free from violation
-		m_currentLimitError[limitIndex] = btScalar(0.f);
-		return 0;
-	}
-
-	if (test_value < loLimit)
-	{
-		m_currentLimit[limitIndex] = 2;//low limit violation
-		m_currentLimitError[limitIndex] =  test_value - loLimit;
-		return 2;
-	}
-	else if (test_value> hiLimit)
-	{
-		m_currentLimit[limitIndex] = 1;//High limit violation
-		m_currentLimitError[limitIndex] = test_value - hiLimit;
-		return 1;
-	};
-
-	m_currentLimit[limitIndex] = 0;//Free from violation
-	m_currentLimitError[limitIndex] = btScalar(0.f);
-	return 0;
-}
-
-
-
-btScalar btTranslationalLimitMotor::solveLinearAxis(
-	btScalar timeStep,
-	btScalar jacDiagABInv,
-	btRigidBody& body1,const btVector3 &pointInA,
-	btRigidBody& body2,const btVector3 &pointInB,
-	int limit_index,
-	const btVector3 & axis_normal_on_a,
-	const btVector3 & anchorPos)
-{
-
-	///find relative velocity
-	//    btVector3 rel_pos1 = pointInA - body1.getCenterOfMassPosition();
-	//    btVector3 rel_pos2 = pointInB - body2.getCenterOfMassPosition();
-	btVector3 rel_pos1 = anchorPos - body1.getCenterOfMassPosition();
-	btVector3 rel_pos2 = anchorPos - body2.getCenterOfMassPosition();
-
-	btVector3 vel1;
-	body1.internalGetVelocityInLocalPointObsolete(rel_pos1,vel1);
-	btVector3 vel2;
-	body2.internalGetVelocityInLocalPointObsolete(rel_pos2,vel2);
-	btVector3 vel = vel1 - vel2;
-
-	btScalar rel_vel = axis_normal_on_a.dot(vel);
-
-
-
-	/// apply displacement correction
-
-	//positional error (zeroth order error)
-	btScalar depth = -(pointInA - pointInB).dot(axis_normal_on_a);
-	btScalar	lo = btScalar(-BT_LARGE_FLOAT);
-	btScalar	hi = btScalar(BT_LARGE_FLOAT);
-
-	btScalar minLimit = m_lowerLimit[limit_index];
-	btScalar maxLimit = m_upperLimit[limit_index];
-
-	//handle the limits
-	if (minLimit < maxLimit)
-	{
-		{
-			if (depth > maxLimit)
-			{
-				depth -= maxLimit;
-				lo = btScalar(0.);
-
-			}
-			else
-			{
-				if (depth < minLimit)
-				{
-					depth -= minLimit;
-					hi = btScalar(0.);
-				}
-				else
-				{
-					return 0.0f;
-				}
-			}
-		}
-	}
-
-	btScalar normalImpulse= m_limitSoftness*(m_restitution*depth/timeStep - m_damping*rel_vel) * jacDiagABInv;
-
-
-
-
-	btScalar oldNormalImpulse = m_accumulatedImpulse[limit_index];
-	btScalar sum = oldNormalImpulse + normalImpulse;
-	m_accumulatedImpulse[limit_index] = sum > hi ? btScalar(0.) : sum < lo ? btScalar(0.) : sum;
-	normalImpulse = m_accumulatedImpulse[limit_index] - oldNormalImpulse;
-
-	btVector3 impulse_vector = axis_normal_on_a * normalImpulse;
-	//body1.applyImpulse( impulse_vector, rel_pos1);
-	//body2.applyImpulse(-impulse_vector, rel_pos2);
-
-	btVector3 ftorqueAxis1 = rel_pos1.cross(axis_normal_on_a);
-	btVector3 ftorqueAxis2 = rel_pos2.cross(axis_normal_on_a);
-	body1.internalApplyImpulse(axis_normal_on_a*body1.getInvMass(), body1.getInvInertiaTensorWorld()*ftorqueAxis1,normalImpulse);
-	body2.internalApplyImpulse(axis_normal_on_a*body2.getInvMass(), body2.getInvInertiaTensorWorld()*ftorqueAxis2,-normalImpulse);
-
-
-
-
-	return normalImpulse;
-}
-
-//////////////////////////// btTranslationalLimitMotor ////////////////////////////////////
-
-void btGeneric6DofConstraint::calculateAngleInfo()
-{
-	btMatrix3x3 relative_frame = m_calculatedTransformA.getBasis().inverse()*m_calculatedTransformB.getBasis();
-	matrixToEulerXYZ(relative_frame,m_calculatedAxisAngleDiff);
-	// in euler angle mode we do not actually constrain the angular velocity
-	// along the axes axis[0] and axis[2] (although we do use axis[1]) :
-	//
-	//    to get			constrain w2-w1 along		...not
-	//    ------			---------------------		------
-	//    d(angle[0])/dt = 0	ax[1] x ax[2]			ax[0]
-	//    d(angle[1])/dt = 0	ax[1]
-	//    d(angle[2])/dt = 0	ax[0] x ax[1]			ax[2]
-	//
-	// constraining w2-w1 along an axis 'a' means that a'*(w2-w1)=0.
-	// to prove the result for angle[0], write the expression for angle[0] from
-	// GetInfo1 then take the derivative. to prove this for angle[2] it is
-	// easier to take the euler rate expression for d(angle[2])/dt with respect
-	// to the components of w and set that to 0.
-	btVector3 axis0 = m_calculatedTransformB.getBasis().getColumn(0);
-	btVector3 axis2 = m_calculatedTransformA.getBasis().getColumn(2);
-
-	m_calculatedAxis[1] = axis2.cross(axis0);
-	m_calculatedAxis[0] = m_calculatedAxis[1].cross(axis2);
-	m_calculatedAxis[2] = axis0.cross(m_calculatedAxis[1]);
-
-	m_calculatedAxis[0].normalize();
-	m_calculatedAxis[1].normalize();
-	m_calculatedAxis[2].normalize();
-
-}
-
-void btGeneric6DofConstraint::calculateTransforms()
-{
-	calculateTransforms(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
-}
-
-void btGeneric6DofConstraint::calculateTransforms(const btTransform& transA,const btTransform& transB)
-{
-	m_calculatedTransformA = transA * m_frameInA;
-	m_calculatedTransformB = transB * m_frameInB;
-	calculateLinearInfo();
-	calculateAngleInfo();
-	if(m_useOffsetForConstraintFrame)
-	{	//  get weight factors depending on masses
-		btScalar miA = getRigidBodyA().getInvMass();
-		btScalar miB = getRigidBodyB().getInvMass();
-		m_hasStaticBody = (miA < SIMD_EPSILON) || (miB < SIMD_EPSILON);
-		btScalar miS = miA + miB;
-		if(miS > btScalar(0.f))
-		{
-			m_factA = miB / miS;
-		}
-		else 
-		{
-			m_factA = btScalar(0.5f);
-		}
-		m_factB = btScalar(1.0f) - m_factA;
-	}
-}
-
-
-
-void btGeneric6DofConstraint::buildLinearJacobian(
-	btJacobianEntry & jacLinear,const btVector3 & normalWorld,
-	const btVector3 & pivotAInW,const btVector3 & pivotBInW)
-{
-	new (&jacLinear) btJacobianEntry(
-        m_rbA.getCenterOfMassTransform().getBasis().transpose(),
-        m_rbB.getCenterOfMassTransform().getBasis().transpose(),
-        pivotAInW - m_rbA.getCenterOfMassPosition(),
-        pivotBInW - m_rbB.getCenterOfMassPosition(),
-        normalWorld,
-        m_rbA.getInvInertiaDiagLocal(),
-        m_rbA.getInvMass(),
-        m_rbB.getInvInertiaDiagLocal(),
-        m_rbB.getInvMass());
-}
-
-
-
-void btGeneric6DofConstraint::buildAngularJacobian(
-	btJacobianEntry & jacAngular,const btVector3 & jointAxisW)
-{
-	 new (&jacAngular)	btJacobianEntry(jointAxisW,
-                                      m_rbA.getCenterOfMassTransform().getBasis().transpose(),
-                                      m_rbB.getCenterOfMassTransform().getBasis().transpose(),
-                                      m_rbA.getInvInertiaDiagLocal(),
-                                      m_rbB.getInvInertiaDiagLocal());
-
-}
-
-
-
-bool btGeneric6DofConstraint::testAngularLimitMotor(int axis_index)
-{
-	btScalar angle = m_calculatedAxisAngleDiff[axis_index];
-	angle = btAdjustAngleToLimits(angle, m_angularLimits[axis_index].m_loLimit, m_angularLimits[axis_index].m_hiLimit);
-	m_angularLimits[axis_index].m_currentPosition = angle;
-	//test limits
-	m_angularLimits[axis_index].testLimitValue(angle);
-	return m_angularLimits[axis_index].needApplyTorques();
-}
-
-
-
-void btGeneric6DofConstraint::buildJacobian()
-{
-#ifndef __SPU__
-	if (m_useSolveConstraintObsolete)
-	{
-
-		// Clear accumulated impulses for the next simulation step
-		m_linearLimits.m_accumulatedImpulse.setValue(btScalar(0.), btScalar(0.), btScalar(0.));
-		int i;
-		for(i = 0; i < 3; i++)
-		{
-			m_angularLimits[i].m_accumulatedImpulse = btScalar(0.);
-		}
-		//calculates transform
-		calculateTransforms(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
-
-		//  const btVector3& pivotAInW = m_calculatedTransformA.getOrigin();
-		//  const btVector3& pivotBInW = m_calculatedTransformB.getOrigin();
-		calcAnchorPos();
-		btVector3 pivotAInW = m_AnchorPos;
-		btVector3 pivotBInW = m_AnchorPos;
-
-		// not used here
-		//    btVector3 rel_pos1 = pivotAInW - m_rbA.getCenterOfMassPosition();
-		//    btVector3 rel_pos2 = pivotBInW - m_rbB.getCenterOfMassPosition();
-
-		btVector3 normalWorld;
-		//linear part
-		for (i=0;i<3;i++)
-		{
-			if (m_linearLimits.isLimited(i))
-			{
-				if (m_useLinearReferenceFrameA)
-					normalWorld = m_calculatedTransformA.getBasis().getColumn(i);
-				else
-					normalWorld = m_calculatedTransformB.getBasis().getColumn(i);
-
-				buildLinearJacobian(
-					m_jacLinear[i],normalWorld ,
-					pivotAInW,pivotBInW);
-
-			}
-		}
-
-		// angular part
-		for (i=0;i<3;i++)
-		{
-			//calculates error angle
-			if (testAngularLimitMotor(i))
-			{
-				normalWorld = this->getAxis(i);
-				// Create angular atom
-				buildAngularJacobian(m_jacAng[i],normalWorld);
-			}
-		}
-
-	}
-#endif //__SPU__
-
-}
-
-
-void btGeneric6DofConstraint::getInfo1 (btConstraintInfo1* info)
-{
-	if (m_useSolveConstraintObsolete)
-	{
-		info->m_numConstraintRows = 0;
-		info->nub = 0;
-	} else
-	{
-		//prepare constraint
-		calculateTransforms(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
-		info->m_numConstraintRows = 0;
-		info->nub = 6;
-		int i;
-		//test linear limits
-		for(i = 0; i < 3; i++)
-		{
-			if(m_linearLimits.needApplyForce(i))
-			{
-				info->m_numConstraintRows++;
-				info->nub--;
-			}
-		}
-		//test angular limits
-		for (i=0;i<3 ;i++ )
-		{
-			if(testAngularLimitMotor(i))
-			{
-				info->m_numConstraintRows++;
-				info->nub--;
-			}
-		}
-	}
-}
-
-void btGeneric6DofConstraint::getInfo1NonVirtual (btConstraintInfo1* info)
-{
-	if (m_useSolveConstraintObsolete)
-	{
-		info->m_numConstraintRows = 0;
-		info->nub = 0;
-	} else
-	{
-		//pre-allocate all 6
-		info->m_numConstraintRows = 6;
-		info->nub = 0;
-	}
-}
-
-
-void btGeneric6DofConstraint::getInfo2 (btConstraintInfo2* info)
-{
-	btAssert(!m_useSolveConstraintObsolete);
-
-	const btTransform& transA = m_rbA.getCenterOfMassTransform();
-	const btTransform& transB = m_rbB.getCenterOfMassTransform();
-	const btVector3& linVelA = m_rbA.getLinearVelocity();
-	const btVector3& linVelB = m_rbB.getLinearVelocity();
-	const btVector3& angVelA = m_rbA.getAngularVelocity();
-	const btVector3& angVelB = m_rbB.getAngularVelocity();
-
-	if(m_useOffsetForConstraintFrame)
-	{ // for stability better to solve angular limits first
-		int row = setAngularLimits(info, 0,transA,transB,linVelA,linVelB,angVelA,angVelB);
-		setLinearLimits(info, row, transA,transB,linVelA,linVelB,angVelA,angVelB);
-	}
-	else
-	{ // leave old version for compatibility
-		int row = setLinearLimits(info, 0, transA,transB,linVelA,linVelB,angVelA,angVelB);
-		setAngularLimits(info, row,transA,transB,linVelA,linVelB,angVelA,angVelB);
-	}
-
-}
-
-
-void btGeneric6DofConstraint::getInfo2NonVirtual (btConstraintInfo2* info, const btTransform& transA,const btTransform& transB,const btVector3& linVelA,const btVector3& linVelB,const btVector3& angVelA,const btVector3& angVelB)
-{
-	
-	btAssert(!m_useSolveConstraintObsolete);
-	//prepare constraint
-	calculateTransforms(transA,transB);
-
-	int i;
-	for (i=0;i<3 ;i++ )
-	{
-		testAngularLimitMotor(i);
-	}
-
-	if(m_useOffsetForConstraintFrame)
-	{ // for stability better to solve angular limits first
-		int row = setAngularLimits(info, 0,transA,transB,linVelA,linVelB,angVelA,angVelB);
-		setLinearLimits(info, row, transA,transB,linVelA,linVelB,angVelA,angVelB);
-	}
-	else
-	{ // leave old version for compatibility
-		int row = setLinearLimits(info, 0, transA,transB,linVelA,linVelB,angVelA,angVelB);
-		setAngularLimits(info, row,transA,transB,linVelA,linVelB,angVelA,angVelB);
-	}
-}
-
-
-
-int btGeneric6DofConstraint::setLinearLimits(btConstraintInfo2* info, int row, const btTransform& transA,const btTransform& transB,const btVector3& linVelA,const btVector3& linVelB,const btVector3& angVelA,const btVector3& angVelB)
-{
-//	int row = 0;
-	//solve linear limits
-	btRotationalLimitMotor limot;
-	for (int i=0;i<3 ;i++ )
-	{
-		if(m_linearLimits.needApplyForce(i))
-		{ // re-use rotational motor code
-			limot.m_bounce = btScalar(0.f);
-			limot.m_currentLimit = m_linearLimits.m_currentLimit[i];
-			limot.m_currentPosition = m_linearLimits.m_currentLinearDiff[i];
-			limot.m_currentLimitError  = m_linearLimits.m_currentLimitError[i];
-			limot.m_damping  = m_linearLimits.m_damping;
-			limot.m_enableMotor  = m_linearLimits.m_enableMotor[i];
-			limot.m_hiLimit  = m_linearLimits.m_upperLimit[i];
-			limot.m_limitSoftness  = m_linearLimits.m_limitSoftness;
-			limot.m_loLimit  = m_linearLimits.m_lowerLimit[i];
-			limot.m_maxLimitForce  = btScalar(0.f);
-			limot.m_maxMotorForce  = m_linearLimits.m_maxMotorForce[i];
-			limot.m_targetVelocity  = m_linearLimits.m_targetVelocity[i];
-			btVector3 axis = m_calculatedTransformA.getBasis().getColumn(i);
-			int flags = m_flags >> (i * BT_6DOF_FLAGS_AXIS_SHIFT);
-			limot.m_normalCFM	= (flags & BT_6DOF_FLAGS_CFM_NORM) ? m_linearLimits.m_normalCFM[i] : info->cfm[0];
-			limot.m_stopCFM		= (flags & BT_6DOF_FLAGS_CFM_STOP) ? m_linearLimits.m_stopCFM[i] : info->cfm[0];
-			limot.m_stopERP		= (flags & BT_6DOF_FLAGS_ERP_STOP) ? m_linearLimits.m_stopERP[i] : info->erp;
-			if(m_useOffsetForConstraintFrame)
-			{
-				int indx1 = (i + 1) % 3;
-				int indx2 = (i + 2) % 3;
-				int rotAllowed = 1; // rotations around orthos to current axis
-				if(m_angularLimits[indx1].m_currentLimit && m_angularLimits[indx2].m_currentLimit)
-				{
-					rotAllowed = 0;
-				}
-				row += get_limit_motor_info2(&limot, transA,transB,linVelA,linVelB,angVelA,angVelB, info, row, axis, 0, rotAllowed);
-			}
-			else
-			{
-				row += get_limit_motor_info2(&limot, transA,transB,linVelA,linVelB,angVelA,angVelB, info, row, axis, 0);
-			}
-		}
-	}
-	return row;
-}
-
-
-
-int btGeneric6DofConstraint::setAngularLimits(btConstraintInfo2 *info, int row_offset, const btTransform& transA,const btTransform& transB,const btVector3& linVelA,const btVector3& linVelB,const btVector3& angVelA,const btVector3& angVelB)
-{
-	btGeneric6DofConstraint * d6constraint = this;
-	int row = row_offset;
-	//solve angular limits
-	for (int i=0;i<3 ;i++ )
-	{
-		if(d6constraint->getRotationalLimitMotor(i)->needApplyTorques())
-		{
-			btVector3 axis = d6constraint->getAxis(i);
-			int flags = m_flags >> ((i + 3) * BT_6DOF_FLAGS_AXIS_SHIFT);
-			if(!(flags & BT_6DOF_FLAGS_CFM_NORM))
-			{
-				m_angularLimits[i].m_normalCFM = info->cfm[0];
-			}
-			if(!(flags & BT_6DOF_FLAGS_CFM_STOP))
-			{
-				m_angularLimits[i].m_stopCFM = info->cfm[0];
-			}
-			if(!(flags & BT_6DOF_FLAGS_ERP_STOP))
-			{
-				m_angularLimits[i].m_stopERP = info->erp;
-			}
-			row += get_limit_motor_info2(d6constraint->getRotationalLimitMotor(i),
-												transA,transB,linVelA,linVelB,angVelA,angVelB, info,row,axis,1);
-		}
-	}
-
-	return row;
-}
-
-
-
-
-void	btGeneric6DofConstraint::updateRHS(btScalar	timeStep)
-{
-	(void)timeStep;
-
-}
-
-
-void btGeneric6DofConstraint::setFrames(const btTransform& frameA, const btTransform& frameB)
-{
-	m_frameInA = frameA;
-	m_frameInB = frameB;
-	buildJacobian();
-	calculateTransforms();
-}
-
-
-
-btVector3 btGeneric6DofConstraint::getAxis(int axis_index) const
-{
-	return m_calculatedAxis[axis_index];
-}
-
-
-btScalar	btGeneric6DofConstraint::getRelativePivotPosition(int axisIndex) const
-{
-	return m_calculatedLinearDiff[axisIndex];
-}
-
-
-btScalar btGeneric6DofConstraint::getAngle(int axisIndex) const
-{
-	return m_calculatedAxisAngleDiff[axisIndex];
-}
-
-
-
-void btGeneric6DofConstraint::calcAnchorPos(void)
-{
-	btScalar imA = m_rbA.getInvMass();
-	btScalar imB = m_rbB.getInvMass();
-	btScalar weight;
-	if(imB == btScalar(0.0))
-	{
-		weight = btScalar(1.0);
-	}
-	else
-	{
-		weight = imA / (imA + imB);
-	}
-	const btVector3& pA = m_calculatedTransformA.getOrigin();
-	const btVector3& pB = m_calculatedTransformB.getOrigin();
-	m_AnchorPos = pA * weight + pB * (btScalar(1.0) - weight);
-	return;
-}
-
-
-
-void btGeneric6DofConstraint::calculateLinearInfo()
-{
-	m_calculatedLinearDiff = m_calculatedTransformB.getOrigin() - m_calculatedTransformA.getOrigin();
-	m_calculatedLinearDiff = m_calculatedTransformA.getBasis().inverse() * m_calculatedLinearDiff;
-	for(int i = 0; i < 3; i++)
-	{
-		m_linearLimits.m_currentLinearDiff[i] = m_calculatedLinearDiff[i];
-		m_linearLimits.testLimitValue(i, m_calculatedLinearDiff[i]);
-	}
-}
-
-
-
-int btGeneric6DofConstraint::get_limit_motor_info2(
-	btRotationalLimitMotor * limot,
-	const btTransform& transA,const btTransform& transB,const btVector3& linVelA,const btVector3& linVelB,const btVector3& angVelA,const btVector3& angVelB,
-	btConstraintInfo2 *info, int row, btVector3& ax1, int rotational,int rotAllowed)
-{
-    int srow = row * info->rowskip;
-    int powered = limot->m_enableMotor;
-    int limit = limot->m_currentLimit;
-    if (powered || limit)
-    {   // if the joint is powered, or has joint limits, add in the extra row
-        btScalar *J1 = rotational ? info->m_J1angularAxis : info->m_J1linearAxis;
-        btScalar *J2 = rotational ? info->m_J2angularAxis : 0;
-        J1[srow+0] = ax1[0];
-        J1[srow+1] = ax1[1];
-        J1[srow+2] = ax1[2];
-        if(rotational)
-        {
-            J2[srow+0] = -ax1[0];
-            J2[srow+1] = -ax1[1];
-            J2[srow+2] = -ax1[2];
-        }
-        if((!rotational))
-        {
-			if (m_useOffsetForConstraintFrame)
-			{
-				btVector3 tmpA, tmpB, relA, relB;
-				// get vector from bodyB to frameB in WCS
-				relB = m_calculatedTransformB.getOrigin() - transB.getOrigin();
-				// get its projection to constraint axis
-				btVector3 projB = ax1 * relB.dot(ax1);
-				// get vector directed from bodyB to constraint axis (and orthogonal to it)
-				btVector3 orthoB = relB - projB;
-				// same for bodyA
-				relA = m_calculatedTransformA.getOrigin() - transA.getOrigin();
-				btVector3 projA = ax1 * relA.dot(ax1);
-				btVector3 orthoA = relA - projA;
-				// get desired offset between frames A and B along constraint axis
-				btScalar desiredOffs = limot->m_currentPosition - limot->m_currentLimitError;
-				// desired vector from projection of center of bodyA to projection of center of bodyB to constraint axis
-				btVector3 totalDist = projA + ax1 * desiredOffs - projB;
-				// get offset vectors relA and relB
-				relA = orthoA + totalDist * m_factA;
-				relB = orthoB - totalDist * m_factB;
-				tmpA = relA.cross(ax1);
-				tmpB = relB.cross(ax1);
-				if(m_hasStaticBody && (!rotAllowed))
-				{
-					tmpA *= m_factA;
-					tmpB *= m_factB;
-				}
-				int i;
-				for (i=0; i<3; i++) info->m_J1angularAxis[srow+i] = tmpA[i];
-				for (i=0; i<3; i++) info->m_J2angularAxis[srow+i] = -tmpB[i];
-			} else
-			{
-				btVector3 ltd;	// Linear Torque Decoupling vector
-				btVector3 c = m_calculatedTransformB.getOrigin() - transA.getOrigin();
-				ltd = c.cross(ax1);
-				info->m_J1angularAxis[srow+0] = ltd[0];
-				info->m_J1angularAxis[srow+1] = ltd[1];
-				info->m_J1angularAxis[srow+2] = ltd[2];
-
-				c = m_calculatedTransformB.getOrigin() - transB.getOrigin();
-				ltd = -c.cross(ax1);
-				info->m_J2angularAxis[srow+0] = ltd[0];
-				info->m_J2angularAxis[srow+1] = ltd[1];
-				info->m_J2angularAxis[srow+2] = ltd[2];
-			}
-        }
-        // if we're limited low and high simultaneously, the joint motor is
-        // ineffective
-        if (limit && (limot->m_loLimit == limot->m_hiLimit)) powered = 0;
-        info->m_constraintError[srow] = btScalar(0.f);
-        if (powered)
-        {
-			info->cfm[srow] = limot->m_normalCFM;
-            if(!limit)
-            {
-				btScalar tag_vel = rotational ? limot->m_targetVelocity : -limot->m_targetVelocity;
-
-				btScalar mot_fact = getMotorFactor(	limot->m_currentPosition, 
-													limot->m_loLimit,
-													limot->m_hiLimit, 
-													tag_vel, 
-													info->fps * limot->m_stopERP);
-				info->m_constraintError[srow] += mot_fact * limot->m_targetVelocity;
-                info->m_lowerLimit[srow] = -limot->m_maxMotorForce;
-                info->m_upperLimit[srow] = limot->m_maxMotorForce;
-            }
-        }
-        if(limit)
-        {
-            btScalar k = info->fps * limot->m_stopERP;
-			if(!rotational)
-			{
-				info->m_constraintError[srow] += k * limot->m_currentLimitError;
-			}
-			else
-			{
-				info->m_constraintError[srow] += -k * limot->m_currentLimitError;
-			}
-			info->cfm[srow] = limot->m_stopCFM;
-            if (limot->m_loLimit == limot->m_hiLimit)
-            {   // limited low and high simultaneously
-                info->m_lowerLimit[srow] = -SIMD_INFINITY;
-                info->m_upperLimit[srow] = SIMD_INFINITY;
-            }
-            else
-            {
-                if (limit == 1)
-                {
-                    info->m_lowerLimit[srow] = 0;
-                    info->m_upperLimit[srow] = SIMD_INFINITY;
-                }
-                else
-                {
-                    info->m_lowerLimit[srow] = -SIMD_INFINITY;
-                    info->m_upperLimit[srow] = 0;
-                }
-                // deal with bounce
-                if (limot->m_bounce > 0)
-                {
-                    // calculate joint velocity
-                    btScalar vel;
-                    if (rotational)
-                    {
-                        vel = angVelA.dot(ax1);
-//make sure that if no body -> angVelB == zero vec
-//                        if (body1)
-                            vel -= angVelB.dot(ax1);
-                    }
-                    else
-                    {
-                        vel = linVelA.dot(ax1);
-//make sure that if no body -> angVelB == zero vec
-//                        if (body1)
-                            vel -= linVelB.dot(ax1);
-                    }
-                    // only apply bounce if the velocity is incoming, and if the
-                    // resulting c[] exceeds what we already have.
-                    if (limit == 1)
-                    {
-                        if (vel < 0)
-                        {
-                            btScalar newc = -limot->m_bounce* vel;
-                            if (newc > info->m_constraintError[srow]) 
-								info->m_constraintError[srow] = newc;
-                        }
-                    }
-                    else
-                    {
-                        if (vel > 0)
-                        {
-                            btScalar newc = -limot->m_bounce * vel;
-                            if (newc < info->m_constraintError[srow]) 
-								info->m_constraintError[srow] = newc;
-                        }
-                    }
-                }
-            }
-        }
-        return 1;
-    }
-    else return 0;
-}
-
-
-
-
-
-
-	///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
-	///If no axis is provided, it uses the default axis for this constraint.
-void btGeneric6DofConstraint::setParam(int num, btScalar value, int axis)
-{
-	if((axis >= 0) && (axis < 3))
-	{
-		switch(num)
-		{
-			case BT_CONSTRAINT_STOP_ERP : 
-				m_linearLimits.m_stopERP[axis] = value;
-				m_flags |= BT_6DOF_FLAGS_ERP_STOP << (axis * BT_6DOF_FLAGS_AXIS_SHIFT);
-				break;
-			case BT_CONSTRAINT_STOP_CFM : 
-				m_linearLimits.m_stopCFM[axis] = value;
-				m_flags |= BT_6DOF_FLAGS_CFM_STOP << (axis * BT_6DOF_FLAGS_AXIS_SHIFT);
-				break;
-			case BT_CONSTRAINT_CFM : 
-				m_linearLimits.m_normalCFM[axis] = value;
-				m_flags |= BT_6DOF_FLAGS_CFM_NORM << (axis * BT_6DOF_FLAGS_AXIS_SHIFT);
-				break;
-			default : 
-				btAssertConstrParams(0);
-		}
-	}
-	else if((axis >=3) && (axis < 6))
-	{
-		switch(num)
-		{
-			case BT_CONSTRAINT_STOP_ERP : 
-				m_angularLimits[axis - 3].m_stopERP = value;
-				m_flags |= BT_6DOF_FLAGS_ERP_STOP << (axis * BT_6DOF_FLAGS_AXIS_SHIFT);
-				break;
-			case BT_CONSTRAINT_STOP_CFM : 
-				m_angularLimits[axis - 3].m_stopCFM = value;
-				m_flags |= BT_6DOF_FLAGS_CFM_STOP << (axis * BT_6DOF_FLAGS_AXIS_SHIFT);
-				break;
-			case BT_CONSTRAINT_CFM : 
-				m_angularLimits[axis - 3].m_normalCFM = value;
-				m_flags |= BT_6DOF_FLAGS_CFM_NORM << (axis * BT_6DOF_FLAGS_AXIS_SHIFT);
-				break;
-			default : 
-				btAssertConstrParams(0);
-		}
-	}
-	else
-	{
-		btAssertConstrParams(0);
-	}
-}
-
-	///return the local value of parameter
-btScalar btGeneric6DofConstraint::getParam(int num, int axis) const 
-{
-	btScalar retVal = 0;
-	if((axis >= 0) && (axis < 3))
-	{
-		switch(num)
-		{
-			case BT_CONSTRAINT_STOP_ERP : 
-				btAssertConstrParams(m_flags & (BT_6DOF_FLAGS_ERP_STOP << (axis * BT_6DOF_FLAGS_AXIS_SHIFT)));
-				retVal = m_linearLimits.m_stopERP[axis];
-				break;
-			case BT_CONSTRAINT_STOP_CFM : 
-				btAssertConstrParams(m_flags & (BT_6DOF_FLAGS_CFM_STOP << (axis * BT_6DOF_FLAGS_AXIS_SHIFT)));
-				retVal = m_linearLimits.m_stopCFM[axis];
-				break;
-			case BT_CONSTRAINT_CFM : 
-				btAssertConstrParams(m_flags & (BT_6DOF_FLAGS_CFM_NORM << (axis * BT_6DOF_FLAGS_AXIS_SHIFT)));
-				retVal = m_linearLimits.m_normalCFM[axis];
-				break;
-			default : 
-				btAssertConstrParams(0);
-		}
-	}
-	else if((axis >=3) && (axis < 6))
-	{
-		switch(num)
-		{
-			case BT_CONSTRAINT_STOP_ERP : 
-				btAssertConstrParams(m_flags & (BT_6DOF_FLAGS_ERP_STOP << (axis * BT_6DOF_FLAGS_AXIS_SHIFT)));
-				retVal = m_angularLimits[axis - 3].m_stopERP;
-				break;
-			case BT_CONSTRAINT_STOP_CFM : 
-				btAssertConstrParams(m_flags & (BT_6DOF_FLAGS_CFM_STOP << (axis * BT_6DOF_FLAGS_AXIS_SHIFT)));
-				retVal = m_angularLimits[axis - 3].m_stopCFM;
-				break;
-			case BT_CONSTRAINT_CFM : 
-				btAssertConstrParams(m_flags & (BT_6DOF_FLAGS_CFM_NORM << (axis * BT_6DOF_FLAGS_AXIS_SHIFT)));
-				retVal = m_angularLimits[axis - 3].m_normalCFM;
-				break;
-			default : 
-				btAssertConstrParams(0);
-		}
-	}
-	else
-	{
-		btAssertConstrParams(0);
-	}
-	return retVal;
-}
-
- 
-
-void btGeneric6DofConstraint::setAxis(const btVector3& axis1,const btVector3& axis2)
-{
-	btVector3 zAxis = axis1.normalized();
-	btVector3 yAxis = axis2.normalized();
-	btVector3 xAxis = yAxis.cross(zAxis); // we want right coordinate system
-	
-	btTransform frameInW;
-	frameInW.setIdentity();
-	frameInW.getBasis().setValue(	xAxis[0], yAxis[0], zAxis[0],	
-	                                xAxis[1], yAxis[1], zAxis[1],
-	                               xAxis[2], yAxis[2], zAxis[2]);
-	
-	// now get constraint frame in local coordinate systems
-	m_frameInA = m_rbA.getCenterOfMassTransform().inverse() * frameInW;
-	m_frameInB = m_rbB.getCenterOfMassTransform().inverse() * frameInW;
-	
-	calculateTransforms();
-}
\ No newline at end of file
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h
deleted file mode 100644
index b441081..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h
+++ /dev/null
@@ -1,614 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-/// 2009 March: btGeneric6DofConstraint refactored by Roman Ponomarev
-/// Added support for generic constraint solver through getInfo1/getInfo2 methods
-
-/*
-2007-09-09
-btGeneric6DofConstraint Refactored by Francisco Le?n
-email: projectileman at yahoo.com
-http://gimpact.sf.net
-*/
-
-
-#ifndef BT_GENERIC_6DOF_CONSTRAINT_H
-#define BT_GENERIC_6DOF_CONSTRAINT_H
-
-#include "LinearMath/btVector3.h"
-#include "btJacobianEntry.h"
-#include "btTypedConstraint.h"
-
-class btRigidBody;
-
-
-
-
-//! Rotation Limit structure for generic joints
-class btRotationalLimitMotor
-{
-public:
-    //! limit_parameters
-    //!@{
-    btScalar m_loLimit;//!< joint limit
-    btScalar m_hiLimit;//!< joint limit
-    btScalar m_targetVelocity;//!< target motor velocity
-    btScalar m_maxMotorForce;//!< max force on motor
-    btScalar m_maxLimitForce;//!< max force on limit
-    btScalar m_damping;//!< Damping.
-    btScalar m_limitSoftness;//! Relaxation factor
-    btScalar m_normalCFM;//!< Constraint force mixing factor
-    btScalar m_stopERP;//!< Error tolerance factor when joint is at limit
-    btScalar m_stopCFM;//!< Constraint force mixing factor when joint is at limit
-    btScalar m_bounce;//!< restitution factor
-    bool m_enableMotor;
-
-    //!@}
-
-    //! temp_variables
-    //!@{
-    btScalar m_currentLimitError;//!  How much is violated this limit
-    btScalar m_currentPosition;     //!  current value of angle 
-    int m_currentLimit;//!< 0=free, 1=at lo limit, 2=at hi limit
-    btScalar m_accumulatedImpulse;
-    //!@}
-
-    btRotationalLimitMotor()
-    {
-    	m_accumulatedImpulse = 0.f;
-        m_targetVelocity = 0;
-        m_maxMotorForce = 0.1f;
-        m_maxLimitForce = 300.0f;
-        m_loLimit = 1.0f;
-        m_hiLimit = -1.0f;
-		m_normalCFM = 0.f;
-		m_stopERP = 0.2f;
-		m_stopCFM = 0.f;
-        m_bounce = 0.0f;
-        m_damping = 1.0f;
-        m_limitSoftness = 0.5f;
-        m_currentLimit = 0;
-        m_currentLimitError = 0;
-        m_enableMotor = false;
-    }
-
-    btRotationalLimitMotor(const btRotationalLimitMotor & limot)
-    {
-        m_targetVelocity = limot.m_targetVelocity;
-        m_maxMotorForce = limot.m_maxMotorForce;
-        m_limitSoftness = limot.m_limitSoftness;
-        m_loLimit = limot.m_loLimit;
-        m_hiLimit = limot.m_hiLimit;
-		m_normalCFM = limot.m_normalCFM;
-		m_stopERP = limot.m_stopERP;
-		m_stopCFM =	limot.m_stopCFM;
-        m_bounce = limot.m_bounce;
-        m_currentLimit = limot.m_currentLimit;
-        m_currentLimitError = limot.m_currentLimitError;
-        m_enableMotor = limot.m_enableMotor;
-    }
-
-
-
-	//! Is limited
-    bool isLimited()
-    {
-    	if(m_loLimit > m_hiLimit) return false;
-    	return true;
-    }
-
-	//! Need apply correction
-    bool needApplyTorques()
-    {
-    	if(m_currentLimit == 0 && m_enableMotor == false) return false;
-    	return true;
-    }
-
-	//! calculates  error
-	/*!
-	calculates m_currentLimit and m_currentLimitError.
-	*/
-	int testLimitValue(btScalar test_value);
-
-	//! apply the correction impulses for two bodies
-    btScalar solveAngularLimits(btScalar timeStep,btVector3& axis, btScalar jacDiagABInv,btRigidBody * body0, btRigidBody * body1);
-
-};
-
-
-
-class btTranslationalLimitMotor
-{
-public:
-	btVector3 m_lowerLimit;//!< the constraint lower limits
-    btVector3 m_upperLimit;//!< the constraint upper limits
-    btVector3 m_accumulatedImpulse;
-    //! Linear_Limit_parameters
-    //!@{
-    btScalar	m_limitSoftness;//!< Softness for linear limit
-    btScalar	m_damping;//!< Damping for linear limit
-    btScalar	m_restitution;//! Bounce parameter for linear limit
-	btVector3	m_normalCFM;//!< Constraint force mixing factor
-    btVector3	m_stopERP;//!< Error tolerance factor when joint is at limit
-	btVector3	m_stopCFM;//!< Constraint force mixing factor when joint is at limit
-    //!@}
-	bool		m_enableMotor[3];
-    btVector3	m_targetVelocity;//!< target motor velocity
-    btVector3	m_maxMotorForce;//!< max force on motor
-    btVector3	m_currentLimitError;//!  How much is violated this limit
-    btVector3	m_currentLinearDiff;//!  Current relative offset of constraint frames
-    int			m_currentLimit[3];//!< 0=free, 1=at lower limit, 2=at upper limit
-
-    btTranslationalLimitMotor()
-    {
-    	m_lowerLimit.setValue(0.f,0.f,0.f);
-    	m_upperLimit.setValue(0.f,0.f,0.f);
-    	m_accumulatedImpulse.setValue(0.f,0.f,0.f);
-		m_normalCFM.setValue(0.f, 0.f, 0.f);
-		m_stopERP.setValue(0.2f, 0.2f, 0.2f);
-		m_stopCFM.setValue(0.f, 0.f, 0.f);
-
-    	m_limitSoftness = 0.7f;
-    	m_damping = btScalar(1.0f);
-    	m_restitution = btScalar(0.5f);
-		for(int i=0; i < 3; i++) 
-		{
-			m_enableMotor[i] = false;
-			m_targetVelocity[i] = btScalar(0.f);
-			m_maxMotorForce[i] = btScalar(0.f);
-		}
-    }
-
-    btTranslationalLimitMotor(const btTranslationalLimitMotor & other )
-    {
-    	m_lowerLimit = other.m_lowerLimit;
-    	m_upperLimit = other.m_upperLimit;
-    	m_accumulatedImpulse = other.m_accumulatedImpulse;
-
-    	m_limitSoftness = other.m_limitSoftness ;
-    	m_damping = other.m_damping;
-    	m_restitution = other.m_restitution;
-		m_normalCFM = other.m_normalCFM;
-		m_stopERP = other.m_stopERP;
-		m_stopCFM = other.m_stopCFM;
-
-		for(int i=0; i < 3; i++) 
-		{
-			m_enableMotor[i] = other.m_enableMotor[i];
-			m_targetVelocity[i] = other.m_targetVelocity[i];
-			m_maxMotorForce[i] = other.m_maxMotorForce[i];
-		}
-    }
-
-    //! Test limit
-	/*!
-    - free means upper < lower,
-    - locked means upper == lower
-    - limited means upper > lower
-    - limitIndex: first 3 are linear, next 3 are angular
-    */
-    inline bool	isLimited(int limitIndex)
-    {
-       return (m_upperLimit[limitIndex] >= m_lowerLimit[limitIndex]);
-    }
-    inline bool needApplyForce(int limitIndex)
-    {
-    	if(m_currentLimit[limitIndex] == 0 && m_enableMotor[limitIndex] == false) return false;
-    	return true;
-    }
-	int testLimitValue(int limitIndex, btScalar test_value);
-
-
-    btScalar solveLinearAxis(
-    	btScalar timeStep,
-        btScalar jacDiagABInv,
-        btRigidBody& body1,const btVector3 &pointInA,
-        btRigidBody& body2,const btVector3 &pointInB,
-        int limit_index,
-        const btVector3 & axis_normal_on_a,
-		const btVector3 & anchorPos);
-
-
-};
-
-enum bt6DofFlags
-{
-	BT_6DOF_FLAGS_CFM_NORM = 1,
-	BT_6DOF_FLAGS_CFM_STOP = 2,
-	BT_6DOF_FLAGS_ERP_STOP = 4
-};
-#define BT_6DOF_FLAGS_AXIS_SHIFT 3 // bits per axis
-
-
-/// btGeneric6DofConstraint between two rigidbodies each with a pivotpoint that descibes the axis location in local space
-/*!
-btGeneric6DofConstraint can leave any of the 6 degree of freedom 'free' or 'locked'.
-currently this limit supports rotational motors<br>
-<ul>
-<li> For Linear limits, use btGeneric6DofConstraint.setLinearUpperLimit, btGeneric6DofConstraint.setLinearLowerLimit. You can set the parameters with the btTranslationalLimitMotor structure accsesible through the btGeneric6DofConstraint.getTranslationalLimitMotor method.
-At this moment translational motors are not supported. May be in the future. </li>
-
-<li> For Angular limits, use the btRotationalLimitMotor structure for configuring the limit.
-This is accessible through btGeneric6DofConstraint.getLimitMotor method,
-This brings support for limit parameters and motors. </li>
-
-<li> Angulars limits have these possible ranges:
-<table border=1 >
-<tr>
-	<td><b>AXIS</b></td>
-	<td><b>MIN ANGLE</b></td>
-	<td><b>MAX ANGLE</b></td>
-</tr><tr>
-	<td>X</td>
-	<td>-PI</td>
-	<td>PI</td>
-</tr><tr>
-	<td>Y</td>
-	<td>-PI/2</td>
-	<td>PI/2</td>
-</tr><tr>
-	<td>Z</td>
-	<td>-PI</td>
-	<td>PI</td>
-</tr>
-</table>
-</li>
-</ul>
-
-*/
-class btGeneric6DofConstraint : public btTypedConstraint
-{
-protected:
-
-	//! relative_frames
-    //!@{
-	btTransform	m_frameInA;//!< the constraint space w.r.t body A
-    btTransform	m_frameInB;//!< the constraint space w.r.t body B
-    //!@}
-
-    //! Jacobians
-    //!@{
-    btJacobianEntry	m_jacLinear[3];//!< 3 orthogonal linear constraints
-    btJacobianEntry	m_jacAng[3];//!< 3 orthogonal angular constraints
-    //!@}
-
-	//! Linear_Limit_parameters
-    //!@{
-    btTranslationalLimitMotor m_linearLimits;
-    //!@}
-
-
-    //! hinge_parameters
-    //!@{
-    btRotationalLimitMotor m_angularLimits[3];
-	//!@}
-
-
-protected:
-    //! temporal variables
-    //!@{
-    btScalar m_timeStep;
-    btTransform m_calculatedTransformA;
-    btTransform m_calculatedTransformB;
-    btVector3 m_calculatedAxisAngleDiff;
-    btVector3 m_calculatedAxis[3];
-    btVector3 m_calculatedLinearDiff;
-	btScalar	m_factA;
-	btScalar	m_factB;
-	bool		m_hasStaticBody;
-    
-	btVector3 m_AnchorPos; // point betwen pivots of bodies A and B to solve linear axes
-
-    bool	m_useLinearReferenceFrameA;
-	bool	m_useOffsetForConstraintFrame;
-    
-	int		m_flags;
-
-    //!@}
-
-    btGeneric6DofConstraint&	operator=(btGeneric6DofConstraint&	other)
-    {
-        btAssert(0);
-        (void) other;
-        return *this;
-    }
-
-
-	int setAngularLimits(btConstraintInfo2 *info, int row_offset,const btTransform& transA,const btTransform& transB,const btVector3& linVelA,const btVector3& linVelB,const btVector3& angVelA,const btVector3& angVelB);
-
-	int setLinearLimits(btConstraintInfo2 *info, int row, const btTransform& transA,const btTransform& transB,const btVector3& linVelA,const btVector3& linVelB,const btVector3& angVelA,const btVector3& angVelB);
-
-    void buildLinearJacobian(
-        btJacobianEntry & jacLinear,const btVector3 & normalWorld,
-        const btVector3 & pivotAInW,const btVector3 & pivotBInW);
-
-    void buildAngularJacobian(btJacobianEntry & jacAngular,const btVector3 & jointAxisW);
-
-	// tests linear limits
-	void calculateLinearInfo();
-
-	//! calcs the euler angles between the two bodies.
-    void calculateAngleInfo();
-
-
-
-public:
-
-	///for backwards compatibility during the transition to 'getInfo/getInfo2'
-	bool		m_useSolveConstraintObsolete;
-
-    btGeneric6DofConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA);
-    btGeneric6DofConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB);
-    
-	//! Calcs global transform of the offsets
-	/*!
-	Calcs the global transform for the joint offset for body A an B, and also calcs the agle differences between the bodies.
-	\sa btGeneric6DofConstraint.getCalculatedTransformA , btGeneric6DofConstraint.getCalculatedTransformB, btGeneric6DofConstraint.calculateAngleInfo
-	*/
-    void calculateTransforms(const btTransform& transA,const btTransform& transB);
-
-	void calculateTransforms();
-
-	//! Gets the global transform of the offset for body A
-    /*!
-    \sa btGeneric6DofConstraint.getFrameOffsetA, btGeneric6DofConstraint.getFrameOffsetB, btGeneric6DofConstraint.calculateAngleInfo.
-    */
-    const btTransform & getCalculatedTransformA() const
-    {
-    	return m_calculatedTransformA;
-    }
-
-    //! Gets the global transform of the offset for body B
-    /*!
-    \sa btGeneric6DofConstraint.getFrameOffsetA, btGeneric6DofConstraint.getFrameOffsetB, btGeneric6DofConstraint.calculateAngleInfo.
-    */
-    const btTransform & getCalculatedTransformB() const
-    {
-    	return m_calculatedTransformB;
-    }
-
-    const btTransform & getFrameOffsetA() const
-    {
-    	return m_frameInA;
-    }
-
-    const btTransform & getFrameOffsetB() const
-    {
-    	return m_frameInB;
-    }
-
-
-    btTransform & getFrameOffsetA()
-    {
-    	return m_frameInA;
-    }
-
-    btTransform & getFrameOffsetB()
-    {
-    	return m_frameInB;
-    }
-
-
-	//! performs Jacobian calculation, and also calculates angle differences and axis
-    virtual void	buildJacobian();
-
-	virtual void getInfo1 (btConstraintInfo1* info);
-
-	void getInfo1NonVirtual (btConstraintInfo1* info);
-
-	virtual void getInfo2 (btConstraintInfo2* info);
-
-	void getInfo2NonVirtual (btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btVector3& linVelA,const btVector3& linVelB,const btVector3& angVelA,const btVector3& angVelB);
-
-
-    void	updateRHS(btScalar	timeStep);
-
-	//! Get the rotation axis in global coordinates
-	/*!
-	\pre btGeneric6DofConstraint.buildJacobian must be called previously.
-	*/
-    btVector3 getAxis(int axis_index) const;
-
-    //! Get the relative Euler angle
-    /*!
-	\pre btGeneric6DofConstraint::calculateTransforms() must be called previously.
-	*/
-    btScalar getAngle(int axis_index) const;
-
-	//! Get the relative position of the constraint pivot
-    /*!
-	\pre btGeneric6DofConstraint::calculateTransforms() must be called previously.
-	*/
-	btScalar getRelativePivotPosition(int axis_index) const;
-
-	void setFrames(const btTransform & frameA, const btTransform & frameB);
-
-	//! Test angular limit.
-	/*!
-	Calculates angular correction and returns true if limit needs to be corrected.
-	\pre btGeneric6DofConstraint::calculateTransforms() must be called previously.
-	*/
-    bool testAngularLimitMotor(int axis_index);
-
-    void	setLinearLowerLimit(const btVector3& linearLower)
-    {
-    	m_linearLimits.m_lowerLimit = linearLower;
-    }
-
-	void	getLinearLowerLimit(btVector3& linearLower)
-	{
-		linearLower = m_linearLimits.m_lowerLimit;
-	}
-
-	void	setLinearUpperLimit(const btVector3& linearUpper)
-	{
-		m_linearLimits.m_upperLimit = linearUpper;
-	}
-
-	void	getLinearUpperLimit(btVector3& linearUpper)
-	{
-		linearUpper = m_linearLimits.m_upperLimit;
-	}
-
-    void	setAngularLowerLimit(const btVector3& angularLower)
-    {
-		for(int i = 0; i < 3; i++) 
-			m_angularLimits[i].m_loLimit = btNormalizeAngle(angularLower[i]);
-    }
-
-	void	getAngularLowerLimit(btVector3& angularLower)
-	{
-		for(int i = 0; i < 3; i++) 
-			angularLower[i] = m_angularLimits[i].m_loLimit;
-	}
-
-    void	setAngularUpperLimit(const btVector3& angularUpper)
-    {
-		for(int i = 0; i < 3; i++)
-			m_angularLimits[i].m_hiLimit = btNormalizeAngle(angularUpper[i]);
-    }
-
-	void	getAngularUpperLimit(btVector3& angularUpper)
-	{
-		for(int i = 0; i < 3; i++)
-			angularUpper[i] = m_angularLimits[i].m_hiLimit;
-	}
-
-	//! Retrieves the angular limit informacion
-    btRotationalLimitMotor * getRotationalLimitMotor(int index)
-    {
-    	return &m_angularLimits[index];
-    }
-
-    //! Retrieves the  limit informacion
-    btTranslationalLimitMotor * getTranslationalLimitMotor()
-    {
-    	return &m_linearLimits;
-    }
-
-    //first 3 are linear, next 3 are angular
-    void setLimit(int axis, btScalar lo, btScalar hi)
-    {
-    	if(axis<3)
-    	{
-    		m_linearLimits.m_lowerLimit[axis] = lo;
-    		m_linearLimits.m_upperLimit[axis] = hi;
-    	}
-    	else
-    	{
-			lo = btNormalizeAngle(lo);
-			hi = btNormalizeAngle(hi);
-    		m_angularLimits[axis-3].m_loLimit = lo;
-    		m_angularLimits[axis-3].m_hiLimit = hi;
-    	}
-    }
-
-	//! Test limit
-	/*!
-    - free means upper < lower,
-    - locked means upper == lower
-    - limited means upper > lower
-    - limitIndex: first 3 are linear, next 3 are angular
-    */
-    bool	isLimited(int limitIndex)
-    {
-    	if(limitIndex<3)
-    	{
-			return m_linearLimits.isLimited(limitIndex);
-
-    	}
-        return m_angularLimits[limitIndex-3].isLimited();
-    }
-
-	virtual void calcAnchorPos(void); // overridable
-
-	int get_limit_motor_info2(	btRotationalLimitMotor * limot,
-								const btTransform& transA,const btTransform& transB,const btVector3& linVelA,const btVector3& linVelB,const btVector3& angVelA,const btVector3& angVelB,
-								btConstraintInfo2 *info, int row, btVector3& ax1, int rotational, int rotAllowed = false);
-
-	// access for UseFrameOffset
-	bool getUseFrameOffset() { return m_useOffsetForConstraintFrame; }
-	void setUseFrameOffset(bool frameOffsetOnOff) { m_useOffsetForConstraintFrame = frameOffsetOnOff; }
-
-	///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
-	///If no axis is provided, it uses the default axis for this constraint.
-	virtual	void setParam(int num, btScalar value, int axis = -1);
-	///return the local value of parameter
-	virtual	btScalar getParam(int num, int axis = -1) const;
-
-	void setAxis( const btVector3& axis1, const btVector3& axis2);
-
-
-	virtual	int	calculateSerializeBufferSize() const;
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
-
-	
-};
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct btGeneric6DofConstraintData
-{
-	btTypedConstraintData	m_typeConstraintData;
-	btTransformFloatData m_rbAFrame; // constraint axii. Assumes z is hinge axis.
-	btTransformFloatData m_rbBFrame;
-	
-	btVector3FloatData	m_linearUpperLimit;
-	btVector3FloatData	m_linearLowerLimit;
-
-	btVector3FloatData	m_angularUpperLimit;
-	btVector3FloatData	m_angularLowerLimit;
-	
-	int	m_useLinearReferenceFrameA;
-	int m_useOffsetForConstraintFrame;
-};
-
-SIMD_FORCE_INLINE	int	btGeneric6DofConstraint::calculateSerializeBufferSize() const
-{
-	return sizeof(btGeneric6DofConstraintData);
-}
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-SIMD_FORCE_INLINE	const char*	btGeneric6DofConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-
-	btGeneric6DofConstraintData* dof = (btGeneric6DofConstraintData*)dataBuffer;
-	btTypedConstraint::serialize(&dof->m_typeConstraintData,serializer);
-
-	m_frameInA.serializeFloat(dof->m_rbAFrame);
-	m_frameInB.serializeFloat(dof->m_rbBFrame);
-
-		
-	int i;
-	for (i=0;i<3;i++)
-	{
-		dof->m_angularLowerLimit.m_floats[i] =  float(m_angularLimits[i].m_loLimit);
-		dof->m_angularUpperLimit.m_floats[i] =  float(m_angularLimits[i].m_hiLimit);
-		dof->m_linearLowerLimit.m_floats[i] = float(m_linearLimits.m_lowerLimit[i]);
-		dof->m_linearUpperLimit.m_floats[i] = float(m_linearLimits.m_upperLimit[i]);
-	}
-	
-	dof->m_useLinearReferenceFrameA = m_useLinearReferenceFrameA? 1 : 0;
-	dof->m_useOffsetForConstraintFrame = m_useOffsetForConstraintFrame ? 1 : 0;
-
-	return "btGeneric6DofConstraintData";
-}
-
-
-
-
-
-#endif //BT_GENERIC_6DOF_CONSTRAINT_H
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp
deleted file mode 100644
index d350345..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library, http://bulletphysics.org
-Copyright (C) 2006, 2007 Sony Computer Entertainment Inc. 
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btGeneric6DofSpringConstraint.h"
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-#include "LinearMath/btTransformUtil.h"
-
-
-btGeneric6DofSpringConstraint::btGeneric6DofSpringConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA)
-	: btGeneric6DofConstraint(rbA, rbB, frameInA, frameInB, useLinearReferenceFrameA)
-{
-	m_objectType = D6_SPRING_CONSTRAINT_TYPE;
-
-	for(int i = 0; i < 6; i++)
-	{
-		m_springEnabled[i] = false;
-		m_equilibriumPoint[i] = btScalar(0.f);
-		m_springStiffness[i] = btScalar(0.f);
-		m_springDamping[i] = btScalar(1.f);
-	}
-}
-
-
-void btGeneric6DofSpringConstraint::enableSpring(int index, bool onOff)
-{
-	btAssert((index >= 0) && (index < 6));
-	m_springEnabled[index] = onOff;
-	if(index < 3)
-	{
-		m_linearLimits.m_enableMotor[index] = onOff;
-	}
-	else
-	{
-		m_angularLimits[index - 3].m_enableMotor = onOff;
-	}
-}
-
-
-
-void btGeneric6DofSpringConstraint::setStiffness(int index, btScalar stiffness)
-{
-	btAssert((index >= 0) && (index < 6));
-	m_springStiffness[index] = stiffness;
-}
-
-
-void btGeneric6DofSpringConstraint::setDamping(int index, btScalar damping)
-{
-	btAssert((index >= 0) && (index < 6));
-	m_springDamping[index] = damping;
-}
-
-
-void btGeneric6DofSpringConstraint::setEquilibriumPoint()
-{
-	calculateTransforms();
-	int i;
-
-	for( i = 0; i < 3; i++)
-	{
-		m_equilibriumPoint[i] = m_calculatedLinearDiff[i];
-	}
-	for(i = 0; i < 3; i++)
-	{
-		m_equilibriumPoint[i + 3] = m_calculatedAxisAngleDiff[i];
-	}
-}
-
-
-
-void btGeneric6DofSpringConstraint::setEquilibriumPoint(int index)
-{
-	btAssert((index >= 0) && (index < 6));
-	calculateTransforms();
-	if(index < 3)
-	{
-		m_equilibriumPoint[index] = m_calculatedLinearDiff[index];
-	}
-	else
-	{
-		m_equilibriumPoint[index] = m_calculatedAxisAngleDiff[index - 3];
-	}
-}
-
-void btGeneric6DofSpringConstraint::setEquilibriumPoint(int index, btScalar val)
-{
-	btAssert((index >= 0) && (index < 6));
-	m_equilibriumPoint[index] = val;
-}
-
-
-void btGeneric6DofSpringConstraint::internalUpdateSprings(btConstraintInfo2* info)
-{
-	// it is assumed that calculateTransforms() have been called before this call
-	int i;
-	btVector3 relVel = m_rbB.getLinearVelocity() - m_rbA.getLinearVelocity();
-	for(i = 0; i < 3; i++)
-	{
-		if(m_springEnabled[i])
-		{
-			// get current position of constraint
-			btScalar currPos = m_calculatedLinearDiff[i];
-			// calculate difference
-			btScalar delta = currPos - m_equilibriumPoint[i];
-			// spring force is (delta * m_stiffness) according to Hooke's Law
-			btScalar force = delta * m_springStiffness[i];
-			btScalar velFactor = info->fps * m_springDamping[i] / btScalar(info->m_numIterations);
-			m_linearLimits.m_targetVelocity[i] =  velFactor * force;
-			m_linearLimits.m_maxMotorForce[i] =  btFabs(force) / info->fps;
-		}
-	}
-	for(i = 0; i < 3; i++)
-	{
-		if(m_springEnabled[i + 3])
-		{
-			// get current position of constraint
-			btScalar currPos = m_calculatedAxisAngleDiff[i];
-			// calculate difference
-			btScalar delta = currPos - m_equilibriumPoint[i+3];
-			// spring force is (-delta * m_stiffness) according to Hooke's Law
-			btScalar force = -delta * m_springStiffness[i+3];
-			btScalar velFactor = info->fps * m_springDamping[i+3] / btScalar(info->m_numIterations);
-			m_angularLimits[i].m_targetVelocity = velFactor * force;
-			m_angularLimits[i].m_maxMotorForce = btFabs(force) / info->fps;
-		}
-	}
-}
-
-
-void btGeneric6DofSpringConstraint::getInfo2(btConstraintInfo2* info)
-{
-	// this will be called by constraint solver at the constraint setup stage
-	// set current motor parameters
-	internalUpdateSprings(info);
-	// do the rest of job for constraint setup
-	btGeneric6DofConstraint::getInfo2(info);
-}
-
-
-void btGeneric6DofSpringConstraint::setAxis(const btVector3& axis1,const btVector3& axis2)
-{
-	btVector3 zAxis = axis1.normalized();
-	btVector3 yAxis = axis2.normalized();
-	btVector3 xAxis = yAxis.cross(zAxis); // we want right coordinate system
-
-	btTransform frameInW;
-	frameInW.setIdentity();
-	frameInW.getBasis().setValue(	xAxis[0], yAxis[0], zAxis[0],	
-                                xAxis[1], yAxis[1], zAxis[1],
-                                xAxis[2], yAxis[2], zAxis[2]);
-
-	// now get constraint frame in local coordinate systems
-	m_frameInA = m_rbA.getCenterOfMassTransform().inverse() * frameInW;
-	m_frameInB = m_rbB.getCenterOfMassTransform().inverse() * frameInW;
-
-  calculateTransforms();
-}
-
-
-
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h
deleted file mode 100644
index b3f2ef8..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library, http://bulletphysics.org
-Copyright (C) 2006, 2007 Sony Computer Entertainment Inc. 
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_GENERIC_6DOF_SPRING_CONSTRAINT_H
-#define BT_GENERIC_6DOF_SPRING_CONSTRAINT_H
-
-
-#include "LinearMath/btVector3.h"
-#include "btTypedConstraint.h"
-#include "btGeneric6DofConstraint.h"
-
-
-/// Generic 6 DOF constraint that allows to set spring motors to any translational and rotational DOF
-
-/// DOF index used in enableSpring() and setStiffness() means:
-/// 0 : translation X
-/// 1 : translation Y
-/// 2 : translation Z
-/// 3 : rotation X (3rd Euler rotational around new position of X axis, range [-PI+epsilon, PI-epsilon] )
-/// 4 : rotation Y (2nd Euler rotational around new position of Y axis, range [-PI/2+epsilon, PI/2-epsilon] )
-/// 5 : rotation Z (1st Euler rotational around Z axis, range [-PI+epsilon, PI-epsilon] )
-
-class btGeneric6DofSpringConstraint : public btGeneric6DofConstraint
-{
-protected:
-	bool		m_springEnabled[6];
-	btScalar	m_equilibriumPoint[6];
-	btScalar	m_springStiffness[6];
-	btScalar	m_springDamping[6]; // between 0 and 1 (1 == no damping)
-	void internalUpdateSprings(btConstraintInfo2* info);
-public: 
-    btGeneric6DofSpringConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA);
-	void enableSpring(int index, bool onOff);
-	void setStiffness(int index, btScalar stiffness);
-	void setDamping(int index, btScalar damping);
-	void setEquilibriumPoint(); // set the current constraint position/orientation as an equilibrium point for all DOF
-	void setEquilibriumPoint(int index);  // set the current constraint position/orientation as an equilibrium point for given DOF
-	void setEquilibriumPoint(int index, btScalar val);
-
-	virtual void setAxis( const btVector3& axis1, const btVector3& axis2);
-
-	virtual void getInfo2 (btConstraintInfo2* info);
-
-	virtual	int	calculateSerializeBufferSize() const;
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
-
-};
-
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct btGeneric6DofSpringConstraintData
-{
-	btGeneric6DofConstraintData	m_6dofData;
-	
-	int			m_springEnabled[6];
-	float		m_equilibriumPoint[6];
-	float		m_springStiffness[6];
-	float		m_springDamping[6];
-};
-
-SIMD_FORCE_INLINE	int	btGeneric6DofSpringConstraint::calculateSerializeBufferSize() const
-{
-	return sizeof(btGeneric6DofSpringConstraintData);
-}
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-SIMD_FORCE_INLINE	const char*	btGeneric6DofSpringConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-	btGeneric6DofSpringConstraintData* dof = (btGeneric6DofSpringConstraintData*)dataBuffer;
-	btGeneric6DofConstraint::serialize(&dof->m_6dofData,serializer);
-
-	int i;
-	for (i=0;i<6;i++)
-	{
-		dof->m_equilibriumPoint[i] = m_equilibriumPoint[i];
-		dof->m_springDamping[i] = m_springDamping[i];
-		dof->m_springEnabled[i] = m_springEnabled[i]? 1 : 0;
-		dof->m_springStiffness[i] = m_springStiffness[i];
-	}
-	return "btGeneric6DofConstraintData";
-}
-
-#endif // BT_GENERIC_6DOF_SPRING_CONSTRAINT_H
-
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp
deleted file mode 100644
index 29123d5..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library, http://bulletphysics.org
-Copyright (C) 2006, 2007 Sony Computer Entertainment Inc. 
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-#include "btHinge2Constraint.h"
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-#include "LinearMath/btTransformUtil.h"
-
-
-
-// constructor
-// anchor, axis1 and axis2 are in world coordinate system
-// axis1 must be orthogonal to axis2
-btHinge2Constraint::btHinge2Constraint(btRigidBody& rbA, btRigidBody& rbB, btVector3& anchor, btVector3& axis1, btVector3& axis2)
-: btGeneric6DofSpringConstraint(rbA, rbB, btTransform::getIdentity(), btTransform::getIdentity(), true),
- m_anchor(anchor),
- m_axis1(axis1),
- m_axis2(axis2)
-{
-	// build frame basis
-	// 6DOF constraint uses Euler angles and to define limits
-	// it is assumed that rotational order is :
-	// Z - first, allowed limits are (-PI,PI);
-	// new position of Y - second (allowed limits are (-PI/2 + epsilon, PI/2 - epsilon), where epsilon is a small positive number 
-	// used to prevent constraint from instability on poles;
-	// new position of X, allowed limits are (-PI,PI);
-	// So to simulate ODE Universal joint we should use parent axis as Z, child axis as Y and limit all other DOFs
-	// Build the frame in world coordinate system first
-	btVector3 zAxis = axis1.normalize();
-	btVector3 xAxis = axis2.normalize();
-	btVector3 yAxis = zAxis.cross(xAxis); // we want right coordinate system
-	btTransform frameInW;
-	frameInW.setIdentity();
-	frameInW.getBasis().setValue(	xAxis[0], yAxis[0], zAxis[0],	
-									xAxis[1], yAxis[1], zAxis[1],
-									xAxis[2], yAxis[2], zAxis[2]);
-	frameInW.setOrigin(anchor);
-	// now get constraint frame in local coordinate systems
-	m_frameInA = rbA.getCenterOfMassTransform().inverse() * frameInW;
-	m_frameInB = rbB.getCenterOfMassTransform().inverse() * frameInW;
-	// sei limits
-	setLinearLowerLimit(btVector3(0.f, 0.f, -1.f));
-	setLinearUpperLimit(btVector3(0.f, 0.f,  1.f));
-	// like front wheels of a car
-	setAngularLowerLimit(btVector3(1.f,  0.f, -SIMD_HALF_PI * 0.5f)); 
-	setAngularUpperLimit(btVector3(-1.f, 0.f,  SIMD_HALF_PI * 0.5f));
-	// enable suspension
-	enableSpring(2, true);
-	setStiffness(2, SIMD_PI * SIMD_PI * 4.f); // period 1 sec for 1 kilogramm weel :-)
-	setDamping(2, 0.01f);
-	setEquilibriumPoint();
-}
-
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.h
deleted file mode 100644
index a76452d..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library, http://bulletphysics.org
-Copyright (C) 2006, 2007 Sony Computer Entertainment Inc. 
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_HINGE2_CONSTRAINT_H
-#define BT_HINGE2_CONSTRAINT_H
-
-
-
-#include "LinearMath/btVector3.h"
-#include "btTypedConstraint.h"
-#include "btGeneric6DofSpringConstraint.h"
-
-
-
-// Constraint similar to ODE Hinge2 Joint
-// has 3 degrees of frredom:
-// 2 rotational degrees of freedom, similar to Euler rotations around Z (axis 1) and X (axis 2)
-// 1 translational (along axis Z) with suspension spring
-
-class btHinge2Constraint : public btGeneric6DofSpringConstraint
-{
-protected:
-	btVector3	m_anchor;
-	btVector3	m_axis1;
-	btVector3	m_axis2;
-public:
-	// constructor
-	// anchor, axis1 and axis2 are in world coordinate system
-	// axis1 must be orthogonal to axis2
-    btHinge2Constraint(btRigidBody& rbA, btRigidBody& rbB, btVector3& anchor, btVector3& axis1, btVector3& axis2);
-	// access
-	const btVector3& getAnchor() { return m_calculatedTransformA.getOrigin(); }
-	const btVector3& getAnchor2() { return m_calculatedTransformB.getOrigin(); }
-	const btVector3& getAxis1() { return m_axis1; }
-	const btVector3& getAxis2() { return m_axis2; }
-	btScalar getAngle1() { return getAngle(2); }
-	btScalar getAngle2() { return getAngle(0); }
-	// limits
-	void setUpperLimit(btScalar ang1max) { setAngularUpperLimit(btVector3(-1.f, 0.f, ang1max)); }
-	void setLowerLimit(btScalar ang1min) { setAngularLowerLimit(btVector3( 1.f, 0.f, ang1min)); }
-};
-
-
-
-#endif // BT_HINGE2_CONSTRAINT_H
-
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp
deleted file mode 100644
index 144beef..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp
+++ /dev/null
@@ -1,1033 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "btHingeConstraint.h"
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-#include "LinearMath/btTransformUtil.h"
-#include "LinearMath/btMinMax.h"
-#include <new>
-#include "btSolverBody.h"
-
-
-
-//#define HINGE_USE_OBSOLETE_SOLVER false
-#define HINGE_USE_OBSOLETE_SOLVER false
-
-#define HINGE_USE_FRAME_OFFSET true
-
-#ifndef __SPU__
-
-
-
-
-
-btHingeConstraint::btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB,
-									 const btVector3& axisInA,const btVector3& axisInB, bool useReferenceFrameA)
-									 :btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA,rbB),
-									 m_angularOnly(false),
-									 m_enableAngularMotor(false),
-									 m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER),
-									 m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET),
-									 m_useReferenceFrameA(useReferenceFrameA),
-									 m_flags(0)
-#ifdef _BT_USE_CENTER_LIMIT_
-									,m_limit()
-#endif
-{
-	m_rbAFrame.getOrigin() = pivotInA;
-	
-	// since no frame is given, assume this to be zero angle and just pick rb transform axis
-	btVector3 rbAxisA1 = rbA.getCenterOfMassTransform().getBasis().getColumn(0);
-
-	btVector3 rbAxisA2;
-	btScalar projection = axisInA.dot(rbAxisA1);
-	if (projection >= 1.0f - SIMD_EPSILON) {
-		rbAxisA1 = -rbA.getCenterOfMassTransform().getBasis().getColumn(2);
-		rbAxisA2 = rbA.getCenterOfMassTransform().getBasis().getColumn(1);
-	} else if (projection <= -1.0f + SIMD_EPSILON) {
-		rbAxisA1 = rbA.getCenterOfMassTransform().getBasis().getColumn(2);
-		rbAxisA2 = rbA.getCenterOfMassTransform().getBasis().getColumn(1);      
-	} else {
-		rbAxisA2 = axisInA.cross(rbAxisA1);
-		rbAxisA1 = rbAxisA2.cross(axisInA);
-	}
-
-	m_rbAFrame.getBasis().setValue( rbAxisA1.getX(),rbAxisA2.getX(),axisInA.getX(),
-									rbAxisA1.getY(),rbAxisA2.getY(),axisInA.getY(),
-									rbAxisA1.getZ(),rbAxisA2.getZ(),axisInA.getZ() );
-
-	btQuaternion rotationArc = shortestArcQuat(axisInA,axisInB);
-	btVector3 rbAxisB1 =  quatRotate(rotationArc,rbAxisA1);
-	btVector3 rbAxisB2 =  axisInB.cross(rbAxisB1);	
-	
-	m_rbBFrame.getOrigin() = pivotInB;
-	m_rbBFrame.getBasis().setValue( rbAxisB1.getX(),rbAxisB2.getX(),axisInB.getX(),
-									rbAxisB1.getY(),rbAxisB2.getY(),axisInB.getY(),
-									rbAxisB1.getZ(),rbAxisB2.getZ(),axisInB.getZ() );
-	
-#ifndef	_BT_USE_CENTER_LIMIT_
-	//start with free
-	m_lowerLimit = btScalar(1.0f);
-	m_upperLimit = btScalar(-1.0f);
-	m_biasFactor = 0.3f;
-	m_relaxationFactor = 1.0f;
-	m_limitSoftness = 0.9f;
-	m_solveLimit = false;
-#endif
-	m_referenceSign = m_useReferenceFrameA ? btScalar(-1.f) : btScalar(1.f);
-}
-
-
-
-btHingeConstraint::btHingeConstraint(btRigidBody& rbA,const btVector3& pivotInA,const btVector3& axisInA, bool useReferenceFrameA)
-:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA), m_angularOnly(false), m_enableAngularMotor(false), 
-m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER),
-m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET),
-m_useReferenceFrameA(useReferenceFrameA),
-m_flags(0)
-#ifdef	_BT_USE_CENTER_LIMIT_
-,m_limit()
-#endif
-{
-
-	// since no frame is given, assume this to be zero angle and just pick rb transform axis
-	// fixed axis in worldspace
-	btVector3 rbAxisA1, rbAxisA2;
-	btPlaneSpace1(axisInA, rbAxisA1, rbAxisA2);
-
-	m_rbAFrame.getOrigin() = pivotInA;
-	m_rbAFrame.getBasis().setValue( rbAxisA1.getX(),rbAxisA2.getX(),axisInA.getX(),
-									rbAxisA1.getY(),rbAxisA2.getY(),axisInA.getY(),
-									rbAxisA1.getZ(),rbAxisA2.getZ(),axisInA.getZ() );
-
-	btVector3 axisInB = rbA.getCenterOfMassTransform().getBasis() * axisInA;
-
-	btQuaternion rotationArc = shortestArcQuat(axisInA,axisInB);
-	btVector3 rbAxisB1 =  quatRotate(rotationArc,rbAxisA1);
-	btVector3 rbAxisB2 = axisInB.cross(rbAxisB1);
-
-
-	m_rbBFrame.getOrigin() = rbA.getCenterOfMassTransform()(pivotInA);
-	m_rbBFrame.getBasis().setValue( rbAxisB1.getX(),rbAxisB2.getX(),axisInB.getX(),
-									rbAxisB1.getY(),rbAxisB2.getY(),axisInB.getY(),
-									rbAxisB1.getZ(),rbAxisB2.getZ(),axisInB.getZ() );
-	
-#ifndef	_BT_USE_CENTER_LIMIT_
-	//start with free
-	m_lowerLimit = btScalar(1.0f);
-	m_upperLimit = btScalar(-1.0f);
-	m_biasFactor = 0.3f;
-	m_relaxationFactor = 1.0f;
-	m_limitSoftness = 0.9f;
-	m_solveLimit = false;
-#endif
-	m_referenceSign = m_useReferenceFrameA ? btScalar(-1.f) : btScalar(1.f);
-}
-
-
-
-btHingeConstraint::btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, 
-								     const btTransform& rbAFrame, const btTransform& rbBFrame, bool useReferenceFrameA)
-:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA,rbB),m_rbAFrame(rbAFrame),m_rbBFrame(rbBFrame),
-m_angularOnly(false),
-m_enableAngularMotor(false),
-m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER),
-m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET),
-m_useReferenceFrameA(useReferenceFrameA),
-m_flags(0)
-#ifdef	_BT_USE_CENTER_LIMIT_
-,m_limit()
-#endif
-{
-#ifndef	_BT_USE_CENTER_LIMIT_
-	//start with free
-	m_lowerLimit = btScalar(1.0f);
-	m_upperLimit = btScalar(-1.0f);
-	m_biasFactor = 0.3f;
-	m_relaxationFactor = 1.0f;
-	m_limitSoftness = 0.9f;
-	m_solveLimit = false;
-#endif
-	m_referenceSign = m_useReferenceFrameA ? btScalar(-1.f) : btScalar(1.f);
-}			
-
-
-
-btHingeConstraint::btHingeConstraint(btRigidBody& rbA, const btTransform& rbAFrame, bool useReferenceFrameA)
-:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA),m_rbAFrame(rbAFrame),m_rbBFrame(rbAFrame),
-m_angularOnly(false),
-m_enableAngularMotor(false),
-m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER),
-m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET),
-m_useReferenceFrameA(useReferenceFrameA),
-m_flags(0)
-#ifdef	_BT_USE_CENTER_LIMIT_
-,m_limit()
-#endif
-{
-	///not providing rigidbody B means implicitly using worldspace for body B
-
-	m_rbBFrame.getOrigin() = m_rbA.getCenterOfMassTransform()(m_rbAFrame.getOrigin());
-#ifndef	_BT_USE_CENTER_LIMIT_
-	//start with free
-	m_lowerLimit = btScalar(1.0f);
-	m_upperLimit = btScalar(-1.0f);
-	m_biasFactor = 0.3f;
-	m_relaxationFactor = 1.0f;
-	m_limitSoftness = 0.9f;
-	m_solveLimit = false;
-#endif
-	m_referenceSign = m_useReferenceFrameA ? btScalar(-1.f) : btScalar(1.f);
-}
-
-
-
-void	btHingeConstraint::buildJacobian()
-{
-	if (m_useSolveConstraintObsolete)
-	{
-		m_appliedImpulse = btScalar(0.);
-		m_accMotorImpulse = btScalar(0.);
-
-		if (!m_angularOnly)
-		{
-			btVector3 pivotAInW = m_rbA.getCenterOfMassTransform()*m_rbAFrame.getOrigin();
-			btVector3 pivotBInW = m_rbB.getCenterOfMassTransform()*m_rbBFrame.getOrigin();
-			btVector3 relPos = pivotBInW - pivotAInW;
-
-			btVector3 normal[3];
-			if (relPos.length2() > SIMD_EPSILON)
-			{
-				normal[0] = relPos.normalized();
-			}
-			else
-			{
-				normal[0].setValue(btScalar(1.0),0,0);
-			}
-
-			btPlaneSpace1(normal[0], normal[1], normal[2]);
-
-			for (int i=0;i<3;i++)
-			{
-				new (&m_jac[i]) btJacobianEntry(
-				m_rbA.getCenterOfMassTransform().getBasis().transpose(),
-				m_rbB.getCenterOfMassTransform().getBasis().transpose(),
-				pivotAInW - m_rbA.getCenterOfMassPosition(),
-				pivotBInW - m_rbB.getCenterOfMassPosition(),
-				normal[i],
-				m_rbA.getInvInertiaDiagLocal(),
-				m_rbA.getInvMass(),
-				m_rbB.getInvInertiaDiagLocal(),
-				m_rbB.getInvMass());
-			}
-		}
-
-		//calculate two perpendicular jointAxis, orthogonal to hingeAxis
-		//these two jointAxis require equal angular velocities for both bodies
-
-		//this is unused for now, it's a todo
-		btVector3 jointAxis0local;
-		btVector3 jointAxis1local;
-		
-		btPlaneSpace1(m_rbAFrame.getBasis().getColumn(2),jointAxis0local,jointAxis1local);
-
-		btVector3 jointAxis0 = getRigidBodyA().getCenterOfMassTransform().getBasis() * jointAxis0local;
-		btVector3 jointAxis1 = getRigidBodyA().getCenterOfMassTransform().getBasis() * jointAxis1local;
-		btVector3 hingeAxisWorld = getRigidBodyA().getCenterOfMassTransform().getBasis() * m_rbAFrame.getBasis().getColumn(2);
-			
-		new (&m_jacAng[0])	btJacobianEntry(jointAxis0,
-			m_rbA.getCenterOfMassTransform().getBasis().transpose(),
-			m_rbB.getCenterOfMassTransform().getBasis().transpose(),
-			m_rbA.getInvInertiaDiagLocal(),
-			m_rbB.getInvInertiaDiagLocal());
-
-		new (&m_jacAng[1])	btJacobianEntry(jointAxis1,
-			m_rbA.getCenterOfMassTransform().getBasis().transpose(),
-			m_rbB.getCenterOfMassTransform().getBasis().transpose(),
-			m_rbA.getInvInertiaDiagLocal(),
-			m_rbB.getInvInertiaDiagLocal());
-
-		new (&m_jacAng[2])	btJacobianEntry(hingeAxisWorld,
-			m_rbA.getCenterOfMassTransform().getBasis().transpose(),
-			m_rbB.getCenterOfMassTransform().getBasis().transpose(),
-			m_rbA.getInvInertiaDiagLocal(),
-			m_rbB.getInvInertiaDiagLocal());
-
-			// clear accumulator
-			m_accLimitImpulse = btScalar(0.);
-
-			// test angular limit
-			testLimit(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
-
-		//Compute K = J*W*J' for hinge axis
-		btVector3 axisA =  getRigidBodyA().getCenterOfMassTransform().getBasis() *  m_rbAFrame.getBasis().getColumn(2);
-		m_kHinge =   1.0f / (getRigidBodyA().computeAngularImpulseDenominator(axisA) +
-							 getRigidBodyB().computeAngularImpulseDenominator(axisA));
-
-	}
-}
-
-
-#endif //__SPU__
-
-
-void btHingeConstraint::getInfo1(btConstraintInfo1* info)
-{
-	if (m_useSolveConstraintObsolete)
-	{
-		info->m_numConstraintRows = 0;
-		info->nub = 0;
-	}
-	else
-	{
-		info->m_numConstraintRows = 5; // Fixed 3 linear + 2 angular
-		info->nub = 1; 
-		//always add the row, to avoid computation (data is not available yet)
-		//prepare constraint
-		testLimit(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
-		if(getSolveLimit() || getEnableAngularMotor())
-		{
-			info->m_numConstraintRows++; // limit 3rd anguar as well
-			info->nub--; 
-		}
-
-	}
-}
-
-void btHingeConstraint::getInfo1NonVirtual(btConstraintInfo1* info)
-{
-	if (m_useSolveConstraintObsolete)
-	{
-		info->m_numConstraintRows = 0;
-		info->nub = 0;
-	}
-	else
-	{
-		//always add the 'limit' row, to avoid computation (data is not available yet)
-		info->m_numConstraintRows = 6; // Fixed 3 linear + 2 angular
-		info->nub = 0; 
-	}
-}
-
-void btHingeConstraint::getInfo2 (btConstraintInfo2* info)
-{
-	if(m_useOffsetForConstraintFrame)
-	{
-		getInfo2InternalUsingFrameOffset(info, m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform(),m_rbA.getAngularVelocity(),m_rbB.getAngularVelocity());
-	}
-	else
-	{
-		getInfo2Internal(info, m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform(),m_rbA.getAngularVelocity(),m_rbB.getAngularVelocity());
-	}
-}
-
-
-void	btHingeConstraint::getInfo2NonVirtual (btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btVector3& angVelA,const btVector3& angVelB)
-{
-	///the regular (virtual) implementation getInfo2 already performs 'testLimit' during getInfo1, so we need to do it now
-	testLimit(transA,transB);
-
-	getInfo2Internal(info,transA,transB,angVelA,angVelB);
-}
-
-
-void btHingeConstraint::getInfo2Internal(btConstraintInfo2* info, const btTransform& transA,const btTransform& transB,const btVector3& angVelA,const btVector3& angVelB)
-{
-
-	btAssert(!m_useSolveConstraintObsolete);
-	int i, skip = info->rowskip;
-	// transforms in world space
-	btTransform trA = transA*m_rbAFrame;
-	btTransform trB = transB*m_rbBFrame;
-	// pivot point
-	btVector3 pivotAInW = trA.getOrigin();
-	btVector3 pivotBInW = trB.getOrigin();
-#if 0
-	if (0)
-	{
-		for (i=0;i<6;i++)
-		{
-			info->m_J1linearAxis[i*skip]=0;
-			info->m_J1linearAxis[i*skip+1]=0;
-			info->m_J1linearAxis[i*skip+2]=0;
-
-			info->m_J1angularAxis[i*skip]=0;
-			info->m_J1angularAxis[i*skip+1]=0;
-			info->m_J1angularAxis[i*skip+2]=0;
-
-			info->m_J2angularAxis[i*skip]=0;
-			info->m_J2angularAxis[i*skip+1]=0;
-			info->m_J2angularAxis[i*skip+2]=0;
-
-			info->m_constraintError[i*skip]=0.f;
-		}
-	}
-#endif //#if 0
-	// linear (all fixed)
-
-	if (!m_angularOnly)
-	{
-		info->m_J1linearAxis[0] = 1;
-		info->m_J1linearAxis[skip + 1] = 1;
-		info->m_J1linearAxis[2 * skip + 2] = 1;
-	}	
-
-
-
-
-	btVector3 a1 = pivotAInW - transA.getOrigin();
-	{
-		btVector3* angular0 = (btVector3*)(info->m_J1angularAxis);
-		btVector3* angular1 = (btVector3*)(info->m_J1angularAxis + skip);
-		btVector3* angular2 = (btVector3*)(info->m_J1angularAxis + 2 * skip);
-		btVector3 a1neg = -a1;
-		a1neg.getSkewSymmetricMatrix(angular0,angular1,angular2);
-	}
-	btVector3 a2 = pivotBInW - transB.getOrigin();
-	{
-		btVector3* angular0 = (btVector3*)(info->m_J2angularAxis);
-		btVector3* angular1 = (btVector3*)(info->m_J2angularAxis + skip);
-		btVector3* angular2 = (btVector3*)(info->m_J2angularAxis + 2 * skip);
-		a2.getSkewSymmetricMatrix(angular0,angular1,angular2);
-	}
-	// linear RHS
-    btScalar k = info->fps * info->erp;
-	if (!m_angularOnly)
-	{
-		for(i = 0; i < 3; i++)
-		{
-			info->m_constraintError[i * skip] = k * (pivotBInW[i] - pivotAInW[i]);
-		}
-	}
-	// make rotations around X and Y equal
-	// the hinge axis should be the only unconstrained
-	// rotational axis, the angular velocity of the two bodies perpendicular to
-	// the hinge axis should be equal. thus the constraint equations are
-	//    p*w1 - p*w2 = 0
-	//    q*w1 - q*w2 = 0
-	// where p and q are unit vectors normal to the hinge axis, and w1 and w2
-	// are the angular velocity vectors of the two bodies.
-	// get hinge axis (Z)
-	btVector3 ax1 = trA.getBasis().getColumn(2);
-	// get 2 orthos to hinge axis (X, Y)
-	btVector3 p = trA.getBasis().getColumn(0);
-	btVector3 q = trA.getBasis().getColumn(1);
-	// set the two hinge angular rows 
-    int s3 = 3 * info->rowskip;
-    int s4 = 4 * info->rowskip;
-
-	info->m_J1angularAxis[s3 + 0] = p[0];
-	info->m_J1angularAxis[s3 + 1] = p[1];
-	info->m_J1angularAxis[s3 + 2] = p[2];
-	info->m_J1angularAxis[s4 + 0] = q[0];
-	info->m_J1angularAxis[s4 + 1] = q[1];
-	info->m_J1angularAxis[s4 + 2] = q[2];
-
-	info->m_J2angularAxis[s3 + 0] = -p[0];
-	info->m_J2angularAxis[s3 + 1] = -p[1];
-	info->m_J2angularAxis[s3 + 2] = -p[2];
-	info->m_J2angularAxis[s4 + 0] = -q[0];
-	info->m_J2angularAxis[s4 + 1] = -q[1];
-	info->m_J2angularAxis[s4 + 2] = -q[2];
-    // compute the right hand side of the constraint equation. set relative
-    // body velocities along p and q to bring the hinge back into alignment.
-    // if ax1,ax2 are the unit length hinge axes as computed from body1 and
-    // body2, we need to rotate both bodies along the axis u = (ax1 x ax2).
-    // if `theta' is the angle between ax1 and ax2, we need an angular velocity
-    // along u to cover angle erp*theta in one step :
-    //   |angular_velocity| = angle/time = erp*theta / stepsize
-    //                      = (erp*fps) * theta
-    //    angular_velocity  = |angular_velocity| * (ax1 x ax2) / |ax1 x ax2|
-    //                      = (erp*fps) * theta * (ax1 x ax2) / sin(theta)
-    // ...as ax1 and ax2 are unit length. if theta is smallish,
-    // theta ~= sin(theta), so
-    //    angular_velocity  = (erp*fps) * (ax1 x ax2)
-    // ax1 x ax2 is in the plane space of ax1, so we project the angular
-    // velocity to p and q to find the right hand side.
-    btVector3 ax2 = trB.getBasis().getColumn(2);
-	btVector3 u = ax1.cross(ax2);
-	info->m_constraintError[s3] = k * u.dot(p);
-	info->m_constraintError[s4] = k * u.dot(q);
-	// check angular limits
-	int nrow = 4; // last filled row
-	int srow;
-	btScalar limit_err = btScalar(0.0);
-	int limit = 0;
-	if(getSolveLimit())
-	{
-#ifdef	_BT_USE_CENTER_LIMIT_
-	limit_err = m_limit.getCorrection() * m_referenceSign;
-#else
-	limit_err = m_correction * m_referenceSign;
-#endif
-	limit = (limit_err > btScalar(0.0)) ? 1 : 2;
-
-	}
-	// if the hinge has joint limits or motor, add in the extra row
-	int powered = 0;
-	if(getEnableAngularMotor())
-	{
-		powered = 1;
-	}
-	if(limit || powered) 
-	{
-		nrow++;
-		srow = nrow * info->rowskip;
-		info->m_J1angularAxis[srow+0] = ax1[0];
-		info->m_J1angularAxis[srow+1] = ax1[1];
-		info->m_J1angularAxis[srow+2] = ax1[2];
-
-		info->m_J2angularAxis[srow+0] = -ax1[0];
-		info->m_J2angularAxis[srow+1] = -ax1[1];
-		info->m_J2angularAxis[srow+2] = -ax1[2];
-
-		btScalar lostop = getLowerLimit();
-		btScalar histop = getUpperLimit();
-		if(limit && (lostop == histop))
-		{  // the joint motor is ineffective
-			powered = 0;
-		}
-		info->m_constraintError[srow] = btScalar(0.0f);
-		btScalar currERP = (m_flags & BT_HINGE_FLAGS_ERP_STOP) ? m_stopERP : info->erp;
-		if(powered)
-		{
-			if(m_flags & BT_HINGE_FLAGS_CFM_NORM)
-			{
-				info->cfm[srow] = m_normalCFM;
-			}
-			btScalar mot_fact = getMotorFactor(m_hingeAngle, lostop, histop, m_motorTargetVelocity, info->fps * currERP);
-			info->m_constraintError[srow] += mot_fact * m_motorTargetVelocity * m_referenceSign;
-			info->m_lowerLimit[srow] = - m_maxMotorImpulse;
-			info->m_upperLimit[srow] =   m_maxMotorImpulse;
-		}
-		if(limit)
-		{
-			k = info->fps * currERP;
-			info->m_constraintError[srow] += k * limit_err;
-			if(m_flags & BT_HINGE_FLAGS_CFM_STOP)
-			{
-				info->cfm[srow] = m_stopCFM;
-			}
-			if(lostop == histop) 
-			{
-				// limited low and high simultaneously
-				info->m_lowerLimit[srow] = -SIMD_INFINITY;
-				info->m_upperLimit[srow] = SIMD_INFINITY;
-			}
-			else if(limit == 1) 
-			{ // low limit
-				info->m_lowerLimit[srow] = 0;
-				info->m_upperLimit[srow] = SIMD_INFINITY;
-			}
-			else 
-			{ // high limit
-				info->m_lowerLimit[srow] = -SIMD_INFINITY;
-				info->m_upperLimit[srow] = 0;
-			}
-			// bounce (we'll use slider parameter abs(1.0 - m_dampingLimAng) for that)
-#ifdef	_BT_USE_CENTER_LIMIT_
-			btScalar bounce = m_limit.getRelaxationFactor();
-#else
-			btScalar bounce = m_relaxationFactor;
-#endif
-			if(bounce > btScalar(0.0))
-			{
-				btScalar vel = angVelA.dot(ax1);
-				vel -= angVelB.dot(ax1);
-				// only apply bounce if the velocity is incoming, and if the
-				// resulting c[] exceeds what we already have.
-				if(limit == 1)
-				{	// low limit
-					if(vel < 0)
-					{
-						btScalar newc = -bounce * vel;
-						if(newc > info->m_constraintError[srow])
-						{
-							info->m_constraintError[srow] = newc;
-						}
-					}
-				}
-				else
-				{	// high limit - all those computations are reversed
-					if(vel > 0)
-					{
-						btScalar newc = -bounce * vel;
-						if(newc < info->m_constraintError[srow])
-						{
-							info->m_constraintError[srow] = newc;
-						}
-					}
-				}
-			}
-#ifdef	_BT_USE_CENTER_LIMIT_
-			info->m_constraintError[srow] *= m_limit.getBiasFactor();
-#else
-			info->m_constraintError[srow] *= m_biasFactor;
-#endif
-		} // if(limit)
-	} // if angular limit or powered
-}
-
-
-void btHingeConstraint::setFrames(const btTransform & frameA, const btTransform & frameB)
-{
-	m_rbAFrame = frameA;
-	m_rbBFrame = frameB;
-	buildJacobian();
-}
-
-
-void	btHingeConstraint::updateRHS(btScalar	timeStep)
-{
-	(void)timeStep;
-
-}
-
-
-btScalar btHingeConstraint::getHingeAngle()
-{
-	return getHingeAngle(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
-}
-
-btScalar btHingeConstraint::getHingeAngle(const btTransform& transA,const btTransform& transB)
-{
-	const btVector3 refAxis0  = transA.getBasis() * m_rbAFrame.getBasis().getColumn(0);
-	const btVector3 refAxis1  = transA.getBasis() * m_rbAFrame.getBasis().getColumn(1);
-	const btVector3 swingAxis = transB.getBasis() * m_rbBFrame.getBasis().getColumn(1);
-//	btScalar angle = btAtan2Fast(swingAxis.dot(refAxis0), swingAxis.dot(refAxis1));
-	btScalar angle = btAtan2(swingAxis.dot(refAxis0), swingAxis.dot(refAxis1));
-	return m_referenceSign * angle;
-}
-
-
-
-void btHingeConstraint::testLimit(const btTransform& transA,const btTransform& transB)
-{
-	// Compute limit information
-	m_hingeAngle = getHingeAngle(transA,transB);
-#ifdef	_BT_USE_CENTER_LIMIT_
-	m_limit.test(m_hingeAngle);
-#else
-	m_correction = btScalar(0.);
-	m_limitSign = btScalar(0.);
-	m_solveLimit = false;
-	if (m_lowerLimit <= m_upperLimit)
-	{
-		m_hingeAngle = btAdjustAngleToLimits(m_hingeAngle, m_lowerLimit, m_upperLimit);
-		if (m_hingeAngle <= m_lowerLimit)
-		{
-			m_correction = (m_lowerLimit - m_hingeAngle);
-			m_limitSign = 1.0f;
-			m_solveLimit = true;
-		} 
-		else if (m_hingeAngle >= m_upperLimit)
-		{
-			m_correction = m_upperLimit - m_hingeAngle;
-			m_limitSign = -1.0f;
-			m_solveLimit = true;
-		}
-	}
-#endif
-	return;
-}
-
-
-static btVector3 vHinge(0, 0, btScalar(1));
-
-void btHingeConstraint::setMotorTarget(const btQuaternion& qAinB, btScalar dt)
-{
-	// convert target from body to constraint space
-	btQuaternion qConstraint = m_rbBFrame.getRotation().inverse() * qAinB * m_rbAFrame.getRotation();
-	qConstraint.normalize();
-
-	// extract "pure" hinge component
-	btVector3 vNoHinge = quatRotate(qConstraint, vHinge); vNoHinge.normalize();
-	btQuaternion qNoHinge = shortestArcQuat(vHinge, vNoHinge);
-	btQuaternion qHinge = qNoHinge.inverse() * qConstraint;
-	qHinge.normalize();
-
-	// compute angular target, clamped to limits
-	btScalar targetAngle = qHinge.getAngle();
-	if (targetAngle > SIMD_PI) // long way around. flip quat and recalculate.
-	{
-		qHinge = operator-(qHinge);
-		targetAngle = qHinge.getAngle();
-	}
-	if (qHinge.getZ() < 0)
-		targetAngle = -targetAngle;
-
-	setMotorTarget(targetAngle, dt);
-}
-
-void btHingeConstraint::setMotorTarget(btScalar targetAngle, btScalar dt)
-{
-#ifdef	_BT_USE_CENTER_LIMIT_
-	m_limit.fit(targetAngle);
-#else
-	if (m_lowerLimit < m_upperLimit)
-	{
-		if (targetAngle < m_lowerLimit)
-			targetAngle = m_lowerLimit;
-		else if (targetAngle > m_upperLimit)
-			targetAngle = m_upperLimit;
-	}
-#endif
-	// compute angular velocity
-	btScalar curAngle  = getHingeAngle(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
-	btScalar dAngle = targetAngle - curAngle;
-	m_motorTargetVelocity = dAngle / dt;
-}
-
-
-
-void btHingeConstraint::getInfo2InternalUsingFrameOffset(btConstraintInfo2* info, const btTransform& transA,const btTransform& transB,const btVector3& angVelA,const btVector3& angVelB)
-{
-	btAssert(!m_useSolveConstraintObsolete);
-	int i, s = info->rowskip;
-	// transforms in world space
-	btTransform trA = transA*m_rbAFrame;
-	btTransform trB = transB*m_rbBFrame;
-	// pivot point
-	btVector3 pivotAInW = trA.getOrigin();
-	btVector3 pivotBInW = trB.getOrigin();
-#if 1
-	// difference between frames in WCS
-	btVector3 ofs = trB.getOrigin() - trA.getOrigin();
-	// now get weight factors depending on masses
-	btScalar miA = getRigidBodyA().getInvMass();
-	btScalar miB = getRigidBodyB().getInvMass();
-	bool hasStaticBody = (miA < SIMD_EPSILON) || (miB < SIMD_EPSILON);
-	btScalar miS = miA + miB;
-	btScalar factA, factB;
-	if(miS > btScalar(0.f))
-	{
-		factA = miB / miS;
-	}
-	else 
-	{
-		factA = btScalar(0.5f);
-	}
-	factB = btScalar(1.0f) - factA;
-	// get the desired direction of hinge axis
-	// as weighted sum of Z-orthos of frameA and frameB in WCS
-	btVector3 ax1A = trA.getBasis().getColumn(2);
-	btVector3 ax1B = trB.getBasis().getColumn(2);
-	btVector3 ax1 = ax1A * factA + ax1B * factB;
-	ax1.normalize();
-	// fill first 3 rows 
-	// we want: velA + wA x relA == velB + wB x relB
-	btTransform bodyA_trans = transA;
-	btTransform bodyB_trans = transB;
-	int s0 = 0;
-	int s1 = s;
-	int s2 = s * 2;
-	int nrow = 2; // last filled row
-	btVector3 tmpA, tmpB, relA, relB, p, q;
-	// get vector from bodyB to frameB in WCS
-	relB = trB.getOrigin() - bodyB_trans.getOrigin();
-	// get its projection to hinge axis
-	btVector3 projB = ax1 * relB.dot(ax1);
-	// get vector directed from bodyB to hinge axis (and orthogonal to it)
-	btVector3 orthoB = relB - projB;
-	// same for bodyA
-	relA = trA.getOrigin() - bodyA_trans.getOrigin();
-	btVector3 projA = ax1 * relA.dot(ax1);
-	btVector3 orthoA = relA - projA;
-	btVector3 totalDist = projA - projB;
-	// get offset vectors relA and relB
-	relA = orthoA + totalDist * factA;
-	relB = orthoB - totalDist * factB;
-	// now choose average ortho to hinge axis
-	p = orthoB * factA + orthoA * factB;
-	btScalar len2 = p.length2();
-	if(len2 > SIMD_EPSILON)
-	{
-		p /= btSqrt(len2);
-	}
-	else
-	{
-		p = trA.getBasis().getColumn(1);
-	}
-	// make one more ortho
-	q = ax1.cross(p);
-	// fill three rows
-	tmpA = relA.cross(p);
-	tmpB = relB.cross(p);
-    for (i=0; i<3; i++) info->m_J1angularAxis[s0+i] = tmpA[i];
-    for (i=0; i<3; i++) info->m_J2angularAxis[s0+i] = -tmpB[i];
-	tmpA = relA.cross(q);
-	tmpB = relB.cross(q);
-	if(hasStaticBody && getSolveLimit())
-	{ // to make constraint between static and dynamic objects more rigid
-		// remove wA (or wB) from equation if angular limit is hit
-		tmpB *= factB;
-		tmpA *= factA;
-	}
-	for (i=0; i<3; i++) info->m_J1angularAxis[s1+i] = tmpA[i];
-    for (i=0; i<3; i++) info->m_J2angularAxis[s1+i] = -tmpB[i];
-	tmpA = relA.cross(ax1);
-	tmpB = relB.cross(ax1);
-	if(hasStaticBody)
-	{ // to make constraint between static and dynamic objects more rigid
-		// remove wA (or wB) from equation
-		tmpB *= factB;
-		tmpA *= factA;
-	}
-	for (i=0; i<3; i++) info->m_J1angularAxis[s2+i] = tmpA[i];
-    for (i=0; i<3; i++) info->m_J2angularAxis[s2+i] = -tmpB[i];
-
-	btScalar k = info->fps * info->erp;
-
-	if (!m_angularOnly)
-	{
-		for (i=0; i<3; i++) info->m_J1linearAxis[s0+i] = p[i];
-		for (i=0; i<3; i++) info->m_J1linearAxis[s1+i] = q[i];
-		for (i=0; i<3; i++) info->m_J1linearAxis[s2+i] = ax1[i];
-	
-	// compute three elements of right hand side
-	
-		btScalar rhs = k * p.dot(ofs);
-		info->m_constraintError[s0] = rhs;
-		rhs = k * q.dot(ofs);
-		info->m_constraintError[s1] = rhs;
-		rhs = k * ax1.dot(ofs);
-		info->m_constraintError[s2] = rhs;
-	}
-	// the hinge axis should be the only unconstrained
-	// rotational axis, the angular velocity of the two bodies perpendicular to
-	// the hinge axis should be equal. thus the constraint equations are
-	//    p*w1 - p*w2 = 0
-	//    q*w1 - q*w2 = 0
-	// where p and q are unit vectors normal to the hinge axis, and w1 and w2
-	// are the angular velocity vectors of the two bodies.
-	int s3 = 3 * s;
-	int s4 = 4 * s;
-	info->m_J1angularAxis[s3 + 0] = p[0];
-	info->m_J1angularAxis[s3 + 1] = p[1];
-	info->m_J1angularAxis[s3 + 2] = p[2];
-	info->m_J1angularAxis[s4 + 0] = q[0];
-	info->m_J1angularAxis[s4 + 1] = q[1];
-	info->m_J1angularAxis[s4 + 2] = q[2];
-
-	info->m_J2angularAxis[s3 + 0] = -p[0];
-	info->m_J2angularAxis[s3 + 1] = -p[1];
-	info->m_J2angularAxis[s3 + 2] = -p[2];
-	info->m_J2angularAxis[s4 + 0] = -q[0];
-	info->m_J2angularAxis[s4 + 1] = -q[1];
-	info->m_J2angularAxis[s4 + 2] = -q[2];
-	// compute the right hand side of the constraint equation. set relative
-	// body velocities along p and q to bring the hinge back into alignment.
-	// if ax1A,ax1B are the unit length hinge axes as computed from bodyA and
-	// bodyB, we need to rotate both bodies along the axis u = (ax1 x ax2).
-	// if "theta" is the angle between ax1 and ax2, we need an angular velocity
-	// along u to cover angle erp*theta in one step :
-	//   |angular_velocity| = angle/time = erp*theta / stepsize
-	//                      = (erp*fps) * theta
-	//    angular_velocity  = |angular_velocity| * (ax1 x ax2) / |ax1 x ax2|
-	//                      = (erp*fps) * theta * (ax1 x ax2) / sin(theta)
-	// ...as ax1 and ax2 are unit length. if theta is smallish,
-	// theta ~= sin(theta), so
-	//    angular_velocity  = (erp*fps) * (ax1 x ax2)
-	// ax1 x ax2 is in the plane space of ax1, so we project the angular
-	// velocity to p and q to find the right hand side.
-	k = info->fps * info->erp;
-	btVector3 u = ax1A.cross(ax1B);
-	info->m_constraintError[s3] = k * u.dot(p);
-	info->m_constraintError[s4] = k * u.dot(q);
-#endif
-	// check angular limits
-	nrow = 4; // last filled row
-	int srow;
-	btScalar limit_err = btScalar(0.0);
-	int limit = 0;
-	if(getSolveLimit())
-	{
-#ifdef	_BT_USE_CENTER_LIMIT_
-	limit_err = m_limit.getCorrection() * m_referenceSign;
-#else
-	limit_err = m_correction * m_referenceSign;
-#endif
-	limit = (limit_err > btScalar(0.0)) ? 1 : 2;
-
-	}
-	// if the hinge has joint limits or motor, add in the extra row
-	int powered = 0;
-	if(getEnableAngularMotor())
-	{
-		powered = 1;
-	}
-	if(limit || powered) 
-	{
-		nrow++;
-		srow = nrow * info->rowskip;
-		info->m_J1angularAxis[srow+0] = ax1[0];
-		info->m_J1angularAxis[srow+1] = ax1[1];
-		info->m_J1angularAxis[srow+2] = ax1[2];
-
-		info->m_J2angularAxis[srow+0] = -ax1[0];
-		info->m_J2angularAxis[srow+1] = -ax1[1];
-		info->m_J2angularAxis[srow+2] = -ax1[2];
-
-		btScalar lostop = getLowerLimit();
-		btScalar histop = getUpperLimit();
-		if(limit && (lostop == histop))
-		{  // the joint motor is ineffective
-			powered = 0;
-		}
-		info->m_constraintError[srow] = btScalar(0.0f);
-		btScalar currERP = (m_flags & BT_HINGE_FLAGS_ERP_STOP) ? m_stopERP : info->erp;
-		if(powered)
-		{
-			if(m_flags & BT_HINGE_FLAGS_CFM_NORM)
-			{
-				info->cfm[srow] = m_normalCFM;
-			}
-			btScalar mot_fact = getMotorFactor(m_hingeAngle, lostop, histop, m_motorTargetVelocity, info->fps * currERP);
-			info->m_constraintError[srow] += mot_fact * m_motorTargetVelocity * m_referenceSign;
-			info->m_lowerLimit[srow] = - m_maxMotorImpulse;
-			info->m_upperLimit[srow] =   m_maxMotorImpulse;
-		}
-		if(limit)
-		{
-			k = info->fps * currERP;
-			info->m_constraintError[srow] += k * limit_err;
-			if(m_flags & BT_HINGE_FLAGS_CFM_STOP)
-			{
-				info->cfm[srow] = m_stopCFM;
-			}
-			if(lostop == histop) 
-			{
-				// limited low and high simultaneously
-				info->m_lowerLimit[srow] = -SIMD_INFINITY;
-				info->m_upperLimit[srow] = SIMD_INFINITY;
-			}
-			else if(limit == 1) 
-			{ // low limit
-				info->m_lowerLimit[srow] = 0;
-				info->m_upperLimit[srow] = SIMD_INFINITY;
-			}
-			else 
-			{ // high limit
-				info->m_lowerLimit[srow] = -SIMD_INFINITY;
-				info->m_upperLimit[srow] = 0;
-			}
-			// bounce (we'll use slider parameter abs(1.0 - m_dampingLimAng) for that)
-#ifdef	_BT_USE_CENTER_LIMIT_
-			btScalar bounce = m_limit.getRelaxationFactor();
-#else
-			btScalar bounce = m_relaxationFactor;
-#endif
-			if(bounce > btScalar(0.0))
-			{
-				btScalar vel = angVelA.dot(ax1);
-				vel -= angVelB.dot(ax1);
-				// only apply bounce if the velocity is incoming, and if the
-				// resulting c[] exceeds what we already have.
-				if(limit == 1)
-				{	// low limit
-					if(vel < 0)
-					{
-						btScalar newc = -bounce * vel;
-						if(newc > info->m_constraintError[srow])
-						{
-							info->m_constraintError[srow] = newc;
-						}
-					}
-				}
-				else
-				{	// high limit - all those computations are reversed
-					if(vel > 0)
-					{
-						btScalar newc = -bounce * vel;
-						if(newc < info->m_constraintError[srow])
-						{
-							info->m_constraintError[srow] = newc;
-						}
-					}
-				}
-			}
-#ifdef	_BT_USE_CENTER_LIMIT_
-			info->m_constraintError[srow] *= m_limit.getBiasFactor();
-#else
-			info->m_constraintError[srow] *= m_biasFactor;
-#endif
-		} // if(limit)
-	} // if angular limit or powered
-}
-
-
-///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
-///If no axis is provided, it uses the default axis for this constraint.
-void btHingeConstraint::setParam(int num, btScalar value, int axis)
-{
-	if((axis == -1) || (axis == 5))
-	{
-		switch(num)
-		{	
-			case BT_CONSTRAINT_STOP_ERP :
-				m_stopERP = value;
-				m_flags |= BT_HINGE_FLAGS_ERP_STOP;
-				break;
-			case BT_CONSTRAINT_STOP_CFM :
-				m_stopCFM = value;
-				m_flags |= BT_HINGE_FLAGS_CFM_STOP;
-				break;
-			case BT_CONSTRAINT_CFM :
-				m_normalCFM = value;
-				m_flags |= BT_HINGE_FLAGS_CFM_NORM;
-				break;
-			default : 
-				btAssertConstrParams(0);
-		}
-	}
-	else
-	{
-		btAssertConstrParams(0);
-	}
-}
-
-///return the local value of parameter
-btScalar btHingeConstraint::getParam(int num, int axis) const 
-{
-	btScalar retVal = 0;
-	if((axis == -1) || (axis == 5))
-	{
-		switch(num)
-		{	
-			case BT_CONSTRAINT_STOP_ERP :
-				btAssertConstrParams(m_flags & BT_HINGE_FLAGS_ERP_STOP);
-				retVal = m_stopERP;
-				break;
-			case BT_CONSTRAINT_STOP_CFM :
-				btAssertConstrParams(m_flags & BT_HINGE_FLAGS_CFM_STOP);
-				retVal = m_stopCFM;
-				break;
-			case BT_CONSTRAINT_CFM :
-				btAssertConstrParams(m_flags & BT_HINGE_FLAGS_CFM_NORM);
-				retVal = m_normalCFM;
-				break;
-			default : 
-				btAssertConstrParams(0);
-		}
-	}
-	else
-	{
-		btAssertConstrParams(0);
-	}
-	return retVal;
-}
-
-
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h
deleted file mode 100644
index cb2973e..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-/* Hinge Constraint by Dirk Gregorius. Limits added by Marcus Hennix at Starbreeze Studios */
-
-#ifndef BT_HINGECONSTRAINT_H
-#define BT_HINGECONSTRAINT_H
-
-#define _BT_USE_CENTER_LIMIT_ 1
-
-
-#include "LinearMath/btVector3.h"
-#include "btJacobianEntry.h"
-#include "btTypedConstraint.h"
-
-class btRigidBody;
-
-#ifdef BT_USE_DOUBLE_PRECISION
-#define btHingeConstraintData	btHingeConstraintDoubleData
-#define btHingeConstraintDataName	"btHingeConstraintDoubleData"
-#else
-#define btHingeConstraintData	btHingeConstraintFloatData
-#define btHingeConstraintDataName	"btHingeConstraintFloatData"
-#endif //BT_USE_DOUBLE_PRECISION
-
-
-
-enum btHingeFlags
-{
-	BT_HINGE_FLAGS_CFM_STOP = 1,
-	BT_HINGE_FLAGS_ERP_STOP = 2,
-	BT_HINGE_FLAGS_CFM_NORM = 4
-};
-
-
-/// hinge constraint between two rigidbodies each with a pivotpoint that descibes the axis location in local space
-/// axis defines the orientation of the hinge axis
-ATTRIBUTE_ALIGNED16(class) btHingeConstraint : public btTypedConstraint
-{
-#ifdef IN_PARALLELL_SOLVER
-public:
-#endif
-	btJacobianEntry	m_jac[3]; //3 orthogonal linear constraints
-	btJacobianEntry	m_jacAng[3]; //2 orthogonal angular constraints+ 1 for limit/motor
-
-	btTransform m_rbAFrame; // constraint axii. Assumes z is hinge axis.
-	btTransform m_rbBFrame;
-
-	btScalar	m_motorTargetVelocity;
-	btScalar	m_maxMotorImpulse;
-
-
-#ifdef	_BT_USE_CENTER_LIMIT_
-	btAngularLimit	m_limit;
-#else
-	btScalar	m_lowerLimit;	
-	btScalar	m_upperLimit;	
-	btScalar	m_limitSign;
-	btScalar	m_correction;
-
-	btScalar	m_limitSoftness; 
-	btScalar	m_biasFactor; 
-	btScalar	m_relaxationFactor; 
-
-	bool		m_solveLimit;
-#endif
-
-	btScalar	m_kHinge;
-
-
-	btScalar	m_accLimitImpulse;
-	btScalar	m_hingeAngle;
-	btScalar	m_referenceSign;
-
-	bool		m_angularOnly;
-	bool		m_enableAngularMotor;
-	bool		m_useSolveConstraintObsolete;
-	bool		m_useOffsetForConstraintFrame;
-	bool		m_useReferenceFrameA;
-
-	btScalar	m_accMotorImpulse;
-
-	int			m_flags;
-	btScalar	m_normalCFM;
-	btScalar	m_stopCFM;
-	btScalar	m_stopERP;
-
-	
-public:
-
-	btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB, const btVector3& axisInA,const btVector3& axisInB, bool useReferenceFrameA = false);
-
-	btHingeConstraint(btRigidBody& rbA,const btVector3& pivotInA,const btVector3& axisInA, bool useReferenceFrameA = false);
-	
-	btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, const btTransform& rbAFrame, const btTransform& rbBFrame, bool useReferenceFrameA = false);
-
-	btHingeConstraint(btRigidBody& rbA,const btTransform& rbAFrame, bool useReferenceFrameA = false);
-
-
-	virtual void	buildJacobian();
-
-	virtual void getInfo1 (btConstraintInfo1* info);
-
-	void getInfo1NonVirtual(btConstraintInfo1* info);
-
-	virtual void getInfo2 (btConstraintInfo2* info);
-
-	void	getInfo2NonVirtual(btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btVector3& angVelA,const btVector3& angVelB);
-
-	void	getInfo2Internal(btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btVector3& angVelA,const btVector3& angVelB);
-	void	getInfo2InternalUsingFrameOffset(btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btVector3& angVelA,const btVector3& angVelB);
-		
-
-	void	updateRHS(btScalar	timeStep);
-
-	const btRigidBody& getRigidBodyA() const
-	{
-		return m_rbA;
-	}
-	const btRigidBody& getRigidBodyB() const
-	{
-		return m_rbB;
-	}
-
-	btRigidBody& getRigidBodyA()	
-	{		
-		return m_rbA;	
-	}	
-
-	btRigidBody& getRigidBodyB()	
-	{		
-		return m_rbB;	
-	}
-
-	btTransform& getFrameOffsetA()
-	{
-	return m_rbAFrame;
-	}
-
-	btTransform& getFrameOffsetB()
-	{
-		return m_rbBFrame;
-	}
-
-	void setFrames(const btTransform& frameA, const btTransform& frameB);
-	
-	void	setAngularOnly(bool angularOnly)
-	{
-		m_angularOnly = angularOnly;
-	}
-
-	void	enableAngularMotor(bool enableMotor,btScalar targetVelocity,btScalar maxMotorImpulse)
-	{
-		m_enableAngularMotor  = enableMotor;
-		m_motorTargetVelocity = targetVelocity;
-		m_maxMotorImpulse = maxMotorImpulse;
-	}
-
-	// extra motor API, including ability to set a target rotation (as opposed to angular velocity)
-	// note: setMotorTarget sets angular velocity under the hood, so you must call it every tick to
-	//       maintain a given angular target.
-	void enableMotor(bool enableMotor) 	{ m_enableAngularMotor = enableMotor; }
-	void setMaxMotorImpulse(btScalar maxMotorImpulse) { m_maxMotorImpulse = maxMotorImpulse; }
-	void setMotorTarget(const btQuaternion& qAinB, btScalar dt); // qAinB is rotation of body A wrt body B.
-	void setMotorTarget(btScalar targetAngle, btScalar dt);
-
-
-	void	setLimit(btScalar low,btScalar high,btScalar _softness = 0.9f, btScalar _biasFactor = 0.3f, btScalar _relaxationFactor = 1.0f)
-	{
-#ifdef	_BT_USE_CENTER_LIMIT_
-		m_limit.set(low, high, _softness, _biasFactor, _relaxationFactor);
-#else
-		m_lowerLimit = btNormalizeAngle(low);
-		m_upperLimit = btNormalizeAngle(high);
-		m_limitSoftness =  _softness;
-		m_biasFactor = _biasFactor;
-		m_relaxationFactor = _relaxationFactor;
-#endif
-	}
-
-	void	setAxis(btVector3& axisInA)
-	{
-		btVector3 rbAxisA1, rbAxisA2;
-		btPlaneSpace1(axisInA, rbAxisA1, rbAxisA2);
-		btVector3 pivotInA = m_rbAFrame.getOrigin();
-//		m_rbAFrame.getOrigin() = pivotInA;
-		m_rbAFrame.getBasis().setValue( rbAxisA1.getX(),rbAxisA2.getX(),axisInA.getX(),
-										rbAxisA1.getY(),rbAxisA2.getY(),axisInA.getY(),
-										rbAxisA1.getZ(),rbAxisA2.getZ(),axisInA.getZ() );
-
-		btVector3 axisInB = m_rbA.getCenterOfMassTransform().getBasis() * axisInA;
-
-		btQuaternion rotationArc = shortestArcQuat(axisInA,axisInB);
-		btVector3 rbAxisB1 =  quatRotate(rotationArc,rbAxisA1);
-		btVector3 rbAxisB2 = axisInB.cross(rbAxisB1);
-
-		m_rbBFrame.getOrigin() = m_rbB.getCenterOfMassTransform().inverse()(m_rbA.getCenterOfMassTransform()(pivotInA));
-
-		m_rbBFrame.getBasis().setValue( rbAxisB1.getX(),rbAxisB2.getX(),axisInB.getX(),
-										rbAxisB1.getY(),rbAxisB2.getY(),axisInB.getY(),
-										rbAxisB1.getZ(),rbAxisB2.getZ(),axisInB.getZ() );
-		m_rbBFrame.getBasis() = m_rbB.getCenterOfMassTransform().getBasis().inverse() * m_rbBFrame.getBasis();
-
-	}
-
-	btScalar	getLowerLimit() const
-	{
-#ifdef	_BT_USE_CENTER_LIMIT_
-	return m_limit.getLow();
-#else
-	return m_lowerLimit;
-#endif
-	}
-
-	btScalar	getUpperLimit() const
-	{
-#ifdef	_BT_USE_CENTER_LIMIT_
-	return m_limit.getHigh();
-#else		
-	return m_upperLimit;
-#endif
-	}
-
-
-	btScalar getHingeAngle();
-
-	btScalar getHingeAngle(const btTransform& transA,const btTransform& transB);
-
-	void testLimit(const btTransform& transA,const btTransform& transB);
-
-
-	const btTransform& getAFrame() const { return m_rbAFrame; };	
-	const btTransform& getBFrame() const { return m_rbBFrame; };
-
-	btTransform& getAFrame() { return m_rbAFrame; };	
-	btTransform& getBFrame() { return m_rbBFrame; };
-
-	inline int getSolveLimit()
-	{
-#ifdef	_BT_USE_CENTER_LIMIT_
-	return m_limit.isLimit();
-#else
-	return m_solveLimit;
-#endif
-	}
-
-	inline btScalar getLimitSign()
-	{
-#ifdef	_BT_USE_CENTER_LIMIT_
-	return m_limit.getSign();
-#else
-		return m_limitSign;
-#endif
-	}
-
-	inline bool getAngularOnly() 
-	{ 
-		return m_angularOnly; 
-	}
-	inline bool getEnableAngularMotor() 
-	{ 
-		return m_enableAngularMotor; 
-	}
-	inline btScalar getMotorTargetVelosity() 
-	{ 
-		return m_motorTargetVelocity; 
-	}
-	inline btScalar getMaxMotorImpulse() 
-	{ 
-		return m_maxMotorImpulse; 
-	}
-	// access for UseFrameOffset
-	bool getUseFrameOffset() { return m_useOffsetForConstraintFrame; }
-	void setUseFrameOffset(bool frameOffsetOnOff) { m_useOffsetForConstraintFrame = frameOffsetOnOff; }
-
-
-	///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
-	///If no axis is provided, it uses the default axis for this constraint.
-	virtual	void	setParam(int num, btScalar value, int axis = -1);
-	///return the local value of parameter
-	virtual	btScalar getParam(int num, int axis = -1) const;
-
-	virtual	int	calculateSerializeBufferSize() const;
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
-
-
-};
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btHingeConstraintDoubleData
-{
-	btTypedConstraintData	m_typeConstraintData;
-	btTransformDoubleData m_rbAFrame; // constraint axii. Assumes z is hinge axis.
-	btTransformDoubleData m_rbBFrame;
-	int			m_useReferenceFrameA;
-	int			m_angularOnly;
-	int			m_enableAngularMotor;
-	float	m_motorTargetVelocity;
-	float	m_maxMotorImpulse;
-
-	float	m_lowerLimit;
-	float	m_upperLimit;
-	float	m_limitSoftness;
-	float	m_biasFactor;
-	float	m_relaxationFactor;
-
-};
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btHingeConstraintFloatData
-{
-	btTypedConstraintData	m_typeConstraintData;
-	btTransformFloatData m_rbAFrame; // constraint axii. Assumes z is hinge axis.
-	btTransformFloatData m_rbBFrame;
-	int			m_useReferenceFrameA;
-	int			m_angularOnly;
-	
-	int			m_enableAngularMotor;
-	float	m_motorTargetVelocity;
-	float	m_maxMotorImpulse;
-
-	float	m_lowerLimit;
-	float	m_upperLimit;
-	float	m_limitSoftness;
-	float	m_biasFactor;
-	float	m_relaxationFactor;
-
-};
-
-
-
-SIMD_FORCE_INLINE	int	btHingeConstraint::calculateSerializeBufferSize() const
-{
-	return sizeof(btHingeConstraintData);
-}
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-SIMD_FORCE_INLINE	const char*	btHingeConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-	btHingeConstraintData* hingeData = (btHingeConstraintData*)dataBuffer;
-	btTypedConstraint::serialize(&hingeData->m_typeConstraintData,serializer);
-
-	m_rbAFrame.serialize(hingeData->m_rbAFrame);
-	m_rbBFrame.serialize(hingeData->m_rbBFrame);
-
-	hingeData->m_angularOnly = m_angularOnly;
-	hingeData->m_enableAngularMotor = m_enableAngularMotor;
-	hingeData->m_maxMotorImpulse = float(m_maxMotorImpulse);
-	hingeData->m_motorTargetVelocity = float(m_motorTargetVelocity);
-	hingeData->m_useReferenceFrameA = m_useReferenceFrameA;
-#ifdef	_BT_USE_CENTER_LIMIT_
-	hingeData->m_lowerLimit = float(m_limit.getLow());
-	hingeData->m_upperLimit = float(m_limit.getHigh());
-	hingeData->m_limitSoftness = float(m_limit.getSoftness());
-	hingeData->m_biasFactor = float(m_limit.getBiasFactor());
-	hingeData->m_relaxationFactor = float(m_limit.getRelaxationFactor());
-#else
-	hingeData->m_lowerLimit = float(m_lowerLimit);
-	hingeData->m_upperLimit = float(m_upperLimit);
-	hingeData->m_limitSoftness = float(m_limitSoftness);
-	hingeData->m_biasFactor = float(m_biasFactor);
-	hingeData->m_relaxationFactor = float(m_relaxationFactor);
-#endif
-
-	return btHingeConstraintDataName;
-}
-
-#endif //BT_HINGECONSTRAINT_H
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btJacobianEntry.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btJacobianEntry.h
deleted file mode 100644
index f1994a2..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btJacobianEntry.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_JACOBIAN_ENTRY_H
-#define BT_JACOBIAN_ENTRY_H
-
-#include "LinearMath/btVector3.h"
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-
-
-//notes:
-// Another memory optimization would be to store m_1MinvJt in the remaining 3 w components
-// which makes the btJacobianEntry memory layout 16 bytes
-// if you only are interested in angular part, just feed massInvA and massInvB zero
-
-/// Jacobian entry is an abstraction that allows to describe constraints
-/// it can be used in combination with a constraint solver
-/// Can be used to relate the effect of an impulse to the constraint error
-ATTRIBUTE_ALIGNED16(class) btJacobianEntry
-{
-public:
-	btJacobianEntry() {};
-	//constraint between two different rigidbodies
-	btJacobianEntry(
-		const btMatrix3x3& world2A,
-		const btMatrix3x3& world2B,
-		const btVector3& rel_pos1,const btVector3& rel_pos2,
-		const btVector3& jointAxis,
-		const btVector3& inertiaInvA, 
-		const btScalar massInvA,
-		const btVector3& inertiaInvB,
-		const btScalar massInvB)
-		:m_linearJointAxis(jointAxis)
-	{
-		m_aJ = world2A*(rel_pos1.cross(m_linearJointAxis));
-		m_bJ = world2B*(rel_pos2.cross(-m_linearJointAxis));
-		m_0MinvJt	= inertiaInvA * m_aJ;
-		m_1MinvJt = inertiaInvB * m_bJ;
-		m_Adiag = massInvA + m_0MinvJt.dot(m_aJ) + massInvB + m_1MinvJt.dot(m_bJ);
-
-		btAssert(m_Adiag > btScalar(0.0));
-	}
-
-	//angular constraint between two different rigidbodies
-	btJacobianEntry(const btVector3& jointAxis,
-		const btMatrix3x3& world2A,
-		const btMatrix3x3& world2B,
-		const btVector3& inertiaInvA,
-		const btVector3& inertiaInvB)
-		:m_linearJointAxis(btVector3(btScalar(0.),btScalar(0.),btScalar(0.)))
-	{
-		m_aJ= world2A*jointAxis;
-		m_bJ = world2B*-jointAxis;
-		m_0MinvJt	= inertiaInvA * m_aJ;
-		m_1MinvJt = inertiaInvB * m_bJ;
-		m_Adiag =  m_0MinvJt.dot(m_aJ) + m_1MinvJt.dot(m_bJ);
-
-		btAssert(m_Adiag > btScalar(0.0));
-	}
-
-	//angular constraint between two different rigidbodies
-	btJacobianEntry(const btVector3& axisInA,
-		const btVector3& axisInB,
-		const btVector3& inertiaInvA,
-		const btVector3& inertiaInvB)
-		: m_linearJointAxis(btVector3(btScalar(0.),btScalar(0.),btScalar(0.)))
-		, m_aJ(axisInA)
-		, m_bJ(-axisInB)
-	{
-		m_0MinvJt	= inertiaInvA * m_aJ;
-		m_1MinvJt = inertiaInvB * m_bJ;
-		m_Adiag =  m_0MinvJt.dot(m_aJ) + m_1MinvJt.dot(m_bJ);
-
-		btAssert(m_Adiag > btScalar(0.0));
-	}
-
-	//constraint on one rigidbody
-	btJacobianEntry(
-		const btMatrix3x3& world2A,
-		const btVector3& rel_pos1,const btVector3& rel_pos2,
-		const btVector3& jointAxis,
-		const btVector3& inertiaInvA, 
-		const btScalar massInvA)
-		:m_linearJointAxis(jointAxis)
-	{
-		m_aJ= world2A*(rel_pos1.cross(jointAxis));
-		m_bJ = world2A*(rel_pos2.cross(-jointAxis));
-		m_0MinvJt	= inertiaInvA * m_aJ;
-		m_1MinvJt = btVector3(btScalar(0.),btScalar(0.),btScalar(0.));
-		m_Adiag = massInvA + m_0MinvJt.dot(m_aJ);
-
-		btAssert(m_Adiag > btScalar(0.0));
-	}
-
-	btScalar	getDiagonal() const { return m_Adiag; }
-
-	// for two constraints on the same rigidbody (for example vehicle friction)
-	btScalar	getNonDiagonal(const btJacobianEntry& jacB, const btScalar massInvA) const
-	{
-		const btJacobianEntry& jacA = *this;
-		btScalar lin = massInvA * jacA.m_linearJointAxis.dot(jacB.m_linearJointAxis);
-		btScalar ang = jacA.m_0MinvJt.dot(jacB.m_aJ);
-		return lin + ang;
-	}
-
-	
-
-	// for two constraints on sharing two same rigidbodies (for example two contact points between two rigidbodies)
-	btScalar	getNonDiagonal(const btJacobianEntry& jacB,const btScalar massInvA,const btScalar massInvB) const
-	{
-		const btJacobianEntry& jacA = *this;
-		btVector3 lin = jacA.m_linearJointAxis * jacB.m_linearJointAxis;
-		btVector3 ang0 = jacA.m_0MinvJt * jacB.m_aJ;
-		btVector3 ang1 = jacA.m_1MinvJt * jacB.m_bJ;
-		btVector3 lin0 = massInvA * lin ;
-		btVector3 lin1 = massInvB * lin;
-		btVector3 sum = ang0+ang1+lin0+lin1;
-		return sum[0]+sum[1]+sum[2];
-	}
-
-	btScalar getRelativeVelocity(const btVector3& linvelA,const btVector3& angvelA,const btVector3& linvelB,const btVector3& angvelB)
-	{
-		btVector3 linrel = linvelA - linvelB;
-		btVector3 angvela  = angvelA * m_aJ;
-		btVector3 angvelb  = angvelB * m_bJ;
-		linrel *= m_linearJointAxis;
-		angvela += angvelb;
-		angvela += linrel;
-		btScalar rel_vel2 = angvela[0]+angvela[1]+angvela[2];
-		return rel_vel2 + SIMD_EPSILON;
-	}
-//private:
-
-	btVector3	m_linearJointAxis;
-	btVector3	m_aJ;
-	btVector3	m_bJ;
-	btVector3	m_0MinvJt;
-	btVector3	m_1MinvJt;
-	//Optimization: can be stored in the w/last component of one of the vectors
-	btScalar	m_Adiag;
-
-};
-
-#endif //BT_JACOBIAN_ENTRY_H
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp
deleted file mode 100644
index 7e0d93b..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "btPoint2PointConstraint.h"
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-#include <new>
-
-
-
-
-
-btPoint2PointConstraint::btPoint2PointConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB)
-:btTypedConstraint(POINT2POINT_CONSTRAINT_TYPE,rbA,rbB),m_pivotInA(pivotInA),m_pivotInB(pivotInB),
-m_flags(0),
-m_useSolveConstraintObsolete(false)
-{
-
-}
-
-
-btPoint2PointConstraint::btPoint2PointConstraint(btRigidBody& rbA,const btVector3& pivotInA)
-:btTypedConstraint(POINT2POINT_CONSTRAINT_TYPE,rbA),m_pivotInA(pivotInA),m_pivotInB(rbA.getCenterOfMassTransform()(pivotInA)),
-m_flags(0),
-m_useSolveConstraintObsolete(false)
-{
-	
-}
-
-void	btPoint2PointConstraint::buildJacobian()
-{
-
-	///we need it for both methods
-	{
-		m_appliedImpulse = btScalar(0.);
-
-		btVector3	normal(0,0,0);
-
-		for (int i=0;i<3;i++)
-		{
-			normal[i] = 1;
-			new (&m_jac[i]) btJacobianEntry(
-			m_rbA.getCenterOfMassTransform().getBasis().transpose(),
-			m_rbB.getCenterOfMassTransform().getBasis().transpose(),
-			m_rbA.getCenterOfMassTransform()*m_pivotInA - m_rbA.getCenterOfMassPosition(),
-			m_rbB.getCenterOfMassTransform()*m_pivotInB - m_rbB.getCenterOfMassPosition(),
-			normal,
-			m_rbA.getInvInertiaDiagLocal(),
-			m_rbA.getInvMass(),
-			m_rbB.getInvInertiaDiagLocal(),
-			m_rbB.getInvMass());
-		normal[i] = 0;
-		}
-	}
-
-
-}
-
-void btPoint2PointConstraint::getInfo1 (btConstraintInfo1* info)
-{
-	getInfo1NonVirtual(info);
-}
-
-void btPoint2PointConstraint::getInfo1NonVirtual (btConstraintInfo1* info)
-{
-	if (m_useSolveConstraintObsolete)
-	{
-		info->m_numConstraintRows = 0;
-		info->nub = 0;
-	} else
-	{
-		info->m_numConstraintRows = 3;
-		info->nub = 3;
-	}
-}
-
-
-
-
-void btPoint2PointConstraint::getInfo2 (btConstraintInfo2* info)
-{
-	getInfo2NonVirtual(info, m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
-}
-
-void btPoint2PointConstraint::getInfo2NonVirtual (btConstraintInfo2* info, const btTransform& body0_trans, const btTransform& body1_trans)
-{
-	btAssert(!m_useSolveConstraintObsolete);
-
-	 //retrieve matrices
-
-	// anchor points in global coordinates with respect to body PORs.
-   
-    // set jacobian
-    info->m_J1linearAxis[0] = 1;
-	info->m_J1linearAxis[info->rowskip+1] = 1;
-	info->m_J1linearAxis[2*info->rowskip+2] = 1;
-
-	btVector3 a1 = body0_trans.getBasis()*getPivotInA();
-	{
-		btVector3* angular0 = (btVector3*)(info->m_J1angularAxis);
-		btVector3* angular1 = (btVector3*)(info->m_J1angularAxis+info->rowskip);
-		btVector3* angular2 = (btVector3*)(info->m_J1angularAxis+2*info->rowskip);
-		btVector3 a1neg = -a1;
-		a1neg.getSkewSymmetricMatrix(angular0,angular1,angular2);
-	}
-    
-	/*info->m_J2linearAxis[0] = -1;
-    info->m_J2linearAxis[s+1] = -1;
-    info->m_J2linearAxis[2*s+2] = -1;
-	*/
-	
-	btVector3 a2 = body1_trans.getBasis()*getPivotInB();
-   
-	{
-		btVector3 a2n = -a2;
-		btVector3* angular0 = (btVector3*)(info->m_J2angularAxis);
-		btVector3* angular1 = (btVector3*)(info->m_J2angularAxis+info->rowskip);
-		btVector3* angular2 = (btVector3*)(info->m_J2angularAxis+2*info->rowskip);
-		a2.getSkewSymmetricMatrix(angular0,angular1,angular2);
-	}
-    
-
-
-    // set right hand side
-	btScalar currERP = (m_flags & BT_P2P_FLAGS_ERP) ? m_erp : info->erp;
-    btScalar k = info->fps * currERP;
-    int j;
-	for (j=0; j<3; j++)
-    {
-        info->m_constraintError[j*info->rowskip] = k * (a2[j] + body1_trans.getOrigin()[j] - a1[j] - body0_trans.getOrigin()[j]);
-		//printf("info->m_constraintError[%d]=%f\n",j,info->m_constraintError[j]);
-    }
-	if(m_flags & BT_P2P_FLAGS_CFM)
-	{
-		for (j=0; j<3; j++)
-		{
-			info->cfm[j*info->rowskip] = m_cfm;
-		}
-	}
-
-	btScalar impulseClamp = m_setting.m_impulseClamp;//
-	for (j=0; j<3; j++)
-    {
-		if (m_setting.m_impulseClamp > 0)
-		{
-			info->m_lowerLimit[j*info->rowskip] = -impulseClamp;
-			info->m_upperLimit[j*info->rowskip] = impulseClamp;
-		}
-	}
-	info->m_damping = m_setting.m_damping;
-	
-}
-
-
-
-void	btPoint2PointConstraint::updateRHS(btScalar	timeStep)
-{
-	(void)timeStep;
-
-}
-
-///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
-///If no axis is provided, it uses the default axis for this constraint.
-void btPoint2PointConstraint::setParam(int num, btScalar value, int axis)
-{
-	if(axis != -1)
-	{
-		btAssertConstrParams(0);
-	}
-	else
-	{
-		switch(num)
-		{
-			case BT_CONSTRAINT_ERP :
-			case BT_CONSTRAINT_STOP_ERP :
-				m_erp = value; 
-				m_flags |= BT_P2P_FLAGS_ERP;
-				break;
-			case BT_CONSTRAINT_CFM :
-			case BT_CONSTRAINT_STOP_CFM :
-				m_cfm = value; 
-				m_flags |= BT_P2P_FLAGS_CFM;
-				break;
-			default: 
-				btAssertConstrParams(0);
-		}
-	}
-}
-
-///return the local value of parameter
-btScalar btPoint2PointConstraint::getParam(int num, int axis) const 
-{
-	btScalar retVal(SIMD_INFINITY);
-	if(axis != -1)
-	{
-		btAssertConstrParams(0);
-	}
-	else
-	{
-		switch(num)
-		{
-			case BT_CONSTRAINT_ERP :
-			case BT_CONSTRAINT_STOP_ERP :
-				btAssertConstrParams(m_flags & BT_P2P_FLAGS_ERP);
-				retVal = m_erp; 
-				break;
-			case BT_CONSTRAINT_CFM :
-			case BT_CONSTRAINT_STOP_CFM :
-				btAssertConstrParams(m_flags & BT_P2P_FLAGS_CFM);
-				retVal = m_cfm; 
-				break;
-			default: 
-				btAssertConstrParams(0);
-		}
-	}
-	return retVal;
-}
-	
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h
deleted file mode 100644
index b3bda03..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_POINT2POINTCONSTRAINT_H
-#define BT_POINT2POINTCONSTRAINT_H
-
-#include "LinearMath/btVector3.h"
-#include "btJacobianEntry.h"
-#include "btTypedConstraint.h"
-
-class btRigidBody;
-
-
-#ifdef BT_USE_DOUBLE_PRECISION
-#define btPoint2PointConstraintData	btPoint2PointConstraintDoubleData
-#define btPoint2PointConstraintDataName	"btPoint2PointConstraintDoubleData"
-#else
-#define btPoint2PointConstraintData	btPoint2PointConstraintFloatData
-#define btPoint2PointConstraintDataName	"btPoint2PointConstraintFloatData"
-#endif //BT_USE_DOUBLE_PRECISION
-
-struct	btConstraintSetting
-{
-	btConstraintSetting()	:
-		m_tau(btScalar(0.3)),
-		m_damping(btScalar(1.)),
-		m_impulseClamp(btScalar(0.))
-	{
-	}
-	btScalar		m_tau;
-	btScalar		m_damping;
-	btScalar		m_impulseClamp;
-};
-
-enum btPoint2PointFlags
-{
-	BT_P2P_FLAGS_ERP = 1,
-	BT_P2P_FLAGS_CFM = 2
-};
-
-/// point to point constraint between two rigidbodies each with a pivotpoint that descibes the 'ballsocket' location in local space
-ATTRIBUTE_ALIGNED16(class) btPoint2PointConstraint : public btTypedConstraint
-{
-#ifdef IN_PARALLELL_SOLVER
-public:
-#endif
-	btJacobianEntry	m_jac[3]; //3 orthogonal linear constraints
-	
-	btVector3	m_pivotInA;
-	btVector3	m_pivotInB;
-	
-	int			m_flags;
-	btScalar	m_erp;
-	btScalar	m_cfm;
-	
-public:
-
-	///for backwards compatibility during the transition to 'getInfo/getInfo2'
-	bool		m_useSolveConstraintObsolete;
-
-	btConstraintSetting	m_setting;
-
-	btPoint2PointConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB);
-
-	btPoint2PointConstraint(btRigidBody& rbA,const btVector3& pivotInA);
-
-
-	virtual void	buildJacobian();
-
-	virtual void getInfo1 (btConstraintInfo1* info);
-
-	void getInfo1NonVirtual (btConstraintInfo1* info);
-
-	virtual void getInfo2 (btConstraintInfo2* info);
-
-	void getInfo2NonVirtual (btConstraintInfo2* info, const btTransform& body0_trans, const btTransform& body1_trans);
-
-	void	updateRHS(btScalar	timeStep);
-
-	void	setPivotA(const btVector3& pivotA)
-	{
-		m_pivotInA = pivotA;
-	}
-
-	void	setPivotB(const btVector3& pivotB)
-	{
-		m_pivotInB = pivotB;
-	}
-
-	const btVector3& getPivotInA() const
-	{
-		return m_pivotInA;
-	}
-
-	const btVector3& getPivotInB() const
-	{
-		return m_pivotInB;
-	}
-
-	///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
-	///If no axis is provided, it uses the default axis for this constraint.
-	virtual	void	setParam(int num, btScalar value, int axis = -1);
-	///return the local value of parameter
-	virtual	btScalar getParam(int num, int axis = -1) const;
-
-	virtual	int	calculateSerializeBufferSize() const;
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
-
-
-};
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btPoint2PointConstraintFloatData
-{
-	btTypedConstraintData	m_typeConstraintData;
-	btVector3FloatData	m_pivotInA;
-	btVector3FloatData	m_pivotInB;
-};
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btPoint2PointConstraintDoubleData
-{
-	btTypedConstraintData	m_typeConstraintData;
-	btVector3DoubleData	m_pivotInA;
-	btVector3DoubleData	m_pivotInB;
-};
-
-
-SIMD_FORCE_INLINE	int	btPoint2PointConstraint::calculateSerializeBufferSize() const
-{
-	return sizeof(btPoint2PointConstraintData);
-
-}
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-SIMD_FORCE_INLINE	const char*	btPoint2PointConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-	btPoint2PointConstraintData* p2pData = (btPoint2PointConstraintData*)dataBuffer;
-
-	btTypedConstraint::serialize(&p2pData->m_typeConstraintData,serializer);
-	m_pivotInA.serialize(p2pData->m_pivotInA);
-	m_pivotInB.serialize(p2pData->m_pivotInB);
-
-	return btPoint2PointConstraintDataName;
-}
-
-#endif //BT_POINT2POINTCONSTRAINT_H
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
deleted file mode 100644
index c05e22f..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
+++ /dev/null
@@ -1,1239 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-//#define COMPUTE_IMPULSE_DENOM 1
-//It is not necessary (redundant) to refresh contact manifolds, this refresh has been moved to the collision algorithms.
-
-#include "btSequentialImpulseConstraintSolver.h"
-#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-#include "btContactConstraint.h"
-#include "btSolve2LinearConstraint.h"
-#include "btContactSolverInfo.h"
-#include "LinearMath/btIDebugDraw.h"
-#include "btJacobianEntry.h"
-#include "LinearMath/btMinMax.h"
-#include "BulletDynamics/ConstraintSolver/btTypedConstraint.h"
-#include <new>
-#include "LinearMath/btStackAlloc.h"
-#include "LinearMath/btQuickprof.h"
-#include "btSolverBody.h"
-#include "btSolverConstraint.h"
-#include "LinearMath/btAlignedObjectArray.h"
-#include <string.h> //for memset
-
-int		gNumSplitImpulseRecoveries = 0;
-
-btSequentialImpulseConstraintSolver::btSequentialImpulseConstraintSolver()
-:m_btSeed2(0)
-{
-
-}
-
-btSequentialImpulseConstraintSolver::~btSequentialImpulseConstraintSolver()
-{
-}
-
-#ifdef USE_SIMD
-#include <emmintrin.h>
-#define btVecSplat(x, e) _mm_shuffle_ps(x, x, _MM_SHUFFLE(e,e,e,e))
-static inline __m128 btSimdDot3( __m128 vec0, __m128 vec1 )
-{
-	__m128 result = _mm_mul_ps( vec0, vec1);
-	return _mm_add_ps( btVecSplat( result, 0 ), _mm_add_ps( btVecSplat( result, 1 ), btVecSplat( result, 2 ) ) );
-}
-#endif//USE_SIMD
-
-// Project Gauss Seidel or the equivalent Sequential Impulse
-void btSequentialImpulseConstraintSolver::resolveSingleConstraintRowGenericSIMD(btRigidBody& body1,btRigidBody& body2,const btSolverConstraint& c)
-{
-#ifdef USE_SIMD
-	__m128 cpAppliedImp = _mm_set1_ps(c.m_appliedImpulse);
-	__m128	lowerLimit1 = _mm_set1_ps(c.m_lowerLimit);
-	__m128	upperLimit1 = _mm_set1_ps(c.m_upperLimit);
-	__m128 deltaImpulse = _mm_sub_ps(_mm_set1_ps(c.m_rhs), _mm_mul_ps(_mm_set1_ps(c.m_appliedImpulse),_mm_set1_ps(c.m_cfm)));
-	__m128 deltaVel1Dotn	=	_mm_add_ps(btSimdDot3(c.m_contactNormal.mVec128,body1.internalGetDeltaLinearVelocity().mVec128), btSimdDot3(c.m_relpos1CrossNormal.mVec128,body1.internalGetDeltaAngularVelocity().mVec128));
-	__m128 deltaVel2Dotn	=	_mm_sub_ps(btSimdDot3(c.m_relpos2CrossNormal.mVec128,body2.internalGetDeltaAngularVelocity().mVec128),btSimdDot3((c.m_contactNormal).mVec128,body2.internalGetDeltaLinearVelocity().mVec128));
-	deltaImpulse	=	_mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel1Dotn,_mm_set1_ps(c.m_jacDiagABInv)));
-	deltaImpulse	=	_mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel2Dotn,_mm_set1_ps(c.m_jacDiagABInv)));
-	btSimdScalar sum = _mm_add_ps(cpAppliedImp,deltaImpulse);
-	btSimdScalar resultLowerLess,resultUpperLess;
-	resultLowerLess = _mm_cmplt_ps(sum,lowerLimit1);
-	resultUpperLess = _mm_cmplt_ps(sum,upperLimit1);
-	__m128 lowMinApplied = _mm_sub_ps(lowerLimit1,cpAppliedImp);
-	deltaImpulse = _mm_or_ps( _mm_and_ps(resultLowerLess, lowMinApplied), _mm_andnot_ps(resultLowerLess, deltaImpulse) );
-	c.m_appliedImpulse = _mm_or_ps( _mm_and_ps(resultLowerLess, lowerLimit1), _mm_andnot_ps(resultLowerLess, sum) );
-	__m128 upperMinApplied = _mm_sub_ps(upperLimit1,cpAppliedImp);
-	deltaImpulse = _mm_or_ps( _mm_and_ps(resultUpperLess, deltaImpulse), _mm_andnot_ps(resultUpperLess, upperMinApplied) );
-	c.m_appliedImpulse = _mm_or_ps( _mm_and_ps(resultUpperLess, c.m_appliedImpulse), _mm_andnot_ps(resultUpperLess, upperLimit1) );
-	__m128	linearComponentA = _mm_mul_ps(c.m_contactNormal.mVec128,body1.internalGetInvMass().mVec128);
-	__m128	linearComponentB = _mm_mul_ps((c.m_contactNormal).mVec128,body2.internalGetInvMass().mVec128);
-	__m128 impulseMagnitude = deltaImpulse;
-	body1.internalGetDeltaLinearVelocity().mVec128 = _mm_add_ps(body1.internalGetDeltaLinearVelocity().mVec128,_mm_mul_ps(linearComponentA,impulseMagnitude));
-	body1.internalGetDeltaAngularVelocity().mVec128 = _mm_add_ps(body1.internalGetDeltaAngularVelocity().mVec128 ,_mm_mul_ps(c.m_angularComponentA.mVec128,impulseMagnitude));
-	body2.internalGetDeltaLinearVelocity().mVec128 = _mm_sub_ps(body2.internalGetDeltaLinearVelocity().mVec128,_mm_mul_ps(linearComponentB,impulseMagnitude));
-	body2.internalGetDeltaAngularVelocity().mVec128 = _mm_add_ps(body2.internalGetDeltaAngularVelocity().mVec128 ,_mm_mul_ps(c.m_angularComponentB.mVec128,impulseMagnitude));
-#else
-	resolveSingleConstraintRowGeneric(body1,body2,c);
-#endif
-}
-
-// Project Gauss Seidel or the equivalent Sequential Impulse
- void btSequentialImpulseConstraintSolver::resolveSingleConstraintRowGeneric(btRigidBody& body1,btRigidBody& body2,const btSolverConstraint& c)
-{
-	btScalar deltaImpulse = c.m_rhs-btScalar(c.m_appliedImpulse)*c.m_cfm;
-	const btScalar deltaVel1Dotn	=	c.m_contactNormal.dot(body1.internalGetDeltaLinearVelocity()) 	+ c.m_relpos1CrossNormal.dot(body1.internalGetDeltaAngularVelocity());
-	const btScalar deltaVel2Dotn	=	-c.m_contactNormal.dot(body2.internalGetDeltaLinearVelocity()) + c.m_relpos2CrossNormal.dot(body2.internalGetDeltaAngularVelocity());
-
-//	const btScalar delta_rel_vel	=	deltaVel1Dotn-deltaVel2Dotn;
-	deltaImpulse	-=	deltaVel1Dotn*c.m_jacDiagABInv;
-	deltaImpulse	-=	deltaVel2Dotn*c.m_jacDiagABInv;
-
-	const btScalar sum = btScalar(c.m_appliedImpulse) + deltaImpulse;
-	if (sum < c.m_lowerLimit)
-	{
-		deltaImpulse = c.m_lowerLimit-c.m_appliedImpulse;
-		c.m_appliedImpulse = c.m_lowerLimit;
-	}
-	else if (sum > c.m_upperLimit) 
-	{
-		deltaImpulse = c.m_upperLimit-c.m_appliedImpulse;
-		c.m_appliedImpulse = c.m_upperLimit;
-	}
-	else
-	{
-		c.m_appliedImpulse = sum;
-	}
-		body1.internalApplyImpulse(c.m_contactNormal*body1.internalGetInvMass(),c.m_angularComponentA,deltaImpulse);
-		body2.internalApplyImpulse(-c.m_contactNormal*body2.internalGetInvMass(),c.m_angularComponentB,deltaImpulse);
-}
-
- void btSequentialImpulseConstraintSolver::resolveSingleConstraintRowLowerLimitSIMD(btRigidBody& body1,btRigidBody& body2,const btSolverConstraint& c)
-{
-#ifdef USE_SIMD
-	__m128 cpAppliedImp = _mm_set1_ps(c.m_appliedImpulse);
-	__m128	lowerLimit1 = _mm_set1_ps(c.m_lowerLimit);
-	__m128	upperLimit1 = _mm_set1_ps(c.m_upperLimit);
-	__m128 deltaImpulse = _mm_sub_ps(_mm_set1_ps(c.m_rhs), _mm_mul_ps(_mm_set1_ps(c.m_appliedImpulse),_mm_set1_ps(c.m_cfm)));
-	__m128 deltaVel1Dotn	=	_mm_add_ps(btSimdDot3(c.m_contactNormal.mVec128,body1.internalGetDeltaLinearVelocity().mVec128), btSimdDot3(c.m_relpos1CrossNormal.mVec128,body1.internalGetDeltaAngularVelocity().mVec128));
-	__m128 deltaVel2Dotn	=	_mm_sub_ps(btSimdDot3(c.m_relpos2CrossNormal.mVec128,body2.internalGetDeltaAngularVelocity().mVec128),btSimdDot3((c.m_contactNormal).mVec128,body2.internalGetDeltaLinearVelocity().mVec128));
-	deltaImpulse	=	_mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel1Dotn,_mm_set1_ps(c.m_jacDiagABInv)));
-	deltaImpulse	=	_mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel2Dotn,_mm_set1_ps(c.m_jacDiagABInv)));
-	btSimdScalar sum = _mm_add_ps(cpAppliedImp,deltaImpulse);
-	btSimdScalar resultLowerLess,resultUpperLess;
-	resultLowerLess = _mm_cmplt_ps(sum,lowerLimit1);
-	resultUpperLess = _mm_cmplt_ps(sum,upperLimit1);
-	__m128 lowMinApplied = _mm_sub_ps(lowerLimit1,cpAppliedImp);
-	deltaImpulse = _mm_or_ps( _mm_and_ps(resultLowerLess, lowMinApplied), _mm_andnot_ps(resultLowerLess, deltaImpulse) );
-	c.m_appliedImpulse = _mm_or_ps( _mm_and_ps(resultLowerLess, lowerLimit1), _mm_andnot_ps(resultLowerLess, sum) );
-	__m128	linearComponentA = _mm_mul_ps(c.m_contactNormal.mVec128,body1.internalGetInvMass().mVec128);
-	__m128	linearComponentB = _mm_mul_ps((c.m_contactNormal).mVec128,body2.internalGetInvMass().mVec128);
-	__m128 impulseMagnitude = deltaImpulse;
-	body1.internalGetDeltaLinearVelocity().mVec128 = _mm_add_ps(body1.internalGetDeltaLinearVelocity().mVec128,_mm_mul_ps(linearComponentA,impulseMagnitude));
-	body1.internalGetDeltaAngularVelocity().mVec128 = _mm_add_ps(body1.internalGetDeltaAngularVelocity().mVec128 ,_mm_mul_ps(c.m_angularComponentA.mVec128,impulseMagnitude));
-	body2.internalGetDeltaLinearVelocity().mVec128 = _mm_sub_ps(body2.internalGetDeltaLinearVelocity().mVec128,_mm_mul_ps(linearComponentB,impulseMagnitude));
-	body2.internalGetDeltaAngularVelocity().mVec128 = _mm_add_ps(body2.internalGetDeltaAngularVelocity().mVec128 ,_mm_mul_ps(c.m_angularComponentB.mVec128,impulseMagnitude));
-#else
-	resolveSingleConstraintRowLowerLimit(body1,body2,c);
-#endif
-}
-
-// Project Gauss Seidel or the equivalent Sequential Impulse
- void btSequentialImpulseConstraintSolver::resolveSingleConstraintRowLowerLimit(btRigidBody& body1,btRigidBody& body2,const btSolverConstraint& c)
-{
-	btScalar deltaImpulse = c.m_rhs-btScalar(c.m_appliedImpulse)*c.m_cfm;
-	const btScalar deltaVel1Dotn	=	c.m_contactNormal.dot(body1.internalGetDeltaLinearVelocity()) 	+ c.m_relpos1CrossNormal.dot(body1.internalGetDeltaAngularVelocity());
-	const btScalar deltaVel2Dotn	=	-c.m_contactNormal.dot(body2.internalGetDeltaLinearVelocity()) + c.m_relpos2CrossNormal.dot(body2.internalGetDeltaAngularVelocity());
-
-	deltaImpulse	-=	deltaVel1Dotn*c.m_jacDiagABInv;
-	deltaImpulse	-=	deltaVel2Dotn*c.m_jacDiagABInv;
-	const btScalar sum = btScalar(c.m_appliedImpulse) + deltaImpulse;
-	if (sum < c.m_lowerLimit)
-	{
-		deltaImpulse = c.m_lowerLimit-c.m_appliedImpulse;
-		c.m_appliedImpulse = c.m_lowerLimit;
-	}
-	else
-	{
-		c.m_appliedImpulse = sum;
-	}
-	body1.internalApplyImpulse(c.m_contactNormal*body1.internalGetInvMass(),c.m_angularComponentA,deltaImpulse);
-	body2.internalApplyImpulse(-c.m_contactNormal*body2.internalGetInvMass(),c.m_angularComponentB,deltaImpulse);
-}
-
-
-void	btSequentialImpulseConstraintSolver::resolveSplitPenetrationImpulseCacheFriendly(
-        btRigidBody& body1,
-        btRigidBody& body2,
-        const btSolverConstraint& c)
-{
-		if (c.m_rhsPenetration)
-        {
-			gNumSplitImpulseRecoveries++;
-			btScalar deltaImpulse = c.m_rhsPenetration-btScalar(c.m_appliedPushImpulse)*c.m_cfm;
-			const btScalar deltaVel1Dotn	=	c.m_contactNormal.dot(body1.internalGetPushVelocity()) 	+ c.m_relpos1CrossNormal.dot(body1.internalGetTurnVelocity());
-			const btScalar deltaVel2Dotn	=	-c.m_contactNormal.dot(body2.internalGetPushVelocity()) + c.m_relpos2CrossNormal.dot(body2.internalGetTurnVelocity());
-
-			deltaImpulse	-=	deltaVel1Dotn*c.m_jacDiagABInv;
-			deltaImpulse	-=	deltaVel2Dotn*c.m_jacDiagABInv;
-			const btScalar sum = btScalar(c.m_appliedPushImpulse) + deltaImpulse;
-			if (sum < c.m_lowerLimit)
-			{
-				deltaImpulse = c.m_lowerLimit-c.m_appliedPushImpulse;
-				c.m_appliedPushImpulse = c.m_lowerLimit;
-			}
-			else
-			{
-				c.m_appliedPushImpulse = sum;
-			}
-			body1.internalApplyPushImpulse(c.m_contactNormal*body1.internalGetInvMass(),c.m_angularComponentA,deltaImpulse);
-			body2.internalApplyPushImpulse(-c.m_contactNormal*body2.internalGetInvMass(),c.m_angularComponentB,deltaImpulse);
-        }
-}
-
- void btSequentialImpulseConstraintSolver::resolveSplitPenetrationSIMD(btRigidBody& body1,btRigidBody& body2,const btSolverConstraint& c)
-{
-#ifdef USE_SIMD
-	if (!c.m_rhsPenetration)
-		return;
-
-	gNumSplitImpulseRecoveries++;
-
-	__m128 cpAppliedImp = _mm_set1_ps(c.m_appliedPushImpulse);
-	__m128	lowerLimit1 = _mm_set1_ps(c.m_lowerLimit);
-	__m128	upperLimit1 = _mm_set1_ps(c.m_upperLimit);
-	__m128 deltaImpulse = _mm_sub_ps(_mm_set1_ps(c.m_rhsPenetration), _mm_mul_ps(_mm_set1_ps(c.m_appliedPushImpulse),_mm_set1_ps(c.m_cfm)));
-	__m128 deltaVel1Dotn	=	_mm_add_ps(btSimdDot3(c.m_contactNormal.mVec128,body1.internalGetPushVelocity().mVec128), btSimdDot3(c.m_relpos1CrossNormal.mVec128,body1.internalGetTurnVelocity().mVec128));
-	__m128 deltaVel2Dotn	=	_mm_sub_ps(btSimdDot3(c.m_relpos2CrossNormal.mVec128,body2.internalGetTurnVelocity().mVec128),btSimdDot3((c.m_contactNormal).mVec128,body2.internalGetPushVelocity().mVec128));
-	deltaImpulse	=	_mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel1Dotn,_mm_set1_ps(c.m_jacDiagABInv)));
-	deltaImpulse	=	_mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel2Dotn,_mm_set1_ps(c.m_jacDiagABInv)));
-	btSimdScalar sum = _mm_add_ps(cpAppliedImp,deltaImpulse);
-	btSimdScalar resultLowerLess,resultUpperLess;
-	resultLowerLess = _mm_cmplt_ps(sum,lowerLimit1);
-	resultUpperLess = _mm_cmplt_ps(sum,upperLimit1);
-	__m128 lowMinApplied = _mm_sub_ps(lowerLimit1,cpAppliedImp);
-	deltaImpulse = _mm_or_ps( _mm_and_ps(resultLowerLess, lowMinApplied), _mm_andnot_ps(resultLowerLess, deltaImpulse) );
-	c.m_appliedImpulse = _mm_or_ps( _mm_and_ps(resultLowerLess, lowerLimit1), _mm_andnot_ps(resultLowerLess, sum) );
-	__m128	linearComponentA = _mm_mul_ps(c.m_contactNormal.mVec128,body1.internalGetInvMass().mVec128);
-	__m128	linearComponentB = _mm_mul_ps((c.m_contactNormal).mVec128,body2.internalGetInvMass().mVec128);
-	__m128 impulseMagnitude = deltaImpulse;
-	body1.internalGetPushVelocity().mVec128 = _mm_add_ps(body1.internalGetPushVelocity().mVec128,_mm_mul_ps(linearComponentA,impulseMagnitude));
-	body1.internalGetTurnVelocity().mVec128 = _mm_add_ps(body1.internalGetTurnVelocity().mVec128 ,_mm_mul_ps(c.m_angularComponentA.mVec128,impulseMagnitude));
-	body2.internalGetPushVelocity().mVec128 = _mm_sub_ps(body2.internalGetPushVelocity().mVec128,_mm_mul_ps(linearComponentB,impulseMagnitude));
-	body2.internalGetTurnVelocity().mVec128 = _mm_add_ps(body2.internalGetTurnVelocity().mVec128 ,_mm_mul_ps(c.m_angularComponentB.mVec128,impulseMagnitude));
-#else
-	resolveSplitPenetrationImpulseCacheFriendly(body1,body2,c);
-#endif
-}
-
-
-
-unsigned long btSequentialImpulseConstraintSolver::btRand2()
-{
-	m_btSeed2 = (1664525L*m_btSeed2 + 1013904223L) & 0xffffffff;
-	return m_btSeed2;
-}
-
-
-
-//See ODE: adam's all-int straightforward(?) dRandInt (0..n-1)
-int btSequentialImpulseConstraintSolver::btRandInt2 (int n)
-{
-	// seems good; xor-fold and modulus
-	const unsigned long un = static_cast<unsigned long>(n);
-	unsigned long r = btRand2();
-
-	// note: probably more aggressive than it needs to be -- might be
-	//       able to get away without one or two of the innermost branches.
-	if (un <= 0x00010000UL) {
-		r ^= (r >> 16);
-		if (un <= 0x00000100UL) {
-			r ^= (r >> 8);
-			if (un <= 0x00000010UL) {
-				r ^= (r >> 4);
-				if (un <= 0x00000004UL) {
-					r ^= (r >> 2);
-					if (un <= 0x00000002UL) {
-						r ^= (r >> 1);
-					}
-				}
-			}
-		}
-	}
-
-	return (int) (r % un);
-}
-
-
-#if 0
-void	btSequentialImpulseConstraintSolver::initSolverBody(btSolverBody* solverBody, btCollisionObject* collisionObject)
-{
-	btRigidBody* rb = collisionObject? btRigidBody::upcast(collisionObject) : 0;
-
-	solverBody->internalGetDeltaLinearVelocity().setValue(0.f,0.f,0.f);
-	solverBody->internalGetDeltaAngularVelocity().setValue(0.f,0.f,0.f);
-	solverBody->internalGetPushVelocity().setValue(0.f,0.f,0.f);
-	solverBody->internalGetTurnVelocity().setValue(0.f,0.f,0.f);
-
-	if (rb)
-	{
-		solverBody->internalGetInvMass() = btVector3(rb->getInvMass(),rb->getInvMass(),rb->getInvMass())*rb->getLinearFactor();
-		solverBody->m_originalBody = rb;
-		solverBody->m_angularFactor = rb->getAngularFactor();
-	} else
-	{
-		solverBody->internalGetInvMass().setValue(0,0,0);
-		solverBody->m_originalBody = 0;
-		solverBody->m_angularFactor.setValue(1,1,1);
-	}
-}
-#endif
-
-
-
-
-
-btScalar btSequentialImpulseConstraintSolver::restitutionCurve(btScalar rel_vel, btScalar restitution)
-{
-	btScalar rest = restitution * -rel_vel;
-	return rest;
-}
-
-
-
-void	applyAnisotropicFriction(btCollisionObject* colObj,btVector3& frictionDirection);
-void	applyAnisotropicFriction(btCollisionObject* colObj,btVector3& frictionDirection)
-{
-	if (colObj && colObj->hasAnisotropicFriction())
-	{
-		// transform to local coordinates
-		btVector3 loc_lateral = frictionDirection * colObj->getWorldTransform().getBasis();
-		const btVector3& friction_scaling = colObj->getAnisotropicFriction();
-		//apply anisotropic friction
-		loc_lateral *= friction_scaling;
-		// ... and transform it back to global coordinates
-		frictionDirection = colObj->getWorldTransform().getBasis() * loc_lateral;
-	}
-}
-
-
-void btSequentialImpulseConstraintSolver::setupFrictionConstraint(btSolverConstraint& solverConstraint, const btVector3& normalAxis,btRigidBody* solverBodyA,btRigidBody* solverBodyB,btManifoldPoint& cp,const btVector3& rel_pos1,const btVector3& rel_pos2,btCollisionObject* colObj0,btCollisionObject* colObj1, btScalar relaxation, btScalar desiredVelocity, btScalar cfmSlip)
-{
-
-
-	btRigidBody* body0=btRigidBody::upcast(colObj0);
-	btRigidBody* body1=btRigidBody::upcast(colObj1);
-
-	solverConstraint.m_contactNormal = normalAxis;
-
-	solverConstraint.m_solverBodyA = body0 ? body0 : &getFixedBody();
-	solverConstraint.m_solverBodyB = body1 ? body1 : &getFixedBody();
-
-	solverConstraint.m_friction = cp.m_combinedFriction;
-	solverConstraint.m_originalContactPoint = 0;
-
-	solverConstraint.m_appliedImpulse = 0.f;
-	solverConstraint.m_appliedPushImpulse = 0.f;
-
-	{
-		btVector3 ftorqueAxis1 = rel_pos1.cross(solverConstraint.m_contactNormal);
-		solverConstraint.m_relpos1CrossNormal = ftorqueAxis1;
-		solverConstraint.m_angularComponentA = body0 ? body0->getInvInertiaTensorWorld()*ftorqueAxis1*body0->getAngularFactor() : btVector3(0,0,0);
-	}
-	{
-		btVector3 ftorqueAxis1 = rel_pos2.cross(-solverConstraint.m_contactNormal);
-		solverConstraint.m_relpos2CrossNormal = ftorqueAxis1;
-		solverConstraint.m_angularComponentB = body1 ? body1->getInvInertiaTensorWorld()*ftorqueAxis1*body1->getAngularFactor() : btVector3(0,0,0);
-	}
-
-#ifdef COMPUTE_IMPULSE_DENOM
-	btScalar denom0 = rb0->computeImpulseDenominator(pos1,solverConstraint.m_contactNormal);
-	btScalar denom1 = rb1->computeImpulseDenominator(pos2,solverConstraint.m_contactNormal);
-#else
-	btVector3 vec;
-	btScalar denom0 = 0.f;
-	btScalar denom1 = 0.f;
-	if (body0)
-	{
-		vec = ( solverConstraint.m_angularComponentA).cross(rel_pos1);
-		denom0 = body0->getInvMass() + normalAxis.dot(vec);
-	}
-	if (body1)
-	{
-		vec = ( -solverConstraint.m_angularComponentB).cross(rel_pos2);
-		denom1 = body1->getInvMass() + normalAxis.dot(vec);
-	}
-
-
-#endif //COMPUTE_IMPULSE_DENOM
-	btScalar denom = relaxation/(denom0+denom1);
-	solverConstraint.m_jacDiagABInv = denom;
-
-#ifdef _USE_JACOBIAN
-	solverConstraint.m_jac =  btJacobianEntry (
-		rel_pos1,rel_pos2,solverConstraint.m_contactNormal,
-		body0->getInvInertiaDiagLocal(),
-		body0->getInvMass(),
-		body1->getInvInertiaDiagLocal(),
-		body1->getInvMass());
-#endif //_USE_JACOBIAN
-
-
-	{
-		btScalar rel_vel;
-		btScalar vel1Dotn = solverConstraint.m_contactNormal.dot(body0?body0->getLinearVelocity():btVector3(0,0,0)) 
-			+ solverConstraint.m_relpos1CrossNormal.dot(body0?body0->getAngularVelocity():btVector3(0,0,0));
-		btScalar vel2Dotn = -solverConstraint.m_contactNormal.dot(body1?body1->getLinearVelocity():btVector3(0,0,0)) 
-			+ solverConstraint.m_relpos2CrossNormal.dot(body1?body1->getAngularVelocity():btVector3(0,0,0));
-
-		rel_vel = vel1Dotn+vel2Dotn;
-
-//		btScalar positionalError = 0.f;
-
-		btSimdScalar velocityError =  desiredVelocity - rel_vel;
-		btSimdScalar	velocityImpulse = velocityError * btSimdScalar(solverConstraint.m_jacDiagABInv);
-		solverConstraint.m_rhs = velocityImpulse;
-		solverConstraint.m_cfm = cfmSlip;
-		solverConstraint.m_lowerLimit = 0;
-		solverConstraint.m_upperLimit = 1e10f;
-	}
-}
-
-
-
-btSolverConstraint&	btSequentialImpulseConstraintSolver::addFrictionConstraint(const btVector3& normalAxis,btRigidBody* solverBodyA,btRigidBody* solverBodyB,int frictionIndex,btManifoldPoint& cp,const btVector3& rel_pos1,const btVector3& rel_pos2,btCollisionObject* colObj0,btCollisionObject* colObj1, btScalar relaxation, btScalar desiredVelocity, btScalar cfmSlip)
-{
-	btSolverConstraint& solverConstraint = m_tmpSolverContactFrictionConstraintPool.expandNonInitializing();
-	solverConstraint.m_frictionIndex = frictionIndex;
-	setupFrictionConstraint(solverConstraint, normalAxis, solverBodyA, solverBodyB, cp, rel_pos1, rel_pos2, 
-							colObj0, colObj1, relaxation, desiredVelocity, cfmSlip);
-	return solverConstraint;
-}
-
-int	btSequentialImpulseConstraintSolver::getOrInitSolverBody(btCollisionObject& body)
-{
-#if 0
-	int solverBodyIdA = -1;
-
-	if (body.getCompanionId() >= 0)
-	{
-		//body has already been converted
-		solverBodyIdA = body.getCompanionId();
-	} else
-	{
-		btRigidBody* rb = btRigidBody::upcast(&body);
-		if (rb && rb->getInvMass())
-		{
-			solverBodyIdA = m_tmpSolverBodyPool.size();
-			btSolverBody& solverBody = m_tmpSolverBodyPool.expand();
-			initSolverBody(&solverBody,&body);
-			body.setCompanionId(solverBodyIdA);
-		} else
-		{
-			return 0;//assume first one is a fixed solver body
-		}
-	}
-	return solverBodyIdA;
-#endif
-	return 0;
-}
-#include <stdio.h>
-
-
-void btSequentialImpulseConstraintSolver::setupContactConstraint(btSolverConstraint& solverConstraint, 
-																 btCollisionObject* colObj0, btCollisionObject* colObj1,
-																 btManifoldPoint& cp, const btContactSolverInfo& infoGlobal,
-																 btVector3& vel, btScalar& rel_vel, btScalar& relaxation,
-																 btVector3& rel_pos1, btVector3& rel_pos2)
-{
-			btRigidBody* rb0 = btRigidBody::upcast(colObj0);
-			btRigidBody* rb1 = btRigidBody::upcast(colObj1);
-
-			const btVector3& pos1 = cp.getPositionWorldOnA();
-			const btVector3& pos2 = cp.getPositionWorldOnB();
-
-//			btVector3 rel_pos1 = pos1 - colObj0->getWorldTransform().getOrigin(); 
-//			btVector3 rel_pos2 = pos2 - colObj1->getWorldTransform().getOrigin();
-			rel_pos1 = pos1 - colObj0->getWorldTransform().getOrigin(); 
-			rel_pos2 = pos2 - colObj1->getWorldTransform().getOrigin();
-
-			relaxation = 1.f;
-
-			btVector3 torqueAxis0 = rel_pos1.cross(cp.m_normalWorldOnB);
-			solverConstraint.m_angularComponentA = rb0 ? rb0->getInvInertiaTensorWorld()*torqueAxis0*rb0->getAngularFactor() : btVector3(0,0,0);
-			btVector3 torqueAxis1 = rel_pos2.cross(cp.m_normalWorldOnB);		
-			solverConstraint.m_angularComponentB = rb1 ? rb1->getInvInertiaTensorWorld()*-torqueAxis1*rb1->getAngularFactor() : btVector3(0,0,0);
-
-				{
-#ifdef COMPUTE_IMPULSE_DENOM
-					btScalar denom0 = rb0->computeImpulseDenominator(pos1,cp.m_normalWorldOnB);
-					btScalar denom1 = rb1->computeImpulseDenominator(pos2,cp.m_normalWorldOnB);
-#else							
-					btVector3 vec;
-					btScalar denom0 = 0.f;
-					btScalar denom1 = 0.f;
-					if (rb0)
-					{
-						vec = ( solverConstraint.m_angularComponentA).cross(rel_pos1);
-						denom0 = rb0->getInvMass() + cp.m_normalWorldOnB.dot(vec);
-					}
-					if (rb1)
-					{
-						vec = ( -solverConstraint.m_angularComponentB).cross(rel_pos2);
-						denom1 = rb1->getInvMass() + cp.m_normalWorldOnB.dot(vec);
-					}
-#endif //COMPUTE_IMPULSE_DENOM		
-
-					btScalar denom = relaxation/(denom0+denom1);
-					solverConstraint.m_jacDiagABInv = denom;
-				}
-
-				solverConstraint.m_contactNormal = cp.m_normalWorldOnB;
-				solverConstraint.m_relpos1CrossNormal = rel_pos1.cross(cp.m_normalWorldOnB);
-				solverConstraint.m_relpos2CrossNormal = rel_pos2.cross(-cp.m_normalWorldOnB);
-
-
-
-
-			btVector3 vel1 = rb0 ? rb0->getVelocityInLocalPoint(rel_pos1) : btVector3(0,0,0);
-			btVector3 vel2 = rb1 ? rb1->getVelocityInLocalPoint(rel_pos2) : btVector3(0,0,0);
-			vel  = vel1 - vel2;
-			rel_vel = cp.m_normalWorldOnB.dot(vel);
-
-				btScalar penetration = cp.getDistance()+infoGlobal.m_linearSlop;
-
-
-				solverConstraint.m_friction = cp.m_combinedFriction;
-
-				btScalar restitution = 0.f;
-				
-				if (cp.m_lifeTime>infoGlobal.m_restingContactRestitutionThreshold)
-				{
-					restitution = 0.f;
-				} else
-				{
-					restitution =  restitutionCurve(rel_vel, cp.m_combinedRestitution);
-					if (restitution <= btScalar(0.))
-					{
-						restitution = 0.f;
-					};
-				}
-
-
-				///warm starting (or zero if disabled)
-				if (infoGlobal.m_solverMode & SOLVER_USE_WARMSTARTING)
-				{
-					solverConstraint.m_appliedImpulse = cp.m_appliedImpulse * infoGlobal.m_warmstartingFactor;
-					if (rb0)
-						rb0->internalApplyImpulse(solverConstraint.m_contactNormal*rb0->getInvMass()*rb0->getLinearFactor(),solverConstraint.m_angularComponentA,solverConstraint.m_appliedImpulse);
-					if (rb1)
-						rb1->internalApplyImpulse(solverConstraint.m_contactNormal*rb1->getInvMass()*rb1->getLinearFactor(),-solverConstraint.m_angularComponentB,-(btScalar)solverConstraint.m_appliedImpulse);
-				} else
-				{
-					solverConstraint.m_appliedImpulse = 0.f;
-				}
-
-				solverConstraint.m_appliedPushImpulse = 0.f;
-
-				{
-					btScalar rel_vel;
-					btScalar vel1Dotn = solverConstraint.m_contactNormal.dot(rb0?rb0->getLinearVelocity():btVector3(0,0,0)) 
-						+ solverConstraint.m_relpos1CrossNormal.dot(rb0?rb0->getAngularVelocity():btVector3(0,0,0));
-					btScalar vel2Dotn = -solverConstraint.m_contactNormal.dot(rb1?rb1->getLinearVelocity():btVector3(0,0,0)) 
-						+ solverConstraint.m_relpos2CrossNormal.dot(rb1?rb1->getAngularVelocity():btVector3(0,0,0));
-
-					rel_vel = vel1Dotn+vel2Dotn;
-
-					btScalar positionalError = 0.f;
-					btScalar	velocityError = restitution - rel_vel;// * damping;
-
-					if (penetration>0)
-					{
-						positionalError = 0;
-						velocityError -= penetration / infoGlobal.m_timeStep;
-					} else
-					{
-						positionalError = -penetration * infoGlobal.m_erp/infoGlobal.m_timeStep;
-					}
-
-					btScalar  penetrationImpulse = positionalError*solverConstraint.m_jacDiagABInv;
-					btScalar velocityImpulse = velocityError *solverConstraint.m_jacDiagABInv;
-					if (!infoGlobal.m_splitImpulse || (penetration > infoGlobal.m_splitImpulsePenetrationThreshold))
-					{
-						//combine position and velocity into rhs
-						solverConstraint.m_rhs = penetrationImpulse+velocityImpulse;
-						solverConstraint.m_rhsPenetration = 0.f;
-					} else
-					{
-						//split position and velocity into rhs and m_rhsPenetration
-						solverConstraint.m_rhs = velocityImpulse;
-						solverConstraint.m_rhsPenetration = penetrationImpulse;
-					}
-					solverConstraint.m_cfm = 0.f;
-					solverConstraint.m_lowerLimit = 0;
-					solverConstraint.m_upperLimit = 1e10f;
-				}
-
-
-
-
-}
-
-
-
-void btSequentialImpulseConstraintSolver::setFrictionConstraintImpulse( btSolverConstraint& solverConstraint, 
-																		btRigidBody* rb0, btRigidBody* rb1, 
-																 btManifoldPoint& cp, const btContactSolverInfo& infoGlobal)
-{
-					if (infoGlobal.m_solverMode & SOLVER_USE_FRICTION_WARMSTARTING)
-					{
-						{
-							btSolverConstraint& frictionConstraint1 = m_tmpSolverContactFrictionConstraintPool[solverConstraint.m_frictionIndex];
-							if (infoGlobal.m_solverMode & SOLVER_USE_WARMSTARTING)
-							{
-								frictionConstraint1.m_appliedImpulse = cp.m_appliedImpulseLateral1 * infoGlobal.m_warmstartingFactor;
-								if (rb0)
-									rb0->internalApplyImpulse(frictionConstraint1.m_contactNormal*rb0->getInvMass()*rb0->getLinearFactor(),frictionConstraint1.m_angularComponentA,frictionConstraint1.m_appliedImpulse);
-								if (rb1)
-									rb1->internalApplyImpulse(frictionConstraint1.m_contactNormal*rb1->getInvMass()*rb1->getLinearFactor(),-frictionConstraint1.m_angularComponentB,-(btScalar)frictionConstraint1.m_appliedImpulse);
-							} else
-							{
-								frictionConstraint1.m_appliedImpulse = 0.f;
-							}
-						}
-
-						if ((infoGlobal.m_solverMode & SOLVER_USE_2_FRICTION_DIRECTIONS))
-						{
-							btSolverConstraint& frictionConstraint2 = m_tmpSolverContactFrictionConstraintPool[solverConstraint.m_frictionIndex+1];
-							if (infoGlobal.m_solverMode & SOLVER_USE_WARMSTARTING)
-							{
-								frictionConstraint2.m_appliedImpulse = cp.m_appliedImpulseLateral2 * infoGlobal.m_warmstartingFactor;
-								if (rb0)
-									rb0->internalApplyImpulse(frictionConstraint2.m_contactNormal*rb0->getInvMass(),frictionConstraint2.m_angularComponentA,frictionConstraint2.m_appliedImpulse);
-								if (rb1)
-									rb1->internalApplyImpulse(frictionConstraint2.m_contactNormal*rb1->getInvMass(),-frictionConstraint2.m_angularComponentB,-(btScalar)frictionConstraint2.m_appliedImpulse);
-							} else
-							{
-								frictionConstraint2.m_appliedImpulse = 0.f;
-							}
-						}
-					} else
-					{
-						btSolverConstraint& frictionConstraint1 = m_tmpSolverContactFrictionConstraintPool[solverConstraint.m_frictionIndex];
-						frictionConstraint1.m_appliedImpulse = 0.f;
-						if ((infoGlobal.m_solverMode & SOLVER_USE_2_FRICTION_DIRECTIONS))
-						{
-							btSolverConstraint& frictionConstraint2 = m_tmpSolverContactFrictionConstraintPool[solverConstraint.m_frictionIndex+1];
-							frictionConstraint2.m_appliedImpulse = 0.f;
-						}
-					}
-}
-
-
-
-
-void	btSequentialImpulseConstraintSolver::convertContact(btPersistentManifold* manifold,const btContactSolverInfo& infoGlobal)
-{
-	btCollisionObject* colObj0=0,*colObj1=0;
-
-	colObj0 = (btCollisionObject*)manifold->getBody0();
-	colObj1 = (btCollisionObject*)manifold->getBody1();
-
-
-	btRigidBody* solverBodyA = btRigidBody::upcast(colObj0);
-	btRigidBody* solverBodyB = btRigidBody::upcast(colObj1);
-
-	///avoid collision response between two static objects
-	if ((!solverBodyA || !solverBodyA->getInvMass()) && (!solverBodyB || !solverBodyB->getInvMass()))
-		return;
-
-	for (int j=0;j<manifold->getNumContacts();j++)
-	{
-
-		btManifoldPoint& cp = manifold->getContactPoint(j);
-
-		if (cp.getDistance() <= manifold->getContactProcessingThreshold())
-		{
-			btVector3 rel_pos1;
-			btVector3 rel_pos2;
-			btScalar relaxation;
-			btScalar rel_vel;
-			btVector3 vel;
-
-			int frictionIndex = m_tmpSolverContactConstraintPool.size();
-			btSolverConstraint& solverConstraint = m_tmpSolverContactConstraintPool.expandNonInitializing();
-			btRigidBody* rb0 = btRigidBody::upcast(colObj0);
-			btRigidBody* rb1 = btRigidBody::upcast(colObj1);
-			solverConstraint.m_solverBodyA = rb0? rb0 : &getFixedBody();
-			solverConstraint.m_solverBodyB = rb1? rb1 : &getFixedBody();
-			solverConstraint.m_originalContactPoint = &cp;
-
-			setupContactConstraint(solverConstraint, colObj0, colObj1, cp, infoGlobal, vel, rel_vel, relaxation, rel_pos1, rel_pos2);
-
-//			const btVector3& pos1 = cp.getPositionWorldOnA();
-//			const btVector3& pos2 = cp.getPositionWorldOnB();
-
-			/////setup the friction constraints
-
-			solverConstraint.m_frictionIndex = m_tmpSolverContactFrictionConstraintPool.size();
-
-			if (!(infoGlobal.m_solverMode & SOLVER_ENABLE_FRICTION_DIRECTION_CACHING) || !cp.m_lateralFrictionInitialized)
-			{
-				cp.m_lateralFrictionDir1 = vel - cp.m_normalWorldOnB * rel_vel;
-				btScalar lat_rel_vel = cp.m_lateralFrictionDir1.length2();
-				if (!(infoGlobal.m_solverMode & SOLVER_DISABLE_VELOCITY_DEPENDENT_FRICTION_DIRECTION) && lat_rel_vel > SIMD_EPSILON)
-				{
-					cp.m_lateralFrictionDir1 /= btSqrt(lat_rel_vel);
-					if((infoGlobal.m_solverMode & SOLVER_USE_2_FRICTION_DIRECTIONS))
-					{
-						cp.m_lateralFrictionDir2 = cp.m_lateralFrictionDir1.cross(cp.m_normalWorldOnB);
-						cp.m_lateralFrictionDir2.normalize();//??
-						applyAnisotropicFriction(colObj0,cp.m_lateralFrictionDir2);
-						applyAnisotropicFriction(colObj1,cp.m_lateralFrictionDir2);
-						addFrictionConstraint(cp.m_lateralFrictionDir2,solverBodyA,solverBodyB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation);
-					}
-
-					applyAnisotropicFriction(colObj0,cp.m_lateralFrictionDir1);
-					applyAnisotropicFriction(colObj1,cp.m_lateralFrictionDir1);
-					addFrictionConstraint(cp.m_lateralFrictionDir1,solverBodyA,solverBodyB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation);
-					cp.m_lateralFrictionInitialized = true;
-				} else
-				{
-					//re-calculate friction direction every frame, todo: check if this is really needed
-					btPlaneSpace1(cp.m_normalWorldOnB,cp.m_lateralFrictionDir1,cp.m_lateralFrictionDir2);
-					if ((infoGlobal.m_solverMode & SOLVER_USE_2_FRICTION_DIRECTIONS))
-					{
-						applyAnisotropicFriction(colObj0,cp.m_lateralFrictionDir2);
-						applyAnisotropicFriction(colObj1,cp.m_lateralFrictionDir2);
-						addFrictionConstraint(cp.m_lateralFrictionDir2,solverBodyA,solverBodyB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation);
-					}
-
-					applyAnisotropicFriction(colObj0,cp.m_lateralFrictionDir1);
-					applyAnisotropicFriction(colObj1,cp.m_lateralFrictionDir1);
-					addFrictionConstraint(cp.m_lateralFrictionDir1,solverBodyA,solverBodyB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation);
-
-					cp.m_lateralFrictionInitialized = true;
-				}
-
-			} else
-			{
-				addFrictionConstraint(cp.m_lateralFrictionDir1,solverBodyA,solverBodyB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation,cp.m_contactMotion1, cp.m_contactCFM1);
-				if ((infoGlobal.m_solverMode & SOLVER_USE_2_FRICTION_DIRECTIONS))
-					addFrictionConstraint(cp.m_lateralFrictionDir2,solverBodyA,solverBodyB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation, cp.m_contactMotion2, cp.m_contactCFM2);
-			}
-			
-			setFrictionConstraintImpulse( solverConstraint, rb0, rb1, cp, infoGlobal);
-
-		}
-	}
-}
-
-
-btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySetup(btCollisionObject** bodies, int numBodies, btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc)
-{
-	BT_PROFILE("solveGroupCacheFriendlySetup");
-	(void)stackAlloc;
-	(void)debugDrawer;
-
-
-	if (!(numConstraints + numManifolds))
-	{
-		//		printf("empty\n");
-		return 0.f;
-	}
-
-	if (infoGlobal.m_splitImpulse)
-	{
-		for (int i = 0; i < numBodies; i++)
-		{
-			btRigidBody* body = btRigidBody::upcast(bodies[i]);
-			if (body)
-			{	
-				body->internalGetDeltaLinearVelocity().setZero();
-				body->internalGetDeltaAngularVelocity().setZero();
-				body->internalGetPushVelocity().setZero();
-				body->internalGetTurnVelocity().setZero();
-			}
-		}
-	}
-	else
-	{
-		for (int i = 0; i < numBodies; i++)
-		{
-			btRigidBody* body = btRigidBody::upcast(bodies[i]);
-			if (body)
-			{	
-				body->internalGetDeltaLinearVelocity().setZero();
-				body->internalGetDeltaAngularVelocity().setZero();
-			}
-		}
-	}
-
-	if (1)
-	{
-		int j;
-		for (j=0;j<numConstraints;j++)
-		{
-			btTypedConstraint* constraint = constraints[j];
-			constraint->buildJacobian();
-			constraint->internalSetAppliedImpulse(0.0f);
-		}
-	}
-	//btRigidBody* rb0=0,*rb1=0;
-
-	//if (1)
-	{
-		{
-
-			int totalNumRows = 0;
-			int i;
-			
-			m_tmpConstraintSizesPool.resize(numConstraints);
-			//calculate the total number of contraint rows
-			for (i=0;i<numConstraints;i++)
-			{
-				btTypedConstraint::btConstraintInfo1& info1 = m_tmpConstraintSizesPool[i];
-				if (constraints[i]->isEnabled())
-				{
-					constraints[i]->getInfo1(&info1);
-				} else
-				{
-					info1.m_numConstraintRows = 0;
-					info1.nub = 0;
-				}
-				totalNumRows += info1.m_numConstraintRows;
-			}
-			m_tmpSolverNonContactConstraintPool.resize(totalNumRows);
-
-			
-			///setup the btSolverConstraints
-			int currentRow = 0;
-
-			for (i=0;i<numConstraints;i++)
-			{
-				const btTypedConstraint::btConstraintInfo1& info1 = m_tmpConstraintSizesPool[i];
-				
-				if (info1.m_numConstraintRows)
-				{
-					btAssert(currentRow<totalNumRows);
-
-					btSolverConstraint* currentConstraintRow = &m_tmpSolverNonContactConstraintPool[currentRow];
-					btTypedConstraint* constraint = constraints[i];
-
-
-					btRigidBody& rbA = constraint->getRigidBodyA();
-					btRigidBody& rbB = constraint->getRigidBodyB();
-
-					
-					int j;
-					for ( j=0;j<info1.m_numConstraintRows;j++)
-					{
-						memset(&currentConstraintRow[j],0,sizeof(btSolverConstraint));
-						currentConstraintRow[j].m_lowerLimit = -SIMD_INFINITY;
-						currentConstraintRow[j].m_upperLimit = SIMD_INFINITY;
-						currentConstraintRow[j].m_appliedImpulse = 0.f;
-						currentConstraintRow[j].m_appliedPushImpulse = 0.f;
-						currentConstraintRow[j].m_solverBodyA = &rbA;
-						currentConstraintRow[j].m_solverBodyB = &rbB;
-					}
-
-					rbA.internalGetDeltaLinearVelocity().setValue(0.f,0.f,0.f);
-					rbA.internalGetDeltaAngularVelocity().setValue(0.f,0.f,0.f);
-					rbB.internalGetDeltaLinearVelocity().setValue(0.f,0.f,0.f);
-					rbB.internalGetDeltaAngularVelocity().setValue(0.f,0.f,0.f);
-
-
-
-					btTypedConstraint::btConstraintInfo2 info2;
-					info2.fps = 1.f/infoGlobal.m_timeStep;
-					info2.erp = infoGlobal.m_erp;
-					info2.m_J1linearAxis = currentConstraintRow->m_contactNormal;
-					info2.m_J1angularAxis = currentConstraintRow->m_relpos1CrossNormal;
-					info2.m_J2linearAxis = 0;
-					info2.m_J2angularAxis = currentConstraintRow->m_relpos2CrossNormal;
-					info2.rowskip = sizeof(btSolverConstraint)/sizeof(btScalar);//check this
-					///the size of btSolverConstraint needs be a multiple of btScalar
-					btAssert(info2.rowskip*sizeof(btScalar)== sizeof(btSolverConstraint));
-					info2.m_constraintError = &currentConstraintRow->m_rhs;
-					currentConstraintRow->m_cfm = infoGlobal.m_globalCfm;
-					info2.m_damping = infoGlobal.m_damping;
-					info2.cfm = &currentConstraintRow->m_cfm;
-					info2.m_lowerLimit = &currentConstraintRow->m_lowerLimit;
-					info2.m_upperLimit = &currentConstraintRow->m_upperLimit;
-					info2.m_numIterations = infoGlobal.m_numIterations;
-					constraints[i]->getInfo2(&info2);
-
-					if (currentConstraintRow->m_upperLimit>constraints[i]->getBreakingImpulseThreshold())
-					{
-						currentConstraintRow->m_upperLimit = constraints[i]->getBreakingImpulseThreshold();
-					}
-
-					if (currentConstraintRow->m_lowerLimit<-constraints[i]->getBreakingImpulseThreshold())
-					{
-						currentConstraintRow->m_lowerLimit = -constraints[i]->getBreakingImpulseThreshold();
-					}
-
-
-
-					///finalize the constraint setup
-					for ( j=0;j<info1.m_numConstraintRows;j++)
-					{
-						btSolverConstraint& solverConstraint = currentConstraintRow[j];
-						solverConstraint.m_originalContactPoint = constraint;
-
-						{
-							const btVector3& ftorqueAxis1 = solverConstraint.m_relpos1CrossNormal;
-							solverConstraint.m_angularComponentA = constraint->getRigidBodyA().getInvInertiaTensorWorld()*ftorqueAxis1*constraint->getRigidBodyA().getAngularFactor();
-						}
-						{
-							const btVector3& ftorqueAxis2 = solverConstraint.m_relpos2CrossNormal;
-							solverConstraint.m_angularComponentB = constraint->getRigidBodyB().getInvInertiaTensorWorld()*ftorqueAxis2*constraint->getRigidBodyB().getAngularFactor();
-						}
-
-						{
-							btVector3 iMJlA = solverConstraint.m_contactNormal*rbA.getInvMass();
-							btVector3 iMJaA = rbA.getInvInertiaTensorWorld()*solverConstraint.m_relpos1CrossNormal;
-							btVector3 iMJlB = solverConstraint.m_contactNormal*rbB.getInvMass();//sign of normal?
-							btVector3 iMJaB = rbB.getInvInertiaTensorWorld()*solverConstraint.m_relpos2CrossNormal;
-
-							btScalar sum = iMJlA.dot(solverConstraint.m_contactNormal);
-							sum += iMJaA.dot(solverConstraint.m_relpos1CrossNormal);
-							sum += iMJlB.dot(solverConstraint.m_contactNormal);
-							sum += iMJaB.dot(solverConstraint.m_relpos2CrossNormal);
-
-							solverConstraint.m_jacDiagABInv = btScalar(1.)/sum;
-						}
-
-
-						///fix rhs
-						///todo: add force/torque accelerators
-						{
-							btScalar rel_vel;
-							btScalar vel1Dotn = solverConstraint.m_contactNormal.dot(rbA.getLinearVelocity()) + solverConstraint.m_relpos1CrossNormal.dot(rbA.getAngularVelocity());
-							btScalar vel2Dotn = -solverConstraint.m_contactNormal.dot(rbB.getLinearVelocity()) + solverConstraint.m_relpos2CrossNormal.dot(rbB.getAngularVelocity());
-
-							rel_vel = vel1Dotn+vel2Dotn;
-
-							btScalar restitution = 0.f;
-							btScalar positionalError = solverConstraint.m_rhs;//already filled in by getConstraintInfo2
-							btScalar	velocityError = restitution - rel_vel * info2.m_damping;
-							btScalar	penetrationImpulse = positionalError*solverConstraint.m_jacDiagABInv;
-							btScalar	velocityImpulse = velocityError *solverConstraint.m_jacDiagABInv;
-							solverConstraint.m_rhs = penetrationImpulse+velocityImpulse;
-							solverConstraint.m_appliedImpulse = 0.f;
-
-						}
-					}
-				}
-				currentRow+=m_tmpConstraintSizesPool[i].m_numConstraintRows;
-			}
-		}
-
-		{
-			int i;
-			btPersistentManifold* manifold = 0;
-//			btCollisionObject* colObj0=0,*colObj1=0;
-
-
-			for (i=0;i<numManifolds;i++)
-			{
-				manifold = manifoldPtr[i];
-				convertContact(manifold,infoGlobal);
-			}
-		}
-	}
-
-	btContactSolverInfo info = infoGlobal;
-
-
-
-	int numConstraintPool = m_tmpSolverContactConstraintPool.size();
-	int numFrictionPool = m_tmpSolverContactFrictionConstraintPool.size();
-
-	///@todo: use stack allocator for such temporarily memory, same for solver bodies/constraints
-	m_orderTmpConstraintPool.resize(numConstraintPool);
-	m_orderFrictionConstraintPool.resize(numFrictionPool);
-	{
-		int i;
-		for (i=0;i<numConstraintPool;i++)
-		{
-			m_orderTmpConstraintPool[i] = i;
-		}
-		for (i=0;i<numFrictionPool;i++)
-		{
-			m_orderFrictionConstraintPool[i] = i;
-		}
-	}
-
-	return 0.f;
-
-}
-
-btScalar btSequentialImpulseConstraintSolver::solveSingleIteration(int iteration, btCollisionObject** /*bodies */,int /*numBodies*/,btPersistentManifold** /*manifoldPtr*/, int /*numManifolds*/,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* /*debugDrawer*/,btStackAlloc* /*stackAlloc*/)
-{
-
-	int numConstraintPool = m_tmpSolverContactConstraintPool.size();
-	int numFrictionPool = m_tmpSolverContactFrictionConstraintPool.size();
-
-	int j;
-
-	if (infoGlobal.m_solverMode & SOLVER_RANDMIZE_ORDER)
-	{
-		if ((iteration & 7) == 0) {
-			for (j=0; j<numConstraintPool; ++j) {
-				int tmp = m_orderTmpConstraintPool[j];
-				int swapi = btRandInt2(j+1);
-				m_orderTmpConstraintPool[j] = m_orderTmpConstraintPool[swapi];
-				m_orderTmpConstraintPool[swapi] = tmp;
-			}
-
-			for (j=0; j<numFrictionPool; ++j) {
-				int tmp = m_orderFrictionConstraintPool[j];
-				int swapi = btRandInt2(j+1);
-				m_orderFrictionConstraintPool[j] = m_orderFrictionConstraintPool[swapi];
-				m_orderFrictionConstraintPool[swapi] = tmp;
-			}
-		}
-	}
-
-	if (infoGlobal.m_solverMode & SOLVER_SIMD)
-	{
-		///solve all joint constraints, using SIMD, if available
-		for (j=0;j<m_tmpSolverNonContactConstraintPool.size();j++)
-		{
-			btSolverConstraint& constraint = m_tmpSolverNonContactConstraintPool[j];
-			resolveSingleConstraintRowGenericSIMD(*constraint.m_solverBodyA,*constraint.m_solverBodyB,constraint);
-		}
-
-		for (j=0;j<numConstraints;j++)
-		{
-			constraints[j]->solveConstraintObsolete(constraints[j]->getRigidBodyA(),constraints[j]->getRigidBodyB(),infoGlobal.m_timeStep);
-		}
-
-		///solve all contact constraints using SIMD, if available
-		int numPoolConstraints = m_tmpSolverContactConstraintPool.size();
-		for (j=0;j<numPoolConstraints;j++)
-		{
-			const btSolverConstraint& solveManifold = m_tmpSolverContactConstraintPool[m_orderTmpConstraintPool[j]];
-			resolveSingleConstraintRowLowerLimitSIMD(*solveManifold.m_solverBodyA,*solveManifold.m_solverBodyB,solveManifold);
-
-		}
-		///solve all friction constraints, using SIMD, if available
-		int numFrictionPoolConstraints = m_tmpSolverContactFrictionConstraintPool.size();
-		for (j=0;j<numFrictionPoolConstraints;j++)
-		{
-			btSolverConstraint& solveManifold = m_tmpSolverContactFrictionConstraintPool[m_orderFrictionConstraintPool[j]];
-			btScalar totalImpulse = m_tmpSolverContactConstraintPool[solveManifold.m_frictionIndex].m_appliedImpulse;
-
-			if (totalImpulse>btScalar(0))
-			{
-				solveManifold.m_lowerLimit = -(solveManifold.m_friction*totalImpulse);
-				solveManifold.m_upperLimit = solveManifold.m_friction*totalImpulse;
-
-				resolveSingleConstraintRowGenericSIMD(*solveManifold.m_solverBodyA,	*solveManifold.m_solverBodyB,solveManifold);
-			}
-		}
-	} else
-	{
-
-		///solve all joint constraints
-		for (j=0;j<m_tmpSolverNonContactConstraintPool.size();j++)
-		{
-			btSolverConstraint& constraint = m_tmpSolverNonContactConstraintPool[j];
-			resolveSingleConstraintRowGeneric(*constraint.m_solverBodyA,*constraint.m_solverBodyB,constraint);
-		}
-
-		for (j=0;j<numConstraints;j++)
-		{
-			constraints[j]->solveConstraintObsolete(constraints[j]->getRigidBodyA(),constraints[j]->getRigidBodyB(),infoGlobal.m_timeStep);
-		}
-		///solve all contact constraints
-		int numPoolConstraints = m_tmpSolverContactConstraintPool.size();
-		for (j=0;j<numPoolConstraints;j++)
-		{
-			const btSolverConstraint& solveManifold = m_tmpSolverContactConstraintPool[m_orderTmpConstraintPool[j]];
-			resolveSingleConstraintRowLowerLimit(*solveManifold.m_solverBodyA,*solveManifold.m_solverBodyB,solveManifold);
-		}
-		///solve all friction constraints
-		int numFrictionPoolConstraints = m_tmpSolverContactFrictionConstraintPool.size();
-		for (j=0;j<numFrictionPoolConstraints;j++)
-		{
-			btSolverConstraint& solveManifold = m_tmpSolverContactFrictionConstraintPool[m_orderFrictionConstraintPool[j]];
-			btScalar totalImpulse = m_tmpSolverContactConstraintPool[solveManifold.m_frictionIndex].m_appliedImpulse;
-
-			if (totalImpulse>btScalar(0))
-			{
-				solveManifold.m_lowerLimit = -(solveManifold.m_friction*totalImpulse);
-				solveManifold.m_upperLimit = solveManifold.m_friction*totalImpulse;
-
-				resolveSingleConstraintRowGeneric(*solveManifold.m_solverBodyA,*solveManifold.m_solverBodyB,solveManifold);
-			}
-		}
-	}
-	return 0.f;
-}
-
-
-void btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySplitImpulseIterations(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc)
-{
-	int iteration;
-	if (infoGlobal.m_splitImpulse)
-	{
-		if (infoGlobal.m_solverMode & SOLVER_SIMD)
-		{
-			for ( iteration = 0;iteration<infoGlobal.m_numIterations;iteration++)
-			{
-				{
-					int numPoolConstraints = m_tmpSolverContactConstraintPool.size();
-					int j;
-					for (j=0;j<numPoolConstraints;j++)
-					{
-						const btSolverConstraint& solveManifold = m_tmpSolverContactConstraintPool[m_orderTmpConstraintPool[j]];
-
-						resolveSplitPenetrationSIMD(*solveManifold.m_solverBodyA,*solveManifold.m_solverBodyB,solveManifold);
-					}
-				}
-			}
-		}
-		else
-		{
-			for ( iteration = 0;iteration<infoGlobal.m_numIterations;iteration++)
-			{
-				{
-					int numPoolConstraints = m_tmpSolverContactConstraintPool.size();
-					int j;
-					for (j=0;j<numPoolConstraints;j++)
-					{
-						const btSolverConstraint& solveManifold = m_tmpSolverContactConstraintPool[m_orderTmpConstraintPool[j]];
-
-						resolveSplitPenetrationImpulseCacheFriendly(*solveManifold.m_solverBodyA,*solveManifold.m_solverBodyB,solveManifold);
-					}
-				}
-			}
-		}
-	}
-}
-
-btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlyIterations(btCollisionObject** bodies ,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc)
-{
-	BT_PROFILE("solveGroupCacheFriendlyIterations");
-
-	
-	//should traverse the contacts random order...
-	int iteration;
-	{
-		solveGroupCacheFriendlySplitImpulseIterations(bodies ,numBodies,manifoldPtr, numManifolds,constraints,numConstraints,infoGlobal,debugDrawer,stackAlloc);
-
-		for ( iteration = 0;iteration<infoGlobal.m_numIterations;iteration++)
-		{			
-			solveSingleIteration(iteration, bodies ,numBodies,manifoldPtr, numManifolds,constraints,numConstraints,infoGlobal,debugDrawer,stackAlloc);
-		}
-		
-	}
-	return 0.f;
-}
-
-btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlyFinish(btCollisionObject** bodies ,int numBodies,btPersistentManifold** /*manifoldPtr*/, int /*numManifolds*/,btTypedConstraint** /*constraints*/,int /* numConstraints*/,const btContactSolverInfo& infoGlobal,btIDebugDraw* /*debugDrawer*/,btStackAlloc* /*stackAlloc*/)
-{
-	int numPoolConstraints = m_tmpSolverContactConstraintPool.size();
-	int i,j;
-
-	for (j=0;j<numPoolConstraints;j++)
-	{
-
-		const btSolverConstraint& solveManifold = m_tmpSolverContactConstraintPool[j];
-		btManifoldPoint* pt = (btManifoldPoint*) solveManifold.m_originalContactPoint;
-		btAssert(pt);
-		pt->m_appliedImpulse = solveManifold.m_appliedImpulse;
-		if (infoGlobal.m_solverMode & SOLVER_USE_FRICTION_WARMSTARTING)
-		{
-			pt->m_appliedImpulseLateral1 = m_tmpSolverContactFrictionConstraintPool[solveManifold.m_frictionIndex].m_appliedImpulse;
-			pt->m_appliedImpulseLateral2 = m_tmpSolverContactFrictionConstraintPool[solveManifold.m_frictionIndex+1].m_appliedImpulse;
-		}
-
-		//do a callback here?
-	}
-
-	numPoolConstraints = m_tmpSolverNonContactConstraintPool.size();
-	for (j=0;j<numPoolConstraints;j++)
-	{
-		const btSolverConstraint& solverConstr = m_tmpSolverNonContactConstraintPool[j];
-		btTypedConstraint* constr = (btTypedConstraint*)solverConstr.m_originalContactPoint;
-		constr->internalSetAppliedImpulse(solverConstr.m_appliedImpulse);
-		if (solverConstr.m_appliedImpulse>constr->getBreakingImpulseThreshold())
-		{
-			constr->setEnabled(false);
-		}
-	}
-
-
-	if (infoGlobal.m_splitImpulse)
-	{		
-		for ( i=0;i<numBodies;i++)
-		{
-			btRigidBody* body = btRigidBody::upcast(bodies[i]);
-			if (body)
-				body->internalWritebackVelocity(infoGlobal.m_timeStep);
-		}
-	} else
-	{
-		for ( i=0;i<numBodies;i++)
-		{
-			btRigidBody* body = btRigidBody::upcast(bodies[i]);
-			if (body)
-				body->internalWritebackVelocity();
-		}
-	}
-
-
-	m_tmpSolverContactConstraintPool.resize(0);
-	m_tmpSolverNonContactConstraintPool.resize(0);
-	m_tmpSolverContactFrictionConstraintPool.resize(0);
-
-	return 0.f;
-}
-
-
-
-/// btSequentialImpulseConstraintSolver Sequentially applies impulses
-btScalar btSequentialImpulseConstraintSolver::solveGroup(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc,btDispatcher* /*dispatcher*/)
-{
-
-	BT_PROFILE("solveGroup");
-	//you need to provide at least some bodies
-	btAssert(bodies);
-	btAssert(numBodies);
-
-	solveGroupCacheFriendlySetup( bodies, numBodies, manifoldPtr,  numManifolds,constraints, numConstraints,infoGlobal,debugDrawer, stackAlloc);
-
-	solveGroupCacheFriendlyIterations(bodies, numBodies, manifoldPtr,  numManifolds,constraints, numConstraints,infoGlobal,debugDrawer, stackAlloc);
-
-	solveGroupCacheFriendlyFinish(bodies, numBodies, manifoldPtr,  numManifolds,constraints, numConstraints,infoGlobal,debugDrawer, stackAlloc);
-	
-	return 0.f;
-}
-
-void	btSequentialImpulseConstraintSolver::reset()
-{
-	m_btSeed2 = 0;
-}
-
-btRigidBody& btSequentialImpulseConstraintSolver::getFixedBody()
-{
-	static btRigidBody s_fixed(0, 0,0);
-	s_fixed.setMassProps(btScalar(0.),btVector3(btScalar(0.),btScalar(0.),btScalar(0.)));
-	return s_fixed;
-}
-
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h
deleted file mode 100644
index d738478..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H
-#define BT_SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H
-
-#include "btConstraintSolver.h"
-class btIDebugDraw;
-#include "btContactConstraint.h"
-#include "btSolverBody.h"
-#include "btSolverConstraint.h"
-#include "btTypedConstraint.h"
-#include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h"
-
-///The btSequentialImpulseConstraintSolver is a fast SIMD implementation of the Projected Gauss Seidel (iterative LCP) method.
-class btSequentialImpulseConstraintSolver : public btConstraintSolver
-{
-protected:
-
-	btConstraintArray			m_tmpSolverContactConstraintPool;
-	btConstraintArray			m_tmpSolverNonContactConstraintPool;
-	btConstraintArray			m_tmpSolverContactFrictionConstraintPool;
-	btAlignedObjectArray<int>	m_orderTmpConstraintPool;
-	btAlignedObjectArray<int>	m_orderFrictionConstraintPool;
-	btAlignedObjectArray<btTypedConstraint::btConstraintInfo1> m_tmpConstraintSizesPool;
-
-	void setupFrictionConstraint(	btSolverConstraint& solverConstraint, const btVector3& normalAxis,btRigidBody* solverBodyA,btRigidBody* solverBodyIdB,
-									btManifoldPoint& cp,const btVector3& rel_pos1,const btVector3& rel_pos2,
-									btCollisionObject* colObj0,btCollisionObject* colObj1, btScalar relaxation, 
-									btScalar desiredVelocity=0., btScalar cfmSlip=0.);
-
-	btSolverConstraint&	addFrictionConstraint(const btVector3& normalAxis,btRigidBody* solverBodyA,btRigidBody* solverBodyB,int frictionIndex,btManifoldPoint& cp,const btVector3& rel_pos1,const btVector3& rel_pos2,btCollisionObject* colObj0,btCollisionObject* colObj1, btScalar relaxation, btScalar desiredVelocity=0., btScalar cfmSlip=0.);
-	
-	void setupContactConstraint(btSolverConstraint& solverConstraint, btCollisionObject* colObj0, btCollisionObject* colObj1, btManifoldPoint& cp, 
-								const btContactSolverInfo& infoGlobal, btVector3& vel, btScalar& rel_vel, btScalar& relaxation, 
-								btVector3& rel_pos1, btVector3& rel_pos2);
-
-	void setFrictionConstraintImpulse( btSolverConstraint& solverConstraint, btRigidBody* rb0, btRigidBody* rb1, 
-										 btManifoldPoint& cp, const btContactSolverInfo& infoGlobal);
-
-	///m_btSeed2 is used for re-arranging the constraint rows. improves convergence/quality of friction
-	unsigned long	m_btSeed2;
-
-//	void	initSolverBody(btSolverBody* solverBody, btCollisionObject* collisionObject);
-	btScalar restitutionCurve(btScalar rel_vel, btScalar restitution);
-
-	void	convertContact(btPersistentManifold* manifold,const btContactSolverInfo& infoGlobal);
-
-
-	void	resolveSplitPenetrationSIMD(
-        btRigidBody& body1,
-        btRigidBody& body2,
-        const btSolverConstraint& contactConstraint);
-
-	void	resolveSplitPenetrationImpulseCacheFriendly(
-        btRigidBody& body1,
-        btRigidBody& body2,
-        const btSolverConstraint& contactConstraint);
-
-	//internal method
-	int	getOrInitSolverBody(btCollisionObject& body);
-
-	void	resolveSingleConstraintRowGeneric(btRigidBody& body1,btRigidBody& body2,const btSolverConstraint& contactConstraint);
-
-	void	resolveSingleConstraintRowGenericSIMD(btRigidBody& body1,btRigidBody& body2,const btSolverConstraint& contactConstraint);
-	
-	void	resolveSingleConstraintRowLowerLimit(btRigidBody& body1,btRigidBody& body2,const btSolverConstraint& contactConstraint);
-	
-	void	resolveSingleConstraintRowLowerLimitSIMD(btRigidBody& body1,btRigidBody& body2,const btSolverConstraint& contactConstraint);
-		
-protected:
-	static btRigidBody& getFixedBody();
-	
-	virtual void solveGroupCacheFriendlySplitImpulseIterations(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc);
-	virtual btScalar solveGroupCacheFriendlyFinish(btCollisionObject** bodies ,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc);
-	btScalar solveSingleIteration(int iteration, btCollisionObject** bodies ,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc);
-
-	virtual btScalar solveGroupCacheFriendlySetup(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc);
-	virtual btScalar solveGroupCacheFriendlyIterations(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc);
-
-
-public:
-
-	
-	btSequentialImpulseConstraintSolver();
-	virtual ~btSequentialImpulseConstraintSolver();
-
-	virtual btScalar solveGroup(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifold,int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& info, btIDebugDraw* debugDrawer, btStackAlloc* stackAlloc,btDispatcher* dispatcher);
-	
-
-	
-	///clear internal cached data and reset random seed
-	virtual	void	reset();
-	
-	unsigned long btRand2();
-
-	int btRandInt2 (int n);
-
-	void	setRandSeed(unsigned long seed)
-	{
-		m_btSeed2 = seed;
-	}
-	unsigned long	getRandSeed() const
-	{
-		return m_btSeed2;
-	}
-
-};
-
-#ifndef BT_PREFER_SIMD
-typedef btSequentialImpulseConstraintSolver btSequentialImpulseConstraintSolverPrefered;
-#endif
-
-
-#endif //BT_SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H
-
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSliderConstraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSliderConstraint.cpp
deleted file mode 100755
index b69f46d..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSliderConstraint.cpp
+++ /dev/null
@@ -1,857 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
-Added by Roman Ponomarev (rponom at gmail.com)
-April 04, 2008
-*/
-
-
-
-#include "btSliderConstraint.h"
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-#include "LinearMath/btTransformUtil.h"
-#include <new>
-
-#define USE_OFFSET_FOR_CONSTANT_FRAME true
-
-void btSliderConstraint::initParams()
-{
-    m_lowerLinLimit = btScalar(1.0);
-    m_upperLinLimit = btScalar(-1.0);
-    m_lowerAngLimit = btScalar(0.);
-    m_upperAngLimit = btScalar(0.);
-	m_softnessDirLin = SLIDER_CONSTRAINT_DEF_SOFTNESS;
-	m_restitutionDirLin = SLIDER_CONSTRAINT_DEF_RESTITUTION;
-	m_dampingDirLin = btScalar(0.);
-	m_cfmDirLin = SLIDER_CONSTRAINT_DEF_CFM;
-	m_softnessDirAng = SLIDER_CONSTRAINT_DEF_SOFTNESS;
-	m_restitutionDirAng = SLIDER_CONSTRAINT_DEF_RESTITUTION;
-	m_dampingDirAng = btScalar(0.);
-	m_cfmDirAng = SLIDER_CONSTRAINT_DEF_CFM;
-	m_softnessOrthoLin = SLIDER_CONSTRAINT_DEF_SOFTNESS;
-	m_restitutionOrthoLin = SLIDER_CONSTRAINT_DEF_RESTITUTION;
-	m_dampingOrthoLin = SLIDER_CONSTRAINT_DEF_DAMPING;
-	m_cfmOrthoLin = SLIDER_CONSTRAINT_DEF_CFM;
-	m_softnessOrthoAng = SLIDER_CONSTRAINT_DEF_SOFTNESS;
-	m_restitutionOrthoAng = SLIDER_CONSTRAINT_DEF_RESTITUTION;
-	m_dampingOrthoAng = SLIDER_CONSTRAINT_DEF_DAMPING;
-	m_cfmOrthoAng = SLIDER_CONSTRAINT_DEF_CFM;
-	m_softnessLimLin = SLIDER_CONSTRAINT_DEF_SOFTNESS;
-	m_restitutionLimLin = SLIDER_CONSTRAINT_DEF_RESTITUTION;
-	m_dampingLimLin = SLIDER_CONSTRAINT_DEF_DAMPING;
-	m_cfmLimLin = SLIDER_CONSTRAINT_DEF_CFM;
-	m_softnessLimAng = SLIDER_CONSTRAINT_DEF_SOFTNESS;
-	m_restitutionLimAng = SLIDER_CONSTRAINT_DEF_RESTITUTION;
-	m_dampingLimAng = SLIDER_CONSTRAINT_DEF_DAMPING;
-	m_cfmLimAng = SLIDER_CONSTRAINT_DEF_CFM;
-
-	m_poweredLinMotor = false;
-    m_targetLinMotorVelocity = btScalar(0.);
-    m_maxLinMotorForce = btScalar(0.);
-	m_accumulatedLinMotorImpulse = btScalar(0.0);
-
-	m_poweredAngMotor = false;
-    m_targetAngMotorVelocity = btScalar(0.);
-    m_maxAngMotorForce = btScalar(0.);
-	m_accumulatedAngMotorImpulse = btScalar(0.0);
-
-	m_flags = 0;
-	m_flags = 0;
-
-	m_useOffsetForConstraintFrame = USE_OFFSET_FOR_CONSTANT_FRAME;
-
-	calculateTransforms(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
-}
-
-
-
-
-
-btSliderConstraint::btSliderConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB, bool useLinearReferenceFrameA)
-        : btTypedConstraint(SLIDER_CONSTRAINT_TYPE, rbA, rbB),
-		m_useSolveConstraintObsolete(false),
-		m_frameInA(frameInA),
-        m_frameInB(frameInB),
-		m_useLinearReferenceFrameA(useLinearReferenceFrameA)
-{
-	initParams();
-}
-
-
-
-btSliderConstraint::btSliderConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameA)
-        : btTypedConstraint(SLIDER_CONSTRAINT_TYPE, getFixedBody(), rbB),
-		m_useSolveConstraintObsolete(false),
-		m_frameInB(frameInB),
-		m_useLinearReferenceFrameA(useLinearReferenceFrameA)
-{
-	///not providing rigidbody A means implicitly using worldspace for body A
-	m_frameInA = rbB.getCenterOfMassTransform() * m_frameInB;
-//	m_frameInA.getOrigin() = m_rbA.getCenterOfMassTransform()(m_frameInA.getOrigin());
-
-	initParams();
-}
-
-
-
-
-
-
-void btSliderConstraint::getInfo1(btConstraintInfo1* info)
-{
-	if (m_useSolveConstraintObsolete)
-	{
-		info->m_numConstraintRows = 0;
-		info->nub = 0;
-	}
-	else
-	{
-		info->m_numConstraintRows = 4; // Fixed 2 linear + 2 angular
-		info->nub = 2; 
-		//prepare constraint
-		calculateTransforms(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
-		testAngLimits();
-		testLinLimits();
-		if(getSolveLinLimit() || getPoweredLinMotor())
-		{
-			info->m_numConstraintRows++; // limit 3rd linear as well
-			info->nub--; 
-		}
-		if(getSolveAngLimit() || getPoweredAngMotor())
-		{
-			info->m_numConstraintRows++; // limit 3rd angular as well
-			info->nub--; 
-		}
-	}
-}
-
-void btSliderConstraint::getInfo1NonVirtual(btConstraintInfo1* info)
-{
-
-	info->m_numConstraintRows = 6; // Fixed 2 linear + 2 angular + 1 limit (even if not used)
-	info->nub = 0; 
-}
-
-void btSliderConstraint::getInfo2(btConstraintInfo2* info)
-{
-	getInfo2NonVirtual(info,m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform(), m_rbA.getLinearVelocity(),m_rbB.getLinearVelocity(), m_rbA.getInvMass(),m_rbB.getInvMass());
-}
-
-
-
-
-
-
-
-void btSliderConstraint::calculateTransforms(const btTransform& transA,const btTransform& transB)
-{
-	if(m_useLinearReferenceFrameA || (!m_useSolveConstraintObsolete))
-	{
-		m_calculatedTransformA = transA * m_frameInA;
-		m_calculatedTransformB = transB * m_frameInB;
-	}
-	else
-	{
-		m_calculatedTransformA = transB * m_frameInB;
-		m_calculatedTransformB = transA * m_frameInA;
-	}
-	m_realPivotAInW = m_calculatedTransformA.getOrigin();
-	m_realPivotBInW = m_calculatedTransformB.getOrigin();
-	m_sliderAxis = m_calculatedTransformA.getBasis().getColumn(0); // along X
-	if(m_useLinearReferenceFrameA || m_useSolveConstraintObsolete)
-	{
-		m_delta = m_realPivotBInW - m_realPivotAInW;
-	}
-	else
-	{
-		m_delta = m_realPivotAInW - m_realPivotBInW;
-	}
-	m_projPivotInW = m_realPivotAInW + m_sliderAxis.dot(m_delta) * m_sliderAxis;
-    btVector3 normalWorld;
-    int i;
-    //linear part
-    for(i = 0; i < 3; i++)
-    {
-		normalWorld = m_calculatedTransformA.getBasis().getColumn(i);
-		m_depth[i] = m_delta.dot(normalWorld);
-    }
-}
- 
-
-
-void btSliderConstraint::testLinLimits(void)
-{
-	m_solveLinLim = false;
-	m_linPos = m_depth[0];
-	if(m_lowerLinLimit <= m_upperLinLimit)
-	{
-		if(m_depth[0] > m_upperLinLimit)
-		{
-			m_depth[0] -= m_upperLinLimit;
-			m_solveLinLim = true;
-		}
-		else if(m_depth[0] < m_lowerLinLimit)
-		{
-			m_depth[0] -= m_lowerLinLimit;
-			m_solveLinLim = true;
-		}
-		else
-		{
-			m_depth[0] = btScalar(0.);
-		}
-	}
-	else
-	{
-		m_depth[0] = btScalar(0.);
-	}
-}
-
-
-
-void btSliderConstraint::testAngLimits(void)
-{
-	m_angDepth = btScalar(0.);
-	m_solveAngLim = false;
-	if(m_lowerAngLimit <= m_upperAngLimit)
-	{
-		const btVector3 axisA0 = m_calculatedTransformA.getBasis().getColumn(1);
-		const btVector3 axisA1 = m_calculatedTransformA.getBasis().getColumn(2);
-		const btVector3 axisB0 = m_calculatedTransformB.getBasis().getColumn(1);
-//		btScalar rot = btAtan2Fast(axisB0.dot(axisA1), axisB0.dot(axisA0));  
-		btScalar rot = btAtan2(axisB0.dot(axisA1), axisB0.dot(axisA0));  
-		rot = btAdjustAngleToLimits(rot, m_lowerAngLimit, m_upperAngLimit);
-		m_angPos = rot;
-		if(rot < m_lowerAngLimit)
-		{
-			m_angDepth = rot - m_lowerAngLimit;
-			m_solveAngLim = true;
-		} 
-		else if(rot > m_upperAngLimit)
-		{
-			m_angDepth = rot - m_upperAngLimit;
-			m_solveAngLim = true;
-		}
-	}
-}
-
-btVector3 btSliderConstraint::getAncorInA(void)
-{
-	btVector3 ancorInA;
-	ancorInA = m_realPivotAInW + (m_lowerLinLimit + m_upperLinLimit) * btScalar(0.5) * m_sliderAxis;
-	ancorInA = m_rbA.getCenterOfMassTransform().inverse() * ancorInA;
-	return ancorInA;
-}
-
-
-
-btVector3 btSliderConstraint::getAncorInB(void)
-{
-	btVector3 ancorInB;
-	ancorInB = m_frameInB.getOrigin();
-	return ancorInB;
-}
-
-
-void btSliderConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const btTransform& transA,const btTransform& transB, const btVector3& linVelA,const btVector3& linVelB, btScalar rbAinvMass,btScalar rbBinvMass  )
-{
-	const btTransform& trA = getCalculatedTransformA();
-	const btTransform& trB = getCalculatedTransformB();
-	
-	btAssert(!m_useSolveConstraintObsolete);
-	int i, s = info->rowskip;
-	
-	btScalar signFact = m_useLinearReferenceFrameA ? btScalar(1.0f) : btScalar(-1.0f);
-	
-	// difference between frames in WCS
-	btVector3 ofs = trB.getOrigin() - trA.getOrigin();
-	// now get weight factors depending on masses
-	btScalar miA = rbAinvMass;
-	btScalar miB = rbBinvMass;
-	bool hasStaticBody = (miA < SIMD_EPSILON) || (miB < SIMD_EPSILON);
-	btScalar miS = miA + miB;
-	btScalar factA, factB;
-	if(miS > btScalar(0.f))
-	{
-		factA = miB / miS;
-	}
-	else 
-	{
-		factA = btScalar(0.5f);
-	}
-	factB = btScalar(1.0f) - factA;
-	btVector3 ax1, p, q;
-	btVector3 ax1A = trA.getBasis().getColumn(0);
-	btVector3 ax1B = trB.getBasis().getColumn(0);
-	if(m_useOffsetForConstraintFrame)
-	{
-		// get the desired direction of slider axis
-		// as weighted sum of X-orthos of frameA and frameB in WCS
-		ax1 = ax1A * factA + ax1B * factB;
-		ax1.normalize();
-		// construct two orthos to slider axis
-		btPlaneSpace1 (ax1, p, q);
-	}
-	else
-	{ // old way - use frameA
-		ax1 = trA.getBasis().getColumn(0);
-		// get 2 orthos to slider axis (Y, Z)
-		p = trA.getBasis().getColumn(1);
-		q = trA.getBasis().getColumn(2);
-	}
-	// make rotations around these orthos equal
-	// the slider axis should be the only unconstrained
-	// rotational axis, the angular velocity of the two bodies perpendicular to
-	// the slider axis should be equal. thus the constraint equations are
-	//    p*w1 - p*w2 = 0
-	//    q*w1 - q*w2 = 0
-	// where p and q are unit vectors normal to the slider axis, and w1 and w2
-	// are the angular velocity vectors of the two bodies.
-	info->m_J1angularAxis[0] = p[0];
-	info->m_J1angularAxis[1] = p[1];
-	info->m_J1angularAxis[2] = p[2];
-	info->m_J1angularAxis[s+0] = q[0];
-	info->m_J1angularAxis[s+1] = q[1];
-	info->m_J1angularAxis[s+2] = q[2];
-
-	info->m_J2angularAxis[0] = -p[0];
-	info->m_J2angularAxis[1] = -p[1];
-	info->m_J2angularAxis[2] = -p[2];
-	info->m_J2angularAxis[s+0] = -q[0];
-	info->m_J2angularAxis[s+1] = -q[1];
-	info->m_J2angularAxis[s+2] = -q[2];
-	// compute the right hand side of the constraint equation. set relative
-	// body velocities along p and q to bring the slider back into alignment.
-	// if ax1A,ax1B are the unit length slider axes as computed from bodyA and
-	// bodyB, we need to rotate both bodies along the axis u = (ax1 x ax2).
-	// if "theta" is the angle between ax1 and ax2, we need an angular velocity
-	// along u to cover angle erp*theta in one step :
-	//   |angular_velocity| = angle/time = erp*theta / stepsize
-	//                      = (erp*fps) * theta
-	//    angular_velocity  = |angular_velocity| * (ax1 x ax2) / |ax1 x ax2|
-	//                      = (erp*fps) * theta * (ax1 x ax2) / sin(theta)
-	// ...as ax1 and ax2 are unit length. if theta is smallish,
-	// theta ~= sin(theta), so
-	//    angular_velocity  = (erp*fps) * (ax1 x ax2)
-	// ax1 x ax2 is in the plane space of ax1, so we project the angular
-	// velocity to p and q to find the right hand side.
-//	btScalar k = info->fps * info->erp * getSoftnessOrthoAng();
-	btScalar currERP = (m_flags & BT_SLIDER_FLAGS_ERP_ORTANG) ? m_softnessOrthoAng : m_softnessOrthoAng * info->erp;
-	btScalar k = info->fps * currERP;
-
-	btVector3 u = ax1A.cross(ax1B);
-	info->m_constraintError[0] = k * u.dot(p);
-	info->m_constraintError[s] = k * u.dot(q);
-	if(m_flags & BT_SLIDER_FLAGS_CFM_ORTANG)
-	{
-		info->cfm[0] = m_cfmOrthoAng;
-		info->cfm[s] = m_cfmOrthoAng;
-	}
-
-	int nrow = 1; // last filled row
-	int srow;
-	btScalar limit_err;
-	int limit;
-	int powered;
-
-	// next two rows. 
-	// we want: velA + wA x relA == velB + wB x relB ... but this would
-	// result in three equations, so we project along two orthos to the slider axis
-
-	btTransform bodyA_trans = transA;
-	btTransform bodyB_trans = transB;
-	nrow++;
-	int s2 = nrow * s;
-	nrow++;
-	int s3 = nrow * s;
-	btVector3 tmpA(0,0,0), tmpB(0,0,0), relA(0,0,0), relB(0,0,0), c(0,0,0);
-	if(m_useOffsetForConstraintFrame)
-	{
-		// get vector from bodyB to frameB in WCS
-		relB = trB.getOrigin() - bodyB_trans.getOrigin();
-		// get its projection to slider axis
-		btVector3 projB = ax1 * relB.dot(ax1);
-		// get vector directed from bodyB to slider axis (and orthogonal to it)
-		btVector3 orthoB = relB - projB;
-		// same for bodyA
-		relA = trA.getOrigin() - bodyA_trans.getOrigin();
-		btVector3 projA = ax1 * relA.dot(ax1);
-		btVector3 orthoA = relA - projA;
-		// get desired offset between frames A and B along slider axis
-		btScalar sliderOffs = m_linPos - m_depth[0];
-		// desired vector from projection of center of bodyA to projection of center of bodyB to slider axis
-		btVector3 totalDist = projA + ax1 * sliderOffs - projB;
-		// get offset vectors relA and relB
-		relA = orthoA + totalDist * factA;
-		relB = orthoB - totalDist * factB;
-		// now choose average ortho to slider axis
-		p = orthoB * factA + orthoA * factB;
-		btScalar len2 = p.length2();
-		if(len2 > SIMD_EPSILON)
-		{
-			p /= btSqrt(len2);
-		}
-		else
-		{
-			p = trA.getBasis().getColumn(1);
-		}
-		// make one more ortho
-		q = ax1.cross(p);
-		// fill two rows
-		tmpA = relA.cross(p);
-		tmpB = relB.cross(p);
-		for (i=0; i<3; i++) info->m_J1angularAxis[s2+i] = tmpA[i];
-		for (i=0; i<3; i++) info->m_J2angularAxis[s2+i] = -tmpB[i];
-		tmpA = relA.cross(q);
-		tmpB = relB.cross(q);
-		if(hasStaticBody && getSolveAngLimit())
-		{ // to make constraint between static and dynamic objects more rigid
-			// remove wA (or wB) from equation if angular limit is hit
-			tmpB *= factB;
-			tmpA *= factA;
-		}
-		for (i=0; i<3; i++) info->m_J1angularAxis[s3+i] = tmpA[i];
-		for (i=0; i<3; i++) info->m_J2angularAxis[s3+i] = -tmpB[i];
-		for (i=0; i<3; i++) info->m_J1linearAxis[s2+i] = p[i];
-		for (i=0; i<3; i++) info->m_J1linearAxis[s3+i] = q[i];
-	}
-	else
-	{	// old way - maybe incorrect if bodies are not on the slider axis
-		// see discussion "Bug in slider constraint" http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=4024&start=0
-		c = bodyB_trans.getOrigin() - bodyA_trans.getOrigin();
-		btVector3 tmp = c.cross(p);
-		for (i=0; i<3; i++) info->m_J1angularAxis[s2+i] = factA*tmp[i];
-		for (i=0; i<3; i++) info->m_J2angularAxis[s2+i] = factB*tmp[i];
-		tmp = c.cross(q);
-		for (i=0; i<3; i++) info->m_J1angularAxis[s3+i] = factA*tmp[i];
-		for (i=0; i<3; i++) info->m_J2angularAxis[s3+i] = factB*tmp[i];
-
-		for (i=0; i<3; i++) info->m_J1linearAxis[s2+i] = p[i];
-		for (i=0; i<3; i++) info->m_J1linearAxis[s3+i] = q[i];
-	}
-	// compute two elements of right hand side
-
-	//	k = info->fps * info->erp * getSoftnessOrthoLin();
-	currERP = (m_flags & BT_SLIDER_FLAGS_ERP_ORTLIN) ? m_softnessOrthoLin : m_softnessOrthoLin * info->erp;
-	k = info->fps * currERP;
-
-	btScalar rhs = k * p.dot(ofs);
-	info->m_constraintError[s2] = rhs;
-	rhs = k * q.dot(ofs);
-	info->m_constraintError[s3] = rhs;
-	if(m_flags & BT_SLIDER_FLAGS_CFM_ORTLIN)
-	{
-		info->cfm[s2] = m_cfmOrthoLin;
-		info->cfm[s3] = m_cfmOrthoLin;
-	}
-
-
-	// check linear limits
-	limit_err = btScalar(0.0);
-	limit = 0;
-	if(getSolveLinLimit())
-	{
-		limit_err = getLinDepth() *  signFact;
-		limit = (limit_err > btScalar(0.0)) ? 2 : 1;
-	}
-	powered = 0;
-	if(getPoweredLinMotor())
-	{
-		powered = 1;
-	}
-	// if the slider has joint limits or motor, add in the extra row
-	if (limit || powered) 
-	{
-		nrow++;
-		srow = nrow * info->rowskip;
-		info->m_J1linearAxis[srow+0] = ax1[0];
-		info->m_J1linearAxis[srow+1] = ax1[1];
-		info->m_J1linearAxis[srow+2] = ax1[2];
-		// linear torque decoupling step:
-		//
-		// we have to be careful that the linear constraint forces (+/- ax1) applied to the two bodies
-		// do not create a torque couple. in other words, the points that the
-		// constraint force is applied at must lie along the same ax1 axis.
-		// a torque couple will result in limited slider-jointed free
-		// bodies from gaining angular momentum.
-		if(m_useOffsetForConstraintFrame)
-		{
-			// this is needed only when bodyA and bodyB are both dynamic.
-			if(!hasStaticBody)
-			{
-				tmpA = relA.cross(ax1);
-				tmpB = relB.cross(ax1);
-				info->m_J1angularAxis[srow+0] = tmpA[0];
-				info->m_J1angularAxis[srow+1] = tmpA[1];
-				info->m_J1angularAxis[srow+2] = tmpA[2];
-				info->m_J2angularAxis[srow+0] = -tmpB[0];
-				info->m_J2angularAxis[srow+1] = -tmpB[1];
-				info->m_J2angularAxis[srow+2] = -tmpB[2];
-			}
-		}
-		else
-		{ // The old way. May be incorrect if bodies are not on the slider axis
-			btVector3 ltd;	// Linear Torque Decoupling vector (a torque)
-			ltd = c.cross(ax1);
-			info->m_J1angularAxis[srow+0] = factA*ltd[0];
-			info->m_J1angularAxis[srow+1] = factA*ltd[1];
-			info->m_J1angularAxis[srow+2] = factA*ltd[2];
-			info->m_J2angularAxis[srow+0] = factB*ltd[0];
-			info->m_J2angularAxis[srow+1] = factB*ltd[1];
-			info->m_J2angularAxis[srow+2] = factB*ltd[2];
-		}
-		// right-hand part
-		btScalar lostop = getLowerLinLimit();
-		btScalar histop = getUpperLinLimit();
-		if(limit && (lostop == histop))
-		{  // the joint motor is ineffective
-			powered = 0;
-		}
-		info->m_constraintError[srow] = 0.;
-		info->m_lowerLimit[srow] = 0.;
-		info->m_upperLimit[srow] = 0.;
-		currERP = (m_flags & BT_SLIDER_FLAGS_ERP_LIMLIN) ? m_softnessLimLin : info->erp;
-		if(powered)
-		{
-			if(m_flags & BT_SLIDER_FLAGS_CFM_DIRLIN)
-			{
-				info->cfm[srow] = m_cfmDirLin;
-			}
-			btScalar tag_vel = getTargetLinMotorVelocity();
-			btScalar mot_fact = getMotorFactor(m_linPos, m_lowerLinLimit, m_upperLinLimit, tag_vel, info->fps * currERP);
-			info->m_constraintError[srow] -= signFact * mot_fact * getTargetLinMotorVelocity();
-			info->m_lowerLimit[srow] += -getMaxLinMotorForce() * info->fps;
-			info->m_upperLimit[srow] += getMaxLinMotorForce() * info->fps;
-		}
-		if(limit)
-		{
-			k = info->fps * currERP;
-			info->m_constraintError[srow] += k * limit_err;
-			if(m_flags & BT_SLIDER_FLAGS_CFM_LIMLIN)
-			{
-				info->cfm[srow] = m_cfmLimLin;
-			}
-			if(lostop == histop) 
-			{	// limited low and high simultaneously
-				info->m_lowerLimit[srow] = -SIMD_INFINITY;
-				info->m_upperLimit[srow] = SIMD_INFINITY;
-			}
-			else if(limit == 1) 
-			{ // low limit
-				info->m_lowerLimit[srow] = -SIMD_INFINITY;
-				info->m_upperLimit[srow] = 0;
-			}
-			else 
-			{ // high limit
-				info->m_lowerLimit[srow] = 0;
-				info->m_upperLimit[srow] = SIMD_INFINITY;
-			}
-			// bounce (we'll use slider parameter abs(1.0 - m_dampingLimLin) for that)
-			btScalar bounce = btFabs(btScalar(1.0) - getDampingLimLin());
-			if(bounce > btScalar(0.0))
-			{
-				btScalar vel = linVelA.dot(ax1);
-				vel -= linVelB.dot(ax1);
-				vel *= signFact;
-				// only apply bounce if the velocity is incoming, and if the
-				// resulting c[] exceeds what we already have.
-				if(limit == 1)
-				{	// low limit
-					if(vel < 0)
-					{
-						btScalar newc = -bounce * vel;
-						if (newc > info->m_constraintError[srow])
-						{
-							info->m_constraintError[srow] = newc;
-						}
-					}
-				}
-				else
-				{ // high limit - all those computations are reversed
-					if(vel > 0)
-					{
-						btScalar newc = -bounce * vel;
-						if(newc < info->m_constraintError[srow]) 
-						{
-							info->m_constraintError[srow] = newc;
-						}
-					}
-				}
-			}
-			info->m_constraintError[srow] *= getSoftnessLimLin();
-		} // if(limit)
-	} // if linear limit
-	// check angular limits
-	limit_err = btScalar(0.0);
-	limit = 0;
-	if(getSolveAngLimit())
-	{
-		limit_err = getAngDepth();
-		limit = (limit_err > btScalar(0.0)) ? 1 : 2;
-	}
-	// if the slider has joint limits, add in the extra row
-	powered = 0;
-	if(getPoweredAngMotor())
-	{
-		powered = 1;
-	}
-	if(limit || powered) 
-	{
-		nrow++;
-		srow = nrow * info->rowskip;
-		info->m_J1angularAxis[srow+0] = ax1[0];
-		info->m_J1angularAxis[srow+1] = ax1[1];
-		info->m_J1angularAxis[srow+2] = ax1[2];
-
-		info->m_J2angularAxis[srow+0] = -ax1[0];
-		info->m_J2angularAxis[srow+1] = -ax1[1];
-		info->m_J2angularAxis[srow+2] = -ax1[2];
-
-		btScalar lostop = getLowerAngLimit();
-		btScalar histop = getUpperAngLimit();
-		if(limit && (lostop == histop))
-		{  // the joint motor is ineffective
-			powered = 0;
-		}
-		currERP = (m_flags & BT_SLIDER_FLAGS_ERP_LIMANG) ? m_softnessLimAng : info->erp;
-		if(powered)
-		{
-			if(m_flags & BT_SLIDER_FLAGS_CFM_DIRANG)
-			{
-				info->cfm[srow] = m_cfmDirAng;
-			}
-			btScalar mot_fact = getMotorFactor(m_angPos, m_lowerAngLimit, m_upperAngLimit, getTargetAngMotorVelocity(), info->fps * currERP);
-			info->m_constraintError[srow] = mot_fact * getTargetAngMotorVelocity();
-			info->m_lowerLimit[srow] = -getMaxAngMotorForce() * info->fps;
-			info->m_upperLimit[srow] = getMaxAngMotorForce() * info->fps;
-		}
-		if(limit)
-		{
-			k = info->fps * currERP;
-			info->m_constraintError[srow] += k * limit_err;
-			if(m_flags & BT_SLIDER_FLAGS_CFM_LIMANG)
-			{
-				info->cfm[srow] = m_cfmLimAng;
-			}
-			if(lostop == histop) 
-			{
-				// limited low and high simultaneously
-				info->m_lowerLimit[srow] = -SIMD_INFINITY;
-				info->m_upperLimit[srow] = SIMD_INFINITY;
-			}
-			else if(limit == 1) 
-			{ // low limit
-				info->m_lowerLimit[srow] = 0;
-				info->m_upperLimit[srow] = SIMD_INFINITY;
-			}
-			else 
-			{ // high limit
-				info->m_lowerLimit[srow] = -SIMD_INFINITY;
-				info->m_upperLimit[srow] = 0;
-			}
-			// bounce (we'll use slider parameter abs(1.0 - m_dampingLimAng) for that)
-			btScalar bounce = btFabs(btScalar(1.0) - getDampingLimAng());
-			if(bounce > btScalar(0.0))
-			{
-				btScalar vel = m_rbA.getAngularVelocity().dot(ax1);
-				vel -= m_rbB.getAngularVelocity().dot(ax1);
-				// only apply bounce if the velocity is incoming, and if the
-				// resulting c[] exceeds what we already have.
-				if(limit == 1)
-				{	// low limit
-					if(vel < 0)
-					{
-						btScalar newc = -bounce * vel;
-						if(newc > info->m_constraintError[srow])
-						{
-							info->m_constraintError[srow] = newc;
-						}
-					}
-				}
-				else
-				{	// high limit - all those computations are reversed
-					if(vel > 0)
-					{
-						btScalar newc = -bounce * vel;
-						if(newc < info->m_constraintError[srow])
-						{
-							info->m_constraintError[srow] = newc;
-						}
-					}
-				}
-			}
-			info->m_constraintError[srow] *= getSoftnessLimAng();
-		} // if(limit)
-	} // if angular limit or powered
-}
-
-
-///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
-///If no axis is provided, it uses the default axis for this constraint.
-void btSliderConstraint::setParam(int num, btScalar value, int axis)
-{
-	switch(num)
-	{
-	case BT_CONSTRAINT_STOP_ERP :
-		if(axis < 1)
-		{
-			m_softnessLimLin = value;
-			m_flags |= BT_SLIDER_FLAGS_ERP_LIMLIN;
-		}
-		else if(axis < 3)
-		{
-			m_softnessOrthoLin = value;
-			m_flags |= BT_SLIDER_FLAGS_ERP_ORTLIN;
-		}
-		else if(axis == 3)
-		{
-			m_softnessLimAng = value;
-			m_flags |= BT_SLIDER_FLAGS_ERP_LIMANG;
-		}
-		else if(axis < 6)
-		{
-			m_softnessOrthoAng = value;
-			m_flags |= BT_SLIDER_FLAGS_ERP_ORTANG;
-		}
-		else
-		{
-			btAssertConstrParams(0);
-		}
-		break;
-	case BT_CONSTRAINT_CFM :
-		if(axis < 1)
-		{
-			m_cfmDirLin = value;
-			m_flags |= BT_SLIDER_FLAGS_CFM_DIRLIN;
-		}
-		else if(axis == 3)
-		{
-			m_cfmDirAng = value;
-			m_flags |= BT_SLIDER_FLAGS_CFM_DIRANG;
-		}
-		else
-		{
-			btAssertConstrParams(0);
-		}
-		break;
-	case BT_CONSTRAINT_STOP_CFM :
-		if(axis < 1)
-		{
-			m_cfmLimLin = value;
-			m_flags |= BT_SLIDER_FLAGS_CFM_LIMLIN;
-		}
-		else if(axis < 3)
-		{
-			m_cfmOrthoLin = value;
-			m_flags |= BT_SLIDER_FLAGS_CFM_ORTLIN;
-		}
-		else if(axis == 3)
-		{
-			m_cfmLimAng = value;
-			m_flags |= BT_SLIDER_FLAGS_CFM_LIMANG;
-		}
-		else if(axis < 6)
-		{
-			m_cfmOrthoAng = value;
-			m_flags |= BT_SLIDER_FLAGS_CFM_ORTANG;
-		}
-		else
-		{
-			btAssertConstrParams(0);
-		}
-		break;
-	}
-}
-
-///return the local value of parameter
-btScalar btSliderConstraint::getParam(int num, int axis) const 
-{
-	btScalar retVal(SIMD_INFINITY);
-	switch(num)
-	{
-	case BT_CONSTRAINT_STOP_ERP :
-		if(axis < 1)
-		{
-			btAssertConstrParams(m_flags & BT_SLIDER_FLAGS_ERP_LIMLIN);
-			retVal = m_softnessLimLin;
-		}
-		else if(axis < 3)
-		{
-			btAssertConstrParams(m_flags & BT_SLIDER_FLAGS_ERP_ORTLIN);
-			retVal = m_softnessOrthoLin;
-		}
-		else if(axis == 3)
-		{
-			btAssertConstrParams(m_flags & BT_SLIDER_FLAGS_ERP_LIMANG);
-			retVal = m_softnessLimAng;
-		}
-		else if(axis < 6)
-		{
-			btAssertConstrParams(m_flags & BT_SLIDER_FLAGS_ERP_ORTANG);
-			retVal = m_softnessOrthoAng;
-		}
-		else
-		{
-			btAssertConstrParams(0);
-		}
-		break;
-	case BT_CONSTRAINT_CFM :
-		if(axis < 1)
-		{
-			btAssertConstrParams(m_flags & BT_SLIDER_FLAGS_CFM_DIRLIN);
-			retVal = m_cfmDirLin;
-		}
-		else if(axis == 3)
-		{
-			btAssertConstrParams(m_flags & BT_SLIDER_FLAGS_CFM_DIRANG);
-			retVal = m_cfmDirAng;
-		}
-		else
-		{
-			btAssertConstrParams(0);
-		}
-		break;
-	case BT_CONSTRAINT_STOP_CFM :
-		if(axis < 1)
-		{
-			btAssertConstrParams(m_flags & BT_SLIDER_FLAGS_CFM_LIMLIN);
-			retVal = m_cfmLimLin;
-		}
-		else if(axis < 3)
-		{
-			btAssertConstrParams(m_flags & BT_SLIDER_FLAGS_CFM_ORTLIN);
-			retVal = m_cfmOrthoLin;
-		}
-		else if(axis == 3)
-		{
-			btAssertConstrParams(m_flags & BT_SLIDER_FLAGS_CFM_LIMANG);
-			retVal = m_cfmLimAng;
-		}
-		else if(axis < 6)
-		{
-			btAssertConstrParams(m_flags & BT_SLIDER_FLAGS_CFM_ORTANG);
-			retVal = m_cfmOrthoAng;
-		}
-		else
-		{
-			btAssertConstrParams(0);
-		}
-		break;
-	}
-	return retVal;
-}
-
-
-
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSliderConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSliderConstraint.h
deleted file mode 100755
index 2edc8d2..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSliderConstraint.h
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
-Added by Roman Ponomarev (rponom at gmail.com)
-April 04, 2008
-
-TODO:
- - add clamping od accumulated impulse to improve stability
- - add conversion for ODE constraint solver
-*/
-
-#ifndef BT_SLIDER_CONSTRAINT_H
-#define BT_SLIDER_CONSTRAINT_H
-
-
-
-#include "LinearMath/btVector3.h"
-#include "btJacobianEntry.h"
-#include "btTypedConstraint.h"
-
-
-
-class btRigidBody;
-
-
-
-#define SLIDER_CONSTRAINT_DEF_SOFTNESS		(btScalar(1.0))
-#define SLIDER_CONSTRAINT_DEF_DAMPING		(btScalar(1.0))
-#define SLIDER_CONSTRAINT_DEF_RESTITUTION	(btScalar(0.7))
-#define SLIDER_CONSTRAINT_DEF_CFM			(btScalar(0.f))
-
-
-enum btSliderFlags
-{
-	BT_SLIDER_FLAGS_CFM_DIRLIN = (1 << 0),
-	BT_SLIDER_FLAGS_ERP_DIRLIN = (1 << 1),
-	BT_SLIDER_FLAGS_CFM_DIRANG = (1 << 2),
-	BT_SLIDER_FLAGS_ERP_DIRANG = (1 << 3),
-	BT_SLIDER_FLAGS_CFM_ORTLIN = (1 << 4),
-	BT_SLIDER_FLAGS_ERP_ORTLIN = (1 << 5),
-	BT_SLIDER_FLAGS_CFM_ORTANG = (1 << 6),
-	BT_SLIDER_FLAGS_ERP_ORTANG = (1 << 7),
-	BT_SLIDER_FLAGS_CFM_LIMLIN = (1 << 8),
-	BT_SLIDER_FLAGS_ERP_LIMLIN = (1 << 9),
-	BT_SLIDER_FLAGS_CFM_LIMANG = (1 << 10),
-	BT_SLIDER_FLAGS_ERP_LIMANG = (1 << 11)
-};
-
-
-class btSliderConstraint : public btTypedConstraint
-{
-protected:
-	///for backwards compatibility during the transition to 'getInfo/getInfo2'
-	bool		m_useSolveConstraintObsolete;
-	bool		m_useOffsetForConstraintFrame;
-	btTransform	m_frameInA;
-    btTransform	m_frameInB;
-	// use frameA fo define limits, if true
-	bool m_useLinearReferenceFrameA;
-	// linear limits
-	btScalar m_lowerLinLimit;
-	btScalar m_upperLinLimit;
-	// angular limits
-	btScalar m_lowerAngLimit;
-	btScalar m_upperAngLimit;
-	// softness, restitution and damping for different cases
-	// DirLin - moving inside linear limits
-	// LimLin - hitting linear limit
-	// DirAng - moving inside angular limits
-	// LimAng - hitting angular limit
-	// OrthoLin, OrthoAng - against constraint axis
-	btScalar m_softnessDirLin;
-	btScalar m_restitutionDirLin;
-	btScalar m_dampingDirLin;
-	btScalar m_cfmDirLin;
-
-	btScalar m_softnessDirAng;
-	btScalar m_restitutionDirAng;
-	btScalar m_dampingDirAng;
-	btScalar m_cfmDirAng;
-
-	btScalar m_softnessLimLin;
-	btScalar m_restitutionLimLin;
-	btScalar m_dampingLimLin;
-	btScalar m_cfmLimLin;
-
-	btScalar m_softnessLimAng;
-	btScalar m_restitutionLimAng;
-	btScalar m_dampingLimAng;
-	btScalar m_cfmLimAng;
-
-	btScalar m_softnessOrthoLin;
-	btScalar m_restitutionOrthoLin;
-	btScalar m_dampingOrthoLin;
-	btScalar m_cfmOrthoLin;
-
-	btScalar m_softnessOrthoAng;
-	btScalar m_restitutionOrthoAng;
-	btScalar m_dampingOrthoAng;
-	btScalar m_cfmOrthoAng;
-	
-	// for interlal use
-	bool m_solveLinLim;
-	bool m_solveAngLim;
-
-	int m_flags;
-
-	btJacobianEntry	m_jacLin[3];
-	btScalar		m_jacLinDiagABInv[3];
-
-    btJacobianEntry	m_jacAng[3];
-
-	btScalar m_timeStep;
-    btTransform m_calculatedTransformA;
-    btTransform m_calculatedTransformB;
-
-	btVector3 m_sliderAxis;
-	btVector3 m_realPivotAInW;
-	btVector3 m_realPivotBInW;
-	btVector3 m_projPivotInW;
-	btVector3 m_delta;
-	btVector3 m_depth;
-	btVector3 m_relPosA;
-	btVector3 m_relPosB;
-
-	btScalar m_linPos;
-	btScalar m_angPos;
-
-	btScalar m_angDepth;
-	btScalar m_kAngle;
-
-	bool	 m_poweredLinMotor;
-    btScalar m_targetLinMotorVelocity;
-    btScalar m_maxLinMotorForce;
-    btScalar m_accumulatedLinMotorImpulse;
-	
-	bool	 m_poweredAngMotor;
-    btScalar m_targetAngMotorVelocity;
-    btScalar m_maxAngMotorForce;
-    btScalar m_accumulatedAngMotorImpulse;
-
-	//------------------------    
-	void initParams();
-public:
-	// constructors
-    btSliderConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA);
-    btSliderConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameA);
-
-	// overrides
-
-    virtual void getInfo1 (btConstraintInfo1* info);
-
-	void getInfo1NonVirtual(btConstraintInfo1* info);
-	
-	virtual void getInfo2 (btConstraintInfo2* info);
-
-	void getInfo2NonVirtual(btConstraintInfo2* info, const btTransform& transA, const btTransform& transB,const btVector3& linVelA,const btVector3& linVelB, btScalar rbAinvMass,btScalar rbBinvMass);
-
-
-	// access
-    const btRigidBody& getRigidBodyA() const { return m_rbA; }
-    const btRigidBody& getRigidBodyB() const { return m_rbB; }
-    const btTransform & getCalculatedTransformA() const { return m_calculatedTransformA; }
-    const btTransform & getCalculatedTransformB() const { return m_calculatedTransformB; }
-    const btTransform & getFrameOffsetA() const { return m_frameInA; }
-    const btTransform & getFrameOffsetB() const { return m_frameInB; }
-    btTransform & getFrameOffsetA() { return m_frameInA; }
-    btTransform & getFrameOffsetB() { return m_frameInB; }
-    btScalar getLowerLinLimit() { return m_lowerLinLimit; }
-    void setLowerLinLimit(btScalar lowerLimit) { m_lowerLinLimit = lowerLimit; }
-    btScalar getUpperLinLimit() { return m_upperLinLimit; }
-    void setUpperLinLimit(btScalar upperLimit) { m_upperLinLimit = upperLimit; }
-    btScalar getLowerAngLimit() { return m_lowerAngLimit; }
-    void setLowerAngLimit(btScalar lowerLimit) { m_lowerAngLimit = btNormalizeAngle(lowerLimit); }
-    btScalar getUpperAngLimit() { return m_upperAngLimit; }
-    void setUpperAngLimit(btScalar upperLimit) { m_upperAngLimit = btNormalizeAngle(upperLimit); }
-	bool getUseLinearReferenceFrameA() { return m_useLinearReferenceFrameA; }
-	btScalar getSoftnessDirLin() { return m_softnessDirLin; }
-	btScalar getRestitutionDirLin() { return m_restitutionDirLin; }
-	btScalar getDampingDirLin() { return m_dampingDirLin ; }
-	btScalar getSoftnessDirAng() { return m_softnessDirAng; }
-	btScalar getRestitutionDirAng() { return m_restitutionDirAng; }
-	btScalar getDampingDirAng() { return m_dampingDirAng; }
-	btScalar getSoftnessLimLin() { return m_softnessLimLin; }
-	btScalar getRestitutionLimLin() { return m_restitutionLimLin; }
-	btScalar getDampingLimLin() { return m_dampingLimLin; }
-	btScalar getSoftnessLimAng() { return m_softnessLimAng; }
-	btScalar getRestitutionLimAng() { return m_restitutionLimAng; }
-	btScalar getDampingLimAng() { return m_dampingLimAng; }
-	btScalar getSoftnessOrthoLin() { return m_softnessOrthoLin; }
-	btScalar getRestitutionOrthoLin() { return m_restitutionOrthoLin; }
-	btScalar getDampingOrthoLin() { return m_dampingOrthoLin; }
-	btScalar getSoftnessOrthoAng() { return m_softnessOrthoAng; }
-	btScalar getRestitutionOrthoAng() { return m_restitutionOrthoAng; }
-	btScalar getDampingOrthoAng() { return m_dampingOrthoAng; }
-	void setSoftnessDirLin(btScalar softnessDirLin) { m_softnessDirLin = softnessDirLin; }
-	void setRestitutionDirLin(btScalar restitutionDirLin) { m_restitutionDirLin = restitutionDirLin; }
-	void setDampingDirLin(btScalar dampingDirLin) { m_dampingDirLin = dampingDirLin; }
-	void setSoftnessDirAng(btScalar softnessDirAng) { m_softnessDirAng = softnessDirAng; }
-	void setRestitutionDirAng(btScalar restitutionDirAng) { m_restitutionDirAng = restitutionDirAng; }
-	void setDampingDirAng(btScalar dampingDirAng) { m_dampingDirAng = dampingDirAng; }
-	void setSoftnessLimLin(btScalar softnessLimLin) { m_softnessLimLin = softnessLimLin; }
-	void setRestitutionLimLin(btScalar restitutionLimLin) { m_restitutionLimLin = restitutionLimLin; }
-	void setDampingLimLin(btScalar dampingLimLin) { m_dampingLimLin = dampingLimLin; }
-	void setSoftnessLimAng(btScalar softnessLimAng) { m_softnessLimAng = softnessLimAng; }
-	void setRestitutionLimAng(btScalar restitutionLimAng) { m_restitutionLimAng = restitutionLimAng; }
-	void setDampingLimAng(btScalar dampingLimAng) { m_dampingLimAng = dampingLimAng; }
-	void setSoftnessOrthoLin(btScalar softnessOrthoLin) { m_softnessOrthoLin = softnessOrthoLin; }
-	void setRestitutionOrthoLin(btScalar restitutionOrthoLin) { m_restitutionOrthoLin = restitutionOrthoLin; }
-	void setDampingOrthoLin(btScalar dampingOrthoLin) { m_dampingOrthoLin = dampingOrthoLin; }
-	void setSoftnessOrthoAng(btScalar softnessOrthoAng) { m_softnessOrthoAng = softnessOrthoAng; }
-	void setRestitutionOrthoAng(btScalar restitutionOrthoAng) { m_restitutionOrthoAng = restitutionOrthoAng; }
-	void setDampingOrthoAng(btScalar dampingOrthoAng) { m_dampingOrthoAng = dampingOrthoAng; }
-	void setPoweredLinMotor(bool onOff) { m_poweredLinMotor = onOff; }
-	bool getPoweredLinMotor() { return m_poweredLinMotor; }
-	void setTargetLinMotorVelocity(btScalar targetLinMotorVelocity) { m_targetLinMotorVelocity = targetLinMotorVelocity; }
-	btScalar getTargetLinMotorVelocity() { return m_targetLinMotorVelocity; }
-	void setMaxLinMotorForce(btScalar maxLinMotorForce) { m_maxLinMotorForce = maxLinMotorForce; }
-	btScalar getMaxLinMotorForce() { return m_maxLinMotorForce; }
-	void setPoweredAngMotor(bool onOff) { m_poweredAngMotor = onOff; }
-	bool getPoweredAngMotor() { return m_poweredAngMotor; }
-	void setTargetAngMotorVelocity(btScalar targetAngMotorVelocity) { m_targetAngMotorVelocity = targetAngMotorVelocity; }
-	btScalar getTargetAngMotorVelocity() { return m_targetAngMotorVelocity; }
-	void setMaxAngMotorForce(btScalar maxAngMotorForce) { m_maxAngMotorForce = maxAngMotorForce; }
-	btScalar getMaxAngMotorForce() { return m_maxAngMotorForce; }
-
-	btScalar getLinearPos() const { return m_linPos; }
-	btScalar getAngularPos() const { return m_angPos; }
-	
-	
-
-	// access for ODE solver
-	bool getSolveLinLimit() { return m_solveLinLim; }
-	btScalar getLinDepth() { return m_depth[0]; }
-	bool getSolveAngLimit() { return m_solveAngLim; }
-	btScalar getAngDepth() { return m_angDepth; }
-	// shared code used by ODE solver
-	void	calculateTransforms(const btTransform& transA,const btTransform& transB);
-	void	testLinLimits();
-	void	testAngLimits();
-	// access for PE Solver
-	btVector3 getAncorInA();
-	btVector3 getAncorInB();
-	// access for UseFrameOffset
-	bool getUseFrameOffset() { return m_useOffsetForConstraintFrame; }
-	void setUseFrameOffset(bool frameOffsetOnOff) { m_useOffsetForConstraintFrame = frameOffsetOnOff; }
-
-	void setFrames(const btTransform& frameA, const btTransform& frameB) 
-	{ 
-		m_frameInA=frameA; 
-		m_frameInB=frameB;
-		calculateTransforms(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
-		buildJacobian();
-	} 
-
-
-	///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
-	///If no axis is provided, it uses the default axis for this constraint.
-	virtual	void	setParam(int num, btScalar value, int axis = -1);
-	///return the local value of parameter
-	virtual	btScalar getParam(int num, int axis = -1) const;
-
-	virtual	int	calculateSerializeBufferSize() const;
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
-
-
-};
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct btSliderConstraintData
-{
-	btTypedConstraintData	m_typeConstraintData;
-	btTransformFloatData m_rbAFrame; // constraint axii. Assumes z is hinge axis.
-	btTransformFloatData m_rbBFrame;
-	
-	float	m_linearUpperLimit;
-	float	m_linearLowerLimit;
-
-	float	m_angularUpperLimit;
-	float	m_angularLowerLimit;
-
-	int	m_useLinearReferenceFrameA;
-	int m_useOffsetForConstraintFrame;
-
-};
-
-
-SIMD_FORCE_INLINE		int	btSliderConstraint::calculateSerializeBufferSize() const
-{
-	return sizeof(btSliderConstraintData);
-}
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-SIMD_FORCE_INLINE	const char*	btSliderConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-
-	btSliderConstraintData* sliderData = (btSliderConstraintData*) dataBuffer;
-	btTypedConstraint::serialize(&sliderData->m_typeConstraintData,serializer);
-
-	m_frameInA.serializeFloat(sliderData->m_rbAFrame);
-	m_frameInB.serializeFloat(sliderData->m_rbBFrame);
-
-	sliderData->m_linearUpperLimit = float(m_upperLinLimit);
-	sliderData->m_linearLowerLimit = float(m_lowerLinLimit);
-
-	sliderData->m_angularUpperLimit = float(m_upperAngLimit);
-	sliderData->m_angularLowerLimit = float(m_lowerAngLimit);
-
-	sliderData->m_useLinearReferenceFrameA = m_useLinearReferenceFrameA;
-	sliderData->m_useOffsetForConstraintFrame = m_useOffsetForConstraintFrame;
-
-	return "btSliderConstraintData";
-}
-
-
-
-#endif //BT_SLIDER_CONSTRAINT_H
-
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp
deleted file mode 100644
index 0c7dbd6..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-#include "btSolve2LinearConstraint.h"
-
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-#include "LinearMath/btVector3.h"
-#include "btJacobianEntry.h"
-
-
-void btSolve2LinearConstraint::resolveUnilateralPairConstraint(
-												   btRigidBody* body1,
-		btRigidBody* body2,
-
-						const btMatrix3x3& world2A,
-						const btMatrix3x3& world2B,
-						
-						const btVector3& invInertiaADiag,
-						const btScalar invMassA,
-						const btVector3& linvelA,const btVector3& angvelA,
-						const btVector3& rel_posA1,
-						const btVector3& invInertiaBDiag,
-						const btScalar invMassB,
-						const btVector3& linvelB,const btVector3& angvelB,
-						const btVector3& rel_posA2,
-
-					  btScalar depthA, const btVector3& normalA, 
-					  const btVector3& rel_posB1,const btVector3& rel_posB2,
-					  btScalar depthB, const btVector3& normalB, 
-					  btScalar& imp0,btScalar& imp1)
-{
-	(void)linvelA;
-	(void)linvelB;
-	(void)angvelB;
-	(void)angvelA;
-
-
-
-	imp0 = btScalar(0.);
-	imp1 = btScalar(0.);
-
-	btScalar len = btFabs(normalA.length()) - btScalar(1.);
-	if (btFabs(len) >= SIMD_EPSILON)
-		return;
-
-	btAssert(len < SIMD_EPSILON);
-
-
-	//this jacobian entry could be re-used for all iterations
-	btJacobianEntry jacA(world2A,world2B,rel_posA1,rel_posA2,normalA,invInertiaADiag,invMassA,
-		invInertiaBDiag,invMassB);
-	btJacobianEntry jacB(world2A,world2B,rel_posB1,rel_posB2,normalB,invInertiaADiag,invMassA,
-		invInertiaBDiag,invMassB);
-	
-	//const btScalar vel0 = jacA.getRelativeVelocity(linvelA,angvelA,linvelB,angvelB);
-	//const btScalar vel1 = jacB.getRelativeVelocity(linvelA,angvelA,linvelB,angvelB);
-
-	const btScalar vel0 = normalA.dot(body1->getVelocityInLocalPoint(rel_posA1)-body2->getVelocityInLocalPoint(rel_posA1));
-	const btScalar vel1 = normalB.dot(body1->getVelocityInLocalPoint(rel_posB1)-body2->getVelocityInLocalPoint(rel_posB1));
-
-//	btScalar penetrationImpulse = (depth*contactTau*timeCorrection)  * massTerm;//jacDiagABInv
-	btScalar massTerm = btScalar(1.) / (invMassA + invMassB);
-
-
-	// calculate rhs (or error) terms
-	const btScalar dv0 = depthA  * m_tau * massTerm - vel0 * m_damping;
-	const btScalar dv1 = depthB  * m_tau * massTerm - vel1 * m_damping;
-
-
-	// dC/dv * dv = -C
-	
-	// jacobian * impulse = -error
-	//
-
-	//impulse = jacobianInverse * -error
-
-	// inverting 2x2 symmetric system (offdiagonal are equal!)
-	// 
-
-
-	btScalar nonDiag = jacA.getNonDiagonal(jacB,invMassA,invMassB);
-	btScalar	invDet = btScalar(1.0) / (jacA.getDiagonal() * jacB.getDiagonal() - nonDiag * nonDiag );
-	
-	//imp0 = dv0 * jacA.getDiagonal() * invDet + dv1 * -nonDiag * invDet;
-	//imp1 = dv1 * jacB.getDiagonal() * invDet + dv0 * - nonDiag * invDet;
-
-	imp0 = dv0 * jacA.getDiagonal() * invDet + dv1 * -nonDiag * invDet;
-	imp1 = dv1 * jacB.getDiagonal() * invDet + dv0 * - nonDiag * invDet;
-
-	//[a b]								  [d -c]
-	//[c d] inverse = (1 / determinant) * [-b a] where determinant is (ad - bc)
-
-	//[jA nD] * [imp0] = [dv0]
-	//[nD jB]   [imp1]   [dv1]
-
-}
-
-
-
-void btSolve2LinearConstraint::resolveBilateralPairConstraint(
-						btRigidBody* body1,
-						btRigidBody* body2,
-						const btMatrix3x3& world2A,
-						const btMatrix3x3& world2B,
-						
-						const btVector3& invInertiaADiag,
-						const btScalar invMassA,
-						const btVector3& linvelA,const btVector3& angvelA,
-						const btVector3& rel_posA1,
-						const btVector3& invInertiaBDiag,
-						const btScalar invMassB,
-						const btVector3& linvelB,const btVector3& angvelB,
-						const btVector3& rel_posA2,
-
-					  btScalar depthA, const btVector3& normalA, 
-					  const btVector3& rel_posB1,const btVector3& rel_posB2,
-					  btScalar depthB, const btVector3& normalB, 
-					  btScalar& imp0,btScalar& imp1)
-{
-
-	(void)linvelA;
-	(void)linvelB;
-	(void)angvelA;
-	(void)angvelB;
-
-
-
-	imp0 = btScalar(0.);
-	imp1 = btScalar(0.);
-
-	btScalar len = btFabs(normalA.length()) - btScalar(1.);
-	if (btFabs(len) >= SIMD_EPSILON)
-		return;
-
-	btAssert(len < SIMD_EPSILON);
-
-
-	//this jacobian entry could be re-used for all iterations
-	btJacobianEntry jacA(world2A,world2B,rel_posA1,rel_posA2,normalA,invInertiaADiag,invMassA,
-		invInertiaBDiag,invMassB);
-	btJacobianEntry jacB(world2A,world2B,rel_posB1,rel_posB2,normalB,invInertiaADiag,invMassA,
-		invInertiaBDiag,invMassB);
-	
-	//const btScalar vel0 = jacA.getRelativeVelocity(linvelA,angvelA,linvelB,angvelB);
-	//const btScalar vel1 = jacB.getRelativeVelocity(linvelA,angvelA,linvelB,angvelB);
-
-	const btScalar vel0 = normalA.dot(body1->getVelocityInLocalPoint(rel_posA1)-body2->getVelocityInLocalPoint(rel_posA1));
-	const btScalar vel1 = normalB.dot(body1->getVelocityInLocalPoint(rel_posB1)-body2->getVelocityInLocalPoint(rel_posB1));
-
-	// calculate rhs (or error) terms
-	const btScalar dv0 = depthA  * m_tau - vel0 * m_damping;
-	const btScalar dv1 = depthB  * m_tau - vel1 * m_damping;
-
-	// dC/dv * dv = -C
-	
-	// jacobian * impulse = -error
-	//
-
-	//impulse = jacobianInverse * -error
-
-	// inverting 2x2 symmetric system (offdiagonal are equal!)
-	// 
-
-
-	btScalar nonDiag = jacA.getNonDiagonal(jacB,invMassA,invMassB);
-	btScalar	invDet = btScalar(1.0) / (jacA.getDiagonal() * jacB.getDiagonal() - nonDiag * nonDiag );
-	
-	//imp0 = dv0 * jacA.getDiagonal() * invDet + dv1 * -nonDiag * invDet;
-	//imp1 = dv1 * jacB.getDiagonal() * invDet + dv0 * - nonDiag * invDet;
-
-	imp0 = dv0 * jacA.getDiagonal() * invDet + dv1 * -nonDiag * invDet;
-	imp1 = dv1 * jacB.getDiagonal() * invDet + dv0 * - nonDiag * invDet;
-
-	//[a b]								  [d -c]
-	//[c d] inverse = (1 / determinant) * [-b a] where determinant is (ad - bc)
-
-	//[jA nD] * [imp0] = [dv0]
-	//[nD jB]   [imp1]   [dv1]
-
-	if ( imp0 > btScalar(0.0))
-	{
-		if ( imp1 > btScalar(0.0) )
-		{
-			//both positive
-		}
-		else
-		{
-			imp1 = btScalar(0.);
-
-			// now imp0>0 imp1<0
-			imp0 = dv0 / jacA.getDiagonal();
-			if ( imp0 > btScalar(0.0) )
-			{
-			} else
-			{
-				imp0 = btScalar(0.);
-			}
-		}
-	}
-	else
-	{
-		imp0 = btScalar(0.);
-
-		imp1 = dv1 / jacB.getDiagonal();
-		if ( imp1 <= btScalar(0.0) )
-		{
-			imp1 = btScalar(0.);
-			// now imp0>0 imp1<0
-			imp0 = dv0 / jacA.getDiagonal();
-			if ( imp0 > btScalar(0.0) )
-			{
-			} else
-			{
-				imp0 = btScalar(0.);
-			}
-		} else
-		{
-		}
-	}
-}
-
-
-/*
-void btSolve2LinearConstraint::resolveAngularConstraint(	const btMatrix3x3& invInertiaAWS,
-											const btScalar invMassA,
-											const btVector3& linvelA,const btVector3& angvelA,
-											const btVector3& rel_posA1,
-											const btMatrix3x3& invInertiaBWS,
-											const btScalar invMassB,
-											const btVector3& linvelB,const btVector3& angvelB,
-											const btVector3& rel_posA2,
-
-											btScalar depthA, const btVector3& normalA, 
-											const btVector3& rel_posB1,const btVector3& rel_posB2,
-											btScalar depthB, const btVector3& normalB, 
-											btScalar& imp0,btScalar& imp1)
-{
-
-}
-*/
-
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h
deleted file mode 100644
index e8bfabf..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_SOLVE_2LINEAR_CONSTRAINT_H
-#define BT_SOLVE_2LINEAR_CONSTRAINT_H
-
-#include "LinearMath/btMatrix3x3.h"
-#include "LinearMath/btVector3.h"
-
-
-class btRigidBody;
-
-
-
-/// constraint class used for lateral tyre friction.
-class	btSolve2LinearConstraint
-{
-	btScalar	m_tau;
-	btScalar	m_damping;
-
-public:
-
-	btSolve2LinearConstraint(btScalar tau,btScalar damping)
-	{
-		m_tau = tau;
-		m_damping = damping;
-	}
-	//
-	// solve unilateral constraint (equality, direct method)
-	//
-	void resolveUnilateralPairConstraint(		
-														   btRigidBody* body0,
-		btRigidBody* body1,
-
-		const btMatrix3x3& world2A,
-						const btMatrix3x3& world2B,
-						
-						const btVector3& invInertiaADiag,
-						const btScalar invMassA,
-						const btVector3& linvelA,const btVector3& angvelA,
-						const btVector3& rel_posA1,
-						const btVector3& invInertiaBDiag,
-						const btScalar invMassB,
-						const btVector3& linvelB,const btVector3& angvelB,
-						const btVector3& rel_posA2,
-
-					  btScalar depthA, const btVector3& normalA, 
-					  const btVector3& rel_posB1,const btVector3& rel_posB2,
-					  btScalar depthB, const btVector3& normalB, 
-					  btScalar& imp0,btScalar& imp1);
-
-
-	//
-	// solving 2x2 lcp problem (inequality, direct solution )
-	//
-	void resolveBilateralPairConstraint(
-			btRigidBody* body0,
-						btRigidBody* body1,
-		const btMatrix3x3& world2A,
-						const btMatrix3x3& world2B,
-						
-						const btVector3& invInertiaADiag,
-						const btScalar invMassA,
-						const btVector3& linvelA,const btVector3& angvelA,
-						const btVector3& rel_posA1,
-						const btVector3& invInertiaBDiag,
-						const btScalar invMassB,
-						const btVector3& linvelB,const btVector3& angvelB,
-						const btVector3& rel_posA2,
-
-					  btScalar depthA, const btVector3& normalA, 
-					  const btVector3& rel_posB1,const btVector3& rel_posB2,
-					  btScalar depthB, const btVector3& normalB, 
-					  btScalar& imp0,btScalar& imp1);
-
-/*
-	void resolveAngularConstraint(	const btMatrix3x3& invInertiaAWS,
-						const btScalar invMassA,
-						const btVector3& linvelA,const btVector3& angvelA,
-						const btVector3& rel_posA1,
-						const btMatrix3x3& invInertiaBWS,
-						const btScalar invMassB,
-						const btVector3& linvelB,const btVector3& angvelB,
-						const btVector3& rel_posA2,
-
-					  btScalar depthA, const btVector3& normalA, 
-					  const btVector3& rel_posB1,const btVector3& rel_posB2,
-					  btScalar depthB, const btVector3& normalB, 
-					  btScalar& imp0,btScalar& imp1);
-
-*/
-
-};
-
-#endif //BT_SOLVE_2LINEAR_CONSTRAINT_H
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolverBody.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolverBody.h
deleted file mode 100644
index 8de5158..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolverBody.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_SOLVER_BODY_H
-#define BT_SOLVER_BODY_H
-
-class	btRigidBody;
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btMatrix3x3.h"
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-#include "LinearMath/btAlignedAllocator.h"
-#include "LinearMath/btTransformUtil.h"
-
-///Until we get other contributions, only use SIMD on Windows, when using Visual Studio 2008 or later, and not double precision
-#ifdef BT_USE_SSE
-#define USE_SIMD 1
-#endif //
-
-
-#ifdef USE_SIMD
-
-struct	btSimdScalar
-{
-	SIMD_FORCE_INLINE	btSimdScalar()
-	{
-
-	}
-
-	SIMD_FORCE_INLINE	btSimdScalar(float	fl)
-	:m_vec128 (_mm_set1_ps(fl))
-	{
-	}
-
-	SIMD_FORCE_INLINE	btSimdScalar(__m128 v128)
-		:m_vec128(v128)
-	{
-	}
-	union
-	{
-		__m128		m_vec128;
-		float		m_floats[4];
-		int			m_ints[4];
-		btScalar	m_unusedPadding;
-	};
-	SIMD_FORCE_INLINE	__m128	get128()
-	{
-		return m_vec128;
-	}
-
-	SIMD_FORCE_INLINE	const __m128	get128() const
-	{
-		return m_vec128;
-	}
-
-	SIMD_FORCE_INLINE	void	set128(__m128 v128)
-	{
-		m_vec128 = v128;
-	}
-
-	SIMD_FORCE_INLINE	operator       __m128()       
-	{ 
-		return m_vec128; 
-	}
-	SIMD_FORCE_INLINE	operator const __m128() const 
-	{ 
-		return m_vec128; 
-	}
-	
-	SIMD_FORCE_INLINE	operator float() const 
-	{ 
-		return m_floats[0]; 
-	}
-
-};
-
-///@brief Return the elementwise product of two btSimdScalar
-SIMD_FORCE_INLINE btSimdScalar 
-operator*(const btSimdScalar& v1, const btSimdScalar& v2) 
-{
-	return btSimdScalar(_mm_mul_ps(v1.get128(),v2.get128()));
-}
-
-///@brief Return the elementwise product of two btSimdScalar
-SIMD_FORCE_INLINE btSimdScalar 
-operator+(const btSimdScalar& v1, const btSimdScalar& v2) 
-{
-	return btSimdScalar(_mm_add_ps(v1.get128(),v2.get128()));
-}
-
-
-#else
-#define btSimdScalar btScalar
-#endif
-
-///The btSolverBody is an internal datastructure for the constraint solver. Only necessary data is packed to increase cache coherence/performance.
-ATTRIBUTE_ALIGNED64 (struct)	btSolverBodyObsolete
-{
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-	btVector3		m_deltaLinearVelocity;
-	btVector3		m_deltaAngularVelocity;
-	btVector3		m_angularFactor;
-	btVector3		m_invMass;
-	btRigidBody*	m_originalBody;
-	btVector3		m_pushVelocity;
-	btVector3		m_turnVelocity;
-
-	
-	SIMD_FORCE_INLINE void	getVelocityInLocalPointObsolete(const btVector3& rel_pos, btVector3& velocity ) const
-	{
-		if (m_originalBody)
-			velocity = m_originalBody->getLinearVelocity()+m_deltaLinearVelocity + (m_originalBody->getAngularVelocity()+m_deltaAngularVelocity).cross(rel_pos);
-		else
-			velocity.setValue(0,0,0);
-	}
-
-	SIMD_FORCE_INLINE void	getAngularVelocity(btVector3& angVel) const
-	{
-		if (m_originalBody)
-			angVel = m_originalBody->getAngularVelocity()+m_deltaAngularVelocity;
-		else
-			angVel.setValue(0,0,0);
-	}
-
-
-	//Optimization for the iterative solver: avoid calculating constant terms involving inertia, normal, relative position
-	SIMD_FORCE_INLINE void applyImpulse(const btVector3& linearComponent, const btVector3& angularComponent,const btScalar impulseMagnitude)
-	{
-		//if (m_invMass)
-		{
-			m_deltaLinearVelocity += linearComponent*impulseMagnitude;
-			m_deltaAngularVelocity += angularComponent*(impulseMagnitude*m_angularFactor);
-		}
-	}
-
-	SIMD_FORCE_INLINE void internalApplyPushImpulse(const btVector3& linearComponent, const btVector3& angularComponent,btScalar impulseMagnitude)
-	{
-		if (m_originalBody)
-		{
-			m_pushVelocity += linearComponent*impulseMagnitude;
-			m_turnVelocity += angularComponent*(impulseMagnitude*m_angularFactor);
-		}
-	}
-	
-	void	writebackVelocity()
-	{
-		if (m_originalBody)
-		{
-			m_originalBody->setLinearVelocity(m_originalBody->getLinearVelocity()+ m_deltaLinearVelocity);
-			m_originalBody->setAngularVelocity(m_originalBody->getAngularVelocity()+m_deltaAngularVelocity);
-			
-			//m_originalBody->setCompanionId(-1);
-		}
-	}
-
-
-	void	writebackVelocity(btScalar timeStep)
-	{
-        (void) timeStep;
-		if (m_originalBody)
-		{
-			m_originalBody->setLinearVelocity(m_originalBody->getLinearVelocity()+ m_deltaLinearVelocity);
-			m_originalBody->setAngularVelocity(m_originalBody->getAngularVelocity()+m_deltaAngularVelocity);
-			
-			//correct the position/orientation based on push/turn recovery
-			btTransform newTransform;
-			btTransformUtil::integrateTransform(m_originalBody->getWorldTransform(),m_pushVelocity,m_turnVelocity,timeStep,newTransform);
-			m_originalBody->setWorldTransform(newTransform);
-			
-			//m_originalBody->setCompanionId(-1);
-		}
-	}
-	
-
-
-};
-
-#endif //BT_SOLVER_BODY_H
-
-
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h
deleted file mode 100644
index 79e45a4..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_SOLVER_CONSTRAINT_H
-#define BT_SOLVER_CONSTRAINT_H
-
-class	btRigidBody;
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btMatrix3x3.h"
-#include "btJacobianEntry.h"
-
-//#define NO_FRICTION_TANGENTIALS 1
-#include "btSolverBody.h"
-
-
-///1D constraint along a normal axis between bodyA and bodyB. It can be combined to solve contact and friction constraints.
-ATTRIBUTE_ALIGNED64 (struct)	btSolverConstraint
-{
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-
-	btVector3		m_relpos1CrossNormal;
-	btVector3		m_contactNormal;
-
-	btVector3		m_relpos2CrossNormal;
-	//btVector3		m_contactNormal2;//usually m_contactNormal2 == -m_contactNormal
-
-	btVector3		m_angularComponentA;
-	btVector3		m_angularComponentB;
-	
-	mutable btSimdScalar	m_appliedPushImpulse;
-	mutable btSimdScalar	m_appliedImpulse;
-	
-	
-	btScalar	m_friction;
-	btScalar	m_jacDiagABInv;
-	union
-	{
-		int	m_numConsecutiveRowsPerKernel;
-		btScalar	m_unusedPadding0;
-	};
-
-	union
-	{
-		int			m_frictionIndex;
-		btScalar	m_unusedPadding1;
-	};
-	union
-	{
-		btRigidBody*	m_solverBodyA;
-		int				m_companionIdA;
-	};
-	union
-	{
-		btRigidBody*	m_solverBodyB;
-		int				m_companionIdB;
-	};
-	
-	union
-	{
-		void*		m_originalContactPoint;
-		btScalar	m_unusedPadding4;
-	};
-
-	btScalar		m_rhs;
-	btScalar		m_cfm;
-	btScalar		m_lowerLimit;
-	btScalar		m_upperLimit;
-
-	btScalar		m_rhsPenetration;
-
-	enum		btSolverConstraintType
-	{
-		BT_SOLVER_CONTACT_1D = 0,
-		BT_SOLVER_FRICTION_1D
-	};
-};
-
-typedef btAlignedObjectArray<btSolverConstraint>	btConstraintArray;
-
-
-#endif //BT_SOLVER_CONSTRAINT_H
-
-
-
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btTypedConstraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btTypedConstraint.cpp
deleted file mode 100644
index fb77b1c..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btTypedConstraint.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "btTypedConstraint.h"
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-#include "LinearMath/btSerializer.h"
-
-
-#define DEFAULT_DEBUGDRAW_SIZE btScalar(0.3f)
-
-btTypedConstraint::btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA)
-:btTypedObject(type),
-m_userConstraintType(-1),
-m_userConstraintId(-1),
-m_needsFeedback(false),
-m_rbA(rbA),
-m_rbB(getFixedBody()),
-m_appliedImpulse(btScalar(0.)),
-m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE),
-m_breakingImpulseThreshold(SIMD_INFINITY),
-m_isEnabled(true)
-{
-}
-
-
-btTypedConstraint::btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA,btRigidBody& rbB)
-:btTypedObject(type),
-m_userConstraintType(-1),
-m_userConstraintId(-1),
-m_needsFeedback(false),
-m_rbA(rbA),
-m_rbB(rbB),
-m_appliedImpulse(btScalar(0.)),
-m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE),
-m_breakingImpulseThreshold(SIMD_INFINITY),
-m_isEnabled(true)
-{
-}
-
-
-
-
-btScalar btTypedConstraint::getMotorFactor(btScalar pos, btScalar lowLim, btScalar uppLim, btScalar vel, btScalar timeFact)
-{
-	if(lowLim > uppLim)
-	{
-		return btScalar(1.0f);
-	}
-	else if(lowLim == uppLim)
-	{
-		return btScalar(0.0f);
-	}
-	btScalar lim_fact = btScalar(1.0f);
-	btScalar delta_max = vel / timeFact;
-	if(delta_max < btScalar(0.0f))
-	{
-		if((pos >= lowLim) && (pos < (lowLim - delta_max)))
-		{
-			lim_fact = (lowLim - pos) / delta_max;
-		}
-		else if(pos  < lowLim)
-		{
-			lim_fact = btScalar(0.0f);
-		}
-		else
-		{
-			lim_fact = btScalar(1.0f);
-		}
-	}
-	else if(delta_max > btScalar(0.0f))
-	{
-		if((pos <= uppLim) && (pos > (uppLim - delta_max)))
-		{
-			lim_fact = (uppLim - pos) / delta_max;
-		}
-		else if(pos  > uppLim)
-		{
-			lim_fact = btScalar(0.0f);
-		}
-		else
-		{
-			lim_fact = btScalar(1.0f);
-		}
-	}
-	else
-	{
-			lim_fact = btScalar(0.0f);
-	}
-	return lim_fact;
-}
-
-///fills the dataBuffer and returns the struct name (and 0 on failure)
-const char*	btTypedConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
-{
-	btTypedConstraintData* tcd = (btTypedConstraintData*) dataBuffer;
-
-	tcd->m_rbA = (btRigidBodyData*)serializer->getUniquePointer(&m_rbA);
-	tcd->m_rbB = (btRigidBodyData*)serializer->getUniquePointer(&m_rbB);
-	char* name = (char*) serializer->findNameForPointer(this);
-	tcd->m_name = (char*)serializer->getUniquePointer(name);
-	if (tcd->m_name)
-	{
-		serializer->serializeName(name);
-	}
-
-	tcd->m_objectType = m_objectType;
-	tcd->m_needsFeedback = m_needsFeedback;
-	tcd->m_userConstraintId =m_userConstraintId;
-	tcd->m_userConstraintType =m_userConstraintType;
-
-	tcd->m_appliedImpulse = float(m_appliedImpulse);
-	tcd->m_dbgDrawSize = float(m_dbgDrawSize );
-
-	tcd->m_disableCollisionsBetweenLinkedBodies = false;
-
-	int i;
-	for (i=0;i<m_rbA.getNumConstraintRefs();i++)
-		if (m_rbA.getConstraintRef(i) == this)
-			tcd->m_disableCollisionsBetweenLinkedBodies = true;
-	for (i=0;i<m_rbB.getNumConstraintRefs();i++)
-		if (m_rbB.getConstraintRef(i) == this)
-			tcd->m_disableCollisionsBetweenLinkedBodies = true;
-
-	return "btTypedConstraintData";
-}
-
-btRigidBody& btTypedConstraint::getFixedBody()
-{
-	static btRigidBody s_fixed(0, 0,0);
-	s_fixed.setMassProps(btScalar(0.),btVector3(btScalar(0.),btScalar(0.),btScalar(0.)));
-	return s_fixed;
-}
-
-
-void btAngularLimit::set(btScalar low, btScalar high, btScalar _softness, btScalar _biasFactor, btScalar _relaxationFactor)
-{
-	m_halfRange = (high - low) / 2.0f;
-	m_center = btNormalizeAngle(low + m_halfRange);
-	m_softness =  _softness;
-	m_biasFactor = _biasFactor;
-	m_relaxationFactor = _relaxationFactor;
-}
-
-void btAngularLimit::test(const btScalar angle)
-{
-	m_correction = 0.0f;
-	m_sign = 0.0f;
-	m_solveLimit = false;
-
-	if (m_halfRange >= 0.0f)
-	{
-		btScalar deviation = btNormalizeAngle(angle - m_center);
-		if (deviation < -m_halfRange)
-		{
-			m_solveLimit = true;
-			m_correction = - (deviation + m_halfRange);
-			m_sign = +1.0f;
-		}
-		else if (deviation > m_halfRange)
-		{
-			m_solveLimit = true;
-			m_correction = m_halfRange - deviation;
-			m_sign = -1.0f;
-		}
-	}
-}
-
-
-btScalar btAngularLimit::getError() const
-{
-	return m_correction * m_sign;
-}
-
-void btAngularLimit::fit(btScalar& angle) const
-{
-	if (m_halfRange > 0.0f)
-	{
-		btScalar relativeAngle = btNormalizeAngle(angle - m_center);
-		if (!btEqual(relativeAngle, m_halfRange))
-		{
-			if (relativeAngle > 0.0f)
-			{
-				angle = getHigh();
-			}
-			else
-			{
-				angle = getLow();
-			}
-		}
-	}
-}
-
-btScalar btAngularLimit::getLow() const
-{
-	return btNormalizeAngle(m_center - m_halfRange);
-}
-
-btScalar btAngularLimit::getHigh() const
-{
-	return btNormalizeAngle(m_center + m_halfRange);
-}
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h
deleted file mode 100644
index 20df8e5..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h
+++ /dev/null
@@ -1,436 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2010 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_TYPED_CONSTRAINT_H
-#define BT_TYPED_CONSTRAINT_H
-
-class btRigidBody;
-#include "LinearMath/btScalar.h"
-#include "btSolverConstraint.h"
-
-class btSerializer;
-
-//Don't change any of the existing enum values, so add enum types at the end for serialization compatibility
-enum btTypedConstraintType
-{
-	POINT2POINT_CONSTRAINT_TYPE=3,
-	HINGE_CONSTRAINT_TYPE,
-	CONETWIST_CONSTRAINT_TYPE,
-	D6_CONSTRAINT_TYPE,
-	SLIDER_CONSTRAINT_TYPE,
-	CONTACT_CONSTRAINT_TYPE,
-	D6_SPRING_CONSTRAINT_TYPE,
-	MAX_CONSTRAINT_TYPE
-};
-
-
-enum btConstraintParams
-{
-	BT_CONSTRAINT_ERP=1,
-	BT_CONSTRAINT_STOP_ERP,
-	BT_CONSTRAINT_CFM,
-	BT_CONSTRAINT_STOP_CFM
-};
-
-#if 1
-	#define btAssertConstrParams(_par) btAssert(_par) 
-#else
-	#define btAssertConstrParams(_par)
-#endif
-
-
-///TypedConstraint is the baseclass for Bullet constraints and vehicles
-class btTypedConstraint : public btTypedObject
-{
-	int	m_userConstraintType;
-
-	union
-	{
-		int	m_userConstraintId;
-		void* m_userConstraintPtr;
-	};
-
-	btScalar	m_breakingImpulseThreshold;
-	bool		m_isEnabled;
-
-
-	bool m_needsFeedback;
-
-	btTypedConstraint&	operator=(btTypedConstraint&	other)
-	{
-		btAssert(0);
-		(void) other;
-		return *this;
-	}
-
-protected:
-	btRigidBody&	m_rbA;
-	btRigidBody&	m_rbB;
-	btScalar	m_appliedImpulse;
-	btScalar	m_dbgDrawSize;
-
-	///internal method used by the constraint solver, don't use them directly
-	btScalar getMotorFactor(btScalar pos, btScalar lowLim, btScalar uppLim, btScalar vel, btScalar timeFact);
-	
-	static btRigidBody& getFixedBody();
-
-public:
-
-	virtual ~btTypedConstraint() {};
-	btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA);
-	btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA,btRigidBody& rbB);
-
-	struct btConstraintInfo1 {
-		int m_numConstraintRows,nub;
-	};
-
-	struct btConstraintInfo2 {
-		// integrator parameters: frames per second (1/stepsize), default error
-		// reduction parameter (0..1).
-		btScalar fps,erp;
-
-		// for the first and second body, pointers to two (linear and angular)
-		// n*3 jacobian sub matrices, stored by rows. these matrices will have
-		// been initialized to 0 on entry. if the second body is zero then the
-		// J2xx pointers may be 0.
-		btScalar *m_J1linearAxis,*m_J1angularAxis,*m_J2linearAxis,*m_J2angularAxis;
-
-		// elements to jump from one row to the next in J's
-		int rowskip;
-
-		// right hand sides of the equation J*v = c + cfm * lambda. cfm is the
-		// "constraint force mixing" vector. c is set to zero on entry, cfm is
-		// set to a constant value (typically very small or zero) value on entry.
-		btScalar *m_constraintError,*cfm;
-
-		// lo and hi limits for variables (set to -/+ infinity on entry).
-		btScalar *m_lowerLimit,*m_upperLimit;
-
-		// findex vector for variables. see the LCP solver interface for a
-		// description of what this does. this is set to -1 on entry.
-		// note that the returned indexes are relative to the first index of
-		// the constraint.
-		int *findex;
-		// number of solver iterations
-		int m_numIterations;
-
-		//damping of the velocity
-		btScalar	m_damping;
-	};
-
-	///internal method used by the constraint solver, don't use them directly
-	virtual void	buildJacobian() {};
-
-	///internal method used by the constraint solver, don't use them directly
-	virtual	void	setupSolverConstraint(btConstraintArray& ca, int solverBodyA,int solverBodyB, btScalar timeStep)
-	{
-        (void)ca;
-        (void)solverBodyA;
-        (void)solverBodyB;
-        (void)timeStep;
-	}
-	
-	///internal method used by the constraint solver, don't use them directly
-	virtual void getInfo1 (btConstraintInfo1* info)=0;
-
-	///internal method used by the constraint solver, don't use them directly
-	virtual void getInfo2 (btConstraintInfo2* info)=0;
-
-	///internal method used by the constraint solver, don't use them directly
-	void	internalSetAppliedImpulse(btScalar appliedImpulse)
-	{
-		m_appliedImpulse = appliedImpulse;
-	}
-	///internal method used by the constraint solver, don't use them directly
-	btScalar	internalGetAppliedImpulse()
-	{
-		return m_appliedImpulse;
-	}
-
-
-	btScalar	getBreakingImpulseThreshold() const
-	{
-		return 	m_breakingImpulseThreshold;
-	}
-
-	void	setBreakingImpulseThreshold(btScalar threshold)
-	{
-		m_breakingImpulseThreshold = threshold;
-	}
-
-	bool	isEnabled() const
-	{
-		return m_isEnabled;
-	}
-
-	void	setEnabled(bool enabled)
-	{
-		m_isEnabled=enabled;
-	}
-
-
-	///internal method used by the constraint solver, don't use them directly
-	virtual	void	solveConstraintObsolete(btRigidBody& /*bodyA*/,btRigidBody& /*bodyB*/,btScalar	/*timeStep*/) {};
-
-	
-	const btRigidBody& getRigidBodyA() const
-	{
-		return m_rbA;
-	}
-	const btRigidBody& getRigidBodyB() const
-	{
-		return m_rbB;
-	}
-
-	btRigidBody& getRigidBodyA() 
-	{
-		return m_rbA;
-	}
-	btRigidBody& getRigidBodyB()
-	{
-		return m_rbB;
-	}
-
-	int getUserConstraintType() const
-	{
-		return m_userConstraintType ;
-	}
-
-	void	setUserConstraintType(int userConstraintType)
-	{
-		m_userConstraintType = userConstraintType;
-	};
-
-	void	setUserConstraintId(int uid)
-	{
-		m_userConstraintId = uid;
-	}
-
-	int getUserConstraintId() const
-	{
-		return m_userConstraintId;
-	}
-
-	void	setUserConstraintPtr(void* ptr)
-	{
-		m_userConstraintPtr = ptr;
-	}
-
-	void*	getUserConstraintPtr()
-	{
-		return m_userConstraintPtr;
-	}
-
-	int getUid() const
-	{
-		return m_userConstraintId;   
-	} 
-
-	bool	needsFeedback() const
-	{
-		return m_needsFeedback;
-	}
-
-	///enableFeedback will allow to read the applied linear and angular impulse
-	///use getAppliedImpulse, getAppliedLinearImpulse and getAppliedAngularImpulse to read feedback information
-	void	enableFeedback(bool needsFeedback)
-	{
-		m_needsFeedback = needsFeedback;
-	}
-
-	///getAppliedImpulse is an estimated total applied impulse. 
-	///This feedback could be used to determine breaking constraints or playing sounds.
-	btScalar	getAppliedImpulse() const
-	{
-		btAssert(m_needsFeedback);
-		return m_appliedImpulse;
-	}
-
-	btTypedConstraintType getConstraintType () const
-	{
-		return btTypedConstraintType(m_objectType);
-	}
-	
-	void setDbgDrawSize(btScalar dbgDrawSize)
-	{
-		m_dbgDrawSize = dbgDrawSize;
-	}
-	btScalar getDbgDrawSize()
-	{
-		return m_dbgDrawSize;
-	}
-
-	///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
-	///If no axis is provided, it uses the default axis for this constraint.
-	virtual	void	setParam(int num, btScalar value, int axis = -1) = 0;
-
-	///return the local value of parameter
-	virtual	btScalar getParam(int num, int axis = -1) const = 0;
-	
-	virtual	int	calculateSerializeBufferSize() const;
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
-
-};
-
-// returns angle in range [-SIMD_2_PI, SIMD_2_PI], closest to one of the limits 
-// all arguments should be normalized angles (i.e. in range [-SIMD_PI, SIMD_PI])
-SIMD_FORCE_INLINE btScalar btAdjustAngleToLimits(btScalar angleInRadians, btScalar angleLowerLimitInRadians, btScalar angleUpperLimitInRadians)
-{
-	if(angleLowerLimitInRadians >= angleUpperLimitInRadians)
-	{
-		return angleInRadians;
-	}
-	else if(angleInRadians < angleLowerLimitInRadians)
-	{
-		btScalar diffLo = btFabs(btNormalizeAngle(angleLowerLimitInRadians - angleInRadians));
-		btScalar diffHi = btFabs(btNormalizeAngle(angleUpperLimitInRadians - angleInRadians));
-		return (diffLo < diffHi) ? angleInRadians : (angleInRadians + SIMD_2_PI);
-	}
-	else if(angleInRadians > angleUpperLimitInRadians)
-	{
-		btScalar diffHi = btFabs(btNormalizeAngle(angleInRadians - angleUpperLimitInRadians));
-		btScalar diffLo = btFabs(btNormalizeAngle(angleInRadians - angleLowerLimitInRadians));
-		return (diffLo < diffHi) ? (angleInRadians - SIMD_2_PI) : angleInRadians;
-	}
-	else
-	{
-		return angleInRadians;
-	}
-}
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btTypedConstraintData
-{
-	btRigidBodyData		*m_rbA;
-	btRigidBodyData		*m_rbB;
-	char	*m_name;
-
-	int	m_objectType;
-	int	m_userConstraintType;
-	int	m_userConstraintId;
-	int	m_needsFeedback;
-
-	float	m_appliedImpulse;
-	float	m_dbgDrawSize;
-
-	int	m_disableCollisionsBetweenLinkedBodies;
-	char	m_pad4[4];
-	
-};
-
-SIMD_FORCE_INLINE	int	btTypedConstraint::calculateSerializeBufferSize() const
-{
-	return sizeof(btTypedConstraintData);
-}
-
-
-
-class btAngularLimit
-{
-private:
-	btScalar 
-		m_center,
-		m_halfRange,
-		m_softness,
-		m_biasFactor,
-		m_relaxationFactor,
-		m_correction,
-		m_sign;
-
-	bool
-		m_solveLimit;
-
-public:
-	/// Default constructor initializes limit as inactive, allowing free constraint movement
-	btAngularLimit()
-		:m_center(0.0f),
-		m_halfRange(-1.0f),
-		m_softness(0.9f),
-		m_biasFactor(0.3f),
-		m_relaxationFactor(1.0f),
-		m_correction(0.0f),
-		m_sign(0.0f),
-		m_solveLimit(false)
-	{}
-
-	/// Sets all limit's parameters.
-	/// When low > high limit becomes inactive.
-	/// When high - low > 2PI limit is ineffective too becouse no angle can exceed the limit
-	void set(btScalar low, btScalar high, btScalar _softness = 0.9f, btScalar _biasFactor = 0.3f, btScalar _relaxationFactor = 1.0f);
-
-	/// Checks conastaint angle against limit. If limit is active and the angle violates the limit
-	/// correction is calculated.
-	void test(const btScalar angle);
-
-	/// Returns limit's softness
-	inline btScalar getSoftness() const
-	{
-		return m_softness;
-	}
-
-	/// Returns limit's bias factor
-	inline btScalar getBiasFactor() const
-	{
-		return m_biasFactor;
-	}
-
-	/// Returns limit's relaxation factor
-	inline btScalar getRelaxationFactor() const
-	{
-		return m_relaxationFactor;
-	}
-
-	/// Returns correction value evaluated when test() was invoked 
-	inline btScalar getCorrection() const
-	{
-		return m_correction;
-	}
-
-	/// Returns sign value evaluated when test() was invoked 
-	inline btScalar getSign() const
-	{
-		return m_sign;
-	}
-
-	/// Gives half of the distance between min and max limit angle
-	inline btScalar getHalfRange() const
-	{
-		return m_halfRange;
-	}
-
-	/// Returns true when the last test() invocation recognized limit violation
-	inline bool isLimit() const
-	{
-		return m_solveLimit;
-	}
-
-	/// Checks given angle against limit. If limit is active and angle doesn't fit it, the angle
-	/// returned is modified so it equals to the limit closest to given angle.
-	void fit(btScalar& angle) const;
-
-	/// Returns correction value multiplied by sign value
-	btScalar getError() const;
-
-	btScalar getLow() const;
-
-	btScalar getHigh() const;
-
-};
-
-
-
-#endif //BT_TYPED_CONSTRAINT_H
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp
deleted file mode 100644
index 40c56e7..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library, http://bulletphysics.org
-Copyright (C) 2006, 2007 Sony Computer Entertainment Inc. 
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-#include "btUniversalConstraint.h"
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-#include "LinearMath/btTransformUtil.h"
-
-
-
-#define UNIV_EPS btScalar(0.01f)
-
-
-// constructor
-// anchor, axis1 and axis2 are in world coordinate system
-// axis1 must be orthogonal to axis2
-btUniversalConstraint::btUniversalConstraint(btRigidBody& rbA, btRigidBody& rbB, btVector3& anchor, btVector3& axis1, btVector3& axis2)
-: btGeneric6DofConstraint(rbA, rbB, btTransform::getIdentity(), btTransform::getIdentity(), true),
- m_anchor(anchor),
- m_axis1(axis1),
- m_axis2(axis2)
-{
-	// build frame basis
-	// 6DOF constraint uses Euler angles and to define limits
-	// it is assumed that rotational order is :
-	// Z - first, allowed limits are (-PI,PI);
-	// new position of Y - second (allowed limits are (-PI/2 + epsilon, PI/2 - epsilon), where epsilon is a small positive number 
-	// used to prevent constraint from instability on poles;
-	// new position of X, allowed limits are (-PI,PI);
-	// So to simulate ODE Universal joint we should use parent axis as Z, child axis as Y and limit all other DOFs
-	// Build the frame in world coordinate system first
-	btVector3 zAxis = axis1.normalize();
-	btVector3 yAxis = axis2.normalize();
-	btVector3 xAxis = yAxis.cross(zAxis); // we want right coordinate system
-	btTransform frameInW;
-	frameInW.setIdentity();
-	frameInW.getBasis().setValue(	xAxis[0], yAxis[0], zAxis[0],	
-									xAxis[1], yAxis[1], zAxis[1],
-									xAxis[2], yAxis[2], zAxis[2]);
-	frameInW.setOrigin(anchor);
-	// now get constraint frame in local coordinate systems
-	m_frameInA = rbA.getCenterOfMassTransform().inverse() * frameInW;
-	m_frameInB = rbB.getCenterOfMassTransform().inverse() * frameInW;
-	// sei limits
-	setLinearLowerLimit(btVector3(0., 0., 0.));
-	setLinearUpperLimit(btVector3(0., 0., 0.));
-	setAngularLowerLimit(btVector3(0.f, -SIMD_HALF_PI + UNIV_EPS, -SIMD_PI + UNIV_EPS));
-	setAngularUpperLimit(btVector3(0.f,  SIMD_HALF_PI - UNIV_EPS,  SIMD_PI - UNIV_EPS));
-}
-
-void btUniversalConstraint::setAxis(const btVector3& axis1,const btVector3& axis2)
-{
-  m_axis1 = axis1;
-  m_axis2 = axis2;
-
-	btVector3 zAxis = axis1.normalized();
-	btVector3 yAxis = axis2.normalized();
-	btVector3 xAxis = yAxis.cross(zAxis); // we want right coordinate system
-
-	btTransform frameInW;
-	frameInW.setIdentity();
-	frameInW.getBasis().setValue(	xAxis[0], yAxis[0], zAxis[0],	
-                                xAxis[1], yAxis[1], zAxis[1],
-                                xAxis[2], yAxis[2], zAxis[2]);
-	frameInW.setOrigin(m_anchor);
-
-	// now get constraint frame in local coordinate systems
-	m_frameInA = m_rbA.getCenterOfMassTransform().inverse() * frameInW;
-	m_frameInB = m_rbB.getCenterOfMassTransform().inverse() * frameInW;
-
-  calculateTransforms();
-}
-
-
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.h
deleted file mode 100644
index bfa48f4..0000000
--- a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library, http://bulletphysics.org
-Copyright (C) 2006, 2007 Sony Computer Entertainment Inc. 
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_UNIVERSAL_CONSTRAINT_H
-#define BT_UNIVERSAL_CONSTRAINT_H
-
-
-
-#include "LinearMath/btVector3.h"
-#include "btTypedConstraint.h"
-#include "btGeneric6DofConstraint.h"
-
-
-
-/// Constraint similar to ODE Universal Joint
-/// has 2 rotatioonal degrees of freedom, similar to Euler rotations around Z (axis 1)
-/// and Y (axis 2)
-/// Description from ODE manual : 
-/// "Given axis 1 on body 1, and axis 2 on body 2 that is perpendicular to axis 1, it keeps them perpendicular. 
-/// In other words, rotation of the two bodies about the direction perpendicular to the two axes will be equal."
-
-class btUniversalConstraint : public btGeneric6DofConstraint
-{
-protected:
-	btVector3	m_anchor;
-	btVector3	m_axis1;
-	btVector3	m_axis2;
-public:
-	// constructor
-	// anchor, axis1 and axis2 are in world coordinate system
-	// axis1 must be orthogonal to axis2
-    btUniversalConstraint(btRigidBody& rbA, btRigidBody& rbB, btVector3& anchor, btVector3& axis1, btVector3& axis2);
-	// access
-	const btVector3& getAnchor() { return m_calculatedTransformA.getOrigin(); }
-	const btVector3& getAnchor2() { return m_calculatedTransformB.getOrigin(); }
-	const btVector3& getAxis1() { return m_axis1; }
-	const btVector3& getAxis2() { return m_axis2; }
-	btScalar getAngle1() { return getAngle(2); }
-	btScalar getAngle2() { return getAngle(1); }
-	// limits
-	void setUpperLimit(btScalar ang1max, btScalar ang2max) { setAngularUpperLimit(btVector3(0.f, ang1max, ang2max)); }
-	void setLowerLimit(btScalar ang1min, btScalar ang2min) { setAngularLowerLimit(btVector3(0.f, ang1min, ang2min)); }
-
-	void setAxis( const btVector3& axis1, const btVector3& axis2);
-};
-
-
-
-#endif // BT_UNIVERSAL_CONSTRAINT_H
-
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/Bullet-C-API.cpp b/hkl3d/bullet/src/BulletDynamics/Dynamics/Bullet-C-API.cpp
deleted file mode 100644
index bd8e274..0000000
--- a/hkl3d/bullet/src/BulletDynamics/Dynamics/Bullet-C-API.cpp
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
-	Draft high-level generic physics C-API. For low-level access, use the physics SDK native API's.
-	Work in progress, functionality will be added on demand.
-
-	If possible, use the richer Bullet C++ API, by including <src/btBulletDynamicsCommon.h>
-*/
-
-#include "Bullet-C-Api.h"
-#include "btBulletDynamicsCommon.h"
-#include "LinearMath/btAlignedAllocator.h"
-
-
-
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btScalar.h"	
-#include "LinearMath/btMatrix3x3.h"
-#include "LinearMath/btTransform.h"
-#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
-#include "BulletCollision/CollisionShapes/btTriangleShape.h"
-
-#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h"
-#include "BulletCollision/NarrowPhaseCollision/btPointCollector.h"
-#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
-#include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h"
-#include "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h"
-#include "BulletCollision/NarrowPhaseCollision/btGjkEpa2.h"
-#include "BulletCollision/CollisionShapes/btMinkowskiSumShape.h"
-#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"
-#include "BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h"
-#include "BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h"
-
-
-/*
-	Create and Delete a Physics SDK	
-*/
-
-struct	btPhysicsSdk
-{
-
-//	btDispatcher*				m_dispatcher;
-//	btOverlappingPairCache*		m_pairCache;
-//	btConstraintSolver*			m_constraintSolver
-
-	btVector3	m_worldAabbMin;
-	btVector3	m_worldAabbMax;
-
-
-	//todo: version, hardware/optimization settings etc?
-	btPhysicsSdk()
-		:m_worldAabbMin(-1000,-1000,-1000),
-		m_worldAabbMax(1000,1000,1000)
-	{
-
-	}
-
-	
-};
-
-plPhysicsSdkHandle	plNewBulletSdk()
-{
-	void* mem = btAlignedAlloc(sizeof(btPhysicsSdk),16);
-	return (plPhysicsSdkHandle)new (mem)btPhysicsSdk;
-}
-
-void		plDeletePhysicsSdk(plPhysicsSdkHandle	physicsSdk)
-{
-	btPhysicsSdk* phys = reinterpret_cast<btPhysicsSdk*>(physicsSdk);
-	btAlignedFree(phys);	
-}
-
-
-/* Dynamics World */
-plDynamicsWorldHandle plCreateDynamicsWorld(plPhysicsSdkHandle physicsSdkHandle)
-{
-	btPhysicsSdk* physicsSdk = reinterpret_cast<btPhysicsSdk*>(physicsSdkHandle);
-	void* mem = btAlignedAlloc(sizeof(btDefaultCollisionConfiguration),16);
-	btDefaultCollisionConfiguration* collisionConfiguration = new (mem)btDefaultCollisionConfiguration();
-	mem = btAlignedAlloc(sizeof(btCollisionDispatcher),16);
-	btDispatcher*				dispatcher = new (mem)btCollisionDispatcher(collisionConfiguration);
-	mem = btAlignedAlloc(sizeof(btAxisSweep3),16);
-	btBroadphaseInterface*		pairCache = new (mem)btAxisSweep3(physicsSdk->m_worldAabbMin,physicsSdk->m_worldAabbMax);
-	mem = btAlignedAlloc(sizeof(btSequentialImpulseConstraintSolver),16);
-	btConstraintSolver*			constraintSolver = new(mem) btSequentialImpulseConstraintSolver();
-
-	mem = btAlignedAlloc(sizeof(btDiscreteDynamicsWorld),16);
-	return (plDynamicsWorldHandle) new (mem)btDiscreteDynamicsWorld(dispatcher,pairCache,constraintSolver,collisionConfiguration);
-}
-void           plDeleteDynamicsWorld(plDynamicsWorldHandle world)
-{
-	//todo: also clean up the other allocations, axisSweep, pairCache,dispatcher,constraintSolver,collisionConfiguration
-	btDynamicsWorld* dynamicsWorld = reinterpret_cast< btDynamicsWorld* >(world);
-	btAlignedFree(dynamicsWorld);
-}
-
-void	plStepSimulation(plDynamicsWorldHandle world,	plReal	timeStep)
-{
-	btDynamicsWorld* dynamicsWorld = reinterpret_cast< btDynamicsWorld* >(world);
-	btAssert(dynamicsWorld);
-	dynamicsWorld->stepSimulation(timeStep);
-}
-
-void plAddRigidBody(plDynamicsWorldHandle world, plRigidBodyHandle object)
-{
-	btDynamicsWorld* dynamicsWorld = reinterpret_cast< btDynamicsWorld* >(world);
-	btAssert(dynamicsWorld);
-	btRigidBody* body = reinterpret_cast< btRigidBody* >(object);
-	btAssert(body);
-
-	dynamicsWorld->addRigidBody(body);
-}
-
-void plRemoveRigidBody(plDynamicsWorldHandle world, plRigidBodyHandle object)
-{
-	btDynamicsWorld* dynamicsWorld = reinterpret_cast< btDynamicsWorld* >(world);
-	btAssert(dynamicsWorld);
-	btRigidBody* body = reinterpret_cast< btRigidBody* >(object);
-	btAssert(body);
-
-	dynamicsWorld->removeRigidBody(body);
-}
-
-/* Rigid Body  */
-
-plRigidBodyHandle plCreateRigidBody(	void* user_data,  float mass, plCollisionShapeHandle cshape )
-{
-	btTransform trans;
-	trans.setIdentity();
-	btVector3 localInertia(0,0,0);
-	btCollisionShape* shape = reinterpret_cast<btCollisionShape*>( cshape);
-	btAssert(shape);
-	if (mass)
-	{
-		shape->calculateLocalInertia(mass,localInertia);
-	}
-	void* mem = btAlignedAlloc(sizeof(btRigidBody),16);
-	btRigidBody::btRigidBodyConstructionInfo rbci(mass, 0,shape,localInertia);
-	btRigidBody* body = new (mem)btRigidBody(rbci);
-	body->setWorldTransform(trans);
-	body->setUserPointer(user_data);
-	return (plRigidBodyHandle) body;
-}
-
-void plDeleteRigidBody(plRigidBodyHandle cbody)
-{
-	btRigidBody* body = reinterpret_cast< btRigidBody* >(cbody);
-	btAssert(body);
-	btAlignedFree( body);
-}
-
-
-/* Collision Shape definition */
-
-plCollisionShapeHandle plNewSphereShape(plReal radius)
-{
-	void* mem = btAlignedAlloc(sizeof(btSphereShape),16);
-	return (plCollisionShapeHandle) new (mem)btSphereShape(radius);
-	
-}
-	
-plCollisionShapeHandle plNewBoxShape(plReal x, plReal y, plReal z)
-{
-	void* mem = btAlignedAlloc(sizeof(btBoxShape),16);
-	return (plCollisionShapeHandle) new (mem)btBoxShape(btVector3(x,y,z));
-}
-
-plCollisionShapeHandle plNewCapsuleShape(plReal radius, plReal height)
-{
-	//capsule is convex hull of 2 spheres, so use btMultiSphereShape
-	
-	const int numSpheres = 2;
-	btVector3 positions[numSpheres] = {btVector3(0,height,0),btVector3(0,-height,0)};
-	btScalar radi[numSpheres] = {radius,radius};
-	void* mem = btAlignedAlloc(sizeof(btMultiSphereShape),16);
-	return (plCollisionShapeHandle) new (mem)btMultiSphereShape(positions,radi,numSpheres);
-}
-plCollisionShapeHandle plNewConeShape(plReal radius, plReal height)
-{
-	void* mem = btAlignedAlloc(sizeof(btConeShape),16);
-	return (plCollisionShapeHandle) new (mem)btConeShape(radius,height);
-}
-
-plCollisionShapeHandle plNewCylinderShape(plReal radius, plReal height)
-{
-	void* mem = btAlignedAlloc(sizeof(btCylinderShape),16);
-	return (plCollisionShapeHandle) new (mem)btCylinderShape(btVector3(radius,height,radius));
-}
-
-/* Convex Meshes */
-plCollisionShapeHandle plNewConvexHullShape()
-{
-	void* mem = btAlignedAlloc(sizeof(btConvexHullShape),16);
-	return (plCollisionShapeHandle) new (mem)btConvexHullShape();
-}
-
-
-/* Concave static triangle meshes */
-plMeshInterfaceHandle		   plNewMeshInterface()
-{
-	return 0;
-}
-
-plCollisionShapeHandle plNewCompoundShape()
-{
-	void* mem = btAlignedAlloc(sizeof(btCompoundShape),16);
-	return (plCollisionShapeHandle) new (mem)btCompoundShape();
-}
-
-void	plAddChildShape(plCollisionShapeHandle compoundShapeHandle,plCollisionShapeHandle childShapeHandle, plVector3 childPos,plQuaternion childOrn)
-{
-	btCollisionShape* colShape = reinterpret_cast<btCollisionShape*>(compoundShapeHandle);
-	btAssert(colShape->getShapeType() == COMPOUND_SHAPE_PROXYTYPE);
-	btCompoundShape* compoundShape = reinterpret_cast<btCompoundShape*>(colShape);
-	btCollisionShape* childShape = reinterpret_cast<btCollisionShape*>(childShapeHandle);
-	btTransform	localTrans;
-	localTrans.setIdentity();
-	localTrans.setOrigin(btVector3(childPos[0],childPos[1],childPos[2]));
-	localTrans.setRotation(btQuaternion(childOrn[0],childOrn[1],childOrn[2],childOrn[3]));
-	compoundShape->addChildShape(localTrans,childShape);
-}
-
-void plSetEuler(plReal yaw,plReal pitch,plReal roll, plQuaternion orient)
-{
-	btQuaternion orn;
-	orn.setEuler(yaw,pitch,roll);
-	orient[0] = orn.getX();
-	orient[1] = orn.getY();
-	orient[2] = orn.getZ();
-	orient[3] = orn.getW();
-
-}
-
-
-//	extern  void		plAddTriangle(plMeshInterfaceHandle meshHandle, plVector3 v0,plVector3 v1,plVector3 v2);
-//	extern  plCollisionShapeHandle plNewStaticTriangleMeshShape(plMeshInterfaceHandle);
-
-
-void		plAddVertex(plCollisionShapeHandle cshape, plReal x,plReal y,plReal z)
-{
-	btCollisionShape* colShape = reinterpret_cast<btCollisionShape*>( cshape);
-	(void)colShape;
-	btAssert(colShape->getShapeType()==CONVEX_HULL_SHAPE_PROXYTYPE);
-	btConvexHullShape* convexHullShape = reinterpret_cast<btConvexHullShape*>( cshape);
-	convexHullShape->addPoint(btVector3(x,y,z));
-
-}
-
-void plDeleteShape(plCollisionShapeHandle cshape)
-{
-	btCollisionShape* shape = reinterpret_cast<btCollisionShape*>( cshape);
-	btAssert(shape);
-	btAlignedFree(shape);
-}
-void plSetScaling(plCollisionShapeHandle cshape, plVector3 cscaling)
-{
-	btCollisionShape* shape = reinterpret_cast<btCollisionShape*>( cshape);
-	btAssert(shape);
-	btVector3 scaling(cscaling[0],cscaling[1],cscaling[2]);
-	shape->setLocalScaling(scaling);	
-}
-
-
-
-void plSetPosition(plRigidBodyHandle object, const plVector3 position)
-{
-	btRigidBody* body = reinterpret_cast< btRigidBody* >(object);
-	btAssert(body);
-	btVector3 pos(position[0],position[1],position[2]);
-	btTransform worldTrans = body->getWorldTransform();
-	worldTrans.setOrigin(pos);
-	body->setWorldTransform(worldTrans);
-}
-
-void plSetOrientation(plRigidBodyHandle object, const plQuaternion orientation)
-{
-	btRigidBody* body = reinterpret_cast< btRigidBody* >(object);
-	btAssert(body);
-	btQuaternion orn(orientation[0],orientation[1],orientation[2],orientation[3]);
-	btTransform worldTrans = body->getWorldTransform();
-	worldTrans.setRotation(orn);
-	body->setWorldTransform(worldTrans);
-}
-
-void	plSetOpenGLMatrix(plRigidBodyHandle object, plReal* matrix)
-{
-	btRigidBody* body = reinterpret_cast< btRigidBody* >(object);
-	btAssert(body);
-	btTransform& worldTrans = body->getWorldTransform();
-	worldTrans.setFromOpenGLMatrix(matrix);
-}
-
-void	plGetOpenGLMatrix(plRigidBodyHandle object, plReal* matrix)
-{
-	btRigidBody* body = reinterpret_cast< btRigidBody* >(object);
-	btAssert(body);
-	body->getWorldTransform().getOpenGLMatrix(matrix);
-
-}
-
-void	plGetPosition(plRigidBodyHandle object,plVector3 position)
-{
-	btRigidBody* body = reinterpret_cast< btRigidBody* >(object);
-	btAssert(body);
-	const btVector3& pos = body->getWorldTransform().getOrigin();
-	position[0] = pos.getX();
-	position[1] = pos.getY();
-	position[2] = pos.getZ();
-}
-
-void plGetOrientation(plRigidBodyHandle object,plQuaternion orientation)
-{
-	btRigidBody* body = reinterpret_cast< btRigidBody* >(object);
-	btAssert(body);
-	const btQuaternion& orn = body->getWorldTransform().getRotation();
-	orientation[0] = orn.getX();
-	orientation[1] = orn.getY();
-	orientation[2] = orn.getZ();
-	orientation[3] = orn.getW();
-}
-
-
-
-//plRigidBodyHandle plRayCast(plDynamicsWorldHandle world, const plVector3 rayStart, const plVector3 rayEnd, plVector3 hitpoint, plVector3 normal);
-
-//	extern  plRigidBodyHandle plObjectCast(plDynamicsWorldHandle world, const plVector3 rayStart, const plVector3 rayEnd, plVector3 hitpoint, plVector3 normal);
-
-double plNearestPoints(float p1[3], float p2[3], float p3[3], float q1[3], float q2[3], float q3[3], float *pa, float *pb, float normal[3])
-{
-	btVector3 vp(p1[0], p1[1], p1[2]);
-	btTriangleShape trishapeA(vp, 
-				  btVector3(p2[0], p2[1], p2[2]), 
-				  btVector3(p3[0], p3[1], p3[2]));
-	trishapeA.setMargin(0.000001f);
-	btVector3 vq(q1[0], q1[1], q1[2]);
-	btTriangleShape trishapeB(vq, 
-				  btVector3(q2[0], q2[1], q2[2]), 
-				  btVector3(q3[0], q3[1], q3[2]));
-	trishapeB.setMargin(0.000001f);
-	
-	// btVoronoiSimplexSolver sGjkSimplexSolver;
-	// btGjkEpaPenetrationDepthSolver penSolverPtr;	
-	
-	static btSimplexSolverInterface sGjkSimplexSolver;
-	sGjkSimplexSolver.reset();
-	
-	static btGjkEpaPenetrationDepthSolver Solver0;
-	static btMinkowskiPenetrationDepthSolver Solver1;
-		
-	btConvexPenetrationDepthSolver* Solver = NULL;
-	
-	Solver = &Solver1;	
-		
-	btGjkPairDetector convexConvex(&trishapeA ,&trishapeB,&sGjkSimplexSolver,Solver);
-	
-	convexConvex.m_catchDegeneracies = 1;
-	
-	// btGjkPairDetector convexConvex(&trishapeA ,&trishapeB,&sGjkSimplexSolver,0);
-	
-	btPointCollector gjkOutput;
-	btGjkPairDetector::ClosestPointInput input;
-	
-		
-	btTransform tr;
-	tr.setIdentity();
-	
-	input.m_transformA = tr;
-	input.m_transformB = tr;
-	
-	convexConvex.getClosestPoints(input, gjkOutput, 0);
-	
-	
-	if (gjkOutput.m_hasResult)
-	{
-		
-		pb[0] = pa[0] = gjkOutput.m_pointInWorld[0];
-		pb[1] = pa[1] = gjkOutput.m_pointInWorld[1];
-		pb[2] = pa[2] = gjkOutput.m_pointInWorld[2];
-
-		pb[0]+= gjkOutput.m_normalOnBInWorld[0] * gjkOutput.m_distance;
-		pb[1]+= gjkOutput.m_normalOnBInWorld[1] * gjkOutput.m_distance;
-		pb[2]+= gjkOutput.m_normalOnBInWorld[2] * gjkOutput.m_distance;
-		
-		normal[0] = gjkOutput.m_normalOnBInWorld[0];
-		normal[1] = gjkOutput.m_normalOnBInWorld[1];
-		normal[2] = gjkOutput.m_normalOnBInWorld[2];
-
-		return gjkOutput.m_distance;
-	}
-	return -1.0f;	
-}
-
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/btActionInterface.h b/hkl3d/bullet/src/BulletDynamics/Dynamics/btActionInterface.h
deleted file mode 100644
index e1fea3a..0000000
--- a/hkl3d/bullet/src/BulletDynamics/Dynamics/btActionInterface.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _BT_ACTION_INTERFACE_H
-#define _BT_ACTION_INTERFACE_H
-
-class btIDebugDraw;
-class btCollisionWorld;
-
-#include "LinearMath/btScalar.h"
-#include "btRigidBody.h"
-
-///Basic interface to allow actions such as vehicles and characters to be updated inside a btDynamicsWorld
-class btActionInterface
-{
-protected:
-
-	static btRigidBody& getFixedBody();
-	
-	
-public:
-
-	virtual ~btActionInterface()
-	{
-	}
-
-	virtual void updateAction( btCollisionWorld* collisionWorld, btScalar deltaTimeStep)=0;
-
-	virtual void debugDraw(btIDebugDraw* debugDrawer) = 0;
-
-};
-
-#endif //_BT_ACTION_INTERFACE_H
-
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp b/hkl3d/bullet/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp
deleted file mode 100644
index 23501c4..0000000
--- a/hkl3d/bullet/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "btContinuousDynamicsWorld.h"
-#include "LinearMath/btQuickprof.h"
-
-//collision detection
-#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
-#include "BulletCollision/BroadphaseCollision/btSimpleBroadphase.h"
-#include "BulletCollision/CollisionShapes/btCollisionShape.h"
-#include "BulletCollision/CollisionDispatch/btSimulationIslandManager.h"
-
-//rigidbody & constraints
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-#include "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h"
-#include "BulletDynamics/ConstraintSolver/btContactSolverInfo.h"
-#include "BulletDynamics/ConstraintSolver/btTypedConstraint.h"
-
-
-
-#include <stdio.h>
-
-btContinuousDynamicsWorld::btContinuousDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration)
-:btDiscreteDynamicsWorld(dispatcher,pairCache,constraintSolver,collisionConfiguration)
-{
-}
-
-btContinuousDynamicsWorld::~btContinuousDynamicsWorld()
-{
-}
-
-	
-void	btContinuousDynamicsWorld::internalSingleStepSimulation( btScalar timeStep)
-{
-	
-	startProfiling(timeStep);
-	
-	if(0 != m_internalPreTickCallback) {
-		(*m_internalPreTickCallback)(this, timeStep);
-	}
-
-
-	///update aabbs information
-	updateAabbs();
-	//static int frame=0;
-//	printf("frame %d\n",frame++);
-
-	///apply gravity, predict motion
-	predictUnconstraintMotion(timeStep);
-
-	btDispatcherInfo& dispatchInfo = getDispatchInfo();
-
-	dispatchInfo.m_timeStep = timeStep;
-	dispatchInfo.m_stepCount = 0;
-	dispatchInfo.m_debugDraw = getDebugDrawer();
-
-	///perform collision detection
-	performDiscreteCollisionDetection();
-
-	calculateSimulationIslands();
-
-	
-	getSolverInfo().m_timeStep = timeStep;
-	
-
-
-	///solve contact and other joint constraints
-	solveConstraints(getSolverInfo());
-	
-	///CallbackTriggers();
-	calculateTimeOfImpacts(timeStep);
-
-	btScalar toi = dispatchInfo.m_timeOfImpact;
-//	if (toi < 1.f)
-//		printf("toi = %f\n",toi);
-	if (toi < 0.f)
-		printf("toi = %f\n",toi);
-
-
-	///integrate transforms
-	integrateTransforms(timeStep * toi);
-
-	///update vehicle simulation
-	updateActions(timeStep);
-
-	updateActivationState( timeStep );
-	
-	if(0 != m_internalTickCallback) {
-		(*m_internalTickCallback)(this, timeStep);
-	}
-}
-
-void	btContinuousDynamicsWorld::calculateTimeOfImpacts(btScalar timeStep)
-{
-		///these should be 'temporal' aabbs!
-		updateTemporalAabbs(timeStep);
-		
-		///'toi' is the global smallest time of impact. However, we just calculate the time of impact for each object individually.
-		///so we handle the case moving versus static properly, and we cheat for moving versus moving
-		btScalar toi = 1.f;
-		
-	
-		btDispatcherInfo& dispatchInfo = getDispatchInfo();
-		dispatchInfo.m_timeStep = timeStep;
-		dispatchInfo.m_timeOfImpact = 1.f;
-		dispatchInfo.m_stepCount = 0;
-		dispatchInfo.m_dispatchFunc = btDispatcherInfo::DISPATCH_CONTINUOUS;
-
-		///calculate time of impact for overlapping pairs
-
-
-		btDispatcher* dispatcher = getDispatcher();
-		if (dispatcher)
-			dispatcher->dispatchAllCollisionPairs(m_broadphasePairCache->getOverlappingPairCache(),dispatchInfo,m_dispatcher1);
-
-		toi = dispatchInfo.m_timeOfImpact;
-
-		dispatchInfo.m_dispatchFunc = btDispatcherInfo::DISPATCH_DISCRETE;
-
-}
-
-void	btContinuousDynamicsWorld::updateTemporalAabbs(btScalar timeStep)
-{
-
-	btVector3 temporalAabbMin,temporalAabbMax;
-
-	for ( int i=0;i<m_collisionObjects.size();i++)
-	{
-		btCollisionObject* colObj = m_collisionObjects[i];
-		
-		btRigidBody* body = btRigidBody::upcast(colObj);
-		if (body)
-		{
-			body->getCollisionShape()->getAabb(m_collisionObjects[i]->getWorldTransform(),temporalAabbMin,temporalAabbMax);
-			const btVector3& linvel = body->getLinearVelocity();
-
-			//make the AABB temporal
-			btScalar temporalAabbMaxx = temporalAabbMax.getX();
-			btScalar temporalAabbMaxy = temporalAabbMax.getY();
-			btScalar temporalAabbMaxz = temporalAabbMax.getZ();
-			btScalar temporalAabbMinx = temporalAabbMin.getX();
-			btScalar temporalAabbMiny = temporalAabbMin.getY();
-			btScalar temporalAabbMinz = temporalAabbMin.getZ();
-
-			// add linear motion
-			btVector3 linMotion = linvel*timeStep;
-		
-			if (linMotion.x() > 0.f)
-				temporalAabbMaxx += linMotion.x(); 
-			else
-				temporalAabbMinx += linMotion.x();
-			if (linMotion.y() > 0.f)
-				temporalAabbMaxy += linMotion.y(); 
-			else
-				temporalAabbMiny += linMotion.y();
-			if (linMotion.z() > 0.f)
-				temporalAabbMaxz += linMotion.z(); 
-			else
-				temporalAabbMinz += linMotion.z();
-
-			//add conservative angular motion
-			btScalar angularMotion(0);// = angvel.length() * GetAngularMotionDisc() * timeStep;
-			btVector3 angularMotion3d(angularMotion,angularMotion,angularMotion);
-			temporalAabbMin = btVector3(temporalAabbMinx,temporalAabbMiny,temporalAabbMinz);
-			temporalAabbMax = btVector3(temporalAabbMaxx,temporalAabbMaxy,temporalAabbMaxz);
-
-			temporalAabbMin -= angularMotion3d;
-			temporalAabbMax += angularMotion3d;
-
-			m_broadphasePairCache->setAabb(body->getBroadphaseHandle(),temporalAabbMin,temporalAabbMax,m_dispatcher1);
-		}
-	}
-
-	//update aabb (of all moved objects)
-
-	m_broadphasePairCache->calculateOverlappingPairs(m_dispatcher1);
-	
-
-
-}
-
-
-
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.h b/hkl3d/bullet/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.h
deleted file mode 100644
index 61c8dea..0000000
--- a/hkl3d/bullet/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_CONTINUOUS_DYNAMICS_WORLD_H
-#define BT_CONTINUOUS_DYNAMICS_WORLD_H
-
-#include "btDiscreteDynamicsWorld.h"
-
-///btContinuousDynamicsWorld adds optional (per object) continuous collision detection for fast moving objects to the btDiscreteDynamicsWorld.
-///This copes with fast moving objects that otherwise would tunnel/miss collisions.
-///Under construction, don't use yet! Please use btDiscreteDynamicsWorld instead.
-class btContinuousDynamicsWorld : public btDiscreteDynamicsWorld
-{
-
-	void	updateTemporalAabbs(btScalar timeStep);
-
-	public:
-
-		btContinuousDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration);
-		virtual ~btContinuousDynamicsWorld();
-		
-		///time stepping with calculation of time of impact for selected fast moving objects
-		virtual void	internalSingleStepSimulation( btScalar timeStep);
-
-		virtual void	calculateTimeOfImpacts(btScalar timeStep);
-
-		virtual btDynamicsWorldType	getWorldType() const
-		{
-			return BT_CONTINUOUS_DYNAMICS_WORLD;
-		}
-
-};
-
-#endif //BT_CONTINUOUS_DYNAMICS_WORLD_H
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp b/hkl3d/bullet/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
deleted file mode 100644
index b08dcf0..0000000
--- a/hkl3d/bullet/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
+++ /dev/null
@@ -1,1348 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "btDiscreteDynamicsWorld.h"
-
-//collision detection
-#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
-#include "BulletCollision/BroadphaseCollision/btSimpleBroadphase.h"
-#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
-#include "BulletCollision/CollisionShapes/btCollisionShape.h"
-#include "BulletCollision/CollisionDispatch/btSimulationIslandManager.h"
-#include "LinearMath/btTransformUtil.h"
-#include "LinearMath/btQuickprof.h"
-
-//rigidbody & constraints
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-#include "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h"
-#include "BulletDynamics/ConstraintSolver/btContactSolverInfo.h"
-#include "BulletDynamics/ConstraintSolver/btTypedConstraint.h"
-#include "BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h"
-#include "BulletDynamics/ConstraintSolver/btHingeConstraint.h"
-#include "BulletDynamics/ConstraintSolver/btConeTwistConstraint.h"
-#include "BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h"
-#include "BulletDynamics/ConstraintSolver/btSliderConstraint.h"
-#include "BulletDynamics/ConstraintSolver/btContactConstraint.h"
-
-
-#include "LinearMath/btIDebugDraw.h"
-#include "BulletCollision/CollisionShapes/btSphereShape.h"
-
-
-#include "BulletDynamics/Dynamics/btActionInterface.h"
-#include "LinearMath/btQuickprof.h"
-#include "LinearMath/btMotionState.h"
-
-#include "LinearMath/btSerializer.h"
-
-#if 0
-btAlignedObjectArray<btVector3> debugContacts;
-btAlignedObjectArray<btVector3> debugNormals;
-int startHit=2;
-int firstHit=startHit;
-#endif
-
-
-
-btDiscreteDynamicsWorld::btDiscreteDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver, btCollisionConfiguration* collisionConfiguration)
-:btDynamicsWorld(dispatcher,pairCache,collisionConfiguration),
-m_constraintSolver(constraintSolver),
-m_gravity(0,-10,0),
-m_localTime(0),
-m_synchronizeAllMotionStates(false),
-m_profileTimings(0)
-{
-	if (!m_constraintSolver)
-	{
-		void* mem = btAlignedAlloc(sizeof(btSequentialImpulseConstraintSolver),16);
-		m_constraintSolver = new (mem) btSequentialImpulseConstraintSolver;
-		m_ownsConstraintSolver = true;
-	} else
-	{
-		m_ownsConstraintSolver = false;
-	}
-
-	{
-		void* mem = btAlignedAlloc(sizeof(btSimulationIslandManager),16);
-		m_islandManager = new (mem) btSimulationIslandManager();
-	}
-
-	m_ownsIslandManager = true;
-}
-
-
-btDiscreteDynamicsWorld::~btDiscreteDynamicsWorld()
-{
-	//only delete it when we created it
-	if (m_ownsIslandManager)
-	{
-		m_islandManager->~btSimulationIslandManager();
-		btAlignedFree( m_islandManager);
-	}
-	if (m_ownsConstraintSolver)
-	{
-
-		m_constraintSolver->~btConstraintSolver();
-		btAlignedFree(m_constraintSolver);
-	}
-}
-
-void	btDiscreteDynamicsWorld::saveKinematicState(btScalar timeStep)
-{
-///would like to iterate over m_nonStaticRigidBodies, but unfortunately old API allows
-///to switch status _after_ adding kinematic objects to the world
-///fix it for Bullet 3.x release
-	for (int i=0;i<m_collisionObjects.size();i++)
-	{
-		btCollisionObject* colObj = m_collisionObjects[i];
-		btRigidBody* body = btRigidBody::upcast(colObj);
-		if (body && body->getActivationState() != ISLAND_SLEEPING)
-		{
-			if (body->isKinematicObject())
-			{
-				//to calculate velocities next frame
-				body->saveKinematicState(timeStep);
-			}
-		}
-	}
-
-}
-
-void	btDiscreteDynamicsWorld::debugDrawWorld()
-{
-	BT_PROFILE("debugDrawWorld");
-
-	btCollisionWorld::debugDrawWorld();
-
-	bool drawConstraints = false;
-	if (getDebugDrawer())
-	{
-		int mode = getDebugDrawer()->getDebugMode();
-		if(mode  & (btIDebugDraw::DBG_DrawConstraints | btIDebugDraw::DBG_DrawConstraintLimits))
-		{
-			drawConstraints = true;
-		}
-	}
-	if(drawConstraints)
-	{
-		for(int i = getNumConstraints()-1; i>=0 ;i--)
-		{
-			btTypedConstraint* constraint = getConstraint(i);
-			debugDrawConstraint(constraint);
-		}
-	}
-
-
-
-	if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe | btIDebugDraw::DBG_DrawAabb))
-	{
-		int i;
-
-		if (getDebugDrawer() && getDebugDrawer()->getDebugMode())
-		{
-			for (i=0;i<m_actions.size();i++)
-			{
-				m_actions[i]->debugDraw(m_debugDrawer);
-			}
-		}
-	}
-}
-
-void	btDiscreteDynamicsWorld::clearForces()
-{
-	///@todo: iterate over awake simulation islands!
-	for ( int i=0;i<m_nonStaticRigidBodies.size();i++)
-	{
-		btRigidBody* body = m_nonStaticRigidBodies[i];
-		//need to check if next line is ok
-		//it might break backward compatibility (people applying forces on sleeping objects get never cleared and accumulate on wake-up
-		body->clearForces();
-	}
-}	
-
-///apply gravity, call this once per timestep
-void	btDiscreteDynamicsWorld::applyGravity()
-{
-	///@todo: iterate over awake simulation islands!
-	for ( int i=0;i<m_nonStaticRigidBodies.size();i++)
-	{
-		btRigidBody* body = m_nonStaticRigidBodies[i];
-		if (body->isActive())
-		{
-			body->applyGravity();
-		}
-	}
-}
-
-
-void	btDiscreteDynamicsWorld::synchronizeSingleMotionState(btRigidBody* body)
-{
-	btAssert(body);
-
-	if (body->getMotionState() && !body->isStaticOrKinematicObject())
-	{
-		//we need to call the update at least once, even for sleeping objects
-		//otherwise the 'graphics' transform never updates properly
-		///@todo: add 'dirty' flag
-		//if (body->getActivationState() != ISLAND_SLEEPING)
-		{
-			btTransform interpolatedTransform;
-			btTransformUtil::integrateTransform(body->getInterpolationWorldTransform(),
-				body->getInterpolationLinearVelocity(),body->getInterpolationAngularVelocity(),m_localTime*body->getHitFraction(),interpolatedTransform);
-			body->getMotionState()->setWorldTransform(interpolatedTransform);
-		}
-	}
-}
-
-
-void	btDiscreteDynamicsWorld::synchronizeMotionStates()
-{
-	BT_PROFILE("synchronizeMotionStates");
-	if (m_synchronizeAllMotionStates)
-	{
-		//iterate  over all collision objects
-		for ( int i=0;i<m_collisionObjects.size();i++)
-		{
-			btCollisionObject* colObj = m_collisionObjects[i];
-			btRigidBody* body = btRigidBody::upcast(colObj);
-			if (body)
-				synchronizeSingleMotionState(body);
-		}
-	} else
-	{
-		//iterate over all active rigid bodies
-		for ( int i=0;i<m_nonStaticRigidBodies.size();i++)
-		{
-			btRigidBody* body = m_nonStaticRigidBodies[i];
-			if (body->isActive())
-				synchronizeSingleMotionState(body);
-		}
-	}
-}
-
-
-int	btDiscreteDynamicsWorld::stepSimulation( btScalar timeStep,int maxSubSteps, btScalar fixedTimeStep)
-{
-	startProfiling(timeStep);
-
-	BT_PROFILE("stepSimulation");
-
-	int numSimulationSubSteps = 0;
-
-	if (maxSubSteps)
-	{
-		//fixed timestep with interpolation
-		m_localTime += timeStep;
-		if (m_localTime >= fixedTimeStep)
-		{
-			numSimulationSubSteps = int( m_localTime / fixedTimeStep);
-			m_localTime -= numSimulationSubSteps * fixedTimeStep;
-		}
-	} else
-	{
-		//variable timestep
-		fixedTimeStep = timeStep;
-		m_localTime = timeStep;
-		if (btFuzzyZero(timeStep))
-		{
-			numSimulationSubSteps = 0;
-			maxSubSteps = 0;
-		} else
-		{
-			numSimulationSubSteps = 1;
-			maxSubSteps = 1;
-		}
-	}
-
-	//process some debugging flags
-	if (getDebugDrawer())
-	{
-		btIDebugDraw* debugDrawer = getDebugDrawer ();
-		gDisableDeactivation = (debugDrawer->getDebugMode() & btIDebugDraw::DBG_NoDeactivation) != 0;
-	}
-	if (numSimulationSubSteps)
-	{
-
-		//clamp the number of substeps, to prevent simulation grinding spiralling down to a halt
-		int clampedSimulationSteps = (numSimulationSubSteps > maxSubSteps)? maxSubSteps : numSimulationSubSteps;
-
-		saveKinematicState(fixedTimeStep*clampedSimulationSteps);
-
-		applyGravity();
-
-		
-
-		for (int i=0;i<clampedSimulationSteps;i++)
-		{
-			internalSingleStepSimulation(fixedTimeStep);
-			synchronizeMotionStates();
-		}
-
-	} else
-	{
-		synchronizeMotionStates();
-	}
-
-	clearForces();
-
-#ifndef BT_NO_PROFILE
-	CProfileManager::Increment_Frame_Counter();
-#endif //BT_NO_PROFILE
-	
-	return numSimulationSubSteps;
-}
-
-void	btDiscreteDynamicsWorld::internalSingleStepSimulation(btScalar timeStep)
-{
-	
-	BT_PROFILE("internalSingleStepSimulation");
-
-	if(0 != m_internalPreTickCallback) {
-		(*m_internalPreTickCallback)(this, timeStep);
-	}	
-
-	///apply gravity, predict motion
-	predictUnconstraintMotion(timeStep);
-
-	btDispatcherInfo& dispatchInfo = getDispatchInfo();
-
-	dispatchInfo.m_timeStep = timeStep;
-	dispatchInfo.m_stepCount = 0;
-	dispatchInfo.m_debugDraw = getDebugDrawer();
-
-
-	///perform collision detection
-	performDiscreteCollisionDetection();
-
-	if (getDispatchInfo().m_useContinuous)
-		addSpeculativeContacts(timeStep);
-
-
-	calculateSimulationIslands();
-
-	
-	getSolverInfo().m_timeStep = timeStep;
-	
-
-
-	///solve contact and other joint constraints
-	solveConstraints(getSolverInfo());
-	
-	///CallbackTriggers();
-
-	///integrate transforms
-	integrateTransforms(timeStep);
-
-	///update vehicle simulation
-	updateActions(timeStep);
-	
-	updateActivationState( timeStep );
-
-	if(0 != m_internalTickCallback) {
-		(*m_internalTickCallback)(this, timeStep);
-	}	
-}
-
-void	btDiscreteDynamicsWorld::setGravity(const btVector3& gravity)
-{
-	m_gravity = gravity;
-	for ( int i=0;i<m_nonStaticRigidBodies.size();i++)
-	{
-		btRigidBody* body = m_nonStaticRigidBodies[i];
-		if (body->isActive() && !(body->getFlags() &BT_DISABLE_WORLD_GRAVITY))
-		{
-			body->setGravity(gravity);
-		}
-	}
-}
-
-btVector3 btDiscreteDynamicsWorld::getGravity () const
-{
-	return m_gravity;
-}
-
-void	btDiscreteDynamicsWorld::addCollisionObject(btCollisionObject* collisionObject,short int collisionFilterGroup,short int collisionFilterMask)
-{
-	btCollisionWorld::addCollisionObject(collisionObject,collisionFilterGroup,collisionFilterMask);
-}
-
-void	btDiscreteDynamicsWorld::removeCollisionObject(btCollisionObject* collisionObject)
-{
-	btRigidBody* body = btRigidBody::upcast(collisionObject);
-	if (body)
-		removeRigidBody(body);
-	else
-		btCollisionWorld::removeCollisionObject(collisionObject);
-}
-
-void	btDiscreteDynamicsWorld::removeRigidBody(btRigidBody* body)
-{
-	m_nonStaticRigidBodies.remove(body);
-	btCollisionWorld::removeCollisionObject(body);
-}
-
-
-void	btDiscreteDynamicsWorld::addRigidBody(btRigidBody* body)
-{
-	if (!body->isStaticOrKinematicObject() && !(body->getFlags() &BT_DISABLE_WORLD_GRAVITY))
-	{
-		body->setGravity(m_gravity);
-	}
-
-	if (body->getCollisionShape())
-	{
-		if (!body->isStaticObject())
-		{
-			m_nonStaticRigidBodies.push_back(body);
-		} else
-		{
-			body->setActivationState(ISLAND_SLEEPING);
-		}
-
-		bool isDynamic = !(body->isStaticObject() || body->isKinematicObject());
-		short collisionFilterGroup = isDynamic? short(btBroadphaseProxy::DefaultFilter) : short(btBroadphaseProxy::StaticFilter);
-		short collisionFilterMask = isDynamic? 	short(btBroadphaseProxy::AllFilter) : 	short(btBroadphaseProxy::AllFilter ^ btBroadphaseProxy::StaticFilter);
-
-		addCollisionObject(body,collisionFilterGroup,collisionFilterMask);
-	}
-}
-
-void	btDiscreteDynamicsWorld::addRigidBody(btRigidBody* body, short group, short mask)
-{
-	if (!body->isStaticOrKinematicObject() && !(body->getFlags() &BT_DISABLE_WORLD_GRAVITY))
-	{
-		body->setGravity(m_gravity);
-	}
-
-	if (body->getCollisionShape())
-	{
-		if (!body->isStaticObject())
-		{
-			m_nonStaticRigidBodies.push_back(body);
-		}
-		 else
-		{
-			body->setActivationState(ISLAND_SLEEPING);
-		}
-		addCollisionObject(body,group,mask);
-	}
-}
-
-
-void	btDiscreteDynamicsWorld::updateActions(btScalar timeStep)
-{
-	BT_PROFILE("updateActions");
-	
-	for ( int i=0;i<m_actions.size();i++)
-	{
-		m_actions[i]->updateAction( this, timeStep);
-	}
-}
-	
-	
-void	btDiscreteDynamicsWorld::updateActivationState(btScalar timeStep)
-{
-	BT_PROFILE("updateActivationState");
-
-	for ( int i=0;i<m_nonStaticRigidBodies.size();i++)
-	{
-		btRigidBody* body = m_nonStaticRigidBodies[i];
-		if (body)
-		{
-			body->updateDeactivation(timeStep);
-
-			if (body->wantsSleeping())
-			{
-				if (body->isStaticOrKinematicObject())
-				{
-					body->setActivationState(ISLAND_SLEEPING);
-				} else
-				{
-					if (body->getActivationState() == ACTIVE_TAG)
-						body->setActivationState( WANTS_DEACTIVATION );
-					if (body->getActivationState() == ISLAND_SLEEPING) 
-					{
-						body->setAngularVelocity(btVector3(0,0,0));
-						body->setLinearVelocity(btVector3(0,0,0));
-					}
-
-				}
-			} else
-			{
-				if (body->getActivationState() != DISABLE_DEACTIVATION)
-					body->setActivationState( ACTIVE_TAG );
-			}
-		}
-	}
-}
-
-void	btDiscreteDynamicsWorld::addConstraint(btTypedConstraint* constraint,bool disableCollisionsBetweenLinkedBodies)
-{
-	m_constraints.push_back(constraint);
-	if (disableCollisionsBetweenLinkedBodies)
-	{
-		constraint->getRigidBodyA().addConstraintRef(constraint);
-		constraint->getRigidBodyB().addConstraintRef(constraint);
-	}
-}
-
-void	btDiscreteDynamicsWorld::removeConstraint(btTypedConstraint* constraint)
-{
-	m_constraints.remove(constraint);
-	constraint->getRigidBodyA().removeConstraintRef(constraint);
-	constraint->getRigidBodyB().removeConstraintRef(constraint);
-}
-
-void	btDiscreteDynamicsWorld::addAction(btActionInterface* action)
-{
-	m_actions.push_back(action);
-}
-
-void	btDiscreteDynamicsWorld::removeAction(btActionInterface* action)
-{
-	m_actions.remove(action);
-}
-
-
-void	btDiscreteDynamicsWorld::addVehicle(btActionInterface* vehicle)
-{
-	addAction(vehicle);
-}
-
-void	btDiscreteDynamicsWorld::removeVehicle(btActionInterface* vehicle)
-{
-	removeAction(vehicle);
-}
-
-void	btDiscreteDynamicsWorld::addCharacter(btActionInterface* character)
-{
-	addAction(character);
-}
-
-void	btDiscreteDynamicsWorld::removeCharacter(btActionInterface* character)
-{
-	removeAction(character);
-}
-
-
-SIMD_FORCE_INLINE	int	btGetConstraintIslandId(const btTypedConstraint* lhs)
-{
-	int islandId;
-	
-	const btCollisionObject& rcolObj0 = lhs->getRigidBodyA();
-	const btCollisionObject& rcolObj1 = lhs->getRigidBodyB();
-	islandId= rcolObj0.getIslandTag()>=0?rcolObj0.getIslandTag():rcolObj1.getIslandTag();
-	return islandId;
-
-}
-
-
-class btSortConstraintOnIslandPredicate
-{
-	public:
-
-		bool operator() ( const btTypedConstraint* lhs, const btTypedConstraint* rhs )
-		{
-			int rIslandId0,lIslandId0;
-			rIslandId0 = btGetConstraintIslandId(rhs);
-			lIslandId0 = btGetConstraintIslandId(lhs);
-			return lIslandId0 < rIslandId0;
-		}
-};
-
-
-
-void	btDiscreteDynamicsWorld::solveConstraints(btContactSolverInfo& solverInfo)
-{
-	BT_PROFILE("solveConstraints");
-	
-	struct InplaceSolverIslandCallback : public btSimulationIslandManager::IslandCallback
-	{
-
-		btContactSolverInfo&	m_solverInfo;
-		btConstraintSolver*		m_solver;
-		btTypedConstraint**		m_sortedConstraints;
-		int						m_numConstraints;
-		btIDebugDraw*			m_debugDrawer;
-		btStackAlloc*			m_stackAlloc;
-		btDispatcher*			m_dispatcher;
-		
-		btAlignedObjectArray<btCollisionObject*> m_bodies;
-		btAlignedObjectArray<btPersistentManifold*> m_manifolds;
-		btAlignedObjectArray<btTypedConstraint*> m_constraints;
-
-
-		InplaceSolverIslandCallback(
-			btContactSolverInfo& solverInfo,
-			btConstraintSolver*	solver,
-			btTypedConstraint** sortedConstraints,
-			int	numConstraints,
-			btIDebugDraw*	debugDrawer,
-			btStackAlloc*			stackAlloc,
-			btDispatcher* dispatcher)
-			:m_solverInfo(solverInfo),
-			m_solver(solver),
-			m_sortedConstraints(sortedConstraints),
-			m_numConstraints(numConstraints),
-			m_debugDrawer(debugDrawer),
-			m_stackAlloc(stackAlloc),
-			m_dispatcher(dispatcher)
-		{
-
-		}
-
-
-		InplaceSolverIslandCallback& operator=(InplaceSolverIslandCallback& other)
-		{
-			btAssert(0);
-			(void)other;
-			return *this;
-		}
-		virtual	void	ProcessIsland(btCollisionObject** bodies,int numBodies,btPersistentManifold**	manifolds,int numManifolds, int islandId)
-		{
-			if (islandId<0)
-			{
-				if (numManifolds + m_numConstraints)
-				{
-					///we don't split islands, so all constraints/contact manifolds/bodies are passed into the solver regardless the island id
-					m_solver->solveGroup( bodies,numBodies,manifolds, numManifolds,&m_sortedConstraints[0],m_numConstraints,m_solverInfo,m_debugDrawer,m_stackAlloc,m_dispatcher);
-				}
-			} else
-			{
-					//also add all non-contact constraints/joints for this island
-				btTypedConstraint** startConstraint = 0;
-				int numCurConstraints = 0;
-				int i;
-				
-				//find the first constraint for this island
-				for (i=0;i<m_numConstraints;i++)
-				{
-					if (btGetConstraintIslandId(m_sortedConstraints[i]) == islandId)
-					{
-						startConstraint = &m_sortedConstraints[i];
-						break;
-					}
-				}
-				//count the number of constraints in this island
-				for (;i<m_numConstraints;i++)
-				{
-					if (btGetConstraintIslandId(m_sortedConstraints[i]) == islandId)
-					{
-						numCurConstraints++;
-					}
-				}
-
-				if (m_solverInfo.m_minimumSolverBatchSize<=1)
-				{
-					///only call solveGroup if there is some work: avoid virtual function call, its overhead can be excessive
-					if (numManifolds + numCurConstraints)
-					{
-						m_solver->solveGroup( bodies,numBodies,manifolds, numManifolds,startConstraint,numCurConstraints,m_solverInfo,m_debugDrawer,m_stackAlloc,m_dispatcher);
-					}
-				} else
-				{
-					
-					for (i=0;i<numBodies;i++)
-						m_bodies.push_back(bodies[i]);
-					for (i=0;i<numManifolds;i++)
-						m_manifolds.push_back(manifolds[i]);
-					for (i=0;i<numCurConstraints;i++)
-						m_constraints.push_back(startConstraint[i]);
-					if ((m_constraints.size()+m_manifolds.size())>m_solverInfo.m_minimumSolverBatchSize)
-					{
-						processConstraints();
-					} else
-					{
-						//printf("deferred\n");
-					}
-				}
-			}
-		}
-		void	processConstraints()
-		{
-			if (m_manifolds.size() + m_constraints.size()>0)
-			{
-				m_solver->solveGroup( &m_bodies[0],m_bodies.size(), &m_manifolds[0], m_manifolds.size(), &m_constraints[0], m_constraints.size() ,m_solverInfo,m_debugDrawer,m_stackAlloc,m_dispatcher);
-			}
-			m_bodies.resize(0);
-			m_manifolds.resize(0);
-			m_constraints.resize(0);
-
-		}
-
-	};
-
-	
-
-	//sorted version of all btTypedConstraint, based on islandId
-	btAlignedObjectArray<btTypedConstraint*>	sortedConstraints;
-	sortedConstraints.resize( m_constraints.size());
-	int i; 
-	for (i=0;i<getNumConstraints();i++)
-	{
-		sortedConstraints[i] = m_constraints[i];
-	}
-
-//	btAssert(0);
-		
-	
-
-	sortedConstraints.quickSort(btSortConstraintOnIslandPredicate());
-	
-	btTypedConstraint** constraintsPtr = getNumConstraints() ? &sortedConstraints[0] : 0;
-	
-	InplaceSolverIslandCallback	solverCallback(	solverInfo,	m_constraintSolver, constraintsPtr,sortedConstraints.size(),	m_debugDrawer,m_stackAlloc,m_dispatcher1);
-	
-	m_constraintSolver->prepareSolve(getCollisionWorld()->getNumCollisionObjects(), getCollisionWorld()->getDispatcher()->getNumManifolds());
-	
-	/// solve all the constraints for this island
-	m_islandManager->buildAndProcessIslands(getCollisionWorld()->getDispatcher(),getCollisionWorld(),&solverCallback);
-
-	solverCallback.processConstraints();
-
-	m_constraintSolver->allSolved(solverInfo, m_debugDrawer, m_stackAlloc);
-}
-
-
-
-
-void	btDiscreteDynamicsWorld::calculateSimulationIslands()
-{
-	BT_PROFILE("calculateSimulationIslands");
-
-	getSimulationIslandManager()->updateActivationState(getCollisionWorld(),getCollisionWorld()->getDispatcher());
-
-	{
-		int i;
-		int numConstraints = int(m_constraints.size());
-		for (i=0;i< numConstraints ; i++ )
-		{
-			btTypedConstraint* constraint = m_constraints[i];
-
-			const btRigidBody* colObj0 = &constraint->getRigidBodyA();
-			const btRigidBody* colObj1 = &constraint->getRigidBodyB();
-
-			if (((colObj0) && (!(colObj0)->isStaticOrKinematicObject())) &&
-				((colObj1) && (!(colObj1)->isStaticOrKinematicObject())))
-			{
-				if (colObj0->isActive() || colObj1->isActive())
-				{
-
-					getSimulationIslandManager()->getUnionFind().unite((colObj0)->getIslandTag(),
-						(colObj1)->getIslandTag());
-				}
-			}
-		}
-	}
-
-	//Store the island id in each body
-	getSimulationIslandManager()->storeIslandActivationState(getCollisionWorld());
-
-	
-}
-
-
-
-
-class btClosestNotMeConvexResultCallback : public btCollisionWorld::ClosestConvexResultCallback
-{
-public:
-
-	btCollisionObject* m_me;
-	btScalar m_allowedPenetration;
-	btOverlappingPairCache* m_pairCache;
-	btDispatcher* m_dispatcher;
-
-public:
-	btClosestNotMeConvexResultCallback (btCollisionObject* me,const btVector3& fromA,const btVector3& toA,btOverlappingPairCache* pairCache,btDispatcher* dispatcher) : 
-	  btCollisionWorld::ClosestConvexResultCallback(fromA,toA),
-		m_me(me),
-		m_allowedPenetration(0.0f),
-		m_pairCache(pairCache),
-		m_dispatcher(dispatcher)
-	{
-	}
-
-	virtual btScalar addSingleResult(btCollisionWorld::LocalConvexResult& convexResult,bool normalInWorldSpace)
-	{
-		if (convexResult.m_hitCollisionObject == m_me)
-			return 1.0f;
-
-		//ignore result if there is no contact response
-		if(!convexResult.m_hitCollisionObject->hasContactResponse())
-			return 1.0f;
-
-		btVector3 linVelA,linVelB;
-		linVelA = m_convexToWorld-m_convexFromWorld;
-		linVelB = btVector3(0,0,0);//toB.getOrigin()-fromB.getOrigin();
-
-		btVector3 relativeVelocity = (linVelA-linVelB);
-		//don't report time of impact for motion away from the contact normal (or causes minor penetration)
-		if (convexResult.m_hitNormalLocal.dot(relativeVelocity)>=-m_allowedPenetration)
-			return 1.f;
-
-		return ClosestConvexResultCallback::addSingleResult (convexResult, normalInWorldSpace);
-	}
-
-	virtual bool needsCollision(btBroadphaseProxy* proxy0) const
-	{
-		//don't collide with itself
-		if (proxy0->m_clientObject == m_me)
-			return false;
-
-		///don't do CCD when the collision filters are not matching
-		if (!ClosestConvexResultCallback::needsCollision(proxy0))
-			return false;
-
-		btCollisionObject* otherObj = (btCollisionObject*) proxy0->m_clientObject;
-
-		//call needsResponse, see http://code.google.com/p/bullet/issues/detail?id=179
-		if (m_dispatcher->needsResponse(m_me,otherObj))
-		{
-#if 0
-			///don't do CCD when there are already contact points (touching contact/penetration)
-			btAlignedObjectArray<btPersistentManifold*> manifoldArray;
-			btBroadphasePair* collisionPair = m_pairCache->findPair(m_me->getBroadphaseHandle(),proxy0);
-			if (collisionPair)
-			{
-				if (collisionPair->m_algorithm)
-				{
-					manifoldArray.resize(0);
-					collisionPair->m_algorithm->getAllContactManifolds(manifoldArray);
-					for (int j=0;j<manifoldArray.size();j++)
-					{
-						btPersistentManifold* manifold = manifoldArray[j];
-						if (manifold->getNumContacts()>0)
-							return false;
-					}
-				}
-			}
-#endif
-			return true;
-		}
-
-		return false;
-	}
-
-
-};
-
-///internal debugging variable. this value shouldn't be too high
-int gNumClampedCcdMotions=0;
-
-void	btDiscreteDynamicsWorld::integrateTransforms(btScalar timeStep)
-{
-	BT_PROFILE("integrateTransforms");
-	btTransform predictedTrans;
-	for ( int i=0;i<m_nonStaticRigidBodies.size();i++)
-	{
-		btRigidBody* body = m_nonStaticRigidBodies[i];
-		body->setHitFraction(1.f);
-
-		if (body->isActive() && (!body->isStaticOrKinematicObject()))
-		{
-
-			body->predictIntegratedTransform(timeStep, predictedTrans);
-			
-			btScalar squareMotion = (predictedTrans.getOrigin()-body->getWorldTransform().getOrigin()).length2();
-
-			
-
-			if (getDispatchInfo().m_useContinuous && body->getCcdSquareMotionThreshold() && body->getCcdSquareMotionThreshold() < squareMotion)
-			{
-				BT_PROFILE("CCD motion clamping");
-				if (body->getCollisionShape()->isConvex())
-				{
-					gNumClampedCcdMotions++;
-#ifdef USE_STATIC_ONLY
-					class StaticOnlyCallback : public btClosestNotMeConvexResultCallback
-					{
-					public:
-
-						StaticOnlyCallback (btCollisionObject* me,const btVector3& fromA,const btVector3& toA,btOverlappingPairCache* pairCache,btDispatcher* dispatcher) : 
-						  btClosestNotMeConvexResultCallback(me,fromA,toA,pairCache,dispatcher)
-						{
-						}
-
-					  	virtual bool needsCollision(btBroadphaseProxy* proxy0) const
-						{
-							btCollisionObject* otherObj = (btCollisionObject*) proxy0->m_clientObject;
-							if (!otherObj->isStaticOrKinematicObject())
-								return false;
-							return btClosestNotMeConvexResultCallback::needsCollision(proxy0);
-						}
-					};
-
-					StaticOnlyCallback sweepResults(body,body->getWorldTransform().getOrigin(),predictedTrans.getOrigin(),getBroadphase()->getOverlappingPairCache(),getDispatcher());
-#else
-					btClosestNotMeConvexResultCallback sweepResults(body,body->getWorldTransform().getOrigin(),predictedTrans.getOrigin(),getBroadphase()->getOverlappingPairCache(),getDispatcher());
-#endif
-					//btConvexShape* convexShape = static_cast<btConvexShape*>(body->getCollisionShape());
-					btSphereShape tmpSphere(body->getCcdSweptSphereRadius());//btConvexShape* convexShape = static_cast<btConvexShape*>(body->getCollisionShape());
-					sweepResults.m_allowedPenetration=getDispatchInfo().m_allowedCcdPenetration;
-
-					sweepResults.m_collisionFilterGroup = body->getBroadphaseProxy()->m_collisionFilterGroup;
-					sweepResults.m_collisionFilterMask  = body->getBroadphaseProxy()->m_collisionFilterMask;
-					btTransform modifiedPredictedTrans = predictedTrans;
-					modifiedPredictedTrans.setBasis(body->getWorldTransform().getBasis());
-
-					convexSweepTest(&tmpSphere,body->getWorldTransform(),modifiedPredictedTrans,sweepResults);
-					if (sweepResults.hasHit() && (sweepResults.m_closestHitFraction < 1.f))
-					{
-						
-						//printf("clamped integration to hit fraction = %f\n",fraction);
-						body->setHitFraction(sweepResults.m_closestHitFraction);
-						body->predictIntegratedTransform(timeStep*body->getHitFraction(), predictedTrans);
-						body->setHitFraction(0.f);
-						body->proceedToTransform( predictedTrans);
-
-#if 0
-						btVector3 linVel = body->getLinearVelocity();
-
-						btScalar maxSpeed = body->getCcdMotionThreshold()/getSolverInfo().m_timeStep;
-						btScalar maxSpeedSqr = maxSpeed*maxSpeed;
-						if (linVel.length2()>maxSpeedSqr)
-						{
-							linVel.normalize();
-							linVel*= maxSpeed;
-							body->setLinearVelocity(linVel);
-							btScalar ms2 = body->getLinearVelocity().length2();
-							body->predictIntegratedTransform(timeStep, predictedTrans);
-
-							btScalar sm2 = (predictedTrans.getOrigin()-body->getWorldTransform().getOrigin()).length2();
-							btScalar smt = body->getCcdSquareMotionThreshold();
-							printf("sm2=%f\n",sm2);
-						}
-#else
-						//response  between two dynamic objects without friction, assuming 0 penetration depth
-						btScalar appliedImpulse = 0.f;
-						btScalar depth = 0.f;
-						appliedImpulse = resolveSingleCollision(body,sweepResults.m_hitCollisionObject,sweepResults.m_hitPointWorld,sweepResults.m_hitNormalWorld,getSolverInfo(), depth);
-						
-
-#endif
-
-        				continue;
-					}
-				}
-			}
-			
-
-			body->proceedToTransform( predictedTrans);
-		}
-	}
-}
-
-void	btDiscreteDynamicsWorld::addSpeculativeContacts(btScalar timeStep)
-{
-	BT_PROFILE("addSpeculativeContacts");
-	btTransform predictedTrans;
-	for ( int i=0;i<m_nonStaticRigidBodies.size();i++)
-	{
-		btRigidBody* body = m_nonStaticRigidBodies[i];
-		body->setHitFraction(1.f);
-
-		if (body->isActive() && (!body->isStaticOrKinematicObject()))
-		{
-			body->predictIntegratedTransform(timeStep, predictedTrans);
-			btScalar squareMotion = (predictedTrans.getOrigin()-body->getWorldTransform().getOrigin()).length2();
-
-			if (body->getCcdSquareMotionThreshold() && body->getCcdSquareMotionThreshold() < squareMotion)
-			{
-				BT_PROFILE("search speculative contacts");
-				if (body->getCollisionShape()->isConvex())
-				{
-					gNumClampedCcdMotions++;
-					
-					btClosestNotMeConvexResultCallback sweepResults(body,body->getWorldTransform().getOrigin(),predictedTrans.getOrigin(),getBroadphase()->getOverlappingPairCache(),getDispatcher());
-					//btConvexShape* convexShape = static_cast<btConvexShape*>(body->getCollisionShape());
-					btSphereShape tmpSphere(body->getCcdSweptSphereRadius());//btConvexShape* convexShape = static_cast<btConvexShape*>(body->getCollisionShape());
-
-					sweepResults.m_collisionFilterGroup = body->getBroadphaseProxy()->m_collisionFilterGroup;
-					sweepResults.m_collisionFilterMask  = body->getBroadphaseProxy()->m_collisionFilterMask;
-					btTransform modifiedPredictedTrans;
-					modifiedPredictedTrans = predictedTrans;
-					modifiedPredictedTrans.setBasis(body->getWorldTransform().getBasis());
-
-					convexSweepTest(&tmpSphere,body->getWorldTransform(),modifiedPredictedTrans,sweepResults);
-					if (sweepResults.hasHit() && (sweepResults.m_closestHitFraction < 1.f))
-					{
-						btBroadphaseProxy* proxy0 = body->getBroadphaseHandle();
-						btBroadphaseProxy* proxy1 = sweepResults.m_hitCollisionObject->getBroadphaseHandle();
-						btBroadphasePair* pair = sweepResults.m_pairCache->findPair(proxy0,proxy1);
-						if (pair)
-						{
-							if (pair->m_algorithm)
-							{
-								btManifoldArray contacts;
-								pair->m_algorithm->getAllContactManifolds(contacts);
-								if (contacts.size())
-								{
-									btManifoldResult result(body,sweepResults.m_hitCollisionObject);
-									result.setPersistentManifold(contacts[0]);
-
-									btVector3 vec = (modifiedPredictedTrans.getOrigin()-body->getWorldTransform().getOrigin());
-									vec*=sweepResults.m_closestHitFraction;
-									
-									btScalar lenSqr = vec.length2();
-									btScalar depth = 0.f;
-									btVector3 pointWorld = sweepResults.m_hitPointWorld;
-									if (lenSqr>SIMD_EPSILON)
-									{
-										depth = btSqrt(lenSqr);
-										pointWorld -= vec;
-										vec /= depth;
-									}
-
-									if (contacts[0]->getBody0()==body)
-									{
-										result.addContactPoint(sweepResults.m_hitNormalWorld,pointWorld,depth);
-#if 0
-										debugContacts.push_back(sweepResults.m_hitPointWorld);//sweepResults.m_hitPointWorld);
-										debugNormals.push_back(sweepResults.m_hitNormalWorld);
-#endif
-									} else
-									{
-										//swapped
-										result.addContactPoint(-sweepResults.m_hitNormalWorld,pointWorld,depth);
-										//sweepResults.m_hitPointWorld,depth);
-										
-#if 0
-										if (1)//firstHit==1)
-										{
-											firstHit=0;
-											debugNormals.push_back(sweepResults.m_hitNormalWorld);
-											debugContacts.push_back(pointWorld);//sweepResults.m_hitPointWorld);
-											debugNormals.push_back(sweepResults.m_hitNormalWorld);
-											debugContacts.push_back(sweepResults.m_hitPointWorld);
-										}
-										firstHit--;
-#endif
-									}
-								}
-
-							} else
-							{
-								//no algorithm, use dispatcher to create one
-
-							}
-
-
-						} else
-						{
-							//add an overlapping pair
-							//printf("pair missing\n");
-
-						}
-					}
-				}
-			}
-			
-		}
-	}
-}
-
-
-
-
-
-void	btDiscreteDynamicsWorld::predictUnconstraintMotion(btScalar timeStep)
-{
-	BT_PROFILE("predictUnconstraintMotion");
-	for ( int i=0;i<m_nonStaticRigidBodies.size();i++)
-	{
-		btRigidBody* body = m_nonStaticRigidBodies[i];
-		if (!body->isStaticOrKinematicObject())
-		{
-			body->integrateVelocities( timeStep);
-			//damping
-			body->applyDamping(timeStep);
-
-			body->predictIntegratedTransform(timeStep,body->getInterpolationWorldTransform());
-		}
-	}
-}
-
-
-void	btDiscreteDynamicsWorld::startProfiling(btScalar timeStep)
-{
-	(void)timeStep;
-
-#ifndef BT_NO_PROFILE
-	CProfileManager::Reset();
-#endif //BT_NO_PROFILE
-
-}
-
-
-
-
-	
-
-void btDiscreteDynamicsWorld::debugDrawConstraint(btTypedConstraint* constraint)
-{
-	bool drawFrames = (getDebugDrawer()->getDebugMode() & btIDebugDraw::DBG_DrawConstraints) != 0;
-	bool drawLimits = (getDebugDrawer()->getDebugMode() & btIDebugDraw::DBG_DrawConstraintLimits) != 0;
-	btScalar dbgDrawSize = constraint->getDbgDrawSize();
-	if(dbgDrawSize <= btScalar(0.f))
-	{
-		return;
-	}
-
-	switch(constraint->getConstraintType())
-	{
-		case POINT2POINT_CONSTRAINT_TYPE:
-			{
-				btPoint2PointConstraint* p2pC = (btPoint2PointConstraint*)constraint;
-				btTransform tr;
-				tr.setIdentity();
-				btVector3 pivot = p2pC->getPivotInA();
-				pivot = p2pC->getRigidBodyA().getCenterOfMassTransform() * pivot; 
-				tr.setOrigin(pivot);
-				getDebugDrawer()->drawTransform(tr, dbgDrawSize);
-				// that ideally should draw the same frame	
-				pivot = p2pC->getPivotInB();
-				pivot = p2pC->getRigidBodyB().getCenterOfMassTransform() * pivot; 
-				tr.setOrigin(pivot);
-				if(drawFrames) getDebugDrawer()->drawTransform(tr, dbgDrawSize);
-			}
-			break;
-		case HINGE_CONSTRAINT_TYPE:
-			{
-				btHingeConstraint* pHinge = (btHingeConstraint*)constraint;
-				btTransform tr = pHinge->getRigidBodyA().getCenterOfMassTransform() * pHinge->getAFrame();
-				if(drawFrames) getDebugDrawer()->drawTransform(tr, dbgDrawSize);
-				tr = pHinge->getRigidBodyB().getCenterOfMassTransform() * pHinge->getBFrame();
-				if(drawFrames) getDebugDrawer()->drawTransform(tr, dbgDrawSize);
-				btScalar minAng = pHinge->getLowerLimit();
-				btScalar maxAng = pHinge->getUpperLimit();
-				if(minAng == maxAng)
-				{
-					break;
-				}
-				bool drawSect = true;
-				if(minAng > maxAng)
-				{
-					minAng = btScalar(0.f);
-					maxAng = SIMD_2_PI;
-					drawSect = false;
-				}
-				if(drawLimits) 
-				{
-					btVector3& center = tr.getOrigin();
-					btVector3 normal = tr.getBasis().getColumn(2);
-					btVector3 axis = tr.getBasis().getColumn(0);
-					getDebugDrawer()->drawArc(center, normal, axis, dbgDrawSize, dbgDrawSize, minAng, maxAng, btVector3(0,0,0), drawSect);
-				}
-			}
-			break;
-		case CONETWIST_CONSTRAINT_TYPE:
-			{
-				btConeTwistConstraint* pCT = (btConeTwistConstraint*)constraint;
-				btTransform tr = pCT->getRigidBodyA().getCenterOfMassTransform() * pCT->getAFrame();
-				if(drawFrames) getDebugDrawer()->drawTransform(tr, dbgDrawSize);
-				tr = pCT->getRigidBodyB().getCenterOfMassTransform() * pCT->getBFrame();
-				if(drawFrames) getDebugDrawer()->drawTransform(tr, dbgDrawSize);
-				if(drawLimits)
-				{
-					//const btScalar length = btScalar(5);
-					const btScalar length = dbgDrawSize;
-					static int nSegments = 8*4;
-					btScalar fAngleInRadians = btScalar(2.*3.1415926) * (btScalar)(nSegments-1)/btScalar(nSegments);
-					btVector3 pPrev = pCT->GetPointForAngle(fAngleInRadians, length);
-					pPrev = tr * pPrev;
-					for (int i=0; i<nSegments; i++)
-					{
-						fAngleInRadians = btScalar(2.*3.1415926) * (btScalar)i/btScalar(nSegments);
-						btVector3 pCur = pCT->GetPointForAngle(fAngleInRadians, length);
-						pCur = tr * pCur;
-						getDebugDrawer()->drawLine(pPrev, pCur, btVector3(0,0,0));
-
-						if (i%(nSegments/8) == 0)
-							getDebugDrawer()->drawLine(tr.getOrigin(), pCur, btVector3(0,0,0));
-
-						pPrev = pCur;
-					}						
-					btScalar tws = pCT->getTwistSpan();
-					btScalar twa = pCT->getTwistAngle();
-					bool useFrameB = (pCT->getRigidBodyB().getInvMass() > btScalar(0.f));
-					if(useFrameB)
-					{
-						tr = pCT->getRigidBodyB().getCenterOfMassTransform() * pCT->getBFrame();
-					}
-					else
-					{
-						tr = pCT->getRigidBodyA().getCenterOfMassTransform() * pCT->getAFrame();
-					}
-					btVector3 pivot = tr.getOrigin();
-					btVector3 normal = tr.getBasis().getColumn(0);
-					btVector3 axis1 = tr.getBasis().getColumn(1);
-					getDebugDrawer()->drawArc(pivot, normal, axis1, dbgDrawSize, dbgDrawSize, -twa-tws, -twa+tws, btVector3(0,0,0), true);
-
-				}
-			}
-			break;
-		case D6_SPRING_CONSTRAINT_TYPE:
-		case D6_CONSTRAINT_TYPE:
-			{
-				btGeneric6DofConstraint* p6DOF = (btGeneric6DofConstraint*)constraint;
-				btTransform tr = p6DOF->getCalculatedTransformA();
-				if(drawFrames) getDebugDrawer()->drawTransform(tr, dbgDrawSize);
-				tr = p6DOF->getCalculatedTransformB();
-				if(drawFrames) getDebugDrawer()->drawTransform(tr, dbgDrawSize);
-				if(drawLimits) 
-				{
-					tr = p6DOF->getCalculatedTransformA();
-					const btVector3& center = p6DOF->getCalculatedTransformB().getOrigin();
-					btVector3 up = tr.getBasis().getColumn(2);
-					btVector3 axis = tr.getBasis().getColumn(0);
-					btScalar minTh = p6DOF->getRotationalLimitMotor(1)->m_loLimit;
-					btScalar maxTh = p6DOF->getRotationalLimitMotor(1)->m_hiLimit;
-					btScalar minPs = p6DOF->getRotationalLimitMotor(2)->m_loLimit;
-					btScalar maxPs = p6DOF->getRotationalLimitMotor(2)->m_hiLimit;
-					getDebugDrawer()->drawSpherePatch(center, up, axis, dbgDrawSize * btScalar(.9f), minTh, maxTh, minPs, maxPs, btVector3(0,0,0));
-					axis = tr.getBasis().getColumn(1);
-					btScalar ay = p6DOF->getAngle(1);
-					btScalar az = p6DOF->getAngle(2);
-					btScalar cy = btCos(ay);
-					btScalar sy = btSin(ay);
-					btScalar cz = btCos(az);
-					btScalar sz = btSin(az);
-					btVector3 ref;
-					ref[0] = cy*cz*axis[0] + cy*sz*axis[1] - sy*axis[2];
-					ref[1] = -sz*axis[0] + cz*axis[1];
-					ref[2] = cz*sy*axis[0] + sz*sy*axis[1] + cy*axis[2];
-					tr = p6DOF->getCalculatedTransformB();
-					btVector3 normal = -tr.getBasis().getColumn(0);
-					btScalar minFi = p6DOF->getRotationalLimitMotor(0)->m_loLimit;
-					btScalar maxFi = p6DOF->getRotationalLimitMotor(0)->m_hiLimit;
-					if(minFi > maxFi)
-					{
-						getDebugDrawer()->drawArc(center, normal, ref, dbgDrawSize, dbgDrawSize, -SIMD_PI, SIMD_PI, btVector3(0,0,0), false);
-					}
-					else if(minFi < maxFi)
-					{
-						getDebugDrawer()->drawArc(center, normal, ref, dbgDrawSize, dbgDrawSize, minFi, maxFi, btVector3(0,0,0), true);
-					}
-					tr = p6DOF->getCalculatedTransformA();
-					btVector3 bbMin = p6DOF->getTranslationalLimitMotor()->m_lowerLimit;
-					btVector3 bbMax = p6DOF->getTranslationalLimitMotor()->m_upperLimit;
-					getDebugDrawer()->drawBox(bbMin, bbMax, tr, btVector3(0,0,0));
-				}
-			}
-			break;
-		case SLIDER_CONSTRAINT_TYPE:
-			{
-				btSliderConstraint* pSlider = (btSliderConstraint*)constraint;
-				btTransform tr = pSlider->getCalculatedTransformA();
-				if(drawFrames) getDebugDrawer()->drawTransform(tr, dbgDrawSize);
-				tr = pSlider->getCalculatedTransformB();
-				if(drawFrames) getDebugDrawer()->drawTransform(tr, dbgDrawSize);
-				if(drawLimits)
-				{
-					btTransform tr = pSlider->getUseLinearReferenceFrameA() ? pSlider->getCalculatedTransformA() : pSlider->getCalculatedTransformB();
-					btVector3 li_min = tr * btVector3(pSlider->getLowerLinLimit(), 0.f, 0.f);
-					btVector3 li_max = tr * btVector3(pSlider->getUpperLinLimit(), 0.f, 0.f);
-					getDebugDrawer()->drawLine(li_min, li_max, btVector3(0, 0, 0));
-					btVector3 normal = tr.getBasis().getColumn(0);
-					btVector3 axis = tr.getBasis().getColumn(1);
-					btScalar a_min = pSlider->getLowerAngLimit();
-					btScalar a_max = pSlider->getUpperAngLimit();
-					const btVector3& center = pSlider->getCalculatedTransformB().getOrigin();
-					getDebugDrawer()->drawArc(center, normal, axis, dbgDrawSize, dbgDrawSize, a_min, a_max, btVector3(0,0,0), true);
-				}
-			}
-			break;
-		default : 
-			break;
-	}
-	return;
-}
-
-
-
-
-
-void	btDiscreteDynamicsWorld::setConstraintSolver(btConstraintSolver* solver)
-{
-	if (m_ownsConstraintSolver)
-	{
-		btAlignedFree( m_constraintSolver);
-	}
-	m_ownsConstraintSolver = false;
-	m_constraintSolver = solver;
-}
-
-btConstraintSolver* btDiscreteDynamicsWorld::getConstraintSolver()
-{
-	return m_constraintSolver;
-}
-
-
-int		btDiscreteDynamicsWorld::getNumConstraints() const
-{
-	return int(m_constraints.size());
-}
-btTypedConstraint* btDiscreteDynamicsWorld::getConstraint(int index)
-{
-	return m_constraints[index];
-}
-const btTypedConstraint* btDiscreteDynamicsWorld::getConstraint(int index) const
-{
-	return m_constraints[index];
-}
-
-
-
-void	btDiscreteDynamicsWorld::serializeRigidBodies(btSerializer* serializer)
-{
-	int i;
-	//serialize all collision objects
-	for (i=0;i<m_collisionObjects.size();i++)
-	{
-		btCollisionObject* colObj = m_collisionObjects[i];
-		if (colObj->getInternalType() & btCollisionObject::CO_RIGID_BODY)
-		{
-			int len = colObj->calculateSerializeBufferSize();
-			btChunk* chunk = serializer->allocate(len,1);
-			const char* structType = colObj->serialize(chunk->m_oldPtr, serializer);
-			serializer->finalizeChunk(chunk,structType,BT_RIGIDBODY_CODE,colObj);
-		}
-	}
-
-	for (i=0;i<m_constraints.size();i++)
-	{
-		btTypedConstraint* constraint = m_constraints[i];
-		int size = constraint->calculateSerializeBufferSize();
-		btChunk* chunk = serializer->allocate(size,1);
-		const char* structType = constraint->serialize(chunk->m_oldPtr,serializer);
-		serializer->finalizeChunk(chunk,structType,BT_CONSTRAINT_CODE,constraint);
-	}
-}
-
-
-void	btDiscreteDynamicsWorld::serialize(btSerializer* serializer)
-{
-
-	serializer->startSerialization();
-
-	serializeRigidBodies(serializer);
-
-	serializeCollisionObjects(serializer);
-
-	serializer->finishSerialization();
-}
-
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h b/hkl3d/bullet/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h
deleted file mode 100644
index 3ba39a1..0000000
--- a/hkl3d/bullet/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef BT_DISCRETE_DYNAMICS_WORLD_H
-#define BT_DISCRETE_DYNAMICS_WORLD_H
-
-#include "btDynamicsWorld.h"
-
-class btDispatcher;
-class btOverlappingPairCache;
-class btConstraintSolver;
-class btSimulationIslandManager;
-class btTypedConstraint;
-class btActionInterface;
-
-class btIDebugDraw;
-#include "LinearMath/btAlignedObjectArray.h"
-
-
-///btDiscreteDynamicsWorld provides discrete rigid body simulation
-///those classes replace the obsolete CcdPhysicsEnvironment/CcdPhysicsController
-class btDiscreteDynamicsWorld : public btDynamicsWorld
-{
-protected:
-
-	btConstraintSolver*	m_constraintSolver;
-
-	btSimulationIslandManager*	m_islandManager;
-
-	btAlignedObjectArray<btTypedConstraint*> m_constraints;
-
-	btAlignedObjectArray<btRigidBody*> m_nonStaticRigidBodies;
-
-	btVector3	m_gravity;
-
-	//for variable timesteps
-	btScalar	m_localTime;
-	//for variable timesteps
-
-	bool	m_ownsIslandManager;
-	bool	m_ownsConstraintSolver;
-	bool	m_synchronizeAllMotionStates;
-
-	btAlignedObjectArray<btActionInterface*>	m_actions;
-	
-	int	m_profileTimings;
-
-	virtual void	predictUnconstraintMotion(btScalar timeStep);
-	
-	virtual void	integrateTransforms(btScalar timeStep);
-		
-	virtual void	addSpeculativeContacts(btScalar timeStep);
-
-	virtual void	calculateSimulationIslands();
-
-	virtual void	solveConstraints(btContactSolverInfo& solverInfo);
-	
-	void	updateActivationState(btScalar timeStep);
-
-	void	updateActions(btScalar timeStep);
-
-	void	startProfiling(btScalar timeStep);
-
-	virtual void	internalSingleStepSimulation( btScalar timeStep);
-
-
-	virtual void	saveKinematicState(btScalar timeStep);
-
-	void	serializeRigidBodies(btSerializer* serializer);
-
-public:
-
-
-	///this btDiscreteDynamicsWorld constructor gets created objects from the user, and will not delete those
-	btDiscreteDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration);
-
-	virtual ~btDiscreteDynamicsWorld();
-
-	///if maxSubSteps > 0, it will interpolate motion between fixedTimeStep's
-	virtual int	stepSimulation( btScalar timeStep,int maxSubSteps=1, btScalar fixedTimeStep=btScalar(1.)/btScalar(60.));
-
-
-	virtual void	synchronizeMotionStates();
-
-	///this can be useful to synchronize a single rigid body -> graphics object
-	void	synchronizeSingleMotionState(btRigidBody* body);
-
-	virtual void	addConstraint(btTypedConstraint* constraint, bool disableCollisionsBetweenLinkedBodies=false);
-
-	virtual void	removeConstraint(btTypedConstraint* constraint);
-
-	virtual void	addAction(btActionInterface*);
-
-	virtual void	removeAction(btActionInterface*);
-	
-	btSimulationIslandManager*	getSimulationIslandManager()
-	{
-		return m_islandManager;
-	}
-
-	const btSimulationIslandManager*	getSimulationIslandManager() const 
-	{
-		return m_islandManager;
-	}
-
-	btCollisionWorld*	getCollisionWorld()
-	{
-		return this;
-	}
-
-	virtual void	setGravity(const btVector3& gravity);
-
-	virtual btVector3 getGravity () const;
-
-	virtual void	addCollisionObject(btCollisionObject* collisionObject,short int collisionFilterGroup=btBroadphaseProxy::StaticFilter,short int collisionFilterMask=btBroadphaseProxy::AllFilter ^ btBroadphaseProxy::StaticFilter);
-
-	virtual void	addRigidBody(btRigidBody* body);
-
-	virtual void	addRigidBody(btRigidBody* body, short group, short mask);
-
-	virtual void	removeRigidBody(btRigidBody* body);
-
-	///removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise call btCollisionWorld::removeCollisionObject
-	virtual void	removeCollisionObject(btCollisionObject* collisionObject);
-
-
-	void	debugDrawConstraint(btTypedConstraint* constraint);
-
-	virtual void	debugDrawWorld();
-
-	virtual void	setConstraintSolver(btConstraintSolver* solver);
-
-	virtual btConstraintSolver* getConstraintSolver();
-	
-	virtual	int		getNumConstraints() const;
-
-	virtual btTypedConstraint* getConstraint(int index)	;
-
-	virtual const btTypedConstraint* getConstraint(int index) const;
-
-	
-	virtual btDynamicsWorldType	getWorldType() const
-	{
-		return BT_DISCRETE_DYNAMICS_WORLD;
-	}
-	
-	///the forces on each rigidbody is accumulating together with gravity. clear this after each timestep.
-	virtual void	clearForces();
-
-	///apply gravity, call this once per timestep
-	virtual void	applyGravity();
-
-	virtual void	setNumTasks(int numTasks)
-	{
-        (void) numTasks;
-	}
-
-	///obsolete, use updateActions instead
-	virtual void updateVehicles(btScalar timeStep)
-	{
-		updateActions(timeStep);
-	}
-
-	///obsolete, use addAction instead
-	virtual void	addVehicle(btActionInterface* vehicle);
-	///obsolete, use removeAction instead
-	virtual void	removeVehicle(btActionInterface* vehicle);
-	///obsolete, use addAction instead
-	virtual void	addCharacter(btActionInterface* character);
-	///obsolete, use removeAction instead
-	virtual void	removeCharacter(btActionInterface* character);
-
-	void	setSynchronizeAllMotionStates(bool synchronizeAll)
-	{
-		m_synchronizeAllMotionStates = synchronizeAll;
-	}
-	bool getSynchronizeAllMotionStates() const
-	{
-		return m_synchronizeAllMotionStates;
-	}
-
-	///Preliminary serialization test for Bullet 2.76. Loading those files requires a separate parser (see Bullet/Demos/SerializeDemo)
-	virtual	void	serialize(btSerializer* serializer);
-
-};
-
-#endif //BT_DISCRETE_DYNAMICS_WORLD_H
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/btDynamicsWorld.h b/hkl3d/bullet/src/BulletDynamics/Dynamics/btDynamicsWorld.h
deleted file mode 100644
index 6b00933..0000000
--- a/hkl3d/bullet/src/BulletDynamics/Dynamics/btDynamicsWorld.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_DYNAMICS_WORLD_H
-#define BT_DYNAMICS_WORLD_H
-
-#include "BulletCollision/CollisionDispatch/btCollisionWorld.h"
-#include "BulletDynamics/ConstraintSolver/btContactSolverInfo.h"
-
-class btTypedConstraint;
-class btActionInterface;
-class btConstraintSolver;
-class btDynamicsWorld;
-
-
-/// Type for the callback for each tick
-typedef void (*btInternalTickCallback)(btDynamicsWorld *world, btScalar timeStep);
-
-enum btDynamicsWorldType
-{
-	BT_SIMPLE_DYNAMICS_WORLD=1,
-	BT_DISCRETE_DYNAMICS_WORLD=2,
-	BT_CONTINUOUS_DYNAMICS_WORLD=3,
-	BT_SOFT_RIGID_DYNAMICS_WORLD=4
-};
-
-///The btDynamicsWorld is the interface class for several dynamics implementation, basic, discrete, parallel, and continuous etc.
-class btDynamicsWorld : public btCollisionWorld
-{
-
-protected:
-		btInternalTickCallback m_internalTickCallback;
-		btInternalTickCallback m_internalPreTickCallback;
-		void*	m_worldUserInfo;
-
-		btContactSolverInfo	m_solverInfo;
-
-public:
-		
-
-		btDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* broadphase,btCollisionConfiguration* collisionConfiguration)
-		:btCollisionWorld(dispatcher,broadphase,collisionConfiguration), m_internalTickCallback(0),m_internalPreTickCallback(0), m_worldUserInfo(0)
-		{
-		}
-
-		virtual ~btDynamicsWorld()
-		{
-		}
-		
-		///stepSimulation proceeds the simulation over 'timeStep', units in preferably in seconds.
-		///By default, Bullet will subdivide the timestep in constant substeps of each 'fixedTimeStep'.
-		///in order to keep the simulation real-time, the maximum number of substeps can be clamped to 'maxSubSteps'.
-		///You can disable subdividing the timestep/substepping by passing maxSubSteps=0 as second argument to stepSimulation, but in that case you have to keep the timeStep constant.
-		virtual int		stepSimulation( btScalar timeStep,int maxSubSteps=1, btScalar fixedTimeStep=btScalar(1.)/btScalar(60.))=0;
-			
-		virtual void	debugDrawWorld() = 0;
-				
-		virtual void	addConstraint(btTypedConstraint* constraint, bool disableCollisionsBetweenLinkedBodies=false) 
-		{ 
-			(void)constraint; (void)disableCollisionsBetweenLinkedBodies;
-		}
-
-		virtual void	removeConstraint(btTypedConstraint* constraint) {(void)constraint;}
-
-		virtual void	addAction(btActionInterface* action) = 0;
-
-		virtual void	removeAction(btActionInterface* action) = 0;
-
-		//once a rigidbody is added to the dynamics world, it will get this gravity assigned
-		//existing rigidbodies in the world get gravity assigned too, during this method
-		virtual void	setGravity(const btVector3& gravity) = 0;
-		virtual btVector3 getGravity () const = 0;
-
-		virtual void	synchronizeMotionStates() = 0;
-
-		virtual void	addRigidBody(btRigidBody* body) = 0;
-
-		virtual void	addRigidBody(btRigidBody* body, short group, short mask) = 0;
-
-		virtual void	removeRigidBody(btRigidBody* body) = 0;
-
-		virtual void	setConstraintSolver(btConstraintSolver* solver) = 0;
-
-		virtual btConstraintSolver* getConstraintSolver() = 0;
-		
-		virtual	int		getNumConstraints() const {	return 0;		}
-		
-		virtual btTypedConstraint* getConstraint(int index)		{	(void)index;		return 0;		}
-		
-		virtual const btTypedConstraint* getConstraint(int index) const	{	(void)index;	return 0;	}
-
-		virtual btDynamicsWorldType	getWorldType() const=0;
-
-		virtual void	clearForces() = 0;
-
-		/// Set the callback for when an internal tick (simulation substep) happens, optional user info
-		void setInternalTickCallback(btInternalTickCallback cb,	void* worldUserInfo=0,bool isPreTick=false) 
-		{ 
-			if (isPreTick)
-			{
-				m_internalPreTickCallback = cb;
-			} else
-			{
-				m_internalTickCallback = cb; 
-			}
-			m_worldUserInfo = worldUserInfo;
-		}
-
-		void	setWorldUserInfo(void* worldUserInfo)
-		{
-			m_worldUserInfo = worldUserInfo;
-		}
-
-		void*	getWorldUserInfo() const
-		{
-			return m_worldUserInfo;
-		}
-
-		btContactSolverInfo& getSolverInfo()
-		{
-			return m_solverInfo;
-		}
-
-
-		///obsolete, use addAction instead.
-		virtual void	addVehicle(btActionInterface* vehicle) {(void)vehicle;}
-		///obsolete, use removeAction instead
-		virtual void	removeVehicle(btActionInterface* vehicle) {(void)vehicle;}
-		///obsolete, use addAction instead.
-		virtual void	addCharacter(btActionInterface* character) {(void)character;}
-		///obsolete, use removeAction instead
-		virtual void	removeCharacter(btActionInterface* character) {(void)character;}
-
-
-};
-
-#endif //BT_DYNAMICS_WORLD_H
-
-
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/btRigidBody.cpp b/hkl3d/bullet/src/BulletDynamics/Dynamics/btRigidBody.cpp
deleted file mode 100644
index aefb26a..0000000
--- a/hkl3d/bullet/src/BulletDynamics/Dynamics/btRigidBody.cpp
+++ /dev/null
@@ -1,402 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btRigidBody.h"
-#include "BulletCollision/CollisionShapes/btConvexShape.h"
-#include "LinearMath/btMinMax.h"
-#include "LinearMath/btTransformUtil.h"
-#include "LinearMath/btMotionState.h"
-#include "BulletDynamics/ConstraintSolver/btTypedConstraint.h"
-#include "LinearMath/btSerializer.h"
-
-//'temporarily' global variables
-btScalar	gDeactivationTime = btScalar(2.);
-bool	gDisableDeactivation = false;
-static int uniqueId = 0;
-
-
-btRigidBody::btRigidBody(const btRigidBody::btRigidBodyConstructionInfo& constructionInfo)
-{
-	setupRigidBody(constructionInfo);
-}
-
-btRigidBody::btRigidBody(btScalar mass, btMotionState *motionState, btCollisionShape *collisionShape, const btVector3 &localInertia)
-{
-	btRigidBodyConstructionInfo cinfo(mass,motionState,collisionShape,localInertia);
-	setupRigidBody(cinfo);
-}
-
-void	btRigidBody::setupRigidBody(const btRigidBody::btRigidBodyConstructionInfo& constructionInfo)
-{
-
-	m_internalType=CO_RIGID_BODY;
-
-	m_linearVelocity.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
-	m_angularVelocity.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
-	m_angularFactor.setValue(1,1,1);
-	m_linearFactor.setValue(1,1,1);
-	m_gravity.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
-	m_gravity_acceleration.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
-	m_totalForce.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
-	m_totalTorque.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0)),
-    setDamping(constructionInfo.m_linearDamping, constructionInfo.m_angularDamping);
-
-	m_linearSleepingThreshold = constructionInfo.m_linearSleepingThreshold;
-	m_angularSleepingThreshold = constructionInfo.m_angularSleepingThreshold;
-	m_optionalMotionState = constructionInfo.m_motionState;
-	m_contactSolverType = 0;
-	m_frictionSolverType = 0;
-	m_additionalDamping = constructionInfo.m_additionalDamping;
-	m_additionalDampingFactor = constructionInfo.m_additionalDampingFactor;
-	m_additionalLinearDampingThresholdSqr = constructionInfo.m_additionalLinearDampingThresholdSqr;
-	m_additionalAngularDampingThresholdSqr = constructionInfo.m_additionalAngularDampingThresholdSqr;
-	m_additionalAngularDampingFactor = constructionInfo.m_additionalAngularDampingFactor;
-
-	if (m_optionalMotionState)
-	{
-		m_optionalMotionState->getWorldTransform(m_worldTransform);
-	} else
-	{
-		m_worldTransform = constructionInfo.m_startWorldTransform;
-	}
-
-	m_interpolationWorldTransform = m_worldTransform;
-	m_interpolationLinearVelocity.setValue(0,0,0);
-	m_interpolationAngularVelocity.setValue(0,0,0);
-	
-	//moved to btCollisionObject
-	m_friction = constructionInfo.m_friction;
-	m_restitution = constructionInfo.m_restitution;
-
-	setCollisionShape( constructionInfo.m_collisionShape );
-	m_debugBodyId = uniqueId++;
-	
-	setMassProps(constructionInfo.m_mass, constructionInfo.m_localInertia);
-	updateInertiaTensor();
-
-	m_rigidbodyFlags = 0;
-
-
-	m_deltaLinearVelocity.setZero();
-	m_deltaAngularVelocity.setZero();
-	m_invMass = m_inverseMass*m_linearFactor;
-	m_pushVelocity.setZero();
-	m_turnVelocity.setZero();
-
-	
-
-}
-
-
-void btRigidBody::predictIntegratedTransform(btScalar timeStep,btTransform& predictedTransform) 
-{
-	btTransformUtil::integrateTransform(m_worldTransform,m_linearVelocity,m_angularVelocity,timeStep,predictedTransform);
-}
-
-void			btRigidBody::saveKinematicState(btScalar timeStep)
-{
-	//todo: clamp to some (user definable) safe minimum timestep, to limit maximum angular/linear velocities
-	if (timeStep != btScalar(0.))
-	{
-		//if we use motionstate to synchronize world transforms, get the new kinematic/animated world transform
-		if (getMotionState())
-			getMotionState()->getWorldTransform(m_worldTransform);
-		btVector3 linVel,angVel;
-		
-		btTransformUtil::calculateVelocity(m_interpolationWorldTransform,m_worldTransform,timeStep,m_linearVelocity,m_angularVelocity);
-		m_interpolationLinearVelocity = m_linearVelocity;
-		m_interpolationAngularVelocity = m_angularVelocity;
-		m_interpolationWorldTransform = m_worldTransform;
-		//printf("angular = %f %f %f\n",m_angularVelocity.getX(),m_angularVelocity.getY(),m_angularVelocity.getZ());
-	}
-}
-	
-void	btRigidBody::getAabb(btVector3& aabbMin,btVector3& aabbMax) const
-{
-	getCollisionShape()->getAabb(m_worldTransform,aabbMin,aabbMax);
-}
-
-
-
-
-void btRigidBody::setGravity(const btVector3& acceleration) 
-{
-	if (m_inverseMass != btScalar(0.0))
-	{
-		m_gravity = acceleration * (btScalar(1.0) / m_inverseMass);
-	}
-	m_gravity_acceleration = acceleration;
-}
-
-
-
-
-
-
-void btRigidBody::setDamping(btScalar lin_damping, btScalar ang_damping)
-{
-	m_linearDamping = btClamped(lin_damping, (btScalar)btScalar(0.0), (btScalar)btScalar(1.0));
-	m_angularDamping = btClamped(ang_damping, (btScalar)btScalar(0.0), (btScalar)btScalar(1.0));
-}
-
-
-
-
-///applyDamping damps the velocity, using the given m_linearDamping and m_angularDamping
-void			btRigidBody::applyDamping(btScalar timeStep)
-{
-	//On new damping: see discussion/issue report here: http://code.google.com/p/bullet/issues/detail?id=74
-	//todo: do some performance comparisons (but other parts of the engine are probably bottleneck anyway
-
-//#define USE_OLD_DAMPING_METHOD 1
-#ifdef USE_OLD_DAMPING_METHOD
-	m_linearVelocity *= GEN_clamped((btScalar(1.) - timeStep * m_linearDamping), (btScalar)btScalar(0.0), (btScalar)btScalar(1.0));
-	m_angularVelocity *= GEN_clamped((btScalar(1.) - timeStep * m_angularDamping), (btScalar)btScalar(0.0), (btScalar)btScalar(1.0));
-#else
-	m_linearVelocity *= btPow(btScalar(1)-m_linearDamping, timeStep);
-	m_angularVelocity *= btPow(btScalar(1)-m_angularDamping, timeStep);
-#endif
-
-	if (m_additionalDamping)
-	{
-		//Additional damping can help avoiding lowpass jitter motion, help stability for ragdolls etc.
-		//Such damping is undesirable, so once the overall simulation quality of the rigid body dynamics system has improved, this should become obsolete
-		if ((m_angularVelocity.length2() < m_additionalAngularDampingThresholdSqr) &&
-			(m_linearVelocity.length2() < m_additionalLinearDampingThresholdSqr))
-		{
-			m_angularVelocity *= m_additionalDampingFactor;
-			m_linearVelocity *= m_additionalDampingFactor;
-		}
-	
-
-		btScalar speed = m_linearVelocity.length();
-		if (speed < m_linearDamping)
-		{
-			btScalar dampVel = btScalar(0.005);
-			if (speed > dampVel)
-			{
-				btVector3 dir = m_linearVelocity.normalized();
-				m_linearVelocity -=  dir * dampVel;
-			} else
-			{
-				m_linearVelocity.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
-			}
-		}
-
-		btScalar angSpeed = m_angularVelocity.length();
-		if (angSpeed < m_angularDamping)
-		{
-			btScalar angDampVel = btScalar(0.005);
-			if (angSpeed > angDampVel)
-			{
-				btVector3 dir = m_angularVelocity.normalized();
-				m_angularVelocity -=  dir * angDampVel;
-			} else
-			{
-				m_angularVelocity.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
-			}
-		}
-	}
-}
-
-
-void btRigidBody::applyGravity()
-{
-	if (isStaticOrKinematicObject())
-		return;
-	
-	applyCentralForce(m_gravity);	
-
-}
-
-void btRigidBody::proceedToTransform(const btTransform& newTrans)
-{
-	setCenterOfMassTransform( newTrans );
-}
-	
-
-void btRigidBody::setMassProps(btScalar mass, const btVector3& inertia)
-{
-	if (mass == btScalar(0.))
-	{
-		m_collisionFlags |= btCollisionObject::CF_STATIC_OBJECT;
-		m_inverseMass = btScalar(0.);
-	} else
-	{
-		m_collisionFlags &= (~btCollisionObject::CF_STATIC_OBJECT);
-		m_inverseMass = btScalar(1.0) / mass;
-	}
-
-	//Fg = m * a
-	m_gravity = mass * m_gravity_acceleration;
-	
-	m_invInertiaLocal.setValue(inertia.x() != btScalar(0.0) ? btScalar(1.0) / inertia.x(): btScalar(0.0),
-				   inertia.y() != btScalar(0.0) ? btScalar(1.0) / inertia.y(): btScalar(0.0),
-				   inertia.z() != btScalar(0.0) ? btScalar(1.0) / inertia.z(): btScalar(0.0));
-
-	m_invMass = m_linearFactor*m_inverseMass;
-}
-
-	
-
-void btRigidBody::updateInertiaTensor() 
-{
-	m_invInertiaTensorWorld = m_worldTransform.getBasis().scaled(m_invInertiaLocal) * m_worldTransform.getBasis().transpose();
-}
-
-
-void btRigidBody::integrateVelocities(btScalar step) 
-{
-	if (isStaticOrKinematicObject())
-		return;
-
-	m_linearVelocity += m_totalForce * (m_inverseMass * step);
-	m_angularVelocity += m_invInertiaTensorWorld * m_totalTorque * step;
-
-#define MAX_ANGVEL SIMD_HALF_PI
-	/// clamp angular velocity. collision calculations will fail on higher angular velocities	
-	btScalar angvel = m_angularVelocity.length();
-	if (angvel*step > MAX_ANGVEL)
-	{
-		m_angularVelocity *= (MAX_ANGVEL/step) /angvel;
-	}
-
-}
-
-btQuaternion btRigidBody::getOrientation() const
-{
-		btQuaternion orn;
-		m_worldTransform.getBasis().getRotation(orn);
-		return orn;
-}
-	
-	
-void btRigidBody::setCenterOfMassTransform(const btTransform& xform)
-{
-
-	if (isStaticOrKinematicObject())
-	{
-		m_interpolationWorldTransform = m_worldTransform;
-	} else
-	{
-		m_interpolationWorldTransform = xform;
-	}
-	m_interpolationLinearVelocity = getLinearVelocity();
-	m_interpolationAngularVelocity = getAngularVelocity();
-	m_worldTransform = xform;
-	updateInertiaTensor();
-}
-
-
-bool btRigidBody::checkCollideWithOverride(btCollisionObject* co)
-{
-	btRigidBody* otherRb = btRigidBody::upcast(co);
-	if (!otherRb)
-		return true;
-
-	for (int i = 0; i < m_constraintRefs.size(); ++i)
-	{
-		btTypedConstraint* c = m_constraintRefs[i];
-		if (&c->getRigidBodyA() == otherRb || &c->getRigidBodyB() == otherRb)
-			return false;
-	}
-
-	return true;
-}
-
-void	btRigidBody::internalWritebackVelocity(btScalar timeStep)
-{
-    (void) timeStep;
-	if (m_inverseMass)
-	{
-		setLinearVelocity(getLinearVelocity()+ m_deltaLinearVelocity);
-		setAngularVelocity(getAngularVelocity()+m_deltaAngularVelocity);
-		
-		//correct the position/orientation based on push/turn recovery
-		btTransform newTransform;
-		btTransformUtil::integrateTransform(getWorldTransform(),m_pushVelocity,m_turnVelocity,timeStep,newTransform);
-		setWorldTransform(newTransform);
-		//m_originalBody->setCompanionId(-1);
-	}
-//	m_deltaLinearVelocity.setZero();
-//	m_deltaAngularVelocity .setZero();
-//	m_pushVelocity.setZero();
-//	m_turnVelocity.setZero();
-}
-
-
-
-void btRigidBody::addConstraintRef(btTypedConstraint* c)
-{
-	int index = m_constraintRefs.findLinearSearch(c);
-	if (index == m_constraintRefs.size())
-		m_constraintRefs.push_back(c); 
-
-	m_checkCollideWith = true;
-}
-
-void btRigidBody::removeConstraintRef(btTypedConstraint* c)
-{
-	m_constraintRefs.remove(c);
-	m_checkCollideWith = m_constraintRefs.size() > 0;
-}
-
-int	btRigidBody::calculateSerializeBufferSize()	const
-{
-	int sz = sizeof(btRigidBodyData);
-	return sz;
-}
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-const char*	btRigidBody::serialize(void* dataBuffer, class btSerializer* serializer) const
-{
-	btRigidBodyData* rbd = (btRigidBodyData*) dataBuffer;
-
-	btCollisionObject::serialize(&rbd->m_collisionObjectData, serializer);
-
-	m_invInertiaTensorWorld.serialize(rbd->m_invInertiaTensorWorld);
-	m_linearVelocity.serialize(rbd->m_linearVelocity);
-	m_angularVelocity.serialize(rbd->m_angularVelocity);
-	rbd->m_inverseMass = m_inverseMass;
-	m_angularFactor.serialize(rbd->m_angularFactor);
-	m_linearFactor.serialize(rbd->m_linearFactor);
-	m_gravity.serialize(rbd->m_gravity);
-	m_gravity_acceleration.serialize(rbd->m_gravity_acceleration);
-	m_invInertiaLocal.serialize(rbd->m_invInertiaLocal);
-	m_totalForce.serialize(rbd->m_totalForce);
-	m_totalTorque.serialize(rbd->m_totalTorque);
-	rbd->m_linearDamping = m_linearDamping;
-	rbd->m_angularDamping = m_angularDamping;
-	rbd->m_additionalDamping = m_additionalDamping;
-	rbd->m_additionalDampingFactor = m_additionalDampingFactor;
-	rbd->m_additionalLinearDampingThresholdSqr = m_additionalLinearDampingThresholdSqr;
-	rbd->m_additionalAngularDampingThresholdSqr = m_additionalAngularDampingThresholdSqr;
-	rbd->m_additionalAngularDampingFactor = m_additionalAngularDampingFactor;
-	rbd->m_linearSleepingThreshold=m_linearSleepingThreshold;
-	rbd->m_angularSleepingThreshold = m_angularSleepingThreshold;
-
-	return btRigidBodyDataName;
-}
-
-
-
-void btRigidBody::serializeSingleObject(class btSerializer* serializer) const
-{
-	btChunk* chunk = serializer->allocate(calculateSerializeBufferSize(),1);
-	const char* structType = serialize(chunk->m_oldPtr, serializer);
-	serializer->finalizeChunk(chunk,structType,BT_RIGIDBODY_CODE,(void*)this);
-}
-
-
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/btRigidBody.h b/hkl3d/bullet/src/BulletDynamics/Dynamics/btRigidBody.h
deleted file mode 100644
index 7c121e6..0000000
--- a/hkl3d/bullet/src/BulletDynamics/Dynamics/btRigidBody.h
+++ /dev/null
@@ -1,691 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_RIGIDBODY_H
-#define BT_RIGIDBODY_H
-
-#include "LinearMath/btAlignedObjectArray.h"
-#include "LinearMath/btTransform.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-
-class btCollisionShape;
-class btMotionState;
-class btTypedConstraint;
-
-
-extern btScalar gDeactivationTime;
-extern bool gDisableDeactivation;
-
-#ifdef BT_USE_DOUBLE_PRECISION
-#define btRigidBodyData	btRigidBodyDoubleData
-#define btRigidBodyDataName	"btRigidBodyDoubleData"
-#else
-#define btRigidBodyData	btRigidBodyFloatData
-#define btRigidBodyDataName	"btRigidBodyFloatData"
-#endif //BT_USE_DOUBLE_PRECISION
-
-
-enum	btRigidBodyFlags
-{
-	BT_DISABLE_WORLD_GRAVITY = 1
-};
-
-
-///The btRigidBody is the main class for rigid body objects. It is derived from btCollisionObject, so it keeps a pointer to a btCollisionShape.
-///It is recommended for performance and memory use to share btCollisionShape objects whenever possible.
-///There are 3 types of rigid bodies: 
-///- A) Dynamic rigid bodies, with positive mass. Motion is controlled by rigid body dynamics.
-///- B) Fixed objects with zero mass. They are not moving (basically collision objects)
-///- C) Kinematic objects, which are objects without mass, but the user can move them. There is on-way interaction, and Bullet calculates a velocity based on the timestep and previous and current world transform.
-///Bullet automatically deactivates dynamic rigid bodies, when the velocity is below a threshold for a given time.
-///Deactivated (sleeping) rigid bodies don't take any processing time, except a minor broadphase collision detection impact (to allow active objects to activate/wake up sleeping objects)
-class btRigidBody  : public btCollisionObject
-{
-
-	btMatrix3x3	m_invInertiaTensorWorld;
-	btVector3		m_linearVelocity;
-	btVector3		m_angularVelocity;
-	btScalar		m_inverseMass;
-	btVector3		m_linearFactor;
-
-	btVector3		m_gravity;	
-	btVector3		m_gravity_acceleration;
-	btVector3		m_invInertiaLocal;
-	btVector3		m_totalForce;
-	btVector3		m_totalTorque;
-	
-	btScalar		m_linearDamping;
-	btScalar		m_angularDamping;
-
-	bool			m_additionalDamping;
-	btScalar		m_additionalDampingFactor;
-	btScalar		m_additionalLinearDampingThresholdSqr;
-	btScalar		m_additionalAngularDampingThresholdSqr;
-	btScalar		m_additionalAngularDampingFactor;
-
-
-	btScalar		m_linearSleepingThreshold;
-	btScalar		m_angularSleepingThreshold;
-
-	//m_optionalMotionState allows to automatic synchronize the world transform for active objects
-	btMotionState*	m_optionalMotionState;
-
-	//keep track of typed constraints referencing this rigid body
-	btAlignedObjectArray<btTypedConstraint*> m_constraintRefs;
-
-	int				m_rigidbodyFlags;
-	
-	int				m_debugBodyId;
-	
-
-protected:
-
-	ATTRIBUTE_ALIGNED64(btVector3		m_deltaLinearVelocity);
-	btVector3		m_deltaAngularVelocity;
-	btVector3		m_angularFactor;
-	btVector3		m_invMass;
-	btVector3		m_pushVelocity;
-	btVector3		m_turnVelocity;
-
-
-public:
-
-
-	///The btRigidBodyConstructionInfo structure provides information to create a rigid body. Setting mass to zero creates a fixed (non-dynamic) rigid body.
-	///For dynamic objects, you can use the collision shape to approximate the local inertia tensor, otherwise use the zero vector (default argument)
-	///You can use the motion state to synchronize the world transform between physics and graphics objects. 
-	///And if the motion state is provided, the rigid body will initialize its initial world transform from the motion state,
-	///m_startWorldTransform is only used when you don't provide a motion state.
-	struct	btRigidBodyConstructionInfo
-	{
-		btScalar			m_mass;
-
-		///When a motionState is provided, the rigid body will initialize its world transform from the motion state
-		///In this case, m_startWorldTransform is ignored.
-		btMotionState*		m_motionState;
-		btTransform	m_startWorldTransform;
-
-		btCollisionShape*	m_collisionShape;
-		btVector3			m_localInertia;
-		btScalar			m_linearDamping;
-		btScalar			m_angularDamping;
-
-		///best simulation results when friction is non-zero
-		btScalar			m_friction;
-		///best simulation results using zero restitution.
-		btScalar			m_restitution;
-
-		btScalar			m_linearSleepingThreshold;
-		btScalar			m_angularSleepingThreshold;
-
-		//Additional damping can help avoiding lowpass jitter motion, help stability for ragdolls etc.
-		//Such damping is undesirable, so once the overall simulation quality of the rigid body dynamics system has improved, this should become obsolete
-		bool				m_additionalDamping;
-		btScalar			m_additionalDampingFactor;
-		btScalar			m_additionalLinearDampingThresholdSqr;
-		btScalar			m_additionalAngularDampingThresholdSqr;
-		btScalar			m_additionalAngularDampingFactor;
-
-		btRigidBodyConstructionInfo(	btScalar mass, btMotionState* motionState, btCollisionShape* collisionShape, const btVector3& localInertia=btVector3(0,0,0)):
-		m_mass(mass),
-			m_motionState(motionState),
-			m_collisionShape(collisionShape),
-			m_localInertia(localInertia),
-			m_linearDamping(btScalar(0.)),
-			m_angularDamping(btScalar(0.)),
-			m_friction(btScalar(0.5)),
-			m_restitution(btScalar(0.)),
-			m_linearSleepingThreshold(btScalar(0.8)),
-			m_angularSleepingThreshold(btScalar(1.f)),
-			m_additionalDamping(false),
-			m_additionalDampingFactor(btScalar(0.005)),
-			m_additionalLinearDampingThresholdSqr(btScalar(0.01)),
-			m_additionalAngularDampingThresholdSqr(btScalar(0.01)),
-			m_additionalAngularDampingFactor(btScalar(0.01))
-		{
-			m_startWorldTransform.setIdentity();
-		}
-	};
-
-	///btRigidBody constructor using construction info
-	btRigidBody(	const btRigidBodyConstructionInfo& constructionInfo);
-
-	///btRigidBody constructor for backwards compatibility. 
-	///To specify friction (etc) during rigid body construction, please use the other constructor (using btRigidBodyConstructionInfo)
-	btRigidBody(	btScalar mass, btMotionState* motionState, btCollisionShape* collisionShape, const btVector3& localInertia=btVector3(0,0,0));
-
-
-	virtual ~btRigidBody()
-        { 
-                //No constraints should point to this rigidbody
-		//Remove constraints from the dynamics world before you delete the related rigidbodies. 
-                btAssert(m_constraintRefs.size()==0); 
-        }
-
-protected:
-
-	///setupRigidBody is only used internally by the constructor
-	void	setupRigidBody(const btRigidBodyConstructionInfo& constructionInfo);
-
-public:
-
-	void			proceedToTransform(const btTransform& newTrans); 
-	
-	///to keep collision detection and dynamics separate we don't store a rigidbody pointer
-	///but a rigidbody is derived from btCollisionObject, so we can safely perform an upcast
-	static const btRigidBody*	upcast(const btCollisionObject* colObj)
-	{
-		if (colObj->getInternalType()&btCollisionObject::CO_RIGID_BODY)
-			return (const btRigidBody*)colObj;
-		return 0;
-	}
-	static btRigidBody*	upcast(btCollisionObject* colObj)
-	{
-		if (colObj->getInternalType()&btCollisionObject::CO_RIGID_BODY)
-			return (btRigidBody*)colObj;
-		return 0;
-	}
-	
-	/// continuous collision detection needs prediction
-	void			predictIntegratedTransform(btScalar step, btTransform& predictedTransform) ;
-	
-	void			saveKinematicState(btScalar step);
-	
-	void			applyGravity();
-	
-	void			setGravity(const btVector3& acceleration);  
-
-	const btVector3&	getGravity() const
-	{
-		return m_gravity_acceleration;
-	}
-
-	void			setDamping(btScalar lin_damping, btScalar ang_damping);
-
-	btScalar getLinearDamping() const
-	{
-		return m_linearDamping;
-	}
-
-	btScalar getAngularDamping() const
-	{
-		return m_angularDamping;
-	}
-
-	btScalar getLinearSleepingThreshold() const
-	{
-		return m_linearSleepingThreshold;
-	}
-
-	btScalar getAngularSleepingThreshold() const
-	{
-		return m_angularSleepingThreshold;
-	}
-
-	void			applyDamping(btScalar timeStep);
-
-	SIMD_FORCE_INLINE const btCollisionShape*	getCollisionShape() const {
-		return m_collisionShape;
-	}
-
-	SIMD_FORCE_INLINE btCollisionShape*	getCollisionShape() {
-			return m_collisionShape;
-	}
-	
-	void			setMassProps(btScalar mass, const btVector3& inertia);
-	
-	const btVector3& getLinearFactor() const
-	{
-		return m_linearFactor;
-	}
-	void setLinearFactor(const btVector3& linearFactor)
-	{
-		m_linearFactor = linearFactor;
-		m_invMass = m_linearFactor*m_inverseMass;
-	}
-	btScalar		getInvMass() const { return m_inverseMass; }
-	const btMatrix3x3& getInvInertiaTensorWorld() const { 
-		return m_invInertiaTensorWorld; 
-	}
-		
-	void			integrateVelocities(btScalar step);
-
-	void			setCenterOfMassTransform(const btTransform& xform);
-
-	void			applyCentralForce(const btVector3& force)
-	{
-		m_totalForce += force*m_linearFactor;
-	}
-
-	const btVector3& getTotalForce() const
-	{
-		return m_totalForce;
-	};
-
-	const btVector3& getTotalTorque() const
-	{
-		return m_totalTorque;
-	};
-    
-	const btVector3& getInvInertiaDiagLocal() const
-	{
-		return m_invInertiaLocal;
-	};
-
-	void	setInvInertiaDiagLocal(const btVector3& diagInvInertia)
-	{
-		m_invInertiaLocal = diagInvInertia;
-	}
-
-	void	setSleepingThresholds(btScalar linear,btScalar angular)
-	{
-		m_linearSleepingThreshold = linear;
-		m_angularSleepingThreshold = angular;
-	}
-
-	void	applyTorque(const btVector3& torque)
-	{
-		m_totalTorque += torque*m_angularFactor;
-	}
-	
-	void	applyForce(const btVector3& force, const btVector3& rel_pos) 
-	{
-		applyCentralForce(force);
-		applyTorque(rel_pos.cross(force*m_linearFactor));
-	}
-	
-	void applyCentralImpulse(const btVector3& impulse)
-	{
-		m_linearVelocity += impulse *m_linearFactor * m_inverseMass;
-	}
-	
-  	void applyTorqueImpulse(const btVector3& torque)
-	{
-			m_angularVelocity += m_invInertiaTensorWorld * torque * m_angularFactor;
-	}
-	
-	void applyImpulse(const btVector3& impulse, const btVector3& rel_pos) 
-	{
-		if (m_inverseMass != btScalar(0.))
-		{
-			applyCentralImpulse(impulse);
-			if (m_angularFactor)
-			{
-				applyTorqueImpulse(rel_pos.cross(impulse*m_linearFactor));
-			}
-		}
-	}
-
-	void clearForces() 
-	{
-		m_totalForce.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
-		m_totalTorque.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
-	}
-	
-	void updateInertiaTensor();    
-	
-	const btVector3&     getCenterOfMassPosition() const { 
-		return m_worldTransform.getOrigin(); 
-	}
-	btQuaternion getOrientation() const;
-	
-	const btTransform&  getCenterOfMassTransform() const { 
-		return m_worldTransform; 
-	}
-	const btVector3&   getLinearVelocity() const { 
-		return m_linearVelocity; 
-	}
-	const btVector3&    getAngularVelocity() const { 
-		return m_angularVelocity; 
-	}
-	
-
-	inline void setLinearVelocity(const btVector3& lin_vel)
-	{ 
-		m_linearVelocity = lin_vel; 
-	}
-
-	inline void setAngularVelocity(const btVector3& ang_vel) 
-	{ 
-		m_angularVelocity = ang_vel; 
-	}
-
-	btVector3 getVelocityInLocalPoint(const btVector3& rel_pos) const
-	{
-		//we also calculate lin/ang velocity for kinematic objects
-		return m_linearVelocity + m_angularVelocity.cross(rel_pos);
-
-		//for kinematic objects, we could also use use:
-		//		return 	(m_worldTransform(rel_pos) - m_interpolationWorldTransform(rel_pos)) / m_kinematicTimeStep;
-	}
-
-	void translate(const btVector3& v) 
-	{
-		m_worldTransform.getOrigin() += v; 
-	}
-
-	
-	void	getAabb(btVector3& aabbMin,btVector3& aabbMax) const;
-
-
-
-
-	
-	SIMD_FORCE_INLINE btScalar computeImpulseDenominator(const btVector3& pos, const btVector3& normal) const
-	{
-		btVector3 r0 = pos - getCenterOfMassPosition();
-
-		btVector3 c0 = (r0).cross(normal);
-
-		btVector3 vec = (c0 * getInvInertiaTensorWorld()).cross(r0);
-
-		return m_inverseMass + normal.dot(vec);
-
-	}
-
-	SIMD_FORCE_INLINE btScalar computeAngularImpulseDenominator(const btVector3& axis) const
-	{
-		btVector3 vec = axis * getInvInertiaTensorWorld();
-		return axis.dot(vec);
-	}
-
-	SIMD_FORCE_INLINE void	updateDeactivation(btScalar timeStep)
-	{
-		if ( (getActivationState() == ISLAND_SLEEPING) || (getActivationState() == DISABLE_DEACTIVATION))
-			return;
-
-		if ((getLinearVelocity().length2() < m_linearSleepingThreshold*m_linearSleepingThreshold) &&
-			(getAngularVelocity().length2() < m_angularSleepingThreshold*m_angularSleepingThreshold))
-		{
-			m_deactivationTime += timeStep;
-		} else
-		{
-			m_deactivationTime=btScalar(0.);
-			setActivationState(0);
-		}
-
-	}
-
-	SIMD_FORCE_INLINE bool	wantsSleeping()
-	{
-
-		if (getActivationState() == DISABLE_DEACTIVATION)
-			return false;
-
-		//disable deactivation
-		if (gDisableDeactivation || (gDeactivationTime == btScalar(0.)))
-			return false;
-
-		if ( (getActivationState() == ISLAND_SLEEPING) || (getActivationState() == WANTS_DEACTIVATION))
-			return true;
-
-		if (m_deactivationTime> gDeactivationTime)
-		{
-			return true;
-		}
-		return false;
-	}
-
-
-	
-	const btBroadphaseProxy*	getBroadphaseProxy() const
-	{
-		return m_broadphaseHandle;
-	}
-	btBroadphaseProxy*	getBroadphaseProxy() 
-	{
-		return m_broadphaseHandle;
-	}
-	void	setNewBroadphaseProxy(btBroadphaseProxy* broadphaseProxy)
-	{
-		m_broadphaseHandle = broadphaseProxy;
-	}
-
-	//btMotionState allows to automatic synchronize the world transform for active objects
-	btMotionState*	getMotionState()
-	{
-		return m_optionalMotionState;
-	}
-	const btMotionState*	getMotionState() const
-	{
-		return m_optionalMotionState;
-	}
-	void	setMotionState(btMotionState* motionState)
-	{
-		m_optionalMotionState = motionState;
-		if (m_optionalMotionState)
-			motionState->getWorldTransform(m_worldTransform);
-	}
-
-	//for experimental overriding of friction/contact solver func
-	int	m_contactSolverType;
-	int	m_frictionSolverType;
-
-	void	setAngularFactor(const btVector3& angFac)
-	{
-		m_angularFactor = angFac;
-	}
-
-	void	setAngularFactor(btScalar angFac)
-	{
-		m_angularFactor.setValue(angFac,angFac,angFac);
-	}
-	const btVector3&	getAngularFactor() const
-	{
-		return m_angularFactor;
-	}
-
-	//is this rigidbody added to a btCollisionWorld/btDynamicsWorld/btBroadphase?
-	bool	isInWorld() const
-	{
-		return (getBroadphaseProxy() != 0);
-	}
-
-	virtual bool checkCollideWithOverride(btCollisionObject* co);
-
-	void addConstraintRef(btTypedConstraint* c);
-	void removeConstraintRef(btTypedConstraint* c);
-
-	btTypedConstraint* getConstraintRef(int index)
-	{
-		return m_constraintRefs[index];
-	}
-
-	int getNumConstraintRefs() const
-	{
-		return m_constraintRefs.size();
-	}
-
-	void	setFlags(int flags)
-	{
-		m_rigidbodyFlags = flags;
-	}
-
-	int getFlags() const
-	{
-		return m_rigidbodyFlags;
-	}
-
-	const btVector3& getDeltaLinearVelocity() const
-	{
-		return m_deltaLinearVelocity;
-	}
-
-	const btVector3& getDeltaAngularVelocity() const
-	{
-		return m_deltaAngularVelocity;
-	}
-
-	const btVector3& getPushVelocity() const 
-	{
-		return m_pushVelocity;
-	}
-
-	const btVector3& getTurnVelocity() const 
-	{
-		return m_turnVelocity;
-	}
-
-
-	////////////////////////////////////////////////
-	///some internal methods, don't use them
-		
-	btVector3& internalGetDeltaLinearVelocity()
-	{
-		return m_deltaLinearVelocity;
-	}
-
-	btVector3& internalGetDeltaAngularVelocity()
-	{
-		return m_deltaAngularVelocity;
-	}
-
-	const btVector3& internalGetAngularFactor() const
-	{
-		return m_angularFactor;
-	}
-
-	const btVector3& internalGetInvMass() const
-	{
-		return m_invMass;
-	}
-	
-	btVector3& internalGetPushVelocity()
-	{
-		return m_pushVelocity;
-	}
-
-	btVector3& internalGetTurnVelocity()
-	{
-		return m_turnVelocity;
-	}
-
-	SIMD_FORCE_INLINE void	internalGetVelocityInLocalPointObsolete(const btVector3& rel_pos, btVector3& velocity ) const
-	{
-		velocity = getLinearVelocity()+m_deltaLinearVelocity + (getAngularVelocity()+m_deltaAngularVelocity).cross(rel_pos);
-	}
-
-	SIMD_FORCE_INLINE void	internalGetAngularVelocity(btVector3& angVel) const
-	{
-		angVel = getAngularVelocity()+m_deltaAngularVelocity;
-	}
-
-
-	//Optimization for the iterative solver: avoid calculating constant terms involving inertia, normal, relative position
-	SIMD_FORCE_INLINE void internalApplyImpulse(const btVector3& linearComponent, const btVector3& angularComponent,const btScalar impulseMagnitude)
-	{
-		if (m_inverseMass)
-		{
-			m_deltaLinearVelocity += linearComponent*impulseMagnitude;
-			m_deltaAngularVelocity += angularComponent*(impulseMagnitude*m_angularFactor);
-		}
-	}
-
-	SIMD_FORCE_INLINE void internalApplyPushImpulse(const btVector3& linearComponent, const btVector3& angularComponent,btScalar impulseMagnitude)
-	{
-		if (m_inverseMass)
-		{
-			m_pushVelocity += linearComponent*impulseMagnitude;
-			m_turnVelocity += angularComponent*(impulseMagnitude*m_angularFactor);
-		}
-	}
-	
-	void	internalWritebackVelocity()
-	{
-		if (m_inverseMass)
-		{
-			setLinearVelocity(getLinearVelocity()+ m_deltaLinearVelocity);
-			setAngularVelocity(getAngularVelocity()+m_deltaAngularVelocity);
-			//m_deltaLinearVelocity.setZero();
-			//m_deltaAngularVelocity .setZero();
-			//m_originalBody->setCompanionId(-1);
-		}
-	}
-
-
-	void	internalWritebackVelocity(btScalar timeStep);
-
-	
-
-	///////////////////////////////////////////////
-
-	virtual	int	calculateSerializeBufferSize()	const;
-
-	///fills the dataBuffer and returns the struct name (and 0 on failure)
-	virtual	const char*	serialize(void* dataBuffer,  class btSerializer* serializer) const;
-
-	virtual void serializeSingleObject(class btSerializer* serializer) const;
-
-};
-
-//@todo add m_optionalMotionState and m_constraintRefs to btRigidBodyData
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btRigidBodyFloatData
-{
-	btCollisionObjectFloatData	m_collisionObjectData;
-	btMatrix3x3FloatData		m_invInertiaTensorWorld;
-	btVector3FloatData		m_linearVelocity;
-	btVector3FloatData		m_angularVelocity;
-	btVector3FloatData		m_angularFactor;
-	btVector3FloatData		m_linearFactor;
-	btVector3FloatData		m_gravity;	
-	btVector3FloatData		m_gravity_acceleration;
-	btVector3FloatData		m_invInertiaLocal;
-	btVector3FloatData		m_totalForce;
-	btVector3FloatData		m_totalTorque;
-	float					m_inverseMass;
-	float					m_linearDamping;
-	float					m_angularDamping;
-	float					m_additionalDampingFactor;
-	float					m_additionalLinearDampingThresholdSqr;
-	float					m_additionalAngularDampingThresholdSqr;
-	float					m_additionalAngularDampingFactor;
-	float					m_linearSleepingThreshold;
-	float					m_angularSleepingThreshold;
-	int						m_additionalDamping;
-};
-
-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
-struct	btRigidBodyDoubleData
-{
-	btCollisionObjectDoubleData	m_collisionObjectData;
-	btMatrix3x3DoubleData		m_invInertiaTensorWorld;
-	btVector3DoubleData		m_linearVelocity;
-	btVector3DoubleData		m_angularVelocity;
-	btVector3DoubleData		m_angularFactor;
-	btVector3DoubleData		m_linearFactor;
-	btVector3DoubleData		m_gravity;	
-	btVector3DoubleData		m_gravity_acceleration;
-	btVector3DoubleData		m_invInertiaLocal;
-	btVector3DoubleData		m_totalForce;
-	btVector3DoubleData		m_totalTorque;
-	double					m_inverseMass;
-	double					m_linearDamping;
-	double					m_angularDamping;
-	double					m_additionalDampingFactor;
-	double					m_additionalLinearDampingThresholdSqr;
-	double					m_additionalAngularDampingThresholdSqr;
-	double					m_additionalAngularDampingFactor;
-	double					m_linearSleepingThreshold;
-	double					m_angularSleepingThreshold;
-	int						m_additionalDamping;
-	char	m_padding[4];
-};
-
-
-
-#endif //BT_RIGIDBODY_H
-
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp b/hkl3d/bullet/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp
deleted file mode 100644
index 5fc2f3c..0000000
--- a/hkl3d/bullet/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btSimpleDynamicsWorld.h"
-#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
-#include "BulletCollision/BroadphaseCollision/btSimpleBroadphase.h"
-#include "BulletCollision/CollisionShapes/btCollisionShape.h"
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-#include "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h"
-#include "BulletDynamics/ConstraintSolver/btContactSolverInfo.h"
-
-
-/*
-  Make sure this dummy function never changes so that it
-  can be used by probes that are checking whether the
-  library is actually installed.
-*/
-extern "C" 
-{
-	void btBulletDynamicsProbe ();
-	void btBulletDynamicsProbe () {}
-}
-
-
-
-
-btSimpleDynamicsWorld::btSimpleDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration)
-:btDynamicsWorld(dispatcher,pairCache,collisionConfiguration),
-m_constraintSolver(constraintSolver),
-m_ownsConstraintSolver(false),
-m_gravity(0,0,-10)
-{
-
-}
-
-
-btSimpleDynamicsWorld::~btSimpleDynamicsWorld()
-{
-	if (m_ownsConstraintSolver)
-		btAlignedFree( m_constraintSolver);
-}
-
-int		btSimpleDynamicsWorld::stepSimulation( btScalar timeStep,int maxSubSteps, btScalar fixedTimeStep)
-{
-	(void)fixedTimeStep;
-	(void)maxSubSteps;
-
-
-	///apply gravity, predict motion
-	predictUnconstraintMotion(timeStep);
-
-	btDispatcherInfo&	dispatchInfo = getDispatchInfo();
-	dispatchInfo.m_timeStep = timeStep;
-	dispatchInfo.m_stepCount = 0;
-	dispatchInfo.m_debugDraw = getDebugDrawer();
-
-	///perform collision detection
-	performDiscreteCollisionDetection();
-
-	///solve contact constraints
-	int numManifolds = m_dispatcher1->getNumManifolds();
-	if (numManifolds)
-	{
-		btPersistentManifold** manifoldPtr = ((btCollisionDispatcher*)m_dispatcher1)->getInternalManifoldPointer();
-		
-		btContactSolverInfo infoGlobal;
-		infoGlobal.m_timeStep = timeStep;
-		m_constraintSolver->prepareSolve(0,numManifolds);
-		m_constraintSolver->solveGroup(&getCollisionObjectArray()[0],getNumCollisionObjects(),manifoldPtr, numManifolds,0,0,infoGlobal,m_debugDrawer, m_stackAlloc,m_dispatcher1);
-		m_constraintSolver->allSolved(infoGlobal,m_debugDrawer, m_stackAlloc);
-	}
-
-	///integrate transforms
-	integrateTransforms(timeStep);
-		
-	updateAabbs();
-
-	synchronizeMotionStates();
-
-	clearForces();
-
-	return 1;
-
-}
-
-void	btSimpleDynamicsWorld::clearForces()
-{
-	///@todo: iterate over awake simulation islands!
-	for ( int i=0;i<m_collisionObjects.size();i++)
-	{
-		btCollisionObject* colObj = m_collisionObjects[i];
-		
-		btRigidBody* body = btRigidBody::upcast(colObj);
-		if (body)
-		{
-			body->clearForces();
-		}
-	}
-}	
-
-
-void	btSimpleDynamicsWorld::setGravity(const btVector3& gravity)
-{
-	m_gravity = gravity;
-	for ( int i=0;i<m_collisionObjects.size();i++)
-	{
-		btCollisionObject* colObj = m_collisionObjects[i];
-		btRigidBody* body = btRigidBody::upcast(colObj);
-		if (body)
-		{
-			body->setGravity(gravity);
-		}
-	}
-}
-
-btVector3 btSimpleDynamicsWorld::getGravity () const
-{
-	return m_gravity;
-}
-
-void	btSimpleDynamicsWorld::removeRigidBody(btRigidBody* body)
-{
-	btCollisionWorld::removeCollisionObject(body);
-}
-
-void	btSimpleDynamicsWorld::removeCollisionObject(btCollisionObject* collisionObject)
-{
-	btRigidBody* body = btRigidBody::upcast(collisionObject);
-	if (body)
-		removeRigidBody(body);
-	else
-		btCollisionWorld::removeCollisionObject(collisionObject);
-}
-
-
-void	btSimpleDynamicsWorld::addRigidBody(btRigidBody* body)
-{
-	body->setGravity(m_gravity);
-
-	if (body->getCollisionShape())
-	{
-		addCollisionObject(body);
-	}
-}
-
-void	btSimpleDynamicsWorld::addRigidBody(btRigidBody* body, short group, short mask)
-{
-	body->setGravity(m_gravity);
-
-	if (body->getCollisionShape())
-	{
-		addCollisionObject(body,group,mask);
-	}
-}
-
-
-void	btSimpleDynamicsWorld::debugDrawWorld()
-{
-
-}
-				
-void	btSimpleDynamicsWorld::addAction(btActionInterface* action)
-{
-
-}
-
-void	btSimpleDynamicsWorld::removeAction(btActionInterface* action)
-{
-
-}
-
-
-void	btSimpleDynamicsWorld::updateAabbs()
-{
-	btTransform predictedTrans;
-	for ( int i=0;i<m_collisionObjects.size();i++)
-	{
-		btCollisionObject* colObj = m_collisionObjects[i];
-		btRigidBody* body = btRigidBody::upcast(colObj);
-		if (body)
-		{
-			if (body->isActive() && (!body->isStaticObject()))
-			{
-				btVector3 minAabb,maxAabb;
-				colObj->getCollisionShape()->getAabb(colObj->getWorldTransform(), minAabb,maxAabb);
-				btBroadphaseInterface* bp = getBroadphase();
-				bp->setAabb(body->getBroadphaseHandle(),minAabb,maxAabb, m_dispatcher1);
-			}
-		}
-	}
-}
-
-void	btSimpleDynamicsWorld::integrateTransforms(btScalar timeStep)
-{
-	btTransform predictedTrans;
-	for ( int i=0;i<m_collisionObjects.size();i++)
-	{
-		btCollisionObject* colObj = m_collisionObjects[i];
-		btRigidBody* body = btRigidBody::upcast(colObj);
-		if (body)
-		{
-			if (body->isActive() && (!body->isStaticObject()))
-			{
-				body->predictIntegratedTransform(timeStep, predictedTrans);
-				body->proceedToTransform( predictedTrans);
-			}
-		}
-	}
-}
-
-
-
-void	btSimpleDynamicsWorld::predictUnconstraintMotion(btScalar timeStep)
-{
-	for ( int i=0;i<m_collisionObjects.size();i++)
-	{
-		btCollisionObject* colObj = m_collisionObjects[i];
-		btRigidBody* body = btRigidBody::upcast(colObj);
-		if (body)
-		{
-			if (!body->isStaticObject())
-			{
-				if (body->isActive())
-				{
-					body->applyGravity();
-					body->integrateVelocities( timeStep);
-					body->applyDamping(timeStep);
-					body->predictIntegratedTransform(timeStep,body->getInterpolationWorldTransform());
-				}
-			}
-		}
-	}
-}
-
-
-void	btSimpleDynamicsWorld::synchronizeMotionStates()
-{
-	///@todo: iterate over awake simulation islands!
-	for ( int i=0;i<m_collisionObjects.size();i++)
-	{
-		btCollisionObject* colObj = m_collisionObjects[i];
-		btRigidBody* body = btRigidBody::upcast(colObj);
-		if (body && body->getMotionState())
-		{
-			if (body->getActivationState() != ISLAND_SLEEPING)
-			{
-				body->getMotionState()->setWorldTransform(body->getWorldTransform());
-			}
-		}
-	}
-
-}
-
-
-void	btSimpleDynamicsWorld::setConstraintSolver(btConstraintSolver* solver)
-{
-	if (m_ownsConstraintSolver)
-	{
-		btAlignedFree(m_constraintSolver);
-	}
-	m_ownsConstraintSolver = false;
-	m_constraintSolver = solver;
-}
-
-btConstraintSolver* btSimpleDynamicsWorld::getConstraintSolver()
-{
-	return m_constraintSolver;
-}
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.h b/hkl3d/bullet/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.h
deleted file mode 100644
index 07a727e..0000000
--- a/hkl3d/bullet/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_SIMPLE_DYNAMICS_WORLD_H
-#define BT_SIMPLE_DYNAMICS_WORLD_H
-
-#include "btDynamicsWorld.h"
-
-class btDispatcher;
-class btOverlappingPairCache;
-class btConstraintSolver;
-
-///The btSimpleDynamicsWorld serves as unit-test and to verify more complicated and optimized dynamics worlds.
-///Please use btDiscreteDynamicsWorld instead (or btContinuousDynamicsWorld once it is finished).
-class btSimpleDynamicsWorld : public btDynamicsWorld
-{
-protected:
-
-	btConstraintSolver*	m_constraintSolver;
-
-	bool	m_ownsConstraintSolver;
-
-	void	predictUnconstraintMotion(btScalar timeStep);
-	
-	void	integrateTransforms(btScalar timeStep);
-		
-	btVector3	m_gravity;
-	
-public:
-
-
-
-	///this btSimpleDynamicsWorld constructor creates dispatcher, broadphase pairCache and constraintSolver
-	btSimpleDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration);
-
-	virtual ~btSimpleDynamicsWorld();
-		
-	///maxSubSteps/fixedTimeStep for interpolation is currently ignored for btSimpleDynamicsWorld, use btDiscreteDynamicsWorld instead
-	virtual int	stepSimulation( btScalar timeStep,int maxSubSteps=1, btScalar fixedTimeStep=btScalar(1.)/btScalar(60.));
-
-	virtual void	setGravity(const btVector3& gravity);
-
-	virtual btVector3 getGravity () const;
-
-	virtual void	addRigidBody(btRigidBody* body);
-
-	virtual void	addRigidBody(btRigidBody* body, short group, short mask);
-
-	virtual void	removeRigidBody(btRigidBody* body);
-
-	virtual void	debugDrawWorld();
-				
-	virtual void	addAction(btActionInterface* action);
-
-	virtual void	removeAction(btActionInterface* action);
-
-	///removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise call btCollisionWorld::removeCollisionObject
-	virtual void	removeCollisionObject(btCollisionObject* collisionObject);
-	
-	virtual void	updateAabbs();
-
-	virtual void	synchronizeMotionStates();
-
-	virtual void	setConstraintSolver(btConstraintSolver* solver);
-
-	virtual btConstraintSolver* getConstraintSolver();
-
-	virtual btDynamicsWorldType	getWorldType() const
-	{
-		return BT_SIMPLE_DYNAMICS_WORLD;
-	}
-
-	virtual void	clearForces();
-
-};
-
-#endif //BT_SIMPLE_DYNAMICS_WORLD_H
diff --git a/hkl3d/bullet/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp b/hkl3d/bullet/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp
deleted file mode 100644
index 5b46788..0000000
--- a/hkl3d/bullet/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp
+++ /dev/null
@@ -1,771 +0,0 @@
-/*
- * Copyright (c) 2005 Erwin Coumans http://continuousphysics.com/Bullet/
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies.
- * Erwin Coumans makes no representations about the suitability 
- * of this software for any purpose.  
- * It is provided "as is" without express or implied warranty.
-*/
-
-#include "LinearMath/btVector3.h"
-#include "btRaycastVehicle.h"
-
-#include "BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h"
-#include "BulletDynamics/ConstraintSolver/btJacobianEntry.h"
-#include "LinearMath/btQuaternion.h"
-#include "BulletDynamics/Dynamics/btDynamicsWorld.h"
-#include "btVehicleRaycaster.h"
-#include "btWheelInfo.h"
-#include "LinearMath/btMinMax.h"
-#include "LinearMath/btIDebugDraw.h"
-#include "BulletDynamics/ConstraintSolver/btContactConstraint.h"
-
-#define ROLLING_INFLUENCE_FIX
-
-
-btRigidBody& btActionInterface::getFixedBody()
-{
-	static btRigidBody s_fixed(0, 0,0);
-	s_fixed.setMassProps(btScalar(0.),btVector3(btScalar(0.),btScalar(0.),btScalar(0.)));
-	return s_fixed;
-}
-
-btRaycastVehicle::btRaycastVehicle(const btVehicleTuning& tuning,btRigidBody* chassis,	btVehicleRaycaster* raycaster )
-:m_vehicleRaycaster(raycaster),
-m_pitchControl(btScalar(0.))
-{
-	m_chassisBody = chassis;
-	m_indexRightAxis = 0;
-	m_indexUpAxis = 2;
-	m_indexForwardAxis = 1;
-	defaultInit(tuning);
-}
-
-
-void btRaycastVehicle::defaultInit(const btVehicleTuning& tuning)
-{
-	(void)tuning;
-	m_currentVehicleSpeedKmHour = btScalar(0.);
-	m_steeringValue = btScalar(0.);
-	
-}
-
-	
-
-btRaycastVehicle::~btRaycastVehicle()
-{
-}
-
-
-//
-// basically most of the code is general for 2 or 4 wheel vehicles, but some of it needs to be reviewed
-//
-btWheelInfo&	btRaycastVehicle::addWheel( const btVector3& connectionPointCS, const btVector3& wheelDirectionCS0,const btVector3& wheelAxleCS, btScalar suspensionRestLength, btScalar wheelRadius,const btVehicleTuning& tuning, bool isFrontWheel)
-{
-
-	btWheelInfoConstructionInfo ci;
-
-	ci.m_chassisConnectionCS = connectionPointCS;
-	ci.m_wheelDirectionCS = wheelDirectionCS0;
-	ci.m_wheelAxleCS = wheelAxleCS;
-	ci.m_suspensionRestLength = suspensionRestLength;
-	ci.m_wheelRadius = wheelRadius;
-	ci.m_suspensionStiffness = tuning.m_suspensionStiffness;
-	ci.m_wheelsDampingCompression = tuning.m_suspensionCompression;
-	ci.m_wheelsDampingRelaxation = tuning.m_suspensionDamping;
-	ci.m_frictionSlip = tuning.m_frictionSlip;
-	ci.m_bIsFrontWheel = isFrontWheel;
-	ci.m_maxSuspensionTravelCm = tuning.m_maxSuspensionTravelCm;
-	ci.m_maxSuspensionForce = tuning.m_maxSuspensionForce;
-
-	m_wheelInfo.push_back( btWheelInfo(ci));
-	
-	btWheelInfo& wheel = m_wheelInfo[getNumWheels()-1];
-	
-	updateWheelTransformsWS( wheel , false );
-	updateWheelTransform(getNumWheels()-1,false);
-	return wheel;
-}
-
-
-
-
-const btTransform&	btRaycastVehicle::getWheelTransformWS( int wheelIndex ) const
-{
-	btAssert(wheelIndex < getNumWheels());
-	const btWheelInfo& wheel = m_wheelInfo[wheelIndex];
-	return wheel.m_worldTransform;
-
-}
-
-void	btRaycastVehicle::updateWheelTransform( int wheelIndex , bool interpolatedTransform)
-{
-	
-	btWheelInfo& wheel = m_wheelInfo[ wheelIndex ];
-	updateWheelTransformsWS(wheel,interpolatedTransform);
-	btVector3 up = -wheel.m_raycastInfo.m_wheelDirectionWS;
-	const btVector3& right = wheel.m_raycastInfo.m_wheelAxleWS;
-	btVector3 fwd = up.cross(right);
-	fwd = fwd.normalize();
-//	up = right.cross(fwd);
-//	up.normalize();
-
-	//rotate around steering over de wheelAxleWS
-	btScalar steering = wheel.m_steering;
-	
-	btQuaternion steeringOrn(up,steering);//wheel.m_steering);
-	btMatrix3x3 steeringMat(steeringOrn);
-
-	btQuaternion rotatingOrn(right,-wheel.m_rotation);
-	btMatrix3x3 rotatingMat(rotatingOrn);
-
-	btMatrix3x3 basis2(
-		right[0],fwd[0],up[0],
-		right[1],fwd[1],up[1],
-		right[2],fwd[2],up[2]
-	);
-	
-	wheel.m_worldTransform.setBasis(steeringMat * rotatingMat * basis2);
-	wheel.m_worldTransform.setOrigin(
-		wheel.m_raycastInfo.m_hardPointWS + wheel.m_raycastInfo.m_wheelDirectionWS * wheel.m_raycastInfo.m_suspensionLength
-	);
-}
-
-void btRaycastVehicle::resetSuspension()
-{
-
-	int i;
-	for (i=0;i<m_wheelInfo.size();	i++)
-	{
-			btWheelInfo& wheel = m_wheelInfo[i];
-			wheel.m_raycastInfo.m_suspensionLength = wheel.getSuspensionRestLength();
-			wheel.m_suspensionRelativeVelocity = btScalar(0.0);
-			
-			wheel.m_raycastInfo.m_contactNormalWS = - wheel.m_raycastInfo.m_wheelDirectionWS;
-			//wheel_info.setContactFriction(btScalar(0.0));
-			wheel.m_clippedInvContactDotSuspension = btScalar(1.0);
-	}
-}
-
-void	btRaycastVehicle::updateWheelTransformsWS(btWheelInfo& wheel , bool interpolatedTransform)
-{
-	wheel.m_raycastInfo.m_isInContact = false;
-
-	btTransform chassisTrans = getChassisWorldTransform();
-	if (interpolatedTransform && (getRigidBody()->getMotionState()))
-	{
-		getRigidBody()->getMotionState()->getWorldTransform(chassisTrans);
-	}
-
-	wheel.m_raycastInfo.m_hardPointWS = chassisTrans( wheel.m_chassisConnectionPointCS );
-	wheel.m_raycastInfo.m_wheelDirectionWS = chassisTrans.getBasis() *  wheel.m_wheelDirectionCS ;
-	wheel.m_raycastInfo.m_wheelAxleWS = chassisTrans.getBasis() * wheel.m_wheelAxleCS;
-}
-
-btScalar btRaycastVehicle::rayCast(btWheelInfo& wheel)
-{
-	updateWheelTransformsWS( wheel,false);
-
-	
-	btScalar depth = -1;
-	
-	btScalar raylen = wheel.getSuspensionRestLength()+wheel.m_wheelsRadius;
-
-	btVector3 rayvector = wheel.m_raycastInfo.m_wheelDirectionWS * (raylen);
-	const btVector3& source = wheel.m_raycastInfo.m_hardPointWS;
-	wheel.m_raycastInfo.m_contactPointWS = source + rayvector;
-	const btVector3& target = wheel.m_raycastInfo.m_contactPointWS;
-
-	btScalar param = btScalar(0.);
-	
-	btVehicleRaycaster::btVehicleRaycasterResult	rayResults;
-
-	btAssert(m_vehicleRaycaster);
-
-	void* object = m_vehicleRaycaster->castRay(source,target,rayResults);
-
-	wheel.m_raycastInfo.m_groundObject = 0;
-
-	if (object)
-	{
-		param = rayResults.m_distFraction;
-		depth = raylen * rayResults.m_distFraction;
-		wheel.m_raycastInfo.m_contactNormalWS  = rayResults.m_hitNormalInWorld;
-		wheel.m_raycastInfo.m_isInContact = true;
-		
-		wheel.m_raycastInfo.m_groundObject = &getFixedBody();///@todo for driving on dynamic/movable objects!;
-		//wheel.m_raycastInfo.m_groundObject = object;
-
-
-		btScalar hitDistance = param*raylen;
-		wheel.m_raycastInfo.m_suspensionLength = hitDistance - wheel.m_wheelsRadius;
-		//clamp on max suspension travel
-
-		btScalar  minSuspensionLength = wheel.getSuspensionRestLength() - wheel.m_maxSuspensionTravelCm*btScalar(0.01);
-		btScalar maxSuspensionLength = wheel.getSuspensionRestLength()+ wheel.m_maxSuspensionTravelCm*btScalar(0.01);
-		if (wheel.m_raycastInfo.m_suspensionLength < minSuspensionLength)
-		{
-			wheel.m_raycastInfo.m_suspensionLength = minSuspensionLength;
-		}
-		if (wheel.m_raycastInfo.m_suspensionLength > maxSuspensionLength)
-		{
-			wheel.m_raycastInfo.m_suspensionLength = maxSuspensionLength;
-		}
-
-		wheel.m_raycastInfo.m_contactPointWS = rayResults.m_hitPointInWorld;
-
-		btScalar denominator= wheel.m_raycastInfo.m_contactNormalWS.dot( wheel.m_raycastInfo.m_wheelDirectionWS );
-
-		btVector3 chassis_velocity_at_contactPoint;
-		btVector3 relpos = wheel.m_raycastInfo.m_contactPointWS-getRigidBody()->getCenterOfMassPosition();
-
-		chassis_velocity_at_contactPoint = getRigidBody()->getVelocityInLocalPoint(relpos);
-
-		btScalar projVel = wheel.m_raycastInfo.m_contactNormalWS.dot( chassis_velocity_at_contactPoint );
-
-		if ( denominator >= btScalar(-0.1))
-		{
-			wheel.m_suspensionRelativeVelocity = btScalar(0.0);
-			wheel.m_clippedInvContactDotSuspension = btScalar(1.0) / btScalar(0.1);
-		}
-		else
-		{
-			btScalar inv = btScalar(-1.) / denominator;
-			wheel.m_suspensionRelativeVelocity = projVel * inv;
-			wheel.m_clippedInvContactDotSuspension = inv;
-		}
-			
-	} else
-	{
-		//put wheel info as in rest position
-		wheel.m_raycastInfo.m_suspensionLength = wheel.getSuspensionRestLength();
-		wheel.m_suspensionRelativeVelocity = btScalar(0.0);
-		wheel.m_raycastInfo.m_contactNormalWS = - wheel.m_raycastInfo.m_wheelDirectionWS;
-		wheel.m_clippedInvContactDotSuspension = btScalar(1.0);
-	}
-
-	return depth;
-}
-
-
-const btTransform& btRaycastVehicle::getChassisWorldTransform() const
-{
-	/*if (getRigidBody()->getMotionState())
-	{
-		btTransform chassisWorldTrans;
-		getRigidBody()->getMotionState()->getWorldTransform(chassisWorldTrans);
-		return chassisWorldTrans;
-	}
-	*/
-
-	
-	return getRigidBody()->getCenterOfMassTransform();
-}
-
-
-void btRaycastVehicle::updateVehicle( btScalar step )
-{
-	{
-		for (int i=0;i<getNumWheels();i++)
-		{
-			updateWheelTransform(i,false);
-		}
-	}
-
-
-	m_currentVehicleSpeedKmHour = btScalar(3.6) * getRigidBody()->getLinearVelocity().length();
-	
-	const btTransform& chassisTrans = getChassisWorldTransform();
-
-	btVector3 forwardW (
-		chassisTrans.getBasis()[0][m_indexForwardAxis],
-		chassisTrans.getBasis()[1][m_indexForwardAxis],
-		chassisTrans.getBasis()[2][m_indexForwardAxis]);
-
-	if (forwardW.dot(getRigidBody()->getLinearVelocity()) < btScalar(0.))
-	{
-		m_currentVehicleSpeedKmHour *= btScalar(-1.);
-	}
-
-	//
-	// simulate suspension
-	//
-	
-	int i=0;
-	for (i=0;i<m_wheelInfo.size();i++)
-	{
-		btScalar depth; 
-		depth = rayCast( m_wheelInfo[i]);
-	}
-
-	updateSuspension(step);
-
-	
-	for (i=0;i<m_wheelInfo.size();i++)
-	{
-		//apply suspension force
-		btWheelInfo& wheel = m_wheelInfo[i];
-		
-		btScalar suspensionForce = wheel.m_wheelsSuspensionForce;
-		
-		if (suspensionForce > wheel.m_maxSuspensionForce)
-		{
-			suspensionForce = wheel.m_maxSuspensionForce;
-		}
-		btVector3 impulse = wheel.m_raycastInfo.m_contactNormalWS * suspensionForce * step;
-		btVector3 relpos = wheel.m_raycastInfo.m_contactPointWS - getRigidBody()->getCenterOfMassPosition();
-		
-		getRigidBody()->applyImpulse(impulse, relpos);
-	
-	}
-	
-
-	
-	updateFriction( step);
-
-	
-	for (i=0;i<m_wheelInfo.size();i++)
-	{
-		btWheelInfo& wheel = m_wheelInfo[i];
-		btVector3 relpos = wheel.m_raycastInfo.m_hardPointWS - getRigidBody()->getCenterOfMassPosition();
-		btVector3 vel = getRigidBody()->getVelocityInLocalPoint( relpos );
-
-		if (wheel.m_raycastInfo.m_isInContact)
-		{
-			const btTransform&	chassisWorldTransform = getChassisWorldTransform();
-
-			btVector3 fwd (
-				chassisWorldTransform.getBasis()[0][m_indexForwardAxis],
-				chassisWorldTransform.getBasis()[1][m_indexForwardAxis],
-				chassisWorldTransform.getBasis()[2][m_indexForwardAxis]);
-
-			btScalar proj = fwd.dot(wheel.m_raycastInfo.m_contactNormalWS);
-			fwd -= wheel.m_raycastInfo.m_contactNormalWS * proj;
-
-			btScalar proj2 = fwd.dot(vel);
-			
-			wheel.m_deltaRotation = (proj2 * step) / (wheel.m_wheelsRadius);
-			wheel.m_rotation += wheel.m_deltaRotation;
-
-		} else
-		{
-			wheel.m_rotation += wheel.m_deltaRotation;
-		}
-		
-		wheel.m_deltaRotation *= btScalar(0.99);//damping of rotation when not in contact
-
-	}
-
-
-
-}
-
-
-void	btRaycastVehicle::setSteeringValue(btScalar steering,int wheel)
-{
-	btAssert(wheel>=0 && wheel < getNumWheels());
-
-	btWheelInfo& wheelInfo = getWheelInfo(wheel);
-	wheelInfo.m_steering = steering;
-}
-
-
-
-btScalar	btRaycastVehicle::getSteeringValue(int wheel) const
-{
-	return getWheelInfo(wheel).m_steering;
-}
-
-
-void	btRaycastVehicle::applyEngineForce(btScalar force, int wheel)
-{
-	btAssert(wheel>=0 && wheel < getNumWheels());
-	btWheelInfo& wheelInfo = getWheelInfo(wheel);
-	wheelInfo.m_engineForce = force;
-}
-
-
-const btWheelInfo&	btRaycastVehicle::getWheelInfo(int index) const
-{
-	btAssert((index >= 0) && (index < 	getNumWheels()));
-	
-	return m_wheelInfo[index];
-}
-
-btWheelInfo&	btRaycastVehicle::getWheelInfo(int index) 
-{
-	btAssert((index >= 0) && (index < 	getNumWheels()));
-	
-	return m_wheelInfo[index];
-}
-
-void btRaycastVehicle::setBrake(btScalar brake,int wheelIndex)
-{
-	btAssert((wheelIndex >= 0) && (wheelIndex < 	getNumWheels()));
-	getWheelInfo(wheelIndex).m_brake = brake;
-}
-
-
-void	btRaycastVehicle::updateSuspension(btScalar deltaTime)
-{
-	(void)deltaTime;
-
-	btScalar chassisMass = btScalar(1.) / m_chassisBody->getInvMass();
-	
-	for (int w_it=0; w_it<getNumWheels(); w_it++)
-	{
-		btWheelInfo &wheel_info = m_wheelInfo[w_it];
-		
-		if ( wheel_info.m_raycastInfo.m_isInContact )
-		{
-			btScalar force;
-			//	Spring
-			{
-				btScalar	susp_length			= wheel_info.getSuspensionRestLength();
-				btScalar	current_length = wheel_info.m_raycastInfo.m_suspensionLength;
-
-				btScalar length_diff = (susp_length - current_length);
-
-				force = wheel_info.m_suspensionStiffness
-					* length_diff * wheel_info.m_clippedInvContactDotSuspension;
-			}
-		
-			// Damper
-			{
-				btScalar projected_rel_vel = wheel_info.m_suspensionRelativeVelocity;
-				{
-					btScalar	susp_damping;
-					if ( projected_rel_vel < btScalar(0.0) )
-					{
-						susp_damping = wheel_info.m_wheelsDampingCompression;
-					}
-					else
-					{
-						susp_damping = wheel_info.m_wheelsDampingRelaxation;
-					}
-					force -= susp_damping * projected_rel_vel;
-				}
-			}
-
-			// RESULT
-			wheel_info.m_wheelsSuspensionForce = force * chassisMass;
-			if (wheel_info.m_wheelsSuspensionForce < btScalar(0.))
-			{
-				wheel_info.m_wheelsSuspensionForce = btScalar(0.);
-			}
-		}
-		else
-		{
-			wheel_info.m_wheelsSuspensionForce = btScalar(0.0);
-		}
-	}
-
-}
-
-
-struct btWheelContactPoint
-{
-	btRigidBody* m_body0;
-	btRigidBody* m_body1;
-	btVector3	m_frictionPositionWorld;
-	btVector3	m_frictionDirectionWorld;
-	btScalar	m_jacDiagABInv;
-	btScalar	m_maxImpulse;
-
-
-	btWheelContactPoint(btRigidBody* body0,btRigidBody* body1,const btVector3& frictionPosWorld,const btVector3& frictionDirectionWorld, btScalar maxImpulse)
-		:m_body0(body0),
-		m_body1(body1),
-		m_frictionPositionWorld(frictionPosWorld),
-		m_frictionDirectionWorld(frictionDirectionWorld),
-		m_maxImpulse(maxImpulse)
-	{
-		btScalar denom0 = body0->computeImpulseDenominator(frictionPosWorld,frictionDirectionWorld);
-		btScalar denom1 = body1->computeImpulseDenominator(frictionPosWorld,frictionDirectionWorld);
-		btScalar	relaxation = 1.f;
-		m_jacDiagABInv = relaxation/(denom0+denom1);
-	}
-
-
-
-};
-
-btScalar calcRollingFriction(btWheelContactPoint& contactPoint);
-btScalar calcRollingFriction(btWheelContactPoint& contactPoint)
-{
-
-	btScalar j1=0.f;
-
-	const btVector3& contactPosWorld = contactPoint.m_frictionPositionWorld;
-
-	btVector3 rel_pos1 = contactPosWorld - contactPoint.m_body0->getCenterOfMassPosition(); 
-	btVector3 rel_pos2 = contactPosWorld - contactPoint.m_body1->getCenterOfMassPosition();
-	
-	btScalar maxImpulse  = contactPoint.m_maxImpulse;
-	
-	btVector3 vel1 = contactPoint.m_body0->getVelocityInLocalPoint(rel_pos1);
-	btVector3 vel2 = contactPoint.m_body1->getVelocityInLocalPoint(rel_pos2);
-	btVector3 vel = vel1 - vel2;
-
-	btScalar vrel = contactPoint.m_frictionDirectionWorld.dot(vel);
-
-	// calculate j that moves us to zero relative velocity
-	j1 = -vrel * contactPoint.m_jacDiagABInv;
-	btSetMin(j1, maxImpulse);
-	btSetMax(j1, -maxImpulse);
-
-	return j1;
-}
-
-
-
-
-btScalar sideFrictionStiffness2 = btScalar(1.0);
-void	btRaycastVehicle::updateFriction(btScalar	timeStep)
-{
-
-		//calculate the impulse, so that the wheels don't move sidewards
-		int numWheel = getNumWheels();
-		if (!numWheel)
-			return;
-
-		m_forwardWS.resize(numWheel);
-		m_axle.resize(numWheel);
-		m_forwardImpulse.resize(numWheel);
-		m_sideImpulse.resize(numWheel);
-		
-		int numWheelsOnGround = 0;
-	
-
-		//collapse all those loops into one!
-		for (int i=0;i<getNumWheels();i++)
-		{
-			btWheelInfo& wheelInfo = m_wheelInfo[i];
-			class btRigidBody* groundObject = (class btRigidBody*) wheelInfo.m_raycastInfo.m_groundObject;
-			if (groundObject)
-				numWheelsOnGround++;
-			m_sideImpulse[i] = btScalar(0.);
-			m_forwardImpulse[i] = btScalar(0.);
-
-		}
-	
-		{
-	
-			for (int i=0;i<getNumWheels();i++)
-			{
-
-				btWheelInfo& wheelInfo = m_wheelInfo[i];
-					
-				class btRigidBody* groundObject = (class btRigidBody*) wheelInfo.m_raycastInfo.m_groundObject;
-
-				if (groundObject)
-				{
-
-					const btTransform& wheelTrans = getWheelTransformWS( i );
-
-					btMatrix3x3 wheelBasis0 = wheelTrans.getBasis();
-					m_axle[i] = btVector3(	
-						wheelBasis0[0][m_indexRightAxis],
-						wheelBasis0[1][m_indexRightAxis],
-						wheelBasis0[2][m_indexRightAxis]);
-					
-					const btVector3& surfNormalWS = wheelInfo.m_raycastInfo.m_contactNormalWS;
-					btScalar proj = m_axle[i].dot(surfNormalWS);
-					m_axle[i] -= surfNormalWS * proj;
-					m_axle[i] = m_axle[i].normalize();
-					
-					m_forwardWS[i] = surfNormalWS.cross(m_axle[i]);
-					m_forwardWS[i].normalize();
-
-				
-					resolveSingleBilateral(*m_chassisBody, wheelInfo.m_raycastInfo.m_contactPointWS,
-							  *groundObject, wheelInfo.m_raycastInfo.m_contactPointWS,
-							  btScalar(0.), m_axle[i],m_sideImpulse[i],timeStep);
-
-					m_sideImpulse[i] *= sideFrictionStiffness2;
-						
-				}
-				
-
-			}
-		}
-
-	btScalar sideFactor = btScalar(1.);
-	btScalar fwdFactor = 0.5;
-
-	bool sliding = false;
-	{
-		for (int wheel =0;wheel <getNumWheels();wheel++)
-		{
-			btWheelInfo& wheelInfo = m_wheelInfo[wheel];
-			class btRigidBody* groundObject = (class btRigidBody*) wheelInfo.m_raycastInfo.m_groundObject;
-
-			btScalar	rollingFriction = 0.f;
-
-			if (groundObject)
-			{
-				if (wheelInfo.m_engineForce != 0.f)
-				{
-					rollingFriction = wheelInfo.m_engineForce* timeStep;
-				} else
-				{
-					btScalar defaultRollingFrictionImpulse = 0.f;
-					btScalar maxImpulse = wheelInfo.m_brake ? wheelInfo.m_brake : defaultRollingFrictionImpulse;
-					btWheelContactPoint contactPt(m_chassisBody,groundObject,wheelInfo.m_raycastInfo.m_contactPointWS,m_forwardWS[wheel],maxImpulse);
-					rollingFriction = calcRollingFriction(contactPt);
-				}
-			}
-
-			//switch between active rolling (throttle), braking and non-active rolling friction (no throttle/break)
-			
-
-
-
-			m_forwardImpulse[wheel] = btScalar(0.);
-			m_wheelInfo[wheel].m_skidInfo= btScalar(1.);
-
-			if (groundObject)
-			{
-				m_wheelInfo[wheel].m_skidInfo= btScalar(1.);
-				
-				btScalar maximp = wheelInfo.m_wheelsSuspensionForce * timeStep * wheelInfo.m_frictionSlip;
-				btScalar maximpSide = maximp;
-
-				btScalar maximpSquared = maximp * maximpSide;
-			
-
-				m_forwardImpulse[wheel] = rollingFriction;//wheelInfo.m_engineForce* timeStep;
-
-				btScalar x = (m_forwardImpulse[wheel] ) * fwdFactor;
-				btScalar y = (m_sideImpulse[wheel] ) * sideFactor;
-				
-				btScalar impulseSquared = (x*x + y*y);
-
-				if (impulseSquared > maximpSquared)
-				{
-					sliding = true;
-					
-					btScalar factor = maximp / btSqrt(impulseSquared);
-					
-					m_wheelInfo[wheel].m_skidInfo *= factor;
-				}
-			} 
-
-		}
-	}
-
-	
-
-
-		if (sliding)
-		{
-			for (int wheel = 0;wheel < getNumWheels(); wheel++)
-			{
-				if (m_sideImpulse[wheel] != btScalar(0.))
-				{
-					if (m_wheelInfo[wheel].m_skidInfo< btScalar(1.))
-					{
-						m_forwardImpulse[wheel] *=	m_wheelInfo[wheel].m_skidInfo;
-						m_sideImpulse[wheel] *= m_wheelInfo[wheel].m_skidInfo;
-					}
-				}
-			}
-		}
-
-		// apply the impulses
-		{
-			for (int wheel = 0;wheel<getNumWheels() ; wheel++)
-			{
-				btWheelInfo& wheelInfo = m_wheelInfo[wheel];
-
-				btVector3 rel_pos = wheelInfo.m_raycastInfo.m_contactPointWS - 
-						m_chassisBody->getCenterOfMassPosition();
-
-				if (m_forwardImpulse[wheel] != btScalar(0.))
-				{
-					m_chassisBody->applyImpulse(m_forwardWS[wheel]*(m_forwardImpulse[wheel]),rel_pos);
-				}
-				if (m_sideImpulse[wheel] != btScalar(0.))
-				{
-					class btRigidBody* groundObject = (class btRigidBody*) m_wheelInfo[wheel].m_raycastInfo.m_groundObject;
-
-					btVector3 rel_pos2 = wheelInfo.m_raycastInfo.m_contactPointWS - 
-						groundObject->getCenterOfMassPosition();
-
-					
-					btVector3 sideImp = m_axle[wheel] * m_sideImpulse[wheel];
-
-#if defined ROLLING_INFLUENCE_FIX // fix. It only worked if car's up was along Y - VT.
-					btVector3 vChassisWorldUp = getRigidBody()->getCenterOfMassTransform().getBasis().getColumn(m_indexUpAxis);
-					rel_pos -= vChassisWorldUp * (vChassisWorldUp.dot(rel_pos) * (1.f-wheelInfo.m_rollInfluence));
-#else
-					rel_pos[m_indexUpAxis] *= wheelInfo.m_rollInfluence;
-#endif
-					m_chassisBody->applyImpulse(sideImp,rel_pos);
-
-					//apply friction impulse on the ground
-					groundObject->applyImpulse(-sideImp,rel_pos2);
-				}
-			}
-		}
-
-	
-}
-
-
-
-void	btRaycastVehicle::debugDraw(btIDebugDraw* debugDrawer)
-{
-
-	for (int v=0;v<this->getNumWheels();v++)
-	{
-		btVector3 wheelColor(0,1,1);
-		if (getWheelInfo(v).m_raycastInfo.m_isInContact)
-		{
-			wheelColor.setValue(0,0,1);
-		} else
-		{
-			wheelColor.setValue(1,0,1);
-		}
-
-		btVector3 wheelPosWS = getWheelInfo(v).m_worldTransform.getOrigin();
-
-		btVector3 axle = btVector3(	
-			getWheelInfo(v).m_worldTransform.getBasis()[0][getRightAxis()],
-			getWheelInfo(v).m_worldTransform.getBasis()[1][getRightAxis()],
-			getWheelInfo(v).m_worldTransform.getBasis()[2][getRightAxis()]);
-
-		//debug wheels (cylinders)
-		debugDrawer->drawLine(wheelPosWS,wheelPosWS+axle,wheelColor);
-		debugDrawer->drawLine(wheelPosWS,getWheelInfo(v).m_raycastInfo.m_contactPointWS,wheelColor);
-
-	}
-}
-
-
-void* btDefaultVehicleRaycaster::castRay(const btVector3& from,const btVector3& to, btVehicleRaycasterResult& result)
-{
-//	RayResultCallback& resultCallback;
-
-	btCollisionWorld::ClosestRayResultCallback rayCallback(from,to);
-
-	m_dynamicsWorld->rayTest(from, to, rayCallback);
-
-	if (rayCallback.hasHit())
-	{
-		
-		btRigidBody* body = btRigidBody::upcast(rayCallback.m_collisionObject);
-        if (body && body->hasContactResponse())
-		{
-			result.m_hitPointInWorld = rayCallback.m_hitPointWorld;
-			result.m_hitNormalInWorld = rayCallback.m_hitNormalWorld;
-			result.m_hitNormalInWorld.normalize();
-			result.m_distFraction = rayCallback.m_closestHitFraction;
-			return body;
-		}
-	}
-	return 0;
-}
-
diff --git a/hkl3d/bullet/src/BulletDynamics/Vehicle/btRaycastVehicle.h b/hkl3d/bullet/src/BulletDynamics/Vehicle/btRaycastVehicle.h
deleted file mode 100644
index f59555f..0000000
--- a/hkl3d/bullet/src/BulletDynamics/Vehicle/btRaycastVehicle.h
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (c) 2005 Erwin Coumans http://continuousphysics.com/Bullet/
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies.
- * Erwin Coumans makes no representations about the suitability 
- * of this software for any purpose.  
- * It is provided "as is" without express or implied warranty.
-*/
-#ifndef BT_RAYCASTVEHICLE_H
-#define BT_RAYCASTVEHICLE_H
-
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-#include "BulletDynamics/ConstraintSolver/btTypedConstraint.h"
-#include "btVehicleRaycaster.h"
-class btDynamicsWorld;
-#include "LinearMath/btAlignedObjectArray.h"
-#include "btWheelInfo.h"
-#include "BulletDynamics/Dynamics/btActionInterface.h"
-
-class btVehicleTuning;
-
-///rayCast vehicle, very special constraint that turn a rigidbody into a vehicle.
-class btRaycastVehicle : public btActionInterface
-{
-
-		btAlignedObjectArray<btVector3>	m_forwardWS;
-		btAlignedObjectArray<btVector3>	m_axle;
-		btAlignedObjectArray<btScalar>	m_forwardImpulse;
-		btAlignedObjectArray<btScalar>	m_sideImpulse;
-	
-		///backwards compatibility
-		int	m_userConstraintType;
-		int	m_userConstraintId;
-
-public:
-	class btVehicleTuning
-		{
-			public:
-
-			btVehicleTuning()
-				:m_suspensionStiffness(btScalar(5.88)),
-				m_suspensionCompression(btScalar(0.83)),
-				m_suspensionDamping(btScalar(0.88)),
-				m_maxSuspensionTravelCm(btScalar(500.)),
-				m_frictionSlip(btScalar(10.5)),
-				m_maxSuspensionForce(btScalar(6000.))
-			{
-			}
-			btScalar	m_suspensionStiffness;
-			btScalar	m_suspensionCompression;
-			btScalar	m_suspensionDamping;
-			btScalar	m_maxSuspensionTravelCm;
-			btScalar	m_frictionSlip;
-			btScalar	m_maxSuspensionForce;
-
-		};
-private:
-
-	btScalar	m_tau;
-	btScalar	m_damping;
-	btVehicleRaycaster*	m_vehicleRaycaster;
-	btScalar		m_pitchControl;
-	btScalar	m_steeringValue; 
-	btScalar m_currentVehicleSpeedKmHour;
-
-	btRigidBody* m_chassisBody;
-
-	int m_indexRightAxis;
-	int m_indexUpAxis;
-	int	m_indexForwardAxis;
-
-	void defaultInit(const btVehicleTuning& tuning);
-
-public:
-
-	//constructor to create a car from an existing rigidbody
-	btRaycastVehicle(const btVehicleTuning& tuning,btRigidBody* chassis,	btVehicleRaycaster* raycaster );
-
-	virtual ~btRaycastVehicle() ;
-
-
-	///btActionInterface interface
-	virtual void updateAction( btCollisionWorld* collisionWorld, btScalar step)
-	{
-        (void) collisionWorld;
-		updateVehicle(step);
-	}
-	
-
-	///btActionInterface interface
-	void	debugDraw(btIDebugDraw* debugDrawer);
-			
-	const btTransform& getChassisWorldTransform() const;
-	
-	btScalar rayCast(btWheelInfo& wheel);
-
-	virtual void updateVehicle(btScalar step);
-	
-	
-	void resetSuspension();
-
-	btScalar	getSteeringValue(int wheel) const;
-
-	void	setSteeringValue(btScalar steering,int wheel);
-
-
-	void	applyEngineForce(btScalar force, int wheel);
-
-	const btTransform&	getWheelTransformWS( int wheelIndex ) const;
-
-	void	updateWheelTransform( int wheelIndex, bool interpolatedTransform = true );
-	
-//	void	setRaycastWheelInfo( int wheelIndex , bool isInContact, const btVector3& hitPoint, const btVector3& hitNormal,btScalar depth);
-
-	btWheelInfo&	addWheel( const btVector3& connectionPointCS0, const btVector3& wheelDirectionCS0,const btVector3& wheelAxleCS,btScalar suspensionRestLength,btScalar wheelRadius,const btVehicleTuning& tuning, bool isFrontWheel);
-
-	inline int		getNumWheels() const {
-		return int (m_wheelInfo.size());
-	}
-	
-	btAlignedObjectArray<btWheelInfo>	m_wheelInfo;
-
-
-	const btWheelInfo&	getWheelInfo(int index) const;
-
-	btWheelInfo&	getWheelInfo(int index);
-
-	void	updateWheelTransformsWS(btWheelInfo& wheel , bool interpolatedTransform = true);
-
-	
-	void setBrake(btScalar brake,int wheelIndex);
-
-	void	setPitchControl(btScalar pitch)
-	{
-		m_pitchControl = pitch;
-	}
-	
-	void	updateSuspension(btScalar deltaTime);
-
-	virtual void	updateFriction(btScalar	timeStep);
-
-
-
-	inline btRigidBody* getRigidBody()
-	{
-		return m_chassisBody;
-	}
-
-	const btRigidBody* getRigidBody() const
-	{
-		return m_chassisBody;
-	}
-
-	inline int	getRightAxis() const
-	{
-		return m_indexRightAxis;
-	}
-	inline int getUpAxis() const
-	{
-		return m_indexUpAxis;
-	}
-
-	inline int getForwardAxis() const
-	{
-		return m_indexForwardAxis;
-	}
-
-	
-	///Worldspace forward vector
-	btVector3 getForwardVector() const
-	{
-		const btTransform& chassisTrans = getChassisWorldTransform(); 
-
-		btVector3 forwardW ( 
-			  chassisTrans.getBasis()[0][m_indexForwardAxis], 
-			  chassisTrans.getBasis()[1][m_indexForwardAxis], 
-			  chassisTrans.getBasis()[2][m_indexForwardAxis]); 
-
-		return forwardW;
-	}
-
-	///Velocity of vehicle (positive if velocity vector has same direction as foward vector)
-	btScalar	getCurrentSpeedKmHour() const
-	{
-		return m_currentVehicleSpeedKmHour;
-	}
-
-	virtual void	setCoordinateSystem(int rightIndex,int upIndex,int forwardIndex)
-	{
-		m_indexRightAxis = rightIndex;
-		m_indexUpAxis = upIndex;
-		m_indexForwardAxis = forwardIndex;
-	}
-
-
-	///backwards compatibility
-	int getUserConstraintType() const
-	{
-		return m_userConstraintType ;
-	}
-
-	void	setUserConstraintType(int userConstraintType)
-	{
-		m_userConstraintType = userConstraintType;
-	};
-
-	void	setUserConstraintId(int uid)
-	{
-		m_userConstraintId = uid;
-	}
-
-	int getUserConstraintId() const
-	{
-		return m_userConstraintId;
-	}
-
-};
-
-class btDefaultVehicleRaycaster : public btVehicleRaycaster
-{
-	btDynamicsWorld*	m_dynamicsWorld;
-public:
-	btDefaultVehicleRaycaster(btDynamicsWorld* world)
-		:m_dynamicsWorld(world)
-	{
-	}
-
-	virtual void* castRay(const btVector3& from,const btVector3& to, btVehicleRaycasterResult& result);
-
-};
-
-
-#endif //BT_RAYCASTVEHICLE_H
-
diff --git a/hkl3d/bullet/src/BulletDynamics/Vehicle/btVehicleRaycaster.h b/hkl3d/bullet/src/BulletDynamics/Vehicle/btVehicleRaycaster.h
deleted file mode 100644
index 3cc909c..0000000
--- a/hkl3d/bullet/src/BulletDynamics/Vehicle/btVehicleRaycaster.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2005 Erwin Coumans http://bulletphysics.org
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies.
- * Erwin Coumans makes no representations about the suitability 
- * of this software for any purpose.  
- * It is provided "as is" without express or implied warranty.
-*/
-#ifndef BT_VEHICLE_RAYCASTER_H
-#define BT_VEHICLE_RAYCASTER_H
-
-#include "LinearMath/btVector3.h"
-
-/// btVehicleRaycaster is provides interface for between vehicle simulation and raycasting
-struct btVehicleRaycaster
-{
-virtual ~btVehicleRaycaster()
-{
-}
-	struct btVehicleRaycasterResult
-	{
-		btVehicleRaycasterResult() :m_distFraction(btScalar(-1.)){};
-		btVector3	m_hitPointInWorld;
-		btVector3	m_hitNormalInWorld;
-		btScalar	m_distFraction;
-	};
-
-	virtual void* castRay(const btVector3& from,const btVector3& to, btVehicleRaycasterResult& result) = 0;
-
-};
-
-#endif //BT_VEHICLE_RAYCASTER_H
-
diff --git a/hkl3d/bullet/src/BulletDynamics/Vehicle/btWheelInfo.cpp b/hkl3d/bullet/src/BulletDynamics/Vehicle/btWheelInfo.cpp
deleted file mode 100644
index ef93c16..0000000
--- a/hkl3d/bullet/src/BulletDynamics/Vehicle/btWheelInfo.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2005 Erwin Coumans http://continuousphysics.com/Bullet/
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies.
- * Erwin Coumans makes no representations about the suitability 
- * of this software for any purpose.  
- * It is provided "as is" without express or implied warranty.
-*/
-#include "btWheelInfo.h"
-#include "BulletDynamics/Dynamics/btRigidBody.h" // for pointvelocity
-
-
-btScalar btWheelInfo::getSuspensionRestLength() const
-{
-
-	return m_suspensionRestLength1;
-
-}
-
-void	btWheelInfo::updateWheel(const btRigidBody& chassis,RaycastInfo& raycastInfo)
-{
-	(void)raycastInfo;
-
-	
-	if (m_raycastInfo.m_isInContact)
-
-	{
-		btScalar	project= m_raycastInfo.m_contactNormalWS.dot( m_raycastInfo.m_wheelDirectionWS );
-		btVector3	 chassis_velocity_at_contactPoint;
-		btVector3 relpos = m_raycastInfo.m_contactPointWS - chassis.getCenterOfMassPosition();
-		chassis_velocity_at_contactPoint = chassis.getVelocityInLocalPoint( relpos );
-		btScalar projVel = m_raycastInfo.m_contactNormalWS.dot( chassis_velocity_at_contactPoint );
-		if ( project >= btScalar(-0.1))
-		{
-			m_suspensionRelativeVelocity = btScalar(0.0);
-			m_clippedInvContactDotSuspension = btScalar(1.0) / btScalar(0.1);
-		}
-		else
-		{
-			btScalar inv = btScalar(-1.) / project;
-			m_suspensionRelativeVelocity = projVel * inv;
-			m_clippedInvContactDotSuspension = inv;
-		}
-		
-	}
-
-	else	// Not in contact : position wheel in a nice (rest length) position
-	{
-		m_raycastInfo.m_suspensionLength = this->getSuspensionRestLength();
-		m_suspensionRelativeVelocity = btScalar(0.0);
-		m_raycastInfo.m_contactNormalWS = -m_raycastInfo.m_wheelDirectionWS;
-		m_clippedInvContactDotSuspension = btScalar(1.0);
-	}
-}
diff --git a/hkl3d/bullet/src/BulletDynamics/Vehicle/btWheelInfo.h b/hkl3d/bullet/src/BulletDynamics/Vehicle/btWheelInfo.h
deleted file mode 100644
index f916053..0000000
--- a/hkl3d/bullet/src/BulletDynamics/Vehicle/btWheelInfo.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 2005 Erwin Coumans http://continuousphysics.com/Bullet/
- *
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies.
- * Erwin Coumans makes no representations about the suitability 
- * of this software for any purpose.  
- * It is provided "as is" without express or implied warranty.
-*/
-#ifndef BT_WHEEL_INFO_H
-#define BT_WHEEL_INFO_H
-
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btTransform.h"
-
-class btRigidBody;
-
-struct btWheelInfoConstructionInfo
-{
-	btVector3	m_chassisConnectionCS;
-	btVector3	m_wheelDirectionCS;
-	btVector3	m_wheelAxleCS;
-	btScalar	m_suspensionRestLength;
-	btScalar	m_maxSuspensionTravelCm;
-	btScalar	m_wheelRadius;
-	
-	btScalar		m_suspensionStiffness;
-	btScalar		m_wheelsDampingCompression;
-	btScalar		m_wheelsDampingRelaxation;
-	btScalar		m_frictionSlip;
-	btScalar		m_maxSuspensionForce;
-	bool m_bIsFrontWheel;
-	
-};
-
-/// btWheelInfo contains information per wheel about friction and suspension.
-struct btWheelInfo
-{
-	struct RaycastInfo
-	{
-		//set by raycaster
-		btVector3	m_contactNormalWS;//contactnormal
-		btVector3	m_contactPointWS;//raycast hitpoint
-		btScalar	m_suspensionLength;
-		btVector3	m_hardPointWS;//raycast starting point
-		btVector3	m_wheelDirectionWS; //direction in worldspace
-		btVector3	m_wheelAxleWS; // axle in worldspace
-		bool		m_isInContact;
-		void*		m_groundObject; //could be general void* ptr
-	};
-
-	RaycastInfo	m_raycastInfo;
-
-	btTransform	m_worldTransform;
-	
-	btVector3	m_chassisConnectionPointCS; //const
-	btVector3	m_wheelDirectionCS;//const
-	btVector3	m_wheelAxleCS; // const or modified by steering
-	btScalar	m_suspensionRestLength1;//const
-	btScalar	m_maxSuspensionTravelCm;
-	btScalar getSuspensionRestLength() const;
-	btScalar	m_wheelsRadius;//const
-	btScalar	m_suspensionStiffness;//const
-	btScalar	m_wheelsDampingCompression;//const
-	btScalar	m_wheelsDampingRelaxation;//const
-	btScalar	m_frictionSlip;
-	btScalar	m_steering;
-	btScalar	m_rotation;
-	btScalar	m_deltaRotation;
-	btScalar	m_rollInfluence;
-	btScalar	m_maxSuspensionForce;
-
-	btScalar	m_engineForce;
-
-	btScalar	m_brake;
-	
-	bool m_bIsFrontWheel;
-	
-	void*		m_clientInfo;//can be used to store pointer to sync transforms...
-
-	btWheelInfo(btWheelInfoConstructionInfo& ci)
-
-	{
-
-		m_suspensionRestLength1 = ci.m_suspensionRestLength;
-		m_maxSuspensionTravelCm = ci.m_maxSuspensionTravelCm;
-
-		m_wheelsRadius = ci.m_wheelRadius;
-		m_suspensionStiffness = ci.m_suspensionStiffness;
-		m_wheelsDampingCompression = ci.m_wheelsDampingCompression;
-		m_wheelsDampingRelaxation = ci.m_wheelsDampingRelaxation;
-		m_chassisConnectionPointCS = ci.m_chassisConnectionCS;
-		m_wheelDirectionCS = ci.m_wheelDirectionCS;
-		m_wheelAxleCS = ci.m_wheelAxleCS;
-		m_frictionSlip = ci.m_frictionSlip;
-		m_steering = btScalar(0.);
-		m_engineForce = btScalar(0.);
-		m_rotation = btScalar(0.);
-		m_deltaRotation = btScalar(0.);
-		m_brake = btScalar(0.);
-		m_rollInfluence = btScalar(0.1);
-		m_bIsFrontWheel = ci.m_bIsFrontWheel;
-		m_maxSuspensionForce = ci.m_maxSuspensionForce;
-
-	}
-
-	void	updateWheel(const btRigidBody& chassis,RaycastInfo& raycastInfo);
-
-	btScalar	m_clippedInvContactDotSuspension;
-	btScalar	m_suspensionRelativeVelocity;
-	//calculated by suspension
-	btScalar	m_wheelsSuspensionForce;
-	btScalar	m_skidInfo;
-
-};
-
-#endif //BT_WHEEL_INFO_H
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolverData.h b/hkl3d/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolverData.h
deleted file mode 100644
index eb4e98b..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolverData.h
+++ /dev/null
@@ -1,744 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_SOFT_BODY_SOLVER_DATA_H
-#define BT_SOFT_BODY_SOLVER_DATA_H
-
-#include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h"
-#include "vectormath/vmInclude.h"
-
-
-class btSoftBodyLinkData
-{
-public:
-	/**
-	 * Class representing a link as a set of three indices into the vertex array.
-	 */
-	class LinkNodePair
-	{
-	public:
-		int vertex0;
-		int vertex1;
-
-		LinkNodePair()
-		{
-			vertex0 = 0;
-			vertex1 = 0;
-		}
-
-		LinkNodePair( int v0, int v1 )
-		{
-			vertex0 = v0;
-			vertex1 = v1;
-		}
-	};
-
-	/**
-	 * Class describing a link for input into the system.
-	 */
-	class LinkDescription
-	{
-	protected:
-		int m_vertex0;
-		int m_vertex1;
-		float m_linkLinearStiffness;
-		float m_linkStrength;
-
-	public:
-
-		LinkDescription()
-		{
-			m_vertex0 = 0;
-			m_vertex1 = 0;
-			m_linkLinearStiffness = 1.0;
-			m_linkStrength = 1.0;
-		}
-
-		LinkDescription( int newVertex0, int newVertex1, float linkLinearStiffness )
-		{
-			m_vertex0 = newVertex0;
-			m_vertex1 = newVertex1;
-			m_linkLinearStiffness = linkLinearStiffness;
-			m_linkStrength = 1.0;
-		}
-
-		LinkNodePair getVertexPair() const
-		{
-			LinkNodePair nodes;
-			nodes.vertex0 = m_vertex0;
-			nodes.vertex1 = m_vertex1;
-			return nodes;
-		}
-
-		void setVertex0( int vertex )
-		{
-			m_vertex0 = vertex;
-		}
-
-		void setVertex1( int vertex )
-		{
-			m_vertex1 = vertex;
-		}
-
-		void setLinkLinearStiffness( float linearStiffness )
-		{
-			m_linkLinearStiffness = linearStiffness;
-		}
-
-		void setLinkStrength( float strength )
-		{
-			m_linkStrength = strength;
-		}
-
-		int getVertex0() const
-		{
-			return m_vertex0;
-		}
-
-		int getVertex1() const
-		{
-			return m_vertex1;
-		}
-
-		float getLinkStrength() const
-		{
-			return m_linkStrength;
-		}
-
-		float getLinkLinearStiffness() const
-		{
-			return m_linkLinearStiffness;
-		}
-	};
-
-
-protected:
-	// NOTE:
-	// Vertex reference data is stored relative to global array, not relative to individual cloth.
-	// Values must be correct if being passed into single-cloth VBOs or when migrating from one solver
-	// to another.
-
-	btAlignedObjectArray< LinkNodePair > m_links; // Vertex pair for the link
-	btAlignedObjectArray< float >								m_linkStrength; // Strength of each link
-	// (inverseMassA + inverseMassB)/ linear stiffness coefficient
-	btAlignedObjectArray< float >								m_linksMassLSC; 
-	btAlignedObjectArray< float >								m_linksRestLengthSquared; 
-	// Current vector length of link
-	btAlignedObjectArray< Vectormath::Aos::Vector3 >			m_linksCLength;
-	// 1/(current length * current length * massLSC)
-	btAlignedObjectArray< float >								m_linksLengthRatio; 
-	btAlignedObjectArray< float >								m_linksRestLength;
-	btAlignedObjectArray< float >								m_linksMaterialLinearStiffnessCoefficient;
-
-public:
-	btSoftBodyLinkData()
-	{
-	}
-
-	virtual ~btSoftBodyLinkData()
-	{
-	}
-
-	virtual void clear()
-	{
-		m_links.resize(0);
-		m_linkStrength.resize(0);
-		m_linksMassLSC.resize(0);
-		m_linksRestLengthSquared.resize(0);
-		m_linksLengthRatio.resize(0);
-		m_linksRestLength.resize(0);
-		m_linksMaterialLinearStiffnessCoefficient.resize(0);
-	}
-
-	int getNumLinks()
-	{
-		return m_links.size();
-	}
-
-	/** Allocate enough space in all link-related arrays to fit numLinks links */
-	virtual void createLinks( int numLinks )
-	{
-		int previousSize = m_links.size();
-		int newSize = previousSize + numLinks;
-
-		// Resize all the arrays that store link data
-		m_links.resize( newSize );
-		m_linkStrength.resize( newSize );
-		m_linksMassLSC.resize( newSize );
-		m_linksRestLengthSquared.resize( newSize );
-		m_linksCLength.resize( newSize );
-		m_linksLengthRatio.resize( newSize );
-		m_linksRestLength.resize( newSize );
-		m_linksMaterialLinearStiffnessCoefficient.resize( newSize );
-	}
-	
-	/** Insert the link described into the correct data structures assuming space has already been allocated by a call to createLinks */
-	virtual void setLinkAt( const LinkDescription &link, int linkIndex )
-	{
-		m_links[linkIndex] = link.getVertexPair();
-		m_linkStrength[linkIndex] = link.getLinkStrength();
-		m_linksMassLSC[linkIndex] = 0.f;
-		m_linksRestLengthSquared[linkIndex] = 0.f;
-		m_linksCLength[linkIndex] = Vectormath::Aos::Vector3(0.f, 0.f, 0.f);
-		m_linksLengthRatio[linkIndex] = 0.f;
-		m_linksRestLength[linkIndex] = 0.f;
-		m_linksMaterialLinearStiffnessCoefficient[linkIndex] = link.getLinkLinearStiffness();
-	}
-
-
-	/**
-	 * Return true if data is on the accelerator.
-	 * The CPU version of this class will return true here because
-	 * the CPU is the same as the accelerator.
-	 */
-	virtual bool onAccelerator()
-	{
-		return true;
-	}
-	
-	/**
-	 * Move data from host memory to the accelerator.
-	 * The CPU version will always return that it has moved it.
-	 */
-	virtual bool moveToAccelerator()
-	{
-		return true;
-	}
-
-	/**
-	 * Move data from host memory from the accelerator.
-	 * The CPU version will always return that it has moved it.
-	 */
-	virtual bool moveFromAccelerator()
-	{
-		return true;
-	}
-
-
-
-	/**
-	 * Return reference to the vertex index pair for link linkIndex as stored on the host.
-	 */
-	LinkNodePair &getVertexPair( int linkIndex )
-	{
-		return m_links[linkIndex];
-	}
-
-	/** 
-	 * Return reference to strength of link linkIndex as stored on the host.
-	 */
-	float &getStrength( int linkIndex )
-	{
-		return m_linkStrength[linkIndex];
-	}
-
-	/**
-	 * Return a reference to the strength of the link corrected for link sorting.
-	 * This is important if we are using data on an accelerator which has the data sorted in some fashion.
-	 */
-	virtual float &getStrengthCorrected( int linkIndex )
-	{
-		return getStrength( linkIndex );
-	}
-
-	/**
-	 * Return reference to the rest length of link linkIndex as stored on the host.
-	 */
-	float &getRestLength( int linkIndex )
-	{
-		return m_linksRestLength[linkIndex];
-	}
-
-	/**
-	 * Return reference to linear stiffness coefficient for link linkIndex as stored on the host.
-	 */
-	float &getLinearStiffnessCoefficient( int linkIndex )
-	{
-		return m_linksMaterialLinearStiffnessCoefficient[linkIndex];
-	}
-
-	/**
-	 * Return reference to the MassLSC value for link linkIndex as stored on the host.
-	 */
-	float &getMassLSC( int linkIndex )
-	{
-		return m_linksMassLSC[linkIndex];
-	}
-
-	/**
-	 * Return reference to rest length squared for link linkIndex as stored on the host.
-	 */
-	float &getRestLengthSquared( int linkIndex )
-	{
-		return m_linksRestLengthSquared[linkIndex];
-	}
-
-	/**
-	 * Return reference to current length of link linkIndex as stored on the host.
-	 */
-	Vectormath::Aos::Vector3 &getCurrentLength( int linkIndex )
-	{
-		return m_linksCLength[linkIndex];
-	}
-
-	 /**
-	  * Return the link length ratio from for link linkIndex as stored on the host.
-	  */
-	 float &getLinkLengthRatio( int linkIndex )
-	 {
-		 return m_linksLengthRatio[linkIndex];
-	 }
-};
-
-
-
-/**
- * Wrapper for vertex data information.
- * By wrapping it like this we stand a good chance of being able to optimise for storage format easily.
- * It should also help us make sure all the data structures remain consistent.
- */
-class btSoftBodyVertexData
-{
-public:
-	/**
-	 * Class describing a vertex for input into the system.
-	 */
-	class VertexDescription
-	{
-	private:
-		Vectormath::Aos::Point3 m_position;
-		/** Inverse mass. If this is 0f then the mass was 0 because that simplifies calculations. */
-		float m_inverseMass;
-
-	public:
-		VertexDescription()
-		{	
-			m_position = Vectormath::Aos::Point3( 0.f, 0.f, 0.f );
-			m_inverseMass = 0.f;
-		}
-
-		VertexDescription( const Vectormath::Aos::Point3 &position, float mass )
-		{
-			m_position = position;
-			if( mass > 0.f )
-				m_inverseMass = 1.0f/mass;
-			else
-				m_inverseMass = 0.f;
-		}
-
-		void setPosition( const Vectormath::Aos::Point3 &position )
-		{
-			m_position = position;
-		}
-
-		void setInverseMass( float inverseMass )
-		{
-			m_inverseMass = inverseMass;
-		}
-
-		void setMass( float mass )
-		{
-			if( mass > 0.f )
-				m_inverseMass = 1.0f/mass;
-			else
-				m_inverseMass = 0.f;
-		}
-
-		Vectormath::Aos::Point3 getPosition() const
-		{
-			return m_position;
-		}
-
-		float getInverseMass() const
-		{
-			return m_inverseMass;
-		}
-
-		float getMass() const
-		{
-			if( m_inverseMass == 0.f )
-				return 0.f;
-			else
-				return 1.0f/m_inverseMass;
-		}
-	};
-protected:
-
-	// identifier for the individual cloth
-	// For the CPU we don't really need this as we can grab the cloths and iterate over only their vertices
-	// For a parallel accelerator knowing on a per-vertex basis which cloth we're part of will help for obtaining
-	// per-cloth data
-	// For sorting etc it might also be helpful to be able to use in-array data such as this.
-	btAlignedObjectArray< int >							m_clothIdentifier;
-	btAlignedObjectArray< Vectormath::Aos::Point3 >		m_vertexPosition;			// vertex positions
-	btAlignedObjectArray< Vectormath::Aos::Point3 >		m_vertexPreviousPosition;	// vertex positions
-	btAlignedObjectArray< Vectormath::Aos::Vector3 >	m_vertexVelocity;			// Velocity
-	btAlignedObjectArray< Vectormath::Aos::Vector3 >	m_vertexForceAccumulator;	// Force accumulator
-	btAlignedObjectArray< Vectormath::Aos::Vector3 >	m_vertexNormal;				// Normals
-	btAlignedObjectArray< float >						m_vertexInverseMass;		// Inverse mass
-	btAlignedObjectArray< float >						m_vertexArea;				// Area controlled by the vertex
-	btAlignedObjectArray< int >							m_vertexTriangleCount;		// Number of triangles touching this vertex
-
-public:
-	btSoftBodyVertexData()
-	{
-	}
-
-	virtual ~btSoftBodyVertexData()
-	{
-	}
-
-	virtual void clear()
-	{
-		m_clothIdentifier.resize(0);
-		m_vertexPosition.resize(0);
-		m_vertexPreviousPosition.resize(0);
-		m_vertexVelocity.resize(0);
-		m_vertexForceAccumulator.resize(0);
-		m_vertexNormal.resize(0);
-		m_vertexInverseMass.resize(0);
-		m_vertexArea.resize(0);
-		m_vertexTriangleCount.resize(0);
-	}
-
-	int getNumVertices()
-	{
-		return m_vertexPosition.size();
-	}
-
-	int getClothIdentifier( int vertexIndex )
-	{
-		return m_clothIdentifier[vertexIndex];
-	}
-
-	void setVertexAt( const VertexDescription &vertex, int vertexIndex )
-	{
-		m_vertexPosition[vertexIndex] = vertex.getPosition();
-		m_vertexPreviousPosition[vertexIndex] = vertex.getPosition();
-		m_vertexVelocity[vertexIndex] = Vectormath::Aos::Vector3(0.f, 0.f, 0.f);
-		m_vertexForceAccumulator[vertexIndex] = Vectormath::Aos::Vector3(0.f, 0.f, 0.f);
-		m_vertexNormal[vertexIndex] = Vectormath::Aos::Vector3(0.f, 0.f, 0.f);
-		m_vertexInverseMass[vertexIndex] = vertex.getInverseMass();
-		m_vertexArea[vertexIndex] = 0.f;
-		m_vertexTriangleCount[vertexIndex] = 0;
-	}
-
-	/** 
-	 * Create numVertices new vertices for cloth clothIdentifier 
-	 * maxVertices allows a buffer zone of extra vertices for alignment or tearing reasons.
-	 */
-	void createVertices( int numVertices, int clothIdentifier, int maxVertices = 0 )
-	{
-		int previousSize = m_vertexPosition.size();
-		if( maxVertices == 0 )
-			maxVertices = numVertices;
-		int newSize = previousSize + maxVertices;
-
-		// Resize all the arrays that store vertex data
-		m_clothIdentifier.resize( newSize );
-		m_vertexPosition.resize( newSize );
-		m_vertexPreviousPosition.resize( newSize );
-		m_vertexVelocity.resize( newSize );
-		m_vertexForceAccumulator.resize( newSize );
-		m_vertexNormal.resize( newSize );
-		m_vertexInverseMass.resize( newSize );
-		m_vertexArea.resize( newSize );
-		m_vertexTriangleCount.resize( newSize );
-
-		for( int vertexIndex = previousSize; vertexIndex < newSize; ++vertexIndex )
-			m_clothIdentifier[vertexIndex] = clothIdentifier;
-		for( int vertexIndex = (previousSize + numVertices); vertexIndex < newSize; ++vertexIndex )
-			m_clothIdentifier[vertexIndex] = -1;
-	}
-
-	// Get and set methods in header so they can be inlined
-
-	/**
-	 * Return a reference to the position of vertex vertexIndex as stored on the host.
-	 */
-	Vectormath::Aos::Point3 &getPosition( int vertexIndex )
-	{
-		return m_vertexPosition[vertexIndex];
-	}
-
-	Vectormath::Aos::Point3 getPosition( int vertexIndex ) const
-	{
-		return m_vertexPosition[vertexIndex];
-	}
-
-	/**
-	 * Return a reference to the previous position of vertex vertexIndex as stored on the host.
-	 */
-	Vectormath::Aos::Point3 &getPreviousPosition( int vertexIndex )
-	{
-		return m_vertexPreviousPosition[vertexIndex];
-	}
-
-	/**
-	 * Return a reference to the velocity of vertex vertexIndex as stored on the host.
-	 */
-	Vectormath::Aos::Vector3 &getVelocity( int vertexIndex )
-	{
-		return m_vertexVelocity[vertexIndex];
-	}
-
-	/**
-	 * Return a reference to the force accumulator of vertex vertexIndex as stored on the host.
-	 */
-	Vectormath::Aos::Vector3 &getForceAccumulator( int vertexIndex )
-	{
-		return m_vertexForceAccumulator[vertexIndex];
-	}
-
-	/**
-	 * Return a reference to the normal of vertex vertexIndex as stored on the host.
-	 */
-	Vectormath::Aos::Vector3 &getNormal( int vertexIndex )
-	{
-		return m_vertexNormal[vertexIndex];
-	}
-
-	Vectormath::Aos::Vector3 getNormal( int vertexIndex ) const
-	{
-		return m_vertexNormal[vertexIndex];
-	}
-
-	/**
-	 * Return a reference to the inverse mass of vertex vertexIndex as stored on the host.
-	 */
-	float &getInverseMass( int vertexIndex )
-	{
-		return m_vertexInverseMass[vertexIndex];
-	}
-
-	/**
-	 * Get access to the area controlled by this vertex.
-	 */
-	float &getArea( int vertexIndex )
-	{
-		return m_vertexArea[vertexIndex];
-	}
-
-	/**
-	 * Get access to the array of how many triangles touch each vertex.
-	 */
-	int &getTriangleCount( int vertexIndex )
-	{
-		return m_vertexTriangleCount[vertexIndex];
-	}
-
-
-
-	/**
-	 * Return true if data is on the accelerator.
-	 * The CPU version of this class will return true here because
-	 * the CPU is the same as the accelerator.
-	 */
-	virtual bool onAccelerator()
-	{
-		return true;
-	}
-	
-	/**
-	 * Move data from host memory to the accelerator.
-	 * The CPU version will always return that it has moved it.
-	 */
-	virtual bool moveToAccelerator()
-	{
-		return true;
-	}
-
-	/**
-	 * Move data from host memory from the accelerator.
-	 * The CPU version will always return that it has moved it.
-	 */
-	virtual bool moveFromAccelerator()
-	{
-		return true;
-	}
-
-	btAlignedObjectArray< Vectormath::Aos::Point3 >	&getVertexPositions()
-	{
-		return m_vertexPosition;
-	}
-};
-
-
-class btSoftBodyTriangleData
-{
-public:
-	/**
-	 * Class representing a triangle as a set of three indices into the
-	 * vertex array.
-	 */
-	class TriangleNodeSet
-	{
-	public:
-		int vertex0;
-		int vertex1;
-		int vertex2;
-		int _padding;
-
-		TriangleNodeSet( )
-		{
-			vertex0 = 0;
-			vertex1 = 0;
-			vertex2 = 0;
-			_padding = -1;
-		}
-
-		TriangleNodeSet( int newVertex0, int newVertex1, int newVertex2 )
-		{
-			vertex0 = newVertex0;
-			vertex1 = newVertex1;
-			vertex2 = newVertex2;
-		}
-	};
-
-	class TriangleDescription
-	{
-	protected:
-		int m_vertex0;
-		int m_vertex1;
-		int m_vertex2;
-
-	public:
-		TriangleDescription()
-		{
-			m_vertex0 = 0;
-			m_vertex1 = 0;
-			m_vertex2 = 0;
-		}
-
-		TriangleDescription( int newVertex0, int newVertex1, int newVertex2 )
-		{
-			m_vertex0 = newVertex0;
-			m_vertex1 = newVertex1;
-			m_vertex2 = newVertex2;
-		}
-
-		TriangleNodeSet getVertexSet() const
-		{
-			btSoftBodyTriangleData::TriangleNodeSet nodes;
-			nodes.vertex0 = m_vertex0;
-			nodes.vertex1 = m_vertex1;
-			nodes.vertex2 = m_vertex2;
-			return nodes;
-		}
-	};
-
-protected:
-	// NOTE:
-	// Vertex reference data is stored relative to global array, not relative to individual cloth.
-	// Values must be correct if being passed into single-cloth VBOs or when migrating from one solver
-	// to another.
-	btAlignedObjectArray< TriangleNodeSet > m_vertexIndices;
-	btAlignedObjectArray< float > m_area;
-	btAlignedObjectArray< Vectormath::Aos::Vector3 > m_normal;
-
-public:
-	btSoftBodyTriangleData()
-	{
-	}
-
-	virtual ~btSoftBodyTriangleData()
-	{
-
-	}
-
-	virtual void clear()
-	{
-		m_vertexIndices.resize(0);
-		m_area.resize(0);
-		m_normal.resize(0);
-	}
-
-	int getNumTriangles()
-	{
-		return m_vertexIndices.size();
-	}
-
-	virtual void setTriangleAt( const TriangleDescription &triangle, int triangleIndex )
-	{
-		m_vertexIndices[triangleIndex] = triangle.getVertexSet();
-	}
-
-	virtual void createTriangles( int numTriangles )		
-	{
-		int previousSize = m_vertexIndices.size();
-		int newSize = previousSize + numTriangles;
-
-		// Resize all the arrays that store triangle data
-		m_vertexIndices.resize( newSize );
-		m_area.resize( newSize );
-		m_normal.resize( newSize );
-	}
-
-	/**
-	 * Return the vertex index set for triangle triangleIndex as stored on the host.
-	 */
-	const TriangleNodeSet &getVertexSet( int triangleIndex )
-	{
-		return m_vertexIndices[triangleIndex];
-	}
-
-	/**
-	 * Get access to the triangle area.
-	 */
-	float &getTriangleArea( int triangleIndex )
-	{
-		return m_area[triangleIndex];
-	}
-
-	/**
-	 * Get access to the normal vector for this triangle.
-	 */
-	Vectormath::Aos::Vector3 &getNormal( int triangleIndex )
-	{
-		return m_normal[triangleIndex];
-	}
-
-	/**
-	 * Return true if data is on the accelerator.
-	 * The CPU version of this class will return true here because
-	 * the CPU is the same as the accelerator.
-	 */
-	virtual bool onAccelerator()
-	{
-		return true;
-	}
-	
-	/**
-	 * Move data from host memory to the accelerator.
-	 * The CPU version will always return that it has moved it.
-	 */
-	virtual bool moveToAccelerator()
-	{
-		return true;
-	}
-
-	/**
-	 * Move data from host memory from the accelerator.
-	 * The CPU version will always return that it has moved it.
-	 */
-	virtual bool moveFromAccelerator()
-	{
-		return true;
-	}
-};
-
-
-#endif // #ifndef BT_SOFT_BODY_SOLVER_DATA_H
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp b/hkl3d/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp
deleted file mode 100644
index 51a24ba..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp
+++ /dev/null
@@ -1,979 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-#include "BulletCollision/CollisionShapes/btCollisionShape.h"
-#include "vectormath/vmInclude.h"
-
-#include "BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h"
-#include "BulletSoftBody/btSoftBody.h"
-#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
-
-
-btCPUSoftBodySolver::btCPUSoftBodySolver()
-{
-	// Initial we will clearly need to update solver constants
-	// For now this is global for the cloths linked with this solver - we should probably make this body specific 
-	// for performance in future once we understand more clearly when constants need to be updated
-	m_updateSolverConstants = true;
-}
-
-btCPUSoftBodySolver::~btCPUSoftBodySolver()
-{
-}
-
-
-
-
-btSoftBodyLinkData &btCPUSoftBodySolver::getLinkData()
-{
-	return m_linkData;
-}
-
-btSoftBodyVertexData &btCPUSoftBodySolver::getVertexData()
-{
-	return m_vertexData;
-}
-
-btSoftBodyTriangleData &btCPUSoftBodySolver::getTriangleData()
-{
-	return m_triangleData;
-}
-
-
-
-
-
-
-static Vectormath::Aos::Vector3 toVector3( const btVector3 &vec )
-{
-	Vectormath::Aos::Vector3 outVec( vec.getX(), vec.getY(), vec.getZ() );
-	return outVec;
-}
-
-static Vectormath::Aos::Transform3 toTransform3( const btTransform &transform )
-{
-	Vectormath::Aos::Transform3 outTransform;
-	outTransform.setCol(0, toVector3(transform.getBasis().getColumn(0)));
-	outTransform.setCol(1, toVector3(transform.getBasis().getColumn(1)));
-	outTransform.setCol(2, toVector3(transform.getBasis().getColumn(2)));
-	outTransform.setCol(3, toVector3(transform.getOrigin()));
-	return outTransform;	
-}
-
-void btCPUSoftBodySolver::btAcceleratedSoftBodyInterface::updateBounds( const btVector3 &lowerBound, const btVector3 &upperBound )
-{
-	float scalarMargin = this->getSoftBody()->getCollisionShape()->getMargin();
-	btVector3 vectorMargin( scalarMargin, scalarMargin, scalarMargin );
-	m_softBody->m_bounds[0] = lowerBound - vectorMargin;
-	m_softBody->m_bounds[1] = upperBound + vectorMargin;
-}
-
-
-void btCPUSoftBodySolver::copyBackToSoftBodies()
-{
-	// Loop over soft bodies, copying all the vertex positions back for each body in turn
-	for( int softBodyIndex = 0; softBodyIndex < m_softBodySet.size(); ++softBodyIndex )
-	{
-		btAcceleratedSoftBodyInterface *softBodyInterface = m_softBodySet[ softBodyIndex ];
-		btSoftBody *softBody = softBodyInterface->getSoftBody();
-
-		int firstVertex = softBodyInterface->getFirstVertex();
-		int numVertices = softBodyInterface->getNumVertices();
-
-		// Copy vertices from solver back into the softbody
-		for( int vertex = 0; vertex < numVertices; ++vertex )
-		{
-			using Vectormath::Aos::Point3;
-			Point3 vertexPosition( getVertexData().getVertexPositions()[firstVertex + vertex] );
-
-			softBody->m_nodes[vertex].m_x.setX( vertexPosition.getX() );
-			softBody->m_nodes[vertex].m_x.setY( vertexPosition.getY() );
-			softBody->m_nodes[vertex].m_x.setZ( vertexPosition.getZ() );
-			
-			softBody->m_nodes[vertex].m_n.setX( vertexPosition.getX() );
-			softBody->m_nodes[vertex].m_n.setY( vertexPosition.getY() );
-			softBody->m_nodes[vertex].m_n.setZ( vertexPosition.getZ() );
-		}
-	}
-} // btCPUSoftBodySolver::copyBackToSoftBodies
-
-void btCPUSoftBodySolver::optimize( btAlignedObjectArray< btSoftBody * > &softBodies , bool forceUpdate )
-{
-	if( forceUpdate || m_softBodySet.size() != softBodies.size() )
-	{
-		// Have a change in the soft body set so update, reloading all the data
-		getVertexData().clear();
-		getTriangleData().clear();
-		getLinkData().clear();
-		m_softBodySet.resize(0);
-
-
-		for( int softBodyIndex = 0; softBodyIndex < softBodies.size(); ++softBodyIndex )
-		{
-			btSoftBody *softBody = softBodies[ softBodyIndex ];
-			using Vectormath::Aos::Matrix3;
-			using Vectormath::Aos::Point3;
-
-			// Create SoftBody that will store the information within the solver
-			btAcceleratedSoftBodyInterface *newSoftBody = new btAcceleratedSoftBodyInterface( softBody );
-			m_softBodySet.push_back( newSoftBody );
-
-			m_perClothAcceleration.push_back( toVector3(softBody->getWorldInfo()->m_gravity) );
-			m_perClothDampingFactor.push_back(softBody->m_cfg.kDP);
-			m_perClothVelocityCorrectionCoefficient.push_back( softBody->m_cfg.kVCF );
-			m_perClothLiftFactor.push_back( softBody->m_cfg.kLF );
-			m_perClothDragFactor.push_back( softBody->m_cfg.kDG );
-			m_perClothMediumDensity.push_back(softBody->getWorldInfo()->air_density);
-			m_perClothCollisionObjects.push_back( CollisionObjectIndices(-1, -1) );
-
-			// Add space for new vertices and triangles in the default solver for now
-			// TODO: Include space here for tearing too later
-			int firstVertex = getVertexData().getNumVertices();
-			int numVertices = softBody->m_nodes.size();
-			int maxVertices = numVertices;
-			// Allocate space for new vertices in all the vertex arrays
-			getVertexData().createVertices( maxVertices, softBodyIndex );
-
-			int firstTriangle = getTriangleData().getNumTriangles();
-			int numTriangles = softBody->m_faces.size();
-			int maxTriangles = numTriangles;
-			getTriangleData().createTriangles( maxTriangles );
-
-			// Copy vertices from softbody into the solver
-			for( int vertex = 0; vertex < numVertices; ++vertex )
-			{
-				Point3 multPoint(softBody->m_nodes[vertex].m_x.getX(), softBody->m_nodes[vertex].m_x.getY(), softBody->m_nodes[vertex].m_x.getZ());
-				btSoftBodyVertexData::VertexDescription desc;
-
-				// TODO: Position in the softbody might be pre-transformed
-				// or we may need to adapt for the pose.
-				//desc.setPosition( cloth.getMeshTransform()*multPoint );
-				desc.setPosition( multPoint );
-
-				float vertexInverseMass = softBody->m_nodes[vertex].m_im;
-				desc.setInverseMass(vertexInverseMass);
-				getVertexData().setVertexAt( desc, firstVertex + vertex );
-			}
-
-			// Copy triangles similarly
-			// We're assuming here that vertex indices are based on the firstVertex rather than the entire scene
-			for( int triangle = 0; triangle < numTriangles; ++triangle )
-			{
-				// Note that large array storage is relative to the array not to the cloth
-				// So we need to add firstVertex to each value
-				int vertexIndex0 = (softBody->m_faces[triangle].m_n[0] - &(softBody->m_nodes[0]));
-				int vertexIndex1 = (softBody->m_faces[triangle].m_n[1] - &(softBody->m_nodes[0]));
-				int vertexIndex2 = (softBody->m_faces[triangle].m_n[2] - &(softBody->m_nodes[0]));
-				btSoftBodyTriangleData::TriangleDescription newTriangle(vertexIndex0 + firstVertex, vertexIndex1 + firstVertex, vertexIndex2 + firstVertex);
-				getTriangleData().setTriangleAt( newTriangle, firstTriangle + triangle );
-				
-				// Increase vertex triangle counts for this triangle		
-				getVertexData().getTriangleCount(newTriangle.getVertexSet().vertex0)++;
-				getVertexData().getTriangleCount(newTriangle.getVertexSet().vertex1)++;
-				getVertexData().getTriangleCount(newTriangle.getVertexSet().vertex2)++;
-			}
-
-			int firstLink = getLinkData().getNumLinks();
-			int numLinks = softBody->m_links.size();
-			int maxLinks = numLinks;
-			
-			// Allocate space for the links
-			getLinkData().createLinks( numLinks );
-
-			// Add the links
-			for( int link = 0; link < numLinks; ++link )
-			{
-				int vertexIndex0 = softBody->m_links[link].m_n[0] - &(softBody->m_nodes[0]);
-				int vertexIndex1 = softBody->m_links[link].m_n[1] - &(softBody->m_nodes[0]);
-
-				btSoftBodyLinkData::LinkDescription newLink(vertexIndex0 + firstVertex, vertexIndex1 + firstVertex, softBody->m_links[link].m_material->m_kLST);
-				newLink.setLinkStrength(1.f);
-				getLinkData().setLinkAt(newLink, firstLink + link);
-			}
-			
-			newSoftBody->setFirstVertex( firstVertex );
-			newSoftBody->setFirstTriangle( firstTriangle );
-			newSoftBody->setNumVertices( numVertices );
-			newSoftBody->setMaxVertices( maxVertices );
-			newSoftBody->setNumTriangles( numTriangles );
-			newSoftBody->setMaxTriangles( maxTriangles );
-			newSoftBody->setFirstLink( firstLink );
-			newSoftBody->setNumLinks( numLinks );
-		}
-
-
-
-		updateConstants(0.f);
-	}
-}
-
-
-
-
-void btCPUSoftBodySolver::updateSoftBodies()
-{
-	using namespace Vectormath::Aos;
-
-	int numVertices = m_vertexData.getNumVertices();
-	int numTriangles = m_triangleData.getNumTriangles();
-
-	// Initialise normal and vertex counts
-	for( int vertexIndex = 0; vertexIndex < numVertices; ++vertexIndex )
-	{
-		m_vertexData.getArea(vertexIndex) = 0.f;
-		m_vertexData.getNormal(vertexIndex) = Vector3(0.f, 0.f, 0.f);
-	}
-
-	// Update the areas for the triangles and vertices.
-	for( int triangleIndex = 0; triangleIndex < numTriangles; ++triangleIndex )
-	{
-		float &triangleArea( m_triangleData.getTriangleArea( triangleIndex ) );
-		const btSoftBodyTriangleData::TriangleNodeSet &vertices( m_triangleData.getVertexSet(triangleIndex) );
-
-		Point3 &vertexPosition0( m_vertexData.getPosition( vertices.vertex0 ) );
-		Point3 &vertexPosition1( m_vertexData.getPosition( vertices.vertex1 ) );
-		Point3 &vertexPosition2( m_vertexData.getPosition( vertices.vertex2 ) );
-
-		triangleArea = computeTriangleArea( vertexPosition0, vertexPosition1, vertexPosition2 );
-
-		// Add to areas for vertices and increase the count of the number of triangles affecting the vertex
-		m_vertexData.getArea(vertices.vertex0) += triangleArea;
-		m_vertexData.getArea(vertices.vertex1) += triangleArea;
-		m_vertexData.getArea(vertices.vertex2) += triangleArea;
-
-		Point3 &vertex0( m_vertexData.getPosition(vertices.vertex0) );
-		Point3 &vertex1( m_vertexData.getPosition(vertices.vertex1) );
-		Point3 &vertex2( m_vertexData.getPosition(vertices.vertex2) );
-		
-		Vector3 triangleNormal = cross( vertex1-vertex0, vertex2 - vertex0 );
-
-		m_triangleData.getNormal(triangleIndex) = normalize(triangleNormal);
-
-		m_vertexData.getNormal(vertices.vertex0) += triangleNormal;
-		m_vertexData.getNormal(vertices.vertex1) += triangleNormal;
-		m_vertexData.getNormal(vertices.vertex2) += triangleNormal;
-
-	}
-
-	// Normalise the area and normals
-	for( int vertexIndex = 0; vertexIndex < numVertices; ++vertexIndex )
-	{
-		m_vertexData.getArea(vertexIndex) /= m_vertexData.getTriangleCount(vertexIndex);
-		m_vertexData.getNormal(vertexIndex) = normalize( m_vertexData.getNormal(vertexIndex) );
-	}
-
-
-	// Clear the collision shape array for the next frame
-	m_collisionObjectDetails.clear();
-
-} // updateSoftBodies
-
-
-Vectormath::Aos::Vector3 btCPUSoftBodySolver::ProjectOnAxis( const Vectormath::Aos::Vector3 &v, const Vectormath::Aos::Vector3 &a )
-{
-	return a*Vectormath::Aos::dot(v, a);
-}
-
-void btCPUSoftBodySolver::ApplyClampedForce( float solverdt, const Vectormath::Aos::Vector3 &force, const Vectormath::Aos::Vector3 &vertexVelocity, float inverseMass, Vectormath::Aos::Vector3 &vertexForce )
-{
-	float dtInverseMass = solverdt*inverseMass;
-	if( Vectormath::Aos::lengthSqr(force * dtInverseMass) > Vectormath::Aos::lengthSqr(vertexVelocity) )
-	{
-		vertexForce -= ProjectOnAxis( vertexVelocity, normalize( force ) )/dtInverseMass;
-	} else {
-		vertexForce += force;
-	}
-}
-
-bool btCPUSoftBodySolver::checkInitialized()
-{
-	return true;
-}
-
-void btCPUSoftBodySolver::applyForces( float solverdt )
-{		
-	using namespace Vectormath::Aos;
-
-	int numVertices = m_vertexData.getNumVertices();			
-	for( int clothIndex = 0; clothIndex < m_softBodySet.size(); ++clothIndex )
-	{
-		btAcceleratedSoftBodyInterface *currentCloth = m_softBodySet[clothIndex];
-		const int startVertex = currentCloth->getFirstVertex();
-		const int numVertices = currentCloth->getNumVertices();
-
-		Vector3 velocityChange = m_perClothAcceleration[clothIndex]*solverdt;
-		for( int vertexIndex = startVertex; vertexIndex < (startVertex + numVertices); ++vertexIndex )
-		{
-			float inverseMass = m_vertexData.getInverseMass( vertexIndex );
-			Vector3 &vertexVelocity( m_vertexData.getVelocity( vertexIndex ) );
-
-			// First apply the global acceleration to all vertices
-			if( inverseMass > 0 )
-				vertexVelocity += velocityChange;
-
-			// If it's a non-static vertex
-			if( m_vertexData.getInverseMass(vertexIndex) > 0 )
-			{
-				// Wind effects on a wind-per-cloth basis
-				float liftFactor = m_perClothLiftFactor[clothIndex];
-				float dragFactor = m_perClothDragFactor[clothIndex];
-				if( (liftFactor > 0.f) || (dragFactor > 0.f) )
-				{
-					Vector3 normal = m_vertexData.getNormal(vertexIndex);
-					Vector3 relativeWindVelocity = m_vertexData.getVelocity(vertexIndex) - m_perClothWindVelocity[clothIndex];
-					float relativeSpeedSquared = lengthSqr(relativeWindVelocity);
-					if( relativeSpeedSquared > FLT_EPSILON )
-					{
-						normal = normal * (dot(normal, relativeWindVelocity) < 0 ? -1.f : +1.f);
-						float dvNormal = dot(normal, relativeWindVelocity);
-						if( dvNormal > 0 )
-						{
-							Vector3 force( 0.f, 0.f, 0.f );
-							float c0 = m_vertexData.getArea(vertexIndex) * dvNormal * relativeSpeedSquared / 2;
-							float c1 = c0 * m_perClothMediumDensity[clothIndex];
-							force += normal * (-c1 * liftFactor);
-							force += normalize(relativeWindVelocity)*(-c1 * dragFactor);
-
-							Vectormath::Aos::Vector3 &vertexForce( m_vertexData.getForceAccumulator(vertexIndex) );
-							ApplyClampedForce( solverdt, force, vertexVelocity, inverseMass, vertexForce );
-						}
-					}
-				}
-			}
-		}
-	}
-} // btCPUSoftBodySolver::applyForces
-
-/**
- * Integrate motion on the solver.
- */
-void btCPUSoftBodySolver::integrate( float solverdt )
-{
-	using namespace Vectormath::Aos;
-	int numVertices = m_vertexData.getNumVertices();
-	for( int vertexIndex = 0; vertexIndex < numVertices; ++vertexIndex )
-	{
-		Point3 &position( m_vertexData.getPosition(vertexIndex) );
-		Point3 &previousPosition( m_vertexData.getPreviousPosition(vertexIndex) );
-		Vector3 &forceAccumulator( m_vertexData.getForceAccumulator(vertexIndex) );
-		Vector3 &velocity( m_vertexData.getVelocity(vertexIndex) );
-		float inverseMass = m_vertexData.getInverseMass(vertexIndex);
-
-		previousPosition = position;
-		velocity += forceAccumulator * inverseMass * solverdt;
-		position += velocity * solverdt;
-		forceAccumulator = Vector3(0.f, 0.f, 0.f);
-	}	
-} // btCPUSoftBodySolver::integrate
-
-float btCPUSoftBodySolver::computeTriangleArea( 
-	const Vectormath::Aos::Point3 &vertex0,
-	const Vectormath::Aos::Point3 &vertex1,
-	const Vectormath::Aos::Point3 &vertex2 )
-{
-	Vectormath::Aos::Vector3 a = vertex1 - vertex0;
-	Vectormath::Aos::Vector3 b = vertex2 - vertex0;
-	Vectormath::Aos::Vector3 crossProduct = cross(a, b);
-	float area = length( crossProduct );
-	return area;
-}
-
-void btCPUSoftBodySolver::updateConstants( float timeStep )
-{
-	using namespace Vectormath::Aos;
-
-	if( m_updateSolverConstants )
-	{
-		m_updateSolverConstants = false;
-
-		// Will have to redo this if we change the structure (tear, maybe) or various other possible changes
-
-		// Initialise link constants
-		const int numLinks = m_linkData.getNumLinks();
-		for( int linkIndex = 0; linkIndex < numLinks; ++linkIndex )
-		{
-			btSoftBodyLinkData::LinkNodePair &vertices( m_linkData.getVertexPair(linkIndex) );
-			m_linkData.getRestLength(linkIndex) = length((m_vertexData.getPosition( vertices.vertex0 ) - m_vertexData.getPosition( vertices.vertex1 )));
-			float invMass0 = m_vertexData.getInverseMass(vertices.vertex0);
-			float invMass1 = m_vertexData.getInverseMass(vertices.vertex1);
-			float linearStiffness = m_linkData.getLinearStiffnessCoefficient(linkIndex);
-			float massLSC = (invMass0 + invMass1)/linearStiffness;
-			m_linkData.getMassLSC(linkIndex) = massLSC;
-			float restLength = m_linkData.getRestLength(linkIndex);
-			float restLengthSquared = restLength*restLength;
-			m_linkData.getRestLengthSquared(linkIndex) = restLengthSquared;
-		}
-	}
-} // btCPUSoftBodySolver::updateConstants
-
-
-
-
-void btCPUSoftBodySolver::updateBounds()
-{	
-	using Vectormath::Aos::Point3;
-
-	for( int clothIndex = 0; clothIndex < m_softBodySet.size(); ++clothIndex )
-	{
-		btAcceleratedSoftBodyInterface *currentCloth = m_softBodySet[clothIndex];
-		btVector3 startBound(FLT_MAX, FLT_MAX, FLT_MAX);
-		btVector3 endBound(FLT_MIN, FLT_MIN, FLT_MIN);
-
-		const int startVertex = currentCloth->getFirstVertex();
-		const int numVertices = currentCloth->getNumVertices();
-
-		int endVertex = startVertex + numVertices;
-		for(int vertexIndex = startVertex; vertexIndex < endVertex; ++vertexIndex)
-		{		
-			btVector3 vertexPosition( m_vertexData.getVertexPositions()[vertexIndex].getX(), m_vertexData.getVertexPositions()[vertexIndex].getY(), m_vertexData.getVertexPositions()[vertexIndex].getZ() );
-			startBound.setX( btMin( startBound.getX(), vertexPosition.getX() ) );
-			startBound.setY( btMin( startBound.getY(), vertexPosition.getY() ) );
-			startBound.setZ( btMin( startBound.getZ(), vertexPosition.getZ() ) );
-
-			endBound.setX( btMax( endBound.getX(), vertexPosition.getX() ) );
-			endBound.setY( btMax( endBound.getY(), vertexPosition.getY() ) );
-			endBound.setZ( btMax( endBound.getZ(), vertexPosition.getZ() ) );
-		}
-
-		m_softBodySet[clothIndex]->updateBounds( startBound, endBound );
-	}
-}
-
-
-class btCPUSB_QuickSortCompare
-{
-	public:
-
-	bool operator() ( const btCPUCollisionShapeDescription& a, const btCPUCollisionShapeDescription& b )
-	{
-		return ( a.softBodyIdentifier < b.softBodyIdentifier );
-	}
-};
-
-/**
- * Sort the collision object details array and generate indexing into it for the per-cloth collision object array.
- */
-void btCPUSoftBodySolver::prepareCollisionConstraints()
-{
-	// First do a simple sort on the collision objects
-	btAlignedObjectArray<int> numObjectsPerClothPrefixSum;
-	btAlignedObjectArray<int> numObjectsPerCloth;
-	numObjectsPerCloth.resize( m_softBodySet.size(), 0 );
-	numObjectsPerClothPrefixSum.resize( m_softBodySet.size(), 0 );
-
-	if (!m_perClothCollisionObjects.size())
-		return;
-
-	m_collisionObjectDetails.quickSort( btCPUSB_QuickSortCompare() );
-
-	// Generating indexing for perClothCollisionObjects
-	// First clear the previous values with the "no collision object for cloth" constant
-	for( int clothIndex = 0; clothIndex < m_perClothCollisionObjects.size(); ++clothIndex )
-	{
-		m_perClothCollisionObjects[clothIndex].firstObject = -1;
-		m_perClothCollisionObjects[clothIndex].endObject = -1;
-	}
-	int currentCloth = 0;
-	int startIndex = 0;
-	for( int collisionObject = 0; collisionObject < m_collisionObjectDetails.size(); ++collisionObject )
-	{
-		int nextCloth = m_collisionObjectDetails[collisionObject].softBodyIdentifier;
-		if( nextCloth != currentCloth )
-		{	
-			// Changed cloth in the array
-			// Set the end index and the range is what we need for currentCloth
-			m_perClothCollisionObjects[currentCloth].firstObject = startIndex;
-			m_perClothCollisionObjects[currentCloth].endObject = collisionObject;
-			currentCloth = nextCloth;
-			startIndex = collisionObject;
-		}
-	}
-
-	// And update last cloth	
-	m_perClothCollisionObjects[currentCloth].firstObject = startIndex;
-	m_perClothCollisionObjects[currentCloth].endObject =  m_collisionObjectDetails.size();
-	
-} // prepareCollisionConstraints
-
-
-void btCPUSoftBodySolver::solveConstraints( float solverdt )
-{
-	using Vectormath::Aos::Vector3;
-	using Vectormath::Aos::Point3;
-	using Vectormath::Aos::lengthSqr;
-	using Vectormath::Aos::dot;
-
-	// Prepare links
-	int numLinks = m_linkData.getNumLinks();
-	int numVertices = m_vertexData.getNumVertices();
-
-	float kst = 1.f;
-
-	for( int linkIndex = 0; linkIndex < numLinks; ++linkIndex )
-	{			
-		btSoftBodyLinkData::LinkNodePair &nodePair( m_linkData.getVertexPair(linkIndex) );
-		Vector3 currentLength = m_vertexData.getPreviousPosition( nodePair.vertex1 ) - m_vertexData.getPreviousPosition( nodePair.vertex0 );
-		m_linkData.getCurrentLength(linkIndex) = currentLength;
-
-		// If mass at both ends of links is 0 (both static points) then we don't want this information.
-		// In reality this would be a fairly pointless link, but it could have been inserted
-		float linkLengthRatio = 0;
-		if( m_linkData.getMassLSC(linkIndex) > 0 )
-			linkLengthRatio = 1.f/(lengthSqr(currentLength) * m_linkData.getMassLSC(linkIndex));
-		m_linkData.getLinkLengthRatio(linkIndex) = linkLengthRatio;
-
-	}
-
-
-	prepareCollisionConstraints();
-
-
-	for( int iteration = 0; iteration < m_numberOfVelocityIterations ; ++iteration )
-	{
-		// Solve velocity
-		for(int linkIndex = 0; linkIndex < numLinks; ++linkIndex)
-		{				
-
-			int vertexIndex0 = m_linkData.getVertexPair(linkIndex).vertex0;
-			int vertexIndex1 = m_linkData.getVertexPair(linkIndex).vertex1;
-
-			float j = -dot(m_linkData.getCurrentLength(linkIndex), m_vertexData.getVelocity(vertexIndex0) - m_vertexData.getVelocity(vertexIndex1)) * m_linkData.getLinkLengthRatio(linkIndex)*kst;
-			
-			// If both ends of the link have no mass then this will be zero. Catch that case.
-			// TODO: Should really catch the /0 in the link setup, too
-			//if(psb->m_linksc0[i]>0)
-			{
-				m_vertexData.getVelocity(vertexIndex0) = m_vertexData.getVelocity(vertexIndex0) + m_linkData.getCurrentLength(linkIndex)*j*m_vertexData.getInverseMass(vertexIndex0);
-				m_vertexData.getVelocity(vertexIndex1) = m_vertexData.getVelocity(vertexIndex1) - m_linkData.getCurrentLength(linkIndex)*j*m_vertexData.getInverseMass(vertexIndex1);
-			}
-		}
-	}
-
-	// Compute new positions from velocity
-	// Also update the previous position so that our position computation is now based on the new position from the velocity solution
-	// rather than based directly on the original positions
-	if( m_numberOfVelocityIterations > 0 )
-	{
-		for(int vertexIndex = 0; vertexIndex < numVertices; ++vertexIndex)
-		{				
-			m_vertexData.getPosition(vertexIndex) = m_vertexData.getPreviousPosition(vertexIndex) + m_vertexData.getVelocity(vertexIndex) * solverdt;
-			m_vertexData.getPreviousPosition(vertexIndex) = m_vertexData.getPosition(vertexIndex);
-		}
-	}
-
-	// Solve drift
-	for( int iteration = 0; iteration < m_numberOfPositionIterations ; ++iteration )
-	{
-		for( int clothIndex = 0; clothIndex < m_softBodySet.size(); ++clothIndex )
-		{
-			btAcceleratedSoftBodyInterface *currentCloth = m_softBodySet[clothIndex];
-
-			const int startLink = currentCloth->getFirstLink();
-			const int numLinks = currentCloth->getNumLinks();
-
-			int endLink = startLink + numLinks;
-			for(int linkIndex = startLink; linkIndex < endLink; ++linkIndex)
-			{			
-				int vertexIndex0 = m_linkData.getVertexPair(linkIndex).vertex0;
-				int vertexIndex1 = m_linkData.getVertexPair(linkIndex).vertex1;
-
-				float massLSC = m_linkData.getMassLSC(linkIndex);
-				if( massLSC > 0.f )
-				{
-					Point3 &vertexPosition0( m_vertexData.getPosition( vertexIndex0 ) );
-					Point3 &vertexPosition1( m_vertexData.getPosition( vertexIndex1 ) );
-
-					Vector3 del = vertexPosition1 - vertexPosition0;
-					float len = lengthSqr(del);
-					float restLength2 = m_linkData.getRestLengthSquared(linkIndex);
-					float k = ((restLength2 - len) / (massLSC * (restLength2 + len) ) )*kst;
-
-					vertexPosition0 -= del*(k*m_vertexData.getInverseMass(vertexIndex0));
-					vertexPosition1 += del*(k*m_vertexData.getInverseMass(vertexIndex1));
-				}
-			}
-		}
-	}
-
-	// Clear forces so that friction is applied correctly
-	for( int clothIndex = 0; clothIndex < m_softBodySet.size(); ++clothIndex )
-	{
-		btAcceleratedSoftBodyInterface *currentCloth = m_softBodySet[clothIndex];
-
-		const int startLink = currentCloth->getFirstLink();
-		const int numLinks = currentCloth->getNumLinks();
-		const int startVertex = currentCloth->getFirstVertex();
-		const int numVertices = currentCloth->getNumVertices();
-		const int lastVertex = startVertex + numVertices;
-		// Update the velocities based on the change in position
-		// TODO: Damping should only be applied to the action of link constraints so the cloth still falls but then moves stiffly once it hits something
-		float velocityCoefficient = (1.f - m_perClothDampingFactor[clothIndex]);
-		float velocityCorrectionCoefficient = m_perClothVelocityCorrectionCoefficient[clothIndex];
-		float isolverDt = 1.f/solverdt;
-
-		for(int vertexIndex = startVertex; vertexIndex < lastVertex; ++vertexIndex)
-		{
-			m_vertexData.getForceAccumulator( vertexIndex ) = Vector3(0.f, 0.f, 0.f);
-		}
-	}
-	 
-
-	
-
-	// Solve collision constraints
-	// Very simple solver that pushes the vertex out of collision imposters for now
-	// to test integration with the broad phase code.
-	// May also want to put this into position solver loop every n iterations depending on
-	// how it behaves
-	for( int clothIndex = 0; clothIndex < m_softBodySet.size(); ++clothIndex )
-	{
-		btAcceleratedSoftBodyInterface *currentCloth = m_softBodySet[clothIndex];
-		
-		float clothFriction = currentCloth->getSoftBody()->getFriction();
-
-		const int startVertex = currentCloth->getFirstVertex();
-		const int numVertices = currentCloth->getNumVertices();
-		int endVertex = startVertex + numVertices;		
-
-		float velocityCoefficient = (1.f - m_perClothDampingFactor[clothIndex]);
-		float velocityCorrectionCoefficient = m_perClothVelocityCorrectionCoefficient[clothIndex];
-		float isolverDt = 1.f/solverdt;
-
-		int startObject = m_perClothCollisionObjects[clothIndex].firstObject;
-		int endObject = m_perClothCollisionObjects[clothIndex].endObject;
-
-		if( endObject == startObject )
-		{
-			// No collisions so just do the force update
-			for(int vertexIndex = startVertex; vertexIndex < endVertex; ++vertexIndex)
-			{
-				m_vertexData.getForceAccumulator( vertexIndex ) = Vector3(0.f, 0.f, 0.f);
-			}
-
-			// Recompute velocity based on updated position inclusive of drift
-			for(int vertexIndex = startVertex; vertexIndex < endVertex; ++vertexIndex)
-			{
-				m_vertexData.getVelocity(vertexIndex) = (m_vertexData.getPosition(vertexIndex) - m_vertexData.getPreviousPosition(vertexIndex)) * velocityCoefficient * isolverDt;
-			}
-		} else {
-
-			for( int collisionObject = startObject; collisionObject < endObject; ++collisionObject )
-			{
-				btCPUCollisionShapeDescription &shapeDescription( m_collisionObjectDetails[collisionObject] );
-
-				float colliderFriction = shapeDescription.friction;
-
-				if( shapeDescription.collisionShapeType == CAPSULE_SHAPE_PROXYTYPE )
-				{
-					using namespace Vectormath::Aos;
-
-					float capsuleHalfHeight = shapeDescription.shapeInformation.capsule.halfHeight;
-					float capsuleRadius = shapeDescription.shapeInformation.capsule.radius;
-					int capsuleUpAxis = shapeDescription.shapeInformation.capsule.upAxis;
-					float capsuleMargin = shapeDescription.margin;
-					
-					Transform3 worldTransform = shapeDescription.shapeTransform;
-
-					// As this is a GPU comparison solver just iterate over the vertices
-					for( int vertexIndex = startVertex; vertexIndex < endVertex; ++vertexIndex )
-					{		
-						// Clear force for vertex first
-						m_vertexData.getForceAccumulator( vertexIndex ) = Vector3(0.f, 0.f, 0.f);
-
-						Point3 vertex( m_vertexData.getPosition( vertexIndex ) );
-
-						// Correctly define the centerline depending on the upAxis
-						Point3 c1(0.f, 0.f, 0.f); 
-						Point3 c2(0.f, 0.f, 0.f);
-						if( capsuleUpAxis == 0 ) {
-							c1.setX(-capsuleHalfHeight);
-							c2.setX(capsuleHalfHeight);
-						} else if( capsuleUpAxis == 1 ) {							
-							c1.setY(-capsuleHalfHeight);
-							c2.setY(capsuleHalfHeight);
-						} else {
-							c1.setZ(-capsuleHalfHeight);
-							c2.setZ(capsuleHalfHeight);						
-						}
-
-						Point3 worldC1 = worldTransform * c1;
-						Point3 worldC2 = worldTransform * c2;
-						Vector3 segment = worldC2 - worldC1;
-
-						// compute distance of tangent to vertex along line segment in capsule
-						float distanceAlongSegment = -( dot( worldC1 - vertex, segment ) / lengthSqr(segment) );
-
-						Point3 closestPoint = (worldC1 + segment * distanceAlongSegment);
-						float distanceFromLine = length(vertex - closestPoint);
-						float distanceFromC1 = length(worldC1 - vertex);
-						float distanceFromC2 = length(worldC2 - vertex);
-					
-						// Final distance from collision, point to push from, direction to push in
-						// for impulse force
-						float distance;
-						Point3 sourcePoint;
-						Vector3 normalVector;
-						if( distanceAlongSegment < 0 )
-						{
-							distance = distanceFromC1;
-							sourcePoint = worldC1;
-							normalVector = normalize(vertex - worldC1);
-						} else if( distanceAlongSegment > 1.f ) {
-							distance = distanceFromC2;
-							sourcePoint = worldC2;
-							normalVector = normalize(vertex - worldC2);	
-						} else {
-							distance = distanceFromLine;
-							sourcePoint = closestPoint;
-							normalVector = normalize(vertex - closestPoint);
-						}
-						
-						Vector3 colliderLinearVelocity( shapeDescription.linearVelocity );
-						Vector3 colliderAngularVelocity( shapeDescription.angularVelocity );
-						Vector3 velocityOfSurfacePoint = colliderLinearVelocity + cross(colliderAngularVelocity, Vector3(vertex) - worldTransform.getTranslation());
-
-						float minDistance = capsuleRadius + capsuleMargin;
-						bool collided = false;
-
-						if( distance < minDistance )
-						{
-							// Project back to surface along normal
-							Vectormath::Aos::Point3 sourcePos = m_vertexData.getPosition( vertexIndex );
-							Vectormath::Aos::Vector3 posChange = (minDistance - distance)*normalVector*0.9;
-							//if( length(posChange) > 1 )
-							//	std::cerr << "Poschange: " << length(posChange) << "\n";
-							
-							Vectormath::Aos::Point3 newPos = sourcePos + posChange;
-							m_vertexData.getPosition( vertexIndex ) = newPos;
-							//m_vertexData.getPosition( vertexIndex ) = m_vertexData.getPosition( vertexIndex )  + (minDistance - distance)*normalVector*0.9;
-
-							// Experiment with moving back along source vector.
-							// Removes all ability to slide because it projects back along the vector length so it would undo lateral movement.
-							// TODO: This isn't quite right because we should take the movement of the collider into account as well
-							/*Vector3 incomingMoveVector( normalize(m_vertexData.getPreviousPosition(vertexIndex) - m_vertexData.getPosition(vertexIndex)) );
-							Vector3 normalDirectionMoveOut( (minDistance - distance)*normalVector*0.9 );
-							float distanceOnIncomingVector = dot(normalDirectionMoveOut, incomingMoveVector);
-							Vector3 vectorCorrection( distanceOnIncomingVector*incomingMoveVector );
-							m_vertexData.getPosition( vertexIndex ) = m_vertexData.getPosition( vertexIndex ) + vectorCorrection;*/
-
-
-							collided = true;
-						}
-
-						// Update velocity of vertex based on position
-						m_vertexData.getVelocity(vertexIndex) = (m_vertexData.getPosition(vertexIndex) - m_vertexData.getPreviousPosition(vertexIndex)) * velocityCoefficient * isolverDt;
-
-						// If we collided before we are on the surface so have friction
-						if( collided )
-						{
-							// Compute friction
-
-							// TODO: Just vertex velocity not enough, really we need the velocity 
-							// relative to closest point on the surface of the collider
-							Vector3 vertexVelocity( m_vertexData.getVelocity(vertexIndex) );
-							Vector3 relativeVelocity( vertexVelocity - velocityOfSurfacePoint );
-
-
-							// First compute vectors for plane perpendicular to normal vector
-							// Cross any vector with normal vector first then cross the normal with it again
-							Vector3 p1(normalize(cross(normalVector, segment)));
-							Vector3 p2(normalize(cross(p1, normalVector)));
-							// Full friction is sum of velocities in each direction of plane.
-							Vector3 frictionVector(p1*dot(relativeVelocity, p1) + p2*dot(relativeVelocity, p2));
-
-							// Real friction is peak friction corrected by friction coefficients.
-							frictionVector = frictionVector*(colliderFriction*clothFriction);
-
-							float approachSpeed = dot( relativeVelocity, normalVector );						
-		
-							// For now just update vertex position by moving to radius distance along the push vector
-							// Could use this as the basis for simple vector distance constraint for the point later, possibly?
-							// That way in the main solver loop all shape types could be the same... though when
-							// we need to apply bi-directionally it becomes more complicated
-					
-							// Add friction vector to the force accumulator
-							Vector3 &currentForce( m_vertexData.getForceAccumulator( vertexIndex ) );
-						
-							// Only apply if the vertex is moving towards the object to reduce jitter error
-							if( approachSpeed <= 0.0 )
-								currentForce -= frictionVector;
-						}
-					}
-				}
-			} // for( int collisionObject = startObject; collisionObject < endObject; ++collisionObject )
-		} // if( endObject == startObject )
-	}
-
-			
-
-
-} // btCPUSoftBodySolver::solveConstraints
-
-
-btCPUSoftBodySolver::btAcceleratedSoftBodyInterface *btCPUSoftBodySolver::findSoftBodyInterface( const btSoftBody* const softBody )
-{
-	for( int softBodyIndex = 0; softBodyIndex < m_softBodySet.size(); ++softBodyIndex )
-	{
-		btAcceleratedSoftBodyInterface *softBodyInterface = m_softBodySet[softBodyIndex];
-		if( softBodyInterface->getSoftBody() == softBody )
-			return softBodyInterface;
-	}
-	return 0;
-}
-
-const btCPUSoftBodySolver::btAcceleratedSoftBodyInterface * const btCPUSoftBodySolver::findSoftBodyInterface( const btSoftBody* const softBody ) const
-{
-	for( int softBodyIndex = 0; softBodyIndex < m_softBodySet.size(); ++softBodyIndex )
-	{
-		const btAcceleratedSoftBodyInterface *const softBodyInterface = m_softBodySet[softBodyIndex];
-		if( softBodyInterface->getSoftBody() == softBody )
-			return softBodyInterface;
-	}
-	return 0;
-}
-
-int btCPUSoftBodySolver::findSoftBodyIndex( const btSoftBody* const softBody )
-{
-	for( int softBodyIndex = 0; softBodyIndex < m_softBodySet.size(); ++softBodyIndex )
-	{
-		btAcceleratedSoftBodyInterface *softBodyInterface = m_softBodySet[softBodyIndex];
-		if( softBodyInterface->getSoftBody() == softBody )
-			return softBodyIndex;
-	}
-	return 1;
-}
-
-void btSoftBodySolverOutputCPUtoCPU::copySoftBodyToVertexBuffer( const btSoftBody * const softBody, btVertexBufferDescriptor *vertexBuffer )
-{
-	// Currently only support CPU output buffers
-	
-	const btSoftBodySolver *solver = softBody->getSoftBodySolver();
-	btAssert( solver->getSolverType() == btSoftBodySolver::CPU_SOLVER );
-	const btCPUSoftBodySolver *cpuSolver = static_cast< const btCPUSoftBodySolver * >( solver );
-	const btCPUSoftBodySolver::btAcceleratedSoftBodyInterface * const currentCloth = cpuSolver->findSoftBodyInterface( softBody );
-	const btSoftBodyVertexData &vertexData( cpuSolver->m_vertexData );
-
-	if( vertexBuffer->getBufferType() == btVertexBufferDescriptor::CPU_BUFFER )
-	{		
-		const int firstVertex = currentCloth->getFirstVertex();
-		const int lastVertex = firstVertex + currentCloth->getNumVertices();
-		const btCPUVertexBufferDescriptor *cpuVertexBuffer = static_cast< btCPUVertexBufferDescriptor* >(vertexBuffer);						
-		float *basePointer = cpuVertexBuffer->getBasePointer();						
-
-		if( vertexBuffer->hasVertexPositions() )
-		{
-			const int vertexOffset = cpuVertexBuffer->getVertexOffset();
-			const int vertexStride = cpuVertexBuffer->getVertexStride();
-			float *vertexPointer = basePointer + vertexOffset;
-
-			for( int vertexIndex = firstVertex; vertexIndex < lastVertex; ++vertexIndex )
-			{
-				Vectormath::Aos::Point3 position = vertexData.getPosition(vertexIndex);
-				*(vertexPointer + 0) = position.getX();
-				*(vertexPointer + 1) = position.getY();
-				*(vertexPointer + 2) = position.getZ();
-				vertexPointer += vertexStride;
-			}
-		}
-		if( vertexBuffer->hasNormals() )
-		{
-			const int normalOffset = cpuVertexBuffer->getNormalOffset();
-			const int normalStride = cpuVertexBuffer->getNormalStride();
-			float *normalPointer = basePointer + normalOffset;
-
-			for( int vertexIndex = firstVertex; vertexIndex < lastVertex; ++vertexIndex )
-			{
-				Vectormath::Aos::Vector3 normal = vertexData.getNormal(vertexIndex);
-				*(normalPointer + 0) = normal.getX();
-				*(normalPointer + 1) = normal.getY();
-				*(normalPointer + 2) = normal.getZ();
-				normalPointer += normalStride;
-			}
-		}
-	} else {
-		btAssert( 0=="Invalid vertex buffer descriptor used in CPU output." );
-	}
-} // btCPUSoftBodySolver::outputToVertexBuffers
-
-void btCPUSoftBodySolver::processCollision( btSoftBody*, btSoftBody *)
-{
-
-}
-
-// Add the collision object to the set to deal with for a particular soft body
-void btCPUSoftBodySolver::processCollision( btSoftBody *softBody, btCollisionObject* collisionObject )
-{
-	int softBodyIndex = findSoftBodyIndex( softBody );
-
-	if( softBodyIndex >= 0 )
-	{
-		btCollisionShape *collisionShape = collisionObject->getCollisionShape();
-		float friction = collisionObject->getFriction();
-		int shapeType = collisionShape->getShapeType();
-		if( shapeType == CAPSULE_SHAPE_PROXYTYPE )
-		{
-			// Add to the list of expected collision objects
-			btCPUCollisionShapeDescription newCollisionShapeDescription;
-			newCollisionShapeDescription.softBodyIdentifier = softBodyIndex;
-			newCollisionShapeDescription.collisionShapeType = shapeType;
-			newCollisionShapeDescription.shapeTransform = toTransform3(collisionObject->getWorldTransform());
-			btCapsuleShape *capsule = static_cast<btCapsuleShape*>( collisionShape );
-			newCollisionShapeDescription.shapeInformation.capsule.radius = capsule->getRadius();
-			newCollisionShapeDescription.shapeInformation.capsule.halfHeight = capsule->getHalfHeight();
-			newCollisionShapeDescription.shapeInformation.capsule.upAxis = capsule->getUpAxis();
-			newCollisionShapeDescription.margin = capsule->getMargin();
-			newCollisionShapeDescription.friction = friction;
-			btRigidBody* body = static_cast< btRigidBody* >( collisionObject );
-			newCollisionShapeDescription.linearVelocity = toVector3(body->getLinearVelocity());
-			newCollisionShapeDescription.angularVelocity = toVector3(body->getAngularVelocity());
-			m_collisionObjectDetails.push_back( newCollisionShapeDescription );
-		} else {
-			btAssert("Unsupported collision shape type\n");
-		}
-	} else {
-		btAssert("Unknown soft body");
-	}
-} // btCPUSoftBodySolver::processCollision
-
-
-void btCPUSoftBodySolver::predictMotion( float timeStep )
-{
-	// Fill the force arrays with current acceleration data etc
-	m_perClothWindVelocity.resize( m_softBodySet.size() );
-	for( int softBodyIndex = 0; softBodyIndex < m_softBodySet.size(); ++softBodyIndex )
-	{
-		btSoftBody *softBody = m_softBodySet[softBodyIndex]->getSoftBody();
-		
-		m_perClothWindVelocity[softBodyIndex] = toVector3(softBody->getWindVelocity());
-	}
-
-
-	// Apply forces that we know about to the cloths
-	applyForces(  timeStep * getTimeScale() );
-
-	// Itegrate motion for all soft bodies dealt with by the solver
-	integrate( timeStep * getTimeScale() );
-
-	// Update bounds
-	// Will update the bounds for all softBodies being dealt with by the solver and 
-	// set the values in the btSoftBody object
-	updateBounds();
-
-	// End prediction work for solvers
-}
-
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h b/hkl3d/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h
deleted file mode 100644
index 25d04cd..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h
+++ /dev/null
@@ -1,370 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_ACCELERATED_SOFT_BODY_CPU_SOLVER_H
-#define BT_ACCELERATED_SOFT_BODY_CPU_SOLVER_H
-
-#include "vectormath/vmInclude.h"
-#include "BulletSoftBody/btSoftBodySolvers.h"
-#include "BulletSoftBody/btSoftBodySolverVertexBuffer.h"
-#include "BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolverData.h"
-
-struct btCPUCollisionShapeDescription
-{
-	int softBodyIdentifier;
-	int collisionShapeType;
-	Vectormath::Aos::Transform3 shapeTransform;
-	union
-	{
-		struct Sphere
-		{
-			float radius;
-		} sphere;
-		struct Capsule
-		{
-			float radius;
-			float halfHeight;
-			int upAxis;
-		} capsule;
-	} shapeInformation;
-	
-	float margin;
-	float friction;
-	Vectormath::Aos::Vector3 linearVelocity;
-	Vectormath::Aos::Vector3 angularVelocity;
-
-	btCPUCollisionShapeDescription()
-	{
-		collisionShapeType = 0;
-		margin = 0;
-		friction = 0;
-	}
-};
-
-class btCPUSoftBodySolver : public btSoftBodySolver
-{
-protected:
-	/**
-	 * Entry in the collision shape array.
-	 * Specifies the shape type, the transform matrix and the necessary details of the collisionShape.
-	 */
-
-
-	// Public because output classes need it. This is a better encapsulation to break in the short term
-	// Than having the solvers themselves need dependencies on DX, CL etc unnecessarily
-public:
-	
-	struct CollisionObjectIndices
-	{
-		CollisionObjectIndices( int f, int e )
-		{
-			firstObject = f;
-			endObject = e;
-		}
-
-		int firstObject;
-		int endObject;
-	};
-
-	/**
-	 * SoftBody class to maintain information about a soft body instance
-	 * within a solver.
-	 * This data addresses the main solver arrays.
-	 */
-	class btAcceleratedSoftBodyInterface
-	{
-	protected:
-		/** Current number of vertices that are part of this cloth */
-		int m_numVertices;
-		/** Maximum number of vertices allocated to be part of this cloth */
-		int m_maxVertices;
-		/** Current number of triangles that are part of this cloth */
-		int m_numTriangles;
-		/** Maximum number of triangles allocated to be part of this cloth */
-		int m_maxTriangles;
-		/** Index of first vertex in the world allocated to this cloth */
-		int m_firstVertex;
-		/** Index of first triangle in the world allocated to this cloth */
-		int m_firstTriangle;
-		/** Index of first link in the world allocated to this cloth */
-		int m_firstLink;
-		/** Maximum number of links allocated to this cloth */
-		int m_maxLinks;
-		/** Current number of links allocated to this cloth */
-		int m_numLinks;
-
-		/** The actual soft body this data represents */
-		btSoftBody *m_softBody;
-
-
-	public:
-		btAcceleratedSoftBodyInterface( btSoftBody *softBody ) :
-		  m_softBody( softBody )
-		{
-			m_numVertices = 0;
-			m_maxVertices = 0;
-			m_numTriangles = 0;
-			m_maxTriangles = 0;
-			m_firstVertex = 0;
-			m_firstTriangle = 0;
-			m_firstLink = 0;
-			m_maxLinks = 0;
-			m_numLinks = 0;
-		}
-		int getNumVertices() const
-		{
-			return m_numVertices;
-		}
-
-		int getNumTriangles() const
-		{
-			return m_numTriangles;
-		}
-
-		int getMaxVertices() const
-		{
-			return m_maxVertices;
-		}
-
-		int getMaxTriangles() const
-		{
-			return m_maxTriangles;
-		}
-
-		int getFirstVertex() const
-		{
-			return m_firstVertex;
-		}
-
-		int getFirstTriangle() const
-		{
-			return m_firstTriangle;
-		}
-
-		/**
-		 * Update the bounds in the btSoftBody object
-		 */
-		void updateBounds( const btVector3 &lowerBound, const btVector3 &upperBound );
-
-		// TODO: All of these set functions will have to do checks and
-		// update the world because restructuring of the arrays will be necessary
-		// Reasonable use of "friend"?
-		void setNumVertices( int numVertices )
-		{
-			m_numVertices = numVertices;
-		}	
-		
-		void setNumTriangles( int numTriangles )
-		{
-			m_numTriangles = numTriangles;
-		}
-
-		void setMaxVertices( int maxVertices )
-		{
-			m_maxVertices = maxVertices;
-		}
-
-		void setMaxTriangles( int maxTriangles )
-		{
-			m_maxTriangles = maxTriangles;
-		}
-
-		void setFirstVertex( int firstVertex )
-		{
-			m_firstVertex = firstVertex;
-		}
-
-		void setFirstTriangle( int firstTriangle )
-		{
-			m_firstTriangle = firstTriangle;
-		}
-
-		void setMaxLinks( int maxLinks )
-		{
-			m_maxLinks = maxLinks;
-		}
-
-		void setNumLinks( int numLinks )
-		{
-			m_numLinks = numLinks;
-		}
-
-		void setFirstLink( int firstLink )
-		{
-			m_firstLink = firstLink;
-		}
-
-		int getMaxLinks() const
-		{
-			return m_maxLinks;
-		}
-
-		int getNumLinks() const
-		{
-			return m_numLinks;
-		}
-
-		int getFirstLink() const
-		{
-			return m_firstLink;
-		}
-
-		btSoftBody* getSoftBody()
-		{
-			return m_softBody;
-		}
-
-		const btSoftBody* const getSoftBody() const
-		{
-			return m_softBody;
-		}
-	};
-	
-	btSoftBodyLinkData m_linkData;
-	btSoftBodyVertexData m_vertexData;
-	btSoftBodyTriangleData m_triangleData;
-
-protected:
-
-
-
-		
-	/** Variable to define whether we need to update solver constants on the next iteration */
-	bool m_updateSolverConstants;
-
-	/** 
-	 * Cloths owned by this solver.
-	 * Only our cloths are in this array.
-	 */
-	btAlignedObjectArray< btAcceleratedSoftBodyInterface * > m_softBodySet;
-	
-	/** Acceleration value to be applied to all non-static vertices in the solver. 
-	 * Index n is cloth n, array sized by number of cloths in the world not the solver. 
-	 */
-	btAlignedObjectArray< Vectormath::Aos::Vector3 > m_perClothAcceleration;
-
-	/** Wind velocity to be applied normal to all non-static vertices in the solver. 
-	 * Index n is cloth n, array sized by number of cloths in the world not the solver. 
-	 */
-	btAlignedObjectArray< Vectormath::Aos::Vector3 > m_perClothWindVelocity;
-
-	/** Velocity damping factor */
-	btAlignedObjectArray< float > m_perClothDampingFactor;
-
-	/** Velocity correction coefficient */
-	btAlignedObjectArray< float > m_perClothVelocityCorrectionCoefficient;
-
-	/** Lift parameter for wind effect on cloth. */
-	btAlignedObjectArray< float > m_perClothLiftFactor;
-	
-	/** Drag parameter for wind effect on cloth. */
-	btAlignedObjectArray< float > m_perClothDragFactor;
-
-	/** Density of the medium in which each cloth sits */
-	btAlignedObjectArray< float > m_perClothMediumDensity;
-
-	/** 
-	 * Collision shape details: pair of index of first collision shape for the cloth and number of collision objects.
-	 */
-	btAlignedObjectArray< CollisionObjectIndices > m_perClothCollisionObjects;
-
-	/** 
-	 * Collision shapes being passed across to the cloths in this solver.
-	 */
-	btAlignedObjectArray< btCPUCollisionShapeDescription > m_collisionObjectDetails;
-
-
-	void prepareCollisionConstraints();
-
-	Vectormath::Aos::Vector3 ProjectOnAxis( const Vectormath::Aos::Vector3 &v, const Vectormath::Aos::Vector3 &a );
-
-	void ApplyClampedForce( float solverdt, const Vectormath::Aos::Vector3 &force, const Vectormath::Aos::Vector3 &vertexVelocity, float inverseMass, Vectormath::Aos::Vector3 &vertexForce );
-	
-	float computeTriangleArea( 
-		const Vectormath::Aos::Point3 &vertex0,
-		const Vectormath::Aos::Point3 &vertex1,
-		const Vectormath::Aos::Point3 &vertex2 );
-
-	void applyForces( float solverdt );
-	void integrate( float solverdt );
-	void updateConstants( float timeStep );
-	int findSoftBodyIndex( const btSoftBody* const softBody );
-	
-	/** Update the bounds of the soft body objects in the solver */
-	void updateBounds();
-
-
-public:
-	btCPUSoftBodySolver();
-	
-	virtual ~btCPUSoftBodySolver();
-
-	
-	virtual SolverTypes getSolverType() const
-	{
-		return CPU_SOLVER;
-	}
-
-
-	virtual btSoftBodyLinkData &getLinkData();
-
-	virtual btSoftBodyVertexData &getVertexData();
-
-	virtual btSoftBodyTriangleData &getTriangleData();
-
-
-
-	btAcceleratedSoftBodyInterface *findSoftBodyInterface( const btSoftBody* const softBody );
-	const btAcceleratedSoftBodyInterface * const findSoftBodyInterface( const btSoftBody* const softBody ) const;
-
-
-
-	virtual bool checkInitialized();
-
-	virtual void updateSoftBodies( );
-
-	virtual void optimize( btAlignedObjectArray< btSoftBody * > &softBodies , bool forceUpdate=false);
-
-	virtual void copyBackToSoftBodies();
-
-	virtual void solveConstraints( float solverdt );
-
-	virtual void predictMotion( float solverdt );
-
-	virtual void processCollision( btSoftBody *, btCollisionObject* );
-
-	virtual void processCollision( btSoftBody*, btSoftBody *);
-
-};
-
-
-/** 
- * Class to manage movement of data from a solver to a given target.
- * This version is the CPU to CPU generic version.
- */
-class btSoftBodySolverOutputCPUtoCPU : public btSoftBodySolverOutput
-{
-protected:
-
-public:
-	btSoftBodySolverOutputCPUtoCPU()
-	{
-	}
-
-	/** Output current computed vertex data to the vertex buffers for all cloths in the solver. */
-	virtual void copySoftBodyToVertexBuffer( const btSoftBody * const softBody, btVertexBufferDescriptor *vertexBuffer );
-};
-
-#endif // #ifndef BT_ACCELERATED_SOFT_BODY_CPU_SOLVER_H
\ No newline at end of file
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/HeapManager.h b/hkl3d/bullet/src/BulletMultiThreaded/HeapManager.h
deleted file mode 100644
index b2da4ef..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/HeapManager.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
-   Copyright (C) 2009 Sony Computer Entertainment Inc.
-   All rights reserved.
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-
-*/
-
-#ifndef BT_HEAP_MANAGER_H__
-#define BT_HEAP_MANAGER_H__
-
-#ifdef __SPU__
-	#define HEAP_STACK_SIZE 32
-#else
-	#define HEAP_STACK_SIZE 64
-#endif
-
-#define MIN_ALLOC_SIZE 16
-
-
-class HeapManager
-{
-private:
-	ATTRIBUTE_ALIGNED16(unsigned char *mHeap);
-	ATTRIBUTE_ALIGNED16(unsigned int mHeapBytes);
-	ATTRIBUTE_ALIGNED16(unsigned char *mPoolStack[HEAP_STACK_SIZE]);
-	ATTRIBUTE_ALIGNED16(unsigned int mCurStack);
-	
-public:
-	enum {ALIGN16,ALIGN128};
-
-	HeapManager(unsigned char *buf,int bytes)
-	{
-		mHeap = buf;
-		mHeapBytes = bytes;
-		clear();
-	}
-	
-	~HeapManager()
-	{
-	}
-	
-	int getAllocated()
-	{
-		return (int)(mPoolStack[mCurStack]-mHeap);
-	}
-	
-	int getRest()
-	{
-		return mHeapBytes-getAllocated();
-	}
-
-	void *allocate(size_t bytes,int alignment = ALIGN16)
-	{
-		if(bytes <= 0) bytes = MIN_ALLOC_SIZE;
-		btAssert(mCurStack < (HEAP_STACK_SIZE-1));
-
-		
-#if defined(_WIN64) || defined(__LP64__) || defined(__x86_64__)
-		unsigned long long p = (unsigned long long )mPoolStack[mCurStack];
-		if(alignment == ALIGN128) {
-			p = ((p+127) & 0xffffffffffffff80);
-			bytes = (bytes+127) & 0xffffffffffffff80;
-		}
-		else {
-			bytes = (bytes+15) & 0xfffffffffffffff0;
-		}
-
-		btAssert(bytes <=(mHeapBytes-(p-(unsigned long long )mHeap)) );
-		
-#else
-		unsigned long p = (unsigned long )mPoolStack[mCurStack];
-		if(alignment == ALIGN128) {
-			p = ((p+127) & 0xffffff80);
-			bytes = (bytes+127) & 0xffffff80;
-		}
-		else {
-			bytes = (bytes+15) & 0xfffffff0;
-		}
-		btAssert(bytes <=(mHeapBytes-(p-(unsigned long)mHeap)) );
-#endif
-		unsigned char * bla = (unsigned char *)(p + bytes);
-		mPoolStack[++mCurStack] = bla;
-		return (void*)p;
-	}
-
-	void deallocate(void *p)
-	{
-		(void) p;
-		mCurStack--;
-	}
-	
-	void clear()
-	{
-		mPoolStack[0] = mHeap;
-		mCurStack = 0;
-	}
-
-//	void printStack()
-//	{
-//		for(unsigned int i=0;i<=mCurStack;i++) {
-//			PRINTF("memStack %2d 0x%x\n",i,(uint32_t)mPoolStack[i]);
-//		}
-//	}
-
-};
-
-#endif //BT_HEAP_MANAGER_H__
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/PlatformDefinitions.h b/hkl3d/bullet/src/BulletMultiThreaded/PlatformDefinitions.h
deleted file mode 100644
index 142103a..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/PlatformDefinitions.h
+++ /dev/null
@@ -1,99 +0,0 @@
-#ifndef BT_TYPE_DEFINITIONS_H
-#define BT_TYPE_DEFINITIONS_H
-
-///This file provides some platform/compiler checks for common definitions
-#include "LinearMath/btScalar.h"
-#include "LinearMath/btMinMax.h"
-
-#ifdef PFX_USE_FREE_VECTORMATH
-#include "physics_effects/base_level/base/pfx_vectormath_include.win32.h"
-typedef Vectormath::Aos::Vector3    vmVector3;
-typedef Vectormath::Aos::Quat       vmQuat;
-typedef Vectormath::Aos::Matrix3    vmMatrix3;
-typedef Vectormath::Aos::Transform3 vmTransform3;
-typedef Vectormath::Aos::Point3     vmPoint3;
-#else
-#include "vectormath/vmInclude.h"
-#endif//PFX_USE_FREE_VECTORMATH
-
-
-
-
-
-#ifdef _WIN32
-
-typedef union
-{
-  unsigned int u;
-  void *p;
-} addr64;
-
-#define USE_WIN32_THREADING 1
-
-		#if defined(__MINGW32__) || defined(__CYGWIN__) || (defined (_MSC_VER) && _MSC_VER < 1300)
-		#else
-		#endif //__MINGW32__
-
-		typedef unsigned char     uint8_t;
-#ifndef __PHYSICS_COMMON_H__
-#ifndef PFX_USE_FREE_VECTORMATH
-#ifndef __BT_SKIP_UINT64_H
-		typedef unsigned long int uint64_t;
-#endif //__BT_SKIP_UINT64_H
-#endif //PFX_USE_FREE_VECTORMATH
-		typedef unsigned int      uint32_t;
-#endif //__PHYSICS_COMMON_H__
-		typedef unsigned short    uint16_t;
-
-		#include <malloc.h>
-		#define memalign(alignment, size) malloc(size);
-			
-#include <string.h> //memcpy
-
-		
-
-		#include <stdio.h>		
-		#define spu_printf printf
-		
-#else
-		#include <stdint.h>
-		#include <stdlib.h>
-		#include <string.h> //for memcpy
-
-#if defined	(__CELLOS_LV2__)
-	// Playstation 3 Cell SDK
-#include <spu_printf.h>
-		
-#else
-	// posix system
-
-#define USE_PTHREADS    (1)
-
-#ifdef USE_LIBSPE2
-#include <stdio.h>		
-#define spu_printf printf	
-#define DWORD unsigned int
-			typedef union
-			{
-			  unsigned long long ull;
-			  unsigned int ui[2];
-			  void *p;
-			} addr64;
-#endif // USE_LIBSPE2
-
-#endif	//__CELLOS_LV2__
-	
-#endif
-
-#ifdef __SPU__
-#include <stdio.h>		
-#define printf spu_printf
-#endif
-
-/* Included here because we need uint*_t typedefs */
-#include "PpuAddressSpace.h"
-
-#endif //BT_TYPE_DEFINITIONS_H
-
-
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/PosixThreadSupport.cpp b/hkl3d/bullet/src/BulletMultiThreaded/PosixThreadSupport.cpp
deleted file mode 100644
index c8b49ee..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/PosixThreadSupport.cpp
+++ /dev/null
@@ -1,399 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include <stdio.h>
-#include "PosixThreadSupport.h"
-#ifdef USE_PTHREADS
-#include <errno.h>
-#include <unistd.h>
-
-#include "SpuCollisionTaskProcess.h"
-#include "SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h"
-
-#define checkPThreadFunction(returnValue) \
-    if(0 != returnValue) { \
-        printf("PThread problem at line %i in file %s: %i %d\n", __LINE__, __FILE__, returnValue, errno); \
-    }
-
-// The number of threads should be equal to the number of available cores
-// Todo: each worker should be linked to a single core, using SetThreadIdealProcessor.
-
-// PosixThreadSupport helps to initialize/shutdown libspe2, start/stop SPU tasks and communication
-// Setup and initialize SPU/CELL/Libspe2
-PosixThreadSupport::PosixThreadSupport(ThreadConstructionInfo& threadConstructionInfo)
-{
-	startThreads(threadConstructionInfo);
-}
-
-// cleanup/shutdown Libspe2
-PosixThreadSupport::~PosixThreadSupport()
-{
-	stopSPU();
-}
-
-#if (defined (__APPLE__))
-#define NAMED_SEMAPHORES
-#endif
-
-// this semaphore will signal, if and how many threads are finished with their work
-static sem_t* mainSemaphore=0;
-
-static sem_t* createSem(const char* baseName)
-{
-	static int semCount = 0;
-#ifdef NAMED_SEMAPHORES
-        /// Named semaphore begin
-        char name[32];
-        snprintf(name, 32, "/%s-%d-%4.4d", baseName, getpid(), semCount++); 
-        sem_t* tempSem = sem_open(name, O_CREAT, 0600, 0);
-
-        if (tempSem != reinterpret_cast<sem_t *>(SEM_FAILED))
-        {
-//        printf("Created \"%s\" Semaphore %p\n", name, tempSem);
-        }
-        else
-	{
-		//printf("Error creating Semaphore %d\n", errno);
-		exit(-1);
-	}
-        /// Named semaphore end
-#else
-	sem_t* tempSem = new sem_t;
-	checkPThreadFunction(sem_init(tempSem, 0, 0));
-#endif
-	return tempSem;
-}
-
-static void destroySem(sem_t* semaphore)
-{
-#ifdef NAMED_SEMAPHORES
-	checkPThreadFunction(sem_close(semaphore));
-#else
-	checkPThreadFunction(sem_destroy(semaphore));
-	delete semaphore;
-#endif	
-}
-
-static void *threadFunction(void *argument) 
-{
-
-	PosixThreadSupport::btSpuStatus* status = (PosixThreadSupport::btSpuStatus*)argument;
-
-	
-	while (1)
-	{
-            checkPThreadFunction(sem_wait(status->startSemaphore));
-		
-		void* userPtr = status->m_userPtr;
-
-		if (userPtr)
-		{
-			btAssert(status->m_status);
-			status->m_userThreadFunc(userPtr,status->m_lsMemory);
-			status->m_status = 2;
-			checkPThreadFunction(sem_post(mainSemaphore));
-	                status->threadUsed++;
-		} else {
-			//exit Thread
-			status->m_status = 3;
-			checkPThreadFunction(sem_post(mainSemaphore));
-			printf("Thread with taskId %i exiting\n",status->m_taskId);
-			break;
-		}
-		
-	}
-
-	printf("Thread TERMINATED\n");
-	return 0;
-
-}
-
-///send messages to SPUs
-void PosixThreadSupport::sendRequest(uint32_t uiCommand, ppu_address_t uiArgument0, uint32_t taskId)
-{
-	///	gMidphaseSPU.sendRequest(CMD_GATHER_AND_PROCESS_PAIRLIST, (uint32_t) &taskDesc);
-	
-	///we should spawn an SPU task here, and in 'waitForResponse' it should wait for response of the (one of) the first tasks that finished
-	
-
-
-	switch (uiCommand)
-	{
-	case 	CMD_GATHER_AND_PROCESS_PAIRLIST:
-		{
-			btSpuStatus&	spuStatus = m_activeSpuStatus[taskId];
-			btAssert(taskId >= 0);
-			btAssert(taskId < m_activeSpuStatus.size());
-
-			spuStatus.m_commandId = uiCommand;
-			spuStatus.m_status = 1;
-			spuStatus.m_userPtr = (void*)uiArgument0;
-
-			// fire event to start new task
-			checkPThreadFunction(sem_post(spuStatus.startSemaphore));
-			break;
-		}
-	default:
-		{
-			///not implemented
-			btAssert(0);
-		}
-
-	};
-
-
-}
-
-
-///check for messages from SPUs
-void PosixThreadSupport::waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1)
-{
-	///We should wait for (one of) the first tasks to finish (or other SPU messages), and report its response
-	
-	///A possible response can be 'yes, SPU handled it', or 'no, please do a PPU fallback'
-
-
-	btAssert(m_activeSpuStatus.size());
-
-        // wait for any of the threads to finish
-	checkPThreadFunction(sem_wait(mainSemaphore));
-        
-	// get at least one thread which has finished
-        size_t last = -1;
-        
-        for(size_t t=0; t < size_t(m_activeSpuStatus.size()); ++t) {
-            if(2 == m_activeSpuStatus[t].m_status) {
-                last = t;
-                break;
-            }
-        }
-
-	btSpuStatus& spuStatus = m_activeSpuStatus[last];
-
-	btAssert(spuStatus.m_status > 1);
-	spuStatus.m_status = 0;
-
-	// need to find an active spu
-	btAssert(last >= 0);
-
-	*puiArgument0 = spuStatus.m_taskId;
-	*puiArgument1 = spuStatus.m_status;
-}
-
-
-
-void PosixThreadSupport::startThreads(ThreadConstructionInfo& threadConstructionInfo)
-{
-        printf("%s creating %i threads.\n", __FUNCTION__, threadConstructionInfo.m_numThreads);
-	m_activeSpuStatus.resize(threadConstructionInfo.m_numThreads);
-        
-	mainSemaphore = createSem("main");                
-	//checkPThreadFunction(sem_wait(mainSemaphore));
-   
-	for (int i=0;i < threadConstructionInfo.m_numThreads;i++)
-	{
-		printf("starting thread %d\n",i);
-
-		btSpuStatus&	spuStatus = m_activeSpuStatus[i];
-
-		spuStatus.startSemaphore = createSem("threadLocal");                
-                
-                checkPThreadFunction(pthread_create(&spuStatus.thread, NULL, &threadFunction, (void*)&spuStatus));
-
-		spuStatus.m_userPtr=0;
-
-		spuStatus.m_taskId = i;
-		spuStatus.m_commandId = 0;
-		spuStatus.m_status = 0;
-		spuStatus.m_lsMemory = threadConstructionInfo.m_lsMemoryFunc();
-		spuStatus.m_userThreadFunc = threadConstructionInfo.m_userThreadFunc;
-        spuStatus.threadUsed = 0;
-
-		printf("started thread %d \n",i);
-		
-	}
-
-}
-
-void PosixThreadSupport::startSPU()
-{
-}
-
-
-///tell the task scheduler we are done with the SPU tasks
-void PosixThreadSupport::stopSPU()
-{
-	for(size_t t=0; t < size_t(m_activeSpuStatus.size()); ++t) 
-	{
-            btSpuStatus&	spuStatus = m_activeSpuStatus[t];
-            printf("%s: Thread %i used: %ld\n", __FUNCTION__, int(t), spuStatus.threadUsed);
-
-	spuStatus.m_userPtr = 0;       
- 	checkPThreadFunction(sem_post(spuStatus.startSemaphore));
-	checkPThreadFunction(sem_wait(mainSemaphore));
-
-	printf("destroy semaphore\n"); 
-            destroySem(spuStatus.startSemaphore);
-            printf("semaphore destroyed\n");
-		checkPThreadFunction(pthread_join(spuStatus.thread,0));
-        }
-	printf("destroy main semaphore\n");
-        destroySem(mainSemaphore);
-	printf("main semaphore destroyed\n");
-	m_activeSpuStatus.clear();
-}
-
-class PosixCriticalSection : public btCriticalSection 
-{
-	pthread_mutex_t m_mutex;
-	
-public:
-	PosixCriticalSection() 
-	{
-		pthread_mutex_init(&m_mutex, NULL);
-	}
-	virtual ~PosixCriticalSection() 
-	{
-		pthread_mutex_destroy(&m_mutex);
-	}
-	
-	ATTRIBUTE_ALIGNED16(unsigned int mCommonBuff[32]);
-	
-	virtual unsigned int getSharedParam(int i)
-	{
-		return mCommonBuff[i];
-	}
-	virtual void setSharedParam(int i,unsigned int p)
-	{
-		mCommonBuff[i] = p;
-	}
-	
-	virtual void lock()
-	{
-		pthread_mutex_lock(&m_mutex);
-	}
-	virtual void unlock()
-	{
-		pthread_mutex_unlock(&m_mutex);
-	}
-};
-
-
-#if defined(_POSIX_BARRIERS) && (_POSIX_BARRIERS - 20012L) >= 0
-/* OK to use barriers on this platform */
-class PosixBarrier : public btBarrier 
-{
-	pthread_barrier_t m_barr;
-	int m_numThreads;
-public:
-	PosixBarrier()
-	:m_numThreads(0)	{	}
-	virtual ~PosixBarrier()	{
-		pthread_barrier_destroy(&m_barr);
-	}
-	
-	virtual void sync()
-	{
-		int rc = pthread_barrier_wait(&m_barr);
-		if(rc != 0 && rc != PTHREAD_BARRIER_SERIAL_THREAD)
-		{
-			printf("Could not wait on barrier\n");
-			exit(-1);
-		}
-	}
-	virtual void setMaxCount(int numThreads)
-	{
-		int result = pthread_barrier_init(&m_barr, NULL, numThreads);
-		m_numThreads = numThreads;
-		btAssert(result==0);
-	}
-	virtual int  getMaxCount()
-	{
-		return m_numThreads;
-	}
-};
-#else
-/* Not OK to use barriers on this platform - insert alternate code here */
-class PosixBarrier : public btBarrier 
-{
-	pthread_mutex_t m_mutex;
-	pthread_cond_t m_cond;
-	
-	int m_numThreads;
-	int	m_called;
-	
-public:
-	PosixBarrier()
-	:m_numThreads(0)
-	{
-	}
-	virtual ~PosixBarrier() 
-	{
-		if (m_numThreads>0)
-		{
-			pthread_mutex_destroy(&m_mutex);
-			pthread_cond_destroy(&m_cond);
-		}
-	}
-	
-	virtual void sync()
-	{		
-		pthread_mutex_lock(&m_mutex);
-		m_called++;
-		if (m_called == m_numThreads) {
-			m_called = 0;
-			pthread_cond_broadcast(&m_cond);
-		} else {
-			pthread_cond_wait(&m_cond,&m_mutex);
-		}
-		pthread_mutex_unlock(&m_mutex);
-		
-	}
-	virtual void setMaxCount(int numThreads)
-	{
-		if (m_numThreads>0)
-		{
-			pthread_mutex_destroy(&m_mutex);
-			pthread_cond_destroy(&m_cond);
-		}
-		m_called = 0;
-		pthread_mutex_init(&m_mutex,NULL);
-		pthread_cond_init(&m_cond,NULL);
-		m_numThreads = numThreads;
-	}
-	virtual int  getMaxCount()
-	{
-		return m_numThreads;
-	}
-};
-
-#endif//_POSIX_BARRIERS
-
-
-
-btBarrier* PosixThreadSupport::createBarrier()
-{
-	PosixBarrier* barrier = new PosixBarrier();
-	barrier->setMaxCount(getNumTasks());
-	return barrier;
-}
-
-btCriticalSection* PosixThreadSupport::createCriticalSection()
-{
-	return new PosixCriticalSection();
-}
-
-#endif // USE_PTHREADS
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/PosixThreadSupport.h b/hkl3d/bullet/src/BulletMultiThreaded/PosixThreadSupport.h
deleted file mode 100644
index 2df3f0e..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/PosixThreadSupport.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_POSIX_THREAD_SUPPORT_H
-#define BT_POSIX_THREAD_SUPPORT_H
-
-
-#include "LinearMath/btScalar.h"
-#include "PlatformDefinitions.h"
-
-#ifdef USE_PTHREADS //platform specifc defines are defined in PlatformDefinitions.h
-
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 600 //for definition of pthread_barrier_t, see http://pages.cs.wisc.edu/~travitch/pthreads_primer.html
-#endif //_XOPEN_SOURCE
-#include <pthread.h>
-#include <semaphore.h>
-
-
-
-#include "LinearMath/btAlignedObjectArray.h"
-
-#include "btThreadSupportInterface.h"
-
-
-typedef void (*PosixThreadFunc)(void* userPtr,void* lsMemory);
-typedef void* (*PosixlsMemorySetupFunc)();
-
-// PosixThreadSupport helps to initialize/shutdown libspe2, start/stop SPU tasks and communication
-class PosixThreadSupport : public btThreadSupportInterface 
-{
-public:
-    typedef enum sStatus {
-        STATUS_BUSY,
-        STATUS_READY,
-        STATUS_FINISHED
-    } Status;
-
-	// placeholder, until libspe2 support is there
-	struct	btSpuStatus
-	{
-		uint32_t	m_taskId;
-		uint32_t	m_commandId;
-		uint32_t	m_status;
-
-		PosixThreadFunc	m_userThreadFunc;
-		void*	m_userPtr; //for taskDesc etc
-		void*	m_lsMemory; //initialized using PosixLocalStoreMemorySetupFunc
-
-                pthread_t thread;
-                sem_t* startSemaphore;
-
-        unsigned long threadUsed;
-	};
-private:
-
-	btAlignedObjectArray<btSpuStatus>	m_activeSpuStatus;
-public:
-	///Setup and initialize SPU/CELL/Libspe2
-
-	
-
-	struct	ThreadConstructionInfo
-	{
-		ThreadConstructionInfo(char* uniqueName,
-									PosixThreadFunc userThreadFunc,
-									PosixlsMemorySetupFunc	lsMemoryFunc,
-									int numThreads=1,
-									int threadStackSize=65535
-									)
-									:m_uniqueName(uniqueName),
-									m_userThreadFunc(userThreadFunc),
-									m_lsMemoryFunc(lsMemoryFunc),
-									m_numThreads(numThreads),
-									m_threadStackSize(threadStackSize)
-		{
-
-		}
-
-		char*					m_uniqueName;
-		PosixThreadFunc			m_userThreadFunc;
-		PosixlsMemorySetupFunc	m_lsMemoryFunc;
-		int						m_numThreads;
-		int						m_threadStackSize;
-
-	};
-
-	PosixThreadSupport(ThreadConstructionInfo& threadConstructionInfo);
-
-///cleanup/shutdown Libspe2
-	virtual	~PosixThreadSupport();
-
-	void	startThreads(ThreadConstructionInfo&	threadInfo);
-
-
-///send messages to SPUs
-	virtual	void sendRequest(uint32_t uiCommand, ppu_address_t uiArgument0, uint32_t uiArgument1);
-
-///check for messages from SPUs
-	virtual	void waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1);
-
-///start the spus (can be called at the beginning of each frame, to make sure that the right SPU program is loaded)
-	virtual	void startSPU();
-
-///tell the task scheduler we are done with the SPU tasks
-	virtual	void stopSPU();
-
-	virtual void setNumTasks(int numTasks) {}
-
-	virtual int getNumTasks() const
-	{
-		return m_activeSpuStatus.size();
-	}
-
-	virtual btBarrier* createBarrier();
-
-	virtual btCriticalSection* createCriticalSection();
-	
-	virtual void*	getThreadLocalMemory(int taskId)
-	{
-		return m_activeSpuStatus[taskId].m_lsMemory;
-	}
-
-};
-
-#endif // USE_PTHREADS
-
-#endif // BT_POSIX_THREAD_SUPPORT_H
-
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/PpuAddressSpace.h b/hkl3d/bullet/src/BulletMultiThreaded/PpuAddressSpace.h
deleted file mode 100644
index 6f22827..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/PpuAddressSpace.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2010 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef BT_PPU_ADDRESS_SPACE_H
-#define BT_PPU_ADDRESS_SPACE_H
-
-
-#ifdef _WIN32
-//stop those casting warnings until we have a better solution for ppu_address_t / void* / uint64 conversions
-#pragma warning (disable: 4311)
-#pragma warning (disable: 4312)
-#endif //_WIN32
-
-
-#if defined(_WIN64)
-	typedef unsigned __int64 ppu_address_t;
-#elif defined(__LP64__) || defined(__x86_64__)
-	typedef uint64_t ppu_address_t;
-#else
-	typedef uint32_t ppu_address_t;
-#endif //defined(_WIN64)
-
-#endif //BT_PPU_ADDRESS_SPACE_H
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SequentialThreadSupport.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SequentialThreadSupport.cpp
deleted file mode 100644
index 8cc7241..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SequentialThreadSupport.cpp
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SequentialThreadSupport.h"
-
-
-#include "SpuCollisionTaskProcess.h"
-#include "SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h"
-
-SequentialThreadSupport::SequentialThreadSupport(SequentialThreadConstructionInfo& threadConstructionInfo)
-{
-	startThreads(threadConstructionInfo);
-}
-
-///cleanup/shutdown Libspe2
-SequentialThreadSupport::~SequentialThreadSupport()
-{
-	stopSPU();
-}
-
-#include <stdio.h>
-
-///send messages to SPUs
-void SequentialThreadSupport::sendRequest(uint32_t uiCommand, ppu_address_t uiArgument0, uint32_t taskId)
-{
-	switch (uiCommand)
-	{
-	case 	CMD_GATHER_AND_PROCESS_PAIRLIST:
-		{
-			btSpuStatus&	spuStatus = m_activeSpuStatus[0];
-			spuStatus.m_userPtr=(void*)uiArgument0;
-			spuStatus.m_userThreadFunc(spuStatus.m_userPtr,spuStatus.m_lsMemory);
-		}
-	break;
-	default:
-		{
-			///not implemented
-			btAssert(0 && "Not implemented");
-		}
-
-	};
-
-
-}
-
-///check for messages from SPUs
-void SequentialThreadSupport::waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1)
-{
-	btAssert(m_activeSpuStatus.size());
-	btSpuStatus& spuStatus = m_activeSpuStatus[0];
-	*puiArgument0 = spuStatus.m_taskId;
-	*puiArgument1 = spuStatus.m_status;
-}
-
-void SequentialThreadSupport::startThreads(SequentialThreadConstructionInfo& threadConstructionInfo)
-{
-	m_activeSpuStatus.resize(1);
-	printf("STS: Not starting any threads\n");
-	btSpuStatus& spuStatus = m_activeSpuStatus[0];
-	spuStatus.m_userPtr = 0;
-	spuStatus.m_taskId = 0;
-	spuStatus.m_commandId = 0;
-	spuStatus.m_status = 0;
-	spuStatus.m_lsMemory = threadConstructionInfo.m_lsMemoryFunc();
-	spuStatus.m_userThreadFunc = threadConstructionInfo.m_userThreadFunc;
-	printf("STS: Created local store at %p for task %s\n", spuStatus.m_lsMemory, threadConstructionInfo.m_uniqueName);
-}
-
-void SequentialThreadSupport::startSPU()
-{
-}
-
-void SequentialThreadSupport::stopSPU()
-{
-	m_activeSpuStatus.clear();
-}
-
-void SequentialThreadSupport::setNumTasks(int numTasks)
-{
-	printf("SequentialThreadSupport::setNumTasks(%d) is not implemented and has no effect\n",numTasks);
-}
-
-
-
-
-class btDummyBarrier : public btBarrier
-{
-private:
-		
-public:
-	btDummyBarrier()
-	{
-	}
-	
-	virtual ~btDummyBarrier()
-	{
-	}
-	
-	void sync()
-	{
-	}
-	
-	virtual void setMaxCount(int n) {}
-	virtual int  getMaxCount() {return 1;}
-};
-
-class btDummyCriticalSection : public btCriticalSection
-{
-	
-public:
-	btDummyCriticalSection()
-	{
-	}
-	
-	virtual ~btDummyCriticalSection()
-	{
-	}
-	
-	unsigned int getSharedParam(int i)
-	{
-		btAssert(i>=0&&i<31);
-		return mCommonBuff[i+1];
-	}
-	
-	void setSharedParam(int i,unsigned int p)
-	{
-		btAssert(i>=0&&i<31);
-		mCommonBuff[i+1] = p;
-	}
-	
-	void lock()
-	{
-		mCommonBuff[0] = 1;
-	}
-	
-	void unlock()
-	{
-		mCommonBuff[0] = 0;
-	}
-};
-
-
-
-
-btBarrier*	SequentialThreadSupport::createBarrier()
-{
-	return new btDummyBarrier();
-}
-
-btCriticalSection* SequentialThreadSupport::createCriticalSection()
-{
-	return new btDummyCriticalSection();
-	
-}
-
-
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SequentialThreadSupport.h b/hkl3d/bullet/src/BulletMultiThreaded/SequentialThreadSupport.h
deleted file mode 100644
index c750f7f..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SequentialThreadSupport.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "LinearMath/btScalar.h"
-#include "PlatformDefinitions.h"
-
-
-#ifndef BT_SEQUENTIAL_THREAD_SUPPORT_H
-#define BT_SEQUENTIAL_THREAD_SUPPORT_H
-
-#include "LinearMath/btAlignedObjectArray.h"
-
-#include "btThreadSupportInterface.h"
-
-typedef void (*SequentialThreadFunc)(void* userPtr,void* lsMemory);
-typedef void* (*SequentiallsMemorySetupFunc)();
-
-
-
-///The SequentialThreadSupport is a portable non-parallel implementation of the btThreadSupportInterface
-///This is useful for debugging and porting SPU Tasks to other platforms.
-class SequentialThreadSupport : public btThreadSupportInterface 
-{
-public:
-	struct	btSpuStatus
-	{
-		uint32_t	m_taskId;
-		uint32_t	m_commandId;
-		uint32_t	m_status;
-
-		SequentialThreadFunc	m_userThreadFunc;
-
-		void*	m_userPtr; //for taskDesc etc
-		void*	m_lsMemory; //initialized using SequentiallsMemorySetupFunc
-	};
-private:
-	btAlignedObjectArray<btSpuStatus>	m_activeSpuStatus;
-	btAlignedObjectArray<void*>			m_completeHandles;	
-public:
-	struct	SequentialThreadConstructionInfo
-	{
-		SequentialThreadConstructionInfo (char* uniqueName,
-									SequentialThreadFunc userThreadFunc,
-									SequentiallsMemorySetupFunc	lsMemoryFunc
-									)
-									:m_uniqueName(uniqueName),
-									m_userThreadFunc(userThreadFunc),
-									m_lsMemoryFunc(lsMemoryFunc)
-		{
-
-		}
-
-		char*						m_uniqueName;
-		SequentialThreadFunc		m_userThreadFunc;
-		SequentiallsMemorySetupFunc	m_lsMemoryFunc;
-	};
-
-	SequentialThreadSupport(SequentialThreadConstructionInfo& threadConstructionInfo);
-	virtual	~SequentialThreadSupport();
-	void	startThreads(SequentialThreadConstructionInfo&	threadInfo);
-///send messages to SPUs
-	virtual	void sendRequest(uint32_t uiCommand, ppu_address_t uiArgument0, uint32_t uiArgument1);
-///check for messages from SPUs
-	virtual	void waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1);
-///start the spus (can be called at the beginning of each frame, to make sure that the right SPU program is loaded)
-	virtual	void startSPU();
-///tell the task scheduler we are done with the SPU tasks
-	virtual	void stopSPU();
-
-	virtual void setNumTasks(int numTasks);
-
-	virtual int getNumTasks() const
-	{
-		return 1;
-	}
-	virtual btBarrier*	createBarrier();
-
-	virtual btCriticalSection* createCriticalSection();
-	
-
-};
-
-#endif //BT_SEQUENTIAL_THREAD_SUPPORT_H
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionObjectWrapper.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionObjectWrapper.cpp
deleted file mode 100644
index 182aa26..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionObjectWrapper.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SpuCollisionObjectWrapper.h"
-#include "BulletCollision/CollisionShapes/btCollisionShape.h"
-
-SpuCollisionObjectWrapper::SpuCollisionObjectWrapper ()
-{
-}
-
-#ifndef __SPU__
-SpuCollisionObjectWrapper::SpuCollisionObjectWrapper (const btCollisionObject* collisionObject)
-{
-	m_shapeType = collisionObject->getCollisionShape()->getShapeType ();
-	m_collisionObjectPtr = (ppu_address_t)collisionObject;
-	m_margin = collisionObject->getCollisionShape()->getMargin ();
-}
-#endif
-
-int
-SpuCollisionObjectWrapper::getShapeType () const
-{
-	return m_shapeType;
-}
-
-float
-SpuCollisionObjectWrapper::getCollisionMargin () const
-{
-	return m_margin;
-}
-
-ppu_address_t
-SpuCollisionObjectWrapper::getCollisionObjectPtr () const
-{
-	return m_collisionObjectPtr;
-}
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionObjectWrapper.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionObjectWrapper.h
deleted file mode 100644
index f90da27..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionObjectWrapper.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_SPU_COLLISION_OBJECT_WRAPPER_H
-#define BT_SPU_COLLISION_OBJECT_WRAPPER_H
-
-#include "PlatformDefinitions.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-
-ATTRIBUTE_ALIGNED16(class) SpuCollisionObjectWrapper
-{
-protected:
-	int m_shapeType;
-	float m_margin;
-	ppu_address_t m_collisionObjectPtr;
-
-public:
-	SpuCollisionObjectWrapper ();
-
-	SpuCollisionObjectWrapper (const btCollisionObject* collisionObject);
-
-	int           getShapeType () const;
-	float         getCollisionMargin () const;
-	ppu_address_t getCollisionObjectPtr () const;
-};
-
-
-#endif //BT_SPU_COLLISION_OBJECT_WRAPPER_H
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionTaskProcess.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionTaskProcess.cpp
deleted file mode 100644
index f606d13..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionTaskProcess.cpp
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-//#define DEBUG_SPU_TASK_SCHEDULING 1
-
-
-//class OptimizedBvhNode;
-
-#include "SpuCollisionTaskProcess.h"
-
-
-
-
-void	SpuCollisionTaskProcess::setNumTasks(int maxNumTasks)
-{
-	if (int(m_maxNumOutstandingTasks) != maxNumTasks)
-	{
-		m_maxNumOutstandingTasks = maxNumTasks;
-		m_taskBusy.resize(m_maxNumOutstandingTasks);
-		m_spuGatherTaskDesc.resize(m_maxNumOutstandingTasks);
-
-		for (int i = 0; i < m_taskBusy.size(); i++)
-		{
-			m_taskBusy[i] = false;
-		}
-
-		///re-allocate task memory buffers
-		if (m_workUnitTaskBuffers != 0)
-		{
-			btAlignedFree(m_workUnitTaskBuffers);
-		}
-		
-		m_workUnitTaskBuffers = (unsigned char *)btAlignedAlloc(MIDPHASE_WORKUNIT_TASK_SIZE*m_maxNumOutstandingTasks, 128);
-	}
-	
-}
-
-
-
-SpuCollisionTaskProcess::SpuCollisionTaskProcess(class	btThreadSupportInterface*	threadInterface, unsigned int	maxNumOutstandingTasks)
-:m_threadInterface(threadInterface),
-m_maxNumOutstandingTasks(0)
-{
-	m_workUnitTaskBuffers = (unsigned char *)0;
-	setNumTasks(maxNumOutstandingTasks);
-	m_numBusyTasks = 0;
-	m_currentTask = 0;
-	m_currentPage = 0;
-	m_currentPageEntry = 0;
-
-#ifdef DEBUG_SpuCollisionTaskProcess
-	m_initialized = false;
-#endif
-
-	m_threadInterface->startSPU();
-
-	//printf("sizeof vec_float4: %d\n", sizeof(vec_float4));
-	printf("sizeof SpuGatherAndProcessWorkUnitInput: %d\n", int(sizeof(SpuGatherAndProcessWorkUnitInput)));
-
-}
-
-SpuCollisionTaskProcess::~SpuCollisionTaskProcess()
-{
-	
-	if (m_workUnitTaskBuffers != 0)
-	{
-		btAlignedFree(m_workUnitTaskBuffers);
-		m_workUnitTaskBuffers = 0;
-	}
-	
-
-
-	m_threadInterface->stopSPU();
-	
-}
-
-
-
-void SpuCollisionTaskProcess::initialize2(bool useEpa)
-{
-
-#ifdef DEBUG_SPU_TASK_SCHEDULING
-	printf("SpuCollisionTaskProcess::initialize()\n");
-#endif //DEBUG_SPU_TASK_SCHEDULING
-	
-	for (int i = 0; i < int (m_maxNumOutstandingTasks); i++)
-	{
-		m_taskBusy[i] = false;
-	}
-	m_numBusyTasks = 0;
-	m_currentTask = 0;
-	m_currentPage = 0;
-	m_currentPageEntry = 0;
-	m_useEpa = useEpa;
-
-#ifdef DEBUG_SpuCollisionTaskProcess
-	m_initialized = true;
-	btAssert(MIDPHASE_NUM_WORKUNITS_PER_TASK*sizeof(SpuGatherAndProcessWorkUnitInput) <= MIDPHASE_WORKUNIT_TASK_SIZE);
-#endif
-}
-
-
-void SpuCollisionTaskProcess::issueTask2()
-{
-
-#ifdef DEBUG_SPU_TASK_SCHEDULING
-	printf("SpuCollisionTaskProcess::issueTask (m_currentTask= %d\n)", m_currentTask);
-#endif //DEBUG_SPU_TASK_SCHEDULING
-
-	m_taskBusy[m_currentTask] = true;
-	m_numBusyTasks++;
-
-
-	SpuGatherAndProcessPairsTaskDesc& taskDesc = m_spuGatherTaskDesc[m_currentTask];
-	taskDesc.m_useEpa = m_useEpa;
-
-	{
-		// send task description in event message
-		// no error checking here...
-		// but, currently, event queue can be no larger than NUM_WORKUNIT_TASKS.
-	
-		taskDesc.m_inPairPtr = reinterpret_cast<uint64_t>(MIDPHASE_TASK_PTR(m_currentTask));
-	
-		taskDesc.taskId = m_currentTask;
-		taskDesc.numPages = m_currentPage+1;
-		taskDesc.numOnLastPage = m_currentPageEntry;
-	}
-
-
-
-	m_threadInterface->sendRequest(CMD_GATHER_AND_PROCESS_PAIRLIST, (ppu_address_t) &taskDesc,m_currentTask);
-
-	// if all tasks busy, wait for spu event to clear the task.
-	
-
-	if (m_numBusyTasks >= m_maxNumOutstandingTasks)
-	{
-		unsigned int taskId;
-		unsigned int outputSize;
-
-		
-		for (int i=0;i<int (m_maxNumOutstandingTasks);i++)
-		  {
-			  if (m_taskBusy[i])
-			  {
-				  taskId = i;
-				  break;
-			  }
-		  }
-
-	  btAssert(taskId>=0);
-
-	  
-		m_threadInterface->waitForResponse(&taskId, &outputSize);
-
-//		printf("issueTask taskId %d completed, numBusy=%d\n",taskId,m_numBusyTasks);
-
-		//printf("PPU: after issue, received event: %u %d\n", taskId, outputSize);
-
-		//postProcess(taskId, outputSize);
-
-		m_taskBusy[taskId] = false;
-
-		m_numBusyTasks--;
-	}
-	
-}
-
-void SpuCollisionTaskProcess::addWorkToTask(void* pairArrayPtr,int startIndex,int endIndex)
-{
-#ifdef DEBUG_SPU_TASK_SCHEDULING
-	printf("#");
-#endif //DEBUG_SPU_TASK_SCHEDULING
-	
-#ifdef DEBUG_SpuCollisionTaskProcess
-	btAssert(m_initialized);
-	btAssert(m_workUnitTaskBuffers);
-
-#endif
-
-	bool batch = true;
-
-	if (batch)
-	{
-		if (m_currentPageEntry == MIDPHASE_NUM_WORKUNITS_PER_PAGE)
-		{
-			if (m_currentPage == MIDPHASE_NUM_WORKUNIT_PAGES-1)
-			{
-				// task buffer is full, issue current task.
-				// if all task buffers busy, this waits until SPU is done.
-				issueTask2();
-
-				// find new task buffer
-				for (unsigned int i = 0; i < m_maxNumOutstandingTasks; i++)
-				{
-					if (!m_taskBusy[i])
-					{
-						m_currentTask = i;
-						//init the task data
-
-						break;
-					}
-				}
-
-				m_currentPage = 0;
-			}
-			else
-			{
-				m_currentPage++;
-			}
-
-			m_currentPageEntry = 0;
-		}
-	}
-
-	{
-
-
-
-		SpuGatherAndProcessWorkUnitInput &wuInput = 
-			*(reinterpret_cast<SpuGatherAndProcessWorkUnitInput*>
-			(MIDPHASE_ENTRY_PTR(m_currentTask, m_currentPage, m_currentPageEntry)));
-		
-		wuInput.m_pairArrayPtr = reinterpret_cast<uint64_t>(pairArrayPtr);
-		wuInput.m_startIndex = startIndex;
-		wuInput.m_endIndex = endIndex;
-
-		
-	
-		m_currentPageEntry++;
-
-		if (!batch)
-		{
-			issueTask2();
-
-			// find new task buffer
-			for (unsigned int i = 0; i < m_maxNumOutstandingTasks; i++)
-			{
-				if (!m_taskBusy[i])
-				{
-					m_currentTask = i;
-					//init the task data
-
-					break;
-				}
-			}
-
-			m_currentPage = 0;
-			m_currentPageEntry =0;
-		}
-	}
-}
-
-
-void 
-SpuCollisionTaskProcess::flush2()
-{
-#ifdef DEBUG_SPU_TASK_SCHEDULING
-	printf("\nSpuCollisionTaskProcess::flush()\n");
-#endif //DEBUG_SPU_TASK_SCHEDULING
-	
-	// if there's a partially filled task buffer, submit that task
-	if (m_currentPage > 0 || m_currentPageEntry > 0)
-	{
-		issueTask2();
-	}
-
-
-	// all tasks are issued, wait for all tasks to be complete
-	while(m_numBusyTasks > 0)
-	{
-	  // Consolidating SPU code
-	  unsigned int taskId=-1;
-	  unsigned int outputSize;
-	  
-	  for (int i=0;i<int (m_maxNumOutstandingTasks);i++)
-	  {
-		  if (m_taskBusy[i])
-		  {
-			  taskId = i;
-			  break;
-		  }
-	  }
-
-	  btAssert(taskId>=0);
-
-	
-	  {
-			
-		// SPURS support.
-		  m_threadInterface->waitForResponse(&taskId, &outputSize);
-	  }
-//		 printf("flush2 taskId %d completed, numBusy =%d \n",taskId,m_numBusyTasks);
-		//printf("PPU: flushing, received event: %u %d\n", taskId, outputSize);
-
-		//postProcess(taskId, outputSize);
-
-		m_taskBusy[taskId] = false;
-
-		m_numBusyTasks--;
-	}
-
-
-}
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionTaskProcess.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionTaskProcess.h
deleted file mode 100644
index 23b5b05..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionTaskProcess.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_SPU_COLLISION_TASK_PROCESS_H
-#define BT_SPU_COLLISION_TASK_PROCESS_H
-
-#include <assert.h>
-
-#include "LinearMath/btScalar.h"
-
-#include "PlatformDefinitions.h"
-#include "LinearMath/btAlignedObjectArray.h"
-#include "SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h" // for definitions processCollisionTask and createCollisionLocalStoreMemory
-
-#include "btThreadSupportInterface.h"
-
-
-//#include "SPUAssert.h"
-#include <string.h>
-
-
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-#include "BulletCollision/CollisionShapes/btCollisionShape.h"
-#include "BulletCollision/CollisionShapes/btConvexShape.h"
-
-#include "LinearMath/btAlignedAllocator.h"
-
-#include <stdio.h>
-
-
-#define DEBUG_SpuCollisionTaskProcess 1
-
-
-#define CMD_GATHER_AND_PROCESS_PAIRLIST	1
-
-class btCollisionObject;
-class btPersistentManifold;
-class btDispatcher;
-
-
-/////Task Description for SPU collision detection
-//struct SpuGatherAndProcessPairsTaskDesc
-//{
-//	uint64_t	inPtr;//m_pairArrayPtr;
-//	//mutex variable
-//	uint32_t	m_someMutexVariableInMainMemory;
-//
-//	uint64_t	m_dispatcher;
-//
-//	uint32_t	numOnLastPage;
-//
-//	uint16_t numPages;
-//	uint16_t taskId;
-//
-//	struct	CollisionTask_LocalStoreMemory*	m_lsMemory; 
-//}
-//
-//#if  defined(__CELLOS_LV2__) || defined(USE_LIBSPE2)
-//__attribute__ ((aligned (16)))
-//#endif
-//;
-
-
-///MidphaseWorkUnitInput stores individual primitive versus mesh collision detection input, to be processed by the SPU.
-ATTRIBUTE_ALIGNED16(struct) SpuGatherAndProcessWorkUnitInput
-{
-	uint64_t m_pairArrayPtr;
-	int		m_startIndex;
-	int		m_endIndex;
-};
-
-
-
-
-/// SpuCollisionTaskProcess handles SPU processing of collision pairs.
-/// Maintains a set of task buffers.
-/// When the task is full, the task is issued for SPUs to process.  Contact output goes into btPersistentManifold
-/// associated with each task.
-/// When PPU issues a task, it will look for completed task buffers
-/// PPU will do postprocessing, dependent on workunit output (not likely)
-class SpuCollisionTaskProcess
-{
-
-  unsigned char  *m_workUnitTaskBuffers;
-
-
-	// track task buffers that are being used, and total busy tasks
-	btAlignedObjectArray<bool>	m_taskBusy;
-	btAlignedObjectArray<SpuGatherAndProcessPairsTaskDesc>	m_spuGatherTaskDesc;
-
-	class	btThreadSupportInterface*	m_threadInterface;
-
-	unsigned int	m_maxNumOutstandingTasks;
-
-	unsigned int   m_numBusyTasks;
-
-	// the current task and the current entry to insert a new work unit
-	unsigned int   m_currentTask;
-	unsigned int   m_currentPage;
-	unsigned int   m_currentPageEntry;
-
-	bool m_useEpa;
-
-#ifdef DEBUG_SpuCollisionTaskProcess
-	bool m_initialized;
-#endif
-	void issueTask2();
-	//void postProcess(unsigned int taskId, int outputSize);
-
-public:
-	SpuCollisionTaskProcess(btThreadSupportInterface*	threadInterface, unsigned int maxNumOutstandingTasks);
-	
-	~SpuCollisionTaskProcess();
-	
-	///call initialize in the beginning of the frame, before addCollisionPairToTask
-	void initialize2(bool useEpa = false);
-
-	///batch up additional work to a current task for SPU processing. When batch is full, it issues the task.
-	void addWorkToTask(void* pairArrayPtr,int startIndex,int endIndex);
-
-	///call flush to submit potential outstanding work to SPUs and wait for all involved SPUs to be finished
-	void flush2();
-
-	/// set the maximum number of SPU tasks allocated
-	void	setNumTasks(int maxNumTasks);
-
-	int		getNumTasks() const
-	{
-		return m_maxNumOutstandingTasks;
-	}
-};
-
-
-
-#define MIDPHASE_TASK_PTR(task) (&m_workUnitTaskBuffers[0] + MIDPHASE_WORKUNIT_TASK_SIZE*task)
-#define MIDPHASE_ENTRY_PTR(task,page,entry) (MIDPHASE_TASK_PTR(task) + MIDPHASE_WORKUNIT_PAGE_SIZE*page + sizeof(SpuGatherAndProcessWorkUnitInput)*entry)
-#define MIDPHASE_OUTPUT_PTR(task) (&m_contactOutputBuffers[0] + MIDPHASE_MAX_CONTACT_BUFFER_SIZE*task)
-#define MIDPHASE_TREENODES_PTR(task) (&m_complexShapeBuffers[0] + MIDPHASE_COMPLEX_SHAPE_BUFFER_SIZE*task)
-
-
-#define MIDPHASE_WORKUNIT_PAGE_SIZE (16)
-//#define MIDPHASE_WORKUNIT_PAGE_SIZE (128)
-
-#define MIDPHASE_NUM_WORKUNIT_PAGES 1
-#define MIDPHASE_WORKUNIT_TASK_SIZE (MIDPHASE_WORKUNIT_PAGE_SIZE*MIDPHASE_NUM_WORKUNIT_PAGES)
-#define MIDPHASE_NUM_WORKUNITS_PER_PAGE (MIDPHASE_WORKUNIT_PAGE_SIZE / sizeof(SpuGatherAndProcessWorkUnitInput))
-#define MIDPHASE_NUM_WORKUNITS_PER_TASK (MIDPHASE_NUM_WORKUNITS_PER_PAGE*MIDPHASE_NUM_WORKUNIT_PAGES)
-
-
-#endif // BT_SPU_COLLISION_TASK_PROCESS_H
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp
deleted file mode 100644
index 286b631..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SpuContactManifoldCollisionAlgorithm.h"
-#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-#include "BulletCollision/CollisionShapes/btCollisionShape.h"
-#include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h"
-
-
-
-
-void SpuContactManifoldCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-	btAssert(0);
-}
-
-btScalar SpuContactManifoldCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
-{
-	btAssert(0);
-	return 1.f;
-}
-
-#ifndef __SPU__
-SpuContactManifoldCollisionAlgorithm::SpuContactManifoldCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1)
-:btCollisionAlgorithm(ci)
-#ifdef USE_SEPDISTANCE_UTIL
-,m_sepDistance(body0->getCollisionShape()->getAngularMotionDisc(),body1->getCollisionShape()->getAngularMotionDisc())
-#endif //USE_SEPDISTANCE_UTIL
-{
-	m_manifoldPtr = m_dispatcher->getNewManifold(body0,body1);
-	m_shapeType0 = body0->getCollisionShape()->getShapeType();
-	m_shapeType1 = body1->getCollisionShape()->getShapeType();
-	m_collisionMargin0 = body0->getCollisionShape()->getMargin();
-	m_collisionMargin1 = body1->getCollisionShape()->getMargin();
-	m_collisionObject0 = body0;
-	m_collisionObject1 = body1;
-
-	if (body0->getCollisionShape()->isPolyhedral())
-	{
-		btPolyhedralConvexShape* convex0 = (btPolyhedralConvexShape*)body0->getCollisionShape();
-		m_shapeDimensions0 = convex0->getImplicitShapeDimensions();
-	}
-	if (body1->getCollisionShape()->isPolyhedral())
-	{
-		btPolyhedralConvexShape* convex1 = (btPolyhedralConvexShape*)body1->getCollisionShape();
-		m_shapeDimensions1 = convex1->getImplicitShapeDimensions();
-	}
-}
-#endif //__SPU__
-
-
-SpuContactManifoldCollisionAlgorithm::~SpuContactManifoldCollisionAlgorithm()
-{
-	if (m_manifoldPtr)
-			m_dispatcher->releaseManifold(m_manifoldPtr);
-}
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.h
deleted file mode 100644
index d28d4db..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_SPU_CONTACTMANIFOLD_COLLISION_ALGORITHM_H
-#define BT_SPU_CONTACTMANIFOLD_COLLISION_ALGORITHM_H
-
-#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"
-#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
-#include "LinearMath/btTransformUtil.h"
-
-class btPersistentManifold;
-
-//#define USE_SEPDISTANCE_UTIL 1
-
-/// SpuContactManifoldCollisionAlgorithm  provides contact manifold and should be processed on SPU.
-ATTRIBUTE_ALIGNED16(class) SpuContactManifoldCollisionAlgorithm : public btCollisionAlgorithm
-{
-	btVector3	m_shapeDimensions0;
-	btVector3	m_shapeDimensions1;
-	btPersistentManifold*	m_manifoldPtr;
-	int		m_shapeType0;
-	int		m_shapeType1;
-	float	m_collisionMargin0;
-	float	m_collisionMargin1;
-
-	btCollisionObject*	m_collisionObject0;
-	btCollisionObject*	m_collisionObject1;
-	
-	
-
-	
-public:
-	
-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
-
-	
-	SpuContactManifoldCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1);
-#ifdef USE_SEPDISTANCE_UTIL
-	btConvexSeparatingDistanceUtil	m_sepDistance;
-#endif //USE_SEPDISTANCE_UTIL
-
-	virtual ~SpuContactManifoldCollisionAlgorithm();
-
-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
-	{
-		if (m_manifoldPtr)
-			manifoldArray.push_back(m_manifoldPtr);
-	}
-
-	btPersistentManifold*	getContactManifoldPtr()
-	{
-		return m_manifoldPtr;
-	}
-
-	btCollisionObject*	getCollisionObject0()
-	{
-		return m_collisionObject0;
-	}
-	
-	btCollisionObject*	getCollisionObject1()
-	{
-		return m_collisionObject1;
-	}
-
-	int		getShapeType0() const
-	{
-		return m_shapeType0;
-	}
-
-	int		getShapeType1() const
-	{
-		return m_shapeType1;
-	}
-	float	getCollisionMargin0() const
-	{
-		return m_collisionMargin0;
-	}
-	float	getCollisionMargin1() const
-	{
-		return m_collisionMargin1;
-	}
-
-	const btVector3&	getShapeDimensions0() const
-	{
-		return m_shapeDimensions0;
-	}
-
-	const btVector3&	getShapeDimensions1() const
-	{
-		return m_shapeDimensions1;
-	}
-
-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
-	{
-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
-		{
-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(SpuContactManifoldCollisionAlgorithm));
-			return new(mem) SpuContactManifoldCollisionAlgorithm(ci,body0,body1);
-		}
-	};
-
-};
-
-#endif //BT_SPU_CONTACTMANIFOLD_COLLISION_ALGORITHM_H
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuDoubleBuffer.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuDoubleBuffer.h
deleted file mode 100644
index 558d615..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuDoubleBuffer.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef BT_DOUBLE_BUFFER_H
-#define BT_DOUBLE_BUFFER_H
-
-#include "SpuFakeDma.h"
-#include "LinearMath/btScalar.h"
-
-
-///DoubleBuffer
-template<class T, int size>
-class DoubleBuffer
-{
-#if defined(__SPU__) || defined(USE_LIBSPE2)
-	ATTRIBUTE_ALIGNED128( T m_buffer0[size] ) ;
-	ATTRIBUTE_ALIGNED128( T m_buffer1[size] ) ;
-#else
-	T m_buffer0[size];
-	T m_buffer1[size];
-#endif
-	
-	T *m_frontBuffer;
-	T *m_backBuffer;
-
-	unsigned int m_dmaTag;
-	bool m_dmaPending;
-public:
-	bool	isPending() const { return m_dmaPending;}
-	DoubleBuffer();
-
-	void init ();
-
-	// dma get and put commands
-	void backBufferDmaGet(uint64_t ea, unsigned int numBytes, unsigned int tag);
-	void backBufferDmaPut(uint64_t ea, unsigned int numBytes, unsigned int tag);
-
-	// gets pointer to a buffer
-	T *getFront();
-	T *getBack();
-
-	// if back buffer dma was started, wait for it to complete
-	// then move back to front and vice versa
-	T *swapBuffers();
-};
-
-template<class T, int size>
-DoubleBuffer<T,size>::DoubleBuffer()
-{
-	init ();
-}
-
-template<class T, int size>
-void DoubleBuffer<T,size>::init()
-{
-	this->m_dmaPending = false;
-	this->m_frontBuffer = &this->m_buffer0[0];
-	this->m_backBuffer = &this->m_buffer1[0];
-}
-
-template<class T, int size>
-void
-DoubleBuffer<T,size>::backBufferDmaGet(uint64_t ea, unsigned int numBytes, unsigned int tag)
-{
-	m_dmaPending = true;
-	m_dmaTag = tag;
-	if (numBytes)
-	{
-		m_backBuffer = (T*)cellDmaLargeGetReadOnly(m_backBuffer, ea, numBytes, tag, 0, 0);
-	}
-}
-
-template<class T, int size>
-void
-DoubleBuffer<T,size>::backBufferDmaPut(uint64_t ea, unsigned int numBytes, unsigned int tag)
-{
-	m_dmaPending = true;
-	m_dmaTag = tag;
-	cellDmaLargePut(m_backBuffer, ea, numBytes, tag, 0, 0);
-}
-
-template<class T, int size>
-T *
-DoubleBuffer<T,size>::getFront()
-{
-	return m_frontBuffer;
-}
-
-template<class T, int size>
-T *
-DoubleBuffer<T,size>::getBack()
-{
-	return m_backBuffer;
-}
-
-template<class T, int size>
-T *
-DoubleBuffer<T,size>::swapBuffers()
-{
-	if (m_dmaPending)
-	{
-		cellDmaWaitTagStatusAll(1<<m_dmaTag);
-		m_dmaPending = false;
-	}
-
-	T *tmp = m_backBuffer;
-	m_backBuffer = m_frontBuffer;
-	m_frontBuffer = tmp;
-
-	return m_frontBuffer;
-}
-
-#endif
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuFakeDma.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuFakeDma.cpp
deleted file mode 100644
index b776a12..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuFakeDma.cpp
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SpuFakeDma.h"
-#include <LinearMath/btScalar.h> //for btAssert
-//Disabling memcpy sometimes helps debugging DMA
-
-#define USE_MEMCPY 1
-#ifdef USE_MEMCPY
-
-#endif
-
-
-void*	cellDmaLargeGetReadOnly(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid)
-{
-
-#if defined (__SPU__) || defined (USE_LIBSPE2)
-	cellDmaLargeGet(ls,ea,size,tag,tid,rid);
-	return ls;
-#else
-	return (void*)(ppu_address_t)ea;
-#endif
-}
-
-void*	cellDmaSmallGetReadOnly(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid)
-{
-#if defined (__SPU__) || defined (USE_LIBSPE2)
-	mfc_get(ls,ea,size,tag,0,0);
-	return ls;
-#else
-	return (void*)(ppu_address_t)ea;
-#endif
-}
-
-
-
-
-void*	cellDmaGetReadOnly(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid)
-{
-#if defined (__SPU__) || defined (USE_LIBSPE2)
-	cellDmaGet(ls,ea,size,tag,tid,rid);
-	return ls;
-#else
-	return (void*)(ppu_address_t)ea;
-#endif
-}
-
-
-///this unalignedDma should not be frequently used, only for small data. It handles alignment and performs check on size (<16 bytes)
-int stallingUnalignedDmaSmallGet(void *ls, uint64_t ea, uint32_t size)
-{
-	
-	btAssert(size<32);
-	
-	ATTRIBUTE_ALIGNED16(char	tmpBuffer[32]);
-
-
-	char* localStore = (char*)ls;
-	uint32_t i;
-	
-
-	///make sure last 4 bits are the same, for cellDmaSmallGet
-	uint32_t last4BitsOffset = ea & 0x0f;
-	char* tmpTarget = tmpBuffer + last4BitsOffset;
-	
-#if defined (__SPU__) || defined (USE_LIBSPE2)
-	
-	int remainingSize = size;
-
-//#define FORCE_cellDmaUnalignedGet 1
-#ifdef FORCE_cellDmaUnalignedGet
-	cellDmaUnalignedGet(tmpTarget,ea,size,DMA_TAG(1),0,0);
-#else
-	char* remainingTmpTarget = tmpTarget;
-	uint64_t remainingEa = ea;
-
-	while (remainingSize)
-	{
-		switch (remainingSize)
-		{
-		case 1:
-		case 2:
-		case 4:
-		case 8:
-		case 16:
-			{
-				mfc_get(remainingTmpTarget,remainingEa,remainingSize,DMA_TAG(1),0,0);
-				remainingSize=0;
-				break;
-			}
-		default:
-			{
-				//spu_printf("unaligned DMA with non-natural size:%d\n",remainingSize);
-				int actualSize = 0;
-
-				if (remainingSize > 16)
-					actualSize = 16;
-				else
-					if (remainingSize >8)
-						actualSize=8;
-					else
-						if (remainingSize >4)
-							actualSize=4;
-						else
-							if (remainingSize >2)
-								actualSize=2;
-				mfc_get(remainingTmpTarget,remainingEa,actualSize,DMA_TAG(1),0,0);
-				remainingSize-=actualSize;
-				remainingTmpTarget+=actualSize;
-				remainingEa += actualSize;
-			}
-		}
-	}
-#endif//FORCE_cellDmaUnalignedGet
-
-#else
-	char* mainMem = (char*)ea;
-	//copy into final destination
-#ifdef USE_MEMCPY
-		
-		memcpy(tmpTarget,mainMem,size);
-#else
-		for ( i=0;i<size;i++)
-		{
-			tmpTarget[i] = mainMem[i];
-		}
-#endif //USE_MEMCPY
-
-#endif
-
-	cellDmaWaitTagStatusAll(DMA_MASK(1));
-
-	//this is slowish, perhaps memcpy on SPU is smarter?
-	for (i=0; btLikely( i<size );i++)
-	{
-		localStore[i] = tmpTarget[i];
-	}
-
-	return 0;
-}
-
-#if defined (__SPU__) || defined (USE_LIBSPE2)
-#else
-
-int	cellDmaLargeGet(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid)
-{
-	char* mainMem = (char*)ea;
-	char* localStore = (char*)ls;
-
-#ifdef USE_MEMCPY
-	memcpy(localStore,mainMem,size);
-#else
-	for (uint32_t i=0;i<size;i++)
-	{
-		localStore[i] = mainMem[i];
-	}
-#endif
-	return 0;
-}
-
-int	cellDmaGet(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid)
-{
-	char* mainMem = (char*)ea;
-	char* localStore = (char*)ls;
-
-//	printf("mainMem=%x, localStore=%x",mainMem,localStore);
-
-#ifdef USE_MEMCPY
-	memcpy(localStore,mainMem,size);
-#else
-	for (uint32_t i=0;i<size;i++)
-	{
-		localStore[i] = mainMem[i];
-	}	
-#endif //#ifdef USE_MEMCPY
-//	printf(" finished\n");
-	return 0;
-}
-
-int cellDmaLargePut(const void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid)
-{
-	char* mainMem = (char*)ea;
-	const char* localStore = (const char*)ls;
-#ifdef USE_MEMCPY
-	memcpy(mainMem,localStore,size);
-#else
-	for (uint32_t i=0;i<size;i++)
-	{
-		mainMem[i] = localStore[i];
-	}	
-#endif //#ifdef USE_MEMCPY
-
-	return 0;
-}
-
-
-
-void	cellDmaWaitTagStatusAll(int ignore)
-{
-
-}
-
-#endif
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuFakeDma.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuFakeDma.h
deleted file mode 100644
index 40e2039..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuFakeDma.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_FAKE_DMA_H
-#define BT_FAKE_DMA_H
-
-
-#include "PlatformDefinitions.h"
-#include "LinearMath/btScalar.h"
-
-
-#ifdef __SPU__
-
-#ifndef USE_LIBSPE2
-
-#include <cell/dma.h>
-#include <stdint.h>
-
-#define DMA_TAG(xfer) (xfer + 1)
-#define DMA_MASK(xfer) (1 << DMA_TAG(xfer))
-
-#else // !USE_LIBSPE2
-
-#define DMA_TAG(xfer) (xfer + 1)
-#define DMA_MASK(xfer) (1 << DMA_TAG(xfer))
-		
-#include <spu_mfcio.h>		
-		
-#define DEBUG_DMA		
-#ifdef DEBUG_DMA
-#define dUASSERT(a,b) if (!(a)) { printf(b);}
-#define uintsize ppu_address_t
-		
-#define cellDmaLargeGet(ls, ea, size, tag, tid, rid) if (  (((uintsize)ls%16) != ((uintsize)ea%16)) || ((((uintsize)ea%16) || ((uintsize)ls%16)) && (( ((uintsize)ls%16) != ((uintsize)size%16) ) || ( ((uintsize)ea%16) != ((uintsize)size%16) ) ) ) || ( ((uintsize)size%16) && ((uintsize)size!=1) && ((uintsize)size!=2) && ((uintsize)size!=4) && ((uintsize)size!=8) ) || (size >= 16384) || !(uintsize)ls || !(uintsize)ea) { \
-															dUASSERT( (((uintsize)ea % 16) == 0) || (size < 16), "XDR Address not aligned: "); \
-															dUASSERT( (((uintsize)ls % 16) == 0) || (size < 16), "LS Address not aligned: "); \
-															dUASSERT( ((((uintsize)ls % size) == 0) && (((uintsize)ea % size) == 0))  || (size > 16), "Not naturally aligned: "); \
-															dUASSERT((size == 1) || (size == 2) || (size == 4) || (size == 8) || ((size % 16) == 0), "size not a multiple of 16byte: "); \
-															dUASSERT(size < 16384, "size too big: "); \
-															dUASSERT( ((uintsize)ea%16)==((uintsize)ls%16), "wrong Quadword alignment of LS and EA: "); \
-	    													dUASSERT(ea != 0, "Nullpointer EA: "); dUASSERT(ls != 0, "Nullpointer LS: ");\
-															printf("GET %s:%d from: 0x%x, to: 0x%x - %d bytes\n", __FILE__, __LINE__, (unsigned int)ea,(unsigned int)ls,(unsigned int)size);\
-															} \
-															mfc_get(ls, ea, size, tag, tid, rid)
-#define cellDmaGet(ls, ea, size, tag, tid, rid) if (  (((uintsize)ls%16) != ((uintsize)ea%16)) || ((((uintsize)ea%16) || ((uintsize)ls%16)) && (( ((uintsize)ls%16) != ((uintsize)size%16) ) || ( ((uintsize)ea%16) != ((uintsize)size%16) ) ) ) || ( ((uintsize)size%16) && ((uintsize)size!=1) && ((uintsize)size!=2) && ((uintsize)size!=4) && ((uintsize)size!=8) ) || (size >= 16384) || !(uintsize)ls || !(uintsize)ea) { \
-														dUASSERT( (((uintsize)ea % 16) == 0) || (size < 16), "XDR Address not aligned: "); \
-														dUASSERT( (((uintsize)ls % 16) == 0) || (size < 16), "LS Address not aligned: "); \
-														dUASSERT( ((((uintsize)ls % size) == 0) && (((uintsize)ea % size) == 0))  || (size > 16), "Not naturally aligned: "); \
-														dUASSERT((size == 1) || (size == 2) || (size == 4) || (size == 8) || ((size % 16) == 0), "size not a multiple of 16byte: "); \
-    													dUASSERT(size < 16384, "size too big: "); \
-														dUASSERT( ((uintsize)ea%16)==((uintsize)ls%16), "wrong Quadword alignment of LS and EA: "); \
-    													dUASSERT(ea != 0, "Nullpointer EA: "); dUASSERT(ls != 0, "Nullpointer LS: ");\
-    													printf("GET %s:%d from: 0x%x, to: 0x%x - %d bytes\n", __FILE__, __LINE__, (unsigned int)ea,(unsigned int)ls,(unsigned int)size);\
-														} \
-														mfc_get(ls, ea, size, tag, tid, rid)
-#define cellDmaLargePut(ls, ea, size, tag, tid, rid) if (  (((uintsize)ls%16) != ((uintsize)ea%16)) || ((((uintsize)ea%16) || ((uintsize)ls%16)) && (( ((uintsize)ls%16) != ((uintsize)size%16) ) || ( ((uintsize)ea%16) != ((uintsize)size%16) ) ) ) || ( ((uintsize)size%16) && ((uintsize)size!=1) && ((uintsize)size!=2) && ((uintsize)size!=4) && ((uintsize)size!=8) ) || (size >= 16384) || !(uintsize)ls || !(uintsize)ea) { \
-															dUASSERT( (((uintsize)ea % 16) == 0) || (size < 16), "XDR Address not aligned: "); \
-															dUASSERT( (((uintsize)ls % 16) == 0) || (size < 16), "LS Address not aligned: "); \
-															dUASSERT( ((((uintsize)ls % size) == 0) && (((uintsize)ea % size) == 0))  || (size > 16), "Not naturally aligned: "); \
-															dUASSERT((size == 1) || (size == 2) || (size == 4) || (size == 8) || ((size % 16) == 0), "size not a multiple of 16byte: "); \
-        													dUASSERT(size < 16384, "size too big: "); \
-															dUASSERT( ((uintsize)ea%16)==((uintsize)ls%16), "wrong Quadword alignment of LS and EA: "); \
-        													dUASSERT(ea != 0, "Nullpointer EA: "); dUASSERT(ls != 0, "Nullpointer LS: ");\
-    														printf("PUT %s:%d from: 0x%x, to: 0x%x - %d bytes\n", __FILE__, __LINE__, (unsigned int)ls,(unsigned int)ea,(unsigned int)size); \
-															} \
-															mfc_put(ls, ea, size, tag, tid, rid)
-#define cellDmaSmallGet(ls, ea, size, tag, tid, rid) if (  (((uintsize)ls%16) != ((uintsize)ea%16)) || ((((uintsize)ea%16) || ((uintsize)ls%16)) && (( ((uintsize)ls%16) != ((uintsize)size%16) ) || ( ((uintsize)ea%16) != ((uintsize)size%16) ) ) ) || ( ((uintsize)size%16) && ((uintsize)size!=1) && ((uintsize)size!=2) && ((uintsize)size!=4) && ((uintsize)size!=8) ) || (size >= 16384) || !(uintsize)ls || !(uintsize)ea) { \
-																dUASSERT( (((uintsize)ea % 16) == 0) || (size < 16), "XDR Address not aligned: "); \
-																dUASSERT( (((uintsize)ls % 16) == 0) || (size < 16), "LS Address not aligned: "); \
-																dUASSERT( ((((uintsize)ls % size) == 0) && (((uintsize)ea % size) == 0))  || (size > 16), "Not naturally aligned: "); \
-    															dUASSERT((size == 1) || (size == 2) || (size == 4) || (size == 8) || ((size % 16) == 0), "size not a multiple of 16byte: "); \
-    															dUASSERT(size < 16384, "size too big: "); \
-    															dUASSERT( ((uintsize)ea%16)==((uintsize)ls%16), "wrong Quadword alignment of LS and EA: "); \
-    	    													dUASSERT(ea != 0, "Nullpointer EA: "); dUASSERT(ls != 0, "Nullpointer LS: ");\
-    															printf("GET %s:%d from: 0x%x, to: 0x%x - %d bytes\n", __FILE__, __LINE__, (unsigned int)ea,(unsigned int)ls,(unsigned int)size);\
-																} \
-																mfc_get(ls, ea, size, tag, tid, rid)
-#define cellDmaWaitTagStatusAll(ignore) mfc_write_tag_mask(ignore) ; mfc_read_tag_status_all()
-
-#else
-#define cellDmaLargeGet(ls, ea, size, tag, tid, rid) mfc_get(ls, ea, size, tag, tid, rid)
-#define cellDmaGet(ls, ea, size, tag, tid, rid) mfc_get(ls, ea, size, tag, tid, rid)
-#define cellDmaLargePut(ls, ea, size, tag, tid, rid) mfc_put(ls, ea, size, tag, tid, rid)
-#define cellDmaSmallGet(ls, ea, size, tag, tid, rid) mfc_get(ls, ea, size, tag, tid, rid)
-#define cellDmaWaitTagStatusAll(ignore) mfc_write_tag_mask(ignore) ; mfc_read_tag_status_all()
-#endif // DEBUG_DMA
-
-		
-		
-		
-		
-		
-		
-		
-#endif // USE_LIBSPE2
-#else // !__SPU__
-//Simulate DMA using memcpy or direct access on non-CELL platforms that don't have DMAs and SPUs (Win32, Mac, Linux etc)
-//Potential to add networked simulation using this interface
-
-#define DMA_TAG(a) (a)
-#define DMA_MASK(a) (a)
-
-		/// cellDmaLargeGet Win32 replacements for Cell DMA to allow simulating most of the SPU code (just memcpy)
-		int	cellDmaLargeGet(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid);
-		int	cellDmaGet(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid);
-		/// cellDmaLargePut Win32 replacements for Cell DMA to allow simulating most of the SPU code (just memcpy)
-		int cellDmaLargePut(const void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid);
-		/// cellDmaWaitTagStatusAll Win32 replacements for Cell DMA to allow simulating most of the SPU code (just memcpy)
-		void	cellDmaWaitTagStatusAll(int ignore);
-
-
-#endif //__CELLOS_LV2__
-
-///stallingUnalignedDmaSmallGet internally uses DMA_TAG(1)
-int	stallingUnalignedDmaSmallGet(void *ls, uint64_t ea, uint32_t size);
-
-
-void*	cellDmaLargeGetReadOnly(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid);
-void*	cellDmaGetReadOnly(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid);
-void*	cellDmaSmallGetReadOnly(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid);
-
-
-#endif //BT_FAKE_DMA_H
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp
deleted file mode 100644
index 420f15f..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SpuGatheringCollisionDispatcher.h"
-#include "SpuCollisionTaskProcess.h"
-
-
-#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"
-#include "BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h"
-#include "SpuContactManifoldCollisionAlgorithm.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-#include "BulletCollision/CollisionShapes/btCollisionShape.h"
-#include "LinearMath/btQuickprof.h"
-#include "BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.h"
-
-
-
-
-
-SpuGatheringCollisionDispatcher::SpuGatheringCollisionDispatcher(class	btThreadSupportInterface*	threadInterface, unsigned int	maxNumOutstandingTasks,btCollisionConfiguration* collisionConfiguration)
-:btCollisionDispatcher(collisionConfiguration),
-m_spuCollisionTaskProcess(0),
-m_threadInterface(threadInterface),
-m_maxNumOutstandingTasks(maxNumOutstandingTasks)
-{
-	
-}
-
-
-bool	SpuGatheringCollisionDispatcher::supportsDispatchPairOnSpu(int proxyType0,int proxyType1)
-{
-	bool supported0 = (
-		(proxyType0 == BOX_SHAPE_PROXYTYPE) ||
-		(proxyType0 == TRIANGLE_SHAPE_PROXYTYPE) ||
-		(proxyType0 == SPHERE_SHAPE_PROXYTYPE) ||
-		(proxyType0 == CAPSULE_SHAPE_PROXYTYPE) ||
-		(proxyType0 == CYLINDER_SHAPE_PROXYTYPE) ||
-//		(proxyType0 == CONE_SHAPE_PROXYTYPE) ||
-		(proxyType0 == TRIANGLE_MESH_SHAPE_PROXYTYPE) ||
-		(proxyType0 == CONVEX_HULL_SHAPE_PROXYTYPE)||
-		(proxyType0 == STATIC_PLANE_PROXYTYPE)||
-		(proxyType0 == COMPOUND_SHAPE_PROXYTYPE)
-		);
-
-	bool supported1 = (
-		(proxyType1 == BOX_SHAPE_PROXYTYPE) ||
-		(proxyType1 == TRIANGLE_SHAPE_PROXYTYPE) ||
-		(proxyType1 == SPHERE_SHAPE_PROXYTYPE) ||
-		(proxyType1 == CAPSULE_SHAPE_PROXYTYPE) ||
-		(proxyType1 == CYLINDER_SHAPE_PROXYTYPE) ||
-//		(proxyType1 == CONE_SHAPE_PROXYTYPE) ||
-		(proxyType1 == TRIANGLE_MESH_SHAPE_PROXYTYPE) ||
-		(proxyType1 == CONVEX_HULL_SHAPE_PROXYTYPE) ||
-		(proxyType1 == STATIC_PLANE_PROXYTYPE) ||
-		(proxyType1 == COMPOUND_SHAPE_PROXYTYPE)
-		);
-
-	
-	return supported0 && supported1;
-}
-
-
-
-SpuGatheringCollisionDispatcher::~SpuGatheringCollisionDispatcher()
-{
-	if (m_spuCollisionTaskProcess)
-		delete m_spuCollisionTaskProcess;
-	
-}
-
-#include "stdio.h"
-
-
-
-///interface for iterating all overlapping collision pairs, no matter how those pairs are stored (array, set, map etc)
-///this is useful for the collision dispatcher.
-class btSpuCollisionPairCallback : public btOverlapCallback
-{
-	const btDispatcherInfo& m_dispatchInfo;
-	SpuGatheringCollisionDispatcher*	m_dispatcher;
-
-public:
-
-	btSpuCollisionPairCallback(const btDispatcherInfo& dispatchInfo, SpuGatheringCollisionDispatcher*	dispatcher)
-	:m_dispatchInfo(dispatchInfo),
-	m_dispatcher(dispatcher)
-	{
-	}
-
-	virtual bool	processOverlap(btBroadphasePair& collisionPair)
-	{
-
-
-		//PPU version
-		//(*m_dispatcher->getNearCallback())(collisionPair,*m_dispatcher,m_dispatchInfo);
-
-		//only support discrete collision detection for now, we could fallback on PPU/unoptimized version for TOI/CCD
-		btAssert(m_dispatchInfo.m_dispatchFunc == btDispatcherInfo::DISPATCH_DISCRETE);
-
-		//by default, Bullet will use this near callback
-		{
-			///userInfo is used to determine if the SPU has to handle this case or not (skip PPU tasks)
-			if (!collisionPair.m_internalTmpValue)
-			{
-				collisionPair.m_internalTmpValue = 1;
-			}
-			if (!collisionPair.m_algorithm)
-			{
-				btCollisionObject* colObj0 = (btCollisionObject*)collisionPair.m_pProxy0->m_clientObject;
-				btCollisionObject* colObj1 = (btCollisionObject*)collisionPair.m_pProxy1->m_clientObject;
-
-				btCollisionAlgorithmConstructionInfo ci;
-				ci.m_dispatcher1 = m_dispatcher;
-				ci.m_manifold = 0;
-
-				if (m_dispatcher->needsCollision(colObj0,colObj1))
-				{
-					int	proxyType0 = colObj0->getCollisionShape()->getShapeType();
-					int	proxyType1 = colObj1->getCollisionShape()->getShapeType();
-					bool supportsSpuDispatch = m_dispatcher->supportsDispatchPairOnSpu(proxyType0,proxyType1) 
-						&& ((colObj0->getCollisionFlags() & btCollisionObject::CF_DISABLE_SPU_COLLISION_PROCESSING) == 0)
-						&& ((colObj1->getCollisionFlags() & btCollisionObject::CF_DISABLE_SPU_COLLISION_PROCESSING) == 0);
-
-					if (proxyType0 == COMPOUND_SHAPE_PROXYTYPE)
-					{
-						btCompoundShape* compound = (btCompoundShape*)colObj0->getCollisionShape();
-						if (compound->getNumChildShapes()>MAX_SPU_COMPOUND_SUBSHAPES)
-						{
-							//printf("PPU fallback, compound->getNumChildShapes(%d)>%d\n",compound->getNumChildShapes(),MAX_SPU_COMPOUND_SUBSHAPES);
-							supportsSpuDispatch = false;
-						}
-					}
-
-					if (proxyType1 == COMPOUND_SHAPE_PROXYTYPE)
-					{
-						btCompoundShape* compound = (btCompoundShape*)colObj1->getCollisionShape();
-						if (compound->getNumChildShapes()>MAX_SPU_COMPOUND_SUBSHAPES)
-						{
-							//printf("PPU fallback, compound->getNumChildShapes(%d)>%d\n",compound->getNumChildShapes(),MAX_SPU_COMPOUND_SUBSHAPES);
-							supportsSpuDispatch = false;
-						}
-					}
-
-					if (supportsSpuDispatch)
-					{
-
-						int so = sizeof(SpuContactManifoldCollisionAlgorithm);
-#ifdef ALLOCATE_SEPARATELY
-						void* mem = btAlignedAlloc(so,16);//m_dispatcher->allocateCollisionAlgorithm(so);
-#else
-						void* mem = m_dispatcher->allocateCollisionAlgorithm(so);
-#endif
-						collisionPair.m_algorithm = new(mem) SpuContactManifoldCollisionAlgorithm(ci,colObj0,colObj1);
-						collisionPair.m_internalTmpValue =  2;
-					} else
-					{
-						collisionPair.m_algorithm = m_dispatcher->findAlgorithm(colObj0,colObj1);
-						collisionPair.m_internalTmpValue = 3;
-					}
-				} 
-			}
-		}
-		return false;
-	}
-};
-
-void	SpuGatheringCollisionDispatcher::dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo, btDispatcher* dispatcher) 
-{
-
-	if (dispatchInfo.m_enableSPU)
-	{
-		m_maxNumOutstandingTasks = m_threadInterface->getNumTasks();
-
-		{
-			BT_PROFILE("processAllOverlappingPairs");
-
-			if (!m_spuCollisionTaskProcess)
-				m_spuCollisionTaskProcess = new SpuCollisionTaskProcess(m_threadInterface,m_maxNumOutstandingTasks);
-		
-			m_spuCollisionTaskProcess->setNumTasks(m_maxNumOutstandingTasks);
-	//		printf("m_maxNumOutstandingTasks =%d\n",m_maxNumOutstandingTasks);
-
-			m_spuCollisionTaskProcess->initialize2(dispatchInfo.m_useEpa);
-			
-		
-			///modified version of btCollisionDispatcher::dispatchAllCollisionPairs:
-			{
-				btSpuCollisionPairCallback	collisionCallback(dispatchInfo,this);
-
-				pairCache->processAllOverlappingPairs(&collisionCallback,dispatcher);
-			}
-		}
-
-		//send one big batch
-		int numTotalPairs = pairCache->getNumOverlappingPairs();
-		
-		btBroadphasePair* pairPtr = pairCache->getOverlappingPairArrayPtr();
-		int i;
-		{
-			int pairRange =	SPU_BATCHSIZE_BROADPHASE_PAIRS;
-			if (numTotalPairs < (m_spuCollisionTaskProcess->getNumTasks()*SPU_BATCHSIZE_BROADPHASE_PAIRS))
-			{
-				pairRange = (numTotalPairs/m_spuCollisionTaskProcess->getNumTasks())+1;
-			}
-
-			BT_PROFILE("addWorkToTask");
-			for (i=0;i<numTotalPairs;)
-			{
-				//Performance Hint: tweak this number during benchmarking
-				
-				int endIndex = (i+pairRange) < numTotalPairs ? i+pairRange : numTotalPairs;
-				m_spuCollisionTaskProcess->addWorkToTask(pairPtr,i,endIndex);
-				i = endIndex;
-			}
-		}
-
-		{
-			BT_PROFILE("PPU fallback");
-			//handle PPU fallback pairs
-			for (i=0;i<numTotalPairs;i++)
-			{
-				btBroadphasePair& collisionPair = pairPtr[i];
-				if (collisionPair.m_internalTmpValue == 3)
-				{
-					if (collisionPair.m_algorithm)
-					{
-						btCollisionObject* colObj0 = (btCollisionObject*)collisionPair.m_pProxy0->m_clientObject;
-						btCollisionObject* colObj1 = (btCollisionObject*)collisionPair.m_pProxy1->m_clientObject;
-
-						if (dispatcher->needsCollision(colObj0,colObj1))
-						{
-							btManifoldResult contactPointResult(colObj0,colObj1);
-							
-							if (dispatchInfo.m_dispatchFunc == 		btDispatcherInfo::DISPATCH_DISCRETE)
-							{
-								//discrete collision detection query
-								collisionPair.m_algorithm->processCollision(colObj0,colObj1,dispatchInfo,&contactPointResult);
-							} else
-							{
-								//continuous collision detection query, time of impact (toi)
-								btScalar toi = collisionPair.m_algorithm->calculateTimeOfImpact(colObj0,colObj1,dispatchInfo,&contactPointResult);
-								if (dispatchInfo.m_timeOfImpact > toi)
-									dispatchInfo.m_timeOfImpact = toi;
-
-							}
-						}
-					}
-				}
-			}
-		}
-		{
-			BT_PROFILE("flush2");
-			//make sure all SPU work is done
-			m_spuCollisionTaskProcess->flush2();
-		}
-
-	} else
-	{
-		///PPU fallback
-		///!Need to make sure to clear all 'algorithms' when switching between SPU and PPU
-		btCollisionDispatcher::dispatchAllCollisionPairs(pairCache,dispatchInfo,dispatcher);
-	}
-}
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuGatheringCollisionDispatcher.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuGatheringCollisionDispatcher.h
deleted file mode 100644
index f8bc7da..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuGatheringCollisionDispatcher.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-#ifndef BT_SPU_GATHERING_COLLISION__DISPATCHER_H
-#define BT_SPU_GATHERING_COLLISION__DISPATCHER_H
-
-#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
-
-
-///Tuning value to optimized SPU utilization 
-///Too small value means Task overhead is large compared to computation (too fine granularity)
-///Too big value might render some SPUs are idle, while a few other SPUs are doing all work.
-//#define SPU_BATCHSIZE_BROADPHASE_PAIRS 8
-//#define SPU_BATCHSIZE_BROADPHASE_PAIRS 16
-//#define SPU_BATCHSIZE_BROADPHASE_PAIRS 64
-#define SPU_BATCHSIZE_BROADPHASE_PAIRS 128
-//#define SPU_BATCHSIZE_BROADPHASE_PAIRS 256
-//#define SPU_BATCHSIZE_BROADPHASE_PAIRS 512
-//#define SPU_BATCHSIZE_BROADPHASE_PAIRS 1024
-
-
-
-class SpuCollisionTaskProcess;
-
-///SpuGatheringCollisionDispatcher can use SPU to gather and calculate collision detection
-///Time of Impact, Closest Points and Penetration Depth.
-class SpuGatheringCollisionDispatcher : public btCollisionDispatcher
-{
-	
-	SpuCollisionTaskProcess*	m_spuCollisionTaskProcess;
-	
-protected:
-
-	class	btThreadSupportInterface*	m_threadInterface;
-
-	unsigned int	m_maxNumOutstandingTasks;
-	
-
-public:
-
-	//can be used by SPU collision algorithms	
-	SpuCollisionTaskProcess*	getSpuCollisionTaskProcess()
-	{
-			return m_spuCollisionTaskProcess;
-	}
-	
-	SpuGatheringCollisionDispatcher (class	btThreadSupportInterface*	threadInterface, unsigned int	maxNumOutstandingTasks,btCollisionConfiguration* collisionConfiguration);
-	
-	virtual ~SpuGatheringCollisionDispatcher();
-
-	bool	supportsDispatchPairOnSpu(int proxyType0,int proxyType1);
-
-	virtual void	dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher) ;
-
-};
-
-
-
-#endif //BT_SPU_GATHERING_COLLISION__DISPATCHER_H
-
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuLibspe2Support.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuLibspe2Support.cpp
deleted file mode 100644
index a312450..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuLibspe2Support.cpp
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifdef USE_LIBSPE2
-
-#include "SpuLibspe2Support.h"
-
-
-
-
-//SpuLibspe2Support helps to initialize/shutdown libspe2, start/stop SPU tasks and communication
-///Setup and initialize SPU/CELL/Libspe2
-SpuLibspe2Support::SpuLibspe2Support(spe_program_handle_t *speprog, int numThreads)
-{
-	this->program = speprog;
-	this->numThreads =  ((numThreads <= spe_cpu_info_get(SPE_COUNT_PHYSICAL_SPES, -1)) ? numThreads : spe_cpu_info_get(SPE_COUNT_PHYSICAL_SPES, -1));
-}
-
-///cleanup/shutdown Libspe2
-SpuLibspe2Support::~SpuLibspe2Support()
-{
-	
-	stopSPU();
-}
-
-
-
-///send messages to SPUs
-void SpuLibspe2Support::sendRequest(uint32_t uiCommand, uint32_t uiArgument0, uint32_t uiArgument1)
-{
-	spe_context_ptr_t context;
-	
-	switch (uiCommand)
-	{
-	case CMD_SAMPLE_TASK_COMMAND:
-	{
-		//get taskdescription
-		SpuSampleTaskDesc* taskDesc = (SpuSampleTaskDesc*) uiArgument0;
-
-		btAssert(taskDesc->m_taskId<m_activeSpuStatus.size());
-
-		//get status of SPU on which task should run
-		btSpuStatus&	spuStatus = m_activeSpuStatus[taskDesc->m_taskId];
-
-		//set data for spuStatus
-		spuStatus.m_commandId = uiCommand;
-		spuStatus.m_status = Spu_Status_Occupied; //set SPU as "occupied"
-		spuStatus.m_taskDesc.p = taskDesc; 
-		
-		//get context
-		context = data[taskDesc->m_taskId].context;
-		
-		
-		taskDesc->m_mainMemoryPtr = reinterpret_cast<uint64_t> (spuStatus.m_lsMemory.p);
-		
-
-		break;
-	}
-	case CMD_GATHER_AND_PROCESS_PAIRLIST:
-		{
-			//get taskdescription
-			SpuGatherAndProcessPairsTaskDesc* taskDesc = (SpuGatherAndProcessPairsTaskDesc*) uiArgument0;
-
-			btAssert(taskDesc->taskId<m_activeSpuStatus.size());
-
-			//get status of SPU on which task should run
-			btSpuStatus&	spuStatus = m_activeSpuStatus[taskDesc->taskId];
-
-			//set data for spuStatus
-			spuStatus.m_commandId = uiCommand;
-			spuStatus.m_status = Spu_Status_Occupied; //set SPU as "occupied"
-			spuStatus.m_taskDesc.p = taskDesc; 
-			
-			//get context
-			context = data[taskDesc->taskId].context;
-			
-			
-			taskDesc->m_lsMemory = (CollisionTask_LocalStoreMemory*)spuStatus.m_lsMemory.p;
-			
-			break;
-		}
-	default:
-		{
-			///not implemented
-			btAssert(0);
-		}
-
-	};
-
-	
-	//write taskdescription in mailbox
-	unsigned int event = Spu_Mailbox_Event_Task;
-	spe_in_mbox_write(context, &event, 1, SPE_MBOX_ANY_NONBLOCKING);
-
-}
-
-///check for messages from SPUs
-void SpuLibspe2Support::waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1)
-{
-	///We should wait for (one of) the first tasks to finish (or other SPU messages), and report its response
-	
-	///A possible response can be 'yes, SPU handled it', or 'no, please do a PPU fallback'
-	
-	btAssert(m_activeSpuStatus.size());
-
-	
-	int last = -1;
-	
-	//find an active spu/thread
-	while(last < 0)
-	{
-		for (int i=0;i<m_activeSpuStatus.size();i++)
-		{
-			if ( m_activeSpuStatus[i].m_status == Spu_Status_Free)
-			{
-				last = i;
-				break;
-			}
-		}
-		if(last < 0)
-			sched_yield();
-	}
-
-
-
-	btSpuStatus& spuStatus = m_activeSpuStatus[last];
-
-	///need to find an active spu
-	btAssert(last>=0);
-
-	
-
-	*puiArgument0 = spuStatus.m_taskId;
-	*puiArgument1 = spuStatus.m_status;
-
-
-}
-
-
-void SpuLibspe2Support::startSPU()
-{
-	this->internal_startSPU();
-}
-
-
-
-///start the spus group (can be called at the beginning of each frame, to make sure that the right SPU program is loaded)
-void SpuLibspe2Support::internal_startSPU()
-{
-	m_activeSpuStatus.resize(numThreads);
-	
-	
-	for (int i=0; i < numThreads; i++)
-	{
-		
-		if(data[i].context == NULL) 
-		{
-					
-			 /* Create context */
-			if ((data[i].context = spe_context_create(0, NULL)) == NULL)
-			{
-			      perror ("Failed creating context");
-		          exit(1);
-			}
-	
-			/* Load program into context */
-			if(spe_program_load(data[i].context, this->program))
-			{
-			      perror ("Failed loading program");
-		          exit(1);
-			}
-			
-			m_activeSpuStatus[i].m_status = Spu_Status_Startup; 
-			m_activeSpuStatus[i].m_taskId = i; 
-			m_activeSpuStatus[i].m_commandId = 0; 
-			m_activeSpuStatus[i].m_lsMemory.p = NULL; 
-			
-			
-			data[i].entry = SPE_DEFAULT_ENTRY;
-			data[i].flags = 0;
-			data[i].argp.p = &m_activeSpuStatus[i];
-			data[i].envp.p = NULL;
-			
-		    /* Create thread for each SPE context */
-			if (pthread_create(&data[i].pthread, NULL, &ppu_pthread_function, &(data[i]) ))
-			{
-			      perror ("Failed creating thread");
-		          exit(1);
-			}
-			/*
-			else
-			{
-				printf("started thread %d\n",i);
-			}*/
-		}		
-	}
-	
-	
-	for (int i=0; i < numThreads; i++)
-	{
-		if(data[i].context != NULL) 
-		{
-			while( m_activeSpuStatus[i].m_status == Spu_Status_Startup)
-			{
-				// wait for spu to set up
-				sched_yield();
-			}
-			printf("Spu %d is ready\n", i);
-		}
-	}
-}
-
-///tell the task scheduler we are done with the SPU tasks
-void SpuLibspe2Support::stopSPU()
-{
-	// wait for all threads to finish 
-	int i;
-	for ( i = 0; i < this->numThreads; i++ ) 
-	{ 
-		
-		unsigned int event = Spu_Mailbox_Event_Shutdown;
-		spe_context_ptr_t context = data[i].context;
-		spe_in_mbox_write(context, &event, 1, SPE_MBOX_ALL_BLOCKING);
-		pthread_join (data[i].pthread, NULL); 
-		
-	} 
-	// close SPE program 
-	spe_image_close(program); 
-	// destroy SPE contexts 
-	for ( i = 0; i < this->numThreads; i++ ) 
-	{ 
-		if(data[i].context != NULL)
-		{
-			spe_context_destroy (data[i].context);
-		}
-	} 
-	
-	m_activeSpuStatus.clear();
-	
-}
-
-
-
-#endif //USE_LIBSPE2
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuLibspe2Support.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuLibspe2Support.h
deleted file mode 100644
index 37a5e79..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuLibspe2Support.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef BT_SPU_LIBSPE2_SUPPORT_H
-#define BT_SPU_LIBSPE2_SUPPORT_H
-
-#include <LinearMath/btScalar.h> //for uint32_t etc.
-
-#ifdef USE_LIBSPE2
-
-#include <stdlib.h>
-#include <stdio.h>
-//#include "SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h"
-#include "PlatformDefinitions.h"
-
-
-//extern struct SpuGatherAndProcessPairsTaskDesc;
-
-enum
-{
-	Spu_Mailbox_Event_Nothing = 0,
-	Spu_Mailbox_Event_Task = 1,
-	Spu_Mailbox_Event_Shutdown = 2,
-	
-	Spu_Mailbox_Event_ForceDword = 0xFFFFFFFF
-	
-};
-
-enum
-{
-	Spu_Status_Free = 0,
-	Spu_Status_Occupied = 1,
-	Spu_Status_Startup = 2,
-	
-	Spu_Status_ForceDword = 0xFFFFFFFF
-	
-};
-
-
-struct btSpuStatus
-{
-	uint32_t	m_taskId;
-	uint32_t	m_commandId;
-	uint32_t	m_status;
-
-	addr64 m_taskDesc;
-	addr64 m_lsMemory;
-	
-}
-__attribute__ ((aligned (128)))
-;
-
-
-
-#ifndef __SPU__
-
-#include "LinearMath/btAlignedObjectArray.h"
-#include "SpuCollisionTaskProcess.h"
-#include "SpuSampleTaskProcess.h"
-#include "btThreadSupportInterface.h"
-#include <libspe2.h>
-#include <pthread.h>
-#include <sched.h>
-
-#define MAX_SPUS 4 
-
-typedef struct ppu_pthread_data 
-{
-	spe_context_ptr_t context;
-	pthread_t pthread;
-	unsigned int entry;
-	unsigned int flags;
-	addr64 argp;
-	addr64 envp;
-	spe_stop_info_t stopinfo;
-} ppu_pthread_data_t;
-
-
-static void *ppu_pthread_function(void *arg)
-{
-    ppu_pthread_data_t * datap = (ppu_pthread_data_t *)arg;
-    /*
-    int rc;
-    do 
-    {*/
-        spe_context_run(datap->context, &datap->entry, datap->flags, datap->argp.p, datap->envp.p, &datap->stopinfo);
-        if (datap->stopinfo.stop_reason == SPE_EXIT) 
-        {
-           if (datap->stopinfo.result.spe_exit_code != 0) 
-           {
-             perror("FAILED: SPE returned a non-zero exit status: \n");
-             exit(1);
-           }
-         } 
-        else 
-         {
-           perror("FAILED: SPE abnormally terminated\n");
-           exit(1);
-         }
-        
-        
-    //} while (rc > 0); // loop until exit or error, and while any stop & signal
-    pthread_exit(NULL);
-}
-
-
-
-
-
-
-///SpuLibspe2Support helps to initialize/shutdown libspe2, start/stop SPU tasks and communication
-class SpuLibspe2Support : public btThreadSupportInterface
-{
-
-	btAlignedObjectArray<btSpuStatus>	m_activeSpuStatus;
-	
-public:
-	//Setup and initialize SPU/CELL/Libspe2
-	SpuLibspe2Support(spe_program_handle_t *speprog,int numThreads);
-	
-	// SPE program handle ptr.
-	spe_program_handle_t *program;
-	
-	// SPE program data
-	ppu_pthread_data_t data[MAX_SPUS];
-	
-	//cleanup/shutdown Libspe2
-	~SpuLibspe2Support();
-
-	///send messages to SPUs
-	void sendRequest(uint32_t uiCommand, uint32_t uiArgument0, uint32_t uiArgument1=0);
-
-	//check for messages from SPUs
-	void waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1);
-
-	//start the spus (can be called at the beginning of each frame, to make sure that the right SPU program is loaded)
-	virtual void startSPU();
-
-	//tell the task scheduler we are done with the SPU tasks
-	virtual void stopSPU();
-
-	virtual void setNumTasks(int numTasks)
-	{
-		//changing the number of tasks after initialization is not implemented (yet)
-	}
-
-private:
-	
-	///start the spus (can be called at the beginning of each frame, to make sure that the right SPU program is loaded)
-	void internal_startSPU();
-
-
-	
-	
-	int numThreads;
-
-};
-
-#endif // NOT __SPU__
-
-#endif //USE_LIBSPE2
-
-#endif //BT_SPU_LIBSPE2_SUPPORT_H
-
-
-
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/Box.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/Box.h
deleted file mode 100644
index e517961..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/Box.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
-   Copyright (C) 2006, 2008 Sony Computer Entertainment Inc.
-   All rights reserved.
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-
-*/
-
-#ifndef __BOX_H__
-#define __BOX_H__
-
-
-#ifndef PE_REF
-#define PE_REF(a) a&
-#endif
-
-#include <math.h>
-
-
-#include "../PlatformDefinitions.h"
-
-
-
-
-enum FeatureType { F, E, V };
-
-//----------------------------------------------------------------------------
-// Box
-//----------------------------------------------------------------------------
-///The Box is an internal class used by the boxBoxDistance calculation.
-class Box
-{
-public:
-	vmVector3 mHalf;
-
-	inline Box()
-	{}
-	inline Box(PE_REF(vmVector3) half_);
-	inline Box(float hx, float hy, float hz);
-
-	inline void Set(PE_REF(vmVector3) half_);
-	inline void Set(float hx, float hy, float hz);
-
-	inline vmVector3 GetAABB(const vmMatrix3& rotation) const;
-};
-
-inline
-Box::Box(PE_REF(vmVector3) half_)
-{
-	Set(half_);
-}
-
-inline
-Box::Box(float hx, float hy, float hz)
-{
-	Set(hx, hy, hz);
-}
-
-inline
-void
-Box::Set(PE_REF(vmVector3) half_)
-{
-	mHalf = half_;
-}
-
-inline
-void
-Box::Set(float hx, float hy, float hz)
-{
-	mHalf = vmVector3(hx, hy, hz);
-}
-
-inline
-vmVector3
-Box::GetAABB(const vmMatrix3& rotation) const
-{
-	return absPerElem(rotation) * mHalf;
-}
-
-//-------------------------------------------------------------------------------------------------
-// BoxPoint
-//-------------------------------------------------------------------------------------------------
-
-///The BoxPoint class is an internally used class to contain feature information for boxBoxDistance calculation.
-class BoxPoint
-{
-public:
-	BoxPoint() : localPoint(0.0f) {}
-
-	vmPoint3      localPoint;
-	FeatureType featureType;
-	int         featureIdx;
-
-	inline void setVertexFeature(int plusX, int plusY, int plusZ);
-	inline void setEdgeFeature(int dim0, int plus0, int dim1, int plus1);
-	inline void setFaceFeature(int dim, int plus);
-
-	inline void getVertexFeature(int & plusX, int & plusY, int & plusZ) const;
-	inline void getEdgeFeature(int & dim0, int & plus0, int & dim1, int & plus1) const;
-	inline void getFaceFeature(int & dim, int & plus) const;
-};
-
-inline
-void
-BoxPoint::setVertexFeature(int plusX, int plusY, int plusZ)
-{
-	featureType = V;
-	featureIdx = plusX << 2 | plusY << 1 | plusZ;
-}
-
-inline
-void
-BoxPoint::setEdgeFeature(int dim0, int plus0, int dim1, int plus1)
-{
-	featureType = E;
-
-	if (dim0 > dim1) {
-		featureIdx = plus1 << 5 | dim1 << 3 | plus0 << 2 | dim0;
-	} else {
-		featureIdx = plus0 << 5 | dim0 << 3 | plus1 << 2 | dim1;
-	}
-}
-
-inline
-void
-BoxPoint::setFaceFeature(int dim, int plus)
-{
-	featureType = F;
-	featureIdx = plus << 2 | dim;
-}
-
-inline
-void
-BoxPoint::getVertexFeature(int & plusX, int & plusY, int & plusZ) const
-{
-	plusX = featureIdx >> 2;
-	plusY = featureIdx >> 1 & 1;
-	plusZ = featureIdx & 1;
-}
-
-inline
-void
-BoxPoint::getEdgeFeature(int & dim0, int & plus0, int & dim1, int & plus1) const
-{
-	plus0 = featureIdx >> 5;
-	dim0 = featureIdx >> 3 & 3;
-	plus1 = featureIdx >> 2 & 1;
-	dim1 = featureIdx & 3;
-}
-
-inline
-void
-BoxPoint::getFaceFeature(int & dim, int & plus) const
-{
-	plus = featureIdx >> 2;
-	dim = featureIdx & 3;
-}
-
-#endif /* __BOX_H__ */
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp
deleted file mode 100644
index dfcd842..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#include "SpuCollisionShapes.h"
-
-///not supported on IBM SDK, until we fix the alignment of btVector3
-#if defined (__CELLOS_LV2__) && defined (__SPU__)
-#include <spu_intrinsics.h>
-static inline vec_float4 vec_dot3( vec_float4 vec0, vec_float4 vec1 )
-{
-    vec_float4 result;
-    result = spu_mul( vec0, vec1 );
-    result = spu_madd( spu_rlqwbyte( vec0, 4 ), spu_rlqwbyte( vec1, 4 ), result );
-    return spu_madd( spu_rlqwbyte( vec0, 8 ), spu_rlqwbyte( vec1, 8 ), result );
-}
-#endif //__SPU__
-
-
-void computeAabb (btVector3& aabbMin, btVector3& aabbMax, btConvexInternalShape* convexShape, ppu_address_t convexShapePtr, int shapeType, const btTransform& xform)
-{
-	//calculate the aabb, given the types...
-	switch (shapeType)
-	{
-	case CYLINDER_SHAPE_PROXYTYPE:
-		/* fall through */
-	case BOX_SHAPE_PROXYTYPE:
-	{
-		btScalar margin=convexShape->getMarginNV();
-		btVector3 halfExtents = convexShape->getImplicitShapeDimensions();
-		halfExtents += btVector3(margin,margin,margin);
-		const btTransform& t = xform;
-		btMatrix3x3 abs_b = t.getBasis().absolute();  
-		btVector3 center = t.getOrigin();
-		btVector3 extent = btVector3(abs_b[0].dot(halfExtents),abs_b[1].dot(halfExtents),abs_b[2].dot(halfExtents));
-		
-		aabbMin = center - extent;
-		aabbMax = center + extent;
-		break;
-	}
-	case CAPSULE_SHAPE_PROXYTYPE:
-	{
-		btScalar margin=convexShape->getMarginNV();
-		btVector3 halfExtents = convexShape->getImplicitShapeDimensions();
-		//add the radius to y-axis to get full height
-		btScalar radius = halfExtents[0];
-		halfExtents[1] += radius;
-		halfExtents += btVector3(margin,margin,margin);
-#if 0
-		int capsuleUpAxis = convexShape->getUpAxis();
-		btScalar halfHeight = convexShape->getHalfHeight();
-		btScalar radius = convexShape->getRadius();
-		halfExtents[capsuleUpAxis] = radius + halfHeight;
-#endif
-		const btTransform& t = xform;
-		btMatrix3x3 abs_b = t.getBasis().absolute();  
-		btVector3 center = t.getOrigin();
-		btVector3 extent = btVector3(abs_b[0].dot(halfExtents),abs_b[1].dot(halfExtents),abs_b[2].dot(halfExtents));
-		
-		aabbMin = center - extent;
-		aabbMax = center + extent;
-		break;
-	}
-	case SPHERE_SHAPE_PROXYTYPE:
-	{
-		btScalar radius = convexShape->getImplicitShapeDimensions().getX();// * convexShape->getLocalScaling().getX();
-		btScalar margin = radius + convexShape->getMarginNV();
-		const btTransform& t = xform;
-		const btVector3& center = t.getOrigin();
-		btVector3 extent(margin,margin,margin);
-		aabbMin = center - extent;
-		aabbMax = center + extent;
-		break;
-	}
-	case CONVEX_HULL_SHAPE_PROXYTYPE:
-	{
-		ATTRIBUTE_ALIGNED16(char convexHullShape0[sizeof(btConvexHullShape)]);
-		cellDmaGet(&convexHullShape0, convexShapePtr  , sizeof(btConvexHullShape), DMA_TAG(1), 0, 0);
-		cellDmaWaitTagStatusAll(DMA_MASK(1));
-		btConvexHullShape* localPtr = (btConvexHullShape*)&convexHullShape0;
-		const btTransform& t = xform;
-		btScalar margin = convexShape->getMarginNV();
-		localPtr->getNonvirtualAabb(t,aabbMin,aabbMax,margin);
-		//spu_printf("SPU convex aabbMin=%f,%f,%f=\n",aabbMin.getX(),aabbMin.getY(),aabbMin.getZ());
-		//spu_printf("SPU convex aabbMax=%f,%f,%f=\n",aabbMax.getX(),aabbMax.getY(),aabbMax.getZ());
-		break;
-	}
-	default:
-		{
-	//	spu_printf("SPU: unsupported shapetype %d in AABB calculation\n");
-		}
-	};
-}
-
-void dmaBvhShapeData (bvhMeshShape_LocalStoreMemory* bvhMeshShape, btBvhTriangleMeshShape* triMeshShape)
-{
-	register int dmaSize;
-	register ppu_address_t	dmaPpuAddress2;
-
-	dmaSize = sizeof(btTriangleIndexVertexArray);
-	dmaPpuAddress2 = reinterpret_cast<ppu_address_t>(triMeshShape->getMeshInterface());
-	//	spu_printf("trimeshShape->getMeshInterface() == %llx\n",dmaPpuAddress2);
-#ifdef __SPU__
-	cellDmaGet(&bvhMeshShape->gTriangleMeshInterfaceStorage, dmaPpuAddress2  , dmaSize, DMA_TAG(1), 0, 0);
-	bvhMeshShape->gTriangleMeshInterfacePtr = &bvhMeshShape->gTriangleMeshInterfaceStorage;
-#else
-	bvhMeshShape->gTriangleMeshInterfacePtr = (btTriangleIndexVertexArray*)cellDmaGetReadOnly(&bvhMeshShape->gTriangleMeshInterfaceStorage, dmaPpuAddress2  , dmaSize, DMA_TAG(1), 0, 0);
-#endif
-
-	//cellDmaWaitTagStatusAll(DMA_MASK(1));
-	
-	///now DMA over the BVH
-	
-	dmaSize = sizeof(btOptimizedBvh);
-	dmaPpuAddress2 = reinterpret_cast<ppu_address_t>(triMeshShape->getOptimizedBvh());
-	//spu_printf("trimeshShape->getOptimizedBvh() == %llx\n",dmaPpuAddress2);
-	cellDmaGet(&bvhMeshShape->gOptimizedBvh, dmaPpuAddress2  , dmaSize, DMA_TAG(2), 0, 0);
-	//cellDmaWaitTagStatusAll(DMA_MASK(2));
-	cellDmaWaitTagStatusAll(DMA_MASK(1) | DMA_MASK(2));
-}
-
-void dmaBvhIndexedMesh (btIndexedMesh* IndexMesh, IndexedMeshArray& indexArray, int index, uint32_t dmaTag)
-{		
-	cellDmaGet(IndexMesh, (ppu_address_t)&indexArray[index]  , sizeof(btIndexedMesh), DMA_TAG(dmaTag), 0, 0);
-	
-}
-
-void dmaBvhSubTreeHeaders (btBvhSubtreeInfo* subTreeHeaders, ppu_address_t subTreePtr, int batchSize, uint32_t dmaTag)
-{
-	cellDmaGet(subTreeHeaders, subTreePtr, batchSize * sizeof(btBvhSubtreeInfo), DMA_TAG(dmaTag), 0, 0);
-}
-
-void dmaBvhSubTreeNodes (btQuantizedBvhNode* nodes, const btBvhSubtreeInfo& subtree, QuantizedNodeArray&	nodeArray, int dmaTag)
-{
-	cellDmaGet(nodes, reinterpret_cast<ppu_address_t>(&nodeArray[subtree.m_rootNodeIndex]) , subtree.m_subtreeSize* sizeof(btQuantizedBvhNode), DMA_TAG(2), 0, 0);
-}
-
-///getShapeTypeSize could easily be optimized, but it is not likely a bottleneck
-int		getShapeTypeSize(int shapeType)
-{
-
-
-	switch (shapeType)
-	{
-	case CYLINDER_SHAPE_PROXYTYPE:
-		{
-			int shapeSize = sizeof(btCylinderShape);
-			btAssert(shapeSize < MAX_SHAPE_SIZE);
-			return shapeSize;
-		}
-	case BOX_SHAPE_PROXYTYPE:
-		{
-			int shapeSize = sizeof(btBoxShape);
-			btAssert(shapeSize < MAX_SHAPE_SIZE);
-			return shapeSize;
-		}
-	case SPHERE_SHAPE_PROXYTYPE:
-		{
-			int shapeSize = sizeof(btSphereShape);
-			btAssert(shapeSize < MAX_SHAPE_SIZE);
-			return shapeSize;
-		}
-	case TRIANGLE_MESH_SHAPE_PROXYTYPE:
-		{
-			int shapeSize = sizeof(btBvhTriangleMeshShape);
-			btAssert(shapeSize < MAX_SHAPE_SIZE);
-			return shapeSize;
-		}
-	case CAPSULE_SHAPE_PROXYTYPE:
-		{
-			int shapeSize = sizeof(btCapsuleShape);
-			btAssert(shapeSize < MAX_SHAPE_SIZE);
-			return shapeSize;
-		}
-
-	case CONVEX_HULL_SHAPE_PROXYTYPE:
-		{
-			int shapeSize = sizeof(btConvexHullShape);
-			btAssert(shapeSize < MAX_SHAPE_SIZE);
-			return shapeSize;
-		}
-
-	case COMPOUND_SHAPE_PROXYTYPE:
-		{
-			int shapeSize = sizeof(btCompoundShape);
-			btAssert(shapeSize < MAX_SHAPE_SIZE);
-			return shapeSize;
-		}
-	case STATIC_PLANE_PROXYTYPE:
-		{
-			int shapeSize = sizeof(btStaticPlaneShape);
-			btAssert(shapeSize < MAX_SHAPE_SIZE);
-			return shapeSize;
-		}
-
-	default:
-		btAssert(0);
-		//unsupported shapetype, please add here
-		return 0;
-	}
-}
-
-void dmaConvexVertexData (SpuConvexPolyhedronVertexData* convexVertexData, btConvexHullShape* convexShapeSPU)
-{
-	convexVertexData->gNumConvexPoints = convexShapeSPU->getNumPoints();
-	if (convexVertexData->gNumConvexPoints>MAX_NUM_SPU_CONVEX_POINTS)
-	{
-		btAssert(0);
-	//	spu_printf("SPU: Error: MAX_NUM_SPU_CONVEX_POINTS(%d) exceeded: %d\n",MAX_NUM_SPU_CONVEX_POINTS,convexVertexData->gNumConvexPoints);
-		return;
-	}
-			
-	register int dmaSize = convexVertexData->gNumConvexPoints*sizeof(btVector3);
-	ppu_address_t pointsPPU = (ppu_address_t) convexShapeSPU->getUnscaledPoints();
-	cellDmaGet(&convexVertexData->g_convexPointBuffer[0], pointsPPU  , dmaSize, DMA_TAG(2), 0, 0);
-}
-
-void dmaCollisionShape (void* collisionShapeLocation, ppu_address_t collisionShapePtr, uint32_t dmaTag, int shapeType)
-{
-	register int dmaSize = getShapeTypeSize(shapeType);
-	cellDmaGet(collisionShapeLocation, collisionShapePtr  , dmaSize, DMA_TAG(dmaTag), 0, 0);
-	//cellDmaGetReadOnly(collisionShapeLocation, collisionShapePtr  , dmaSize, DMA_TAG(dmaTag), 0, 0);
-	//cellDmaWaitTagStatusAll(DMA_MASK(dmaTag));
-}
-
-void dmaCompoundShapeInfo (CompoundShape_LocalStoreMemory* compoundShapeLocation, btCompoundShape* spuCompoundShape, uint32_t dmaTag)
-{
-	register int dmaSize;
-	register	ppu_address_t	dmaPpuAddress2;
-	int childShapeCount = spuCompoundShape->getNumChildShapes();
-	dmaSize = childShapeCount * sizeof(btCompoundShapeChild);
-	dmaPpuAddress2 = (ppu_address_t)spuCompoundShape->getChildList();
-	cellDmaGet(&compoundShapeLocation->gSubshapes[0], dmaPpuAddress2, dmaSize, DMA_TAG(dmaTag), 0, 0);
-}
-
-void dmaCompoundSubShapes (CompoundShape_LocalStoreMemory* compoundShapeLocation, btCompoundShape* spuCompoundShape, uint32_t dmaTag)
-{
-	int childShapeCount = spuCompoundShape->getNumChildShapes();
-	int i;
-	// DMA all the subshapes 
-	for ( i = 0; i < childShapeCount; ++i)
-	{
-		btCompoundShapeChild& childShape = compoundShapeLocation->gSubshapes[i];
-		dmaCollisionShape (&compoundShapeLocation->gSubshapeShape[i],(ppu_address_t)childShape.m_childShape, dmaTag, childShape.m_childShapeType);
-	}
-}
-
-
-void	spuWalkStacklessQuantizedTree(btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax,const btQuantizedBvhNode* rootNode,int startNodeIndex,int endNodeIndex)
-{
-
-	int curIndex = startNodeIndex;
-	int walkIterations = 0;
-#ifdef BT_DEBUG
-	int subTreeSize = endNodeIndex - startNodeIndex;
-#endif
-
-	int escapeIndex;
-
-	unsigned int aabbOverlap, isLeafNode;
-
-	while (curIndex < endNodeIndex)
-	{
-		//catch bugs in tree data
-		btAssert (walkIterations < subTreeSize);
-
-		walkIterations++;
-		aabbOverlap = spuTestQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,rootNode->m_quantizedAabbMin,rootNode->m_quantizedAabbMax);
-		isLeafNode = rootNode->isLeafNode();
-
-		if (isLeafNode && aabbOverlap)
-		{
-			//printf("overlap with node %d\n",rootNode->getTriangleIndex());
-			nodeCallback->processNode(0,rootNode->getTriangleIndex());
-			//			spu_printf("SPU: overlap detected with triangleIndex:%d\n",rootNode->getTriangleIndex());
-		} 
-
-		if (aabbOverlap || isLeafNode)
-		{
-			rootNode++;
-			curIndex++;
-		} else
-		{
-			escapeIndex = rootNode->getEscapeIndex();
-			rootNode += escapeIndex;
-			curIndex += escapeIndex;
-		}
-	}
-
-}
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.h
deleted file mode 100644
index aa8a291..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-#ifndef __SPU_COLLISION_SHAPES_H
-#define __SPU_COLLISION_SHAPES_H
-
-#include "../SpuDoubleBuffer.h"
-
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-#include "BulletCollision/CollisionShapes/btConvexInternalShape.h"
-#include "BulletCollision/CollisionShapes/btCylinderShape.h"
-#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"
-
-#include "BulletCollision/CollisionShapes/btOptimizedBvh.h"
-#include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h"
-#include "BulletCollision/CollisionShapes/btSphereShape.h"
-
-#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
-
-#include "BulletCollision/CollisionShapes/btConvexShape.h"
-#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h"
-#include "BulletCollision/CollisionShapes/btConvexHullShape.h"
-#include "BulletCollision/CollisionShapes/btCompoundShape.h"
-
-#define MAX_NUM_SPU_CONVEX_POINTS 128 //@fallback to PPU if a btConvexHullShape has more than MAX_NUM_SPU_CONVEX_POINTS points
-#define MAX_SPU_COMPOUND_SUBSHAPES 16 //@fallback on PPU if compound has more than MAX_SPU_COMPOUND_SUBSHAPES child shapes
-#define MAX_SHAPE_SIZE 256 //@todo: assert on this
-
-ATTRIBUTE_ALIGNED16(struct)	SpuConvexPolyhedronVertexData
-{
-	void*	gSpuConvexShapePtr;
-	btVector3* gConvexPoints;
-	int gNumConvexPoints;
-	int unused;
-	ATTRIBUTE_ALIGNED16(btVector3 g_convexPointBuffer[MAX_NUM_SPU_CONVEX_POINTS]);
-};
-
-
-
-ATTRIBUTE_ALIGNED16(struct) CollisionShape_LocalStoreMemory
-{
-	ATTRIBUTE_ALIGNED16(char collisionShape[MAX_SHAPE_SIZE]);
-};
-
-ATTRIBUTE_ALIGNED16(struct) CompoundShape_LocalStoreMemory
-{
-	// Compound data
-
-	ATTRIBUTE_ALIGNED16(btCompoundShapeChild gSubshapes[MAX_SPU_COMPOUND_SUBSHAPES]);
-	ATTRIBUTE_ALIGNED16(char gSubshapeShape[MAX_SPU_COMPOUND_SUBSHAPES][MAX_SHAPE_SIZE]);
-};
-
-ATTRIBUTE_ALIGNED16(struct) bvhMeshShape_LocalStoreMemory
-{
-	//ATTRIBUTE_ALIGNED16(btOptimizedBvh	gOptimizedBvh);
-	ATTRIBUTE_ALIGNED16(char gOptimizedBvh[sizeof(btOptimizedBvh)+16]);
-	btOptimizedBvh*	getOptimizedBvh()
-	{
-		return (btOptimizedBvh*) gOptimizedBvh;
-	}
-
-	ATTRIBUTE_ALIGNED16(btTriangleIndexVertexArray	gTriangleMeshInterfaceStorage);
-	btTriangleIndexVertexArray*	gTriangleMeshInterfacePtr;
-	///only a single mesh part for now, we can add support for multiple parts, but quantized trees don't support this at the moment 
-	ATTRIBUTE_ALIGNED16(btIndexedMesh	gIndexMesh);
-	#define MAX_SPU_SUBTREE_HEADERS 32
-	//1024
-	ATTRIBUTE_ALIGNED16(btBvhSubtreeInfo	gSubtreeHeaders[MAX_SPU_SUBTREE_HEADERS]);
-	ATTRIBUTE_ALIGNED16(btQuantizedBvhNode	gSubtreeNodes[MAX_SUBTREE_SIZE_IN_BYTES/sizeof(btQuantizedBvhNode)]);
-};
-
-
-void computeAabb (btVector3& aabbMin, btVector3& aabbMax, btConvexInternalShape* convexShape, ppu_address_t convexShapePtr, int shapeType, const btTransform& xform);
-void dmaBvhShapeData (bvhMeshShape_LocalStoreMemory* bvhMeshShape, btBvhTriangleMeshShape* triMeshShape);
-void dmaBvhIndexedMesh (btIndexedMesh* IndexMesh, IndexedMeshArray& indexArray, int index, uint32_t dmaTag);
-void dmaBvhSubTreeHeaders (btBvhSubtreeInfo* subTreeHeaders, ppu_address_t subTreePtr, int batchSize, uint32_t dmaTag);
-void dmaBvhSubTreeNodes (btQuantizedBvhNode* nodes, const btBvhSubtreeInfo& subtree, QuantizedNodeArray&	nodeArray, int dmaTag);
-
-int  getShapeTypeSize(int shapeType);
-void dmaConvexVertexData (SpuConvexPolyhedronVertexData* convexVertexData, btConvexHullShape* convexShapeSPU);
-void dmaCollisionShape (void* collisionShapeLocation, ppu_address_t collisionShapePtr, uint32_t dmaTag, int shapeType);
-void dmaCompoundShapeInfo (CompoundShape_LocalStoreMemory* compoundShapeLocation, btCompoundShape* spuCompoundShape, uint32_t dmaTag);
-void dmaCompoundSubShapes (CompoundShape_LocalStoreMemory* compoundShapeLocation, btCompoundShape* spuCompoundShape, uint32_t dmaTag);
-
-
-#define USE_BRANCHFREE_TEST 1
-#ifdef USE_BRANCHFREE_TEST
-SIMD_FORCE_INLINE unsigned int spuTestQuantizedAabbAgainstQuantizedAabb(unsigned short int* aabbMin1,unsigned short int* aabbMax1,const unsigned short int* aabbMin2,const unsigned short int* aabbMax2)
-{		
-#if defined(__CELLOS_LV2__) && defined (__SPU__)
-	vec_ushort8 vecMin = {aabbMin1[0],aabbMin2[0],aabbMin1[2],aabbMin2[2],aabbMin1[1],aabbMin2[1],0,0};
-	vec_ushort8 vecMax = {aabbMax2[0],aabbMax1[0],aabbMax2[2],aabbMax1[2],aabbMax2[1],aabbMax1[1],0,0};
-	vec_ushort8 isGt = spu_cmpgt(vecMin,vecMax);
-	return spu_extract(spu_gather(isGt),0)==0;
-
-#else
-	return btSelect((unsigned)((aabbMin1[0] <= aabbMax2[0]) & (aabbMax1[0] >= aabbMin2[0])
-		& (aabbMin1[2] <= aabbMax2[2]) & (aabbMax1[2] >= aabbMin2[2])
-		& (aabbMin1[1] <= aabbMax2[1]) & (aabbMax1[1] >= aabbMin2[1])),
-		1, 0);
-#endif
-}
-#else
-
-SIMD_FORCE_INLINE unsigned int spuTestQuantizedAabbAgainstQuantizedAabb(const unsigned short int* aabbMin1,const unsigned short int* aabbMax1,const unsigned short int* aabbMin2,const unsigned short int*  aabbMax2)
-{
-	unsigned int overlap = 1;
-	overlap = (aabbMin1[0] > aabbMax2[0] || aabbMax1[0] < aabbMin2[0]) ? 0 : overlap;
-	overlap = (aabbMin1[2] > aabbMax2[2] || aabbMax1[2] < aabbMin2[2]) ? 0 : overlap;
-	overlap = (aabbMin1[1] > aabbMax2[1] || aabbMax1[1] < aabbMin2[1]) ? 0 : overlap;
-	return overlap;
-}
-#endif
-
-void	spuWalkStacklessQuantizedTree(btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax,const btQuantizedBvhNode* rootNode,int startNodeIndex,int endNodeIndex);
-
-#endif
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp
deleted file mode 100644
index bd71373..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SpuContactResult.h"
-
-//#define DEBUG_SPU_COLLISION_DETECTION 1
-
-#ifdef DEBUG_SPU_COLLISION_DETECTION
-#ifndef __SPU__
-#include <stdio.h>
-#define spu_printf printf
-#endif
-#endif //DEBUG_SPU_COLLISION_DETECTION
-
-SpuContactResult::SpuContactResult()
-{
-	m_manifoldAddress = 0;
-	m_spuManifold = NULL;
-	m_RequiresWriteBack = false;
-}
-
- SpuContactResult::~SpuContactResult()
-{
-	g_manifoldDmaExport.swapBuffers();
-}
-
- 	///User can override this material combiner by implementing gContactAddedCallback and setting body0->m_collisionFlags |= btCollisionObject::customMaterialCallback;
-inline btScalar	calculateCombinedFriction(btScalar friction0,btScalar friction1)
-{
-	btScalar friction = friction0*friction1;
-
-	const btScalar MAX_FRICTION  = btScalar(10.);
-
-	if (friction < -MAX_FRICTION)
-		friction = -MAX_FRICTION;
-	if (friction > MAX_FRICTION)
-		friction = MAX_FRICTION;
-	return friction;
-
-}
-
-inline btScalar	calculateCombinedRestitution(btScalar restitution0,btScalar restitution1)
-{
-	return restitution0*restitution1;
-}
-
-
-
- void	SpuContactResult::setContactInfo(btPersistentManifold* spuManifold, ppu_address_t	manifoldAddress,const btTransform& worldTrans0,const btTransform& worldTrans1, btScalar restitution0,btScalar restitution1, btScalar friction0,btScalar friction1, bool isSwapped)
- {
-	//spu_printf("SpuContactResult::setContactInfo ManifoldAddress: %lu\n", manifoldAddress);
-	m_rootWorldTransform0 = worldTrans0;
-	m_rootWorldTransform1 = worldTrans1;
-	m_manifoldAddress = manifoldAddress;    
-	m_spuManifold = spuManifold;
-
-	m_combinedFriction = calculateCombinedFriction(friction0,friction1);
-	m_combinedRestitution = calculateCombinedRestitution(restitution0,restitution1);
-	m_isSwapped = isSwapped;
- }
-
- void SpuContactResult::setShapeIdentifiersA(int partId0,int index0)
- {
-	
- }
-
- void SpuContactResult::setShapeIdentifiersB(int partId1,int index1)
- {
-	
- }
-
-
-
- ///return true if it requires a dma transfer back
-bool ManifoldResultAddContactPoint(const btVector3& normalOnBInWorld,
-								   const btVector3& pointInWorld,
-								   float depth,
-								   btPersistentManifold* manifoldPtr,
-								   btTransform& transA,
-								   btTransform& transB,
-									btScalar	combinedFriction,
-									btScalar	combinedRestitution,
-								   bool isSwapped)
-{
-	
-//	float contactTreshold = manifoldPtr->getContactBreakingThreshold();
-
-	//spu_printf("SPU: add contactpoint, depth:%f, contactTreshold %f, manifoldPtr %llx\n",depth,contactTreshold,manifoldPtr);
-
-#ifdef DEBUG_SPU_COLLISION_DETECTION
-	spu_printf("SPU: contactTreshold %f\n",contactTreshold);
-#endif //DEBUG_SPU_COLLISION_DETECTION
-	//if (depth > manifoldPtr->getContactBreakingThreshold())
-	//	return false;
-
-	if (depth > manifoldPtr->getContactProcessingThreshold())
-		return false;
-
-
-
-	btVector3 pointA;
-	btVector3 localA;
-	btVector3 localB;
-	btVector3 normal;
-
-
-	if (isSwapped)
-	{
-		normal = normalOnBInWorld * -1;
-		pointA = pointInWorld + normal * depth;
-		localA = transA.invXform(pointA );
-		localB = transB.invXform(pointInWorld);
-	}
-	else
-	{
-		normal = normalOnBInWorld;
-		pointA = pointInWorld + normal * depth;
-		localA = transA.invXform(pointA );
-		localB = transB.invXform(pointInWorld);
-	}
-
-	btManifoldPoint newPt(localA,localB,normal,depth);
-	newPt.m_positionWorldOnA = pointA;
-	newPt.m_positionWorldOnB = pointInWorld;
-
-	newPt.m_combinedFriction = combinedFriction;
-	newPt.m_combinedRestitution = combinedRestitution;
-
-
-	int insertIndex = manifoldPtr->getCacheEntry(newPt);
-	if (insertIndex >= 0)
-	{
-		// we need to replace the current contact point, otherwise small errors will accumulate (spheres start rolling etc)
-		manifoldPtr->replaceContactPoint(newPt,insertIndex);
-		return true;
-		
-	} else
-	{
-
-		/*
-		///@todo: SPU callbacks, either immediate (local on the SPU), or deferred
-		//User can override friction and/or restitution
-		if (gContactAddedCallback &&
-			//and if either of the two bodies requires custom material
-			 ((m_body0->m_collisionFlags & btCollisionObject::customMaterialCallback) ||
-			   (m_body1->m_collisionFlags & btCollisionObject::customMaterialCallback)))
-		{
-			//experimental feature info, for per-triangle material etc.
-			(*gContactAddedCallback)(newPt,m_body0,m_partId0,m_index0,m_body1,m_partId1,m_index1);
-		}
-		*/
-
-		manifoldPtr->addManifoldPoint(newPt);
-		return true;
-
-	}
-	return false;
-	
-}
-
-
-void SpuContactResult::writeDoubleBufferedManifold(btPersistentManifold* lsManifold, btPersistentManifold* mmManifold)
-{
-	///only write back the contact information on SPU. Other platforms avoid copying, and use the data in-place
-	///see SpuFakeDma.cpp 'cellDmaLargeGetReadOnly'
-#if defined (__SPU__) || defined (USE_LIBSPE2)
-    memcpy(g_manifoldDmaExport.getFront(),lsManifold,sizeof(btPersistentManifold));
-
-    g_manifoldDmaExport.swapBuffers();
-    ppu_address_t mmAddr = (ppu_address_t)mmManifold;
-    g_manifoldDmaExport.backBufferDmaPut(mmAddr, sizeof(btPersistentManifold), DMA_TAG(9));
-	// Should there be any kind of wait here?  What if somebody tries to use this tag again?  What if we call this function again really soon?
-	//no, the swapBuffers does the wait
-#endif
-}
-
-void SpuContactResult::addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)
-{
-#ifdef DEBUG_SPU_COLLISION_DETECTION
-	spu_printf("*** SpuContactResult::addContactPoint: depth = %f\n",depth);
-	spu_printf("*** normal = %f,%f,%f\n",normalOnBInWorld.getX(),normalOnBInWorld.getY(),normalOnBInWorld.getZ());
-	spu_printf("*** position = %f,%f,%f\n",pointInWorld.getX(),pointInWorld.getY(),pointInWorld.getZ());
-#endif //DEBUG_SPU_COLLISION_DETECTION
-	
-
-#ifdef DEBUG_SPU_COLLISION_DETECTION
- //   int sman = sizeof(rage::phManifold);
-//	spu_printf("sizeof_manifold = %i\n",sman);
-#endif //DEBUG_SPU_COLLISION_DETECTION
-
-	btPersistentManifold* localManifold = m_spuManifold;
-
-	btVector3	normalB(normalOnBInWorld.getX(),normalOnBInWorld.getY(),normalOnBInWorld.getZ());
-	btVector3	pointWrld(pointInWorld.getX(),pointInWorld.getY(),pointInWorld.getZ());
-
-	//process the contact point
-	const bool retVal = ManifoldResultAddContactPoint(normalB,
-		pointWrld,
-		depth,
-		localManifold,
-		m_rootWorldTransform0,
-		m_rootWorldTransform1,
-		m_combinedFriction,
-		m_combinedRestitution,
-		m_isSwapped);
-	m_RequiresWriteBack = m_RequiresWriteBack || retVal;
-}
-
-void SpuContactResult::flush()
-{
-
-	if (m_spuManifold && m_spuManifold->getNumContacts())
-	{
-		m_spuManifold->refreshContactPoints(m_rootWorldTransform0,m_rootWorldTransform1);
-		m_RequiresWriteBack = true;
-	}
-
-
-	if (m_RequiresWriteBack)
-	{
-#ifdef DEBUG_SPU_COLLISION_DETECTION
-		spu_printf("SPU: Start SpuContactResult::flush (Put) DMA\n");
-		spu_printf("Num contacts:%d\n", m_spuManifold->getNumContacts());
-		spu_printf("Manifold address: %llu\n", m_manifoldAddress);
-#endif //DEBUG_SPU_COLLISION_DETECTION
-	//	spu_printf("writeDoubleBufferedManifold\n");
-		writeDoubleBufferedManifold(m_spuManifold, (btPersistentManifold*)m_manifoldAddress);
-#ifdef DEBUG_SPU_COLLISION_DETECTION
-		spu_printf("SPU: Finished (Put) DMA\n");
-#endif //DEBUG_SPU_COLLISION_DETECTION
-	}
-	m_spuManifold = NULL;
-	m_RequiresWriteBack = false;
-}
-
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.h
deleted file mode 100644
index 394f56d..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef SPU_CONTACT_RESULT2_H
-#define SPU_CONTACT_RESULT2_H
-
-
-#ifndef _WIN32
-#include <stdint.h>
-#endif
-
-
-
-#include "../SpuDoubleBuffer.h"
-
-
-#include "LinearMath/btTransform.h"
-
-
-#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
-#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"
-
-class btCollisionShape;
-
-
-struct SpuCollisionPairInput
-{
-	ppu_address_t m_collisionShapes[2];
-	btCollisionShape*	m_spuCollisionShapes[2];
-
-	ppu_address_t m_persistentManifoldPtr;
-	btVector3	m_primitiveDimensions0;
-	btVector3	m_primitiveDimensions1;
-	int		m_shapeType0;
-	int		m_shapeType1;	
-	float	m_collisionMargin0;
-	float	m_collisionMargin1;
-
-	btTransform	m_worldTransform0;
-	btTransform m_worldTransform1;
-	
-	bool	m_isSwapped;
-	bool    m_useEpa;
-};
-
-
-struct SpuClosestPointInput : public btDiscreteCollisionDetectorInterface::ClosestPointInput
-{
-	struct SpuConvexPolyhedronVertexData* m_convexVertexData[2];
-};
-
-///SpuContactResult exports the contact points using double-buffered DMA transfers, only when needed
-///So when an existing contact point is duplicated, no transfer/refresh is performed.
-class SpuContactResult : public btDiscreteCollisionDetectorInterface::Result
-{
-    btTransform		m_rootWorldTransform0;
-	btTransform		m_rootWorldTransform1;
-	ppu_address_t	m_manifoldAddress;
-
-    btPersistentManifold* m_spuManifold;
-	bool m_RequiresWriteBack;
-	btScalar	m_combinedFriction;
-	btScalar	m_combinedRestitution;
-	
-	bool m_isSwapped;
-
-	DoubleBuffer<btPersistentManifold, 1> g_manifoldDmaExport;
-
-	public:
-		SpuContactResult();
-		virtual ~SpuContactResult();
-
-		btPersistentManifold*	GetSpuManifold() const
-		{
-			return m_spuManifold;
-		}
-
-		virtual void setShapeIdentifiersA(int partId0,int index0);
-		virtual void setShapeIdentifiersB(int partId1,int index1);
-
-		void	setContactInfo(btPersistentManifold* spuManifold, ppu_address_t	manifoldAddress,const btTransform& worldTrans0,const btTransform& worldTrans1, btScalar restitution0,btScalar restitution1, btScalar friction0,btScalar friction01, bool isSwapped);
-
-
-        void writeDoubleBufferedManifold(btPersistentManifold* lsManifold, btPersistentManifold* mmManifold);
-
-        virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth);
-
-		void flush();
-};
-
-
-
-#endif //SPU_CONTACT_RESULT2_H
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuConvexPenetrationDepthSolver.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuConvexPenetrationDepthSolver.h
deleted file mode 100644
index 449f192..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuConvexPenetrationDepthSolver.h
+++ /dev/null
@@ -1,51 +0,0 @@
-
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef SPU_CONVEX_PENETRATION_DEPTH_H
-#define SPU_CONVEX_PENETRATION_DEPTH_H
-
-
-
-class btStackAlloc;
-class btIDebugDraw;
-#include "BulletCollision/NarrowphaseCollision/btConvexPenetrationDepthSolver.h"
-
-#include "LinearMath/btTransform.h"
-
-
-///ConvexPenetrationDepthSolver provides an interface for penetration depth calculation.
-class SpuConvexPenetrationDepthSolver : public btConvexPenetrationDepthSolver
-{
-public:	
-	
-	virtual ~SpuConvexPenetrationDepthSolver() {};
-	virtual bool calcPenDepth( SpuVoronoiSimplexSolver& simplexSolver,
-	        void* convexA,void* convexB,int shapeTypeA, int shapeTypeB, float marginA, float marginB,
-            btTransform& transA,const btTransform& transB,
-			btVector3& v, btVector3& pa, btVector3& pb,
-			class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc,
-			struct SpuConvexPolyhedronVertexData* convexVertexDataA,
-			struct SpuConvexPolyhedronVertexData* convexVertexDataB
-			) const = 0;
-
-
-};
-
-
-
-#endif //SPU_CONVEX_PENETRATION_DEPTH_H
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp
deleted file mode 100644
index e5e263c..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp
+++ /dev/null
@@ -1,1412 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SpuGatheringCollisionTask.h"
-
-//#define DEBUG_SPU_COLLISION_DETECTION 1
-#include "../SpuDoubleBuffer.h"
-
-#include "../SpuCollisionTaskProcess.h"
-#include "../SpuGatheringCollisionDispatcher.h" //for SPU_BATCHSIZE_BROADPHASE_PAIRS
-
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-#include "../SpuContactManifoldCollisionAlgorithm.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-#include "SpuContactResult.h"
-#include "BulletCollision/CollisionShapes/btOptimizedBvh.h"
-#include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h"
-#include "BulletCollision/CollisionShapes/btSphereShape.h"
-#include "BulletCollision/CollisionShapes/btConvexPointCloudShape.h"
-
-#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
-
-#include "BulletCollision/CollisionShapes/btConvexShape.h"
-#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h"
-#include "BulletCollision/CollisionShapes/btConvexHullShape.h"
-#include "BulletCollision/CollisionShapes/btCompoundShape.h"
-
-#include "SpuMinkowskiPenetrationDepthSolver.h"
-//#include "SpuEpaPenetrationDepthSolver.h"
-#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h"
-
-
-#include "boxBoxDistance.h"
-#include "BulletMultiThreaded/vectormath2bullet.h"
-#include "SpuCollisionShapes.h" //definition of SpuConvexPolyhedronVertexData
-#include "BulletCollision/CollisionDispatch/btBoxBoxDetector.h"
-#include "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h"
-#include "BulletCollision/CollisionShapes/btTriangleShape.h"
-
-#ifdef __SPU__
-///Software caching from the IBM Cell SDK, it reduces 25% SPU time for our test cases
-#ifndef USE_LIBSPE2
-//#define USE_SOFTWARE_CACHE 1
-#endif
-#endif //__SPU__
-
-int gSkippedCol = 0;
-int gProcessedCol = 0;
-
-////////////////////////////////////////////////
-/// software caching
-#if USE_SOFTWARE_CACHE
-#include <spu_intrinsics.h>
-#include <sys/spu_thread.h>
-#include <sys/spu_event.h>
-#include <stdint.h>
-#define SPE_CACHE_NWAY   		4
-//#define SPE_CACHE_NSETS 		32, 16
-#define SPE_CACHE_NSETS 		8
-//#define SPE_CACHELINE_SIZE 		512
-#define SPE_CACHELINE_SIZE 		128
-#define SPE_CACHE_SET_TAGID(set) 	15
-///make sure that spe_cache.h is below those defines!
-#include "../Extras/software_cache/cache/include/spe_cache.h"
-
-
-int g_CacheMisses=0;
-int g_CacheHits=0;
-
-#if 0 // Added to allow cache misses and hits to be tracked, change this to 1 to restore unmodified version
-#define spe_cache_read(ea)		_spe_cache_lookup_xfer_wait_(ea, 0, 1)
-#else
-#define spe_cache_read(ea)		\
-({								\
-    int set, idx, line, byte;					\
-    _spe_cache_nway_lookup_(ea, set, idx);			\
-								\
-    if (btUnlikely(idx < 0)) {					\
-        ++g_CacheMisses;                        \
-	    idx = _spe_cache_miss_(ea, set, -1);			\
-        spu_writech(22, SPE_CACHE_SET_TAGMASK(set));		\
-        spu_mfcstat(MFC_TAG_UPDATE_ALL);			\
-    } 								\
-    else                            \
-    {                               \
-        ++g_CacheHits;              \
-    }                               \
-    line = _spe_cacheline_num_(set, idx);			\
-    byte = _spe_cacheline_byte_offset_(ea);			\
-    (void *) &spe_cache_mem[line + byte];			\
-})
-
-#endif
-
-#endif // USE_SOFTWARE_CACHE
-
-bool gUseEpa = false;
-
-#ifdef USE_SN_TUNER
-#include <LibSN_SPU.h>
-#endif //USE_SN_TUNER
-
-#if defined (__SPU__) && !defined (USE_LIBSPE2)
-#include <spu_printf.h>
-#elif defined (USE_LIBSPE2)
-#define spu_printf(a)
-#else
-#define IGNORE_ALIGNMENT 1
-#include <stdio.h>
-#include <stdlib.h>
-#define spu_printf printf
-
-#endif
-
-//int gNumConvexPoints0=0;
-
-///Make sure no destructors are called on this memory
-struct	CollisionTask_LocalStoreMemory
-{
-	///This CollisionTask_LocalStoreMemory is mainly used for the SPU version, using explicit DMA
-	///Other platforms can use other memory programming models.
-
-	ATTRIBUTE_ALIGNED16(btBroadphasePair	gBroadphasePairsBuffer[SPU_BATCHSIZE_BROADPHASE_PAIRS]);
-	DoubleBuffer<unsigned char, MIDPHASE_WORKUNIT_PAGE_SIZE> g_workUnitTaskBuffers;
-	ATTRIBUTE_ALIGNED16(char gSpuContactManifoldAlgoBuffer [sizeof(SpuContactManifoldCollisionAlgorithm)+16]);
-	ATTRIBUTE_ALIGNED16(char gColObj0Buffer [sizeof(btCollisionObject)+16]);
-	ATTRIBUTE_ALIGNED16(char gColObj1Buffer [sizeof(btCollisionObject)+16]);
-	///we reserve 32bit integer indices, even though they might be 16bit
-	ATTRIBUTE_ALIGNED16(int	spuIndices[16]);
-	btPersistentManifold	gPersistentManifoldBuffer;
-	CollisionShape_LocalStoreMemory gCollisionShapes[2];
-	bvhMeshShape_LocalStoreMemory bvhShapeData;
-	SpuConvexPolyhedronVertexData convexVertexData[2];
-	CompoundShape_LocalStoreMemory compoundShapeData[2];
-		
-	///The following pointers might either point into this local store memory, or to the original/other memory locations.
-	///See SpuFakeDma for implementation of cellDmaSmallGetReadOnly.
-	btCollisionObject*	m_lsColObj0Ptr;
-	btCollisionObject*	m_lsColObj1Ptr;
-	btBroadphasePair* m_pairsPointer;
-	btPersistentManifold*	m_lsManifoldPtr;
-	SpuContactManifoldCollisionAlgorithm*	m_lsCollisionAlgorithmPtr;
-
-	bool	needsDmaPutContactManifoldAlgo;
-
-	btCollisionObject* getColObj0()
-	{
-		return m_lsColObj0Ptr;
-	}
-	btCollisionObject* getColObj1()
-	{
-		return m_lsColObj1Ptr;
-	}
-
-
-	btBroadphasePair* getBroadphasePairPtr()
-	{
-		return m_pairsPointer;
-	}
-
-	SpuContactManifoldCollisionAlgorithm*	getlocalCollisionAlgorithm()
-	{
-		return m_lsCollisionAlgorithmPtr;
-	}
-	
-	btPersistentManifold*	getContactManifoldPtr()
-	{
-		return m_lsManifoldPtr;
-	}
-};
-
-
-#if defined(__CELLOS_LV2__) || defined(USE_LIBSPE2) 
-
-ATTRIBUTE_ALIGNED16(CollisionTask_LocalStoreMemory	gLocalStoreMemory);
-
-void* createCollisionLocalStoreMemory()
-{
-	return &gLocalStoreMemory;
-}
-#else
-void* createCollisionLocalStoreMemory()
-{
-        return new CollisionTask_LocalStoreMemory;
-}
-
-#endif
-
-void	ProcessSpuConvexConvexCollision(SpuCollisionPairInput* wuInput, CollisionTask_LocalStoreMemory* lsMemPtr, SpuContactResult& spuContacts);
-
-
-SIMD_FORCE_INLINE void small_cache_read(void* buffer, ppu_address_t ea, size_t size)
-{
-#if USE_SOFTWARE_CACHE
-	// Check for alignment requirements. We need to make sure the entire request fits within one cache line,
-	// so the first and last bytes should fall on the same cache line
-	btAssert((ea & ~SPE_CACHELINE_MASK) == ((ea + size - 1) & ~SPE_CACHELINE_MASK));
-
-	void* ls = spe_cache_read(ea);
-	memcpy(buffer, ls, size);
-#else
-	stallingUnalignedDmaSmallGet(buffer,ea,size);
-#endif
-}
-
-SIMD_FORCE_INLINE void small_cache_read_triple(	void* ls0, ppu_address_t ea0,
-												void* ls1, ppu_address_t ea1,
-												void* ls2, ppu_address_t ea2,
-												size_t size)
-{
-		btAssert(size<16);
-		ATTRIBUTE_ALIGNED16(char	tmpBuffer0[32]);
-		ATTRIBUTE_ALIGNED16(char	tmpBuffer1[32]);
-		ATTRIBUTE_ALIGNED16(char	tmpBuffer2[32]);
-
-		uint32_t i;
-		
-
-		///make sure last 4 bits are the same, for cellDmaSmallGet
-		char* localStore0 = (char*)ls0;
-		uint32_t last4BitsOffset = ea0 & 0x0f;
-		char* tmpTarget0 = tmpBuffer0 + last4BitsOffset;
-#ifdef __SPU__
-		cellDmaSmallGet(tmpTarget0,ea0,size,DMA_TAG(1),0,0);
-#else
-		tmpTarget0 = (char*)cellDmaSmallGetReadOnly(tmpTarget0,ea0,size,DMA_TAG(1),0,0);
-#endif
-
-
-		char* localStore1 = (char*)ls1;
-		last4BitsOffset = ea1 & 0x0f;
-		char* tmpTarget1 = tmpBuffer1 + last4BitsOffset;
-#ifdef __SPU__
-		cellDmaSmallGet(tmpTarget1,ea1,size,DMA_TAG(1),0,0);
-#else
-		tmpTarget1 = (char*)cellDmaSmallGetReadOnly(tmpTarget1,ea1,size,DMA_TAG(1),0,0);
-#endif
-		
-		char* localStore2 = (char*)ls2;
-		last4BitsOffset = ea2 & 0x0f;
-		char* tmpTarget2 = tmpBuffer2 + last4BitsOffset;
-#ifdef __SPU__
-		cellDmaSmallGet(tmpTarget2,ea2,size,DMA_TAG(1),0,0);
-#else
-		tmpTarget2 = (char*)cellDmaSmallGetReadOnly(tmpTarget2,ea2,size,DMA_TAG(1),0,0);
-#endif
-		
-		
-		cellDmaWaitTagStatusAll( DMA_MASK(1) );
-
-		//this is slowish, perhaps memcpy on SPU is smarter?
-		for (i=0; btLikely( i<size );i++)
-		{
-			localStore0[i] = tmpTarget0[i];
-			localStore1[i] = tmpTarget1[i];
-			localStore2[i] = tmpTarget2[i];
-		}
-
-		
-}
-
-
-
-
-class spuNodeCallback : public btNodeOverlapCallback
-{
-	SpuCollisionPairInput* m_wuInput;
-	SpuContactResult&		m_spuContacts;
-	CollisionTask_LocalStoreMemory*	m_lsMemPtr;
-	ATTRIBUTE_ALIGNED16(btTriangleShape)	m_tmpTriangleShape;
-
-	ATTRIBUTE_ALIGNED16(btVector3	spuTriangleVertices[3]);
-	ATTRIBUTE_ALIGNED16(btScalar	spuUnscaledVertex[4]);
-	
-
-
-public:
-	spuNodeCallback(SpuCollisionPairInput* wuInput, CollisionTask_LocalStoreMemory*	lsMemPtr,SpuContactResult& spuContacts)
-		:	m_wuInput(wuInput),
-		m_spuContacts(spuContacts),
-		m_lsMemPtr(lsMemPtr)
-	{
-	}
-
-	virtual void processNode(int subPart, int triangleIndex)
-	{
-		///Create a triangle on the stack, call process collision, with GJK
-		///DMA the vertices, can benefit from software caching
-
-		//		spu_printf("processNode with triangleIndex %d\n",triangleIndex);
-
-		if (m_lsMemPtr->bvhShapeData.gIndexMesh.m_indexType == PHY_SHORT)
-		{
-			unsigned short int* indexBasePtr = (unsigned short int*)(m_lsMemPtr->bvhShapeData.gIndexMesh.m_triangleIndexBase+triangleIndex*m_lsMemPtr->bvhShapeData.gIndexMesh.m_triangleIndexStride);
-			ATTRIBUTE_ALIGNED16(unsigned short int tmpIndices[3]);
-
-			small_cache_read_triple(&tmpIndices[0],(ppu_address_t)&indexBasePtr[0],
-									&tmpIndices[1],(ppu_address_t)&indexBasePtr[1],
-									&tmpIndices[2],(ppu_address_t)&indexBasePtr[2],
-									sizeof(unsigned short int));
-
-			m_lsMemPtr->spuIndices[0] = int(tmpIndices[0]);
-			m_lsMemPtr->spuIndices[1] = int(tmpIndices[1]);
-			m_lsMemPtr->spuIndices[2] = int(tmpIndices[2]);
-		} else
-		{
-			unsigned int* indexBasePtr = (unsigned int*)(m_lsMemPtr->bvhShapeData.gIndexMesh.m_triangleIndexBase+triangleIndex*m_lsMemPtr->bvhShapeData.gIndexMesh.m_triangleIndexStride);
-
-			small_cache_read_triple(&m_lsMemPtr->spuIndices[0],(ppu_address_t)&indexBasePtr[0],
-								&m_lsMemPtr->spuIndices[1],(ppu_address_t)&indexBasePtr[1],
-								&m_lsMemPtr->spuIndices[2],(ppu_address_t)&indexBasePtr[2],
-								sizeof(int));
-		}
-		
-		//		spu_printf("SPU index0=%d ,",spuIndices[0]);
-		//		spu_printf("SPU index1=%d ,",spuIndices[1]);
-		//		spu_printf("SPU index2=%d ,",spuIndices[2]);
-		//		spu_printf("SPU: indexBasePtr=%llx\n",indexBasePtr);
-
-		const btVector3& meshScaling = m_lsMemPtr->bvhShapeData.gTriangleMeshInterfacePtr->getScaling();
-		for (int j=2;btLikely( j>=0 );j--)
-		{
-			int graphicsindex = m_lsMemPtr->spuIndices[j];
-
-			//			spu_printf("SPU index=%d ,",graphicsindex);
-			btScalar* graphicsbasePtr = (btScalar*)(m_lsMemPtr->bvhShapeData.gIndexMesh.m_vertexBase+graphicsindex*m_lsMemPtr->bvhShapeData.gIndexMesh.m_vertexStride);
-			//			spu_printf("SPU graphicsbasePtr=%llx\n",graphicsbasePtr);
-
-
-			///handle un-aligned vertices...
-
-			//another DMA for each vertex
-			small_cache_read_triple(&spuUnscaledVertex[0],(ppu_address_t)&graphicsbasePtr[0],
-									&spuUnscaledVertex[1],(ppu_address_t)&graphicsbasePtr[1],
-									&spuUnscaledVertex[2],(ppu_address_t)&graphicsbasePtr[2],
-									sizeof(btScalar));
-			
-			m_tmpTriangleShape.getVertexPtr(j).setValue(spuUnscaledVertex[0]*meshScaling.getX(),
-				spuUnscaledVertex[1]*meshScaling.getY(),
-				spuUnscaledVertex[2]*meshScaling.getZ());
-
-			//			spu_printf("SPU:triangle vertices:%f,%f,%f\n",spuTriangleVertices[j].x(),spuTriangleVertices[j].y(),spuTriangleVertices[j].z());
-		}
-
-
-		SpuCollisionPairInput triangleConcaveInput(*m_wuInput);
-//		triangleConcaveInput.m_spuCollisionShapes[1] = &spuTriangleVertices[0];
-		triangleConcaveInput.m_spuCollisionShapes[1] = &m_tmpTriangleShape;
-		triangleConcaveInput.m_shapeType1 = TRIANGLE_SHAPE_PROXYTYPE;
-
-		m_spuContacts.setShapeIdentifiersB(subPart,triangleIndex);
-
-		//		m_spuContacts.flush();
-
-		ProcessSpuConvexConvexCollision(&triangleConcaveInput, m_lsMemPtr,m_spuContacts);
-		///this flush should be automatic
-		//	m_spuContacts.flush();
-	}
-
-};
-
-
-
-void btConvexPlaneCollideSingleContact (SpuCollisionPairInput* wuInput,CollisionTask_LocalStoreMemory* lsMemPtr,SpuContactResult&  spuContacts)
-{
-	
-	btConvexShape* convexShape = (btConvexShape*) wuInput->m_spuCollisionShapes[0];
-	btStaticPlaneShape* planeShape = (btStaticPlaneShape*) wuInput->m_spuCollisionShapes[1];
-
-    bool hasCollision = false;
-	const btVector3& planeNormal = planeShape->getPlaneNormal();
-	const btScalar& planeConstant = planeShape->getPlaneConstant();
-	
-	
-	btTransform convexWorldTransform = wuInput->m_worldTransform0;
-	btTransform convexInPlaneTrans;
-	convexInPlaneTrans= wuInput->m_worldTransform1.inverse() * convexWorldTransform;
-	btTransform planeInConvex;
-	planeInConvex= convexWorldTransform.inverse() * wuInput->m_worldTransform1;
-	
-	//btVector3 vtx = convexShape->localGetSupportVertexWithoutMarginNonVirtual(planeInConvex.getBasis()*-planeNormal);
-	btVector3 vtx = convexShape->localGetSupportVertexNonVirtual(planeInConvex.getBasis()*-planeNormal);
-
-	btVector3 vtxInPlane = convexInPlaneTrans(vtx);
-	btScalar distance = (planeNormal.dot(vtxInPlane) - planeConstant);
-
-	btVector3 vtxInPlaneProjected = vtxInPlane - distance*planeNormal;
-	btVector3 vtxInPlaneWorld = wuInput->m_worldTransform1 * vtxInPlaneProjected;
-
-	hasCollision = distance < lsMemPtr->getContactManifoldPtr()->getContactBreakingThreshold();
-	//resultOut->setPersistentManifold(m_manifoldPtr);
-	if (hasCollision)
-	{
-		/// report a contact. internally this will be kept persistent, and contact reduction is done
-		btVector3 normalOnSurfaceB =wuInput->m_worldTransform1.getBasis() * planeNormal;
-		btVector3 pOnB = vtxInPlaneWorld;
-		spuContacts.addContactPoint(normalOnSurfaceB,pOnB,distance);
-	}
-}
-
-void	ProcessConvexPlaneSpuCollision(SpuCollisionPairInput* wuInput, CollisionTask_LocalStoreMemory* lsMemPtr, SpuContactResult& spuContacts)
-{
-
-		register	int dmaSize = 0;
-		register ppu_address_t	dmaPpuAddress2;
-		btPersistentManifold* manifold = (btPersistentManifold*)wuInput->m_persistentManifoldPtr;
-
-		///DMA in the vertices for convex shapes
-		ATTRIBUTE_ALIGNED16(char convexHullShape0[sizeof(btConvexHullShape)]);
-		ATTRIBUTE_ALIGNED16(char convexHullShape1[sizeof(btConvexHullShape)]);
-
-		if ( btLikely( wuInput->m_shapeType0== CONVEX_HULL_SHAPE_PROXYTYPE ) )
-		{
-			//	spu_printf("SPU: DMA btConvexHullShape\n");
-			
-			dmaSize = sizeof(btConvexHullShape);
-			dmaPpuAddress2 = wuInput->m_collisionShapes[0];
-
-			cellDmaGet(&convexHullShape0, dmaPpuAddress2  , dmaSize, DMA_TAG(1), 0, 0);
-			//cellDmaWaitTagStatusAll(DMA_MASK(1));
-		}
-
-		if ( btLikely( wuInput->m_shapeType1 == CONVEX_HULL_SHAPE_PROXYTYPE ) )
-		{
-			//	spu_printf("SPU: DMA btConvexHullShape\n");
-			dmaSize = sizeof(btConvexHullShape);
-			dmaPpuAddress2 = wuInput->m_collisionShapes[1];
-			cellDmaGet(&convexHullShape1, dmaPpuAddress2  , dmaSize, DMA_TAG(1), 0, 0);
-			//cellDmaWaitTagStatusAll(DMA_MASK(1));
-		}
-		
-		if ( btLikely( wuInput->m_shapeType0 == CONVEX_HULL_SHAPE_PROXYTYPE ) )
-		{		
-			cellDmaWaitTagStatusAll(DMA_MASK(1));
-			dmaConvexVertexData (&lsMemPtr->convexVertexData[0], (btConvexHullShape*)&convexHullShape0);
-			lsMemPtr->convexVertexData[0].gSpuConvexShapePtr = wuInput->m_spuCollisionShapes[0];
-		}
-
-			
-		if ( btLikely( wuInput->m_shapeType1 == CONVEX_HULL_SHAPE_PROXYTYPE ) )
-		{
-			cellDmaWaitTagStatusAll(DMA_MASK(1));
-			dmaConvexVertexData (&lsMemPtr->convexVertexData[1], (btConvexHullShape*)&convexHullShape1);
-			lsMemPtr->convexVertexData[1].gSpuConvexShapePtr = wuInput->m_spuCollisionShapes[1];
-		}
-
-		
-		btConvexPointCloudShape cpc0,cpc1;
-
-		if ( btLikely( wuInput->m_shapeType0 == CONVEX_HULL_SHAPE_PROXYTYPE ) )
-		{
-			cellDmaWaitTagStatusAll(DMA_MASK(2));
-			lsMemPtr->convexVertexData[0].gConvexPoints = &lsMemPtr->convexVertexData[0].g_convexPointBuffer[0];
-			btConvexHullShape* ch = (btConvexHullShape*)wuInput->m_spuCollisionShapes[0];
-			const btVector3& localScaling = ch->getLocalScalingNV();
-			cpc0.setPoints(lsMemPtr->convexVertexData[0].gConvexPoints,lsMemPtr->convexVertexData[0].gNumConvexPoints,false,localScaling);
-			wuInput->m_spuCollisionShapes[0] = &cpc0;
-		}
-
-		if ( btLikely( wuInput->m_shapeType1 == CONVEX_HULL_SHAPE_PROXYTYPE ) )
-		{
-			cellDmaWaitTagStatusAll(DMA_MASK(2));		
-			lsMemPtr->convexVertexData[1].gConvexPoints = &lsMemPtr->convexVertexData[1].g_convexPointBuffer[0];
-			btConvexHullShape* ch = (btConvexHullShape*)wuInput->m_spuCollisionShapes[1];
-			const btVector3& localScaling = ch->getLocalScalingNV();
-			cpc1.setPoints(lsMemPtr->convexVertexData[1].gConvexPoints,lsMemPtr->convexVertexData[1].gNumConvexPoints,false,localScaling);
-			wuInput->m_spuCollisionShapes[1] = &cpc1;
-
-		}
-
-
-//		const btConvexShape* shape0Ptr = (const btConvexShape*)wuInput->m_spuCollisionShapes[0];
-//		const btConvexShape* shape1Ptr = (const btConvexShape*)wuInput->m_spuCollisionShapes[1];
-//		int shapeType0 = wuInput->m_shapeType0;
-//		int shapeType1 = wuInput->m_shapeType1;
-		float marginA = wuInput->m_collisionMargin0;
-		float marginB = wuInput->m_collisionMargin1;
-
-		SpuClosestPointInput	cpInput;
-		cpInput.m_convexVertexData[0] = &lsMemPtr->convexVertexData[0];
-		cpInput.m_convexVertexData[1] = &lsMemPtr->convexVertexData[1];
-		cpInput.m_transformA = wuInput->m_worldTransform0;
-		cpInput.m_transformB = wuInput->m_worldTransform1;
-		float sumMargin = (marginA+marginB+lsMemPtr->getContactManifoldPtr()->getContactBreakingThreshold());
-		cpInput.m_maximumDistanceSquared = sumMargin * sumMargin;
-
-		ppu_address_t manifoldAddress = (ppu_address_t)manifold;
-
-		btPersistentManifold* spuManifold=lsMemPtr->getContactManifoldPtr();
-		//spuContacts.setContactInfo(spuManifold,manifoldAddress,wuInput->m_worldTransform0,wuInput->m_worldTransform1,wuInput->m_isSwapped);
-		spuContacts.setContactInfo(spuManifold,manifoldAddress,lsMemPtr->getColObj0()->getWorldTransform(),
-			lsMemPtr->getColObj1()->getWorldTransform(),
-			lsMemPtr->getColObj0()->getRestitution(),lsMemPtr->getColObj1()->getRestitution(),
-			lsMemPtr->getColObj0()->getFriction(),lsMemPtr->getColObj1()->getFriction(),
-			wuInput->m_isSwapped);
-
-
-		btConvexPlaneCollideSingleContact(wuInput,lsMemPtr,spuContacts);
-
-
-		
-	
-}
-
-
-
-
-////////////////////////
-/// Convex versus Concave triangle mesh collision detection (handles concave triangle mesh versus sphere, box, cylinder, triangle, cone, convex polyhedron etc)
-///////////////////
-void	ProcessConvexConcaveSpuCollision(SpuCollisionPairInput* wuInput, CollisionTask_LocalStoreMemory* lsMemPtr, SpuContactResult& spuContacts)
-{
-	//order: first collision shape is convex, second concave. m_isSwapped is true, if the original order was opposite
-	
-	btBvhTriangleMeshShape*	trimeshShape = (btBvhTriangleMeshShape*)wuInput->m_spuCollisionShapes[1];
-	//need the mesh interface, for access to triangle vertices
-	dmaBvhShapeData (&lsMemPtr->bvhShapeData, trimeshShape);
-
-	btVector3 aabbMin(-1,-400,-1);
-	btVector3 aabbMax(1,400,1);
-
-
-	//recalc aabbs
-	btTransform convexInTriangleSpace;
-	convexInTriangleSpace = wuInput->m_worldTransform1.inverse() * wuInput->m_worldTransform0;
-	btConvexInternalShape* convexShape = (btConvexInternalShape*)wuInput->m_spuCollisionShapes[0];
-
-	computeAabb (aabbMin, aabbMax, convexShape, wuInput->m_collisionShapes[0], wuInput->m_shapeType0, convexInTriangleSpace);
-
-
-	//CollisionShape* triangleShape = static_cast<btCollisionShape*>(triBody->m_collisionShape);
-	//convexShape->getAabb(convexInTriangleSpace,m_aabbMin,m_aabbMax);
-
-	//	btScalar extraMargin = collisionMarginTriangle;
-	//	btVector3 extra(extraMargin,extraMargin,extraMargin);
-	//	aabbMax += extra;
-	//	aabbMin -= extra;
-
-	///quantize query AABB
-	unsigned short int quantizedQueryAabbMin[3];
-	unsigned short int quantizedQueryAabbMax[3];
-	lsMemPtr->bvhShapeData.getOptimizedBvh()->quantizeWithClamp(quantizedQueryAabbMin,aabbMin,0);
-	lsMemPtr->bvhShapeData.getOptimizedBvh()->quantizeWithClamp(quantizedQueryAabbMax,aabbMax,1);
-
-	QuantizedNodeArray&	nodeArray = lsMemPtr->bvhShapeData.getOptimizedBvh()->getQuantizedNodeArray();
-	//spu_printf("SPU: numNodes = %d\n",nodeArray.size());
-
-	BvhSubtreeInfoArray& subTrees = lsMemPtr->bvhShapeData.getOptimizedBvh()->getSubtreeInfoArray();
-
-
-	spuNodeCallback	nodeCallback(wuInput,lsMemPtr,spuContacts);
-	IndexedMeshArray&	indexArray = lsMemPtr->bvhShapeData.gTriangleMeshInterfacePtr->getIndexedMeshArray();
-	//spu_printf("SPU:indexArray.size() = %d\n",indexArray.size());
-
-	//	spu_printf("SPU: numSubTrees = %d\n",subTrees.size());
-	//not likely to happen
-	if (subTrees.size() && indexArray.size() == 1)
-	{
-		///DMA in the index info
-		dmaBvhIndexedMesh (&lsMemPtr->bvhShapeData.gIndexMesh, indexArray, 0 /* index into indexArray */, 1 /* dmaTag */);
-		cellDmaWaitTagStatusAll(DMA_MASK(1));
-		
-		//display the headers
-		int numBatch = subTrees.size();
-		for (int i=0;i<numBatch;)
-		{
-			//@todo- can reorder DMA transfers for less stall
-			int remaining = subTrees.size() - i;
-			int nextBatch = remaining < MAX_SPU_SUBTREE_HEADERS ? remaining : MAX_SPU_SUBTREE_HEADERS;
-			
-			dmaBvhSubTreeHeaders (&lsMemPtr->bvhShapeData.gSubtreeHeaders[0], (ppu_address_t)(&subTrees[i]), nextBatch, 1);
-			cellDmaWaitTagStatusAll(DMA_MASK(1));
-			
-
-			//			spu_printf("nextBatch = %d\n",nextBatch);
-
-			for (int j=0;j<nextBatch;j++)
-			{
-				const btBvhSubtreeInfo& subtree = lsMemPtr->bvhShapeData.gSubtreeHeaders[j];
-
-				unsigned int overlap = spuTestQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,subtree.m_quantizedAabbMin,subtree.m_quantizedAabbMax);
-				if (overlap)
-				{
-					btAssert(subtree.m_subtreeSize);
-
-					//dma the actual nodes of this subtree
-					dmaBvhSubTreeNodes (&lsMemPtr->bvhShapeData.gSubtreeNodes[0], subtree, nodeArray, 2);
-					cellDmaWaitTagStatusAll(DMA_MASK(2));
-
-					/* Walk this subtree */
-					spuWalkStacklessQuantizedTree(&nodeCallback,quantizedQueryAabbMin,quantizedQueryAabbMax,
-						&lsMemPtr->bvhShapeData.gSubtreeNodes[0],
-						0,
-						subtree.m_subtreeSize);
-				}
-				//				spu_printf("subtreeSize = %d\n",gSubtreeHeaders[j].m_subtreeSize);
-			}
-
-			//	unsigned short int	m_quantizedAabbMin[3];
-			//	unsigned short int	m_quantizedAabbMax[3];
-			//	int			m_rootNodeIndex;
-			//	int			m_subtreeSize;
-			i+=nextBatch;
-		}
-
-		//pre-fetch first tree, then loop and double buffer
-	}
-
-}
-
-
-int stats[11]={0,0,0,0,0,0,0,0,0,0,0};
-int degenerateStats[11]={0,0,0,0,0,0,0,0,0,0,0};
-
-
-////////////////////////
-/// Convex versus Convex collision detection (handles collision between sphere, box, cylinder, triangle, cone, convex polyhedron etc)
-///////////////////
-void	ProcessSpuConvexConvexCollision(SpuCollisionPairInput* wuInput, CollisionTask_LocalStoreMemory* lsMemPtr, SpuContactResult& spuContacts)
-{
-	register int dmaSize;
-	register ppu_address_t	dmaPpuAddress2;
-	
-#ifdef DEBUG_SPU_COLLISION_DETECTION
-	//spu_printf("SPU: ProcessSpuConvexConvexCollision\n");
-#endif //DEBUG_SPU_COLLISION_DETECTION
-	//CollisionShape* shape0 = (CollisionShape*)wuInput->m_collisionShapes[0];
-	//CollisionShape* shape1 = (CollisionShape*)wuInput->m_collisionShapes[1];
-	btPersistentManifold* manifold = (btPersistentManifold*)wuInput->m_persistentManifoldPtr;
-
-	bool genericGjk = true;
-
-	if (genericGjk)
-	{
-		//try generic GJK
-
-		
-		
-		//SpuConvexPenetrationDepthSolver* penetrationSolver=0;
-		btVoronoiSimplexSolver simplexSolver;
-		btGjkEpaPenetrationDepthSolver	epaPenetrationSolver2;
-		
-		btConvexPenetrationDepthSolver* penetrationSolver = &epaPenetrationSolver2;
-		
-		//SpuMinkowskiPenetrationDepthSolver	minkowskiPenetrationSolver;
-#ifdef ENABLE_EPA
-		if (gUseEpa)
-		{
-			penetrationSolver = &epaPenetrationSolver2;
-		} else
-#endif
-		{
-			//penetrationSolver = &minkowskiPenetrationSolver;
-		}
-
-
-		///DMA in the vertices for convex shapes
-		ATTRIBUTE_ALIGNED16(char convexHullShape0[sizeof(btConvexHullShape)]);
-		ATTRIBUTE_ALIGNED16(char convexHullShape1[sizeof(btConvexHullShape)]);
-
-		if ( btLikely( wuInput->m_shapeType0== CONVEX_HULL_SHAPE_PROXYTYPE ) )
-		{
-			//	spu_printf("SPU: DMA btConvexHullShape\n");
-			
-			dmaSize = sizeof(btConvexHullShape);
-			dmaPpuAddress2 = wuInput->m_collisionShapes[0];
-
-			cellDmaGet(&convexHullShape0, dmaPpuAddress2  , dmaSize, DMA_TAG(1), 0, 0);
-			//cellDmaWaitTagStatusAll(DMA_MASK(1));
-		}
-
-		if ( btLikely( wuInput->m_shapeType1 == CONVEX_HULL_SHAPE_PROXYTYPE ) )
-		{
-			//	spu_printf("SPU: DMA btConvexHullShape\n");
-			dmaSize = sizeof(btConvexHullShape);
-			dmaPpuAddress2 = wuInput->m_collisionShapes[1];
-			cellDmaGet(&convexHullShape1, dmaPpuAddress2  , dmaSize, DMA_TAG(1), 0, 0);
-			//cellDmaWaitTagStatusAll(DMA_MASK(1));
-		}
-		
-		if ( btLikely( wuInput->m_shapeType0 == CONVEX_HULL_SHAPE_PROXYTYPE ) )
-		{		
-			cellDmaWaitTagStatusAll(DMA_MASK(1));
-			dmaConvexVertexData (&lsMemPtr->convexVertexData[0], (btConvexHullShape*)&convexHullShape0);
-			lsMemPtr->convexVertexData[0].gSpuConvexShapePtr = wuInput->m_spuCollisionShapes[0];
-		}
-
-			
-		if ( btLikely( wuInput->m_shapeType1 == CONVEX_HULL_SHAPE_PROXYTYPE ) )
-		{
-			cellDmaWaitTagStatusAll(DMA_MASK(1));
-			dmaConvexVertexData (&lsMemPtr->convexVertexData[1], (btConvexHullShape*)&convexHullShape1);
-			lsMemPtr->convexVertexData[1].gSpuConvexShapePtr = wuInput->m_spuCollisionShapes[1];
-		}
-
-		
-		btConvexPointCloudShape cpc0,cpc1;
-
-		if ( btLikely( wuInput->m_shapeType0 == CONVEX_HULL_SHAPE_PROXYTYPE ) )
-		{
-			cellDmaWaitTagStatusAll(DMA_MASK(2));
-			lsMemPtr->convexVertexData[0].gConvexPoints = &lsMemPtr->convexVertexData[0].g_convexPointBuffer[0];
-			btConvexHullShape* ch = (btConvexHullShape*)wuInput->m_spuCollisionShapes[0];
-			const btVector3& localScaling = ch->getLocalScalingNV();
-			cpc0.setPoints(lsMemPtr->convexVertexData[0].gConvexPoints,lsMemPtr->convexVertexData[0].gNumConvexPoints,false,localScaling);
-			wuInput->m_spuCollisionShapes[0] = &cpc0;
-		}
-
-		if ( btLikely( wuInput->m_shapeType1 == CONVEX_HULL_SHAPE_PROXYTYPE ) )
-		{
-			cellDmaWaitTagStatusAll(DMA_MASK(2));		
-			lsMemPtr->convexVertexData[1].gConvexPoints = &lsMemPtr->convexVertexData[1].g_convexPointBuffer[0];
-			btConvexHullShape* ch = (btConvexHullShape*)wuInput->m_spuCollisionShapes[1];
-			const btVector3& localScaling = ch->getLocalScalingNV();
-			cpc1.setPoints(lsMemPtr->convexVertexData[1].gConvexPoints,lsMemPtr->convexVertexData[1].gNumConvexPoints,false,localScaling);
-			wuInput->m_spuCollisionShapes[1] = &cpc1;
-
-		}
-
-
-		const btConvexShape* shape0Ptr = (const btConvexShape*)wuInput->m_spuCollisionShapes[0];
-		const btConvexShape* shape1Ptr = (const btConvexShape*)wuInput->m_spuCollisionShapes[1];
-		int shapeType0 = wuInput->m_shapeType0;
-		int shapeType1 = wuInput->m_shapeType1;
-		float marginA = wuInput->m_collisionMargin0;
-		float marginB = wuInput->m_collisionMargin1;
-
-		SpuClosestPointInput	cpInput;
-		cpInput.m_convexVertexData[0] = &lsMemPtr->convexVertexData[0];
-		cpInput.m_convexVertexData[1] = &lsMemPtr->convexVertexData[1];
-		cpInput.m_transformA = wuInput->m_worldTransform0;
-		cpInput.m_transformB = wuInput->m_worldTransform1;
-		float sumMargin = (marginA+marginB+lsMemPtr->getContactManifoldPtr()->getContactBreakingThreshold());
-		cpInput.m_maximumDistanceSquared = sumMargin * sumMargin;
-
-		ppu_address_t manifoldAddress = (ppu_address_t)manifold;
-
-		btPersistentManifold* spuManifold=lsMemPtr->getContactManifoldPtr();
-		//spuContacts.setContactInfo(spuManifold,manifoldAddress,wuInput->m_worldTransform0,wuInput->m_worldTransform1,wuInput->m_isSwapped);
-		spuContacts.setContactInfo(spuManifold,manifoldAddress,lsMemPtr->getColObj0()->getWorldTransform(),
-			lsMemPtr->getColObj1()->getWorldTransform(),
-			lsMemPtr->getColObj0()->getRestitution(),lsMemPtr->getColObj1()->getRestitution(),
-			lsMemPtr->getColObj0()->getFriction(),lsMemPtr->getColObj1()->getFriction(),
-			wuInput->m_isSwapped);
-
-		{
-			btGjkPairDetector gjk(shape0Ptr,shape1Ptr,shapeType0,shapeType1,marginA,marginB,&simplexSolver,penetrationSolver);//&vsSolver,penetrationSolver);
-			gjk.getClosestPoints(cpInput,spuContacts,0);//,debugDraw);
-			
-			stats[gjk.m_lastUsedMethod]++;
-			degenerateStats[gjk.m_degenerateSimplex]++;
-
-#ifdef USE_SEPDISTANCE_UTIL			
-			btScalar sepDist = gjk.getCachedSeparatingDistance()+spuManifold->getContactBreakingThreshold();
-			lsMemPtr->getlocalCollisionAlgorithm()->m_sepDistance.initSeparatingDistance(gjk.getCachedSeparatingAxis(),sepDist,wuInput->m_worldTransform0,wuInput->m_worldTransform1);
-			lsMemPtr->needsDmaPutContactManifoldAlgo = true;
-#endif //USE_SEPDISTANCE_UTIL
-
-		}
-
-	}
-
-
-}
-
-
-template<typename T> void DoSwap(T& a, T& b)
-{
-	char tmp[sizeof(T)];
-	memcpy(tmp, &a, sizeof(T));
-	memcpy(&a, &b, sizeof(T));
-	memcpy(&b, tmp, sizeof(T));
-}
-
-SIMD_FORCE_INLINE void	dmaAndSetupCollisionObjects(SpuCollisionPairInput& collisionPairInput, CollisionTask_LocalStoreMemory& lsMem)
-{
-	register int dmaSize;
-	register ppu_address_t	dmaPpuAddress2;
-		
-	dmaSize = sizeof(btCollisionObject);//btTransform);
-	dmaPpuAddress2 = /*collisionPairInput.m_isSwapped ? (ppu_address_t)lsMem.gProxyPtr1->m_clientObject :*/ (ppu_address_t)lsMem.getlocalCollisionAlgorithm()->getCollisionObject0();
-	lsMem.m_lsColObj0Ptr = (btCollisionObject*)cellDmaGetReadOnly(&lsMem.gColObj0Buffer, dmaPpuAddress2  , dmaSize, DMA_TAG(1), 0, 0);		
-
-	dmaSize = sizeof(btCollisionObject);//btTransform);
-	dmaPpuAddress2 = /*collisionPairInput.m_isSwapped ? (ppu_address_t)lsMem.gProxyPtr0->m_clientObject :*/ (ppu_address_t)lsMem.getlocalCollisionAlgorithm()->getCollisionObject1();
-	lsMem.m_lsColObj1Ptr = (btCollisionObject*)cellDmaGetReadOnly(&lsMem.gColObj1Buffer, dmaPpuAddress2  , dmaSize, DMA_TAG(2), 0, 0);		
-	
-	cellDmaWaitTagStatusAll(DMA_MASK(1) | DMA_MASK(2));
-
-	btCollisionObject* ob0 = lsMem.getColObj0();
-	btCollisionObject* ob1 = lsMem.getColObj1();
-
-	collisionPairInput.m_worldTransform0 = ob0->getWorldTransform();
-	collisionPairInput.m_worldTransform1 = ob1->getWorldTransform();
-}
-
-
-
-void	handleCollisionPair(SpuCollisionPairInput& collisionPairInput, CollisionTask_LocalStoreMemory& lsMem,
-							SpuContactResult &spuContacts,
-							ppu_address_t collisionShape0Ptr, void* collisionShape0Loc,
-							ppu_address_t collisionShape1Ptr, void* collisionShape1Loc, bool dmaShapes = true)
-{
-	
-	if (btBroadphaseProxy::isConvex(collisionPairInput.m_shapeType0) 
-		&& btBroadphaseProxy::isConvex(collisionPairInput.m_shapeType1))
-	{
-		if (dmaShapes)
-		{
-			dmaCollisionShape (collisionShape0Loc, collisionShape0Ptr, 1, collisionPairInput.m_shapeType0);
-			dmaCollisionShape (collisionShape1Loc, collisionShape1Ptr, 2, collisionPairInput.m_shapeType1);
-			cellDmaWaitTagStatusAll(DMA_MASK(1) | DMA_MASK(2));
-		}
-
-		btConvexInternalShape* spuConvexShape0 = (btConvexInternalShape*)collisionShape0Loc;
-		btConvexInternalShape* spuConvexShape1 = (btConvexInternalShape*)collisionShape1Loc;
-
-		btVector3 dim0 = spuConvexShape0->getImplicitShapeDimensions();
-		btVector3 dim1 = spuConvexShape1->getImplicitShapeDimensions();
-
-		collisionPairInput.m_primitiveDimensions0 = dim0;
-		collisionPairInput.m_primitiveDimensions1 = dim1;
-		collisionPairInput.m_collisionShapes[0] = collisionShape0Ptr;
-		collisionPairInput.m_collisionShapes[1] = collisionShape1Ptr;
-		collisionPairInput.m_spuCollisionShapes[0] = spuConvexShape0;
-		collisionPairInput.m_spuCollisionShapes[1] = spuConvexShape1;
-		ProcessSpuConvexConvexCollision(&collisionPairInput,&lsMem,spuContacts);
-	} 
-	else if (btBroadphaseProxy::isCompound(collisionPairInput.m_shapeType0) && 
-			btBroadphaseProxy::isCompound(collisionPairInput.m_shapeType1))
-	{
-		//snPause();
-
-		dmaCollisionShape (collisionShape0Loc, collisionShape0Ptr, 1, collisionPairInput.m_shapeType0);
-		dmaCollisionShape (collisionShape1Loc, collisionShape1Ptr, 2, collisionPairInput.m_shapeType1);
-		cellDmaWaitTagStatusAll(DMA_MASK(1) | DMA_MASK(2));
-
-		// Both are compounds, do N^2 CD for now
-		///@todo: add some AABB-based pruning (probably not -> slower)
-	
-		btCompoundShape* spuCompoundShape0 = (btCompoundShape*)collisionShape0Loc;
-		btCompoundShape* spuCompoundShape1 = (btCompoundShape*)collisionShape1Loc;
-
-		dmaCompoundShapeInfo (&lsMem.compoundShapeData[0], spuCompoundShape0, 1);
-		dmaCompoundShapeInfo (&lsMem.compoundShapeData[1], spuCompoundShape1, 2);
-		cellDmaWaitTagStatusAll(DMA_MASK(1) | DMA_MASK(2));
-		
-
-		dmaCompoundSubShapes (&lsMem.compoundShapeData[0], spuCompoundShape0, 1);
-		cellDmaWaitTagStatusAll(DMA_MASK(1));
-		dmaCompoundSubShapes (&lsMem.compoundShapeData[1], spuCompoundShape1, 1);
-		cellDmaWaitTagStatusAll(DMA_MASK(1));
-
-		int childShapeCount0 = spuCompoundShape0->getNumChildShapes();
-		btAssert(childShapeCount0< MAX_SPU_COMPOUND_SUBSHAPES);
-		int childShapeCount1 = spuCompoundShape1->getNumChildShapes();
-		btAssert(childShapeCount1< MAX_SPU_COMPOUND_SUBSHAPES);
-
-		// Start the N^2
-		for (int i = 0; i < childShapeCount0; ++i)
-		{
-			btCompoundShapeChild& childShape0 = lsMem.compoundShapeData[0].gSubshapes[i];
-			btAssert(!btBroadphaseProxy::isCompound(childShape0.m_childShapeType));
-
-			for (int j = 0; j < childShapeCount1; ++j)
-			{
-				btCompoundShapeChild& childShape1 = lsMem.compoundShapeData[1].gSubshapes[j];
-				btAssert(!btBroadphaseProxy::isCompound(childShape1.m_childShapeType));
-
-
-				/* Create a new collision pair input struct using the two child shapes */
-				SpuCollisionPairInput cinput (collisionPairInput);
-
-				cinput.m_worldTransform0 = collisionPairInput.m_worldTransform0 * childShape0.m_transform;
-				cinput.m_shapeType0 = childShape0.m_childShapeType;
-				cinput.m_collisionMargin0 = childShape0.m_childMargin;
-
-				cinput.m_worldTransform1 = collisionPairInput.m_worldTransform1 * childShape1.m_transform;
-				cinput.m_shapeType1 = childShape1.m_childShapeType;
-				cinput.m_collisionMargin1 = childShape1.m_childMargin;
-				/* Recursively call handleCollisionPair () with new collision pair input */
-				
-				handleCollisionPair(cinput, lsMem, spuContacts,			
-					(ppu_address_t)childShape0.m_childShape, lsMem.compoundShapeData[0].gSubshapeShape[i], 
-					(ppu_address_t)childShape1.m_childShape, lsMem.compoundShapeData[1].gSubshapeShape[j], false);
-			}
-		}
-	}
-	else if (btBroadphaseProxy::isCompound(collisionPairInput.m_shapeType0) )
-	{
-		//snPause();
-		
-		dmaCollisionShape (collisionShape0Loc, collisionShape0Ptr, 1, collisionPairInput.m_shapeType0);
-		dmaCollisionShape (collisionShape1Loc, collisionShape1Ptr, 2, collisionPairInput.m_shapeType1);
-		cellDmaWaitTagStatusAll(DMA_MASK(1) | DMA_MASK(2));
-
-		// object 0 compound, object 1 non-compound
-		btCompoundShape* spuCompoundShape = (btCompoundShape*)collisionShape0Loc;
-		dmaCompoundShapeInfo (&lsMem.compoundShapeData[0], spuCompoundShape, 1);
-		cellDmaWaitTagStatusAll(DMA_MASK(1));
-
-		int childShapeCount = spuCompoundShape->getNumChildShapes();
-		btAssert(childShapeCount< MAX_SPU_COMPOUND_SUBSHAPES);
-
-		for (int i = 0; i < childShapeCount; ++i)
-		{
-			btCompoundShapeChild& childShape = lsMem.compoundShapeData[0].gSubshapes[i];
-			btAssert(!btBroadphaseProxy::isCompound(childShape.m_childShapeType));
-			// Dma the child shape
-			dmaCollisionShape (&lsMem.compoundShapeData[0].gSubshapeShape[i], (ppu_address_t)childShape.m_childShape, 1, childShape.m_childShapeType);
-			cellDmaWaitTagStatusAll(DMA_MASK(1));
-			
-			SpuCollisionPairInput cinput (collisionPairInput);
-			cinput.m_worldTransform0 = collisionPairInput.m_worldTransform0 * childShape.m_transform;
-			cinput.m_shapeType0 = childShape.m_childShapeType;
-			cinput.m_collisionMargin0 = childShape.m_childMargin;
-
-			handleCollisionPair(cinput, lsMem, spuContacts,			
-				(ppu_address_t)childShape.m_childShape, lsMem.compoundShapeData[0].gSubshapeShape[i], 
-				collisionShape1Ptr, collisionShape1Loc, false);
-		}
-	}
-	else if (btBroadphaseProxy::isCompound(collisionPairInput.m_shapeType1) )
-	{
-		//snPause();
-		
-		dmaCollisionShape (collisionShape0Loc, collisionShape0Ptr, 1, collisionPairInput.m_shapeType0);
-		dmaCollisionShape (collisionShape1Loc, collisionShape1Ptr, 2, collisionPairInput.m_shapeType1);
-		cellDmaWaitTagStatusAll(DMA_MASK(1) | DMA_MASK(2));
-		// object 0 non-compound, object 1 compound
-		btCompoundShape* spuCompoundShape = (btCompoundShape*)collisionShape1Loc;
-		dmaCompoundShapeInfo (&lsMem.compoundShapeData[0], spuCompoundShape, 1);
-		cellDmaWaitTagStatusAll(DMA_MASK(1));
-		
-		int childShapeCount = spuCompoundShape->getNumChildShapes();
-		btAssert(childShapeCount< MAX_SPU_COMPOUND_SUBSHAPES);
-
-
-		for (int i = 0; i < childShapeCount; ++i)
-		{
-			btCompoundShapeChild& childShape = lsMem.compoundShapeData[0].gSubshapes[i];
-			btAssert(!btBroadphaseProxy::isCompound(childShape.m_childShapeType));
-			// Dma the child shape
-			dmaCollisionShape (&lsMem.compoundShapeData[0].gSubshapeShape[i], (ppu_address_t)childShape.m_childShape, 1, childShape.m_childShapeType);
-			cellDmaWaitTagStatusAll(DMA_MASK(1));
-
-			SpuCollisionPairInput cinput (collisionPairInput);
-			cinput.m_worldTransform1 = collisionPairInput.m_worldTransform1 * childShape.m_transform;
-			cinput.m_shapeType1 = childShape.m_childShapeType;
-			cinput.m_collisionMargin1 = childShape.m_childMargin;
-			handleCollisionPair(cinput, lsMem, spuContacts,
-				collisionShape0Ptr, collisionShape0Loc, 
-				(ppu_address_t)childShape.m_childShape, lsMem.compoundShapeData[0].gSubshapeShape[i], false);
-		}
-		
-	}
-	else
-	{
-		//a non-convex shape is involved									
-		bool handleConvexConcave = false;
-
-		//snPause();
-
-		if (btBroadphaseProxy::isConcave(collisionPairInput.m_shapeType0) &&
-			btBroadphaseProxy::isConvex(collisionPairInput.m_shapeType1))
-		{
-			// Swap stuff
-			DoSwap(collisionShape0Ptr, collisionShape1Ptr);
-			DoSwap(collisionShape0Loc, collisionShape1Loc);
-			DoSwap(collisionPairInput.m_shapeType0, collisionPairInput.m_shapeType1);
-			DoSwap(collisionPairInput.m_worldTransform0, collisionPairInput.m_worldTransform1);
-			DoSwap(collisionPairInput.m_collisionMargin0, collisionPairInput.m_collisionMargin1);
-			
-			collisionPairInput.m_isSwapped = true;
-		}
-		
-		if (btBroadphaseProxy::isConvex(collisionPairInput.m_shapeType0)&&
-			btBroadphaseProxy::isConcave(collisionPairInput.m_shapeType1))
-		{
-			handleConvexConcave = true;
-		}
-		if (handleConvexConcave)
-		{
-			if (dmaShapes)
-			{
-				dmaCollisionShape (collisionShape0Loc, collisionShape0Ptr, 1, collisionPairInput.m_shapeType0);
-				dmaCollisionShape (collisionShape1Loc, collisionShape1Ptr, 2, collisionPairInput.m_shapeType1);
-				cellDmaWaitTagStatusAll(DMA_MASK(1) | DMA_MASK(2));
-			}
-			
-			if (collisionPairInput.m_shapeType1 == STATIC_PLANE_PROXYTYPE)
-			{
-				btConvexInternalShape* spuConvexShape0 = (btConvexInternalShape*)collisionShape0Loc;
-				btStaticPlaneShape* planeShape= (btStaticPlaneShape*)collisionShape1Loc;
-
-				btVector3 dim0 = spuConvexShape0->getImplicitShapeDimensions();
-				collisionPairInput.m_primitiveDimensions0 = dim0;
-				collisionPairInput.m_collisionShapes[0] = collisionShape0Ptr;
-				collisionPairInput.m_collisionShapes[1] = collisionShape1Ptr;
-				collisionPairInput.m_spuCollisionShapes[0] = spuConvexShape0;
-				collisionPairInput.m_spuCollisionShapes[1] = planeShape;
-
-				ProcessConvexPlaneSpuCollision(&collisionPairInput,&lsMem,spuContacts);
-			} else
-			{
-				btConvexInternalShape* spuConvexShape0 = (btConvexInternalShape*)collisionShape0Loc;
-				btBvhTriangleMeshShape* trimeshShape = (btBvhTriangleMeshShape*)collisionShape1Loc;
-
-				btVector3 dim0 = spuConvexShape0->getImplicitShapeDimensions();
-				collisionPairInput.m_primitiveDimensions0 = dim0;
-				collisionPairInput.m_collisionShapes[0] = collisionShape0Ptr;
-				collisionPairInput.m_collisionShapes[1] = collisionShape1Ptr;
-				collisionPairInput.m_spuCollisionShapes[0] = spuConvexShape0;
-				collisionPairInput.m_spuCollisionShapes[1] = trimeshShape;
-
-				ProcessConvexConcaveSpuCollision(&collisionPairInput,&lsMem,spuContacts);
-			}
-		}
-
-	}
-	
-	spuContacts.flush();
-
-}
-
-
-void	processCollisionTask(void* userPtr, void* lsMemPtr)
-{
-
-	SpuGatherAndProcessPairsTaskDesc* taskDescPtr = (SpuGatherAndProcessPairsTaskDesc*)userPtr;
-	SpuGatherAndProcessPairsTaskDesc& taskDesc = *taskDescPtr;
-	CollisionTask_LocalStoreMemory*	colMemPtr = (CollisionTask_LocalStoreMemory*)lsMemPtr;
-	CollisionTask_LocalStoreMemory& lsMem = *(colMemPtr);
-
-	gUseEpa = taskDesc.m_useEpa;
-
-	//	spu_printf("taskDescPtr=%llx\n",taskDescPtr);
-
-	SpuContactResult spuContacts;
-
-	////////////////////
-
-	ppu_address_t dmaInPtr = taskDesc.m_inPairPtr;
-	unsigned int numPages = taskDesc.numPages;
-	unsigned int numOnLastPage = taskDesc.numOnLastPage;
-
-	// prefetch first set of inputs and wait
-	lsMem.g_workUnitTaskBuffers.init();
-
-	unsigned int nextNumOnPage = (numPages > 1)? MIDPHASE_NUM_WORKUNITS_PER_PAGE : numOnLastPage;
-	lsMem.g_workUnitTaskBuffers.backBufferDmaGet(dmaInPtr, nextNumOnPage*sizeof(SpuGatherAndProcessWorkUnitInput), DMA_TAG(3));
-	dmaInPtr += MIDPHASE_WORKUNIT_PAGE_SIZE;
-
-	
-	register unsigned char *inputPtr;
-	register unsigned int numOnPage;
-	register unsigned int j;
-	SpuGatherAndProcessWorkUnitInput* wuInputs;	
-	register int dmaSize;
-	register ppu_address_t	dmaPpuAddress;
-	register ppu_address_t	dmaPpuAddress2;
-
-	int numPairs;
-	register int p;
-	SpuCollisionPairInput collisionPairInput;
-	
-	for (unsigned int i = 0; btLikely(i < numPages); i++)
-	{
-
-		// wait for back buffer dma and swap buffers
-		inputPtr = lsMem.g_workUnitTaskBuffers.swapBuffers();
-
-		// number on current page is number prefetched last iteration
-		numOnPage = nextNumOnPage;
-
-
-		// prefetch next set of inputs
-#if MIDPHASE_NUM_WORKUNIT_PAGES > 2
-		if ( btLikely( i < numPages-1 ) )
-#else
-		if ( btUnlikely( i < numPages-1 ) )
-#endif
-		{
-			nextNumOnPage = (i == numPages-2)? numOnLastPage : MIDPHASE_NUM_WORKUNITS_PER_PAGE;
-			lsMem.g_workUnitTaskBuffers.backBufferDmaGet(dmaInPtr, nextNumOnPage*sizeof(SpuGatherAndProcessWorkUnitInput), DMA_TAG(3));
-			dmaInPtr += MIDPHASE_WORKUNIT_PAGE_SIZE;
-		}
-
-		wuInputs = reinterpret_cast<SpuGatherAndProcessWorkUnitInput *>(inputPtr);
-		
-		
-		for (j = 0; btLikely( j < numOnPage ); j++)
-		{
-#ifdef DEBUG_SPU_COLLISION_DETECTION
-		//	printMidphaseInput(&wuInputs[j]);
-#endif //DEBUG_SPU_COLLISION_DETECTION
-
-
-			numPairs = wuInputs[j].m_endIndex - wuInputs[j].m_startIndex;
-			
-			if ( btLikely( numPairs ) )
-			{
-					dmaSize = numPairs*sizeof(btBroadphasePair);
-					dmaPpuAddress = wuInputs[j].m_pairArrayPtr+wuInputs[j].m_startIndex * sizeof(btBroadphasePair);
-					lsMem.m_pairsPointer = (btBroadphasePair*)cellDmaGetReadOnly(&lsMem.gBroadphasePairsBuffer, dmaPpuAddress  , dmaSize, DMA_TAG(1), 0, 0);
-					cellDmaWaitTagStatusAll(DMA_MASK(1));
-				
-
-				for (p=0;p<numPairs;p++)
-				{
-
-					//for each broadphase pair, do something
-
-					btBroadphasePair& pair = lsMem.getBroadphasePairPtr()[p];
-#ifdef DEBUG_SPU_COLLISION_DETECTION
-					spu_printf("pair->m_userInfo = %d\n",pair.m_userInfo);
-					spu_printf("pair->m_algorithm = %d\n",pair.m_algorithm);
-					spu_printf("pair->m_pProxy0 = %d\n",pair.m_pProxy0);
-					spu_printf("pair->m_pProxy1 = %d\n",pair.m_pProxy1);
-#endif //DEBUG_SPU_COLLISION_DETECTION
-
-					if (pair.m_internalTmpValue == 2 && pair.m_algorithm && pair.m_pProxy0 && pair.m_pProxy1)
-					{
-						dmaSize = sizeof(SpuContactManifoldCollisionAlgorithm);
-						dmaPpuAddress2 = (ppu_address_t)pair.m_algorithm;
-						lsMem.m_lsCollisionAlgorithmPtr = (SpuContactManifoldCollisionAlgorithm*)cellDmaGetReadOnly(&lsMem.gSpuContactManifoldAlgoBuffer, dmaPpuAddress2  , dmaSize, DMA_TAG(1), 0, 0);
-
-						cellDmaWaitTagStatusAll(DMA_MASK(1));
-
-						lsMem.needsDmaPutContactManifoldAlgo = false;
-
-						collisionPairInput.m_persistentManifoldPtr = (ppu_address_t) lsMem.getlocalCollisionAlgorithm()->getContactManifoldPtr();
-						collisionPairInput.m_isSwapped = false;
-
-						if (1)
-						{
-
-							///can wait on the combined DMA_MASK, or dma on the same tag
-
-
-#ifdef DEBUG_SPU_COLLISION_DETECTION
-					//		spu_printf("SPU collisionPairInput->m_shapeType0 = %d\n",collisionPairInput->m_shapeType0);
-					//		spu_printf("SPU collisionPairInput->m_shapeType1 = %d\n",collisionPairInput->m_shapeType1);
-#endif //DEBUG_SPU_COLLISION_DETECTION
-
-							
-							dmaSize = sizeof(btPersistentManifold);
-
-							dmaPpuAddress2 = collisionPairInput.m_persistentManifoldPtr;
-							lsMem.m_lsManifoldPtr = (btPersistentManifold*)cellDmaGetReadOnly(&lsMem.gPersistentManifoldBuffer, dmaPpuAddress2  , dmaSize, DMA_TAG(1), 0, 0);
-
-							collisionPairInput.m_shapeType0 = lsMem.getlocalCollisionAlgorithm()->getShapeType0();
-							collisionPairInput.m_shapeType1 = lsMem.getlocalCollisionAlgorithm()->getShapeType1();
-							collisionPairInput.m_collisionMargin0 = lsMem.getlocalCollisionAlgorithm()->getCollisionMargin0();
-							collisionPairInput.m_collisionMargin1 = lsMem.getlocalCollisionAlgorithm()->getCollisionMargin1();
-							
-							
-							
-							//??cellDmaWaitTagStatusAll(DMA_MASK(1));
-							
-
-							if (1)
-							{
-								//snPause();
-
-								// Get the collision objects
-								dmaAndSetupCollisionObjects(collisionPairInput, lsMem);
-
-								if (lsMem.getColObj0()->isActive() || lsMem.getColObj1()->isActive())
-								{
-
-									lsMem.needsDmaPutContactManifoldAlgo = true;
-#ifdef USE_SEPDISTANCE_UTIL
-									lsMem.getlocalCollisionAlgorithm()->m_sepDistance.updateSeparatingDistance(collisionPairInput.m_worldTransform0,collisionPairInput.m_worldTransform1);
-#endif //USE_SEPDISTANCE_UTIL
-							
-#define USE_DEDICATED_BOX_BOX 1
-#ifdef USE_DEDICATED_BOX_BOX
-									bool boxbox = ((lsMem.getlocalCollisionAlgorithm()->getShapeType0()==BOX_SHAPE_PROXYTYPE)&&
-										(lsMem.getlocalCollisionAlgorithm()->getShapeType1()==BOX_SHAPE_PROXYTYPE));
-									if (boxbox)
-									{
-										//spu_printf("boxbox dist = %f\n",distance);
-										btPersistentManifold* spuManifold=lsMem.getContactManifoldPtr();
-										btPersistentManifold* manifold = (btPersistentManifold*)collisionPairInput.m_persistentManifoldPtr;
-										ppu_address_t manifoldAddress = (ppu_address_t)manifold;
-
-										spuContacts.setContactInfo(spuManifold,manifoldAddress,lsMem.getColObj0()->getWorldTransform(),
-											lsMem.getColObj1()->getWorldTransform(),
-											lsMem.getColObj0()->getRestitution(),lsMem.getColObj1()->getRestitution(),
-											lsMem.getColObj0()->getFriction(),lsMem.getColObj1()->getFriction(),
-											collisionPairInput.m_isSwapped);
-
-						
-									//float distance=0.f;
-									btVector3 normalInB;
-
-
-									if (//!gUseEpa &&
-#ifdef USE_SEPDISTANCE_UTIL
-										lsMem.getlocalCollisionAlgorithm()->m_sepDistance.getConservativeSeparatingDistance()<=0.f
-#else
-										1
-#endif											
-										)
-										{
-//#define USE_PE_BOX_BOX 1
-#ifdef USE_PE_BOX_BOX
-											{
-
-												//getCollisionMargin0
-												btScalar margin0 = lsMem.getlocalCollisionAlgorithm()->getCollisionMargin0();
-												btScalar margin1 = lsMem.getlocalCollisionAlgorithm()->getCollisionMargin1();
-												btVector3 shapeDim0 = lsMem.getlocalCollisionAlgorithm()->getShapeDimensions0()+btVector3(margin0,margin0,margin0);
-												btVector3 shapeDim1 = lsMem.getlocalCollisionAlgorithm()->getShapeDimensions1()+btVector3(margin1,margin1,margin1);
-/*
-												//Box boxA(shapeDim0.getX(),shapeDim0.getY(),shapeDim0.getZ());
-												vmVector3 vmPos0 = getVmVector3(collisionPairInput.m_worldTransform0.getOrigin());
-												vmVector3 vmPos1 = getVmVector3(collisionPairInput.m_worldTransform1.getOrigin());
-												vmMatrix3 vmMatrix0 = getVmMatrix3(collisionPairInput.m_worldTransform0.getBasis());
-												vmMatrix3 vmMatrix1 = getVmMatrix3(collisionPairInput.m_worldTransform1.getBasis());
-
-												vmTransform3 transformA(vmMatrix0,vmPos0);
-												Box boxB(shapeDim1.getX(),shapeDim1.getY(),shapeDim1.getZ());
-												vmTransform3 transformB(vmMatrix1,vmPos1);
-												BoxPoint resultClosestBoxPointA;
-												BoxPoint resultClosestBoxPointB;
-												vmVector3 resultNormal;
-												*/
-
-#ifdef USE_SEPDISTANCE_UTIL
-												float distanceThreshold = FLT_MAX
-#else
-												//float distanceThreshold = 0.f;
-#endif
-
-
-												vmVector3 n;
-												Box boxA;
-												vmVector3 hA(shapeDim0.getX(),shapeDim0.getY(),shapeDim0.getZ());
-												vmVector3 hB(shapeDim1.getX(),shapeDim1.getY(),shapeDim1.getZ());
-												boxA.mHalf= hA;
-												vmTransform3 trA;
-												trA.setTranslation(getVmVector3(collisionPairInput.m_worldTransform0.getOrigin()));
-												trA.setUpper3x3(getVmMatrix3(collisionPairInput.m_worldTransform0.getBasis()));
-												Box boxB;
-												boxB.mHalf = hB;
-												vmTransform3 trB;
-												trB.setTranslation(getVmVector3(collisionPairInput.m_worldTransform1.getOrigin()));
-												trB.setUpper3x3(getVmMatrix3(collisionPairInput.m_worldTransform1.getBasis()));
-												
-												float distanceThreshold = spuManifold->getContactBreakingThreshold();//0.001f;
-
-
-												BoxPoint ptA,ptB;
-												float dist = boxBoxDistance(n, ptA, ptB,
-														   boxA, trA, boxB,	   trB,
-															distanceThreshold );
-
-
-//												float distance = boxBoxDistance(resultNormal,resultClosestBoxPointA,resultClosestBoxPointB,  boxA, transformA, boxB,transformB,distanceThreshold);
-												
-												normalInB = -getBtVector3(n);//resultNormal);
-
-												//if(dist < distanceThreshold)//spuManifold->getContactBreakingThreshold())
-												if(dist < spuManifold->getContactBreakingThreshold())
-												{
-													btVector3 pointOnB = collisionPairInput.m_worldTransform1(getBtVector3(ptB.localPoint));
-
-													spuContacts.addContactPoint(
-														normalInB,
-														pointOnB,
-														dist);
-												}
-											} 
-#else									
-											{
-
-												btScalar margin0 = lsMem.getlocalCollisionAlgorithm()->getCollisionMargin0();
-												btScalar margin1 = lsMem.getlocalCollisionAlgorithm()->getCollisionMargin1();
-												btVector3 shapeDim0 = lsMem.getlocalCollisionAlgorithm()->getShapeDimensions0()+btVector3(margin0,margin0,margin0);
-												btVector3 shapeDim1 = lsMem.getlocalCollisionAlgorithm()->getShapeDimensions1()+btVector3(margin1,margin1,margin1);
-
-
-												btBoxShape box0(shapeDim0);
-												btBoxShape box1(shapeDim1);
-
-												struct SpuBridgeContactCollector : public btDiscreteCollisionDetectorInterface::Result
-												{
-													SpuContactResult&	m_spuContacts;
-
-													virtual void setShapeIdentifiersA(int partId0,int index0)
-													{
-														m_spuContacts.setShapeIdentifiersA(partId0,index0);
-													}
-													virtual void setShapeIdentifiersB(int partId1,int index1)
-													{
-														m_spuContacts.setShapeIdentifiersB(partId1,index1);
-													}
-													virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)
-													{
-														m_spuContacts.addContactPoint(normalOnBInWorld,pointInWorld,depth);
-													}
-
-													SpuBridgeContactCollector(SpuContactResult& spuContacts)
-														:m_spuContacts(spuContacts)
-													{
-
-													}
-												};
-												
-												SpuBridgeContactCollector  bridgeOutput(spuContacts);
-
-												btDiscreteCollisionDetectorInterface::ClosestPointInput input;
-												input.m_maximumDistanceSquared = BT_LARGE_FLOAT;
-												input.m_transformA = collisionPairInput.m_worldTransform0;
-												input.m_transformB = collisionPairInput.m_worldTransform1;
-
-												btBoxBoxDetector detector(&box0,&box1);
-												
-												detector.getClosestPoints(input,bridgeOutput,0);
-
-											}
-#endif //USE_PE_BOX_BOX
-											
-											lsMem.needsDmaPutContactManifoldAlgo = true;
-#ifdef USE_SEPDISTANCE_UTIL
-											btScalar sepDist2 = distance+spuManifold->getContactBreakingThreshold();
-											lsMem.getlocalCollisionAlgorithm()->m_sepDistance.initSeparatingDistance(normalInB,sepDist2,collisionPairInput.m_worldTransform0,collisionPairInput.m_worldTransform1);
-#endif //USE_SEPDISTANCE_UTIL
-											gProcessedCol++;
-										} else
-										{
-											gSkippedCol++;
-										}
-
-										spuContacts.flush();
-											
-
-									} else
-#endif //USE_DEDICATED_BOX_BOX
-									{
-										if (
-#ifdef USE_SEPDISTANCE_UTIL
-											lsMem.getlocalCollisionAlgorithm()->m_sepDistance.getConservativeSeparatingDistance()<=0.f
-#else
-											1
-#endif //USE_SEPDISTANCE_UTIL
-											)
-										{
-											handleCollisionPair(collisionPairInput, lsMem, spuContacts,
-												(ppu_address_t)lsMem.getColObj0()->getRootCollisionShape(), &lsMem.gCollisionShapes[0].collisionShape,
-												(ppu_address_t)lsMem.getColObj1()->getRootCollisionShape(), &lsMem.gCollisionShapes[1].collisionShape);
-										} else
-										{
-												//spu_printf("boxbox dist = %f\n",distance);
-											btPersistentManifold* spuManifold=lsMem.getContactManifoldPtr();
-											btPersistentManifold* manifold = (btPersistentManifold*)collisionPairInput.m_persistentManifoldPtr;
-											ppu_address_t manifoldAddress = (ppu_address_t)manifold;
-
-											spuContacts.setContactInfo(spuManifold,manifoldAddress,lsMem.getColObj0()->getWorldTransform(),
-												lsMem.getColObj1()->getWorldTransform(),
-												lsMem.getColObj0()->getRestitution(),lsMem.getColObj1()->getRestitution(),
-												lsMem.getColObj0()->getFriction(),lsMem.getColObj1()->getFriction(),
-												collisionPairInput.m_isSwapped);
-
-											spuContacts.flush();
-										}
-									}
-								
-								}
-
-							}
-						}
-
-#ifdef USE_SEPDISTANCE_UTIL
-#if defined (__SPU__) || defined (USE_LIBSPE2)
-						if (lsMem.needsDmaPutContactManifoldAlgo)
-						{
-							dmaSize = sizeof(SpuContactManifoldCollisionAlgorithm);
-							dmaPpuAddress2 = (ppu_address_t)pair.m_algorithm;
-							cellDmaLargePut(&lsMem.gSpuContactManifoldAlgoBuffer, dmaPpuAddress2  , dmaSize, DMA_TAG(1), 0, 0);
-							cellDmaWaitTagStatusAll(DMA_MASK(1));
-						}
-#endif
-#endif //#ifdef USE_SEPDISTANCE_UTIL
-
-					}
-				}
-			}
-		} //end for (j = 0; j < numOnPage; j++)
-
-	}//	for 
-
-
-
-	return;
-}
-
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h
deleted file mode 100644
index bbaa555..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef SPU_GATHERING_COLLISION_TASK_H
-#define SPU_GATHERING_COLLISION_TASK_H
-
-#include "../PlatformDefinitions.h"
-//#define DEBUG_SPU_COLLISION_DETECTION 1
-
-
-///Task Description for SPU collision detection
-struct SpuGatherAndProcessPairsTaskDesc 
-{
-	ppu_address_t	m_inPairPtr;//m_pairArrayPtr;
-	//mutex variable
-	uint32_t	m_someMutexVariableInMainMemory;
-
-	ppu_address_t	m_dispatcher;
-
-	uint32_t	numOnLastPage;
-
-	uint16_t numPages;
-	uint16_t taskId;
-	bool m_useEpa;
-
-	struct	CollisionTask_LocalStoreMemory*	m_lsMemory; 
-}
-
-#if  defined(__CELLOS_LV2__) || defined(USE_LIBSPE2)
-__attribute__ ((aligned (128)))
-#endif
-;
-
-
-void	processCollisionTask(void* userPtr, void* lsMemory);
-
-void*	createCollisionLocalStoreMemory();
-
-
-#if defined(USE_LIBSPE2) && defined(__SPU__)
-#include "../SpuLibspe2Support.h"
-#include <spu_intrinsics.h>
-#include <spu_mfcio.h>
-#include <SpuFakeDma.h>
-
-//#define DEBUG_LIBSPE2_SPU_TASK
-
-
-
-int main(unsigned long long speid, addr64 argp, addr64 envp)
-{
-	printf("SPU: hello \n");
-	
-	ATTRIBUTE_ALIGNED128(btSpuStatus status);
-	ATTRIBUTE_ALIGNED16( SpuGatherAndProcessPairsTaskDesc taskDesc ) ;
-	unsigned int received_message = Spu_Mailbox_Event_Nothing;
-    bool shutdown = false;
-
-	cellDmaGet(&status, argp.ull, sizeof(btSpuStatus), DMA_TAG(3), 0, 0);
-	cellDmaWaitTagStatusAll(DMA_MASK(3));
-
-	status.m_status = Spu_Status_Free;
-	status.m_lsMemory.p = createCollisionLocalStoreMemory();
-
-	cellDmaLargePut(&status, argp.ull, sizeof(btSpuStatus), DMA_TAG(3), 0, 0);
-	cellDmaWaitTagStatusAll(DMA_MASK(3));
-	
-	
-	while ( btLikely( !shutdown ) )
-	{
-		
-		received_message = spu_read_in_mbox();
-		
-		if( btLikely( received_message == Spu_Mailbox_Event_Task ))
-		{
-#ifdef DEBUG_LIBSPE2_SPU_TASK
-			printf("SPU: received Spu_Mailbox_Event_Task\n");
-#endif //DEBUG_LIBSPE2_SPU_TASK
-
-			// refresh the status
-			cellDmaGet(&status, argp.ull, sizeof(btSpuStatus), DMA_TAG(3), 0, 0);
-			cellDmaWaitTagStatusAll(DMA_MASK(3));
-		
-			btAssert(status.m_status==Spu_Status_Occupied);
-			
-			cellDmaGet(&taskDesc, status.m_taskDesc.p, sizeof(SpuGatherAndProcessPairsTaskDesc), DMA_TAG(3), 0, 0);
-			cellDmaWaitTagStatusAll(DMA_MASK(3));
-#ifdef DEBUG_LIBSPE2_SPU_TASK		
-			printf("SPU:processCollisionTask\n");	
-#endif //DEBUG_LIBSPE2_SPU_TASK
-			processCollisionTask((void*)&taskDesc, taskDesc.m_lsMemory);
-			
-#ifdef DEBUG_LIBSPE2_SPU_TASK
-			printf("SPU:finished processCollisionTask\n");
-#endif //DEBUG_LIBSPE2_SPU_TASK
-		}
-		else
-		{
-#ifdef DEBUG_LIBSPE2_SPU_TASK
-			printf("SPU: received ShutDown\n");
-#endif //DEBUG_LIBSPE2_SPU_TASK
-			if( btLikely( received_message == Spu_Mailbox_Event_Shutdown ) )
-			{
-				shutdown = true;
-			}
-			else
-			{
-				//printf("SPU - Sth. recieved\n");
-			}
-		}
-
-		// set to status free and wait for next task
-		status.m_status = Spu_Status_Free;
-		cellDmaLargePut(&status, argp.ull, sizeof(btSpuStatus), DMA_TAG(3), 0, 0);
-		cellDmaWaitTagStatusAll(DMA_MASK(3));		
-				
-		
-  	}
-
-	printf("SPU: shutdown\n");
-  	return 0;
-}
-#endif // USE_LIBSPE2
-
-
-#endif //SPU_GATHERING_COLLISION_TASK_H
-
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuLocalSupport.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuLocalSupport.h
deleted file mode 100644
index 8b89de0..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuLocalSupport.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.cpp
deleted file mode 100644
index 9f7e64d..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.cpp
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "SpuMinkowskiPenetrationDepthSolver.h"
-#include "SpuContactResult.h"
-#include "SpuPreferredPenetrationDirections.h"
-#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
-#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h"
-#include "SpuCollisionShapes.h"
-
-#define NUM_UNITSPHERE_POINTS 42
-static btVector3	sPenetrationDirections[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2] = 
-{
-btVector3(btScalar(0.000000) , btScalar(-0.000000),btScalar(-1.000000)),
-btVector3(btScalar(0.723608) , btScalar(-0.525725),btScalar(-0.447219)),
-btVector3(btScalar(-0.276388) , btScalar(-0.850649),btScalar(-0.447219)),
-btVector3(btScalar(-0.894426) , btScalar(-0.000000),btScalar(-0.447216)),
-btVector3(btScalar(-0.276388) , btScalar(0.850649),btScalar(-0.447220)),
-btVector3(btScalar(0.723608) , btScalar(0.525725),btScalar(-0.447219)),
-btVector3(btScalar(0.276388) , btScalar(-0.850649),btScalar(0.447220)),
-btVector3(btScalar(-0.723608) , btScalar(-0.525725),btScalar(0.447219)),
-btVector3(btScalar(-0.723608) , btScalar(0.525725),btScalar(0.447219)),
-btVector3(btScalar(0.276388) , btScalar(0.850649),btScalar(0.447219)),
-btVector3(btScalar(0.894426) , btScalar(0.000000),btScalar(0.447216)),
-btVector3(btScalar(-0.000000) , btScalar(0.000000),btScalar(1.000000)),
-btVector3(btScalar(0.425323) , btScalar(-0.309011),btScalar(-0.850654)),
-btVector3(btScalar(-0.162456) , btScalar(-0.499995),btScalar(-0.850654)),
-btVector3(btScalar(0.262869) , btScalar(-0.809012),btScalar(-0.525738)),
-btVector3(btScalar(0.425323) , btScalar(0.309011),btScalar(-0.850654)),
-btVector3(btScalar(0.850648) , btScalar(-0.000000),btScalar(-0.525736)),
-btVector3(btScalar(-0.525730) , btScalar(-0.000000),btScalar(-0.850652)),
-btVector3(btScalar(-0.688190) , btScalar(-0.499997),btScalar(-0.525736)),
-btVector3(btScalar(-0.162456) , btScalar(0.499995),btScalar(-0.850654)),
-btVector3(btScalar(-0.688190) , btScalar(0.499997),btScalar(-0.525736)),
-btVector3(btScalar(0.262869) , btScalar(0.809012),btScalar(-0.525738)),
-btVector3(btScalar(0.951058) , btScalar(0.309013),btScalar(0.000000)),
-btVector3(btScalar(0.951058) , btScalar(-0.309013),btScalar(0.000000)),
-btVector3(btScalar(0.587786) , btScalar(-0.809017),btScalar(0.000000)),
-btVector3(btScalar(0.000000) , btScalar(-1.000000),btScalar(0.000000)),
-btVector3(btScalar(-0.587786) , btScalar(-0.809017),btScalar(0.000000)),
-btVector3(btScalar(-0.951058) , btScalar(-0.309013),btScalar(-0.000000)),
-btVector3(btScalar(-0.951058) , btScalar(0.309013),btScalar(-0.000000)),
-btVector3(btScalar(-0.587786) , btScalar(0.809017),btScalar(-0.000000)),
-btVector3(btScalar(-0.000000) , btScalar(1.000000),btScalar(-0.000000)),
-btVector3(btScalar(0.587786) , btScalar(0.809017),btScalar(-0.000000)),
-btVector3(btScalar(0.688190) , btScalar(-0.499997),btScalar(0.525736)),
-btVector3(btScalar(-0.262869) , btScalar(-0.809012),btScalar(0.525738)),
-btVector3(btScalar(-0.850648) , btScalar(0.000000),btScalar(0.525736)),
-btVector3(btScalar(-0.262869) , btScalar(0.809012),btScalar(0.525738)),
-btVector3(btScalar(0.688190) , btScalar(0.499997),btScalar(0.525736)),
-btVector3(btScalar(0.525730) , btScalar(0.000000),btScalar(0.850652)),
-btVector3(btScalar(0.162456) , btScalar(-0.499995),btScalar(0.850654)),
-btVector3(btScalar(-0.425323) , btScalar(-0.309011),btScalar(0.850654)),
-btVector3(btScalar(-0.425323) , btScalar(0.309011),btScalar(0.850654)),
-btVector3(btScalar(0.162456) , btScalar(0.499995),btScalar(0.850654))
-};
-
-
-bool SpuMinkowskiPenetrationDepthSolver::calcPenDepth( btSimplexSolverInterface& simplexSolver,
-		const btConvexShape* convexA,const btConvexShape* convexB,
-					const btTransform& transA,const btTransform& transB,
-				btVector3& v, btVector3& pa, btVector3& pb,
-				class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc)
-{
-#if 0
-	(void)stackAlloc;
-	(void)v;
-	
-
-	struct btIntermediateResult : public SpuContactResult
-	{
-
-		btIntermediateResult():m_hasResult(false)
-		{
-		}
-		
-		btVector3 m_normalOnBInWorld;
-		btVector3 m_pointInWorld;
-		btScalar m_depth;
-		bool	m_hasResult;
-
-		virtual void setShapeIdentifiersA(int partId0,int index0)
-		{
-			(void)partId0;
-			(void)index0;
-		}
-
-		virtual void setShapeIdentifiersB(int partId1,int index1)
-		{
-			(void)partId1;
-			(void)index1;
-		}
-		void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)
-		{
-			m_normalOnBInWorld = normalOnBInWorld;
-			m_pointInWorld = pointInWorld;
-			m_depth = depth;
-			m_hasResult = true;
-		}
-	};
-
-	//just take fixed number of orientation, and sample the penetration depth in that direction
-	btScalar minProj = btScalar(BT_LARGE_FLOAT);
-	btVector3 minNorm(0.f,0.f,0.f);
-	btVector3 minVertex;
-	btVector3 minA,minB;
-	btVector3 seperatingAxisInA,seperatingAxisInB;
-	btVector3 pInA,qInB,pWorld,qWorld,w;
-
-//#define USE_BATCHED_SUPPORT 1
-#ifdef USE_BATCHED_SUPPORT
-
-	btVector3	supportVerticesABatch[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2];
-	btVector3	supportVerticesBBatch[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2];
-	btVector3	seperatingAxisInABatch[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2];
-	btVector3	seperatingAxisInBBatch[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2];
-	int i;
-
-	int numSampleDirections = NUM_UNITSPHERE_POINTS;
-
-	for (i=0;i<numSampleDirections;i++)
-	{
-		const btVector3& norm = sPenetrationDirections[i];
-		seperatingAxisInABatch[i] =  (-norm) * transA.getBasis() ;
-		seperatingAxisInBBatch[i] =  norm   * transB.getBasis() ;
-	}
-
-	{
-		int numPDA = convexA->getNumPreferredPenetrationDirections();
-		if (numPDA)
-		{
-			for (int i=0;i<numPDA;i++)
-			{
-				btVector3 norm;
-				convexA->getPreferredPenetrationDirection(i,norm);
-				norm  = transA.getBasis() * norm;
-				sPenetrationDirections[numSampleDirections] = norm;
-				seperatingAxisInABatch[numSampleDirections] = (-norm) * transA.getBasis();
-				seperatingAxisInBBatch[numSampleDirections] = norm * transB.getBasis();
-				numSampleDirections++;
-			}
-		}
-	}
-
-	{
-		int numPDB = convexB->getNumPreferredPenetrationDirections();
-		if (numPDB)
-		{
-			for (int i=0;i<numPDB;i++)
-			{
-				btVector3 norm;
-				convexB->getPreferredPenetrationDirection(i,norm);
-				norm  = transB.getBasis() * norm;
-				sPenetrationDirections[numSampleDirections] = norm;
-				seperatingAxisInABatch[numSampleDirections] = (-norm) * transA.getBasis();
-				seperatingAxisInBBatch[numSampleDirections] = norm * transB.getBasis();
-				numSampleDirections++;
-			}
-		}
-	}
-
-
-
-	convexA->batchedUnitVectorGetSupportingVertexWithoutMargin(seperatingAxisInABatch,supportVerticesABatch,numSampleDirections);
-	convexB->batchedUnitVectorGetSupportingVertexWithoutMargin(seperatingAxisInBBatch,supportVerticesBBatch,numSampleDirections);
-
-	for (i=0;i<numSampleDirections;i++)
-	{
-		const btVector3& norm = sPenetrationDirections[i];
-		seperatingAxisInA = seperatingAxisInABatch[i];
-		seperatingAxisInB = seperatingAxisInBBatch[i];
-
-		pInA = supportVerticesABatch[i];
-		qInB = supportVerticesBBatch[i];
-
-		pWorld = transA(pInA);	
-		qWorld = transB(qInB);
-		w	= qWorld - pWorld;
-		btScalar delta = norm.dot(w);
-		//find smallest delta
-		if (delta < minProj)
-		{
-			minProj = delta;
-			minNorm = norm;
-			minA = pWorld;
-			minB = qWorld;
-		}
-	}	
-#else
-
-	int numSampleDirections = NUM_UNITSPHERE_POINTS;
-
-///this is necessary, otherwise the normal is not correct, and sphere will rotate forever on a sloped triangle mesh
-#define DO_PREFERRED_DIRECTIONS 1
-#ifdef DO_PREFERRED_DIRECTIONS
-	{
-		int numPDA = spuGetNumPreferredPenetrationDirections(shapeTypeA,convexA);
-		if (numPDA)
-		{
-			for (int i=0;i<numPDA;i++)
-			{
-				btVector3 norm;
-				spuGetPreferredPenetrationDirection(shapeTypeA,convexA,i,norm);
-				norm  = transA.getBasis() * norm;
-				sPenetrationDirections[numSampleDirections] = norm;
-				numSampleDirections++;
-			}
-		}
-	}
-
-	{
-		int numPDB = spuGetNumPreferredPenetrationDirections(shapeTypeB,convexB);
-		if (numPDB)
-		{
-			for (int i=0;i<numPDB;i++)
-			{
-				btVector3 norm;
-				spuGetPreferredPenetrationDirection(shapeTypeB,convexB,i,norm);
-				norm  = transB.getBasis() * norm;
-				sPenetrationDirections[numSampleDirections] = norm;
-				numSampleDirections++;
-			}
-		}
-	}
-#endif //DO_PREFERRED_DIRECTIONS
-
-	for (int i=0;i<numSampleDirections;i++)
-	{
-		const btVector3& norm = sPenetrationDirections[i];
-		seperatingAxisInA = (-norm)* transA.getBasis();
-		seperatingAxisInB = norm* transB.getBasis();
-
-		pInA = convexA->localGetSupportVertexWithoutMarginNonVirtual( seperatingAxisInA);//, NULL);
-		qInB = convexB->localGetSupportVertexWithoutMarginNonVirtual(seperatingAxisInB);//, NULL);
-
-	//	pInA = convexA->localGetSupportingVertexWithoutMargin(seperatingAxisInA);
-	//	qInB = convexB->localGetSupportingVertexWithoutMargin(seperatingAxisInB);
-
-		pWorld = transA(pInA);	
-		qWorld = transB(qInB);
-		w	= qWorld - pWorld;
-		btScalar delta = norm.dot(w);
-		//find smallest delta
-		if (delta < minProj)
-		{
-			minProj = delta;
-			minNorm = norm;
-			minA = pWorld;
-			minB = qWorld;
-		}
-	}
-#endif //USE_BATCHED_SUPPORT
-
-	//add the margins
-
-	minA += minNorm*marginA;
-	minB -= minNorm*marginB;
-	//no penetration
-	if (minProj < btScalar(0.))
-		return false;
-
-	minProj += (marginA + marginB) + btScalar(1.00);
-
-
-
-
-
-//#define DEBUG_DRAW 1
-#ifdef DEBUG_DRAW
-	if (debugDraw)
-	{
-		btVector3 color(0,1,0);
-		debugDraw->drawLine(minA,minB,color);
-		color = btVector3 (1,1,1);
-		btVector3 vec = minB-minA;
-		btScalar prj2 = minNorm.dot(vec);
-		debugDraw->drawLine(minA,minA+(minNorm*minProj),color);
-
-	}
-#endif //DEBUG_DRAW
-
-	
-	btGjkPairDetector gjkdet(convexA,convexB,&simplexSolver,0);
-
-	btScalar offsetDist = minProj;
-	btVector3 offset = minNorm * offsetDist;
-	
-
-	SpuClosestPointInput input;
-	input.m_convexVertexData[0] = convexVertexDataA;
-	input.m_convexVertexData[1] = convexVertexDataB;
-	btVector3 newOrg = transA.getOrigin() + offset;
-
-	btTransform displacedTrans = transA;
-	displacedTrans.setOrigin(newOrg);
-
-	input.m_transformA = displacedTrans;
-	input.m_transformB = transB;
-	input.m_maximumDistanceSquared = btScalar(BT_LARGE_FLOAT);//minProj;
-	
-	btIntermediateResult res;
-	gjkdet.getClosestPoints(input,res,0);
-
-	btScalar correctedMinNorm = minProj - res.m_depth;
-
-
-	//the penetration depth is over-estimated, relax it
-	btScalar penetration_relaxation= btScalar(1.);
-	minNorm*=penetration_relaxation;
-
-	if (res.m_hasResult)
-	{
-
-		pa = res.m_pointInWorld - minNorm * correctedMinNorm;
-		pb = res.m_pointInWorld;
-		
-#ifdef DEBUG_DRAW
-		if (debugDraw)
-		{
-			btVector3 color(1,0,0);
-			debugDraw->drawLine(pa,pb,color);
-		}
-#endif//DEBUG_DRAW
-
-
-	} else {
-		// could not seperate shapes
-		//btAssert (false);
-	}
-	return res.m_hasResult;
-#endif
-	return false;
-}
-
-
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.h
deleted file mode 100644
index 18ad223..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.h
+++ /dev/null
@@ -1,48 +0,0 @@
-
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
-#define MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
-
-
-#include "BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h"
-
-class btStackAlloc;
-class btIDebugDraw;
-class btVoronoiSimplexSolver;
-class btConvexShape;
-
-///MinkowskiPenetrationDepthSolver implements bruteforce penetration depth estimation.
-///Implementation is based on sampling the depth using support mapping, and using GJK step to get the witness points.
-class SpuMinkowskiPenetrationDepthSolver : public btConvexPenetrationDepthSolver
-{
-public:
-	SpuMinkowskiPenetrationDepthSolver() {}
-	virtual ~SpuMinkowskiPenetrationDepthSolver() {};
-
-		virtual bool calcPenDepth( btSimplexSolverInterface& simplexSolver,
-		const btConvexShape* convexA,const btConvexShape* convexB,
-					const btTransform& transA,const btTransform& transB,
-				btVector3& v, btVector3& pa, btVector3& pb,
-				class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc
-				);
-
-
-};
-
-
-#endif //MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuPreferredPenetrationDirections.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuPreferredPenetrationDirections.h
deleted file mode 100644
index 774a0cb..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuPreferredPenetrationDirections.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef _SPU_PREFERRED_PENETRATION_DIRECTIONS_H
-#define _SPU_PREFERRED_PENETRATION_DIRECTIONS_H
-
-
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
-
-int		spuGetNumPreferredPenetrationDirections(int shapeType, void* shape)
-{
-	switch (shapeType)
-    {
-		case TRIANGLE_SHAPE_PROXYTYPE:
-		{
-			return 2;
-			//spu_printf("2\n");
-			break;
-		}
-		default:
-			{
-#if __ASSERT
-        spu_printf("spuGetNumPreferredPenetrationDirections() - Unsupported bound type: %d.\n", shapeType);
-#endif // __ASSERT
-			}
-	}
-
-	return 0;	
-}	
-
-void	spuGetPreferredPenetrationDirection(int shapeType, void* shape, int index, btVector3& penetrationVector)
-{
-
-
-	switch (shapeType)
-    {
-		case TRIANGLE_SHAPE_PROXYTYPE:
-		{
-			btVector3* vertices = (btVector3*)shape;
-			///calcNormal
-			penetrationVector = (vertices[1]-vertices[0]).cross(vertices[2]-vertices[0]);
-			penetrationVector.normalize();
-			if (index)
-				penetrationVector *= btScalar(-1.);
-			break;
-		}
-		default:
-			{
-					
-#if __ASSERT
-        spu_printf("spuGetNumPreferredPenetrationDirections() - Unsupported bound type: %d.\n", shapeType);
-#endif // __ASSERT
-			}
-	}
-		
-}
-
-#endif //_SPU_PREFERRED_PENETRATION_DIRECTIONS_H
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp
deleted file mode 100644
index 5e1202c..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp
+++ /dev/null
@@ -1,1160 +0,0 @@
-/*
-   Copyright (C) 2006, 2008 Sony Computer Entertainment Inc.
-   All rights reserved.
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-
-*/
-
-
-//#include "PfxContactBoxBox.h"
-
-#include <math.h>
-#include "../PlatformDefinitions.h"
-#include "boxBoxDistance.h"
-
-static inline float sqr( float a )
-{
-	return (a * a);
-}
-
-enum BoxSepAxisType
-{
-	A_AXIS, B_AXIS, CROSS_AXIS
-};
-
-//-------------------------------------------------------------------------------------------------
-// voronoiTol: bevels Voronoi planes slightly which helps when features are parallel.
-//-------------------------------------------------------------------------------------------------
-
-static const float voronoiTol = -1.0e-5f;
-
-//-------------------------------------------------------------------------------------------------
-// separating axis tests: gaps along each axis are computed, and the axis with the maximum
-// gap is stored.  cross product axes are normalized.
-//-------------------------------------------------------------------------------------------------
-
-#define AaxisTest( dim, letter, first )                                                         \
-{                                                                                               \
-   if ( first )                                                                                 \
-   {                                                                                            \
-      maxGap = gap = gapsA.get##letter();                                                      \
-      if ( gap > distanceThreshold ) return gap;                                                \
-      axisType = A_AXIS;                                                                        \
-      faceDimA = dim;                                                                           \
-      axisA = identity.getCol##dim();                                                          \
-   }                                                                                            \
-   else                                                                                         \
-   {                                                                                            \
-      gap = gapsA.get##letter();                                                               \
-      if ( gap > distanceThreshold ) return gap;                                                \
-      else if ( gap > maxGap )                                                                  \
-      {                                                                                         \
-         maxGap = gap;                                                                          \
-         axisType = A_AXIS;                                                                     \
-         faceDimA = dim;                                                                        \
-         axisA = identity.getCol##dim();                                                       \
-      }                                                                                         \
-   }                                                                                            \
-}
-
-
-#define BaxisTest( dim, letter )                                                                \
-{                                                                                               \
-   gap = gapsB.get##letter();                                                                  \
-   if ( gap > distanceThreshold ) return gap;                                                   \
-   else if ( gap > maxGap )                                                                     \
-   {                                                                                            \
-      maxGap = gap;                                                                             \
-      axisType = B_AXIS;                                                                        \
-      faceDimB = dim;                                                                           \
-      axisB = identity.getCol##dim();                                                          \
-   }                                                                                            \
-}
-
-#define CrossAxisTest( dima, dimb, letterb )                                                    \
-{                                                                                               \
-   const float lsqr_tolerance = 1.0e-30f;                                                       \
-   float lsqr;                                                                                  \
-                                                                                                \
-   lsqr = lsqrs.getCol##dima().get##letterb();                                                \
-                                                                                                \
-   if ( lsqr > lsqr_tolerance )                                                                 \
-   {                                                                                            \
-      float l_recip = 1.0f / sqrtf( lsqr );                                                     \
-      gap = float(gapsAxB.getCol##dima().get##letterb()) * l_recip;                           \
-                                                                                                \
-      if ( gap > distanceThreshold )                                                            \
-      {                                                                                         \
-         return gap;                                                                            \
-      }                                                                                         \
-                                                                                                \
-      if ( gap > maxGap )                                                                       \
-      {                                                                                         \
-         maxGap = gap;                                                                          \
-         axisType = CROSS_AXIS;                                                                 \
-         edgeDimA = dima;                                                                       \
-         edgeDimB = dimb;                                                                       \
-         axisA = cross(identity.getCol##dima(),matrixAB.getCol##dimb()) * l_recip;            \
-      }                                                                                         \
-   }                                                                                            \
-}
-
-//-------------------------------------------------------------------------------------------------
-// tests whether a vertex of box B and a face of box A are the closest features
-//-------------------------------------------------------------------------------------------------
-
-inline
-float
-VertexBFaceATest(
-	bool & inVoronoi,
-	float & t0,
-	float & t1,
-	const vmVector3 & hA,
-	PE_REF(vmVector3) faceOffsetAB,
-	PE_REF(vmVector3) faceOffsetBA,
-	const vmMatrix3 & matrixAB,
-	const vmMatrix3 & matrixBA,
-	PE_REF(vmVector3) signsB,
-	PE_REF(vmVector3) scalesB )
-{
-	// compute a corner of box B in A's coordinate system
-
-	vmVector3 corner =
-		vmVector3( faceOffsetAB + matrixAB.getCol0() * scalesB.getX() + matrixAB.getCol1() * scalesB.getY() );
-
-	// compute the parameters of the point on A, closest to this corner
-
-	t0 = corner[0];
-	t1 = corner[1];
-
-	if ( t0 > hA[0] )
-		t0 = hA[0];
-	else if ( t0 < -hA[0] )
-		t0 = -hA[0];
-	if ( t1 > hA[1] )
-		t1 = hA[1];
-	else if ( t1 < -hA[1] )
-		t1 = -hA[1];
-
-	// do the Voronoi test: already know the point on B is in the Voronoi region of the
-	// point on A, check the reverse.
-
-	vmVector3 facePointB =
-		vmVector3( mulPerElem( faceOffsetBA + matrixBA.getCol0() * t0 + matrixBA.getCol1() * t1 - scalesB, signsB ) );
-
-	inVoronoi = ( ( facePointB[0] >= voronoiTol * facePointB[2] ) &&
-				  ( facePointB[1] >= voronoiTol * facePointB[0] ) &&
-				  ( facePointB[2] >= voronoiTol * facePointB[1] ) );
-
-	return (sqr( corner[0] - t0 ) + sqr( corner[1] - t1 ) + sqr( corner[2] ));
-}
-
-#define VertexBFaceA_SetNewMin()                \
-{                                               \
-   minDistSqr = distSqr;                        \
-   localPointA.setX(t0);                        \
-   localPointA.setY(t1);                        \
-   localPointB.setX( scalesB.getX() );          \
-   localPointB.setY( scalesB.getY() );          \
-   featureA = F;                                \
-   featureB = V;                                \
-}
-
-void
-VertexBFaceATests(
-	bool & done,
-	float & minDistSqr,
-	vmPoint3 & localPointA,
-	vmPoint3 & localPointB,
-	FeatureType & featureA,
-	FeatureType & featureB,
-	const vmVector3 & hA,
-	PE_REF(vmVector3) faceOffsetAB,
-	PE_REF(vmVector3) faceOffsetBA,
-	const vmMatrix3 & matrixAB,
-	const vmMatrix3 & matrixBA,
-	PE_REF(vmVector3) signsB,
-	PE_REF(vmVector3) scalesB,
-	bool first )
-{
-		
-	float t0, t1;
-	float distSqr;
-
-	distSqr = VertexBFaceATest( done, t0, t1, hA, faceOffsetAB, faceOffsetBA,
-								matrixAB, matrixBA, signsB, scalesB );
-
-	if ( first ) {
-		VertexBFaceA_SetNewMin();
-	} else {
-		if ( distSqr < minDistSqr ) {
-			VertexBFaceA_SetNewMin();
-		}
-	}
-
-	if ( done )
-		return;
-
-	signsB.setX( -signsB.getX() );
-	scalesB.setX( -scalesB.getX() );
-
-	distSqr = VertexBFaceATest( done, t0, t1, hA, faceOffsetAB, faceOffsetBA,
-								matrixAB, matrixBA, signsB, scalesB );
-
-	if ( distSqr < minDistSqr ) {
-		VertexBFaceA_SetNewMin();
-	}
-
-	if ( done )
-		return;
-
-	signsB.setY( -signsB.getY() );
-	scalesB.setY( -scalesB.getY() );
-
-	distSqr = VertexBFaceATest( done, t0, t1, hA, faceOffsetAB, faceOffsetBA,
-								matrixAB, matrixBA, signsB, scalesB );
-
-	if ( distSqr < minDistSqr ) {
-		VertexBFaceA_SetNewMin();
-	}
-
-	if ( done )
-		return;
-
-	signsB.setX( -signsB.getX() );
-	scalesB.setX( -scalesB.getX() );
-
-	distSqr = VertexBFaceATest( done, t0, t1, hA, faceOffsetAB, faceOffsetBA,
-								matrixAB, matrixBA, signsB, scalesB );
-
-	if ( distSqr < minDistSqr ) {
-		VertexBFaceA_SetNewMin();
-	}
-}
-
-//-------------------------------------------------------------------------------------------------
-// VertexAFaceBTest: tests whether a vertex of box A and a face of box B are the closest features
-//-------------------------------------------------------------------------------------------------
-
-inline
-float
-VertexAFaceBTest(
-	bool & inVoronoi,
-	float & t0,
-	float & t1,
-	const vmVector3 & hB,
-	PE_REF(vmVector3) faceOffsetAB,
-	PE_REF(vmVector3) faceOffsetBA,
-	const vmMatrix3 & matrixAB,
-	const vmMatrix3 & matrixBA,
-	PE_REF(vmVector3) signsA,
-	PE_REF(vmVector3) scalesA )
-{
-	vmVector3 corner =
-		vmVector3( faceOffsetBA + matrixBA.getCol0() * scalesA.getX() + matrixBA.getCol1() * scalesA.getY() );
-
-	t0 = corner[0];
-	t1 = corner[1];
-
-	if ( t0 > hB[0] )
-		t0 = hB[0];
-	else if ( t0 < -hB[0] )
-		t0 = -hB[0];
-	if ( t1 > hB[1] )
-		t1 = hB[1];
-	else if ( t1 < -hB[1] )
-		t1 = -hB[1];
-
-	vmVector3 facePointA =
-		vmVector3( mulPerElem( faceOffsetAB + matrixAB.getCol0() * t0 + matrixAB.getCol1() * t1 - scalesA, signsA ) );
-
-	inVoronoi = ( ( facePointA[0] >= voronoiTol * facePointA[2] ) &&
-				  ( facePointA[1] >= voronoiTol * facePointA[0] ) &&
-				  ( facePointA[2] >= voronoiTol * facePointA[1] ) );
-
-	return (sqr( corner[0] - t0 ) + sqr( corner[1] - t1 ) + sqr( corner[2] ));
-}
-
-#define VertexAFaceB_SetNewMin()                \
-{                                               \
-   minDistSqr = distSqr;                        \
-   localPointB.setX(t0);                        \
-   localPointB.setY(t1);                        \
-   localPointA.setX( scalesA.getX() );          \
-   localPointA.setY( scalesA.getY() );          \
-   featureA = V;                                \
-   featureB = F;                                \
-}
-
-void
-VertexAFaceBTests(
-	bool & done,
-	float & minDistSqr,
-	vmPoint3 & localPointA,
-	vmPoint3 & localPointB,
-	FeatureType & featureA,
-	FeatureType & featureB,
-	const vmVector3 & hB,
-	PE_REF(vmVector3) faceOffsetAB,
-	PE_REF(vmVector3) faceOffsetBA,
-	const vmMatrix3 & matrixAB,
-	const vmMatrix3 & matrixBA,
-	PE_REF(vmVector3) signsA,
-	PE_REF(vmVector3) scalesA,
-	bool first )
-{
-	float t0, t1;
-	float distSqr;
-
-	distSqr = VertexAFaceBTest( done, t0, t1, hB, faceOffsetAB, faceOffsetBA,
-								matrixAB, matrixBA, signsA, scalesA );
-
-	if ( first ) {
-		VertexAFaceB_SetNewMin();
-	} else {
-		if ( distSqr < minDistSqr ) {
-			VertexAFaceB_SetNewMin();
-		}
-	}
-
-	if ( done )
-		return;
-
-	signsA.setX( -signsA.getX() );
-	scalesA.setX( -scalesA.getX() );
-
-	distSqr = VertexAFaceBTest( done, t0, t1, hB, faceOffsetAB, faceOffsetBA,
-								matrixAB, matrixBA, signsA, scalesA );
-
-	if ( distSqr < minDistSqr ) {
-		VertexAFaceB_SetNewMin();
-	}
-
-	if ( done )
-		return;
-
-	signsA.setY( -signsA.getY() );
-	scalesA.setY( -scalesA.getY() );
-
-	distSqr = VertexAFaceBTest( done, t0, t1, hB, faceOffsetAB, faceOffsetBA,
-								matrixAB, matrixBA, signsA, scalesA );
-
-	if ( distSqr < minDistSqr ) {
-		VertexAFaceB_SetNewMin();
-	}
-
-	if ( done )
-		return;
-
-	signsA.setX( -signsA.getX() );
-	scalesA.setX( -scalesA.getX() );
-
-	distSqr = VertexAFaceBTest( done, t0, t1, hB, faceOffsetAB, faceOffsetBA,
-								matrixAB, matrixBA, signsA, scalesA );
-
-	if ( distSqr < minDistSqr ) {
-		VertexAFaceB_SetNewMin();
-	}
-}
-
-//-------------------------------------------------------------------------------------------------
-// CustomEdgeEdgeTest:
-//
-// tests whether a pair of edges are the closest features
-//
-// note on the shorthand:
-// 'a' & 'b' refer to the edges.
-// 'c' is the dimension of the axis that points from the face center to the edge Center
-// 'd' is the dimension of the edge Direction
-// the dimension of the face normal is 2
-//-------------------------------------------------------------------------------------------------
-
-#define CustomEdgeEdgeTest( ac, ac_letter, ad, ad_letter, bc, bc_letter, bd, bd_letter )              \
-{                                                                                               \
-   vmVector3 edgeOffsetAB;                                                                          \
-   vmVector3 edgeOffsetBA;                                                                          \
-                                                                                                \
-   edgeOffsetAB = faceOffsetAB + matrixAB.getCol##bc() * scalesB.get##bc_letter();            \
-   edgeOffsetAB.set##ac_letter( edgeOffsetAB.get##ac_letter() - scalesA.get##ac_letter() );  \
-                                                                                                \
-   edgeOffsetBA = faceOffsetBA + matrixBA.getCol##ac() * scalesA.get##ac_letter();            \
-   edgeOffsetBA.set##bc_letter( edgeOffsetBA.get##bc_letter() - scalesB.get##bc_letter() );  \
-                                                                                                \
-   float dirDot = matrixAB.getCol##bd().get##ad_letter();                                     \
-   float denom = 1.0f - dirDot*dirDot;                                                          \
-   float edgeOffsetAB_ad = edgeOffsetAB.get##ad_letter();                                      \
-   float edgeOffsetBA_bd = edgeOffsetBA.get##bd_letter();                                      \
-                                                                                                \
-   if ( denom == 0.0f )                                                                         \
-   {                                                                                            \
-      tA = 0.0f;                                                                                \
-   }                                                                                            \
-   else                                                                                         \
-   {                                                                                            \
-      tA = ( edgeOffsetAB_ad + edgeOffsetBA_bd * dirDot ) / denom;                              \
-   }                                                                                            \
-                                                                                                \
-   if ( tA < -hA[ad] ) tA = -hA[ad];                                                            \
-   else if ( tA > hA[ad] ) tA = hA[ad];                                                         \
-                                                                                                \
-   tB = tA * dirDot + edgeOffsetBA_bd;                                                          \
-                                                                                                \
-   if ( tB < -hB[bd] )                                                                          \
-   {                                                                                            \
-      tB = -hB[bd];                                                                             \
-      tA = tB * dirDot + edgeOffsetAB_ad;                                                       \
-                                                                                                \
-      if ( tA < -hA[ad] ) tA = -hA[ad];                                                         \
-      else if ( tA > hA[ad] ) tA = hA[ad];                                                      \
-   }                                                                                            \
-   else if ( tB > hB[bd] )                                                                      \
-   {                                                                                            \
-      tB = hB[bd];                                                                              \
-      tA = tB * dirDot + edgeOffsetAB_ad;                                                       \
-                                                                                                \
-      if ( tA < -hA[ad] ) tA = -hA[ad];                                                         \
-      else if ( tA > hA[ad] ) tA = hA[ad];                                                      \
-   }                                                                                            \
-                                                                                                \
-   vmVector3 edgeOffAB = vmVector3( mulPerElem( edgeOffsetAB + matrixAB.getCol##bd() * tB, signsA ) );\
-   vmVector3 edgeOffBA = vmVector3( mulPerElem( edgeOffsetBA + matrixBA.getCol##ad() * tA, signsB ) );\
-                                                                                                \
-   inVoronoi = ( edgeOffAB[ac] >= voronoiTol * edgeOffAB[2] ) &&                                \
-               ( edgeOffAB[2] >= voronoiTol * edgeOffAB[ac] ) &&                                \
-               ( edgeOffBA[bc] >= voronoiTol * edgeOffBA[2] ) &&                                \
-               ( edgeOffBA[2] >= voronoiTol * edgeOffBA[bc] );                                  \
-                                                                                                \
-   edgeOffAB[ad] -= tA;                                                                         \
-   edgeOffBA[bd] -= tB;                                                                         \
-                                                                                                \
-   return dot(edgeOffAB,edgeOffAB);                                                             \
-}
-
-float
-CustomEdgeEdgeTest_0101(
-	bool & inVoronoi,
-	float & tA,
-	float & tB,
-	const vmVector3 & hA,
-	const vmVector3 & hB,
-	PE_REF(vmVector3) faceOffsetAB,
-	PE_REF(vmVector3) faceOffsetBA,
-	const vmMatrix3 & matrixAB,
-	const vmMatrix3 & matrixBA,
-	PE_REF(vmVector3) signsA,
-	PE_REF(vmVector3) signsB,
-	PE_REF(vmVector3) scalesA,
-	PE_REF(vmVector3) scalesB )
-{
-	CustomEdgeEdgeTest( 0, X, 1, Y, 0, X, 1, Y );
-}
-
-float
-CustomEdgeEdgeTest_0110(
-	bool & inVoronoi,
-	float & tA,
-	float & tB,
-	const vmVector3 & hA,
-	const vmVector3 & hB,
-	PE_REF(vmVector3) faceOffsetAB,
-	PE_REF(vmVector3) faceOffsetBA,
-	const vmMatrix3 & matrixAB,
-	const vmMatrix3 & matrixBA,
-	PE_REF(vmVector3) signsA,
-	PE_REF(vmVector3) signsB,
-	PE_REF(vmVector3) scalesA,
-	PE_REF(vmVector3) scalesB )
-{
-	CustomEdgeEdgeTest( 0, X, 1, Y, 1, Y, 0, X );
-}
-
-float
-CustomEdgeEdgeTest_1001(
-	bool & inVoronoi,
-	float & tA,
-	float & tB,
-	const vmVector3 & hA,
-	const vmVector3 & hB,
-	PE_REF(vmVector3) faceOffsetAB,
-	PE_REF(vmVector3) faceOffsetBA,
-	const vmMatrix3 & matrixAB,
-	const vmMatrix3 & matrixBA,
-	PE_REF(vmVector3) signsA,
-	PE_REF(vmVector3) signsB,
-	PE_REF(vmVector3) scalesA,
-	PE_REF(vmVector3) scalesB )
-{
-	CustomEdgeEdgeTest( 1, Y, 0, X, 0, X, 1, Y );
-}
-
-float
-CustomEdgeEdgeTest_1010(
-	bool & inVoronoi,
-	float & tA,
-	float & tB,
-	const vmVector3 & hA,
-	const vmVector3 & hB,
-	PE_REF(vmVector3) faceOffsetAB,
-	PE_REF(vmVector3) faceOffsetBA,
-	const vmMatrix3 & matrixAB,
-	const vmMatrix3 & matrixBA,
-	PE_REF(vmVector3) signsA,
-	PE_REF(vmVector3) signsB,
-	PE_REF(vmVector3) scalesA,
-	PE_REF(vmVector3) scalesB )
-{
-	CustomEdgeEdgeTest( 1, Y, 0, X, 1, Y, 0, X );
-}
-
-#define EdgeEdge_SetNewMin( ac_letter, ad_letter, bc_letter, bd_letter )   \
-{                                                                          \
-   minDistSqr = distSqr;                                                   \
-   localPointA.set##ac_letter(scalesA.get##ac_letter());                 \
-   localPointA.set##ad_letter(tA);                                        \
-   localPointB.set##bc_letter(scalesB.get##bc_letter());                 \
-   localPointB.set##bd_letter(tB);                                        \
-   otherFaceDimA = testOtherFaceDimA;                                      \
-   otherFaceDimB = testOtherFaceDimB;                                      \
-   featureA = E;                                                           \
-   featureB = E;                                                           \
-}
-
-void
-EdgeEdgeTests(
-	bool & done,
-	float & minDistSqr,
-	vmPoint3 & localPointA,
-	vmPoint3 & localPointB,
-	int & otherFaceDimA,
-	int & otherFaceDimB,
-	FeatureType & featureA,
-	FeatureType & featureB,
-	const vmVector3 & hA,
-	const vmVector3 & hB,
-	PE_REF(vmVector3) faceOffsetAB,
-	PE_REF(vmVector3) faceOffsetBA,
-	const vmMatrix3 & matrixAB,
-	const vmMatrix3 & matrixBA,
-	PE_REF(vmVector3) signsA,
-	PE_REF(vmVector3) signsB,
-	PE_REF(vmVector3) scalesA,
-	PE_REF(vmVector3) scalesB,
-	bool first )
-{
-
-	float distSqr;
-	float tA, tB;
-
-	int testOtherFaceDimA, testOtherFaceDimB;
-
-	testOtherFaceDimA = 0;
-	testOtherFaceDimB = 0;
-
-	distSqr = CustomEdgeEdgeTest_0101( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
-								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
-
-	if ( first ) {
-		EdgeEdge_SetNewMin( X, Y, X, Y );
-	} else {
-		if ( distSqr < minDistSqr ) {
-			EdgeEdge_SetNewMin( X, Y, X, Y );
-		}
-	}
-
-	if ( done )
-		return;
-
-	signsA.setX( -signsA.getX() );
-	scalesA.setX( -scalesA.getX() );
-
-	distSqr = CustomEdgeEdgeTest_0101( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
-								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
-
-	if ( distSqr < minDistSqr ) {
-		EdgeEdge_SetNewMin( X, Y, X, Y );
-	}
-
-	if ( done )
-		return;
-
-	signsB.setX( -signsB.getX() );
-	scalesB.setX( -scalesB.getX() );
-
-	distSqr = CustomEdgeEdgeTest_0101( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
-								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
-
-	if ( distSqr < minDistSqr ) {
-		EdgeEdge_SetNewMin( X, Y, X, Y );
-	}
-
-	if ( done )
-		return;
-
-	signsA.setX( -signsA.getX() );
-	scalesA.setX( -scalesA.getX() );
-
-	distSqr = CustomEdgeEdgeTest_0101( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
-								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
-
-	if ( distSqr < minDistSqr ) {
-		EdgeEdge_SetNewMin( X, Y, X, Y );
-	}
-
-	if ( done )
-		return;
-
-	testOtherFaceDimA = 1;
-	testOtherFaceDimB = 0;
-	signsB.setX( -signsB.getX() );
-	scalesB.setX( -scalesB.getX() );
-
-	distSqr = CustomEdgeEdgeTest_1001( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
-								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
-
-	if ( distSqr < minDistSqr ) {
-		EdgeEdge_SetNewMin( Y, X, X, Y );
-	}
-
-	if ( done )
-		return;
-
-	signsA.setY( -signsA.getY() );
-	scalesA.setY( -scalesA.getY() );
-
-	distSqr = CustomEdgeEdgeTest_1001( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
-								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
-
-	if ( distSqr < minDistSqr ) {
-		EdgeEdge_SetNewMin( Y, X, X, Y );
-	}
-
-	if ( done )
-		return;
-
-	signsB.setX( -signsB.getX() );
-	scalesB.setX( -scalesB.getX() );
-
-	distSqr = CustomEdgeEdgeTest_1001( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
-								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
-
-	if ( distSqr < minDistSqr ) {
-		EdgeEdge_SetNewMin( Y, X, X, Y );
-	}
-
-	if ( done )
-		return;
-
-	signsA.setY( -signsA.getY() );
-	scalesA.setY( -scalesA.getY() );
-
-	distSqr = CustomEdgeEdgeTest_1001( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
-								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
-
-	if ( distSqr < minDistSqr ) {
-		EdgeEdge_SetNewMin( Y, X, X, Y );
-	}
-
-	if ( done )
-		return;
-
-	testOtherFaceDimA = 0;
-	testOtherFaceDimB = 1;
-	signsB.setX( -signsB.getX() );
-	scalesB.setX( -scalesB.getX() );
-
-	distSqr = CustomEdgeEdgeTest_0110( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
-								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
-
-	if ( distSqr < minDistSqr ) {
-		EdgeEdge_SetNewMin( X, Y, Y, X );
-	}
-
-	if ( done )
-		return;
-
-	signsA.setX( -signsA.getX() );
-	scalesA.setX( -scalesA.getX() );
-
-	distSqr = CustomEdgeEdgeTest_0110( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
-								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
-
-	if ( distSqr < minDistSqr ) {
-		EdgeEdge_SetNewMin( X, Y, Y, X );
-	}
-
-	if ( done )
-		return;
-
-	signsB.setY( -signsB.getY() );
-	scalesB.setY( -scalesB.getY() );
-
-	distSqr = CustomEdgeEdgeTest_0110( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
-								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
-
-	if ( distSqr < minDistSqr ) {
-		EdgeEdge_SetNewMin( X, Y, Y, X );
-	}
-
-	if ( done )
-		return;
-
-	signsA.setX( -signsA.getX() );
-	scalesA.setX( -scalesA.getX() );
-
-	distSqr = CustomEdgeEdgeTest_0110( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
-								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
-
-	if ( distSqr < minDistSqr ) {
-		EdgeEdge_SetNewMin( X, Y, Y, X );
-	}
-
-	if ( done )
-		return;
-
-	testOtherFaceDimA = 1;
-	testOtherFaceDimB = 1;
-	signsB.setY( -signsB.getY() );
-	scalesB.setY( -scalesB.getY() );
-
-	distSqr = CustomEdgeEdgeTest_1010( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
-								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
-
-	if ( distSqr < minDistSqr ) {
-		EdgeEdge_SetNewMin( Y, X, Y, X );
-	}
-
-	if ( done )
-		return;
-
-	signsA.setY( -signsA.getY() );
-	scalesA.setY( -scalesA.getY() );
-
-	distSqr = CustomEdgeEdgeTest_1010( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
-								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
-
-	if ( distSqr < minDistSqr ) {
-		EdgeEdge_SetNewMin( Y, X, Y, X );
-	}
-
-	if ( done )
-		return;
-
-	signsB.setY( -signsB.getY() );
-	scalesB.setY( -scalesB.getY() );
-
-	distSqr = CustomEdgeEdgeTest_1010( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
-								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
-
-	if ( distSqr < minDistSqr ) {
-		EdgeEdge_SetNewMin( Y, X, Y, X );
-	}
-
-	if ( done )
-		return;
-
-	signsA.setY( -signsA.getY() );
-	scalesA.setY( -scalesA.getY() );
-
-	distSqr = CustomEdgeEdgeTest_1010( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
-								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
-
-	if ( distSqr < minDistSqr ) {
-		EdgeEdge_SetNewMin( Y, X, Y, X );
-	}
-}
-
-
-float
-boxBoxDistance(vmVector3& normal, BoxPoint& boxPointA, BoxPoint& boxPointB,
-			   PE_REF(Box) boxA, const vmTransform3 & transformA, PE_REF(Box) boxB,
-			   const vmTransform3 & transformB,
-			   float distanceThreshold)
-{
-	vmMatrix3 identity;
-	identity = vmMatrix3::identity();
-	vmVector3 ident[3];
-	ident[0] = identity.getCol0();
-	ident[1] = identity.getCol1();
-	ident[2] = identity.getCol2();
-
-	// get relative transformations
-
-	vmTransform3 transformAB, transformBA;
-	vmMatrix3 matrixAB, matrixBA;
-	vmVector3 offsetAB, offsetBA;
-
-	transformAB = orthoInverse(transformA) * transformB;
-	transformBA = orthoInverse(transformAB);
-
-	matrixAB = transformAB.getUpper3x3();
-	offsetAB = transformAB.getTranslation();
-	matrixBA = transformBA.getUpper3x3();
-	offsetBA = transformBA.getTranslation();
-
-	vmMatrix3 absMatrixAB = absPerElem(matrixAB);
-	vmMatrix3 absMatrixBA = absPerElem(matrixBA);
-
-	// find separating axis with largest gap between projections
-
-	BoxSepAxisType axisType;
-	vmVector3 axisA(0.0f), axisB(0.0f);
-	float gap, maxGap;
-	int faceDimA = 0, faceDimB = 0, edgeDimA = 0, edgeDimB = 0;
-
-	// face axes
-
-	vmVector3  gapsA   = absPerElem(offsetAB) - boxA.mHalf - absMatrixAB * boxB.mHalf;
-
-	AaxisTest(0,X,true);
-	AaxisTest(1,Y,false);
-	AaxisTest(2,Z,false);
-
-	vmVector3  gapsB   = absPerElem(offsetBA) - boxB.mHalf - absMatrixBA * boxA.mHalf;
-
-	BaxisTest(0,X);
-	BaxisTest(1,Y);
-	BaxisTest(2,Z);
-
-	// cross product axes
-
-	// �O�ς��O�̂Ƃ��̑΍�
-	absMatrixAB += vmMatrix3(1.0e-5f);
-	absMatrixBA += vmMatrix3(1.0e-5f);
-
-	vmMatrix3 lsqrs, projOffset, projAhalf, projBhalf;
-
-	lsqrs.setCol0( mulPerElem( matrixBA.getCol2(), matrixBA.getCol2() ) +
-				   mulPerElem( matrixBA.getCol1(), matrixBA.getCol1() ) );
-	lsqrs.setCol1( mulPerElem( matrixBA.getCol2(), matrixBA.getCol2() ) +
-				   mulPerElem( matrixBA.getCol0(), matrixBA.getCol0() ) );
-	lsqrs.setCol2( mulPerElem( matrixBA.getCol1(), matrixBA.getCol1() ) +
-				   mulPerElem( matrixBA.getCol0(), matrixBA.getCol0() ) );
-
-	projOffset.setCol0(matrixBA.getCol1() * offsetAB.getZ() - matrixBA.getCol2() * offsetAB.getY());
-	projOffset.setCol1(matrixBA.getCol2() * offsetAB.getX() - matrixBA.getCol0() * offsetAB.getZ());
-	projOffset.setCol2(matrixBA.getCol0() * offsetAB.getY() - matrixBA.getCol1() * offsetAB.getX());
-
-	projAhalf.setCol0(absMatrixBA.getCol1() * boxA.mHalf.getZ() + absMatrixBA.getCol2() * boxA.mHalf.getY());
-	projAhalf.setCol1(absMatrixBA.getCol2() * boxA.mHalf.getX() + absMatrixBA.getCol0() * boxA.mHalf.getZ());
-	projAhalf.setCol2(absMatrixBA.getCol0() * boxA.mHalf.getY() + absMatrixBA.getCol1() * boxA.mHalf.getX());
-
-	projBhalf.setCol0(absMatrixAB.getCol1() * boxB.mHalf.getZ() + absMatrixAB.getCol2() * boxB.mHalf.getY());
-	projBhalf.setCol1(absMatrixAB.getCol2() * boxB.mHalf.getX() + absMatrixAB.getCol0() * boxB.mHalf.getZ());
-	projBhalf.setCol2(absMatrixAB.getCol0() * boxB.mHalf.getY() + absMatrixAB.getCol1() * boxB.mHalf.getX());
-
-	vmMatrix3 gapsAxB = absPerElem(projOffset) - projAhalf - transpose(projBhalf);
-
-	CrossAxisTest(0,0,X);
-	CrossAxisTest(0,1,Y);
-	CrossAxisTest(0,2,Z);
-	CrossAxisTest(1,0,X);
-	CrossAxisTest(1,1,Y);
-	CrossAxisTest(1,2,Z);
-	CrossAxisTest(2,0,X);
-	CrossAxisTest(2,1,Y);
-	CrossAxisTest(2,2,Z);
-
-	// need to pick the face on each box whose normal best matches the separating axis.
-	// will transform vectors to be in the coordinate system of this face to simplify things later.
-	// for this, a permutation matrix can be used, which the next section computes.
-
-	int dimA[3], dimB[3];
-
-	if ( axisType == A_AXIS ) {
-		if ( dot(axisA,offsetAB) < 0.0f )
-			axisA = -axisA;
-		axisB = matrixBA * -axisA;
-
-		vmVector3 absAxisB = vmVector3(absPerElem(axisB));
-
-		if ( ( absAxisB[0] > absAxisB[1] ) && ( absAxisB[0] > absAxisB[2] ) )
-			faceDimB = 0;
-		else if ( absAxisB[1] > absAxisB[2] )
-			faceDimB = 1;
-		else
-			faceDimB = 2;
-	} else if ( axisType == B_AXIS ) {
-		if ( dot(axisB,offsetBA) < 0.0f )
-			axisB = -axisB;
-		axisA = matrixAB * -axisB;
-
-		vmVector3 absAxisA = vmVector3(absPerElem(axisA));
-
-		if ( ( absAxisA[0] > absAxisA[1] ) && ( absAxisA[0] > absAxisA[2] ) )
-			faceDimA = 0;
-		else if ( absAxisA[1] > absAxisA[2] )
-			faceDimA = 1;
-		else
-			faceDimA = 2;
-	}
-
-	if ( axisType == CROSS_AXIS ) {
-		if ( dot(axisA,offsetAB) < 0.0f )
-			axisA = -axisA;
-		axisB = matrixBA * -axisA;
-
-		vmVector3 absAxisA = vmVector3(absPerElem(axisA));
-		vmVector3 absAxisB = vmVector3(absPerElem(axisB));
-
-		dimA[1] = edgeDimA;
-		dimB[1] = edgeDimB;
-
-		if ( edgeDimA == 0 ) {
-			if ( absAxisA[1] > absAxisA[2] ) {
-				dimA[0] = 2;
-				dimA[2] = 1;
-			} else                             {
-				dimA[0] = 1;
-				dimA[2] = 2;
-			}
-		} else if ( edgeDimA == 1 ) {
-			if ( absAxisA[2] > absAxisA[0] ) {
-				dimA[0] = 0;
-				dimA[2] = 2;
-			} else                             {
-				dimA[0] = 2;
-				dimA[2] = 0;
-			}
-		} else {
-			if ( absAxisA[0] > absAxisA[1] ) {
-				dimA[0] = 1;
-				dimA[2] = 0;
-			} else                             {
-				dimA[0] = 0;
-				dimA[2] = 1;
-			}
-		}
-
-		if ( edgeDimB == 0 ) {
-			if ( absAxisB[1] > absAxisB[2] ) {
-				dimB[0] = 2;
-				dimB[2] = 1;
-			} else                             {
-				dimB[0] = 1;
-				dimB[2] = 2;
-			}
-		} else if ( edgeDimB == 1 ) {
-			if ( absAxisB[2] > absAxisB[0] ) {
-				dimB[0] = 0;
-				dimB[2] = 2;
-			} else                             {
-				dimB[0] = 2;
-				dimB[2] = 0;
-			}
-		} else {
-			if ( absAxisB[0] > absAxisB[1] ) {
-				dimB[0] = 1;
-				dimB[2] = 0;
-			} else                             {
-				dimB[0] = 0;
-				dimB[2] = 1;
-			}
-		}
-	} else {
-		dimA[2] = faceDimA;
-		dimA[0] = (faceDimA+1)%3;
-		dimA[1] = (faceDimA+2)%3;
-		dimB[2] = faceDimB;
-		dimB[0] = (faceDimB+1)%3;
-		dimB[1] = (faceDimB+2)%3;
-	}
-
-	vmMatrix3 aperm_col, bperm_col;
-
-	aperm_col.setCol0(ident[dimA[0]]);
-	aperm_col.setCol1(ident[dimA[1]]);
-	aperm_col.setCol2(ident[dimA[2]]);
-
-	bperm_col.setCol0(ident[dimB[0]]);
-	bperm_col.setCol1(ident[dimB[1]]);
-	bperm_col.setCol2(ident[dimB[2]]);
-
-	vmMatrix3 aperm_row, bperm_row;
-
-	aperm_row = transpose(aperm_col);
-	bperm_row = transpose(bperm_col);
-
-	// permute all box parameters to be in the face coordinate systems
-
-	vmMatrix3 matrixAB_perm = aperm_row * matrixAB * bperm_col;
-	vmMatrix3 matrixBA_perm = transpose(matrixAB_perm);
-
-	vmVector3 offsetAB_perm, offsetBA_perm;
-
-	offsetAB_perm = aperm_row * offsetAB;
-	offsetBA_perm = bperm_row * offsetBA;
-
-	vmVector3 halfA_perm, halfB_perm;
-
-	halfA_perm = aperm_row * boxA.mHalf;
-	halfB_perm = bperm_row * boxB.mHalf;
-
-	// compute the vector between the centers of each face, in each face's coordinate frame
-
-	vmVector3 signsA_perm, signsB_perm, scalesA_perm, scalesB_perm, faceOffsetAB_perm, faceOffsetBA_perm;
-
-	signsA_perm = copySignPerElem(vmVector3(1.0f),aperm_row * axisA);
-	signsB_perm = copySignPerElem(vmVector3(1.0f),bperm_row * axisB);
-	scalesA_perm = mulPerElem( signsA_perm, halfA_perm );
-	scalesB_perm = mulPerElem( signsB_perm, halfB_perm );
-
-	faceOffsetAB_perm = offsetAB_perm + matrixAB_perm.getCol2() * scalesB_perm.getZ();
-	faceOffsetAB_perm.setZ( faceOffsetAB_perm.getZ() - scalesA_perm.getZ() );
-
-	faceOffsetBA_perm = offsetBA_perm + matrixBA_perm.getCol2() * scalesA_perm.getZ();
-	faceOffsetBA_perm.setZ( faceOffsetBA_perm.getZ() - scalesB_perm.getZ() );
-
-	if ( maxGap < 0.0f ) {
-		// if boxes overlap, this will separate the faces for finding points of penetration.
-
-		faceOffsetAB_perm -= aperm_row * axisA * maxGap * 1.01f;
-		faceOffsetBA_perm -= bperm_row * axisB * maxGap * 1.01f;
-	}
-
-	// for each vertex/face or edge/edge pair of the two faces, find the closest points.
-	//
-	// these points each have an associated box feature (vertex, edge, or face).  if each
-	// point is in the external Voronoi region of the other's feature, they are the
-	// closest points of the boxes, and the algorithm can exit.
-	//
-	// the feature pairs are arranged so that in the general case, the first test will
-	// succeed.  degenerate cases (parallel faces) may require up to all tests in the
-	// worst case.
-	//
-	// if for some reason no case passes the Voronoi test, the features with the minimum
-	// distance are returned.
-
-	vmPoint3 localPointA_perm, localPointB_perm;
-	float minDistSqr;
-	bool done;
-
-	vmVector3 hA_perm( halfA_perm ), hB_perm( halfB_perm );
-
-	localPointA_perm.setZ( scalesA_perm.getZ() );
-	localPointB_perm.setZ( scalesB_perm.getZ() );
-	scalesA_perm.setZ(0.0f);
-	scalesB_perm.setZ(0.0f);
-
-	int otherFaceDimA, otherFaceDimB;
-	FeatureType featureA, featureB;
-
-	if ( axisType == CROSS_AXIS ) {
-		EdgeEdgeTests( done, minDistSqr, localPointA_perm, localPointB_perm,
-					   otherFaceDimA, otherFaceDimB, featureA, featureB,
-					   hA_perm, hB_perm, faceOffsetAB_perm, faceOffsetBA_perm,
-					   matrixAB_perm, matrixBA_perm, signsA_perm, signsB_perm,
-					   scalesA_perm, scalesB_perm, true );
-
-		if ( !done ) {
-			VertexBFaceATests( done, minDistSqr, localPointA_perm, localPointB_perm,
-							   featureA, featureB,
-							   hA_perm, faceOffsetAB_perm, faceOffsetBA_perm,
-							   matrixAB_perm, matrixBA_perm, signsB_perm, scalesB_perm, false );
-
-			if ( !done ) {
-				VertexAFaceBTests( done, minDistSqr, localPointA_perm, localPointB_perm,
-								   featureA, featureB,
-								   hB_perm, faceOffsetAB_perm, faceOffsetBA_perm,
-								   matrixAB_perm, matrixBA_perm, signsA_perm, scalesA_perm, false );
-			}
-		}
-	} else if ( axisType == B_AXIS ) {
-		VertexAFaceBTests( done, minDistSqr, localPointA_perm, localPointB_perm,
-						   featureA, featureB,
-						   hB_perm, faceOffsetAB_perm, faceOffsetBA_perm,
-						   matrixAB_perm, matrixBA_perm, signsA_perm, scalesA_perm, true );
-
-		if ( !done ) {
-			VertexBFaceATests( done, minDistSqr, localPointA_perm, localPointB_perm,
-							   featureA, featureB,
-							   hA_perm, faceOffsetAB_perm, faceOffsetBA_perm,
-							   matrixAB_perm, matrixBA_perm, signsB_perm, scalesB_perm, false );
-
-			if ( !done ) {
-				EdgeEdgeTests( done, minDistSqr, localPointA_perm, localPointB_perm,
-							   otherFaceDimA, otherFaceDimB, featureA, featureB,
-							   hA_perm, hB_perm, faceOffsetAB_perm, faceOffsetBA_perm,
-							   matrixAB_perm, matrixBA_perm, signsA_perm, signsB_perm,
-							   scalesA_perm, scalesB_perm, false );
-			}
-		}
-	} else {
-		VertexBFaceATests( done, minDistSqr, localPointA_perm, localPointB_perm,
-						   featureA, featureB,
-						   hA_perm, faceOffsetAB_perm, faceOffsetBA_perm,
-						   matrixAB_perm, matrixBA_perm, signsB_perm, scalesB_perm, true );
-
-		if ( !done ) {
-			VertexAFaceBTests( done, minDistSqr, localPointA_perm, localPointB_perm,
-							   featureA, featureB,
-							   hB_perm, faceOffsetAB_perm, faceOffsetBA_perm,
-							   matrixAB_perm, matrixBA_perm, signsA_perm, scalesA_perm, false );
-
-			if ( !done ) {
-				EdgeEdgeTests( done, minDistSqr, localPointA_perm, localPointB_perm,
-							   otherFaceDimA, otherFaceDimB, featureA, featureB,
-							   hA_perm, hB_perm, faceOffsetAB_perm, faceOffsetBA_perm,
-							   matrixAB_perm, matrixBA_perm, signsA_perm, signsB_perm,
-							   scalesA_perm, scalesB_perm, false );
-			}
-		}
-	}
-
-	// convert local points from face-local to box-local coordinate system
-
-	
-	boxPointA.localPoint = vmPoint3( aperm_col * vmVector3( localPointA_perm )) ;
-	boxPointB.localPoint = vmPoint3( bperm_col * vmVector3( localPointB_perm )) ;
-
-#if 0
-	// find which features of the boxes are involved.
-	// the only feature pairs which occur in this function are VF, FV, and EE, even though the
-	// closest points might actually lie on sub-features, as in a VF contact might be used for
-	// what's actually a VV contact.  this means some feature pairs could possibly seem distinct
-	// from others, although their contact positions are the same.  don't know yet whether this
-	// matters.
-
-	int sA[3], sB[3];
-
-	sA[0] = boxPointA.localPoint.getX() > 0.0f;
-	sA[1] = boxPointA.localPoint.getY() > 0.0f;
-	sA[2] = boxPointA.localPoint.getZ() > 0.0f;
-
-	sB[0] = boxPointB.localPoint.getX() > 0.0f;
-	sB[1] = boxPointB.localPoint.getY() > 0.0f;
-	sB[2] = boxPointB.localPoint.getZ() > 0.0f;
-
-	if ( featureA == F ) {
-		boxPointA.setFaceFeature( dimA[2], sA[dimA[2]] );
-	} else if ( featureA == E ) {
-		boxPointA.setEdgeFeature( dimA[2], sA[dimA[2]], dimA[otherFaceDimA], sA[dimA[otherFaceDimA]] );
-	} else {
-		boxPointA.setVertexFeature( sA[0], sA[1], sA[2] );
-	}
-
-	if ( featureB == F ) {
-		boxPointB.setFaceFeature( dimB[2], sB[dimB[2]] );
-	} else if ( featureB == E ) {
-		boxPointB.setEdgeFeature( dimB[2], sB[dimB[2]], dimB[otherFaceDimB], sB[dimB[otherFaceDimB]] );
-	} else {
-		boxPointB.setVertexFeature( sB[0], sB[1], sB[2] );
-	}
-#endif
-
-	normal = transformA * axisA;
-
-	if ( maxGap < 0.0f ) {
-		return (maxGap);
-	} else {
-		return (sqrtf( minDistSqr ));
-	}
-}
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.h
deleted file mode 100644
index 0d4957d..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-   Copyright (C) 2006, 2008 Sony Computer Entertainment Inc.
-   All rights reserved.
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-
-*/
-
-
-#ifndef __BOXBOXDISTANCE_H__
-#define __BOXBOXDISTANCE_H__
-
-
-#include "Box.h"
-
-
-//---------------------------------------------------------------------------
-// boxBoxDistance:
-//
-// description:
-//    this computes info that can be used for the collision response of two boxes.  when the boxes
-//    do not overlap, the points are set to the closest points of the boxes, and a positive
-//    distance between them is returned.  if the boxes do overlap, a negative distance is returned
-//    and the points are set to two points that would touch after the boxes are translated apart.
-//    the contact normal gives the direction to repel or separate the boxes when they touch or
-//    overlap (it's being approximated here as one of the 15 "separating axis" directions).
-//
-// returns:
-//    positive or negative distance between two boxes.
-//
-// args:
-//    vmVector3& normal: set to a unit contact normal pointing from box A to box B.
-//
-//    BoxPoint& boxPointA, BoxPoint& boxPointB:
-//       set to a closest point or point of penetration on each box.
-//
-//    Box boxA, Box boxB:
-//       boxes, represented as 3 half-widths
-//
-//    const vmTransform3& transformA, const vmTransform3& transformB:
-//       box transformations, in world coordinates
-//
-//    float distanceThreshold:
-//       the algorithm will exit early if it finds that the boxes are more distant than this
-//       threshold, and not compute a contact normal or points.  if this distance returned
-//       exceeds the threshold, all the other output data may not have been computed.  by
-//       default, this is set to MAX_FLOAT so it will have no effect.
-//
-//---------------------------------------------------------------------------
-
-float
-boxBoxDistance(vmVector3& normal, BoxPoint& boxPointA, BoxPoint& boxPointB,
-			   PE_REF(Box) boxA, const vmTransform3 & transformA, PE_REF(Box) boxB,
-			   const vmTransform3 & transformB,
-			   float distanceThreshold = FLT_MAX );
-
-#endif /* __BOXBOXDISTANCE_H__ */
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp
deleted file mode 100644
index fe61955..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library, Copyright (c) 2007 Erwin Coumans
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-
-*/
-
-
-#include "SpuSampleTask.h"
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-#include "../PlatformDefinitions.h"
-#include "../SpuFakeDma.h"
-#include "LinearMath/btMinMax.h"
-
-#ifdef __SPU__
-#include <spu_printf.h>
-#else
-#include <stdio.h>
-#define spu_printf printf
-#endif
-
-#define MAX_NUM_BODIES 8192
-
-struct SampleTask_LocalStoreMemory
-{
-	ATTRIBUTE_ALIGNED16(char gLocalRigidBody [sizeof(btRigidBody)+16]);
-	ATTRIBUTE_ALIGNED16(void* gPointerArray[MAX_NUM_BODIES]);
-
-};
-
-
-
-
-//-- MAIN METHOD
-void processSampleTask(void* userPtr, void* lsMemory)
-{
-	//	BT_PROFILE("processSampleTask");
-
-	SampleTask_LocalStoreMemory* localMemory = (SampleTask_LocalStoreMemory*)lsMemory;
-
-	SpuSampleTaskDesc* taskDescPtr = (SpuSampleTaskDesc*)userPtr;
-	SpuSampleTaskDesc& taskDesc = *taskDescPtr;
-
-	switch (taskDesc.m_sampleCommand)
-	{
-	case CMD_SAMPLE_INTEGRATE_BODIES:
-		{
-			btTransform predictedTrans;
-			btCollisionObject** eaPtr = (btCollisionObject**)taskDesc.m_mainMemoryPtr;
-
-			int batchSize = taskDesc.m_sampleValue;
-			if (batchSize>MAX_NUM_BODIES)
-			{
-				spu_printf("SPU Error: exceed number of bodies, see MAX_NUM_BODIES in SpuSampleTask.cpp\n");
-				break;
-			}
-			int dmaArraySize = batchSize*sizeof(void*);
-
-			uint64_t ppuArrayAddress = reinterpret_cast<uint64_t>(eaPtr);
-
-			//			spu_printf("array location is at %llx, batchSize = %d, DMA size = %d\n",ppuArrayAddress,batchSize,dmaArraySize);
-
-			if (dmaArraySize>=16)
-			{
-				cellDmaLargeGet((void*)&localMemory->gPointerArray[0], ppuArrayAddress  , dmaArraySize, DMA_TAG(1), 0, 0);	
-				cellDmaWaitTagStatusAll(DMA_MASK(1));
-			} else
-			{
-				stallingUnalignedDmaSmallGet((void*)&localMemory->gPointerArray[0], ppuArrayAddress  , dmaArraySize);
-			}
-
-
-			for ( int i=0;i<batchSize;i++)
-			{
-				///DMA rigid body
-
-				void* localPtr = &localMemory->gLocalRigidBody[0];
-				void* shortAdd = localMemory->gPointerArray[i];
-				uint64_t ppuRigidBodyAddress = reinterpret_cast<uint64_t>(shortAdd);
-
-				//	spu_printf("cellDmaGet at CMD_SAMPLE_INTEGRATE_BODIES from %llx to %llx\n",ppuRigidBodyAddress,localPtr);
-
-				int dmaBodySize = sizeof(btRigidBody);
-
-				cellDmaGet((void*)localPtr, ppuRigidBodyAddress  , dmaBodySize, DMA_TAG(1), 0, 0);	
-				cellDmaWaitTagStatusAll(DMA_MASK(1));
-
-
-				float timeStep = 1.f/60.f;
-
-				btRigidBody* body = (btRigidBody*) localPtr;//btRigidBody::upcast(colObj);
-				if (body)
-				{
-					if (body->isActive() && (!body->isStaticOrKinematicObject()))
-					{
-						body->predictIntegratedTransform(timeStep, predictedTrans);
-						body->proceedToTransform( predictedTrans);
-						void* ptr = (void*)localPtr;
-						//	spu_printf("cellDmaLargePut from %llx to LS %llx\n",ptr,ppuRigidBodyAddress);
-
-						cellDmaLargePut(ptr, ppuRigidBodyAddress  , dmaBodySize, DMA_TAG(1), 0, 0);
-						cellDmaWaitTagStatusAll(DMA_MASK(1));
-
-					}
-				}
-
-			}
-			break;
-		}
-
-
-	case CMD_SAMPLE_PREDICT_MOTION_BODIES:
-		{
-			btTransform predictedTrans;
-			btCollisionObject** eaPtr = (btCollisionObject**)taskDesc.m_mainMemoryPtr;
-
-			int batchSize = taskDesc.m_sampleValue;
-			int dmaArraySize = batchSize*sizeof(void*);
-
-			if (batchSize>MAX_NUM_BODIES)
-			{
-				spu_printf("SPU Error: exceed number of bodies, see MAX_NUM_BODIES in SpuSampleTask.cpp\n");
-				break;
-			}
-
-			uint64_t ppuArrayAddress = reinterpret_cast<uint64_t>(eaPtr);
-
-			//			spu_printf("array location is at %llx, batchSize = %d, DMA size = %d\n",ppuArrayAddress,batchSize,dmaArraySize);
-
-			if (dmaArraySize>=16)
-			{
-				cellDmaLargeGet((void*)&localMemory->gPointerArray[0], ppuArrayAddress  , dmaArraySize, DMA_TAG(1), 0, 0);	
-				cellDmaWaitTagStatusAll(DMA_MASK(1));
-			} else
-			{
-				stallingUnalignedDmaSmallGet((void*)&localMemory->gPointerArray[0], ppuArrayAddress  , dmaArraySize);
-			}
-
-
-			for ( int i=0;i<batchSize;i++)
-			{
-				///DMA rigid body
-
-				void* localPtr = &localMemory->gLocalRigidBody[0];
-				void* shortAdd = localMemory->gPointerArray[i];
-				uint64_t ppuRigidBodyAddress = reinterpret_cast<uint64_t>(shortAdd);
-
-				//	spu_printf("cellDmaGet at CMD_SAMPLE_INTEGRATE_BODIES from %llx to %llx\n",ppuRigidBodyAddress,localPtr);
-
-				int dmaBodySize = sizeof(btRigidBody);
-
-				cellDmaGet((void*)localPtr, ppuRigidBodyAddress  , dmaBodySize, DMA_TAG(1), 0, 0);	
-				cellDmaWaitTagStatusAll(DMA_MASK(1));
-
-
-				float timeStep = 1.f/60.f;
-
-				btRigidBody* body = (btRigidBody*) localPtr;//btRigidBody::upcast(colObj);
-				if (body)
-				{
-					if (!body->isStaticOrKinematicObject())
-					{
-						if (body->isActive())
-						{
-							body->integrateVelocities( timeStep);
-							//damping
-							body->applyDamping(timeStep);
-
-							body->predictIntegratedTransform(timeStep,body->getInterpolationWorldTransform());
-
-							void* ptr = (void*)localPtr;
-							cellDmaLargePut(ptr, ppuRigidBodyAddress  , dmaBodySize, DMA_TAG(1), 0, 0);
-							cellDmaWaitTagStatusAll(DMA_MASK(1));
-						}
-					}
-				}
-
-			}
-			break;
-		}
-	
-
-
-	default:
-		{
-
-		}
-	};
-}
-
-
-#if defined(__CELLOS_LV2__) || defined (LIBSPE2)
-
-ATTRIBUTE_ALIGNED16(SampleTask_LocalStoreMemory	gLocalStoreMemory);
-
-void* createSampleLocalStoreMemory()
-{
-	return &gLocalStoreMemory;
-}
-#else
-void* createSampleLocalStoreMemory()
-{
-	return new SampleTask_LocalStoreMemory;
-};
-
-#endif
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTask/SpuSampleTask.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTask/SpuSampleTask.h
deleted file mode 100644
index c8ebdfd..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTask/SpuSampleTask.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library, Copyright (c) 2007 Erwin Coumans
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-
-*/
-
-#ifndef SPU_SAMPLE_TASK_H
-#define SPU_SAMPLE_TASK_H
-
-#include "../PlatformDefinitions.h"
-#include "LinearMath/btScalar.h"
-#include "LinearMath/btVector3.h"
-#include "LinearMath/btMatrix3x3.h"
-
-#include "LinearMath/btAlignedAllocator.h"
-
-
-enum
-{
-	CMD_SAMPLE_INTEGRATE_BODIES = 1,
-	CMD_SAMPLE_PREDICT_MOTION_BODIES
-};
-
-
-
-ATTRIBUTE_ALIGNED16(struct) SpuSampleTaskDesc
-{
-	BT_DECLARE_ALIGNED_ALLOCATOR();
-
-	uint32_t						m_sampleCommand;
-	uint32_t						m_taskId;
-
-	uint64_t 	m_mainMemoryPtr;
-	int			m_sampleValue;
-	
-
-};
-
-
-void	processSampleTask(void* userPtr, void* lsMemory);
-void*	createSampleLocalStoreMemory();
-
-
-#endif //SPU_SAMPLE_TASK_H
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTaskProcess.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTaskProcess.cpp
deleted file mode 100644
index 11cb9e7..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTaskProcess.cpp
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-//#define __CELLOS_LV2__ 1
-
-#define USE_SAMPLE_PROCESS 1
-#ifdef USE_SAMPLE_PROCESS
-
-
-#include "SpuSampleTaskProcess.h"
-#include <stdio.h>
-
-#ifdef __SPU__
-
-
-
-void	SampleThreadFunc(void* userPtr,void* lsMemory)
-{
-	//do nothing
-	printf("hello world\n");
-}
-
-
-void*	SamplelsMemoryFunc()
-{
-	//don't create local store memory, just return 0
-	return 0;
-}
-
-
-#else
-
-
-#include "btThreadSupportInterface.h"
-
-//#	include "SPUAssert.h"
-#include <string.h>
-
-
-
-extern "C" {
-	extern char SPU_SAMPLE_ELF_SYMBOL[];
-}
-
-
-
-
-
-SpuSampleTaskProcess::SpuSampleTaskProcess(btThreadSupportInterface*	threadInterface,  int maxNumOutstandingTasks)
-:m_threadInterface(threadInterface),
-m_maxNumOutstandingTasks(maxNumOutstandingTasks)
-{
-
-	m_taskBusy.resize(m_maxNumOutstandingTasks);
-	m_spuSampleTaskDesc.resize(m_maxNumOutstandingTasks);
-
-	for (int i = 0; i < m_maxNumOutstandingTasks; i++)
-	{
-		m_taskBusy[i] = false;
-	}
-	m_numBusyTasks = 0;
-	m_currentTask = 0;
-
-	m_initialized = false;
-
-	m_threadInterface->startSPU();
-
-
-}
-
-SpuSampleTaskProcess::~SpuSampleTaskProcess()
-{
-	m_threadInterface->stopSPU();
-	
-}
-
-
-
-void	SpuSampleTaskProcess::initialize()
-{
-#ifdef DEBUG_SPU_TASK_SCHEDULING
-	printf("SpuSampleTaskProcess::initialize()\n");
-#endif //DEBUG_SPU_TASK_SCHEDULING
-	
-	for (int i = 0; i < m_maxNumOutstandingTasks; i++)
-	{
-		m_taskBusy[i] = false;
-	}
-	m_numBusyTasks = 0;
-	m_currentTask = 0;
-	m_initialized = true;
-
-}
-
-
-void SpuSampleTaskProcess::issueTask(void* sampleMainMemPtr,int sampleValue,int sampleCommand)
-{
-
-#ifdef DEBUG_SPU_TASK_SCHEDULING
-	printf("SpuSampleTaskProcess::issueTask (m_currentTask= %d\)n", m_currentTask);
-#endif //DEBUG_SPU_TASK_SCHEDULING
-
-	m_taskBusy[m_currentTask] = true;
-	m_numBusyTasks++;
-
-	SpuSampleTaskDesc& taskDesc = m_spuSampleTaskDesc[m_currentTask];
-	{
-		// send task description in event message
-		// no error checking here...
-		// but, currently, event queue can be no larger than NUM_WORKUNIT_TASKS.
-	
-		taskDesc.m_mainMemoryPtr = reinterpret_cast<uint64_t>(sampleMainMemPtr);
-		taskDesc.m_sampleValue = sampleValue;
-		taskDesc.m_sampleCommand = sampleCommand;
-
-		//some bookkeeping to recognize finished tasks
-		taskDesc.m_taskId = m_currentTask;
-	}
-
-
-	m_threadInterface->sendRequest(1, (ppu_address_t) &taskDesc, m_currentTask);
-
-	// if all tasks busy, wait for spu event to clear the task.
-	
-	if (m_numBusyTasks >= m_maxNumOutstandingTasks)
-	{
-		unsigned int taskId;
-		unsigned int outputSize;
-
-		for (int i=0;i<m_maxNumOutstandingTasks;i++)
-	  {
-		  if (m_taskBusy[i])
-		  {
-			  taskId = i;
-			  break;
-		  }
-	  }
-		m_threadInterface->waitForResponse(&taskId, &outputSize);
-
-		//printf("PPU: after issue, received event: %u %d\n", taskId, outputSize);
-
-		postProcess(taskId, outputSize);
-
-		m_taskBusy[taskId] = false;
-
-		m_numBusyTasks--;
-	}
-
-	// find new task buffer
-	for (int i = 0; i < m_maxNumOutstandingTasks; i++)
-	{
-		if (!m_taskBusy[i])
-		{
-			m_currentTask = i;
-			break;
-		}
-	}
-}
-
-
-///Optional PPU-size post processing for each task
-void SpuSampleTaskProcess::postProcess(int taskId, int outputSize)
-{
-
-}
-
-
-void SpuSampleTaskProcess::flush()
-{
-#ifdef DEBUG_SPU_TASK_SCHEDULING
-	printf("\nSpuCollisionTaskProcess::flush()\n");
-#endif //DEBUG_SPU_TASK_SCHEDULING
-	
-
-	// all tasks are issued, wait for all tasks to be complete
-	while(m_numBusyTasks > 0)
-	{
-// Consolidating SPU code
-	  unsigned int taskId;
-	  unsigned int outputSize;
-	  
-	  for (int i=0;i<m_maxNumOutstandingTasks;i++)
-	  {
-		  if (m_taskBusy[i])
-		  {
-			  taskId = i;
-			  break;
-		  }
-	  }
-	  {
-			
-		  m_threadInterface->waitForResponse(&taskId, &outputSize);
-	  }
-
-		//printf("PPU: flushing, received event: %u %d\n", taskId, outputSize);
-
-		postProcess(taskId, outputSize);
-
-		m_taskBusy[taskId] = false;
-
-		m_numBusyTasks--;
-	}
-
-
-}
-
-#endif
-
-
-#endif //USE_SAMPLE_PROCESS
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTaskProcess.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTaskProcess.h
deleted file mode 100644
index 6173225..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTaskProcess.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_SPU_SAMPLE_TASK_PROCESS_H
-#define BT_SPU_SAMPLE_TASK_PROCESS_H
-
-#include <assert.h>
-
-
-#include "PlatformDefinitions.h"
-
-#include <stdlib.h>
-
-#include "LinearMath/btAlignedObjectArray.h"
-
-
-#include "SpuSampleTask/SpuSampleTask.h"
-
-
-//just add your commands here, try to keep them globally unique for debugging purposes
-#define CMD_SAMPLE_TASK_COMMAND 10
-
-
-
-/// SpuSampleTaskProcess handles SPU processing of collision pairs.
-/// When PPU issues a task, it will look for completed task buffers
-/// PPU will do postprocessing, dependent on workunit output (not likely)
-class SpuSampleTaskProcess
-{
-	// track task buffers that are being used, and total busy tasks
-	btAlignedObjectArray<bool>	m_taskBusy;
-	btAlignedObjectArray<SpuSampleTaskDesc>m_spuSampleTaskDesc;
-	
-	int   m_numBusyTasks;
-
-	// the current task and the current entry to insert a new work unit
-	int   m_currentTask;
-
-	bool m_initialized;
-
-	void postProcess(int taskId, int outputSize);
-	
-	class	btThreadSupportInterface*	m_threadInterface;
-
-	int	m_maxNumOutstandingTasks;
-
-
-
-public:
-	SpuSampleTaskProcess(btThreadSupportInterface*	threadInterface, int maxNumOutstandingTasks);
-	
-	~SpuSampleTaskProcess();
-	
-	///call initialize in the beginning of the frame, before addCollisionPairToTask
-	void initialize();
-
-	void issueTask(void* sampleMainMemPtr,int sampleValue,int sampleCommand);
-
-	///call flush to submit potential outstanding work to SPUs and wait for all involved SPUs to be finished
-	void flush();
-};
-
-
-#if defined(USE_LIBSPE2) && defined(__SPU__)
-////////////////////MAIN/////////////////////////////
-#include "../SpuLibspe2Support.h"
-#include <spu_intrinsics.h>
-#include <spu_mfcio.h>
-#include <SpuFakeDma.h>
-
-void * SamplelsMemoryFunc();
-void SampleThreadFunc(void* userPtr,void* lsMemory);
-
-//#define DEBUG_LIBSPE2_MAINLOOP
-
-int main(unsigned long long speid, addr64 argp, addr64 envp)
-{
-	printf("SPU is up \n");
-	
-	ATTRIBUTE_ALIGNED128(btSpuStatus status);
-	ATTRIBUTE_ALIGNED16( SpuSampleTaskDesc taskDesc ) ;
-	unsigned int received_message = Spu_Mailbox_Event_Nothing;
-        bool shutdown = false;
-
-	cellDmaGet(&status, argp.ull, sizeof(btSpuStatus), DMA_TAG(3), 0, 0);
-	cellDmaWaitTagStatusAll(DMA_MASK(3));
-
-	status.m_status = Spu_Status_Free;
-	status.m_lsMemory.p = SamplelsMemoryFunc();
-
-	cellDmaLargePut(&status, argp.ull, sizeof(btSpuStatus), DMA_TAG(3), 0, 0);
-	cellDmaWaitTagStatusAll(DMA_MASK(3));
-	
-	
-	while (!shutdown)
-	{
-		received_message = spu_read_in_mbox();
-		
-
-		
-		switch(received_message)
-		{
-		case Spu_Mailbox_Event_Shutdown:
-			shutdown = true;
-			break; 
-		case Spu_Mailbox_Event_Task:
-			// refresh the status
-#ifdef DEBUG_LIBSPE2_MAINLOOP
-			printf("SPU recieved Task \n");
-#endif //DEBUG_LIBSPE2_MAINLOOP
-			cellDmaGet(&status, argp.ull, sizeof(btSpuStatus), DMA_TAG(3), 0, 0);
-			cellDmaWaitTagStatusAll(DMA_MASK(3));
-		
-			btAssert(status.m_status==Spu_Status_Occupied);
-			
-			cellDmaGet(&taskDesc, status.m_taskDesc.p, sizeof(SpuSampleTaskDesc), DMA_TAG(3), 0, 0);
-			cellDmaWaitTagStatusAll(DMA_MASK(3));
-			
-			SampleThreadFunc((void*)&taskDesc, reinterpret_cast<void*> (taskDesc.m_mainMemoryPtr) );
-			break;
-		case Spu_Mailbox_Event_Nothing:
-		default:
-			break;
-		}
-
-		// set to status free and wait for next task
-		status.m_status = Spu_Status_Free;
-		cellDmaLargePut(&status, argp.ull, sizeof(btSpuStatus), DMA_TAG(3), 0, 0);
-		cellDmaWaitTagStatusAll(DMA_MASK(3));		
-				
-		
-  	}
-  	return 0;
-}
-//////////////////////////////////////////////////////
-#endif
-
-
-
-#endif // BT_SPU_SAMPLE_TASK_PROCESS_H
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuSync.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuSync.h
deleted file mode 100644
index 4157b8f..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/SpuSync.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2007 Starbreeze Studios
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-
-Written by: Marten Svanfeldt
-*/
-
-#ifndef BT_SPU_SYNC_H
-#define	BT_SPU_SYNC_H
-
-
-#include "PlatformDefinitions.h"
-
-
-#if defined(WIN32)
-
-#define WIN32_LEAN_AND_MEAN
-#ifdef _XBOX
-#include <Xtl.h>
-#else
-#include <Windows.h>
-#endif
-
-///The btSpinlock is a structure to allow multi-platform synchronization. This allows to port the SPU tasks to other platforms.
-class btSpinlock
-{
-public:
-	//typedef volatile LONG SpinVariable;
-	typedef CRITICAL_SECTION SpinVariable;
-
-	btSpinlock (SpinVariable* var)
-		: spinVariable (var)
-	{}
-
-	void Init ()
-	{
-		//*spinVariable = 0;
-		InitializeCriticalSection(spinVariable);
-	}
-
-	void Lock ()
-	{
-		EnterCriticalSection(spinVariable);
-	}
-
-	void Unlock ()
-	{
-		LeaveCriticalSection(spinVariable);
-	}
-
-private:
-	SpinVariable* spinVariable;
-};
-
-
-#elif defined (__CELLOS_LV2__)
-
-//#include <cell/atomic.h>
-#include <cell/sync/mutex.h>
-
-///The btSpinlock is a structure to allow multi-platform synchronization. This allows to port the SPU tasks to other platforms.
-class btSpinlock
-{
-public:
-	typedef CellSyncMutex SpinVariable;
-
-	btSpinlock (SpinVariable* var)
-		: spinVariable (var)
-	{}
-
-	void Init ()
-	{
-#ifndef __SPU__
-		//*spinVariable = 1;
-		cellSyncMutexInitialize(spinVariable);
-#endif
-	}
-
-
-
-	void Lock ()
-	{
-#ifdef __SPU__
-		// lock semaphore
-		/*while (cellAtomicTestAndDecr32(atomic_buf, (uint64_t)spinVariable) == 0) 
-		{
-
-		};*/
-		cellSyncMutexLock((uint64_t)spinVariable);
-#endif
-	}
-
-	void Unlock ()
-	{
-#ifdef __SPU__
-		//cellAtomicIncr32(atomic_buf, (uint64_t)spinVariable);
-		cellSyncMutexUnlock((uint64_t)spinVariable);
-#endif 
-	}
-
-
-private:
-	SpinVariable*	spinVariable;
-	ATTRIBUTE_ALIGNED128(uint32_t		atomic_buf[32]);
-};
-
-#else
-//create a dummy implementation (without any locking) useful for serial processing
-class btSpinlock
-{
-public:
-	typedef int  SpinVariable;
-
-	btSpinlock (SpinVariable* var)
-		: spinVariable (var)
-	{}
-
-	void Init ()
-	{
-	}
-
-	void Lock ()
-	{
-	}
-
-	void Unlock ()
-	{
-	}
-
-private:
-	SpinVariable* spinVariable;
-};
-
-
-#endif
-
-
-#endif //BT_SPU_SYNC_H
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/TrbDynBody.h b/hkl3d/bullet/src/BulletMultiThreaded/TrbDynBody.h
deleted file mode 100644
index 4d14212..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/TrbDynBody.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
-   Copyright (C) 2009 Sony Computer Entertainment Inc.
-   All rights reserved.
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-
-*/
-
-#ifndef BT_RB_DYN_BODY_H__
-#define BT_RB_DYN_BODY_H__
-
-#include "vectormath/vmInclude.h"
-using namespace Vectormath::Aos;
-
-#include "TrbStateVec.h"
-
-class CollObject;
-
-class TrbDynBody
-{
-public:
-	TrbDynBody()
-	{
-		fMass   = 0.0f;
-		fCollObject = NULL;
-		fElasticity = 0.2f;
-		fFriction = 0.8f;
-	}
-
-	// Get methods
-	float          getMass() const {return fMass;};
-	float          getElasticity() const {return fElasticity;}
-	float          getFriction() const {return fFriction;}
-	CollObject*    getCollObject() const {return fCollObject;}
-	const Matrix3 &getBodyInertia() const {return fIBody;}
-	const Matrix3 &getBodyInertiaInv() const {return fIBodyInv;}
-	float          getMassInv() const {return fMassInv;}
-
-	// Set methods
-	void           setMass(float mass) {fMass=mass;fMassInv=mass>0.0f?1.0f/mass:0.0f;}
-	void           setBodyInertia(const Matrix3 bodyInertia) {fIBody = bodyInertia;fIBodyInv = inverse(bodyInertia);}
-	void           setElasticity(float elasticity) {fElasticity = elasticity;}
-	void           setFriction(float friction) {fFriction = friction;}
-	void           setCollObject(CollObject *collObj) {fCollObject = collObj;}
-	
-	void           setBodyInertiaInv(const Matrix3 bodyInertiaInv) 
-	{
-		fIBody = inverse(bodyInertiaInv);
-		fIBodyInv = bodyInertiaInv;
-	}
-	void           setMassInv(float invMass) {
-		fMass= invMass>0.0f ? 1.0f/invMass :0.0f;
-		fMassInv=invMass;
-	}
-
-
-private:
-	// Rigid Body constants
-	float          fMass;        // Rigid Body mass
-	float          fMassInv;     // Inverse of mass
-	Matrix3        fIBody;       // Inertia matrix in body's coords
-	Matrix3        fIBodyInv;    // Inertia matrix inverse in body's coords
-	float          fElasticity;  // Coefficient of restitution
-	float          fFriction;    // Coefficient of friction
-
-public:
-	CollObject*    fCollObject;  // Collision object corresponding the RB
-} __attribute__ ((aligned(16)));
-
-#endif //BT_RB_DYN_BODY_H__
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/TrbStateVec.h b/hkl3d/bullet/src/BulletMultiThreaded/TrbStateVec.h
deleted file mode 100644
index 46d1904..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/TrbStateVec.h
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
-   Copyright (C) 2009 Sony Computer Entertainment Inc.
-   All rights reserved.
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-
-*/
-
-#ifndef BT_TRBSTATEVEC_H__
-#define BT_TRBSTATEVEC_H__
-
-#include <stdlib.h>
-#ifdef PFX_USE_FREE_VECTORMATH
-#include "vecmath/vmInclude.h"
-#else
-#include "vectormath/vmInclude.h"
-#endif //PFX_USE_FREE_VECTORMATH
-
-
-#include "PlatformDefinitions.h"
-
-
-static inline vmVector3 read_Vector3(const float* p)
-{
-	vmVector3 v;
-	loadXYZ(v, p);
-	return v;
-}
-
-static inline vmQuat read_Quat(const float* p)
-{
-	vmQuat vq;
-	loadXYZW(vq, p);
-	return vq;
-}
-
-static inline void store_Vector3(const vmVector3 &src, float* p)
-{
-	vmVector3 v = src;
-	storeXYZ(v, p);
-}
-
-static inline void store_Quat(const vmQuat &src, float* p)
-{
-	vmQuat vq = src;
-	storeXYZW(vq, p);
-}
-
-// Motion Type
-enum {
-	PfxMotionTypeFixed = 0,
-	PfxMotionTypeActive,
-	PfxMotionTypeKeyframe,
-	PfxMotionTypeOneWay,
-	PfxMotionTypeTrigger,
-	PfxMotionTypeCount
-};
-
-#define PFX_MOTION_MASK_DYNAMIC 0x0a // Active,OneWay
-#define PFX_MOTION_MASK_STATIC  0x95 // Fixed,Keyframe,Trigger,Sleeping
-#define PFX_MOTION_MASK_SLEEP   0x0e // Can sleep
-#define PFX_MOTION_MASK_TYPE    0x7f
-
-//
-// Rigid Body state
-//
-
-#ifdef __CELLOS_LV2__
-ATTRIBUTE_ALIGNED128(class) TrbState
-#else
-ATTRIBUTE_ALIGNED16(class) TrbState
-#endif
-
-{
-public:
-	TrbState()
-	{
-		setMotionType(PfxMotionTypeActive);
-		contactFilterSelf=contactFilterTarget=0xffffffff;
-		deleted = 0;
-		mSleeping = 0;
-		useSleep = 1;
-		trbBodyIdx=0;
-		mSleepCount=0;
-		useCcd = 0;
-		useContactCallback = 0;
-		useSleepCallback = 0;
-		linearDamping = 1.0f;
-		angularDamping = 0.99f;
-	}
-
-	TrbState(const uint8_t m, const vmVector3& x, const vmQuat& q, const vmVector3& v, const vmVector3& omega );
-	
-	uint16_t	mSleepCount;
-	uint8_t		mMotionType;
-	uint8_t		deleted            : 1;
-	uint8_t		mSleeping           : 1;
-	uint8_t		useSleep           : 1;
-	uint8_t		useCcd		       : 1;
-	uint8_t		useContactCallback : 1;
-	uint8_t		useSleepCallback   : 1;
-
-	uint16_t	trbBodyIdx;
-	uint32_t	contactFilterSelf;
-	uint32_t	contactFilterTarget;
-
-	float		center[3];		// AABB center(World)
-	float		half[3];		// AABB half(World)
-
-	float		linearDamping;
-	float		angularDamping;
-	
-	float		deltaLinearVelocity[3];
-	float		deltaAngularVelocity[3];
-
-	float     fX[3];				// position
-	float     fQ[4];				// orientation
-	float     fV[3];				// velocity
-	float     fOmega[3];			// angular velocity
-
-	inline void setZero();      // Zeroes out the elements
-	inline void setIdentity();  // Sets the rotation to identity and zeroes out the other elements
-
-	bool		isDeleted() const {return deleted==1;}
-
-	uint16_t	getRigidBodyId() const {return trbBodyIdx;}
-	void		setRigidBodyId(uint16_t i) {trbBodyIdx = i;}
-
-
-	uint32_t	getContactFilterSelf() const {return contactFilterSelf;}
-	void		setContactFilterSelf(uint32_t filter) {contactFilterSelf = filter;}
-
-	uint32_t	getContactFilterTarget() const {return contactFilterTarget;}
-	void		setContactFilterTarget(uint32_t filter) {contactFilterTarget = filter;}
-
-	float getLinearDamping() const {return linearDamping;}
-	float getAngularDamping() const {return angularDamping;}
-
-	void setLinearDamping(float damping) {linearDamping=damping;}
-	void setAngularDamping(float damping) {angularDamping=damping;}
-
-
-	uint8_t		getMotionType() const {return mMotionType;}
-	void		setMotionType(uint8_t t) {mMotionType = t;mSleeping=0;mSleepCount=0;}
-
-	uint8_t		getMotionMask() const {return (1<<mMotionType)|(mSleeping<<7);}
-
-	bool		isAsleep() const {return mSleeping==1;}
-	bool		isAwake() const {return mSleeping==0;}
-
-	void		wakeup() {mSleeping=0;mSleepCount=0;}
-	void		sleep() {if(useSleep) {mSleeping=1;mSleepCount=0;}}
-
-	uint8_t		getUseSleep() const {return useSleep;}
-	void		setUseSleep(uint8_t b) {useSleep=b;}
-
-	uint8_t		getUseCcd() const {return useCcd;}
-	void		setUseCcd(uint8_t b) {useCcd=b;}
-
-	uint8_t		getUseContactCallback() const {return useContactCallback;}
-	void		setUseContactCallback(uint8_t b) {useContactCallback=b;}
-
-	uint8_t		getUseSleepCallback() const {return useSleepCallback;}
-	void		setUseSleepCallback(uint8_t b) {useSleepCallback=b;}
-
-	void	 	incrementSleepCount() {mSleepCount++;}
-	void		resetSleepCount() {mSleepCount=0;}
-	uint16_t	getSleepCount() const {return mSleepCount;}
-
-	vmVector3 getPosition() const {return read_Vector3(fX);}
-	vmQuat    getOrientation() const {return read_Quat(fQ);}
-	vmVector3 getLinearVelocity() const {return read_Vector3(fV);}
-	vmVector3 getAngularVelocity() const {return read_Vector3(fOmega);}
-	vmVector3 getDeltaLinearVelocity() const {return read_Vector3(deltaLinearVelocity);}
-	vmVector3 getDeltaAngularVelocity() const {return read_Vector3(deltaAngularVelocity);}
-
-	void setPosition(const vmVector3 &pos) {store_Vector3(pos, fX);}
-	void setLinearVelocity(const vmVector3 &vel) {store_Vector3(vel, fV);}
-	void setAngularVelocity(const vmVector3 &vel) {store_Vector3(vel, fOmega);}
-	void setDeltaLinearVelocity(const vmVector3 &vel) {store_Vector3(vel, deltaLinearVelocity);}
-	void setDeltaAngularVelocity(const vmVector3 &vel) {store_Vector3(vel, deltaAngularVelocity);}
-	void setOrientation(const vmQuat &rot) {store_Quat(rot, fQ);}
-
-	inline void setAuxils(const vmVector3 &centerLocal,const vmVector3 &halfLocal);
-	inline void	setAuxilsCcd(const vmVector3 &centerLocal,const vmVector3 &halfLocal,float timeStep);
-	inline	void reset();
-};
-
-inline
-TrbState::TrbState(const uint8_t m, const vmVector3& x, const vmQuat& q, const vmVector3& v, const vmVector3& omega)
-{
-	setMotionType(m);
-	fX[0] = x[0];
-	fX[1] = x[1];
-	fX[2] = x[2];
-	fQ[0] = q[0];
-	fQ[1] = q[1];
-	fQ[2] = q[2];
-	fQ[3] = q[3];
-	fV[0] = v[0];
-	fV[1] = v[1];
-	fV[2] = v[2];
-	fOmega[0] = omega[0];
-	fOmega[1] = omega[1];
-	fOmega[2] = omega[2];
-	contactFilterSelf=contactFilterTarget=0xffff;
-	trbBodyIdx=0;
-	mSleeping = 0;
-	deleted = 0;
-	useSleep = 1;
-	useCcd = 0;
-	useContactCallback = 0;
-	useSleepCallback = 0;
-	mSleepCount=0;
-	linearDamping = 1.0f;
-	angularDamping = 0.99f;
-}
-
-inline void
-TrbState::setIdentity()
-{
-	fX[0] = 0.0f;
-	fX[1] = 0.0f;
-	fX[2] = 0.0f;
-	fQ[0] = 0.0f;
-	fQ[1] = 0.0f;
-	fQ[2] = 0.0f;
-	fQ[3] = 1.0f;
-	fV[0] = 0.0f;
-	fV[1] = 0.0f;
-	fV[2] = 0.0f;
-	fOmega[0] = 0.0f;
-	fOmega[1] = 0.0f;
-	fOmega[2] = 0.0f;
-}
-
-inline void
-TrbState::setZero()
-{
-	fX[0] = 0.0f;
-	fX[1] = 0.0f;
-	fX[2] = 0.0f;
-	fQ[0] = 0.0f;
-	fQ[1] = 0.0f;
-	fQ[2] = 0.0f;
-	fQ[3] = 0.0f;
-	fV[0] = 0.0f;
-	fV[1] = 0.0f;
-	fV[2] = 0.0f;
-	fOmega[0] = 0.0f;
-	fOmega[1] = 0.0f;
-	fOmega[2] = 0.0f;
-}
-
-inline void
-TrbState::setAuxils(const vmVector3 &centerLocal,const vmVector3 &halfLocal)
-{
-	vmVector3 centerW = getPosition() + rotate(getOrientation(),centerLocal);
-	vmVector3 halfW = absPerElem(vmMatrix3(getOrientation())) * halfLocal;
-	center[0] = centerW[0];
-	center[1] = centerW[1];
-	center[2] = centerW[2];
-	half[0] = halfW[0];
-	half[1] = halfW[1];
-	half[2] = halfW[2];
-}
-
-inline void
-TrbState::setAuxilsCcd(const vmVector3 &centerLocal,const vmVector3 &halfLocal,float timeStep)
-{
-	vmVector3 centerW = getPosition() + rotate(getOrientation(),centerLocal);
-	vmVector3 halfW = absPerElem(vmMatrix3(getOrientation())) * halfLocal;
-
-	vmVector3 diffvec = getLinearVelocity()*timeStep;
-
-	vmVector3 newCenter = centerW + diffvec;
-	vmVector3 aabbMin = minPerElem(newCenter - halfW,centerW - halfW);
-	vmVector3 aabbMax = maxPerElem(newCenter + halfW,centerW + halfW);
-	
-	centerW = 0.5f * (aabbMin + aabbMax);
-	halfW =0.5f * (aabbMax - aabbMin);
-
-	center[0] = centerW[0];
-	center[1] = centerW[1];
-	center[2] = centerW[2];
-
-	half[0] = halfW[0];
-	half[1] = halfW[1];
-	half[2] = halfW[2];
-}
-
-inline
-void TrbState::reset()
-{
-#if 0
-	mSleepCount = 0;
-	mMotionType = PfxMotionTypeActive;
-	mDeleted = 0;
-	mSleeping = 0;
-	mUseSleep = 1;
-	mUseCcd = 0;
-	mUseContactCallback = 0;
-	mUseSleepCallback = 0;
-	mRigidBodyId = 0;
-	mContactFilterSelf = 0xffffffff;
-	mContactFilterTarget = 0xffffffff;
-	mLinearDamping = 1.0f;
-	mAngularDamping = 0.99f;
-	mPosition = vmVector3(0.0f);
-	mOrientation = vmQuat::identity();
-	mLinearVelocity = vmVector3(0.0f);
-	mAngularVelocity = vmVector3(0.0f);
-#endif
-
-	setMotionType(PfxMotionTypeActive);
-	contactFilterSelf=contactFilterTarget=0xffffffff;
-	deleted = 0;
-	mSleeping = 0;
-	useSleep = 1;
-	trbBodyIdx=0;
-	mSleepCount=0;
-	useCcd = 0;
-	useContactCallback = 0;
-	useSleepCallback = 0;
-	linearDamping = 1.0f;
-	angularDamping = 0.99f;
-}
-
-#endif //BT_TRBSTATEVEC_H__
-
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/Win32ThreadSupport.cpp b/hkl3d/bullet/src/BulletMultiThreaded/Win32ThreadSupport.cpp
deleted file mode 100644
index 1197bbe..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/Win32ThreadSupport.cpp
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "Win32ThreadSupport.h"
-
-#ifdef USE_WIN32_THREADING
-
-#include <windows.h>
-
-#include "SpuCollisionTaskProcess.h"
-
-#include "SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h"
-
-
-
-///The number of threads should be equal to the number of available cores
-///@todo: each worker should be linked to a single core, using SetThreadIdealProcessor.
-
-///Win32ThreadSupport helps to initialize/shutdown libspe2, start/stop SPU tasks and communication
-///Setup and initialize SPU/CELL/Libspe2
-Win32ThreadSupport::Win32ThreadSupport(const Win32ThreadConstructionInfo & threadConstructionInfo)
-{
-	m_maxNumTasks = threadConstructionInfo.m_numThreads;
-	startThreads(threadConstructionInfo);
-}
-
-///cleanup/shutdown Libspe2
-Win32ThreadSupport::~Win32ThreadSupport()
-{
-	stopSPU();
-}
-
-
-
-
-#include <stdio.h>
-
-DWORD WINAPI Thread_no_1( LPVOID lpParam ) 
-{
-
-	Win32ThreadSupport::btSpuStatus* status = (Win32ThreadSupport::btSpuStatus*)lpParam;
-
-	
-	while (1)
-	{
-		WaitForSingleObject(status->m_eventStartHandle,INFINITE);
-		
-		void* userPtr = status->m_userPtr;
-
-		if (userPtr)
-		{
-			btAssert(status->m_status);
-			status->m_userThreadFunc(userPtr,status->m_lsMemory);
-			status->m_status = 2;
-			SetEvent(status->m_eventCompletetHandle);
-		} else
-		{
-			//exit Thread
-			status->m_status = 3;
-			printf("Thread with taskId %i with handle %p exiting\n",status->m_taskId, status->m_threadHandle);
-			SetEvent(status->m_eventCompletetHandle);
-			break;
-		}
-		
-	}
-
-	printf("Thread TERMINATED\n");
-	return 0;
-
-}
-
-///send messages to SPUs
-void Win32ThreadSupport::sendRequest(uint32_t uiCommand, ppu_address_t uiArgument0, uint32_t taskId)
-{
-	///	gMidphaseSPU.sendRequest(CMD_GATHER_AND_PROCESS_PAIRLIST, (ppu_address_t) &taskDesc);
-	
-	///we should spawn an SPU task here, and in 'waitForResponse' it should wait for response of the (one of) the first tasks that finished
-	
-
-
-	switch (uiCommand)
-	{
-	case 	CMD_GATHER_AND_PROCESS_PAIRLIST:
-		{
-
-
-//#define SINGLE_THREADED 1
-#ifdef SINGLE_THREADED
-
-			btSpuStatus&	spuStatus = m_activeSpuStatus[0];
-			spuStatus.m_userPtr=(void*)uiArgument0;
-			spuStatus.m_userThreadFunc(spuStatus.m_userPtr,spuStatus.m_lsMemory);
-			HANDLE handle =0;
-#else
-
-
-			btSpuStatus&	spuStatus = m_activeSpuStatus[taskId];
-			btAssert(taskId>=0);
-			btAssert(int(taskId)<m_activeSpuStatus.size());
-
-			spuStatus.m_commandId = uiCommand;
-			spuStatus.m_status = 1;
-			spuStatus.m_userPtr = (void*)uiArgument0;
-
-			///fire event to start new task
-			SetEvent(spuStatus.m_eventStartHandle);
-
-#endif //CollisionTask_LocalStoreMemory
-
-			
-
-			break;
-		}
-	default:
-		{
-			///not implemented
-			btAssert(0);
-		}
-
-	};
-
-
-}
-
-
-///check for messages from SPUs
-void Win32ThreadSupport::waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1)
-{
-	///We should wait for (one of) the first tasks to finish (or other SPU messages), and report its response
-	
-	///A possible response can be 'yes, SPU handled it', or 'no, please do a PPU fallback'
-
-
-	btAssert(m_activeSpuStatus.size());
-
-	int last = -1;
-#ifndef SINGLE_THREADED
-	DWORD res = WaitForMultipleObjects(m_completeHandles.size(), &m_completeHandles[0], FALSE, INFINITE);
-	btAssert(res != WAIT_FAILED);
-	last = res - WAIT_OBJECT_0;
-
-	btSpuStatus& spuStatus = m_activeSpuStatus[last];
-	btAssert(spuStatus.m_threadHandle);
-	btAssert(spuStatus.m_eventCompletetHandle);
-
-	//WaitForSingleObject(spuStatus.m_eventCompletetHandle, INFINITE);
-	btAssert(spuStatus.m_status > 1);
-	spuStatus.m_status = 0;
-
-	///need to find an active spu
-	btAssert(last>=0);
-
-#else
-	last=0;
-	btSpuStatus& spuStatus = m_activeSpuStatus[last];
-#endif //SINGLE_THREADED
-
-	
-
-	*puiArgument0 = spuStatus.m_taskId;
-	*puiArgument1 = spuStatus.m_status;
-
-
-}
-
-
-///check for messages from SPUs
-bool Win32ThreadSupport::isTaskCompleted(unsigned int *puiArgument0, unsigned int *puiArgument1, int timeOutInMilliseconds)
-{
-	///We should wait for (one of) the first tasks to finish (or other SPU messages), and report its response
-	
-	///A possible response can be 'yes, SPU handled it', or 'no, please do a PPU fallback'
-
-
-	btAssert(m_activeSpuStatus.size());
-
-	int last = -1;
-#ifndef SINGLE_THREADED
-	DWORD res = WaitForMultipleObjects(m_completeHandles.size(), &m_completeHandles[0], FALSE, timeOutInMilliseconds);
-	
-	if ((res != STATUS_TIMEOUT) && (res != WAIT_FAILED))
-	{
-		
-		btAssert(res != WAIT_FAILED);
-		last = res - WAIT_OBJECT_0;
-
-		btSpuStatus& spuStatus = m_activeSpuStatus[last];
-		btAssert(spuStatus.m_threadHandle);
-		btAssert(spuStatus.m_eventCompletetHandle);
-
-		//WaitForSingleObject(spuStatus.m_eventCompletetHandle, INFINITE);
-		btAssert(spuStatus.m_status > 1);
-		spuStatus.m_status = 0;
-
-		///need to find an active spu
-		btAssert(last>=0);
-
-	#else
-		last=0;
-		btSpuStatus& spuStatus = m_activeSpuStatus[last];
-	#endif //SINGLE_THREADED
-
-		
-
-		*puiArgument0 = spuStatus.m_taskId;
-		*puiArgument1 = spuStatus.m_status;
-
-		return true;
-	} 
-
-	return false;
-}
-
-
-void Win32ThreadSupport::startThreads(const Win32ThreadConstructionInfo& threadConstructionInfo)
-{
-
-	m_activeSpuStatus.resize(threadConstructionInfo.m_numThreads);
-	m_completeHandles.resize(threadConstructionInfo.m_numThreads);
-
-	m_maxNumTasks = threadConstructionInfo.m_numThreads;
-
-	for (int i=0;i<threadConstructionInfo.m_numThreads;i++)
-	{
-		printf("starting thread %d\n",i);
-
-		btSpuStatus&	spuStatus = m_activeSpuStatus[i];
-
-		LPSECURITY_ATTRIBUTES lpThreadAttributes=NULL;
-		SIZE_T dwStackSize=threadConstructionInfo.m_threadStackSize;
-		LPTHREAD_START_ROUTINE lpStartAddress=&Thread_no_1;
-		LPVOID lpParameter=&spuStatus;
-		DWORD dwCreationFlags=0;
-		LPDWORD lpThreadId=0;
-
-		spuStatus.m_userPtr=0;
-
-		sprintf(spuStatus.m_eventStartHandleName,"eventStart%s%d",threadConstructionInfo.m_uniqueName,i);
-		spuStatus.m_eventStartHandle = CreateEventA (0,false,false,spuStatus.m_eventStartHandleName);
-
-		sprintf(spuStatus.m_eventCompletetHandleName,"eventComplete%s%d",threadConstructionInfo.m_uniqueName,i);
-		spuStatus.m_eventCompletetHandle = CreateEventA (0,false,false,spuStatus.m_eventCompletetHandleName);
-
-		m_completeHandles[i] = spuStatus.m_eventCompletetHandle;
-
-		HANDLE handle = CreateThread(lpThreadAttributes,dwStackSize,lpStartAddress,lpParameter,	dwCreationFlags,lpThreadId);
-		SetThreadPriority(handle,THREAD_PRIORITY_HIGHEST);
-		//SetThreadPriority(handle,THREAD_PRIORITY_TIME_CRITICAL);
-
-		SetThreadAffinityMask(handle, 1<<i);
-
-		spuStatus.m_taskId = i;
-		spuStatus.m_commandId = 0;
-		spuStatus.m_status = 0;
-		spuStatus.m_threadHandle = handle;
-		spuStatus.m_lsMemory = threadConstructionInfo.m_lsMemoryFunc();
-		spuStatus.m_userThreadFunc = threadConstructionInfo.m_userThreadFunc;
-
-		printf("started thread %d with threadHandle %p\n",i,handle);
-		
-	}
-
-}
-
-void Win32ThreadSupport::startSPU()
-{
-}
-
-
-///tell the task scheduler we are done with the SPU tasks
-void Win32ThreadSupport::stopSPU()
-{
-	int i;
-	for (i=0;i<m_activeSpuStatus.size();i++)
-	{
-		btSpuStatus& spuStatus = m_activeSpuStatus[i];
-		if (spuStatus.m_status>0)
-		{
-			WaitForSingleObject(spuStatus.m_eventCompletetHandle, INFINITE);
-		}
-		
-
-		spuStatus.m_userPtr = 0;
-		SetEvent(spuStatus.m_eventStartHandle);
-		WaitForSingleObject(spuStatus.m_eventCompletetHandle, INFINITE);
-
-		CloseHandle(spuStatus.m_eventCompletetHandle);
-		CloseHandle(spuStatus.m_eventStartHandle);
-		CloseHandle(spuStatus.m_threadHandle);
-	}
-
-	m_activeSpuStatus.clear();
-	m_completeHandles.clear();
-
-}
-
-
-
-class btWin32Barrier : public btBarrier
-{
-private:
-	CRITICAL_SECTION mExternalCriticalSection;
-	CRITICAL_SECTION mLocalCriticalSection;
-	HANDLE mRunEvent,mNotifyEvent;
-	int mCounter,mEnableCounter;
-	int mMaxCount;
-
-public:
-	btWin32Barrier()
-	{
-		mCounter = 0;
-		mMaxCount = 1;
-		mEnableCounter = 0;
-		InitializeCriticalSection(&mExternalCriticalSection);
-		InitializeCriticalSection(&mLocalCriticalSection);
-		mRunEvent = CreateEvent(NULL,TRUE,FALSE,NULL);
-		mNotifyEvent = CreateEvent(NULL,TRUE,FALSE,NULL);
-	}
-
-	virtual ~btWin32Barrier()
-	{
-		DeleteCriticalSection(&mExternalCriticalSection);
-		DeleteCriticalSection(&mLocalCriticalSection);
-		CloseHandle(mRunEvent);
-		CloseHandle(mNotifyEvent);
-	}
-
-	void sync()
-	{
-		int eventId;
-
-		EnterCriticalSection(&mExternalCriticalSection);
-
-		//PFX_PRINTF("enter taskId %d count %d stage %d phase %d mEnableCounter %d\n",taskId,mCounter,debug&0xff,debug>>16,mEnableCounter);
-
-		if(mEnableCounter > 0) {
-			ResetEvent(mNotifyEvent);
-			LeaveCriticalSection(&mExternalCriticalSection);
-			WaitForSingleObject(mNotifyEvent,INFINITE); 
-			EnterCriticalSection(&mExternalCriticalSection);
-		}
-
-		eventId = mCounter;
-		mCounter++;
-
-		if(eventId == mMaxCount-1) {
-			SetEvent(mRunEvent);
-
-			mEnableCounter = mCounter-1;
-			mCounter = 0;
-		}
-		else {
-			ResetEvent(mRunEvent);
-			LeaveCriticalSection(&mExternalCriticalSection);
-			WaitForSingleObject(mRunEvent,INFINITE); 
-			EnterCriticalSection(&mExternalCriticalSection);
-			mEnableCounter--;
-		}
-
-		if(mEnableCounter == 0) {
-			SetEvent(mNotifyEvent);
-		}
-
-		//PFX_PRINTF("leave taskId %d count %d stage %d phase %d mEnableCounter %d\n",taskId,mCounter,debug&0xff,debug>>16,mEnableCounter);
-
-		LeaveCriticalSection(&mExternalCriticalSection);
-	}
-
-	virtual void setMaxCount(int n) {mMaxCount = n;}
-	virtual int  getMaxCount() {return mMaxCount;}
-};
-
-class btWin32CriticalSection : public btCriticalSection
-{
-private:
-	CRITICAL_SECTION mCriticalSection;
-
-public:
-	btWin32CriticalSection()
-	{
-		InitializeCriticalSection(&mCriticalSection);
-	}
-
-	~btWin32CriticalSection()
-	{
-		DeleteCriticalSection(&mCriticalSection);
-	}
-
-	unsigned int getSharedParam(int i)
-	{
-		btAssert(i>=0&&i<31);
-		return mCommonBuff[i+1];
-	}
-
-	void setSharedParam(int i,unsigned int p)
-	{
-		btAssert(i>=0&&i<31);
-		mCommonBuff[i+1] = p;
-	}
-
-	void lock()
-	{
-		EnterCriticalSection(&mCriticalSection);
-		mCommonBuff[0] = 1;
-	}
-
-	void unlock()
-	{
-		mCommonBuff[0] = 0;
-		LeaveCriticalSection(&mCriticalSection);
-	}
-};
-
-
-btBarrier*	Win32ThreadSupport::createBarrier()
-{
-	unsigned char* mem = (unsigned char*)btAlignedAlloc(sizeof(btWin32Barrier),16);
-	btWin32Barrier* barrier = new(mem) btWin32Barrier();
-	barrier->setMaxCount(getNumTasks());
-	return barrier;
-}
-
-btCriticalSection* Win32ThreadSupport::createCriticalSection()
-{
-	unsigned char* mem = (unsigned char*) btAlignedAlloc(sizeof(btWin32CriticalSection),16);
-	btWin32CriticalSection* cs = new(mem) btWin32CriticalSection();
-	return cs;
-}
-
-
-
-#endif //USE_WIN32_THREADING
-
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/Win32ThreadSupport.h b/hkl3d/bullet/src/BulletMultiThreaded/Win32ThreadSupport.h
deleted file mode 100644
index 4370c00..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/Win32ThreadSupport.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "LinearMath/btScalar.h"
-#include "PlatformDefinitions.h"
-
-#ifdef USE_WIN32_THREADING  //platform specific defines are defined in PlatformDefinitions.h
-
-#ifndef BT_WIN32_THREAD_SUPPORT_H
-#define BT_WIN32_THREAD_SUPPORT_H
-
-#include "LinearMath/btAlignedObjectArray.h"
-
-#include "btThreadSupportInterface.h"
-
-
-typedef void (*Win32ThreadFunc)(void* userPtr,void* lsMemory);
-typedef void* (*Win32lsMemorySetupFunc)();
-
-
-///Win32ThreadSupport helps to initialize/shutdown libspe2, start/stop SPU tasks and communication
-class Win32ThreadSupport : public btThreadSupportInterface 
-{
-public:
-	///placeholder, until libspe2 support is there
-	struct	btSpuStatus
-	{
-		uint32_t	m_taskId;
-		uint32_t	m_commandId;
-		uint32_t	m_status;
-
-		Win32ThreadFunc	m_userThreadFunc;
-		void*	m_userPtr; //for taskDesc etc
-		void*	m_lsMemory; //initialized using Win32LocalStoreMemorySetupFunc
-
-		void*	m_threadHandle; //this one is calling 'Win32ThreadFunc'
-
-		void*	m_eventStartHandle;
-		char	m_eventStartHandleName[32];
-
-		void*	m_eventCompletetHandle;
-		char	m_eventCompletetHandleName[32];
-		
-
-	};
-private:
-
-	btAlignedObjectArray<btSpuStatus>	m_activeSpuStatus;
-	btAlignedObjectArray<void*>			m_completeHandles;
-	
-	int m_maxNumTasks;
-public:
-	///Setup and initialize SPU/CELL/Libspe2
-
-	struct	Win32ThreadConstructionInfo
-	{
-		Win32ThreadConstructionInfo(char* uniqueName,
-									Win32ThreadFunc userThreadFunc,
-									Win32lsMemorySetupFunc	lsMemoryFunc,
-									int numThreads=1,
-									int threadStackSize=65535
-									)
-									:m_uniqueName(uniqueName),
-									m_userThreadFunc(userThreadFunc),
-									m_lsMemoryFunc(lsMemoryFunc),
-									m_numThreads(numThreads),
-									m_threadStackSize(threadStackSize)
-		{
-
-		}
-
-		char*					m_uniqueName;
-		Win32ThreadFunc			m_userThreadFunc;
-		Win32lsMemorySetupFunc	m_lsMemoryFunc;
-		int						m_numThreads;
-		int						m_threadStackSize;
-
-	};
-
-
-
-	Win32ThreadSupport(const Win32ThreadConstructionInfo& threadConstructionInfo);
-
-///cleanup/shutdown Libspe2
-	virtual	~Win32ThreadSupport();
-
-	void	startThreads(const Win32ThreadConstructionInfo&	threadInfo);
-
-
-///send messages to SPUs
-	virtual	void sendRequest(uint32_t uiCommand, ppu_address_t uiArgument0, uint32_t uiArgument1);
-
-///check for messages from SPUs
-	virtual	void waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1);
-
-	virtual bool isTaskCompleted(unsigned int *puiArgument0, unsigned int *puiArgument1, int timeOutInMilliseconds);
-
-///start the spus (can be called at the beginning of each frame, to make sure that the right SPU program is loaded)
-	virtual	void startSPU();
-
-///tell the task scheduler we are done with the SPU tasks
-	virtual	void stopSPU();
-
-	virtual	void	setNumTasks(int numTasks)
-	{
-		m_maxNumTasks = numTasks;
-	}
-
-	virtual int getNumTasks() const
-	{
-		return m_maxNumTasks;
-	}
-
-	virtual void*	getThreadLocalMemory(int taskId)
-	{
-		return m_activeSpuStatus[taskId].m_lsMemory;
-	}
-	virtual btBarrier*	createBarrier();
-
-	virtual btCriticalSection* createCriticalSection();
-
-};
-
-#endif //BT_WIN32_THREAD_SUPPORT_H
-
-#endif //USE_WIN32_THREADING
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/btThreadSupportInterface.cpp b/hkl3d/bullet/src/BulletMultiThreaded/btThreadSupportInterface.cpp
deleted file mode 100644
index 8192aa4..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/btThreadSupportInterface.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btThreadSupportInterface.h"
-
-btThreadSupportInterface::~btThreadSupportInterface()
-{
-
-}
-
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/btThreadSupportInterface.h b/hkl3d/bullet/src/BulletMultiThreaded/btThreadSupportInterface.h
deleted file mode 100644
index 16850e2..0000000
--- a/hkl3d/bullet/src/BulletMultiThreaded/btThreadSupportInterface.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_THREAD_SUPPORT_INTERFACE_H
-#define BT_THREAD_SUPPORT_INTERFACE_H
-
-
-#include <LinearMath/btScalar.h> //for ATTRIBUTE_ALIGNED16
-#include "PlatformDefinitions.h"
-#include "PpuAddressSpace.h"
-
-class btBarrier {
-public:
-	btBarrier() {}
-	virtual ~btBarrier() {}
-
-	virtual void sync() = 0;
-	virtual void setMaxCount(int n) = 0;
-	virtual int  getMaxCount() = 0;
-};
-
-class btCriticalSection {
-public:
-	btCriticalSection() {}
-	virtual ~btCriticalSection() {}
-
-	ATTRIBUTE_ALIGNED16(unsigned int mCommonBuff[32]);
-
-	virtual unsigned int getSharedParam(int i) = 0;
-	virtual void setSharedParam(int i,unsigned int p) = 0;
-
-	virtual void lock() = 0;
-	virtual void unlock() = 0;
-};
-
-
-class btThreadSupportInterface
-{
-public:
-
-	virtual ~btThreadSupportInterface();
-
-///send messages to SPUs
-	virtual void sendRequest(uint32_t uiCommand, ppu_address_t uiArgument0, uint32_t uiArgument1) =0;
-
-///check for messages from SPUs
-	virtual	void waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1) =0;
-
-
-	///non-blocking test if a task is completed. First implement all versions, and then enable this API
-	///virtual bool isTaskCompleted(unsigned int *puiArgument0, unsigned int *puiArgument1, int timeOutInMilliseconds)=0;
-
-///start the spus (can be called at the beginning of each frame, to make sure that the right SPU program is loaded)
-	virtual	void startSPU() =0;
-
-///tell the task scheduler we are done with the SPU tasks
-	virtual	void stopSPU()=0;
-
-	///tell the task scheduler to use no more than numTasks tasks
-	virtual void	setNumTasks(int numTasks)=0;
-
-	virtual int		getNumTasks() const = 0;
-
-	virtual btBarrier*	createBarrier() = 0;
-
-	virtual btCriticalSection* createCriticalSection() = 0;
-	
-	virtual void*	getThreadLocalMemory(int taskId) { return 0; }
-
-};
-
-#endif //BT_THREAD_SUPPORT_INTERFACE_H
-
diff --git a/hkl3d/bullet/src/LinearMath/btAabbUtil2.h b/hkl3d/bullet/src/LinearMath/btAabbUtil2.h
deleted file mode 100644
index 42b721d..0000000
--- a/hkl3d/bullet/src/LinearMath/btAabbUtil2.h
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
-Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-#ifndef BT_AABB_UTIL2
-#define BT_AABB_UTIL2
-
-#include "btTransform.h"
-#include "btVector3.h"
-#include "btMinMax.h"
-
-
-
-SIMD_FORCE_INLINE void AabbExpand (btVector3& aabbMin,
-								   btVector3& aabbMax,
-								   const btVector3& expansionMin,
-								   const btVector3& expansionMax)
-{
-	aabbMin = aabbMin + expansionMin;
-	aabbMax = aabbMax + expansionMax;
-}
-
-/// conservative test for overlap between two aabbs
-SIMD_FORCE_INLINE bool TestPointAgainstAabb2(const btVector3 &aabbMin1, const btVector3 &aabbMax1,
-								const btVector3 &point)
-{
-	bool overlap = true;
-	overlap = (aabbMin1.getX() > point.getX() || aabbMax1.getX() < point.getX()) ? false : overlap;
-	overlap = (aabbMin1.getZ() > point.getZ() || aabbMax1.getZ() < point.getZ()) ? false : overlap;
-	overlap = (aabbMin1.getY() > point.getY() || aabbMax1.getY() < point.getY()) ? false : overlap;
-	return overlap;
-}
-
-
-/// conservative test for overlap between two aabbs
-SIMD_FORCE_INLINE bool TestAabbAgainstAabb2(const btVector3 &aabbMin1, const btVector3 &aabbMax1,
-								const btVector3 &aabbMin2, const btVector3 &aabbMax2)
-{
-	bool overlap = true;
-	overlap = (aabbMin1.getX() > aabbMax2.getX() || aabbMax1.getX() < aabbMin2.getX()) ? false : overlap;
-	overlap = (aabbMin1.getZ() > aabbMax2.getZ() || aabbMax1.getZ() < aabbMin2.getZ()) ? false : overlap;
-	overlap = (aabbMin1.getY() > aabbMax2.getY() || aabbMax1.getY() < aabbMin2.getY()) ? false : overlap;
-	return overlap;
-}
-
-/// conservative test for overlap between triangle and aabb
-SIMD_FORCE_INLINE bool TestTriangleAgainstAabb2(const btVector3 *vertices,
-									const btVector3 &aabbMin, const btVector3 &aabbMax)
-{
-	const btVector3 &p1 = vertices[0];
-	const btVector3 &p2 = vertices[1];
-	const btVector3 &p3 = vertices[2];
-
-	if (btMin(btMin(p1[0], p2[0]), p3[0]) > aabbMax[0]) return false;
-	if (btMax(btMax(p1[0], p2[0]), p3[0]) < aabbMin[0]) return false;
-
-	if (btMin(btMin(p1[2], p2[2]), p3[2]) > aabbMax[2]) return false;
-	if (btMax(btMax(p1[2], p2[2]), p3[2]) < aabbMin[2]) return false;
-  
-	if (btMin(btMin(p1[1], p2[1]), p3[1]) > aabbMax[1]) return false;
-	if (btMax(btMax(p1[1], p2[1]), p3[1]) < aabbMin[1]) return false;
-	return true;
-}
-
-
-SIMD_FORCE_INLINE int	btOutcode(const btVector3& p,const btVector3& halfExtent) 
-{
-	return (p.getX()  < -halfExtent.getX() ? 0x01 : 0x0) |    
-		   (p.getX() >  halfExtent.getX() ? 0x08 : 0x0) |
-		   (p.getY() < -halfExtent.getY() ? 0x02 : 0x0) |    
-		   (p.getY() >  halfExtent.getY() ? 0x10 : 0x0) |
-		   (p.getZ() < -halfExtent.getZ() ? 0x4 : 0x0) |    
-		   (p.getZ() >  halfExtent.getZ() ? 0x20 : 0x0);
-}
-
-
-
-SIMD_FORCE_INLINE bool btRayAabb2(const btVector3& rayFrom,
-								  const btVector3& rayInvDirection,
-								  const unsigned int raySign[3],
-								  const btVector3 bounds[2],
-								  btScalar& tmin,
-								  btScalar lambda_min,
-								  btScalar lambda_max)
-{
-	btScalar tmax, tymin, tymax, tzmin, tzmax;
-	tmin = (bounds[raySign[0]].getX() - rayFrom.getX()) * rayInvDirection.getX();
-	tmax = (bounds[1-raySign[0]].getX() - rayFrom.getX()) * rayInvDirection.getX();
-	tymin = (bounds[raySign[1]].getY() - rayFrom.getY()) * rayInvDirection.getY();
-	tymax = (bounds[1-raySign[1]].getY() - rayFrom.getY()) * rayInvDirection.getY();
-
-	if ( (tmin > tymax) || (tymin > tmax) )
-		return false;
-
-	if (tymin > tmin)
-		tmin = tymin;
-
-	if (tymax < tmax)
-		tmax = tymax;
-
-	tzmin = (bounds[raySign[2]].getZ() - rayFrom.getZ()) * rayInvDirection.getZ();
-	tzmax = (bounds[1-raySign[2]].getZ() - rayFrom.getZ()) * rayInvDirection.getZ();
-
-	if ( (tmin > tzmax) || (tzmin > tmax) )
-		return false;
-	if (tzmin > tmin)
-		tmin = tzmin;
-	if (tzmax < tmax)
-		tmax = tzmax;
-	return ( (tmin < lambda_max) && (tmax > lambda_min) );
-}
-
-SIMD_FORCE_INLINE bool btRayAabb(const btVector3& rayFrom, 
-								 const btVector3& rayTo, 
-								 const btVector3& aabbMin, 
-								 const btVector3& aabbMax,
-					  btScalar& param, btVector3& normal) 
-{
-	btVector3 aabbHalfExtent = (aabbMax-aabbMin)* btScalar(0.5);
-	btVector3 aabbCenter = (aabbMax+aabbMin)* btScalar(0.5);
-	btVector3	source = rayFrom - aabbCenter;
-	btVector3	target = rayTo - aabbCenter;
-	int	sourceOutcode = btOutcode(source,aabbHalfExtent);
-	int targetOutcode = btOutcode(target,aabbHalfExtent);
-	if ((sourceOutcode & targetOutcode) == 0x0)
-	{
-		btScalar lambda_enter = btScalar(0.0);
-		btScalar lambda_exit  = param;
-		btVector3 r = target - source;
-		int i;
-		btScalar	normSign = 1;
-		btVector3	hitNormal(0,0,0);
-		int bit=1;
-
-		for (int j=0;j<2;j++)
-		{
-			for (i = 0; i != 3; ++i)
-			{
-				if (sourceOutcode & bit)
-				{
-					btScalar lambda = (-source[i] - aabbHalfExtent[i]*normSign) / r[i];
-					if (lambda_enter <= lambda)
-					{
-						lambda_enter = lambda;
-						hitNormal.setValue(0,0,0);
-						hitNormal[i] = normSign;
-					}
-				}
-				else if (targetOutcode & bit) 
-				{
-					btScalar lambda = (-source[i] - aabbHalfExtent[i]*normSign) / r[i];
-					btSetMin(lambda_exit, lambda);
-				}
-				bit<<=1;
-			}
-			normSign = btScalar(-1.);
-		}
-		if (lambda_enter <= lambda_exit)
-		{
-			param = lambda_enter;
-			normal = hitNormal;
-			return true;
-		}
-	}
-	return false;
-}
-
-
-
-SIMD_FORCE_INLINE	void btTransformAabb(const btVector3& halfExtents, btScalar margin,const btTransform& t,btVector3& aabbMinOut,btVector3& aabbMaxOut)
-{
-	btVector3 halfExtentsWithMargin = halfExtents+btVector3(margin,margin,margin);
-	btMatrix3x3 abs_b = t.getBasis().absolute();  
-	btVector3 center = t.getOrigin();
-	btVector3 extent = btVector3(abs_b[0].dot(halfExtentsWithMargin),
-		   abs_b[1].dot(halfExtentsWithMargin),
-		  abs_b[2].dot(halfExtentsWithMargin));
-	aabbMinOut = center - extent;
-	aabbMaxOut = center + extent;
-}
-
-
-SIMD_FORCE_INLINE	void btTransformAabb(const btVector3& localAabbMin,const btVector3& localAabbMax, btScalar margin,const btTransform& trans,btVector3& aabbMinOut,btVector3& aabbMaxOut)
-{
-		btAssert(localAabbMin.getX() <= localAabbMax.getX());
-		btAssert(localAabbMin.getY() <= localAabbMax.getY());
-		btAssert(localAabbMin.getZ() <= localAabbMax.getZ());
-		btVector3 localHalfExtents = btScalar(0.5)*(localAabbMax-localAabbMin);
-		localHalfExtents+=btVector3(margin,margin,margin);
-
-		btVector3 localCenter = btScalar(0.5)*(localAabbMax+localAabbMin);
-		btMatrix3x3 abs_b = trans.getBasis().absolute();  
-		btVector3 center = trans(localCenter);
-		btVector3 extent = btVector3(abs_b[0].dot(localHalfExtents),
-			   abs_b[1].dot(localHalfExtents),
-			  abs_b[2].dot(localHalfExtents));
-		aabbMinOut = center-extent;
-		aabbMaxOut = center+extent;
-}
-
-#define USE_BANCHLESS 1
-#ifdef USE_BANCHLESS
-	//This block replaces the block below and uses no branches, and replaces the 8 bit return with a 32 bit return for improved performance (~3x on XBox 360)
-	SIMD_FORCE_INLINE unsigned testQuantizedAabbAgainstQuantizedAabb(const unsigned short int* aabbMin1,const unsigned short int* aabbMax1,const unsigned short int* aabbMin2,const unsigned short int* aabbMax2)
-	{		
-		return static_cast<unsigned int>(btSelect((unsigned)((aabbMin1[0] <= aabbMax2[0]) & (aabbMax1[0] >= aabbMin2[0])
-			& (aabbMin1[2] <= aabbMax2[2]) & (aabbMax1[2] >= aabbMin2[2])
-			& (aabbMin1[1] <= aabbMax2[1]) & (aabbMax1[1] >= aabbMin2[1])),
-			1, 0));
-	}
-#else
-	SIMD_FORCE_INLINE bool testQuantizedAabbAgainstQuantizedAabb(const unsigned short int* aabbMin1,const unsigned short int* aabbMax1,const unsigned short int* aabbMin2,const unsigned short int* aabbMax2)
-	{
-		bool overlap = true;
-		overlap = (aabbMin1[0] > aabbMax2[0] || aabbMax1[0] < aabbMin2[0]) ? false : overlap;
-		overlap = (aabbMin1[2] > aabbMax2[2] || aabbMax1[2] < aabbMin2[2]) ? false : overlap;
-		overlap = (aabbMin1[1] > aabbMax2[1] || aabbMax1[1] < aabbMin2[1]) ? false : overlap;
-		return overlap;
-	}
-#endif //USE_BANCHLESS
-
-#endif //BT_AABB_UTIL2
-
-
diff --git a/hkl3d/bullet/src/LinearMath/btAlignedAllocator.cpp b/hkl3d/bullet/src/LinearMath/btAlignedAllocator.cpp
deleted file mode 100644
index 189b759..0000000
--- a/hkl3d/bullet/src/LinearMath/btAlignedAllocator.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include "btAlignedAllocator.h"
-
-int gNumAlignedAllocs = 0;
-int gNumAlignedFree = 0;
-int gTotalBytesAlignedAllocs = 0;//detect memory leaks
-
-static void *btAllocDefault(size_t size)
-{
-	return malloc(size);
-}
-
-static void btFreeDefault(void *ptr)
-{
-	free(ptr);
-}
-
-static btAllocFunc *sAllocFunc = btAllocDefault;
-static btFreeFunc *sFreeFunc = btFreeDefault;
-
-
-
-#if defined (BT_HAS_ALIGNED_ALLOCATOR)
-#include <malloc.h>
-static void *btAlignedAllocDefault(size_t size, int alignment)
-{
-	return _aligned_malloc(size, (size_t)alignment);
-}
-
-static void btAlignedFreeDefault(void *ptr)
-{
-	_aligned_free(ptr);
-}
-#elif defined(__CELLOS_LV2__)
-#include <stdlib.h>
-
-static inline void *btAlignedAllocDefault(size_t size, int alignment)
-{
-	return memalign(alignment, size);
-}
-
-static inline void btAlignedFreeDefault(void *ptr)
-{
-	free(ptr);
-}
-#else
-static inline void *btAlignedAllocDefault(size_t size, int alignment)
-{
-  void *ret;
-  char *real;
-  unsigned long offset;
-
-  real = (char *)sAllocFunc(size + sizeof(void *) + (alignment-1));
-  if (real) {
-    offset = (alignment - (unsigned long)(real + sizeof(void *))) & (alignment-1);
-    ret = (void *)((real + sizeof(void *)) + offset);
-    *((void **)(ret)-1) = (void *)(real);
-  } else {
-    ret = (void *)(real);
-  }
-  return (ret);
-}
-
-static inline void btAlignedFreeDefault(void *ptr)
-{
-  void* real;
-
-  if (ptr) {
-    real = *((void **)(ptr)-1);
-    sFreeFunc(real);
-  }
-}
-#endif
-
-
-static btAlignedAllocFunc *sAlignedAllocFunc = btAlignedAllocDefault;
-static btAlignedFreeFunc *sAlignedFreeFunc = btAlignedFreeDefault;
-
-void btAlignedAllocSetCustomAligned(btAlignedAllocFunc *allocFunc, btAlignedFreeFunc *freeFunc)
-{
-  sAlignedAllocFunc = allocFunc ? allocFunc : btAlignedAllocDefault;
-  sAlignedFreeFunc = freeFunc ? freeFunc : btAlignedFreeDefault;
-}
-
-void btAlignedAllocSetCustom(btAllocFunc *allocFunc, btFreeFunc *freeFunc)
-{
-  sAllocFunc = allocFunc ? allocFunc : btAllocDefault;
-  sFreeFunc = freeFunc ? freeFunc : btFreeDefault;
-}
-
-#ifdef BT_DEBUG_MEMORY_ALLOCATIONS
-//this generic allocator provides the total allocated number of bytes
-#include <stdio.h>
-
-void*   btAlignedAllocInternal  (size_t size, int alignment,int line,char* filename)
-{
- void *ret;
- char *real;
- unsigned long offset;
-
- gTotalBytesAlignedAllocs += size;
- gNumAlignedAllocs++;
-
- 
- real = (char *)sAllocFunc(size + 2*sizeof(void *) + (alignment-1));
- if (real) {
-   offset = (alignment - (unsigned long)(real + 2*sizeof(void *))) &
-(alignment-1);
-   ret = (void *)((real + 2*sizeof(void *)) + offset);
-   *((void **)(ret)-1) = (void *)(real);
-       *((int*)(ret)-2) = size;
-
- } else {
-   ret = (void *)(real);//??
- }
-
- printf("allocation#%d at address %x, from %s,line %d, size %d\n",gNumAlignedAllocs,real, filename,line,size);
-
- int* ptr = (int*)ret;
- *ptr = 12;
- return (ret);
-}
-
-void    btAlignedFreeInternal   (void* ptr,int line,char* filename)
-{
-
- void* real;
- gNumAlignedFree++;
-
- if (ptr) {
-   real = *((void **)(ptr)-1);
-       int size = *((int*)(ptr)-2);
-       gTotalBytesAlignedAllocs -= size;
-
-	   printf("free #%d at address %x, from %s,line %d, size %d\n",gNumAlignedFree,real, filename,line,size);
-
-   sFreeFunc(real);
- } else
- {
-	 printf("NULL ptr\n");
- }
-}
-
-#else //BT_DEBUG_MEMORY_ALLOCATIONS
-
-void*	btAlignedAllocInternal	(size_t size, int alignment)
-{
-	gNumAlignedAllocs++;
-	void* ptr;
-	ptr = sAlignedAllocFunc(size, alignment);
-//	printf("btAlignedAllocInternal %d, %x\n",size,ptr);
-	return ptr;
-}
-
-void	btAlignedFreeInternal	(void* ptr)
-{
-	if (!ptr)
-	{
-		return;
-	}
-
-	gNumAlignedFree++;
-//	printf("btAlignedFreeInternal %x\n",ptr);
-	sAlignedFreeFunc(ptr);
-}
-
-#endif //BT_DEBUG_MEMORY_ALLOCATIONS
-
diff --git a/hkl3d/bullet/src/LinearMath/btAlignedAllocator.h b/hkl3d/bullet/src/LinearMath/btAlignedAllocator.h
deleted file mode 100644
index f168f3c..0000000
--- a/hkl3d/bullet/src/LinearMath/btAlignedAllocator.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_ALIGNED_ALLOCATOR
-#define BT_ALIGNED_ALLOCATOR
-
-///we probably replace this with our own aligned memory allocator
-///so we replace _aligned_malloc and _aligned_free with our own
-///that is better portable and more predictable
-
-#include "btScalar.h"
-//#define BT_DEBUG_MEMORY_ALLOCATIONS 1
-#ifdef BT_DEBUG_MEMORY_ALLOCATIONS
-
-#define btAlignedAlloc(a,b) \
-		btAlignedAllocInternal(a,b,__LINE__,__FILE__)
-
-#define btAlignedFree(ptr) \
-		btAlignedFreeInternal(ptr,__LINE__,__FILE__)
-
-void*	btAlignedAllocInternal	(size_t size, int alignment,int line,char* filename);
-
-void	btAlignedFreeInternal	(void* ptr,int line,char* filename);
-
-#else
-	void*	btAlignedAllocInternal	(size_t size, int alignment);
-	void	btAlignedFreeInternal	(void* ptr);
-
-	#define btAlignedAlloc(size,alignment) btAlignedAllocInternal(size,alignment)
-	#define btAlignedFree(ptr) btAlignedFreeInternal(ptr)
-
-#endif
-typedef int	size_type;
-
-typedef void *(btAlignedAllocFunc)(size_t size, int alignment);
-typedef void (btAlignedFreeFunc)(void *memblock);
-typedef void *(btAllocFunc)(size_t size);
-typedef void (btFreeFunc)(void *memblock);
-
-///The developer can let all Bullet memory allocations go through a custom memory allocator, using btAlignedAllocSetCustom
-void btAlignedAllocSetCustom(btAllocFunc *allocFunc, btFreeFunc *freeFunc);
-///If the developer has already an custom aligned allocator, then btAlignedAllocSetCustomAligned can be used. The default aligned allocator pre-allocates extra memory using the non-aligned allocator, and instruments it.
-void btAlignedAllocSetCustomAligned(btAlignedAllocFunc *allocFunc, btAlignedFreeFunc *freeFunc);
-
-
-///The btAlignedAllocator is a portable class for aligned memory allocations.
-///Default implementations for unaligned and aligned allocations can be overridden by a custom allocator using btAlignedAllocSetCustom and btAlignedAllocSetCustomAligned.
-template < typename T , unsigned Alignment >
-class btAlignedAllocator {
-	
-	typedef btAlignedAllocator< T , Alignment > self_type;
-	
-public:
-
-	//just going down a list:
-	btAlignedAllocator() {}
-	/*
-	btAlignedAllocator( const self_type & ) {}
-	*/
-
-	template < typename Other >
-	btAlignedAllocator( const btAlignedAllocator< Other , Alignment > & ) {}
-
-	typedef const T*         const_pointer;
-	typedef const T&         const_reference;
-	typedef T*               pointer;
-	typedef T&               reference;
-	typedef T                value_type;
-
-	pointer       address   ( reference        ref ) const                           { return &ref; }
-	const_pointer address   ( const_reference  ref ) const                           { return &ref; }
-	pointer       allocate  ( size_type        n   , const_pointer *      hint = 0 ) {
-		(void)hint;
-		return reinterpret_cast< pointer >(btAlignedAlloc( sizeof(value_type) * n , Alignment ));
-	}
-	void          construct ( pointer          ptr , const value_type &   value    ) { new (ptr) value_type( value ); }
-	void          deallocate( pointer          ptr ) {
-		btAlignedFree( reinterpret_cast< void * >( ptr ) );
-	}
-	void          destroy   ( pointer          ptr )                                 { ptr->~value_type(); }
-	
-
-	template < typename O > struct rebind {
-		typedef btAlignedAllocator< O , Alignment > other;
-	};
-	template < typename O >
-	self_type & operator=( const btAlignedAllocator< O , Alignment > & ) { return *this; }
-
-	friend bool operator==( const self_type & , const self_type & ) { return true; }
-};
-
-
-
-#endif //BT_ALIGNED_ALLOCATOR
-
diff --git a/hkl3d/bullet/src/LinearMath/btAlignedObjectArray.h b/hkl3d/bullet/src/LinearMath/btAlignedObjectArray.h
deleted file mode 100644
index 955bb12..0000000
--- a/hkl3d/bullet/src/LinearMath/btAlignedObjectArray.h
+++ /dev/null
@@ -1,471 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef BT_OBJECT_ARRAY__
-#define BT_OBJECT_ARRAY__
-
-#include "btScalar.h" // has definitions like SIMD_FORCE_INLINE
-#include "btAlignedAllocator.h"
-
-///If the platform doesn't support placement new, you can disable BT_USE_PLACEMENT_NEW
-///then the btAlignedObjectArray doesn't support objects with virtual methods, and non-trivial constructors/destructors
-///You can enable BT_USE_MEMCPY, then swapping elements in the array will use memcpy instead of operator=
-///see discussion here: http://continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1231 and
-///http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1240
-
-#define BT_USE_PLACEMENT_NEW 1
-//#define BT_USE_MEMCPY 1 //disable, because it is cumbersome to find out for each platform where memcpy is defined. It can be in <memory.h> or <string.h> or otherwise...
-
-#ifdef BT_USE_MEMCPY
-#include <memory.h>
-#include <string.h>
-#endif //BT_USE_MEMCPY
-
-#ifdef BT_USE_PLACEMENT_NEW
-#include <new> //for placement new
-#endif //BT_USE_PLACEMENT_NEW
-
-
-///The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods
-///It is developed to replace stl::vector to avoid portability issues, including STL alignment issues to add SIMD/SSE data
-template <typename T> 
-//template <class T> 
-class btAlignedObjectArray
-{
-	btAlignedAllocator<T , 16>	m_allocator;
-
-	int					m_size;
-	int					m_capacity;
-	T*					m_data;
-	//PCK: added this line
-	bool				m_ownsMemory;
-
-	protected:
-		SIMD_FORCE_INLINE	int	allocSize(int size)
-		{
-			return (size ? size*2 : 1);
-		}
-		SIMD_FORCE_INLINE	void	copy(int start,int end, T* dest) const
-		{
-			int i;
-			for (i=start;i<end;++i)
-#ifdef BT_USE_PLACEMENT_NEW
-				new (&dest[i]) T(m_data[i]);
-#else
-				dest[i] = m_data[i];
-#endif //BT_USE_PLACEMENT_NEW
-		}
-
-		SIMD_FORCE_INLINE	void	init()
-		{
-			//PCK: added this line
-			m_ownsMemory = true;
-			m_data = 0;
-			m_size = 0;
-			m_capacity = 0;
-		}
-		SIMD_FORCE_INLINE	void	destroy(int first,int last)
-		{
-			int i;
-			for (i=first; i<last;i++)
-			{
-				m_data[i].~T();
-			}
-		}
-
-		SIMD_FORCE_INLINE	void* allocate(int size)
-		{
-			if (size)
-				return m_allocator.allocate(size);
-			return 0;
-		}
-
-		SIMD_FORCE_INLINE	void	deallocate()
-		{
-			if(m_data)	{
-				//PCK: enclosed the deallocation in this block
-				if (m_ownsMemory)
-				{
-					m_allocator.deallocate(m_data);
-				}
-				m_data = 0;
-			}
-		}
-
-	
-
-
-	public:
-		
-		btAlignedObjectArray()
-		{
-			init();
-		}
-
-		~btAlignedObjectArray()
-		{
-			clear();
-		}
-
-		///Generally it is best to avoid using the copy constructor of an btAlignedObjectArray, and use a (const) reference to the array instead.
-		btAlignedObjectArray(const btAlignedObjectArray& otherArray)
-		{
-			init();
-
-			int otherSize = otherArray.size();
-			resize (otherSize);
-			otherArray.copy(0, otherSize, m_data);
-		}
-
-		
-		
-		/// return the number of elements in the array
-		SIMD_FORCE_INLINE	int size() const
-		{	
-			return m_size;
-		}
-		
-		SIMD_FORCE_INLINE const T& at(int n) const
-		{
-			return m_data[n];
-		}
-
-		SIMD_FORCE_INLINE T& at(int n)
-		{
-			return m_data[n];
-		}
-
-		SIMD_FORCE_INLINE const T& operator[](int n) const
-		{
-			return m_data[n];
-		}
-
-		SIMD_FORCE_INLINE T& operator[](int n)
-		{
-			return m_data[n];
-		}
-		
-
-		///clear the array, deallocated memory. Generally it is better to use array.resize(0), to reduce performance overhead of run-time memory (de)allocations.
-		SIMD_FORCE_INLINE	void	clear()
-		{
-			destroy(0,size());
-			
-			deallocate();
-			
-			init();
-		}
-
-		SIMD_FORCE_INLINE	void	pop_back()
-		{
-			m_size--;
-			m_data[m_size].~T();
-		}
-
-		///resize changes the number of elements in the array. If the new size is larger, the new elements will be constructed using the optional second argument.
-		///when the new number of elements is smaller, the destructor will be called, but memory will not be freed, to reduce performance overhead of run-time memory (de)allocations.
-		SIMD_FORCE_INLINE	void	resize(int newsize, const T& fillData=T())
-		{
-			int curSize = size();
-
-			if (newsize < curSize)
-			{
-				for(int i = newsize; i < curSize; i++)
-				{
-					m_data[i].~T();
-				}
-			} else
-			{
-				if (newsize > size())
-				{
-					reserve(newsize);
-				}
-#ifdef BT_USE_PLACEMENT_NEW
-				for (int i=curSize;i<newsize;i++)
-				{
-					new ( &m_data[i]) T(fillData);
-				}
-#endif //BT_USE_PLACEMENT_NEW
-
-			}
-
-			m_size = newsize;
-		}
-	
-		SIMD_FORCE_INLINE	T&  expandNonInitializing( )
-		{	
-			int sz = size();
-			if( sz == capacity() )
-			{
-				reserve( allocSize(size()) );
-			}
-			m_size++;
-
-			return m_data[sz];		
-		}
-
-
-		SIMD_FORCE_INLINE	T&  expand( const T& fillValue=T())
-		{	
-			int sz = size();
-			if( sz == capacity() )
-			{
-				reserve( allocSize(size()) );
-			}
-			m_size++;
-#ifdef BT_USE_PLACEMENT_NEW
-			new (&m_data[sz]) T(fillValue); //use the in-place new (not really allocating heap memory)
-#endif
-
-			return m_data[sz];		
-		}
-
-
-		SIMD_FORCE_INLINE	void push_back(const T& _Val)
-		{	
-			int sz = size();
-			if( sz == capacity() )
-			{
-				reserve( allocSize(size()) );
-			}
-			
-#ifdef BT_USE_PLACEMENT_NEW
-			new ( &m_data[m_size] ) T(_Val);
-#else
-			m_data[size()] = _Val;			
-#endif //BT_USE_PLACEMENT_NEW
-
-			m_size++;
-		}
-
-	
-		/// return the pre-allocated (reserved) elements, this is at least as large as the total number of elements,see size() and reserve()
-		SIMD_FORCE_INLINE	int capacity() const
-		{	
-			return m_capacity;
-		}
-		
-		SIMD_FORCE_INLINE	void reserve(int _Count)
-		{	// determine new minimum length of allocated storage
-			if (capacity() < _Count)
-			{	// not enough room, reallocate
-				T*	s = (T*)allocate(_Count);
-
-				copy(0, size(), s);
-
-				destroy(0,size());
-
-				deallocate();
-				
-				//PCK: added this line
-				m_ownsMemory = true;
-
-				m_data = s;
-				
-				m_capacity = _Count;
-
-			}
-		}
-
-
-		class less
-		{
-			public:
-
-				bool operator() ( const T& a, const T& b )
-				{
-					return ( a < b );
-				}
-		};
-	
-		template <typename L>
-		void quickSortInternal(L CompareFunc,int lo, int hi)
-		{
-		//  lo is the lower index, hi is the upper index
-		//  of the region of array a that is to be sorted
-			int i=lo, j=hi;
-			T x=m_data[(lo+hi)/2];
-
-			//  partition
-			do
-			{    
-				while (CompareFunc(m_data[i],x)) 
-					i++; 
-				while (CompareFunc(x,m_data[j])) 
-					j--;
-				if (i<=j)
-				{
-					swap(i,j);
-					i++; j--;
-				}
-			} while (i<=j);
-
-			//  recursion
-			if (lo<j) 
-				quickSortInternal( CompareFunc, lo, j);
-			if (i<hi) 
-				quickSortInternal( CompareFunc, i, hi);
-		}
-
-
-		template <typename L>
-		void quickSort(L CompareFunc)
-		{
-			//don't sort 0 or 1 elements
-			if (size()>1)
-			{
-				quickSortInternal(CompareFunc,0,size()-1);
-			}
-		}
-
-
-		///heap sort from http://www.csse.monash.edu.au/~lloyd/tildeAlgDS/Sort/Heap/
-		template <typename L>
-		void downHeap(T *pArr, int k, int n,L CompareFunc)
-		{
-			/*  PRE: a[k+1..N] is a heap */
-			/* POST:  a[k..N]  is a heap */
-			
-			T temp = pArr[k - 1];
-			/* k has child(s) */
-			while (k <= n/2) 
-			{
-				int child = 2*k;
-				
-				if ((child < n) && CompareFunc(pArr[child - 1] , pArr[child]))
-				{
-					child++;
-				}
-				/* pick larger child */
-				if (CompareFunc(temp , pArr[child - 1]))
-				{
-					/* move child up */
-					pArr[k - 1] = pArr[child - 1];
-					k = child;
-				}
-				else
-				{
-					break;
-				}
-			}
-			pArr[k - 1] = temp;
-		} /*downHeap*/
-
-		void	swap(int index0,int index1)
-		{
-#ifdef BT_USE_MEMCPY
-			char	temp[sizeof(T)];
-			memcpy(temp,&m_data[index0],sizeof(T));
-			memcpy(&m_data[index0],&m_data[index1],sizeof(T));
-			memcpy(&m_data[index1],temp,sizeof(T));
-#else
-			T temp = m_data[index0];
-			m_data[index0] = m_data[index1];
-			m_data[index1] = temp;
-#endif //BT_USE_PLACEMENT_NEW
-
-		}
-
-	template <typename L>
-	void heapSort(L CompareFunc)
-	{
-		/* sort a[0..N-1],  N.B. 0 to N-1 */
-		int k;
-		int n = m_size;
-		for (k = n/2; k > 0; k--) 
-		{
-			downHeap(m_data, k, n, CompareFunc);
-		}
-
-		/* a[1..N] is now a heap */
-		while ( n>=1 ) 
-		{
-			swap(0,n-1); /* largest of a[0..n-1] */
-
-
-			n = n - 1;
-			/* restore a[1..i-1] heap */
-			downHeap(m_data, 1, n, CompareFunc);
-		} 
-	}
-
-	///non-recursive binary search, assumes sorted array
-	int	findBinarySearch(const T& key) const
-	{
-		int first = 0;
-		int last = size()-1;
-
-		//assume sorted array
-		while (first <= last) {
-			int mid = (first + last) / 2;  // compute mid point.
-			if (key > m_data[mid]) 
-				first = mid + 1;  // repeat search in top half.
-			else if (key < m_data[mid]) 
-				last = mid - 1; // repeat search in bottom half.
-			else
-				return mid;     // found it. return position /////
-		}
-		return size();    // failed to find key
-	}
-
-
-	int	findLinearSearch(const T& key) const
-	{
-		int index=size();
-		int i;
-
-		for (i=0;i<size();i++)
-		{
-			if (m_data[i] == key)
-			{
-				index = i;
-				break;
-			}
-		}
-		return index;
-	}
-
-	void	remove(const T& key)
-	{
-
-		int findIndex = findLinearSearch(key);
-		if (findIndex<size())
-		{
-			swap( findIndex,size()-1);
-			pop_back();
-		}
-	}
-
-	//PCK: whole function
-	void initializeFromBuffer(void *buffer, int size, int capacity)
-	{
-		clear();
-		m_ownsMemory = false;
-		m_data = (T*)buffer;
-		m_size = size;
-		m_capacity = capacity;
-	}
-
-	void copyFromArray(const btAlignedObjectArray& otherArray)
-	{
-		int otherSize = otherArray.size();
-		resize (otherSize);
-		otherArray.copy(0, otherSize, m_data);
-	}
-
-};
-
-#endif //BT_OBJECT_ARRAY__
diff --git a/hkl3d/bullet/src/LinearMath/btConvexHull.cpp b/hkl3d/bullet/src/LinearMath/btConvexHull.cpp
deleted file mode 100644
index 532d76d..0000000
--- a/hkl3d/bullet/src/LinearMath/btConvexHull.cpp
+++ /dev/null
@@ -1,1174 +0,0 @@
-/*
-Stan Melax Convex Hull Computation
-Copyright (c) 2003-2006 Stan Melax http://www.melax.com/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include <string.h>
-
-#include "btConvexHull.h"
-#include "btAlignedObjectArray.h"
-#include "btMinMax.h"
-#include "btVector3.h"
-
-
-
-template <class T>
-void Swap(T &a,T &b)
-{
-	T tmp = a;
-	a=b;
-	b=tmp;
-}
-
-
-//----------------------------------
-
-class int3  
-{
-public:
-	int x,y,z;
-	int3(){};
-	int3(int _x,int _y, int _z){x=_x;y=_y;z=_z;}
-	const int& operator[](int i) const {return (&x)[i];}
-	int& operator[](int i) {return (&x)[i];}
-};
-
-
-//------- btPlane ----------
-
-
-inline btPlane PlaneFlip(const btPlane &plane){return btPlane(-plane.normal,-plane.dist);}
-inline int operator==( const btPlane &a, const btPlane &b ) { return (a.normal==b.normal && a.dist==b.dist); }
-inline int coplanar( const btPlane &a, const btPlane &b ) { return (a==b || a==PlaneFlip(b)); }
-
-
-//--------- Utility Functions ------
-
-btVector3  PlaneLineIntersection(const btPlane &plane, const btVector3 &p0, const btVector3 &p1);
-btVector3  PlaneProject(const btPlane &plane, const btVector3 &point);
-
-btVector3  ThreePlaneIntersection(const btPlane &p0,const btPlane &p1, const btPlane &p2);
-btVector3  ThreePlaneIntersection(const btPlane &p0,const btPlane &p1, const btPlane &p2)
-{
-	btVector3 N1 = p0.normal;
-	btVector3 N2 = p1.normal;
-	btVector3 N3 = p2.normal;
-
-	btVector3 n2n3; n2n3 = N2.cross(N3);
-	btVector3 n3n1; n3n1 = N3.cross(N1);
-	btVector3 n1n2; n1n2 = N1.cross(N2);
-
-	btScalar quotient = (N1.dot(n2n3));
-
-	btAssert(btFabs(quotient) > btScalar(0.000001));
-	
-	quotient = btScalar(-1.) / quotient;
-	n2n3 *= p0.dist;
-	n3n1 *= p1.dist;
-	n1n2 *= p2.dist;
-	btVector3 potentialVertex = n2n3;
-	potentialVertex += n3n1;
-	potentialVertex += n1n2;
-	potentialVertex *= quotient;
-
-	btVector3 result(potentialVertex.getX(),potentialVertex.getY(),potentialVertex.getZ());
-	return result;
-
-}
-
-btScalar   DistanceBetweenLines(const btVector3 &ustart, const btVector3 &udir, const btVector3 &vstart, const btVector3 &vdir, btVector3 *upoint=NULL, btVector3 *vpoint=NULL);
-btVector3  TriNormal(const btVector3 &v0, const btVector3 &v1, const btVector3 &v2);
-btVector3  NormalOf(const btVector3 *vert, const int n);
-
-
-btVector3 PlaneLineIntersection(const btPlane &plane, const btVector3 &p0, const btVector3 &p1)
-{
-	// returns the point where the line p0-p1 intersects the plane n&d
-				static btVector3 dif;
-		dif = p1-p0;
-				btScalar dn= btDot(plane.normal,dif);
-				btScalar t = -(plane.dist+btDot(plane.normal,p0) )/dn;
-				return p0 + (dif*t);
-}
-
-btVector3 PlaneProject(const btPlane &plane, const btVector3 &point)
-{
-	return point - plane.normal * (btDot(point,plane.normal)+plane.dist);
-}
-
-btVector3 TriNormal(const btVector3 &v0, const btVector3 &v1, const btVector3 &v2)
-{
-	// return the normal of the triangle
-	// inscribed by v0, v1, and v2
-	btVector3 cp=btCross(v1-v0,v2-v1);
-	btScalar m=cp.length();
-	if(m==0) return btVector3(1,0,0);
-	return cp*(btScalar(1.0)/m);
-}
-
-
-btScalar DistanceBetweenLines(const btVector3 &ustart, const btVector3 &udir, const btVector3 &vstart, const btVector3 &vdir, btVector3 *upoint, btVector3 *vpoint)
-{
-	static btVector3 cp;
-	cp = btCross(udir,vdir).normalized();
-
-	btScalar distu = -btDot(cp,ustart);
-	btScalar distv = -btDot(cp,vstart);
-	btScalar dist = (btScalar)fabs(distu-distv);
-	if(upoint) 
-		{
-		btPlane plane;
-		plane.normal = btCross(vdir,cp).normalized();
-		plane.dist = -btDot(plane.normal,vstart);
-		*upoint = PlaneLineIntersection(plane,ustart,ustart+udir);
-	}
-	if(vpoint) 
-		{
-		btPlane plane;
-		plane.normal = btCross(udir,cp).normalized();
-		plane.dist = -btDot(plane.normal,ustart);
-		*vpoint = PlaneLineIntersection(plane,vstart,vstart+vdir);
-	}
-	return dist;
-}
-
-
-
-
-
-
-
-#define COPLANAR   (0)
-#define UNDER      (1)
-#define OVER       (2)
-#define SPLIT      (OVER|UNDER)
-#define PAPERWIDTH (btScalar(0.001))
-
-btScalar planetestepsilon = PAPERWIDTH;
-
-
-
-typedef ConvexH::HalfEdge HalfEdge;
-
-ConvexH::ConvexH(int vertices_size,int edges_size,int facets_size)
-{
-	vertices.resize(vertices_size);
-	edges.resize(edges_size);
-	facets.resize(facets_size);
-}
-
-
-int PlaneTest(const btPlane &p, const btVector3 &v);
-int PlaneTest(const btPlane &p, const btVector3 &v) {
-	btScalar a  = btDot(v,p.normal)+p.dist;
-	int   flag = (a>planetestepsilon)?OVER:((a<-planetestepsilon)?UNDER:COPLANAR);
-	return flag;
-}
-
-int SplitTest(ConvexH &convex,const btPlane &plane);
-int SplitTest(ConvexH &convex,const btPlane &plane) {
-	int flag=0;
-	for(int i=0;i<convex.vertices.size();i++) {
-		flag |= PlaneTest(plane,convex.vertices[i]);
-	}
-	return flag;
-}
-
-class VertFlag
-{
-public:
-	unsigned char planetest;
-	unsigned char junk;
-	unsigned char undermap;
-	unsigned char overmap;
-};
-class EdgeFlag 
-{
-public:
-	unsigned char planetest;
-	unsigned char fixes;
-	short undermap;
-	short overmap;
-};
-class PlaneFlag
-{
-public:
-	unsigned char undermap;
-	unsigned char overmap;
-};
-class Coplanar{
-public:
-	unsigned short ea;
-	unsigned char v0;
-	unsigned char v1;
-};
-
-
-
-
-
-
-
-
-template<class T>
-int maxdirfiltered(const T *p,int count,const T &dir,btAlignedObjectArray<int> &allow)
-{
-	btAssert(count);
-	int m=-1;
-	for(int i=0;i<count;i++) 
-		if(allow[i])
-		{
-			if(m==-1 || btDot(p[i],dir)>btDot(p[m],dir))
-				m=i;
-		}
-	btAssert(m!=-1);
-	return m;
-} 
-
-btVector3 orth(const btVector3 &v);
-btVector3 orth(const btVector3 &v)
-{
-	btVector3 a=btCross(v,btVector3(0,0,1));
-	btVector3 b=btCross(v,btVector3(0,1,0));
-	if (a.length() > b.length())
-	{
-		return a.normalized();
-	} else {
-		return b.normalized();
-	}
-}
-
-
-template<class T>
-int maxdirsterid(const T *p,int count,const T &dir,btAlignedObjectArray<int> &allow)
-{
-	int m=-1;
-	while(m==-1)
-	{
-		m = maxdirfiltered(p,count,dir,allow);
-		if(allow[m]==3) return m;
-		T u = orth(dir);
-		T v = btCross(u,dir);
-		int ma=-1;
-		for(btScalar x = btScalar(0.0) ; x<= btScalar(360.0) ; x+= btScalar(45.0))
-		{
-			btScalar s = btSin(SIMD_RADS_PER_DEG*(x));
-			btScalar c = btCos(SIMD_RADS_PER_DEG*(x));
-			int mb = maxdirfiltered(p,count,dir+(u*s+v*c)*btScalar(0.025),allow);
-			if(ma==m && mb==m)
-			{
-				allow[m]=3;
-				return m;
-			}
-			if(ma!=-1 && ma!=mb)  // Yuck - this is really ugly
-			{
-				int mc = ma;
-				for(btScalar xx = x-btScalar(40.0) ; xx <= x ; xx+= btScalar(5.0))
-				{
-					btScalar s = btSin(SIMD_RADS_PER_DEG*(xx));
-					btScalar c = btCos(SIMD_RADS_PER_DEG*(xx));
-					int md = maxdirfiltered(p,count,dir+(u*s+v*c)*btScalar(0.025),allow);
-					if(mc==m && md==m)
-					{
-						allow[m]=3;
-						return m;
-					}
-					mc=md;
-				}
-			}
-			ma=mb;
-		}
-		allow[m]=0;
-		m=-1;
-	}
-	btAssert(0);
-	return m;
-} 
-
-
-
-
-int operator ==(const int3 &a,const int3 &b);
-int operator ==(const int3 &a,const int3 &b) 
-{
-	for(int i=0;i<3;i++) 
-	{
-		if(a[i]!=b[i]) return 0;
-	}
-	return 1;
-}
-
-
-int above(btVector3* vertices,const int3& t, const btVector3 &p, btScalar epsilon);
-int above(btVector3* vertices,const int3& t, const btVector3 &p, btScalar epsilon) 
-{
-	btVector3 n=TriNormal(vertices[t[0]],vertices[t[1]],vertices[t[2]]);
-	return (btDot(n,p-vertices[t[0]]) > epsilon); // EPSILON???
-}
-int hasedge(const int3 &t, int a,int b);
-int hasedge(const int3 &t, int a,int b)
-{
-	for(int i=0;i<3;i++)
-	{
-		int i1= (i+1)%3;
-		if(t[i]==a && t[i1]==b) return 1;
-	}
-	return 0;
-}
-int hasvert(const int3 &t, int v);
-int hasvert(const int3 &t, int v)
-{
-	return (t[0]==v || t[1]==v || t[2]==v) ;
-}
-int shareedge(const int3 &a,const int3 &b);
-int shareedge(const int3 &a,const int3 &b)
-{
-	int i;
-	for(i=0;i<3;i++)
-	{
-		int i1= (i+1)%3;
-		if(hasedge(a,b[i1],b[i])) return 1;
-	}
-	return 0;
-}
-
-class btHullTriangle;
-
-
-
-class btHullTriangle : public int3
-{
-public:
-	int3 n;
-	int id;
-	int vmax;
-	btScalar rise;
-	btHullTriangle(int a,int b,int c):int3(a,b,c),n(-1,-1,-1)
-	{
-		vmax=-1;
-		rise = btScalar(0.0);
-	}
-	~btHullTriangle()
-	{
-	}
-	int &neib(int a,int b);
-};
-
-
-int &btHullTriangle::neib(int a,int b)
-{
-	static int er=-1;
-	int i;
-	for(i=0;i<3;i++) 
-	{
-		int i1=(i+1)%3;
-		int i2=(i+2)%3;
-		if((*this)[i]==a && (*this)[i1]==b) return n[i2];
-		if((*this)[i]==b && (*this)[i1]==a) return n[i2];
-	}
-	btAssert(0);
-	return er;
-}
-void HullLibrary::b2bfix(btHullTriangle* s,btHullTriangle*t)
-{
-	int i;
-	for(i=0;i<3;i++) 
-	{
-		int i1=(i+1)%3;
-		int i2=(i+2)%3;
-		int a = (*s)[i1];
-		int b = (*s)[i2];
-		btAssert(m_tris[s->neib(a,b)]->neib(b,a) == s->id);
-		btAssert(m_tris[t->neib(a,b)]->neib(b,a) == t->id);
-		m_tris[s->neib(a,b)]->neib(b,a) = t->neib(b,a);
-		m_tris[t->neib(b,a)]->neib(a,b) = s->neib(a,b);
-	}
-}
-
-void HullLibrary::removeb2b(btHullTriangle* s,btHullTriangle*t)
-{
-	b2bfix(s,t);
-	deAllocateTriangle(s);
-
-	deAllocateTriangle(t);
-}
-
-void HullLibrary::checkit(btHullTriangle *t)
-{
-	(void)t;
-
-	int i;
-	btAssert(m_tris[t->id]==t);
-	for(i=0;i<3;i++)
-	{
-		int i1=(i+1)%3;
-		int i2=(i+2)%3;
-		int a = (*t)[i1];
-		int b = (*t)[i2];
-
-		// release compile fix
-		(void)i1;
-		(void)i2;
-		(void)a;
-		(void)b;
-
-		btAssert(a!=b);
-		btAssert( m_tris[t->n[i]]->neib(b,a) == t->id);
-	}
-}
-
-btHullTriangle*	HullLibrary::allocateTriangle(int a,int b,int c)
-{
-	void* mem = btAlignedAlloc(sizeof(btHullTriangle),16);
-	btHullTriangle* tr = new (mem)btHullTriangle(a,b,c);
-	tr->id = m_tris.size();
-	m_tris.push_back(tr);
-
-	return tr;
-}
-
-void	HullLibrary::deAllocateTriangle(btHullTriangle* tri)
-{
-	btAssert(m_tris[tri->id]==tri);
-	m_tris[tri->id]=NULL;
-	tri->~btHullTriangle();
-	btAlignedFree(tri);
-}
-
-
-void HullLibrary::extrude(btHullTriangle *t0,int v)
-{
-	int3 t= *t0;
-	int n = m_tris.size();
-	btHullTriangle* ta = allocateTriangle(v,t[1],t[2]);
-	ta->n = int3(t0->n[0],n+1,n+2);
-	m_tris[t0->n[0]]->neib(t[1],t[2]) = n+0;
-	btHullTriangle* tb = allocateTriangle(v,t[2],t[0]);
-	tb->n = int3(t0->n[1],n+2,n+0);
-	m_tris[t0->n[1]]->neib(t[2],t[0]) = n+1;
-	btHullTriangle* tc = allocateTriangle(v,t[0],t[1]);
-	tc->n = int3(t0->n[2],n+0,n+1);
-	m_tris[t0->n[2]]->neib(t[0],t[1]) = n+2;
-	checkit(ta);
-	checkit(tb);
-	checkit(tc);
-	if(hasvert(*m_tris[ta->n[0]],v)) removeb2b(ta,m_tris[ta->n[0]]);
-	if(hasvert(*m_tris[tb->n[0]],v)) removeb2b(tb,m_tris[tb->n[0]]);
-	if(hasvert(*m_tris[tc->n[0]],v)) removeb2b(tc,m_tris[tc->n[0]]);
-	deAllocateTriangle(t0);
-
-}
-
-btHullTriangle* HullLibrary::extrudable(btScalar epsilon)
-{
-	int i;
-	btHullTriangle *t=NULL;
-	for(i=0;i<m_tris.size();i++)
-	{
-		if(!t || (m_tris[i] && t->rise<m_tris[i]->rise))
-		{
-			t = m_tris[i];
-		}
-	}
-	return (t->rise >epsilon)?t:NULL ;
-}
-
-
-
-
-int4 HullLibrary::FindSimplex(btVector3 *verts,int verts_count,btAlignedObjectArray<int> &allow)
-{
-	btVector3 basis[3];
-	basis[0] = btVector3( btScalar(0.01), btScalar(0.02), btScalar(1.0) );      
-	int p0 = maxdirsterid(verts,verts_count, basis[0],allow);   
-	int	p1 = maxdirsterid(verts,verts_count,-basis[0],allow);
-	basis[0] = verts[p0]-verts[p1];
-	if(p0==p1 || basis[0]==btVector3(0,0,0)) 
-		return int4(-1,-1,-1,-1);
-	basis[1] = btCross(btVector3(     btScalar(1),btScalar(0.02), btScalar(0)),basis[0]);
-	basis[2] = btCross(btVector3(btScalar(-0.02),     btScalar(1), btScalar(0)),basis[0]);
-	if (basis[1].length() > basis[2].length())
-	{
-		basis[1].normalize();
-	} else {
-		basis[1] = basis[2];
-		basis[1].normalize ();
-	}
-	int p2 = maxdirsterid(verts,verts_count,basis[1],allow);
-	if(p2 == p0 || p2 == p1)
-	{
-		p2 = maxdirsterid(verts,verts_count,-basis[1],allow);
-	}
-	if(p2 == p0 || p2 == p1) 
-		return int4(-1,-1,-1,-1);
-	basis[1] = verts[p2] - verts[p0];
-	basis[2] = btCross(basis[1],basis[0]).normalized();
-	int p3 = maxdirsterid(verts,verts_count,basis[2],allow);
-	if(p3==p0||p3==p1||p3==p2) p3 = maxdirsterid(verts,verts_count,-basis[2],allow);
-	if(p3==p0||p3==p1||p3==p2) 
-		return int4(-1,-1,-1,-1);
-	btAssert(!(p0==p1||p0==p2||p0==p3||p1==p2||p1==p3||p2==p3));
-	if(btDot(verts[p3]-verts[p0],btCross(verts[p1]-verts[p0],verts[p2]-verts[p0])) <0) {Swap(p2,p3);}
-	return int4(p0,p1,p2,p3);
-}
-
-int HullLibrary::calchullgen(btVector3 *verts,int verts_count, int vlimit)
-{
-	if(verts_count <4) return 0;
-	if(vlimit==0) vlimit=1000000000;
-	int j;
-	btVector3 bmin(*verts),bmax(*verts);
-	btAlignedObjectArray<int> isextreme;
-	isextreme.reserve(verts_count);
-	btAlignedObjectArray<int> allow;
-	allow.reserve(verts_count);
-
-	for(j=0;j<verts_count;j++) 
-	{
-		allow.push_back(1);
-		isextreme.push_back(0);
-		bmin.setMin (verts[j]);
-		bmax.setMax (verts[j]);
-	}
-	btScalar epsilon = (bmax-bmin).length() * btScalar(0.001);
-	btAssert (epsilon != 0.0);
-
-
-	int4 p = FindSimplex(verts,verts_count,allow);
-	if(p.x==-1) return 0; // simplex failed
-
-
-
-	btVector3 center = (verts[p[0]]+verts[p[1]]+verts[p[2]]+verts[p[3]]) / btScalar(4.0);  // a valid interior point
-	btHullTriangle *t0 = allocateTriangle(p[2],p[3],p[1]); t0->n=int3(2,3,1);
-	btHullTriangle *t1 = allocateTriangle(p[3],p[2],p[0]); t1->n=int3(3,2,0);
-	btHullTriangle *t2 = allocateTriangle(p[0],p[1],p[3]); t2->n=int3(0,1,3);
-	btHullTriangle *t3 = allocateTriangle(p[1],p[0],p[2]); t3->n=int3(1,0,2);
-	isextreme[p[0]]=isextreme[p[1]]=isextreme[p[2]]=isextreme[p[3]]=1;
-	checkit(t0);checkit(t1);checkit(t2);checkit(t3);
-
-	for(j=0;j<m_tris.size();j++)
-	{
-		btHullTriangle *t=m_tris[j];
-		btAssert(t);
-		btAssert(t->vmax<0);
-		btVector3 n=TriNormal(verts[(*t)[0]],verts[(*t)[1]],verts[(*t)[2]]);
-		t->vmax = maxdirsterid(verts,verts_count,n,allow);
-		t->rise = btDot(n,verts[t->vmax]-verts[(*t)[0]]);
-	}
-	btHullTriangle *te;
-	vlimit-=4;
-	while(vlimit >0 && ((te=extrudable(epsilon)) != 0))
-	{
-		int3 ti=*te;
-		int v=te->vmax;
-		btAssert(v != -1);
-		btAssert(!isextreme[v]);  // wtf we've already done this vertex
-		isextreme[v]=1;
-		//if(v==p0 || v==p1 || v==p2 || v==p3) continue; // done these already
-		j=m_tris.size();
-		while(j--) {
-			if(!m_tris[j]) continue;
-			int3 t=*m_tris[j];
-			if(above(verts,t,verts[v],btScalar(0.01)*epsilon)) 
-			{
-				extrude(m_tris[j],v);
-			}
-		}
-		// now check for those degenerate cases where we have a flipped triangle or a really skinny triangle
-		j=m_tris.size();
-		while(j--)
-		{
-			if(!m_tris[j]) continue;
-			if(!hasvert(*m_tris[j],v)) break;
-			int3 nt=*m_tris[j];
-			if(above(verts,nt,center,btScalar(0.01)*epsilon)  || btCross(verts[nt[1]]-verts[nt[0]],verts[nt[2]]-verts[nt[1]]).length()< epsilon*epsilon*btScalar(0.1) )
-			{
-				btHullTriangle *nb = m_tris[m_tris[j]->n[0]];
-				btAssert(nb);btAssert(!hasvert(*nb,v));btAssert(nb->id<j);
-				extrude(nb,v);
-				j=m_tris.size(); 
-			}
-		} 
-		j=m_tris.size();
-		while(j--)
-		{
-			btHullTriangle *t=m_tris[j];
-			if(!t) continue;
-			if(t->vmax>=0) break;
-			btVector3 n=TriNormal(verts[(*t)[0]],verts[(*t)[1]],verts[(*t)[2]]);
-			t->vmax = maxdirsterid(verts,verts_count,n,allow);
-			if(isextreme[t->vmax]) 
-			{
-				t->vmax=-1; // already done that vertex - algorithm needs to be able to terminate.
-			}
-			else
-			{
-				t->rise = btDot(n,verts[t->vmax]-verts[(*t)[0]]);
-			}
-		}
-		vlimit --;
-	}
-	return 1;
-}
-
-int HullLibrary::calchull(btVector3 *verts,int verts_count, TUIntArray& tris_out, int &tris_count,int vlimit) 
-{
-	int rc=calchullgen(verts,verts_count,  vlimit) ;
-	if(!rc) return 0;
-	btAlignedObjectArray<int> ts;
-	int i;
-
-	for(i=0;i<m_tris.size();i++)
-	{
-		if(m_tris[i])
-		{
-			for(int j=0;j<3;j++)
-				ts.push_back((*m_tris[i])[j]);
-			deAllocateTriangle(m_tris[i]);
-		}
-	}
-	tris_count = ts.size()/3;
-	tris_out.resize(ts.size());
-	
-	for (i=0;i<ts.size();i++)
-	{
-		tris_out[i] = static_cast<unsigned int>(ts[i]);
-	}
-	m_tris.resize(0);
-
-	return 1;
-}
-
-
-
-
-
-bool HullLibrary::ComputeHull(unsigned int vcount,const btVector3 *vertices,PHullResult &result,unsigned int vlimit)
-{
-	
-	int    tris_count;
-	int ret = calchull( (btVector3 *) vertices, (int) vcount, result.m_Indices, tris_count, static_cast<int>(vlimit) );
-	if(!ret) return false;
-	result.mIndexCount = (unsigned int) (tris_count*3);
-	result.mFaceCount  = (unsigned int) tris_count;
-	result.mVertices   = (btVector3*) vertices;
-	result.mVcount     = (unsigned int) vcount;
-	return true;
-
-}
-
-
-void ReleaseHull(PHullResult &result);
-void ReleaseHull(PHullResult &result)
-{
-	if ( result.m_Indices.size() )
-	{
-		result.m_Indices.clear();
-	}
-
-	result.mVcount = 0;
-	result.mIndexCount = 0;
-	result.mVertices = 0;
-}
-
-
-//*********************************************************************
-//*********************************************************************
-//********  HullLib header
-//*********************************************************************
-//*********************************************************************
-
-//*********************************************************************
-//*********************************************************************
-//********  HullLib implementation
-//*********************************************************************
-//*********************************************************************
-
-HullError HullLibrary::CreateConvexHull(const HullDesc       &desc,           // describes the input request
-																					HullResult           &result)         // contains the resulst
-{
-	HullError ret = QE_FAIL;
-
-
-	PHullResult hr;
-
-	unsigned int vcount = desc.mVcount;
-	if ( vcount < 8 ) vcount = 8;
-
-	btAlignedObjectArray<btVector3> vertexSource;
-	vertexSource.resize(static_cast<int>(vcount));
-
-	btVector3 scale;
-
-	unsigned int ovcount;
-
-	bool ok = CleanupVertices(desc.mVcount,desc.mVertices, desc.mVertexStride, ovcount, &vertexSource[0], desc.mNormalEpsilon, scale ); // normalize point cloud, remove duplicates!
-
-	if ( ok )
-	{
-
-
-//		if ( 1 ) // scale vertices back to their original size.
-		{
-			for (unsigned int i=0; i<ovcount; i++)
-			{
-				btVector3& v = vertexSource[static_cast<int>(i)];
-				v[0]*=scale[0];
-				v[1]*=scale[1];
-				v[2]*=scale[2];
-			}
-		}
-
-		ok = ComputeHull(ovcount,&vertexSource[0],hr,desc.mMaxVertices);
-
-		if ( ok )
-		{
-
-			// re-index triangle mesh so it refers to only used vertices, rebuild a new vertex table.
-			btAlignedObjectArray<btVector3>	vertexScratch;
-			vertexScratch.resize(static_cast<int>(hr.mVcount));
-
-			BringOutYourDead(hr.mVertices,hr.mVcount, &vertexScratch[0], ovcount, &hr.m_Indices[0], hr.mIndexCount );
-
-			ret = QE_OK;
-
-			if ( desc.HasHullFlag(QF_TRIANGLES) ) // if he wants the results as triangle!
-			{
-				result.mPolygons          = false;
-				result.mNumOutputVertices = ovcount;
-				result.m_OutputVertices.resize(static_cast<int>(ovcount));
-				result.mNumFaces          = hr.mFaceCount;
-				result.mNumIndices        = hr.mIndexCount;
-
-				result.m_Indices.resize(static_cast<int>(hr.mIndexCount));
-
-				memcpy(&result.m_OutputVertices[0], &vertexScratch[0], sizeof(btVector3)*ovcount );
-
-  			if ( desc.HasHullFlag(QF_REVERSE_ORDER) )
-				{
-
-					const unsigned int *source = &hr.m_Indices[0];
-					unsigned int *dest   = &result.m_Indices[0];
-
-					for (unsigned int i=0; i<hr.mFaceCount; i++)
-					{
-						dest[0] = source[2];
-						dest[1] = source[1];
-						dest[2] = source[0];
-						dest+=3;
-						source+=3;
-					}
-
-				}
-				else
-				{
-					memcpy(&result.m_Indices[0], &hr.m_Indices[0], sizeof(unsigned int)*hr.mIndexCount);
-				}
-			}
-			else
-			{
-				result.mPolygons          = true;
-				result.mNumOutputVertices = ovcount;
-				result.m_OutputVertices.resize(static_cast<int>(ovcount));
-				result.mNumFaces          = hr.mFaceCount;
-				result.mNumIndices        = hr.mIndexCount+hr.mFaceCount;
-				result.m_Indices.resize(static_cast<int>(result.mNumIndices));
-				memcpy(&result.m_OutputVertices[0], &vertexScratch[0], sizeof(btVector3)*ovcount );
-
-//				if ( 1 )
-				{
-					const unsigned int *source = &hr.m_Indices[0];
-					unsigned int *dest   = &result.m_Indices[0];
-					for (unsigned int i=0; i<hr.mFaceCount; i++)
-					{
-						dest[0] = 3;
-						if ( desc.HasHullFlag(QF_REVERSE_ORDER) )
-						{
-							dest[1] = source[2];
-							dest[2] = source[1];
-							dest[3] = source[0];
-						}
-						else
-						{
-							dest[1] = source[0];
-							dest[2] = source[1];
-							dest[3] = source[2];
-						}
-
-						dest+=4;
-						source+=3;
-					}
-				}
-			}
-			ReleaseHull(hr);
-		}
-	}
-
-	return ret;
-}
-
-
-
-HullError HullLibrary::ReleaseResult(HullResult &result) // release memory allocated for this result, we are done with it.
-{
-	if ( result.m_OutputVertices.size())
-	{
-		result.mNumOutputVertices=0;
-		result.m_OutputVertices.clear();
-	}
-	if ( result.m_Indices.size() )
-	{
-		result.mNumIndices=0;
-		result.m_Indices.clear();
-	}
-	return QE_OK;
-}
-
-
-static void addPoint(unsigned int &vcount,btVector3 *p,btScalar x,btScalar y,btScalar z)
-{
-	// XXX, might be broken
-	btVector3& dest = p[vcount];
-	dest[0] = x;
-	dest[1] = y;
-	dest[2] = z;
-	vcount++;
-}
-
-btScalar GetDist(btScalar px,btScalar py,btScalar pz,const btScalar *p2);
-btScalar GetDist(btScalar px,btScalar py,btScalar pz,const btScalar *p2)
-{
-
-	btScalar dx = px - p2[0];
-	btScalar dy = py - p2[1];
-	btScalar dz = pz - p2[2];
-
-	return dx*dx+dy*dy+dz*dz;
-}
-
-
-
-bool  HullLibrary::CleanupVertices(unsigned int svcount,
-				   const btVector3 *svertices,
-				   unsigned int stride,
-				   unsigned int &vcount,       // output number of vertices
-				   btVector3 *vertices,                 // location to store the results.
-				   btScalar  normalepsilon,
-				   btVector3& scale)
-{
-	if ( svcount == 0 ) return false;
-
-	m_vertexIndexMapping.resize(0);
-
-
-#define EPSILON btScalar(0.000001) /* close enough to consider two btScalaring point numbers to be 'the same'. */
-
-	vcount = 0;
-
-	btScalar recip[3]={0.f,0.f,0.f};
-
-	if ( scale )
-	{
-		scale[0] = 1;
-		scale[1] = 1;
-		scale[2] = 1;
-	}
-
-	btScalar bmin[3] = {  FLT_MAX,  FLT_MAX,  FLT_MAX };
-	btScalar bmax[3] = { -FLT_MAX, -FLT_MAX, -FLT_MAX };
-
-	const char *vtx = (const char *) svertices;
-
-//	if ( 1 )
-	{
-		for (unsigned int i=0; i<svcount; i++)
-		{
-			const btScalar *p = (const btScalar *) vtx;
-
-			vtx+=stride;
-
-			for (int j=0; j<3; j++)
-			{
-				if ( p[j] < bmin[j] ) bmin[j] = p[j];
-				if ( p[j] > bmax[j] ) bmax[j] = p[j];
-			}
-		}
-	}
-
-	btScalar dx = bmax[0] - bmin[0];
-	btScalar dy = bmax[1] - bmin[1];
-	btScalar dz = bmax[2] - bmin[2];
-
-	btVector3 center;
-
-	center[0] = dx*btScalar(0.5) + bmin[0];
-	center[1] = dy*btScalar(0.5) + bmin[1];
-	center[2] = dz*btScalar(0.5) + bmin[2];
-
-	if ( dx < EPSILON || dy < EPSILON || dz < EPSILON || svcount < 3 )
-	{
-
-		btScalar len = FLT_MAX;
-
-		if ( dx > EPSILON && dx < len ) len = dx;
-		if ( dy > EPSILON && dy < len ) len = dy;
-		if ( dz > EPSILON && dz < len ) len = dz;
-
-		if ( len == FLT_MAX )
-		{
-			dx = dy = dz = btScalar(0.01); // one centimeter
-		}
-		else
-		{
-			if ( dx < EPSILON ) dx = len * btScalar(0.05); // 1/5th the shortest non-zero edge.
-			if ( dy < EPSILON ) dy = len * btScalar(0.05);
-			if ( dz < EPSILON ) dz = len * btScalar(0.05);
-		}
-
-		btScalar x1 = center[0] - dx;
-		btScalar x2 = center[0] + dx;
-
-		btScalar y1 = center[1] - dy;
-		btScalar y2 = center[1] + dy;
-
-		btScalar z1 = center[2] - dz;
-		btScalar z2 = center[2] + dz;
-
-		addPoint(vcount,vertices,x1,y1,z1);
-		addPoint(vcount,vertices,x2,y1,z1);
-		addPoint(vcount,vertices,x2,y2,z1);
-		addPoint(vcount,vertices,x1,y2,z1);
-		addPoint(vcount,vertices,x1,y1,z2);
-		addPoint(vcount,vertices,x2,y1,z2);
-		addPoint(vcount,vertices,x2,y2,z2);
-		addPoint(vcount,vertices,x1,y2,z2);
-
-		return true; // return cube
-
-
-	}
-	else
-	{
-		if ( scale )
-		{
-			scale[0] = dx;
-			scale[1] = dy;
-			scale[2] = dz;
-
-			recip[0] = 1 / dx;
-			recip[1] = 1 / dy;
-			recip[2] = 1 / dz;
-
-			center[0]*=recip[0];
-			center[1]*=recip[1];
-			center[2]*=recip[2];
-
-		}
-
-	}
-
-
-
-	vtx = (const char *) svertices;
-
-	for (unsigned int i=0; i<svcount; i++)
-	{
-		const btVector3 *p = (const btVector3 *)vtx;
-		vtx+=stride;
-
-		btScalar px = p->getX();
-		btScalar py = p->getY();
-		btScalar pz = p->getZ();
-
-		if ( scale )
-		{
-			px = px*recip[0]; // normalize
-			py = py*recip[1]; // normalize
-			pz = pz*recip[2]; // normalize
-		}
-
-//		if ( 1 )
-		{
-			unsigned int j;
-
-			for (j=0; j<vcount; j++)
-			{
-				/// XXX might be broken
-				btVector3& v = vertices[j];
-
-				btScalar x = v[0];
-				btScalar y = v[1];
-				btScalar z = v[2];
-
-				btScalar dx = btFabs(x - px );
-				btScalar dy = btFabs(y - py );
-				btScalar dz = btFabs(z - pz );
-
-				if ( dx < normalepsilon && dy < normalepsilon && dz < normalepsilon )
-				{
-					// ok, it is close enough to the old one
-					// now let us see if it is further from the center of the point cloud than the one we already recorded.
-					// in which case we keep this one instead.
-
-					btScalar dist1 = GetDist(px,py,pz,center);
-					btScalar dist2 = GetDist(v[0],v[1],v[2],center);
-
-					if ( dist1 > dist2 )
-					{
-						v[0] = px;
-						v[1] = py;
-						v[2] = pz;
-						
-					}
-
-					break;
-				}
-			}
-
-			if ( j == vcount )
-			{
-				btVector3& dest = vertices[vcount];
-				dest[0] = px;
-				dest[1] = py;
-				dest[2] = pz;
-				vcount++;
-			}
-			m_vertexIndexMapping.push_back(j);
-		}
-	}
-
-	// ok..now make sure we didn't prune so many vertices it is now invalid.
-//	if ( 1 )
-	{
-		btScalar bmin[3] = {  FLT_MAX,  FLT_MAX,  FLT_MAX };
-		btScalar bmax[3] = { -FLT_MAX, -FLT_MAX, -FLT_MAX };
-
-		for (unsigned int i=0; i<vcount; i++)
-		{
-			const btVector3& p = vertices[i];
-			for (int j=0; j<3; j++)
-			{
-				if ( p[j] < bmin[j] ) bmin[j] = p[j];
-				if ( p[j] > bmax[j] ) bmax[j] = p[j];
-			}
-		}
-
-		btScalar dx = bmax[0] - bmin[0];
-		btScalar dy = bmax[1] - bmin[1];
-		btScalar dz = bmax[2] - bmin[2];
-
-		if ( dx < EPSILON || dy < EPSILON || dz < EPSILON || vcount < 3)
-		{
-			btScalar cx = dx*btScalar(0.5) + bmin[0];
-			btScalar cy = dy*btScalar(0.5) + bmin[1];
-			btScalar cz = dz*btScalar(0.5) + bmin[2];
-
-			btScalar len = FLT_MAX;
-
-			if ( dx >= EPSILON && dx < len ) len = dx;
-			if ( dy >= EPSILON && dy < len ) len = dy;
-			if ( dz >= EPSILON && dz < len ) len = dz;
-
-			if ( len == FLT_MAX )
-			{
-				dx = dy = dz = btScalar(0.01); // one centimeter
-			}
-			else
-			{
-				if ( dx < EPSILON ) dx = len * btScalar(0.05); // 1/5th the shortest non-zero edge.
-				if ( dy < EPSILON ) dy = len * btScalar(0.05);
-				if ( dz < EPSILON ) dz = len * btScalar(0.05);
-			}
-
-			btScalar x1 = cx - dx;
-			btScalar x2 = cx + dx;
-
-			btScalar y1 = cy - dy;
-			btScalar y2 = cy + dy;
-
-			btScalar z1 = cz - dz;
-			btScalar z2 = cz + dz;
-
-			vcount = 0; // add box
-
-			addPoint(vcount,vertices,x1,y1,z1);
-			addPoint(vcount,vertices,x2,y1,z1);
-			addPoint(vcount,vertices,x2,y2,z1);
-			addPoint(vcount,vertices,x1,y2,z1);
-			addPoint(vcount,vertices,x1,y1,z2);
-			addPoint(vcount,vertices,x2,y1,z2);
-			addPoint(vcount,vertices,x2,y2,z2);
-			addPoint(vcount,vertices,x1,y2,z2);
-
-			return true;
-		}
-	}
-
-	return true;
-}
-
-void HullLibrary::BringOutYourDead(const btVector3* verts,unsigned int vcount, btVector3* overts,unsigned int &ocount,unsigned int *indices,unsigned indexcount)
-{
-	btAlignedObjectArray<int>tmpIndices;
-	tmpIndices.resize(m_vertexIndexMapping.size());
-	int i;
-
-	for (i=0;i<m_vertexIndexMapping.size();i++)
-	{
-		tmpIndices[i] = m_vertexIndexMapping[i];
-	}
-
-	TUIntArray usedIndices;
-	usedIndices.resize(static_cast<int>(vcount));
-	memset(&usedIndices[0],0,sizeof(unsigned int)*vcount);
-
-	ocount = 0;
-
-	for (i=0; i<int (indexcount); i++)
-	{
-		unsigned int v = indices[i]; // original array index
-
-		btAssert( v >= 0 && v < vcount );
-
-		if ( usedIndices[static_cast<int>(v)] ) // if already remapped
-		{
-			indices[i] = usedIndices[static_cast<int>(v)]-1; // index to new array
-		}
-		else
-		{
-
-			indices[i] = ocount;      // new index mapping
-
-			overts[ocount][0] = verts[v][0]; // copy old vert to new vert array
-			overts[ocount][1] = verts[v][1];
-			overts[ocount][2] = verts[v][2];
-
-			for (int k=0;k<m_vertexIndexMapping.size();k++)
-			{
-				if (tmpIndices[k]==int(v))
-					m_vertexIndexMapping[k]=ocount;
-			}
-
-			ocount++; // increment output vert count
-
-			btAssert( ocount >=0 && ocount <= vcount );
-
-			usedIndices[static_cast<int>(v)] = ocount; // assign new index remapping
-
-		
-		}
-	}
-
-	
-}
diff --git a/hkl3d/bullet/src/LinearMath/btConvexHull.h b/hkl3d/bullet/src/LinearMath/btConvexHull.h
deleted file mode 100644
index 69c52bc..0000000
--- a/hkl3d/bullet/src/LinearMath/btConvexHull.h
+++ /dev/null
@@ -1,241 +0,0 @@
-
-/*
-Stan Melax Convex Hull Computation
-Copyright (c) 2008 Stan Melax http://www.melax.com/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-///includes modifications/improvements by John Ratcliff, see BringOutYourDead below.
-
-#ifndef BT_CD_HULL_H
-#define BT_CD_HULL_H
-
-#include "btVector3.h"
-#include "btAlignedObjectArray.h"
-
-typedef btAlignedObjectArray<unsigned int> TUIntArray;
-
-class HullResult
-{
-public:
-	HullResult(void)
-	{
-		mPolygons = true;
-		mNumOutputVertices = 0;
-		mNumFaces = 0;
-		mNumIndices = 0;
-	}
-	bool                    mPolygons;                  // true if indices represents polygons, false indices are triangles
-	unsigned int            mNumOutputVertices;         // number of vertices in the output hull
-	btAlignedObjectArray<btVector3>	m_OutputVertices;            // array of vertices
-	unsigned int            mNumFaces;                  // the number of faces produced
-	unsigned int            mNumIndices;                // the total number of indices
-	btAlignedObjectArray<unsigned int>    m_Indices;                   // pointer to indices.
-
-// If triangles, then indices are array indexes into the vertex list.
-// If polygons, indices are in the form (number of points in face) (p1, p2, p3, ..) etc..
-};
-
-enum HullFlag
-{
-	QF_TRIANGLES         = (1<<0),             // report results as triangles, not polygons.
-	QF_REVERSE_ORDER     = (1<<1),             // reverse order of the triangle indices.
-	QF_DEFAULT           = QF_TRIANGLES
-};
-
-
-class HullDesc
-{
-public:
-	HullDesc(void)
-	{
-		mFlags          = QF_DEFAULT;
-		mVcount         = 0;
-		mVertices       = 0;
-		mVertexStride   = sizeof(btVector3);
-		mNormalEpsilon  = 0.001f;
-		mMaxVertices	= 4096; // maximum number of points to be considered for a convex hull.
-		mMaxFaces	= 4096;
-	};
-
-	HullDesc(HullFlag flag,
-		 unsigned int vcount,
-		 const btVector3 *vertices,
-		 unsigned int stride = sizeof(btVector3))
-	{
-		mFlags          = flag;
-		mVcount         = vcount;
-		mVertices       = vertices;
-		mVertexStride   = stride;
-		mNormalEpsilon  = btScalar(0.001);
-		mMaxVertices    = 4096;
-	}
-
-	bool HasHullFlag(HullFlag flag) const
-	{
-		if ( mFlags & flag ) return true;
-		return false;
-	}
-
-	void SetHullFlag(HullFlag flag)
-	{
-		mFlags|=flag;
-	}
-
-	void ClearHullFlag(HullFlag flag)
-	{
-		mFlags&=~flag;
-	}
-
-	unsigned int      mFlags;           // flags to use when generating the convex hull.
-	unsigned int      mVcount;          // number of vertices in the input point cloud
-	const btVector3  *mVertices;        // the array of vertices.
-	unsigned int      mVertexStride;    // the stride of each vertex, in bytes.
-	btScalar             mNormalEpsilon;   // the epsilon for removing duplicates.  This is a normalized value, if normalized bit is on.
-	unsigned int      mMaxVertices;     // maximum number of vertices to be considered for the hull!
-	unsigned int      mMaxFaces;
-};
-
-enum HullError
-{
-	QE_OK,            // success!
-	QE_FAIL           // failed.
-};
-
-class btPlane
-{
-	public:
-	btVector3	normal;
-	btScalar	dist;   // distance below origin - the D from plane equasion Ax+By+Cz+D=0
-			btPlane(const btVector3 &n,btScalar d):normal(n),dist(d){}
-			btPlane():normal(),dist(0){}
-	
-};
-
-
-
-class ConvexH 
-{
-  public:
-	class HalfEdge
-	{
-	  public:
-		short ea;         // the other half of the edge (index into edges list)
-		unsigned char v;  // the vertex at the start of this edge (index into vertices list)
-		unsigned char p;  // the facet on which this edge lies (index into facets list)
-		HalfEdge(){}
-		HalfEdge(short _ea,unsigned char _v, unsigned char _p):ea(_ea),v(_v),p(_p){}
-	};
-	ConvexH()
-	{
-	}
-	~ConvexH()
-	{
-	}
-	btAlignedObjectArray<btVector3> vertices;
-	btAlignedObjectArray<HalfEdge> edges;
-	btAlignedObjectArray<btPlane>  facets;
-	ConvexH(int vertices_size,int edges_size,int facets_size);
-};
-
-
-class int4
-{
-public:
-	int x,y,z,w;
-	int4(){};
-	int4(int _x,int _y, int _z,int _w){x=_x;y=_y;z=_z;w=_w;}
-	const int& operator[](int i) const {return (&x)[i];}
-	int& operator[](int i) {return (&x)[i];}
-};
-
-class PHullResult
-{
-public:
-
-	PHullResult(void)
-	{
-		mVcount = 0;
-		mIndexCount = 0;
-		mFaceCount = 0;
-		mVertices = 0;
-	}
-
-	unsigned int mVcount;
-	unsigned int mIndexCount;
-	unsigned int mFaceCount;
-	btVector3*   mVertices;
-	TUIntArray m_Indices;
-};
-
-
-
-///The HullLibrary class can create a convex hull from a collection of vertices, using the ComputeHull method.
-///The btShapeHull class uses this HullLibrary to create a approximate convex mesh given a general (non-polyhedral) convex shape.
-class HullLibrary
-{
-
-	btAlignedObjectArray<class btHullTriangle*> m_tris;
-
-public:
-
-	btAlignedObjectArray<int> m_vertexIndexMapping;
-
-
-	HullError CreateConvexHull(const HullDesc& desc, // describes the input request
-				   HullResult&     result);        // contains the resulst
-	HullError ReleaseResult(HullResult &result); // release memory allocated for this result, we are done with it.
-
-private:
-
-	bool ComputeHull(unsigned int vcount,const btVector3 *vertices,PHullResult &result,unsigned int vlimit);
-
-	class btHullTriangle*	allocateTriangle(int a,int b,int c);
-	void	deAllocateTriangle(btHullTriangle*);
-	void b2bfix(btHullTriangle* s,btHullTriangle*t);
-
-	void removeb2b(btHullTriangle* s,btHullTriangle*t);
-
-	void checkit(btHullTriangle *t);
-
-	btHullTriangle* extrudable(btScalar epsilon);
-
-	int calchull(btVector3 *verts,int verts_count, TUIntArray& tris_out, int &tris_count,int vlimit);
-
-	int calchullgen(btVector3 *verts,int verts_count, int vlimit);
-
-	int4 FindSimplex(btVector3 *verts,int verts_count,btAlignedObjectArray<int> &allow);
-
-	class ConvexH* ConvexHCrop(ConvexH& convex,const btPlane& slice);
-
-	void extrude(class btHullTriangle* t0,int v);
-
-	ConvexH* test_cube();
-
-	//BringOutYourDead (John Ratcliff): When you create a convex hull you hand it a large input set of vertices forming a 'point cloud'. 
-	//After the hull is generated it give you back a set of polygon faces which index the *original* point cloud.
-	//The thing is, often times, there are many 'dead vertices' in the point cloud that are on longer referenced by the hull.
-	//The routine 'BringOutYourDead' find only the referenced vertices, copies them to an new buffer, and re-indexes the hull so that it is a minimal representation.
-	void BringOutYourDead(const btVector3* verts,unsigned int vcount, btVector3* overts,unsigned int &ocount,unsigned int* indices,unsigned indexcount);
-
-	bool CleanupVertices(unsigned int svcount,
-			     const btVector3* svertices,
-			     unsigned int stride,
-			     unsigned int &vcount, // output number of vertices
-			     btVector3* vertices, // location to store the results.
-			     btScalar  normalepsilon,
-			     btVector3& scale);
-};
-
-
-#endif //BT_CD_HULL_H
-
diff --git a/hkl3d/bullet/src/LinearMath/btConvexHullComputer.cpp b/hkl3d/bullet/src/LinearMath/btConvexHullComputer.cpp
deleted file mode 100644
index 10316b4..0000000
--- a/hkl3d/bullet/src/LinearMath/btConvexHullComputer.cpp
+++ /dev/null
@@ -1,2749 +0,0 @@
-/*
-Copyright (c) 2011 Ole Kniemeyer, MAXON, www.maxon.net
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#include <string.h>
-
-#include "btConvexHullComputer.h"
-#include "btAlignedObjectArray.h"
-#include "btMinMax.h"
-#include "btVector3.h"
-
-#ifdef __GNUC__
-	#include <stdint.h>
-#elif defined(_MSC_VER)
-	typedef __int32 int32_t;
-	typedef __int64 int64_t;
-	typedef unsigned __int32 uint32_t;
-	typedef unsigned __int64 uint64_t;
-#else
-	typedef int int32_t;
-	typedef long long int int64_t;
-	typedef unsigned int uint32_t;
-	typedef unsigned long long int uint64_t;
-#endif
-
-
-//The definition of USE_X86_64_ASM is moved into the build system. You can enable it manually by commenting out the following lines
-//#if (defined(__GNUC__) && defined(__x86_64__) && !defined(__ICL))  // || (defined(__ICL) && defined(_M_X64))   bug in Intel compiler, disable inline assembly
-//	#define USE_X86_64_ASM
-//#endif
-
-
-//#define DEBUG_CONVEX_HULL
-//#define SHOW_ITERATIONS
-
-#if defined(DEBUG_CONVEX_HULL) || defined(SHOW_ITERATIONS)
-	#include <stdio.h>
-#endif
-
-// Convex hull implementation based on Preparata and Hong
-// Ole Kniemeyer, MAXON Computer GmbH
-class btConvexHullInternal
-{
-	public:
-		
-		class Point64
-		{
-			public:
-				int64_t x;
-				int64_t y;
-				int64_t z;
-				
-				Point64(int64_t x, int64_t y, int64_t z): x(x), y(y), z(z)
-				{
-				}
-
-				bool isZero()
-				{
-					return (x == 0) && (y == 0) && (z == 0);
-				}
-
-				int64_t dot(const Point64& b) const
-				{
-					return x * b.x + y * b.y + z * b.z;
-				}
-		};
-		
-		class Point32
-		{
-			public:
-				int32_t x;
-				int32_t y;
-				int32_t z;
-				int index;
-				
-				Point32()
-				{
-				}
-				
-				Point32(int32_t x, int32_t y, int32_t z): x(x), y(y), z(z), index(-1)
-				{
-				}
-				
-				bool operator==(const Point32& b) const
-				{
-					return (x == b.x) && (y == b.y) && (z == b.z);
-				}
-
-				bool operator!=(const Point32& b) const
-				{
-					return (x != b.x) || (y != b.y) || (z != b.z);
-				}
-
-				bool isZero()
-				{
-					return (x == 0) && (y == 0) && (z == 0);
-				}
-
-				Point64 cross(const Point32& b) const
-				{
-					return Point64(y * b.z - z * b.y, z * b.x - x * b.z, x * b.y - y * b.x);
-				}
-
-				Point64 cross(const Point64& b) const
-				{
-					return Point64(y * b.z - z * b.y, z * b.x - x * b.z, x * b.y - y * b.x);
-				}
-
-				int64_t dot(const Point32& b) const
-				{
-					return x * b.x + y * b.y + z * b.z;
-				}
-
-				int64_t dot(const Point64& b) const
-				{
-					return x * b.x + y * b.y + z * b.z;
-				}
-
-				Point32 operator+(const Point32& b) const
-				{
-					return Point32(x + b.x, y + b.y, z + b.z);
-				}
-
-				Point32 operator-(const Point32& b) const
-				{
-					return Point32(x - b.x, y - b.y, z - b.z);
-				}
-		};
-
-		class Int128
-		{
-			public:
-				uint64_t low;
-				uint64_t high;
-
-				Int128()
-				{
-				}
-
-				Int128(uint64_t low, uint64_t high): low(low), high(high)
-				{
-				}
-
-				Int128(uint64_t low): low(low), high(0)
-				{
-				}
-
-				Int128(int64_t value): low(value), high((value >= 0) ? 0 : (uint64_t) -1LL)
-				{
-				}
-
-				static Int128 mul(int64_t a, int64_t b);
-
-				static Int128 mul(uint64_t a, uint64_t b);
-
-				Int128 operator-() const
-				{
-					return Int128((uint64_t) -(int64_t)low, ~high + (low == 0));
-				}
-
-				Int128 operator+(const Int128& b) const
-				{
-#ifdef USE_X86_64_ASM
-					Int128 result;
-					__asm__ ("addq %[bl], %[rl]\n\t"
-									 "adcq %[bh], %[rh]\n\t"
-									 : [rl] "=r" (result.low), [rh] "=r" (result.high)
-									 : "0"(low), "1"(high), [bl] "g"(b.low), [bh] "g"(b.high)
-									 : "cc" );
-					return result;
-#else
-					uint64_t lo = low + b.low;
-					return Int128(lo, high + b.high + (lo < low));
-#endif
-				}
-
-				Int128 operator-(const Int128& b) const
-				{
-#ifdef USE_X86_64_ASM
-					Int128 result;
-					__asm__ ("subq %[bl], %[rl]\n\t"
-									 "sbbq %[bh], %[rh]\n\t"
-									 : [rl] "=r" (result.low), [rh] "=r" (result.high)
-									 : "0"(low), "1"(high), [bl] "g"(b.low), [bh] "g"(b.high)
-									 : "cc" );
-					return result;
-#else
-					return *this + -b;
-#endif
-				}
-
-				Int128& operator+=(const Int128& b)
-				{
-#ifdef USE_X86_64_ASM
-					__asm__ ("addq %[bl], %[rl]\n\t"
-									 "adcq %[bh], %[rh]\n\t"
-									 : [rl] "=r" (low), [rh] "=r" (high)
-									 : "0"(low), "1"(high), [bl] "g"(b.low), [bh] "g"(b.high)
-									 : "cc" );
-#else
-					uint64_t lo = low + b.low;
-					if (lo < low)
-					{
-						++high;
-					}
-					low = lo;
-					high += b.high;
-#endif
-					return *this;
-				}
-
-				Int128& operator++()
-				{
-					if (++low == 0)
-					{
-						++high;
-					}
-					return *this;
-				}
-
-				Int128 operator*(int64_t b) const;
-
-				btScalar toScalar() const
-				{
-					return ((int64_t) high >= 0) ? btScalar(high) * (btScalar(0x100000000LL) * btScalar(0x100000000LL)) + btScalar(low)
-						: -(-*this).toScalar();
-				}
-
-				int getSign() const
-				{
-					return ((int64_t) high < 0) ? -1 : (high || low) ? 1 : 0;
-				}
-
-				bool operator<(const Int128& b) const
-				{
-					return (high < b.high) || ((high == b.high) && (low < b.low));
-				}
-
-				int ucmp(const Int128&b) const
-				{
-					if (high < b.high)
-					{
-						return -1;
-					}
-					if (high > b.high)
-					{
-						return 1;
-					}
-					if (low < b.low)
-					{
-						return -1;
-					}
-					if (low > b.low)
-					{
-						return 1;
-					}
-					return 0;
-				}
-		};
-
-
-		class Rational64
-		{
-			private:
-				uint64_t numerator;
-				uint64_t denominator;
-				int sign;
-				
-			public:
-				Rational64(int64_t numerator, int64_t denominator)
-				{
-					if (numerator > 0)
-					{
-						sign = 1;
-						this->numerator = (uint64_t) numerator;
-					}
-					else if (numerator < 0)
-					{
-						sign = -1;
-						this->numerator = (uint64_t) -numerator;
-					}
-					else
-					{
-						sign = 0;
-						this->numerator = 0;
-					}
-					if (denominator > 0)
-					{
-						this->denominator = (uint64_t) denominator;
-					}
-					else if (denominator < 0)
-					{
-						sign = -sign;
-						this->denominator = (uint64_t) -denominator;
-					}
-					else
-					{
-						this->denominator = 0;
-					}
-				}
-				
-				bool isNegativeInfinity() const
-				{
-					return (sign < 0) && (denominator == 0);
-				}
-				
-				bool isNaN() const
-				{
-					return (sign == 0) && (denominator == 0);
-				}
-				
-				int compare(const Rational64& b) const;
-				
-				btScalar toScalar() const
-				{
-					return sign * ((denominator == 0) ? SIMD_INFINITY : (btScalar) numerator / denominator);
-				}
-		};
-
-
-		class Rational128
-		{
-			private:
-				Int128 numerator;
-				Int128 denominator;
-				int sign;
-				bool isInt64;
-
-			public:
-				Rational128(int64_t value)
-				{
-					if (value > 0)
-					{
-						sign = 1;
-						this->numerator = value;
-					}
-					else if (value < 0)
-					{
-						sign = -1;
-						this->numerator = -value;
-					}
-					else
-					{
-						sign = 0;
-						this->numerator = (uint64_t) 0;
-					}
-					this->denominator = (uint64_t) 1;
-					isInt64 = true;
-				}
-
-				Rational128(const Int128& numerator, const Int128& denominator)
-				{
-					sign = numerator.getSign();
-					if (sign >= 0)
-					{
-						this->numerator = numerator;
-					}
-					else
-					{
-						this->numerator = -numerator;
-					}
-					int dsign = denominator.getSign();
-					if (dsign >= 0)
-					{
-						this->denominator = denominator;
-					}
-					else
-					{
-						sign = -sign;
-						this->denominator = -denominator;
-					}
-					isInt64 = false;
-				}
-
-				int compare(const Rational128& b) const;
-
-				int compare(int64_t b) const;
-
-				btScalar toScalar() const
-				{
-					return sign * ((denominator.getSign() == 0) ? SIMD_INFINITY : numerator.toScalar() / denominator.toScalar());
-				}
-		};
-
-		class PointR128
-		{
-			public:
-				Int128 x;
-				Int128 y;
-				Int128 z;
-				Int128 denominator;
-
-				PointR128()
-				{
-				}
-
-				PointR128(Int128 x, Int128 y, Int128 z, Int128 denominator): x(x), y(y), z(z), denominator(denominator)
-				{
-				}
-
-				btScalar xvalue() const
-				{
-					return x.toScalar() / denominator.toScalar();
-				}
-
-				btScalar yvalue() const
-				{
-					return y.toScalar() / denominator.toScalar();
-				}
-
-				btScalar zvalue() const
-				{
-					return z.toScalar() / denominator.toScalar();
-				}
-		};
-
-
-		class Edge;
-		class Face;
-
-		class Vertex
-		{
-			public:
-				Vertex* next;
-				Vertex* prev;
-				Edge* edges;
-				Face* firstNearbyFace;
-				Face* lastNearbyFace;
-				PointR128 point128;
-				Point32 point;
-				int copy;
-				
-				Vertex(): next(NULL), prev(NULL), edges(NULL), firstNearbyFace(NULL), lastNearbyFace(NULL), copy(-1)
-				{
-				}
-
-#ifdef DEBUG_CONVEX_HULL
-				void print()
-				{
-					printf("V%d (%d, %d, %d)", point.index, point.x, point.y, point.z);
-				}
-
-				void printGraph();
-#endif
-
-				Point32 operator-(const Vertex& b) const
-				{
-					return point - b.point;
-				}
-
-				Rational128 dot(const Point64& b) const
-				{
-					return (point.index >= 0) ? Rational128(point.dot(b))
-						: Rational128(point128.x * b.x + point128.y * b.y + point128.z * b.z, point128.denominator);
-				}
-
-				btScalar xvalue() const
-				{
-					return (point.index >= 0) ? btScalar(point.x) : point128.xvalue();
-				}
-
-				btScalar yvalue() const
-				{
-					return (point.index >= 0) ? btScalar(point.y) : point128.yvalue();
-				}
-
-				btScalar zvalue() const
-				{
-					return (point.index >= 0) ? btScalar(point.z) : point128.zvalue();
-				}
-
-				void receiveNearbyFaces(Vertex* src)
-				{
-					if (lastNearbyFace)
-					{
-						lastNearbyFace->nextWithSameNearbyVertex = src->firstNearbyFace;
-					}
-					else
-					{
-						firstNearbyFace = src->firstNearbyFace;
-					}
-					if (src->lastNearbyFace)
-					{
-						lastNearbyFace = src->lastNearbyFace;
-					}
-					for (Face* f = src->firstNearbyFace; f; f = f->nextWithSameNearbyVertex)
-					{
-						btAssert(f->nearbyVertex == src);
-						f->nearbyVertex = this;
-					}
-					src->firstNearbyFace = NULL;
-					src->lastNearbyFace = NULL;
-				}
-		};
-
-
-		class Edge
-		{
-			public:
-				Edge* next;
-				Edge* prev;
-				Edge* reverse;
-				Vertex* target;
-				Face* face;
-				int copy;
-
-				~Edge()
-				{
-					next = NULL;
-					prev = NULL;
-					reverse = NULL;
-					target = NULL;
-					face = NULL;
-				}
-
-				void link(Edge* n)
-				{
-					btAssert(reverse->target == n->reverse->target);
-					next = n;
-					n->prev = this;
-				}
-
-#ifdef DEBUG_CONVEX_HULL
-				void print()
-				{
-					printf("E%p : %d -> %d,  n=%p p=%p   (0 %d\t%d\t%d) -> (%d %d %d)", this, reverse->target->point.index, target->point.index, next, prev,
-								 reverse->target->point.x, reverse->target->point.y, reverse->target->point.z, target->point.x, target->point.y, target->point.z);
-				}
-#endif
-		};
-
-		class Face
-		{
-			public:
-				Face* next;
-				Vertex* nearbyVertex;
-				Face* nextWithSameNearbyVertex;
-				Point32 origin;
-				Point32 dir0;
-				Point32 dir1;
-
-				Face(): next(NULL), nearbyVertex(NULL), nextWithSameNearbyVertex(NULL)
-				{
-				}
-
-				void init(Vertex* a, Vertex* b, Vertex* c)
-				{
-					nearbyVertex = a;
-					origin = a->point;
-					dir0 = *b - *a;
-					dir1 = *c - *a;
-					if (a->lastNearbyFace)
-					{
-						a->lastNearbyFace->nextWithSameNearbyVertex = this;
-					}
-					else
-					{
-						a->firstNearbyFace = this;
-					}
-					a->lastNearbyFace = this;
-				}
-
-				Point64 getNormal()
-				{
-					return dir0.cross(dir1);
-				}
-		};
-
-		template<typename UWord, typename UHWord> class DMul
-		{
-			private:
-				static uint32_t high(uint64_t value)
-				{
-					return (uint32_t) (value >> 32);
-				}
-				
-				static uint32_t low(uint64_t value)
-				{
-					return (uint32_t) value;
-				}
-				
-				static uint64_t mul(uint32_t a, uint32_t b)
-				{
-					return (uint64_t) a * (uint64_t) b;
-				}
-				
-				static void shlHalf(uint64_t& value)
-				{
-					value <<= 32;
-				}
-				
-				static uint64_t high(Int128 value)
-				{
-					return value.high;
-				}
-				
-				static uint64_t low(Int128 value)
-				{
-					return value.low;
-				}
-				
-				static Int128 mul(uint64_t a, uint64_t b)
-				{
-					return Int128::mul(a, b);
-				}
-				
-				static void shlHalf(Int128& value)
-				{
-					value.high = value.low;
-					value.low = 0;
-				}
-				
-			public:
-				
-				static void mul(UWord a, UWord b, UWord& resLow, UWord& resHigh)
-				{
-					UWord p00 = mul(low(a), low(b));
-					UWord p01 = mul(low(a), high(b));
-					UWord p10 = mul(high(a), low(b));
-					UWord p11 = mul(high(a), high(b));
-					UWord p0110 = UWord(low(p01)) + UWord(low(p10));
-					p11 += high(p01);
-					p11 += high(p10);
-					p11 += high(p0110);
-					shlHalf(p0110);
-					p00 += p0110;
-					if (p00 < p0110)
-					{
-						++p11;
-					}
-					resLow = p00;
-					resHigh = p11;
-				}
-		};
-	
-	private:
-
-		class IntermediateHull
-		{
-			public:
-				Vertex* minXy;
-				Vertex* maxXy;
-				Vertex* minYx;
-				Vertex* maxYx;
-				
-				IntermediateHull(): minXy(NULL), maxXy(NULL), minYx(NULL), maxYx(NULL)
-				{
-				}
-				
-				void print();
-		};
-	
-		enum Orientation {NONE, CLOCKWISE, COUNTER_CLOCKWISE};
-
-		template <typename T> class PoolArray
-		{
-			private:
-				T* array;
-				int size;
-
-			public:
-				PoolArray<T>* next;
-
-				PoolArray(int size): size(size), next(NULL)
-				{
-					array = (T*) btAlignedAlloc(sizeof(T) * size, 16);
-				}
-
-				~PoolArray()
-				{
-					btAlignedFree(array);
-				}
-
-				T* init()
-				{
-					T* o = array;
-					for (int i = 0; i < size; i++, o++)
-					{
-						o->next = (i+1 < size) ? o + 1 : NULL;
-					}
-					return array;
-				}
-		};
-
-		template <typename T> class Pool
-		{
-			private:
-				PoolArray<T>* arrays;
-				PoolArray<T>* nextArray;
-				T* freeObjects;
-				int arraySize;
-
-			public:
-				Pool(): arrays(NULL), nextArray(NULL), freeObjects(NULL), arraySize(256)
-				{
-				}
-
-				~Pool()
-				{
-					while (arrays)
-					{
-						PoolArray<T>* p = arrays;
-						arrays = p->next;
-						p->~PoolArray<T>();
-						btAlignedFree(p);
-					}
-				}
-
-				void reset()
-				{
-					nextArray = arrays;
-					freeObjects = NULL;
-				}
-
-				void setArraySize(int arraySize)
-				{
-					this->arraySize = arraySize;
-				}
-
-				T* newObject()
-				{
-					T* o = freeObjects;
-					if (!o)
-					{
-						PoolArray<T>* p = nextArray;
-						if (p)
-						{
-							nextArray = p->next;
-						}
-						else
-						{
-							p = new(btAlignedAlloc(sizeof(PoolArray<T>), 16)) PoolArray<T>(arraySize);
-							p->next = arrays;
-							arrays = p;
-						}
-						o = p->init();
-					}
-					freeObjects = o->next;
-					return new(o) T();
-				};
-
-				void freeObject(T* object)
-				{
-					object->~T();
-					object->next = freeObjects;
-					freeObjects = object;
-				}
-		};
-
-		btVector3 scaling;
-		btVector3 center;
-		Pool<Vertex> vertexPool;
-		Pool<Edge> edgePool;
-		Pool<Face> facePool;
-		btAlignedObjectArray<Vertex*> originalVertices;
-		int mergeStamp;
-		int minAxis;
-		int medAxis;
-		int maxAxis;
-		int usedEdgePairs;
-		int maxUsedEdgePairs;
-
-		static Orientation getOrientation(const Edge* prev, const Edge* next, const Point32& s, const Point32& t);
-		Edge* findMaxAngle(bool ccw, const Vertex* start, const Point32& s, const Point64& rxs, const Point64& sxrxs, Rational64& minCot);
-		void findEdgeForCoplanarFaces(Vertex* c0, Vertex* c1, Edge*& e0, Edge*& e1, Vertex* stop0, Vertex* stop1);
-
-		Edge* newEdgePair(Vertex* from, Vertex* to);
-
-		void removeEdgePair(Edge* edge)
-		{
-			Edge* n = edge->next;
-			Edge* r = edge->reverse;
-
-			btAssert(edge->target && r->target);
-
-			if (n != edge)
-			{
-				n->prev = edge->prev;
-				edge->prev->next = n;
-				r->target->edges = n;
-			}
-			else
-			{
-				r->target->edges = NULL;
-			}
-			
-			n = r->next;
-			
-			if (n != r)
-			{
-				n->prev = r->prev;
-				r->prev->next = n;
-				edge->target->edges = n;
-			}
-			else
-			{
-				edge->target->edges = NULL;
-			}
-
-			edgePool.freeObject(edge);
-			edgePool.freeObject(r);
-			usedEdgePairs--;
-		}
-		
-		void computeInternal(int start, int end, IntermediateHull& result);
-		
-		bool mergeProjection(IntermediateHull& h0, IntermediateHull& h1, Vertex*& c0, Vertex*& c1);
-		
-		void merge(IntermediateHull& h0, IntermediateHull& h1);
-
-		btVector3 toBtVector(const Point32& v);
-
-		btVector3 getBtNormal(Face* face);
-
-		bool shiftFace(Face* face, btScalar amount, btAlignedObjectArray<Vertex*> stack);
-
-	public:
-		Vertex* vertexList;
-
-		void compute(const void* coords, bool doubleCoords, int stride, int count);
-
-		btVector3 getCoordinates(const Vertex* v);
-
-		btScalar shrink(btScalar amount, btScalar clampAmount);
-};
-
-
-btConvexHullInternal::Int128 btConvexHullInternal::Int128::operator*(int64_t b) const
-{
-	bool negative = (int64_t) high < 0;
-	Int128 a = negative ? -*this : *this;
-	if (b < 0)
-	{
-		negative = !negative;
-		b = -b;
-	}
-	Int128 result = mul(a.low, (uint64_t) b);
-	result.high += a.high * (uint64_t) b;
-	return negative ? -result : result;
-}
-
-btConvexHullInternal::Int128 btConvexHullInternal::Int128::mul(int64_t a, int64_t b)
-{
-	Int128 result;
-	
-#ifdef USE_X86_64_ASM
-	__asm__ ("imulq %[b]"
-					 : "=a" (result.low), "=d" (result.high)
-					 : "0"(a), [b] "r"(b)
-					 : "cc" );
-	return result;
-	
-#else
-	bool negative = a < 0;
-	if (negative)
-	{
-		a = -a;
-	}
-	if (b < 0)
-	{
-		negative = !negative;
-		b = -b;
-	}
-	DMul<uint64_t, uint32_t>::mul((uint64_t) a, (uint64_t) b, result.low, result.high);
-	return negative ? -result : result;
-#endif
-}
-
-btConvexHullInternal::Int128 btConvexHullInternal::Int128::mul(uint64_t a, uint64_t b)
-{
-	Int128 result;
-
-#ifdef USE_X86_64_ASM
-	__asm__ ("mulq %[b]"
-					 : "=a" (result.low), "=d" (result.high)
-					 : "0"(a), [b] "r"(b)
-					 : "cc" );
-
-#else
-	DMul<uint64_t, uint32_t>::mul(a, b, result.low, result.high);
-#endif
-
-	return result;
-}
-
-int btConvexHullInternal::Rational64::compare(const Rational64& b) const
-{
-	if (sign != b.sign)
-	{
-		return sign - b.sign;
-	}
-	else if (sign == 0)
-	{
-		return 0;
-	}
-
-	//	return (numerator * b.denominator > b.numerator * denominator) ? sign : (numerator * b.denominator < b.numerator * denominator) ? -sign : 0;
-
-#ifdef USE_X86_64_ASM
-
-	int result;
-	int64_t tmp;
-	int64_t dummy;
-	__asm__ ("mulq %[bn]\n\t"
-					 "movq %%rax, %[tmp]\n\t"
-					 "movq %%rdx, %%rbx\n\t"
-					 "movq %[tn], %%rax\n\t"
-					 "mulq %[bd]\n\t"
-					 "subq %[tmp], %%rax\n\t"
-					 "sbbq %%rbx, %%rdx\n\t" // rdx:rax contains 128-bit-difference "numerator*b.denominator - b.numerator*denominator"
-					 "setnsb %%bh\n\t" // bh=1 if difference is non-negative, bh=0 otherwise
-					 "orq %%rdx, %%rax\n\t"
-					 "setnzb %%bl\n\t" // bl=1 if difference if non-zero, bl=0 if it is zero
-					 "decb %%bh\n\t" // now bx=0x0000 if difference is zero, 0xff01 if it is negative, 0x0001 if it is positive (i.e., same sign as difference)
-					 "shll $16, %%ebx\n\t" // ebx has same sign as difference
-					 : "=&b"(result), [tmp] "=&r"(tmp), "=a"(dummy)
-					 : "a"(denominator), [bn] "g"(b.numerator), [tn] "g"(numerator), [bd] "g"(b.denominator)
-					 : "%rdx", "cc" );
-	return result ? result ^ sign // if sign is +1, only bit 0 of result is inverted, which does not change the sign of result (and cannot result in zero)
-																// if sign is -1, all bits of result are inverted, which changes the sign of result (and again cannot result in zero)
-								: 0;
-
-#else
-
-	return sign * Int128::mul(numerator, b.denominator).ucmp(Int128::mul(denominator, b.numerator));
-
-#endif
-}
-
-int btConvexHullInternal::Rational128::compare(const Rational128& b) const
-{
-	if (sign != b.sign)
-	{
-		return sign - b.sign;
-	}
-	else if (sign == 0)
-	{
-		return 0;
-	}
-	if (isInt64)
-	{
-		return -b.compare(sign * (int64_t) numerator.low);
-	}
-
-	Int128 nbdLow, nbdHigh, dbnLow, dbnHigh;
-	DMul<Int128, uint64_t>::mul(numerator, b.denominator, nbdLow, nbdHigh);
-	DMul<Int128, uint64_t>::mul(denominator, b.numerator, dbnLow, dbnHigh);
-
-	int cmp = nbdHigh.ucmp(dbnHigh);
-	if (cmp)
-	{
-		return cmp * sign;
-	}
-	return nbdLow.ucmp(dbnLow) * sign;
-}
-
-int btConvexHullInternal::Rational128::compare(int64_t b) const
-{
-	if (isInt64)
-	{
-		int64_t a = sign * (int64_t) numerator.low;
-		return (a > b) ? 1 : (a < b) ? -1 : 0;
-	}
-	if (b > 0)
-	{
-		if (sign <= 0)
-		{
-			return -1;
-		}
-	}
-	else if (b < 0)
-	{
-		if (sign >= 0)
-		{
-			return 1;
-		}
-		b = -b;
-	}
-	else
-	{
-		return sign;
-	}
-
-	return numerator.ucmp(denominator * b) * sign;
-}
-
-
-btConvexHullInternal::Edge* btConvexHullInternal::newEdgePair(Vertex* from, Vertex* to)
-{
-	btAssert(from && to);
-	Edge* e = edgePool.newObject();
-	Edge* r = edgePool.newObject();
-	e->reverse = r;
-	r->reverse = e;
-	e->copy = mergeStamp;
-	r->copy = mergeStamp;
-	e->target = to;
-	r->target = from;
-	e->face = NULL;
-	r->face = NULL;
-	usedEdgePairs++;
-	if (usedEdgePairs > maxUsedEdgePairs)
-	{
-		maxUsedEdgePairs = usedEdgePairs;
-	}
-	return e;
-}
-
-bool btConvexHullInternal::mergeProjection(IntermediateHull& h0, IntermediateHull& h1, Vertex*& c0, Vertex*& c1)
-{
-	Vertex* v0 = h0.maxYx;
-	Vertex* v1 = h1.minYx;
-	if ((v0->point.x == v1->point.x) && (v0->point.y == v1->point.y))
-	{
-		btAssert(v0->point.z < v1->point.z);
-		Vertex* v1p = v1->prev;
-		if (v1p == v1)
-		{
-			c0 = v0;
-			if (v1->edges)
-			{
-				btAssert(v1->edges->next == v1->edges);
-				v1 = v1->edges->target;
-				btAssert(v1->edges->next == v1->edges);
-			}
-			c1 = v1;
-			return false;
-		}
-		Vertex* v1n = v1->next;
-		v1p->next = v1n;
-		v1n->prev = v1p;
-		if (v1 == h1.minXy)
-		{
-			if ((v1n->point.x < v1p->point.x) || ((v1n->point.x == v1p->point.x) && (v1n->point.y < v1p->point.y)))
-			{
-				h1.minXy = v1n;
-			}
-			else
-			{
-				h1.minXy = v1p;
-			}
-		}
-		if (v1 == h1.maxXy)
-		{
-			if ((v1n->point.x > v1p->point.x) || ((v1n->point.x == v1p->point.x) && (v1n->point.y > v1p->point.y)))
-			{
-				h1.maxXy = v1n;
-			}
-			else
-			{
-				h1.maxXy = v1p;
-			}
-		}
-	}
-	
-	v0 = h0.maxXy;
-	v1 = h1.maxXy;
-	Vertex* v00 = NULL;
-	Vertex* v10 = NULL;
-	int32_t sign = 1;
-
-	for (int side = 0; side <= 1; side++)
-	{		
-		int32_t dx = (v1->point.x - v0->point.x) * sign;
-		if (dx > 0)
-		{
-			while (true)
-			{
-				int32_t dy = v1->point.y - v0->point.y;
-
-				Vertex* w0 = side ? v0->next : v0->prev;
-				if (w0 != v0)
-				{
-					int32_t dx0 = (w0->point.x - v0->point.x) * sign;
-					int32_t dy0 = w0->point.y - v0->point.y;
-					if ((dy0 <= 0) && ((dx0 == 0) || ((dx0 < 0) && (dy0 * dx <= dy * dx0))))
-					{
-						v0 = w0;
-						dx = (v1->point.x - v0->point.x) * sign;
-						continue;
-					}
-				}
-
-				Vertex* w1 = side ? v1->next : v1->prev;
-				if (w1 != v1)
-				{
-					int32_t dx1 = (w1->point.x - v1->point.x) * sign;
-					int32_t dy1 = w1->point.y - v1->point.y;
-					int32_t dxn = (w1->point.x - v0->point.x) * sign;
-					if ((dxn > 0) && (dy1 < 0) && ((dx1 == 0) || ((dx1 < 0) && (dy1 * dx < dy * dx1))))
-					{
-						v1 = w1;
-						dx = dxn;
-						continue;
-					}
-				}
-
-				break;
-			}
-		}
-		else if (dx < 0)
-		{
-			while (true)
-			{
-				int32_t dy = v1->point.y - v0->point.y;
-				
-				Vertex* w1 = side ? v1->prev : v1->next;
-				if (w1 != v1)
-				{
-					int32_t dx1 = (w1->point.x - v1->point.x) * sign;
-					int32_t dy1 = w1->point.y - v1->point.y;
-					if ((dy1 >= 0) && ((dx1 == 0) || ((dx1 < 0) && (dy1 * dx <= dy * dx1))))
-					{
-						v1 = w1;
-						dx = (v1->point.x - v0->point.x) * sign;
-						continue;
-					}
-				}
-				
-				Vertex* w0 = side ? v0->prev : v0->next;
-				if (w0 != v0)
-				{
-					int32_t dx0 = (w0->point.x - v0->point.x) * sign;
-					int32_t dy0 = w0->point.y - v0->point.y;
-					int32_t dxn = (v1->point.x - w0->point.x) * sign;
-					if ((dxn < 0) && (dy0 > 0) && ((dx0 == 0) || ((dx0 < 0) && (dy0 * dx < dy * dx0))))
-					{
-						v0 = w0;
-						dx = dxn;
-						continue;
-					}
-				}
-				
-				break;
-			}
-		}
-		else
-		{
-			int32_t x = v0->point.x;
-			int32_t y0 = v0->point.y;
-			Vertex* w0 = v0;
-			Vertex* t;
-			while (((t = side ? w0->next : w0->prev) != v0) && (t->point.x == x) && (t->point.y <= y0))
-			{
-				w0 = t;
-				y0 = t->point.y;
-			}
-			v0 = w0;
-
-			int32_t y1 = v1->point.y;
-			Vertex* w1 = v1;
-			while (((t = side ? w1->prev : w1->next) != v1) && (t->point.x == x) && (t->point.y >= y1))
-			{
-				w1 = t;
-				y1 = t->point.y;
-			}
-			v1 = w1;
-		}
-		
-		if (side == 0)
-		{
-			v00 = v0;
-			v10 = v1;
-
-			v0 = h0.minXy;
-			v1 = h1.minXy;
-			sign = -1;
-		}
-	}
-
-	v0->prev = v1;
-	v1->next = v0;
-
-	v00->next = v10;
-	v10->prev = v00;
-
-	if (h1.minXy->point.x < h0.minXy->point.x)
-	{
-		h0.minXy = h1.minXy;
-	}
-	if (h1.maxXy->point.x >= h0.maxXy->point.x)
-	{
-		h0.maxXy = h1.maxXy;
-	}
-	
-	h0.maxYx = h1.maxYx;
-
-	c0 = v00;
-	c1 = v10;
-
-	return true;
-}
-
-void btConvexHullInternal::computeInternal(int start, int end, IntermediateHull& result)
-{
-	int n = end - start;
-	switch (n)
-	{
-		case 0:
-			result.minXy = NULL;
-			result.maxXy = NULL;
-			result.minYx = NULL;
-			result.maxYx = NULL;
-			return;
-		case 2:
-		{
-			Vertex* v = originalVertices[start];
-			Vertex* w = v + 1;
-			if (v->point != w->point)
-			{
-				int32_t dx = v->point.x - w->point.x;
-				int32_t dy = v->point.y - w->point.y;
-
-				if ((dx == 0) && (dy == 0))
-				{
-					if (v->point.z > w->point.z)
-					{
-						Vertex* t = w;
-						w = v;
-						v = t;
-					}
-					btAssert(v->point.z < w->point.z);
-					v->next = v;
-					v->prev = v;
-					result.minXy = v;
-					result.maxXy = v;
-					result.minYx = v;
-					result.maxYx = v;
-				}
-				else
-				{
-					v->next = w;
-					v->prev = w;
-					w->next = v;
-					w->prev = v;
-
-					if ((dx < 0) || ((dx == 0) && (dy < 0)))
-					{
-						result.minXy = v;
-						result.maxXy = w;
-					}
-					else
-					{
-						result.minXy = w;
-						result.maxXy = v;
-					}
-
-					if ((dy < 0) || ((dy == 0) && (dx < 0)))
-					{
-						result.minYx = v;
-						result.maxYx = w;
-					}
-					else
-					{
-						result.minYx = w;
-						result.maxYx = v;
-					}
-				}
-
-				Edge* e = newEdgePair(v, w);
-				e->link(e);
-				v->edges = e;
-
-				e = e->reverse;
-				e->link(e);
-				w->edges = e;
-
-				return;
-			}
-		}
-		// lint -fallthrough
-		case 1:
-		{
-			Vertex* v = originalVertices[start];
-			v->edges = NULL;
-			v->next = v;
-			v->prev = v;
-
-			result.minXy = v;
-			result.maxXy = v;
-			result.minYx = v;
-			result.maxYx = v;
-
-			return;
-		}
-	}
-
-	int split0 = start + n / 2;
-	Point32 p = originalVertices[split0-1]->point;
-	int split1 = split0;
-	while ((split1 < end) && (originalVertices[split1]->point == p))
-	{
-		split1++;
-	}
-	computeInternal(start, split0, result);
-	IntermediateHull hull1;
-	computeInternal(split1, end, hull1);
-#ifdef DEBUG_CONVEX_HULL
-	printf("\n\nMerge\n");
-	result.print();
-	hull1.print();
-#endif
-	merge(result, hull1);
-#ifdef DEBUG_CONVEX_HULL
-	printf("\n  Result\n");
-	result.print();
-#endif
-}
-
-#ifdef DEBUG_CONVEX_HULL
-void btConvexHullInternal::IntermediateHull::print()
-{
-	printf("    Hull\n");
-	for (Vertex* v = minXy; v; )
-	{
-		printf("      ");
-		v->print();
-		if (v == maxXy)
-		{
-			printf(" maxXy");
-		}
-		if (v == minYx)
-		{
-			printf(" minYx");
-		}
-		if (v == maxYx)
-		{
-			printf(" maxYx");
-		}
-		if (v->next->prev != v)
-		{
-			printf(" Inconsistency");
-		}
-		printf("\n");
-		v = v->next;
-		if (v == minXy)
-		{
-			break;
-		}
-	}
-	if (minXy)
-	{		
-		minXy->copy = (minXy->copy == -1) ? -2 : -1;
-		minXy->printGraph();
-	}
-}
-
-void btConvexHullInternal::Vertex::printGraph()
-{
-	print();
-	printf("\nEdges\n");
-	Edge* e = edges;
-	if (e)
-	{
-		do
-		{
-			e->print();
-			printf("\n");
-			e = e->next;
-		} while (e != edges);
-		do
-		{
-			Vertex* v = e->target;
-			if (v->copy != copy)
-			{
-				v->copy = copy;
-				v->printGraph();
-			}
-			e = e->next;
-		} while (e != edges);
-	}
-}
-#endif
-
-btConvexHullInternal::Orientation btConvexHullInternal::getOrientation(const Edge* prev, const Edge* next, const Point32& s, const Point32& t)
-{
-	btAssert(prev->reverse->target == next->reverse->target);
-	if (prev->next == next)
-	{
-		if (prev->prev == next)
-		{
-			Point64 n = t.cross(s);
-			Point64 m = (*prev->target - *next->reverse->target).cross(*next->target - *next->reverse->target);
-			btAssert(!m.isZero());
-			int64_t dot = n.dot(m);
-			btAssert(dot != 0);
-			return (dot > 0) ? COUNTER_CLOCKWISE : CLOCKWISE;
-		}
-		return COUNTER_CLOCKWISE;
-	}
-	else if (prev->prev == next)
-	{
-		return CLOCKWISE;
-	}
-	else
-	{
-		return NONE;
-	}
-}
-
-btConvexHullInternal::Edge* btConvexHullInternal::findMaxAngle(bool ccw, const Vertex* start, const Point32& s, const Point64& rxs, const Point64& sxrxs, Rational64& minCot)
-{
-	Edge* minEdge = NULL;
-
-#ifdef DEBUG_CONVEX_HULL
-	printf("find max edge for %d\n", start->point.index);
-#endif
-	Edge* e = start->edges;
-	if (e)
-	{
-		do
-		{
-			if (e->copy > mergeStamp)
-			{
-				Point32 t = *e->target - *start;
-				Rational64 cot(t.dot(sxrxs), t.dot(rxs));
-#ifdef DEBUG_CONVEX_HULL
-				printf("      Angle is %f (%d) for ", (float) btAtan(cot.toScalar()), (int) cot.isNaN());
-				e->print();
-#endif
-				if (cot.isNaN())
-				{
-					btAssert(ccw ? (t.dot(s) < 0) : (t.dot(s) > 0));
-				}
-				else
-				{
-					int cmp;
-					if (minEdge == NULL)
-					{
-						minCot = cot;
-						minEdge = e;
-					}
-					else if ((cmp = cot.compare(minCot)) < 0)
-					{
-						minCot = cot;
-						minEdge = e;
-					}
-					else if ((cmp == 0) && (ccw == (getOrientation(minEdge, e, s, t) == COUNTER_CLOCKWISE)))
-					{
-						minEdge = e;
-					}
-				}
-#ifdef DEBUG_CONVEX_HULL
-				printf("\n");
-#endif
-			}
-			e = e->next;
-		} while (e != start->edges);
-	}
-	return minEdge;
-}
-
-void btConvexHullInternal::findEdgeForCoplanarFaces(Vertex* c0, Vertex* c1, Edge*& e0, Edge*& e1, Vertex* stop0, Vertex* stop1)
-{
-	Edge* start0 = e0;
-	Edge* start1 = e1;
-	Point32 et0 = start0 ? start0->target->point : c0->point;
-	Point32 et1 = start1 ? start1->target->point : c1->point;
-	Point32 s = c1->point - c0->point;
-	Point64 normal = ((start0 ? start0 : start1)->target->point - c0->point).cross(s);
-	int64_t dist = c0->point.dot(normal);
-	btAssert(!start1 || (start1->target->point.dot(normal) == dist));
-	Point64 perp = s.cross(normal);
-	btAssert(!perp.isZero());
-	
-#ifdef DEBUG_CONVEX_HULL
-	printf("   Advancing %d %d  (%p %p, %d %d)\n", c0->point.index, c1->point.index, start0, start1, start0 ? start0->target->point.index : -1, start1 ? start1->target->point.index : -1);
-#endif
-
-	int64_t maxDot0 = et0.dot(perp);
-	if (e0)
-	{
-		while (e0->target != stop0)
-		{
-			Edge* e = e0->reverse->prev;
-			if (e->target->point.dot(normal) < dist)
-			{
-				break;
-			}
-			btAssert(e->target->point.dot(normal) == dist);
-			if (e->copy == mergeStamp)
-			{
-				break;
-			}
-			int64_t dot = e->target->point.dot(perp);
-			if (dot <= maxDot0)
-			{
-				break;
-			}
-			maxDot0 = dot;
-			e0 = e;
-			et0 = e->target->point;
-		}
-	}
-	
-	int64_t maxDot1 = et1.dot(perp);
-	if (e1)
-	{
-		while (e1->target != stop1)
-		{
-			Edge* e = e1->reverse->next;
-			if (e->target->point.dot(normal) < dist)
-			{
-				break;
-			}
-			btAssert(e->target->point.dot(normal) == dist);
-			if (e->copy == mergeStamp)
-			{
-				break;
-			}
-			int64_t dot = e->target->point.dot(perp);
-			if (dot <= maxDot1)
-			{
-				break;
-			}
-			maxDot1 = dot;
-			e1 = e;
-			et1 = e->target->point;
-		}
-	}
-
-#ifdef DEBUG_CONVEX_HULL
-	printf("   Starting at %d %d\n", et0.index, et1.index);
-#endif
-
-	int64_t dx = maxDot1 - maxDot0;
-	if (dx > 0)
-	{
-		while (true)
-		{
-			int64_t dy = (et1 - et0).dot(s);
-			
-			if (e0 && (e0->target != stop0))
-			{
-				Edge* f0 = e0->next->reverse;
-				if (f0->copy > mergeStamp)
-				{
-					int64_t dx0 = (f0->target->point - et0).dot(perp);
-					int64_t dy0 = (f0->target->point - et0).dot(s);
-					if ((dx0 == 0) ? (dy0 < 0) : ((dx0 < 0) && (Rational64(dy0, dx0).compare(Rational64(dy, dx)) >= 0)))
-					{
-						et0 = f0->target->point;
-						dx = (et1 - et0).dot(perp);
-						e0 = (e0 == start0) ? NULL : f0;
-						continue;
-					}
-				}
-			}
-			
-			if (e1 && (e1->target != stop1))
-			{
-				Edge* f1 = e1->reverse->next;
-				if (f1->copy > mergeStamp)
-				{
-					Point32 d1 = f1->target->point - et1;
-					if (d1.dot(normal) == 0)
-					{
-						int64_t dx1 = d1.dot(perp);
-						int64_t dy1 = d1.dot(s);
-						int64_t dxn = (f1->target->point - et0).dot(perp);
-						if ((dxn > 0) && ((dx1 == 0) ? (dy1 < 0) : ((dx1 < 0) && (Rational64(dy1, dx1).compare(Rational64(dy, dx)) > 0))))
-						{
-							e1 = f1;
-							et1 = e1->target->point;
-							dx = dxn;
-							continue;
-						}
-					}
-					else
-					{
-						btAssert((e1 == start1) && (d1.dot(normal) < 0));
-					}
-				}
-			}
-
-			break;
-		}
-	}
-	else if (dx < 0)
-	{
-		while (true)
-		{
-			int64_t dy = (et1 - et0).dot(s);
-			
-			if (e1 && (e1->target != stop1))
-			{
-				Edge* f1 = e1->prev->reverse;
-				if (f1->copy > mergeStamp)
-				{
-					int64_t dx1 = (f1->target->point - et1).dot(perp);
-					int64_t dy1 = (f1->target->point - et1).dot(s);
-					if ((dx1 == 0) ? (dy1 > 0) : ((dx1 < 0) && (Rational64(dy1, dx1).compare(Rational64(dy, dx)) <= 0)))
-					{
-						et1 = f1->target->point;
-						dx = (et1 - et0).dot(perp);
-						e1 = (e1 == start1) ? NULL : f1;
-						continue;
-					}
-				}
-			}
-			
-			if (e0 && (e0->target != stop0))
-			{
-				Edge* f0 = e0->reverse->prev;
-				if (f0->copy > mergeStamp)
-				{
-					Point32 d0 = f0->target->point - et0;
-					if (d0.dot(normal) == 0)
-					{
-						int64_t dx0 = d0.dot(perp);
-						int64_t dy0 = d0.dot(s);
-						int64_t dxn = (et1 - f0->target->point).dot(perp);
-						if ((dxn < 0) && ((dx0 == 0) ? (dy0 > 0) : ((dx0 < 0) && (Rational64(dy0, dx0).compare(Rational64(dy, dx)) < 0))))
-						{
-							e0 = f0;
-							et0 = e0->target->point;
-							dx = dxn;
-							continue;
-						}
-					}
-					else
-					{
-						btAssert((e0 == start0) && (d0.dot(normal) < 0));
-					}
-				}
-			}
-
-			break;
-		}
-	}
-#ifdef DEBUG_CONVEX_HULL
-	printf("   Advanced edges to %d %d\n", et0.index, et1.index);
-#endif
-}
-
-
-void btConvexHullInternal::merge(IntermediateHull& h0, IntermediateHull& h1)
-{
-	if (!h1.maxXy)
-	{
-		return;
-	}
-	if (!h0.maxXy)
-	{
-		h0 = h1;
-		return;
-	}
-	
-	mergeStamp--;
-
-	Vertex* c0 = NULL;
-	Edge* toPrev0 = NULL;
-	Edge* firstNew0 = NULL;
-	Edge* pendingHead0 = NULL;
-	Edge* pendingTail0 = NULL;
-	Vertex* c1 = NULL;
-	Edge* toPrev1 = NULL;
-	Edge* firstNew1 = NULL;
-	Edge* pendingHead1 = NULL;
-	Edge* pendingTail1 = NULL;
-	Point32 prevPoint;
-
-	if (mergeProjection(h0, h1, c0, c1))
-	{
-		Point32 s = *c1 - *c0;
-		Point64 normal = Point32(0, 0, -1).cross(s);
-		Point64 t = s.cross(normal);
-		btAssert(!t.isZero());
-
-		Edge* e = c0->edges;
-		Edge* start0 = NULL;
-		if (e)
-		{
-			do
-			{
-				int64_t dot = (*e->target - *c0).dot(normal);
-				btAssert(dot <= 0);
-				if ((dot == 0) && ((*e->target - *c0).dot(t) > 0))
-				{
-					if (!start0 || (getOrientation(start0, e, s, Point32(0, 0, -1)) == CLOCKWISE))
-					{
-						start0 = e;
-					}
-				}
-				e = e->next;
-			} while (e != c0->edges);
-		}
-		
-		e = c1->edges;
-		Edge* start1 = NULL;
-		if (e)
-		{
-			do
-			{
-				int64_t dot = (*e->target - *c1).dot(normal);
-				btAssert(dot <= 0);
-				if ((dot == 0) && ((*e->target - *c1).dot(t) > 0))
-				{
-					if (!start1 || (getOrientation(start1, e, s, Point32(0, 0, -1)) == COUNTER_CLOCKWISE))
-					{
-						start1 = e;
-					}
-				}
-				e = e->next;
-			} while (e != c1->edges);
-		}
-
-		if (start0 || start1)
-		{
-			findEdgeForCoplanarFaces(c0, c1, start0, start1, NULL, NULL);
-			if (start0)
-			{
-				c0 = start0->target;
-			}
-			if (start1)
-			{
-				c1 = start1->target;
-			}
-		}
-
-		prevPoint = c1->point;
-		prevPoint.z++;
-	}
-	else
-	{
-		prevPoint = c1->point;
-		prevPoint.x++;
-	}
-
-	Vertex* first0 = c0;
-	Vertex* first1 = c1;
-	bool firstRun = true;
-
-	while (true)
-	{
-		Point32 s = *c1 - *c0;
-		Point32 r = prevPoint - c0->point;
-		Point64 rxs = r.cross(s);
-		Point64 sxrxs = s.cross(rxs);
-		
-#ifdef DEBUG_CONVEX_HULL
-		printf("\n  Checking %d %d\n", c0->point.index, c1->point.index);
-#endif
-		Rational64 minCot0(0, 0);
-		Edge* min0 = findMaxAngle(false, c0, s, rxs, sxrxs, minCot0);
-		Rational64 minCot1(0, 0);
-		Edge* min1 = findMaxAngle(true, c1, s, rxs, sxrxs, minCot1);
-		if (!min0 && !min1)
-		{
-			Edge* e = newEdgePair(c0, c1);
-			e->link(e);
-			c0->edges = e;
-
-			e = e->reverse;
-			e->link(e);
-			c1->edges = e;
-			return;
-		}
-		else
-		{
-			int cmp = !min0 ? 1 : !min1 ? -1 : minCot0.compare(minCot1);
-#ifdef DEBUG_CONVEX_HULL
-			printf("    -> Result %d\n", cmp);
-#endif
-			if (firstRun || ((cmp >= 0) ? !minCot1.isNegativeInfinity() : !minCot0.isNegativeInfinity()))
-			{
-				Edge* e = newEdgePair(c0, c1);
-				if (pendingTail0)
-				{
-					pendingTail0->prev = e;
-				}
-				else
-				{
-					pendingHead0 = e;
-				}
-				e->next = pendingTail0;
-				pendingTail0 = e;
-
-				e = e->reverse;
-				if (pendingTail1)
-				{
-					pendingTail1->next = e;
-				}
-				else
-				{
-					pendingHead1 = e;
-				}
-				e->prev = pendingTail1;
-				pendingTail1 = e;
-			}
-			
-			Edge* e0 = min0;
-			Edge* e1 = min1;
-
-#ifdef DEBUG_CONVEX_HULL
-			printf("   Found min edges to %d %d\n", e0 ? e0->target->point.index : -1, e1 ? e1->target->point.index : -1);
-#endif
-
-			if (cmp == 0)
-			{
-				findEdgeForCoplanarFaces(c0, c1, e0, e1, NULL, NULL);
-			}
-
-			if ((cmp >= 0) && e1)
-			{
-				if (toPrev1)
-				{
-					for (Edge* e = toPrev1->next, *n = NULL; e != min1; e = n)
-					{
-						n = e->next;
-						removeEdgePair(e);
-					}
-				}
-
-				if (pendingTail1)
-				{
-					if (toPrev1)
-					{
-						toPrev1->link(pendingHead1);
-					}
-					else
-					{
-						min1->prev->link(pendingHead1);
-						firstNew1 = pendingHead1;
-					}
-					pendingTail1->link(min1);
-					pendingHead1 = NULL;
-					pendingTail1 = NULL;
-				}
-				else if (!toPrev1)
-				{
-					firstNew1 = min1;
-				}
-
-				prevPoint = c1->point;
-				c1 = e1->target;
-				toPrev1 = e1->reverse;
-			}
-
-			if ((cmp <= 0) && e0)
-			{
-				if (toPrev0)
-				{
-					for (Edge* e = toPrev0->prev, *n = NULL; e != min0; e = n)
-					{
-						n = e->prev;
-						removeEdgePair(e);
-					}
-				}
-
-				if (pendingTail0)
-				{
-					if (toPrev0)
-					{
-						pendingHead0->link(toPrev0);
-					}
-					else
-					{
-						pendingHead0->link(min0->next);
-						firstNew0 = pendingHead0;
-					}
-					min0->link(pendingTail0);
-					pendingHead0 = NULL;
-					pendingTail0 = NULL;
-				}
-				else if (!toPrev0)
-				{
-					firstNew0 = min0;
-				}
-
-				prevPoint = c0->point;
-				c0 = e0->target;
-				toPrev0 = e0->reverse;
-			}
-		}
-
-		if ((c0 == first0) && (c1 == first1))
-		{
-			if (toPrev0 == NULL)
-			{
-				pendingHead0->link(pendingTail0);
-				c0->edges = pendingTail0;
-			}
-			else
-			{
-				for (Edge* e = toPrev0->prev, *n = NULL; e != firstNew0; e = n)
-				{
-					n = e->prev;
-					removeEdgePair(e);
-				}
-				if (pendingTail0)
-				{
-					pendingHead0->link(toPrev0);
-					firstNew0->link(pendingTail0);
-				}
-			}
-
-			if (toPrev1 == NULL)
-			{
-				pendingTail1->link(pendingHead1);
-				c1->edges = pendingTail1;
-			}
-			else
-			{
-				for (Edge* e = toPrev1->next, *n = NULL; e != firstNew1; e = n)
-				{
-					n = e->next;
-					removeEdgePair(e);
-				}
-				if (pendingTail1)
-				{
-					toPrev1->link(pendingHead1);
-					pendingTail1->link(firstNew1);
-				}
-			}
-			
-			return;
-		}
-
-		firstRun = false;
-	}
-}
-
-
-static bool pointCmp(const btConvexHullInternal::Point32& p, const btConvexHullInternal::Point32& q)
-{
-	return (p.y < q.y) || ((p.y == q.y) && ((p.x < q.x) || ((p.x == q.x) && (p.z < q.z))));
-}
-
-void btConvexHullInternal::compute(const void* coords, bool doubleCoords, int stride, int count)
-{
-	btVector3 min(btScalar(1e30), btScalar(1e30), btScalar(1e30)), max(btScalar(-1e30), btScalar(-1e30), btScalar(-1e30));
-	const char* ptr = (const char*) coords;
-	if (doubleCoords)
-	{
-		for (int i = 0; i < count; i++)
-		{
-			const double* v = (const double*) ptr;
-			btVector3 p((btScalar) v[0], (btScalar) v[1], (btScalar) v[2]);
-			ptr += stride;
-			min.setMin(p);
-			max.setMax(p);
-		}
-	}
-	else
-	{
-		for (int i = 0; i < count; i++)
-		{
-			const float* v = (const float*) ptr;
-			btVector3 p(v[0], v[1], v[2]);
-			ptr += stride;
-			min.setMin(p);
-			max.setMax(p);
-		}
-	}
-
-	btVector3 s = max - min;
-	maxAxis = s.maxAxis();
-	minAxis = s.minAxis();
-	if (minAxis == maxAxis)
-	{
-		minAxis = (maxAxis + 1) % 3;
-	}
-	medAxis = 3 - maxAxis - minAxis;
-
-	s /= btScalar(10216);
-
-	scaling = s;
-	if (s[0] > 0)
-	{
-		s[0] = btScalar(1) / s[0];
-	}
-	if (s[1] > 0)
-	{
-		s[1] = btScalar(1) / s[1];
-	}
-	if (s[2] > 0)
-	{
-		s[2] = btScalar(1) / s[2];
-	}
-
-	center = (min + max) * btScalar(0.5);
-
-	btAlignedObjectArray<Point32> points;
-	points.resize(count);
-	ptr = (const char*) coords;
-	if (doubleCoords)
-	{
-		for (int i = 0; i < count; i++)
-		{
-			const double* v = (const double*) ptr;
-			btVector3 p((btScalar) v[0], (btScalar) v[1], (btScalar) v[2]);
-			ptr += stride;
-			p = (p - center) * s;
-			points[i].x = (int32_t) p[medAxis];
-			points[i].y = (int32_t) p[maxAxis];
-			points[i].z = (int32_t) p[minAxis];
-			points[i].index = i;
-		}
-	}
-	else
-	{
-		for (int i = 0; i < count; i++)
-		{
-			const float* v = (const float*) ptr;
-			btVector3 p(v[0], v[1], v[2]);
-			ptr += stride;
-			p = (p - center) * s;
-			points[i].x = (int32_t) p[medAxis];
-			points[i].y = (int32_t) p[maxAxis];
-			points[i].z = (int32_t) p[minAxis];
-			points[i].index = i;
-		}
-	}
-	points.quickSort(pointCmp);
-
-	vertexPool.reset();
-	vertexPool.setArraySize(count);
-	originalVertices.resize(count);
-	for (int i = 0; i < count; i++)
-	{
-		Vertex* v = vertexPool.newObject();
-		v->edges = NULL;
-		v->point = points[i];
-		v->copy = -1;
-		originalVertices[i] = v;
-	}
-
-	points.clear();
-
-	edgePool.reset();
-	edgePool.setArraySize(6 * count);
-
-	usedEdgePairs = 0;
-	maxUsedEdgePairs = 0;
-
-	mergeStamp = -3;
-
-	IntermediateHull hull;
-	computeInternal(0, count, hull);
-	vertexList = hull.minXy;
-#ifdef DEBUG_CONVEX_HULL
-	printf("max. edges %d (3v = %d)", maxUsedEdgePairs, 3 * count);
-#endif
-}
-
-btVector3 btConvexHullInternal::toBtVector(const Point32& v)
-{
-	btVector3 p;
-	p[medAxis] = btScalar(v.x);
-	p[maxAxis] = btScalar(v.y);
-	p[minAxis] = btScalar(v.z);
-	return p * scaling;
-}
-
-btVector3 btConvexHullInternal::getBtNormal(Face* face)
-{
-	btVector3 normal = toBtVector(face->dir0).cross(toBtVector(face->dir1));
-	normal /= ((medAxis + 1 == maxAxis) || (medAxis - 2 == maxAxis)) ? normal.length() : -normal.length();
-	return normal;
-}
-
-btVector3 btConvexHullInternal::getCoordinates(const Vertex* v)
-{
-	btVector3 p;
-	p[medAxis] = v->xvalue();
-	p[maxAxis] = v->yvalue();
-	p[minAxis] = v->zvalue();
-	return p * scaling + center;
-}
-
-btScalar btConvexHullInternal::shrink(btScalar amount, btScalar clampAmount)
-{
-	if (!vertexList)
-	{
-		return 0;
-	}
-	int stamp = --mergeStamp;
-	btAlignedObjectArray<Vertex*> stack;
-	vertexList->copy = stamp;
-	stack.push_back(vertexList);
-	btAlignedObjectArray<Face*> faces;
-
-	Point32 ref = vertexList->point;
-	Int128 hullCenterX(0, 0);
-	Int128 hullCenterY(0, 0);
-	Int128 hullCenterZ(0, 0);
-	Int128 volume(0, 0);
-
-	while (stack.size() > 0)
-	{
-		Vertex* v = stack[stack.size() - 1];
-		stack.pop_back();
-		Edge* e = v->edges;
-		if (e)
-		{
-			do
-			{
-				if (e->target->copy != stamp)
-				{
-					e->target->copy = stamp;
-					stack.push_back(e->target);
-				}
-				if (e->copy != stamp)
-				{
-					Face* face = facePool.newObject();
-					face->init(e->target, e->reverse->prev->target, v);
-					faces.push_back(face);
-					Edge* f = e;
-
-					Vertex* a = NULL;
-					Vertex* b = NULL;
-					do
-					{
-						if (a && b)
-						{
-							int64_t vol = (v->point - ref).dot((a->point - ref).cross(b->point - ref));
-							btAssert(vol >= 0);
-							Point32 c = v->point + a->point + b->point + ref;
-							hullCenterX += vol * c.x;
-							hullCenterY += vol * c.y;
-							hullCenterZ += vol * c.z;
-							volume += vol;
-						}
-
-						btAssert(f->copy != stamp);
-						f->copy = stamp;
-						f->face = face;
-
-						a = b;
-						b = f->target;
-
-						f = f->reverse->prev;
-					} while (f != e);
-				}
-				e = e->next;
-			} while (e != v->edges);
-		}
-	}
-
-	if (volume.getSign() <= 0)
-	{
-		return 0;
-	}
-
-	btVector3 hullCenter;
-	hullCenter[medAxis] = hullCenterX.toScalar();
-	hullCenter[maxAxis] = hullCenterY.toScalar();
-	hullCenter[minAxis] = hullCenterZ.toScalar();
-	hullCenter /= 4 * volume.toScalar();
-	hullCenter *= scaling;
-
-	int faceCount = faces.size();
-
-	if (clampAmount > 0)
-	{
-		btScalar minDist = SIMD_INFINITY;
-		for (int i = 0; i < faceCount; i++)
-		{
-			btVector3 normal = getBtNormal(faces[i]);
-			btScalar dist = normal.dot(toBtVector(faces[i]->origin) - hullCenter);
-			if (dist < minDist)
-			{
-				minDist = dist;
-			}
-		}
-		
-		if (minDist <= 0)
-		{
-			return 0;
-		}
-
-		amount = btMin(amount, minDist * clampAmount);
-	}
-
-	unsigned int seed = 243703;
-	for (int i = 0; i < faceCount; i++, seed = 1664525 * seed + 1013904223)
-	{
-		btSwap(faces[i], faces[seed % faceCount]);
-	}
-
-	for (int i = 0; i < faceCount; i++)
-	{
-		if (!shiftFace(faces[i], amount, stack))
-		{
-			return -amount;
-		}
-	}
-
-	return amount;
-}
-
-bool btConvexHullInternal::shiftFace(Face* face, btScalar amount, btAlignedObjectArray<Vertex*> stack)
-{
-	btVector3 origShift = getBtNormal(face) * -amount;
-	if (scaling[0] > 0)
-	{
-		origShift[0] /= scaling[0];
-	}
-	if (scaling[1] > 0)
-	{
-		origShift[1] /= scaling[1];
-	}
-	if (scaling[2] > 0)
-	{
-		origShift[2] /= scaling[2];
-	}
-	Point32 shift((int32_t) origShift[medAxis], (int32_t) origShift[maxAxis], (int32_t) origShift[minAxis]);
-	if (shift.isZero())
-	{
-		return true;
-	}
-	Point64 normal = face->getNormal();
-#ifdef DEBUG_CONVEX_HULL
-	printf("\nShrinking face (%d %d %d) (%d %d %d) (%d %d %d) by (%d %d %d)\n",
-				 face->origin.x, face->origin.y, face->origin.z, face->dir0.x, face->dir0.y, face->dir0.z, face->dir1.x, face->dir1.y, face->dir1.z, shift.x, shift.y, shift.z);
-#endif
-	int64_t origDot = face->origin.dot(normal);
-	Point32 shiftedOrigin = face->origin + shift;
-	int64_t shiftedDot = shiftedOrigin.dot(normal);
-	btAssert(shiftedDot <= origDot);
-	if (shiftedDot >= origDot)
-	{
-		return false;
-	}
-
-	Edge* intersection = NULL;
-
-	Edge* startEdge = face->nearbyVertex->edges;
-#ifdef DEBUG_CONVEX_HULL
-	printf("Start edge is ");
-	startEdge->print();
-	printf(", normal is (%lld %lld %lld), shifted dot is %lld\n", normal.x, normal.y, normal.z, shiftedDot);
-#endif
-	Rational128 optDot = face->nearbyVertex->dot(normal);
-	int cmp = optDot.compare(shiftedDot);
-#ifdef SHOW_ITERATIONS
-	int n = 0;
-#endif
-	if (cmp >= 0)
-	{
-		Edge* e = startEdge;
-		do
-		{
-#ifdef SHOW_ITERATIONS
-			n++;
-#endif
-			Rational128 dot = e->target->dot(normal);
-			btAssert(dot.compare(origDot) <= 0);
-#ifdef DEBUG_CONVEX_HULL
-			printf("Moving downwards, edge is ");
-			e->print();
-			printf(", dot is %f (%f %lld)\n", (float) dot.toScalar(), (float) optDot.toScalar(), shiftedDot);
-#endif
-			if (dot.compare(optDot) < 0)
-			{
-				int c = dot.compare(shiftedDot);
-				optDot = dot;
-				e = e->reverse;
-				startEdge = e;
-				if (c < 0)
-				{
-					intersection = e;
-					break;
-				}
-				cmp = c;
-			}
-			e = e->prev;
-		} while (e != startEdge);
-
-		if (!intersection)
-		{
-			return false;
-		}
-	}
-	else
-	{
-		Edge* e = startEdge;
-		do
-		{
-#ifdef SHOW_ITERATIONS
-			n++;
-#endif
-			Rational128 dot = e->target->dot(normal);
-			btAssert(dot.compare(origDot) <= 0);
-#ifdef DEBUG_CONVEX_HULL
-			printf("Moving upwards, edge is ");
-			e->print();
-			printf(", dot is %f (%f %lld)\n", (float) dot.toScalar(), (float) optDot.toScalar(), shiftedDot);
-#endif
-			if (dot.compare(optDot) > 0)
-			{
-				cmp = dot.compare(shiftedDot);
-				if (cmp >= 0)
-				{
-					intersection = e;
-					break;
-				}
-				optDot = dot;
-				e = e->reverse;
-				startEdge = e;
-			}
-			e = e->prev;
-		} while (e != startEdge);
-		
-		if (!intersection)
-		{
-			return true;
-		}
-	}
-
-#ifdef SHOW_ITERATIONS
-	printf("Needed %d iterations to find initial intersection\n", n);
-#endif
-
-	if (cmp == 0)
-	{
-		Edge* e = intersection->reverse->next;
-#ifdef SHOW_ITERATIONS
-		n = 0;
-#endif
-		while (e->target->dot(normal).compare(shiftedDot) <= 0)
-		{
-#ifdef SHOW_ITERATIONS
-			n++;
-#endif
-			e = e->next;
-			if (e == intersection->reverse)
-			{
-				return true;
-			}
-#ifdef DEBUG_CONVEX_HULL
-			printf("Checking for outwards edge, current edge is ");
-			e->print();
-			printf("\n");
-#endif
-		}
-#ifdef SHOW_ITERATIONS
-		printf("Needed %d iterations to check for complete containment\n", n);
-#endif
-	}
-	
-	Edge* firstIntersection = NULL;
-	Edge* faceEdge = NULL;
-	Edge* firstFaceEdge = NULL;
-
-#ifdef SHOW_ITERATIONS
-	int m = 0;
-#endif
-	while (true)
-	{
-#ifdef SHOW_ITERATIONS
-		m++;
-#endif
-#ifdef DEBUG_CONVEX_HULL
-		printf("Intersecting edge is ");
-		intersection->print();
-		printf("\n");
-#endif
-		if (cmp == 0)
-		{
-			Edge* e = intersection->reverse->next;
-			startEdge = e;
-#ifdef SHOW_ITERATIONS
-			n = 0;
-#endif
-			while (true)
-			{
-#ifdef SHOW_ITERATIONS
-				n++;
-#endif
-				if (e->target->dot(normal).compare(shiftedDot) >= 0)
-				{
-					break;
-				}
-				intersection = e->reverse;
-				e = e->next;
-				if (e == startEdge)
-				{
-					return true;
-				}
-			}
-#ifdef SHOW_ITERATIONS
-			printf("Needed %d iterations to advance intersection\n", n);
-#endif
-		}
-
-#ifdef DEBUG_CONVEX_HULL
-		printf("Advanced intersecting edge to ");
-		intersection->print();
-		printf(", cmp = %d\n", cmp);
-#endif
-
-		if (!firstIntersection)
-		{
-			firstIntersection = intersection;
-		}
-		else if (intersection == firstIntersection)
-		{
-			break;
-		}
-
-		int prevCmp = cmp;
-		Edge* prevIntersection = intersection;
-		Edge* prevFaceEdge = faceEdge;
-
-		Edge* e = intersection->reverse;
-#ifdef SHOW_ITERATIONS
-		n = 0;
-#endif
-		while (true)
-		{
-#ifdef SHOW_ITERATIONS
-			n++;
-#endif
-			e = e->reverse->prev;
-			btAssert(e != intersection->reverse);
-			cmp = e->target->dot(normal).compare(shiftedDot);
-#ifdef DEBUG_CONVEX_HULL
-			printf("Testing edge ");
-			e->print();
-			printf(" -> cmp = %d\n", cmp);
-#endif
-			if (cmp >= 0)
-			{
-				intersection = e;
-				break;
-			}
-		}
-#ifdef SHOW_ITERATIONS
-		printf("Needed %d iterations to find other intersection of face\n", n);
-#endif
-
-		if (cmp > 0)
-		{
-			Vertex* removed = intersection->target;
-			e = intersection->reverse;
-			if (e->prev == e)
-			{
-				removed->edges = NULL;
-			}
-			else
-			{
-				removed->edges = e->prev;
-				e->prev->link(e->next);
-				e->link(e);
-			}
-#ifdef DEBUG_CONVEX_HULL
-			printf("1: Removed part contains (%d %d %d)\n", removed->point.x, removed->point.y, removed->point.z);
-#endif
-			
-			Point64 n0 = intersection->face->getNormal();
-			Point64 n1 = intersection->reverse->face->getNormal();
-			int64_t m00 = face->dir0.dot(n0);
-			int64_t m01 = face->dir1.dot(n0);
-			int64_t m10 = face->dir0.dot(n1);
-			int64_t m11 = face->dir1.dot(n1);
-			int64_t r0 = (intersection->face->origin - shiftedOrigin).dot(n0);
-			int64_t r1 = (intersection->reverse->face->origin - shiftedOrigin).dot(n1);
-			Int128 det = Int128::mul(m00, m11) - Int128::mul(m01, m10);
-			btAssert(det.getSign() != 0);
-			Vertex* v = vertexPool.newObject();
-			v->point.index = -1;
-			v->copy = -1;
-			v->point128 = PointR128(Int128::mul(face->dir0.x * r0, m11) - Int128::mul(face->dir0.x * r1, m01)
-															+ Int128::mul(face->dir1.x * r1, m00) - Int128::mul(face->dir1.x * r0, m10) + det * shiftedOrigin.x,
-															Int128::mul(face->dir0.y * r0, m11) - Int128::mul(face->dir0.y * r1, m01)
-															+ Int128::mul(face->dir1.y * r1, m00) - Int128::mul(face->dir1.y * r0, m10) + det * shiftedOrigin.y,
-															Int128::mul(face->dir0.z * r0, m11) - Int128::mul(face->dir0.z * r1, m01)
-															+ Int128::mul(face->dir1.z * r1, m00) - Int128::mul(face->dir1.z * r0, m10) + det * shiftedOrigin.z,
-															det);
-			v->point.x = (int32_t) v->point128.xvalue();
-			v->point.y = (int32_t) v->point128.yvalue();
-			v->point.z = (int32_t) v->point128.zvalue();
-			intersection->target = v;
-			v->edges = e;
-
-			stack.push_back(v);
-			stack.push_back(removed);
-			stack.push_back(NULL);
-		}
-
-		if (cmp || prevCmp || (prevIntersection->reverse->next->target != intersection->target))
-		{
-			faceEdge = newEdgePair(prevIntersection->target, intersection->target);
-			if (prevCmp == 0)
-			{
-				faceEdge->link(prevIntersection->reverse->next);
-			}
-			if ((prevCmp == 0) || prevFaceEdge)
-			{
-				prevIntersection->reverse->link(faceEdge);
-			}
-			if (cmp == 0)
-			{
-				intersection->reverse->prev->link(faceEdge->reverse);
-			}
-			faceEdge->reverse->link(intersection->reverse);
-		}
-		else
-		{
-			faceEdge = prevIntersection->reverse->next;
-		}
-
-		if (prevFaceEdge)
-		{
-			if (prevCmp > 0)
-			{
-				faceEdge->link(prevFaceEdge->reverse);
-			}
-			else if (faceEdge != prevFaceEdge->reverse)
-			{
-				stack.push_back(prevFaceEdge->target);
-				while (faceEdge->next != prevFaceEdge->reverse)
-				{
-					Vertex* removed = faceEdge->next->target;
-					removeEdgePair(faceEdge->next);
-					stack.push_back(removed);
-#ifdef DEBUG_CONVEX_HULL
-					printf("2: Removed part contains (%d %d %d)\n", removed->point.x, removed->point.y, removed->point.z);
-#endif
-				}
-				stack.push_back(NULL);
-			}
-		}
-		faceEdge->face = face;
-		faceEdge->reverse->face = intersection->face;
-
-		if (!firstFaceEdge)
-		{
-			firstFaceEdge = faceEdge;
-		}
-	}
-#ifdef SHOW_ITERATIONS
-	printf("Needed %d iterations to process all intersections\n", m);
-#endif
-
-	if (cmp > 0)
-	{
-		firstFaceEdge->reverse->target = faceEdge->target;
-		firstIntersection->reverse->link(firstFaceEdge);
-		firstFaceEdge->link(faceEdge->reverse);
-	}
-	else if (firstFaceEdge != faceEdge->reverse)
-	{
-		stack.push_back(faceEdge->target);
-		while (firstFaceEdge->next != faceEdge->reverse)
-		{
-			Vertex* removed = firstFaceEdge->next->target;
-			removeEdgePair(firstFaceEdge->next);
-			stack.push_back(removed);
-#ifdef DEBUG_CONVEX_HULL
-			printf("3: Removed part contains (%d %d %d)\n", removed->point.x, removed->point.y, removed->point.z);
-#endif
-		}
-		stack.push_back(NULL);
-	}
-
-	btAssert(stack.size() > 0);
-	vertexList = stack[0];
-
-#ifdef DEBUG_CONVEX_HULL
-	printf("Removing part\n");
-#endif
-#ifdef SHOW_ITERATIONS
-	n = 0;
-#endif
-	int pos = 0;
-	while (pos < stack.size())
-	{
-		int end = stack.size();
-		while (pos < end)
-		{
-			Vertex* kept = stack[pos++];
-#ifdef DEBUG_CONVEX_HULL
-			kept->print();
-#endif
-			bool deeper = false;
-			Vertex* removed;
-			while ((removed = stack[pos++]) != NULL)
-			{
-#ifdef SHOW_ITERATIONS
-				n++;
-#endif
-				kept->receiveNearbyFaces(removed);
-				while (removed->edges)
-				{
-					if (!deeper)
-					{
-						deeper = true;
-						stack.push_back(kept);
-					}
-					stack.push_back(removed->edges->target);
-					removeEdgePair(removed->edges);
-				}
-			}
-			if (deeper)
-			{
-				stack.push_back(NULL);
-			}
-		}
-	}
-#ifdef SHOW_ITERATIONS
-	printf("Needed %d iterations to remove part\n", n);
-#endif
-
-	stack.resize(0);
-	face->origin = shiftedOrigin;
-
-	return true;
-}
-
-
-static int getVertexCopy(btConvexHullInternal::Vertex* vertex, btAlignedObjectArray<btConvexHullInternal::Vertex*>& vertices)
-{
-	int index = vertex->copy;
-	if (index < 0)
-	{
-		index = vertices.size();
-		vertex->copy = index;
-		vertices.push_back(vertex);
-#ifdef DEBUG_CONVEX_HULL
-		printf("Vertex %d gets index *%d\n", vertex->point.index, index);
-#endif
-	}
-	return index;
-}
-
-btScalar btConvexHullComputer::compute(const void* coords, bool doubleCoords, int stride, int count, btScalar shrink, btScalar shrinkClamp)
-{
-	if (count <= 0)
-	{
-		vertices.clear();
-		edges.clear();
-		faces.clear();
-		return 0;
-	}
-
-	btConvexHullInternal hull;
-	hull.compute(coords, doubleCoords, stride, count);
-
-	btScalar shift = 0;
-	if ((shrink > 0) && ((shift = hull.shrink(shrink, shrinkClamp)) < 0))
-	{
-		vertices.clear();
-		edges.clear();
-		faces.clear();
-		return shift;
-	}
-
-	vertices.resize(0);
-	edges.resize(0);
-	faces.resize(0);
-
-	btAlignedObjectArray<btConvexHullInternal::Vertex*> oldVertices;
-	getVertexCopy(hull.vertexList, oldVertices);
-	int copied = 0;
-	while (copied < oldVertices.size())
-	{
-		btConvexHullInternal::Vertex* v = oldVertices[copied];
-		vertices.push_back(hull.getCoordinates(v));
-		btConvexHullInternal::Edge* firstEdge = v->edges;
-		if (firstEdge)
-		{
-			int firstCopy = -1;
-			int prevCopy = -1;
-			btConvexHullInternal::Edge* e = firstEdge;
-			do
-			{
-				if (e->copy < 0)
-				{
-					int s = edges.size();
-					edges.push_back(Edge());
-					edges.push_back(Edge());
-					Edge* c = &edges[s];
-					Edge* r = &edges[s + 1];
-					e->copy = s;
-					e->reverse->copy = s + 1;
-					c->reverse = 1;
-					r->reverse = -1;
-					c->targetVertex = getVertexCopy(e->target, oldVertices);
-					r->targetVertex = copied;
-#ifdef DEBUG_CONVEX_HULL
-					printf("      CREATE: Vertex *%d has edge to *%d\n", copied, c->getTargetVertex());
-#endif
-				}
-				if (prevCopy >= 0)
-				{
-					edges[e->copy].next = prevCopy - e->copy;
-				}
-				else
-				{
-					firstCopy = e->copy;
-				}
-				prevCopy = e->copy;
-				e = e->next;
-			} while (e != firstEdge);
-			edges[firstCopy].next = prevCopy - firstCopy;
-		}
-		copied++;
-	}
-
-	for (int i = 0; i < copied; i++)
-	{
-		btConvexHullInternal::Vertex* v = oldVertices[i];
-		btConvexHullInternal::Edge* firstEdge = v->edges;
-		if (firstEdge)
-		{
-			btConvexHullInternal::Edge* e = firstEdge;
-			do
-			{
-				if (e->copy >= 0)
-				{
-#ifdef DEBUG_CONVEX_HULL
-					printf("Vertex *%d has edge to *%d\n", i, edges[e->copy].getTargetVertex());
-#endif
-					faces.push_back(e->copy);
-					btConvexHullInternal::Edge* f = e;
-					do
-					{
-#ifdef DEBUG_CONVEX_HULL
-						printf("   Face *%d\n", edges[f->copy].getTargetVertex());
-#endif
-						f->copy = -1;
-						f = f->reverse->prev;
-					} while (f != e);
-				}
-				e = e->next;
-			} while (e != firstEdge);
-		}
-	}
-
-	return shift;
-}
-
-
-
-
-
diff --git a/hkl3d/bullet/src/LinearMath/btConvexHullComputer.h b/hkl3d/bullet/src/LinearMath/btConvexHullComputer.h
deleted file mode 100644
index f1d2630..0000000
--- a/hkl3d/bullet/src/LinearMath/btConvexHullComputer.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-Copyright (c) 2011 Ole Kniemeyer, MAXON, www.maxon.net
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_CONVEX_HULL_COMPUTER_H
-#define BT_CONVEX_HULL_COMPUTER_H
-
-#include "btVector3.h"
-#include "btAlignedObjectArray.h"
-
-/// Convex hull implementation based on Preparata and Hong
-/// See http://code.google.com/p/bullet/issues/detail?id=275
-/// Ole Kniemeyer, MAXON Computer GmbH
-class btConvexHullComputer
-{
-	private:
-		btScalar compute(const void* coords, bool doubleCoords, int stride, int count, btScalar shrink, btScalar shrinkClamp);
-
-	public:
-
-		class Edge
-		{
-			private:
-				int next;
-				int reverse;
-				int targetVertex;
-
-				friend class btConvexHullComputer;
-
-			public:
-				int getSourceVertex() const
-				{
-					return (this + reverse)->targetVertex;
-				}
-
-				int getTargetVertex() const
-				{
-					return targetVertex;
-				}
-
-				const Edge* getNextEdgeOfVertex() const // counter-clockwise list of all edges of a vertex
-				{
-					return this + next;
-				}
-
-				const Edge* getNextEdgeOfFace() const // clockwise list of all edges of a face
-				{
-					return (this + reverse)->getNextEdgeOfVertex();
-				}
-
-				const Edge* getReverseEdge() const
-				{
-					return this + reverse;
-				}
-		};
-
-
-		// Vertices of the output hull
-		btAlignedObjectArray<btVector3> vertices;
-
-		// Edges of the output hull
-		btAlignedObjectArray<Edge> edges;
-
-		// Faces of the convex hull. Each entry is an index into the "edges" array pointing to an edge of the face. Faces are planar n-gons
-		btAlignedObjectArray<int> faces;
-
-		/*
-		Compute convex hull of "count" vertices stored in "coords". "stride" is the difference in bytes
-		between the addresses of consecutive vertices. If "shrink" is positive, the convex hull is shrunken
-		by that amount (each face is moved by "shrink" length units towards the center along its normal).
-		If "shrinkClamp" is positive, "shrink" is clamped to not exceed "shrinkClamp * innerRadius", where "innerRadius"
-		is the minimum distance of a face to the center of the convex hull.
-
-		The returned value is the amount by which the hull has been shrunken. If it is negative, the amount was so large
-		that the resulting convex hull is empty.
-
-		The output convex hull can be found in the member variables "vertices", "edges", "faces".
-		*/
-		btScalar compute(const float* coords, int stride, int count, btScalar shrink, btScalar shrinkClamp)
-		{
-			return compute(coords, false, stride, count, shrink, shrinkClamp);
-		}
-
-		// same as above, but double precision
-		btScalar compute(const double* coords, int stride, int count, btScalar shrink, btScalar shrinkClamp)
-		{
-			return compute(coords, true, stride, count, shrink, shrinkClamp);
-		}
-};
-
-
-#endif //BT_CONVEX_HULL_COMPUTER_H
-
diff --git a/hkl3d/bullet/src/LinearMath/btDefaultMotionState.h b/hkl3d/bullet/src/LinearMath/btDefaultMotionState.h
deleted file mode 100644
index a6b7ef1..0000000
--- a/hkl3d/bullet/src/LinearMath/btDefaultMotionState.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef BT_DEFAULT_MOTION_STATE_H
-#define BT_DEFAULT_MOTION_STATE_H
-
-#include "btMotionState.h"
-
-///The btDefaultMotionState provides a common implementation to synchronize world transforms with offsets.
-struct	btDefaultMotionState : public btMotionState
-{
-	btTransform m_graphicsWorldTrans;
-	btTransform	m_centerOfMassOffset;
-	btTransform m_startWorldTrans;
-	void*		m_userPointer;
-
-	btDefaultMotionState(const btTransform& startTrans = btTransform::getIdentity(),const btTransform& centerOfMassOffset = btTransform::getIdentity())
-		: m_graphicsWorldTrans(startTrans),
-		m_centerOfMassOffset(centerOfMassOffset),
-		m_startWorldTrans(startTrans),
-		m_userPointer(0)
-
-	{
-	}
-
-	///synchronizes world transform from user to physics
-	virtual void	getWorldTransform(btTransform& centerOfMassWorldTrans ) const 
-	{
-			centerOfMassWorldTrans = 	m_centerOfMassOffset.inverse() * m_graphicsWorldTrans ;
-	}
-
-	///synchronizes world transform from physics to user
-	///Bullet only calls the update of worldtransform for active objects
-	virtual void	setWorldTransform(const btTransform& centerOfMassWorldTrans)
-	{
-			m_graphicsWorldTrans = centerOfMassWorldTrans * m_centerOfMassOffset ;
-	}
-
-	
-
-};
-
-#endif //BT_DEFAULT_MOTION_STATE_H
diff --git a/hkl3d/bullet/src/LinearMath/btGeometryUtil.cpp b/hkl3d/bullet/src/LinearMath/btGeometryUtil.cpp
deleted file mode 100644
index 5ac230f..0000000
--- a/hkl3d/bullet/src/LinearMath/btGeometryUtil.cpp
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
-Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-#include "btGeometryUtil.h"
-
-
-/*
-  Make sure this dummy function never changes so that it
-  can be used by probes that are checking whether the
-  library is actually installed.
-*/
-extern "C"
-{	
-	void btBulletMathProbe ();
-
-	void btBulletMathProbe () {}
-}
-
-
-bool	btGeometryUtil::isPointInsidePlanes(const btAlignedObjectArray<btVector3>& planeEquations, const btVector3& point, btScalar	margin)
-{
-	int numbrushes = planeEquations.size();
-	for (int i=0;i<numbrushes;i++)
-	{
-		const btVector3& N1 = planeEquations[i];
-		btScalar dist = btScalar(N1.dot(point))+btScalar(N1[3])-margin;
-		if (dist>btScalar(0.))
-		{
-			return false;
-		}
-	}
-	return true;
-		
-}
-
-
-bool	btGeometryUtil::areVerticesBehindPlane(const btVector3& planeNormal, const btAlignedObjectArray<btVector3>& vertices, btScalar	margin)
-{
-	int numvertices = vertices.size();
-	for (int i=0;i<numvertices;i++)
-	{
-		const btVector3& N1 = vertices[i];
-		btScalar dist = btScalar(planeNormal.dot(N1))+btScalar(planeNormal[3])-margin;
-		if (dist>btScalar(0.))
-		{
-			return false;
-		}
-	}
-	return true;
-}
-
-bool notExist(const btVector3& planeEquation,const btAlignedObjectArray<btVector3>& planeEquations);
-
-bool notExist(const btVector3& planeEquation,const btAlignedObjectArray<btVector3>& planeEquations)
-{
-	int numbrushes = planeEquations.size();
-	for (int i=0;i<numbrushes;i++)
-	{
-		const btVector3& N1 = planeEquations[i];
-		if (planeEquation.dot(N1) > btScalar(0.999))
-		{
-			return false;
-		} 
-	}
-	return true;
-}
-
-void	btGeometryUtil::getPlaneEquationsFromVertices(btAlignedObjectArray<btVector3>& vertices, btAlignedObjectArray<btVector3>& planeEquationsOut )
-{
-		const int numvertices = vertices.size();
-	// brute force:
-	for (int i=0;i<numvertices;i++)
-	{
-		const btVector3& N1 = vertices[i];
-		
-
-		for (int j=i+1;j<numvertices;j++)
-		{
-			const btVector3& N2 = vertices[j];
-				
-			for (int k=j+1;k<numvertices;k++)
-			{
-
-				const btVector3& N3 = vertices[k];
-
-				btVector3 planeEquation,edge0,edge1;
-				edge0 = N2-N1;
-				edge1 = N3-N1;
-				btScalar normalSign = btScalar(1.);
-				for (int ww=0;ww<2;ww++)
-				{
-					planeEquation = normalSign * edge0.cross(edge1);
-					if (planeEquation.length2() > btScalar(0.0001))
-					{
-						planeEquation.normalize();
-						if (notExist(planeEquation,planeEquationsOut))
-						{
-							planeEquation[3] = -planeEquation.dot(N1);
-							
-								//check if inside, and replace supportingVertexOut if needed
-								if (areVerticesBehindPlane(planeEquation,vertices,btScalar(0.01)))
-								{
-									planeEquationsOut.push_back(planeEquation);
-								}
-						}
-					}
-					normalSign = btScalar(-1.);
-				}
-			
-			}
-		}
-	}
-
-}
-
-void	btGeometryUtil::getVerticesFromPlaneEquations(const btAlignedObjectArray<btVector3>& planeEquations , btAlignedObjectArray<btVector3>& verticesOut )
-{
-	const int numbrushes = planeEquations.size();
-	// brute force:
-	for (int i=0;i<numbrushes;i++)
-	{
-		const btVector3& N1 = planeEquations[i];
-		
-
-		for (int j=i+1;j<numbrushes;j++)
-		{
-			const btVector3& N2 = planeEquations[j];
-				
-			for (int k=j+1;k<numbrushes;k++)
-			{
-
-				const btVector3& N3 = planeEquations[k];
-
-				btVector3 n2n3; n2n3 = N2.cross(N3);
-				btVector3 n3n1; n3n1 = N3.cross(N1);
-				btVector3 n1n2; n1n2 = N1.cross(N2);
-				
-				if ( ( n2n3.length2() > btScalar(0.0001) ) &&
-					 ( n3n1.length2() > btScalar(0.0001) ) &&
-					 ( n1n2.length2() > btScalar(0.0001) ) )
-				{
-					//point P out of 3 plane equations:
-
-					//	d1 ( N2 * N3 ) + d2 ( N3 * N1 ) + d3 ( N1 * N2 )  
-					//P =  -------------------------------------------------------------------------  
-					//   N1 . ( N2 * N3 )  
-
-
-					btScalar quotient = (N1.dot(n2n3));
-					if (btFabs(quotient) > btScalar(0.000001))
-					{
-						quotient = btScalar(-1.) / quotient;
-						n2n3 *= N1[3];
-						n3n1 *= N2[3];
-						n1n2 *= N3[3];
-						btVector3 potentialVertex = n2n3;
-						potentialVertex += n3n1;
-						potentialVertex += n1n2;
-						potentialVertex *= quotient;
-
-						//check if inside, and replace supportingVertexOut if needed
-						if (isPointInsidePlanes(planeEquations,potentialVertex,btScalar(0.01)))
-						{
-							verticesOut.push_back(potentialVertex);
-						}
-					}
-				}
-			}
-		}
-	}
-}
-
diff --git a/hkl3d/bullet/src/LinearMath/btGeometryUtil.h b/hkl3d/bullet/src/LinearMath/btGeometryUtil.h
deleted file mode 100644
index a4b13b4..0000000
--- a/hkl3d/bullet/src/LinearMath/btGeometryUtil.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef BT_GEOMETRY_UTIL_H
-#define BT_GEOMETRY_UTIL_H
-
-#include "btVector3.h"
-#include "btAlignedObjectArray.h"
-
-///The btGeometryUtil helper class provides a few methods to convert between plane equations and vertices.
-class btGeometryUtil
-{
-	public:
-	
-	
-		static void	getPlaneEquationsFromVertices(btAlignedObjectArray<btVector3>& vertices, btAlignedObjectArray<btVector3>& planeEquationsOut );
-
-		static void	getVerticesFromPlaneEquations(const btAlignedObjectArray<btVector3>& planeEquations , btAlignedObjectArray<btVector3>& verticesOut );
-	
-		static bool	isInside(const btAlignedObjectArray<btVector3>& vertices, const btVector3& planeNormal, btScalar	margin);
-		
-		static bool	isPointInsidePlanes(const btAlignedObjectArray<btVector3>& planeEquations, const btVector3& point, btScalar	margin);
-
-		static bool	areVerticesBehindPlane(const btVector3& planeNormal, const btAlignedObjectArray<btVector3>& vertices, btScalar	margin);
-
-};
-
-
-#endif //BT_GEOMETRY_UTIL_H
-
diff --git a/hkl3d/bullet/src/LinearMath/btHashMap.h b/hkl3d/bullet/src/LinearMath/btHashMap.h
deleted file mode 100644
index ce07db3..0000000
--- a/hkl3d/bullet/src/LinearMath/btHashMap.h
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef BT_HASH_MAP_H
-#define BT_HASH_MAP_H
-
-#include "btAlignedObjectArray.h"
-
-///very basic hashable string implementation, compatible with btHashMap
-struct btHashString
-{
-	const char* m_string;
-	unsigned int	m_hash;
-
-	SIMD_FORCE_INLINE	unsigned int getHash()const
-	{
-		return m_hash;
-	}
-
-	btHashString(const char* name)
-		:m_string(name)
-	{
-		/* magic numbers from http://www.isthe.com/chongo/tech/comp/fnv/ */
-		static const unsigned int  InitialFNV = 2166136261u;
-		static const unsigned int FNVMultiple = 16777619u;
-
-		/* Fowler / Noll / Vo (FNV) Hash */
-		unsigned int hash = InitialFNV;
-		
-		for(int i = 0; m_string[i]; i++)
-		{
-			hash = hash ^ (m_string[i]);       /* xor  the low 8 bits */
-			hash = hash * FNVMultiple;  /* multiply by the magic number */
-		}
-		m_hash = hash;
-	}
-
-	int portableStringCompare(const char* src,	const char* dst) const
-	{
-			int ret = 0 ;
-
-			while( ! (ret = *(unsigned char *)src - *(unsigned char *)dst) && *dst)
-					++src, ++dst;
-
-			if ( ret < 0 )
-					ret = -1 ;
-			else if ( ret > 0 )
-					ret = 1 ;
-
-			return( ret );
-	}
-
-	bool equals(const btHashString& other) const
-	{
-		return (m_string == other.m_string) ||
-			(0==portableStringCompare(m_string,other.m_string));
-
-	}
-
-};
-
-const int BT_HASH_NULL=0xffffffff;
-
-
-class btHashInt
-{
-	int	m_uid;
-public:
-	btHashInt(int uid)	:m_uid(uid)
-	{
-	}
-
-	int	getUid1() const
-	{
-		return m_uid;
-	}
-
-	void	setUid1(int uid)
-	{
-		m_uid = uid;
-	}
-
-	bool equals(const btHashInt& other) const
-	{
-		return getUid1() == other.getUid1();
-	}
-	//to our success
-	SIMD_FORCE_INLINE	unsigned int getHash()const
-	{
-		int key = m_uid;
-		// Thomas Wang's hash
-		key += ~(key << 15);	key ^=  (key >> 10);	key +=  (key << 3);	key ^=  (key >> 6);	key += ~(key << 11);	key ^=  (key >> 16);
-		return key;
-	}
-};
-
-
-
-class btHashPtr
-{
-
-	union
-	{
-		const void*	m_pointer;
-		int	m_hashValues[2];
-	};
-
-public:
-
-	btHashPtr(const void* ptr)
-		:m_pointer(ptr)
-	{
-	}
-
-	const void*	getPointer() const
-	{
-		return m_pointer;
-	}
-
-	bool equals(const btHashPtr& other) const
-	{
-		return getPointer() == other.getPointer();
-	}
-
-	//to our success
-	SIMD_FORCE_INLINE	unsigned int getHash()const
-	{
-		const bool VOID_IS_8 = ((sizeof(void*)==8));
-		
-		int key = VOID_IS_8? m_hashValues[0]+m_hashValues[1] : m_hashValues[0];
-	
-		// Thomas Wang's hash
-		key += ~(key << 15);	key ^=  (key >> 10);	key +=  (key << 3);	key ^=  (key >> 6);	key += ~(key << 11);	key ^=  (key >> 16);
-		return key;
-	}
-
-	
-};
-
-
-template <class Value>
-class btHashKeyPtr
-{
-        int     m_uid;
-public:
-
-        btHashKeyPtr(int uid)    :m_uid(uid)
-        {
-        }
-
-        int     getUid1() const
-        {
-                return m_uid;
-        }
-
-        bool equals(const btHashKeyPtr<Value>& other) const
-        {
-                return getUid1() == other.getUid1();
-        }
-
-        //to our success
-        SIMD_FORCE_INLINE       unsigned int getHash()const
-        {
-                int key = m_uid;
-                // Thomas Wang's hash
-                key += ~(key << 15);	key ^=  (key >> 10);	key +=  (key << 3);	key ^=  (key >> 6);	key += ~(key << 11);	key ^=  (key >> 16);
-                return key;
-        }
-
-        
-};
-
-
-template <class Value>
-class btHashKey
-{
-	int	m_uid;
-public:
-
-	btHashKey(int uid)	:m_uid(uid)
-	{
-	}
-
-	int	getUid1() const
-	{
-		return m_uid;
-	}
-
-	bool equals(const btHashKey<Value>& other) const
-	{
-		return getUid1() == other.getUid1();
-	}
-	//to our success
-	SIMD_FORCE_INLINE	unsigned int getHash()const
-	{
-		int key = m_uid;
-		// Thomas Wang's hash
-		key += ~(key << 15);	key ^=  (key >> 10);	key +=  (key << 3);	key ^=  (key >> 6);	key += ~(key << 11);	key ^=  (key >> 16);
-		return key;
-	}
-};
-
-
-///The btHashMap template class implements a generic and lightweight hashmap.
-///A basic sample of how to use btHashMap is located in Demos\BasicDemo\main.cpp
-template <class Key, class Value>
-class btHashMap
-{
-
-protected:
-	btAlignedObjectArray<int>		m_hashTable;
-	btAlignedObjectArray<int>		m_next;
-	
-	btAlignedObjectArray<Value>		m_valueArray;
-	btAlignedObjectArray<Key>		m_keyArray;
-
-	void	growTables(const Key& /*key*/)
-	{
-		int newCapacity = m_valueArray.capacity();
-
-		if (m_hashTable.size() < newCapacity)
-		{
-			//grow hashtable and next table
-			int curHashtableSize = m_hashTable.size();
-
-			m_hashTable.resize(newCapacity);
-			m_next.resize(newCapacity);
-
-			int i;
-
-			for (i= 0; i < newCapacity; ++i)
-			{
-				m_hashTable[i] = BT_HASH_NULL;
-			}
-			for (i = 0; i < newCapacity; ++i)
-			{
-				m_next[i] = BT_HASH_NULL;
-			}
-
-			for(i=0;i<curHashtableSize;i++)
-			{
-				//const Value& value = m_valueArray[i];
-				//const Key& key = m_keyArray[i];
-
-				int	hashValue = m_keyArray[i].getHash() & (m_valueArray.capacity()-1);	// New hash value with new mask
-				m_next[i] = m_hashTable[hashValue];
-				m_hashTable[hashValue] = i;
-			}
-
-
-		}
-	}
-
-	public:
-
-	void insert(const Key& key, const Value& value) {
-		int hash = key.getHash() & (m_valueArray.capacity()-1);
-
-		//replace value if the key is already there
-		int index = findIndex(key);
-		if (index != BT_HASH_NULL)
-		{
-			m_valueArray[index]=value;
-			return;
-		}
-
-		int count = m_valueArray.size();
-		int oldCapacity = m_valueArray.capacity();
-		m_valueArray.push_back(value);
-		m_keyArray.push_back(key);
-
-		int newCapacity = m_valueArray.capacity();
-		if (oldCapacity < newCapacity)
-		{
-			growTables(key);
-			//hash with new capacity
-			hash = key.getHash() & (m_valueArray.capacity()-1);
-		}
-		m_next[count] = m_hashTable[hash];
-		m_hashTable[hash] = count;
-	}
-
-	void remove(const Key& key) {
-
-		int hash = key.getHash() & (m_valueArray.capacity()-1);
-
-		int pairIndex = findIndex(key);
-		
-		if (pairIndex ==BT_HASH_NULL)
-		{
-			return;
-		}
-
-		// Remove the pair from the hash table.
-		int index = m_hashTable[hash];
-		btAssert(index != BT_HASH_NULL);
-
-		int previous = BT_HASH_NULL;
-		while (index != pairIndex)
-		{
-			previous = index;
-			index = m_next[index];
-		}
-
-		if (previous != BT_HASH_NULL)
-		{
-			btAssert(m_next[previous] == pairIndex);
-			m_next[previous] = m_next[pairIndex];
-		}
-		else
-		{
-			m_hashTable[hash] = m_next[pairIndex];
-		}
-
-		// We now move the last pair into spot of the
-		// pair being removed. We need to fix the hash
-		// table indices to support the move.
-
-		int lastPairIndex = m_valueArray.size() - 1;
-
-		// If the removed pair is the last pair, we are done.
-		if (lastPairIndex == pairIndex)
-		{
-			m_valueArray.pop_back();
-			m_keyArray.pop_back();
-			return;
-		}
-
-		// Remove the last pair from the hash table.
-		int lastHash = m_keyArray[lastPairIndex].getHash() & (m_valueArray.capacity()-1);
-
-		index = m_hashTable[lastHash];
-		btAssert(index != BT_HASH_NULL);
-
-		previous = BT_HASH_NULL;
-		while (index != lastPairIndex)
-		{
-			previous = index;
-			index = m_next[index];
-		}
-
-		if (previous != BT_HASH_NULL)
-		{
-			btAssert(m_next[previous] == lastPairIndex);
-			m_next[previous] = m_next[lastPairIndex];
-		}
-		else
-		{
-			m_hashTable[lastHash] = m_next[lastPairIndex];
-		}
-
-		// Copy the last pair into the remove pair's spot.
-		m_valueArray[pairIndex] = m_valueArray[lastPairIndex];
-		m_keyArray[pairIndex] = m_keyArray[lastPairIndex];
-
-		// Insert the last pair into the hash table
-		m_next[pairIndex] = m_hashTable[lastHash];
-		m_hashTable[lastHash] = pairIndex;
-
-		m_valueArray.pop_back();
-		m_keyArray.pop_back();
-
-	}
-
-
-	int size() const
-	{
-		return m_valueArray.size();
-	}
-
-	const Value* getAtIndex(int index) const
-	{
-		btAssert(index < m_valueArray.size());
-
-		return &m_valueArray[index];
-	}
-
-	Value* getAtIndex(int index)
-	{
-		btAssert(index < m_valueArray.size());
-
-		return &m_valueArray[index];
-	}
-
-	Value* operator[](const Key& key) {
-		return find(key);
-	}
-
-	const Value*	find(const Key& key) const
-	{
-		int index = findIndex(key);
-		if (index == BT_HASH_NULL)
-		{
-			return NULL;
-		}
-		return &m_valueArray[index];
-	}
-
-	Value*	find(const Key& key)
-	{
-		int index = findIndex(key);
-		if (index == BT_HASH_NULL)
-		{
-			return NULL;
-		}
-		return &m_valueArray[index];
-	}
-
-
-	int	findIndex(const Key& key) const
-	{
-		unsigned int hash = key.getHash() & (m_valueArray.capacity()-1);
-
-		if (hash >= (unsigned int)m_hashTable.size())
-		{
-			return BT_HASH_NULL;
-		}
-
-		int index = m_hashTable[hash];
-		while ((index != BT_HASH_NULL) && key.equals(m_keyArray[index]) == false)
-		{
-			index = m_next[index];
-		}
-		return index;
-	}
-
-	void	clear()
-	{
-		m_hashTable.clear();
-		m_next.clear();
-		m_valueArray.clear();
-		m_keyArray.clear();
-	}
-
-};
-
-#endif //BT_HASH_MAP_H
diff --git a/hkl3d/bullet/src/LinearMath/btIDebugDraw.h b/hkl3d/bullet/src/LinearMath/btIDebugDraw.h
deleted file mode 100644
index 882514e..0000000
--- a/hkl3d/bullet/src/LinearMath/btIDebugDraw.h
+++ /dev/null
@@ -1,417 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef BT_IDEBUG_DRAW__H
-#define BT_IDEBUG_DRAW__H
-
-#include "btVector3.h"
-#include "btTransform.h"
-
-
-///The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations.
-///Typical use case: create a debug drawer object, and assign it to a btCollisionWorld or btDynamicsWorld using setDebugDrawer and call debugDrawWorld.
-///A class that implements the btIDebugDraw interface has to implement the drawLine method at a minimum.
-///For color arguments the X,Y,Z components refer to Red, Green and Blue each in the range [0..1]
-class	btIDebugDraw
-{
-	public:
-
-	enum	DebugDrawModes
-	{
-		DBG_NoDebug=0,
-		DBG_DrawWireframe = 1,
-		DBG_DrawAabb=2,
-		DBG_DrawFeaturesText=4,
-		DBG_DrawContactPoints=8,
-		DBG_NoDeactivation=16,
-		DBG_NoHelpText = 32,
-		DBG_DrawText=64,
-		DBG_ProfileTimings = 128,
-		DBG_EnableSatComparison = 256,
-		DBG_DisableBulletLCP = 512,
-		DBG_EnableCCD = 1024,
-		DBG_DrawConstraints = (1 << 11),
-		DBG_DrawConstraintLimits = (1 << 12),
-		DBG_FastWireframe = (1<<13),
-		DBG_MAX_DEBUG_DRAW_MODE
-	};
-
-	virtual ~btIDebugDraw() {};
-
-	virtual void	drawLine(const btVector3& from,const btVector3& to,const btVector3& color)=0;
-		
-	virtual void    drawLine(const btVector3& from,const btVector3& to, const btVector3& fromColor, const btVector3& toColor)
-	{
-        (void) toColor;
-		drawLine (from, to, fromColor);
-	}
-
-	virtual void	drawSphere(btScalar radius, const btTransform& transform, const btVector3& color)
-	{
-		btVector3 start = transform.getOrigin();
-
-		const btVector3 xoffs = transform.getBasis() * btVector3(radius,0,0);
-		const btVector3 yoffs = transform.getBasis() * btVector3(0,radius,0);
-		const btVector3 zoffs = transform.getBasis() * btVector3(0,0,radius);
-
-		// XY 
-		drawLine(start-xoffs, start+yoffs, color);
-		drawLine(start+yoffs, start+xoffs, color);
-		drawLine(start+xoffs, start-yoffs, color);
-		drawLine(start-yoffs, start-xoffs, color);
-
-		// XZ
-		drawLine(start-xoffs, start+zoffs, color);
-		drawLine(start+zoffs, start+xoffs, color);
-		drawLine(start+xoffs, start-zoffs, color);
-		drawLine(start-zoffs, start-xoffs, color);
-
-		// YZ
-		drawLine(start-yoffs, start+zoffs, color);
-		drawLine(start+zoffs, start+yoffs, color);
-		drawLine(start+yoffs, start-zoffs, color);
-		drawLine(start-zoffs, start-yoffs, color);
-	}
-	
-	virtual void	drawSphere (const btVector3& p, btScalar radius, const btVector3& color)
-	{
-		btTransform tr;
-		tr.setIdentity();
-		tr.setOrigin(p);
-		drawSphere(radius,tr,color);
-	}
-	
-	virtual	void	drawTriangle(const btVector3& v0,const btVector3& v1,const btVector3& v2,const btVector3& /*n0*/,const btVector3& /*n1*/,const btVector3& /*n2*/,const btVector3& color, btScalar alpha)
-	{
-		drawTriangle(v0,v1,v2,color,alpha);
-	}
-	virtual	void	drawTriangle(const btVector3& v0,const btVector3& v1,const btVector3& v2,const btVector3& color, btScalar /*alpha*/)
-	{
-		drawLine(v0,v1,color);
-		drawLine(v1,v2,color);
-		drawLine(v2,v0,color);
-	}
-
-	virtual void	drawContactPoint(const btVector3& PointOnB,const btVector3& normalOnB,btScalar distance,int lifeTime,const btVector3& color)=0;
-
-	virtual void	reportErrorWarning(const char* warningString) = 0;
-
-	virtual void	draw3dText(const btVector3& location,const char* textString) = 0;
-	
-	virtual void	setDebugMode(int debugMode) =0;
-	
-	virtual int		getDebugMode() const = 0;
-
-	virtual void drawAabb(const btVector3& from,const btVector3& to,const btVector3& color)
-	{
-
-		btVector3 halfExtents = (to-from)* 0.5f;
-		btVector3 center = (to+from) *0.5f;
-		int i,j;
-
-		btVector3 edgecoord(1.f,1.f,1.f),pa,pb;
-		for (i=0;i<4;i++)
-		{
-			for (j=0;j<3;j++)
-			{
-				pa = btVector3(edgecoord[0]*halfExtents[0], edgecoord[1]*halfExtents[1],		
-					edgecoord[2]*halfExtents[2]);
-				pa+=center;
-
-				int othercoord = j%3;
-				edgecoord[othercoord]*=-1.f;
-				pb = btVector3(edgecoord[0]*halfExtents[0], edgecoord[1]*halfExtents[1],	
-					edgecoord[2]*halfExtents[2]);
-				pb+=center;
-
-				drawLine(pa,pb,color);
-			}
-			edgecoord = btVector3(-1.f,-1.f,-1.f);
-			if (i<3)
-				edgecoord[i]*=-1.f;
-		}
-	}
-	virtual void drawTransform(const btTransform& transform, btScalar orthoLen)
-	{
-		btVector3 start = transform.getOrigin();
-		drawLine(start, start+transform.getBasis() * btVector3(orthoLen, 0, 0), btVector3(0.7f,0,0));
-		drawLine(start, start+transform.getBasis() * btVector3(0, orthoLen, 0), btVector3(0,0.7f,0));
-		drawLine(start, start+transform.getBasis() * btVector3(0, 0, orthoLen), btVector3(0,0,0.7f));
-	}
-
-	virtual void drawArc(const btVector3& center, const btVector3& normal, const btVector3& axis, btScalar radiusA, btScalar radiusB, btScalar minAngle, btScalar maxAngle, 
-				const btVector3& color, bool drawSect, btScalar stepDegrees = btScalar(10.f))
-	{
-		const btVector3& vx = axis;
-		btVector3 vy = normal.cross(axis);
-		btScalar step = stepDegrees * SIMD_RADS_PER_DEG;
-		int nSteps = (int)((maxAngle - minAngle) / step);
-		if(!nSteps) nSteps = 1;
-		btVector3 prev = center + radiusA * vx * btCos(minAngle) + radiusB * vy * btSin(minAngle);
-		if(drawSect)
-		{
-			drawLine(center, prev, color);
-		}
-		for(int i = 1; i <= nSteps; i++)
-		{
-			btScalar angle = minAngle + (maxAngle - minAngle) * btScalar(i) / btScalar(nSteps);
-			btVector3 next = center + radiusA * vx * btCos(angle) + radiusB * vy * btSin(angle);
-			drawLine(prev, next, color);
-			prev = next;
-		}
-		if(drawSect)
-		{
-			drawLine(center, prev, color);
-		}
-	}
-	virtual void drawSpherePatch(const btVector3& center, const btVector3& up, const btVector3& axis, btScalar radius, 
-		btScalar minTh, btScalar maxTh, btScalar minPs, btScalar maxPs, const btVector3& color, btScalar stepDegrees = btScalar(10.f))
-	{
-		btVector3 vA[74];
-		btVector3 vB[74];
-		btVector3 *pvA = vA, *pvB = vB, *pT;
-		btVector3 npole = center + up * radius;
-		btVector3 spole = center - up * radius;
-		btVector3 arcStart;
-		btScalar step = stepDegrees * SIMD_RADS_PER_DEG;
-		const btVector3& kv = up;
-		const btVector3& iv = axis;
-		btVector3 jv = kv.cross(iv);
-		bool drawN = false;
-		bool drawS = false;
-		if(minTh <= -SIMD_HALF_PI)
-		{
-			minTh = -SIMD_HALF_PI + step;
-			drawN = true;
-		}
-		if(maxTh >= SIMD_HALF_PI)
-		{
-			maxTh = SIMD_HALF_PI - step;
-			drawS = true;
-		}
-		if(minTh > maxTh)
-		{
-			minTh = -SIMD_HALF_PI + step;
-			maxTh =  SIMD_HALF_PI - step;
-			drawN = drawS = true;
-		}
-		int n_hor = (int)((maxTh - minTh) / step) + 1;
-		if(n_hor < 2) n_hor = 2;
-		btScalar step_h = (maxTh - minTh) / btScalar(n_hor - 1);
-		bool isClosed = false;
-		if(minPs > maxPs)
-		{
-			minPs = -SIMD_PI + step;
-			maxPs =  SIMD_PI;
-			isClosed = true;
-		}
-		else if((maxPs - minPs) >= SIMD_PI * btScalar(2.f))
-		{
-			isClosed = true;
-		}
-		else
-		{
-			isClosed = false;
-		}
-		int n_vert = (int)((maxPs - minPs) / step) + 1;
-		if(n_vert < 2) n_vert = 2;
-		btScalar step_v = (maxPs - minPs) / btScalar(n_vert - 1);
-		for(int i = 0; i < n_hor; i++)
-		{
-			btScalar th = minTh + btScalar(i) * step_h;
-			btScalar sth = radius * btSin(th);
-			btScalar cth = radius * btCos(th);
-			for(int j = 0; j < n_vert; j++)
-			{
-				btScalar psi = minPs + btScalar(j) * step_v;
-				btScalar sps = btSin(psi);
-				btScalar cps = btCos(psi);
-				pvB[j] = center + cth * cps * iv + cth * sps * jv + sth * kv;
-				if(i)
-				{
-					drawLine(pvA[j], pvB[j], color);
-				}
-				else if(drawS)
-				{
-					drawLine(spole, pvB[j], color);
-				}
-				if(j)
-				{
-					drawLine(pvB[j-1], pvB[j], color);
-				}
-				else
-				{
-					arcStart = pvB[j];
-				}
-				if((i == (n_hor - 1)) && drawN)
-				{
-					drawLine(npole, pvB[j], color);
-				}
-				if(isClosed)
-				{
-					if(j == (n_vert-1))
-					{
-						drawLine(arcStart, pvB[j], color);
-					}
-				}
-				else
-				{
-					if(((!i) || (i == (n_hor-1))) && ((!j) || (j == (n_vert-1))))
-					{
-						drawLine(center, pvB[j], color);
-					}
-				}
-			}
-			pT = pvA; pvA = pvB; pvB = pT;
-		}
-	}
-	
-	virtual void drawBox(const btVector3& bbMin, const btVector3& bbMax, const btVector3& color)
-	{
-		drawLine(btVector3(bbMin[0], bbMin[1], bbMin[2]), btVector3(bbMax[0], bbMin[1], bbMin[2]), color);
-		drawLine(btVector3(bbMax[0], bbMin[1], bbMin[2]), btVector3(bbMax[0], bbMax[1], bbMin[2]), color);
-		drawLine(btVector3(bbMax[0], bbMax[1], bbMin[2]), btVector3(bbMin[0], bbMax[1], bbMin[2]), color);
-		drawLine(btVector3(bbMin[0], bbMax[1], bbMin[2]), btVector3(bbMin[0], bbMin[1], bbMin[2]), color);
-		drawLine(btVector3(bbMin[0], bbMin[1], bbMin[2]), btVector3(bbMin[0], bbMin[1], bbMax[2]), color);
-		drawLine(btVector3(bbMax[0], bbMin[1], bbMin[2]), btVector3(bbMax[0], bbMin[1], bbMax[2]), color);
-		drawLine(btVector3(bbMax[0], bbMax[1], bbMin[2]), btVector3(bbMax[0], bbMax[1], bbMax[2]), color);
-		drawLine(btVector3(bbMin[0], bbMax[1], bbMin[2]), btVector3(bbMin[0], bbMax[1], bbMax[2]), color);
-		drawLine(btVector3(bbMin[0], bbMin[1], bbMax[2]), btVector3(bbMax[0], bbMin[1], bbMax[2]), color);
-		drawLine(btVector3(bbMax[0], bbMin[1], bbMax[2]), btVector3(bbMax[0], bbMax[1], bbMax[2]), color);
-		drawLine(btVector3(bbMax[0], bbMax[1], bbMax[2]), btVector3(bbMin[0], bbMax[1], bbMax[2]), color);
-		drawLine(btVector3(bbMin[0], bbMax[1], bbMax[2]), btVector3(bbMin[0], bbMin[1], bbMax[2]), color);
-	}
-	virtual void drawBox(const btVector3& bbMin, const btVector3& bbMax, const btTransform& trans, const btVector3& color)
-	{
-		drawLine(trans * btVector3(bbMin[0], bbMin[1], bbMin[2]), trans * btVector3(bbMax[0], bbMin[1], bbMin[2]), color);
-		drawLine(trans * btVector3(bbMax[0], bbMin[1], bbMin[2]), trans * btVector3(bbMax[0], bbMax[1], bbMin[2]), color);
-		drawLine(trans * btVector3(bbMax[0], bbMax[1], bbMin[2]), trans * btVector3(bbMin[0], bbMax[1], bbMin[2]), color);
-		drawLine(trans * btVector3(bbMin[0], bbMax[1], bbMin[2]), trans * btVector3(bbMin[0], bbMin[1], bbMin[2]), color);
-		drawLine(trans * btVector3(bbMin[0], bbMin[1], bbMin[2]), trans * btVector3(bbMin[0], bbMin[1], bbMax[2]), color);
-		drawLine(trans * btVector3(bbMax[0], bbMin[1], bbMin[2]), trans * btVector3(bbMax[0], bbMin[1], bbMax[2]), color);
-		drawLine(trans * btVector3(bbMax[0], bbMax[1], bbMin[2]), trans * btVector3(bbMax[0], bbMax[1], bbMax[2]), color);
-		drawLine(trans * btVector3(bbMin[0], bbMax[1], bbMin[2]), trans * btVector3(bbMin[0], bbMax[1], bbMax[2]), color);
-		drawLine(trans * btVector3(bbMin[0], bbMin[1], bbMax[2]), trans * btVector3(bbMax[0], bbMin[1], bbMax[2]), color);
-		drawLine(trans * btVector3(bbMax[0], bbMin[1], bbMax[2]), trans * btVector3(bbMax[0], bbMax[1], bbMax[2]), color);
-		drawLine(trans * btVector3(bbMax[0], bbMax[1], bbMax[2]), trans * btVector3(bbMin[0], bbMax[1], bbMax[2]), color);
-		drawLine(trans * btVector3(bbMin[0], bbMax[1], bbMax[2]), trans * btVector3(bbMin[0], bbMin[1], bbMax[2]), color);
-	}
-
-	virtual void drawCapsule(btScalar radius, btScalar halfHeight, int upAxis, const btTransform& transform, const btVector3& color)
-	{
-		btVector3 capStart(0.f,0.f,0.f);
-		capStart[upAxis] = -halfHeight;
-
-		btVector3 capEnd(0.f,0.f,0.f);
-		capEnd[upAxis] = halfHeight;
-
-		// Draw the ends
-		{
-
-			btTransform childTransform = transform;
-			childTransform.getOrigin() = transform * capStart;
-			drawSphere(radius, childTransform, color);
-		}
-
-		{
-			btTransform childTransform = transform;
-			childTransform.getOrigin() = transform * capEnd;
-			drawSphere(radius, childTransform, color);
-		}
-
-		// Draw some additional lines
-		btVector3 start = transform.getOrigin();
-
-		capStart[(upAxis+1)%3] = radius;
-		capEnd[(upAxis+1)%3] = radius;
-		drawLine(start+transform.getBasis() * capStart,start+transform.getBasis() * capEnd, color);
-		capStart[(upAxis+1)%3] = -radius;
-		capEnd[(upAxis+1)%3] = -radius;
-		drawLine(start+transform.getBasis() * capStart,start+transform.getBasis() * capEnd, color);
-
-		capStart[(upAxis+1)%3] = 0.f;
-		capEnd[(upAxis+1)%3] = 0.f;
-
-		capStart[(upAxis+2)%3] = radius;
-		capEnd[(upAxis+2)%3] = radius;
-		drawLine(start+transform.getBasis() * capStart,start+transform.getBasis() * capEnd, color);
-		capStart[(upAxis+2)%3] = -radius;
-		capEnd[(upAxis+2)%3] = -radius;
-		drawLine(start+transform.getBasis() * capStart,start+transform.getBasis() * capEnd, color);
-	}
-
-	virtual void drawCylinder(btScalar radius, btScalar halfHeight, int upAxis, const btTransform& transform, const btVector3& color)
-	{
-		btVector3 start = transform.getOrigin();
-		btVector3	offsetHeight(0,0,0);
-		offsetHeight[upAxis] = halfHeight;
-		btVector3	offsetRadius(0,0,0);
-		offsetRadius[(upAxis+1)%3] = radius;
-		drawLine(start+transform.getBasis() * (offsetHeight+offsetRadius),start+transform.getBasis() * (-offsetHeight+offsetRadius),color);
-		drawLine(start+transform.getBasis() * (offsetHeight-offsetRadius),start+transform.getBasis() * (-offsetHeight-offsetRadius),color);
-
-		// Drawing top and bottom caps of the cylinder
-		btVector3 yaxis(0,0,0);
-		yaxis[upAxis] = btScalar(1.0);
-		btVector3 xaxis(0,0,0);
-		xaxis[(upAxis+1)%3] = btScalar(1.0);
-		drawArc(start-transform.getBasis()*(offsetHeight),transform.getBasis()*yaxis,transform.getBasis()*xaxis,radius,radius,0,SIMD_2_PI,color,false,btScalar(10.0));
-		drawArc(start+transform.getBasis()*(offsetHeight),transform.getBasis()*yaxis,transform.getBasis()*xaxis,radius,radius,0,SIMD_2_PI,color,false,btScalar(10.0));
-	}
-
-	virtual void drawCone(btScalar radius, btScalar height, int upAxis, const btTransform& transform, const btVector3& color)
-	{
-
-		btVector3 start = transform.getOrigin();
-
-		btVector3	offsetHeight(0,0,0);
-		offsetHeight[upAxis] = height * btScalar(0.5);
-		btVector3	offsetRadius(0,0,0);
-		offsetRadius[(upAxis+1)%3] = radius;
-		btVector3	offset2Radius(0,0,0);
-		offset2Radius[(upAxis+2)%3] = radius;
-
-		drawLine(start+transform.getBasis() * (offsetHeight),start+transform.getBasis() * (-offsetHeight+offsetRadius),color);
-		drawLine(start+transform.getBasis() * (offsetHeight),start+transform.getBasis() * (-offsetHeight-offsetRadius),color);
-		drawLine(start+transform.getBasis() * (offsetHeight),start+transform.getBasis() * (-offsetHeight+offset2Radius),color);
-		drawLine(start+transform.getBasis() * (offsetHeight),start+transform.getBasis() * (-offsetHeight-offset2Radius),color);
-
-		// Drawing the base of the cone
-		btVector3 yaxis(0,0,0);
-		yaxis[upAxis] = btScalar(1.0);
-		btVector3 xaxis(0,0,0);
-		xaxis[(upAxis+1)%3] = btScalar(1.0);
-		drawArc(start-transform.getBasis()*(offsetHeight),transform.getBasis()*yaxis,transform.getBasis()*xaxis,radius,radius,0,SIMD_2_PI,color,false,10.0);
-	}
-
-	virtual void drawPlane(const btVector3& planeNormal, btScalar planeConst, const btTransform& transform, const btVector3& color)
-	{
-		btVector3 planeOrigin = planeNormal * planeConst;
-		btVector3 vec0,vec1;
-		btPlaneSpace1(planeNormal,vec0,vec1);
-		btScalar vecLen = 100.f;
-		btVector3 pt0 = planeOrigin + vec0*vecLen;
-		btVector3 pt1 = planeOrigin - vec0*vecLen;
-		btVector3 pt2 = planeOrigin + vec1*vecLen;
-		btVector3 pt3 = planeOrigin - vec1*vecLen;
-		drawLine(transform*pt0,transform*pt1,color);
-		drawLine(transform*pt2,transform*pt3,color);
-	}
-};
-
-
-#endif //BT_IDEBUG_DRAW__H
-
diff --git a/hkl3d/bullet/src/LinearMath/btList.h b/hkl3d/bullet/src/LinearMath/btList.h
deleted file mode 100644
index eec80a7..0000000
--- a/hkl3d/bullet/src/LinearMath/btList.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-#ifndef BT_GEN_LIST_H
-#define BT_GEN_LIST_H
-
-class btGEN_Link {
-public:
-    btGEN_Link() : m_next(0), m_prev(0) {}
-    btGEN_Link(btGEN_Link *next, btGEN_Link *prev) : m_next(next), m_prev(prev) {}
-    
-    btGEN_Link *getNext() const { return m_next; }  
-    btGEN_Link *getPrev() const { return m_prev; }  
-
-    bool isHead() const { return m_prev == 0; }
-    bool isTail() const { return m_next == 0; }
-
-    void insertBefore(btGEN_Link *link) {
-        m_next         = link;
-        m_prev         = link->m_prev;
-        m_next->m_prev = this;
-        m_prev->m_next = this;
-    } 
-
-    void insertAfter(btGEN_Link *link) {
-        m_next         = link->m_next;
-        m_prev         = link;
-        m_next->m_prev = this;
-        m_prev->m_next = this;
-    } 
-
-    void remove() { 
-        m_next->m_prev = m_prev; 
-        m_prev->m_next = m_next;
-    }
-
-private:  
-    btGEN_Link  *m_next;
-    btGEN_Link  *m_prev;
-};
-
-class btGEN_List {
-public:
-    btGEN_List() : m_head(&m_tail, 0), m_tail(0, &m_head) {}
-
-    btGEN_Link *getHead() const { return m_head.getNext(); } 
-    btGEN_Link *getTail() const { return m_tail.getPrev(); } 
-
-    void addHead(btGEN_Link *link) { link->insertAfter(&m_head); }
-    void addTail(btGEN_Link *link) { link->insertBefore(&m_tail); }
-    
-private:
-    btGEN_Link m_head;
-    btGEN_Link m_tail;
-};
-
-#endif //BT_GEN_LIST_H
-
-
-
diff --git a/hkl3d/bullet/src/LinearMath/btMatrix3x3.h b/hkl3d/bullet/src/LinearMath/btMatrix3x3.h
deleted file mode 100644
index d0234a0..0000000
--- a/hkl3d/bullet/src/LinearMath/btMatrix3x3.h
+++ /dev/null
@@ -1,771 +0,0 @@
-/*
-Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef	BT_MATRIX3x3_H
-#define BT_MATRIX3x3_H
-
-#include "btVector3.h"
-#include "btQuaternion.h"
-
-#ifdef BT_USE_DOUBLE_PRECISION
-#define btMatrix3x3Data	btMatrix3x3DoubleData 
-#else
-#define btMatrix3x3Data	btMatrix3x3FloatData
-#endif //BT_USE_DOUBLE_PRECISION
-
-
-/**@brief The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with btQuaternion, btTransform and btVector3.
-* Make sure to only include a pure orthogonal matrix without scaling. */
-class btMatrix3x3 {
-
-	///Data storage for the matrix, each vector is a row of the matrix
-	btVector3 m_el[3];
-
-public:
-	/** @brief No initializaion constructor */
-	btMatrix3x3 () {}
-
-	//		explicit btMatrix3x3(const btScalar *m) { setFromOpenGLSubMatrix(m); }
-
-	/**@brief Constructor from Quaternion */
-	explicit btMatrix3x3(const btQuaternion& q) { setRotation(q); }
-	/*
-	template <typename btScalar>
-	Matrix3x3(const btScalar& yaw, const btScalar& pitch, const btScalar& roll)
-	{ 
-	setEulerYPR(yaw, pitch, roll);
-	}
-	*/
-	/** @brief Constructor with row major formatting */
-	btMatrix3x3(const btScalar& xx, const btScalar& xy, const btScalar& xz,
-		const btScalar& yx, const btScalar& yy, const btScalar& yz,
-		const btScalar& zx, const btScalar& zy, const btScalar& zz)
-	{ 
-		setValue(xx, xy, xz, 
-			yx, yy, yz, 
-			zx, zy, zz);
-	}
-	/** @brief Copy constructor */
-	SIMD_FORCE_INLINE btMatrix3x3 (const btMatrix3x3& other)
-	{
-		m_el[0] = other.m_el[0];
-		m_el[1] = other.m_el[1];
-		m_el[2] = other.m_el[2];
-	}
-	/** @brief Assignment Operator */
-	SIMD_FORCE_INLINE btMatrix3x3& operator=(const btMatrix3x3& other)
-	{
-		m_el[0] = other.m_el[0];
-		m_el[1] = other.m_el[1];
-		m_el[2] = other.m_el[2];
-		return *this;
-	}
-
-	/** @brief Get a column of the matrix as a vector 
-	*  @param i Column number 0 indexed */
-	SIMD_FORCE_INLINE btVector3 getColumn(int i) const
-	{
-		return btVector3(m_el[0][i],m_el[1][i],m_el[2][i]);
-	}
-
-
-	/** @brief Get a row of the matrix as a vector 
-	*  @param i Row number 0 indexed */
-	SIMD_FORCE_INLINE const btVector3& getRow(int i) const
-	{
-		btFullAssert(0 <= i && i < 3);
-		return m_el[i];
-	}
-
-	/** @brief Get a mutable reference to a row of the matrix as a vector 
-	*  @param i Row number 0 indexed */
-	SIMD_FORCE_INLINE btVector3&  operator[](int i)
-	{ 
-		btFullAssert(0 <= i && i < 3);
-		return m_el[i]; 
-	}
-
-	/** @brief Get a const reference to a row of the matrix as a vector 
-	*  @param i Row number 0 indexed */
-	SIMD_FORCE_INLINE const btVector3& operator[](int i) const
-	{
-		btFullAssert(0 <= i && i < 3);
-		return m_el[i]; 
-	}
-
-	/** @brief Multiply by the target matrix on the right
-	*  @param m Rotation matrix to be applied 
-	* Equivilant to this = this * m */
-	btMatrix3x3& operator*=(const btMatrix3x3& m); 
-
-	/** @brief Adds by the target matrix on the right
-	*  @param m matrix to be applied 
-	* Equivilant to this = this + m */
-	btMatrix3x3& operator+=(const btMatrix3x3& m); 
-
-	/** @brief Substractss by the target matrix on the right
-	*  @param m matrix to be applied 
-	* Equivilant to this = this - m */
-	btMatrix3x3& operator-=(const btMatrix3x3& m); 
-
-	/** @brief Set from the rotational part of a 4x4 OpenGL matrix
-	*  @param m A pointer to the beginning of the array of scalars*/
-	void setFromOpenGLSubMatrix(const btScalar *m)
-	{
-		m_el[0].setValue(m[0],m[4],m[8]);
-		m_el[1].setValue(m[1],m[5],m[9]);
-		m_el[2].setValue(m[2],m[6],m[10]);
-
-	}
-	/** @brief Set the values of the matrix explicitly (row major)
-	*  @param xx Top left
-	*  @param xy Top Middle
-	*  @param xz Top Right
-	*  @param yx Middle Left
-	*  @param yy Middle Middle
-	*  @param yz Middle Right
-	*  @param zx Bottom Left
-	*  @param zy Bottom Middle
-	*  @param zz Bottom Right*/
-	void setValue(const btScalar& xx, const btScalar& xy, const btScalar& xz, 
-		const btScalar& yx, const btScalar& yy, const btScalar& yz, 
-		const btScalar& zx, const btScalar& zy, const btScalar& zz)
-	{
-		m_el[0].setValue(xx,xy,xz);
-		m_el[1].setValue(yx,yy,yz);
-		m_el[2].setValue(zx,zy,zz);
-	}
-
-	/** @brief Set the matrix from a quaternion
-	*  @param q The Quaternion to match */  
-	void setRotation(const btQuaternion& q) 
-	{
-		btScalar d = q.length2();
-		btFullAssert(d != btScalar(0.0));
-		btScalar s = btScalar(2.0) / d;
-		btScalar xs = q.x() * s,   ys = q.y() * s,   zs = q.z() * s;
-		btScalar wx = q.w() * xs,  wy = q.w() * ys,  wz = q.w() * zs;
-		btScalar xx = q.x() * xs,  xy = q.x() * ys,  xz = q.x() * zs;
-		btScalar yy = q.y() * ys,  yz = q.y() * zs,  zz = q.z() * zs;
-		setValue(btScalar(1.0) - (yy + zz), xy - wz, xz + wy,
-			xy + wz, btScalar(1.0) - (xx + zz), yz - wx,
-			xz - wy, yz + wx, btScalar(1.0) - (xx + yy));
-	}
-
-
-	/** @brief Set the matrix from euler angles using YPR around YXZ respectively
-	*  @param yaw Yaw about Y axis
-	*  @param pitch Pitch about X axis
-	*  @param roll Roll about Z axis 
-	*/
-	void setEulerYPR(const btScalar& yaw, const btScalar& pitch, const btScalar& roll) 
-	{
-		setEulerZYX(roll, pitch, yaw);
-	}
-
-	/** @brief Set the matrix from euler angles YPR around ZYX axes
-	* @param eulerX Roll about X axis
-	* @param eulerY Pitch around Y axis
-	* @param eulerZ Yaw aboud Z axis
-	* 
-	* These angles are used to produce a rotation matrix. The euler
-	* angles are applied in ZYX order. I.e a vector is first rotated 
-	* about X then Y and then Z
-	**/
-	void setEulerZYX(btScalar eulerX,btScalar eulerY,btScalar eulerZ) { 
-		///@todo proposed to reverse this since it's labeled zyx but takes arguments xyz and it will match all other parts of the code
-		btScalar ci ( btCos(eulerX)); 
-		btScalar cj ( btCos(eulerY)); 
-		btScalar ch ( btCos(eulerZ)); 
-		btScalar si ( btSin(eulerX)); 
-		btScalar sj ( btSin(eulerY)); 
-		btScalar sh ( btSin(eulerZ)); 
-		btScalar cc = ci * ch; 
-		btScalar cs = ci * sh; 
-		btScalar sc = si * ch; 
-		btScalar ss = si * sh;
-
-		setValue(cj * ch, sj * sc - cs, sj * cc + ss,
-			cj * sh, sj * ss + cc, sj * cs - sc, 
-			-sj,      cj * si,      cj * ci);
-	}
-
-	/**@brief Set the matrix to the identity */
-	void setIdentity()
-	{ 
-		setValue(btScalar(1.0), btScalar(0.0), btScalar(0.0), 
-			btScalar(0.0), btScalar(1.0), btScalar(0.0), 
-			btScalar(0.0), btScalar(0.0), btScalar(1.0)); 
-	}
-
-	static const btMatrix3x3&	getIdentity()
-	{
-		static const btMatrix3x3 identityMatrix(btScalar(1.0), btScalar(0.0), btScalar(0.0), 
-			btScalar(0.0), btScalar(1.0), btScalar(0.0), 
-			btScalar(0.0), btScalar(0.0), btScalar(1.0));
-		return identityMatrix;
-	}
-
-	/**@brief Fill the rotational part of an OpenGL matrix and clear the shear/perspective
-	* @param m The array to be filled */
-	void getOpenGLSubMatrix(btScalar *m) const 
-	{
-		m[0]  = btScalar(m_el[0].x()); 
-		m[1]  = btScalar(m_el[1].x());
-		m[2]  = btScalar(m_el[2].x());
-		m[3]  = btScalar(0.0); 
-		m[4]  = btScalar(m_el[0].y());
-		m[5]  = btScalar(m_el[1].y());
-		m[6]  = btScalar(m_el[2].y());
-		m[7]  = btScalar(0.0); 
-		m[8]  = btScalar(m_el[0].z()); 
-		m[9]  = btScalar(m_el[1].z());
-		m[10] = btScalar(m_el[2].z());
-		m[11] = btScalar(0.0); 
-	}
-
-	/**@brief Get the matrix represented as a quaternion 
-	* @param q The quaternion which will be set */
-	void getRotation(btQuaternion& q) const
-	{
-		btScalar trace = m_el[0].x() + m_el[1].y() + m_el[2].z();
-		btScalar temp[4];
-
-		if (trace > btScalar(0.0)) 
-		{
-			btScalar s = btSqrt(trace + btScalar(1.0));
-			temp[3]=(s * btScalar(0.5));
-			s = btScalar(0.5) / s;
-
-			temp[0]=((m_el[2].y() - m_el[1].z()) * s);
-			temp[1]=((m_el[0].z() - m_el[2].x()) * s);
-			temp[2]=((m_el[1].x() - m_el[0].y()) * s);
-		} 
-		else 
-		{
-			int i = m_el[0].x() < m_el[1].y() ? 
-				(m_el[1].y() < m_el[2].z() ? 2 : 1) :
-				(m_el[0].x() < m_el[2].z() ? 2 : 0); 
-			int j = (i + 1) % 3;  
-			int k = (i + 2) % 3;
-
-			btScalar s = btSqrt(m_el[i][i] - m_el[j][j] - m_el[k][k] + btScalar(1.0));
-			temp[i] = s * btScalar(0.5);
-			s = btScalar(0.5) / s;
-
-			temp[3] = (m_el[k][j] - m_el[j][k]) * s;
-			temp[j] = (m_el[j][i] + m_el[i][j]) * s;
-			temp[k] = (m_el[k][i] + m_el[i][k]) * s;
-		}
-		q.setValue(temp[0],temp[1],temp[2],temp[3]);
-	}
-
-	/**@brief Get the matrix represented as euler angles around YXZ, roundtrip with setEulerYPR
-	* @param yaw Yaw around Y axis
-	* @param pitch Pitch around X axis
-	* @param roll around Z axis */	
-	void getEulerYPR(btScalar& yaw, btScalar& pitch, btScalar& roll) const
-	{
-
-		// first use the normal calculus
-		yaw = btScalar(btAtan2(m_el[1].x(), m_el[0].x()));
-		pitch = btScalar(btAsin(-m_el[2].x()));
-		roll = btScalar(btAtan2(m_el[2].y(), m_el[2].z()));
-
-		// on pitch = +/-HalfPI
-		if (btFabs(pitch)==SIMD_HALF_PI)
-		{
-			if (yaw>0)
-				yaw-=SIMD_PI;
-			else
-				yaw+=SIMD_PI;
-
-			if (roll>0)
-				roll-=SIMD_PI;
-			else
-				roll+=SIMD_PI;
-		}
-	};
-
-
-	/**@brief Get the matrix represented as euler angles around ZYX
-	* @param yaw Yaw around X axis
-	* @param pitch Pitch around Y axis
-	* @param roll around X axis 
-	* @param solution_number Which solution of two possible solutions ( 1 or 2) are possible values*/	
-	void getEulerZYX(btScalar& yaw, btScalar& pitch, btScalar& roll, unsigned int solution_number = 1) const
-	{
-		struct Euler
-		{
-			btScalar yaw;
-			btScalar pitch;
-			btScalar roll;
-		};
-
-		Euler euler_out;
-		Euler euler_out2; //second solution
-		//get the pointer to the raw data
-
-		// Check that pitch is not at a singularity
-		if (btFabs(m_el[2].x()) >= 1)
-		{
-			euler_out.yaw = 0;
-			euler_out2.yaw = 0;
-
-			// From difference of angles formula
-			btScalar delta = btAtan2(m_el[0].x(),m_el[0].z());
-			if (m_el[2].x() > 0)  //gimbal locked up
-			{
-				euler_out.pitch = SIMD_PI / btScalar(2.0);
-				euler_out2.pitch = SIMD_PI / btScalar(2.0);
-				euler_out.roll = euler_out.pitch + delta;
-				euler_out2.roll = euler_out.pitch + delta;
-			}
-			else // gimbal locked down
-			{
-				euler_out.pitch = -SIMD_PI / btScalar(2.0);
-				euler_out2.pitch = -SIMD_PI / btScalar(2.0);
-				euler_out.roll = -euler_out.pitch + delta;
-				euler_out2.roll = -euler_out.pitch + delta;
-			}
-		}
-		else
-		{
-			euler_out.pitch = - btAsin(m_el[2].x());
-			euler_out2.pitch = SIMD_PI - euler_out.pitch;
-
-			euler_out.roll = btAtan2(m_el[2].y()/btCos(euler_out.pitch), 
-				m_el[2].z()/btCos(euler_out.pitch));
-			euler_out2.roll = btAtan2(m_el[2].y()/btCos(euler_out2.pitch), 
-				m_el[2].z()/btCos(euler_out2.pitch));
-
-			euler_out.yaw = btAtan2(m_el[1].x()/btCos(euler_out.pitch), 
-				m_el[0].x()/btCos(euler_out.pitch));
-			euler_out2.yaw = btAtan2(m_el[1].x()/btCos(euler_out2.pitch), 
-				m_el[0].x()/btCos(euler_out2.pitch));
-		}
-
-		if (solution_number == 1)
-		{ 
-			yaw = euler_out.yaw; 
-			pitch = euler_out.pitch;
-			roll = euler_out.roll;
-		}
-		else
-		{ 
-			yaw = euler_out2.yaw; 
-			pitch = euler_out2.pitch;
-			roll = euler_out2.roll;
-		}
-	}
-
-	/**@brief Create a scaled copy of the matrix 
-	* @param s Scaling vector The elements of the vector will scale each column */
-
-	btMatrix3x3 scaled(const btVector3& s) const
-	{
-		return btMatrix3x3(m_el[0].x() * s.x(), m_el[0].y() * s.y(), m_el[0].z() * s.z(),
-			m_el[1].x() * s.x(), m_el[1].y() * s.y(), m_el[1].z() * s.z(),
-			m_el[2].x() * s.x(), m_el[2].y() * s.y(), m_el[2].z() * s.z());
-	}
-
-	/**@brief Return the determinant of the matrix */
-	btScalar            determinant() const;
-	/**@brief Return the adjoint of the matrix */
-	btMatrix3x3 adjoint() const;
-	/**@brief Return the matrix with all values non negative */
-	btMatrix3x3 absolute() const;
-	/**@brief Return the transpose of the matrix */
-	btMatrix3x3 transpose() const;
-	/**@brief Return the inverse of the matrix */
-	btMatrix3x3 inverse() const; 
-
-	btMatrix3x3 transposeTimes(const btMatrix3x3& m) const;
-	btMatrix3x3 timesTranspose(const btMatrix3x3& m) const;
-
-	SIMD_FORCE_INLINE btScalar tdotx(const btVector3& v) const 
-	{
-		return m_el[0].x() * v.x() + m_el[1].x() * v.y() + m_el[2].x() * v.z();
-	}
-	SIMD_FORCE_INLINE btScalar tdoty(const btVector3& v) const 
-	{
-		return m_el[0].y() * v.x() + m_el[1].y() * v.y() + m_el[2].y() * v.z();
-	}
-	SIMD_FORCE_INLINE btScalar tdotz(const btVector3& v) const 
-	{
-		return m_el[0].z() * v.x() + m_el[1].z() * v.y() + m_el[2].z() * v.z();
-	}
-
-
-	/**@brief diagonalizes this matrix by the Jacobi method.
-	* @param rot stores the rotation from the coordinate system in which the matrix is diagonal to the original
-	* coordinate system, i.e., old_this = rot * new_this * rot^T. 
-	* @param threshold See iteration
-	* @param iteration The iteration stops when all off-diagonal elements are less than the threshold multiplied 
-	* by the sum of the absolute values of the diagonal, or when maxSteps have been executed. 
-	* 
-	* Note that this matrix is assumed to be symmetric. 
-	*/
-	void diagonalize(btMatrix3x3& rot, btScalar threshold, int maxSteps)
-	{
-		rot.setIdentity();
-		for (int step = maxSteps; step > 0; step--)
-		{
-			// find off-diagonal element [p][q] with largest magnitude
-			int p = 0;
-			int q = 1;
-			int r = 2;
-			btScalar max = btFabs(m_el[0][1]);
-			btScalar v = btFabs(m_el[0][2]);
-			if (v > max)
-			{
-				q = 2;
-				r = 1;
-				max = v;
-			}
-			v = btFabs(m_el[1][2]);
-			if (v > max)
-			{
-				p = 1;
-				q = 2;
-				r = 0;
-				max = v;
-			}
-
-			btScalar t = threshold * (btFabs(m_el[0][0]) + btFabs(m_el[1][1]) + btFabs(m_el[2][2]));
-			if (max <= t)
-			{
-				if (max <= SIMD_EPSILON * t)
-				{
-					return;
-				}
-				step = 1;
-			}
-
-			// compute Jacobi rotation J which leads to a zero for element [p][q] 
-			btScalar mpq = m_el[p][q];
-			btScalar theta = (m_el[q][q] - m_el[p][p]) / (2 * mpq);
-			btScalar theta2 = theta * theta;
-			btScalar cos;
-			btScalar sin;
-			if (theta2 * theta2 < btScalar(10 / SIMD_EPSILON))
-			{
-				t = (theta >= 0) ? 1 / (theta + btSqrt(1 + theta2))
-					: 1 / (theta - btSqrt(1 + theta2));
-				cos = 1 / btSqrt(1 + t * t);
-				sin = cos * t;
-			}
-			else
-			{
-				// approximation for large theta-value, i.e., a nearly diagonal matrix
-				t = 1 / (theta * (2 + btScalar(0.5) / theta2));
-				cos = 1 - btScalar(0.5) * t * t;
-				sin = cos * t;
-			}
-
-			// apply rotation to matrix (this = J^T * this * J)
-			m_el[p][q] = m_el[q][p] = 0;
-			m_el[p][p] -= t * mpq;
-			m_el[q][q] += t * mpq;
-			btScalar mrp = m_el[r][p];
-			btScalar mrq = m_el[r][q];
-			m_el[r][p] = m_el[p][r] = cos * mrp - sin * mrq;
-			m_el[r][q] = m_el[q][r] = cos * mrq + sin * mrp;
-
-			// apply rotation to rot (rot = rot * J)
-			for (int i = 0; i < 3; i++)
-			{
-				btVector3& row = rot[i];
-				mrp = row[p];
-				mrq = row[q];
-				row[p] = cos * mrp - sin * mrq;
-				row[q] = cos * mrq + sin * mrp;
-			}
-		}
-	}
-
-
-
-
-	/**@brief Calculate the matrix cofactor 
-	* @param r1 The first row to use for calculating the cofactor
-	* @param c1 The first column to use for calculating the cofactor
-	* @param r1 The second row to use for calculating the cofactor
-	* @param c1 The second column to use for calculating the cofactor
-	* See http://en.wikipedia.org/wiki/Cofactor_(linear_algebra) for more details
-	*/
-	btScalar cofac(int r1, int c1, int r2, int c2) const 
-	{
-		return m_el[r1][c1] * m_el[r2][c2] - m_el[r1][c2] * m_el[r2][c1];
-	}
-
-	void	serialize(struct	btMatrix3x3Data& dataOut) const;
-
-	void	serializeFloat(struct	btMatrix3x3FloatData& dataOut) const;
-
-	void	deSerialize(const struct	btMatrix3x3Data& dataIn);
-
-	void	deSerializeFloat(const struct	btMatrix3x3FloatData& dataIn);
-
-	void	deSerializeDouble(const struct	btMatrix3x3DoubleData& dataIn);
-
-};
-
-
-SIMD_FORCE_INLINE btMatrix3x3& 
-btMatrix3x3::operator*=(const btMatrix3x3& m)
-{
-	setValue(m.tdotx(m_el[0]), m.tdoty(m_el[0]), m.tdotz(m_el[0]),
-		m.tdotx(m_el[1]), m.tdoty(m_el[1]), m.tdotz(m_el[1]),
-		m.tdotx(m_el[2]), m.tdoty(m_el[2]), m.tdotz(m_el[2]));
-	return *this;
-}
-
-SIMD_FORCE_INLINE btMatrix3x3& 
-btMatrix3x3::operator+=(const btMatrix3x3& m)
-{
-	setValue(
-		m_el[0][0]+m.m_el[0][0], 
-		m_el[0][1]+m.m_el[0][1],
-		m_el[0][2]+m.m_el[0][2],
-		m_el[1][0]+m.m_el[1][0], 
-		m_el[1][1]+m.m_el[1][1],
-		m_el[1][2]+m.m_el[1][2],
-		m_el[2][0]+m.m_el[2][0], 
-		m_el[2][1]+m.m_el[2][1],
-		m_el[2][2]+m.m_el[2][2]);
-	return *this;
-}
-
-SIMD_FORCE_INLINE btMatrix3x3
-operator*(const btMatrix3x3& m, const btScalar & k)
-{
-	return btMatrix3x3(
-		m[0].x()*k,m[0].y()*k,m[0].z()*k,
-		m[1].x()*k,m[1].y()*k,m[1].z()*k,
-		m[2].x()*k,m[2].y()*k,m[2].z()*k);
-}
-
- SIMD_FORCE_INLINE btMatrix3x3 
-operator+(const btMatrix3x3& m1, const btMatrix3x3& m2)
-{
-	return btMatrix3x3(
-	m1[0][0]+m2[0][0], 
-	m1[0][1]+m2[0][1],
-	m1[0][2]+m2[0][2],
-	m1[1][0]+m2[1][0], 
-	m1[1][1]+m2[1][1],
-	m1[1][2]+m2[1][2],
-	m1[2][0]+m2[2][0], 
-	m1[2][1]+m2[2][1],
-	m1[2][2]+m2[2][2]);
-}
-
-SIMD_FORCE_INLINE btMatrix3x3 
-operator-(const btMatrix3x3& m1, const btMatrix3x3& m2)
-{
-	return btMatrix3x3(
-	m1[0][0]-m2[0][0], 
-	m1[0][1]-m2[0][1],
-	m1[0][2]-m2[0][2],
-	m1[1][0]-m2[1][0], 
-	m1[1][1]-m2[1][1],
-	m1[1][2]-m2[1][2],
-	m1[2][0]-m2[2][0], 
-	m1[2][1]-m2[2][1],
-	m1[2][2]-m2[2][2]);
-}
-
-
-SIMD_FORCE_INLINE btMatrix3x3& 
-btMatrix3x3::operator-=(const btMatrix3x3& m)
-{
-	setValue(
-	m_el[0][0]-m.m_el[0][0], 
-	m_el[0][1]-m.m_el[0][1],
-	m_el[0][2]-m.m_el[0][2],
-	m_el[1][0]-m.m_el[1][0], 
-	m_el[1][1]-m.m_el[1][1],
-	m_el[1][2]-m.m_el[1][2],
-	m_el[2][0]-m.m_el[2][0], 
-	m_el[2][1]-m.m_el[2][1],
-	m_el[2][2]-m.m_el[2][2]);
-	return *this;
-}
-
-
-SIMD_FORCE_INLINE btScalar 
-btMatrix3x3::determinant() const
-{ 
-	return btTriple((*this)[0], (*this)[1], (*this)[2]);
-}
-
-
-SIMD_FORCE_INLINE btMatrix3x3 
-btMatrix3x3::absolute() const
-{
-	return btMatrix3x3(
-		btFabs(m_el[0].x()), btFabs(m_el[0].y()), btFabs(m_el[0].z()),
-		btFabs(m_el[1].x()), btFabs(m_el[1].y()), btFabs(m_el[1].z()),
-		btFabs(m_el[2].x()), btFabs(m_el[2].y()), btFabs(m_el[2].z()));
-}
-
-SIMD_FORCE_INLINE btMatrix3x3 
-btMatrix3x3::transpose() const 
-{
-	return btMatrix3x3(m_el[0].x(), m_el[1].x(), m_el[2].x(),
-		m_el[0].y(), m_el[1].y(), m_el[2].y(),
-		m_el[0].z(), m_el[1].z(), m_el[2].z());
-}
-
-SIMD_FORCE_INLINE btMatrix3x3 
-btMatrix3x3::adjoint() const 
-{
-	return btMatrix3x3(cofac(1, 1, 2, 2), cofac(0, 2, 2, 1), cofac(0, 1, 1, 2),
-		cofac(1, 2, 2, 0), cofac(0, 0, 2, 2), cofac(0, 2, 1, 0),
-		cofac(1, 0, 2, 1), cofac(0, 1, 2, 0), cofac(0, 0, 1, 1));
-}
-
-SIMD_FORCE_INLINE btMatrix3x3 
-btMatrix3x3::inverse() const
-{
-	btVector3 co(cofac(1, 1, 2, 2), cofac(1, 2, 2, 0), cofac(1, 0, 2, 1));
-	btScalar det = (*this)[0].dot(co);
-	btFullAssert(det != btScalar(0.0));
-	btScalar s = btScalar(1.0) / det;
-	return btMatrix3x3(co.x() * s, cofac(0, 2, 2, 1) * s, cofac(0, 1, 1, 2) * s,
-		co.y() * s, cofac(0, 0, 2, 2) * s, cofac(0, 2, 1, 0) * s,
-		co.z() * s, cofac(0, 1, 2, 0) * s, cofac(0, 0, 1, 1) * s);
-}
-
-SIMD_FORCE_INLINE btMatrix3x3 
-btMatrix3x3::transposeTimes(const btMatrix3x3& m) const
-{
-	return btMatrix3x3(
-		m_el[0].x() * m[0].x() + m_el[1].x() * m[1].x() + m_el[2].x() * m[2].x(),
-		m_el[0].x() * m[0].y() + m_el[1].x() * m[1].y() + m_el[2].x() * m[2].y(),
-		m_el[0].x() * m[0].z() + m_el[1].x() * m[1].z() + m_el[2].x() * m[2].z(),
-		m_el[0].y() * m[0].x() + m_el[1].y() * m[1].x() + m_el[2].y() * m[2].x(),
-		m_el[0].y() * m[0].y() + m_el[1].y() * m[1].y() + m_el[2].y() * m[2].y(),
-		m_el[0].y() * m[0].z() + m_el[1].y() * m[1].z() + m_el[2].y() * m[2].z(),
-		m_el[0].z() * m[0].x() + m_el[1].z() * m[1].x() + m_el[2].z() * m[2].x(),
-		m_el[0].z() * m[0].y() + m_el[1].z() * m[1].y() + m_el[2].z() * m[2].y(),
-		m_el[0].z() * m[0].z() + m_el[1].z() * m[1].z() + m_el[2].z() * m[2].z());
-}
-
-SIMD_FORCE_INLINE btMatrix3x3 
-btMatrix3x3::timesTranspose(const btMatrix3x3& m) const
-{
-	return btMatrix3x3(
-		m_el[0].dot(m[0]), m_el[0].dot(m[1]), m_el[0].dot(m[2]),
-		m_el[1].dot(m[0]), m_el[1].dot(m[1]), m_el[1].dot(m[2]),
-		m_el[2].dot(m[0]), m_el[2].dot(m[1]), m_el[2].dot(m[2]));
-
-}
-
-SIMD_FORCE_INLINE btVector3 
-operator*(const btMatrix3x3& m, const btVector3& v) 
-{
-	return btVector3(m[0].dot(v), m[1].dot(v), m[2].dot(v));
-}
-
-
-SIMD_FORCE_INLINE btVector3
-operator*(const btVector3& v, const btMatrix3x3& m)
-{
-	return btVector3(m.tdotx(v), m.tdoty(v), m.tdotz(v));
-}
-
-SIMD_FORCE_INLINE btMatrix3x3 
-operator*(const btMatrix3x3& m1, const btMatrix3x3& m2)
-{
-	return btMatrix3x3(
-		m2.tdotx( m1[0]), m2.tdoty( m1[0]), m2.tdotz( m1[0]),
-		m2.tdotx( m1[1]), m2.tdoty( m1[1]), m2.tdotz( m1[1]),
-		m2.tdotx( m1[2]), m2.tdoty( m1[2]), m2.tdotz( m1[2]));
-}
-
-/*
-SIMD_FORCE_INLINE btMatrix3x3 btMultTransposeLeft(const btMatrix3x3& m1, const btMatrix3x3& m2) {
-return btMatrix3x3(
-m1[0][0] * m2[0][0] + m1[1][0] * m2[1][0] + m1[2][0] * m2[2][0],
-m1[0][0] * m2[0][1] + m1[1][0] * m2[1][1] + m1[2][0] * m2[2][1],
-m1[0][0] * m2[0][2] + m1[1][0] * m2[1][2] + m1[2][0] * m2[2][2],
-m1[0][1] * m2[0][0] + m1[1][1] * m2[1][0] + m1[2][1] * m2[2][0],
-m1[0][1] * m2[0][1] + m1[1][1] * m2[1][1] + m1[2][1] * m2[2][1],
-m1[0][1] * m2[0][2] + m1[1][1] * m2[1][2] + m1[2][1] * m2[2][2],
-m1[0][2] * m2[0][0] + m1[1][2] * m2[1][0] + m1[2][2] * m2[2][0],
-m1[0][2] * m2[0][1] + m1[1][2] * m2[1][1] + m1[2][2] * m2[2][1],
-m1[0][2] * m2[0][2] + m1[1][2] * m2[1][2] + m1[2][2] * m2[2][2]);
-}
-*/
-
-/**@brief Equality operator between two matrices
-* It will test all elements are equal.  */
-SIMD_FORCE_INLINE bool operator==(const btMatrix3x3& m1, const btMatrix3x3& m2)
-{
-	return ( m1[0][0] == m2[0][0] && m1[1][0] == m2[1][0] && m1[2][0] == m2[2][0] &&
-		m1[0][1] == m2[0][1] && m1[1][1] == m2[1][1] && m1[2][1] == m2[2][1] &&
-		m1[0][2] == m2[0][2] && m1[1][2] == m2[1][2] && m1[2][2] == m2[2][2] );
-}
-
-///for serialization
-struct	btMatrix3x3FloatData
-{
-	btVector3FloatData m_el[3];
-};
-
-///for serialization
-struct	btMatrix3x3DoubleData
-{
-	btVector3DoubleData m_el[3];
-};
-
-
-	
-
-SIMD_FORCE_INLINE	void	btMatrix3x3::serialize(struct	btMatrix3x3Data& dataOut) const
-{
-	for (int i=0;i<3;i++)
-		m_el[i].serialize(dataOut.m_el[i]);
-}
-
-SIMD_FORCE_INLINE	void	btMatrix3x3::serializeFloat(struct	btMatrix3x3FloatData& dataOut) const
-{
-	for (int i=0;i<3;i++)
-		m_el[i].serializeFloat(dataOut.m_el[i]);
-}
-
-
-SIMD_FORCE_INLINE	void	btMatrix3x3::deSerialize(const struct	btMatrix3x3Data& dataIn)
-{
-	for (int i=0;i<3;i++)
-		m_el[i].deSerialize(dataIn.m_el[i]);
-}
-
-SIMD_FORCE_INLINE	void	btMatrix3x3::deSerializeFloat(const struct	btMatrix3x3FloatData& dataIn)
-{
-	for (int i=0;i<3;i++)
-		m_el[i].deSerializeFloat(dataIn.m_el[i]);
-}
-
-SIMD_FORCE_INLINE	void	btMatrix3x3::deSerializeDouble(const struct	btMatrix3x3DoubleData& dataIn)
-{
-	for (int i=0;i<3;i++)
-		m_el[i].deSerializeDouble(dataIn.m_el[i]);
-}
-
-#endif //BT_MATRIX3x3_H
-
diff --git a/hkl3d/bullet/src/LinearMath/btMinMax.h b/hkl3d/bullet/src/LinearMath/btMinMax.h
deleted file mode 100644
index bd5d731..0000000
--- a/hkl3d/bullet/src/LinearMath/btMinMax.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
-Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-#ifndef BT_GEN_MINMAX_H
-#define BT_GEN_MINMAX_H
-
-#include "LinearMath/btScalar.h"
-
-template <class T>
-SIMD_FORCE_INLINE const T& btMin(const T& a, const T& b) 
-{
-  return a < b ? a : b ;
-}
-
-template <class T>
-SIMD_FORCE_INLINE const T& btMax(const T& a, const T& b) 
-{
-  return  a > b ? a : b;
-}
-
-template <class T>
-SIMD_FORCE_INLINE const T& btClamped(const T& a, const T& lb, const T& ub) 
-{
-	return a < lb ? lb : (ub < a ? ub : a); 
-}
-
-template <class T>
-SIMD_FORCE_INLINE void btSetMin(T& a, const T& b) 
-{
-    if (b < a) 
-	{
-		a = b;
-	}
-}
-
-template <class T>
-SIMD_FORCE_INLINE void btSetMax(T& a, const T& b) 
-{
-    if (a < b) 
-	{
-		a = b;
-	}
-}
-
-template <class T>
-SIMD_FORCE_INLINE void btClamp(T& a, const T& lb, const T& ub) 
-{
-	if (a < lb) 
-	{
-		a = lb; 
-	}
-	else if (ub < a) 
-	{
-		a = ub;
-	}
-}
-
-#endif //BT_GEN_MINMAX_H
diff --git a/hkl3d/bullet/src/LinearMath/btMotionState.h b/hkl3d/bullet/src/LinearMath/btMotionState.h
deleted file mode 100644
index 9431814..0000000
--- a/hkl3d/bullet/src/LinearMath/btMotionState.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_MOTIONSTATE_H
-#define BT_MOTIONSTATE_H
-
-#include "btTransform.h"
-
-///The btMotionState interface class allows the dynamics world to synchronize and interpolate the updated world transforms with graphics
-///For optimizations, potentially only moving objects get synchronized (using setWorldPosition/setWorldOrientation)
-class	btMotionState
-{
-	public:
-		
-		virtual ~btMotionState()
-		{
-			
-		}
-		
-		virtual void	getWorldTransform(btTransform& worldTrans ) const =0;
-
-		//Bullet only calls the update of worldtransform for active objects
-		virtual void	setWorldTransform(const btTransform& worldTrans)=0;
-		
-	
-};
-
-#endif //BT_MOTIONSTATE_H
diff --git a/hkl3d/bullet/src/LinearMath/btPoolAllocator.h b/hkl3d/bullet/src/LinearMath/btPoolAllocator.h
deleted file mode 100755
index ef20845..0000000
--- a/hkl3d/bullet/src/LinearMath/btPoolAllocator.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef _BT_POOL_ALLOCATOR_H
-#define _BT_POOL_ALLOCATOR_H
-
-#include "btScalar.h"
-#include "btAlignedAllocator.h"
-
-///The btPoolAllocator class allows to efficiently allocate a large pool of objects, instead of dynamically allocating them separately.
-class btPoolAllocator
-{
-	int				m_elemSize;
-	int				m_maxElements;
-	int				m_freeCount;
-	void*			m_firstFree;
-	unsigned char*	m_pool;
-
-public:
-
-	btPoolAllocator(int elemSize, int maxElements)
-		:m_elemSize(elemSize),
-		m_maxElements(maxElements)
-	{
-		m_pool = (unsigned char*) btAlignedAlloc( static_cast<unsigned int>(m_elemSize*m_maxElements),16);
-
-		unsigned char* p = m_pool;
-        m_firstFree = p;
-        m_freeCount = m_maxElements;
-        int count = m_maxElements;
-        while (--count) {
-            *(void**)p = (p + m_elemSize);
-            p += m_elemSize;
-        }
-        *(void**)p = 0;
-    }
-
-	~btPoolAllocator()
-	{
-		btAlignedFree( m_pool);
-	}
-
-	int	getFreeCount() const
-	{
-		return m_freeCount;
-	}
-
-	int getUsedCount() const
-	{
-		return m_maxElements - m_freeCount;
-	}
-
-	int getMaxCount() const
-	{
-		return m_maxElements;
-	}
-
-	void*	allocate(int size)
-	{
-		// release mode fix
-		(void)size;
-		btAssert(!size || size<=m_elemSize);
-		btAssert(m_freeCount>0);
-        void* result = m_firstFree;
-        m_firstFree = *(void**)m_firstFree;
-        --m_freeCount;
-        return result;
-	}
-
-	bool validPtr(void* ptr)
-	{
-		if (ptr) {
-			if (((unsigned char*)ptr >= m_pool && (unsigned char*)ptr < m_pool + m_maxElements * m_elemSize))
-			{
-				return true;
-			}
-		}
-		return false;
-	}
-
-	void	freeMemory(void* ptr)
-	{
-		 if (ptr) {
-            btAssert((unsigned char*)ptr >= m_pool && (unsigned char*)ptr < m_pool + m_maxElements * m_elemSize);
-
-            *(void**)ptr = m_firstFree;
-            m_firstFree = ptr;
-            ++m_freeCount;
-        }
-	}
-
-	int	getElementSize() const
-	{
-		return m_elemSize;
-	}
-
-	unsigned char*	getPoolAddress()
-	{
-		return m_pool;
-	}
-
-	const unsigned char*	getPoolAddress() const
-	{
-		return m_pool;
-	}
-
-};
-
-#endif //_BT_POOL_ALLOCATOR_H
diff --git a/hkl3d/bullet/src/LinearMath/btQuadWord.h b/hkl3d/bullet/src/LinearMath/btQuadWord.h
deleted file mode 100644
index d5e9daa..0000000
--- a/hkl3d/bullet/src/LinearMath/btQuadWord.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
-Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef BT_SIMD_QUADWORD_H
-#define BT_SIMD_QUADWORD_H
-
-#include "btScalar.h"
-#include "btMinMax.h"
-
-
-#if defined (__CELLOS_LV2) && defined (__SPU__)
-#include <altivec.h>
-#endif
-
-/**@brief The btQuadWord class is base class for btVector3 and btQuaternion. 
- * Some issues under PS3 Linux with IBM 2.1 SDK, gcc compiler prevent from using aligned quadword.
- */
-#ifndef USE_LIBSPE2
-ATTRIBUTE_ALIGNED16(class) btQuadWord
-#else
-class btQuadWord
-#endif
-{
-protected:
-
-#if defined (__SPU__) && defined (__CELLOS_LV2__)
-	union {
-		vec_float4 mVec128;
-		btScalar	m_floats[4];
-	};
-public:
-	vec_float4	get128() const
-	{
-		return mVec128;
-	}
-protected:
-#else //__CELLOS_LV2__ __SPU__
-	btScalar	m_floats[4];
-#endif //__CELLOS_LV2__ __SPU__
-
-	public:
-  
-
-  /**@brief Return the x value */
-		SIMD_FORCE_INLINE const btScalar& getX() const { return m_floats[0]; }
-  /**@brief Return the y value */
-		SIMD_FORCE_INLINE const btScalar& getY() const { return m_floats[1]; }
-  /**@brief Return the z value */
-		SIMD_FORCE_INLINE const btScalar& getZ() const { return m_floats[2]; }
-  /**@brief Set the x value */
-		SIMD_FORCE_INLINE void	setX(btScalar x) { m_floats[0] = x;};
-  /**@brief Set the y value */
-		SIMD_FORCE_INLINE void	setY(btScalar y) { m_floats[1] = y;};
-  /**@brief Set the z value */
-		SIMD_FORCE_INLINE void	setZ(btScalar z) { m_floats[2] = z;};
-  /**@brief Set the w value */
-		SIMD_FORCE_INLINE void	setW(btScalar w) { m_floats[3] = w;};
-  /**@brief Return the x value */
-		SIMD_FORCE_INLINE const btScalar& x() const { return m_floats[0]; }
-  /**@brief Return the y value */
-		SIMD_FORCE_INLINE const btScalar& y() const { return m_floats[1]; }
-  /**@brief Return the z value */
-		SIMD_FORCE_INLINE const btScalar& z() const { return m_floats[2]; }
-  /**@brief Return the w value */
-		SIMD_FORCE_INLINE const btScalar& w() const { return m_floats[3]; }
-
-	//SIMD_FORCE_INLINE btScalar&       operator[](int i)       { return (&m_floats[0])[i];	}      
-	//SIMD_FORCE_INLINE const btScalar& operator[](int i) const { return (&m_floats[0])[i]; }
-	///operator btScalar*() replaces operator[], using implicit conversion. We added operator != and operator == to avoid pointer comparisons.
-	SIMD_FORCE_INLINE	operator       btScalar *()       { return &m_floats[0]; }
-	SIMD_FORCE_INLINE	operator const btScalar *() const { return &m_floats[0]; }
-
-	SIMD_FORCE_INLINE	bool	operator==(const btQuadWord& other) const
-	{
-		return ((m_floats[3]==other.m_floats[3]) && (m_floats[2]==other.m_floats[2]) && (m_floats[1]==other.m_floats[1]) && (m_floats[0]==other.m_floats[0]));
-	}
-
-	SIMD_FORCE_INLINE	bool	operator!=(const btQuadWord& other) const
-	{
-		return !(*this == other);
-	}
-
-  /**@brief Set x,y,z and zero w 
-   * @param x Value of x
-   * @param y Value of y
-   * @param z Value of z
-   */
-		SIMD_FORCE_INLINE void 	setValue(const btScalar& x, const btScalar& y, const btScalar& z)
-		{
-			m_floats[0]=x;
-			m_floats[1]=y;
-			m_floats[2]=z;
-			m_floats[3] = 0.f;
-		}
-
-/*		void getValue(btScalar *m) const 
-		{
-			m[0] = m_floats[0];
-			m[1] = m_floats[1];
-			m[2] = m_floats[2];
-		}
-*/
-/**@brief Set the values 
-   * @param x Value of x
-   * @param y Value of y
-   * @param z Value of z
-   * @param w Value of w
-   */
-		SIMD_FORCE_INLINE void	setValue(const btScalar& x, const btScalar& y, const btScalar& z,const btScalar& w)
-		{
-			m_floats[0]=x;
-			m_floats[1]=y;
-			m_floats[2]=z;
-			m_floats[3]=w;
-		}
-  /**@brief No initialization constructor */
-		SIMD_FORCE_INLINE btQuadWord()
-		//	:m_floats[0](btScalar(0.)),m_floats[1](btScalar(0.)),m_floats[2](btScalar(0.)),m_floats[3](btScalar(0.))
-		{
-		}
- 
-  /**@brief Three argument constructor (zeros w)
-   * @param x Value of x
-   * @param y Value of y
-   * @param z Value of z
-   */
-		SIMD_FORCE_INLINE btQuadWord(const btScalar& x, const btScalar& y, const btScalar& z)		
-		{
-			m_floats[0] = x, m_floats[1] = y, m_floats[2] = z, m_floats[3] = 0.0f;
-		}
-
-/**@brief Initializing constructor
-   * @param x Value of x
-   * @param y Value of y
-   * @param z Value of z
-   * @param w Value of w
-   */
-		SIMD_FORCE_INLINE btQuadWord(const btScalar& x, const btScalar& y, const btScalar& z,const btScalar& w) 
-		{
-			m_floats[0] = x, m_floats[1] = y, m_floats[2] = z, m_floats[3] = w;
-		}
-
-  /**@brief Set each element to the max of the current values and the values of another btQuadWord
-   * @param other The other btQuadWord to compare with 
-   */
-		SIMD_FORCE_INLINE void	setMax(const btQuadWord& other)
-		{
-			btSetMax(m_floats[0], other.m_floats[0]);
-			btSetMax(m_floats[1], other.m_floats[1]);
-			btSetMax(m_floats[2], other.m_floats[2]);
-			btSetMax(m_floats[3], other.m_floats[3]);
-		}
-  /**@brief Set each element to the min of the current values and the values of another btQuadWord
-   * @param other The other btQuadWord to compare with 
-   */
-		SIMD_FORCE_INLINE void	setMin(const btQuadWord& other)
-		{
-			btSetMin(m_floats[0], other.m_floats[0]);
-			btSetMin(m_floats[1], other.m_floats[1]);
-			btSetMin(m_floats[2], other.m_floats[2]);
-			btSetMin(m_floats[3], other.m_floats[3]);
-		}
-
-
-
-};
-
-#endif //BT_SIMD_QUADWORD_H
diff --git a/hkl3d/bullet/src/LinearMath/btQuaternion.h b/hkl3d/bullet/src/LinearMath/btQuaternion.h
deleted file mode 100644
index 42e968d..0000000
--- a/hkl3d/bullet/src/LinearMath/btQuaternion.h
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
-Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-#ifndef BT_SIMD__QUATERNION_H_
-#define BT_SIMD__QUATERNION_H_
-
-
-#include "btVector3.h"
-#include "btQuadWord.h"
-
-/**@brief The btQuaternion implements quaternion to perform linear algebra rotations in combination with btMatrix3x3, btVector3 and btTransform. */
-class btQuaternion : public btQuadWord {
-public:
-  /**@brief No initialization constructor */
-	btQuaternion() {}
-
-	//		template <typename btScalar>
-	//		explicit Quaternion(const btScalar *v) : Tuple4<btScalar>(v) {}
-  /**@brief Constructor from scalars */
-	btQuaternion(const btScalar& x, const btScalar& y, const btScalar& z, const btScalar& w) 
-		: btQuadWord(x, y, z, w) 
-	{}
-  /**@brief Axis angle Constructor
-   * @param axis The axis which the rotation is around
-   * @param angle The magnitude of the rotation around the angle (Radians) */
-	btQuaternion(const btVector3& axis, const btScalar& angle) 
-	{ 
-		setRotation(axis, angle); 
-	}
-  /**@brief Constructor from Euler angles
-   * @param yaw Angle around Y unless BT_EULER_DEFAULT_ZYX defined then Z
-   * @param pitch Angle around X unless BT_EULER_DEFAULT_ZYX defined then Y
-   * @param roll Angle around Z unless BT_EULER_DEFAULT_ZYX defined then X */
-	btQuaternion(const btScalar& yaw, const btScalar& pitch, const btScalar& roll)
-	{ 
-#ifndef BT_EULER_DEFAULT_ZYX
-		setEuler(yaw, pitch, roll); 
-#else
-		setEulerZYX(yaw, pitch, roll); 
-#endif 
-	}
-  /**@brief Set the rotation using axis angle notation 
-   * @param axis The axis around which to rotate
-   * @param angle The magnitude of the rotation in Radians */
-	void setRotation(const btVector3& axis, const btScalar& angle)
-	{
-		btScalar d = axis.length();
-		btAssert(d != btScalar(0.0));
-		btScalar s = btSin(angle * btScalar(0.5)) / d;
-		setValue(axis.x() * s, axis.y() * s, axis.z() * s, 
-			btCos(angle * btScalar(0.5)));
-	}
-  /**@brief Set the quaternion using Euler angles
-   * @param yaw Angle around Y
-   * @param pitch Angle around X
-   * @param roll Angle around Z */
-	void setEuler(const btScalar& yaw, const btScalar& pitch, const btScalar& roll)
-	{
-		btScalar halfYaw = btScalar(yaw) * btScalar(0.5);  
-		btScalar halfPitch = btScalar(pitch) * btScalar(0.5);  
-		btScalar halfRoll = btScalar(roll) * btScalar(0.5);  
-		btScalar cosYaw = btCos(halfYaw);
-		btScalar sinYaw = btSin(halfYaw);
-		btScalar cosPitch = btCos(halfPitch);
-		btScalar sinPitch = btSin(halfPitch);
-		btScalar cosRoll = btCos(halfRoll);
-		btScalar sinRoll = btSin(halfRoll);
-		setValue(cosRoll * sinPitch * cosYaw + sinRoll * cosPitch * sinYaw,
-			cosRoll * cosPitch * sinYaw - sinRoll * sinPitch * cosYaw,
-			sinRoll * cosPitch * cosYaw - cosRoll * sinPitch * sinYaw,
-			cosRoll * cosPitch * cosYaw + sinRoll * sinPitch * sinYaw);
-	}
-  /**@brief Set the quaternion using euler angles 
-   * @param yaw Angle around Z
-   * @param pitch Angle around Y
-   * @param roll Angle around X */
-	void setEulerZYX(const btScalar& yaw, const btScalar& pitch, const btScalar& roll)
-	{
-		btScalar halfYaw = btScalar(yaw) * btScalar(0.5);  
-		btScalar halfPitch = btScalar(pitch) * btScalar(0.5);  
-		btScalar halfRoll = btScalar(roll) * btScalar(0.5);  
-		btScalar cosYaw = btCos(halfYaw);
-		btScalar sinYaw = btSin(halfYaw);
-		btScalar cosPitch = btCos(halfPitch);
-		btScalar sinPitch = btSin(halfPitch);
-		btScalar cosRoll = btCos(halfRoll);
-		btScalar sinRoll = btSin(halfRoll);
-		setValue(sinRoll * cosPitch * cosYaw - cosRoll * sinPitch * sinYaw, //x
-                         cosRoll * sinPitch * cosYaw + sinRoll * cosPitch * sinYaw, //y
-                         cosRoll * cosPitch * sinYaw - sinRoll * sinPitch * cosYaw, //z
-                         cosRoll * cosPitch * cosYaw + sinRoll * sinPitch * sinYaw); //formerly yzx
-	}
-  /**@brief Add two quaternions
-   * @param q The quaternion to add to this one */
-	SIMD_FORCE_INLINE	btQuaternion& operator+=(const btQuaternion& q)
-	{
-		m_floats[0] += q.x(); m_floats[1] += q.y(); m_floats[2] += q.z(); m_floats[3] += q.m_floats[3];
-		return *this;
-	}
-
-  /**@brief Subtract out a quaternion
-   * @param q The quaternion to subtract from this one */
-	btQuaternion& operator-=(const btQuaternion& q) 
-	{
-		m_floats[0] -= q.x(); m_floats[1] -= q.y(); m_floats[2] -= q.z(); m_floats[3] -= q.m_floats[3];
-		return *this;
-	}
-
-  /**@brief Scale this quaternion
-   * @param s The scalar to scale by */
-	btQuaternion& operator*=(const btScalar& s)
-	{
-		m_floats[0] *= s; m_floats[1] *= s; m_floats[2] *= s; m_floats[3] *= s;
-		return *this;
-	}
-
-  /**@brief Multiply this quaternion by q on the right
-   * @param q The other quaternion 
-   * Equivilant to this = this * q */
-	btQuaternion& operator*=(const btQuaternion& q)
-	{
-		setValue(m_floats[3] * q.x() + m_floats[0] * q.m_floats[3] + m_floats[1] * q.z() - m_floats[2] * q.y(),
-			m_floats[3] * q.y() + m_floats[1] * q.m_floats[3] + m_floats[2] * q.x() - m_floats[0] * q.z(),
-			m_floats[3] * q.z() + m_floats[2] * q.m_floats[3] + m_floats[0] * q.y() - m_floats[1] * q.x(),
-			m_floats[3] * q.m_floats[3] - m_floats[0] * q.x() - m_floats[1] * q.y() - m_floats[2] * q.z());
-		return *this;
-	}
-  /**@brief Return the dot product between this quaternion and another
-   * @param q The other quaternion */
-	btScalar dot(const btQuaternion& q) const
-	{
-		return m_floats[0] * q.x() + m_floats[1] * q.y() + m_floats[2] * q.z() + m_floats[3] * q.m_floats[3];
-	}
-
-  /**@brief Return the length squared of the quaternion */
-	btScalar length2() const
-	{
-		return dot(*this);
-	}
-
-  /**@brief Return the length of the quaternion */
-	btScalar length() const
-	{
-		return btSqrt(length2());
-	}
-
-  /**@brief Normalize the quaternion 
-   * Such that x^2 + y^2 + z^2 +w^2 = 1 */
-	btQuaternion& normalize() 
-	{
-		return *this /= length();
-	}
-
-  /**@brief Return a scaled version of this quaternion
-   * @param s The scale factor */
-	SIMD_FORCE_INLINE btQuaternion
-	operator*(const btScalar& s) const
-	{
-		return btQuaternion(x() * s, y() * s, z() * s, m_floats[3] * s);
-	}
-
-
-  /**@brief Return an inversely scaled versionof this quaternion
-   * @param s The inverse scale factor */
-	btQuaternion operator/(const btScalar& s) const
-	{
-		btAssert(s != btScalar(0.0));
-		return *this * (btScalar(1.0) / s);
-	}
-
-  /**@brief Inversely scale this quaternion
-   * @param s The scale factor */
-	btQuaternion& operator/=(const btScalar& s) 
-	{
-		btAssert(s != btScalar(0.0));
-		return *this *= btScalar(1.0) / s;
-	}
-
-  /**@brief Return a normalized version of this quaternion */
-	btQuaternion normalized() const 
-	{
-		return *this / length();
-	} 
-  /**@brief Return the angle between this quaternion and the other 
-   * @param q The other quaternion */
-	btScalar angle(const btQuaternion& q) const 
-	{
-		btScalar s = btSqrt(length2() * q.length2());
-		btAssert(s != btScalar(0.0));
-		return btAcos(dot(q) / s);
-	}
-  /**@brief Return the angle of rotation represented by this quaternion */
-	btScalar getAngle() const 
-	{
-		btScalar s = btScalar(2.) * btAcos(m_floats[3]);
-		return s;
-	}
-
-	/**@brief Return the axis of the rotation represented by this quaternion */
-	btVector3 getAxis() const
-	{
-		btScalar s_squared = btScalar(1.) - btPow(m_floats[3], btScalar(2.));
-		if (s_squared < btScalar(10.) * SIMD_EPSILON) //Check for divide by zero
-			return btVector3(1.0, 0.0, 0.0);  // Arbitrary
-		btScalar s = btSqrt(s_squared);
-		return btVector3(m_floats[0] / s, m_floats[1] / s, m_floats[2] / s);
-	}
-
-	/**@brief Return the inverse of this quaternion */
-	btQuaternion inverse() const
-	{
-		return btQuaternion(-m_floats[0], -m_floats[1], -m_floats[2], m_floats[3]);
-	}
-
-  /**@brief Return the sum of this quaternion and the other 
-   * @param q2 The other quaternion */
-	SIMD_FORCE_INLINE btQuaternion
-	operator+(const btQuaternion& q2) const
-	{
-		const btQuaternion& q1 = *this;
-		return btQuaternion(q1.x() + q2.x(), q1.y() + q2.y(), q1.z() + q2.z(), q1.m_floats[3] + q2.m_floats[3]);
-	}
-
-  /**@brief Return the difference between this quaternion and the other 
-   * @param q2 The other quaternion */
-	SIMD_FORCE_INLINE btQuaternion
-	operator-(const btQuaternion& q2) const
-	{
-		const btQuaternion& q1 = *this;
-		return btQuaternion(q1.x() - q2.x(), q1.y() - q2.y(), q1.z() - q2.z(), q1.m_floats[3] - q2.m_floats[3]);
-	}
-
-  /**@brief Return the negative of this quaternion 
-   * This simply negates each element */
-	SIMD_FORCE_INLINE btQuaternion operator-() const
-	{
-		const btQuaternion& q2 = *this;
-		return btQuaternion( - q2.x(), - q2.y(),  - q2.z(),  - q2.m_floats[3]);
-	}
-  /**@todo document this and it's use */
-	SIMD_FORCE_INLINE btQuaternion farthest( const btQuaternion& qd) const 
-	{
-		btQuaternion diff,sum;
-		diff = *this - qd;
-		sum = *this + qd;
-		if( diff.dot(diff) > sum.dot(sum) )
-			return qd;
-		return (-qd);
-	}
-
-	/**@todo document this and it's use */
-	SIMD_FORCE_INLINE btQuaternion nearest( const btQuaternion& qd) const 
-	{
-		btQuaternion diff,sum;
-		diff = *this - qd;
-		sum = *this + qd;
-		if( diff.dot(diff) < sum.dot(sum) )
-			return qd;
-		return (-qd);
-	}
-
-
-  /**@brief Return the quaternion which is the result of Spherical Linear Interpolation between this and the other quaternion
-   * @param q The other quaternion to interpolate with 
-   * @param t The ratio between this and q to interpolate.  If t = 0 the result is this, if t=1 the result is q.
-   * Slerp interpolates assuming constant velocity.  */
-	btQuaternion slerp(const btQuaternion& q, const btScalar& t) const
-	{
-		btScalar theta = angle(q);
-		if (theta != btScalar(0.0))
-		{
-			btScalar d = btScalar(1.0) / btSin(theta);
-			btScalar s0 = btSin((btScalar(1.0) - t) * theta);
-			btScalar s1 = btSin(t * theta);   
-                        if (dot(q) < 0) // Take care of long angle case see http://en.wikipedia.org/wiki/Slerp
-                          return btQuaternion((m_floats[0] * s0 + -q.x() * s1) * d,
-                                              (m_floats[1] * s0 + -q.y() * s1) * d,
-                                              (m_floats[2] * s0 + -q.z() * s1) * d,
-                                              (m_floats[3] * s0 + -q.m_floats[3] * s1) * d);
-                        else
-                          return btQuaternion((m_floats[0] * s0 + q.x() * s1) * d,
-                                              (m_floats[1] * s0 + q.y() * s1) * d,
-                                              (m_floats[2] * s0 + q.z() * s1) * d,
-                                              (m_floats[3] * s0 + q.m_floats[3] * s1) * d);
-                        
-		}
-		else
-		{
-			return *this;
-		}
-	}
-
-	static const btQuaternion&	getIdentity()
-	{
-		static const btQuaternion identityQuat(btScalar(0.),btScalar(0.),btScalar(0.),btScalar(1.));
-		return identityQuat;
-	}
-
-	SIMD_FORCE_INLINE const btScalar& getW() const { return m_floats[3]; }
-
-	
-};
-
-
-/**@brief Return the negative of a quaternion */
-SIMD_FORCE_INLINE btQuaternion
-operator-(const btQuaternion& q)
-{
-	return btQuaternion(-q.x(), -q.y(), -q.z(), -q.w());
-}
-
-
-
-/**@brief Return the product of two quaternions */
-SIMD_FORCE_INLINE btQuaternion
-operator*(const btQuaternion& q1, const btQuaternion& q2) {
-	return btQuaternion(q1.w() * q2.x() + q1.x() * q2.w() + q1.y() * q2.z() - q1.z() * q2.y(),
-		q1.w() * q2.y() + q1.y() * q2.w() + q1.z() * q2.x() - q1.x() * q2.z(),
-		q1.w() * q2.z() + q1.z() * q2.w() + q1.x() * q2.y() - q1.y() * q2.x(),
-		q1.w() * q2.w() - q1.x() * q2.x() - q1.y() * q2.y() - q1.z() * q2.z()); 
-}
-
-SIMD_FORCE_INLINE btQuaternion
-operator*(const btQuaternion& q, const btVector3& w)
-{
-	return btQuaternion( q.w() * w.x() + q.y() * w.z() - q.z() * w.y(),
-		q.w() * w.y() + q.z() * w.x() - q.x() * w.z(),
-		q.w() * w.z() + q.x() * w.y() - q.y() * w.x(),
-		-q.x() * w.x() - q.y() * w.y() - q.z() * w.z()); 
-}
-
-SIMD_FORCE_INLINE btQuaternion
-operator*(const btVector3& w, const btQuaternion& q)
-{
-	return btQuaternion( w.x() * q.w() + w.y() * q.z() - w.z() * q.y(),
-		w.y() * q.w() + w.z() * q.x() - w.x() * q.z(),
-		w.z() * q.w() + w.x() * q.y() - w.y() * q.x(),
-		-w.x() * q.x() - w.y() * q.y() - w.z() * q.z()); 
-}
-
-/**@brief Calculate the dot product between two quaternions */
-SIMD_FORCE_INLINE btScalar 
-dot(const btQuaternion& q1, const btQuaternion& q2) 
-{ 
-	return q1.dot(q2); 
-}
-
-
-/**@brief Return the length of a quaternion */
-SIMD_FORCE_INLINE btScalar
-length(const btQuaternion& q) 
-{ 
-	return q.length(); 
-}
-
-/**@brief Return the angle between two quaternions*/
-SIMD_FORCE_INLINE btScalar
-angle(const btQuaternion& q1, const btQuaternion& q2) 
-{ 
-	return q1.angle(q2); 
-}
-
-/**@brief Return the inverse of a quaternion*/
-SIMD_FORCE_INLINE btQuaternion
-inverse(const btQuaternion& q) 
-{
-	return q.inverse();
-}
-
-/**@brief Return the result of spherical linear interpolation betwen two quaternions 
- * @param q1 The first quaternion
- * @param q2 The second quaternion 
- * @param t The ration between q1 and q2.  t = 0 return q1, t=1 returns q2 
- * Slerp assumes constant velocity between positions. */
-SIMD_FORCE_INLINE btQuaternion
-slerp(const btQuaternion& q1, const btQuaternion& q2, const btScalar& t) 
-{
-	return q1.slerp(q2, t);
-}
-
-SIMD_FORCE_INLINE btVector3 
-quatRotate(const btQuaternion& rotation, const btVector3& v) 
-{
-	btQuaternion q = rotation * v;
-	q *= rotation.inverse();
-	return btVector3(q.getX(),q.getY(),q.getZ());
-}
-
-SIMD_FORCE_INLINE btQuaternion 
-shortestArcQuat(const btVector3& v0, const btVector3& v1) // Game Programming Gems 2.10. make sure v0,v1 are normalized
-{
-	btVector3 c = v0.cross(v1);
-	btScalar  d = v0.dot(v1);
-
-	if (d < -1.0 + SIMD_EPSILON)
-	{
-		btVector3 n,unused;
-		btPlaneSpace1(v0,n,unused);
-		return btQuaternion(n.x(),n.y(),n.z(),0.0f); // just pick any vector that is orthogonal to v0
-	}
-
-	btScalar  s = btSqrt((1.0f + d) * 2.0f);
-	btScalar rs = 1.0f / s;
-
-	return btQuaternion(c.getX()*rs,c.getY()*rs,c.getZ()*rs,s * 0.5f);
-}
-
-SIMD_FORCE_INLINE btQuaternion 
-shortestArcQuatNormalize2(btVector3& v0,btVector3& v1)
-{
-	v0.normalize();
-	v1.normalize();
-	return shortestArcQuat(v0,v1);
-}
-
-#endif //BT_SIMD__QUATERNION_H_
-
-
-
-
diff --git a/hkl3d/bullet/src/LinearMath/btQuickprof.cpp b/hkl3d/bullet/src/LinearMath/btQuickprof.cpp
deleted file mode 100644
index 1453406..0000000
--- a/hkl3d/bullet/src/LinearMath/btQuickprof.cpp
+++ /dev/null
@@ -1,565 +0,0 @@
-/*
-
-***************************************************************************************************
-**
-** profile.cpp
-**
-** Real-Time Hierarchical Profiling for Game Programming Gems 3
-**
-** by Greg Hjelstrom & Byon Garrabrant
-**
-***************************************************************************************************/
-
-// Credits: The Clock class was inspired by the Timer classes in 
-// Ogre (www.ogre3d.org).
-
-#include "btQuickprof.h"
-
-#ifndef BT_NO_PROFILE
-
-
-static btClock gProfileClock;
-
-
-#ifdef __CELLOS_LV2__
-#include <sys/sys_time.h>
-#include <sys/time_util.h>
-#include <stdio.h>
-#endif
-
-#if defined (SUNOS) || defined (__SUNOS__) 
-#include <stdio.h> 
-#endif
-
-#if defined(WIN32) || defined(_WIN32)
-
-#define BT_USE_WINDOWS_TIMERS
-#define WIN32_LEAN_AND_MEAN
-#define NOWINRES
-#define NOMCX
-#define NOIME 
-
-#ifdef _XBOX
-	#include <Xtl.h>
-#else //_XBOX
-	#include <windows.h>
-#endif //_XBOX
-
-#include <time.h>
-
-
-#else //_WIN32
-#include <sys/time.h>
-#endif //_WIN32
-
-#define mymin(a,b) (a > b ? a : b)
-
-struct btClockData
-{
-
-#ifdef BT_USE_WINDOWS_TIMERS
-	LARGE_INTEGER mClockFrequency;
-	DWORD mStartTick;
-	LONGLONG mPrevElapsedTime;
-	LARGE_INTEGER mStartTime;
-#else
-#ifdef __CELLOS_LV2__
-	uint64_t	mStartTime;
-#else
-	struct timeval mStartTime;
-#endif
-#endif //__CELLOS_LV2__
-
-};
-
-///The btClock is a portable basic clock that measures accurate time in seconds, use for profiling.
-btClock::btClock()
-{
-	m_data = new btClockData;
-#ifdef BT_USE_WINDOWS_TIMERS
-	QueryPerformanceFrequency(&m_data->mClockFrequency);
-#endif
-	reset();
-}
-
-btClock::~btClock()
-{
-	delete m_data;
-}
-
-btClock::btClock(const btClock& other)
-{
-	m_data = new btClockData;
-	*m_data = *other.m_data;
-}
-
-btClock& btClock::operator=(const btClock& other)
-{
-	*m_data = *other.m_data;
-	return *this;
-}
-
-
-	/// Resets the initial reference time.
-void btClock::reset()
-{
-#ifdef BT_USE_WINDOWS_TIMERS
-	QueryPerformanceCounter(&m_data->mStartTime);
-	m_data->mStartTick = GetTickCount();
-	m_data->mPrevElapsedTime = 0;
-#else
-#ifdef __CELLOS_LV2__
-
-	typedef uint64_t  ClockSize;
-	ClockSize newTime;
-	//__asm __volatile__( "mftb %0" : "=r" (newTime) : : "memory");
-	SYS_TIMEBASE_GET( newTime );
-	m_data->mStartTime = newTime;
-#else
-	gettimeofday(&m_data->mStartTime, 0);
-#endif
-#endif
-}
-
-/// Returns the time in ms since the last call to reset or since 
-/// the btClock was created.
-unsigned long int btClock::getTimeMilliseconds()
-{
-#ifdef BT_USE_WINDOWS_TIMERS
-	LARGE_INTEGER currentTime;
-	QueryPerformanceCounter(&currentTime);
-	LONGLONG elapsedTime = currentTime.QuadPart - 
-		m_data->mStartTime.QuadPart;
-		// Compute the number of millisecond ticks elapsed.
-	unsigned long msecTicks = (unsigned long)(1000 * elapsedTime / 
-		m_data->mClockFrequency.QuadPart);
-		// Check for unexpected leaps in the Win32 performance counter.  
-	// (This is caused by unexpected data across the PCI to ISA 
-		// bridge, aka south bridge.  See Microsoft KB274323.)
-		unsigned long elapsedTicks = GetTickCount() - m_data->mStartTick;
-		signed long msecOff = (signed long)(msecTicks - elapsedTicks);
-		if (msecOff < -100 || msecOff > 100)
-		{
-			// Adjust the starting time forwards.
-			LONGLONG msecAdjustment = mymin(msecOff * 
-				m_data->mClockFrequency.QuadPart / 1000, elapsedTime - 
-				m_data->mPrevElapsedTime);
-			m_data->mStartTime.QuadPart += msecAdjustment;
-			elapsedTime -= msecAdjustment;
-
-			// Recompute the number of millisecond ticks elapsed.
-			msecTicks = (unsigned long)(1000 * elapsedTime / 
-				m_data->mClockFrequency.QuadPart);
-		}
-
-		// Store the current elapsed time for adjustments next time.
-		m_data->mPrevElapsedTime = elapsedTime;
-
-		return msecTicks;
-#else
-
-#ifdef __CELLOS_LV2__
-		uint64_t freq=sys_time_get_timebase_frequency();
-		double dFreq=((double) freq) / 1000.0;
-		typedef uint64_t  ClockSize;
-		ClockSize newTime;
-		SYS_TIMEBASE_GET( newTime );
-		//__asm __volatile__( "mftb %0" : "=r" (newTime) : : "memory");
-
-		return (unsigned long int)((double(newTime-m_data->mStartTime)) / dFreq);
-#else
-
-		struct timeval currentTime;
-		gettimeofday(&currentTime, 0);
-		return (currentTime.tv_sec - m_data->mStartTime.tv_sec) * 1000 + 
-			(currentTime.tv_usec - m_data->mStartTime.tv_usec) / 1000;
-#endif //__CELLOS_LV2__
-#endif
-}
-
-	/// Returns the time in us since the last call to reset or since 
-	/// the Clock was created.
-unsigned long int btClock::getTimeMicroseconds()
-{
-#ifdef BT_USE_WINDOWS_TIMERS
-		LARGE_INTEGER currentTime;
-		QueryPerformanceCounter(&currentTime);
-		LONGLONG elapsedTime = currentTime.QuadPart - 
-			m_data->mStartTime.QuadPart;
-
-		// Compute the number of millisecond ticks elapsed.
-		unsigned long msecTicks = (unsigned long)(1000 * elapsedTime / 
-			m_data->mClockFrequency.QuadPart);
-
-		// Check for unexpected leaps in the Win32 performance counter.  
-		// (This is caused by unexpected data across the PCI to ISA 
-		// bridge, aka south bridge.  See Microsoft KB274323.)
-		unsigned long elapsedTicks = GetTickCount() - m_data->mStartTick;
-		signed long msecOff = (signed long)(msecTicks - elapsedTicks);
-		if (msecOff < -100 || msecOff > 100)
-		{
-			// Adjust the starting time forwards.
-			LONGLONG msecAdjustment = mymin(msecOff * 
-				m_data->mClockFrequency.QuadPart / 1000, elapsedTime - 
-				m_data->mPrevElapsedTime);
-			m_data->mStartTime.QuadPart += msecAdjustment;
-			elapsedTime -= msecAdjustment;
-		}
-
-		// Store the current elapsed time for adjustments next time.
-		m_data->mPrevElapsedTime = elapsedTime;
-
-		// Convert to microseconds.
-		unsigned long usecTicks = (unsigned long)(1000000 * elapsedTime / 
-			m_data->mClockFrequency.QuadPart);
-
-		return usecTicks;
-#else
-
-#ifdef __CELLOS_LV2__
-		uint64_t freq=sys_time_get_timebase_frequency();
-		double dFreq=((double) freq)/ 1000000.0;
-		typedef uint64_t  ClockSize;
-		ClockSize newTime;
-		//__asm __volatile__( "mftb %0" : "=r" (newTime) : : "memory");
-		SYS_TIMEBASE_GET( newTime );
-
-		return (unsigned long int)((double(newTime-m_data->mStartTime)) / dFreq);
-#else
-
-		struct timeval currentTime;
-		gettimeofday(&currentTime, 0);
-		return (currentTime.tv_sec - m_data->mStartTime.tv_sec) * 1000000 + 
-			(currentTime.tv_usec - m_data->mStartTime.tv_usec);
-#endif//__CELLOS_LV2__
-#endif 
-}
-
-
-
-
-
-inline void Profile_Get_Ticks(unsigned long int * ticks)
-{
-	*ticks = gProfileClock.getTimeMicroseconds();
-}
-
-inline float Profile_Get_Tick_Rate(void)
-{
-//	return 1000000.f;
-	return 1000.f;
-
-}
-
-
-
-/***************************************************************************************************
-**
-** CProfileNode
-**
-***************************************************************************************************/
-
-/***********************************************************************************************
- * INPUT:                                                                                      *
- * name - pointer to a static string which is the name of this profile node                    *
- * parent - parent pointer                                                                     *
- *                                                                                             *
- * WARNINGS:                                                                                   *
- * The name is assumed to be a static pointer, only the pointer is stored and compared for     *
- * efficiency reasons.                                                                         *
- *=============================================================================================*/
-CProfileNode::CProfileNode( const char * name, CProfileNode * parent ) :
-	Name( name ),
-	TotalCalls( 0 ),
-	TotalTime( 0 ),
-	StartTime( 0 ),
-	RecursionCounter( 0 ),
-	Parent( parent ),
-	Child( NULL ),
-	Sibling( NULL )
-{
-	Reset();
-}
-
-
-void	CProfileNode::CleanupMemory()
-{
-	delete ( Child);
-	Child = NULL;
-	delete ( Sibling);
-	Sibling = NULL;
-}
-
-CProfileNode::~CProfileNode( void )
-{
-	delete ( Child);
-	delete ( Sibling);
-}
-
-
-/***********************************************************************************************
- * INPUT:                                                                                      *
- * name - static string pointer to the name of the node we are searching for                   *
- *                                                                                             *
- * WARNINGS:                                                                                   *
- * All profile names are assumed to be static strings so this function uses pointer compares   *
- * to find the named node.                                                                     *
- *=============================================================================================*/
-CProfileNode * CProfileNode::Get_Sub_Node( const char * name )
-{
-	// Try to find this sub node
-	CProfileNode * child = Child;
-	while ( child ) {
-		if ( child->Name == name ) {
-			return child;
-		}
-		child = child->Sibling;
-	}
-
-	// We didn't find it, so add it
-	
-	CProfileNode * node = new CProfileNode( name, this );
-	node->Sibling = Child;
-	Child = node;
-	return node;
-}
-
-
-void	CProfileNode::Reset( void )
-{
-	TotalCalls = 0;
-	TotalTime = 0.0f;
-	
-
-	if ( Child ) {
-		Child->Reset();
-	}
-	if ( Sibling ) {
-		Sibling->Reset();
-	}
-}
-
-
-void	CProfileNode::Call( void )
-{
-	TotalCalls++;
-	if (RecursionCounter++ == 0) {
-		Profile_Get_Ticks(&StartTime);
-	}
-}
-
-
-bool	CProfileNode::Return( void )
-{
-	if ( --RecursionCounter == 0 && TotalCalls != 0 ) { 
-		unsigned long int time;
-		Profile_Get_Ticks(&time);
-		time-=StartTime;
-		TotalTime += (float)time / Profile_Get_Tick_Rate();
-	}
-	return ( RecursionCounter == 0 );
-}
-
-
-/***************************************************************************************************
-**
-** CProfileIterator
-**
-***************************************************************************************************/
-CProfileIterator::CProfileIterator( CProfileNode * start )
-{
-	CurrentParent = start;
-	CurrentChild = CurrentParent->Get_Child();
-}
-
-
-void	CProfileIterator::First(void)
-{
-	CurrentChild = CurrentParent->Get_Child();
-}
-
-
-void	CProfileIterator::Next(void)
-{
-	CurrentChild = CurrentChild->Get_Sibling();
-}
-
-
-bool	CProfileIterator::Is_Done(void)
-{
-	return CurrentChild == NULL;
-}
-
-
-void	CProfileIterator::Enter_Child( int index )
-{
-	CurrentChild = CurrentParent->Get_Child();
-	while ( (CurrentChild != NULL) && (index != 0) ) {
-		index--;
-		CurrentChild = CurrentChild->Get_Sibling();
-	}
-
-	if ( CurrentChild != NULL ) {
-		CurrentParent = CurrentChild;
-		CurrentChild = CurrentParent->Get_Child();
-	}
-}
-
-
-void	CProfileIterator::Enter_Parent( void )
-{
-	if ( CurrentParent->Get_Parent() != NULL ) {
-		CurrentParent = CurrentParent->Get_Parent();
-	}
-	CurrentChild = CurrentParent->Get_Child();
-}
-
-
-/***************************************************************************************************
-**
-** CProfileManager
-**
-***************************************************************************************************/
-
-CProfileNode	CProfileManager::Root( "Root", NULL );
-CProfileNode *	CProfileManager::CurrentNode = &CProfileManager::Root;
-int				CProfileManager::FrameCounter = 0;
-unsigned long int			CProfileManager::ResetTime = 0;
-
-
-/***********************************************************************************************
- * CProfileManager::Start_Profile -- Begin a named profile                                    *
- *                                                                                             *
- * Steps one level deeper into the tree, if a child already exists with the specified name     *
- * then it accumulates the profiling; otherwise a new child node is added to the profile tree. *
- *                                                                                             *
- * INPUT:                                                                                      *
- * name - name of this profiling record                                                        *
- *                                                                                             *
- * WARNINGS:                                                                                   *
- * The string used is assumed to be a static string; pointer compares are used throughout      *
- * the profiling code for efficiency.                                                          *
- *=============================================================================================*/
-void	CProfileManager::Start_Profile( const char * name )
-{
-	if (name != CurrentNode->Get_Name()) {
-		CurrentNode = CurrentNode->Get_Sub_Node( name );
-	} 
-	
-	CurrentNode->Call();
-}
-
-
-/***********************************************************************************************
- * CProfileManager::Stop_Profile -- Stop timing and record the results.                       *
- *=============================================================================================*/
-void	CProfileManager::Stop_Profile( void )
-{
-	// Return will indicate whether we should back up to our parent (we may
-	// be profiling a recursive function)
-	if (CurrentNode->Return()) {
-		CurrentNode = CurrentNode->Get_Parent();
-	}
-}
-
-
-/***********************************************************************************************
- * CProfileManager::Reset -- Reset the contents of the profiling system                       *
- *                                                                                             *
- *    This resets everything except for the tree structure.  All of the timing data is reset.  *
- *=============================================================================================*/
-void	CProfileManager::Reset( void )
-{ 
-	gProfileClock.reset();
-	Root.Reset();
-    Root.Call();
-	FrameCounter = 0;
-	Profile_Get_Ticks(&ResetTime);
-}
-
-
-/***********************************************************************************************
- * CProfileManager::Increment_Frame_Counter -- Increment the frame counter                    *
- *=============================================================================================*/
-void CProfileManager::Increment_Frame_Counter( void )
-{
-	FrameCounter++;
-}
-
-
-/***********************************************************************************************
- * CProfileManager::Get_Time_Since_Reset -- returns the elapsed time since last reset         *
- *=============================================================================================*/
-float CProfileManager::Get_Time_Since_Reset( void )
-{
-	unsigned long int time;
-	Profile_Get_Ticks(&time);
-	time -= ResetTime;
-	return (float)time / Profile_Get_Tick_Rate();
-}
-
-#include <stdio.h>
-
-void	CProfileManager::dumpRecursive(CProfileIterator* profileIterator, int spacing)
-{
-	profileIterator->First();
-	if (profileIterator->Is_Done())
-		return;
-
-	float accumulated_time=0,parent_time = profileIterator->Is_Root() ? CProfileManager::Get_Time_Since_Reset() : profileIterator->Get_Current_Parent_Total_Time();
-	int i;
-	int frames_since_reset = CProfileManager::Get_Frame_Count_Since_Reset();
-	for (i=0;i<spacing;i++)	printf(".");
-	printf("----------------------------------\n");
-	for (i=0;i<spacing;i++)	printf(".");
-	printf("Profiling: %s (total running time: %.3f ms) ---\n",	profileIterator->Get_Current_Parent_Name(), parent_time );
-	float totalTime = 0.f;
-
-	
-	int numChildren = 0;
-	
-	for (i = 0; !profileIterator->Is_Done(); i++,profileIterator->Next())
-	{
-		numChildren++;
-		float current_total_time = profileIterator->Get_Current_Total_Time();
-		accumulated_time += current_total_time;
-		float fraction = parent_time > SIMD_EPSILON ? (current_total_time / parent_time) * 100 : 0.f;
-		{
-			int i;	for (i=0;i<spacing;i++)	printf(".");
-		}
-		printf("%d -- %s (%.2f %%) :: %.3f ms / frame (%d calls)\n",i, profileIterator->Get_Current_Name(), fraction,(current_total_time / (double)frames_since_reset),profileIterator->Get_Current_Total_Calls());
-		totalTime += current_total_time;
-		//recurse into children
-	}
-
-	if (parent_time < accumulated_time)
-	{
-		printf("what's wrong\n");
-	}
-	for (i=0;i<spacing;i++)	printf(".");
-	printf("%s (%.3f %%) :: %.3f ms\n", "Unaccounted:",parent_time > SIMD_EPSILON ? ((parent_time - accumulated_time) / parent_time) * 100 : 0.f, parent_time - accumulated_time);
-	
-	for (i=0;i<numChildren;i++)
-	{
-		profileIterator->Enter_Child(i);
-		dumpRecursive(profileIterator,spacing+3);
-		profileIterator->Enter_Parent();
-	}
-}
-
-
-
-void	CProfileManager::dumpAll()
-{
-	CProfileIterator* profileIterator = 0;
-	profileIterator = CProfileManager::Get_Iterator();
-
-	dumpRecursive(profileIterator,0);
-
-	CProfileManager::Release_Iterator(profileIterator);
-}
-
-
-
-
-#endif //BT_NO_PROFILE
diff --git a/hkl3d/bullet/src/LinearMath/btQuickprof.h b/hkl3d/bullet/src/LinearMath/btQuickprof.h
deleted file mode 100644
index 0da13ab..0000000
--- a/hkl3d/bullet/src/LinearMath/btQuickprof.h
+++ /dev/null
@@ -1,196 +0,0 @@
-
-/***************************************************************************************************
-**
-** Real-Time Hierarchical Profiling for Game Programming Gems 3
-**
-** by Greg Hjelstrom & Byon Garrabrant
-**
-***************************************************************************************************/
-
-// Credits: The Clock class was inspired by the Timer classes in 
-// Ogre (www.ogre3d.org).
-
-
-
-#ifndef BT_QUICK_PROF_H
-#define BT_QUICK_PROF_H
-
-//To disable built-in profiling, please comment out next line
-//#define BT_NO_PROFILE 1
-#ifndef BT_NO_PROFILE
-#include <stdio.h>//@todo remove this, backwards compatibility
-#include "btScalar.h"
-#include "btAlignedAllocator.h"
-#include <new>
-
-
-
-
-
-#define USE_BT_CLOCK 1
-
-#ifdef USE_BT_CLOCK
-
-///The btClock is a portable basic clock that measures accurate time in seconds, use for profiling.
-class btClock
-{
-public:
-	btClock();
-
-	btClock(const btClock& other);
-	btClock& operator=(const btClock& other);
-
-	~btClock();
-
-	/// Resets the initial reference time.
-	void reset();
-
-	/// Returns the time in ms since the last call to reset or since 
-	/// the btClock was created.
-	unsigned long int getTimeMilliseconds();
-
-	/// Returns the time in us since the last call to reset or since 
-	/// the Clock was created.
-	unsigned long int getTimeMicroseconds();
-private:
-	struct btClockData* m_data;
-};
-
-#endif //USE_BT_CLOCK
-
-
-
-
-///A node in the Profile Hierarchy Tree
-class	CProfileNode {
-
-public:
-	CProfileNode( const char * name, CProfileNode * parent );
-	~CProfileNode( void );
-
-	CProfileNode * Get_Sub_Node( const char * name );
-
-	CProfileNode * Get_Parent( void )		{ return Parent; }
-	CProfileNode * Get_Sibling( void )		{ return Sibling; }
-	CProfileNode * Get_Child( void )			{ return Child; }
-
-	void				CleanupMemory();
-	void				Reset( void );
-	void				Call( void );
-	bool				Return( void );
-
-	const char *	Get_Name( void )				{ return Name; }
-	int				Get_Total_Calls( void )		{ return TotalCalls; }
-	float				Get_Total_Time( void )		{ return TotalTime; }
-
-protected:
-
-	const char *	Name;
-	int				TotalCalls;
-	float				TotalTime;
-	unsigned long int			StartTime;
-	int				RecursionCounter;
-
-	CProfileNode *	Parent;
-	CProfileNode *	Child;
-	CProfileNode *	Sibling;
-};
-
-///An iterator to navigate through the tree
-class CProfileIterator
-{
-public:
-	// Access all the children of the current parent
-	void				First(void);
-	void				Next(void);
-	bool				Is_Done(void);
-	bool                Is_Root(void) { return (CurrentParent->Get_Parent() == 0); }
-
-	void				Enter_Child( int index );		// Make the given child the new parent
-	void				Enter_Largest_Child( void );	// Make the largest child the new parent
-	void				Enter_Parent( void );			// Make the current parent's parent the new parent
-
-	// Access the current child
-	const char *	Get_Current_Name( void )			{ return CurrentChild->Get_Name(); }
-	int				Get_Current_Total_Calls( void )	{ return CurrentChild->Get_Total_Calls(); }
-	float				Get_Current_Total_Time( void )	{ return CurrentChild->Get_Total_Time(); }
-
-	// Access the current parent
-	const char *	Get_Current_Parent_Name( void )			{ return CurrentParent->Get_Name(); }
-	int				Get_Current_Parent_Total_Calls( void )	{ return CurrentParent->Get_Total_Calls(); }
-	float				Get_Current_Parent_Total_Time( void )	{ return CurrentParent->Get_Total_Time(); }
-
-protected:
-
-	CProfileNode *	CurrentParent;
-	CProfileNode *	CurrentChild;
-
-	CProfileIterator( CProfileNode * start );
-	friend	class		CProfileManager;
-};
-
-
-///The Manager for the Profile system
-class	CProfileManager {
-public:
-	static	void						Start_Profile( const char * name );
-	static	void						Stop_Profile( void );
-
-	static	void						CleanupMemory(void)
-	{
-		Root.CleanupMemory();
-	}
-
-	static	void						Reset( void );
-	static	void						Increment_Frame_Counter( void );
-	static	int						Get_Frame_Count_Since_Reset( void )		{ return FrameCounter; }
-	static	float						Get_Time_Since_Reset( void );
-
-	static	CProfileIterator *	Get_Iterator( void )	
-	{ 
-		
-		return new CProfileIterator( &Root ); 
-	}
-	static	void						Release_Iterator( CProfileIterator * iterator ) { delete ( iterator); }
-
-	static void	dumpRecursive(CProfileIterator* profileIterator, int spacing);
-
-	static void	dumpAll();
-
-private:
-	static	CProfileNode			Root;
-	static	CProfileNode *			CurrentNode;
-	static	int						FrameCounter;
-	static	unsigned long int					ResetTime;
-};
-
-
-///ProfileSampleClass is a simple way to profile a function's scope
-///Use the BT_PROFILE macro at the start of scope to time
-class	CProfileSample {
-public:
-	CProfileSample( const char * name )
-	{ 
-		CProfileManager::Start_Profile( name ); 
-	}
-
-	~CProfileSample( void )					
-	{ 
-		CProfileManager::Stop_Profile(); 
-	}
-};
-
-
-#define	BT_PROFILE( name )			CProfileSample __profile( name )
-
-#else
-
-#define	BT_PROFILE( name )
-
-#endif //#ifndef BT_NO_PROFILE
-
-
-
-#endif //BT_QUICK_PROF_H
-
-
diff --git a/hkl3d/bullet/src/LinearMath/btRandom.h b/hkl3d/bullet/src/LinearMath/btRandom.h
deleted file mode 100644
index 4cbfc6b..0000000
--- a/hkl3d/bullet/src/LinearMath/btRandom.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-#ifndef BT_GEN_RANDOM_H
-#define BT_GEN_RANDOM_H
-
-#ifdef MT19937
-
-#include <limits.h>
-#include <mt19937.h>
-
-#define GEN_RAND_MAX UINT_MAX
-
-SIMD_FORCE_INLINE void         GEN_srand(unsigned int seed) { init_genrand(seed); }
-SIMD_FORCE_INLINE unsigned int GEN_rand()                   { return genrand_int32(); }
-
-#else
-
-#include <stdlib.h>
-
-#define GEN_RAND_MAX RAND_MAX
-
-SIMD_FORCE_INLINE void         GEN_srand(unsigned int seed) { srand(seed); } 
-SIMD_FORCE_INLINE unsigned int GEN_rand()                   { return rand(); }
-
-#endif
-
-#endif //BT_GEN_RANDOM_H
-
diff --git a/hkl3d/bullet/src/LinearMath/btScalar.h b/hkl3d/bullet/src/LinearMath/btScalar.h
deleted file mode 100644
index d36af1e..0000000
--- a/hkl3d/bullet/src/LinearMath/btScalar.h
+++ /dev/null
@@ -1,522 +0,0 @@
-/*
-Copyright (c) 2003-2009 Erwin Coumans  http://bullet.googlecode.com
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-#ifndef BT_SCALAR_H
-#define BT_SCALAR_H
-
-#ifdef BT_MANAGED_CODE
-//Aligned data types not supported in managed code
-#pragma unmanaged
-#endif
-
-
-#include <math.h>
-#include <stdlib.h>//size_t for MSVC 6.0
-#include <float.h>
-
-/* SVN $Revision$ on $Date$ from http://bullet.googlecode.com*/
-#define BT_BULLET_VERSION 278
-
-inline int	btGetVersion()
-{
-	return BT_BULLET_VERSION;
-}
-
-#if defined(DEBUG) || defined (_DEBUG)
-#define BT_DEBUG
-#endif
-
-
-#ifdef _WIN32
-
-		#if defined(__MINGW32__) || defined(__CYGWIN__) || (defined (_MSC_VER) && _MSC_VER < 1300)
-
-			#define SIMD_FORCE_INLINE inline
-			#define ATTRIBUTE_ALIGNED16(a) a
-			#define ATTRIBUTE_ALIGNED64(a) a
-			#define ATTRIBUTE_ALIGNED128(a) a
-		#else
-			//#define BT_HAS_ALIGNED_ALLOCATOR
-			#pragma warning(disable : 4324) // disable padding warning
-//			#pragma warning(disable:4530) // Disable the exception disable but used in MSCV Stl warning.
-//			#pragma warning(disable:4996) //Turn off warnings about deprecated C routines
-//			#pragma warning(disable:4786) // Disable the "debug name too long" warning
-
-			#define SIMD_FORCE_INLINE __forceinline
-			#define ATTRIBUTE_ALIGNED16(a) __declspec(align(16)) a
-			#define ATTRIBUTE_ALIGNED64(a) __declspec(align(64)) a
-			#define ATTRIBUTE_ALIGNED128(a) __declspec (align(128)) a
-		#ifdef _XBOX
-			#define BT_USE_VMX128
-
-			#include <ppcintrinsics.h>
- 			#define BT_HAVE_NATIVE_FSEL
- 			#define btFsel(a,b,c) __fsel((a),(b),(c))
-		#else
-
-#if (defined (_WIN32) && (_MSC_VER) && _MSC_VER >= 1400) && (!defined (BT_USE_DOUBLE_PRECISION))
-			#define BT_USE_SSE
-			#include <emmintrin.h>
-#endif
-
-		#endif//_XBOX
-
-		#endif //__MINGW32__
-
-		#include <assert.h>
-#ifdef BT_DEBUG
-		#define btAssert assert
-#else
-		#define btAssert(x)
-#endif
-		//btFullAssert is optional, slows down a lot
-		#define btFullAssert(x)
-
-		#define btLikely(_c)  _c
-		#define btUnlikely(_c) _c
-
-#else
-	
-#if defined	(__CELLOS_LV2__)
-		#define SIMD_FORCE_INLINE inline __attribute__((always_inline))
-		#define ATTRIBUTE_ALIGNED16(a) a __attribute__ ((aligned (16)))
-		#define ATTRIBUTE_ALIGNED64(a) a __attribute__ ((aligned (64)))
-		#define ATTRIBUTE_ALIGNED128(a) a __attribute__ ((aligned (128)))
-		#ifndef assert
-		#include <assert.h>
-		#endif
-#ifdef BT_DEBUG
-#ifdef __SPU__
-#include <spu_printf.h>
-#define printf spu_printf
-	#define btAssert(x) {if(!(x)){printf("Assert "__FILE__ ":%u ("#x")\n", __LINE__);spu_hcmpeq(0,0);}}
-#else
-	#define btAssert assert
-#endif
-	
-#else
-		#define btAssert(x)
-#endif
-		//btFullAssert is optional, slows down a lot
-		#define btFullAssert(x)
-
-		#define btLikely(_c)  _c
-		#define btUnlikely(_c) _c
-
-#else
-
-#ifdef USE_LIBSPE2
-
-		#define SIMD_FORCE_INLINE __inline
-		#define ATTRIBUTE_ALIGNED16(a) a __attribute__ ((aligned (16)))
-		#define ATTRIBUTE_ALIGNED64(a) a __attribute__ ((aligned (64)))
-		#define ATTRIBUTE_ALIGNED128(a) a __attribute__ ((aligned (128)))
-		#ifndef assert
-		#include <assert.h>
-		#endif
-#ifdef BT_DEBUG
-		#define btAssert assert
-#else
-		#define btAssert(x)
-#endif
-		//btFullAssert is optional, slows down a lot
-		#define btFullAssert(x)
-
-
-		#define btLikely(_c)   __builtin_expect((_c), 1)
-		#define btUnlikely(_c) __builtin_expect((_c), 0)
-		
-
-#else
-	//non-windows systems
-
-#if (defined (__APPLE__) && defined (__i386__) && (!defined (BT_USE_DOUBLE_PRECISION)))
-	#define BT_USE_SSE
-	#include <emmintrin.h>
-
-	#define SIMD_FORCE_INLINE inline
-///@todo: check out alignment methods for other platforms/compilers
-	#define ATTRIBUTE_ALIGNED16(a) a __attribute__ ((aligned (16)))
-	#define ATTRIBUTE_ALIGNED64(a) a __attribute__ ((aligned (64)))
-	#define ATTRIBUTE_ALIGNED128(a) a __attribute__ ((aligned (128)))
-	#ifndef assert
-	#include <assert.h>
-	#endif
-
-	#if defined(DEBUG) || defined (_DEBUG)
-		#define btAssert assert
-	#else
-		#define btAssert(x)
-	#endif
-
-	//btFullAssert is optional, slows down a lot
-	#define btFullAssert(x)
-	#define btLikely(_c)  _c
-	#define btUnlikely(_c) _c
-
-#else
-
-		#define SIMD_FORCE_INLINE inline
-		///@todo: check out alignment methods for other platforms/compilers
-		///#define ATTRIBUTE_ALIGNED16(a) a __attribute__ ((aligned (16)))
-		///#define ATTRIBUTE_ALIGNED64(a) a __attribute__ ((aligned (64)))
-		///#define ATTRIBUTE_ALIGNED128(a) a __attribute__ ((aligned (128)))
-		#define ATTRIBUTE_ALIGNED16(a) a
-		#define ATTRIBUTE_ALIGNED64(a) a
-		#define ATTRIBUTE_ALIGNED128(a) a
-		#ifndef assert
-		#include <assert.h>
-		#endif
-
-#if defined(DEBUG) || defined (_DEBUG)
-		#define btAssert assert
-#else
-		#define btAssert(x)
-#endif
-
-		//btFullAssert is optional, slows down a lot
-		#define btFullAssert(x)
-		#define btLikely(_c)  _c
-		#define btUnlikely(_c) _c
-#endif //__APPLE__ 
-
-#endif // LIBSPE2
-
-#endif	//__CELLOS_LV2__
-#endif
-
-
-///The btScalar type abstracts floating point numbers, to easily switch between double and single floating point precision.
-#if defined(BT_USE_DOUBLE_PRECISION)
-typedef double btScalar;
-//this number could be bigger in double precision
-#define BT_LARGE_FLOAT 1e30
-#else
-typedef float btScalar;
-//keep BT_LARGE_FLOAT*BT_LARGE_FLOAT < FLT_MAX
-#define BT_LARGE_FLOAT 1e18f
-#endif
-
-
-
-#define BT_DECLARE_ALIGNED_ALLOCATOR() \
-   SIMD_FORCE_INLINE void* operator new(size_t sizeInBytes)   { return btAlignedAlloc(sizeInBytes,16); }   \
-   SIMD_FORCE_INLINE void  operator delete(void* ptr)         { btAlignedFree(ptr); }   \
-   SIMD_FORCE_INLINE void* operator new(size_t, void* ptr)   { return ptr; }   \
-   SIMD_FORCE_INLINE void  operator delete(void*, void*)      { }   \
-   SIMD_FORCE_INLINE void* operator new[](size_t sizeInBytes)   { return btAlignedAlloc(sizeInBytes,16); }   \
-   SIMD_FORCE_INLINE void  operator delete[](void* ptr)         { btAlignedFree(ptr); }   \
-   SIMD_FORCE_INLINE void* operator new[](size_t, void* ptr)   { return ptr; }   \
-   SIMD_FORCE_INLINE void  operator delete[](void*, void*)      { }   \
-
-
-
-#if defined(BT_USE_DOUBLE_PRECISION) || defined(BT_FORCE_DOUBLE_FUNCTIONS)
-		
-SIMD_FORCE_INLINE btScalar btSqrt(btScalar x) { return sqrt(x); }
-SIMD_FORCE_INLINE btScalar btFabs(btScalar x) { return fabs(x); }
-SIMD_FORCE_INLINE btScalar btCos(btScalar x) { return cos(x); }
-SIMD_FORCE_INLINE btScalar btSin(btScalar x) { return sin(x); }
-SIMD_FORCE_INLINE btScalar btTan(btScalar x) { return tan(x); }
-SIMD_FORCE_INLINE btScalar btAcos(btScalar x) { if (x<btScalar(-1))	x=btScalar(-1); if (x>btScalar(1))	x=btScalar(1); return acos(x); }
-SIMD_FORCE_INLINE btScalar btAsin(btScalar x) { if (x<btScalar(-1))	x=btScalar(-1); if (x>btScalar(1))	x=btScalar(1); return asin(x); }
-SIMD_FORCE_INLINE btScalar btAtan(btScalar x) { return atan(x); }
-SIMD_FORCE_INLINE btScalar btAtan2(btScalar x, btScalar y) { return atan2(x, y); }
-SIMD_FORCE_INLINE btScalar btExp(btScalar x) { return exp(x); }
-SIMD_FORCE_INLINE btScalar btLog(btScalar x) { return log(x); }
-SIMD_FORCE_INLINE btScalar btPow(btScalar x,btScalar y) { return pow(x,y); }
-SIMD_FORCE_INLINE btScalar btFmod(btScalar x,btScalar y) { return fmod(x,y); }
-
-#else
-		
-SIMD_FORCE_INLINE btScalar btSqrt(btScalar y) 
-{ 
-#ifdef USE_APPROXIMATION
-    double x, z, tempf;
-    unsigned long *tfptr = ((unsigned long *)&tempf) + 1;
-
-	tempf = y;
-	*tfptr = (0xbfcdd90a - *tfptr)>>1; /* estimate of 1/sqrt(y) */
-	x =  tempf;
-	z =  y*btScalar(0.5);
-	x = (btScalar(1.5)*x)-(x*x)*(x*z);         /* iteration formula     */
-	x = (btScalar(1.5)*x)-(x*x)*(x*z);
-	x = (btScalar(1.5)*x)-(x*x)*(x*z);
-	x = (btScalar(1.5)*x)-(x*x)*(x*z);
-	x = (btScalar(1.5)*x)-(x*x)*(x*z);
-	return x*y;
-#else
-	return sqrtf(y); 
-#endif
-}
-SIMD_FORCE_INLINE btScalar btFabs(btScalar x) { return fabsf(x); }
-SIMD_FORCE_INLINE btScalar btCos(btScalar x) { return cosf(x); }
-SIMD_FORCE_INLINE btScalar btSin(btScalar x) { return sinf(x); }
-SIMD_FORCE_INLINE btScalar btTan(btScalar x) { return tanf(x); }
-SIMD_FORCE_INLINE btScalar btAcos(btScalar x) { 
-	if (x<btScalar(-1))	
-		x=btScalar(-1); 
-	if (x>btScalar(1))	
-		x=btScalar(1);
-	return acosf(x); 
-}
-SIMD_FORCE_INLINE btScalar btAsin(btScalar x) { 
-	if (x<btScalar(-1))	
-		x=btScalar(-1); 
-	if (x>btScalar(1))	
-		x=btScalar(1);
-	return asinf(x); 
-}
-SIMD_FORCE_INLINE btScalar btAtan(btScalar x) { return atanf(x); }
-SIMD_FORCE_INLINE btScalar btAtan2(btScalar x, btScalar y) { return atan2f(x, y); }
-SIMD_FORCE_INLINE btScalar btExp(btScalar x) { return expf(x); }
-SIMD_FORCE_INLINE btScalar btLog(btScalar x) { return logf(x); }
-SIMD_FORCE_INLINE btScalar btPow(btScalar x,btScalar y) { return powf(x,y); }
-SIMD_FORCE_INLINE btScalar btFmod(btScalar x,btScalar y) { return fmodf(x,y); }
-	
-#endif
-
-#define SIMD_2_PI         btScalar(6.283185307179586232)
-#define SIMD_PI           (SIMD_2_PI * btScalar(0.5))
-#define SIMD_HALF_PI      (SIMD_2_PI * btScalar(0.25))
-#define SIMD_RADS_PER_DEG (SIMD_2_PI / btScalar(360.0))
-#define SIMD_DEGS_PER_RAD  (btScalar(360.0) / SIMD_2_PI)
-#define SIMDSQRT12 btScalar(0.7071067811865475244008443621048490)
-
-#define btRecipSqrt(x) ((btScalar)(btScalar(1.0)/btSqrt(btScalar(x))))		/* reciprocal square root */
-
-
-#ifdef BT_USE_DOUBLE_PRECISION
-#define SIMD_EPSILON      DBL_EPSILON
-#define SIMD_INFINITY     DBL_MAX
-#else
-#define SIMD_EPSILON      FLT_EPSILON
-#define SIMD_INFINITY     FLT_MAX
-#endif
-
-SIMD_FORCE_INLINE btScalar btAtan2Fast(btScalar y, btScalar x) 
-{
-	btScalar coeff_1 = SIMD_PI / 4.0f;
-	btScalar coeff_2 = 3.0f * coeff_1;
-	btScalar abs_y = btFabs(y);
-	btScalar angle;
-	if (x >= 0.0f) {
-		btScalar r = (x - abs_y) / (x + abs_y);
-		angle = coeff_1 - coeff_1 * r;
-	} else {
-		btScalar r = (x + abs_y) / (abs_y - x);
-		angle = coeff_2 - coeff_1 * r;
-	}
-	return (y < 0.0f) ? -angle : angle;
-}
-
-SIMD_FORCE_INLINE bool      btFuzzyZero(btScalar x) { return btFabs(x) < SIMD_EPSILON; }
-
-SIMD_FORCE_INLINE bool	btEqual(btScalar a, btScalar eps) {
-	return (((a) <= eps) && !((a) < -eps));
-}
-SIMD_FORCE_INLINE bool	btGreaterEqual (btScalar a, btScalar eps) {
-	return (!((a) <= eps));
-}
-
-
-SIMD_FORCE_INLINE int       btIsNegative(btScalar x) {
-    return x < btScalar(0.0) ? 1 : 0;
-}
-
-SIMD_FORCE_INLINE btScalar btRadians(btScalar x) { return x * SIMD_RADS_PER_DEG; }
-SIMD_FORCE_INLINE btScalar btDegrees(btScalar x) { return x * SIMD_DEGS_PER_RAD; }
-
-#define BT_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name
-
-#ifndef btFsel
-SIMD_FORCE_INLINE btScalar btFsel(btScalar a, btScalar b, btScalar c)
-{
-	return a >= 0 ? b : c;
-}
-#endif
-#define btFsels(a,b,c) (btScalar)btFsel(a,b,c)
-
-
-SIMD_FORCE_INLINE bool btMachineIsLittleEndian()
-{
-   long int i = 1;
-   const char *p = (const char *) &i;
-   if (p[0] == 1)  // Lowest address contains the least significant byte
-	   return true;
-   else
-	   return false;
-}
-
-
-
-///btSelect avoids branches, which makes performance much better for consoles like Playstation 3 and XBox 360
-///Thanks Phil Knight. See also http://www.cellperformance.com/articles/2006/04/more_techniques_for_eliminatin_1.html
-SIMD_FORCE_INLINE unsigned btSelect(unsigned condition, unsigned valueIfConditionNonZero, unsigned valueIfConditionZero) 
-{
-    // Set testNz to 0xFFFFFFFF if condition is nonzero, 0x00000000 if condition is zero
-    // Rely on positive value or'ed with its negative having sign bit on
-    // and zero value or'ed with its negative (which is still zero) having sign bit off 
-    // Use arithmetic shift right, shifting the sign bit through all 32 bits
-    unsigned testNz = (unsigned)(((int)condition | -(int)condition) >> 31);
-    unsigned testEqz = ~testNz;
-    return ((valueIfConditionNonZero & testNz) | (valueIfConditionZero & testEqz)); 
-}
-SIMD_FORCE_INLINE int btSelect(unsigned condition, int valueIfConditionNonZero, int valueIfConditionZero)
-{
-    unsigned testNz = (unsigned)(((int)condition | -(int)condition) >> 31);
-    unsigned testEqz = ~testNz; 
-    return static_cast<int>((valueIfConditionNonZero & testNz) | (valueIfConditionZero & testEqz));
-}
-SIMD_FORCE_INLINE float btSelect(unsigned condition, float valueIfConditionNonZero, float valueIfConditionZero)
-{
-#ifdef BT_HAVE_NATIVE_FSEL
-    return (float)btFsel((btScalar)condition - btScalar(1.0f), valueIfConditionNonZero, valueIfConditionZero);
-#else
-    return (condition != 0) ? valueIfConditionNonZero : valueIfConditionZero; 
-#endif
-}
-
-template<typename T> SIMD_FORCE_INLINE void btSwap(T& a, T& b)
-{
-	T tmp = a;
-	a = b;
-	b = tmp;
-}
-
-
-//PCK: endian swapping functions
-SIMD_FORCE_INLINE unsigned btSwapEndian(unsigned val)
-{
-	return (((val & 0xff000000) >> 24) | ((val & 0x00ff0000) >> 8) | ((val & 0x0000ff00) << 8)  | ((val & 0x000000ff) << 24));
-}
-
-SIMD_FORCE_INLINE unsigned short btSwapEndian(unsigned short val)
-{
-	return static_cast<unsigned short>(((val & 0xff00) >> 8) | ((val & 0x00ff) << 8));
-}
-
-SIMD_FORCE_INLINE unsigned btSwapEndian(int val)
-{
-	return btSwapEndian((unsigned)val);
-}
-
-SIMD_FORCE_INLINE unsigned short btSwapEndian(short val)
-{
-	return btSwapEndian((unsigned short) val);
-}
-
-///btSwapFloat uses using char pointers to swap the endianness
-////btSwapFloat/btSwapDouble will NOT return a float, because the machine might 'correct' invalid floating point values
-///Not all values of sign/exponent/mantissa are valid floating point numbers according to IEEE 754. 
-///When a floating point unit is faced with an invalid value, it may actually change the value, or worse, throw an exception. 
-///In most systems, running user mode code, you wouldn't get an exception, but instead the hardware/os/runtime will 'fix' the number for you. 
-///so instead of returning a float/double, we return integer/long long integer
-SIMD_FORCE_INLINE unsigned int  btSwapEndianFloat(float d)
-{
-    unsigned int a = 0;
-    unsigned char *dst = (unsigned char *)&a;
-    unsigned char *src = (unsigned char *)&d;
-
-    dst[0] = src[3];
-    dst[1] = src[2];
-    dst[2] = src[1];
-    dst[3] = src[0];
-    return a;
-}
-
-// unswap using char pointers
-SIMD_FORCE_INLINE float btUnswapEndianFloat(unsigned int a) 
-{
-    float d = 0.0f;
-    unsigned char *src = (unsigned char *)&a;
-    unsigned char *dst = (unsigned char *)&d;
-
-    dst[0] = src[3];
-    dst[1] = src[2];
-    dst[2] = src[1];
-    dst[3] = src[0];
-
-    return d;
-}
-
-
-// swap using char pointers
-SIMD_FORCE_INLINE void  btSwapEndianDouble(double d, unsigned char* dst)
-{
-    unsigned char *src = (unsigned char *)&d;
-
-    dst[0] = src[7];
-    dst[1] = src[6];
-    dst[2] = src[5];
-    dst[3] = src[4];
-    dst[4] = src[3];
-    dst[5] = src[2];
-    dst[6] = src[1];
-    dst[7] = src[0];
-
-}
-
-// unswap using char pointers
-SIMD_FORCE_INLINE double btUnswapEndianDouble(const unsigned char *src) 
-{
-    double d = 0.0;
-    unsigned char *dst = (unsigned char *)&d;
-
-    dst[0] = src[7];
-    dst[1] = src[6];
-    dst[2] = src[5];
-    dst[3] = src[4];
-    dst[4] = src[3];
-    dst[5] = src[2];
-    dst[6] = src[1];
-    dst[7] = src[0];
-
-	return d;
-}
-
-// returns normalized value in range [-SIMD_PI, SIMD_PI]
-SIMD_FORCE_INLINE btScalar btNormalizeAngle(btScalar angleInRadians) 
-{
-	angleInRadians = btFmod(angleInRadians, SIMD_2_PI);
-	if(angleInRadians < -SIMD_PI)
-	{
-		return angleInRadians + SIMD_2_PI;
-	}
-	else if(angleInRadians > SIMD_PI)
-	{
-		return angleInRadians - SIMD_2_PI;
-	}
-	else
-	{
-		return angleInRadians;
-	}
-}
-
-///rudimentary class to provide type info
-struct btTypedObject
-{
-	btTypedObject(int objectType)
-		:m_objectType(objectType)
-	{
-	}
-	int	m_objectType;
-	inline int getObjectType() const
-	{
-		return m_objectType;
-	}
-};
-#endif //BT_SCALAR_H
diff --git a/hkl3d/bullet/src/LinearMath/btSerializer.cpp b/hkl3d/bullet/src/LinearMath/btSerializer.cpp
deleted file mode 100644
index c6d387e..0000000
--- a/hkl3d/bullet/src/LinearMath/btSerializer.cpp
+++ /dev/null
@@ -1,832 +0,0 @@
-unsigned char sBulletDNAstr[]= {
-83,68,78,65,78,65,77,69,42,1,0,0,109,95,115,105,122,101,0,109,
-95,99,97,112,97,99,105,116,121,0,42,109,95,100,97,116,97,0,109,95,
-99,111,108,108,105,115,105,111,110,83,104,97,112,101,115,0,109,95,99,111,
-108,108,105,115,105,111,110,79,98,106,101,99,116,115,0,109,95,99,111,110,
-115,116,114,97,105,110,116,115,0,42,102,105,114,115,116,0,42,108,97,115,
-116,0,109,95,102,108,111,97,116,115,91,52,93,0,109,95,101,108,91,51,
-93,0,109,95,98,97,115,105,115,0,109,95,111,114,105,103,105,110,0,109,
-95,114,111,111,116,78,111,100,101,73,110,100,101,120,0,109,95,115,117,98,
-116,114,101,101,83,105,122,101,0,109,95,113,117,97,110,116,105,122,101,100,
-65,97,98,98,77,105,110,91,51,93,0,109,95,113,117,97,110,116,105,122,
-101,100,65,97,98,98,77,97,120,91,51,93,0,109,95,97,97,98,98,77,
-105,110,79,114,103,0,109,95,97,97,98,98,77,97,120,79,114,103,0,109,
-95,101,115,99,97,112,101,73,110,100,101,120,0,109,95,115,117,98,80,97,
-114,116,0,109,95,116,114,105,97,110,103,108,101,73,110,100,101,120,0,109,
-95,112,97,100,91,52,93,0,109,95,101,115,99,97,112,101,73,110,100,101,
-120,79,114,84,114,105,97,110,103,108,101,73,110,100,101,120,0,109,95,98,
-118,104,65,97,98,98,77,105,110,0,109,95,98,118,104,65,97,98,98,77,
-97,120,0,109,95,98,118,104,81,117,97,110,116,105,122,97,116,105,111,110,
-0,109,95,99,117,114,78,111,100,101,73,110,100,101,120,0,109,95,117,115,
-101,81,117,97,110,116,105,122,97,116,105,111,110,0,109,95,110,117,109,67,
-111,110,116,105,103,117,111,117,115,76,101,97,102,78,111,100,101,115,0,109,
-95,110,117,109,81,117,97,110,116,105,122,101,100,67,111,110,116,105,103,117,
-111,117,115,78,111,100,101,115,0,42,109,95,99,111,110,116,105,103,117,111,
-117,115,78,111,100,101,115,80,116,114,0,42,109,95,113,117,97,110,116,105,
-122,101,100,67,111,110,116,105,103,117,111,117,115,78,111,100,101,115,80,116,
-114,0,42,109,95,115,117,98,84,114,101,101,73,110,102,111,80,116,114,0,
-109,95,116,114,97,118,101,114,115,97,108,77,111,100,101,0,109,95,110,117,
-109,83,117,98,116,114,101,101,72,101,97,100,101,114,115,0,42,109,95,110,
-97,109,101,0,109,95,115,104,97,112,101,84,121,112,101,0,109,95,112,97,
-100,100,105,110,103,91,52,93,0,109,95,99,111,108,108,105,115,105,111,110,
-83,104,97,112,101,68,97,116,97,0,109,95,108,111,99,97,108,83,99,97,
-108,105,110,103,0,109,95,112,108,97,110,101,78,111,114,109,97,108,0,109,
-95,112,108,97,110,101,67,111,110,115,116,97,110,116,0,109,95,105,109,112,
-108,105,99,105,116,83,104,97,112,101,68,105,109,101,110,115,105,111,110,115,
-0,109,95,99,111,108,108,105,115,105,111,110,77,97,114,103,105,110,0,109,
-95,112,97,100,100,105,110,103,0,109,95,112,111,115,0,109,95,114,97,100,
-105,117,115,0,109,95,99,111,110,118,101,120,73,110,116,101,114,110,97,108,
-83,104,97,112,101,68,97,116,97,0,42,109,95,108,111,99,97,108,80,111,
-115,105,116,105,111,110,65,114,114,97,121,80,116,114,0,109,95,108,111,99,
-97,108,80,111,115,105,116,105,111,110,65,114,114,97,121,83,105,122,101,0,
-109,95,118,97,108,117,101,0,109,95,112,97,100,91,50,93,0,109,95,118,
-97,108,117,101,115,91,51,93,0,109,95,112,97,100,0,42,109,95,118,101,
-114,116,105,99,101,115,51,102,0,42,109,95,118,101,114,116,105,99,101,115,
-51,100,0,42,109,95,105,110,100,105,99,101,115,51,50,0,42,109,95,51,
-105,110,100,105,99,101,115,49,54,0,42,109,95,51,105,110,100,105,99,101,
-115,56,0,42,109,95,105,110,100,105,99,101,115,49,54,0,109,95,110,117,
-109,84,114,105,97,110,103,108,101,115,0,109,95,110,117,109,86,101,114,116,
-105,99,101,115,0,42,109,95,109,101,115,104,80,97,114,116,115,80,116,114,
-0,109,95,115,99,97,108,105,110,103,0,109,95,110,117,109,77,101,115,104,
-80,97,114,116,115,0,109,95,109,101,115,104,73,110,116,101,114,102,97,99,
-101,0,42,109,95,113,117,97,110,116,105,122,101,100,70,108,111,97,116,66,
-118,104,0,42,109,95,113,117,97,110,116,105,122,101,100,68,111,117,98,108,
-101,66,118,104,0,42,109,95,116,114,105,97,110,103,108,101,73,110,102,111,
-77,97,112,0,109,95,112,97,100,51,91,52,93,0,109,95,116,114,105,109,
-101,115,104,83,104,97,112,101,68,97,116,97,0,109,95,116,114,97,110,115,
-102,111,114,109,0,42,109,95,99,104,105,108,100,83,104,97,112,101,0,109,
-95,99,104,105,108,100,83,104,97,112,101,84,121,112,101,0,109,95,99,104,
-105,108,100,77,97,114,103,105,110,0,42,109,95,99,104,105,108,100,83,104,
-97,112,101,80,116,114,0,109,95,110,117,109,67,104,105,108,100,83,104,97,
-112,101,115,0,109,95,117,112,65,120,105,115,0,109,95,102,108,97,103,115,
-0,109,95,101,100,103,101,86,48,86,49,65,110,103,108,101,0,109,95,101,
-100,103,101,86,49,86,50,65,110,103,108,101,0,109,95,101,100,103,101,86,
-50,86,48,65,110,103,108,101,0,42,109,95,104,97,115,104,84,97,98,108,
-101,80,116,114,0,42,109,95,110,101,120,116,80,116,114,0,42,109,95,118,
-97,108,117,101,65,114,114,97,121,80,116,114,0,42,109,95,107,101,121,65,
-114,114,97,121,80,116,114,0,109,95,99,111,110,118,101,120,69,112,115,105,
-108,111,110,0,109,95,112,108,97,110,97,114,69,112,115,105,108,111,110,0,
-109,95,101,113,117,97,108,86,101,114,116,101,120,84,104,114,101,115,104,111,
-108,100,0,109,95,101,100,103,101,68,105,115,116,97,110,99,101,84,104,114,
-101,115,104,111,108,100,0,109,95,122,101,114,111,65,114,101,97,84,104,114,
-101,115,104,111,108,100,0,109,95,110,101,120,116,83,105,122,101,0,109,95,
-104,97,115,104,84,97,98,108,101,83,105,122,101,0,109,95,110,117,109,86,
-97,108,117,101,115,0,109,95,110,117,109,75,101,121,115,0,109,95,103,105,
-109,112,97,99,116,83,117,98,84,121,112,101,0,42,109,95,117,110,115,99,
-97,108,101,100,80,111,105,110,116,115,70,108,111,97,116,80,116,114,0,42,
-109,95,117,110,115,99,97,108,101,100,80,111,105,110,116,115,68,111,117,98,
-108,101,80,116,114,0,109,95,110,117,109,85,110,115,99,97,108,101,100,80,
-111,105,110,116,115,0,109,95,112,97,100,100,105,110,103,51,91,52,93,0,
-42,109,95,98,114,111,97,100,112,104,97,115,101,72,97,110,100,108,101,0,
-42,109,95,99,111,108,108,105,115,105,111,110,83,104,97,112,101,0,42,109,
-95,114,111,111,116,67,111,108,108,105,115,105,111,110,83,104,97,112,101,0,
-109,95,119,111,114,108,100,84,114,97,110,115,102,111,114,109,0,109,95,105,
-110,116,101,114,112,111,108,97,116,105,111,110,87,111,114,108,100,84,114,97,
-110,115,102,111,114,109,0,109,95,105,110,116,101,114,112,111,108,97,116,105,
-111,110,76,105,110,101,97,114,86,101,108,111,99,105,116,121,0,109,95,105,
-110,116,101,114,112,111,108,97,116,105,111,110,65,110,103,117,108,97,114,86,
-101,108,111,99,105,116,121,0,109,95,97,110,105,115,111,116,114,111,112,105,
-99,70,114,105,99,116,105,111,110,0,109,95,99,111,110,116,97,99,116,80,
-114,111,99,101,115,115,105,110,103,84,104,114,101,115,104,111,108,100,0,109,
-95,100,101,97,99,116,105,118,97,116,105,111,110,84,105,109,101,0,109,95,
-102,114,105,99,116,105,111,110,0,109,95,114,101,115,116,105,116,117,116,105,
-111,110,0,109,95,104,105,116,70,114,97,99,116,105,111,110,0,109,95,99,
-99,100,83,119,101,112,116,83,112,104,101,114,101,82,97,100,105,117,115,0,
-109,95,99,99,100,77,111,116,105,111,110,84,104,114,101,115,104,111,108,100,
-0,109,95,104,97,115,65,110,105,115,111,116,114,111,112,105,99,70,114,105,
-99,116,105,111,110,0,109,95,99,111,108,108,105,115,105,111,110,70,108,97,
-103,115,0,109,95,105,115,108,97,110,100,84,97,103,49,0,109,95,99,111,
-109,112,97,110,105,111,110,73,100,0,109,95,97,99,116,105,118,97,116,105,
-111,110,83,116,97,116,101,49,0,109,95,105,110,116,101,114,110,97,108,84,
-121,112,101,0,109,95,99,104,101,99,107,67,111,108,108,105,100,101,87,105,
-116,104,0,109,95,99,111,108,108,105,115,105,111,110,79,98,106,101,99,116,
-68,97,116,97,0,109,95,105,110,118,73,110,101,114,116,105,97,84,101,110,
-115,111,114,87,111,114,108,100,0,109,95,108,105,110,101,97,114,86,101,108,
-111,99,105,116,121,0,109,95,97,110,103,117,108,97,114,86,101,108,111,99,
-105,116,121,0,109,95,97,110,103,117,108,97,114,70,97,99,116,111,114,0,
-109,95,108,105,110,101,97,114,70,97,99,116,111,114,0,109,95,103,114,97,
-118,105,116,121,0,109,95,103,114,97,118,105,116,121,95,97,99,99,101,108,
-101,114,97,116,105,111,110,0,109,95,105,110,118,73,110,101,114,116,105,97,
-76,111,99,97,108,0,109,95,116,111,116,97,108,70,111,114,99,101,0,109,
-95,116,111,116,97,108,84,111,114,113,117,101,0,109,95,105,110,118,101,114,
-115,101,77,97,115,115,0,109,95,108,105,110,101,97,114,68,97,109,112,105,
-110,103,0,109,95,97,110,103,117,108,97,114,68,97,109,112,105,110,103,0,
-109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,112,105,110,103,70,
-97,99,116,111,114,0,109,95,97,100,100,105,116,105,111,110,97,108,76,105,
-110,101,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,
-83,113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,
-108,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,83,
-113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,108,
-97,114,68,97,109,112,105,110,103,70,97,99,116,111,114,0,109,95,108,105,
-110,101,97,114,83,108,101,101,112,105,110,103,84,104,114,101,115,104,111,108,
-100,0,109,95,97,110,103,117,108,97,114,83,108,101,101,112,105,110,103,84,
-104,114,101,115,104,111,108,100,0,109,95,97,100,100,105,116,105,111,110,97,
-108,68,97,109,112,105,110,103,0,109,95,110,117,109,67,111,110,115,116,114,
-97,105,110,116,82,111,119,115,0,110,117,98,0,42,109,95,114,98,65,0,
-42,109,95,114,98,66,0,109,95,111,98,106,101,99,116,84,121,112,101,0,
-109,95,117,115,101,114,67,111,110,115,116,114,97,105,110,116,84,121,112,101,
-0,109,95,117,115,101,114,67,111,110,115,116,114,97,105,110,116,73,100,0,
-109,95,110,101,101,100,115,70,101,101,100,98,97,99,107,0,109,95,97,112,
-112,108,105,101,100,73,109,112,117,108,115,101,0,109,95,100,98,103,68,114,
-97,119,83,105,122,101,0,109,95,100,105,115,97,98,108,101,67,111,108,108,
-105,115,105,111,110,115,66,101,116,119,101,101,110,76,105,110,107,101,100,66,
-111,100,105,101,115,0,109,95,112,97,100,52,91,52,93,0,109,95,116,121,
-112,101,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,109,95,112,
-105,118,111,116,73,110,65,0,109,95,112,105,118,111,116,73,110,66,0,109,
-95,114,98,65,70,114,97,109,101,0,109,95,114,98,66,70,114,97,109,101,
-0,109,95,117,115,101,82,101,102,101,114,101,110,99,101,70,114,97,109,101,
-65,0,109,95,97,110,103,117,108,97,114,79,110,108,121,0,109,95,101,110,
-97,98,108,101,65,110,103,117,108,97,114,77,111,116,111,114,0,109,95,109,
-111,116,111,114,84,97,114,103,101,116,86,101,108,111,99,105,116,121,0,109,
-95,109,97,120,77,111,116,111,114,73,109,112,117,108,115,101,0,109,95,108,
-111,119,101,114,76,105,109,105,116,0,109,95,117,112,112,101,114,76,105,109,
-105,116,0,109,95,108,105,109,105,116,83,111,102,116,110,101,115,115,0,109,
-95,98,105,97,115,70,97,99,116,111,114,0,109,95,114,101,108,97,120,97,
-116,105,111,110,70,97,99,116,111,114,0,109,95,115,119,105,110,103,83,112,
-97,110,49,0,109,95,115,119,105,110,103,83,112,97,110,50,0,109,95,116,
-119,105,115,116,83,112,97,110,0,109,95,100,97,109,112,105,110,103,0,109,
-95,108,105,110,101,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,
-108,105,110,101,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,97,
-110,103,117,108,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,97,
-110,103,117,108,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,117,
-115,101,76,105,110,101,97,114,82,101,102,101,114,101,110,99,101,70,114,97,
-109,101,65,0,109,95,117,115,101,79,102,102,115,101,116,70,111,114,67,111,
-110,115,116,114,97,105,110,116,70,114,97,109,101,0,109,95,54,100,111,102,
-68,97,116,97,0,109,95,115,112,114,105,110,103,69,110,97,98,108,101,100,
-91,54,93,0,109,95,101,113,117,105,108,105,98,114,105,117,109,80,111,105,
-110,116,91,54,93,0,109,95,115,112,114,105,110,103,83,116,105,102,102,110,
-101,115,115,91,54,93,0,109,95,115,112,114,105,110,103,68,97,109,112,105,
-110,103,91,54,93,0,109,95,108,105,110,101,97,114,83,116,105,102,102,110,
-101,115,115,0,109,95,97,110,103,117,108,97,114,83,116,105,102,102,110,101,
-115,115,0,109,95,118,111,108,117,109,101,83,116,105,102,102,110,101,115,115,
-0,42,109,95,109,97,116,101,114,105,97,108,0,109,95,112,111,115,105,116,
-105,111,110,0,109,95,112,114,101,118,105,111,117,115,80,111,115,105,116,105,
-111,110,0,109,95,118,101,108,111,99,105,116,121,0,109,95,97,99,99,117,
-109,117,108,97,116,101,100,70,111,114,99,101,0,109,95,110,111,114,109,97,
-108,0,109,95,97,114,101,97,0,109,95,97,116,116,97,99,104,0,109,95,
-110,111,100,101,73,110,100,105,99,101,115,91,50,93,0,109,95,114,101,115,
-116,76,101,110,103,116,104,0,109,95,98,98,101,110,100,105,110,103,0,109,
-95,110,111,100,101,73,110,100,105,99,101,115,91,51,93,0,109,95,114,101,
-115,116,65,114,101,97,0,109,95,99,48,91,52,93,0,109,95,110,111,100,
-101,73,110,100,105,99,101,115,91,52,93,0,109,95,114,101,115,116,86,111,
-108,117,109,101,0,109,95,99,49,0,109,95,99,50,0,109,95,99,48,0,
-109,95,108,111,99,97,108,70,114,97,109,101,0,42,109,95,114,105,103,105,
-100,66,111,100,121,0,109,95,110,111,100,101,73,110,100,101,120,0,109,95,
-97,101,114,111,77,111,100,101,108,0,109,95,98,97,117,109,103,97,114,116,
-101,0,109,95,100,114,97,103,0,109,95,108,105,102,116,0,109,95,112,114,
-101,115,115,117,114,101,0,109,95,118,111,108,117,109,101,0,109,95,100,121,
-110,97,109,105,99,70,114,105,99,116,105,111,110,0,109,95,112,111,115,101,
-77,97,116,99,104,0,109,95,114,105,103,105,100,67,111,110,116,97,99,116,
-72,97,114,100,110,101,115,115,0,109,95,107,105,110,101,116,105,99,67,111,
-110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,
-67,111,110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,97,110,
-99,104,111,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,82,
-105,103,105,100,67,108,117,115,116,101,114,72,97,114,100,110,101,115,115,0,
-109,95,115,111,102,116,75,105,110,101,116,105,99,67,108,117,115,116,101,114,
-72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,83,111,102,116,67,
-108,117,115,116,101,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,
-116,82,105,103,105,100,67,108,117,115,116,101,114,73,109,112,117,108,115,101,
-83,112,108,105,116,0,109,95,115,111,102,116,75,105,110,101,116,105,99,67,
-108,117,115,116,101,114,73,109,112,117,108,115,101,83,112,108,105,116,0,109,
-95,115,111,102,116,83,111,102,116,67,108,117,115,116,101,114,73,109,112,117,
-108,115,101,83,112,108,105,116,0,109,95,109,97,120,86,111,108,117,109,101,
-0,109,95,116,105,109,101,83,99,97,108,101,0,109,95,118,101,108,111,99,
-105,116,121,73,116,101,114,97,116,105,111,110,115,0,109,95,112,111,115,105,
-116,105,111,110,73,116,101,114,97,116,105,111,110,115,0,109,95,100,114,105,
-102,116,73,116,101,114,97,116,105,111,110,115,0,109,95,99,108,117,115,116,
-101,114,73,116,101,114,97,116,105,111,110,115,0,109,95,114,111,116,0,109,
-95,115,99,97,108,101,0,109,95,97,113,113,0,109,95,99,111,109,0,42,
-109,95,112,111,115,105,116,105,111,110,115,0,42,109,95,119,101,105,103,104,
-116,115,0,109,95,110,117,109,80,111,115,105,116,105,111,110,115,0,109,95,
-110,117,109,87,101,105,103,116,115,0,109,95,98,118,111,108,117,109,101,0,
-109,95,98,102,114,97,109,101,0,109,95,102,114,97,109,101,120,102,111,114,
-109,0,109,95,108,111,99,105,105,0,109,95,105,110,118,119,105,0,109,95,
-118,105,109,112,117,108,115,101,115,91,50,93,0,109,95,100,105,109,112,117,
-108,115,101,115,91,50,93,0,109,95,108,118,0,109,95,97,118,0,42,109,
-95,102,114,97,109,101,114,101,102,115,0,42,109,95,110,111,100,101,73,110,
-100,105,99,101,115,0,42,109,95,109,97,115,115,101,115,0,109,95,110,117,
-109,70,114,97,109,101,82,101,102,115,0,109,95,110,117,109,78,111,100,101,
-115,0,109,95,110,117,109,77,97,115,115,101,115,0,109,95,105,100,109,97,
-115,115,0,109,95,105,109,97,115,115,0,109,95,110,118,105,109,112,117,108,
-115,101,115,0,109,95,110,100,105,109,112,117,108,115,101,115,0,109,95,110,
-100,97,109,112,105,110,103,0,109,95,108,100,97,109,112,105,110,103,0,109,
-95,97,100,97,109,112,105,110,103,0,109,95,109,97,116,99,104,105,110,103,
-0,109,95,109,97,120,83,101,108,102,67,111,108,108,105,115,105,111,110,73,
-109,112,117,108,115,101,0,109,95,115,101,108,102,67,111,108,108,105,115,105,
-111,110,73,109,112,117,108,115,101,70,97,99,116,111,114,0,109,95,99,111,
-110,116,97,105,110,115,65,110,99,104,111,114,0,109,95,99,111,108,108,105,
-100,101,0,109,95,99,108,117,115,116,101,114,73,110,100,101,120,0,42,109,
-95,98,111,100,121,65,0,42,109,95,98,111,100,121,66,0,109,95,114,101,
-102,115,91,50,93,0,109,95,99,102,109,0,109,95,101,114,112,0,109,95,
-115,112,108,105,116,0,109,95,100,101,108,101,116,101,0,109,95,114,101,108,
-80,111,115,105,116,105,111,110,91,50,93,0,109,95,98,111,100,121,65,116,
-121,112,101,0,109,95,98,111,100,121,66,116,121,112,101,0,109,95,106,111,
-105,110,116,84,121,112,101,0,42,109,95,112,111,115,101,0,42,42,109,95,
-109,97,116,101,114,105,97,108,115,0,42,109,95,110,111,100,101,115,0,42,
-109,95,108,105,110,107,115,0,42,109,95,102,97,99,101,115,0,42,109,95,
-116,101,116,114,97,104,101,100,114,97,0,42,109,95,97,110,99,104,111,114,
-115,0,42,109,95,99,108,117,115,116,101,114,115,0,42,109,95,106,111,105,
-110,116,115,0,109,95,110,117,109,77,97,116,101,114,105,97,108,115,0,109,
-95,110,117,109,76,105,110,107,115,0,109,95,110,117,109,70,97,99,101,115,
-0,109,95,110,117,109,84,101,116,114,97,104,101,100,114,97,0,109,95,110,
-117,109,65,110,99,104,111,114,115,0,109,95,110,117,109,67,108,117,115,116,
-101,114,115,0,109,95,110,117,109,74,111,105,110,116,115,0,109,95,99,111,
-110,102,105,103,0,0,0,0,84,89,80,69,72,0,0,0,99,104,97,114,
-0,117,99,104,97,114,0,115,104,111,114,116,0,117,115,104,111,114,116,0,
-105,110,116,0,108,111,110,103,0,117,108,111,110,103,0,102,108,111,97,116,
-0,100,111,117,98,108,101,0,118,111,105,100,0,80,111,105,110,116,101,114,
-65,114,114,97,121,0,98,116,80,104,121,115,105,99,115,83,121,115,116,101,
-109,0,76,105,115,116,66,97,115,101,0,98,116,86,101,99,116,111,114,51,
-70,108,111,97,116,68,97,116,97,0,98,116,86,101,99,116,111,114,51,68,
-111,117,98,108,101,68,97,116,97,0,98,116,77,97,116,114,105,120,51,120,
-51,70,108,111,97,116,68,97,116,97,0,98,116,77,97,116,114,105,120,51,
-120,51,68,111,117,98,108,101,68,97,116,97,0,98,116,84,114,97,110,115,
-102,111,114,109,70,108,111,97,116,68,97,116,97,0,98,116,84,114,97,110,
-115,102,111,114,109,68,111,117,98,108,101,68,97,116,97,0,98,116,66,118,
-104,83,117,98,116,114,101,101,73,110,102,111,68,97,116,97,0,98,116,79,
-112,116,105,109,105,122,101,100,66,118,104,78,111,100,101,70,108,111,97,116,
-68,97,116,97,0,98,116,79,112,116,105,109,105,122,101,100,66,118,104,78,
-111,100,101,68,111,117,98,108,101,68,97,116,97,0,98,116,81,117,97,110,
-116,105,122,101,100,66,118,104,78,111,100,101,68,97,116,97,0,98,116,81,
-117,97,110,116,105,122,101,100,66,118,104,70,108,111,97,116,68,97,116,97,
-0,98,116,81,117,97,110,116,105,122,101,100,66,118,104,68,111,117,98,108,
-101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,111,110,83,104,97,
-112,101,68,97,116,97,0,98,116,83,116,97,116,105,99,80,108,97,110,101,
-83,104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,73,110,
-116,101,114,110,97,108,83,104,97,112,101,68,97,116,97,0,98,116,80,111,
-115,105,116,105,111,110,65,110,100,82,97,100,105,117,115,0,98,116,77,117,
-108,116,105,83,112,104,101,114,101,83,104,97,112,101,68,97,116,97,0,98,
-116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114,
-116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114,
-116,73,110,116,73,110,100,101,120,84,114,105,112,108,101,116,68,97,116,97,
-0,98,116,67,104,97,114,73,110,100,101,120,84,114,105,112,108,101,116,68,
-97,116,97,0,98,116,77,101,115,104,80,97,114,116,68,97,116,97,0,98,
-116,83,116,114,105,100,105,110,103,77,101,115,104,73,110,116,101,114,102,97,
-99,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,77,101,115,
-104,83,104,97,112,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,
-101,73,110,102,111,77,97,112,68,97,116,97,0,98,116,83,99,97,108,101,
-100,84,114,105,97,110,103,108,101,77,101,115,104,83,104,97,112,101,68,97,
-116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,97,112,101,67,104,
-105,108,100,68,97,116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,
-97,112,101,68,97,116,97,0,98,116,67,121,108,105,110,100,101,114,83,104,
-97,112,101,68,97,116,97,0,98,116,67,97,112,115,117,108,101,83,104,97,
-112,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,73,110,102,
-111,68,97,116,97,0,98,116,71,73,109,112,97,99,116,77,101,115,104,83,
-104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,72,117,108,
-108,83,104,97,112,101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,
-111,110,79,98,106,101,99,116,68,111,117,98,108,101,68,97,116,97,0,98,
-116,67,111,108,108,105,115,105,111,110,79,98,106,101,99,116,70,108,111,97,
-116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,70,108,111,
-97,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,68,111,
-117,98,108,101,68,97,116,97,0,98,116,67,111,110,115,116,114,97,105,110,
-116,73,110,102,111,49,0,98,116,84,121,112,101,100,67,111,110,115,116,114,
-97,105,110,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,
-68,97,116,97,0,98,116,80,111,105,110,116,50,80,111,105,110,116,67,111,
-110,115,116,114,97,105,110,116,70,108,111,97,116,68,97,116,97,0,98,116,
-80,111,105,110,116,50,80,111,105,110,116,67,111,110,115,116,114,97,105,110,
-116,68,111,117,98,108,101,68,97,116,97,0,98,116,72,105,110,103,101,67,
-111,110,115,116,114,97,105,110,116,68,111,117,98,108,101,68,97,116,97,0,
-98,116,72,105,110,103,101,67,111,110,115,116,114,97,105,110,116,70,108,111,
-97,116,68,97,116,97,0,98,116,67,111,110,101,84,119,105,115,116,67,111,
-110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,71,101,110,101,114,
-105,99,54,68,111,102,67,111,110,115,116,114,97,105,110,116,68,97,116,97,
-0,98,116,71,101,110,101,114,105,99,54,68,111,102,83,112,114,105,110,103,
-67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,83,108,105,
-100,101,114,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,83,111,
-102,116,66,111,100,121,77,97,116,101,114,105,97,108,68,97,116,97,0,83,
-111,102,116,66,111,100,121,78,111,100,101,68,97,116,97,0,83,111,102,116,
-66,111,100,121,76,105,110,107,68,97,116,97,0,83,111,102,116,66,111,100,
-121,70,97,99,101,68,97,116,97,0,83,111,102,116,66,111,100,121,84,101,
-116,114,97,68,97,116,97,0,83,111,102,116,82,105,103,105,100,65,110,99,
-104,111,114,68,97,116,97,0,83,111,102,116,66,111,100,121,67,111,110,102,
-105,103,68,97,116,97,0,83,111,102,116,66,111,100,121,80,111,115,101,68,
-97,116,97,0,83,111,102,116,66,111,100,121,67,108,117,115,116,101,114,68,
-97,116,97,0,98,116,83,111,102,116,66,111,100,121,74,111,105,110,116,68,
-97,116,97,0,98,116,83,111,102,116,66,111,100,121,70,108,111,97,116,68,
-97,116,97,0,84,76,69,78,1,0,1,0,2,0,2,0,4,0,4,0,
-4,0,4,0,8,0,0,0,12,0,36,0,8,0,16,0,32,0,48,0,
-96,0,64,0,-128,0,20,0,48,0,80,0,16,0,84,0,-124,0,12,0,
-52,0,52,0,20,0,64,0,4,0,4,0,8,0,4,0,32,0,28,0,
-60,0,56,0,76,0,76,0,24,0,60,0,60,0,16,0,64,0,68,0,
--56,1,-8,0,-32,1,-104,3,8,0,44,0,0,0,76,0,108,0,84,1,
--44,0,-52,0,-12,0,84,1,-60,0,16,0,100,0,20,0,36,0,100,0,
-92,0,104,0,-64,0,92,1,104,0,-92,1,83,84,82,67,61,0,0,0,
-10,0,3,0,4,0,0,0,4,0,1,0,9,0,2,0,11,0,3,0,
-10,0,3,0,10,0,4,0,10,0,5,0,12,0,2,0,9,0,6,0,
-9,0,7,0,13,0,1,0,7,0,8,0,14,0,1,0,8,0,8,0,
-15,0,1,0,13,0,9,0,16,0,1,0,14,0,9,0,17,0,2,0,
-15,0,10,0,13,0,11,0,18,0,2,0,16,0,10,0,14,0,11,0,
-19,0,4,0,4,0,12,0,4,0,13,0,2,0,14,0,2,0,15,0,
-20,0,6,0,13,0,16,0,13,0,17,0,4,0,18,0,4,0,19,0,
-4,0,20,0,0,0,21,0,21,0,6,0,14,0,16,0,14,0,17,0,
-4,0,18,0,4,0,19,0,4,0,20,0,0,0,21,0,22,0,3,0,
-2,0,14,0,2,0,15,0,4,0,22,0,23,0,12,0,13,0,23,0,
-13,0,24,0,13,0,25,0,4,0,26,0,4,0,27,0,4,0,28,0,
-4,0,29,0,20,0,30,0,22,0,31,0,19,0,32,0,4,0,33,0,
-4,0,34,0,24,0,12,0,14,0,23,0,14,0,24,0,14,0,25,0,
-4,0,26,0,4,0,27,0,4,0,28,0,4,0,29,0,21,0,30,0,
-22,0,31,0,4,0,33,0,4,0,34,0,19,0,32,0,25,0,3,0,
-0,0,35,0,4,0,36,0,0,0,37,0,26,0,5,0,25,0,38,0,
-13,0,39,0,13,0,40,0,7,0,41,0,0,0,21,0,27,0,5,0,
-25,0,38,0,13,0,39,0,13,0,42,0,7,0,43,0,4,0,44,0,
-28,0,2,0,13,0,45,0,7,0,46,0,29,0,4,0,27,0,47,0,
-28,0,48,0,4,0,49,0,0,0,37,0,30,0,1,0,4,0,50,0,
-31,0,2,0,2,0,50,0,0,0,51,0,32,0,2,0,2,0,52,0,
-0,0,51,0,33,0,2,0,0,0,52,0,0,0,53,0,34,0,8,0,
-13,0,54,0,14,0,55,0,30,0,56,0,32,0,57,0,33,0,58,0,
-31,0,59,0,4,0,60,0,4,0,61,0,35,0,4,0,34,0,62,0,
-13,0,63,0,4,0,64,0,0,0,37,0,36,0,7,0,25,0,38,0,
-35,0,65,0,23,0,66,0,24,0,67,0,37,0,68,0,7,0,43,0,
-0,0,69,0,38,0,2,0,36,0,70,0,13,0,39,0,39,0,4,0,
-17,0,71,0,25,0,72,0,4,0,73,0,7,0,74,0,40,0,4,0,
-25,0,38,0,39,0,75,0,4,0,76,0,7,0,43,0,41,0,3,0,
-27,0,47,0,4,0,77,0,0,0,37,0,42,0,3,0,27,0,47,0,
-4,0,77,0,0,0,37,0,43,0,4,0,4,0,78,0,7,0,79,0,
-7,0,80,0,7,0,81,0,37,0,14,0,4,0,82,0,4,0,83,0,
-43,0,84,0,4,0,85,0,7,0,86,0,7,0,87,0,7,0,88,0,
-7,0,89,0,7,0,90,0,4,0,91,0,4,0,92,0,4,0,93,0,
-4,0,94,0,0,0,37,0,44,0,5,0,25,0,38,0,35,0,65,0,
-13,0,39,0,7,0,43,0,4,0,95,0,45,0,5,0,27,0,47,0,
-13,0,96,0,14,0,97,0,4,0,98,0,0,0,99,0,46,0,24,0,
-9,0,100,0,9,0,101,0,25,0,102,0,0,0,35,0,18,0,103,0,
-18,0,104,0,14,0,105,0,14,0,106,0,14,0,107,0,8,0,108,0,
-8,0,109,0,8,0,110,0,8,0,111,0,8,0,112,0,8,0,113,0,
-8,0,114,0,4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0,
-4,0,119,0,4,0,120,0,4,0,121,0,0,0,37,0,47,0,23,0,
-9,0,100,0,9,0,101,0,25,0,102,0,0,0,35,0,17,0,103,0,
-17,0,104,0,13,0,105,0,13,0,106,0,13,0,107,0,7,0,108,0,
-7,0,109,0,7,0,110,0,7,0,111,0,7,0,112,0,7,0,113,0,
-7,0,114,0,4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0,
-4,0,119,0,4,0,120,0,4,0,121,0,48,0,21,0,47,0,122,0,
-15,0,123,0,13,0,124,0,13,0,125,0,13,0,126,0,13,0,127,0,
-13,0,-128,0,13,0,-127,0,13,0,-126,0,13,0,-125,0,13,0,-124,0,
-7,0,-123,0,7,0,-122,0,7,0,-121,0,7,0,-120,0,7,0,-119,0,
-7,0,-118,0,7,0,-117,0,7,0,-116,0,7,0,-115,0,4,0,-114,0,
-49,0,22,0,46,0,122,0,16,0,123,0,14,0,124,0,14,0,125,0,
-14,0,126,0,14,0,127,0,14,0,-128,0,14,0,-127,0,14,0,-126,0,
-14,0,-125,0,14,0,-124,0,8,0,-123,0,8,0,-122,0,8,0,-121,0,
-8,0,-120,0,8,0,-119,0,8,0,-118,0,8,0,-117,0,8,0,-116,0,
-8,0,-115,0,4,0,-114,0,0,0,37,0,50,0,2,0,4,0,-113,0,
-4,0,-112,0,51,0,11,0,52,0,-111,0,52,0,-110,0,0,0,35,0,
-4,0,-109,0,4,0,-108,0,4,0,-107,0,4,0,-106,0,7,0,-105,0,
-7,0,-104,0,4,0,-103,0,0,0,-102,0,53,0,3,0,51,0,-101,0,
-13,0,-100,0,13,0,-99,0,54,0,3,0,51,0,-101,0,14,0,-100,0,
-14,0,-99,0,55,0,13,0,51,0,-101,0,18,0,-98,0,18,0,-97,0,
-4,0,-96,0,4,0,-95,0,4,0,-94,0,7,0,-93,0,7,0,-92,0,
-7,0,-91,0,7,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,
-56,0,13,0,51,0,-101,0,17,0,-98,0,17,0,-97,0,4,0,-96,0,
-4,0,-95,0,4,0,-94,0,7,0,-93,0,7,0,-92,0,7,0,-91,0,
-7,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,57,0,11,0,
-51,0,-101,0,17,0,-98,0,17,0,-97,0,7,0,-86,0,7,0,-85,0,
-7,0,-84,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,7,0,-83,0,
-0,0,21,0,58,0,9,0,51,0,-101,0,17,0,-98,0,17,0,-97,0,
-13,0,-82,0,13,0,-81,0,13,0,-80,0,13,0,-79,0,4,0,-78,0,
-4,0,-77,0,59,0,5,0,58,0,-76,0,4,0,-75,0,7,0,-74,0,
-7,0,-73,0,7,0,-72,0,60,0,9,0,51,0,-101,0,17,0,-98,0,
-17,0,-97,0,7,0,-82,0,7,0,-81,0,7,0,-80,0,7,0,-79,0,
-4,0,-78,0,4,0,-77,0,61,0,4,0,7,0,-71,0,7,0,-70,0,
-7,0,-69,0,4,0,78,0,62,0,10,0,61,0,-68,0,13,0,-67,0,
-13,0,-66,0,13,0,-65,0,13,0,-64,0,13,0,-63,0,7,0,-123,0,
-7,0,-62,0,4,0,-61,0,4,0,53,0,63,0,4,0,61,0,-68,0,
-4,0,-60,0,7,0,-59,0,4,0,-58,0,64,0,4,0,13,0,-63,0,
-61,0,-68,0,4,0,-57,0,7,0,-56,0,65,0,7,0,13,0,-55,0,
-61,0,-68,0,4,0,-54,0,7,0,-53,0,7,0,-52,0,7,0,-51,0,
-4,0,53,0,66,0,6,0,15,0,-50,0,13,0,-52,0,13,0,-49,0,
-52,0,-48,0,4,0,-47,0,7,0,-51,0,67,0,26,0,4,0,-46,0,
-7,0,-45,0,7,0,-83,0,7,0,-44,0,7,0,-43,0,7,0,-42,0,
-7,0,-41,0,7,0,-40,0,7,0,-39,0,7,0,-38,0,7,0,-37,0,
-7,0,-36,0,7,0,-35,0,7,0,-34,0,7,0,-33,0,7,0,-32,0,
-7,0,-31,0,7,0,-30,0,7,0,-29,0,7,0,-28,0,7,0,-27,0,
-4,0,-26,0,4,0,-25,0,4,0,-24,0,4,0,-23,0,4,0,116,0,
-68,0,12,0,15,0,-22,0,15,0,-21,0,15,0,-20,0,13,0,-19,0,
-13,0,-18,0,7,0,-17,0,4,0,-16,0,4,0,-15,0,4,0,-14,0,
-4,0,-13,0,7,0,-53,0,4,0,53,0,69,0,27,0,17,0,-12,0,
-15,0,-11,0,15,0,-10,0,13,0,-19,0,13,0,-9,0,13,0,-8,0,
-13,0,-7,0,13,0,-6,0,13,0,-5,0,4,0,-4,0,7,0,-3,0,
-4,0,-2,0,4,0,-1,0,4,0,0,1,7,0,1,1,7,0,2,1,
-4,0,3,1,4,0,4,1,7,0,5,1,7,0,6,1,7,0,7,1,
-7,0,8,1,7,0,9,1,7,0,10,1,4,0,11,1,4,0,12,1,
-4,0,13,1,70,0,12,0,9,0,14,1,9,0,15,1,13,0,16,1,
-7,0,17,1,7,0,18,1,7,0,19,1,4,0,20,1,13,0,21,1,
-4,0,22,1,4,0,23,1,4,0,24,1,4,0,53,0,71,0,19,0,
-47,0,122,0,68,0,25,1,61,0,26,1,62,0,27,1,63,0,28,1,
-64,0,29,1,65,0,30,1,66,0,31,1,69,0,32,1,70,0,33,1,
-4,0,34,1,4,0,-1,0,4,0,35,1,4,0,36,1,4,0,37,1,
-4,0,38,1,4,0,39,1,4,0,40,1,67,0,41,1,};
-int sBulletDNAlen= sizeof(sBulletDNAstr);
-unsigned char sBulletDNAstr64[]= {
-83,68,78,65,78,65,77,69,42,1,0,0,109,95,115,105,122,101,0,109,
-95,99,97,112,97,99,105,116,121,0,42,109,95,100,97,116,97,0,109,95,
-99,111,108,108,105,115,105,111,110,83,104,97,112,101,115,0,109,95,99,111,
-108,108,105,115,105,111,110,79,98,106,101,99,116,115,0,109,95,99,111,110,
-115,116,114,97,105,110,116,115,0,42,102,105,114,115,116,0,42,108,97,115,
-116,0,109,95,102,108,111,97,116,115,91,52,93,0,109,95,101,108,91,51,
-93,0,109,95,98,97,115,105,115,0,109,95,111,114,105,103,105,110,0,109,
-95,114,111,111,116,78,111,100,101,73,110,100,101,120,0,109,95,115,117,98,
-116,114,101,101,83,105,122,101,0,109,95,113,117,97,110,116,105,122,101,100,
-65,97,98,98,77,105,110,91,51,93,0,109,95,113,117,97,110,116,105,122,
-101,100,65,97,98,98,77,97,120,91,51,93,0,109,95,97,97,98,98,77,
-105,110,79,114,103,0,109,95,97,97,98,98,77,97,120,79,114,103,0,109,
-95,101,115,99,97,112,101,73,110,100,101,120,0,109,95,115,117,98,80,97,
-114,116,0,109,95,116,114,105,97,110,103,108,101,73,110,100,101,120,0,109,
-95,112,97,100,91,52,93,0,109,95,101,115,99,97,112,101,73,110,100,101,
-120,79,114,84,114,105,97,110,103,108,101,73,110,100,101,120,0,109,95,98,
-118,104,65,97,98,98,77,105,110,0,109,95,98,118,104,65,97,98,98,77,
-97,120,0,109,95,98,118,104,81,117,97,110,116,105,122,97,116,105,111,110,
-0,109,95,99,117,114,78,111,100,101,73,110,100,101,120,0,109,95,117,115,
-101,81,117,97,110,116,105,122,97,116,105,111,110,0,109,95,110,117,109,67,
-111,110,116,105,103,117,111,117,115,76,101,97,102,78,111,100,101,115,0,109,
-95,110,117,109,81,117,97,110,116,105,122,101,100,67,111,110,116,105,103,117,
-111,117,115,78,111,100,101,115,0,42,109,95,99,111,110,116,105,103,117,111,
-117,115,78,111,100,101,115,80,116,114,0,42,109,95,113,117,97,110,116,105,
-122,101,100,67,111,110,116,105,103,117,111,117,115,78,111,100,101,115,80,116,
-114,0,42,109,95,115,117,98,84,114,101,101,73,110,102,111,80,116,114,0,
-109,95,116,114,97,118,101,114,115,97,108,77,111,100,101,0,109,95,110,117,
-109,83,117,98,116,114,101,101,72,101,97,100,101,114,115,0,42,109,95,110,
-97,109,101,0,109,95,115,104,97,112,101,84,121,112,101,0,109,95,112,97,
-100,100,105,110,103,91,52,93,0,109,95,99,111,108,108,105,115,105,111,110,
-83,104,97,112,101,68,97,116,97,0,109,95,108,111,99,97,108,83,99,97,
-108,105,110,103,0,109,95,112,108,97,110,101,78,111,114,109,97,108,0,109,
-95,112,108,97,110,101,67,111,110,115,116,97,110,116,0,109,95,105,109,112,
-108,105,99,105,116,83,104,97,112,101,68,105,109,101,110,115,105,111,110,115,
-0,109,95,99,111,108,108,105,115,105,111,110,77,97,114,103,105,110,0,109,
-95,112,97,100,100,105,110,103,0,109,95,112,111,115,0,109,95,114,97,100,
-105,117,115,0,109,95,99,111,110,118,101,120,73,110,116,101,114,110,97,108,
-83,104,97,112,101,68,97,116,97,0,42,109,95,108,111,99,97,108,80,111,
-115,105,116,105,111,110,65,114,114,97,121,80,116,114,0,109,95,108,111,99,
-97,108,80,111,115,105,116,105,111,110,65,114,114,97,121,83,105,122,101,0,
-109,95,118,97,108,117,101,0,109,95,112,97,100,91,50,93,0,109,95,118,
-97,108,117,101,115,91,51,93,0,109,95,112,97,100,0,42,109,95,118,101,
-114,116,105,99,101,115,51,102,0,42,109,95,118,101,114,116,105,99,101,115,
-51,100,0,42,109,95,105,110,100,105,99,101,115,51,50,0,42,109,95,51,
-105,110,100,105,99,101,115,49,54,0,42,109,95,51,105,110,100,105,99,101,
-115,56,0,42,109,95,105,110,100,105,99,101,115,49,54,0,109,95,110,117,
-109,84,114,105,97,110,103,108,101,115,0,109,95,110,117,109,86,101,114,116,
-105,99,101,115,0,42,109,95,109,101,115,104,80,97,114,116,115,80,116,114,
-0,109,95,115,99,97,108,105,110,103,0,109,95,110,117,109,77,101,115,104,
-80,97,114,116,115,0,109,95,109,101,115,104,73,110,116,101,114,102,97,99,
-101,0,42,109,95,113,117,97,110,116,105,122,101,100,70,108,111,97,116,66,
-118,104,0,42,109,95,113,117,97,110,116,105,122,101,100,68,111,117,98,108,
-101,66,118,104,0,42,109,95,116,114,105,97,110,103,108,101,73,110,102,111,
-77,97,112,0,109,95,112,97,100,51,91,52,93,0,109,95,116,114,105,109,
-101,115,104,83,104,97,112,101,68,97,116,97,0,109,95,116,114,97,110,115,
-102,111,114,109,0,42,109,95,99,104,105,108,100,83,104,97,112,101,0,109,
-95,99,104,105,108,100,83,104,97,112,101,84,121,112,101,0,109,95,99,104,
-105,108,100,77,97,114,103,105,110,0,42,109,95,99,104,105,108,100,83,104,
-97,112,101,80,116,114,0,109,95,110,117,109,67,104,105,108,100,83,104,97,
-112,101,115,0,109,95,117,112,65,120,105,115,0,109,95,102,108,97,103,115,
-0,109,95,101,100,103,101,86,48,86,49,65,110,103,108,101,0,109,95,101,
-100,103,101,86,49,86,50,65,110,103,108,101,0,109,95,101,100,103,101,86,
-50,86,48,65,110,103,108,101,0,42,109,95,104,97,115,104,84,97,98,108,
-101,80,116,114,0,42,109,95,110,101,120,116,80,116,114,0,42,109,95,118,
-97,108,117,101,65,114,114,97,121,80,116,114,0,42,109,95,107,101,121,65,
-114,114,97,121,80,116,114,0,109,95,99,111,110,118,101,120,69,112,115,105,
-108,111,110,0,109,95,112,108,97,110,97,114,69,112,115,105,108,111,110,0,
-109,95,101,113,117,97,108,86,101,114,116,101,120,84,104,114,101,115,104,111,
-108,100,0,109,95,101,100,103,101,68,105,115,116,97,110,99,101,84,104,114,
-101,115,104,111,108,100,0,109,95,122,101,114,111,65,114,101,97,84,104,114,
-101,115,104,111,108,100,0,109,95,110,101,120,116,83,105,122,101,0,109,95,
-104,97,115,104,84,97,98,108,101,83,105,122,101,0,109,95,110,117,109,86,
-97,108,117,101,115,0,109,95,110,117,109,75,101,121,115,0,109,95,103,105,
-109,112,97,99,116,83,117,98,84,121,112,101,0,42,109,95,117,110,115,99,
-97,108,101,100,80,111,105,110,116,115,70,108,111,97,116,80,116,114,0,42,
-109,95,117,110,115,99,97,108,101,100,80,111,105,110,116,115,68,111,117,98,
-108,101,80,116,114,0,109,95,110,117,109,85,110,115,99,97,108,101,100,80,
-111,105,110,116,115,0,109,95,112,97,100,100,105,110,103,51,91,52,93,0,
-42,109,95,98,114,111,97,100,112,104,97,115,101,72,97,110,100,108,101,0,
-42,109,95,99,111,108,108,105,115,105,111,110,83,104,97,112,101,0,42,109,
-95,114,111,111,116,67,111,108,108,105,115,105,111,110,83,104,97,112,101,0,
-109,95,119,111,114,108,100,84,114,97,110,115,102,111,114,109,0,109,95,105,
-110,116,101,114,112,111,108,97,116,105,111,110,87,111,114,108,100,84,114,97,
-110,115,102,111,114,109,0,109,95,105,110,116,101,114,112,111,108,97,116,105,
-111,110,76,105,110,101,97,114,86,101,108,111,99,105,116,121,0,109,95,105,
-110,116,101,114,112,111,108,97,116,105,111,110,65,110,103,117,108,97,114,86,
-101,108,111,99,105,116,121,0,109,95,97,110,105,115,111,116,114,111,112,105,
-99,70,114,105,99,116,105,111,110,0,109,95,99,111,110,116,97,99,116,80,
-114,111,99,101,115,115,105,110,103,84,104,114,101,115,104,111,108,100,0,109,
-95,100,101,97,99,116,105,118,97,116,105,111,110,84,105,109,101,0,109,95,
-102,114,105,99,116,105,111,110,0,109,95,114,101,115,116,105,116,117,116,105,
-111,110,0,109,95,104,105,116,70,114,97,99,116,105,111,110,0,109,95,99,
-99,100,83,119,101,112,116,83,112,104,101,114,101,82,97,100,105,117,115,0,
-109,95,99,99,100,77,111,116,105,111,110,84,104,114,101,115,104,111,108,100,
-0,109,95,104,97,115,65,110,105,115,111,116,114,111,112,105,99,70,114,105,
-99,116,105,111,110,0,109,95,99,111,108,108,105,115,105,111,110,70,108,97,
-103,115,0,109,95,105,115,108,97,110,100,84,97,103,49,0,109,95,99,111,
-109,112,97,110,105,111,110,73,100,0,109,95,97,99,116,105,118,97,116,105,
-111,110,83,116,97,116,101,49,0,109,95,105,110,116,101,114,110,97,108,84,
-121,112,101,0,109,95,99,104,101,99,107,67,111,108,108,105,100,101,87,105,
-116,104,0,109,95,99,111,108,108,105,115,105,111,110,79,98,106,101,99,116,
-68,97,116,97,0,109,95,105,110,118,73,110,101,114,116,105,97,84,101,110,
-115,111,114,87,111,114,108,100,0,109,95,108,105,110,101,97,114,86,101,108,
-111,99,105,116,121,0,109,95,97,110,103,117,108,97,114,86,101,108,111,99,
-105,116,121,0,109,95,97,110,103,117,108,97,114,70,97,99,116,111,114,0,
-109,95,108,105,110,101,97,114,70,97,99,116,111,114,0,109,95,103,114,97,
-118,105,116,121,0,109,95,103,114,97,118,105,116,121,95,97,99,99,101,108,
-101,114,97,116,105,111,110,0,109,95,105,110,118,73,110,101,114,116,105,97,
-76,111,99,97,108,0,109,95,116,111,116,97,108,70,111,114,99,101,0,109,
-95,116,111,116,97,108,84,111,114,113,117,101,0,109,95,105,110,118,101,114,
-115,101,77,97,115,115,0,109,95,108,105,110,101,97,114,68,97,109,112,105,
-110,103,0,109,95,97,110,103,117,108,97,114,68,97,109,112,105,110,103,0,
-109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,112,105,110,103,70,
-97,99,116,111,114,0,109,95,97,100,100,105,116,105,111,110,97,108,76,105,
-110,101,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,
-83,113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,
-108,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,83,
-113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,108,
-97,114,68,97,109,112,105,110,103,70,97,99,116,111,114,0,109,95,108,105,
-110,101,97,114,83,108,101,101,112,105,110,103,84,104,114,101,115,104,111,108,
-100,0,109,95,97,110,103,117,108,97,114,83,108,101,101,112,105,110,103,84,
-104,114,101,115,104,111,108,100,0,109,95,97,100,100,105,116,105,111,110,97,
-108,68,97,109,112,105,110,103,0,109,95,110,117,109,67,111,110,115,116,114,
-97,105,110,116,82,111,119,115,0,110,117,98,0,42,109,95,114,98,65,0,
-42,109,95,114,98,66,0,109,95,111,98,106,101,99,116,84,121,112,101,0,
-109,95,117,115,101,114,67,111,110,115,116,114,97,105,110,116,84,121,112,101,
-0,109,95,117,115,101,114,67,111,110,115,116,114,97,105,110,116,73,100,0,
-109,95,110,101,101,100,115,70,101,101,100,98,97,99,107,0,109,95,97,112,
-112,108,105,101,100,73,109,112,117,108,115,101,0,109,95,100,98,103,68,114,
-97,119,83,105,122,101,0,109,95,100,105,115,97,98,108,101,67,111,108,108,
-105,115,105,111,110,115,66,101,116,119,101,101,110,76,105,110,107,101,100,66,
-111,100,105,101,115,0,109,95,112,97,100,52,91,52,93,0,109,95,116,121,
-112,101,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,109,95,112,
-105,118,111,116,73,110,65,0,109,95,112,105,118,111,116,73,110,66,0,109,
-95,114,98,65,70,114,97,109,101,0,109,95,114,98,66,70,114,97,109,101,
-0,109,95,117,115,101,82,101,102,101,114,101,110,99,101,70,114,97,109,101,
-65,0,109,95,97,110,103,117,108,97,114,79,110,108,121,0,109,95,101,110,
-97,98,108,101,65,110,103,117,108,97,114,77,111,116,111,114,0,109,95,109,
-111,116,111,114,84,97,114,103,101,116,86,101,108,111,99,105,116,121,0,109,
-95,109,97,120,77,111,116,111,114,73,109,112,117,108,115,101,0,109,95,108,
-111,119,101,114,76,105,109,105,116,0,109,95,117,112,112,101,114,76,105,109,
-105,116,0,109,95,108,105,109,105,116,83,111,102,116,110,101,115,115,0,109,
-95,98,105,97,115,70,97,99,116,111,114,0,109,95,114,101,108,97,120,97,
-116,105,111,110,70,97,99,116,111,114,0,109,95,115,119,105,110,103,83,112,
-97,110,49,0,109,95,115,119,105,110,103,83,112,97,110,50,0,109,95,116,
-119,105,115,116,83,112,97,110,0,109,95,100,97,109,112,105,110,103,0,109,
-95,108,105,110,101,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,
-108,105,110,101,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,97,
-110,103,117,108,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,97,
-110,103,117,108,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,117,
-115,101,76,105,110,101,97,114,82,101,102,101,114,101,110,99,101,70,114,97,
-109,101,65,0,109,95,117,115,101,79,102,102,115,101,116,70,111,114,67,111,
-110,115,116,114,97,105,110,116,70,114,97,109,101,0,109,95,54,100,111,102,
-68,97,116,97,0,109,95,115,112,114,105,110,103,69,110,97,98,108,101,100,
-91,54,93,0,109,95,101,113,117,105,108,105,98,114,105,117,109,80,111,105,
-110,116,91,54,93,0,109,95,115,112,114,105,110,103,83,116,105,102,102,110,
-101,115,115,91,54,93,0,109,95,115,112,114,105,110,103,68,97,109,112,105,
-110,103,91,54,93,0,109,95,108,105,110,101,97,114,83,116,105,102,102,110,
-101,115,115,0,109,95,97,110,103,117,108,97,114,83,116,105,102,102,110,101,
-115,115,0,109,95,118,111,108,117,109,101,83,116,105,102,102,110,101,115,115,
-0,42,109,95,109,97,116,101,114,105,97,108,0,109,95,112,111,115,105,116,
-105,111,110,0,109,95,112,114,101,118,105,111,117,115,80,111,115,105,116,105,
-111,110,0,109,95,118,101,108,111,99,105,116,121,0,109,95,97,99,99,117,
-109,117,108,97,116,101,100,70,111,114,99,101,0,109,95,110,111,114,109,97,
-108,0,109,95,97,114,101,97,0,109,95,97,116,116,97,99,104,0,109,95,
-110,111,100,101,73,110,100,105,99,101,115,91,50,93,0,109,95,114,101,115,
-116,76,101,110,103,116,104,0,109,95,98,98,101,110,100,105,110,103,0,109,
-95,110,111,100,101,73,110,100,105,99,101,115,91,51,93,0,109,95,114,101,
-115,116,65,114,101,97,0,109,95,99,48,91,52,93,0,109,95,110,111,100,
-101,73,110,100,105,99,101,115,91,52,93,0,109,95,114,101,115,116,86,111,
-108,117,109,101,0,109,95,99,49,0,109,95,99,50,0,109,95,99,48,0,
-109,95,108,111,99,97,108,70,114,97,109,101,0,42,109,95,114,105,103,105,
-100,66,111,100,121,0,109,95,110,111,100,101,73,110,100,101,120,0,109,95,
-97,101,114,111,77,111,100,101,108,0,109,95,98,97,117,109,103,97,114,116,
-101,0,109,95,100,114,97,103,0,109,95,108,105,102,116,0,109,95,112,114,
-101,115,115,117,114,101,0,109,95,118,111,108,117,109,101,0,109,95,100,121,
-110,97,109,105,99,70,114,105,99,116,105,111,110,0,109,95,112,111,115,101,
-77,97,116,99,104,0,109,95,114,105,103,105,100,67,111,110,116,97,99,116,
-72,97,114,100,110,101,115,115,0,109,95,107,105,110,101,116,105,99,67,111,
-110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,
-67,111,110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,97,110,
-99,104,111,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,82,
-105,103,105,100,67,108,117,115,116,101,114,72,97,114,100,110,101,115,115,0,
-109,95,115,111,102,116,75,105,110,101,116,105,99,67,108,117,115,116,101,114,
-72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,83,111,102,116,67,
-108,117,115,116,101,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,
-116,82,105,103,105,100,67,108,117,115,116,101,114,73,109,112,117,108,115,101,
-83,112,108,105,116,0,109,95,115,111,102,116,75,105,110,101,116,105,99,67,
-108,117,115,116,101,114,73,109,112,117,108,115,101,83,112,108,105,116,0,109,
-95,115,111,102,116,83,111,102,116,67,108,117,115,116,101,114,73,109,112,117,
-108,115,101,83,112,108,105,116,0,109,95,109,97,120,86,111,108,117,109,101,
-0,109,95,116,105,109,101,83,99,97,108,101,0,109,95,118,101,108,111,99,
-105,116,121,73,116,101,114,97,116,105,111,110,115,0,109,95,112,111,115,105,
-116,105,111,110,73,116,101,114,97,116,105,111,110,115,0,109,95,100,114,105,
-102,116,73,116,101,114,97,116,105,111,110,115,0,109,95,99,108,117,115,116,
-101,114,73,116,101,114,97,116,105,111,110,115,0,109,95,114,111,116,0,109,
-95,115,99,97,108,101,0,109,95,97,113,113,0,109,95,99,111,109,0,42,
-109,95,112,111,115,105,116,105,111,110,115,0,42,109,95,119,101,105,103,104,
-116,115,0,109,95,110,117,109,80,111,115,105,116,105,111,110,115,0,109,95,
-110,117,109,87,101,105,103,116,115,0,109,95,98,118,111,108,117,109,101,0,
-109,95,98,102,114,97,109,101,0,109,95,102,114,97,109,101,120,102,111,114,
-109,0,109,95,108,111,99,105,105,0,109,95,105,110,118,119,105,0,109,95,
-118,105,109,112,117,108,115,101,115,91,50,93,0,109,95,100,105,109,112,117,
-108,115,101,115,91,50,93,0,109,95,108,118,0,109,95,97,118,0,42,109,
-95,102,114,97,109,101,114,101,102,115,0,42,109,95,110,111,100,101,73,110,
-100,105,99,101,115,0,42,109,95,109,97,115,115,101,115,0,109,95,110,117,
-109,70,114,97,109,101,82,101,102,115,0,109,95,110,117,109,78,111,100,101,
-115,0,109,95,110,117,109,77,97,115,115,101,115,0,109,95,105,100,109,97,
-115,115,0,109,95,105,109,97,115,115,0,109,95,110,118,105,109,112,117,108,
-115,101,115,0,109,95,110,100,105,109,112,117,108,115,101,115,0,109,95,110,
-100,97,109,112,105,110,103,0,109,95,108,100,97,109,112,105,110,103,0,109,
-95,97,100,97,109,112,105,110,103,0,109,95,109,97,116,99,104,105,110,103,
-0,109,95,109,97,120,83,101,108,102,67,111,108,108,105,115,105,111,110,73,
-109,112,117,108,115,101,0,109,95,115,101,108,102,67,111,108,108,105,115,105,
-111,110,73,109,112,117,108,115,101,70,97,99,116,111,114,0,109,95,99,111,
-110,116,97,105,110,115,65,110,99,104,111,114,0,109,95,99,111,108,108,105,
-100,101,0,109,95,99,108,117,115,116,101,114,73,110,100,101,120,0,42,109,
-95,98,111,100,121,65,0,42,109,95,98,111,100,121,66,0,109,95,114,101,
-102,115,91,50,93,0,109,95,99,102,109,0,109,95,101,114,112,0,109,95,
-115,112,108,105,116,0,109,95,100,101,108,101,116,101,0,109,95,114,101,108,
-80,111,115,105,116,105,111,110,91,50,93,0,109,95,98,111,100,121,65,116,
-121,112,101,0,109,95,98,111,100,121,66,116,121,112,101,0,109,95,106,111,
-105,110,116,84,121,112,101,0,42,109,95,112,111,115,101,0,42,42,109,95,
-109,97,116,101,114,105,97,108,115,0,42,109,95,110,111,100,101,115,0,42,
-109,95,108,105,110,107,115,0,42,109,95,102,97,99,101,115,0,42,109,95,
-116,101,116,114,97,104,101,100,114,97,0,42,109,95,97,110,99,104,111,114,
-115,0,42,109,95,99,108,117,115,116,101,114,115,0,42,109,95,106,111,105,
-110,116,115,0,109,95,110,117,109,77,97,116,101,114,105,97,108,115,0,109,
-95,110,117,109,76,105,110,107,115,0,109,95,110,117,109,70,97,99,101,115,
-0,109,95,110,117,109,84,101,116,114,97,104,101,100,114,97,0,109,95,110,
-117,109,65,110,99,104,111,114,115,0,109,95,110,117,109,67,108,117,115,116,
-101,114,115,0,109,95,110,117,109,74,111,105,110,116,115,0,109,95,99,111,
-110,102,105,103,0,0,0,0,84,89,80,69,72,0,0,0,99,104,97,114,
-0,117,99,104,97,114,0,115,104,111,114,116,0,117,115,104,111,114,116,0,
-105,110,116,0,108,111,110,103,0,117,108,111,110,103,0,102,108,111,97,116,
-0,100,111,117,98,108,101,0,118,111,105,100,0,80,111,105,110,116,101,114,
-65,114,114,97,121,0,98,116,80,104,121,115,105,99,115,83,121,115,116,101,
-109,0,76,105,115,116,66,97,115,101,0,98,116,86,101,99,116,111,114,51,
-70,108,111,97,116,68,97,116,97,0,98,116,86,101,99,116,111,114,51,68,
-111,117,98,108,101,68,97,116,97,0,98,116,77,97,116,114,105,120,51,120,
-51,70,108,111,97,116,68,97,116,97,0,98,116,77,97,116,114,105,120,51,
-120,51,68,111,117,98,108,101,68,97,116,97,0,98,116,84,114,97,110,115,
-102,111,114,109,70,108,111,97,116,68,97,116,97,0,98,116,84,114,97,110,
-115,102,111,114,109,68,111,117,98,108,101,68,97,116,97,0,98,116,66,118,
-104,83,117,98,116,114,101,101,73,110,102,111,68,97,116,97,0,98,116,79,
-112,116,105,109,105,122,101,100,66,118,104,78,111,100,101,70,108,111,97,116,
-68,97,116,97,0,98,116,79,112,116,105,109,105,122,101,100,66,118,104,78,
-111,100,101,68,111,117,98,108,101,68,97,116,97,0,98,116,81,117,97,110,
-116,105,122,101,100,66,118,104,78,111,100,101,68,97,116,97,0,98,116,81,
-117,97,110,116,105,122,101,100,66,118,104,70,108,111,97,116,68,97,116,97,
-0,98,116,81,117,97,110,116,105,122,101,100,66,118,104,68,111,117,98,108,
-101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,111,110,83,104,97,
-112,101,68,97,116,97,0,98,116,83,116,97,116,105,99,80,108,97,110,101,
-83,104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,73,110,
-116,101,114,110,97,108,83,104,97,112,101,68,97,116,97,0,98,116,80,111,
-115,105,116,105,111,110,65,110,100,82,97,100,105,117,115,0,98,116,77,117,
-108,116,105,83,112,104,101,114,101,83,104,97,112,101,68,97,116,97,0,98,
-116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114,
-116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114,
-116,73,110,116,73,110,100,101,120,84,114,105,112,108,101,116,68,97,116,97,
-0,98,116,67,104,97,114,73,110,100,101,120,84,114,105,112,108,101,116,68,
-97,116,97,0,98,116,77,101,115,104,80,97,114,116,68,97,116,97,0,98,
-116,83,116,114,105,100,105,110,103,77,101,115,104,73,110,116,101,114,102,97,
-99,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,77,101,115,
-104,83,104,97,112,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,
-101,73,110,102,111,77,97,112,68,97,116,97,0,98,116,83,99,97,108,101,
-100,84,114,105,97,110,103,108,101,77,101,115,104,83,104,97,112,101,68,97,
-116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,97,112,101,67,104,
-105,108,100,68,97,116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,
-97,112,101,68,97,116,97,0,98,116,67,121,108,105,110,100,101,114,83,104,
-97,112,101,68,97,116,97,0,98,116,67,97,112,115,117,108,101,83,104,97,
-112,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,73,110,102,
-111,68,97,116,97,0,98,116,71,73,109,112,97,99,116,77,101,115,104,83,
-104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,72,117,108,
-108,83,104,97,112,101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,
-111,110,79,98,106,101,99,116,68,111,117,98,108,101,68,97,116,97,0,98,
-116,67,111,108,108,105,115,105,111,110,79,98,106,101,99,116,70,108,111,97,
-116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,70,108,111,
-97,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,68,111,
-117,98,108,101,68,97,116,97,0,98,116,67,111,110,115,116,114,97,105,110,
-116,73,110,102,111,49,0,98,116,84,121,112,101,100,67,111,110,115,116,114,
-97,105,110,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,
-68,97,116,97,0,98,116,80,111,105,110,116,50,80,111,105,110,116,67,111,
-110,115,116,114,97,105,110,116,70,108,111,97,116,68,97,116,97,0,98,116,
-80,111,105,110,116,50,80,111,105,110,116,67,111,110,115,116,114,97,105,110,
-116,68,111,117,98,108,101,68,97,116,97,0,98,116,72,105,110,103,101,67,
-111,110,115,116,114,97,105,110,116,68,111,117,98,108,101,68,97,116,97,0,
-98,116,72,105,110,103,101,67,111,110,115,116,114,97,105,110,116,70,108,111,
-97,116,68,97,116,97,0,98,116,67,111,110,101,84,119,105,115,116,67,111,
-110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,71,101,110,101,114,
-105,99,54,68,111,102,67,111,110,115,116,114,97,105,110,116,68,97,116,97,
-0,98,116,71,101,110,101,114,105,99,54,68,111,102,83,112,114,105,110,103,
-67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,83,108,105,
-100,101,114,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,83,111,
-102,116,66,111,100,121,77,97,116,101,114,105,97,108,68,97,116,97,0,83,
-111,102,116,66,111,100,121,78,111,100,101,68,97,116,97,0,83,111,102,116,
-66,111,100,121,76,105,110,107,68,97,116,97,0,83,111,102,116,66,111,100,
-121,70,97,99,101,68,97,116,97,0,83,111,102,116,66,111,100,121,84,101,
-116,114,97,68,97,116,97,0,83,111,102,116,82,105,103,105,100,65,110,99,
-104,111,114,68,97,116,97,0,83,111,102,116,66,111,100,121,67,111,110,102,
-105,103,68,97,116,97,0,83,111,102,116,66,111,100,121,80,111,115,101,68,
-97,116,97,0,83,111,102,116,66,111,100,121,67,108,117,115,116,101,114,68,
-97,116,97,0,98,116,83,111,102,116,66,111,100,121,74,111,105,110,116,68,
-97,116,97,0,98,116,83,111,102,116,66,111,100,121,70,108,111,97,116,68,
-97,116,97,0,84,76,69,78,1,0,1,0,2,0,2,0,4,0,4,0,
-4,0,4,0,8,0,0,0,16,0,48,0,16,0,16,0,32,0,48,0,
-96,0,64,0,-128,0,20,0,48,0,80,0,16,0,96,0,-112,0,16,0,
-56,0,56,0,20,0,72,0,4,0,4,0,8,0,4,0,56,0,32,0,
-80,0,72,0,96,0,80,0,32,0,64,0,64,0,16,0,72,0,80,0,
--40,1,8,1,-16,1,-88,3,8,0,56,0,0,0,88,0,120,0,96,1,
--32,0,-40,0,0,1,96,1,-48,0,16,0,104,0,24,0,40,0,104,0,
-96,0,104,0,-56,0,104,1,112,0,-40,1,83,84,82,67,61,0,0,0,
-10,0,3,0,4,0,0,0,4,0,1,0,9,0,2,0,11,0,3,0,
-10,0,3,0,10,0,4,0,10,0,5,0,12,0,2,0,9,0,6,0,
-9,0,7,0,13,0,1,0,7,0,8,0,14,0,1,0,8,0,8,0,
-15,0,1,0,13,0,9,0,16,0,1,0,14,0,9,0,17,0,2,0,
-15,0,10,0,13,0,11,0,18,0,2,0,16,0,10,0,14,0,11,0,
-19,0,4,0,4,0,12,0,4,0,13,0,2,0,14,0,2,0,15,0,
-20,0,6,0,13,0,16,0,13,0,17,0,4,0,18,0,4,0,19,0,
-4,0,20,0,0,0,21,0,21,0,6,0,14,0,16,0,14,0,17,0,
-4,0,18,0,4,0,19,0,4,0,20,0,0,0,21,0,22,0,3,0,
-2,0,14,0,2,0,15,0,4,0,22,0,23,0,12,0,13,0,23,0,
-13,0,24,0,13,0,25,0,4,0,26,0,4,0,27,0,4,0,28,0,
-4,0,29,0,20,0,30,0,22,0,31,0,19,0,32,0,4,0,33,0,
-4,0,34,0,24,0,12,0,14,0,23,0,14,0,24,0,14,0,25,0,
-4,0,26,0,4,0,27,0,4,0,28,0,4,0,29,0,21,0,30,0,
-22,0,31,0,4,0,33,0,4,0,34,0,19,0,32,0,25,0,3,0,
-0,0,35,0,4,0,36,0,0,0,37,0,26,0,5,0,25,0,38,0,
-13,0,39,0,13,0,40,0,7,0,41,0,0,0,21,0,27,0,5,0,
-25,0,38,0,13,0,39,0,13,0,42,0,7,0,43,0,4,0,44,0,
-28,0,2,0,13,0,45,0,7,0,46,0,29,0,4,0,27,0,47,0,
-28,0,48,0,4,0,49,0,0,0,37,0,30,0,1,0,4,0,50,0,
-31,0,2,0,2,0,50,0,0,0,51,0,32,0,2,0,2,0,52,0,
-0,0,51,0,33,0,2,0,0,0,52,0,0,0,53,0,34,0,8,0,
-13,0,54,0,14,0,55,0,30,0,56,0,32,0,57,0,33,0,58,0,
-31,0,59,0,4,0,60,0,4,0,61,0,35,0,4,0,34,0,62,0,
-13,0,63,0,4,0,64,0,0,0,37,0,36,0,7,0,25,0,38,0,
-35,0,65,0,23,0,66,0,24,0,67,0,37,0,68,0,7,0,43,0,
-0,0,69,0,38,0,2,0,36,0,70,0,13,0,39,0,39,0,4,0,
-17,0,71,0,25,0,72,0,4,0,73,0,7,0,74,0,40,0,4,0,
-25,0,38,0,39,0,75,0,4,0,76,0,7,0,43,0,41,0,3,0,
-27,0,47,0,4,0,77,0,0,0,37,0,42,0,3,0,27,0,47,0,
-4,0,77,0,0,0,37,0,43,0,4,0,4,0,78,0,7,0,79,0,
-7,0,80,0,7,0,81,0,37,0,14,0,4,0,82,0,4,0,83,0,
-43,0,84,0,4,0,85,0,7,0,86,0,7,0,87,0,7,0,88,0,
-7,0,89,0,7,0,90,0,4,0,91,0,4,0,92,0,4,0,93,0,
-4,0,94,0,0,0,37,0,44,0,5,0,25,0,38,0,35,0,65,0,
-13,0,39,0,7,0,43,0,4,0,95,0,45,0,5,0,27,0,47,0,
-13,0,96,0,14,0,97,0,4,0,98,0,0,0,99,0,46,0,24,0,
-9,0,100,0,9,0,101,0,25,0,102,0,0,0,35,0,18,0,103,0,
-18,0,104,0,14,0,105,0,14,0,106,0,14,0,107,0,8,0,108,0,
-8,0,109,0,8,0,110,0,8,0,111,0,8,0,112,0,8,0,113,0,
-8,0,114,0,4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0,
-4,0,119,0,4,0,120,0,4,0,121,0,0,0,37,0,47,0,23,0,
-9,0,100,0,9,0,101,0,25,0,102,0,0,0,35,0,17,0,103,0,
-17,0,104,0,13,0,105,0,13,0,106,0,13,0,107,0,7,0,108,0,
-7,0,109,0,7,0,110,0,7,0,111,0,7,0,112,0,7,0,113,0,
-7,0,114,0,4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0,
-4,0,119,0,4,0,120,0,4,0,121,0,48,0,21,0,47,0,122,0,
-15,0,123,0,13,0,124,0,13,0,125,0,13,0,126,0,13,0,127,0,
-13,0,-128,0,13,0,-127,0,13,0,-126,0,13,0,-125,0,13,0,-124,0,
-7,0,-123,0,7,0,-122,0,7,0,-121,0,7,0,-120,0,7,0,-119,0,
-7,0,-118,0,7,0,-117,0,7,0,-116,0,7,0,-115,0,4,0,-114,0,
-49,0,22,0,46,0,122,0,16,0,123,0,14,0,124,0,14,0,125,0,
-14,0,126,0,14,0,127,0,14,0,-128,0,14,0,-127,0,14,0,-126,0,
-14,0,-125,0,14,0,-124,0,8,0,-123,0,8,0,-122,0,8,0,-121,0,
-8,0,-120,0,8,0,-119,0,8,0,-118,0,8,0,-117,0,8,0,-116,0,
-8,0,-115,0,4,0,-114,0,0,0,37,0,50,0,2,0,4,0,-113,0,
-4,0,-112,0,51,0,11,0,52,0,-111,0,52,0,-110,0,0,0,35,0,
-4,0,-109,0,4,0,-108,0,4,0,-107,0,4,0,-106,0,7,0,-105,0,
-7,0,-104,0,4,0,-103,0,0,0,-102,0,53,0,3,0,51,0,-101,0,
-13,0,-100,0,13,0,-99,0,54,0,3,0,51,0,-101,0,14,0,-100,0,
-14,0,-99,0,55,0,13,0,51,0,-101,0,18,0,-98,0,18,0,-97,0,
-4,0,-96,0,4,0,-95,0,4,0,-94,0,7,0,-93,0,7,0,-92,0,
-7,0,-91,0,7,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,
-56,0,13,0,51,0,-101,0,17,0,-98,0,17,0,-97,0,4,0,-96,0,
-4,0,-95,0,4,0,-94,0,7,0,-93,0,7,0,-92,0,7,0,-91,0,
-7,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,57,0,11,0,
-51,0,-101,0,17,0,-98,0,17,0,-97,0,7,0,-86,0,7,0,-85,0,
-7,0,-84,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,7,0,-83,0,
-0,0,21,0,58,0,9,0,51,0,-101,0,17,0,-98,0,17,0,-97,0,
-13,0,-82,0,13,0,-81,0,13,0,-80,0,13,0,-79,0,4,0,-78,0,
-4,0,-77,0,59,0,5,0,58,0,-76,0,4,0,-75,0,7,0,-74,0,
-7,0,-73,0,7,0,-72,0,60,0,9,0,51,0,-101,0,17,0,-98,0,
-17,0,-97,0,7,0,-82,0,7,0,-81,0,7,0,-80,0,7,0,-79,0,
-4,0,-78,0,4,0,-77,0,61,0,4,0,7,0,-71,0,7,0,-70,0,
-7,0,-69,0,4,0,78,0,62,0,10,0,61,0,-68,0,13,0,-67,0,
-13,0,-66,0,13,0,-65,0,13,0,-64,0,13,0,-63,0,7,0,-123,0,
-7,0,-62,0,4,0,-61,0,4,0,53,0,63,0,4,0,61,0,-68,0,
-4,0,-60,0,7,0,-59,0,4,0,-58,0,64,0,4,0,13,0,-63,0,
-61,0,-68,0,4,0,-57,0,7,0,-56,0,65,0,7,0,13,0,-55,0,
-61,0,-68,0,4,0,-54,0,7,0,-53,0,7,0,-52,0,7,0,-51,0,
-4,0,53,0,66,0,6,0,15,0,-50,0,13,0,-52,0,13,0,-49,0,
-52,0,-48,0,4,0,-47,0,7,0,-51,0,67,0,26,0,4,0,-46,0,
-7,0,-45,0,7,0,-83,0,7,0,-44,0,7,0,-43,0,7,0,-42,0,
-7,0,-41,0,7,0,-40,0,7,0,-39,0,7,0,-38,0,7,0,-37,0,
-7,0,-36,0,7,0,-35,0,7,0,-34,0,7,0,-33,0,7,0,-32,0,
-7,0,-31,0,7,0,-30,0,7,0,-29,0,7,0,-28,0,7,0,-27,0,
-4,0,-26,0,4,0,-25,0,4,0,-24,0,4,0,-23,0,4,0,116,0,
-68,0,12,0,15,0,-22,0,15,0,-21,0,15,0,-20,0,13,0,-19,0,
-13,0,-18,0,7,0,-17,0,4,0,-16,0,4,0,-15,0,4,0,-14,0,
-4,0,-13,0,7,0,-53,0,4,0,53,0,69,0,27,0,17,0,-12,0,
-15,0,-11,0,15,0,-10,0,13,0,-19,0,13,0,-9,0,13,0,-8,0,
-13,0,-7,0,13,0,-6,0,13,0,-5,0,4,0,-4,0,7,0,-3,0,
-4,0,-2,0,4,0,-1,0,4,0,0,1,7,0,1,1,7,0,2,1,
-4,0,3,1,4,0,4,1,7,0,5,1,7,0,6,1,7,0,7,1,
-7,0,8,1,7,0,9,1,7,0,10,1,4,0,11,1,4,0,12,1,
-4,0,13,1,70,0,12,0,9,0,14,1,9,0,15,1,13,0,16,1,
-7,0,17,1,7,0,18,1,7,0,19,1,4,0,20,1,13,0,21,1,
-4,0,22,1,4,0,23,1,4,0,24,1,4,0,53,0,71,0,19,0,
-47,0,122,0,68,0,25,1,61,0,26,1,62,0,27,1,63,0,28,1,
-64,0,29,1,65,0,30,1,66,0,31,1,69,0,32,1,70,0,33,1,
-4,0,34,1,4,0,-1,0,4,0,35,1,4,0,36,1,4,0,37,1,
-4,0,38,1,4,0,39,1,4,0,40,1,67,0,41,1,};
-int sBulletDNAlen64= sizeof(sBulletDNAstr64);
diff --git a/hkl3d/bullet/src/LinearMath/btSerializer.h b/hkl3d/bullet/src/LinearMath/btSerializer.h
deleted file mode 100644
index 8a89374..0000000
--- a/hkl3d/bullet/src/LinearMath/btSerializer.h
+++ /dev/null
@@ -1,655 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BT_SERIALIZER_H
-#define BT_SERIALIZER_H
-
-#include "btScalar.h" // has definitions like SIMD_FORCE_INLINE
-#include "btStackAlloc.h"
-#include "btHashMap.h"
-
-#if !defined( __CELLOS_LV2__) && !defined(__MWERKS__)
-#include <memory.h>
-#endif
-#include <string.h>
-
-
-
-///only the 32bit versions for now
-extern unsigned char sBulletDNAstr[];
-extern int sBulletDNAlen;
-extern unsigned char sBulletDNAstr64[];
-extern int sBulletDNAlen64;
-
-SIMD_FORCE_INLINE	int btStrLen(const char* str) 
-{
-    if (!str) 
-		return(0);
-	int len = 0;
-    
-	while (*str != 0)
-	{
-        str++;
-        len++;
-    }
-
-    return len;
-}
-
-
-class btChunk
-{
-public:
-	int		m_chunkCode;
-	int		m_length;
-	void	*m_oldPtr;
-	int		m_dna_nr;
-	int		m_number;
-};
-
-enum	btSerializationFlags
-{
-	BT_SERIALIZE_NO_BVH = 1,
-	BT_SERIALIZE_NO_TRIANGLEINFOMAP = 2,
-	BT_SERIALIZE_NO_DUPLICATE_ASSERT = 4
-};
-
-class	btSerializer
-{
-
-public:
-
-	virtual ~btSerializer() {}
-
-	virtual	const unsigned char*		getBufferPointer() const = 0;
-
-	virtual	int		getCurrentBufferSize() const = 0;
-
-	virtual	btChunk*	allocate(size_t size, int numElements) = 0;
-
-	virtual	void	finalizeChunk(btChunk* chunk, const char* structType, int chunkCode,void* oldPtr)= 0;
-
-	virtual	 void*	findPointer(void* oldPtr)  = 0;
-
-	virtual	void*	getUniquePointer(void*oldPtr) = 0;
-
-	virtual	void	startSerialization() = 0;
-	
-	virtual	void	finishSerialization() = 0;
-
-	virtual	const char*	findNameForPointer(const void* ptr) const = 0;
-
-	virtual	void	registerNameForPointer(const void* ptr, const char* name) = 0;
-
-	virtual void	serializeName(const char* ptr) = 0;
-
-	virtual int		getSerializationFlags() const = 0;
-
-	virtual void	setSerializationFlags(int flags) = 0;
-
-
-};
-
-
-
-#define BT_HEADER_LENGTH 12
-#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__BIG_ENDIAN__)
-#	define MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) )
-#else
-#	define MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) )
-#endif
-
-#define BT_SOFTBODY_CODE		MAKE_ID('S','B','D','Y')
-#define BT_COLLISIONOBJECT_CODE MAKE_ID('C','O','B','J')
-#define BT_RIGIDBODY_CODE		MAKE_ID('R','B','D','Y')
-#define BT_CONSTRAINT_CODE		MAKE_ID('C','O','N','S')
-#define BT_BOXSHAPE_CODE		MAKE_ID('B','O','X','S')
-#define BT_QUANTIZED_BVH_CODE	MAKE_ID('Q','B','V','H')
-#define BT_TRIANLGE_INFO_MAP	MAKE_ID('T','M','A','P')
-#define BT_SHAPE_CODE			MAKE_ID('S','H','A','P')
-#define BT_ARRAY_CODE			MAKE_ID('A','R','A','Y')
-#define BT_SBMATERIAL_CODE		MAKE_ID('S','B','M','T')
-#define BT_SBNODE_CODE			MAKE_ID('S','B','N','D')
-#define BT_DNA_CODE				MAKE_ID('D','N','A','1')
-
-
-struct	btPointerUid
-{
-	union
-	{
-		void*	m_ptr;
-		int		m_uniqueIds[2];
-	};
-};
-
-///The btDefaultSerializer is the main Bullet serialization class.
-///The constructor takes an optional argument for backwards compatibility, it is recommended to leave this empty/zero.
-class btDefaultSerializer	:	public btSerializer
-{
-
-
-	btAlignedObjectArray<char*>			mTypes;
-	btAlignedObjectArray<short*>			mStructs;
-	btAlignedObjectArray<short>			mTlens;
-	btHashMap<btHashInt, int>			mStructReverse;
-	btHashMap<btHashString,int>	mTypeLookup;
-
-	
-	btHashMap<btHashPtr,void*>	m_chunkP;
-	
-	btHashMap<btHashPtr,const char*>	m_nameMap;
-
-	btHashMap<btHashPtr,btPointerUid>	m_uniquePointers;
-	int	m_uniqueIdGenerator;
-
-	int					m_totalSize;
-	unsigned char*		m_buffer;
-	int					m_currentSize;
-	void*				m_dna;
-	int					m_dnaLength;
-
-	int					m_serializationFlags;
-
-
-	btAlignedObjectArray<btChunk*>	m_chunkPtrs;
-	
-protected:
-
-	virtual	void*	findPointer(void* oldPtr) 
-	{
-		void** ptr = m_chunkP.find(oldPtr);
-		if (ptr && *ptr)
-			return *ptr;
-		return 0;
-	}
-
-	
-
-
-
-		void	writeDNA()
-		{
-			btChunk* dnaChunk = allocate(m_dnaLength,1);
-			memcpy(dnaChunk->m_oldPtr,m_dna,m_dnaLength);
-			finalizeChunk(dnaChunk,"DNA1",BT_DNA_CODE, m_dna);
-		}
-
-		int getReverseType(const char *type) const
-		{
-
-			btHashString key(type);
-			const int* valuePtr = mTypeLookup.find(key);
-			if (valuePtr)
-				return *valuePtr;
-			
-			return -1;
-		}
-
-		void initDNA(const char* bdnaOrg,int dnalen)
-		{
-			///was already initialized
-			if (m_dna)
-				return;
-
-			int littleEndian= 1;
-			littleEndian= ((char*)&littleEndian)[0];
-			
-
-			m_dna = btAlignedAlloc(dnalen,16);
-			memcpy(m_dna,bdnaOrg,dnalen);
-			m_dnaLength = dnalen;
-
-			int *intPtr=0;
-			short *shtPtr=0;
-			char *cp = 0;int dataLen =0;long nr=0;
-			intPtr = (int*)m_dna;
-
-			/*
-				SDNA (4 bytes) (magic number)
-				NAME (4 bytes)
-				<nr> (4 bytes) amount of names (int)
-				<string>
-				<string>
-			*/
-
-			if (strncmp((const char*)m_dna, "SDNA", 4)==0)
-			{
-				// skip ++ NAME
-				intPtr++; intPtr++;
-			}
-
-			// Parse names
-			if (!littleEndian)
-				*intPtr = btSwapEndian(*intPtr);
-				
-			dataLen = *intPtr;
-			
-			intPtr++;
-
-			cp = (char*)intPtr;
-			int i;
-			for ( i=0; i<dataLen; i++)
-			{
-				
-				while (*cp)cp++;
-				cp++;
-			}
-			{
-				nr= (long)cp;
-			//	long mask=3;
-				nr= ((nr+3)&~3)-nr;
-				while (nr--)
-				{
-					cp++;
-				}
-			}
-
-			/*
-				TYPE (4 bytes)
-				<nr> amount of types (int)
-				<string>
-				<string>
-			*/
-
-			intPtr = (int*)cp;
-			assert(strncmp(cp, "TYPE", 4)==0); intPtr++;
-
-			if (!littleEndian)
-				*intPtr =  btSwapEndian(*intPtr);
-			
-			dataLen = *intPtr;
-			intPtr++;
-
-			
-			cp = (char*)intPtr;
-			for (i=0; i<dataLen; i++)
-			{
-				mTypes.push_back(cp);
-				while (*cp)cp++;
-				cp++;
-			}
-
-		{
-				nr= (long)cp;
-			//	long mask=3;
-				nr= ((nr+3)&~3)-nr;
-				while (nr--)
-				{
-					cp++;
-				}
-			}
-
-
-			/*
-				TLEN (4 bytes)
-				<len> (short) the lengths of types
-				<len>
-			*/
-
-			// Parse type lens
-			intPtr = (int*)cp;
-			assert(strncmp(cp, "TLEN", 4)==0); intPtr++;
-
-			dataLen = (int)mTypes.size();
-
-			shtPtr = (short*)intPtr;
-			for (i=0; i<dataLen; i++, shtPtr++)
-			{
-				if (!littleEndian)
-					shtPtr[0] = btSwapEndian(shtPtr[0]);
-				mTlens.push_back(shtPtr[0]);
-			}
-
-			if (dataLen & 1) shtPtr++;
-
-			/*
-				STRC (4 bytes)
-				<nr> amount of structs (int)
-				<typenr>
-				<nr_of_elems>
-				<typenr>
-				<namenr>
-				<typenr>
-				<namenr>
-			*/
-
-			intPtr = (int*)shtPtr;
-			cp = (char*)intPtr;
-			assert(strncmp(cp, "STRC", 4)==0); intPtr++;
-
-			if (!littleEndian)
-				*intPtr = btSwapEndian(*intPtr);
-			dataLen = *intPtr ; 
-			intPtr++;
-
-
-			shtPtr = (short*)intPtr;
-			for (i=0; i<dataLen; i++)
-			{
-				mStructs.push_back (shtPtr);
-				
-				if (!littleEndian)
-				{
-					shtPtr[0]= btSwapEndian(shtPtr[0]);
-					shtPtr[1]= btSwapEndian(shtPtr[1]);
-
-					int len = shtPtr[1];
-					shtPtr+= 2;
-
-					for (int a=0; a<len; a++, shtPtr+=2)
-					{
-							shtPtr[0]= btSwapEndian(shtPtr[0]);
-							shtPtr[1]= btSwapEndian(shtPtr[1]);
-					}
-
-				} else
-				{
-					shtPtr+= (2*shtPtr[1])+2;
-				}
-			}
-
-			// build reverse lookups
-			for (i=0; i<(int)mStructs.size(); i++)
-			{
-				short *strc = mStructs.at(i);
-				mStructReverse.insert(strc[0], i);
-				mTypeLookup.insert(btHashString(mTypes[strc[0]]),i);
-			}
-		}
-
-public:	
-	
-
-	
-
-		btDefaultSerializer(int totalSize=0)
-			:m_totalSize(totalSize),
-			m_currentSize(0),
-			m_dna(0),
-			m_dnaLength(0),
-			m_serializationFlags(0)
-		{
-			m_buffer = m_totalSize?(unsigned char*)btAlignedAlloc(totalSize,16):0;
-			
-			const bool VOID_IS_8 = ((sizeof(void*)==8));
-
-#ifdef BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
-			if (VOID_IS_8)
-			{
-#if _WIN64
-				initDNA((const char*)sBulletDNAstr64,sBulletDNAlen64);
-#else
-				btAssert(0);
-#endif
-			} else
-			{
-#ifndef _WIN64
-				initDNA((const char*)sBulletDNAstr,sBulletDNAlen);
-#else
-				btAssert(0);
-#endif
-			}
-	
-#else //BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
-			if (VOID_IS_8)
-			{
-				initDNA((const char*)sBulletDNAstr64,sBulletDNAlen64);
-			} else
-			{
-				initDNA((const char*)sBulletDNAstr,sBulletDNAlen);
-			}
-#endif //BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
-	
-		}
-
-		virtual ~btDefaultSerializer() 
-		{
-			if (m_buffer)
-				btAlignedFree(m_buffer);
-			if (m_dna)
-				btAlignedFree(m_dna);
-		}
-
-		void	writeHeader(unsigned char* buffer) const
-		{
-			
-
-#ifdef  BT_USE_DOUBLE_PRECISION
-			memcpy(buffer, "BULLETd", 7);
-#else
-			memcpy(buffer, "BULLETf", 7);
-#endif //BT_USE_DOUBLE_PRECISION
-	
-			int littleEndian= 1;
-			littleEndian= ((char*)&littleEndian)[0];
-
-			if (sizeof(void*)==8)
-			{
-				buffer[7] = '-';
-			} else
-			{
-				buffer[7] = '_';
-			}
-
-			if (littleEndian)
-			{
-				buffer[8]='v';				
-			} else
-			{
-				buffer[8]='V';
-			}
-
-
-			buffer[9] = '2';
-			buffer[10] = '7';
-			buffer[11] = '8';
-
-		}
-
-		virtual	void	startSerialization()
-		{
-			m_uniqueIdGenerator= 1;
-			if (m_totalSize)
-			{
-				unsigned char* buffer = internalAlloc(BT_HEADER_LENGTH);
-				writeHeader(buffer);
-			}
-			
-		}
-
-		virtual	void	finishSerialization()
-		{
-			writeDNA();
-
-			//if we didn't pre-allocate a buffer, we need to create a contiguous buffer now
-			int mysize = 0;
-			if (!m_totalSize)
-			{
-				if (m_buffer)
-					btAlignedFree(m_buffer);
-
-				m_currentSize += BT_HEADER_LENGTH;
-				m_buffer = (unsigned char*)btAlignedAlloc(m_currentSize,16);
-
-				unsigned char* currentPtr = m_buffer;
-				writeHeader(m_buffer);
-				currentPtr += BT_HEADER_LENGTH;
-				mysize+=BT_HEADER_LENGTH;
-				for (int i=0;i<	m_chunkPtrs.size();i++)
-				{
-					int curLength = sizeof(btChunk)+m_chunkPtrs[i]->m_length;
-					memcpy(currentPtr,m_chunkPtrs[i], curLength);
-					btAlignedFree(m_chunkPtrs[i]);
-					currentPtr+=curLength;
-					mysize+=curLength;
-				}
-			}
-
-			mTypes.clear();
-			mStructs.clear();
-			mTlens.clear();
-			mStructReverse.clear();
-			mTypeLookup.clear();
-			m_chunkP.clear();
-			m_nameMap.clear();
-			m_uniquePointers.clear();
-			m_chunkPtrs.clear();
-		}
-
-		virtual	void*	getUniquePointer(void*oldPtr)
-		{
-			if (!oldPtr)
-				return 0;
-
-			btPointerUid* uptr = (btPointerUid*)m_uniquePointers.find(oldPtr);
-			if (uptr)
-			{
-				return uptr->m_ptr;
-			}
-			m_uniqueIdGenerator++;
-			
-			btPointerUid uid;
-			uid.m_uniqueIds[0] = m_uniqueIdGenerator;
-			uid.m_uniqueIds[1] = m_uniqueIdGenerator;
-			m_uniquePointers.insert(oldPtr,uid);
-			return uid.m_ptr;
-
-		}
-
-		virtual	const unsigned char*		getBufferPointer() const
-		{
-			return m_buffer;
-		}
-
-		virtual	int					getCurrentBufferSize() const
-		{
-			return	m_currentSize;
-		}
-
-		virtual	void	finalizeChunk(btChunk* chunk, const char* structType, int chunkCode,void* oldPtr)
-		{
-			if (!(m_serializationFlags&BT_SERIALIZE_NO_DUPLICATE_ASSERT))
-			{
-				btAssert(!findPointer(oldPtr));
-			}
-
-			chunk->m_dna_nr = getReverseType(structType);
-			
-			chunk->m_chunkCode = chunkCode;
-			
-			void* uniquePtr = getUniquePointer(oldPtr);
-			
-			m_chunkP.insert(oldPtr,uniquePtr);//chunk->m_oldPtr);
-			chunk->m_oldPtr = uniquePtr;//oldPtr;
-			
-		}
-
-		
-		virtual unsigned char* internalAlloc(size_t size)
-		{
-			unsigned char* ptr = 0;
-
-			if (m_totalSize)
-			{
-				ptr = m_buffer+m_currentSize;
-				m_currentSize += int(size);
-				btAssert(m_currentSize<m_totalSize);
-			} else
-			{
-				ptr = (unsigned char*)btAlignedAlloc(size,16);
-				m_currentSize += int(size);
-			}
-			return ptr;
-		}
-
-		
-
-		virtual	btChunk*	allocate(size_t size, int numElements)
-		{
-
-			unsigned char* ptr = internalAlloc(int(size)*numElements+sizeof(btChunk));
-
-			unsigned char* data = ptr + sizeof(btChunk);
-			
-			btChunk* chunk = (btChunk*)ptr;
-			chunk->m_chunkCode = 0;
-			chunk->m_oldPtr = data;
-			chunk->m_length = int(size)*numElements;
-			chunk->m_number = numElements;
-			
-			m_chunkPtrs.push_back(chunk);
-			
-
-			return chunk;
-		}
-
-		virtual	const char*	findNameForPointer(const void* ptr) const
-		{
-			const char*const * namePtr = m_nameMap.find(ptr);
-			if (namePtr && *namePtr)
-				return *namePtr;
-			return 0;
-
-		}
-
-		virtual	void	registerNameForPointer(const void* ptr, const char* name)
-		{
-			m_nameMap.insert(ptr,name);
-		}
-
-		virtual void	serializeName(const char* name)
-		{
-			if (name)
-			{
-				//don't serialize name twice
-				if (findPointer((void*)name))
-					return;
-
-				int len = btStrLen(name);
-				if (len)
-				{
-
-					int newLen = len+1;
-					int padding = ((newLen+3)&~3)-newLen;
-					newLen += padding;
-
-					//serialize name string now
-					btChunk* chunk = allocate(sizeof(char),newLen);
-					char* destinationName = (char*)chunk->m_oldPtr;
-					for (int i=0;i<len;i++)
-					{
-						destinationName[i] = name[i];
-					}
-					destinationName[len] = 0;
-					finalizeChunk(chunk,"char",BT_ARRAY_CODE,(void*)name);
-				}
-			}
-		}
-
-		virtual int		getSerializationFlags() const
-		{
-			return m_serializationFlags;
-		}
-
-		virtual void	setSerializationFlags(int flags)
-		{
-			m_serializationFlags = flags;
-		}
-
-};
-
-
-#endif //BT_SERIALIZER_H
-
diff --git a/hkl3d/bullet/src/LinearMath/btStackAlloc.h b/hkl3d/bullet/src/LinearMath/btStackAlloc.h
deleted file mode 100644
index 397b084..0000000
--- a/hkl3d/bullet/src/LinearMath/btStackAlloc.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-/*
-StackAlloc extracted from GJK-EPA collision solver by Nathanael Presson
-Nov.2006
-*/
-
-#ifndef BT_STACK_ALLOC
-#define BT_STACK_ALLOC
-
-#include "btScalar.h" //for btAssert
-#include "btAlignedAllocator.h"
-
-///The btBlock class is an internal structure for the btStackAlloc memory allocator.
-struct btBlock
-{
-	btBlock*			previous;
-	unsigned char*		address;
-};
-
-///The StackAlloc class provides some fast stack-based memory allocator (LIFO last-in first-out)
-class btStackAlloc
-{
-public:
-
-	btStackAlloc(unsigned int size)	{ ctor();create(size); }
-	~btStackAlloc()		{ destroy(); }
-	
-	inline void		create(unsigned int size)
-	{
-		destroy();
-		data		=  (unsigned char*) btAlignedAlloc(size,16);
-		totalsize	=	size;
-	}
-	inline void		destroy()
-	{
-		btAssert(usedsize==0);
-		//Raise(L"StackAlloc is still in use");
-
-		if(usedsize==0)
-		{
-			if(!ischild && data)		
-				btAlignedFree(data);
-
-			data				=	0;
-			usedsize			=	0;
-		}
-		
-	}
-
-	int	getAvailableMemory() const
-	{
-		return static_cast<int>(totalsize - usedsize);
-	}
-
-	unsigned char*			allocate(unsigned int size)
-	{
-		const unsigned int	nus(usedsize+size);
-		if(nus<totalsize)
-		{
-			usedsize=nus;
-			return(data+(usedsize-size));
-		}
-		btAssert(0);
-		//&& (L"Not enough memory"));
-		
-		return(0);
-	}
-	SIMD_FORCE_INLINE btBlock*		beginBlock()
-	{
-		btBlock*	pb = (btBlock*)allocate(sizeof(btBlock));
-		pb->previous	=	current;
-		pb->address		=	data+usedsize;
-		current			=	pb;
-		return(pb);
-	}
-	SIMD_FORCE_INLINE void		endBlock(btBlock* block)
-	{
-		btAssert(block==current);
-		//Raise(L"Unmatched blocks");
-		if(block==current)
-		{
-			current		=	block->previous;
-			usedsize	=	(unsigned int)((block->address-data)-sizeof(btBlock));
-		}
-	}
-
-private:
-	void		ctor()
-	{
-		data		=	0;
-		totalsize	=	0;
-		usedsize	=	0;
-		current		=	0;
-		ischild		=	false;
-	}
-	unsigned char*		data;
-	unsigned int		totalsize;
-	unsigned int		usedsize;
-	btBlock*	current;
-	bool		ischild;
-};
-
-#endif //BT_STACK_ALLOC
diff --git a/hkl3d/bullet/src/LinearMath/btTransform.h b/hkl3d/bullet/src/LinearMath/btTransform.h
deleted file mode 100644
index 5e52d18..0000000
--- a/hkl3d/bullet/src/LinearMath/btTransform.h
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
-Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-#ifndef BT_TRANSFORM_H
-#define BT_TRANSFORM_H
-
-
-#include "btMatrix3x3.h"
-
-#ifdef BT_USE_DOUBLE_PRECISION
-#define btTransformData btTransformDoubleData
-#else
-#define btTransformData btTransformFloatData
-#endif
-
-
-
-
-/**@brief The btTransform class supports rigid transforms with only translation and rotation and no scaling/shear.
- *It can be used in combination with btVector3, btQuaternion and btMatrix3x3 linear algebra classes. */
-class btTransform {
-	
-  ///Storage for the rotation
-	btMatrix3x3 m_basis;
-  ///Storage for the translation
-	btVector3   m_origin;
-
-public:
-	
-  /**@brief No initialization constructor */
-	btTransform() {}
-  /**@brief Constructor from btQuaternion (optional btVector3 )
-   * @param q Rotation from quaternion 
-   * @param c Translation from Vector (default 0,0,0) */
-	explicit SIMD_FORCE_INLINE btTransform(const btQuaternion& q, 
-		const btVector3& c = btVector3(btScalar(0), btScalar(0), btScalar(0))) 
-		: m_basis(q),
-		m_origin(c)
-	{}
-
-  /**@brief Constructor from btMatrix3x3 (optional btVector3)
-   * @param b Rotation from Matrix 
-   * @param c Translation from Vector default (0,0,0)*/
-	explicit SIMD_FORCE_INLINE btTransform(const btMatrix3x3& b, 
-		const btVector3& c = btVector3(btScalar(0), btScalar(0), btScalar(0)))
-		: m_basis(b),
-		m_origin(c)
-	{}
-  /**@brief Copy constructor */
-	SIMD_FORCE_INLINE btTransform (const btTransform& other)
-		: m_basis(other.m_basis),
-		m_origin(other.m_origin)
-	{
-	}
-  /**@brief Assignment Operator */
-	SIMD_FORCE_INLINE btTransform& operator=(const btTransform& other)
-	{
-		m_basis = other.m_basis;
-		m_origin = other.m_origin;
-		return *this;
-	}
-
-
-  /**@brief Set the current transform as the value of the product of two transforms
-   * @param t1 Transform 1
-   * @param t2 Transform 2
-   * This = Transform1 * Transform2 */
-		SIMD_FORCE_INLINE void mult(const btTransform& t1, const btTransform& t2) {
-			m_basis = t1.m_basis * t2.m_basis;
-			m_origin = t1(t2.m_origin);
-		}
-
-/*		void multInverseLeft(const btTransform& t1, const btTransform& t2) {
-			btVector3 v = t2.m_origin - t1.m_origin;
-			m_basis = btMultTransposeLeft(t1.m_basis, t2.m_basis);
-			m_origin = v * t1.m_basis;
-		}
-		*/
-
-/**@brief Return the transform of the vector */
-	SIMD_FORCE_INLINE btVector3 operator()(const btVector3& x) const
-	{
-		return btVector3(m_basis[0].dot(x) + m_origin.x(), 
-			m_basis[1].dot(x) + m_origin.y(), 
-			m_basis[2].dot(x) + m_origin.z());
-	}
-
-  /**@brief Return the transform of the vector */
-	SIMD_FORCE_INLINE btVector3 operator*(const btVector3& x) const
-	{
-		return (*this)(x);
-	}
-
-  /**@brief Return the transform of the btQuaternion */
-	SIMD_FORCE_INLINE btQuaternion operator*(const btQuaternion& q) const
-	{
-		return getRotation() * q;
-	}
-
-  /**@brief Return the basis matrix for the rotation */
-	SIMD_FORCE_INLINE btMatrix3x3&       getBasis()          { return m_basis; }
-  /**@brief Return the basis matrix for the rotation */
-	SIMD_FORCE_INLINE const btMatrix3x3& getBasis()    const { return m_basis; }
-
-  /**@brief Return the origin vector translation */
-	SIMD_FORCE_INLINE btVector3&         getOrigin()         { return m_origin; }
-  /**@brief Return the origin vector translation */
-	SIMD_FORCE_INLINE const btVector3&   getOrigin()   const { return m_origin; }
-
-  /**@brief Return a quaternion representing the rotation */
-	btQuaternion getRotation() const { 
-		btQuaternion q;
-		m_basis.getRotation(q);
-		return q;
-	}
-	
-	
-  /**@brief Set from an array 
-   * @param m A pointer to a 15 element array (12 rotation(row major padded on the right by 1), and 3 translation */
-	void setFromOpenGLMatrix(const btScalar *m)
-	{
-		m_basis.setFromOpenGLSubMatrix(m);
-		m_origin.setValue(m[12],m[13],m[14]);
-	}
-
-  /**@brief Fill an array representation
-   * @param m A pointer to a 15 element array (12 rotation(row major padded on the right by 1), and 3 translation */
-	void getOpenGLMatrix(btScalar *m) const 
-	{
-		m_basis.getOpenGLSubMatrix(m);
-		m[12] = m_origin.x();
-		m[13] = m_origin.y();
-		m[14] = m_origin.z();
-		m[15] = btScalar(1.0);
-	}
-
-  /**@brief Set the translational element
-   * @param origin The vector to set the translation to */
-	SIMD_FORCE_INLINE void setOrigin(const btVector3& origin) 
-	{ 
-		m_origin = origin;
-	}
-
-	SIMD_FORCE_INLINE btVector3 invXform(const btVector3& inVec) const;
-
-
-  /**@brief Set the rotational element by btMatrix3x3 */
-	SIMD_FORCE_INLINE void setBasis(const btMatrix3x3& basis)
-	{ 
-		m_basis = basis;
-	}
-
-  /**@brief Set the rotational element by btQuaternion */
-	SIMD_FORCE_INLINE void setRotation(const btQuaternion& q)
-	{
-		m_basis.setRotation(q);
-	}
-
-
-  /**@brief Set this transformation to the identity */
-	void setIdentity()
-	{
-		m_basis.setIdentity();
-		m_origin.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
-	}
-
-  /**@brief Multiply this Transform by another(this = this * another) 
-   * @param t The other transform */
-	btTransform& operator*=(const btTransform& t) 
-	{
-		m_origin += m_basis * t.m_origin;
-		m_basis *= t.m_basis;
-		return *this;
-	}
-
-  /**@brief Return the inverse of this transform */
-	btTransform inverse() const
-	{ 
-		btMatrix3x3 inv = m_basis.transpose();
-		return btTransform(inv, inv * -m_origin);
-	}
-
-  /**@brief Return the inverse of this transform times the other transform
-   * @param t The other transform 
-   * return this.inverse() * the other */
-	btTransform inverseTimes(const btTransform& t) const;  
-
-  /**@brief Return the product of this transform and the other */
-	btTransform operator*(const btTransform& t) const;
-
-  /**@brief Return an identity transform */
-	static const btTransform&	getIdentity()
-	{
-		static const btTransform identityTransform(btMatrix3x3::getIdentity());
-		return identityTransform;
-	}
-
-	void	serialize(struct	btTransformData& dataOut) const;
-
-	void	serializeFloat(struct	btTransformFloatData& dataOut) const;
-
-	void	deSerialize(const struct	btTransformData& dataIn);
-
-	void	deSerializeDouble(const struct	btTransformDoubleData& dataIn);
-
-	void	deSerializeFloat(const struct	btTransformFloatData& dataIn);
-
-};
-
-
-SIMD_FORCE_INLINE btVector3
-btTransform::invXform(const btVector3& inVec) const
-{
-	btVector3 v = inVec - m_origin;
-	return (m_basis.transpose() * v);
-}
-
-SIMD_FORCE_INLINE btTransform 
-btTransform::inverseTimes(const btTransform& t) const  
-{
-	btVector3 v = t.getOrigin() - m_origin;
-		return btTransform(m_basis.transposeTimes(t.m_basis),
-			v * m_basis);
-}
-
-SIMD_FORCE_INLINE btTransform 
-btTransform::operator*(const btTransform& t) const
-{
-	return btTransform(m_basis * t.m_basis, 
-		(*this)(t.m_origin));
-}
-
-/**@brief Test if two transforms have all elements equal */
-SIMD_FORCE_INLINE bool operator==(const btTransform& t1, const btTransform& t2)
-{
-   return ( t1.getBasis()  == t2.getBasis() &&
-            t1.getOrigin() == t2.getOrigin() );
-}
-
-
-///for serialization
-struct	btTransformFloatData
-{
-	btMatrix3x3FloatData	m_basis;
-	btVector3FloatData	m_origin;
-};
-
-struct	btTransformDoubleData
-{
-	btMatrix3x3DoubleData	m_basis;
-	btVector3DoubleData	m_origin;
-};
-
-
-
-SIMD_FORCE_INLINE	void	btTransform::serialize(btTransformData& dataOut) const
-{
-	m_basis.serialize(dataOut.m_basis);
-	m_origin.serialize(dataOut.m_origin);
-}
-
-SIMD_FORCE_INLINE	void	btTransform::serializeFloat(btTransformFloatData& dataOut) const
-{
-	m_basis.serializeFloat(dataOut.m_basis);
-	m_origin.serializeFloat(dataOut.m_origin);
-}
-
-
-SIMD_FORCE_INLINE	void	btTransform::deSerialize(const btTransformData& dataIn)
-{
-	m_basis.deSerialize(dataIn.m_basis);
-	m_origin.deSerialize(dataIn.m_origin);
-}
-
-SIMD_FORCE_INLINE	void	btTransform::deSerializeFloat(const btTransformFloatData& dataIn)
-{
-	m_basis.deSerializeFloat(dataIn.m_basis);
-	m_origin.deSerializeFloat(dataIn.m_origin);
-}
-
-SIMD_FORCE_INLINE	void	btTransform::deSerializeDouble(const btTransformDoubleData& dataIn)
-{
-	m_basis.deSerializeDouble(dataIn.m_basis);
-	m_origin.deSerializeDouble(dataIn.m_origin);
-}
-
-
-#endif //BT_TRANSFORM_H
-
-
-
-
-
-
diff --git a/hkl3d/bullet/src/LinearMath/btTransformUtil.h b/hkl3d/bullet/src/LinearMath/btTransformUtil.h
deleted file mode 100644
index 2303c27..0000000
--- a/hkl3d/bullet/src/LinearMath/btTransformUtil.h
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
-Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-#ifndef BT_TRANSFORM_UTIL_H
-#define BT_TRANSFORM_UTIL_H
-
-#include "btTransform.h"
-#define ANGULAR_MOTION_THRESHOLD btScalar(0.5)*SIMD_HALF_PI
-
-
-
-
-SIMD_FORCE_INLINE btVector3 btAabbSupport(const btVector3& halfExtents,const btVector3& supportDir)
-{
-	return btVector3(supportDir.x() < btScalar(0.0) ? -halfExtents.x() : halfExtents.x(),
-      supportDir.y() < btScalar(0.0) ? -halfExtents.y() : halfExtents.y(),
-      supportDir.z() < btScalar(0.0) ? -halfExtents.z() : halfExtents.z()); 
-}
-
-
-
-
-
-
-/// Utils related to temporal transforms
-class btTransformUtil
-{
-
-public:
-
-	static void integrateTransform(const btTransform& curTrans,const btVector3& linvel,const btVector3& angvel,btScalar timeStep,btTransform& predictedTransform)
-	{
-		predictedTransform.setOrigin(curTrans.getOrigin() + linvel * timeStep);
-//	#define QUATERNION_DERIVATIVE
-	#ifdef QUATERNION_DERIVATIVE
-		btQuaternion predictedOrn = curTrans.getRotation();
-		predictedOrn += (angvel * predictedOrn) * (timeStep * btScalar(0.5));
-		predictedOrn.normalize();
-	#else
-		//Exponential map
-		//google for "Practical Parameterization of Rotations Using the Exponential Map", F. Sebastian Grassia
-
-		btVector3 axis;
-		btScalar	fAngle = angvel.length(); 
-		//limit the angular motion
-		if (fAngle*timeStep > ANGULAR_MOTION_THRESHOLD)
-		{
-			fAngle = ANGULAR_MOTION_THRESHOLD / timeStep;
-		}
-
-		if ( fAngle < btScalar(0.001) )
-		{
-			// use Taylor's expansions of sync function
-			axis   = angvel*( btScalar(0.5)*timeStep-(timeStep*timeStep*timeStep)*(btScalar(0.020833333333))*fAngle*fAngle );
-		}
-		else
-		{
-			// sync(fAngle) = sin(c*fAngle)/t
-			axis   = angvel*( btSin(btScalar(0.5)*fAngle*timeStep)/fAngle );
-		}
-		btQuaternion dorn (axis.x(),axis.y(),axis.z(),btCos( fAngle*timeStep*btScalar(0.5) ));
-		btQuaternion orn0 = curTrans.getRotation();
-
-		btQuaternion predictedOrn = dorn * orn0;
-		predictedOrn.normalize();
-	#endif
-		predictedTransform.setRotation(predictedOrn);
-	}
-
-	static void	calculateVelocityQuaternion(const btVector3& pos0,const btVector3& pos1,const btQuaternion& orn0,const btQuaternion& orn1,btScalar timeStep,btVector3& linVel,btVector3& angVel)
-	{
-		linVel = (pos1 - pos0) / timeStep;
-		btVector3 axis;
-		btScalar  angle;
-		if (orn0 != orn1)
-		{
-			calculateDiffAxisAngleQuaternion(orn0,orn1,axis,angle);
-			angVel = axis * angle / timeStep;
-		} else
-		{
-			angVel.setValue(0,0,0);
-		}
-	}
-
-	static void calculateDiffAxisAngleQuaternion(const btQuaternion& orn0,const btQuaternion& orn1a,btVector3& axis,btScalar& angle)
-	{
-		btQuaternion orn1 = orn0.nearest(orn1a);
-		btQuaternion dorn = orn1 * orn0.inverse();
-		angle = dorn.getAngle();
-		axis = btVector3(dorn.x(),dorn.y(),dorn.z());
-		axis[3] = btScalar(0.);
-		//check for axis length
-		btScalar len = axis.length2();
-		if (len < SIMD_EPSILON*SIMD_EPSILON)
-			axis = btVector3(btScalar(1.),btScalar(0.),btScalar(0.));
-		else
-			axis /= btSqrt(len);
-	}
-
-	static void	calculateVelocity(const btTransform& transform0,const btTransform& transform1,btScalar timeStep,btVector3& linVel,btVector3& angVel)
-	{
-		linVel = (transform1.getOrigin() - transform0.getOrigin()) / timeStep;
-		btVector3 axis;
-		btScalar  angle;
-		calculateDiffAxisAngle(transform0,transform1,axis,angle);
-		angVel = axis * angle / timeStep;
-	}
-
-	static void calculateDiffAxisAngle(const btTransform& transform0,const btTransform& transform1,btVector3& axis,btScalar& angle)
-	{
-		btMatrix3x3 dmat = transform1.getBasis() * transform0.getBasis().inverse();
-		btQuaternion dorn;
-		dmat.getRotation(dorn);
-
-		///floating point inaccuracy can lead to w component > 1..., which breaks 
-		dorn.normalize();
-		
-		angle = dorn.getAngle();
-		axis = btVector3(dorn.x(),dorn.y(),dorn.z());
-		axis[3] = btScalar(0.);
-		//check for axis length
-		btScalar len = axis.length2();
-		if (len < SIMD_EPSILON*SIMD_EPSILON)
-			axis = btVector3(btScalar(1.),btScalar(0.),btScalar(0.));
-		else
-			axis /= btSqrt(len);
-	}
-
-};
-
-
-///The btConvexSeparatingDistanceUtil can help speed up convex collision detection 
-///by conservatively updating a cached separating distance/vector instead of re-calculating the closest distance
-class	btConvexSeparatingDistanceUtil
-{
-	btQuaternion	m_ornA;
-	btQuaternion	m_ornB;
-	btVector3	m_posA;
-	btVector3	m_posB;
-	
-	btVector3	m_separatingNormal;
-
-	btScalar	m_boundingRadiusA;
-	btScalar	m_boundingRadiusB;
-	btScalar	m_separatingDistance;
-
-public:
-
-	btConvexSeparatingDistanceUtil(btScalar	boundingRadiusA,btScalar	boundingRadiusB)
-		:m_boundingRadiusA(boundingRadiusA),
-		m_boundingRadiusB(boundingRadiusB),
-		m_separatingDistance(0.f)
-	{
-	}
-
-	btScalar	getConservativeSeparatingDistance()
-	{
-		return m_separatingDistance;
-	}
-
-	void	updateSeparatingDistance(const btTransform& transA,const btTransform& transB)
-	{
-		const btVector3& toPosA = transA.getOrigin();
-		const btVector3& toPosB = transB.getOrigin();
-		btQuaternion toOrnA = transA.getRotation();
-		btQuaternion toOrnB = transB.getRotation();
-
-		if (m_separatingDistance>0.f)
-		{
-			
-
-			btVector3 linVelA,angVelA,linVelB,angVelB;
-			btTransformUtil::calculateVelocityQuaternion(m_posA,toPosA,m_ornA,toOrnA,btScalar(1.),linVelA,angVelA);
-			btTransformUtil::calculateVelocityQuaternion(m_posB,toPosB,m_ornB,toOrnB,btScalar(1.),linVelB,angVelB);
-			btScalar maxAngularProjectedVelocity = angVelA.length() * m_boundingRadiusA + angVelB.length() * m_boundingRadiusB;
-			btVector3 relLinVel = (linVelB-linVelA);
-			btScalar relLinVelocLength = relLinVel.dot(m_separatingNormal);
-			if (relLinVelocLength<0.f)
-			{
-				relLinVelocLength = 0.f;
-			}
-	
-			btScalar	projectedMotion = maxAngularProjectedVelocity +relLinVelocLength;
-			m_separatingDistance -= projectedMotion;
-		}
-	
-		m_posA = toPosA;
-		m_posB = toPosB;
-		m_ornA = toOrnA;
-		m_ornB = toOrnB;
-	}
-
-	void	initSeparatingDistance(const btVector3& separatingVector,btScalar separatingDistance,const btTransform& transA,const btTransform& transB)
-	{
-		m_separatingDistance = separatingDistance;
-
-		if (m_separatingDistance>0.f)
-		{
-			m_separatingNormal = separatingVector;
-			
-			const btVector3& toPosA = transA.getOrigin();
-			const btVector3& toPosB = transB.getOrigin();
-			btQuaternion toOrnA = transA.getRotation();
-			btQuaternion toOrnB = transB.getRotation();
-			m_posA = toPosA;
-			m_posB = toPosB;
-			m_ornA = toOrnA;
-			m_ornB = toOrnB;
-		}
-	}
-
-};
-
-
-#endif //BT_TRANSFORM_UTIL_H
-
diff --git a/hkl3d/bullet/src/LinearMath/btVector3.h b/hkl3d/bullet/src/LinearMath/btVector3.h
deleted file mode 100644
index d99b7c8..0000000
--- a/hkl3d/bullet/src/LinearMath/btVector3.h
+++ /dev/null
@@ -1,766 +0,0 @@
-/*
-Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-#ifndef BT_VECTOR3_H
-#define BT_VECTOR3_H
-
-
-#include "btScalar.h"
-#include "btMinMax.h"
-
-#ifdef BT_USE_DOUBLE_PRECISION
-#define btVector3Data btVector3DoubleData
-#define btVector3DataName "btVector3DoubleData"
-#else
-#define btVector3Data btVector3FloatData
-#define btVector3DataName "btVector3FloatData"
-#endif //BT_USE_DOUBLE_PRECISION
-
-
-
-
-/**@brief btVector3 can be used to represent 3D points and vectors.
- * It has an un-used w component to suit 16-byte alignment when btVector3 is stored in containers. This extra component can be used by derived classes (Quaternion?) or by user
- * Ideally, this class should be replaced by a platform optimized SIMD version that keeps the data in registers
- */
-ATTRIBUTE_ALIGNED16(class) btVector3
-{
-public:
-
-#if defined (__SPU__) && defined (__CELLOS_LV2__)
-		btScalar	m_floats[4];
-public:
-	SIMD_FORCE_INLINE const vec_float4&	get128() const
-	{
-		return *((const vec_float4*)&m_floats[0]);
-	}
-public:
-#else //__CELLOS_LV2__ __SPU__
-#ifdef BT_USE_SSE // _WIN32
-	union {
-		__m128 mVec128;
-		btScalar	m_floats[4];
-	};
-	SIMD_FORCE_INLINE	__m128	get128() const
-	{
-		return mVec128;
-	}
-	SIMD_FORCE_INLINE	void	set128(__m128 v128)
-	{
-		mVec128 = v128;
-	}
-#else
-	btScalar	m_floats[4];
-#endif
-#endif //__CELLOS_LV2__ __SPU__
-
-	public:
-
-  /**@brief No initialization constructor */
-	SIMD_FORCE_INLINE btVector3() {}
-
- 
-	
-  /**@brief Constructor from scalars 
-   * @param x X value
-   * @param y Y value 
-   * @param z Z value 
-   */
-	SIMD_FORCE_INLINE btVector3(const btScalar& x, const btScalar& y, const btScalar& z)
-	{
-		m_floats[0] = x;
-		m_floats[1] = y;
-		m_floats[2] = z;
-		m_floats[3] = btScalar(0.);
-	}
-
-	
-/**@brief Add a vector to this one 
- * @param The vector to add to this one */
-	SIMD_FORCE_INLINE btVector3& operator+=(const btVector3& v)
-	{
-
-		m_floats[0] += v.m_floats[0]; m_floats[1] += v.m_floats[1];m_floats[2] += v.m_floats[2];
-		return *this;
-	}
-
-
-  /**@brief Subtract a vector from this one
-   * @param The vector to subtract */
-	SIMD_FORCE_INLINE btVector3& operator-=(const btVector3& v) 
-	{
-		m_floats[0] -= v.m_floats[0]; m_floats[1] -= v.m_floats[1];m_floats[2] -= v.m_floats[2];
-		return *this;
-	}
-  /**@brief Scale the vector
-   * @param s Scale factor */
-	SIMD_FORCE_INLINE btVector3& operator*=(const btScalar& s)
-	{
-		m_floats[0] *= s; m_floats[1] *= s;m_floats[2] *= s;
-		return *this;
-	}
-
-  /**@brief Inversely scale the vector 
-   * @param s Scale factor to divide by */
-	SIMD_FORCE_INLINE btVector3& operator/=(const btScalar& s) 
-	{
-		btFullAssert(s != btScalar(0.0));
-		return *this *= btScalar(1.0) / s;
-	}
-
-  /**@brief Return the dot product
-   * @param v The other vector in the dot product */
-	SIMD_FORCE_INLINE btScalar dot(const btVector3& v) const
-	{
-		return m_floats[0] * v.m_floats[0] + m_floats[1] * v.m_floats[1] +m_floats[2] * v.m_floats[2];
-	}
-
-  /**@brief Return the length of the vector squared */
-	SIMD_FORCE_INLINE btScalar length2() const
-	{
-		return dot(*this);
-	}
-
-  /**@brief Return the length of the vector */
-	SIMD_FORCE_INLINE btScalar length() const
-	{
-		return btSqrt(length2());
-	}
-
-  /**@brief Return the distance squared between the ends of this and another vector
-   * This is symantically treating the vector like a point */
-	SIMD_FORCE_INLINE btScalar distance2(const btVector3& v) const;
-
-  /**@brief Return the distance between the ends of this and another vector
-   * This is symantically treating the vector like a point */
-	SIMD_FORCE_INLINE btScalar distance(const btVector3& v) const;
-
-	SIMD_FORCE_INLINE btVector3& safeNormalize() 
-	{
-		btVector3 absVec = this->absolute();
-		int maxIndex = absVec.maxAxis();
-		if (absVec[maxIndex]>0)
-		{
-			*this /= absVec[maxIndex];
-			return *this /= length();
-		}
-		setValue(1,0,0);
-		return *this;
-	}
-
-  /**@brief Normalize this vector 
-   * x^2 + y^2 + z^2 = 1 */
-	SIMD_FORCE_INLINE btVector3& normalize() 
-	{
-		return *this /= length();
-	}
-
-  /**@brief Return a normalized version of this vector */
-	SIMD_FORCE_INLINE btVector3 normalized() const;
-
-  /**@brief Return a rotated version of this vector
-   * @param wAxis The axis to rotate about 
-   * @param angle The angle to rotate by */
-	SIMD_FORCE_INLINE btVector3 rotate( const btVector3& wAxis, const btScalar angle ) const;
-
-  /**@brief Return the angle between this and another vector
-   * @param v The other vector */
-	SIMD_FORCE_INLINE btScalar angle(const btVector3& v) const 
-	{
-		btScalar s = btSqrt(length2() * v.length2());
-		btFullAssert(s != btScalar(0.0));
-		return btAcos(dot(v) / s);
-	}
-  /**@brief Return a vector will the absolute values of each element */
-	SIMD_FORCE_INLINE btVector3 absolute() const 
-	{
-		return btVector3(
-			btFabs(m_floats[0]), 
-			btFabs(m_floats[1]), 
-			btFabs(m_floats[2]));
-	}
-  /**@brief Return the cross product between this and another vector 
-   * @param v The other vector */
-	SIMD_FORCE_INLINE btVector3 cross(const btVector3& v) const
-	{
-		return btVector3(
-			m_floats[1] * v.m_floats[2] -m_floats[2] * v.m_floats[1],
-			m_floats[2] * v.m_floats[0] - m_floats[0] * v.m_floats[2],
-			m_floats[0] * v.m_floats[1] - m_floats[1] * v.m_floats[0]);
-	}
-
-	SIMD_FORCE_INLINE btScalar triple(const btVector3& v1, const btVector3& v2) const
-	{
-		return m_floats[0] * (v1.m_floats[1] * v2.m_floats[2] - v1.m_floats[2] * v2.m_floats[1]) + 
-			m_floats[1] * (v1.m_floats[2] * v2.m_floats[0] - v1.m_floats[0] * v2.m_floats[2]) + 
-			m_floats[2] * (v1.m_floats[0] * v2.m_floats[1] - v1.m_floats[1] * v2.m_floats[0]);
-	}
-
-  /**@brief Return the axis with the smallest value 
-   * Note return values are 0,1,2 for x, y, or z */
-	SIMD_FORCE_INLINE int minAxis() const
-	{
-		return m_floats[0] < m_floats[1] ? (m_floats[0] <m_floats[2] ? 0 : 2) : (m_floats[1] <m_floats[2] ? 1 : 2);
-	}
-
-  /**@brief Return the axis with the largest value 
-   * Note return values are 0,1,2 for x, y, or z */
-	SIMD_FORCE_INLINE int maxAxis() const 
-	{
-		return m_floats[0] < m_floats[1] ? (m_floats[1] <m_floats[2] ? 2 : 1) : (m_floats[0] <m_floats[2] ? 2 : 0);
-	}
-
-	SIMD_FORCE_INLINE int furthestAxis() const
-	{
-		return absolute().minAxis();
-	}
-
-	SIMD_FORCE_INLINE int closestAxis() const 
-	{
-		return absolute().maxAxis();
-	}
-
-	SIMD_FORCE_INLINE void setInterpolate3(const btVector3& v0, const btVector3& v1, btScalar rt)
-	{
-		btScalar s = btScalar(1.0) - rt;
-		m_floats[0] = s * v0.m_floats[0] + rt * v1.m_floats[0];
-		m_floats[1] = s * v0.m_floats[1] + rt * v1.m_floats[1];
-		m_floats[2] = s * v0.m_floats[2] + rt * v1.m_floats[2];
-		//don't do the unused w component
-		//		m_co[3] = s * v0[3] + rt * v1[3];
-	}
-
-  /**@brief Return the linear interpolation between this and another vector 
-   * @param v The other vector 
-   * @param t The ration of this to v (t = 0 => return this, t=1 => return other) */
-	SIMD_FORCE_INLINE btVector3 lerp(const btVector3& v, const btScalar& t) const 
-	{
-		return btVector3(m_floats[0] + (v.m_floats[0] - m_floats[0]) * t,
-			m_floats[1] + (v.m_floats[1] - m_floats[1]) * t,
-			m_floats[2] + (v.m_floats[2] -m_floats[2]) * t);
-	}
-
-  /**@brief Elementwise multiply this vector by the other 
-   * @param v The other vector */
-	SIMD_FORCE_INLINE btVector3& operator*=(const btVector3& v)
-	{
-		m_floats[0] *= v.m_floats[0]; m_floats[1] *= v.m_floats[1];m_floats[2] *= v.m_floats[2];
-		return *this;
-	}
-
-	 /**@brief Return the x value */
-		SIMD_FORCE_INLINE const btScalar& getX() const { return m_floats[0]; }
-  /**@brief Return the y value */
-		SIMD_FORCE_INLINE const btScalar& getY() const { return m_floats[1]; }
-  /**@brief Return the z value */
-		SIMD_FORCE_INLINE const btScalar& getZ() const { return m_floats[2]; }
-  /**@brief Set the x value */
-		SIMD_FORCE_INLINE void	setX(btScalar x) { m_floats[0] = x;};
-  /**@brief Set the y value */
-		SIMD_FORCE_INLINE void	setY(btScalar y) { m_floats[1] = y;};
-  /**@brief Set the z value */
-		SIMD_FORCE_INLINE void	setZ(btScalar z) {m_floats[2] = z;};
-  /**@brief Set the w value */
-		SIMD_FORCE_INLINE void	setW(btScalar w) { m_floats[3] = w;};
-  /**@brief Return the x value */
-		SIMD_FORCE_INLINE const btScalar& x() const { return m_floats[0]; }
-  /**@brief Return the y value */
-		SIMD_FORCE_INLINE const btScalar& y() const { return m_floats[1]; }
-  /**@brief Return the z value */
-		SIMD_FORCE_INLINE const btScalar& z() const { return m_floats[2]; }
-  /**@brief Return the w value */
-		SIMD_FORCE_INLINE const btScalar& w() const { return m_floats[3]; }
-
-	//SIMD_FORCE_INLINE btScalar&       operator[](int i)       { return (&m_floats[0])[i];	}      
-	//SIMD_FORCE_INLINE const btScalar& operator[](int i) const { return (&m_floats[0])[i]; }
-	///operator btScalar*() replaces operator[], using implicit conversion. We added operator != and operator == to avoid pointer comparisons.
-	SIMD_FORCE_INLINE	operator       btScalar *()       { return &m_floats[0]; }
-	SIMD_FORCE_INLINE	operator const btScalar *() const { return &m_floats[0]; }
-
-	SIMD_FORCE_INLINE	bool	operator==(const btVector3& other) const
-	{
-		return ((m_floats[3]==other.m_floats[3]) && (m_floats[2]==other.m_floats[2]) && (m_floats[1]==other.m_floats[1]) && (m_floats[0]==other.m_floats[0]));
-	}
-
-	SIMD_FORCE_INLINE	bool	operator!=(const btVector3& other) const
-	{
-		return !(*this == other);
-	}
-
-	 /**@brief Set each element to the max of the current values and the values of another btVector3
-   * @param other The other btVector3 to compare with 
-   */
-		SIMD_FORCE_INLINE void	setMax(const btVector3& other)
-		{
-			btSetMax(m_floats[0], other.m_floats[0]);
-			btSetMax(m_floats[1], other.m_floats[1]);
-			btSetMax(m_floats[2], other.m_floats[2]);
-			btSetMax(m_floats[3], other.w());
-		}
-  /**@brief Set each element to the min of the current values and the values of another btVector3
-   * @param other The other btVector3 to compare with 
-   */
-		SIMD_FORCE_INLINE void	setMin(const btVector3& other)
-		{
-			btSetMin(m_floats[0], other.m_floats[0]);
-			btSetMin(m_floats[1], other.m_floats[1]);
-			btSetMin(m_floats[2], other.m_floats[2]);
-			btSetMin(m_floats[3], other.w());
-		}
-
-		SIMD_FORCE_INLINE void 	setValue(const btScalar& x, const btScalar& y, const btScalar& z)
-		{
-			m_floats[0]=x;
-			m_floats[1]=y;
-			m_floats[2]=z;
-			m_floats[3] = btScalar(0.);
-		}
-
-		void	getSkewSymmetricMatrix(btVector3* v0,btVector3* v1,btVector3* v2) const
-		{
-			v0->setValue(0.		,-z()		,y());
-			v1->setValue(z()	,0.			,-x());
-			v2->setValue(-y()	,x()	,0.);
-		}
-
-		void	setZero()
-		{
-			setValue(btScalar(0.),btScalar(0.),btScalar(0.));
-		}
-
-		SIMD_FORCE_INLINE bool isZero() const 
-		{
-			return m_floats[0] == btScalar(0) && m_floats[1] == btScalar(0) && m_floats[2] == btScalar(0);
-		}
-
-		SIMD_FORCE_INLINE bool fuzzyZero() const 
-		{
-			return length2() < SIMD_EPSILON;
-		}
-
-		SIMD_FORCE_INLINE	void	serialize(struct	btVector3Data& dataOut) const;
-
-		SIMD_FORCE_INLINE	void	deSerialize(const struct	btVector3Data& dataIn);
-
-		SIMD_FORCE_INLINE	void	serializeFloat(struct	btVector3FloatData& dataOut) const;
-
-		SIMD_FORCE_INLINE	void	deSerializeFloat(const struct	btVector3FloatData& dataIn);
-
-		SIMD_FORCE_INLINE	void	serializeDouble(struct	btVector3DoubleData& dataOut) const;
-
-		SIMD_FORCE_INLINE	void	deSerializeDouble(const struct	btVector3DoubleData& dataIn);
-
-};
-
-/**@brief Return the sum of two vectors (Point symantics)*/
-SIMD_FORCE_INLINE btVector3 
-operator+(const btVector3& v1, const btVector3& v2) 
-{
-	return btVector3(v1.m_floats[0] + v2.m_floats[0], v1.m_floats[1] + v2.m_floats[1], v1.m_floats[2] + v2.m_floats[2]);
-}
-
-/**@brief Return the elementwise product of two vectors */
-SIMD_FORCE_INLINE btVector3 
-operator*(const btVector3& v1, const btVector3& v2) 
-{
-	return btVector3(v1.m_floats[0] * v2.m_floats[0], v1.m_floats[1] * v2.m_floats[1], v1.m_floats[2] * v2.m_floats[2]);
-}
-
-/**@brief Return the difference between two vectors */
-SIMD_FORCE_INLINE btVector3 
-operator-(const btVector3& v1, const btVector3& v2)
-{
-	return btVector3(v1.m_floats[0] - v2.m_floats[0], v1.m_floats[1] - v2.m_floats[1], v1.m_floats[2] - v2.m_floats[2]);
-}
-/**@brief Return the negative of the vector */
-SIMD_FORCE_INLINE btVector3 
-operator-(const btVector3& v)
-{
-	return btVector3(-v.m_floats[0], -v.m_floats[1], -v.m_floats[2]);
-}
-
-/**@brief Return the vector scaled by s */
-SIMD_FORCE_INLINE btVector3 
-operator*(const btVector3& v, const btScalar& s)
-{
-	return btVector3(v.m_floats[0] * s, v.m_floats[1] * s, v.m_floats[2] * s);
-}
-
-/**@brief Return the vector scaled by s */
-SIMD_FORCE_INLINE btVector3 
-operator*(const btScalar& s, const btVector3& v)
-{ 
-	return v * s; 
-}
-
-/**@brief Return the vector inversely scaled by s */
-SIMD_FORCE_INLINE btVector3
-operator/(const btVector3& v, const btScalar& s)
-{
-	btFullAssert(s != btScalar(0.0));
-	return v * (btScalar(1.0) / s);
-}
-
-/**@brief Return the vector inversely scaled by s */
-SIMD_FORCE_INLINE btVector3
-operator/(const btVector3& v1, const btVector3& v2)
-{
-	return btVector3(v1.m_floats[0] / v2.m_floats[0],v1.m_floats[1] / v2.m_floats[1],v1.m_floats[2] / v2.m_floats[2]);
-}
-
-/**@brief Return the dot product between two vectors */
-SIMD_FORCE_INLINE btScalar 
-btDot(const btVector3& v1, const btVector3& v2) 
-{ 
-	return v1.dot(v2); 
-}
-
-
-/**@brief Return the distance squared between two vectors */
-SIMD_FORCE_INLINE btScalar
-btDistance2(const btVector3& v1, const btVector3& v2) 
-{ 
-	return v1.distance2(v2); 
-}
-
-
-/**@brief Return the distance between two vectors */
-SIMD_FORCE_INLINE btScalar
-btDistance(const btVector3& v1, const btVector3& v2) 
-{ 
-	return v1.distance(v2); 
-}
-
-/**@brief Return the angle between two vectors */
-SIMD_FORCE_INLINE btScalar
-btAngle(const btVector3& v1, const btVector3& v2) 
-{ 
-	return v1.angle(v2); 
-}
-
-/**@brief Return the cross product of two vectors */
-SIMD_FORCE_INLINE btVector3 
-btCross(const btVector3& v1, const btVector3& v2) 
-{ 
-	return v1.cross(v2); 
-}
-
-SIMD_FORCE_INLINE btScalar
-btTriple(const btVector3& v1, const btVector3& v2, const btVector3& v3)
-{
-	return v1.triple(v2, v3);
-}
-
-/**@brief Return the linear interpolation between two vectors
- * @param v1 One vector 
- * @param v2 The other vector 
- * @param t The ration of this to v (t = 0 => return v1, t=1 => return v2) */
-SIMD_FORCE_INLINE btVector3 
-lerp(const btVector3& v1, const btVector3& v2, const btScalar& t)
-{
-	return v1.lerp(v2, t);
-}
-
-
-
-SIMD_FORCE_INLINE btScalar btVector3::distance2(const btVector3& v) const
-{
-	return (v - *this).length2();
-}
-
-SIMD_FORCE_INLINE btScalar btVector3::distance(const btVector3& v) const
-{
-	return (v - *this).length();
-}
-
-SIMD_FORCE_INLINE btVector3 btVector3::normalized() const
-{
-	return *this / length();
-} 
-
-SIMD_FORCE_INLINE btVector3 btVector3::rotate( const btVector3& wAxis, const btScalar angle ) const
-{
-	// wAxis must be a unit lenght vector
-
-	btVector3 o = wAxis * wAxis.dot( *this );
-	btVector3 x = *this - o;
-	btVector3 y;
-
-	y = wAxis.cross( *this );
-
-	return ( o + x * btCos( angle ) + y * btSin( angle ) );
-}
-
-class btVector4 : public btVector3
-{
-public:
-
-	SIMD_FORCE_INLINE btVector4() {}
-
-
-	SIMD_FORCE_INLINE btVector4(const btScalar& x, const btScalar& y, const btScalar& z,const btScalar& w) 
-		: btVector3(x,y,z)
-	{
-		m_floats[3] = w;
-	}
-
-
-	SIMD_FORCE_INLINE btVector4 absolute4() const 
-	{
-		return btVector4(
-			btFabs(m_floats[0]), 
-			btFabs(m_floats[1]), 
-			btFabs(m_floats[2]),
-			btFabs(m_floats[3]));
-	}
-
-
-
-	btScalar	getW() const { return m_floats[3];}
-
-
-		SIMD_FORCE_INLINE int maxAxis4() const
-	{
-		int maxIndex = -1;
-		btScalar maxVal = btScalar(-BT_LARGE_FLOAT);
-		if (m_floats[0] > maxVal)
-		{
-			maxIndex = 0;
-			maxVal = m_floats[0];
-		}
-		if (m_floats[1] > maxVal)
-		{
-			maxIndex = 1;
-			maxVal = m_floats[1];
-		}
-		if (m_floats[2] > maxVal)
-		{
-			maxIndex = 2;
-			maxVal =m_floats[2];
-		}
-		if (m_floats[3] > maxVal)
-		{
-			maxIndex = 3;
-			maxVal = m_floats[3];
-		}
-		
-		
-		
-
-		return maxIndex;
-
-	}
-
-
-	SIMD_FORCE_INLINE int minAxis4() const
-	{
-		int minIndex = -1;
-		btScalar minVal = btScalar(BT_LARGE_FLOAT);
-		if (m_floats[0] < minVal)
-		{
-			minIndex = 0;
-			minVal = m_floats[0];
-		}
-		if (m_floats[1] < minVal)
-		{
-			minIndex = 1;
-			minVal = m_floats[1];
-		}
-		if (m_floats[2] < minVal)
-		{
-			minIndex = 2;
-			minVal =m_floats[2];
-		}
-		if (m_floats[3] < minVal)
-		{
-			minIndex = 3;
-			minVal = m_floats[3];
-		}
-		
-		return minIndex;
-
-	}
-
-
-	SIMD_FORCE_INLINE int closestAxis4() const 
-	{
-		return absolute4().maxAxis4();
-	}
-
-	
- 
-
-  /**@brief Set x,y,z and zero w 
-   * @param x Value of x
-   * @param y Value of y
-   * @param z Value of z
-   */
-		
-
-/*		void getValue(btScalar *m) const 
-		{
-			m[0] = m_floats[0];
-			m[1] = m_floats[1];
-			m[2] =m_floats[2];
-		}
-*/
-/**@brief Set the values 
-   * @param x Value of x
-   * @param y Value of y
-   * @param z Value of z
-   * @param w Value of w
-   */
-		SIMD_FORCE_INLINE void	setValue(const btScalar& x, const btScalar& y, const btScalar& z,const btScalar& w)
-		{
-			m_floats[0]=x;
-			m_floats[1]=y;
-			m_floats[2]=z;
-			m_floats[3]=w;
-		}
-
-
-};
-
-
-///btSwapVector3Endian swaps vector endianness, useful for network and cross-platform serialization
-SIMD_FORCE_INLINE void	btSwapScalarEndian(const btScalar& sourceVal, btScalar& destVal)
-{
-	#ifdef BT_USE_DOUBLE_PRECISION
-	unsigned char* dest = (unsigned char*) &destVal;
-	unsigned char* src  = (unsigned char*) &sourceVal;
-	dest[0] = src[7];
-    dest[1] = src[6];
-    dest[2] = src[5];
-    dest[3] = src[4];
-    dest[4] = src[3];
-    dest[5] = src[2];
-    dest[6] = src[1];
-    dest[7] = src[0];
-#else
-	unsigned char* dest = (unsigned char*) &destVal;
-	unsigned char* src  = (unsigned char*) &sourceVal;
-	dest[0] = src[3];
-    dest[1] = src[2];
-    dest[2] = src[1];
-    dest[3] = src[0];
-#endif //BT_USE_DOUBLE_PRECISION
-}
-///btSwapVector3Endian swaps vector endianness, useful for network and cross-platform serialization
-SIMD_FORCE_INLINE void	btSwapVector3Endian(const btVector3& sourceVec, btVector3& destVec)
-{
-	for (int i=0;i<4;i++)
-	{
-		btSwapScalarEndian(sourceVec[i],destVec[i]);
-	}
-
-}
-
-///btUnSwapVector3Endian swaps vector endianness, useful for network and cross-platform serialization
-SIMD_FORCE_INLINE void	btUnSwapVector3Endian(btVector3& vector)
-{
-
-	btVector3	swappedVec;
-	for (int i=0;i<4;i++)
-	{
-		btSwapScalarEndian(vector[i],swappedVec[i]);
-	}
-	vector = swappedVec;
-}
-
-template <class T>
-SIMD_FORCE_INLINE void btPlaneSpace1 (const T& n, T& p, T& q)
-{
-  if (btFabs(n[2]) > SIMDSQRT12) {
-    // choose p in y-z plane
-    btScalar a = n[1]*n[1] + n[2]*n[2];
-    btScalar k = btRecipSqrt (a);
-    p[0] = 0;
-	p[1] = -n[2]*k;
-	p[2] = n[1]*k;
-    // set q = n x p
-    q[0] = a*k;
-	q[1] = -n[0]*p[2];
-	q[2] = n[0]*p[1];
-  }
-  else {
-    // choose p in x-y plane
-    btScalar a = n[0]*n[0] + n[1]*n[1];
-    btScalar k = btRecipSqrt (a);
-    p[0] = -n[1]*k;
-	p[1] = n[0]*k;
-	p[2] = 0;
-    // set q = n x p
-    q[0] = -n[2]*p[1];
-	q[1] = n[2]*p[0];
-	q[2] = a*k;
-  }
-}
-
-
-struct	btVector3FloatData
-{
-	float	m_floats[4];
-};
-
-struct	btVector3DoubleData
-{
-	double	m_floats[4];
-
-};
-
-SIMD_FORCE_INLINE	void	btVector3::serializeFloat(struct	btVector3FloatData& dataOut) const
-{
-	///could also do a memcpy, check if it is worth it
-	for (int i=0;i<4;i++)
-		dataOut.m_floats[i] = float(m_floats[i]);
-}
-
-SIMD_FORCE_INLINE void	btVector3::deSerializeFloat(const struct	btVector3FloatData& dataIn)
-{
-	for (int i=0;i<4;i++)
-		m_floats[i] = btScalar(dataIn.m_floats[i]);
-}
-
-
-SIMD_FORCE_INLINE	void	btVector3::serializeDouble(struct	btVector3DoubleData& dataOut) const
-{
-	///could also do a memcpy, check if it is worth it
-	for (int i=0;i<4;i++)
-		dataOut.m_floats[i] = double(m_floats[i]);
-}
-
-SIMD_FORCE_INLINE void	btVector3::deSerializeDouble(const struct	btVector3DoubleData& dataIn)
-{
-	for (int i=0;i<4;i++)
-		m_floats[i] = btScalar(dataIn.m_floats[i]);
-}
-
-
-SIMD_FORCE_INLINE	void	btVector3::serialize(struct	btVector3Data& dataOut) const
-{
-	///could also do a memcpy, check if it is worth it
-	for (int i=0;i<4;i++)
-		dataOut.m_floats[i] = m_floats[i];
-}
-
-SIMD_FORCE_INLINE void	btVector3::deSerialize(const struct	btVector3Data& dataIn)
-{
-	for (int i=0;i<4;i++)
-		m_floats[i] = dataIn.m_floats[i];
-}
-
-
-#endif //BT_VECTOR3_H
diff --git a/hkl3d/bullet/src/Makefile.am b/hkl3d/bullet/src/Makefile.am
deleted file mode 100644
index 199f79e..0000000
--- a/hkl3d/bullet/src/Makefile.am
+++ /dev/null
@@ -1,358 +0,0 @@
-if CONDITIONAL_BUILD_MULTITHREADED
-noinst_LTLIBRARIES = libbulletmath.la libbulletcollision.la libbulletdynamics.la libbulletmultithreaded.la
-
-libbulletmultithreaded_la_CXXFLAGS = -I./BulletMultiThreaded/vectormath/scalar/cpp
-libbulletmultithreaded_la_SOURCES =\
-		BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolverData.h \
-		BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp \
-		BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h \
-		BulletMultiThreaded/HeapManager.h \
-		BulletMultiThreaded/SpuCollisionObjectWrapper.cpp \
-		BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp \
-		BulletMultiThreaded/SpuLibspe2Support.cpp \
-		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp \
-		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp \
-		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.cpp \
-		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp \
-		BulletMultiThreaded/btThreadSupportInterface.cpp \
-		BulletMultiThreaded/SequentialThreadSupport.cpp \
-		BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp \
-		BulletMultiThreaded/Win32ThreadSupport.cpp \
-		BulletMultiThreaded/SpuFakeDma.cpp \
-		BulletMultiThreaded/PosixThreadSupport.cpp \
-		BulletMultiThreaded/SpuCollisionTaskProcess.cpp \
-		BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp \
-		BulletMultiThreaded/SpuSampleTaskProcess.cpp \
-		BulletMultiThreaded/SpuSampleTask/SpuSampleTask.h \
-		BulletMultiThreaded/PpuAddressSpace.h \
-		BulletMultiThreaded/SpuSampleTaskProcess.h \
-		BulletMultiThreaded/SequentialThreadSupport.h \
-		BulletMultiThreaded/PlatformDefinitions.h \
-		BulletMultiThreaded/Win32ThreadSupport.h \
-		BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.h \
-		BulletMultiThreaded/btThreadSupportInterface.h \
-		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h \
-		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuConvexPenetrationDepthSolver.h \
-		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuPreferredPenetrationDirections.h \
-		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.h \
-		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuLocalSupport.h \
-		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.h \
-		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.h \
-		BulletMultiThreaded/SpuGatheringCollisionDispatcher.h \
-		BulletMultiThreaded/SpuFakeDma.h \
-		BulletMultiThreaded/SpuSync.h \
-		BulletMultiThreaded/TrbDynBody.h \
-		BulletMultiThreaded/TrbStateVec.h \
-		BulletMultiThreaded/SpuCollisionObjectWrapper.h \
-		BulletMultiThreaded/SpuDoubleBuffer.h \
-		BulletMultiThreaded/SpuCollisionTaskProcess.h \
-		BulletMultiThreaded/PosixThreadSupport.h \
-		BulletMultiThreaded/SpuLibspe2Support.h \
-		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp \
-		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.h \
-		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/Box.h
-
-else
-noinst_LTLIBRARIES = libbulletmath.la libbulletcollision.la libbulletdynamics.la
-endif
-
-
-libbulletmath_la_SOURCES	= \
-		LinearMath/btQuickprof.cpp \
-		LinearMath/btGeometryUtil.cpp \
-		LinearMath/btAlignedAllocator.cpp \
-		LinearMath/btSerializer.cpp \
-		LinearMath/btConvexHull.cpp \
-		LinearMath/btHashMap.h \
-		LinearMath/btConvexHull.h \
-		LinearMath/btConvexHullComputer.cpp \
-		LinearMath/btConvexHullComputer.h \
-		LinearMath/btAabbUtil2.h \
-		LinearMath/btGeometryUtil.h \
-		LinearMath/btQuadWord.h \
-		LinearMath/btPoolAllocator.h \
-		LinearMath/btScalar.h \
-		LinearMath/btMinMax.h \
-		LinearMath/btVector3.h \
-		LinearMath/btList.h \
-		LinearMath/btStackAlloc.h \
-		LinearMath/btMatrix3x3.h \
-		LinearMath/btMotionState.h \
-		LinearMath/btAlignedAllocator.h \
-		LinearMath/btQuaternion.h \
-		LinearMath/btAlignedObjectArray.h \
-		LinearMath/btQuickprof.h \
-		LinearMath/btSerializer.h \
-		LinearMath/btTransformUtil.h \
-		LinearMath/btTransform.h \
-		LinearMath/btDefaultMotionState.h \
-		LinearMath/btIDebugDraw.h \
-		LinearMath/btRandom.h
-
-
-libbulletcollision_la_SOURCES = \
-		BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp \
-		BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp \
-		BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp \
-		BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp \
-		BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp \
-		BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp \
-		BulletCollision/NarrowPhaseCollision/btConvexCast.cpp \
-		BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp \
-		BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp \
-		BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp \
-		BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp \
-		BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/btCollisionObject.cpp \
-		BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/btGhostObject.cpp \
-		BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp \
-		BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp \
-		BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp \
-		BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp \
-		BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp \
-		BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp \
-		BulletCollision/CollisionDispatch/btManifoldResult.cpp \
-		BulletCollision/CollisionDispatch/btCollisionWorld.cpp \
-		BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/btUnionFind.cpp \
-		BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp \
-		BulletCollision/CollisionShapes/btTetrahedronShape.cpp \
-		BulletCollision/CollisionShapes/btShapeHull.cpp \
-		BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp \
-		BulletCollision/CollisionShapes/btCompoundShape.cpp \
-		BulletCollision/CollisionShapes/btConeShape.cpp \
-		BulletCollision/CollisionShapes/btMultiSphereShape.cpp \
-		BulletCollision/CollisionShapes/btUniformScalingShape.cpp \
-		BulletCollision/CollisionShapes/btSphereShape.cpp \
-		BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp \
-		BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp \
-		BulletCollision/CollisionShapes/btTriangleMeshShape.cpp \
-		BulletCollision/CollisionShapes/btTriangleBuffer.cpp \
-		BulletCollision/CollisionShapes/btStaticPlaneShape.cpp \
-		BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp \
-		BulletCollision/CollisionShapes/btEmptyShape.cpp \
-		BulletCollision/CollisionShapes/btCollisionShape.cpp \
-		BulletCollision/CollisionShapes/btConvexShape.cpp \
-		BulletCollision/CollisionShapes/btConvex2dShape.cpp \
-		BulletCollision/CollisionShapes/btConvexInternalShape.cpp \
-		BulletCollision/CollisionShapes/btConvexHullShape.cpp \
-		BulletCollision/CollisionShapes/btConvexPolyhedron.cpp \
-		BulletCollision/CollisionShapes/btConvexPolyhedron.h \
-		BulletCollision/CollisionShapes/btTriangleCallback.cpp \
-		BulletCollision/CollisionShapes/btCapsuleShape.cpp \
-		BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp \
-		BulletCollision/CollisionShapes/btConcaveShape.cpp \
-		BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp \
-		BulletCollision/CollisionShapes/btBoxShape.cpp \
-		BulletCollision/CollisionShapes/btBox2dShape.cpp \
-		BulletCollision/CollisionShapes/btOptimizedBvh.cpp \
-		BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp \
-		BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp \
-		BulletCollision/CollisionShapes/btCylinderShape.cpp \
-		BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp \
-		BulletCollision/CollisionShapes/btStridingMeshInterface.cpp \
-		BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp \
-		BulletCollision/CollisionShapes/btTriangleMesh.cpp \
-		BulletCollision/BroadphaseCollision/btAxisSweep3.cpp \
-		BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp \
-		BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp \
-		BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp \
-		BulletCollision/BroadphaseCollision/btDispatcher.cpp \
-		BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp \
-		BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp \
-		BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp \
-		BulletCollision/BroadphaseCollision/btDbvt.cpp \
-		BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp \
-		BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h \
-		BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h \
-		BulletCollision/NarrowPhaseCollision/btConvexCast.h \
-		BulletCollision/NarrowPhaseCollision/btGjkEpa2.h \
-		BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h \
-		BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h \
-		BulletCollision/NarrowPhaseCollision/btPointCollector.h \
-		BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp \
-		BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.h \
-		BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h \
-		BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \
-		BulletCollision/NarrowPhaseCollision/btRaycastCallback.h \
-		BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h \
-		BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h \
-		BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \
-		BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h \
-		BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \
-		BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \
-		BulletCollision/CollisionDispatch/btCollisionObject.h \
-		BulletCollision/CollisionDispatch/btGhostObject.h \
-		BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h \
-		BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h \
-		BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.h \
-		BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h \
-		BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.h \
-		BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h \
-		BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \
-		BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h \
-		BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h \
-		BulletCollision/CollisionDispatch/btBoxBoxDetector.h \
-		BulletCollision/CollisionDispatch/btCollisionDispatcher.h \
-		BulletCollision/CollisionDispatch/SphereTriangleDetector.h \
-		BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h \
-		BulletCollision/CollisionDispatch/btUnionFind.h \
-		BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h \
-		BulletCollision/CollisionDispatch/btSimulationIslandManager.h \
-		BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h \
-		BulletCollision/CollisionDispatch/btCollisionWorld.h \
-		BulletCollision/CollisionDispatch/btInternalEdgeUtility.h \
-		BulletCollision/CollisionDispatch/btManifoldResult.h \
-		BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h \
-		BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h \
-		BulletCollision/CollisionDispatch/btCollisionConfiguration.h \
-		BulletCollision/CollisionShapes/btConvexShape.h \
-		BulletCollision/CollisionShapes/btConvex2dShape.h \
-		BulletCollision/CollisionShapes/btTriangleCallback.h \
-		BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \
-		BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.h \
-		BulletCollision/CollisionShapes/btCompoundShape.h \
-		BulletCollision/CollisionShapes/btBoxShape.h \
-		BulletCollision/CollisionShapes/btBox2dShape.h \
-		BulletCollision/CollisionShapes/btMultiSphereShape.h \
-		BulletCollision/CollisionShapes/btCollisionMargin.h \
-		BulletCollision/CollisionShapes/btConcaveShape.h \
-		BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h \
-		BulletCollision/CollisionShapes/btEmptyShape.h \
-		BulletCollision/CollisionShapes/btUniformScalingShape.h \
-		BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h \
-		BulletCollision/CollisionShapes/btMaterial.h \
-		BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h \
-		BulletCollision/CollisionShapes/btSphereShape.h \
-		BulletCollision/CollisionShapes/btConvexPointCloudShape.h \
-		BulletCollision/CollisionShapes/btCapsuleShape.h \
-		BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h \
-		BulletCollision/CollisionShapes/btCollisionShape.h \
-		BulletCollision/CollisionShapes/btStaticPlaneShape.h \
-		BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h \
-		BulletCollision/CollisionShapes/btTriangleMeshShape.h \
-		BulletCollision/CollisionShapes/btStridingMeshInterface.h \
-		BulletCollision/CollisionShapes/btTriangleInfoMap.h \
-		BulletCollision/CollisionShapes/btTriangleMesh.h \
-		BulletCollision/CollisionShapes/btTriangleBuffer.h \
-		BulletCollision/CollisionShapes/btShapeHull.h \
-		BulletCollision/CollisionShapes/btMinkowskiSumShape.h \
-		BulletCollision/CollisionShapes/btOptimizedBvh.h \
-		BulletCollision/CollisionShapes/btTriangleShape.h \
-		BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.h \
-		BulletCollision/CollisionShapes/btCylinderShape.h \
-		BulletCollision/CollisionShapes/btTetrahedronShape.h \
-		BulletCollision/CollisionShapes/btConvexInternalShape.h \
-		BulletCollision/CollisionShapes/btConeShape.h \
-		BulletCollision/CollisionShapes/btConvexHullShape.h \
-		BulletCollision/BroadphaseCollision/btAxisSweep3.h \
-		BulletCollision/BroadphaseCollision/btDbvtBroadphase.h \
-		BulletCollision/BroadphaseCollision/btSimpleBroadphase.h \
-		BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h \
-		BulletCollision/BroadphaseCollision/btDbvt.h \
-		BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h \
-		BulletCollision/BroadphaseCollision/btDispatcher.h \
-		BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h \
-		BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \
-		BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \
-		BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \
-		BulletCollision/BroadphaseCollision/btQuantizedBvh.h \
-		BulletCollision/Gimpact/btGImpactBvh.cpp\
-                BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp\
-                BulletCollision/Gimpact/btTriangleShapeEx.cpp\
-                BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp\
-                BulletCollision/Gimpact/btGImpactShape.cpp\
-                BulletCollision/Gimpact/gim_box_set.cpp\
-                BulletCollision/Gimpact/gim_contact.cpp\
-                BulletCollision/Gimpact/gim_memory.cpp\
-                BulletCollision/Gimpact/gim_tri_collision.cpp \
-		BulletCollision/Gimpact/btBoxCollision.h \
-		BulletCollision/Gimpact/btGenericPoolAllocator.h  \
-		BulletCollision/Gimpact/btGImpactCollisionAlgorithm.h  \
-		BulletCollision/Gimpact/btGImpactShape.h \
-		BulletCollision/Gimpact/btClipPolygon.h \
-		BulletCollision/Gimpact/btGeometryOperations.h \
-		BulletCollision/Gimpact/btGImpactMassUtil.h \
-		BulletCollision/Gimpact/btQuantization.h \
-		BulletCollision/Gimpact/btContactProcessing.h \
-		BulletCollision/Gimpact/btGImpactBvh.h \
-		BulletCollision/Gimpact/btGImpactQuantizedBvh.h \
-		BulletCollision/Gimpact/btTriangleShapeEx.h \
-		BulletCollision/Gimpact/gim_array.h \
-		BulletCollision/Gimpact/gim_box_collision.h  \
-		BulletCollision/Gimpact/gim_contact.h \
-		BulletCollision/Gimpact/gim_hash_table.h \
-		BulletCollision/Gimpact/gim_memory.h \
-		BulletCollision/Gimpact/gim_basic_geometry_operations.h \
-		BulletCollision/Gimpact/gim_box_set.h \
-		BulletCollision/Gimpact/gim_geometry.h \
-		BulletCollision/Gimpact/gim_linear_math.h \
-		BulletCollision/Gimpact/gim_radixsort.h \
-		BulletCollision/Gimpact/gim_bitset.h \
-		BulletCollision/Gimpact/gim_clip_polygon.h \
-		BulletCollision/Gimpact/gim_geom_types.h \
-		BulletCollision/Gimpact/gim_math.h \
-		BulletCollision/Gimpact/gim_tri_collision.h
-
-
-libbulletdynamics_la_SOURCES = \
-		BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp \
-		BulletDynamics/Dynamics/btRigidBody.cpp \
-		BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp \
-		BulletDynamics/Dynamics/Bullet-C-API.cpp \
-		BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp \
-		BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp \
-		BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp \
-		BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp \
-		BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp \
-		BulletDynamics/ConstraintSolver/btTypedConstraint.cpp \
-		BulletDynamics/ConstraintSolver/btContactConstraint.cpp \
-		BulletDynamics/ConstraintSolver/btSliderConstraint.cpp \
-		BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp \
-		BulletDynamics/ConstraintSolver/btHingeConstraint.cpp \
-		BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp \
-		BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp \
-		BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp \
-		BulletDynamics/Vehicle/btWheelInfo.cpp \
-		BulletDynamics/Vehicle/btRaycastVehicle.cpp \
-		BulletDynamics/Character/btKinematicCharacterController.cpp \
-		BulletDynamics/Character/btKinematicCharacterController.h \
-		BulletDynamics/Character/btCharacterControllerInterface.h \
-		BulletDynamics/Dynamics/btActionInterface.h \
-		BulletDynamics/Dynamics/btContinuousDynamicsWorld.h \
-		BulletDynamics/Dynamics/btSimpleDynamicsWorld.h \
-		Bullet-C-Api.h \
-		btBulletDynamicsCommon.h \
-		btBulletCollisionCommon.h \
-		BulletDynamics/Dynamics/btRigidBody.h \
-		BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h \
-		BulletDynamics/Dynamics/btDynamicsWorld.h \
-		BulletDynamics/ConstraintSolver/btSolverBody.h \
-		BulletDynamics/ConstraintSolver/btConstraintSolver.h \
-		BulletDynamics/ConstraintSolver/btConeTwistConstraint.h \
-		BulletDynamics/ConstraintSolver/btTypedConstraint.h \
-		BulletDynamics/ConstraintSolver/btContactSolverInfo.h \
-		BulletDynamics/ConstraintSolver/btContactConstraint.h \
-		BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h \
-		BulletDynamics/ConstraintSolver/btJacobianEntry.h \
-		BulletDynamics/ConstraintSolver/btSolverConstraint.h \
-		BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h \
-		BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h \
-		BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h \
-		BulletDynamics/ConstraintSolver/btSliderConstraint.h \
-		BulletDynamics/ConstraintSolver/btHingeConstraint.h \
-		BulletDynamics/ConstraintSolver/btHinge2Constraint.h \
-		BulletDynamics/ConstraintSolver/btUniversalConstraint.h \
-		BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h \
-		BulletDynamics/Vehicle/btVehicleRaycaster.h \
-		BulletDynamics/Vehicle/btRaycastVehicle.h \
-		BulletDynamics/Vehicle/btWheelInfo.h
diff --git a/hkl3d/bullet/src/Makefile.in b/hkl3d/bullet/src/Makefile.in
deleted file mode 100644
index c1889a1..0000000
--- a/hkl3d/bullet/src/Makefile.in
+++ /dev/null
@@ -1,2212 +0,0 @@
-# Makefile.in generated by automake 1.13.3 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
-  case $${target_option-} in \
-      ?) ;; \
-      *) echo "am__make_running_with_option: internal error: invalid" \
-              "target option '$${target_option-}' specified" >&2; \
-         exit 1;; \
-  esac; \
-  has_opt=no; \
-  sane_makeflags=$$MAKEFLAGS; \
-  if $(am__is_gnu_make); then \
-    sane_makeflags=$$MFLAGS; \
-  else \
-    case $$MAKEFLAGS in \
-      *\\[\ \	]*) \
-        bs=\\; \
-        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
-          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
-    esac; \
-  fi; \
-  skip_next=no; \
-  strip_trailopt () \
-  { \
-    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
-  }; \
-  for flg in $$sane_makeflags; do \
-    test $$skip_next = yes && { skip_next=no; continue; }; \
-    case $$flg in \
-      *=*|--*) continue;; \
-        -*I) strip_trailopt 'I'; skip_next=yes;; \
-      -*I?*) strip_trailopt 'I';; \
-        -*O) strip_trailopt 'O'; skip_next=yes;; \
-      -*O?*) strip_trailopt 'O';; \
-        -*l) strip_trailopt 'l'; skip_next=yes;; \
-      -*l?*) strip_trailopt 'l';; \
-      -[dEDm]) skip_next=yes;; \
-      -[JT]) skip_next=yes;; \
-    esac; \
-    case $$flg in \
-      *$$target_option*) has_opt=yes; break;; \
-    esac; \
-  done; \
-  test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = hkl3d/bullet/src
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/config/depcomp
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
-	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
-	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
-	$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libbulletcollision_la_LIBADD =
-am_libbulletcollision_la_OBJECTS = btRaycastCallback.lo \
-	btMinkowskiPenetrationDepthSolver.lo btSubSimplexConvexCast.lo \
-	btGjkEpaPenetrationDepthSolver.lo btGjkConvexCast.lo \
-	btPersistentManifold.lo btConvexCast.lo \
-	btContinuousConvexCollision.lo btGjkPairDetector.lo \
-	btGjkEpa2.lo btVoronoiSimplexSolver.lo \
-	btActivatingCollisionAlgorithm.lo btCollisionObject.lo \
-	btEmptyCollisionAlgorithm.lo btGhostObject.lo \
-	btSphereSphereCollisionAlgorithm.lo \
-	btSphereBoxCollisionAlgorithm.lo btCollisionDispatcher.lo \
-	btDefaultCollisionConfiguration.lo \
-	btSimulationIslandManager.lo btBoxBoxDetector.lo \
-	btConvexPlaneCollisionAlgorithm.lo \
-	btConvexConcaveCollisionAlgorithm.lo \
-	btBoxBoxCollisionAlgorithm.lo \
-	btBox2dBox2dCollisionAlgorithm.lo SphereTriangleDetector.lo \
-	btInternalEdgeUtility.lo btManifoldResult.lo \
-	btCollisionWorld.lo btSphereTriangleCollisionAlgorithm.lo \
-	btConvexConvexAlgorithm.lo btConvex2dConvex2dAlgorithm.lo \
-	btUnionFind.lo btCompoundCollisionAlgorithm.lo \
-	btTetrahedronShape.lo btShapeHull.lo btMinkowskiSumShape.lo \
-	btCompoundShape.lo btConeShape.lo btMultiSphereShape.lo \
-	btUniformScalingShape.lo btSphereShape.lo \
-	btTriangleIndexVertexArray.lo btBvhTriangleMeshShape.lo \
-	btTriangleMeshShape.lo btTriangleBuffer.lo \
-	btStaticPlaneShape.lo btPolyhedralConvexShape.lo \
-	btEmptyShape.lo btCollisionShape.lo btConvexShape.lo \
-	btConvex2dShape.lo btConvexInternalShape.lo \
-	btConvexHullShape.lo btConvexPolyhedron.lo \
-	btTriangleCallback.lo btCapsuleShape.lo \
-	btConvexTriangleMeshShape.lo btConcaveShape.lo \
-	btConvexPointCloudShape.lo btBoxShape.lo btBox2dShape.lo \
-	btOptimizedBvh.lo btHeightfieldTerrainShape.lo \
-	btMultimaterialTriangleMeshShape.lo btCylinderShape.lo \
-	btScaledBvhTriangleMeshShape.lo btStridingMeshInterface.lo \
-	btTriangleIndexVertexMaterialArray.lo btTriangleMesh.lo \
-	btAxisSweep3.lo btOverlappingPairCache.lo btDbvtBroadphase.lo \
-	btMultiSapBroadphase.lo btDispatcher.lo btBroadphaseProxy.lo \
-	btQuantizedBvh.lo btCollisionAlgorithm.lo btDbvt.lo \
-	btSimpleBroadphase.lo btPolyhedralContactClipping.lo \
-	btGImpactBvh.lo btGImpactQuantizedBvh.lo btTriangleShapeEx.lo \
-	btGImpactCollisionAlgorithm.lo btGImpactShape.lo \
-	gim_box_set.lo gim_contact.lo gim_memory.lo \
-	gim_tri_collision.lo
-libbulletcollision_la_OBJECTS = $(am_libbulletcollision_la_OBJECTS)
-AM_V_lt = $(am__v_lt_ at AM_V@)
-am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 = 
- at CONDITIONAL_BUILD_MULTITHREADED_FALSE@am_libbulletcollision_la_rpath =
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@am_libbulletcollision_la_rpath =
-libbulletdynamics_la_LIBADD =
-am_libbulletdynamics_la_OBJECTS = btContinuousDynamicsWorld.lo \
-	btRigidBody.lo btSimpleDynamicsWorld.lo Bullet-C-API.lo \
-	btDiscreteDynamicsWorld.lo btGeneric6DofConstraint.lo \
-	btGeneric6DofSpringConstraint.lo btSolve2LinearConstraint.lo \
-	btPoint2PointConstraint.lo btTypedConstraint.lo \
-	btContactConstraint.lo btSliderConstraint.lo \
-	btConeTwistConstraint.lo btHingeConstraint.lo \
-	btHinge2Constraint.lo btUniversalConstraint.lo \
-	btSequentialImpulseConstraintSolver.lo btWheelInfo.lo \
-	btRaycastVehicle.lo btKinematicCharacterController.lo
-libbulletdynamics_la_OBJECTS = $(am_libbulletdynamics_la_OBJECTS)
- at CONDITIONAL_BUILD_MULTITHREADED_FALSE@am_libbulletdynamics_la_rpath =
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@am_libbulletdynamics_la_rpath =
-libbulletmath_la_LIBADD =
-am_libbulletmath_la_OBJECTS = btQuickprof.lo btGeometryUtil.lo \
-	btAlignedAllocator.lo btSerializer.lo btConvexHull.lo \
-	btConvexHullComputer.lo
-libbulletmath_la_OBJECTS = $(am_libbulletmath_la_OBJECTS)
- at CONDITIONAL_BUILD_MULTITHREADED_FALSE@am_libbulletmath_la_rpath =
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@am_libbulletmath_la_rpath =
-libbulletmultithreaded_la_LIBADD =
-am__libbulletmultithreaded_la_SOURCES_DIST = BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolverData.h \
-	BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp \
-	BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h \
-	BulletMultiThreaded/HeapManager.h \
-	BulletMultiThreaded/SpuCollisionObjectWrapper.cpp \
-	BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp \
-	BulletMultiThreaded/SpuLibspe2Support.cpp \
-	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp \
-	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp \
-	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.cpp \
-	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp \
-	BulletMultiThreaded/btThreadSupportInterface.cpp \
-	BulletMultiThreaded/SequentialThreadSupport.cpp \
-	BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp \
-	BulletMultiThreaded/Win32ThreadSupport.cpp \
-	BulletMultiThreaded/SpuFakeDma.cpp \
-	BulletMultiThreaded/PosixThreadSupport.cpp \
-	BulletMultiThreaded/SpuCollisionTaskProcess.cpp \
-	BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp \
-	BulletMultiThreaded/SpuSampleTaskProcess.cpp \
-	BulletMultiThreaded/SpuSampleTask/SpuSampleTask.h \
-	BulletMultiThreaded/PpuAddressSpace.h \
-	BulletMultiThreaded/SpuSampleTaskProcess.h \
-	BulletMultiThreaded/SequentialThreadSupport.h \
-	BulletMultiThreaded/PlatformDefinitions.h \
-	BulletMultiThreaded/Win32ThreadSupport.h \
-	BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.h \
-	BulletMultiThreaded/btThreadSupportInterface.h \
-	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h \
-	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuConvexPenetrationDepthSolver.h \
-	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuPreferredPenetrationDirections.h \
-	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.h \
-	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuLocalSupport.h \
-	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.h \
-	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.h \
-	BulletMultiThreaded/SpuGatheringCollisionDispatcher.h \
-	BulletMultiThreaded/SpuFakeDma.h BulletMultiThreaded/SpuSync.h \
-	BulletMultiThreaded/TrbDynBody.h \
-	BulletMultiThreaded/TrbStateVec.h \
-	BulletMultiThreaded/SpuCollisionObjectWrapper.h \
-	BulletMultiThreaded/SpuDoubleBuffer.h \
-	BulletMultiThreaded/SpuCollisionTaskProcess.h \
-	BulletMultiThreaded/PosixThreadSupport.h \
-	BulletMultiThreaded/SpuLibspe2Support.h \
-	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp \
-	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.h \
-	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/Box.h
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@am_libbulletmultithreaded_la_OBJECTS = libbulletmultithreaded_la-btSoftBodySolver_CPU.lo \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuCollisionObjectWrapper.lo \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuSampleTask.lo \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuLibspe2Support.lo \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuContactResult.lo \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuGatheringCollisionTask.lo \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuMinkowskiPenetrationDepthSolver.lo \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuCollisionShapes.lo \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-btThreadSupportInterface.lo \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SequentialThreadSupport.lo \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuGatheringCollisionDispatcher.lo \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-Win32ThreadSupport.lo \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuFakeDma.lo \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-PosixThreadSupport.lo \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuCollisionTaskProcess.lo \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuContactManifoldCollisionAlgorithm.lo \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuSampleTaskProcess.lo \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-boxBoxDistance.lo
-libbulletmultithreaded_la_OBJECTS =  \
-	$(am_libbulletmultithreaded_la_OBJECTS)
-libbulletmultithreaded_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
-	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
-	$(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@am_libbulletmultithreaded_la_rpath =
-AM_V_P = $(am__v_P_ at AM_V@)
-am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_ at AM_V@)
-am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
-am__v_GEN_0 = @echo "  GEN     " $@;
-am__v_GEN_1 = 
-AM_V_at = $(am__v_at_ at AM_V@)
-am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 = 
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/config/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CXXFLAGS) $(CXXFLAGS)
-AM_V_CXX = $(am__v_CXX_ at AM_V@)
-am__v_CXX_ = $(am__v_CXX_ at AM_DEFAULT_V@)
-am__v_CXX_0 = @echo "  CXX     " $@;
-am__v_CXX_1 = 
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
-	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CXXLD = $(am__v_CXXLD_ at AM_V@)
-am__v_CXXLD_ = $(am__v_CXXLD_ at AM_DEFAULT_V@)
-am__v_CXXLD_0 = @echo "  CXXLD   " $@;
-am__v_CXXLD_1 = 
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
-	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_ at AM_V@)
-am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 = 
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
-	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 = 
-SOURCES = $(libbulletcollision_la_SOURCES) \
-	$(libbulletdynamics_la_SOURCES) $(libbulletmath_la_SOURCES) \
-	$(libbulletmultithreaded_la_SOURCES)
-DIST_SOURCES = $(libbulletcollision_la_SOURCES) \
-	$(libbulletdynamics_la_SOURCES) $(libbulletmath_la_SOURCES) \
-	$(am__libbulletmultithreaded_la_SOURCES_DIST)
-am__can_run_installinfo = \
-  case $$AM_UPDATE_INFO_DIR in \
-    n|no|NO) false;; \
-    *) (install-info --version) >/dev/null 2>&1;; \
-  esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates.  Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
-  BEGIN { nonempty = 0; } \
-  { items[$$0] = 1; nonempty = 1; } \
-  END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique.  This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
-  list='$(am__tagged_files)'; \
-  unique=`for i in $$list; do \
-    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-  done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-ASY = @ASY@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-G3D_CFLAGS = @G3D_CFLAGS@
-G3D_LIBS = @G3D_LIBS@
-GLIB_CFLAGS = @GLIB_CFLAGS@
-GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
-GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
-GLIB_LIBS = @GLIB_LIBS@
-GLIB_MKENUMS = @GLIB_MKENUMS@
-GLU_CFLAGS = @GLU_CFLAGS@
-GLU_LIBS = @GLU_LIBS@
-GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
-GOBJECT_LIBS = @GOBJECT_LIBS@
-GOBJECT_QUERY = @GOBJECT_QUERY@
-GREP = @GREP@
-GSL_CFLAGS = @GSL_CFLAGS@
-GSL_CONFIG = @GSL_CONFIG@
-GSL_LIBS = @GSL_LIBS@
-GTKDOC_CHECK = @GTKDOC_CHECK@
-GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
-GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
-GTKDOC_MKPDF = @GTKDOC_MKPDF@
-GTKDOC_REBASE = @GTKDOC_REBASE@
-GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
-GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
-GTKMM_CFLAGS = @GTKMM_CFLAGS@
-GTKMM_LIBS = @GTKMM_LIBS@
-HTML_DIR = @HTML_DIR@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
-INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
-INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
-INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
-INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
-INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
-INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
-INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-LTP = @LTP@
-LTP_GENHTML = @LTP_GENHTML@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-SHTOOL = @SHTOOL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-VMAJ = @VMAJ@
-YAML_CFLAGS = @YAML_CFLAGS@
-YAML_LIBS = @YAML_LIBS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-opengl_LIBS = @opengl_LIBS@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-release_info = @release_info@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-version_info = @version_info@
- at CONDITIONAL_BUILD_MULTITHREADED_FALSE@noinst_LTLIBRARIES = libbulletmath.la libbulletcollision.la libbulletdynamics.la
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@noinst_LTLIBRARIES = libbulletmath.la libbulletcollision.la libbulletdynamics.la libbulletmultithreaded.la
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@libbulletmultithreaded_la_CXXFLAGS = -I./BulletMultiThreaded/vectormath/scalar/cpp
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@libbulletmultithreaded_la_SOURCES = \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolverData.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/HeapManager.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuCollisionObjectWrapper.cpp \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuLibspe2Support.cpp \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.cpp \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/btThreadSupportInterface.cpp \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SequentialThreadSupport.cpp \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/Win32ThreadSupport.cpp \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuFakeDma.cpp \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/PosixThreadSupport.cpp \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuCollisionTaskProcess.cpp \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuSampleTaskProcess.cpp \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuSampleTask/SpuSampleTask.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/PpuAddressSpace.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuSampleTaskProcess.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SequentialThreadSupport.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/PlatformDefinitions.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/Win32ThreadSupport.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/btThreadSupportInterface.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuConvexPenetrationDepthSolver.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuPreferredPenetrationDirections.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuLocalSupport.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuGatheringCollisionDispatcher.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuFakeDma.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuSync.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/TrbDynBody.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/TrbStateVec.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuCollisionObjectWrapper.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuDoubleBuffer.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuCollisionTaskProcess.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/PosixThreadSupport.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuLibspe2Support.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.h \
- at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/Box.h
-
-libbulletmath_la_SOURCES = \
-		LinearMath/btQuickprof.cpp \
-		LinearMath/btGeometryUtil.cpp \
-		LinearMath/btAlignedAllocator.cpp \
-		LinearMath/btSerializer.cpp \
-		LinearMath/btConvexHull.cpp \
-		LinearMath/btHashMap.h \
-		LinearMath/btConvexHull.h \
-		LinearMath/btConvexHullComputer.cpp \
-		LinearMath/btConvexHullComputer.h \
-		LinearMath/btAabbUtil2.h \
-		LinearMath/btGeometryUtil.h \
-		LinearMath/btQuadWord.h \
-		LinearMath/btPoolAllocator.h \
-		LinearMath/btScalar.h \
-		LinearMath/btMinMax.h \
-		LinearMath/btVector3.h \
-		LinearMath/btList.h \
-		LinearMath/btStackAlloc.h \
-		LinearMath/btMatrix3x3.h \
-		LinearMath/btMotionState.h \
-		LinearMath/btAlignedAllocator.h \
-		LinearMath/btQuaternion.h \
-		LinearMath/btAlignedObjectArray.h \
-		LinearMath/btQuickprof.h \
-		LinearMath/btSerializer.h \
-		LinearMath/btTransformUtil.h \
-		LinearMath/btTransform.h \
-		LinearMath/btDefaultMotionState.h \
-		LinearMath/btIDebugDraw.h \
-		LinearMath/btRandom.h
-
-libbulletcollision_la_SOURCES = \
-		BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp \
-		BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp \
-		BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp \
-		BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp \
-		BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp \
-		BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp \
-		BulletCollision/NarrowPhaseCollision/btConvexCast.cpp \
-		BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp \
-		BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp \
-		BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp \
-		BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp \
-		BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/btCollisionObject.cpp \
-		BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/btGhostObject.cpp \
-		BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp \
-		BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp \
-		BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp \
-		BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp \
-		BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp \
-		BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp \
-		BulletCollision/CollisionDispatch/btManifoldResult.cpp \
-		BulletCollision/CollisionDispatch/btCollisionWorld.cpp \
-		BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp \
-		BulletCollision/CollisionDispatch/btUnionFind.cpp \
-		BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp \
-		BulletCollision/CollisionShapes/btTetrahedronShape.cpp \
-		BulletCollision/CollisionShapes/btShapeHull.cpp \
-		BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp \
-		BulletCollision/CollisionShapes/btCompoundShape.cpp \
-		BulletCollision/CollisionShapes/btConeShape.cpp \
-		BulletCollision/CollisionShapes/btMultiSphereShape.cpp \
-		BulletCollision/CollisionShapes/btUniformScalingShape.cpp \
-		BulletCollision/CollisionShapes/btSphereShape.cpp \
-		BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp \
-		BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp \
-		BulletCollision/CollisionShapes/btTriangleMeshShape.cpp \
-		BulletCollision/CollisionShapes/btTriangleBuffer.cpp \
-		BulletCollision/CollisionShapes/btStaticPlaneShape.cpp \
-		BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp \
-		BulletCollision/CollisionShapes/btEmptyShape.cpp \
-		BulletCollision/CollisionShapes/btCollisionShape.cpp \
-		BulletCollision/CollisionShapes/btConvexShape.cpp \
-		BulletCollision/CollisionShapes/btConvex2dShape.cpp \
-		BulletCollision/CollisionShapes/btConvexInternalShape.cpp \
-		BulletCollision/CollisionShapes/btConvexHullShape.cpp \
-		BulletCollision/CollisionShapes/btConvexPolyhedron.cpp \
-		BulletCollision/CollisionShapes/btConvexPolyhedron.h \
-		BulletCollision/CollisionShapes/btTriangleCallback.cpp \
-		BulletCollision/CollisionShapes/btCapsuleShape.cpp \
-		BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp \
-		BulletCollision/CollisionShapes/btConcaveShape.cpp \
-		BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp \
-		BulletCollision/CollisionShapes/btBoxShape.cpp \
-		BulletCollision/CollisionShapes/btBox2dShape.cpp \
-		BulletCollision/CollisionShapes/btOptimizedBvh.cpp \
-		BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp \
-		BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp \
-		BulletCollision/CollisionShapes/btCylinderShape.cpp \
-		BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp \
-		BulletCollision/CollisionShapes/btStridingMeshInterface.cpp \
-		BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp \
-		BulletCollision/CollisionShapes/btTriangleMesh.cpp \
-		BulletCollision/BroadphaseCollision/btAxisSweep3.cpp \
-		BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp \
-		BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp \
-		BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp \
-		BulletCollision/BroadphaseCollision/btDispatcher.cpp \
-		BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp \
-		BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp \
-		BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp \
-		BulletCollision/BroadphaseCollision/btDbvt.cpp \
-		BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp \
-		BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h \
-		BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h \
-		BulletCollision/NarrowPhaseCollision/btConvexCast.h \
-		BulletCollision/NarrowPhaseCollision/btGjkEpa2.h \
-		BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h \
-		BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h \
-		BulletCollision/NarrowPhaseCollision/btPointCollector.h \
-		BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp \
-		BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.h \
-		BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h \
-		BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \
-		BulletCollision/NarrowPhaseCollision/btRaycastCallback.h \
-		BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h \
-		BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h \
-		BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \
-		BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h \
-		BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \
-		BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \
-		BulletCollision/CollisionDispatch/btCollisionObject.h \
-		BulletCollision/CollisionDispatch/btGhostObject.h \
-		BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h \
-		BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h \
-		BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.h \
-		BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h \
-		BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.h \
-		BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h \
-		BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \
-		BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h \
-		BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h \
-		BulletCollision/CollisionDispatch/btBoxBoxDetector.h \
-		BulletCollision/CollisionDispatch/btCollisionDispatcher.h \
-		BulletCollision/CollisionDispatch/SphereTriangleDetector.h \
-		BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h \
-		BulletCollision/CollisionDispatch/btUnionFind.h \
-		BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h \
-		BulletCollision/CollisionDispatch/btSimulationIslandManager.h \
-		BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h \
-		BulletCollision/CollisionDispatch/btCollisionWorld.h \
-		BulletCollision/CollisionDispatch/btInternalEdgeUtility.h \
-		BulletCollision/CollisionDispatch/btManifoldResult.h \
-		BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h \
-		BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h \
-		BulletCollision/CollisionDispatch/btCollisionConfiguration.h \
-		BulletCollision/CollisionShapes/btConvexShape.h \
-		BulletCollision/CollisionShapes/btConvex2dShape.h \
-		BulletCollision/CollisionShapes/btTriangleCallback.h \
-		BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \
-		BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.h \
-		BulletCollision/CollisionShapes/btCompoundShape.h \
-		BulletCollision/CollisionShapes/btBoxShape.h \
-		BulletCollision/CollisionShapes/btBox2dShape.h \
-		BulletCollision/CollisionShapes/btMultiSphereShape.h \
-		BulletCollision/CollisionShapes/btCollisionMargin.h \
-		BulletCollision/CollisionShapes/btConcaveShape.h \
-		BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h \
-		BulletCollision/CollisionShapes/btEmptyShape.h \
-		BulletCollision/CollisionShapes/btUniformScalingShape.h \
-		BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h \
-		BulletCollision/CollisionShapes/btMaterial.h \
-		BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h \
-		BulletCollision/CollisionShapes/btSphereShape.h \
-		BulletCollision/CollisionShapes/btConvexPointCloudShape.h \
-		BulletCollision/CollisionShapes/btCapsuleShape.h \
-		BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h \
-		BulletCollision/CollisionShapes/btCollisionShape.h \
-		BulletCollision/CollisionShapes/btStaticPlaneShape.h \
-		BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h \
-		BulletCollision/CollisionShapes/btTriangleMeshShape.h \
-		BulletCollision/CollisionShapes/btStridingMeshInterface.h \
-		BulletCollision/CollisionShapes/btTriangleInfoMap.h \
-		BulletCollision/CollisionShapes/btTriangleMesh.h \
-		BulletCollision/CollisionShapes/btTriangleBuffer.h \
-		BulletCollision/CollisionShapes/btShapeHull.h \
-		BulletCollision/CollisionShapes/btMinkowskiSumShape.h \
-		BulletCollision/CollisionShapes/btOptimizedBvh.h \
-		BulletCollision/CollisionShapes/btTriangleShape.h \
-		BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.h \
-		BulletCollision/CollisionShapes/btCylinderShape.h \
-		BulletCollision/CollisionShapes/btTetrahedronShape.h \
-		BulletCollision/CollisionShapes/btConvexInternalShape.h \
-		BulletCollision/CollisionShapes/btConeShape.h \
-		BulletCollision/CollisionShapes/btConvexHullShape.h \
-		BulletCollision/BroadphaseCollision/btAxisSweep3.h \
-		BulletCollision/BroadphaseCollision/btDbvtBroadphase.h \
-		BulletCollision/BroadphaseCollision/btSimpleBroadphase.h \
-		BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h \
-		BulletCollision/BroadphaseCollision/btDbvt.h \
-		BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h \
-		BulletCollision/BroadphaseCollision/btDispatcher.h \
-		BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h \
-		BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \
-		BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \
-		BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \
-		BulletCollision/BroadphaseCollision/btQuantizedBvh.h \
-		BulletCollision/Gimpact/btGImpactBvh.cpp\
-                BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp\
-                BulletCollision/Gimpact/btTriangleShapeEx.cpp\
-                BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp\
-                BulletCollision/Gimpact/btGImpactShape.cpp\
-                BulletCollision/Gimpact/gim_box_set.cpp\
-                BulletCollision/Gimpact/gim_contact.cpp\
-                BulletCollision/Gimpact/gim_memory.cpp\
-                BulletCollision/Gimpact/gim_tri_collision.cpp \
-		BulletCollision/Gimpact/btBoxCollision.h \
-		BulletCollision/Gimpact/btGenericPoolAllocator.h  \
-		BulletCollision/Gimpact/btGImpactCollisionAlgorithm.h  \
-		BulletCollision/Gimpact/btGImpactShape.h \
-		BulletCollision/Gimpact/btClipPolygon.h \
-		BulletCollision/Gimpact/btGeometryOperations.h \
-		BulletCollision/Gimpact/btGImpactMassUtil.h \
-		BulletCollision/Gimpact/btQuantization.h \
-		BulletCollision/Gimpact/btContactProcessing.h \
-		BulletCollision/Gimpact/btGImpactBvh.h \
-		BulletCollision/Gimpact/btGImpactQuantizedBvh.h \
-		BulletCollision/Gimpact/btTriangleShapeEx.h \
-		BulletCollision/Gimpact/gim_array.h \
-		BulletCollision/Gimpact/gim_box_collision.h  \
-		BulletCollision/Gimpact/gim_contact.h \
-		BulletCollision/Gimpact/gim_hash_table.h \
-		BulletCollision/Gimpact/gim_memory.h \
-		BulletCollision/Gimpact/gim_basic_geometry_operations.h \
-		BulletCollision/Gimpact/gim_box_set.h \
-		BulletCollision/Gimpact/gim_geometry.h \
-		BulletCollision/Gimpact/gim_linear_math.h \
-		BulletCollision/Gimpact/gim_radixsort.h \
-		BulletCollision/Gimpact/gim_bitset.h \
-		BulletCollision/Gimpact/gim_clip_polygon.h \
-		BulletCollision/Gimpact/gim_geom_types.h \
-		BulletCollision/Gimpact/gim_math.h \
-		BulletCollision/Gimpact/gim_tri_collision.h
-
-libbulletdynamics_la_SOURCES = \
-		BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp \
-		BulletDynamics/Dynamics/btRigidBody.cpp \
-		BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp \
-		BulletDynamics/Dynamics/Bullet-C-API.cpp \
-		BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp \
-		BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp \
-		BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp \
-		BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp \
-		BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp \
-		BulletDynamics/ConstraintSolver/btTypedConstraint.cpp \
-		BulletDynamics/ConstraintSolver/btContactConstraint.cpp \
-		BulletDynamics/ConstraintSolver/btSliderConstraint.cpp \
-		BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp \
-		BulletDynamics/ConstraintSolver/btHingeConstraint.cpp \
-		BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp \
-		BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp \
-		BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp \
-		BulletDynamics/Vehicle/btWheelInfo.cpp \
-		BulletDynamics/Vehicle/btRaycastVehicle.cpp \
-		BulletDynamics/Character/btKinematicCharacterController.cpp \
-		BulletDynamics/Character/btKinematicCharacterController.h \
-		BulletDynamics/Character/btCharacterControllerInterface.h \
-		BulletDynamics/Dynamics/btActionInterface.h \
-		BulletDynamics/Dynamics/btContinuousDynamicsWorld.h \
-		BulletDynamics/Dynamics/btSimpleDynamicsWorld.h \
-		Bullet-C-Api.h \
-		btBulletDynamicsCommon.h \
-		btBulletCollisionCommon.h \
-		BulletDynamics/Dynamics/btRigidBody.h \
-		BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h \
-		BulletDynamics/Dynamics/btDynamicsWorld.h \
-		BulletDynamics/ConstraintSolver/btSolverBody.h \
-		BulletDynamics/ConstraintSolver/btConstraintSolver.h \
-		BulletDynamics/ConstraintSolver/btConeTwistConstraint.h \
-		BulletDynamics/ConstraintSolver/btTypedConstraint.h \
-		BulletDynamics/ConstraintSolver/btContactSolverInfo.h \
-		BulletDynamics/ConstraintSolver/btContactConstraint.h \
-		BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h \
-		BulletDynamics/ConstraintSolver/btJacobianEntry.h \
-		BulletDynamics/ConstraintSolver/btSolverConstraint.h \
-		BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h \
-		BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h \
-		BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h \
-		BulletDynamics/ConstraintSolver/btSliderConstraint.h \
-		BulletDynamics/ConstraintSolver/btHingeConstraint.h \
-		BulletDynamics/ConstraintSolver/btHinge2Constraint.h \
-		BulletDynamics/ConstraintSolver/btUniversalConstraint.h \
-		BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h \
-		BulletDynamics/Vehicle/btVehicleRaycaster.h \
-		BulletDynamics/Vehicle/btRaycastVehicle.h \
-		BulletDynamics/Vehicle/btWheelInfo.h
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu hkl3d/bullet/src/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu hkl3d/bullet/src/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstLTLIBRARIES:
-	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
-	@list='$(noinst_LTLIBRARIES)'; \
-	locs=`for p in $$list; do echo $$p; done | \
-	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
-	      sort -u`; \
-	test -z "$$locs" || { \
-	  echo rm -f $${locs}; \
-	  rm -f $${locs}; \
-	}
-
-libbulletcollision.la: $(libbulletcollision_la_OBJECTS) $(libbulletcollision_la_DEPENDENCIES) $(EXTRA_libbulletcollision_la_DEPENDENCIES) 
-	$(AM_V_CXXLD)$(CXXLINK) $(am_libbulletcollision_la_rpath) $(libbulletcollision_la_OBJECTS) $(libbulletcollision_la_LIBADD) $(LIBS)
-
-libbulletdynamics.la: $(libbulletdynamics_la_OBJECTS) $(libbulletdynamics_la_DEPENDENCIES) $(EXTRA_libbulletdynamics_la_DEPENDENCIES) 
-	$(AM_V_CXXLD)$(CXXLINK) $(am_libbulletdynamics_la_rpath) $(libbulletdynamics_la_OBJECTS) $(libbulletdynamics_la_LIBADD) $(LIBS)
-
-libbulletmath.la: $(libbulletmath_la_OBJECTS) $(libbulletmath_la_DEPENDENCIES) $(EXTRA_libbulletmath_la_DEPENDENCIES) 
-	$(AM_V_CXXLD)$(CXXLINK) $(am_libbulletmath_la_rpath) $(libbulletmath_la_OBJECTS) $(libbulletmath_la_LIBADD) $(LIBS)
-
-libbulletmultithreaded.la: $(libbulletmultithreaded_la_OBJECTS) $(libbulletmultithreaded_la_DEPENDENCIES) $(EXTRA_libbulletmultithreaded_la_DEPENDENCIES) 
-	$(AM_V_CXXLD)$(libbulletmultithreaded_la_LINK) $(am_libbulletmultithreaded_la_rpath) $(libbulletmultithreaded_la_OBJECTS) $(libbulletmultithreaded_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Bullet-C-API.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/SphereTriangleDetector.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btActivatingCollisionAlgorithm.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btAlignedAllocator.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btAxisSweep3.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btBox2dBox2dCollisionAlgorithm.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btBox2dShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btBoxBoxCollisionAlgorithm.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btBoxBoxDetector.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btBoxShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btBroadphaseProxy.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btBvhTriangleMeshShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btCapsuleShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btCollisionAlgorithm.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btCollisionDispatcher.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btCollisionObject.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btCollisionShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btCollisionWorld.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btCompoundCollisionAlgorithm.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btCompoundShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConcaveShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConeShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConeTwistConstraint.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btContactConstraint.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btContinuousConvexCollision.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btContinuousDynamicsWorld.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvex2dConvex2dAlgorithm.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvex2dShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexCast.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexConcaveCollisionAlgorithm.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexConvexAlgorithm.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexHull.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexHullComputer.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexHullShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexInternalShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexPlaneCollisionAlgorithm.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexPointCloudShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexPolyhedron.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexTriangleMeshShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btCylinderShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btDbvt.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btDbvtBroadphase.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btDefaultCollisionConfiguration.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btDiscreteDynamicsWorld.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btDispatcher.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btEmptyCollisionAlgorithm.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btEmptyShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGImpactBvh.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGImpactCollisionAlgorithm.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGImpactQuantizedBvh.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGImpactShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGeneric6DofConstraint.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGeneric6DofSpringConstraint.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGeometryUtil.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGhostObject.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGjkConvexCast.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGjkEpa2.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGjkEpaPenetrationDepthSolver.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGjkPairDetector.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btHeightfieldTerrainShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btHinge2Constraint.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btHingeConstraint.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btInternalEdgeUtility.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btKinematicCharacterController.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btManifoldResult.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btMinkowskiPenetrationDepthSolver.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btMinkowskiSumShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btMultiSapBroadphase.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btMultiSphereShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btMultimaterialTriangleMeshShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btOptimizedBvh.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btOverlappingPairCache.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btPersistentManifold.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btPoint2PointConstraint.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btPolyhedralContactClipping.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btPolyhedralConvexShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btQuantizedBvh.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btQuickprof.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btRaycastCallback.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btRaycastVehicle.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btRigidBody.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btScaledBvhTriangleMeshShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSequentialImpulseConstraintSolver.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSerializer.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btShapeHull.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSimpleBroadphase.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSimpleDynamicsWorld.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSimulationIslandManager.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSliderConstraint.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSolve2LinearConstraint.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSphereBoxCollisionAlgorithm.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSphereShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSphereSphereCollisionAlgorithm.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSphereTriangleCollisionAlgorithm.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btStaticPlaneShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btStridingMeshInterface.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSubSimplexConvexCast.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btTetrahedronShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btTriangleBuffer.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btTriangleCallback.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btTriangleIndexVertexArray.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btTriangleIndexVertexMaterialArray.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btTriangleMesh.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btTriangleMeshShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btTriangleShapeEx.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btTypedConstraint.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btUniformScalingShape.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btUnionFind.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btUniversalConstraint.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btVoronoiSimplexSolver.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btWheelInfo.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gim_box_set.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gim_contact.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gim_memory.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gim_tri_collision.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-PosixThreadSupport.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SequentialThreadSupport.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuCollisionObjectWrapper.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuCollisionShapes.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuCollisionTaskProcess.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuContactManifoldCollisionAlgorithm.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuContactResult.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuFakeDma.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuGatheringCollisionDispatcher.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuGatheringCollisionTask.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuLibspe2Support.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuMinkowskiPenetrationDepthSolver.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuSampleTask.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuSampleTaskProcess.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-Win32ThreadSupport.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-boxBoxDistance.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-btSoftBodySolver_CPU.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-btThreadSupportInterface.Plo at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
-
-btRaycastCallback.lo: BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btRaycastCallback.lo -MD -MP -MF $(DEPDIR)/btRaycastCallback.Tpo -c -o btRaycastCallback.lo `test -f 'BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btRaycastCallback.Tpo $(DEPDIR)/btRaycastCallback.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp' object='btRaycastCallback.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btRaycastCallback.lo `test -f 'BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
-
-btMinkowskiPenetrationDepthSolver.lo: BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btMinkowskiPenetrationDepthSolver.lo -MD -MP -MF $(DEPDIR)/btMinkowskiPenetrationDepthSolver.Tpo -c -o btMinkowskiPenetrationDepthSolver.lo `test -f 'BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPha [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btMinkowskiPenetrationDepthSolver.Tpo $(DEPDIR)/btMinkowskiPenetrationDepthSolver.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp' object='btMinkowskiPenetrationDepthSolver.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btMinkowskiPenetrationDepthSolver.lo `test -f 'BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp
-
-btSubSimplexConvexCast.lo: BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSubSimplexConvexCast.lo -MD -MP -MF $(DEPDIR)/btSubSimplexConvexCast.Tpo -c -o btSubSimplexConvexCast.lo `test -f 'BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSubSimplexConvexCast.Tpo $(DEPDIR)/btSubSimplexConvexCast.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp' object='btSubSimplexConvexCast.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSubSimplexConvexCast.lo `test -f 'BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp
-
-btGjkEpaPenetrationDepthSolver.lo: BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGjkEpaPenetrationDepthSolver.lo -MD -MP -MF $(DEPDIR)/btGjkEpaPenetrationDepthSolver.Tpo -c -o btGjkEpaPenetrationDepthSolver.lo `test -f 'BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/ [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGjkEpaPenetrationDepthSolver.Tpo $(DEPDIR)/btGjkEpaPenetrationDepthSolver.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp' object='btGjkEpaPenetrationDepthSolver.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGjkEpaPenetrationDepthSolver.lo `test -f 'BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp
-
-btGjkConvexCast.lo: BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGjkConvexCast.lo -MD -MP -MF $(DEPDIR)/btGjkConvexCast.Tpo -c -o btGjkConvexCast.lo `test -f 'BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGjkConvexCast.Tpo $(DEPDIR)/btGjkConvexCast.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp' object='btGjkConvexCast.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGjkConvexCast.lo `test -f 'BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp
-
-btPersistentManifold.lo: BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btPersistentManifold.lo -MD -MP -MF $(DEPDIR)/btPersistentManifold.Tpo -c -o btPersistentManifold.lo `test -f 'BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btPersistentManifold.Tpo $(DEPDIR)/btPersistentManifold.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp' object='btPersistentManifold.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btPersistentManifold.lo `test -f 'BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp
-
-btConvexCast.lo: BulletCollision/NarrowPhaseCollision/btConvexCast.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexCast.lo -MD -MP -MF $(DEPDIR)/btConvexCast.Tpo -c -o btConvexCast.lo `test -f 'BulletCollision/NarrowPhaseCollision/btConvexCast.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btConvexCast.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexCast.Tpo $(DEPDIR)/btConvexCast.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btConvexCast.cpp' object='btConvexCast.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexCast.lo `test -f 'BulletCollision/NarrowPhaseCollision/btConvexCast.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btConvexCast.cpp
-
-btContinuousConvexCollision.lo: BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btContinuousConvexCollision.lo -MD -MP -MF $(DEPDIR)/btContinuousConvexCollision.Tpo -c -o btContinuousConvexCollision.lo `test -f 'BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btContinuous [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btContinuousConvexCollision.Tpo $(DEPDIR)/btContinuousConvexCollision.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp' object='btContinuousConvexCollision.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btContinuousConvexCollision.lo `test -f 'BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp
-
-btGjkPairDetector.lo: BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGjkPairDetector.lo -MD -MP -MF $(DEPDIR)/btGjkPairDetector.Tpo -c -o btGjkPairDetector.lo `test -f 'BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGjkPairDetector.Tpo $(DEPDIR)/btGjkPairDetector.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp' object='btGjkPairDetector.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGjkPairDetector.lo `test -f 'BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp
-
-btGjkEpa2.lo: BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGjkEpa2.lo -MD -MP -MF $(DEPDIR)/btGjkEpa2.Tpo -c -o btGjkEpa2.lo `test -f 'BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGjkEpa2.Tpo $(DEPDIR)/btGjkEpa2.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp' object='btGjkEpa2.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGjkEpa2.lo `test -f 'BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp
-
-btVoronoiSimplexSolver.lo: BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btVoronoiSimplexSolver.lo -MD -MP -MF $(DEPDIR)/btVoronoiSimplexSolver.Tpo -c -o btVoronoiSimplexSolver.lo `test -f 'BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btVoronoiSimplexSolver.Tpo $(DEPDIR)/btVoronoiSimplexSolver.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp' object='btVoronoiSimplexSolver.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btVoronoiSimplexSolver.lo `test -f 'BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp
-
-btActivatingCollisionAlgorithm.lo: BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btActivatingCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btActivatingCollisionAlgorithm.Tpo -c -o btActivatingCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btActi [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btActivatingCollisionAlgorithm.Tpo $(DEPDIR)/btActivatingCollisionAlgorithm.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp' object='btActivatingCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btActivatingCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp
-
-btCollisionObject.lo: BulletCollision/CollisionDispatch/btCollisionObject.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btCollisionObject.lo -MD -MP -MF $(DEPDIR)/btCollisionObject.Tpo -c -o btCollisionObject.lo `test -f 'BulletCollision/CollisionDispatch/btCollisionObject.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btCollisionObject.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btCollisionObject.Tpo $(DEPDIR)/btCollisionObject.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btCollisionObject.cpp' object='btCollisionObject.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btCollisionObject.lo `test -f 'BulletCollision/CollisionDispatch/btCollisionObject.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btCollisionObject.cpp
-
-btEmptyCollisionAlgorithm.lo: BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btEmptyCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btEmptyCollisionAlgorithm.Tpo -c -o btEmptyCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btEmptyCollisionAlgorithm.Tpo $(DEPDIR)/btEmptyCollisionAlgorithm.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp' object='btEmptyCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btEmptyCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp
-
-btGhostObject.lo: BulletCollision/CollisionDispatch/btGhostObject.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGhostObject.lo -MD -MP -MF $(DEPDIR)/btGhostObject.Tpo -c -o btGhostObject.lo `test -f 'BulletCollision/CollisionDispatch/btGhostObject.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btGhostObject.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGhostObject.Tpo $(DEPDIR)/btGhostObject.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btGhostObject.cpp' object='btGhostObject.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGhostObject.lo `test -f 'BulletCollision/CollisionDispatch/btGhostObject.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btGhostObject.cpp
-
-btSphereSphereCollisionAlgorithm.lo: BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSphereSphereCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btSphereSphereCollisionAlgorithm.Tpo -c -o btSphereSphereCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatc [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSphereSphereCollisionAlgorithm.Tpo $(DEPDIR)/btSphereSphereCollisionAlgorithm.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp' object='btSphereSphereCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSphereSphereCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp
-
-btSphereBoxCollisionAlgorithm.lo: BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSphereBoxCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btSphereBoxCollisionAlgorithm.Tpo -c -o btSphereBoxCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btSphereBo [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSphereBoxCollisionAlgorithm.Tpo $(DEPDIR)/btSphereBoxCollisionAlgorithm.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp' object='btSphereBoxCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSphereBoxCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp
-
-btCollisionDispatcher.lo: BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btCollisionDispatcher.lo -MD -MP -MF $(DEPDIR)/btCollisionDispatcher.Tpo -c -o btCollisionDispatcher.lo `test -f 'BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btCollisionDispatcher.Tpo $(DEPDIR)/btCollisionDispatcher.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp' object='btCollisionDispatcher.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btCollisionDispatcher.lo `test -f 'BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp
-
-btDefaultCollisionConfiguration.lo: BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btDefaultCollisionConfiguration.lo -MD -MP -MF $(DEPDIR)/btDefaultCollisionConfiguration.Tpo -c -o btDefaultCollisionConfiguration.lo `test -f 'BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/bt [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btDefaultCollisionConfiguration.Tpo $(DEPDIR)/btDefaultCollisionConfiguration.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp' object='btDefaultCollisionConfiguration.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btDefaultCollisionConfiguration.lo `test -f 'BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp
-
-btSimulationIslandManager.lo: BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSimulationIslandManager.lo -MD -MP -MF $(DEPDIR)/btSimulationIslandManager.Tpo -c -o btSimulationIslandManager.lo `test -f 'BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSimulationIslandManager.Tpo $(DEPDIR)/btSimulationIslandManager.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp' object='btSimulationIslandManager.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSimulationIslandManager.lo `test -f 'BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp
-
-btBoxBoxDetector.lo: BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btBoxBoxDetector.lo -MD -MP -MF $(DEPDIR)/btBoxBoxDetector.Tpo -c -o btBoxBoxDetector.lo `test -f 'BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btBoxBoxDetector.Tpo $(DEPDIR)/btBoxBoxDetector.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp' object='btBoxBoxDetector.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btBoxBoxDetector.lo `test -f 'BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp
-
-btConvexPlaneCollisionAlgorithm.lo: BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexPlaneCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btConvexPlaneCollisionAlgorithm.Tpo -c -o btConvexPlaneCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/bt [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexPlaneCollisionAlgorithm.Tpo $(DEPDIR)/btConvexPlaneCollisionAlgorithm.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp' object='btConvexPlaneCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexPlaneCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp
-
-btConvexConcaveCollisionAlgorithm.lo: BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexConcaveCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btConvexConcaveCollisionAlgorithm.Tpo -c -o btConvexConcaveCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDis [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexConcaveCollisionAlgorithm.Tpo $(DEPDIR)/btConvexConcaveCollisionAlgorithm.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp' object='btConvexConcaveCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexConcaveCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp
-
-btBoxBoxCollisionAlgorithm.lo: BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btBoxBoxCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btBoxBoxCollisionAlgorithm.Tpo -c -o btBoxBoxCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgor [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btBoxBoxCollisionAlgorithm.Tpo $(DEPDIR)/btBoxBoxCollisionAlgorithm.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp' object='btBoxBoxCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btBoxBoxCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp
-
-btBox2dBox2dCollisionAlgorithm.lo: BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btBox2dBox2dCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btBox2dBox2dCollisionAlgorithm.Tpo -c -o btBox2dBox2dCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btBox2 [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btBox2dBox2dCollisionAlgorithm.Tpo $(DEPDIR)/btBox2dBox2dCollisionAlgorithm.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp' object='btBox2dBox2dCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btBox2dBox2dCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp
-
-SphereTriangleDetector.lo: BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SphereTriangleDetector.lo -MD -MP -MF $(DEPDIR)/SphereTriangleDetector.Tpo -c -o SphereTriangleDetector.lo `test -f 'BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/SphereTriangleDetector.Tpo $(DEPDIR)/SphereTriangleDetector.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp' object='SphereTriangleDetector.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SphereTriangleDetector.lo `test -f 'BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp
-
-btInternalEdgeUtility.lo: BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btInternalEdgeUtility.lo -MD -MP -MF $(DEPDIR)/btInternalEdgeUtility.Tpo -c -o btInternalEdgeUtility.lo `test -f 'BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btInternalEdgeUtility.Tpo $(DEPDIR)/btInternalEdgeUtility.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp' object='btInternalEdgeUtility.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btInternalEdgeUtility.lo `test -f 'BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp
-
-btManifoldResult.lo: BulletCollision/CollisionDispatch/btManifoldResult.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btManifoldResult.lo -MD -MP -MF $(DEPDIR)/btManifoldResult.Tpo -c -o btManifoldResult.lo `test -f 'BulletCollision/CollisionDispatch/btManifoldResult.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btManifoldResult.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btManifoldResult.Tpo $(DEPDIR)/btManifoldResult.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btManifoldResult.cpp' object='btManifoldResult.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btManifoldResult.lo `test -f 'BulletCollision/CollisionDispatch/btManifoldResult.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btManifoldResult.cpp
-
-btCollisionWorld.lo: BulletCollision/CollisionDispatch/btCollisionWorld.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btCollisionWorld.lo -MD -MP -MF $(DEPDIR)/btCollisionWorld.Tpo -c -o btCollisionWorld.lo `test -f 'BulletCollision/CollisionDispatch/btCollisionWorld.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btCollisionWorld.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btCollisionWorld.Tpo $(DEPDIR)/btCollisionWorld.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btCollisionWorld.cpp' object='btCollisionWorld.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btCollisionWorld.lo `test -f 'BulletCollision/CollisionDispatch/btCollisionWorld.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btCollisionWorld.cpp
-
-btSphereTriangleCollisionAlgorithm.lo: BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSphereTriangleCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btSphereTriangleCollisionAlgorithm.Tpo -c -o btSphereTriangleCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/Collisio [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSphereTriangleCollisionAlgorithm.Tpo $(DEPDIR)/btSphereTriangleCollisionAlgorithm.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp' object='btSphereTriangleCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSphereTriangleCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp
-
-btConvexConvexAlgorithm.lo: BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexConvexAlgorithm.lo -MD -MP -MF $(DEPDIR)/btConvexConvexAlgorithm.Tpo -c -o btConvexConvexAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexConvexAlgorithm.Tpo $(DEPDIR)/btConvexConvexAlgorithm.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp' object='btConvexConvexAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexConvexAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp
-
-btConvex2dConvex2dAlgorithm.lo: BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvex2dConvex2dAlgorithm.lo -MD -MP -MF $(DEPDIR)/btConvex2dConvex2dAlgorithm.Tpo -c -o btConvex2dConvex2dAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btConvex2dConvex2d [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvex2dConvex2dAlgorithm.Tpo $(DEPDIR)/btConvex2dConvex2dAlgorithm.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp' object='btConvex2dConvex2dAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvex2dConvex2dAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp
-
-btUnionFind.lo: BulletCollision/CollisionDispatch/btUnionFind.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btUnionFind.lo -MD -MP -MF $(DEPDIR)/btUnionFind.Tpo -c -o btUnionFind.lo `test -f 'BulletCollision/CollisionDispatch/btUnionFind.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btUnionFind.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btUnionFind.Tpo $(DEPDIR)/btUnionFind.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btUnionFind.cpp' object='btUnionFind.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btUnionFind.lo `test -f 'BulletCollision/CollisionDispatch/btUnionFind.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btUnionFind.cpp
-
-btCompoundCollisionAlgorithm.lo: BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btCompoundCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btCompoundCollisionAlgorithm.Tpo -c -o btCompoundCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btCompoundColl [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btCompoundCollisionAlgorithm.Tpo $(DEPDIR)/btCompoundCollisionAlgorithm.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp' object='btCompoundCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btCompoundCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp
-
-btTetrahedronShape.lo: BulletCollision/CollisionShapes/btTetrahedronShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btTetrahedronShape.lo -MD -MP -MF $(DEPDIR)/btTetrahedronShape.Tpo -c -o btTetrahedronShape.lo `test -f 'BulletCollision/CollisionShapes/btTetrahedronShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTetrahedronShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btTetrahedronShape.Tpo $(DEPDIR)/btTetrahedronShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btTetrahedronShape.cpp' object='btTetrahedronShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btTetrahedronShape.lo `test -f 'BulletCollision/CollisionShapes/btTetrahedronShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTetrahedronShape.cpp
-
-btShapeHull.lo: BulletCollision/CollisionShapes/btShapeHull.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btShapeHull.lo -MD -MP -MF $(DEPDIR)/btShapeHull.Tpo -c -o btShapeHull.lo `test -f 'BulletCollision/CollisionShapes/btShapeHull.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btShapeHull.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btShapeHull.Tpo $(DEPDIR)/btShapeHull.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btShapeHull.cpp' object='btShapeHull.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btShapeHull.lo `test -f 'BulletCollision/CollisionShapes/btShapeHull.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btShapeHull.cpp
-
-btMinkowskiSumShape.lo: BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btMinkowskiSumShape.lo -MD -MP -MF $(DEPDIR)/btMinkowskiSumShape.Tpo -c -o btMinkowskiSumShape.lo `test -f 'BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btMinkowskiSumShape.Tpo $(DEPDIR)/btMinkowskiSumShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp' object='btMinkowskiSumShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btMinkowskiSumShape.lo `test -f 'BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp
-
-btCompoundShape.lo: BulletCollision/CollisionShapes/btCompoundShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btCompoundShape.lo -MD -MP -MF $(DEPDIR)/btCompoundShape.Tpo -c -o btCompoundShape.lo `test -f 'BulletCollision/CollisionShapes/btCompoundShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btCompoundShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btCompoundShape.Tpo $(DEPDIR)/btCompoundShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btCompoundShape.cpp' object='btCompoundShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btCompoundShape.lo `test -f 'BulletCollision/CollisionShapes/btCompoundShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btCompoundShape.cpp
-
-btConeShape.lo: BulletCollision/CollisionShapes/btConeShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConeShape.lo -MD -MP -MF $(DEPDIR)/btConeShape.Tpo -c -o btConeShape.lo `test -f 'BulletCollision/CollisionShapes/btConeShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConeShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConeShape.Tpo $(DEPDIR)/btConeShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btConeShape.cpp' object='btConeShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConeShape.lo `test -f 'BulletCollision/CollisionShapes/btConeShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConeShape.cpp
-
-btMultiSphereShape.lo: BulletCollision/CollisionShapes/btMultiSphereShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btMultiSphereShape.lo -MD -MP -MF $(DEPDIR)/btMultiSphereShape.Tpo -c -o btMultiSphereShape.lo `test -f 'BulletCollision/CollisionShapes/btMultiSphereShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btMultiSphereShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btMultiSphereShape.Tpo $(DEPDIR)/btMultiSphereShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btMultiSphereShape.cpp' object='btMultiSphereShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btMultiSphereShape.lo `test -f 'BulletCollision/CollisionShapes/btMultiSphereShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btMultiSphereShape.cpp
-
-btUniformScalingShape.lo: BulletCollision/CollisionShapes/btUniformScalingShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btUniformScalingShape.lo -MD -MP -MF $(DEPDIR)/btUniformScalingShape.Tpo -c -o btUniformScalingShape.lo `test -f 'BulletCollision/CollisionShapes/btUniformScalingShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btUniformScalingShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btUniformScalingShape.Tpo $(DEPDIR)/btUniformScalingShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btUniformScalingShape.cpp' object='btUniformScalingShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btUniformScalingShape.lo `test -f 'BulletCollision/CollisionShapes/btUniformScalingShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btUniformScalingShape.cpp
-
-btSphereShape.lo: BulletCollision/CollisionShapes/btSphereShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSphereShape.lo -MD -MP -MF $(DEPDIR)/btSphereShape.Tpo -c -o btSphereShape.lo `test -f 'BulletCollision/CollisionShapes/btSphereShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btSphereShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSphereShape.Tpo $(DEPDIR)/btSphereShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btSphereShape.cpp' object='btSphereShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSphereShape.lo `test -f 'BulletCollision/CollisionShapes/btSphereShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btSphereShape.cpp
-
-btTriangleIndexVertexArray.lo: BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btTriangleIndexVertexArray.lo -MD -MP -MF $(DEPDIR)/btTriangleIndexVertexArray.Tpo -c -o btTriangleIndexVertexArray.lo `test -f 'BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btTriangleIndexVertexArray.Tpo $(DEPDIR)/btTriangleIndexVertexArray.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp' object='btTriangleIndexVertexArray.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btTriangleIndexVertexArray.lo `test -f 'BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp
-
-btBvhTriangleMeshShape.lo: BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btBvhTriangleMeshShape.lo -MD -MP -MF $(DEPDIR)/btBvhTriangleMeshShape.Tpo -c -o btBvhTriangleMeshShape.lo `test -f 'BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btBvhTriangleMeshShape.Tpo $(DEPDIR)/btBvhTriangleMeshShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp' object='btBvhTriangleMeshShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btBvhTriangleMeshShape.lo `test -f 'BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp
-
-btTriangleMeshShape.lo: BulletCollision/CollisionShapes/btTriangleMeshShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btTriangleMeshShape.lo -MD -MP -MF $(DEPDIR)/btTriangleMeshShape.Tpo -c -o btTriangleMeshShape.lo `test -f 'BulletCollision/CollisionShapes/btTriangleMeshShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleMeshShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btTriangleMeshShape.Tpo $(DEPDIR)/btTriangleMeshShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btTriangleMeshShape.cpp' object='btTriangleMeshShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btTriangleMeshShape.lo `test -f 'BulletCollision/CollisionShapes/btTriangleMeshShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleMeshShape.cpp
-
-btTriangleBuffer.lo: BulletCollision/CollisionShapes/btTriangleBuffer.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btTriangleBuffer.lo -MD -MP -MF $(DEPDIR)/btTriangleBuffer.Tpo -c -o btTriangleBuffer.lo `test -f 'BulletCollision/CollisionShapes/btTriangleBuffer.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleBuffer.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btTriangleBuffer.Tpo $(DEPDIR)/btTriangleBuffer.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btTriangleBuffer.cpp' object='btTriangleBuffer.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btTriangleBuffer.lo `test -f 'BulletCollision/CollisionShapes/btTriangleBuffer.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleBuffer.cpp
-
-btStaticPlaneShape.lo: BulletCollision/CollisionShapes/btStaticPlaneShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btStaticPlaneShape.lo -MD -MP -MF $(DEPDIR)/btStaticPlaneShape.Tpo -c -o btStaticPlaneShape.lo `test -f 'BulletCollision/CollisionShapes/btStaticPlaneShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btStaticPlaneShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btStaticPlaneShape.Tpo $(DEPDIR)/btStaticPlaneShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btStaticPlaneShape.cpp' object='btStaticPlaneShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btStaticPlaneShape.lo `test -f 'BulletCollision/CollisionShapes/btStaticPlaneShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btStaticPlaneShape.cpp
-
-btPolyhedralConvexShape.lo: BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btPolyhedralConvexShape.lo -MD -MP -MF $(DEPDIR)/btPolyhedralConvexShape.Tpo -c -o btPolyhedralConvexShape.lo `test -f 'BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btPolyhedralConvexShape.Tpo $(DEPDIR)/btPolyhedralConvexShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp' object='btPolyhedralConvexShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btPolyhedralConvexShape.lo `test -f 'BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp
-
-btEmptyShape.lo: BulletCollision/CollisionShapes/btEmptyShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btEmptyShape.lo -MD -MP -MF $(DEPDIR)/btEmptyShape.Tpo -c -o btEmptyShape.lo `test -f 'BulletCollision/CollisionShapes/btEmptyShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btEmptyShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btEmptyShape.Tpo $(DEPDIR)/btEmptyShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btEmptyShape.cpp' object='btEmptyShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btEmptyShape.lo `test -f 'BulletCollision/CollisionShapes/btEmptyShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btEmptyShape.cpp
-
-btCollisionShape.lo: BulletCollision/CollisionShapes/btCollisionShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btCollisionShape.lo -MD -MP -MF $(DEPDIR)/btCollisionShape.Tpo -c -o btCollisionShape.lo `test -f 'BulletCollision/CollisionShapes/btCollisionShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btCollisionShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btCollisionShape.Tpo $(DEPDIR)/btCollisionShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btCollisionShape.cpp' object='btCollisionShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btCollisionShape.lo `test -f 'BulletCollision/CollisionShapes/btCollisionShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btCollisionShape.cpp
-
-btConvexShape.lo: BulletCollision/CollisionShapes/btConvexShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexShape.lo -MD -MP -MF $(DEPDIR)/btConvexShape.Tpo -c -o btConvexShape.lo `test -f 'BulletCollision/CollisionShapes/btConvexShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexShape.Tpo $(DEPDIR)/btConvexShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btConvexShape.cpp' object='btConvexShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexShape.lo `test -f 'BulletCollision/CollisionShapes/btConvexShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexShape.cpp
-
-btConvex2dShape.lo: BulletCollision/CollisionShapes/btConvex2dShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvex2dShape.lo -MD -MP -MF $(DEPDIR)/btConvex2dShape.Tpo -c -o btConvex2dShape.lo `test -f 'BulletCollision/CollisionShapes/btConvex2dShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvex2dShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvex2dShape.Tpo $(DEPDIR)/btConvex2dShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btConvex2dShape.cpp' object='btConvex2dShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvex2dShape.lo `test -f 'BulletCollision/CollisionShapes/btConvex2dShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvex2dShape.cpp
-
-btConvexInternalShape.lo: BulletCollision/CollisionShapes/btConvexInternalShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexInternalShape.lo -MD -MP -MF $(DEPDIR)/btConvexInternalShape.Tpo -c -o btConvexInternalShape.lo `test -f 'BulletCollision/CollisionShapes/btConvexInternalShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexInternalShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexInternalShape.Tpo $(DEPDIR)/btConvexInternalShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btConvexInternalShape.cpp' object='btConvexInternalShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexInternalShape.lo `test -f 'BulletCollision/CollisionShapes/btConvexInternalShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexInternalShape.cpp
-
-btConvexHullShape.lo: BulletCollision/CollisionShapes/btConvexHullShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexHullShape.lo -MD -MP -MF $(DEPDIR)/btConvexHullShape.Tpo -c -o btConvexHullShape.lo `test -f 'BulletCollision/CollisionShapes/btConvexHullShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexHullShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexHullShape.Tpo $(DEPDIR)/btConvexHullShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btConvexHullShape.cpp' object='btConvexHullShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexHullShape.lo `test -f 'BulletCollision/CollisionShapes/btConvexHullShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexHullShape.cpp
-
-btConvexPolyhedron.lo: BulletCollision/CollisionShapes/btConvexPolyhedron.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexPolyhedron.lo -MD -MP -MF $(DEPDIR)/btConvexPolyhedron.Tpo -c -o btConvexPolyhedron.lo `test -f 'BulletCollision/CollisionShapes/btConvexPolyhedron.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexPolyhedron.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexPolyhedron.Tpo $(DEPDIR)/btConvexPolyhedron.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btConvexPolyhedron.cpp' object='btConvexPolyhedron.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexPolyhedron.lo `test -f 'BulletCollision/CollisionShapes/btConvexPolyhedron.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexPolyhedron.cpp
-
-btTriangleCallback.lo: BulletCollision/CollisionShapes/btTriangleCallback.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btTriangleCallback.lo -MD -MP -MF $(DEPDIR)/btTriangleCallback.Tpo -c -o btTriangleCallback.lo `test -f 'BulletCollision/CollisionShapes/btTriangleCallback.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleCallback.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btTriangleCallback.Tpo $(DEPDIR)/btTriangleCallback.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btTriangleCallback.cpp' object='btTriangleCallback.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btTriangleCallback.lo `test -f 'BulletCollision/CollisionShapes/btTriangleCallback.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleCallback.cpp
-
-btCapsuleShape.lo: BulletCollision/CollisionShapes/btCapsuleShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btCapsuleShape.lo -MD -MP -MF $(DEPDIR)/btCapsuleShape.Tpo -c -o btCapsuleShape.lo `test -f 'BulletCollision/CollisionShapes/btCapsuleShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btCapsuleShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btCapsuleShape.Tpo $(DEPDIR)/btCapsuleShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btCapsuleShape.cpp' object='btCapsuleShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btCapsuleShape.lo `test -f 'BulletCollision/CollisionShapes/btCapsuleShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btCapsuleShape.cpp
-
-btConvexTriangleMeshShape.lo: BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexTriangleMeshShape.lo -MD -MP -MF $(DEPDIR)/btConvexTriangleMeshShape.Tpo -c -o btConvexTriangleMeshShape.lo `test -f 'BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexTriangleMeshShape.Tpo $(DEPDIR)/btConvexTriangleMeshShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp' object='btConvexTriangleMeshShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexTriangleMeshShape.lo `test -f 'BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp
-
-btConcaveShape.lo: BulletCollision/CollisionShapes/btConcaveShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConcaveShape.lo -MD -MP -MF $(DEPDIR)/btConcaveShape.Tpo -c -o btConcaveShape.lo `test -f 'BulletCollision/CollisionShapes/btConcaveShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConcaveShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConcaveShape.Tpo $(DEPDIR)/btConcaveShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btConcaveShape.cpp' object='btConcaveShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConcaveShape.lo `test -f 'BulletCollision/CollisionShapes/btConcaveShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConcaveShape.cpp
-
-btConvexPointCloudShape.lo: BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexPointCloudShape.lo -MD -MP -MF $(DEPDIR)/btConvexPointCloudShape.Tpo -c -o btConvexPointCloudShape.lo `test -f 'BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexPointCloudShape.Tpo $(DEPDIR)/btConvexPointCloudShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp' object='btConvexPointCloudShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexPointCloudShape.lo `test -f 'BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp
-
-btBoxShape.lo: BulletCollision/CollisionShapes/btBoxShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btBoxShape.lo -MD -MP -MF $(DEPDIR)/btBoxShape.Tpo -c -o btBoxShape.lo `test -f 'BulletCollision/CollisionShapes/btBoxShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btBoxShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btBoxShape.Tpo $(DEPDIR)/btBoxShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btBoxShape.cpp' object='btBoxShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btBoxShape.lo `test -f 'BulletCollision/CollisionShapes/btBoxShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btBoxShape.cpp
-
-btBox2dShape.lo: BulletCollision/CollisionShapes/btBox2dShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btBox2dShape.lo -MD -MP -MF $(DEPDIR)/btBox2dShape.Tpo -c -o btBox2dShape.lo `test -f 'BulletCollision/CollisionShapes/btBox2dShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btBox2dShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btBox2dShape.Tpo $(DEPDIR)/btBox2dShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btBox2dShape.cpp' object='btBox2dShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btBox2dShape.lo `test -f 'BulletCollision/CollisionShapes/btBox2dShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btBox2dShape.cpp
-
-btOptimizedBvh.lo: BulletCollision/CollisionShapes/btOptimizedBvh.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btOptimizedBvh.lo -MD -MP -MF $(DEPDIR)/btOptimizedBvh.Tpo -c -o btOptimizedBvh.lo `test -f 'BulletCollision/CollisionShapes/btOptimizedBvh.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btOptimizedBvh.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btOptimizedBvh.Tpo $(DEPDIR)/btOptimizedBvh.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btOptimizedBvh.cpp' object='btOptimizedBvh.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btOptimizedBvh.lo `test -f 'BulletCollision/CollisionShapes/btOptimizedBvh.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btOptimizedBvh.cpp
-
-btHeightfieldTerrainShape.lo: BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btHeightfieldTerrainShape.lo -MD -MP -MF $(DEPDIR)/btHeightfieldTerrainShape.Tpo -c -o btHeightfieldTerrainShape.lo `test -f 'BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btHeightfieldTerrainShape.Tpo $(DEPDIR)/btHeightfieldTerrainShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp' object='btHeightfieldTerrainShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btHeightfieldTerrainShape.lo `test -f 'BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp
-
-btMultimaterialTriangleMeshShape.lo: BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btMultimaterialTriangleMeshShape.lo -MD -MP -MF $(DEPDIR)/btMultimaterialTriangleMeshShape.Tpo -c -o btMultimaterialTriangleMeshShape.lo `test -f 'BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/bt [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btMultimaterialTriangleMeshShape.Tpo $(DEPDIR)/btMultimaterialTriangleMeshShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp' object='btMultimaterialTriangleMeshShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btMultimaterialTriangleMeshShape.lo `test -f 'BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp
-
-btCylinderShape.lo: BulletCollision/CollisionShapes/btCylinderShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btCylinderShape.lo -MD -MP -MF $(DEPDIR)/btCylinderShape.Tpo -c -o btCylinderShape.lo `test -f 'BulletCollision/CollisionShapes/btCylinderShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btCylinderShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btCylinderShape.Tpo $(DEPDIR)/btCylinderShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btCylinderShape.cpp' object='btCylinderShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btCylinderShape.lo `test -f 'BulletCollision/CollisionShapes/btCylinderShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btCylinderShape.cpp
-
-btScaledBvhTriangleMeshShape.lo: BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btScaledBvhTriangleMeshShape.lo -MD -MP -MF $(DEPDIR)/btScaledBvhTriangleMeshShape.Tpo -c -o btScaledBvhTriangleMeshShape.lo `test -f 'BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btScaledBvhTriangl [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btScaledBvhTriangleMeshShape.Tpo $(DEPDIR)/btScaledBvhTriangleMeshShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp' object='btScaledBvhTriangleMeshShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btScaledBvhTriangleMeshShape.lo `test -f 'BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp
-
-btStridingMeshInterface.lo: BulletCollision/CollisionShapes/btStridingMeshInterface.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btStridingMeshInterface.lo -MD -MP -MF $(DEPDIR)/btStridingMeshInterface.Tpo -c -o btStridingMeshInterface.lo `test -f 'BulletCollision/CollisionShapes/btStridingMeshInterface.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btStridingMeshInterface.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btStridingMeshInterface.Tpo $(DEPDIR)/btStridingMeshInterface.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btStridingMeshInterface.cpp' object='btStridingMeshInterface.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btStridingMeshInterface.lo `test -f 'BulletCollision/CollisionShapes/btStridingMeshInterface.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btStridingMeshInterface.cpp
-
-btTriangleIndexVertexMaterialArray.lo: BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btTriangleIndexVertexMaterialArray.lo -MD -MP -MF $(DEPDIR)/btTriangleIndexVertexMaterialArray.Tpo -c -o btTriangleIndexVertexMaterialArray.lo `test -f 'BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionS [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btTriangleIndexVertexMaterialArray.Tpo $(DEPDIR)/btTriangleIndexVertexMaterialArray.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp' object='btTriangleIndexVertexMaterialArray.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btTriangleIndexVertexMaterialArray.lo `test -f 'BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp
-
-btTriangleMesh.lo: BulletCollision/CollisionShapes/btTriangleMesh.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btTriangleMesh.lo -MD -MP -MF $(DEPDIR)/btTriangleMesh.Tpo -c -o btTriangleMesh.lo `test -f 'BulletCollision/CollisionShapes/btTriangleMesh.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleMesh.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btTriangleMesh.Tpo $(DEPDIR)/btTriangleMesh.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btTriangleMesh.cpp' object='btTriangleMesh.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btTriangleMesh.lo `test -f 'BulletCollision/CollisionShapes/btTriangleMesh.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleMesh.cpp
-
-btAxisSweep3.lo: BulletCollision/BroadphaseCollision/btAxisSweep3.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btAxisSweep3.lo -MD -MP -MF $(DEPDIR)/btAxisSweep3.Tpo -c -o btAxisSweep3.lo `test -f 'BulletCollision/BroadphaseCollision/btAxisSweep3.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btAxisSweep3.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btAxisSweep3.Tpo $(DEPDIR)/btAxisSweep3.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/BroadphaseCollision/btAxisSweep3.cpp' object='btAxisSweep3.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btAxisSweep3.lo `test -f 'BulletCollision/BroadphaseCollision/btAxisSweep3.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btAxisSweep3.cpp
-
-btOverlappingPairCache.lo: BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btOverlappingPairCache.lo -MD -MP -MF $(DEPDIR)/btOverlappingPairCache.Tpo -c -o btOverlappingPairCache.lo `test -f 'BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btOverlappingPairCache.Tpo $(DEPDIR)/btOverlappingPairCache.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp' object='btOverlappingPairCache.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btOverlappingPairCache.lo `test -f 'BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp
-
-btDbvtBroadphase.lo: BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btDbvtBroadphase.lo -MD -MP -MF $(DEPDIR)/btDbvtBroadphase.Tpo -c -o btDbvtBroadphase.lo `test -f 'BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btDbvtBroadphase.Tpo $(DEPDIR)/btDbvtBroadphase.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp' object='btDbvtBroadphase.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btDbvtBroadphase.lo `test -f 'BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp
-
-btMultiSapBroadphase.lo: BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btMultiSapBroadphase.lo -MD -MP -MF $(DEPDIR)/btMultiSapBroadphase.Tpo -c -o btMultiSapBroadphase.lo `test -f 'BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btMultiSapBroadphase.Tpo $(DEPDIR)/btMultiSapBroadphase.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp' object='btMultiSapBroadphase.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btMultiSapBroadphase.lo `test -f 'BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp
-
-btDispatcher.lo: BulletCollision/BroadphaseCollision/btDispatcher.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btDispatcher.lo -MD -MP -MF $(DEPDIR)/btDispatcher.Tpo -c -o btDispatcher.lo `test -f 'BulletCollision/BroadphaseCollision/btDispatcher.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btDispatcher.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btDispatcher.Tpo $(DEPDIR)/btDispatcher.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/BroadphaseCollision/btDispatcher.cpp' object='btDispatcher.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btDispatcher.lo `test -f 'BulletCollision/BroadphaseCollision/btDispatcher.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btDispatcher.cpp
-
-btBroadphaseProxy.lo: BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btBroadphaseProxy.lo -MD -MP -MF $(DEPDIR)/btBroadphaseProxy.Tpo -c -o btBroadphaseProxy.lo `test -f 'BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btBroadphaseProxy.Tpo $(DEPDIR)/btBroadphaseProxy.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp' object='btBroadphaseProxy.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btBroadphaseProxy.lo `test -f 'BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp
-
-btQuantizedBvh.lo: BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btQuantizedBvh.lo -MD -MP -MF $(DEPDIR)/btQuantizedBvh.Tpo -c -o btQuantizedBvh.lo `test -f 'BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btQuantizedBvh.Tpo $(DEPDIR)/btQuantizedBvh.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp' object='btQuantizedBvh.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btQuantizedBvh.lo `test -f 'BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp
-
-btCollisionAlgorithm.lo: BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btCollisionAlgorithm.Tpo -c -o btCollisionAlgorithm.lo `test -f 'BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btCollisionAlgorithm.Tpo $(DEPDIR)/btCollisionAlgorithm.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp' object='btCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btCollisionAlgorithm.lo `test -f 'BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp
-
-btDbvt.lo: BulletCollision/BroadphaseCollision/btDbvt.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btDbvt.lo -MD -MP -MF $(DEPDIR)/btDbvt.Tpo -c -o btDbvt.lo `test -f 'BulletCollision/BroadphaseCollision/btDbvt.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btDbvt.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btDbvt.Tpo $(DEPDIR)/btDbvt.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/BroadphaseCollision/btDbvt.cpp' object='btDbvt.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btDbvt.lo `test -f 'BulletCollision/BroadphaseCollision/btDbvt.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btDbvt.cpp
-
-btSimpleBroadphase.lo: BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSimpleBroadphase.lo -MD -MP -MF $(DEPDIR)/btSimpleBroadphase.Tpo -c -o btSimpleBroadphase.lo `test -f 'BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSimpleBroadphase.Tpo $(DEPDIR)/btSimpleBroadphase.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp' object='btSimpleBroadphase.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSimpleBroadphase.lo `test -f 'BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp
-
-btPolyhedralContactClipping.lo: BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btPolyhedralContactClipping.lo -MD -MP -MF $(DEPDIR)/btPolyhedralContactClipping.Tpo -c -o btPolyhedralContactClipping.lo `test -f 'BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btPolyhedral [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btPolyhedralContactClipping.Tpo $(DEPDIR)/btPolyhedralContactClipping.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp' object='btPolyhedralContactClipping.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btPolyhedralContactClipping.lo `test -f 'BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp
-
-btGImpactBvh.lo: BulletCollision/Gimpact/btGImpactBvh.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGImpactBvh.lo -MD -MP -MF $(DEPDIR)/btGImpactBvh.Tpo -c -o btGImpactBvh.lo `test -f 'BulletCollision/Gimpact/btGImpactBvh.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/btGImpactBvh.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGImpactBvh.Tpo $(DEPDIR)/btGImpactBvh.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/Gimpact/btGImpactBvh.cpp' object='btGImpactBvh.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGImpactBvh.lo `test -f 'BulletCollision/Gimpact/btGImpactBvh.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/btGImpactBvh.cpp
-
-btGImpactQuantizedBvh.lo: BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGImpactQuantizedBvh.lo -MD -MP -MF $(DEPDIR)/btGImpactQuantizedBvh.Tpo -c -o btGImpactQuantizedBvh.lo `test -f 'BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGImpactQuantizedBvh.Tpo $(DEPDIR)/btGImpactQuantizedBvh.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp' object='btGImpactQuantizedBvh.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGImpactQuantizedBvh.lo `test -f 'BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp
-
-btTriangleShapeEx.lo: BulletCollision/Gimpact/btTriangleShapeEx.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btTriangleShapeEx.lo -MD -MP -MF $(DEPDIR)/btTriangleShapeEx.Tpo -c -o btTriangleShapeEx.lo `test -f 'BulletCollision/Gimpact/btTriangleShapeEx.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/btTriangleShapeEx.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btTriangleShapeEx.Tpo $(DEPDIR)/btTriangleShapeEx.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/Gimpact/btTriangleShapeEx.cpp' object='btTriangleShapeEx.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btTriangleShapeEx.lo `test -f 'BulletCollision/Gimpact/btTriangleShapeEx.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/btTriangleShapeEx.cpp
-
-btGImpactCollisionAlgorithm.lo: BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGImpactCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btGImpactCollisionAlgorithm.Tpo -c -o btGImpactCollisionAlgorithm.lo `test -f 'BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGImpactCollisionAlgorithm.Tpo $(DEPDIR)/btGImpactCollisionAlgorithm.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp' object='btGImpactCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGImpactCollisionAlgorithm.lo `test -f 'BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp
-
-btGImpactShape.lo: BulletCollision/Gimpact/btGImpactShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGImpactShape.lo -MD -MP -MF $(DEPDIR)/btGImpactShape.Tpo -c -o btGImpactShape.lo `test -f 'BulletCollision/Gimpact/btGImpactShape.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/btGImpactShape.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGImpactShape.Tpo $(DEPDIR)/btGImpactShape.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/Gimpact/btGImpactShape.cpp' object='btGImpactShape.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGImpactShape.lo `test -f 'BulletCollision/Gimpact/btGImpactShape.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/btGImpactShape.cpp
-
-gim_box_set.lo: BulletCollision/Gimpact/gim_box_set.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gim_box_set.lo -MD -MP -MF $(DEPDIR)/gim_box_set.Tpo -c -o gim_box_set.lo `test -f 'BulletCollision/Gimpact/gim_box_set.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/gim_box_set.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/gim_box_set.Tpo $(DEPDIR)/gim_box_set.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/Gimpact/gim_box_set.cpp' object='gim_box_set.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gim_box_set.lo `test -f 'BulletCollision/Gimpact/gim_box_set.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/gim_box_set.cpp
-
-gim_contact.lo: BulletCollision/Gimpact/gim_contact.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gim_contact.lo -MD -MP -MF $(DEPDIR)/gim_contact.Tpo -c -o gim_contact.lo `test -f 'BulletCollision/Gimpact/gim_contact.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/gim_contact.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/gim_contact.Tpo $(DEPDIR)/gim_contact.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/Gimpact/gim_contact.cpp' object='gim_contact.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gim_contact.lo `test -f 'BulletCollision/Gimpact/gim_contact.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/gim_contact.cpp
-
-gim_memory.lo: BulletCollision/Gimpact/gim_memory.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gim_memory.lo -MD -MP -MF $(DEPDIR)/gim_memory.Tpo -c -o gim_memory.lo `test -f 'BulletCollision/Gimpact/gim_memory.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/gim_memory.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/gim_memory.Tpo $(DEPDIR)/gim_memory.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/Gimpact/gim_memory.cpp' object='gim_memory.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gim_memory.lo `test -f 'BulletCollision/Gimpact/gim_memory.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/gim_memory.cpp
-
-gim_tri_collision.lo: BulletCollision/Gimpact/gim_tri_collision.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gim_tri_collision.lo -MD -MP -MF $(DEPDIR)/gim_tri_collision.Tpo -c -o gim_tri_collision.lo `test -f 'BulletCollision/Gimpact/gim_tri_collision.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/gim_tri_collision.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/gim_tri_collision.Tpo $(DEPDIR)/gim_tri_collision.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/Gimpact/gim_tri_collision.cpp' object='gim_tri_collision.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gim_tri_collision.lo `test -f 'BulletCollision/Gimpact/gim_tri_collision.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/gim_tri_collision.cpp
-
-btContinuousDynamicsWorld.lo: BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btContinuousDynamicsWorld.lo -MD -MP -MF $(DEPDIR)/btContinuousDynamicsWorld.Tpo -c -o btContinuousDynamicsWorld.lo `test -f 'BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp' || echo '$(srcdir)/'`BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btContinuousDynamicsWorld.Tpo $(DEPDIR)/btContinuousDynamicsWorld.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp' object='btContinuousDynamicsWorld.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btContinuousDynamicsWorld.lo `test -f 'BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp' || echo '$(srcdir)/'`BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp
-
-btRigidBody.lo: BulletDynamics/Dynamics/btRigidBody.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btRigidBody.lo -MD -MP -MF $(DEPDIR)/btRigidBody.Tpo -c -o btRigidBody.lo `test -f 'BulletDynamics/Dynamics/btRigidBody.cpp' || echo '$(srcdir)/'`BulletDynamics/Dynamics/btRigidBody.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btRigidBody.Tpo $(DEPDIR)/btRigidBody.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/Dynamics/btRigidBody.cpp' object='btRigidBody.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btRigidBody.lo `test -f 'BulletDynamics/Dynamics/btRigidBody.cpp' || echo '$(srcdir)/'`BulletDynamics/Dynamics/btRigidBody.cpp
-
-btSimpleDynamicsWorld.lo: BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSimpleDynamicsWorld.lo -MD -MP -MF $(DEPDIR)/btSimpleDynamicsWorld.Tpo -c -o btSimpleDynamicsWorld.lo `test -f 'BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp' || echo '$(srcdir)/'`BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSimpleDynamicsWorld.Tpo $(DEPDIR)/btSimpleDynamicsWorld.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp' object='btSimpleDynamicsWorld.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSimpleDynamicsWorld.lo `test -f 'BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp' || echo '$(srcdir)/'`BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp
-
-Bullet-C-API.lo: BulletDynamics/Dynamics/Bullet-C-API.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Bullet-C-API.lo -MD -MP -MF $(DEPDIR)/Bullet-C-API.Tpo -c -o Bullet-C-API.lo `test -f 'BulletDynamics/Dynamics/Bullet-C-API.cpp' || echo '$(srcdir)/'`BulletDynamics/Dynamics/Bullet-C-API.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/Bullet-C-API.Tpo $(DEPDIR)/Bullet-C-API.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/Dynamics/Bullet-C-API.cpp' object='Bullet-C-API.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Bullet-C-API.lo `test -f 'BulletDynamics/Dynamics/Bullet-C-API.cpp' || echo '$(srcdir)/'`BulletDynamics/Dynamics/Bullet-C-API.cpp
-
-btDiscreteDynamicsWorld.lo: BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btDiscreteDynamicsWorld.lo -MD -MP -MF $(DEPDIR)/btDiscreteDynamicsWorld.Tpo -c -o btDiscreteDynamicsWorld.lo `test -f 'BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp' || echo '$(srcdir)/'`BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btDiscreteDynamicsWorld.Tpo $(DEPDIR)/btDiscreteDynamicsWorld.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp' object='btDiscreteDynamicsWorld.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btDiscreteDynamicsWorld.lo `test -f 'BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp' || echo '$(srcdir)/'`BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
-
-btGeneric6DofConstraint.lo: BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGeneric6DofConstraint.lo -MD -MP -MF $(DEPDIR)/btGeneric6DofConstraint.Tpo -c -o btGeneric6DofConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGeneric6DofConstraint.Tpo $(DEPDIR)/btGeneric6DofConstraint.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp' object='btGeneric6DofConstraint.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGeneric6DofConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp
-
-btGeneric6DofSpringConstraint.lo: BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGeneric6DofSpringConstraint.lo -MD -MP -MF $(DEPDIR)/btGeneric6DofSpringConstraint.Tpo -c -o btGeneric6DofSpringConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btGeneric6DofS [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGeneric6DofSpringConstraint.Tpo $(DEPDIR)/btGeneric6DofSpringConstraint.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp' object='btGeneric6DofSpringConstraint.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGeneric6DofSpringConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp
-
-btSolve2LinearConstraint.lo: BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSolve2LinearConstraint.lo -MD -MP -MF $(DEPDIR)/btSolve2LinearConstraint.Tpo -c -o btSolve2LinearConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSolve2LinearConstraint.Tpo $(DEPDIR)/btSolve2LinearConstraint.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp' object='btSolve2LinearConstraint.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSolve2LinearConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp
-
-btPoint2PointConstraint.lo: BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btPoint2PointConstraint.lo -MD -MP -MF $(DEPDIR)/btPoint2PointConstraint.Tpo -c -o btPoint2PointConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btPoint2PointConstraint.Tpo $(DEPDIR)/btPoint2PointConstraint.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp' object='btPoint2PointConstraint.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btPoint2PointConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp
-
-btTypedConstraint.lo: BulletDynamics/ConstraintSolver/btTypedConstraint.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btTypedConstraint.lo -MD -MP -MF $(DEPDIR)/btTypedConstraint.Tpo -c -o btTypedConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btTypedConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btTypedConstraint.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btTypedConstraint.Tpo $(DEPDIR)/btTypedConstraint.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btTypedConstraint.cpp' object='btTypedConstraint.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btTypedConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btTypedConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btTypedConstraint.cpp
-
-btContactConstraint.lo: BulletDynamics/ConstraintSolver/btContactConstraint.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btContactConstraint.lo -MD -MP -MF $(DEPDIR)/btContactConstraint.Tpo -c -o btContactConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btContactConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btContactConstraint.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btContactConstraint.Tpo $(DEPDIR)/btContactConstraint.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btContactConstraint.cpp' object='btContactConstraint.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btContactConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btContactConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btContactConstraint.cpp
-
-btSliderConstraint.lo: BulletDynamics/ConstraintSolver/btSliderConstraint.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSliderConstraint.lo -MD -MP -MF $(DEPDIR)/btSliderConstraint.Tpo -c -o btSliderConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btSliderConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btSliderConstraint.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSliderConstraint.Tpo $(DEPDIR)/btSliderConstraint.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btSliderConstraint.cpp' object='btSliderConstraint.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSliderConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btSliderConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btSliderConstraint.cpp
-
-btConeTwistConstraint.lo: BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConeTwistConstraint.lo -MD -MP -MF $(DEPDIR)/btConeTwistConstraint.Tpo -c -o btConeTwistConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConeTwistConstraint.Tpo $(DEPDIR)/btConeTwistConstraint.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp' object='btConeTwistConstraint.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConeTwistConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp
-
-btHingeConstraint.lo: BulletDynamics/ConstraintSolver/btHingeConstraint.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btHingeConstraint.lo -MD -MP -MF $(DEPDIR)/btHingeConstraint.Tpo -c -o btHingeConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btHingeConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btHingeConstraint.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btHingeConstraint.Tpo $(DEPDIR)/btHingeConstraint.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btHingeConstraint.cpp' object='btHingeConstraint.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btHingeConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btHingeConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btHingeConstraint.cpp
-
-btHinge2Constraint.lo: BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btHinge2Constraint.lo -MD -MP -MF $(DEPDIR)/btHinge2Constraint.Tpo -c -o btHinge2Constraint.lo `test -f 'BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btHinge2Constraint.Tpo $(DEPDIR)/btHinge2Constraint.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp' object='btHinge2Constraint.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btHinge2Constraint.lo `test -f 'BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp
-
-btUniversalConstraint.lo: BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btUniversalConstraint.lo -MD -MP -MF $(DEPDIR)/btUniversalConstraint.Tpo -c -o btUniversalConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btUniversalConstraint.Tpo $(DEPDIR)/btUniversalConstraint.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp' object='btUniversalConstraint.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btUniversalConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp
-
-btSequentialImpulseConstraintSolver.lo: BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSequentialImpulseConstraintSolver.lo -MD -MP -MF $(DEPDIR)/btSequentialImpulseConstraintSolver.Tpo -c -o btSequentialImpulseConstraintSolver.lo `test -f 'BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp' || echo '$(srcdir)/'`BulletDynamics/Constra [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSequentialImpulseConstraintSolver.Tpo $(DEPDIR)/btSequentialImpulseConstraintSolver.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp' object='btSequentialImpulseConstraintSolver.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSequentialImpulseConstraintSolver.lo `test -f 'BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
-
-btWheelInfo.lo: BulletDynamics/Vehicle/btWheelInfo.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btWheelInfo.lo -MD -MP -MF $(DEPDIR)/btWheelInfo.Tpo -c -o btWheelInfo.lo `test -f 'BulletDynamics/Vehicle/btWheelInfo.cpp' || echo '$(srcdir)/'`BulletDynamics/Vehicle/btWheelInfo.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btWheelInfo.Tpo $(DEPDIR)/btWheelInfo.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/Vehicle/btWheelInfo.cpp' object='btWheelInfo.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btWheelInfo.lo `test -f 'BulletDynamics/Vehicle/btWheelInfo.cpp' || echo '$(srcdir)/'`BulletDynamics/Vehicle/btWheelInfo.cpp
-
-btRaycastVehicle.lo: BulletDynamics/Vehicle/btRaycastVehicle.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btRaycastVehicle.lo -MD -MP -MF $(DEPDIR)/btRaycastVehicle.Tpo -c -o btRaycastVehicle.lo `test -f 'BulletDynamics/Vehicle/btRaycastVehicle.cpp' || echo '$(srcdir)/'`BulletDynamics/Vehicle/btRaycastVehicle.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btRaycastVehicle.Tpo $(DEPDIR)/btRaycastVehicle.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/Vehicle/btRaycastVehicle.cpp' object='btRaycastVehicle.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btRaycastVehicle.lo `test -f 'BulletDynamics/Vehicle/btRaycastVehicle.cpp' || echo '$(srcdir)/'`BulletDynamics/Vehicle/btRaycastVehicle.cpp
-
-btKinematicCharacterController.lo: BulletDynamics/Character/btKinematicCharacterController.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btKinematicCharacterController.lo -MD -MP -MF $(DEPDIR)/btKinematicCharacterController.Tpo -c -o btKinematicCharacterController.lo `test -f 'BulletDynamics/Character/btKinematicCharacterController.cpp' || echo '$(srcdir)/'`BulletDynamics/Character/btKinematicCharacterCont [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btKinematicCharacterController.Tpo $(DEPDIR)/btKinematicCharacterController.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/Character/btKinematicCharacterController.cpp' object='btKinematicCharacterController.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btKinematicCharacterController.lo `test -f 'BulletDynamics/Character/btKinematicCharacterController.cpp' || echo '$(srcdir)/'`BulletDynamics/Character/btKinematicCharacterController.cpp
-
-btQuickprof.lo: LinearMath/btQuickprof.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btQuickprof.lo -MD -MP -MF $(DEPDIR)/btQuickprof.Tpo -c -o btQuickprof.lo `test -f 'LinearMath/btQuickprof.cpp' || echo '$(srcdir)/'`LinearMath/btQuickprof.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btQuickprof.Tpo $(DEPDIR)/btQuickprof.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='LinearMath/btQuickprof.cpp' object='btQuickprof.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btQuickprof.lo `test -f 'LinearMath/btQuickprof.cpp' || echo '$(srcdir)/'`LinearMath/btQuickprof.cpp
-
-btGeometryUtil.lo: LinearMath/btGeometryUtil.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGeometryUtil.lo -MD -MP -MF $(DEPDIR)/btGeometryUtil.Tpo -c -o btGeometryUtil.lo `test -f 'LinearMath/btGeometryUtil.cpp' || echo '$(srcdir)/'`LinearMath/btGeometryUtil.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGeometryUtil.Tpo $(DEPDIR)/btGeometryUtil.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='LinearMath/btGeometryUtil.cpp' object='btGeometryUtil.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGeometryUtil.lo `test -f 'LinearMath/btGeometryUtil.cpp' || echo '$(srcdir)/'`LinearMath/btGeometryUtil.cpp
-
-btAlignedAllocator.lo: LinearMath/btAlignedAllocator.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btAlignedAllocator.lo -MD -MP -MF $(DEPDIR)/btAlignedAllocator.Tpo -c -o btAlignedAllocator.lo `test -f 'LinearMath/btAlignedAllocator.cpp' || echo '$(srcdir)/'`LinearMath/btAlignedAllocator.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btAlignedAllocator.Tpo $(DEPDIR)/btAlignedAllocator.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='LinearMath/btAlignedAllocator.cpp' object='btAlignedAllocator.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btAlignedAllocator.lo `test -f 'LinearMath/btAlignedAllocator.cpp' || echo '$(srcdir)/'`LinearMath/btAlignedAllocator.cpp
-
-btSerializer.lo: LinearMath/btSerializer.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSerializer.lo -MD -MP -MF $(DEPDIR)/btSerializer.Tpo -c -o btSerializer.lo `test -f 'LinearMath/btSerializer.cpp' || echo '$(srcdir)/'`LinearMath/btSerializer.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSerializer.Tpo $(DEPDIR)/btSerializer.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='LinearMath/btSerializer.cpp' object='btSerializer.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSerializer.lo `test -f 'LinearMath/btSerializer.cpp' || echo '$(srcdir)/'`LinearMath/btSerializer.cpp
-
-btConvexHull.lo: LinearMath/btConvexHull.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexHull.lo -MD -MP -MF $(DEPDIR)/btConvexHull.Tpo -c -o btConvexHull.lo `test -f 'LinearMath/btConvexHull.cpp' || echo '$(srcdir)/'`LinearMath/btConvexHull.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexHull.Tpo $(DEPDIR)/btConvexHull.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='LinearMath/btConvexHull.cpp' object='btConvexHull.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexHull.lo `test -f 'LinearMath/btConvexHull.cpp' || echo '$(srcdir)/'`LinearMath/btConvexHull.cpp
-
-btConvexHullComputer.lo: LinearMath/btConvexHullComputer.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexHullComputer.lo -MD -MP -MF $(DEPDIR)/btConvexHullComputer.Tpo -c -o btConvexHullComputer.lo `test -f 'LinearMath/btConvexHullComputer.cpp' || echo '$(srcdir)/'`LinearMath/btConvexHullComputer.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexHullComputer.Tpo $(DEPDIR)/btConvexHullComputer.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='LinearMath/btConvexHullComputer.cpp' object='btConvexHullComputer.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexHullComputer.lo `test -f 'LinearMath/btConvexHullComputer.cpp' || echo '$(srcdir)/'`LinearMath/btConvexHullComputer.cpp
-
-libbulletmultithreaded_la-btSoftBodySolver_CPU.lo: BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-btSoftBodySolver_CPU.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-btSoftBodySolver_CPU.Tpo -c -o libbulletmultithreaded_la-btSoftBodySolver_CPU.lo `test -f 'BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_ [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-btSoftBodySolver_CPU.Tpo $(DEPDIR)/libbulletmultithreaded_la-btSoftBodySolver_CPU.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp' object='libbulletmultithreaded_la-btSoftBodySolver_CPU.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-btSoftBodySolver_CPU.lo `test -f 'BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp
-
-libbulletmultithreaded_la-SpuCollisionObjectWrapper.lo: BulletMultiThreaded/SpuCollisionObjectWrapper.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuCollisionObjectWrapper.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuCollisionObjectWrapper.Tpo -c -o libbulletmultithreaded_la-SpuCollisionObjectWrapper.lo `test -f 'BulletMultiThreaded/SpuCollisionObjectWrapper [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuCollisionObjectWrapper.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuCollisionObjectWrapper.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuCollisionObjectWrapper.cpp' object='libbulletmultithreaded_la-SpuCollisionObjectWrapper.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuCollisionObjectWrapper.lo `test -f 'BulletMultiThreaded/SpuCollisionObjectWrapper.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuCollisionObjectWrapper.cpp
-
-libbulletmultithreaded_la-SpuSampleTask.lo: BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuSampleTask.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuSampleTask.Tpo -c -o libbulletmultithreaded_la-SpuSampleTask.lo `test -f 'BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp' || echo '$(srcdir)/'`BulletM [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuSampleTask.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuSampleTask.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp' object='libbulletmultithreaded_la-SpuSampleTask.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuSampleTask.lo `test -f 'BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp
-
-libbulletmultithreaded_la-SpuLibspe2Support.lo: BulletMultiThreaded/SpuLibspe2Support.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuLibspe2Support.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuLibspe2Support.Tpo -c -o libbulletmultithreaded_la-SpuLibspe2Support.lo `test -f 'BulletMultiThreaded/SpuLibspe2Support.cpp' || echo '$(srcdir)/'`Bulle [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuLibspe2Support.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuLibspe2Support.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuLibspe2Support.cpp' object='libbulletmultithreaded_la-SpuLibspe2Support.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuLibspe2Support.lo `test -f 'BulletMultiThreaded/SpuLibspe2Support.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuLibspe2Support.cpp
-
-libbulletmultithreaded_la-SpuContactResult.lo: BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuContactResult.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuContactResult.Tpo -c -o libbulletmultithreaded_la-SpuContactResult.lo `test -f 'BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp' || [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuContactResult.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuContactResult.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp' object='libbulletmultithreaded_la-SpuContactResult.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuContactResult.lo `test -f 'BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp
-
-libbulletmultithreaded_la-SpuGatheringCollisionTask.lo: BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuGatheringCollisionTask.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuGatheringCollisionTask.Tpo -c -o libbulletmultithreaded_la-SpuGatheringCollisionTask.lo `test -f 'BulletMultiThreaded/SpuNarrowPhaseCollisionTa [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuGatheringCollisionTask.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuGatheringCollisionTask.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp' object='libbulletmultithreaded_la-SpuGatheringCollisionTask.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuGatheringCollisionTask.lo `test -f 'BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp
-
-libbulletmultithreaded_la-SpuMinkowskiPenetrationDepthSolver.lo: BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuMinkowskiPenetrationDepthSolver.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuMinkowskiPenetrationDepthSolver.Tpo -c -o libbulletmultithreaded_la-SpuMinkowskiPenetrationDepthSolver.lo `test -f 'BulletMultiThreade [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuMinkowskiPenetrationDepthSolver.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuMinkowskiPenetrationDepthSolver.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.cpp' object='libbulletmultithreaded_la-SpuMinkowskiPenetrationDepthSolver.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuMinkowskiPenetrationDepthSolver.lo `test -f 'BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuM [...]
-
-libbulletmultithreaded_la-SpuCollisionShapes.lo: BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuCollisionShapes.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuCollisionShapes.Tpo -c -o libbulletmultithreaded_la-SpuCollisionShapes.lo `test -f 'BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuCollisionShapes.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuCollisionShapes.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp' object='libbulletmultithreaded_la-SpuCollisionShapes.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuCollisionShapes.lo `test -f 'BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp
-
-libbulletmultithreaded_la-btThreadSupportInterface.lo: BulletMultiThreaded/btThreadSupportInterface.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-btThreadSupportInterface.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-btThreadSupportInterface.Tpo -c -o libbulletmultithreaded_la-btThreadSupportInterface.lo `test -f 'BulletMultiThreaded/btThreadSupportInterface.cpp [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-btThreadSupportInterface.Tpo $(DEPDIR)/libbulletmultithreaded_la-btThreadSupportInterface.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/btThreadSupportInterface.cpp' object='libbulletmultithreaded_la-btThreadSupportInterface.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-btThreadSupportInterface.lo `test -f 'BulletMultiThreaded/btThreadSupportInterface.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/btThreadSupportInterface.cpp
-
-libbulletmultithreaded_la-SequentialThreadSupport.lo: BulletMultiThreaded/SequentialThreadSupport.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SequentialThreadSupport.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SequentialThreadSupport.Tpo -c -o libbulletmultithreaded_la-SequentialThreadSupport.lo `test -f 'BulletMultiThreaded/SequentialThreadSupport.cpp' || [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SequentialThreadSupport.Tpo $(DEPDIR)/libbulletmultithreaded_la-SequentialThreadSupport.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SequentialThreadSupport.cpp' object='libbulletmultithreaded_la-SequentialThreadSupport.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SequentialThreadSupport.lo `test -f 'BulletMultiThreaded/SequentialThreadSupport.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SequentialThreadSupport.cpp
-
-libbulletmultithreaded_la-SpuGatheringCollisionDispatcher.lo: BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuGatheringCollisionDispatcher.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuGatheringCollisionDispatcher.Tpo -c -o libbulletmultithreaded_la-SpuGatheringCollisionDispatcher.lo `test -f 'BulletMultiThreaded/SpuGath [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuGatheringCollisionDispatcher.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuGatheringCollisionDispatcher.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp' object='libbulletmultithreaded_la-SpuGatheringCollisionDispatcher.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuGatheringCollisionDispatcher.lo `test -f 'BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp
-
-libbulletmultithreaded_la-Win32ThreadSupport.lo: BulletMultiThreaded/Win32ThreadSupport.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-Win32ThreadSupport.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-Win32ThreadSupport.Tpo -c -o libbulletmultithreaded_la-Win32ThreadSupport.lo `test -f 'BulletMultiThreaded/Win32ThreadSupport.cpp' || echo '$(srcdir)/'`B [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-Win32ThreadSupport.Tpo $(DEPDIR)/libbulletmultithreaded_la-Win32ThreadSupport.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/Win32ThreadSupport.cpp' object='libbulletmultithreaded_la-Win32ThreadSupport.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-Win32ThreadSupport.lo `test -f 'BulletMultiThreaded/Win32ThreadSupport.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/Win32ThreadSupport.cpp
-
-libbulletmultithreaded_la-SpuFakeDma.lo: BulletMultiThreaded/SpuFakeDma.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuFakeDma.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuFakeDma.Tpo -c -o libbulletmultithreaded_la-SpuFakeDma.lo `test -f 'BulletMultiThreaded/SpuFakeDma.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuFakeDma.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuFakeDma.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuFakeDma.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuFakeDma.cpp' object='libbulletmultithreaded_la-SpuFakeDma.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuFakeDma.lo `test -f 'BulletMultiThreaded/SpuFakeDma.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuFakeDma.cpp
-
-libbulletmultithreaded_la-PosixThreadSupport.lo: BulletMultiThreaded/PosixThreadSupport.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-PosixThreadSupport.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-PosixThreadSupport.Tpo -c -o libbulletmultithreaded_la-PosixThreadSupport.lo `test -f 'BulletMultiThreaded/PosixThreadSupport.cpp' || echo '$(srcdir)/'`B [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-PosixThreadSupport.Tpo $(DEPDIR)/libbulletmultithreaded_la-PosixThreadSupport.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/PosixThreadSupport.cpp' object='libbulletmultithreaded_la-PosixThreadSupport.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-PosixThreadSupport.lo `test -f 'BulletMultiThreaded/PosixThreadSupport.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/PosixThreadSupport.cpp
-
-libbulletmultithreaded_la-SpuCollisionTaskProcess.lo: BulletMultiThreaded/SpuCollisionTaskProcess.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuCollisionTaskProcess.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuCollisionTaskProcess.Tpo -c -o libbulletmultithreaded_la-SpuCollisionTaskProcess.lo `test -f 'BulletMultiThreaded/SpuCollisionTaskProcess.cpp' || [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuCollisionTaskProcess.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuCollisionTaskProcess.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuCollisionTaskProcess.cpp' object='libbulletmultithreaded_la-SpuCollisionTaskProcess.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuCollisionTaskProcess.lo `test -f 'BulletMultiThreaded/SpuCollisionTaskProcess.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuCollisionTaskProcess.cpp
-
-libbulletmultithreaded_la-SpuContactManifoldCollisionAlgorithm.lo: BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuContactManifoldCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuContactManifoldCollisionAlgorithm.Tpo -c -o libbulletmultithreaded_la-SpuContactManifoldCollisionAlgorithm.lo `test -f 'BulletMultiT [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuContactManifoldCollisionAlgorithm.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuContactManifoldCollisionAlgorithm.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp' object='libbulletmultithreaded_la-SpuContactManifoldCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuContactManifoldCollisionAlgorithm.lo `test -f 'BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp
-
-libbulletmultithreaded_la-SpuSampleTaskProcess.lo: BulletMultiThreaded/SpuSampleTaskProcess.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuSampleTaskProcess.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuSampleTaskProcess.Tpo -c -o libbulletmultithreaded_la-SpuSampleTaskProcess.lo `test -f 'BulletMultiThreaded/SpuSampleTaskProcess.cpp' || echo '$(src [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuSampleTaskProcess.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuSampleTaskProcess.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuSampleTaskProcess.cpp' object='libbulletmultithreaded_la-SpuSampleTaskProcess.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuSampleTaskProcess.lo `test -f 'BulletMultiThreaded/SpuSampleTaskProcess.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuSampleTaskProcess.cpp
-
-libbulletmultithreaded_la-boxBoxDistance.lo: BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp
- at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-boxBoxDistance.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-boxBoxDistance.Tpo -c -o libbulletmultithreaded_la-boxBoxDistance.lo `test -f 'BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp' || echo '$ [...]
- at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-boxBoxDistance.Tpo $(DEPDIR)/libbulletmultithreaded_la-boxBoxDistance.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp' object='libbulletmultithreaded_la-boxBoxDistance.lo' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-boxBoxDistance.lo `test -f 'BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(am__tagged_files)
-	$(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	set x; \
-	here=`pwd`; \
-	$(am__define_uniq_tagged_files); \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
-	$(am__define_uniq_tagged_files); \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
-	list='$(am__tagged_files)'; \
-	case "$(srcdir)" in \
-	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
-	  *) sdir=$(subdir)/$(srcdir) ;; \
-	esac; \
-	for i in $$list; do \
-	  if test -f "$$i"; then \
-	    echo "$(subdir)/$$i"; \
-	  else \
-	    echo "$$sdir/$$i"; \
-	  fi; \
-	done >> $(top_builddir)/cscope.files
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
-	ctags-am distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-am uninstall uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/hkl3d/bullet/src/btBulletCollisionCommon.h b/hkl3d/bullet/src/btBulletCollisionCommon.h
deleted file mode 100644
index 472690c..0000000
--- a/hkl3d/bullet/src/btBulletCollisionCommon.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BULLET_COLLISION_COMMON_H
-#define BULLET_COLLISION_COMMON_H
-
-///Common headerfile includes for Bullet Collision Detection
-
-///Bullet's btCollisionWorld and btCollisionObject definitions
-#include "BulletCollision/CollisionDispatch/btCollisionWorld.h"
-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
-
-///Collision Shapes
-#include "BulletCollision/CollisionShapes/btBoxShape.h"
-#include "BulletCollision/CollisionShapes/btSphereShape.h"
-#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
-#include "BulletCollision/CollisionShapes/btCylinderShape.h"
-#include "BulletCollision/CollisionShapes/btConeShape.h"
-#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"
-#include "BulletCollision/CollisionShapes/btConvexHullShape.h"
-#include "BulletCollision/CollisionShapes/btTriangleMesh.h"
-#include "BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h"
-#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h"
-#include "BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h"
-#include "BulletCollision/CollisionShapes/btTriangleMeshShape.h"
-#include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h"
-#include "BulletCollision/CollisionShapes/btCompoundShape.h"
-#include "BulletCollision/CollisionShapes/btTetrahedronShape.h"
-#include "BulletCollision/CollisionShapes/btEmptyShape.h"
-#include "BulletCollision/CollisionShapes/btMultiSphereShape.h"
-#include "BulletCollision/CollisionShapes/btUniformScalingShape.h"
-
-///Narrowphase Collision Detector
-#include "BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h"
-
-//btSphereBoxCollisionAlgorithm is broken, use gjk for now
-//#include "BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h"
-#include "BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h"
-
-///Dispatching and generation of collision pairs (broadphase)
-#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
-#include "BulletCollision/BroadphaseCollision/btSimpleBroadphase.h"
-#include "BulletCollision/BroadphaseCollision/btAxisSweep3.h"
-#include "BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h"
-#include "BulletCollision/BroadphaseCollision/btDbvtBroadphase.h"
-
-///Math library & Utils
-#include "LinearMath/btQuaternion.h"
-#include "LinearMath/btTransform.h"
-#include "LinearMath/btDefaultMotionState.h"
-#include "LinearMath/btQuickprof.h"
-#include "LinearMath/btIDebugDraw.h"
-#include "LinearMath/btSerializer.h"
-
-
-#endif //BULLET_COLLISION_COMMON_H
-
diff --git a/hkl3d/bullet/src/btBulletDynamicsCommon.h b/hkl3d/bullet/src/btBulletDynamicsCommon.h
deleted file mode 100644
index db8b379..0000000
--- a/hkl3d/bullet/src/btBulletDynamicsCommon.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-Bullet Continuous Collision Detection and Physics Library
-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-#ifndef BULLET_DYNAMICS_COMMON_H
-#define BULLET_DYNAMICS_COMMON_H
-
-///Common headerfile includes for Bullet Dynamics, including Collision Detection
-#include "btBulletCollisionCommon.h"
-
-#include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"
-#include "BulletDynamics/Dynamics/btContinuousDynamicsWorld.h"
-
-#include "BulletDynamics/Dynamics/btSimpleDynamicsWorld.h"
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-
-#include "BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h"
-#include "BulletDynamics/ConstraintSolver/btHingeConstraint.h"
-#include "BulletDynamics/ConstraintSolver/btConeTwistConstraint.h"
-#include "BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h"
-#include "BulletDynamics/ConstraintSolver/btSliderConstraint.h"
-#include "BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h"
-#include "BulletDynamics/ConstraintSolver/btUniversalConstraint.h"
-#include "BulletDynamics/ConstraintSolver/btHinge2Constraint.h"
-
-#include "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h"
-
-
-///Vehicle simulation, with wheel contact simulated by raycasts
-#include "BulletDynamics/Vehicle/btRaycastVehicle.h"
-
-
-
-
-
-
-#endif //BULLET_DYNAMICS_COMMON_H
-
diff --git a/hkl3d/hkl3d.cpp b/hkl3d/hkl3d.cpp
index 0db3168..691800b 100644
--- a/hkl3d/hkl3d.cpp
+++ b/hkl3d/hkl3d.cpp
@@ -31,9 +31,7 @@
 #include <g3d/quat.h>
 #include <g3d/matrix.h>
 
-#include "hkl/ccan/container_of/container_of.h"
 #include "hkl3d.h"
-#include "hkl-axis-private.h"
 #include "hkl-geometry-private.h"
 
 #include "btBulletCollisionCommon.h"
@@ -254,6 +252,33 @@ static void hkl3d_object_set_axis_name(Hkl3DObject *self, const char *name)
 	self->axis_name = strdup(name);
 }
 
+static void matrix_fprintf(FILE *f, const float matrix[])
+{
+	fprintf(f, "transformation : ");
+	for(uint i=0; i<4; ++i){
+		if(i)
+			fprintf(f, "                 ");
+		for(uint j=0; j<4; ++j){
+			fprintf(f, " %6.3f", matrix[4 * i + j]);
+		}
+		fprintf(f, "\n");
+	}
+}
+
+void hkl3d_object_aabb_get(const Hkl3DObject *self, float from[3], float to[3])
+{
+	btVector3 min, max;
+
+	self->btShape->getAabb(self->btObject->getWorldTransform(), min, max);
+
+	from[0] = min.getX();
+	from[1] = min.getY();
+	from[2] = min.getZ();
+	to[0] = max.getX();
+	to[1] = max.getY();
+	to[2] = max.getZ();
+}
+
 void hkl3d_object_fprintf(FILE *f, const Hkl3DObject *self)
 {
 	GSList *faces;
@@ -264,8 +289,10 @@ void hkl3d_object_fprintf(FILE *f, const Hkl3DObject *self)
 	fprintf(f, "id : %d\n", self->id);
 	fprintf(f, "name : %s (%p)\n", self->axis_name, self->axis_name);
 	fprintf(f, "axis : %p\n", self->axis);
+	matrix_fprintf(f, self->transformation);
 	fprintf(f, "btObject : %p\n", self->btObject);
 	fprintf(f, "g3d : %p\n", self->g3d);
+	matrix_fprintf(f, self->g3d->transformation->matrix);
 	fprintf(f, "btShape : %p\n", self->btShape);
 	fprintf(f, "meshes : %p\n", self->meshes);
 	fprintf(f, "color : %f, %f, %f\n", material->r, material->g, material->b);
@@ -564,15 +591,14 @@ static void hkl3d_geometry_apply_transformations(Hkl3DGeometry *self)
 		for(j=0; j<len; j++){
 			size_t k;
 			size_t idx = (*holder)->config->idx[j];
-			HklAxis *axis = container_of(darray_item(self->geometry->axes, idx),
-						     HklAxis, parameter);
+			const HklQuaternion *q = hkl_parameter_quaternion_get(darray_item(self->geometry->axes, idx));
 			G3DMatrix G3DM[16];
 
 			/* conversion beetween hkl -> bullet coordinates */
-			btQ *= btQuaternion(-axis->q.data[1],
-					    axis->q.data[3],
-					    axis->q.data[2],
-					    axis->q.data[0]);
+			btQ *= btQuaternion(-q->data[1],
+					    q->data[3],
+					    q->data[2],
+					    q->data[0]);
 
 			/* move each object connected to that hkl Axis. */
 			/* apply the quaternion transformation to the bullet object */
@@ -1123,11 +1149,11 @@ struct ContactSensorCallback : public btCollisionWorld::ContactResultCallback
 	Hkl3DObject *object;
 
 	virtual btScalar addSingleResult(btManifoldPoint & cp,
-					 const btCollisionObject *colObj0, int partId0, int index0,
-					 const btCollisionObject *colObj1, int partId1, int index1)
+					 const btCollisionObjectWrapper *colObj0, int partId0, int index0,
+					 const btCollisionObjectWrapper *colObj1, int partId1, int index1)
 		{
-			if(colObj0 == collisionObject
-			   || colObj1 == collisionObject)
+			if(colObj0->m_collisionObject == collisionObject
+			   || colObj1->m_collisionObject == collisionObject)
 				object->is_colliding = TRUE;
 			return 0;
 		}
diff --git a/hkl3d/hkl3d.h b/hkl3d/hkl3d.h
index 1bd3672..54f6f5b 100644
--- a/hkl3d/hkl3d.h
+++ b/hkl3d/hkl3d.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2010-2013 Synchrotron SOLEIL
+ * Copyright (C) 2010-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -85,6 +85,7 @@ extern "C" {
 		float transformation[16];
 	};
 
+	extern void hkl3d_object_aabb_get(const Hkl3DObject *self, float from[3], float to[3]);
 	extern void hkl3d_object_fprintf(FILE *f, const Hkl3DObject *self);
 
 	/**************/
diff --git a/m4/gtk-doc.m4 b/m4/gtk-doc.m4
index 0ada151..3675543 100644
--- a/m4/gtk-doc.m4
+++ b/m4/gtk-doc.m4
@@ -1,6 +1,6 @@
 dnl -*- mode: autoconf -*-
 
-# serial 1
+# serial 2
 
 dnl Usage:
 dnl   GTK_DOC_CHECK([minimum-gtk-doc-version])
@@ -10,8 +10,24 @@ AC_DEFUN([GTK_DOC_CHECK],
   AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
   AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
 
+  ifelse([$1],[],[gtk_doc_requires="gtk-doc"],[gtk_doc_requires="gtk-doc >= $1"])
+  AC_MSG_CHECKING([for gtk-doc])
+  PKG_CHECK_EXISTS([$gtk_doc_requires],[have_gtk_doc=yes],[have_gtk_doc=no])
+  AC_MSG_RESULT($have_gtk_doc)
+
+  if test "$have_gtk_doc" = "no"; then
+      AC_MSG_WARN([
+  You will not be able to create source packages with 'make dist'
+  because $gtk_doc_requires is not found.])
+  fi
+
   dnl check for tools we added during development
-  AC_PATH_PROG([GTKDOC_CHECK],[gtkdoc-check])
+  dnl Use AC_CHECK_PROG to avoid the check target using an absolute path that
+  dnl may not be writable by the user. Currently, automake requires that the
+  dnl test name must end in '.test'.
+  dnl https://bugzilla.gnome.org/show_bug.cgi?id=701638
+  AC_CHECK_PROG([GTKDOC_CHECK],[gtkdoc-check],[gtkdoc-check.test])
+  AC_PATH_PROG([GTKDOC_CHECK_PATH],[gtkdoc-check])
   AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true])
   AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf])
 
@@ -28,22 +44,22 @@ AC_DEFUN([GTK_DOC_CHECK],
                    [use gtk-doc to build documentation [[default=no]]]),,
     [enable_gtk_doc=no])
 
-  if test x$enable_gtk_doc = xyes; then
-    ifelse([$1],[],
-      [PKG_CHECK_EXISTS([gtk-doc],,
-                        AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))],
-      [PKG_CHECK_EXISTS([gtk-doc >= $1],,
-                        AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))])
-    dnl don't check for glib if we build glib
-    if test "x$PACKAGE_NAME" != "xglib"; then
-      dnl don't fail if someone does not have glib
-      PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0,,)
-    fi
-  fi
-
   AC_MSG_CHECKING([whether to build gtk-doc documentation])
   AC_MSG_RESULT($enable_gtk_doc)
 
+  if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then
+    AC_MSG_ERROR([
+  You must have $gtk_doc_requires installed to build documentation for
+  $PACKAGE_NAME. Please install gtk-doc or disable building the
+  documentation by adding '--disable-gtk-doc' to '[$]0'.])
+  fi
+
+  dnl don't check for glib if we build glib
+  if test "x$PACKAGE_NAME" != "xglib"; then
+    dnl don't fail if someone does not have glib
+    PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0,,[:])
+  fi
+
   dnl enable/disable output formats
   AC_ARG_ENABLE([gtk-doc-html],
     AS_HELP_STRING([--enable-gtk-doc-html],
@@ -58,7 +74,12 @@ AC_DEFUN([GTK_DOC_CHECK],
     enable_gtk_doc_pdf=no
   fi
 
+  if test -z "$AM_DEFAULT_VERBOSITY"; then
+    AM_DEFAULT_VERBOSITY=1
+  fi
+  AC_SUBST([AM_DEFAULT_VERBOSITY])
 
+  AM_CONDITIONAL([HAVE_GTK_DOC], [test x$have_gtk_doc = xyes])
   AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes])
   AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes])
   AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes])
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 02b4bbe..d7c043f 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1312,7 +1312,7 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
@@ -1333,7 +1333,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 		;;
 	    esac
 	    ;;
-	  ppc64-*linux*|powerpc64-*linux*)
+	  powerpc64le-*)
+	    LD="${LD-ld} -m elf32lppclinux"
+	    ;;
+	  powerpc64-*)
 	    LD="${LD-ld} -m elf32ppclinux"
 	    ;;
 	  s390x-*linux*)
@@ -1352,7 +1355,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 	  x86_64-*linux*)
 	    LD="${LD-ld} -m elf_x86_64"
 	    ;;
-	  ppc*-*linux*|powerpc*-*linux*)
+	  powerpcle-*)
+	    LD="${LD-ld} -m elf64lppc"
+	    ;;
+	  powerpc-*)
 	    LD="${LD-ld} -m elf64ppc"
 	    ;;
 	  s390*-*linux*|s390*-*tpf*)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f13138c..74703fe 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -7,7 +7,6 @@ all_tests = \
 	hkl-unit-t \
 	hkl-bench-t \
 	hkl-axis-t \
-	hkl-error-t \
 	hkl-pseudoaxis-t \
 	hkl-quaternion-t \
 	hkl-interval-t \
@@ -27,25 +26,28 @@ all_tests = \
 	hkl-pseudoaxis-zaxis-t \
 	hkl-pseudoaxis-soleil-sixs-med-t
 
-AM_CPPFLAGS = -Wextra -pedantic -D_BSD_SOURCE \
+AM_CPPFLAGS = -Wextra -D_BSD_SOURCE \
 	-I$(top_srcdir) \
 	-I$(top_srcdir)/hkl \
-	-I$(top_srcdir)/tests
+	-I$(top_srcdir)/tests \
+	$(GLIB_CFLAGS) \
+	$(GSL_CFLAGS)
 
 LDADD = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a \
+	$(GLIB_LIBS) \
 	$(GSL_LIBS)
 
-AM_LDFLAGS=-static
-
 if HKL3D
 
 all_tests += hkl3d-test-t
 
 AM_CPPFLAGS += -I$(top_srcdir)/hkl3d \
-	$(G3D_CFLAGS)
+	$(G3D_CFLAGS) \
+	$(BULLET_CFLAGS)
 
-LDADD += $(top_builddir)/hkl3d/libhkl3d.la
+LDADD += $(top_builddir)/hkl3d/libhkl3d.la \
+	$(BULLET_LIBS)
 
 endif
 
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 05f40d9..ddd6b82 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
@@ -80,9 +80,12 @@ host_triplet = @host@
 @HAVE_INTROSPECTION_TRUE at am__append_1 = bindings
 @HKL3D_TRUE at am__append_2 = hkl3d-test-t
 @HKL3D_TRUE at am__append_3 = -I$(top_srcdir)/hkl3d \
- at HKL3D_TRUE@	$(G3D_CFLAGS)
+ at HKL3D_TRUE@	$(G3D_CFLAGS) \
+ at HKL3D_TRUE@	$(BULLET_CFLAGS)
+
+ at HKL3D_TRUE@am__append_4 = $(top_builddir)/hkl3d/libhkl3d.la \
+ at HKL3D_TRUE@	$(BULLET_LIBS)
 
- at HKL3D_TRUE@am__append_4 = $(top_builddir)/hkl3d/libhkl3d.la
 check_PROGRAMS = runtests$(EXEEXT) $(am__EXEEXT_2)
 subdir = tests
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
@@ -100,24 +103,25 @@ CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 @HKL3D_TRUE at am__EXEEXT_1 = hkl3d-test-t$(EXEEXT)
 am__EXEEXT_2 = hkl-unit-t$(EXEEXT) hkl-bench-t$(EXEEXT) \
-	hkl-axis-t$(EXEEXT) hkl-error-t$(EXEEXT) \
-	hkl-pseudoaxis-t$(EXEEXT) hkl-quaternion-t$(EXEEXT) \
-	hkl-interval-t$(EXEEXT) hkl-pseudoaxis-e4cv-t$(EXEEXT) \
-	hkl-pseudoaxis-e4ch-t$(EXEEXT) hkl-sample-t$(EXEEXT) \
-	hkl-lattice-t$(EXEEXT) hkl-pseudoaxis-e6c-t$(EXEEXT) \
-	hkl-source-t$(EXEEXT) hkl-detector-t$(EXEEXT) \
-	hkl-matrix-t$(EXEEXT) hkl-pseudoaxis-k4cv-t$(EXEEXT) \
-	hkl-vector-t$(EXEEXT) hkl-geometry-t$(EXEEXT) \
-	hkl-parameter-t$(EXEEXT) hkl-pseudoaxis-k6c-t$(EXEEXT) \
-	hkl-pseudoaxis-zaxis-t$(EXEEXT) \
+	hkl-axis-t$(EXEEXT) hkl-pseudoaxis-t$(EXEEXT) \
+	hkl-quaternion-t$(EXEEXT) hkl-interval-t$(EXEEXT) \
+	hkl-pseudoaxis-e4cv-t$(EXEEXT) hkl-pseudoaxis-e4ch-t$(EXEEXT) \
+	hkl-sample-t$(EXEEXT) hkl-lattice-t$(EXEEXT) \
+	hkl-pseudoaxis-e6c-t$(EXEEXT) hkl-source-t$(EXEEXT) \
+	hkl-detector-t$(EXEEXT) hkl-matrix-t$(EXEEXT) \
+	hkl-pseudoaxis-k4cv-t$(EXEEXT) hkl-vector-t$(EXEEXT) \
+	hkl-geometry-t$(EXEEXT) hkl-parameter-t$(EXEEXT) \
+	hkl-pseudoaxis-k6c-t$(EXEEXT) hkl-pseudoaxis-zaxis-t$(EXEEXT) \
 	hkl-pseudoaxis-soleil-sixs-med-t$(EXEEXT) $(am__EXEEXT_1)
 hkl_axis_t_SOURCES = hkl-axis-t.c
 hkl_axis_t_OBJECTS = hkl-axis-t.$(OBJEXT)
 hkl_axis_t_LDADD = $(LDADD)
 am__DEPENDENCIES_1 =
+ at HKL3D_TRUE@am__DEPENDENCIES_2 = $(top_builddir)/hkl3d/libhkl3d.la \
+ at HKL3D_TRUE@	$(am__DEPENDENCIES_1)
 hkl_axis_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 AM_V_lt = $(am__v_lt_ at AM_V@)
 am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
 am__v_lt_0 = --silent
@@ -127,79 +131,73 @@ hkl_bench_t_OBJECTS = hkl-bench-t.$(OBJEXT)
 hkl_bench_t_LDADD = $(LDADD)
 hkl_bench_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 hkl_detector_t_SOURCES = hkl-detector-t.c
 hkl_detector_t_OBJECTS = hkl-detector-t.$(OBJEXT)
 hkl_detector_t_LDADD = $(LDADD)
 hkl_detector_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
-hkl_error_t_SOURCES = hkl-error-t.c
-hkl_error_t_OBJECTS = hkl-error-t.$(OBJEXT)
-hkl_error_t_LDADD = $(LDADD)
-hkl_error_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
-	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 hkl_geometry_t_SOURCES = hkl-geometry-t.c
 hkl_geometry_t_OBJECTS = hkl-geometry-t.$(OBJEXT)
 hkl_geometry_t_LDADD = $(LDADD)
 hkl_geometry_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 hkl_interval_t_SOURCES = hkl-interval-t.c
 hkl_interval_t_OBJECTS = hkl-interval-t.$(OBJEXT)
 hkl_interval_t_LDADD = $(LDADD)
 hkl_interval_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 hkl_lattice_t_SOURCES = hkl-lattice-t.c
 hkl_lattice_t_OBJECTS = hkl-lattice-t.$(OBJEXT)
 hkl_lattice_t_LDADD = $(LDADD)
 hkl_lattice_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 hkl_matrix_t_SOURCES = hkl-matrix-t.c
 hkl_matrix_t_OBJECTS = hkl-matrix-t.$(OBJEXT)
 hkl_matrix_t_LDADD = $(LDADD)
 hkl_matrix_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 hkl_parameter_t_SOURCES = hkl-parameter-t.c
 hkl_parameter_t_OBJECTS = hkl-parameter-t.$(OBJEXT)
 hkl_parameter_t_LDADD = $(LDADD)
 hkl_parameter_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 hkl_pseudoaxis_e4ch_t_SOURCES = hkl-pseudoaxis-e4ch-t.c
 hkl_pseudoaxis_e4ch_t_OBJECTS = hkl-pseudoaxis-e4ch-t.$(OBJEXT)
 hkl_pseudoaxis_e4ch_t_LDADD = $(LDADD)
 hkl_pseudoaxis_e4ch_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 hkl_pseudoaxis_e4cv_t_SOURCES = hkl-pseudoaxis-e4cv-t.c
 hkl_pseudoaxis_e4cv_t_OBJECTS = hkl-pseudoaxis-e4cv-t.$(OBJEXT)
 hkl_pseudoaxis_e4cv_t_LDADD = $(LDADD)
 hkl_pseudoaxis_e4cv_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 hkl_pseudoaxis_e6c_t_SOURCES = hkl-pseudoaxis-e6c-t.c
 hkl_pseudoaxis_e6c_t_OBJECTS = hkl-pseudoaxis-e6c-t.$(OBJEXT)
 hkl_pseudoaxis_e6c_t_LDADD = $(LDADD)
 hkl_pseudoaxis_e6c_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 hkl_pseudoaxis_k4cv_t_SOURCES = hkl-pseudoaxis-k4cv-t.c
 hkl_pseudoaxis_k4cv_t_OBJECTS = hkl-pseudoaxis-k4cv-t.$(OBJEXT)
 hkl_pseudoaxis_k4cv_t_LDADD = $(LDADD)
 hkl_pseudoaxis_k4cv_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 hkl_pseudoaxis_k6c_t_SOURCES = hkl-pseudoaxis-k6c-t.c
 hkl_pseudoaxis_k6c_t_OBJECTS = hkl-pseudoaxis-k6c-t.$(OBJEXT)
 hkl_pseudoaxis_k6c_t_LDADD = $(LDADD)
 hkl_pseudoaxis_k6c_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 hkl_pseudoaxis_soleil_sixs_med_t_SOURCES =  \
 	hkl-pseudoaxis-soleil-sixs-med-t.c
 hkl_pseudoaxis_soleil_sixs_med_t_OBJECTS =  \
@@ -208,61 +206,61 @@ hkl_pseudoaxis_soleil_sixs_med_t_LDADD = $(LDADD)
 hkl_pseudoaxis_soleil_sixs_med_t_DEPENDENCIES =  \
 	$(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 hkl_pseudoaxis_t_SOURCES = hkl-pseudoaxis-t.c
 hkl_pseudoaxis_t_OBJECTS = hkl-pseudoaxis-t.$(OBJEXT)
 hkl_pseudoaxis_t_LDADD = $(LDADD)
 hkl_pseudoaxis_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 hkl_pseudoaxis_zaxis_t_SOURCES = hkl-pseudoaxis-zaxis-t.c
 hkl_pseudoaxis_zaxis_t_OBJECTS = hkl-pseudoaxis-zaxis-t.$(OBJEXT)
 hkl_pseudoaxis_zaxis_t_LDADD = $(LDADD)
 hkl_pseudoaxis_zaxis_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 hkl_quaternion_t_SOURCES = hkl-quaternion-t.c
 hkl_quaternion_t_OBJECTS = hkl-quaternion-t.$(OBJEXT)
 hkl_quaternion_t_LDADD = $(LDADD)
 hkl_quaternion_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 hkl_sample_t_SOURCES = hkl-sample-t.c
 hkl_sample_t_OBJECTS = hkl-sample-t.$(OBJEXT)
 hkl_sample_t_LDADD = $(LDADD)
 hkl_sample_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 hkl_source_t_SOURCES = hkl-source-t.c
 hkl_source_t_OBJECTS = hkl-source-t.$(OBJEXT)
 hkl_source_t_LDADD = $(LDADD)
 hkl_source_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 hkl_unit_t_SOURCES = hkl-unit-t.c
 hkl_unit_t_OBJECTS = hkl-unit-t.$(OBJEXT)
 hkl_unit_t_LDADD = $(LDADD)
 hkl_unit_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 hkl_vector_t_SOURCES = hkl-vector-t.c
 hkl_vector_t_OBJECTS = hkl-vector-t.$(OBJEXT)
 hkl_vector_t_LDADD = $(LDADD)
 hkl_vector_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 hkl3d_test_t_SOURCES = hkl3d-test-t.c
 hkl3d_test_t_OBJECTS = hkl3d-test-t.$(OBJEXT)
 hkl3d_test_t_LDADD = $(LDADD)
 hkl3d_test_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 runtests_SOURCES = runtests.c
 runtests_OBJECTS = runtests.$(OBJEXT)
 runtests_LDADD = $(LDADD)
 runtests_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
 	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
-	$(am__append_4)
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 AM_V_P = $(am__v_P_ at AM_V@)
 am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -297,7 +295,16 @@ AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
 am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
-SOURCES = hkl-axis-t.c hkl-bench-t.c hkl-detector-t.c hkl-error-t.c \
+SOURCES = hkl-axis-t.c hkl-bench-t.c hkl-detector-t.c hkl-geometry-t.c \
+	hkl-interval-t.c hkl-lattice-t.c hkl-matrix-t.c \
+	hkl-parameter-t.c hkl-pseudoaxis-e4ch-t.c \
+	hkl-pseudoaxis-e4cv-t.c hkl-pseudoaxis-e6c-t.c \
+	hkl-pseudoaxis-k4cv-t.c hkl-pseudoaxis-k6c-t.c \
+	hkl-pseudoaxis-soleil-sixs-med-t.c hkl-pseudoaxis-t.c \
+	hkl-pseudoaxis-zaxis-t.c hkl-quaternion-t.c hkl-sample-t.c \
+	hkl-source-t.c hkl-unit-t.c hkl-vector-t.c hkl3d-test-t.c \
+	runtests.c
+DIST_SOURCES = hkl-axis-t.c hkl-bench-t.c hkl-detector-t.c \
 	hkl-geometry-t.c hkl-interval-t.c hkl-lattice-t.c \
 	hkl-matrix-t.c hkl-parameter-t.c hkl-pseudoaxis-e4ch-t.c \
 	hkl-pseudoaxis-e4cv-t.c hkl-pseudoaxis-e6c-t.c \
@@ -306,15 +313,6 @@ SOURCES = hkl-axis-t.c hkl-bench-t.c hkl-detector-t.c hkl-error-t.c \
 	hkl-pseudoaxis-zaxis-t.c hkl-quaternion-t.c hkl-sample-t.c \
 	hkl-source-t.c hkl-unit-t.c hkl-vector-t.c hkl3d-test-t.c \
 	runtests.c
-DIST_SOURCES = hkl-axis-t.c hkl-bench-t.c hkl-detector-t.c \
-	hkl-error-t.c hkl-geometry-t.c hkl-interval-t.c \
-	hkl-lattice-t.c hkl-matrix-t.c hkl-parameter-t.c \
-	hkl-pseudoaxis-e4ch-t.c hkl-pseudoaxis-e4cv-t.c \
-	hkl-pseudoaxis-e6c-t.c hkl-pseudoaxis-k4cv-t.c \
-	hkl-pseudoaxis-k6c-t.c hkl-pseudoaxis-soleil-sixs-med-t.c \
-	hkl-pseudoaxis-t.c hkl-pseudoaxis-zaxis-t.c hkl-quaternion-t.c \
-	hkl-sample-t.c hkl-source-t.c hkl-unit-t.c hkl-vector-t.c \
-	hkl3d-test-t.c runtests.c
 RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
 	ctags-recursive dvi-recursive html-recursive info-recursive \
 	install-data-recursive install-dvi-recursive \
@@ -392,6 +390,8 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BULLET_CFLAGS = @BULLET_CFLAGS@
+BULLET_LIBS = @BULLET_LIBS@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
@@ -411,6 +411,7 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+EMACS = @EMACS@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
 G3D_CFLAGS = @G3D_CFLAGS@
@@ -430,14 +431,15 @@ GSL_CFLAGS = @GSL_CFLAGS@
 GSL_CONFIG = @GSL_CONFIG@
 GSL_LIBS = @GSL_LIBS@
 GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@
 GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
 GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
 GTKDOC_MKPDF = @GTKDOC_MKPDF@
 GTKDOC_REBASE = @GTKDOC_REBASE@
-GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
-GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
-GTKMM_CFLAGS = @GTKMM_CFLAGS@
-GTKMM_LIBS = @GTKMM_LIBS@
+GTKGLEXT_CFLAGS = @GTKGLEXT_CFLAGS@
+GTKGLEXT_LIBS = @GTKGLEXT_LIBS@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
 HTML_DIR = @HTML_DIR@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -533,7 +535,6 @@ localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
-opengl_LIBS = @opengl_LIBS@
 pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
@@ -549,18 +550,19 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 version_info = @version_info@
 SUBDIRS = tap . $(am__append_1)
-all_tests = hkl-unit-t hkl-bench-t hkl-axis-t hkl-error-t \
-	hkl-pseudoaxis-t hkl-quaternion-t hkl-interval-t \
-	hkl-pseudoaxis-e4cv-t hkl-pseudoaxis-e4ch-t hkl-sample-t \
-	hkl-lattice-t hkl-pseudoaxis-e6c-t hkl-source-t hkl-detector-t \
-	hkl-matrix-t hkl-pseudoaxis-k4cv-t hkl-vector-t hkl-geometry-t \
+all_tests = hkl-unit-t hkl-bench-t hkl-axis-t hkl-pseudoaxis-t \
+	hkl-quaternion-t hkl-interval-t hkl-pseudoaxis-e4cv-t \
+	hkl-pseudoaxis-e4ch-t hkl-sample-t hkl-lattice-t \
+	hkl-pseudoaxis-e6c-t hkl-source-t hkl-detector-t hkl-matrix-t \
+	hkl-pseudoaxis-k4cv-t hkl-vector-t hkl-geometry-t \
 	hkl-parameter-t hkl-pseudoaxis-k6c-t hkl-pseudoaxis-zaxis-t \
 	hkl-pseudoaxis-soleil-sixs-med-t $(am__append_2)
-AM_CPPFLAGS = -Wextra -pedantic -D_BSD_SOURCE -I$(top_srcdir) \
-	-I$(top_srcdir)/hkl -I$(top_srcdir)/tests $(am__append_3)
+AM_CPPFLAGS = -Wextra -D_BSD_SOURCE -I$(top_srcdir) \
+	-I$(top_srcdir)/hkl -I$(top_srcdir)/tests $(GLIB_CFLAGS) \
+	$(GSL_CFLAGS) $(am__append_3)
 LDADD = $(top_builddir)/hkl/libhkl.la \
-	$(top_builddir)/tests/tap/libtap.a $(GSL_LIBS) $(am__append_4)
-AM_LDFLAGS = -static
+	$(top_builddir)/tests/tap/libtap.a $(GLIB_LIBS) $(GSL_LIBS) \
+	$(am__append_4)
 all: all-recursive
 
 .SUFFIXES:
@@ -617,10 +619,6 @@ hkl-detector-t$(EXEEXT): $(hkl_detector_t_OBJECTS) $(hkl_detector_t_DEPENDENCIES
 	@rm -f hkl-detector-t$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(hkl_detector_t_OBJECTS) $(hkl_detector_t_LDADD) $(LIBS)
 
-hkl-error-t$(EXEEXT): $(hkl_error_t_OBJECTS) $(hkl_error_t_DEPENDENCIES) $(EXTRA_hkl_error_t_DEPENDENCIES) 
-	@rm -f hkl-error-t$(EXEEXT)
-	$(AM_V_CCLD)$(LINK) $(hkl_error_t_OBJECTS) $(hkl_error_t_LDADD) $(LIBS)
-
 hkl-geometry-t$(EXEEXT): $(hkl_geometry_t_OBJECTS) $(hkl_geometry_t_DEPENDENCIES) $(EXTRA_hkl_geometry_t_DEPENDENCIES) 
 	@rm -f hkl-geometry-t$(EXEEXT)
 	$(AM_V_CCLD)$(LINK) $(hkl_geometry_t_OBJECTS) $(hkl_geometry_t_LDADD) $(LIBS)
@@ -710,7 +708,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-axis-t.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-bench-t.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-detector-t.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-error-t.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-geometry-t.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-interval-t.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-lattice-t.Po at am__quote@
@@ -733,22 +730,25 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/runtests.Po at am__quote@
 
 .c.o:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+ at am__fastdepCC_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c $<
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
 
 .c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+ at am__fastdepCC_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
 .c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at am__fastdepCC_TRUE@	$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+ at am__fastdepCC_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
diff --git a/tests/bindings/Makefile.am b/tests/bindings/Makefile.am
index 92a040c..5793660 100644
--- a/tests/bindings/Makefile.am
+++ b/tests/bindings/Makefile.am
@@ -4,6 +4,9 @@ TESTS = python.py trajectory.py
 EXTRA_DIST = $(TESTS)
 
 ipython:
-	env GI_TYPELIB_PATH=$(top_builddir)/hkl $(LIBTOOL) --mode=execute -dlopen $(top_builddir)/hkl/libhkl.la ipython
+	env GI_TYPELIB_PATH=$(top_builddir)/hkl $(LIBTOOL) --mode=execute -dlopen $(top_builddir)/hkl/libhkl.la ipython -i -c "from gi.repository import Hkl"
 
-CLEANFILES = trajectories.pdf
\ No newline at end of file
+gdb:
+	env GI_TYPELIB_PATH=$(top_builddir)/hkl $(LIBTOOL) --mode=execute -dlopen $(top_builddir)/hkl/libhkl.la gdb python
+
+CLEANFILES = trajectories.pdf
diff --git a/tests/bindings/Makefile.in b/tests/bindings/Makefile.in
index f3145e8..540090e 100644
--- a/tests/bindings/Makefile.in
+++ b/tests/bindings/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
@@ -326,6 +326,8 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BULLET_CFLAGS = @BULLET_CFLAGS@
+BULLET_LIBS = @BULLET_LIBS@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
@@ -345,6 +347,7 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+EMACS = @EMACS@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
 G3D_CFLAGS = @G3D_CFLAGS@
@@ -364,14 +367,15 @@ GSL_CFLAGS = @GSL_CFLAGS@
 GSL_CONFIG = @GSL_CONFIG@
 GSL_LIBS = @GSL_LIBS@
 GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@
 GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
 GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
 GTKDOC_MKPDF = @GTKDOC_MKPDF@
 GTKDOC_REBASE = @GTKDOC_REBASE@
-GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
-GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
-GTKMM_CFLAGS = @GTKMM_CFLAGS@
-GTKMM_LIBS = @GTKMM_LIBS@
+GTKGLEXT_CFLAGS = @GTKGLEXT_CFLAGS@
+GTKGLEXT_LIBS = @GTKGLEXT_LIBS@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
 HTML_DIR = @HTML_DIR@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -467,7 +471,6 @@ localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
-opengl_LIBS = @opengl_LIBS@
 pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
@@ -855,7 +858,10 @@ uninstall-am:
 
 
 ipython:
-	env GI_TYPELIB_PATH=$(top_builddir)/hkl $(LIBTOOL) --mode=execute -dlopen $(top_builddir)/hkl/libhkl.la ipython
+	env GI_TYPELIB_PATH=$(top_builddir)/hkl $(LIBTOOL) --mode=execute -dlopen $(top_builddir)/hkl/libhkl.la ipython -i -c "from gi.repository import Hkl"
+
+gdb:
+	env GI_TYPELIB_PATH=$(top_builddir)/hkl $(LIBTOOL) --mode=execute -dlopen $(top_builddir)/hkl/libhkl.la gdb python
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/tests/bindings/python.py b/tests/bindings/python.py
index 773347a..64f1127 100755
--- a/tests/bindings/python.py
+++ b/tests/bindings/python.py
@@ -22,7 +22,6 @@ Copyright (C) 2012-2013 Synchrotron SOLEIL
 Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
 """
 
-import sys
 import math
 import unittest
 from gi.repository import GLib
@@ -30,21 +29,49 @@ from gi.repository import Hkl
 
 
 class TestAPI(unittest.TestCase):
+    """Test all the Hkl API, if something brakes here it means that API
+    has changed !!!
+    """
+
+    def test_vector_api(self):
+        """
+        enforce the Vector api
+        """
+        v = Hkl.Vector()
+        self.assertTrue(type(v) == Hkl.Vector)
+        self.assertTrue(type(v.data) == list)
+        self.assertTrue(3 == len(v.data))
+
+        del v
+
+    def test_quaternion_api(self):
+        """
+        enforce the Vector api
+        """
+        q = Hkl.Quaternion()
+        self.assertTrue(type(q) == Hkl.Quaternion)
+        self.assertTrue(type(q.data) == list)
+        self.assertTrue(4 == len(q.data))
+
+        del q
 
-    @unittest.skip("factory not yet ready")
     def test_factory_api(self):
         """
         enforce the Factory API
         """
         # factories dict <name, Factory>
         factories = Hkl.factories()
-        for key, value in factories.iteritems():
+        for key, factory in factories.iteritems():
             self.assertTrue(type(key) == str)
-            self.assertTrue(type(value) == Hkl.Factory)
+            self.assertTrue(type(factory) == Hkl.Factory)
+
+            # create all the geometry and engines
+            geometry = factory.create_new_geometry()
+            self.assertTrue(type(geometry) == Hkl.Geometry)
+            engines = factory.create_new_engine_list()
+            self.assertTrue(type(engines) == Hkl.EngineList)
 
-        kappa6C_factory = factories['Kappa6C']
-        geometry = kappa6C_factory.create_new_geometry()
-        engines = kappa6C_factory.create_new_engine_list()
+        del factories
 
     def test_detector_api(self):
         """
@@ -55,9 +82,7 @@ class TestAPI(unittest.TestCase):
         detector = Hkl.Detector.factory_new(Hkl.DetectorType(0))
         self.assertTrue(type(detector) is Hkl.Detector)
 
-        # mount the detector on the 2nd holder of the geometry
-        # yes numbering follow the C convention !
-        detector.idx_set(1)
+        del detector
 
     def test_geometry_api(self):
         """
@@ -69,15 +94,15 @@ class TestAPI(unittest.TestCase):
         factory = Hkl.factories()['K6C']
         geometry = factory.create_new_geometry()
 
-        # axes names are accessible
-        self.assertTrue(
-            isinstance([axis.name_get() for axis in geometry.axes()],
-                       list))
+        # source access
+        wavelength = 1.
+        geometry.wavelength_set(wavelength, Hkl.UnitEnum.USER)
+        self.assertTrue(wavelength == geometry.wavelength_get(Hkl.UnitEnum.USER))  # noqa
 
         # set the geometry axes values
         values_w = [0, 30, 0, 0, 0, 60]
-        geometry.set_axes_values_unit(values_w)
-        values_r = geometry.get_axes_values_unit()
+        geometry.axis_values_set(values_w, Hkl.UnitEnum.USER)
+        values_r = geometry.axis_values_get(Hkl.UnitEnum.USER)
 
         # check that the read and write values of the geometry are
         # almost equals
@@ -85,30 +110,15 @@ class TestAPI(unittest.TestCase):
             self.assertAlmostEqual(r, w)
 
         # check that we can access the axes
-        axes = geometry.axes()
-        self.assertTrue(len([axis.name_get() for axis in axes]) != 0)
-        for axis in axes:
-            self.assertTrue(type(axis.name_get()) is str)
-            axis.min_max_unit_set(0, math.radians(180))
+        axis_names = geometry.axis_names_get()
+        for name in axis_names:
+            axis = geometry.axis_get(name)
+            axis.min_max_set(0, math.radians(180), Hkl.UnitEnum.USER)
+            v = axis.axis_v_get()
+            q = axis.quaternion_get()
+            geometry.axis_set(name, axis)
 
-    def test_mode_api(self):
-        """
-        enforce the HklMode API
-        """
-        factory = Hkl.factories()['K6C']
-        engines = factory.create_new_engine_list()
-        engine = engines.get_by_name("hkl")
-
-        # check for all modes
-        for mode in engine.modes():
-            self.assertTrue(type(mode) is Hkl.Mode)
-            self.assertTrue(type(mode.name()) is str)
-
-            # check the parameters
-            parameters = mode.parameters()
-            self.assertTrue(type(parameters) is Hkl.ParameterList)
-            for parameter in parameters.parameters():
-                self.assertTrue(type(parameter) is Hkl.Parameter)
+        del geometry
 
     def test_engine_api(self):
         """
@@ -116,19 +126,15 @@ class TestAPI(unittest.TestCase):
         """
 
         detector = Hkl.Detector.factory_new(Hkl.DetectorType(0))
-        detector.idx_set(1)
 
         factory = Hkl.factories()['K6C']
         geometry = factory.create_new_geometry()
         values_w = [0., 30., 0., 0., 0., 60.]
-        geometry.set_axes_values_unit(values_w)
+        geometry.axis_values_set(values_w, Hkl.UnitEnum.USER)
 
         sample = Hkl.Sample.new("toto")
         lattice = sample.lattice_get()
-        lattice.set(1.54, 1.54, 1.54,
-                    math.radians(90.0),
-                    math.radians(90.0),
-                    math.radians(90.0))
+        lattice.set(1.54, 1.54, 1.54, 90, 90, 90, Hkl.UnitEnum.USER)
         sample.lattice_set(lattice)
 
         # compute all the pseudo axes managed by all engines
@@ -137,36 +143,79 @@ class TestAPI(unittest.TestCase):
         engines.get()
 
         # get the hkl engine and do a computation
-        hkl = engines.get_by_name("hkl")
-        values = hkl.pseudo_axes().values_unit_get()
+        hkl = engines.engine_get_by_name("hkl")
+        values = hkl.pseudo_axis_values_get(Hkl.UnitEnum.USER)
 
         # check for all modes
-        for mode in hkl.modes():
-            self.assertTrue(type(mode) is Hkl.Mode)
+        for mode in hkl.modes_names_get():
+            self.assertTrue(type(mode) is str)
 
         # set the hkl engine and get the results
         for _ in range(100):
             try:
-                hkl.set_values_unit(values)
+                solutions = hkl.pseudo_axis_values_set(values,
+                                                       Hkl.UnitEnum.USER)
+                self.assertTrue(type(solutions) is Hkl.GeometryList)
+                for item in solutions.items():
+                    self.assertTrue(type(item) is Hkl.GeometryListItem)
+                    self.assertTrue(type(item.geometry_get()) is Hkl.Geometry)
+                values[1] += .01
             except GLib.GError, err:
                 print values, err
-            solutions = engines.geometries()
-            self.assertTrue(type(solutions) is Hkl.GeometryList)
-            for item in solutions.items():
-                self.assertTrue(type(item) is Hkl.GeometryListItem)
-                self.assertTrue(type(item.geometry()) is Hkl.Geometry)
-            values[1] += .01
 
         # check that all the values computed are reachable
-        for engine in engines.engines():
+        for engine in engines.engines_get():
             self.assertTrue(type(engine) is Hkl.Engine)
-            self.assertTrue(type(engine.name()) is str)
-            for parameter in engine.pseudo_axes().parameters():
-                self.assertTrue(type(parameter) is Hkl.Parameter)
-                self.assertTrue(type(parameter.value_get()) is float)
+            self.assertTrue(type(engine.name_get()) is str)
+            self.assertTrue(type(engine.pseudo_axis_names_get()) is list)
+            self.assertTrue(type(engine.modes_names_get()) is list)
+            self.assertTrue(len(engine.modes_names_get()))
+            for mode in engine.modes_names_get():
+                self.assertTrue(type(mode) is str)
+            values = engine.pseudo_axis_values_get(Hkl.UnitEnum.USER)
+            self.assertTrue(type(values) is list)
+            for value in values:
+                self.assertTrue(type(value) is float)
+
+        # check that all engine parameters and axes are reachables
+        for engine in engines.engines_get():
+            for mode in engine.modes_names_get():
+                engine.current_mode_set(mode)
+
+                parameters = engine.parameters_names_get()
+                self.assertTrue(type(parameters) is list)
+                [self.assertTrue(type(_) is str) for _ in parameters]
+                for parameter in parameters:
+                    p = engine.parameter_get(parameter)
+                    self.assertTrue(type(p.description_get()) is str)
+
+                axes_r = engine.axis_names_get(Hkl.EngineAxisNamesGet.READ)
+                self.assertTrue(type(axes_r) is list)
+                [self.assertTrue(type(_) is str) for _ in axes_r]
+                axes_w = engine.axis_names_get(Hkl.EngineAxisNamesGet.WRITE)
+                self.assertTrue(type(axes_w) is list)
+                [self.assertTrue(type(_) is str) for _ in axes_w]
+
+        # check all the capabilities
+        for engine in engines.engines_get():
+            capabilities = engine.capabilities_get()
+            self.assertTrue(capabilities & Hkl.EngineCapabilities.READABLE)
+            self.assertTrue(capabilities & Hkl.EngineCapabilities.WRITABLE)
+            if engine.name_get() == "psi":
+                self.assertTrue(capabilities & Hkl.EngineCapabilities.INITIALIZABLE)
+
+        # check initialized_get/set
+        for engine in engines.engines_get():
+            initialized = engine.initialized_get()
+            capabilities = engine.capabilities_get()
+            if capabilities & Hkl.EngineCapabilities.INITIALIZABLE:
+                engine.initialized_set(False)
+                self.assertTrue(False == engine.initialized_get())
+                engine.initialized_set(True)
+                self.assertTrue(True == engine.initialized_get())
 
     @unittest.skip("for testing figures")
-    def test_doc_exemple(self):
+    def test_doc_example(self):
         # execfile("../../Documentation/sphinx/source/bindings/python.py")
         execfile(
             "../../Documentation/sphinx/source/pyplots/trajectory_simple.py")
@@ -200,19 +249,19 @@ class TestAPI(unittest.TestCase):
 
         # change the lattice parameter by expanding the tuple from
         # the get method. the lattice should not change.
-        lattice.set(*lattice.get())
+        a, b, c, alpha, beta, gamma = lattice.get(Hkl.UnitEnum.DEFAULT)
+        lattice.set(a, b, c, alpha, beta, gamma, Hkl.UnitEnum.DEFAULT)
 
         # this new lattice is identical to the one from the sample
-        self.assertTrue(lattice.get() == sample.lattice_get().get())
+        v = lattice.get(Hkl.UnitEnum.DEFAULT)
+        self.assertTrue(v == sample.lattice_get().get(Hkl.UnitEnum.DEFAULT))
 
         # now change the lattice parameter
-        lattice.set(1, 2, 3,
-                    math.radians(90),
-                    math.radians(90),
-                    math.radians(90))
+        lattice.set(1, 2, 3, 90, 90, 90, Hkl.UnitEnum.USER)
 
         # this new lattice is different from the one in the sample
-        self.assertTrue(lattice.get() != sample.lattice_get().get())
+        v = lattice.get(Hkl.UnitEnum.DEFAULT)
+        self.assertTrue(v != sample.lattice_get().get(Hkl.UnitEnum.DEFAULT))
 
         # gives access to the ux, uy, uz part
         ux = sample.ux_get()
@@ -231,15 +280,17 @@ class TestAPI(unittest.TestCase):
         reciprocal = lattice.copy()
         lattice.reciprocal(reciprocal)
 
+        del sample
+        del lattice
+
     def test_reflection_api(self):
 
         detector = Hkl.Detector.factory_new(Hkl.DetectorType(0))
-        detector.idx_set(1)
 
         factory = Hkl.factories()['K6C']
         geometry = factory.create_new_geometry()
         values_w = [0., 30., 0., 0., 0., 60.]
-        geometry.set_axes_values_unit(values_w)
+        geometry.axis_values_set(values_w, Hkl.UnitEnum.USER)
 
         sample = Hkl.Sample.new("toto")
 
@@ -253,13 +304,16 @@ class TestAPI(unittest.TestCase):
         self.assertTrue(r2.hkl_get() == (1.0, 0.0, 1.0))
 
         # compute the angles
-        print sample.get_reflection_mesured_angle(r1, r2)
-        print sample.get_reflection_theoretical_angle(r1, r2)
+        sample.get_reflection_measured_angle(r1, r2)
+        sample.get_reflection_theoretical_angle(r1, r2)
 
         # remove all the reflections
         reflections = sample.reflections_get()
         for reflection in reflections:
             sample.del_reflection(reflection)
 
+        del reflections
+        del sample
+
 if __name__ == '__main__':
-    unittest.main()
+    unittest.main(verbosity=2)
diff --git a/tests/bindings/trajectory.py b/tests/bindings/trajectory.py
index ed20498..0aa15b3 100755
--- a/tests/bindings/trajectory.py
+++ b/tests/bindings/trajectory.py
@@ -14,7 +14,7 @@ from gi.repository import GLib
 from gi.repository import Hkl
 
 
-def compute_hkl_trajectories(engine, hkl1=None, hkl2=None, n=100):
+def compute_hkl_trajectories(engines, engine, hkl1=None, hkl2=None, n=100):
     """
     compute all the trajectories for a given engine already configured
     """
@@ -31,16 +31,17 @@ def compute_hkl_trajectories(engine, hkl1=None, hkl2=None, n=100):
     trajectories = []
     for hh, kk, ll in zip(h, k, l):
         try:
-            engine.set_values_unit([hh, kk, ll])
-            solutions = engine.engines().geometries()
+            solutions = engine.pseudo_axis_values_set([hh, kk, ll],
+                                                      Hkl.UnitEnum.USER)
+            first_solution = solutions.items()[0]
             for i, item in enumerate(solutions.items()):
                 try:
                     trajectories[i]
                 except IndexError:
                     trajectories.append([])
-                values = item.geometry().get_axes_values_unit()
+                values = item.geometry_get().axis_values_get(Hkl.UnitEnum.USER)
                 trajectories[i].append(values)
-            engine.engines().select_solution(0)
+            engines.select_solution(first_solution)
         except GLib.GError, err:
             pass
 
@@ -62,22 +63,22 @@ def plot_hkl_trajectory(filename, geometry, engines,
     plot the trajectory for a engine. It is possible to limit the
     number of trajectory using the max_traj keyword
     """
-    axes_names = [axis.name_get() for axis in geometry.axes()]
+    axis_names = geometry.axis_names_get()
 
-    hkl = engines.get_by_name("hkl")
+    hkl = engines.engine_get_by_name("hkl")
     page = 1
     plt.clf()
     plt.suptitle("\"" + filename + "\" " + repr(
         hkl1) + " -> " + repr(hkl2) + " page " + str(page))
-    _plot_legend(axes_names)
+    _plot_legend(axis_names)
     idx = 2
-    for mode in hkl.modes():
-        hkl.select_mode(mode)
-        trajectories = compute_hkl_trajectories(hkl, hkl1=hkl1, hkl2=hkl2, n=n)
-        print "\"" + filename + "\"", idx, mode.name(), len(trajectories)
+    for mode in hkl.modes_names_get():
+        hkl.current_mode_set(mode)
+        trajectories = compute_hkl_trajectories(engines, hkl, hkl1=hkl1, hkl2=hkl2, n=n)
+        print "\"" + filename + "\"", idx, mode, len(trajectories)
 
         plt.subplot(3, 4, idx)
-        plt.title("%s" % (mode.name(),))
+        plt.title(mode)
         if not len(trajectories):
             plt.text(0.5, 0.5, "Failed", size=20, rotation=0.,
                      ha="center", va="center",
@@ -99,7 +100,7 @@ def plot_hkl_trajectory(filename, geometry, engines,
             pp.savefig()
             plt.clf()
             page += 1
-            _plot_legend(axes_names)
+            _plot_legend(axis_names)
             plt.suptitle(filename + " " + repr(
                 hkl1) + " -> " + repr(hkl2) + " page " + str(page))
             idx = 2
@@ -112,15 +113,13 @@ rcParams['font.size'] = 6
 
 def main():
     sample = Hkl.Sample.new("toto")
-    lattice = sample.lattice_get()
-    lattice.set(1.54, 1.54, 1.54,
-                math.radians(90.0),
-                math.radians(90.0),
-                math.radians(90.))
+    lattice = Hkl.Lattice.new(1.54, 1.54, 1.54,
+                              math.radians(90.),
+                              math.radians(90.),
+                              math.radians(90.))
     sample.lattice_set(lattice)
 
     detector = Hkl.Detector.factory_new(Hkl.DetectorType(0))
-    detector.idx_set(1)
 
     for key, factory in Hkl.factories().iteritems():
         geometry = factory.create_new_geometry()
@@ -128,13 +127,15 @@ def main():
 
         # here we set the detector arm with only positiv values for
         # now tth or delta arm
-        for axis in geometry.axes():
-            if axis.name_get() in ["tth", "delta"]:
-                axis.min_max_unit_set(0, 180.)
+        for axis in geometry.axis_names_get():
+            if axis in ["tth", "delta"]:
+                tmp = geometry.axis_get(axis)
+                tmp.min_max_set(0, 180., Hkl.UnitEnum.USER)
+                geometry.axis_set(axis, tmp)
 
         engines.init(geometry, detector, sample)
 
-        engines_names = [engine.name() for engine in engines.engines()]
+        engines_names = [engine.name_get() for engine in engines.engines_get()]
         if 'hkl' in engines_names:
             plot_hkl_trajectory(key, geometry, engines,
                                 hkl1=[0, 0, 1], hkl2=[0, 1, 1], n=100)
diff --git a/tests/hkl-axis-t.c b/tests/hkl-axis-t.c
index 3869591..23f5884 100644
--- a/tests/hkl-axis-t.c
+++ b/tests/hkl-axis-t.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,183 +22,179 @@
 #include "hkl.h"
 #include <tap/basic.h>
 #include <tap/float.h>
+#include <tap/hkl-tap.h>
 
-#include "hkl/ccan/container_of/container_of.h"
-#include "hkl-axis-private.h"
+/* use these private methods */
+HklParameter *hkl_parameter_new_axis(const char *, const HklVector *axis_v);
+int hkl_parameter_is_valid(const HklParameter *parameter);
+void hkl_parameter_value_set_smallest_in_range(HklParameter *parameter);
+double hkl_parameter_value_get_closest(HklParameter *parameter, HklParameter *ref);
 
 static void new(void)
 {
 	HklParameter *axis;
 	static HklVector v = {{1, 0, 0}};
+	double min, max;
 
 	axis = hkl_parameter_new_axis("omega", &v);
 
-	is_string("omega", axis->name, __func__);
-	is_double(-M_PI, axis->range.min, HKL_EPSILON, __func__);
-	is_double(M_PI, axis->range.max, HKL_EPSILON, __func__);
-	is_double(0., hkl_parameter_value_get(axis), HKL_EPSILON, __func__);
-	ok(HKL_TRUE == axis->fit, __func__);
-	ok(HKL_TRUE == axis->changed, __func__);
+	is_string("omega", hkl_parameter_name_get(axis), __func__);
+	hkl_parameter_min_max_get(axis, &min, &max, HKL_UNIT_DEFAULT);
+	is_double(-M_PI, min, HKL_EPSILON, __func__);
+	is_double(M_PI, max, HKL_EPSILON, __func__);
+	is_double(0., hkl_parameter_value_get(axis, HKL_UNIT_DEFAULT), HKL_EPSILON, __func__);
+	ok(TRUE == hkl_parameter_fit_get(axis), __func__);
 
 	hkl_parameter_free(axis);
 }
 
 static void get_quaternions(void)
 {
-	HklAxis *axis;
-	static HklVector v = {{1, 0, 0}};
+	static HklVector v_ref = {{1, 0, 0}};
+	static HklQuaternion q1_ref = {{1, 0, 0, 0}};
+	static HklQuaternion q2_ref = {{M_SQRT1_2, -M_SQRT1_2, 0, 0}};
+	HklParameter *axis;
 
-	axis = container_of(hkl_parameter_new_axis("omega", &v),
-			    HklAxis, parameter);
+	axis = hkl_parameter_new_axis("omega", &v_ref);
 
-	is_double(1., axis->q.data[0], HKL_EPSILON, __func__);
-	is_double(0., axis->q.data[1], HKL_EPSILON, __func__);
-	is_double(0., axis->q.data[2], HKL_EPSILON, __func__);
-	is_double(0., axis->q.data[3], HKL_EPSILON, __func__);
+	is_quaternion(&q1_ref, hkl_parameter_quaternion_get(axis), __func__);
 
-	hkl_parameter_value_set(&axis->parameter, -M_PI_2, NULL);
-	is_double(1./sqrt(2.), axis->q.data[0], HKL_EPSILON, __func__);
-	is_double(-1./sqrt(2.), axis->q.data[1], HKL_EPSILON, __func__);
-	is_double(0., axis->q.data[2], HKL_EPSILON, __func__);
-	is_double(0., axis->q.data[3], HKL_EPSILON, __func__);
+	ok(TRUE == hkl_parameter_value_set(axis, -M_PI_2, HKL_UNIT_DEFAULT, NULL), __func__);
+	is_quaternion(&q2_ref, hkl_parameter_quaternion_get(axis), __func__);
 
-	hkl_parameter_free(&axis->parameter);
+	hkl_parameter_free(axis);
 }
 
 static void copy(void)
 {
-	HklAxis *axis;
-	HklAxis *copy;
 	static HklVector v = {{1, 0, 0}};
+	static HklQuaternion q_ref = {{M_SQRT1_2, -M_SQRT1_2, 0, 0}};
+	HklParameter *axis;
+	HklParameter *copy;
+	double min, max;
+
+
+	axis = hkl_parameter_new_axis("omega", &v);
+	ok(TRUE == hkl_parameter_value_set(axis, -M_PI_2, HKL_UNIT_DEFAULT, NULL), __func__);
 
-	axis = container_of(hkl_parameter_new_axis("omega", &v),
-			    HklAxis, parameter);
-	hkl_parameter_value_set(&axis->parameter, -M_PI_2, NULL);
-
-	copy = container_of(hkl_parameter_new_copy(&axis->parameter),
-			    HklAxis, parameter);
-	is_string("omega", copy->parameter.name, __func__);
-	is_double(-M_PI, copy->parameter.range.min, HKL_EPSILON, __func__);
-	is_double(M_PI, copy->parameter.range.max, HKL_EPSILON, __func__);
-	is_double(-M_PI_2, hkl_parameter_value_get(&copy->parameter), HKL_EPSILON, __func__);
-	ok(HKL_TRUE == copy->parameter.fit, __func__);
-	ok(HKL_TRUE == copy->parameter.changed, __func__);
-	is_double(1./sqrt(2.), copy->q.data[0], HKL_EPSILON, __func__);
-	is_double(-1./sqrt(2.), copy->q.data[1], HKL_EPSILON, __func__);
-	is_double(0., copy->q.data[2], HKL_EPSILON, __func__);
-	is_double(0., copy->q.data[3], HKL_EPSILON, __func__);
-	
-	hkl_parameter_free(&axis->parameter);
-	hkl_parameter_free(&copy->parameter);
+	copy = hkl_parameter_new_copy(axis);
+
+	is_string("omega", hkl_parameter_name_get(copy), __func__);
+	hkl_parameter_min_max_get(copy, &min, &max, HKL_UNIT_DEFAULT);
+	is_double(-M_PI, min, HKL_EPSILON, __func__);
+	is_double(M_PI, max, HKL_EPSILON, __func__);
+	is_double(-M_PI_2, hkl_parameter_value_get(copy, HKL_UNIT_DEFAULT), HKL_EPSILON, __func__);
+	ok(TRUE == hkl_parameter_fit_get(copy), __func__);
+
+	is_quaternion(&q_ref, hkl_parameter_quaternion_get(copy), __func__);
+
+	hkl_parameter_free(axis);
+	hkl_parameter_free(copy);
 }
 
 static void is_valid(void)
 {
-	HklAxis *axis1;
 	static HklVector v = {{1, 0, 0}};
+	HklParameter *axis1;
 
-	axis1 = container_of(hkl_parameter_new_axis("omega", &v),
-			     HklAxis, parameter);
+	axis1 = hkl_parameter_new_axis("omega", &v);
 
-	hkl_parameter_value_unit_set(&axis1->parameter, 45, NULL);
-	ok(HKL_TRUE == hkl_parameter_is_valid(&axis1->parameter), __func__);
+	ok(TRUE == hkl_parameter_value_set(axis1, 45, HKL_UNIT_USER, NULL), __func__);
+	ok(TRUE == hkl_parameter_is_valid(axis1), __func__);
 
 	/* change the range of axis1 */
-	hkl_parameter_min_max_unit_set(&axis1->parameter, -270, 0);
-	ok(HKL_FALSE == hkl_parameter_is_valid(&axis1->parameter), __func__);
+	ok(TRUE == hkl_parameter_min_max_set(axis1, -270, 0, HKL_UNIT_USER, NULL), __func__);
+	ok(FALSE == hkl_parameter_is_valid(axis1), __func__);
 
-	hkl_parameter_value_unit_set(&axis1->parameter, -45, NULL);
-	ok(HKL_TRUE == hkl_parameter_is_valid(&axis1->parameter), __func__);
+	ok(TRUE == hkl_parameter_value_set(axis1, -45, HKL_UNIT_USER, NULL), __func__);
+	ok(TRUE == hkl_parameter_is_valid(axis1), __func__);
 
-	hkl_parameter_min_max_unit_set(&axis1->parameter, 350, 450);
-	hkl_parameter_value_unit_set(&axis1->parameter, 45, NULL);
-	ok(HKL_TRUE == hkl_parameter_is_valid(&axis1->parameter), __func__);
-	hkl_parameter_value_unit_set(&axis1->parameter, -45, NULL);
-	ok(HKL_FALSE == hkl_parameter_is_valid(&axis1->parameter), __func__);
+	ok(TRUE == hkl_parameter_min_max_set(axis1, 350, 450, HKL_UNIT_USER, NULL), __func__);
+	ok(TRUE == hkl_parameter_value_set(axis1, 45, HKL_UNIT_USER, NULL), __func__);
+	ok(TRUE == hkl_parameter_is_valid(axis1), __func__);
+	ok(TRUE == hkl_parameter_value_set(axis1, -45, HKL_UNIT_USER, NULL), __func__);
+	ok(FALSE == hkl_parameter_is_valid(axis1), __func__);
 
-	hkl_parameter_min_max_unit_set(&axis1->parameter, -10, 90);
-	hkl_parameter_value_unit_set(&axis1->parameter, 405, NULL);
-	ok(HKL_TRUE == hkl_parameter_is_valid(&axis1->parameter), __func__);
-	hkl_parameter_value_unit_set(&axis1->parameter, -405, NULL);
-	ok(HKL_FALSE == hkl_parameter_is_valid(&axis1->parameter), __func__);
+	ok(TRUE == hkl_parameter_min_max_set(axis1, -10, 90, HKL_UNIT_USER, NULL), __func__);
+	ok(TRUE == hkl_parameter_value_set(axis1, 405, HKL_UNIT_USER, NULL), __func__);
+	ok(TRUE == hkl_parameter_is_valid(axis1), __func__);
+	ok(TRUE == hkl_parameter_value_set(axis1, -405, HKL_UNIT_USER, NULL), __func__);
+	ok(FALSE == hkl_parameter_is_valid(axis1), __func__);
 
-	hkl_parameter_free(&axis1->parameter);
+	hkl_parameter_free(axis1);
 }
 
 static void set_value_smallest_in_range(void)
 {
-	HklAxis *axis;
+	HklParameter *axis;
 	static HklVector v = {{1, 0, 0}};
 
-	axis = container_of(hkl_parameter_new_axis("omega", &v),
-			    HklAxis, parameter);
+	axis = hkl_parameter_new_axis("omega", &v);
 
-	hkl_parameter_min_max_unit_set(&axis->parameter, -190, 190);
+	ok(TRUE == hkl_parameter_min_max_set(axis, -190, 190, HKL_UNIT_USER, NULL), __func__);
 
-	hkl_parameter_value_unit_set(&axis->parameter, 185, NULL);
-	hkl_parameter_value_set_smallest_in_range(&axis->parameter);
-	is_double(-175., hkl_parameter_value_unit_get(&axis->parameter), HKL_EPSILON, __func__);
+	ok(TRUE == hkl_parameter_value_set(axis, 185, HKL_UNIT_USER, NULL), __func__);
+	hkl_parameter_value_set_smallest_in_range(axis);
+	is_double(-175., hkl_parameter_value_get(axis, HKL_UNIT_USER), HKL_EPSILON, __func__);
 
-	hkl_parameter_value_unit_set(&axis->parameter, 545, NULL);
-	hkl_parameter_value_set_smallest_in_range(&axis->parameter);
-	is_double(-175., hkl_parameter_value_unit_get(&axis->parameter), HKL_EPSILON, __func__);
+	ok(TRUE == hkl_parameter_value_set(axis, 545, HKL_UNIT_USER, NULL), __func__);
+	hkl_parameter_value_set_smallest_in_range(axis);
+	is_double(-175., hkl_parameter_value_get(axis, HKL_UNIT_USER), HKL_EPSILON, __func__);
 
-	hkl_parameter_value_unit_set(&axis->parameter, -185, NULL);
-	hkl_parameter_value_set_smallest_in_range(&axis->parameter);
-	is_double(-185., hkl_parameter_value_unit_get(&axis->parameter), HKL_EPSILON, __func__);
+	ok(TRUE == hkl_parameter_value_set(axis, -185, HKL_UNIT_USER, NULL), __func__);
+	hkl_parameter_value_set_smallest_in_range(axis);
+	is_double(-185., hkl_parameter_value_get(axis, HKL_UNIT_USER), HKL_EPSILON, __func__);
 
-	hkl_parameter_value_unit_set(&axis->parameter, 175, NULL);
-	hkl_parameter_value_set_smallest_in_range(&axis->parameter);
-	is_double(-185., hkl_parameter_value_unit_get(&axis->parameter), HKL_EPSILON, __func__);
+	ok(TRUE == hkl_parameter_value_set(axis, 175, HKL_UNIT_USER, NULL), __func__);
+	hkl_parameter_value_set_smallest_in_range(axis);
+	is_double(-185., hkl_parameter_value_get(axis, HKL_UNIT_USER), HKL_EPSILON, __func__);
 
-	hkl_parameter_value_unit_set(&axis->parameter, 190, NULL);
-	hkl_parameter_value_set_smallest_in_range(&axis->parameter);
-	is_double(-170., hkl_parameter_value_unit_get(&axis->parameter), HKL_EPSILON, __func__);
+	ok(TRUE == hkl_parameter_value_set(axis, 190, HKL_UNIT_USER, NULL), __func__);
+	hkl_parameter_value_set_smallest_in_range(axis);
+	is_double(-170., hkl_parameter_value_get(axis, HKL_UNIT_USER), HKL_EPSILON, __func__);
 
-	hkl_parameter_value_unit_set(&axis->parameter, -190, NULL);
-	hkl_parameter_value_set_smallest_in_range(&axis->parameter);
-	is_double(-190., hkl_parameter_value_unit_get(&axis->parameter), HKL_EPSILON, __func__);
+	ok(TRUE == hkl_parameter_value_set(axis, -190, HKL_UNIT_USER, NULL), __func__);
+	hkl_parameter_value_set_smallest_in_range(axis);
+	is_double(-190., hkl_parameter_value_get(axis, HKL_UNIT_USER), HKL_EPSILON, __func__);
 
-	hkl_parameter_free(&axis->parameter);
+	hkl_parameter_free(axis);
 }
 
 static void get_value_closest(void)
 {
-	HklAxis *axis1, *axis2;
+	HklParameter *axis1, *axis2;
 	static HklVector v = {{1, 0, 0}};
 
-	axis1 = container_of(hkl_parameter_new_axis("omega", &v),
-			     HklAxis, parameter);
-	axis2 = container_of(hkl_parameter_new_axis("omega", &v),
-			     HklAxis, parameter);
+	axis1 = hkl_parameter_new_axis("omega", &v);
+	axis2 = hkl_parameter_new_axis("omega", &v);
 
-	hkl_parameter_value_unit_set(&axis1->parameter, 0, NULL);
-	hkl_parameter_value_unit_set(&axis2->parameter, 0, NULL);
-	is_double(0., hkl_parameter_value_get_closest(&axis1->parameter,
-						      &axis2->parameter),
+	ok(TRUE == hkl_parameter_value_set(axis1, 0, HKL_UNIT_USER, NULL), __func__);
+	ok(TRUE == hkl_parameter_value_set(axis2, 0, HKL_UNIT_USER, NULL), __func__);
+	is_double(0., hkl_parameter_value_get_closest(axis1,
+						      axis2),
 		  HKL_EPSILON, __func__);
 
 	/* change the range of axis1 */
-	hkl_parameter_min_max_unit_set(&axis1->parameter, -270, 180);
-	hkl_parameter_value_unit_set(&axis1->parameter, 100, NULL);
+	ok(TRUE == hkl_parameter_min_max_set(axis1, -270, 180, HKL_UNIT_USER, NULL), __func__);
+	ok(TRUE == hkl_parameter_value_set(axis1, 100, HKL_UNIT_USER, NULL), __func__);
 
-	hkl_parameter_value_unit_set(&axis2->parameter, -75, NULL);
-	is_double(100 * HKL_DEGTORAD, hkl_parameter_value_get_closest(&axis1->parameter,
-								      &axis2->parameter),
+	ok(TRUE == hkl_parameter_value_set(axis2, -75, HKL_UNIT_USER, NULL), __func__);
+	is_double(100 * HKL_DEGTORAD, hkl_parameter_value_get_closest(axis1,
+								      axis2),
 		  HKL_EPSILON, __func__);
 
-	hkl_parameter_value_unit_set(&axis2->parameter, -85, NULL);
-	is_double(-260 * HKL_DEGTORAD, hkl_parameter_value_get_closest(&axis1->parameter,
-								       &axis2->parameter),
+	ok(TRUE == hkl_parameter_value_set(axis2, -85, HKL_UNIT_USER, NULL), __func__);
+	is_double(-260 * HKL_DEGTORAD, hkl_parameter_value_get_closest(axis1,
+								       axis2),
 		  HKL_EPSILON, __func__);
 
-	hkl_parameter_free(&axis1->parameter);
-	hkl_parameter_free(&axis2->parameter);
+	hkl_parameter_free(axis1);
+	hkl_parameter_free(axis2);
 }
 
 int main(int argc, char** argv)
 {
-	plan(40);
+	plan(53);
 
 	new();
 	get_quaternions();
diff --git a/tests/hkl-bench-t.c b/tests/hkl-bench-t.c
index 330e917..ecd70c2 100644
--- a/tests/hkl-bench-t.c
+++ b/tests/hkl-bench-t.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -24,31 +24,46 @@
 #include <tap/basic.h>
 #include "hkl.h"
 
-static void hkl_test_bench_run_real(HklEngine *engine, HklGeometry *geometry, size_t n)
+static void hkl_test_bench_run_real(HklEngine *engine, HklGeometry *geometry,
+				    double values[], size_t n_values, size_t n)
 {
 	size_t i;
-	HklMode **mode;
-	darray_mode *modes = hkl_engine_modes(engine);
+	const darray_string *modes = hkl_engine_modes_names_get(engine);
+	const char **mode;
 
 	/* pseudo -> geometry */
 	darray_foreach(mode, *modes){
 		double min, max, mean;
-		darray_parameter *parameters;
-
-		hkl_engine_select_mode(engine, *mode);
-		parameters = hkl_mode_parameters(*mode);
-		if (darray_size(*parameters))
-			hkl_parameter_value_set(darray_item(*parameters, 0), 1, NULL);
+		const darray_string *parameters;
+		size_t n_params;
+
+		hkl_engine_current_mode_set(engine, *mode, NULL);
+		parameters = hkl_engine_parameters_names_get(engine);
+		n_params = darray_size(*parameters);
+		if (n_params){
+			double params[n_params];
+
+			hkl_engine_parameters_values_get(engine,
+							 params, n_params,
+							 HKL_UNIT_DEFAULT);
+			values[0] = 1;
+			hkl_engine_parameters_values_set(engine,
+							 params, n_params,
+							 HKL_UNIT_DEFAULT, NULL);
+		}
 
 		mean = max = 0;
 		min = 1000; /* arbitrary value always greater than the real min */
 		for(i=0; i<n; ++i){
 			struct timeval debut, fin, dt;
 			double t;
+			HklGeometryList *solutions;
 
-			hkl_geometry_set_values_unit_v(geometry, 0, 0, 0, 0, 10, 10);
+			hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 0., 0., 0., 0., 10., 10.);
 			gettimeofday(&debut, NULL);
-			hkl_engine_set(engine, NULL);
+			solutions = hkl_engine_pseudo_axis_values_set(engine, values, n_values, HKL_UNIT_DEFAULT, NULL);
+			if (NULL != solutions)
+				hkl_geometry_list_free(solutions);
 			gettimeofday(&fin, NULL);
 			timersub(&fin, &debut, &dt);
 			t = dt.tv_sec * 1000. + dt.tv_usec / 1000.;
@@ -58,28 +73,26 @@ static void hkl_test_bench_run_real(HklEngine *engine, HklGeometry *geometry, si
 		}
 		fprintf(stdout, "\"%s\" \"%s\" \"%s\" (%d/%d) iterations %f / %f / %f [min/mean/max] ms each\n",
 			hkl_geometry_name_get(geometry),
-			hkl_engine_name(engine),
-			hkl_mode_name(*mode), n, i, min, mean/n, max);
+			hkl_engine_name_get(engine),
+			*mode, n, i, min, mean/n, max);
 	}
 }
 
 static void hkl_test_bench_run_v(HklEngineList *engines, HklGeometry *geometry,
-				 char const *name, int n, ...)
+				 char const *name, unsigned int n, ...)
 {
 	va_list ap;
-	HklEngine *engine = hkl_engine_list_get_by_name(engines, name);
-	HklParameter **pseudo_axis;
-	darray_parameter *pseudo_axes = (darray_parameter *)hkl_engine_pseudo_axes(engine);
+	size_t i;
+	HklEngine *engine = hkl_engine_list_engine_get_by_name(engines, name, NULL);
+	size_t n_values = darray_size(*hkl_engine_pseudo_axis_names_get(engine));
+	double values[n_values];
 
 	va_start(ap, n);
-	/* TODO replace with a specialise HklParameterList */
-	darray_foreach(pseudo_axis, *pseudo_axes){
-		hkl_parameter_value_set(*pseudo_axis,
-					va_arg(ap, double), NULL);
-	}
+	for(i=0; i<n_values; ++i)
+		values[i] = va_arg(ap, double);
 	va_end(ap);
 
-	hkl_test_bench_run_real(engine, geometry, n);
+	hkl_test_bench_run_real(engine, geometry, values, n_values, n);
 }
 
 static void hkl_test_bench_k6c(int n)
@@ -93,12 +106,11 @@ static void hkl_test_bench_k6c(int n)
 	size_t i, j;
 	int res;
 
-	factory = hkl_factory_get_by_name("K6C");
+	factory = hkl_factory_get_by_name("K6C", NULL);
 
 	geom = hkl_factory_create_new_geometry(factory);
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	sample = hkl_sample_new("test");
 
@@ -121,46 +133,43 @@ static void hkl_test_bench_eulerians(void)
 {
 	HklEngineList *engines;
 	HklEngine *engine;
-	HklMode **mode;
-	darray_mode *modes;
+	const char **mode;
+	const darray_string *modes;
 	const HklFactory *factory;
 	HklGeometry *geometry;
 	HklDetector *detector;
 	HklSample *sample;
 
-	factory = hkl_factory_get_by_name("K6C");
+	factory = hkl_factory_get_by_name("K6C", NULL);
 
 	geometry = hkl_factory_create_new_geometry(factory);
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	sample = hkl_sample_new("test");
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
 
-	engine = hkl_engine_list_get_by_name(engines, "eulerians");
-	modes = hkl_engine_modes(engine);
+	engine = hkl_engine_list_engine_get_by_name(engines, "eulerians", NULL);
+	modes = hkl_engine_modes_names_get(engine);
 
 	darray_foreach(mode, *modes){
-		static double eulerians[] = {0, 90 * HKL_DEGTORAD, 0};
-		HklParameterList *pseudo_axes = hkl_engine_pseudo_axes(engine);
+		static double values[3] = {0, 90 * HKL_DEGTORAD, 0};
+		HklGeometryList *solutions;
 
-		hkl_engine_select_mode(engine, *mode);
+		hkl_engine_current_mode_set(engine, *mode, NULL);
 
 		/* studdy this degenerated case */
-		hkl_parameter_list_values_set(pseudo_axes, eulerians, 3, NULL);
-		if (hkl_engine_set(engine, NULL)) {
-			const HklGeometryList *geometries = hkl_engine_list_geometries(engines);
-			const darray_item *items = hkl_geometry_list_items_get(geometries);
-			HklGeometryListItem **item;
-
-			darray_foreach(item, *items){
-				static double null[] = {0, 0, 0};
+		solutions = hkl_engine_pseudo_axis_values_set(engine,
+							       values, ARRAY_SIZE(values),
+							       HKL_UNIT_DEFAULT, NULL);
+		if (solutions) {
+			const HklGeometryListItem *item;
 
-				hkl_parameter_list_values_set(pseudo_axes, null, 3, NULL);
+			HKL_GEOMETRY_LIST_FOREACH(item, solutions){
 				hkl_geometry_set(geometry,
-						 hkl_geometry_list_item_geometry_get(*item));
-				hkl_engine_get(engine, NULL);
+						 hkl_geometry_list_item_geometry_get(item));
+				hkl_engine_pseudo_axis_values_get(engine, values, ARRAY_SIZE(values),
+								   HKL_UNIT_DEFAULT, NULL);
 			}
 		}
 	}
@@ -185,7 +194,7 @@ int main(int argc, char **argv)
 	hkl_test_bench_k6c(n);
 	hkl_test_bench_eulerians();
 
-	ok(HKL_TRUE == HKL_TRUE, __func__);
+	ok(TRUE == TRUE, __func__);
 
 	return 0;
 }
diff --git a/tests/hkl-detector-t.c b/tests/hkl-detector-t.c
index 2c29022..090f4d5 100644
--- a/tests/hkl-detector-t.c
+++ b/tests/hkl-detector-t.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -31,7 +31,7 @@ static void new(void)
 	HklDetector *detector2;
 
 	detector1 = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	ok(0 == detector1->idx, __func__);
+	ok(1 == detector1->idx, __func__);
 	ok(NULL == detector1->holder, __func__);
 
 	detector2 = hkl_detector_new_copy(detector1);
@@ -54,7 +54,7 @@ static void attach_to_holder(void)
 	holder = hkl_geometry_add_holder(geometry);
 	hkl_detector_attach_to_holder(detector, holder);
 
-	ok(0 == detector->idx, __func__);
+	ok(1 == detector->idx, __func__);
 	ok(holder == detector->holder, __func__);
 
 	hkl_geometry_free(geometry);
@@ -73,12 +73,17 @@ static void compute_kf(void)
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
 	geometry = hkl_geometry_new(NULL);
+	/* add a fake first holder */
+	holder = hkl_geometry_add_holder(geometry);
+	/* for now all detectors MUST be connected to the second
+	 * holder. We will decide about a better API to connect
+	 * geometry and detector */
 	holder = hkl_geometry_add_holder(geometry);
 	hkl_holder_add_rotation_axis(holder, "a", 1, 0, 0);
 	hkl_holder_add_rotation_axis(holder, "b", 0, 1, 0);
 
-	hkl_parameter_value_set(darray_item(geometry->axes, 0), M_PI_2, NULL);
-	hkl_parameter_value_set(darray_item(geometry->axes, 1), M_PI_2, NULL);
+	hkl_parameter_value_set(darray_item(geometry->axes, 0), M_PI_2, HKL_UNIT_DEFAULT, NULL);
+	hkl_parameter_value_set(darray_item(geometry->axes, 1), M_PI_2, HKL_UNIT_DEFAULT, NULL);
 
 	hkl_detector_attach_to_holder(detector, holder);
 	hkl_detector_compute_kf(detector, geometry, &kf);
diff --git a/tests/hkl-error-t.c b/tests/hkl-error-t.c
deleted file mode 100644
index 355da64..0000000
--- a/tests/hkl-error-t.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include "hkl.h"
-#include <tap/basic.h>
-
-#include "hkl-error-private.h"
-
-static void new(void)
-{
-	HklError *error;
-
-	error = hkl_error_new("salut %s", "fred");
-	is_string("salut fred", error->message, __func__);
-	hkl_error_free(error);
-
-	error = hkl_error_new_literal("salut fred");
-	is_string("salut fred", error->message, __func__);
-	hkl_error_free(error);
-}
-
-static void copy(void)
-{
-	HklError *error;
-	HklError *copy;
-
-	error = hkl_error_new ("salut %s", "fred");
-	copy = hkl_error_new_copy (error);
-
-	is_string ("salut fred", copy->message, __func__);
-
-	hkl_error_free (error);
-	hkl_error_free (copy);
-}
-
-static void set(void)
-{
-	HklError *error = NULL;
-
-	hkl_error_set (&error, "salut %s", "bob");
-	is_string ("salut bob", error->message, __func__);
-	hkl_error_clear (&error);
-
-	hkl_error_set_literal (&error, "salut fred");
-	is_string ("salut fred", error->message, __func__);
-
-	hkl_error_free (error);
-}
-
-static void propagate(void)
-{
-	HklError *dest = NULL;
-	HklError *src;
-
-	src = hkl_error_new ("salut %s", "fred");
-	hkl_error_propagate (NULL, src);
-	/* free src so no memory leak here*/
-
-	src = hkl_error_new ("salut %s", "fred");
-	hkl_error_propagate (&dest, src);
-	is_string ("salut fred", dest->message, __func__);
-	/* transfer the error into dest so no need to release src anymore */
-	hkl_error_free (dest);
-}
-
-static void clear(void)
-{
-	HklError *error;
-
-	error = hkl_error_new ("salut %s", "fred");
-	hkl_error_clear (&error);
-
-	ok(NULL == error, __func__);
-}
-
-static void prefix(void)
-{
-	HklError *error;
-	HklError *dest = NULL;
-
-	error = hkl_error_new ("%s", "fred");
-
-	hkl_error_prefix (&error, "%s", "salut ");
-	is_string ("salut fred", error->message, __func__);
-
-	hkl_error_propagate_prefixed (&dest, error, "%s", "oh ");
-	is_string ("oh salut fred", dest->message, __func__);
-
-	hkl_error_free (dest);
-}
-
-int main(int argc, char** argv)
-{
-	plan(9);
-
-	new();
-	copy();
-	set();
-	propagate();
-	clear();
-	prefix();
-
-	return 0;
-}
diff --git a/tests/hkl-geometry-t.c b/tests/hkl-geometry-t.c
index 5477024..710fff2 100644
--- a/tests/hkl-geometry-t.c
+++ b/tests/hkl-geometry-t.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -23,6 +23,9 @@
 #include <tap/basic.h>
 #include <tap/float.h>
 
+/* BEWARE THESE TESTS ARE DEALING WITH HKL INTERNALS WHICH EXPOSE A
+ * NON PUBLIC API WHICH ALLOW TO SHOOT YOURSELF IN YOUR FOOT */
+
 #include "hkl/ccan/container_of/container_of.h"
 #include "hkl-axis-private.h" /* temporary */
 #include "hkl-geometry-private.h"
@@ -54,7 +57,8 @@ static void get_axis(void)
 {
 	HklGeometry *g = NULL;
 	HklHolder *holder = NULL;
-	HklAxis *axis0, *axis1, *axis2;
+	const HklParameter *axis0, *axis1, *axis2;
+	GError *error;
 
 	g = hkl_geometry_new(NULL);
 
@@ -66,11 +70,36 @@ static void get_axis(void)
 	hkl_holder_add_rotation_axis(holder, "A", 1., 0., 0.);
 	hkl_holder_add_rotation_axis(holder, "C", 1., 0., 0.);
 
+	/* check the private API */
 	ok(0 == !hkl_geometry_get_axis_by_name(g, "A"), __func__);
 	ok(0 == !hkl_geometry_get_axis_by_name(g, "B"), __func__);
 	ok(0 == !hkl_geometry_get_axis_by_name(g, "C"), __func__);
 	ok(1 == !hkl_geometry_get_axis_by_name(g, "D"), __func__);
 
+	/* check the public API */
+	/* get */
+	ok(NULL != hkl_geometry_axis_get(g, "A", NULL), __func__);
+	ok(NULL == hkl_geometry_axis_get(g, "D", NULL), __func__);
+	error = NULL;
+	hkl_geometry_axis_get(g, "A", &error);
+	ok(error == NULL, __func__);
+	hkl_geometry_axis_get(g, "D", &error);
+	ok(error != NULL, __func__);
+	g_clear_error(&error);
+
+	/* set */
+	axis0 = hkl_geometry_axis_get(g, "A", NULL);
+	ok(TRUE == hkl_geometry_axis_set(g, "A", axis0, NULL), __func__);
+	ok(FALSE == hkl_geometry_axis_set(g, "B", axis0, NULL), __func__);
+
+	error = NULL;
+	hkl_geometry_axis_set(g, "A", axis0, &error);
+	ok(error == NULL, __func__);
+
+	ok(FALSE == hkl_geometry_axis_set(g, "B", axis0, &error), __func__);
+	ok(error != NULL, __func__);
+	g_clear_error(&error);
+
 	hkl_geometry_free(g);
 }
 
@@ -91,9 +120,9 @@ static void update(void)
 	hkl_holder_add_rotation_axis(holder, "C", 1., 0., 0.);
 
 	axis1 = container_of(hkl_geometry_get_axis_by_name(g, "B"), HklAxis, parameter);
-	hkl_parameter_value_set(&axis1->parameter, M_PI_2, NULL);
+	hkl_parameter_value_set(&axis1->parameter, M_PI_2, HKL_UNIT_DEFAULT, NULL);
 	/* now axis1 is dirty */
-	ok(HKL_TRUE == axis1->parameter.changed, __func__);
+	ok(TRUE == axis1->parameter.changed, __func__);
 
 	hkl_geometry_update(g);
 	holder = darray_item(g->holders, 0);
@@ -102,15 +131,20 @@ static void update(void)
 	is_double(.0, holder->q.data[2], HKL_EPSILON, __func__);
 	is_double(.0, holder->q.data[3], HKL_EPSILON, __func__);
 	/* now axis1 is clean */
-	ok(HKL_FALSE == axis1->parameter.changed, __func__);
+	ok(FALSE == axis1->parameter.changed, __func__);
 
 	hkl_geometry_free(g);
 }
 
-static void set_values(void)
+static void set(void)
 {
+	int res;
+	GError *error;
 	HklGeometry *g;
+	HklGeometry *g1;
+	HklGeometry *g2;
 	HklHolder *holder;
+	HklFactory *fake_factory;
 
 	g = hkl_geometry_new(NULL);
 	holder = hkl_geometry_add_holder(g);
@@ -118,18 +152,32 @@ static void set_values(void)
 	hkl_holder_add_rotation_axis(holder, "B", 1., 0., 0.);
 	hkl_holder_add_rotation_axis(holder, "C", 1., 0., 0.);
 
-	hkl_geometry_set_values_v(g, 3, 1., 1., 1.);
-	is_double(1., hkl_parameter_value_get(darray_item(g->axes, 0)), HKL_EPSILON, __func__);
-	is_double(1., hkl_parameter_value_get(darray_item(g->axes, 1)), HKL_EPSILON, __func__);
-	is_double(1., hkl_parameter_value_get(darray_item(g->axes, 2)), HKL_EPSILON, __func__);
+	g1 = hkl_geometry_new_copy(g);
 
+	/* it is required to use a fake factory, with the public API
+	 * geometry contain always a real factory */
+	fake_factory = (HklFactory *)0x1;
+	g2 = hkl_geometry_new(fake_factory);
+	holder = hkl_geometry_add_holder(g);
+	hkl_holder_add_rotation_axis(holder, "A", 1., 0., 0.);
+	hkl_holder_add_rotation_axis(holder, "B", 1., 0., 0.);
+
+	ok(hkl_geometry_set(g, g1), __func__);
+
+	hkl_geometry_free(g2);
+	hkl_geometry_free(g1);
 	hkl_geometry_free(g);
 }
 
-static void set_values_unit(void)
+static void axis_values_get_set(void)
 {
+	unsigned int i;
 	HklGeometry *g;
 	HklHolder *holder;
+	static double set_1[] = {1, 1, 1};
+	static double set_10[] = {10, 10, 10};
+	double values[3];
+	GError *error;
 
 	g = hkl_geometry_new(NULL);
 	holder = hkl_geometry_add_holder(g);
@@ -137,10 +185,30 @@ static void set_values_unit(void)
 	hkl_holder_add_rotation_axis(holder, "B", 1., 0., 0.);
 	hkl_holder_add_rotation_axis(holder, "C", 1., 0., 0.);
 
-	hkl_geometry_set_values_unit_v(g, 10., 10., 10.);
-	is_double(10. * HKL_DEGTORAD, hkl_parameter_value_get(darray_item(g->axes, 0)), HKL_EPSILON, __func__);
-	is_double(10. * HKL_DEGTORAD, hkl_parameter_value_get(darray_item(g->axes, 1)), HKL_EPSILON, __func__);
-	is_double(10. * HKL_DEGTORAD, hkl_parameter_value_get(darray_item(g->axes, 2)), HKL_EPSILON, __func__);
+	/* check set DEFAULT unit */
+	error = NULL;
+	ok(TRUE == hkl_geometry_axis_values_set(g, set_1, ARRAY_SIZE(set_1), HKL_UNIT_DEFAULT, NULL), __func__);
+	ok(TRUE == hkl_geometry_axis_values_set(g, set_1, ARRAY_SIZE(set_1), HKL_UNIT_DEFAULT, &error), __func__);
+	ok(error == NULL, __func__);
+	for(i=0; i<ARRAY_SIZE(set_1); ++i)
+		is_double(set_1[i], hkl_parameter_value_get(darray_item(g->axes, i), HKL_UNIT_DEFAULT), HKL_EPSILON, __func__);
+
+	/* check get DEFAULT unit */
+	hkl_geometry_axis_values_get(g, values, 3, HKL_UNIT_DEFAULT);
+	for(i=0; i<ARRAY_SIZE(set_1); ++i)
+		is_double(set_1[i], values[i], HKL_EPSILON, __func__);
+
+	/* check set USER unit */
+	ok(TRUE == hkl_geometry_axis_values_set(g, set_10, ARRAY_SIZE(set_10), HKL_UNIT_USER, NULL), __func__);
+	ok(TRUE == hkl_geometry_axis_values_set(g, set_10, ARRAY_SIZE(set_10), HKL_UNIT_USER, &error), __func__);
+	ok(error == NULL, __func__);
+	for(i=0; i<ARRAY_SIZE(set_10); ++i)
+		is_double(set_10[i] * HKL_DEGTORAD, hkl_parameter_value_get(darray_item(g->axes, i), HKL_UNIT_DEFAULT), HKL_EPSILON, __func__);
+
+	/* check get USER unit */
+	hkl_geometry_axis_values_get(g, values, 3, HKL_UNIT_USER);
+	for(i=0; i<ARRAY_SIZE(set_10); ++i)
+		is_double(set_10[i], values[i], HKL_EPSILON, __func__);
 
 	hkl_geometry_free(g);
 }
@@ -159,8 +227,8 @@ static void distance(void)
 
 	g2 = hkl_geometry_new_copy(g1);
 
-	hkl_geometry_set_values_v(g1, 3, 0., 0., 0.);
-	hkl_geometry_set_values_v(g2, 3, 1., 1., 1.);
+	hkl_geometry_set_values_v(g1, HKL_UNIT_DEFAULT, NULL, 0., 0., 0.);
+	hkl_geometry_set_values_v(g2, HKL_UNIT_DEFAULT, NULL, 1., 1., 1.);
 	is_double(3., hkl_geometry_distance(g1, g2), HKL_EPSILON, __func__);
 
 	hkl_geometry_free(g1);
@@ -178,15 +246,37 @@ static void is_valid(void)
 	hkl_holder_add_rotation_axis(holder, "B", 1., 0., 0.);
 	hkl_holder_add_rotation_axis(holder, "C", 1., 0., 0.);
 
-	hkl_geometry_set_values_v(geom, 3, 0., 0., 0.);
-	ok(HKL_TRUE == hkl_geometry_is_valid(geom), __func__);
+	hkl_geometry_set_values_v(geom, HKL_UNIT_DEFAULT, NULL, 0., 0., 0.);
+	ok(TRUE == hkl_geometry_is_valid(geom), __func__);
 
-	hkl_geometry_set_values_v(geom, 3, -181. * HKL_DEGTORAD, 0., 0.);
-	ok(HKL_TRUE == hkl_geometry_is_valid(geom), __func__);
+	hkl_geometry_set_values_v(geom, HKL_UNIT_DEFAULT, NULL, -181. * HKL_DEGTORAD, 0., 0.);
+	ok(TRUE == hkl_geometry_is_valid(geom), __func__);
 
 	hkl_parameter_min_max_set(darray_item(geom->axes, 0),
-				-100 * HKL_DEGTORAD, 100 * HKL_DEGTORAD);
-	ok(HKL_FALSE == hkl_geometry_is_valid(geom), __func__);
+				  -100 * HKL_DEGTORAD, 100 * HKL_DEGTORAD,
+				  HKL_UNIT_DEFAULT, NULL);
+	ok(FALSE == hkl_geometry_is_valid(geom), __func__);
+
+	hkl_geometry_free(geom);
+}
+
+static void wavelength(void)
+{
+	HklGeometry *geom = NULL;
+	HklHolder *holder = NULL;
+	GError *error;
+
+	geom = hkl_geometry_new(NULL);
+
+	is_double(1.54, hkl_geometry_wavelength_get(geom, HKL_UNIT_DEFAULT), HKL_EPSILON, __func__);
+
+	ok(TRUE == hkl_geometry_wavelength_set(geom, 2, HKL_UNIT_DEFAULT, NULL), __func__);
+	is_double(2, hkl_geometry_wavelength_get(geom, HKL_UNIT_DEFAULT), HKL_EPSILON, __func__);
+
+	error = NULL;
+	ok(TRUE == hkl_geometry_wavelength_set(geom, 2, HKL_UNIT_DEFAULT, &error), __func__);
+	ok(error == NULL, __func__);
+	is_double(2, hkl_geometry_wavelength_get(geom, HKL_UNIT_DEFAULT), HKL_EPSILON, __func__);
 
 	hkl_geometry_free(geom);
 }
@@ -196,7 +286,7 @@ static void list(void)
 	int i = 0;
 	HklGeometry *g;
 	HklGeometryList *list;
-	HklGeometryListItem **item;
+	const HklGeometryListItem *item;
 	HklHolder *holder;
 	static double values[] = {0. * HKL_DEGTORAD, 10 * HKL_DEGTORAD, 30 * HKL_DEGTORAD};
 
@@ -208,28 +298,26 @@ static void list(void)
 
 	list = hkl_geometry_list_new();
 
-	hkl_geometry_set_values_v(g, 3, values[0], 0., 0.);
-	hkl_geometry_fprintf(stderr, g);
+	hkl_geometry_set_values_v(g, HKL_UNIT_DEFAULT, NULL, values[0], 0., 0.);
 	hkl_geometry_list_add(list, g);
-	is_int(1, darray_size(list->items), __func__);
+	is_int(1, hkl_geometry_list_n_items_get(list), __func__);
 
 	/* can not add two times the same geometry */
 	hkl_geometry_list_add(list, g);
-	is_int(1, darray_size(list->items), __func__);
+	is_int(1, hkl_geometry_list_n_items_get(list), __func__);
 
-	hkl_geometry_set_values_v(g, 3, values[2], 0., 0.);
+	hkl_geometry_set_values_v(g, HKL_UNIT_DEFAULT, NULL, values[2], 0., 0.);
 	hkl_geometry_list_add(list, g);
-	hkl_geometry_set_values_v(g, 3, values[1], 0., 0.);
+	hkl_geometry_set_values_v(g, HKL_UNIT_DEFAULT, NULL, values[1], 0., 0.);
 	hkl_geometry_list_add(list, g);
-	is_int(3, darray_size(list->items), __func__);
+	is_int(3, hkl_geometry_list_n_items_get(list), __func__);
 
-	hkl_geometry_set_values_v(g, 3, values[0], 0., 0.);
+	hkl_geometry_set_values_v(g, HKL_UNIT_DEFAULT, NULL, values[0], 0., 0.);
 	hkl_geometry_list_sort(list, g);
 
-	hkl_geometry_list_fprintf(stderr, list);
-	darray_foreach(item, list->items){
+	HKL_GEOMETRY_LIST_FOREACH(item, list){
 		is_double(values[i++],
-			  hkl_parameter_value_get(darray_item((*item)->geometry->axes, 0)),
+			  hkl_parameter_value_get(darray_item(item->geometry->axes, 0), HKL_UNIT_DEFAULT),
 			  HKL_EPSILON, __func__);
 	}
 
@@ -254,13 +342,14 @@ static void  list_multiply_from_range(void)
 	axisB = hkl_geometry_get_axis_by_name(g, "B");
 	axisC = hkl_geometry_get_axis_by_name(g, "C");
 
-	hkl_parameter_min_max_unit_set(axisA, -190, 190);
-	hkl_parameter_min_max_unit_set(axisB, -190, 190);
-	hkl_parameter_min_max_unit_set(axisC, -190, 190);
+	hkl_parameter_min_max_set(axisA, -190, 190, HKL_UNIT_USER, NULL);
+	hkl_parameter_min_max_set(axisB, -190, 190, HKL_UNIT_USER, NULL);
+	hkl_parameter_min_max_set(axisC, -190, 190, HKL_UNIT_USER, NULL);
 
 	list = hkl_geometry_list_new();
 
-	hkl_geometry_set_values_v(g, 3, 185. * HKL_DEGTORAD, -185. * HKL_DEGTORAD, 190. * HKL_DEGTORAD);
+	hkl_geometry_set_values_v(g, HKL_UNIT_DEFAULT, NULL,
+				  185. * HKL_DEGTORAD, -185. * HKL_DEGTORAD, 190. * HKL_DEGTORAD);
 	hkl_geometry_list_add(list, g);
 
 	hkl_geometry_list_multiply_from_range(list);
@@ -286,33 +375,33 @@ static void  list_remove_invalid(void)
 	axisB = hkl_geometry_get_axis_by_name(g, "B");
 	axisC = hkl_geometry_get_axis_by_name(g, "C");
 
-	hkl_parameter_min_max_unit_set(axisA, -100, 180.);
-	hkl_parameter_min_max_unit_set(axisB, -100., 180.);
-	hkl_parameter_min_max_unit_set(axisC, -100., 180.);
+	hkl_parameter_min_max_set(axisA, -100, 180., HKL_UNIT_USER, NULL);
+	hkl_parameter_min_max_set(axisB, -100., 180., HKL_UNIT_USER, NULL);
+	hkl_parameter_min_max_set(axisC, -100., 180., HKL_UNIT_USER, NULL);
 
 	list = hkl_geometry_list_new();
 
-	hkl_geometry_set_values_v(g, 3,
+	hkl_geometry_set_values_v(g, HKL_UNIT_DEFAULT, NULL,
 				  185. * HKL_DEGTORAD,
 				  -185.* HKL_DEGTORAD,
 				  185. * HKL_DEGTORAD);
 	hkl_geometry_list_add(list, g);
 
-	hkl_geometry_set_values_v(g, 3,
+	hkl_geometry_set_values_v(g, HKL_UNIT_DEFAULT, NULL,
 				  -190. * HKL_DEGTORAD,
 				  -190.* HKL_DEGTORAD,
 				  -190.* HKL_DEGTORAD);
 	hkl_geometry_list_add(list, g);
 
-	hkl_geometry_set_values_v(g, 3,
+	hkl_geometry_set_values_v(g, HKL_UNIT_DEFAULT, NULL,
 				  180. * HKL_DEGTORAD,
 				  180.* HKL_DEGTORAD,
 				  180.* HKL_DEGTORAD);
 	hkl_geometry_list_add(list, g);
 
-	is_int(3, darray_size(list->items), __func__);
+	is_int(3, hkl_geometry_list_n_items_get(list), __func__);
 	hkl_geometry_list_remove_invalid(list);
-	is_int(2, darray_size(list->items), __func__);
+	is_int(2, hkl_geometry_list_n_items_get(list), __func__);
 
 	hkl_geometry_free(g);
 	hkl_geometry_list_free(list);
@@ -320,15 +409,16 @@ static void  list_remove_invalid(void)
 
 int main(int argc, char** argv)
 {
-	plan(32);
+	plan(60);
 
 	add_holder();
 	get_axis();
 	update();
-	set_values();
-	set_values_unit();
+	set();
+	axis_values_get_set();
 	distance();
 	is_valid();
+	wavelength();
 
 	list();
 	list_multiply_from_range();
diff --git a/tests/hkl-interval-t.c b/tests/hkl-interval-t.c
index 957a006..c9c89b3 100644
--- a/tests/hkl-interval-t.c
+++ b/tests/hkl-interval-t.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -33,7 +33,7 @@ static void cmp(void)
 	HklInterval interval;
 
 	interval = interval_ref;
-	ok(HKL_TRUE == hkl_interval_cmp(&interval_ref, &interval), __func__);
+	ok(TRUE == hkl_interval_cmp(&interval_ref, &interval), __func__);
 }
 
 static void plus_interval(void)
@@ -43,7 +43,7 @@ static void plus_interval(void)
 	HklInterval i2 = {-1, 4};
 
 	hkl_interval_plus_interval(&i1, &i2);
-	ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i1), __func__);
+	ok(TRUE == hkl_interval_cmp(&i_ref, &i1), __func__);
 }
 
 static void plus_double(void)
@@ -52,7 +52,7 @@ static void plus_double(void)
 	HklInterval i1 = {-2, 8};
 
 	hkl_interval_plus_double(&i1, 1);
-	ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i1), __func__);
+	ok(TRUE == hkl_interval_cmp(&i_ref, &i1), __func__);
 }
 
 static void times_interval(void)
@@ -62,7 +62,7 @@ static void times_interval(void)
 	HklInterval i2 = {-1, 4};
 
 	hkl_interval_times_interval(&i1, &i2);
-	ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i1), __func__);
+	ok(TRUE == hkl_interval_cmp(&i_ref, &i1), __func__);
 }
 
 static void times_double(void)
@@ -71,7 +71,7 @@ static void times_double(void)
 	HklInterval i1 = {-9, 36};
 
 	hkl_interval_times_double(&i1, -3);
-	ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i1), __func__);
+	ok(TRUE == hkl_interval_cmp(&i_ref, &i1), __func__);
 }
 
 static void divides_double(void)
@@ -80,7 +80,7 @@ static void divides_double(void)
 	HklInterval i1 = {-108, 27};
 
 	hkl_interval_divides_double(&i1, -3);
-	ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i1), __func__);
+	ok(TRUE == hkl_interval_cmp(&i_ref, &i1), __func__);
 }
 
 static void contain_zero(void)
@@ -88,8 +88,8 @@ static void contain_zero(void)
 	HklInterval i1 = {-9, 36};
 	HklInterval i2 = {-108, -27};
 
-	ok(HKL_TRUE == hkl_interval_contain_zero(&i1), __func__);
-	ok(HKL_FALSE == hkl_interval_contain_zero(&i2), __func__);
+	ok(TRUE == hkl_interval_contain_zero(&i1), __func__);
+	ok(FALSE == hkl_interval_contain_zero(&i2), __func__);
 }
 
 static void cosinus(void)
@@ -111,7 +111,7 @@ static void cosinus(void)
 		i_ref.min = min_ref;					\
 		i_ref.max = max_ref;					\
 		hkl_interval_cos(&i);					\
-		ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i), __func__);	\
+		ok(TRUE == hkl_interval_cmp(&i_ref, &i), __func__);	\
 	} while(0)
 
 	/* 1st max(0) */
@@ -166,7 +166,7 @@ static void acosinus(void)
 	HklInterval i = {-.5, .5};
 
 	hkl_interval_acos(&i);
-	ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i), __func__);
+	ok(TRUE == hkl_interval_cmp(&i_ref, &i), __func__);
 }
 
 static void sinus(void)
@@ -187,7 +187,7 @@ static void sinus(void)
 		i_ref.min = min_ref;					\
 		i_ref.max = max_ref;					\
 		hkl_interval_sin(&i);					\
-		ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i), __func__);	\
+		ok(TRUE == hkl_interval_cmp(&i_ref, &i), __func__);	\
 	} while(0)
 
 	/* 1st max(0) */
@@ -245,7 +245,7 @@ static void asinus(void)
 	HklInterval i = {-.5, .5};
 
 	hkl_interval_asin(&i);
-	ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i), __func__);
+	ok(TRUE == hkl_interval_cmp(&i_ref, &i), __func__);
 }
 
 static void tangeante(void)
@@ -260,7 +260,7 @@ static void tangeante(void)
 		i_ref.min = min_ref;					\
 		i_ref.max = max_ref;					\
 		hkl_interval_tan(&i);					\
-		ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i), __func__);	\
+		ok(TRUE == hkl_interval_cmp(&i_ref, &i), __func__);	\
 	} while(0)
 
 	TAN(-100, -89, -INFINITY, INFINITY);
@@ -279,7 +279,7 @@ static void atangeante(void)
 	HklInterval i = {-10, 10};
 
 	hkl_interval_atan(&i);
-	ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i), __func__);
+	ok(TRUE == hkl_interval_cmp(&i_ref, &i), __func__);
 }
 
 static void length(void)
diff --git a/tests/hkl-lattice-t.c b/tests/hkl-lattice-t.c
index 6c2a4d6..da2ae26 100644
--- a/tests/hkl-lattice-t.c
+++ b/tests/hkl-lattice-t.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,47 +22,102 @@
 #include "hkl.h"
 #include <tap/basic.h>
 #include <tap/float.h>
+#include <tap/hkl-tap.h>
+
+#define CHECK_PARAM(_lattice, _param, _value)				\
+	is_double(_value,						\
+		  hkl_parameter_value_get(hkl_lattice_## _param ##_get(_lattice), \
+					  HKL_UNIT_DEFAULT),		\
+		  HKL_EPSILON, __func__);
+
+#define CHECK_LATTICE(_lattice, _a, _b, _c, _alpha, _beta, _gamma) do {	\
+		CHECK_PARAM(_lattice, a, _a);				\
+		CHECK_PARAM(_lattice, b, _b);				\
+		CHECK_PARAM(_lattice, c, _c);				\
+		CHECK_PARAM(_lattice, alpha, _alpha);			\
+		CHECK_PARAM(_lattice, beta, _beta);			\
+		CHECK_PARAM(_lattice, gamma, _gamma);			\
+	}while(0)
+
+#define SET_PARAM(_lattice, _param, _value) do {			\
+		GError *error;						\
+		HklParameter *p = hkl_parameter_new_copy(hkl_lattice_ ## _param ## _get(_lattice)); \
+		ok(hkl_parameter_value_set(p, _value, HKL_UNIT_DEFAULT, NULL), __func__); \
+		ok(TRUE == hkl_lattice_ ## _param ## _set(_lattice, p, NULL), __func__); \
+		error = NULL;						\
+		ok(TRUE == hkl_lattice_ ## _param ## _set(_lattice, p, &error), __func__); \
+		ok(error == NULL, __func__);				\
+		hkl_parameter_free(p);					\
+	}while(0)
+				\
+#define SET_LATTICE(_lattice, _a, _b, _c, _alpha, _beta, _gamma) do{	\
+		SET_PARAM(_lattice, a, _a);				\
+		SET_PARAM(_lattice, b, _b);				\
+		SET_PARAM(_lattice, c, _c);				\
+		SET_PARAM(_lattice, alpha, _alpha);			\
+		SET_PARAM(_lattice, beta, _beta);			\
+		SET_PARAM(_lattice, gamma, _gamma);			\
+	}while(0)
 
 static void new(void)
 {
 	HklLattice *lattice;
+	GError *error;
 
 	/* can not set this lattice */
 	lattice = hkl_lattice_new(1.54, 1.54, 1.54,
-				  90*HKL_DEGTORAD, 10*HKL_DEGTORAD, 120*HKL_DEGTORAD);
+				  90*HKL_DEGTORAD, 10*HKL_DEGTORAD, 120*HKL_DEGTORAD,
+				  NULL);
 	ok(NULL == lattice, __func__);
 
+	/* check GError generation */
+	error = NULL;
+	lattice = hkl_lattice_new(1.54, 1.54, 1.54,
+				  90*HKL_DEGTORAD, 10*HKL_DEGTORAD, 120*HKL_DEGTORAD,
+				  &error);
+	ok(NULL == lattice, __func__);
+	ok(error != NULL, __func__);
+	g_clear_error(&error);
+
 	/* but can create this one */
 	lattice = hkl_lattice_new(1.54, 1.54, 1.54,
-				  90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD);
+				  90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD,
+				  NULL);
+	ok(0 == !lattice, __func__);
+
+	CHECK_LATTICE(lattice,
+		      1.54, 1.54, 1.54,
+		      90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD);
+
+	/* but can create this one and no GError are produce */
+	lattice = hkl_lattice_new(1.54, 1.54, 1.54,
+				  90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD,
+				  &error);
 	ok(0 == !lattice, __func__);
+	ok(error == NULL, __func__);
+
+	CHECK_LATTICE(lattice,
+		      1.54, 1.54, 1.54,
+		      90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD);
 
-	is_double(1.54, hkl_parameter_value_get(hkl_lattice_a_get(lattice)), HKL_EPSILON, __func__);
-	is_double(1.54, hkl_parameter_value_get(hkl_lattice_b_get(lattice)), HKL_EPSILON, __func__);
-	is_double(1.54, hkl_parameter_value_get(hkl_lattice_c_get(lattice)), HKL_EPSILON, __func__);
-	is_double(90*HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_alpha_get(lattice)), HKL_EPSILON, __func__);
-	is_double(90*HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_beta_get(lattice)), HKL_EPSILON, __func__);
-	is_double(90*HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_gamma_get(lattice)), HKL_EPSILON, __func__);
 	hkl_lattice_free(lattice);
 }
 
-static void  new_copy(void )
+static void new_copy(void)
 {
 	HklLattice *lattice;
 	HklLattice *copy;
 
 	lattice = hkl_lattice_new(1.54, 1.54, 1.54,
-				  90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD);
+				  90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD,
+				  NULL);
 
 	/* copy constructor */
 	copy = hkl_lattice_new_copy(lattice);
 
-	is_double(1.54, hkl_parameter_value_get(hkl_lattice_a_get(copy)), HKL_EPSILON, __func__);
-	is_double(1.54, hkl_parameter_value_get(hkl_lattice_b_get(copy)), HKL_EPSILON, __func__);
-	is_double(1.54, hkl_parameter_value_get(hkl_lattice_c_get(copy)), HKL_EPSILON, __func__);
-	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_alpha_get(copy)), HKL_EPSILON, __func__);
-	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_beta_get(copy)), HKL_EPSILON, __func__);
-	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_gamma_get(copy)), HKL_EPSILON, __func__);
+	CHECK_LATTICE(copy,
+		      1.54, 1.54, 1.54,
+		      90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD);
 
 	hkl_lattice_free(lattice);
 	hkl_lattice_free(copy);
@@ -71,24 +126,76 @@ static void  new_copy(void )
 static void set(void)
 {
 	HklLattice *lattice;
+	GError *error;
 
-	/* can not set this lattice */
 	lattice = hkl_lattice_new_default();
 
-	/* but can create this one */
-	hkl_lattice_set(lattice, 1.54, 1.54, 1.54,
-			90*HKL_DEGTORAD, 91*HKL_DEGTORAD, 92*HKL_DEGTORAD);
-
-	is_double(1.54, hkl_parameter_value_get(hkl_lattice_a_get(lattice)), HKL_EPSILON, __func__);
-	is_double(1.54, hkl_parameter_value_get(hkl_lattice_b_get(lattice)), HKL_EPSILON, __func__);
-	is_double(1.54, hkl_parameter_value_get(hkl_lattice_c_get(lattice)), HKL_EPSILON, __func__);
-	is_double(90*HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_alpha_get(lattice)), HKL_EPSILON, __func__);
-	is_double(91*HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_beta_get(lattice)), HKL_EPSILON, __func__);
-	is_double(92*HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_gamma_get(lattice)), HKL_EPSILON, __func__);
+	/* can not set this lattice */
+	ok(FALSE == hkl_lattice_set(lattice,
+				    1.54, 1.54, 1.54,
+				    90*HKL_DEGTORAD, 10*HKL_DEGTORAD, 120*HKL_DEGTORAD,
+				    HKL_UNIT_DEFAULT, NULL),
+	   __func__);
+
+	/* can not set this lattice with GError */
+	error = NULL;
+	ok(FALSE == hkl_lattice_set(lattice,
+				    1.54, 1.54, 1.54,
+				    90*HKL_DEGTORAD, 10*HKL_DEGTORAD, 120*HKL_DEGTORAD,
+				    HKL_UNIT_DEFAULT, &error),
+	   __func__);
+	ok(error != NULL, __func__);
+	g_clear_error(&error);
+
+	/* can set this lattice */
+	ok(TRUE == hkl_lattice_set(lattice,
+				   1.54, 1.54, 1.54,
+				   90*HKL_DEGTORAD, 91*HKL_DEGTORAD, 92*HKL_DEGTORAD,
+				   HKL_UNIT_DEFAULT, NULL),
+	   __func__);
+	CHECK_LATTICE(lattice,
+		      1.54, 1.54, 1.54,
+		      90*HKL_DEGTORAD, 91*HKL_DEGTORAD, 92*HKL_DEGTORAD);
+
+	/* can set this lattice with no GError set */
+	ok(TRUE == hkl_lattice_set(lattice,
+				   1.54, 1.54, 1.54,
+				   90*HKL_DEGTORAD, 91*HKL_DEGTORAD, 90*HKL_DEGTORAD,
+				   HKL_UNIT_DEFAULT, &error),
+	   __func__);
+	ok(error == NULL, __func__);
+	CHECK_LATTICE(lattice,
+		      1.54, 1.54, 1.54,
+		      90*HKL_DEGTORAD, 91*HKL_DEGTORAD, 90*HKL_DEGTORAD);
+
+
+
+	/* can set this lattice in HKL_UNIT_USER with no GError set */
+	ok(TRUE == hkl_lattice_set(lattice, 1.54, 1.54, 1.54, 90, 91, 92,
+				   HKL_UNIT_USER, NULL),
+	   __func__);
+	CHECK_LATTICE(lattice,
+		      1.54, 1.54, 1.54,
+		      90*HKL_DEGTORAD, 91*HKL_DEGTORAD, 92*HKL_DEGTORAD);
+
+	/* can set this lattice in HKL_UNIT_USER with no GError set */
+	ok(TRUE == hkl_lattice_set(lattice,
+				   1.54, 1.54, 1.54, 90, 91, 90,
+				   HKL_UNIT_USER, &error),
+	   __func__);
+	ok(error == NULL, __func__);
+	CHECK_LATTICE(lattice,
+		      1.54, 1.54, 1.54,
+		      90*HKL_DEGTORAD, 91*HKL_DEGTORAD, 90*HKL_DEGTORAD);
+
+	/* check individual accessor */
+	SET_LATTICE(lattice, 1.54, 1.54, 1.54, 90*HKL_DEGTORAD, 91 * HKL_DEGTORAD, 91 * HKL_DEGTORAD);
+	CHECK_LATTICE(lattice, 1.54, 1.54, 1.54, 90*HKL_DEGTORAD, 91 * HKL_DEGTORAD, 91 * HKL_DEGTORAD);
+
 	hkl_lattice_free(lattice);
 }
 
-static void  reciprocal(void )
+static void reciprocal(void)
 {
 	HklLattice *lattice;
 	HklLattice *reciprocal;
@@ -97,78 +204,79 @@ static void  reciprocal(void )
 	reciprocal = hkl_lattice_new_default();
 
 	/* cubic */
-	hkl_lattice_set(lattice, 1.54, 1.54, 1.54,
-			90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD);
+	ok(TRUE == hkl_lattice_set(lattice, 1.54, 1.54, 1.54,
+				   90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD,
+				   HKL_UNIT_DEFAULT, NULL),
+	   __func__);
 
-	ok(HKL_TRUE == hkl_lattice_reciprocal(lattice, reciprocal), __func__);
+	ok(TRUE == hkl_lattice_reciprocal(lattice, reciprocal), __func__);
 
-	is_double(HKL_TAU / 1.54, hkl_parameter_value_get(hkl_lattice_a_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(HKL_TAU / 1.54, hkl_parameter_value_get(hkl_lattice_b_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(HKL_TAU / 1.54, hkl_parameter_value_get(hkl_lattice_c_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_alpha_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_beta_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_gamma_get(reciprocal)), HKL_EPSILON, __func__);
+	CHECK_LATTICE(reciprocal,
+		      HKL_TAU / 1.54, HKL_TAU / 1.54, HKL_TAU / 1.54,
+		      90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD);
 
 	/* orthorombic */
-	hkl_lattice_set(lattice, 1., 3., 4., 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD);
-	ok(HKL_TRUE == hkl_lattice_reciprocal(lattice, reciprocal), __func__);
+	ok(TRUE == hkl_lattice_set(lattice,
+				   1., 3., 4.,
+				   90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD,
+				   HKL_UNIT_DEFAULT, NULL),
+	   __func__);
+	ok(TRUE == hkl_lattice_reciprocal(lattice, reciprocal), __func__);
 
-	is_double(HKL_TAU / 1., hkl_parameter_value_get(hkl_lattice_a_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(HKL_TAU / 3., hkl_parameter_value_get(hkl_lattice_b_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(HKL_TAU / 4., hkl_parameter_value_get(hkl_lattice_c_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_alpha_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_beta_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_gamma_get(reciprocal)), HKL_EPSILON, __func__);
+	CHECK_LATTICE(reciprocal,
+		      HKL_TAU / 1., HKL_TAU / 3., HKL_TAU / 4.,
+		      90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD);
 
 	/* hexagonal1 */
-	hkl_lattice_set(lattice, 1., 2., 1., 90 * HKL_DEGTORAD, 120 * HKL_DEGTORAD, 90 * HKL_DEGTORAD);
-	ok(HKL_TRUE == hkl_lattice_reciprocal(lattice, reciprocal), __func__);
+	ok(TRUE == hkl_lattice_set(lattice,
+				   1., 2., 1.,
+				   90 * HKL_DEGTORAD, 120 * HKL_DEGTORAD, 90 * HKL_DEGTORAD,
+				   HKL_UNIT_DEFAULT, NULL),
+	   __func__);
+	ok(TRUE == hkl_lattice_reciprocal(lattice, reciprocal), __func__);
 
-	is_double(HKL_TAU * 2. / sqrt(3.), hkl_parameter_value_get(hkl_lattice_a_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(HKL_TAU / 2., hkl_parameter_value_get(hkl_lattice_b_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(HKL_TAU * 2. / sqrt(3.), hkl_parameter_value_get(hkl_lattice_c_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_alpha_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(60. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_beta_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_gamma_get(reciprocal)), HKL_EPSILON, __func__);
+	CHECK_LATTICE(reciprocal,
+		      HKL_TAU * 2. / sqrt(3.), HKL_TAU / 2., HKL_TAU * 2. / sqrt(3.),
+		      90. * HKL_DEGTORAD, 60. * HKL_DEGTORAD, 90. * HKL_DEGTORAD);
 
 	/* hexagonal2 */
-	hkl_lattice_set(lattice, 2., 1., 1., 120 * HKL_DEGTORAD, 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD);
-	ok(HKL_TRUE == hkl_lattice_reciprocal(lattice, reciprocal), __func__);
+	ok(TRUE == hkl_lattice_set(lattice, 2., 1., 1.,
+				   120 * HKL_DEGTORAD, 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD,
+				   HKL_UNIT_DEFAULT, NULL),
+	   __func__);
+	ok(TRUE == hkl_lattice_reciprocal(lattice, reciprocal), __func__);
 
-	is_double(HKL_TAU / 2., hkl_parameter_value_get(hkl_lattice_a_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(HKL_TAU * 2. / sqrt(3.), hkl_parameter_value_get(hkl_lattice_b_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(HKL_TAU * 2. / sqrt(3.), hkl_parameter_value_get(hkl_lattice_c_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(60. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_alpha_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_beta_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_gamma_get(reciprocal)), HKL_EPSILON, __func__);
+	CHECK_LATTICE(reciprocal,
+		      HKL_TAU / 2., HKL_TAU * 2. / sqrt(3.), HKL_TAU * 2. / sqrt(3.),
+		      60. * HKL_DEGTORAD, 90. * HKL_DEGTORAD, 90. * HKL_DEGTORAD);
 
 	/* triclinic1 */
-	hkl_lattice_set(lattice, 9.32, 8.24, 13.78, 91.23 * HKL_DEGTORAD, 93.64 * HKL_DEGTORAD, 122.21 * HKL_DEGTORAD);
-	ok(HKL_TRUE == hkl_lattice_reciprocal(lattice, reciprocal), __func__);
+	ok(TRUE == hkl_lattice_set(lattice, 9.32, 8.24, 13.78,
+				   91.23 * HKL_DEGTORAD, 93.64 * HKL_DEGTORAD, 122.21 * HKL_DEGTORAD,
+				   HKL_UNIT_DEFAULT, NULL),
+	   __func__);
+	ok(TRUE == hkl_lattice_reciprocal(lattice, reciprocal), __func__);
 
-	is_double(HKL_TAU * 0.1273130168, hkl_parameter_value_get(hkl_lattice_a_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(HKL_TAU * 0.1437422974, hkl_parameter_value_get(hkl_lattice_b_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(HKL_TAU * 0.0728721120, hkl_parameter_value_get(hkl_lattice_c_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(1.5052513337, hkl_parameter_value_get(hkl_lattice_alpha_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(1.482101482, hkl_parameter_value_get(hkl_lattice_beta_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(1.0055896011, hkl_parameter_value_get(hkl_lattice_gamma_get(reciprocal)), HKL_EPSILON, __func__);
+	CHECK_LATTICE(reciprocal,
+		      HKL_TAU * 0.1273130168,HKL_TAU * 0.1437422974,HKL_TAU * 0.0728721120,
+		      1.5052513337, 1.482101482, 1.0055896011);
 
 	/* triclinic2 */
-	hkl_lattice_set(lattice, 18.423, 18.417, 18.457, 89.99 * HKL_DEGTORAD, 89.963 * HKL_DEGTORAD, 119.99 * HKL_DEGTORAD);
-	ok(HKL_TRUE == hkl_lattice_reciprocal(lattice, reciprocal), __func__);
+	ok(TRUE == hkl_lattice_set(lattice, 18.423, 18.417,
+				   18.457, 89.99 * HKL_DEGTORAD, 89.963 * HKL_DEGTORAD, 119.99 * HKL_DEGTORAD,
+				   HKL_UNIT_DEFAULT, NULL),
+	   __func__);
+	ok(TRUE == hkl_lattice_reciprocal(lattice, reciprocal), __func__);
 
-	is_double(HKL_TAU * 0.0626708259, hkl_parameter_value_get(hkl_lattice_a_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(HKL_TAU * 0.0626912310, hkl_parameter_value_get(hkl_lattice_b_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(HKL_TAU * 0.0541800061, hkl_parameter_value_get(hkl_lattice_c_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(1.5713705262, hkl_parameter_value_get(hkl_lattice_alpha_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(1.5716426508, hkl_parameter_value_get(hkl_lattice_beta_get(reciprocal)), HKL_EPSILON, __func__);
-	is_double(1.0473718249, hkl_parameter_value_get(hkl_lattice_gamma_get(reciprocal)), HKL_EPSILON, __func__);
+	CHECK_LATTICE(reciprocal,
+		      HKL_TAU * 0.0626708259,HKL_TAU * 0.0626912310,HKL_TAU * 0.0541800061,
+		      1.5713705262, 1.5716426508, 1.0473718249);
 
 	hkl_lattice_free(lattice);
 	hkl_lattice_free(reciprocal);
 }
 
-static void  get_B(void )
+static void get_B(void)
 {
 	HklMatrix *B_ref = hkl_matrix_new_full(HKL_TAU / 1.54, 0, 0,
 					       0, HKL_TAU / 1.54, 0,
@@ -177,17 +285,19 @@ static void  get_B(void )
 	HklMatrix *B = hkl_matrix_new();
 
 	/* cubic */
-	lattice = hkl_lattice_new(1.54, 1.54, 1.54, 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD);
+	lattice = hkl_lattice_new(1.54, 1.54, 1.54,
+				  90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD,
+				  NULL);
 
 	hkl_lattice_get_B(lattice, B);
-	ok(HKL_TRUE == hkl_matrix_cmp(B_ref, B), __func__);
+	is_matrix(B_ref, B, __func__);
 
 	hkl_lattice_free(lattice);
 	hkl_matrix_free(B);
 	hkl_matrix_free(B_ref);
 }
 
-static void  get_1_B(void )
+static void get_1_B(void)
 {
 	HklMatrix *I_ref = hkl_matrix_new_full(1, 0, 0,
 					       0, 1, 0,
@@ -198,14 +308,15 @@ static void  get_1_B(void )
 
 	/* cubic */
 	lattice = hkl_lattice_new(1.54, 1.54, 1.54,
-				  90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD);
+				  90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD,
+				  NULL);
 
 	hkl_lattice_get_B(lattice, I);
 	hkl_lattice_get_1_B(lattice, B_1);
 
 	/* B times B^-1 = Identity */
 	hkl_matrix_times_matrix(I, B_1);
-	ok(HKL_TRUE == hkl_matrix_cmp(I_ref, I), __func__);
+	is_matrix(I_ref, I, __func__);
 
 	hkl_lattice_free(lattice);
 	hkl_matrix_free(B_1);
@@ -215,7 +326,7 @@ static void  get_1_B(void )
 
 int main(int argc, char** argv)
 {
-	plan(64);
+	plan(137);
 
 	new();
 	new_copy();
diff --git a/tests/hkl-matrix-t.c b/tests/hkl-matrix-t.c
index 8ef01bb..fc66070 100644
--- a/tests/hkl-matrix-t.c
+++ b/tests/hkl-matrix-t.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -51,8 +51,8 @@ static void cmp(void)
 			 {3.0, 4.0, 5.0},
 			 {6.0, 7.0, 8.0}}};
 
-	ok(HKL_TRUE == hkl_matrix_cmp(&m1, &m1), __func__);
-	ok(HKL_FALSE == hkl_matrix_cmp(&m1, &m2), __func__);
+	ok(TRUE == hkl_matrix_cmp(&m1, &m1), __func__);
+	ok(FALSE == hkl_matrix_cmp(&m1, &m2), __func__);
 }
 
 static void assignement(void)
@@ -63,7 +63,7 @@ static void assignement(void)
 	HklMatrix m;
 
 	m = m1;
-	ok(HKL_TRUE == hkl_matrix_cmp(&m1, &m), __func__);
+	ok(TRUE == hkl_matrix_cmp(&m1, &m), __func__);
 }
 
 static void init_from_euler(void)
@@ -74,7 +74,7 @@ static void init_from_euler(void)
 	HklMatrix m;
 
 	hkl_matrix_init_from_euler(&m, 45.*HKL_DEGTORAD, 45.*HKL_DEGTORAD, 45.*HKL_DEGTORAD);
-	ok(HKL_TRUE == hkl_matrix_cmp(&m_ref, &m), __func__);
+	ok(TRUE == hkl_matrix_cmp(&m_ref, &m), __func__);
 }
 
 static void init_from_two_vector(void)
@@ -88,7 +88,7 @@ static void init_from_two_vector(void)
 	HklMatrix m;
 
 	hkl_matrix_init_from_two_vector(&m, &v1, &v2);
-	ok(HKL_TRUE == hkl_matrix_cmp(&m_ref, &m), __func__);
+	ok(TRUE == hkl_matrix_cmp(&m_ref, &m), __func__);
 }
 
 static void times_vector(void)
@@ -117,7 +117,7 @@ static void times_matrix(void)
 	};
 
 	hkl_matrix_times_matrix(&m, &m);
-	ok(HKL_TRUE == hkl_matrix_cmp(&m_ref, &m), __func__);
+	ok(TRUE == hkl_matrix_cmp(&m_ref, &m), __func__);
 }
 
 static void transpose(void)
@@ -133,7 +133,7 @@ static void transpose(void)
 	};
 
 	hkl_matrix_transpose(&m);
-	ok(HKL_TRUE == hkl_matrix_cmp(&m_ref, &m), __func__);
+	ok(TRUE == hkl_matrix_cmp(&m_ref, &m), __func__);
 }
 
 int main(int argc, char** argv)
diff --git a/tests/hkl-parameter-t.c b/tests/hkl-parameter-t.c
index 332bb7f..e9b2337 100644
--- a/tests/hkl-parameter-t.c
+++ b/tests/hkl-parameter-t.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -29,32 +29,32 @@ static void new(void)
 {
 	HklParameter *p;
 
-	ok(NULL == hkl_parameter_new("", 2, 1, 3,
-				     HKL_FALSE, HKL_TRUE,
+	ok(NULL == hkl_parameter_new("", "", 2, 1, 3,
+				     FALSE, TRUE,
 				     &hkl_unit_angle_rad, &hkl_unit_angle_deg), __func__);
-	ok(NULL == hkl_parameter_new("", 2, 1, 3,
-				     HKL_FALSE, HKL_TRUE,
+	ok(NULL == hkl_parameter_new("", "", 2, 1, 3,
+				     FALSE, TRUE,
 				     &hkl_unit_angle_rad, &hkl_unit_angle_deg), __func__);
-	ok(NULL == hkl_parameter_new("", 2, 1, 3,
-				     HKL_FALSE, HKL_TRUE,
+	ok(NULL == hkl_parameter_new("", "", 2, 1, 3,
+				     FALSE, TRUE,
 				     &hkl_unit_angle_rad, &hkl_unit_angle_deg), __func__);
-	ok(NULL == hkl_parameter_new("toto", 2, 1, 3,
-				     HKL_FALSE, HKL_TRUE,
+	ok(NULL == hkl_parameter_new("toto", "", 2, 1, 3,
+				     FALSE, TRUE,
 				     &hkl_unit_angle_rad, &hkl_unit_angle_deg), __func__);
 
-	ok(NULL == hkl_parameter_new("toto", 1, 2, 3,
-				     HKL_FALSE, HKL_TRUE,
+	ok(NULL == hkl_parameter_new("toto", "", 1, 2, 3,
+				     FALSE, TRUE,
 				     &hkl_unit_angle_rad, &hkl_unit_length_nm), __func__);
 
-	p = hkl_parameter_new("toto", 1, 2, 3,
-			      HKL_FALSE, HKL_TRUE,
+	p = hkl_parameter_new("toto", "no description", 1, 2, 3,
+			      FALSE, TRUE,
 			      &hkl_unit_angle_rad, &hkl_unit_angle_deg);
 	ok(0 == !p, __func__);
 	is_double(1., p->range.min, HKL_EPSILON, __func__);
 	is_double(2., p->_value, HKL_EPSILON, __func__);
 	is_double(3., p->range.max, HKL_EPSILON, __func__);
-	ok(HKL_FALSE == p->fit, __func__);
-	ok(HKL_TRUE == p->changed, __func__);
+	ok(FALSE == p->fit, __func__);
+	ok(TRUE == p->changed, __func__);
 	ok(&hkl_unit_angle_rad == p->unit, __func__);
 	ok(&hkl_unit_angle_deg == p->punit, __func__);
 
@@ -65,13 +65,14 @@ static void new_copy(void)
 {
 	HklParameter *copy, *p;
 
-	p = hkl_parameter_new("toto", 1, 2, 3,
-			      HKL_FALSE, HKL_TRUE,
+	p = hkl_parameter_new("toto", "no description", 1, 2, 3,
+			      FALSE, TRUE,
 			      &hkl_unit_angle_rad, &hkl_unit_angle_deg);
 
 	copy = hkl_parameter_new_copy(p);
 
 	ok(copy->name == p->name, __func__);
+	ok(copy->description == p->description, __func__);
 	is_double(copy->range.min, p->range.min, HKL_EPSILON, __func__);
 	is_double(copy->_value, p->_value, HKL_EPSILON, __func__);
 	is_double(copy->range.max, p->range.max, HKL_EPSILON, __func__);
@@ -88,23 +89,23 @@ static void init(void)
 {
 	HklParameter *p;
 
-	ok(NULL == hkl_parameter_new("", 2, 1, 3,
-				     HKL_FALSE, HKL_TRUE,
+	ok(NULL == hkl_parameter_new("", "no description", 2, 1, 3,
+				     FALSE, TRUE,
 				     &hkl_unit_angle_rad, &hkl_unit_angle_deg), __func__);
-	ok(NULL == hkl_parameter_new("", 2, 1, 3,
-				     HKL_FALSE, HKL_TRUE,
+	ok(NULL == hkl_parameter_new("", "no description", 2, 1, 3,
+				     FALSE, TRUE,
 				     &hkl_unit_angle_rad, &hkl_unit_angle_deg), __func__);
-	ok(NULL == hkl_parameter_new("", 2, 1, 3,
-				     HKL_FALSE, HKL_TRUE,
+	ok(NULL == hkl_parameter_new("", "no description", 2, 1, 3,
+				     FALSE, TRUE,
 				     &hkl_unit_angle_rad, &hkl_unit_angle_deg), __func__);
-	ok(NULL == hkl_parameter_new("toto", 2, 1, 3,
-				     HKL_FALSE, HKL_TRUE,
+	ok(NULL == hkl_parameter_new("toto", "no description", 2, 1, 3,
+				     FALSE, TRUE,
 				     &hkl_unit_angle_rad, &hkl_unit_angle_deg), __func__);
-	ok(NULL == hkl_parameter_new("toto", 1, 2, 3,
-				     HKL_FALSE, HKL_TRUE,
+	ok(NULL == hkl_parameter_new("toto", "no description", 1, 2, 3,
+				     FALSE, TRUE,
 				     &hkl_unit_angle_rad, &hkl_unit_length_nm), __func__);
-	p = hkl_parameter_new("toto", 1, 2, 3,
-			      HKL_FALSE, HKL_TRUE,
+	p = hkl_parameter_new("toto", "no description", 1, 2, 3,
+			      FALSE, TRUE,
 			      &hkl_unit_angle_rad, &hkl_unit_angle_deg);
 	ok(NULL != p, __func__);
 
@@ -114,26 +115,76 @@ static void init(void)
 static void is_valid(void)
 {
 	HklParameter *p;
+	GError *error;
 
-	p = hkl_parameter_new("toto", 1, 2, 3,
-			      HKL_FALSE, HKL_TRUE,
+	p = hkl_parameter_new("toto", "no description", 1, 2, 3,
+			      FALSE, TRUE,
 			      &hkl_unit_angle_rad, &hkl_unit_angle_deg);
-	ok(HKL_TRUE == hkl_parameter_is_valid(p), __func__);
+	ok(TRUE == hkl_parameter_is_valid(p), __func__);
 
-	hkl_parameter_value_set(p, 10, NULL);
-	ok(HKL_FALSE == hkl_parameter_is_valid(p), __func__);
+	error= NULL;
+	ok(TRUE == hkl_parameter_value_set(p, 10, HKL_UNIT_DEFAULT, &error), __func__);
+	ok(error == NULL, __func__);
+	ok(FALSE == hkl_parameter_is_valid(p), __func__);
+
+	hkl_parameter_free(p);
+}
+
+static void min_max(void)
+{
+	HklParameter *p;
+	double min, max;
+	GError *error;
+
+	p = hkl_parameter_new("toto", "no description", 1, 2, 3,
+			      FALSE, TRUE,
+			      &hkl_unit_angle_rad, &hkl_unit_angle_deg);
+	hkl_parameter_min_max_get(p, &min, &max, HKL_UNIT_DEFAULT);
+	is_double(1, min, HKL_EPSILON, __func__);
+	is_double(3, max, HKL_EPSILON, __func__);
+
+	ok(TRUE == hkl_parameter_min_max_set(p, 1.1, 4, HKL_UNIT_DEFAULT, NULL), __func__);
+	hkl_parameter_min_max_get(p, &min, &max, HKL_UNIT_DEFAULT);
+	is_double(1.1, min, HKL_EPSILON, __func__);
+	is_double(4, max, HKL_EPSILON, __func__);
+
+	error = NULL;
+	ok(FALSE == hkl_parameter_min_max_set(p, 4, 1, HKL_UNIT_DEFAULT, &error), __func__);
+	ok(error != NULL, __func__);
+	g_clear_error(&error);
+
+	/* nothing should have changed */
+	hkl_parameter_min_max_get(p, &min, &max, HKL_UNIT_DEFAULT);
+	is_double(1.1, min, HKL_EPSILON, __func__);
+	is_double(4, max, HKL_EPSILON, __func__);
+
+	hkl_parameter_free(p);
+}
+
+static void getter(void)
+{
+	HklParameter *p;
+
+	p = hkl_parameter_new("toto", "no description", 1, 2, 3,
+			      FALSE, TRUE,
+			      &hkl_unit_angle_rad, &hkl_unit_angle_deg);
+
+	ok(NULL == hkl_parameter_axis_v_get(p), __func__);
+	ok(NULL == hkl_parameter_quaternion_get(p), __func__);
+	ok(NULL != hkl_parameter_description_get(p), __func__);
 
 	hkl_parameter_free(p);
 }
 
 int main(int argc, char** argv)
 {
-	plan(29);
+	plan(44);
 
 	new();
 	new_copy();
 	init();
 	is_valid();
-
+	min_max();
+	getter();
 	return 0;
 }
diff --git a/tests/hkl-pseudoaxis-e4ch-t.c b/tests/hkl-pseudoaxis-e4ch-t.c
index fdee7b4..7e01e01 100644
--- a/tests/hkl-pseudoaxis-e4ch-t.c
+++ b/tests/hkl-pseudoaxis-e4ch-t.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -26,7 +26,7 @@
 
 static void getter(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
 	const HklFactory *factory;
@@ -34,40 +34,34 @@ static void getter(void)
 	HklDetector *detector;
 	HklSample *sample;
 
-	factory = hkl_factory_get_by_name("E4CH");
+	factory = hkl_factory_get_by_name("E4CH", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
 
-	engine = hkl_engine_list_get_by_name(engines, "hkl");
+	engine = hkl_engine_list_engine_get_by_name(engines, "hkl", NULL);
 
 	/* geometry -> pseudo */
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
-	hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, 0., 1., 0.);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., 0., 60.);
+	res &= DIAG(check_pseudoaxes_v(engine, 0., 1., 0.));
 
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., 90., 60.);
-	hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, 1., 0., 0.);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., 90., 60.);
+	res &= DIAG(check_pseudoaxes_v(engine, 1., 0., 0.));
 
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., -90., 60.);
-	hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, -1., 0., 0.);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., -90., 60.);
+	res &= DIAG(check_pseudoaxes_v(engine, -1., 0., 0.));
 
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., 180., 60.);
-	hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, 0., -1., 0.);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., 180., 60.);
+	res &= DIAG(check_pseudoaxes_v(engine, 0., -1., 0.));
 
-	hkl_geometry_set_values_unit_v(geometry, 45., 0., 135., 90.);
-	hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, 1., -1., 0.);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 45., 0., 135., 90.);
+	res &= DIAG(check_pseudoaxes_v(engine, 1., -1., 0.));
 
-	ok(res == HKL_TRUE, "getter");
+	ok(res == TRUE, "getter");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
@@ -77,61 +71,61 @@ static void getter(void)
 
 static void degenerated(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
-	HklMode **mode;
-	darray_mode *modes;
+	const char **mode;
+	const darray_string *modes;
 	const HklFactory *factory;
 	HklGeometry *geometry;
-	const HklGeometryList *geometries;
 	HklDetector *detector;
 	HklSample *sample;
-	HklParameterList *pseudo_axes;
 
-	factory = hkl_factory_get_by_name("E4CH");
+	factory = hkl_factory_get_by_name("E4CH", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
-	geometries = hkl_engine_list_geometries(engines);
 
-	engine = hkl_engine_list_get_by_name(engines, "hkl");
-	modes = hkl_engine_modes(engine);
-	pseudo_axes = hkl_engine_pseudo_axes(engine);
+	engine = hkl_engine_list_engine_get_by_name(engines, "hkl", NULL);
+	modes = hkl_engine_modes_names_get(engine);
 
 	darray_foreach(mode, *modes){
 		static double values[] = {0, 0, 1};
-		darray_parameter *parameters;
-
-		hkl_engine_select_mode(engine, *mode);
-		parameters = hkl_mode_parameters(*mode);
-		if (darray_size(*parameters))
-			hkl_parameter_value_set(darray_item(*parameters, 0), 0, NULL);
+		const darray_string *parameters;
+		HklGeometryList *geometries;
+		size_t n_params;
+
+		hkl_engine_current_mode_set(engine, *mode, NULL);
+		parameters = hkl_engine_parameters_names_get(engine);
+		n_params = darray_size(*parameters);
+		if (n_params){
+			double params[n_params];
+
+			hkl_engine_parameters_values_get(engine, params, n_params, HKL_UNIT_DEFAULT);
+			values[0] = 0;
+			hkl_engine_parameters_values_set(engine, params, n_params, HKL_UNIT_DEFAULT, NULL);
+		}
 
 		/* studdy this degenerated case */
-		hkl_parameter_list_values_set(pseudo_axes, values, 3, NULL);
-		if(hkl_engine_set(engine, NULL)){
-			const darray_item *items = hkl_geometry_list_items_get(geometries);
-			HklGeometryListItem **item;
-
-			darray_foreach(item, *items){
-				static double null[] = {0, 0, 0};
+		geometries = hkl_engine_pseudo_axis_values_set(engine, values, ARRAY_SIZE(values),
+								HKL_UNIT_DEFAULT, NULL);
+		if(geometries){
+			const HklGeometryListItem *item;
 
-				hkl_parameter_list_values_set(pseudo_axes, null, 3, NULL);
+			HKL_GEOMETRY_LIST_FOREACH(item, geometries){
 				hkl_geometry_set(geometry,
-						 hkl_geometry_list_item_geometry_get(*item));
-				hkl_engine_get(engine, NULL);
-				res &= check_pseudoaxes(engine, values, 3);
+						 hkl_geometry_list_item_geometry_get(item));
+				res &= DIAG(check_pseudoaxes(engine, values, 3));
 			}
+			hkl_geometry_list_free(geometries);
 		}
 	}
 
-	ok(res == HKL_TRUE, "degenerated");
+	ok(res == TRUE, "degenerated");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
@@ -141,7 +135,7 @@ static void degenerated(void)
 
 static void psi_getter(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
 	const HklFactory *factory;
@@ -149,58 +143,50 @@ static void psi_getter(void)
 	HklDetector *detector;
 	HklSample *sample;
 	double hkl[3];
-	HklMode *mode;
-	HklParameterList *parameters;
 
-	factory = hkl_factory_get_by_name("E4CH");
+	factory = hkl_factory_get_by_name("E4CH", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
 
-	engine = hkl_engine_list_get_by_name(engines, "psi");
-	mode = hkl_engine_mode(engine);
-	parameters = hkl_mode_parameters(mode);
+	engine = hkl_engine_list_engine_get_by_name(engines, "psi", NULL);
 
 	/* the getter part */
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
-	hkl_engine_initialize(engine, NULL);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., 0., 60.);
+	hkl_engine_initialized_set(engine, TRUE, NULL);
 
 	hkl[0] = 1, hkl[1] = 0, hkl[2] = 0;
-	hkl_parameter_list_values_set(parameters,
-				      hkl, ARRAY_SIZE(hkl), NULL);
-	res &= hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, 0.);
+	hkl_engine_parameters_values_set(engine, hkl, ARRAY_SIZE(hkl),
+					 HKL_UNIT_DEFAULT, NULL);
+	res &= DIAG(check_pseudoaxes_v(engine, 0.));
 
 	/* here Q and <h, k, l>_ref are colinear must FAIL */
 	hkl[0] = 0, hkl[1] = 1, hkl[2] = 0;
-	hkl_parameter_list_values_set(parameters,
-				      hkl, ARRAY_SIZE(hkl), NULL);
-	res &= !hkl_engine_get(engine, NULL);
+	hkl_engine_parameters_values_set(engine, hkl, ARRAY_SIZE(hkl),
+					 HKL_UNIT_DEFAULT, NULL);
+	res &= DIAG(!check_pseudoaxes_v(engine, 0.));
 
 	hkl[0] = -1, hkl[1] = 0, hkl[2] = 0;
-	hkl_parameter_list_values_set(parameters,
-				      hkl, ARRAY_SIZE(hkl), NULL);
-	res &= hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, 180. * HKL_DEGTORAD);
+	hkl_engine_parameters_values_set(engine, hkl, ARRAY_SIZE(hkl),
+					 HKL_UNIT_DEFAULT, NULL);
+	res &= DIAG(check_pseudoaxes_v(engine, 180. * HKL_DEGTORAD));
 
 	hkl[0] = 0, hkl[1] = 0, hkl[2] = -1;
-	hkl_parameter_list_values_set(parameters,
-				      hkl, ARRAY_SIZE(hkl), NULL);
-	res &= hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, 90. * HKL_DEGTORAD);
+	hkl_engine_parameters_values_set(engine, hkl, ARRAY_SIZE(hkl),
+					 HKL_UNIT_DEFAULT, NULL);
+	res &= DIAG(check_pseudoaxes_v(engine, 90. * HKL_DEGTORAD));
 
 	/* Q and <h, k, l>_ref are colinear so must FAIL */
 	hkl[0] = 0, hkl[1] = -1, hkl[2] = 0;
-	hkl_parameter_list_values_set(parameters,
-				      hkl, ARRAY_SIZE(hkl), NULL);
-	res &= !hkl_engine_get(engine, NULL);
+	hkl_engine_parameters_values_set(engine, hkl, ARRAY_SIZE(hkl),
+					 HKL_UNIT_DEFAULT, NULL);
+	res &= DIAG(!check_pseudoaxes_v(engine, 0.));
 
-	ok(res == HKL_TRUE, "psi getter");
+	ok(res == TRUE, "psi getter");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
@@ -210,66 +196,58 @@ static void psi_getter(void)
 
 static void psi_setter(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
-	HklMode **mode;
-	darray_mode *modes;
+	const darray_string *modes;
+	const char **mode;
 	const HklFactory *factory;
 	HklGeometry *geometry;
-	const HklGeometryList *geometries;
 	HklDetector *detector;
 	HklSample *sample;
 	static double hkl[] = {1, 0, 0};
-	HklParameterList *pseudo_axes;
 
-	factory = hkl_factory_get_by_name("E4CH");
+	factory = hkl_factory_get_by_name("E4CH", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
-	geometries = hkl_engine_list_geometries(engines);
 
-	engine = hkl_engine_list_get_by_name(engines, "psi");
-	modes = hkl_engine_modes(engine);
-	pseudo_axes = hkl_engine_pseudo_axes(engine);
+	engine = hkl_engine_list_engine_get_by_name(engines, "psi", NULL);
+	modes = hkl_engine_modes_names_get(engine);
 
 	/* the init part */
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
-	hkl_parameter_list_values_set(hkl_mode_parameters(hkl_engine_mode(engine)),
-				      hkl, ARRAY_SIZE(hkl), NULL);
-	hkl_engine_initialize(engine, NULL);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., 0., 60.);
+	hkl_engine_parameters_values_set(engine, hkl, ARRAY_SIZE(hkl),
+					 HKL_UNIT_DEFAULT, NULL);
+	hkl_engine_initialized_set(engine, TRUE, NULL);
 
 	darray_foreach(mode, *modes){
 		double psi;
 
-		hkl_engine_select_mode(engine, *mode);
+		hkl_engine_current_mode_set(engine, *mode, NULL);
 		for(psi=-180 * HKL_DEGTORAD;psi<180 * HKL_DEGTORAD;psi += HKL_DEGTORAD){
-			hkl_parameter_list_values_set(pseudo_axes, &psi, 1, NULL);
-			if(hkl_engine_set(engine, NULL)){
-				const darray_item *items = hkl_geometry_list_items_get(geometries);
-				HklGeometryListItem **item;
+			HklGeometryList *geometries;
 
-				darray_foreach(item, *items){
-					static double null[] = {0};
+			geometries = hkl_engine_pseudo_axis_values_set(engine, &psi, 1,
+									HKL_UNIT_DEFAULT, NULL);
+			if(geometries){
+				const HklGeometryListItem *item;
 
-					hkl_parameter_list_values_set(pseudo_axes,
-								      null, ARRAY_SIZE(null),
-								      NULL);
+				HKL_GEOMETRY_LIST_FOREACH(item, geometries){
 					hkl_geometry_set(geometry,
-							 hkl_geometry_list_item_geometry_get(*item));
-					hkl_engine_get(engine, NULL);
-					res &= check_pseudoaxes_v(engine, psi);
+							 hkl_geometry_list_item_geometry_get(item));
+					res &= DIAG(check_pseudoaxes_v(engine, psi));
 				}
+				hkl_geometry_list_free(geometries);
 			}
 		}
 	}
 
-	ok(res == HKL_TRUE, "psi setter");
+	ok(res == TRUE, "psi setter");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
@@ -280,64 +258,56 @@ static void psi_setter(void)
 
 static void q(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
-	HklMode **mode;
-	darray_mode *modes;
+	const darray_string *modes;
+	const char **mode;
 	const HklFactory *factory;
 	HklGeometry *geometry;
-	const HklGeometryList *geometries;
 	HklDetector *detector;
 	HklSample *sample;
-	HklParameterList *pseudo_axes;
 
-	factory = hkl_factory_get_by_name("E4CH");
+	factory = hkl_factory_get_by_name("E4CH", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
-	geometries = hkl_engine_list_geometries(engines);
 
-	engine = hkl_engine_list_get_by_name(engines, "q");
-	modes = hkl_engine_modes(engine);
-	pseudo_axes = hkl_engine_pseudo_axes(engine);
+	engine = hkl_engine_list_engine_get_by_name(engines, "q", NULL);
+	modes = hkl_engine_modes_names_get(engine);
 
 	/* the init part */
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
-	hkl_engine_initialize(engine, NULL);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., 0., 60.);
+	hkl_engine_initialized_set(engine, TRUE, NULL);
 
 	darray_foreach(mode, *modes){
 		double q;
 
-		hkl_engine_select_mode(engine, *mode);
+		hkl_engine_current_mode_set(engine, *mode, NULL);
 		for(q=-1.; q<1.; q += 0.1){
-			hkl_parameter_list_values_set(pseudo_axes, &q, 1, NULL);
+			HklGeometryList *geometries;
 
-			if(hkl_engine_set(engine, NULL)){
-				const darray_item *items = hkl_geometry_list_items_get(geometries);
-				HklGeometryListItem **item;
+			geometries = hkl_engine_pseudo_axis_values_set(engine, &q, 1,
+									HKL_UNIT_DEFAULT, NULL);
 
-				darray_foreach(item, *items){
-					static double null[] = {0};
-					hkl_parameter_list_values_set(pseudo_axes,
-								      null, ARRAY_SIZE(null),
-								      NULL);
+			if(geometries){
+				const HklGeometryListItem *item;
 
+				HKL_GEOMETRY_LIST_FOREACH(item, geometries){
 					hkl_geometry_set(geometry,
-							 hkl_geometry_list_item_geometry_get(*item));
-					hkl_engine_get(engine, NULL);
-					res &= check_pseudoaxes(engine, &q, 1);
+							 hkl_geometry_list_item_geometry_get(item));
+					res &= DIAG(check_pseudoaxes(engine, &q, 1));
 				}
+				hkl_geometry_list_free(geometries);
 			}
 		}
 	}
 
-	ok(res == HKL_TRUE, "q");
+	ok(res == TRUE, "q");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
@@ -347,63 +317,51 @@ static void q(void)
 
 static void hkl_psi_constant_horizontal(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
-	HklMode *mode;
 	const HklFactory *factory;
 	HklGeometry *geometry;
-	const HklGeometryList *geometries;
+	HklGeometryList *geometries;
 	HklDetector *detector;
 	HklSample *sample;
 	static double hkl[] = {1, 0, 1};
 	static double hkl2[] = {1, 1, 0};
-	HklParameterList *pseudo_axes;
 
-	factory = hkl_factory_get_by_name("E4CH");
+	factory = hkl_factory_get_by_name("E4CH", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
-	geometries = hkl_engine_list_geometries(engines);
 
-	engine = hkl_engine_list_get_by_name(engines, "hkl");
-	mode = hkl_engine_mode(engine);
-	pseudo_axes = hkl_engine_pseudo_axes(engine);
+	engine = hkl_engine_list_engine_get_by_name(engines, "hkl", NULL);
 
-	hkl_engine_select_mode_by_name(engine,
-				       "psi_constant");
+	hkl_engine_current_mode_set(engine, "psi_constant", NULL);
 
 	/* the init part */
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
-	hkl_parameter_list_values_set(hkl_mode_parameters(mode),
-				      hkl2, ARRAY_SIZE(hkl2), NULL);
-	hkl_engine_initialize(engine, NULL);
-
-	hkl_parameter_list_values_set(pseudo_axes,
-				      hkl, ARRAY_SIZE(hkl), NULL);
-	if(hkl_engine_set(engine, NULL)){
-		const darray_item *items = hkl_geometry_list_items_get(geometries);
-		HklGeometryListItem **item;
-
-		darray_foreach(item, *items){
-			static double null[] = {0, 0, 0};
-
-			hkl_parameter_list_values_set(pseudo_axes,
-						      null, ARRAY_SIZE(null),
-						      NULL);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., 0., 60.);
+	hkl_engine_parameters_values_set(engine, hkl2, ARRAY_SIZE(hkl2),
+					 HKL_UNIT_DEFAULT, NULL);
+	hkl_engine_initialized_set(engine, TRUE, NULL);
+
+	geometries = hkl_engine_pseudo_axis_values_set(engine,
+							hkl, ARRAY_SIZE(hkl),
+							HKL_UNIT_DEFAULT, NULL);
+	if(geometries){
+		const HklGeometryListItem *item;
+
+		HKL_GEOMETRY_LIST_FOREACH(item, geometries){
 			hkl_geometry_set(geometry,
-					 hkl_geometry_list_item_geometry_get(*item));
-			hkl_engine_get(engine, NULL);
-			res &= check_pseudoaxes(engine, hkl, ARRAY_SIZE(hkl));
+					 hkl_geometry_list_item_geometry_get(item));
+			res &= DIAG(check_pseudoaxes(engine, hkl, ARRAY_SIZE(hkl)));
 		}
+		hkl_geometry_list_free(geometries);
 	}
 
-	ok(res == HKL_TRUE, "psi constant horizontal");
+	ok(res == TRUE, "psi constant horizontal");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
diff --git a/tests/hkl-pseudoaxis-e4cv-t.c b/tests/hkl-pseudoaxis-e4cv-t.c
index ad51cf8..10f11ae 100644
--- a/tests/hkl-pseudoaxis-e4cv-t.c
+++ b/tests/hkl-pseudoaxis-e4cv-t.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -25,7 +25,7 @@
 
 static void getter(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
 	const HklFactory *factory;
@@ -33,40 +33,34 @@ static void getter(void)
 	HklDetector *detector;
 	HklSample *sample;
 
-	factory = hkl_factory_get_by_name("E4CV");
+	factory = hkl_factory_get_by_name("E4CV", NULL);
 	geom = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geom, detector, sample);
 
-	engine = hkl_engine_list_get_by_name(engines, "hkl");
+	engine = hkl_engine_list_engine_get_by_name(engines, "hkl", NULL);
 
 	/* geometry -> pseudo */
-	hkl_geometry_set_values_unit_v(geom, 30., 0., 0., 60.);
-	hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, 0., 0., 1.);
+	hkl_geometry_set_values_v(geom, HKL_UNIT_USER, NULL, 30., 0., 0., 60.);
+	res &= DIAG(check_pseudoaxes_v(engine, 0., 0., 1.));
 
-	hkl_geometry_set_values_unit_v(geom, 30., 0., 90., 60.);
-	hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, 1., 0., 0.);
+	hkl_geometry_set_values_v(geom, HKL_UNIT_USER, NULL, 30., 0., 90., 60.);
+	res &= DIAG(check_pseudoaxes_v(engine, 1., 0., 0.));
 
-	hkl_geometry_set_values_unit_v(geom, 30., 0., -90., 60.);
-	hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, -1., 0., 0.);
+	hkl_geometry_set_values_v(geom, HKL_UNIT_USER, NULL, 30., 0., -90., 60.);
+	res &= DIAG(check_pseudoaxes_v(engine, -1., 0., 0.));
 
-	hkl_geometry_set_values_unit_v(geom, 30., 0., 180., 60.);
-	hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, 0., 0., -1.);
+	hkl_geometry_set_values_v(geom, HKL_UNIT_USER, NULL, 30., 0., 180., 60.);
+	res &= DIAG(check_pseudoaxes_v(engine, 0., 0., -1.));
 
-	hkl_geometry_set_values_unit_v(geom, 45., 0., 135., 90.);
-	hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, 1., 0., -1.);
+	hkl_geometry_set_values_v(geom, HKL_UNIT_USER, NULL, 45., 0., 135., 90.);
+	res &= DIAG(check_pseudoaxes_v(engine, 1., 0., -1.));
 
-	ok(res == HKL_TRUE, "getter");
+	ok(res == TRUE, "getter");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
@@ -76,60 +70,59 @@ static void getter(void)
 
 static void degenerated(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
-	HklMode **mode;
-	darray_mode *modes;
+	const char **mode;
+	const darray_string *modes;
 	const HklFactory *factory;
 	HklGeometry *geometry;
 	HklDetector *detector;
 	HklSample *sample;
-	const HklGeometryList *geometries;
 
-	factory = hkl_factory_get_by_name("E4CV");
+	factory = hkl_factory_get_by_name("E4CV", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
-	geometries = hkl_engine_list_geometries(engines);
 
-	engine = hkl_engine_list_get_by_name(engines, "hkl");
-	modes = hkl_engine_modes(engine);
+	engine = hkl_engine_list_engine_get_by_name(engines, "hkl", NULL);
+	modes = hkl_engine_modes_names_get(engine);
 
 	darray_foreach(mode, *modes){
 		static double values[] = {0, 0, 1};
-		HklParameterList *pseudo_axes = hkl_engine_pseudo_axes(engine);
-		darray_parameter *parameters = hkl_mode_parameters(*mode);
-
-		hkl_engine_select_mode(engine, *mode);
-		if (darray_size(*parameters))
-			hkl_parameter_value_set(darray_item(*parameters, 0), 0, NULL);
+		HklGeometryList *geometries;
+		size_t n_params;
+
+		hkl_engine_current_mode_set(engine, *mode, NULL);
+		const darray_string *parameters = hkl_engine_parameters_names_get(engine);
+		n_params = darray_size(*parameters);
+		if (n_params){
+			double params[n_params];
+
+			hkl_engine_parameters_values_get(engine, params, n_params, HKL_UNIT_DEFAULT);
+			params[0] = 0;
+			hkl_engine_parameters_values_set(engine, params, n_params, HKL_UNIT_DEFAULT, NULL);
+		}
 
 		/* studdy this degenerated case */
-		hkl_parameter_list_values_set(pseudo_axes, values, 3, NULL);
-
-		if(hkl_engine_set(engine, NULL)){
-			const darray_item *items = hkl_geometry_list_items_get(geometries);
-			HklGeometryListItem **item;
-
-			darray_foreach(item, *items){
-				static double null[] = {0, 0, 0};
+		geometries = hkl_engine_pseudo_axis_values_set(engine, values, 3, HKL_UNIT_DEFAULT, NULL);
+		if(geometries){
+			const HklGeometryListItem *item;
 
-				hkl_parameter_list_values_set(pseudo_axes, null, 3, NULL);
+			HKL_GEOMETRY_LIST_FOREACH(item, geometries){
 				hkl_geometry_set(geometry,
-						 hkl_geometry_list_item_geometry_get(*item));
-				hkl_engine_get(engine, NULL);
-				res &= check_pseudoaxes(engine, values, 3);
+						 hkl_geometry_list_item_geometry_get(item));
+				res &= DIAG(check_pseudoaxes(engine, values, ARRAY_SIZE(values)));
 			}
+			hkl_geometry_list_free(geometries);
 		}
 	}
 
-	ok(res == HKL_TRUE, "degenerated");
+	ok(res == TRUE, "degenerated");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
@@ -139,72 +132,61 @@ static void degenerated(void)
 
 static void psi_getter(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
-	HklMode *mode;
-	HklParameterList *parameters;
 	const HklFactory *factory;
 	HklGeometry *geom;
 	HklDetector *detector;
 	HklSample *sample;
 	double hkl[3];
 
-	factory = hkl_factory_get_by_name("E4CV");
+	factory = hkl_factory_get_by_name("E4CV", NULL);
 	geom = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geom, detector, sample);
 
-	engine = hkl_engine_list_get_by_name(engines, "psi");
-	mode = hkl_engine_mode(engine);
-	parameters = hkl_mode_parameters(mode);
+	engine = hkl_engine_list_engine_get_by_name(engines, "psi", NULL);
 
 	/* the getter part */
-	hkl_geometry_set_values_unit_v(geom, 30., 0., 0., 60.);
-	hkl_engine_initialize(engine, NULL);
+	hkl_geometry_set_values_v(geom, HKL_UNIT_USER, NULL, 30., 0., 0., 60.);
+	hkl_engine_initialized_set(engine, TRUE, NULL);
 
+	/* 1 0 0 */
 	hkl[0] = 1, hkl[1] = 0, hkl[2] = 0;
-	hkl_parameter_list_values_set(parameters,
-				      hkl, ARRAY_SIZE(hkl), NULL);
-	res &= hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, 0.);
+	hkl_engine_parameters_values_set(engine, hkl, ARRAY_SIZE(hkl), HKL_UNIT_DEFAULT, NULL);
+	res &= DIAG(check_pseudoaxes_v(engine, 0.));
 
+	/* 0 1 0*/
 	hkl[0] = 0, hkl[1] = 1, hkl[2] = 0;
-	hkl_parameter_list_values_set(parameters,
-				      hkl, ARRAY_SIZE(hkl), NULL);
-	res &= hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, 90. * HKL_DEGTORAD);
+	hkl_engine_parameters_values_set(engine, hkl, ARRAY_SIZE(hkl), HKL_UNIT_DEFAULT, NULL);
+	res &= DIAG(check_pseudoaxes_v(engine, 90. * HKL_DEGTORAD));
 
 	/* here Q and <h, k, l>_ref are colinear must FAIL */
 	hkl[0] = 0, hkl[1] = 0, hkl[2] = 1;
-	hkl_parameter_list_values_set(parameters,
-				      hkl, ARRAY_SIZE(hkl), NULL);
-	res &= !hkl_engine_get(engine, NULL);
+	hkl_engine_parameters_values_set(engine, hkl, ARRAY_SIZE(hkl), HKL_UNIT_DEFAULT, NULL);
+	res &= DIAG(!check_pseudoaxes_v(engine, 0. * HKL_DEGTORAD));
 
+	/* -1 0 0 */
 	hkl[0] = -1, hkl[1] = 0, hkl[2] = 0;
-	hkl_parameter_list_values_set(parameters,
-				      hkl, ARRAY_SIZE(hkl), NULL);
-	res &= hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, 180. * HKL_DEGTORAD);
+	hkl_engine_parameters_values_set(engine, hkl, ARRAY_SIZE(hkl), HKL_UNIT_DEFAULT, NULL);
+	res &= DIAG(check_pseudoaxes_v(engine, 180. * HKL_DEGTORAD));
 
+	/* 0 -1 0 */
 	hkl[0] = 0, hkl[1] = -1, hkl[2] = 0;
-	hkl_parameter_list_values_set(parameters,
-				      hkl, ARRAY_SIZE(hkl), NULL);
-	res &= hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, -90. * HKL_DEGTORAD);
+	hkl_engine_parameters_values_set(engine, hkl, ARRAY_SIZE(hkl), HKL_UNIT_DEFAULT, NULL);
+	res &= DIAG(check_pseudoaxes_v(engine, -90. * HKL_DEGTORAD));
 
 	/* Q and <h, k, l>_ref are colinear so must FAIL */
 	hkl[0] = 0, hkl[1] = 0, hkl[2] = -1;
-	hkl_parameter_list_values_set(parameters,
-				      hkl, ARRAY_SIZE(hkl), NULL);
-	res &= !hkl_engine_get(engine, NULL);
+	hkl_engine_parameters_values_set(engine, hkl, ARRAY_SIZE(hkl), HKL_UNIT_DEFAULT, NULL);
+	res &= DIAG(!check_pseudoaxes_v(engine, 0. * HKL_DEGTORAD));
 
-	ok(res == HKL_TRUE, "psi getter");
+	ok(res == TRUE, "psi getter");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
@@ -214,66 +196,57 @@ static void psi_getter(void)
 
 static void psi_setter(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
-	HklParameterList *pseudo_axes;
-	HklMode **mode;
-	darray_mode *modes;
-	HklParameterList *parameters;
+	const darray_string *modes;
+	const char **mode;
 	const HklFactory *factory;
 	HklGeometry *geometry;
 	HklDetector *detector;
 	HklSample *sample;
 	static double hkl[] = {1, 0, 0};
-	const HklGeometryList *geometries;
 
-	factory = hkl_factory_get_by_name("E4CV");
+	factory = hkl_factory_get_by_name("E4CV", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
-	geometries = hkl_engine_list_geometries(engines);
 
-	engine = hkl_engine_list_get_by_name(engines, "psi");
-	pseudo_axes = hkl_engine_pseudo_axes(engine);
-	modes = hkl_engine_modes(engine);
-	parameters = hkl_mode_parameters(hkl_engine_mode(engine));
+	engine = hkl_engine_list_engine_get_by_name(engines, "psi", NULL);
+	modes = hkl_engine_modes_names_get(engine);
 
 	/* the init part */
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
-	hkl_parameter_list_values_set(parameters,
-				      hkl, ARRAY_SIZE(hkl), NULL);
-	hkl_engine_initialize(engine, NULL);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., 0., 60.);
+	hkl_engine_parameters_values_set(engine, hkl, ARRAY_SIZE(hkl), HKL_UNIT_DEFAULT, NULL);
+	hkl_engine_initialized_set(engine, TRUE, NULL);
 
 	darray_foreach(mode, *modes){
 		double psi;
 
-		hkl_engine_select_mode(engine, *mode);
+		hkl_engine_current_mode_set(engine, *mode, NULL);
 		for(psi=-180 * HKL_DEGTORAD;psi<180 * HKL_DEGTORAD;psi += HKL_DEGTORAD){
-			hkl_parameter_list_values_set(pseudo_axes, &psi, 1, NULL);
-			if(hkl_engine_set(engine, NULL)){
-				const darray_item *items = hkl_geometry_list_items_get(geometries);
-				HklGeometryListItem **item;
+			HklGeometryList *geometries;
 
-				darray_foreach(item, *items){
-					static double null[] = {0};
+			geometries = hkl_engine_pseudo_axis_values_set(engine, &psi, 1,
+									HKL_UNIT_DEFAULT, NULL);
+			if(geometries){
+				const HklGeometryListItem *item;
 
-					hkl_parameter_list_values_set(pseudo_axes, null, 1, NULL);
+				HKL_GEOMETRY_LIST_FOREACH(item, geometries){
 					hkl_geometry_set(geometry,
-							 hkl_geometry_list_item_geometry_get(*item));
-					hkl_engine_get(engine, NULL);
-					res &= check_pseudoaxes_v(engine, psi);
+							 hkl_geometry_list_item_geometry_get(item));
+					res &= DIAG(check_pseudoaxes_v(engine, psi));
 				}
+				hkl_geometry_list_free(geometries);
 			}
 		}
 	}
 
-	ok(res == HKL_TRUE, "psi setter");
+	ok(res == TRUE, "psi setter");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
@@ -283,60 +256,55 @@ static void psi_setter(void)
 
 static void q(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
-	HklMode **mode;
-	darray_mode *modes;
+	const darray_string *modes;
+	const char **mode;
 	const HklFactory *factory;
 	HklGeometry *geometry;
 	HklDetector *detector;
 	HklSample *sample;
-	const HklGeometryList *geometries;
 
-	factory = hkl_factory_get_by_name("E4CV");
+	factory = hkl_factory_get_by_name("E4CV", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
-	geometries = hkl_engine_list_geometries(engines);
 
-	engine = hkl_engine_list_get_by_name(engines, "q");
-	modes = hkl_engine_modes(engine);
+	engine = hkl_engine_list_engine_get_by_name(engines, "q", NULL);
+	modes = hkl_engine_modes_names_get(engine);
 
 	/* the init part */
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
-	hkl_engine_initialize(engine, NULL);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., 0., 60.);
+	hkl_engine_initialized_set(engine, TRUE, NULL);
 
 	darray_foreach(mode, *modes){
 		double q;
-		HklParameterList *pseudo_axes = hkl_engine_pseudo_axes(engine);
 
-		hkl_engine_select_mode(engine, *mode);
+		hkl_engine_current_mode_set(engine, *mode, NULL);
 		for(q=-1.; q<1.; q += 0.1){
-			hkl_parameter_list_values_set(pseudo_axes, &q, 1, NULL);
-			if(hkl_engine_set(engine, NULL)){
-				const darray_item *items = hkl_geometry_list_items_get(geometries);
-				HklGeometryListItem **item;
+			HklGeometryList *geometries;
 
-				darray_foreach(item, *items){
-					static double null[] = {0};
+			geometries = hkl_engine_pseudo_axis_values_set(engine, &q, 1,
+									HKL_UNIT_DEFAULT, NULL);
+			if(geometries){
+				const HklGeometryListItem *item;
 
-					hkl_parameter_list_values_set(pseudo_axes, null, 1, NULL);
+				HKL_GEOMETRY_LIST_FOREACH(item, geometries){
 					hkl_geometry_set(geometry,
-							 hkl_geometry_list_item_geometry_get(*item));
-					hkl_engine_get(engine, NULL);
-					res &= check_pseudoaxes(engine, &q, 1);
+							 hkl_geometry_list_item_geometry_get(item));
+					res &= DIAG(check_pseudoaxes(engine, &q, 1));
 				}
+				hkl_geometry_list_free(geometries);
 			}
 		}
 	}
 
-	ok(res == HKL_TRUE, "q");
+	ok(res == TRUE, "q");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
@@ -346,66 +314,49 @@ static void q(void)
 
 static void hkl_psi_constant_vertical(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
 	const HklFactory *factory;
 	HklGeometry *geometry;
-	const HklGeometryList *geometries;
+	HklGeometryList *geometries;
 	HklDetector *detector;
 	HklSample *sample;
 	static double hkl[] = {1, 0, 1};
 	static double hkl2[] = {1, 1, 0};
-	HklParameterList *pseudo_axes;
-	HklMode *mode;
-	HklParameterList *parameters;
 
-	factory = hkl_factory_get_by_name("E4CV");
+	factory = hkl_factory_get_by_name("E4CV", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
-	geometries = hkl_engine_list_geometries(engines);
 
-	engine = hkl_engine_list_get_by_name(engines, "hkl");
-	pseudo_axes = hkl_engine_pseudo_axes(engine);
+	engine = hkl_engine_list_engine_get_by_name(engines, "hkl", NULL);
 
-	hkl_engine_select_mode_by_name(engine,
-				       "psi_constant");
-
-	mode = hkl_engine_mode(engine);
-	parameters = hkl_mode_parameters(mode);
+	hkl_engine_current_mode_set(engine, "psi_constant", NULL);
 
 	/* the init part */
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
-	hkl_parameter_list_values_set(parameters,
-				      hkl2, ARRAY_SIZE(hkl2), NULL);
-	hkl_engine_initialize(engine, NULL);
-
-	hkl_parameter_list_values_set(pseudo_axes,
-				      hkl, ARRAY_SIZE(hkl), NULL);
-	if(hkl_engine_set(engine, NULL)){
-		const darray_item *items = hkl_geometry_list_items_get(geometries);
-		HklGeometryListItem **item;
-
-		darray_foreach(item, *items){
-			static double null[] = {0, 0, 0};
-
-			hkl_parameter_list_values_set(pseudo_axes,
-						      null, ARRAY_SIZE(null),
-						      NULL);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., 0., 60.);
+	hkl_engine_parameters_values_set(engine, hkl2, ARRAY_SIZE(hkl2), HKL_UNIT_DEFAULT, NULL);
+	hkl_engine_initialized_set(engine, TRUE, NULL);
+
+	geometries = hkl_engine_pseudo_axis_values_set(engine, hkl, ARRAY_SIZE(hkl),
+							HKL_UNIT_DEFAULT, NULL);
+	if(geometries){
+		const HklGeometryListItem *item;
+
+		HKL_GEOMETRY_LIST_FOREACH(item, geometries){
 			hkl_geometry_set(geometry,
-					 hkl_geometry_list_item_geometry_get(*item));
-			hkl_engine_get(engine, NULL);
-			res &= check_pseudoaxes(engine, hkl, ARRAY_SIZE(hkl));
+					 hkl_geometry_list_item_geometry_get(item));
+			res &= DIAG(check_pseudoaxes(engine, hkl, ARRAY_SIZE(hkl)));
 		}
+		hkl_geometry_list_free(geometries);
 	}
 
-	ok(res == HKL_TRUE, "psi constant vertical");
+	ok(res == TRUE, "psi constant vertical");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
diff --git a/tests/hkl-pseudoaxis-e6c-t.c b/tests/hkl-pseudoaxis-e6c-t.c
index 6abe411..eb97399 100644
--- a/tests/hkl-pseudoaxis-e6c-t.c
+++ b/tests/hkl-pseudoaxis-e6c-t.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -25,7 +25,7 @@
 
 #include "hkl-axis-private.h" /* temporary */
 
-#define CHECK_AXIS_VALUE(axis, value) fabs((value) - hkl_parameter_value_get(axis)) < HKL_EPSILON
+#define CHECK_AXIS_VALUE(geometry, axis, value) fabs((value) - hkl_parameter_value_get(hkl_geometry_axis_get(geometry, axis, NULL), HKL_UNIT_DEFAULT)) < HKL_EPSILON
 
 
 static int hkl_geometry_list_check_geometry_unit(const HklGeometryList *self,
@@ -36,20 +36,21 @@ static int hkl_geometry_list_check_geometry_unit(const HklGeometryList *self,
 						 double gamma,
 						 double delta)
 {
-	const darray_item *items = hkl_geometry_list_items_get(self);
-	HklGeometryListItem **item;
-	int res = HKL_TRUE;
+	const HklGeometryListItem *item;
+	int res = TRUE;
 
-	darray_foreach(item, *items){
-		const darray_parameter *axes = hkl_geometry_axes_get(hkl_geometry_list_item_geometry_get(*item));
+	HKL_GEOMETRY_LIST_FOREACH(item, self){
+		const HklGeometry *geometry;
 
-		res = HKL_TRUE;
-		res &= CHECK_AXIS_VALUE(darray_item(*axes, 0), mu * HKL_DEGTORAD);
-		res &= CHECK_AXIS_VALUE(darray_item(*axes, 1), omega * HKL_DEGTORAD);
-		res &= CHECK_AXIS_VALUE(darray_item(*axes, 2), chi * HKL_DEGTORAD);
-		res &= CHECK_AXIS_VALUE(darray_item(*axes, 3), phi * HKL_DEGTORAD);
-		res &= CHECK_AXIS_VALUE(darray_item(*axes, 4), gamma * HKL_DEGTORAD);
-		res &= CHECK_AXIS_VALUE(darray_item(*axes, 5), delta * HKL_DEGTORAD);
+		geometry = hkl_geometry_list_item_geometry_get(item);
+
+		res = TRUE;
+		res &= DIAG(CHECK_AXIS_VALUE(geometry, "mu", mu * HKL_DEGTORAD));
+		res &= DIAG(CHECK_AXIS_VALUE(geometry, "omega", omega * HKL_DEGTORAD));
+		res &= DIAG(CHECK_AXIS_VALUE(geometry, "chi", chi * HKL_DEGTORAD));
+		res &= DIAG(CHECK_AXIS_VALUE(geometry, "phi", phi * HKL_DEGTORAD));
+		res &= DIAG(CHECK_AXIS_VALUE(geometry, "gamma", gamma * HKL_DEGTORAD));
+		res &= DIAG(CHECK_AXIS_VALUE(geometry, "delta", delta * HKL_DEGTORAD));
 
 		if (res)
 			break;
@@ -59,7 +60,7 @@ static int hkl_geometry_list_check_geometry_unit(const HklGeometryList *self,
 
 static void getter(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
 	const HklFactory *factory;
@@ -67,40 +68,34 @@ static void getter(void)
 	HklDetector *detector;
 	HklSample *sample;
 
-	factory = hkl_factory_get_by_name("E6C");
+	factory = hkl_factory_get_by_name("E6C", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
 
-	engine = hkl_engine_list_get_by_name(engines, "hkl");
+	engine = hkl_engine_list_engine_get_by_name(engines, "hkl", NULL);
 
 	/* geometry -> pseudo */
-	hkl_geometry_set_values_unit_v(geometry, 0., 30., 0., 0., 0., 60.);
-	hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, 0., 0., 1.);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 0., 30., 0., 0., 0., 60.);
+	res &= DIAG(check_pseudoaxes_v(engine, 0., 0., 1.));
 
-	hkl_geometry_set_values_unit_v(geometry, 0., 30., 0., 90., 0., 60.);
-	hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, 1., 0., 0.);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 0., 30., 0., 90., 0., 60.);
+	res &= DIAG(check_pseudoaxes_v(engine, 1., 0., 0.));
 
-	hkl_geometry_set_values_unit_v(geometry, 0., 30., 0., -90., 0., 60.);
-	hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, -1., 0., 0.);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 0., 30., 0., -90., 0., 60.);
+	res &= DIAG(check_pseudoaxes_v(engine, -1., 0., 0.));
 
-	hkl_geometry_set_values_unit_v(geometry, 0., 30., 0., 180., 0., 60.);
-	hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, 0., 0., -1.);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 0., 30., 0., 180., 0., 60.);
+	res &= DIAG(check_pseudoaxes_v(engine, 0., 0., -1.));
 
-	hkl_geometry_set_values_unit_v(geometry, 0., 45., 0., 135., 0., 90.);
-	hkl_engine_get(engine, NULL);
-	res &= check_pseudoaxes_v(engine, 1., 0., -1.);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 0., 45., 0., 135., 0., 90.);
+	res &= DIAG(check_pseudoaxes_v(engine, 1., 0., -1.));
 
-	ok(res == HKL_TRUE, "getter");
+	ok(res == TRUE, "getter");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
@@ -110,64 +105,62 @@ static void getter(void)
 
 static void degenerated(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
-	HklMode **mode;
-	darray_mode *modes;
+	const darray_string *modes;
+	const char **mode;
 	const HklFactory *factory;
 	HklGeometry *geometry;
-	const HklGeometryList *geometries;
 	HklDetector *detector;
 	HklSample *sample;
 	static double hkl[] = {0, 0, 1};
-	HklParameterList *pseudo_axes;
 
-	factory = hkl_factory_get_by_name("E6C");
+	factory = hkl_factory_get_by_name("E6C", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
-	geometries = hkl_engine_list_geometries(engines);
 
-	engine = hkl_engine_list_get_by_name(engines, "hkl");
-	modes = hkl_engine_modes(engine);
-	pseudo_axes = hkl_engine_pseudo_axes(engine);
+	engine = hkl_engine_list_engine_get_by_name(engines, "hkl", NULL);
+	modes = hkl_engine_modes_names_get(engine);
 
 	darray_foreach(mode, *modes) {
-		darray_parameter *parameters;
-
-		hkl_engine_select_mode(engine, *mode);
-		parameters = hkl_mode_parameters(*mode);
-		if (darray_size(*parameters))
-			hkl_parameter_value_set(darray_item(*parameters, 0), 0, NULL);
+		const darray_string *parameters;
+		HklGeometryList *geometries;
+		size_t n_params;
+
+		hkl_engine_current_mode_set(engine, *mode, NULL);
+		parameters = hkl_engine_parameters_names_get(engine);
+		n_params = darray_size(*parameters);
+		if (n_params){
+			double params[n_params];
+
+			hkl_engine_parameters_values_get(engine, params, n_params, HKL_UNIT_DEFAULT);
+			params[0] = 0;
+			hkl_engine_parameters_values_set(engine, params, n_params, HKL_UNIT_DEFAULT, NULL);
+		}
 
 		/* studdy this degenerated case */
-		hkl_parameter_list_values_set(pseudo_axes,
-					      hkl, ARRAY_SIZE(hkl),
-					      NULL);
-		if (hkl_engine_set(engine, NULL)){
-			const darray_item *items = hkl_geometry_list_items_get(geometries);
-			HklGeometryListItem **item;
-
-			darray_foreach(item, *items) {
-				static double null[] = {0, 0, 0};
-
-				hkl_parameter_list_values_set(pseudo_axes,
-							      null, ARRAY_SIZE(null),
-							      NULL);
-				hkl_geometry_set(geometry, hkl_geometry_list_item_geometry_get(*item));
-				hkl_engine_get(engine, NULL);
-				res &= check_pseudoaxes(engine, hkl, 3);
+		geometries = hkl_engine_pseudo_axis_values_set(engine,
+								hkl, ARRAY_SIZE(hkl),
+								HKL_UNIT_DEFAULT, NULL);
+		if (geometries){
+			const HklGeometryListItem *item;
+
+			HKL_GEOMETRY_LIST_FOREACH(item, geometries){
+				hkl_geometry_set(geometry,
+						 hkl_geometry_list_item_geometry_get(item));
+				res &= DIAG(check_pseudoaxes(engine, hkl, 3));
 			}
+			hkl_geometry_list_free(geometries);
 		}
 	}
 
-	ok(res == HKL_TRUE, "degenerated");
+	ok(res == TRUE, "degenerated");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
@@ -177,68 +170,58 @@ static void degenerated(void)
 
 static void q2(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
-	HklMode **mode;
-	darray_mode *modes;
+	const char **mode;
+	const darray_string *modes;
 	const HklFactory *factory;
 	HklGeometry *geometry;
-	const HklGeometryList *geometries;
 	HklDetector *detector;
 	HklSample *sample;
-	HklParameterList *pseudo_axes;
 
-	factory = hkl_factory_get_by_name("E6C");
+	factory = hkl_factory_get_by_name("E6C", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
-	geometries = hkl_engine_list_geometries(engines);
 
-	engine = hkl_engine_list_get_by_name(engines, "q2");
-	modes = hkl_engine_modes(engine);
-	pseudo_axes = hkl_engine_pseudo_axes(engine);
+	engine = hkl_engine_list_engine_get_by_name(engines, "q2", NULL);
+	modes = hkl_engine_modes_names_get(engine);
 
 	/* the init part */
-	hkl_geometry_set_values_unit_v(geometry, 0., 30., 0., 0., 0., 60.);
-	hkl_engine_initialize(engine, NULL);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 0., 30., 0., 0., 0., 60.);
+	hkl_engine_initialized_set(engine, TRUE, NULL);
 
 
 	darray_foreach(mode, *modes){
 		double q, alpha;
 
-		hkl_engine_select_mode(engine, *mode);
+		hkl_engine_current_mode_set(engine, *mode, NULL);
 		for(q=0.1; q<1.; q += 0.1)
 			for(alpha = -M_PI; alpha<M_PI; alpha += M_PI/180.){
 				double values[] = {q, alpha};
+				HklGeometryList *geometries;
 
-				hkl_parameter_list_values_set(pseudo_axes,
-							      values, ARRAY_SIZE(values),
-							      NULL);
-				if(hkl_engine_set(engine, NULL)){
-					const darray_item *items = hkl_geometry_list_items_get(geometries);
-					HklGeometryListItem **item;
-
-					darray_foreach(item, *items){
-						static double null[] = {0, 0};
-
-						hkl_parameter_list_values_set(pseudo_axes,
-									      null, ARRAY_SIZE(null),
-									      NULL);
-						hkl_geometry_set(geometry, hkl_geometry_list_item_geometry_get(*item));
-						hkl_engine_get(engine, NULL);
-						res &= check_pseudoaxes(engine, values, 2);
+				geometries = hkl_engine_pseudo_axis_values_set(engine,
+										values, ARRAY_SIZE(values),
+										HKL_UNIT_DEFAULT, NULL);
+				if(geometries){
+					const HklGeometryListItem *item;
+
+					HKL_GEOMETRY_LIST_FOREACH(item, geometries){
+						hkl_geometry_set(geometry, hkl_geometry_list_item_geometry_get(item));
+						res &= DIAG(check_pseudoaxes(engine, values, 2));
 					}
+					hkl_geometry_list_free(geometries);
 				}
 			}
 	}
 
-	ok(res == HKL_TRUE, "q2");
+	ok(res == TRUE, "q2");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
@@ -248,81 +231,76 @@ static void q2(void)
 
 static void petra3(void)
 {
-	static double values[] = {1, 1, 0};
-	static double parameters[] = {0, 0, 1, 90 * HKL_DEGTORAD};
-	int res = HKL_TRUE;
+	static double hkl_v[] = {1, 1, 0};
+	static double hkl_p[] = {0, 0, 1, 90 * HKL_DEGTORAD};
+	static double psi_p[] = {0, 0, 1};
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *hkl;
 	HklEngine *psi;
-	HklMode *mode;
 	const HklFactory *factory;
 	HklGeometry *geometry;
-	const HklGeometryList *geometries;
+	HklGeometryList *geometries;
 	HklDetector *detector;
 	HklSample *sample;
 	HklLattice *lattice;
 	HklMatrix *U;
 
-	factory = hkl_factory_get_by_name("E6C");
+	factory = hkl_factory_get_by_name("E6C", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
-	hkl_geometry_wavelength_set(geometry, 2.033);
+	hkl_geometry_wavelength_set(geometry, 2.033, HKL_UNIT_DEFAULT, NULL);
 
 	sample = hkl_sample_new("test");
 	lattice = hkl_lattice_new(7.813, 7.813, 7.813,
-				  90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD);
+				  90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD,
+				  NULL);
 	hkl_sample_lattice_set(sample, lattice);
 	hkl_lattice_free(lattice);
 
 	U = hkl_matrix_new_euler(-112.5 * HKL_DEGTORAD,
 				 -87.84 * HKL_DEGTORAD,
 				 157.48 * HKL_DEGTORAD);
-	hkl_sample_U_set(sample, U);
+	hkl_sample_U_set(sample, U, NULL);
 	hkl_matrix_free(U);
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
-	geometries = hkl_engine_list_geometries(engines);
-
-	/* set the hkl pseudo axis in psi_constant_vertical */
-	hkl = hkl_engine_list_get_by_name(engines, "hkl");
-	hkl_engine_select_mode_by_name(hkl, "psi_constant_vertical");
-	hkl_engine_set_values_v(hkl, 1, 1, 0);
-	/* set the mode parameters 0, 0, 1, 90. */
-	mode = hkl_engine_mode(hkl);
-	hkl_parameter_list_values_set(hkl_mode_parameters(mode),
-				      parameters, ARRAY_SIZE(parameters),
-				      NULL);
 
 	/* set the psi pseudo axis */
-	psi = hkl_engine_list_get_by_name(engines, "psi");
-	hkl_engine_select_mode_by_name(psi, "psi_constant_vertical");
+	psi = hkl_engine_list_engine_get_by_name(engines, "psi", NULL);
+	hkl_engine_current_mode_set(psi, "psi_constant_vertical", NULL);
 	/* set the mode parameters 0, 0, 1 */
-	mode = hkl_engine_mode(psi);
-	hkl_parameter_list_values_set(hkl_mode_parameters(mode),
-				      parameters, ARRAY_SIZE(parameters), NULL);
+	hkl_engine_parameters_values_set(psi, psi_p, ARRAY_SIZE(psi_p), HKL_UNIT_DEFAULT, NULL);
 
 	/* Compute the hkl [1, 1, 0] in psi_constant_vertical mode with */
 	/* h2,k2,l2= [0, 0,1] and psi = 90 */
-	if(hkl_engine_set(hkl, NULL)){
-		const darray_item *items = hkl_geometry_list_items_get(geometries);
-		HklGeometryListItem **item;
-		darray_parameter *pseudo_axes = hkl_engine_pseudo_axes(psi);
+	/* set the hkl pseudo axis in psi_constant_vertical */
+	hkl = hkl_engine_list_engine_get_by_name(engines, "hkl", NULL);
+	hkl_engine_current_mode_set(hkl, "psi_constant_vertical", NULL);
+	/* set the mode parameters 0, 0, 1, 90. */
+	hkl_engine_parameters_values_set(hkl, hkl_p, ARRAY_SIZE(hkl_p), HKL_UNIT_DEFAULT, NULL);
+	geometries = hkl_engine_pseudo_axis_values_set(hkl, hkl_v, ARRAY_SIZE(hkl_v),
+							HKL_UNIT_DEFAULT, NULL);
+	if(geometries){
+		const HklGeometryListItem *item;
 
-		darray_foreach(item, *items) {
-			double PSI = parameters[3];
+		HKL_GEOMETRY_LIST_FOREACH(item, geometries){
+			double PSI = hkl_p[3];
+			double current;
 
 			hkl_geometry_set(geometry,
-					 hkl_geometry_list_item_geometry_get(*item));
-			hkl_engine_initialize(psi, NULL);
-			hkl_engine_list_get(engines);
-			res &= fabs(PSI - hkl_parameter_value_get(darray_item(*pseudo_axes, 0))) < HKL_EPSILON;
+					 hkl_geometry_list_item_geometry_get(item));
+			hkl_engine_initialized_set(psi, TRUE, NULL);
+			hkl_engine_pseudo_axis_values_get(psi, &current, 1,
+							   HKL_UNIT_DEFAULT, NULL);
+			res &= DIAG(fabs(PSI - current) < HKL_EPSILON);
 		}
+		hkl_geometry_list_free(geometries);
 	}
 
-	ok(res == HKL_TRUE, "petra3");
+	ok(res == TRUE, "petra3");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
@@ -333,23 +311,21 @@ static void petra3(void)
 /* Problem observed with the psi_constant_vertical mode */
 static void petra3_2(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *hkl;
 	HklEngine *psi;
-	HklMode *mode;
 	const HklFactory *factory;
-	const darray_item *items;
-	HklGeometryListItem **item;
+	const HklGeometryListItem *item;
 	HklGeometry *geometry;
-	const HklGeometryList *geometries;
+	HklGeometryList *geometries;
 	HklDetector *detector;
 	HklSample *sample;
 	HklLattice *lattice;
 	HklMatrix *U;
 	double PSI;
-	double parameters[4];
-	darray_parameter *pseudo_axes;
+	double hkl_p[4];
+	double psi_p[3];
 
 	/* Wavelength 1.0332035 */
 	/* Mode       psi_constant_vertical */
@@ -360,168 +336,162 @@ static void petra3_2(void)
 	/* A 5.1 B 5.1 C 5.1  */
 	/* Alpha 90 Beta 90 Gamma 90  */
 
-	factory = hkl_factory_get_by_name("E6C");
+	factory = hkl_factory_get_by_name("E6C", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
-	hkl_geometry_wavelength_set(geometry, 1.0332035);
+	hkl_geometry_wavelength_set(geometry, 1.0332035, HKL_UNIT_DEFAULT, NULL);
 
 	sample = hkl_sample_new("test");
 	lattice = hkl_lattice_new(5.1, 5.1, 5.1,
-				  90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD);
+				  90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD,
+				  NULL);
 	hkl_sample_lattice_set(sample, lattice);
 	hkl_lattice_free(lattice);
 	U = hkl_matrix_new_euler(-90.0 * HKL_DEGTORAD,
 				 0.0 * HKL_DEGTORAD,
 				 -90.0 * HKL_DEGTORAD);
-	hkl_sample_U_set(sample, U);
+	hkl_sample_U_set(sample, U, NULL);
 	hkl_matrix_free(U);
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
-	geometries = hkl_engine_list_geometries(engines);
-	items = hkl_geometry_list_items_get(geometries);
 
 	/* set the hkl pseudo axis in psi_constant_vertical */
-	hkl = hkl_engine_list_get_by_name(engines, "hkl");
-	hkl_engine_select_mode_by_name(hkl, "psi_constant_vertical");
+	hkl = hkl_engine_list_engine_get_by_name(engines, "hkl", NULL);
+	hkl_engine_current_mode_set(hkl, "psi_constant_vertical", NULL);
 	/* set the psi pseudo engine to read the psi value */
-	psi = hkl_engine_list_get_by_name(engines, "psi");
-	pseudo_axes = hkl_engine_pseudo_axes(psi);
+	psi = hkl_engine_list_engine_get_by_name(engines, "psi", NULL);
 
 	/* PsiRef 0 1 0 */
 	/* freeze 0; ca 0 0 2 */
 	/* for hkl */
-	parameters[0] = 0;
-	parameters[1] = 1;
-	parameters[2] = 0;
-	parameters[3] = PSI = 0;
-	mode = hkl_engine_mode(hkl);
-	hkl_parameter_list_values_set(hkl_mode_parameters(mode),
-				      parameters, ARRAY_SIZE(parameters),
-				      NULL);
+	hkl_p[0] = 0;
+	hkl_p[1] = 1;
+	hkl_p[2] = 0;
+	hkl_p[3] = PSI = 0;
+	hkl_engine_parameters_values_set(hkl, hkl_p, ARRAY_SIZE(hkl_p), HKL_UNIT_DEFAULT, NULL);
 	/* for psi */
-	mode = hkl_engine_mode(psi);
-	hkl_parameter_list_values_set(hkl_mode_parameters(mode),
-				      parameters, ARRAY_SIZE(parameters),
-				      NULL);
+	psi_p[0] = 0;
+	psi_p[1] = 1;
+	psi_p[2] = 0;
+	hkl_engine_parameters_values_set(psi, psi_p, ARRAY_SIZE(psi_p), HKL_UNIT_DEFAULT, NULL);
 
 	/* freeze 0; ca 0 0 2 */
-	hkl_engine_set_values_v(hkl, 0., 0., 2.);
+	geometries = hkl_engine_set_values_v(hkl, 0., 0., 2.);
 
 	/*      del              th               chi              phi */
 	/*      23.37668         11.68835         90               -90 */
 	/*      gamma            mu */
 	/*      -2.384186e-09    -1.182388e-14 */
 	/* the -90 value of phi is problematic, the right value is 0 */
-	if(hkl_engine_set(hkl, NULL)){
-		res &= hkl_geometry_list_check_geometry_unit(
-			geometries,
-			0., 11.688393153063114, 90., 0., 0.,  23.376786185344031);
+	if(geometries){
+		res &= DIAG(hkl_geometry_list_check_geometry_unit(geometries, 0., 11.688393153063114, 90., 0., 0., 23.376786185344031));
 
 		/* check that all solution gives the right psi */
-		darray_foreach(item, *items) {
-			hkl_geometry_set(geometry, hkl_geometry_list_item_geometry_get(*item));
-			hkl_engine_initialize(psi, NULL);
-			hkl_engine_list_get(engines);
-			res &= fabs(PSI - hkl_parameter_value_get(darray_item(*pseudo_axes, 0))) < HKL_EPSILON;
+		HKL_GEOMETRY_LIST_FOREACH(item, geometries){
+			double current;
+
+			hkl_geometry_set(geometry, hkl_geometry_list_item_geometry_get(item));
+			hkl_engine_initialized_set(psi, TRUE, NULL);
+			hkl_engine_pseudo_axis_values_get(psi, &current, 1,
+							   HKL_UNIT_DEFAULT, NULL);
+			res &= DIAG(fabs(PSI - current) < HKL_EPSILON);
 		}
+		hkl_geometry_list_free(geometries);
 	}
 
 	/* freeze 45; ca 0 0 2 */
-	parameters[3] = PSI = 45.0 * HKL_DEGTORAD;
-	mode = hkl_engine_mode(hkl);
-	hkl_parameter_list_values_set(hkl_mode_parameters(mode),
-				      parameters, ARRAY_SIZE(parameters), NULL);
-	hkl_engine_set_values_v(hkl, 0., 0., 2.);
+	hkl_p[3] = PSI = 45.0 * HKL_DEGTORAD;
+	hkl_engine_parameters_values_set(hkl, hkl_p, ARRAY_SIZE(hkl_p), HKL_UNIT_DEFAULT, NULL);
+	geometries = hkl_engine_set_values_v(hkl, 0., 0., 2.);
 
 	/*      del              th               chi              phi */
 	/*      23.3768          11.68831         90               -135 */
 	/*      gamma            mu */
 	/*      -2.384186e-09    -1.182388e-14 */
 	/* -135 n'est pas bon il faudrait plutôt -45 */
-	if(hkl_engine_set(hkl, NULL)){
-		res &= hkl_geometry_list_check_geometry_unit(
-			geometries,
-			0., 11.688393153063114, 90., -45., 0.,  23.376786185344031);
+	if(geometries){
+		res &= DIAG(hkl_geometry_list_check_geometry_unit(geometries, 0., 11.688393153063114, 90., -45., 0., 23.376786185344031));
 
 		/* check that all solution gives the right psi */
-		darray_foreach(item, *items) {
-			hkl_geometry_set(geometry, hkl_geometry_list_item_geometry_get(*item));
-			hkl_engine_initialize(psi, NULL);
-			hkl_engine_list_get(engines);
-			res &= fabs(PSI - hkl_parameter_value_get(darray_item(*pseudo_axes, 0))) < HKL_EPSILON;
+		HKL_GEOMETRY_LIST_FOREACH(item, geometries) {
+			double current;
+
+			hkl_geometry_set(geometry, hkl_geometry_list_item_geometry_get(item));
+			hkl_engine_initialized_set(psi, TRUE, NULL);
+			hkl_engine_pseudo_axis_values_get(psi, &current, 1,
+							   HKL_UNIT_DEFAULT, NULL);
+			res &= DIAG(fabs(PSI - current) < HKL_EPSILON);
 		}
+		hkl_geometry_list_free(geometries);
 	}
 
 	/* PsiRef 1 1 0 */
 	/* freeze 0; ca 0 0 2 */
-	parameters[0] = 1;
-	parameters[1] = 1;
-	parameters[2] = 0;
-	parameters[3] = PSI = 0;
+	hkl_p[0] = 1;
+	hkl_p[1] = 1;
+	hkl_p[2] = 0;
+	hkl_p[3] = PSI = 0;
 	/* for hkl */
-	mode = hkl_engine_mode(hkl);
-	hkl_parameter_list_values_set(hkl_mode_parameters(mode),
-				      parameters, ARRAY_SIZE(parameters),
-				      NULL);
-	hkl_engine_set_values_v(hkl, 0., 0., 2.);
+	hkl_engine_parameters_values_set(hkl, hkl_p, ARRAY_SIZE(hkl_p), HKL_UNIT_DEFAULT, NULL);
+	geometries = hkl_engine_set_values_v(hkl, 0., 0., 2.);
 
 	/* for psi */
-	mode = hkl_engine_mode(psi);
-	hkl_parameter_list_values_set(hkl_mode_parameters(mode),
-				      parameters, ARRAY_SIZE(parameters),
-				      NULL);
+	psi_p[0] = 1;
+	psi_p[1] = 1;
+	psi_p[2] = 0;
+	hkl_engine_parameters_values_set(psi, psi_p, ARRAY_SIZE(psi_p), HKL_UNIT_DEFAULT, NULL);
 
 	/*      del              th               chi              phi */
 	/*      23.37681         11.68839         90               -90 */
 	/*      gamma            mu */
 	/*      -2.384186e-09    -1.182388e-14 */
 	/* phi is wrong it should be -45 */
-	if(hkl_engine_set(hkl, NULL)){
-		res &= hkl_geometry_list_check_geometry_unit(
-			geometries,
-			0, 11.688393153063114, 90, -45, 0,  23.376786185344031);
+	if(geometries){
+		res &= DIAG(hkl_geometry_list_check_geometry_unit(geometries, 0, 11.688393153063114, 90, -45, 0, 23.376786185344031));
 
 		/* check that all solution gives the right psi */
-		darray_foreach(item, *items) {
-			hkl_geometry_set(geometry, hkl_geometry_list_item_geometry_get(*item));
-			hkl_engine_initialize(psi, NULL);
-			hkl_engine_list_get(engines);
-			res &= fabs(PSI - hkl_parameter_value_get(darray_item(*pseudo_axes, 0))) < HKL_EPSILON;
+		HKL_GEOMETRY_LIST_FOREACH(item, geometries){
+			double current;
+
+			hkl_geometry_set(geometry, hkl_geometry_list_item_geometry_get(item));
+			hkl_engine_initialized_set(psi, TRUE, NULL);
+			hkl_engine_pseudo_axis_values_get(psi, &current, 1,
+							   HKL_UNIT_DEFAULT, NULL);
+			res &= DIAG(fabs(PSI - current) < HKL_EPSILON);
 		}
+		hkl_geometry_list_free(geometries);
 	}
 
 	/* freeze 45; ca 0 0 2 */
-	parameters[3] = PSI = 45 * HKL_DEGTORAD;
+	hkl_p[3] = PSI = 45 * HKL_DEGTORAD;
 	/* for hkl */
-	mode = hkl_engine_mode(hkl);
-	hkl_parameter_list_values_set(hkl_mode_parameters(mode),
-				      parameters, ARRAY_SIZE(parameters),
-				      NULL);
-	hkl_engine_set_values_v(hkl, 0., 0., 2.);
+	hkl_engine_parameters_values_set(hkl, hkl_p, ARRAY_SIZE(hkl_p), HKL_UNIT_DEFAULT, NULL);
+	geometries = hkl_engine_set_values_v(hkl, 0., 0., 2.);
 
 	/*      del              th               chi              phi */
 	/*      23.37666         11.68837         90               -135 */
 	/*      gamma            mu */
 	/*      -2.384186e-09    -1.182388e-14 */
 	/* phi is wrong it should be -90 */
-	if(hkl_engine_set(hkl, NULL)){
-		res &= hkl_geometry_list_check_geometry_unit(
-			geometries,
-			0, 11.688393153063114, 90, -90, 0,  23.376786185344031);
+	if(geometries){
+		res &= DIAG(hkl_geometry_list_check_geometry_unit(geometries, 0, 11.688393153063114, 90, -90, 0, 23.376786185344031));
 
 		/* check that all solution gives the right psi */
-		darray_foreach(item, *items){
-			hkl_geometry_set(geometry, hkl_geometry_list_item_geometry_get(*item));
-			hkl_engine_initialize(psi, NULL);
-			hkl_engine_list_get(engines);
-			res &= fabs(PSI - hkl_parameter_value_get(darray_item(*pseudo_axes, 0))) < HKL_EPSILON;
+		HKL_GEOMETRY_LIST_FOREACH(item, geometries){
+			double current;
+
+			hkl_geometry_set(geometry, hkl_geometry_list_item_geometry_get(item));
+			hkl_engine_initialized_set(psi, TRUE, NULL);
+			hkl_engine_pseudo_axis_values_get(psi, &current, 1,
+							   HKL_UNIT_DEFAULT, NULL);
+			res &= DIAG(fabs(PSI - current) < HKL_EPSILON);
 		}
+		hkl_geometry_list_free(geometries);
 	}
 
-	ok(res == HKL_TRUE, __func__);
+	ok(res == TRUE, __func__);
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
diff --git a/tests/hkl-pseudoaxis-k4cv-t.c b/tests/hkl-pseudoaxis-k4cv-t.c
index 94eab22..00bce71 100644
--- a/tests/hkl-pseudoaxis-k4cv-t.c
+++ b/tests/hkl-pseudoaxis-k4cv-t.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -25,62 +25,62 @@
 
 static void degenerated(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
-	HklMode **mode;
-	darray_mode *modes;
+	const darray_string *modes;
+	const char **mode;
 	const HklFactory *factory;
 	HklGeometry *geometry;
-	const HklGeometryList *geometries;
 	HklDetector *detector;
 	HklSample *sample;
 	static double hkl[] = {0, 1, 0};
-	HklParameterList *pseudo_axes;
-	darray_parameter *parameters;
 
-	factory = hkl_factory_get_by_name("K4CV");
+	factory = hkl_factory_get_by_name("K4CV", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
-	geometries = hkl_engine_list_geometries(engines);
 
-	engine = hkl_engine_list_get_by_name(engines, "hkl");
-	modes = hkl_engine_modes(engine);
-	pseudo_axes = hkl_engine_pseudo_axes(engine);
+	engine = hkl_engine_list_engine_get_by_name(engines, "hkl", NULL);
+	modes = hkl_engine_modes_names_get(engine);
 
 	darray_foreach(mode, *modes) {
-		hkl_engine_select_mode(engine, *mode);
-		parameters = hkl_mode_parameters(*mode);
-		if(darray_size(*parameters))
-			hkl_parameter_value_set(darray_item(*parameters, 0), 1, NULL);
+		const darray_string *parameters;
+		HklGeometryList *geometries;
+		size_t n_params;
+
+		hkl_engine_current_mode_set(engine, *mode, NULL);
+		parameters = hkl_engine_parameters_names_get(engine);
+		n_params = darray_size(*parameters);
+		if(n_params){
+			double params[n_params];
+
+			hkl_engine_parameters_values_get(engine, params, n_params, HKL_UNIT_DEFAULT);
+			params[0] = 1;
+			hkl_engine_parameters_values_set(engine, params, n_params, HKL_UNIT_DEFAULT, NULL);
+		}
 
 		/* studdy this degenerated case */
-		hkl_parameter_list_values_set(pseudo_axes, hkl, ARRAY_SIZE(hkl), NULL);
-		if (hkl_engine_set(engine, NULL)){
-			const darray_item *items = hkl_geometry_list_items_get(geometries);
-			HklGeometryListItem **item;
-
-			darray_foreach(item, *items){
-				static double null[] = {0, 0, 0};
+		geometries = hkl_engine_pseudo_axis_values_set(engine,
+								hkl, ARRAY_SIZE(hkl),
+								HKL_UNIT_DEFAULT, NULL);
+		if (geometries){
+			const HklGeometryListItem *item;
 
-				hkl_parameter_list_values_set(pseudo_axes,
-							      null, ARRAY_SIZE(null),
-							      NULL);
+			HKL_GEOMETRY_LIST_FOREACH(item, geometries){
 				hkl_geometry_set(geometry,
-						 hkl_geometry_list_item_geometry_get(*item));
-				hkl_engine_get(engine, NULL);
-				res &= check_pseudoaxes(engine, hkl, 3);
+						 hkl_geometry_list_item_geometry_get(item));
+				res &= DIAG(check_pseudoaxes(engine, hkl, 3));
 			}
+			hkl_geometry_list_free(geometries);
 		}
 	}
 
-	ok(res == HKL_TRUE, "degenerated");
+	ok(res == TRUE, "degenerated");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
@@ -90,66 +90,72 @@ static void degenerated(void)
 
 static void eulerians(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
-	HklMode **mode;
-	darray_mode *modes;
+	const darray_string *modes;
+	const char **mode;
 	const HklFactory *factory;
 	HklGeometry *geometry;
-	const HklGeometryList *geometries;
 	HklDetector *detector;
 	HklSample *sample;
 	static double eulerians[] = {0., 90 * HKL_DEGTORAD, 0.};
-	HklParameterList *pseudo_axes;
 
-	factory = hkl_factory_get_by_name("K4CV");
+	factory = hkl_factory_get_by_name("K4CV", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
-	geometries = hkl_engine_list_geometries(engines);
 
-	engine = hkl_engine_list_get_by_name(engines, "eulerians");
-	modes = hkl_engine_modes(engine);
-	pseudo_axes = hkl_engine_pseudo_axes(engine);
+	engine = hkl_engine_list_engine_get_by_name(engines, "eulerians", NULL);
+	modes = hkl_engine_modes_names_get(engine);
 
 	darray_foreach(mode, *modes){
-		darray_parameter *parameters;
-
-		hkl_engine_select_mode(engine, *mode);
-		parameters = hkl_mode_parameters(*mode);
-		if(darray_size(*parameters))
-			hkl_parameter_value_set(darray_item(*parameters, 0), 1, NULL);
+		const darray_string *parameters;
+		HklGeometryList *geometries;
+		size_t n_params;
+
+		hkl_engine_current_mode_set(engine, *mode, NULL);
+		parameters = hkl_engine_parameters_names_get(engine);
+		n_params = darray_size(*parameters);
+		if(n_params){
+			double params[n_params];
+
+			hkl_engine_parameters_values_get(engine, params, n_params, HKL_UNIT_DEFAULT);
+			params[0] = 1;
+			hkl_engine_parameters_values_set(engine, params, n_params, HKL_UNIT_DEFAULT, NULL);
+		}
 
 		/* studdy this degenerated case */
-		hkl_parameter_list_values_set(pseudo_axes,
-					      eulerians, ARRAY_SIZE(eulerians),
-					      NULL);
-		if (hkl_engine_set(engine, NULL)) {
-			const darray_item *items = hkl_geometry_list_items_get(geometries);
-
-			res &= darray_size(*items) == 2;
-
-			/* first solution = 0, 90, 0 */
+		geometries = hkl_engine_pseudo_axis_values_set(engine,
+								eulerians, ARRAY_SIZE(eulerians),
+								HKL_UNIT_DEFAULT, NULL);
+		if (geometries) {
+			const HklGeometryListItem *item;
+
+			/* first solution = -180, -90, 180 */
+			item = hkl_geometry_list_items_first_get(geometries);
 			hkl_geometry_set(geometry,
-					 hkl_geometry_list_item_geometry_get(darray_item(*items, 1)));
-			hkl_engine_get(engine, NULL);
-			res &= check_pseudoaxes_v(engine, 0., 90 * HKL_DEGTORAD, 0.);
+					 hkl_geometry_list_item_geometry_get(item));
+			res &= DIAG(check_pseudoaxes_v(engine, -180. * HKL_DEGTORAD, -90 * HKL_DEGTORAD, 180. * HKL_DEGTORAD));
 
-			/* second solution = -180, -90, 180 */
+			/* second solution = 0, 90, 0 */
+			item = hkl_geometry_list_items_next_get(geometries,item);
 			hkl_geometry_set(geometry,
-					 hkl_geometry_list_item_geometry_get(darray_item(*items, 0)));
-			hkl_engine_get(engine, NULL);
-			res &= check_pseudoaxes_v(engine, -180. * HKL_DEGTORAD, -90 * HKL_DEGTORAD, 180. * HKL_DEGTORAD);
+					 hkl_geometry_list_item_geometry_get(item));
+			res &= DIAG(check_pseudoaxes_v(engine, 0., 90 * HKL_DEGTORAD, 0.));
+
+			/* no more solution */
+			res &= DIAG(hkl_geometry_list_items_next_get(geometries, item) == NULL);
+
+			hkl_geometry_list_free(geometries);
 		}
 	}
 
-	ok(res == HKL_TRUE, "eulerians");
+	ok(res == TRUE, "eulerians");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
@@ -159,57 +165,55 @@ static void eulerians(void)
 
 static void q(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
-	HklMode **mode;
-	darray_mode *modes;
+	const darray_string *modes;
+	const char **mode;
 	const HklFactory *factory;
 	HklGeometry *geometry;
-	const HklGeometryList *geometries;
 	HklDetector *detector;
 	HklSample *sample;
 
-	factory = hkl_factory_get_by_name("K4CV");
+	factory = hkl_factory_get_by_name("K4CV", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
-	geometries = hkl_engine_list_geometries(engines);
 
-	engine = hkl_engine_list_get_by_name(engines, "q");
-	modes = hkl_engine_modes(engine);
+	engine = hkl_engine_list_engine_get_by_name(engines, "q", NULL);
+	modes = hkl_engine_modes_names_get(engine);
 
 	/* the init part */
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
-	hkl_engine_initialize(engine, NULL);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., 0., 60.);
+	hkl_engine_initialized_set(engine, TRUE, NULL);
 
 	darray_foreach(mode, *modes){
 		double q;
 
-		hkl_engine_select_mode(engine, *mode);
+		hkl_engine_current_mode_set(engine, *mode, NULL);
 		for(q=-1.; q<1.; q += 0.1){
-			hkl_engine_set_values_v(engine, q, NULL);
-			if(hkl_engine_set(engine, NULL)){
-				const darray_item *items = hkl_geometry_list_items_get(geometries);
-				HklGeometryListItem **item;
+			HklGeometryList *geometries;
+
+			geometries = hkl_engine_set_values_v(engine, q, NULL);
+			if(geometries){
+				const HklGeometryListItem *item;
 
-				darray_foreach(item, *items){
+				HKL_GEOMETRY_LIST_FOREACH(item, geometries){
 					hkl_engine_set_values_v(engine, 0.);
 					hkl_geometry_set(geometry,
-							 hkl_geometry_list_item_geometry_get(*item));
-					hkl_engine_get(engine, NULL);
-					res &= check_pseudoaxes_v(engine, q);
+							 hkl_geometry_list_item_geometry_get(item));
+					res &= DIAG(check_pseudoaxes_v(engine, q));
 				}
+				hkl_geometry_list_free(geometries);
 			}
 		}
 	}
 
-	ok(res == HKL_TRUE, "q");
+	ok(res == TRUE, "q");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
diff --git a/tests/hkl-pseudoaxis-k6c-t.c b/tests/hkl-pseudoaxis-k6c-t.c
index ecb4fed..5a900dc 100644
--- a/tests/hkl-pseudoaxis-k6c-t.c
+++ b/tests/hkl-pseudoaxis-k6c-t.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -25,67 +25,76 @@
 
 static void degenerated(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
-	HklMode **mode;
-	darray_mode *modes;
+	const darray_string *modes;
+	const char **mode;
 	const HklFactory *factory;
 	HklGeometry *geometry;
-	const HklGeometryList *geometries;
 	HklDetector *detector;
 	HklSample *sample;
 	static double hkl[] = {0, 1, 0};
-	HklParameterList *pseudo_axes;
 
-	factory = hkl_factory_get_by_name("K6C");
+	factory = hkl_factory_get_by_name("K6C", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
-	geometries = hkl_engine_list_geometries(engines);
 
-	engine = hkl_engine_list_get_by_name(engines, "hkl");
-	modes = hkl_engine_modes(engine);
-	pseudo_axes = hkl_engine_pseudo_axes(engine);
+	engine = hkl_engine_list_engine_get_by_name(engines, "hkl", NULL);
+	modes = hkl_engine_modes_names_get(engine);
 
 	darray_foreach(mode, *modes){
-		darray_parameter *parameters;
-
-		hkl_engine_select_mode(engine, *mode);
-		parameters = hkl_mode_parameters(*mode);
-		if (!strcasecmp(hkl_mode_name(*mode),
-				"constant_chi_vertical"))
-			hkl_parameter_value_set(darray_item(*parameters, 0), 1, NULL);
-		if (!strcasecmp(hkl_mode_name(*mode),
-				"constant_incidence"))
-			hkl_parameter_value_set(darray_item(*parameters, 3), 1, NULL);
+		const darray_string *parameters;
+		HklGeometryList *geometries;
+
+		hkl_engine_current_mode_set(engine, *mode, NULL);
+		parameters = hkl_engine_parameters_names_get(engine);
+		if (!strcasecmp(*mode, "constant_chi_vertical")){
+			size_t n_params = darray_size(*parameters);
+			double params[n_params];
+
+			hkl_engine_parameters_values_get(engine,
+							 params, n_params,
+							 HKL_UNIT_DEFAULT);
+			params[0] = 1;
+			hkl_engine_parameters_values_set(engine,
+							 params, n_params,
+							 HKL_UNIT_DEFAULT, NULL);
+		}
+		if (!strcasecmp(*mode, "constant_incidence")){
+			size_t n_params = darray_size(*parameters);
+			double params[n_params];
+
+			hkl_engine_parameters_values_get(engine,
+							 params, n_params,
+							 HKL_UNIT_DEFAULT);
+			params[3] = 1;
+			hkl_engine_parameters_values_set(engine,
+							 params, n_params,
+							 HKL_UNIT_DEFAULT, NULL);
+		}
 
 		/* studdy this degenerated case */
-		hkl_parameter_list_values_set(pseudo_axes,
-					      hkl, ARRAY_SIZE(hkl), NULL);
-		if (hkl_engine_set(engine, NULL)){
-			const darray_item *items = hkl_geometry_list_items_get(geometries);
-			HklGeometryListItem **item;
-
-			darray_foreach(item, *items){
-				static double null[] = {0, 0, 0};
-
-				hkl_parameter_list_values_set(pseudo_axes,
-							      null, ARRAY_SIZE(null),
-							      NULL);
-				hkl_geometry_set(geometry, hkl_geometry_list_item_geometry_get(*item));
-				hkl_engine_get(engine, NULL);
-				res &= check_pseudoaxes(engine, hkl, ARRAY_SIZE(hkl));
+		geometries = hkl_engine_pseudo_axis_values_set(engine,
+								hkl, ARRAY_SIZE(hkl),
+								HKL_UNIT_DEFAULT, NULL);
+		if (geometries){
+			const HklGeometryListItem *item;
+
+			HKL_GEOMETRY_LIST_FOREACH(item, geometries){
+				hkl_geometry_set(geometry, hkl_geometry_list_item_geometry_get(item));
+				res &= DIAG(check_pseudoaxes(engine, hkl, ARRAY_SIZE(hkl)));
 			}
+			hkl_geometry_list_free(geometries);
 		}
 	}
 
-	ok(res == HKL_TRUE, "degenerated");
+	ok(res == TRUE, "degenerated");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
@@ -95,63 +104,75 @@ static void degenerated(void)
 
 static void eulerians(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
-	HklMode **mode;
-	darray_mode *modes;
-	HklGeometryListItem *item;
+	const darray_string *modes;
+	const char **mode;
+	const HklGeometryListItem *item;
 	const HklFactory *factory;
 	HklGeometry *geometry;
-	const HklGeometryList *geometries;
 	HklDetector *detector;
 	HklSample *sample;
 
-	factory = hkl_factory_get_by_name("K6C");
+	factory = hkl_factory_get_by_name("K6C", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
-	geometries = hkl_engine_list_geometries(engines);
 
-	engine = hkl_engine_list_get_by_name(engines, "eulerians");
-	modes = hkl_engine_modes(engine);
+	engine = hkl_engine_list_engine_get_by_name(engines, "eulerians", NULL);
+	modes = hkl_engine_modes_names_get(engine);
 
 	darray_foreach(mode, *modes){
 		double omega, chi, phi;
-		darray_parameter *parameters;
-
-		hkl_engine_select_mode(engine, *mode);
-		parameters = hkl_mode_parameters(*mode);
-		if (darray_size(*parameters))
-			hkl_parameter_value_set(darray_item(*parameters, 0), 1, NULL);
+		const darray_string *parameters;
+		HklGeometryList *geometries;
+		size_t n_params;
+
+		hkl_engine_current_mode_set(engine, *mode, NULL);
+		parameters = hkl_engine_parameters_names_get(engine);
+		n_params = darray_size(*parameters);
+		if (n_params){
+			double params[n_params];
+
+			hkl_engine_parameters_values_get(engine,
+							 params, n_params,
+							 HKL_UNIT_DEFAULT);
+			params[0] = 1;
+			hkl_engine_parameters_values_set(engine,
+							 params, n_params,
+							 HKL_UNIT_DEFAULT, NULL);
+		}
 
 		/* studdy this degenerated case */
-		hkl_engine_set_values_v(engine, 0., 90. * HKL_DEGTORAD, 0.);
-		if (hkl_engine_set(engine, NULL)) {
-			const darray_item *items = hkl_geometry_list_items_get(geometries);
+		geometries = hkl_engine_set_values_v(engine, 0., 90. * HKL_DEGTORAD, 0.);
+		if (geometries) {
+			res &= DIAG(hkl_geometry_list_n_items_get(geometries) == 2);
 
-			res &= darray_size(*items) == 2;
-
-			/* first solution = 0, 90, 0 */
+			/* first solution = -180, -90, 180 */
+			item = hkl_geometry_list_items_first_get(geometries);
 			hkl_geometry_set(geometry,
-					 hkl_geometry_list_item_geometry_get(darray_item(*items, 1)));
-			hkl_engine_get(engine, NULL);
-			res &= check_pseudoaxes_v(engine, 0., 90. * HKL_DEGTORAD, 0.);
+					 hkl_geometry_list_item_geometry_get(item));
+			res &= DIAG(check_pseudoaxes_v(engine, -180. * HKL_DEGTORAD, -90. * HKL_DEGTORAD, 180. * HKL_DEGTORAD));
 
-			/* second solution = -180, -90, 180 */
+			/* second solution = 0, 90, 0 */
+			item = hkl_geometry_list_items_next_get(geometries, item);
 			hkl_geometry_set(geometry,
-					 hkl_geometry_list_item_geometry_get(darray_item(*items, 0)));
-			hkl_engine_get(engine, NULL);
-			res &= check_pseudoaxes_v(engine, -180. * HKL_DEGTORAD, -90. * HKL_DEGTORAD, 180. * HKL_DEGTORAD);
+					 hkl_geometry_list_item_geometry_get(item));
+			res &= DIAG(check_pseudoaxes_v(engine, 0., 90. * HKL_DEGTORAD, 0.));
+
+			/* no more solution */
+			res &= DIAG(hkl_geometry_list_items_next_get(geometries, item) == NULL);
+
+			hkl_geometry_list_free(geometries);
 		}
 	}
 
-	ok(res == HKL_TRUE, "eulerians");
+	ok(res == TRUE, "eulerians");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
@@ -161,68 +182,58 @@ static void eulerians(void)
 
 static void q2(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
-	HklMode **mode;
-	darray_mode *modes;
+	const darray_string *modes;
+	const char **mode;
 	const HklFactory *factory;
 	HklGeometry *geometry;
-	const HklGeometryList *geometries;
 	HklDetector *detector;
 	HklSample *sample;
-	HklParameterList *pseudo_axes;
 
-	factory = hkl_factory_get_by_name("K6C");
+	factory = hkl_factory_get_by_name("K6C", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
-	geometries = hkl_engine_list_geometries(engines);
 
-	engine = hkl_engine_list_get_by_name(engines, "q2");
-	modes = hkl_engine_modes(engine);
-	pseudo_axes = hkl_engine_pseudo_axes(engine);
+	engine = hkl_engine_list_engine_get_by_name(engines, "q2", NULL);
+	modes = hkl_engine_modes_names_get(engine);
 
 	/* the init part */
-	hkl_geometry_set_values_unit_v(geometry, 0., 30., 0., 0., 0., 60.);
-	hkl_engine_initialize(engine, NULL);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 0., 30., 0., 0., 0., 60.);
+	hkl_engine_initialized_set(engine, TRUE, NULL);
 
 	darray_foreach(mode, *modes){
 		double q, alpha;
 
-		hkl_engine_select_mode(engine, *mode);
+		hkl_engine_current_mode_set(engine, *mode, NULL);
 		for(q=0.1; q<1.; q += 0.1)
 			for(alpha = -M_PI; alpha<M_PI; alpha += M_PI/180.){
 				double values[] = {q, alpha};
+				HklGeometryList *geometries;
 
-				hkl_parameter_list_values_set(pseudo_axes,
-							      values, ARRAY_SIZE(values),
-							      NULL);
-				if(hkl_engine_set(engine, NULL)){
-					const darray_item *items = hkl_geometry_list_items_get(geometries);
-					HklGeometryListItem **item;
-
-					darray_foreach(item, *items){
-						static double null[] = {0, 0};
+				geometries = hkl_engine_pseudo_axis_values_set(engine,
+									       values, ARRAY_SIZE(values),
+									       HKL_UNIT_DEFAULT, NULL);
+				if(geometries){
+					const HklGeometryListItem *item;
 
-						hkl_parameter_list_values_set(pseudo_axes,
-									      null, ARRAY_SIZE(null),
-									      NULL);
+					HKL_GEOMETRY_LIST_FOREACH(item, geometries){
 						hkl_geometry_set(geometry,
-								 hkl_geometry_list_item_geometry_get(*item));
-						hkl_engine_get(engine, NULL);
-						res &= check_pseudoaxes(engine, values, 2);
+								 hkl_geometry_list_item_geometry_get(item));
+						res &= DIAG(check_pseudoaxes(engine, values, 2));
 					}
+					hkl_geometry_list_free(geometries);
 				}
 			}
 	}
 
-	ok(res == HKL_TRUE, "q2");
+	ok(res == TRUE, "q2");
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
@@ -233,7 +244,7 @@ static void q2(void)
 
 static void m15110(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
 	const HklFactory *factory;
@@ -241,28 +252,27 @@ static void m15110(void)
 	HklDetector *detector;
 	HklSample *sample;
 
-	factory = hkl_factory_get_by_name("K6C");
+	factory = hkl_factory_get_by_name("K6C", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 	sample = hkl_sample_new("test");
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
 
-	engine = hkl_engine_list_get_by_name(engines, "psi");
+	engine = hkl_engine_list_engine_get_by_name(engines, "psi", NULL);
 
 	/* the init part must succed */
-	hkl_geometry_set_values_unit_v(geometry, 0., 62.95, 134.75, 0., 0., 60.);
-	res &= hkl_engine_initialize(engine, NULL);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 0., 62.95, 134.75, 0., 0., 60.);
+	res &= DIAG(hkl_engine_initialized_set(engine, TRUE, NULL));
 
 	hkl_engine_list_free(engines);
 	hkl_detector_free(detector);
 	hkl_sample_free(sample);
 	hkl_geometry_free(geometry);
 
-	ok(res == HKL_TRUE, "m15110");
+	ok(res == TRUE, "m15110");
 }
 
 int main(int argc, char** argv)
diff --git a/tests/hkl-pseudoaxis-soleil-sixs-med-t.c b/tests/hkl-pseudoaxis-soleil-sixs-med-t.c
index 1d15aeb..b72b001 100644
--- a/tests/hkl-pseudoaxis-soleil-sixs-med-t.c
+++ b/tests/hkl-pseudoaxis-soleil-sixs-med-t.c
@@ -26,12 +26,11 @@
 
 #include "hkl-axis-private.h" /* temporary */
 
-#define GET_GAMMA(items, index) hkl_parameter_value_unit_get(		\
-		darray_item(*hkl_geometry_axes_get(			\
-				     hkl_geometry_list_item_geometry_get( \
-					     darray_item(*(items), (index)))), \
-			     3))
-
+#define GET_GAMMA(geometries) hkl_parameter_value_get(			\
+		hkl_geometry_axis_get(					\
+			hkl_geometry_list_item_geometry_get(		\
+				hkl_geometry_list_items_first_get((geometries))), \
+			"gamma", NULL), HKL_UNIT_USER)
 
 static void qper_qpar(void)
 {
@@ -42,53 +41,50 @@ static void qper_qpar(void)
 	HklDetector *detector;
 	HklSample *sample;
 	size_t i, f_idx;
-	double *Qper, *Qpar;
+	double qper_qpar[2];
 	double gamma;
-	darray_parameter *pseudo_axes;
-	const HklGeometryList *geometries;
-	const darray_item *items;
+	HklGeometryList *geometries;
 	HklMatrix *U;
 
-	factory = hkl_factory_get_by_name("SOLEIL SIXS MED2+3");
+	factory = hkl_factory_get_by_name("SOLEIL SIXS MED2+3", NULL);
 	geom = hkl_factory_create_new_geometry(factory);
 
 	sample = hkl_sample_new("test");
 	U = hkl_matrix_new_euler(-90.0 * HKL_DEGTORAD, 0., 0.);
-	hkl_sample_U_set(sample, U);
+	hkl_sample_U_set(sample, U, NULL);
 	hkl_matrix_free(U);
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geom, detector, sample);
-	geometries = hkl_engine_list_geometries(engines);
-	items = hkl_geometry_list_items_get(geometries);
-
-	engine = hkl_engine_list_get_by_name(engines, "qper_qpar");
-	pseudo_axes = hkl_engine_pseudo_axes(engine);
 
-	Qper = &darray_item(*pseudo_axes, 0)->_value;
-	Qpar = &darray_item(*pseudo_axes, 1)->_value;
+	engine = hkl_engine_list_engine_get_by_name(engines, "qper_qpar", NULL);
 
 	/* the init part */
-	hkl_geometry_set_values_unit_v(geom, 0., 0.1, 0., 0., 90., 0.);
-	hkl_engine_initialize(engine, NULL);
+	hkl_geometry_set_values_v(geom, HKL_UNIT_USER, NULL, 0., 0.1, 0., 0., 90., 0.);
+	hkl_engine_initialized_set(engine, TRUE, NULL);
 
 	/* gamma must be positif */
-	*Qper = 0.1;
-	*Qpar = 4.;
-	if(hkl_engine_set(engine, NULL) == HKL_TRUE){
-		gamma = GET_GAMMA(items, 0);
+	qper_qpar[0] = 0.1;
+	qper_qpar[1] = 4.;
+	geometries = hkl_engine_pseudo_axis_values_set(engine, qper_qpar, ARRAY_SIZE(qper_qpar),
+							HKL_UNIT_DEFAULT, NULL);
+	if(geometries){
+		gamma = GET_GAMMA(geometries);
 		is_double(2.61077, gamma, HKL_EPSILON * 10, __func__);
+		hkl_geometry_list_free(geometries);
 	}
 
 	/* gamma must be negatif */
-	*Qper = -0.1;
-	*Qpar = 4.;
-	if(hkl_engine_set(engine, NULL) == HKL_TRUE){
-		gamma = GET_GAMMA(items, 0);
+	qper_qpar[0] = -0.1;
+	qper_qpar[1] = 4.;
+	geometries = hkl_engine_pseudo_axis_values_set(engine, qper_qpar, ARRAY_SIZE(qper_qpar),
+							HKL_UNIT_DEFAULT, NULL);
+	if(geometries){
+		gamma = GET_GAMMA(geometries);
 		is_double(-2.7956354, gamma, HKL_EPSILON * 10, __func__);
+		hkl_geometry_list_free(geometries);
 	}
 
 	hkl_engine_list_free(engines);
@@ -97,11 +93,77 @@ static void qper_qpar(void)
 	hkl_geometry_free(geom);
 }
 
+static void med_2_3(void)
+{
+	int res = TRUE;
+	HklEngineList *engines;
+	HklEngine *hkl;
+	const HklFactory *factory;
+	const HklGeometryListItem *item;
+	HklGeometry *geometry;
+	HklGeometryList *geometries;
+	HklDetector *detector;
+	HklSample *sample;
+	HklLattice *lattice;
+	HklMatrix *U;
+	static double positions[] = {0, 1, -14.27, 99.62, 60.98, 0};
+	static double hkl_p[] = {1.95, 2, 6};
+
+	/* Wavelength 1.54980 */
+	/* Mode       mu_fixed */
+	/* Ux -90.59 Uy -9.97 Uz 176.35  */
+	/* A 4.759 B 4.759 C 12.992  */
+	/* Alpha 90 Beta 90 Gamma 120  */
+
+	factory = hkl_factory_get_by_name("SOLEIL SIXS MED2+3", NULL);
+	geometry = hkl_factory_create_new_geometry(factory);
+
+	hkl_geometry_axis_values_set(geometry,
+				     positions, ARRAY_SIZE(positions), HKL_UNIT_USER,
+				     NULL);
+	hkl_geometry_wavelength_set(geometry, 1.54980, HKL_UNIT_DEFAULT, NULL);
+
+	sample = hkl_sample_new("test");
+	lattice = hkl_lattice_new(4.759, 4.759, 12.992,
+				  90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 120*HKL_DEGTORAD,
+				  NULL);
+	hkl_sample_lattice_set(sample, lattice);
+	hkl_lattice_free(lattice);
+	U = hkl_matrix_new_euler(-90.59 * HKL_DEGTORAD,
+				 -9.97 * HKL_DEGTORAD,
+				 176.35 * HKL_DEGTORAD);
+	hkl_sample_U_set(sample, U, NULL);
+	hkl_matrix_free(U);
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+
+	hkl = hkl_engine_list_engine_get_by_name(engines, "hkl", NULL);
+	hkl_engine_current_mode_set(hkl, "mu_fixed", NULL);
+
+	/* hkl 1.95, 2, 6 (should not fail) */
+	geometries = hkl_engine_pseudo_axis_values_set(hkl,
+						       hkl_p, ARRAY_SIZE(hkl_p),
+						       HKL_UNIT_DEFAULT, NULL);
+	res &= DIAG((geometries != NULL));
+	hkl_geometry_list_free(geometries);
+
+	ok(res == TRUE, __func__);
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
 int main(int argc, char** argv)
 {
-	plan(2);
+	plan(3);
 
 	qper_qpar();
+	med_2_3();
 
 	return 0;
 }
diff --git a/tests/hkl-pseudoaxis-t.c b/tests/hkl-pseudoaxis-t.c
index 42e2e75..e79872e 100644
--- a/tests/hkl-pseudoaxis-t.c
+++ b/tests/hkl-pseudoaxis-t.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -23,93 +23,195 @@
 #include <string.h>
 #include "hkl.h"
 #include <tap/basic.h>
+#include <tap/hkl-tap.h>
 
-#define with_log 1
+#define DEBUG
 
-static int test_engine(HklEngine *engine, HklEngineList *engine_list, unsigned int n)
+
+typedef int (* test_func) (HklEngine *engine, HklEngineList *engine_list, unsigned int n);
+
+static int __test(unsigned int nb_iter, test_func f, int foreach_mode)
+{
+	HklFactory **factories;
+	unsigned int i, j, n;
+	HklGeometry *geometry = NULL;
+	HklDetector *detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	HklSample *sample = hkl_sample_new("test");
+	HklEngineList *engines;
+	int res = TRUE;
+	const char **mode;
+
+	factories = hkl_factory_get_all(&n);
+	for(i=0; i<n && TRUE == res; i++){
+		HklEngine **engine;
+
+		geometry = hkl_factory_create_new_geometry(factories[i]);
+		engines = hkl_factory_create_new_engine_list(factories[i]);
+		hkl_engine_list_init(engines, geometry, detector, sample);
+		darray_foreach(engine, *hkl_engine_list_engines_get(engines)){
+			const darray_string *modes = hkl_engine_modes_names_get(*engine);
+			if (foreach_mode){
+				darray_foreach(mode, *modes){
+					res &= DIAG(hkl_engine_current_mode_set(*engine, *mode, NULL));
+					for(j=0; j<nb_iter; ++j){
+						res &= DIAG(f(*engine, engines, nb_iter));
+						if(!res){
+							diag("failed at factory: \"%s\" engine: \"%s\" mode: \"%s\"",
+							     hkl_geometry_name_get(geometry),
+							     hkl_engine_name_get(*engine), *mode);
+							break;
+						}
+					}
+					if(!res)
+						break;
+				}
+			}else{
+				for(j=0; j<nb_iter; ++j){
+					res &= DIAG(f(*engine, engines, nb_iter));
+					if(!res)
+						break;
+				}
+			}
+			if(!res)
+				break;
+		}
+		hkl_geometry_free(geometry);
+		hkl_engine_list_free(engines);
+	}
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+
+	return res;
+}
+
+#define TEST(_nb_iter, _f) __test(_nb_iter, _f, 0)
+#define TEST_FOREACH_MODE(_nb_iter, _f) __test(_nb_iter, _f, 1)
+
+static void factories(void)
+{
+	int res = TRUE;
+	uint i, n;
+	HklEngineList *engines;
+	HklFactory **factories;
+
+	factories = hkl_factory_get_all(&n);
+	for(i=0;i<n; i++){
+		engines = hkl_factory_create_new_engine_list(factories[i]);
+		hkl_engine_list_free(engines);
+	}
+
+	ok(res == TRUE, "factories");
+}
+
+static int _get(HklEngine *engine, HklEngineList *engine_list, unsigned int n)
 {
 	uint i;
-	double values[10]; /* this should be the number of pseudo_axis */
+	GError *error;
+	int res = TRUE;
+	HklGeometry *geometry = hkl_engine_list_geometry_get(engine_list);
+	const darray_string *pseudo_axes = hkl_engine_pseudo_axis_names_get(engine);
+	const size_t n_pseudo_axes = darray_size(*pseudo_axes);
+	double targets[n_pseudo_axes];
+	double currents[n_pseudo_axes];
+
+	/* randomize the geometry */
+	hkl_geometry_randomize(geometry);
+
+	/* randomize the pseudoAxes values */
+	hkl_tap_engine_pseudo_axes_randomize(engine,
+					     targets, n_pseudo_axes,
+					     HKL_UNIT_DEFAULT);
+
+	/* randomize the parameters */
+	hkl_tap_engine_parameters_randomize(engine);
+
+	/* pseudo -> geometry */
+	if(HKL_ENGINE_CAPABILITIES_INITIALIZABLE & hkl_engine_capabilities_get(engine))
+		res &= DIAG(hkl_engine_initialized_set(engine, TRUE, NULL));
+	res &= DIAG(hkl_engine_pseudo_axis_values_get(engine, currents, n_pseudo_axes,
+						      HKL_UNIT_DEFAULT, NULL));
+
+	/* idem with error management */
+	error = NULL;
+	res &= DIAG(hkl_engine_pseudo_axis_values_get(engine, currents, n_pseudo_axes,
+						      HKL_UNIT_DEFAULT, &error));
+	res &= DIAG(NULL == error);
+	for(i=0; i<n_pseudo_axes; ++i)
+		res &= DIAG(targets[i] != currents[i]); /* TODO this test is almost true, need a real check */
+
+	return res;
+}
+
+static void get()
+{
+	ok(TRUE == TEST_FOREACH_MODE(1, _get), __func__);
+}
+
+static int _set(HklEngine *engine, HklEngineList *engine_list, unsigned int n)
+{
+	uint i;
+	GError *error = NULL;
 	int unreachable = 0;
-	int ko = HKL_FALSE;
-	HklMode **mode;
-	const HklGeometryList *geometries = hkl_engine_list_geometries(engine_list);
-	HklGeometry *geometry = hkl_engine_list_get_geometry(engine_list);
-	darray_mode *modes = hkl_engine_modes(engine);
-	darray_parameter *pseudo_axes = (darray_parameter *)hkl_engine_pseudo_axes(engine);
+	int res = TRUE;
+	HklGeometry *geometry = hkl_engine_list_geometry_get(engine_list);
+	const darray_string *pseudo_axes = hkl_engine_pseudo_axis_names_get(engine);
+	const size_t n_pseudo_axes = darray_size(*pseudo_axes);
+	double targets[n_pseudo_axes];
+	double currents[n_pseudo_axes];
 
 	/* randomize the geometry */
 	hkl_geometry_randomize(geometry);
 
-	darray_foreach(mode, *modes){
-		hkl_engine_select_mode(engine, *mode);
-		/* for now unactive the eulerians check */
-		if(!strcmp(hkl_mode_name(*mode), "eulerians"))
-			continue;
-		unreachable = 0;
-
-		for(i=0;i<n && !ko;++i) {
-			unsigned int j = 0;
-			HklParameter **pseudo_axis;
-
-			/* randomize the pseudoAxes values */
-			darray_foreach(pseudo_axis, *pseudo_axes){
-				hkl_parameter_randomize(*pseudo_axis);
-				values[j++] = hkl_parameter_value_get(*pseudo_axis);
-			}
+	/* for now skip the eulerians check */
+	if(!strcmp(hkl_engine_current_mode_get(engine), "eulerians"))
+		return TRUE;
 
-			/* randomize the parameters */
-			hkl_parameter_list_randomize(hkl_mode_parameters(*mode));
+	size_t j;
+	HklParameter **pseudo_axis;
+	HklGeometryList *solutions;
 
-			/* pseudo -> geometry */
-			hkl_engine_initialize(engine, NULL);
-			/* hkl_engine_fprintf(stderr, engine); */
+	/* randomize the pseudoAxes values */
+	hkl_tap_engine_pseudo_axes_randomize(engine,
+					     targets, n_pseudo_axes,
+					     HKL_UNIT_DEFAULT);
 
-			/* geometry -> pseudo */
-			if(hkl_engine_set(engine, NULL)) {
-				const darray_item *items = hkl_geometry_list_items_get(geometries);
-				HklGeometryListItem **item;
+	/* randomize the parameters */
+	hkl_tap_engine_parameters_randomize(engine);
 
-				darray_foreach(item, *items){
-					/* first modify the pseudoAxes values */
-					/* to be sure that the result is the */
-					/* computed result. */
+	/* pseudo -> geometry */
+	res &= DIAG(hkl_engine_initialized_set(engine, TRUE, &error));
 
-					darray_foreach(pseudo_axis, *pseudo_axes){
-						hkl_parameter_value_set(*pseudo_axis, 0., NULL);
-					}
+	/* geometry -> pseudo */
+	solutions = hkl_engine_pseudo_axis_values_set(engine,
+						      targets, n_pseudo_axes,
+						      HKL_UNIT_DEFAULT, &error);
+	if(solutions) {
+		const HklGeometryListItem *item;
 
-					hkl_geometry_set(geometry,
-							 hkl_geometry_list_item_geometry_get(*item));
-					hkl_engine_get(engine, NULL);
+		HKL_GEOMETRY_LIST_FOREACH(item, solutions){
+			hkl_geometry_set(geometry,
+					 hkl_geometry_list_item_geometry_get(item));
 
-					j = 0;
-					darray_foreach(pseudo_axis, *pseudo_axes){
-						ko |= fabs(values[j] - hkl_parameter_value_get(*pseudo_axis)) >= HKL_EPSILON;
-						++j;
-					}
-					if(ko)
-						break;
-				}
-			}else
-				unreachable++;
+			res &= DIAG(hkl_engine_pseudo_axis_values_get(engine, currents, n_pseudo_axes, HKL_UNIT_DEFAULT, &error));
+			for(j=0; j<n_pseudo_axes; ++j)
+				res &= DIAG(fabs(targets[j] - currents[j]) < HKL_EPSILON);
 		}
-#if with_log
-		fprintf(stderr, "\n\"%s\" \"%s\" \"%s\"",
-			hkl_geometry_name_get(geometry),
-			hkl_engine_name(engine),
-			hkl_mode_name(*mode));
+	}else{
+		res &= DIAG(error != NULL);
+		g_clear_error(&error);
+		unreachable++;
+
+#if 0
 		fprintf(stderr, " unreachable : %d/%d", unreachable, i);
-		if(ko){
+		if(!res){
 			fprintf(stderr, " ko");
 			/* print the hkl internals if the test failed */
 			fprintf(stderr, "\n    expected : ");
-			for(uint j=0; j<darray_size(*pseudo_axes); ++j)
-				fprintf(stderr, " %f", values[j]);
+			for(uint j=0; j<n_pseudo_axes; ++j)
+				fprintf(stderr, " %f", targets[j]);
 			fprintf(stderr, " obtained : ");
-			for(uint j=0; j<darray_size(*pseudo_axes); ++j)
-				fprintf(stderr, " %f",
-					hkl_parameter_value_get(darray_item(*pseudo_axes, j)));
+			for(uint j=0; j<n_pseudo_axes; ++j)
+				fprintf(stderr, " %f", currents[j]);
 			hkl_engine_fprintf(stderr, engine);
 			exit(0);
 		}else{
@@ -117,76 +219,284 @@ static int test_engine(HklEngine *engine, HklEngineList *engine_list, unsigned i
 		}
 #endif
 	}
+	return res;
+}
 
-	return !ko;
+
+static void set(int nb_iter)
+{
+	ok(TRUE == TEST_FOREACH_MODE(nb_iter, _set), __func__);
 }
 
-static int test_engines(HklEngineList *engine_list, int n)
+
+static int _pseudo_axis_get(HklEngine *engine, HklEngineList *engine_list, unsigned int n)
 {
-	int res = HKL_TRUE;
-	HklEngine **engine;
-	darray_engine *engines = hkl_engine_list_engines(engine_list);
+	static const char *bad = "_bad_name_";
+	const darray_string *pseudo_axis_names = hkl_engine_pseudo_axis_names_get(engine);
+	const char **pseudo_axis_name;
+	const HklParameter *pseudo_axis;
+	int res = TRUE;
+	GError *error;
+
+	darray_foreach(pseudo_axis_name, *pseudo_axis_names){
+		pseudo_axis = hkl_engine_pseudo_axis_get(engine, *pseudo_axis_name, NULL);
+		res &= DIAG(NULL != pseudo_axis);
 
-	darray_foreach(engine, *engines){
-		res &= test_engine(*engine, engine_list, n);
+		error = NULL;
+		pseudo_axis = hkl_engine_pseudo_axis_get(engine, *pseudo_axis_name, &error);
+		res &= DIAG(NULL != pseudo_axis);
+		res &= DIAG(NULL == error);
 	}
 
-#if with_log
-	fprintf(stderr, "\n");
-#endif
+	/* error */
+	pseudo_axis = hkl_engine_pseudo_axis_get(engine, bad, NULL);
+	res &= DIAG(NULL == pseudo_axis);
+
+	error = NULL;
+	pseudo_axis = hkl_engine_pseudo_axis_get(engine, bad, &error);
+	res &= DIAG(NULL == pseudo_axis);
+	res &= DIAG(error != NULL);
+	g_clear_error(&error);
+
 	return res;
 }
 
-static void factories(void)
+static void pseudo_axis_get(void)
 {
-	int res = HKL_TRUE;
-	uint i, n;
-	HklEngineList *engines;
-	HklFactory **factories;
+	ok(TRUE == TEST(1, _pseudo_axis_get), __func__);
+}
 
-	factories = hkl_factory_get_all(&n);
-	for(i=0;i<n; i++){
-		engines = hkl_factory_create_new_engine_list(factories[i]);
-		hkl_engine_list_free(engines);
+static int _capabilities(HklEngine *engine, HklEngineList *engine_list, unsigned int n)
+{
+	int res = TRUE;
+	const unsigned long capabilities = hkl_engine_capabilities_get(engine);
+
+	/* all motors must have the read/write capabilities */
+	res &= DIAG((capabilities & HKL_ENGINE_CAPABILITIES_READABLE) != 0);
+	res &= DIAG((capabilities & HKL_ENGINE_CAPABILITIES_WRITABLE) != 0);
+
+	/* all psi engines must be initialisable */
+	if(!strcmp("psi", hkl_engine_name_get(engine)))
+		res &= DIAG((capabilities & HKL_ENGINE_CAPABILITIES_INITIALIZABLE) != 0);
+
+	return res;
+}
+
+static void capabilities(void)
+{
+	ok(TRUE == TEST_FOREACH_MODE(1, _capabilities), __func__);
+}
+
+static int _initialized(HklEngine *engine, HklEngineList *engine_list, unsigned int n)
+{
+	int res = TRUE;
+	GError *error = NULL;
+	const unsigned long capabilities = hkl_engine_capabilities_get(engine);
+
+	if(HKL_ENGINE_CAPABILITIES_INITIALIZABLE & capabilities){
+		int tmp;
+
+		res &= DIAG(TRUE == hkl_engine_initialized_set(engine, FALSE, NULL));
+		res &= DIAG(FALSE == hkl_engine_initialized_get(engine));
+		tmp = hkl_engine_initialized_set(engine, TRUE, NULL);
+		res &= DIAG(tmp == hkl_engine_initialized_get(engine));
+
+		res &= DIAG(TRUE == hkl_engine_initialized_set(engine, FALSE, &error));
+		res &= DIAG(FALSE == hkl_engine_initialized_get(engine));
+		res &= DIAG(NULL == error);
+		tmp = hkl_engine_initialized_set(engine, TRUE, &error);
+		res &= DIAG(tmp == hkl_engine_initialized_get(engine));
+		if(tmp)
+			res &= DIAG(NULL == error);
+		else{
+			res &= DIAG(NULL != error);
+			g_clear_error(&error);
+		}
+	}else{
+		/* non-initializable engine should not produce an error */
+		res &= DIAG(TRUE == hkl_engine_initialized_get(engine));
+		res &= DIAG(TRUE == hkl_engine_initialized_set(engine, TRUE, NULL));
+		res &= DIAG(TRUE == hkl_engine_initialized_get(engine));
+		res &= DIAG(TRUE == hkl_engine_initialized_set(engine, FALSE, NULL));
+		res &= DIAG(TRUE == hkl_engine_initialized_get(engine));
+
+		res &= DIAG(TRUE == hkl_engine_initialized_set(engine, TRUE, &error));
+		res &= DIAG(TRUE == hkl_engine_initialized_get(engine));
+		res &= DIAG(NULL == error);
+		res &= DIAG(TRUE == hkl_engine_initialized_set(engine, FALSE, &error));
+		res &= DIAG(TRUE == hkl_engine_initialized_get(engine));
+		res &= DIAG(NULL == error);
 	}
 
-	ok(res == HKL_TRUE, "factories");
+	return res;
 }
 
-static void set(int nb_iter)
+static void initialized(void)
 {
-	HklFactory **factories;
-	unsigned int i, n;
-	HklGeometry *geometry = NULL;
-	HklDetector *detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	HklSample *sample = hkl_sample_new("test");
-	HklEngineList *engines;
-	int res = HKL_TRUE;
+	ok(TRUE == TEST_FOREACH_MODE(1, _initialized), __func__);
+}
 
-	/* attach to the second holder */
-	hkl_detector_idx_set(detector, 1);
+HKLAPI int hkl_engine_initialized_set(HklEngine *self, int initialized,
+				      GError **error) HKL_ARG_NONNULL(1) HKL_WARN_UNUSED_RESULT;
 
-	factories = hkl_factory_get_all(&n);
-	for(i=0; i<n; i++){
-		geometry = hkl_factory_create_new_geometry(factories[i]);
-		engines = hkl_factory_create_new_engine_list(factories[i]);
-		hkl_engine_list_init(engines, geometry, detector, sample);
-		res &= test_engines(engines, nb_iter);
-		hkl_geometry_free(geometry);
-		hkl_engine_list_free(engines);
+static int _modes(HklEngine *engine, HklEngineList *engine_list, unsigned int n)
+{
+	static const char *bad = "__bad_mode_name__";
+	int res = TRUE;
+	int ok;
+	const darray_string *modes;
+	const char **mode;
+	const char *current_mode;
+	GError *error = NULL;
+
+	modes = hkl_engine_modes_names_get(engine);
+
+	/* check that the current mode is available in the mode list. */
+	current_mode = hkl_engine_current_mode_get(engine);
+	ok = FALSE;
+	darray_foreach(mode, *modes){
+		if(!strcmp(current_mode, *mode))
+			ok = TRUE;
 	}
+	res &= DIAG(TRUE == ok);
 
-	hkl_detector_free(detector);
-	hkl_sample_free(sample);
+	/* check that all modes can be set */
+	darray_foreach(mode, *modes){
+		res &= DIAG(TRUE == hkl_engine_current_mode_set(engine, *mode, NULL));
+
+		res &= DIAG(TRUE == hkl_engine_current_mode_set(engine, *mode, &error));
+		res &= DIAG(NULL == error);
+	}
+
+	/* check for bad mode name */
+	res &= DIAG(FALSE == hkl_engine_current_mode_set(engine, bad, NULL));
 
-	ok(res == HKL_TRUE, "set");
+	res &= DIAG(FALSE == hkl_engine_current_mode_set(engine, bad, &error));
+	res &= DIAG(NULL != error);
+	g_clear_error(&error);
+
+	return res;
+}
+
+static void modes(void)
+{
+	ok(TRUE == TEST(1, _modes), __func__);
+}
+
+static int _check_axes(const darray_string *axes, const darray_string *refs)
+{
+	int ko = TRUE;
+	const char **axis;
+	const char **ref;
+
+	darray_foreach(axis, *axes){
+		darray_foreach(ref, *refs){
+			if(!strcmp(*axis, *ref))
+				ko = FALSE;
+		}
+		if(ko)
+			break;
+		ko = TRUE;
+	}
+	return ko;
+}
+
+static int _axis_names(HklEngine *engine, HklEngineList *engine_list, unsigned int n)
+{
+	int res  = TRUE;
+	HklGeometry *geometry;
+	const darray_string *all_axes;
+	const darray_string *axes_r;
+	const darray_string *axes_w;
+
+	geometry = hkl_engine_list_geometry_get(engine_list);
+	all_axes = hkl_geometry_axis_names_get(geometry);
+
+	/* check consistency of the engines, all axes should be in the
+	 * list of the geometry axes */
+	axes_r = hkl_engine_axis_names_get(engine,
+					   HKL_ENGINE_AXIS_NAMES_GET_READ);
+
+	axes_w = hkl_engine_axis_names_get(engine,
+					   HKL_ENGINE_AXIS_NAMES_GET_WRITE);
+
+	res &= DIAG(axes_r != NULL);
+	res &= DIAG(axes_w != NULL);
+	res &= DIAG(_check_axes(axes_r, all_axes));
+	res &= DIAG(_check_axes(axes_w, all_axes));
+}
+
+static void axis_names(void)
+{
+	ok(TRUE == TEST_FOREACH_MODE(1, _axis_names), __func__);
 }
 
+
+
+static int _parameters(HklEngine *engine, HklEngineList *engine_list, unsigned int n)
+{
+	static const char *bad = "__bad_parameer_name__";
+	int res = TRUE;
+	GError *error = NULL;
+	const char **parameter;
+	const darray_string *parameters = hkl_engine_parameters_names_get(engine);
+	const HklParameter *param;
+	int n_values = darray_size(*parameters);
+	double values[n_values];
+
+	/* can not get a bad parameter */
+	param = hkl_engine_parameter_get(engine, bad, NULL);
+	res &= DIAG(NULL == param);
+
+	param = hkl_engine_parameter_get(engine, bad, &error);
+	res &= DIAG(NULL == param);
+	res &= DIAG(NULL != error);
+	g_clear_error(&error);
+
+	/* it is possible to get and set all the parameters */
+	darray_foreach(parameter, *parameters){
+		/* get */
+		param = hkl_engine_parameter_get(engine, *parameter, NULL);
+		res &= DIAG(NULL != param);
+
+		param = hkl_engine_parameter_get(engine, *parameter, &error);
+		res &= DIAG(NULL != param);
+		res &= DIAG(NULL == error);
+
+		/* set */
+		res &= DIAG(TRUE == hkl_engine_parameter_set(engine, *parameter, param, NULL));
+		res &= DIAG(TRUE == hkl_engine_parameter_set(engine, *parameter, param, &error));
+		res &= DIAG(NULL == error);
+
+		res &= DIAG(FALSE == hkl_engine_parameter_set(engine, bad, param, &error));
+		res &= DIAG(NULL != error);
+		g_clear_error(&error);
+	}
+
+	hkl_engine_parameters_values_get(engine, values, n_values, HKL_UNIT_USER);
+
+	res &= DIAG(TRUE == hkl_engine_parameters_values_set(engine, values, n_values, HKL_UNIT_DEFAULT, NULL));
+	res &= DIAG(TRUE == hkl_engine_parameters_values_set(engine, values, n_values, HKL_UNIT_DEFAULT, &error));
+	res &= DIAG(NULL == error);
+
+	res &= DIAG(TRUE == hkl_engine_parameters_values_set(engine, values, n_values, HKL_UNIT_USER, NULL));
+	res &= DIAG(TRUE == hkl_engine_parameters_values_set(engine, values, n_values, HKL_UNIT_USER, &error));
+	res &= DIAG(NULL == error);
+
+	return res;
+}
+
+static void parameters(void)
+{
+	ok(TRUE == TEST_FOREACH_MODE(1, _parameters), __func__);
+}
+
+
 int main(int argc, char** argv)
 {
 	double n;
 
-	plan(2);
+	plan(9);
 
 	if (argc > 1)
 		n = atoi(argv[1]);
@@ -194,7 +504,14 @@ int main(int argc, char** argv)
 		n = 10;
 
 	factories();
+	get();
 	set(n);
+	pseudo_axis_get();
+	capabilities();
+	initialized();
+	modes();
+	axis_names();
+	parameters();
 
 	return 0;
 }
diff --git a/tests/hkl-pseudoaxis-zaxis-t.c b/tests/hkl-pseudoaxis-zaxis-t.c
index dccc48f..cd28551 100644
--- a/tests/hkl-pseudoaxis-zaxis-t.c
+++ b/tests/hkl-pseudoaxis-zaxis-t.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -25,67 +25,61 @@
 
 static void solution(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	HklEngineList *engines;
 	HklEngine *engine;
 	const HklFactory *factory;
 	HklGeometry *geometry;
-	const HklGeometryList *geometries;
+	HklGeometryList *geometries;
 	HklDetector *detector;
 	HklSample *sample;
 	HklLattice *lattice;
 	static double hkl[] = {1, 1, 0};
-	HklParameterList *pseudo_axes;
 	HklMatrix *U;
 
 	/* get the geometry and set the source */
-	factory = hkl_factory_get_by_name("ZAXIS");
+	factory = hkl_factory_get_by_name("ZAXIS", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
-	hkl_geometry_wavelength_set(geometry, 0.842);
+	hkl_geometry_wavelength_set(geometry, 0.842, HKL_UNIT_DEFAULT, NULL);
 
 	/* set up the sample */
 	sample = hkl_sample_new("test");
 	lattice = hkl_lattice_new(5.432, 5.432, 5.432,
 				  90 * HKL_DEGTORAD,
 				  90 * HKL_DEGTORAD,
-				  90 * HKL_DEGTORAD);
+				  90 * HKL_DEGTORAD,
+				  NULL);
 	hkl_sample_lattice_set(sample, lattice);
 	U = hkl_matrix_new_euler(-90*HKL_DEGTORAD, 0, 0);
-	hkl_sample_U_set(sample, U);
+	hkl_sample_U_set(sample, U, NULL);
 	hkl_lattice_free(lattice);
 	hkl_matrix_free(U);
 
 	/* use a 0D detector */
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	/* select the hkl pseudo axis */
 	engines = hkl_factory_create_new_engine_list(factory);
 	hkl_engine_list_init(engines, geometry, detector, sample);
-	geometries = hkl_engine_list_geometries(engines);
-	engine = hkl_engine_list_get_by_name(engines, "hkl");
-	pseudo_axes = hkl_engine_pseudo_axes(engine);
+	engine = hkl_engine_list_engine_get_by_name(engines, "hkl", NULL);
 
 	/* the init part must succed */
-	hkl_geometry_set_values_unit_v(geometry, 1., 0., 0., 0.);
+	hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 1., 0., 0., 0.);
 
 	/* compute the 1 1 0 */
-	hkl_parameter_list_values_set(pseudo_axes, hkl, ARRAY_SIZE(hkl), NULL);
-	if (hkl_engine_set(engine, NULL)){
-		const darray_item *items = hkl_geometry_list_items_get(geometries);
-		HklGeometryListItem **item;
-
-		darray_foreach(item, *items){
-			static double null[] = {0, 0, 0};
+	geometries = hkl_engine_pseudo_axis_values_set(engine, hkl, ARRAY_SIZE(hkl),
+							HKL_UNIT_DEFAULT, NULL);
+	if (geometries){
+		const HklGeometryListItem *item;
 
-			hkl_parameter_list_values_set(pseudo_axes, null, ARRAY_SIZE(null), NULL);
+		HKL_GEOMETRY_LIST_FOREACH(item, geometries){
 			hkl_geometry_set(geometry,
-					 hkl_geometry_list_item_geometry_get(*item));
-			hkl_engine_get(engine, NULL);
-			res &= check_pseudoaxes(engine, hkl, 3);
+					 hkl_geometry_list_item_geometry_get(item));
+			res &= DIAG(check_pseudoaxes(engine, hkl, 3));
 		}
+		hkl_geometry_list_free(geometries);
 	}else
-		res = HKL_FALSE;
+		res = FALSE;
 	if(!res)
 		hkl_engine_fprintf(stdout, engine);
 
@@ -94,7 +88,7 @@ static void solution(void)
 	hkl_sample_free(sample);
 	hkl_geometry_free(geometry);
 
-	ok(res == HKL_TRUE, "solution");
+	ok(res == TRUE, "solution");
 }
 
 int main(int argc, char** argv)
diff --git a/tests/hkl-quaternion-t.c b/tests/hkl-quaternion-t.c
index e7147c8..2c34dc4 100644
--- a/tests/hkl-quaternion-t.c
+++ b/tests/hkl-quaternion-t.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,6 +22,7 @@
 #include "hkl.h"
 #include <tap/basic.h>
 #include <tap/float.h>
+#include <tap/hkl-tap.h>
 
 #include "hkl-quaternion-private.h"
 
@@ -42,12 +43,12 @@ static void cmp(void)
 	HklQuaternion q = {{1., 2., 3., 4.}};
 	HklQuaternion q1 = {{1., 1., 3., 4.}};
 
-	ok(HKL_TRUE == hkl_quaternion_cmp(&q_ref, &q), __func__);
-	ok(HKL_FALSE == hkl_quaternion_cmp(&q_ref, &q1), __func__);
+	ok(TRUE == hkl_quaternion_cmp(&q_ref, &q), __func__);
+	ok(FALSE == hkl_quaternion_cmp(&q_ref, &q1), __func__);
 
 	/* test the assignation */
 	q1 = q_ref;
-	ok(HKL_TRUE == hkl_quaternion_cmp(&q_ref, &q1), __func__);
+	ok(TRUE == hkl_quaternion_cmp(&q_ref, &q1), __func__);
 }
 
 static void init_from_vector(void)
@@ -57,7 +58,7 @@ static void init_from_vector(void)
 	HklQuaternion q;
 
 	hkl_quaternion_init_from_vector(&q, &v);
-	ok(HKL_TRUE == hkl_quaternion_cmp(&q_ref, &q), __func__);
+	ok(TRUE == hkl_quaternion_cmp(&q_ref, &q), __func__);
 }
 
 static void init_from_angle_and_axe(void)
@@ -68,10 +69,10 @@ static void init_from_angle_and_axe(void)
 	HklQuaternion q;
 
 	hkl_quaternion_init_from_angle_and_axe(&q, 0, &v_ref2);
-	ok(HKL_TRUE == hkl_quaternion_cmp(&q_ref1, &q), __func__);
+	ok(TRUE == hkl_quaternion_cmp(&q_ref1, &q), __func__);
 
 	hkl_quaternion_init_from_angle_and_axe(&q, 90. * HKL_DEGTORAD, &v_ref2);
-	ok(HKL_TRUE == hkl_quaternion_cmp(&q_ref2, &q), __func__);
+	ok(TRUE == hkl_quaternion_cmp(&q_ref2, &q), __func__);
 }
 
 static void times_quaternion(void)
@@ -80,7 +81,7 @@ static void times_quaternion(void)
 	HklQuaternion q = {{1., 2., 3., 4.}};
 
 	hkl_quaternion_times_quaternion(&q, &q);
-	ok(HKL_TRUE == hkl_quaternion_cmp(&q_ref, &q), __func__);
+	ok(TRUE == hkl_quaternion_cmp(&q_ref, &q), __func__);
 }
 
 static void norm2(void)
@@ -96,7 +97,7 @@ static void conjugate(void)
 	HklQuaternion q = {{1., 2., 3., 4.}};
 
 	hkl_quaternion_conjugate(&q);
-	ok(HKL_TRUE == hkl_quaternion_cmp(&q_ref, &q), __func__);
+	ok(TRUE == hkl_quaternion_cmp(&q_ref, &q), __func__);
 }
 
 static void to_matrix(void)
@@ -108,7 +109,7 @@ static void to_matrix(void)
 	HklMatrix *m = hkl_matrix_new();
 
 	hkl_quaternion_to_matrix(&q_ref, m);
-	ok(HKL_TRUE == hkl_matrix_cmp(m_ref, m), __func__);
+	is_matrix(m_ref, m, __func__);
 
 	hkl_matrix_free(m_ref);
 	hkl_matrix_free(m);
diff --git a/tests/hkl-sample-t.c b/tests/hkl-sample-t.c
index a85d9a6..747c6e1 100644
--- a/tests/hkl-sample-t.c
+++ b/tests/hkl-sample-t.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,6 +22,39 @@
 #include "hkl.h"
 #include <tap/basic.h>
 #include <tap/float.h>
+#include <tap/hkl-tap.h>
+
+#define SET(_sample, _param, _value) do{				\
+		HklParameter *parameter = hkl_parameter_new_copy(hkl_sample_ ## _param ## _get(_sample)); \
+		GError *error;						\
+		ok(TRUE == hkl_parameter_value_set(parameter, _value, HKL_UNIT_DEFAULT, NULL), __func__); \
+		error = NULL;						\
+		ok(TRUE == hkl_parameter_value_set(parameter, _value, HKL_UNIT_DEFAULT, &error), __func__); \
+		ok(error == NULL, __func__);				\
+		ok(TRUE == hkl_sample_ ## _param ## _set(_sample, parameter, NULL), __func__); \
+		ok(TRUE == hkl_sample_ ## _param ## _set(_sample, parameter, &error), __func__); \
+		ok(error == NULL, __func__);				\
+		hkl_parameter_free(parameter);				\
+	}while(0)
+
+#define SET_UX_UY_UZ(_sample, _ux, _uy, _uz) do{	\
+	SET(_sample, ux, _ux);\
+	SET(_sample, uy, _uy);\
+	SET(_sample, uz, _uz);\
+}while(0)
+
+#define CHECK(_sample, _param, _value) do{				\
+		is_double(_value,					\
+			  hkl_parameter_value_get(hkl_sample_## _param ## _get(sample), HKL_UNIT_DEFAULT), \
+			  HKL_EPSILON, __func__);			\
+	}while(0)
+
+#define CHECK_UX_UY_UZ(_sample, _ux, _uy, _uz) do{	\
+		CHECK(_sample, ux, _ux);		\
+		CHECK(_sample, uy, _uy);		\
+		CHECK(_sample, uz, _uz);		\
+	}while(0)
+
 
 static void new(void)
 {
@@ -40,19 +73,21 @@ static void add_reflection(void)
 	HklSample *sample;
 	HklSampleReflection *ref;
 
-	factory = hkl_factory_get_by_name("E4CV");
+	factory = hkl_factory_get_by_name("E4CV", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	sample = hkl_sample_new("test");
 
-	ref = hkl_sample_reflection_new(geometry, detector, 1, 0, 0);
+	ok(hkl_sample_n_reflections_get(sample) == 0, __func__);
+	ref = hkl_sample_reflection_new(geometry, detector, 1, 0, 0, NULL);
 	hkl_sample_add_reflection(sample, ref);
+	ok(hkl_sample_n_reflections_get(sample) == 1, __func__);
 
 	/* we can not add two times the same reflection */
 	hkl_sample_add_reflection(sample, ref);
+	ok(hkl_sample_n_reflections_get(sample) == 1, __func__);
 
 	hkl_sample_free(sample);
 	hkl_detector_free(detector);
@@ -68,24 +103,23 @@ static void get_reflection(void)
 	HklSampleReflection *ref;
 	HklSampleReflection *ref2;
 
-	factory = hkl_factory_get_by_name("E4CV");
+	factory = hkl_factory_get_by_name("E4CV", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	sample = hkl_sample_new("test");
 
-	ref = hkl_sample_reflection_new(geometry, detector, 1, 0, 0);
+	ref = hkl_sample_reflection_new(geometry, detector, 1, 0, 0, NULL);
 	hkl_sample_add_reflection(sample, ref);
-	ref2 = hkl_sample_first_reflection_get(sample);
+	ref2 = hkl_sample_reflections_first_get(sample);
 	ok(0 == !ref, __func__);
 	ok(ref == ref2, __func__);
-	ok(NULL == hkl_sample_next_reflection_get(sample, ref2), __func__);
+	ok(NULL == hkl_sample_reflections_next_get(sample, ref2), __func__);
 
-	ref = hkl_sample_reflection_new(geometry, detector, -1, 0, 0);
+	ref = hkl_sample_reflection_new(geometry, detector, -1, 0, 0, NULL);
 	hkl_sample_add_reflection(sample, ref);
-	ref = hkl_sample_reflection_new(geometry, detector, 0, 1, 0);
+	ref = hkl_sample_reflection_new(geometry, detector, 0, 1, 0, NULL);
 	hkl_sample_add_reflection(sample, ref);
 
 	hkl_sample_free(sample);
@@ -101,27 +135,42 @@ static void del_reflection(void)
 	HklSample *sample;
 	HklSampleReflection *ref;
 
-	factory = hkl_factory_get_by_name("E4CV");
+	factory = hkl_factory_get_by_name("E4CV", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	sample = hkl_sample_new("test");
 
-	ref = hkl_sample_reflection_new(geometry, detector, 1, 0, 0);
+	ref = hkl_sample_reflection_new(geometry, detector, 1, 0, 0, NULL);
 	hkl_sample_add_reflection(sample, ref);
+	ok(hkl_sample_n_reflections_get(sample) == 1, __func__);
 	hkl_sample_del_reflection(sample, ref);
-	ok (NULL == hkl_sample_first_reflection_get(sample), __func__);
+	ok(hkl_sample_n_reflections_get(sample) == 0, __func__);
+	ok (NULL == hkl_sample_reflections_first_get(sample), __func__);
 
 	hkl_sample_free(sample);
 	hkl_detector_free(detector);
 	hkl_geometry_free(geometry);
 }
 
-static void  set_UB(void )
+static void set_ux_uy_uz(void)
 {
 	HklSample *sample;
+
+	sample = hkl_sample_new("test");
+
+	SET_UX_UY_UZ(sample, 1 * HKL_DEGTORAD, 2 * HKL_DEGTORAD, 3 * HKL_DEGTORAD);
+	CHECK_UX_UY_UZ(sample, 1 * HKL_DEGTORAD, 2 * HKL_DEGTORAD, 3 * HKL_DEGTORAD);
+
+	hkl_sample_free(sample);
+}
+
+static void set_UB(void)
+{
+	GError *error;
+	HklSample *sample;
+	const HklMatrix *_UB;
 	HklMatrix *UB = hkl_matrix_new_full(HKL_TAU/1.54, 0., 0.,
 					    0., 0., HKL_TAU/1.54,
 					    0., -HKL_TAU/1.54, 0.);
@@ -129,28 +178,46 @@ static void  set_UB(void )
 					   0., 0., 1.,
 					   0.,-1., 0.);
 
+	HklMatrix *UB_wrong = hkl_matrix_new_full(0., 0., 0.,
+						  0., 0., 0.,
+						  0., 0., 0.);
+
 	sample = hkl_sample_new("test");
 
-	hkl_sample_UB_set(sample, UB);
-	ok(HKL_TRUE == hkl_matrix_cmp(U,
-				      hkl_sample_U_get(sample)), __func__);
-	is_double(-90. * HKL_DEGTORAD,
-		  hkl_parameter_value_get(hkl_sample_ux_get(sample)),
-		  HKL_EPSILON, __func__);
-	is_double(0.,
-		  hkl_parameter_value_get(hkl_sample_uy_get(sample)),
-		  HKL_EPSILON, __func__);
-	is_double(0.,
-		  hkl_parameter_value_get(hkl_sample_uz_get(sample)),
-		  HKL_EPSILON, __func__);
+	/* check that reading and writing the current UB works */
+	_UB = hkl_sample_UB_get(sample);
+	ok(TRUE == hkl_sample_UB_set(sample, _UB, NULL), __func__);
+	error = NULL;
+	ok(TRUE == hkl_sample_UB_set(sample, _UB, &error), __func__);
+	ok(error == NULL, __func__);
+
+	CHECK_UX_UY_UZ(sample, 0., 0., 0.);
+
+	/* set a new valid UB matrix */
+	error = NULL;
+	ok(TRUE == hkl_sample_UB_set(sample, UB, NULL), __func__);
+	ok(TRUE == hkl_sample_UB_set(sample, UB, &error), __func__);
+	ok(error == NULL, __func__);
+	is_matrix(U, hkl_sample_U_get(sample), __func__);
+
+	CHECK_UX_UY_UZ(sample, -90. * HKL_DEGTORAD, 0., 0.);
+
+	/* set a non-valid UB matrix */
+	error = NULL;
+	ok(FALSE == hkl_sample_UB_set(sample, UB_wrong, &error), __func__);
+	ok(error != NULL, __func__);
+	g_clear_error(&error);
+	is_matrix(U, hkl_sample_U_get(sample), __func__);
 
 	hkl_sample_free(sample);
+	hkl_matrix_free(UB_wrong);
 	hkl_matrix_free(U);
 	hkl_matrix_free(UB);
 }
 
 static void compute_UB_busing_levy(void)
 {
+	GError *error;
 	HklDetector *detector;
 	const HklFactory *factory;
 	HklGeometry *geometry;
@@ -163,41 +230,59 @@ static void compute_UB_busing_levy(void)
 					       0., 0., 1.,
 					       0.,-1., 0.);
 
-	factory = hkl_factory_get_by_name("E4CV");
+	factory = hkl_factory_get_by_name("E4CV", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	sample = hkl_sample_new("test");
 
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
-	r0 = hkl_sample_reflection_new(geometry, detector, 0, 0, 1);
+	/* first test */
+	ok(TRUE == hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., 0., 60.), __func__);
+	r0 = hkl_sample_reflection_new(geometry, detector, 0, 0, 1, NULL);
 	hkl_sample_add_reflection(sample, r0);
 
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., -90., 60.);
-	r1 = hkl_sample_reflection_new(geometry, detector, -1, 0, 0);
+	ok(TRUE == hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., -90., 60.), __func__);
+	r1 = hkl_sample_reflection_new(geometry, detector, -1, 0, 0, NULL);
 	hkl_sample_add_reflection(sample, r1);
 
-	hkl_sample_compute_UB_busing_levy(sample, r0, r1);
-	ok(HKL_TRUE == hkl_matrix_cmp(m_I, hkl_sample_U_get(sample)), __func__);
-	is_double(0., hkl_parameter_value_get(hkl_sample_ux_get(sample)), HKL_EPSILON, __func__);
-	is_double(0., hkl_parameter_value_get(hkl_sample_uy_get(sample)), HKL_EPSILON, __func__);
-	is_double(0., hkl_parameter_value_get(hkl_sample_uz_get(sample)), HKL_EPSILON, __func__);
+	ok(TRUE == hkl_sample_compute_UB_busing_levy(sample, r0, r1, NULL), __func__);
+	is_matrix(m_I, hkl_sample_U_get(sample), __func__);
+
+	error = NULL;
+	ok(TRUE == hkl_sample_compute_UB_busing_levy(sample, r0, r1, &error), __func__);
+	ok(error == NULL, __func__);
+	is_matrix(m_I, hkl_sample_U_get(sample), __func__);
+
+	CHECK_UX_UY_UZ(sample, 0., 0., 0.);
 
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., 90., 60.);
-	r2 = hkl_sample_reflection_new(geometry, detector, 1, 0, 0);
+	/* second test */
+	ok(TRUE == hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., 90., 60.), __func__);
+	r2 = hkl_sample_reflection_new(geometry, detector, 1, 0, 0, NULL);
 	hkl_sample_add_reflection(sample, r2);
 
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., 180., 60.);
-	r3 = hkl_sample_reflection_new(geometry, detector, 0, 1, 0);
+	ok(TRUE == hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., 180., 60.), __func__);
+	r3 = hkl_sample_reflection_new(geometry, detector, 0, 1, 0, NULL);
 	hkl_sample_add_reflection(sample, r3);
 
-	hkl_sample_compute_UB_busing_levy(sample, r2, r3);
-	ok(HKL_TRUE == hkl_matrix_cmp(m_ref, hkl_sample_U_get(sample)), __func__);
-	is_double(-90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_sample_ux_get(sample)), HKL_EPSILON, __func__);
-	is_double(0., hkl_parameter_value_get(hkl_sample_uy_get(sample)), HKL_EPSILON, __func__);
-	is_double(0., hkl_parameter_value_get(hkl_sample_uz_get(sample)), HKL_EPSILON, __func__);
+	ok(TRUE == hkl_sample_compute_UB_busing_levy(sample, r2, r3, NULL), __func__);
+	is_matrix(m_ref, hkl_sample_U_get(sample), __func__);
+
+	error = NULL;
+	ok(TRUE == hkl_sample_compute_UB_busing_levy(sample, r2, r3, &error), __func__);
+	ok(error == NULL, __func__);
+	is_matrix(m_ref, hkl_sample_U_get(sample), __func__);
+
+	CHECK_UX_UY_UZ(sample, -90. * HKL_DEGTORAD, 0., 0.);
+
+	/* failling test */
+	ok(FALSE == hkl_sample_compute_UB_busing_levy(sample, r0, r0, NULL), __func__);
+
+	error = NULL;
+	ok(FALSE == hkl_sample_compute_UB_busing_levy(sample, r0, r0, &error), __func__);
+	ok(error != NULL, __func__);
+	g_clear_error(&error);
+	is_matrix(m_ref, hkl_sample_U_get(sample), __func__);
 
 	hkl_sample_free(sample);
 	hkl_detector_free(detector);
@@ -208,6 +293,7 @@ static void compute_UB_busing_levy(void)
 
 static void affine(void)
 {
+	GError *error;
 	double a, b, c, alpha, beta, gamma;
 	const HklFactory *factory;
 	HklDetector *detector;
@@ -219,55 +305,58 @@ static void affine(void)
 					       0., 1., 0.,
 					       0., 0., 1.);
 
-	factory = hkl_factory_get_by_name("E4CV");
+	factory = hkl_factory_get_by_name("E4CV", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	sample = hkl_sample_new("test");
 	lattice = hkl_lattice_new(1, 5, 4,
 				  92 * HKL_DEGTORAD,
 				  81 * HKL_DEGTORAD,
-				  90 * HKL_DEGTORAD);
+				  90 * HKL_DEGTORAD,
+				  NULL);
 	hkl_sample_lattice_set(sample, lattice);
 	hkl_lattice_free(lattice);
 
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., 90., 60.);
-	ref = hkl_sample_reflection_new(geometry, detector, 1, 0, 0);
+	ok(TRUE == hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., 90., 60.), __func__);
+	ref = hkl_sample_reflection_new(geometry, detector, 1, 0, 0, NULL);
 	hkl_sample_add_reflection(sample, ref);
 
-	hkl_geometry_set_values_unit_v(geometry, 30., 90., 0., 60.);
-	ref = hkl_sample_reflection_new(geometry, detector, 0, 1, 0);
+	ok(TRUE == hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 90., 0., 60.), __func__);
+	ref = hkl_sample_reflection_new(geometry, detector, 0, 1, 0, NULL);
 	hkl_sample_add_reflection(sample, ref);
 
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
-	ref = hkl_sample_reflection_new(geometry, detector, 0, 0, 1);
+	ok(TRUE == hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., 0., 60.), __func__);
+	ref = hkl_sample_reflection_new(geometry, detector, 0, 0, 1, NULL);
 	hkl_sample_add_reflection(sample, ref);
 
-	hkl_geometry_set_values_unit_v(geometry, 60., 60., 60., 60.);
-	ref = hkl_sample_reflection_new(geometry, detector, .625, .75, -.216506350946);
+	ok(TRUE == hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 60., 60., 60., 60.), __func__);
+	ref = hkl_sample_reflection_new(geometry, detector, .625, .75, -.216506350946, NULL);
 	hkl_sample_add_reflection(sample, ref);
 
-	hkl_geometry_set_values_unit_v(geometry, 45., 45., 45., 60.);
-	ref = hkl_sample_reflection_new(geometry, detector, .665975615037, .683012701892, .299950211252);
+	ok(TRUE == hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 45., 45., 45., 60.), __func__);
+	ref = hkl_sample_reflection_new(geometry, detector, .665975615037, .683012701892, .299950211252, NULL);
 	hkl_sample_add_reflection(sample, ref);
 
-	hkl_sample_affine(sample);
+
+	ok(TRUE == hkl_sample_affine(sample, NULL), __func__);
+
+	error = NULL;
+	ok(TRUE == hkl_sample_affine(sample, &error), __func__);
+	ok(error == NULL, __func__);
 
 	hkl_lattice_get(hkl_sample_lattice_get(sample),
-			&a, &b, &c, &alpha, &beta, &gamma);
+			&a, &b, &c, &alpha, &beta, &gamma, HKL_UNIT_DEFAULT);
 
-	ok(HKL_TRUE == hkl_matrix_cmp(m_ref, hkl_sample_U_get(sample)), __func__);
+	is_matrix(m_ref, hkl_sample_U_get(sample), __func__);
 	is_double(1.54, a, HKL_EPSILON, __func__);
 	is_double(1.54, b, HKL_EPSILON, __func__);
 	is_double(1.54, c, HKL_EPSILON, __func__);
 	is_double(90 * HKL_DEGTORAD, alpha, HKL_EPSILON, __func__);
 	is_double(90 * HKL_DEGTORAD, beta, HKL_EPSILON, __func__);
 	is_double(90 * HKL_DEGTORAD, gamma, HKL_EPSILON, __func__);
-	is_double(0., hkl_parameter_value_get(hkl_sample_ux_get(sample)), HKL_EPSILON, __func__);
-	is_double(0., hkl_parameter_value_get(hkl_sample_uy_get(sample)), HKL_EPSILON, __func__);
-	is_double(0., hkl_parameter_value_get(hkl_sample_uz_get(sample)), HKL_EPSILON, __func__);
+	CHECK_UX_UY_UZ(sample, 0., 0., 0.);
 
 	hkl_sample_free(sample);
 	hkl_detector_free(detector);
@@ -284,36 +373,36 @@ static void get_reflections_xxx_angle(void)
 	HklLattice *lattice;
 	HklSampleReflection *r0, *r1, *r2, *r3, *r4;
 
-	factory = hkl_factory_get_by_name("E4CV");
+	factory = hkl_factory_get_by_name("E4CV", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	sample = hkl_sample_new("test");
 	lattice = hkl_lattice_new(1.54, 1.54, 1.54,
-				  90*HKL_DEGTORAD, 90*HKL_DEGTORAD,90*HKL_DEGTORAD);
+				  90*HKL_DEGTORAD, 90*HKL_DEGTORAD,90*HKL_DEGTORAD,
+				  NULL);
 	hkl_sample_lattice_set(sample, lattice);
 	hkl_lattice_free(lattice);
 
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., 90., 60.);
-	r0 = hkl_sample_reflection_new(geometry, detector, 1, 0, 0);
+	ok(TRUE == hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., 90., 60.), __func__);
+	r0 = hkl_sample_reflection_new(geometry, detector, 1, 0, 0, NULL);
 	hkl_sample_add_reflection(sample, r0);
 
-	hkl_geometry_set_values_unit_v(geometry, 30., 90., 0., 60.);
-	r1 = hkl_sample_reflection_new(geometry, detector, 0, 1, 0);
+	ok(TRUE == hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 90., 0., 60.), __func__);
+	r1 = hkl_sample_reflection_new(geometry, detector, 0, 1, 0, NULL);
 	hkl_sample_add_reflection(sample, r1);
 
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
-	r2 = hkl_sample_reflection_new(geometry, detector, 0, 0, 1);
+	ok(TRUE == hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., 0., 60.), __func__);
+	r2 = hkl_sample_reflection_new(geometry, detector, 0, 0, 1, NULL);
 	hkl_sample_add_reflection(sample, r2);
 
-	hkl_geometry_set_values_unit_v(geometry, 60., 60., 60., 60.);
-	r3 = hkl_sample_reflection_new(geometry, detector, .625, .75, -.216506350946);
+	ok(TRUE == hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 60., 60., 60., 60.), __func__);
+	r3 = hkl_sample_reflection_new(geometry, detector, .625, .75, -.216506350946, NULL);
 	hkl_sample_add_reflection(sample, r3);
 
-	hkl_geometry_set_values_unit_v(geometry, 45., 45., 45., 60.);
-	r4 = hkl_sample_reflection_new(geometry, detector, .665975615037, .683012701892, .299950211252);
+	ok(TRUE == hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 45., 45., 45., 60.), __func__);
+	r4 = hkl_sample_reflection_new(geometry, detector, .665975615037, .683012701892, .299950211252, NULL);
 	hkl_sample_add_reflection(sample, r4);
 
 	is_double(90 * HKL_DEGTORAD,
@@ -321,7 +410,7 @@ static void get_reflections_xxx_angle(void)
 		  HKL_EPSILON, __func__);
 
 	is_double(90 * HKL_DEGTORAD,
-		  hkl_sample_get_reflection_mesured_angle(sample, r0, r1),
+		  hkl_sample_get_reflection_measured_angle(sample, r0, r1),
 		  HKL_EPSILON, __func__);
 
 	is_double(90 * HKL_DEGTORAD,
@@ -329,7 +418,7 @@ static void get_reflections_xxx_angle(void)
 		  HKL_EPSILON, __func__);
 
 	is_double(90 * HKL_DEGTORAD,
-		  hkl_sample_get_reflection_mesured_angle(sample, r1, r2),
+		  hkl_sample_get_reflection_measured_angle(sample, r1, r2),
 		  HKL_EPSILON, __func__);
 
 	hkl_sample_free(sample);
@@ -350,56 +439,55 @@ static void reflection_set_geometry(void)
 					       0., 1., 0.,
 					       0., 0., 1.);
 
-	factory = hkl_factory_get_by_name("E4CV");
+	factory = hkl_factory_get_by_name("E4CV", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	hkl_detector_idx_set(detector, 1);
 
 	sample = hkl_sample_new("test");
 	lattice = hkl_lattice_new(1.54, 1.54, 1.54,
-				  90*HKL_DEGTORAD, 90*HKL_DEGTORAD,90*HKL_DEGTORAD);
+				  90*HKL_DEGTORAD, 90*HKL_DEGTORAD,90*HKL_DEGTORAD,
+				  NULL);
 	hkl_sample_lattice_set(sample, lattice);
 	hkl_lattice_free(lattice);
 
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., 90., 60.);
-	ref = hkl_sample_reflection_new(geometry, detector, 1, 0, 0);
+	ok(TRUE == hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., 90., 60.), __func__);
+	ref = hkl_sample_reflection_new(geometry, detector, 1, 0, 0, NULL);
 	hkl_sample_add_reflection(sample, ref);
 
-	hkl_geometry_set_values_unit_v(geometry, 30., 90., 0., 60.);
-	ref = hkl_sample_reflection_new(geometry, detector, 0, 1, 0);
+	ok(TRUE == hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 90., 0., 60.), __func__);
+	ref = hkl_sample_reflection_new(geometry, detector, 0, 1, 0, NULL);
 	hkl_sample_add_reflection(sample, ref);
 
-	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
-	ref = hkl_sample_reflection_new(geometry, detector, 0, 0, 1);
+	ok(TRUE == hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 30., 0., 0., 60.), __func__);
+	ref = hkl_sample_reflection_new(geometry, detector, 0, 0, 1, NULL);
 	hkl_sample_add_reflection(sample, ref);
 
-	hkl_geometry_set_values_unit_v(geometry, 60., 60., 60., 60.);
-	ref = hkl_sample_reflection_new(geometry, detector, .625, .75, -.216506350946);
+	ok(TRUE == hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 60., 60., 60., 60.), __func__);
+	ref = hkl_sample_reflection_new(geometry, detector, .625, .75, -.216506350946, NULL);
 	hkl_sample_add_reflection(sample, ref);
 
-	hkl_geometry_set_values_unit_v(geometry, 46., 45., 45., 60.);
-	ref = hkl_sample_reflection_new(geometry, detector, .665975615037, .683012701892, .299950211252);
+	ok(TRUE == hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 46., 45., 45., 60.), __func__);
+	ref = hkl_sample_reflection_new(geometry, detector, .665975615037, .683012701892, .299950211252, NULL);
 	hkl_sample_add_reflection(sample, ref);
 
 	/* correct the last reflection so the sample affinement must be ok. */
-	hkl_geometry_set_values_unit_v(geometry, 45., 45., 45., 60.);
+	ok(TRUE == hkl_geometry_set_values_v(geometry, HKL_UNIT_USER, NULL, 45., 45., 45., 60.), __func__);
 	hkl_sample_reflection_geometry_set(ref, geometry);
 
-	hkl_sample_affine(sample);
+	ok(TRUE == hkl_sample_affine(sample, NULL), __func__);
 	hkl_lattice_get(hkl_sample_lattice_get(sample),
-			&a, &b, &c, &alpha, &beta, &gamma);
+			&a, &b, &c, &alpha, &beta, &gamma,
+			HKL_UNIT_DEFAULT);
 
-	ok(HKL_TRUE == hkl_matrix_cmp(m_ref, hkl_sample_U_get(sample)), __func__);
+	is_matrix(m_ref, hkl_sample_U_get(sample), __func__);
 	is_double(1.54, a, HKL_EPSILON, __func__);
 	is_double(1.54, b, HKL_EPSILON, __func__);
 	is_double(1.54, c, HKL_EPSILON, __func__);
 	is_double(90 * HKL_DEGTORAD, alpha, HKL_EPSILON, __func__);
 	is_double(90 * HKL_DEGTORAD, beta, HKL_EPSILON, __func__);
 	is_double(90 * HKL_DEGTORAD, gamma, HKL_EPSILON, __func__);
-	is_double(0., hkl_parameter_value_get(hkl_sample_ux_get(sample)), HKL_EPSILON, __func__);
-	is_double(0., hkl_parameter_value_get(hkl_sample_uy_get(sample)), HKL_EPSILON, __func__);
-	is_double(0., hkl_parameter_value_get(hkl_sample_uz_get(sample)), HKL_EPSILON, __func__);
+	CHECK_UX_UY_UZ(sample, 0., 0., 0.);
 
 	hkl_sample_free(sample);
 	hkl_detector_free(detector);
@@ -409,12 +497,13 @@ static void reflection_set_geometry(void)
 
 int main(int argc, char** argv)
 {
-	plan(40);
+	plan(114);
 
 	new();
 	add_reflection();
 	get_reflection();
 	del_reflection();
+	set_ux_uy_uz();
 	set_UB();
 	compute_UB_busing_levy();
 	affine();
diff --git a/tests/hkl-source-t.c b/tests/hkl-source-t.c
index 8e9d09b..1b515c6 100644
--- a/tests/hkl-source-t.c
+++ b/tests/hkl-source-t.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -33,7 +33,7 @@ static void new_copy(void)
 	c = s;
 
 	is_double(c.wave_length, s.wave_length, HKL_EPSILON, __func__);
-	ok(HKL_FALSE == hkl_vector_cmp(&c.direction, &s.direction), __func__);
+	ok(FALSE == hkl_vector_cmp(&c.direction, &s.direction), __func__);
 }
 
 static void init(void)
@@ -56,8 +56,8 @@ static void cmp(void)
 	hkl_source_init(&s1, 1.54, 1, 0, 0);
 	hkl_source_init(&s2, 1, 1, 0, 0);
 
-	ok(HKL_TRUE == hkl_source_cmp(&ref, &s1), __func__);
-	ok(HKL_FALSE == hkl_source_cmp(&ref, &s2), __func__);
+	ok(TRUE == hkl_source_cmp(&ref, &s1), __func__);
+	ok(FALSE == hkl_source_cmp(&ref, &s2), __func__);
 }
 
 static void compute_ki(void)
diff --git a/tests/hkl-unit-t.c b/tests/hkl-unit-t.c
index e69682a..ce32e72 100644
--- a/tests/hkl-unit-t.c
+++ b/tests/hkl-unit-t.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,22 +22,23 @@
 #include "hkl.h"
 #include <tap/basic.h>
 #include <tap/float.h>
+#include <tap/hkl-tap.h>
 
 #include "hkl-unit-private.h"
 
 static void compatible(void)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 
 	const HklUnit *unit;
 	const HklUnit *punit;
 
-	res &= hkl_unit_compatible(&hkl_unit_angle_deg, &hkl_unit_angle_rad);
-	res &= !hkl_unit_compatible(&hkl_unit_angle_deg, &hkl_unit_length_nm);
-	res &= !hkl_unit_compatible(&hkl_unit_angle_rad, &hkl_unit_length_nm);
-	res &= hkl_unit_compatible(NULL, NULL);
+	res &= DIAG(hkl_unit_compatible(&hkl_unit_angle_deg, &hkl_unit_angle_rad));
+	res &= DIAG(!hkl_unit_compatible(&hkl_unit_angle_deg, &hkl_unit_length_nm));
+	res &= DIAG(!hkl_unit_compatible(&hkl_unit_angle_rad, &hkl_unit_length_nm));
+	res &= DIAG(hkl_unit_compatible(NULL, NULL));
 
-	ok(res == HKL_TRUE, __func__);
+	ok(res == TRUE, __func__);
 }
 
 static void factor(void)
diff --git a/tests/hkl-vector-t.c b/tests/hkl-vector-t.c
index 1d57a7e..a1b9bee 100644
--- a/tests/hkl-vector-t.c
+++ b/tests/hkl-vector-t.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -51,8 +51,8 @@ static void is_opposite(void)
 	HklVector v1 = {{1, 2, 3}};
 	HklVector v2 = {{0, -1, -2}};
 
-	ok(HKL_FALSE == hkl_vector_is_opposite(&v_ref, &v1), __func__);
-	ok(HKL_TRUE == hkl_vector_is_opposite(&v_ref, &v2), __func__);
+	ok(FALSE == hkl_vector_is_opposite(&v_ref, &v1), __func__);
+	ok(TRUE == hkl_vector_is_opposite(&v_ref, &v2), __func__);
 }
 
 static void norm2(void)
diff --git a/tests/hkl3d-test-t.c b/tests/hkl3d-test-t.c
index 2ad2a79..03be40c 100644
--- a/tests/hkl3d-test-t.c
+++ b/tests/hkl3d-test-t.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2010-2013 Synchrotron SOLEIL
+ * Copyright (C) 2010-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -24,6 +24,7 @@
 
 #include "hkl3d.h"
 #include "tap/basic.h"
+#include "tap/hkl-tap.h"
 
 #define MODEL_FILENAME "data/diffabs.yaml"
 
@@ -34,13 +35,12 @@ static void check_model_validity(Hkl3D *hkl3d)
 	int res;
 	Hkl3DObject *obji;
 	Hkl3DObject *objj;
-	const darray_parameter *axes;
 
 	res = TRUE;
 
 	/* imported 1 config files with 7 Hkl3DObjects */
-	res &= hkl3d->config->len == 1;
-	res &= hkl3d->config->models[0]->len == 7;
+	res &= DIAG(hkl3d->config->len == 1);
+	res &= DIAG(hkl3d->config->models[0]->len == 7);
 
 	/* all Hkl3DObjects must have a different axis_name */
 	len = hkl3d->config->models[0]->len;
@@ -49,7 +49,7 @@ static void check_model_validity(Hkl3D *hkl3d)
 		for (j=1; j<len-i; ++j){
 			objj = hkl3d->config->models[0]->objects[i+j];
 			if(!(strcmp(obji->axis_name, objj->axis_name))){
-				res &= FALSE;
+				res &= DIAG(FALSE);
 				break;
 			}
 		}
@@ -57,9 +57,8 @@ static void check_model_validity(Hkl3D *hkl3d)
 	}
 
 	/* check the _movingObjects validity, all Hkl3DAxis must have a size of 1 */
-	axes = hkl_geometry_axes_get(hkl3d->geometry->geometry);
-	for(i=0; i<darray_size(*axes); ++i)
-		res &= hkl3d->geometry->axes[i]->len == 1;
+	for(i=0; i<6; ++i)
+		res &= DIAG(hkl3d->geometry->axes[i]->len == 1);
 
 	ok(res == TRUE, "no identical objects");
 }
@@ -73,10 +72,11 @@ static void check_collision(Hkl3D *hkl3d)
 
 	/* check the collision and that the right axes are colliding */
 	res = TRUE;
-	hkl_geometry_set_values_unit_v(hkl3d->geometry->geometry,
-				       23., 0., 0., 0., 0., 0.);
+	hkl_geometry_set_values_v(hkl3d->geometry->geometry,
+				  HKL_UNIT_USER, NULL,
+				  23., 0., 0., 0., 0., 0.);
 
-	res &= hkl3d_is_colliding(hkl3d) == TRUE;
+	res &= DIAG(hkl3d_is_colliding(hkl3d) == TRUE);
 	strcpy(buffer, "");
 
 	/* now check that only delta and mu are colliding */
@@ -93,9 +93,9 @@ static void check_collision(Hkl3D *hkl3d)
 		}
 
 		if(!strcmp(name, "mu") || !strcmp(name, "delta"))
-			res &= tmp == TRUE;
+			res &= DIAG(tmp == TRUE);
 		else
-			res &= tmp == FALSE;
+			res &= DIAG(tmp == FALSE);
 	}
 	ok(res == TRUE,  "collision [%s]", buffer);
 }
@@ -107,27 +107,31 @@ static void check_no_collision(Hkl3D *hkl3d)
 
 	/* check that rotating around komega/kappa/kphi do not create collisison */
 	res = TRUE;
-	hkl_geometry_set_values_unit_v(hkl3d->geometry->geometry,
-				       0., 0., 0., 0., 0., 0.);
+	hkl_geometry_set_values_v(hkl3d->geometry->geometry,
+				  HKL_UNIT_USER, NULL,
+				  0., 0., 0., 0., 0., 0.);
 	/* komega */
 	for(i=0; i<=360; i=i+10){
-		hkl_geometry_set_values_unit_v(hkl3d->geometry->geometry,
-					       0., i, 0., 0., 0., 0.);
-		res &= hkl3d_is_colliding(hkl3d) == FALSE;
+		hkl_geometry_set_values_v(hkl3d->geometry->geometry,
+					  HKL_UNIT_USER, NULL,
+					  0., i, 0., 0., 0., 0.);
+		res &= DIAG(hkl3d_is_colliding(hkl3d) == FALSE);
 	}
 
 	/* kappa */
 	for(i=0; i<=360; i=i+10){
-		hkl_geometry_set_values_unit_v(hkl3d->geometry->geometry,
-					       0., 0., i, 0., 0., 0.);
-		res &= hkl3d_is_colliding(hkl3d) == FALSE;
+		hkl_geometry_set_values_v(hkl3d->geometry->geometry,
+					  HKL_UNIT_USER, NULL,
+					  0., 0., i, 0., 0., 0.);
+		res &= DIAG(hkl3d_is_colliding(hkl3d) == FALSE);
 	}
 
 	/* kphi */
 	for(i=0; i<=360; i=i+10){
-		hkl_geometry_set_values_unit_v(hkl3d->geometry->geometry,
-					       0., 0., 0., i, 0., 0.);
-		res &= hkl3d_is_colliding(hkl3d) == FALSE;
+		hkl_geometry_set_values_v(hkl3d->geometry->geometry,
+					  HKL_UNIT_USER, NULL,
+					  0., 0., 0., i, 0., 0.);
+		res &= DIAG(hkl3d_is_colliding(hkl3d) == FALSE);
 	}
 	ok(res == TRUE, "no-collision");
 }
@@ -139,7 +143,7 @@ int main(int argc, char** argv)
 	HklGeometry *geometry;
 	Hkl3D *hkl3d;
 
-	factory = hkl_factory_get_by_name("K6C");
+	factory = hkl_factory_get_by_name("K6C", NULL);
 	geometry = hkl_factory_create_new_geometry(factory);
 
 	/* compute the filename of the diffractometer config file */
diff --git a/tests/tap/Makefile.am b/tests/tap/Makefile.am
index a55a30b..d2953d0 100644
--- a/tests/tap/Makefile.am
+++ b/tests/tap/Makefile.am
@@ -1,6 +1,8 @@
 AM_CFLAGS = \
 	-I$(top_srcdir) \
-	-I$(abs_top_srcdir)/tests
+	-I$(abs_top_srcdir)/tests \
+	$(GLIB_CFLAGS) \
+	$(GSL_CFLAGS)
 
 check_LIBRARIES = libtap.a
 libtap_a_SOURCES = \
diff --git a/tests/tap/Makefile.in b/tests/tap/Makefile.in
index a157d36..e20716f 100644
--- a/tests/tap/Makefile.in
+++ b/tests/tap/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
@@ -176,6 +176,8 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
+BULLET_CFLAGS = @BULLET_CFLAGS@
+BULLET_LIBS = @BULLET_LIBS@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
@@ -195,6 +197,7 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+EMACS = @EMACS@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
 G3D_CFLAGS = @G3D_CFLAGS@
@@ -214,14 +217,15 @@ GSL_CFLAGS = @GSL_CFLAGS@
 GSL_CONFIG = @GSL_CONFIG@
 GSL_LIBS = @GSL_LIBS@
 GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@
 GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
 GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
 GTKDOC_MKPDF = @GTKDOC_MKPDF@
 GTKDOC_REBASE = @GTKDOC_REBASE@
-GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
-GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
-GTKMM_CFLAGS = @GTKMM_CFLAGS@
-GTKMM_LIBS = @GTKMM_LIBS@
+GTKGLEXT_CFLAGS = @GTKGLEXT_CFLAGS@
+GTKGLEXT_LIBS = @GTKGLEXT_LIBS@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
 HTML_DIR = @HTML_DIR@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -317,7 +321,6 @@ localstatedir = @localstatedir@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
-opengl_LIBS = @opengl_LIBS@
 pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
@@ -334,7 +337,9 @@ top_srcdir = @top_srcdir@
 version_info = @version_info@
 AM_CFLAGS = \
 	-I$(top_srcdir) \
-	-I$(abs_top_srcdir)/tests
+	-I$(abs_top_srcdir)/tests \
+	$(GLIB_CFLAGS) \
+	$(GSL_CFLAGS)
 
 check_LIBRARIES = libtap.a
 libtap_a_SOURCES = \
@@ -400,22 +405,25 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-tap.Po at am__quote@
 
 .c.o:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+ at am__fastdepCC_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c $<
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
 
 .c.obj:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+ at am__fastdepCC_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
 .c.lo:
- at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at am__fastdepCC_TRUE@	$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+ at am__fastdepCC_TRUE@	$(am__mv) $$depbase.Tpo $$depbase.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
diff --git a/tests/tap/hkl-tap.c b/tests/tap/hkl-tap.c
index 2e8ad2a..039271c 100644
--- a/tests/tap/hkl-tap.c
+++ b/tests/tap/hkl-tap.c
@@ -21,8 +21,49 @@
  */
 #include <stdarg.h>
 
+#include "basic.h"
 #include "hkl-tap.h"
+#include "hkl/hkl-matrix-private.h"
 #include "hkl/hkl-macros-private.h"
+#include "hkl/hkl-pseudoaxis-private.h"
+
+void is_quaternion(const HklQuaternion *wanted, const HklQuaternion *seen, const char *format, ...)
+{
+	va_list args;
+
+	va_start(args, format);
+	fflush(stderr);
+	if(TRUE == hkl_quaternion_cmp(wanted, seen))
+		okv(1, format, args);
+	else{
+		printf("# wanted: %g %g %g %g\n",
+		       wanted->data[0], wanted->data[1], wanted->data[2], wanted->data[3]);
+		printf("#   seen: %g %g %g %g\n",
+		       seen->data[0], seen->data[1], seen->data[2], wanted->data[3]);
+		okv(0, format, args);
+	}
+}
+
+void is_matrix(const HklMatrix *wanted, const HklMatrix *seen, const char *format, ...)
+{
+	va_list args;
+
+	va_start(args, format);
+	fflush(stderr);
+	if(TRUE == hkl_matrix_cmp(wanted, seen))
+		okv(1, format, args);
+	else{
+		printf("# wanted: %g %g %g\n#       : %g %g %g\n#       : %g %g %g\n",
+		       wanted->data[0][0], wanted->data[0][1], wanted->data[0][2],
+		       wanted->data[1][0], wanted->data[1][1], wanted->data[1][2],
+		       wanted->data[2][0], wanted->data[2][1], wanted->data[2][2]);
+		printf("#   seen: %g %g %g\n#       : %g %g %g\n#       : %g %g %g\n",
+		       seen->data[0][0], seen->data[0][1], seen->data[0][2],
+		       seen->data[1][0], seen->data[1][1], seen->data[1][2],
+		       seen->data[2][0], seen->data[2][1], seen->data[2][2]);
+		okv(0, format, args);
+	}
+}
 
 int check_pseudoaxes_v(HklEngine *engine, ...)
 {
@@ -43,22 +84,23 @@ int check_pseudoaxes_v(HklEngine *engine, ...)
 int check_pseudoaxes(HklEngine *engine,
 		     double expected[], uint len)
 {
-	int res = HKL_TRUE;
+	int res = TRUE;
 	unsigned int i = 0;
-	HklParameter **pseudo_axis;
-	darray_parameter *pseudo_axes = hkl_engine_pseudo_axes(engine);
+	double currents[len];
 
 	hkl_assert(hkl_engine_len(engine) == len);
 
-	darray_foreach(pseudo_axis, *pseudo_axes){
-		double current = hkl_parameter_value_get(*pseudo_axis);
-		res &= fabs(current - expected[i]) <= HKL_EPSILON;
-		if (!res){
-			fprintf(stderr, "current: %f, expected: %f, epsilon: %f\n",
-				current, expected[i], HKL_EPSILON);
+	if(hkl_engine_pseudo_axis_values_get(engine, currents, len, HKL_UNIT_DEFAULT, NULL)){
+		for(i=0; i<len; ++i){
+			res &= fabs(currents[i] - expected[i]) <= HKL_EPSILON;
+			if (!res){
+				fprintf(stderr, "current: %f, expected: %f, epsilon: %f\n",
+					currents[i], expected[i], HKL_EPSILON);
+			}
 		}
-		++i;
-	}
+	}else
+		res = FALSE;
+
 	return res;
 }
 
@@ -70,12 +112,11 @@ int check_pseudoaxes(HklEngine *engine,
  * set the values of the PseudoAxes with the given values. This method
  * is only available for test as it is sort of brittle.
  **/
-void hkl_engine_set_values_v(HklEngine *self, ...)
+HklGeometryList *hkl_engine_set_values_v(HklEngine *self, ...)
 {
 	uint i;
 	va_list ap;
 	unsigned int len = hkl_engine_len(self);
-	HklParameterList *pseudo_axes = hkl_engine_pseudo_axes(self);
 	double values[len];
 
 	va_start(ap, self);
@@ -83,7 +124,40 @@ void hkl_engine_set_values_v(HklEngine *self, ...)
 		values[i] = va_arg(ap, double);
 		
 	va_end(ap);
-	hkl_parameter_list_values_set(pseudo_axes,
-				      values, len,
-				      NULL);
+	return hkl_engine_pseudo_axis_values_set(self, values, len,
+						  HKL_UNIT_DEFAULT, NULL);
+}
+
+/**
+ * hkl_tap_engine_pseudo_axes_randomize: (skip)
+ * @self: the this ptr
+ *
+ * randomize all the parameters of the #HklEngine
+ **/
+void hkl_tap_engine_pseudo_axes_randomize(HklEngine *self,
+					  double values[], size_t n_values,
+					  HklUnitEnum unit_type)
+{
+	size_t i;
+
+	for(i=0; i<n_values; ++i){
+		HklParameter *parameter = darray_item(self->pseudo_axes, i);
+		hkl_parameter_randomize(parameter);
+		values[i] = hkl_parameter_value_get(parameter, unit_type);
+	}
+}
+
+/**
+ * hkl_tap_engine_parameters_randomize: (skip)
+ * @self: the this ptr
+ *
+ * randomize all the parameters of the #HklEngine
+ **/
+void hkl_tap_engine_parameters_randomize(HklEngine *self)
+{
+	HklParameter **parameter;
+
+	darray_foreach(parameter, self->mode->parameters){
+		hkl_parameter_randomize(*parameter);
+	}
 }
diff --git a/tests/tap/hkl-tap.h b/tests/tap/hkl-tap.h
index 20939af..041fe41 100644
--- a/tests/tap/hkl-tap.h
+++ b/tests/tap/hkl-tap.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ * Copyright (C) 2003-2014 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -24,15 +24,38 @@
 
 #include "hkl.h"
 
-HKL_BEGIN_DECLS
+#define STRINGIFY(x) #x
+#define TOSTRING(x) STRINGIFY(x)
+
+/* BEWARE here we are using a GCC extension */
+#define DIAG(_success)							\
+	({	typeof(_success) __success = (_success);		\
+		if(!__success)						\
+			diag("status: %d " __FILE__ ":" TOSTRING(__LINE__) ":%s", (__success) , __func__); \
+		__success;						\
+	})
+
+G_BEGIN_DECLS
+
+extern void is_quaternion(const HklQuaternion *wanted, const HklQuaternion *seen, const char *format, ...)
+	__attribute__((__format__(printf, 3, 4)));
+
+extern void is_matrix(const HklMatrix *wanted, const HklMatrix *seen, const char *format, ...)
+	__attribute__((__format__(printf, 3, 4)));
 
 extern int check_pseudoaxes_v(HklEngine *engine, ...);
 
 extern int check_pseudoaxes(HklEngine *engine,
 			    double expected[], uint len);
 
-extern void hkl_engine_set_values_v(HklEngine *self, ...);
+extern  void hkl_tap_engine_pseudo_axes_randomize(HklEngine *self,
+						  double values[], size_t n_values,
+						  HklUnitEnum unit_type) HKL_ARG_NONNULL(1, 2);
+
+extern void hkl_tap_engine_parameters_randomize(HklEngine *self) HKL_ARG_NONNULL(1);
+
+extern HklGeometryList *hkl_engine_set_values_v(HklEngine *self, ...);
 
-HKL_END_DECLS
+G_END_DECLS
 
 #endif /* __HKL_TAP_H__ */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/hkl.git



More information about the debian-science-commits mailing list