-
Notifications
You must be signed in to change notification settings - Fork 19
/
Newton.pas
1188 lines (955 loc) · 79.1 KB
/
Newton.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{ ******************************************************************** }
{ Newton Game dynamics }
{ copyright 2000-2004 }
{ By Julio Jerez }
{ VC: 6.0 }
{ One and only header file. }
{ ******************************************************************** }
{ ******************************************************************** }
{ Newton Pascal Header translation }
{ Copyright 2005-2009 Jernej L. }
{ Portions are based on original newton header by S.Spasov(Sury) }
{ ******************************************************************** }
// Define double to use newton in double precision
{$undef double}
{$i compiler.inc}
unit Newton;
interface
const
newtondll = 'Newton.dll';
NEWTON_MAJOR_VERSION = 2;
NEWTON_MINOR_VERSION = 12;
type
{$ifndef double}
float = Single;
{$else}
float = Double;
{$endif}
Pfloat = ^float;
Pinteger = ^integer;
Psmallint = ^smallint;
size_t = cardinal; // no longer used in Beta 15
unsigned = longword;
{ Newton objects }
PNewtonMesh = ^Pointer;
PNewtonBody = ^Pointer;
PNewtonWorld = ^Pointer;
PNewtonJoint = ^Pointer;
// DP 2.0 PNewtonContact = ^Pointer;
PNewtonMaterial = ^Pointer;
PNewtonCollision = ^Pointer;
PNewtonSceneProxy = ^Pointer; // 2.0
// DP 2.0 PNewtonRagDoll = ^Pointer;
// DP 2.0 PNewtonRagDollBone = ^Pointer;
const SERIALIZE_ID_BOX = 0;
const SERIALIZE_ID_CONE = 1;
const SERIALIZE_ID_SPHERE = 2;
const SERIALIZE_ID_CAPSULE = 3;
const SERIALIZE_ID_CYLINDER = 4;
const SERIALIZE_ID_COMPOUND = 5;
const SERIALIZE_ID_CONVEXHULL = 6;
const SERIALIZE_ID_CONVEXMODIFIER = 7;
const SERIALIZE_ID_CHAMFERCYLINDER = 8;
const SERIALIZE_ID_TREE = 9;
const SERIALIZE_ID_NULL = 10;
const SERIALIZE_ID_HEIGHTFIELD = 11;
const SERIALIZE_ID_USERMESH = 12;
const SERIALIZE_ID_SCENE = 13;
type
NewtonJointRecord = packed record
m_attachmenMatrix_0: array[0..3, 0..3] of float;
m_attachmenMatrix_1: array[0..3, 0..3] of float;
m_minLinearDof: array[0..2] of float;
m_minAngularDof: array[0..2] of float;
m_maxAngularDof: array[0..2] of float;
m_attachBody_0: Pnewtonbody;
m_attachBody_1: Pnewtonbody;
m_extraParameters: array[0..15] of float;
m_bodiesCollisionOn: integer;
m_descriptionType: array[0..31] of char;
end;
PNewtonJointRecord = ^NewtonJointRecord;
{ Newton records }
NewtonUserMeshCollisionCollideDesc = packed record
m_boxP0: array[0..3] of float; // lower bounding box of intersection query in local space
m_boxP1: array[0..3] of float; // upper bounding box of intersection query in local space
m_userData: Pointer; // user data passed to the collision geometry at creation time
m_faceCount: integer; // set how many polygons intersect the query box
m_vertex: Pfloat; // the pointer to the vertex array.
m_vertexStrideInBytes: integer; // set the size of each vertex
m_userAttribute: Pinteger; // set the Pointer to the user data, one for each face
m_faceIndexCount: Pinteger; // set the Pointer to the vertex count of each face.
m_faceVertexIndex: Pinteger; // set the Pointer index array for each vertex on a face.
m_objBody: PNewtonBody; // Pointer to the colliding body
m_polySoupBody: PNewtonBody; // Pointer to the rigid body owner of this collision tree
end;
PNewtonUserMeshCollisionCollideDesc = ^NewtonUserMeshCollisionCollideDesc;
NewtonWorldConvexCastReturnInfo = packed record
m_point: array[0..3] of float; // collision point in global space
m_normal: array[0..3] of float; // surface normal at collision point in global space
m_normalOnHitPoint: array[0..3] of single; // surface normal at the surface of the hit body,
// is the same as the normal calculated by a ray cast hitting the body at the hit point
m_penetration: float; // contact penetration at collision point
m_contactID: integer; // collision ID at contact point
m_hitBody: PNewtonBody; // body hit at contact point
end;
PNewtonWorldConvexCastReturnInfo = ^NewtonWorldConvexCastReturnInfo;
NewtonUserMeshCollisionRayHitDesc = packed record
m_p0: array[0..3] of float; // ray origin in collision local space
m_p1: array[0..3] of float; // ray destination in collision local space
m_normalOut: array[0..3] of float; // copy here the normal at the rat integerersection
m_userIdOut: integer; // copy here a user defined id for further feedback
m_userData: Pointer; // user data passed to the collision geometry at creation time
end;
PNewtonUserMeshCollisionRayHitDesc = ^NewtonUserMeshCollisionRayHitDesc;
NewtonHingeSliderUpdateDesc = packed record
m_accel: float;
m_minFriction: float;
m_maxFriction: float;
m_timestep: float;
end;
PNewtonHingeSliderUpdateDesc = ^NewtonHingeSliderUpdateDesc;
// NewtonCollisionInfoRecord
TNewtonBoxParam = packed record
m_x,
m_y,
m_z: float;
end;
TNewtonSphereParam = packed record
m_r0,
m_r1,
m_r2: single;
end;
TNewtonCylinderParam = packed record
m_r0,
m_r1,
m_height: single;
end;
TNewtonCapsuleParam = packed record
m_r0,
m_r1,
m_height: single;
end;
TNewtonConeParam = packed record
m_r,
m_height: single;
end;
TNewtonChamferCylinderParam = packed record
m_r,
m_height: single;
end;
TNewtonCollisionTreeParam = packed record
m_vertexCount,
m_indexCount: integer;
// if you want trimesh geometry data, use NewtonTreeCollisionGetVertexListIndexListInAABB.
end;
TNewtonCollisionNullParam = packed record
// nothing.
end;
TNewtonConvexHullModifierParam = packed record
m_chidren: PNewtonCollision;
end;
TNewtonCompoundCollisionParam = packed record
m_chidrenCount: integer;
m_chidren: pointer; // pointer to array of pnewtoncollisions
end;
TNewtonConvexHullParam = packed record
m_vertexCount,
m_vertexStrideInBytes,
m_faceCount: integer;
m_vertex: Pfloat;
end;
TNewtonHeightFieldCollisionParam = packed record
m_width,
m_height,
m_gridsDiagonals: integer;
m_horizonalScale,
m_verticalScale: single;
m_elevation: pointer; //unsigned short *m_elevation;
m_atributes: pchar;
end;
TNewtonSceneCollisionParam = packed record
m_childrenProxyCount: integer;
end;
TNewtonCollisionInfoRecord = packed record
m_offsetMatrix: array[0..3,0..3] of single;
m_collisionType, // tag id to identify the collision primitive
m_referenceCount: integer; // the current reference count for this collision
m_collisionUserID: integer;
Case integer of
SERIALIZE_ID_BOX :
(shapedatabox: TNewtonBoxParam );
SERIALIZE_ID_CONE :
(shapedata: TNewtonConeParam );
SERIALIZE_ID_SPHERE :
(shapedatasphere: TNewtonSphereParam );
SERIALIZE_ID_CAPSULE :
(shapedatacapsule: TNewtonCapsuleParam );
SERIALIZE_ID_CYLINDER :
(shapedatacylinder: TNewtonCylinderParam );
SERIALIZE_ID_COMPOUND :
(shapedatacompound: TNewtonCompoundCollisionParam );
SERIALIZE_ID_CONVEXHULL :
(shapedataconvexhull: TNewtonConvexHullParam);
SERIALIZE_ID_CONVEXMODIFIER :
(shapedataxonvexhull: TNewtonConvexHullModifierParam );
SERIALIZE_ID_CHAMFERCYLINDER :
(shapedatachamfercylinder: TNewtonChamferCylinderParam );
SERIALIZE_ID_TREE :
(shapedatatree: TNewtonCollisionTreeParam );
SERIALIZE_ID_NULL :
(shapedatanull: TNewtonCollisionNullParam );
SERIALIZE_ID_HEIGHTFIELD :
(shapedataheightfield: TNewtonHeightFieldCollisionParam );
SERIALIZE_ID_USERMESH :
(m_paramArray: array[0..63] of float);
SERIALIZE_ID_SCENE :
(shapedatascenecollision: TNewtonSceneCollisionParam);
end;
PNewtonCollisionInfoRecord = ^TNewtonCollisionInfoRecord;
// Newton callback functions
NewtonAllocMemory = procedure (sizeInBytes: integer ); cdecl;
PNewtonAllocMemory = ^NewtonAllocMemory;
PNewtonDestroyWorld = procedure (const NewtonWorld: PnewtonWorld); cdecl; // new 2.04
NewtonFreeMemory = procedure (const ptr: Pointer; sizeInBytes: integer ); cdecl;
PNewtonFreeMemory = ^NewtonFreeMemory;
PNewtonGetTicksCountCallback = function: longword; cdecl;
PNewtonSerialize = procedure(serializeHandle: Pointer; const buffer: Pointer; size: integer); cdecl;
PNewtonDeserialize = procedure(serializeHandle: Pointer; buffer: Pointer; size: integer); cdecl;
PNewtonUserMeshCollisionCollideCallback = procedure(collideDescData: NewtonUserMeshCollisionCollideDesc); cdecl;
PNewtonUserMeshCollisionRayHitCallback = function(lineDescData: NewtonUserMeshCollisionRayHitDesc): float; cdecl;
PNewtonUserMeshCollisionDestroyCallback = procedure(descData: Pointer); cdecl;
PNewtonUserMeshCollisionGetCollisionInfo = procedure(userData: pointer; infoRecord: PNewtonCollisionInfoRecord);
PNewtonUserMeshCollisionGetFacesInAABB = function(userData: pointer; const p0: Pfloat; p1: Pfloat;
const vertexArray: Pfloat; vertexCount: integer; VertexStrideInBytes: integer;
const indexList: integer; maxIndexCount: integer; const userDataList: Pinteger): integer;
PNewtonCollisionTreeRayCastCallback = function (const body: PNewtonBody; const treeCollision: PNewtonCollision; interception: float; normal: Pfloat; faceId: integer; usedData: pointer): float;
NewtonHeightFieldRayCastCallback = function (const body: PNewtonBody; const heightFieldCollision: PNewtonCollision; interception: single; row, col: integer; normal: Pfloat; faceId: integer; usedData: pointer): float;
// changed in 2.0
// collision tree call back (obsoleted no recommended)
PNewtonTreeCollisionCallback = procedure(const bodyWithTreeCollision: PNewtonBody; const body: PNewtonBody; faceID: integer;
vertexCount: integer; const vertex: Pfloat; VertexStrideInBytes: integer); cdecl;
PNewtonBodyDestructor = procedure(const body: PNewtonBody); cdecl;
PNewtonApplyForceAndTorque = procedure (const body: PNewtonBody; timestep: float; threadindex: integer); cdecl;
PNewtonSetTransform = procedure (const body: PNewtonBody ; const bmatrix: Pfloat; threadindex: integer); cdecl;
PNewtonBodyActivationState = procedure (const body: PNewtonBody; state: unsigned); cdecl;
pNewtonCollisionDestructor = procedure (const NewtonWorld: PnewtonWorld; const collision: PNewtonCollision);
PNewtonIslandUpdate = function(const NewtonWorld: PnewtonWorld; const islandHandle: pointer; bodyCount: integer): integer;
PNewtonBodyLeaveWorld = procedure(const body: PNewtonBody; threadindex: integer); cdecl;
pNewtonDestroyBodyByExeciveForce = procedure(const body: PNewtonBody; const contact: pNewtonJoint );
{
// DP 2.0
PNewtonSetRagDollTransform = procedure (const bone: PNewtonRagDollBone); cdecl;
}
PNewtonGetBuoyancyPlane = function(const collisionID: integer; context: Pointer; const globalSpaceMatrix: Pfloat; globalSpacePlane: Pfloat): integer; cdecl;
{
PNewtonVehicleTireUpdate = procedure(const vehicle: PNewtonJoint; timestep: float); cdecl;
}
PNewtonWorldRayPrefilterCallback = function (const body: PNewtonBody; const collision: PNewtonCollision; userData: Pointer): longword; cdecl;
PNewtonWorldRayFilterCallback = function(const body: PNewtonBody; const hitNormal: Pfloat; collisionID: integer; userData: Pointer; integerersetParam: float): float; cdecl;
// changed in 2.0
// PNewtonContactBegin -> NewtonOnAABBOverlap
PNewtonOnAABBOverlap = function (const material: PNewtonMaterial; const body0: PNewtonBody; const body1: PNewtonBody; threadindex: integer): integer; cdecl;
// typedef int ( *NewtonOnAABBOverlap) (const NewtonMaterial* material, const NewtonBody* body0, const NewtonBody* body1, int threadIndex);
// changed in 2.0
PNewtonContactsProcess = function (const contact: PNewtonJoint; timestep: float; threadindex: integer): integer; cdecl;
// removed in 2.0
// PNewtonContactEnd = procedure (const material: PNewtonMaterial; const body0: PNewtonBody; const body1: PNewtonBody; threadindex: integer); cdecl;
PNewtonBodyIterator = procedure( const body: PNewtonBody; userData: pointer); cdecl;
PNewtonJointIterator = procedure( const joint: PNewtonJoint; userData: pointer); cdecl;
PNewtonCollisionIterator = procedure( const userdata: Pointer; vertexCount: integer; const FaceArray: Pfloat; faceId: integer); cdecl;
PNewtonBallCallBack = procedure (const ball: PNewtonJoint; timestep: float); cdecl;
PNewtonHingeCallBack = function (const hinge: PNewtonJoint; desc: PNewtonHingeSliderUpdateDesc): unsigned; cdecl;
PNewtonSliderCallBack = function (const slider: PNewtonJoint; desc: PNewtonHingeSliderUpdateDesc): unsigned; cdecl;
PNewtonUniversalCallBack = function (const universal: PNewtonJoint; desc: PNewtonHingeSliderUpdateDesc): unsigned; cdecl;
PNewtonCorkscrewCallBack = function (const corkscrew: PNewtonJoint; desc: PNewtonHingeSliderUpdateDesc): unsigned; cdecl;
PNewtonUserBilateralCallBack = procedure (const userJoint: PNewtonJoint; timestep: float; threadindex: integer); cdecl;
PNewtonUserBilateralGetInfoCallBack = procedure (const userJoint: PNewtonJoint; info: PNewtonJointRecord); cdecl;
PNewtonConstraintDestructor = procedure (const me: PNewtonJoint); cdecl;
// **********************************************************************************************
//
// world control functions
//
// **********************************************************************************************
function NewtonWorldGetVersion(): integer; cdecl; external newtondll;
function NewtonWorldFloatSize(): integer; cdecl; external newtondll;
function NewtonGetMemoryUsed (): integer; cdecl; external newtondll;
procedure NewtonSetMemorySystem (malloc: PNewtonAllocMemory; mfree: PNewtonFreeMemory); cdecl; external newtondll;
function NewtonCreate (): PNewtonWorld; cdecl; external newtondll;
procedure NewtonDestroy (const newtonWorld: PNewtonWorld); cdecl; external newtondll;
procedure NewtonDestroyAllBodies (const newtonWorld: PNewtonWorld); cdecl; external newtondll;
procedure NewtonUpdate (const newtonWorld: PNewtonWorld; timestep: float); cdecl; external newtondll;
procedure NewtonInvalidateCache (const newtonWorld: PNewtonWorld); cdecl; external newtondll;
procedure NewtonCollisionUpdate (const newtonWorld: PNewtonWorld); cdecl; external newtondll;
procedure NewtonSetSolverModel (const newtonWorld: PNewtonWorld; model: integer); cdecl; external newtondll;
procedure NewtonSetPlatformArchitecture (const newtonWorld: PNewtonWorld; mode: integer); cdecl; external newtondll;
function NewtonGetPlatformArchitecture(const newtonWorld: PNewtonWorld; description: pchar): integer; cdecl; external newtondll;
procedure NewtonSetMultiThreadSolverOnSingleIsland (const newtonWorld: PNewtonWorld; mode: integer); cdecl; external newtondll;
function NewtonGetMultiThreadSolverOnSingleIsland (const newtonWorld: PNewtonWorld): integer; cdecl; external newtondll;
procedure NewtonSetPerformanceClock (const newtonWorld: PNewtonWorld; callback: PNewtonGetTicksCountCallback); cdecl; external newtondll;
{
NEWTON_API void NewtonSetPerformanceClock (const NewtonWorld* newtonWorld, NewtonGetTicksCountCallback callback);
NEWTON_API unsigned NewtonReadPerformanceTicks (const NewtonWorld* newtonWorld, unsigned performanceEntry);
NEWTON_API unsigned NewtonReadThreadPerformanceTicks (const NewtonWorld* newtonWorld, unsigned threadIndex);
}
procedure NewtonWorldCriticalSectionLock (const newtonWorld: PNewtonWorld); cdecl; external newtondll;
procedure NewtonWorldCriticalSectionUnlock (const newtonWorld: PNewtonWorld); cdecl; external newtondll;
function NewtonReadPerformaceTicks (const newtonWorld: PNewtonWorld; performanceEntry: longword): longword; cdecl; external newtondll;
procedure NewtonSetThreadsCount (const newtonWorld: PNewtonWorld; threads: integer); cdecl; external newtondll;
function NewtonGetThreadsCount(const newtonWorld: PNewtonWorld): integer; cdecl; external newtondll;
function NewtonGetMaxThreadsCount(const newtonWorld: PNewtonWorld): integer; cdecl; external newtondll;
procedure NewtonSetFrictionModel (const newtonWorld: PNewtonWorld; model: integer); cdecl; external newtondll;
procedure NewtonSetMinimumFrameRate (const newtonWorld: PNewtonWorld; frameRate: float); cdecl; external newtondll;
procedure NewtonSetBodyLeaveWorldEvent (const newtonWorld: PNewtonWorld; callback: PNewtonBodyLeaveWorld); cdecl; external newtondll;
procedure NewtonSetWorldSize (const newtonWorld: PNewtonWorld; const minPoint: Pfloat; const maxPoint: Pfloat); cdecl; external newtondll;
procedure NewtonSetIslandUpdateEvent (const newtonWorld: PNewtonWorld; islandUpdate: PNewtonIslandUpdate); cdecl; external newtondll;
procedure NewtonSetCollisionDestructor (const newtonWorld: PNewtonWorld; callback: pNewtonCollisionDestructor); cdecl; external newtondll;
procedure NewtonSetDestroyBodyByExeciveForce (const newtonWorld: PNewtonWorld; callback: pNewtonDestroyBodyByExeciveForce); cdecl; external newtondll;
// DP2.0 procedure NewtonWorldFreezeBody (const newtonWorld: PNewtonWorld; const body: PNewtonBody); cdecl; external newtondll;
// DP2.0 procedure NewtonWorldUnfreezeBody (const newtonWorld: PNewtonWorld; const body: PNewtonBody); cdecl; external newtondll;
// removed in 2.0 beta 16
// procedure NewtonWorldForEachBodyDo (const newtonWorld: PNewtonWorld; callback: PNewtonBodyIterator); cdecl; external newtondll;
// new 2.0
procedure NewtonWorldForEachJointDo (const newtonWorld: PNewtonWorld; callback: PNewtonJointIterator; userdata: pointer); cdecl; external newtondll;
// added in 1.53?
procedure NewtonWorldForEachBodyInAABBDo (const newtonWorld: PNewtonWorld; const p0: Pfloat; const p1: Pfloat; callback: PNewtonBodyIterator; userdata: pointer); cdecl; external newtondll;
procedure NewtonWorldSetUserData (const newtonWorld: PNewtonWorld; userData: Pointer); cdecl; external newtondll;
function NewtonWorldGetUserData (const newtonWorld: PNewtonWorld): pointer; cdecl; external newtondll;
procedure NewtonWorldSetDestructorCallBack (const newtonWorld: PNewtonWorld; NewtonDestroyWorld: PNewtonDestroyWorld); cdecl; external newtondll; // 2.04
function NewtonWorldGetDestructorCallBack (const newtonWorld: PNewtonWorld): PNewtonDestroyWorld; cdecl; external newtondll; // 2.04
procedure NewtonWorldRayCast (const newtonWorld: PNewtonWorld; const p0: Pfloat; const p1: Pfloat; filter: PNewtonWorldRayFilterCallback; userData: Pointer; prefilter: PNewtonBodyIterator); cdecl; external newtondll;
// new 2.0
function NewtonWorldConvexCast (const newtonWorld: PNewtonWorld; const matrix: PFloat; const target: PFloat; const shape: PNewtonCollision; hitParam: PFloat; userData: Pointer;
prefilter: PNewtonWorldRayPrefilterCallback; info: PNewtonWorldConvexCastReturnInfo; maxContactsCount: integer; threadIndex: integer): integer; cdecl; external newtondll;
// world utility functions
// new 2.0
function NewtonWorldGetBodyCount(const newtonWorld: PNewtonWorld): integer; cdecl; external newtondll;
function NewtonWorldGetConstraintCount(const newtonWorld: PNewtonWorld): integer; cdecl; external newtondll;
// deprecated in 1.53 or 2.0?
// NEWTON_API int NewtonGetActiveBodiesCount();
// NEWTON_API int NewtonGetActiveConstraintsCount();
// NEWTON_API dFloat NewtonGetGlobalScale (const newtonWorld: PNewtonWorld);
// **********************************************************************************************
//
// Simulation islands
//
// **********************************************************************************************
// new 2.0
function NewtonIslandGetBody (const island: pointer; bodyIndex: integer): PNewtonBody; cdecl; external newtondll;
procedure NewtonIslandGetBodyAABB (const island: pointer; bodyIndex: integer; const p0: Pfloat; const p1: Pfloat); cdecl; external newtondll;
// **********************************************************************************************
//
// Physics Material Section
//
// **********************************************************************************************
function NewtonMaterialCreateGroupID(const newtonWorld: PNewtonWorld): integer; cdecl; external newtondll;
function NewtonMaterialGetDefaultGroupID(const newtonWorld: PNewtonWorld): integer; cdecl; external newtondll;
procedure NewtonMaterialDestroyAllGroupID(const newtonWorld: PNewtonWorld); cdecl; external newtondll;
// material definitions that can not be overwritten in function callback
function NewtonMaterialGetUserData (const newtonWorld: PNewtonWorld; id0: integer; id1: integer): Pointer; cdecl; external newtondll;
// new 2.0
procedure NewtonMaterialSetSurfaceThickness (const newtonWorld: PNewtonWorld; id0: integer; id1: integer; thickness: Float); cdecl; external newtondll;
// 1.30
procedure NewtonMaterialSetContinuousCollisionMode (const newtonWorld: PNewtonWorld; id0: integer; id1: integer; state: integer); cdecl; external newtondll;
// changed in 2.0
procedure NewtonMaterialSetCollisionCallback (const newtonWorld: PNewtonWorld; id0: integer; id1: integer; userData: Pointer;
begin_: PNewtonOnAABBOverlap; process: PNewtonContactsProcess{; end_: PNewtonContactEnd}); cdecl; external newtondll;
// material definitions that can be overwritten in function callback
procedure NewtonMaterialSetDefaultSoftness (const newtonWorld: PNewtonWorld; id0: integer; id1: integer; value: float); cdecl; external newtondll;
procedure NewtonMaterialSetDefaultElasticity (const newtonWorld: PNewtonWorld; id0: integer; id1: integer; elasticCoef: float); cdecl; external newtondll;
procedure NewtonMaterialSetDefaultCollidable (const newtonWorld: PNewtonWorld; id0: integer; id1: integer; state: integer); cdecl; external newtondll;
procedure NewtonMaterialSetDefaultFriction (const newtonWorld: PNewtonWorld; id0: integer; id1: integer; staticFriction: float; kineticFriction: float); cdecl; external newtondll;
function NewtonWorldGetFirstMaterial (const newtonWorld: PNewtonWorld): PNewtonMaterial; cdecl; external newtondll;
function NewtonWorldGetNextMaterial (const newtonWorld: PNewtonWorld; const material: PNewtonMaterial): PNewtonMaterial; cdecl; external newtondll;
function NewtonWorldGetFirstBody (const newtonWorld: PNewtonWorld): PNewtonBody; cdecl; external newtondll;
function NewtonWorldGetNextBody (const newtonWorld: PNewtonWorld; const curBody: PNewtonBody): PNewtonBody; cdecl; external newtondll;
// **********************************************************************************************
//
// Physics Contact control functions
//
// **********************************************************************************************
// dp 2.0 beta 13 procedure NewtonMaterialDisableContact (const material: PNewtonMaterial); cdecl; external newtondll;
// dp 2.0 beta 13 Function NewtonMaterialGetCurrentTimestep (const material: PNewtonMaterial): float ; cdecl; external newtondll;
Function NewtonMaterialGetMaterialPairUserData (const material: PNewtonMaterial): Pointer; cdecl; external newtondll;
Function NewtonMaterialGetBodyCollisionID (const material: PNewtonMaterial; const body: PNewtonBody): unsigned ; cdecl; external newtondll;
Function NewtonMaterialGetContactFaceAttribute (const material: PNewtonMaterial): unsigned ; cdecl; external newtondll;
// changed in 2.0
Function NewtonMaterialGetContactNormalSpeed (const material: PNewtonMaterial): float ; cdecl; external newtondll;
procedure NewtonMaterialGetContactForce (const material: PNewtonMaterial; const body: PNewtonBody; const force: Pfloat); cdecl; external newtondll;
procedure NewtonMaterialGetContactPositionAndNormal (const material: PNewtonMaterial; const body: PNewtonBody; const posit: Pfloat; const normal: Pfloat); cdecl; external newtondll;
procedure NewtonMaterialGetContactTangentDirections (const material: PNewtonMaterial; const body: PNewtonBody; const dir0: Pfloat; const dir1: Pfloat); cdecl; external newtondll;
// changed in 2.0
Function NewtonMaterialGetContactTangentSpeed (const material: PNewtonMaterial; index: integer): float ; cdecl; external newtondll;
procedure NewtonMaterialSetContactSoftness (const material: PNewtonMaterial; softness: float); cdecl; external newtondll;
procedure NewtonMaterialSetContactElasticity (const material: PNewtonMaterial; restitution: float); cdecl; external newtondll;
procedure NewtonMaterialSetContactFrictionState (const material: PNewtonMaterial; state: integer; index: integer); cdecl; external newtondll;
procedure NewtonMaterialSetContactFrictionCoef (const material: PNewtonMaterial; coef: float; index: integer); cdecl; external newtondll;
// dp 2.0 beta 13 procedure NewtonMaterialSetContactKineticFrictionCoef (const material: PNewtonMaterial; coef: float; index: integer); cdecl; external newtondll;
// 1.30
procedure NewtonMaterialSetContactNormalAcceleration (const material: PNewtonMaterial; accel: float); cdecl; external newtondll;
// 1.30
procedure NewtonMaterialSetContactNormalDirection (const material: PNewtonMaterial; const directionVector: Pfloat); cdecl; external newtondll;
procedure NewtonMaterialSetContactTangentAcceleration (const material: PNewtonMaterial; accel: float; index: integer); cdecl; external newtondll;
procedure NewtonMaterialContactRotateTangentDirections (const material: PNewtonMaterial; const directionVector: Pfloat); cdecl; external newtondll;
// **********************************************************************************************
//
// convex collision primitives creation functions
//
// **********************************************************************************************
Function NewtonCreateNull (const newtonWorld: PNewtonWorld): PNewtonCollision ; cdecl; external newtondll;
Function NewtonCreateSphere (const newtonWorld: PNewtonWorld; radiusX: float; radiusY: float; radiusZ: float; shapeid: integer; const offsetMatrix: Pfloat): PNewtonCollision ; cdecl; external newtondll;
Function NewtonCreateBox (const newtonWorld: PNewtonWorld; dx: float; dy: float; dz: float; shapeid: integer; const offsetMatrix: Pfloat): PNewtonCollision ; cdecl; external newtondll;
Function NewtonCreateCone (const newtonWorld: PNewtonWorld; radius: float; height: float; shapeid: integer; const offsetMatrix: Pfloat): PNewtonCollision ; cdecl; external newtondll;
Function NewtonCreateCapsule (const newtonWorld: PNewtonWorld; radius: float; height: float; shapeid: integer; const offsetMatrix: Pfloat): PNewtonCollision ; cdecl; external newtondll;
Function NewtonCreateCylinder (const newtonWorld: PNewtonWorld; radius: float; height: float; shapeid: integer; const offsetMatrix: Pfloat): PNewtonCollision ; cdecl; external newtondll;
Function NewtonCreateChamferCylinder (const newtonWorld: PNewtonWorld; radius: float; height: float; shapeid: integer; const offsetMatrix: Pfloat): PNewtonCollision ; cdecl; external newtondll;
Function NewtonCreateConvexHull (const newtonWorld: PNewtonWorld; count: integer; vertexCloud: Pfloat; StrideInBytes: integer; tolerance: float; shapeid: integer; const offsetMatrix: Pfloat): PNewtonCollision ; cdecl; external newtondll;
function NewtonCreateConvexHullFromMesh (const newtonWorld: PNewtonWorld; const mesh: PNewtonMesh; tolerance: float; shapeid: integer): PNewtonCollision ; cdecl; external newtondll;
Function NewtonCreateConvexHullModifier (const newtonWorld: PNewtonWorld; const convexHullCollision: PNewtonCollision): PNewtonCollision ; cdecl; external newtondll;
procedure NewtonConvexHullModifierGetMatrix (const convexHullCollision: PNewtonCollision; matrix: Pfloat); cdecl; external newtondll;
procedure NewtonConvexHullModifierSetMatrix (const convexHullCollision: PNewtonCollision; const matrix: Pfloat); cdecl; external newtondll;
function NewtonCollisionIsTriggerVolume(const convexCollision: PNewtonCollision): integer; cdecl; external newtondll;
procedure NewtonCollisionSetAsTriggerVolume(const convexCollision: PNewtonCollision; trigger: integer); cdecl; external newtondll;
procedure NewtonCollisionSetMaxBreakImpactImpulse(const convexHullCollision: PNewtonCollision; maxImpactImpulse: Float); cdecl; external newtondll;
function NewtonCollisionGetMaxBreakImpactImpulse(const convexHullCollision: PNewtonCollision): single; cdecl; external newtondll;
procedure NewtonCollisionSetUserID (const convexCollision: PNewtonCollision; id: unsigned); cdecl; external newtondll; // gone with 2.04, back with 2.06
Function NewtonCollisionGetUserID (const convexCollision: PNewtonCollision): unsigned; cdecl; external newtondll;
function NewtonConvexHullGetFaceIndices (const convexHullCollision: PNewtonCollision; face: integer; faceIndices: pointer): integer; cdecl; external newtondll;
// 1.30
Function NewtonConvexCollisionCalculateVolume (const convexCollision: PNewtonCollision): float ; cdecl; external newtondll;
// 1.30
procedure NewtonConvexCollisionCalculateInertialMatrix (const convexCollision: PNewtonCollision; inertia: Pfloat; origin: Pfloat); cdecl; external newtondll;
// 1.30
procedure NewtonCollisionMakeUnique (const newtonWorld: PNewtonWorld; const collision: PNewtonCollision); cdecl; external newtondll;
procedure NewtonReleaseCollision (const newtonWorld: PNewtonWorld; const collision: PNewtonCollision); cdecl; external newtondll;
// new 2.0
function NewtonAddCollisionReference (const newtonWorld: PNewtonWorld): integer; cdecl; external newtondll;
// **********************************************************************************************
//
// mass/spring/damper collision shape
//
// **********************************************************************************************
// NEWTON_API NewtonCollision* NewtonCreateSoftShape (const NewtonWorld* newtonWorld);
// NEWTON_API void NewtonSoftBodySetMassCount (const NewtonCollision* convexCollision, int count);
// NEWTON_API void NewtonSoftBodySetSpringCount (const NewtonCollision* convexCollision, int count);
// NEWTON_API void NewtonSoftBodySetMass (const NewtonCollision* convexCollision, int index, dFloat mass, dFloat* position);
// NEWTON_API int NewtonSoftBodySetSpring (const NewtonCollision* convexCollision, int index, int mass0, int mass1, dFloat stiffness, dFloat damper);
// NEWTON_API int NewtonSoftBodyGetMassArray (const NewtonCollision* convexCollision, dFloat* masses, dFloat** positions);
// **********************************************************************************************
//
// complex collision primitives creation functions
//
// **********************************************************************************************
function NewtonCreateCompoundCollision (const newtonWorld: PNewtonWorld; count: integer;
const collisionPrimitiveArray: array of PNewtonCollision; shapeid: integer): PNewtonCollision; cdecl; external newtondll;
// new 2.0
//function NewtonCreateCompoundCollisionFromMesh (const newtonWorld: PNewtonWorld; const mesh: PNewtonMesh; concavity: float; maxShapeCount: integer; shapeid: integer): PNewtonCollision; cdecl; external newtondll;
function NewtonCreateCompoundCollisionFromMesh(const newtonWorld: PNewtonWorld; const mesh: PNewtonMesh; maxSubShapesCount: integer; shapeID: integer; subShapeID: integer): PNewtonCollision; cdecl; external newtondll;
{
// **********************************************************************************************
//
// complex breakable collision primitives interface
//
// **********************************************************************************************
// NEWTON_API NewtonCollision* NewtonCreateCompoundBreakable (const NewtonWorld* newtonWorld, int meshCount,
// NewtonMesh* const solids[], NewtonMesh* const splitePlanes[],
// dFloat* const matrixPallete, int* const shapeIDArray, dFloat* const densities,
// int shapeID, int debriID, NewtonCollisionCompoundBreakableCallback callback, void* buildUsedData);
NEWTON_API NewtonCollision* NewtonCreateCompoundBreakable (const NewtonWorld* newtonWorld, int meshCount,
const NewtonMesh* const solids[], const int* const shapeIDArray,
const dFloat* const densities, const int* const internalFaceMaterial,
int shapeID, int debriID, dFloat debriSeparationGap);
NEWTON_API void NewtonCompoundBreakableResetAnchoredPieces (const NewtonCollision* compoundBreakable);
NEWTON_API void NewtonCompoundBreakableSetAnchoredPieces (const NewtonCollision* compoundBreakable, int fixShapesCount, dFloat* const matrixPallete, NewtonCollision** fixedShapesArray);
NEWTON_API int NewtonCompoundBreakableGetVertexCount (const NewtonCollision* compoundBreakable);
NEWTON_API void NewtonCompoundBreakableGetVertexStreams (const NewtonCollision* compoundBreakable, int vertexStrideInByte, dFloat* vertex,
int normalStrideInByte, dFloat* normal, int uvStrideInByte, dFloat* uv);
NEWTON_API NewtonbreakableComponentMesh* NewtonBreakableGetMainMesh (const NewtonCollision* compoundBreakable);
NEWTON_API NewtonbreakableComponentMesh* NewtonBreakableGetFirstComponent (const NewtonCollision* compoundBreakable);
NEWTON_API NewtonbreakableComponentMesh* NewtonBreakableGetNextComponent (const NewtonbreakableComponentMesh* component);
NEWTON_API void NewtonBreakableBeginDelete (const NewtonCollision* compoundBreakable);
NEWTON_API NewtonBody* NewtonBreakableCreateDebrieBody (const NewtonCollision* compoundBreakable, const NewtonbreakableComponentMesh* component);
NEWTON_API void NewtonBreakableDeleteComponent (const NewtonCollision* compoundBreakable, const NewtonbreakableComponentMesh* component);
NEWTON_API void NewtonBreakableEndDelete (const NewtonCollision* compoundBreakable);
NEWTON_API int NewtonBreakableGetComponentsInRadius (const NewtonCollision* compoundBreakable, const dFloat* position, dFloat radius, NewtonbreakableComponentMesh** segments, int maxCount);
NEWTON_API void* NewtonBreakableGetFirstSegment (const NewtonbreakableComponentMesh* breakableComponent);
NEWTON_API void* NewtonBreakableGetNextSegment (const void* segment);
NEWTON_API int NewtonBreakableSegmentGetMaterial (const void* segment);
NEWTON_API int NewtonBreakableSegmentGetIndexCount (const void* segment);
NEWTON_API int NewtonBreakableSegmentGetIndexStream (const NewtonCollision* compoundBreakable, const NewtonbreakableComponentMesh* meshOwner, const void* segment, int* index);
NEWTON_API int NewtonBreakableSegmentGetIndexStreamShort (const NewtonCollision* compoundBreakable, const NewtonbreakableComponentMesh* meshOwner, const void* segment, short int* index);
}
// updated in 2.0
function NewtonCreateUserMeshCollision (const newtonWorld: PNewtonWorld; const minBox: Pfloat;
const maxBox: Pfloat; userData: Pointer; collideCallback: PNewtonUserMeshCollisionCollideCallback;
rayHitCallback: PNewtonUserMeshCollisionRayHitCallback; destroyCallback: PNewtonUserMeshCollisionDestroyCallback;
getInfoCallback: PNewtonUserMeshCollisionGetCollisionInfo; facesInAABBCallback: PNewtonUserMeshCollisionGetFacesInAABB;
shapeid: integer
): PNewtonCollision; cdecl; external newtondll;
{
NEWTON_API NewtonCollision* NewtonCreateSceneCollision (const NewtonWorld* const newtonWorld, int shapeID);
NEWTON_API NewtonSceneProxy* NewtonSceneCollisionCreateProxy (NewtonCollision* const scene, NewtonCollision* collision, const dFloat* const matrix);
NEWTON_API void NewtonSceneCollisionDestroyProxy (NewtonCollision* const scene, NewtonSceneProxy* Proxy);
NEWTON_API void NewtonSceneProxySetMatrix (NewtonSceneProxy* const proxy, const dFloat* matrix);
NEWTON_API void NewtonSceneProxyGetMatrix (NewtonSceneProxy* const proxy, dFloat* matrix);
NEWTON_API void* NewtonSceneGetFirstProxy (NewtonCollision* const scene);
NEWTON_API void* NewtonSceneGetNextProxy (NewtonCollision* const scene, void* const proxy);
}
function NewtonCreateSceneCollision (const newtonWorld: PNewtonWorld; size: Float; shapeid: integer): PNewtonCollision; cdecl; external newtondll;
function NewtonSceneCollisionCreateProxy (scene: PNewtonCollision; collision: PNewtonCollision): PNewtonSceneProxy; cdecl; external newtondll;
procedure NewtonSceneCollisionDestroyProxy (scene: PNewtonCollision; Proxy: PNewtonSceneProxy); cdecl; external newtondll;
procedure NewtonSceneProxySetMatrix (Proxy: PNewtonSceneProxy; const matrix: PFloat); cdecl; external newtondll;
procedure NewtonSceneProxyGetMatrix (Proxy: PNewtonSceneProxy; matrix: PFloat); cdecl; external newtondll;
procedure NewtonSceneCollisionOptimize (scene: PNewtonCollision); cdecl; external newtondll;
// ***********************************************************************************************************
//
// Collision serialization functions
//
// ***********************************************************************************************************
function NewtonCreateCollisionFromSerialization (const newtonWorld: PNewtonWorld; deserializeFunction: PNewtonSerialize; serializeHandle: pointer): PNewtonCollision; cdecl; external newtondll;
procedure NewtonCollisionSerialize (const newtonWorld: PNewtonWorld; const collision: PNewtonCollision; serializeFunction: PNewtonSerialize; serializeHandle: pointer); cdecl; external newtondll;
procedure NewtonCollisionGetInfo (const collision: PNewtonCollision; collisionInfo: PNewtonCollisionInfoRecord); cdecl; external newtondll;
// deprecated in 2.0 procedure NewtonTreeCollisionSerialize (const treeCollision: PNewtonCollision; serializeFunction: PNewtonSerialize; serializeHandle: Pointer); cdecl; external newtondll;
// deprecated in 2.0 Function NewtonCreateTreeCollisionFromSerialization (const newtonWorld: PNewtonWorld; userCallback: PNewtonTreeCollisionCallback; deserializeFunction: PNewtonDeserialize; serializeHandle: Pointer): PNewtonCollision; cdecl; external newtondll;
// **********************************************************************************************
//
// Static collision shapes functions
//
// **********************************************************************************************
// new 2.0
function NewtonCreateHeightFieldCollision (const newtonWorld: PNewtonWorld; width, height, gridsDiagonals: integer;
elevationMap: word; atributeMap: pointer;
horizontalScale, verticalScale: float; shapeid: integer): PNewtonCollision; cdecl; external newtondll;
// new 2.0, DP 2.0 beta 11
// function NewtonHeightFieldCollisionGetVertexListIndexListInAABB (const hightField: PNewtonCollision; const p0, p1: Pfloat; const vertexArrayOut: Pfloat; vertexCount: Pinteger; vertexStrideInBytes: Pinteger; const indexList: Pinteger; maxIndexCount: integer; const faceAttribute: Pinteger): integer; cdecl; external newtondll;
Function NewtonCreateTreeCollision (const newtonWorld: PNewtonWorld; shapeid: integer): PNewtonCollision; cdecl; external newtondll;
// new 2.0
procedure NewtonTreeCollisionSetUserCallback (const treeCollision: PNewtonCollision; userCallback: PNewtonTreeCollisionCallback); cdecl; external newtondll;
// new 2.0
procedure NewtonTreeCollisionSetUserRayCastCallback (const treeCollision: PNewtonCollision; rayHitCallback: PNewtonCollisionTreeRayCastCallback); cdecl; external newtondll;
procedure NewtonTreeCollisionBeginBuild (const treeCollision: PNewtonCollision); cdecl; external newtondll;
procedure NewtonTreeCollisionAddFace (const treeCollision: PNewtonCollision; vertexCount: integer; const vertexPtr: Pfloat; StrideInBytes: integer; faceAttribute: integer); cdecl; external newtondll;
procedure NewtonTreeCollisionEndBuild (const treeCollision: PNewtonCollision; optimize: integer); cdecl; external newtondll;
Function NewtonTreeCollisionGetFaceAtribute (const treeCollision: PNewtonCollision; const faceIndexArray: Pinteger): integer; cdecl; external newtondll;
procedure NewtonTreeCollisionSetFaceAtribute (const treeCollision: PNewtonCollision; const faceIndexArray: Pinteger;
attribute: integer); cdecl; external newtondll;
// new 2.0
function NewtonTreeCollisionGetVertexListIndexListInAABB (const treeCollision: PNewtonCollision; const p0: Pfloat; const p1: Pfloat; const vertexArray: PFloat; vertexCount: Pinteger; VertexStrideInBytes: Pinteger; const indexList: Pinteger; maxIndexCount: integer; const faceAttribute: Pinteger): integer; cdecl; external newtondll;
procedure NewtonStaticCollisionSetDebugCallback (const treeCollision: PNewtonCollision; userCallback: PNewtonTreeCollisionCallback); cdecl; external newtondll;
// **********************************************************************************************
//
// General purpose collision library functions
//
// **********************************************************************************************
// 1.30
function NewtonCollisionPointDistance (const newtonWorld: PNewtonWorld; const Point: Pfloat;
const collision: PNewtonCollision; const matrix: Pfloat; contact: Pfloat; normal: Pfloat; threadindex: integer): integer; cdecl; external newtondll;
// 1.30
function NewtonCollisionClosestPoint (const newtonWorld: PNewtonWorld;
const collisionA: PNewtonCollision; const matrixA: Pfloat; const collisionB: PNewtonCollision; const matrixB: Pfloat;
contactA: Pfloat; contactB: Pfloat; normalAB: Pfloat; threadindex: integer): integer; cdecl; external newtondll;
// 1.30
function NewtonCollisionCollide (const newtonWorld: PNewtonWorld; maxSize: integer;
const collisionA: PNewtonCollision; const matrixA: Pfloat;
const collisionB: PNewtonCollision; const matrixB: Pfloat;
contacts: Pfloat; normals: Pfloat; penetration: Pfloat; threadindex: integer): integer; cdecl; external newtondll;
// 1.30
function NewtonCollisionCollideContinue (const newtonWorld: PNewtonWorld; maxSize: integer; const timestep: float;
const collisionA: PNewtonCollision; const matrixA: Pfloat; const velocA: Pfloat; const omegaA: Pfloat;
const collisionB: PNewtonCollision; const matrixB: Pfloat; const velocB: Pfloat; const omegaB: Pfloat;
timeOfImpact: Pfloat; contacts: Pfloat; normals: Pfloat; penetration: Pfloat; threadindex: integer): integer; cdecl; external newtondll;
// new 2.0
procedure NewtonCollisionSupportVertex (const collision: PNewtonCollision; const dir, vertex: Pfloat); cdecl; external newtondll;
Function NewtonCollisionRayCast (const collision: PNewtonCollision; const p0: Pfloat; const p1: Pfloat; normals: Pfloat; attribute: Pinteger): float ; cdecl; external newtondll;
procedure NewtonCollisionCalculateAABB (const collision: PNewtonCollision; const matrix: Pfloat; p0: Pfloat; p1: Pfloat); cdecl; external newtondll;
procedure NewtonCollisionForEachPolygonDo (const collision: PNewtonCollision; matrix: Pfloat; callback: PNewtonCollisionIterator; userData: pointer); cdecl; external newtondll; // new 2.0
// **********************************************************************************************
//
// transforms utility functions
//
// **********************************************************************************************
procedure NewtonGetEulerAngle (const matrix: Pfloat; const eulersAngles: Pfloat); cdecl; external newtondll;
procedure NewtonSetEulerAngle (const eulersAngles: Pfloat; const matrix: Pfloat); cdecl; external newtondll;
// new 2.0
function NewtonCalculateSpringDamperAcceleration (dt, ks, x, kd, s: float): float; cdecl; external newtondll;
// **********************************************************************************************
//
// body manipulation functions
//
// **********************************************************************************************
function NewtonCreateBody (const newtonWorld: PNewtonWorld; const collision: PNewtonCollision; const matrix: Pfloat): PNewtonBody; cdecl; external newtondll;
procedure NewtonDestroyBody(const newtonWorld: PNewtonWorld; const body: PNewtonBody); cdecl; external newtondll;
procedure NewtonBodyAddForce (const body: PNewtonBody; const force: Pfloat); cdecl; external newtondll;
procedure NewtonBodyAddTorque (const body: PNewtonBody; const torque: Pfloat); cdecl; external newtondll;
// new 2.0
procedure NewtonBodyCalculateInverseDynamicsForce (const body: PNewtonBody; timestep: float; const desiredVeloc, forceOut: Pfloat); cdecl; external newtondll;
procedure NewtonBodySetMatrix (const body: PNewtonBody; const matrix: Pfloat); cdecl; external newtondll;
procedure NewtonBodySetMatrixRecursive (const body: PNewtonBody; const matrix: Pfloat); cdecl; external newtondll;
procedure NewtonBodySetMassMatrix (const body: PNewtonBody; mass: float; Ixx: float; Iyy: float; Izz: float); cdecl; external newtondll;
procedure NewtonBodySetMaterialGroupID (const body: PNewtonBody; id: integer); cdecl; external newtondll;
procedure NewtonBodySetContinuousCollisionMode (const body: PNewtonBody; state: unsigned); cdecl; external newtondll;
procedure NewtonBodySetJointRecursiveCollision (const body: PNewtonBody; state: unsigned); cdecl; external newtondll;
procedure NewtonBodySetOmega (const body: PNewtonBody; const omega: Pfloat); cdecl; external newtondll;
procedure NewtonBodySetVelocity (const body: PNewtonBody; const velocity: Pfloat); cdecl; external newtondll;
procedure NewtonBodySetForce (const body: PNewtonBody; const force: Pfloat); cdecl; external newtondll;
procedure NewtonBodySetTorque (const body: PNewtonBody; const torque: Pfloat); cdecl; external newtondll;
// 1.3
procedure NewtonBodySetCentreOfMass (const body: PNewtonBody; const com: Pfloat); cdecl; external newtondll;
procedure NewtonBodySetLinearDamping (const body: PNewtonBody; linearDamp: float); cdecl; external newtondll;
procedure NewtonBodySetAngularDamping (const body: PNewtonBody; const angularDamp: Pfloat); cdecl; external newtondll;
procedure NewtonBodySetUserData (const body: PNewtonBody; userData: Pointer); cdecl; external newtondll;
procedure NewtonBodySetCollision (const body: PNewtonBody; const collision: PNewtonCollision); cdecl; external newtondll;
// changed 2.0 NewtonBodyGetAutoFreeze -> NewtonBodyGetAutoSleep
// changed 2.0 NewtonBodyGetSleepingState -> NewtonBodyGetFreezeState
function NewtonBodyGetSleepState (const body: PNewtonBody): integer; cdecl; external newtondll;
function NewtonBodyGetAutoSleep (const body: PNewtonBody): integer; cdecl; external newtondll;
procedure NewtonBodySetAutoSleep (const body: PNewtonBody; state: integer); cdecl; external newtondll;
function NewtonBodyGetFreezeState(const body: PNewtonBody): integer; cdecl; external newtondll;
procedure NewtonBodySetFreezeState (const body: PNewtonBody; state: integer); cdecl; external newtondll;
// deprecated in 2.0 procedure NewtonBodySetAutoFreeze (const body: PNewtonBody; state: integer); cdecl; external newtondll;
// deprecated in 2.0 procedure NewtonBodyCoriolisForcesMode (const body: PNewtonBody; mode: integer); cdecl; external newtondll;
// deprecated in 1.53? NEWTON_API void NewtonBodySetGyroscopicForcesMode (const NewtonBody* body, int mode);
// deprecated in 1.53? NEWTON_API int NewtonBodyGetGyroscopicForcesMode (const NewtonBody* body);
// deprecated in 1.53? NEWTON_API int NewtonBodyGetFreezeState (const NewtonBody* body);
// deprecated in 1.53? NEWTON_API void NewtonBodySetFreezeState (const NewtonBody* body, int state);
// deprecated in 2.0 procedure NewtonBodyGetFreezeTreshold (const body: PNewtonBody; freezeSpeed2: Pfloat; freezeOmega2: Pfloat); cdecl; external newtondll;
// deprecated in 2.0 procedure ??????????????? (const body: PNewtonBody; freezeSpeed2: float; freezeOmega2: float; framesCount: integer); cdecl; external newtondll;
// deprecated in 2.0 procedure NewtonBodySetAutoactiveCallback (const body: PNewtonBody; callback: PNewtonBodyActivationState); cdecl; external newtondll;
procedure NewtonBodySetDestructorCallback (const body: PNewtonBody; callback: PNewtonBodyDestructor); cdecl; external newtondll;
procedure NewtonBodySetTransformCallback (const body: PNewtonBody; callback: PNewtonSetTransform); cdecl; external newtondll;
function NewtonBodyGetTransformCallback (const body: PNewtonBody): PNewtonSetTransform; cdecl; external newtondll;
procedure NewtonBodySetForceAndTorqueCallback (const body: PNewtonBody; callback: PNewtonApplyForceAndTorque); cdecl; external newtondll;
// 1.3
function NewtonBodyGetForceAndTorqueCallback (const body: PNewtonBody): PNewtonApplyForceAndTorque; cdecl; external newtondll;
function NewtonBodyGetUserData (const body: PNewtonBody): Pointer; cdecl; external newtondll;
function NewtonBodyGetWorld (const body: PNewtonBody): PNewtonWorld; cdecl; external newtondll;
Function NewtonBodyGetCollision (const body: PNewtonBody): PNewtonCollision ; cdecl; external newtondll;
Function NewtonBodyGetMaterialGroupID (const body: PNewtonBody): integer; cdecl; external newtondll;
// added 1.3
Function NewtonBodyGetContinuousCollisionMode (const body: PNewtonBody): integer; cdecl; external newtondll;
Function NewtonBodyGetJointRecursiveCollision (const body: PNewtonBody): integer; cdecl; external newtondll;
procedure NewtonBodyGetMatrix(const body: PNewtonBody; matrix: Pfloat); cdecl; external newtondll;
// new 2.0
procedure NewtonBodyGetRotation(const body: PNewtonBody; matrix: Pfloat); cdecl; external newtondll;
procedure NewtonBodyGetMassMatrix (const body: PNewtonBody; mass: Pfloat; Ixx: Pfloat; Iyy: Pfloat; Izz: Pfloat); cdecl; external newtondll;
procedure NewtonBodyGetInvMass(const body: PNewtonBody; invMass: Pfloat; invIxx: Pfloat; invIyy: Pfloat; invIzz: Pfloat); cdecl; external newtondll;
procedure NewtonBodyGetOmega(const body: PNewtonBody; vector: Pfloat); cdecl; external newtondll;
procedure NewtonBodyGetVelocity(const body: PNewtonBody; vector: Pfloat); cdecl; external newtondll;
procedure NewtonBodyGetForce(const body: PNewtonBody; vector: Pfloat); cdecl; external newtondll;
procedure NewtonBodyGetTorque(const body: PNewtonBody; vector: Pfloat); cdecl; external newtondll;
// added 2.0
procedure NewtonBodyGetForceAcc(const body: PNewtonBody; vector: Pfloat); cdecl; external newtondll;
procedure NewtonBodyGetTorqueAcc(const body: PNewtonBody; vector: Pfloat); cdecl; external newtondll;
// added 1.3
procedure NewtonBodyGetCentreOfMass (const body: PNewtonBody; com: Pfloat); cdecl; external newtondll;
Function NewtonBodyGetLinearDamping (const body: PNewtonBody): float ; cdecl; external newtondll;
// new 2.0
procedure NewtonBodyGetAngularDamping (const body: PNewtonBody; vector: Pfloat); cdecl; external newtondll;
procedure NewtonBodyGetAABB (const body: PNewtonBody; p0: Pfloat; p1: Pfloat); cdecl; external newtondll;
// new 2.0
function NewtonBodyGetFirstJoint (const body: PNewtonBody): PNewtonJoint; cdecl; external newtondll;
// new 2.0
function NewtonBodyGetNextJoint (const body: PNewtonBody; const joint: PNewtonJoint): PNewtonJoint; cdecl; external newtondll;
// new 2.0
function NewtonBodyGetFirstContactJoint (const body: PNewtonBody): PNewtonJoint; cdecl; external newtondll;
// new 2.0
function NewtonBodyGetNextContactJoint (const body: PNewtonBody; const contactJoint: PNewtonJoint): PNewtonJoint; cdecl; external newtondll;
// new 2.0
function NewtonContactJointGetFirstContact (const contactJoint: PNewtonJoint): PNewtonJoint; cdecl; external newtondll;
function NewtonContactJointGetNextContact (const contactJoint: PNewtonJoint; contact: PNewtonJoint): PNewtonJoint; cdecl; external newtondll;
// new 2.0
function NewtonContactJointGetContactCount(const contactJoint: PNewtonJoint): integer; cdecl; external newtondll;
procedure NewtonContactJointRemoveContact(const contactJoint: PNewtonJoint; contact: pointer); cdecl; external newtondll;
// new 2.0
function NewtonContactGetMaterial (const contactJoint: PnewtonJoint): PNewtonMaterial; cdecl; external newtondll;
procedure NewtonBodyAddBuoyancyForce (const body: PNewtonBody; fluidDensity: float;
fluidLinearViscosity: float; fluidAngularViscosity: float;
const gravityVector: Pfloat; Plane: PNewtonGetBuoyancyPlane; context: Pointer); cdecl; external newtondll;
// deprecated in 2.0 procedure NewtonBodyForEachPolygonDo (const body: PNewtonBody; callback: PNewtonCollisionIterator); cdecl; external newtondll;
// new 2.0: renamed NewtonAddBodyImpulse to NewtonBodyAddImpulse
procedure NewtonBodyAddImpulse (const body: PNewtonBody; const PointDeltaVeloc: Pfloat; const PointPosit: Pfloat); cdecl; external newtondll;
// **********************************************************************************************
//
// Common Joint functions
//
// **********************************************************************************************
function NewtonJointGetUserData (const Joint: PNewtonJoint): Pointer; cdecl; external newtondll;
procedure NewtonJointSetUserData (const Joint: PNewtonJoint; userData: Pointer); cdecl; external newtondll;
// new 2.0
function NewtonJointGetBody0 (const Joint: PNewtonJoint): PNewtonBody; cdecl; external newtondll;
function NewtonJointGetBody1 (const Joint: PNewtonJoint): PNewtonBody; cdecl; external newtondll;
// new 2.0
procedure NewtonJointGetInfo (const joint: PNewtonJoint; info: PNewtonJointRecord); cdecl; external newtondll; // new 2.0
function NewtonJointGetCollisionState (const Joint: PNewtonJoint): integer; cdecl; external newtondll;
procedure NewtonJointSetCollisionState (const Joint: PNewtonJoint; state: integer); cdecl; external newtondll;
Function NewtonJointGetStiffness (const Joint: PNewtonJoint): float ; cdecl; external newtondll;
procedure NewtonJointSetStiffness (const Joint: PNewtonJoint; state: float); cdecl; external newtondll;
procedure NewtonDestroyJoint(const newtonWorld: PNewtonWorld; const Joint: PNewtonJoint); cdecl; external newtondll;
procedure NewtonJointSetDestructor (const Joint: PNewtonJoint; destructor_: PNewtonConstraintDestructor); cdecl; external newtondll;
// **********************************************************************************************
//
// Ball and Socket Joint functions
//
// **********************************************************************************************
function NewtonConstraintCreateBall (const newtonWorld: PNewtonWorld; const pivotPoint: Pfloat;
const childBody: PNewtonBody; const parentBody: PNewtonBody): PNewtonJoint; cdecl; external newtondll;
procedure NewtonBallSetUserCallback (const ball: PNewtonJoint; callback: PNewtonBallCallBack); cdecl; external newtondll;
procedure NewtonBallGetJointAngle (const ball: PNewtonJoint; angle: Pfloat); cdecl; external newtondll;
procedure NewtonBallGetJointOmega (const ball: PNewtonJoint; omega: Pfloat); cdecl; external newtondll;
procedure NewtonBallGetJointForce (const ball: PNewtonJoint; force: Pfloat); cdecl; external newtondll;
procedure NewtonBallSetConeLimits (const ball: PNewtonJoint; const pin: Pfloat; maxConeAngle: float; maxTwistAngle: float); cdecl; external newtondll;
// **********************************************************************************************
//
// Hinge Joint functions
//
// **********************************************************************************************
function NewtonConstraintCreateHinge (const newtonWorld: PNewtonWorld;
const pivotPoint: Pfloat; const pinDir: Pfloat;
const childBody: PNewtonBody; const parentBody: PNewtonBody): PNewtonJoint; cdecl; external newtondll;
procedure NewtonHingeSetUserCallback (const hinge: PNewtonJoint; callback: PNewtonHingeCallBack); cdecl; external newtondll;
Function NewtonHingeGetJointAngle (const hinge: PNewtonJoint): float ; cdecl; external newtondll;
Function NewtonHingeGetJointOmega (const hinge: PNewtonJoint): float ; cdecl; external newtondll;
procedure NewtonHingeGetJointForce (const hinge: PNewtonJoint; force: Pfloat); cdecl; external newtondll;
Function NewtonHingeCalculateStopAlpha (const hinge: PNewtonJoint; const desc: PNewtonHingeSliderUpdateDesc; angle: float): float ; cdecl; external newtondll;
// **********************************************************************************************
//
// Slider Joint functions
//
// **********************************************************************************************
function NewtonConstraintCreateSlider (const newtonWorld: PNewtonWorld;
const pivotPoint: Pfloat; const pinDir: Pfloat;
const childBody: PNewtonBody; const parentBody: PNewtonBody): PNewtonJoint; cdecl; external newtondll;
procedure NewtonSliderSetUserCallback (const slider: PNewtonJoint; callback: PNewtonSliderCallBack); cdecl; external newtondll;
Function NewtonSliderGetJointPosit (const slider: PNewtonJoint): float ; cdecl; external newtondll;
Function NewtonSliderGetJointVeloc (const slider: PNewtonJoint): float ; cdecl; external newtondll;
procedure NewtonSliderGetJointForce (const slider: PNewtonJoint; force: Pfloat); cdecl; external newtondll;
Function NewtonSliderCalculateStopAccel (const slider: PNewtonJoint; const desc: PNewtonHingeSliderUpdateDesc; position: float): float ; cdecl; external newtondll;
// **********************************************************************************************
//
// Corkscrew Joint functions
//
// **********************************************************************************************
function NewtonConstraintCreateCorkscrew (const newtonWorld: PNewtonWorld;
const pivotPoint: Pfloat; const pinDir: Pfloat;
const childBody: PNewtonBody; const parentBody: PNewtonBody): PNewtonJoint; cdecl; external newtondll;
procedure NewtonCorkscrewSetUserCallback (const corkscrew: PNewtonJoint; callback: PNewtonCorkscrewCallBack); cdecl; external newtondll;
Function NewtonCorkscrewGetJointPosit (const corkscrew: PNewtonJoint): float ; cdecl; external newtondll;
Function NewtonCorkscrewGetJointAngle (const corkscrew: PNewtonJoint): float ; cdecl; external newtondll;
Function NewtonCorkscrewGetJointVeloc (const corkscrew: PNewtonJoint): float ; cdecl; external newtondll;
Function NewtonCorkscrewGetJointOmega (const corkscrew: PNewtonJoint): float ; cdecl; external newtondll;
procedure NewtonCorkscrewGetJointForce (const corkscrew: PNewtonJoint; force: Pfloat); cdecl; external newtondll;
Function NewtonCorkscrewCalculateStopAlpha (const corkscrew: PNewtonJoint; const desc: PNewtonHingeSliderUpdateDesc; angle: float): float ; cdecl; external newtondll;
Function NewtonCorkscrewCalculateStopAccel (const corkscrew: PNewtonJoint; const desc: PNewtonHingeSliderUpdateDesc; position: float): float ; cdecl; external newtondll;
// **********************************************************************************************
//
// Universal Joint functions
//
// **********************************************************************************************
function NewtonConstraintCreateUniversal (const newtonWorld: PNewtonWorld;
const pivotPoint: Pfloat; const pinDir0: Pfloat; const pinDir1: Pfloat;
const childBody: PNewtonBody; const parentBody: PNewtonBody): PNewtonJoint; cdecl; external newtondll;
procedure NewtonUniversalSetUserCallback (const universal: PNewtonJoint; callback: PNewtonUniversalCallBack); cdecl; external newtondll;
Function NewtonUniversalGetJointAngle0 (const universal: PNewtonJoint): float ; cdecl; external newtondll;
Function NewtonUniversalGetJointAngle1 (const universal: PNewtonJoint): float ; cdecl; external newtondll;
Function NewtonUniversalGetJointOmega0 (const universal: PNewtonJoint): float ; cdecl; external newtondll;
Function NewtonUniversalGetJointOmega1 (const universal: PNewtonJoint): float ; cdecl; external newtondll;
procedure NewtonUniversalGetJointForce (const universal: PNewtonJoint; force: Pfloat); cdecl; external newtondll;
Function NewtonUniversalCalculateStopAlpha0 (const universal: PNewtonJoint; const desc: PNewtonHingeSliderUpdateDesc; angle: float): float ; cdecl; external newtondll;
Function NewtonUniversalCalculateStopAlpha1 (const universal: PNewtonJoint; const desc: PNewtonHingeSliderUpdateDesc; angle: float): float ; cdecl; external newtondll;
// **********************************************************************************************
//
// Up vector Joint functions
//
// **********************************************************************************************
function NewtonConstraintCreateUpVector (const newtonWorld: PNewtonWorld; const pinDir: Pfloat; const body: PNewtonBody): PNewtonJoint; cdecl; external newtondll;
procedure NewtonUpVectorGetPin (const upVector: PNewtonJoint; pin: Pfloat); cdecl; external newtondll;
procedure NewtonUpVectorSetPin (const upVector: PNewtonJoint; const pin: Pfloat); cdecl; external newtondll;
// **********************************************************************************************
//
// User defined bilateral Joint
//
// **********************************************************************************************
// ALL USER JOINT ADDED IN 1.30
// changed in 2.0
Function NewtonConstraintCreateUserJoint (const newtonWorld: PNewtonWorld; maxDOF: integer; callback: PNewtonUserBilateralCallBack;
const getInfo: PNewtonUserBilateralGetInfoCallBack;
const childBody: PNewtonBody; const parentBody: PNewtonBody): PNewtonJoint; cdecl; external newtondll;
// new 2.0
procedure NewtonUserJointSetFeedbackCollectorCallback (const Joint: PNewtonJoint; getFeedback: PNewtonUserBilateralCallBack); cdecl; external newtondll;
procedure NewtonUserJointAddLinearRow (const Joint: PNewtonJoint; const pivot0: Pfloat; const pivot1: Pfloat; const dir: Pfloat); cdecl; external newtondll;
procedure NewtonUserJointAddAngularRow (const Joint: PNewtonJoint; relativeAngle: float; const dir: Pfloat); cdecl; external newtondll;
procedure NewtonUserJointAddGeneralRow (const Joint: PNewtonJoint; const jacobian0: Pfloat; const jacobian1: Pfloat); cdecl; external newtondll;
procedure NewtonUserJointSetRowMinimumFriction (const Joint: PNewtonJoint; friction: float); cdecl; external newtondll;
procedure NewtonUserJointSetRowMaximumFriction (const Joint: PNewtonJoint; friction: float); cdecl; external newtondll;
procedure NewtonUserJointSetRowAcceleration (const Joint: PNewtonJoint; acceleration: float); cdecl; external newtondll;
procedure NewtonUserJointSetRowSpringDamperAcceleration (const Joint: PNewtonJoint; springK: float; springD: float); cdecl; external newtondll;
procedure NewtonUserJointSetRowStiffness (const Joint: PNewtonJoint; stiffness: float); cdecl; external newtondll;
Function NewtonUserJointGetRowForce (const Joint: PNewtonJoint; row: integer): float ; cdecl; external newtondll;
// **********************************************************************************************
//
// Mesh joint functions
//
// **********************************************************************************************
function NewtonMeshCreate(const newtonWorld: PNewtonWorld): PNewtonMesh; cdecl; external newtondll;
function NewtonMeshCreateFromMesh(const mesh: PNewtonMesh): PNewtonMesh; cdecl; external newtondll;
function NewtonMeshCreateFromCollision(const collision: PNewtonCollision): PNewtonMesh; cdecl; external newtondll;
function NewtonMeshConvexHull (const world: PNewtonWorld; count: integer; const vertexCloud: PFloat; strideInBytes: integer; tolerance: single): PNewtonMesh; cdecl; external newtondll;
function NewtonMeshCreatePlane (const newtonWorld: PNewtonWorld; const locationMatrix: pfloat; witdth, breadth: float; material: integer; const textureMatrix: pFloat): pNewtonMesh; cdecl; external newtondll;
procedure NewtonMeshDestroy(const PNewtonMeshmesh); cdecl; external newtondll;
procedure NewtonMeshCalculateOOBB(const mesh: pNewtonMesh; matrix: pFloat; x, y, z: pfloat); cdecl; external newtondll;
procedure NewtonMeshCalculateVertexNormals(const mesh: PNewtonMesh; angleInRadians: Float); cdecl; external newtondll;
procedure NewtonMeshApplySphericalMapping(const mesh: PNewtonMesh; material: integer); cdecl; external newtondll;
procedure NewtonMeshApplyBoxMapping(const mesh: PNewtonMesh; front: integer ; side: integer; top: integer); cdecl; external newtondll;
procedure NewtonMeshApplyCylindricalMapping(const mesh: PNewtonMesh; cylinderMaterial: integer; capMaterial: integer); cdecl; external newtondll;
function NewtonMeshIsOpenMesh (const mesh: PNewtonMesh): integer; cdecl; external newtondll;
procedure NewtonMeshFixTJoints (const mesh: PNewtonMesh); cdecl; external newtondll;
procedure NewtonMeshPolygonize (const mesh: pNewtonMesh); cdecl; external newtondll;
procedure NewtonMeshTriangulate (const mesh: pNewtonMesh); cdecl; external newtondll;
function NewtonMeshUnion (const mesh: pNewtonMesh; const clipper: pNewtonMesh; const clipperMatrix: pFloat): pNewtonMesh; cdecl; external newtondll;
function NewtonMeshDifference (const mesh: pNewtonMesh; const clipper: pNewtonMesh; const clipperMatrix: pFloat): pNewtonMesh; cdecl; external newtondll;
function NewtonMeshIntersection (const mesh: pNewtonMesh; const clipper: pNewtonMesh; const clipperMatrix: pFloat): pNewtonMesh; cdecl; external newtondll;
procedure NewtonMeshClip (const mesh: pNewtonMesh; const clipper: pNewtonMesh; const clipperMatrix: pFloat; topMesh: pNewtonMesh; bottomMesh: pNewtonMesh); cdecl; external newtondll;
procedure NewtonRemoveUnusedVertices(const mesh: PNewtonMesh; vertexRemapTable: pointer); cdecl; external newtondll;
{
NEWTON_API void NewtonMeshBeginFace(const NewtonMesh *mesh);
NEWTON_API void NewtonMeshAddFace(const NewtonMesh *mesh, int vertexCount, const dFloat* vertex, int strideInBytes, int materialIndex);