Browse Source

removed duplicates

GLScene 2 years ago
parent
commit
74c15170f5
41 changed files with 754 additions and 4954 deletions
  1. 2 2
      Examples/Demos/physics/NewtonDensity/NewtonDensityC.cbproj
  2. 1 0
      Examples/Demos/physics/NewtonDensity/fNewtonDensityC.cpp
  3. 25 24
      Examples/Demos/physics/NewtonDensity/fNewtonDensityC.dfm
  4. 2 0
      Examples/Demos/physics/NewtonDensity/fNewtonDensityC.h
  5. 1 1
      Examples/Demos/physics/NewtonDensity/fNewtonDensityD.pas
  6. 1 1
      Examples/Demos/physics/OdeClothify/fOdeClothifyD.pas
  7. 1 1
      Examples/Demos/physics/OdeConveyor/fOdeConveyorD.pas
  8. 4 0
      Examples/Demos/physics/OdeFurball/fOdeFurballC.cpp
  9. 49 94
      Examples/Demos/physics/OdeFurball/fOdeFurballC.dfm
  10. 1 1
      Examples/Demos/physics/OdeFurball/fOdeFurballC.h
  11. 44 89
      Examples/Demos/physics/OdeFurball/fOdeFurballD.dfm
  12. 1 1
      Examples/Demos/physics/OdeFurball/fOdeFurballD.pas
  13. 7 12
      Examples/Demos/physics/OdeMachine/fOdeMachineD.dfm
  14. 1 1
      Examples/Demos/physics/OdeMachine/fOdeMachineD.pas
  15. 1 1
      Examples/Demos/physics/OdeRagdoll/fOdeRagdollC.h
  16. 1 1
      Examples/Demos/physics/OdeRagdoll/fOdeRagdollD.pas
  17. 4 4
      Packages/GLScene_Physics_RT.dpk
  18. 4 4
      Packages/GLScene_Physics_RT.dproj
  19. 3 2
      Packages/GLScene_RT.dpk
  20. 2 1
      Packages/GLScene_RT.dproj
  21. 2 2
      Packagex/GLXcene_RT.dpk
  22. 2 2
      Packagex/GLXcene_RT.dproj
  23. 1 1
      Source/Common/ModuleLoader.pas
  24. 1 1
      Source/Common/NGD.Import.pas
  25. 1 1
      Source/Common/Newton.Import.pas
  26. 2 2
      Source/Common/ODE.Import.pas
  27. 1 1
      Source/Common/PhysX.Import.pas
  28. 1 1
      Source/Common/Vulkan.Import.pas
  29. 582 0
      Source/FMX/GLX.InitOpenGL.pas
  30. 0 301
      Source/FMX/Physix.ModuleLoader.pas
  31. 0 1236
      Source/FMX/Physix.NGDImport.pas
  32. 0 1261
      Source/FMX/Physix.NewtonImport.pas
  33. 0 1854
      Source/FMX/Physix.ODEImport.pas
  34. 0 44
      Source/FMX/Physix.PhysX.pas
  35. 1 1
      Source/Physics.NGDManager.pas
  36. 1 1
      Source/Physics.NGDRagdoll.pas
  37. 1 1
      Source/Physics.ODEManager.pas
  38. 1 1
      Source/Physics.ODERagdoll.pas
  39. 1 1
      Source/Physics.ODESkeletonColliders.pas
  40. 1 1
      Source/Physics.ODEUtils.pas
  41. 0 1
      Source/VCL/GLS.InitOpenGL.pas

+ 2 - 2
Examples/Demos/physics/NewtonDensity/NewtonDensityC.cbproj

@@ -65,7 +65,7 @@
         <DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)</DCC_Namespace>
         <DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)</DCC_Namespace>
         <IncludePath>D:\GLScene\Samples\CPP\Demos\physics\NewtonDensity\;$(IncludePath)</IncludePath>
         <IncludePath>D:\GLScene\Samples\CPP\Demos\physics\NewtonDensity\;$(IncludePath)</IncludePath>
         <ProjectType>CppVCLApplication</ProjectType>
         <ProjectType>CppVCLApplication</ProjectType>
-        <AllPackageLibs>rtl.lib;vcl.lib;VclSmp.lib;vclx.lib;GLScene_RT.lib;fmx.lib;xmlrtl.lib;vclimg.lib</AllPackageLibs>
+        <AllPackageLibs>rtl.lib;vcl.lib;VclSmp.lib;vclx.lib;GLScene_RT.lib;fmx.lib;xmlrtl.lib;vclimg.lib;GLScene_Physics_RT.lib</AllPackageLibs>
         <DCC_CBuilderOutput>JPHNE</DCC_CBuilderOutput>
         <DCC_CBuilderOutput>JPHNE</DCC_CBuilderOutput>
         <DynamicRTL>true</DynamicRTL>
         <DynamicRTL>true</DynamicRTL>
         <UsePackages>true</UsePackages>
         <UsePackages>true</UsePackages>
@@ -124,7 +124,7 @@
         <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
         <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
         <ILINK_LibraryPath>$(BDSCOMMONDIR)\Dcp;$(BDSLIB)\$(PLATFORM)$(CC_SUFFIX)\debug;$(ILINK_LibraryPath)</ILINK_LibraryPath>
         <ILINK_LibraryPath>$(BDSCOMMONDIR)\Dcp;$(BDSLIB)\$(PLATFORM)$(CC_SUFFIX)\debug;$(ILINK_LibraryPath)</ILINK_LibraryPath>
         <Defines>_DEBUG;$(Defines)</Defines>
         <Defines>_DEBUG;$(Defines)</Defines>
-        <LinkPackageImports>rtl.bpi;vcl.bpi;VclSmp.bpi;vclx.bpi;GLScene_RT.bpi;fmx.bpi;xmlrtl.bpi;vclimg.bpi</LinkPackageImports>
+        <LinkPackageImports>rtl.bpi;vcl.bpi;VclSmp.bpi;vclx.bpi;GLScene_RT.bpi;fmx.bpi;xmlrtl.bpi;vclimg.bpi;GLScene_Physics_RT.bpi</LinkPackageImports>
     </PropertyGroup>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
     <PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
         <Defines>_DEBUG;$(Defines)</Defines>
         <Defines>_DEBUG;$(Defines)</Defines>

+ 1 - 0
Examples/Demos/physics/NewtonDensity/fNewtonDensityC.cpp

@@ -14,6 +14,7 @@
 
 
 #pragma link "GLS.GeomObjects"
 #pragma link "GLS.GeomObjects"
 #pragma link "GLS.HUDObjects"
 #pragma link "GLS.HUDObjects"
+#pragma link "NGD.Import"
 #pragma link "Physics.NGDManager"
 #pragma link "Physics.NGDManager"
 #pragma link "GLS.Objects"
 #pragma link "GLS.Objects"
 #pragma link "GLS.Scene"
 #pragma link "GLS.Scene"

+ 25 - 24
Examples/Demos/physics/NewtonDensity/fNewtonDensityC.dfm

@@ -10,6 +10,7 @@ object Form1: TForm1
   Font.Height = -11
   Font.Height = -11
   Font.Name = 'Tahoma'
   Font.Name = 'Tahoma'
   Font.Style = []
   Font.Style = []
+  Position = poScreenCenter
   OnCreate = FormCreate
   OnCreate = FormCreate
   TextHeight = 13
   TextHeight = 13
   object GLSceneViewer1: TGLSceneViewer
   object GLSceneViewer1: TGLSceneViewer
@@ -94,10 +95,10 @@ object Form1: TForm1
         TopRadius = 3.000000000000000000
         TopRadius = 3.000000000000000000
         BehavioursData = {
         BehavioursData = {
           0458434F4C02010201060D54474C4E474444796E616D69630200060C68696768
           0458434F4C02010201060D54474C4E474444796E616D69630200060C68696768
-          2064656E736974790200020112000000000800090500000000000AD7A3F83F12
-          00000000020109050000000000CDCCCCFB3F0500000000000000A00140090500
-          0000000000000000000200080200080200090000000000000000000000000000
-          803F020008}
+          2064656E7369747902000201060D474C4E47444D616E61676572310800090500
+          000000000AD7A3F83F1200000000020109050000000000CDCCCCFB3F05000000
+          00000000A0014009050000000000000000000002000802000802000900000000
+          00000000000000000000803F020008}
       end
       end
       object GLCone1: TGLCone
       object GLCone1: TGLCone
         Position.Coordinates = {000000000000C040000000000000803F}
         Position.Coordinates = {000000000000C040000000000000803F}
@@ -105,20 +106,20 @@ object Form1: TForm1
         Height = 3.000000000000000000
         Height = 3.000000000000000000
         BehavioursData = {
         BehavioursData = {
           0458434F4C02010201060D54474C4E474444796E616D69630200060E6E6F726D
           0458434F4C02010201060D54474C4E474444796E616D69630200060E6E6F726D
-          616C2064656E736974790200020112000000000800090500000000000AD7A3F8
-          3F1200000000020109050000000000CDCCCCFB3F050000000000000080FF3F09
-          0500000000000000000000020008020008020009E2CD0C33000040BF00000000
-          0000803F020008}
+          616C2064656E7369747902000201060D474C4E47444D616E6167657231080009
+          0500000000000AD7A3F83F1200000000020109050000000000CDCCCCFB3F0500
+          00000000000080FF3F090500000000000000000000020008020008020009E2CD
+          0C33000040BF000000000000803F020008}
       end
       end
       object GLCube2: TGLCube
       object GLCube2: TGLCube
         Material.FrontProperties.Diffuse.Color = {0000803F0000803F0000803F0000803F}
         Material.FrontProperties.Diffuse.Color = {0000803F0000803F0000803F0000803F}
         Position.Coordinates = {0000000000000041000000000000803F}
         Position.Coordinates = {0000000000000041000000000000803F}
         BehavioursData = {
         BehavioursData = {
           0458434F4C02010201060D54474C4E474444796E616D69630200060B6C6F7720
           0458434F4C02010201060D54474C4E474444796E616D69630200060B6C6F7720
-          64656E736974790200020112000000000800090500000000000AD7A3F83F1200
-          000000020109050000000000CDCCCCFB3F050000000000000080FE3F09050000
-          0000000000000000020008020008020009000000000000000000000000000080
-          3F020008}
+          64656E7369747902000201060D474C4E47444D616E6167657231080009050000
+          0000000AD7A3F83F1200000000020109050000000000CDCCCCFB3F0500000000
+          00000080FE3F0905000000000000000000000200080200080200090000000000
+          000000000000000000803F020008}
         CubeSize = {000040400000404000004040}
         CubeSize = {000040400000404000004040}
       end
       end
       object SubMarine: TGLCube
       object SubMarine: TGLCube
@@ -141,10 +142,10 @@ object Form1: TForm1
         Radius = 2.000000000000000000
         Radius = 2.000000000000000000
         BehavioursData = {
         BehavioursData = {
           0458434F4C02010201060D54474C4E474444796E616D69630200060C68696768
           0458434F4C02010201060D54474C4E474444796E616D69630200060C68696768
-          2064656E736974790200020112000000000800090500000000000AD7A3F83F12
-          00000000020109050000000000CDCCCCFB3F0500000000000000A00240090500
-          0000000000000000000200080200080200090000000000000000000000000000
-          803F020008}
+          2064656E7369747902000201060D474C4E47444D616E61676572310800090500
+          000000000AD7A3F83F1200000000020109050000000000CDCCCCFB3F05000000
+          00000000A0024009050000000000000000000002000802000802000900000000
+          00000000000000000000803F020008}
       end
       end
       object GLPaperSphere: TGLSphere
       object GLPaperSphere: TGLSphere
         Material.FrontProperties.Diffuse.Color = {0000803F0000803F0000803F0000803F}
         Material.FrontProperties.Diffuse.Color = {0000803F0000803F0000803F0000803F}
@@ -152,10 +153,10 @@ object Form1: TForm1
         Radius = 2.000000000000000000
         Radius = 2.000000000000000000
         BehavioursData = {
         BehavioursData = {
           0458434F4C02010201060D54474C4E474444796E616D69630200060B6C6F7720
           0458434F4C02010201060D54474C4E474444796E616D69630200060B6C6F7720
-          64656E736974790200020112000000000800090500000000000AD7A3F83F1200
-          000000020109050000000000CDCCCCFB3F050000000000CDCCCCFB3F09050000
-          0000000000000000020008020008020009000000000000000000000000000080
-          3F020008}
+          64656E7369747902000201060D474C4E47444D616E6167657231080009050000
+          0000000AD7A3F83F1200000000020109050000000000CDCCCCFB3F0500000000
+          00CDCCCCFB3F0905000000000000000000000200080200080200090000000000
+          000000000000000000803F020008}
       end
       end
       object GLCapsule1: TGLCapsule
       object GLCapsule1: TGLCapsule
         Height = 5.000000000000000000
         Height = 5.000000000000000000
@@ -164,10 +165,10 @@ object Form1: TForm1
         Radius = 1.500000000000000000
         Radius = 1.500000000000000000
         BehavioursData = {
         BehavioursData = {
           0458434F4C02010201060D54474C4E474444796E616D69630200060E6E6F726D
           0458434F4C02010201060D54474C4E474444796E616D69630200060E6E6F726D
-          616C2064656E736974790200020112000000000800090500000000000AD7A3F8
-          3F1200000000020109050000000000CDCCCCFB3F050000000000000080FF3F09
-          0500000000000000000000020008020008020009000000000000000000000000
-          0000803F020008}
+          616C2064656E7369747902000201060D474C4E47444D616E6167657231080009
+          0500000000000AD7A3F83F1200000000020109050000000000CDCCCCFB3F0500
+          00000000000080FF3F0905000000000000000000000200080200080200090000
+          000000000000000000000000803F020008}
       end
       end
     end
     end
     object GLCube1: TGLCube
     object GLCube1: TGLCube

+ 2 - 0
Examples/Demos/physics/NewtonDensity/fNewtonDensityC.h

@@ -14,12 +14,14 @@
 
 
 #include "GLS.GeomObjects.hpp"
 #include "GLS.GeomObjects.hpp"
 #include "GLS.HUDObjects.hpp"
 #include "GLS.HUDObjects.hpp"
+#include "NGD.Import.hpp"
 #include "Physics.NGDManager.hpp"
 #include "Physics.NGDManager.hpp"
 #include "GLS.Objects.hpp"
 #include "GLS.Objects.hpp"
 #include "GLS.Scene.hpp"
 #include "GLS.Scene.hpp"
 #include "GLS.SimpleNavigation.hpp"
 #include "GLS.SimpleNavigation.hpp"
 #include "GLS.SceneViewer.hpp"
 #include "GLS.SceneViewer.hpp"
 #include "GLS.BitmapFont.hpp";
 #include "GLS.BitmapFont.hpp";
+
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
 class TForm1 : public TForm
 class TForm1 : public TForm
 {
 {

+ 1 - 1
Examples/Demos/physics/NewtonDensity/fNewtonDensityD.pas

@@ -29,7 +29,7 @@ uses
   GLS.HUDObjects,
   GLS.HUDObjects,
   GLS.BitmapFont,
   GLS.BitmapFont,
   GLS.WindowsFont,
   GLS.WindowsFont,
-  Physics.NGDImport,
+  NGD.Import,
   GLS.GeomObjects;
   GLS.GeomObjects;
 
 
 type
 type

+ 1 - 1
Examples/Demos/physics/OdeClothify/fOdeClothifyD.pas

@@ -43,7 +43,7 @@ uses
   GLS.Context,
   GLS.Context,
   GLS.BaseClasses,
   GLS.BaseClasses,
 
 
-  Physics.ODEImport,
+  ODE.Import,
   Physics.ODEUtils;
   Physics.ODEUtils;
 
 
 type
 type

+ 1 - 1
Examples/Demos/physics/OdeConveyor/fOdeConveyorD.pas

@@ -16,7 +16,7 @@ uses
   Vcl.ComCtrls,
   Vcl.ComCtrls,
   Vcl.ExtCtrls,
   Vcl.ExtCtrls,
 
 
-  Physics.ODEImport,
+  ODE.Import,
   Physics.ODEManager,
   Physics.ODEManager,
   GLS.Scene,
   GLS.Scene,
   GLS.VectorTypes,
   GLS.VectorTypes,

+ 4 - 0
Examples/Demos/physics/OdeFurball/fOdeFurballC.cpp

@@ -24,6 +24,10 @@
 #pragma package(smart_init)
 #pragma package(smart_init)
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
 
 
+#pragma link "GLS.BaseClasses"
+#pragma link "GLS.Coordinates"
+#pragma link "GLS.Objects"
+#pragma link "GLS.ShadowPlane"
 #pragma resource "*.dfm"
 #pragma resource "*.dfm"
 TForm1 *Form1;
 TForm1 *Form1;
 
 

+ 49 - 94
Examples/Demos/physics/OdeFurball/fOdeFurballC.dfm

@@ -2,33 +2,28 @@ object Form1: TForm1
   Left = 0
   Left = 0
   Top = 0
   Top = 0
   Caption = 'ODE Fur Ball'
   Caption = 'ODE Fur Ball'
-  ClientHeight = 553
-  ClientWidth = 941
+  ClientHeight = 442
+  ClientWidth = 753
   Color = clBtnFace
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
   Font.Color = clWindowText
-  Font.Height = -14
+  Font.Height = -11
   Font.Name = 'Tahoma'
   Font.Name = 'Tahoma'
   Font.Style = []
   Font.Style = []
   OnClose = FormClose
   OnClose = FormClose
   OnCreate = FormCreate
   OnCreate = FormCreate
   OnMouseWheel = FormMouseWheel
   OnMouseWheel = FormMouseWheel
-  PixelsPerInch = 120
-  TextHeight = 17
+  TextHeight = 13
   object GLSceneViewer1: TGLSceneViewer
   object GLSceneViewer1: TGLSceneViewer
     Left = 0
     Left = 0
-    Top = 71
-    Width = 941
-    Height = 482
-    Margins.Left = 4
-    Margins.Top = 4
-    Margins.Right = 4
-    Margins.Bottom = 4
+    Top = 57
+    Width = 753
+    Height = 385
     Camera = GLCamera1
     Camera = GLCamera1
     Buffer.BackgroundColor = clSilver
     Buffer.BackgroundColor = clSilver
     Buffer.ContextOptions = [roDoubleBuffer, roStencilBuffer, roRenderToWindow]
     Buffer.ContextOptions = [roDoubleBuffer, roStencilBuffer, roRenderToWindow]
     Buffer.AntiAliasing = aa4xHQ
     Buffer.AntiAliasing = aa4xHQ
-    FieldOfView = 147.607437133789100000
+    FieldOfView = 140.033782958984400000
     PenAsTouch = False
     PenAsTouch = False
     Align = alClient
     Align = alClient
     OnMouseMove = GLSceneViewer1MouseMove
     OnMouseMove = GLSceneViewer1MouseMove
@@ -37,62 +32,42 @@ object Form1: TForm1
   object Panel1: TPanel
   object Panel1: TPanel
     Left = 0
     Left = 0
     Top = 0
     Top = 0
-    Width = 941
-    Height = 71
-    Margins.Left = 4
-    Margins.Top = 4
-    Margins.Right = 4
-    Margins.Bottom = 4
+    Width = 753
+    Height = 57
     Align = alTop
     Align = alTop
     TabOrder = 1
     TabOrder = 1
     DesignSize = (
     DesignSize = (
-      941
-      71)
+      753
+      57)
     object Label1: TLabel
     object Label1: TLabel
-      Left = 409
-      Top = 13
-      Width = 198
-      Height = 17
-      Margins.Left = 4
-      Margins.Top = 4
-      Margins.Right = 4
-      Margins.Bottom = 4
+      Left = 327
+      Top = 10
+      Width = 153
+      Height = 13
       Caption = '(Steer with A/D W/S UP/DOWN)'
       Caption = '(Steer with A/D W/S UP/DOWN)'
     end
     end
     object Label_FPS: TLabel
     object Label_FPS: TLabel
-      Left = 778
-      Top = 11
-      Width = 23
-      Height = 17
-      Margins.Left = 4
-      Margins.Top = 4
-      Margins.Right = 4
-      Margins.Bottom = 4
+      Left = 623
+      Top = 9
+      Width = 18
+      Height = 13
       Alignment = taRightJustify
       Alignment = taRightJustify
       Anchors = [akLeft, akTop, akRight]
       Anchors = [akLeft, akTop, akRight]
       Caption = 'FPS'
       Caption = 'FPS'
     end
     end
     object CheckBox_LockBall: TCheckBox
     object CheckBox_LockBall: TCheckBox
-      Left = 10
-      Top = 10
-      Width = 81
-      Height = 21
-      Margins.Left = 4
-      Margins.Top = 4
-      Margins.Right = 4
-      Margins.Bottom = 4
+      Left = 8
+      Top = 8
+      Width = 65
+      Height = 17
       Caption = '&Lock Ball'
       Caption = '&Lock Ball'
       TabOrder = 0
       TabOrder = 0
     end
     end
     object CheckBox_Inertia: TCheckBox
     object CheckBox_Inertia: TCheckBox
-      Left = 10
-      Top = 30
-      Width = 81
-      Height = 21
-      Margins.Left = 4
-      Margins.Top = 4
-      Margins.Right = 4
-      Margins.Bottom = 4
+      Left = 8
+      Top = 24
+      Width = 65
+      Height = 17
       Caption = 'Fur &Inertia'
       Caption = 'Fur &Inertia'
       Checked = True
       Checked = True
       State = cbChecked
       State = cbChecked
@@ -100,14 +75,10 @@ object Form1: TForm1
       OnClick = CheckBox_InertiaClick
       OnClick = CheckBox_InertiaClick
     end
     end
     object CheckBox_FurGravity: TCheckBox
     object CheckBox_FurGravity: TCheckBox
-      Left = 100
-      Top = 10
-      Width = 101
-      Height = 21
-      Margins.Left = 4
-      Margins.Top = 4
-      Margins.Right = 4
-      Margins.Bottom = 4
+      Left = 80
+      Top = 8
+      Width = 81
+      Height = 17
       Caption = 'Fur &Gravity'
       Caption = 'Fur &Gravity'
       Checked = True
       Checked = True
       State = cbChecked
       State = cbChecked
@@ -115,14 +86,10 @@ object Form1: TForm1
       OnClick = CheckBox_FurGravityClick
       OnClick = CheckBox_FurGravityClick
     end
     end
     object CheckBox_WindResistence: TCheckBox
     object CheckBox_WindResistence: TCheckBox
-      Left = 200
-      Top = 10
-      Width = 131
-      Height = 21
-      Margins.Left = 4
-      Margins.Top = 4
-      Margins.Right = 4
-      Margins.Bottom = 4
+      Left = 160
+      Top = 8
+      Width = 105
+      Height = 17
       Caption = '&Wind Resistence'
       Caption = '&Wind Resistence'
       Checked = True
       Checked = True
       State = cbChecked
       State = cbChecked
@@ -130,43 +97,31 @@ object Form1: TForm1
       OnClick = CheckBox_WindResistenceClick
       OnClick = CheckBox_WindResistenceClick
     end
     end
     object TrackBar_WindForce: TTrackBar
     object TrackBar_WindForce: TTrackBar
-      Left = 200
-      Top = 30
-      Width = 131
-      Height = 21
-      Margins.Left = 4
-      Margins.Top = 4
-      Margins.Right = 4
-      Margins.Bottom = 4
+      Left = 160
+      Top = 24
+      Width = 105
+      Height = 17
       Max = 100
       Max = 100
       Position = 50
       Position = 50
       TabOrder = 4
       TabOrder = 4
-      ThumbLength = 13
+      ThumbLength = 10
       TickStyle = tsNone
       TickStyle = tsNone
       OnChange = TrackBar_WindForceChange
       OnChange = TrackBar_WindForceChange
     end
     end
     object CheckBox_Bald: TCheckBox
     object CheckBox_Bald: TCheckBox
-      Left = 340
-      Top = 10
-      Width = 61
-      Height = 21
-      Margins.Left = 4
-      Margins.Top = 4
-      Margins.Right = 4
-      Margins.Bottom = 4
+      Left = 272
+      Top = 8
+      Width = 49
+      Height = 17
       Caption = '&Bald'
       Caption = '&Bald'
       TabOrder = 5
       TabOrder = 5
       OnClick = CheckBox_BaldClick
       OnClick = CheckBox_BaldClick
     end
     end
     object CheckBox_Shadows: TCheckBox
     object CheckBox_Shadows: TCheckBox
-      Left = 620
-      Top = 10
-      Width = 81
-      Height = 21
-      Margins.Left = 4
-      Margins.Top = 4
-      Margins.Right = 4
-      Margins.Bottom = 4
+      Left = 496
+      Top = 8
+      Width = 65
+      Height = 17
       Caption = '&Shadows'
       Caption = '&Shadows'
       TabOrder = 6
       TabOrder = 6
       OnClick = CheckBox_ShadowsClick
       OnClick = CheckBox_ShadowsClick

+ 1 - 1
Examples/Demos/physics/OdeFurball/fOdeFurballC.h

@@ -15,7 +15,7 @@
 #include "GLS.SceneViewer.hpp"
 #include "GLS.SceneViewer.hpp"
 #include "GLS.Cadencer.hpp"
 #include "GLS.Cadencer.hpp"
 
 
-#include "Physics.ODEImport.hpp"
+#include "ODE.Import.hpp"
 #include "Physics.ODEUtils.hpp"
 #include "Physics.ODEUtils.hpp"
 #include <GLS.Navigator.hpp>
 #include <GLS.Navigator.hpp>
 #include <GLS.ShadowPlane.hpp>
 #include <GLS.ShadowPlane.hpp>

+ 44 - 89
Examples/Demos/physics/OdeFurball/fOdeFurballD.dfm

@@ -2,49 +2,40 @@ object FormFurball: TFormFurball
   Left = 192
   Left = 192
   Top = 114
   Top = 114
   Caption = 'Fur Ball'
   Caption = 'Fur Ball'
-  ClientHeight = 491
-  ClientWidth = 790
+  ClientHeight = 393
+  ClientWidth = 632
   Color = clBtnFace
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
   Font.Color = clWindowText
-  Font.Height = -14
+  Font.Height = -11
   Font.Name = 'MS Sans Serif'
   Font.Name = 'MS Sans Serif'
   Font.Style = []
   Font.Style = []
   OnClose = FormClose
   OnClose = FormClose
   OnCreate = FormCreate
   OnCreate = FormCreate
   OnMouseWheel = FormMouseWheel
   OnMouseWheel = FormMouseWheel
-  PixelsPerInch = 120
   DesignSize = (
   DesignSize = (
-    790
-    491)
-  TextHeight = 16
+    632
+    393)
+  TextHeight = 13
   object Label_FPS: TLabel
   object Label_FPS: TLabel
-    Left = 758
-    Top = 3
-    Width = 26
-    Height = 16
-    Margins.Left = 4
-    Margins.Top = 4
-    Margins.Right = 4
-    Margins.Bottom = 4
+    Left = 607
+    Top = 2
+    Width = 20
+    Height = 13
     Alignment = taRightJustify
     Alignment = taRightJustify
     Anchors = [akLeft, akTop, akRight]
     Anchors = [akLeft, akTop, akRight]
     Caption = 'FPS'
     Caption = 'FPS'
   end
   end
   object GLSceneViewer1: TGLSceneViewer
   object GLSceneViewer1: TGLSceneViewer
     Left = 0
     Left = 0
-    Top = 61
-    Width = 790
-    Height = 430
-    Margins.Left = 4
-    Margins.Top = 4
-    Margins.Right = 4
-    Margins.Bottom = 4
+    Top = 49
+    Width = 632
+    Height = 344
     Camera = GLCamera1
     Camera = GLCamera1
     Buffer.BackgroundColor = clSilver
     Buffer.BackgroundColor = clSilver
     Buffer.ContextOptions = [roDoubleBuffer, roStencilBuffer, roRenderToWindow]
     Buffer.ContextOptions = [roDoubleBuffer, roStencilBuffer, roRenderToWindow]
     Buffer.AntiAliasing = aa4xHQ
     Buffer.AntiAliasing = aa4xHQ
-    FieldOfView = 143.931427001953100000
+    FieldOfView = 135.709640502929700000
     PenAsTouch = False
     PenAsTouch = False
     Align = alClient
     Align = alClient
     OnMouseMove = GLSceneViewer1MouseMove
     OnMouseMove = GLSceneViewer1MouseMove
@@ -53,46 +44,30 @@ object FormFurball: TFormFurball
   object Panel1: TPanel
   object Panel1: TPanel
     Left = 0
     Left = 0
     Top = 0
     Top = 0
-    Width = 790
-    Height = 61
-    Margins.Left = 4
-    Margins.Top = 4
-    Margins.Right = 4
-    Margins.Bottom = 4
+    Width = 632
+    Height = 49
     Align = alTop
     Align = alTop
     TabOrder = 1
     TabOrder = 1
     object Label1: TLabel
     object Label1: TLabel
-      Left = 409
-      Top = 3
-      Width = 189
-      Height = 16
-      Margins.Left = 4
-      Margins.Top = 4
-      Margins.Right = 4
-      Margins.Bottom = 4
+      Left = 327
+      Top = 2
+      Width = 160
+      Height = 13
       Caption = '(Steer with A/D W/S UP/DOWN)'
       Caption = '(Steer with A/D W/S UP/DOWN)'
     end
     end
     object CheckBox_LockBall: TCheckBox
     object CheckBox_LockBall: TCheckBox
-      Left = 10
+      Left = 8
       Top = 0
       Top = 0
-      Width = 81
-      Height = 21
-      Margins.Left = 4
-      Margins.Top = 4
-      Margins.Right = 4
-      Margins.Bottom = 4
+      Width = 65
+      Height = 17
       Caption = '&Lock Ball'
       Caption = '&Lock Ball'
       TabOrder = 0
       TabOrder = 0
     end
     end
     object CheckBox_Inertia: TCheckBox
     object CheckBox_Inertia: TCheckBox
-      Left = 10
-      Top = 20
-      Width = 81
-      Height = 21
-      Margins.Left = 4
-      Margins.Top = 4
-      Margins.Right = 4
-      Margins.Bottom = 4
+      Left = 8
+      Top = 16
+      Width = 65
+      Height = 17
       Caption = 'Fur &Inertia'
       Caption = 'Fur &Inertia'
       Checked = True
       Checked = True
       State = cbChecked
       State = cbChecked
@@ -100,14 +75,10 @@ object FormFurball: TFormFurball
       OnClick = CheckBox_InertiaClick
       OnClick = CheckBox_InertiaClick
     end
     end
     object CheckBox_FurGravity: TCheckBox
     object CheckBox_FurGravity: TCheckBox
-      Left = 100
+      Left = 80
       Top = 0
       Top = 0
-      Width = 101
-      Height = 21
-      Margins.Left = 4
-      Margins.Top = 4
-      Margins.Right = 4
-      Margins.Bottom = 4
+      Width = 81
+      Height = 17
       Caption = 'Fur &Gravity'
       Caption = 'Fur &Gravity'
       Checked = True
       Checked = True
       State = cbChecked
       State = cbChecked
@@ -115,14 +86,10 @@ object FormFurball: TFormFurball
       OnClick = CheckBox_FurGravityClick
       OnClick = CheckBox_FurGravityClick
     end
     end
     object CheckBox_WindResistence: TCheckBox
     object CheckBox_WindResistence: TCheckBox
-      Left = 200
+      Left = 160
       Top = 0
       Top = 0
-      Width = 131
-      Height = 21
-      Margins.Left = 4
-      Margins.Top = 4
-      Margins.Right = 4
-      Margins.Bottom = 4
+      Width = 105
+      Height = 17
       Caption = '&Wind Resistence'
       Caption = '&Wind Resistence'
       Checked = True
       Checked = True
       State = cbChecked
       State = cbChecked
@@ -130,43 +97,31 @@ object FormFurball: TFormFurball
       OnClick = CheckBox_WindResistenceClick
       OnClick = CheckBox_WindResistenceClick
     end
     end
     object TrackBar_WindForce: TTrackBar
     object TrackBar_WindForce: TTrackBar
-      Left = 200
-      Top = 20
-      Width = 131
-      Height = 21
-      Margins.Left = 4
-      Margins.Top = 4
-      Margins.Right = 4
-      Margins.Bottom = 4
+      Left = 160
+      Top = 16
+      Width = 105
+      Height = 17
       Max = 100
       Max = 100
       Position = 50
       Position = 50
       TabOrder = 4
       TabOrder = 4
-      ThumbLength = 13
+      ThumbLength = 10
       TickStyle = tsNone
       TickStyle = tsNone
       OnChange = TrackBar_WindForceChange
       OnChange = TrackBar_WindForceChange
     end
     end
     object CheckBox_Bald: TCheckBox
     object CheckBox_Bald: TCheckBox
-      Left = 340
+      Left = 272
       Top = 0
       Top = 0
-      Width = 61
-      Height = 21
-      Margins.Left = 4
-      Margins.Top = 4
-      Margins.Right = 4
-      Margins.Bottom = 4
+      Width = 49
+      Height = 17
       Caption = '&Bald'
       Caption = '&Bald'
       TabOrder = 5
       TabOrder = 5
       OnClick = CheckBox_BaldClick
       OnClick = CheckBox_BaldClick
     end
     end
     object CheckBox_Shadows: TCheckBox
     object CheckBox_Shadows: TCheckBox
-      Left = 620
+      Left = 496
       Top = 0
       Top = 0
-      Width = 81
-      Height = 21
-      Margins.Left = 4
-      Margins.Top = 4
-      Margins.Right = 4
-      Margins.Bottom = 4
+      Width = 65
+      Height = 17
       Caption = '&Shadows'
       Caption = '&Shadows'
       TabOrder = 6
       TabOrder = 6
       OnClick = CheckBox_ShadowsClick
       OnClick = CheckBox_ShadowsClick

+ 1 - 1
Examples/Demos/physics/OdeFurball/fOdeFurballD.pas

@@ -16,7 +16,7 @@ uses
   Vcl.ComCtrls,
   Vcl.ComCtrls,
   Vcl.Imaging.Jpeg,
   Vcl.Imaging.Jpeg,
 
 
-  Physics.ODEImport,
+  ODE.Import,
   Physics.ODEUtils,
   Physics.ODEUtils,
   GLS.VectorTypes,
   GLS.VectorTypes,
   GLS.SceneViewer,
   GLS.SceneViewer,

+ 7 - 12
Examples/Demos/physics/OdeMachine/fOdeMachineD.dfm

@@ -2,28 +2,23 @@ object FormOdeMachine: TFormOdeMachine
   Left = 83
   Left = 83
   Top = 84
   Top = 84
   Caption = 'Ode Machine'
   Caption = 'Ode Machine'
-  ClientHeight = 537
-  ClientWidth = 745
+  ClientHeight = 430
+  ClientWidth = 596
   Color = clBtnFace
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
   Font.Color = clWindowText
-  Font.Height = -14
+  Font.Height = -11
   Font.Name = 'MS Sans Serif'
   Font.Name = 'MS Sans Serif'
   Font.Style = []
   Font.Style = []
   Position = poScreenCenter
   Position = poScreenCenter
-  PixelsPerInch = 120
-  TextHeight = 16
+  TextHeight = 13
   object GLSceneViewer1: TGLSceneViewer
   object GLSceneViewer1: TGLSceneViewer
     Left = 0
     Left = 0
     Top = 0
     Top = 0
-    Width = 745
-    Height = 537
-    Margins.Left = 4
-    Margins.Top = 4
-    Margins.Right = 4
-    Margins.Bottom = 4
+    Width = 596
+    Height = 430
     Camera = GLCamera1
     Camera = GLCamera1
-    FieldOfView = 158.902450561523400000
+    FieldOfView = 153.816207885742200000
     PenAsTouch = False
     PenAsTouch = False
     Align = alClient
     Align = alClient
     OnMouseDown = GLSceneViewer1MouseDown
     OnMouseDown = GLSceneViewer1MouseDown

+ 1 - 1
Examples/Demos/physics/OdeMachine/fOdeMachineD.pas

@@ -23,7 +23,7 @@ uses
  
  
   GLS.Coordinates,
   GLS.Coordinates,
   GLS.BaseClasses,
   GLS.BaseClasses,
-  Physics.ODEImport;
+  ODE.Import;
 
 
 type
 type
   TFormOdeMachine = class(TForm)
   TFormOdeMachine = class(TForm)

+ 1 - 1
Examples/Demos/physics/OdeRagdoll/fOdeRagdollC.h

@@ -24,7 +24,7 @@
 #include "GLS.SceneViewer.hpp"
 #include "GLS.SceneViewer.hpp"
 #include "GLS.WindowsFont.hpp"
 #include "GLS.WindowsFont.hpp"
 #include "Physics.ODEUtils.hpp"
 #include "Physics.ODEUtils.hpp"
-#include "Physics.ODEImport.hpp"
+#include "ODE.Import.hpp"
 #include "Physics.ODERagdoll.hpp"
 #include "Physics.ODERagdoll.hpp"
 #include "GLS.Utils.hpp"
 #include "GLS.Utils.hpp"
 
 

+ 1 - 1
Examples/Demos/physics/OdeRagdoll/fOdeRagdollD.pas

@@ -34,7 +34,7 @@ uses
   GLS.Coordinates,
   GLS.Coordinates,
 
 
   GLS.BaseClasses,
   GLS.BaseClasses,
-  Physics.ODEImport,
+  ODE.Import,
   Physics.ODERagdoll,
   Physics.ODERagdoll,
   GLS.FileSMD,
   GLS.FileSMD,
   Physics.ODEUtils,
   Physics.ODEUtils,

+ 4 - 4
Packages/GLScene_Physics_RT.dpk

@@ -35,11 +35,11 @@ requires
   GLScene_RT;
   GLScene_RT;
 
 
 contains
 contains
-  Physics.NewtonImport in '..\Source\Physics.NewtonImport.pas',
+  Newton.Import in '..\Source\Common\Newton.Import.pas',
+  NGD.Import in '..\Source\Common\NGD.Import.pas',
+  ODE.Import in '..\Source\Common\ODE.Import.pas',
   Physics.NGDManager in '..\Source\Physics.NGDManager.pas',
   Physics.NGDManager in '..\Source\Physics.NGDManager.pas',
   Physics.NGDRagdoll in '..\Source\Physics.NGDRagdoll.pas',
   Physics.NGDRagdoll in '..\Source\Physics.NGDRagdoll.pas',
-  Physics.NGDImport in '..\Source\Physics.NGDImport.pas',
-  Physics.ODEImport in '..\Source\Physics.ODEImport.pas',
   Physics.ODEManager in '..\Source\Physics.ODEManager.pas',
   Physics.ODEManager in '..\Source\Physics.ODEManager.pas',
   Physics.ODERagdoll in '..\Source\Physics.ODERagdoll.pas',
   Physics.ODERagdoll in '..\Source\Physics.ODERagdoll.pas',
   Physics.ODESkeletonColliders in '..\Source\Physics.ODESkeletonColliders.pas',
   Physics.ODESkeletonColliders in '..\Source\Physics.ODESkeletonColliders.pas',
@@ -49,7 +49,7 @@ contains
   Physics.SPIInertias in '..\Source\Physics.SPIInertias.pas',
   Physics.SPIInertias in '..\Source\Physics.SPIInertias.pas',
   Physics.SPIJoints in '..\Source\Physics.SPIJoints.pas',
   Physics.SPIJoints in '..\Source\Physics.SPIJoints.pas',
   Physics.SPIManager in '..\Source\Physics.SPIManager.pas',
   Physics.SPIManager in '..\Source\Physics.SPIManager.pas',
-  Physics.PhysXImport in '..\Source\Physics.PhysXImport.pas';
+  PhysX.Import in '..\Source\Common\PhysX.Import.pas';
 
 
 end.
 end.
 
 

+ 4 - 4
Packages/GLScene_Physics_RT.dproj

@@ -145,11 +145,11 @@
         <DCCReference Include="rtl.dcp"/>
         <DCCReference Include="rtl.dcp"/>
         <DCCReference Include="vcl.dcp"/>
         <DCCReference Include="vcl.dcp"/>
         <DCCReference Include="GLScene_RT.dcp"/>
         <DCCReference Include="GLScene_RT.dcp"/>
-        <DCCReference Include="..\Source\Physics.NewtonImport.pas"/>
+        <DCCReference Include="..\Source\Common\Newton.Import.pas"/>
+        <DCCReference Include="..\Source\Common\NGD.Import.pas"/>
+        <DCCReference Include="..\Source\Common\ODE.Import.pas"/>
         <DCCReference Include="..\Source\Physics.NGDManager.pas"/>
         <DCCReference Include="..\Source\Physics.NGDManager.pas"/>
         <DCCReference Include="..\Source\Physics.NGDRagdoll.pas"/>
         <DCCReference Include="..\Source\Physics.NGDRagdoll.pas"/>
-        <DCCReference Include="..\Source\Physics.NGDImport.pas"/>
-        <DCCReference Include="..\Source\Physics.ODEImport.pas"/>
         <DCCReference Include="..\Source\Physics.ODEManager.pas"/>
         <DCCReference Include="..\Source\Physics.ODEManager.pas"/>
         <DCCReference Include="..\Source\Physics.ODERagdoll.pas"/>
         <DCCReference Include="..\Source\Physics.ODERagdoll.pas"/>
         <DCCReference Include="..\Source\Physics.ODESkeletonColliders.pas"/>
         <DCCReference Include="..\Source\Physics.ODESkeletonColliders.pas"/>
@@ -159,7 +159,7 @@
         <DCCReference Include="..\Source\Physics.SPIInertias.pas"/>
         <DCCReference Include="..\Source\Physics.SPIInertias.pas"/>
         <DCCReference Include="..\Source\Physics.SPIJoints.pas"/>
         <DCCReference Include="..\Source\Physics.SPIJoints.pas"/>
         <DCCReference Include="..\Source\Physics.SPIManager.pas"/>
         <DCCReference Include="..\Source\Physics.SPIManager.pas"/>
-        <DCCReference Include="..\Source\Physics.PhysXImport.pas"/>
+        <DCCReference Include="..\Source\Common\PhysX.Import.pas"/>
         <BuildConfiguration Include="Base">
         <BuildConfiguration Include="Base">
             <Key>Base</Key>
             <Key>Base</Key>
         </BuildConfiguration>
         </BuildConfiguration>

+ 3 - 2
Packages/GLScene_RT.dpk

@@ -167,7 +167,7 @@ contains
   GLS.MeshUtils in '..\Source\GLS.MeshUtils.pas',
   GLS.MeshUtils in '..\Source\GLS.MeshUtils.pas',
   GLS.Mirror in '..\Source\GLS.Mirror.pas',
   GLS.Mirror in '..\Source\GLS.Mirror.pas',
   GLS.Movement in '..\Source\GLS.Movement.pas',
   GLS.Movement in '..\Source\GLS.Movement.pas',
-  GLS.ModuleLoader in '..\Source\GLS.ModuleLoader.pas',
+  ModuleLoader in '..\Source\Common\ModuleLoader.pas',
   GLS.MultiPolygon in '..\Source\GLS.MultiPolygon.pas',
   GLS.MultiPolygon in '..\Source\GLS.MultiPolygon.pas',
   GLS.MultiProxy in '..\Source\GLS.MultiProxy.pas',
   GLS.MultiProxy in '..\Source\GLS.MultiProxy.pas',
   GLS.MultiSampleImage in '..\Source\GLS.MultiSampleImage.pas',
   GLS.MultiSampleImage in '..\Source\GLS.MultiSampleImage.pas',
@@ -268,7 +268,8 @@ contains
   GLS.XOpenGL in '..\Source\GLS.XOpenGL.pas',
   GLS.XOpenGL in '..\Source\GLS.XOpenGL.pas',
   PasGLTF in '..\Source\Common\PasGLTF.pas',
   PasGLTF in '..\Source\Common\PasGLTF.pas',
   PasJSON in '..\Source\Common\PasJSON.pas',
   PasJSON in '..\Source\Common\PasJSON.pas',
-  PasDblStrUtils in '..\Source\Common\PasDblStrUtils.pas';
+  PasDblStrUtils in '..\Source\Common\PasDblStrUtils.pas',
+  GLS.InitOpenGL in '..\Source\VCL\GLS.InitOpenGL.pas';
 
 
 end.
 end.
 
 

+ 2 - 1
Packages/GLScene_RT.dproj

@@ -271,7 +271,7 @@
         <DCCReference Include="..\Source\GLS.MeshUtils.pas"/>
         <DCCReference Include="..\Source\GLS.MeshUtils.pas"/>
         <DCCReference Include="..\Source\GLS.Mirror.pas"/>
         <DCCReference Include="..\Source\GLS.Mirror.pas"/>
         <DCCReference Include="..\Source\GLS.Movement.pas"/>
         <DCCReference Include="..\Source\GLS.Movement.pas"/>
-        <DCCReference Include="..\Source\GLS.ModuleLoader.pas"/>
+        <DCCReference Include="..\Source\Common\ModuleLoader.pas"/>
         <DCCReference Include="..\Source\GLS.MultiPolygon.pas"/>
         <DCCReference Include="..\Source\GLS.MultiPolygon.pas"/>
         <DCCReference Include="..\Source\GLS.MultiProxy.pas"/>
         <DCCReference Include="..\Source\GLS.MultiProxy.pas"/>
         <DCCReference Include="..\Source\GLS.MultiSampleImage.pas"/>
         <DCCReference Include="..\Source\GLS.MultiSampleImage.pas"/>
@@ -373,6 +373,7 @@
         <DCCReference Include="..\Source\Common\PasGLTF.pas"/>
         <DCCReference Include="..\Source\Common\PasGLTF.pas"/>
         <DCCReference Include="..\Source\Common\PasJSON.pas"/>
         <DCCReference Include="..\Source\Common\PasJSON.pas"/>
         <DCCReference Include="..\Source\Common\PasDblStrUtils.pas"/>
         <DCCReference Include="..\Source\Common\PasDblStrUtils.pas"/>
+        <DCCReference Include="..\Source\VCL\GLS.InitOpenGL.pas"/>
         <BuildConfiguration Include="Base">
         <BuildConfiguration Include="Base">
             <Key>Base</Key>
             <Key>Base</Key>
         </BuildConfiguration>
         </BuildConfiguration>

+ 2 - 2
Packagex/GLXcene_RT.dpk

@@ -172,7 +172,7 @@ contains
   GLX.ObjectManager in '..\Source\FMX\GLX.ObjectManager.pas',
   GLX.ObjectManager in '..\Source\FMX\GLX.ObjectManager.pas',
   GLX.Objects in '..\Source\FMX\GLX.Objects.pas',
   GLX.Objects in '..\Source\FMX\GLX.Objects.pas',
   GLX.Octree in '..\Source\FMX\GLX.Octree.pas',
   GLX.Octree in '..\Source\FMX\GLX.Octree.pas',
-  OpenGLx.InitFMX in '..\Source\FMX\OpenGLx.InitFMX.pas',
+  GLX.InitOpenGL in '..\Source\FMX\GLX.InitOpenGL.pas',
   GLX.OutlineShader in '..\Source\FMX\GLX.OutlineShader.pas',
   GLX.OutlineShader in '..\Source\FMX\GLX.OutlineShader.pas',
   GLX.ParametricSurfaces in '..\Source\FMX\GLX.ParametricSurfaces.pas',
   GLX.ParametricSurfaces in '..\Source\FMX\GLX.ParametricSurfaces.pas',
   GLX.ParticleFX in '..\Source\FMX\GLX.ParticleFX.pas',
   GLX.ParticleFX in '..\Source\FMX\GLX.ParticleFX.pas',
@@ -259,7 +259,7 @@ contains
   GLX.GeometryBB in '..\Source\FMX\GLX.GeometryBB.pas',
   GLX.GeometryBB in '..\Source\FMX\GLX.GeometryBB.pas',
   GLX.GeometryCoordinates in '..\Source\FMX\GLX.GeometryCoordinates.pas',
   GLX.GeometryCoordinates in '..\Source\FMX\GLX.GeometryCoordinates.pas',
   GLX.OpenGL in '..\Source\FMX\GLX.OpenGL.pas',
   GLX.OpenGL in '..\Source\FMX\GLX.OpenGL.pas',
-  Scene.Vulkan in '..\Source\Common\Scene.Vulkan.pas',
+  Vulkan.Import in '..\Source\Common\Vulkan.Import.pas',
   GLSLx.Parameter in '..\Source\FMX\GLSLx.Parameter.pas';
   GLSLx.Parameter in '..\Source\FMX\GLSLx.Parameter.pas';
 
 
 end.
 end.

+ 2 - 2
Packagex/GLXcene_RT.dproj

@@ -292,7 +292,7 @@
         <DCCReference Include="..\Source\FMX\GLX.ObjectManager.pas"/>
         <DCCReference Include="..\Source\FMX\GLX.ObjectManager.pas"/>
         <DCCReference Include="..\Source\FMX\GLX.Objects.pas"/>
         <DCCReference Include="..\Source\FMX\GLX.Objects.pas"/>
         <DCCReference Include="..\Source\FMX\GLX.Octree.pas"/>
         <DCCReference Include="..\Source\FMX\GLX.Octree.pas"/>
-        <DCCReference Include="..\Source\FMX\OpenGLx.InitFMX.pas"/>
+        <DCCReference Include="..\Source\FMX\GLX.InitOpenGL.pas"/>
         <DCCReference Include="..\Source\FMX\GLX.OutlineShader.pas"/>
         <DCCReference Include="..\Source\FMX\GLX.OutlineShader.pas"/>
         <DCCReference Include="..\Source\FMX\GLX.ParametricSurfaces.pas"/>
         <DCCReference Include="..\Source\FMX\GLX.ParametricSurfaces.pas"/>
         <DCCReference Include="..\Source\FMX\GLX.ParticleFX.pas"/>
         <DCCReference Include="..\Source\FMX\GLX.ParticleFX.pas"/>
@@ -379,7 +379,7 @@
         <DCCReference Include="..\Source\FMX\GLX.GeometryBB.pas"/>
         <DCCReference Include="..\Source\FMX\GLX.GeometryBB.pas"/>
         <DCCReference Include="..\Source\FMX\GLX.GeometryCoordinates.pas"/>
         <DCCReference Include="..\Source\FMX\GLX.GeometryCoordinates.pas"/>
         <DCCReference Include="..\Source\FMX\GLX.OpenGL.pas"/>
         <DCCReference Include="..\Source\FMX\GLX.OpenGL.pas"/>
-        <DCCReference Include="..\Source\Common\Scene.Vulkan.pas"/>
+        <DCCReference Include="..\Source\Common\Vulkan.Import.pas"/>
         <DCCReference Include="..\Source\FMX\GLSLx.Parameter.pas"/>
         <DCCReference Include="..\Source\FMX\GLSLx.Parameter.pas"/>
         <BuildConfiguration Include="Base">
         <BuildConfiguration Include="Base">
             <Key>Base</Key>
             <Key>Base</Key>

+ 1 - 1
Source/GLS.ModuleLoader.pas → Source/Common/ModuleLoader.pas

@@ -1,7 +1,7 @@
 //
 //
 // The graphics platform GLScene https://github.com/glscene
 // The graphics platform GLScene https://github.com/glscene
 //
 //
-unit GLS.ModuleLoader;
+unit ModuleLoader;
 
 
 {******************************************************************}
 {******************************************************************}
 {                                                                  }
 {                                                                  }

+ 1 - 1
Source/Physics.NGDImport.pas → Source/Common/NGD.Import.pas

@@ -1,7 +1,7 @@
 //
 //
 // The graphics platform GLScene https://github.com/glscene
 // The graphics platform GLScene https://github.com/glscene
 //
 //
-unit Physics.NGDImport;
+unit NGD.Import;
 
 
 (* Copyright (c) <2003-2014> <Julio Jerez, Newton Game Dynamics>
 (* Copyright (c) <2003-2014> <Julio Jerez, Newton Game Dynamics>
   *
   *

+ 1 - 1
Source/Physics.NewtonImport.pas → Source/Common/Newton.Import.pas

@@ -18,7 +18,7 @@
 *
 *
 * 3. This notice may not be removed or altered from any source distribution.
 * 3. This notice may not be removed or altered from any source distribution.
 *)
 *)
-unit Physics.NewtonImport;
+unit Newton.Import;
 
 
 // Define double to use newton in double precision
 // Define double to use newton in double precision
 {.$DEFINE USE_DOUBLE_PRECISION}
 {.$DEFINE USE_DOUBLE_PRECISION}

+ 2 - 2
Source/Physics.ODEImport.pas → Source/Common/ODE.Import.pas

@@ -1,7 +1,7 @@
 //
 //
 // The graphics platform GLScene https://github.com/glscene
 // The graphics platform GLScene https://github.com/glscene
 //
 //
-unit Physics.ODEImport;
+unit ODE.Import;
 
 
 (* ************************************************************************
 (* ************************************************************************
   *                                                                       *
   *                                                                       *
@@ -55,7 +55,7 @@ interface
 
 
 uses
 uses
   System.Classes,
   System.Classes,
-  GLS.ModuleLoader;
+  ModuleLoader;
 
 
 const
 const
 
 

+ 1 - 1
Source/Physics.PhysXImport.pas → Source/Common/PhysX.Import.pas

@@ -1,7 +1,7 @@
 //
 //
 // The graphics platform GLScene https://github.com/glscene
 // The graphics platform GLScene https://github.com/glscene
 //
 //
-unit Physics.PhysXImport;
+unit PhysX.Import;
 
 
 interface
 interface
 
 

+ 1 - 1
Source/Common/Scene.Vulkan.pas → Source/Common/Vulkan.Import.pas

@@ -1,7 +1,7 @@
 //
 //
 // The graphics platform GLXcene https://github.com/glscene
 // The graphics platform GLXcene https://github.com/glscene
 //
 //
-unit Scene.Vulkan;
+unit Vulkan.Import;
 
 
 (*
 (*
 ** Copyright (c) 2015-2017 The Khronos Group Inc.
 ** Copyright (c) 2015-2017 The Khronos Group Inc.

+ 582 - 0
Source/FMX/GLX.InitOpenGL.pas

@@ -0,0 +1,582 @@
+//
+// The graphics platform GLXcene https://github.com/glscene
+//
+unit GLX.InitOpenGL;
+
+(* OpenGL for Initialization in FMX *)
+
+interface
+
+uses
+  Winapi.OpenGL,
+  Winapi.OpenGLext,
+  Winapi.Windows,
+  FMX.Forms;
+
+type
+  TgxOpenGL = class
+  private
+    CommonCustomForm: TCommonCustomForm;
+    _WND: HWND;
+    _DC: HDC;
+  protected
+    _PFD: TPixelFormatDescriptor;
+    _PFI: Integer;
+    _RC: HGLRC;
+    procedure SetPFD(const PFD_: TPixelFormatDescriptor);
+    procedure SetPFI(const PFI_: Integer);
+    procedure CreateWindow;
+    procedure DestroyWindow;
+    procedure ValidatePFD(const PFD_: TPixelFormatDescriptor);
+    procedure ValidatePFI(const PFI_: Integer);
+    procedure CreateDC;
+    procedure DestroyDC;
+    procedure CreateRC;
+    procedure DestroyRC;
+  public
+    constructor Create;
+    destructor Destroy; override;
+    property PFD: TPixelFormatDescriptor read _PFD write SetPFD;
+    property PFI: Integer read _PFI write SetPFI;
+    property RC: HGLRC read _RC;
+    class function DefaultPFD: TPixelFormatDescriptor;
+    procedure BeginGL;
+    procedure EndGL;
+    procedure InitOpenGL;
+    procedure ApplyPixelFormat(const DC_: HDC);
+  end;
+
+//-----------------------------------------------------------------------
+  TgxShader = class
+  private
+  protected
+    _ID: GLuint;
+  public
+    constructor Create(const Kind_: GLenum);
+    destructor Destroy; override;
+    property ID: GLuint read _ID;
+    procedure SetSource(const Source_: String);
+  end;
+
+//-----------------------------------------------------------------------
+
+  TgxShaderV = class(TgxShader)
+  private
+  protected
+  public
+    constructor Create;
+    destructor Destroy; override;
+  end;
+
+//-----------------------------------------------------------------------
+
+  TgxShaderG = class(TgxShader)
+  private
+  protected
+  public
+    constructor Create;
+    destructor Destroy; override;
+  end;
+
+//-----------------------------------------------------------------------
+
+  TgxShaderF = class(TgxShader)
+  private
+  protected
+  public
+    constructor Create;
+    destructor Destroy; override;
+  end;
+
+//-----------------------------------------------------------------------
+
+  TgxProgram = class
+  private
+  protected
+    _ID: GLuint;
+  public
+    constructor Create;
+    destructor Destroy; override;
+    procedure Attach(const Shader_: TgxShader);
+    procedure Detach(const Shader_: TgxShader);
+    procedure Link;
+    procedure Use;
+  end;
+
+//-----------------------------------------------------------------------
+
+  TgxBuffer<_TYPE_: record > = class
+  public type
+    _PValue_ = ^_TYPE_;
+  private
+  protected
+    _ID: GLuint;
+    _Kind: GLenum;
+    _Count: Integer;
+    _Head: _PValue_;
+    procedure SetCount(const Count_: Integer);
+  public
+    constructor Create(const Kind_: GLenum);
+    destructor Destroy; override;
+    property ID: GLuint read _ID;
+    property Count: Integer read _Count write SetCount;
+    procedure Bind;
+    procedure Unbind;
+    procedure Map;
+    procedure Unmap;
+  end;
+
+//-----------------------------------------------------------------------
+
+  TgxBufferV<_TYPE_: record > = class(TgxBuffer<_TYPE_>)
+  private
+  protected
+  public
+    constructor Create;
+    destructor Destroy; override;
+  end;
+
+//-----------------------------------------------------------------------
+
+  TgxBufferI<_TYPE_: record > = class(TgxBuffer<_TYPE_>)
+  private
+  protected
+  public
+    constructor Create;
+    destructor Destroy; override;
+  end;
+
+//-----------------------------------------------------------------------
+
+  TgxBufferU<_TYPE_: record > = class(TgxBuffer<_TYPE_>)
+  private
+  protected
+  public
+    constructor Create;
+    destructor Destroy; override;
+  end;
+
+//-----------------------------------------------------------------------
+
+  TgxArray = class
+  private
+  protected
+    _ID: GLuint;
+  public
+    constructor Create;
+    destructor Destroy; override;
+    property ID: GLuint read _ID;
+    procedure BeginBind;
+    procedure EndBind;
+  end;
+
+var
+  GXOpenGL: TgxOpenGL;
+
+//-----------------------------------------------------------------------
+implementation
+//-----------------------------------------------------------------------
+
+uses
+  System.SysUtils,
+  FMX.Platform.Win;
+
+procedure TgxOpenGL.SetPFD(const PFD_: TPixelFormatDescriptor);
+begin
+  DestroyRC;
+  DestroyDC;
+  CreateDC;
+  ValidatePFD(PFD_);
+  CreateRC;
+end;
+
+procedure TgxOpenGL.SetPFI(const PFI_: Integer);
+begin
+  DestroyRC;
+  DestroyDC;
+  CreateDC;
+  ValidatePFI(PFI_);
+  CreateRC;
+end;
+
+// ------------------------------------------------------------------------------
+procedure TgxOpenGL.CreateWindow;
+begin
+  CommonCustomForm := TCommonCustomForm.Create(nil);
+  _WND := WindowHandleToPlatform(CommonCustomForm.Handle).Wnd;
+end;
+
+procedure TgxOpenGL.DestroyWindow;
+begin
+  CommonCustomForm.Free;
+end;
+
+// ------------------------------------------------------------------------------
+
+procedure TgxOpenGL.ValidatePFD(const PFD_: TPixelFormatDescriptor);
+var
+  I: Integer;
+begin
+  _PFD := PFD_;
+  I := ChoosePixelFormat(_DC, @_PFD);
+  Assert(I > 0, 'Not found the PixelFormat with a close setting!');
+  ValidatePFI(I);
+end;
+
+procedure TgxOpenGL.ValidatePFI(const PFI_: Integer);
+begin
+  _PFI := PFI_;
+  Assert(DescribePixelFormat(_DC, _PFI, SizeOf(TPixelFormatDescriptor), _PFD),
+    'Not found the PixelFormat of the index!');
+end;
+
+// ------------------------------------------------------------------------------
+
+procedure TgxOpenGL.CreateDC;
+begin
+  _DC := GetDC(_WND);
+end;
+
+procedure TgxOpenGL.DestroyDC;
+begin
+  ReleaseDC(0, _DC);
+end;
+
+// ------------------------------------------------------------------------------
+
+procedure TgxOpenGL.CreateRC;
+begin
+  ApplyPixelFormat(_DC);
+
+  _RC := wglCreateContext(_DC);
+end;
+
+procedure TgxOpenGL.DestroyRC;
+begin
+  wglDeleteContext(_RC);
+end;
+
+constructor TgxOpenGL.Create;
+begin
+  inherited;
+  CreateWindow;
+  CreateDC;
+  ValidatePFD(DefaultPFD);
+  CreateRC;
+  InitOpenGL;
+end;
+
+destructor TgxOpenGL.Destroy;
+begin
+  DestroyRC;
+  DestroyDC;
+  DestroyWindow;
+  inherited;
+end;
+
+// ------------------------------------------------------------------------------
+
+class function TgxOpenGL.DefaultPFD: TPixelFormatDescriptor;
+begin
+  with Result do
+  begin
+    nSize := SizeOf(TPixelFormatDescriptor);
+    nVersion := 1;
+    dwFlags := PFD_DRAW_TO_WINDOW or PFD_SUPPORT_OPENGL or PFD_DOUBLEBUFFER;
+    iPixelType := PFD_TYPE_RGBA;
+    cColorBits := 24;
+    cRedBits := 0;
+    cRedShift := 0;
+    cGreenBits := 0;
+    cGreenShift := 0;
+    cBlueBits := 0;
+    cBlueShift := 0;
+    cAlphaBits := 0;
+    cAlphaShift := 0;
+    cAccumBits := 0;
+    cAccumRedBits := 0;
+    cAccumGreenBits := 0;
+    cAccumBlueBits := 0;
+    cAccumAlphaBits := 0;
+    cDepthBits := 32;
+    cStencilBits := 0;
+    cAuxBuffers := 0;
+    iLayerType := PFD_MAIN_PLANE;
+    bReserved := 0;
+    dwLayerMask := 0;
+    dwVisibleMask := 0;
+    dwDamageMask := 0;
+  end;
+end;
+
+// ------------------------------------------------------------------------------
+
+procedure TgxOpenGL.BeginGL;
+begin
+  wglMakeCurrent(_DC, _RC);
+end;
+
+procedure TgxOpenGL.EndGL;
+begin
+  wglMakeCurrent(_DC, 0);
+end;
+
+// ------------------------------------------------------------------------------
+
+procedure TgxOpenGL.InitOpenGL;
+begin
+  BeginGL;
+  glEnable(GL_DEPTH_TEST);
+  glEnable(GL_CULL_FACE);
+  EndGL;
+end;
+
+// ------------------------------------------------------------------------------
+
+procedure TgxOpenGL.ApplyPixelFormat(const DC_: HDC);
+begin
+  Assert(SetPixelFormat(DC_, _PFI, @_PFD), 'SetPixelFormat() is failed!');
+end;
+
+// ------------------------------------------------------------------------------
+
+constructor TgxShader.Create(const Kind_: GLenum);
+begin
+  inherited Create;
+  _ID := glCreateShader(Kind_);
+end;
+
+destructor TgxShader.Destroy;
+begin
+  glDeleteShader(_ID);
+  inherited;
+end;
+
+// ------------------------------------------------------------------------------
+
+procedure TgxShader.SetSource(const Source_: String);
+var
+  P: PAnsiChar;
+  N: GLint;
+  E: GLint;
+  Cs: array of PGLchar;
+  CsN: GLsizei;
+begin
+  P := PAnsiChar(AnsiString(Source_));
+  N := Length(Source_);
+  glShaderSource(_ID, 1, @P, @N);
+  glCompileShader(_ID);
+  glGetShaderiv(_ID, GL_COMPILE_STATUS, @E);
+  if E = GL_FALSE then
+  begin
+    glGetShaderiv(_ID, GL_INFO_LOG_LENGTH, @N);
+    SetLength(Cs, N);
+    glGetShaderInfoLog(_ID, N, @CsN, @Cs[0]);
+    Assert(False, AnsiString(Cs));
+  end;
+end;
+
+// ------------------------------------------------------------------------------
+
+constructor TgxShaderV.Create;
+begin
+  inherited Create(GL_VERTEX_SHADER);
+end;
+
+destructor TgxShaderV.Destroy;
+begin
+  inherited;
+end;
+
+// ------------------------------------------------------------------------------
+
+constructor TgxShaderG.Create;
+begin
+  inherited Create(GL_GEOMETRY_SHADER);
+end;
+
+destructor TgxShaderG.Destroy;
+begin
+  inherited;
+end;
+
+// ------------------------------------------------------------------------------
+
+constructor TgxShaderF.Create;
+begin
+  inherited Create(GL_FRAGMENT_SHADER);
+end;
+
+destructor TgxShaderF.Destroy;
+begin
+  inherited;
+end;
+
+// ------------------------------------------------------------------------------
+
+constructor TgxProgram.Create;
+begin
+  inherited;
+  _ID := glCreateProgram;
+end;
+
+destructor TgxProgram.Destroy;
+begin
+  glDeleteProgram(_ID);
+  inherited;
+end;
+
+// ------------------------------------------------------------------------------
+
+procedure TgxProgram.Attach(const Shader_: TgxShader);
+begin
+  glAttachShader(_ID, Shader_.ID);
+end;
+
+procedure TgxProgram.Detach(const Shader_: TgxShader);
+begin
+  glDetachShader(_ID, Shader_.ID);
+end;
+
+// ------------------------------------------------------------------------------
+
+procedure TgxProgram.Link;
+begin
+  glLinkProgram(_ID);
+end;
+
+// ------------------------------------------------------------------------------
+
+procedure TgxProgram.Use;
+begin
+  glUseProgram(_ID);
+end;
+
+// ------------------------------------------------------------------------------
+
+procedure TgxBuffer<_TYPE_>.SetCount(const Count_: Integer);
+begin
+  _Count := Count_;
+  Bind;
+  glBufferData(_Kind, SizeOf(_TYPE_) * _Count, nil, GL_DYNAMIC_DRAW);
+  Unbind;
+end;
+
+// ------------------------------------------------------------------------------
+
+constructor TgxBuffer<_TYPE_>.Create(const Kind_: GLenum);
+begin
+  inherited Create;
+  glGenBuffers(1, @_ID);
+  _Kind := Kind_;
+  Count := 0;
+end;
+
+// ------------------------------------------------------------------------------
+
+destructor TgxBuffer<_TYPE_>.Destroy;
+begin
+  glDeleteBuffers(1, @_ID);
+  inherited;
+end;
+
+// ------------------------------------------------------------------------------
+
+procedure TgxBuffer<_TYPE_>.Bind;
+begin
+  glBindBuffer(_Kind, _ID);
+end;
+
+procedure TgxBuffer<_TYPE_>.Unbind;
+begin
+  glBindBuffer(_Kind, 0);
+end;
+
+// ------------------------------------------------------------------------------
+
+procedure TgxBuffer<_TYPE_>.Map;
+begin
+  Bind;
+  _Head := glMapBuffer(_Kind, GL_READ_WRITE);
+end;
+
+procedure TgxBuffer<_TYPE_>.Unmap;
+begin
+  glUnmapBuffer(_Kind);
+  Unbind;
+end;
+
+constructor TgxBufferV<_TYPE_>.Create;
+begin
+  inherited Create(GL_ARRAY_BUFFER);
+end;
+
+destructor TgxBufferV<_TYPE_>.Destroy;
+begin
+  inherited;
+end;
+
+// ------------------------------------------------------------------------------
+
+constructor TgxBufferI<_TYPE_>.Create;
+begin
+  inherited Create(GL_ELEMENT_ARRAY_BUFFER);
+end;
+
+destructor TgxBufferI<_TYPE_>.Destroy;
+begin
+  inherited;
+end;
+
+// ------------------------------------------------------------------------------
+
+constructor TgxBufferU<_TYPE_>.Create;
+begin
+  inherited Create(GL_UNIFORM_BUFFER);
+end;
+
+destructor TgxBufferU<_TYPE_>.Destroy;
+begin
+  inherited;
+end;
+
+// ------------------------------------------------------------------------------
+
+constructor TgxArray.Create;
+begin
+  inherited Create;
+  glGenVertexArrays(1, @_ID);
+end;
+
+destructor TgxArray.Destroy;
+begin
+  glDeleteVertexArrays(1, @_ID);
+  inherited;
+end;
+
+// ------------------------------------------------------------------------------
+
+procedure TgxArray.BeginBind;
+begin
+  glBindVertexArray(_ID);
+end;
+
+procedure TgxArray.EndBind;
+begin
+  glBindVertexArray(0);
+end;
+
+//==========================================================================
+initialization
+//==========================================================================
+
+GXOpenGL := TgxOpenGL.Create;
+GXOpenGL.BeginGL;
+InitOpenGLext;
+
+finalization
+
+GXOpenGL.EndGL;
+GXOpenGL.Free;
+
+end.

+ 0 - 301
Source/FMX/Physix.ModuleLoader.pas

@@ -1,301 +0,0 @@
-//
-// The graphics platform GLXcene https://github.com/glscene
-//
-{******************************************************************}
-{                                                                  }
-{       Project JEDI                                               }
-{       OS independent Dynamic Loading Helpers                     }
-{                                                                  }
-{ The initial developer of the this code is                        }
-{ Robert Marquardt <[email protected])                       }
-{                                                                  }
-{ Copyright (C) 2000, 2001 Robert Marquardt.                       }
-{                                                                  }
-{ Obtained through:                                                }
-{ Joint Endeavour of Delphi Innovators (Project JEDI)              }
-{                                                                  }
-{ You may retrieve the latest version of this file at the Project  }
-{ JEDI home page, located at http://delphi-jedi.org                }
-{                                                                  }
-{ The contents of this file are used with permission, subject to   }
-{ the Mozilla Public License Version 1.1 (the "License"); you may  }
-{ not use this file except in compliance with the License. You may }
-{ obtain a copy of the License at                                  }
-{ http://www.mozilla.org/NPL/NPL-1_1Final.html                     }
-{                                                                  }
-{ Software distributed under the License is distributed on an      }
-{ "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or   }
-{ implied. See the License for the specific language governing     }
-{ rights and limitations under the License.                        }
-{                                                                  }
-{******************************************************************}
-unit Physix.ModuleLoader;
-
-interface
-
-{$WEAKPACKAGEUNIT ON}
-
-// each OS gets its own IFDEFed complete code block to make reading easier
-
-{$IFDEF MSWINDOWS}
-uses
-  Winapi.Windows;
-
-type
-  // Handle to a loaded DLL
-  TModuleHandle = HINST;
-
-const
-  // Value designating an unassigned TModuleHandle od a failed loading
-  INVALID_MODULEHANDLE_VALUE = TModuleHandle(0);
-
-function LoadModule(var Module: TModuleHandle; FileName: PChar): Boolean; stdcall;
-function LoadModuleEx(var Module: TModuleHandle; FileName: PChar; Flags: Cardinal): Boolean; stdcall;
-procedure UnloadModule(var Module: TModuleHandle); stdcall;
-function GetModuleSymbol(Module: TModuleHandle; SymbolName: PChar): Pointer; stdcall;
-function GetModuleSymbolEx(Module: TModuleHandle; SymbolName: PChar; var Accu: Boolean): Pointer; stdcall;
-function ReadModuleData(Module: TModuleHandle; SymbolName: PChar; var Buffer; Size: Cardinal): Boolean; stdcall;
-function WriteModuleData(Module: TModuleHandle; SymbolName: PChar; var Buffer; Size: Cardinal): Boolean; stdcall;
-
-//-----------------------------------------------------
-implementation
-//-----------------------------------------------------
-
-// load the DLL file FileName
-// the rules for FileName are those of LoadLibrary
-// Returns: True = success, False = failure to load
-// Assigns: the handle of the loaded DLL to Module
-// Warning: if Module has any other value than INVALID_MODULEHANDLE_VALUE
-// on entry the function will do nothing but returning success.
-
-function LoadModule(var Module: TModuleHandle; FileName: PChar): Boolean;
-begin
-  if Module = INVALID_MODULEHANDLE_VALUE then
-    Module := LoadLibrary( FileName );
-  Result := Module <> INVALID_MODULEHANDLE_VALUE;
-end;
-
-// load the DLL file FileName
-// LoadLibraryEx is used to get better control of the loading
-// for the allowed values for flags see LoadLibraryEx documentation.
-
-function LoadModuleEx(var Module: TModuleHandle; FileName: PChar; Flags: Cardinal): Boolean;
-begin
-  if Module = INVALID_MODULEHANDLE_VALUE then
-    Module := LoadLibraryEx( FileName, 0, Flags);
-  Result := Module <> INVALID_MODULEHANDLE_VALUE;
-end;
-
-// unload a DLL loaded with LoadModule or LoadModuleEx
-// The procedure will not try to unload a handle with
-// value INVALID_MODULEHANDLE_VALUE and assigns this value
-// to Module after unload.
-
-procedure UnloadModule(var Module: TModuleHandle);
-begin
-  if Module <> INVALID_MODULEHANDLE_VALUE then
-    FreeLibrary(Module);
-  Module := INVALID_MODULEHANDLE_VALUE;
-end;
-
-// returns the pointer to the symbol named SymbolName
-// if it is exported from the DLL Module
-// nil is returned if the symbol is not available
-
-function GetModuleSymbol(Module: TModuleHandle; SymbolName: PChar): Pointer;
-begin
-  Result := nil;
-  if Module <> INVALID_MODULEHANDLE_VALUE then
-    Result := GetProcAddress(Module, SymbolName );
-end;
-
-// returns the pointer to the symbol named SymbolName
-// if it is exported from the DLL Module
-// nil is returned if the symbol is not available.
-// as an extra the boolean variable Accu is updated
-// by anding in the success of the function.
-// This is very handy for rendering a global result
-// when accessing a long list of symbols.
-
-function GetModuleSymbolEx(Module: TModuleHandle; SymbolName: PChar; var Accu: Boolean): Pointer;
-begin
-  Result := nil;
-  if Module <> INVALID_MODULEHANDLE_VALUE then
-    Result := GetProcAddress(Module, SymbolName );
-  Accu := Accu and (Result <> nil);
-end;
-
-// get the value of variables exported from a DLL Module
-// Delphi cannot access variables in a DLL directly, so
-// this function allows to copy the data from the DLL.
-// Beware! You are accessing the DLL memory image directly.
-// Be sure to access a variable not a function and be sure
-// to read the correct amount of data.
-
-function ReadModuleData(Module: TModuleHandle; SymbolName: PChar; var Buffer; Size: Cardinal): Boolean;
-var
-  Sym: Pointer;
-begin
-  Result := True;
-  Sym := GetModuleSymbolEx(Module, SymbolName, Result);
-  if Result then
-    Move(Sym^, Buffer, Size);
-end;
-
-// set the value of variables exported from a DLL Module
-// Delphi cannot access variables in a DLL directly, so
-// this function allows to copy the data to the DLL!
-// BEWARE! You are accessing the DLL memory image directly.
-// Be sure to access a variable not a function and be sure
-// to write the correct amount of data.
-// The changes are not persistent. They get lost when the
-// DLL is unloaded.
-
-function WriteModuleData(Module: TModuleHandle; SymbolName: PChar; var Buffer; Size: Cardinal): Boolean;
-var
-  Sym: Pointer;
-begin
-  Result := True;
-  Sym := GetModuleSymbolEx(Module, SymbolName, Result);
-  if Result then
-    Move(Buffer, Sym^, Size);
-end;
-
-{$ENDIF}
-
-{$IFDEF UNIX}
-uses
-{$IFDEF UNIX}
-  Types,
-  Libc;
-{$ELSE}
-  dl,
-  Types,
-  Baseunix,
-  Unix;
-{$ENDIF}
-type
-  // Handle to a loaded .so
-  TModuleHandle = Pointer;
-
-const
-  // Value designating an unassigned TModuleHandle od a failed loading
-  INVALID_MODULEHANDLE_VALUE = TModuleHandle(nil);
-
-function LoadModule(var Module: TModuleHandle; FileName: PChar): Boolean;
-function LoadModuleEx(var Module: TModuleHandle; FileName: PChar; Flags: Cardinal): Boolean;
-procedure UnloadModule(var Module: TModuleHandle);
-function GetModuleSymbol(Module: TModuleHandle; SymbolName: PChar): Pointer;
-function GetModuleSymbolEx(Module: TModuleHandle; SymbolName: PChar; var Accu: Boolean): Pointer;
-function ReadModuleData(Module: TModuleHandle; SymbolName: PChar; var Buffer; Size: Cardinal): Boolean;
-function WriteModuleData(Module: TModuleHandle; SymbolName: PChar; var Buffer; Size: Cardinal): Boolean;
-
-//----------------------------------------------
-implementation
-//----------------------------------------------
-
-// load the .so file FileName
-// the rules for FileName are those of dlopen()
-// Returns: True = success, False = failure to load
-// Assigns: the handle of the loaded .so to Module
-// Warning: if Module has any other value than INVALID_MODULEHANDLE_VALUE
-// on entry the function will do nothing but returning success.
-
-function LoadModule(var Module: TModuleHandle; FileName: PChar): Boolean;
-begin
-  if Module = INVALID_MODULEHANDLE_VALUE then
-    Module := dlopen( FileName, RTLD_NOW);
-  Result := Module <> INVALID_MODULEHANDLE_VALUE;
-end;
-
-// load the .so file FileName
-// dlopen() with flags is used to get better control of the loading
-// for the allowed values for flags see "man dlopen".
-
-function LoadModuleEx(var Module: TModuleHandle; FileName: PChar; Flags: Cardinal): Boolean;
-begin
-  if Module = INVALID_MODULEHANDLE_VALUE then
-    Module := dlopen( FileName, Flags);
-  Result := Module <> INVALID_MODULEHANDLE_VALUE;
-end;
-
-// unload a .so loaded with LoadModule or LoadModuleEx
-// The procedure will not try to unload a handle with
-// value INVALID_MODULEHANDLE_VALUE and assigns this value
-// to Module after unload.
-
-procedure UnloadModule(var Module: TModuleHandle);
-begin
-  if Module <> INVALID_MODULEHANDLE_VALUE then
-    dlclose(Module);
-  Module := INVALID_MODULEHANDLE_VALUE;
-end;
-
-// returns the pointer to the symbol named SymbolName
-// if it is exported from the .so Module
-// nil is returned if the symbol is not available
-
-function GetModuleSymbol(Module: TModuleHandle; SymbolName: PChar): Pointer;
-begin
-  Result := nil;
-  if Module <> INVALID_MODULEHANDLE_VALUE then
-    Result := dlsym(Module, SymbolName );
-end;
-
-// returns the pointer to the symbol named SymbolName
-// if it is exported from the .so Module
-// nil is returned if the symbol is not available.
-// as an extra the boolean variable Accu is updated
-// by anding in the success of the function.
-// This is very handy for rendering a global result
-// when accessing a long list of symbols.
-
-function GetModuleSymbolEx(Module: TModuleHandle; SymbolName: PChar; var Accu: Boolean): Pointer;
-begin
-  Result := nil;
-  if Module <> INVALID_MODULEHANDLE_VALUE then
-    Result := dlsym(Module, SymbolName );
-  Accu := Accu and (Result <> nil);
-end;
-
-// get the value of variables exported from a .so Module
-// Delphi cannot access variables in a .so directly, so
-// this function allows to copy the data from the .so.
-// Beware! You are accessing the .so memory image directly.
-// Be sure to access a variable not a function and be sure
-// to read the correct amount of data.
-
-function ReadModuleData(Module: TModuleHandle; SymbolName: PChar; var Buffer; Size: Cardinal): Boolean;
-var
-  Sym: Pointer;
-begin
-  Result := True;
-  Sym := GetModuleSymbolEx(Module, SymbolName, Result);
-  if Result then
-    Move(Sym^, Buffer, Size);
-end;
-
-// set the value of variables exported from a .so Module
-// Delphi cannot access variables in a .so directly, so
-// this function allows to copy the data to the .so!
-// BEWARE! You are accessing the .so memory image directly.
-// Be sure to access a variable not a function and be sure
-// to write the correct amount of data.
-// The changes are not persistent. They get lost when the
-// .so is unloaded.
-
-function WriteModuleData(Module: TModuleHandle; SymbolName: PChar; var Buffer; Size: Cardinal): Boolean;
-var
-  Sym: Pointer;
-begin
-  Result := True;
-  Sym := GetModuleSymbolEx(Module, SymbolName, Result);
-  if Result then
-    Move(Buffer, Sym^, Size);
-end;
-{$ENDIF}
-
-{$IFDEF __MACH__} // Mach definitions go here
-{$ENDIF}
-
-end.

+ 0 - 1236
Source/FMX/Physix.NGDImport.pas

@@ -1,1236 +0,0 @@
-//
-// The graphics rendering engine GLScene http://glscene.org
-//
-unit Physix.NGDImport;
-
-(* Copyright (c) <2003-2014> <Julio Jerez, Newton Game Dynamics>
-*
-* This software is provided 'as-is', without any express or implied
-* warranty. In no event will the authors be held liable for any damages
-* arising from the use of this software.
-*
-* Permission is granted to anyone to use this software for any purpose,
-* including commercial applications, and to alter it and redistribute it
-* freely, subject to the following restrictions:
-*
-* 1. The origin of this software must not be misrepresented; you must not
-* claim that you wrote the original software. If you use this software
-* in a product, an acknowledgment in the product documentation would be
-* appreciated but is not required.
-*
-* 2. Altered source versions must be plainly marked as 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 NEWTON_DOUBLE_PRECISION} 
-
-interface
-
-uses
-  System.Classes;
-
-const
-{.$DEFINE NEWTON_DOUBLE_PRECISION} // This is needed when you want to use double precision
-{$IFDEF WIN32}
-   NewtonDLL = 'newton32.dll';
-{$ENDIF}
-
-{$IFDEF WIN64}
-   NewtonDLL = 'newton64.dll';
-{$ENDIF}
-
-type
-{$IFDEF NEWTON_DOUBLE_PRECISION}
-   dFloat               = Double;
-{$ELSE}
-   dFloat               = Single;
-{$ENDIF}
-   dFloat64             = Double;
-   dLong                = Int64;
-
-   PdFloat              = ^dFloat;
-   PdFloat64            = ^dFloat64;
-   PdLong               = ^dLong;
-   Long_double          = Extended;
-
-const
- NEWTON_MAJOR_VERSION                            =  3;
- NEWTON_MINOR_VERSION                            = 15;
- NEWTON_BROADPHASE_DEFAULT                       =  0;
- NEWTON_PROFILER_WORLD_UPDATE                    =  0;
- NEWTON_DYNAMIC_BODY                             =  0;
- NEWTON_PROFILER_COLLISION_UPDATE                =  1;
- NEWTON_PROFILER_COLLISION_UPDATE_BROAD_PHASE    =  2;
- NEWTON_PROFILER_COLLISION_UPDATE_NARROW_PHASE   =  3;
- NEWTON_PROFILER_DYNAMICS_UPDATE                 =  4;
- NEWTON_PROFILER_DYNAMICS_CONSTRAINT_GRAPH       =  5;
- NEWTON_PROFILER_FORCE_CALLBACK_UPDATE           =  6;
- NEWTON_PROFILER_DYNAMICS_SOLVE_CONSTRAINT_GRAPH =  7;
-
- SERIALIZE_ID_SPHERE = 0;
- SERIALIZE_ID_CAPSULE = 1;
- SERIALIZE_ID_CYLINDER = 2;
- SERIALIZE_ID_CHAMFERCYLINDER = 3;
- SERIALIZE_ID_BOX = 4;
- SERIALIZE_ID_CONE = 5;
- SERIALIZE_ID_CONVEXHULL = 6;
- SERIALIZE_ID_NULL = 7;
- SERIALIZE_ID_COMPOUND = 8;
- SERIALIZE_ID_TREE = 9;
- SERIALIZE_ID_HEIGHTFIELD = 10;
- SERIALIZE_ID_CLOTH_PATCH = 11;
- SERIALIZE_ID_DEFORMABLE_SOLID = 12;
- SERIALIZE_ID_USERMESH = 13;
- SERIALIZE_ID_SCENE = 14;
- SERIALIZE_ID_FRACTURED_COMPOUND = 15;
-// SERIALIZE_ID_COMPOUND_BREAKABLE                 = 14;
-type
-// This C++ types for Delphi syntax to speed up the translation process and avoid bugs
-  __int8 = ShortInt;
-  __int16 = SmallInt;
-  __int32 = LongInt;
-  __int64 = Int64;
-  nchar = ShortInt;
-  unsigned_char = Byte;
-  short = SmallInt;
-  unsigned_short = Word;
-  long = LongInt;
-  unsigned_long = LongWord;
-  unsigned_int = Cardinal;
-  size_t = Cardinal;
-  charArray = array [0..255] of Char;
-
-  P__int8 = ^__int8;
-  P__int16 = ^__int16;
-  P__int32 = ^__int32;
-  P__int64 = ^__int64;
-  P2Char = ^nchar;
-  PUnsigned_char = ^unsigned_char;
-  PShort = ^short;
-  PUnsigned_short = ^unsigned_short;
-  PLong = ^long;
-  PUnsigned_long = ^unsigned_long;
-  PUnsigned_int = ^unsigned_int;
-  Psize_t = ^size_t;
-  PLong_double = ^long_double;
-  PCharArray = ^charArray;
-
-  //Pascal to C++
-  Bool = Boolean;
-
- //Pointer types
-  Pvoid = Pointer; //void pointer
-  PBool = ^Bool;
-
-  //Moved Maths related C++ Definitions to Maths3D.pas
-
-  (* Next done in order to make code complete and code parameters hint window
-  to show the actual type for ex. PNewtonWorld instead of just "Pointer",
-  thus making programming a lot easier *)
-
-(*
-#ifdef __cplusplus
-	class NewtonMesh;
-	class NewtonBody;
-	class NewtonWorld;
-	class NewtonJoint;
-	class NewtonMaterial;
-	class NewtonCollision;
-	class NewtonDeformableMeshSegment;
-	class NewtonFracturedCompoundMeshPart;
-#else
-*)
-
-  PNewtonMesh = Pointer;
-  PNewtonBody = Pointer;
-  PNewtonWorld = Pointer;
-  PNewtonJoint = Pointer;
-  PNewtonMaterial = Pointer;
-  PNewtonCollision = Pointer;
-  PNewtonDeformableMeshSegment  = Pointer;
-  PNewtonFracturedCompoundMeshPart = Pointer;
-//  PNewtonContact = Pointer;
-  PNewtonSerializeHandle = Pointer;
-  PNewtonMeshHandle = Pointer;
-  PNewtonMeshVertex = Pointer;
-  PNewtonMeshPoint = Pointer;
-  PNewtonMeshEdge = Pointer;
-  PNewtonMeshFace = Pointer;
-
-  PNewtonSceneProxy = Pointer;
-  PNewtonBreakableComponentMesh = Pointer;
-
-  PNewtonListener = Pointer;
-
-  //PNewtonRagDoll = Pointer;
-  //PNewtonRagDollBone = Pointer;
-  // NewtonCollisionInfoRecord
-
-
- TNewtonMaterialData = packed record // union
-
-	m_ptr   : Pointer;
-	m_int   : dLong;
-	m_float : dFloat;
- end;
-
-TNewtonCollisionMaterial = packed record
-  m_userId: dLong;
-  m_userData: TNewtonMaterialData;
-  m_userParam: array[0..5] of TNewtonMaterialData;
- end;
-
-
- TNewtonBoxParam = packed record
-  m_x : dFloat;
-  m_y : dFloat;
-  m_z : dFloat;
- end;
-
- TNewtonSphereParam = packed record
-  m_radio                : dFloat;
- end;
-
- TNewtonCylinderParam = packed record
-  m_radio, m_height               : dFloat;
- end;
-
- TNewtonCapsuleParam = packed record
-  m_radio, m_height               : dFloat;
- end;
-
- TNewtonConeParam = packed record
-  m_radio,
-  m_height               : dFloat;
- end;
-
- TNewtonTaperedCapsuleParam = packed record
-  m_radio0,
-  m_radio1,
-  m_height               : dFloat;
- end;
-
-
- TNewtonTaperedCylinderParam = packed record
-  m_radio0,
-  m_radio1,
-  m_height               : dFloat;
- end;
-
- TNewtonChamferCylinderParam = packed record
-  m_radio  : dFloat;
-  m_height : dFloat;
- end;
-
- TNewtonConvexHullParam = packed record
-  m_vertexCount           : integer;
-  m_vertexStrideInBytes   : integer;
-  m_faceCount             : integer;
-  m_vertex                : PdFloat;
- end;
-
-
-  TNewtonCompoundCollisionParam = packed record
-    m_chidrenCount: integer;
-
-  end;
-
-  TNewtonCollisionTreeParam = packed record
-    m_vertexCount: integer;
-    m_indexCount: integer;
-  end;
-
- TNewtonDeformableMeshParam = packed record
-  m_vertexCount           : integer;
-  m_triangleCount         : integer;
-  m_vertexStrideInBytes   : integer;
-  m_indexList             : PWord;
-  m_vertexList            : PdFloat;
- end;
-
-
-  TNewtonHeightFieldCollisionParam = packed record
-    m_width: integer;
-    m_height: integer;
-    m_gridsDiagonals: integer;
-    m_elevationDataType: integer; // 0 = 32 bit floats, 1 = unsigned 16 bit integers
-    m_verticalScale: dFloat;
-    m_horizonalScale_x: dFloat;
-    m_horizonalScale_z: dFloat;
-    m_vertialElevation: Pointer;
-    m_atributes: pchar;
-  end;
-
-  TNewtonSceneCollisionParam = packed record
-    m_childrenProxyCount: integer;
-  end;
-
-  TNewtonCollisionNullParam = packed record
-    // nothing.
-  end;
-
-  PNewtonCollisionInfoRecord = ^TNewtonCollisionInfoRecord;
-  TNewtonCollisionInfoRecord = packed record
-    m_offsetMatrix: array[0..3,0..3] of dFloat;
-	m_collisionMaterial: TNewtonCollisionMaterial;
-    m_collisionType: integer;          // tag id to identify the collision primitive
-    case Integer of
-      SERIALIZE_ID_BOX: (sdbox: TNewtonBoxParam);
-      SERIALIZE_ID_CONE: (shapedata: TNewtonConeParam);
-      SERIALIZE_ID_SPHERE: (sdSphere: TNewtonSphereParam);
-      SERIALIZE_ID_CAPSULE: (sdCapsule: TNewtonCapsuleParam);
-      SERIALIZE_ID_CYLINDER: (sdCylinder: TNewtonCylinderParam);
-      SERIALIZE_ID_CHAMFERCYLINDER: (sdChamfercylinder: TNewtonChamferCylinderParam);
-      SERIALIZE_ID_CONVEXHULL: (sdConvexhull: TNewtonConvexHullParam);
-      SERIALIZE_ID_NULL: (sdNull: TNewtonCollisionNullParam);
-      SERIALIZE_ID_COMPOUND: (sdCompound: TNewtonCompoundCollisionParam);
-      SERIALIZE_ID_TREE: (sdTree: TNewtonCollisionTreeParam);
-      SERIALIZE_ID_HEIGHTFIELD: (sdHeightfield: TNewtonHeightFieldCollisionParam);
-      SERIALIZE_ID_SCENE: (sdSceneCollision: TNewtonSceneCollisionParam);
-
-  end;
-
-
-  PNewtonJointRecord = ^NewtonJointRecord;
-  NewtonJointRecord = packed record
-    m_attachmenMatrix_0 : array[ 0..3,0..3 ] of dFloat;
-    m_attachmenMatrix_1 : array[ 0..3,0..3 ] of dFloat;
-    m_minLinearDof      : array[ 0..2 ] of dFloat;
-    m_maxLinearDof      : array[ 0..2 ] of dFloat;
-    m_minAngularDof     : array[ 0..2 ] of dFloat;
-    m_maxAngularDof     : array[ 0..2 ] of dFloat;
-    m_attachBody_0      : PNewtonBody;
-    m_attachBody_1      : PNewtonBody;
-    m_extraParameters   : array[ 0..15 ] of dFloat;
-    m_bodiesCollisionOn : integer;
-    m_descriptionType   : array[ 0..31 ] of dFloat;
-  end;
-
-
-  PNewtonUserMeshCollisionCollideDesc = ^NewtonUserMeshCollisionCollideDesc;
-  NewtonUserMeshCollisionCollideDesc = record
-    m_boxP0               : array[ 0..3 ] of dFloat; // lower bounding box of intersection query in local space
-    m_boxP1               : array[ 0..3 ] of dFloat; // upper bounding box of intersection query in local space
-    m_boxDistanceTravel	  : array[ 0..3 ] of dFloat; // max distance that box bpxP0 and boxP1 can travel on this timestep, used this for continue collision mode.
-    m_threadNumber        : integer;                     // current thread executing this query
-    m_faceCount           : integer;                     // the application should set here how many polygons intersect the query box
-    m_vertexStrideInBytes : integer;                     // the application should set here the size of each vertex
-  	m_skinThickness       : dFloat;                  // this is the minimum skin separation specified by the material between these two colliding shapes
-    m_userData            : Pointer;                 // user data passed to the collision geometry at creation time
-
-    m_objBody             : PNewtonBody;             // pointer to the colliding body
-    m_polySoupBody        : PNewtonBody;             // pointer to the rigid body owner of this collision tree
-	m_objCollision 	      : PNewtonCollision;	     // collision shape of the colliding body, (no necessarily the collision of m_objBody)
-	m_polySoupCollision   : PNewtonCollision;  	     // collision shape of the collision tree, (no necessarily the collision of m_polySoupBody)
-
-    m_vertex              : ^dFloat;                 // the application should set here the pointer to the global vertex of the mesh.
-    m_faceIndexCount      : ^integer;                    // the application should set here the pointer to the vertex count of each face.
-    m_faceVertexIndex     : ^integer;                    // the application should set here the pointer index array for each vertex on a face.
-												  // the format of a face is I0, I1, I2, I3, ..., M, N, E0, E1, E2, ..., A
-                          // I0, I1, I2, .. are the indices to the vertex, relative to m_vertex pointer
-                         	// M is the index to the material sub shape id
-													// N in the index to the vertex normal relative to m_vertex pointer
-													// E0, E1, E2, ... are the indices of the the face normal that is shared to that face edge, when the edge does not share a face normal then the edge index is set to index N, which the index to the face normal
-													// A is and estimate of the largest diagonal of the face, this used internally as a hint to improve floating point accuracy and algorithm performance.
-  end;
-
-  PNewtonWorldConvexCastReturnInfo = ^NewtonWorldConvexCastReturnInfo;
-  NewtonWorldConvexCastReturnInfo = record
-    m_point            : array[ 0..3 ] of dFloat; // collision point in global space
-    m_normal           : array[ 0..3 ] of dFloat; // surface normal at collision point in global space
-    m_normalOnHitPoint : array[ 0..3 ] of dFloat; // surface normal at the surface of the hit body,
-					         // is the same as the normal calculated by a ray cast hitting the body at the hit poi
-
-    m_contactID        : integer;                    // collision ID at contact point
-    m_hitBody          : PNewtonBody;            // body hit at contact point
-    m_penetration      : dFloat;                 // contact penetration at collision point
-  end;
-
-  PNewtonUserMeshCollisionRayHitDesc = ^NewtonUserMeshCollisionRayHitDesc;
-  NewtonUserMeshCollisionRayHitDesc = record
-    m_p0        : array[ 0..3 ] of dFloat; // ray origin in collision local space
-    m_p1        : array[ 0..3 ] of dFloat; // ray destination in collision local space
-    m_normalOut : array[ 0..3 ] of dFloat; // copy here the normal at the ray intersection
-    m_userIdOut : integer;                     // copy here a user defined id for further feedback
-    m_userData  : Pointer;                 // user data passed to the collision geometry at creation time
-  end;
-
-
-  PNewtonHingeSliderUpdateDesc = ^NewtonHingeSliderUpdateDesc;
-  NewtonHingeSliderUpdateDesc = packed record
-    m_accel       : dFloat;
-    m_minFriction : dFloat;
-    m_maxFriction : dFloat;
-    m_timestep    : dFloat;
-  end;
-
- PNewtonUserContactPoint = ^NewtonUserContactPoint;
- NewtonUserContactPoint = packed record
-  m_point                : array [0..3] of dFloat;
-  m_normal               : array [0..3] of dFloat;
-  m_shapeId0             : dLong;
-  m_shapeId1             : dLong;
-  m_penetration          : dFloat;
-  m_unused               : array [0..2] of integer;
- end;
-
- // data structure for interfacing with NewtonMesh
- PNewtonMeshDoubleData = ^NewtonMeshDoubleData;
- NewtonMeshDoubleData = packed record
-  m_data          : PdFloat64;
-  m_indexList     : ^integer;
-  m_strideInBytes : integer;
- end;
-
- PNewtonMeshFloatData = ^NewtonMeshFloatData;
- NewtonMeshFloatData = packed record
-  m_data          : PdFloat;
-  m_indexList     : ^integer;
-  m_strideInBytes : integer;
- end;
-
- PNewtonMeshVertexFormat = ^NewtonMeshVertexFormat;
- NewtonMeshVertexFormat = packed record
-  m_faceCount : integer;
-  m_faceIndexCount : ^integer;
-  m_faceMaterial : ^integer;
-  m_vertex : NewtonMeshDoubleData;
-  m_normal : NewtonMeshFloatData;
-  m_binormal : NewtonMeshFloatData;
-  m_uv0 : NewtonMeshFloatData;
-  m_uv1 : NewtonMeshFloatData;
-  m_vertexColor : NewtonMeshFloatData;
- end;
-
-  PNewtonAllocMemory = ^NewtonAllocMemory;
-  NewtonAllocMemory = function(sizeInBytes: integer): Pointer; cdecl;
-
-  PNewtonFreeMemory = ^NewtonFreeMemory;
-  NewtonFreeMemory = procedure(ptr: Pointer; sizeInBytes: integer); cdecl;
-
-  PNewtonDestroyWorld = ^NewtonDestroyWorld;
-  NewtonDestroyWorld = procedure(const NewtonWorld: PNewtonWorld); cdecl;
-
-  PNewtonGetTicksCountCallback = ^NewtonGetTicksCountCallback;
-  NewtonGetTicksCountCallback = function(): Cardinal; cdecl;
-
-  PNewtonSerialize = ^NewtonSerialize;
-  NewtonSerialize = procedure(serializeHandle: Pointer; const buffer: Pointer; size: size_t); cdecl;
-
-  PNewtonDeserialize = ^NewtonDeserialize;
-  NewtonDeserialize = procedure(serializeHandle: Pointer; buffer: Pointer; size: size_t); cdecl;
-
-  PNewtonUserMeshCollisionDestroyCallback = ^NewtonUserMeshCollisionDestroyCallback;
-  NewtonUserMeshCollisionDestroyCallback = procedure(descData: Pointer); cdecl;
-
-  PNewtonUserMeshCollisionCollideCallback = ^NewtonUserMeshCollisionCollideCallback;
-  NewtonUserMeshCollisionCollideCallback = procedure(NewtonUserMeshCollisionCollideDesc: PNewtonUserMeshCollisionCollideDesc); cdecl;
-
-  PNewtonUserMeshCollisionRayHitCallback = ^NewtonUserMeshCollisionRayHitCallback;
-  NewtonUserMeshCollisionRayHitCallback = function(NewtonUserMeshCollisionRayHitDesc: PNewtonUserMeshCollisionRayHitDesc): integer; cdecl;
-
-  PNewtonUserMeshCollisionGetCollisionInfo = ^NewtonUserMeshCollisionGetCollisionInfo;
-  NewtonUserMeshCollisionGetCollisionInfo = procedure(userData: Pointer; infoRecord: PNewtonCollisionInfoRecord); cdecl;
-
-  PNewtonUserMeshCollisionGetFacesInAABB = ^NewtonUserMeshCollisionGetFacesInAABB;
-  NewtonUserMeshCollisionGetFacesInAABB = function(userData: Pointer;
-    const p0: PdFloat; const p1: PdFloat; const vertexArray: PdFloat;
-    vertexCount: PInteger; vertexStrideInBytes: PInteger; const indexList: PInteger;
-    maxIndexCount: integer; const userDataList: PInteger): integer; cdecl;
-
-  PNewtonCollisionTreeRayCastCallback = ^NewtonCollisionTreeRayCastCallback;
-  NewtonCollisionTreeRayCastCallback = function(const Body: PNewtonBody;
-    const TreeCollision: PNewtonCollision; interception: dFloat;
-    normal: PdFloat; faceId: integer; usedData: Pointer): dFloat; cdecl;
-
-  PNewtonHeightFieldRayCastCallback = ^NewtonHeightFieldRayCastCallback;
-  NewtonHeightFieldRayCastCallback = function(const Body: PNewtonBody;
-    const HeightFieldCollision: PNewtonCollision; interception: dFloat;
-    Row, Col: integer; normal: PdFloat; faceId: integer; usedData: Pointer)
-    : dFloat; cdecl;
-
-  PNewtonTreeCollisionCallback = ^NewtonTreeCollisionCallback;
-  NewtonTreeCollisionCallback = procedure(const bodyWithTreeCollision
-    : PNewtonBody; const Body: PNewtonBody; faceId: integer; const vertex: PdFloat;
-    vertexStrideInBytes: integer); cdecl;
-
-  PNewtonBodyDestructor = ^NewtonBodyDestructor;
-  NewtonBodyDestructor = procedure(const Body: PNewtonBody); cdecl;
-
-  PNewtonApplyForceAndTorque = ^NewtonApplyForceAndTorque;
-  NewtonApplyForceAndTorque = procedure(const Body: PNewtonBody;
-    timestep: dFloat; threadIndex: integer); cdecl;
-
-  PNewtonSetTransform = ^NewtonSetTransform;
-  NewtonSetTransform = procedure(const Body: PNewtonBody; const matrix: PdFloat; threadIndex: integer); cdecl;
-
-  PNewtonIslandUpdate = ^NewtonIslandUpdate;
-  NewtonIslandUpdate = function(const World: PNewtonWorld; islandHandle: Pointer; bodyCount: integer): integer; cdecl;
-
-  PNewtonBodyLeaveWorld = ^NewtonBodyLeaveWorld;
-  NewtonBodyLeaveWorld = procedure(const Body: PNewtonBody; threadIndex: integer); cdecl;
-
-  PNewtonDestroyBodyByExeciveForce = ^NewtonDestroyBodyByExeciveForce;
-  NewtonDestroyBodyByExeciveForce = procedure(const Body: PNewtonBody; const contact: PNewtonJoint); cdecl;
-
-  PNewtonCollisionDestructor = ^NewtonCollisionDestructor;
-  NewtonCollisionDestructor = procedure(const World: PNewtonWorld; const collision: PNewtonCollision); cdecl;
-
-  PNewtonCollisionCompoundBreakableCallback = ^NewtonCollisionCompoundBreakableCallback;
-  NewtonCollisionCompoundBreakableCallback = function(const Mesh: PNewtonMesh; userData: Pointer; planeMatrixOut: PdFloat): integer; cdecl;
-
-  PNewtonGetBuoyancyPlane = ^NewtonGetBuoyancyPlane;
-  NewtonGetBuoyancyPlane = function(const collisionID: integer; context: Pointer; const globalSpaceMatrix: PdFloat; globalSpacePlane: PdFloat): integer; cdecl;
-
-  PNewtonWorldRayPrefilterCallback = ^NewtonWorldRayPrefilterCallback;
-  NewtonWorldRayPrefilterCallback = function(const Body: PNewtonBody; const collision: PNewtonCollision; userData: Pointer): Cardinal; cdecl;
-
-  PNewtonWorldRayFilterCallback = ^NewtonWorldRayFilterCallback;
-  NewtonWorldRayFilterCallback = function(const Body: PNewtonBody; const hitNormal: PdFloat; collisionID: integer; userData: Pointer; intersetParam: dFloat): dFloat; cdecl;
-
-  PNewtonOnAABBOverlap = ^NewtonOnAABBOverlap;
-  NewtonOnAABBOverlap = function(const material: PNewtonMaterial; const body0: PNewtonBody; const body1: PNewtonBody; threadIndex: integer): integer; cdecl;
-
-  PNewtonContactsProcess = ^NewtonContactsProcess;
-  NewtonContactsProcess = procedure(const contact: PNewtonJoint; timestep: dFloat; threadIndex: integer); cdecl;
-
-  PNewtonBodyIterator = ^NewtonBodyIterator;
-  NewtonBodyIterator = procedure(const Body: PNewtonBody; userData: Pointer); cdecl;
-
-  PNewtonJointIterator = ^NewtonJointIterator;
-  NewtonJointIterator = procedure(const joint: PNewtonJoint; userData: Pointer); cdecl;
-
-  PNewtonCollisionIterator = ^NewtonCollisionIterator;
-  NewtonCollisionIterator = procedure(userData: Pointer; vertexCount: integer; const FaceArray: PdFloat; faceId: integer); cdecl;
-
-  PNewtonBallCallBack = ^NewtonBallCallBack;
-  NewtonBallCallBack = procedure(const ball: PNewtonJoint; timestep: dFloat); cdecl;
-
-  PNewtonHingeCallBack = ^NewtonHingeCallBack;
-  NewtonHingeCallBack = function(const hinge: PNewtonJoint; desc: PNewtonHingeSliderUpdateDesc): unsigned_int; cdecl;
-
-  PNewtonSliderCallBack = ^NewtonSliderCallBack;
-  NewtonSliderCallBack = function(const slider: PNewtonJoint; desc: PNewtonHingeSliderUpdateDesc): unsigned_int; cdecl;
-
-  PNewtonUniversalCallBack = ^NewtonUniversalCallBack;
-  NewtonUniversalCallBack = function(const universal: PNewtonJoint; desc: PNewtonHingeSliderUpdateDesc): unsigned_int; cdecl;
-
-  PNewtonCorkscrewCallBack = ^NewtonCorkscrewCallBack;
-  NewtonCorkscrewCallBack = function(const corkscrew: PNewtonJoint; desc: PNewtonHingeSliderUpdateDesc): unsigned_int; cdecl;
-
-  PNewtonUserBilateralCallBack = ^NewtonUserBilateralCallBack;
-  NewtonUserBilateralCallBack = procedure(const userJoint: PNewtonJoint; timestep: dFloat; threadIndex: integer); cdecl;
-
-  PNewtonUserBilateralGetInfoCallBack = ^NewtonUserBilateralGetInfoCallBack;
-  NewtonUserBilateralGetInfoCallBack = procedure(const userJoint: PNewtonJoint; info: PNewtonJointRecord); cdecl;
-
-  PNewtonConstraintDestructor = ^NewtonConstraintDestructor;
-  NewtonConstraintDestructor = procedure(const me: PNewtonJoint); cdecl;
-
-
-// *****************************************************************************************************************************
-//
-// world control functions
-//
-// *****************************************************************************************************************************
-function NewtonWorldGetVersion(const NewtonWorld: PNewtonWorld): Integer; cdecl; external NewtonDLL;
-function NewtonWorldFloatSize(const NewtonWorld: PNewtonWorld): Integer; cdecl; external NewtonDLL;
-
-function NewtonCreate(malloc: NewtonAllocMemory; mfree: NewtonFreeMemory): PNewtonWorld; cdecl; external NewtonDLL;
-procedure NewtonDestroy(const NewtonWorld: PNewtonWorld); cdecl; external NewtonDLL;
-procedure NewtonDestroyAllBodies(const NewtonWorld: PNewtonWorld); cdecl; external NewtonDLL;
-
-function NewtonGetMemoryUsed(): Integer; cdecl; external NewtonDLL;
-
-procedure NewtonSetMemorySystem(malloc: NewtonAllocMemory; mfree: NewtonFreeMemory); cdecl; external NewtonDLL;
-procedure NewtonUpdate(const NewtonWorld: PNewtonWorld; timestep: dFloat); cdecl; external NewtonDLL;
-procedure NewtonInvalidateCache(const NewtonWorld: PNewtonWorld); cdecl; external NewtonDLL;
-procedure NewtonCollisionUpdate(const NewtonWorld: PNewtonWorld); cdecl; external NewtonDLL;
-
-procedure NewtonSetSolverModel(const NewtonWorld: PNewtonWorld; Model: integer); cdecl; external NewtonDLL;
-procedure NewtonSetPlatformArchitecture(const NewtonWorld: PNewtonWorld; mode: integer); cdecl; external NewtonDLL;
-
-function NewtonGetPlatformArchitecture(const NewtonWorld: PNewtonWorld; description: PCharArray): integer; cdecl; external NewtonDLL;
-
-procedure NewtonSetMultiThreadSolverOnSingleIsland(const NewtonWorld: PNewtonWorld; mode: integer); cdecl; external NewtonDLL;
-
-function NewtonGetMultiThreadSolverOnSingleIsland(const NewtonWorld: PNewtonWorld): integer; cdecl; external NewtonDLL;
-
-procedure NewtonSetPerformanceClock(const NewtonWorld: PNewtonWorld; NewtonGetTicksCountCallback: PNewtonGetTicksCountCallback); cdecl; external NewtonDLL;
-
-function NewtonReadPerformanceTicks(const NewtonWorld: PNewtonWorld; performanceEntry: Cardinal): Cardinal; cdecl; external NewtonDLL;
-function NewtonReadThreadPerformanceTicks(const NewtonWorld: PNewtonWorld; threadIndex: Cardinal): Cardinal; cdecl; external NewtonDLL;
-
-procedure NewtonWorldCriticalSectionLock(const NewtonWorld: PNewtonWorld); cdecl; external NewtonDLL;
-procedure NewtonWorldCriticalSectionUnlock(const NewtonWorld: PNewtonWorld); cdecl; external NewtonDLL;
-
-procedure NewtonSetThreadsCount(const NewtonWorld: PNewtonWorld; threads: integer); cdecl; external NewtonDLL;
-
-function NewtonGetThreadsCount(const NewtonWorld: PNewtonWorld): integer; cdecl; external NewtonDLL;
-function NewtonGetMaxThreadsCount(const NewtonWorld: PNewtonWorld): integer; cdecl; external NewtonDLL;
-
-procedure NewtonSetFrictionModel(const NewtonWorld: PNewtonWorld; Model: integer); cdecl; external NewtonDLL;
-
-procedure NewtonSetMinimumFrameRate(const NewtonWorld: PNewtonWorld; frameRate: dFloat); cdecl; external NewtonDLL;
-procedure NewtonSetBodyLeaveWorldEvent(const NewtonWorld: PNewtonWorld; callback: PNewtonBodyLeaveWorld); cdecl; external NewtonDLL;
-procedure NewtonSetWorldSize(const NewtonWorld: PNewtonWorld; const minPoint: PdFloat; const maxPoint: PdFloat); cdecl; external NewtonDLL;
-
-procedure NewtonSetIslandUpdateEvent(const NewtonWorld: PNewtonWorld; NewtonIslandUpdate: PNewtonIslandUpdate); cdecl; external NewtonDLL;
-
-procedure NewtonSetCollisionDestructor(const NewtonWorld: PNewtonWorld; callback: PNewtonCollisionDestructor); cdecl; external NewtonDLL;
-
-procedure NewtonSetDestroyBodyByExeciveForce(const NewtonWorld: PNewtonWorld; callback: PNewtonDestroyBodyByExeciveForce); cdecl; external NewtonDLL;
-
-procedure NewtonWorldForEachJointDo(const NewtonWorld: PNewtonWorld; callback: PNewtonJointIterator; userData: Pointer); cdecl; external NewtonDLL;
-
-procedure NewtonWorldForEachBodyInAABBDo(const NewtonWorld: PNewtonWorld; const p0: PdFloat; const p1: PdFloat; callback: PNewtonBodyIterator; userData: Pointer); cdecl; external NewtonDLL;
-
-procedure NewtonWorldSetUserData(const NewtonWorld: PNewtonWorld; userData: Pointer); cdecl; external NewtonDLL;
-function NewtonWorldGetUserData(const NewtonWorld: PNewtonWorld): Pointer; cdecl; external NewtonDLL;
-
-procedure NewtonWorldSetDestructorCallBack(const NewtonWorld: PNewtonWorld; NewtonDestroyWorld: PNewtonDestroyWorld); cdecl; external NewtonDLL;
-function NewtonWorldGetDestructorCallBack(const NewtonWorld: PNewtonWorld): PNewtonDestroyWorld; cdecl; external NewtonDLL;
-
-procedure NewtonWorldRayCast(const newtonWorld: PNewtonWorld; const p0: PdFloat; const p1: PdFloat;
-                             filter: PNewtonWorldRayFilterCallback; userData: Pointer;
-                             prefilter: NewtonWorldRayPrefilterCallback); cdecl; external NewtonDLL;
-
-function NewtonWorldConvexCast(const newtonWorld: PNewtonWorld; const matrix: PdFloat; const target: PdFloat;
-                               const shape: PNewtonCollision; hitParam: PdFloat; userData: Pointer;
-                               prefilter: NewtonWorldRayPrefilterCallback; info: PNewtonWorldConvexCastReturnInfo;
-                               maxContactsCount: integer; threadIndex: integer): Integer; cdecl; external NewtonDLL;
-
-function NewtonWorldGetBodyCount(const NewtonWorld: PNewtonWorld): integer; cdecl; external NewtonDLL;
-
-function NewtonWorldGetConstraintCount(const NewtonWorld: PNewtonWorld): integer; cdecl; external NewtonDLL;
-
-
-// *****************************************************************************************************************************
-//
-// Simulation islands
-//
-// *****************************************************************************************************************************
-
-function NewtonIslandGetBody(const island: Pointer; bodyIndex: integer): PNewtonBody; cdecl; external NewtonDLL;
-
-procedure NewtonIslandGetBodyAABB(const island: Pointer; bodyIndex: integer; p0: PdFloat; p1: PdFloat); cdecl; external NewtonDLL;
-
-// *****************************************************************************************************************************
-//
-//  Physics Material Section
-//
-// *****************************************************************************************************************************
-function NewtonMaterialCreateGroupID(const NewtonWorld: PNewtonWorld): integer; cdecl; external NewtonDLL;
-function NewtonMaterialGetDefaultGroupID(const NewtonWorld: PNewtonWorld): integer; cdecl; external NewtonDLL;
-procedure NewtonMaterialDestroyAllGroupID(const NewtonWorld: PNewtonWorld); cdecl; external NewtonDLL;
-
-// material definitions that can not be overwritten in function callback
-function NewtonMaterialGetUserData(const NewtonWorld: PNewtonWorld; id0: integer; id1: integer): Pointer; cdecl; external NewtonDLL;
-procedure NewtonMaterialSetSurfaceThickness(const NewtonWorld: PNewtonWorld; id0: integer; id1: integer; thickness: dFloat); cdecl; external NewtonDLL;
-
-//	deprecated, not longer continue collision is set on the material
-procedure NewtonMaterialSetContinuousCollisionMode(const NewtonWorld: PNewtonWOrld; id0, id1, state: Integer); cdecl; external NewtonDLL;
-
-///procedure NewtonMaterialSetCompoundCollisionCallback(const NewtonWorld: PNewtonWOrld; id0, id1: integer; compoundAabbOverlap: PNewtonOnCompoundSubCollisionAABBOverlap);
-procedure NewtonMaterialSetCollisionCallback(const NewtonWorld: PNewtonWorld; id0: integer; id1: integer; userData: Pointer; AABBOverlap: PNewtonOnAABBOverlap; process: PNewtonContactsProcess); cdecl; external NewtonDLL;
-
-procedure NewtonMaterialSetDefaultSoftness(const NewtonWorld: PNewtonWorld; id0: integer; id1: integer; value: dFloat); cdecl; external NewtonDLL;
-procedure NewtonMaterialSetDefaultElasticity(const NewtonWorld: PNewtonWorld; id0: integer; id1: integer; elasticCoef: dFloat); cdecl; external NewtonDLL;
-procedure NewtonMaterialSetDefaultCollidable(const NewtonWorld: PNewtonWorld; id0: integer; id1: integer; state: integer); cdecl; external NewtonDLL;
-procedure NewtonMaterialSetDefaultFriction(const NewtonWorld: PNewtonWorld; id0: integer; id1: integer; staticFriction: dFloat; kineticFriction: dFloat); cdecl; external NewtonDLL;
-
-
-function NewtonWorldGetFirstMaterial(const NewtonWorld: PNewtonWorld): PNewtonMaterial; cdecl; external NewtonDLL;
-
-function NewtonWorldGetNextMaterial(const NewtonWorld: PNewtonWorld; const material: PNewtonMaterial): PNewtonMaterial; cdecl; external NewtonDLL;
-
-function NewtonWorldGetFirstBody(const NewtonWorld: PNewtonWorld): PNewtonBody; cdecl; external NewtonDLL;
-
-function NewtonWorldGetNextBody(const NewtonWorld: PNewtonWorld; const curBody: PNewtonBody): PNewtonBody; cdecl; external NewtonDLL;
-
-// *****************************************************************************************************************************
-//
-// Physics Contact control functions
-//
-// *****************************************************************************************************************************
-function NewtonMaterialGetMaterialPairUserData(const material: PNewtonMaterial): Pointer; cdecl; external NewtonDLL;
-function NewtonMaterialGetContactFaceAttribute(const material: PNewtonMaterial): Unsigned_int; cdecl; external NewtonDLL;
-function NewtonMaterialGetBodyCollidingShape(const material: PNewtonMaterial; const Body: PNewtonBody): PNewtonCollision; external NewtonDLL;
-function NewtonMaterialGetBodyCollisionID(const material: PNewtonMaterial; body: PNewtonBody): Unsigned_int; cdecl; external NewtonDLL;
-
-function NewtonMaterialGetContactNormalSpeed(const material: PNewtonMaterial): dFloat; cdecl; external NewtonDLL;
-procedure NewtonMaterialGetContactForce(const material: PNewtonMaterial; const Body: PNewtonBody; Force: PdFloat); cdecl; external NewtonDLL;
-procedure NewtonMaterialGetContactPositionAndNormal(const material: PNewtonMaterial; const Body: PNewtonBody; const Posit, normal: PdFloat); cdecl; external NewtonDLL;
-procedure NewtonMaterialGetContactTangentDirections(const material: PNewtonMaterial; const Body: PNewtonBody; const Dir0, Dir1: PdFloat); cdecl; external NewtonDLL;
-
-function NewtonMaterialGetContactTangentSpeed(const material: PNewtonMaterial;index: Integer): dFloat; cdecl; external NewtonDLL;
-
-procedure NewtonMaterialSetContactSoftness(const material: PNewtonMaterial; softness: dFloat); cdecl; external NewtonDLL;
-procedure NewtonMaterialSetContactElasticity(const material: PNewtonMaterial; restitution: dFloat); cdecl; external NewtonDLL;
-procedure NewtonMaterialSetContactFrictionState(const material: PNewtonMaterial; state: Integer; index: Integer); cdecl; external NewtonDLL;
-procedure NewtonMaterialSetContactFrictionCoef(const material: PNewtonMaterial; staticFrictionCoef, kineticFrictionCoef: dFloat; index: Integer); cdecl; external NewtonDLL;
-
-procedure NewtonMaterialSetContactNormalAcceleration(const material: PNewtonMaterial; accel: dFloat); cdecl; external NewtonDLL;
-procedure NewtonMaterialSetContactNormalDirection(const material: PNewtonMaterial; directionVector: PdFloat); cdecl; external NewtonDLL;
-
-procedure NewtonMaterialSetContactTangentAcceleration(const material: PNewtonMaterial; accel: dFloat; index: Integer); cdecl; external NewtonDLL;
-procedure NewtonMaterialContactRotateTangentDirections(const material: PNewtonMaterial; const directionVector: PdFloat); cdecl; external NewtonDLL;
-
-
-// **********************************************************************************************
-//
-// convex collision primitives creation functions
-//
-// **********************************************************************************************
-function NewtonCreateNull(const NewtonWorld: PNewtonWorld): PNewtonCollision; cdecl; external NewtonDLL;
-function NewtonCreateSphere(const NewtonWorld: PNewtonWorld; radiusX, radiusY, radiusZ: dFloat; shapeID: Integer; const offsetMatrix: PdFloat): PNewtonCollision; cdecl; external NewtonDLL;
-function NewtonCreateBox(const NewtonWorld: PNewtonWorld; dx: dFloat; dy: dFloat; dz: dFloat; shapeID: Integer; const offsetMatrix: PdFloat): PNewtonCollision; cdecl; external NewtonDLL;
-function NewtonCreateCone(const NewtonWorld: PNewtonWorld; radius: dFloat; height: dFloat; shapeID: Integer; const offsetMatrix: PdFloat): PNewtonCollision; cdecl; external NewtonDLL;
-function NewtonCreateCapsule(const NewtonWorld: PNewtonWorld; radius: dFloat; height: dFloat; shapeID: Integer; const offsetMatrix: PdFloat): PNewtonCollision; cdecl; external NewtonDLL;
-function NewtonCreateCylinder(const NewtonWorld: PNewtonWorld; radius: dFloat; height: dFloat; shapeID: Integer; const offsetMatrix: PdFloat): PNewtonCollision; cdecl; external NewtonDLL;
-function NewtonCreateChamferCylinder(const NewtonWorld: PNewtonWorld; raduis: dFloat; height: dFloat; shapeID: Integer; const offsetMatrix: PdFloat): PNewtonCollision; cdecl; external NewtonDLL;
-function NewtonCreateConvexHull(const NewtonWorld: PNewtonWorld; count: Integer; const vertexCloud: PdFloat; strideInBytes: Integer; tolerance: dFloat; shapeID: Integer; const offsetMatrix: PdFloat): PNewtonCollision; cdecl; external NewtonDLL;
-function NewtonCreateConvexHullFromMesh(const NewtonWorld: PNewtonWorld; ìesh: PNewtonMesh; tolerance: dFloat; shapeID: Integer): PNewtonCollision; cdecl; external NewtonDLL;
-
-function NewtonCreateConvexHullModifier(const NewtonWorld: PNewtonWorld; const convexHullCollision: PNewtonCollision; shapeID: Integer): PNewtonCollision; cdecl; external NewtonDLL;
-procedure NewtonConvexHullModifierGetMatrix(const convexHullCollision: PNewtonCollision; matrix: PdFloat); cdecl; external NewtonDLL;
-procedure NewtonConvexHullModifierSetMatrix(const convexHullCollision: PNewtonCollision; const matrix: PdFloat); cdecl; external NewtonDLL;
-
-function NewtonCollisionIsTriggerVolume(const convexCollision: PNewtonCollision): Integer; cdecl; external NewtonDLL;
-procedure NewtonCollisionSetAsTriggerVolume(const convexCollision: PNewtonCollision; trigger: Integer); cdecl; external NewtonDLL;
-
-procedure NewtonCollisionSetMaxBreakImpactImpulse(const convexHullCollision: PNewtonCollision; maxImpactImpulse: dFloat); cdecl; external NewtonDLL;
-function NewtonCollisionGetMaxBreakImpactImpulse(const convexHullCollision: PNewtonCollision): dFloat; cdecl; external NewtonDLL;
-
-procedure NewtonCollisionSetUserID(const convexCollision: PNewtonCollision; id: Unsigned_int); cdecl; external NewtonDLL;
-function NewtonCollisionGetUserID(const convexCollision: PNewtonCollision): Unsigned_int; cdecl; external NewtonDLL;
-
-function NewtonConvexHullGetFaceIndices(const convexHullCollision: PNewtonCollision; face: Integer; faceIndices: PInteger): Integer; cdecl; external NewtonDLL;
-function NewtonConvexCollisionCalculateVolume(const convexCollision: PNewtonCollision): dFloat; cdecl; external NewtonDLL;
-procedure NewtonConvexCollisionCalculateInertialMatrix(const convexCollision: PNewtonCollision; inertia, origin: PdFloat); cdecl; external NewtonDLL;
-
-procedure NewtonCollisionMakeUnique(const NewtonWorld: PNewtonWorld; const collision: PNewtonCollision); cdecl; external NewtonDLL;
-procedure NewtonReleaseCollision(const NewtonWorld: PNewtonWorld; const collision: PNewtonCollision); cdecl; external NewtonDLL;
-function NewtonAddCollisionReference(const collision: PNewtonCollision): Integer; cdecl; external NewtonDLL;
-
-// **********************************************************************************************
-//
-// complex collision primitives creation functions
-// note: can only be used with static bodies (bodies with infinite mass)
-//
-// **********************************************************************************************
-type
-  TCollisionPrimitiveArray = array of PNewtonCollision;
-
-function NewtonCreateCompoundCollision( const newtonWorld : PNewtonWorld; count : integer;
-                                        const collisionPrimitiveArray : TcollisionPrimitiveArray; shapeID : Integer) : PNewtonCollision;            cdecl; external{$IFDEF __GPC__}name 'NewtonCreateCompoundCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function NewtonCreateCompoundCollisionFromMesh( const newtonWorld : PNewtonWorld; const mesh : PNewtonMesh; maxSubShapesCount : integer;
-                                                shapeID : Integer; subShapeID : integer ) : PNewtonCollision;                                            cdecl; external{$IFDEF __GPC__}name 'NewtonCreateCompoundCollisionFromMesh'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function NewtonCreateUserMeshCollision( const newtonWorld : PNewtonWorld; const minBox : PdFloat;
-                                        const maxBox : PdFloat; userData : Pointer; collideCallback : NewtonUserMeshCollisionCollideCallback;
-                                        rayHitCallback : NewtonUserMeshCollisionRayHitCallback;
-                                        destroyCallback : NewtonUserMeshCollisionDestroyCallback;
-                                        getInfoCallback : NewtonUserMeshCollisionGetCollisionInfo;
-                                        facesInAABBCallback : NewtonUserMeshCollisionGetFacesInAABB; shapeID : Integer) : PNewtonCollision;         cdecl; external{$IFDEF __GPC__}name 'NewtonCreateUserMeshCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-
-
-
-function NewtonCreateSceneCollision(const NewtonWorld: PNewtonWorld; shapeID: Integer): PNewtonCollision; cdecl; external NewtonDLL;
-function NewtonSceneCollisionCreateProxy(scene: PNewtonCollision; collision: PNewtonCollision): PNewtonSceneProxy; cdecl; external NewtonDLL;
-procedure NewtonSceneCollisionDestroyProxy(scene: PNewtonCollision; Proxy: PNewtonSceneProxy); cdecl; external NewtonDLL;
-procedure NewtonSceneProxySetMatrix(Proxy: PNewtonSceneProxy; const matrix: PdFloat); cdecl; external NewtonDLL;
-procedure NewtonSceneProxyGetMatrix(Proxy: PNewtonSceneProxy; matrix: PdFloat); cdecl; external NewtonDLL;
-procedure NewtonSceneSetProxyUserData(const Proxy: PNewtonSceneProxy; userData: Pointer); cdecl; external NewtonDLL;
-function NewtonSceneGetProxyUserData(const Proxy: PNewtonSceneProxy): Pointer; cdecl; external NewtonDLL;
-function NewtonSceneGetFirstProxy(const scene: PNewtonCollision): PNewtonSceneProxy; cdecl; external NewtonDLL;
-function NewtonSceneGetNextProxy(const scene: PNewtonCollision; const Proxy: PNewtonSceneProxy): PNewtonSceneProxy; cdecl; external NewtonDLL;
-
-procedure NewtonSceneCollisionOptimize( scene : PNewtonCollision );                                                                              cdecl; external NewtonDLL;
-
-
-// **********************************************************************************************
-//
-// Fractured compound collision primitives interface
-//
-// **********************************************************************************************
-function NewtonCreateCompoundBreakable( const NewtonWorld : PNewtonWorld; meshCount : integer; const SolidsArray : PNewtonMesh; const ShapeIDArray : PInteger; Densities : PdFloat; internalFaceMaterial : PInteger; ShapeID : Integer; debrisID : Integer; DebrisSeparationGap : dFloat ) : PNewtonCollision; cdecl; external{$IFDEF __GPC__}name 'NewtonCreateCompoundBreakable'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonCompoundBreakableResetAnchoredPieces( const compoundBreakable : PNewtonCollision );                                                                                                                                                                                      cdecl; external{$IFDEF __GPC__}name 'NewtonCompoundBreakableResetAnchoredPieces'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonCompoundBreakableSetAnchoredPieces( const compoundBreakable : PNewtonCollision; fixshapesCount : Integer; matrixPallete : PdFloat; fixedShapesArray : PNewtonCollision );                                                                                                     cdecl; external{$IFDEF __GPC__}name 'NewtonCompoundBreakableSetAnchoredPieces'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonCompoundBreakableGetVertexCount( const compoundBreakable : PNewtonCollision ) : Integer;                                                                                                                                                                                     cdecl; external{$IFDEF __GPC__}name 'NewtonCompoundBreakableGetVertexCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonCompoundBreakableGetVertexStreams( const compoundBreakable : PNewtonCollision; vertexStrideInByte : Integer; Vertex : PdFloat; normalStrideInByte : Integer; normal : PdFloat; uvStrideInByte : Integer; uv : PdFloat );                                                                cdecl; external{$IFDEF __GPC__}name 'NewtonCompoundBreakableGetVertexStreams'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonBreakableGetMainMesh( const compoundBreakable : PNewtonCollision ) : PNewtonBreakableComponentMesh;                                                                                                                                                                      cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableGetMainMesh'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonBreakableGetFirstComponent( const compoundBreakable : PNewtonCollision ) : PNewtonBreakableComponentMesh;                                                                                                                                                                cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableGetFirstComponent'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonBreakableGetNextComponent( const component : PNewtonBreakableComponentMesh ) : PNewtonBreakableComponentMesh;                                                                                                                                                            cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableGetNextComponent'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonBreakableBeginDelete( const compoundBreakable : PNewtonCollision );                                                                                                                                                                                                      cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableBeginDelete'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonBreakableCreateDebrieBody( const compoundBreakable : PNewtonCollision; const component : PNewtonBreakableComponentMesh ) : PNewtonBody;                                                                                                                                  cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableCreateDebrieBody'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBreakableDeleteComponent( const compoundBreakable : PNewtonCollision; const component : PNewtonBreakableComponentMesh );                                                                                                                                                 cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableDeleteComponent'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBreakableEndDelete( const compoundBreakable : PNewtonCollision );                                                                                                                                                                                                        cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableBeginDelete'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonBreakableGetComponentsInRadius( const compoundBreakable : PNewtonCollision; const position : PdFloat; radius : dFloat; Segments : PNewtonBreakableComponentMesh; maxCount : Integer) : Integer;                                                                                   cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableGetComponentsInRadius'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonBreakableGetFirstSegment( const BreakableComponent : PNewtonBreakableComponentMesh ) : Pointer;                                                                                                                                                                          cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableGetFirstSegment'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonBreakableGetNextSegment( const Segment : Pointer ) : Pointer;                                                                                                                                                                                                            cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableGetNextSegment'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonBreakableSegmentGetMaterial( const Segment : Pointer ) : Integer;                                                                                                                                                                                                            cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableSegmentGetMaterial'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonBreakableSegmentGetIndexCount( const Segment : Pointer ) : Integer;                                                                                                                                                                                                          cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableSegmentGetIndexCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonBreakableSegmentGetIndexStream( CompoundBreakable : PNewtonCollision; const MeshOwner : PNewtonBreakableComponentMesh; const Segment : Pointer; Index : PInteger) : Integer;                                                                                                    cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableSegmentGetIndexStream'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonBreakableSegmentGetIndexStreamShort( CompoundBreakable : PNewtonCollision; const MeshOwner : PNewtonBreakableComponentMesh; const Segment : Pointer; Index : PShort ) : Integer;                                                                                             cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableSegmentGetIndexStreamShort'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-
-//  ***********************************************************************************************************
-//
-//	Collision serialization functions
-//
-	// ***********************************************************************************************************
-
-function NewtonCreateCollisionFromSerialization( const newtonWorld : PNewtonWorld; deserializeFunction : PNewtonDeserialize; serializeHandle : Pointer ) : PNewtonCollision; cdecl; external{$IFDEF __GPC__}name 'NewtonCreateCollisionFromSerialization'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-//  ***********************************************************************************************************
-//
-//	Collision serialization functions
-//
-// ***********************************************************************************************************
-procedure NewtonCollisionSerialize( const newtonWorld : PNewtonWorld; const collision : PNewtonCollision; serializeFunction : PNewtonSerialize; serializeHandle : Pointer ); cdecl; external{$IFDEF __GPC__}name 'NewtonCollisionSerialize'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonCollisionGetInfo( const collision : PNewtonCollision; collisionInfo : PNewtonCollisionInfoRecord); cdecl; external{$IFDEF __GPC__}name 'NewtonCollisionGetInfo'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-// **********************************************************************************************
-//
-// Static collision shapes functions
-//
-// **********************************************************************************************
-function  NewtonCreateHeightFieldCollision( const newtonWorld : PNewtonWorld; width, height, gridDiagonals : integer; elevationMap : PUnsigned_short; attributeMap : P2Char; horizontalScale,verticalScale : dFloat; shapeID : Integer) : PNewtonCollision; cdecl; external{$IFDEF __GPC__}name 'NewtonCreateHeightFieldCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonHeightFieldSetUserRayCastCallback (const TreeCollision : PNewtonCollision; RayHitCallBack : PNewtonHeightFieldRayCastCallback); cdecl; external{$IFDEF __GPC__}name 'NewtonHeightFieldSetUserRayCastCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonCreateTreeCollision( const newtonWorld : PNewtonWorld; shapeID : Integer) : PNewtonCollision; cdecl; external NewtonDLL;
-function  NewtonCreateTreeCollisionFromMesh (const newtonWorld : PNewtonWorld; const mesh: PNewtonMesh; shapeID: integer) : PNewtonCollision; cdecl; external NewtonDLL;
-procedure NewtonTreeCollisionSetUserRayCastCallback( const treeCollision : PNewtonCollision; rayHitCallback : PNewtonCollisionTreeRayCastCallback ); cdecl; external NewtonDLL;
-
-procedure NewtonTreeCollisionBeginBuild( const treeCollision : PNewtonCollision ); cdecl; external NewtonDLL;
-procedure NewtonTreeCollisionAddFace( const treeCollision : PNewtonCollision; vertexCount : integer; const vertexPtr : PdFloat;
-                                      strideInBytes : integer; faceAttribute : integer ); cdecl; external NewtonDLL;
-procedure NewtonTreeCollisionEndBuild( const treeCollision : PNewtonCollision; optimize : integer ); cdecl; external NewtonDLL;
-
-function  NewtonTreeCollisionGetFaceAtribute( const treeCollision : PNewtonCollision; const faceIndexArray : Pinteger): integer; cdecl; external NewtonDLL;
-procedure NewtonTreeCollisionSetFaceAtribute( const treeCollision : PNewtonCollision; const faceIndexArray : Pinteger;
-                                              attribute : integer ); cdecl; external{$IFDEF __GPC__}name 'NewtonTreeCollisionSetFaceAtribute'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonTreeCollisionGetVertexListIndexListInAABB( const treeCollision : PNewtonCollision; const p0, p1 : PdFloat; const vertexArray : PdFloat; vertexCount,vertexStrideInBytes : PInteger; const indexList : PInteger; maxIndexCount : Integer; const faceAttribute : PInteger): integer; cdecl; external NewtonDLL;
-
-
-procedure NewtonStaticCollisionSetDebugCallback( const staticCollision : PNewtonCollision; userCallback : PNewtonTreeCollisionCallback ); cdecl; external{$IFDEF __GPC__}name 'NewtonStaticCollisionSetDebugCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-
-// *****************************************************************************************************************************
-//
-// General purpose collision library functions
-//
-// *****************************************************************************************************************************
-
-function  NewtonCollisionPointDistance (const newtonWorld : PNewtonWorld; const point : PdFloat;
-		                                    const collision : PNewtonCollision; const matrix : PdFloat;	contact : PdFloat;
-                                        normal : PdFloat; threadIndex : integer) : Integer;                                                               cdecl; external{$IFDEF __GPC__}name 'NewtonCollisionPointDistance'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-	// for the end user
-function  NewtonCollisionClosestPoint (const newtonWorld : PNewtonWorld; const collsionA : PNewtonCollision;
-                                       const matrixA : PdFloat; const collisionB : PNewtonCollision; const matrixB : PdFloat;
-		                                   contactA, contactB, normalAB : PdFloat; threadIndex : integer) : Integer;                                          cdecl; external{$IFDEF __GPC__}name 'NewtonCollisionClosestPoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonCollisionCollide (const newtonWorld : PNewtonWorld; maxSize : Integer; const collsionA : PNewtonCollision;
-                                  const matrixA : PdFloat; const collisionB : PNewtonCollision; const matrixB : PdFloat;
-                                  contacts, normals, penetration : PdFloat; threadIndex : integer) : Integer;                                             cdecl; external{$IFDEF __GPC__}name 'NewtonCollisionCollide'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function NewtonCollisionCollideContinue(const newtonWorld : PNewtonWorld; maxSize : Integer; const timestep : dFloat;
-		                                    const collsionA : PNewtonCollision; const matrixA : PdFloat; const velocA : PdFloat; const omegaA : dFloat;
-		                                    const collsionB : PNewtonCollision; const matrixB : PdFloat; const velocB : PdFloat; const omegaB : dFloat;
-		                                    timeOfImpact : PdFloat; contacts : PdFloat; normals : PdFloat;
-                                        penetration : PdFloat; threadIndex : integer) : Integer;                                                          cdecl; external{$IFDEF __GPC__}name 'NewtonCollisionCollideContinue'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonCollisionSupportVertex( const collision : PNewtonCollision; const dir : PdFloat; vertex : PdFloat);                                cdecl; external{$IFDEF __GPC__}name 'NewtonCollisionSupportVertex'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonCollisionRayCast(const collision : PNewtonCollision; const p0: PdFloat; const p1: PdFloat;
-                                 normals: PdFloat; attribute: PInteger): dFloat;                                                                       cdecl; external NewtonDLL;
-procedure NewtonCollisionCalculateAABB( const collision : PNewtonCollision; const matrix : PdFloat; p0 : PdFloat; p1 : PdFloat );                   cdecl; external NewtonDLL;
-
-procedure NewtonCollisionForEachPolygonDo (const collision : PNewtonCollision; const matrix : PdFloat; callback : NewtonCollisionIterator;
-	// **********************************************************************************************
-	//
-	// collision aggregates, are a collision node on eh broad phase the serve as the root nod for a collection of rigid bodies
-	// that shared the property of being in close proximity all the time, they are similar to compound collision by the group bodies instead of collision instances
-	// These are good for speeding calculation calculation of rag doll, Vehicles or contractions of rigid bodied lined by joints.
-	// also for example if you know that many the life time of a group of bodies like the object on a house of a building will be localize to the confide of the building
-	// then warping the bodies under an aggregate will reduce collision calculation of almost an order of magnitude.
-	//
-	// **********************************************************************************************
-                                           UserData : Pointer);                                                                                  cdecl; external{$IFDEF __GPC__}name 'NewtonCollisionForEachPolygonDo'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-
-// *****************************************************************************************************************************
-//
-// transforms utility functions
-//
-// *****************************************************************************************************************************
-procedure NewtonSetEulerAngle( const eulersAngles : PdFloat; matrix : PdFloat );                                                                   cdecl; external{$IFDEF __GPC__}name 'NewtonSetEulerAngle'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonGetEulerAngle( const matrix : PdFloat; eulersAngles : PdFloat );                                                                   cdecl; external{$IFDEF __GPC__}name 'NewtonGetEulerAngle'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonCalculateSpringDamperAcceleration(dt, ks, x, kd, s : dFloat): dFloat;                                                              cdecl; external{$IFDEF __GPC__}name 'NewtonCalculateSpringDamperAcceleration'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-// *****************************************************************************************************************************
-//
-// body manipulation functions
-//
-// *****************************************************************************************************************************
-function  NewtonCreateBody( const newtonWorld : PNewtonWorld; const collision : PNewtonCollision; const Matrix : PdFloat) : PNewtonBody;          cdecl; external{$IFDEF __GPC__}name 'NewtonCreateBody'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonDestroyBody( const newtonWorld : PNewtonWorld; const body : PNewtonBody );                                                       cdecl; external{$IFDEF __GPC__}name 'NewtonDestroyBody'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonBodyAddForce( const body : PNewtonBody; const force : PdFloat );                                                                  cdecl; external{$IFDEF __GPC__}name 'NewtonBodyAddForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodyAddTorque( const body : PNewtonBody; const torque : PdFloat );                                                                cdecl; external{$IFDEF __GPC__}name 'NewtonBodyAddTorque'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonBodyCalculateInverseDynamicsForce(const body : PNewtonBody; timestep : dFloat; const desiredVeloc : PdFloat; forceOut : PdFloat );  cdecl; external{$IFDEF __GPC__}name 'NewtonBodyCalculateInverseDynamicsForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonBodySetMatrix( const body : PNewtonBody; const matrix : PdFloat );                                                                cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetMatrix'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodySetMatrixRecursive( const body : PNewtonBody; const matrix : PdFloat );                                                       cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetMatrixRecursive'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodySetMassMatrix( const body : PNewtonBody; mass : dFloat; Ixx : dFloat; Iyy : dFloat; Izz : dFloat );                              cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetMassMatrix'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodySetMaterialGroupID( const body : PNewtonBody; id : integer );                                                                    cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetMaterialGroupID'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodySetContinuousCollisionMode(const body : PNewtonbody; state : integer);                                                           cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetContinuousCollisionMode'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodySetJointRecursiveCollision( const body : PNewtonBody; state : unsigned_int );                                                cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetJointRecursiveCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodySetOmega( const body : PNewtonBody; const omega : PdFloat );                                                                  cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetOmega'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodySetVelocity( const body : PNewtonBody; const velocity : PdFloat );                                                            cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetVelocity'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodySetForce( const body : PNewtonBody; const force : PdFloat );                                                                  cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodySetTorque( const body : PNewtonBody; const torque : PdFloat );                                                                cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetTorque'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonBodySetCentreOfMass(const body : PNewtonBody; const com : PdFloat);                                                               cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetCentreOfMass'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodySetLinearDamping( const body : PNewtonBody; linearDamp : dFloat );                                                            cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetLinearDamping'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodySetAngularDamping( const body : PNewtonBody; const angularDamp : PdFloat );                                                   cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetAngularDamping'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodySetUserData( const body : PNewtonBody; userData : Pointer );                                                                 cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetUserData'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonBodySetCollision( const body : PNewtonBody; const collision : PNewtonCollision );                                                cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonBodyGetSleepState( const body : PNewtonBody) : Integer;                                                                              cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetSleepState'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonBodyGetAutoSleep( const body : PNewtonBody) : Integer;                                                                               cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetAutoSleep'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonBodySetAutoSleep( const body : PNewtonBody; state : integer );                                                                       cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetAutoSleep'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonBodyGetFreezeState( const body : PNewtonBody) : Integer;                                                                             cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetFreezeState'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonBodySetFreezeState( const body : PNewtonBody; state : integer );                                                                     cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetFreezeState'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonBodySetDestructorCallback( const body : PNewtonBody; callback : NewtonBodyDestructor );                                          cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetDestructorCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonBodySetTransformCallback( const body : PNewtonBody; callback : NewtonSetTransform );                                             cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetTransformCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function NewtonBodyGetTransformCallback( const body : PNewtonBody ): NewtonSetTransform;                                                         cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetForceAndTorqueCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonBodySetForceAndTorqueCallback( const body : PNewtonBody; callback : NewtonApplyForceAndTorque );                                 cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetForceAndTorqueCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function NewtonBodyGetForceAndTorqueCallback( const body : PNewtonBody ): NewtonApplyForceAndTorque;                                             cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetForceAndTorqueCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonBodyGetUserData( const body : PNewtonBody ) : Pointer;                                                                           cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetUserData'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonBodyGetWorld( const body : PNewtonBody) : PNewtonWorld;                                                                          cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetWorld'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonBodyGetCollision( const body : PNewtonBody ) : PNewtonCollision;                                                                 cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonBodyGetMaterialGroupID( const body : PNewtonBody ) : Integer;                                                                        cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetMaterialGroupID'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonBodyGetContinuousCollisionMode( const body : PNewtonBody ) : Integer;                                                                cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetContinuousCollisionMode'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonBodyGetJointRecursiveCollision( const body : PNewtonBody ) : Integer;                                                                cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetJointRecursiveCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonBodyGetMatrix( const body : PNewtonBody; matrix : PdFloat );                                                                      cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetMatrix'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonBodyGetRotation( const body : PNewtonBody; rotation : PdFloat );                                                                  cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetRotation'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodyGetMassMatrix( const body : PNewtonBody; mass : PdFloat; Ixx : PdFloat; Iyy : PdFloat; Izz : PdFloat );                          cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetMassMatrix'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodyGetInvMass( const body : PNewtonBody; invMass : PdFloat; invIxx : PdFloat; invIyy : PdFloat; invIzz : PdFloat );                 cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetInvMass'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodyGetOmega( const body : PNewtonBody; vector : PdFloat );                                                                       cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetOmega'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodyGetVelocity( const body : PNewtonBody; vector : PdFloat );                                                                    cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetVelocity'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodyGetForce( const body : PNewtonBody; vector : PdFloat );                                                                       cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodyGetTorque( const body : PNewtonBody; vector : PdFloat);                                                                       cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetTorque'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonBodyGetForceAcc( const body : PNewtonBody; vector : PdFloat );                                                                    cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetForceAcc'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonBodyGetTorqueAcc( const body : PNewtonBody; vector : PdFloat );                                                                   cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetTorqueAcc'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodyGetCentreOfMass(const body : PNewtonBody; com : PdFloat);                                                                     cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetCentreOfMass'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonBodyGetLinearDamping( const body : PNewtonBody ) : dFloat;                                                                        cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetLinearDamping'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodyGetAngularDamping( const body : PNewtonBody; vector : PdFloat );                                                              cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetAngularDamping'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBodyGetAABB( const body : PNewtonBody; p0 : PdFloat; p1 : PdFloat );                                                               cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetAABB'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonBodyGetFreezeTreshold( const body : PNewtonBody; freezeSpeed2 : PdFloat; freezeOmega2 : PdFloat );                                 cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetFreezeTreshold'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonBodyGetFirstJoint( const body : PNewtonBody ) : PNewtonJoint;                                                                    cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetFirstJoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonBodyGetNextJoint( const body : PNewtonBody; const joint : PNewtonJoint ) : PNewtonJoint;                                         cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetNextJoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonBodyGetFirstContactJoint( const body : PNewtonBody ) : PNewtonJoint;                                                             cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetFirstContactJoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonBodyGetNextContactJoint( const body : PNewtonBody; const contactJoint : PNewtonJoint ) : PNewtonJoint;                           cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetNextContactJoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-// **********************************************************************************************
-//
-// contact joints interface
-//
-// **********************************************************************************************
-
-function  NewtonContactJointGetFirstContact( const contactJoint : PNewtonJoint ) : Pointer;                                                      cdecl; external NewtonDLL;
-function  NewtonContactJointGetNextContact( const contactJoint : PNewtonJoint; contact : Pointer ) : Pointer;                                    cdecl; external NewtonDLL;
-
-function  NewtonContactJointGetContactCount( const contactJoint : PNewtonJoint ) : integer;                                                          cdecl; external{$IFDEF __GPC__}name 'NewtonContactJointGetContactCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonContactJointRemoveContact( const contactJoint : PNewtonJoint; contact : Pointer );                                               cdecl; external{$IFDEF __GPC__}name 'NewtonContactJointRemoveContact'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function NewtonContactGetMaterial( const contact : Pointer ) : PNewtonMaterial;                                                                  cdecl; external NewtonDLL;
-
-procedure NewtonBodyAddBuoyancyForce( const body : PNewtonBody; fluidDensity : dFloat; fluidLinearViscosity, fluidAngularViscosity : dFloat;
-                                      const gravityVector : PdFloat; buoyancyPlane : NewtonGetBuoyancyPlane; context : Pointer );                 cdecl; external{$IFDEF __GPC__}name 'NewtonBodyAddBuoyancyForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonBodyAddImpulse(const body : PNewtonBody; const pointDeltaVeloc : PdFloat; const pointPosit : PdFloat );                            cdecl; external{$IFDEF __GPC__}name 'NewtonAddBodyImpulse'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonBodyApplyImpulseArray (const Body : PNewtonBody; ImpuleCount : Integer; StrideInByte : Integer; const impulseArray : PdFloat;
-                                       const pointArray : PdFloat);                                                                               cdecl; external{$IFDEF __GPC__}name 'NewtonBodyApplyImpulseArray'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-// *****************************************************************************************************************************
-//
-// Common joint funtions
-//
-// *****************************************************************************************************************************
-function  NewtonJointGetUserData( const joint : PNewtonJoint ) : Pointer;                                                                        cdecl; external{$IFDEF __GPC__}name 'NewtonJointGetUserData'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonJointSetUserData( const joint : PNewtonJoint; userData : Pointer );                                                              cdecl; external{$IFDEF __GPC__}name 'NewtonJointSetUserData'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonJointGetBody0( const joint : PNewtonJoint ) : PNewtonBody;                                                                       cdecl; external{$IFDEF __GPC__}name 'NewtonJointGetBody0'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonJointGetBody1( const joint : PNewtonJoint ) : PNewtonBody;                                                                       cdecl; external{$IFDEF __GPC__}name 'NewtonJointGetBody1'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonJointGetInfo( const joint : PNewtonJoint; info : PNewtonJointRecord );                                                           cdecl; external{$IFDEF __GPC__}name 'NewtonJointGetInfo'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonJointGetCollisionState( const joint : PNewtonJoint ) : integer;                                                                      cdecl; external{$IFDEF __GPC__}name 'NewtonJointGetCollisionState'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonJointSetCollisionState( const joint : PNewtonJoint; state : integer );                                                               cdecl; external{$IFDEF __GPC__}name 'NewtonJointSetCollisionState'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonJointGetStiffness( const joint : PNewtonJoint): dFloat;                                                                           cdecl; external{$IFDEF __GPC__}name 'NewtonJointGetStiffness'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonJointSetStiffness( const joint: PNewtonJoint; state: dFloat);                                                                     cdecl; external{$IFDEF __GPC__}name 'NewtonJointSetStiffness'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonDestroyJoint( const newtonWorld : PNewtonWorld; const joint : PNewtonJoint );                                                    cdecl; external{$IFDEF __GPC__}name 'NewtonDestroyJoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonJointSetDestructor( const joint : PNewtonJoint; _destructor : NewtonConstraintDestructor );                                      cdecl; external{$IFDEF __GPC__}name 'NewtonJointSetDestructor'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-// *****************************************************************************************************************************
-//
-// Ball and Socket joint functions
-//
-// *****************************************************************************************************************************
-function  NewtonConstraintCreateBall( const newtonWorld : PNewtonWorld; const pivotPoint : PdFloat;
-                                      const childBody : PNewtonBody; const parentBody : PNewtonBody ) : PNewtonJoint;                            cdecl; external{$IFDEF __GPC__}name 'NewtonConstraintCreateBall'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBallSetUserCallback( const ball : PNewtonJoint; callback : NewtonBallCallBack );                                                 cdecl; external{$IFDEF __GPC__}name 'NewtonBallSetUserCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBallGetJointAngle( const ball : PNewtonJoint; angle : PdFloat );                                                                  cdecl; external{$IFDEF __GPC__}name 'NewtonBallGetJointAngle'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBallGetJointOmega( const ball : PNewtonJoint; omega : PdFloat );                                                                  cdecl; external{$IFDEF __GPC__}name 'NewtonBallGetJointOmega'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBallGetJointForce( const ball : PNewtonJoint; force : PdFloat );                                                                  cdecl; external{$IFDEF __GPC__}name 'NewtonBallGetJointForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonBallSetConeLimits( const ball : PNewtonJoint; const pin : PdFloat; maxConeAngle : dFloat; maxTwistAngle : dFloat );                 cdecl; external{$IFDEF __GPC__}name 'NewtonBallSetConeLimits'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-// *****************************************************************************************************************************
-//
-// Hinge joint functions
-//
-// *****************************************************************************************************************************
-function  NewtonConstraintCreateHinge( const newtonWorld : PNewtonWorld;
-                                       const pivotPoint : PdFloat; const pinDir : PdFloat;
-                                       const childBody : PNewtonBody; const parentBody : PNewtonBody ) : PNewtonJoint;                           cdecl; external{$IFDEF __GPC__}name 'NewtonConstraintCreateHinge'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonHingeSetUserCallback( const hinge : PNewtonJoint; callback : NewtonHingeCallBack );                                              cdecl; external{$IFDEF __GPC__}name 'NewtonHingeSetUserCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonHingeGetJointAngle( const hinge : PNewtonJoint ) : dFloat;                                                                        cdecl; external{$IFDEF __GPC__}name 'NewtonHingeGetJointAngle'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonHingeGetJointOmega( const hinge : PNewtonJoint ) : dFloat;                                                                        cdecl; external{$IFDEF __GPC__}name 'NewtonHingeGetJointOmega'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonHingeGetJointForce( const hinge : PNewtonJoint; force : PdFloat );                                                                cdecl; external{$IFDEF __GPC__}name 'NewtonHingeGetJointForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonHingeCalculateStopAlpha( const hinge : PNewtonJoint; const desc : PNewtonHingeSliderUpdateDesc; angle : dFloat): dFloat;         cdecl; external{$IFDEF __GPC__}name 'NewtonHingeCalculateStopAlpha'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-// *****************************************************************************************************************************
-//
-// Slider joint functions
-//
-// *****************************************************************************************************************************
-function  NewtonConstraintCreateSlider( const newtonWorld : PNewtonWorld;
-                                        const pivotPoint : PdFloat; const pinDir : PdFloat;
-                                        const childBody : PNewtonBody; const parentBody : PNewtonBody ) : PNewtonJoint;                          cdecl; external{$IFDEF __GPC__}name 'NewtonConstraintCreateSlider'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonSliderSetUserCallback( const slider : PNewtonJoint; callback : NewtonSliderCallBack );                                           cdecl; external{$IFDEF __GPC__}name 'NewtonSliderSetUserCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonSliderGetJointPosit( const slider : PNewtonJoint ) : dFloat;                                                                      cdecl; external{$IFDEF __GPC__}name 'NewtonSliderGetJointPosit'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonSliderGetJointVeloc( const slider : PNewtonJoint ) : dFloat;                                                                      cdecl; external{$IFDEF __GPC__}name 'NewtonSliderGetJointVeloc'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonSliderGetJointForce( const slider : PNewtonJoint; force : PdFloat );                                                              cdecl; external{$IFDEF __GPC__}name 'NewtonSliderGetJointForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonSliderCalculateStopAccel( const slider : PNewtonJoint; const desc : PNewtonHingeSliderUpdateDesc; position : dFloat ) : dFloat;    cdecl; external{$IFDEF __GPC__}name 'NewtonSliderCalculateStopAccel'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-
-// *****************************************************************************************************************************
-//
-// Corkscrew joint functions
-//
-// *****************************************************************************************************************************
-function  NewtonConstraintCreateCorkscrew( const newtonWorld : PNewtonWorld;
-                                           const pivotPoint : PdFloat; const pinDir : PdFloat;
-                                           const childBody : PNewtonBody; const parentBody : PNewtonBody ) : PNewtonJoint;                       cdecl; external{$IFDEF __GPC__}name 'NewtonConstraintCreateCorkscrew'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonCorkscrewSetUserCallback( const corkscrew : PNewtonJoint; callback : NewtonCorkscrewCallBack );                                  cdecl; external{$IFDEF __GPC__}name 'NewtonCorkscrewSetUserCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonCorkscrewGetJointPosit( const corkscrew : PNewtonJoint ) : dFloat;                                                                cdecl; external{$IFDEF __GPC__}name 'NewtonCorkscrewGetJointPosit'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonCorkscrewGetJointAngle( const corkscrew : PNewtonJoint ) : dFloat;                                                                cdecl; external{$IFDEF __GPC__}name 'NewtonCorkscrewGetJointAngle'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonCorkscrewGetJointVeloc( const corkscrew : PNewtonJoint ) : dFloat;                                                                cdecl; external{$IFDEF __GPC__}name 'NewtonCorkscrewGetJointVeloc'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonCorkscrewGetJointOmega( const corkscrew : PNewtonJoint ) : dFloat;                                                                cdecl; external{$IFDEF __GPC__}name 'NewtonCorkscrewGetJointOmega'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonCorkscrewGetJointForce( const corkscrew : PNewtonJoint; force : PdFloat );                                                        cdecl; external{$IFDEF __GPC__}name 'NewtonCorkscrewGetJointForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonCorkscrewCalculateStopAlpha(const corkscrew : PNewtonJoint;const desc : PNewtonHingeSliderUpdateDesc;angle : dFloat) : dFloat;     cdecl; external{$IFDEF __GPC__}name 'NewtonCorkscrewCalculateStopAlpha'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonCorkscrewCalculateStopAccel(const corkscrew : PNewtonJoint;const desc : PNewtonHingeSliderUpdateDesc;position : dFloat) : dFloat;  cdecl; external{$IFDEF __GPC__}name 'NewtonCorkscrewCalculateStopAccel'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-
-// *****************************************************************************************************************************
-//
-// Universal joint functions
-//
-// *****************************************************************************************************************************
-function  NewtonConstraintCreateUniversal( const newtonWorld: PNewtonWorld; const pivotPoint: PdFloat; const pinDir0: PdFloat;
-                                          const pinDir1: PdFloat; const childBody: PNewtonBody; const parentBody: PNewtonBody): PNewtonJoint;     cdecl; external{$IFDEF __GPC__}name 'NewtonConstraintCreateUniversal'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonUniversalSetUserCallback(const universal: PNewtonJoint; callback: NewtonUniversalCallback);                                      cdecl; external{$IFDEF __GPC__}name 'NewtonUniversalSetUserCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonUniversalGetJointAngle0(const universal: PNewtonJoint):dFloat;                                                                    cdecl; external{$IFDEF __GPC__}name 'NewtonUniversalGetJointAngle0'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonUniversalGetJointAngle1(const universal: PNewtonJoint):dFloat;                                                                    cdecl; external{$IFDEF __GPC__}name 'NewtonUniversalGetJointAngle1'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonUniversalGetJointOmega0(const universal: PNewtonJoint):dFloat;                                                                    cdecl; external{$IFDEF __GPC__}name 'NewtonUniversalGetJointOmega0'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonUniversalGetJointOmega1(const universal: PNewtonJoint):dFloat;                                                                    cdecl; external{$IFDEF __GPC__}name 'NewtonUniversalGetJointOmega1'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonUniversalGetJointForce(const universal: PNewtonJoint; force: PdFloat);                                                            cdecl; external{$IFDEF __GPC__}name 'NewtonUniversalGetJointForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonUniversalCalculateStopAlpha0(const universal : PNewtonJoint; const desc: PNewtonHingeSliderUpdateDesc; angle: dFloat): dFloat;     cdecl; external{$IFDEF __GPC__}name 'NewtonUniversalCalculateStopAlpha0'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonUniversalCalculateStopAlpha1(const universal : PNewtonJoint; const desc: PNewtonHingeSliderUpdateDesc; angle: dFloat): dFloat;     cdecl; external{$IFDEF __GPC__}name 'NewtonUniversalCalculateStopAlpha1'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-// *****************************************************************************************************************************
-//
-// Up vector joint unctions
-//
-// *****************************************************************************************************************************
-function  NewtonConstraintCreateUpVector( const newtonWorld : PNewtonWorld; const pinDir : PdFloat; const body : PNewtonBody ) : PNewtonJoint;    cdecl; external{$IFDEF __GPC__}name 'NewtonConstraintCreateUpVector'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonUpVectorGetPin( const upVector : PNewtonJoint; pin : PdFloat );                                                                   cdecl; external{$IFDEF __GPC__}name 'NewtonUpVectorGetPin'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonUpVectorSetPin( const upVector : PNewtonJoint; const pin : PdFloat );                                                             cdecl; external{$IFDEF __GPC__}name 'NewtonUpVectorSetPin'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-// *****************************************************************************************************************************
-//
-// User defined bilateral Joint
-//
-// *****************************************************************************************************************************
-function  NewtonConstraintCreateUserJoint(const NewtonWorld : PNewtonWorld; MaxDOF : Integer; Callback : PNewtonUserBilateralCallBack;
-                                          GetInfo : PNewtonUserBilateralGetInfoCallBack; const ChildBody: PNewtonBody;
-                                          const parentBody: PNewtonBody): PNewtonJoint;                                                          cdecl; external{$IFDEF __GPC__}name 'NewtonConstraintCreateUserJoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonUserJointSetFeedbackCollectorCallback(const Joint : PNewtonJoint; GetFeedback : PNewtonUserBilateralCallBack);                   cdecl; external{$IFDEF __GPC__}name 'NewtonUserJointSetFeedbackCollectorCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonUserJointAddLinearRow(const Joint : PNewtonJoint; const pivot0 : PdFloat; const pivot1 : PdFloat; const Dir : PdFloat);             cdecl; external{$IFDEF __GPC__}name 'NewtonUserJointAddLinearRow'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonUserJointAddAngularRow(const Joint : PNewtonJoint; RelativeAngle : dFloat; const Dir : PdFloat);                                   cdecl; external{$IFDEF __GPC__}name 'NewtonUserJointAddAngularRow'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonUserJointAddGeneralRow(const Joint : PNewtonJoint; const Jacobian0 : PdFloat; const Jacobian1 : PdFloat);                          cdecl; external{$IFDEF __GPC__}name 'NewtonUserJointAddGeneralRow'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonUserJointSetRowMinimumFriction(const Joint : PNewtonJoint; Friction : dFloat);                                                    cdecl; external{$IFDEF __GPC__}name 'NewtonUserJointSetRowMinimumFriction'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonUserJointSetRowMaximumFriction(const Joint : PNewtonJoint; Friction : dFloat);                                                    cdecl; external{$IFDEF __GPC__}name 'NewtonUserJointSetRowMaximumFriction'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonUserJointSetRowAcceleration(const Joint : PNewtonJoint; Acceleration : dFloat);                                                   cdecl; external{$IFDEF __GPC__}name 'NewtonUserJointSetRowAcceleration'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonUserJointSetRowSpringDamperAcceleration(const joint : PNewtonJoint; springK : dFloat; springD : dFloat);                           cdecl; external{$IFDEF __GPC__}name 'NewtonUserJointSetRowSpringDamperAcceleration'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonUserJointSetRowStiffness(const Joint : PNewtonJoint; Stiffness : dFloat);                                                         cdecl; external{$IFDEF __GPC__}name 'NewtonUserJointSetRowStiffness'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonUserJointGetRowForce (const Joint : PNewtonJoint; Row : Integer) : dFloat;                                                            cdecl; external{$IFDEF __GPC__}name 'NewtonUserJointGetRowForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-// **********************************************************************************************
-//
-// Mesh joint functions
-//
-// **********************************************************************************************
-
-function  NewtonMeshCreate (const World : PNewtonWorld) : PNewtonMesh;                                                                           cdecl; external{$IFDEF __GPC__}name 'NewtonMeshCreate'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshCreateFromMesh(const Mesh : PNewtonMesh) : PNewtonMesh;                                                                      cdecl; external{$IFDEF __GPC__}name 'NewtonMeshCreateFromMesh'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshCreateFromCollision (const collision : PNewtonCollision) : PNewtonMesh;                                                      cdecl; external{$IFDEF __GPC__}name 'NewtonMeshCreateFromCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshConvexHull (const NewtonWorld : PNewtonWorld; count : integer; const vertexCloud : PdFloat; strideInBytes : integer;
-                                tolerance : dFloat) : PNewtonMesh;                                                                                cdecl; external{$IFDEF __GPC__}name 'NewtonMeshConvexHull'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshCreatePlane (const World : PNewtonWorld; const locationMatrix : PdFloat; width : dFloat; breadth : dFloat; material : Integer;
-                                 const textureMatrix0 : PdFloat; const textureMatrix1) : PNewtonMesh;                                             cdecl; external{$IFDEF __GPC__}name 'NewtonMeshCreatePlane'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonMeshDestroy(const mesh : PNewtonMesh);                                                                                           cdecl; external{$IFDEF __GPC__}name 'NewtonMeshDestroy'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonMeshCalculateOOBB(const mesh : PNewtonMesh; const matrix : PdFloat; x : PdFloat; y : PdFloat; z : PdFloat);                          cdecl; external{$IFDEF __GPC__}name 'NewtonMeshCalculateOOBB'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonMesApplyTransform (const Mesh : PNewtonMesh; const Matrix : PdFloat);                                                             cdecl; external{$IFDEF __GPC__}name 'NewtonMesApplyTransform'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonMeshCalculateVertexNormals(const mesh : PNewtonMesh; angleInRadians : dFloat);                                                    cdecl; external{$IFDEF __GPC__}name 'NewtonMeshCalculateVertexNormals'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonMeshApplySphericalMapping(const mesh : PNewtonMesh; material : integer);                                                             cdecl; external{$IFDEF __GPC__}name 'NewtonMeshApplySphericalMapping'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonMeshApplyBoxMapping(const mesh : PNewtonMesh; front,side,top : integer);                                                             cdecl; external{$IFDEF __GPC__}name 'NewtonMeshApplyBoxMapping'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonMeshApplyCylindricalMapping(const mesh : PNewtonMesh; cylinderMaterial,capMaterial : integer);                                       cdecl; external{$IFDEF __GPC__}name 'NewtonMeshApplyCylindricalMapping'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonMeshIsOpenMesh (const mesh : PNewtonMesh) : Integer;                                                                                 cdecl; external{$IFDEF __GPC__}name 'NewtonMeshIsOpenMesh'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonMeshFixTJoints (const mesh : PNewtonMesh);                                                                                       cdecl; external{$IFDEF __GPC__}name 'NewtonMeshFixTJoints'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonMeshPolygonize (const mesh : PNewtonMesh);                                                                                       cdecl; external{$IFDEF __GPC__}name 'NewtonMeshPolygonize'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonMeshTriangulate (const mesh : PNewtonMesh);                                                                                      cdecl; external{$IFDEF __GPC__}name 'NewtonMeshTriangulate'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshUnion (const mesh : PNewtonMesh; clipper : PNewtonMesh; clipperMatrix : PdFloat) : PNewtonMesh;                               cdecl; external{$IFDEF __GPC__}name 'NewtonMeshUnion'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshDifference (const mesh : PNewtonMesh; clipper : PNewtonMesh; clipperMatrix : PdFloat) : PNewtonMesh;                          cdecl; external{$IFDEF __GPC__}name 'NewtonMeshDifference'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshIntersection (const mesh : PNewtonMesh; clipper : PNewtonMesh; clipperMatrix : PdFloat) : PNewtonMesh;                        cdecl; external{$IFDEF __GPC__}name 'NewtonMeshIntersection'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonMeshClip (const mesh : PNewtonMesh; const clipper : PNewtonMesh; const clippermatrix : PdFloat; const topMesh : PNewtonMesh;
-                          const bottomMesh : PNewtonMesh);                                                                                       cdecl; external{$IFDEF __GPC__}name 'NewtonMeshClip'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonMeshPlaneClip (const Mesh : PNewtonMesh; const planeMatrix : PdFloat; const PlaneTextureMatrix : PdFloat; PlaneMaterial : Integer;
-                               const topMesh : PNewtonMesh; const bottomMesh : PNewtonMesh);                                                     cdecl; external{$IFDEF __GPC__}name 'NewtonMeshPlaneClip'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-
-function  NewtonMeshConvexDecomposition (const Mesh : PNewtonMesh; MaxCount : Integer) : PNewtonMesh;                                                cdecl; external{$IFDEF __GPC__}name 'NewtonMeshConvexDecomposition'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshVoronoiDecomposition (const Mesh : PNewtonMesh; PointCount, PointStrideInBytes : Integer; const PointCloud : PdFloat;
-                                          InternalMaterial : Integer; const TextureMatrix : PdFloat) : PNewtonMesh;                                   cdecl; external{$IFDEF __GPC__}name 'NewtonMeshVoronoiDecomposition'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-
-procedure NewtonRemoveUnusedVertices(const mesh : PNewtonMesh; vertexRemapTable : PInteger);                                                         cdecl; external{$IFDEF __GPC__}name 'NewtonRemoveUnusedVertices'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonMeshBeginFace(const mesh : PNewtonMesh);                                                                                         cdecl; external{$IFDEF __GPC__}name 'NewtonMeshBeginFace'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonMeshAddFace(const mesh : PNewtonMesh; vertexCount : integer; const vertex : PdFloat; strideInBytes,materialIndex : integer );             cdecl; external{$IFDEF __GPC__}name 'NewtonMeshAddFace'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonMeshEndFace(const mesh : PNewtonMesh);                                                                                           cdecl; external{$IFDEF __GPC__}name 'NewtonMeshEndFace'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonMeshBuildFromVertexListIndexList(const Mesh : PNewtonMesh;
-		FaceCount : Integer; const faceIndexCount : PInteger; const faceMaterialIndex : PInteger;
-		const vertex : PdFloat; vertexStrideInBytes : Integer; const vertexIndex : PInteger;
-		const normal : PdFloat; normalStrideInBytes : Integer; const normalIndex : PInteger;
-		const uv0 : PdFloat; uv0StrideInBytes : Integer; const uv0Index : PInteger;
-		const uv1 : PdFloat; uv1StrideInBytes : Integer; const uv1Index : PInteger);                                                                          cdecl; external{$IFDEF __GPC__}name 'NewtonMeshBuildFromVertexListIndexList'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonMeshGetVertexStreams(const Mesh: PNewtonMesh; vertexStrideInByte: Integer; Vertex: PdFloat; normalStrideInByte : integer;
-                                     Normal: PdFloat; uvStrideInByte0 : Integer; uv0: PdFloat; uvStrideInByte1 : Integer; uv1 : PdFloat);                 cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetVertexStreams'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-procedure NewtonMeshGetIndirectVertexStreams(const mesh : PNewtonMesh; vertexStrideInByte : integer; vertex : PdFloat; vertexIndices : PInteger;
-                                             vertexCount : PInteger; normalStrideInByte : integer; normal: PdFloat; normalIndices : PInteger;
-                                             normalCount : PInteger; uvStrideInByte0 : integer; uv0: PdFloat; uvIndices0 : PInteger; uvCount0 : PInteger;
-                                             uvStrideInByte1 : integer; uv1: PdFloat; uvIndices1 : PInteger; uvCount1 : PInteger);                           cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetIndirectVertexStreams'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonMeshBeginHandle (const mesh : PNewtonMesh) : Pointer;                                                                            cdecl; external{$IFDEF __GPC__}name 'NewtonMeshBeginHandle'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonMeshEndHandle (const mesh : PNewtonMesh; Handle : Pointer);                                                                      cdecl; external{$IFDEF __GPC__}name 'NewtonMeshEndHandle'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonMeshFirstMaterial (const mesh : PNewtonMesh; Handle : Pointer) : integer;                                                            cdecl; external{$IFDEF __GPC__}name 'NewtonMeshFirstMaterial'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshNextMaterial (const mesh : PNewtonMesh; Handle : Pointer; materialID : integer) : integer;                                           cdecl; external{$IFDEF __GPC__}name 'NewtonMeshNextMaterial'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshMaterialGetMaterial (const mesh : PNewtonMesh; Handle : Pointer; materialID : integer) : integer;                                    cdecl; external{$IFDEF __GPC__}name 'NewtonMeshMaterialGetMaterial'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshMaterialGetIndexCount (const mesh : PNewtonMesh; Handle : Pointer; materialID : integer) : integer;                                  cdecl; external{$IFDEF __GPC__}name 'NewtonMeshMaterialGetIndexCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonMeshMaterialGetIndexStream(const mesh : PNewtonMesh; Handle : Pointer; materialID : integer; index : PInteger);                          cdecl; external{$IFDEF __GPC__}name 'NewtonMeshMaterialGetIndexStream'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonMeshMaterialGetIndexStreamShort(const mesh : PNewtonMesh; Handle : Pointer; materialID : integer; index : PShort);                   cdecl; external{$IFDEF __GPC__}name 'NewtonMeshMaterialGetIndexStreamShort'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonMeshCreateFirstSingleSegment (const mesh : PNewtonMesh) : PNewtonMesh;                                                           cdecl; external{$IFDEF __GPC__}name 'NewtonMeshCreateFirstSingleSegment'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshCreateNextSingleSegment (const mesh : PNewtonMesh; Segment : PNewtonMesh) : PNewtonMesh;                                     cdecl; external{$IFDEF __GPC__}name 'NewtonMeshCreateNextSingleSegment'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonMeshCreateFirstLayer(const Mesh : PNewtonMesh) : PNewtonMesh;                                                                    cdecl; external{$IFDEF __GPC__}name 'NewtonMeshCreateFirstLayer'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshCreateNextLayer(const Mesh : PNewtonMesh; const Segment : PNewtonMesh) : PNewtonMesh;                                        cdecl; external{$IFDEF __GPC__}name 'NewtonMeshCreateNextLayer'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonMeshGetTotalFaceCount (const mesh : PNewtonMesh) : Integer;                                                                          cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetTotalFaceCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshGetTotalIndexCount (const mesh : PNewtonMesh) : Integer;                                                                         cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetTotalIndexCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonMeshGetFaces (const mesh : PNewtonMesh; const faceIndexCount : PInteger; faceMaterial : PInteger; faceIndices : PInteger);                   cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetFaces'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonMeshGetPointCount (const Mesh : PNewtonMesh) : Integer;                                                                              cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetPointCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshGetPointStrideInByte (const Mesh : PNewtonMesh) : Integer;                                                                       cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetPointStrideInByte'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshGetPointArray (const Mesh : PNewtonMesh): PdFloat;                                                                            cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetPointArray'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonMeshGetNormalArray (const Mesh : PNewtonMesh) : PdFloat;                                                                          cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetNormalArray'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshGetUV0Array (const Mesh : PNewtonMesh) : PdFloat;                                                                             cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetUV0Array'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshGetUV1Array (const Mesh : PNewtonMesh) : PdFloat;                                                                             cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetUV1Array'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonMeshGetVertexCount (const Mesh : PNewtonMesh) : Integer;                                                                             cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetVertexCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshGetVertexStrideInByte (const Mesh : PNewtonMesh) : Integer;                                                                      cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetVertexStrideInByte'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshGetVertexArray (const Mesh : PNewtonMesh) : PdFloat;                                                                          cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetVertexArray'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonMeshGetFirstVertex (const Mesh : PNewtonMesh) : Pointer;                                                                         cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetFirstVertex'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshGetNextVertex (const Mesh : PNewtonMesh; const Vertex : Pointer) : Pointer;                                                  cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetNextVertex'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshGetVertexIndex (const Mesh : PNewtonMesh; const Vertex : Pointer) : Integer;                                                     cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetVertexIndex'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-//NEWTON_API int NewtonMeshGetVertexPointIndex (const NewtonMesh *mesh, const void* vertex);
-
-function  NewtonMeshGetFirstPoint (const Mesh : PNewtonMesh) : Pointer;                                                                          cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetFirstPoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshGetNextPoint (const Mesh : PNewtonMesh; const point : Pointer) : Pointer;                                                    cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetNextPoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshGetPointIndex (const Mesh : PNewtonMesh; const point : Pointer) : Integer;                                                       cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetPointIndex'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshGetVertexIndexFromPoint (const Mesh : PNewtonMesh; const point : Pointer) : Integer;                                             cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetVertexIndexFromPoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-function  NewtonMeshGetFirstEdge (const Mesh : PNewtonMesh) : Pointer;                                                                           cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetFirstEdge'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshGetNextEdge (const Mesh : PNewtonMesh; const Edge : Pointer) : Pointer;                                                      cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetNextEdge'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonMeshGetEdgeIndices (const Mesh : PNewtonMesh; const Edge : Pointer; v0 : PInteger; v1 : PInteger);                                       cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetEdgeIndices'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-//NEWTON_API void NewtonMeshGetEdgePointIndices (const Mesh : PNewtonMesh, const void* edge, int* v0, int* v1);
-
-function  NewtonMeshGetFirstFace (const Mesh : PNewtonMesh) : Pointer;                                                                           cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetFirstFace'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshGetNextFace (const Mesh : PNewtonMesh; const Face : Pointer) : Pointer;                                                      cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetNextFace'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshIsFaceOpen (const Mesh : PNewtonMesh; const Face : Pointer) : Integer;                                                           cdecl; external{$IFDEF __GPC__}name 'NewtonMeshIsFaceOpen'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshGetFaceMaterial (const Mesh : PNewtonMesh; const Face : Pointer) : Integer;                                                      cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetFaceMaterial'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-function  NewtonMeshGetFaceIndexCount (const Mesh : PNewtonMesh; const Face : Pointer) : Integer;                                                    cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetFaceIndexCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonMeshGetFaceIndices (const Mesh : PNewtonMesh; const Face : Pointer; Indices : PInteger);                                             cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetFaceIndices'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-procedure NewtonMeshGetFacePointIndices (const Mesh : PNewtonMesh; const Face : Pointer; Indices : PInteger);                                        cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetFacePointIndices'{$ELSE}NewtonDLL{$ENDIF __GPC__};
-
-
-implementation
-
-end.

+ 0 - 1261
Source/FMX/Physix.NewtonImport.pas

@@ -1,1261 +0,0 @@
-//
-// The graphics platform GLXcene https://github.com/glscene
-//
-unit Physix.NewtonImport;
-
-(* Copyright (c) <2003-2020> <Julio Jerez, Newton Game Dynamics>
-*
-* This software is provided 'as-is', without any express or implied
-* warranty. In no event will the authors be held liable for any damages
-* arising from the use of this software.
-*
-* Permission is granted to anyone to use this software for any purpose,
-* including commercial applications, and to alter it and redistribute it
-* freely, subject to the following restrictions:
-*
-* 1. The origin of this software must not be misrepresented; you must not
-* claim that you wrote the original software. If you use this software
-* in a product, an acknowledgment in the product documentation would be
-* appreciated but is not required.
-*
-* 2. Altered source versions must be plainly marked as such, and must not be
-* misrepresented as being the original software.
-*
-* 3. This notice may not be removed or altered from any source distribution.
-*)
-
-interface
-
-// Define double to use newton in double precision
-{.$DEFINE USE_DOUBLE_PRECISION}
-
- const
- {$IFDEF USE_DOUBLE_PRECISION}
-  NEWTON_API = 'newtond.dll';
- {$ELSE}
-  NEWTON_API = 'newton.dll';
- {$ENDIF}
-
-type
-{$IFDEF USE_DOUBLE_PRECISION}
-  	  Float = Double;
-     dFloat = Double;
-{$ELSE}
-      Float = Single;
-     dFloat = Single;
-{$ENDIF}
-
-PFloat = ^Float;
-PdFloat = ^dFloat;
-
-PInteger = ^Integer;
-Psmallint = ^smallint;
-PPointer = ^Pointer;
-dFloat64 = Double;
-PdFloat64 = ^dFloat64;
-dLong = Int64;
-PdLong = ^dLong;
-
-PNewtonMesh = ^Pointer;
-PNewtonBody = ^Pointer;
-PNewtonWorld = ^Pointer;
-PNewtonJoint = ^Pointer;
-PNewtonMaterial = ^Pointer;
-PNewtonCollision = ^Pointer;
-PNewtonSceneProxy = ^Pointer;
-PNewtonFracturedCompoundMeshPart = ^Pointer;
-PNewtonDeformableMeshSegment = ^Pointer;
-PNewtonAcyclicArticulation = ^Pointer;
-PNewtonInverseDynamics = ^Pointer;
-(*
-PNewtonSerializeHandle = ^Pointer;
-PNewtonMeshHandle = ^Pointer;
-PNewtonMeshVertex = ^Pointer;
-PNewtonMeshPoint = ^Pointer;
-PNewtonMeshEdge = ^Pointer;
-PNewtonMeshFace = ^Pointer;
-PNewtonListener = ^Pointer;
-*)
-TNewtonFuncLinkRecord = record
-	function_name: widestring;
-	function_ptr: pointer
-end;
- 
-
-const 
- NEWTON_MAJOR_VERSION = 3;
- NEWTON_MINOR_VERSION = 15;
- NEWTON_BROADPHASE_DEFAULT = 0;
- NEWTON_BROADPHASE_PERSINTENT = 1;
- NEWTON_DYNAMIC_BODY = 0;
- NEWTON_KINEMATIC_BODY = 1;
- NEWTON_DYNAMIC_ASYMETRIC_BODY	= 2;
-// NEWTON_DEFORMABLE_BODY	=	2;
-
- SERIALIZE_ID_SPHERE = 0;
- SERIALIZE_ID_CAPSULE = 1;
- SERIALIZE_ID_CYLINDER = 2;
- SERIALIZE_ID_CHAMFERCYLINDER = 3;
- SERIALIZE_ID_BOX = 4;
- SERIALIZE_ID_CONE = 5;
- SERIALIZE_ID_CONVEXHULL = 6;
- SERIALIZE_ID_NULL = 7;
- SERIALIZE_ID_COMPOUND = 8;
- SERIALIZE_ID_TREE = 9;
- SERIALIZE_ID_HEIGHTFIELD = 10;
- SERIALIZE_ID_CLOTH_PATCH = 11;
- SERIALIZE_ID_DEFORMABLE_SOLID = 12;
- SERIALIZE_ID_USERMESH = 13;
- SERIALIZE_ID_SCENE = 14;
- SERIALIZE_ID_FRACTURED_COMPOUND = 15;
-
- 
-type  
- 
-TNewtonMaterialData = packed record
-case integer of
-1: (
-	m_ptr: Pointer;
-);
-2: (
-	m_int: dLong;
-);
-3: (
-	m_float: dFloat;
-);
-  end; 
-PNewtonMaterialData = ^TNewtonMaterialData;
-
-TNewtonCollisionMaterial = packed record
-  m_userId: dLong;
-  m_userData: TNewtonMaterialData;
-  m_userParam: array[0..5] of TNewtonMaterialData;
- end;
-PNewtonCollisionMaterial = ^TNewtonCollisionMaterial;
-
-TNewtonBoxParam = packed record
-  m_x: dFloat;
-  m_y: dFloat;
-  m_z: dFloat;
- end;
-PNewtonBoxParam = ^TNewtonBoxParam;
-
-TNewtonSphereParam = packed record
-  m_radio: dFloat;
- end;
-PNewtonSphereParam = ^TNewtonSphereParam;
-
-TNewtonCapsuleParam = packed record
-	m_radio0: dfloat;
-	m_radio1: dfloat;
-	m_height: dfloat;
-end;
-PNewtonCapsuleParam = ^TNewtonCapsuleParam;
-
-TNewtonCylinderParam = packed record
-	m_radio0: dfloat;
-	m_radio1: dfloat;
-	m_height: dfloat;
-end;
-PNewtonCylinderParam = ^TNewtonCylinderParam;
-
-TNewtonConeParam = packed record
-	m_radio: dfloat;
-	m_height: dfloat;
-end;
-PNewtonConeParam = ^TNewtonConeParam;
-
-TNewtonTaperedCapsuleParam = packed record
-  m_radio0,
-  m_radio1,
-  m_height: dFloat;
-end;
-PNewtonTaperedCapsuleParam = ^TNewtonTaperedCapsuleParam;
-
-
-TNewtonTaperedCylinderParam = packed record
-  m_radio0,
-  m_radio1,
-  m_height: dFloat;
-end;
-PNewtonTaperedCylinderParam = ^TNewtonTaperedCylinderParam;
-
-TNewtonChamferCylinderParam = packed record
-  m_radio: dFloat;
-  m_height: dFloat;
- end;
-PNewtonChamferCylinderParam = ^TNewtonChamferCylinderParam;
-
-TNewtonConvexHullParam = packed record
-  m_vertexCount: Integer;
-  m_vertexStrideInBytes: Integer;
-  m_faceCount: Integer;
-  m_vertex: PdFloat;
- end;
-PNewtonConvexHullParam = ^TNewtonConvexHullParam;
-
-TNewtonCompoundCollisionParam = packed record
-	m_chidrenCount: Integer;
-end;
-PNewtonCompoundCollisionParam = ^TNewtonCompoundCollisionParam;
-
-TNewtonCollisionTreeParam = packed record
-	m_vertexCount: Integer;
-	m_indexCount: Integer;
-end;
-PNewtonCollisionTreeParam = ^TNewtonCollisionTreeParam;
-
-TNewtonDeformableMeshParam = packed record
-	m_vertexCount: Integer;
-	m_triangleCount: Integer;
-	m_vrtexStrideInBytes: Integer;
-	m_indexList: PWord;
-	m_vertexList: PdFloat;
-end;
-PNewtonDeformableMeshParam = ^TNewtonDeformableMeshParam;
-
-TNewtonHeightFieldCollisionParam = packed record
-  m_width                 : Integer;
-  m_height                : Integer; 
-  m_gridsDiagonals        : Integer;
-  m_elevationDataType     : Integer;// 0 = 32 bit floats, 1 = unsigned 16 bit integers
-  m_verticalScale         : dFloat;
-  m_horizonalScale_x      : dFloat;
-  m_horizonalScale_z      : dFloat;
-  m_vertialElevation      : Pointer;
-  m_atributes             : PShortInt;
-end;
-PNewtonHeightFieldCollisionParam = ^TNewtonHeightFieldCollisionParam;
-
-TNewtonSceneCollisionParam = packed record
-  m_childrenProxyCount   : Integer;
-end;
-PNewtonSceneCollisionParam = ^TNewtonSceneCollisionParam;
-
-TNewtonCollisionNullParam = packed record
-end;
-
-TNewtonCollisionInfoRecord = packed record
-  m_offsetMatrix: array [0..3,0..3] of dFloat;
-  m_collisionMaterial: TNewtonCollisionMaterial; 
-  m_collisionType,    // tag id to identify the collision primitive
-  m_collisionUserID: Integer;
-  case Integer of
-  	SERIALIZE_ID_BOX: (shapedataBox: TNewtonBoxParam);
-	SERIALIZE_ID_CONE: (shapedataCone: TNewtonConeParam);
-	SERIALIZE_ID_SPHERE: (shapedataSphere: TNewtonSphereParam);
-    SERIALIZE_ID_CAPSULE: (shapedataCapsule: TNewtonCapsuleParam);
-    SERIALIZE_ID_CYLINDER: (shapedataCylinder: TNewtonCylinderParam);
-	//SERIALIZE_ID_TAPEREDCAPSULE: (m_taperedCapsule: TNewtonTaperedCapsuleParam);
-	//SERIALIZE_ID_TAPEREDCYLINDER:	(m_taperedCylinder: TNewtonTaperedCylinderParam);
-    // SERIALIZE_ID_NULL: (shapedataNull: TNewtonCollisionNullParam);
-     SERIALIZE_ID_CHAMFERCYLINDER: (shapedataChamferCylinder: TNewtonChamferCylinderParam);
-     SERIALIZE_ID_CONVEXHULL: (shapedataConvexHull: TNewtonConvexHullParam);
-	 
-	 SERIALIZE_ID_DEFORMABLE_SOLID:	(m_deformableMesh: TNewtonDeformableMeshParam);
-
-     SERIALIZE_ID_COMPOUND: (shapedataCompound: TNewtonCompoundCollisionParam);
-     SERIALIZE_ID_TREE: (shapedataTree: TNewtonCollisionTreeParam);
-     SERIALIZE_ID_HEIGHTFIELD: (shapedataHeightField: TNewtonHeightFieldCollisionParam);
-     SERIALIZE_ID_SCENE: (shapedataSceneCollision: TNewtonSceneCollisionParam);
-	 SERIALIZE_ID_USERMESH: (m_paramArray: array[0..63] of float);
- end;
-PNewtonCollisionInfoRecord = ^TNewtonCollisionInfoRecord;  
-
-TNewtonJointRecord = packed record
-	m_attachmenMatrix_0: array[0..3, 0..3] of dfloat;
-	m_attachmenMatrix_1: array[0..3, 0..3] of dfloat;
-	m_minLinearDof: array[0..2] of dfloat;
-	m_maxLinearDof: array[0..2] of dfloat;
-	m_minAngularDof: array[0..2] of dfloat;
-	m_maxAngularDof: array[0..2] of dfloat;
-	m_attachBody_0: pNewtonBody;
-	m_attachBody_1: pNewtonBody;
-	m_extraParameters: array[0..63] of dfloat;
-	m_bodiesCollisionOn: Integer;
-	m_descriptionType: array[0..127] of AnsiChar;
-end;
-PNewtonJointRecord = ^TNewtonJointRecord;
-
- TNewtonUserMeshCollisionCollideDesc = packed record
-  m_boxP0: array [0..3] of dFloat;                      // lower bounding box of intersection query in local space
-  m_boxP1: array [0..3] of dFloat;                      // upper bounding box of intersection query in local space
-  m_boxDistanceTravel: array [0..3] of dFloat;          // max distance that box bpxP0 and boxP1 can travel on this timestep, used this for continue collision mode.
-  m_threadNumber: Integer;                              // current thread executing this query
-  m_faceCount: Integer;                                 // the application should set here how many polygons intersect the query box
-  m_vertexStrideInBytes: Integer;                       // the application should set here the size of each vertex
-  m_skinThickness: dFloat;                              // this is the minimum skin separation specified by the material between these two colliding shapes
-  m_userData: Pointer;                                  // user data passed to the collision geometry at creation time
-
-  m_objBody              : PNewtonBody;                  // pointer to the colliding body
-  m_polySoupBody         : PNewtonBody;                  // pointer to the rigid body owner of this collision tree
-  m_objCollision         : PNewtonCollision;             // collision shape of the colliding body, (no necessarily the collision of m_objBody)
-  m_polySoupCollision    : PNewtonCollision;             // collision shape of teh collsion tree, (no necessarily the collision of m_polySoupBody)
-  m_vertex               : PdFloat;                 // the application should set here the pointer to the global vertex of the mesh.
-  m_faceIndexCount       : PInteger;                // the application should set here the pointer to the vertex count of each face.
-  m_faceVertexIndex      : PInteger;                // the application should set here the pointer index array for each vertex on a face.
-													// the format of a face is I0, I1, I2, I3, ..., M, N, E0, E1, E2, ..., A
-                                                	// I0, I1, I2, .. are the indices to the vertex, relative to m_vertex pointer
-		                                        	// M is the index to the material sub shape id
-													// N in the index to the vertex normal relative to m_vertex pointer
-													// E0, E1, E2, ... are the indices of the the face normal that is shared to that face edge, when the edge does not share a face normal then the edge index is set to index N, which the index to the face normal
-													// A is and estimate of the largest diagonal of the face, this used internally as a hint to improve floating point accuracy and algorithm performance. 
- end;
- PNewtonUserMeshCollisionCollideDesc = ^TNewtonUserMeshCollisionCollideDesc;
- 
- 
- TNewtonWorldConvexCastReturnInfo = Packed Record
-   m_point: array [0..3] of dFloat;              // collision point in global space
-   m_normal: array [0..3] of dFloat;             // surface normal at collision point in global space
-   //m_normalOnHitPoint: array [0..3] of dFloat; // surface normal at the surface of the hit body,
-                                                 // is the same as the normal calculated by a ray cast hitting the body at the hit point
-   m_contactID: Integer;                         // collision ID at contact point
-   m_hitBody: PNewtonBody;                        // body hit at contact point
-   m_penetration: dFloat;                        // contact penetration at collision point
- end;
- PNewtonWorldConvexCastReturnInfo = ^TNewtonWorldConvexCastReturnInfo;
- 
- TNewtonUserMeshCollisionRayHitDesc = Packed Record
-  m_p0                   : array [0..3] of dFloat;      // ray origin in collision local space
-  m_p1                   : array [0..3] of dFloat;      // ray destination in collision local space
-  m_normalOut            : array [0..3] of dFloat;      // copy here the normal at the ray intersection
-  m_userIdOut            : dLong;                       // copy here a user defined id for further feedback
-  m_userData             : Pointer;                     // user data passed to the collision geometry at creation time
- end;
- PNewtonUserMeshCollisionRayHitDesc = ^TNewtonUserMeshCollisionRayHitDesc;
- 
- TNewtonHingeSliderUpdateDesc = Packed Record
-  m_accel                : dFloat;
-  m_minFriction          : dFloat;  
-  m_maxFriction          : dFloat;
-  m_timestep             : dFloat;
- end;
-PNewtonHingeSliderUpdateDesc = ^TNewtonHingeSliderUpdateDesc;
-
-
- TNewtonUserContactPoint = packed record
-  m_point                : array [0..3] of dFloat;
-  m_normal               : array [0..3] of dFloat;
-  m_shapeId0             : dLong;
-  m_shapeId1             : dLong;
-  m_penetration          : dFloat;
-  m_unused               : array [0..2] of Integer;
- end;
- PNewtonUserContactPoint = ^TNewtonUserContactPoint;
-
-TNewtonImmediateModeConstraint = packed record
-	m_jacobian01: array[0..7, 0..5] of dfloat;
-	m_jacobian10: array[0..7, 0..5] of dfloat;
-	m_minFriction: array[0..7] of dfloat;
-	m_maxFriction: array[0..7] of dfloat;
-	m_jointAccel: array[0..7] of dfloat;
-	m_jointStiffness: array[0..7] of dfloat;
-end;
-PNewtonImmediateModeConstraint = ^TNewtonImmediateModeConstraint;
- // data structure for interfacing with NewtonMesh
- TNewtonMeshDoubleData = packed record
-  m_data          : Pdouble;
-  m_indexList     : PInteger;
-  m_strideInBytes : Integer;
- end;
- PNewtonMeshDoubleData = ^TNewtonMeshDoubleData;
-  
- TNewtonMeshFloatData = packed record
-  m_data          : PdFloat;
-  m_indexList     : PInteger;
-  m_strideInBytes : Integer;
- end;
- PNewtonMeshFloatData = ^TNewtonMeshFloatData;
- 
- TNewtonMeshVertexFormat = packed record
-  m_faceCount : Integer;
-  m_faceIndexCount: PInteger;
-  m_faceMaterial: PInteger;
-  m_vertex: TNewtonMeshDoubleData;
-  m_normal: TNewtonMeshFloatData;
-  m_binormal: TNewtonMeshFloatData;
-  m_uv0: TNewtonMeshFloatData;
-  m_uv1: TNewtonMeshFloatData;
-  m_vertexColor: TNewtonMeshFloatData;
- end;
- PNewtonMeshVertexFormat = ^TNewtonMeshVertexFormat;
- 
- // Newton callback functions
-NewtonAllocMemory = function(sizeInBytes: Integer): Pointer; cdecl;
-PNewtonAllocMemory = ^NewtonAllocMemory;
-NewtonFreeMemory = procedure(const ptr: Pointer; sizeInBytes: Integer); cdecl;
-PNewtonFreeMemory = ^NewtonFreeMemory;
- 
-NewtonWorldDestructorCallback = procedure(const world: PNewtonWorld); cdecl;
-PNewtonWorldDestructorCallback = ^NewtonWorldDestructorCallback;
-
-NewtonPostUpdateCallback = procedure(const world: PNewtonWorld; timestep: dfloat); cdecl;
-PNewtonPostUpdateCallback = ^NewtonPostUpdateCallback;
-
-NewtonCreateContactCallback = procedure(const newtonWorld: PNewtonWorld; const contact: PNewtonJoint); cdecl;
-PNewtonCreateContactCallback = ^NewtonCreateContactCallback;
-
-NewtonDestroyContactCallback = procedure(const newtonWorld: PNewtonWorld; const contact: PNewtonJoint); cdecl;
-PNewtonDestroyContactCallback = ^NewtonDestroyContactCallback;
-
-NewtonWorldListenerDebugCallback = procedure(const world: PNewtonWorld; const listener: Pointer; const debugContext: Pointer); cdecl;
-PNewtonWorldListenerDebugCallback = ^NewtonWorldListenerDebugCallback;
-
-NewtonWorldListenerBodyDestroyCallback = procedure(const world: PNewtonWorld; const listenerUserData: Pointer; const body: pNewtonBody); cdecl;
-PNewtonWorldListenerBodyDestroyCallback = ^NewtonWorldListenerBodyDestroyCallback;
-
-NewtonWorldUpdateListenerCallback = procedure(const world: PNewtonWorld; const listenerUserData: Pointer; timestep: dfloat); cdecl;
-PNewtonWorldUpdateListenerCallback = ^NewtonWorldUpdateListenerCallback;
-
-NewtonWorldDestroyListenerCallback = procedure(const world: PNewtonWorld; const listenerUserData: Pointer); cdecl;
-PNewtonWorldDestroyListenerCallback = ^NewtonWorldDestroyListenerCallback;
-
-NewtonGetTimeInMicrosencondsCallback = function(): int64; cdecl;
-PNewtonGetTimeInMicrosencondsCallback = ^NewtonGetTimeInMicrosencondsCallback;
-
-NewtonSerializeCallback = procedure(const serializeHandle: Pointer; const buffer: Pointer; size: Integer); cdecl;
-PNewtonSerializeCallback = ^NewtonSerializeCallback;
-
-NewtonDeserializeCallback = procedure(const serializeHandle: Pointer; const buffer: Pointer; size: Integer); cdecl;
-PNewtonDeserializeCallback = ^NewtonDeserializeCallback;
-
-NewtonOnBodySerializationCallback = procedure(const body: pNewtonBody; const userData: Pointer; functionparam: PNewtonSerializeCallback; const serializeHandle: Pointer); cdecl;
-PNewtonOnBodySerializationCallback = ^NewtonOnBodySerializationCallback;
-
-NewtonOnBodyDeserializationCallback = procedure(const body: pNewtonBody; const userData: Pointer; functionparam: PNewtonDeserializeCallback; const serializeHandle: Pointer); cdecl;
-PNewtonOnBodyDeserializationCallback = ^NewtonOnBodyDeserializationCallback;
-
-NewtonOnJointSerializationCallback = procedure(const joint: PNewtonJoint; functionparam: PNewtonSerializeCallback; const serializeHandle: Pointer); cdecl;
-PNewtonOnJointSerializationCallback = ^NewtonOnJointSerializationCallback;
-
-NewtonOnJointDeserializationCallback = procedure(const body0: pNewtonBody; const body1: pNewtonBody; functionparam: PNewtonDeserializeCallback; const serializeHandle: Pointer); cdecl;
-PNewtonOnJointDeserializationCallback = ^NewtonOnJointDeserializationCallback;
-
- // user collision callbacks
-NewtonOnUserCollisionSerializationCallback = procedure(const userData: Pointer; functionparam: PNewtonSerializeCallback; const serializeHandle: Pointer); cdecl;
-PNewtonOnUserCollisionSerializationCallback = ^NewtonOnUserCollisionSerializationCallback;
-
-NewtonUserMeshCollisionDestroyCallback = procedure(const userData: Pointer); cdecl;
-PNewtonUserMeshCollisionDestroyCallback = ^NewtonUserMeshCollisionDestroyCallback;
-
-NewtonUserMeshCollisionRayHitCallback = function(const lineDescData: PNewtonUserMeshCollisionRayHitDesc): dfloat; cdecl;
-PNewtonUserMeshCollisionRayHitCallback = ^NewtonUserMeshCollisionRayHitCallback;
-
-NewtonUserMeshCollisionGetCollisionInfo = procedure(const userData: Pointer; const infoRecord: PNewtonCollisionInfoRecord); cdecl;
-PNewtonUserMeshCollisionGetCollisionInfo = ^NewtonUserMeshCollisionGetCollisionInfo;
-
-NewtonUserMeshCollisionAABBTest = function(const userData: Pointer; const boxP0: pfloat; const boxP1: pfloat): Integer; cdecl;
-PNewtonUserMeshCollisionAABBTest = ^NewtonUserMeshCollisionAABBTest;
-
-NewtonUserMeshCollisionGetFacesInAABB = function(const userData: Pointer; const p0: pfloat; const p1: pfloat; const vertexArray: Pfloat; const vertexCount: Pinteger; const vertexStrideInBytes: Pinteger; const indexList: Pinteger; maxIndexCount: Integer; const userDataList: Pinteger): Integer; cdecl;
-PNewtonUserMeshCollisionGetFacesInAABB = ^NewtonUserMeshCollisionGetFacesInAABB;
-
-NewtonUserMeshCollisionCollideCallback = procedure(const collideDescData: PNewtonUserMeshCollisionCollideDesc; const continueCollisionHandle: Pointer); cdecl;
-PNewtonUserMeshCollisionCollideCallback = ^NewtonUserMeshCollisionCollideCallback;
-
-NewtonTreeCollisionFaceCallback = function(const context: Pointer; const polygon: pfloat; strideInBytes: Integer; const indexArray: Pinteger; indexCount: Integer): Integer; cdecl;
-PNewtonTreeCollisionFaceCallback = ^NewtonTreeCollisionFaceCallback;
-
-NewtonCollisionTreeRayCastCallback = function(const body: pNewtonBody; const treeCollision: PNewtonCollision; intersection: dfloat; const normal: pfloat; faceId: Integer; const usedData: Pointer): dfloat; cdecl;
-PNewtonCollisionTreeRayCastCallback = ^NewtonCollisionTreeRayCastCallback;
-
-NewtonHeightFieldRayCastCallback = function(const body: pNewtonBody; const heightFieldCollision: PNewtonCollision; intersection: dfloat; row: Integer; col: Integer; const normal: pfloat; faceId: Integer; const usedData: Pointer): dfloat; cdecl;
-PNewtonHeightFieldRayCastCallback = ^NewtonHeightFieldRayCastCallback;
-
-NewtonCollisionCopyConstructionCallback = procedure(const newtonWorld: PNewtonWorld; const collision: PNewtonCollision; const sourceCollision: PNewtonCollision); cdecl;
-PNewtonCollisionCopyConstructionCallback = ^NewtonCollisionCopyConstructionCallback;
-
-NewtonCollisionDestructorCallback = procedure(const newtonWorld: PNewtonWorld; const collision: PNewtonCollision); cdecl;
-PNewtonCollisionDestructorCallback = ^NewtonCollisionDestructorCallback;
-
-NewtonTreeCollisionCallback = procedure(const bodyWithTreeCollision: pNewtonBody; const body: pNewtonBody; faceID: Integer; vertexCount: Integer; const vertex: pfloat; vertexStrideInBytes: Integer); cdecl;
-PNewtonTreeCollisionCallback = ^NewtonTreeCollisionCallback;
-
-NewtonBodyDestructor = procedure(const body: pNewtonBody); cdecl;
-PNewtonBodyDestructor = ^NewtonBodyDestructor;
-
-NewtonApplyForceAndTorque = procedure(const body: pNewtonBody; timestep: dfloat; threadIndex: Integer); cdecl;
-PNewtonApplyForceAndTorque = ^NewtonApplyForceAndTorque;
-
-NewtonSetTransform = procedure(const body: pNewtonBody; const matrix: pfloat; threadIndex: Integer); cdecl;
-PNewtonSetTransform = ^NewtonSetTransform;
-
-NewtonIslandUpdate = function(const newtonWorld: PNewtonWorld; const islandHandle: Pointer; bodyCount: Integer): Integer; cdecl;
-PNewtonIslandUpdate = ^NewtonIslandUpdate;
-
-NewtonFractureCompoundCollisionOnEmitCompoundFractured = procedure(const fracturedBody: pNewtonBody); cdecl;
-PNewtonFractureCompoundCollisionOnEmitCompoundFractured = ^NewtonFractureCompoundCollisionOnEmitCompoundFractured;
-
-NewtonFractureCompoundCollisionOnEmitChunk = procedure(const chunkBody: pNewtonBody; const fracturexChunkMesh: PNewtonFracturedCompoundMeshPart; const fracturedCompountCollision: PNewtonCollision); cdecl;
-PNewtonFractureCompoundCollisionOnEmitChunk = ^NewtonFractureCompoundCollisionOnEmitChunk;
-
-NewtonFractureCompoundCollisionReconstructMainMeshCallBack = procedure(const body: pNewtonBody; const mainMesh: PNewtonFracturedCompoundMeshPart; const fracturedCompountCollision: PNewtonCollision); cdecl;
-PNewtonFractureCompoundCollisionReconstructMainMeshCallBack = ^NewtonFractureCompoundCollisionReconstructMainMeshCallBack;
-
-NewtonWorldRayPrefilterCallback = function(const body: pNewtonBody; const collision: PNewtonCollision; const userData: Pointer): LongWord; cdecl;
-PNewtonWorldRayPrefilterCallback = ^NewtonWorldRayPrefilterCallback;
-
-NewtonWorldRayFilterCallback = function(const body: pNewtonBody; const shapeHit: PNewtonCollision; const hitContact: pfloat; const hitNormal: pfloat; collisionID: int64; const userData: Pointer; intersectParam: dfloat): dfloat; cdecl;
-PNewtonWorldRayFilterCallback = ^NewtonWorldRayFilterCallback;
-
-NewtonOnAABBOverlap = function(const contact: PNewtonJoint; timestep: dfloat; threadIndex: Integer): Integer; cdecl;
-PNewtonOnAABBOverlap = ^NewtonOnAABBOverlap;
-
-NewtonContactsProcess = procedure(const contact: PNewtonJoint; timestep: dfloat; threadIndex: Integer); cdecl;
-PNewtonContactsProcess = ^NewtonContactsProcess;
-
-NewtonOnCompoundSubCollisionAABBOverlap = function(const contact: PNewtonJoint; timestep: dfloat; const body0: pNewtonBody; const collisionNode0: Pointer; const body1: pNewtonBody; const collisionNode1: Pointer; threadIndex: Integer): Integer; cdecl;
-PNewtonOnCompoundSubCollisionAABBOverlap = ^NewtonOnCompoundSubCollisionAABBOverlap;
-
-NewtonOnContactGeneration = function(const material: PNewtonMaterial; const body0: pNewtonBody; const collision0: PNewtonCollision; const body1: pNewtonBody; const collision1: PNewtonCollision; const contactBuffer: PNewtonUserContactPoint; maxCount: Integer; threadIndex: Integer): Integer; cdecl;
-PNewtonOnContactGeneration = ^NewtonOnContactGeneration;
-
-NewtonBodyIterator = function(const body: pNewtonBody; const userData: Pointer): Integer; cdecl;
-PNewtonBodyIterator = ^NewtonBodyIterator;
-
-NewtonJointIterator = procedure(const joint: PNewtonJoint; const userData: Pointer); cdecl;
-PNewtonJointIterator = ^NewtonJointIterator;
-
-NewtonCollisionIterator = procedure(const userData: Pointer; vertexCount: Integer; const faceArray: pfloat; faceId: Integer); cdecl;
-PNewtonCollisionIterator = ^NewtonCollisionIterator;
-
-NewtonBallCallback = procedure(const ball: PNewtonJoint; timestep: dfloat); cdecl;
-PNewtonBallCallback = ^NewtonBallCallback;
-
-NewtonHingeCallback = function(const hinge: PNewtonJoint; const desc: PNewtonHingeSliderUpdateDesc): LongWord; cdecl;
-PNewtonHingeCallback = ^NewtonHingeCallback;
-
-NewtonSliderCallback = function(const slider: PNewtonJoint; const desc: PNewtonHingeSliderUpdateDesc): LongWord; cdecl;
-PNewtonSliderCallback = ^NewtonSliderCallback;
-
-NewtonUniversalCallback = function(const universal: PNewtonJoint; const desc: PNewtonHingeSliderUpdateDesc): LongWord; cdecl;
-PNewtonUniversalCallback = ^NewtonUniversalCallback;
-
-NewtonCorkscrewCallback = function(const corkscrew: PNewtonJoint; const desc: PNewtonHingeSliderUpdateDesc): LongWord; cdecl;
-PNewtonCorkscrewCallback = ^NewtonCorkscrewCallback;
-
-NewtonUserBilateralCallback = procedure(const userJoint: PNewtonJoint; timestep: dfloat; threadIndex: Integer); cdecl;
-PNewtonUserBilateralCallback = ^NewtonUserBilateralCallback;
-
-NewtonUserBilateralGetInfoCallback = procedure(const userJoint: PNewtonJoint; const info: PNewtonJointRecord); cdecl;
-PNewtonUserBilateralGetInfoCallback = ^NewtonUserBilateralGetInfoCallback;
-
-NewtonConstraintDestructor = procedure(const me: PNewtonJoint); cdecl;
-PNewtonConstraintDestructor = ^NewtonConstraintDestructor;
-
-NewtonJobTask = procedure(const world: PNewtonWorld; const userData: Pointer; threadIndex: Integer); cdecl;
-PNewtonJobTask = ^NewtonJobTask;
-
-NewtonReportProgress = function(normalizedProgressPercent: dfloat; const userData: Pointer): Integer; cdecl;
-PNewtonReportProgress = ^NewtonReportProgress;
-
- // **********************************************************************************************
- //
- // world control functions
- //
- // **********************************************************************************************
-function NewtonWorldGetVersion (): Integer; cdecl; external NEWTON_API;
-function NewtonWorldFloatSize (): Integer; cdecl; external NEWTON_API;
-function NewtonGetMemoryUsed (): Integer; cdecl; external NEWTON_API;
-procedure NewtonSetMemorySystem (malloc: NewtonAllocMemory; free: NewtonFreeMemory); cdecl; external NEWTON_API;
-function NewtonCreate (): PNewtonWorld; cdecl; external NEWTON_API;
-procedure NewtonDestroy (const newtonWorld: PNewtonWorld); cdecl; external NEWTON_API;
-procedure NewtonDestroyAllBodies (const newtonWorld: PNewtonWorld); cdecl; external NEWTON_API;
-function NewtonGetPostUpdateCallback (const newtonWorld: PNewtonWorld): PNewtonPostUpdateCallback; cdecl; external NEWTON_API;
-procedure NewtonSetPostUpdateCallback (const newtonWorld: PNewtonWorld; callback: NewtonPostUpdateCallback); cdecl; external NEWTON_API;
-function NewtonAlloc (sizeInBytes: Integer): Pointer; cdecl; external NEWTON_API;
-procedure NewtonFree (const ptr: Pointer); cdecl; external NEWTON_API;
-procedure NewtonLoadPlugins (const newtonWorld: PNewtonWorld; const plugInPath: pchar); cdecl; external NEWTON_API;
-procedure NewtonUnloadPlugins (const newtonWorld: PNewtonWorld); cdecl; external NEWTON_API;
-function NewtonCurrentPlugin (const newtonWorld: PNewtonWorld): Pointer; cdecl; external NEWTON_API;
-function NewtonGetFirstPlugin (const newtonWorld: PNewtonWorld): Pointer; cdecl; external NEWTON_API;
-function NewtonGetPreferedPlugin (const newtonWorld: PNewtonWorld): Pointer; cdecl; external NEWTON_API;
-function NewtonGetNextPlugin (const newtonWorld: PNewtonWorld; const plugin: Pointer): Pointer; cdecl; external NEWTON_API;
-function NewtonGetPluginString (const newtonWorld: PNewtonWorld; const plugin: Pointer): pchar; cdecl; external NEWTON_API;
-procedure NewtonSelectPlugin (const newtonWorld: PNewtonWorld; const plugin: Pointer); cdecl; external NEWTON_API;
-function NewtonGetContactMergeTolerance (const newtonWorld: PNewtonWorld): dfloat; cdecl; external NEWTON_API;
-procedure NewtonSetContactMergeTolerance (const newtonWorld: PNewtonWorld; tolerance: dfloat); cdecl; external NEWTON_API;
-procedure NewtonInvalidateCache (const newtonWorld: PNewtonWorld); cdecl; external NEWTON_API;
-procedure NewtonSetSolverIterations (const newtonWorld: PNewtonWorld; model: Integer); cdecl; external NEWTON_API;
-function NewtonGetSolverIterations (const newtonWorld: PNewtonWorld): Integer; cdecl; external NEWTON_API;
-procedure NewtonSetParallelSolverOnLargeIsland (const newtonWorld: PNewtonWorld; mode: Integer); cdecl; external NEWTON_API;
-function NewtonGetParallelSolverOnLargeIsland (const newtonWorld: PNewtonWorld): Integer; cdecl; external NEWTON_API;
-function NewtonGetBroadphaseAlgorithm (const newtonWorld: PNewtonWorld): Integer; cdecl; external NEWTON_API;
-procedure NewtonSelectBroadphaseAlgorithm (const newtonWorld: PNewtonWorld; algorithmType: Integer); cdecl; external NEWTON_API;
-procedure NewtonResetBroadphase (const newtonWorld: PNewtonWorld); cdecl; external NEWTON_API;
-procedure NewtonUpdate (const newtonWorld: PNewtonWorld; timestep: dfloat); cdecl; external NEWTON_API;
-procedure NewtonUpdateAsync (const newtonWorld: PNewtonWorld; timestep: dfloat); cdecl; external NEWTON_API;
-procedure NewtonWaitForUpdateToFinish (const newtonWorld: PNewtonWorld); cdecl; external NEWTON_API;
-function NewtonGetNumberOfSubsteps (const newtonWorld: PNewtonWorld): Integer; cdecl; external NEWTON_API;
-procedure NewtonSetNumberOfSubsteps (const newtonWorld: PNewtonWorld; subSteps: Integer); cdecl; external NEWTON_API;
-function NewtonGetLastUpdateTime (const newtonWorld: PNewtonWorld): dfloat; cdecl; external NEWTON_API;
-procedure NewtonSerializeToFile (const newtonWorld: PNewtonWorld; const filename: pchar; bodyCallback: NewtonOnBodySerializationCallback; const bodyUserData: Pointer); cdecl; external NEWTON_API;
-procedure NewtonDeserializeFromFile (const newtonWorld: PNewtonWorld; const filename: pchar; bodyCallback: NewtonOnBodyDeserializationCallback; const bodyUserData: Pointer); cdecl; external NEWTON_API;
-procedure NewtonSerializeScene (const newtonWorld: PNewtonWorld; bodyCallback: NewtonOnBodySerializationCallback; const bodyUserData: Pointer; serializeCallback: NewtonSerializeCallback; const serializeHandle: Pointer); cdecl; external NEWTON_API;
-procedure NewtonDeserializeScene (const newtonWorld: PNewtonWorld; bodyCallback: NewtonOnBodyDeserializationCallback; const bodyUserData: Pointer; serializeCallback: NewtonDeserializeCallback; const serializeHandle: Pointer); cdecl; external NEWTON_API;
-function NewtonFindSerializedBody (const newtonWorld: PNewtonWorld; bodySerializedID: Integer): pNewtonBody; cdecl; external NEWTON_API;
-procedure NewtonSetJointSerializationCallbacks (const newtonWorld: PNewtonWorld; serializeJoint: NewtonOnJointSerializationCallback; deserializeJoint: NewtonOnJointDeserializationCallback); cdecl; external NEWTON_API;
-procedure NewtonGetJointSerializationCallbacks (const newtonWorld: PNewtonWorld; const serializeJoint: NewtonOnJointSerializationCallback; const deserializeJoint: NewtonOnJointDeserializationCallback); cdecl; external NEWTON_API;
-procedure NewtonWorldCriticalSectionLock (const newtonWorld: PNewtonWorld; threadIndex: Integer); cdecl; external NEWTON_API;
-procedure NewtonWorldCriticalSectionUnlock (const newtonWorld: PNewtonWorld); cdecl; external NEWTON_API;
-procedure NewtonSetThreadsCount (const newtonWorld: PNewtonWorld; threads: Integer); cdecl; external NEWTON_API;
-function NewtonGetThreadsCount (const newtonWorld: PNewtonWorld): Integer; cdecl; external NEWTON_API;
-function NewtonGetMaxThreadsCount (const newtonWorld: PNewtonWorld): Integer; cdecl; external NEWTON_API;
-procedure NewtonDispachThreadJob (const newtonWorld: PNewtonWorld; task: NewtonJobTask; const usedData: Pointer; const functionName: pchar); cdecl; external NEWTON_API;
-procedure NewtonSyncThreadJobs (const newtonWorld: PNewtonWorld); cdecl; external NEWTON_API;
-function NewtonAtomicAdd (const ptr: Pinteger; value: Integer): Integer; cdecl; external NEWTON_API;
-function NewtonAtomicSwap (const ptr: Pinteger; value: Integer): Integer; cdecl; external NEWTON_API;
-procedure NewtonYield (); cdecl; external NEWTON_API;
-procedure NewtonSetIslandUpdateEvent (const newtonWorld: PNewtonWorld; islandUpdate: NewtonIslandUpdate); cdecl; external NEWTON_API;
-procedure NewtonWorldForEachJointDo (const newtonWorld: PNewtonWorld; callback: NewtonJointIterator; const userData: Pointer); cdecl; external NEWTON_API;
-procedure NewtonWorldForEachBodyInAABBDo (const newtonWorld: PNewtonWorld; const p0: pfloat; const p1: pfloat; callback: NewtonBodyIterator; const userData: Pointer); cdecl; external NEWTON_API;
-procedure NewtonWorldSetUserData (const newtonWorld: PNewtonWorld; const userData: Pointer); cdecl; external NEWTON_API;
-function NewtonWorldGetUserData (const newtonWorld: PNewtonWorld): Pointer; cdecl; external NEWTON_API;
-function NewtonWorldAddListener (const newtonWorld: PNewtonWorld; const nameId: pchar; const listenerUserData: Pointer): Pointer; cdecl; external NEWTON_API;
-function NewtonWorldGetListener (const newtonWorld: PNewtonWorld; const nameId: pchar): Pointer; cdecl; external NEWTON_API;
-procedure NewtonWorldListenerSetDebugCallback (const newtonWorld: PNewtonWorld; const listener: Pointer; callback: NewtonWorldListenerDebugCallback); cdecl; external NEWTON_API;
-procedure NewtonWorldListenerSetPostStepCallback (const newtonWorld: PNewtonWorld; const listener: Pointer; callback: NewtonWorldUpdateListenerCallback); cdecl; external NEWTON_API;
-procedure NewtonWorldListenerSetPreUpdateCallback (const newtonWorld: PNewtonWorld; const listener: Pointer; callback: NewtonWorldUpdateListenerCallback); cdecl; external NEWTON_API;
-procedure NewtonWorldListenerSetPostUpdateCallback (const newtonWorld: PNewtonWorld; const listener: Pointer; callback: NewtonWorldUpdateListenerCallback); cdecl; external NEWTON_API;
-procedure NewtonWorldListenerSetDestructorCallback (const newtonWorld: PNewtonWorld; const listener: Pointer; callback: NewtonWorldDestroyListenerCallback); cdecl; external NEWTON_API;
-procedure NewtonWorldListenerSetBodyDestroyCallback (const newtonWorld: PNewtonWorld; const listener: Pointer; callback: NewtonWorldListenerBodyDestroyCallback); cdecl; external NEWTON_API;
-procedure NewtonWorldListenerDebug (const newtonWorld: PNewtonWorld; const context: Pointer); cdecl; external NEWTON_API;
-function NewtonWorldGetListenerUserData (const newtonWorld: PNewtonWorld; const listener: Pointer): Pointer; cdecl; external NEWTON_API;
-function NewtonWorldListenerGetBodyDestroyCallback (const newtonWorld: PNewtonWorld; const listener: Pointer): PNewtonWorldListenerBodyDestroyCallback; cdecl; external NEWTON_API;
-procedure NewtonWorldSetDestructorCallback (const newtonWorld: PNewtonWorld; destructorparam: NewtonWorldDestructorCallback); cdecl; external NEWTON_API;
-function NewtonWorldGetDestructorCallback (const newtonWorld: PNewtonWorld): PNewtonWorldDestructorCallback; cdecl; external NEWTON_API;
-procedure NewtonWorldSetCollisionConstructorDestructorCallback (const newtonWorld: PNewtonWorld; constructorparam: NewtonCollisionCopyConstructionCallback; destructorparam: NewtonCollisionDestructorCallback); cdecl; external NEWTON_API;
-procedure NewtonWorldSetCreateDestroyContactCallback (const newtonWorld: PNewtonWorld; createContact: NewtonCreateContactCallback; destroyContact: NewtonDestroyContactCallback); cdecl; external NEWTON_API;
-procedure NewtonWorldRayCast (const newtonWorld: PNewtonWorld; const p0: pfloat; const p1: pfloat; filter: NewtonWorldRayFilterCallback; const userData: Pointer; prefilter: NewtonWorldRayPrefilterCallback; threadIndex: Integer); cdecl; external NEWTON_API;
-function NewtonWorldConvexCast (const newtonWorld: PNewtonWorld; const matrix: pfloat; const target: pfloat; const shape: PNewtonCollision; const param: pfloat; const userData: Pointer; prefilter: NewtonWorldRayPrefilterCallback; const info: PNewtonWorldConvexCastReturnInfo; maxContactsCount: Integer; threadIndex: Integer): Integer; cdecl; external NEWTON_API;
-function NewtonWorldCollide (const newtonWorld: PNewtonWorld; const matrix: pfloat; const shape: PNewtonCollision; const userData: Pointer; prefilter: NewtonWorldRayPrefilterCallback; const info: PNewtonWorldConvexCastReturnInfo; maxContactsCount: Integer; threadIndex: Integer): Integer; cdecl; external NEWTON_API;
-	
-// world utility functions
-function NewtonWorldGetBodyCount (const newtonWorld: PNewtonWorld): Integer; cdecl; external NEWTON_API;
-function NewtonWorldGetConstraintCount (const newtonWorld: PNewtonWorld): Integer; cdecl; external NEWTON_API;
-function NewtonWorldFindJoint (const body0: pNewtonBody; const body1: pNewtonBody): PNewtonJoint; cdecl; external NEWTON_API;
-
-// **********************************************************************************************
-//
-// Simulation islands 
-//
-// **********************************************************************************************
-function NewtonIslandGetBody (const island: Pointer; bodyIndex: Integer): pNewtonBody; cdecl; external NEWTON_API;
-procedure NewtonIslandGetBodyAABB (const island: Pointer; bodyIndex: Integer; const p0: pfloat; const p1: pfloat); cdecl; external NEWTON_API;
-
-// **********************************************************************************************
-//
-// Physics Material Section
-//
-// **********************************************************************************************
-function NewtonMaterialCreateGroupID (const newtonWorld: PNewtonWorld): Integer; cdecl; external NEWTON_API;
-function NewtonMaterialGetDefaultGroupID (const newtonWorld: PNewtonWorld): Integer; cdecl; external NEWTON_API;
-procedure NewtonMaterialDestroyAllGroupID (const newtonWorld: PNewtonWorld); cdecl; external NEWTON_API;
-
-// material definitions that can not be overwritten in function callback
-function NewtonMaterialGetUserData (const newtonWorld: PNewtonWorld; id0: Integer; id1: Integer): Pointer; cdecl; external NEWTON_API;
-procedure NewtonMaterialSetSurfaceThickness (const newtonWorld: PNewtonWorld; id0: Integer; id1: Integer; thickness: dfloat); cdecl; external NEWTON_API;
-
-//	deprecated, not longer continue collision is set on the material  	
-//	NEWTON_API void NewtonMaterialSetContinuousCollisionMode (const NewtonWorld* const newtonWorld, int id0, int id1, int state);
-
-procedure NewtonMaterialSetCallbackUserData (const newtonWorld: PNewtonWorld; id0: Integer; id1: Integer; const userData: Pointer); cdecl; external NEWTON_API;
-procedure NewtonMaterialSetContactGenerationCallback (const newtonWorld: PNewtonWorld; id0: Integer; id1: Integer; contactGeneration: NewtonOnContactGeneration); cdecl; external NEWTON_API;
-procedure NewtonMaterialSetCompoundCollisionCallback (const newtonWorld: PNewtonWorld; id0: Integer; id1: Integer; compoundAabbOverlap: NewtonOnCompoundSubCollisionAABBOverlap); cdecl; external NEWTON_API;
-procedure NewtonMaterialSetCollisionCallback (const newtonWorld: PNewtonWorld; id0: Integer; id1: Integer; aabbOverlap: NewtonOnAABBOverlap; process: NewtonContactsProcess); cdecl; external NEWTON_API;
-procedure NewtonMaterialSetDefaultSoftness (const newtonWorld: PNewtonWorld; id0: Integer; id1: Integer; value: dfloat); cdecl; external NEWTON_API;
-procedure NewtonMaterialSetDefaultElasticity (const newtonWorld: PNewtonWorld; id0: Integer; id1: Integer; elasticCoef: dfloat); cdecl; external NEWTON_API;
-procedure NewtonMaterialSetDefaultCollidable (const newtonWorld: PNewtonWorld; id0: Integer; id1: Integer; state: Integer); cdecl; external NEWTON_API;
-procedure NewtonMaterialSetDefaultFriction (const newtonWorld: PNewtonWorld; id0: Integer; id1: Integer; staticFriction: dfloat; kineticFriction: dfloat); cdecl; external NEWTON_API;
-procedure NewtonMaterialJointResetIntraJointCollision (const newtonWorld: PNewtonWorld; id0: Integer; id1: Integer); cdecl; external NEWTON_API;
-procedure NewtonMaterialJointResetSelftJointCollision (const newtonWorld: PNewtonWorld; id0: Integer; id1: Integer); cdecl; external NEWTON_API;
-function NewtonWorldGetFirstMaterial (const newtonWorld: PNewtonWorld): PNewtonMaterial; cdecl; external NEWTON_API;
-function NewtonWorldGetNextMaterial (const newtonWorld: PNewtonWorld; const material: PNewtonMaterial): PNewtonMaterial; cdecl; external NEWTON_API;
-function NewtonWorldGetFirstBody (const newtonWorld: PNewtonWorld): pNewtonBody; cdecl; external NEWTON_API;
-function NewtonWorldGetNextBody (const newtonWorld: PNewtonWorld; const curBody: pNewtonBody): pNewtonBody; cdecl; external NEWTON_API;
-
-
-// **********************************************************************************************
-//
-// Physics Contact control functions
-//
-// **********************************************************************************************
-function NewtonMaterialGetMaterialPairUserData (const material: PNewtonMaterial): Pointer; cdecl; external NEWTON_API;
-function NewtonMaterialGetContactFaceAttribute (const material: PNewtonMaterial): LongWord; cdecl; external NEWTON_API;
-function NewtonMaterialGetBodyCollidingShape (const material: PNewtonMaterial; const body: pNewtonBody): PNewtonCollision; cdecl; external NEWTON_API;
-function NewtonMaterialGetContactNormalSpeed (const material: PNewtonMaterial): dfloat; cdecl; external NEWTON_API;
-procedure NewtonMaterialGetContactForce (const material: PNewtonMaterial; const body: pNewtonBody; const force: pfloat); cdecl; external NEWTON_API;
-procedure NewtonMaterialGetContactPositionAndNormal (const material: PNewtonMaterial; const body: pNewtonBody; const posit: pfloat; const normal: pfloat); cdecl; external NEWTON_API;
-procedure NewtonMaterialGetContactTangentDirections (const material: PNewtonMaterial; const body: pNewtonBody; const dir0: pfloat; const dir1: pfloat); cdecl; external NEWTON_API;
-function NewtonMaterialGetContactTangentSpeed (const material: PNewtonMaterial; index: Integer): dfloat; cdecl; external NEWTON_API;
-function NewtonMaterialGetContactMaxNormalImpact (const material: PNewtonMaterial): dfloat; cdecl; external NEWTON_API;
-function NewtonMaterialGetContactMaxTangentImpact (const material: PNewtonMaterial; index: Integer): dfloat; cdecl; external NEWTON_API;
-function NewtonMaterialGetContactPenetration (const material: PNewtonMaterial): dfloat; cdecl; external NEWTON_API;
-procedure NewtonMaterialSetAsSoftContact (const material: PNewtonMaterial; relaxation: dfloat); cdecl; external NEWTON_API;
-procedure NewtonMaterialSetContactSoftness (const material: PNewtonMaterial; softness: dfloat); cdecl; external NEWTON_API;
-procedure NewtonMaterialSetContactThickness (const material: PNewtonMaterial; thickness: dfloat); cdecl; external NEWTON_API;
-procedure NewtonMaterialSetContactElasticity (const material: PNewtonMaterial; restitution: dfloat); cdecl; external NEWTON_API;
-procedure NewtonMaterialSetContactFrictionState (const material: PNewtonMaterial; state: Integer; index: Integer); cdecl; external NEWTON_API;
-procedure NewtonMaterialSetContactFrictionCoef (const material: PNewtonMaterial; staticFrictionCoef: dfloat; kineticFrictionCoef: dfloat; index: Integer); cdecl; external NEWTON_API;
-procedure NewtonMaterialSetContactNormalAcceleration (const material: PNewtonMaterial; accel: dfloat); cdecl; external NEWTON_API;
-procedure NewtonMaterialSetContactNormalDirection (const material: PNewtonMaterial; const directionVector: pfloat); cdecl; external NEWTON_API;
-procedure NewtonMaterialSetContactPosition (const material: PNewtonMaterial; const position: pfloat); cdecl; external NEWTON_API;
-procedure NewtonMaterialSetContactTangentFriction (const material: PNewtonMaterial; friction: dfloat; index: Integer); cdecl; external NEWTON_API;
-procedure NewtonMaterialSetContactTangentAcceleration (const material: PNewtonMaterial; accel: dfloat; index: Integer); cdecl; external NEWTON_API;
-procedure NewtonMaterialContactRotateTangentDirections (const material: PNewtonMaterial; const directionVector: pfloat); cdecl; external NEWTON_API;
-{}function NewtonMaterialGetContactPruningTolerance (const contactJoint: PNewtonJoint): dfloat; cdecl; external NEWTON_API;
-{}procedure NewtonMaterialSetContactPruningTolerance (const contactJoint: PNewtonJoint; tolerance: dfloat); cdecl; external NEWTON_API;
-
-// **********************************************************************************************
-//
-// convex collision primitives creation functions
-//
-// **********************************************************************************************
-function NewtonCreateNull (const newtonWorld: PNewtonWorld): PNewtonCollision; cdecl; external NEWTON_API;
-function NewtonCreateSphere (const newtonWorld: PNewtonWorld; radius: dfloat; shapeID: Integer; const offsetMatrix: pfloat): PNewtonCollision; cdecl; external NEWTON_API;
-function NewtonCreateBox (const newtonWorld: PNewtonWorld; dx: dfloat; dy: dfloat; dz: dfloat; shapeID: Integer; const offsetMatrix: pfloat): PNewtonCollision; cdecl; external NEWTON_API;
-function NewtonCreateCone (const newtonWorld: PNewtonWorld; radius: dfloat; height: dfloat; shapeID: Integer; const offsetMatrix: pfloat): PNewtonCollision; cdecl; external NEWTON_API;
-function NewtonCreateCapsule (const newtonWorld: PNewtonWorld; radius0: dfloat; radius1: dfloat; height: dfloat; shapeID: Integer; const offsetMatrix: pfloat): PNewtonCollision; cdecl; external NEWTON_API;
-function NewtonCreateCylinder (const newtonWorld: PNewtonWorld; radio0: dfloat; radio1: dfloat; height: dfloat; shapeID: Integer; const offsetMatrix: pfloat): PNewtonCollision; cdecl; external NEWTON_API;
-function NewtonCreateChamferCylinder (const newtonWorld: PNewtonWorld; radius: dfloat; height: dfloat; shapeID: Integer; const offsetMatrix: pfloat): PNewtonCollision; cdecl; external NEWTON_API;
-function NewtonCreateConvexHull (const newtonWorld: PNewtonWorld; count: Integer; const vertexCloud: pfloat; strideInBytes: Integer; tolerance: dfloat; shapeID: Integer; const offsetMatrix: pfloat): PNewtonCollision; cdecl; external NEWTON_API;
-function NewtonCreateConvexHullFromMesh (const newtonWorld: PNewtonWorld; const mesh: PNewtonMesh; tolerance: dfloat; shapeID: Integer): PNewtonCollision; cdecl; external NEWTON_API;
-function NewtonCollisionGetMode (const convexCollision: PNewtonCollision): Integer; cdecl; external NEWTON_API;
-procedure NewtonCollisionSetMode (const convexCollision: PNewtonCollision; mode: Integer); cdecl; external NEWTON_API;
-function NewtonConvexHullGetFaceIndices (const convexHullCollision: PNewtonCollision; face: Integer; const faceIndices: Pinteger): Integer; cdecl; external NEWTON_API;
-function NewtonConvexHullGetVertexData (const convexHullCollision: PNewtonCollision; const vertexData: Pfloat; strideInBytes: Pinteger): Integer; cdecl; external NEWTON_API;
-function NewtonConvexCollisionCalculateVolume (const convexCollision: PNewtonCollision): dfloat; cdecl; external NEWTON_API;
-procedure NewtonConvexCollisionCalculateInertialMatrix (const convexCollision: PNewtonCollision; const inertia: pfloat; const origin: pfloat); cdecl; external NEWTON_API;
-function NewtonConvexCollisionCalculateBuoyancyVolume (const convexCollision: PNewtonCollision; const matrix: pfloat; const fluidPlane: pfloat; const centerOfBuoyancy: pfloat): dfloat; cdecl; external NEWTON_API;
-function NewtonCollisionDataPointer (const convexCollision: PNewtonCollision): Pointer; cdecl; external NEWTON_API;
-
-// **********************************************************************************************
-//
-// compound collision primitives creation functions
-//
-// **********************************************************************************************
-function NewtonCreateCompoundCollision (const newtonWorld: PNewtonWorld; shapeID: Integer): PNewtonCollision; cdecl; external NEWTON_API;
-function NewtonCreateCompoundCollisionFromMesh (const newtonWorld: PNewtonWorld; const mesh: PNewtonMesh; hullTolerance: dfloat; shapeID: Integer; subShapeID: Integer): PNewtonCollision; cdecl; external NEWTON_API;
-procedure NewtonCompoundCollisionBeginAddRemove (const compoundCollision: PNewtonCollision); cdecl; external NEWTON_API;
-function NewtonCompoundCollisionAddSubCollision (const compoundCollision: PNewtonCollision; const convexCollision: PNewtonCollision): Pointer; cdecl; external NEWTON_API;
-procedure NewtonCompoundCollisionRemoveSubCollision (const compoundCollision: PNewtonCollision; const collisionNode: Pointer); cdecl; external NEWTON_API;
-procedure NewtonCompoundCollisionRemoveSubCollisionByIndex (const compoundCollision: PNewtonCollision; nodeIndex: Integer); cdecl; external NEWTON_API;
-procedure NewtonCompoundCollisionSetSubCollisionMatrix (const compoundCollision: PNewtonCollision; const collisionNode: Pointer; const matrix: pfloat); cdecl; external NEWTON_API;
-procedure NewtonCompoundCollisionEndAddRemove (const compoundCollision: PNewtonCollision); cdecl; external NEWTON_API;
-function NewtonCompoundCollisionGetFirstNode (const compoundCollision: PNewtonCollision): Pointer; cdecl; external NEWTON_API;
-function NewtonCompoundCollisionGetNextNode (const compoundCollision: PNewtonCollision; const collisionNode: Pointer): Pointer; cdecl; external NEWTON_API;
-function NewtonCompoundCollisionGetNodeByIndex (const compoundCollision: PNewtonCollision; index: Integer): Pointer; cdecl; external NEWTON_API;
-function NewtonCompoundCollisionGetNodeIndex (const compoundCollision: PNewtonCollision; const collisionNode: Pointer): Integer; cdecl; external NEWTON_API;
-function NewtonCompoundCollisionGetCollisionFromNode (const compoundCollision: PNewtonCollision; const collisionNode: Pointer): PNewtonCollision; cdecl; external NEWTON_API;
-
-// **********************************************************************************************
-//
-// Fractured compound collision primitives interface
-//
-// **********************************************************************************************
-function NewtonCreateFracturedCompoundCollision (const newtonWorld: PNewtonWorld; const solidMesh: PNewtonMesh; shapeID: Integer; fracturePhysicsMaterialID: Integer; pointcloudCount: Integer; const vertexCloud: pfloat; strideInBytes: Integer; materialID: Integer; const textureMatrix: pfloat; regenerateMainMeshCallback: NewtonFractureCompoundCollisionReconstructMainMeshCallBack; emitFracturedCompound: NewtonFractureCompoundCollisionOnEmitCompoundFractured; emitFracfuredChunk: NewtonFractureCompoundCollisionOnEmitChunk): PNewtonCollision; cdecl; external NEWTON_API;
-function NewtonFracturedCompoundPlaneClip (const fracturedCompound: PNewtonCollision; const plane: pfloat): PNewtonCollision; cdecl; external NEWTON_API;
-procedure NewtonFracturedCompoundSetCallbacks (const fracturedCompound: PNewtonCollision; regenerateMainMeshCallback: NewtonFractureCompoundCollisionReconstructMainMeshCallBack; emitFracturedCompound: NewtonFractureCompoundCollisionOnEmitCompoundFractured; emitFracfuredChunk: NewtonFractureCompoundCollisionOnEmitChunk); cdecl; external NEWTON_API;
-function NewtonFracturedCompoundIsNodeFreeToDetach (const fracturedCompound: PNewtonCollision; const collisionNode: Pointer): Integer; cdecl; external NEWTON_API;
-function NewtonFracturedCompoundNeighborNodeList (const fracturedCompound: PNewtonCollision; const collisionNode: Pointer; const list: PPointer; maxCount: Integer): Integer; cdecl; external NEWTON_API;
-function NewtonFracturedCompoundGetMainMesh (const fracturedCompound: PNewtonCollision): PNewtonFracturedCompoundMeshPart; cdecl; external NEWTON_API;
-function NewtonFracturedCompoundGetFirstSubMesh (const fracturedCompound: PNewtonCollision): PNewtonFracturedCompoundMeshPart; cdecl; external NEWTON_API;
-function NewtonFracturedCompoundGetNextSubMesh (const fracturedCompound: PNewtonCollision; const subMesh: PNewtonFracturedCompoundMeshPart): PNewtonFracturedCompoundMeshPart; cdecl; external NEWTON_API;
-function NewtonFracturedCompoundCollisionGetVertexCount (const fracturedCompound: PNewtonCollision; const meshOwner: PNewtonFracturedCompoundMeshPart): Integer; cdecl; external NEWTON_API;
-function NewtonFracturedCompoundCollisionGetVertexPositions (const fracturedCompound: PNewtonCollision; const meshOwner: PNewtonFracturedCompoundMeshPart): pfloat; cdecl; external NEWTON_API;
-function NewtonFracturedCompoundCollisionGetVertexNormals (const fracturedCompound: PNewtonCollision; const meshOwner: PNewtonFracturedCompoundMeshPart): pfloat; cdecl; external NEWTON_API;
-function NewtonFracturedCompoundCollisionGetVertexUVs (const fracturedCompound: PNewtonCollision; const meshOwner: PNewtonFracturedCompoundMeshPart): pfloat; cdecl; external NEWTON_API;
-function NewtonFracturedCompoundMeshPartGetIndexStream (const fracturedCompound: PNewtonCollision; const meshOwner: PNewtonFracturedCompoundMeshPart; const segment: Pointer; const index: Pinteger): Integer; cdecl; external NEWTON_API;
-function NewtonFracturedCompoundMeshPartGetFirstSegment (const fractureCompoundMeshPart: PNewtonFracturedCompoundMeshPart): Pointer; cdecl; external NEWTON_API;
-function NewtonFracturedCompoundMeshPartGetNextSegment (const fractureCompoundMeshSegment: Pointer): Pointer; cdecl; external NEWTON_API;
-function NewtonFracturedCompoundMeshPartGetMaterial (const fractureCompoundMeshSegment: Pointer): Integer; cdecl; external NEWTON_API;
-function NewtonFracturedCompoundMeshPartGetIndexCount (const fractureCompoundMeshSegment: Pointer): Integer; cdecl; external NEWTON_API;
-
-// **********************************************************************************************
-//
-// scene collision are static compound collision that can take polygonal static collisions
-//
-// **********************************************************************************************
-function NewtonCreateSceneCollision (const newtonWorld: PNewtonWorld; shapeID: Integer): PNewtonCollision; cdecl; external NEWTON_API;
-procedure NewtonSceneCollisionBeginAddRemove (const sceneCollision: PNewtonCollision); cdecl; external NEWTON_API;
-function NewtonSceneCollisionAddSubCollision (const sceneCollision: PNewtonCollision; const collision: PNewtonCollision): Pointer; cdecl; external NEWTON_API;
-procedure NewtonSceneCollisionRemoveSubCollision (const compoundCollision: PNewtonCollision; const collisionNode: Pointer); cdecl; external NEWTON_API;
-procedure NewtonSceneCollisionRemoveSubCollisionByIndex (const sceneCollision: PNewtonCollision; nodeIndex: Integer); cdecl; external NEWTON_API;
-procedure NewtonSceneCollisionSetSubCollisionMatrix (const sceneCollision: PNewtonCollision; const collisionNode: Pointer; const matrix: pfloat); cdecl; external NEWTON_API;
-procedure NewtonSceneCollisionEndAddRemove (const sceneCollision: PNewtonCollision); cdecl; external NEWTON_API;
-function NewtonSceneCollisionGetFirstNode (const sceneCollision: PNewtonCollision): Pointer; cdecl; external NEWTON_API;
-function NewtonSceneCollisionGetNextNode (const sceneCollision: PNewtonCollision; const collisionNode: Pointer): Pointer; cdecl; external NEWTON_API;
-function NewtonSceneCollisionGetNodeByIndex (const sceneCollision: PNewtonCollision; index: Integer): Pointer; cdecl; external NEWTON_API;
-function NewtonSceneCollisionGetNodeIndex (const sceneCollision: PNewtonCollision; const collisionNode: Pointer): Integer; cdecl; external NEWTON_API;
-function NewtonSceneCollisionGetCollisionFromNode (const sceneCollision: PNewtonCollision; const collisionNode: Pointer): PNewtonCollision; cdecl; external NEWTON_API;
-
-//  ***********************************************************************************************************
-//
-//	User Static mesh collision interface
-//
-// ***********************************************************************************************************
-function NewtonCreateUserMeshCollision (const newtonWorld: PNewtonWorld; const minBox: pfloat; const maxBox: pfloat; const userData: Pointer; collideCallback: NewtonUserMeshCollisionCollideCallback; rayHitCallback: NewtonUserMeshCollisionRayHitCallback; destroyCallback: NewtonUserMeshCollisionDestroyCallback; getInfoCallback: NewtonUserMeshCollisionGetCollisionInfo; getLocalAABBCallback: NewtonUserMeshCollisionAABBTest; facesInAABBCallback: NewtonUserMeshCollisionGetFacesInAABB; serializeCallback: NewtonOnUserCollisionSerializationCallback; shapeID: Integer): PNewtonCollision; cdecl; external NEWTON_API;
-function NewtonUserMeshCollisionContinuousOverlapTest (const collideDescData: PNewtonUserMeshCollisionCollideDesc; const continueCollisionHandle: Pointer; const minAabb: pfloat; const maxAabb: pfloat): Integer; cdecl; external NEWTON_API;
-	
-//  ***********************************************************************************************************
-//
-//	Collision serialization functions
-//
-// ***********************************************************************************************************
-function NewtonCreateCollisionFromSerialization (const newtonWorld: PNewtonWorld; deserializeFunction: NewtonDeserializeCallback; const serializeHandle: Pointer): PNewtonCollision; cdecl; external NEWTON_API;
-procedure NewtonCollisionSerialize (const newtonWorld: PNewtonWorld; const collision: PNewtonCollision; serializeFunction: NewtonSerializeCallback; const serializeHandle: Pointer); cdecl; external NEWTON_API;
-procedure NewtonCollisionGetInfo (const collision: PNewtonCollision; const collisionInfo: PNewtonCollisionInfoRecord); cdecl; external NEWTON_API;
-
-// **********************************************************************************************
-//
-// Static collision shapes functions
-//
-// **********************************************************************************************
-function NewtonCreateHeightFieldCollision (const newtonWorld: PNewtonWorld; width: Integer; height: Integer; gridsDiagonals: Integer; elevationdatType: Integer; const elevationMap: Pointer; const attributeMap: pchar; verticalScale: dfloat; horizontalScale_x: dfloat; horizontalScale_z: dfloat; shapeID: Integer): PNewtonCollision; cdecl; external NEWTON_API;
-procedure NewtonHeightFieldSetUserRayCastCallback (const heightfieldCollision: PNewtonCollision; rayHitCallback: NewtonHeightFieldRayCastCallback); cdecl; external NEWTON_API;
-procedure NewtonHeightFieldSetHorizontalDisplacement(heightfieldCollision : PNewtonCollision; horizontalMap : Pword; scale : dFloat); cdecl; external NEWTON_API;
-function NewtonCreateTreeCollision (const newtonWorld: PNewtonWorld; shapeID: Integer): PNewtonCollision; cdecl; external NEWTON_API;
-function NewtonCreateTreeCollisionFromMesh (const newtonWorld: PNewtonWorld; const mesh: PNewtonMesh; shapeID: Integer): PNewtonCollision; cdecl; external NEWTON_API;
-procedure NewtonTreeCollisionSetUserRayCastCallback (const treeCollision: PNewtonCollision; rayHitCallback: NewtonCollisionTreeRayCastCallback); cdecl; external NEWTON_API;
-procedure NewtonTreeCollisionBeginBuild (const treeCollision: PNewtonCollision); cdecl; external NEWTON_API;
-procedure NewtonTreeCollisionAddFace (const treeCollision: PNewtonCollision; vertexCount: Integer; const vertexPtr: pfloat; strideInBytes: Integer; faceAttribute: Integer); cdecl; external NEWTON_API;
-procedure NewtonTreeCollisionEndBuild (const treeCollision: PNewtonCollision; optimize: Integer); cdecl; external NEWTON_API;
-function NewtonTreeCollisionGetFaceAttribute (const treeCollision: PNewtonCollision; const faceIndexArray: Pinteger; indexCount: Integer): Integer; cdecl; external NEWTON_API;
-procedure NewtonTreeCollisionSetFaceAttribute (const treeCollision: PNewtonCollision; const faceIndexArray: Pinteger; indexCount: Integer; attribute: Integer); cdecl; external NEWTON_API;
-procedure NewtonTreeCollisionForEachFace (const treeCollision: PNewtonCollision; forEachFaceCallback: NewtonTreeCollisionFaceCallback; const context: Pointer); cdecl; external NEWTON_API;
-function NewtonTreeCollisionGetVertexListTriangleListInAABB (const treeCollision: PNewtonCollision; const p0: pfloat; const p1: pfloat; const vertexArray: Pfloat; const vertexCount: Pinteger; const vertexStrideInBytes: Pinteger; const indexList: Pinteger; maxIndexCount: Integer; const faceAttribute: Pinteger): Integer; cdecl; external NEWTON_API;
-procedure NewtonStaticCollisionSetDebugCallback (const staticCollision: PNewtonCollision; userCallback: NewtonTreeCollisionCallback); cdecl; external NEWTON_API;
-
-// **********************************************************************************************
-//
-// General purpose collision library functions
-//
-// **********************************************************************************************
-function NewtonCollisionCreateInstance (const collision: PNewtonCollision): PNewtonCollision; cdecl; external NEWTON_API;
-function NewtonCollisionGetType (const collision: PNewtonCollision): Integer; cdecl; external NEWTON_API;
-function NewtonCollisionIsConvexShape (const collision: PNewtonCollision): Integer; cdecl; external NEWTON_API;
-function NewtonCollisionIsStaticShape (const collision: PNewtonCollision): Integer; cdecl; external NEWTON_API;
-procedure NewtonCollisionSetUserData (const collision: PNewtonCollision; const userData: Pointer); cdecl; external NEWTON_API;
-function NewtonCollisionGetUserData (const collision: PNewtonCollision): Pointer; cdecl; external NEWTON_API;
-procedure NewtonCollisionSetUserID (const collision: PNewtonCollision; id: int64); cdecl; external NEWTON_API;
-function NewtonCollisionGetUserID (const collision: PNewtonCollision): int64; cdecl; external NEWTON_API;
-procedure NewtonCollisionGetMaterial (const collision: PNewtonCollision; const userData: PNewtonCollisionMaterial); cdecl; external NEWTON_API;
-procedure NewtonCollisionSetMaterial (const collision: PNewtonCollision; const userData: PNewtonCollisionMaterial); cdecl; external NEWTON_API;
-function NewtonCollisionGetSubCollisionHandle (const collision: PNewtonCollision): Pointer; cdecl; external NEWTON_API;
-function NewtonCollisionGetParentInstance (const collision: PNewtonCollision): PNewtonCollision; cdecl; external NEWTON_API;
-procedure NewtonCollisionSetMatrix (const collision: PNewtonCollision; const matrix: pfloat); cdecl; external NEWTON_API;
-procedure NewtonCollisionGetMatrix (const collision: PNewtonCollision; const matrix: pfloat); cdecl; external NEWTON_API;
-procedure NewtonCollisionSetScale (const collision: PNewtonCollision; scaleX: dfloat; scaleY: dfloat; scaleZ: dfloat); cdecl; external NEWTON_API;
-procedure NewtonCollisionGetScale (const collision: PNewtonCollision; const scaleX: pfloat; const scaleY: pfloat; const scaleZ: pfloat); cdecl; external NEWTON_API;
-procedure NewtonDestroyCollision (const collision: PNewtonCollision); cdecl; external NEWTON_API;
-function NewtonCollisionGetSkinThickness (const collision: PNewtonCollision): dfloat; cdecl; external NEWTON_API;
-procedure NewtonCollisionSetSkinThickness (const collision: PNewtonCollision; thickness: dfloat); cdecl; external NEWTON_API;
-function NewtonCollisionIntersectionTest (const newtonWorld: PNewtonWorld; const collisionA: PNewtonCollision; const matrixA: pfloat; const collisionB: PNewtonCollision; const matrixB: pfloat; threadIndex: Integer): Integer; cdecl; external NEWTON_API;
-function NewtonCollisionPointDistance (const newtonWorld: PNewtonWorld; const point: pfloat; const collision: PNewtonCollision; const matrix: pfloat; const contact: pfloat; const normal: pfloat; threadIndex: Integer): Integer; cdecl; external NEWTON_API;
-function NewtonCollisionClosestPoint (const newtonWorld: PNewtonWorld; const collisionA: PNewtonCollision; const matrixA: pfloat; const collisionB: PNewtonCollision; const matrixB: pfloat; const contactA: pfloat; const contactB: pfloat; const normalAB: pfloat; threadIndex: Integer): Integer; cdecl; external NEWTON_API;
-function NewtonCollisionCollide (const newtonWorld: PNewtonWorld; maxSize: Integer; const collisionA: PNewtonCollision; const matrixA: pfloat; const collisionB: PNewtonCollision; const matrixB: pfloat; const contacts: pfloat; const normals: pfloat; const penetration: pfloat; const attributeA: Pint64; const attributeB: Pint64; threadIndex: Integer): Integer; cdecl; external NEWTON_API;
-function NewtonCollisionCollideContinue (const newtonWorld: PNewtonWorld; maxSize: Integer; timestep: dfloat; const collisionA: PNewtonCollision; const matrixA: pfloat; const velocA: pfloat; const omegaA: pfloat; const collisionB: PNewtonCollision; const matrixB: pfloat; const velocB: pfloat; const omegaB: pfloat; const timeOfImpact: pfloat; const contacts: pfloat; const normals: pfloat; const penetration: pfloat; const attributeA: Pint64; const attributeB: Pint64; threadIndex: Integer): Integer; cdecl; external NEWTON_API;
-procedure NewtonCollisionSupportVertex (const collision: PNewtonCollision; const dir: pfloat; const vertex: pfloat); cdecl; external NEWTON_API;
-function NewtonCollisionRayCast (const collision: PNewtonCollision; const p0: pfloat; const p1: pfloat; const normal: pfloat; const attribute: Pint64): dfloat; cdecl; external NEWTON_API;
-procedure NewtonCollisionCalculateAABB (const collision: PNewtonCollision; const matrix: pfloat; const p0: pfloat; const p1: pfloat); cdecl; external NEWTON_API;
-procedure NewtonCollisionForEachPolygonDo (const collision: PNewtonCollision; const matrix: pfloat; callback: NewtonCollisionIterator; const userData: Pointer); cdecl; external NEWTON_API;
-	
-// **********************************************************************************************
-// 
-// collision aggregates, are a collision node on eh broad phase the serve as the root nod for a collection of rigid bodies
-// that shared the property of being in close proximity all the time, they are similar to compound collision by the group bodies instead of collision instances
-// These are good for speeding calculation calculation of rag doll, Vehicles or contractions of rigid bodied lined by joints.
-// also for example if you know that many the life time of a group of bodies like the object on a house of a building will be localize to the confide of the building
-// then warping the bodies under an aggregate will reduce collision calculation of almost an order of magnitude.
-//
-// **********************************************************************************************
-function NewtonCollisionAggregateCreate (const world: PNewtonWorld): Pointer; cdecl; external NEWTON_API;
-procedure NewtonCollisionAggregateDestroy (const aggregate: Pointer); cdecl; external NEWTON_API;
-procedure NewtonCollisionAggregateAddBody (const aggregate: Pointer; const body: pNewtonBody); cdecl; external NEWTON_API;
-procedure NewtonCollisionAggregateRemoveBody (const aggregate: Pointer; const body: pNewtonBody); cdecl; external NEWTON_API;
-function NewtonCollisionAggregateGetSelfCollision (const aggregate: Pointer): Integer; cdecl; external NEWTON_API;
-procedure NewtonCollisionAggregateSetSelfCollision (const aggregate: Pointer; state: Integer); cdecl; external NEWTON_API;
-{ transforms utility functions }
-procedure NewtonSetEulerAngle (const eulersAngles: pfloat; const matrix: pfloat); cdecl; external NEWTON_API;
-procedure NewtonGetEulerAngle (const matrix: pfloat; const eulersAngles0: pfloat; const eulersAngles1: pfloat); cdecl; external NEWTON_API;
-function NewtonCalculateSpringDamperAcceleration (dt: dfloat; ks: dfloat; x: dfloat; kd: dfloat; s: dfloat): dfloat; cdecl; external NEWTON_API;
-{ body manipulation functions }
-function NewtonCreateDynamicBody (const newtonWorld: PNewtonWorld; const collision: PNewtonCollision; const matrix: pfloat): pNewtonBody; cdecl; external NEWTON_API;
-function NewtonCreateKinematicBody (const newtonWorld: PNewtonWorld; const collision: PNewtonCollision; const matrix: pfloat): pNewtonBody; cdecl; external NEWTON_API;
-function NewtonCreateAsymetricDynamicBody (const newtonWorld: PNewtonWorld; const collision: PNewtonCollision; const matrix: pfloat): pNewtonBody; cdecl; external NEWTON_API;
-procedure NewtonDestroyBody (const body: pNewtonBody); cdecl; external NEWTON_API;
-function NewtonBodyGetSimulationState (const body: pNewtonBody): Integer; cdecl; external NEWTON_API;
-procedure NewtonBodySetSimulationState (const bodyPtr: pNewtonBody; const state: Integer); cdecl; external NEWTON_API;
-function NewtonBodyGetType (const body: pNewtonBody): Integer; cdecl; external NEWTON_API;
-function NewtonBodyGetCollidable (const body: pNewtonBody): Integer; cdecl; external NEWTON_API;
-procedure NewtonBodySetCollidable (const body: pNewtonBody; collidableState: Integer); cdecl; external NEWTON_API;
-procedure NewtonBodyAddForce (const body: pNewtonBody; const force: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodyAddTorque (const body: pNewtonBody; const torque: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodyCalculateInverseDynamicsForce(body : PNewtonBody; timestep : dFloat; desiredVeloc : PdFloat; forceOut : PdFloat); cdecl; external NEWTON_API;
-procedure NewtonBodySetCentreOfMass (const body: pNewtonBody; const com: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodySetMassMatrix (const body: pNewtonBody; mass: dfloat; Ixx: dfloat; Iyy: dfloat; Izz: dfloat); cdecl; external NEWTON_API;
-procedure NewtonBodySetFullMassMatrix (const body: pNewtonBody; mass: dfloat; const inertiaMatrix: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodySetMassProperties (const body: pNewtonBody; mass: dfloat; const collision: PNewtonCollision); cdecl; external NEWTON_API;
-procedure NewtonBodySetMatrix (const body: pNewtonBody; const matrix: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodySetMatrixNoSleep (const body: pNewtonBody; const matrix: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodySetMatrixRecursive (const body: pNewtonBody; const matrix: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodySetMaterialGroupID (const body: pNewtonBody; id: Integer); cdecl; external NEWTON_API;
-procedure NewtonBodySetContinuousCollisionMode (const body: pNewtonBody; state: LongWord); cdecl; external NEWTON_API;
-procedure NewtonBodySetJointRecursiveCollision (const body: pNewtonBody; state: LongWord); cdecl; external NEWTON_API;
-procedure NewtonBodySetOmega (const body: pNewtonBody; const omega: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodySetOmegaNoSleep (const body: pNewtonBody; const omega: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodySetVelocity (const body: pNewtonBody; const velocity: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodySetVelocityNoSleep (const body: pNewtonBody; const velocity: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodySetForce (const body: pNewtonBody; const force: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodySetTorque (const body: pNewtonBody; const torque: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodySetLinearDamping (const body: pNewtonBody; linearDamp: dfloat); cdecl; external NEWTON_API;
-procedure NewtonBodySetAngularDamping (const body: pNewtonBody; const angularDamp: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodySetCollision (const body: pNewtonBody; const collision: PNewtonCollision); cdecl; external NEWTON_API;
-procedure NewtonBodySetCollisionScale (const body: pNewtonBody; scaleX: dfloat; scaleY: dfloat; scaleZ: dfloat); cdecl; external NEWTON_API;
-function NewtonBodyGetSleepState (const body: pNewtonBody): Integer; cdecl; external NEWTON_API;
-procedure NewtonBodySetSleepState (const body: pNewtonBody; state: Integer); cdecl; external NEWTON_API;
-function NewtonBodyGetAutoSleep (const body: pNewtonBody): Integer; cdecl; external NEWTON_API;
-procedure NewtonBodySetAutoSleep (const body: pNewtonBody; state: Integer); cdecl; external NEWTON_API;
-function NewtonBodyGetFreezeState (const body: pNewtonBody): Integer; cdecl; external NEWTON_API;
-procedure NewtonBodySetFreezeState (const body: pNewtonBody; state: Integer); cdecl; external NEWTON_API;
-function NewtonBodyGetGyroscopicTorque (const body: pNewtonBody): Integer; cdecl; external NEWTON_API;
-procedure NewtonBodySetGyroscopicTorque (const body: pNewtonBody; state: Integer); cdecl; external NEWTON_API;
-procedure NewtonBodySetDestructorCallback (const body: pNewtonBody; callback: NewtonBodyDestructor); cdecl; external NEWTON_API;
-function NewtonBodyGetDestructorCallback (const body: pNewtonBody): PNewtonBodyDestructor; cdecl; external NEWTON_API;
-procedure NewtonBodySetTransformCallback (const body: pNewtonBody; callback: NewtonSetTransform); cdecl; external NEWTON_API;
-function NewtonBodyGetTransformCallback (const body: pNewtonBody): PNewtonSetTransform; cdecl; external NEWTON_API;
-procedure NewtonBodySetForceAndTorqueCallback (const body: pNewtonBody; callback: NewtonApplyForceAndTorque); cdecl; external NEWTON_API;
-function NewtonBodyGetForceAndTorqueCallback (const body: pNewtonBody): PNewtonApplyForceAndTorque; cdecl; external NEWTON_API;
-function NewtonBodyGetID (const body: pNewtonBody): Integer; cdecl; external NEWTON_API;
-procedure NewtonBodySetUserData (const body: pNewtonBody; const userData: Pointer); cdecl; external NEWTON_API;
-function NewtonBodyGetUserData (const body: pNewtonBody): Pointer; cdecl; external NEWTON_API;
-function NewtonBodyGetWorld (const body: pNewtonBody): PNewtonWorld; cdecl; external NEWTON_API;
-function NewtonBodyGetCollision (const body: pNewtonBody): PNewtonCollision; cdecl; external NEWTON_API;
-function NewtonBodyGetMaterialGroupID (const body: pNewtonBody): Integer; cdecl; external NEWTON_API;
-function NewtonBodyGetSerializedID (const body: pNewtonBody): Integer; cdecl; external NEWTON_API;
-function NewtonBodyGetContinuousCollisionMode (const body: pNewtonBody): Integer; cdecl; external NEWTON_API;
-function NewtonBodyGetJointRecursiveCollision (const body: pNewtonBody): Integer; cdecl; external NEWTON_API;
-procedure NewtonBodyGetPosition (const body: pNewtonBody; const pos: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodyGetMatrix (const body: pNewtonBody; const matrix: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodyGetRotation (const body: pNewtonBody; const rotation: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodyGetMass (const body: pNewtonBody; mass: pfloat; const Ixx: pfloat; const Iyy: pfloat; const Izz: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodyGetInvMass (const body: pNewtonBody; const invMass: pfloat; const invIxx: pfloat; const invIyy: pfloat; const invIzz: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodyGetInertiaMatrix (const body: pNewtonBody; const inertiaMatrix: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodyGetInvInertiaMatrix (const body: pNewtonBody; const invInertiaMatrix: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodyGetOmega (const body: pNewtonBody; const vector: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodyGetVelocity (const body: pNewtonBody; const vector: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodyGetAlpha (const body: pNewtonBody; const vector: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodyGetAcceleration (const body: pNewtonBody; const vector: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodyGetForce (const body: pNewtonBody; const vector: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodyGetTorque (const body: pNewtonBody; const vector: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodyGetCentreOfMass (const body: pNewtonBody; const com: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodyGetPointVelocity (const body: pNewtonBody; const point: pfloat; const velocOut: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodyApplyImpulsePair (const body: pNewtonBody; const linearImpulse: pfloat; const angularImpulse: pfloat; timestep: dfloat); cdecl; external NEWTON_API;
-procedure NewtonBodyAddImpulse (const body: pNewtonBody; const pointDeltaVeloc: pfloat; const pointPosit: pfloat; timestep: dfloat); cdecl; external NEWTON_API;
-procedure NewtonBodyApplyImpulseArray (const body: pNewtonBody; impuleCount: Integer; strideInByte: Integer; const impulseArray: pfloat; const pointArray: pfloat; timestep: dfloat); cdecl; external NEWTON_API;
-procedure NewtonBodyIntegrateVelocity (const body: pNewtonBody; timestep: dfloat); cdecl; external NEWTON_API;
-function NewtonBodyGetLinearDamping (const body: pNewtonBody): dfloat; cdecl; external NEWTON_API;
-procedure NewtonBodyGetAngularDamping (const body: pNewtonBody; const vector: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBodyGetAABB (const body: pNewtonBody; const p0: pfloat; const p1: pfloat); cdecl; external NEWTON_API;
-function NewtonBodyGetFirstJoint (const body: pNewtonBody): PNewtonJoint; cdecl; external NEWTON_API;
-function NewtonBodyGetNextJoint (const body: pNewtonBody; const joint: PNewtonJoint): PNewtonJoint; cdecl; external NEWTON_API;
-function NewtonBodyGetFirstContactJoint (const body: pNewtonBody): PNewtonJoint; cdecl; external NEWTON_API;
-function NewtonBodyGetNextContactJoint (const body: pNewtonBody; const contactJoint: PNewtonJoint): PNewtonJoint; cdecl; external NEWTON_API;
-function NewtonBodyFindContact (const body0: pNewtonBody; const body1: pNewtonBody): PNewtonJoint; cdecl; external NEWTON_API;
-	
-// **********************************************************************************************
-//
-// contact joints interface
-//
-// **********************************************************************************************
-function NewtonContactJointGetFirstContact (const contactJoint: PNewtonJoint): Pointer; cdecl; external NEWTON_API;
-function NewtonContactJointGetNextContact (const contactJoint: PNewtonJoint; const contact: Pointer): Pointer; cdecl; external NEWTON_API;
-function NewtonContactJointGetContactCount (const contactJoint: PNewtonJoint): Integer; cdecl; external NEWTON_API;
-procedure NewtonContactJointRemoveContact (const contactJoint: PNewtonJoint; const contact: Pointer); cdecl; external NEWTON_API;
-function NewtonContactJointGetClosestDistance (const contactJoint: PNewtonJoint): dfloat; cdecl; external NEWTON_API;
-procedure NewtonContactJointResetSelftJointCollision (const contactJoint: PNewtonJoint); cdecl; external NEWTON_API;
-procedure NewtonContactJointResetIntraJointCollision (const contactJoint: PNewtonJoint); cdecl; external NEWTON_API;
-function NewtonContactGetMaterial (const contact: Pointer): PNewtonMaterial; cdecl; external NEWTON_API;
-function NewtonContactGetCollision0 (const contact: Pointer): PNewtonCollision; cdecl; external NEWTON_API;
-function NewtonContactGetCollision1 (const contact: Pointer): PNewtonCollision; cdecl; external NEWTON_API;
-function NewtonContactGetCollisionID0 (const contact: Pointer): Pointer; cdecl; external NEWTON_API;
-function NewtonContactGetCollisionID1 (const contact: Pointer): Pointer; cdecl; external NEWTON_API;
-	
-	
-// **********************************************************************************************
-//
-// Common joint functions
-//
-// **********************************************************************************************
-function NewtonJointGetUserData (const joint: PNewtonJoint): Pointer; cdecl; external NEWTON_API;
-procedure NewtonJointSetUserData (const joint: PNewtonJoint; const userData: Pointer); cdecl; external NEWTON_API;
-function NewtonJointGetBody0 (const joint: PNewtonJoint): pNewtonBody; cdecl; external NEWTON_API;
-function NewtonJointGetBody1 (const joint: PNewtonJoint): pNewtonBody; cdecl; external NEWTON_API;
-procedure NewtonJointGetInfo (const joint: PNewtonJoint; const info: PNewtonJointRecord); cdecl; external NEWTON_API;
-function NewtonJointGetCollisionState (const joint: PNewtonJoint): Integer; cdecl; external NEWTON_API;
-procedure NewtonJointSetCollisionState (const joint: PNewtonJoint; state: Integer); cdecl; external NEWTON_API;
-function NewtonJointGetStiffness (const joint: PNewtonJoint): dfloat; cdecl; external NEWTON_API;
-procedure NewtonJointSetStiffness (const joint: PNewtonJoint; state: dfloat); cdecl; external NEWTON_API;
-procedure NewtonDestroyJoint (const newtonWorld: PNewtonWorld; const joint: PNewtonJoint); cdecl; external NEWTON_API;
-procedure NewtonJointSetDestructor (const joint: PNewtonJoint; destructorparam: NewtonConstraintDestructor); cdecl; external NEWTON_API;
-function NewtonJointIsActive (const joint: PNewtonJoint): Integer; cdecl; external NEWTON_API;
-
-// **********************************************************************************************
-//
-// particle system interface (soft bodies, individual, pressure bodies and cloth)   
-//
-// **********************************************************************************************
-function NewtonCreateMassSpringDamperSystem (const newtonWorld: PNewtonWorld; shapeID: Integer; const points: pfloat; pointCount: Integer; strideInBytes: Integer; const pointMass: pfloat; const links: Pinteger; linksCount: Integer; const linksSpring: pfloat; const linksDamper: pfloat): PNewtonCollision; cdecl; external NEWTON_API;
-function NewtonCreateDeformableSolid (const newtonWorld: PNewtonWorld; const mesh: PNewtonMesh; shapeID: Integer): PNewtonCollision; cdecl; external NEWTON_API;
-function NewtonDeformableMeshGetParticleCount (const deformableMesh: PNewtonCollision): Integer; cdecl; external NEWTON_API;
-function NewtonDeformableMeshGetParticleStrideInBytes (const deformableMesh: PNewtonCollision): Integer; cdecl; external NEWTON_API;
-function NewtonDeformableMeshGetParticleArray (const deformableMesh: PNewtonCollision): pfloat; cdecl; external NEWTON_API;
-
-(*
-	NEWTON_API NewtonCollision* NewtonCreateClothPatch (const NewtonWorld* const newtonWorld, NewtonMesh* const mesh, int shapeID, NewtonClothPatchMaterial* const structuralMaterial, NewtonClothPatchMaterial* const bendMaterial);
-	NEWTON_API void NewtonDeformableMeshCreateClusters (NewtonCollision* const deformableMesh, int clusterCount, dFloat overlapingWidth);
-	NEWTON_API void NewtonDeformableMeshSetDebugCallback (NewtonCollision* const deformableMesh, NewtonCollisionIterator callback);
-
-	
-	NEWTON_API void NewtonDeformableMeshGetParticlePosition (NewtonCollision* const deformableMesh, int particleIndex, dFloat* const posit);
-
-	NEWTON_API void NewtonDeformableMeshBeginConfiguration (const NewtonCollision* const deformableMesh); 
-	NEWTON_API void NewtonDeformableMeshUnconstraintParticle (NewtonCollision* const deformableMesh, int particleIndex);
-	NEWTON_API void NewtonDeformableMeshConstraintParticle (NewtonCollision* const deformableMesh, int particleIndex, const dFloat* const posit, const NewtonBody* const body);
-	NEWTON_API void NewtonDeformableMeshEndConfiguration (const NewtonCollision* const deformableMesh); 
-
-//	NEWTON_API void NewtonDeformableMeshSetPlasticity (NewtonCollision* const deformableMesh, dFloat plasticity);
-//	NEWTON_API void NewtonDeformableMeshSetStiffness (NewtonCollision* const deformableMesh, dFloat stiffness);
-	NEWTON_API void NewtonDeformableMeshSetSkinThickness (NewtonCollision* const deformableMesh, dFloat skinThickness);
-
-	NEWTON_API void NewtonDeformableMeshUpdateRenderNormals (const NewtonCollision* const deformableMesh); 
-	NEWTON_API int NewtonDeformableMeshGetVertexCount (const NewtonCollision* const deformableMesh); 
-	NEWTON_API void NewtonDeformableMeshGetVertexStreams (const NewtonCollision* const deformableMesh, int vertexStrideInByte, dFloat* const vertex, int normalStrideInByte, dFloat* const normal, int uvStrideInByte0, dFloat* const uv0);
-	NEWTON_API NewtonDeformableMeshSegment* NewtonDeformableMeshGetFirstSegment (const NewtonCollision* const deformableMesh);
-	NEWTON_API NewtonDeformableMeshSegment* NewtonDeformableMeshGetNextSegment (const NewtonCollision* const deformableMesh, const NewtonDeformableMeshSegment* const segment);
-
-	NEWTON_API int NewtonDeformableMeshSegmentGetMaterialID (const NewtonCollision* const deformableMesh, const NewtonDeformableMeshSegment* const segment);
-	NEWTON_API int NewtonDeformableMeshSegmentGetIndexCount (const NewtonCollision* const deformableMesh, const NewtonDeformableMeshSegment* const segment);
-	NEWTON_API const int* NewtonDeformableMeshSegmentGetIndexList (const NewtonCollision* const deformableMesh, const NewtonDeformableMeshSegment* const segment);
-*)
-// **********************************************************************************************
-//
-// Ball and Socket joint functions
-//
-// **********************************************************************************************
-function NewtonConstraintCreateBall (const newtonWorld: PNewtonWorld; const pivotPoint: pfloat; const childBody: pNewtonBody; const parentBody: pNewtonBody): PNewtonJoint; cdecl; external NEWTON_API;
-procedure NewtonBallSetUserCallback (const ball: PNewtonJoint; callback: NewtonBallCallback); cdecl; external NEWTON_API;
-procedure NewtonBallGetJointAngle (const ball: PNewtonJoint; angle: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBallGetJointOmega (const ball: PNewtonJoint; omega: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBallGetJointForce (const ball: PNewtonJoint; const force: pfloat); cdecl; external NEWTON_API;
-procedure NewtonBallSetConeLimits (const ball: PNewtonJoint; const pin: pfloat; maxConeAngle: dfloat; maxTwistAngle: dfloat); cdecl; external NEWTON_API;
-
-// **********************************************************************************************
-//
-// Hinge joint functions
-//
-// **********************************************************************************************
-function NewtonConstraintCreateHinge (const newtonWorld: PNewtonWorld; const pivotPoint: pfloat; const pinDir: pfloat; const childBody: pNewtonBody; const parentBody: pNewtonBody): PNewtonJoint; cdecl; external NEWTON_API;
-procedure NewtonHingeSetUserCallback (const hinge: PNewtonJoint; callback: NewtonHingeCallback); cdecl; external NEWTON_API;
-function NewtonHingeGetJointAngle (const hinge: PNewtonJoint): dfloat; cdecl; external NEWTON_API;
-function NewtonHingeGetJointOmega (const hinge: PNewtonJoint): dfloat; cdecl; external NEWTON_API;
-procedure NewtonHingeGetJointForce (const hinge: PNewtonJoint; const force: pfloat); cdecl; external NEWTON_API;
-function NewtonHingeCalculateStopAlpha (const hinge: PNewtonJoint; const desc: PNewtonHingeSliderUpdateDesc; angle: dfloat): dfloat; cdecl; external NEWTON_API;
-
-// **********************************************************************************************
-//
-// Slider joint functions
-//
-// **********************************************************************************************
-function NewtonConstraintCreateSlider (const newtonWorld: PNewtonWorld; const pivotPoint: pfloat; const pinDir: pfloat; const childBody: pNewtonBody; const parentBody: pNewtonBody): PNewtonJoint; cdecl; external NEWTON_API;
-procedure NewtonSliderSetUserCallback (const slider: PNewtonJoint; callback: NewtonSliderCallback); cdecl; external NEWTON_API;
-function NewtonSliderGetJointPosit (const slider: PNewtonJoint): dfloat; cdecl; external NEWTON_API;
-function NewtonSliderGetJointVeloc (const slider: PNewtonJoint): dfloat; cdecl; external NEWTON_API;
-procedure NewtonSliderGetJointForce (const slider: PNewtonJoint; const force: pfloat); cdecl; external NEWTON_API;
-function NewtonSliderCalculateStopAccel (const slider: PNewtonJoint; const desc: PNewtonHingeSliderUpdateDesc; position: dfloat): dfloat; cdecl; external NEWTON_API;
-
-
-// **********************************************************************************************
-//
-// Corkscrew joint functions
-//
-// **********************************************************************************************
-function NewtonConstraintCreateCorkscrew (const newtonWorld: PNewtonWorld; const pivotPoint: pfloat; const pinDir: pfloat; const childBody: pNewtonBody; const parentBody: pNewtonBody): PNewtonJoint; cdecl; external NEWTON_API;
-procedure NewtonCorkscrewSetUserCallback (const corkscrew: PNewtonJoint; callback: NewtonCorkscrewCallback); cdecl; external NEWTON_API;
-function NewtonCorkscrewGetJointPosit (const corkscrew: PNewtonJoint): dfloat; cdecl; external NEWTON_API;
-function NewtonCorkscrewGetJointAngle (const corkscrew: PNewtonJoint): dfloat; cdecl; external NEWTON_API;
-function NewtonCorkscrewGetJointVeloc (const corkscrew: PNewtonJoint): dfloat; cdecl; external NEWTON_API;
-function NewtonCorkscrewGetJointOmega (const corkscrew: PNewtonJoint): dfloat; cdecl; external NEWTON_API;
-procedure NewtonCorkscrewGetJointForce (const corkscrew: PNewtonJoint; const force: pfloat); cdecl; external NEWTON_API;
-function NewtonCorkscrewCalculateStopAlpha (const corkscrew: PNewtonJoint; const desc: PNewtonHingeSliderUpdateDesc; angle: dfloat): dfloat; cdecl; external NEWTON_API;
-function NewtonCorkscrewCalculateStopAccel (const corkscrew: PNewtonJoint; const desc: PNewtonHingeSliderUpdateDesc; position: dfloat): dfloat; cdecl; external NEWTON_API;
-
-
-// **********************************************************************************************
-//
-// Universal joint functions
-//
-// **********************************************************************************************
-function NewtonConstraintCreateUniversal (const newtonWorld: PNewtonWorld; const pivotPoint: pfloat; const pinDir0: pfloat; const pinDir1: pfloat; const childBody: pNewtonBody; const parentBody: pNewtonBody): PNewtonJoint; cdecl; external NEWTON_API;
-procedure NewtonUniversalSetUserCallback (const universal: PNewtonJoint; callback: NewtonUniversalCallback); cdecl; external NEWTON_API;
-function NewtonUniversalGetJointAngle0 (const universal: PNewtonJoint): dfloat; cdecl; external NEWTON_API;
-function NewtonUniversalGetJointAngle1 (const universal: PNewtonJoint): dfloat; cdecl; external NEWTON_API;
-function NewtonUniversalGetJointOmega0 (const universal: PNewtonJoint): dfloat; cdecl; external NEWTON_API;
-function NewtonUniversalGetJointOmega1 (const universal: PNewtonJoint): dfloat; cdecl; external NEWTON_API;
-procedure NewtonUniversalGetJointForce (const universal: PNewtonJoint; const force: pfloat); cdecl; external NEWTON_API;
-function NewtonUniversalCalculateStopAlpha0 (const universal: PNewtonJoint; const desc: PNewtonHingeSliderUpdateDesc; angle: dfloat): dfloat; cdecl; external NEWTON_API;
-function NewtonUniversalCalculateStopAlpha1 (const universal: PNewtonJoint; const desc: PNewtonHingeSliderUpdateDesc; angle: dfloat): dfloat; cdecl; external NEWTON_API;
-
-
-// **********************************************************************************************
-//
-// Up vector joint functions
-//
-// **********************************************************************************************
-function NewtonConstraintCreateUpVector (const newtonWorld: PNewtonWorld; const pinDir: pfloat; const body: pNewtonBody): PNewtonJoint; cdecl; external NEWTON_API;
-procedure NewtonUpVectorGetPin (const upVector: PNewtonJoint; pin: dfloat); cdecl; external NEWTON_API;
-procedure NewtonUpVectorSetPin (const upVector: PNewtonJoint; const pin: dfloat); cdecl; external NEWTON_API;
-
-
-// **********************************************************************************************
-//
-// User defined bilateral Joint
-//
-// **********************************************************************************************
-function NewtonConstraintCreateUserJoint (const newtonWorld: PNewtonWorld; maxDOF: Integer; callback: NewtonUserBilateralCallback; const childBody: pNewtonBody; const parentBody: pNewtonBody): PNewtonJoint; cdecl; external NEWTON_API;
-function NewtonUserJointGetSolverModel (const joint: PNewtonJoint): Integer; cdecl; external NEWTON_API;
-procedure NewtonUserJointSetSolverModel (const joint: PNewtonJoint; model: Integer); cdecl; external NEWTON_API;
-{}procedure NewtonUserJointMassScale (const joint: PNewtonJoint; scaleBody0: dfloat; scaleBody1: dfloat); cdecl; external NEWTON_API;
-procedure NewtonUserJointSetFeedbackCollectorCallback (const joint: PNewtonJoint; getFeedback: NewtonUserBilateralCallback); cdecl; external NEWTON_API;
-procedure NewtonUserJointAddLinearRow (const joint: PNewtonJoint; const pivot0: pfloat; const pivot1: pfloat; const dir: pfloat); cdecl; external NEWTON_API;
-procedure NewtonUserJointAddAngularRow (const joint: PNewtonJoint; relativeAngle: dfloat; const dir: pfloat); cdecl; external NEWTON_API;
-procedure NewtonUserJointAddGeneralRow (const joint: PNewtonJoint; const jacobian0: pfloat; const jacobian1: pfloat); cdecl; external NEWTON_API;
-procedure NewtonUserJointSetRowMinimumFriction (const joint: PNewtonJoint; friction: dfloat); cdecl; external NEWTON_API;
-procedure NewtonUserJointSetRowMaximumFriction (const joint: PNewtonJoint; friction: dfloat); cdecl; external NEWTON_API;
-function NewtonUserJointCalculateRowZeroAcceleration (const joint: PNewtonJoint): dfloat; cdecl; external NEWTON_API;
-function NewtonUserJointGetRowAcceleration (const joint: PNewtonJoint): dfloat; cdecl; external NEWTON_API;
-{}procedure NewtonUserJointGetRowJacobian (const joint: PNewtonJoint; const linear0: pfloat; const angula0: pfloat; const linear1: pfloat; const angula1: pfloat); cdecl; external NEWTON_API;
-procedure NewtonUserJointSetRowAcceleration (const joint: PNewtonJoint; acceleration: dfloat); cdecl; external NEWTON_API;
-procedure NewtonUserJointSetRowSpringDamperAcceleration (const joint: PNewtonJoint; rowStiffness: dfloat; spring: dfloat; damper: dfloat); cdecl; external NEWTON_API;
-procedure NewtonUserJointSetRowStiffness (const joint: PNewtonJoint; stiffness: dfloat); cdecl; external NEWTON_API;
-function NewtonUserJoinRowsCount (const joint: PNewtonJoint): Integer; cdecl; external NEWTON_API;
-procedure NewtonUserJointGetGeneralRow (const joint: PNewtonJoint; index: Integer; const jacobian0: pfloat; const jacobian1: pfloat); cdecl; external NEWTON_API;
-function NewtonUserJointGetRowForce (const joint: PNewtonJoint; row: Integer): dfloat; cdecl; external NEWTON_API;
-
-// **********************************************************************************************
-//
-// Mesh joint functions
-//
-// **********************************************************************************************
-function NewtonMeshCreate (const newtonWorld: PNewtonWorld): PNewtonMesh; cdecl; external NEWTON_API;
-function NewtonMeshCreateFromMesh (const mesh: PNewtonMesh): PNewtonMesh; cdecl; external NEWTON_API;
-function NewtonMeshCreateFromCollision (const collision: PNewtonCollision): PNewtonMesh; cdecl; external NEWTON_API;
-function NewtonMeshCreateTetrahedraIsoSurface (const mesh: PNewtonMesh): PNewtonMesh; cdecl; external NEWTON_API;
-function NewtonMeshCreateConvexHull (const newtonWorld: PNewtonWorld; pointCount: Integer; const vertexCloud: pfloat; strideInBytes: Integer; tolerance: dfloat): PNewtonMesh; cdecl; external NEWTON_API;
-function NewtonMeshCreateVoronoiConvexDecomposition (const newtonWorld: PNewtonWorld; pointCount: Integer; const vertexCloud: pfloat; strideInBytes: Integer; materialID: Integer; const textureMatrix: pfloat): PNewtonMesh; cdecl; external NEWTON_API;
-function NewtonMeshCreateFromSerialization (const newtonWorld: PNewtonWorld; deserializeFunction: NewtonDeserializeCallback; const serializeHandle: Pointer): PNewtonMesh; cdecl; external NEWTON_API;
-procedure NewtonMeshDestroy (const mesh: PNewtonMesh); cdecl; external NEWTON_API;
-procedure NewtonMeshSerialize (const mesh: PNewtonMesh; serializeFunction: NewtonSerializeCallback; const serializeHandle: Pointer); cdecl; external NEWTON_API;
-procedure NewtonMeshSaveOFF (const mesh: PNewtonMesh; const filename: pchar); cdecl; external NEWTON_API;
-function NewtonMeshLoadOFF (const newtonWorld: PNewtonWorld; const filename: pchar): PNewtonMesh; cdecl; external NEWTON_API;
-function NewtonMeshLoadTetrahedraMesh (const newtonWorld: PNewtonWorld; const filename: pchar): PNewtonMesh; cdecl; external NEWTON_API;
-{}procedure NewtonMeshFlipWinding (const mesh: PNewtonMesh); cdecl; external NEWTON_API;
-
-procedure NewtonMeshApplyTransform (const mesh: PNewtonMesh; const matrix: pfloat); cdecl; external NEWTON_API;
-procedure NewtonMeshCalculateOOBB (const mesh: PNewtonMesh; const matrix: pfloat; const x: pfloat; const y: pfloat; const z: pfloat); cdecl; external NEWTON_API;
-procedure NewtonMeshCalculateVertexNormals (const mesh: PNewtonMesh; angleInRadians: dfloat); cdecl; external NEWTON_API;
-procedure NewtonMeshApplySphericalMapping (const mesh: PNewtonMesh; material: Integer; const aligmentMatrix: pfloat); cdecl; external NEWTON_API;
-procedure NewtonMeshApplyCylindricalMapping (const mesh: PNewtonMesh; cylinderMaterial: Integer; capMaterial: Integer; const aligmentMatrix: pfloat); cdecl; external NEWTON_API;
-procedure NewtonMeshApplyBoxMapping (const mesh: PNewtonMesh; frontMaterial: Integer; sideMaterial: Integer; topMaterial: Integer; const aligmentMatrix: pfloat); cdecl; external NEWTON_API;
-procedure NewtonMeshApplyAngleBasedMapping (const mesh: PNewtonMesh; material: Integer; reportPrograssCallback: NewtonReportProgress; const reportPrgressUserData: Pointer; const aligmentMatrix: pfloat); cdecl; external NEWTON_API;
-procedure NewtonCreateTetrahedraLinearBlendSkinWeightsChannel (const tetrahedraMesh: PNewtonMesh; const skinMesh: PNewtonMesh); cdecl; external NEWTON_API;
-procedure NewtonMeshOptimize (const mesh: PNewtonMesh); cdecl; external NEWTON_API;
-procedure NewtonMeshOptimizePoints (const mesh: PNewtonMesh); cdecl; external NEWTON_API;
-procedure NewtonMeshOptimizeVertex (const mesh: PNewtonMesh); cdecl; external NEWTON_API;
-function NewtonMeshIsOpenMesh (const mesh: PNewtonMesh): Integer; cdecl; external NEWTON_API;
-procedure NewtonMeshFixTJoints (const mesh: PNewtonMesh); cdecl; external NEWTON_API;
-procedure NewtonMeshPolygonize (const mesh: PNewtonMesh); cdecl; external NEWTON_API;
-procedure NewtonMeshTriangulate (const mesh: PNewtonMesh); cdecl; external NEWTON_API;
-function NewtonMeshUnion (const mesh: PNewtonMesh; const clipper: PNewtonMesh; const clipperMatrix: pfloat): PNewtonMesh; cdecl; external NEWTON_API;
-function NewtonMeshDifference (const mesh: PNewtonMesh; const clipper: PNewtonMesh; const clipperMatrix: pfloat): PNewtonMesh; cdecl; external NEWTON_API;
-function NewtonMeshIntersection (const mesh: PNewtonMesh; const clipper: PNewtonMesh; const clipperMatrix: pfloat): PNewtonMesh; cdecl; external NEWTON_API;
-procedure NewtonMeshClip (const mesh: PNewtonMesh; const clipper: PNewtonMesh; const clipperMatrix: pfloat; const topMesh: PNewtonMesh; const bottomMesh: PNewtonMesh); cdecl; external NEWTON_API;
-function NewtonMeshConvexMeshIntersection (const mesh: PNewtonMesh; const convexMesh: PNewtonMesh): PNewtonMesh; cdecl; external NEWTON_API;
-function NewtonMeshSimplify (const mesh: PNewtonMesh; maxVertexCount: Integer; reportPrograssCallback: NewtonReportProgress; const reportPrgressUserData: Pointer): PNewtonMesh; cdecl; external NEWTON_API;
-function NewtonMeshApproximateConvexDecomposition (const mesh: PNewtonMesh; maxConcavity: dfloat; backFaceDistanceFactor: dfloat; maxCount: Integer; maxVertexPerHull: Integer; reportProgressCallback: NewtonReportProgress; const reportProgressUserData: Pointer): PNewtonMesh; cdecl; external NEWTON_API;
-procedure NewtonRemoveUnusedVertices (const mesh: PNewtonMesh; const vertexRemapTable: Pinteger); cdecl; external NEWTON_API;
-procedure NewtonMeshBeginBuild (const mesh: PNewtonMesh); cdecl; external NEWTON_API;
-procedure NewtonMeshBeginFace (const mesh: PNewtonMesh); cdecl; external NEWTON_API;
-procedure NewtonMeshAddPoint (const mesh: PNewtonMesh; x: double; y: double; z: double); cdecl; external NEWTON_API;
-procedure NewtonMeshAddLayer (const mesh: PNewtonMesh; layerIndex: Integer); cdecl; external NEWTON_API;
-procedure NewtonMeshAddMaterial (const mesh: PNewtonMesh; materialIndex: Integer); cdecl; external NEWTON_API;
-procedure NewtonMeshAddNormal (const mesh: PNewtonMesh; x: dfloat; y: dfloat; z: dfloat); cdecl; external NEWTON_API;
-procedure NewtonMeshAddBinormal (const mesh: PNewtonMesh; x: dfloat; y: dfloat; z: dfloat); cdecl; external NEWTON_API;
-procedure NewtonMeshAddUV0 (const mesh: PNewtonMesh; u: dfloat; v: dfloat); cdecl; external NEWTON_API;
-procedure NewtonMeshAddUV1 (const mesh: PNewtonMesh; u: dfloat; v: dfloat); cdecl; external NEWTON_API;
-{}procedure NewtonMeshAddVertexColor (const mesh: PNewtonMesh; r: Single; g: Single; b: Single; a: Single); cdecl; external NEWTON_API;
-procedure NewtonMeshEndFace (const mesh: PNewtonMesh); cdecl; external NEWTON_API;
-procedure NewtonMeshEndBuild (const mesh: PNewtonMesh); cdecl; external NEWTON_API;
-procedure NewtonMeshClearVertexFormat (const format: PNewtonMeshVertexFormat); cdecl; external NEWTON_API;
-procedure NewtonMeshBuildFromVertexListIndexList (const mesh: PNewtonMesh; const format: PNewtonMeshVertexFormat); cdecl; external NEWTON_API;
-function NewtonMeshGetPointCount (const mesh: PNewtonMesh): Integer; cdecl; external NEWTON_API;
-function NewtonMeshGetIndexToVertexMap (const mesh: PNewtonMesh): Pinteger; cdecl; external NEWTON_API;
-function NewtonMeshGetVertexWeights(mesh : PNewtonMesh; vertexIndex : Integer; weightIndex : PInteger; weightFactor : PdFloat) : Integer; cdecl; external NEWTON_API;
-procedure NewtonMeshGetVertexDoubleChannel (const mesh: PNewtonMesh; vertexStrideInByte: Integer; const outBuffer: Pdouble); cdecl; external NEWTON_API;
-procedure NewtonMeshGetVertexChannel (const mesh: PNewtonMesh; vertexStrideInByte: Integer; const outBuffer: pfloat); cdecl; external NEWTON_API;
-procedure NewtonMeshGetNormalChannel (const mesh: PNewtonMesh; vertexStrideInByte: Integer; const outBuffer: pfloat); cdecl; external NEWTON_API;
-procedure NewtonMeshGetBinormalChannel (const mesh: PNewtonMesh; vertexStrideInByte: Integer; const outBuffer: pfloat); cdecl; external NEWTON_API;
-procedure NewtonMeshGetUV0Channel (const mesh: PNewtonMesh; vertexStrideInByte: Integer; const outBuffer: pfloat); cdecl; external NEWTON_API;
-procedure NewtonMeshGetUV1Channel (const mesh: PNewtonMesh; vertexStrideInByte: Integer; const outBuffer: pfloat); cdecl; external NEWTON_API;
-procedure NewtonMeshGetVertexColorChannel (const mesh: PNewtonMesh; vertexStrideInByte: Integer; const outBuffer: pfloat); cdecl; external NEWTON_API;
-function NewtonMeshHasNormalChannel (const mesh: PNewtonMesh): Integer; cdecl; external NEWTON_API;
-function NewtonMeshHasBinormalChannel (const mesh: PNewtonMesh): Integer; cdecl; external NEWTON_API;
-function NewtonMeshHasUV0Channel (const mesh: PNewtonMesh): Integer; cdecl; external NEWTON_API;
-function NewtonMeshHasUV1Channel (const mesh: PNewtonMesh): Integer; cdecl; external NEWTON_API;
-function NewtonMeshHasVertexColorChannel (const mesh: PNewtonMesh): Integer; cdecl; external NEWTON_API;
-function NewtonMeshBeginHandle (const mesh: PNewtonMesh): Pointer; cdecl; external NEWTON_API;
-procedure NewtonMeshEndHandle (const mesh: PNewtonMesh; const handle: Pointer); cdecl; external NEWTON_API;
-function NewtonMeshFirstMaterial (const mesh: PNewtonMesh; const handle: Pointer): Integer; cdecl; external NEWTON_API;
-function NewtonMeshNextMaterial (const mesh: PNewtonMesh; const handle: Pointer; materialId: Integer): Integer; cdecl; external NEWTON_API;
-function NewtonMeshMaterialGetMaterial (const mesh: PNewtonMesh; const handle: Pointer; materialId: Integer): Integer; cdecl; external NEWTON_API;
-function NewtonMeshMaterialGetIndexCount (const mesh: PNewtonMesh; const handle: Pointer; materialId: Integer): Integer; cdecl; external NEWTON_API;
-procedure NewtonMeshMaterialGetIndexStream (const mesh: PNewtonMesh; const handle: Pointer; materialId: Integer; const index: Pinteger); cdecl; external NEWTON_API;
-procedure NewtonMeshMaterialGetIndexStreamShort (const mesh: PNewtonMesh; const handle: Pointer; materialId: Integer; const index: SmallInt); cdecl; external NEWTON_API;
-function NewtonMeshCreateFirstSingleSegment (const mesh: PNewtonMesh): PNewtonMesh; cdecl; external NEWTON_API;
-function NewtonMeshCreateNextSingleSegment (const mesh: PNewtonMesh; const segment: PNewtonMesh): PNewtonMesh; cdecl; external NEWTON_API;
-function NewtonMeshCreateFirstLayer (const mesh: PNewtonMesh): PNewtonMesh; cdecl; external NEWTON_API;
-function NewtonMeshCreateNextLayer (const mesh: PNewtonMesh; const segment: PNewtonMesh): PNewtonMesh; cdecl; external NEWTON_API;
-function NewtonMeshGetTotalFaceCount (const mesh: PNewtonMesh): Integer; cdecl; external NEWTON_API;
-function NewtonMeshGetTotalIndexCount (const mesh: PNewtonMesh): Integer; cdecl; external NEWTON_API;
-procedure NewtonMeshGetFaces (const mesh: PNewtonMesh; const faceIndexCount: Pinteger; const faceMaterial: Pinteger; const faceIndices: PPointer); cdecl; external NEWTON_API;
-function NewtonMeshGetVertexCount (const mesh: PNewtonMesh): Integer; cdecl; external NEWTON_API;
-function NewtonMeshGetVertexStrideInByte (const mesh: PNewtonMesh): Integer; cdecl; external NEWTON_API;
-function NewtonMeshGetVertexArray (const mesh: PNewtonMesh): Pdouble; cdecl; external NEWTON_API;
-function NewtonMeshGetVertexBaseCount (const mesh: PNewtonMesh): Integer; cdecl; external NEWTON_API;
-procedure NewtonMeshSetVertexBaseCount (const mesh: PNewtonMesh; baseCount: Integer); cdecl; external NEWTON_API;
-function NewtonMeshGetFirstVertex (const mesh: PNewtonMesh): Pointer; cdecl; external NEWTON_API;
-function NewtonMeshGetNextVertex (const mesh: PNewtonMesh; const vertex: Pointer): Pointer; cdecl; external NEWTON_API;
-function NewtonMeshGetVertexIndex (const mesh: PNewtonMesh; const vertex: Pointer): Integer; cdecl; external NEWTON_API;
-function NewtonMeshGetFirstPoint (const mesh: PNewtonMesh): Pointer; cdecl; external NEWTON_API;
-function NewtonMeshGetNextPoint (const mesh: PNewtonMesh; const point: Pointer): Pointer; cdecl; external NEWTON_API;
-function NewtonMeshGetPointIndex (const mesh: PNewtonMesh; const point: Pointer): Integer; cdecl; external NEWTON_API;
-function NewtonMeshGetVertexIndexFromPoint (const mesh: PNewtonMesh; const point: Pointer): Integer; cdecl; external NEWTON_API;
-function NewtonMeshGetFirstEdge (const mesh: PNewtonMesh): Pointer; cdecl; external NEWTON_API;
-function NewtonMeshGetNextEdge (const mesh: PNewtonMesh; const edge: Pointer): Pointer; cdecl; external NEWTON_API;
-procedure NewtonMeshGetEdgeIndices (const mesh: PNewtonMesh; const edge: Pointer; const v0: Pinteger; const v1: Pinteger); cdecl; external NEWTON_API;
-	//NEWTON_API void NewtonMeshGetEdgePointIndices (const NewtonMesh* const mesh, const void* const edge, int* const v0, int* const v1);
-
-function NewtonMeshGetFirstFace (const mesh: PNewtonMesh): Pointer; cdecl; external NEWTON_API;
-function NewtonMeshGetNextFace (const mesh: PNewtonMesh; const face: Pointer): Pointer; cdecl; external NEWTON_API;
-function NewtonMeshIsFaceOpen (const mesh: PNewtonMesh; const face: Pointer): Integer; cdecl; external NEWTON_API;
-function NewtonMeshGetFaceMaterial (const mesh: PNewtonMesh; const face: Pointer): Integer; cdecl; external NEWTON_API;
-function NewtonMeshGetFaceIndexCount (const mesh: PNewtonMesh; const face: Pointer): Integer; cdecl; external NEWTON_API;
-procedure NewtonMeshGetFaceIndices (const mesh: PNewtonMesh; const face: Pointer; const indices: Pinteger); cdecl; external NEWTON_API;
-procedure NewtonMeshGetFacePointIndices (const mesh: PNewtonMesh; const face: Pointer; const indices: Pinteger); cdecl; external NEWTON_API;
-procedure NewtonMeshCalculateFaceNormal (const mesh: PNewtonMesh; const face: Pointer; const normal: Pdouble); cdecl; external NEWTON_API;
-procedure NewtonMeshSetFaceMaterial (const mesh: PNewtonMesh; const face: Pointer; matId: Integer); cdecl; external NEWTON_API;
-
-
-implementation
-
-end.

+ 0 - 1854
Source/FMX/Physix.ODEImport.pas

@@ -1,1854 +0,0 @@
-//
-// The graphics platform GLXcene https://github.com/glscene
-//
-unit Physix.ODEImport;
-
-(*******************************
- *                                                                       *
- * Open Dynamics Engine, Copyright (C) 2001,2020 Russell L. Smith.       *
- *                All rights reserved. Web: www.ode.org                  *
- *                                                                       *
- * 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 LICENSE.TXT.                                               *
- *   (2) The BSD-style license that is included with this library in     *
- *       the file LICENSE-BSD.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    *
- * LICENSE.TXT and LICENSE-BSD.TXT for more details.                     *
- *                                                                       *
- *****************************)
-
-(*******************************
-  Some notes;
-
-  Sometimes it's easier and faster to refer to the members of the objects
-  directly, like Body.Pos, Geom.Data or Body.Mass, instead of calling the built
-  in routines. Be very careful if you do this, because some of the built in
-  routines alter states when called.
-
-  Examples
-
-  bGeomSetBody(Geom, Body); // This method must be used so
-  Geom.Body := Body; // DON'T DO THIS
-
-  Setting the mass of a body is another example. Typically, reading members is
-  fine, but before writing directly to member fields yourself, you should check
-  the c source and see what the function/procedure does. The source can be found
-  at http://www.q12.org/ode/
-
-  *****************************)
-
-interface
-// remove . from line below if you are using a generic ODE DLL
-{$DEFINE VanillaODE}
-{$IFNDEF VanillaODE}
-   {$DEFINE PARODE}
-{$ENDIF}
-
-uses
-  System.Classes,
-  Physix.ModuleLoader;
-
-const
-
-  //   ODE precision:
-  //
-  //   ODE can be run in Single or Double precision, Single is less precise,
-  //   but requires less memory.
-  //
-  //   If you choose to run in Single mode, you must deploy the single precision
-  //   dll (this is default)
-  //
-  //   If you choose to run in Double mode, you must deploy the double precision
-  //   dll (named ode_double.dll and located in the dll directory)
-
-  {$define cSINGLE}  //Insert . before "$" to make ODE double based
-  {$IFDEF WIN32}
-    {$IFDEF cSINGLE}
-      ODEDLL = 'ode32s.dll';
-    {$ELSE}
-      ODEDLL = 'ode32d.dll';
-    {$ENDIF}
-  {$ENDIF}
-  {$IFDEF WIN64}
-    {$IFDEF cSINGLE}
-      ODEDLL = 'ode64s.dll';
-    {$ELSE}
-      ODEDLL = 'ode64d.dll';
-    {$ENDIF}
-  {$ENDIF}
-
-  {$IFDEF UNIX}
-  ODEDLL = 'libode.so';
-  {$ENDIF}
-  {$IFDEF MACOS}
-  ODEDLL = 'libode.dylib';
-  {$ENDIF}
-  {$IFDEF DARWIN} // MacOS X
-  ODEDLL = 'libode.dylib';
-  {$ENDIF}
-
-
-const
-// enum (* TRIMESH_FACE_NORMALS, TRIMESH_LAST_TRANSFORMATION ; *)
-    TRIMESH_FACE_NORMALS = 0;
-    TRIMESH_LAST_TRANSFORMATION = 1;
-
-// Just generate any contacts (disables any contact refining).
-    CONTACTS_UNIMPORTANT = $80000000;
-
-// Change: New Type added, syntax enforcement
-type TJointFlag = Integer;
-
-// These consts now have defined types
-const
-  // if this flag is set, the joint was allocated in a joint group
-    dJOINT_INGROUP: TJointFlag = 1;
-  (* if this flag is set, the joint was attached with arguments (0,body).
-     our convention is to treat all attaches as (body,0), i.e. so node[0].body
-     is always nonzero, so this flag records the fact that the arguments were swapped *)
-    dJOINT_REVERSE: TJointFlag = 2;
-  (* if this flag is set, the joint can not have just one body attached to it,
-     it must have either zero or two bodies attached *)
-    dJOINT_TWOBODIES: TJointFlag = 4;
-
-
-// Change: New Type added, syntax enforcement
-type TdContactType = Integer;
-
-// These consts now have defined types
-const
-    dContactMu2: TdContactType		= $0001;
-    dContactFDir1: TdContactType	= $0002;
-    dContactBounce: TdContactType   	= $0004;
-    dContactSoftERP: TdContactType  	= $0008;
-    dContactSoftCFM: TdContactType  	= $0010;
-    dContactMotion1: TdContactType  	= $0020;
-    dContactMotion2: TdContactType	= $0040;
-    dContactMotionN: TdContactType	= $0080;
-    dContactSlip1: TdContactType	= $0100;
-    dContactSlip2: TdContactType	= $0200;
-
-    dContactApprox0: TdContactType	= $0000;
-    dContactApprox1_1: TdContactType	= $1000;
-    dContactApprox1_2: TdContactType	= $2000;
-    dContactApprox1: TdContactType	= $3000;
-
-// Change: New Type added, syntax enforcement
-type TBodyFlags = Integer;
-
-// These consts now have defined types
-const
-  dxBodyFlagFiniteRotation: TBodyFlags = 1;		  // use finite rotations
-  dxBodyFlagFiniteRotationAxis: TBodyFlags = 2;	// use finite rotations only along axis
-  dxBodyDisabled: TBodyFlags = 4;			          // body is disabled
-  dxBodyNoGravity: TBodyFlags = 8;              // body is not influenced by gravity
-
-type
-  {$ifdef cSINGLE}
-    TdReal = single;
-  {$else}
-    TdReal = double;
-  {$endif}
-
-  PdReal = ^TdReal;
-
-  {define cODEDebugEnabled} // Debug mode
-
-  (* Pointers to internal ODE structures to reproduce C++ classes in Delphi *)
-  PdxJointGroup = ^TdxJointGroup;
-  TdJointGroupID = PdxJointGroup;
-
-  TdxJointGroup = record
-     num : integer;
-     stack : pointer;
-  end;
-
-  PdxJointLimitMotor = ^TdxJointLimitMotor;
-  TdxJointLimitMotor = record
-     vel,fmax : TdReal;  // powered joint: velocity, max force
-     lostop,histop : TdReal; // joint limits, relative to initial position
-     fudge_factor : TdReal; // when powering away from joint limits
-     normal_cfm : TdReal; // cfm to use when not at a stop
-     stop_erp,stop_sfm : TdReal; // erp and cfm for when at joint limit
-     bounce : TdReal; // restitution factor
-     // variables used between getInfo1() and getInfo2()
-     limit : integer; // 0=free, 1=at lo limit, 2=at hi limit
-     limit_err : TdReal; // if at limit, amount over limit
-  end;
-
-  TdRealArray = array[0..15] of TdReal;
-  PdRealArray = ^TdRealArray;
-
-  // typedef dReal dVector33[4];
-  TdVector3 = array[0..3] of TdReal;//Q: Why isn't TdVector3 = array[0..2] of TdReal? A: Because of SIMD alignment.
-  PdVector3 = ^TdVector3;
-
-  Pd3Axis = ^Td3Axis;
-  Td3Axis = array[0..2] of TdVector3;
-
-  PdInteger3 = ^TdInteger3;
-  TdInteger3 = array[0..2] of integer;
-
-  PdxJointLimitMotor3 = ^TdxJointLimitMotor3;
-  TdxJointLimitMotor3 = array[0..2] of TdxJointLimitMotor;
-
-  // typedef dReal dVector4[4];
-  TdVector4 = array[0..3] of TdReal;
-  PdVector4 = ^TdVector4;
-
-  // typedef dReal dMatrix3[4*3];
-  TdMatrix3 = array[0..4*3-1] of TdReal;
-  PdMatrix3 = ^TdMatrix3;
-
-  TdMatrix3_As3x4 = array[0..2, 0..3] of TdReal;
-  PdMatrix3_As3x4 = ^TdMatrix3_As3x4;
-
-  // typedef dReal dMatrix4[4*4];
-  TdMatrix4 = array[0..4*4-1] of TdReal;
-  PdMatrix4 = ^TdMatrix4;
-
-  // typedef dReal dMatrix6[8*6];
-  TdMatrix6 = array[0..8*6-1] of TdReal;
-  PdMatrix6 = ^TdMatrix6;
-
-  // typedef dReal dQuaternion[4];
-  TdQuaternion = TdVector4;//array[0..3] of TdReal;
-  PdQuaternion = ^TdQuaternion;
-
-  // No typedef for AABB
-  TdAABB = array[0..5] of TdReal;
-
-
-  TdMass = record
-    mass : TdReal; // total mass of the rigid body
-    c : TdVector4; // center of gravity position in body frame (x,y,z)
-    I : TdMatrix3; // 3x3 inertia tensor in body frame, about POR
-  end;
-  PdMass = ^TdMass;
-
-   TdxAutoDisable = record
-      idle_time : TdReal; // time the body needs to be idle to auto-disable it
-      idle_steps : integer; // steps the body needs to be idle to auto-disable it
-      linear_average_threashold : TdReal;  // linear (squared) average velocity threshold
-      angular_average_threashold : TdReal;  // angular (squared) average velocity threshold
-      average_samples : longword; // size of the average_lvel and average_avel buffers
-   end;
-   TdxDampingParameters = record
-      linear_scale : TdReal; // multiply the linear velocity by (1 - scale)
-      angular_scale : TdReal; // multiply the angular velocity by (1 - scale)
-      linear_threahold : TdReal; // linear (squared) average speed threshold
-      angular_threashold : TdReal; // angular (squared) average speed threshold
-   end;
-   TdxContactParameters = record
-      max_vel : TdReal;   // maximum correcting velocity
-      min_depth : TdReal; // thickness of 'surface layer'
-   end;
-   TdxQuickStepParameters = record
-      num_iterations : integer; // number of SOR iterations to perform
-      w : TdReal; // the SOR over-relaxation parameter
-   end;
-  PdxGeom = ^TdxGeom;
-  PPdxGeom = ^PdxGeom;
-
-//  Whenever a body has its position or rotation changed during the
-//  timestep, the callback will be called (with body as the argument).
-//  Use it to know which body may need an update in an external
-//  structure (like a 3D engine).
-  TdMovedCallback = procedure(o1: PdxGeom); cdecl;
-
-//  Per triangle callback. Allows the user to say if he wants a collision with
-//  a particular triangle.
-  TdTriCallback = function(TriMesh,RefObject : PdxGeom; TriangleIndex : integer) : integer;
-
-//  Per object callback. Allows the user to get the list of triangles in 1
-//  shot. Maybe we should remove this one.
-  TdTriArrayCallback = procedure(TriMesh,RefObject : PdxGeom; TriIndices:PIntegerArray; TriCount : integer);
-
-//  Allows the user to say if a ray collides with a triangle on barycentric
-//  coords. The user can for example sample a texture with alpha transparency
-//  to determine if a collision should occur.
-  TdTriRayCallback = function(TriMesh,Ray : PdxGeom; TriangleIndex : integer; u,v:TdReal) : integer;
-
-
-  PdxWorld = ^TdxWorld;
-
-  PdObject = ^TdObject;
-  PPdObject = ^PdObject;
-  TdObject = record
-    World     : PdxWorld;  // world this object is in
-    next      : PdObject;	// next object of this type in list
-    tome      : PPdObject;	// pointer to previous object's next ptr
-    userdata  : pointer;		// user settable data
-    tag       : integer;		// used by dynamics algorithms
-  end;
-
-
-  PdxBody = ^TdxBody;
-  PdxJoint= ^TdxJoint;
-  TdJointID = PdxJoint;
-
-  {$IFDEF PARODE}
-  TdJointBreakCallback = procedure(joint: TdJointID); cdecl;
-
-  TJointBreakMode = Integer;
-
-  PdxJointBreakInfo = ^TdxJointBreakInfo;
-  TdxJointBreakInfo = record
-      flags : integer;
-      b1MaxF:TdVector3; // maximum force on body 1
-      b1MaxT:TdVector3; // maximum torque on body 1
-      b2MaxF:TdVector3; // maximum force on body 2
-      b2MaxT:TdVector3; // maximum torque on body 2
-      callback:TdJointBreakCallback; // function that is called when this joint breaks
-   end;
-  {$ENDIF}
-
-  PdxJointNode = ^TdxJointNode;
-  TdxJointNode = record
-     joint : PdxJoint; // pointer to enclosing dxJoint object
-     body : PdxBody;   // *other* body this joint is connected to
-     next : PdxJointNode; // next node in body's list of connected joints
-  end;
-
-  // info returned by getInfo1 function. the constraint dimension is m (<=6).
-  // i.e. that is the total number of rows in the jacobian. `nub' is the
-  // number of unbounded variables (which have lo,hi = -/+ infinity).
-  TJointInfo1 = record
-     m,nub : integer;
-  end;
-
-  // info returned by getInfo2 function
-  TJointInfo2 = record
-    // integrator parameters: frames per second (1/stepsize), default error
-    // reduction parameter (0..1).
-     fps,erp : TdReal;
-    // 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.
-     J1l,J1a,J2l,J2a : pdReal;
-    // elements to jump from one row to the next in J's
-     rowskip : integer;
-    // 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.
-     c,cfm : pdReal;
-    // lo and hi limits for variables (set to -/+ infinity on entry).
-     lo,hi : pdReal;
-    // 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.
-     findex : pinteger;
-  end;
-  TdxJoint = record
-     baseObject : TdObject;
-     Info1 : TJointInfo1;
-     Info2 : TJointInfo2;
-  end;
-  TdxJointNull = TdxJoint;
-
-  PdxJointBall = ^TdxJointBall;
-  TdxJointBall = record
-     BaseJoint : TdxJoint;
-     anchor1 : TdVector3;// anchor w.r.t first body
-     anchor2 : TdVector3;// anchor w.r.t second body
-     erp : TdReal; // error reduction
-     cfm : TdReal; // constraint force mix in
-  end;
-
-  PdxJointHinge = ^TdxJointHinge;
-  TdxJointHinge = record
-     BaseJoint : TdxJoint;
-     anchor1 : TdVector3; // anchor w.r.t first body
-     anchor2 : TdVector3; // anchor w.r.t second body
-     axis1 : TdVector3; // axis w.r.t first body
-     axis2 : TdVector3; // axis w.r.t second body
-     qrel : tdQuaternion;  // initial relative rotation body1 -> body2
-     limot : TdxJointLimitMotor; // limit and motor information
-  end;
-
-  PdxJointUniversial = ^TdxJointUniversial;
-  TdxJointUniversial = record
-     BaseJoint : TdxJoint;
-     anchor1 : TdVector3; // anchor w.r.t first body
-     anchor2 : TdVector3; // anchor w.r.t second body
-     axis1 : TdVector3; // axis w.r.t first body
-     axis2 : TdVector3; // axis w.r.t second body
-     qrel1 : tdQuaternion; // initial relative rotation body1 -> virtual cross piece
-     qrel2 : tdQuaternion; // initial relative rotation virtual cross piece -> body2
-     limot1 : TdxJointLimitMotor; // limit and motor information for axis1
-     limot2 : TdxJointLimitMotor;// limit and motor information for axis2
-  end;
-
-  PdxJointPR = ^TdxJointPR;
-  TdxJointPR = record
-     BaseJoint : TdxJoint;
-
-     anchor2:TdVector3;     ///< @brief Position of the rotoide articulation
-                            ///<        w.r.t second body.
-                            ///< @note Position of body 2 in world frame +
-                            ///< anchor2 in world frame give the position
-                            ///< of the rotoide articulation
-     axisR1:TdVector3 ;     ///< axis of the rotoide articulation w.r.t first body.
-                            ///< @note This is considered as axis1 from the parameter
-                            ///< view.
-     axisR2:TdVector3 ;     ///< axis of the rotoide articulation w.r.t second body.
-                            ///< @note This is considered also as axis1 from the
-                            ///< parameter view
-     axisP1:TdVector3;      ///< axis for the prismatic articulation w.r.t first body.
-                            ///< @note This is considered as axis2 in from the parameter
-                            ///< view
-     qrel:TdQuaternion;     ///< initial relative rotation body1 -> body2.
-     offset:TdVector3;      ///< @brief vector between the body1 and the rotoide
-                            ///< articulation.
-                            ///<
-                            ///< Going from the first to the second in the frame
-                            ///<  of body1.
-                            ///< That should be aligned with body1 center along axisP
-                            ///< This is calculated when the axis are set.
-     limotR:TdxJointLimitMotor; ///< limit and motor information for the rotoide articulation.
-     limotP:TdxJointLimitMotor; ///< limit and motor information for the prismatic articulation.
-  end;
-
-  PdxJointPiston = ^TdxJointPiston;
-  TdxJointPiston = record
-     BaseJoint : TdxJoint;
-
-     axis1:TdVector3;          ///< Axis of the prismatic and rotoide w.r.t first body
-     axis2:TdVector3;          ///< Axis of the prismatic and rotoide w.r.t second body
-
-     qrel:TdQuaternion;        ///< Initial relative rotation body1 -> body2
-
-  /// Anchor w.r.t first body.
-  /// This is the same as the offset for the Slider joint
-  /// @note To find the position of the anchor when the body 1 has moved
-  ///       you must add the position of the prismatic joint
-  ///       i.e anchor = R1 * anchor1 + dJointGetPistonPosition() * (R1 * axis1)
-     anchor1:TdVector3;
-     anchor2:TdVector3;        //< anchor w.r.t second body
-
-  /// limit and motor information for the prismatic
-  /// part of the joint
-     limotP:TdxJointLimitMotor;
-
-  /// limit and motor information for the rotoide
-  /// part of the joint
-     limotR:TdxJointLimitMotor;
-  end;
-
-  PdxJointSlider = ^TdxJointSlider;
-  TdxJointSlider = record
-     BaseJoint : TdxJoint;
-     axis1:TdVector3;		// axis w.r.t first body
-     qrel:TdQuaternion;		// initial relative rotation body1 -> body2
-     offset:TdVector3;		// point relative to body2 that should be
-                				// aligned with body1 center along axis1
-     limot:TdxJointLimitMotor;	// limit and motor information
-  end;
-
-  PdxJointHinge2 = ^TdxJointHinge2;
-  TdxJointHinge2 = record
-     BaseJoint : TdxJoint;
-
-     anchor1:TdVector3 ;		// anchor w.r.t first body
-     anchor2:TdVector3 ;		// anchor w.r.t second body
-     axis1:TdVector3;		// axis 1 w.r.t first body
-     axis2:TdVector3;		// axis 2 w.r.t second body
-     c0,s0:TdReal;			// cos,sin of desired angle between axis 1,2
-     v1,v2:TdVector3;		// angle ref vectors embedded in first body
-     limot1:TdxJointLimitMotor;	// limit+motor info for axis 1
-     limot2:TdxJointLimitMotor;	// limit+motor info for axis 2
-     susp_erp,susp_cfm:TdReal;	// suspension parameters (erp,cfm)
-  end;
-
-  TdxJointAMotor = record
-     BaseJoint : TdxJoint;
-
-     num:integer;			// number of axes (0..3)
-     mode:integer;			// a dAMotorXXX constant
-     rel:TdInteger3;			// what the axes are relative to (global,b1,b2)
-     axis:Td3Axis;		// three axes
-     limot:TdxJointLimitMotor3;	// limit+motor info for axes
-     angle:TdVector3;		// user-supplied angles for axes
-     // these vectors are used for calculating euler angles
-     reference1:TdVector3;		// original axis[2], relative to body 1
-     reference2:TdVector3;		// original axis[0], relative to body 2
-  end;
-
-  TdxJointLMotor = record
-     BaseJoint : TdxJoint;
-
-     num: integer;
-     rel:TdInteger3;
-     axis:Td3Axis;		// three axes
-     limot:TdxJointLimitMotor3;	// limit+motor info for axes
-  end;
-
-  TdxJointPlane2D = record
-     BaseJoint : TdxJoint;
-     row_motor_x:integer;
-     row_motor_y:integer;
-     row_motor_angle:integer;
-     motor_x:TdxJointLimitMotor;
-     motor_y:TdxJointLimitMotor;
-     motor_angle:TdxJointLimitMotor;
-  end;
-
-  TdxJointFixed = record
-     BaseJoint : TdxJoint;
-     qrel:TdQuaternion;		// initial relative rotation body1 -> body2
-     offset:TdVector3;		// relative offset between the bodies
-     erp:TdReal;			// error reduction parameter
-     cfm:TdReal;			// constraint force mix-in
-  end;
-
-  // position vector and rotation matrix for geometry objects that are not
-  // connected to bodies.
-  PdxPosR = ^TdxPosR;
-  TdxPosR = record
-    pos : TdVector3;
-    R : TdMatrix3;
-  end;
-
-  TdxBody = record
-    BaseObject : TdObject;
-    {$ifdef cSINGLE}
-    Padding : byte;
-    {$endif}
-    firstjoint : TdJointID;	// list of attached joints
-    flags : integer;			  // some dxBodyFlagXXX flags
-    geom : PdxGeom;          // first collision geom associated with body
-    mass : TdMass;			    // mass parameters about POR
-    invI : TdMatrix3 ;		  // inverse of mass.I
-    invMass : TdReal;		    // 1 / mass.mass
-    posr : TdxPosR;			  // position and orientation of point of reference
-    q : TdQuaternion;		    // orientation quaternion
-    lvel,avel : TdVector3;	// linear and angular velocity of POR
-    facc,tacc : TdVector3 ;	// force and torque accululators
-    finite_rot_axis : TdVector3 ;	// finite rotation axis, unit length or 0=none
-    adis : TdxAutoDisable; // auto-disable parameters
-    adis_timeleft : TdReal; // time left to be idle
-    adis_stepsleft : integer;  // steps left to be idle
-    average_lvel_buffer : pdVector3; // buffer for the linear average velocity calculation
-    average_avel_buffer : pdVector3; // buffer for the angular average velocity calculation
-    average_counter : longword; // counter/index to fill the average-buffers
-    average_ready : integer; // indicates ( with = 1 ), if the Body's buffers are ready for average-calculations
-    moved_callback : TdMovedCallback; // let the user know the body moved
-    dampingp : TdxDampingParameters; // damping parameters, depends on flags
-    max_angular_speed : TdReal; // limit the angular velocity to this magnitude
-  end;
-
-  TBodyList = class(TList)
-  private
-    function GetItems(i: integer): PdxBody;
-    procedure SetItems(i: integer; const Value: PdxBody);
-  public
-    property Items[i : integer] : PdxBody read GetItems write SetItems; default;
-    procedure DeleteAllBodies;
-  end;
-
-
-(*struct dxWorld : public dBase {
-  dxBody *firstbody;		// body linked list
-  dxJoint *firstjoint;	// joint linked list
-  int nb,nj;			      // number of bodies and joints in lists
-  dVector3 gravity;		  // gravity vector (m/s/s)
-  dReal global_erp;		  // global error reduction parameter
-  dReal global_cfm;		  // global costraint force mixing parameter
-};*)
-
-  TdxWorld = record //(TdBase)
-    firstbody : PdxBody;		// body linked list
-    firstjoint : PdxJoint;	// joint linked list
-    nb,nj : integer;			  // number of bodies and joints in lists
-    gravity : TdVector3;		// gravity vector (m/s/s)
-    global_erp : TdReal;		// global error reduction parameter
-    global_cfm : TdReal;		// global costraint force mixing parameter
-    adis : TdxAutoDisable;
-    body_flags : integer;
-    qs : TdxQuickStepParameters;
-    contactp : TdxContactParameters;
-    dampingp : TdxDampingParameters;
-    max_angular_speed : TdReal;
-  end;
-
-
-  TdJointFeedback = record
-    f1 : TdVector3;       // force that joint applies to body 1
-    t1 : TdVector3;       // torque that joint applies to body 1
-    f2 : TdVector3;       // force that joint applies to body 2
-    t2 : TdVector3;       // torque that joint applies to body 2
-  end;
-
-  PTdJointFeedback = ^TdJointFeedback;
-
-  TdErrorType =
-    (d_ERR_UNKNOWN, // unknown error
-     d_ERR_IASSERT, // user assertion failed */
-     d_ERR_UASSERT, // user assertion failed */
-     d_ERR_LCP);
-
-
-  TdJointTypeNumbers =
-    (dJointTypeNone,		// or "unknown"
-    dJointTypeBall,
-    dJointTypeHinge,
-    dJointTypeSlider,
-    dJointTypeContact,
-    dJointTypeUniversal,
-    dJointTypeHinge2,
-    dJointTypeFixed,
-    dJointTypeNull,
-    dJointTypeAMotor,
-    dJointTypeLMotor,
-    dJointTypePlane2D,
-    dJointTypePR,
-    dJointTypePU,
-    dJointTypePiston
-    );
-
-  TdAngularMotorModeNumbers =
-    (dAMotorUser,
-     dAMotorEuler);
-
-
-  TdSurfaceParameters = record
-    // must always be defined
-    mode : integer;
-    mu : TdReal;
-
-    // only defined if the corresponding flag is set in mode
-    mu2,
-    bounce,
-    bounce_vel,
-    soft_erp,
-    soft_cfm,
-    motion1,motion2,motionN,
-    slip1,slip2 : TdReal
-  end;
-
-  TdContactGeom = record
-    pos : TdVector3;
-    normal : TdVector3;
-    depth : TdReal;
-    g1,g2 : PdxGeom;
-    side1,side2 : integer;
-  end;
-
-  PdContactGeom = ^TdContactGeom;
-
-  TdContact = record
-    surface : TdSurfaceParameters;
-    geom : TdContactGeom;
-    fdir1 : TdVector3;
-  end;
-  PdContact = ^TdContact;
-
-  // Collission callback structure
-  TdNearCallback = procedure(data : pointer; o1, o2 : PdxGeom); cdecl;
-
-
-  TdColliderFn = function(o1, o2 : PdxGeom; flags : Integer;
-                  contact : PdContactGeom; skip : Integer) : Integer; cdecl;
-  TdGetColliderFnFn = function(num : Integer) : TdColliderFn; cdecl;
-  TdGetAABBFn = procedure(g : PdxGeom; var aabb : TdAABB); cdecl;
-  TdGeomDtorFn = procedure(o : PdxGeom); cdecl;
-  TdAABBTestFn = function(o1, o2 : PdxGeom; const aabb2 : TdAABB) : Integer; cdecl;
-
-(*typedef struct dGeomClass {
-  int bytes;
-  dGetColliderFnFn *collider;
-  dGetAABBFn *aabb;
-  dAABBTestFn *aabb_test;
-  dGeomDtorFn *dtor;
-} dGeomClass;*)
-
-  TdGeomClass = record
-    bytes : integer;                 // extra storage size
-    collider : TdGetColliderFnFn;    // collider function
-    aabb : TdGetAABBFn;       // bounding box function
-    aabb_test : TdAABBTestFn; // aabb tester, can be 0 for none
-    dtor : TdGeomDtorFn;      // destructor, can be 0 for none
-  end;
-
-  PdGeomClass = ^TdGeomClass;
-
-  (*struct dxSpace : public dBase {
-  int type;			// don't want to use RTTI
-  virtual void destroy()=0;
-  virtual void add (dGeomID)=0;
-  virtual void remove (dGeomID)=0;
-  virtual void collide (void *data, dNearCallback *callback)=0;
-  virtual int query (dGeomID)=0;
-};*)
-
-  PdxSpace = ^TdxSpace;
-
-  TdRealHugeArray = array[0..65535] of TdReal;
-  PdRealHugeArray = ^TdRealHugeArray;
-
-  // Tri-list collider
-  TdIntegerArray = array[0..65535] of Integer;
-  PdIntegerArray = ^TdIntegerArray;
-
-  TdVector3Array = array[0..65535] of TdVector3;
-  PdVector3Array = ^TdVector3Array;
-
-(*struct dxTriMeshData{
-	Model BVTree;
-	MeshInterface Mesh;
-
-    dxTriMeshData();
-    ~dxTriMeshData();
-
-    void Build(const void* Vertices, int VertexStide, int VertexCount,
-	       const void* Indices, int IndexCount, int TriStride,
-	       const void* Normals,
-	       bool Single);
-
-        /* aabb in model space */
-        dVector3 AABBCenter;
-        dVector3 AABBExtents;
-
-    /* data for use in collison resolution */
-    const void* Normals;
-    Matrix4x4   last_trans;
-};*)
-  TdxTriMeshData = record
-    unknown : byte; //
-  end;
-  PdxTriMeshData = ^TdxTriMeshData;
-
-  TdxHeightfieldData = record
-    m_fWidth : TdReal;
-    m_fDepth : TdReal;
-    m_fSampleWidth : TdReal;
-    m_fSampleDepth : TdReal;
-    m_fInvSampleWidth : TdReal;
-    m_fInvSampleDepth : TdReal;
-    m_fHalfWidth : TdReal;
-    m_fHalfDepth : TdReal;
-    m_fMinHeight : TdReal;
-    m_fMaxHeight : TdReal;
-    m_fThickness : TdReal;
-    m_fScale : TdReal;
-    m_fOffset : TdReal;
-    m_nWidthSamples : integer;
-    m_nDepthSamples : integer;
-    m_bCopyHeightData : integer;
-    m_bWrapMode : integer;
-    m_nGetHeightMode : integer;
-    m_pHeightData : pointer;
-    m_pUserData : pointer;
-     m_contacts : PdContactGeom;
-  end;
-  PdxHeightfieldData = ^TdxHeightfieldData;
-
-
-(*//simple space - reports all n^2 object intersections
-struct dxSimpleSpace : public dxSpace {
-  dGeomID first;
-  void destroy();
-  void add (dGeomID);
-  void remove (dGeomID);
-  void collide (void *data, dNearCallback *callback);
-  int query (dGeomID);
-};*)
-
-
-  PdxSimpleSpace = ^TdxSimpleSpace;
-
-(*//currently the space 'container' is just a list of the geoms in the space.
-struct dxHashSpace : public dxSpace {
-  dxGeom *first;
-  int global_minlevel;	// smallest hash table level to put AABBs in
-  int global_maxlevel;	// objects that need a level larger than this will be
-			// put in a "big objects" list instead of a hash table
-  void destroy();
-  void add (dGeomID);
-  void remove (dGeomID);
-  void collide (void *data, dNearCallback *callback);
-  int query (dGeomID);
-};*)
-
-  PdxHashSpace = ^TdxHashSpace;
-
-  (*typedef struct dGeomSpaceData {
-  dGeomID next;
-} dGeomSpaceData; *)
-
-  TdGeomSpaceData = record
-     next : PdxGeom;
-  end;
-
-  (*// common data for all geometry objects. the class-specific data area follows
-  // this structure. pos and R will either point to a separately allocated
-  // buffer (if body is 0 - pos points to the dxPosR object) or to the pos and
-  // R of the body (if body nonzero).
-  struct dxGeom {		// a dGeomID is a pointer to this
-    dxGeomClass *_class;	// class of this object
-    void *data;		// user data pointer
-    dBodyID body;		// dynamics body associated with this object (if any)
-    dReal *pos;		// pointer to object's position vector
-    dReal *R;		// pointer to object's rotation matrix
-    dSpaceID spaceid;	// the space this object is in
-    dGeomSpaceData space;	// reserved for use by space this object is in
-    dReal *space_aabb;	// ptr to aabb array held by dSpaceCollide() fn
-    // class-specific data follows here, with proper alignment.
-  };*)
-
-  TdxGeom = record // a dGeomID is a pointer to this
-     _type : integer;	// class of this object
-
-     {$ifdef cSINGLE}
-     Padding : byte;
-     {$endif}
-     gflags : integer;
-
-     data : pointer;		// user data pointer
-     Body : PdxBody ;		// dynamics body associated with this object (if any)
-     body_next : PdxGeom; // next geom in body's linked list of associated geoms
-     final_posr : PdxPosR; // final position of the geom in world coordinates
-     offset_posr : PdxPosR; // offset from body in local coordinates
-
-     next : PdxGeom;
-     tome : PPdxGeom;
-     parent_space : Pdxspace;
-     aabb : TdAABB;
-     category_bits,collide_bits : longword;
-  end;
-
-  TGeomList = class(TList)
-  private
-    function GetItems(i: integer): PdxGeom;
-    procedure SetItems(i: integer; const Value: PdxGeom);
-  public
-    property Items[i : integer] : PdxGeom read GetItems write SetItems; default;
-    procedure DeleteAllGeoms(DeleteDataAsObject : boolean=false);
-  end;
-
-
-  TdxSpace = record
-    baseGeom : TdxGeom;
-    count : integer;
-    first : PdxGeom;
-    cleanup : integer;
-    current_index : integer;
-    current_geom : PdxGeom;
-    lock_count : integer;
-  end;
-
-  // Copies settings from TdxSpace, beacause pascal doeasn't do inheritance
-  // for records
-  TdxSimpleSpace = TdxSpace;
-
-  // Copies settings from TdxSpace, beacause pascal doeasn't do inheritance
-  // for records
-  TdxHashSpace = record
-    BaseSpace : TdxSpace;
-    global_minlevel : integer;
-    global_maxlevel : integer;
-  end;
-
-  TdxQuadTreeSpace = record
-    BaseSpace : TdxSpace;
-    Blocks : pointer;
-    DirtyList : pointer;
-  end;
-
-//  TJointParams = (
-// parameters for limits and motors
-// Change: New Type added, sintax enforcement
-    TJointParams = Integer;
-
-// These consts now have defined types
-
-{$IFDEF PARODE}
-  const
-     dJOINT_BREAK_UNKNOWN:TJointBreakMode =      $0000;
-     dJOINT_BROKEN:TJointBreakMode =             $0001;
-     dJOINT_DELETE_ON_BREAK:TJointBreakMode =    $0002;
-     dJOINT_BREAK_AT_B1_FORCE:TJointBreakMode =  $0004;
-     dJOINT_BREAK_AT_B1_TORQUE:TJointBreakMode = $0008;
-     dJOINT_BREAK_AT_B2_FORCE:TJointBreakMode =  $0010;
-     dJOINT_BREAK_AT_B2_TORQUE:TJointBreakMode = $0020;
-{$ENDIF}
-
-  const
-    _priv_dParamLoStop  = $000;
-    _priv_dParamLoStop2 = $100;
-    _priv_dParamLoStop3 = $200;
-  const
-    dParamLoStop: TJointParams = _priv_dParamLoStop;
-    dParamHiStop: TJointParams = _priv_dParamLoStop + 1;
-    dParamVel: TJointParams = _priv_dParamLoStop + 2;
-    dParamFMax: TJointParams = _priv_dParamLoStop + 3;
-    dParamFudgeFactor: TJointParams = _priv_dParamLoStop + 4;
-    dParamBounce: TJointParams = _priv_dParamLoStop + 5;
-    dParamCFM: TJointParams = _priv_dParamLoStop + 6;
-    dParamStopERP: TJointParams = _priv_dParamLoStop + 7;
-    dParamStopCFM: TJointParams = _priv_dParamLoStop + 8;
-    // parameters for suspension
-    dParamSuspensionERP: TJointParams = _priv_dParamLoStop + 9;
-    dParamSuspensionCFM: TJointParams = _priv_dParamLoStop + 10;
-    dParamERP: TJointParams = _priv_dParamLoStop + 11;
-
-    dParamGroup1: TJointParams = $000;
-    dParamLoStop1: TJointParams = _priv_dParamLoStop;
-    dParamHiStop1: TJointParams = _priv_dParamLoStop + 1;
-    dParamVel1: TJointParams = _priv_dParamLoStop + 2;
-    dParamFMax1: TJointParams = _priv_dParamLoStop + 3;
-    dParamFudgeFactor1: TJointParams = _priv_dParamLoStop + 4;
-    dParamBounce1: TJointParams = _priv_dParamLoStop + 5;
-    dParamCFM1: TJointParams = _priv_dParamLoStop + 6;
-    dParamStopERP1: TJointParams = _priv_dParamLoStop + 7;
-    dParamStopCFM1: TJointParams = _priv_dParamLoStop + 8;
-    // parameters for suspension
-    dParamSuspensionERP1: TJointParams = _priv_dParamLoStop + 9;
-    dParamSuspensionCFM1: TJointParams = _priv_dParamLoStop + 10;
-    dParamERP1: TJointParams = _priv_dParamLoStop + 11;
-
-    // SECOND AXEL
-    // parameters for limits and motors
-    dParamGroup2: TJointParams = $100;
-    dParamLoStop2: TJointParams = _priv_dParamLoStop2;
-    dParamHiStop2: TJointParams = _priv_dParamLoStop2 + 1;
-    dParamVel2: TJointParams = _priv_dParamLoStop2 + 2;
-    dParamFMax2: TJointParams = _priv_dParamLoStop2 + 3;
-    dParamFudgeFactor2: TJointParams = _priv_dParamLoStop2 + 4;
-    dParamBounce2: TJointParams = _priv_dParamLoStop2 + 5;
-    dParamCFM2: TJointParams = _priv_dParamLoStop2 + 6;
-    dParamStopERP2: TJointParams = _priv_dParamLoStop2 + 7;
-    dParamStopCFM2: TJointParams = _priv_dParamLoStop2 + 8;
-    // parameters for suspension
-    dParamSuspensionERP2: TJointParams = _priv_dParamLoStop2 + 9;
-    dParamSuspensionCFM2: TJointParams = _priv_dParamLoStop2 + 10;
-    dParamERP2: TJointParams = _priv_dParamLoStop2 + 11;
-
-    // THIRD AXEL
-    // parameters for limits and motors
-    dParamGroup3: TJointParams = $200;
-    dParamLoStop3: TJointParams = _priv_dParamLoStop3;
-    dParamHiStop3: TJointParams = _priv_dParamLoStop3 + 1;
-    dParamVel3: TJointParams = _priv_dParamLoStop3 + 2;
-    dParamFMax3: TJointParams = _priv_dParamLoStop3 + 3;
-    dParamFudgeFactor3: TJointParams = _priv_dParamLoStop3 + 4;
-    dParamBounce3: TJointParams = _priv_dParamLoStop3 + 5;
-    dParamCFM3: TJointParams = _priv_dParamLoStop3 + 6;
-    dParamStopERP3: TJointParams = _priv_dParamLoStop3 + 7;
-    dParamStopCFM3: TJointParams = _priv_dParamLoStop3 + 8;
-    // parameters for suspension
-    dParamSuspensionERP3: TJointParams = _priv_dParamLoStop3 + 9;
-    dParamSuspensionCFM3: TJointParams = _priv_dParamLoStop3 + 10;
-    dParamERP3: TJointParams = _priv_dParamLoStop3 + 11;
-    dParamGroup: TJointParams = $100;
-
-  // added by PAR
-   {$IFDEF PARODE}
-   function dSphereGetClass: integer; cdecl; external ODEDLL;
-   function dBoxGetClass: integer; cdecl; external ODEDLL;
-   function dCylinderGetClass: integer; cdecl; external ODEDLL;
-   function dCapsuleGetClass: integer; cdecl; external ODEDLL;
-   function dRayGetClass: integer; cdecl; external ODEDLL;
-   function dPlaneGetClass: integer; cdecl; external ODEDLL;
-   function dConvexGetClass: integer; cdecl; external ODEDLL;
-   function dTriMeshGetClass: integer; cdecl; external ODEDLL;
-   function dHeightfieldGetClass: integer; cdecl; external ODEDLL;
-   function dGeomTransformGetClass: integer; cdecl; external ODEDLL;
-   {$ENDIF}
-
-   procedure dInitODE; cdecl; external ODEDLL;
-   function dInitODE2(uiInitFlags: longword): integer; cdecl; external ODEDLL;
-
-  procedure dCloseODE; cdecl; external ODEDLL;
-
-
-  //----- dWorld -----
-  function dWorldCreate: PdxWorld; cdecl; external ODEDLL;
-  procedure dWorldDestroy(const World: PdxWorld); cdecl; external ODEDLL;
-  function dWorldGetCFM(const World: PdxWorld): TdReal; cdecl; external ODEDLL;
-  function dWorldGetERP(const World: PdxWorld): TdReal; cdecl; external ODEDLL;
-  procedure dWorldGetGravity(const World: PdxWorld; var gravity: TdVector3); cdecl; external ODEDLL;
-  procedure dWorldImpulseToForce(const World: PdxWorld; const stepsize, ix, iy, iz: TdReal; var force: TdVector3); cdecl; external ODEDLL;
-  procedure dWorldSetCFM(const World: PdxWorld; cfm: TdReal); cdecl; external ODEDLL;
-  procedure dWorldSetERP(const World: PdxWorld; erp: TdReal); cdecl; external ODEDLL;
-procedure dWorldSetGravity(const World: PdxWorld; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dWorldSetContactMaxCorrectingVel(const World: PdxWorld; const vel: TdReal); cdecl; external ODEDLL;
-  function dWorldGetContactMaxCorrectingVel(const World: PdxWorld): TdReal; cdecl; external ODEDLL;
-  procedure dWorldSetContactSurfaceLayer(const World: PdxWorld; const depth: TdReal); cdecl; external ODEDLL;
-  function dWorldGetContactSurfaceLayer(const World: PdxWorld): TdReal; cdecl; external ODEDLL;
-  procedure dWorldExportDIF(const World: PdxWorld; fileHandle: cardinal; const world_name:PAnsiChar); cdecl; external ODEDLL;
-
-  // Damping
-  function dWorldGetLinearDampingThreshold(const World: PdxWorld): TdReal; cdecl; external ODEDLL;
-  procedure dWorldSetLinearDampingThreshold(const World: PdxWorld; const threshold: TdReal); cdecl; external ODEDLL;
-  function dWorldGetAngularDampingThreshold(const World: PdxWorld): TdReal; cdecl; external ODEDLL;
-  procedure dWorldSetAngularDampingThreshold(const World: PdxWorld; const threshold: TdReal); cdecl; external ODEDLL;
-  function dWorldGetLinearDamping(const World: PdxWorld): TdReal; cdecl; external ODEDLL;
-  procedure dWorldSetLinearDamping(const World: PdxWorld; const scale: TdReal); cdecl; external ODEDLL;
-  function dWorldGetAngularDamping(const World: PdxWorld): TdReal; cdecl; external ODEDLL;
-  procedure dWorldSetAngularDamping(const World: PdxWorld; const scale: TdReal); cdecl; external ODEDLL;
-  procedure dWorldSetDamping(const World: PdxWorld; const linear_scale,angular_scale: TdReal); cdecl; external ODEDLL;
-  function dWorldGetMaxAngularSpeed(const World: PdxWorld): TdReal; cdecl; external ODEDLL;
-  procedure dWorldSetMaxAngularSpeed(const World: PdxWorld; const max_speed: TdReal); cdecl; external ODEDLL;
-  // Step
-  procedure dWorldStep(const World: PdxWorld; const stepsize: TdReal); cdecl; external ODEDLL;
-  // QuickStep
-  procedure dWorldQuickStep(const World: PdxWorld; const stepsize: TdReal); cdecl; external ODEDLL;
-  procedure dWorldSetQuickStepNumIterations(const World: PdxWorld; const num: integer); cdecl; external ODEDLL;
-  function dWorldGetQuickStepNumIterations(const World: PdxWorld): integer; cdecl; external ODEDLL;
-  procedure dWorldSetQuickStepW(const World: PdxWorld; const param: TdReal); cdecl; external ODEDLL;
-  function dWorldGetQuickStepW(const World: PdxWorld): TdReal; cdecl; external ODEDLL;
-  // Auto-disable functions
-  function dWorldGetAutoDisableLinearAverageThreshold(const World: PdxWorld): TdReal; cdecl; external ODEDLL;
-  procedure dWorldSetAutoDisableLinearAverageThreshold(const World: PdxWorld; linear_average_threshold: TdReal); cdecl; external ODEDLL;
-  function dWorldGetAutoDisableAngularAverageThreshold(const World: PdxWorld): TdReal; cdecl; external ODEDLL;
-  procedure dWorldSetAutoDisableAngularAverageThreshold(const World: PdxWorld; linear_average_threshold: TdReal); cdecl; external ODEDLL;
-  function dWorldGetAutoDisableAverageSamplesCount(const World: PdxWorld): TdReal; cdecl; external ODEDLL;
-  procedure dWorldSetAutoDisableAverageSamplesCount(const World: PdxWorld; linear_average_threshold: TdReal); cdecl; external ODEDLL;
-
-  function dWorldGetAutoDisableLinearThreshold(const World: PdxWorld): TdReal; cdecl; external ODEDLL;
-  procedure dWorldSetAutoDisableLinearThreshold(const World: PdxWorld; linThreshold: TdReal); cdecl; external ODEDLL;
-  function dWorldGetAutoDisableAngularThreshold(const World: PdxWorld): TdReal; cdecl; external ODEDLL;
-  procedure dWorldSetAutoDisableAngularThreshold(const World: PdxWorld; angThreshold: TdReal); cdecl; external ODEDLL;
-  function dWorldGetAutoDisableSteps(const World: PdxWorld): Integer; cdecl; external ODEDLL;
-  procedure dWorldSetAutoDisableSteps(const World: PdxWorld; steps: Integer); cdecl; external ODEDLL;
-  function dWorldGetAutoDisableTime(const World: PdxWorld): TdReal; cdecl; external ODEDLL;
-  procedure dWorldSetAutoDisableTime(const World: PdxWorld; time: TdReal); cdecl; external ODEDLL;
-  function dWorldGetAutoDisableFlag(const World: PdxWorld): Integer; cdecl; external ODEDLL;
-  procedure dWorldSetAutoDisableFlag(const World: PdxWorld; do_auto_disable: Integer); cdecl; external ODEDLL;
-
-
-  //----- dBody -----
-  procedure dBodyAddForce(const Body: PdxBody; const fx, fy, fz: TdReal); cdecl; external ODEDLL;
-  procedure dBodyAddForceAtPos(const Body: PdxBody; const fx, fy, fz, px, py, pz: TdReal); cdecl; external ODEDLL;
-  procedure dBodyAddForceAtRelPos(const Body: PdxBody; const fx, fy, fz, px, py, pz: TdReal); cdecl; external ODEDLL;
-  procedure dBodyAddRelForce(const Body: PdxBody; const fx, fy, fz: TdReal); cdecl; external ODEDLL;
-  procedure dBodyAddRelForceAtPos(const Body: PdxBody; const fx, fy, fz, px, py, pz: TdReal); cdecl; external ODEDLL;
-  procedure dBodyAddRelForceAtRelPos(const Body: PdxBody; const fx, fy, fz, px, py, pz: TdReal); cdecl; external ODEDLL;
-  procedure dBodyAddRelTorque(const Body: PdxBody; const fx, fy, fz: TdReal); cdecl; external ODEDLL;
-  procedure dBodyAddTorque(const Body: PdxBody; const fx, fy, fz: TdReal); cdecl; external ODEDLL;
-
-  function dBodyCreate(const World: PdxWorld): PdxBody; cdecl; external ODEDLL;
-  procedure dBodyDestroy(const Body: PdxBody); cdecl; external ODEDLL;
-  procedure dBodyDisable(const Body: PdxBody); cdecl; external ODEDLL;
-  procedure dBodyEnable(const Body: PdxBody); cdecl; external ODEDLL;
-  function dBodyGetAngularVel(const Body: PdxBody): PdVector3; cdecl; external ODEDLL;
-  procedure dBodyGetFiniteRotationAxis(const Body: PdxBody; var result: TdVector3); cdecl; external ODEDLL;
-  function dBodyGetFiniteRotationMode(const Body: PdxBody): Integer; cdecl; external ODEDLL;
-  function dBodyGetForce(const Body: PdxBody): PdVector3; cdecl; external ODEDLL;
-  function dBodyGetGravityMode(const Body: PdxBody): Integer; cdecl; external ODEDLL;
-  function dBodyGetJoint(const Body: PdxBody; const index: Integer): TdJointID; cdecl; external ODEDLL;
-  function dBodyGetLinearVel(const Body: PdxBody): PdVector3; cdecl; external ODEDLL;
-  procedure dBodyGetMass(const Body: PdxBody; var mass: TdMass); cdecl; external ODEDLL;
-  function dBodyGetNumJoints(const Body: PdxBody): Integer; cdecl; external ODEDLL;
-  procedure dBodyGetPointVel(const Body: PdxBody; const px, py, pz: TdReal; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dBodyGetPosRelPoint(const Body: PdxBody; const px, py, pz: TdReal; var result: TdVector3); cdecl; external ODEDLL;
-  function dBodyGetPosition(const Body: PdxBody): PdVector3; cdecl; external ODEDLL;
-  function dBodyGetQuaternion(const Body: PdxBody): PdQuaternion; cdecl; external ODEDLL;
-  procedure dBodyGetRelPointPos(const Body: PdxBody; const px, py, pz: TdReal; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dBodyGetRelPointVel(const Body: PdxBody; const px, py, pz: TdReal; var result: TdVector3); cdecl; external ODEDLL;
-  function dBodyGetRotation(const Body: PdxBody): PdMatrix3; cdecl; external ODEDLL;
-  function dBodyGetTorque(const Body: PdxBody): PdVector3; cdecl; external ODEDLL;
-  function dBodyIsEnabled(const Body: PdxBody): Integer; cdecl; external ODEDLL;
-  procedure dBodySetAngularVel(const Body: PdxBody; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dBodySetFiniteRotationAxis(const Body: PdxBody; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dBodySetFiniteRotationMode(const Body: PdxBody; const mode: Integer); cdecl; external ODEDLL;
-  procedure dBodySetForce(const Body: PdxBody; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dBodySetGravityMode(const Body: PdxBody; const mode: Integer); cdecl; external ODEDLL;
-  procedure dBodySetLinearVel(const Body: PdxBody; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dBodySetMass( const Body: PdxBody; const mass: PdMass); cdecl; external ODEDLL;
-  procedure dBodySetPosition(const Body: PdxBody; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dBodySetQuaternion(const Body: PdxBody; const q: TdQuaternion); cdecl; external ODEDLL;
-  procedure dBodySetRotation(const Body: PdxBody; const R: TdMatrix3); cdecl; external ODEDLL;
-  procedure dBodySetTorque(const Body: PdxBody; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dBodyVectorFromWorld(const Body: PdxBody; const px, py, pz: TdReal; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dBodyVectorToWorld(const Body: PdxBody; const px, py, pz: TdReal; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dBodySetData (const Body: PdxBody; data : pointer); cdecl; external ODEDLL;
-  function dBodyGetData (const Body: PdxBody) : pointer; cdecl; external ODEDLL;
-  procedure dBodySetMovedCallback (const Body: PdxBody; Callback: TdMovedCallback); cdecl; external ODEDLL;
-  procedure dBodyCopyPosition(const Body: PdxBody; const pos: TdVector3); cdecl; external ODEDLL;
-  procedure dBodyCopyRotation(const Body: PdxBody; const R: TdMatrix3); cdecl; external ODEDLL;
-  procedure dBodyCopyQuaternion(const Body: PdxBody; const quat: TdQuaternion); cdecl; external ODEDLL;
-
-  // damping functions
-  procedure dBodySetLinearDamping (const Body: PdxBody; scale: TdReal); cdecl; external ODEDLL;
-  function dBodyGetLinearDamping (const Body: PdxBody): TdReal; cdecl; external ODEDLL;
-  procedure dBodySetAngularDamping(const Body: PdxBody; scale : TdReal); cdecl; external ODEDLL;
-  function dBodyGetAngularDamping(const Body: PdxBody): TdReal; cdecl; external ODEDLL;
-  procedure dBodySetDamping(const Body: PdxBody; linear_scale, angular_scale: TdReal); cdecl; external ODEDLL;
-  function dBodyGetLinearDampingThreshold(const Body: PdxBody): TdReal; cdecl; external ODEDLL;
-  procedure dBodySetLinearDampingThreshold(const Body: PdxBody; threshold: TdReal); cdecl; external ODEDLL;
-  function dBodyGetAngularDampingThreshold(const Body: PdxBody): TdReal; cdecl; external ODEDLL;
-  procedure dBodySetAngularDampingThreshold(const Body: PdxBody; threshold: TdReal); cdecl; external ODEDLL;
-  procedure dBodySetDampingDefaults(const Body: PdxBody; threshold: TdReal); cdecl; external ODEDLL;
-  procedure dBodySetMaxAngularSpeed(const Body: PdxBody; max_speed: TdReal); cdecl; external ODEDLL;
-  function dBodyGetMaxAngularSpeed(const Body: PdxBody): TdReal; cdecl; external ODEDLL;
-
-  // Auto-disable functions
-  function dBodyGetAutoDisableLinearThreshold(const Body: PdxBody): TdReal; cdecl; external ODEDLL;
-  procedure dBodySetAutoDisableLinearThreshold(const Body: PdxBody; linThreshold: TdReal); cdecl; external ODEDLL;
-  function dBodyGetAutoDisableAngularThreshold(const Body: PdxBody): TdReal; cdecl; external ODEDLL;
-  procedure dBodySetAutoDisableAngularThreshold(const Body: PdxBody; angThreshold: TdReal); cdecl; external ODEDLL;
-  function dBodyGetAutoDisableSteps(const Body: PdxBody): Integer; cdecl; external ODEDLL;
-  procedure dBodySetAutoDisableSteps(const Body: PdxBody; steps: Integer); cdecl; external ODEDLL;
-  function dBodyGetAutoDisableTime(const Body: PdxBody): TdReal; cdecl; external ODEDLL;
-  procedure dBodySetAutoDisableTime(const Body: PdxBody; time: TdReal); cdecl; external ODEDLL;
-  function dBodyGetAutoDisableFlag(const Body: PdxBody): Integer; cdecl; external ODEDLL;
-  procedure dBodySetAutoDisableFlag(const Body: PdxBody; do_auto_disable: Integer); cdecl; external ODEDLL;
-  procedure dBodySetAutoDisableDefaults(const Body: PdxBody); cdecl; external ODEDLL;
-  procedure dBodySetAutoDisableAverageSamplesCount(const Body: PdxBody; average_samples_count: longword); cdecl; external ODEDLL;
-
-
-  //----- dJoint -----
-  {$IFDEF PARODE}
-  // breakable joints
-  procedure dJointSetBreakable (const dJointID: TdJointID; b: integer); cdecl; external ODEDLL;
-  procedure dJointSetBreakCallback (const dJointID: TdJointID; callbackFunc:TdJointBreakCallback); cdecl; external ODEDLL;
-  procedure dJointSetBreakMode (const dJointID: TdJointID; mode: integer); cdecl; external ODEDLL;
-  function dJointGetBreakMode (const dJointID: TdJointID): integer; cdecl; external ODEDLL;
-  procedure dJointSetBreakForce(const dJointID: TdJointID; body: integer; x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dJointSetBreakTorque(const dJointID: TdJointID; body: integer; x, y, z: TdReal); cdecl; external ODEDLL;
-  function dJointIsBreakable (const dJointID: TdJointID): integer; cdecl; external ODEDLL;
-  procedure dJointGetBreakForce(const dJointID: TdJointID; body: integer; var force: TdVector3); cdecl; external ODEDLL;
-  procedure dJointGetBreakTorque(const dJointID: TdJointID; body: integer; var torque: TdVector3); cdecl; external ODEDLL;
-  {$ENDIF}
-
-  // normal joints
-  procedure dJointGroupDestroy(const dJointGroupID: TdJointGroupID); cdecl; external ODEDLL;
-  function dJointGroupCreate(const max_size: Integer): TdJointGroupID; cdecl; external ODEDLL;
-  procedure dJointGroupEmpty(const dJointGroupID: TdJointGroupID); cdecl; external ODEDLL;
-
-  procedure dJointAttach(const dJointID: TdJointID; const body1, body2: PdxBody); cdecl; external ODEDLL;
-  procedure dJointDestroy(const dJointID: TdJointID); cdecl; external ODEDLL;
-
-  function dJointGetData (const dJointID: TdJointID): pointer; cdecl; external ODEDLL;
-  procedure dJointSetData (const dJointID: TdJointID; data: Pointer); cdecl; external ODEDLL;
-
-  // callback routines for feedback of joints
-  procedure dJointSetFeedback (const dJointID: TdJointID; Feedback: PTdJointFeedback); cdecl; external ODEDLL;
-  function dJointGetFeedback (const dJointID: TdJointID): PTdJointFeedback; cdecl; external ODEDLL;
-
-  function dJointGetType(const dJointID: TdJointID): Integer; cdecl; external ODEDLL;
-  function dJointGetBody(const dJointID: TdJointID; const index: Integer): PdxBody; cdecl; external ODEDLL;
-
-  //Contact
-  function dJointCreateContact(const World: PdxWorld; dJointGroupID: TdJointGroupID; const dContact: PdContact): TdJointID; cdecl; external ODEDLL;
-
-  //AMotor
-  function dJointCreateAMotor(const World: PdxWorld; dJointGroupID: TdJointGroupID): TdJointID; cdecl; external ODEDLL;
-  procedure dJointSetAMotorAngle(const dJointID: TdJointID; const anum: Integer; const angle: TdReal); cdecl; external ODEDLL;
-  function dJointGetAMotorAngle(const dJointID: TdJointID; const anum: Integer): TdReal; cdecl; external ODEDLL;
-  procedure dJointSetAMotorAxis(const dJointID: TdJointID; const anum, rel: Integer; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dJointGetAMotorAxis(const dJointID: TdJointID; const anum: Integer; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dJointSetAMotorNumAxes(const dJointID: TdJointID; const num: Integer); cdecl; external ODEDLL;
-  function dJointGetAMotorNumAxes(const dJointID: TdJointID): Integer; cdecl; external ODEDLL;
-  procedure dJointSetAMotorParam(const dJointID: TdJointID; const parameter: TJointParams; const value: TdReal); cdecl; external ODEDLL;
-  function dJointGetAMotorParam(const dJointID: TdJointID; const parameter: TJointParams): TdReal; cdecl; external ODEDLL;
-  procedure dJointSetAMotorMode(const dJointID: TdJointID; const mode: TdAngularMotorModeNumbers); cdecl; external ODEDLL;
-  function dJointGetAMotorMode(const dJointID: TdJointID): Integer; cdecl; external ODEDLL;
-  procedure dJointAddAMotorTorques (const dJointID: TdJointID; torque1, torque2, torque3: TdReal); cdecl; external ODEDLL;
-  function dJointGetAMotorAngleRate(const dJointID: TdJointID; const anum: Integer): TdReal; cdecl; external ODEDLL;
-  function dJointGetAMotorAxisRel(const dJointID: TdJointID; const anum: Integer): Integer; cdecl; external ODEDLL;
-
-  //LMotor
-  function dJointCreateLMotor(const World: PdxWorld; dJointGroupID : TdJointGroupID): TdJointID; cdecl; external ODEDLL;
-  procedure dJointSetLMotorAxis(const dJointID: TdJointID; const anum, rel: Integer; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dJointGetLMotorAxis(const dJointID: TdJointID; const anum: Integer; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dJointSetLMotorNumAxes(const dJointID: TdJointID; const num: Integer); cdecl; external ODEDLL;
-  function dJointGetLMotorNumAxes(const dJointID: TdJointID): Integer; cdecl; external ODEDLL;
-  procedure dJointSetLMotorParam(const dJointID: TdJointID; const parameter: TJointParams; const value: TdReal); cdecl; external ODEDLL;
-  function dJointGetLMotorParam(const dJointID: TdJointID; const parameter: TJointParams): TdReal; cdecl; external ODEDLL;
-
-  //Ball
-  function dJointCreateBall(const World: PdxWorld; dJointGroupID : TdJointGroupID): TdJointID; cdecl; external ODEDLL;
-  procedure dJointSetBallAnchor(const dJointID: TdJointID; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dJointGetBallAnchor(const dJointID: TdJointID; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dJointGetBallAnchor2(const dJointID: TdJointID; var result: TdVector3); cdecl; external ODEDLL;
-
-  //Hinge
-  function dJointCreateHinge(const World: PdxWorld; dJointGroupID : TdJointGroupID): TdJointID; cdecl; external ODEDLL;
-  procedure dJointSetHingeAnchor(const dJointID: TdJointID; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dJointGetHingeAnchor(const dJointID: TdJointID; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dJointGetHingeAnchor2(const dJointID: TdJointID; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dJointSetHingeAxis(const dJointID: TdJointID; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dJointGetHingeAxis(const dJointID: TdJointID; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dJointSetHingeParam(const dJointID: TdJointID; const parameter: TJointParams; const value: TdReal); cdecl; external ODEDLL;
-  function dJointGetHingeParam(const dJointID: TdJointID; const parameter: TJointParams): TdReal; cdecl; external ODEDLL;
-  function dJointGetHingeAngle(const dJointID: TdJointID): TdReal; cdecl; external ODEDLL;
-  function dJointGetHingeAngleRate(const dJointID: TdJointID): TdReal; cdecl; external ODEDLL;
-  procedure dJointAddHingeTorque (const dJointID: TdJointID; torque: TdReal); cdecl; external ODEDLL;
-
-  //Hinge2
-  function dJointCreateHinge2(const World: PdxWorld; dJointGroupID : TdJointGroupID): TdJointID; cdecl; external ODEDLL;
-  procedure dJointSetHinge2Anchor(const dJointID: TdJointID; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dJointGetHinge2Anchor(const dJointID: TdJointID; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dJointGetHinge2Anchor2(const dJointID: TdJointID; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dJointSetHinge2Axis1(const dJointID: TdJointID; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dJointGetHinge2Axis1(const dJointID: TdJointID; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dJointSetHinge2Axis2(const dJointID: TdJointID; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dJointGetHinge2Axis2(const dJointID: TdJointID; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dJointSetHinge2Param(const dJointID: TdJointID; const parameter: TJointParams; const value: TdReal); cdecl; external ODEDLL;
-  function dJointGetHinge2Param(const dJointID: TdJointID; const parameter: TJointParams): TdReal; cdecl; external ODEDLL;
-  function dJointGetHinge2Angle1(const dJointID: TdJointID): TdReal; cdecl; external ODEDLL;
-  function dJointGetHinge2Angle1Rate(const dJointID: TdJointID): TdReal; cdecl; external ODEDLL;
-  function dJointGetHinge2Angle2Rate(const dJointID: TdJointID): TdReal; cdecl; external ODEDLL;
-  procedure dJointAddHinge2Torques (const dJointID: TdJointID; torque1, torque2: TdReal); cdecl; external ODEDLL;
-  procedure dJointCorrectHinge2(const dJointID: TdJointID); cdecl; external ODEDLL;
-
-  //Slider
-  function dJointCreateSlider(const World: PdxWorld; dJointGroupID : TdJointGroupID): TdJointID; cdecl; external ODEDLL;
-  procedure dJointSetSliderAxis(const dJointID: TdJointID; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dJointGetSliderAxis(const dJointID: TdJointID; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dJointSetSliderParam(const dJointID: TdJointID; const parameter: TJointParams; const value: TdReal); cdecl; external ODEDLL;
-  function dJointGetSliderParam(const dJointID: TdJointID; const parameter: TJointParams): TdReal; cdecl; external ODEDLL;
-  function dJointGetSliderPosition(const dJointID: TdJointID): TdReal; cdecl; external ODEDLL;
-  function dJointGetSliderPositionRate(const dJointID: TdJointID): TdReal; cdecl; external ODEDLL;
-  procedure dJointAddSliderForce (const dJointID: TdJointID; force: TdReal); cdecl; external ODEDLL;
-
-  //Universal
-  function dJointCreateUniversal(const World: PdxWorld; dJointGroupID : TdJointGroupID): TdJointID; cdecl; external ODEDLL;
-  procedure dJointGetUniversalAnchor(const dJointID: TdJointID; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dJointGetUniversalAnchor2(const dJointID: TdJointID; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dJointSetUniversalAxis1(const dJointID: TdJointID; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dJointGetUniversalAxis1(const dJointID: TdJointID; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dJointSetUniversalAxis2(const dJointID: TdJointID; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dJointGetUniversalAxis2(const dJointID: TdJointID; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dJointSetUniversalParam(const dJointID: TdJointID; const parameter: TJointParams; const value: TdReal); cdecl; external ODEDLL;
-  function dJointGetUniversalParam(const dJointID: TdJointID; const parameter: TJointParams): TdReal; cdecl; external ODEDLL;
-  function dJointGetUniversalAngle1(const dJointID: TdJointID): TdReal; cdecl; external ODEDLL;
-  function dJointGetUniversalAngle2(const dJointID: TdJointID): TdReal; cdecl; external ODEDLL;
-  function dJointGetUniversalAngle1Rate(const dJointID: TdJointID): TdReal; cdecl; external ODEDLL;
-  function dJointGetUniversalAngle2Rate(const dJointID: TdJointID): TdReal; cdecl; external ODEDLL;
-  procedure dJointSetUniversalAnchor(const dJointID: TdJointID; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dJointAddUniversalTorques (const dJointID: TdJointID; torque1, torque2: TdReal); cdecl; external ODEDLL;
-
-  //Fixed
-  function dJointCreateFixed(const World: PdxWorld; dJointGroupID : TdJointGroupID): TdJointID; cdecl; external ODEDLL;
-  procedure dJointSetFixed(const dJointID: TdJointID); cdecl; external ODEDLL;
-
-  //Plane2D
-  function dJointCreatePlane2D(const World: PdxWorld; dJointGroupID : TdJointGroupID): TdJointID; cdecl; external ODEDLL;
-  procedure dJointSetPlane2DXParam(const dJointID: TdJointID; const parameter: Integer; const value: TdReal); cdecl; external ODEDLL;
-  procedure dJointSetPlane2DYParam(const dJointID: TdJointID; const parameter: Integer; const value: TdReal); cdecl; external ODEDLL;
-  procedure dJointSetPlane2DAngleParam(const dJointID: TdJointID; const parameter: Integer; const value: TdReal); cdecl; external ODEDLL;
-
-  //PR
-  function dJointCreatePR(const World: PdxWorld; dJointGroupID : TdJointGroupID): TdJointID; cdecl; external ODEDLL;
-  procedure dJointSetPRAnchor(const dJointID: TdJointID; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dJointSetPRAxis1(const dJointID: TdJointID; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dJointGetPRAxis1(const dJointID: TdJointID; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dJointSetPRAxis2(const dJointID: TdJointID; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dJointGetPRAxis2(const dJointID: TdJointID; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dJointSetPRParam(const dJointID: TdJointID; const parameter: TJointParams; const value: TdReal); cdecl; external ODEDLL;
-  function dJointGetPRParam(const dJointID: TdJointID; parameter: integer): TdReal; cdecl; external ODEDLL;
-  procedure dJointAddPRTorque (const dJointID: TdJointID; torque: TdReal); cdecl; external ODEDLL;
-
-  //Piston
-  function dJointCreatePiston(const World: PdxWorld; dJointGroupID : TdJointGroupID): TdJointID; cdecl; external ODEDLL;
-  procedure dJointSetPistonAnchor(const dJointID: TdJointID; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dJointGetPistonAnchor(const dJointID: TdJointID; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dJointGetPistonAnchor2(const dJointID: TdJointID; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dJointSetPistonAxis(const dJointID: TdJointID; const x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dJointGetPistonAxis(const dJointID: TdJointID; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dJointSetPistonParam(const dJointID: TdJointID; const parameter: TJointParams; const value: TdReal); cdecl; external ODEDLL;
-  function dJointGetPistonParam(const dJointID: TdJointID; parameter : integer): TdReal; cdecl; external ODEDLL;
-  procedure dJointSetPistonAxisDelta(const dJointID: TdJointID; const x, y, z, ax, ay, az: TdReal); cdecl; external ODEDLL;
-  procedure dJointAddPistonForce (const dJointID: TdJointID; force: TdReal); cdecl; external ODEDLL;
-  function dJointGetPistonPosition(const dJointID: TdJointID): TdReal; cdecl; external ODEDLL;
-  function dJointGetPistonAngle(const dJointID: TdJointID): TdReal; cdecl; external ODEDLL;
-  function dJointGetPistonAngleRate(const dJointID: TdJointID): TdReal; cdecl; external ODEDLL;
-  function dJointGetPistonRate(const dJointID: TdJointID): TdReal; cdecl; external ODEDLL;
-
-
-  //----- dGeom -----
-  function dCreateGeom (classnum: Integer): PdxGeom; cdecl; external ODEDLL;
-  procedure dGeomDestroy(const Geom: PdxGeom); cdecl; external ODEDLL;
-
-  function dCreateGeomClass(const classptr: TdGeomClass): Integer; cdecl; external ODEDLL;
-  function dGeomGetClass(const Geom: PdxGeom): Integer; cdecl; external ODEDLL;
-  function dGeomGetClassData(o: PdxGeom): Pointer; cdecl; external ODEDLL;
-
-  function dGeomGetSpace(const Geom: PdxGeom): PdxSpace; cdecl; external ODEDLL;
-  function dGeomIsSpace (const Geom: PdxGeom): integer; cdecl; external ODEDLL;
-  procedure dGeomSetBody(const Geom: PdxGeom; Body: PdxBody); cdecl; external ODEDLL;
-  function dGeomGetBody(const Geom: PdxGeom): PdxBody; cdecl; external ODEDLL;
-
-  procedure dGeomSetPosition(const Geom: PdxGeom; const x, y, z: TdReal); cdecl; external ODEDLL;
-  function dGeomGetPosition(const Geom: PdxGeom): PdVector3; cdecl; external ODEDLL;
-  procedure dGeomSetRotation(const Geom: PdxGeom; const R: TdMatrix3); cdecl; external ODEDLL;
-  function dGeomGetRotation(const Geom: PdxGeom): PdMatrix3; cdecl; external ODEDLL;
-  procedure dGeomSetQuaternion(const Geom: PdxGeom; const TdQuaternion); cdecl; external ODEDLL;
-  procedure dGeomGetQuaternion(const Geom: PdxGeom; var result: TdQuaternion); cdecl; external ODEDLL;
-  procedure dGeomCopyPosition(const Geom: PdxGeom; const pos: TdVector3); cdecl; external ODEDLL;
-  procedure dGeomCopyRotation(const Geom: PdxGeom; const R: TdMatrix3); cdecl; external ODEDLL;
-  procedure dGeomCopyQuaternion(const Geom: PdxGeom; const quat: TdQuaternion); cdecl; external ODEDLL;
-
-  procedure dGeomSetData (const Geom: PdxGeom; data : pointer); cdecl; external ODEDLL;
-  function dGeomGetData (const Geom: PdxGeom): pointer; cdecl; external ODEDLL;
-  procedure dGeomEnable (const Geom: PdxGeom); cdecl; external ODEDLL;
-  procedure dGeomDisable (const Geom: PdxGeom); cdecl; external ODEDLL;
-  function dGeomIsEnabled (const Geom: PdxGeom): integer; cdecl; external ODEDLL;
-  procedure dGeomGetAABB(const Geom: PdxGeom; var aabb: TdAABB); cdecl; external ODEDLL;
-  procedure dGeomSetCategoryBits (const Geom: PdxGeom; bits : Cardinal); cdecl; external ODEDLL;
-  function dGeomGetCategoryBits (const Geom: PdxGeom): cardinal; cdecl; external ODEDLL;
-  procedure dGeomSetCollideBits (const Geom: PdxGeom; bits : Cardinal); cdecl; external ODEDLL;
-  function dGeomGetCollideBits (const Geom: PdxGeom): cardinal; cdecl; external ODEDLL;
-
-  procedure dGeomSetOffsetPosition (const Geom: PdxGeom; x,y,z:TdReal); cdecl; external ODEDLL;
-  function dGeomGetOffsetPosition(const Geom: PdxGeom): PdVector3; cdecl; external ODEDLL;
-  procedure dGeomSetOffsetRotation (const Geom: PdxGeom; R:TdMatrix3); cdecl; external ODEDLL;
-  function dGeomGetOffsetRotation(const Geom: PdxGeom): PdVector3; cdecl; external ODEDLL;
-  procedure dGeomSetOffsetQuaternion (const Geom: PdxGeom; const Q:TdQuaternion); cdecl; external ODEDLL;
-  procedure dGeomGetOffsetQuaternion (const Geom: PdxGeom; var Q:TdQuaternion); cdecl; external ODEDLL;
-  procedure dGeomClearOffset (const Geom: PdxGeom); cdecl; external ODEDLL;
-  procedure dGeomSetOffsetWorldPosition (const Geom: PdxGeom; x,y,z:TdReal); cdecl; external ODEDLL;
-  procedure dGeomSetOffsetWorldRotation (const Geom: PdxGeom; R:TdMatrix3); cdecl; external ODEDLL;
-  procedure dGeomSetOffsetWorldQuaternion (const Geom: PdxGeom; const Q:TdQuaternion); cdecl; external ODEDLL;
-  procedure dGeomCopyOffsetPosition(const Geom: PdxGeom; var pos: TdVector3); cdecl; external ODEDLL;
-  procedure dGeomCopyOffsetRotation(const Geom: PdxGeom; var R: TdMatrix3); cdecl; external ODEDLL;
-  procedure dGeomIsOffset(const Geom: PdxGeom); cdecl; external ODEDLL;
-
-  //Transform
-  function dCreateGeomTransform(const Space: PdxSpace): PdxGeom; cdecl; external ODEDLL;
-  procedure dGeomTransformSetGeom(const Geom, obj: PdxGeom); cdecl; external ODEDLL;
-  function dGeomTransformGetGeom(const Geom: PdxGeom): PdxGeom; cdecl; external ODEDLL;
-  procedure dGeomTransformSetInfo(const Geom: PdxGeom; mode: integer); cdecl; external ODEDLL;
-  function dGeomTransformGetInfo(const Geom: PdxGeom): integer; cdecl; external ODEDLL;
-  procedure dGeomTransformSetCleanup(const Geom: PdxGeom; const mode: Integer); cdecl; external ODEDLL;
-  function dGeomTransformGetCleanup(const Geom: PdxGeom): Integer; cdecl; external ODEDLL;
-
-  //Box
-  function dCreateBox(const Space: PdxSpace; const lx, ly, lz: TdReal): PdxGeom; cdecl; external ODEDLL;
-  procedure dGeomBoxGetLengths(const Geom: PdxGeom; var result: TdVector3); cdecl; external ODEDLL;
-  procedure dGeomBoxSetLengths(const Geom: PdxGeom; const lx, ly, lz: TdReal); cdecl; external ODEDLL;
-  function dGeomBoxPointDepth(const Geom: PdxGeom; const x,y,z: TdReal): TdReal; cdecl; external ODEDLL;
-
-  // dCylinder (not a capped cylinder).
-  function dCreateCylinder(const Space: PdxSpace; r, lz: TdReal): PdxGeom; cdecl; external ODEDLL;
-  procedure dGeomCylinderSetParams(const Geom: PdxGeom; radius, length: TdReal); cdecl; external ODEDLL;
-  procedure dGeomCylinderGetParams(const Geom: PdxGeom; var radius, length: TdReal); cdecl; external ODEDLL;
-
-  // dCapsule (a capped cylinder).
-  function dCreateCapsule(const Space: PdxSpace; const radius, length: TdReal): PdxGeom; cdecl; external ODEDLL;
-  procedure dGeomCapsuleSetParams(const Geom: PdxGeom; const radius, length: TdReal); cdecl; external ODEDLL;
-  procedure dGeomCapsuleGetParams(const Geom: PdxGeom; var radius, length: TdReal); cdecl; external ODEDLL;
-  function dGeomCapsulePointDepth(const Geom: PdxGeom; const x,y,z: TdReal): TdReal; cdecl; external ODEDLL;
-
-  //Plane
-  function dCreatePlane(const Space: PdxSpace; const a, b, c, d: TdReal): PdxGeom; cdecl; external ODEDLL;
-  procedure dGeomPlaneSetParams(const Geom: PdxGeom; const a, b, c, d: TdReal); cdecl; external ODEDLL;
-  procedure dGeomPlaneGetParams(const Geom: PdxGeom; var result: TdVector4); cdecl; external ODEDLL;
-  function dGeomPlanePointDepth(const Geom: PdxGeom; const x,y,z: TdReal): TdReal; cdecl; external ODEDLL;
-
-  //Sphere
-  function dCreateSphere(const Space: PdxSpace; const radius: TdReal): PdxGeom; cdecl; external ODEDLL;
-  procedure dGeomSphereSetRadius(const Geom: PdxGeom; const radius: TdReal); cdecl; external ODEDLL;
-  function dGeomSphereGetRadius(const Geom: PdxGeom): TdReal; cdecl; external ODEDLL;
-  function dGeomSpherePointDepth(const Geom: PdxGeom; const x,y,z: TdReal): TdReal; cdecl; external ODEDLL;
-
-  //Convex
-  function dCreateConvex(const Space: PdxSpace; _planes: PdReal; _planecount: longword; _points: PdReal; _pointcount: longword; const _polygons:longword): PdxGeom; cdecl; external ODEDLL;
-  procedure dGeomSetConvex(const Geom: PdxGeom; _planes: PdReal; _planecount: longword; _points: PdReal; _pointcount: longword; const _polygons:longword); cdecl; external ODEDLL;
-
-  //Heightfield  (incomplete)
-  function dCreateHeightfield(const Space: PdxSpace; Data: PdxHeightfieldData; bPlaceable:Integer): PdxGeom; cdecl; external ODEDLL;
-  function dGeomHeightfieldDataCreate: PdxHeightfieldData; cdecl; external ODEDLL;
-  procedure dGeomHeightfieldDataDestroy(Data: PdxHeightfieldData); cdecl; external ODEDLL;
-  procedure dGeomHeightfieldSetHeightfieldData(const Geom: PdxGeom; Data: PdxHeightfieldData); cdecl; external ODEDLL;
-  function dGeomHeightfieldGetHeightfieldData(const Geom: PdxGeom):PdxHeightfieldData; cdecl; external ODEDLL;
-  function dGeomHeightfieldDataSetBounds(Data: PdxHeightfieldData; minHeight, MaxHeight: TdReal) : TdReal; cdecl; external ODEDLL;
-
-  //dRay
-  function dCreateRay(const Space: PdxSpace; length: TdReal): PdxGeom; cdecl; external ODEDLL;
-  procedure dGeomRaySet(const geom: PdxGeom; px, py, pz, dx, dy, dz: TdReal); cdecl; external ODEDLL;
-  procedure dGeomRayGet(const geom: PdxGeom; var start, dir: TdVector3); cdecl; external ODEDLL;
-  procedure dGeomRaySetLength(const geom: PdxGeom; length: TdReal); cdecl; external ODEDLL;
-  function dGeomRayGetLength(const geom: PdxGeom): TdReal; cdecl; external ODEDLL;
-  procedure dGeomRaySetParams(const geom: PdxGeom; FirstContact, BackfacCull: Integer); cdecl; external ODEDLL;
-  procedure dGeomRayGetParams(const geom: PdxGeom; var FirstContact, BackfacCull: Integer); cdecl; external ODEDLL;
-  procedure dGeomRaySetClosestHit(const geom: PdxGeom; closestHit: Integer); cdecl; external ODEDLL;
-  function dGeomRayGetClosestHit(const geom: PdxGeom): Integer; cdecl; external ODEDLL;
-
-  //TriMesh
-  function dCreateTriMesh(const Space : PdxSpace; Data: PdxTriMeshData; Callback:TdTriCallback; ArrayCallback:TdTriArrayCallback; RayCallback: TdTriRayCallback): PdxGeom; cdecl; external ODEDLL;
-
-  procedure dGeomTriMeshSetData(g: PdxGeom; Data: PdxTriMeshData); cdecl; external ODEDLL;
-  function dGeomTriMeshGetData(g: PdxGeom):PdxTriMeshData; cdecl; external ODEDLL;
-  function dGeomTriMeshGetTriMeshDataID(g: PdxGeom): PdxTriMeshData; cdecl; external ODEDLL;
-  procedure dGeomTriMeshDataUpdate(g: PdxTriMeshData); cdecl; external ODEDLL;
-
-  function dGeomTriMeshIsTCEnabled(g: PdxGeom; geomClass: Integer): Integer; cdecl; external ODEDLL;
-  procedure dGeomTriMeshEnableTC(g: PdxGeom; geomClass, enable: Integer); cdecl; external ODEDLL;
-  procedure dGeomTriMeshClearTCCache(g: PdxGeom); cdecl; external ODEDLL;
-
-  function dGeomTriMeshGetTriangleCount(g: PdxGeom) : integer; cdecl; external ODEDLL;
-  procedure dGeomTriMeshGetTriangle(g: PdxGeom; Index: Integer; v0, v1, v2: PdVector3); cdecl; external ODEDLL;
-  procedure dGeomTriMeshGetPoint(g: PdxGeom; Index: Integer; u, v: TdReal; result: TdVector3); cdecl; external ODEDLL;
-  function dGeomTriMeshGetArrayCallback(g: PdxGeom): Pointer; cdecl; external ODEDLL;
-  function dGeomTriMeshGetRayCallback(g: PdxGeom): Pointer; cdecl; external ODEDLL;
-  procedure dGeomTriMeshSetArrayCallback(g: PdxGeom; ArrayCallback: Pointer); cdecl; external ODEDLL;
-  procedure dGeomTriMeshSetRayCallback(g: PdxGeom; RayCallback: Pointer); cdecl; external ODEDLL;
-  procedure dGeomTriMeshSetCallback(g: PdxGeom; Callback: Pointer); cdecl; external ODEDLL;
-  function dGeomTriMeshGetCallback(g: PdxGeom): Pointer; cdecl; external ODEDLL;
-
-  procedure dGeomTriMeshDataDestroy(g: PdxTriMeshData); cdecl; external ODEDLL;
-  function dGeomTriMeshDataCreate: PdxTriMeshData; cdecl; external ODEDLL;
-  procedure dGeomTriMeshDataSet(g: PdxTriMeshData; data_id: Integer; data: Pointer); cdecl; external ODEDLL;
-
-  procedure dGeomTriMeshDataBuildSimple(g: PdxTriMeshData; Vertices: PdVector3Array; VertexCount: Integer; Indices: PdIntegerArray; IndexCount: Integer); cdecl; external ODEDLL;
-  procedure dGeomTriMeshDataBuildSimple1(g: PdxTriMeshData; Vertices: PdVector3Array; VertexCount: Integer; Indices: PdIntegerArray; IndexCount: Integer; Normals: PdVector3Array); cdecl; external ODEDLL;
-  procedure dGeomTriMeshDataBuildDouble(g: PdxTriMeshData; Vertices: PdVector3Array; VertexStride, VertexCount: Integer; Indices: PdIntegerArray; IndexCount, TriStride: Integer); cdecl; external ODEDLL;
-  procedure dGeomTriMeshDataBuildDouble1(g: PdxTriMeshData; Vertices: PdVector3Array; VertexStride, VertexCount: Integer; Indices: PdIntegerArray; IndexCount, TriStride: Integer; Normals: PdVector3Array); cdecl; external ODEDLL;
-  procedure dGeomTriMeshDataBuildSingle(g: PdxTriMeshData; Vertices: PdVector3Array; VertexStride, VertexCount: Integer; Indices: PdIntegerArray; IndexCount, TriStride: Integer); cdecl; external ODEDLL;
-  procedure dGeomTriMeshDataBuildSingle1(g: PdxTriMeshData; Vertices: PdVector3Array; VertexStride, VertexCount: Integer; Indices: PdIntegerArray; IndexCount, TriStride: Integer; Normals: PdVector3Array); cdecl; external ODEDLL;
-
-  procedure dInfiniteAABB(geom: PdxGeom; var aabb: TdAABB); cdecl; external ODEDLL;
-
-  //----- dSpace -----
-  procedure dSpaceDestroy(const Space: PdxSpace); cdecl; external ODEDLL;
-
-  function dSimpleSpaceCreate(Space: PdxSpace): PdxSpace; cdecl; external ODEDLL;
-  function dHashSpaceCreate(Space: PdxSpace): PdxSpace; cdecl; external ODEDLL;
-  function dQuadTreeSpaceCreate(const Space: PdxSpace; const Center, Extents : TdVector3; const Depth : Integer): PdxSpace; cdecl; external ODEDLL;
-
-  procedure dSpaceAdd(const Space: PdxSpace; const Geom: PdxGeom); cdecl; external ODEDLL;
-  procedure dSpaceRemove(const Space: PdxSpace; const Geom: PdxGeom); cdecl; external ODEDLL;
-  procedure dSpaceClean (const Space: PdxSpace); cdecl; external ODEDLL;
-  function dSpaceQuery (const Space: PdxSpace; const Geom: PdxGeom): Integer; cdecl; external ODEDLL;
-  function dSpaceGetNumGeoms (const Space: PdxSpace): integer; cdecl; external ODEDLL;
-  function dSpaceGetGeom(const Space: PdxSpace; const i: Integer): PdxGeom; cdecl; external ODEDLL;
-  procedure dHashSpaceSetLevels(const Space: PdxSpace; const minlevel, maxlevel: Integer); cdecl; external ODEDLL;
-  procedure dHashSpaceGetLevels(const Space: PdxSpace; var minlevel, maxlevel: Integer); cdecl; external ODEDLL;
-  procedure dSpaceSetCleanup (space: PdxSpace; const mode: integer); cdecl; external ODEDLL;
-  function dSpaceGetCleanup(Space: PdxSpace): integer; cdecl; external ODEDLL;
-
-  function dCollide(o1, o2: PdxGeom; flags: integer; var Contact: TdContactGeom; Skip: integer) : integer; cdecl; external ODEDLL;
-  procedure dSpaceCollide(const Space : PdxSpace; data: pointer; callback: TdNearCallback); cdecl; external ODEDLL;
-  procedure dSpaceCollide2(o1, o2: PdxGeom; data: pointer; callback: TdNearCallback); cdecl; external ODEDLL;
-
-  //----- dMass -----
-  procedure dMassSetParameters(var m: TdMass; themass, cgx, cgy, cgz, I11, I22, I33, I12, I13, I23: TdReal); cdecl; external ODEDLL;
-  procedure dMassAdd(var a,b: TdMass); cdecl; external ODEDLL;
-  procedure dMassAdjust(var m: TdMass; newmass: TdReal); cdecl; external ODEDLL;
-  procedure dMassTranslate(var m: TdMass; x, y, z: TdReal); cdecl; external ODEDLL;
-  procedure dMassRotate(var m: TdMass; var R: TdMatrix3); cdecl; external ODEDLL;
-
-  procedure dMassSetZero(var m: TdMass); cdecl; external ODEDLL;
-  procedure dMassSetBox(var m: TdMass; density, lx, ly, lz: TdReal); cdecl; external ODEDLL;
-  procedure dMassSetBoxTotal(var m: TdMass; total_mass, lx, ly, lz: TdReal); cdecl; external ODEDLL;
-  procedure dMassSetCylinder(var m: TdMass; density: TdReal; direction: Integer; radius, length: TdReal); cdecl; external ODEDLL;
-  procedure dMassSetCylinderTotal(var m: TdMass; total_mass: TdReal; direction: Integer; radius, length: TdReal); cdecl; external ODEDLL;
-  procedure dMassSetCapsule(var m: TdMass; density: TdReal; direction: Integer; radius, length: TdReal); cdecl; external ODEDLL;
-  procedure dMassSetCapsuleTotal(var m: TdMass; total_mass: TdReal; direction: Integer; radius, length: TdReal); cdecl; external ODEDLL;
-  procedure dMassSetSphere(var m: TdMass; density, radius: TdReal); cdecl; external ODEDLL;
-  procedure dMassSetSphereTotal(var m: TdMass; total_mass, radius: TdReal); cdecl; external ODEDLL;
-  procedure dMassSetTrimesh(var m: TdMass; density: TdReal; trimesh:PdxGeom); cdecl; external ODEDLL;
-  procedure dMassSetTrimeshTotal(var m: TdMass; total_mass: TdReal; trimesh:PdxGeom); cdecl; external ODEDLL;
-
-  //----- Rotation.h -----
-  procedure dQFromAxisAndAngle (var q: TdQuaternion; const ax, ay ,az, angle: TdReal); cdecl; external ODEDLL;
-  procedure dRFromAxisAndAngle (var R: TdMatrix3; const ax, ay ,az, angle: TdReal); cdecl; external ODEDLL;
-  procedure dRSetIdentity (var R: TdMatrix3); cdecl; external ODEDLL;
-  procedure dQSetIdentity (var Q: TdQuaternion); cdecl; external ODEDLL;
-  procedure dRFromEulerAngles (var R : TdMatrix3; const phi, theta, psi: TdReal); cdecl; external ODEDLL;
-  procedure dRFrom2Axes (var R: TdMatrix3; const ax, ay, az, bx, by, bz: TdReal); cdecl; external ODEDLL;
-  procedure dRFromZAxis (var R: TdMatrix3; const ax, ay, az: TdReal); cdecl; external ODEDLL;
-
-  procedure dMultiply0 (const A: PdReal; const B, C: PdReal; p, q, r: integer); cdecl; external ODEDLL;
-  procedure dMultiply1 (const A: PdReal; const B, C: PdReal; p, q, r: integer); cdecl; external ODEDLL;
-  procedure dMultiply2 (const A: PdReal; const B, C: PdReal; p, q, r: integer); cdecl; external ODEDLL;
-  procedure dQMultiply0 (var qa: TdQuaternion; const qb, qc: TdQuaternion); cdecl; external ODEDLL;
-  procedure dQMultiply1 (var qa: TdQuaternion; const qb, qc: TdQuaternion); cdecl; external ODEDLL;
-  procedure dQMultiply2 (var qa: TdQuaternion; const qb, qc: TdQuaternion); cdecl; external ODEDLL;
-  procedure dQMultiply3 (var qa: TdQuaternion; const qb, qc: TdQuaternion); cdecl; external ODEDLL;
-  procedure dRfromQ (var R: TdMatrix3; const q: TdQuaternion); cdecl; external ODEDLL;
-  procedure dQfromR (var q: TdQuaternion; const R: TdMatrix3); cdecl; external ODEDLL;
-  procedure dDQfromW (var dq: TdVector4; const w: TdVector3; const q: TdQuaternion); cdecl; external ODEDLL;
-
-  //----- Math -----
-  procedure dNormalize3 (var a: TdVector3); cdecl; external ODEDLL;
-  procedure dNormalize4 (var a: TdVector4); cdecl; external ODEDLL;
-
-  //----- Misc -----
-  procedure dClosestLineSegmentPoints (const a1, a2, b1, b2: TdVector3; var cp1, cp2: TdVector3); cdecl; external ODEDLL;
-
-  function dBoxTouchesBox (const _p1: TdVector3; const R1: TdMatrix3; const side1: TdVector3; const _p2: TdVector3; const R2: TdMatrix3; const side2: TdVector3): integer; cdecl; external ODEDLL;
-
-  function dMaxDifference (A, B: PdReal; n, m: integer): TdReal; cdecl; external ODEDLL;
-  procedure dMakeRandomVector(var n1: TdVector3; a: integer; f: TdReal); cdecl; external ODEDLL;
-  function dAreConnected (a, b: PdxBody): integer; cdecl; external ODEDLL;
-  function dAreConnectedExcluding (a, b: PdxBody; joint_type : TdJointTypeNumbers) : integer; cdecl; external ODEDLL;
-
-  procedure dMakeRandomMatrix (A: PdRealArray; n, m: integer; range:  TdReal); cdecl; external ODEDLL;
-  procedure dClearUpperTriangle (A: PdRealArray; n: integer); cdecl; external ODEDLL;
-
-  function dRandGetSeed: Cardinal; cdecl; external ODEDLL;
-  procedure dRandSetSeed (const s: Cardinal); cdecl; external ODEDLL;
-  function dRandInt (const n: Integer): Integer; cdecl; external ODEDLL;
-  function dRandReal: TdReal; cdecl; external ODEDLL;
-
-  // return 1 if the random number generator is working.
-  function dTestRand: Integer; cdecl; external ODEDLL;
-
-  procedure dTestMatrixComparison; cdecl; external ODEDLL;
-  procedure dTestSolveLCP; cdecl; external ODEDLL;
-
-  //----- Recreated -----
-  function dDot (const a, b: TdVector3): TdReal; overload;
-  function dDot (const a, b: PdVector3): TdReal; overload;
-
-  function dDOT14(const a,b: TdRealArray): TdReal; overload;
-  function dDOT14(const a,b: PdRealArray): TdReal; overload;
-
-  procedure dMULTIPLY0_333(var A: TdMatrix3; const B,C: TdMatrix3);
-  procedure dMULTIPLY0_331(var A: TdVector3; const B: TdMatrix3; const C: TdVector3);
-
-  function Vector3ScalarMul(const a: TdVector3; const Scalar : TdReal): TdVector3;
-  function Vector3ADD(const a, b: TdVector3): TdVector3;
-  function Vector3SUB(const a, b: TdVector3): TdVector3;
-  function Vector3Length(const a : TdVector3): TdReal;
-  function Vector3Cross(const V1, V2: TdVector3): TdVector3;
-  function Vector3Make(const x,y,z: TdReal): TdVector3;
-
-  procedure VerifyDelphiODE(Body: PdxBody; Geom: PdxGeom);
-
-  {ExportInitODEMarker}
-
-const MaxUserClasses = 4;
-
-var
-  dSphereClass : integer=0;
-  dBoxClass : integer=1;
-  dCapsuleClass : integer=2;
-  dCylinderClass : integer=3;
-  dPlaneClass : integer=4;
-  dRayClass : integer=5;
-  dConvexClass : integer=6;
-  dGeomTransformClass : integer=7;
-  dTriMeshClass : integer=8;
-  dHeightFieldClass : integer=9;
-  dFirstSpaceClass : integer = 10;
-  dSimpleSpaceClass : integer = 10;
-  dHashSpaceClass : integer = 11;
-  dSweepAndPruneSpaceClass : integer = 12;
-  dQuadTreeSpaceClass : integer = 13;
-  dLastSpaceClass : integer = 13;
-  dFirstUserClass : integer = 14;
-  dLastUserClass : integer = 17;
-  dGeomNumClasses : integer = 18;
-
-  IsODEInitialized : boolean = False;
-  DisabledDebugGeom : boolean = False;
-  DisabledDebugCollision : boolean = False;
-
-{$IFDEF cODEDebugEnabled}
-var
-   ODEDebugGeomList: TGeomList;
-{$ENDIF}
-{$IFDEF cODEDebugCollisionEnabled}
-var
-   ODEDebugCollisionList: array of TdContact;
-{$ENDIF}
-
-
-  // These are made public in the dynamic version MRQZZZ
-  function InitODE(ADllName : PChar) : boolean;
-  procedure CloseODE;
-
-
-//-----------------------------------------
-implementation
-//-----------------------------------------
-
-//---------------------
-// TBodyList
-//---------------------
-
-procedure TBodyList.DeleteAllBodies;
-var i : integer;
-begin
-  for i := 0 to Count-1 do  dBodyDestroy(Get(i));
-  Clear;
-end;
-
-function TBodyList.GetItems(i: integer): PdxBody;
-begin
-  result := Get(i);
-end;
-
-procedure TBodyList.SetItems(i: integer; const Value: PdxBody);
-begin
-  Put(i, Value);
-end;
-
-//---------------------------
-// TGeomList
-//---------------------------
-
-procedure TGeomList.DeleteAllGeoms(DeleteDataAsObject : boolean=false);
-var i : integer;
-    geom : PdxGeom;
-begin
-   for i := 0 to Count-1 do begin
-      geom := Get(i);
-      if DeleteDataAsObject and (geom.data<>nil) then TObject(geom.data).Free;
-      dGeomDestroy(geom);
-   end;
-   Clear;
-end;
-
-function TGeomList.GetItems(i: integer): PdxGeom;
-begin
-   result := Get(i);
-end;
-
-procedure TGeomList.SetItems(i: integer; const Value: PdxGeom);
-begin
-   Put(i, Value);
-end;
-
-//----- Recreated -----
-
-function dDot (const a, b : PdVector3) : TdReal;
-begin
-  Assert(Assigned(a),'a not assigned!');
-  Assert(Assigned(b),'b not assigned!');
-  result := ((a)[0]*(b)[0] + (a)[1]*(b)[1] + (a)[2]*(b)[2]);
-end;
-
-function dDot (const a, b : TdVector3) : TdReal;
-begin
-  result := ((a)[0]*(b)[0] + (a)[1]*(b)[1] + (a)[2]*(b)[2]);
-end;
-
-// #define dDOT(a,b)   ((a)[0]*(b)[0] + (a)[1]*(b)[1] + (a)[2]*(b)[2])
-// #define dDOT14(a,b) ((a)[0]*(b)[0] + (a)[1]*(b)[4] + (a)[2]*(b)[8])
-// #define dDOT41(a,b) ((a)[0]*(b)[0] + (a)[4]*(b)[1] + (a)[8]*(b)[2])
-// #define dDOT44(a,b) ((a)[0]*(b)[0] + (a)[4]*(b)[4] + (a)[8]*(b)[8])
-
-function dDOT14(const a,b : TdRealArray) : TdReal; overload;
-begin
-  result := ((a)[0]*(b)[0] + (a)[1]*(b)[4] + (a)[2]*(b)[8]);
-end;
-
-function dDOT14(const a,b : PdRealArray) : TdReal; overload;
-begin
-  result := ((a)[0]*(b)[0] + (a)[1]*(b)[4] + (a)[2]*(b)[8]);
-end;
-
-procedure dMULTIPLY0_331(var A : TdVector3; const B : TdMatrix3; const C : TdVector3);
-{var
-  v : PdVector3;}
-begin
-  // #define dMULTIPLY0_331(A,B,C) dMULTIPLYOP0_331(A,=,B,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));
-
-
-  A[0] := dDOT(PdVector3(@(B[0]))^, C);
-
-  A[1] := dDOT(PdVector3(@(B[4]))^, C);
-  A[2] := dDOT(PdVector3(@(B[8]))^, C);//}
-end;
-
-procedure dMULTIPLY0_333(var A : TdMatrix3; const B,C : TdMatrix3);
-begin
-  // #define dMULTIPLY0_333(A,B,C) dMULTIPLYOP0_333(A,=,B,C)
-  // #define dMULTIPLYOP0_333(A,op,B,C) \
-  //   (A)[0] op dDOT14((B),(C)); \
-  //   (A)[1] op dDOT14((B),(C+1)); \
-  //   (A)[2] op dDOT14((B),(C+2)); \
-  //   (A)[4] op dDOT14((B+4),(C)); \
-  //   (A)[5] op dDOT14((B+4),(C+1)); \
-  //   (A)[6] op dDOT14((B+4),(C+2)); \
-  //   (A)[8] op dDOT14((B+8),(C)); \
-  //   (A)[9] op dDOT14((B+8),(C+1)); \
-  //   (A)[10] op dDOT14((B+8),(C+2));
-
-  A[0] := dDOT14(PdRealArray(@(B[0])),PdRealArray(@(C[0])));
-  A[1] := dDOT14(PdRealArray(@(B[0])),PdRealArray(@(C[1])));
-  A[2] := dDOT14(PdRealArray(@(B[0])),PdRealArray(@(C[2])));
-
-  A[4] := dDOT14(PdRealArray(@(B[4])),PdRealArray(@(C[0])));
-  A[5] := dDOT14(PdRealArray(@(B[4])),PdRealArray(@(C[1])));
-  A[6] := dDOT14(PdRealArray(@(B[4])),PdRealArray(@(C[2])));
-
-  A[8] := dDOT14(PdRealArray(@(B[8])),PdRealArray(@(C[0])));
-  A[9] := dDOT14(PdRealArray(@(B[8])),PdRealArray(@(C[1])));
-  A[10] := dDOT14(PdRealArray(@(B[8])),PdRealArray(@(C[2])));
-end;
-
-function Vector3ScalarMul(const a : TdVector3; const Scalar : TdReal) : TdVector3;
-begin
-  result[0] := a[0]*Scalar;
-  result[1] := a[1]*Scalar;
-  result[2] := a[2]*Scalar;
-end;
-
-function Vector3ADD(const a, b : TdVector3) : TdVector3;
-begin
-  result[0] := a[0]+b[0];
-  result[1] := a[1]+b[1];
-  result[2] := a[2]+b[2];
-end;
-
-function Vector3SUB(const a, b : TdVector3) : TdVector3;
-begin
-  result[0] := a[0]-b[0];
-  result[1] := a[1]-b[1];
-  result[2] := a[2]-b[2];
-end;
-
-function Vector3Length(const a : TdVector3) : TdReal;
-begin
-  result := sqrt(sqr(a[0])+sqr(a[1])+sqr(a[2]));
-end;
-
-function Vector3Cross(const V1, V2 : TdVector3) : TdVector3;
-begin
-   Result[0]:=V1[1] * V2[2] - V1[2] * V2[1];
-   Result[1]:=V1[2] * V2[0] - V1[0] * V2[2];
-   Result[2]:=V1[0] * V2[1] - V1[1] * V2[0];
-end;
-
-function Vector3Make(const x,y,z : TdReal) : TdVector3;
-begin
-  result[0] := x;
-  result[1] := y;
-  result[2] := z;
-end;
-
-(*
-procedure DisableStillBodies(World : PdxWorld; Threshold : TdReal=0.0001);
-var
-  Body : PdxBody;
-  TempList : TList;
-begin
-  if not Assigned(WasStillBefore) then
-  begin
-    WasStillBefore := TList.Create;
-    WasStillBeforeOld := TList.Create;
-  end;
-
-  Body := World.FirstBody;
-
-  WasStillBefore.Clear;
-
-  // We can't disable bodies just as soon as they're still - that could disable
-  // bodies that are just slowed down or titering on an edge. If they've been
-  // still for two frames, we consider them truly still.
-  while Assigned(Body) do
-  begin
-    if dBodyIsEnabled(Body)=1 then
-    begin
-      // Is the body still?
-      if (abs(Body.lvel[0])<Threshold) and (abs(Body.lvel[1])<Threshold) and (abs(Body.lvel[2])<Threshold) and
-         (abs(Body.avel[0])<Threshold) and (abs(Body.avel[1])<Threshold) and (abs(Body.avel[2])<Threshold) then
-      begin
-        if WasStillBeforeOld.IndexOf(Body)<>-1 then
-          dBodyDisable(Body)
-        else
-          WasStillBefore.Add(Body);
-      end;
-    end;
-
-    Body := PdxBody(Body.BaseObject.next);
-  end;
-
-  TempList := WasStillBeforeOld;
-  WasStillBeforeOld := WasStillBefore;
-  WasStillBefore := TempList;
-end; *)
-
-procedure VerifyDelphiODE(Body : PdxBody; Geom : PdxGeom);
-var
-  m : TdMass;
-  VerificationPointer : pointer;
-begin
-  VerificationPointer := pointer( -1 ); // A known pointer
-  // Verify Body
-  dBodySetData( Body, VerificationPointer );
-  Assert( dBodyGetData( Body ) = VerificationPointer, 'Body test 1 fails' );
-  Assert( Body.BaseObject.userdata = VerificationPointer, 'Body test 2 fails' );
-
-  dBodyGetMass(Body, m);
-
-  Assert(Body.mass.mass = m.mass, 'Body test 3 fails');
-
-  // Verify Geom
-  dGeomSetData( Geom, VerificationPointer );
-  Assert( dGeomGetData( Geom ) = VerificationPointer, 'Geom test 1 fails' );
-  Assert(dGeomGetBody(Geom)=Geom.Body, 'Geom test 2 fails');
-  Assert( Geom.Data = VerificationPointer, 'Geom test 3 fails' );
-end;
-
-var
-  vODEHandle : TModuleHandle;
-
-procedure GetODEClassIDs;
-begin
-  {$IFDEF PARODE}
-   dSphereClass:=dSphereGetClass;
-   dBoxClass:=dBoxGetClass;
-   dPlaneClass:=dPlaneGetClass;
-   dCylinderClass:=dCylinderGetClass;
-   dConvexClass:=dConvexGetClass;
-   dGeomTransformClass:=dGeomTransformGetClass;
-   dRayClass:=dRayGetClass;
-   dTriMeshClass:=dTriMeshGetClass;
-   dHeightfieldClass:=dHeightfieldGetClass;
-   {$ENDIF}
-end;
-
-function InitODE(ADllName : PChar) : boolean;
-var isODELoaded : boolean;
-begin
-  result := IsODEInitialized;
-  if IsODEInitialized then exit;
-
-  if ADllName = '' then ADllName := ODEDLL;
-
-  isODELoaded := LoadModule( vODEHandle, ADllName );
-  if not isODELoaded then exit;
-
-  if isODELoaded and not IsODEInitialized then begin
-     dInitODE2(0);
-     GetODEClassIDs;
-     IsODEInitialized:=True;
-  end;
-  result:=IsODEInitialized;
-end;
-
-procedure CloseODE;
-begin
-  if IsODEInitialized then dCloseODE;
-  IsODEInitialized := false;
-  UnLoadModule( vODEHandle );
-end;
-
-//---------------------------------------
-initialization
-//---------------------------------------
-
- InitODE(ODEDLL);
-
-//---------------------------------------
-finalization
-//---------------------------------------
-
-   CloseODE;
-
-end.

+ 0 - 44
Source/FMX/Physix.PhysX.pas

@@ -1,44 +0,0 @@
-//
-// The graphics platform GLXcene https://github.com/glscene
-//
-unit Physix.PhysX;
-
-interface
-
-uses
-  Winapi.Windows;
-
-const
-  DLL = 'PhysXwrap.dll';
-
-procedure SDK_Version(major, minor, bugfix: pdword); stdcall; external DLL;
-
-procedure InitNx; stdcall; external DLL;
-procedure ReleaseNx; stdcall; external DLL;
-
-procedure SimulateNx(dt: single); stdcall; external DLL;
-procedure GetResultsNx; stdcall; external DLL;
-
-procedure ActorCount(count: pdword); stdcall; external DLL;
-procedure GetActor(index: dword; obj: pdword); stdcall; external DLL;
-procedure GetActorGlobalPosition(actor: dword; x,y,z: psingle); stdcall; external DLL;
-procedure SetActorGlobalPosition(actor: dword; x,y,z: single); stdcall; external DLL;
-procedure GetActorGlobalOrientation(actor: dword; x,y,z,w: psingle); stdcall; external DLL;
-procedure SetActorGlobalOrientation(actor: dword; x,y,z,w: single); stdcall; external DLL;
-procedure GetActorCMassGlobalPosition(actor: dword; x,y,z: psingle); stdcall; external DLL;
-procedure SetActorCMassGlobalPosition(actor: dword; x,y,z: single); stdcall; external DLL;
-procedure GetActorMass(actor: dword; m: psingle); stdcall; external DLL;
-procedure SetActorMass(actor: dword; m: single); stdcall; external DLL;
-
-procedure ActorAddForce(actor: dword; x,y,z: single); stdcall; external DLL;
-
-
-procedure CreateGroundPlane(actor: pdword); stdcall; external DLL;
-procedure CreateBox(actor: pdword; sx,sy,sz,dens: single); stdcall; external DLL;
-procedure CreateSphere(actor: pdword; rad: single; dens: single); stdcall; external DLL;
-procedure CreateCylinder(actor: pdword; rad: single; height: single; dens: single); stdcall; external DLL;
-
-
-implementation
-
-end.

+ 1 - 1
Source/Physics.NGDManager.pas

@@ -17,7 +17,7 @@ uses
   System.Math, // Samevalue isZero to compare single
   System.Math, // Samevalue isZero to compare single
   System.Types,
   System.Types,
 
 
-  Physics.NGDImport,
+  NGD.Import,
 
 
   /// NGD.Joints,            // old joints
   /// NGD.Joints,            // old joints
   /// Physics.NewtonImport,      // new version 4.0
   /// Physics.NewtonImport,      // new version 4.0

+ 1 - 1
Source/Physics.NGDRagdoll.pas

@@ -13,7 +13,7 @@ uses
   GLS.VectorGeometry,
   GLS.VectorGeometry,
   GLS.VectorTypes,
   GLS.VectorTypes,
   GLS.VectorFileObjects,
   GLS.VectorFileObjects,
-  Physics.NGDImport;
+  NGD.Import;
 
 
 type
 type
   TNewtonRagdoll = class
   TNewtonRagdoll = class

+ 1 - 1
Source/Physics.ODEManager.pas

@@ -36,7 +36,7 @@ uses
   GLS.TerrainRenderer,
   GLS.TerrainRenderer,
   GLS.Graph,
   GLS.Graph,
 
 
-  Physics.ODEImport,
+  ODE.Import,
   Physics.ODEUtils;
   Physics.ODEUtils;
 
 
 type
 type

+ 1 - 1
Source/Physics.ODERagdoll.pas

@@ -16,7 +16,7 @@ uses
   GLS.Texture,
   GLS.Texture,
   GLS.VectorFileObjects,
   GLS.VectorFileObjects,
 
 
-  Physics.ODEImport,
+  ODE.Import,
   Physics.ODEUtils;
   Physics.ODEUtils;
 
 
 const
 const

+ 1 - 1
Source/Physics.ODESkeletonColliders.pas

@@ -14,7 +14,7 @@ uses
   GLS.PersistentClasses,
   GLS.PersistentClasses,
   GLS.VectorGeometry,
   GLS.VectorGeometry,
   GLS.VectorFileObjects,
   GLS.VectorFileObjects,
-  Physics.ODEImport;
+  ODE.Import;
 
 
 type
 type
 
 

+ 1 - 1
Source/Physics.ODEUtils.pas

@@ -18,7 +18,7 @@ uses
   System.SysUtils,
   System.SysUtils,
   System.Classes,
   System.Classes,
 
 
-  Physics.ODEImport,
+  ODE.Import,
   GLS.OpenGLTokens,
   GLS.OpenGLTokens,
   GLS.Context,
   GLS.Context,
   GLS.VectorGeometry,
   GLS.VectorGeometry,

+ 0 - 1
Source/Common/Scene.InitOpenGL.pas → Source/VCL/GLS.InitOpenGL.pas

@@ -13,7 +13,6 @@ uses
   Winapi.OpenGLext,
   Winapi.OpenGLext,
   Winapi.Windows,
   Winapi.Windows,
   System.SysUtils,
   System.SysUtils,
-
   Vcl.Forms;
   Vcl.Forms;
 
 
 type
 type