Import.NGD.pas 108 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237
  1. //
  2. // This unit is part of the GLScene Engine, http://glscene.org
  3. //
  4. unit Import.NGD;
  5. (* Copyright (c) <2003-2014> <Julio Jerez, Newton Game Dynamics>
  6. *
  7. * This software is provided 'as-is', without any express or implied
  8. * warranty. In no event will the authors be held liable for any damages
  9. * arising from the use of this software.
  10. *
  11. * Permission is granted to anyone to use this software for any purpose,
  12. * including commercial applications, and to alter it and redistribute it
  13. * freely, subject to the following restrictions:
  14. *
  15. * 1. The origin of this software must not be misrepresented; you must not
  16. * claim that you wrote the original software. If you use this software
  17. * in a product, an acknowledgment in the product documentation would be
  18. * appreciated but is not required.
  19. *
  20. * 2. Altered source versions must be plainly marked as such, and must not be
  21. * misrepresented as being the original software.
  22. *
  23. * 3. This notice may not be removed or altered from any source distribution.
  24. *)
  25. {.$DEFINE NEWTON_DOUBLE_PRECISION}
  26. interface
  27. uses
  28. Classes;
  29. const
  30. {.$DEFINE NEWTON_DOUBLE_PRECISION} // This is needed when you want to use double precision
  31. {$IFDEF WIN32}
  32. NewtonDLL = 'newton32.dll';
  33. {$ENDIF}
  34. {$IFDEF WIN64}
  35. NewtonDLL = 'newton64.dll';
  36. {$ENDIF}
  37. type
  38. {$IFDEF NEWTON_DOUBLE_PRECISION}
  39. dFloat = Double;
  40. {$ELSE}
  41. dFloat = Single;
  42. {$ENDIF}
  43. dFloat64 = Double;
  44. dLong = Int64;
  45. PdFloat = ^dFloat;
  46. PdFloat64 = ^dFloat64;
  47. PdLong = ^dLong;
  48. Long_double = Extended;
  49. const
  50. NEWTON_MAJOR_VERSION = 3;
  51. NEWTON_MINOR_VERSION = 15;
  52. NEWTON_BROADPHASE_DEFAULT = 0;
  53. NEWTON_PROFILER_WORLD_UPDATE = 0;
  54. NEWTON_DYNAMIC_BODY = 0;
  55. NEWTON_PROFILER_COLLISION_UPDATE = 1;
  56. NEWTON_PROFILER_COLLISION_UPDATE_BROAD_PHASE = 2;
  57. NEWTON_PROFILER_COLLISION_UPDATE_NARROW_PHASE = 3;
  58. NEWTON_PROFILER_DYNAMICS_UPDATE = 4;
  59. NEWTON_PROFILER_DYNAMICS_CONSTRAINT_GRAPH = 5;
  60. NEWTON_PROFILER_FORCE_CALLBACK_UPDATE = 6;
  61. NEWTON_PROFILER_DYNAMICS_SOLVE_CONSTRAINT_GRAPH = 7;
  62. SERIALIZE_ID_SPHERE = 0;
  63. SERIALIZE_ID_CAPSULE = 1;
  64. SERIALIZE_ID_CYLINDER = 2;
  65. SERIALIZE_ID_CHAMFERCYLINDER = 3;
  66. SERIALIZE_ID_BOX = 4;
  67. SERIALIZE_ID_CONE = 5;
  68. SERIALIZE_ID_CONVEXHULL = 6;
  69. SERIALIZE_ID_NULL = 7;
  70. SERIALIZE_ID_COMPOUND = 8;
  71. SERIALIZE_ID_TREE = 9;
  72. SERIALIZE_ID_HEIGHTFIELD = 10;
  73. SERIALIZE_ID_CLOTH_PATCH = 11;
  74. SERIALIZE_ID_DEFORMABLE_SOLID = 12;
  75. SERIALIZE_ID_USERMESH = 13;
  76. SERIALIZE_ID_SCENE = 14;
  77. SERIALIZE_ID_FRACTURED_COMPOUND = 15;
  78. // SERIALIZE_ID_COMPOUND_BREAKABLE = 14;
  79. type
  80. // This C++ types for Delphi syntax to speed up the translation process and avoid bugs
  81. __int8 = ShortInt;
  82. __int16 = SmallInt;
  83. __int32 = LongInt;
  84. __int64 = Int64;
  85. nchar = ShortInt;
  86. unsigned_char = Byte;
  87. short = SmallInt;
  88. unsigned_short = Word;
  89. long = LongInt;
  90. unsigned_long = LongWord;
  91. unsigned_int = Cardinal;
  92. size_t = Cardinal;
  93. charArray = array [0..255] of Char;
  94. P__int8 = ^__int8;
  95. P__int16 = ^__int16;
  96. P__int32 = ^__int32;
  97. P__int64 = ^__int64;
  98. P2Char = ^nchar;
  99. PUnsigned_char = ^unsigned_char;
  100. PShort = ^short;
  101. PUnsigned_short = ^unsigned_short;
  102. PLong = ^long;
  103. PUnsigned_long = ^unsigned_long;
  104. PUnsigned_int = ^unsigned_int;
  105. Psize_t = ^size_t;
  106. PLong_double = ^long_double;
  107. PCharArray = ^charArray;
  108. //Pascal to C++
  109. Bool = Boolean;
  110. //Pointer types
  111. Pvoid = Pointer; //void pointer
  112. PBool = ^Bool;
  113. //Moved Maths related C++ Definitions to Maths3D.pas
  114. (* Next done in order to make code complete and code parameters hint window
  115. to show the actual type for ex. PNewtonWorld instead of just "Pointer",
  116. thus making programming a lot easier *)
  117. (*
  118. #ifdef __cplusplus
  119. class NewtonMesh;
  120. class NewtonBody;
  121. class NewtonWorld;
  122. class NewtonJoint;
  123. class NewtonMaterial;
  124. class NewtonCollision;
  125. class NewtonDeformableMeshSegment;
  126. class NewtonFracturedCompoundMeshPart;
  127. #else
  128. *)
  129. PNewtonMesh = Pointer;
  130. PNewtonBody = Pointer;
  131. PNewtonWorld = Pointer;
  132. PNewtonJoint = Pointer;
  133. PNewtonMaterial = Pointer;
  134. PNewtonCollision = Pointer;
  135. PNewtonDeformableMeshSegment = Pointer;
  136. PNewtonFracturedCompoundMeshPart = Pointer;
  137. // PNewtonContact = Pointer;
  138. PNewtonSerializeHandle = Pointer;
  139. PNewtonMeshHandle = Pointer;
  140. PNewtonMeshVertex = Pointer;
  141. PNewtonMeshPoint = Pointer;
  142. PNewtonMeshEdge = Pointer;
  143. PNewtonMeshFace = Pointer;
  144. PNewtonSceneProxy = Pointer;
  145. PNewtonBreakableComponentMesh = Pointer;
  146. PNewtonListener = Pointer;
  147. //PNewtonRagDoll = Pointer;
  148. //PNewtonRagDollBone = Pointer;
  149. // NewtonCollisionInfoRecord
  150. TNewtonMaterialData = packed record // union
  151. m_ptr : Pointer;
  152. m_int : dLong;
  153. m_float : dFloat;
  154. end;
  155. TNewtonCollisionMaterial = packed record
  156. m_userId: dLong;
  157. m_userData: TNewtonMaterialData;
  158. m_userParam: array[0..5] of TNewtonMaterialData;
  159. end;
  160. TNewtonBoxParam = packed record
  161. m_x : dFloat;
  162. m_y : dFloat;
  163. m_z : dFloat;
  164. end;
  165. TNewtonSphereParam = packed record
  166. m_radio : dFloat;
  167. end;
  168. TNewtonCylinderParam = packed record
  169. m_radio, m_height : dFloat;
  170. end;
  171. TNewtonCapsuleParam = packed record
  172. m_radio, m_height : dFloat;
  173. end;
  174. TNewtonConeParam = packed record
  175. m_radio,
  176. m_height : dFloat;
  177. end;
  178. TNewtonTaperedCapsuleParam = packed record
  179. m_radio0,
  180. m_radio1,
  181. m_height : dFloat;
  182. end;
  183. TNewtonTaperedCylinderParam = packed record
  184. m_radio0,
  185. m_radio1,
  186. m_height : dFloat;
  187. end;
  188. TNewtonChamferCylinderParam = packed record
  189. m_radio : dFloat;
  190. m_height : dFloat;
  191. end;
  192. TNewtonConvexHullParam = packed record
  193. m_vertexCount : integer;
  194. m_vertexStrideInBytes : integer;
  195. m_faceCount : integer;
  196. m_vertex : PdFloat;
  197. end;
  198. TNewtonCompoundCollisionParam = packed record
  199. m_chidrenCount: integer;
  200. end;
  201. TNewtonCollisionTreeParam = packed record
  202. m_vertexCount: integer;
  203. m_indexCount: integer;
  204. end;
  205. TNewtonDeformableMeshParam = packed record
  206. m_vertexCount : integer;
  207. m_triangleCount : integer;
  208. m_vertexStrideInBytes : integer;
  209. m_indexList : PWord;
  210. m_vertexList : PdFloat;
  211. end;
  212. TNewtonHeightFieldCollisionParam = packed record
  213. m_width: integer;
  214. m_height: integer;
  215. m_gridsDiagonals: integer;
  216. m_elevationDataType: integer; // 0 = 32 bit floats, 1 = unsigned 16 bit integers
  217. m_verticalScale: dFloat;
  218. m_horizonalScale_x: dFloat;
  219. m_horizonalScale_z: dFloat;
  220. m_vertialElevation: Pointer;
  221. m_atributes: pchar;
  222. end;
  223. TNewtonSceneCollisionParam = packed record
  224. m_childrenProxyCount: integer;
  225. end;
  226. TNewtonCollisionNullParam = packed record
  227. // nothing.
  228. end;
  229. PNewtonCollisionInfoRecord = ^TNewtonCollisionInfoRecord;
  230. TNewtonCollisionInfoRecord = packed record
  231. m_offsetMatrix: array[0..3,0..3] of dFloat;
  232. m_collisionMaterial: TNewtonCollisionMaterial;
  233. m_collisionType: integer; // tag id to identify the collision primitive
  234. case Integer of
  235. SERIALIZE_ID_BOX: (sdbox: TNewtonBoxParam);
  236. SERIALIZE_ID_CONE: (shapedata: TNewtonConeParam);
  237. SERIALIZE_ID_SPHERE: (sdSphere: TNewtonSphereParam);
  238. SERIALIZE_ID_CAPSULE: (sdCapsule: TNewtonCapsuleParam);
  239. SERIALIZE_ID_CYLINDER: (sdCylinder: TNewtonCylinderParam);
  240. SERIALIZE_ID_CHAMFERCYLINDER: (sdChamfercylinder: TNewtonChamferCylinderParam);
  241. SERIALIZE_ID_CONVEXHULL: (sdConvexhull: TNewtonConvexHullParam);
  242. SERIALIZE_ID_NULL: (sdNull: TNewtonCollisionNullParam);
  243. SERIALIZE_ID_COMPOUND: (sdCompound: TNewtonCompoundCollisionParam);
  244. SERIALIZE_ID_TREE: (sdTree: TNewtonCollisionTreeParam);
  245. SERIALIZE_ID_HEIGHTFIELD: (sdHeightfield: TNewtonHeightFieldCollisionParam);
  246. SERIALIZE_ID_SCENE: (sdSceneCollision: TNewtonSceneCollisionParam);
  247. end;
  248. PNewtonJointRecord = ^NewtonJointRecord;
  249. NewtonJointRecord = packed record
  250. m_attachmenMatrix_0 : array[ 0..3,0..3 ] of dFloat;
  251. m_attachmenMatrix_1 : array[ 0..3,0..3 ] of dFloat;
  252. m_minLinearDof : array[ 0..2 ] of dFloat;
  253. m_maxLinearDof : array[ 0..2 ] of dFloat;
  254. m_minAngularDof : array[ 0..2 ] of dFloat;
  255. m_maxAngularDof : array[ 0..2 ] of dFloat;
  256. m_attachBody_0 : PNewtonBody;
  257. m_attachBody_1 : PNewtonBody;
  258. m_extraParameters : array[ 0..15 ] of dFloat;
  259. m_bodiesCollisionOn : integer;
  260. m_descriptionType : array[ 0..31 ] of dFloat;
  261. end;
  262. PNewtonUserMeshCollisionCollideDesc = ^NewtonUserMeshCollisionCollideDesc;
  263. NewtonUserMeshCollisionCollideDesc = record
  264. m_boxP0 : array[ 0..3 ] of dFloat; // lower bounding box of intersection query in local space
  265. m_boxP1 : array[ 0..3 ] of dFloat; // upper bounding box of intersection query in local space
  266. 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.
  267. m_threadNumber : integer; // current thread executing this query
  268. m_faceCount : integer; // the application should set here how many polygons intersect the query box
  269. m_vertexStrideInBytes : integer; // the application should set here the size of each vertex
  270. m_skinThickness : dFloat; // this is the minimum skin separation specified by the material between these two colliding shapes
  271. m_userData : Pointer; // user data passed to the collision geometry at creation time
  272. m_objBody : PNewtonBody; // pointer to the colliding body
  273. m_polySoupBody : PNewtonBody; // pointer to the rigid body owner of this collision tree
  274. m_objCollision : PNewtonCollision; // collision shape of the colliding body, (no necessarily the collision of m_objBody)
  275. m_polySoupCollision : PNewtonCollision; // collision shape of the collision tree, (no necessarily the collision of m_polySoupBody)
  276. m_vertex : ^dFloat; // the application should set here the pointer to the global vertex of the mesh.
  277. m_faceIndexCount : ^integer; // the application should set here the pointer to the vertex count of each face.
  278. m_faceVertexIndex : ^integer; // the application should set here the pointer index array for each vertex on a face.
  279. // the format of a face is I0, I1, I2, I3, ..., M, N, E0, E1, E2, ..., A
  280. // I0, I1, I2, .. are the indices to the vertex, relative to m_vertex pointer
  281. // M is the index to the material sub shape id
  282. // N in the index to the vertex normal relative to m_vertex pointer
  283. // 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
  284. // 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.
  285. end;
  286. PNewtonWorldConvexCastReturnInfo = ^NewtonWorldConvexCastReturnInfo;
  287. NewtonWorldConvexCastReturnInfo = record
  288. m_point : array[ 0..3 ] of dFloat; // collision point in global space
  289. m_normal : array[ 0..3 ] of dFloat; // surface normal at collision point in global space
  290. m_normalOnHitPoint : array[ 0..3 ] of dFloat; // surface normal at the surface of the hit body,
  291. // is the same as the normal calculated by a ray cast hitting the body at the hit poi
  292. m_contactID : integer; // collision ID at contact point
  293. m_hitBody : PNewtonBody; // body hit at contact point
  294. m_penetration : dFloat; // contact penetration at collision point
  295. end;
  296. PNewtonUserMeshCollisionRayHitDesc = ^NewtonUserMeshCollisionRayHitDesc;
  297. NewtonUserMeshCollisionRayHitDesc = record
  298. m_p0 : array[ 0..3 ] of dFloat; // ray origin in collision local space
  299. m_p1 : array[ 0..3 ] of dFloat; // ray destination in collision local space
  300. m_normalOut : array[ 0..3 ] of dFloat; // copy here the normal at the ray intersection
  301. m_userIdOut : integer; // copy here a user defined id for further feedback
  302. m_userData : Pointer; // user data passed to the collision geometry at creation time
  303. end;
  304. PNewtonHingeSliderUpdateDesc = ^NewtonHingeSliderUpdateDesc;
  305. NewtonHingeSliderUpdateDesc = packed record
  306. m_accel : dFloat;
  307. m_minFriction : dFloat;
  308. m_maxFriction : dFloat;
  309. m_timestep : dFloat;
  310. end;
  311. PNewtonUserContactPoint = ^NewtonUserContactPoint;
  312. NewtonUserContactPoint = packed record
  313. m_point : array [0..3] of dFloat;
  314. m_normal : array [0..3] of dFloat;
  315. m_shapeId0 : dLong;
  316. m_shapeId1 : dLong;
  317. m_penetration : dFloat;
  318. m_unused : array [0..2] of integer;
  319. end;
  320. // data structure for interfacing with NewtonMesh
  321. PNewtonMeshDoubleData = ^NewtonMeshDoubleData;
  322. NewtonMeshDoubleData = packed record
  323. m_data : PdFloat64;
  324. m_indexList : ^integer;
  325. m_strideInBytes : integer;
  326. end;
  327. PNewtonMeshFloatData = ^NewtonMeshFloatData;
  328. NewtonMeshFloatData = packed record
  329. m_data : PdFloat;
  330. m_indexList : ^integer;
  331. m_strideInBytes : integer;
  332. end;
  333. PNewtonMeshVertexFormat = ^NewtonMeshVertexFormat;
  334. NewtonMeshVertexFormat = packed record
  335. m_faceCount : integer;
  336. m_faceIndexCount : ^integer;
  337. m_faceMaterial : ^integer;
  338. m_vertex : NewtonMeshDoubleData;
  339. m_normal : NewtonMeshFloatData;
  340. m_binormal : NewtonMeshFloatData;
  341. m_uv0 : NewtonMeshFloatData;
  342. m_uv1 : NewtonMeshFloatData;
  343. m_vertexColor : NewtonMeshFloatData;
  344. end;
  345. PNewtonAllocMemory = ^NewtonAllocMemory;
  346. NewtonAllocMemory = function(sizeInBytes: integer): Pointer; cdecl;
  347. PNewtonFreeMemory = ^NewtonFreeMemory;
  348. NewtonFreeMemory = procedure(ptr: Pointer; sizeInBytes: integer); cdecl;
  349. PNewtonDestroyWorld = ^NewtonDestroyWorld;
  350. NewtonDestroyWorld = procedure(const NewtonWorld: PNewtonWorld); cdecl;
  351. PNewtonGetTicksCountCallback = ^NewtonGetTicksCountCallback;
  352. NewtonGetTicksCountCallback = function(): Cardinal; cdecl;
  353. PNewtonSerialize = ^NewtonSerialize;
  354. NewtonSerialize = procedure(serializeHandle: Pointer; const buffer: Pointer; size: size_t); cdecl;
  355. PNewtonDeserialize = ^NewtonDeserialize;
  356. NewtonDeserialize = procedure(serializeHandle: Pointer; buffer: Pointer; size: size_t); cdecl;
  357. PNewtonUserMeshCollisionDestroyCallback = ^NewtonUserMeshCollisionDestroyCallback;
  358. NewtonUserMeshCollisionDestroyCallback = procedure(descData: Pointer); cdecl;
  359. PNewtonUserMeshCollisionCollideCallback = ^NewtonUserMeshCollisionCollideCallback;
  360. NewtonUserMeshCollisionCollideCallback = procedure(NewtonUserMeshCollisionCollideDesc: PNewtonUserMeshCollisionCollideDesc); cdecl;
  361. PNewtonUserMeshCollisionRayHitCallback = ^NewtonUserMeshCollisionRayHitCallback;
  362. NewtonUserMeshCollisionRayHitCallback = function(NewtonUserMeshCollisionRayHitDesc: PNewtonUserMeshCollisionRayHitDesc): integer; cdecl;
  363. PNewtonUserMeshCollisionGetCollisionInfo = ^NewtonUserMeshCollisionGetCollisionInfo;
  364. NewtonUserMeshCollisionGetCollisionInfo = procedure(userData: Pointer; infoRecord: PNewtonCollisionInfoRecord); cdecl;
  365. PNewtonUserMeshCollisionGetFacesInAABB = ^NewtonUserMeshCollisionGetFacesInAABB;
  366. NewtonUserMeshCollisionGetFacesInAABB = function(userData: Pointer;
  367. const p0: PdFloat; const p1: PdFloat; const vertexArray: PdFloat;
  368. vertexCount: PInteger; vertexStrideInBytes: PInteger; const indexList: PInteger;
  369. maxIndexCount: integer; const userDataList: PInteger): integer; cdecl;
  370. PNewtonCollisionTreeRayCastCallback = ^NewtonCollisionTreeRayCastCallback;
  371. NewtonCollisionTreeRayCastCallback = function(const Body: PNewtonBody;
  372. const TreeCollision: PNewtonCollision; interception: dFloat;
  373. normal: PdFloat; faceId: integer; usedData: Pointer): dFloat; cdecl;
  374. PNewtonHeightFieldRayCastCallback = ^NewtonHeightFieldRayCastCallback;
  375. NewtonHeightFieldRayCastCallback = function(const Body: PNewtonBody;
  376. const HeightFieldCollision: PNewtonCollision; interception: dFloat;
  377. Row, Col: integer; normal: PdFloat; faceId: integer; usedData: Pointer)
  378. : dFloat; cdecl;
  379. PNewtonTreeCollisionCallback = ^NewtonTreeCollisionCallback;
  380. NewtonTreeCollisionCallback = procedure(const bodyWithTreeCollision
  381. : PNewtonBody; const Body: PNewtonBody; faceId: integer; const vertex: PdFloat;
  382. vertexStrideInBytes: integer); cdecl;
  383. PNewtonBodyDestructor = ^NewtonBodyDestructor;
  384. NewtonBodyDestructor = procedure(const Body: PNewtonBody); cdecl;
  385. PNewtonApplyForceAndTorque = ^NewtonApplyForceAndTorque;
  386. NewtonApplyForceAndTorque = procedure(const Body: PNewtonBody;
  387. timestep: dFloat; threadIndex: integer); cdecl;
  388. PNewtonSetTransform = ^NewtonSetTransform;
  389. NewtonSetTransform = procedure(const Body: PNewtonBody; const matrix: PdFloat; threadIndex: integer); cdecl;
  390. PNewtonIslandUpdate = ^NewtonIslandUpdate;
  391. NewtonIslandUpdate = function(const World: PNewtonWorld; islandHandle: Pointer; bodyCount: integer): integer; cdecl;
  392. PNewtonBodyLeaveWorld = ^NewtonBodyLeaveWorld;
  393. NewtonBodyLeaveWorld = procedure(const Body: PNewtonBody; threadIndex: integer); cdecl;
  394. PNewtonDestroyBodyByExeciveForce = ^NewtonDestroyBodyByExeciveForce;
  395. NewtonDestroyBodyByExeciveForce = procedure(const Body: PNewtonBody; const contact: PNewtonJoint); cdecl;
  396. PNewtonCollisionDestructor = ^NewtonCollisionDestructor;
  397. NewtonCollisionDestructor = procedure(const World: PNewtonWorld; const collision: PNewtonCollision); cdecl;
  398. PNewtonCollisionCompoundBreakableCallback = ^NewtonCollisionCompoundBreakableCallback;
  399. NewtonCollisionCompoundBreakableCallback = function(const Mesh: PNewtonMesh; userData: Pointer; planeMatrixOut: PdFloat): integer; cdecl;
  400. PNewtonGetBuoyancyPlane = ^NewtonGetBuoyancyPlane;
  401. NewtonGetBuoyancyPlane = function(const collisionID: integer; context: Pointer; const globalSpaceMatrix: PdFloat; globalSpacePlane: PdFloat): integer; cdecl;
  402. PNewtonWorldRayPrefilterCallback = ^NewtonWorldRayPrefilterCallback;
  403. NewtonWorldRayPrefilterCallback = function(const Body: PNewtonBody; const collision: PNewtonCollision; userData: Pointer): Cardinal; cdecl;
  404. PNewtonWorldRayFilterCallback = ^NewtonWorldRayFilterCallback;
  405. NewtonWorldRayFilterCallback = function(const Body: PNewtonBody; const hitNormal: PdFloat; collisionID: integer; userData: Pointer; intersetParam: dFloat): dFloat; cdecl;
  406. PNewtonOnAABBOverlap = ^NewtonOnAABBOverlap;
  407. NewtonOnAABBOverlap = function(const material: PNewtonMaterial; const body0: PNewtonBody; const body1: PNewtonBody; threadIndex: integer): integer; cdecl;
  408. PNewtonContactsProcess = ^NewtonContactsProcess;
  409. NewtonContactsProcess = procedure(const contact: PNewtonJoint; timestep: dFloat; threadIndex: integer); cdecl;
  410. PNewtonBodyIterator = ^NewtonBodyIterator;
  411. NewtonBodyIterator = procedure(const Body: PNewtonBody; userData: Pointer); cdecl;
  412. PNewtonJointIterator = ^NewtonJointIterator;
  413. NewtonJointIterator = procedure(const joint: PNewtonJoint; userData: Pointer); cdecl;
  414. PNewtonCollisionIterator = ^NewtonCollisionIterator;
  415. NewtonCollisionIterator = procedure(userData: Pointer; vertexCount: integer; const FaceArray: PdFloat; faceId: integer); cdecl;
  416. PNewtonBallCallBack = ^NewtonBallCallBack;
  417. NewtonBallCallBack = procedure(const ball: PNewtonJoint; timestep: dFloat); cdecl;
  418. PNewtonHingeCallBack = ^NewtonHingeCallBack;
  419. NewtonHingeCallBack = function(const hinge: PNewtonJoint; desc: PNewtonHingeSliderUpdateDesc): unsigned_int; cdecl;
  420. PNewtonSliderCallBack = ^NewtonSliderCallBack;
  421. NewtonSliderCallBack = function(const slider: PNewtonJoint; desc: PNewtonHingeSliderUpdateDesc): unsigned_int; cdecl;
  422. PNewtonUniversalCallBack = ^NewtonUniversalCallBack;
  423. NewtonUniversalCallBack = function(const universal: PNewtonJoint; desc: PNewtonHingeSliderUpdateDesc): unsigned_int; cdecl;
  424. PNewtonCorkscrewCallBack = ^NewtonCorkscrewCallBack;
  425. NewtonCorkscrewCallBack = function(const corkscrew: PNewtonJoint; desc: PNewtonHingeSliderUpdateDesc): unsigned_int; cdecl;
  426. PNewtonUserBilateralCallBack = ^NewtonUserBilateralCallBack;
  427. NewtonUserBilateralCallBack = procedure(const userJoint: PNewtonJoint; timestep: dFloat; threadIndex: integer); cdecl;
  428. PNewtonUserBilateralGetInfoCallBack = ^NewtonUserBilateralGetInfoCallBack;
  429. NewtonUserBilateralGetInfoCallBack = procedure(const userJoint: PNewtonJoint; info: PNewtonJointRecord); cdecl;
  430. PNewtonConstraintDestructor = ^NewtonConstraintDestructor;
  431. NewtonConstraintDestructor = procedure(const me: PNewtonJoint); cdecl;
  432. // *****************************************************************************************************************************
  433. //
  434. // world control functions
  435. //
  436. // *****************************************************************************************************************************
  437. function NewtonWorldGetVersion(const NewtonWorld: PNewtonWorld): Integer; cdecl; external NewtonDLL;
  438. function NewtonWorldFloatSize(const NewtonWorld: PNewtonWorld): Integer; cdecl; external NewtonDLL;
  439. function NewtonCreate(malloc: NewtonAllocMemory; mfree: NewtonFreeMemory): PNewtonWorld; cdecl; external NewtonDLL;
  440. procedure NewtonDestroy(const NewtonWorld: PNewtonWorld); cdecl; external NewtonDLL;
  441. procedure NewtonDestroyAllBodies(const NewtonWorld: PNewtonWorld); cdecl; external NewtonDLL;
  442. function NewtonGetMemoryUsed(): Integer; cdecl; external NewtonDLL;
  443. procedure NewtonSetMemorySystem(malloc: NewtonAllocMemory; mfree: NewtonFreeMemory); cdecl; external NewtonDLL;
  444. procedure NewtonUpdate(const NewtonWorld: PNewtonWorld; timestep: dFloat); cdecl; external NewtonDLL;
  445. procedure NewtonInvalidateCache(const NewtonWorld: PNewtonWorld); cdecl; external NewtonDLL;
  446. procedure NewtonCollisionUpdate(const NewtonWorld: PNewtonWorld); cdecl; external NewtonDLL;
  447. procedure NewtonSetSolverModel(const NewtonWorld: PNewtonWorld; Model: integer); cdecl; external NewtonDLL;
  448. procedure NewtonSetPlatformArchitecture(const NewtonWorld: PNewtonWorld; mode: integer); cdecl; external NewtonDLL;
  449. function NewtonGetPlatformArchitecture(const NewtonWorld: PNewtonWorld; description: PCharArray): integer; cdecl; external NewtonDLL;
  450. procedure NewtonSetMultiThreadSolverOnSingleIsland(const NewtonWorld: PNewtonWorld; mode: integer); cdecl; external NewtonDLL;
  451. function NewtonGetMultiThreadSolverOnSingleIsland(const NewtonWorld: PNewtonWorld): integer; cdecl; external NewtonDLL;
  452. procedure NewtonSetPerformanceClock(const NewtonWorld: PNewtonWorld; NewtonGetTicksCountCallback: PNewtonGetTicksCountCallback); cdecl; external NewtonDLL;
  453. function NewtonReadPerformanceTicks(const NewtonWorld: PNewtonWorld; performanceEntry: Cardinal): Cardinal; cdecl; external NewtonDLL;
  454. function NewtonReadThreadPerformanceTicks(const NewtonWorld: PNewtonWorld; threadIndex: Cardinal): Cardinal; cdecl; external NewtonDLL;
  455. procedure NewtonWorldCriticalSectionLock(const NewtonWorld: PNewtonWorld); cdecl; external NewtonDLL;
  456. procedure NewtonWorldCriticalSectionUnlock(const NewtonWorld: PNewtonWorld); cdecl; external NewtonDLL;
  457. procedure NewtonSetThreadsCount(const NewtonWorld: PNewtonWorld; threads: integer); cdecl; external NewtonDLL;
  458. function NewtonGetThreadsCount(const NewtonWorld: PNewtonWorld): integer; cdecl; external NewtonDLL;
  459. function NewtonGetMaxThreadsCount(const NewtonWorld: PNewtonWorld): integer; cdecl; external NewtonDLL;
  460. procedure NewtonSetFrictionModel(const NewtonWorld: PNewtonWorld; Model: integer); cdecl; external NewtonDLL;
  461. procedure NewtonSetMinimumFrameRate(const NewtonWorld: PNewtonWorld; frameRate: dFloat); cdecl; external NewtonDLL;
  462. procedure NewtonSetBodyLeaveWorldEvent(const NewtonWorld: PNewtonWorld; callback: PNewtonBodyLeaveWorld); cdecl; external NewtonDLL;
  463. procedure NewtonSetWorldSize(const NewtonWorld: PNewtonWorld; const minPoint: PdFloat; const maxPoint: PdFloat); cdecl; external NewtonDLL;
  464. procedure NewtonSetIslandUpdateEvent(const NewtonWorld: PNewtonWorld; NewtonIslandUpdate: PNewtonIslandUpdate); cdecl; external NewtonDLL;
  465. procedure NewtonSetCollisionDestructor(const NewtonWorld: PNewtonWorld; callback: PNewtonCollisionDestructor); cdecl; external NewtonDLL;
  466. procedure NewtonSetDestroyBodyByExeciveForce(const NewtonWorld: PNewtonWorld; callback: PNewtonDestroyBodyByExeciveForce); cdecl; external NewtonDLL;
  467. procedure NewtonWorldForEachJointDo(const NewtonWorld: PNewtonWorld; callback: PNewtonJointIterator; userData: Pointer); cdecl; external NewtonDLL;
  468. procedure NewtonWorldForEachBodyInAABBDo(const NewtonWorld: PNewtonWorld; const p0: PdFloat; const p1: PdFloat; callback: PNewtonBodyIterator; userData: Pointer); cdecl; external NewtonDLL;
  469. procedure NewtonWorldSetUserData(const NewtonWorld: PNewtonWorld; userData: Pointer); cdecl; external NewtonDLL;
  470. function NewtonWorldGetUserData(const NewtonWorld: PNewtonWorld): Pointer; cdecl; external NewtonDLL;
  471. procedure NewtonWorldSetDestructorCallBack(const NewtonWorld: PNewtonWorld; NewtonDestroyWorld: PNewtonDestroyWorld); cdecl; external NewtonDLL;
  472. function NewtonWorldGetDestructorCallBack(const NewtonWorld: PNewtonWorld): PNewtonDestroyWorld; cdecl; external NewtonDLL;
  473. procedure NewtonWorldRayCast(const newtonWorld: PNewtonWorld; const p0: PdFloat; const p1: PdFloat;
  474. filter: PNewtonWorldRayFilterCallback; userData: Pointer;
  475. prefilter: NewtonWorldRayPrefilterCallback); cdecl; external NewtonDLL;
  476. function NewtonWorldConvexCast(const newtonWorld: PNewtonWorld; const matrix: PdFloat; const target: PdFloat;
  477. const shape: PNewtonCollision; hitParam: PdFloat; userData: Pointer;
  478. prefilter: NewtonWorldRayPrefilterCallback; info: PNewtonWorldConvexCastReturnInfo;
  479. maxContactsCount: integer; threadIndex: integer): Integer; cdecl; external NewtonDLL;
  480. function NewtonWorldGetBodyCount(const NewtonWorld: PNewtonWorld): integer; cdecl; external NewtonDLL;
  481. function NewtonWorldGetConstraintCount(const NewtonWorld: PNewtonWorld): integer; cdecl; external NewtonDLL;
  482. // *****************************************************************************************************************************
  483. //
  484. // Simulation islands
  485. //
  486. // *****************************************************************************************************************************
  487. function NewtonIslandGetBody(const island: Pointer; bodyIndex: integer): PNewtonBody; cdecl; external NewtonDLL;
  488. procedure NewtonIslandGetBodyAABB(const island: Pointer; bodyIndex: integer; p0: PdFloat; p1: PdFloat); cdecl; external NewtonDLL;
  489. // *****************************************************************************************************************************
  490. //
  491. // Physics Material Section
  492. //
  493. // *****************************************************************************************************************************
  494. function NewtonMaterialCreateGroupID(const NewtonWorld: PNewtonWorld): integer; cdecl; external NewtonDLL;
  495. function NewtonMaterialGetDefaultGroupID(const NewtonWorld: PNewtonWorld): integer; cdecl; external NewtonDLL;
  496. procedure NewtonMaterialDestroyAllGroupID(const NewtonWorld: PNewtonWorld); cdecl; external NewtonDLL;
  497. // material definitions that can not be overwritten in function callback
  498. function NewtonMaterialGetUserData(const NewtonWorld: PNewtonWorld; id0: integer; id1: integer): Pointer; cdecl; external NewtonDLL;
  499. procedure NewtonMaterialSetSurfaceThickness(const NewtonWorld: PNewtonWorld; id0: integer; id1: integer; thickness: dFloat); cdecl; external NewtonDLL;
  500. // deprecated, not longer continue collision is set on the material
  501. procedure NewtonMaterialSetContinuousCollisionMode(const NewtonWorld: PNewtonWOrld; id0, id1, state: Integer); cdecl; external NewtonDLL;
  502. ///procedure NewtonMaterialSetCompoundCollisionCallback(const NewtonWorld: PNewtonWOrld; id0, id1: integer; compoundAabbOverlap: PNewtonOnCompoundSubCollisionAABBOverlap);
  503. procedure NewtonMaterialSetCollisionCallback(const NewtonWorld: PNewtonWorld; id0: integer; id1: integer; userData: Pointer; AABBOverlap: PNewtonOnAABBOverlap; process: PNewtonContactsProcess); cdecl; external NewtonDLL;
  504. procedure NewtonMaterialSetDefaultSoftness(const NewtonWorld: PNewtonWorld; id0: integer; id1: integer; value: dFloat); cdecl; external NewtonDLL;
  505. procedure NewtonMaterialSetDefaultElasticity(const NewtonWorld: PNewtonWorld; id0: integer; id1: integer; elasticCoef: dFloat); cdecl; external NewtonDLL;
  506. procedure NewtonMaterialSetDefaultCollidable(const NewtonWorld: PNewtonWorld; id0: integer; id1: integer; state: integer); cdecl; external NewtonDLL;
  507. procedure NewtonMaterialSetDefaultFriction(const NewtonWorld: PNewtonWorld; id0: integer; id1: integer; staticFriction: dFloat; kineticFriction: dFloat); cdecl; external NewtonDLL;
  508. function NewtonWorldGetFirstMaterial(const NewtonWorld: PNewtonWorld): PNewtonMaterial; cdecl; external NewtonDLL;
  509. function NewtonWorldGetNextMaterial(const NewtonWorld: PNewtonWorld; const material: PNewtonMaterial): PNewtonMaterial; cdecl; external NewtonDLL;
  510. function NewtonWorldGetFirstBody(const NewtonWorld: PNewtonWorld): PNewtonBody; cdecl; external NewtonDLL;
  511. function NewtonWorldGetNextBody(const NewtonWorld: PNewtonWorld; const curBody: PNewtonBody): PNewtonBody; cdecl; external NewtonDLL;
  512. // *****************************************************************************************************************************
  513. //
  514. // Physics Contact control functions
  515. //
  516. // *****************************************************************************************************************************
  517. function NewtonMaterialGetMaterialPairUserData(const material: PNewtonMaterial): Pointer; cdecl; external NewtonDLL;
  518. function NewtonMaterialGetContactFaceAttribute(const material: PNewtonMaterial): Unsigned_int; cdecl; external NewtonDLL;
  519. function NewtonMaterialGetBodyCollidingShape(const material: PNewtonMaterial; const Body: PNewtonBody): PNewtonCollision; external NewtonDLL;
  520. function NewtonMaterialGetBodyCollisionID(const material: PNewtonMaterial; body: PNewtonBody): Unsigned_int; cdecl; external NewtonDLL;
  521. function NewtonMaterialGetContactNormalSpeed(const material: PNewtonMaterial): dFloat; cdecl; external NewtonDLL;
  522. procedure NewtonMaterialGetContactForce(const material: PNewtonMaterial; const Body: PNewtonBody; Force: PdFloat); cdecl; external NewtonDLL;
  523. procedure NewtonMaterialGetContactPositionAndNormal(const material: PNewtonMaterial; const Body: PNewtonBody; const Posit, normal: PdFloat); cdecl; external NewtonDLL;
  524. procedure NewtonMaterialGetContactTangentDirections(const material: PNewtonMaterial; const Body: PNewtonBody; const Dir0, Dir1: PdFloat); cdecl; external NewtonDLL;
  525. function NewtonMaterialGetContactTangentSpeed(const material: PNewtonMaterial;index: Integer): dFloat; cdecl; external NewtonDLL;
  526. procedure NewtonMaterialSetContactSoftness(const material: PNewtonMaterial; softness: dFloat); cdecl; external NewtonDLL;
  527. procedure NewtonMaterialSetContactElasticity(const material: PNewtonMaterial; restitution: dFloat); cdecl; external NewtonDLL;
  528. procedure NewtonMaterialSetContactFrictionState(const material: PNewtonMaterial; state: Integer; index: Integer); cdecl; external NewtonDLL;
  529. procedure NewtonMaterialSetContactFrictionCoef(const material: PNewtonMaterial; staticFrictionCoef, kineticFrictionCoef: dFloat; index: Integer); cdecl; external NewtonDLL;
  530. procedure NewtonMaterialSetContactNormalAcceleration(const material: PNewtonMaterial; accel: dFloat); cdecl; external NewtonDLL;
  531. procedure NewtonMaterialSetContactNormalDirection(const material: PNewtonMaterial; directionVector: PdFloat); cdecl; external NewtonDLL;
  532. procedure NewtonMaterialSetContactTangentAcceleration(const material: PNewtonMaterial; accel: dFloat; index: Integer); cdecl; external NewtonDLL;
  533. procedure NewtonMaterialContactRotateTangentDirections(const material: PNewtonMaterial; const directionVector: PdFloat); cdecl; external NewtonDLL;
  534. // **********************************************************************************************
  535. //
  536. // convex collision primitives creation functions
  537. //
  538. // **********************************************************************************************
  539. function NewtonCreateNull(const NewtonWorld: PNewtonWorld): PNewtonCollision; cdecl; external NewtonDLL;
  540. function NewtonCreateSphere(const NewtonWorld: PNewtonWorld; radiusX, radiusY, radiusZ: dFloat; shapeID: Integer; const offsetMatrix: PdFloat): PNewtonCollision; cdecl; external NewtonDLL;
  541. function NewtonCreateBox(const NewtonWorld: PNewtonWorld; dx: dFloat; dy: dFloat; dz: dFloat; shapeID: Integer; const offsetMatrix: PdFloat): PNewtonCollision; cdecl; external NewtonDLL;
  542. function NewtonCreateCone(const NewtonWorld: PNewtonWorld; radius: dFloat; height: dFloat; shapeID: Integer; const offsetMatrix: PdFloat): PNewtonCollision; cdecl; external NewtonDLL;
  543. function NewtonCreateCapsule(const NewtonWorld: PNewtonWorld; radius: dFloat; height: dFloat; shapeID: Integer; const offsetMatrix: PdFloat): PNewtonCollision; cdecl; external NewtonDLL;
  544. function NewtonCreateCylinder(const NewtonWorld: PNewtonWorld; radius: dFloat; height: dFloat; shapeID: Integer; const offsetMatrix: PdFloat): PNewtonCollision; cdecl; external NewtonDLL;
  545. function NewtonCreateChamferCylinder(const NewtonWorld: PNewtonWorld; raduis: dFloat; height: dFloat; shapeID: Integer; const offsetMatrix: PdFloat): PNewtonCollision; cdecl; external NewtonDLL;
  546. function NewtonCreateConvexHull(const NewtonWorld: PNewtonWorld; count: Integer; const vertexCloud: PdFloat; strideInBytes: Integer; tolerance: dFloat; shapeID: Integer; const offsetMatrix: PdFloat): PNewtonCollision; cdecl; external NewtonDLL;
  547. function NewtonCreateConvexHullFromMesh(const NewtonWorld: PNewtonWorld; ìesh: PNewtonMesh; tolerance: dFloat; shapeID: Integer): PNewtonCollision; cdecl; external NewtonDLL;
  548. function NewtonCreateConvexHullModifier(const NewtonWorld: PNewtonWorld; const convexHullCollision: PNewtonCollision; shapeID: Integer): PNewtonCollision; cdecl; external NewtonDLL;
  549. procedure NewtonConvexHullModifierGetMatrix(const convexHullCollision: PNewtonCollision; matrix: PdFloat); cdecl; external NewtonDLL;
  550. procedure NewtonConvexHullModifierSetMatrix(const convexHullCollision: PNewtonCollision; const matrix: PdFloat); cdecl; external NewtonDLL;
  551. function NewtonCollisionIsTriggerVolume(const convexCollision: PNewtonCollision): Integer; cdecl; external NewtonDLL;
  552. procedure NewtonCollisionSetAsTriggerVolume(const convexCollision: PNewtonCollision; trigger: Integer); cdecl; external NewtonDLL;
  553. procedure NewtonCollisionSetMaxBreakImpactImpulse(const convexHullCollision: PNewtonCollision; maxImpactImpulse: dFloat); cdecl; external NewtonDLL;
  554. function NewtonCollisionGetMaxBreakImpactImpulse(const convexHullCollision: PNewtonCollision): dFloat; cdecl; external NewtonDLL;
  555. procedure NewtonCollisionSetUserID(const convexCollision: PNewtonCollision; id: Unsigned_int); cdecl; external NewtonDLL;
  556. function NewtonCollisionGetUserID(const convexCollision: PNewtonCollision): Unsigned_int; cdecl; external NewtonDLL;
  557. function NewtonConvexHullGetFaceIndices(const convexHullCollision: PNewtonCollision; face: Integer; faceIndices: PInteger): Integer; cdecl; external NewtonDLL;
  558. function NewtonConvexCollisionCalculateVolume(const convexCollision: PNewtonCollision): dFloat; cdecl; external NewtonDLL;
  559. procedure NewtonConvexCollisionCalculateInertialMatrix(const convexCollision: PNewtonCollision; inertia, origin: PdFloat); cdecl; external NewtonDLL;
  560. procedure NewtonCollisionMakeUnique(const NewtonWorld: PNewtonWorld; const collision: PNewtonCollision); cdecl; external NewtonDLL;
  561. procedure NewtonReleaseCollision(const NewtonWorld: PNewtonWorld; const collision: PNewtonCollision); cdecl; external NewtonDLL;
  562. function NewtonAddCollisionReference(const collision: PNewtonCollision): Integer; cdecl; external NewtonDLL;
  563. // **********************************************************************************************
  564. //
  565. // complex collision primitives creation functions
  566. // note: can only be used with static bodies (bodies with infinite mass)
  567. //
  568. // **********************************************************************************************
  569. type
  570. TCollisionPrimitiveArray = array of PNewtonCollision;
  571. function NewtonCreateCompoundCollision( const newtonWorld : PNewtonWorld; count : integer;
  572. const collisionPrimitiveArray : TcollisionPrimitiveArray; shapeID : Integer) : PNewtonCollision; cdecl; external{$IFDEF __GPC__}name 'NewtonCreateCompoundCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  573. function NewtonCreateCompoundCollisionFromMesh( const newtonWorld : PNewtonWorld; const mesh : PNewtonMesh; maxSubShapesCount : integer;
  574. shapeID : Integer; subShapeID : integer ) : PNewtonCollision; cdecl; external{$IFDEF __GPC__}name 'NewtonCreateCompoundCollisionFromMesh'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  575. function NewtonCreateUserMeshCollision( const newtonWorld : PNewtonWorld; const minBox : PdFloat;
  576. const maxBox : PdFloat; userData : Pointer; collideCallback : NewtonUserMeshCollisionCollideCallback;
  577. rayHitCallback : NewtonUserMeshCollisionRayHitCallback;
  578. destroyCallback : NewtonUserMeshCollisionDestroyCallback;
  579. getInfoCallback : NewtonUserMeshCollisionGetCollisionInfo;
  580. facesInAABBCallback : NewtonUserMeshCollisionGetFacesInAABB; shapeID : Integer) : PNewtonCollision; cdecl; external{$IFDEF __GPC__}name 'NewtonCreateUserMeshCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  581. function NewtonCreateSceneCollision(const NewtonWorld: PNewtonWorld; shapeID: Integer): PNewtonCollision; cdecl; external NewtonDLL;
  582. function NewtonSceneCollisionCreateProxy(scene: PNewtonCollision; collision: PNewtonCollision): PNewtonSceneProxy; cdecl; external NewtonDLL;
  583. procedure NewtonSceneCollisionDestroyProxy(scene: PNewtonCollision; Proxy: PNewtonSceneProxy); cdecl; external NewtonDLL;
  584. procedure NewtonSceneProxySetMatrix(Proxy: PNewtonSceneProxy; const matrix: PdFloat); cdecl; external NewtonDLL;
  585. procedure NewtonSceneProxyGetMatrix(Proxy: PNewtonSceneProxy; matrix: PdFloat); cdecl; external NewtonDLL;
  586. procedure NewtonSceneSetProxyUserData(const Proxy: PNewtonSceneProxy; userData: Pointer); cdecl; external NewtonDLL;
  587. function NewtonSceneGetProxyUserData(const Proxy: PNewtonSceneProxy): Pointer; cdecl; external NewtonDLL;
  588. function NewtonSceneGetFirstProxy(const scene: PNewtonCollision): PNewtonSceneProxy; cdecl; external NewtonDLL;
  589. function NewtonSceneGetNextProxy(const scene: PNewtonCollision; const Proxy: PNewtonSceneProxy): PNewtonSceneProxy; cdecl; external NewtonDLL;
  590. procedure NewtonSceneCollisionOptimize( scene : PNewtonCollision ); cdecl; external NewtonDLL;
  591. // **********************************************************************************************
  592. //
  593. // Fractured compound collision primitives interface
  594. //
  595. // **********************************************************************************************
  596. 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__};
  597. procedure NewtonCompoundBreakableResetAnchoredPieces( const compoundBreakable : PNewtonCollision ); cdecl; external{$IFDEF __GPC__}name 'NewtonCompoundBreakableResetAnchoredPieces'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  598. procedure NewtonCompoundBreakableSetAnchoredPieces( const compoundBreakable : PNewtonCollision; fixshapesCount : Integer; matrixPallete : PdFloat; fixedShapesArray : PNewtonCollision ); cdecl; external{$IFDEF __GPC__}name 'NewtonCompoundBreakableSetAnchoredPieces'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  599. function NewtonCompoundBreakableGetVertexCount( const compoundBreakable : PNewtonCollision ) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonCompoundBreakableGetVertexCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  600. 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__};
  601. function NewtonBreakableGetMainMesh( const compoundBreakable : PNewtonCollision ) : PNewtonBreakableComponentMesh; cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableGetMainMesh'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  602. function NewtonBreakableGetFirstComponent( const compoundBreakable : PNewtonCollision ) : PNewtonBreakableComponentMesh; cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableGetFirstComponent'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  603. function NewtonBreakableGetNextComponent( const component : PNewtonBreakableComponentMesh ) : PNewtonBreakableComponentMesh; cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableGetNextComponent'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  604. procedure NewtonBreakableBeginDelete( const compoundBreakable : PNewtonCollision ); cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableBeginDelete'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  605. function NewtonBreakableCreateDebrieBody( const compoundBreakable : PNewtonCollision; const component : PNewtonBreakableComponentMesh ) : PNewtonBody; cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableCreateDebrieBody'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  606. procedure NewtonBreakableDeleteComponent( const compoundBreakable : PNewtonCollision; const component : PNewtonBreakableComponentMesh ); cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableDeleteComponent'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  607. procedure NewtonBreakableEndDelete( const compoundBreakable : PNewtonCollision ); cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableBeginDelete'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  608. 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__};
  609. function NewtonBreakableGetFirstSegment( const BreakableComponent : PNewtonBreakableComponentMesh ) : Pointer; cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableGetFirstSegment'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  610. function NewtonBreakableGetNextSegment( const Segment : Pointer ) : Pointer; cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableGetNextSegment'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  611. function NewtonBreakableSegmentGetMaterial( const Segment : Pointer ) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableSegmentGetMaterial'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  612. function NewtonBreakableSegmentGetIndexCount( const Segment : Pointer ) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableSegmentGetIndexCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  613. function NewtonBreakableSegmentGetIndexStream( CompoundBreakable : PNewtonCollision; const MeshOwner : PNewtonBreakableComponentMesh; const Segment : Pointer; Index : PInteger) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableSegmentGetIndexStream'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  614. function NewtonBreakableSegmentGetIndexStreamShort( CompoundBreakable : PNewtonCollision; const MeshOwner : PNewtonBreakableComponentMesh; const Segment : Pointer; Index : PShort ) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableSegmentGetIndexStreamShort'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  615. // ***********************************************************************************************************
  616. //
  617. // Collision serialization functions
  618. //
  619. // ***********************************************************************************************************
  620. function NewtonCreateCollisionFromSerialization( const newtonWorld : PNewtonWorld; deserializeFunction : PNewtonDeserialize; serializeHandle : Pointer ) : PNewtonCollision; cdecl; external{$IFDEF __GPC__}name 'NewtonCreateCollisionFromSerialization'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  621. // ***********************************************************************************************************
  622. //
  623. // Collision serialization functions
  624. //
  625. // ***********************************************************************************************************
  626. procedure NewtonCollisionSerialize( const newtonWorld : PNewtonWorld; const collision : PNewtonCollision; serializeFunction : PNewtonSerialize; serializeHandle : Pointer ); cdecl; external{$IFDEF __GPC__}name 'NewtonCollisionSerialize'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  627. procedure NewtonCollisionGetInfo( const collision : PNewtonCollision; collisionInfo : PNewtonCollisionInfoRecord); cdecl; external{$IFDEF __GPC__}name 'NewtonCollisionGetInfo'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  628. // **********************************************************************************************
  629. //
  630. // Static collision shapes functions
  631. //
  632. // **********************************************************************************************
  633. 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__};
  634. procedure NewtonHeightFieldSetUserRayCastCallback (const TreeCollision : PNewtonCollision; RayHitCallBack : PNewtonHeightFieldRayCastCallback); cdecl; external{$IFDEF __GPC__}name 'NewtonHeightFieldSetUserRayCastCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  635. function NewtonCreateTreeCollision( const newtonWorld : PNewtonWorld; shapeID : Integer) : PNewtonCollision; cdecl; external NewtonDLL;
  636. function NewtonCreateTreeCollisionFromMesh (const newtonWorld : PNewtonWorld; const mesh: PNewtonMesh; shapeID: integer) : PNewtonCollision; cdecl; external NewtonDLL;
  637. procedure NewtonTreeCollisionSetUserRayCastCallback( const treeCollision : PNewtonCollision; rayHitCallback : PNewtonCollisionTreeRayCastCallback ); cdecl; external NewtonDLL;
  638. procedure NewtonTreeCollisionBeginBuild( const treeCollision : PNewtonCollision ); cdecl; external NewtonDLL;
  639. procedure NewtonTreeCollisionAddFace( const treeCollision : PNewtonCollision; vertexCount : integer; const vertexPtr : PdFloat;
  640. strideInBytes : integer; faceAttribute : integer ); cdecl; external NewtonDLL;
  641. procedure NewtonTreeCollisionEndBuild( const treeCollision : PNewtonCollision; optimize : integer ); cdecl; external NewtonDLL;
  642. function NewtonTreeCollisionGetFaceAtribute( const treeCollision : PNewtonCollision; const faceIndexArray : Pinteger): integer; cdecl; external NewtonDLL;
  643. procedure NewtonTreeCollisionSetFaceAtribute( const treeCollision : PNewtonCollision; const faceIndexArray : Pinteger;
  644. attribute : integer ); cdecl; external{$IFDEF __GPC__}name 'NewtonTreeCollisionSetFaceAtribute'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  645. 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;
  646. procedure NewtonStaticCollisionSetDebugCallback( const staticCollision : PNewtonCollision; userCallback : PNewtonTreeCollisionCallback ); cdecl; external{$IFDEF __GPC__}name 'NewtonStaticCollisionSetDebugCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  647. // *****************************************************************************************************************************
  648. //
  649. // General purpose collision library functions
  650. //
  651. // *****************************************************************************************************************************
  652. function NewtonCollisionPointDistance (const newtonWorld : PNewtonWorld; const point : PdFloat;
  653. const collision : PNewtonCollision; const matrix : PdFloat; contact : PdFloat;
  654. normal : PdFloat; threadIndex : integer) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonCollisionPointDistance'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  655. // for the end user
  656. function NewtonCollisionClosestPoint (const newtonWorld : PNewtonWorld; const collsionA : PNewtonCollision;
  657. const matrixA : PdFloat; const collisionB : PNewtonCollision; const matrixB : PdFloat;
  658. contactA, contactB, normalAB : PdFloat; threadIndex : integer) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonCollisionClosestPoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  659. function NewtonCollisionCollide (const newtonWorld : PNewtonWorld; maxSize : Integer; const collsionA : PNewtonCollision;
  660. const matrixA : PdFloat; const collisionB : PNewtonCollision; const matrixB : PdFloat;
  661. contacts, normals, penetration : PdFloat; threadIndex : integer) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonCollisionCollide'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  662. function NewtonCollisionCollideContinue(const newtonWorld : PNewtonWorld; maxSize : Integer; const timestep : dFloat;
  663. const collsionA : PNewtonCollision; const matrixA : PdFloat; const velocA : PdFloat; const omegaA : dFloat;
  664. const collsionB : PNewtonCollision; const matrixB : PdFloat; const velocB : PdFloat; const omegaB : dFloat;
  665. timeOfImpact : PdFloat; contacts : PdFloat; normals : PdFloat;
  666. penetration : PdFloat; threadIndex : integer) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonCollisionCollideContinue'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  667. procedure NewtonCollisionSupportVertex( const collision : PNewtonCollision; const dir : PdFloat; vertex : PdFloat); cdecl; external{$IFDEF __GPC__}name 'NewtonCollisionSupportVertex'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  668. function NewtonCollisionRayCast(const collision : PNewtonCollision; const p0: PdFloat; const p1: PdFloat;
  669. normals: PdFloat; attribute: PInteger): dFloat; cdecl; external NewtonDLL;
  670. procedure NewtonCollisionCalculateAABB( const collision : PNewtonCollision; const matrix : PdFloat; p0 : PdFloat; p1 : PdFloat ); cdecl; external NewtonDLL;
  671. procedure NewtonCollisionForEachPolygonDo (const collision : PNewtonCollision; const matrix : PdFloat; callback : NewtonCollisionIterator;
  672. // **********************************************************************************************
  673. //
  674. // collision aggregates, are a collision node on eh broad phase the serve as the root nod for a collection of rigid bodies
  675. // 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
  676. // These are good for speeding calculation calculation of rag doll, Vehicles or contractions of rigid bodied lined by joints.
  677. // 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
  678. // then warping the bodies under an aggregate will reduce collision calculation of almost an order of magnitude.
  679. //
  680. // **********************************************************************************************
  681. UserData : Pointer); cdecl; external{$IFDEF __GPC__}name 'NewtonCollisionForEachPolygonDo'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  682. // *****************************************************************************************************************************
  683. //
  684. // transforms utility functions
  685. //
  686. // *****************************************************************************************************************************
  687. procedure NewtonSetEulerAngle( const eulersAngles : PdFloat; matrix : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonSetEulerAngle'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  688. procedure NewtonGetEulerAngle( const matrix : PdFloat; eulersAngles : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonGetEulerAngle'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  689. function NewtonCalculateSpringDamperAcceleration(dt, ks, x, kd, s : dFloat): dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonCalculateSpringDamperAcceleration'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  690. // *****************************************************************************************************************************
  691. //
  692. // body manipulation functions
  693. //
  694. // *****************************************************************************************************************************
  695. function NewtonCreateBody( const newtonWorld : PNewtonWorld; const collision : PNewtonCollision; const Matrix : PdFloat) : PNewtonBody; cdecl; external{$IFDEF __GPC__}name 'NewtonCreateBody'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  696. procedure NewtonDestroyBody( const newtonWorld : PNewtonWorld; const body : PNewtonBody ); cdecl; external{$IFDEF __GPC__}name 'NewtonDestroyBody'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  697. procedure NewtonBodyAddForce( const body : PNewtonBody; const force : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodyAddForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  698. procedure NewtonBodyAddTorque( const body : PNewtonBody; const torque : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodyAddTorque'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  699. procedure NewtonBodyCalculateInverseDynamicsForce(const body : PNewtonBody; timestep : dFloat; const desiredVeloc : PdFloat; forceOut : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodyCalculateInverseDynamicsForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  700. procedure NewtonBodySetMatrix( const body : PNewtonBody; const matrix : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetMatrix'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  701. procedure NewtonBodySetMatrixRecursive( const body : PNewtonBody; const matrix : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetMatrixRecursive'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  702. procedure NewtonBodySetMassMatrix( const body : PNewtonBody; mass : dFloat; Ixx : dFloat; Iyy : dFloat; Izz : dFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetMassMatrix'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  703. procedure NewtonBodySetMaterialGroupID( const body : PNewtonBody; id : integer ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetMaterialGroupID'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  704. procedure NewtonBodySetContinuousCollisionMode(const body : PNewtonbody; state : integer); cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetContinuousCollisionMode'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  705. procedure NewtonBodySetJointRecursiveCollision( const body : PNewtonBody; state : unsigned_int ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetJointRecursiveCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  706. procedure NewtonBodySetOmega( const body : PNewtonBody; const omega : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetOmega'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  707. procedure NewtonBodySetVelocity( const body : PNewtonBody; const velocity : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetVelocity'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  708. procedure NewtonBodySetForce( const body : PNewtonBody; const force : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  709. procedure NewtonBodySetTorque( const body : PNewtonBody; const torque : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetTorque'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  710. procedure NewtonBodySetCentreOfMass(const body : PNewtonBody; const com : PdFloat); cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetCentreOfMass'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  711. procedure NewtonBodySetLinearDamping( const body : PNewtonBody; linearDamp : dFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetLinearDamping'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  712. procedure NewtonBodySetAngularDamping( const body : PNewtonBody; const angularDamp : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetAngularDamping'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  713. procedure NewtonBodySetUserData( const body : PNewtonBody; userData : Pointer ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetUserData'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  714. procedure NewtonBodySetCollision( const body : PNewtonBody; const collision : PNewtonCollision ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  715. function NewtonBodyGetSleepState( const body : PNewtonBody) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetSleepState'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  716. function NewtonBodyGetAutoSleep( const body : PNewtonBody) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetAutoSleep'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  717. procedure NewtonBodySetAutoSleep( const body : PNewtonBody; state : integer ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetAutoSleep'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  718. function NewtonBodyGetFreezeState( const body : PNewtonBody) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetFreezeState'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  719. procedure NewtonBodySetFreezeState( const body : PNewtonBody; state : integer ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetFreezeState'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  720. procedure NewtonBodySetDestructorCallback( const body : PNewtonBody; callback : NewtonBodyDestructor ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetDestructorCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  721. procedure NewtonBodySetTransformCallback( const body : PNewtonBody; callback : NewtonSetTransform ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetTransformCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  722. function NewtonBodyGetTransformCallback( const body : PNewtonBody ): NewtonSetTransform; cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetForceAndTorqueCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  723. procedure NewtonBodySetForceAndTorqueCallback( const body : PNewtonBody; callback : NewtonApplyForceAndTorque ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetForceAndTorqueCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  724. function NewtonBodyGetForceAndTorqueCallback( const body : PNewtonBody ): NewtonApplyForceAndTorque; cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetForceAndTorqueCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  725. function NewtonBodyGetUserData( const body : PNewtonBody ) : Pointer; cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetUserData'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  726. function NewtonBodyGetWorld( const body : PNewtonBody) : PNewtonWorld; cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetWorld'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  727. function NewtonBodyGetCollision( const body : PNewtonBody ) : PNewtonCollision; cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  728. function NewtonBodyGetMaterialGroupID( const body : PNewtonBody ) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetMaterialGroupID'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  729. function NewtonBodyGetContinuousCollisionMode( const body : PNewtonBody ) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetContinuousCollisionMode'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  730. function NewtonBodyGetJointRecursiveCollision( const body : PNewtonBody ) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetJointRecursiveCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  731. procedure NewtonBodyGetMatrix( const body : PNewtonBody; matrix : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetMatrix'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  732. procedure NewtonBodyGetRotation( const body : PNewtonBody; rotation : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetRotation'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  733. procedure NewtonBodyGetMassMatrix( const body : PNewtonBody; mass : PdFloat; Ixx : PdFloat; Iyy : PdFloat; Izz : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetMassMatrix'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  734. procedure NewtonBodyGetInvMass( const body : PNewtonBody; invMass : PdFloat; invIxx : PdFloat; invIyy : PdFloat; invIzz : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetInvMass'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  735. procedure NewtonBodyGetOmega( const body : PNewtonBody; vector : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetOmega'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  736. procedure NewtonBodyGetVelocity( const body : PNewtonBody; vector : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetVelocity'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  737. procedure NewtonBodyGetForce( const body : PNewtonBody; vector : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  738. procedure NewtonBodyGetTorque( const body : PNewtonBody; vector : PdFloat); cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetTorque'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  739. procedure NewtonBodyGetForceAcc( const body : PNewtonBody; vector : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetForceAcc'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  740. procedure NewtonBodyGetTorqueAcc( const body : PNewtonBody; vector : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetTorqueAcc'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  741. procedure NewtonBodyGetCentreOfMass(const body : PNewtonBody; com : PdFloat); cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetCentreOfMass'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  742. function NewtonBodyGetLinearDamping( const body : PNewtonBody ) : dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetLinearDamping'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  743. procedure NewtonBodyGetAngularDamping( const body : PNewtonBody; vector : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetAngularDamping'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  744. procedure NewtonBodyGetAABB( const body : PNewtonBody; p0 : PdFloat; p1 : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetAABB'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  745. procedure NewtonBodyGetFreezeTreshold( const body : PNewtonBody; freezeSpeed2 : PdFloat; freezeOmega2 : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetFreezeTreshold'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  746. function NewtonBodyGetFirstJoint( const body : PNewtonBody ) : PNewtonJoint; cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetFirstJoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  747. function NewtonBodyGetNextJoint( const body : PNewtonBody; const joint : PNewtonJoint ) : PNewtonJoint; cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetNextJoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  748. function NewtonBodyGetFirstContactJoint( const body : PNewtonBody ) : PNewtonJoint; cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetFirstContactJoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  749. function NewtonBodyGetNextContactJoint( const body : PNewtonBody; const contactJoint : PNewtonJoint ) : PNewtonJoint; cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetNextContactJoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  750. // **********************************************************************************************
  751. //
  752. // contact joints interface
  753. //
  754. // **********************************************************************************************
  755. function NewtonContactJointGetFirstContact( const contactJoint : PNewtonJoint ) : Pointer; cdecl; external NewtonDLL;
  756. function NewtonContactJointGetNextContact( const contactJoint : PNewtonJoint; contact : Pointer ) : Pointer; cdecl; external NewtonDLL;
  757. function NewtonContactJointGetContactCount( const contactJoint : PNewtonJoint ) : integer; cdecl; external{$IFDEF __GPC__}name 'NewtonContactJointGetContactCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  758. procedure NewtonContactJointRemoveContact( const contactJoint : PNewtonJoint; contact : Pointer ); cdecl; external{$IFDEF __GPC__}name 'NewtonContactJointRemoveContact'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  759. function NewtonContactGetMaterial( const contact : Pointer ) : PNewtonMaterial; cdecl; external NewtonDLL;
  760. procedure NewtonBodyAddBuoyancyForce( const body : PNewtonBody; fluidDensity : dFloat; fluidLinearViscosity, fluidAngularViscosity : dFloat;
  761. const gravityVector : PdFloat; buoyancyPlane : NewtonGetBuoyancyPlane; context : Pointer ); cdecl; external{$IFDEF __GPC__}name 'NewtonBodyAddBuoyancyForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  762. procedure NewtonBodyAddImpulse(const body : PNewtonBody; const pointDeltaVeloc : PdFloat; const pointPosit : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonAddBodyImpulse'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  763. procedure NewtonBodyApplyImpulseArray (const Body : PNewtonBody; ImpuleCount : Integer; StrideInByte : Integer; const impulseArray : PdFloat;
  764. const pointArray : PdFloat); cdecl; external{$IFDEF __GPC__}name 'NewtonBodyApplyImpulseArray'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  765. // *****************************************************************************************************************************
  766. //
  767. // Common joint funtions
  768. //
  769. // *****************************************************************************************************************************
  770. function NewtonJointGetUserData( const joint : PNewtonJoint ) : Pointer; cdecl; external{$IFDEF __GPC__}name 'NewtonJointGetUserData'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  771. procedure NewtonJointSetUserData( const joint : PNewtonJoint; userData : Pointer ); cdecl; external{$IFDEF __GPC__}name 'NewtonJointSetUserData'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  772. function NewtonJointGetBody0( const joint : PNewtonJoint ) : PNewtonBody; cdecl; external{$IFDEF __GPC__}name 'NewtonJointGetBody0'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  773. function NewtonJointGetBody1( const joint : PNewtonJoint ) : PNewtonBody; cdecl; external{$IFDEF __GPC__}name 'NewtonJointGetBody1'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  774. procedure NewtonJointGetInfo( const joint : PNewtonJoint; info : PNewtonJointRecord ); cdecl; external{$IFDEF __GPC__}name 'NewtonJointGetInfo'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  775. function NewtonJointGetCollisionState( const joint : PNewtonJoint ) : integer; cdecl; external{$IFDEF __GPC__}name 'NewtonJointGetCollisionState'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  776. procedure NewtonJointSetCollisionState( const joint : PNewtonJoint; state : integer ); cdecl; external{$IFDEF __GPC__}name 'NewtonJointSetCollisionState'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  777. function NewtonJointGetStiffness( const joint : PNewtonJoint): dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonJointGetStiffness'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  778. procedure NewtonJointSetStiffness( const joint: PNewtonJoint; state: dFloat); cdecl; external{$IFDEF __GPC__}name 'NewtonJointSetStiffness'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  779. procedure NewtonDestroyJoint( const newtonWorld : PNewtonWorld; const joint : PNewtonJoint ); cdecl; external{$IFDEF __GPC__}name 'NewtonDestroyJoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  780. procedure NewtonJointSetDestructor( const joint : PNewtonJoint; _destructor : NewtonConstraintDestructor ); cdecl; external{$IFDEF __GPC__}name 'NewtonJointSetDestructor'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  781. // *****************************************************************************************************************************
  782. //
  783. // Ball and Socket joint functions
  784. //
  785. // *****************************************************************************************************************************
  786. function NewtonConstraintCreateBall( const newtonWorld : PNewtonWorld; const pivotPoint : PdFloat;
  787. const childBody : PNewtonBody; const parentBody : PNewtonBody ) : PNewtonJoint; cdecl; external{$IFDEF __GPC__}name 'NewtonConstraintCreateBall'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  788. procedure NewtonBallSetUserCallback( const ball : PNewtonJoint; callback : NewtonBallCallBack ); cdecl; external{$IFDEF __GPC__}name 'NewtonBallSetUserCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  789. procedure NewtonBallGetJointAngle( const ball : PNewtonJoint; angle : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBallGetJointAngle'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  790. procedure NewtonBallGetJointOmega( const ball : PNewtonJoint; omega : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBallGetJointOmega'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  791. procedure NewtonBallGetJointForce( const ball : PNewtonJoint; force : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBallGetJointForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  792. procedure NewtonBallSetConeLimits( const ball : PNewtonJoint; const pin : PdFloat; maxConeAngle : dFloat; maxTwistAngle : dFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonBallSetConeLimits'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  793. // *****************************************************************************************************************************
  794. //
  795. // Hinge joint functions
  796. //
  797. // *****************************************************************************************************************************
  798. function NewtonConstraintCreateHinge( const newtonWorld : PNewtonWorld;
  799. const pivotPoint : PdFloat; const pinDir : PdFloat;
  800. const childBody : PNewtonBody; const parentBody : PNewtonBody ) : PNewtonJoint; cdecl; external{$IFDEF __GPC__}name 'NewtonConstraintCreateHinge'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  801. procedure NewtonHingeSetUserCallback( const hinge : PNewtonJoint; callback : NewtonHingeCallBack ); cdecl; external{$IFDEF __GPC__}name 'NewtonHingeSetUserCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  802. function NewtonHingeGetJointAngle( const hinge : PNewtonJoint ) : dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonHingeGetJointAngle'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  803. function NewtonHingeGetJointOmega( const hinge : PNewtonJoint ) : dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonHingeGetJointOmega'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  804. procedure NewtonHingeGetJointForce( const hinge : PNewtonJoint; force : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonHingeGetJointForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  805. function NewtonHingeCalculateStopAlpha( const hinge : PNewtonJoint; const desc : PNewtonHingeSliderUpdateDesc; angle : dFloat): dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonHingeCalculateStopAlpha'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  806. // *****************************************************************************************************************************
  807. //
  808. // Slider joint functions
  809. //
  810. // *****************************************************************************************************************************
  811. function NewtonConstraintCreateSlider( const newtonWorld : PNewtonWorld;
  812. const pivotPoint : PdFloat; const pinDir : PdFloat;
  813. const childBody : PNewtonBody; const parentBody : PNewtonBody ) : PNewtonJoint; cdecl; external{$IFDEF __GPC__}name 'NewtonConstraintCreateSlider'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  814. procedure NewtonSliderSetUserCallback( const slider : PNewtonJoint; callback : NewtonSliderCallBack ); cdecl; external{$IFDEF __GPC__}name 'NewtonSliderSetUserCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  815. function NewtonSliderGetJointPosit( const slider : PNewtonJoint ) : dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonSliderGetJointPosit'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  816. function NewtonSliderGetJointVeloc( const slider : PNewtonJoint ) : dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonSliderGetJointVeloc'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  817. procedure NewtonSliderGetJointForce( const slider : PNewtonJoint; force : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonSliderGetJointForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  818. function NewtonSliderCalculateStopAccel( const slider : PNewtonJoint; const desc : PNewtonHingeSliderUpdateDesc; position : dFloat ) : dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonSliderCalculateStopAccel'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  819. // *****************************************************************************************************************************
  820. //
  821. // Corkscrew joint functions
  822. //
  823. // *****************************************************************************************************************************
  824. function NewtonConstraintCreateCorkscrew( const newtonWorld : PNewtonWorld;
  825. const pivotPoint : PdFloat; const pinDir : PdFloat;
  826. const childBody : PNewtonBody; const parentBody : PNewtonBody ) : PNewtonJoint; cdecl; external{$IFDEF __GPC__}name 'NewtonConstraintCreateCorkscrew'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  827. procedure NewtonCorkscrewSetUserCallback( const corkscrew : PNewtonJoint; callback : NewtonCorkscrewCallBack ); cdecl; external{$IFDEF __GPC__}name 'NewtonCorkscrewSetUserCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  828. function NewtonCorkscrewGetJointPosit( const corkscrew : PNewtonJoint ) : dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonCorkscrewGetJointPosit'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  829. function NewtonCorkscrewGetJointAngle( const corkscrew : PNewtonJoint ) : dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonCorkscrewGetJointAngle'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  830. function NewtonCorkscrewGetJointVeloc( const corkscrew : PNewtonJoint ) : dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonCorkscrewGetJointVeloc'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  831. function NewtonCorkscrewGetJointOmega( const corkscrew : PNewtonJoint ) : dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonCorkscrewGetJointOmega'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  832. procedure NewtonCorkscrewGetJointForce( const corkscrew : PNewtonJoint; force : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonCorkscrewGetJointForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  833. function NewtonCorkscrewCalculateStopAlpha(const corkscrew : PNewtonJoint;const desc : PNewtonHingeSliderUpdateDesc;angle : dFloat) : dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonCorkscrewCalculateStopAlpha'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  834. function NewtonCorkscrewCalculateStopAccel(const corkscrew : PNewtonJoint;const desc : PNewtonHingeSliderUpdateDesc;position : dFloat) : dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonCorkscrewCalculateStopAccel'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  835. // *****************************************************************************************************************************
  836. //
  837. // Universal joint functions
  838. //
  839. // *****************************************************************************************************************************
  840. function NewtonConstraintCreateUniversal( const newtonWorld: PNewtonWorld; const pivotPoint: PdFloat; const pinDir0: PdFloat;
  841. const pinDir1: PdFloat; const childBody: PNewtonBody; const parentBody: PNewtonBody): PNewtonJoint; cdecl; external{$IFDEF __GPC__}name 'NewtonConstraintCreateUniversal'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  842. procedure NewtonUniversalSetUserCallback(const universal: PNewtonJoint; callback: NewtonUniversalCallback); cdecl; external{$IFDEF __GPC__}name 'NewtonUniversalSetUserCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  843. function NewtonUniversalGetJointAngle0(const universal: PNewtonJoint):dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonUniversalGetJointAngle0'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  844. function NewtonUniversalGetJointAngle1(const universal: PNewtonJoint):dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonUniversalGetJointAngle1'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  845. function NewtonUniversalGetJointOmega0(const universal: PNewtonJoint):dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonUniversalGetJointOmega0'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  846. function NewtonUniversalGetJointOmega1(const universal: PNewtonJoint):dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonUniversalGetJointOmega1'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  847. procedure NewtonUniversalGetJointForce(const universal: PNewtonJoint; force: PdFloat); cdecl; external{$IFDEF __GPC__}name 'NewtonUniversalGetJointForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  848. function NewtonUniversalCalculateStopAlpha0(const universal : PNewtonJoint; const desc: PNewtonHingeSliderUpdateDesc; angle: dFloat): dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonUniversalCalculateStopAlpha0'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  849. function NewtonUniversalCalculateStopAlpha1(const universal : PNewtonJoint; const desc: PNewtonHingeSliderUpdateDesc; angle: dFloat): dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonUniversalCalculateStopAlpha1'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  850. // *****************************************************************************************************************************
  851. //
  852. // Up vector joint unctions
  853. //
  854. // *****************************************************************************************************************************
  855. function NewtonConstraintCreateUpVector( const newtonWorld : PNewtonWorld; const pinDir : PdFloat; const body : PNewtonBody ) : PNewtonJoint; cdecl; external{$IFDEF __GPC__}name 'NewtonConstraintCreateUpVector'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  856. procedure NewtonUpVectorGetPin( const upVector : PNewtonJoint; pin : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonUpVectorGetPin'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  857. procedure NewtonUpVectorSetPin( const upVector : PNewtonJoint; const pin : PdFloat ); cdecl; external{$IFDEF __GPC__}name 'NewtonUpVectorSetPin'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  858. // *****************************************************************************************************************************
  859. //
  860. // User defined bilateral Joint
  861. //
  862. // *****************************************************************************************************************************
  863. function NewtonConstraintCreateUserJoint(const NewtonWorld : PNewtonWorld; MaxDOF : Integer; Callback : PNewtonUserBilateralCallBack;
  864. GetInfo : PNewtonUserBilateralGetInfoCallBack; const ChildBody: PNewtonBody;
  865. const parentBody: PNewtonBody): PNewtonJoint; cdecl; external{$IFDEF __GPC__}name 'NewtonConstraintCreateUserJoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  866. procedure NewtonUserJointSetFeedbackCollectorCallback(const Joint : PNewtonJoint; GetFeedback : PNewtonUserBilateralCallBack); cdecl; external{$IFDEF __GPC__}name 'NewtonUserJointSetFeedbackCollectorCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  867. procedure NewtonUserJointAddLinearRow(const Joint : PNewtonJoint; const pivot0 : PdFloat; const pivot1 : PdFloat; const Dir : PdFloat); cdecl; external{$IFDEF __GPC__}name 'NewtonUserJointAddLinearRow'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  868. procedure NewtonUserJointAddAngularRow(const Joint : PNewtonJoint; RelativeAngle : dFloat; const Dir : PdFloat); cdecl; external{$IFDEF __GPC__}name 'NewtonUserJointAddAngularRow'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  869. procedure NewtonUserJointAddGeneralRow(const Joint : PNewtonJoint; const Jacobian0 : PdFloat; const Jacobian1 : PdFloat); cdecl; external{$IFDEF __GPC__}name 'NewtonUserJointAddGeneralRow'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  870. procedure NewtonUserJointSetRowMinimumFriction(const Joint : PNewtonJoint; Friction : dFloat); cdecl; external{$IFDEF __GPC__}name 'NewtonUserJointSetRowMinimumFriction'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  871. procedure NewtonUserJointSetRowMaximumFriction(const Joint : PNewtonJoint; Friction : dFloat); cdecl; external{$IFDEF __GPC__}name 'NewtonUserJointSetRowMaximumFriction'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  872. procedure NewtonUserJointSetRowAcceleration(const Joint : PNewtonJoint; Acceleration : dFloat); cdecl; external{$IFDEF __GPC__}name 'NewtonUserJointSetRowAcceleration'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  873. procedure NewtonUserJointSetRowSpringDamperAcceleration(const joint : PNewtonJoint; springK : dFloat; springD : dFloat); cdecl; external{$IFDEF __GPC__}name 'NewtonUserJointSetRowSpringDamperAcceleration'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  874. procedure NewtonUserJointSetRowStiffness(const Joint : PNewtonJoint; Stiffness : dFloat); cdecl; external{$IFDEF __GPC__}name 'NewtonUserJointSetRowStiffness'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  875. function NewtonUserJointGetRowForce (const Joint : PNewtonJoint; Row : Integer) : dFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonUserJointGetRowForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  876. // **********************************************************************************************
  877. //
  878. // Mesh joint functions
  879. //
  880. // **********************************************************************************************
  881. function NewtonMeshCreate (const World : PNewtonWorld) : PNewtonMesh; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshCreate'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  882. function NewtonMeshCreateFromMesh(const Mesh : PNewtonMesh) : PNewtonMesh; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshCreateFromMesh'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  883. function NewtonMeshCreateFromCollision (const collision : PNewtonCollision) : PNewtonMesh; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshCreateFromCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  884. function NewtonMeshConvexHull (const NewtonWorld : PNewtonWorld; count : integer; const vertexCloud : PdFloat; strideInBytes : integer;
  885. tolerance : dFloat) : PNewtonMesh; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshConvexHull'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  886. function NewtonMeshCreatePlane (const World : PNewtonWorld; const locationMatrix : PdFloat; width : dFloat; breadth : dFloat; material : Integer;
  887. const textureMatrix0 : PdFloat; const textureMatrix1) : PNewtonMesh; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshCreatePlane'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  888. procedure NewtonMeshDestroy(const mesh : PNewtonMesh); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshDestroy'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  889. procedure NewtonMeshCalculateOOBB(const mesh : PNewtonMesh; const matrix : PdFloat; x : PdFloat; y : PdFloat; z : PdFloat); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshCalculateOOBB'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  890. procedure NewtonMesApplyTransform (const Mesh : PNewtonMesh; const Matrix : PdFloat); cdecl; external{$IFDEF __GPC__}name 'NewtonMesApplyTransform'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  891. procedure NewtonMeshCalculateVertexNormals(const mesh : PNewtonMesh; angleInRadians : dFloat); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshCalculateVertexNormals'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  892. procedure NewtonMeshApplySphericalMapping(const mesh : PNewtonMesh; material : integer); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshApplySphericalMapping'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  893. procedure NewtonMeshApplyBoxMapping(const mesh : PNewtonMesh; front,side,top : integer); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshApplyBoxMapping'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  894. procedure NewtonMeshApplyCylindricalMapping(const mesh : PNewtonMesh; cylinderMaterial,capMaterial : integer); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshApplyCylindricalMapping'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  895. function NewtonMeshIsOpenMesh (const mesh : PNewtonMesh) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshIsOpenMesh'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  896. procedure NewtonMeshFixTJoints (const mesh : PNewtonMesh); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshFixTJoints'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  897. procedure NewtonMeshPolygonize (const mesh : PNewtonMesh); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshPolygonize'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  898. procedure NewtonMeshTriangulate (const mesh : PNewtonMesh); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshTriangulate'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  899. function NewtonMeshUnion (const mesh : PNewtonMesh; clipper : PNewtonMesh; clipperMatrix : PdFloat) : PNewtonMesh; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshUnion'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  900. function NewtonMeshDifference (const mesh : PNewtonMesh; clipper : PNewtonMesh; clipperMatrix : PdFloat) : PNewtonMesh; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshDifference'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  901. function NewtonMeshIntersection (const mesh : PNewtonMesh; clipper : PNewtonMesh; clipperMatrix : PdFloat) : PNewtonMesh; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshIntersection'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  902. procedure NewtonMeshClip (const mesh : PNewtonMesh; const clipper : PNewtonMesh; const clippermatrix : PdFloat; const topMesh : PNewtonMesh;
  903. const bottomMesh : PNewtonMesh); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshClip'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  904. procedure NewtonMeshPlaneClip (const Mesh : PNewtonMesh; const planeMatrix : PdFloat; const PlaneTextureMatrix : PdFloat; PlaneMaterial : Integer;
  905. const topMesh : PNewtonMesh; const bottomMesh : PNewtonMesh); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshPlaneClip'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  906. function NewtonMeshConvexDecomposition (const Mesh : PNewtonMesh; MaxCount : Integer) : PNewtonMesh; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshConvexDecomposition'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  907. function NewtonMeshVoronoiDecomposition (const Mesh : PNewtonMesh; PointCount, PointStrideInBytes : Integer; const PointCloud : PdFloat;
  908. InternalMaterial : Integer; const TextureMatrix : PdFloat) : PNewtonMesh; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshVoronoiDecomposition'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  909. procedure NewtonRemoveUnusedVertices(const mesh : PNewtonMesh; vertexRemapTable : PInteger); cdecl; external{$IFDEF __GPC__}name 'NewtonRemoveUnusedVertices'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  910. procedure NewtonMeshBeginFace(const mesh : PNewtonMesh); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshBeginFace'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  911. procedure NewtonMeshAddFace(const mesh : PNewtonMesh; vertexCount : integer; const vertex : PdFloat; strideInBytes,materialIndex : integer ); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshAddFace'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  912. procedure NewtonMeshEndFace(const mesh : PNewtonMesh); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshEndFace'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  913. procedure NewtonMeshBuildFromVertexListIndexList(const Mesh : PNewtonMesh;
  914. FaceCount : Integer; const faceIndexCount : PInteger; const faceMaterialIndex : PInteger;
  915. const vertex : PdFloat; vertexStrideInBytes : Integer; const vertexIndex : PInteger;
  916. const normal : PdFloat; normalStrideInBytes : Integer; const normalIndex : PInteger;
  917. const uv0 : PdFloat; uv0StrideInBytes : Integer; const uv0Index : PInteger;
  918. const uv1 : PdFloat; uv1StrideInBytes : Integer; const uv1Index : PInteger); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshBuildFromVertexListIndexList'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  919. procedure NewtonMeshGetVertexStreams(const Mesh: PNewtonMesh; vertexStrideInByte: Integer; Vertex: PdFloat; normalStrideInByte : integer;
  920. Normal: PdFloat; uvStrideInByte0 : Integer; uv0: PdFloat; uvStrideInByte1 : Integer; uv1 : PdFloat); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetVertexStreams'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  921. procedure NewtonMeshGetIndirectVertexStreams(const mesh : PNewtonMesh; vertexStrideInByte : integer; vertex : PdFloat; vertexIndices : PInteger;
  922. vertexCount : PInteger; normalStrideInByte : integer; normal: PdFloat; normalIndices : PInteger;
  923. normalCount : PInteger; uvStrideInByte0 : integer; uv0: PdFloat; uvIndices0 : PInteger; uvCount0 : PInteger;
  924. uvStrideInByte1 : integer; uv1: PdFloat; uvIndices1 : PInteger; uvCount1 : PInteger); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetIndirectVertexStreams'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  925. function NewtonMeshBeginHandle (const mesh : PNewtonMesh) : Pointer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshBeginHandle'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  926. procedure NewtonMeshEndHandle (const mesh : PNewtonMesh; Handle : Pointer); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshEndHandle'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  927. function NewtonMeshFirstMaterial (const mesh : PNewtonMesh; Handle : Pointer) : integer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshFirstMaterial'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  928. function NewtonMeshNextMaterial (const mesh : PNewtonMesh; Handle : Pointer; materialID : integer) : integer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshNextMaterial'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  929. function NewtonMeshMaterialGetMaterial (const mesh : PNewtonMesh; Handle : Pointer; materialID : integer) : integer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshMaterialGetMaterial'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  930. function NewtonMeshMaterialGetIndexCount (const mesh : PNewtonMesh; Handle : Pointer; materialID : integer) : integer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshMaterialGetIndexCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  931. procedure NewtonMeshMaterialGetIndexStream(const mesh : PNewtonMesh; Handle : Pointer; materialID : integer; index : PInteger); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshMaterialGetIndexStream'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  932. procedure NewtonMeshMaterialGetIndexStreamShort(const mesh : PNewtonMesh; Handle : Pointer; materialID : integer; index : PShort); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshMaterialGetIndexStreamShort'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  933. function NewtonMeshCreateFirstSingleSegment (const mesh : PNewtonMesh) : PNewtonMesh; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshCreateFirstSingleSegment'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  934. function NewtonMeshCreateNextSingleSegment (const mesh : PNewtonMesh; Segment : PNewtonMesh) : PNewtonMesh; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshCreateNextSingleSegment'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  935. function NewtonMeshCreateFirstLayer(const Mesh : PNewtonMesh) : PNewtonMesh; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshCreateFirstLayer'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  936. function NewtonMeshCreateNextLayer(const Mesh : PNewtonMesh; const Segment : PNewtonMesh) : PNewtonMesh; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshCreateNextLayer'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  937. function NewtonMeshGetTotalFaceCount (const mesh : PNewtonMesh) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetTotalFaceCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  938. function NewtonMeshGetTotalIndexCount (const mesh : PNewtonMesh) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetTotalIndexCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  939. procedure NewtonMeshGetFaces (const mesh : PNewtonMesh; const faceIndexCount : PInteger; faceMaterial : PInteger; faceIndices : PInteger); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetFaces'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  940. function NewtonMeshGetPointCount (const Mesh : PNewtonMesh) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetPointCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  941. function NewtonMeshGetPointStrideInByte (const Mesh : PNewtonMesh) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetPointStrideInByte'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  942. function NewtonMeshGetPointArray (const Mesh : PNewtonMesh): PdFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetPointArray'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  943. function NewtonMeshGetNormalArray (const Mesh : PNewtonMesh) : PdFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetNormalArray'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  944. function NewtonMeshGetUV0Array (const Mesh : PNewtonMesh) : PdFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetUV0Array'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  945. function NewtonMeshGetUV1Array (const Mesh : PNewtonMesh) : PdFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetUV1Array'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  946. function NewtonMeshGetVertexCount (const Mesh : PNewtonMesh) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetVertexCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  947. function NewtonMeshGetVertexStrideInByte (const Mesh : PNewtonMesh) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetVertexStrideInByte'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  948. function NewtonMeshGetVertexArray (const Mesh : PNewtonMesh) : PdFloat; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetVertexArray'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  949. function NewtonMeshGetFirstVertex (const Mesh : PNewtonMesh) : Pointer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetFirstVertex'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  950. function NewtonMeshGetNextVertex (const Mesh : PNewtonMesh; const Vertex : Pointer) : Pointer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetNextVertex'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  951. function NewtonMeshGetVertexIndex (const Mesh : PNewtonMesh; const Vertex : Pointer) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetVertexIndex'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  952. //NEWTON_API int NewtonMeshGetVertexPointIndex (const NewtonMesh *mesh, const void* vertex);
  953. function NewtonMeshGetFirstPoint (const Mesh : PNewtonMesh) : Pointer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetFirstPoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  954. function NewtonMeshGetNextPoint (const Mesh : PNewtonMesh; const point : Pointer) : Pointer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetNextPoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  955. function NewtonMeshGetPointIndex (const Mesh : PNewtonMesh; const point : Pointer) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetPointIndex'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  956. function NewtonMeshGetVertexIndexFromPoint (const Mesh : PNewtonMesh; const point : Pointer) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetVertexIndexFromPoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  957. function NewtonMeshGetFirstEdge (const Mesh : PNewtonMesh) : Pointer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetFirstEdge'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  958. function NewtonMeshGetNextEdge (const Mesh : PNewtonMesh; const Edge : Pointer) : Pointer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetNextEdge'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  959. procedure NewtonMeshGetEdgeIndices (const Mesh : PNewtonMesh; const Edge : Pointer; v0 : PInteger; v1 : PInteger); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetEdgeIndices'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  960. //NEWTON_API void NewtonMeshGetEdgePointIndices (const Mesh : PNewtonMesh, const void* edge, int* v0, int* v1);
  961. function NewtonMeshGetFirstFace (const Mesh : PNewtonMesh) : Pointer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetFirstFace'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  962. function NewtonMeshGetNextFace (const Mesh : PNewtonMesh; const Face : Pointer) : Pointer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetNextFace'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  963. function NewtonMeshIsFaceOpen (const Mesh : PNewtonMesh; const Face : Pointer) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshIsFaceOpen'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  964. function NewtonMeshGetFaceMaterial (const Mesh : PNewtonMesh; const Face : Pointer) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetFaceMaterial'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  965. function NewtonMeshGetFaceIndexCount (const Mesh : PNewtonMesh; const Face : Pointer) : Integer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetFaceIndexCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  966. procedure NewtonMeshGetFaceIndices (const Mesh : PNewtonMesh; const Face : Pointer; Indices : PInteger); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetFaceIndices'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  967. procedure NewtonMeshGetFacePointIndices (const Mesh : PNewtonMesh; const Face : Pointer; Indices : PInteger); cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetFacePointIndices'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  968. implementation
  969. end.