NGD.Import.pas 92 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671
  1. //
  2. // The graphics engine GLXEngine
  3. //
  4. unit NGD.Import;
  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. System.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, m_height: dFloat;
  176. end;
  177. TNewtonTaperedCapsuleParam = packed record
  178. m_radio0, m_radio1, m_height: dFloat;
  179. end;
  180. TNewtonTaperedCylinderParam = packed record
  181. m_radio0, m_radio1, m_height: dFloat;
  182. end;
  183. TNewtonChamferCylinderParam = packed record
  184. m_radio: dFloat;
  185. m_height: dFloat;
  186. end;
  187. TNewtonConvexHullParam = packed record
  188. m_vertexCount: integer;
  189. m_vertexStrideInBytes: integer;
  190. m_faceCount: integer;
  191. m_vertex: PdFloat;
  192. end;
  193. TNewtonCompoundCollisionParam = packed record
  194. m_chidrenCount: integer;
  195. end;
  196. TNewtonCollisionTreeParam = packed record
  197. m_vertexCount: integer;
  198. m_indexCount: integer;
  199. end;
  200. TNewtonDeformableMeshParam = packed record
  201. m_vertexCount: integer;
  202. m_triangleCount: integer;
  203. m_vertexStrideInBytes: integer;
  204. m_indexList: PWord;
  205. m_vertexList: PdFloat;
  206. end;
  207. TNewtonHeightFieldCollisionParam = packed record
  208. m_width: integer;
  209. m_height: integer;
  210. m_gridsDiagonals: integer;
  211. m_elevationDataType: integer; // 0 = 32 bit floats, 1 = unsigned 16 bit integers
  212. m_verticalScale: dFloat;
  213. m_horizonalScale_x: dFloat;
  214. m_horizonalScale_z: dFloat;
  215. m_vertialElevation: Pointer;
  216. m_atributes: pchar;
  217. end;
  218. TNewtonSceneCollisionParam = packed record
  219. m_childrenProxyCount: integer;
  220. end;
  221. TNewtonCollisionNullParam = packed record
  222. // nothing.
  223. end;
  224. PNewtonCollisionInfoRecord = ^TNewtonCollisionInfoRecord;
  225. TNewtonCollisionInfoRecord = packed record
  226. m_offsetMatrix: array [0 .. 3, 0 .. 3] of dFloat;
  227. m_collisionMaterial: TNewtonCollisionMaterial;
  228. m_collisionType: integer; // tag id to identify the collision primitive
  229. case integer of
  230. SERIALIZE_ID_BOX:
  231. (sdbox: TNewtonBoxParam);
  232. SERIALIZE_ID_CONE:
  233. (shapedata: TNewtonConeParam);
  234. SERIALIZE_ID_SPHERE:
  235. (sdSphere: TNewtonSphereParam);
  236. SERIALIZE_ID_CAPSULE:
  237. (sdCapsule: TNewtonCapsuleParam);
  238. SERIALIZE_ID_CYLINDER:
  239. (sdCylinder: TNewtonCylinderParam);
  240. SERIALIZE_ID_CHAMFERCYLINDER:
  241. (sdChamfercylinder: TNewtonChamferCylinderParam);
  242. SERIALIZE_ID_CONVEXHULL:
  243. (sdConvexhull: TNewtonConvexHullParam);
  244. SERIALIZE_ID_NULL:
  245. (sdNull: TNewtonCollisionNullParam);
  246. SERIALIZE_ID_COMPOUND:
  247. (sdCompound: TNewtonCompoundCollisionParam);
  248. SERIALIZE_ID_TREE:
  249. (sdTree: TNewtonCollisionTreeParam);
  250. SERIALIZE_ID_HEIGHTFIELD:
  251. (sdHeightfield: TNewtonHeightFieldCollisionParam);
  252. SERIALIZE_ID_SCENE:
  253. (sdSceneCollision: TNewtonSceneCollisionParam);
  254. end;
  255. PNewtonJointRecord = ^NewtonJointRecord;
  256. NewtonJointRecord = packed record
  257. m_attachmenMatrix_0: array [0 .. 3, 0 .. 3] of dFloat;
  258. m_attachmenMatrix_1: array [0 .. 3, 0 .. 3] of dFloat;
  259. m_minLinearDof: array [0 .. 2] of dFloat;
  260. m_maxLinearDof: array [0 .. 2] of dFloat;
  261. m_minAngularDof: array [0 .. 2] of dFloat;
  262. m_maxAngularDof: array [0 .. 2] of dFloat;
  263. m_attachBody_0: PNewtonBody;
  264. m_attachBody_1: PNewtonBody;
  265. m_extraParameters: array [0 .. 15] of dFloat;
  266. m_bodiesCollisionOn: integer;
  267. m_descriptionType: array [0 .. 31] of dFloat;
  268. end;
  269. PNewtonUserMeshCollisionCollideDesc = ^NewtonUserMeshCollisionCollideDesc;
  270. NewtonUserMeshCollisionCollideDesc = record
  271. m_boxP0: array [0 .. 3] of dFloat; // lower bounding box of intersection query in local space
  272. m_boxP1: array [0 .. 3] of dFloat; // upper bounding box of intersection query in local space
  273. m_boxDistanceTravel: array [0 .. 3] of dFloat;
  274. // max distance that box bpxP0 and boxP1 can travel on this timestep, used this for continue collision mode.
  275. m_threadNumber: integer; // current thread executing this query
  276. m_faceCount: integer;
  277. // the application should set here how many polygons intersect the query box
  278. m_vertexStrideInBytes: integer; // the application should set here the size of each vertex
  279. m_skinThickness: dFloat;
  280. // this is the minimum skin separation specified by the material between these two colliding shapes
  281. m_userData: Pointer; // user data passed to the collision geometry at creation time
  282. m_objBody: PNewtonBody; // pointer to the colliding body
  283. m_polySoupBody: PNewtonBody; // pointer to the rigid body owner of this collision tree
  284. m_objCollision: PNewtonCollision;
  285. // collision shape of the colliding body, (no necessarily the collision of m_objBody)
  286. m_polySoupCollision: PNewtonCollision;
  287. // collision shape of the collision tree, (no necessarily the collision of m_polySoupBody)
  288. m_vertex: ^dFloat;
  289. // the application should set here the pointer to the global vertex of the mesh.
  290. m_faceIndexCount: ^integer;
  291. // the application should set here the pointer to the vertex count of each face.
  292. m_faceVertexIndex: ^integer;
  293. // the application should set here the pointer index array for each vertex on a face.
  294. // the format of a face is I0, I1, I2, I3, ..., M, N, E0, E1, E2, ..., A
  295. // I0, I1, I2, .. are the indices to the vertex, relative to m_vertex pointer
  296. // M is the index to the material sub shape id
  297. // N in the index to the vertex normal relative to m_vertex pointer
  298. // 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
  299. // 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.
  300. end;
  301. PNewtonWorldConvexCastReturnInfo = ^NewtonWorldConvexCastReturnInfo;
  302. NewtonWorldConvexCastReturnInfo = record
  303. m_point: array [0 .. 3] of dFloat; // collision point in global space
  304. m_normal: array [0 .. 3] of dFloat; // surface normal at collision point in global space
  305. m_normalOnHitPoint: array [0 .. 3] of dFloat; // surface normal at the surface of the hit body,
  306. // is the same as the normal calculated by a ray cast hitting the body at the hit poi
  307. m_contactID: integer; // collision ID at contact point
  308. m_hitBody: PNewtonBody; // body hit at contact point
  309. m_penetration: dFloat; // contact penetration at collision point
  310. end;
  311. PNewtonUserMeshCollisionRayHitDesc = ^NewtonUserMeshCollisionRayHitDesc;
  312. NewtonUserMeshCollisionRayHitDesc = record
  313. m_p0: array [0 .. 3] of dFloat; // ray origin in collision local space
  314. m_p1: array [0 .. 3] of dFloat; // ray destination in collision local space
  315. m_normalOut: array [0 .. 3] of dFloat; // copy here the normal at the ray intersection
  316. m_userIdOut: integer; // copy here a user defined id for further feedback
  317. m_userData: Pointer; // user data passed to the collision geometry at creation time
  318. end;
  319. PNewtonHingeSliderUpdateDesc = ^NewtonHingeSliderUpdateDesc;
  320. NewtonHingeSliderUpdateDesc = packed record
  321. m_accel: dFloat;
  322. m_minFriction: dFloat;
  323. m_maxFriction: dFloat;
  324. m_timestep: dFloat;
  325. end;
  326. PNewtonUserContactPoint = ^NewtonUserContactPoint;
  327. NewtonUserContactPoint = packed record
  328. m_point: array [0 .. 3] of dFloat;
  329. m_normal: array [0 .. 3] of dFloat;
  330. m_shapeId0: dLong;
  331. m_shapeId1: dLong;
  332. m_penetration: dFloat;
  333. m_unused: array [0 .. 2] of integer;
  334. end;
  335. // data structure for interfacing with NewtonMesh
  336. PNewtonMeshDoubleData = ^NewtonMeshDoubleData;
  337. NewtonMeshDoubleData = packed record
  338. m_data: PdFloat64;
  339. m_indexList: ^integer;
  340. m_strideInBytes: integer;
  341. end;
  342. PNewtonMeshFloatData = ^NewtonMeshFloatData;
  343. NewtonMeshFloatData = packed record
  344. m_data: PdFloat;
  345. m_indexList: ^integer;
  346. m_strideInBytes: integer;
  347. end;
  348. PNewtonMeshVertexFormat = ^NewtonMeshVertexFormat;
  349. NewtonMeshVertexFormat = packed record
  350. m_faceCount: integer;
  351. m_faceIndexCount: ^integer;
  352. m_faceMaterial: ^integer;
  353. m_vertex: NewtonMeshDoubleData;
  354. m_normal: NewtonMeshFloatData;
  355. m_binormal: NewtonMeshFloatData;
  356. m_uv0: NewtonMeshFloatData;
  357. m_uv1: NewtonMeshFloatData;
  358. m_vertexColor: NewtonMeshFloatData;
  359. end;
  360. PNewtonAllocMemory = ^NewtonAllocMemory;
  361. NewtonAllocMemory = function(sizeInBytes: integer): Pointer; cdecl;
  362. PNewtonFreeMemory = ^NewtonFreeMemory;
  363. NewtonFreeMemory = procedure(ptr: Pointer; sizeInBytes: integer); cdecl;
  364. PNewtonDestroyWorld = ^NewtonDestroyWorld;
  365. NewtonDestroyWorld = procedure(const NewtonWorld: PNewtonWorld); cdecl;
  366. PNewtonGetTicksCountCallback = ^NewtonGetTicksCountCallback;
  367. NewtonGetTicksCountCallback = function(): Cardinal; cdecl;
  368. PNewtonSerialize = ^NewtonSerialize;
  369. NewtonSerialize = procedure(serializeHandle: Pointer; const buffer: Pointer; size: size_t); cdecl;
  370. PNewtonDeserialize = ^NewtonDeserialize;
  371. NewtonDeserialize = procedure(serializeHandle: Pointer; buffer: Pointer; size: size_t); cdecl;
  372. PNewtonUserMeshCollisionDestroyCallback = ^NewtonUserMeshCollisionDestroyCallback;
  373. NewtonUserMeshCollisionDestroyCallback = procedure(descData: Pointer); cdecl;
  374. PNewtonUserMeshCollisionCollideCallback = ^NewtonUserMeshCollisionCollideCallback;
  375. NewtonUserMeshCollisionCollideCallback = procedure(NewtonUserMeshCollisionCollideDesc
  376. : PNewtonUserMeshCollisionCollideDesc); cdecl;
  377. PNewtonUserMeshCollisionRayHitCallback = ^NewtonUserMeshCollisionRayHitCallback;
  378. NewtonUserMeshCollisionRayHitCallback = function(NewtonUserMeshCollisionRayHitDesc
  379. : PNewtonUserMeshCollisionRayHitDesc): integer; cdecl;
  380. PNewtonUserMeshCollisionGetCollisionInfo = ^NewtonUserMeshCollisionGetCollisionInfo;
  381. NewtonUserMeshCollisionGetCollisionInfo = procedure(userData: Pointer;
  382. infoRecord: PNewtonCollisionInfoRecord); cdecl;
  383. PNewtonUserMeshCollisionGetFacesInAABB = ^NewtonUserMeshCollisionGetFacesInAABB;
  384. NewtonUserMeshCollisionGetFacesInAABB = function(userData: Pointer; const p0: PdFloat;
  385. const p1: PdFloat; const vertexArray: PdFloat; vertexCount: PInteger;
  386. vertexStrideInBytes: PInteger; const indexList: PInteger; maxIndexCount: integer;
  387. const userDataList: PInteger): integer; cdecl;
  388. PNewtonCollisionTreeRayCastCallback = ^NewtonCollisionTreeRayCastCallback;
  389. NewtonCollisionTreeRayCastCallback = function(const Body: PNewtonBody;
  390. const TreeCollision: PNewtonCollision; interception: dFloat; normal: PdFloat; faceId: integer;
  391. usedData: Pointer): dFloat; cdecl;
  392. PNewtonHeightFieldRayCastCallback = ^NewtonHeightFieldRayCastCallback;
  393. NewtonHeightFieldRayCastCallback = function(const Body: PNewtonBody;
  394. const HeightFieldCollision: PNewtonCollision; interception: dFloat; Row, Col: integer;
  395. normal: PdFloat; faceId: integer; usedData: Pointer): dFloat; cdecl;
  396. PNewtonTreeCollisionCallback = ^NewtonTreeCollisionCallback;
  397. NewtonTreeCollisionCallback = procedure(const bodyWithTreeCollision: PNewtonBody;
  398. const Body: PNewtonBody; faceId: integer; const vertex: PdFloat;
  399. vertexStrideInBytes: integer); cdecl;
  400. PNewtonBodyDestructor = ^NewtonBodyDestructor;
  401. NewtonBodyDestructor = procedure(const Body: PNewtonBody); cdecl;
  402. PNewtonApplyForceAndTorque = ^NewtonApplyForceAndTorque;
  403. NewtonApplyForceAndTorque = procedure(const Body: PNewtonBody; timestep: dFloat;
  404. threadIndex: integer); cdecl;
  405. PNewtonSetTransform = ^NewtonSetTransform;
  406. NewtonSetTransform = procedure(const Body: PNewtonBody; const matrix: PdFloat;
  407. threadIndex: integer); cdecl;
  408. PNewtonIslandUpdate = ^NewtonIslandUpdate;
  409. NewtonIslandUpdate = function(const World: PNewtonWorld; islandHandle: Pointer;
  410. bodyCount: integer): integer; cdecl;
  411. PNewtonBodyLeaveWorld = ^NewtonBodyLeaveWorld;
  412. NewtonBodyLeaveWorld = procedure(const Body: PNewtonBody; threadIndex: integer); cdecl;
  413. PNewtonDestroyBodyByExeciveForce = ^NewtonDestroyBodyByExeciveForce;
  414. NewtonDestroyBodyByExeciveForce = procedure(const Body: PNewtonBody;
  415. const contact: PNewtonJoint); cdecl;
  416. PNewtonCollisionDestructor = ^NewtonCollisionDestructor;
  417. NewtonCollisionDestructor = procedure(const World: PNewtonWorld;
  418. const collision: PNewtonCollision); cdecl;
  419. PNewtonCollisionCompoundBreakableCallback = ^NewtonCollisionCompoundBreakableCallback;
  420. NewtonCollisionCompoundBreakableCallback = function(const Mesh: PNewtonMesh; userData: Pointer;
  421. planeMatrixOut: PdFloat): integer; cdecl;
  422. PNewtonGetBuoyancyPlane = ^NewtonGetBuoyancyPlane;
  423. NewtonGetBuoyancyPlane = function(const collisionID: integer; context: Pointer;
  424. const globalSpaceMatrix: PdFloat; globalSpacePlane: PdFloat): integer; cdecl;
  425. PNewtonWorldRayPrefilterCallback = ^NewtonWorldRayPrefilterCallback;
  426. NewtonWorldRayPrefilterCallback = function(const Body: PNewtonBody;
  427. const collision: PNewtonCollision; userData: Pointer): Cardinal; cdecl;
  428. PNewtonWorldRayFilterCallback = ^NewtonWorldRayFilterCallback;
  429. NewtonWorldRayFilterCallback = function(const Body: PNewtonBody; const hitNormal: PdFloat;
  430. collisionID: integer; userData: Pointer; intersetParam: dFloat): dFloat; cdecl;
  431. PNewtonOnAABBOverlap = ^NewtonOnAABBOverlap;
  432. NewtonOnAABBOverlap = function(const material: PNewtonMaterial; const body0: PNewtonBody;
  433. const body1: PNewtonBody; threadIndex: integer): integer; cdecl;
  434. PNewtonContactsProcess = ^NewtonContactsProcess;
  435. NewtonContactsProcess = procedure(const contact: PNewtonJoint; timestep: dFloat;
  436. threadIndex: integer); cdecl;
  437. PNewtonBodyIterator = ^NewtonBodyIterator;
  438. NewtonBodyIterator = procedure(const Body: PNewtonBody; userData: Pointer); cdecl;
  439. PNewtonJointIterator = ^NewtonJointIterator;
  440. NewtonJointIterator = procedure(const joint: PNewtonJoint; userData: Pointer); cdecl;
  441. PNewtonCollisionIterator = ^NewtonCollisionIterator;
  442. NewtonCollisionIterator = procedure(userData: Pointer; vertexCount: integer;
  443. const FaceArray: PdFloat; faceId: integer); cdecl;
  444. PNewtonBallCallBack = ^NewtonBallCallBack;
  445. NewtonBallCallBack = procedure(const ball: PNewtonJoint; timestep: dFloat); cdecl;
  446. PNewtonHingeCallBack = ^NewtonHingeCallBack;
  447. NewtonHingeCallBack = function(const hinge: PNewtonJoint; desc: PNewtonHingeSliderUpdateDesc)
  448. : unsigned_int; cdecl;
  449. PNewtonSliderCallBack = ^NewtonSliderCallBack;
  450. NewtonSliderCallBack = function(const slider: PNewtonJoint; desc: PNewtonHingeSliderUpdateDesc)
  451. : unsigned_int; cdecl;
  452. PNewtonUniversalCallBack = ^NewtonUniversalCallBack;
  453. NewtonUniversalCallBack = function(const universal: PNewtonJoint;
  454. desc: PNewtonHingeSliderUpdateDesc): unsigned_int; cdecl;
  455. PNewtonCorkscrewCallBack = ^NewtonCorkscrewCallBack;
  456. NewtonCorkscrewCallBack = function(const corkscrew: PNewtonJoint;
  457. desc: PNewtonHingeSliderUpdateDesc): unsigned_int; cdecl;
  458. PNewtonUserBilateralCallBack = ^NewtonUserBilateralCallBack;
  459. NewtonUserBilateralCallBack = procedure(const userJoint: PNewtonJoint; timestep: dFloat;
  460. threadIndex: integer); cdecl;
  461. PNewtonUserBilateralGetInfoCallBack = ^NewtonUserBilateralGetInfoCallBack;
  462. NewtonUserBilateralGetInfoCallBack = procedure(const userJoint: PNewtonJoint;
  463. info: PNewtonJointRecord); cdecl;
  464. PNewtonConstraintDestructor = ^NewtonConstraintDestructor;
  465. NewtonConstraintDestructor = procedure(const me: PNewtonJoint); cdecl;
  466. // *****************************************************************************************************************************
  467. //
  468. // world control functions
  469. //
  470. // *****************************************************************************************************************************
  471. function NewtonWorldGetVersion(const NewtonWorld: PNewtonWorld): integer; cdecl; external NewtonDLL;
  472. function NewtonWorldFloatSize(const NewtonWorld: PNewtonWorld): integer; cdecl; external NewtonDLL;
  473. function NewtonCreate(malloc: NewtonAllocMemory; mfree: NewtonFreeMemory): PNewtonWorld; cdecl;
  474. external NewtonDLL;
  475. procedure NewtonDestroy(const NewtonWorld: PNewtonWorld); cdecl; external NewtonDLL;
  476. procedure NewtonDestroyAllBodies(const NewtonWorld: PNewtonWorld); cdecl; external NewtonDLL;
  477. function NewtonGetMemoryUsed(): integer; cdecl; external NewtonDLL;
  478. procedure NewtonSetMemorySystem(malloc: NewtonAllocMemory; mfree: NewtonFreeMemory); cdecl;
  479. external NewtonDLL;
  480. procedure NewtonUpdate(const NewtonWorld: PNewtonWorld; timestep: dFloat); cdecl;
  481. external NewtonDLL;
  482. procedure NewtonInvalidateCache(const NewtonWorld: PNewtonWorld); cdecl; external NewtonDLL;
  483. procedure NewtonCollisionUpdate(const NewtonWorld: PNewtonWorld); cdecl; external NewtonDLL;
  484. procedure NewtonSetSolverModel(const NewtonWorld: PNewtonWorld; Model: integer); cdecl;
  485. external NewtonDLL;
  486. procedure NewtonSetPlatformArchitecture(const NewtonWorld: PNewtonWorld; mode: integer); cdecl;
  487. external NewtonDLL;
  488. function NewtonGetPlatformArchitecture(const NewtonWorld: PNewtonWorld; description: PCharArray)
  489. : integer; cdecl; external NewtonDLL;
  490. procedure NewtonSetMultiThreadSolverOnSingleIsland(const NewtonWorld: PNewtonWorld; mode: integer);
  491. cdecl; external NewtonDLL;
  492. function NewtonGetMultiThreadSolverOnSingleIsland(const NewtonWorld: PNewtonWorld): integer; cdecl;
  493. external NewtonDLL;
  494. procedure NewtonSetPerformanceClock(const NewtonWorld: PNewtonWorld;
  495. NewtonGetTicksCountCallback: PNewtonGetTicksCountCallback); cdecl; external NewtonDLL;
  496. function NewtonReadPerformanceTicks(const NewtonWorld: PNewtonWorld; performanceEntry: Cardinal)
  497. : Cardinal; cdecl; external NewtonDLL;
  498. function NewtonReadThreadPerformanceTicks(const NewtonWorld: PNewtonWorld; threadIndex: Cardinal)
  499. : Cardinal; cdecl; external NewtonDLL;
  500. procedure NewtonWorldCriticalSectionLock(const NewtonWorld: PNewtonWorld); cdecl;
  501. external NewtonDLL;
  502. procedure NewtonWorldCriticalSectionUnlock(const NewtonWorld: PNewtonWorld); cdecl;
  503. external NewtonDLL;
  504. procedure NewtonSetThreadsCount(const NewtonWorld: PNewtonWorld; threads: integer); cdecl;
  505. external NewtonDLL;
  506. function NewtonGetThreadsCount(const NewtonWorld: PNewtonWorld): integer; cdecl; external NewtonDLL;
  507. function NewtonGetMaxThreadsCount(const NewtonWorld: PNewtonWorld): integer; cdecl;
  508. external NewtonDLL;
  509. procedure NewtonSetFrictionModel(const NewtonWorld: PNewtonWorld; Model: integer); cdecl;
  510. external NewtonDLL;
  511. procedure NewtonSetMinimumFrameRate(const NewtonWorld: PNewtonWorld; frameRate: dFloat); cdecl;
  512. external NewtonDLL;
  513. procedure NewtonSetBodyLeaveWorldEvent(const NewtonWorld: PNewtonWorld;
  514. callback: PNewtonBodyLeaveWorld); cdecl; external NewtonDLL;
  515. procedure NewtonSetWorldSize(const NewtonWorld: PNewtonWorld; const minPoint: PdFloat;
  516. const maxPoint: PdFloat); cdecl; external NewtonDLL;
  517. procedure NewtonSetIslandUpdateEvent(const NewtonWorld: PNewtonWorld;
  518. NewtonIslandUpdate: PNewtonIslandUpdate); cdecl; external NewtonDLL;
  519. procedure NewtonSetCollisionDestructor(const NewtonWorld: PNewtonWorld;
  520. callback: PNewtonCollisionDestructor); cdecl; external NewtonDLL;
  521. procedure NewtonSetDestroyBodyByExeciveForce(const NewtonWorld: PNewtonWorld;
  522. callback: PNewtonDestroyBodyByExeciveForce); cdecl; external NewtonDLL;
  523. procedure NewtonWorldForEachJointDo(const NewtonWorld: PNewtonWorld; callback: PNewtonJointIterator;
  524. userData: Pointer); cdecl; external NewtonDLL;
  525. procedure NewtonWorldForEachBodyInAABBDo(const NewtonWorld: PNewtonWorld; const p0: PdFloat;
  526. const p1: PdFloat; callback: PNewtonBodyIterator; userData: Pointer); cdecl; external NewtonDLL;
  527. procedure NewtonWorldSetUserData(const NewtonWorld: PNewtonWorld; userData: Pointer); cdecl;
  528. external NewtonDLL;
  529. function NewtonWorldGetUserData(const NewtonWorld: PNewtonWorld): Pointer; cdecl;
  530. external NewtonDLL;
  531. procedure NewtonWorldSetDestructorCallBack(const NewtonWorld: PNewtonWorld;
  532. NewtonDestroyWorld: PNewtonDestroyWorld); cdecl; external NewtonDLL;
  533. function NewtonWorldGetDestructorCallBack(const NewtonWorld: PNewtonWorld): PNewtonDestroyWorld;
  534. cdecl; external NewtonDLL;
  535. procedure NewtonWorldRayCast(const NewtonWorld: PNewtonWorld; const p0: PdFloat; const p1: PdFloat;
  536. filter: PNewtonWorldRayFilterCallback; userData: Pointer;
  537. prefilter: NewtonWorldRayPrefilterCallback); cdecl; external NewtonDLL;
  538. function NewtonWorldConvexCast(const NewtonWorld: PNewtonWorld; const matrix: PdFloat;
  539. const target: PdFloat; const shape: PNewtonCollision; hitParam: PdFloat; userData: Pointer;
  540. prefilter: NewtonWorldRayPrefilterCallback; info: PNewtonWorldConvexCastReturnInfo;
  541. maxContactsCount: integer; threadIndex: integer): integer; cdecl; external NewtonDLL;
  542. function NewtonWorldGetBodyCount(const NewtonWorld: PNewtonWorld): integer; cdecl;
  543. external NewtonDLL;
  544. function NewtonWorldGetConstraintCount(const NewtonWorld: PNewtonWorld): integer; cdecl;
  545. external NewtonDLL;
  546. // *****************************************************************************************************************************
  547. //
  548. // Simulation islands
  549. //
  550. // *****************************************************************************************************************************
  551. function NewtonIslandGetBody(const island: Pointer; bodyIndex: integer): PNewtonBody; cdecl;
  552. external NewtonDLL;
  553. procedure NewtonIslandGetBodyAABB(const island: Pointer; bodyIndex: integer; p0: PdFloat;
  554. p1: PdFloat); cdecl; external NewtonDLL;
  555. // *****************************************************************************************************************************
  556. //
  557. // Physics Material Section
  558. //
  559. // *****************************************************************************************************************************
  560. function NewtonMaterialCreateGroupID(const NewtonWorld: PNewtonWorld): integer; cdecl;
  561. external NewtonDLL;
  562. function NewtonMaterialGetDefaultGroupID(const NewtonWorld: PNewtonWorld): integer; cdecl;
  563. external NewtonDLL;
  564. procedure NewtonMaterialDestroyAllGroupID(const NewtonWorld: PNewtonWorld); cdecl;
  565. external NewtonDLL;
  566. // material definitions that can not be overwritten in function callback
  567. function NewtonMaterialGetUserData(const NewtonWorld: PNewtonWorld; id0: integer; id1: integer)
  568. : Pointer; cdecl; external NewtonDLL;
  569. procedure NewtonMaterialSetSurfaceThickness(const NewtonWorld: PNewtonWorld; id0: integer;
  570. id1: integer; thickness: dFloat); cdecl; external NewtonDLL;
  571. // deprecated, not longer continue collision is set on the material
  572. procedure NewtonMaterialSetContinuousCollisionMode(const NewtonWorld: PNewtonWorld;
  573. id0, id1, state: integer); cdecl; external NewtonDLL;
  574. /// procedure NewtonMaterialSetCompoundCollisionCallback(const NewtonWorld: PNewtonWOrld; id0, id1: integer; compoundAabbOverlap: PNewtonOnCompoundSubCollisionAABBOverlap);
  575. procedure NewtonMaterialSetCollisionCallback(const NewtonWorld: PNewtonWorld; id0: integer;
  576. id1: integer; userData: Pointer; AABBOverlap: PNewtonOnAABBOverlap;
  577. process: PNewtonContactsProcess); cdecl; external NewtonDLL;
  578. procedure NewtonMaterialSetDefaultSoftness(const NewtonWorld: PNewtonWorld; id0: integer;
  579. id1: integer; value: dFloat); cdecl; external NewtonDLL;
  580. procedure NewtonMaterialSetDefaultElasticity(const NewtonWorld: PNewtonWorld; id0: integer;
  581. id1: integer; elasticCoef: dFloat); cdecl; external NewtonDLL;
  582. procedure NewtonMaterialSetDefaultCollidable(const NewtonWorld: PNewtonWorld; id0: integer;
  583. id1: integer; state: integer); cdecl; external NewtonDLL;
  584. procedure NewtonMaterialSetDefaultFriction(const NewtonWorld: PNewtonWorld; id0: integer;
  585. id1: integer; staticFriction: dFloat; kineticFriction: dFloat); cdecl; external NewtonDLL;
  586. function NewtonWorldGetFirstMaterial(const NewtonWorld: PNewtonWorld): PNewtonMaterial; cdecl;
  587. external NewtonDLL;
  588. function NewtonWorldGetNextMaterial(const NewtonWorld: PNewtonWorld;
  589. const material: PNewtonMaterial): PNewtonMaterial; cdecl; external NewtonDLL;
  590. function NewtonWorldGetFirstBody(const NewtonWorld: PNewtonWorld): PNewtonBody; cdecl;
  591. external NewtonDLL;
  592. function NewtonWorldGetNextBody(const NewtonWorld: PNewtonWorld; const curBody: PNewtonBody)
  593. : PNewtonBody; cdecl; external NewtonDLL;
  594. // *****************************************************************************************************************************
  595. //
  596. // Physics Contact control functions
  597. //
  598. // *****************************************************************************************************************************
  599. function NewtonMaterialGetMaterialPairUserData(const material: PNewtonMaterial): Pointer; cdecl;
  600. external NewtonDLL;
  601. function NewtonMaterialGetContactFaceAttribute(const material: PNewtonMaterial): unsigned_int;
  602. cdecl; external NewtonDLL;
  603. function NewtonMaterialGetBodyCollidingShape(const material: PNewtonMaterial;
  604. const Body: PNewtonBody): PNewtonCollision; external NewtonDLL;
  605. function NewtonMaterialGetBodyCollisionID(const material: PNewtonMaterial; Body: PNewtonBody)
  606. : unsigned_int; cdecl; external NewtonDLL;
  607. function NewtonMaterialGetContactNormalSpeed(const material: PNewtonMaterial): dFloat; cdecl;
  608. external NewtonDLL;
  609. procedure NewtonMaterialGetContactForce(const material: PNewtonMaterial; const Body: PNewtonBody;
  610. Force: PdFloat); cdecl; external NewtonDLL;
  611. procedure NewtonMaterialGetContactPositionAndNormal(const material: PNewtonMaterial;
  612. const Body: PNewtonBody; const Posit, normal: PdFloat); cdecl; external NewtonDLL;
  613. procedure NewtonMaterialGetContactTangentDirections(const material: PNewtonMaterial;
  614. const Body: PNewtonBody; const Dir0, Dir1: PdFloat); cdecl; external NewtonDLL;
  615. function NewtonMaterialGetContactTangentSpeed(const material: PNewtonMaterial; index: integer)
  616. : dFloat; cdecl; external NewtonDLL;
  617. procedure NewtonMaterialSetContactSoftness(const material: PNewtonMaterial; softness: dFloat);
  618. cdecl; external NewtonDLL;
  619. procedure NewtonMaterialSetContactElasticity(const material: PNewtonMaterial; restitution: dFloat);
  620. cdecl; external NewtonDLL;
  621. procedure NewtonMaterialSetContactFrictionState(const material: PNewtonMaterial; state: integer;
  622. index: integer); cdecl; external NewtonDLL;
  623. procedure NewtonMaterialSetContactFrictionCoef(const material: PNewtonMaterial;
  624. staticFrictionCoef, kineticFrictionCoef: dFloat; index: integer); cdecl; external NewtonDLL;
  625. procedure NewtonMaterialSetContactNormalAcceleration(const material: PNewtonMaterial;
  626. accel: dFloat); cdecl; external NewtonDLL;
  627. procedure NewtonMaterialSetContactNormalDirection(const material: PNewtonMaterial;
  628. directionVector: PdFloat); cdecl; external NewtonDLL;
  629. procedure NewtonMaterialSetContactTangentAcceleration(const material: PNewtonMaterial;
  630. accel: dFloat; index: integer); cdecl; external NewtonDLL;
  631. procedure NewtonMaterialContactRotateTangentDirections(const material: PNewtonMaterial;
  632. const directionVector: PdFloat); cdecl; external NewtonDLL;
  633. // **********************************************************************************************
  634. //
  635. // convex collision primitives creation functions
  636. //
  637. // **********************************************************************************************
  638. function NewtonCreateNull(const NewtonWorld: PNewtonWorld): PNewtonCollision; cdecl;
  639. external NewtonDLL;
  640. function NewtonCreateSphere(const NewtonWorld: PNewtonWorld; radiusX, radiusY, radiusZ: dFloat;
  641. shapeID: integer; const offsetMatrix: PdFloat): PNewtonCollision; cdecl; external NewtonDLL;
  642. function NewtonCreateBox(const NewtonWorld: PNewtonWorld; dx: dFloat; dy: dFloat; dz: dFloat;
  643. shapeID: integer; const offsetMatrix: PdFloat): PNewtonCollision; cdecl; external NewtonDLL;
  644. function NewtonCreateCone(const NewtonWorld: PNewtonWorld; radius: dFloat; height: dFloat;
  645. shapeID: integer; const offsetMatrix: PdFloat): PNewtonCollision; cdecl; external NewtonDLL;
  646. function NewtonCreateCapsule(const NewtonWorld: PNewtonWorld; radius: dFloat; height: dFloat;
  647. shapeID: integer; const offsetMatrix: PdFloat): PNewtonCollision; cdecl; external NewtonDLL;
  648. function NewtonCreateCylinder(const NewtonWorld: PNewtonWorld; radius: dFloat; height: dFloat;
  649. shapeID: integer; const offsetMatrix: PdFloat): PNewtonCollision; cdecl; external NewtonDLL;
  650. function NewtonCreateChamferCylinder(const NewtonWorld: PNewtonWorld; raduis: dFloat;
  651. height: dFloat; shapeID: integer; const offsetMatrix: PdFloat): PNewtonCollision; cdecl;
  652. external NewtonDLL;
  653. function NewtonCreateConvexHull(const NewtonWorld: PNewtonWorld; count: integer;
  654. const vertexCloud: PdFloat; strideInBytes: integer; tolerance: dFloat; shapeID: integer;
  655. const offsetMatrix: PdFloat): PNewtonCollision; cdecl; external NewtonDLL;
  656. function NewtonCreateConvexHullFromMesh(const NewtonWorld: PNewtonWorld; ìesh: PNewtonMesh;
  657. tolerance: dFloat; shapeID: integer): PNewtonCollision; cdecl; external NewtonDLL;
  658. function NewtonCreateConvexHullModifier(const NewtonWorld: PNewtonWorld;
  659. const convexHullCollision: PNewtonCollision; shapeID: integer): PNewtonCollision; cdecl;
  660. external NewtonDLL;
  661. procedure NewtonConvexHullModifierGetMatrix(const convexHullCollision: PNewtonCollision;
  662. matrix: PdFloat); cdecl; external NewtonDLL;
  663. procedure NewtonConvexHullModifierSetMatrix(const convexHullCollision: PNewtonCollision;
  664. const matrix: PdFloat); cdecl; external NewtonDLL;
  665. function NewtonCollisionIsTriggerVolume(const convexCollision: PNewtonCollision): integer; cdecl;
  666. external NewtonDLL;
  667. procedure NewtonCollisionSetAsTriggerVolume(const convexCollision: PNewtonCollision;
  668. trigger: integer); cdecl; external NewtonDLL;
  669. procedure NewtonCollisionSetMaxBreakImpactImpulse(const convexHullCollision: PNewtonCollision;
  670. maxImpactImpulse: dFloat); cdecl; external NewtonDLL;
  671. function NewtonCollisionGetMaxBreakImpactImpulse(const convexHullCollision: PNewtonCollision)
  672. : dFloat; cdecl; external NewtonDLL;
  673. procedure NewtonCollisionSetUserID(const convexCollision: PNewtonCollision; id: unsigned_int);
  674. cdecl; external NewtonDLL;
  675. function NewtonCollisionGetUserID(const convexCollision: PNewtonCollision): unsigned_int; cdecl;
  676. external NewtonDLL;
  677. function NewtonConvexHullGetFaceIndices(const convexHullCollision: PNewtonCollision; face: integer;
  678. faceIndices: PInteger): integer; cdecl; external NewtonDLL;
  679. function NewtonConvexCollisionCalculateVolume(const convexCollision: PNewtonCollision): dFloat;
  680. cdecl; external NewtonDLL;
  681. procedure NewtonConvexCollisionCalculateInertialMatrix(const convexCollision: PNewtonCollision;
  682. inertia, origin: PdFloat); cdecl; external NewtonDLL;
  683. procedure NewtonCollisionMakeUnique(const NewtonWorld: PNewtonWorld;
  684. const collision: PNewtonCollision); cdecl; external NewtonDLL;
  685. procedure NewtonReleaseCollision(const NewtonWorld: PNewtonWorld;
  686. const collision: PNewtonCollision); cdecl; external NewtonDLL;
  687. function NewtonAddCollisionReference(const collision: PNewtonCollision): integer; cdecl;
  688. external NewtonDLL;
  689. // **********************************************************************************************
  690. //
  691. // complex collision primitives creation functions
  692. // note: can only be used with static bodies (bodies with infinite mass)
  693. //
  694. // **********************************************************************************************
  695. type
  696. TCollisionPrimitiveArray = array of PNewtonCollision;
  697. function NewtonCreateCompoundCollision(const NewtonWorld: PNewtonWorld; count: integer;
  698. const collisionPrimitiveArray: TCollisionPrimitiveArray; shapeID: integer): PNewtonCollision;
  699. cdecl; external{$IFDEF __GPC__}name 'NewtonCreateCompoundCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  700. function NewtonCreateCompoundCollisionFromMesh(const NewtonWorld: PNewtonWorld;
  701. const Mesh: PNewtonMesh; maxSubShapesCount: integer; shapeID: integer; subShapeID: integer)
  702. : PNewtonCollision; cdecl;
  703. external{$IFDEF __GPC__}name 'NewtonCreateCompoundCollisionFromMesh'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  704. function NewtonCreateUserMeshCollision(const NewtonWorld: PNewtonWorld; const minBox: PdFloat;
  705. const maxBox: PdFloat; userData: Pointer; collideCallback: NewtonUserMeshCollisionCollideCallback;
  706. rayHitCallback: NewtonUserMeshCollisionRayHitCallback;
  707. destroyCallback: NewtonUserMeshCollisionDestroyCallback;
  708. getInfoCallback: NewtonUserMeshCollisionGetCollisionInfo;
  709. facesInAABBCallback: NewtonUserMeshCollisionGetFacesInAABB; shapeID: integer): PNewtonCollision;
  710. cdecl; external{$IFDEF __GPC__}name 'NewtonCreateUserMeshCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  711. function NewtonCreateSceneCollision(const NewtonWorld: PNewtonWorld; shapeID: integer)
  712. : PNewtonCollision; cdecl; external NewtonDLL;
  713. function NewtonSceneCollisionCreateProxy(scene: PNewtonCollision; collision: PNewtonCollision)
  714. : PNewtonSceneProxy; cdecl; external NewtonDLL;
  715. procedure NewtonSceneCollisionDestroyProxy(scene: PNewtonCollision; Proxy: PNewtonSceneProxy);
  716. cdecl; external NewtonDLL;
  717. procedure NewtonSceneProxySetMatrix(Proxy: PNewtonSceneProxy; const matrix: PdFloat); cdecl;
  718. external NewtonDLL;
  719. procedure NewtonSceneProxyGetMatrix(Proxy: PNewtonSceneProxy; matrix: PdFloat); cdecl;
  720. external NewtonDLL;
  721. procedure NewtonSceneSetProxyUserData(const Proxy: PNewtonSceneProxy; userData: Pointer); cdecl;
  722. external NewtonDLL;
  723. function NewtonSceneGetProxyUserData(const Proxy: PNewtonSceneProxy): Pointer; cdecl;
  724. external NewtonDLL;
  725. function NewtonSceneGetFirstProxy(const scene: PNewtonCollision): PNewtonSceneProxy; cdecl;
  726. external NewtonDLL;
  727. function NewtonSceneGetNextProxy(const scene: PNewtonCollision; const Proxy: PNewtonSceneProxy)
  728. : PNewtonSceneProxy; cdecl; external NewtonDLL;
  729. procedure NewtonSceneCollisionOptimize(scene: PNewtonCollision); cdecl; external NewtonDLL;
  730. // **********************************************************************************************
  731. //
  732. // Fractured compound collision primitives interface
  733. //
  734. // **********************************************************************************************
  735. function NewtonCreateCompoundBreakable(const NewtonWorld: PNewtonWorld; meshCount: integer;
  736. const SolidsArray: PNewtonMesh; const ShapeIDArray: PInteger; Densities: PdFloat;
  737. internalFaceMaterial: PInteger; shapeID: integer; debrisID: integer; DebrisSeparationGap: dFloat)
  738. : PNewtonCollision; cdecl;
  739. external{$IFDEF __GPC__}name 'NewtonCreateCompoundBreakable'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  740. procedure NewtonCompoundBreakableResetAnchoredPieces(const compoundBreakable: PNewtonCollision);
  741. cdecl; external{$IFDEF __GPC__}name 'NewtonCompoundBreakableResetAnchoredPieces'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  742. procedure NewtonCompoundBreakableSetAnchoredPieces(const compoundBreakable: PNewtonCollision;
  743. fixshapesCount: integer; matrixPallete: PdFloat; fixedShapesArray: PNewtonCollision); cdecl;
  744. external{$IFDEF __GPC__}name 'NewtonCompoundBreakableSetAnchoredPieces'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  745. function NewtonCompoundBreakableGetVertexCount(const compoundBreakable: PNewtonCollision): integer;
  746. cdecl; external{$IFDEF __GPC__}name 'NewtonCompoundBreakableGetVertexCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  747. procedure NewtonCompoundBreakableGetVertexStreams(const compoundBreakable: PNewtonCollision;
  748. vertexStrideInByte: integer; vertex: PdFloat; normalStrideInByte: integer; normal: PdFloat;
  749. uvStrideInByte: integer; uv: PdFloat); cdecl;
  750. external{$IFDEF __GPC__}name 'NewtonCompoundBreakableGetVertexStreams'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  751. function NewtonBreakableGetMainMesh(const compoundBreakable: PNewtonCollision)
  752. : PNewtonBreakableComponentMesh; cdecl;
  753. external{$IFDEF __GPC__}name 'NewtonBreakableGetMainMesh'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  754. function NewtonBreakableGetFirstComponent(const compoundBreakable: PNewtonCollision)
  755. : PNewtonBreakableComponentMesh; cdecl;
  756. external{$IFDEF __GPC__}name 'NewtonBreakableGetFirstComponent'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  757. function NewtonBreakableGetNextComponent(const component: PNewtonBreakableComponentMesh)
  758. : PNewtonBreakableComponentMesh; cdecl;
  759. external{$IFDEF __GPC__}name 'NewtonBreakableGetNextComponent'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  760. procedure NewtonBreakableBeginDelete(const compoundBreakable: PNewtonCollision); cdecl;
  761. external{$IFDEF __GPC__}name 'NewtonBreakableBeginDelete'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  762. function NewtonBreakableCreateDebrieBody(const compoundBreakable: PNewtonCollision;
  763. const component: PNewtonBreakableComponentMesh): PNewtonBody; cdecl;
  764. external{$IFDEF __GPC__}name 'NewtonBreakableCreateDebrieBody'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  765. procedure NewtonBreakableDeleteComponent(const compoundBreakable: PNewtonCollision;
  766. const component: PNewtonBreakableComponentMesh); cdecl;
  767. external{$IFDEF __GPC__}name 'NewtonBreakableDeleteComponent'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  768. procedure NewtonBreakableEndDelete(const compoundBreakable: PNewtonCollision); cdecl;
  769. external{$IFDEF __GPC__}name 'NewtonBreakableBeginDelete'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  770. function NewtonBreakableGetComponentsInRadius(const compoundBreakable: PNewtonCollision;
  771. const position: PdFloat; radius: dFloat; Segments: PNewtonBreakableComponentMesh;
  772. maxCount: integer): integer; cdecl;
  773. external{$IFDEF __GPC__}name 'NewtonBreakableGetComponentsInRadius'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  774. function NewtonBreakableGetFirstSegment(const BreakableComponent: PNewtonBreakableComponentMesh)
  775. : Pointer; cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableGetFirstSegment'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  776. function NewtonBreakableGetNextSegment(const Segment: Pointer): Pointer; cdecl;
  777. external{$IFDEF __GPC__}name 'NewtonBreakableGetNextSegment'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  778. function NewtonBreakableSegmentGetMaterial(const Segment: Pointer): integer; cdecl;
  779. external{$IFDEF __GPC__}name 'NewtonBreakableSegmentGetMaterial'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  780. function NewtonBreakableSegmentGetIndexCount(const Segment: Pointer): integer; cdecl;
  781. external{$IFDEF __GPC__}name 'NewtonBreakableSegmentGetIndexCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  782. function NewtonBreakableSegmentGetIndexStream(compoundBreakable: PNewtonCollision;
  783. const MeshOwner: PNewtonBreakableComponentMesh; const Segment: Pointer; index: PInteger): integer;
  784. cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableSegmentGetIndexStream'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  785. function NewtonBreakableSegmentGetIndexStreamShort(compoundBreakable: PNewtonCollision;
  786. const MeshOwner: PNewtonBreakableComponentMesh; const Segment: Pointer; index: PShort): integer;
  787. cdecl; external{$IFDEF __GPC__}name 'NewtonBreakableSegmentGetIndexStreamShort'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  788. // ***********************************************************************************************************
  789. //
  790. // Collision serialization functions
  791. //
  792. // ***********************************************************************************************************
  793. function NewtonCreateCollisionFromSerialization(const NewtonWorld: PNewtonWorld;
  794. deserializeFunction: PNewtonDeserialize; serializeHandle: Pointer): PNewtonCollision; cdecl;
  795. external{$IFDEF __GPC__}name 'NewtonCreateCollisionFromSerialization'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  796. // ***********************************************************************************************************
  797. //
  798. // Collision serialization functions
  799. //
  800. // ***********************************************************************************************************
  801. procedure NewtonCollisionSerialize(const NewtonWorld: PNewtonWorld;
  802. const collision: PNewtonCollision; serializeFunction: PNewtonSerialize; serializeHandle: Pointer);
  803. cdecl; external{$IFDEF __GPC__}name 'NewtonCollisionSerialize'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  804. procedure NewtonCollisionGetInfo(const collision: PNewtonCollision;
  805. collisionInfo: PNewtonCollisionInfoRecord); cdecl;
  806. external{$IFDEF __GPC__}name 'NewtonCollisionGetInfo'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  807. // **********************************************************************************************
  808. //
  809. // Static collision shapes functions
  810. //
  811. // **********************************************************************************************
  812. function NewtonCreateHeightFieldCollision(const NewtonWorld: PNewtonWorld;
  813. width, height, gridDiagonals: integer; elevationMap: PUnsigned_short; attributeMap: P2Char;
  814. horizontalScale, verticalScale: dFloat; shapeID: integer): PNewtonCollision; cdecl;
  815. external{$IFDEF __GPC__}name 'NewtonCreateHeightFieldCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  816. procedure NewtonHeightFieldSetUserRayCastCallback(const TreeCollision: PNewtonCollision;
  817. rayHitCallback: PNewtonHeightFieldRayCastCallback); cdecl;
  818. external{$IFDEF __GPC__}name 'NewtonHeightFieldSetUserRayCastCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  819. function NewtonCreateTreeCollision(const NewtonWorld: PNewtonWorld; shapeID: integer)
  820. : PNewtonCollision; cdecl; external NewtonDLL;
  821. function NewtonCreateTreeCollisionFromMesh(const NewtonWorld: PNewtonWorld; const Mesh: PNewtonMesh;
  822. shapeID: integer): PNewtonCollision; cdecl; external NewtonDLL;
  823. procedure NewtonTreeCollisionSetUserRayCastCallback(const TreeCollision: PNewtonCollision;
  824. rayHitCallback: PNewtonCollisionTreeRayCastCallback); cdecl; external NewtonDLL;
  825. procedure NewtonTreeCollisionBeginBuild(const TreeCollision: PNewtonCollision); cdecl;
  826. external NewtonDLL;
  827. procedure NewtonTreeCollisionAddFace(const TreeCollision: PNewtonCollision; vertexCount: integer;
  828. const vertexPtr: PdFloat; strideInBytes: integer; faceAttribute: integer); cdecl;
  829. external NewtonDLL;
  830. procedure NewtonTreeCollisionEndBuild(const TreeCollision: PNewtonCollision; optimize: integer);
  831. cdecl; external NewtonDLL;
  832. function NewtonTreeCollisionGetFaceAtribute(const TreeCollision: PNewtonCollision;
  833. const faceIndexArray: PInteger): integer; cdecl; external NewtonDLL;
  834. procedure NewtonTreeCollisionSetFaceAtribute(const TreeCollision: PNewtonCollision;
  835. const faceIndexArray: PInteger; attribute: integer); cdecl;
  836. external{$IFDEF __GPC__}name 'NewtonTreeCollisionSetFaceAtribute'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  837. function NewtonTreeCollisionGetVertexListIndexListInAABB(const TreeCollision: PNewtonCollision;
  838. const p0, p1: PdFloat; const vertexArray: PdFloat; vertexCount, vertexStrideInBytes: PInteger;
  839. const indexList: PInteger; maxIndexCount: integer; const faceAttribute: PInteger): integer; cdecl;
  840. external NewtonDLL;
  841. procedure NewtonStaticCollisionSetDebugCallback(const staticCollision: PNewtonCollision;
  842. userCallback: PNewtonTreeCollisionCallback); cdecl;
  843. external{$IFDEF __GPC__}name 'NewtonStaticCollisionSetDebugCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  844. // *****************************************************************************************************************************
  845. //
  846. // General purpose collision library functions
  847. //
  848. // *****************************************************************************************************************************
  849. function NewtonCollisionPointDistance(const NewtonWorld: PNewtonWorld; const point: PdFloat;
  850. const collision: PNewtonCollision; const matrix: PdFloat; contact: PdFloat; normal: PdFloat;
  851. threadIndex: integer): integer; cdecl;
  852. external{$IFDEF __GPC__}name 'NewtonCollisionPointDistance'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  853. // for the end user
  854. function NewtonCollisionClosestPoint(const NewtonWorld: PNewtonWorld;
  855. const collsionA: PNewtonCollision; const matrixA: PdFloat; const collisionB: PNewtonCollision;
  856. const matrixB: PdFloat; contactA, contactB, normalAB: PdFloat; threadIndex: integer): integer;
  857. cdecl; external{$IFDEF __GPC__}name 'NewtonCollisionClosestPoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  858. function NewtonCollisionCollide(const NewtonWorld: PNewtonWorld; maxSize: integer;
  859. const collsionA: PNewtonCollision; const matrixA: PdFloat; const collisionB: PNewtonCollision;
  860. const matrixB: PdFloat; contacts, normals, penetration: PdFloat; threadIndex: integer): integer;
  861. cdecl; external{$IFDEF __GPC__}name 'NewtonCollisionCollide'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  862. function NewtonCollisionCollideContinue(const NewtonWorld: PNewtonWorld; maxSize: integer;
  863. const timestep: dFloat; const collsionA: PNewtonCollision; const matrixA: PdFloat;
  864. const velocA: PdFloat; const omegaA: dFloat; const collsionB: PNewtonCollision;
  865. const matrixB: PdFloat; const velocB: PdFloat; const omegaB: dFloat; timeOfImpact: PdFloat;
  866. contacts: PdFloat; normals: PdFloat; penetration: PdFloat; threadIndex: integer): integer; cdecl;
  867. external{$IFDEF __GPC__}name 'NewtonCollisionCollideContinue'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  868. procedure NewtonCollisionSupportVertex(const collision: PNewtonCollision; const dir: PdFloat;
  869. vertex: PdFloat); cdecl;
  870. external{$IFDEF __GPC__}name 'NewtonCollisionSupportVertex'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  871. function NewtonCollisionRayCast(const collision: PNewtonCollision; const p0: PdFloat;
  872. const p1: PdFloat; normals: PdFloat; attribute: PInteger): dFloat; cdecl; external NewtonDLL;
  873. procedure NewtonCollisionCalculateAABB(const collision: PNewtonCollision; const matrix: PdFloat;
  874. p0: PdFloat; p1: PdFloat); cdecl; external NewtonDLL;
  875. procedure NewtonCollisionForEachPolygonDo(const collision: PNewtonCollision; const matrix: PdFloat;
  876. callback: NewtonCollisionIterator;
  877. // **********************************************************************************************
  878. //
  879. // collision aggregates, are a collision node on eh broad phase the serve as the root nod for a collection of rigid bodies
  880. // 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
  881. // These are good for speeding calculation calculation of rag doll, Vehicles or contractions of rigid bodied lined by joints.
  882. // 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
  883. // then warping the bodies under an aggregate will reduce collision calculation of almost an order of magnitude.
  884. //
  885. // **********************************************************************************************
  886. userData: Pointer); cdecl;
  887. external{$IFDEF __GPC__}name 'NewtonCollisionForEachPolygonDo'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  888. // *****************************************************************************************************************************
  889. //
  890. // transforms utility functions
  891. //
  892. // *****************************************************************************************************************************
  893. procedure NewtonSetEulerAngle(const eulersAngles: PdFloat; matrix: PdFloat); cdecl;
  894. external{$IFDEF __GPC__}name 'NewtonSetEulerAngle'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  895. procedure NewtonGetEulerAngle(const matrix: PdFloat; eulersAngles: PdFloat); cdecl;
  896. external{$IFDEF __GPC__}name 'NewtonGetEulerAngle'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  897. function NewtonCalculateSpringDamperAcceleration(dt, ks, x, kd, s: dFloat): dFloat; cdecl;
  898. external{$IFDEF __GPC__}name 'NewtonCalculateSpringDamperAcceleration'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  899. // *****************************************************************************************************************************
  900. //
  901. // body manipulation functions
  902. //
  903. // *****************************************************************************************************************************
  904. function NewtonCreateBody(const NewtonWorld: PNewtonWorld; const collision: PNewtonCollision;
  905. const matrix: PdFloat): PNewtonBody; cdecl;
  906. external{$IFDEF __GPC__}name 'NewtonCreateBody'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  907. procedure NewtonDestroyBody(const NewtonWorld: PNewtonWorld; const Body: PNewtonBody); cdecl;
  908. external{$IFDEF __GPC__}name 'NewtonDestroyBody'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  909. procedure NewtonBodyAddForce(const Body: PNewtonBody; const Force: PdFloat); cdecl;
  910. external{$IFDEF __GPC__}name 'NewtonBodyAddForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  911. procedure NewtonBodyAddTorque(const Body: PNewtonBody; const torque: PdFloat); cdecl;
  912. external{$IFDEF __GPC__}name 'NewtonBodyAddTorque'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  913. procedure NewtonBodyCalculateInverseDynamicsForce(const Body: PNewtonBody; timestep: dFloat;
  914. const desiredVeloc: PdFloat; forceOut: PdFloat); cdecl;
  915. external{$IFDEF __GPC__}name 'NewtonBodyCalculateInverseDynamicsForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  916. procedure NewtonBodySetMatrix(const Body: PNewtonBody; const matrix: PdFloat); cdecl;
  917. external{$IFDEF __GPC__}name 'NewtonBodySetMatrix'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  918. procedure NewtonBodySetMatrixRecursive(const Body: PNewtonBody; const matrix: PdFloat); cdecl;
  919. external{$IFDEF __GPC__}name 'NewtonBodySetMatrixRecursive'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  920. procedure NewtonBodySetMassMatrix(const Body: PNewtonBody; mass: dFloat; Ixx: dFloat; Iyy: dFloat;
  921. Izz: dFloat); cdecl;
  922. external{$IFDEF __GPC__}name 'NewtonBodySetMassMatrix'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  923. procedure NewtonBodySetMaterialGroupID(const Body: PNewtonBody; id: integer); cdecl;
  924. external{$IFDEF __GPC__}name 'NewtonBodySetMaterialGroupID'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  925. procedure NewtonBodySetContinuousCollisionMode(const Body: PNewtonBody; state: integer); cdecl;
  926. external{$IFDEF __GPC__}name 'NewtonBodySetContinuousCollisionMode'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  927. procedure NewtonBodySetJointRecursiveCollision(const Body: PNewtonBody; state: unsigned_int); cdecl;
  928. external{$IFDEF __GPC__}name 'NewtonBodySetJointRecursiveCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  929. procedure NewtonBodySetOmega(const Body: PNewtonBody; const omega: PdFloat); cdecl;
  930. external{$IFDEF __GPC__}name 'NewtonBodySetOmega'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  931. procedure NewtonBodySetVelocity(const Body: PNewtonBody; const velocity: PdFloat); cdecl;
  932. external{$IFDEF __GPC__}name 'NewtonBodySetVelocity'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  933. procedure NewtonBodySetForce(const Body: PNewtonBody; const Force: PdFloat); cdecl;
  934. external{$IFDEF __GPC__}name 'NewtonBodySetForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  935. procedure NewtonBodySetTorque(const Body: PNewtonBody; const torque: PdFloat); cdecl;
  936. external{$IFDEF __GPC__}name 'NewtonBodySetTorque'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  937. procedure NewtonBodySetCentreOfMass(const Body: PNewtonBody; const com: PdFloat); cdecl;
  938. external{$IFDEF __GPC__}name 'NewtonBodySetCentreOfMass'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  939. procedure NewtonBodySetLinearDamping(const Body: PNewtonBody; linearDamp: dFloat); cdecl;
  940. external{$IFDEF __GPC__}name 'NewtonBodySetLinearDamping'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  941. procedure NewtonBodySetAngularDamping(const Body: PNewtonBody; const angularDamp: PdFloat); cdecl;
  942. external{$IFDEF __GPC__}name 'NewtonBodySetAngularDamping'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  943. procedure NewtonBodySetUserData(const Body: PNewtonBody; userData: Pointer); cdecl;
  944. external{$IFDEF __GPC__}name 'NewtonBodySetUserData'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  945. procedure NewtonBodySetCollision(const Body: PNewtonBody; const collision: PNewtonCollision); cdecl;
  946. external{$IFDEF __GPC__}name 'NewtonBodySetCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  947. function NewtonBodyGetSleepState(const Body: PNewtonBody): integer; cdecl;
  948. external{$IFDEF __GPC__}name 'NewtonBodyGetSleepState'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  949. function NewtonBodyGetAutoSleep(const Body: PNewtonBody): integer; cdecl;
  950. external{$IFDEF __GPC__}name 'NewtonBodyGetAutoSleep'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  951. procedure NewtonBodySetAutoSleep(const Body: PNewtonBody; state: integer); cdecl;
  952. external{$IFDEF __GPC__}name 'NewtonBodySetAutoSleep'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  953. function NewtonBodyGetFreezeState(const Body: PNewtonBody): integer; cdecl;
  954. external{$IFDEF __GPC__}name 'NewtonBodyGetFreezeState'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  955. procedure NewtonBodySetFreezeState(const Body: PNewtonBody; state: integer); cdecl;
  956. external{$IFDEF __GPC__}name 'NewtonBodySetFreezeState'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  957. procedure NewtonBodySetDestructorCallback(const Body: PNewtonBody; callback: NewtonBodyDestructor);
  958. cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetDestructorCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  959. procedure NewtonBodySetTransformCallback(const Body: PNewtonBody; callback: NewtonSetTransform);
  960. cdecl; external{$IFDEF __GPC__}name 'NewtonBodySetTransformCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  961. function NewtonBodyGetTransformCallback(const Body: PNewtonBody): NewtonSetTransform; cdecl;
  962. external{$IFDEF __GPC__}name 'NewtonBodyGetForceAndTorqueCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  963. procedure NewtonBodySetForceAndTorqueCallback(const Body: PNewtonBody;
  964. callback: NewtonApplyForceAndTorque); cdecl;
  965. external{$IFDEF __GPC__}name 'NewtonBodySetForceAndTorqueCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  966. function NewtonBodyGetForceAndTorqueCallback(const Body: PNewtonBody): NewtonApplyForceAndTorque;
  967. cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetForceAndTorqueCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  968. function NewtonBodyGetUserData(const Body: PNewtonBody): Pointer; cdecl;
  969. external{$IFDEF __GPC__}name 'NewtonBodyGetUserData'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  970. function NewtonBodyGetWorld(const Body: PNewtonBody): PNewtonWorld; cdecl;
  971. external{$IFDEF __GPC__}name 'NewtonBodyGetWorld'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  972. function NewtonBodyGetCollision(const Body: PNewtonBody): PNewtonCollision; cdecl;
  973. external{$IFDEF __GPC__}name 'NewtonBodyGetCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  974. function NewtonBodyGetMaterialGroupID(const Body: PNewtonBody): integer; cdecl;
  975. external{$IFDEF __GPC__}name 'NewtonBodyGetMaterialGroupID'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  976. function NewtonBodyGetContinuousCollisionMode(const Body: PNewtonBody): integer; cdecl;
  977. external{$IFDEF __GPC__}name 'NewtonBodyGetContinuousCollisionMode'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  978. function NewtonBodyGetJointRecursiveCollision(const Body: PNewtonBody): integer; cdecl;
  979. external{$IFDEF __GPC__}name 'NewtonBodyGetJointRecursiveCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  980. procedure NewtonBodyGetMatrix(const Body: PNewtonBody; matrix: PdFloat); cdecl;
  981. external{$IFDEF __GPC__}name 'NewtonBodyGetMatrix'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  982. procedure NewtonBodyGetRotation(const Body: PNewtonBody; rotation: PdFloat); cdecl;
  983. external{$IFDEF __GPC__}name 'NewtonBodyGetRotation'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  984. procedure NewtonBodyGetMassMatrix(const Body: PNewtonBody; mass: PdFloat; Ixx: PdFloat;
  985. Iyy: PdFloat; Izz: PdFloat); cdecl;
  986. external{$IFDEF __GPC__}name 'NewtonBodyGetMassMatrix'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  987. procedure NewtonBodyGetInvMass(const Body: PNewtonBody; invMass: PdFloat; invIxx: PdFloat;
  988. invIyy: PdFloat; invIzz: PdFloat); cdecl;
  989. external{$IFDEF __GPC__}name 'NewtonBodyGetInvMass'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  990. procedure NewtonBodyGetOmega(const Body: PNewtonBody; vector: PdFloat); cdecl;
  991. external{$IFDEF __GPC__}name 'NewtonBodyGetOmega'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  992. procedure NewtonBodyGetVelocity(const Body: PNewtonBody; vector: PdFloat); cdecl;
  993. external{$IFDEF __GPC__}name 'NewtonBodyGetVelocity'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  994. procedure NewtonBodyGetForce(const Body: PNewtonBody; vector: PdFloat); cdecl;
  995. external{$IFDEF __GPC__}name 'NewtonBodyGetForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  996. procedure NewtonBodyGetTorque(const Body: PNewtonBody; vector: PdFloat); cdecl;
  997. external{$IFDEF __GPC__}name 'NewtonBodyGetTorque'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  998. procedure NewtonBodyGetForceAcc(const Body: PNewtonBody; vector: PdFloat); cdecl;
  999. external{$IFDEF __GPC__}name 'NewtonBodyGetForceAcc'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1000. procedure NewtonBodyGetTorqueAcc(const Body: PNewtonBody; vector: PdFloat); cdecl;
  1001. external{$IFDEF __GPC__}name 'NewtonBodyGetTorqueAcc'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1002. procedure NewtonBodyGetCentreOfMass(const Body: PNewtonBody; com: PdFloat); cdecl;
  1003. external{$IFDEF __GPC__}name 'NewtonBodyGetCentreOfMass'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1004. function NewtonBodyGetLinearDamping(const Body: PNewtonBody): dFloat; cdecl;
  1005. external{$IFDEF __GPC__}name 'NewtonBodyGetLinearDamping'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1006. procedure NewtonBodyGetAngularDamping(const Body: PNewtonBody; vector: PdFloat); cdecl;
  1007. external{$IFDEF __GPC__}name 'NewtonBodyGetAngularDamping'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1008. procedure NewtonBodyGetAABB(const Body: PNewtonBody; p0: PdFloat; p1: PdFloat); cdecl;
  1009. external{$IFDEF __GPC__}name 'NewtonBodyGetAABB'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1010. procedure NewtonBodyGetFreezeTreshold(const Body: PNewtonBody; freezeSpeed2: PdFloat;
  1011. freezeOmega2: PdFloat); cdecl;
  1012. external{$IFDEF __GPC__}name 'NewtonBodyGetFreezeTreshold'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1013. function NewtonBodyGetFirstJoint(const Body: PNewtonBody): PNewtonJoint; cdecl;
  1014. external{$IFDEF __GPC__}name 'NewtonBodyGetFirstJoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1015. function NewtonBodyGetNextJoint(const Body: PNewtonBody; const joint: PNewtonJoint): PNewtonJoint;
  1016. cdecl; external{$IFDEF __GPC__}name 'NewtonBodyGetNextJoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1017. function NewtonBodyGetFirstContactJoint(const Body: PNewtonBody): PNewtonJoint; cdecl;
  1018. external{$IFDEF __GPC__}name 'NewtonBodyGetFirstContactJoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1019. function NewtonBodyGetNextContactJoint(const Body: PNewtonBody; const contactJoint: PNewtonJoint)
  1020. : PNewtonJoint; cdecl;
  1021. external{$IFDEF __GPC__}name 'NewtonBodyGetNextContactJoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1022. // **********************************************************************************************
  1023. //
  1024. // contact joints interface
  1025. //
  1026. // **********************************************************************************************
  1027. function NewtonContactJointGetFirstContact(const contactJoint: PNewtonJoint): Pointer; cdecl;
  1028. external NewtonDLL;
  1029. function NewtonContactJointGetNextContact(const contactJoint: PNewtonJoint; contact: Pointer)
  1030. : Pointer; cdecl; external NewtonDLL;
  1031. function NewtonContactJointGetContactCount(const contactJoint: PNewtonJoint): integer; cdecl;
  1032. external{$IFDEF __GPC__}name 'NewtonContactJointGetContactCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1033. procedure NewtonContactJointRemoveContact(const contactJoint: PNewtonJoint; contact: Pointer);
  1034. cdecl; external{$IFDEF __GPC__}name 'NewtonContactJointRemoveContact'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1035. function NewtonContactGetMaterial(const contact: Pointer): PNewtonMaterial; cdecl;
  1036. external NewtonDLL;
  1037. procedure NewtonBodyAddBuoyancyForce(const Body: PNewtonBody; fluidDensity: dFloat;
  1038. fluidLinearViscosity, fluidAngularViscosity: dFloat; const gravityVector: PdFloat;
  1039. buoyancyPlane: NewtonGetBuoyancyPlane; context: Pointer); cdecl;
  1040. external{$IFDEF __GPC__}name 'NewtonBodyAddBuoyancyForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1041. procedure NewtonBodyAddImpulse(const Body: PNewtonBody; const pointDeltaVeloc: PdFloat;
  1042. const pointPosit: PdFloat); cdecl;
  1043. external{$IFDEF __GPC__}name 'NewtonAddBodyImpulse'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1044. procedure NewtonBodyApplyImpulseArray(const Body: PNewtonBody; ImpuleCount: integer;
  1045. StrideInByte: integer; const impulseArray: PdFloat; const pointArray: PdFloat); cdecl;
  1046. external{$IFDEF __GPC__}name 'NewtonBodyApplyImpulseArray'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1047. // *****************************************************************************************************************************
  1048. //
  1049. // Common joint funtions
  1050. //
  1051. // *****************************************************************************************************************************
  1052. function NewtonJointGetUserData(const joint: PNewtonJoint): Pointer; cdecl;
  1053. external{$IFDEF __GPC__}name 'NewtonJointGetUserData'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1054. procedure NewtonJointSetUserData(const joint: PNewtonJoint; userData: Pointer); cdecl;
  1055. external{$IFDEF __GPC__}name 'NewtonJointSetUserData'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1056. function NewtonJointGetBody0(const joint: PNewtonJoint): PNewtonBody; cdecl;
  1057. external{$IFDEF __GPC__}name 'NewtonJointGetBody0'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1058. function NewtonJointGetBody1(const joint: PNewtonJoint): PNewtonBody; cdecl;
  1059. external{$IFDEF __GPC__}name 'NewtonJointGetBody1'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1060. procedure NewtonJointGetInfo(const joint: PNewtonJoint; info: PNewtonJointRecord); cdecl;
  1061. external{$IFDEF __GPC__}name 'NewtonJointGetInfo'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1062. function NewtonJointGetCollisionState(const joint: PNewtonJoint): integer; cdecl;
  1063. external{$IFDEF __GPC__}name 'NewtonJointGetCollisionState'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1064. procedure NewtonJointSetCollisionState(const joint: PNewtonJoint; state: integer); cdecl;
  1065. external{$IFDEF __GPC__}name 'NewtonJointSetCollisionState'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1066. function NewtonJointGetStiffness(const joint: PNewtonJoint): dFloat; cdecl;
  1067. external{$IFDEF __GPC__}name 'NewtonJointGetStiffness'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1068. procedure NewtonJointSetStiffness(const joint: PNewtonJoint; state: dFloat); cdecl;
  1069. external{$IFDEF __GPC__}name 'NewtonJointSetStiffness'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1070. procedure NewtonDestroyJoint(const NewtonWorld: PNewtonWorld; const joint: PNewtonJoint); cdecl;
  1071. external{$IFDEF __GPC__}name 'NewtonDestroyJoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1072. procedure NewtonJointSetDestructor(const joint: PNewtonJoint;
  1073. _destructor: NewtonConstraintDestructor); cdecl;
  1074. external{$IFDEF __GPC__}name 'NewtonJointSetDestructor'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1075. // *****************************************************************************************************************************
  1076. //
  1077. // Ball and Socket joint functions
  1078. //
  1079. // *****************************************************************************************************************************
  1080. function NewtonConstraintCreateBall(const NewtonWorld: PNewtonWorld; const pivotPoint: PdFloat;
  1081. const childBody: PNewtonBody; const parentBody: PNewtonBody): PNewtonJoint; cdecl;
  1082. external{$IFDEF __GPC__}name 'NewtonConstraintCreateBall'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1083. procedure NewtonBallSetUserCallback(const ball: PNewtonJoint; callback: NewtonBallCallBack); cdecl;
  1084. external{$IFDEF __GPC__}name 'NewtonBallSetUserCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1085. procedure NewtonBallGetJointAngle(const ball: PNewtonJoint; angle: PdFloat); cdecl;
  1086. external{$IFDEF __GPC__}name 'NewtonBallGetJointAngle'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1087. procedure NewtonBallGetJointOmega(const ball: PNewtonJoint; omega: PdFloat); cdecl;
  1088. external{$IFDEF __GPC__}name 'NewtonBallGetJointOmega'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1089. procedure NewtonBallGetJointForce(const ball: PNewtonJoint; Force: PdFloat); cdecl;
  1090. external{$IFDEF __GPC__}name 'NewtonBallGetJointForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1091. procedure NewtonBallSetConeLimits(const ball: PNewtonJoint; const pin: PdFloat;
  1092. maxConeAngle: dFloat; maxTwistAngle: dFloat); cdecl;
  1093. external{$IFDEF __GPC__}name 'NewtonBallSetConeLimits'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1094. // *****************************************************************************************************************************
  1095. //
  1096. // Hinge joint functions
  1097. //
  1098. // *****************************************************************************************************************************
  1099. function NewtonConstraintCreateHinge(const NewtonWorld: PNewtonWorld; const pivotPoint: PdFloat;
  1100. const pinDir: PdFloat; const childBody: PNewtonBody; const parentBody: PNewtonBody): PNewtonJoint;
  1101. cdecl; external{$IFDEF __GPC__}name 'NewtonConstraintCreateHinge'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1102. procedure NewtonHingeSetUserCallback(const hinge: PNewtonJoint; callback: NewtonHingeCallBack);
  1103. cdecl; external{$IFDEF __GPC__}name 'NewtonHingeSetUserCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1104. function NewtonHingeGetJointAngle(const hinge: PNewtonJoint): dFloat; cdecl;
  1105. external{$IFDEF __GPC__}name 'NewtonHingeGetJointAngle'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1106. function NewtonHingeGetJointOmega(const hinge: PNewtonJoint): dFloat; cdecl;
  1107. external{$IFDEF __GPC__}name 'NewtonHingeGetJointOmega'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1108. procedure NewtonHingeGetJointForce(const hinge: PNewtonJoint; Force: PdFloat); cdecl;
  1109. external{$IFDEF __GPC__}name 'NewtonHingeGetJointForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1110. function NewtonHingeCalculateStopAlpha(const hinge: PNewtonJoint;
  1111. const desc: PNewtonHingeSliderUpdateDesc; angle: dFloat): dFloat; cdecl;
  1112. external{$IFDEF __GPC__}name 'NewtonHingeCalculateStopAlpha'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1113. // *****************************************************************************************************************************
  1114. //
  1115. // Slider joint functions
  1116. //
  1117. // *****************************************************************************************************************************
  1118. function NewtonConstraintCreateSlider(const NewtonWorld: PNewtonWorld; const pivotPoint: PdFloat;
  1119. const pinDir: PdFloat; const childBody: PNewtonBody; const parentBody: PNewtonBody): PNewtonJoint;
  1120. cdecl; external{$IFDEF __GPC__}name 'NewtonConstraintCreateSlider'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1121. procedure NewtonSliderSetUserCallback(const slider: PNewtonJoint; callback: NewtonSliderCallBack);
  1122. cdecl; external{$IFDEF __GPC__}name 'NewtonSliderSetUserCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1123. function NewtonSliderGetJointPosit(const slider: PNewtonJoint): dFloat; cdecl;
  1124. external{$IFDEF __GPC__}name 'NewtonSliderGetJointPosit'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1125. function NewtonSliderGetJointVeloc(const slider: PNewtonJoint): dFloat; cdecl;
  1126. external{$IFDEF __GPC__}name 'NewtonSliderGetJointVeloc'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1127. procedure NewtonSliderGetJointForce(const slider: PNewtonJoint; Force: PdFloat); cdecl;
  1128. external{$IFDEF __GPC__}name 'NewtonSliderGetJointForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1129. function NewtonSliderCalculateStopAccel(const slider: PNewtonJoint;
  1130. const desc: PNewtonHingeSliderUpdateDesc; position: dFloat): dFloat; cdecl;
  1131. external{$IFDEF __GPC__}name 'NewtonSliderCalculateStopAccel'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1132. // *****************************************************************************************************************************
  1133. //
  1134. // Corkscrew joint functions
  1135. //
  1136. // *****************************************************************************************************************************
  1137. function NewtonConstraintCreateCorkscrew(const NewtonWorld: PNewtonWorld; const pivotPoint: PdFloat;
  1138. const pinDir: PdFloat; const childBody: PNewtonBody; const parentBody: PNewtonBody): PNewtonJoint;
  1139. cdecl; external{$IFDEF __GPC__}name 'NewtonConstraintCreateCorkscrew'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1140. procedure NewtonCorkscrewSetUserCallback(const corkscrew: PNewtonJoint;
  1141. callback: NewtonCorkscrewCallBack); cdecl;
  1142. external{$IFDEF __GPC__}name 'NewtonCorkscrewSetUserCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1143. function NewtonCorkscrewGetJointPosit(const corkscrew: PNewtonJoint): dFloat; cdecl;
  1144. external{$IFDEF __GPC__}name 'NewtonCorkscrewGetJointPosit'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1145. function NewtonCorkscrewGetJointAngle(const corkscrew: PNewtonJoint): dFloat; cdecl;
  1146. external{$IFDEF __GPC__}name 'NewtonCorkscrewGetJointAngle'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1147. function NewtonCorkscrewGetJointVeloc(const corkscrew: PNewtonJoint): dFloat; cdecl;
  1148. external{$IFDEF __GPC__}name 'NewtonCorkscrewGetJointVeloc'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1149. function NewtonCorkscrewGetJointOmega(const corkscrew: PNewtonJoint): dFloat; cdecl;
  1150. external{$IFDEF __GPC__}name 'NewtonCorkscrewGetJointOmega'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1151. procedure NewtonCorkscrewGetJointForce(const corkscrew: PNewtonJoint; Force: PdFloat); cdecl;
  1152. external{$IFDEF __GPC__}name 'NewtonCorkscrewGetJointForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1153. function NewtonCorkscrewCalculateStopAlpha(const corkscrew: PNewtonJoint;
  1154. const desc: PNewtonHingeSliderUpdateDesc; angle: dFloat): dFloat; cdecl;
  1155. external{$IFDEF __GPC__}name 'NewtonCorkscrewCalculateStopAlpha'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1156. function NewtonCorkscrewCalculateStopAccel(const corkscrew: PNewtonJoint;
  1157. const desc: PNewtonHingeSliderUpdateDesc; position: dFloat): dFloat; cdecl;
  1158. external{$IFDEF __GPC__}name 'NewtonCorkscrewCalculateStopAccel'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1159. // *****************************************************************************************************************************
  1160. //
  1161. // Universal joint functions
  1162. //
  1163. // *****************************************************************************************************************************
  1164. function NewtonConstraintCreateUniversal(const NewtonWorld: PNewtonWorld; const pivotPoint: PdFloat;
  1165. const pinDir0: PdFloat; const pinDir1: PdFloat; const childBody: PNewtonBody;
  1166. const parentBody: PNewtonBody): PNewtonJoint; cdecl;
  1167. external{$IFDEF __GPC__}name 'NewtonConstraintCreateUniversal'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1168. procedure NewtonUniversalSetUserCallback(const universal: PNewtonJoint;
  1169. callback: NewtonUniversalCallBack); cdecl;
  1170. external{$IFDEF __GPC__}name 'NewtonUniversalSetUserCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1171. function NewtonUniversalGetJointAngle0(const universal: PNewtonJoint): dFloat; cdecl;
  1172. external{$IFDEF __GPC__}name 'NewtonUniversalGetJointAngle0'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1173. function NewtonUniversalGetJointAngle1(const universal: PNewtonJoint): dFloat; cdecl;
  1174. external{$IFDEF __GPC__}name 'NewtonUniversalGetJointAngle1'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1175. function NewtonUniversalGetJointOmega0(const universal: PNewtonJoint): dFloat; cdecl;
  1176. external{$IFDEF __GPC__}name 'NewtonUniversalGetJointOmega0'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1177. function NewtonUniversalGetJointOmega1(const universal: PNewtonJoint): dFloat; cdecl;
  1178. external{$IFDEF __GPC__}name 'NewtonUniversalGetJointOmega1'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1179. procedure NewtonUniversalGetJointForce(const universal: PNewtonJoint; Force: PdFloat); cdecl;
  1180. external{$IFDEF __GPC__}name 'NewtonUniversalGetJointForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1181. function NewtonUniversalCalculateStopAlpha0(const universal: PNewtonJoint;
  1182. const desc: PNewtonHingeSliderUpdateDesc; angle: dFloat): dFloat; cdecl;
  1183. external{$IFDEF __GPC__}name 'NewtonUniversalCalculateStopAlpha0'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1184. function NewtonUniversalCalculateStopAlpha1(const universal: PNewtonJoint;
  1185. const desc: PNewtonHingeSliderUpdateDesc; angle: dFloat): dFloat; cdecl;
  1186. external{$IFDEF __GPC__}name 'NewtonUniversalCalculateStopAlpha1'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1187. // *****************************************************************************************************************************
  1188. //
  1189. // Up vector joint unctions
  1190. //
  1191. // *****************************************************************************************************************************
  1192. function NewtonConstraintCreateUpVector(const NewtonWorld: PNewtonWorld; const pinDir: PdFloat;
  1193. const Body: PNewtonBody): PNewtonJoint; cdecl;
  1194. external{$IFDEF __GPC__}name 'NewtonConstraintCreateUpVector'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1195. procedure NewtonUpVectorGetPin(const upVector: PNewtonJoint; pin: PdFloat); cdecl;
  1196. external{$IFDEF __GPC__}name 'NewtonUpVectorGetPin'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1197. procedure NewtonUpVectorSetPin(const upVector: PNewtonJoint; const pin: PdFloat); cdecl;
  1198. external{$IFDEF __GPC__}name 'NewtonUpVectorSetPin'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1199. // *****************************************************************************************************************************
  1200. //
  1201. // User defined bilateral Joint
  1202. //
  1203. // *****************************************************************************************************************************
  1204. function NewtonConstraintCreateUserJoint(const NewtonWorld: PNewtonWorld; MaxDOF: integer;
  1205. callback: PNewtonUserBilateralCallBack; GetInfo: PNewtonUserBilateralGetInfoCallBack;
  1206. const childBody: PNewtonBody; const parentBody: PNewtonBody): PNewtonJoint; cdecl;
  1207. external{$IFDEF __GPC__}name 'NewtonConstraintCreateUserJoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1208. procedure NewtonUserJointSetFeedbackCollectorCallback(const joint: PNewtonJoint;
  1209. GetFeedback: PNewtonUserBilateralCallBack); cdecl;
  1210. external{$IFDEF __GPC__}name 'NewtonUserJointSetFeedbackCollectorCallback'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1211. procedure NewtonUserJointAddLinearRow(const joint: PNewtonJoint; const pivot0: PdFloat;
  1212. const pivot1: PdFloat; const dir: PdFloat); cdecl;
  1213. external{$IFDEF __GPC__}name 'NewtonUserJointAddLinearRow'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1214. procedure NewtonUserJointAddAngularRow(const joint: PNewtonJoint; RelativeAngle: dFloat;
  1215. const dir: PdFloat); cdecl;
  1216. external{$IFDEF __GPC__}name 'NewtonUserJointAddAngularRow'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1217. procedure NewtonUserJointAddGeneralRow(const joint: PNewtonJoint; const Jacobian0: PdFloat;
  1218. const Jacobian1: PdFloat); cdecl;
  1219. external{$IFDEF __GPC__}name 'NewtonUserJointAddGeneralRow'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1220. procedure NewtonUserJointSetRowMinimumFriction(const joint: PNewtonJoint; Friction: dFloat); cdecl;
  1221. external{$IFDEF __GPC__}name 'NewtonUserJointSetRowMinimumFriction'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1222. procedure NewtonUserJointSetRowMaximumFriction(const joint: PNewtonJoint; Friction: dFloat); cdecl;
  1223. external{$IFDEF __GPC__}name 'NewtonUserJointSetRowMaximumFriction'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1224. procedure NewtonUserJointSetRowAcceleration(const joint: PNewtonJoint; Acceleration: dFloat); cdecl;
  1225. external{$IFDEF __GPC__}name 'NewtonUserJointSetRowAcceleration'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1226. procedure NewtonUserJointSetRowSpringDamperAcceleration(const joint: PNewtonJoint; springK: dFloat;
  1227. springD: dFloat); cdecl;
  1228. external{$IFDEF __GPC__}name 'NewtonUserJointSetRowSpringDamperAcceleration'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1229. procedure NewtonUserJointSetRowStiffness(const joint: PNewtonJoint; Stiffness: dFloat); cdecl;
  1230. external{$IFDEF __GPC__}name 'NewtonUserJointSetRowStiffness'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1231. function NewtonUserJointGetRowForce(const joint: PNewtonJoint; Row: integer): dFloat; cdecl;
  1232. external{$IFDEF __GPC__}name 'NewtonUserJointGetRowForce'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1233. // **********************************************************************************************
  1234. //
  1235. // Mesh joint functions
  1236. //
  1237. // **********************************************************************************************
  1238. function NewtonMeshCreate(const World: PNewtonWorld): PNewtonMesh; cdecl;
  1239. external{$IFDEF __GPC__}name 'NewtonMeshCreate'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1240. function NewtonMeshCreateFromMesh(const Mesh: PNewtonMesh): PNewtonMesh; cdecl;
  1241. external{$IFDEF __GPC__}name 'NewtonMeshCreateFromMesh'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1242. function NewtonMeshCreateFromCollision(const collision: PNewtonCollision): PNewtonMesh; cdecl;
  1243. external{$IFDEF __GPC__}name 'NewtonMeshCreateFromCollision'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1244. function NewtonMeshConvexHull(const NewtonWorld: PNewtonWorld; count: integer;
  1245. const vertexCloud: PdFloat; strideInBytes: integer; tolerance: dFloat): PNewtonMesh; cdecl;
  1246. external{$IFDEF __GPC__}name 'NewtonMeshConvexHull'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1247. function NewtonMeshCreatePlane(const World: PNewtonWorld; const locationMatrix: PdFloat;
  1248. width: dFloat; breadth: dFloat; material: integer; const textureMatrix0: PdFloat;
  1249. const textureMatrix1): PNewtonMesh; cdecl;
  1250. external{$IFDEF __GPC__}name 'NewtonMeshCreatePlane'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1251. procedure NewtonMeshDestroy(const Mesh: PNewtonMesh); cdecl;
  1252. external{$IFDEF __GPC__}name 'NewtonMeshDestroy'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1253. procedure NewtonMeshCalculateOOBB(const Mesh: PNewtonMesh; const matrix: PdFloat; x: PdFloat;
  1254. y: PdFloat; z: PdFloat); cdecl;
  1255. external{$IFDEF __GPC__}name 'NewtonMeshCalculateOOBB'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1256. procedure NewtonMesApplyTransform(const Mesh: PNewtonMesh; const matrix: PdFloat); cdecl;
  1257. external{$IFDEF __GPC__}name 'NewtonMesApplyTransform'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1258. procedure NewtonMeshCalculateVertexNormals(const Mesh: PNewtonMesh; angleInRadians: dFloat); cdecl;
  1259. external{$IFDEF __GPC__}name 'NewtonMeshCalculateVertexNormals'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1260. procedure NewtonMeshApplySphericalMapping(const Mesh: PNewtonMesh; material: integer); cdecl;
  1261. external{$IFDEF __GPC__}name 'NewtonMeshApplySphericalMapping'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1262. procedure NewtonMeshApplyBoxMapping(const Mesh: PNewtonMesh; front, side, top: integer); cdecl;
  1263. external{$IFDEF __GPC__}name 'NewtonMeshApplyBoxMapping'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1264. procedure NewtonMeshApplyCylindricalMapping(const Mesh: PNewtonMesh;
  1265. cylinderMaterial, capMaterial: integer); cdecl;
  1266. external{$IFDEF __GPC__}name 'NewtonMeshApplyCylindricalMapping'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1267. function NewtonMeshIsOpenMesh(const Mesh: PNewtonMesh): integer; cdecl;
  1268. external{$IFDEF __GPC__}name 'NewtonMeshIsOpenMesh'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1269. procedure NewtonMeshFixTJoints(const Mesh: PNewtonMesh); cdecl;
  1270. external{$IFDEF __GPC__}name 'NewtonMeshFixTJoints'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1271. procedure NewtonMeshPolygonize(const Mesh: PNewtonMesh); cdecl;
  1272. external{$IFDEF __GPC__}name 'NewtonMeshPolygonize'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1273. procedure NewtonMeshTriangulate(const Mesh: PNewtonMesh); cdecl;
  1274. external{$IFDEF __GPC__}name 'NewtonMeshTriangulate'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1275. function NewtonMeshUnion(const Mesh: PNewtonMesh; clipper: PNewtonMesh; clipperMatrix: PdFloat)
  1276. : PNewtonMesh; cdecl;
  1277. external{$IFDEF __GPC__}name 'NewtonMeshUnion'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1278. function NewtonMeshDifference(const Mesh: PNewtonMesh; clipper: PNewtonMesh; clipperMatrix: PdFloat)
  1279. : PNewtonMesh; cdecl;
  1280. external{$IFDEF __GPC__}name 'NewtonMeshDifference'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1281. function NewtonMeshIntersection(const Mesh: PNewtonMesh; clipper: PNewtonMesh;
  1282. clipperMatrix: PdFloat): PNewtonMesh; cdecl;
  1283. external{$IFDEF __GPC__}name 'NewtonMeshIntersection'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1284. procedure NewtonMeshClip(const Mesh: PNewtonMesh; const clipper: PNewtonMesh;
  1285. const clipperMatrix: PdFloat; const topMesh: PNewtonMesh; const bottomMesh: PNewtonMesh); cdecl;
  1286. external{$IFDEF __GPC__}name 'NewtonMeshClip'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1287. procedure NewtonMeshPlaneClip(const Mesh: PNewtonMesh; const planeMatrix: PdFloat;
  1288. const PlaneTextureMatrix: PdFloat; PlaneMaterial: integer; const topMesh: PNewtonMesh;
  1289. const bottomMesh: PNewtonMesh); cdecl;
  1290. external{$IFDEF __GPC__}name 'NewtonMeshPlaneClip'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1291. function NewtonMeshConvexDecomposition(const Mesh: PNewtonMesh; maxCount: integer): PNewtonMesh;
  1292. cdecl; external{$IFDEF __GPC__}name 'NewtonMeshConvexDecomposition'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1293. function NewtonMeshVoronoiDecomposition(const Mesh: PNewtonMesh;
  1294. PointCount, PointStrideInBytes: integer; const PointCloud: PdFloat; InternalMaterial: integer;
  1295. const TextureMatrix: PdFloat): PNewtonMesh; cdecl;
  1296. external{$IFDEF __GPC__}name 'NewtonMeshVoronoiDecomposition'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1297. procedure NewtonRemoveUnusedVertices(const Mesh: PNewtonMesh; vertexRemapTable: PInteger); cdecl;
  1298. external{$IFDEF __GPC__}name 'NewtonRemoveUnusedVertices'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1299. procedure NewtonMeshBeginFace(const Mesh: PNewtonMesh); cdecl;
  1300. external{$IFDEF __GPC__}name 'NewtonMeshBeginFace'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1301. procedure NewtonMeshAddFace(const Mesh: PNewtonMesh; vertexCount: integer; const vertex: PdFloat;
  1302. strideInBytes, materialIndex: integer); cdecl;
  1303. external{$IFDEF __GPC__}name 'NewtonMeshAddFace'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1304. procedure NewtonMeshEndFace(const Mesh: PNewtonMesh); cdecl;
  1305. external{$IFDEF __GPC__}name 'NewtonMeshEndFace'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1306. procedure NewtonMeshBuildFromVertexListIndexList(const Mesh: PNewtonMesh; FaceCount: integer;
  1307. const faceIndexCount: PInteger; const faceMaterialIndex: PInteger; const vertex: PdFloat;
  1308. vertexStrideInBytes: integer; const vertexIndex: PInteger; const normal: PdFloat;
  1309. normalStrideInBytes: integer; const normalIndex: PInteger; const uv0: PdFloat;
  1310. uv0StrideInBytes: integer; const uv0Index: PInteger; const uv1: PdFloat;
  1311. uv1StrideInBytes: integer; const uv1Index: PInteger); cdecl;
  1312. external{$IFDEF __GPC__}name 'NewtonMeshBuildFromVertexListIndexList'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1313. procedure NewtonMeshGetVertexStreams(const Mesh: PNewtonMesh; vertexStrideInByte: integer;
  1314. vertex: PdFloat; normalStrideInByte: integer; normal: PdFloat; uvStrideInByte0: integer;
  1315. uv0: PdFloat; uvStrideInByte1: integer; uv1: PdFloat); cdecl;
  1316. external{$IFDEF __GPC__}name 'NewtonMeshGetVertexStreams'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1317. procedure NewtonMeshGetIndirectVertexStreams(const Mesh: PNewtonMesh; vertexStrideInByte: integer;
  1318. vertex: PdFloat; vertexIndices: PInteger; vertexCount: PInteger; normalStrideInByte: integer;
  1319. normal: PdFloat; normalIndices: PInteger; normalCount: PInteger; uvStrideInByte0: integer;
  1320. uv0: PdFloat; uvIndices0: PInteger; uvCount0: PInteger; uvStrideInByte1: integer; uv1: PdFloat;
  1321. uvIndices1: PInteger; uvCount1: PInteger); cdecl;
  1322. external{$IFDEF __GPC__}name 'NewtonMeshGetIndirectVertexStreams'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1323. function NewtonMeshBeginHandle(const Mesh: PNewtonMesh): Pointer; cdecl;
  1324. external{$IFDEF __GPC__}name 'NewtonMeshBeginHandle'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1325. procedure NewtonMeshEndHandle(const Mesh: PNewtonMesh; Handle: Pointer); cdecl;
  1326. external{$IFDEF __GPC__}name 'NewtonMeshEndHandle'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1327. function NewtonMeshFirstMaterial(const Mesh: PNewtonMesh; Handle: Pointer): integer; cdecl;
  1328. external{$IFDEF __GPC__}name 'NewtonMeshFirstMaterial'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1329. function NewtonMeshNextMaterial(const Mesh: PNewtonMesh; Handle: Pointer; materialID: integer)
  1330. : integer; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshNextMaterial'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1331. function NewtonMeshMaterialGetMaterial(const Mesh: PNewtonMesh; Handle: Pointer;
  1332. materialID: integer): integer; cdecl;
  1333. external{$IFDEF __GPC__}name 'NewtonMeshMaterialGetMaterial'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1334. function NewtonMeshMaterialGetIndexCount(const Mesh: PNewtonMesh; Handle: Pointer;
  1335. materialID: integer): integer; cdecl;
  1336. external{$IFDEF __GPC__}name 'NewtonMeshMaterialGetIndexCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1337. procedure NewtonMeshMaterialGetIndexStream(const Mesh: PNewtonMesh; Handle: Pointer;
  1338. materialID: integer; index: PInteger); cdecl;
  1339. external{$IFDEF __GPC__}name 'NewtonMeshMaterialGetIndexStream'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1340. procedure NewtonMeshMaterialGetIndexStreamShort(const Mesh: PNewtonMesh; Handle: Pointer;
  1341. materialID: integer; index: PShort); cdecl;
  1342. external{$IFDEF __GPC__}name 'NewtonMeshMaterialGetIndexStreamShort'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1343. function NewtonMeshCreateFirstSingleSegment(const Mesh: PNewtonMesh): PNewtonMesh; cdecl;
  1344. external{$IFDEF __GPC__}name 'NewtonMeshCreateFirstSingleSegment'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1345. function NewtonMeshCreateNextSingleSegment(const Mesh: PNewtonMesh; Segment: PNewtonMesh)
  1346. : PNewtonMesh; cdecl; external{$IFDEF __GPC__}name 'NewtonMeshCreateNextSingleSegment'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1347. function NewtonMeshCreateFirstLayer(const Mesh: PNewtonMesh): PNewtonMesh; cdecl;
  1348. external{$IFDEF __GPC__}name 'NewtonMeshCreateFirstLayer'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1349. function NewtonMeshCreateNextLayer(const Mesh: PNewtonMesh; const Segment: PNewtonMesh)
  1350. : PNewtonMesh; cdecl;
  1351. external{$IFDEF __GPC__}name 'NewtonMeshCreateNextLayer'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1352. function NewtonMeshGetTotalFaceCount(const Mesh: PNewtonMesh): integer; cdecl;
  1353. external{$IFDEF __GPC__}name 'NewtonMeshGetTotalFaceCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1354. function NewtonMeshGetTotalIndexCount(const Mesh: PNewtonMesh): integer; cdecl;
  1355. external{$IFDEF __GPC__}name 'NewtonMeshGetTotalIndexCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1356. procedure NewtonMeshGetFaces(const Mesh: PNewtonMesh; const faceIndexCount: PInteger;
  1357. faceMaterial: PInteger; faceIndices: PInteger); cdecl;
  1358. external{$IFDEF __GPC__}name 'NewtonMeshGetFaces'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1359. function NewtonMeshGetPointCount(const Mesh: PNewtonMesh): integer; cdecl;
  1360. external{$IFDEF __GPC__}name 'NewtonMeshGetPointCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1361. function NewtonMeshGetPointStrideInByte(const Mesh: PNewtonMesh): integer; cdecl;
  1362. external{$IFDEF __GPC__}name 'NewtonMeshGetPointStrideInByte'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1363. function NewtonMeshGetPointArray(const Mesh: PNewtonMesh): PdFloat; cdecl;
  1364. external{$IFDEF __GPC__}name 'NewtonMeshGetPointArray'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1365. function NewtonMeshGetNormalArray(const Mesh: PNewtonMesh): PdFloat; cdecl;
  1366. external{$IFDEF __GPC__}name 'NewtonMeshGetNormalArray'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1367. function NewtonMeshGetUV0Array(const Mesh: PNewtonMesh): PdFloat; cdecl;
  1368. external{$IFDEF __GPC__}name 'NewtonMeshGetUV0Array'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1369. function NewtonMeshGetUV1Array(const Mesh: PNewtonMesh): PdFloat; cdecl;
  1370. external{$IFDEF __GPC__}name 'NewtonMeshGetUV1Array'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1371. function NewtonMeshGetVertexCount(const Mesh: PNewtonMesh): integer; cdecl;
  1372. external{$IFDEF __GPC__}name 'NewtonMeshGetVertexCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1373. function NewtonMeshGetVertexStrideInByte(const Mesh: PNewtonMesh): integer; cdecl;
  1374. external{$IFDEF __GPC__}name 'NewtonMeshGetVertexStrideInByte'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1375. function NewtonMeshGetVertexArray(const Mesh: PNewtonMesh): PdFloat; cdecl;
  1376. external{$IFDEF __GPC__}name 'NewtonMeshGetVertexArray'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1377. function NewtonMeshGetFirstVertex(const Mesh: PNewtonMesh): Pointer; cdecl;
  1378. external{$IFDEF __GPC__}name 'NewtonMeshGetFirstVertex'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1379. function NewtonMeshGetNextVertex(const Mesh: PNewtonMesh; const vertex: Pointer): Pointer; cdecl;
  1380. external{$IFDEF __GPC__}name 'NewtonMeshGetNextVertex'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1381. function NewtonMeshGetVertexIndex(const Mesh: PNewtonMesh; const vertex: Pointer): integer; cdecl;
  1382. external{$IFDEF __GPC__}name 'NewtonMeshGetVertexIndex'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1383. // NEWTON_API int NewtonMeshGetVertexPointIndex (const NewtonMesh *mesh, const void* vertex);
  1384. function NewtonMeshGetFirstPoint(const Mesh: PNewtonMesh): Pointer; cdecl;
  1385. external{$IFDEF __GPC__}name 'NewtonMeshGetFirstPoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1386. function NewtonMeshGetNextPoint(const Mesh: PNewtonMesh; const point: Pointer): Pointer; cdecl;
  1387. external{$IFDEF __GPC__}name 'NewtonMeshGetNextPoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1388. function NewtonMeshGetPointIndex(const Mesh: PNewtonMesh; const point: Pointer): integer; cdecl;
  1389. external{$IFDEF __GPC__}name 'NewtonMeshGetPointIndex'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1390. function NewtonMeshGetVertexIndexFromPoint(const Mesh: PNewtonMesh; const point: Pointer): integer;
  1391. cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetVertexIndexFromPoint'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1392. function NewtonMeshGetFirstEdge(const Mesh: PNewtonMesh): Pointer; cdecl;
  1393. external{$IFDEF __GPC__}name 'NewtonMeshGetFirstEdge'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1394. function NewtonMeshGetNextEdge(const Mesh: PNewtonMesh; const Edge: Pointer): Pointer; cdecl;
  1395. external{$IFDEF __GPC__}name 'NewtonMeshGetNextEdge'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1396. procedure NewtonMeshGetEdgeIndices(const Mesh: PNewtonMesh; const Edge: Pointer; v0: PInteger;
  1397. v1: PInteger); cdecl;
  1398. external{$IFDEF __GPC__}name 'NewtonMeshGetEdgeIndices'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1399. // NEWTON_API void NewtonMeshGetEdgePointIndices (const Mesh : PNewtonMesh, const void* edge, int* v0, int* v1);
  1400. function NewtonMeshGetFirstFace(const Mesh: PNewtonMesh): Pointer; cdecl;
  1401. external{$IFDEF __GPC__}name 'NewtonMeshGetFirstFace'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1402. function NewtonMeshGetNextFace(const Mesh: PNewtonMesh; const face: Pointer): Pointer; cdecl;
  1403. external{$IFDEF __GPC__}name 'NewtonMeshGetNextFace'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1404. function NewtonMeshIsFaceOpen(const Mesh: PNewtonMesh; const face: Pointer): integer; cdecl;
  1405. external{$IFDEF __GPC__}name 'NewtonMeshIsFaceOpen'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1406. function NewtonMeshGetFaceMaterial(const Mesh: PNewtonMesh; const face: Pointer): integer; cdecl;
  1407. external{$IFDEF __GPC__}name 'NewtonMeshGetFaceMaterial'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1408. function NewtonMeshGetFaceIndexCount(const Mesh: PNewtonMesh; const face: Pointer): integer; cdecl;
  1409. external{$IFDEF __GPC__}name 'NewtonMeshGetFaceIndexCount'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1410. procedure NewtonMeshGetFaceIndices(const Mesh: PNewtonMesh; const face: Pointer; Indices: PInteger);
  1411. cdecl; external{$IFDEF __GPC__}name 'NewtonMeshGetFaceIndices'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1412. procedure NewtonMeshGetFacePointIndices(const Mesh: PNewtonMesh; const face: Pointer;
  1413. Indices: PInteger); cdecl;
  1414. external{$IFDEF __GPC__}name 'NewtonMeshGetFacePointIndices'{$ELSE}NewtonDLL{$ENDIF __GPC__};
  1415. implementation //-------------------------------------------------------------
  1416. end.