├── .gitignore ├── LICENSE.txt ├── Newton.h ├── README.md ├── dub.json ├── genbinding.py ├── lib ├── x64 │ └── newton.dll └── x86 │ └── newton.dll ├── plugins ├── x64 │ ├── dgNewtonAvx.dll │ ├── dgNewtonAvx2.dll │ └── dgNewtonSse4.2.dll └── x86 │ ├── dgNewtonAvx.dll │ ├── dgNewtonAvx2.dll │ └── dgNewtonSse4.2.dll └── src └── bindbc └── newton ├── binddynamic.d ├── funcs.d ├── package.d └── types.d /.gitignore: -------------------------------------------------------------------------------- 1 | # Static libraries 2 | *.a 3 | *.lib 4 | 5 | # Executables 6 | *.exe 7 | 8 | # DUB 9 | .dub 10 | docs.json 11 | dub.selections.json 12 | __dummy.html 13 | __test__library__ 14 | tests 15 | docs/ 16 | 17 | # Code coverage 18 | *.lst 19 | 20 | # Backup files 21 | *~ 22 | 23 | # Editor files 24 | .vs 25 | 26 | # Python files 27 | __pycache__/ 28 | pyclibrary/ 29 | pyparsing.py 30 | 31 | # Parser cache 32 | Newton.h.cache 33 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019-2022 Timur Gafarov 2 | 3 | Boost Software License - Version 1.0 - August 17th, 2003 4 | 5 | Permission is hereby granted, free of charge, to any person or organization 6 | obtaining a copy of the software and accompanying documentation covered by 7 | this license (the "Software") to use, reproduce, display, distribute, 8 | execute, and transmit the Software, and to prepare derivative works of the 9 | Software, and to permit third-parties to whom the Software is furnished to 10 | do so, all subject to the following: 11 | 12 | The copyright notices in the Software and this entire statement, including 13 | the above license grant, this restriction and the following disclaimer, 14 | must be included in all copies of the Software, in whole or in part, and 15 | all derivative works of the Software, unless such copies or derivative 16 | works are solely in the form of machine-executable object code generated by 17 | a source language processor. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 22 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 23 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 24 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | 27 | -------------------------------------------------------------------------------- /Newton.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) <2003-2019> 2 | * 3 | * This software is provided 'as-is', without any express or implied 4 | * warranty. In no event will the authors be held liable for any damages 5 | * arising from the use of this software. 6 | * 7 | * Permission is granted to anyone to use this software for any purpose, 8 | * including commercial applications, and to alter it and redistribute it 9 | * freely, subject to the following restrictions: 10 | * 11 | * 1. The origin of this software must not be misrepresented; you must not 12 | * claim that you wrote the original software. If you use this software 13 | * in a product, an acknowledgment in the product documentation would be 14 | * appreciated but is not required. 15 | * 16 | * 2. Altered source versions must be plainly marked as such, and must not be 17 | * misrepresented as being the original software. 18 | * 19 | * 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef __NEWTON_H__ 23 | #define __NEWTON_H__ 24 | 25 | 26 | #define NEWTON_MAJOR_VERSION 3 27 | #define NEWTON_MINOR_VERSION 14 28 | 29 | //#include 30 | 31 | #if defined(_MSC_VER) 32 | #define DG_LIBRARY_EXPORT __declspec(dllexport) 33 | #define DG_LIBRARY_IMPORT __declspec(dllimport) 34 | #define DG_LIBRARY_STATIC 35 | #else 36 | #define DG_LIBRARY_EXPORT __attribute__((visibility("default"))) 37 | #define DG_LIBRARY_IMPORT __attribute__((visibility("default"))) 38 | #define DG_LIBRARY_STATIC 39 | #endif 40 | 41 | #ifdef _NEWTON_STATIC_LIB 42 | #define NEWTON_API DG_LIBRARY_STATIC 43 | #elif defined(_NEWTON_BUILD_DLL) 44 | #define NEWTON_API DG_LIBRARY_EXPORT 45 | #else 46 | #define NEWTON_API DG_LIBRARY_IMPORT 47 | #endif 48 | 49 | 50 | #ifndef dLong 51 | #define dLong long long 52 | #endif 53 | 54 | #ifndef dFloat 55 | #ifdef _NEWTON_USE_DOUBLE 56 | #define dFloat double 57 | #else 58 | #define dFloat float 59 | #endif 60 | #endif 61 | 62 | #ifndef dFloat32 63 | #define dFloat32 float 64 | #endif 65 | 66 | #ifndef dFloat64 67 | #define dFloat64 double 68 | #endif 69 | 70 | #ifdef __cplusplus 71 | extern "C" { 72 | #endif 73 | 74 | #define NEWTON_BROADPHASE_DEFAULT 0 75 | #define NEWTON_BROADPHASE_PERSINTENT 1 76 | 77 | #define NEWTON_DYNAMIC_BODY 0 78 | #define NEWTON_KINEMATIC_BODY 1 79 | #define NEWTON_DYNAMIC_ASYMETRIC_BODY 2 80 | // #define NEWTON_DEFORMABLE_BODY 2 81 | 82 | #define SERIALIZE_ID_SPHERE 0 83 | #define SERIALIZE_ID_CAPSULE 1 84 | #define SERIALIZE_ID_CYLINDER 2 85 | #define SERIALIZE_ID_CHAMFERCYLINDER 3 86 | #define SERIALIZE_ID_BOX 4 87 | #define SERIALIZE_ID_CONE 5 88 | #define SERIALIZE_ID_CONVEXHULL 6 89 | #define SERIALIZE_ID_NULL 7 90 | #define SERIALIZE_ID_COMPOUND 8 91 | #define SERIALIZE_ID_TREE 9 92 | #define SERIALIZE_ID_HEIGHTFIELD 10 93 | #define SERIALIZE_ID_CLOTH_PATCH 11 94 | #define SERIALIZE_ID_DEFORMABLE_SOLID 12 95 | #define SERIALIZE_ID_USERMESH 13 96 | #define SERIALIZE_ID_SCENE 14 97 | #define SERIALIZE_ID_FRACTURED_COMPOUND 15 98 | 99 | #ifdef __cplusplus 100 | class NewtonMesh; 101 | class NewtonBody; 102 | class NewtonWorld; 103 | class NewtonJoint; 104 | class NewtonMaterial; 105 | class NewtonCollision; 106 | class NewtonDeformableMeshSegment; 107 | class NewtonFracturedCompoundMeshPart; 108 | #else 109 | typedef struct NewtonMesh NewtonMesh; 110 | typedef struct NewtonBody NewtonBody; 111 | typedef struct NewtonWorld NewtonWorld; 112 | typedef struct NewtonJoint NewtonJoint; 113 | typedef struct NewtonMaterial NewtonMaterial; 114 | typedef struct NewtonCollision NewtonCollision; 115 | typedef struct NewtonDeformableMeshSegment NewtonDeformableMeshSegment; 116 | typedef struct NewtonFracturedCompoundMeshPart NewtonFracturedCompoundMeshPart; 117 | #endif 118 | 119 | typedef union 120 | { 121 | void* m_ptr; 122 | dLong m_int; 123 | dFloat m_float; 124 | } NewtonMaterialData; 125 | 126 | typedef struct NewtonCollisionMaterial 127 | { 128 | dLong m_userId; 129 | NewtonMaterialData m_userData; 130 | NewtonMaterialData m_userParam[6]; 131 | } NewtonCollisionMaterial; 132 | 133 | typedef struct NewtonBoxParam 134 | { 135 | dFloat m_x; 136 | dFloat m_y; 137 | dFloat m_z; 138 | } NewtonBoxParam; 139 | 140 | typedef struct NewtonSphereParam 141 | { 142 | dFloat m_radio; 143 | } NewtonSphereParam; 144 | 145 | 146 | typedef struct NewtonCapsuleParam 147 | { 148 | dFloat m_radio0; 149 | dFloat m_radio1; 150 | dFloat m_height; 151 | } NewtonCapsuleParam; 152 | 153 | typedef struct NewtonCylinderParam 154 | { 155 | dFloat m_radio0; 156 | dFloat m_radio1; 157 | dFloat m_height; 158 | } NewtonCylinderParam; 159 | 160 | typedef struct NewtonConeParam 161 | { 162 | dFloat m_radio; 163 | dFloat m_height; 164 | } NewtonConeParam; 165 | 166 | typedef struct NewtonChamferCylinderParam 167 | { 168 | dFloat m_radio; 169 | dFloat m_height; 170 | } NewtonChamferCylinderParam; 171 | 172 | typedef struct NewtonConvexHullParam 173 | { 174 | int m_vertexCount; 175 | int m_vertexStrideInBytes; 176 | int m_faceCount; 177 | dFloat* m_vertex; 178 | } NewtonConvexHullParam; 179 | 180 | typedef struct NewtonCompoundCollisionParam 181 | { 182 | int m_chidrenCount; 183 | } NewtonCompoundCollisionParam; 184 | 185 | typedef struct NewtonCollisionTreeParam 186 | { 187 | int m_vertexCount; 188 | int m_indexCount; 189 | } NewtonCollisionTreeParam; 190 | 191 | typedef struct NewtonDeformableMeshParam 192 | { 193 | int m_vertexCount; 194 | int m_triangleCount; 195 | int m_vrtexStrideInBytes; 196 | unsigned short *m_indexList; 197 | dFloat *m_vertexList; 198 | } NewtonDeformableMeshParam; 199 | 200 | typedef struct NewtonHeightFieldCollisionParam 201 | { 202 | int m_width; 203 | int m_height; 204 | int m_gridsDiagonals; 205 | int m_elevationDataType; // 0 = 32 bit floats, 1 = unsigned 16 bit integers 206 | dFloat m_verticalScale; 207 | dFloat m_horizonalScale_x; 208 | dFloat m_horizonalScale_z; 209 | void* m_vertialElevation; 210 | char* m_atributes; 211 | } NewtonHeightFieldCollisionParam; 212 | 213 | typedef struct NewtonSceneCollisionParam 214 | { 215 | int m_childrenProxyCount; 216 | } NewtonSceneCollisionParam; 217 | 218 | typedef struct NewtonCollisionInfoRecord 219 | { 220 | dFloat m_offsetMatrix[4][4]; 221 | NewtonCollisionMaterial m_collisionMaterial; 222 | int m_collisionType; // tag id to identify the collision primitive 223 | union { 224 | NewtonBoxParam m_box; 225 | NewtonConeParam m_cone; 226 | NewtonSphereParam m_sphere; 227 | NewtonCapsuleParam m_capsule; 228 | NewtonCylinderParam m_cylinder; 229 | NewtonChamferCylinderParam m_chamferCylinder; 230 | NewtonConvexHullParam m_convexHull; 231 | NewtonDeformableMeshParam m_deformableMesh; 232 | NewtonCompoundCollisionParam m_compoundCollision; 233 | NewtonCollisionTreeParam m_collisionTree; 234 | NewtonHeightFieldCollisionParam m_heightField; 235 | NewtonSceneCollisionParam m_sceneCollision; 236 | dFloat m_paramArray[64]; // user define collision can use this to store information 237 | }; 238 | } NewtonCollisionInfoRecord; 239 | 240 | typedef struct NewtonJointRecord 241 | { 242 | dFloat m_attachmenMatrix_0[4][4]; 243 | dFloat m_attachmenMatrix_1[4][4]; 244 | dFloat m_minLinearDof[3]; 245 | dFloat m_maxLinearDof[3]; 246 | dFloat m_minAngularDof[3]; 247 | dFloat m_maxAngularDof[3]; 248 | const NewtonBody* m_attachBody_0; 249 | const NewtonBody* m_attachBody_1; 250 | dFloat m_extraParameters[64]; 251 | int m_bodiesCollisionOn; 252 | char m_descriptionType[128]; 253 | } NewtonJointRecord; 254 | 255 | typedef struct NewtonUserMeshCollisionCollideDesc 256 | { 257 | dFloat m_boxP0[4]; // lower bounding box of intersection query in local space 258 | dFloat m_boxP1[4]; // upper bounding box of intersection query in local space 259 | dFloat m_boxDistanceTravel[4]; // max distance that box bpxP0 and boxP1 can travel on this timestep, used this for continue collision mode. 260 | int m_threadNumber; // current thread executing this query 261 | int m_faceCount; // the application should set here how many polygons intersect the query box 262 | int m_vertexStrideInBytes; // the application should set here the size of each vertex 263 | dFloat m_skinThickness; // this is the minimum skin separation specified by the material between these two colliding shapes 264 | void* m_userData; // user data passed to the collision geometry at creation time 265 | 266 | NewtonBody* m_objBody; // pointer to the colliding body 267 | NewtonBody* m_polySoupBody; // pointer to the rigid body owner of this collision tree 268 | NewtonCollision* m_objCollision; // collision shape of the colliding body, (no necessarily the collision of m_objBody) 269 | NewtonCollision* m_polySoupCollision; // collision shape of the collision tree, (no necessarily the collision of m_polySoupBody) 270 | 271 | dFloat* m_vertex; // the application should set here the pointer to the global vertex of the mesh. 272 | int* m_faceIndexCount; // the application should set here the pointer to the vertex count of each face. 273 | int* m_faceVertexIndex; // the application should set here the pointer index array for each vertex on a face. 274 | // the format of a face is I0, I1, I2, I3, ..., M, N, E0, E1, E2, ..., A 275 | // I0, I1, I2, .. are the indices to the vertex, relative to m_vertex pointer 276 | // M is the index to the material sub shape id 277 | // N in the index to the vertex normal relative to m_vertex pointer 278 | // 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 279 | // 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. 280 | } NewtonUserMeshCollisionCollideDesc; 281 | 282 | typedef struct NewtonWorldConvexCastReturnInfo 283 | { 284 | dFloat m_point[4]; // collision point in global space 285 | dFloat m_normal[4]; // surface normal at collision point in global space 286 | //dFloat m_normalOnHitPoint[4]; // surface normal at the surface of the hit body, 287 | // is the same as the normal calculated by a ray cast hitting the body at the hit point 288 | dLong m_contactID; // collision ID at contact point 289 | const NewtonBody* m_hitBody; // body hit at contact point 290 | dFloat m_penetration; // contact penetration at collision point 291 | } NewtonWorldConvexCastReturnInfo; 292 | 293 | typedef struct NewtonUserMeshCollisionRayHitDesc 294 | { 295 | dFloat m_p0[4]; // ray origin in collision local space 296 | dFloat m_p1[4]; // ray destination in collision local space 297 | dFloat m_normalOut[4]; // copy here the normal at the ray intersection 298 | dLong m_userIdOut; // copy here a user defined id for further feedback 299 | void* m_userData; // user data passed to the collision geometry at creation time 300 | } NewtonUserMeshCollisionRayHitDesc; 301 | 302 | typedef struct NewtonHingeSliderUpdateDesc 303 | { 304 | dFloat m_accel; 305 | dFloat m_minFriction; 306 | dFloat m_maxFriction; 307 | dFloat m_timestep; 308 | } NewtonHingeSliderUpdateDesc; 309 | 310 | typedef struct NewtonUserContactPoint 311 | { 312 | dFloat m_point[4]; 313 | dFloat m_normal[4]; 314 | dLong m_shapeId0; 315 | dLong m_shapeId1; 316 | dFloat m_penetration; 317 | int m_unused[3]; 318 | } NewtonUserContactPoint; 319 | 320 | 321 | typedef struct NewtonImmediateModeConstraint 322 | { 323 | dFloat m_jacobian01[8][6]; 324 | dFloat m_jacobian10[8][6]; 325 | dFloat m_minFriction[8]; 326 | dFloat m_maxFriction[8]; 327 | dFloat m_jointAccel[8]; 328 | dFloat m_jointStiffness[8]; 329 | } NewtonConstraintDescriptor; 330 | 331 | 332 | // data structure for interfacing with NewtonMesh 333 | typedef struct NewtonMeshDoubleData 334 | { 335 | dFloat64* m_data; 336 | int* m_indexList; 337 | int m_strideInBytes; 338 | } NewtonMeshDoubleData; 339 | 340 | typedef struct NewtonMeshFloatData 341 | { 342 | dFloat* m_data; 343 | int* m_indexList; 344 | int m_strideInBytes; 345 | } NewtonMeshFloatData; 346 | 347 | typedef struct NewtonMeshVertexFormat 348 | { 349 | int m_faceCount; 350 | int* m_faceIndexCount; 351 | int* m_faceMaterial; 352 | NewtonMeshDoubleData m_vertex; 353 | NewtonMeshFloatData m_normal; 354 | NewtonMeshFloatData m_binormal; 355 | NewtonMeshFloatData m_uv0; 356 | NewtonMeshFloatData m_uv1; 357 | NewtonMeshFloatData m_vertexColor; 358 | } NewtonMeshVertexFormat; 359 | 360 | // Newton callback functions 361 | typedef void* (*NewtonAllocMemory) (int sizeInBytes); 362 | typedef void (*NewtonFreeMemory) (void* const ptr, int sizeInBytes); 363 | 364 | typedef void (*NewtonWorldDestructorCallback) (const NewtonWorld* const world); 365 | typedef void (*NewtonPostUpdateCallback) (const NewtonWorld* const world, dFloat timestep); 366 | 367 | typedef void(*NewtonCreateContactCallback) (const NewtonWorld* const newtonWorld, NewtonJoint* const contact); 368 | typedef void(*NewtonDestroyContactCallback) (const NewtonWorld* const newtonWorld, NewtonJoint* const contact); 369 | 370 | typedef void (*NewtonWorldListenerDebugCallback) (const NewtonWorld* const world, void* const listener, void* const debugContext); 371 | typedef void (*NewtonWorldListenerBodyDestroyCallback) (const NewtonWorld* const world, void* const listenerUserData, NewtonBody* const body); 372 | typedef void (*NewtonWorldUpdateListenerCallback) (const NewtonWorld* const world, void* const listenerUserData, dFloat timestep); 373 | typedef void (*NewtonWorldDestroyListenerCallback) (const NewtonWorld* const world, void* const listenerUserData); 374 | 375 | typedef dLong (*NewtonGetTimeInMicrosencondsCallback) (); 376 | 377 | typedef void (*NewtonSerializeCallback) (void* const serializeHandle, const void* const buffer, int size); 378 | typedef void (*NewtonDeserializeCallback) (void* const serializeHandle, void* const buffer, int size); 379 | 380 | typedef void (*NewtonOnBodySerializationCallback) (NewtonBody* const body, void* const userData, NewtonSerializeCallback function, void* const serializeHandle); 381 | typedef void (*NewtonOnBodyDeserializationCallback) (NewtonBody* const body, void* const userData, NewtonDeserializeCallback function, void* const serializeHandle); 382 | 383 | typedef void (*NewtonOnJointSerializationCallback) (const NewtonJoint* const joint, NewtonSerializeCallback function, void* const serializeHandle); 384 | typedef void (*NewtonOnJointDeserializationCallback) (NewtonBody* const body0, NewtonBody* const body1, NewtonDeserializeCallback function, void* const serializeHandle); 385 | 386 | typedef void (*NewtonOnUserCollisionSerializationCallback) (void* const userData, NewtonSerializeCallback function, void* const serializeHandle); 387 | 388 | // user collision callbacks 389 | typedef void (*NewtonUserMeshCollisionDestroyCallback) (void* const userData); 390 | typedef dFloat (*NewtonUserMeshCollisionRayHitCallback) (NewtonUserMeshCollisionRayHitDesc* const lineDescData); 391 | typedef void (*NewtonUserMeshCollisionGetCollisionInfo) (void* const userData, NewtonCollisionInfoRecord* const infoRecord); 392 | typedef int (*NewtonUserMeshCollisionAABBTest) (void* const userData, const dFloat* const boxP0, const dFloat* const boxP1); 393 | typedef int (*NewtonUserMeshCollisionGetFacesInAABB) (void* const userData, const dFloat* const p0, const dFloat* const p1, 394 | const dFloat** const vertexArray, int* const vertexCount, int* const vertexStrideInBytes, 395 | const int* const indexList, int maxIndexCount, const int* const userDataList); 396 | typedef void (*NewtonUserMeshCollisionCollideCallback) (NewtonUserMeshCollisionCollideDesc* const collideDescData, const void* const continueCollisionHandle); 397 | 398 | typedef int (*NewtonTreeCollisionFaceCallback) (void* const context, const dFloat* const polygon, int strideInBytes, const int* const indexArray, int indexCount); 399 | 400 | typedef dFloat (*NewtonCollisionTreeRayCastCallback) (const NewtonBody* const body, const NewtonCollision* const treeCollision, dFloat intersection, dFloat* const normal, int faceId, void* const usedData); 401 | typedef dFloat (*NewtonHeightFieldRayCastCallback) (const NewtonBody* const body, const NewtonCollision* const heightFieldCollision, dFloat intersection, int row, int col, dFloat* const normal, int faceId, void* const usedData); 402 | 403 | typedef void (*NewtonCollisionCopyConstructionCallback) (const NewtonWorld* const newtonWorld, NewtonCollision* const collision, const NewtonCollision* const sourceCollision); 404 | typedef void (*NewtonCollisionDestructorCallback) (const NewtonWorld* const newtonWorld, const NewtonCollision* const collision); 405 | 406 | // collision tree call back (obsoleted no recommended) 407 | typedef void (*NewtonTreeCollisionCallback) (const NewtonBody* const bodyWithTreeCollision, const NewtonBody* const body, int faceID, 408 | int vertexCount, const dFloat* const vertex, int vertexStrideInBytes); 409 | 410 | typedef void (*NewtonBodyDestructor) (const NewtonBody* const body); 411 | typedef void (*NewtonApplyForceAndTorque) (const NewtonBody* const body, dFloat timestep, int threadIndex); 412 | typedef void (*NewtonSetTransform) (const NewtonBody* const body, const dFloat* const matrix, int threadIndex); 413 | 414 | typedef int (*NewtonIslandUpdate) (const NewtonWorld* const newtonWorld, const void* islandHandle, int bodyCount); 415 | 416 | typedef void (*NewtonFractureCompoundCollisionOnEmitCompoundFractured) (NewtonBody* const fracturedBody); 417 | typedef void (*NewtonFractureCompoundCollisionOnEmitChunk) (NewtonBody* const chunkBody, NewtonFracturedCompoundMeshPart* const fracturexChunkMesh, const NewtonCollision* const fracturedCompountCollision); 418 | typedef void (*NewtonFractureCompoundCollisionReconstructMainMeshCallBack) (NewtonBody* const body, NewtonFracturedCompoundMeshPart* const mainMesh, const NewtonCollision* const fracturedCompountCollision); 419 | 420 | typedef unsigned (*NewtonWorldRayPrefilterCallback)(const NewtonBody* const body, const NewtonCollision* const collision, void* const userData); 421 | typedef dFloat (*NewtonWorldRayFilterCallback)(const NewtonBody* const body, const NewtonCollision* const shapeHit, const dFloat* const hitContact, const dFloat* const hitNormal, dLong collisionID, void* const userData, dFloat intersectParam); 422 | 423 | typedef int (*NewtonOnAABBOverlap) (const NewtonJoint* const contact, dFloat timestep, int threadIndex); 424 | typedef void (*NewtonContactsProcess) (const NewtonJoint* const contact, dFloat timestep, int threadIndex); 425 | typedef int (*NewtonOnCompoundSubCollisionAABBOverlap) (const NewtonJoint* const contact, dFloat timestep, const NewtonBody* const body0, const void* const collisionNode0, const NewtonBody* const body1, const void* const collisionNode1, int threadIndex); 426 | typedef int (*NewtonOnContactGeneration) (const NewtonMaterial* const material, const NewtonBody* const body0, const NewtonCollision* const collision0, const NewtonBody* const body1, const NewtonCollision* const collision1, NewtonUserContactPoint* const contactBuffer, int maxCount, int threadIndex); 427 | 428 | typedef int (*NewtonBodyIterator) (const NewtonBody* const body, void* const userData); 429 | typedef void (*NewtonJointIterator) (const NewtonJoint* const joint, void* const userData); 430 | typedef void (*NewtonCollisionIterator) (void* const userData, int vertexCount, const dFloat* const faceArray, int faceId); 431 | 432 | typedef void (*NewtonBallCallback) (const NewtonJoint* const ball, dFloat timestep); 433 | typedef unsigned (*NewtonHingeCallback) (const NewtonJoint* const hinge, NewtonHingeSliderUpdateDesc* const desc); 434 | typedef unsigned (*NewtonSliderCallback) (const NewtonJoint* const slider, NewtonHingeSliderUpdateDesc* const desc); 435 | typedef unsigned (*NewtonUniversalCallback) (const NewtonJoint* const universal, NewtonHingeSliderUpdateDesc* const desc); 436 | typedef unsigned (*NewtonCorkscrewCallback) (const NewtonJoint* const corkscrew, NewtonHingeSliderUpdateDesc* const desc); 437 | 438 | typedef void (*NewtonUserBilateralCallback) (const NewtonJoint* const userJoint, dFloat timestep, int threadIndex); 439 | typedef void (*NewtonUserBilateralGetInfoCallback) (const NewtonJoint* const userJoint, NewtonJointRecord* const info); 440 | 441 | typedef void (*NewtonConstraintDestructor) (const NewtonJoint* const me); 442 | 443 | typedef void (*NewtonJobTask) (NewtonWorld* const world, void* const userData, int threadIndex); 444 | typedef int (*NewtonReportProgress) (dFloat normalizedProgressPercent, void* const userData); 445 | 446 | // ********************************************************************************************** 447 | // 448 | // world control functions 449 | // 450 | // ********************************************************************************************** 451 | NEWTON_API int NewtonWorldGetVersion (); 452 | NEWTON_API int NewtonWorldFloatSize (); 453 | 454 | NEWTON_API int NewtonGetMemoryUsed (); 455 | NEWTON_API void NewtonSetMemorySystem (NewtonAllocMemory malloc, NewtonFreeMemory free); 456 | 457 | NEWTON_API NewtonWorld* NewtonCreate (); 458 | NEWTON_API void NewtonDestroy (const NewtonWorld* const newtonWorld); 459 | NEWTON_API void NewtonDestroyAllBodies (const NewtonWorld* const newtonWorld); 460 | 461 | NEWTON_API NewtonPostUpdateCallback NewtonGetPostUpdateCallback(const NewtonWorld* const newtonWorld); 462 | NEWTON_API void NewtonSetPostUpdateCallback (const NewtonWorld* const newtonWorld, NewtonPostUpdateCallback callback); 463 | 464 | NEWTON_API void* NewtonAlloc (int sizeInBytes); 465 | NEWTON_API void NewtonFree (void* const ptr); 466 | 467 | NEWTON_API void NewtonLoadPlugins(const NewtonWorld* const newtonWorld, const char* const plugInPath); 468 | NEWTON_API void NewtonUnloadPlugins(const NewtonWorld* const newtonWorld); 469 | NEWTON_API void* NewtonCurrentPlugin(const NewtonWorld* const newtonWorld); 470 | NEWTON_API void* NewtonGetFirstPlugin(const NewtonWorld* const newtonWorld); 471 | NEWTON_API void* NewtonGetPreferedPlugin(const NewtonWorld* const newtonWorld); 472 | NEWTON_API void* NewtonGetNextPlugin(const NewtonWorld* const newtonWorld, const void* const plugin); 473 | NEWTON_API const char* NewtonGetPluginString(const NewtonWorld* const newtonWorld, const void* const plugin); 474 | NEWTON_API void NewtonSelectPlugin(const NewtonWorld* const newtonWorld, const void* const plugin); 475 | 476 | NEWTON_API dFloat NewtonGetContactMergeTolerance (const NewtonWorld* const newtonWorld); 477 | NEWTON_API void NewtonSetContactMergeTolerance (const NewtonWorld* const newtonWorld, dFloat tolerance); 478 | 479 | NEWTON_API void NewtonInvalidateCache (const NewtonWorld* const newtonWorld); 480 | 481 | NEWTON_API void NewtonSetSolverIterations (const NewtonWorld* const newtonWorld, int model); 482 | NEWTON_API int NewtonGetSolverIterations(const NewtonWorld* const newtonWorld); 483 | 484 | NEWTON_API void NewtonSetParallelSolverOnLargeIsland (const NewtonWorld* const newtonWorld, int mode); 485 | NEWTON_API int NewtonGetParallelSolverOnLargeIsland (const NewtonWorld* const newtonWorld); 486 | 487 | NEWTON_API int NewtonGetBroadphaseAlgorithm (const NewtonWorld* const newtonWorld); 488 | NEWTON_API void NewtonSelectBroadphaseAlgorithm (const NewtonWorld* const newtonWorld, int algorithmType); 489 | NEWTON_API void NewtonResetBroadphase(const NewtonWorld* const newtonWorld); 490 | 491 | NEWTON_API void NewtonUpdate (const NewtonWorld* const newtonWorld, dFloat timestep); 492 | NEWTON_API void NewtonUpdateAsync (const NewtonWorld* const newtonWorld, dFloat timestep); 493 | NEWTON_API void NewtonWaitForUpdateToFinish (const NewtonWorld* const newtonWorld); 494 | 495 | NEWTON_API int NewtonGetNumberOfSubsteps (const NewtonWorld* const newtonWorld); 496 | NEWTON_API void NewtonSetNumberOfSubsteps (const NewtonWorld* const newtonWorld, int subSteps); 497 | NEWTON_API dFloat NewtonGetLastUpdateTime (const NewtonWorld* const newtonWorld); 498 | 499 | NEWTON_API void NewtonSerializeToFile (const NewtonWorld* const newtonWorld, const char* const filename, NewtonOnBodySerializationCallback bodyCallback, void* const bodyUserData); 500 | NEWTON_API void NewtonDeserializeFromFile (const NewtonWorld* const newtonWorld, const char* const filename, NewtonOnBodyDeserializationCallback bodyCallback, void* const bodyUserData); 501 | 502 | NEWTON_API void NewtonSerializeScene(const NewtonWorld* const newtonWorld, NewtonOnBodySerializationCallback bodyCallback, void* const bodyUserData, 503 | NewtonSerializeCallback serializeCallback, void* const serializeHandle); 504 | NEWTON_API void NewtonDeserializeScene(const NewtonWorld* const newtonWorld, NewtonOnBodyDeserializationCallback bodyCallback, void* const bodyUserData, 505 | NewtonDeserializeCallback serializeCallback, void* const serializeHandle); 506 | 507 | NEWTON_API NewtonBody* NewtonFindSerializedBody(const NewtonWorld* const newtonWorld, int bodySerializedID); 508 | NEWTON_API void NewtonSetJointSerializationCallbacks (const NewtonWorld* const newtonWorld, NewtonOnJointSerializationCallback serializeJoint, NewtonOnJointDeserializationCallback deserializeJoint); 509 | NEWTON_API void NewtonGetJointSerializationCallbacks (const NewtonWorld* const newtonWorld, NewtonOnJointSerializationCallback* const serializeJoint, NewtonOnJointDeserializationCallback* const deserializeJoint); 510 | 511 | // multi threading interface 512 | NEWTON_API void NewtonWorldCriticalSectionLock (const NewtonWorld* const newtonWorld, int threadIndex); 513 | NEWTON_API void NewtonWorldCriticalSectionUnlock (const NewtonWorld* const newtonWorld); 514 | NEWTON_API void NewtonSetThreadsCount (const NewtonWorld* const newtonWorld, int threads); 515 | NEWTON_API int NewtonGetThreadsCount(const NewtonWorld* const newtonWorld); 516 | NEWTON_API int NewtonGetMaxThreadsCount(const NewtonWorld* const newtonWorld); 517 | NEWTON_API void NewtonDispachThreadJob(const NewtonWorld* const newtonWorld, NewtonJobTask task, void* const usedData, const char* const functionName); 518 | NEWTON_API void NewtonSyncThreadJobs(const NewtonWorld* const newtonWorld); 519 | 520 | // atomic operations 521 | NEWTON_API int NewtonAtomicAdd (int* const ptr, int value); 522 | NEWTON_API int NewtonAtomicSwap (int* const ptr, int value); 523 | NEWTON_API void NewtonYield (); 524 | 525 | NEWTON_API void NewtonSetIslandUpdateEvent (const NewtonWorld* const newtonWorld, NewtonIslandUpdate islandUpdate); 526 | NEWTON_API void NewtonWorldForEachJointDo (const NewtonWorld* const newtonWorld, NewtonJointIterator callback, void* const userData); 527 | NEWTON_API void NewtonWorldForEachBodyInAABBDo (const NewtonWorld* const newtonWorld, const dFloat* const p0, const dFloat* const p1, NewtonBodyIterator callback, void* const userData); 528 | 529 | NEWTON_API void NewtonWorldSetUserData (const NewtonWorld* const newtonWorld, void* const userData); 530 | NEWTON_API void* NewtonWorldGetUserData (const NewtonWorld* const newtonWorld); 531 | 532 | NEWTON_API void* NewtonWorldAddListener (const NewtonWorld* const newtonWorld, const char* const nameId, void* const listenerUserData); 533 | NEWTON_API void* NewtonWorldGetListener (const NewtonWorld* const newtonWorld, const char* const nameId); 534 | 535 | NEWTON_API void NewtonWorldListenerSetDebugCallback (const NewtonWorld* const newtonWorld, void* const listener, NewtonWorldListenerDebugCallback callback); 536 | NEWTON_API void NewtonWorldListenerSetPostStepCallback (const NewtonWorld* const newtonWorld, void* const listener, NewtonWorldUpdateListenerCallback callback); 537 | NEWTON_API void NewtonWorldListenerSetPreUpdateCallback (const NewtonWorld* const newtonWorld, void* const listener, NewtonWorldUpdateListenerCallback callback); 538 | NEWTON_API void NewtonWorldListenerSetPostUpdateCallback (const NewtonWorld* const newtonWorld, void* const listener, NewtonWorldUpdateListenerCallback callback); 539 | NEWTON_API void NewtonWorldListenerSetDestructorCallback (const NewtonWorld* const newtonWorld, void* const listener, NewtonWorldDestroyListenerCallback callback); 540 | NEWTON_API void NewtonWorldListenerSetBodyDestroyCallback(const NewtonWorld* const newtonWorld, void* const listener, NewtonWorldListenerBodyDestroyCallback callback); 541 | NEWTON_API void NewtonWorldListenerDebug(const NewtonWorld* const newtonWorld, void* const context); 542 | NEWTON_API void* NewtonWorldGetListenerUserData(const NewtonWorld* const newtonWorld, void* const listener); 543 | NEWTON_API NewtonWorldListenerBodyDestroyCallback NewtonWorldListenerGetBodyDestroyCallback (const NewtonWorld* const newtonWorld, void* const listener); 544 | 545 | NEWTON_API void NewtonWorldSetDestructorCallback (const NewtonWorld* const newtonWorld, NewtonWorldDestructorCallback destructor); 546 | NEWTON_API NewtonWorldDestructorCallback NewtonWorldGetDestructorCallback (const NewtonWorld* const newtonWorld); 547 | NEWTON_API void NewtonWorldSetCollisionConstructorDestructorCallback (const NewtonWorld* const newtonWorld, NewtonCollisionCopyConstructionCallback constructor, NewtonCollisionDestructorCallback destructor); 548 | 549 | NEWTON_API void NewtonWorldSetCreateDestroyContactCallback(const NewtonWorld* const newtonWorld, NewtonCreateContactCallback createContact, NewtonDestroyContactCallback destroyContact); 550 | 551 | NEWTON_API void NewtonWorldRayCast (const NewtonWorld* const newtonWorld, const dFloat* const p0, const dFloat* const p1, NewtonWorldRayFilterCallback filter, void* const userData, NewtonWorldRayPrefilterCallback prefilter, int threadIndex); 552 | NEWTON_API int NewtonWorldConvexCast (const NewtonWorld* const newtonWorld, const dFloat* const matrix, const dFloat* const target, const NewtonCollision* const shape, dFloat* const param, void* const userData, NewtonWorldRayPrefilterCallback prefilter, NewtonWorldConvexCastReturnInfo* const info, int maxContactsCount, int threadIndex); 553 | NEWTON_API int NewtonWorldCollide (const NewtonWorld* const newtonWorld, const dFloat* const matrix, const NewtonCollision* const shape, void* const userData, NewtonWorldRayPrefilterCallback prefilter, NewtonWorldConvexCastReturnInfo* const info, int maxContactsCount, int threadIndex); 554 | 555 | // world utility functions 556 | NEWTON_API int NewtonWorldGetBodyCount(const NewtonWorld* const newtonWorld); 557 | NEWTON_API int NewtonWorldGetConstraintCount(const NewtonWorld* const newtonWorld); 558 | 559 | NEWTON_API NewtonJoint* NewtonWorldFindJoint(const NewtonBody* const body0, const NewtonBody* const body1); 560 | 561 | // ********************************************************************************************** 562 | // 563 | // Simulation islands 564 | // 565 | // ********************************************************************************************** 566 | NEWTON_API NewtonBody* NewtonIslandGetBody (const void* const island, int bodyIndex); 567 | NEWTON_API void NewtonIslandGetBodyAABB (const void* const island, int bodyIndex, dFloat* const p0, dFloat* const p1); 568 | 569 | // ********************************************************************************************** 570 | // 571 | // Physics Material Section 572 | // 573 | // ********************************************************************************************** 574 | NEWTON_API int NewtonMaterialCreateGroupID(const NewtonWorld* const newtonWorld); 575 | NEWTON_API int NewtonMaterialGetDefaultGroupID(const NewtonWorld* const newtonWorld); 576 | NEWTON_API void NewtonMaterialDestroyAllGroupID(const NewtonWorld* const newtonWorld); 577 | 578 | // material definitions that can not be overwritten in function callback 579 | NEWTON_API void* NewtonMaterialGetUserData (const NewtonWorld* const newtonWorld, int id0, int id1); 580 | NEWTON_API void NewtonMaterialSetSurfaceThickness (const NewtonWorld* const newtonWorld, int id0, int id1, dFloat thickness); 581 | 582 | // deprecated, not longer continue collision is set on the material 583 | // NEWTON_API void NewtonMaterialSetContinuousCollisionMode (const NewtonWorld* const newtonWorld, int id0, int id1, int state); 584 | 585 | NEWTON_API void NewtonMaterialSetCallbackUserData (const NewtonWorld* const newtonWorld, int id0, int id1, void* const userData); 586 | NEWTON_API void NewtonMaterialSetContactGenerationCallback (const NewtonWorld* const newtonWorld, int id0, int id1, NewtonOnContactGeneration contactGeneration); 587 | NEWTON_API void NewtonMaterialSetCompoundCollisionCallback(const NewtonWorld* const newtonWorld, int id0, int id1, NewtonOnCompoundSubCollisionAABBOverlap compoundAabbOverlap); 588 | NEWTON_API void NewtonMaterialSetCollisionCallback (const NewtonWorld* const newtonWorld, int id0, int id1, NewtonOnAABBOverlap aabbOverlap, NewtonContactsProcess process); 589 | 590 | NEWTON_API void NewtonMaterialSetDefaultSoftness (const NewtonWorld* const newtonWorld, int id0, int id1, dFloat value); 591 | NEWTON_API void NewtonMaterialSetDefaultElasticity (const NewtonWorld* const newtonWorld, int id0, int id1, dFloat elasticCoef); 592 | NEWTON_API void NewtonMaterialSetDefaultCollidable (const NewtonWorld* const newtonWorld, int id0, int id1, int state); 593 | NEWTON_API void NewtonMaterialSetDefaultFriction (const NewtonWorld* const newtonWorld, int id0, int id1, dFloat staticFriction, dFloat kineticFriction); 594 | 595 | NEWTON_API void NewtonMaterialJointResetIntraJointCollision (const NewtonWorld* const newtonWorld, int id0, int id1); 596 | NEWTON_API void NewtonMaterialJointResetSelftJointCollision (const NewtonWorld* const newtonWorld, int id0, int id1); 597 | 598 | NEWTON_API NewtonMaterial* NewtonWorldGetFirstMaterial (const NewtonWorld* const newtonWorld); 599 | NEWTON_API NewtonMaterial* NewtonWorldGetNextMaterial (const NewtonWorld* const newtonWorld, const NewtonMaterial* const material); 600 | 601 | NEWTON_API NewtonBody* NewtonWorldGetFirstBody (const NewtonWorld* const newtonWorld); 602 | NEWTON_API NewtonBody* NewtonWorldGetNextBody (const NewtonWorld* const newtonWorld, const NewtonBody* const curBody); 603 | 604 | 605 | // ********************************************************************************************** 606 | // 607 | // Physics Contact control functions 608 | // 609 | // ********************************************************************************************** 610 | NEWTON_API void *NewtonMaterialGetMaterialPairUserData (const NewtonMaterial* const material); 611 | NEWTON_API unsigned NewtonMaterialGetContactFaceAttribute (const NewtonMaterial* const material); 612 | NEWTON_API NewtonCollision* NewtonMaterialGetBodyCollidingShape (const NewtonMaterial* const material, const NewtonBody* const body); 613 | NEWTON_API dFloat NewtonMaterialGetContactNormalSpeed (const NewtonMaterial* const material); 614 | NEWTON_API void NewtonMaterialGetContactForce (const NewtonMaterial* const material, const NewtonBody* const body, dFloat* const force); 615 | NEWTON_API void NewtonMaterialGetContactPositionAndNormal (const NewtonMaterial* const material, const NewtonBody* const body, dFloat* const posit, dFloat* const normal); 616 | NEWTON_API void NewtonMaterialGetContactTangentDirections (const NewtonMaterial* const material, const NewtonBody* const body, dFloat* const dir0, dFloat* const dir1); 617 | NEWTON_API dFloat NewtonMaterialGetContactTangentSpeed (const NewtonMaterial* const material, int index); 618 | NEWTON_API dFloat NewtonMaterialGetContactMaxNormalImpact (const NewtonMaterial* const material); 619 | NEWTON_API dFloat NewtonMaterialGetContactMaxTangentImpact (const NewtonMaterial* const material, int index); 620 | NEWTON_API dFloat NewtonMaterialGetContactPenetration (const NewtonMaterial* const material); 621 | NEWTON_API void NewtonMaterialSetAsSoftContact (const NewtonMaterial* const material, dFloat relaxation); 622 | 623 | NEWTON_API void NewtonMaterialSetContactSoftness (const NewtonMaterial* const material, dFloat softness); 624 | NEWTON_API void NewtonMaterialSetContactThickness (const NewtonMaterial* const material, dFloat thickness); 625 | NEWTON_API void NewtonMaterialSetContactElasticity (const NewtonMaterial* const material, dFloat restitution); 626 | NEWTON_API void NewtonMaterialSetContactFrictionState (const NewtonMaterial* const material, int state, int index); 627 | NEWTON_API void NewtonMaterialSetContactFrictionCoef (const NewtonMaterial* const material, dFloat staticFrictionCoef, dFloat kineticFrictionCoef, int index); 628 | 629 | NEWTON_API void NewtonMaterialSetContactNormalAcceleration (const NewtonMaterial* const material, dFloat accel); 630 | NEWTON_API void NewtonMaterialSetContactNormalDirection (const NewtonMaterial* const material, const dFloat* const directionVector); 631 | NEWTON_API void NewtonMaterialSetContactPosition (const NewtonMaterial* const material, const dFloat* const position); 632 | 633 | NEWTON_API void NewtonMaterialSetContactTangentFriction (const NewtonMaterial* const material, dFloat friction, int index); 634 | NEWTON_API void NewtonMaterialSetContactTangentAcceleration (const NewtonMaterial* const material, dFloat accel, int index); 635 | NEWTON_API void NewtonMaterialContactRotateTangentDirections (const NewtonMaterial* const material, const dFloat* const directionVector); 636 | 637 | //NEWTON_API dFloat NewtonMaterialGetContactPruningTolerance (const NewtonBody* const body0, const NewtonBody* const body1); 638 | //NEWTON_API void NewtonMaterialSetContactPruningTolerance (const NewtonBody* const body0, const NewtonBody* const body1, dFloat tolerance); 639 | NEWTON_API dFloat NewtonMaterialGetContactPruningTolerance(const NewtonJoint* const contactJoint); 640 | NEWTON_API void NewtonMaterialSetContactPruningTolerance(const NewtonJoint* const contactJoint, dFloat tolerance); 641 | 642 | // ********************************************************************************************** 643 | // 644 | // convex collision primitives creation functions 645 | // 646 | // ********************************************************************************************** 647 | NEWTON_API NewtonCollision* NewtonCreateNull (const NewtonWorld* const newtonWorld); 648 | NEWTON_API NewtonCollision* NewtonCreateSphere (const NewtonWorld* const newtonWorld, dFloat radius, int shapeID, const dFloat* const offsetMatrix); 649 | NEWTON_API NewtonCollision* NewtonCreateBox (const NewtonWorld* const newtonWorld, dFloat dx, dFloat dy, dFloat dz, int shapeID, const dFloat* const offsetMatrix); 650 | NEWTON_API NewtonCollision* NewtonCreateCone (const NewtonWorld* const newtonWorld, dFloat radius, dFloat height, int shapeID, const dFloat* const offsetMatrix); 651 | NEWTON_API NewtonCollision* NewtonCreateCapsule (const NewtonWorld* const newtonWorld, dFloat radius0, dFloat radius1, dFloat height, int shapeID, const dFloat* const offsetMatrix); 652 | NEWTON_API NewtonCollision* NewtonCreateCylinder (const NewtonWorld* const newtonWorld, dFloat radio0, dFloat radio1, dFloat height, int shapeID, const dFloat* const offsetMatrix); 653 | NEWTON_API NewtonCollision* NewtonCreateChamferCylinder (const NewtonWorld* const newtonWorld, dFloat radius, dFloat height, int shapeID, const dFloat* const offsetMatrix); 654 | NEWTON_API NewtonCollision* NewtonCreateConvexHull (const NewtonWorld* const newtonWorld, int count, const dFloat* const vertexCloud, int strideInBytes, dFloat tolerance, int shapeID, const dFloat* const offsetMatrix); 655 | NEWTON_API NewtonCollision* NewtonCreateConvexHullFromMesh (const NewtonWorld* const newtonWorld, const NewtonMesh* const mesh, dFloat tolerance, int shapeID); 656 | 657 | NEWTON_API int NewtonCollisionGetMode(const NewtonCollision* const convexCollision); 658 | NEWTON_API void NewtonCollisionSetMode (const NewtonCollision* const convexCollision, int mode); 659 | 660 | NEWTON_API int NewtonConvexHullGetFaceIndices (const NewtonCollision* const convexHullCollision, int face, int* const faceIndices); 661 | NEWTON_API int NewtonConvexHullGetVertexData (const NewtonCollision* const convexHullCollision, dFloat** const vertexData, int* strideInBytes); 662 | 663 | NEWTON_API dFloat NewtonConvexCollisionCalculateVolume (const NewtonCollision* const convexCollision); 664 | NEWTON_API void NewtonConvexCollisionCalculateInertialMatrix (const NewtonCollision* convexCollision, dFloat* const inertia, dFloat* const origin); 665 | NEWTON_API dFloat NewtonConvexCollisionCalculateBuoyancyVolume (const NewtonCollision* const convexCollision, const dFloat* const matrix, const dFloat* const fluidPlane, dFloat* const centerOfBuoyancy); 666 | 667 | NEWTON_API const void* NewtonCollisionDataPointer (const NewtonCollision* const convexCollision); 668 | 669 | // ********************************************************************************************** 670 | // 671 | // compound collision primitives creation functions 672 | // 673 | // ********************************************************************************************** 674 | NEWTON_API NewtonCollision* NewtonCreateCompoundCollision (const NewtonWorld* const newtonWorld, int shapeID); 675 | NEWTON_API NewtonCollision* NewtonCreateCompoundCollisionFromMesh (const NewtonWorld* const newtonWorld, const NewtonMesh* const mesh, dFloat hullTolerance, int shapeID, int subShapeID); 676 | 677 | NEWTON_API void NewtonCompoundCollisionBeginAddRemove (NewtonCollision* const compoundCollision); 678 | NEWTON_API void* NewtonCompoundCollisionAddSubCollision (NewtonCollision* const compoundCollision, const NewtonCollision* const convexCollision); 679 | NEWTON_API void NewtonCompoundCollisionRemoveSubCollision (NewtonCollision* const compoundCollision, const void* const collisionNode); 680 | NEWTON_API void NewtonCompoundCollisionRemoveSubCollisionByIndex (NewtonCollision* const compoundCollision, int nodeIndex); 681 | NEWTON_API void NewtonCompoundCollisionSetSubCollisionMatrix (NewtonCollision* const compoundCollision, const void* const collisionNode, const dFloat* const matrix); 682 | NEWTON_API void NewtonCompoundCollisionEndAddRemove (NewtonCollision* const compoundCollision); 683 | 684 | NEWTON_API void* NewtonCompoundCollisionGetFirstNode (NewtonCollision* const compoundCollision); 685 | NEWTON_API void* NewtonCompoundCollisionGetNextNode (NewtonCollision* const compoundCollision, const void* const collisionNode); 686 | 687 | NEWTON_API void* NewtonCompoundCollisionGetNodeByIndex (NewtonCollision* const compoundCollision, int index); 688 | NEWTON_API int NewtonCompoundCollisionGetNodeIndex (NewtonCollision* const compoundCollision, const void* const collisionNode); 689 | NEWTON_API NewtonCollision* NewtonCompoundCollisionGetCollisionFromNode (NewtonCollision* const compoundCollision, const void* const collisionNode); 690 | 691 | 692 | // ********************************************************************************************** 693 | // 694 | // Fractured compound collision primitives interface 695 | // 696 | // ********************************************************************************************** 697 | NEWTON_API NewtonCollision* NewtonCreateFracturedCompoundCollision (const NewtonWorld* const newtonWorld, const NewtonMesh* const solidMesh, int shapeID, int fracturePhysicsMaterialID, int pointcloudCount, const dFloat* const vertexCloud, int strideInBytes, int materialID, const dFloat* const textureMatrix, 698 | NewtonFractureCompoundCollisionReconstructMainMeshCallBack regenerateMainMeshCallback, 699 | NewtonFractureCompoundCollisionOnEmitCompoundFractured emitFracturedCompound, NewtonFractureCompoundCollisionOnEmitChunk emitFracfuredChunk); 700 | NEWTON_API NewtonCollision* NewtonFracturedCompoundPlaneClip (const NewtonCollision* const fracturedCompound, const dFloat* const plane); 701 | 702 | NEWTON_API void NewtonFracturedCompoundSetCallbacks (const NewtonCollision* const fracturedCompound, NewtonFractureCompoundCollisionReconstructMainMeshCallBack regenerateMainMeshCallback, 703 | NewtonFractureCompoundCollisionOnEmitCompoundFractured emitFracturedCompound, NewtonFractureCompoundCollisionOnEmitChunk emitFracfuredChunk); 704 | 705 | 706 | NEWTON_API int NewtonFracturedCompoundIsNodeFreeToDetach (const NewtonCollision* const fracturedCompound, void* const collisionNode); 707 | NEWTON_API int NewtonFracturedCompoundNeighborNodeList (const NewtonCollision* const fracturedCompound, void* const collisionNode, void** const list, int maxCount); 708 | 709 | 710 | NEWTON_API NewtonFracturedCompoundMeshPart* NewtonFracturedCompoundGetMainMesh (const NewtonCollision* const fracturedCompound); 711 | NEWTON_API NewtonFracturedCompoundMeshPart* NewtonFracturedCompoundGetFirstSubMesh(const NewtonCollision* const fracturedCompound); 712 | NEWTON_API NewtonFracturedCompoundMeshPart* NewtonFracturedCompoundGetNextSubMesh(const NewtonCollision* const fracturedCompound, NewtonFracturedCompoundMeshPart* const subMesh); 713 | 714 | NEWTON_API int NewtonFracturedCompoundCollisionGetVertexCount (const NewtonCollision* const fracturedCompound, const NewtonFracturedCompoundMeshPart* const meshOwner); 715 | NEWTON_API const dFloat* NewtonFracturedCompoundCollisionGetVertexPositions (const NewtonCollision* const fracturedCompound, const NewtonFracturedCompoundMeshPart* const meshOwner); 716 | NEWTON_API const dFloat* NewtonFracturedCompoundCollisionGetVertexNormals (const NewtonCollision* const fracturedCompound, const NewtonFracturedCompoundMeshPart* const meshOwner); 717 | NEWTON_API const dFloat* NewtonFracturedCompoundCollisionGetVertexUVs (const NewtonCollision* const fracturedCompound, const NewtonFracturedCompoundMeshPart* const meshOwner); 718 | NEWTON_API int NewtonFracturedCompoundMeshPartGetIndexStream (const NewtonCollision* const fracturedCompound, const NewtonFracturedCompoundMeshPart* const meshOwner, const void* const segment, int* const index); 719 | 720 | NEWTON_API void* NewtonFracturedCompoundMeshPartGetFirstSegment (const NewtonFracturedCompoundMeshPart* const fractureCompoundMeshPart); 721 | NEWTON_API void* NewtonFracturedCompoundMeshPartGetNextSegment (const void* const fractureCompoundMeshSegment); 722 | NEWTON_API int NewtonFracturedCompoundMeshPartGetMaterial (const void* const fractureCompoundMeshSegment); 723 | NEWTON_API int NewtonFracturedCompoundMeshPartGetIndexCount (const void* const fractureCompoundMeshSegment); 724 | 725 | 726 | // ********************************************************************************************** 727 | // 728 | // scene collision are static compound collision that can take polygonal static collisions 729 | // 730 | // ********************************************************************************************** 731 | NEWTON_API NewtonCollision* NewtonCreateSceneCollision (const NewtonWorld* const newtonWorld, int shapeID); 732 | 733 | NEWTON_API void NewtonSceneCollisionBeginAddRemove (NewtonCollision* const sceneCollision); 734 | NEWTON_API void* NewtonSceneCollisionAddSubCollision (NewtonCollision* const sceneCollision, const NewtonCollision* const collision); 735 | NEWTON_API void NewtonSceneCollisionRemoveSubCollision (NewtonCollision* const compoundCollision, const void* const collisionNode); 736 | NEWTON_API void NewtonSceneCollisionRemoveSubCollisionByIndex (NewtonCollision* const sceneCollision, int nodeIndex); 737 | NEWTON_API void NewtonSceneCollisionSetSubCollisionMatrix (NewtonCollision* const sceneCollision, const void* const collisionNode, const dFloat* const matrix); 738 | NEWTON_API void NewtonSceneCollisionEndAddRemove (NewtonCollision* const sceneCollision); 739 | 740 | NEWTON_API void* NewtonSceneCollisionGetFirstNode (NewtonCollision* const sceneCollision); 741 | NEWTON_API void* NewtonSceneCollisionGetNextNode (NewtonCollision* const sceneCollision, const void* const collisionNode); 742 | 743 | NEWTON_API void* NewtonSceneCollisionGetNodeByIndex (NewtonCollision* const sceneCollision, int index); 744 | NEWTON_API int NewtonSceneCollisionGetNodeIndex (NewtonCollision* const sceneCollision, const void* const collisionNode); 745 | NEWTON_API NewtonCollision* NewtonSceneCollisionGetCollisionFromNode (NewtonCollision* const sceneCollision, const void* const collisionNode); 746 | 747 | 748 | // *********************************************************************************************************** 749 | // 750 | // User Static mesh collision interface 751 | // 752 | // *********************************************************************************************************** 753 | NEWTON_API NewtonCollision* NewtonCreateUserMeshCollision (const NewtonWorld* const newtonWorld, const dFloat* const minBox, 754 | const dFloat* const maxBox, void* const userData, NewtonUserMeshCollisionCollideCallback collideCallback, 755 | NewtonUserMeshCollisionRayHitCallback rayHitCallback, NewtonUserMeshCollisionDestroyCallback destroyCallback, 756 | NewtonUserMeshCollisionGetCollisionInfo getInfoCallback, NewtonUserMeshCollisionAABBTest getLocalAABBCallback, 757 | NewtonUserMeshCollisionGetFacesInAABB facesInAABBCallback, NewtonOnUserCollisionSerializationCallback serializeCallback, int shapeID); 758 | 759 | NEWTON_API int NewtonUserMeshCollisionContinuousOverlapTest (const NewtonUserMeshCollisionCollideDesc* const collideDescData, const void* const continueCollisionHandle, const dFloat* const minAabb, const dFloat* const maxAabb); 760 | 761 | // *********************************************************************************************************** 762 | // 763 | // Collision serialization functions 764 | // 765 | // *********************************************************************************************************** 766 | NEWTON_API NewtonCollision* NewtonCreateCollisionFromSerialization (const NewtonWorld* const newtonWorld, NewtonDeserializeCallback deserializeFunction, void* const serializeHandle); 767 | NEWTON_API void NewtonCollisionSerialize (const NewtonWorld* const newtonWorld, const NewtonCollision* const collision, NewtonSerializeCallback serializeFunction, void* const serializeHandle); 768 | NEWTON_API void NewtonCollisionGetInfo (const NewtonCollision* const collision, NewtonCollisionInfoRecord* const collisionInfo); 769 | 770 | // ********************************************************************************************** 771 | // 772 | // Static collision shapes functions 773 | // 774 | // ********************************************************************************************** 775 | NEWTON_API NewtonCollision* NewtonCreateHeightFieldCollision (const NewtonWorld* const newtonWorld, int width, int height, int gridsDiagonals, int elevationdatType, const void* const elevationMap, const char* const attributeMap, dFloat verticalScale, dFloat horizontalScale_x, dFloat horizontalScale_z, int shapeID); 776 | NEWTON_API void NewtonHeightFieldSetUserRayCastCallback (const NewtonCollision* const heightfieldCollision, NewtonHeightFieldRayCastCallback rayHitCallback); 777 | 778 | NEWTON_API NewtonCollision* NewtonCreateTreeCollision (const NewtonWorld* const newtonWorld, int shapeID); 779 | NEWTON_API NewtonCollision* NewtonCreateTreeCollisionFromMesh (const NewtonWorld* const newtonWorld, const NewtonMesh* const mesh, int shapeID); 780 | NEWTON_API void NewtonTreeCollisionSetUserRayCastCallback (const NewtonCollision* const treeCollision, NewtonCollisionTreeRayCastCallback rayHitCallback); 781 | 782 | NEWTON_API void NewtonTreeCollisionBeginBuild (const NewtonCollision* const treeCollision); 783 | NEWTON_API void NewtonTreeCollisionAddFace (const NewtonCollision* const treeCollision, int vertexCount, const dFloat* const vertexPtr, int strideInBytes, int faceAttribute); 784 | NEWTON_API void NewtonTreeCollisionEndBuild (const NewtonCollision* const treeCollision, int optimize); 785 | 786 | NEWTON_API int NewtonTreeCollisionGetFaceAttribute (const NewtonCollision* const treeCollision, const int* const faceIndexArray, int indexCount); 787 | NEWTON_API void NewtonTreeCollisionSetFaceAttribute (const NewtonCollision* const treeCollision, const int* const faceIndexArray, int indexCount, int attribute); 788 | 789 | NEWTON_API void NewtonTreeCollisionForEachFace (const NewtonCollision* const treeCollision, NewtonTreeCollisionFaceCallback forEachFaceCallback, void* const context); 790 | 791 | NEWTON_API int NewtonTreeCollisionGetVertexListTriangleListInAABB (const NewtonCollision* const treeCollision, const dFloat* const p0, const dFloat* const p1, const dFloat** const vertexArray, int* const vertexCount, int* const vertexStrideInBytes, const int* const indexList, int maxIndexCount, const int* const faceAttribute); 792 | 793 | NEWTON_API void NewtonStaticCollisionSetDebugCallback (const NewtonCollision* const staticCollision, NewtonTreeCollisionCallback userCallback); 794 | 795 | // ********************************************************************************************** 796 | // 797 | // General purpose collision library functions 798 | // 799 | // ********************************************************************************************** 800 | NEWTON_API NewtonCollision* NewtonCollisionCreateInstance (const NewtonCollision* const collision); 801 | NEWTON_API int NewtonCollisionGetType (const NewtonCollision* const collision); 802 | NEWTON_API int NewtonCollisionIsConvexShape (const NewtonCollision* const collision); 803 | NEWTON_API int NewtonCollisionIsStaticShape (const NewtonCollision* const collision); 804 | 805 | // for the end user 806 | NEWTON_API void NewtonCollisionSetUserData (const NewtonCollision* const collision, void* const userData); 807 | NEWTON_API void* NewtonCollisionGetUserData (const NewtonCollision* const collision); 808 | 809 | NEWTON_API void NewtonCollisionSetUserID (const NewtonCollision* const collision, dLong id); 810 | NEWTON_API dLong NewtonCollisionGetUserID (const NewtonCollision* const collision); 811 | 812 | NEWTON_API void NewtonCollisionGetMaterial (const NewtonCollision* const collision, NewtonCollisionMaterial* const userData); 813 | NEWTON_API void NewtonCollisionSetMaterial (const NewtonCollision* const collision, const NewtonCollisionMaterial* const userData); 814 | 815 | NEWTON_API void* NewtonCollisionGetSubCollisionHandle (const NewtonCollision* const collision); 816 | NEWTON_API NewtonCollision* NewtonCollisionGetParentInstance (const NewtonCollision* const collision); 817 | 818 | NEWTON_API void NewtonCollisionSetMatrix (const NewtonCollision* const collision, const dFloat* const matrix); 819 | NEWTON_API void NewtonCollisionGetMatrix (const NewtonCollision* const collision, dFloat* const matrix); 820 | 821 | NEWTON_API void NewtonCollisionSetScale (const NewtonCollision* const collision, dFloat scaleX, dFloat scaleY, dFloat scaleZ); 822 | NEWTON_API void NewtonCollisionGetScale (const NewtonCollision* const collision, dFloat* const scaleX, dFloat* const scaleY, dFloat* const scaleZ); 823 | NEWTON_API void NewtonDestroyCollision (const NewtonCollision* const collision); 824 | 825 | NEWTON_API dFloat NewtonCollisionGetSkinThickness (const NewtonCollision* const collision); 826 | NEWTON_API void NewtonCollisionSetSkinThickness(const NewtonCollision* const collision, dFloat thickness); 827 | 828 | NEWTON_API int NewtonCollisionIntersectionTest (const NewtonWorld* const newtonWorld, 829 | const NewtonCollision* const collisionA, const dFloat* const matrixA, 830 | const NewtonCollision* const collisionB, const dFloat* const matrixB, int threadIndex); 831 | 832 | NEWTON_API int NewtonCollisionPointDistance (const NewtonWorld* const newtonWorld, const dFloat* const point, 833 | const NewtonCollision* const collision, const dFloat* const matrix, dFloat* const contact, dFloat* const normal, int threadIndex); 834 | 835 | NEWTON_API int NewtonCollisionClosestPoint (const NewtonWorld* const newtonWorld, 836 | const NewtonCollision* const collisionA, const dFloat* const matrixA, 837 | const NewtonCollision* const collisionB, const dFloat* const matrixB, 838 | dFloat* const contactA, dFloat* const contactB, dFloat* const normalAB, int threadIndex); 839 | 840 | NEWTON_API int NewtonCollisionCollide (const NewtonWorld* const newtonWorld, int maxSize, 841 | const NewtonCollision* const collisionA, const dFloat* const matrixA, 842 | const NewtonCollision* const collisionB, const dFloat* const matrixB, 843 | dFloat* const contacts, dFloat* const normals, dFloat* const penetration, 844 | dLong* const attributeA, dLong* const attributeB, int threadIndex); 845 | 846 | NEWTON_API int NewtonCollisionCollideContinue (const NewtonWorld* const newtonWorld, int maxSize, dFloat timestep, 847 | const NewtonCollision* const collisionA, const dFloat* const matrixA, const dFloat* const velocA, const dFloat* omegaA, 848 | const NewtonCollision* const collisionB, const dFloat* const matrixB, const dFloat* const velocB, const dFloat* const omegaB, 849 | dFloat* const timeOfImpact, dFloat* const contacts, dFloat* const normals, dFloat* const penetration, 850 | dLong* const attributeA, dLong* const attributeB, int threadIndex); 851 | 852 | NEWTON_API void NewtonCollisionSupportVertex (const NewtonCollision* const collision, const dFloat* const dir, dFloat* const vertex); 853 | NEWTON_API dFloat NewtonCollisionRayCast (const NewtonCollision* const collision, const dFloat* const p0, const dFloat* const p1, dFloat* const normal, dLong* const attribute); 854 | NEWTON_API void NewtonCollisionCalculateAABB (const NewtonCollision* const collision, const dFloat* const matrix, dFloat* const p0, dFloat* const p1); 855 | NEWTON_API void NewtonCollisionForEachPolygonDo (const NewtonCollision* const collision, const dFloat* const matrix, NewtonCollisionIterator callback, void* const userData); 856 | 857 | // ********************************************************************************************** 858 | // 859 | // collision aggregates, are a collision node on eh broad phase the serve as the root nod for a collection of rigid bodies 860 | // 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 861 | // These are good for speeding calculation calculation of rag doll, Vehicles or contractions of rigid bodied lined by joints. 862 | // 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 863 | // then warping the bodies under an aggregate will reduce collision calculation of almost an order of magnitude. 864 | // 865 | // ********************************************************************************************** 866 | NEWTON_API void* NewtonCollisionAggregateCreate (NewtonWorld* const world); 867 | NEWTON_API void NewtonCollisionAggregateDestroy (void* const aggregate); 868 | NEWTON_API void NewtonCollisionAggregateAddBody (void* const aggregate, const NewtonBody* const body); 869 | NEWTON_API void NewtonCollisionAggregateRemoveBody (void* const aggregate, const NewtonBody* const body); 870 | 871 | NEWTON_API int NewtonCollisionAggregateGetSelfCollision (void* const aggregate); 872 | NEWTON_API void NewtonCollisionAggregateSetSelfCollision (void* const aggregate, int state); 873 | 874 | // ********************************************************************************************** 875 | // 876 | // transforms utility functions 877 | // 878 | // ********************************************************************************************** 879 | NEWTON_API void NewtonSetEulerAngle (const dFloat* const eulersAngles, dFloat* const matrix); 880 | NEWTON_API void NewtonGetEulerAngle (const dFloat* const matrix, dFloat* const eulersAngles0, dFloat* const eulersAngles1); 881 | NEWTON_API dFloat NewtonCalculateSpringDamperAcceleration (dFloat dt, dFloat ks, dFloat x, dFloat kd, dFloat s); 882 | 883 | // ********************************************************************************************** 884 | // 885 | // body manipulation functions 886 | // 887 | // ********************************************************************************************** 888 | NEWTON_API NewtonBody* NewtonCreateDynamicBody (const NewtonWorld* const newtonWorld, const NewtonCollision* const collision, const dFloat* const matrix); 889 | NEWTON_API NewtonBody* NewtonCreateKinematicBody (const NewtonWorld* const newtonWorld, const NewtonCollision* const collision, const dFloat* const matrix); 890 | NEWTON_API NewtonBody* NewtonCreateAsymetricDynamicBody(const NewtonWorld* const newtonWorld, const NewtonCollision* const collision, const dFloat* const matrix); 891 | 892 | NEWTON_API void NewtonDestroyBody(const NewtonBody* const body); 893 | 894 | NEWTON_API int NewtonBodyGetSimulationState(const NewtonBody* const body); 895 | NEWTON_API void NewtonBodySetSimulationState(const NewtonBody* const bodyPtr, const int state); 896 | 897 | NEWTON_API int NewtonBodyGetType (const NewtonBody* const body); 898 | NEWTON_API int NewtonBodyGetCollidable (const NewtonBody* const body); 899 | NEWTON_API void NewtonBodySetCollidable (const NewtonBody* const body, int collidableState); 900 | 901 | NEWTON_API void NewtonBodyAddForce (const NewtonBody* const body, const dFloat* const force); 902 | NEWTON_API void NewtonBodyAddTorque (const NewtonBody* const body, const dFloat* const torque); 903 | 904 | NEWTON_API void NewtonBodySetCentreOfMass (const NewtonBody* const body, const dFloat* const com); 905 | NEWTON_API void NewtonBodySetMassMatrix (const NewtonBody* const body, dFloat mass, dFloat Ixx, dFloat Iyy, dFloat Izz); 906 | NEWTON_API void NewtonBodySetFullMassMatrix (const NewtonBody* const body, dFloat mass, const dFloat* const inertiaMatrix); 907 | 908 | NEWTON_API void NewtonBodySetMassProperties (const NewtonBody* const body, dFloat mass, const NewtonCollision* const collision); 909 | NEWTON_API void NewtonBodySetMatrix (const NewtonBody* const body, const dFloat* const matrix); 910 | NEWTON_API void NewtonBodySetMatrixNoSleep (const NewtonBody* const body, const dFloat* const matrix); 911 | NEWTON_API void NewtonBodySetMatrixRecursive (const NewtonBody* const body, const dFloat* const matrix); 912 | 913 | NEWTON_API void NewtonBodySetMaterialGroupID (const NewtonBody* const body, int id); 914 | NEWTON_API void NewtonBodySetContinuousCollisionMode (const NewtonBody* const body, unsigned state); 915 | NEWTON_API void NewtonBodySetJointRecursiveCollision (const NewtonBody* const body, unsigned state); 916 | NEWTON_API void NewtonBodySetOmega (const NewtonBody* const body, const dFloat* const omega); 917 | NEWTON_API void NewtonBodySetOmegaNoSleep (const NewtonBody* const body, const dFloat* const omega); 918 | NEWTON_API void NewtonBodySetVelocity (const NewtonBody* const body, const dFloat* const velocity); 919 | NEWTON_API void NewtonBodySetVelocityNoSleep (const NewtonBody* const body, const dFloat* const velocity); 920 | NEWTON_API void NewtonBodySetForce (const NewtonBody* const body, const dFloat* const force); 921 | NEWTON_API void NewtonBodySetTorque (const NewtonBody* const body, const dFloat* const torque); 922 | 923 | NEWTON_API void NewtonBodySetLinearDamping (const NewtonBody* const body, dFloat linearDamp); 924 | NEWTON_API void NewtonBodySetAngularDamping (const NewtonBody* const body, const dFloat* const angularDamp); 925 | NEWTON_API void NewtonBodySetCollision (const NewtonBody* const body, const NewtonCollision* const collision); 926 | NEWTON_API void NewtonBodySetCollisionScale (const NewtonBody* const body, dFloat scaleX, dFloat scaleY, dFloat scaleZ); 927 | 928 | NEWTON_API int NewtonBodyGetSleepState (const NewtonBody* const body); 929 | NEWTON_API void NewtonBodySetSleepState (const NewtonBody* const body, int state); 930 | 931 | NEWTON_API int NewtonBodyGetAutoSleep (const NewtonBody* const body); 932 | NEWTON_API void NewtonBodySetAutoSleep (const NewtonBody* const body, int state); 933 | 934 | NEWTON_API int NewtonBodyGetFreezeState(const NewtonBody* const body); 935 | NEWTON_API void NewtonBodySetFreezeState (const NewtonBody* const body, int state); 936 | 937 | NEWTON_API int NewtonBodyGetGyroscopicTorque(const NewtonBody* const body); 938 | NEWTON_API void NewtonBodySetGyroscopicTorque(const NewtonBody* const body, int state); 939 | 940 | NEWTON_API void NewtonBodySetDestructorCallback (const NewtonBody* const body, NewtonBodyDestructor callback); 941 | NEWTON_API NewtonBodyDestructor NewtonBodyGetDestructorCallback (const NewtonBody* const body); 942 | 943 | NEWTON_API void NewtonBodySetTransformCallback (const NewtonBody* const body, NewtonSetTransform callback); 944 | NEWTON_API NewtonSetTransform NewtonBodyGetTransformCallback (const NewtonBody* const body); 945 | 946 | NEWTON_API void NewtonBodySetForceAndTorqueCallback (const NewtonBody* const body, NewtonApplyForceAndTorque callback); 947 | NEWTON_API NewtonApplyForceAndTorque NewtonBodyGetForceAndTorqueCallback (const NewtonBody* const body); 948 | 949 | NEWTON_API int NewtonBodyGetID (const NewtonBody* const body); 950 | 951 | NEWTON_API void NewtonBodySetUserData (const NewtonBody* const body, void* const userData); 952 | NEWTON_API void* NewtonBodyGetUserData (const NewtonBody* const body); 953 | 954 | NEWTON_API NewtonWorld* NewtonBodyGetWorld (const NewtonBody* const body); 955 | NEWTON_API NewtonCollision* NewtonBodyGetCollision (const NewtonBody* const body); 956 | NEWTON_API int NewtonBodyGetMaterialGroupID (const NewtonBody* const body); 957 | 958 | NEWTON_API int NewtonBodyGetSerializedID(const NewtonBody* const body); 959 | NEWTON_API int NewtonBodyGetContinuousCollisionMode (const NewtonBody* const body); 960 | NEWTON_API int NewtonBodyGetJointRecursiveCollision (const NewtonBody* const body); 961 | 962 | NEWTON_API void NewtonBodyGetPosition(const NewtonBody* const body, dFloat* const pos); 963 | NEWTON_API void NewtonBodyGetMatrix(const NewtonBody* const body, dFloat* const matrix); 964 | NEWTON_API void NewtonBodyGetRotation(const NewtonBody* const body, dFloat* const rotation); 965 | NEWTON_API void NewtonBodyGetMass (const NewtonBody* const body, dFloat* mass, dFloat* const Ixx, dFloat* const Iyy, dFloat* const Izz); 966 | NEWTON_API void NewtonBodyGetInvMass(const NewtonBody* const body, dFloat* const invMass, dFloat* const invIxx, dFloat* const invIyy, dFloat* const invIzz); 967 | NEWTON_API void NewtonBodyGetInertiaMatrix(const NewtonBody* const body, dFloat* const inertiaMatrix); 968 | NEWTON_API void NewtonBodyGetInvInertiaMatrix(const NewtonBody* const body, dFloat* const invInertiaMatrix); 969 | NEWTON_API void NewtonBodyGetOmega(const NewtonBody* const body, dFloat* const vector); 970 | NEWTON_API void NewtonBodyGetVelocity(const NewtonBody* const body, dFloat* const vector); 971 | NEWTON_API void NewtonBodyGetAlpha(const NewtonBody* const body, dFloat* const vector); 972 | NEWTON_API void NewtonBodyGetAcceleration(const NewtonBody* const body, dFloat* const vector); 973 | NEWTON_API void NewtonBodyGetForce(const NewtonBody* const body, dFloat* const vector); 974 | NEWTON_API void NewtonBodyGetTorque(const NewtonBody* const body, dFloat* const vector); 975 | NEWTON_API void NewtonBodyGetCentreOfMass (const NewtonBody* const body, dFloat* const com); 976 | NEWTON_API void NewtonBodyGetPointVelocity (const NewtonBody* const body, const dFloat* const point, dFloat* const velocOut); 977 | 978 | NEWTON_API void NewtonBodyApplyImpulsePair (const NewtonBody* const body, dFloat* const linearImpulse, dFloat* const angularImpulse, dFloat timestep); 979 | NEWTON_API void NewtonBodyAddImpulse (const NewtonBody* const body, const dFloat* const pointDeltaVeloc, const dFloat* const pointPosit, dFloat timestep); 980 | NEWTON_API void NewtonBodyApplyImpulseArray (const NewtonBody* const body, int impuleCount, int strideInByte, const dFloat* const impulseArray, const dFloat* const pointArray, dFloat timestep); 981 | 982 | NEWTON_API void NewtonBodyIntegrateVelocity (const NewtonBody* const body, dFloat timestep); 983 | 984 | NEWTON_API dFloat NewtonBodyGetLinearDamping (const NewtonBody* const body); 985 | NEWTON_API void NewtonBodyGetAngularDamping (const NewtonBody* const body, dFloat* const vector); 986 | NEWTON_API void NewtonBodyGetAABB (const NewtonBody* const body, dFloat* const p0, dFloat* const p1); 987 | 988 | NEWTON_API NewtonJoint* NewtonBodyGetFirstJoint (const NewtonBody* const body); 989 | NEWTON_API NewtonJoint* NewtonBodyGetNextJoint (const NewtonBody* const body, const NewtonJoint* const joint); 990 | 991 | NEWTON_API NewtonJoint* NewtonBodyGetFirstContactJoint (const NewtonBody* const body); 992 | NEWTON_API NewtonJoint* NewtonBodyGetNextContactJoint (const NewtonBody* const body, const NewtonJoint* const contactJoint); 993 | NEWTON_API NewtonJoint* NewtonBodyFindContact (const NewtonBody* const body0, const NewtonBody* const body1); 994 | 995 | // ********************************************************************************************** 996 | // 997 | // contact joints interface 998 | // 999 | // ********************************************************************************************** 1000 | NEWTON_API void* NewtonContactJointGetFirstContact (const NewtonJoint* const contactJoint); 1001 | NEWTON_API void* NewtonContactJointGetNextContact (const NewtonJoint* const contactJoint, void* const contact); 1002 | 1003 | NEWTON_API int NewtonContactJointGetContactCount(const NewtonJoint* const contactJoint); 1004 | NEWTON_API void NewtonContactJointRemoveContact(const NewtonJoint* const contactJoint, void* const contact); 1005 | 1006 | NEWTON_API dFloat NewtonContactJointGetClosestDistance(const NewtonJoint* const contactJoint); 1007 | NEWTON_API void NewtonContactJointResetSelftJointCollision(const NewtonJoint* const contactJoint); 1008 | NEWTON_API void NewtonContactJointResetIntraJointCollision(const NewtonJoint* const contactJoint); 1009 | 1010 | NEWTON_API NewtonMaterial* NewtonContactGetMaterial (const void* const contact); 1011 | 1012 | NEWTON_API NewtonCollision* NewtonContactGetCollision0 (const void* const contact); 1013 | NEWTON_API NewtonCollision* NewtonContactGetCollision1 (const void* const contact); 1014 | 1015 | NEWTON_API void* NewtonContactGetCollisionID0 (const void* const contact); 1016 | NEWTON_API void* NewtonContactGetCollisionID1 (const void* const contact); 1017 | 1018 | 1019 | // ********************************************************************************************** 1020 | // 1021 | // Common joint functions 1022 | // 1023 | // ********************************************************************************************** 1024 | NEWTON_API void* NewtonJointGetUserData (const NewtonJoint* const joint); 1025 | NEWTON_API void NewtonJointSetUserData (const NewtonJoint* const joint, void* const userData); 1026 | 1027 | NEWTON_API NewtonBody* NewtonJointGetBody0 (const NewtonJoint* const joint); 1028 | NEWTON_API NewtonBody* NewtonJointGetBody1 (const NewtonJoint* const joint); 1029 | 1030 | NEWTON_API void NewtonJointGetInfo (const NewtonJoint* const joint, NewtonJointRecord* const info); 1031 | NEWTON_API int NewtonJointGetCollisionState (const NewtonJoint* const joint); 1032 | NEWTON_API void NewtonJointSetCollisionState (const NewtonJoint* const joint, int state); 1033 | 1034 | NEWTON_API dFloat NewtonJointGetStiffness (const NewtonJoint* const joint); 1035 | NEWTON_API void NewtonJointSetStiffness (const NewtonJoint* const joint, dFloat state); 1036 | 1037 | NEWTON_API void NewtonDestroyJoint(const NewtonWorld* const newtonWorld, const NewtonJoint* const joint); 1038 | NEWTON_API void NewtonJointSetDestructor (const NewtonJoint* const joint, NewtonConstraintDestructor destructor); 1039 | 1040 | NEWTON_API int NewtonJointIsActive (const NewtonJoint* const joint); 1041 | 1042 | // ********************************************************************************************** 1043 | // 1044 | // particle system interface (soft bodies, individual, pressure bodies and cloth) 1045 | // 1046 | // ********************************************************************************************** 1047 | NEWTON_API NewtonCollision* NewtonCreateMassSpringDamperSystem (const NewtonWorld* const newtonWorld, int shapeID, 1048 | const dFloat* const points, int pointCount, int strideInBytes, const dFloat* const pointMass, 1049 | const int* const links, int linksCount, const dFloat* const linksSpring, const dFloat* const linksDamper); 1050 | 1051 | NEWTON_API NewtonCollision* NewtonCreateDeformableSolid(const NewtonWorld* const newtonWorld, const NewtonMesh* const mesh, int shapeID); 1052 | 1053 | NEWTON_API int NewtonDeformableMeshGetParticleCount (const NewtonCollision* const deformableMesh); 1054 | NEWTON_API int NewtonDeformableMeshGetParticleStrideInBytes (const NewtonCollision* const deformableMesh); 1055 | NEWTON_API const dFloat* NewtonDeformableMeshGetParticleArray (const NewtonCollision* const deformableMesh); 1056 | 1057 | /* 1058 | NEWTON_API NewtonCollision* NewtonCreateClothPatch (const NewtonWorld* const newtonWorld, NewtonMesh* const mesh, int shapeID, NewtonClothPatchMaterial* const structuralMaterial, NewtonClothPatchMaterial* const bendMaterial); 1059 | NEWTON_API void NewtonDeformableMeshCreateClusters (NewtonCollision* const deformableMesh, int clusterCount, dFloat overlapingWidth); 1060 | NEWTON_API void NewtonDeformableMeshSetDebugCallback (NewtonCollision* const deformableMesh, NewtonCollisionIterator callback); 1061 | 1062 | 1063 | NEWTON_API void NewtonDeformableMeshGetParticlePosition (NewtonCollision* const deformableMesh, int particleIndex, dFloat* const posit); 1064 | 1065 | NEWTON_API void NewtonDeformableMeshBeginConfiguration (const NewtonCollision* const deformableMesh); 1066 | NEWTON_API void NewtonDeformableMeshUnconstraintParticle (NewtonCollision* const deformableMesh, int particleIndex); 1067 | NEWTON_API void NewtonDeformableMeshConstraintParticle (NewtonCollision* const deformableMesh, int particleIndex, const dFloat* const posit, const NewtonBody* const body); 1068 | NEWTON_API void NewtonDeformableMeshEndConfiguration (const NewtonCollision* const deformableMesh); 1069 | 1070 | // NEWTON_API void NewtonDeformableMeshSetPlasticity (NewtonCollision* const deformableMesh, dFloat plasticity); 1071 | // NEWTON_API void NewtonDeformableMeshSetStiffness (NewtonCollision* const deformableMesh, dFloat stiffness); 1072 | NEWTON_API void NewtonDeformableMeshSetSkinThickness (NewtonCollision* const deformableMesh, dFloat skinThickness); 1073 | 1074 | NEWTON_API void NewtonDeformableMeshUpdateRenderNormals (const NewtonCollision* const deformableMesh); 1075 | NEWTON_API int NewtonDeformableMeshGetVertexCount (const NewtonCollision* const deformableMesh); 1076 | NEWTON_API void NewtonDeformableMeshGetVertexStreams (const NewtonCollision* const deformableMesh, int vertexStrideInByte, dFloat* const vertex, int normalStrideInByte, dFloat* const normal, int uvStrideInByte0, dFloat* const uv0); 1077 | NEWTON_API NewtonDeformableMeshSegment* NewtonDeformableMeshGetFirstSegment (const NewtonCollision* const deformableMesh); 1078 | NEWTON_API NewtonDeformableMeshSegment* NewtonDeformableMeshGetNextSegment (const NewtonCollision* const deformableMesh, const NewtonDeformableMeshSegment* const segment); 1079 | 1080 | NEWTON_API int NewtonDeformableMeshSegmentGetMaterialID (const NewtonCollision* const deformableMesh, const NewtonDeformableMeshSegment* const segment); 1081 | NEWTON_API int NewtonDeformableMeshSegmentGetIndexCount (const NewtonCollision* const deformableMesh, const NewtonDeformableMeshSegment* const segment); 1082 | NEWTON_API const int* NewtonDeformableMeshSegmentGetIndexList (const NewtonCollision* const deformableMesh, const NewtonDeformableMeshSegment* const segment); 1083 | */ 1084 | // ********************************************************************************************** 1085 | // 1086 | // Ball and Socket joint functions 1087 | // 1088 | // ********************************************************************************************** 1089 | NEWTON_API NewtonJoint* NewtonConstraintCreateBall (const NewtonWorld* const newtonWorld, const dFloat* pivotPoint, const NewtonBody* const childBody, const NewtonBody* const parentBody); 1090 | NEWTON_API void NewtonBallSetUserCallback (const NewtonJoint* const ball, NewtonBallCallback callback); 1091 | NEWTON_API void NewtonBallGetJointAngle (const NewtonJoint* const ball, dFloat* angle); 1092 | NEWTON_API void NewtonBallGetJointOmega (const NewtonJoint* const ball, dFloat* omega); 1093 | NEWTON_API void NewtonBallGetJointForce (const NewtonJoint* const ball, dFloat* const force); 1094 | NEWTON_API void NewtonBallSetConeLimits (const NewtonJoint* const ball, const dFloat* pin, dFloat maxConeAngle, dFloat maxTwistAngle); 1095 | 1096 | // ********************************************************************************************** 1097 | // 1098 | // Hinge joint functions 1099 | // 1100 | // ********************************************************************************************** 1101 | NEWTON_API NewtonJoint* NewtonConstraintCreateHinge (const NewtonWorld* const newtonWorld, const dFloat* pivotPoint, const dFloat* pinDir, const NewtonBody* const childBody, const NewtonBody* const parentBody); 1102 | NEWTON_API void NewtonHingeSetUserCallback (const NewtonJoint* const hinge, NewtonHingeCallback callback); 1103 | NEWTON_API dFloat NewtonHingeGetJointAngle (const NewtonJoint* const hinge); 1104 | NEWTON_API dFloat NewtonHingeGetJointOmega (const NewtonJoint* const hinge); 1105 | NEWTON_API void NewtonHingeGetJointForce (const NewtonJoint* const hinge, dFloat* const force); 1106 | NEWTON_API dFloat NewtonHingeCalculateStopAlpha (const NewtonJoint* const hinge, const NewtonHingeSliderUpdateDesc* const desc, dFloat angle); 1107 | 1108 | // ********************************************************************************************** 1109 | // 1110 | // Slider joint functions 1111 | // 1112 | // ********************************************************************************************** 1113 | NEWTON_API NewtonJoint* NewtonConstraintCreateSlider (const NewtonWorld* const newtonWorld, const dFloat* pivotPoint, const dFloat* pinDir, const NewtonBody* const childBody, const NewtonBody* const parentBody); 1114 | NEWTON_API void NewtonSliderSetUserCallback (const NewtonJoint* const slider, NewtonSliderCallback callback); 1115 | NEWTON_API dFloat NewtonSliderGetJointPosit (const NewtonJoint* slider); 1116 | NEWTON_API dFloat NewtonSliderGetJointVeloc (const NewtonJoint* slider); 1117 | NEWTON_API void NewtonSliderGetJointForce (const NewtonJoint* const slider, dFloat* const force); 1118 | NEWTON_API dFloat NewtonSliderCalculateStopAccel (const NewtonJoint* const slider, const NewtonHingeSliderUpdateDesc* const desc, dFloat position); 1119 | 1120 | 1121 | // ********************************************************************************************** 1122 | // 1123 | // Corkscrew joint functions 1124 | // 1125 | // ********************************************************************************************** 1126 | NEWTON_API NewtonJoint* NewtonConstraintCreateCorkscrew (const NewtonWorld* const newtonWorld, const dFloat* pivotPoint, const dFloat* pinDir, const NewtonBody* const childBody, const NewtonBody* const parentBody); 1127 | NEWTON_API void NewtonCorkscrewSetUserCallback (const NewtonJoint* const corkscrew, NewtonCorkscrewCallback callback); 1128 | NEWTON_API dFloat NewtonCorkscrewGetJointPosit (const NewtonJoint* const corkscrew); 1129 | NEWTON_API dFloat NewtonCorkscrewGetJointAngle (const NewtonJoint* const corkscrew); 1130 | NEWTON_API dFloat NewtonCorkscrewGetJointVeloc (const NewtonJoint* const corkscrew); 1131 | NEWTON_API dFloat NewtonCorkscrewGetJointOmega (const NewtonJoint* const corkscrew); 1132 | NEWTON_API void NewtonCorkscrewGetJointForce (const NewtonJoint* const corkscrew, dFloat* const force); 1133 | NEWTON_API dFloat NewtonCorkscrewCalculateStopAlpha (const NewtonJoint* const corkscrew, const NewtonHingeSliderUpdateDesc* const desc, dFloat angle); 1134 | NEWTON_API dFloat NewtonCorkscrewCalculateStopAccel (const NewtonJoint* const corkscrew, const NewtonHingeSliderUpdateDesc* const desc, dFloat position); 1135 | 1136 | 1137 | // ********************************************************************************************** 1138 | // 1139 | // Universal joint functions 1140 | // 1141 | // ********************************************************************************************** 1142 | NEWTON_API NewtonJoint* NewtonConstraintCreateUniversal (const NewtonWorld* const newtonWorld, const dFloat* pivotPoint, const dFloat* pinDir0, const dFloat* pinDir1, const NewtonBody* const childBody, const NewtonBody* const parentBody); 1143 | NEWTON_API void NewtonUniversalSetUserCallback (const NewtonJoint* const universal, NewtonUniversalCallback callback); 1144 | NEWTON_API dFloat NewtonUniversalGetJointAngle0 (const NewtonJoint* const universal); 1145 | NEWTON_API dFloat NewtonUniversalGetJointAngle1 (const NewtonJoint* const universal); 1146 | NEWTON_API dFloat NewtonUniversalGetJointOmega0 (const NewtonJoint* const universal); 1147 | NEWTON_API dFloat NewtonUniversalGetJointOmega1 (const NewtonJoint* const universal); 1148 | NEWTON_API void NewtonUniversalGetJointForce (const NewtonJoint* const universal, dFloat* const force); 1149 | NEWTON_API dFloat NewtonUniversalCalculateStopAlpha0 (const NewtonJoint* const universal, const NewtonHingeSliderUpdateDesc* const desc, dFloat angle); 1150 | NEWTON_API dFloat NewtonUniversalCalculateStopAlpha1 (const NewtonJoint* const universal, const NewtonHingeSliderUpdateDesc* const desc, dFloat angle); 1151 | 1152 | 1153 | // ********************************************************************************************** 1154 | // 1155 | // Up vector joint functions 1156 | // 1157 | // ********************************************************************************************** 1158 | NEWTON_API NewtonJoint* NewtonConstraintCreateUpVector (const NewtonWorld* const newtonWorld, const dFloat* pinDir, const NewtonBody* const body); 1159 | NEWTON_API void NewtonUpVectorGetPin (const NewtonJoint* const upVector, dFloat *pin); 1160 | NEWTON_API void NewtonUpVectorSetPin (const NewtonJoint* const upVector, const dFloat *pin); 1161 | 1162 | 1163 | // ********************************************************************************************** 1164 | // 1165 | // User defined bilateral Joint 1166 | // 1167 | // ********************************************************************************************** 1168 | NEWTON_API NewtonJoint* NewtonConstraintCreateUserJoint (const NewtonWorld* const newtonWorld, int maxDOF, NewtonUserBilateralCallback callback, const NewtonBody* const childBody, const NewtonBody* const parentBody) ; 1169 | NEWTON_API int NewtonUserJointGetSolverModel(const NewtonJoint* const joint); 1170 | NEWTON_API void NewtonUserJointSetSolverModel(const NewtonJoint* const joint, int model); 1171 | NEWTON_API void NewtonUserJointMassScale(const NewtonJoint* const joint, dFloat scaleBody0, dFloat scaleBody1); 1172 | 1173 | NEWTON_API void NewtonUserJointSetFeedbackCollectorCallback (const NewtonJoint* const joint, NewtonUserBilateralCallback getFeedback); 1174 | NEWTON_API void NewtonUserJointAddLinearRow (const NewtonJoint* const joint, const dFloat* const pivot0, const dFloat* const pivot1, const dFloat* const dir); 1175 | NEWTON_API void NewtonUserJointAddAngularRow (const NewtonJoint* const joint, dFloat relativeAngle, const dFloat* const dir); 1176 | NEWTON_API void NewtonUserJointAddGeneralRow (const NewtonJoint* const joint, const dFloat* const jacobian0, const dFloat* const jacobian1); 1177 | NEWTON_API void NewtonUserJointSetRowMinimumFriction (const NewtonJoint* const joint, dFloat friction); 1178 | NEWTON_API void NewtonUserJointSetRowMaximumFriction (const NewtonJoint* const joint, dFloat friction); 1179 | NEWTON_API dFloat NewtonUserJointCalculateRowZeroAcceleration (const NewtonJoint* const joint); 1180 | NEWTON_API dFloat NewtonUserJointGetRowAcceleration (const NewtonJoint* const joint); 1181 | NEWTON_API void NewtonUserJointGetRowJacobian(const NewtonJoint* const joint, dFloat* const linear0, dFloat* const angula0, dFloat* const linear1, dFloat* const angula1); 1182 | NEWTON_API void NewtonUserJointSetRowAcceleration (const NewtonJoint* const joint, dFloat acceleration); 1183 | NEWTON_API void NewtonUserJointSetRowMassDependentSpringDamperAcceleration(const NewtonJoint* const joint, dFloat spring, dFloat damper); 1184 | NEWTON_API void NewtonUserJointSetRowMassIndependentSpringDamperAcceleration (const NewtonJoint* const joint, dFloat rowStiffness, dFloat spring, dFloat damper); 1185 | NEWTON_API void NewtonUserJointSetRowStiffness (const NewtonJoint* const joint, dFloat stiffness); 1186 | NEWTON_API int NewtonUserJoinRowsCount (const NewtonJoint* const joint); 1187 | NEWTON_API void NewtonUserJointGetGeneralRow (const NewtonJoint* const joint, int index, dFloat* const jacobian0, dFloat* const jacobian1); 1188 | NEWTON_API dFloat NewtonUserJointGetRowForce (const NewtonJoint* const joint, int row); 1189 | 1190 | // ********************************************************************************************** 1191 | // 1192 | // Mesh joint functions 1193 | // 1194 | // ********************************************************************************************** 1195 | NEWTON_API NewtonMesh* NewtonMeshCreate(const NewtonWorld* const newtonWorld); 1196 | NEWTON_API NewtonMesh* NewtonMeshCreateFromMesh(const NewtonMesh* const mesh); 1197 | NEWTON_API NewtonMesh* NewtonMeshCreateFromCollision(const NewtonCollision* const collision); 1198 | NEWTON_API NewtonMesh* NewtonMeshCreateTetrahedraIsoSurface(const NewtonMesh* const mesh); 1199 | NEWTON_API NewtonMesh* NewtonMeshCreateConvexHull (const NewtonWorld* const newtonWorld, int pointCount, const dFloat* const vertexCloud, int strideInBytes, dFloat tolerance); 1200 | NEWTON_API NewtonMesh* NewtonMeshCreateVoronoiConvexDecomposition (const NewtonWorld* const newtonWorld, int pointCount, const dFloat* const vertexCloud, int strideInBytes, int materialID, const dFloat* const textureMatrix); 1201 | NEWTON_API NewtonMesh* NewtonMeshCreateFromSerialization (const NewtonWorld* const newtonWorld, NewtonDeserializeCallback deserializeFunction, void* const serializeHandle); 1202 | NEWTON_API void NewtonMeshDestroy(const NewtonMesh* const mesh); 1203 | 1204 | NEWTON_API void NewtonMeshSerialize (const NewtonMesh* const mesh, NewtonSerializeCallback serializeFunction, void* const serializeHandle); 1205 | NEWTON_API void NewtonMeshSaveOFF(const NewtonMesh* const mesh, const char* const filename); 1206 | NEWTON_API NewtonMesh* NewtonMeshLoadOFF(const NewtonWorld* const newtonWorld, const char* const filename); 1207 | NEWTON_API NewtonMesh* NewtonMeshLoadTetrahedraMesh(const NewtonWorld* const newtonWorld, const char* const filename); 1208 | 1209 | NEWTON_API void NewtonMeshFlipWinding(const NewtonMesh* const mesh); 1210 | 1211 | NEWTON_API void NewtonMeshApplyTransform (const NewtonMesh* const mesh, const dFloat* const matrix); 1212 | NEWTON_API void NewtonMeshCalculateOOBB(const NewtonMesh* const mesh, dFloat* const matrix, dFloat* const x, dFloat* const y, dFloat* const z); 1213 | 1214 | NEWTON_API void NewtonMeshCalculateVertexNormals(const NewtonMesh* const mesh, dFloat angleInRadians); 1215 | NEWTON_API void NewtonMeshApplySphericalMapping(const NewtonMesh* const mesh, int material, const dFloat* const aligmentMatrix); 1216 | NEWTON_API void NewtonMeshApplyCylindricalMapping(const NewtonMesh* const mesh, int cylinderMaterial, int capMaterial, const dFloat* const aligmentMatrix); 1217 | NEWTON_API void NewtonMeshApplyBoxMapping(const NewtonMesh* const mesh, int frontMaterial, int sideMaterial, int topMaterial, const dFloat* const aligmentMatrix); 1218 | NEWTON_API void NewtonMeshApplyAngleBasedMapping(const NewtonMesh* const mesh, int material, NewtonReportProgress reportPrograssCallback, void* const reportPrgressUserData, dFloat* const aligmentMatrix); 1219 | 1220 | NEWTON_API void NewtonCreateTetrahedraLinearBlendSkinWeightsChannel(const NewtonMesh* const tetrahedraMesh, NewtonMesh* const skinMesh); 1221 | 1222 | NEWTON_API void NewtonMeshOptimize (const NewtonMesh* const mesh); 1223 | NEWTON_API void NewtonMeshOptimizePoints (const NewtonMesh* const mesh); 1224 | NEWTON_API void NewtonMeshOptimizeVertex (const NewtonMesh* const mesh); 1225 | NEWTON_API int NewtonMeshIsOpenMesh (const NewtonMesh* const mesh); 1226 | NEWTON_API void NewtonMeshFixTJoints (const NewtonMesh* const mesh); 1227 | 1228 | NEWTON_API void NewtonMeshPolygonize (const NewtonMesh* const mesh); 1229 | NEWTON_API void NewtonMeshTriangulate (const NewtonMesh* const mesh); 1230 | NEWTON_API NewtonMesh* NewtonMeshUnion (const NewtonMesh* const mesh, const NewtonMesh* const clipper, const dFloat* const clipperMatrix); 1231 | NEWTON_API NewtonMesh* NewtonMeshDifference (const NewtonMesh* const mesh, const NewtonMesh* const clipper, const dFloat* const clipperMatrix); 1232 | NEWTON_API NewtonMesh* NewtonMeshIntersection (const NewtonMesh* const mesh, const NewtonMesh* const clipper, const dFloat* const clipperMatrix); 1233 | NEWTON_API void NewtonMeshClip (const NewtonMesh* const mesh, const NewtonMesh* const clipper, const dFloat* const clipperMatrix, NewtonMesh** const topMesh, NewtonMesh** const bottomMesh); 1234 | 1235 | NEWTON_API NewtonMesh* NewtonMeshConvexMeshIntersection (const NewtonMesh* const mesh, const NewtonMesh* const convexMesh); 1236 | 1237 | NEWTON_API NewtonMesh* NewtonMeshSimplify (const NewtonMesh* const mesh, int maxVertexCount, NewtonReportProgress reportPrograssCallback, void* const reportPrgressUserData); 1238 | NEWTON_API NewtonMesh* NewtonMeshApproximateConvexDecomposition (const NewtonMesh* const mesh, dFloat maxConcavity, dFloat backFaceDistanceFactor, int maxCount, int maxVertexPerHull, NewtonReportProgress reportProgressCallback, void* const reportProgressUserData); 1239 | 1240 | NEWTON_API void NewtonRemoveUnusedVertices(const NewtonMesh* const mesh, int* const vertexRemapTable); 1241 | 1242 | NEWTON_API void NewtonMeshBeginBuild(const NewtonMesh* const mesh); 1243 | NEWTON_API void NewtonMeshBeginFace(const NewtonMesh* const mesh); 1244 | NEWTON_API void NewtonMeshAddPoint(const NewtonMesh* const mesh, dFloat64 x, dFloat64 y, dFloat64 z); 1245 | NEWTON_API void NewtonMeshAddLayer(const NewtonMesh* const mesh, int layerIndex); 1246 | NEWTON_API void NewtonMeshAddMaterial(const NewtonMesh* const mesh, int materialIndex); 1247 | NEWTON_API void NewtonMeshAddNormal(const NewtonMesh* const mesh, dFloat x, dFloat y, dFloat z); 1248 | NEWTON_API void NewtonMeshAddBinormal(const NewtonMesh* const mesh, dFloat x, dFloat y, dFloat z); 1249 | NEWTON_API void NewtonMeshAddUV0(const NewtonMesh* const mesh, dFloat u, dFloat v); 1250 | NEWTON_API void NewtonMeshAddUV1(const NewtonMesh* const mesh, dFloat u, dFloat v); 1251 | NEWTON_API void NewtonMeshAddVertexColor(const NewtonMesh* const mesh, dFloat32 r, dFloat32 g, dFloat32 b, dFloat32 a); 1252 | NEWTON_API void NewtonMeshEndFace(const NewtonMesh* const mesh); 1253 | NEWTON_API void NewtonMeshEndBuild(const NewtonMesh* const mesh); 1254 | 1255 | NEWTON_API void NewtonMeshClearVertexFormat (NewtonMeshVertexFormat* const format); 1256 | NEWTON_API void NewtonMeshBuildFromVertexListIndexList (const NewtonMesh* const mesh, const NewtonMeshVertexFormat* const format); 1257 | 1258 | NEWTON_API int NewtonMeshGetPointCount (const NewtonMesh* const mesh); 1259 | NEWTON_API const int* NewtonMeshGetIndexToVertexMap(const NewtonMesh* const mesh); 1260 | 1261 | NEWTON_API void NewtonMeshGetVertexDoubleChannel (const NewtonMesh* const mesh, int vertexStrideInByte, dFloat64* const outBuffer); 1262 | NEWTON_API void NewtonMeshGetVertexChannel (const NewtonMesh* const mesh, int vertexStrideInByte, dFloat* const outBuffer); 1263 | NEWTON_API void NewtonMeshGetNormalChannel (const NewtonMesh* const mesh, int vertexStrideInByte, dFloat* const outBuffer); 1264 | NEWTON_API void NewtonMeshGetBinormalChannel (const NewtonMesh* const mesh, int vertexStrideInByte, dFloat* const outBuffer); 1265 | NEWTON_API void NewtonMeshGetUV0Channel (const NewtonMesh* const mesh, int vertexStrideInByte, dFloat* const outBuffer); 1266 | NEWTON_API void NewtonMeshGetUV1Channel (const NewtonMesh* const mesh, int vertexStrideInByte, dFloat* const outBuffer); 1267 | NEWTON_API void NewtonMeshGetVertexColorChannel (const NewtonMesh* const mesh, int vertexStrideInByte, dFloat* const outBuffer); 1268 | 1269 | NEWTON_API int NewtonMeshHasNormalChannel(const NewtonMesh* const mesh); 1270 | NEWTON_API int NewtonMeshHasBinormalChannel(const NewtonMesh* const mesh); 1271 | NEWTON_API int NewtonMeshHasUV0Channel(const NewtonMesh* const mesh); 1272 | NEWTON_API int NewtonMeshHasUV1Channel(const NewtonMesh* const mesh); 1273 | NEWTON_API int NewtonMeshHasVertexColorChannel(const NewtonMesh* const mesh); 1274 | 1275 | NEWTON_API void* NewtonMeshBeginHandle (const NewtonMesh* const mesh); 1276 | NEWTON_API void NewtonMeshEndHandle (const NewtonMesh* const mesh, void* const handle); 1277 | NEWTON_API int NewtonMeshFirstMaterial (const NewtonMesh* const mesh, void* const handle); 1278 | NEWTON_API int NewtonMeshNextMaterial (const NewtonMesh* const mesh, void* const handle, int materialId); 1279 | NEWTON_API int NewtonMeshMaterialGetMaterial (const NewtonMesh* const mesh, void* const handle, int materialId); 1280 | NEWTON_API int NewtonMeshMaterialGetIndexCount (const NewtonMesh* const mesh, void* const handle, int materialId); 1281 | NEWTON_API void NewtonMeshMaterialGetIndexStream (const NewtonMesh* const mesh, void* const handle, int materialId, int* const index); 1282 | NEWTON_API void NewtonMeshMaterialGetIndexStreamShort (const NewtonMesh* const mesh, void* const handle, int materialId, short int* const index); 1283 | 1284 | NEWTON_API NewtonMesh* NewtonMeshCreateFirstSingleSegment (const NewtonMesh* const mesh); 1285 | NEWTON_API NewtonMesh* NewtonMeshCreateNextSingleSegment (const NewtonMesh* const mesh, const NewtonMesh* const segment); 1286 | 1287 | NEWTON_API NewtonMesh* NewtonMeshCreateFirstLayer (const NewtonMesh* const mesh); 1288 | NEWTON_API NewtonMesh* NewtonMeshCreateNextLayer (const NewtonMesh* const mesh, const NewtonMesh* const segment); 1289 | 1290 | NEWTON_API int NewtonMeshGetTotalFaceCount (const NewtonMesh* const mesh); 1291 | NEWTON_API int NewtonMeshGetTotalIndexCount (const NewtonMesh* const mesh); 1292 | NEWTON_API void NewtonMeshGetFaces (const NewtonMesh* const mesh, int* const faceIndexCount, int* const faceMaterial, void** const faceIndices); 1293 | 1294 | NEWTON_API int NewtonMeshGetVertexCount (const NewtonMesh* const mesh); 1295 | NEWTON_API int NewtonMeshGetVertexStrideInByte (const NewtonMesh* const mesh); 1296 | NEWTON_API const dFloat64* NewtonMeshGetVertexArray (const NewtonMesh* const mesh); 1297 | 1298 | NEWTON_API int NewtonMeshGetVertexBaseCount(const NewtonMesh* const mesh); 1299 | NEWTON_API void NewtonMeshSetVertexBaseCount(const NewtonMesh* const mesh, int baseCount); 1300 | 1301 | NEWTON_API void* NewtonMeshGetFirstVertex (const NewtonMesh* const mesh); 1302 | NEWTON_API void* NewtonMeshGetNextVertex (const NewtonMesh* const mesh, const void* const vertex); 1303 | NEWTON_API int NewtonMeshGetVertexIndex (const NewtonMesh* const mesh, const void* const vertex); 1304 | 1305 | NEWTON_API void* NewtonMeshGetFirstPoint (const NewtonMesh* const mesh); 1306 | NEWTON_API void* NewtonMeshGetNextPoint (const NewtonMesh* const mesh, const void* const point); 1307 | NEWTON_API int NewtonMeshGetPointIndex (const NewtonMesh* const mesh, const void* const point); 1308 | NEWTON_API int NewtonMeshGetVertexIndexFromPoint (const NewtonMesh* const mesh, const void* const point); 1309 | 1310 | NEWTON_API void* NewtonMeshGetFirstEdge (const NewtonMesh* const mesh); 1311 | NEWTON_API void* NewtonMeshGetNextEdge (const NewtonMesh* const mesh, const void* const edge); 1312 | NEWTON_API void NewtonMeshGetEdgeIndices (const NewtonMesh* const mesh, const void* const edge, int* const v0, int* const v1); 1313 | //NEWTON_API void NewtonMeshGetEdgePointIndices (const NewtonMesh* const mesh, const void* const edge, int* const v0, int* const v1); 1314 | 1315 | NEWTON_API void* NewtonMeshGetFirstFace (const NewtonMesh* const mesh); 1316 | NEWTON_API void* NewtonMeshGetNextFace (const NewtonMesh* const mesh, const void* const face); 1317 | NEWTON_API int NewtonMeshIsFaceOpen (const NewtonMesh* const mesh, const void* const face); 1318 | NEWTON_API int NewtonMeshGetFaceMaterial (const NewtonMesh* const mesh, const void* const face); 1319 | NEWTON_API int NewtonMeshGetFaceIndexCount (const NewtonMesh* const mesh, const void* const face); 1320 | NEWTON_API void NewtonMeshGetFaceIndices (const NewtonMesh* const mesh, const void* const face, int* const indices); 1321 | NEWTON_API void NewtonMeshGetFacePointIndices (const NewtonMesh* const mesh, const void* const face, int* const indices); 1322 | NEWTON_API void NewtonMeshCalculateFaceNormal (const NewtonMesh* const mesh, const void* const face, dFloat64* const normal); 1323 | 1324 | NEWTON_API void NewtonMeshSetFaceMaterial (const NewtonMesh* const mesh, const void* const face, int matId); 1325 | 1326 | 1327 | #ifdef __cplusplus 1328 | } 1329 | #endif 1330 | #endif 1331 | 1332 | 1333 | 1334 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # bindbc-newton 2 | BindBC binding to [Newton Dynamics](https://github.com/MADEAPPS/newton-dynamics) 3.14. Includes `newton.dll` and AVX/SSE plugins for x86 and x86_64. 3 | 4 | [![DUB Package](https://img.shields.io/dub/v/bindbc-newton.svg)](https://code.dlang.org/packages/bindbc-newton) 5 | [![DUB Downloads](https://img.shields.io/dub/dm/bindbc-newton.svg)](https://code.dlang.org/packages/bindbc-newton) 6 | -------------------------------------------------------------------------------- /dub.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bindbc-newton", 3 | "description": "Dynamic binding to Newton Dynamics", 4 | "homepage": "https://github.com/gecko0307/bindbc-newton", 5 | "license": "Boost", 6 | "authors": [ 7 | "Timur Gafarov" 8 | ], 9 | 10 | "dependencies": { 11 | "bindbc-loader": "~>1.1" 12 | }, 13 | 14 | "importPaths": ["src"], 15 | "sourcePaths": ["src"], 16 | 17 | "buildRequirements":[ 18 | "allowWarnings" 19 | ], 20 | 21 | "configurations": [ 22 | { 23 | "name": "library", 24 | "targetType": "library" 25 | } 26 | ], 27 | 28 | "copyFiles-windows-x86" : ["lib/x86/*.dll", "plugins/x86/*.dll"], 29 | "copyFiles-windows-x86_64" : ["lib/x64/*.dll", "plugins/x64/*.dll"] 30 | } 31 | 32 | -------------------------------------------------------------------------------- /genbinding.py: -------------------------------------------------------------------------------- 1 | from pyclibrary import CParser 2 | 3 | def typeToStr(type): 4 | typeSpec = type.type_spec 5 | if typeSpec == 'float': 6 | typeSpec = 'dFloat' 7 | if typeSpec == 'unsigned': 8 | typeSpec = 'uint' 9 | if typeSpec == 'short int': 10 | typeSpec = 'short' 11 | if typeSpec == 'long long': 12 | typeSpec = 'long' 13 | quals = '' 14 | if len(type.type_quals) >= 1: 15 | quals = ' '.join(type.type_quals[0]) + ' ' 16 | return quals + typeSpec + ' '.join(type.declarators) 17 | 18 | def argToStr(arg): 19 | argName = arg[0] 20 | if argName == 'body': 21 | argName = '_body' 22 | argType = arg[1] 23 | return typeToStr(argType) + ' ' + argName 24 | 25 | parser = CParser(files=['Newton.h'], cache='Newton.h.cache') 26 | funcs = parser.defs['functions'] 27 | 28 | binding = '' 29 | 30 | binding += ''' 31 | /* 32 | Boost Software License - Version 1.0 - August 17th, 2003 33 | 34 | Permission is hereby granted, free of charge, to any person or organization 35 | obtaining a copy of the software and accompanying documentation covered by 36 | this license (the "Software") to use, reproduce, display, distribute, 37 | execute, and transmit the Software, and to prepare derivative works of the 38 | Software, and to permit third-parties to whom the Software is furnished to 39 | do so, all subject to the following: 40 | 41 | The copyright notices in the Software and this entire statement, including 42 | the above license grant, this restriction and the following disclaimer, 43 | must be included in all copies of the Software, in whole or in part, and 44 | all derivative works of the Software, unless such copies or derivative 45 | works are solely in the form of machine-executable object code generated by 46 | a source language processor. 47 | 48 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 49 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 50 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 51 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 52 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 53 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 54 | DEALINGS IN THE SOFTWARE. 55 | */ 56 | module bindbc.newton.funcs; 57 | 58 | import bindbc.newton.types; 59 | ''' 60 | 61 | binding += ''' 62 | extern(C) @nogc nothrow __gshared 63 | { 64 | ''' 65 | 66 | for f in funcs: 67 | retType = funcs[f][0] 68 | args = funcs[f][1] 69 | aliasName = 'da_' + f 70 | aliasStr = 'alias ' + aliasName + ' = ' 71 | aliasStr += typeToStr(retType) 72 | aliasStr += ' function(' 73 | aliasStr += ', '.join([argToStr(a) for a in args]) 74 | aliasStr += ');' 75 | binding += ' ' + aliasStr + '\n' 76 | binding += ' ' + aliasName + ' ' + f + ';' + '\n\n' 77 | 78 | binding += '}\n' 79 | 80 | headersFile = open('src/bindbc/newton/funcs.d', 'w') 81 | headersFile.write(binding) 82 | -------------------------------------------------------------------------------- /lib/x64/newton.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DLangGamedev/bindbc-newton/258a0683a438f2744492649b504e1c1bae37d3c6/lib/x64/newton.dll -------------------------------------------------------------------------------- /lib/x86/newton.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DLangGamedev/bindbc-newton/258a0683a438f2744492649b504e1c1bae37d3c6/lib/x86/newton.dll -------------------------------------------------------------------------------- /plugins/x64/dgNewtonAvx.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DLangGamedev/bindbc-newton/258a0683a438f2744492649b504e1c1bae37d3c6/plugins/x64/dgNewtonAvx.dll -------------------------------------------------------------------------------- /plugins/x64/dgNewtonAvx2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DLangGamedev/bindbc-newton/258a0683a438f2744492649b504e1c1bae37d3c6/plugins/x64/dgNewtonAvx2.dll -------------------------------------------------------------------------------- /plugins/x64/dgNewtonSse4.2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DLangGamedev/bindbc-newton/258a0683a438f2744492649b504e1c1bae37d3c6/plugins/x64/dgNewtonSse4.2.dll -------------------------------------------------------------------------------- /plugins/x86/dgNewtonAvx.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DLangGamedev/bindbc-newton/258a0683a438f2744492649b504e1c1bae37d3c6/plugins/x86/dgNewtonAvx.dll -------------------------------------------------------------------------------- /plugins/x86/dgNewtonAvx2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DLangGamedev/bindbc-newton/258a0683a438f2744492649b504e1c1bae37d3c6/plugins/x86/dgNewtonAvx2.dll -------------------------------------------------------------------------------- /plugins/x86/dgNewtonSse4.2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DLangGamedev/bindbc-newton/258a0683a438f2744492649b504e1c1bae37d3c6/plugins/x86/dgNewtonSse4.2.dll -------------------------------------------------------------------------------- /src/bindbc/newton/binddynamic.d: -------------------------------------------------------------------------------- 1 | /* 2 | Boost Software License - Version 1.0 - August 17th, 2003 3 | 4 | Permission is hereby granted, free of charge, to any person or organization 5 | obtaining a copy of the software and accompanying documentation covered by 6 | this license (the "Software") to use, reproduce, display, distribute, 7 | execute, and transmit the Software, and to prepare derivative works of the 8 | Software, and to permit third-parties to whom the Software is furnished to 9 | do so, all subject to the following: 10 | 11 | The copyright notices in the Software and this entire statement, including 12 | the above license grant, this restriction and the following disclaimer, 13 | must be included in all copies of the Software, in whole or in part, and 14 | all derivative works of the Software, unless such copies or derivative 15 | works are solely in the form of machine-executable object code generated by 16 | a source language processor. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 21 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 22 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 23 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 24 | DEALINGS IN THE SOFTWARE. 25 | */ 26 | module bindbc.newton.binddynamic; 27 | 28 | import bindbc.loader; 29 | import bindbc.newton.types; 30 | import bindbc.newton.funcs; 31 | 32 | enum NewtonSupport { 33 | noLibrary, 34 | badLibrary, 35 | newton314 36 | } 37 | 38 | private 39 | { 40 | SharedLib lib; 41 | NewtonSupport loadedVersion; 42 | } 43 | 44 | void unloadNewton() 45 | { 46 | if (lib != invalidHandle) 47 | { 48 | lib.unload(); 49 | } 50 | } 51 | 52 | NewtonSupport loadedNewtonVersion() { return loadedVersion; } 53 | bool isNewtonLoaded() { return lib != invalidHandle; } 54 | 55 | NewtonSupport loadNewton() 56 | { 57 | version(Windows) 58 | { 59 | const(char)[][1] libNames = 60 | [ 61 | "newton.dll" 62 | ]; 63 | } 64 | else version(OSX) 65 | { 66 | const(char)[][1] libNames = 67 | [ 68 | "/usr/local/lib/libnewton.dylib" 69 | ]; 70 | } 71 | else version(Posix) 72 | { 73 | const(char)[][2] libNames = 74 | [ 75 | "libnewton.so", 76 | "/usr/local/lib/libnewton.so" 77 | ]; 78 | } 79 | else static assert(0, "bindbc-newton is not yet supported on this platform."); 80 | 81 | NewtonSupport ret; 82 | foreach(name; libNames) 83 | { 84 | ret = loadNewton(name.ptr); 85 | if (ret != NewtonSupport.noLibrary) 86 | break; 87 | } 88 | return ret; 89 | } 90 | 91 | NewtonSupport loadNewton(const(char)* libName) 92 | { 93 | lib = load(libName); 94 | if(lib == invalidHandle) 95 | { 96 | return NewtonSupport.noLibrary; 97 | } 98 | 99 | auto errCount = errorCount(); 100 | loadedVersion = NewtonSupport.badLibrary; 101 | 102 | import std.algorithm.searching: startsWith; 103 | static foreach(m; __traits(allMembers, bindbc.newton.funcs)) 104 | { 105 | static if (m.startsWith("da_")) 106 | lib.bindSymbol( 107 | cast(void**)&__traits(getMember, bindbc.newton.funcs, m[3..$]), 108 | __traits(getMember, bindbc.newton.funcs, m[3..$]).stringof); 109 | } 110 | 111 | loadedVersion = NewtonSupport.newton314; 112 | 113 | if (errorCount() != errCount) 114 | return NewtonSupport.badLibrary; 115 | 116 | return loadedVersion; 117 | } 118 | -------------------------------------------------------------------------------- /src/bindbc/newton/funcs.d: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | Boost Software License - Version 1.0 - August 17th, 2003 4 | 5 | Permission is hereby granted, free of charge, to any person or organization 6 | obtaining a copy of the software and accompanying documentation covered by 7 | this license (the "Software") to use, reproduce, display, distribute, 8 | execute, and transmit the Software, and to prepare derivative works of the 9 | Software, and to permit third-parties to whom the Software is furnished to 10 | do so, all subject to the following: 11 | 12 | The copyright notices in the Software and this entire statement, including 13 | the above license grant, this restriction and the following disclaimer, 14 | must be included in all copies of the Software, in whole or in part, and 15 | all derivative works of the Software, unless such copies or derivative 16 | works are solely in the form of machine-executable object code generated by 17 | a source language processor. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 22 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 23 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 24 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | */ 27 | module bindbc.newton.funcs; 28 | 29 | import bindbc.newton.types; 30 | 31 | extern(C) @nogc nothrow __gshared 32 | { 33 | alias da_NewtonWorldGetVersion = int function(); 34 | da_NewtonWorldGetVersion NewtonWorldGetVersion; 35 | 36 | alias da_NewtonWorldFloatSize = int function(); 37 | da_NewtonWorldFloatSize NewtonWorldFloatSize; 38 | 39 | alias da_NewtonGetMemoryUsed = int function(); 40 | da_NewtonGetMemoryUsed NewtonGetMemoryUsed; 41 | 42 | alias da_NewtonSetMemorySystem = void function( NewtonAllocMemory malloc, NewtonFreeMemory free); 43 | da_NewtonSetMemorySystem NewtonSetMemorySystem; 44 | 45 | alias da_NewtonCreate = NewtonWorld* function(); 46 | da_NewtonCreate NewtonCreate; 47 | 48 | alias da_NewtonDestroy = void function(const NewtonWorld* newtonWorld); 49 | da_NewtonDestroy NewtonDestroy; 50 | 51 | alias da_NewtonDestroyAllBodies = void function(const NewtonWorld* newtonWorld); 52 | da_NewtonDestroyAllBodies NewtonDestroyAllBodies; 53 | 54 | alias da_NewtonGetPostUpdateCallback = NewtonPostUpdateCallback function(const NewtonWorld* newtonWorld); 55 | da_NewtonGetPostUpdateCallback NewtonGetPostUpdateCallback; 56 | 57 | alias da_NewtonSetPostUpdateCallback = void function(const NewtonWorld* newtonWorld, NewtonPostUpdateCallback callback); 58 | da_NewtonSetPostUpdateCallback NewtonSetPostUpdateCallback; 59 | 60 | alias da_NewtonAlloc = void* function( int sizeInBytes); 61 | da_NewtonAlloc NewtonAlloc; 62 | 63 | alias da_NewtonFree = void function( void* ptr); 64 | da_NewtonFree NewtonFree; 65 | 66 | alias da_NewtonLoadPlugins = void function(const NewtonWorld* newtonWorld, const char* plugInPath); 67 | da_NewtonLoadPlugins NewtonLoadPlugins; 68 | 69 | alias da_NewtonUnloadPlugins = void function(const NewtonWorld* newtonWorld); 70 | da_NewtonUnloadPlugins NewtonUnloadPlugins; 71 | 72 | alias da_NewtonCurrentPlugin = void* function(const NewtonWorld* newtonWorld); 73 | da_NewtonCurrentPlugin NewtonCurrentPlugin; 74 | 75 | alias da_NewtonGetFirstPlugin = void* function(const NewtonWorld* newtonWorld); 76 | da_NewtonGetFirstPlugin NewtonGetFirstPlugin; 77 | 78 | alias da_NewtonGetPreferedPlugin = void* function(const NewtonWorld* newtonWorld); 79 | da_NewtonGetPreferedPlugin NewtonGetPreferedPlugin; 80 | 81 | alias da_NewtonGetNextPlugin = void* function(const NewtonWorld* newtonWorld, const void* plugin); 82 | da_NewtonGetNextPlugin NewtonGetNextPlugin; 83 | 84 | alias da_NewtonGetPluginString = const char* function(const NewtonWorld* newtonWorld, const void* plugin); 85 | da_NewtonGetPluginString NewtonGetPluginString; 86 | 87 | alias da_NewtonSelectPlugin = void function(const NewtonWorld* newtonWorld, const void* plugin); 88 | da_NewtonSelectPlugin NewtonSelectPlugin; 89 | 90 | alias da_NewtonGetContactMergeTolerance = dFloat function(const NewtonWorld* newtonWorld); 91 | da_NewtonGetContactMergeTolerance NewtonGetContactMergeTolerance; 92 | 93 | alias da_NewtonSetContactMergeTolerance = void function(const NewtonWorld* newtonWorld, dFloat tolerance); 94 | da_NewtonSetContactMergeTolerance NewtonSetContactMergeTolerance; 95 | 96 | alias da_NewtonInvalidateCache = void function(const NewtonWorld* newtonWorld); 97 | da_NewtonInvalidateCache NewtonInvalidateCache; 98 | 99 | alias da_NewtonSetSolverIterations = void function(const NewtonWorld* newtonWorld, int model); 100 | da_NewtonSetSolverIterations NewtonSetSolverIterations; 101 | 102 | alias da_NewtonGetSolverIterations = int function(const NewtonWorld* newtonWorld); 103 | da_NewtonGetSolverIterations NewtonGetSolverIterations; 104 | 105 | alias da_NewtonSetParallelSolverOnLargeIsland = void function(const NewtonWorld* newtonWorld, int mode); 106 | da_NewtonSetParallelSolverOnLargeIsland NewtonSetParallelSolverOnLargeIsland; 107 | 108 | alias da_NewtonGetParallelSolverOnLargeIsland = int function(const NewtonWorld* newtonWorld); 109 | da_NewtonGetParallelSolverOnLargeIsland NewtonGetParallelSolverOnLargeIsland; 110 | 111 | alias da_NewtonGetBroadphaseAlgorithm = int function(const NewtonWorld* newtonWorld); 112 | da_NewtonGetBroadphaseAlgorithm NewtonGetBroadphaseAlgorithm; 113 | 114 | alias da_NewtonSelectBroadphaseAlgorithm = void function(const NewtonWorld* newtonWorld, int algorithmType); 115 | da_NewtonSelectBroadphaseAlgorithm NewtonSelectBroadphaseAlgorithm; 116 | 117 | alias da_NewtonResetBroadphase = void function(const NewtonWorld* newtonWorld); 118 | da_NewtonResetBroadphase NewtonResetBroadphase; 119 | 120 | alias da_NewtonUpdate = void function(const NewtonWorld* newtonWorld, dFloat timestep); 121 | da_NewtonUpdate NewtonUpdate; 122 | 123 | alias da_NewtonUpdateAsync = void function(const NewtonWorld* newtonWorld, dFloat timestep); 124 | da_NewtonUpdateAsync NewtonUpdateAsync; 125 | 126 | alias da_NewtonWaitForUpdateToFinish = void function(const NewtonWorld* newtonWorld); 127 | da_NewtonWaitForUpdateToFinish NewtonWaitForUpdateToFinish; 128 | 129 | alias da_NewtonGetNumberOfSubsteps = int function(const NewtonWorld* newtonWorld); 130 | da_NewtonGetNumberOfSubsteps NewtonGetNumberOfSubsteps; 131 | 132 | alias da_NewtonSetNumberOfSubsteps = void function(const NewtonWorld* newtonWorld, int subSteps); 133 | da_NewtonSetNumberOfSubsteps NewtonSetNumberOfSubsteps; 134 | 135 | alias da_NewtonGetLastUpdateTime = dFloat function(const NewtonWorld* newtonWorld); 136 | da_NewtonGetLastUpdateTime NewtonGetLastUpdateTime; 137 | 138 | alias da_NewtonSerializeToFile = void function(const NewtonWorld* newtonWorld, const char* filename, NewtonOnBodySerializationCallback bodyCallback, void* bodyUserData); 139 | da_NewtonSerializeToFile NewtonSerializeToFile; 140 | 141 | alias da_NewtonDeserializeFromFile = void function(const NewtonWorld* newtonWorld, const char* filename, NewtonOnBodyDeserializationCallback bodyCallback, void* bodyUserData); 142 | da_NewtonDeserializeFromFile NewtonDeserializeFromFile; 143 | 144 | alias da_NewtonSerializeScene = void function(const NewtonWorld* newtonWorld, NewtonOnBodySerializationCallback bodyCallback, void* bodyUserData, NewtonSerializeCallback serializeCallback, void* serializeHandle); 145 | da_NewtonSerializeScene NewtonSerializeScene; 146 | 147 | alias da_NewtonDeserializeScene = void function(const NewtonWorld* newtonWorld, NewtonOnBodyDeserializationCallback bodyCallback, void* bodyUserData, NewtonDeserializeCallback serializeCallback, void* serializeHandle); 148 | da_NewtonDeserializeScene NewtonDeserializeScene; 149 | 150 | alias da_NewtonFindSerializedBody = NewtonBody* function(const NewtonWorld* newtonWorld, int bodySerializedID); 151 | da_NewtonFindSerializedBody NewtonFindSerializedBody; 152 | 153 | alias da_NewtonSetJointSerializationCallbacks = void function(const NewtonWorld* newtonWorld, NewtonOnJointSerializationCallback serializeJoint, NewtonOnJointDeserializationCallback deserializeJoint); 154 | da_NewtonSetJointSerializationCallbacks NewtonSetJointSerializationCallbacks; 155 | 156 | alias da_NewtonGetJointSerializationCallbacks = void function(const NewtonWorld* newtonWorld, NewtonOnJointSerializationCallback* serializeJoint, NewtonOnJointDeserializationCallback* deserializeJoint); 157 | da_NewtonGetJointSerializationCallbacks NewtonGetJointSerializationCallbacks; 158 | 159 | alias da_NewtonWorldCriticalSectionLock = void function(const NewtonWorld* newtonWorld, int threadIndex); 160 | da_NewtonWorldCriticalSectionLock NewtonWorldCriticalSectionLock; 161 | 162 | alias da_NewtonWorldCriticalSectionUnlock = void function(const NewtonWorld* newtonWorld); 163 | da_NewtonWorldCriticalSectionUnlock NewtonWorldCriticalSectionUnlock; 164 | 165 | alias da_NewtonSetThreadsCount = void function(const NewtonWorld* newtonWorld, int threads); 166 | da_NewtonSetThreadsCount NewtonSetThreadsCount; 167 | 168 | alias da_NewtonGetThreadsCount = int function(const NewtonWorld* newtonWorld); 169 | da_NewtonGetThreadsCount NewtonGetThreadsCount; 170 | 171 | alias da_NewtonGetMaxThreadsCount = int function(const NewtonWorld* newtonWorld); 172 | da_NewtonGetMaxThreadsCount NewtonGetMaxThreadsCount; 173 | 174 | alias da_NewtonDispachThreadJob = void function(const NewtonWorld* newtonWorld, NewtonJobTask task, void* usedData, const char* functionName); 175 | da_NewtonDispachThreadJob NewtonDispachThreadJob; 176 | 177 | alias da_NewtonSyncThreadJobs = void function(const NewtonWorld* newtonWorld); 178 | da_NewtonSyncThreadJobs NewtonSyncThreadJobs; 179 | 180 | alias da_NewtonAtomicAdd = int function( int* ptr, int value); 181 | da_NewtonAtomicAdd NewtonAtomicAdd; 182 | 183 | alias da_NewtonAtomicSwap = int function( int* ptr, int value); 184 | da_NewtonAtomicSwap NewtonAtomicSwap; 185 | 186 | alias da_NewtonYield = void function(); 187 | da_NewtonYield NewtonYield; 188 | 189 | alias da_NewtonSetIslandUpdateEvent = void function(const NewtonWorld* newtonWorld, NewtonIslandUpdate islandUpdate); 190 | da_NewtonSetIslandUpdateEvent NewtonSetIslandUpdateEvent; 191 | 192 | alias da_NewtonWorldForEachJointDo = void function(const NewtonWorld* newtonWorld, NewtonJointIterator callback, void* userData); 193 | da_NewtonWorldForEachJointDo NewtonWorldForEachJointDo; 194 | 195 | alias da_NewtonWorldForEachBodyInAABBDo = void function(const NewtonWorld* newtonWorld, const dFloat* p0, const dFloat* p1, NewtonBodyIterator callback, void* userData); 196 | da_NewtonWorldForEachBodyInAABBDo NewtonWorldForEachBodyInAABBDo; 197 | 198 | alias da_NewtonWorldSetUserData = void function(const NewtonWorld* newtonWorld, void* userData); 199 | da_NewtonWorldSetUserData NewtonWorldSetUserData; 200 | 201 | alias da_NewtonWorldGetUserData = void* function(const NewtonWorld* newtonWorld); 202 | da_NewtonWorldGetUserData NewtonWorldGetUserData; 203 | 204 | alias da_NewtonWorldAddListener = void* function(const NewtonWorld* newtonWorld, const char* nameId, void* listenerUserData); 205 | da_NewtonWorldAddListener NewtonWorldAddListener; 206 | 207 | alias da_NewtonWorldGetListener = void* function(const NewtonWorld* newtonWorld, const char* nameId); 208 | da_NewtonWorldGetListener NewtonWorldGetListener; 209 | 210 | alias da_NewtonWorldListenerSetDebugCallback = void function(const NewtonWorld* newtonWorld, void* listener, NewtonWorldListenerDebugCallback callback); 211 | da_NewtonWorldListenerSetDebugCallback NewtonWorldListenerSetDebugCallback; 212 | 213 | alias da_NewtonWorldListenerSetPostStepCallback = void function(const NewtonWorld* newtonWorld, void* listener, NewtonWorldUpdateListenerCallback callback); 214 | da_NewtonWorldListenerSetPostStepCallback NewtonWorldListenerSetPostStepCallback; 215 | 216 | alias da_NewtonWorldListenerSetPreUpdateCallback = void function(const NewtonWorld* newtonWorld, void* listener, NewtonWorldUpdateListenerCallback callback); 217 | da_NewtonWorldListenerSetPreUpdateCallback NewtonWorldListenerSetPreUpdateCallback; 218 | 219 | alias da_NewtonWorldListenerSetPostUpdateCallback = void function(const NewtonWorld* newtonWorld, void* listener, NewtonWorldUpdateListenerCallback callback); 220 | da_NewtonWorldListenerSetPostUpdateCallback NewtonWorldListenerSetPostUpdateCallback; 221 | 222 | alias da_NewtonWorldListenerSetDestructorCallback = void function(const NewtonWorld* newtonWorld, void* listener, NewtonWorldDestroyListenerCallback callback); 223 | da_NewtonWorldListenerSetDestructorCallback NewtonWorldListenerSetDestructorCallback; 224 | 225 | alias da_NewtonWorldListenerSetBodyDestroyCallback = void function(const NewtonWorld* newtonWorld, void* listener, NewtonWorldListenerBodyDestroyCallback callback); 226 | da_NewtonWorldListenerSetBodyDestroyCallback NewtonWorldListenerSetBodyDestroyCallback; 227 | 228 | alias da_NewtonWorldListenerDebug = void function(const NewtonWorld* newtonWorld, void* context); 229 | da_NewtonWorldListenerDebug NewtonWorldListenerDebug; 230 | 231 | alias da_NewtonWorldGetListenerUserData = void* function(const NewtonWorld* newtonWorld, void* listener); 232 | da_NewtonWorldGetListenerUserData NewtonWorldGetListenerUserData; 233 | 234 | alias da_NewtonWorldListenerGetBodyDestroyCallback = NewtonWorldListenerBodyDestroyCallback function(const NewtonWorld* newtonWorld, void* listener); 235 | da_NewtonWorldListenerGetBodyDestroyCallback NewtonWorldListenerGetBodyDestroyCallback; 236 | 237 | alias da_NewtonWorldSetDestructorCallback = void function(const NewtonWorld* newtonWorld, NewtonWorldDestructorCallback destructor); 238 | da_NewtonWorldSetDestructorCallback NewtonWorldSetDestructorCallback; 239 | 240 | alias da_NewtonWorldGetDestructorCallback = NewtonWorldDestructorCallback function(const NewtonWorld* newtonWorld); 241 | da_NewtonWorldGetDestructorCallback NewtonWorldGetDestructorCallback; 242 | 243 | alias da_NewtonWorldSetCollisionConstructorDestructorCallback = void function(const NewtonWorld* newtonWorld, NewtonCollisionCopyConstructionCallback constructor, NewtonCollisionDestructorCallback destructor); 244 | da_NewtonWorldSetCollisionConstructorDestructorCallback NewtonWorldSetCollisionConstructorDestructorCallback; 245 | 246 | alias da_NewtonWorldSetCreateDestroyContactCallback = void function(const NewtonWorld* newtonWorld, NewtonCreateContactCallback createContact, NewtonDestroyContactCallback destroyContact); 247 | da_NewtonWorldSetCreateDestroyContactCallback NewtonWorldSetCreateDestroyContactCallback; 248 | 249 | alias da_NewtonWorldRayCast = void function(const NewtonWorld* newtonWorld, const dFloat* p0, const dFloat* p1, NewtonWorldRayFilterCallback filter, void* userData, NewtonWorldRayPrefilterCallback prefilter, int threadIndex); 250 | da_NewtonWorldRayCast NewtonWorldRayCast; 251 | 252 | alias da_NewtonWorldConvexCast = int function(const NewtonWorld* newtonWorld, const dFloat* matrix, const dFloat* target, const NewtonCollision* shape, dFloat* param, void* userData, NewtonWorldRayPrefilterCallback prefilter, NewtonWorldConvexCastReturnInfo* info, int maxContactsCount, int threadIndex); 253 | da_NewtonWorldConvexCast NewtonWorldConvexCast; 254 | 255 | alias da_NewtonWorldCollide = int function(const NewtonWorld* newtonWorld, const dFloat* matrix, const NewtonCollision* shape, void* userData, NewtonWorldRayPrefilterCallback prefilter, NewtonWorldConvexCastReturnInfo* info, int maxContactsCount, int threadIndex); 256 | da_NewtonWorldCollide NewtonWorldCollide; 257 | 258 | alias da_NewtonWorldGetBodyCount = int function(const NewtonWorld* newtonWorld); 259 | da_NewtonWorldGetBodyCount NewtonWorldGetBodyCount; 260 | 261 | alias da_NewtonWorldGetConstraintCount = int function(const NewtonWorld* newtonWorld); 262 | da_NewtonWorldGetConstraintCount NewtonWorldGetConstraintCount; 263 | 264 | alias da_NewtonWorldFindJoint = NewtonJoint* function(const NewtonBody* body0, const NewtonBody* body1); 265 | da_NewtonWorldFindJoint NewtonWorldFindJoint; 266 | 267 | alias da_NewtonIslandGetBody = NewtonBody* function(const void* island, int bodyIndex); 268 | da_NewtonIslandGetBody NewtonIslandGetBody; 269 | 270 | alias da_NewtonIslandGetBodyAABB = void function(const void* island, int bodyIndex, dFloat* p0, dFloat* p1); 271 | da_NewtonIslandGetBodyAABB NewtonIslandGetBodyAABB; 272 | 273 | alias da_NewtonMaterialCreateGroupID = int function(const NewtonWorld* newtonWorld); 274 | da_NewtonMaterialCreateGroupID NewtonMaterialCreateGroupID; 275 | 276 | alias da_NewtonMaterialGetDefaultGroupID = int function(const NewtonWorld* newtonWorld); 277 | da_NewtonMaterialGetDefaultGroupID NewtonMaterialGetDefaultGroupID; 278 | 279 | alias da_NewtonMaterialDestroyAllGroupID = void function(const NewtonWorld* newtonWorld); 280 | da_NewtonMaterialDestroyAllGroupID NewtonMaterialDestroyAllGroupID; 281 | 282 | alias da_NewtonMaterialGetUserData = void* function(const NewtonWorld* newtonWorld, int id0, int id1); 283 | da_NewtonMaterialGetUserData NewtonMaterialGetUserData; 284 | 285 | alias da_NewtonMaterialSetSurfaceThickness = void function(const NewtonWorld* newtonWorld, int id0, int id1, dFloat thickness); 286 | da_NewtonMaterialSetSurfaceThickness NewtonMaterialSetSurfaceThickness; 287 | 288 | alias da_NewtonMaterialSetCallbackUserData = void function(const NewtonWorld* newtonWorld, int id0, int id1, void* userData); 289 | da_NewtonMaterialSetCallbackUserData NewtonMaterialSetCallbackUserData; 290 | 291 | alias da_NewtonMaterialSetContactGenerationCallback = void function(const NewtonWorld* newtonWorld, int id0, int id1, NewtonOnContactGeneration contactGeneration); 292 | da_NewtonMaterialSetContactGenerationCallback NewtonMaterialSetContactGenerationCallback; 293 | 294 | alias da_NewtonMaterialSetCompoundCollisionCallback = void function(const NewtonWorld* newtonWorld, int id0, int id1, NewtonOnCompoundSubCollisionAABBOverlap compoundAabbOverlap); 295 | da_NewtonMaterialSetCompoundCollisionCallback NewtonMaterialSetCompoundCollisionCallback; 296 | 297 | alias da_NewtonMaterialSetCollisionCallback = void function(const NewtonWorld* newtonWorld, int id0, int id1, NewtonOnAABBOverlap aabbOverlap, NewtonContactsProcess process); 298 | da_NewtonMaterialSetCollisionCallback NewtonMaterialSetCollisionCallback; 299 | 300 | alias da_NewtonMaterialSetDefaultSoftness = void function(const NewtonWorld* newtonWorld, int id0, int id1, dFloat value); 301 | da_NewtonMaterialSetDefaultSoftness NewtonMaterialSetDefaultSoftness; 302 | 303 | alias da_NewtonMaterialSetDefaultElasticity = void function(const NewtonWorld* newtonWorld, int id0, int id1, dFloat elasticCoef); 304 | da_NewtonMaterialSetDefaultElasticity NewtonMaterialSetDefaultElasticity; 305 | 306 | alias da_NewtonMaterialSetDefaultCollidable = void function(const NewtonWorld* newtonWorld, int id0, int id1, int state); 307 | da_NewtonMaterialSetDefaultCollidable NewtonMaterialSetDefaultCollidable; 308 | 309 | alias da_NewtonMaterialSetDefaultFriction = void function(const NewtonWorld* newtonWorld, int id0, int id1, dFloat staticFriction, dFloat kineticFriction); 310 | da_NewtonMaterialSetDefaultFriction NewtonMaterialSetDefaultFriction; 311 | 312 | alias da_NewtonMaterialJointResetIntraJointCollision = void function(const NewtonWorld* newtonWorld, int id0, int id1); 313 | da_NewtonMaterialJointResetIntraJointCollision NewtonMaterialJointResetIntraJointCollision; 314 | 315 | alias da_NewtonMaterialJointResetSelftJointCollision = void function(const NewtonWorld* newtonWorld, int id0, int id1); 316 | da_NewtonMaterialJointResetSelftJointCollision NewtonMaterialJointResetSelftJointCollision; 317 | 318 | alias da_NewtonWorldGetFirstMaterial = NewtonMaterial* function(const NewtonWorld* newtonWorld); 319 | da_NewtonWorldGetFirstMaterial NewtonWorldGetFirstMaterial; 320 | 321 | alias da_NewtonWorldGetNextMaterial = NewtonMaterial* function(const NewtonWorld* newtonWorld, const NewtonMaterial* material); 322 | da_NewtonWorldGetNextMaterial NewtonWorldGetNextMaterial; 323 | 324 | alias da_NewtonWorldGetFirstBody = NewtonBody* function(const NewtonWorld* newtonWorld); 325 | da_NewtonWorldGetFirstBody NewtonWorldGetFirstBody; 326 | 327 | alias da_NewtonWorldGetNextBody = NewtonBody* function(const NewtonWorld* newtonWorld, const NewtonBody* curBody); 328 | da_NewtonWorldGetNextBody NewtonWorldGetNextBody; 329 | 330 | alias da_NewtonMaterialGetMaterialPairUserData = void* function(const NewtonMaterial* material); 331 | da_NewtonMaterialGetMaterialPairUserData NewtonMaterialGetMaterialPairUserData; 332 | 333 | alias da_NewtonMaterialGetContactFaceAttribute = uint function(const NewtonMaterial* material); 334 | da_NewtonMaterialGetContactFaceAttribute NewtonMaterialGetContactFaceAttribute; 335 | 336 | alias da_NewtonMaterialGetBodyCollidingShape = NewtonCollision* function(const NewtonMaterial* material, const NewtonBody* _body); 337 | da_NewtonMaterialGetBodyCollidingShape NewtonMaterialGetBodyCollidingShape; 338 | 339 | alias da_NewtonMaterialGetContactNormalSpeed = dFloat function(const NewtonMaterial* material); 340 | da_NewtonMaterialGetContactNormalSpeed NewtonMaterialGetContactNormalSpeed; 341 | 342 | alias da_NewtonMaterialGetContactForce = void function(const NewtonMaterial* material, const NewtonBody* _body, dFloat* force); 343 | da_NewtonMaterialGetContactForce NewtonMaterialGetContactForce; 344 | 345 | alias da_NewtonMaterialGetContactPositionAndNormal = void function(const NewtonMaterial* material, const NewtonBody* _body, dFloat* posit, dFloat* normal); 346 | da_NewtonMaterialGetContactPositionAndNormal NewtonMaterialGetContactPositionAndNormal; 347 | 348 | alias da_NewtonMaterialGetContactTangentDirections = void function(const NewtonMaterial* material, const NewtonBody* _body, dFloat* dir0, dFloat* dir1); 349 | da_NewtonMaterialGetContactTangentDirections NewtonMaterialGetContactTangentDirections; 350 | 351 | alias da_NewtonMaterialGetContactTangentSpeed = dFloat function(const NewtonMaterial* material, int index); 352 | da_NewtonMaterialGetContactTangentSpeed NewtonMaterialGetContactTangentSpeed; 353 | 354 | alias da_NewtonMaterialGetContactMaxNormalImpact = dFloat function(const NewtonMaterial* material); 355 | da_NewtonMaterialGetContactMaxNormalImpact NewtonMaterialGetContactMaxNormalImpact; 356 | 357 | alias da_NewtonMaterialGetContactMaxTangentImpact = dFloat function(const NewtonMaterial* material, int index); 358 | da_NewtonMaterialGetContactMaxTangentImpact NewtonMaterialGetContactMaxTangentImpact; 359 | 360 | alias da_NewtonMaterialGetContactPenetration = dFloat function(const NewtonMaterial* material); 361 | da_NewtonMaterialGetContactPenetration NewtonMaterialGetContactPenetration; 362 | 363 | alias da_NewtonMaterialSetAsSoftContact = void function(const NewtonMaterial* material, dFloat relaxation); 364 | da_NewtonMaterialSetAsSoftContact NewtonMaterialSetAsSoftContact; 365 | 366 | alias da_NewtonMaterialSetContactSoftness = void function(const NewtonMaterial* material, dFloat softness); 367 | da_NewtonMaterialSetContactSoftness NewtonMaterialSetContactSoftness; 368 | 369 | alias da_NewtonMaterialSetContactThickness = void function(const NewtonMaterial* material, dFloat thickness); 370 | da_NewtonMaterialSetContactThickness NewtonMaterialSetContactThickness; 371 | 372 | alias da_NewtonMaterialSetContactElasticity = void function(const NewtonMaterial* material, dFloat restitution); 373 | da_NewtonMaterialSetContactElasticity NewtonMaterialSetContactElasticity; 374 | 375 | alias da_NewtonMaterialSetContactFrictionState = void function(const NewtonMaterial* material, int state, int index); 376 | da_NewtonMaterialSetContactFrictionState NewtonMaterialSetContactFrictionState; 377 | 378 | alias da_NewtonMaterialSetContactFrictionCoef = void function(const NewtonMaterial* material, dFloat staticFrictionCoef, dFloat kineticFrictionCoef, int index); 379 | da_NewtonMaterialSetContactFrictionCoef NewtonMaterialSetContactFrictionCoef; 380 | 381 | alias da_NewtonMaterialSetContactNormalAcceleration = void function(const NewtonMaterial* material, dFloat accel); 382 | da_NewtonMaterialSetContactNormalAcceleration NewtonMaterialSetContactNormalAcceleration; 383 | 384 | alias da_NewtonMaterialSetContactNormalDirection = void function(const NewtonMaterial* material, const dFloat* directionVector); 385 | da_NewtonMaterialSetContactNormalDirection NewtonMaterialSetContactNormalDirection; 386 | 387 | alias da_NewtonMaterialSetContactPosition = void function(const NewtonMaterial* material, const dFloat* position); 388 | da_NewtonMaterialSetContactPosition NewtonMaterialSetContactPosition; 389 | 390 | alias da_NewtonMaterialSetContactTangentFriction = void function(const NewtonMaterial* material, dFloat friction, int index); 391 | da_NewtonMaterialSetContactTangentFriction NewtonMaterialSetContactTangentFriction; 392 | 393 | alias da_NewtonMaterialSetContactTangentAcceleration = void function(const NewtonMaterial* material, dFloat accel, int index); 394 | da_NewtonMaterialSetContactTangentAcceleration NewtonMaterialSetContactTangentAcceleration; 395 | 396 | alias da_NewtonMaterialContactRotateTangentDirections = void function(const NewtonMaterial* material, const dFloat* directionVector); 397 | da_NewtonMaterialContactRotateTangentDirections NewtonMaterialContactRotateTangentDirections; 398 | 399 | alias da_NewtonMaterialGetContactPruningTolerance = dFloat function(const NewtonJoint* contactJoint); 400 | da_NewtonMaterialGetContactPruningTolerance NewtonMaterialGetContactPruningTolerance; 401 | 402 | alias da_NewtonMaterialSetContactPruningTolerance = void function(const NewtonJoint* contactJoint, dFloat tolerance); 403 | da_NewtonMaterialSetContactPruningTolerance NewtonMaterialSetContactPruningTolerance; 404 | 405 | alias da_NewtonCreateNull = NewtonCollision* function(const NewtonWorld* newtonWorld); 406 | da_NewtonCreateNull NewtonCreateNull; 407 | 408 | alias da_NewtonCreateSphere = NewtonCollision* function(const NewtonWorld* newtonWorld, dFloat radius, int shapeID, const dFloat* offsetMatrix); 409 | da_NewtonCreateSphere NewtonCreateSphere; 410 | 411 | alias da_NewtonCreateBox = NewtonCollision* function(const NewtonWorld* newtonWorld, dFloat dx, dFloat dy, dFloat dz, int shapeID, const dFloat* offsetMatrix); 412 | da_NewtonCreateBox NewtonCreateBox; 413 | 414 | alias da_NewtonCreateCone = NewtonCollision* function(const NewtonWorld* newtonWorld, dFloat radius, dFloat height, int shapeID, const dFloat* offsetMatrix); 415 | da_NewtonCreateCone NewtonCreateCone; 416 | 417 | alias da_NewtonCreateCapsule = NewtonCollision* function(const NewtonWorld* newtonWorld, dFloat radius0, dFloat radius1, dFloat height, int shapeID, const dFloat* offsetMatrix); 418 | da_NewtonCreateCapsule NewtonCreateCapsule; 419 | 420 | alias da_NewtonCreateCylinder = NewtonCollision* function(const NewtonWorld* newtonWorld, dFloat radio0, dFloat radio1, dFloat height, int shapeID, const dFloat* offsetMatrix); 421 | da_NewtonCreateCylinder NewtonCreateCylinder; 422 | 423 | alias da_NewtonCreateChamferCylinder = NewtonCollision* function(const NewtonWorld* newtonWorld, dFloat radius, dFloat height, int shapeID, const dFloat* offsetMatrix); 424 | da_NewtonCreateChamferCylinder NewtonCreateChamferCylinder; 425 | 426 | alias da_NewtonCreateConvexHull = NewtonCollision* function(const NewtonWorld* newtonWorld, int count, const dFloat* vertexCloud, int strideInBytes, dFloat tolerance, int shapeID, const dFloat* offsetMatrix); 427 | da_NewtonCreateConvexHull NewtonCreateConvexHull; 428 | 429 | alias da_NewtonCreateConvexHullFromMesh = NewtonCollision* function(const NewtonWorld* newtonWorld, const NewtonMesh* mesh, dFloat tolerance, int shapeID); 430 | da_NewtonCreateConvexHullFromMesh NewtonCreateConvexHullFromMesh; 431 | 432 | alias da_NewtonCollisionGetMode = int function(const NewtonCollision* convexCollision); 433 | da_NewtonCollisionGetMode NewtonCollisionGetMode; 434 | 435 | alias da_NewtonCollisionSetMode = void function(const NewtonCollision* convexCollision, int mode); 436 | da_NewtonCollisionSetMode NewtonCollisionSetMode; 437 | 438 | alias da_NewtonConvexHullGetFaceIndices = int function(const NewtonCollision* convexHullCollision, int face, int* faceIndices); 439 | da_NewtonConvexHullGetFaceIndices NewtonConvexHullGetFaceIndices; 440 | 441 | alias da_NewtonConvexHullGetVertexData = int function(const NewtonCollision* convexHullCollision, dFloat* * vertexData, int* strideInBytes); 442 | da_NewtonConvexHullGetVertexData NewtonConvexHullGetVertexData; 443 | 444 | alias da_NewtonConvexCollisionCalculateVolume = dFloat function(const NewtonCollision* convexCollision); 445 | da_NewtonConvexCollisionCalculateVolume NewtonConvexCollisionCalculateVolume; 446 | 447 | alias da_NewtonConvexCollisionCalculateInertialMatrix = void function(const NewtonCollision* convexCollision, dFloat* inertia, dFloat* origin); 448 | da_NewtonConvexCollisionCalculateInertialMatrix NewtonConvexCollisionCalculateInertialMatrix; 449 | 450 | alias da_NewtonConvexCollisionCalculateBuoyancyVolume = dFloat function(const NewtonCollision* convexCollision, const dFloat* matrix, const dFloat* fluidPlane, dFloat* centerOfBuoyancy); 451 | da_NewtonConvexCollisionCalculateBuoyancyVolume NewtonConvexCollisionCalculateBuoyancyVolume; 452 | 453 | alias da_NewtonCollisionDataPointer = const void* function(const NewtonCollision* convexCollision); 454 | da_NewtonCollisionDataPointer NewtonCollisionDataPointer; 455 | 456 | alias da_NewtonCreateCompoundCollision = NewtonCollision* function(const NewtonWorld* newtonWorld, int shapeID); 457 | da_NewtonCreateCompoundCollision NewtonCreateCompoundCollision; 458 | 459 | alias da_NewtonCreateCompoundCollisionFromMesh = NewtonCollision* function(const NewtonWorld* newtonWorld, const NewtonMesh* mesh, dFloat hullTolerance, int shapeID, int subShapeID); 460 | da_NewtonCreateCompoundCollisionFromMesh NewtonCreateCompoundCollisionFromMesh; 461 | 462 | alias da_NewtonCompoundCollisionBeginAddRemove = void function( NewtonCollision* compoundCollision); 463 | da_NewtonCompoundCollisionBeginAddRemove NewtonCompoundCollisionBeginAddRemove; 464 | 465 | alias da_NewtonCompoundCollisionAddSubCollision = void* function( NewtonCollision* compoundCollision, const NewtonCollision* convexCollision); 466 | da_NewtonCompoundCollisionAddSubCollision NewtonCompoundCollisionAddSubCollision; 467 | 468 | alias da_NewtonCompoundCollisionRemoveSubCollision = void function( NewtonCollision* compoundCollision, const void* collisionNode); 469 | da_NewtonCompoundCollisionRemoveSubCollision NewtonCompoundCollisionRemoveSubCollision; 470 | 471 | alias da_NewtonCompoundCollisionRemoveSubCollisionByIndex = void function( NewtonCollision* compoundCollision, int nodeIndex); 472 | da_NewtonCompoundCollisionRemoveSubCollisionByIndex NewtonCompoundCollisionRemoveSubCollisionByIndex; 473 | 474 | alias da_NewtonCompoundCollisionSetSubCollisionMatrix = void function( NewtonCollision* compoundCollision, const void* collisionNode, const dFloat* matrix); 475 | da_NewtonCompoundCollisionSetSubCollisionMatrix NewtonCompoundCollisionSetSubCollisionMatrix; 476 | 477 | alias da_NewtonCompoundCollisionEndAddRemove = void function( NewtonCollision* compoundCollision); 478 | da_NewtonCompoundCollisionEndAddRemove NewtonCompoundCollisionEndAddRemove; 479 | 480 | alias da_NewtonCompoundCollisionGetFirstNode = void* function( NewtonCollision* compoundCollision); 481 | da_NewtonCompoundCollisionGetFirstNode NewtonCompoundCollisionGetFirstNode; 482 | 483 | alias da_NewtonCompoundCollisionGetNextNode = void* function( NewtonCollision* compoundCollision, const void* collisionNode); 484 | da_NewtonCompoundCollisionGetNextNode NewtonCompoundCollisionGetNextNode; 485 | 486 | alias da_NewtonCompoundCollisionGetNodeByIndex = void* function( NewtonCollision* compoundCollision, int index); 487 | da_NewtonCompoundCollisionGetNodeByIndex NewtonCompoundCollisionGetNodeByIndex; 488 | 489 | alias da_NewtonCompoundCollisionGetNodeIndex = int function( NewtonCollision* compoundCollision, const void* collisionNode); 490 | da_NewtonCompoundCollisionGetNodeIndex NewtonCompoundCollisionGetNodeIndex; 491 | 492 | alias da_NewtonCompoundCollisionGetCollisionFromNode = NewtonCollision* function( NewtonCollision* compoundCollision, const void* collisionNode); 493 | da_NewtonCompoundCollisionGetCollisionFromNode NewtonCompoundCollisionGetCollisionFromNode; 494 | 495 | alias da_NewtonCreateFracturedCompoundCollision = NewtonCollision* function(const NewtonWorld* newtonWorld, const NewtonMesh* solidMesh, int shapeID, int fracturePhysicsMaterialID, int pointcloudCount, const dFloat* vertexCloud, int strideInBytes, int materialID, const dFloat* textureMatrix, NewtonFractureCompoundCollisionReconstructMainMeshCallBack regenerateMainMeshCallback, NewtonFractureCompoundCollisionOnEmitCompoundFractured emitFracturedCompound, NewtonFractureCompoundCollisionOnEmitChunk emitFracfuredChunk); 496 | da_NewtonCreateFracturedCompoundCollision NewtonCreateFracturedCompoundCollision; 497 | 498 | alias da_NewtonFracturedCompoundPlaneClip = NewtonCollision* function(const NewtonCollision* fracturedCompound, const dFloat* plane); 499 | da_NewtonFracturedCompoundPlaneClip NewtonFracturedCompoundPlaneClip; 500 | 501 | alias da_NewtonFracturedCompoundSetCallbacks = void function(const NewtonCollision* fracturedCompound, NewtonFractureCompoundCollisionReconstructMainMeshCallBack regenerateMainMeshCallback, NewtonFractureCompoundCollisionOnEmitCompoundFractured emitFracturedCompound, NewtonFractureCompoundCollisionOnEmitChunk emitFracfuredChunk); 502 | da_NewtonFracturedCompoundSetCallbacks NewtonFracturedCompoundSetCallbacks; 503 | 504 | alias da_NewtonFracturedCompoundIsNodeFreeToDetach = int function(const NewtonCollision* fracturedCompound, void* collisionNode); 505 | da_NewtonFracturedCompoundIsNodeFreeToDetach NewtonFracturedCompoundIsNodeFreeToDetach; 506 | 507 | alias da_NewtonFracturedCompoundNeighborNodeList = int function(const NewtonCollision* fracturedCompound, void* collisionNode, void* * list, int maxCount); 508 | da_NewtonFracturedCompoundNeighborNodeList NewtonFracturedCompoundNeighborNodeList; 509 | 510 | alias da_NewtonFracturedCompoundGetMainMesh = NewtonFracturedCompoundMeshPart* function(const NewtonCollision* fracturedCompound); 511 | da_NewtonFracturedCompoundGetMainMesh NewtonFracturedCompoundGetMainMesh; 512 | 513 | alias da_NewtonFracturedCompoundGetFirstSubMesh = NewtonFracturedCompoundMeshPart* function(const NewtonCollision* fracturedCompound); 514 | da_NewtonFracturedCompoundGetFirstSubMesh NewtonFracturedCompoundGetFirstSubMesh; 515 | 516 | alias da_NewtonFracturedCompoundGetNextSubMesh = NewtonFracturedCompoundMeshPart* function(const NewtonCollision* fracturedCompound, NewtonFracturedCompoundMeshPart* subMesh); 517 | da_NewtonFracturedCompoundGetNextSubMesh NewtonFracturedCompoundGetNextSubMesh; 518 | 519 | alias da_NewtonFracturedCompoundCollisionGetVertexCount = int function(const NewtonCollision* fracturedCompound, const NewtonFracturedCompoundMeshPart* meshOwner); 520 | da_NewtonFracturedCompoundCollisionGetVertexCount NewtonFracturedCompoundCollisionGetVertexCount; 521 | 522 | alias da_NewtonFracturedCompoundCollisionGetVertexPositions = const dFloat* function(const NewtonCollision* fracturedCompound, const NewtonFracturedCompoundMeshPart* meshOwner); 523 | da_NewtonFracturedCompoundCollisionGetVertexPositions NewtonFracturedCompoundCollisionGetVertexPositions; 524 | 525 | alias da_NewtonFracturedCompoundCollisionGetVertexNormals = const dFloat* function(const NewtonCollision* fracturedCompound, const NewtonFracturedCompoundMeshPart* meshOwner); 526 | da_NewtonFracturedCompoundCollisionGetVertexNormals NewtonFracturedCompoundCollisionGetVertexNormals; 527 | 528 | alias da_NewtonFracturedCompoundCollisionGetVertexUVs = const dFloat* function(const NewtonCollision* fracturedCompound, const NewtonFracturedCompoundMeshPart* meshOwner); 529 | da_NewtonFracturedCompoundCollisionGetVertexUVs NewtonFracturedCompoundCollisionGetVertexUVs; 530 | 531 | alias da_NewtonFracturedCompoundMeshPartGetIndexStream = int function(const NewtonCollision* fracturedCompound, const NewtonFracturedCompoundMeshPart* meshOwner, const void* segment, int* index); 532 | da_NewtonFracturedCompoundMeshPartGetIndexStream NewtonFracturedCompoundMeshPartGetIndexStream; 533 | 534 | alias da_NewtonFracturedCompoundMeshPartGetFirstSegment = void* function(const NewtonFracturedCompoundMeshPart* fractureCompoundMeshPart); 535 | da_NewtonFracturedCompoundMeshPartGetFirstSegment NewtonFracturedCompoundMeshPartGetFirstSegment; 536 | 537 | alias da_NewtonFracturedCompoundMeshPartGetNextSegment = void* function(const void* fractureCompoundMeshSegment); 538 | da_NewtonFracturedCompoundMeshPartGetNextSegment NewtonFracturedCompoundMeshPartGetNextSegment; 539 | 540 | alias da_NewtonFracturedCompoundMeshPartGetMaterial = int function(const void* fractureCompoundMeshSegment); 541 | da_NewtonFracturedCompoundMeshPartGetMaterial NewtonFracturedCompoundMeshPartGetMaterial; 542 | 543 | alias da_NewtonFracturedCompoundMeshPartGetIndexCount = int function(const void* fractureCompoundMeshSegment); 544 | da_NewtonFracturedCompoundMeshPartGetIndexCount NewtonFracturedCompoundMeshPartGetIndexCount; 545 | 546 | alias da_NewtonCreateSceneCollision = NewtonCollision* function(const NewtonWorld* newtonWorld, int shapeID); 547 | da_NewtonCreateSceneCollision NewtonCreateSceneCollision; 548 | 549 | alias da_NewtonSceneCollisionBeginAddRemove = void function( NewtonCollision* sceneCollision); 550 | da_NewtonSceneCollisionBeginAddRemove NewtonSceneCollisionBeginAddRemove; 551 | 552 | alias da_NewtonSceneCollisionAddSubCollision = void* function( NewtonCollision* sceneCollision, const NewtonCollision* collision); 553 | da_NewtonSceneCollisionAddSubCollision NewtonSceneCollisionAddSubCollision; 554 | 555 | alias da_NewtonSceneCollisionRemoveSubCollision = void function( NewtonCollision* compoundCollision, const void* collisionNode); 556 | da_NewtonSceneCollisionRemoveSubCollision NewtonSceneCollisionRemoveSubCollision; 557 | 558 | alias da_NewtonSceneCollisionRemoveSubCollisionByIndex = void function( NewtonCollision* sceneCollision, int nodeIndex); 559 | da_NewtonSceneCollisionRemoveSubCollisionByIndex NewtonSceneCollisionRemoveSubCollisionByIndex; 560 | 561 | alias da_NewtonSceneCollisionSetSubCollisionMatrix = void function( NewtonCollision* sceneCollision, const void* collisionNode, const dFloat* matrix); 562 | da_NewtonSceneCollisionSetSubCollisionMatrix NewtonSceneCollisionSetSubCollisionMatrix; 563 | 564 | alias da_NewtonSceneCollisionEndAddRemove = void function( NewtonCollision* sceneCollision); 565 | da_NewtonSceneCollisionEndAddRemove NewtonSceneCollisionEndAddRemove; 566 | 567 | alias da_NewtonSceneCollisionGetFirstNode = void* function( NewtonCollision* sceneCollision); 568 | da_NewtonSceneCollisionGetFirstNode NewtonSceneCollisionGetFirstNode; 569 | 570 | alias da_NewtonSceneCollisionGetNextNode = void* function( NewtonCollision* sceneCollision, const void* collisionNode); 571 | da_NewtonSceneCollisionGetNextNode NewtonSceneCollisionGetNextNode; 572 | 573 | alias da_NewtonSceneCollisionGetNodeByIndex = void* function( NewtonCollision* sceneCollision, int index); 574 | da_NewtonSceneCollisionGetNodeByIndex NewtonSceneCollisionGetNodeByIndex; 575 | 576 | alias da_NewtonSceneCollisionGetNodeIndex = int function( NewtonCollision* sceneCollision, const void* collisionNode); 577 | da_NewtonSceneCollisionGetNodeIndex NewtonSceneCollisionGetNodeIndex; 578 | 579 | alias da_NewtonSceneCollisionGetCollisionFromNode = NewtonCollision* function( NewtonCollision* sceneCollision, const void* collisionNode); 580 | da_NewtonSceneCollisionGetCollisionFromNode NewtonSceneCollisionGetCollisionFromNode; 581 | 582 | alias da_NewtonCreateUserMeshCollision = NewtonCollision* function(const NewtonWorld* newtonWorld, const dFloat* minBox, const dFloat* maxBox, void* userData, NewtonUserMeshCollisionCollideCallback collideCallback, NewtonUserMeshCollisionRayHitCallback rayHitCallback, NewtonUserMeshCollisionDestroyCallback destroyCallback, NewtonUserMeshCollisionGetCollisionInfo getInfoCallback, NewtonUserMeshCollisionAABBTest getLocalAABBCallback, NewtonUserMeshCollisionGetFacesInAABB facesInAABBCallback, NewtonOnUserCollisionSerializationCallback serializeCallback, int shapeID); 583 | da_NewtonCreateUserMeshCollision NewtonCreateUserMeshCollision; 584 | 585 | alias da_NewtonUserMeshCollisionContinuousOverlapTest = int function(const NewtonUserMeshCollisionCollideDesc* collideDescData, const void* continueCollisionHandle, const dFloat* minAabb, const dFloat* maxAabb); 586 | da_NewtonUserMeshCollisionContinuousOverlapTest NewtonUserMeshCollisionContinuousOverlapTest; 587 | 588 | alias da_NewtonCreateCollisionFromSerialization = NewtonCollision* function(const NewtonWorld* newtonWorld, NewtonDeserializeCallback deserializeFunction, void* serializeHandle); 589 | da_NewtonCreateCollisionFromSerialization NewtonCreateCollisionFromSerialization; 590 | 591 | alias da_NewtonCollisionSerialize = void function(const NewtonWorld* newtonWorld, const NewtonCollision* collision, NewtonSerializeCallback serializeFunction, void* serializeHandle); 592 | da_NewtonCollisionSerialize NewtonCollisionSerialize; 593 | 594 | alias da_NewtonCollisionGetInfo = void function(const NewtonCollision* collision, NewtonCollisionInfoRecord* collisionInfo); 595 | da_NewtonCollisionGetInfo NewtonCollisionGetInfo; 596 | 597 | alias da_NewtonCreateHeightFieldCollision = NewtonCollision* function(const NewtonWorld* newtonWorld, int width, int height, int gridsDiagonals, int elevationdatType, const void* elevationMap, const char* attributeMap, dFloat verticalScale, dFloat horizontalScale_x, dFloat horizontalScale_z, int shapeID); 598 | da_NewtonCreateHeightFieldCollision NewtonCreateHeightFieldCollision; 599 | 600 | alias da_NewtonHeightFieldSetUserRayCastCallback = void function(const NewtonCollision* heightfieldCollision, NewtonHeightFieldRayCastCallback rayHitCallback); 601 | da_NewtonHeightFieldSetUserRayCastCallback NewtonHeightFieldSetUserRayCastCallback; 602 | 603 | alias da_NewtonCreateTreeCollision = NewtonCollision* function(const NewtonWorld* newtonWorld, int shapeID); 604 | da_NewtonCreateTreeCollision NewtonCreateTreeCollision; 605 | 606 | alias da_NewtonCreateTreeCollisionFromMesh = NewtonCollision* function(const NewtonWorld* newtonWorld, const NewtonMesh* mesh, int shapeID); 607 | da_NewtonCreateTreeCollisionFromMesh NewtonCreateTreeCollisionFromMesh; 608 | 609 | alias da_NewtonTreeCollisionSetUserRayCastCallback = void function(const NewtonCollision* treeCollision, NewtonCollisionTreeRayCastCallback rayHitCallback); 610 | da_NewtonTreeCollisionSetUserRayCastCallback NewtonTreeCollisionSetUserRayCastCallback; 611 | 612 | alias da_NewtonTreeCollisionBeginBuild = void function(const NewtonCollision* treeCollision); 613 | da_NewtonTreeCollisionBeginBuild NewtonTreeCollisionBeginBuild; 614 | 615 | alias da_NewtonTreeCollisionAddFace = void function(const NewtonCollision* treeCollision, int vertexCount, const dFloat* vertexPtr, int strideInBytes, int faceAttribute); 616 | da_NewtonTreeCollisionAddFace NewtonTreeCollisionAddFace; 617 | 618 | alias da_NewtonTreeCollisionEndBuild = void function(const NewtonCollision* treeCollision, int optimize); 619 | da_NewtonTreeCollisionEndBuild NewtonTreeCollisionEndBuild; 620 | 621 | alias da_NewtonTreeCollisionGetFaceAttribute = int function(const NewtonCollision* treeCollision, const int* faceIndexArray, int indexCount); 622 | da_NewtonTreeCollisionGetFaceAttribute NewtonTreeCollisionGetFaceAttribute; 623 | 624 | alias da_NewtonTreeCollisionSetFaceAttribute = void function(const NewtonCollision* treeCollision, const int* faceIndexArray, int indexCount, int attribute); 625 | da_NewtonTreeCollisionSetFaceAttribute NewtonTreeCollisionSetFaceAttribute; 626 | 627 | alias da_NewtonTreeCollisionForEachFace = void function(const NewtonCollision* treeCollision, NewtonTreeCollisionFaceCallback forEachFaceCallback, void* context); 628 | da_NewtonTreeCollisionForEachFace NewtonTreeCollisionForEachFace; 629 | 630 | alias da_NewtonTreeCollisionGetVertexListTriangleListInAABB = int function(const NewtonCollision* treeCollision, const dFloat* p0, const dFloat* p1, const dFloat* * vertexArray, int* vertexCount, int* vertexStrideInBytes, const int* indexList, int maxIndexCount, const int* faceAttribute); 631 | da_NewtonTreeCollisionGetVertexListTriangleListInAABB NewtonTreeCollisionGetVertexListTriangleListInAABB; 632 | 633 | alias da_NewtonStaticCollisionSetDebugCallback = void function(const NewtonCollision* staticCollision, NewtonTreeCollisionCallback userCallback); 634 | da_NewtonStaticCollisionSetDebugCallback NewtonStaticCollisionSetDebugCallback; 635 | 636 | alias da_NewtonCollisionCreateInstance = NewtonCollision* function(const NewtonCollision* collision); 637 | da_NewtonCollisionCreateInstance NewtonCollisionCreateInstance; 638 | 639 | alias da_NewtonCollisionGetType = int function(const NewtonCollision* collision); 640 | da_NewtonCollisionGetType NewtonCollisionGetType; 641 | 642 | alias da_NewtonCollisionIsConvexShape = int function(const NewtonCollision* collision); 643 | da_NewtonCollisionIsConvexShape NewtonCollisionIsConvexShape; 644 | 645 | alias da_NewtonCollisionIsStaticShape = int function(const NewtonCollision* collision); 646 | da_NewtonCollisionIsStaticShape NewtonCollisionIsStaticShape; 647 | 648 | alias da_NewtonCollisionSetUserData = void function(const NewtonCollision* collision, void* userData); 649 | da_NewtonCollisionSetUserData NewtonCollisionSetUserData; 650 | 651 | alias da_NewtonCollisionGetUserData = void* function(const NewtonCollision* collision); 652 | da_NewtonCollisionGetUserData NewtonCollisionGetUserData; 653 | 654 | alias da_NewtonCollisionSetUserID = void function(const NewtonCollision* collision, long id); 655 | da_NewtonCollisionSetUserID NewtonCollisionSetUserID; 656 | 657 | alias da_NewtonCollisionGetUserID = long function(const NewtonCollision* collision); 658 | da_NewtonCollisionGetUserID NewtonCollisionGetUserID; 659 | 660 | alias da_NewtonCollisionGetMaterial = void function(const NewtonCollision* collision, NewtonCollisionMaterial* userData); 661 | da_NewtonCollisionGetMaterial NewtonCollisionGetMaterial; 662 | 663 | alias da_NewtonCollisionSetMaterial = void function(const NewtonCollision* collision, const NewtonCollisionMaterial* userData); 664 | da_NewtonCollisionSetMaterial NewtonCollisionSetMaterial; 665 | 666 | alias da_NewtonCollisionGetSubCollisionHandle = void* function(const NewtonCollision* collision); 667 | da_NewtonCollisionGetSubCollisionHandle NewtonCollisionGetSubCollisionHandle; 668 | 669 | alias da_NewtonCollisionGetParentInstance = NewtonCollision* function(const NewtonCollision* collision); 670 | da_NewtonCollisionGetParentInstance NewtonCollisionGetParentInstance; 671 | 672 | alias da_NewtonCollisionSetMatrix = void function(const NewtonCollision* collision, const dFloat* matrix); 673 | da_NewtonCollisionSetMatrix NewtonCollisionSetMatrix; 674 | 675 | alias da_NewtonCollisionGetMatrix = void function(const NewtonCollision* collision, dFloat* matrix); 676 | da_NewtonCollisionGetMatrix NewtonCollisionGetMatrix; 677 | 678 | alias da_NewtonCollisionSetScale = void function(const NewtonCollision* collision, dFloat scaleX, dFloat scaleY, dFloat scaleZ); 679 | da_NewtonCollisionSetScale NewtonCollisionSetScale; 680 | 681 | alias da_NewtonCollisionGetScale = void function(const NewtonCollision* collision, dFloat* scaleX, dFloat* scaleY, dFloat* scaleZ); 682 | da_NewtonCollisionGetScale NewtonCollisionGetScale; 683 | 684 | alias da_NewtonDestroyCollision = void function(const NewtonCollision* collision); 685 | da_NewtonDestroyCollision NewtonDestroyCollision; 686 | 687 | alias da_NewtonCollisionGetSkinThickness = dFloat function(const NewtonCollision* collision); 688 | da_NewtonCollisionGetSkinThickness NewtonCollisionGetSkinThickness; 689 | 690 | alias da_NewtonCollisionSetSkinThickness = void function(const NewtonCollision* collision, dFloat thickness); 691 | da_NewtonCollisionSetSkinThickness NewtonCollisionSetSkinThickness; 692 | 693 | alias da_NewtonCollisionIntersectionTest = int function(const NewtonWorld* newtonWorld, const NewtonCollision* collisionA, const dFloat* matrixA, const NewtonCollision* collisionB, const dFloat* matrixB, int threadIndex); 694 | da_NewtonCollisionIntersectionTest NewtonCollisionIntersectionTest; 695 | 696 | alias da_NewtonCollisionPointDistance = int function(const NewtonWorld* newtonWorld, const dFloat* point, const NewtonCollision* collision, const dFloat* matrix, dFloat* contact, dFloat* normal, int threadIndex); 697 | da_NewtonCollisionPointDistance NewtonCollisionPointDistance; 698 | 699 | alias da_NewtonCollisionClosestPoint = int function(const NewtonWorld* newtonWorld, const NewtonCollision* collisionA, const dFloat* matrixA, const NewtonCollision* collisionB, const dFloat* matrixB, dFloat* contactA, dFloat* contactB, dFloat* normalAB, int threadIndex); 700 | da_NewtonCollisionClosestPoint NewtonCollisionClosestPoint; 701 | 702 | alias da_NewtonCollisionCollide = int function(const NewtonWorld* newtonWorld, int maxSize, const NewtonCollision* collisionA, const dFloat* matrixA, const NewtonCollision* collisionB, const dFloat* matrixB, dFloat* contacts, dFloat* normals, dFloat* penetration, long* attributeA, long* attributeB, int threadIndex); 703 | da_NewtonCollisionCollide NewtonCollisionCollide; 704 | 705 | alias da_NewtonCollisionCollideContinue = int function(const NewtonWorld* newtonWorld, int maxSize, dFloat timestep, const NewtonCollision* collisionA, const dFloat* matrixA, const dFloat* velocA, const dFloat* omegaA, const NewtonCollision* collisionB, const dFloat* matrixB, const dFloat* velocB, const dFloat* omegaB, dFloat* timeOfImpact, dFloat* contacts, dFloat* normals, dFloat* penetration, long* attributeA, long* attributeB, int threadIndex); 706 | da_NewtonCollisionCollideContinue NewtonCollisionCollideContinue; 707 | 708 | alias da_NewtonCollisionSupportVertex = void function(const NewtonCollision* collision, const dFloat* dir, dFloat* vertex); 709 | da_NewtonCollisionSupportVertex NewtonCollisionSupportVertex; 710 | 711 | alias da_NewtonCollisionRayCast = dFloat function(const NewtonCollision* collision, const dFloat* p0, const dFloat* p1, dFloat* normal, long* attribute); 712 | da_NewtonCollisionRayCast NewtonCollisionRayCast; 713 | 714 | alias da_NewtonCollisionCalculateAABB = void function(const NewtonCollision* collision, const dFloat* matrix, dFloat* p0, dFloat* p1); 715 | da_NewtonCollisionCalculateAABB NewtonCollisionCalculateAABB; 716 | 717 | alias da_NewtonCollisionForEachPolygonDo = void function(const NewtonCollision* collision, const dFloat* matrix, NewtonCollisionIterator callback, void* userData); 718 | da_NewtonCollisionForEachPolygonDo NewtonCollisionForEachPolygonDo; 719 | 720 | alias da_NewtonCollisionAggregateCreate = void* function( NewtonWorld* world); 721 | da_NewtonCollisionAggregateCreate NewtonCollisionAggregateCreate; 722 | 723 | alias da_NewtonCollisionAggregateDestroy = void function( void* aggregate); 724 | da_NewtonCollisionAggregateDestroy NewtonCollisionAggregateDestroy; 725 | 726 | alias da_NewtonCollisionAggregateAddBody = void function( void* aggregate, const NewtonBody* _body); 727 | da_NewtonCollisionAggregateAddBody NewtonCollisionAggregateAddBody; 728 | 729 | alias da_NewtonCollisionAggregateRemoveBody = void function( void* aggregate, const NewtonBody* _body); 730 | da_NewtonCollisionAggregateRemoveBody NewtonCollisionAggregateRemoveBody; 731 | 732 | alias da_NewtonCollisionAggregateGetSelfCollision = int function( void* aggregate); 733 | da_NewtonCollisionAggregateGetSelfCollision NewtonCollisionAggregateGetSelfCollision; 734 | 735 | alias da_NewtonCollisionAggregateSetSelfCollision = void function( void* aggregate, int state); 736 | da_NewtonCollisionAggregateSetSelfCollision NewtonCollisionAggregateSetSelfCollision; 737 | 738 | alias da_NewtonSetEulerAngle = void function(const dFloat* eulersAngles, dFloat* matrix); 739 | da_NewtonSetEulerAngle NewtonSetEulerAngle; 740 | 741 | alias da_NewtonGetEulerAngle = void function(const dFloat* matrix, dFloat* eulersAngles0, dFloat* eulersAngles1); 742 | da_NewtonGetEulerAngle NewtonGetEulerAngle; 743 | 744 | alias da_NewtonCalculateSpringDamperAcceleration = dFloat function( dFloat dt, dFloat ks, dFloat x, dFloat kd, dFloat s); 745 | da_NewtonCalculateSpringDamperAcceleration NewtonCalculateSpringDamperAcceleration; 746 | 747 | alias da_NewtonCreateDynamicBody = NewtonBody* function(const NewtonWorld* newtonWorld, const NewtonCollision* collision, const dFloat* matrix); 748 | da_NewtonCreateDynamicBody NewtonCreateDynamicBody; 749 | 750 | alias da_NewtonCreateKinematicBody = NewtonBody* function(const NewtonWorld* newtonWorld, const NewtonCollision* collision, const dFloat* matrix); 751 | da_NewtonCreateKinematicBody NewtonCreateKinematicBody; 752 | 753 | alias da_NewtonCreateAsymetricDynamicBody = NewtonBody* function(const NewtonWorld* newtonWorld, const NewtonCollision* collision, const dFloat* matrix); 754 | da_NewtonCreateAsymetricDynamicBody NewtonCreateAsymetricDynamicBody; 755 | 756 | alias da_NewtonDestroyBody = void function(const NewtonBody* _body); 757 | da_NewtonDestroyBody NewtonDestroyBody; 758 | 759 | alias da_NewtonBodyGetSimulationState = int function(const NewtonBody* _body); 760 | da_NewtonBodyGetSimulationState NewtonBodyGetSimulationState; 761 | 762 | alias da_NewtonBodySetSimulationState = void function(const NewtonBody* bodyPtr, const int state); 763 | da_NewtonBodySetSimulationState NewtonBodySetSimulationState; 764 | 765 | alias da_NewtonBodyGetType = int function(const NewtonBody* _body); 766 | da_NewtonBodyGetType NewtonBodyGetType; 767 | 768 | alias da_NewtonBodyGetCollidable = int function(const NewtonBody* _body); 769 | da_NewtonBodyGetCollidable NewtonBodyGetCollidable; 770 | 771 | alias da_NewtonBodySetCollidable = void function(const NewtonBody* _body, int collidableState); 772 | da_NewtonBodySetCollidable NewtonBodySetCollidable; 773 | 774 | alias da_NewtonBodyAddForce = void function(const NewtonBody* _body, const dFloat* force); 775 | da_NewtonBodyAddForce NewtonBodyAddForce; 776 | 777 | alias da_NewtonBodyAddTorque = void function(const NewtonBody* _body, const dFloat* torque); 778 | da_NewtonBodyAddTorque NewtonBodyAddTorque; 779 | 780 | alias da_NewtonBodySetCentreOfMass = void function(const NewtonBody* _body, const dFloat* com); 781 | da_NewtonBodySetCentreOfMass NewtonBodySetCentreOfMass; 782 | 783 | alias da_NewtonBodySetMassMatrix = void function(const NewtonBody* _body, dFloat mass, dFloat Ixx, dFloat Iyy, dFloat Izz); 784 | da_NewtonBodySetMassMatrix NewtonBodySetMassMatrix; 785 | 786 | alias da_NewtonBodySetFullMassMatrix = void function(const NewtonBody* _body, dFloat mass, const dFloat* inertiaMatrix); 787 | da_NewtonBodySetFullMassMatrix NewtonBodySetFullMassMatrix; 788 | 789 | alias da_NewtonBodySetMassProperties = void function(const NewtonBody* _body, dFloat mass, const NewtonCollision* collision); 790 | da_NewtonBodySetMassProperties NewtonBodySetMassProperties; 791 | 792 | alias da_NewtonBodySetMatrix = void function(const NewtonBody* _body, const dFloat* matrix); 793 | da_NewtonBodySetMatrix NewtonBodySetMatrix; 794 | 795 | alias da_NewtonBodySetMatrixNoSleep = void function(const NewtonBody* _body, const dFloat* matrix); 796 | da_NewtonBodySetMatrixNoSleep NewtonBodySetMatrixNoSleep; 797 | 798 | alias da_NewtonBodySetMatrixRecursive = void function(const NewtonBody* _body, const dFloat* matrix); 799 | da_NewtonBodySetMatrixRecursive NewtonBodySetMatrixRecursive; 800 | 801 | alias da_NewtonBodySetMaterialGroupID = void function(const NewtonBody* _body, int id); 802 | da_NewtonBodySetMaterialGroupID NewtonBodySetMaterialGroupID; 803 | 804 | alias da_NewtonBodySetContinuousCollisionMode = void function(const NewtonBody* _body, uint state); 805 | da_NewtonBodySetContinuousCollisionMode NewtonBodySetContinuousCollisionMode; 806 | 807 | alias da_NewtonBodySetJointRecursiveCollision = void function(const NewtonBody* _body, uint state); 808 | da_NewtonBodySetJointRecursiveCollision NewtonBodySetJointRecursiveCollision; 809 | 810 | alias da_NewtonBodySetOmega = void function(const NewtonBody* _body, const dFloat* omega); 811 | da_NewtonBodySetOmega NewtonBodySetOmega; 812 | 813 | alias da_NewtonBodySetOmegaNoSleep = void function(const NewtonBody* _body, const dFloat* omega); 814 | da_NewtonBodySetOmegaNoSleep NewtonBodySetOmegaNoSleep; 815 | 816 | alias da_NewtonBodySetVelocity = void function(const NewtonBody* _body, const dFloat* velocity); 817 | da_NewtonBodySetVelocity NewtonBodySetVelocity; 818 | 819 | alias da_NewtonBodySetVelocityNoSleep = void function(const NewtonBody* _body, const dFloat* velocity); 820 | da_NewtonBodySetVelocityNoSleep NewtonBodySetVelocityNoSleep; 821 | 822 | alias da_NewtonBodySetForce = void function(const NewtonBody* _body, const dFloat* force); 823 | da_NewtonBodySetForce NewtonBodySetForce; 824 | 825 | alias da_NewtonBodySetTorque = void function(const NewtonBody* _body, const dFloat* torque); 826 | da_NewtonBodySetTorque NewtonBodySetTorque; 827 | 828 | alias da_NewtonBodySetLinearDamping = void function(const NewtonBody* _body, dFloat linearDamp); 829 | da_NewtonBodySetLinearDamping NewtonBodySetLinearDamping; 830 | 831 | alias da_NewtonBodySetAngularDamping = void function(const NewtonBody* _body, const dFloat* angularDamp); 832 | da_NewtonBodySetAngularDamping NewtonBodySetAngularDamping; 833 | 834 | alias da_NewtonBodySetCollision = void function(const NewtonBody* _body, const NewtonCollision* collision); 835 | da_NewtonBodySetCollision NewtonBodySetCollision; 836 | 837 | alias da_NewtonBodySetCollisionScale = void function(const NewtonBody* _body, dFloat scaleX, dFloat scaleY, dFloat scaleZ); 838 | da_NewtonBodySetCollisionScale NewtonBodySetCollisionScale; 839 | 840 | alias da_NewtonBodyGetSleepState = int function(const NewtonBody* _body); 841 | da_NewtonBodyGetSleepState NewtonBodyGetSleepState; 842 | 843 | alias da_NewtonBodySetSleepState = void function(const NewtonBody* _body, int state); 844 | da_NewtonBodySetSleepState NewtonBodySetSleepState; 845 | 846 | alias da_NewtonBodyGetAutoSleep = int function(const NewtonBody* _body); 847 | da_NewtonBodyGetAutoSleep NewtonBodyGetAutoSleep; 848 | 849 | alias da_NewtonBodySetAutoSleep = void function(const NewtonBody* _body, int state); 850 | da_NewtonBodySetAutoSleep NewtonBodySetAutoSleep; 851 | 852 | alias da_NewtonBodyGetFreezeState = int function(const NewtonBody* _body); 853 | da_NewtonBodyGetFreezeState NewtonBodyGetFreezeState; 854 | 855 | alias da_NewtonBodySetFreezeState = void function(const NewtonBody* _body, int state); 856 | da_NewtonBodySetFreezeState NewtonBodySetFreezeState; 857 | 858 | alias da_NewtonBodyGetGyroscopicTorque = int function(const NewtonBody* _body); 859 | da_NewtonBodyGetGyroscopicTorque NewtonBodyGetGyroscopicTorque; 860 | 861 | alias da_NewtonBodySetGyroscopicTorque = void function(const NewtonBody* _body, int state); 862 | da_NewtonBodySetGyroscopicTorque NewtonBodySetGyroscopicTorque; 863 | 864 | alias da_NewtonBodySetDestructorCallback = void function(const NewtonBody* _body, NewtonBodyDestructor callback); 865 | da_NewtonBodySetDestructorCallback NewtonBodySetDestructorCallback; 866 | 867 | alias da_NewtonBodyGetDestructorCallback = NewtonBodyDestructor function(const NewtonBody* _body); 868 | da_NewtonBodyGetDestructorCallback NewtonBodyGetDestructorCallback; 869 | 870 | alias da_NewtonBodySetTransformCallback = void function(const NewtonBody* _body, NewtonSetTransform callback); 871 | da_NewtonBodySetTransformCallback NewtonBodySetTransformCallback; 872 | 873 | alias da_NewtonBodyGetTransformCallback = NewtonSetTransform function(const NewtonBody* _body); 874 | da_NewtonBodyGetTransformCallback NewtonBodyGetTransformCallback; 875 | 876 | alias da_NewtonBodySetForceAndTorqueCallback = void function(const NewtonBody* _body, NewtonApplyForceAndTorque callback); 877 | da_NewtonBodySetForceAndTorqueCallback NewtonBodySetForceAndTorqueCallback; 878 | 879 | alias da_NewtonBodyGetForceAndTorqueCallback = NewtonApplyForceAndTorque function(const NewtonBody* _body); 880 | da_NewtonBodyGetForceAndTorqueCallback NewtonBodyGetForceAndTorqueCallback; 881 | 882 | alias da_NewtonBodyGetID = int function(const NewtonBody* _body); 883 | da_NewtonBodyGetID NewtonBodyGetID; 884 | 885 | alias da_NewtonBodySetUserData = void function(const NewtonBody* _body, void* userData); 886 | da_NewtonBodySetUserData NewtonBodySetUserData; 887 | 888 | alias da_NewtonBodyGetUserData = void* function(const NewtonBody* _body); 889 | da_NewtonBodyGetUserData NewtonBodyGetUserData; 890 | 891 | alias da_NewtonBodyGetWorld = NewtonWorld* function(const NewtonBody* _body); 892 | da_NewtonBodyGetWorld NewtonBodyGetWorld; 893 | 894 | alias da_NewtonBodyGetCollision = NewtonCollision* function(const NewtonBody* _body); 895 | da_NewtonBodyGetCollision NewtonBodyGetCollision; 896 | 897 | alias da_NewtonBodyGetMaterialGroupID = int function(const NewtonBody* _body); 898 | da_NewtonBodyGetMaterialGroupID NewtonBodyGetMaterialGroupID; 899 | 900 | alias da_NewtonBodyGetSerializedID = int function(const NewtonBody* _body); 901 | da_NewtonBodyGetSerializedID NewtonBodyGetSerializedID; 902 | 903 | alias da_NewtonBodyGetContinuousCollisionMode = int function(const NewtonBody* _body); 904 | da_NewtonBodyGetContinuousCollisionMode NewtonBodyGetContinuousCollisionMode; 905 | 906 | alias da_NewtonBodyGetJointRecursiveCollision = int function(const NewtonBody* _body); 907 | da_NewtonBodyGetJointRecursiveCollision NewtonBodyGetJointRecursiveCollision; 908 | 909 | alias da_NewtonBodyGetPosition = void function(const NewtonBody* _body, dFloat* pos); 910 | da_NewtonBodyGetPosition NewtonBodyGetPosition; 911 | 912 | alias da_NewtonBodyGetMatrix = void function(const NewtonBody* _body, dFloat* matrix); 913 | da_NewtonBodyGetMatrix NewtonBodyGetMatrix; 914 | 915 | alias da_NewtonBodyGetRotation = void function(const NewtonBody* _body, dFloat* rotation); 916 | da_NewtonBodyGetRotation NewtonBodyGetRotation; 917 | 918 | alias da_NewtonBodyGetMass = void function(const NewtonBody* _body, dFloat* mass, dFloat* Ixx, dFloat* Iyy, dFloat* Izz); 919 | da_NewtonBodyGetMass NewtonBodyGetMass; 920 | 921 | alias da_NewtonBodyGetInvMass = void function(const NewtonBody* _body, dFloat* invMass, dFloat* invIxx, dFloat* invIyy, dFloat* invIzz); 922 | da_NewtonBodyGetInvMass NewtonBodyGetInvMass; 923 | 924 | alias da_NewtonBodyGetInertiaMatrix = void function(const NewtonBody* _body, dFloat* inertiaMatrix); 925 | da_NewtonBodyGetInertiaMatrix NewtonBodyGetInertiaMatrix; 926 | 927 | alias da_NewtonBodyGetInvInertiaMatrix = void function(const NewtonBody* _body, dFloat* invInertiaMatrix); 928 | da_NewtonBodyGetInvInertiaMatrix NewtonBodyGetInvInertiaMatrix; 929 | 930 | alias da_NewtonBodyGetOmega = void function(const NewtonBody* _body, dFloat* vector); 931 | da_NewtonBodyGetOmega NewtonBodyGetOmega; 932 | 933 | alias da_NewtonBodyGetVelocity = void function(const NewtonBody* _body, dFloat* vector); 934 | da_NewtonBodyGetVelocity NewtonBodyGetVelocity; 935 | 936 | alias da_NewtonBodyGetAlpha = void function(const NewtonBody* _body, dFloat* vector); 937 | da_NewtonBodyGetAlpha NewtonBodyGetAlpha; 938 | 939 | alias da_NewtonBodyGetAcceleration = void function(const NewtonBody* _body, dFloat* vector); 940 | da_NewtonBodyGetAcceleration NewtonBodyGetAcceleration; 941 | 942 | alias da_NewtonBodyGetForce = void function(const NewtonBody* _body, dFloat* vector); 943 | da_NewtonBodyGetForce NewtonBodyGetForce; 944 | 945 | alias da_NewtonBodyGetTorque = void function(const NewtonBody* _body, dFloat* vector); 946 | da_NewtonBodyGetTorque NewtonBodyGetTorque; 947 | 948 | alias da_NewtonBodyGetCentreOfMass = void function(const NewtonBody* _body, dFloat* com); 949 | da_NewtonBodyGetCentreOfMass NewtonBodyGetCentreOfMass; 950 | 951 | alias da_NewtonBodyGetPointVelocity = void function(const NewtonBody* _body, const dFloat* point, dFloat* velocOut); 952 | da_NewtonBodyGetPointVelocity NewtonBodyGetPointVelocity; 953 | 954 | alias da_NewtonBodyApplyImpulsePair = void function(const NewtonBody* _body, dFloat* linearImpulse, dFloat* angularImpulse, dFloat timestep); 955 | da_NewtonBodyApplyImpulsePair NewtonBodyApplyImpulsePair; 956 | 957 | alias da_NewtonBodyAddImpulse = void function(const NewtonBody* _body, const dFloat* pointDeltaVeloc, const dFloat* pointPosit, dFloat timestep); 958 | da_NewtonBodyAddImpulse NewtonBodyAddImpulse; 959 | 960 | alias da_NewtonBodyApplyImpulseArray = void function(const NewtonBody* _body, int impuleCount, int strideInByte, const dFloat* impulseArray, const dFloat* pointArray, dFloat timestep); 961 | da_NewtonBodyApplyImpulseArray NewtonBodyApplyImpulseArray; 962 | 963 | alias da_NewtonBodyIntegrateVelocity = void function(const NewtonBody* _body, dFloat timestep); 964 | da_NewtonBodyIntegrateVelocity NewtonBodyIntegrateVelocity; 965 | 966 | alias da_NewtonBodyGetLinearDamping = dFloat function(const NewtonBody* _body); 967 | da_NewtonBodyGetLinearDamping NewtonBodyGetLinearDamping; 968 | 969 | alias da_NewtonBodyGetAngularDamping = void function(const NewtonBody* _body, dFloat* vector); 970 | da_NewtonBodyGetAngularDamping NewtonBodyGetAngularDamping; 971 | 972 | alias da_NewtonBodyGetAABB = void function(const NewtonBody* _body, dFloat* p0, dFloat* p1); 973 | da_NewtonBodyGetAABB NewtonBodyGetAABB; 974 | 975 | alias da_NewtonBodyGetFirstJoint = NewtonJoint* function(const NewtonBody* _body); 976 | da_NewtonBodyGetFirstJoint NewtonBodyGetFirstJoint; 977 | 978 | alias da_NewtonBodyGetNextJoint = NewtonJoint* function(const NewtonBody* _body, const NewtonJoint* joint); 979 | da_NewtonBodyGetNextJoint NewtonBodyGetNextJoint; 980 | 981 | alias da_NewtonBodyGetFirstContactJoint = NewtonJoint* function(const NewtonBody* _body); 982 | da_NewtonBodyGetFirstContactJoint NewtonBodyGetFirstContactJoint; 983 | 984 | alias da_NewtonBodyGetNextContactJoint = NewtonJoint* function(const NewtonBody* _body, const NewtonJoint* contactJoint); 985 | da_NewtonBodyGetNextContactJoint NewtonBodyGetNextContactJoint; 986 | 987 | alias da_NewtonBodyFindContact = NewtonJoint* function(const NewtonBody* body0, const NewtonBody* body1); 988 | da_NewtonBodyFindContact NewtonBodyFindContact; 989 | 990 | alias da_NewtonContactJointGetFirstContact = void* function(const NewtonJoint* contactJoint); 991 | da_NewtonContactJointGetFirstContact NewtonContactJointGetFirstContact; 992 | 993 | alias da_NewtonContactJointGetNextContact = void* function(const NewtonJoint* contactJoint, void* contact); 994 | da_NewtonContactJointGetNextContact NewtonContactJointGetNextContact; 995 | 996 | alias da_NewtonContactJointGetContactCount = int function(const NewtonJoint* contactJoint); 997 | da_NewtonContactJointGetContactCount NewtonContactJointGetContactCount; 998 | 999 | alias da_NewtonContactJointRemoveContact = void function(const NewtonJoint* contactJoint, void* contact); 1000 | da_NewtonContactJointRemoveContact NewtonContactJointRemoveContact; 1001 | 1002 | alias da_NewtonContactJointGetClosestDistance = dFloat function(const NewtonJoint* contactJoint); 1003 | da_NewtonContactJointGetClosestDistance NewtonContactJointGetClosestDistance; 1004 | 1005 | alias da_NewtonContactJointResetSelftJointCollision = void function(const NewtonJoint* contactJoint); 1006 | da_NewtonContactJointResetSelftJointCollision NewtonContactJointResetSelftJointCollision; 1007 | 1008 | alias da_NewtonContactJointResetIntraJointCollision = void function(const NewtonJoint* contactJoint); 1009 | da_NewtonContactJointResetIntraJointCollision NewtonContactJointResetIntraJointCollision; 1010 | 1011 | alias da_NewtonContactGetMaterial = NewtonMaterial* function(const void* contact); 1012 | da_NewtonContactGetMaterial NewtonContactGetMaterial; 1013 | 1014 | alias da_NewtonContactGetCollision0 = NewtonCollision* function(const void* contact); 1015 | da_NewtonContactGetCollision0 NewtonContactGetCollision0; 1016 | 1017 | alias da_NewtonContactGetCollision1 = NewtonCollision* function(const void* contact); 1018 | da_NewtonContactGetCollision1 NewtonContactGetCollision1; 1019 | 1020 | alias da_NewtonContactGetCollisionID0 = void* function(const void* contact); 1021 | da_NewtonContactGetCollisionID0 NewtonContactGetCollisionID0; 1022 | 1023 | alias da_NewtonContactGetCollisionID1 = void* function(const void* contact); 1024 | da_NewtonContactGetCollisionID1 NewtonContactGetCollisionID1; 1025 | 1026 | alias da_NewtonJointGetUserData = void* function(const NewtonJoint* joint); 1027 | da_NewtonJointGetUserData NewtonJointGetUserData; 1028 | 1029 | alias da_NewtonJointSetUserData = void function(const NewtonJoint* joint, void* userData); 1030 | da_NewtonJointSetUserData NewtonJointSetUserData; 1031 | 1032 | alias da_NewtonJointGetBody0 = NewtonBody* function(const NewtonJoint* joint); 1033 | da_NewtonJointGetBody0 NewtonJointGetBody0; 1034 | 1035 | alias da_NewtonJointGetBody1 = NewtonBody* function(const NewtonJoint* joint); 1036 | da_NewtonJointGetBody1 NewtonJointGetBody1; 1037 | 1038 | alias da_NewtonJointGetInfo = void function(const NewtonJoint* joint, NewtonJointRecord* info); 1039 | da_NewtonJointGetInfo NewtonJointGetInfo; 1040 | 1041 | alias da_NewtonJointGetCollisionState = int function(const NewtonJoint* joint); 1042 | da_NewtonJointGetCollisionState NewtonJointGetCollisionState; 1043 | 1044 | alias da_NewtonJointSetCollisionState = void function(const NewtonJoint* joint, int state); 1045 | da_NewtonJointSetCollisionState NewtonJointSetCollisionState; 1046 | 1047 | alias da_NewtonJointGetStiffness = dFloat function(const NewtonJoint* joint); 1048 | da_NewtonJointGetStiffness NewtonJointGetStiffness; 1049 | 1050 | alias da_NewtonJointSetStiffness = void function(const NewtonJoint* joint, dFloat state); 1051 | da_NewtonJointSetStiffness NewtonJointSetStiffness; 1052 | 1053 | alias da_NewtonDestroyJoint = void function(const NewtonWorld* newtonWorld, const NewtonJoint* joint); 1054 | da_NewtonDestroyJoint NewtonDestroyJoint; 1055 | 1056 | alias da_NewtonJointSetDestructor = void function(const NewtonJoint* joint, NewtonConstraintDestructor destructor); 1057 | da_NewtonJointSetDestructor NewtonJointSetDestructor; 1058 | 1059 | alias da_NewtonJointIsActive = int function(const NewtonJoint* joint); 1060 | da_NewtonJointIsActive NewtonJointIsActive; 1061 | 1062 | alias da_NewtonCreateMassSpringDamperSystem = NewtonCollision* function(const NewtonWorld* newtonWorld, int shapeID, const dFloat* points, int pointCount, int strideInBytes, const dFloat* pointMass, const int* links, int linksCount, const dFloat* linksSpring, const dFloat* linksDamper); 1063 | da_NewtonCreateMassSpringDamperSystem NewtonCreateMassSpringDamperSystem; 1064 | 1065 | alias da_NewtonCreateDeformableSolid = NewtonCollision* function(const NewtonWorld* newtonWorld, const NewtonMesh* mesh, int shapeID); 1066 | da_NewtonCreateDeformableSolid NewtonCreateDeformableSolid; 1067 | 1068 | alias da_NewtonDeformableMeshGetParticleCount = int function(const NewtonCollision* deformableMesh); 1069 | da_NewtonDeformableMeshGetParticleCount NewtonDeformableMeshGetParticleCount; 1070 | 1071 | alias da_NewtonDeformableMeshGetParticleStrideInBytes = int function(const NewtonCollision* deformableMesh); 1072 | da_NewtonDeformableMeshGetParticleStrideInBytes NewtonDeformableMeshGetParticleStrideInBytes; 1073 | 1074 | alias da_NewtonDeformableMeshGetParticleArray = const dFloat* function(const NewtonCollision* deformableMesh); 1075 | da_NewtonDeformableMeshGetParticleArray NewtonDeformableMeshGetParticleArray; 1076 | 1077 | alias da_NewtonConstraintCreateBall = NewtonJoint* function(const NewtonWorld* newtonWorld, const dFloat* pivotPoint, const NewtonBody* childBody, const NewtonBody* parentBody); 1078 | da_NewtonConstraintCreateBall NewtonConstraintCreateBall; 1079 | 1080 | alias da_NewtonBallSetUserCallback = void function(const NewtonJoint* ball, NewtonBallCallback callback); 1081 | da_NewtonBallSetUserCallback NewtonBallSetUserCallback; 1082 | 1083 | alias da_NewtonBallGetJointAngle = void function(const NewtonJoint* ball, dFloat* angle); 1084 | da_NewtonBallGetJointAngle NewtonBallGetJointAngle; 1085 | 1086 | alias da_NewtonBallGetJointOmega = void function(const NewtonJoint* ball, dFloat* omega); 1087 | da_NewtonBallGetJointOmega NewtonBallGetJointOmega; 1088 | 1089 | alias da_NewtonBallGetJointForce = void function(const NewtonJoint* ball, dFloat* force); 1090 | da_NewtonBallGetJointForce NewtonBallGetJointForce; 1091 | 1092 | alias da_NewtonBallSetConeLimits = void function(const NewtonJoint* ball, const dFloat* pin, dFloat maxConeAngle, dFloat maxTwistAngle); 1093 | da_NewtonBallSetConeLimits NewtonBallSetConeLimits; 1094 | 1095 | /* 1096 | alias da_NewtonConstraintCreateHinge = NewtonJoint* function(const NewtonWorld* newtonWorld, const dFloat* pivotPoint, const dFloat* pinDir, const NewtonBody* childBody, const NewtonBody* parentBody); 1097 | da_NewtonConstraintCreateHinge NewtonConstraintCreateHinge; 1098 | 1099 | alias da_NewtonHingeSetUserCallback = void function(const NewtonJoint* hinge, NewtonHingeCallback callback); 1100 | da_NewtonHingeSetUserCallback NewtonHingeSetUserCallback; 1101 | 1102 | alias da_NewtonHingeGetJointAngle = dFloat function(const NewtonJoint* hinge); 1103 | da_NewtonHingeGetJointAngle NewtonHingeGetJointAngle; 1104 | 1105 | alias da_NewtonHingeGetJointOmega = dFloat function(const NewtonJoint* hinge); 1106 | da_NewtonHingeGetJointOmega NewtonHingeGetJointOmega; 1107 | 1108 | alias da_NewtonHingeGetJointForce = void function(const NewtonJoint* hinge, const dFloat* force); 1109 | da_NewtonHingeGetJointForce NewtonHingeGetJointForce; 1110 | 1111 | alias da_NewtonHingeCalculateStopAlpha = dFloat function(const NewtonJoint* hinge, const NewtonHingeSliderUpdateDesc* desc, dFloat angle); 1112 | da_NewtonHingeCalculateStopAlpha NewtonHingeCalculateStopAlpha; 1113 | */ 1114 | 1115 | alias da_NewtonConstraintCreateSlider = NewtonJoint* function(const NewtonWorld* newtonWorld, const dFloat* pivotPoint, const dFloat* pinDir, const NewtonBody* childBody, const NewtonBody* parentBody); 1116 | da_NewtonConstraintCreateSlider NewtonConstraintCreateSlider; 1117 | 1118 | alias da_NewtonSliderSetUserCallback = void function(const NewtonJoint* slider, NewtonSliderCallback callback); 1119 | da_NewtonSliderSetUserCallback NewtonSliderSetUserCallback; 1120 | 1121 | alias da_NewtonSliderGetJointPosit = dFloat function(const NewtonJoint* slider); 1122 | da_NewtonSliderGetJointPosit NewtonSliderGetJointPosit; 1123 | 1124 | alias da_NewtonSliderGetJointVeloc = dFloat function(const NewtonJoint* slider); 1125 | da_NewtonSliderGetJointVeloc NewtonSliderGetJointVeloc; 1126 | 1127 | alias da_NewtonSliderGetJointForce = void function(const NewtonJoint* slider, dFloat* force); 1128 | da_NewtonSliderGetJointForce NewtonSliderGetJointForce; 1129 | 1130 | alias da_NewtonSliderCalculateStopAccel = dFloat function(const NewtonJoint* slider, const NewtonHingeSliderUpdateDesc* desc, dFloat position); 1131 | da_NewtonSliderCalculateStopAccel NewtonSliderCalculateStopAccel; 1132 | 1133 | alias da_NewtonConstraintCreateCorkscrew = NewtonJoint* function(const NewtonWorld* newtonWorld, const dFloat* pivotPoint, const dFloat* pinDir, const NewtonBody* childBody, const NewtonBody* parentBody); 1134 | da_NewtonConstraintCreateCorkscrew NewtonConstraintCreateCorkscrew; 1135 | 1136 | alias da_NewtonCorkscrewSetUserCallback = void function(const NewtonJoint* corkscrew, NewtonCorkscrewCallback callback); 1137 | da_NewtonCorkscrewSetUserCallback NewtonCorkscrewSetUserCallback; 1138 | 1139 | alias da_NewtonCorkscrewGetJointPosit = dFloat function(const NewtonJoint* corkscrew); 1140 | da_NewtonCorkscrewGetJointPosit NewtonCorkscrewGetJointPosit; 1141 | 1142 | alias da_NewtonCorkscrewGetJointAngle = dFloat function(const NewtonJoint* corkscrew); 1143 | da_NewtonCorkscrewGetJointAngle NewtonCorkscrewGetJointAngle; 1144 | 1145 | alias da_NewtonCorkscrewGetJointVeloc = dFloat function(const NewtonJoint* corkscrew); 1146 | da_NewtonCorkscrewGetJointVeloc NewtonCorkscrewGetJointVeloc; 1147 | 1148 | alias da_NewtonCorkscrewGetJointOmega = dFloat function(const NewtonJoint* corkscrew); 1149 | da_NewtonCorkscrewGetJointOmega NewtonCorkscrewGetJointOmega; 1150 | 1151 | alias da_NewtonCorkscrewGetJointForce = void function(const NewtonJoint* corkscrew, dFloat* force); 1152 | da_NewtonCorkscrewGetJointForce NewtonCorkscrewGetJointForce; 1153 | 1154 | alias da_NewtonCorkscrewCalculateStopAlpha = dFloat function(const NewtonJoint* corkscrew, const NewtonHingeSliderUpdateDesc* desc, dFloat angle); 1155 | da_NewtonCorkscrewCalculateStopAlpha NewtonCorkscrewCalculateStopAlpha; 1156 | 1157 | alias da_NewtonCorkscrewCalculateStopAccel = dFloat function(const NewtonJoint* corkscrew, const NewtonHingeSliderUpdateDesc* desc, dFloat position); 1158 | da_NewtonCorkscrewCalculateStopAccel NewtonCorkscrewCalculateStopAccel; 1159 | 1160 | alias da_NewtonConstraintCreateUniversal = NewtonJoint* function(const NewtonWorld* newtonWorld, const dFloat* pivotPoint, const dFloat* pinDir0, const dFloat* pinDir1, const NewtonBody* childBody, const NewtonBody* parentBody); 1161 | da_NewtonConstraintCreateUniversal NewtonConstraintCreateUniversal; 1162 | 1163 | alias da_NewtonUniversalSetUserCallback = void function(const NewtonJoint* universal, NewtonUniversalCallback callback); 1164 | da_NewtonUniversalSetUserCallback NewtonUniversalSetUserCallback; 1165 | 1166 | alias da_NewtonUniversalGetJointAngle0 = dFloat function(const NewtonJoint* universal); 1167 | da_NewtonUniversalGetJointAngle0 NewtonUniversalGetJointAngle0; 1168 | 1169 | alias da_NewtonUniversalGetJointAngle1 = dFloat function(const NewtonJoint* universal); 1170 | da_NewtonUniversalGetJointAngle1 NewtonUniversalGetJointAngle1; 1171 | 1172 | alias da_NewtonUniversalGetJointOmega0 = dFloat function(const NewtonJoint* universal); 1173 | da_NewtonUniversalGetJointOmega0 NewtonUniversalGetJointOmega0; 1174 | 1175 | alias da_NewtonUniversalGetJointOmega1 = dFloat function(const NewtonJoint* universal); 1176 | da_NewtonUniversalGetJointOmega1 NewtonUniversalGetJointOmega1; 1177 | 1178 | alias da_NewtonUniversalGetJointForce = void function(const NewtonJoint* universal, dFloat* force); 1179 | da_NewtonUniversalGetJointForce NewtonUniversalGetJointForce; 1180 | 1181 | alias da_NewtonUniversalCalculateStopAlpha0 = dFloat function(const NewtonJoint* universal, const NewtonHingeSliderUpdateDesc* desc, dFloat angle); 1182 | da_NewtonUniversalCalculateStopAlpha0 NewtonUniversalCalculateStopAlpha0; 1183 | 1184 | alias da_NewtonUniversalCalculateStopAlpha1 = dFloat function(const NewtonJoint* universal, const NewtonHingeSliderUpdateDesc* desc, dFloat angle); 1185 | da_NewtonUniversalCalculateStopAlpha1 NewtonUniversalCalculateStopAlpha1; 1186 | 1187 | alias da_NewtonConstraintCreateUpVector = NewtonJoint* function(const NewtonWorld* newtonWorld, const dFloat* pinDir, const NewtonBody* _body); 1188 | da_NewtonConstraintCreateUpVector NewtonConstraintCreateUpVector; 1189 | 1190 | alias da_NewtonUpVectorGetPin = void function(const NewtonJoint* upVector, dFloat* pin); 1191 | da_NewtonUpVectorGetPin NewtonUpVectorGetPin; 1192 | 1193 | alias da_NewtonUpVectorSetPin = void function(const NewtonJoint* upVector, const dFloat* pin); 1194 | da_NewtonUpVectorSetPin NewtonUpVectorSetPin; 1195 | 1196 | alias da_NewtonConstraintCreateUserJoint = NewtonJoint* function(const NewtonWorld* newtonWorld, int maxDOF, NewtonUserBilateralCallback callback, const NewtonBody* childBody, const NewtonBody* parentBody); 1197 | da_NewtonConstraintCreateUserJoint NewtonConstraintCreateUserJoint; 1198 | 1199 | alias da_NewtonUserJointGetSolverModel = int function(const NewtonJoint* joint); 1200 | da_NewtonUserJointGetSolverModel NewtonUserJointGetSolverModel; 1201 | 1202 | alias da_NewtonUserJointSetSolverModel = void function(const NewtonJoint* joint, int model); 1203 | da_NewtonUserJointSetSolverModel NewtonUserJointSetSolverModel; 1204 | 1205 | alias da_NewtonUserJointMassScale = void function(const NewtonJoint* joint, dFloat scaleBody0, dFloat scaleBody1); 1206 | da_NewtonUserJointMassScale NewtonUserJointMassScale; 1207 | 1208 | alias da_NewtonUserJointSetFeedbackCollectorCallback = void function(const NewtonJoint* joint, NewtonUserBilateralCallback getFeedback); 1209 | da_NewtonUserJointSetFeedbackCollectorCallback NewtonUserJointSetFeedbackCollectorCallback; 1210 | 1211 | alias da_NewtonUserJointAddLinearRow = void function(const NewtonJoint* joint, const dFloat* pivot0, const dFloat* pivot1, const dFloat* dir); 1212 | da_NewtonUserJointAddLinearRow NewtonUserJointAddLinearRow; 1213 | 1214 | alias da_NewtonUserJointAddAngularRow = void function(const NewtonJoint* joint, dFloat relativeAngle, const dFloat* dir); 1215 | da_NewtonUserJointAddAngularRow NewtonUserJointAddAngularRow; 1216 | 1217 | alias da_NewtonUserJointAddGeneralRow = void function(const NewtonJoint* joint, const dFloat* jacobian0, const dFloat* jacobian1); 1218 | da_NewtonUserJointAddGeneralRow NewtonUserJointAddGeneralRow; 1219 | 1220 | alias da_NewtonUserJointSetRowMinimumFriction = void function(const NewtonJoint* joint, dFloat friction); 1221 | da_NewtonUserJointSetRowMinimumFriction NewtonUserJointSetRowMinimumFriction; 1222 | 1223 | alias da_NewtonUserJointSetRowMaximumFriction = void function(const NewtonJoint* joint, dFloat friction); 1224 | da_NewtonUserJointSetRowMaximumFriction NewtonUserJointSetRowMaximumFriction; 1225 | 1226 | alias da_NewtonUserJointCalculateRowZeroAcceleration = dFloat function(const NewtonJoint* joint); 1227 | da_NewtonUserJointCalculateRowZeroAcceleration NewtonUserJointCalculateRowZeroAcceleration; 1228 | 1229 | alias da_NewtonUserJointGetRowAcceleration = dFloat function(const NewtonJoint* joint); 1230 | da_NewtonUserJointGetRowAcceleration NewtonUserJointGetRowAcceleration; 1231 | 1232 | alias da_NewtonUserJointGetRowJacobian = void function(const NewtonJoint* joint, dFloat* linear0, dFloat* angula0, dFloat* linear1, dFloat* angula1); 1233 | da_NewtonUserJointGetRowJacobian NewtonUserJointGetRowJacobian; 1234 | 1235 | alias da_NewtonUserJointSetRowAcceleration = void function(const NewtonJoint* joint, dFloat acceleration); 1236 | da_NewtonUserJointSetRowAcceleration NewtonUserJointSetRowAcceleration; 1237 | 1238 | alias da_NewtonUserJointSetRowMassDependentSpringDamperAcceleration = void function(const NewtonJoint* joint, dFloat spring, dFloat damper); 1239 | da_NewtonUserJointSetRowMassDependentSpringDamperAcceleration NewtonUserJointSetRowMassDependentSpringDamperAcceleration; 1240 | 1241 | alias da_NewtonUserJointSetRowMassIndependentSpringDamperAcceleration = void function(const NewtonJoint* joint, dFloat rowStiffness, dFloat spring, dFloat damper); 1242 | da_NewtonUserJointSetRowMassIndependentSpringDamperAcceleration NewtonUserJointSetRowMassIndependentSpringDamperAcceleration; 1243 | 1244 | alias da_NewtonUserJointSetRowStiffness = void function(const NewtonJoint* joint, dFloat stiffness); 1245 | da_NewtonUserJointSetRowStiffness NewtonUserJointSetRowStiffness; 1246 | 1247 | alias da_NewtonUserJoinRowsCount = int function(const NewtonJoint* joint); 1248 | da_NewtonUserJoinRowsCount NewtonUserJoinRowsCount; 1249 | 1250 | alias da_NewtonUserJointGetGeneralRow = void function(const NewtonJoint* joint, int index, dFloat* jacobian0, dFloat* jacobian1); 1251 | da_NewtonUserJointGetGeneralRow NewtonUserJointGetGeneralRow; 1252 | 1253 | alias da_NewtonUserJointGetRowForce = dFloat function(const NewtonJoint* joint, int row); 1254 | da_NewtonUserJointGetRowForce NewtonUserJointGetRowForce; 1255 | 1256 | alias da_NewtonMeshCreate = NewtonMesh* function(const NewtonWorld* newtonWorld); 1257 | da_NewtonMeshCreate NewtonMeshCreate; 1258 | 1259 | alias da_NewtonMeshCreateFromMesh = NewtonMesh* function(const NewtonMesh* mesh); 1260 | da_NewtonMeshCreateFromMesh NewtonMeshCreateFromMesh; 1261 | 1262 | alias da_NewtonMeshCreateFromCollision = NewtonMesh* function(const NewtonCollision* collision); 1263 | da_NewtonMeshCreateFromCollision NewtonMeshCreateFromCollision; 1264 | 1265 | alias da_NewtonMeshCreateTetrahedraIsoSurface = NewtonMesh* function(const NewtonMesh* mesh); 1266 | da_NewtonMeshCreateTetrahedraIsoSurface NewtonMeshCreateTetrahedraIsoSurface; 1267 | 1268 | alias da_NewtonMeshCreateConvexHull = NewtonMesh* function(const NewtonWorld* newtonWorld, int pointCount, const dFloat* vertexCloud, int strideInBytes, dFloat tolerance); 1269 | da_NewtonMeshCreateConvexHull NewtonMeshCreateConvexHull; 1270 | 1271 | alias da_NewtonMeshCreateVoronoiConvexDecomposition = NewtonMesh* function(const NewtonWorld* newtonWorld, int pointCount, const dFloat* vertexCloud, int strideInBytes, int materialID, const dFloat* textureMatrix); 1272 | da_NewtonMeshCreateVoronoiConvexDecomposition NewtonMeshCreateVoronoiConvexDecomposition; 1273 | 1274 | alias da_NewtonMeshCreateFromSerialization = NewtonMesh* function(const NewtonWorld* newtonWorld, NewtonDeserializeCallback deserializeFunction, void* serializeHandle); 1275 | da_NewtonMeshCreateFromSerialization NewtonMeshCreateFromSerialization; 1276 | 1277 | alias da_NewtonMeshDestroy = void function(const NewtonMesh* mesh); 1278 | da_NewtonMeshDestroy NewtonMeshDestroy; 1279 | 1280 | alias da_NewtonMeshSerialize = void function(const NewtonMesh* mesh, NewtonSerializeCallback serializeFunction, void* serializeHandle); 1281 | da_NewtonMeshSerialize NewtonMeshSerialize; 1282 | 1283 | alias da_NewtonMeshSaveOFF = void function(const NewtonMesh* mesh, const char* filename); 1284 | da_NewtonMeshSaveOFF NewtonMeshSaveOFF; 1285 | 1286 | alias da_NewtonMeshLoadOFF = NewtonMesh* function(const NewtonWorld* newtonWorld, const char* filename); 1287 | da_NewtonMeshLoadOFF NewtonMeshLoadOFF; 1288 | 1289 | alias da_NewtonMeshLoadTetrahedraMesh = NewtonMesh* function(const NewtonWorld* newtonWorld, const char* filename); 1290 | da_NewtonMeshLoadTetrahedraMesh NewtonMeshLoadTetrahedraMesh; 1291 | 1292 | alias da_NewtonMeshFlipWinding = void function(const NewtonMesh* mesh); 1293 | da_NewtonMeshFlipWinding NewtonMeshFlipWinding; 1294 | 1295 | alias da_NewtonMeshApplyTransform = void function(const NewtonMesh* mesh, const dFloat* matrix); 1296 | da_NewtonMeshApplyTransform NewtonMeshApplyTransform; 1297 | 1298 | alias da_NewtonMeshCalculateOOBB = void function(const NewtonMesh* mesh, dFloat* matrix, dFloat* x, dFloat* y, dFloat* z); 1299 | da_NewtonMeshCalculateOOBB NewtonMeshCalculateOOBB; 1300 | 1301 | alias da_NewtonMeshCalculateVertexNormals = void function(const NewtonMesh* mesh, dFloat angleInRadians); 1302 | da_NewtonMeshCalculateVertexNormals NewtonMeshCalculateVertexNormals; 1303 | 1304 | alias da_NewtonMeshApplySphericalMapping = void function(const NewtonMesh* mesh, int material, const dFloat* aligmentMatrix); 1305 | da_NewtonMeshApplySphericalMapping NewtonMeshApplySphericalMapping; 1306 | 1307 | alias da_NewtonMeshApplyCylindricalMapping = void function(const NewtonMesh* mesh, int cylinderMaterial, int capMaterial, const dFloat* aligmentMatrix); 1308 | da_NewtonMeshApplyCylindricalMapping NewtonMeshApplyCylindricalMapping; 1309 | 1310 | alias da_NewtonMeshApplyBoxMapping = void function(const NewtonMesh* mesh, int frontMaterial, int sideMaterial, int topMaterial, const dFloat* aligmentMatrix); 1311 | da_NewtonMeshApplyBoxMapping NewtonMeshApplyBoxMapping; 1312 | 1313 | alias da_NewtonMeshApplyAngleBasedMapping = void function(const NewtonMesh* mesh, int material, NewtonReportProgress reportPrograssCallback, void* reportPrgressUserData, dFloat* aligmentMatrix); 1314 | da_NewtonMeshApplyAngleBasedMapping NewtonMeshApplyAngleBasedMapping; 1315 | 1316 | alias da_NewtonCreateTetrahedraLinearBlendSkinWeightsChannel = void function(const NewtonMesh* tetrahedraMesh, NewtonMesh* skinMesh); 1317 | da_NewtonCreateTetrahedraLinearBlendSkinWeightsChannel NewtonCreateTetrahedraLinearBlendSkinWeightsChannel; 1318 | 1319 | alias da_NewtonMeshOptimize = void function(const NewtonMesh* mesh); 1320 | da_NewtonMeshOptimize NewtonMeshOptimize; 1321 | 1322 | alias da_NewtonMeshOptimizePoints = void function(const NewtonMesh* mesh); 1323 | da_NewtonMeshOptimizePoints NewtonMeshOptimizePoints; 1324 | 1325 | alias da_NewtonMeshOptimizeVertex = void function(const NewtonMesh* mesh); 1326 | da_NewtonMeshOptimizeVertex NewtonMeshOptimizeVertex; 1327 | 1328 | alias da_NewtonMeshIsOpenMesh = int function(const NewtonMesh* mesh); 1329 | da_NewtonMeshIsOpenMesh NewtonMeshIsOpenMesh; 1330 | 1331 | alias da_NewtonMeshFixTJoints = void function(const NewtonMesh* mesh); 1332 | da_NewtonMeshFixTJoints NewtonMeshFixTJoints; 1333 | 1334 | alias da_NewtonMeshPolygonize = void function(const NewtonMesh* mesh); 1335 | da_NewtonMeshPolygonize NewtonMeshPolygonize; 1336 | 1337 | alias da_NewtonMeshTriangulate = void function(const NewtonMesh* mesh); 1338 | da_NewtonMeshTriangulate NewtonMeshTriangulate; 1339 | 1340 | alias da_NewtonMeshUnion = NewtonMesh* function(const NewtonMesh* mesh, const NewtonMesh* clipper, const dFloat* clipperMatrix); 1341 | da_NewtonMeshUnion NewtonMeshUnion; 1342 | 1343 | alias da_NewtonMeshDifference = NewtonMesh* function(const NewtonMesh* mesh, const NewtonMesh* clipper, const dFloat* clipperMatrix); 1344 | da_NewtonMeshDifference NewtonMeshDifference; 1345 | 1346 | alias da_NewtonMeshIntersection = NewtonMesh* function(const NewtonMesh* mesh, const NewtonMesh* clipper, const dFloat* clipperMatrix); 1347 | da_NewtonMeshIntersection NewtonMeshIntersection; 1348 | 1349 | alias da_NewtonMeshClip = void function(const NewtonMesh* mesh, const NewtonMesh* clipper, const dFloat* clipperMatrix, NewtonMesh* * topMesh, NewtonMesh* * bottomMesh); 1350 | da_NewtonMeshClip NewtonMeshClip; 1351 | 1352 | alias da_NewtonMeshConvexMeshIntersection = NewtonMesh* function(const NewtonMesh* mesh, const NewtonMesh* convexMesh); 1353 | da_NewtonMeshConvexMeshIntersection NewtonMeshConvexMeshIntersection; 1354 | 1355 | alias da_NewtonMeshSimplify = NewtonMesh* function(const NewtonMesh* mesh, int maxVertexCount, NewtonReportProgress reportPrograssCallback, void* reportPrgressUserData); 1356 | da_NewtonMeshSimplify NewtonMeshSimplify; 1357 | 1358 | alias da_NewtonMeshApproximateConvexDecomposition = NewtonMesh* function(const NewtonMesh* mesh, dFloat maxConcavity, dFloat backFaceDistanceFactor, int maxCount, int maxVertexPerHull, NewtonReportProgress reportProgressCallback, void* reportProgressUserData); 1359 | da_NewtonMeshApproximateConvexDecomposition NewtonMeshApproximateConvexDecomposition; 1360 | 1361 | alias da_NewtonRemoveUnusedVertices = void function(const NewtonMesh* mesh, int* vertexRemapTable); 1362 | da_NewtonRemoveUnusedVertices NewtonRemoveUnusedVertices; 1363 | 1364 | alias da_NewtonMeshBeginBuild = void function(const NewtonMesh* mesh); 1365 | da_NewtonMeshBeginBuild NewtonMeshBeginBuild; 1366 | 1367 | alias da_NewtonMeshBeginFace = void function(const NewtonMesh* mesh); 1368 | da_NewtonMeshBeginFace NewtonMeshBeginFace; 1369 | 1370 | alias da_NewtonMeshAddPoint = void function(const NewtonMesh* mesh, double x, double y, double z); 1371 | da_NewtonMeshAddPoint NewtonMeshAddPoint; 1372 | 1373 | alias da_NewtonMeshAddLayer = void function(const NewtonMesh* mesh, int layerIndex); 1374 | da_NewtonMeshAddLayer NewtonMeshAddLayer; 1375 | 1376 | alias da_NewtonMeshAddMaterial = void function(const NewtonMesh* mesh, int materialIndex); 1377 | da_NewtonMeshAddMaterial NewtonMeshAddMaterial; 1378 | 1379 | alias da_NewtonMeshAddNormal = void function(const NewtonMesh* mesh, dFloat x, dFloat y, dFloat z); 1380 | da_NewtonMeshAddNormal NewtonMeshAddNormal; 1381 | 1382 | alias da_NewtonMeshAddBinormal = void function(const NewtonMesh* mesh, dFloat x, dFloat y, dFloat z); 1383 | da_NewtonMeshAddBinormal NewtonMeshAddBinormal; 1384 | 1385 | alias da_NewtonMeshAddUV0 = void function(const NewtonMesh* mesh, dFloat u, dFloat v); 1386 | da_NewtonMeshAddUV0 NewtonMeshAddUV0; 1387 | 1388 | alias da_NewtonMeshAddUV1 = void function(const NewtonMesh* mesh, dFloat u, dFloat v); 1389 | da_NewtonMeshAddUV1 NewtonMeshAddUV1; 1390 | 1391 | alias da_NewtonMeshAddVertexColor = void function(const NewtonMesh* mesh, dFloat r, dFloat g, dFloat b, dFloat a); 1392 | da_NewtonMeshAddVertexColor NewtonMeshAddVertexColor; 1393 | 1394 | alias da_NewtonMeshEndFace = void function(const NewtonMesh* mesh); 1395 | da_NewtonMeshEndFace NewtonMeshEndFace; 1396 | 1397 | alias da_NewtonMeshEndBuild = void function(const NewtonMesh* mesh); 1398 | da_NewtonMeshEndBuild NewtonMeshEndBuild; 1399 | 1400 | alias da_NewtonMeshClearVertexFormat = void function( NewtonMeshVertexFormat* format); 1401 | da_NewtonMeshClearVertexFormat NewtonMeshClearVertexFormat; 1402 | 1403 | alias da_NewtonMeshBuildFromVertexListIndexList = void function(const NewtonMesh* mesh, const NewtonMeshVertexFormat* format); 1404 | da_NewtonMeshBuildFromVertexListIndexList NewtonMeshBuildFromVertexListIndexList; 1405 | 1406 | alias da_NewtonMeshGetPointCount = int function(const NewtonMesh* mesh); 1407 | da_NewtonMeshGetPointCount NewtonMeshGetPointCount; 1408 | 1409 | alias da_NewtonMeshGetIndexToVertexMap = const int* function(const NewtonMesh* mesh); 1410 | da_NewtonMeshGetIndexToVertexMap NewtonMeshGetIndexToVertexMap; 1411 | 1412 | alias da_NewtonMeshGetVertexDoubleChannel = void function(const NewtonMesh* mesh, int vertexStrideInByte, double* outBuffer); 1413 | da_NewtonMeshGetVertexDoubleChannel NewtonMeshGetVertexDoubleChannel; 1414 | 1415 | alias da_NewtonMeshGetVertexChannel = void function(const NewtonMesh* mesh, int vertexStrideInByte, dFloat* outBuffer); 1416 | da_NewtonMeshGetVertexChannel NewtonMeshGetVertexChannel; 1417 | 1418 | alias da_NewtonMeshGetNormalChannel = void function(const NewtonMesh* mesh, int vertexStrideInByte, dFloat* outBuffer); 1419 | da_NewtonMeshGetNormalChannel NewtonMeshGetNormalChannel; 1420 | 1421 | alias da_NewtonMeshGetBinormalChannel = void function(const NewtonMesh* mesh, int vertexStrideInByte, dFloat* outBuffer); 1422 | da_NewtonMeshGetBinormalChannel NewtonMeshGetBinormalChannel; 1423 | 1424 | alias da_NewtonMeshGetUV0Channel = void function(const NewtonMesh* mesh, int vertexStrideInByte, dFloat* outBuffer); 1425 | da_NewtonMeshGetUV0Channel NewtonMeshGetUV0Channel; 1426 | 1427 | alias da_NewtonMeshGetUV1Channel = void function(const NewtonMesh* mesh, int vertexStrideInByte, dFloat* outBuffer); 1428 | da_NewtonMeshGetUV1Channel NewtonMeshGetUV1Channel; 1429 | 1430 | alias da_NewtonMeshGetVertexColorChannel = void function(const NewtonMesh* mesh, int vertexStrideInByte, dFloat* outBuffer); 1431 | da_NewtonMeshGetVertexColorChannel NewtonMeshGetVertexColorChannel; 1432 | 1433 | alias da_NewtonMeshHasNormalChannel = int function(const NewtonMesh* mesh); 1434 | da_NewtonMeshHasNormalChannel NewtonMeshHasNormalChannel; 1435 | 1436 | alias da_NewtonMeshHasBinormalChannel = int function(const NewtonMesh* mesh); 1437 | da_NewtonMeshHasBinormalChannel NewtonMeshHasBinormalChannel; 1438 | 1439 | alias da_NewtonMeshHasUV0Channel = int function(const NewtonMesh* mesh); 1440 | da_NewtonMeshHasUV0Channel NewtonMeshHasUV0Channel; 1441 | 1442 | alias da_NewtonMeshHasUV1Channel = int function(const NewtonMesh* mesh); 1443 | da_NewtonMeshHasUV1Channel NewtonMeshHasUV1Channel; 1444 | 1445 | alias da_NewtonMeshHasVertexColorChannel = int function(const NewtonMesh* mesh); 1446 | da_NewtonMeshHasVertexColorChannel NewtonMeshHasVertexColorChannel; 1447 | 1448 | alias da_NewtonMeshBeginHandle = void* function(const NewtonMesh* mesh); 1449 | da_NewtonMeshBeginHandle NewtonMeshBeginHandle; 1450 | 1451 | alias da_NewtonMeshEndHandle = void function(const NewtonMesh* mesh, void* handle); 1452 | da_NewtonMeshEndHandle NewtonMeshEndHandle; 1453 | 1454 | alias da_NewtonMeshFirstMaterial = int function(const NewtonMesh* mesh, void* handle); 1455 | da_NewtonMeshFirstMaterial NewtonMeshFirstMaterial; 1456 | 1457 | alias da_NewtonMeshNextMaterial = int function(const NewtonMesh* mesh, void* handle, int materialId); 1458 | da_NewtonMeshNextMaterial NewtonMeshNextMaterial; 1459 | 1460 | alias da_NewtonMeshMaterialGetMaterial = int function(const NewtonMesh* mesh, void* handle, int materialId); 1461 | da_NewtonMeshMaterialGetMaterial NewtonMeshMaterialGetMaterial; 1462 | 1463 | alias da_NewtonMeshMaterialGetIndexCount = int function(const NewtonMesh* mesh, void* handle, int materialId); 1464 | da_NewtonMeshMaterialGetIndexCount NewtonMeshMaterialGetIndexCount; 1465 | 1466 | alias da_NewtonMeshMaterialGetIndexStream = void function(const NewtonMesh* mesh, void* handle, int materialId, int* index); 1467 | da_NewtonMeshMaterialGetIndexStream NewtonMeshMaterialGetIndexStream; 1468 | 1469 | alias da_NewtonMeshMaterialGetIndexStreamShort = void function(const NewtonMesh* mesh, void* handle, int materialId, short* index); 1470 | da_NewtonMeshMaterialGetIndexStreamShort NewtonMeshMaterialGetIndexStreamShort; 1471 | 1472 | alias da_NewtonMeshCreateFirstSingleSegment = NewtonMesh* function(const NewtonMesh* mesh); 1473 | da_NewtonMeshCreateFirstSingleSegment NewtonMeshCreateFirstSingleSegment; 1474 | 1475 | alias da_NewtonMeshCreateNextSingleSegment = NewtonMesh* function(const NewtonMesh* mesh, const NewtonMesh* segment); 1476 | da_NewtonMeshCreateNextSingleSegment NewtonMeshCreateNextSingleSegment; 1477 | 1478 | alias da_NewtonMeshCreateFirstLayer = NewtonMesh* function(const NewtonMesh* mesh); 1479 | da_NewtonMeshCreateFirstLayer NewtonMeshCreateFirstLayer; 1480 | 1481 | alias da_NewtonMeshCreateNextLayer = NewtonMesh* function(const NewtonMesh* mesh, const NewtonMesh* segment); 1482 | da_NewtonMeshCreateNextLayer NewtonMeshCreateNextLayer; 1483 | 1484 | alias da_NewtonMeshGetTotalFaceCount = int function(const NewtonMesh* mesh); 1485 | da_NewtonMeshGetTotalFaceCount NewtonMeshGetTotalFaceCount; 1486 | 1487 | alias da_NewtonMeshGetTotalIndexCount = int function(const NewtonMesh* mesh); 1488 | da_NewtonMeshGetTotalIndexCount NewtonMeshGetTotalIndexCount; 1489 | 1490 | alias da_NewtonMeshGetFaces = void function(const NewtonMesh* mesh, int* faceIndexCount, int* faceMaterial, void* * faceIndices); 1491 | da_NewtonMeshGetFaces NewtonMeshGetFaces; 1492 | 1493 | alias da_NewtonMeshGetVertexCount = int function(const NewtonMesh* mesh); 1494 | da_NewtonMeshGetVertexCount NewtonMeshGetVertexCount; 1495 | 1496 | alias da_NewtonMeshGetVertexStrideInByte = int function(const NewtonMesh* mesh); 1497 | da_NewtonMeshGetVertexStrideInByte NewtonMeshGetVertexStrideInByte; 1498 | 1499 | alias da_NewtonMeshGetVertexArray = const double* function(const NewtonMesh* mesh); 1500 | da_NewtonMeshGetVertexArray NewtonMeshGetVertexArray; 1501 | 1502 | alias da_NewtonMeshGetVertexBaseCount = int function(const NewtonMesh* mesh); 1503 | da_NewtonMeshGetVertexBaseCount NewtonMeshGetVertexBaseCount; 1504 | 1505 | alias da_NewtonMeshSetVertexBaseCount = void function(const NewtonMesh* mesh, int baseCount); 1506 | da_NewtonMeshSetVertexBaseCount NewtonMeshSetVertexBaseCount; 1507 | 1508 | alias da_NewtonMeshGetFirstVertex = void* function(const NewtonMesh* mesh); 1509 | da_NewtonMeshGetFirstVertex NewtonMeshGetFirstVertex; 1510 | 1511 | alias da_NewtonMeshGetNextVertex = void* function(const NewtonMesh* mesh, const void* vertex); 1512 | da_NewtonMeshGetNextVertex NewtonMeshGetNextVertex; 1513 | 1514 | alias da_NewtonMeshGetVertexIndex = int function(const NewtonMesh* mesh, const void* vertex); 1515 | da_NewtonMeshGetVertexIndex NewtonMeshGetVertexIndex; 1516 | 1517 | alias da_NewtonMeshGetFirstPoint = void* function(const NewtonMesh* mesh); 1518 | da_NewtonMeshGetFirstPoint NewtonMeshGetFirstPoint; 1519 | 1520 | alias da_NewtonMeshGetNextPoint = void* function(const NewtonMesh* mesh, const void* point); 1521 | da_NewtonMeshGetNextPoint NewtonMeshGetNextPoint; 1522 | 1523 | alias da_NewtonMeshGetPointIndex = int function(const NewtonMesh* mesh, const void* point); 1524 | da_NewtonMeshGetPointIndex NewtonMeshGetPointIndex; 1525 | 1526 | alias da_NewtonMeshGetVertexIndexFromPoint = int function(const NewtonMesh* mesh, const void* point); 1527 | da_NewtonMeshGetVertexIndexFromPoint NewtonMeshGetVertexIndexFromPoint; 1528 | 1529 | alias da_NewtonMeshGetFirstEdge = void* function(const NewtonMesh* mesh); 1530 | da_NewtonMeshGetFirstEdge NewtonMeshGetFirstEdge; 1531 | 1532 | alias da_NewtonMeshGetNextEdge = void* function(const NewtonMesh* mesh, const void* edge); 1533 | da_NewtonMeshGetNextEdge NewtonMeshGetNextEdge; 1534 | 1535 | alias da_NewtonMeshGetEdgeIndices = void function(const NewtonMesh* mesh, const void* edge, int* v0, int* v1); 1536 | da_NewtonMeshGetEdgeIndices NewtonMeshGetEdgeIndices; 1537 | 1538 | alias da_NewtonMeshGetFirstFace = void* function(const NewtonMesh* mesh); 1539 | da_NewtonMeshGetFirstFace NewtonMeshGetFirstFace; 1540 | 1541 | alias da_NewtonMeshGetNextFace = void* function(const NewtonMesh* mesh, const void* face); 1542 | da_NewtonMeshGetNextFace NewtonMeshGetNextFace; 1543 | 1544 | alias da_NewtonMeshIsFaceOpen = int function(const NewtonMesh* mesh, const void* face); 1545 | da_NewtonMeshIsFaceOpen NewtonMeshIsFaceOpen; 1546 | 1547 | alias da_NewtonMeshGetFaceMaterial = int function(const NewtonMesh* mesh, const void* face); 1548 | da_NewtonMeshGetFaceMaterial NewtonMeshGetFaceMaterial; 1549 | 1550 | alias da_NewtonMeshGetFaceIndexCount = int function(const NewtonMesh* mesh, const void* face); 1551 | da_NewtonMeshGetFaceIndexCount NewtonMeshGetFaceIndexCount; 1552 | 1553 | alias da_NewtonMeshGetFaceIndices = void function(const NewtonMesh* mesh, const void* face, int* indices); 1554 | da_NewtonMeshGetFaceIndices NewtonMeshGetFaceIndices; 1555 | 1556 | alias da_NewtonMeshGetFacePointIndices = void function(const NewtonMesh* mesh, const void* face, int* indices); 1557 | da_NewtonMeshGetFacePointIndices NewtonMeshGetFacePointIndices; 1558 | 1559 | alias da_NewtonMeshCalculateFaceNormal = void function(const NewtonMesh* mesh, const void* face, double* normal); 1560 | da_NewtonMeshCalculateFaceNormal NewtonMeshCalculateFaceNormal; 1561 | 1562 | alias da_NewtonMeshSetFaceMaterial = void function(const NewtonMesh* mesh, const void* face, int matId); 1563 | da_NewtonMeshSetFaceMaterial NewtonMeshSetFaceMaterial; 1564 | 1565 | } 1566 | -------------------------------------------------------------------------------- /src/bindbc/newton/package.d: -------------------------------------------------------------------------------- 1 | /* 2 | Boost Software License - Version 1.0 - August 17th, 2003 3 | 4 | Permission is hereby granted, free of charge, to any person or organization 5 | obtaining a copy of the software and accompanying documentation covered by 6 | this license (the "Software") to use, reproduce, display, distribute, 7 | execute, and transmit the Software, and to prepare derivative works of the 8 | Software, and to permit third-parties to whom the Software is furnished to 9 | do so, all subject to the following: 10 | 11 | The copyright notices in the Software and this entire statement, including 12 | the above license grant, this restriction and the following disclaimer, 13 | must be included in all copies of the Software, in whole or in part, and 14 | all derivative works of the Software, unless such copies or derivative 15 | works are solely in the form of machine-executable object code generated by 16 | a source language processor. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 21 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 22 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 23 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 24 | DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | module bindbc.newton; 28 | 29 | public import bindbc.newton.types; 30 | public import bindbc.newton.funcs; 31 | public import bindbc.newton.binddynamic; 32 | -------------------------------------------------------------------------------- /src/bindbc/newton/types.d: -------------------------------------------------------------------------------- 1 | /* 2 | Boost Software License - Version 1.0 - August 17th, 2003 3 | 4 | Permission is hereby granted, free of charge, to any person or organization 5 | obtaining a copy of the software and accompanying documentation covered by 6 | this license (the "Software") to use, reproduce, display, distribute, 7 | execute, and transmit the Software, and to prepare derivative works of the 8 | Software, and to permit third-parties to whom the Software is furnished to 9 | do so, all subject to the following: 10 | 11 | The copyright notices in the Software and this entire statement, including 12 | the above license grant, this restriction and the following disclaimer, 13 | must be included in all copies of the Software, in whole or in part, and 14 | all derivative works of the Software, unless such copies or derivative 15 | works are solely in the form of machine-executable object code generated by 16 | a source language processor. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 21 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 22 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 23 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 24 | DEALINGS IN THE SOFTWARE. 25 | */ 26 | module bindbc.newton.types; 27 | 28 | private { 29 | import core.stdc.config; 30 | } 31 | 32 | extern(C): 33 | 34 | alias dLong = long; 35 | alias dFloat32 = float; 36 | alias dFloat64 = double; 37 | version(_NEWTON_USE_DOUBLE) alias dFloat = double; 38 | else alias dFloat = float; 39 | 40 | enum NEWTON_MAJOR_VERSION = 3; 41 | enum NEWTON_MINOR_VERSION = 14; 42 | 43 | enum NEWTON_BROADPHASE_DEFAULT = 0; 44 | enum NEWTON_BROADPHASE_PERSINTENT = 1; 45 | 46 | enum NEWTON_DYNAMIC_BODY = 0; 47 | enum NEWTON_KINEMATIC_BODY = 1; 48 | enum NEWTON_DYNAMIC_ASYMETRIC_BODY = 2; 49 | // enum NEWTON_DEFORMABLE_BODY = 2; 50 | 51 | enum SERIALIZE_ID_SPHERE = 0; 52 | enum SERIALIZE_ID_CAPSULE = 1; 53 | enum SERIALIZE_ID_CYLINDER = 2; 54 | enum SERIALIZE_ID_CHAMFERCYLINDER = 3; 55 | enum SERIALIZE_ID_BOX = 4; 56 | enum SERIALIZE_ID_CONE = 5; 57 | enum SERIALIZE_ID_CONVEXHULL = 6; 58 | enum SERIALIZE_ID_NULL = 7; 59 | enum SERIALIZE_ID_COMPOUND = 8; 60 | enum SERIALIZE_ID_TREE = 9; 61 | enum SERIALIZE_ID_HEIGHTFIELD = 10; 62 | enum SERIALIZE_ID_CLOTH_PATCH = 11; 63 | enum SERIALIZE_ID_DEFORMABLE_SOLID = 12; 64 | enum SERIALIZE_ID_USERMESH = 13; 65 | enum SERIALIZE_ID_SCENE = 14; 66 | enum SERIALIZE_ID_FRACTURED_COMPOUND = 15; 67 | 68 | struct NewtonMesh {} 69 | struct NewtonBody {} 70 | struct NewtonWorld {} 71 | struct NewtonJoint {} 72 | struct NewtonMaterial {} 73 | struct NewtonCollision {} 74 | struct NewtonDeformableMeshSegment {} 75 | struct NewtonFracturedCompoundMeshPart {} 76 | 77 | union NewtonMaterialData 78 | { 79 | void* m_ptr; 80 | dLong m_int; 81 | dFloat m_float; 82 | } 83 | 84 | struct NewtonCollisionMaterial 85 | { 86 | dLong m_userId; 87 | NewtonMaterialData m_userData; 88 | NewtonMaterialData[6] m_userParam; 89 | } 90 | 91 | struct NewtonBoxParam 92 | { 93 | dFloat m_x; 94 | dFloat m_y; 95 | dFloat m_z; 96 | } 97 | 98 | struct NewtonSphereParam 99 | { 100 | dFloat m_radio; 101 | } 102 | 103 | struct NewtonCapsuleParam 104 | { 105 | dFloat m_radio0; 106 | dFloat m_radio1; 107 | dFloat m_height; 108 | } 109 | 110 | struct NewtonCylinderParam 111 | { 112 | dFloat m_radio0; 113 | dFloat m_radio1; 114 | dFloat m_height; 115 | } 116 | 117 | struct NewtonConeParam 118 | { 119 | dFloat m_radio; 120 | dFloat m_height; 121 | } 122 | 123 | struct NewtonChamferCylinderParam 124 | { 125 | dFloat m_radio; 126 | dFloat m_height; 127 | } 128 | 129 | struct NewtonConvexHullParam 130 | { 131 | int m_vertexCount; 132 | int m_vertexStrideInBytes; 133 | int m_faceCount; 134 | dFloat* m_vertex; 135 | } 136 | 137 | struct NewtonCompoundCollisionParam 138 | { 139 | int m_chidrenCount; 140 | } 141 | 142 | struct NewtonCollisionTreeParam 143 | { 144 | int m_vertexCount; 145 | int m_indexCount; 146 | } 147 | 148 | struct NewtonDeformableMeshParam 149 | { 150 | int m_vertexCount; 151 | int m_triangleCount; 152 | int m_vrtexStrideInBytes; 153 | ushort* m_indexList; 154 | dFloat* m_vertexList; 155 | } 156 | 157 | struct NewtonHeightFieldCollisionParam 158 | { 159 | int m_width; 160 | int m_height; 161 | int m_gridsDiagonals; 162 | int m_elevationDataType; // 0 = 32 bit floats, 1 = unsigned 16 bit integers 163 | dFloat m_verticalScale; 164 | dFloat m_horizonalScale_x; 165 | dFloat m_horizonalScale_z; 166 | void* m_vertialElevation; 167 | char* m_atributes; 168 | } 169 | 170 | struct NewtonSceneCollisionParam 171 | { 172 | int m_childrenProxyCount; 173 | } 174 | 175 | struct NewtonCollisionInfoRecord 176 | { 177 | dFloat[4][4] m_offsetMatrix; 178 | NewtonCollisionMaterial m_collisionMaterial; 179 | int m_collisionType; // tag id to identify the collision primitive 180 | 181 | union 182 | { 183 | NewtonBoxParam m_box; 184 | NewtonConeParam m_cone; 185 | NewtonSphereParam m_sphere; 186 | NewtonCapsuleParam m_capsule; 187 | NewtonCylinderParam m_cylinder; 188 | NewtonChamferCylinderParam m_chamferCylinder; 189 | NewtonConvexHullParam m_convexHull; 190 | NewtonDeformableMeshParam m_deformableMesh; 191 | NewtonCompoundCollisionParam m_compoundCollision; 192 | NewtonCollisionTreeParam m_collisionTree; 193 | NewtonHeightFieldCollisionParam m_heightField; 194 | NewtonSceneCollisionParam m_sceneCollision; 195 | dFloat[64] m_paramArray; // user define collision can use this to store information 196 | } 197 | } 198 | 199 | struct NewtonJointRecord 200 | { 201 | dFloat[4][4] m_attachmenMatrix_0; 202 | dFloat[4][4] m_attachmenMatrix_1; 203 | dFloat[3] m_minLinearDof; 204 | dFloat[3] m_maxLinearDof; 205 | dFloat[3] m_minAngularDof; 206 | dFloat[3] m_maxAngularDof; 207 | const(NewtonBody)* m_attachBody_0; 208 | const(NewtonBody)* m_attachBody_1; 209 | dFloat[64] m_extraParameters; 210 | int m_bodiesCollisionOn; 211 | char[128] m_descriptionType; 212 | } 213 | 214 | struct NewtonUserMeshCollisionCollideDesc 215 | { 216 | dFloat[4] m_boxP0; // lower bounding box of intersection query in local space 217 | dFloat[4] m_boxP1; // upper bounding box of intersection query in local space 218 | dFloat[4] m_boxDistanceTravel; // max distance that box bpxP0 and boxP1 can travel on this timestep, used this for continue collision mode. 219 | int m_threadNumber; // current thread executing this query 220 | int m_faceCount; // the application should set here how many polygons intersect the query box 221 | int m_vertexStrideInBytes; // the application should set here the size of each vertex 222 | dFloat m_skinThickness; // this is the minimum skin separation specified by the material between these two colliding shapes 223 | void* m_userData; // user data passed to the collision geometry at creation time 224 | 225 | NewtonBody* m_objBody; // pointer to the colliding body 226 | NewtonBody* m_polySoupBody; // pointer to the rigid body owner of this collision tree 227 | NewtonCollision* m_objCollision; // collision shape of the colliding body, (no necessarily the collision of m_objBody) 228 | NewtonCollision* m_polySoupCollision; // collision shape of the collision tree, (no necessarily the collision of m_polySoupBody) 229 | 230 | dFloat* m_vertex; // the application should set here the pointer to the global vertex of the mesh. 231 | int* m_faceIndexCount; // the application should set here the pointer to the vertex count of each face. 232 | int* m_faceVertexIndex; // the application should set here the pointer index array for each vertex on a face. 233 | // the format of a face is I0, I1, I2, I3, ..., M, N, E0, E1, E2, ..., A 234 | // I0, I1, I2, .. are the indices to the vertex, relative to m_vertex pointer 235 | // M is the index to the material sub shape id 236 | // N in the index to the vertex normal relative to m_vertex pointer 237 | // 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 238 | // 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. 239 | } 240 | 241 | struct NewtonWorldConvexCastReturnInfo 242 | { 243 | dFloat[4] m_point; // collision point in global space 244 | dFloat[4] m_normal; // surface normal at collision point in global space 245 | //dFloat m_normalOnHitPoint[4]; // surface normal at the surface of the hit body, 246 | // is the same as the normal calculated by a ray cast hitting the body at the hit point 247 | dLong m_contactID; // collision ID at contact point 248 | const(NewtonBody)* m_hitBody; // body hit at contact point 249 | dFloat m_penetration; // contact penetration at collision point 250 | } 251 | 252 | struct NewtonUserMeshCollisionRayHitDesc 253 | { 254 | dFloat[4] m_p0; // ray origin in collision local space 255 | dFloat[4] m_p1; // ray destination in collision local space 256 | dFloat[4] m_normalOut; // copy here the normal at the ray intersection 257 | dLong m_userIdOut; // copy here a user defined id for further feedback 258 | void* m_userData; // user data passed to the collision geometry at creation time 259 | } 260 | 261 | struct NewtonHingeSliderUpdateDesc 262 | { 263 | dFloat m_accel; 264 | dFloat m_minFriction; 265 | dFloat m_maxFriction; 266 | dFloat m_timestep; 267 | } 268 | 269 | struct NewtonUserContactPoint 270 | { 271 | dFloat[4] m_point; 272 | dFloat[4] m_normal; 273 | dLong m_shapeId0; 274 | dLong m_shapeId1; 275 | dFloat m_penetration; 276 | int[3] m_unused; 277 | } 278 | 279 | struct NewtonImmediateModeConstraint 280 | { 281 | dFloat[8][6] m_jacobian01; 282 | dFloat[8][6] m_jacobian10; 283 | dFloat[8] m_minFriction; 284 | dFloat[8] m_maxFriction; 285 | dFloat[8] m_jointAccel; 286 | dFloat[8] m_jointStiffness; 287 | } 288 | 289 | // data structure for interfacing with NewtonMesh 290 | struct NewtonMeshDoubleData 291 | { 292 | dFloat64* m_data; 293 | int* m_indexList; 294 | int m_strideInBytes; 295 | } 296 | 297 | struct NewtonMeshFloatData 298 | { 299 | dFloat* m_data; 300 | int* m_indexList; 301 | int m_strideInBytes; 302 | } 303 | 304 | struct NewtonMeshVertexFormat 305 | { 306 | int m_faceCount; 307 | int* m_faceIndexCount; 308 | int* m_faceMaterial; 309 | NewtonMeshDoubleData m_vertex; 310 | NewtonMeshFloatData m_normal; 311 | NewtonMeshFloatData m_binormal; 312 | NewtonMeshFloatData m_uv0; 313 | NewtonMeshFloatData m_uv1; 314 | NewtonMeshFloatData m_vertexColor; 315 | } 316 | 317 | // Newton callback functions 318 | alias NewtonAllocMemory = void* function (int sizeInBytes); 319 | alias NewtonFreeMemory = void function (void* ptr, int sizeInBytes); 320 | 321 | alias NewtonWorldDestructorCallback = void function (const NewtonWorld* world); 322 | alias NewtonPostUpdateCallback = void function (const NewtonWorld* world, dFloat timestep); 323 | 324 | alias NewtonCreateContactCallback = void function(const NewtonWorld* newtonWorld, NewtonJoint* contact); 325 | alias NewtonDestroyContactCallback = void function(const NewtonWorld* newtonWorld, NewtonJoint* contact); 326 | 327 | alias NewtonWorldListenerDebugCallback = void function (const NewtonWorld* world, void* listener, void* debugContext); 328 | alias NewtonWorldListenerBodyDestroyCallback = void function (const NewtonWorld* world, void* listenerUserData, NewtonBody* body_); 329 | alias NewtonWorldUpdateListenerCallback = void function (const NewtonWorld* world, void* listenerUserData, dFloat timestep); 330 | alias NewtonWorldDestroyListenerCallback = void function (const NewtonWorld* world, void* listenerUserData); 331 | 332 | alias NewtonGetTimeInMicrosencondsCallback = dLong function (); 333 | 334 | alias NewtonSerializeCallback = void function (void* serializeHandle, const void* buffer, int size); 335 | alias NewtonDeserializeCallback = void function (void* serializeHandle, void* buffer, int size); 336 | 337 | alias NewtonOnBodySerializationCallback = void function (NewtonBody* body_, void* userData, NewtonSerializeCallback function_, void* serializeHandle); 338 | alias NewtonOnBodyDeserializationCallback = void function (NewtonBody* body_, void* userData, NewtonDeserializeCallback function_, void* serializeHandle); 339 | 340 | alias NewtonOnJointSerializationCallback = void function (const NewtonJoint* joint, NewtonSerializeCallback function_, void* serializeHandle); 341 | alias NewtonOnJointDeserializationCallback = void function (NewtonBody* body0, NewtonBody* body1, NewtonDeserializeCallback function_, void* serializeHandle); 342 | 343 | alias NewtonOnUserCollisionSerializationCallback = void function (void* userData, NewtonSerializeCallback function_, void* serializeHandle); 344 | 345 | // user collision callbacks 346 | alias NewtonUserMeshCollisionDestroyCallback = void function (void* userData); 347 | alias NewtonUserMeshCollisionRayHitCallback = dFloat function (NewtonUserMeshCollisionRayHitDesc* lineDescData); 348 | alias NewtonUserMeshCollisionGetCollisionInfo = void function (void* userData, NewtonCollisionInfoRecord* infoRecord); 349 | alias NewtonUserMeshCollisionAABBTest = int function (void* userData, const dFloat* boxP0, const dFloat* boxP1); 350 | alias NewtonUserMeshCollisionGetFacesInAABB = int function ( 351 | void* userData, 352 | const dFloat* p0, 353 | const dFloat* p1, 354 | const dFloat** vertexArray, 355 | int* vertexCount, 356 | int* vertexStrideInBytes, 357 | const int* indexList, 358 | int maxIndexCount, 359 | const int* userDataList); 360 | alias NewtonUserMeshCollisionCollideCallback = void function (NewtonUserMeshCollisionCollideDesc* collideDescData, const void* continueCollisionHandle); 361 | 362 | alias NewtonTreeCollisionFaceCallback = int function (void* context, const dFloat* polygon, int strideInBytes, const int* indexArray, int indexCount); 363 | 364 | alias NewtonCollisionTreeRayCastCallback = dFloat function (const NewtonBody* body_, const NewtonCollision* treeCollision, dFloat intersection, dFloat* normal, int faceId, void* usedData); 365 | alias NewtonHeightFieldRayCastCallback = dFloat function (const NewtonBody* body_, const NewtonCollision* heightFieldCollision, dFloat intersection, int row, int col, dFloat* normal, int faceId, void* usedData); 366 | 367 | alias NewtonCollisionCopyConstructionCallback = void function (const NewtonWorld* newtonWorld, NewtonCollision* collision, const NewtonCollision* sourceCollision); 368 | alias NewtonCollisionDestructorCallback = void function (const NewtonWorld* newtonWorld, const NewtonCollision* collision); 369 | 370 | // collision tree call back (obsoleted no recommended) 371 | alias NewtonTreeCollisionCallback = void function ( 372 | const NewtonBody* bodyWithTreeCollision, 373 | const NewtonBody* body_, 374 | int faceID, 375 | int vertexCount, 376 | const dFloat* vertex, 377 | int vertexStrideInBytes); 378 | 379 | alias NewtonBodyDestructor = void function (const NewtonBody* body_); 380 | alias NewtonApplyForceAndTorque = void function (const NewtonBody* body_, dFloat timestep, int threadIndex); 381 | alias NewtonSetTransform = void function (const NewtonBody* body_, const dFloat* matrix, int threadIndex); 382 | 383 | alias NewtonIslandUpdate = int function (const NewtonWorld* newtonWorld, const(void)* islandHandle, int bodyCount); 384 | 385 | alias NewtonFractureCompoundCollisionOnEmitCompoundFractured = void function (NewtonBody* fracturedBody); 386 | alias NewtonFractureCompoundCollisionOnEmitChunk = void function (NewtonBody* chunkBody, NewtonFracturedCompoundMeshPart* fracturexChunkMesh, const NewtonCollision* fracturedCompountCollision); 387 | alias NewtonFractureCompoundCollisionReconstructMainMeshCallBack = void function (NewtonBody* body_, NewtonFracturedCompoundMeshPart* mainMesh, const NewtonCollision* fracturedCompountCollision); 388 | 389 | alias NewtonWorldRayPrefilterCallback = uint function (const NewtonBody* body_, const NewtonCollision* collision, void* userData); 390 | alias NewtonWorldRayFilterCallback = dFloat function (const NewtonBody* body_, const NewtonCollision* shapeHit, const dFloat* hitContact, const dFloat* hitNormal, long collisionID, void* userData, dFloat intersectParam); 391 | 392 | alias NewtonOnAABBOverlap = int function (const NewtonJoint* contact, dFloat timestep, int threadIndex); 393 | alias NewtonContactsProcess = void function (const NewtonJoint* contact, dFloat timestep, int threadIndex); 394 | alias NewtonOnCompoundSubCollisionAABBOverlap = int function (const NewtonJoint* contact, dFloat timestep, const NewtonBody* body0, const void* collisionNode0, const NewtonBody* body1, const void* collisionNode1, int threadIndex); 395 | alias NewtonOnContactGeneration = int function (const NewtonMaterial* material, const NewtonBody* body0, const NewtonCollision* collision0, const NewtonBody* body1, const NewtonCollision* collision1, NewtonUserContactPoint* contactBuffer, int maxCount, int threadIndex); 396 | 397 | alias NewtonBodyIterator = int function (const NewtonBody* body_, void* userData); 398 | alias NewtonJointIterator = void function (const NewtonJoint* joint, void* userData); 399 | alias NewtonCollisionIterator = void function (void* userData, int vertexCount, const dFloat* faceArray, int faceId); 400 | 401 | alias NewtonBallCallback = void function (const NewtonJoint* ball, dFloat timestep); 402 | alias NewtonHingeCallback = uint function (const NewtonJoint* hinge, NewtonHingeSliderUpdateDesc* desc); 403 | alias NewtonSliderCallback = uint function (const NewtonJoint* slider, NewtonHingeSliderUpdateDesc* desc); 404 | alias NewtonUniversalCallback = uint function (const NewtonJoint* universal, NewtonHingeSliderUpdateDesc* desc); 405 | alias NewtonCorkscrewCallback = uint function (const NewtonJoint* corkscrew, NewtonHingeSliderUpdateDesc* desc); 406 | 407 | alias NewtonUserBilateralCallback = void function (const NewtonJoint* userJoint, dFloat timestep, int threadIndex); 408 | alias NewtonUserBilateralGetInfoCallback = void function (const NewtonJoint* userJoint, NewtonJointRecord* info); 409 | 410 | alias NewtonConstraintDestructor = void function (const NewtonJoint* me); 411 | 412 | alias NewtonJobTask = void function (NewtonWorld* world, void* userData, int threadIndex); 413 | alias NewtonReportProgress = int function (dFloat normalizedProgressPercent, void* userData); 414 | --------------------------------------------------------------------------------