{                                                                            
 Newton Game Dynamics Header Translation (Delphi/FreePascal)                  
  Newton Version 3.14 
  Generated by NewtonDoc on 31/03/2017 16:17:44  


********************************************************************************
*                                                                              *
* Copyright (c) <2003-2016> <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.   *
*                                                                              *
********************************************************************************
}

unit NewtonImport;

{== Local Defines ==
  __NONDELPHI__            - Enables compatiblity with compilers other than Delphi.
                             Note that pascaldefines.inc and newtonpascal.inc
                             are protected under the Mozilla Public License.

 == Conditionals ==
 Declare the Following in Projects->Options->Conditionals to enable them:
  __USE_DOUBLE_PRECISION__ - Toggles Double Precision. DLL used must match this setting.

 == Local Defines ==}
 //{$DEFINE __NONDELPHI__}



{$IFDEF __NONDELPHI__}
 {$I pascaldefines.inc}
{$ENDIF}

interface

{$IFDEF __NONDELPHI__}
 {$I newtonpascal.inc}
{$ELSE}
 const
 {$IFDEF __USE_DOUBLE_PRECISION__}
  NEWTON_API = 'newtond.dll';
 {$ELSE}
  NEWTON_API = 'newton.dll';
 {$ENDIF}
{$ENDIF}

 NEWTON_MAJOR_VERSION = 3;
 NEWTON_MINOR_VERSION = 14;
 NEWTON_BROADPHASE_DEFAULT = 0;
 NEWTON_BROADPHASE_PERSINTENT = 1;
 NEWTON_DYNAMIC_BODY = 0;
 NEWTON_KINEMATIC_BODY = 1;
 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
{$IFDEF __USE_DOUBLE_PRECISION__}
 dFloat                       = Double;
{$ELSE}
 dFloat                       = Single;
{$ENDIF}
 dFloat64                     = Double;
 dLong                        = Int64;

 PdFloat                      = ^dFloat;
 PdFloat64                    = ^dFloat64;
 PdLong                       = ^dLong;

 NewtonMesh                   = ^Pointer;
 NewtonBody                   = ^Pointer;
 NewtonWorld                  = ^Pointer;
 NewtonJoint                  = ^Pointer;
 NewtonMaterial               = ^Pointer;
 NewtonCollision              = ^Pointer;
// NewtonSceneProxy           = ^Pointer;
 //NewtonSkeletonContainer      = ^Pointer;
 NewtonDeformableMeshSegment  = ^Pointer;
 NewtonFracturedCompoundMeshPart = ^Pointer;

 NewtonSerializeHandle        = ^Pointer;
 NewtonMeshHandle             = ^Pointer;
 NewtonMeshVertex             = ^Pointer;
 NewtonMeshPoint              = ^Pointer;
 NewtonMeshEdge               = ^Pointer;
 NewtonMeshFace               = ^Pointer;
 NewtonListener               = ^Pointer;

 TNewtonBoxParam = Packed Record
  m_x,
  m_y,
  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,
  m_height               : dFloat;
 end;

 TNewtonConvexHullParam = Packed Record
  m_vertexCount,
  m_vertexStrideInBytes,
  m_faceCount            : Integer;
  m_vertex               : PdFloat;
 end;


 TNewtonCompoundCollisionParam = Packed Record
  m_chidrenCount         : Integer;
 end;


 TNewtonCollisionTreeParam = Packed Record
  m_vertexCount,
  m_indexCount           : Integer;
 end;

 TNewtonDeformableMeshParam = Packed Record
  m_vertexCount,
  m_triangleCount,
  m_vertexStrideInBytes  : Integer;
  m_indexList            : PWord;
  m_vertexList           : PdFloat;
 end;


 TNewtonHeightFieldCollisionParam = Packed Record
  m_width,
  m_height,
  m_gridsDiagonals,
  m_elevationDataType     : Integer;// 0 = 32 bit floats, 1 = unsigned 16 bit integers
  m_verticalScale         : dFloat;
  m_horizonalScale_x : dFloat;
  m_horizonalScale_z : dFloat;
  m_horizonalDisplacementScale_x : dFloat;
  m_horizonalDisplacementScale_z : dFloat;
  m_vertialElevation      : Pointer;
  m_horizotalDisplacement : PSmallInt;
  m_atributes             : PShortInt;
 end;

 TNewtonSceneCollisionParam = Packed Record
  m_childrenProxyCount   : Integer;
 end;

 TNewtonCollisionNullParam = packed record
 end;

 NewtonCollisionInfoRecord = ^TNewtonCollisionInfoRecord;
 TNewtonCollisionInfoRecord = Packed Record
  m_offsetMatrix         : Array [0..3,0..3] of dFloat;
  m_collisionType,    // tag id to identify the collision primitive
  m_collisionUserID      : Integer;

  case Integer of
       SERIALIZE_ID_SPHERE           : (sdSphere             : TNewtonSphereParam);
       SERIALIZE_ID_CAPSULE          : (sdCapsule            : TNewtonCapsuleParam);
	   SERIALIZE_ID_CYLINDER         : (sdCylinder           : TNewtonCylinderParam);
       SERIALIZE_ID_CHAMFERCYLINDER  : (sdChamferCylinder    : TNewtonChamferCylinderParam);
       SERIALIZE_ID_BOX              : (sdBox                : TNewtonBoxParam);
       SERIALIZE_ID_CONE             : (sdCone               : TNewtonConeParam);
       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_DEFORMABLE_SOLID : (sdDeformableMesh     : TNewtonDeformableMeshParam);
       SERIALIZE_ID_USERMESH         : (sdUserMesh           : Array[0..63] of dFloat);
       SERIALIZE_ID_SCENE            : (sdSceneCollision     : TNewtonSceneCollisionParam);
  end;

 NewtonJointRecord = ^TNewtonJointRecord;
 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         : NewtonBody;
  m_attachBody_1         : NewtonBody;
  m_extraParameters      : Array [0..63] of dFloat;
  m_bodiesCollisionOn    : Integer;
  m_descriptionType      : Array [0..127] of ShortInt;
 end;

 NewtonUserMeshCollisionCollideDesc = ^TNewtonUserMeshCollisionCollideDesc;
 TNewtonUserMeshCollisionCollideDesc = Packed Record
  m_boxP0,                                              // lower bounding box of intersection query in local space
  m_boxP1,                                              // upper bounding box of intersection query in local space
  m_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.
                                                        // used this for continue collision mode
  m_threadNumber,                                       // current thread executing this query
  m_faceCount,                                          // 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,                                            // pointer to the colliding body
  m_polySoupBody         : NewtonBody;                  // pointer to the rigid body owner of this collision tree
  m_objCollision,                                       // collision shape of the colliding body, (no necessarily the collision of m_objBody)
  m_polySoupCollision    : NewtonCollision;             // 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,                                     // 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;

 NewtonWorldConvexCastReturnInfo = ^TNewtonWorldConvexCastReturnInfo;
 TNewtonWorldConvexCastReturnInfo = Packed Record
  m_point,                                              // collision point in global space
  m_normal{,                                             // 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              : NewtonBody;                  // body hit at contact point
  m_penetration          : dFloat;                      // contact penetration at collision point
 end;

 NewtonUserMeshCollisionRayHitDesc = ^TNewtonUserMeshCollisionRayHitDesc;
 TNewtonUserMeshCollisionRayHitDesc = Packed Record
  m_p0,                                                 // ray origin in collision local space
  m_p1,                                                 // 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;

 NewtonHingeSliderUpdateDesc = ^TNewtonHingeSliderUpdateDesc;
 TNewtonHingeSliderUpdateDesc = Packed Record
  m_accel,
  m_minFriction,
  m_maxFriction,
  m_timestep             : dFloat;
 end;

 NewtonUserContactPoint = ^TNewtonUserContactPoint;
 TNewtonUserContactPoint = Packed Record
  m_point,
  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
 NewtonMeshDoubleData = ^TNewtonMeshDoubleData;
 TNewtonMeshDoubleData = Packed Record
  m_data          : PdFloat64;
  m_indexList     : PInteger;
  m_strideInBytes : Integer;
 end;
 
 NewtonMeshFloatData = ^TNewtonMeshFloatData;
 TNewtonMeshFloatData = Packed Record
  m_data          : PdFloat;
  m_indexList     : PInteger;
  m_strideInBytes : Integer;
 end;
 
 NewtonMeshVertexFormat = ^TNewtonMeshVertexFormat;
 TNewtonMeshVertexFormat = Packed Record
 // int m_faceCount : Integer;
  m_faceIndexCount : PInteger;
  m_faceMaterial : PInteger;
  m_vertex : NewtonMeshDoubleData;
  m_normal : NewtonMeshFloatData;
  m_binormal : NewtonMeshFloatData;
  m_uv0 : NewtonMeshFloatData;
  m_uv1 : NewtonMeshFloatData;
  m_vertexColor : NewtonMeshFloatData;
 end;
 
 // Newton callback functions
 NewtonAllocMemory                          = ^TNewtonAllocMemory;
 TNewtonAllocMemory                          = function (sizeInBytes : Integer) : Pointer;
 NewtonFreeMemory                           = ^TNewtonFreeMemory;
 TNewtonFreeMemory                           = procedure (ptr : Pointer; sizeInBytes : Integer);

 NewtonWorldDestructorCallback              = ^TNewtonWorldDestructorCallback;
 TNewtonWorldDestructorCallback              = procedure (const World : NewtonWorld);

 NewtonWorldListenerBodyDestroyCallback          = ^TNewtonWorldListenerBodyDestroyCallback;
 TNewtonWorldListenerBodyDestroyCallback          = procedure (const World : NewtonWorld; listenerUserData : Pointer; body : NewtonBody);

 NewtonWorldUpdateListenerCallback          = ^TNewtonWorldUpdateListenerCallback;
 TNewtonWorldUpdateListenerCallback          = procedure (const World : NewtonWorld; listenerUserData : Pointer; timestep : dFloat);
 NewtonWorldDestroyListenerCallback         = ^TNewtonWorldDestroyListenerCallback;
 TNewtonWorldDestroyListenerCallback         = procedure (const World : NewtonWorld; listenerUserData : Pointer);

 NewtonGetTimeInMicrosencondsCallback                = ^TNewtonGetTimeInMicrosencondsCallback;
 TNewtonGetTimeInMicrosencondsCallback               = function () : dLong;

 NewtonSerializeCallback                    = ^TNewtonSerializeCallback;
 TNewtonSerializeCallback                    = procedure (Handle : NewtonSerializeHandle; const buffer : Pointer; size : Integer);
 NewtonDeserializeCallback                  = ^TNewtonDeserializeCallback;
 TNewtonDeserializeCallback                  = procedure (Handle : NewtonSerializeHandle; buffer : Pointer; size : Integer);

 NewtonOnBodySerializationCallback          = ^TNewtonOnBodySerializationCallback;
 TNewtonOnBodySerializationCallback          = procedure (body : NewtonBody; userData : Pointer; Callback : NewtonSerializeCallback; Handle : NewtonSerializeHandle);
 NewtonOnBodyDeserializationCallback        = ^TNewtonOnBodyDeserializationCallback;
 TNewtonOnBodyDeserializationCallback        = procedure (body : NewtonBody; userData : Pointer; Callback : NewtonDeserializeCallback; Handle : NewtonSerializeHandle);

 NewtonOnJointSerializationCallback         = ^TNewtonOnJointSerializationCallback;
 TNewtonOnJointSerializationCallback         = procedure (joint : NewtonJoint; funct : NewtonSerializeCallback; serializeHandle : NewtonSerializeHandle);

 NewtonOnJointDeserializationCallback       = ^TNewtonOnJointDeserializationCallback;
 TNewtonOnJointDeserializationCallback       = procedure (body0 : NewtonBody; body1 : NewtonBody; funct : NewtonDeserializeCallback; serializeHandle : NewtonSerializeHandle);

 NewtonOnUserCollisionSerializationCallback = ^TNewtonOnUserCollisionSerializationCallback;
 TNewtonOnUserCollisionSerializationCallback = procedure (userData : Pointer; Callback : NewtonSerializeCallback; Handle : NewtonSerializeHandle);


 // user collision callbacks
 NewtonUserMeshCollisionDestroyCallback     = ^TNewtonUserMeshCollisionDestroyCallback;
 TNewtonUserMeshCollisionDestroyCallback     = procedure (userData : Pointer);
 NewtonUserMeshCollisionRayHitCallback      = ^TNewtonUserMeshCollisionRayHitCallback;
 TNewtonUserMeshCollisionRayHitCallback      = function (lineDescData : NewtonUserMeshCollisionRayHitDesc) : dFloat;
 NewtonUserMeshCollisionGetCollisionInfo    = ^TNewtonUserMeshCollisionGetCollisionInfo;
 TNewtonUserMeshCollisionGetCollisionInfo    = procedure (userData : Pointer; infoRecord : NewtonCollisionInfoRecord);
 NewtonUserMeshCollisionAABBTest            = ^TNewtonUserMeshCollisionAABBTest;
 TNewtonUserMeshCollisionAABBTest            = function (userData : Pointer; const boxP0,boxP1 : PdFloat) : Integer;
 NewtonUserMeshCollisionGetFacesInAABB      = ^TNewtonUserMeshCollisionGetFacesInAABB;
 TNewtonUserMeshCollisionGetFacesInAABB      = 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;

 NewtonUserMeshCollisionCollideCallback     = ^TNewtonUserMeshCollisionCollideCallback;
 TNewtonUserMeshCollisionCollideCallback     = procedure (collideDescData : NewtonUserMeshCollisionCollideDesc; continueCollisionHandle : Pointer);

 NewtonTreeCollisionFaceCallback            = ^TNewtonTreeCollisionFaceCallback;
 TNewtonTreeCollisionFaceCallback            = function (context : Pointer; polygon : PdFloat; strideInBytes : Integer; indexArray : PInteger; indexCount : Integer) : Integer;

 NewtonCollisionTreeRayCastCallback         = ^TNewtonCollisionTreeRayCastCallback;
 TNewtonCollisionTreeRayCastCallback         = function (const body : NewtonBody; const treeCollision : NewtonCollision;
                                                        interception : dFloat; normal : PdFloat; faceID : Integer;
                                                        userData : Pointer) : dFloat;
 NewtonHeightFieldRayCastCallback           = ^TNewtonHeightFieldRayCastCallback;
 TNewtonHeightFieldRayCastCallback           = function (const body : NewtonBody; const heightFieldCollision : NewtonCollision;
                                                        interception : dFloat; row, col : Integer; normal : PdFloat;
                                                        faceID : Integer; userData : Pointer) : dFloat;

 NewtonCollisionCopyConstructionCallback    = ^TNewtonCollisionCopyConstructionCallback;
 TNewtonCollisionCopyConstructionCallback    = procedure (newtonWorld : NewtonWorld; collision : NewtonCollision; sourceCollision : NewtonCollision);

 NewtonCollisionDestructorCallback          = ^TNewtonCollisionDestructorCallback;
 TNewtonCollisionDestructorCallback          = procedure (newtonWorld : NewtonWorld; collision : NewtonCollision);

 // collision tree call back (obsoleted no recommended)
 NewtonTreeCollisionCallback                = ^TNewtonTreeCollisionCallback;
 TNewtonTreeCollisionCallback                = procedure (const bodyWithTreeCollision : NewtonBody; const body : NewtonBody;
                                                         faceID : Integer; vertexCount : Integer; const vertexArray : PdFloat;
                                                         vertexStrideInBytes : Integer);

 NewtonBodyDestructor                       = ^TNewtonBodyDestructor;
 TNewtonBodyDestructor                       = procedure (const body : NewtonBody);
 NewtonApplyForceAndTorque                  = ^TNewtonApplyForceAndTorque;
 TNewtonApplyForceAndTorque                  = procedure (const body : NewtonBody; timestep : dFloat; threadIndex : Integer);
 NewtonSetTransform                         = ^TNewtonSetTransform;
 TNewtonSetTransform                         = procedure (const body : NewtonBody; const matrix : PdFloat; threadIndex : Integer);

 NewtonIslandUpdate                         = ^TNewtonIslandUpdate;
 TNewtonIslandUpdate                         = function (const world : NewtonWorld; islandHandle : Pointer; bodyCount : Integer) : Integer;

 NewtonFractureCompoundCollisionOnEmitCompoundFractured   = ^TNewtonFractureCompoundCollisionOnEmitCompoundFractured;
 TNewtonFractureCompoundCollisionOnEmitCompoundFractured   = procedure (fracturedBody : NewtonBody);

 NewtonFractureCompoundCollisionOnEmitChunk   = ^TNewtonFractureCompoundCollisionOnEmitChunk;
 TNewtonFractureCompoundCollisionOnEmitChunk   = procedure (chunkBody : NewtonBody; fracturexChunkMesh : NewtonFracturedCompoundMeshPart; fracturedCompountCollision : NewtonCollision);

 NewtonFractureCompoundCollisionReconstructMainMeshCallBack   = ^TNewtonFractureCompoundCollisionReconstructMainMeshCallBack;
 TNewtonFractureCompoundCollisionReconstructMainMeshCallBack   = procedure (body : NewtonBody; mainMesh : NewtonFracturedCompoundMeshPart; fracturedCompountCollision : NewtonCollision);

 NewtonWorldRayPrefilterCallback            = ^TNewtonWorldRayPrefilterCallback;
 TNewtonWorldRayPrefilterCallback            = function (const body : NewtonBody; collision : NewtonCollision; userData : Pointer) : Cardinal;
 NewtonWorldRayFilterCallback               = ^TNewtonWorldRayFilterCallback;
 TNewtonWorldRayFilterCallback               = function (const body : NewtonBody; const shapeHit : NewtonCollision; const hitContact : PDFloat; const hitNormal : PdFloat; collisionID : dLong;
                                                        userData : Pointer; intersectParam : dFloat) : dFloat;

 NewtonContactsProcess                      = ^TNewtonContactsProcess;
 TNewtonContactsProcess                      = procedure (const contact : NewtonJoint; timestep : dFloat; threadIndex : Integer);

 NewtonOnAABBOverlap                        = ^TNewtonOnAABBOverlap;
 TNewtonOnAABBOverlap                        = function (const material : NewtonMaterial; const body0 : NewtonBody; const body1 : NewtonBody;
                                                        threadIndex : Integer) : Integer;

 NewtonOnCompoundSubCollisionAABBOverlap    = ^TNewtonOnCompoundSubCollisionAABBOverlap;
 TNewtonOnCompoundSubCollisionAABBOverlap    = function (const material : NewtonMaterial; body0 : NewtonBody; collisionNode0 : Pointer; body1 : NewtonBody; collisionNode1 : Pointer; threadIndex : Integer) : Integer;

 NewtonOnContactGeneration                  = ^TNewtonOnContactGeneration;
 TNewtonOnContactGeneration                  = function (const material : NewtonMaterial; body0 : NewtonBody; collision0 : Pointer; body1 : NewtonBody; collision1 : Pointer; contactBuffer : NewtonUserContactPoint; maxCount : Integer; threadIndex : Integer) : Integer;

 NewtonBodyIterator                         = ^TNewtonBodyIterator;
 TNewtonBodyIterator                         = function (const body : NewtonBody; userData : Pointer) : Integer;
 NewtonJointIterator                        = ^TNewtonJointIterator;
 TNewtonJointIterator                        = procedure (const joint : NewtonJoint; userData : Pointer);
 NewtonCollisionIterator                    = ^TNewtonCollisionIterator;
 TNewtonCollisionIterator                    = procedure (userData : Pointer; vertexCount : Integer; const faceArray : PdFloat; faceId : Integer);

 NewtonBallCallback                         = ^TNewtonBallCallback;
 TNewtonBallCallback                        = procedure (const ball : NewtonJoint; timestep : dFloat);
 NewtonHingeCallback                        = ^TNewtonHingeCallback;
 TNewtonHingeCallback                       = function (const hinge : NewtonJoint; desc : NewtonHingeSliderUpdateDesc) : Cardinal;
 NewtonSliderCallback                       = ^TNewtonSliderCallback;
 TNewtonSliderCallback                      = function (const slider : NewtonJoint; desc : NewtonHingeSliderUpdateDesc) : Cardinal;
 NewtonUniversalCallback                    = ^TNewtonUniversalCallback;
 TNewtonUniversalCallback                   = function (const universal : NewtonJoint; desc : NewtonHingeSliderUpdateDesc) : Cardinal;
 NewtonCorkscrewCallback                    = ^TNewtonCorkscrewCallback;
 TNewtonCorkscrewCallback                   = function (const corkscrew : NewtonJoint; desc : NewtonHingeSliderUpdateDesc) : Cardinal;

 NewtonUserBilateralCallback                = ^TNewtonUserBilateralCallback;
 TNewtonUserBilateralCallback               = procedure (const userJoint : NewtonJoint; timestep : dFloat; threadIndex : Integer);
 NewtonUserBilateralGetInfoCallback         = ^TNewtonUserBilateralGetInfoCallback;
 TNewtonUserBilateralGetInfoCallback        = procedure (const userJoint : NewtonJoint; info : NewtonJointRecord);

 NewtonConstraintDestructor                 = ^TNewtonConstraintDestructor;
 TNewtonConstraintDestructor                = procedure (const me : NewtonJoint);

 NewtonJobTask                              = ^TNewtonJobTask;
 TNewtonJobTask                             = procedure (world : NewtonWorld; userData : Pointer; threadIndex : Integer);

 NewtonReportProgress                       = ^TNewtonReportProgress;
 TNewtonReportProgress                      = function (progressNormalzedPercent : dFloat; userData : Pointer) : Integer;


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() : NewtonWorld; cdecl; external NEWTON_API;
function NewtonCreateEx(stackSizeInMegabytes : Integer) : NewtonWorld; cdecl; external NEWTON_API;
procedure NewtonDestroy(newtonWorld : NewtonWorld); cdecl; external NEWTON_API;
procedure NewtonDestroyAllBodies(newtonWorld : NewtonWorld); cdecl; external NEWTON_API;
function NewtonAlloc(sizeInBytes : Integer) : Pointer; cdecl; external NEWTON_API;
procedure NewtonFree(ptr : Pointer); cdecl; external NEWTON_API;
function NewtonGetStackSize(newtonWorld : NewtonWorld) : Integer; cdecl; external NEWTON_API;
procedure NewtonSetStackSize(newtonWorld : NewtonWorld; size : Integer); cdecl; external NEWTON_API;
function NewtonEnumerateDevices(newtonWorld : NewtonWorld) : Integer; cdecl; external NEWTON_API;
function NewtonGetCurrentDevice(newtonWorld : NewtonWorld) : Integer; cdecl; external NEWTON_API;
procedure NewtonSetCurrentDevice(newtonWorld : NewtonWorld; deviceIndex : Integer); cdecl; external NEWTON_API;
procedure NewtonGetDeviceString(newtonWorld : NewtonWorld; deviceIndex : Integer; vendorString : Pchar; maxSize : Integer); cdecl; external NEWTON_API;
function NewtonGetContactMergeTolerance(newtonWorld : NewtonWorld) : dFloat; cdecl; external NEWTON_API;
procedure NewtonSetContactMergeTolerance(newtonWorld : NewtonWorld; tolerance : dFloat); cdecl; external NEWTON_API;
procedure NewtonInvalidateCache(newtonWorld : NewtonWorld); cdecl; external NEWTON_API;
procedure NewtonSetSolverModel(newtonWorld : NewtonWorld; model : Integer); cdecl; external NEWTON_API;
function NewtonGetSolverModel(newtonWorld : NewtonWorld) : Integer; cdecl; external NEWTON_API;
procedure NewtonSetSolverConvergenceQuality(newtonWorld : NewtonWorld; lowOrHigh : Integer); cdecl; external NEWTON_API;
function NewtonGetSolverConvergenceQuality(newtonWorld : NewtonWorld) : Integer; cdecl; external NEWTON_API;
procedure NewtonSetMultiThreadSolverOnSingleIsland(newtonWorld : NewtonWorld; mode : Integer); cdecl; external NEWTON_API;
function NewtonGetMultiThreadSolverOnSingleIsland(newtonWorld : NewtonWorld) : Integer; cdecl; external NEWTON_API;
procedure NewtonSetPerformanceClock(newtonWorld : NewtonWorld; callback : NewtonGetTimeInMicrosencondsCallback); cdecl; external NEWTON_API;
function NewtonGetBroadphaseAlgorithm(newtonWorld : NewtonWorld) : Integer; cdecl; external NEWTON_API;
procedure NewtonSelectBroadphaseAlgorithm(newtonWorld : NewtonWorld; algorithmType : Integer); cdecl; external NEWTON_API;
procedure NewtonUpdate(newtonWorld : NewtonWorld; timestep : dFloat); cdecl; external NEWTON_API;
procedure NewtonUpdateAsync(newtonWorld : NewtonWorld; timestep : dFloat); cdecl; external NEWTON_API;
procedure NewtonWaitForUpdateToFinish(newtonWorld : NewtonWorld); cdecl; external NEWTON_API;
function NewtonGetNumberOfSubsteps(newtonWorld : NewtonWorld) : Integer; cdecl; external NEWTON_API;
procedure NewtonSetNumberOfSubsteps(newtonWorld : NewtonWorld; subSteps : Integer); cdecl; external NEWTON_API;
function NewtonGetLastUpdateTime(newtonWorld : NewtonWorld) : dFloat; cdecl; external NEWTON_API;
procedure NewtonSerializeToFile(newtonWorld : NewtonWorld; filename : Pchar; bodyCallback : NewtonOnBodySerializationCallback; bodyUserData : Pointer); cdecl; external NEWTON_API;
procedure NewtonDeserializeFromFile(newtonWorld : NewtonWorld; filename : Pchar; bodyCallback : NewtonOnBodyDeserializationCallback; bodyUserData : Pointer); cdecl; external NEWTON_API;
function NewtonFindSerializedBody(newtonWorld : NewtonWorld; bodySerializedID : Integer) : NewtonBody; cdecl; external NEWTON_API;
procedure NewtonSetJointSerializationCallbacks(newtonWorld : NewtonWorld; serializeJoint : NewtonOnJointSerializationCallback; deserializeJoint : NewtonOnJointDeserializationCallback); cdecl; external NEWTON_API;
procedure NewtonGetJointSerializationCallbacks(newtonWorld : NewtonWorld; serializeJoint : NewtonOnJointSerializationCallback; deserializeJoint : NewtonOnJointDeserializationCallback); cdecl; external NEWTON_API;
procedure NewtonWorldCriticalSectionLock(newtonWorld : NewtonWorld; threadIndex : Integer); cdecl; external NEWTON_API;
procedure NewtonWorldCriticalSectionUnlock(newtonWorld : NewtonWorld); cdecl; external NEWTON_API;
procedure NewtonSetThreadsCount(newtonWorld : NewtonWorld; threads : Integer); cdecl; external NEWTON_API;
function NewtonGetThreadsCount(newtonWorld : NewtonWorld) : Integer; cdecl; external NEWTON_API;
function NewtonGetMaxThreadsCount(newtonWorld : NewtonWorld) : Integer; cdecl; external NEWTON_API;
procedure NewtonDispachThreadJob(newtonWorld : NewtonWorld; task : NewtonJobTask; usedData : Pointer); cdecl; external NEWTON_API;
procedure NewtonSyncThreadJobs(newtonWorld : NewtonWorld); cdecl; external NEWTON_API;
function NewtonAtomicAdd(ptr : PInteger; value : Integer) : Integer; cdecl; external NEWTON_API;
function NewtonAtomicSwap(ptr : PInteger; value : Integer) : Integer; cdecl; external NEWTON_API;
procedure NewtonYield(); cdecl; external NEWTON_API;
procedure NewtonSetIslandUpdateEvent(newtonWorld : NewtonWorld; islandUpdate : NewtonIslandUpdate); cdecl; external NEWTON_API;
procedure NewtonWorldForEachJointDo(newtonWorld : NewtonWorld; callback : NewtonJointIterator; userData : Pointer); cdecl; external NEWTON_API;
procedure NewtonWorldForEachBodyInAABBDo(newtonWorld : NewtonWorld; p0 : PdFloat; p1 : PdFloat; callback : NewtonBodyIterator; userData : Pointer); cdecl; external NEWTON_API;
procedure NewtonWorldSetUserData(newtonWorld : NewtonWorld; userData : Pointer); cdecl; external NEWTON_API;
function NewtonWorldGetUserData(newtonWorld : NewtonWorld) : Pointer; cdecl; external NEWTON_API;
function NewtonWorldGetListenerUserData(newtonWorld : NewtonWorld; listener : Pointer) : Pointer; cdecl; external NEWTON_API;
function NewtonWorldListenerGetBodyDestroyCallback(newtonWorld : NewtonWorld; listener : Pointer) : NewtonWorldListenerBodyDestroyCallback; cdecl; external NEWTON_API;
procedure NewtonWorldListenerSetBodyDestroyCallback(newtonWorld : NewtonWorld; listener : Pointer; bodyDestroyCallback : NewtonWorldListenerBodyDestroyCallback); cdecl; external NEWTON_API;
function NewtonWorldGetPreListener(newtonWorld : NewtonWorld; nameId : Pchar) : Pointer; cdecl; external NEWTON_API;
function NewtonWorldAddPreListener(newtonWorld : NewtonWorld; nameId : Pchar; listenerUserData : Pointer; update : NewtonWorldUpdateListenerCallback; destroy : NewtonWorldDestroyListenerCallback) : Pointer; cdecl; external NEWTON_API;
function NewtonWorldGetPostListener(newtonWorld : NewtonWorld; nameId : Pchar) : Pointer; cdecl; external NEWTON_API;
function NewtonWorldAddPostListener(newtonWorld : NewtonWorld; nameId : Pchar; listenerUserData : Pointer; update : NewtonWorldUpdateListenerCallback; destroy : NewtonWorldDestroyListenerCallback) : Pointer; cdecl; external NEWTON_API;
procedure NewtonWorldSetDestructorCallback(newtonWorld : NewtonWorld; _destructor : NewtonWorldDestructorCallback); cdecl; external NEWTON_API;
function NewtonWorldGetDestructorCallback(newtonWorld : NewtonWorld) : NewtonWorldDestructorCallback; cdecl; external NEWTON_API;
procedure NewtonWorldSetCollisionConstructorDestructorCallback(newtonWorld : NewtonWorld; _constructor : NewtonCollisionCopyConstructionCallback; _destructor : NewtonCollisionDestructorCallback); cdecl; external NEWTON_API;
procedure NewtonWorldRayCast(newtonWorld : NewtonWorld; p0 : PdFloat; p1 : PdFloat; filter : NewtonWorldRayFilterCallback; userData : Pointer; prefilter : NewtonWorldRayPrefilterCallback; threadIndex : Integer); cdecl; external NEWTON_API;
function NewtonWorldConvexCast(newtonWorld : NewtonWorld; matrix : PdFloat; target : PdFloat; shape : NewtonCollision; param : PdFloat; userData : Pointer; prefilter : NewtonWorldRayPrefilterCallback; info : NewtonWorldConvexCastReturnInfo; maxContactsCount : Integer; threadIndex : Integer) : Integer; cdecl; external NEWTON_API;
function NewtonWorldCollide(newtonWorld : NewtonWorld; matrix : PdFloat; shape : NewtonCollision; userData : Pointer; prefilter : NewtonWorldRayPrefilterCallback; info : NewtonWorldConvexCastReturnInfo; maxContactsCount : Integer; threadIndex : Integer) : Integer; cdecl; external NEWTON_API;
function NewtonWorldGetBodyCount(newtonWorld : NewtonWorld) : Integer; cdecl; external NEWTON_API;
function NewtonWorldGetConstraintCount(newtonWorld : NewtonWorld) : Integer; cdecl; external NEWTON_API;
function NewtonIslandGetBody(island : Pointer; bodyIndex : Integer) : NewtonBody; cdecl; external NEWTON_API;
procedure NewtonIslandGetBodyAABB(island : Pointer; bodyIndex : Integer; p0 : PdFloat; p1 : PdFloat); cdecl; external NEWTON_API;
function NewtonMaterialCreateGroupID(newtonWorld : NewtonWorld) : Integer; cdecl; external NEWTON_API;
function NewtonMaterialGetDefaultGroupID(newtonWorld : NewtonWorld) : Integer; cdecl; external NEWTON_API;
procedure NewtonMaterialDestroyAllGroupID(newtonWorld : NewtonWorld); cdecl; external NEWTON_API;
function NewtonMaterialGetUserData(newtonWorld : NewtonWorld; id0 : Integer; id1 : Integer) : Pointer; cdecl; external NEWTON_API;
procedure NewtonMaterialSetSurfaceThickness(newtonWorld : NewtonWorld; id0 : Integer; id1 : Integer; thickness : dFloat); cdecl; external NEWTON_API;
procedure NewtonMaterialSetCallbackUserData(newtonWorld : NewtonWorld; id0 : Integer; id1 : Integer; userData : Pointer); cdecl; external NEWTON_API;
procedure NewtonMaterialSetContactGenerationCallback(newtonWorld : NewtonWorld; id0 : Integer; id1 : Integer; contactGeneration : NewtonOnContactGeneration); cdecl; external NEWTON_API;
procedure NewtonMaterialSetCompoundCollisionCallback(newtonWorld : NewtonWorld; id0 : Integer; id1 : Integer; compoundAabbOverlap : NewtonOnCompoundSubCollisionAABBOverlap); cdecl; external NEWTON_API;
procedure NewtonMaterialSetCollisionCallback(newtonWorld : NewtonWorld; id0 : Integer; id1 : Integer; aabbOverlap : NewtonOnAABBOverlap; process : NewtonContactsProcess); cdecl; external NEWTON_API;
procedure NewtonMaterialSetDefaultSoftness(newtonWorld : NewtonWorld; id0 : Integer; id1 : Integer; value : dFloat); cdecl; external NEWTON_API;
procedure NewtonMaterialSetDefaultElasticity(newtonWorld : NewtonWorld; id0 : Integer; id1 : Integer; elasticCoef : dFloat); cdecl; external NEWTON_API;
procedure NewtonMaterialSetDefaultCollidable(newtonWorld : NewtonWorld; id0 : Integer; id1 : Integer; state : Integer); cdecl; external NEWTON_API;
procedure NewtonMaterialSetDefaultFriction(newtonWorld : NewtonWorld; id0 : Integer; id1 : Integer; staticFriction : dFloat; kineticFriction : dFloat); cdecl; external NEWTON_API;
function NewtonWorldGetFirstMaterial(newtonWorld : NewtonWorld) : NewtonMaterial; cdecl; external NEWTON_API;
function NewtonWorldGetNextMaterial(newtonWorld : NewtonWorld; material : NewtonMaterial) : NewtonMaterial; cdecl; external NEWTON_API;
function NewtonWorldGetFirstBody(newtonWorld : NewtonWorld) : NewtonBody; cdecl; external NEWTON_API;
function NewtonWorldGetNextBody(newtonWorld : NewtonWorld; curBody : NewtonBody) : NewtonBody; cdecl; external NEWTON_API;
function NewtonMaterialGetMaterialPairUserData(material : NewtonMaterial) : Pointer; cdecl; external NEWTON_API;
function NewtonMaterialGetContactFaceAttribute(material : NewtonMaterial) : Cardinal; cdecl; external NEWTON_API;
function NewtonMaterialGetBodyCollidingShape(material : NewtonMaterial; body : NewtonBody) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonMaterialGetContactNormalSpeed(material : NewtonMaterial) : dFloat; cdecl; external NEWTON_API;
procedure NewtonMaterialGetContactForce(material : NewtonMaterial; body : NewtonBody; force : PdFloat); cdecl; external NEWTON_API;
procedure NewtonMaterialGetContactPositionAndNormal(material : NewtonMaterial; body : NewtonBody; posit : PdFloat; normal : PdFloat); cdecl; external NEWTON_API;
procedure NewtonMaterialGetContactTangentDirections(material : NewtonMaterial; body : NewtonBody; dir0 : PdFloat; dir1 : PdFloat); cdecl; external NEWTON_API;
function NewtonMaterialGetContactTangentSpeed(material : NewtonMaterial; index : Integer) : dFloat; cdecl; external NEWTON_API;
function NewtonMaterialGetContactMaxNormalImpact(material : NewtonMaterial) : dFloat; cdecl; external NEWTON_API;
function NewtonMaterialGetContactMaxTangentImpact(material : NewtonMaterial; index : Integer) : dFloat; cdecl; external NEWTON_API;
function NewtonMaterialGetContactPenetration(material : NewtonMaterial) : dFloat; cdecl; external NEWTON_API;
procedure NewtonMaterialSetContactSoftness(material : NewtonMaterial; softness : dFloat); cdecl; external NEWTON_API;
procedure NewtonMaterialSetContactElasticity(material : NewtonMaterial; restitution : dFloat); cdecl; external NEWTON_API;
procedure NewtonMaterialSetContactFrictionState(material : NewtonMaterial; state : Integer; index : Integer); cdecl; external NEWTON_API;
procedure NewtonMaterialSetContactFrictionCoef(material : NewtonMaterial; staticFrictionCoef : dFloat; kineticFrictionCoef : dFloat; index : Integer); cdecl; external NEWTON_API;
procedure NewtonMaterialSetContactNormalAcceleration(material : NewtonMaterial; accel : dFloat); cdecl; external NEWTON_API;
procedure NewtonMaterialSetContactNormalDirection(material : NewtonMaterial; directionVector : PdFloat); cdecl; external NEWTON_API;
procedure NewtonMaterialSetContactPosition(material : NewtonMaterial; position : PdFloat); cdecl; external NEWTON_API;
procedure NewtonMaterialSetContactTangentFriction(material : NewtonMaterial; friction : dFloat; index : Integer); cdecl; external NEWTON_API;
procedure NewtonMaterialSetContactTangentAcceleration(material : NewtonMaterial; accel : dFloat; index : Integer); cdecl; external NEWTON_API;
procedure NewtonMaterialContactRotateTangentDirections(material : NewtonMaterial; directionVector : PdFloat); cdecl; external NEWTON_API;
function NewtonCreateNull(newtonWorld : NewtonWorld) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonCreateSphere(newtonWorld : NewtonWorld; radius : dFloat; shapeID : Integer; offsetMatrix : PdFloat) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonCreateBox(newtonWorld : NewtonWorld; dx : dFloat; dy : dFloat; dz : dFloat; shapeID : Integer; offsetMatrix : PdFloat) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonCreateCone(newtonWorld : NewtonWorld; radius : dFloat; height : dFloat; shapeID : Integer; offsetMatrix : PdFloat) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonCreateCapsule(newtonWorld : NewtonWorld; radius0 : dFloat; radius1 : dFloat; height : dFloat; shapeID : Integer; offsetMatrix : PdFloat) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonCreateCylinder(newtonWorld : NewtonWorld; radio0 : dFloat; radio1 : dFloat; height : dFloat; shapeID : Integer; offsetMatrix : PdFloat) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonCreateChamferCylinder(newtonWorld : NewtonWorld; radius : dFloat; height : dFloat; shapeID : Integer; offsetMatrix : PdFloat) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonCreateConvexHull(newtonWorld : NewtonWorld; count : Integer; vertexCloud : PdFloat; strideInBytes : Integer; tolerance : dFloat; shapeID : Integer; offsetMatrix : PdFloat) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonCreateConvexHullFromMesh(newtonWorld : NewtonWorld; mesh : NewtonMesh; tolerance : dFloat; shapeID : Integer) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonCollisionGetMode(convexCollision : NewtonCollision) : Integer; cdecl; external NEWTON_API;
procedure NewtonCollisionSetMode(convexCollision : NewtonCollision; mode : Integer); cdecl; external NEWTON_API;
function NewtonConvexHullGetFaceIndices(convexHullCollision : NewtonCollision; face : Integer; faceIndices : PInteger) : Integer; cdecl; external NEWTON_API;
function NewtonConvexHullGetVertexData(convexHullCollision : NewtonCollision; vertexData : PdFloat; strideInBytes : PInteger) : Integer; cdecl; external NEWTON_API;
function NewtonConvexCollisionCalculateVolume(convexCollision : NewtonCollision) : dFloat; cdecl; external NEWTON_API;
procedure NewtonConvexCollisionCalculateInertialMatrix(convexCollision : NewtonCollision; inertia : PdFloat; origin : PdFloat); cdecl; external NEWTON_API;
procedure NewtonConvexCollisionCalculateBuoyancyAcceleration(convexCollision : NewtonCollision; matrix : PdFloat; shapeOrigin : PdFloat; gravityVector : PdFloat; fluidPlane : PdFloat; fluidDensity : dFloat; fluidViscosity : dFloat; accel : PdFloat; alpha : PdFloat); cdecl; external NEWTON_API;
function NewtonCollisionDataPointer(convexCollision : NewtonCollision) : Pointer; cdecl; external NEWTON_API;
function NewtonCreateCompoundCollision(newtonWorld : NewtonWorld; shapeID : Integer) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonCreateCompoundCollisionFromMesh(newtonWorld : NewtonWorld; mesh : NewtonMesh; hullTolerance : dFloat; shapeID : Integer; subShapeID : Integer) : NewtonCollision; cdecl; external NEWTON_API;
procedure NewtonCompoundCollisionBeginAddRemove(compoundCollision : NewtonCollision); cdecl; external NEWTON_API;
function NewtonCompoundCollisionAddSubCollision(compoundCollision : NewtonCollision; convexCollision : NewtonCollision) : Pointer; cdecl; external NEWTON_API;
procedure NewtonCompoundCollisionRemoveSubCollision(compoundCollision : NewtonCollision; collisionNode : Pointer); cdecl; external NEWTON_API;
procedure NewtonCompoundCollisionRemoveSubCollisionByIndex(compoundCollision : NewtonCollision; nodeIndex : Integer); cdecl; external NEWTON_API;
procedure NewtonCompoundCollisionSetSubCollisionMatrix(compoundCollision : NewtonCollision; collisionNode : Pointer; matrix : PdFloat); cdecl; external NEWTON_API;
procedure NewtonCompoundCollisionEndAddRemove(compoundCollision : NewtonCollision); cdecl; external NEWTON_API;
function NewtonCompoundCollisionGetFirstNode(compoundCollision : NewtonCollision) : Pointer; cdecl; external NEWTON_API;
function NewtonCompoundCollisionGetNextNode(compoundCollision : NewtonCollision; collisionNode : Pointer) : Pointer; cdecl; external NEWTON_API;
function NewtonCompoundCollisionGetNodeByIndex(compoundCollision : NewtonCollision; index : Integer) : Pointer; cdecl; external NEWTON_API;
function NewtonCompoundCollisionGetNodeIndex(compoundCollision : NewtonCollision; collisionNode : Pointer) : Integer; cdecl; external NEWTON_API;
function NewtonCompoundCollisionGetCollisionFromNode(compoundCollision : NewtonCollision; collisionNode : Pointer) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonCreateFracturedCompoundCollision(newtonWorld : NewtonWorld; solidMesh : NewtonMesh; shapeID : Integer; fracturePhysicsMaterialID : Integer; pointcloudCount : Integer; vertexCloud : PdFloat; strideInBytes : Integer; materialID : Integer; textureMatrix : PdFloat; regenerateMainMeshCallback : NewtonFractureCompoundCollisionReconstructMainMeshCallBack; emitFracturedCompound : NewtonFractureCompoundCollisionOnEmitCompoundFractured; emitFracfuredChunk : NewtonFractureCompoundCollisionOnEmitChunk) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonFracturedCompoundPlaneClip(fracturedCompound : NewtonCollision; plane : PdFloat) : NewtonCollision; cdecl; external NEWTON_API;
procedure NewtonFracturedCompoundSetCallbacks(fracturedCompound : NewtonCollision; regenerateMainMeshCallback : NewtonFractureCompoundCollisionReconstructMainMeshCallBack; emitFracturedCompound : NewtonFractureCompoundCollisionOnEmitCompoundFractured; emitFracfuredChunk : NewtonFractureCompoundCollisionOnEmitChunk); cdecl; external NEWTON_API;
function NewtonFracturedCompoundIsNodeFreeToDetach(fracturedCompound : NewtonCollision; collisionNode : Pointer) : Integer; cdecl; external NEWTON_API;
function NewtonFracturedCompoundNeighborNodeList(fracturedCompound : NewtonCollision; collisionNode : Pointer; list : Pointer; maxCount : Integer) : Integer; cdecl; external NEWTON_API;
function NewtonFracturedCompoundGetMainMesh(fracturedCompound : NewtonCollision) : NewtonFracturedCompoundMeshPart; cdecl; external NEWTON_API;
function NewtonFracturedCompoundGetFirstSubMesh(fracturedCompound : NewtonCollision) : NewtonFracturedCompoundMeshPart; cdecl; external NEWTON_API;
function NewtonFracturedCompoundGetNextSubMesh(fracturedCompound : NewtonCollision; subMesh : NewtonFracturedCompoundMeshPart) : NewtonFracturedCompoundMeshPart; cdecl; external NEWTON_API;
function NewtonFracturedCompoundCollisionGetVertexCount(fracturedCompound : NewtonCollision; meshOwner : NewtonFracturedCompoundMeshPart) : Integer; cdecl; external NEWTON_API;
function NewtonFracturedCompoundCollisionGetVertexPositions(fracturedCompound : NewtonCollision; meshOwner : NewtonFracturedCompoundMeshPart) : PdFloat; cdecl; external NEWTON_API;
function NewtonFracturedCompoundCollisionGetVertexNormals(fracturedCompound : NewtonCollision; meshOwner : NewtonFracturedCompoundMeshPart) : PdFloat; cdecl; external NEWTON_API;
function NewtonFracturedCompoundCollisionGetVertexUVs(fracturedCompound : NewtonCollision; meshOwner : NewtonFracturedCompoundMeshPart) : PdFloat; cdecl; external NEWTON_API;
function NewtonFracturedCompoundMeshPartGetIndexStream(fracturedCompound : NewtonCollision; meshOwner : NewtonFracturedCompoundMeshPart; segment : Pointer; index : PInteger) : Integer; cdecl; external NEWTON_API;
function NewtonFracturedCompoundMeshPartGetFirstSegment(fractureCompoundMeshPart : NewtonFracturedCompoundMeshPart) : Pointer; cdecl; external NEWTON_API;
function NewtonFracturedCompoundMeshPartGetNextSegment(fractureCompoundMeshSegment : Pointer) : Pointer; cdecl; external NEWTON_API;
function NewtonFracturedCompoundMeshPartGetMaterial(fractureCompoundMeshSegment : Pointer) : Integer; cdecl; external NEWTON_API;
function NewtonFracturedCompoundMeshPartGetIndexCount(fractureCompoundMeshSegment : Pointer) : Integer; cdecl; external NEWTON_API;
function NewtonCreateSceneCollision(newtonWorld : NewtonWorld; shapeID : Integer) : NewtonCollision; cdecl; external NEWTON_API;
procedure NewtonSceneCollisionBeginAddRemove(sceneCollision : NewtonCollision); cdecl; external NEWTON_API;
function NewtonSceneCollisionAddSubCollision(sceneCollision : NewtonCollision; collision : NewtonCollision) : Pointer; cdecl; external NEWTON_API;
procedure NewtonSceneCollisionRemoveSubCollision(compoundCollision : NewtonCollision; collisionNode : Pointer); cdecl; external NEWTON_API;
procedure NewtonSceneCollisionRemoveSubCollisionByIndex(sceneCollision : NewtonCollision; nodeIndex : Integer); cdecl; external NEWTON_API;
procedure NewtonSceneCollisionSetSubCollisionMatrix(sceneCollision : NewtonCollision; collisionNode : Pointer; matrix : PdFloat); cdecl; external NEWTON_API;
procedure NewtonSceneCollisionEndAddRemove(sceneCollision : NewtonCollision); cdecl; external NEWTON_API;
function NewtonSceneCollisionGetFirstNode(sceneCollision : NewtonCollision) : Pointer; cdecl; external NEWTON_API;
function NewtonSceneCollisionGetNextNode(sceneCollision : NewtonCollision; collisionNode : Pointer) : Pointer; cdecl; external NEWTON_API;
function NewtonSceneCollisionGetNodeByIndex(sceneCollision : NewtonCollision; index : Integer) : Pointer; cdecl; external NEWTON_API;
function NewtonSceneCollisionGetNodeIndex(sceneCollision : NewtonCollision; collisionNode : Pointer) : Integer; cdecl; external NEWTON_API;
function NewtonSceneCollisionGetCollisionFromNode(sceneCollision : NewtonCollision; collisionNode : Pointer) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonCreateUserMeshCollision(newtonWorld : NewtonWorld; minBox : PdFloat; maxBox : PdFloat; userData : Pointer; collideCallback : NewtonUserMeshCollisionCollideCallback; rayHitCallback : NewtonUserMeshCollisionRayHitCallback; destroyCallback : NewtonUserMeshCollisionDestroyCallback; getInfoCallback : NewtonUserMeshCollisionGetCollisionInfo; getLocalAABBCallback : NewtonUserMeshCollisionAABBTest; facesInAABBCallback : NewtonUserMeshCollisionGetFacesInAABB; serializeCallback : NewtonOnUserCollisionSerializationCallback; shapeID : Integer) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonUserMeshCollisionContinuousOverlapTest(collideDescData : NewtonUserMeshCollisionCollideDesc; continueCollisionHandle : Pointer; minAabb : PdFloat; maxAabb : PdFloat) : Integer; cdecl; external NEWTON_API;
function NewtonCreateCollisionFromSerialization(newtonWorld : NewtonWorld; deserializeFunction : NewtonDeserializeCallback; serializeHandle : Pointer) : NewtonCollision; cdecl; external NEWTON_API;
procedure NewtonCollisionSerialize(newtonWorld : NewtonWorld; collision : NewtonCollision; serializeFunction : NewtonSerializeCallback; serializeHandle : Pointer); cdecl; external NEWTON_API;
procedure NewtonCollisionGetInfo(collision : NewtonCollision; collisionInfo : NewtonCollisionInfoRecord); cdecl; external NEWTON_API;
function NewtonCreateHeightFieldCollision(newtonWorld : NewtonWorld; width : Integer; height : Integer; gridsDiagonals : Integer; elevationdatType : Integer; elevationMap : Pointer; attributeMap : Pchar; verticalScale : dFloat; horizontalScale_x : dFloat; horizontalScale_z : dFloat; shapeID : Integer) : NewtonCollision; cdecl; external NEWTON_API;
procedure NewtonHeightFieldSetUserRayCastCallback(heightfieldCollision : NewtonCollision; rayHitCallback : NewtonHeightFieldRayCastCallback); cdecl; external NEWTON_API;
procedure NewtonHeightFieldSetHorizontalDisplacement(heightfieldCollision : NewtonCollision; horizontalMap : Pword; scale : dFloat); cdecl; external NEWTON_API;
function NewtonCreateTreeCollision(newtonWorld : NewtonWorld; shapeID : Integer) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonCreateTreeCollisionFromMesh(newtonWorld : NewtonWorld; mesh : NewtonMesh; shapeID : Integer) : NewtonCollision; cdecl; external NEWTON_API;
procedure NewtonTreeCollisionSetUserRayCastCallback(treeCollision : NewtonCollision; rayHitCallback : NewtonCollisionTreeRayCastCallback); cdecl; external NEWTON_API;
procedure NewtonTreeCollisionBeginBuild(treeCollision : NewtonCollision); cdecl; external NEWTON_API;
procedure NewtonTreeCollisionAddFace(treeCollision : NewtonCollision; vertexCount : Integer; vertexPtr : PdFloat; strideInBytes : Integer; faceAttribute : Integer); cdecl; external NEWTON_API;
procedure NewtonTreeCollisionEndBuild(treeCollision : NewtonCollision; optimize : Integer); cdecl; external NEWTON_API;
function NewtonTreeCollisionGetFaceAttribute(treeCollision : NewtonCollision; faceIndexArray : PInteger; indexCount : Integer) : Integer; cdecl; external NEWTON_API;
procedure NewtonTreeCollisionSetFaceAttribute(treeCollision : NewtonCollision; faceIndexArray : PInteger; indexCount : Integer; attribute : Integer); cdecl; external NEWTON_API;
procedure NewtonTreeCollisionForEachFace(treeCollision : NewtonCollision; forEachFaceCallback : NewtonTreeCollisionFaceCallback; context : Pointer); cdecl; external NEWTON_API;
function NewtonTreeCollisionGetVertexListTriangleListInAABB(treeCollision : NewtonCollision; p0 : PdFloat; p1 : PdFloat; vertexArray : PdFloat; vertexCount : PInteger; vertexStrideInBytes : PInteger; indexList : PInteger; maxIndexCount : Integer; faceAttribute : PInteger) : Integer; cdecl; external NEWTON_API;
procedure NewtonStaticCollisionSetDebugCallback(staticCollision : NewtonCollision; userCallback : NewtonTreeCollisionCallback); cdecl; external NEWTON_API;
function NewtonCollisionCreateInstance(collision : NewtonCollision) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonCollisionGetType(collision : NewtonCollision) : Integer; cdecl; external NEWTON_API;
function NewtonCollisionIsConvexShape(collision : NewtonCollision) : Integer; cdecl; external NEWTON_API;
function NewtonCollisionIsStaticShape(collision : NewtonCollision) : Integer; cdecl; external NEWTON_API;
procedure NewtonCollisionSetUserData(collision : NewtonCollision; userData : Pointer); cdecl; external NEWTON_API;
function NewtonCollisionGetUserData(collision : NewtonCollision) : Pointer; cdecl; external NEWTON_API;
procedure NewtonCollisionSetUserData1(collision : NewtonCollision; userData : Pointer); cdecl; external NEWTON_API;
function NewtonCollisionGetUserData1(collision : NewtonCollision) : Pointer; cdecl; external NEWTON_API;
procedure NewtonCollisionSetUserID(collision : NewtonCollision; id : Cardinal); cdecl; external NEWTON_API;
function NewtonCollisionGetUserID(collision : NewtonCollision) : Cardinal; cdecl; external NEWTON_API;
function NewtonCollisionGetSubCollisionHandle(collision : NewtonCollision) : Pointer; cdecl; external NEWTON_API;
function NewtonCollisionGetParentInstance(collision : NewtonCollision) : NewtonCollision; cdecl; external NEWTON_API;
procedure NewtonCollisionSetMatrix(collision : NewtonCollision; matrix : PdFloat); cdecl; external NEWTON_API;
procedure NewtonCollisionGetMatrix(collision : NewtonCollision; matrix : PdFloat); cdecl; external NEWTON_API;
procedure NewtonCollisionSetScale(collision : NewtonCollision; scaleX : dFloat; scaleY : dFloat; scaleZ : dFloat); cdecl; external NEWTON_API;
procedure NewtonCollisionGetScale(collision : NewtonCollision; scaleX : PdFloat; scaleY : PdFloat; scaleZ : PdFloat); cdecl; external NEWTON_API;
procedure NewtonDestroyCollision(collision : NewtonCollision); cdecl; external NEWTON_API;
function NewtonCollisionIntersectionTest(newtonWorld : NewtonWorld; collisionA : NewtonCollision; matrixA : PdFloat; collisionB : NewtonCollision; matrixB : PdFloat; threadIndex : Integer) : Integer; cdecl; external NEWTON_API;
function NewtonCollisionPointDistance(newtonWorld : NewtonWorld; point : PdFloat; collision : NewtonCollision; matrix : PdFloat; contact : PdFloat; normal : PdFloat; threadIndex : Integer) : Integer; cdecl; external NEWTON_API;
function NewtonCollisionClosestPoint(newtonWorld : NewtonWorld; collisionA : NewtonCollision; matrixA : PdFloat; collisionB : NewtonCollision; matrixB : PdFloat; contactA : PdFloat; contactB : PdFloat; normalAB : PdFloat; threadIndex : Integer) : Integer; cdecl; external NEWTON_API;
function NewtonCollisionCollide(newtonWorld : NewtonWorld; maxSize : Integer; collisionA : NewtonCollision; matrixA : PdFloat; collisionB : NewtonCollision; matrixB : PdFloat; contacts : PdFloat; normals : PdFloat; penetration : PdFloat; attributeA : PdLong; attributeB : PdLong; threadIndex : Integer) : Integer; cdecl; external NEWTON_API;
function NewtonCollisionCollideContinue(newtonWorld : NewtonWorld; maxSize : Integer; timestep : dFloat; collisionA : NewtonCollision; matrixA : PdFloat; velocA : PdFloat; omegaA : PdFloat; collisionB : NewtonCollision; matrixB : PdFloat; velocB : PdFloat; omegaB : PdFloat; timeOfImpact : PdFloat; contacts : PdFloat; normals : PdFloat; penetration : PdFloat; attributeA : PdLong; attributeB : PdLong; threadIndex : Integer) : Integer; cdecl; external NEWTON_API;
procedure NewtonCollisionSupportVertex(collision : NewtonCollision; dir : PdFloat; vertex : PdFloat); cdecl; external NEWTON_API;
function NewtonCollisionRayCast(collision : NewtonCollision; p0 : PdFloat; p1 : PdFloat; normal : PdFloat; attribute : PdLong) : dFloat; cdecl; external NEWTON_API;
procedure NewtonCollisionCalculateAABB(collision : NewtonCollision; matrix : PdFloat; p0 : PdFloat; p1 : PdFloat); cdecl; external NEWTON_API;
procedure NewtonCollisionForEachPolygonDo(collision : NewtonCollision; matrix : PdFloat; callback : NewtonCollisionIterator; userData : Pointer); cdecl; external NEWTON_API;
function NewtonCollisionAggregateCreate(world : NewtonWorld) : Pointer; cdecl; external NEWTON_API;
procedure NewtonCollisionAggregateDestroy(aggregate : Pointer); cdecl; external NEWTON_API;
procedure NewtonCollisionAggregateAddBody(aggregate : Pointer; body : NewtonBody); cdecl; external NEWTON_API;
procedure NewtonCollisionAggregateRemoveBody(aggregate : Pointer; body : NewtonBody); cdecl; external NEWTON_API;
function NewtonCollisionAggregateGetSelfCollision(aggregate : Pointer) : Integer; cdecl; external NEWTON_API;
procedure NewtonCollisionAggregateSetSelfCollision(aggregate : Pointer; state : Integer); cdecl; external NEWTON_API;
procedure NewtonSetEulerAngle(eulersAngles : PdFloat; matrix : PdFloat); cdecl; external NEWTON_API;
procedure NewtonGetEulerAngle(matrix : PdFloat; eulersAngles0 : PdFloat; eulersAngles1 : PdFloat); cdecl; external NEWTON_API;
function NewtonCalculateSpringDamperAcceleration(dt : dFloat; ks : dFloat; x : dFloat; kd : dFloat; s : dFloat) : dFloat; cdecl; external NEWTON_API;
function NewtonCreateDynamicBody(newtonWorld : NewtonWorld; collision : NewtonCollision; matrix : PdFloat) : NewtonBody; cdecl; external NEWTON_API;
function NewtonCreateKinematicBody(newtonWorld : NewtonWorld; collision : NewtonCollision; matrix : PdFloat) : NewtonBody; cdecl; external NEWTON_API;
procedure NewtonDestroyBody(body : NewtonBody); cdecl; external NEWTON_API;
function NewtonBodyGetSimulationState(body : NewtonBody) : Integer; cdecl; external NEWTON_API;
procedure NewtonBodySetSimulationState(bodyPtr : NewtonBody; state : Integer); cdecl; external NEWTON_API;
function NewtonBodyGetType(body : NewtonBody) : Integer; cdecl; external NEWTON_API;
function NewtonBodyGetCollidable(body : NewtonBody) : Integer; cdecl; external NEWTON_API;
procedure NewtonBodySetCollidable(body : NewtonBody; collidableState : Integer); cdecl; external NEWTON_API;
procedure NewtonBodyAddForce(body : NewtonBody; force : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodyAddTorque(body : NewtonBody; torque : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodyCalculateInverseDynamicsForce(body : NewtonBody; timestep : dFloat; desiredVeloc : PdFloat; forceOut : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodySetCentreOfMass(body : NewtonBody; com : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodySetMassMatrix(body : NewtonBody; mass : dFloat; Ixx : dFloat; Iyy : dFloat; Izz : dFloat); cdecl; external NEWTON_API;
procedure NewtonBodySetFullMassMatrix(body : NewtonBody; mass : dFloat; inertiaMatrix : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodySetMassProperties(body : NewtonBody; mass : dFloat; collision : NewtonCollision); cdecl; external NEWTON_API;
procedure NewtonBodySetMatrix(body : NewtonBody; matrix : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodySetMatrixNoSleep(body : NewtonBody; matrix : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodySetMatrixRecursive(body : NewtonBody; matrix : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodySetMaterialGroupID(body : NewtonBody; id : Integer); cdecl; external NEWTON_API;
procedure NewtonBodySetContinuousCollisionMode(body : NewtonBody; state : Cardinal); cdecl; external NEWTON_API;
procedure NewtonBodySetJointRecursiveCollision(body : NewtonBody; state : Cardinal); cdecl; external NEWTON_API;
procedure NewtonBodySetOmega(body : NewtonBody; omega : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodySetOmegaNoSleep(body : NewtonBody; omega : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodySetVelocity(body : NewtonBody; velocity : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodySetVelocityNoSleep(body : NewtonBody; velocity : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodySetForce(body : NewtonBody; force : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodySetTorque(body : NewtonBody; torque : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodySetLinearDamping(body : NewtonBody; linearDamp : dFloat); cdecl; external NEWTON_API;
procedure NewtonBodySetAngularDamping(body : NewtonBody; angularDamp : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodySetCollision(body : NewtonBody; collision : NewtonCollision); cdecl; external NEWTON_API;
procedure NewtonBodySetCollisionScale(body : NewtonBody; scaleX : dFloat; scaleY : dFloat; scaleZ : dFloat); cdecl; external NEWTON_API;
function NewtonBodyGetMaxRotationPerStep(body : NewtonBody) : dFloat; cdecl; external NEWTON_API;
procedure NewtonBodySetMaxRotationPerStep(body : NewtonBody; angleInRadians : dFloat); cdecl; external NEWTON_API;
function NewtonBodyGetSleepState(body : NewtonBody) : Integer; cdecl; external NEWTON_API;
procedure NewtonBodySetSleepState(body : NewtonBody; state : Integer); cdecl; external NEWTON_API;
function NewtonBodyGetAutoSleep(body : NewtonBody) : Integer; cdecl; external NEWTON_API;
procedure NewtonBodySetAutoSleep(body : NewtonBody; state : Integer); cdecl; external NEWTON_API;
function NewtonBodyGetFreezeState(body : NewtonBody) : Integer; cdecl; external NEWTON_API;
procedure NewtonBodySetFreezeState(body : NewtonBody; state : Integer); cdecl; external NEWTON_API;
procedure NewtonBodySetDestructorCallback(body : NewtonBody; callback : NewtonBodyDestructor); cdecl; external NEWTON_API;
function NewtonBodyGetDestructorCallback(body : NewtonBody) : NewtonBodyDestructor; cdecl; external NEWTON_API;
procedure NewtonBodySetTransformCallback(body : NewtonBody; callback : NewtonSetTransform); cdecl; external NEWTON_API;
function NewtonBodyGetTransformCallback(body : NewtonBody) : NewtonSetTransform; cdecl; external NEWTON_API;
procedure NewtonBodySetForceAndTorqueCallback(body : NewtonBody; callback : NewtonApplyForceAndTorque); cdecl; external NEWTON_API;
function NewtonBodyGetForceAndTorqueCallback(body : NewtonBody) : NewtonApplyForceAndTorque; cdecl; external NEWTON_API;
function NewtonBodyGetID(body : NewtonBody) : Integer; cdecl; external NEWTON_API;
procedure NewtonBodySetUserData(body : NewtonBody; userData : Pointer); cdecl; external NEWTON_API;
function NewtonBodyGetUserData(body : NewtonBody) : Pointer; cdecl; external NEWTON_API;
function NewtonBodyGetWorld(body : NewtonBody) : NewtonWorld; cdecl; external NEWTON_API;
function NewtonBodyGetCollision(body : NewtonBody) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonBodyGetMaterialGroupID(body : NewtonBody) : Integer; cdecl; external NEWTON_API;
function NewtonBodyGetSerializedID(body : NewtonBody) : Integer; cdecl; external NEWTON_API;
function NewtonBodyGetContinuousCollisionMode(body : NewtonBody) : Integer; cdecl; external NEWTON_API;
function NewtonBodyGetJointRecursiveCollision(body : NewtonBody) : Integer; cdecl; external NEWTON_API;
procedure NewtonBodyGetPosition(body : NewtonBody; pos : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodyGetMatrix(body : NewtonBody; matrix : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodyGetRotation(body : NewtonBody; rotation : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodyGetMass(body : NewtonBody; mass : PdFloat; Ixx : PdFloat; Iyy : PdFloat; Izz : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodyGetInvMass(body : NewtonBody; invMass : PdFloat; invIxx : PdFloat; invIyy : PdFloat; invIzz : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodyGetInertiaMatrix(body : NewtonBody; inertiaMatrix : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodyGetInvInertiaMatrix(body : NewtonBody; invInertiaMatrix : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodyGetOmega(body : NewtonBody; vector : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodyGetVelocity(body : NewtonBody; vector : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodyGetForce(body : NewtonBody; vector : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodyGetTorque(body : NewtonBody; vector : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodyGetCentreOfMass(body : NewtonBody; com : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodyGetPointVelocity(body : NewtonBody; point : PdFloat; velocOut : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodyApplyImpulsePair(body : NewtonBody; linearImpulse : PdFloat; angularImpulse : PdFloat; timestep : dFloat); cdecl; external NEWTON_API;
procedure NewtonBodyAddImpulse(body : NewtonBody; pointDeltaVeloc : PdFloat; pointPosit : PdFloat; timestep : dFloat); cdecl; external NEWTON_API;
procedure NewtonBodyApplyImpulseArray(body : NewtonBody; impuleCount : Integer; strideInByte : Integer; impulseArray : PdFloat; pointArray : PdFloat; timestep : dFloat); cdecl; external NEWTON_API;
procedure NewtonBodyIntegrateVelocity(body : NewtonBody; timestep : dFloat); cdecl; external NEWTON_API;
function NewtonBodyGetLinearDamping(body : NewtonBody) : dFloat; cdecl; external NEWTON_API;
procedure NewtonBodyGetAngularDamping(body : NewtonBody; vector : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBodyGetAABB(body : NewtonBody; p0 : PdFloat; p1 : PdFloat); cdecl; external NEWTON_API;
function NewtonBodyGetFirstJoint(body : NewtonBody) : NewtonJoint; cdecl; external NEWTON_API;
function NewtonBodyGetNextJoint(body : NewtonBody; joint : NewtonJoint) : NewtonJoint; cdecl; external NEWTON_API;
function NewtonBodyGetFirstContactJoint(body : NewtonBody) : NewtonJoint; cdecl; external NEWTON_API;
function NewtonBodyGetNextContactJoint(body : NewtonBody; contactJoint : NewtonJoint) : NewtonJoint; cdecl; external NEWTON_API;
function NewtonContactJointGetFirstContact(contactJoint : NewtonJoint) : Pointer; cdecl; external NEWTON_API;
function NewtonContactJointGetNextContact(contactJoint : NewtonJoint; contact : Pointer) : Pointer; cdecl; external NEWTON_API;
function NewtonContactJointGetContactCount(contactJoint : NewtonJoint) : Integer; cdecl; external NEWTON_API;
procedure NewtonContactJointRemoveContact(contactJoint : NewtonJoint; contact : Pointer); cdecl; external NEWTON_API;
function NewtonContactJointGetClosestDistance(contactJoint : NewtonJoint) : dFloat; cdecl; external NEWTON_API;
function NewtonContactGetMaterial(contact : Pointer) : NewtonMaterial; cdecl; external NEWTON_API;
function NewtonContactGetCollision0(contact : Pointer) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonContactGetCollision1(contact : Pointer) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonContactGetCollisionID0(contact : Pointer) : Pointer; cdecl; external NEWTON_API;
function NewtonContactGetCollisionID1(contact : Pointer) : Pointer; cdecl; external NEWTON_API;
function NewtonJointGetUserData(joint : NewtonJoint) : Pointer; cdecl; external NEWTON_API;
procedure NewtonJointSetUserData(joint : NewtonJoint; userData : Pointer); cdecl; external NEWTON_API;
function NewtonJointGetBody0(joint : NewtonJoint) : NewtonBody; cdecl; external NEWTON_API;
function NewtonJointGetBody1(joint : NewtonJoint) : NewtonBody; cdecl; external NEWTON_API;
procedure NewtonJointGetInfo(joint : NewtonJoint; info : NewtonJointRecord); cdecl; external NEWTON_API;
function NewtonJointGetCollisionState(joint : NewtonJoint) : Integer; cdecl; external NEWTON_API;
procedure NewtonJointSetCollisionState(joint : NewtonJoint; state : Integer); cdecl; external NEWTON_API;
function NewtonJointGetStiffness(joint : NewtonJoint) : dFloat; cdecl; external NEWTON_API;
procedure NewtonJointSetStiffness(joint : NewtonJoint; state : dFloat); cdecl; external NEWTON_API;
procedure NewtonDestroyJoint(newtonWorld : NewtonWorld; joint : NewtonJoint); cdecl; external NEWTON_API;
procedure NewtonJointSetDestructor(joint : NewtonJoint; _destructor : NewtonConstraintDestructor); cdecl; external NEWTON_API;
function NewtonJointIsActive(joint : NewtonJoint) : Integer; cdecl; external NEWTON_API;
function NewtonCreateMassSpringDamperSystem(newtonWorld : NewtonWorld; shapeID : Integer; points : PdFloat; pointCount : Integer; strideInBytes : Integer; pointMass : PdFloat; links : PInteger; linksCount : Integer; linksSpring : PdFloat; linksDamper : PdFloat) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonCreateDeformableSolid(newtonWorld : NewtonWorld; mesh : NewtonMesh; shapeID : Integer) : NewtonCollision; cdecl; external NEWTON_API;
function NewtonDeformableMeshGetParticleCount(deformableMesh : NewtonCollision) : Integer; cdecl; external NEWTON_API;
function NewtonDeformableMeshGetParticleStrideInBytes(deformableMesh : NewtonCollision) : Integer; cdecl; external NEWTON_API;
function NewtonDeformableMeshGetParticleArray(deformableMesh : NewtonCollision) : PdFloat; cdecl; external NEWTON_API;
function NewtonConstraintCreateBall(newtonWorld : NewtonWorld; pivotPoint : PdFloat; childBody : NewtonBody; parentBody : NewtonBody) : NewtonJoint; cdecl; external NEWTON_API;
procedure NewtonBallSetUserCallback(ball : NewtonJoint; callback : NewtonBallCallback); cdecl; external NEWTON_API;
procedure NewtonBallGetJointAngle(ball : NewtonJoint; angle : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBallGetJointOmega(ball : NewtonJoint; omega : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBallGetJointForce(ball : NewtonJoint; force : PdFloat); cdecl; external NEWTON_API;
procedure NewtonBallSetConeLimits(ball : NewtonJoint; pin : PdFloat; maxConeAngle : dFloat; maxTwistAngle : dFloat); cdecl; external NEWTON_API;
function NewtonConstraintCreateHinge(newtonWorld : NewtonWorld; pivotPoint : PdFloat; pinDir : PdFloat; childBody : NewtonBody; parentBody : NewtonBody) : NewtonJoint; cdecl; external NEWTON_API;
procedure NewtonHingeSetUserCallback(hinge : NewtonJoint; callback : NewtonHingeCallback); cdecl; external NEWTON_API;
function NewtonHingeGetJointAngle(hinge : NewtonJoint) : dFloat; cdecl; external NEWTON_API;
function NewtonHingeGetJointOmega(hinge : NewtonJoint) : dFloat; cdecl; external NEWTON_API;
procedure NewtonHingeGetJointForce(hinge : NewtonJoint; force : PdFloat); cdecl; external NEWTON_API;
function NewtonHingeCalculateStopAlpha(hinge : NewtonJoint; desc : NewtonHingeSliderUpdateDesc; angle : dFloat) : dFloat; cdecl; external NEWTON_API;
function NewtonConstraintCreateSlider(newtonWorld : NewtonWorld; pivotPoint : PdFloat; pinDir : PdFloat; childBody : NewtonBody; parentBody : NewtonBody) : NewtonJoint; cdecl; external NEWTON_API;
procedure NewtonSliderSetUserCallback(slider : NewtonJoint; callback : NewtonSliderCallback); cdecl; external NEWTON_API;
function NewtonSliderGetJointPosit(slider : NewtonJoint) : dFloat; cdecl; external NEWTON_API;
function NewtonSliderGetJointVeloc(slider : NewtonJoint) : dFloat; cdecl; external NEWTON_API;
procedure NewtonSliderGetJointForce(slider : NewtonJoint; force : PdFloat); cdecl; external NEWTON_API;
function NewtonSliderCalculateStopAccel(slider : NewtonJoint; desc : NewtonHingeSliderUpdateDesc; position : dFloat) : dFloat; cdecl; external NEWTON_API;
function NewtonConstraintCreateCorkscrew(newtonWorld : NewtonWorld; pivotPoint : PdFloat; pinDir : PdFloat; childBody : NewtonBody; parentBody : NewtonBody) : NewtonJoint; cdecl; external NEWTON_API;
procedure NewtonCorkscrewSetUserCallback(corkscrew : NewtonJoint; callback : NewtonCorkscrewCallback); cdecl; external NEWTON_API;
function NewtonCorkscrewGetJointPosit(corkscrew : NewtonJoint) : dFloat; cdecl; external NEWTON_API;
function NewtonCorkscrewGetJointAngle(corkscrew : NewtonJoint) : dFloat; cdecl; external NEWTON_API;
function NewtonCorkscrewGetJointVeloc(corkscrew : NewtonJoint) : dFloat; cdecl; external NEWTON_API;
function NewtonCorkscrewGetJointOmega(corkscrew : NewtonJoint) : dFloat; cdecl; external NEWTON_API;
procedure NewtonCorkscrewGetJointForce(corkscrew : NewtonJoint; force : PdFloat); cdecl; external NEWTON_API;
function NewtonCorkscrewCalculateStopAlpha(corkscrew : NewtonJoint; desc : NewtonHingeSliderUpdateDesc; angle : dFloat) : dFloat; cdecl; external NEWTON_API;
function NewtonCorkscrewCalculateStopAccel(corkscrew : NewtonJoint; desc : NewtonHingeSliderUpdateDesc; position : dFloat) : dFloat; cdecl; external NEWTON_API;
function NewtonConstraintCreateUniversal(newtonWorld : NewtonWorld; pivotPoint : PdFloat; pinDir0 : PdFloat; pinDir1 : PdFloat; childBody : NewtonBody; parentBody : NewtonBody) : NewtonJoint; cdecl; external NEWTON_API;
procedure NewtonUniversalSetUserCallback(universal : NewtonJoint; callback : NewtonUniversalCallback); cdecl; external NEWTON_API;
function NewtonUniversalGetJointAngle0(universal : NewtonJoint) : dFloat; cdecl; external NEWTON_API;
function NewtonUniversalGetJointAngle1(universal : NewtonJoint) : dFloat; cdecl; external NEWTON_API;
function NewtonUniversalGetJointOmega0(universal : NewtonJoint) : dFloat; cdecl; external NEWTON_API;
function NewtonUniversalGetJointOmega1(universal : NewtonJoint) : dFloat; cdecl; external NEWTON_API;
procedure NewtonUniversalGetJointForce(universal : NewtonJoint; force : PdFloat); cdecl; external NEWTON_API;
function NewtonUniversalCalculateStopAlpha0(universal : NewtonJoint; desc : NewtonHingeSliderUpdateDesc; angle : dFloat) : dFloat; cdecl; external NEWTON_API;
function NewtonUniversalCalculateStopAlpha1(universal : NewtonJoint; desc : NewtonHingeSliderUpdateDesc; angle : dFloat) : dFloat; cdecl; external NEWTON_API;
function NewtonConstraintCreateUpVector(newtonWorld : NewtonWorld; pinDir : PdFloat; body : NewtonBody) : NewtonJoint; cdecl; external NEWTON_API;
procedure NewtonUpVectorGetPin(upVector : NewtonJoint; pin : PdFloat); cdecl; external NEWTON_API;
procedure NewtonUpVectorSetPin(upVector : NewtonJoint; pin : PdFloat); cdecl; external NEWTON_API;
function NewtonConstraintCreateUserJoint(newtonWorld : NewtonWorld; maxDOF : Integer; callback : NewtonUserBilateralCallback; getInfo : NewtonUserBilateralGetInfoCallback; childBody : NewtonBody; parentBody : NewtonBody) : NewtonJoint; cdecl; external NEWTON_API;
function NewtonUserJointGetSolverModel(joint : NewtonJoint) : Integer; cdecl; external NEWTON_API;
procedure NewtonUserJointSetSolverModel(joint : NewtonJoint; model : Integer); cdecl; external NEWTON_API;
procedure NewtonUserJointSetFeedbackCollectorCallback(joint : NewtonJoint; getFeedback : NewtonUserBilateralCallback); cdecl; external NEWTON_API;
procedure NewtonUserJointAddLinearRow(joint : NewtonJoint; pivot0 : PdFloat; pivot1 : PdFloat; dir : PdFloat); cdecl; external NEWTON_API;
procedure NewtonUserJointAddAngularRow(joint : NewtonJoint; relativeAngle : dFloat; dir : PdFloat); cdecl; external NEWTON_API;
procedure NewtonUserJointAddGeneralRow(joint : NewtonJoint; jacobian0 : PdFloat; jacobian1 : PdFloat); cdecl; external NEWTON_API;
procedure NewtonUserJointSetRowMinimumFriction(joint : NewtonJoint; friction : dFloat); cdecl; external NEWTON_API;
procedure NewtonUserJointSetRowMaximumFriction(joint : NewtonJoint; friction : dFloat); cdecl; external NEWTON_API;
function NewtonUserCalculateRowZeroAccelaration(joint : NewtonJoint) : dFloat; cdecl; external NEWTON_API;
function NewtonUserJointGetRowAcceleration(joint : NewtonJoint) : dFloat; cdecl; external NEWTON_API;
procedure NewtonUserJointSetRowAcceleration(joint : NewtonJoint; acceleration : dFloat); cdecl; external NEWTON_API;
procedure NewtonUserJointSetRowSpringDamperAcceleration(joint : NewtonJoint; rowStiffness : dFloat; spring : dFloat; damper : dFloat); cdecl; external NEWTON_API;
procedure NewtonUserJointSetRowStiffness(joint : NewtonJoint; stiffness : dFloat); cdecl; external NEWTON_API;
function NewtonUserJoinRowsCount(joint : NewtonJoint) : Integer; cdecl; external NEWTON_API;
procedure NewtonUserJointGetGeneralRow(joint : NewtonJoint; index : Integer; jacobian0 : PdFloat; jacobian1 : PdFloat); cdecl; external NEWTON_API;
function NewtonUserJointGetRowForce(joint : NewtonJoint; row : Integer) : dFloat; cdecl; external NEWTON_API;
function NewtonMeshCreate(newtonWorld : NewtonWorld) : NewtonMesh; cdecl; external NEWTON_API;
function NewtonMeshCreateFromMesh(mesh : NewtonMesh) : NewtonMesh; cdecl; external NEWTON_API;
function NewtonMeshCreateFromCollision(collision : NewtonCollision) : NewtonMesh; cdecl; external NEWTON_API;
function NewtonMeshCreateTetrahedraIsoSurface(mesh : NewtonMesh) : NewtonMesh; cdecl; external NEWTON_API;
function NewtonMeshCreateConvexHull(newtonWorld : NewtonWorld; pointCount : Integer; vertexCloud : PdFloat; strideInBytes : Integer; tolerance : dFloat) : NewtonMesh; cdecl; external NEWTON_API;
function NewtonMeshCreateVoronoiConvexDecomposition(newtonWorld : NewtonWorld; pointCount : Integer; vertexCloud : PdFloat; strideInBytes : Integer; materialID : Integer; textureMatrix : PdFloat) : NewtonMesh; cdecl; external NEWTON_API;
function NewtonMeshCreateFromSerialization(newtonWorld : NewtonWorld; deserializeFunction : NewtonDeserializeCallback; serializeHandle : Pointer) : NewtonMesh; cdecl; external NEWTON_API;
procedure NewtonMeshDestroy(mesh : NewtonMesh); cdecl; external NEWTON_API;
procedure NewtonMeshSerialize(mesh : NewtonMesh; serializeFunction : NewtonSerializeCallback; serializeHandle : Pointer); cdecl; external NEWTON_API;
procedure NewtonMeshSaveOFF(mesh : NewtonMesh; filename : Pchar); cdecl; external NEWTON_API;
function NewtonMeshLoadOFF(newtonWorld : NewtonWorld; filename : Pchar) : NewtonMesh; cdecl; external NEWTON_API;
function NewtonMeshLoadTetrahedraMesh(newtonWorld : NewtonWorld; filename : Pchar) : NewtonMesh; cdecl; external NEWTON_API;
procedure NewtonMeshApplyTransform(mesh : NewtonMesh; matrix : PdFloat); cdecl; external NEWTON_API;
procedure NewtonMeshCalculateOOBB(mesh : NewtonMesh; matrix : PdFloat; x : PdFloat; y : PdFloat; z : PdFloat); cdecl; external NEWTON_API;
procedure NewtonMeshCalculateVertexNormals(mesh : NewtonMesh; angleInRadians : dFloat); cdecl; external NEWTON_API;
procedure NewtonMeshApplySphericalMapping(mesh : NewtonMesh; material : Integer); cdecl; external NEWTON_API;
procedure NewtonMeshApplyCylindricalMapping(mesh : NewtonMesh; cylinderMaterial : Integer; capMaterial : Integer); cdecl; external NEWTON_API;
procedure NewtonMeshApplyBoxMapping(mesh : NewtonMesh; frontMaterial : Integer; sideMaterial : Integer; topMaterial : Integer); cdecl; external NEWTON_API;
procedure NewtonMeshApplyAngleBasedMapping(mesh : NewtonMesh; material : Integer; reportPrograssCallback : NewtonReportProgress; reportPrgressUserData : Pointer); cdecl; external NEWTON_API;
procedure NewtonCreateTetrahedraLinearBlendSkinWeightsChannel(tetrahedraMesh : NewtonMesh; skinMesh : NewtonMesh); cdecl; external NEWTON_API;
procedure NewtonMeshOptimize(mesh : NewtonMesh); cdecl; external NEWTON_API;
procedure NewtonMeshOptimizePoints(mesh : NewtonMesh); cdecl; external NEWTON_API;
procedure NewtonMeshOptimizeVertex(mesh : NewtonMesh); cdecl; external NEWTON_API;
function NewtonMeshIsOpenMesh(mesh : NewtonMesh) : Integer; cdecl; external NEWTON_API;
procedure NewtonMeshFixTJoints(mesh : NewtonMesh); cdecl; external NEWTON_API;
procedure NewtonMeshPolygonize(mesh : NewtonMesh); cdecl; external NEWTON_API;
procedure NewtonMeshTriangulate(mesh : NewtonMesh); cdecl; external NEWTON_API;
function NewtonMeshUnion(mesh : NewtonMesh; clipper : NewtonMesh; clipperMatrix : PdFloat) : NewtonMesh; cdecl; external NEWTON_API;
function NewtonMeshDifference(mesh : NewtonMesh; clipper : NewtonMesh; clipperMatrix : PdFloat) : NewtonMesh; cdecl; external NEWTON_API;
function NewtonMeshIntersection(mesh : NewtonMesh; clipper : NewtonMesh; clipperMatrix : PdFloat) : NewtonMesh; cdecl; external NEWTON_API;
procedure NewtonMeshClip(mesh : NewtonMesh; clipper : NewtonMesh; clipperMatrix : PdFloat; topMesh : NewtonMesh; bottomMesh : NewtonMesh); cdecl; external NEWTON_API;
function NewtonMeshConvexMeshIntersection(mesh : NewtonMesh; convexMesh : NewtonMesh) : NewtonMesh; cdecl; external NEWTON_API;
function NewtonMeshSimplify(mesh : NewtonMesh; maxVertexCount : Integer; reportPrograssCallback : NewtonReportProgress; reportPrgressUserData : Pointer) : NewtonMesh; cdecl; external NEWTON_API;
function NewtonMeshApproximateConvexDecomposition(mesh : NewtonMesh; maxConcavity : dFloat; backFaceDistanceFactor : dFloat; maxCount : Integer; maxVertexPerHull : Integer; reportProgressCallback : NewtonReportProgress; reportProgressUserData : Pointer) : NewtonMesh; cdecl; external NEWTON_API;
procedure NewtonRemoveUnusedVertices(mesh : NewtonMesh; vertexRemapTable : PInteger); cdecl; external NEWTON_API;
procedure NewtonMeshBeginBuild(mesh : NewtonMesh); cdecl; external NEWTON_API;
procedure NewtonMeshBeginFace(mesh : NewtonMesh); cdecl; external NEWTON_API;
procedure NewtonMeshAddPoint(mesh : NewtonMesh; x : dFloat64; y : dFloat64; z : dFloat64); cdecl; external NEWTON_API;
procedure NewtonMeshAddLayer(mesh : NewtonMesh; layerIndex : Integer); cdecl; external NEWTON_API;
procedure NewtonMeshAddMaterial(mesh : NewtonMesh; materialIndex : Integer); cdecl; external NEWTON_API;
procedure NewtonMeshAddNormal(mesh : NewtonMesh; x : dFloat; y : dFloat; z : dFloat); cdecl; external NEWTON_API;
procedure NewtonMeshAddBinormal(mesh : NewtonMesh; x : dFloat; y : dFloat; z : dFloat); cdecl; external NEWTON_API;
procedure NewtonMeshAddUV0(mesh : NewtonMesh; u : dFloat; v : dFloat); cdecl; external NEWTON_API;
procedure NewtonMeshAddUV1(mesh : NewtonMesh; u : dFloat; v : dFloat); cdecl; external NEWTON_API;
procedure NewtonMeshEndFace(mesh : NewtonMesh); cdecl; external NEWTON_API;
procedure NewtonMeshEndBuild(mesh : NewtonMesh); cdecl; external NEWTON_API;
procedure NewtonMeshClearVertexFormat(format : NewtonMeshVertexFormat); cdecl; external NEWTON_API;
procedure NewtonMeshBuildFromVertexListIndexList(mesh : NewtonMesh; format : NewtonMeshVertexFormat); cdecl; external NEWTON_API;
function NewtonMeshGetPointCount(mesh : NewtonMesh) : Integer; cdecl; external NEWTON_API;
function NewtonMeshGetIndexToVertexMap(mesh : NewtonMesh) : PInteger; cdecl; external NEWTON_API;
function NewtonMeshGetVertexWeights(mesh : NewtonMesh; vertexIndex : Integer; weightIndex : PInteger; weightFactor : PdFloat) : Integer; cdecl; external NEWTON_API;
procedure NewtonMeshGetVertexDoubleChannel(mesh : NewtonMesh; vertexStrideInByte : Integer; outBuffer : PdFloat64); cdecl; external NEWTON_API;
procedure NewtonMeshGetVertexChannel(mesh : NewtonMesh; vertexStrideInByte : Integer; outBuffer : PdFloat); cdecl; external NEWTON_API;
procedure NewtonMeshGetNormalChannel(mesh : NewtonMesh; vertexStrideInByte : Integer; outBuffer : PdFloat); cdecl; external NEWTON_API;
procedure NewtonMeshGetBinormalChannel(mesh : NewtonMesh; vertexStrideInByte : Integer; outBuffer : PdFloat); cdecl; external NEWTON_API;
procedure NewtonMeshGetUV0Channel(mesh : NewtonMesh; vertexStrideInByte : Integer; outBuffer : PdFloat); cdecl; external NEWTON_API;
procedure NewtonMeshGetUV1Channel(mesh : NewtonMesh; vertexStrideInByte : Integer; outBuffer : PdFloat); cdecl; external NEWTON_API;
procedure NewtonMeshGetVertexColorChannel(mesh : NewtonMesh; vertexStrideInByte : Integer; outBuffer : PdFloat); cdecl; external NEWTON_API;
function NewtonMeshHasNormalChannel(mesh : NewtonMesh) : Integer; cdecl; external NEWTON_API;
function NewtonMeshHasBinormalChannel(mesh : NewtonMesh) : Integer; cdecl; external NEWTON_API;
function NewtonMeshHasUV0Channel(mesh : NewtonMesh) : Integer; cdecl; external NEWTON_API;
function NewtonMeshHasUV1Channel(mesh : NewtonMesh) : Integer; cdecl; external NEWTON_API;
function NewtonMeshHasVertexColorChannel(mesh : NewtonMesh) : Integer; cdecl; external NEWTON_API;
function NewtonMeshBeginHandle(mesh : NewtonMesh) : Pointer; cdecl; external NEWTON_API;
procedure NewtonMeshEndHandle(mesh : NewtonMesh; handle : Pointer); cdecl; external NEWTON_API;
function NewtonMeshFirstMaterial(mesh : NewtonMesh; handle : Pointer) : Integer; cdecl; external NEWTON_API;
function NewtonMeshNextMaterial(mesh : NewtonMesh; handle : Pointer; materialId : Integer) : Integer; cdecl; external NEWTON_API;
function NewtonMeshMaterialGetMaterial(mesh : NewtonMesh; handle : Pointer; materialId : Integer) : Integer; cdecl; external NEWTON_API;
function NewtonMeshMaterialGetIndexCount(mesh : NewtonMesh; handle : Pointer; materialId : Integer) : Integer; cdecl; external NEWTON_API;
procedure NewtonMeshMaterialGetIndexStream(mesh : NewtonMesh; handle : Pointer; materialId : Integer; index : PInteger); cdecl; external NEWTON_API;
procedure NewtonMeshMaterialGetIndexStreamShort(mesh : NewtonMesh; handle : Pointer; materialId : Integer; index : PSmallint); cdecl; external NEWTON_API;
function NewtonMeshCreateFirstSingleSegment(mesh : NewtonMesh) : NewtonMesh; cdecl; external NEWTON_API;
function NewtonMeshCreateNextSingleSegment(mesh : NewtonMesh; segment : NewtonMesh) : NewtonMesh; cdecl; external NEWTON_API;
function NewtonMeshCreateFirstLayer(mesh : NewtonMesh) : NewtonMesh; cdecl; external NEWTON_API;
function NewtonMeshCreateNextLayer(mesh : NewtonMesh; segment : NewtonMesh) : NewtonMesh; cdecl; external NEWTON_API;
function NewtonMeshGetTotalFaceCount(mesh : NewtonMesh) : Integer; cdecl; external NEWTON_API;
function NewtonMeshGetTotalIndexCount(mesh : NewtonMesh) : Integer; cdecl; external NEWTON_API;
procedure NewtonMeshGetFaces(mesh : NewtonMesh; faceIndexCount : PInteger; faceMaterial : PInteger; faceIndices : Pointer); cdecl; external NEWTON_API;
function NewtonMeshGetVertexCount(mesh : NewtonMesh) : Integer; cdecl; external NEWTON_API;
function NewtonMeshGetVertexStrideInByte(mesh : NewtonMesh) : Integer; cdecl; external NEWTON_API;
function NewtonMeshGetVertexArray(mesh : NewtonMesh) : PdFloat64; cdecl; external NEWTON_API;
function NewtonMeshGetFirstVertex(mesh : NewtonMesh) : Pointer; cdecl; external NEWTON_API;
function NewtonMeshGetNextVertex(mesh : NewtonMesh; vertex : Pointer) : Pointer; cdecl; external NEWTON_API;
function NewtonMeshGetVertexIndex(mesh : NewtonMesh; vertex : Pointer) : Integer; cdecl; external NEWTON_API;
function NewtonMeshGetFirstPoint(mesh : NewtonMesh) : Pointer; cdecl; external NEWTON_API;
function NewtonMeshGetNextPoint(mesh : NewtonMesh; point : Pointer) : Pointer; cdecl; external NEWTON_API;
function NewtonMeshGetPointIndex(mesh : NewtonMesh; point : Pointer) : Integer; cdecl; external NEWTON_API;
function NewtonMeshGetVertexIndexFromPoint(mesh : NewtonMesh; point : Pointer) : Integer; cdecl; external NEWTON_API;
function NewtonMeshGetFirstEdge(mesh : NewtonMesh) : Pointer; cdecl; external NEWTON_API;
function NewtonMeshGetNextEdge(mesh : NewtonMesh; edge : Pointer) : Pointer; cdecl; external NEWTON_API;
procedure NewtonMeshGetEdgeIndices(mesh : NewtonMesh; edge : Pointer; v0 : PInteger; v1 : PInteger); cdecl; external NEWTON_API;
function NewtonMeshGetFirstFace(mesh : NewtonMesh) : Pointer; cdecl; external NEWTON_API;
function NewtonMeshGetNextFace(mesh : NewtonMesh; face : Pointer) : Pointer; cdecl; external NEWTON_API;
function NewtonMeshIsFaceOpen(mesh : NewtonMesh; face : Pointer) : Integer; cdecl; external NEWTON_API;
function NewtonMeshGetFaceMaterial(mesh : NewtonMesh; face : Pointer) : Integer; cdecl; external NEWTON_API;
function NewtonMeshGetFaceIndexCount(mesh : NewtonMesh; face : Pointer) : Integer; cdecl; external NEWTON_API;
procedure NewtonMeshGetFaceIndices(mesh : NewtonMesh; face : Pointer; indices : PInteger); cdecl; external NEWTON_API;
procedure NewtonMeshGetFacePointIndices(mesh : NewtonMesh; face : Pointer; indices : PInteger); cdecl; external NEWTON_API;
procedure NewtonMeshCalculateFaceNormal(mesh : NewtonMesh; face : Pointer; normal : PdFloat64); cdecl; external NEWTON_API;
procedure NewtonMeshSetFaceMaterial(mesh : NewtonMesh; face : Pointer; matId : Integer); cdecl; external NEWTON_API;


implementation

end.
