diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..43830a7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +# Static libraries +*.a +*.lib + +# Executables +*.exe + +# DUB +.dub +docs.json +dub.selections.json +__dummy.html +__test__library__ +tests +docs/ + +# Code coverage +*.lst + +# Backup files +*~ + +# Editor files +.vs + diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..4939ae5 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,26 @@ +Copyright (c) 2019 Timur Gafarov + +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + diff --git a/README.md b/README.md index 05bc9c1..2f5a710 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ # bindbc-newton -Dynamic binding to Newton Dynamics +BindBC binding to [Newton Dynamics](https://github.com/MADEAPPS/newton-dynamics) 3.14. diff --git a/dub.json b/dub.json new file mode 100644 index 0000000..387abe3 --- /dev/null +++ b/dub.json @@ -0,0 +1,31 @@ +{ + "name": "bindbc-newton", + "description": "Dynamic binding to Newton Dynamics", + "homepage": "https://github.com/gecko0307/bindbc-newton", + "license": "Boost", + "authors": [ + "Timur Gafarov" + ], + + "dependencies": { + "bindbc-loader": "~>0.2.1" + }, + + "importPaths": ["src"], + "sourcePaths": ["src"], + + "buildRequirements":[ + "allowWarnings" + ], + + "configurations": [ + { + "name": "library", + "targetType": "library" + } + ], + + "copyFiles-windows-x86" : ["lib/x86/*.dll", "plugins/x86/*.dll"], + "copyFiles-windows-x86_64" : ["lib/x64/*.dll", "plugins/x64/*.dll"] +} + diff --git a/lib/x64/newton.dll b/lib/x64/newton.dll new file mode 100644 index 0000000..2b13d34 Binary files /dev/null and b/lib/x64/newton.dll differ diff --git a/lib/x86/newton.dll b/lib/x86/newton.dll new file mode 100644 index 0000000..cff85c2 Binary files /dev/null and b/lib/x86/newton.dll differ diff --git a/plugins/x64/dgNewtonAvx.dll b/plugins/x64/dgNewtonAvx.dll new file mode 100644 index 0000000..fc5931c Binary files /dev/null and b/plugins/x64/dgNewtonAvx.dll differ diff --git a/plugins/x64/dgNewtonAvx2.dll b/plugins/x64/dgNewtonAvx2.dll new file mode 100644 index 0000000..5add77f Binary files /dev/null and b/plugins/x64/dgNewtonAvx2.dll differ diff --git a/plugins/x64/dgNewtonSse4.2.dll b/plugins/x64/dgNewtonSse4.2.dll new file mode 100644 index 0000000..7227441 Binary files /dev/null and b/plugins/x64/dgNewtonSse4.2.dll differ diff --git a/plugins/x86/dgNewtonAvx.dll b/plugins/x86/dgNewtonAvx.dll new file mode 100644 index 0000000..8a31573 Binary files /dev/null and b/plugins/x86/dgNewtonAvx.dll differ diff --git a/plugins/x86/dgNewtonAvx2.dll b/plugins/x86/dgNewtonAvx2.dll new file mode 100644 index 0000000..8d700bc Binary files /dev/null and b/plugins/x86/dgNewtonAvx2.dll differ diff --git a/plugins/x86/dgNewtonSse4.2.dll b/plugins/x86/dgNewtonSse4.2.dll new file mode 100644 index 0000000..8251adf Binary files /dev/null and b/plugins/x86/dgNewtonSse4.2.dll differ diff --git a/src/bindbc/newton/binddynamic.d b/src/bindbc/newton/binddynamic.d new file mode 100644 index 0000000..5d0e130 --- /dev/null +++ b/src/bindbc/newton/binddynamic.d @@ -0,0 +1,1779 @@ +/* +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +*/ + +module bindbc.newton.binddynamic; + +version(BindNewton_Static) {} +else version = BindNewton_Dynamic; + +version(BindNewton_Dynamic): + +import bindbc.loader; +import bindbc.newton.types; + +extern(C) @nogc nothrow +{ + // World + alias da_NewtonWorldGetVersion = int function(); + alias da_NewtonWorldFloatSize = int function(); + alias da_NewtonGetMemoryUsed = int function(); + alias da_NewtonSetMemorySystem = void function(NewtonAllocMemory malloc, NewtonFreeMemory free); + alias da_NewtonCreate = NewtonWorld* function(); + alias da_NewtonDestroy = void function(const NewtonWorld* newtonWorld); + alias da_NewtonDestroyAllBodies = void function(const NewtonWorld* newtonWorld); + //alias da_NewtonSetPosUpdateCallback = void function(const NewtonWorld* newtonWorld, NewtonPostUpdateCallback callback); + alias da_NewtonAlloc = void* function(int sizeInBytes); + alias da_NewtonFree = void function(void* ptr); + alias da_NewtonLoadPlugins = void function(const NewtonWorld* newtonWorld, const char* plugInPath); + alias da_NewtonUnloadPlugins = void function(const NewtonWorld* newtonWorld); + alias da_NewtonCurrentPlugin = void* function(const NewtonWorld* newtonWorld); + alias da_NewtonGetFirstPlugin = void* function(const NewtonWorld* newtonWorld); + alias da_NewtonGetPreferedPlugin = void* function(const NewtonWorld* newtonWorld); + alias da_NewtonGetNextPlugin = void* function(const NewtonWorld* newtonWorld, const void* plugin); + alias da_NewtonGetPluginString = const(char)* function(const NewtonWorld* newtonWorld, const void* plugin); + alias da_NewtonSelectPlugin = void function(const NewtonWorld* newtonWorld, const void* plugin); + alias da_NewtonGetContactMergeTolerance = dFloat function(const NewtonWorld* newtonWorld); + alias da_NewtonSetContactMergeTolerance = void function(const NewtonWorld* newtonWorld, dFloat tolerance); + alias da_NewtonInvalidateCache = void function(const NewtonWorld* newtonWorld); + alias da_NewtonSetSolverIterations = void function(const NewtonWorld* newtonWorld, int model); + alias da_NewtonGetSolverIterations = int function(const NewtonWorld* newtonWorld); + //alias da_NewtonSetMultiThreadSolverOnSingleIsland = void function(const NewtonWorld* newtonWorld, int mode); + //alias da_NewtonGetMultiThreadSolverOnSingleIsland = int function(const NewtonWorld* newtonWorld); + alias da_NewtonGetBroadphaseAlgorithm = int function(const NewtonWorld* newtonWorld); + alias da_NewtonSelectBroadphaseAlgorithm = void function(const NewtonWorld* newtonWorld, int algorithmType); + alias da_NewtonResetBroadphase = void function(const NewtonWorld* newtonWorld); + alias da_NewtonUpdate = void function(const NewtonWorld* newtonWorld, dFloat timestep); + alias da_NewtonUpdateAsync = void function(const NewtonWorld* newtonWorld, dFloat timestep); + alias da_NewtonWaitForUpdateToFinish = void function(const NewtonWorld* newtonWorld); + alias da_NewtonGetNumberOfSubsteps = int function(const NewtonWorld* newtonWorld); + alias da_NewtonSetNumberOfSubsteps = void function(const NewtonWorld* newtonWorld, int subSteps); + alias da_NewtonGetLastUpdateTime = dFloat function(const NewtonWorld* newtonWorld); + alias da_NewtonSerializeToFile = void function(const NewtonWorld* newtonWorld, const char* filename, NewtonOnBodySerializationCallback bodyCallback, const char* bodyUserData); + alias da_NewtonDeserializeFromFile = void function(const NewtonWorld* newtonWorld, const char* filename, NewtonOnBodyDeserializationCallback bodyCallback, void* bodyUserData); + alias da_NewtonSerializeScene = void function(const NewtonWorld* newtonWorld, NewtonOnBodySerializationCallback bodyCallback, void* bodyUserData, NewtonSerializeCallback serializeCallback, void* serializeHandle); + alias da_NewtonDeserializeScene = void function(const NewtonWorld* newtonWorld, NewtonOnBodyDeserializationCallback bodyCallback, void* bodyUserData, NewtonDeserializeCallback serializeCallback, void* serializeHandle); + alias da_NewtonFindSerializedBody = NewtonBody* function(const NewtonWorld* newtonWorld, int bodySerializedID); + alias da_NewtonSetJointSerializationCallbacks = void function(const NewtonWorld* newtonWorld, NewtonOnJointSerializationCallback serializeJoint, NewtonOnJointDeserializationCallback deserializeJoint); + alias da_NewtonGetJointSerializationCallbacks = void function(const NewtonWorld* newtonWorld, NewtonOnJointSerializationCallback* serializeJoint, NewtonOnJointDeserializationCallback* deserializeJoint); + + // Multithreading + alias da_NewtonWorldCriticalSectionLock = void function(const NewtonWorld* newtonWorld, int threadIndex); + alias da_NewtonWorldCriticalSectionUnlock = void function(const NewtonWorld* newtonWorld); + alias da_NewtonSetThreadsCount = void function(const NewtonWorld* newtonWorld, int threads); + alias da_NewtonGetThreadsCount = int function(const NewtonWorld* newtonWorld); + alias da_NewtonGetMaxThreadsCount = int function(const NewtonWorld* newtonWorld); + alias da_NewtonDispachThreadJob = void function(const NewtonWorld* newtonWorld, NewtonJobTask task, const void* usedData, const char* functionName); + alias da_NewtonSyncThreadJobs = void function(const NewtonWorld* newtonWorld); + alias da_NewtonAtomicAdd = int function(const int* ptr, int value); + alias da_NewtonAtomicSwap = int function(const int* ptr, int value); + alias da_NewtonYield = void function(); + + alias da_NewtonSetIslandUpdateEvent = void function(const NewtonWorld* newtonWorld, NewtonIslandUpdate islandUpdate); + alias da_NewtonWorldForEachJointDo = void function(const NewtonWorld* newtonWorld, NewtonJointIterator callback, void* userData); + alias da_NewtonWorldForEachBodyInAABBDo = void function(const NewtonWorld* newtonWorld, const dFloat* p0, const dFloat* p1, NewtonBodyIterator callback, void* userData); + alias da_NewtonWorldGetUserData = void* function(const NewtonWorld* newtonWorld); + alias da_NewtonWorldAddListener = void* function(const NewtonWorld* newtonWorld, const char* nameId, void* listenerUserData); + alias da_NewtonWorldGetListener = void* function(const NewtonWorld* newtonWorld, const char* nameId); + alias da_NewtonWorldListenerSetDestructorCallback = void function(const NewtonWorld* newtonWorld, void* listener, NewtonWorldDestroyListenerCallback destroy); + alias da_NewtonWorldListenerSetPreUpdateCallback = void function(const NewtonWorld* newtonWorld, void* listener, NewtonWorldUpdateListenerCallback update); + alias da_NewtonWorldListenerSetPostUpdateCallback = void function(const NewtonWorld* newtonWorld, void* listener, NewtonWorldUpdateListenerCallback update); + alias da_NewtonWorldListenerSetDebugCallback = void function(const NewtonWorld* newtonWorld, void* listener, NewtonWorldListenerDebugCallback debugCallback); + alias da_NewtonWorldListenerSetBodyDestroyCallback = void function(const NewtonWorld* newtonWorld, void* listener, NewtonWorldListenerBodyDestroyCallback bodyDestroyCallback); + alias da_NewtonWorldListenerDebug = void function(const NewtonWorld* newtonWorld, void* context); + alias da_NewtonWorldGetListenerUserData = void* function(const NewtonWorld* newtonWorld, void* listener); + alias da_NewtonWorldListenerGetBodyDestroyCallback = NewtonWorldListenerBodyDestroyCallback function(const NewtonWorld* newtonWorld, void* listener); + alias da_NewtonWorldSetDestructorCallback = void function(const NewtonWorld* newtonWorld, NewtonWorldDestructorCallback destructor); + alias da_NewtonWorldGetDestructorCallback = NewtonWorldDestructorCallback function(const NewtonWorld* newtonWorld); + alias da_NewtonWorldSetCollisionConstructorDestructorCallback = void function(const NewtonWorld* newtonWorld, NewtonCollisionCopyConstructionCallback constructor, NewtonCollisionDestructorCallback destructor); + alias da_NewtonWorldRayCast = void function(const NewtonWorld* newtonWorld, const dFloat* p0, const dFloat* p1, NewtonWorldRayFilterCallback filter, void* userData, NewtonWorldRayPrefilterCallback prefilter, int threadIndex); + 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); + alias da_NewtonWorldCollide = int function(const NewtonWorld* newtonWorld, const dFloat* matrix, const NewtonCollision* shape, void* userData, NewtonWorldRayPrefilterCallback prefilter, NewtonWorldConvexCastReturnInfo* info, int maxContactsCount, int threadIndex); + + // world utility functions + alias da_NewtonWorldGetBodyCount = int function(const NewtonWorld* newtonWorld); + alias da_NewtonWorldGetConstraintCount = int function(const NewtonWorld* newtonWorld); + + // Island + alias da_NewtonIslandGetBody = NewtonBody* function(const void* island, int bodyIndex); + alias da_NewtonIslandGetBodyAABB = void function(const void* island, int bodyIndex, dFloat* p0, dFloat* p1); + + // Material + alias da_NewtonMaterialCreateGroupID = int function(const NewtonWorld* newtonWorld); + alias da_NewtonMaterialGetDefaultGroupID = int function(const NewtonWorld* newtonWorld); + alias da_NewtonMaterialDestroyAllGroupID = void function(const NewtonWorld* newtonWorld); + alias da_NewtonMaterialGetUserData = void* function(const NewtonWorld* newtonWorld, int id0, int id1); + alias da_NewtonMaterialSetSurfaceThickness = void function(const NewtonWorld* newtonWorld, int id0, int id1, dFloat thickness); + alias da_NewtonMaterialSetCallbackUserData = void function(const NewtonWorld* newtonWorld, int id0, int id1, void* userData); + alias da_NewtonMaterialSetContactGenerationCallback = void function(const NewtonWorld* newtonWorld, int id0, int id1, NewtonOnContactGeneration contactGeneration); + alias da_NewtonMaterialSetCompoundCollisionCallback = void function(const NewtonWorld* newtonWorld, int id0, int id1, NewtonOnCompoundSubCollisionAABBOverlap compoundAabbOverlap); + alias da_NewtonMaterialSetCollisionCallback = void function(const NewtonWorld* newtonWorld, int id0, int id1, NewtonOnAABBOverlap aabbOverlap, NewtonContactsProcess process); + alias da_NewtonMaterialSetDefaultSoftness = void function(const NewtonWorld* newtonWorld, int id0, int id1, dFloat value); + alias da_NewtonMaterialSetDefaultElasticity = void function(const NewtonWorld* newtonWorld, int id0, int id1, dFloat elasticCoef); + alias da_NewtonMaterialSetDefaultCollidable = void function(const NewtonWorld* newtonWorld, int id0, int id1, int state); + alias da_NewtonMaterialSetDefaultFriction = void function(const NewtonWorld* newtonWorld, int id0, int id1, dFloat staticFriction, dFloat kineticFriction); + alias da_NewtonWorldGetFirstMaterial = NewtonMaterial* function(const NewtonWorld* newtonWorld); + alias da_NewtonWorldGetNextMaterial = NewtonMaterial* function(const NewtonWorld* newtonWorld, const NewtonMaterial* material); + alias da_NewtonWorldGetFirstBody = NewtonBody* function(const NewtonWorld* newtonWorld); + alias da_NewtonWorldGetNextBody = NewtonBody* function(const NewtonWorld* newtonWorld, const NewtonBody* curBody); + + // Physics Contact control + alias da_NewtonMaterialGetMaterialPairUserData = void* function(const NewtonMaterial* material); + alias da_NewtonMaterialGetContactFaceAttribute = uint function(const NewtonMaterial* material); + alias da_NewtonMaterialGetBodyCollidingShape = NewtonCollision* function(const NewtonMaterial* material, const NewtonBody* body_); + alias da_NewtonMaterialGetContactNormalSpeed = dFloat function(const NewtonMaterial* material); + alias da_NewtonMaterialGetContactForce = void function(const NewtonMaterial* material, const NewtonBody* body_, dFloat* force); + alias da_NewtonMaterialGetContactPositionAndNormal = void function(const NewtonMaterial* material, const NewtonBody* body_, dFloat* posit, dFloat* normal); + alias da_NewtonMaterialGetContactTangentDirections = void function(const NewtonMaterial* material, const NewtonBody* body_, dFloat* dir0, dFloat* dir1); + alias da_NewtonMaterialGetContactTangentSpeed = dFloat function(const NewtonMaterial* material, int index); + alias da_NewtonMaterialGetContactMaxNormalImpact = dFloat function(const NewtonMaterial* material); + alias da_NewtonMaterialGetContactMaxTangentImpact = dFloat function(const NewtonMaterial* material, int index); + alias da_NewtonMaterialGetContactPenetration = dFloat function(const NewtonMaterial* material); + alias da_NewtonMaterialSetContactSoftness = void function(const NewtonMaterial* material, dFloat softness); + alias da_NewtonMaterialSetContactThickness = void function(const NewtonMaterial* material, dFloat thickness); + alias da_NewtonMaterialSetContactElasticity = void function(const NewtonMaterial* material, dFloat restitution); + alias da_NewtonMaterialSetContactFrictionState = void function(const NewtonMaterial* material, int state, int index); + alias da_NewtonMaterialSetContactFrictionCoef = void function(const NewtonMaterial* material, dFloat staticFrictionCoef, dFloat kineticFrictionCoef, int index); + alias da_NewtonMaterialSetContactNormalAcceleration = void function(const NewtonMaterial* material, dFloat accel); + alias da_NewtonMaterialSetContactNormalDirection = void function(const NewtonMaterial* material, const dFloat* directionVector); + alias da_NewtonMaterialSetContactPosition = void function(const NewtonMaterial* material, const dFloat* position); + alias da_NewtonMaterialSetContactTangentFriction = void function(const NewtonMaterial* material, dFloat friction, int index); + alias da_NewtonMaterialSetContactTangentAcceleration = void function(const NewtonMaterial* material, dFloat accel, int index); + alias da_NewtonMaterialContactRotateTangentDirections = void function(const NewtonMaterial* material, const dFloat* directionVector); + alias da_NewtonMaterialGetContactPruningTolerance = dFloat function(const NewtonBody* body0, const NewtonBody* body1); + alias da_NewtonMaterialSetContactPruningTolerance = void function(const NewtonBody* body0, const NewtonBody* body1, dFloat tolerance); + + // Convex collision primitives creation + alias da_NewtonCreateNull = NewtonCollision* function(const NewtonWorld* newtonWorld); + alias da_NewtonCreateSphere = NewtonCollision* function(const NewtonWorld* newtonWorld, dFloat radius, int shapeID, const dFloat* offsetMatrix); + alias da_NewtonCreateBox = NewtonCollision* function(const NewtonWorld* newtonWorld, dFloat dx, dFloat dy, dFloat dz, int shapeID, const dFloat* offsetMatrix); + alias da_NewtonCreateCone = NewtonCollision* function(const NewtonWorld* newtonWorld, dFloat radius, dFloat height, int shapeID, const dFloat* offsetMatrix); + alias da_NewtonCreateCapsule = NewtonCollision* function(const NewtonWorld* newtonWorld, dFloat radius0, dFloat radius1, dFloat height, int shapeID, const dFloat* offsetMatrix); + alias da_NewtonCreateCylinder = NewtonCollision* function(const NewtonWorld* newtonWorld, dFloat radio0, dFloat radio1, dFloat height, int shapeID, const dFloat* offsetMatrix); + alias da_NewtonCreateChamferCylinder = NewtonCollision* function(const NewtonWorld* newtonWorld, dFloat radius, dFloat height, int shapeID, const dFloat* offsetMatrix); + alias da_NewtonCreateConvexHull = NewtonCollision* function(const NewtonWorld* newtonWorld, int count, const dFloat* vertexCloud, int strideInBytes, dFloat tolerance, int shapeID, const dFloat* offsetMatrix); + alias da_NewtonCreateConvexHullFromMesh = NewtonCollision* function(const NewtonWorld* newtonWorld, const NewtonMesh* mesh, dFloat tolerance, int shapeID); + alias da_NewtonCollisionGetMode = int function(const NewtonCollision* convexCollision); + alias da_NewtonCollisionSetMode = void function(const NewtonCollision* convexCollision, int mode); + alias da_NewtonConvexHullGetFaceIndices = int function(const NewtonCollision* convexHullCollision, int face, int* faceIndices); + alias da_NewtonConvexHullGetVertexData = int function(const NewtonCollision* convexHullCollision, dFloat** vertexData, int* strideInBytes); + alias da_NewtonConvexCollisionCalculateVolume = dFloat function(const NewtonCollision* convexCollision); + alias da_NewtonConvexCollisionCalculateInertialMatrix = void function(const(NewtonCollision)* convexCollision, dFloat* inertia, dFloat* origin); + alias da_NewtonConvexCollisionCalculateBuoyancyAcceleration = void function(const NewtonCollision* convexCollision, const dFloat* matrix, const dFloat* shapeOrigin, const dFloat* gravityVector, const dFloat* fluidPlane, dFloat fluidDensity, dFloat fluidViscosity, dFloat* accel, dFloat* alpha); + alias da_NewtonCollisionDataPointer = const(void)* function(const NewtonCollision* convexCollision); + + // Compound collision primitives creation + alias da_NewtonCreateCompoundCollision = NewtonCollision* function(const NewtonWorld* newtonWorld, int shapeID); + alias da_NewtonCreateCompoundCollisionFromMesh = NewtonCollision* function(const NewtonWorld* newtonWorld, const NewtonMesh* mesh, dFloat hullTolerance, int shapeID, int subShapeID); + alias da_NewtonCompoundCollisionBeginAddRemove = void function(NewtonCollision* compoundCollision); + alias da_NewtonCompoundCollisionAddSubCollision = void* function(NewtonCollision* compoundCollision, const NewtonCollision* convexCollision); + alias da_NewtonCompoundCollisionRemoveSubCollision = void function(NewtonCollision* compoundCollision, const void* collisionNode); + alias da_NewtonCompoundCollisionRemoveSubCollisionByIndex = void function(NewtonCollision* compoundCollision, int nodeIndex); + alias da_NewtonCompoundCollisionSetSubCollisionMatrix = void function(NewtonCollision* compoundCollision, const void* collisionNode, const dFloat* matrix); + alias da_NewtonCompoundCollisionEndAddRemove = void function(NewtonCollision* compoundCollision); + alias da_NewtonCompoundCollisionGetFirstNode = void* function(NewtonCollision* compoundCollision); + alias da_NewtonCompoundCollisionGetNextNode = void* function(NewtonCollision* compoundCollision, const void* collisionNode); + alias da_NewtonCompoundCollisionGetNodeByIndex = void* function(NewtonCollision* compoundCollision, int index); + alias da_NewtonCompoundCollisionGetNodeIndex = int function(NewtonCollision* compoundCollision, const void* collisionNode); + alias da_NewtonCompoundCollisionGetCollisionFromNode = NewtonCollision* function(NewtonCollision* compoundCollision, const void* collisionNode); + + // Fractured compound collision primitives interface + 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); + alias da_NewtonFracturedCompoundPlaneClip = NewtonCollision* function(const NewtonCollision* fracturedCompound, const dFloat* plane); + alias da_NewtonFracturedCompoundSetCallbacks = void function(const NewtonCollision* fracturedCompound, NewtonFractureCompoundCollisionReconstructMainMeshCallBack regenerateMainMeshCallback, NewtonFractureCompoundCollisionOnEmitCompoundFractured emitFracturedCompound, NewtonFractureCompoundCollisionOnEmitChunk emitFracfuredChunk); + alias da_NewtonFracturedCompoundIsNodeFreeToDetach = int function(const NewtonCollision* fracturedCompound, void* collisionNode); + alias da_NewtonFracturedCompoundNeighborNodeList = int function(const NewtonCollision* fracturedCompound, void* collisionNode, void** list, int maxCount); + alias da_NewtonFracturedCompoundGetMainMesh = NewtonFracturedCompoundMeshPart* function(const NewtonCollision* fracturedCompound); + alias da_NewtonFracturedCompoundGetFirstSubMesh = NewtonFracturedCompoundMeshPart* function(const NewtonCollision* fracturedCompound); + alias da_NewtonFracturedCompoundGetNextSubMesh = NewtonFracturedCompoundMeshPart* function(const NewtonCollision* fracturedCompound, NewtonFracturedCompoundMeshPart* subMesh); + alias da_NewtonFracturedCompoundCollisionGetVertexCount = int function(const NewtonCollision* fracturedCompound, const NewtonFracturedCompoundMeshPart* meshOwner); + alias da_NewtonFracturedCompoundCollisionGetVertexPositions = const(dFloat)* function(const NewtonCollision* fracturedCompound, const NewtonFracturedCompoundMeshPart* meshOwner); + alias da_NewtonFracturedCompoundCollisionGetVertexNormals = const(dFloat)* function(const NewtonCollision* fracturedCompound, const NewtonFracturedCompoundMeshPart* meshOwner); + alias da_NewtonFracturedCompoundCollisionGetVertexUVs = const(dFloat)* function(const NewtonCollision* fracturedCompound, const NewtonFracturedCompoundMeshPart* meshOwner); + alias da_NewtonFracturedCompoundMeshPartGetIndexStream = int function(const NewtonCollision* fracturedCompound, const NewtonFracturedCompoundMeshPart* meshOwner, const void* segment, int* index); + alias da_NewtonFracturedCompoundMeshPartGetFirstSegment = void* function(const NewtonFracturedCompoundMeshPart* fractureCompoundMeshPart); + alias da_NewtonFracturedCompoundMeshPartGetNextSegment = void* function(const void* fractureCompoundMeshSegment); + alias da_NewtonFracturedCompoundMeshPartGetMaterial = int function(const void* fractureCompoundMeshSegment); + alias da_NewtonFracturedCompoundMeshPartGetIndexCount = int function(const void* fractureCompoundMeshSegment); + + // scene collision are static compound collision that can take polygonal static collisions + alias da_NewtonCreateSceneCollision = NewtonCollision* function(const NewtonWorld* newtonWorld, int shapeID); + alias da_NewtonSceneCollisionBeginAddRemove = void function(NewtonCollision* sceneCollision); + alias da_NewtonSceneCollisionAddSubCollision = void* function(NewtonCollision* sceneCollision, const NewtonCollision* collision); + alias da_NewtonSceneCollisionRemoveSubCollision = void function(NewtonCollision* compoundCollision, const void* collisionNode); + alias da_NewtonSceneCollisionRemoveSubCollisionByIndex = void function(NewtonCollision* sceneCollision, int nodeIndex); + alias da_NewtonSceneCollisionSetSubCollisionMatrix = void function(NewtonCollision* sceneCollision, const void* collisionNode, const dFloat* matrix); + alias da_NewtonSceneCollisionEndAddRemove = void function(NewtonCollision* sceneCollision); + alias da_NewtonSceneCollisionGetFirstNode = void* function(NewtonCollision* sceneCollision); + alias da_NewtonSceneCollisionGetNextNode = void* function(NewtonCollision* sceneCollision, const void* collisionNode); + alias da_NewtonSceneCollisionGetNodeByIndex = void* function(NewtonCollision* sceneCollision, int index); + alias da_NewtonSceneCollisionGetNodeIndex = int function(NewtonCollision* sceneCollision, const void* collisionNode); + alias da_NewtonSceneCollisionGetCollisionFromNode = NewtonCollision* function(NewtonCollision* sceneCollision, const void* collisionNode); + + // User Static mesh collision interface + 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); + alias da_NewtonUserMeshCollisionContinuousOverlapTest = int function(const NewtonUserMeshCollisionCollideDesc* collideDescData, const void* continueCollisionHandle, const dFloat* minAabb, const dFloat* maxAabb); + + // Collision serialization functions + alias da_NewtonCreateCollisionFromSerialization = NewtonCollision* function(const NewtonWorld* newtonWorld, NewtonDeserializeCallback deserializeFunction, void* serializeHandle); + alias da_NewtonCollisionSerialize = void function(const NewtonWorld* newtonWorld, const NewtonCollision* collision, NewtonSerializeCallback serializeFunction, void* serializeHandle); + alias da_NewtonCollisionGetInfo = void function(const NewtonCollision* collision, NewtonCollisionInfoRecord* collisionInfo); + + // Static collision shapes functions + 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); + alias da_NewtonHeightFieldSetUserRayCastCallback = void function(const NewtonCollision* heightfieldCollision, NewtonHeightFieldRayCastCallback rayHitCallback); + alias da_NewtonHeightFieldSetHorizontalDisplacement = void function(const NewtonCollision* heightfieldCollision, const ushort* horizontalMap, dFloat scale); + alias da_NewtonCreateTreeCollision = NewtonCollision* function(const NewtonWorld* newtonWorld, int shapeID); + alias da_NewtonCreateTreeCollisionFromMesh = NewtonCollision* function(const NewtonWorld* newtonWorld, const NewtonMesh* mesh, int shapeID); + alias da_NewtonTreeCollisionSetUserRayCastCallback = void function(const NewtonCollision* treeCollision, NewtonCollisionTreeRayCastCallback rayHitCallback); + alias da_NewtonTreeCollisionBeginBuild = void function(const NewtonCollision* treeCollision); + alias da_NewtonTreeCollisionAddFace = void function(const NewtonCollision* treeCollision, int vertexCount, const dFloat* vertexPtr, int strideInBytes, int faceAttribute); + alias da_NewtonTreeCollisionEndBuild = void function(const NewtonCollision* treeCollision, int optimize); + alias da_NewtonTreeCollisionGetFaceAttribute = int function(const NewtonCollision* treeCollision, const int* faceIndexArray, int indexCount); + alias da_NewtonTreeCollisionSetFaceAttribute = void function(const NewtonCollision* treeCollision, const int* faceIndexArray, int indexCount, int attribute); + alias da_NewtonTreeCollisionForEachFace = void function(const NewtonCollision* treeCollision, NewtonTreeCollisionFaceCallback forEachFaceCallback, void* context); + 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); + alias da_NewtonStaticCollisionSetDebugCallback = void function(const NewtonCollision* staticCollision, NewtonTreeCollisionCallback userCallback); + + // General purpose collision library functions + alias da_NewtonCollisionCreateInstance = NewtonCollision* function(const NewtonCollision* collision); + alias da_NewtonCollisionGetType = int function(const NewtonCollision* collision); + alias da_NewtonCollisionIsConvexShape = int function(const NewtonCollision* collision); + alias da_NewtonCollisionIsStaticShape = int function(const NewtonCollision* collision); + + // for the end user + alias da_NewtonCollisionSetUserData = void function(const NewtonCollision* collision, void* userData); + alias da_NewtonCollisionGetUserData = void* function(const NewtonCollision* collision); + alias da_NewtonCollisionSetUserID = void function(const NewtonCollision* collision, uint id); + alias da_NewtonCollisionGetUserID = uint function(const NewtonCollision* collision); + alias da_NewtonCollisionGetMaterial = void function(const NewtonCollision* collision, NewtonCollisionMaterial* userData); + alias da_NewtonCollisionSetMaterial = void function(const NewtonCollision* collision, const NewtonCollisionMaterial* userData); + alias da_NewtonCollisionGetSubCollisionHandle = void* function(const NewtonCollision* collision); + alias da_NewtonCollisionGetParentInstance = NewtonCollision* function(const NewtonCollision* collision); + alias da_NewtonCollisionSetMatrix = void function(const NewtonCollision* collision, const dFloat* matrix); + alias da_NewtonCollisionGetMatrix = void function(const NewtonCollision* collision, dFloat* matrix); + alias da_NewtonCollisionSetScale = void function(const NewtonCollision* collision, dFloat scaleX, dFloat scaleY, dFloat scaleZ); + alias da_NewtonCollisionGetScale = void function(const NewtonCollision* collision, dFloat* scaleX, dFloat* scaleY, dFloat* scaleZ); + alias da_NewtonDestroyCollision = void function(const NewtonCollision* collision); + alias da_NewtonCollisionGetSkinThickness = float function(const NewtonCollision* collision); + alias da_NewtonCollisionSetSkinThickness = void function(const NewtonCollision* collision, dFloat thickness); + alias da_NewtonCollisionIntersectionTest = int function(const NewtonWorld* newtonWorld, const NewtonCollision* collisionA, const dFloat* matrixA, const NewtonCollision* collisionB, const dFloat* matrixB, int threadIndex); + alias da_NewtonCollisionPointDistance = int function(const NewtonWorld* newtonWorld, const dFloat* point, const NewtonCollision* collision, const dFloat* matrix, dFloat* contact, dFloat* normal, int threadIndex); + 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); + 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); + 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); + alias da_NewtonCollisionSupportVertex = void function(const NewtonCollision* collision, const dFloat* dir, dFloat* vertex); + alias da_NewtonCollisionRayCast = dFloat function(const NewtonCollision* collision, const dFloat* p0, const dFloat* p1, dFloat* normal, long* attribute); + alias da_NewtonCollisionCalculateAABB = void function(const NewtonCollision* collision, const dFloat* matrix, dFloat* p0, dFloat* p1); + alias da_NewtonCollisionForEachPolygonDo = void function(const NewtonCollision* collision, const dFloat* matrix, NewtonCollisionIterator callback, void* userData); + + // collision aggregates + alias da_NewtonCollisionAggregateCreate = void* function(NewtonWorld* world); + alias da_NewtonCollisionAggregateDestroy = void function(void* aggregate); + alias da_NewtonCollisionAggregateAddBody = void function(void* aggregate, const NewtonBody* body_); + alias da_NewtonCollisionAggregateRemoveBody = void function(void* aggregate, const NewtonBody* body_); + alias da_NewtonCollisionAggregateGetSelfCollision = int function(void* aggregate); + alias da_NewtonCollisionAggregateSetSelfCollision = void function(void* aggregate, int state); + + // transforms utility functions + alias da_NewtonSetEulerAngle = void function(const dFloat* eulersAngles, dFloat* matrix); + alias da_NewtonGetEulerAngle = void function(const dFloat* matrix, dFloat* eulersAngles0, dFloat* eulersAngles1); + alias da_NewtonCalculateSpringDamperAcceleration = dFloat function(dFloat dt, dFloat ks, dFloat x, dFloat kd, dFloat s); + + // body manipulation functions + alias da_NewtonCreateDynamicBody = NewtonBody* function(const NewtonWorld* newtonWorld, const NewtonCollision* collision, const dFloat* matrix); + alias da_NewtonCreateKinematicBody = NewtonBody* function(const NewtonWorld* newtonWorld, const NewtonCollision* collision, const dFloat* matrix); + alias da_NewtonDestroyBody = void function(const NewtonBody* body_); + alias da_NewtonBodyGetSimulationState = int function(const NewtonBody* body_); + alias da_NewtonBodySetSimulationState = void function(const NewtonBody* bodyPtr, const int state); + alias da_NewtonBodyGetType = int function(const NewtonBody* body_); + alias da_NewtonBodyGetCollidable = int function(const NewtonBody* body_); + alias da_NewtonBodySetCollidable = void function(const NewtonBody* body_, int collidableState); + alias da_NewtonBodyAddForce = void function(const NewtonBody* body_, const dFloat* force); + alias da_NewtonBodyAddTorque = void function(const NewtonBody* body_, const dFloat* torque); + alias da_NewtonBodyCalculateInverseDynamicsForce = void function(const NewtonBody* body_, dFloat timestep, const dFloat* desiredVeloc, dFloat* forceOut); + alias da_NewtonBodySetCentreOfMass = void function(const NewtonBody* body_, const dFloat* com); + alias da_NewtonBodySetMassMatrix = void function(const NewtonBody* body_, dFloat mass, dFloat Ixx, dFloat Iyy, dFloat Izz); + alias da_NewtonBodySetFullMassMatrix = void function(const NewtonBody* body_, dFloat mass, const dFloat* inertiaMatrix); + alias da_NewtonBodySetMassProperties = void function(const NewtonBody* body_, dFloat mass, const NewtonCollision* collision); + alias da_NewtonBodySetMatrix = void function(const NewtonBody* body_, const dFloat* matrix); + alias da_NewtonBodySetMatrixNoSleep = void function(const NewtonBody* body_, const dFloat* matrix); + alias da_NewtonBodySetMatrixRecursive = void function(const NewtonBody* body_, const dFloat* matrix); + alias da_NewtonBodySetMaterialGroupID = void function(const NewtonBody* body_, int id); + alias da_NewtonBodySetContinuousCollisionMode = void function(const NewtonBody* body_, uint state); + alias da_NewtonBodySetJointRecursiveCollision = void function(const NewtonBody* body_, uint state); + alias da_NewtonBodySetOmega = void function(const NewtonBody* body_, const dFloat* omega); + alias da_NewtonBodySetOmegaNoSleep = void function(const NewtonBody* body_, const dFloat* omega); + alias da_NewtonBodySetVelocity = void function(const NewtonBody* body_, const dFloat* velocity); + alias da_NewtonBodySetVelocityNoSleep = void function(const NewtonBody* body_, const dFloat* velocity); + alias da_NewtonBodySetForce = void function(const NewtonBody* body_, const dFloat* force); + alias da_NewtonBodySetTorque = void function(const NewtonBody* body_, const dFloat* torque); + alias da_NewtonBodySetLinearDamping = void function(const NewtonBody* body_, dFloat linearDamp); + alias da_NewtonBodySetAngularDamping = void function(const NewtonBody* body_, const dFloat* angularDamp); + alias da_NewtonBodySetCollision = void function(const NewtonBody* body_, const NewtonCollision* collision); + alias da_NewtonBodySetCollisionScale = void function(const NewtonBody* body_, dFloat scaleX, dFloat scaleY, dFloat scaleZ); + alias da_NewtonBodyGetSleepState = int function(const NewtonBody* body_); + alias da_NewtonBodySetSleepState = void function(const NewtonBody* body_, int state); + alias da_NewtonBodyGetAutoSleep = int function(const NewtonBody* body_); + alias da_NewtonBodySetAutoSleep = void function(const NewtonBody* body_, int state); + alias da_NewtonBodyGetFreezeState = int function(const NewtonBody* body_); + alias da_NewtonBodySetFreezeState = void function(const NewtonBody* body_, int state); + //alias da_NewtonBodyGetGyroscopicTorque = int function(const NewtonBody* body_); + //alias da_NewtonBodySetGyroscopicTorque = void function(const NewtonBody* body_, int state); + alias da_NewtonBodySetDestructorCallback = void function(const NewtonBody* body_, NewtonBodyDestructor callback); + alias da_NewtonBodyGetDestructorCallback = NewtonBodyDestructor function(const NewtonBody* body_); + alias da_NewtonBodySetTransformCallback = void function(const NewtonBody* body_, NewtonSetTransform callback); + alias da_NewtonBodyGetTransformCallback = NewtonSetTransform function(const NewtonBody* body_); + alias da_NewtonBodySetForceAndTorqueCallback = void function(const NewtonBody* body_, NewtonApplyForceAndTorque callback); + alias da_NewtonBodyGetForceAndTorqueCallback = NewtonApplyForceAndTorque function(const NewtonBody* body_); + alias da_NewtonBodyGetID = int function(const NewtonBody* body_); + alias da_NewtonBodySetUserData = void function(const NewtonBody* body_, void* userData); + alias da_NewtonBodyGetUserData = void* function(const NewtonBody* body_); + alias da_NewtonBodyGetWorld = NewtonWorld* function(const NewtonBody* body_); + alias da_NewtonBodyGetCollision = NewtonCollision* function(const NewtonBody* body_); + alias da_NewtonBodyGetMaterialGroupID = int function(const NewtonBody* body_); + alias da_NewtonBodyGetSerializedID = int function(const NewtonBody* body_); + alias da_NewtonBodyGetContinuousCollisionMode = int function(const NewtonBody* body_); + alias da_NewtonBodyGetJointRecursiveCollision = int function(const NewtonBody* body_); + alias da_NewtonBodyGetPosition = void function(const NewtonBody* body_, dFloat* pos); + alias da_NewtonBodyGetMatrix = void function(const NewtonBody* body_, dFloat* matrix); + alias da_NewtonBodyGetRotation = void function(const NewtonBody* body_, dFloat* rotation); + alias da_NewtonBodyGetMass = void function(const NewtonBody* body_, dFloat* mass, dFloat* Ixx, dFloat* Iyy, dFloat* Izz); + alias da_NewtonBodyGetInvMass = void function(const NewtonBody* body_, dFloat* invMass, dFloat* invIxx, dFloat* invIyy, dFloat* invIzz); + alias da_NewtonBodyGetInertiaMatrix = void function(const NewtonBody* body_, dFloat* inertiaMatrix); + alias da_NewtonBodyGetInvInertiaMatrix = void function(const NewtonBody* body_, dFloat* invInertiaMatrix); + alias da_NewtonBodyGetOmega = void function(const NewtonBody* body_, dFloat* vector); + alias da_NewtonBodyGetVelocity = void function(const NewtonBody* body_, dFloat* vector); + alias da_NewtonBodyGetAlpha = void function(const NewtonBody* body_, dFloat* vector); + alias da_NewtonBodyGetAcceleration = void function(const NewtonBody* body_, dFloat* vector); + alias da_NewtonBodyGetForce = void function(const NewtonBody* body_, dFloat* vector); + alias da_NewtonBodyGetTorque = void function(const NewtonBody* body_, dFloat* vector); + alias da_NewtonBodyGetCentreOfMass = void function(const NewtonBody* body_, dFloat* com); + alias da_NewtonBodyGetPointVelocity = void function(const NewtonBody* body_, const dFloat* point, dFloat* velocOut); + alias da_NewtonBodyApplyImpulsePair = void function(const NewtonBody* body_, dFloat* linearImpulse, dFloat* angularImpulse, dFloat timestep); + alias da_NewtonBodyAddImpulse = void function(const NewtonBody* body_, const dFloat* pointDeltaVeloc, const dFloat* pointPosit, dFloat timestep); + alias da_NewtonBodyApplyImpulseArray = void function(const NewtonBody* body_, int impuleCount, int strideInByte, const dFloat* impulseArray, const dFloat* pointArray, dFloat timestep); + alias da_NewtonBodyIntegrateVelocity = void function(const NewtonBody* body_, dFloat timestep); + alias da_NewtonBodyGetLinearDamping = dFloat function(const NewtonBody* body_); + alias da_NewtonBodyGetAngularDamping = void function(const NewtonBody* body_, dFloat* vector); + alias da_NewtonBodyGetAABB = void function(const NewtonBody* body_, dFloat* p0, dFloat* p1); + alias da_NewtonBodyGetFirstJoint = NewtonJoint* function(const NewtonBody* body_); + alias da_NewtonBodyGetNextJoint = NewtonJoint* function(const NewtonBody* body_, const NewtonJoint* joint); + alias da_NewtonBodyGetFirstContactJoint = NewtonJoint* function(const NewtonBody* body_); + alias da_NewtonBodyGetNextContactJoint = NewtonJoint* function(const NewtonBody* body_, const NewtonJoint* contactJoint); + alias da_NewtonBodyFindContact = NewtonJoint* function(const NewtonBody* body0, const NewtonBody* body1); + + // contact joints interface + alias da_NewtonContactJointGetFirstContact = void* function(const NewtonJoint* contactJoint); + alias da_NewtonContactJointGetNextContact = void* function(const NewtonJoint* contactJoint, void* contact); + alias da_NewtonContactJointGetContactCount = int function(const NewtonJoint* contactJoint); + alias da_NewtonContactJointRemoveContact = void function(const NewtonJoint* contactJoint, void* contact); + alias da_NewtonContactJointGetClosestDistance = dFloat function(const NewtonJoint* contactJoint); + alias da_NewtonContactJointResetSelftJointCollision = void function(const NewtonJoint* contactJoint); + alias da_NewtonContactJointResetIntraJointCollision = void function(const NewtonJoint* contactJoint); + alias da_NewtonContactGetMaterial = NewtonMaterial* function(const void* contact); + alias da_NewtonContactGetCollision0 = NewtonCollision* function(const void* contact); + alias da_NewtonContactGetCollision1 = NewtonCollision* function(const void* contact); + alias da_NewtonContactGetCollisionID0 = void* function(const void* contact); + alias da_NewtonContactGetCollisionID1 = void* function(const void* contact); + + // Common joint functions + alias da_NewtonJointGetUserData = void* function(const NewtonJoint* joint); + alias da_NewtonJointSetUserData = void function(const NewtonJoint* joint, void* userData); + alias da_NewtonJointGetBody0 = NewtonBody* function(const NewtonJoint* joint); + alias da_NewtonJointGetBody1 = NewtonBody* function(const NewtonJoint* joint); + alias da_NewtonJointGetInfo = void function(const NewtonJoint* joint, NewtonJointRecord* info); + alias da_NewtonJointGetCollisionState = int function(const NewtonJoint* joint); + alias da_NewtonJointSetCollisionState = void function(const NewtonJoint* joint, int state); + alias da_NewtonJointGetStiffness = dFloat function(const NewtonJoint* joint); + alias da_NewtonJointSetStiffness = void function(const NewtonJoint* joint, dFloat state); + alias da_NewtonDestroyJoint = void function(const NewtonWorld* newtonWorld, const NewtonJoint* joint); + alias da_NewtonJointSetDestructor = void function(const NewtonJoint* joint, NewtonConstraintDestructor destructor); + alias da_NewtonJointIsActive = int function(const NewtonJoint* joint); + + // InverseDynamics Interface + alias da_NewtonCreateInverseDynamics = NewtonInverseDynamics* function(const NewtonWorld* newtonWorld); + alias da_NewtonInverseDynamicsDestroy = void function(NewtonInverseDynamics* inverseDynamics); + alias da_NewtonInverseDynamicsGetRoot = void* function(NewtonInverseDynamics* inverseDynamics); + alias da_NewtonInverseDynamicsGetNextChildNode = void* function(NewtonInverseDynamics* inverseDynamics, void* node); + alias da_NewtonInverseDynamicsGetFirstChildNode = void* function(NewtonInverseDynamics* inverseDynamics, void* parentNode); + alias da_NewtonInverseDynamicsGetBody = NewtonBody* function(NewtonInverseDynamics* inverseDynamics, void* node); + alias da_NewtonInverseDynamicsGetJoint = NewtonJoint* function(NewtonInverseDynamics* inverseDynamics, void* node); + alias da_NewtonInverseDynamicsCreateEffector = NewtonJoint* function(NewtonInverseDynamics* inverseDynamics, void* node, NewtonUserBilateralCallback callback); + alias da_NewtonInverseDynamicsDestroyEffector = void function(NewtonJoint* effector); + alias da_NewtonInverseDynamicsAddRoot = void* function(NewtonInverseDynamics* inverseDynamics, NewtonBody* root); + alias da_NewtonInverseDynamicsAddChildNode = void* function(NewtonInverseDynamics* inverseDynamics, void* parentNode, NewtonJoint* joint); + alias da_NewtonInverseDynamicsAddLoopJoint = bool function(NewtonInverseDynamics* inverseDynamics, NewtonJoint* joint); + alias da_NewtonInverseDynamicsEndBuild = void function(NewtonInverseDynamics* inverseDynamics); + alias da_NewtonInverseDynamicsUpdate = void function(NewtonInverseDynamics* inverseDynamics, dFloat timestep, int threadIndex); + + // particle system interface (soft bodies, individual, pressure bodies and cloth) + 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); + alias da_NewtonCreateDeformableSolid = NewtonCollision* function(const NewtonWorld* newtonWorld, const NewtonMesh* mesh, int shapeID); + alias da_NewtonDeformableMeshGetParticleCount = int function(const NewtonCollision* deformableMesh); + alias da_NewtonDeformableMeshGetParticleStrideInBytes = int function(const NewtonCollision* deformableMesh); + alias da_NewtonDeformableMeshGetParticleArray = const(dFloat)* function(const NewtonCollision* deformableMesh); + + // Ball and Socket joint functions + alias da_NewtonConstraintCreateBall = NewtonJoint* function(const NewtonWorld* newtonWorld, const(dFloat)* pivotPoint, const NewtonBody* childBody, const NewtonBody* parentBody); + alias da_NewtonBallSetUserCallback = void function(const NewtonJoint* ball, NewtonBallCallback callback); + alias da_NewtonBallGetJointAngle = void function(const NewtonJoint* ball, dFloat* angle); + alias da_NewtonBallGetJointOmega = void function(const NewtonJoint* ball, dFloat* omega); + alias da_NewtonBallGetJointForce = void function(const NewtonJoint* ball, dFloat* force); + alias da_NewtonBallSetConeLimits = void function(const NewtonJoint* ball, const(dFloat)* pin, dFloat maxConeAngle, dFloat maxTwistAngle); + + // Hinge joint functions + // alias da_NewtonConstraintCreateHinge = NewtonJoint* function(const NewtonWorld* newtonWorld, const(dFloat)* pivotPoint, const(dFloat)* pinDir, const NewtonBody* childBody, const NewtonBody* parentBody); + // alias da_NewtonHingeSetUserCallback = void function(const NewtonJoint* hinge, NewtonHingeCallback callback); + // alias da_NewtonHingeGetJointAngle = dFloat function(const NewtonJoint* hinge); + // alias da_NewtonHingeGetJointOmega = dFloat function(const NewtonJoint* hinge); + // alias da_NewtonHingeGetJointForce = void function(const NewtonJoint* hinge, dFloat* force); + // alias da_NewtonHingeCalculateStopAlpha = dFloat function(const NewtonJoint* hinge, const NewtonHingeSliderUpdateDesc* desc, dFloat angle); + + // Slider joint functions + alias da_NewtonConstraintCreateSlider = NewtonJoint* function(const NewtonWorld* newtonWorld, const(dFloat)* pivotPoint, const(dFloat)* pinDir, const NewtonBody* childBody, const NewtonBody* parentBody); + alias da_NewtonSliderSetUserCallback = void function(const NewtonJoint* slider, NewtonSliderCallback callback); + alias da_NewtonSliderGetJointPosit = dFloat function(const(NewtonJoint)* slider); + alias da_NewtonSliderGetJointVeloc = dFloat function(const(NewtonJoint)* slider); + alias da_NewtonSliderGetJointForce = void function(const NewtonJoint* slider, dFloat* force); + alias da_NewtonSliderCalculateStopAccel = dFloat function(const NewtonJoint* slider, const NewtonHingeSliderUpdateDesc* desc, dFloat position); + + // Corkscrew joint functions + alias da_NewtonConstraintCreateCorkscrew = NewtonJoint* function(const NewtonWorld* newtonWorld, const(dFloat)* pivotPoint, const(dFloat)* pinDir, const NewtonBody* childBody, const NewtonBody* parentBody); + alias da_NewtonCorkscrewSetUserCallback = void function(const NewtonJoint* corkscrew, NewtonCorkscrewCallback callback); + alias da_NewtonCorkscrewGetJointPosit = dFloat function(const NewtonJoint* corkscrew); + alias da_NewtonCorkscrewGetJointAngle = dFloat function(const NewtonJoint* corkscrew); + alias da_NewtonCorkscrewGetJointVeloc = dFloat function(const NewtonJoint* corkscrew); + alias da_NewtonCorkscrewGetJointOmega = dFloat function(const NewtonJoint* corkscrew); + alias da_NewtonCorkscrewGetJointForce = void function(const NewtonJoint* corkscrew, dFloat* force); + alias da_NewtonCorkscrewCalculateStopAlpha = dFloat function(const NewtonJoint* corkscrew, const NewtonHingeSliderUpdateDesc* desc, dFloat angle); + alias da_NewtonCorkscrewCalculateStopAccel = dFloat function(const NewtonJoint* corkscrew, const NewtonHingeSliderUpdateDesc* desc, dFloat position); + + // Universal joint functions + alias da_NewtonConstraintCreateUniversal = NewtonJoint* function(const NewtonWorld* newtonWorld, const(dFloat)* pivotPoint, const(dFloat)* pinDir0, const(dFloat)* pinDir1, const NewtonBody* childBody, const NewtonBody* parentBody); + alias da_NewtonUniversalSetUserCallback = void function(const NewtonJoint* universal, NewtonUniversalCallback callback); + alias da_NewtonUniversalGetJointAngle0 = dFloat function(const NewtonJoint* universal); + alias da_NewtonUniversalGetJointAngle1 = dFloat function(const NewtonJoint* universal); + alias da_NewtonUniversalGetJointOmega0 = dFloat function(const NewtonJoint* universal); + alias da_NewtonUniversalGetJointOmega1 = dFloat function(const NewtonJoint* universal); + alias da_NewtonUniversalGetJointForce = void function(const NewtonJoint* universal, dFloat* force); + alias da_NewtonUniversalCalculateStopAlpha0 = dFloat function(const NewtonJoint* universal, const NewtonHingeSliderUpdateDesc* desc, dFloat angle); + alias da_NewtonUniversalCalculateStopAlpha1 = dFloat function(const NewtonJoint* universal, const NewtonHingeSliderUpdateDesc* desc, dFloat angle); + + // Up vector joint functions + alias da_NewtonConstraintCreateUpVector = NewtonJoint* function(const NewtonWorld* newtonWorld, const(dFloat)* pinDir, const NewtonBody* body_); + alias da_NewtonUpVectorGetPin = void function(const NewtonJoint* upVector, dFloat* pin); + alias da_NewtonUpVectorSetPin = void function(const NewtonJoint* upVector, const(dFloat)* pin); + + // User defined bilateral Joint + alias da_NewtonConstraintCreateUserJoint = NewtonJoint* function(const NewtonWorld* newtonWorld, int maxDOF, NewtonUserBilateralCallback callback, const NewtonBody* childBody, const NewtonBody* parentBody); + alias da_NewtonUserJointGetSolverModel = int function(const NewtonJoint* joint); + alias da_NewtonUserJointSetSolverModel = void function(const NewtonJoint* joint, int model); + alias da_NewtonUserJointSetFeedbackCollectorCallback = void function(const NewtonJoint* joint, NewtonUserBilateralCallback getFeedback); + alias da_NewtonUserJointAddLinearRow = void function(const NewtonJoint* joint, const dFloat* pivot0, const dFloat* pivot1, const dFloat* dir); + alias da_NewtonUserJointAddAngularRow = void function(const NewtonJoint* joint, dFloat relativeAngle, const dFloat* dir); + alias da_NewtonUserJointAddGeneralRow = void function(const NewtonJoint* joint, const dFloat* jacobian0, const dFloat* jacobian1); + alias da_NewtonUserJointSetRowMinimumFriction = void function(const NewtonJoint* joint, dFloat friction); + alias da_NewtonUserJointSetRowMaximumFriction = void function(const NewtonJoint* joint, dFloat friction); + alias da_NewtonUserJointCalculateRowZeroAccelaration = dFloat function(const NewtonJoint* joint); + alias da_NewtonUserJointGetRowAcceleration = dFloat function(const NewtonJoint* joint); + alias da_NewtonUserJointSetRowAsInverseDynamics = void function(const NewtonJoint* joint); + alias da_NewtonUserJointSetRowAcceleration = void function(const NewtonJoint* joint, dFloat acceleration); + alias da_NewtonUserJointSetRowSpringDamperAcceleration = void function(const NewtonJoint* joint, dFloat rowStiffness, dFloat spring, dFloat damper); + alias da_NewtonUserJointSetRowStiffness = void function(const NewtonJoint* joint, dFloat stiffness); + alias da_NewtonUserJoinRowsCount = int function(const NewtonJoint* joint); + alias da_NewtonUserJointGetGeneralRow = void function(const NewtonJoint* joint, int index, dFloat* jacobian0, dFloat* jacobian1); + alias da_NewtonUserJointGetRowForce = dFloat function(const NewtonJoint* joint, int row); + alias da_NewtonUserJointSubmitImmediateModeConstraint = int function(const NewtonJoint* joint, NewtonImmediateModeConstraint* descriptor, float timestep); + + // Mesh joint functions + alias da_NewtonMeshCreate = NewtonMesh* function(const NewtonWorld* newtonWorld); + alias da_NewtonMeshCreateFromMesh = NewtonMesh* function(const NewtonMesh* mesh); + alias da_NewtonMeshCreateFromCollision = NewtonMesh* function(const NewtonCollision* collision); + alias da_NewtonMeshCreateTetrahedraIsoSurface = NewtonMesh* function(const NewtonMesh* mesh); + alias da_NewtonMeshCreateConvexHull = NewtonMesh* function(const NewtonWorld* newtonWorld, int pointCount, const dFloat* vertexCloud, int strideInBytes, dFloat tolerance); + alias da_NewtonMeshCreateVoronoiConvexDecomposition = NewtonMesh* function(const NewtonWorld* newtonWorld, int pointCount, const dFloat* vertexCloud, int strideInBytes, int materialID, const dFloat* textureMatrix); + alias da_NewtonMeshCreateFromSerialization = NewtonMesh* function(const NewtonWorld* newtonWorld, NewtonDeserializeCallback deserializeFunction, void* serializeHandle); + alias da_NewtonMeshDestroy = void function(const NewtonMesh* mesh); + alias da_NewtonMeshSerialize = void function(const NewtonMesh* mesh, NewtonSerializeCallback serializeFunction, void* serializeHandle); + alias da_NewtonMeshSaveOFF = void function(const NewtonMesh* mesh, const char* filename); + alias da_NewtonMeshLoadOFF = NewtonMesh* function(const NewtonWorld* newtonWorld, const char* filename); + alias da_NewtonMeshLoadTetrahedraMesh = NewtonMesh* function(const NewtonWorld* newtonWorld, const char* filename); + alias da_NewtonMeshApplyTransform = void function(const NewtonMesh* mesh, const dFloat* matrix); + alias da_NewtonMeshCalculateOOBB = void function(const NewtonMesh* mesh, dFloat* matrix, dFloat* x, dFloat* y, dFloat* z); + alias da_NewtonMeshCalculateVertexNormals = void function(const NewtonMesh* mesh, dFloat angleInRadians); + alias da_NewtonMeshApplySphericalMapping = void function(const NewtonMesh* mesh, int material); + alias da_NewtonMeshApplyCylindricalMapping = void function(const NewtonMesh* mesh, int cylinderMaterial, int capMaterial); + alias da_NewtonMeshApplyBoxMapping = void function(const NewtonMesh* mesh, int frontMaterial, int sideMaterial, int topMaterial); + alias da_NewtonMeshApplyAngleBasedMapping = void function(const NewtonMesh* mesh, int material, NewtonReportProgress reportPrograssCallback, void* reportPrgressUserData); + alias da_NewtonCreateTetrahedraLinearBlendSkinWeightsChannel = void function(const NewtonMesh* tetrahedraMesh, NewtonMesh* skinMesh); + alias da_NewtonMeshOptimize = void function(const NewtonMesh* mesh); + alias da_NewtonMeshOptimizePoints = void function(const NewtonMesh* mesh); + alias da_NewtonMeshOptimizeVertex = void function(const NewtonMesh* mesh); + alias da_NewtonMeshIsOpenMesh = int function(const NewtonMesh* mesh); + alias da_NewtonMeshFixTJoints = void function(const NewtonMesh* mesh); + alias da_NewtonMeshPolygonize = void function(const NewtonMesh* mesh); + alias da_NewtonMeshTriangulate = void function(const NewtonMesh* mesh); + alias da_NewtonMeshUnion = NewtonMesh* function(const NewtonMesh* mesh, const NewtonMesh* clipper, const dFloat* clipperMatrix); + alias da_NewtonMeshDifference = NewtonMesh* function(const NewtonMesh* mesh, const NewtonMesh* clipper, const dFloat* clipperMatrix); + alias da_NewtonMeshIntersection = NewtonMesh* function(const NewtonMesh* mesh, const NewtonMesh* clipper, const dFloat* clipperMatrix); + alias da_NewtonMeshClip = void function(const NewtonMesh* mesh, const NewtonMesh* clipper, const dFloat* clipperMatrix, NewtonMesh** topMesh, NewtonMesh** bottomMesh); + alias da_NewtonMeshConvexMeshIntersection = NewtonMesh* function(const NewtonMesh* mesh, const NewtonMesh* convexMesh); + alias da_NewtonMeshSimplify = NewtonMesh* function(const NewtonMesh* mesh, int maxVertexCount, NewtonReportProgress reportPrograssCallback, void* reportPrgressUserData); + alias da_NewtonMeshApproximateConvexDecomposition = NewtonMesh* function(const NewtonMesh* mesh, dFloat maxConcavity, dFloat backFaceDistanceFactor, int maxCount, int maxVertexPerHull, NewtonReportProgress reportProgressCallback, void* reportProgressUserData); + alias da_NewtonRemoveUnusedVertices = void function(const NewtonMesh* mesh, int* vertexRemapTable); + alias da_NewtonMeshBeginBuild = void function(const NewtonMesh* mesh); + alias da_NewtonMeshBeginFace = void function(const NewtonMesh* mesh); + alias da_NewtonMeshAddPoint = void function(const NewtonMesh* mesh, dFloat64 x, dFloat64 y, dFloat64 z); + alias da_NewtonMeshAddLayer = void function(const NewtonMesh* mesh, int layerIndex); + alias da_NewtonMeshAddMaterial = void function(const NewtonMesh* mesh, int materialIndex); + alias da_NewtonMeshAddNormal = void function(const NewtonMesh* mesh, dFloat x, dFloat y, dFloat z); + alias da_NewtonMeshAddBinormal = void function(const NewtonMesh* mesh, dFloat x, dFloat y, dFloat z); + alias da_NewtonMeshAddUV0 = void function(const NewtonMesh* mesh, dFloat u, dFloat v); + alias da_NewtonMeshAddUV1 = void function(const NewtonMesh* mesh, dFloat u, dFloat v); + alias da_NewtonMeshEndFace = void function(const NewtonMesh* mesh); + alias da_NewtonMeshEndBuild = void function(const NewtonMesh* mesh); + alias da_NewtonMeshClearVertexFormat = void function(NewtonMeshVertexFormat* format); + alias da_NewtonMeshBuildFromVertexListIndexList = void function(const NewtonMesh* mesh, const NewtonMeshVertexFormat* format); + alias da_NewtonMeshGetPointCount = int function(const NewtonMesh* mesh); + alias da_NewtonMeshGetIndexToVertexMap = const(int)* function(const NewtonMesh* mesh); + alias da_NewtonMeshGetVertexDoubleChannel = void function(const NewtonMesh* mesh, int vertexStrideInByte, dFloat64* outBuffer); + alias da_NewtonMeshGetVertexChannel = void function(const NewtonMesh* mesh, int vertexStrideInByte, dFloat* outBuffer); + alias da_NewtonMeshGetNormalChannel = void function(const NewtonMesh* mesh, int vertexStrideInByte, dFloat* outBuffer); + alias da_NewtonMeshGetBinormalChannel = void function(const NewtonMesh* mesh, int vertexStrideInByte, dFloat* outBuffer); + alias da_NewtonMeshGetUV0Channel = void function(const NewtonMesh* mesh, int vertexStrideInByte, dFloat* outBuffer); + alias da_NewtonMeshGetUV1Channel = void function(const NewtonMesh* mesh, int vertexStrideInByte, dFloat* outBuffer); + alias da_NewtonMeshGetVertexColorChannel = void function(const NewtonMesh* mesh, int vertexStrideInByte, dFloat* outBuffer); + alias da_NewtonMeshHasNormalChannel = int function(const NewtonMesh* mesh); + alias da_NewtonMeshHasBinormalChannel = int function(const NewtonMesh* mesh); + alias da_NewtonMeshHasUV0Channel = int function(const NewtonMesh* mesh); + alias da_NewtonMeshHasUV1Channel = int function(const NewtonMesh* mesh); + alias da_NewtonMeshHasVertexColorChannel = int function(const NewtonMesh* mesh); + alias da_NewtonMeshBeginHandle = void* function(const NewtonMesh* mesh); + alias da_NewtonMeshEndHandle = void function(const NewtonMesh* mesh, void* handle); + alias da_NewtonMeshFirstMaterial = int function(const NewtonMesh* mesh, void* handle); + alias da_NewtonMeshNextMaterial = int function(const NewtonMesh* mesh, void* handle, int materialId); + alias da_NewtonMeshMaterialGetMaterial = int function(const NewtonMesh* mesh, void* handle, int materialId); + alias da_NewtonMeshMaterialGetIndexCount = int function(const NewtonMesh* mesh, void* handle, int materialId); + alias da_NewtonMeshMaterialGetIndexStream = void function(const NewtonMesh* mesh, void* handle, int materialId, int* index); + alias da_NewtonMeshMaterialGetIndexStreamShort = void function(const NewtonMesh* mesh, void* handle, int materialId, short* index); + alias da_NewtonMeshCreateFirstSingleSegment = NewtonMesh* function(const NewtonMesh* mesh); + alias da_NewtonMeshCreateNextSingleSegment = NewtonMesh* function(const NewtonMesh* mesh, const NewtonMesh* segment); + alias da_NewtonMeshCreateFirstLayer = NewtonMesh* function(const NewtonMesh* mesh); + alias da_NewtonMeshCreateNextLayer = NewtonMesh* function(const NewtonMesh* mesh, const NewtonMesh* segment); + alias da_NewtonMeshGetTotalFaceCount = int function(const NewtonMesh* mesh); + alias da_NewtonMeshGetTotalIndexCount = int function(const NewtonMesh* mesh); + alias da_NewtonMeshGetFaces = void function(const NewtonMesh* mesh, int* faceIndexCount, int* faceMaterial, void** faceIndices); + alias da_NewtonMeshGetVertexCount = int function(const NewtonMesh* mesh); + alias da_NewtonMeshGetVertexStrideInByte = int function(const NewtonMesh* mesh); + alias da_NewtonMeshGetVertexArray = const(dFloat64)* function(const NewtonMesh* mesh); + alias da_NewtonMeshGetFirstVertex = void* function(const NewtonMesh* mesh); + alias da_NewtonMeshGetNextVertex = void* function(const NewtonMesh* mesh, const void* vertex); + alias da_NewtonMeshGetVertexIndex = int function(const NewtonMesh* mesh, const void* vertex); + alias da_NewtonMeshGetFirstPoint = void* function(const NewtonMesh* mesh); + alias da_NewtonMeshGetNextPoint = void* function(const NewtonMesh* mesh, const void* point); + alias da_NewtonMeshGetPointIndex = int function(const NewtonMesh* mesh, const void* point); + alias da_NewtonMeshGetVertexIndexFromPoint = int function(const NewtonMesh* mesh, const void* point); + alias da_NewtonMeshGetFirstEdge = void* function(const NewtonMesh* mesh); + alias da_NewtonMeshGetNextEdge = void* function(const NewtonMesh* mesh, const void* edge); + alias da_NewtonMeshGetEdgeIndices = void function(const NewtonMesh* mesh, const void* edge, int* v0, int* v1); + alias da_NewtonMeshGetFirstFace = void* function(const NewtonMesh* mesh); + alias da_NewtonMeshGetNextFace = void* function(const NewtonMesh* mesh, const void* face); + alias da_NewtonMeshIsFaceOpen = int function(const NewtonMesh* mesh, const void* face); + alias da_NewtonMeshGetFaceMaterial = int function(const NewtonMesh* mesh, const void* face); + alias da_NewtonMeshGetFaceIndexCount = int function(const NewtonMesh* mesh, const void* face); + alias da_NewtonMeshGetFaceIndices = void function(const NewtonMesh* mesh, const void* face, int* indices); + alias da_NewtonMeshGetFacePointIndices = void function(const NewtonMesh* mesh, const void* face, int* indices); + alias da_NewtonMeshCalculateFaceNormal = void function(const NewtonMesh* mesh, const void* face, dFloat64* normal); + alias da_NewtonMeshSetFaceMaterial = void function(const NewtonMesh* mesh, const void* face, int matId); +} + +__gshared +{ + // World + da_NewtonWorldGetVersion NewtonWorldGetVersion; + da_NewtonWorldFloatSize NewtonWorldFloatSize; + da_NewtonGetMemoryUsed NewtonGetMemoryUsed; + da_NewtonSetMemorySystem NewtonSetMemorySystem; + da_NewtonCreate NewtonCreate; + da_NewtonDestroy NewtonDestroy; + da_NewtonDestroyAllBodies NewtonDestroyAllBodies; + //da_NewtonSetPosUpdateCallback NewtonSetPosUpdateCallback; + da_NewtonAlloc NewtonAlloc; + da_NewtonFree NewtonFree; + da_NewtonLoadPlugins NewtonLoadPlugins; + da_NewtonUnloadPlugins NewtonUnloadPlugins; + da_NewtonCurrentPlugin NewtonCurrentPlugin; + da_NewtonGetFirstPlugin NewtonGetFirstPlugin; + da_NewtonGetPreferedPlugin NewtonGetPreferedPlugin; + da_NewtonGetNextPlugin NewtonGetNextPlugin; + da_NewtonGetPluginString NewtonGetPluginString; + da_NewtonSelectPlugin NewtonSelectPlugin; + da_NewtonGetContactMergeTolerance NewtonGetContactMergeTolerance; + da_NewtonSetContactMergeTolerance NewtonSetContactMergeTolerance; + da_NewtonInvalidateCache NewtonInvalidateCache; + da_NewtonSetSolverIterations NewtonSetSolverIterations; + da_NewtonGetSolverIterations NewtonGetSolverIterations; + //da_NewtonSetMultiThreadSolverOnSingleIsland NewtonSetMultiThreadSolverOnSingleIsland; + //da_NewtonGetMultiThreadSolverOnSingleIsland NewtonGetMultiThreadSolverOnSingleIsland; + da_NewtonGetBroadphaseAlgorithm NewtonGetBroadphaseAlgorithm; + da_NewtonSelectBroadphaseAlgorithm NewtonSelectBroadphaseAlgorithm; + da_NewtonResetBroadphase NewtonResetBroadphase; + da_NewtonUpdate NewtonUpdate; + da_NewtonUpdateAsync NewtonUpdateAsync; + da_NewtonWaitForUpdateToFinish NewtonWaitForUpdateToFinish; + da_NewtonGetNumberOfSubsteps NewtonGetNumberOfSubsteps; + da_NewtonSetNumberOfSubsteps NewtonSetNumberOfSubsteps; + da_NewtonGetLastUpdateTime NewtonGetLastUpdateTime; + da_NewtonSerializeToFile NewtonSerializeToFile; + da_NewtonDeserializeFromFile NewtonDeserializeFromFile; + da_NewtonSerializeScene NewtonSerializeScene; + da_NewtonDeserializeScene NewtonDeserializeScene; + da_NewtonFindSerializedBody NewtonFindSerializedBody; + da_NewtonSetJointSerializationCallbacks NewtonSetJointSerializationCallbacks; + da_NewtonGetJointSerializationCallbacks NewtonGetJointSerializationCallbacks; + + // Multithreading + da_NewtonWorldCriticalSectionLock NewtonWorldCriticalSectionLock; + da_NewtonWorldCriticalSectionUnlock NewtonWorldCriticalSectionUnlock; + da_NewtonSetThreadsCount NewtonSetThreadsCount; + da_NewtonGetThreadsCount NewtonGetThreadsCount; + da_NewtonGetMaxThreadsCount NewtonGetMaxThreadsCount; + da_NewtonDispachThreadJob NewtonDispachThreadJob; + da_NewtonSyncThreadJobs NewtonSyncThreadJobs; + da_NewtonAtomicAdd NewtonAtomicAdd; + da_NewtonAtomicSwap NewtonAtomicSwap; + da_NewtonYield NewtonYield; + + da_NewtonSetIslandUpdateEvent NewtonSetIslandUpdateEvent; + da_NewtonWorldForEachJointDo NewtonWorldForEachJointDo; + da_NewtonWorldForEachBodyInAABBDo NewtonWorldForEachBodyInAABBDo; + da_NewtonWorldGetUserData NewtonWorldGetUserData; + da_NewtonWorldAddListener NewtonWorldAddListener; + da_NewtonWorldGetListener NewtonWorldGetListener; + da_NewtonWorldListenerSetDestructorCallback NewtonWorldListenerSetDestructorCallback; + da_NewtonWorldListenerSetPreUpdateCallback NewtonWorldListenerSetPreUpdateCallback; + da_NewtonWorldListenerSetPostUpdateCallback NewtonWorldListenerSetPostUpdateCallback; + da_NewtonWorldListenerSetDebugCallback NewtonWorldListenerSetDebugCallback; + da_NewtonWorldListenerSetBodyDestroyCallback NewtonWorldListenerSetBodyDestroyCallback; + da_NewtonWorldListenerDebug NewtonWorldListenerDebug; + da_NewtonWorldGetListenerUserData NewtonWorldGetListenerUserData; + da_NewtonWorldListenerGetBodyDestroyCallback NewtonWorldListenerGetBodyDestroyCallback; + da_NewtonWorldSetDestructorCallback NewtonWorldSetDestructorCallback; + da_NewtonWorldGetDestructorCallback NewtonWorldGetDestructorCallback; + da_NewtonWorldSetCollisionConstructorDestructorCallback NewtonWorldSetCollisionConstructorDestructorCallback; + da_NewtonWorldRayCast NewtonWorldRayCast; + da_NewtonWorldConvexCast NewtonWorldConvexCast; + da_NewtonWorldCollide NewtonWorldCollide; + + da_NewtonWorldGetBodyCount NewtonWorldGetBodyCount; + da_NewtonWorldGetConstraintCount NewtonWorldGetConstraintCount; + + // Island + da_NewtonIslandGetBody NewtonIslandGetBody; + da_NewtonIslandGetBodyAABB NewtonIslandGetBodyAABB; + + // Material + da_NewtonMaterialCreateGroupID NewtonMaterialCreateGroupID; + da_NewtonMaterialGetDefaultGroupID NewtonMaterialGetDefaultGroupID; + da_NewtonMaterialDestroyAllGroupID NewtonMaterialDestroyAllGroupID; + da_NewtonMaterialGetUserData NewtonMaterialGetUserData; + da_NewtonMaterialSetSurfaceThickness NewtonMaterialSetSurfaceThickness; + da_NewtonMaterialSetCallbackUserData NewtonMaterialSetCallbackUserData; + da_NewtonMaterialSetContactGenerationCallback NewtonMaterialSetContactGenerationCallback; + da_NewtonMaterialSetCompoundCollisionCallback NewtonMaterialSetCompoundCollisionCallback; + da_NewtonMaterialSetCollisionCallback NewtonMaterialSetCollisionCallback; + da_NewtonMaterialSetDefaultSoftness NewtonMaterialSetDefaultSoftness; + da_NewtonMaterialSetDefaultElasticity NewtonMaterialSetDefaultElasticity; + da_NewtonMaterialSetDefaultCollidable NewtonMaterialSetDefaultCollidable; + da_NewtonMaterialSetDefaultFriction NewtonMaterialSetDefaultFriction; + da_NewtonWorldGetFirstMaterial NewtonWorldGetFirstMaterial; + da_NewtonWorldGetNextMaterial NewtonWorldGetNextMaterial; + da_NewtonWorldGetFirstBody NewtonWorldGetFirstBody; + da_NewtonWorldGetNextBody NewtonWorldGetNextBody; + + da_NewtonMaterialGetMaterialPairUserData NewtonMaterialGetMaterialPairUserData; + da_NewtonMaterialGetContactFaceAttribute NewtonMaterialGetContactFaceAttribute; + da_NewtonMaterialGetBodyCollidingShape NewtonMaterialGetBodyCollidingShape; + da_NewtonMaterialGetContactNormalSpeed NewtonMaterialGetContactNormalSpeed; + da_NewtonMaterialGetContactForce NewtonMaterialGetContactForce; + da_NewtonMaterialGetContactPositionAndNormal NewtonMaterialGetContactPositionAndNormal; + da_NewtonMaterialGetContactTangentDirections NewtonMaterialGetContactTangentDirections; + da_NewtonMaterialGetContactTangentSpeed NewtonMaterialGetContactTangentSpeed; + da_NewtonMaterialGetContactMaxNormalImpact NewtonMaterialGetContactMaxNormalImpact; + da_NewtonMaterialGetContactMaxTangentImpact NewtonMaterialGetContactMaxTangentImpact; + da_NewtonMaterialGetContactPenetration NewtonMaterialGetContactPenetration; + da_NewtonMaterialSetContactSoftness NewtonMaterialSetContactSoftness; + da_NewtonMaterialSetContactThickness NewtonMaterialSetContactThickness; + da_NewtonMaterialSetContactElasticity NewtonMaterialSetContactElasticity; + da_NewtonMaterialSetContactFrictionState NewtonMaterialSetContactFrictionState; + da_NewtonMaterialSetContactFrictionCoef NewtonMaterialSetContactFrictionCoef; + da_NewtonMaterialSetContactNormalAcceleration NewtonMaterialSetContactNormalAcceleration; + da_NewtonMaterialSetContactNormalDirection NewtonMaterialSetContactNormalDirection; + da_NewtonMaterialSetContactPosition NewtonMaterialSetContactPosition; + da_NewtonMaterialSetContactTangentFriction NewtonMaterialSetContactTangentFriction; + da_NewtonMaterialSetContactTangentAcceleration NewtonMaterialSetContactTangentAcceleration; + da_NewtonMaterialContactRotateTangentDirections NewtonMaterialContactRotateTangentDirections; + da_NewtonMaterialGetContactPruningTolerance NewtonMaterialGetContactPruningTolerance; + da_NewtonMaterialSetContactPruningTolerance NewtonMaterialSetContactPruningTolerance; + + da_NewtonCreateNull NewtonCreateNull; + da_NewtonCreateSphere NewtonCreateSphere; + da_NewtonCreateBox NewtonCreateBox; + da_NewtonCreateCone NewtonCreateCone; + da_NewtonCreateCapsule NewtonCreateCapsule; + da_NewtonCreateCylinder NewtonCreateCylinder; + da_NewtonCreateChamferCylinder NewtonCreateChamferCylinder; + da_NewtonCreateConvexHull NewtonCreateConvexHull; + da_NewtonCreateConvexHullFromMesh NewtonCreateConvexHullFromMesh; + da_NewtonCollisionGetMode NewtonCollisionGetMode; + da_NewtonCollisionSetMode NewtonCollisionSetMode; + da_NewtonConvexHullGetFaceIndices NewtonConvexHullGetFaceIndices; + da_NewtonConvexHullGetVertexData NewtonConvexHullGetVertexData; + da_NewtonConvexCollisionCalculateVolume NewtonConvexCollisionCalculateVolume; + da_NewtonConvexCollisionCalculateInertialMatrix NewtonConvexCollisionCalculateInertialMatrix; + da_NewtonConvexCollisionCalculateBuoyancyAcceleration NewtonConvexCollisionCalculateBuoyancyAcceleration; + da_NewtonCollisionDataPointer NewtonCollisionDataPointer; + + da_NewtonCreateCompoundCollision NewtonCreateCompoundCollision; + da_NewtonCreateCompoundCollisionFromMesh NewtonCreateCompoundCollisionFromMesh; + da_NewtonCompoundCollisionBeginAddRemove NewtonCompoundCollisionBeginAddRemove; + da_NewtonCompoundCollisionAddSubCollision NewtonCompoundCollisionAddSubCollision; + da_NewtonCompoundCollisionRemoveSubCollision NewtonCompoundCollisionRemoveSubCollision; + da_NewtonCompoundCollisionRemoveSubCollisionByIndex NewtonCompoundCollisionRemoveSubCollisionByIndex; + da_NewtonCompoundCollisionSetSubCollisionMatrix NewtonCompoundCollisionSetSubCollisionMatrix; + da_NewtonCompoundCollisionEndAddRemove NewtonCompoundCollisionEndAddRemove; + da_NewtonCompoundCollisionGetFirstNode NewtonCompoundCollisionGetFirstNode; + da_NewtonCompoundCollisionGetNextNode NewtonCompoundCollisionGetNextNode; + da_NewtonCompoundCollisionGetNodeByIndex NewtonCompoundCollisionGetNodeByIndex; + da_NewtonCompoundCollisionGetNodeIndex NewtonCompoundCollisionGetNodeIndex; + da_NewtonCompoundCollisionGetCollisionFromNode NewtonCompoundCollisionGetCollisionFromNode; + + da_NewtonCreateFracturedCompoundCollision NewtonCreateFracturedCompoundCollision; + da_NewtonFracturedCompoundPlaneClip NewtonFracturedCompoundPlaneClip; + da_NewtonFracturedCompoundSetCallbacks NewtonFracturedCompoundSetCallbacks; + da_NewtonFracturedCompoundIsNodeFreeToDetach NewtonFracturedCompoundIsNodeFreeToDetach; + da_NewtonFracturedCompoundNeighborNodeList NewtonFracturedCompoundNeighborNodeList; + da_NewtonFracturedCompoundGetMainMesh NewtonFracturedCompoundGetMainMesh; + da_NewtonFracturedCompoundGetFirstSubMesh NewtonFracturedCompoundGetFirstSubMesh; + da_NewtonFracturedCompoundGetNextSubMesh NewtonFracturedCompoundGetNextSubMesh; + da_NewtonFracturedCompoundCollisionGetVertexCount NewtonFracturedCompoundCollisionGetVertexCount; + da_NewtonFracturedCompoundCollisionGetVertexPositions NewtonFracturedCompoundCollisionGetVertexPositions; + da_NewtonFracturedCompoundCollisionGetVertexNormals NewtonFracturedCompoundCollisionGetVertexNormals; + da_NewtonFracturedCompoundCollisionGetVertexUVs NewtonFracturedCompoundCollisionGetVertexUVs; + da_NewtonFracturedCompoundMeshPartGetIndexStream NewtonFracturedCompoundMeshPartGetIndexStream; + da_NewtonFracturedCompoundMeshPartGetFirstSegment NewtonFracturedCompoundMeshPartGetFirstSegment; + da_NewtonFracturedCompoundMeshPartGetNextSegment NewtonFracturedCompoundMeshPartGetNextSegment; + da_NewtonFracturedCompoundMeshPartGetMaterial NewtonFracturedCompoundMeshPartGetMaterial; + da_NewtonFracturedCompoundMeshPartGetIndexCount NewtonFracturedCompoundMeshPartGetIndexCount; + + da_NewtonCreateSceneCollision NewtonCreateSceneCollision; + da_NewtonSceneCollisionBeginAddRemove NewtonSceneCollisionBeginAddRemove; + da_NewtonSceneCollisionAddSubCollision NewtonSceneCollisionAddSubCollision; + da_NewtonSceneCollisionRemoveSubCollision NewtonSceneCollisionRemoveSubCollision; + da_NewtonSceneCollisionRemoveSubCollisionByIndex NewtonSceneCollisionRemoveSubCollisionByIndex; + da_NewtonSceneCollisionSetSubCollisionMatrix NewtonSceneCollisionSetSubCollisionMatrix; + da_NewtonSceneCollisionEndAddRemove NewtonSceneCollisionEndAddRemove; + da_NewtonSceneCollisionGetFirstNode NewtonSceneCollisionGetFirstNode; + da_NewtonSceneCollisionGetNextNode NewtonSceneCollisionGetNextNode; + da_NewtonSceneCollisionGetNodeByIndex NewtonSceneCollisionGetNodeByIndex; + da_NewtonSceneCollisionGetNodeIndex NewtonSceneCollisionGetNodeIndex; + da_NewtonSceneCollisionGetCollisionFromNode NewtonSceneCollisionGetCollisionFromNode; + da_NewtonCreateUserMeshCollision NewtonCreateUserMeshCollision; + da_NewtonUserMeshCollisionContinuousOverlapTest NewtonUserMeshCollisionContinuousOverlapTest; + + da_NewtonCreateCollisionFromSerialization NewtonCreateCollisionFromSerialization; + da_NewtonCollisionSerialize NewtonCollisionSerialize; + da_NewtonCollisionGetInfo NewtonCollisionGetInfo; + + da_NewtonCreateHeightFieldCollision NewtonCreateHeightFieldCollision; + da_NewtonHeightFieldSetUserRayCastCallback NewtonHeightFieldSetUserRayCastCallback; + da_NewtonHeightFieldSetHorizontalDisplacement NewtonHeightFieldSetHorizontalDisplacement; + da_NewtonCreateTreeCollision NewtonCreateTreeCollision; + da_NewtonCreateTreeCollisionFromMesh NewtonCreateTreeCollisionFromMesh; + da_NewtonTreeCollisionSetUserRayCastCallback NewtonTreeCollisionSetUserRayCastCallback; + da_NewtonTreeCollisionBeginBuild NewtonTreeCollisionBeginBuild; + da_NewtonTreeCollisionAddFace NewtonTreeCollisionAddFace; + da_NewtonTreeCollisionEndBuild NewtonTreeCollisionEndBuild; + da_NewtonTreeCollisionGetFaceAttribute NewtonTreeCollisionGetFaceAttribute; + da_NewtonTreeCollisionSetFaceAttribute NewtonTreeCollisionSetFaceAttribute; + da_NewtonTreeCollisionForEachFace NewtonTreeCollisionForEachFace; + da_NewtonTreeCollisionGetVertexListTriangleListInAABB NewtonTreeCollisionGetVertexListTriangleListInAABB; + da_NewtonStaticCollisionSetDebugCallback NewtonStaticCollisionSetDebugCallback; + + da_NewtonCollisionCreateInstance NewtonCollisionCreateInstance; + da_NewtonCollisionGetType NewtonCollisionGetType; + da_NewtonCollisionIsConvexShape NewtonCollisionIsConvexShape; + da_NewtonCollisionIsStaticShape NewtonCollisionIsStaticShape; + + da_NewtonCollisionSetUserData NewtonCollisionSetUserData; + da_NewtonCollisionGetUserData NewtonCollisionGetUserData; + da_NewtonCollisionSetUserID NewtonCollisionSetUserID; + da_NewtonCollisionGetUserID NewtonCollisionGetUserID; + da_NewtonCollisionGetMaterial NewtonCollisionGetMaterial; + da_NewtonCollisionSetMaterial NewtonCollisionSetMaterial; + da_NewtonCollisionGetSubCollisionHandle NewtonCollisionGetSubCollisionHandle; + da_NewtonCollisionGetParentInstance NewtonCollisionGetParentInstance; + da_NewtonCollisionSetMatrix NewtonCollisionSetMatrix; + da_NewtonCollisionGetMatrix NewtonCollisionGetMatrix; + da_NewtonCollisionSetScale NewtonCollisionSetScale; + da_NewtonCollisionGetScale NewtonCollisionGetScale; + da_NewtonDestroyCollision NewtonDestroyCollision; + da_NewtonCollisionGetSkinThickness NewtonCollisionGetSkinThickness; + da_NewtonCollisionSetSkinThickness NewtonCollisionSetSkinThickness; + da_NewtonCollisionIntersectionTest NewtonCollisionIntersectionTest; + da_NewtonCollisionPointDistance NewtonCollisionPointDistance; + da_NewtonCollisionClosestPoint NewtonCollisionClosestPoint; + da_NewtonCollisionCollide NewtonCollisionCollide; + da_NewtonCollisionCollideContinue NewtonCollisionCollideContinue; + da_NewtonCollisionSupportVertex NewtonCollisionSupportVertex; + da_NewtonCollisionRayCast NewtonCollisionRayCast; + da_NewtonCollisionCalculateAABB NewtonCollisionCalculateAABB; + da_NewtonCollisionForEachPolygonDo NewtonCollisionForEachPolygonDo; + + da_NewtonCollisionAggregateCreate NewtonCollisionAggregateCreate; + da_NewtonCollisionAggregateDestroy NewtonCollisionAggregateDestroy; + da_NewtonCollisionAggregateAddBody NewtonCollisionAggregateAddBody; + da_NewtonCollisionAggregateRemoveBody NewtonCollisionAggregateRemoveBody; + da_NewtonCollisionAggregateGetSelfCollision NewtonCollisionAggregateGetSelfCollision; + da_NewtonCollisionAggregateSetSelfCollision NewtonCollisionAggregateSetSelfCollision; + + da_NewtonSetEulerAngle NewtonSetEulerAngle; + da_NewtonGetEulerAngle NewtonGetEulerAngle; + da_NewtonCalculateSpringDamperAcceleration NewtonCalculateSpringDamperAcceleration; + + da_NewtonCreateDynamicBody NewtonCreateDynamicBody; + da_NewtonCreateKinematicBody NewtonCreateKinematicBody; + da_NewtonDestroyBody NewtonDestroyBody; + da_NewtonBodyGetSimulationState NewtonBodyGetSimulationState; + da_NewtonBodySetSimulationState NewtonBodySetSimulationState; + da_NewtonBodyGetType NewtonBodyGetType; + da_NewtonBodyGetCollidable NewtonBodyGetCollidable; + da_NewtonBodySetCollidable NewtonBodySetCollidable; + da_NewtonBodyAddForce NewtonBodyAddForce; + da_NewtonBodyAddTorque NewtonBodyAddTorque; + da_NewtonBodyCalculateInverseDynamicsForce NewtonBodyCalculateInverseDynamicsForce; + da_NewtonBodySetCentreOfMass NewtonBodySetCentreOfMass; + da_NewtonBodySetMassMatrix NewtonBodySetMassMatrix; + da_NewtonBodySetFullMassMatrix NewtonBodySetFullMassMatrix; + da_NewtonBodySetMassProperties NewtonBodySetMassProperties; + da_NewtonBodySetMatrix NewtonBodySetMatrix; + da_NewtonBodySetMatrixNoSleep NewtonBodySetMatrixNoSleep; + da_NewtonBodySetMatrixRecursive NewtonBodySetMatrixRecursive; + da_NewtonBodySetMaterialGroupID NewtonBodySetMaterialGroupID; + da_NewtonBodySetContinuousCollisionMode NewtonBodySetContinuousCollisionMode; + da_NewtonBodySetJointRecursiveCollision NewtonBodySetJointRecursiveCollision; + da_NewtonBodySetOmega NewtonBodySetOmega; + da_NewtonBodySetOmegaNoSleep NewtonBodySetOmegaNoSleep; + da_NewtonBodySetVelocity NewtonBodySetVelocity; + da_NewtonBodySetVelocityNoSleep NewtonBodySetVelocityNoSleep; + da_NewtonBodySetForce NewtonBodySetForce; + da_NewtonBodySetTorque NewtonBodySetTorque; + da_NewtonBodySetLinearDamping NewtonBodySetLinearDamping; + da_NewtonBodySetAngularDamping NewtonBodySetAngularDamping; + da_NewtonBodySetCollision NewtonBodySetCollision; + da_NewtonBodySetCollisionScale NewtonBodySetCollisionScale; + da_NewtonBodyGetSleepState NewtonBodyGetSleepState; + da_NewtonBodySetSleepState NewtonBodySetSleepState; + da_NewtonBodyGetAutoSleep NewtonBodyGetAutoSleep; + da_NewtonBodySetAutoSleep NewtonBodySetAutoSleep; + da_NewtonBodyGetFreezeState NewtonBodyGetFreezeState; + da_NewtonBodySetFreezeState NewtonBodySetFreezeState; + //da_NewtonBodyGetGyroscopicTorque NewtonBodyGetGyroscopicTorque; + //da_NewtonBodySetGyroscopicTorque NewtonBodySetGyroscopicTorque; + da_NewtonBodySetDestructorCallback NewtonBodySetDestructorCallback; + da_NewtonBodyGetDestructorCallback NewtonBodyGetDestructorCallback; + da_NewtonBodySetTransformCallback NewtonBodySetTransformCallback; + da_NewtonBodyGetTransformCallback NewtonBodyGetTransformCallback; + da_NewtonBodySetForceAndTorqueCallback NewtonBodySetForceAndTorqueCallback; + da_NewtonBodyGetForceAndTorqueCallback NewtonBodyGetForceAndTorqueCallback; + da_NewtonBodyGetID NewtonBodyGetID; + da_NewtonBodySetUserData NewtonBodySetUserData; + da_NewtonBodyGetUserData NewtonBodyGetUserData; + da_NewtonBodyGetWorld NewtonBodyGetWorld; + da_NewtonBodyGetCollision NewtonBodyGetCollision; + da_NewtonBodyGetMaterialGroupID NewtonBodyGetMaterialGroupID; + da_NewtonBodyGetSerializedID NewtonBodyGetSerializedID; + da_NewtonBodyGetContinuousCollisionMode NewtonBodyGetContinuousCollisionMode; + da_NewtonBodyGetJointRecursiveCollision NewtonBodyGetJointRecursiveCollision; + da_NewtonBodyGetPosition NewtonBodyGetPosition; + da_NewtonBodyGetMatrix NewtonBodyGetMatrix; + da_NewtonBodyGetRotation NewtonBodyGetRotation; + da_NewtonBodyGetMass NewtonBodyGetMass; + da_NewtonBodyGetInvMass NewtonBodyGetInvMass; + da_NewtonBodyGetInertiaMatrix NewtonBodyGetInertiaMatrix; + da_NewtonBodyGetInvInertiaMatrix NewtonBodyGetInvInertiaMatrix; + da_NewtonBodyGetOmega NewtonBodyGetOmega; + da_NewtonBodyGetVelocity NewtonBodyGetVelocity; + da_NewtonBodyGetAlpha NewtonBodyGetAlpha; + da_NewtonBodyGetAcceleration NewtonBodyGetAcceleration; + da_NewtonBodyGetForce NewtonBodyGetForce; + da_NewtonBodyGetTorque NewtonBodyGetTorque; + da_NewtonBodyGetCentreOfMass NewtonBodyGetCentreOfMass; + da_NewtonBodyGetPointVelocity NewtonBodyGetPointVelocity; + da_NewtonBodyApplyImpulsePair NewtonBodyApplyImpulsePair; + da_NewtonBodyAddImpulse NewtonBodyAddImpulse; + da_NewtonBodyApplyImpulseArray NewtonBodyApplyImpulseArray; + da_NewtonBodyIntegrateVelocity NewtonBodyIntegrateVelocity; + da_NewtonBodyGetLinearDamping NewtonBodyGetLinearDamping; + da_NewtonBodyGetAngularDamping NewtonBodyGetAngularDamping; + da_NewtonBodyGetAABB NewtonBodyGetAABB; + da_NewtonBodyGetFirstJoint NewtonBodyGetFirstJoint; + da_NewtonBodyGetNextJoint NewtonBodyGetNextJoint; + da_NewtonBodyGetFirstContactJoint NewtonBodyGetFirstContactJoint; + da_NewtonBodyGetNextContactJoint NewtonBodyGetNextContactJoint; + da_NewtonBodyFindContact NewtonBodyFindContact; + + da_NewtonContactJointGetFirstContact NewtonContactJointGetFirstContact; + da_NewtonContactJointGetNextContact NewtonContactJointGetNextContact; + da_NewtonContactJointGetContactCount NewtonContactJointGetContactCount; + da_NewtonContactJointRemoveContact NewtonContactJointRemoveContact; + da_NewtonContactJointGetClosestDistance NewtonContactJointGetClosestDistance; + da_NewtonContactJointResetSelftJointCollision NewtonContactJointResetSelftJointCollision; + da_NewtonContactJointResetIntraJointCollision NewtonContactJointResetIntraJointCollision; + da_NewtonContactGetMaterial NewtonContactGetMaterial; + da_NewtonContactGetCollision0 NewtonContactGetCollision0; + da_NewtonContactGetCollision1 NewtonContactGetCollision1; + da_NewtonContactGetCollisionID0 NewtonContactGetCollisionID0; + da_NewtonContactGetCollisionID1 NewtonContactGetCollisionID1; + + da_NewtonJointGetUserData NewtonJointGetUserData; + da_NewtonJointSetUserData NewtonJointSetUserData; + da_NewtonJointGetBody0 NewtonJointGetBody0; + da_NewtonJointGetBody1 NewtonJointGetBody1; + da_NewtonJointGetInfo NewtonJointGetInfo; + da_NewtonJointGetCollisionState NewtonJointGetCollisionState; + da_NewtonJointSetCollisionState NewtonJointSetCollisionState; + da_NewtonJointGetStiffness NewtonJointGetStiffness; + da_NewtonJointSetStiffness NewtonJointSetStiffness; + da_NewtonDestroyJoint NewtonDestroyJoint; + da_NewtonJointSetDestructor NewtonJointSetDestructor; + da_NewtonJointIsActive NewtonJointIsActive; + + da_NewtonCreateInverseDynamics NewtonCreateInverseDynamics; + da_NewtonInverseDynamicsDestroy NewtonInverseDynamicsDestroy; + da_NewtonInverseDynamicsGetRoot NewtonInverseDynamicsGetRoot; + da_NewtonInverseDynamicsGetNextChildNode NewtonInverseDynamicsGetNextChildNode; + da_NewtonInverseDynamicsGetFirstChildNode NewtonInverseDynamicsGetFirstChildNode; + da_NewtonInverseDynamicsGetBody NewtonInverseDynamicsGetBody; + da_NewtonInverseDynamicsGetJoint NewtonInverseDynamicsGetJoint; + da_NewtonInverseDynamicsCreateEffector NewtonInverseDynamicsCreateEffector; + da_NewtonInverseDynamicsDestroyEffector NewtonInverseDynamicsDestroyEffector; + da_NewtonInverseDynamicsAddRoot NewtonInverseDynamicsAddRoot; + da_NewtonInverseDynamicsAddChildNode NewtonInverseDynamicsAddChildNode; + da_NewtonInverseDynamicsAddLoopJoint NewtonInverseDynamicsAddLoopJoint; + da_NewtonInverseDynamicsEndBuild NewtonInverseDynamicsEndBuild; + da_NewtonInverseDynamicsUpdate NewtonInverseDynamicsUpdate; + + da_NewtonCreateMassSpringDamperSystem NewtonCreateMassSpringDamperSystem; + da_NewtonCreateDeformableSolid NewtonCreateDeformableSolid; + da_NewtonDeformableMeshGetParticleCount NewtonDeformableMeshGetParticleCount; + da_NewtonDeformableMeshGetParticleStrideInBytes NewtonDeformableMeshGetParticleStrideInBytes; + da_NewtonDeformableMeshGetParticleArray NewtonDeformableMeshGetParticleArray; + + da_NewtonConstraintCreateBall NewtonConstraintCreateBall; + da_NewtonBallSetUserCallback NewtonBallSetUserCallback; + da_NewtonBallGetJointAngle NewtonBallGetJointAngle; + da_NewtonBallGetJointOmega NewtonBallGetJointOmega; + da_NewtonBallGetJointForce NewtonBallGetJointForce; + da_NewtonBallSetConeLimits NewtonBallSetConeLimits; + + // da_NewtonConstraintCreateHinge NewtonConstraintCreateHinge; + // da_NewtonHingeSetUserCallback NewtonHingeSetUserCallback; + // da_NewtonHingeGetJointAngle NewtonHingeGetJointAngle; + // da_NewtonHingeGetJointOmega NewtonHingeGetJointOmega; + // da_NewtonHingeGetJointForce NewtonHingeGetJointForce; + // da_NewtonHingeCalculateStopAlpha NewtonHingeCalculateStopAlpha; + + da_NewtonConstraintCreateSlider NewtonConstraintCreateSlider; + da_NewtonSliderSetUserCallback NewtonSliderSetUserCallback; + da_NewtonSliderGetJointPosit NewtonSliderGetJointPosit; + da_NewtonSliderGetJointVeloc NewtonSliderGetJointVeloc; + da_NewtonSliderGetJointForce NewtonSliderGetJointForce; + da_NewtonSliderCalculateStopAccel NewtonSliderCalculateStopAccel; + + da_NewtonConstraintCreateCorkscrew NewtonConstraintCreateCorkscrew; + da_NewtonCorkscrewSetUserCallback NewtonCorkscrewSetUserCallback; + da_NewtonCorkscrewGetJointPosit NewtonCorkscrewGetJointPosit; + da_NewtonCorkscrewGetJointAngle NewtonCorkscrewGetJointAngle; + da_NewtonCorkscrewGetJointVeloc NewtonCorkscrewGetJointVeloc; + da_NewtonCorkscrewGetJointOmega NewtonCorkscrewGetJointOmega; + da_NewtonCorkscrewGetJointForce NewtonCorkscrewGetJointForce; + da_NewtonCorkscrewCalculateStopAlpha NewtonCorkscrewCalculateStopAlpha; + da_NewtonCorkscrewCalculateStopAccel NewtonCorkscrewCalculateStopAccel; + + da_NewtonConstraintCreateUniversal NewtonConstraintCreateUniversal; + da_NewtonUniversalSetUserCallback NewtonUniversalSetUserCallback; + da_NewtonUniversalGetJointAngle0 NewtonUniversalGetJointAngle0; + da_NewtonUniversalGetJointAngle1 NewtonUniversalGetJointAngle1; + da_NewtonUniversalGetJointOmega0 NewtonUniversalGetJointOmega0; + da_NewtonUniversalGetJointOmega1 NewtonUniversalGetJointOmega1; + da_NewtonUniversalGetJointForce NewtonUniversalGetJointForce; + da_NewtonUniversalCalculateStopAlpha0 NewtonUniversalCalculateStopAlpha0; + da_NewtonUniversalCalculateStopAlpha1 NewtonUniversalCalculateStopAlpha1; + + da_NewtonConstraintCreateUpVector NewtonConstraintCreateUpVector; + da_NewtonUpVectorGetPin NewtonUpVectorGetPin; + da_NewtonUpVectorSetPin NewtonUpVectorSetPin; + + da_NewtonConstraintCreateUserJoint NewtonConstraintCreateUserJoint; + da_NewtonUserJointGetSolverModel NewtonUserJointGetSolverModel; + da_NewtonUserJointSetSolverModel NewtonUserJointSetSolverModel; + da_NewtonUserJointSetFeedbackCollectorCallback NewtonUserJointSetFeedbackCollectorCallback; + da_NewtonUserJointAddLinearRow NewtonUserJointAddLinearRow; + da_NewtonUserJointAddAngularRow NewtonUserJointAddAngularRow; + da_NewtonUserJointAddGeneralRow NewtonUserJointAddGeneralRow; + da_NewtonUserJointSetRowMinimumFriction NewtonUserJointSetRowMinimumFriction; + da_NewtonUserJointSetRowMaximumFriction NewtonUserJointSetRowMaximumFriction; + da_NewtonUserJointCalculateRowZeroAccelaration NewtonUserJointCalculateRowZeroAccelaration; + da_NewtonUserJointGetRowAcceleration NewtonUserJointGetRowAcceleration; + da_NewtonUserJointSetRowAsInverseDynamics NewtonUserJointSetRowAsInverseDynamics; + da_NewtonUserJointSetRowAcceleration NewtonUserJointSetRowAcceleration; + da_NewtonUserJointSetRowSpringDamperAcceleration NewtonUserJointSetRowSpringDamperAcceleration; + da_NewtonUserJointSetRowStiffness NewtonUserJointSetRowStiffness; + da_NewtonUserJoinRowsCount NewtonUserJoinRowsCount; + da_NewtonUserJointGetGeneralRow NewtonUserJointGetGeneralRow; + da_NewtonUserJointGetRowForce NewtonUserJointGetRowForce; + da_NewtonUserJointSubmitImmediateModeConstraint NewtonUserJointSubmitImmediateModeConstraint; + + da_NewtonMeshCreate NewtonMeshCreate; + da_NewtonMeshCreateFromMesh NewtonMeshCreateFromMesh; + da_NewtonMeshCreateFromCollision NewtonMeshCreateFromCollision; + da_NewtonMeshCreateTetrahedraIsoSurface NewtonMeshCreateTetrahedraIsoSurface; + da_NewtonMeshCreateConvexHull NewtonMeshCreateConvexHull; + da_NewtonMeshCreateVoronoiConvexDecomposition NewtonMeshCreateVoronoiConvexDecomposition; + da_NewtonMeshCreateFromSerialization NewtonMeshCreateFromSerialization; + da_NewtonMeshDestroy NewtonMeshDestroy; + da_NewtonMeshSerialize NewtonMeshSerialize; + da_NewtonMeshSaveOFF NewtonMeshSaveOFF; + da_NewtonMeshLoadOFF NewtonMeshLoadOFF; + da_NewtonMeshLoadTetrahedraMesh NewtonMeshLoadTetrahedraMesh; + da_NewtonMeshApplyTransform NewtonMeshApplyTransform; + da_NewtonMeshCalculateOOBB NewtonMeshCalculateOOBB; + da_NewtonMeshCalculateVertexNormals NewtonMeshCalculateVertexNormals; + da_NewtonMeshApplySphericalMapping NewtonMeshApplySphericalMapping; + da_NewtonMeshApplyCylindricalMapping NewtonMeshApplyCylindricalMapping; + da_NewtonMeshApplyBoxMapping NewtonMeshApplyBoxMapping; + da_NewtonMeshApplyAngleBasedMapping NewtonMeshApplyAngleBasedMapping; + da_NewtonCreateTetrahedraLinearBlendSkinWeightsChannel NewtonCreateTetrahedraLinearBlendSkinWeightsChannel; + da_NewtonMeshOptimize NewtonMeshOptimize; + da_NewtonMeshOptimizePoints NewtonMeshOptimizePoints; + da_NewtonMeshOptimizeVertex NewtonMeshOptimizeVertex; + da_NewtonMeshIsOpenMesh NewtonMeshIsOpenMesh; + da_NewtonMeshFixTJoints NewtonMeshFixTJoints; + da_NewtonMeshPolygonize NewtonMeshPolygonize; + da_NewtonMeshTriangulate NewtonMeshTriangulate; + da_NewtonMeshUnion NewtonMeshUnion; + da_NewtonMeshDifference NewtonMeshDifference; + da_NewtonMeshIntersection NewtonMeshIntersection; + da_NewtonMeshClip NewtonMeshClip; + da_NewtonMeshConvexMeshIntersection NewtonMeshConvexMeshIntersection; + da_NewtonMeshSimplify NewtonMeshSimplify; + da_NewtonMeshApproximateConvexDecomposition NewtonMeshApproximateConvexDecomposition; + da_NewtonRemoveUnusedVertices NewtonRemoveUnusedVertices; + da_NewtonMeshBeginBuild NewtonMeshBeginBuild; + da_NewtonMeshBeginFace NewtonMeshBeginFace; + da_NewtonMeshAddPoint NewtonMeshAddPoint; + da_NewtonMeshAddLayer NewtonMeshAddLayer; + da_NewtonMeshAddMaterial NewtonMeshAddMaterial; + da_NewtonMeshAddNormal NewtonMeshAddNormal; + da_NewtonMeshAddBinormal NewtonMeshAddBinormal; + da_NewtonMeshAddUV0 NewtonMeshAddUV0; + da_NewtonMeshAddUV1 NewtonMeshAddUV1; + da_NewtonMeshEndFace NewtonMeshEndFace; + da_NewtonMeshEndBuild NewtonMeshEndBuild; + da_NewtonMeshClearVertexFormat NewtonMeshClearVertexFormat; + da_NewtonMeshBuildFromVertexListIndexList NewtonMeshBuildFromVertexListIndexList; + da_NewtonMeshGetPointCount NewtonMeshGetPointCount; + da_NewtonMeshGetIndexToVertexMap NewtonMeshGetIndexToVertexMap; + da_NewtonMeshGetVertexDoubleChannel NewtonMeshGetVertexDoubleChannel; + da_NewtonMeshGetVertexChannel NewtonMeshGetVertexChannel; + da_NewtonMeshGetNormalChannel NewtonMeshGetNormalChannel; + da_NewtonMeshGetBinormalChannel NewtonMeshGetBinormalChannel; + da_NewtonMeshGetUV0Channel NewtonMeshGetUV0Channel; + da_NewtonMeshGetUV1Channel NewtonMeshGetUV1Channel; + da_NewtonMeshGetVertexColorChannel NewtonMeshGetVertexColorChannel; + da_NewtonMeshHasNormalChannel NewtonMeshHasNormalChannel; + da_NewtonMeshHasBinormalChannel NewtonMeshHasBinormalChannel; + da_NewtonMeshHasUV0Channel NewtonMeshHasUV0Channel; + da_NewtonMeshHasUV1Channel NewtonMeshHasUV1Channel; + da_NewtonMeshHasVertexColorChannel NewtonMeshHasVertexColorChannel; + da_NewtonMeshBeginHandle NewtonMeshBeginHandle; + da_NewtonMeshEndHandle NewtonMeshEndHandle; + da_NewtonMeshFirstMaterial NewtonMeshFirstMaterial; + da_NewtonMeshNextMaterial NewtonMeshNextMaterial; + da_NewtonMeshMaterialGetMaterial NewtonMeshMaterialGetMaterial; + da_NewtonMeshMaterialGetIndexCount NewtonMeshMaterialGetIndexCount; + da_NewtonMeshMaterialGetIndexStream NewtonMeshMaterialGetIndexStream; + da_NewtonMeshMaterialGetIndexStreamShort NewtonMeshMaterialGetIndexStreamShort; + da_NewtonMeshCreateFirstSingleSegment NewtonMeshCreateFirstSingleSegment; + da_NewtonMeshCreateNextSingleSegment NewtonMeshCreateNextSingleSegment; + da_NewtonMeshCreateFirstLayer NewtonMeshCreateFirstLayer; + da_NewtonMeshCreateNextLayer NewtonMeshCreateNextLayer; + da_NewtonMeshGetTotalFaceCount NewtonMeshGetTotalFaceCount; + da_NewtonMeshGetTotalIndexCount NewtonMeshGetTotalIndexCount; + da_NewtonMeshGetFaces NewtonMeshGetFaces; + da_NewtonMeshGetVertexCount NewtonMeshGetVertexCount; + da_NewtonMeshGetVertexStrideInByte NewtonMeshGetVertexStrideInByte; + da_NewtonMeshGetVertexArray NewtonMeshGetVertexArray; + da_NewtonMeshGetFirstVertex NewtonMeshGetFirstVertex; + da_NewtonMeshGetNextVertex NewtonMeshGetNextVertex; + da_NewtonMeshGetVertexIndex NewtonMeshGetVertexIndex; + da_NewtonMeshGetFirstPoint NewtonMeshGetFirstPoint; + da_NewtonMeshGetNextPoint NewtonMeshGetNextPoint; + da_NewtonMeshGetPointIndex NewtonMeshGetPointIndex; + da_NewtonMeshGetVertexIndexFromPoint NewtonMeshGetVertexIndexFromPoint; + da_NewtonMeshGetFirstEdge NewtonMeshGetFirstEdge; + da_NewtonMeshGetNextEdge NewtonMeshGetNextEdge; + da_NewtonMeshGetEdgeIndices NewtonMeshGetEdgeIndices; + da_NewtonMeshGetFirstFace NewtonMeshGetFirstFace; + da_NewtonMeshGetNextFace NewtonMeshGetNextFace; + da_NewtonMeshIsFaceOpen NewtonMeshIsFaceOpen; + da_NewtonMeshGetFaceMaterial NewtonMeshGetFaceMaterial; + da_NewtonMeshGetFaceIndexCount NewtonMeshGetFaceIndexCount; + da_NewtonMeshGetFaceIndices NewtonMeshGetFaceIndices; + da_NewtonMeshGetFacePointIndices NewtonMeshGetFacePointIndices; + da_NewtonMeshCalculateFaceNormal NewtonMeshCalculateFaceNormal; + da_NewtonMeshSetFaceMaterial NewtonMeshSetFaceMaterial; +} + +private +{ + SharedLib lib; + NewtonSupport loadedVersion; +} + +void unloadNewton() +{ + if (lib != invalidHandle) + { + lib.unload(); + } +} + +NewtonSupport loadedNewtonVersion() { return loadedVersion; } +bool isNewtonLoaded() { return lib != invalidHandle; } + +NewtonSupport loadNewton() +{ + version(Windows) + { + const(char)[][1] libNames = + [ + "newton.dll" + ]; + } + else version(OSX) + { + const(char)[][1] libNames = + [ + "/usr/local/lib/libnewton.dylib" + ]; + } + else version(Posix) + { + const(char)[][1] libNames = + [ + "libnewton.so" + ]; + } + else static assert(0, "bindbc-newton is not yet supported on this platform."); + + NewtonSupport ret; + foreach(name; libNames) + { + ret = loadNewton(name.ptr); + if (ret != NewtonSupport.noLibrary) + break; + } + return ret; +} + +NewtonSupport loadNewton(const(char)* libName) +{ + lib = load(libName); + if(lib == invalidHandle) + { + return NewtonSupport.noLibrary; + } + + auto errCount = errorCount(); + loadedVersion = NewtonSupport.badLibrary; + + // World + lib.bindSymbol(cast(void**)&NewtonWorldGetVersion, "NewtonWorldGetVersion"); + lib.bindSymbol(cast(void**)&NewtonWorldFloatSize, "NewtonWorldFloatSize"); + lib.bindSymbol(cast(void**)&NewtonGetMemoryUsed, "NewtonGetMemoryUsed"); + lib.bindSymbol(cast(void**)&NewtonSetMemorySystem, "NewtonSetMemorySystem"); + lib.bindSymbol(cast(void**)&NewtonCreate, "NewtonCreate"); + lib.bindSymbol(cast(void**)&NewtonDestroy, "NewtonDestroy"); + lib.bindSymbol(cast(void**)&NewtonDestroyAllBodies, "NewtonDestroyAllBodies"); + //lib.bindSymbol(cast(void**)&NewtonSetPosUpdateCallback, "NewtonSetPosUpdateCallback"); + lib.bindSymbol(cast(void**)&NewtonAlloc, "NewtonAlloc"); + lib.bindSymbol(cast(void**)&NewtonFree, "NewtonFree"); + lib.bindSymbol(cast(void**)&NewtonLoadPlugins, "NewtonLoadPlugins"); + lib.bindSymbol(cast(void**)&NewtonUnloadPlugins, "NewtonUnloadPlugins"); + lib.bindSymbol(cast(void**)&NewtonCurrentPlugin, "NewtonCurrentPlugin"); + lib.bindSymbol(cast(void**)&NewtonGetFirstPlugin, "NewtonGetFirstPlugin"); + lib.bindSymbol(cast(void**)&NewtonGetPreferedPlugin, "NewtonGetPreferedPlugin"); + lib.bindSymbol(cast(void**)&NewtonGetPreferedPlugin, "NewtonGetPreferedPlugin"); + lib.bindSymbol(cast(void**)&NewtonGetNextPlugin, "NewtonGetNextPlugin"); + lib.bindSymbol(cast(void**)&NewtonGetPluginString, "NewtonGetPluginString"); + lib.bindSymbol(cast(void**)&NewtonSelectPlugin, "NewtonSelectPlugin"); + lib.bindSymbol(cast(void**)&NewtonGetContactMergeTolerance, "NewtonGetContactMergeTolerance"); + lib.bindSymbol(cast(void**)&NewtonSetContactMergeTolerance, "NewtonSetContactMergeTolerance"); + lib.bindSymbol(cast(void**)&NewtonInvalidateCache, "NewtonInvalidateCache"); + lib.bindSymbol(cast(void**)&NewtonSetSolverIterations, "NewtonSetSolverIterations"); + lib.bindSymbol(cast(void**)&NewtonGetSolverIterations, "NewtonGetSolverIterations"); + //lib.bindSymbol(cast(void**)&NewtonSetMultiThreadSolverOnSingleIsland, "NewtonSetMultiThreadSolverOnSingleIsland"); + //lib.bindSymbol(cast(void**)&NewtonGetMultiThreadSolverOnSingleIsland, "NewtonGetMultiThreadSolverOnSingleIsland"); + lib.bindSymbol(cast(void**)&NewtonGetBroadphaseAlgorithm, "NewtonGetBroadphaseAlgorithm"); + lib.bindSymbol(cast(void**)&NewtonSelectBroadphaseAlgorithm, "NewtonSelectBroadphaseAlgorithm"); + lib.bindSymbol(cast(void**)&NewtonResetBroadphase, "NewtonResetBroadphase"); + lib.bindSymbol(cast(void**)&NewtonUpdate, "NewtonUpdate"); + lib.bindSymbol(cast(void**)&NewtonUpdateAsync, "NewtonUpdateAsync"); + lib.bindSymbol(cast(void**)&NewtonWaitForUpdateToFinish, "NewtonWaitForUpdateToFinish"); + lib.bindSymbol(cast(void**)&NewtonGetNumberOfSubsteps, "NewtonGetNumberOfSubsteps"); + lib.bindSymbol(cast(void**)&NewtonSetNumberOfSubsteps, "NewtonSetNumberOfSubsteps"); + lib.bindSymbol(cast(void**)&NewtonGetLastUpdateTime, "NewtonGetLastUpdateTime"); + lib.bindSymbol(cast(void**)&NewtonSerializeToFile, "NewtonSerializeToFile"); + lib.bindSymbol(cast(void**)&NewtonDeserializeFromFile, "NewtonDeserializeFromFile"); + lib.bindSymbol(cast(void**)&NewtonSerializeScene, "NewtonSerializeScene"); + lib.bindSymbol(cast(void**)&NewtonDeserializeScene, "NewtonDeserializeScene"); + lib.bindSymbol(cast(void**)&NewtonFindSerializedBody, "NewtonFindSerializedBody"); + lib.bindSymbol(cast(void**)&NewtonSetJointSerializationCallbacks, "NewtonSetJointSerializationCallbacks"); + lib.bindSymbol(cast(void**)&NewtonGetJointSerializationCallbacks, "NewtonGetJointSerializationCallbacks"); + + // Multithreading + lib.bindSymbol(cast(void**)&NewtonWorldCriticalSectionLock, "NewtonWorldCriticalSectionLock"); + lib.bindSymbol(cast(void**)&NewtonWorldCriticalSectionUnlock, "NewtonWorldCriticalSectionUnlock"); + lib.bindSymbol(cast(void**)&NewtonSetThreadsCount, "NewtonSetThreadsCount"); + lib.bindSymbol(cast(void**)&NewtonGetThreadsCount, "NewtonGetThreadsCount"); + lib.bindSymbol(cast(void**)&NewtonGetMaxThreadsCount, "NewtonGetMaxThreadsCount"); + lib.bindSymbol(cast(void**)&NewtonDispachThreadJob, "NewtonDispachThreadJob"); + lib.bindSymbol(cast(void**)&NewtonSyncThreadJobs, "NewtonSyncThreadJobs"); + lib.bindSymbol(cast(void**)&NewtonAtomicAdd, "NewtonAtomicAdd"); + lib.bindSymbol(cast(void**)&NewtonAtomicSwap, "NewtonAtomicSwap"); + lib.bindSymbol(cast(void**)&NewtonYield, "NewtonYield"); + + lib.bindSymbol(cast(void**)&NewtonSetIslandUpdateEvent, "NewtonSetIslandUpdateEvent"); + lib.bindSymbol(cast(void**)&NewtonWorldForEachJointDo, "NewtonWorldForEachJointDo"); + lib.bindSymbol(cast(void**)&NewtonWorldForEachBodyInAABBDo, "NewtonWorldForEachBodyInAABBDo"); + lib.bindSymbol(cast(void**)&NewtonWorldGetUserData, "NewtonWorldGetUserData"); + lib.bindSymbol(cast(void**)&NewtonWorldAddListener, "NewtonWorldAddListener"); + lib.bindSymbol(cast(void**)&NewtonWorldGetListener, "NewtonWorldGetListener"); + lib.bindSymbol(cast(void**)&NewtonWorldListenerSetDestructorCallback, "NewtonWorldListenerSetDestructorCallback"); + lib.bindSymbol(cast(void**)&NewtonWorldListenerSetPreUpdateCallback, "NewtonWorldListenerSetPreUpdateCallback"); + lib.bindSymbol(cast(void**)&NewtonWorldListenerSetPostUpdateCallback, "NewtonWorldListenerSetPostUpdateCallback"); + lib.bindSymbol(cast(void**)&NewtonWorldListenerSetDebugCallback, "NewtonWorldListenerSetDebugCallback"); + lib.bindSymbol(cast(void**)&NewtonWorldListenerSetBodyDestroyCallback, "NewtonWorldListenerSetBodyDestroyCallback"); + lib.bindSymbol(cast(void**)&NewtonWorldListenerDebug, "NewtonWorldListenerDebug"); + lib.bindSymbol(cast(void**)&NewtonWorldGetListenerUserData, "NewtonWorldGetListenerUserData"); + lib.bindSymbol(cast(void**)&NewtonWorldListenerGetBodyDestroyCallback, "NewtonWorldListenerGetBodyDestroyCallback"); + lib.bindSymbol(cast(void**)&NewtonWorldSetDestructorCallback, "NewtonWorldSetDestructorCallback"); + lib.bindSymbol(cast(void**)&NewtonWorldGetDestructorCallback, "NewtonWorldGetDestructorCallback"); + lib.bindSymbol(cast(void**)&NewtonWorldSetCollisionConstructorDestructorCallback, "NewtonWorldSetCollisionConstructorDestructorCallback"); + lib.bindSymbol(cast(void**)&NewtonWorldRayCast, "NewtonWorldRayCast"); + lib.bindSymbol(cast(void**)&NewtonWorldConvexCast, "NewtonWorldConvexCast"); + lib.bindSymbol(cast(void**)&NewtonWorldCollide, "NewtonWorldCollide"); + + lib.bindSymbol(cast(void**)&NewtonWorldGetBodyCount, "NewtonWorldGetBodyCount"); + lib.bindSymbol(cast(void**)&NewtonWorldGetConstraintCount, "NewtonWorldGetConstraintCount"); + + // Island + lib.bindSymbol(cast(void**)&NewtonIslandGetBody, "NewtonIslandGetBody"); + lib.bindSymbol(cast(void**)&NewtonIslandGetBodyAABB, "NewtonIslandGetBodyAABB"); + + // Material + lib.bindSymbol(cast(void**)&NewtonMaterialCreateGroupID, "NewtonMaterialCreateGroupID"); + lib.bindSymbol(cast(void**)&NewtonMaterialGetDefaultGroupID, "NewtonMaterialGetDefaultGroupID"); + lib.bindSymbol(cast(void**)&NewtonMaterialDestroyAllGroupID, "NewtonMaterialDestroyAllGroupID"); + lib.bindSymbol(cast(void**)&NewtonMaterialGetUserData, "NewtonMaterialGetUserData"); + lib.bindSymbol(cast(void**)&NewtonMaterialSetSurfaceThickness, "NewtonMaterialSetSurfaceThickness"); + lib.bindSymbol(cast(void**)&NewtonMaterialSetCallbackUserData, "NewtonMaterialSetCallbackUserData"); + lib.bindSymbol(cast(void**)&NewtonMaterialSetContactGenerationCallback, "NewtonMaterialSetContactGenerationCallback"); + lib.bindSymbol(cast(void**)&NewtonMaterialSetCompoundCollisionCallback, "NewtonMaterialSetCompoundCollisionCallback"); + lib.bindSymbol(cast(void**)&NewtonMaterialSetCollisionCallback, "NewtonMaterialSetCollisionCallback"); + lib.bindSymbol(cast(void**)&NewtonMaterialSetDefaultSoftness, "NewtonMaterialSetDefaultSoftness"); + lib.bindSymbol(cast(void**)&NewtonMaterialSetDefaultElasticity, "NewtonMaterialSetDefaultElasticity"); + lib.bindSymbol(cast(void**)&NewtonMaterialSetDefaultCollidable, "NewtonMaterialSetDefaultCollidable"); + lib.bindSymbol(cast(void**)&NewtonMaterialSetDefaultFriction, "NewtonMaterialSetDefaultFriction"); + lib.bindSymbol(cast(void**)&NewtonWorldGetFirstMaterial, "NewtonWorldGetFirstMaterial"); + lib.bindSymbol(cast(void**)&NewtonWorldGetNextMaterial, "NewtonWorldGetNextMaterial"); + lib.bindSymbol(cast(void**)&NewtonWorldGetFirstBody, "NewtonWorldGetFirstBody"); + lib.bindSymbol(cast(void**)&NewtonWorldGetNextBody, "NewtonWorldGetNextBody"); + + lib.bindSymbol(cast(void**)&NewtonMaterialGetMaterialPairUserData, "NewtonMaterialGetMaterialPairUserData"); + lib.bindSymbol(cast(void**)&NewtonMaterialGetContactFaceAttribute, "NewtonMaterialGetContactFaceAttribute"); + lib.bindSymbol(cast(void**)&NewtonMaterialGetBodyCollidingShape, "NewtonMaterialGetBodyCollidingShape"); + lib.bindSymbol(cast(void**)&NewtonMaterialGetContactNormalSpeed, "NewtonMaterialGetContactNormalSpeed"); + lib.bindSymbol(cast(void**)&NewtonMaterialGetContactForce, "NewtonMaterialGetContactForce"); + lib.bindSymbol(cast(void**)&NewtonMaterialGetContactPositionAndNormal, "NewtonMaterialGetContactPositionAndNormal"); + lib.bindSymbol(cast(void**)&NewtonMaterialGetContactTangentDirections, "NewtonMaterialGetContactTangentDirections"); + lib.bindSymbol(cast(void**)&NewtonMaterialGetContactTangentSpeed, "NewtonMaterialGetContactTangentSpeed"); + lib.bindSymbol(cast(void**)&NewtonMaterialGetContactMaxNormalImpact, "NewtonMaterialGetContactMaxNormalImpact"); + lib.bindSymbol(cast(void**)&NewtonMaterialGetContactMaxTangentImpact, "NewtonMaterialGetContactMaxTangentImpact"); + lib.bindSymbol(cast(void**)&NewtonMaterialGetContactPenetration, "NewtonMaterialGetContactPenetration"); + lib.bindSymbol(cast(void**)&NewtonMaterialSetContactSoftness, "NewtonMaterialSetContactSoftness"); + lib.bindSymbol(cast(void**)&NewtonMaterialSetContactThickness, "NewtonMaterialSetContactThickness"); + lib.bindSymbol(cast(void**)&NewtonMaterialSetContactElasticity, "NewtonMaterialSetContactElasticity"); + lib.bindSymbol(cast(void**)&NewtonMaterialSetContactFrictionState, "NewtonMaterialSetContactFrictionState"); + lib.bindSymbol(cast(void**)&NewtonMaterialSetContactFrictionCoef, "NewtonMaterialSetContactFrictionCoef"); + lib.bindSymbol(cast(void**)&NewtonMaterialSetContactNormalAcceleration, "NewtonMaterialSetContactNormalAcceleration"); + lib.bindSymbol(cast(void**)&NewtonMaterialSetContactNormalDirection, "NewtonMaterialSetContactNormalDirection"); + lib.bindSymbol(cast(void**)&NewtonMaterialSetContactPosition, "NewtonMaterialSetContactPosition"); + lib.bindSymbol(cast(void**)&NewtonMaterialSetContactTangentFriction, "NewtonMaterialSetContactTangentFriction"); + lib.bindSymbol(cast(void**)&NewtonMaterialSetContactTangentAcceleration, "NewtonMaterialSetContactTangentAcceleration"); + lib.bindSymbol(cast(void**)&NewtonMaterialContactRotateTangentDirections, "NewtonMaterialContactRotateTangentDirections"); + lib.bindSymbol(cast(void**)&NewtonMaterialGetContactPruningTolerance, "NewtonMaterialGetContactPruningTolerance"); + lib.bindSymbol(cast(void**)&NewtonMaterialSetContactPruningTolerance, "NewtonMaterialSetContactPruningTolerance"); + + lib.bindSymbol(cast(void**)&NewtonCreateNull, "NewtonCreateNull"); + lib.bindSymbol(cast(void**)&NewtonCreateSphere, "NewtonCreateSphere"); + lib.bindSymbol(cast(void**)&NewtonCreateBox, "NewtonCreateBox"); + lib.bindSymbol(cast(void**)&NewtonCreateCone, "NewtonCreateCone"); + lib.bindSymbol(cast(void**)&NewtonCreateCapsule, "NewtonCreateCapsule"); + lib.bindSymbol(cast(void**)&NewtonCreateCylinder, "NewtonCreateCylinder"); + lib.bindSymbol(cast(void**)&NewtonCreateChamferCylinder, "NewtonCreateChamferCylinder"); + lib.bindSymbol(cast(void**)&NewtonCreateConvexHull, "NewtonCreateConvexHull"); + lib.bindSymbol(cast(void**)&NewtonCreateConvexHullFromMesh, "NewtonCreateConvexHullFromMesh"); + lib.bindSymbol(cast(void**)&NewtonCollisionGetMode, "NewtonCollisionGetMode"); + lib.bindSymbol(cast(void**)&NewtonCollisionSetMode, "NewtonCollisionSetMode"); + lib.bindSymbol(cast(void**)&NewtonConvexHullGetFaceIndices, "NewtonConvexHullGetFaceIndices"); + lib.bindSymbol(cast(void**)&NewtonConvexHullGetVertexData, "NewtonConvexHullGetVertexData"); + lib.bindSymbol(cast(void**)&NewtonConvexCollisionCalculateVolume, "NewtonConvexCollisionCalculateVolume"); + lib.bindSymbol(cast(void**)&NewtonConvexCollisionCalculateInertialMatrix, "NewtonConvexCollisionCalculateInertialMatrix"); + lib.bindSymbol(cast(void**)&NewtonConvexCollisionCalculateBuoyancyAcceleration, "NewtonConvexCollisionCalculateBuoyancyAcceleration"); + lib.bindSymbol(cast(void**)&NewtonCollisionDataPointer, "NewtonCollisionDataPointer"); + + lib.bindSymbol(cast(void**)&NewtonCreateCompoundCollision, "NewtonCreateCompoundCollision"); + lib.bindSymbol(cast(void**)&NewtonCreateCompoundCollisionFromMesh, "NewtonCreateCompoundCollisionFromMesh"); + lib.bindSymbol(cast(void**)&NewtonCompoundCollisionBeginAddRemove, "NewtonCompoundCollisionBeginAddRemove"); + lib.bindSymbol(cast(void**)&NewtonCompoundCollisionAddSubCollision, "NewtonCompoundCollisionAddSubCollision"); + lib.bindSymbol(cast(void**)&NewtonCompoundCollisionRemoveSubCollision, "NewtonCompoundCollisionRemoveSubCollision"); + lib.bindSymbol(cast(void**)&NewtonCompoundCollisionRemoveSubCollisionByIndex, "NewtonCompoundCollisionRemoveSubCollisionByIndex"); + lib.bindSymbol(cast(void**)&NewtonCompoundCollisionSetSubCollisionMatrix, "NewtonCompoundCollisionSetSubCollisionMatrix"); + lib.bindSymbol(cast(void**)&NewtonCompoundCollisionEndAddRemove, "NewtonCompoundCollisionEndAddRemove"); + lib.bindSymbol(cast(void**)&NewtonCompoundCollisionGetFirstNode, "NewtonCompoundCollisionGetFirstNode"); + lib.bindSymbol(cast(void**)&NewtonCompoundCollisionGetNextNode, "NewtonCompoundCollisionGetNextNode"); + lib.bindSymbol(cast(void**)&NewtonCompoundCollisionGetNodeByIndex, "NewtonCompoundCollisionGetNodeByIndex"); + lib.bindSymbol(cast(void**)&NewtonCompoundCollisionGetNodeIndex, "NewtonCompoundCollisionGetNodeIndex"); + lib.bindSymbol(cast(void**)&NewtonCompoundCollisionGetCollisionFromNode, "NewtonCompoundCollisionGetCollisionFromNode"); + + lib.bindSymbol(cast(void**)&NewtonCreateFracturedCompoundCollision, "NewtonCreateFracturedCompoundCollision"); + lib.bindSymbol(cast(void**)&NewtonFracturedCompoundPlaneClip, "NewtonFracturedCompoundPlaneClip"); + lib.bindSymbol(cast(void**)&NewtonFracturedCompoundSetCallbacks, "NewtonFracturedCompoundSetCallbacks"); + lib.bindSymbol(cast(void**)&NewtonFracturedCompoundIsNodeFreeToDetach, "NewtonFracturedCompoundIsNodeFreeToDetach"); + lib.bindSymbol(cast(void**)&NewtonFracturedCompoundNeighborNodeList, "NewtonFracturedCompoundNeighborNodeList"); + lib.bindSymbol(cast(void**)&NewtonFracturedCompoundGetMainMesh, "NewtonFracturedCompoundGetMainMesh"); + lib.bindSymbol(cast(void**)&NewtonFracturedCompoundGetFirstSubMesh, "NewtonFracturedCompoundGetFirstSubMesh"); + lib.bindSymbol(cast(void**)&NewtonFracturedCompoundGetNextSubMesh, "NewtonFracturedCompoundGetNextSubMesh"); + lib.bindSymbol(cast(void**)&NewtonFracturedCompoundCollisionGetVertexCount, "NewtonFracturedCompoundCollisionGetVertexCount"); + lib.bindSymbol(cast(void**)&NewtonFracturedCompoundCollisionGetVertexPositions, "NewtonFracturedCompoundCollisionGetVertexPositions"); + lib.bindSymbol(cast(void**)&NewtonFracturedCompoundCollisionGetVertexNormals, "NewtonFracturedCompoundCollisionGetVertexNormals"); + lib.bindSymbol(cast(void**)&NewtonFracturedCompoundCollisionGetVertexUVs, "NewtonFracturedCompoundCollisionGetVertexUVs"); + lib.bindSymbol(cast(void**)&NewtonFracturedCompoundMeshPartGetIndexStream, "NewtonFracturedCompoundMeshPartGetIndexStream"); + lib.bindSymbol(cast(void**)&NewtonFracturedCompoundMeshPartGetFirstSegment, "NewtonFracturedCompoundMeshPartGetFirstSegment"); + lib.bindSymbol(cast(void**)&NewtonFracturedCompoundMeshPartGetNextSegment, "NewtonFracturedCompoundMeshPartGetNextSegment"); + lib.bindSymbol(cast(void**)&NewtonFracturedCompoundMeshPartGetMaterial, "NewtonFracturedCompoundMeshPartGetMaterial"); + lib.bindSymbol(cast(void**)&NewtonFracturedCompoundMeshPartGetIndexCount, "NewtonFracturedCompoundMeshPartGetIndexCount"); + + lib.bindSymbol(cast(void**)&NewtonCreateSceneCollision, "NewtonCreateSceneCollision"); + lib.bindSymbol(cast(void**)&NewtonSceneCollisionBeginAddRemove, "NewtonSceneCollisionBeginAddRemove"); + lib.bindSymbol(cast(void**)&NewtonSceneCollisionAddSubCollision, "NewtonSceneCollisionAddSubCollision"); + lib.bindSymbol(cast(void**)&NewtonSceneCollisionRemoveSubCollision, "NewtonSceneCollisionRemoveSubCollision"); + lib.bindSymbol(cast(void**)&NewtonSceneCollisionRemoveSubCollisionByIndex, "NewtonSceneCollisionRemoveSubCollisionByIndex"); + lib.bindSymbol(cast(void**)&NewtonSceneCollisionSetSubCollisionMatrix, "NewtonSceneCollisionSetSubCollisionMatrix"); + lib.bindSymbol(cast(void**)&NewtonSceneCollisionEndAddRemove, "NewtonSceneCollisionEndAddRemove"); + lib.bindSymbol(cast(void**)&NewtonSceneCollisionGetFirstNode, "NewtonSceneCollisionGetFirstNode"); + lib.bindSymbol(cast(void**)&NewtonSceneCollisionGetNextNode, "NewtonSceneCollisionGetNextNode"); + lib.bindSymbol(cast(void**)&NewtonSceneCollisionGetNodeByIndex, "NewtonSceneCollisionGetNodeByIndex"); + lib.bindSymbol(cast(void**)&NewtonSceneCollisionGetNodeIndex, "NewtonSceneCollisionGetNodeIndex"); + lib.bindSymbol(cast(void**)&NewtonSceneCollisionGetCollisionFromNode, "NewtonSceneCollisionGetCollisionFromNode"); + + lib.bindSymbol(cast(void**)&NewtonCreateUserMeshCollision, "NewtonCreateUserMeshCollision"); + lib.bindSymbol(cast(void**)&NewtonUserMeshCollisionContinuousOverlapTest, "NewtonUserMeshCollisionContinuousOverlapTest"); + + lib.bindSymbol(cast(void**)&NewtonCreateCollisionFromSerialization, "NewtonCreateCollisionFromSerialization"); + lib.bindSymbol(cast(void**)&NewtonCollisionSerialize, "NewtonCollisionSerialize"); + lib.bindSymbol(cast(void**)&NewtonCollisionGetInfo, "NewtonCollisionGetInfo"); + + lib.bindSymbol(cast(void**)&NewtonCreateHeightFieldCollision, "NewtonCreateHeightFieldCollision"); + lib.bindSymbol(cast(void**)&NewtonHeightFieldSetUserRayCastCallback, "NewtonHeightFieldSetUserRayCastCallback"); + lib.bindSymbol(cast(void**)&NewtonHeightFieldSetHorizontalDisplacement, "NewtonHeightFieldSetHorizontalDisplacement"); + lib.bindSymbol(cast(void**)&NewtonCreateTreeCollision, "NewtonCreateTreeCollision"); + lib.bindSymbol(cast(void**)&NewtonCreateTreeCollisionFromMesh, "NewtonCreateTreeCollisionFromMesh"); + lib.bindSymbol(cast(void**)&NewtonTreeCollisionSetUserRayCastCallback, "NewtonTreeCollisionSetUserRayCastCallback"); + lib.bindSymbol(cast(void**)&NewtonTreeCollisionBeginBuild, "NewtonTreeCollisionBeginBuild"); + lib.bindSymbol(cast(void**)&NewtonTreeCollisionAddFace, "NewtonTreeCollisionAddFace"); + lib.bindSymbol(cast(void**)&NewtonTreeCollisionEndBuild, "NewtonTreeCollisionEndBuild"); + lib.bindSymbol(cast(void**)&NewtonTreeCollisionGetFaceAttribute, "NewtonTreeCollisionGetFaceAttribute"); + lib.bindSymbol(cast(void**)&NewtonTreeCollisionSetFaceAttribute, "NewtonTreeCollisionSetFaceAttribute"); + lib.bindSymbol(cast(void**)&NewtonTreeCollisionForEachFace, "NewtonTreeCollisionForEachFace"); + lib.bindSymbol(cast(void**)&NewtonTreeCollisionGetVertexListTriangleListInAABB, "NewtonTreeCollisionGetVertexListTriangleListInAABB"); + lib.bindSymbol(cast(void**)&NewtonStaticCollisionSetDebugCallback, "NewtonStaticCollisionSetDebugCallback"); + + lib.bindSymbol(cast(void**)&NewtonCollisionCreateInstance, "NewtonCollisionCreateInstance"); + lib.bindSymbol(cast(void**)&NewtonCollisionGetType, "NewtonCollisionGetType"); + lib.bindSymbol(cast(void**)&NewtonCollisionIsConvexShape, "NewtonCollisionIsConvexShape"); + lib.bindSymbol(cast(void**)&NewtonCollisionIsStaticShape, "NewtonCollisionIsStaticShape"); + + lib.bindSymbol(cast(void**)&NewtonCollisionSetUserData, "NewtonCollisionSetUserData"); + lib.bindSymbol(cast(void**)&NewtonCollisionGetUserData, "NewtonCollisionGetUserData"); + lib.bindSymbol(cast(void**)&NewtonCollisionSetUserID, "NewtonCollisionSetUserID"); + lib.bindSymbol(cast(void**)&NewtonCollisionGetUserID, "NewtonCollisionGetUserID"); + lib.bindSymbol(cast(void**)&NewtonCollisionGetMaterial, "NewtonCollisionGetMaterial"); + lib.bindSymbol(cast(void**)&NewtonCollisionSetMaterial, "NewtonCollisionSetMaterial"); + lib.bindSymbol(cast(void**)&NewtonCollisionGetSubCollisionHandle, "NewtonCollisionGetSubCollisionHandle"); + lib.bindSymbol(cast(void**)&NewtonCollisionGetParentInstance, "NewtonCollisionGetParentInstance"); + lib.bindSymbol(cast(void**)&NewtonCollisionSetMatrix, "NewtonCollisionSetMatrix"); + lib.bindSymbol(cast(void**)&NewtonCollisionGetMatrix, "NewtonCollisionGetMatrix"); + lib.bindSymbol(cast(void**)&NewtonCollisionSetScale, "NewtonCollisionSetScale"); + lib.bindSymbol(cast(void**)&NewtonCollisionGetScale, "NewtonCollisionGetScale"); + lib.bindSymbol(cast(void**)&NewtonDestroyCollision, "NewtonDestroyCollision"); + lib.bindSymbol(cast(void**)&NewtonCollisionGetSkinThickness, "NewtonCollisionGetSkinThickness"); + lib.bindSymbol(cast(void**)&NewtonCollisionSetSkinThickness, "NewtonCollisionSetSkinThickness"); + lib.bindSymbol(cast(void**)&NewtonCollisionIntersectionTest, "NewtonCollisionIntersectionTest"); + lib.bindSymbol(cast(void**)&NewtonCollisionPointDistance, "NewtonCollisionPointDistance"); + lib.bindSymbol(cast(void**)&NewtonCollisionClosestPoint, "NewtonCollisionClosestPoint"); + lib.bindSymbol(cast(void**)&NewtonCollisionCollide, "NewtonCollisionCollide"); + lib.bindSymbol(cast(void**)&NewtonCollisionCollideContinue, "NewtonCollisionCollideContinue"); + lib.bindSymbol(cast(void**)&NewtonCollisionSupportVertex, "NewtonCollisionSupportVertex"); + lib.bindSymbol(cast(void**)&NewtonCollisionRayCast, "NewtonCollisionRayCast"); + lib.bindSymbol(cast(void**)&NewtonCollisionCalculateAABB, "NewtonCollisionCalculateAABB"); + lib.bindSymbol(cast(void**)&NewtonCollisionForEachPolygonDo, "NewtonCollisionForEachPolygonDo"); + + lib.bindSymbol(cast(void**)&NewtonCollisionAggregateCreate, "NewtonCollisionAggregateCreate"); + lib.bindSymbol(cast(void**)&NewtonCollisionAggregateDestroy, "NewtonCollisionAggregateDestroy"); + lib.bindSymbol(cast(void**)&NewtonCollisionAggregateAddBody, "NewtonCollisionAggregateAddBody"); + lib.bindSymbol(cast(void**)&NewtonCollisionAggregateRemoveBody, "NewtonCollisionAggregateRemoveBody"); + lib.bindSymbol(cast(void**)&NewtonCollisionAggregateGetSelfCollision, "NewtonCollisionAggregateGetSelfCollision"); + lib.bindSymbol(cast(void**)&NewtonCollisionAggregateSetSelfCollision, "NewtonCollisionAggregateSetSelfCollision"); + + lib.bindSymbol(cast(void**)&NewtonSetEulerAngle, "NewtonSetEulerAngle"); + lib.bindSymbol(cast(void**)&NewtonGetEulerAngle, "NewtonGetEulerAngle"); + lib.bindSymbol(cast(void**)&NewtonCalculateSpringDamperAcceleration, "NewtonCalculateSpringDamperAcceleration"); + + lib.bindSymbol(cast(void**)&NewtonCreateDynamicBody, "NewtonCreateDynamicBody"); + lib.bindSymbol(cast(void**)&NewtonCreateKinematicBody, "NewtonCreateKinematicBody"); + lib.bindSymbol(cast(void**)&NewtonDestroyBody, "NewtonDestroyBody"); + lib.bindSymbol(cast(void**)&NewtonBodyGetSimulationState, "NewtonBodyGetSimulationState"); + lib.bindSymbol(cast(void**)&NewtonBodySetSimulationState, "NewtonBodySetSimulationState"); + lib.bindSymbol(cast(void**)&NewtonBodyGetType, "NewtonBodyGetType"); + lib.bindSymbol(cast(void**)&NewtonBodyGetCollidable, "NewtonBodyGetCollidable"); + lib.bindSymbol(cast(void**)&NewtonBodySetCollidable, "NewtonBodySetCollidable"); + lib.bindSymbol(cast(void**)&NewtonBodyAddForce, "NewtonBodyAddForce"); + lib.bindSymbol(cast(void**)&NewtonBodyAddTorque, "NewtonBodyAddTorque"); + lib.bindSymbol(cast(void**)&NewtonBodyCalculateInverseDynamicsForce, "NewtonBodyCalculateInverseDynamicsForce"); + lib.bindSymbol(cast(void**)&NewtonBodySetCentreOfMass, "NewtonBodySetCentreOfMass"); + lib.bindSymbol(cast(void**)&NewtonBodySetMassMatrix, "NewtonBodySetMassMatrix"); + lib.bindSymbol(cast(void**)&NewtonBodySetFullMassMatrix, "NewtonBodySetFullMassMatrix"); + lib.bindSymbol(cast(void**)&NewtonBodySetMassProperties, "NewtonBodySetMassProperties"); + lib.bindSymbol(cast(void**)&NewtonBodySetMatrix, "NewtonBodySetMatrix"); + lib.bindSymbol(cast(void**)&NewtonBodySetMatrixNoSleep, "NewtonBodySetMatrixNoSleep"); + lib.bindSymbol(cast(void**)&NewtonBodySetMatrixRecursive, "NewtonBodySetMatrixRecursive"); + lib.bindSymbol(cast(void**)&NewtonBodySetMaterialGroupID, "NewtonBodySetMaterialGroupID"); + lib.bindSymbol(cast(void**)&NewtonBodySetContinuousCollisionMode, "NewtonBodySetContinuousCollisionMode"); + lib.bindSymbol(cast(void**)&NewtonBodySetJointRecursiveCollision, "NewtonBodySetJointRecursiveCollision"); + lib.bindSymbol(cast(void**)&NewtonBodySetOmega, "NewtonBodySetOmega"); + lib.bindSymbol(cast(void**)&NewtonBodySetOmegaNoSleep, "NewtonBodySetOmegaNoSleep"); + lib.bindSymbol(cast(void**)&NewtonBodySetVelocity, "NewtonBodySetVelocity"); + lib.bindSymbol(cast(void**)&NewtonBodySetVelocityNoSleep, "NewtonBodySetVelocityNoSleep"); + lib.bindSymbol(cast(void**)&NewtonBodySetForce, "NewtonBodySetForce"); + lib.bindSymbol(cast(void**)&NewtonBodySetTorque, "NewtonBodySetTorque"); + lib.bindSymbol(cast(void**)&NewtonBodySetLinearDamping, "NewtonBodySetLinearDamping"); + lib.bindSymbol(cast(void**)&NewtonBodySetAngularDamping, "NewtonBodySetAngularDamping"); + lib.bindSymbol(cast(void**)&NewtonBodySetCollision, "NewtonBodySetCollision"); + lib.bindSymbol(cast(void**)&NewtonBodySetCollisionScale, "NewtonBodySetCollisionScale"); + lib.bindSymbol(cast(void**)&NewtonBodyGetSleepState, "NewtonBodyGetSleepState"); + lib.bindSymbol(cast(void**)&NewtonBodySetSleepState, "NewtonBodySetSleepState"); + lib.bindSymbol(cast(void**)&NewtonBodyGetAutoSleep, "NewtonBodyGetAutoSleep"); + lib.bindSymbol(cast(void**)&NewtonBodySetAutoSleep, "NewtonBodySetAutoSleep"); + lib.bindSymbol(cast(void**)&NewtonBodyGetFreezeState, "NewtonBodyGetFreezeState"); + lib.bindSymbol(cast(void**)&NewtonBodySetFreezeState, "NewtonBodySetFreezeState"); + //lib.bindSymbol(cast(void**)&NewtonBodyGetGyroscopicTorque, "NewtonBodyGetGyroscopicTorque"); + //lib.bindSymbol(cast(void**)&NewtonBodySetGyroscopicTorque, "NewtonBodySetGyroscopicTorque"); + lib.bindSymbol(cast(void**)&NewtonBodySetDestructorCallback, "NewtonBodySetDestructorCallback"); + lib.bindSymbol(cast(void**)&NewtonBodyGetDestructorCallback, "NewtonBodyGetDestructorCallback"); + lib.bindSymbol(cast(void**)&NewtonBodySetTransformCallback, "NewtonBodySetTransformCallback"); + lib.bindSymbol(cast(void**)&NewtonBodyGetTransformCallback, "NewtonBodyGetTransformCallback"); + lib.bindSymbol(cast(void**)&NewtonBodySetForceAndTorqueCallback, "NewtonBodySetForceAndTorqueCallback"); + lib.bindSymbol(cast(void**)&NewtonBodyGetForceAndTorqueCallback, "NewtonBodyGetForceAndTorqueCallback"); + lib.bindSymbol(cast(void**)&NewtonBodyGetID, "NewtonBodyGetID"); + lib.bindSymbol(cast(void**)&NewtonBodySetUserData, "NewtonBodySetUserData"); + lib.bindSymbol(cast(void**)&NewtonBodyGetUserData, "NewtonBodyGetUserData"); + lib.bindSymbol(cast(void**)&NewtonBodyGetWorld, "NewtonBodyGetWorld"); + lib.bindSymbol(cast(void**)&NewtonBodyGetCollision, "NewtonBodyGetCollision"); + lib.bindSymbol(cast(void**)&NewtonBodyGetMaterialGroupID, "NewtonBodyGetMaterialGroupID"); + lib.bindSymbol(cast(void**)&NewtonBodyGetSerializedID, "NewtonBodyGetSerializedID"); + lib.bindSymbol(cast(void**)&NewtonBodyGetContinuousCollisionMode, "NewtonBodyGetContinuousCollisionMode"); + lib.bindSymbol(cast(void**)&NewtonBodyGetJointRecursiveCollision, "NewtonBodyGetJointRecursiveCollision"); + lib.bindSymbol(cast(void**)&NewtonBodyGetPosition, "NewtonBodyGetPosition"); + lib.bindSymbol(cast(void**)&NewtonBodyGetMatrix, "NewtonBodyGetMatrix"); + lib.bindSymbol(cast(void**)&NewtonBodyGetRotation, "NewtonBodyGetRotation"); + lib.bindSymbol(cast(void**)&NewtonBodyGetMass, "NewtonBodyGetMass"); + lib.bindSymbol(cast(void**)&NewtonBodyGetInvMass, "NewtonBodyGetInvMass"); + lib.bindSymbol(cast(void**)&NewtonBodyGetInertiaMatrix, "NewtonBodyGetInertiaMatrix"); + lib.bindSymbol(cast(void**)&NewtonBodyGetInvInertiaMatrix, "NewtonBodyGetInvInertiaMatrix"); + lib.bindSymbol(cast(void**)&NewtonBodyGetOmega, "NewtonBodyGetOmega"); + lib.bindSymbol(cast(void**)&NewtonBodyGetVelocity, "NewtonBodyGetVelocity"); + lib.bindSymbol(cast(void**)&NewtonBodyGetAlpha, "NewtonBodyGetAlpha"); + lib.bindSymbol(cast(void**)&NewtonBodyGetAcceleration, "NewtonBodyGetAcceleration"); + lib.bindSymbol(cast(void**)&NewtonBodyGetForce, "NewtonBodyGetForce"); + lib.bindSymbol(cast(void**)&NewtonBodyGetTorque, "NewtonBodyGetTorque"); + lib.bindSymbol(cast(void**)&NewtonBodyGetCentreOfMass, "NewtonBodyGetCentreOfMass"); + lib.bindSymbol(cast(void**)&NewtonBodyGetPointVelocity, "NewtonBodyGetPointVelocity"); + lib.bindSymbol(cast(void**)&NewtonBodyApplyImpulsePair, "NewtonBodyApplyImpulsePair"); + lib.bindSymbol(cast(void**)&NewtonBodyAddImpulse, "NewtonBodyAddImpulse"); + lib.bindSymbol(cast(void**)&NewtonBodyApplyImpulseArray, "NewtonBodyApplyImpulseArray"); + lib.bindSymbol(cast(void**)&NewtonBodyIntegrateVelocity, "NewtonBodyIntegrateVelocity"); + lib.bindSymbol(cast(void**)&NewtonBodyGetLinearDamping, "NewtonBodyGetLinearDamping"); + lib.bindSymbol(cast(void**)&NewtonBodyGetAngularDamping, "NewtonBodyGetAngularDamping"); + lib.bindSymbol(cast(void**)&NewtonBodyGetAABB, "NewtonBodyGetAABB"); + lib.bindSymbol(cast(void**)&NewtonBodyGetFirstJoint, "NewtonBodyGetFirstJoint"); + lib.bindSymbol(cast(void**)&NewtonBodyGetNextJoint, "NewtonBodyGetNextJoint"); + lib.bindSymbol(cast(void**)&NewtonBodyGetFirstContactJoint, "NewtonBodyGetFirstContactJoint"); + lib.bindSymbol(cast(void**)&NewtonBodyGetNextContactJoint, "NewtonBodyGetNextContactJoint"); + lib.bindSymbol(cast(void**)&NewtonBodyFindContact, "NewtonBodyFindContact"); + + lib.bindSymbol(cast(void**)&NewtonContactJointGetFirstContact, "NewtonContactJointGetFirstContact"); + lib.bindSymbol(cast(void**)&NewtonContactJointGetNextContact, "NewtonContactJointGetNextContact"); + lib.bindSymbol(cast(void**)&NewtonContactJointGetContactCount, "NewtonContactJointGetContactCount"); + lib.bindSymbol(cast(void**)&NewtonContactJointRemoveContact, "NewtonContactJointRemoveContact"); + lib.bindSymbol(cast(void**)&NewtonContactJointGetClosestDistance, "NewtonContactJointGetClosestDistance"); + lib.bindSymbol(cast(void**)&NewtonContactJointResetSelftJointCollision, "NewtonContactJointResetSelftJointCollision"); + lib.bindSymbol(cast(void**)&NewtonContactJointResetIntraJointCollision, "NewtonContactJointResetIntraJointCollision"); + lib.bindSymbol(cast(void**)&NewtonContactGetMaterial, "NewtonContactGetMaterial"); + lib.bindSymbol(cast(void**)&NewtonContactGetCollision0, "NewtonContactGetCollision0"); + lib.bindSymbol(cast(void**)&NewtonContactGetCollision1, "NewtonContactGetCollision1"); + lib.bindSymbol(cast(void**)&NewtonContactGetCollisionID0, "NewtonContactGetCollisionID0"); + lib.bindSymbol(cast(void**)&NewtonContactGetCollisionID1, "NewtonContactGetCollisionID1"); + + lib.bindSymbol(cast(void**)&NewtonJointGetUserData, "NewtonJointGetUserData"); + lib.bindSymbol(cast(void**)&NewtonJointSetUserData, "NewtonJointSetUserData"); + lib.bindSymbol(cast(void**)&NewtonJointGetBody0, "NewtonJointGetBody0"); + lib.bindSymbol(cast(void**)&NewtonJointGetBody1, "NewtonJointGetBody1"); + lib.bindSymbol(cast(void**)&NewtonJointGetInfo, "NewtonJointGetInfo"); + lib.bindSymbol(cast(void**)&NewtonJointGetCollisionState, "NewtonJointGetCollisionState"); + lib.bindSymbol(cast(void**)&NewtonJointSetCollisionState, "NewtonJointSetCollisionState"); + lib.bindSymbol(cast(void**)&NewtonJointGetStiffness, "NewtonJointGetStiffness"); + lib.bindSymbol(cast(void**)&NewtonJointSetStiffness, "NewtonJointSetStiffness"); + lib.bindSymbol(cast(void**)&NewtonDestroyJoint, "NewtonDestroyJoint"); + lib.bindSymbol(cast(void**)&NewtonJointSetDestructor, "NewtonJointSetDestructor"); + lib.bindSymbol(cast(void**)&NewtonJointIsActive, "NewtonJointIsActive"); + + lib.bindSymbol(cast(void**)&NewtonCreateInverseDynamics, "NewtonCreateInverseDynamics"); + lib.bindSymbol(cast(void**)&NewtonInverseDynamicsDestroy, "NewtonInverseDynamicsDestroy"); + lib.bindSymbol(cast(void**)&NewtonInverseDynamicsGetRoot, "NewtonInverseDynamicsGetRoot"); + lib.bindSymbol(cast(void**)&NewtonInverseDynamicsGetNextChildNode, "NewtonInverseDynamicsGetNextChildNode"); + lib.bindSymbol(cast(void**)&NewtonInverseDynamicsGetFirstChildNode, "NewtonInverseDynamicsGetFirstChildNode"); + lib.bindSymbol(cast(void**)&NewtonInverseDynamicsGetBody, "NewtonInverseDynamicsGetBody"); + lib.bindSymbol(cast(void**)&NewtonInverseDynamicsGetJoint, "NewtonInverseDynamicsGetJoint"); + lib.bindSymbol(cast(void**)&NewtonInverseDynamicsCreateEffector, "NewtonInverseDynamicsCreateEffector"); + lib.bindSymbol(cast(void**)&NewtonInverseDynamicsDestroyEffector, "NewtonInverseDynamicsDestroyEffector"); + lib.bindSymbol(cast(void**)&NewtonInverseDynamicsAddRoot, "NewtonInverseDynamicsAddRoot"); + lib.bindSymbol(cast(void**)&NewtonInverseDynamicsAddChildNode, "NewtonInverseDynamicsAddChildNode"); + lib.bindSymbol(cast(void**)&NewtonInverseDynamicsAddLoopJoint, "NewtonInverseDynamicsAddLoopJoint"); + lib.bindSymbol(cast(void**)&NewtonInverseDynamicsEndBuild, "NewtonInverseDynamicsEndBuild"); + lib.bindSymbol(cast(void**)&NewtonInverseDynamicsUpdate, "NewtonInverseDynamicsUpdate"); + + lib.bindSymbol(cast(void**)&NewtonCreateMassSpringDamperSystem, "NewtonCreateMassSpringDamperSystem"); + lib.bindSymbol(cast(void**)&NewtonCreateDeformableSolid, "NewtonCreateDeformableSolid"); + lib.bindSymbol(cast(void**)&NewtonDeformableMeshGetParticleCount, "NewtonDeformableMeshGetParticleCount"); + lib.bindSymbol(cast(void**)&NewtonDeformableMeshGetParticleStrideInBytes, "NewtonDeformableMeshGetParticleStrideInBytes"); + lib.bindSymbol(cast(void**)&NewtonDeformableMeshGetParticleArray, "NewtonDeformableMeshGetParticleArray"); + + lib.bindSymbol(cast(void**)&NewtonConstraintCreateBall, "NewtonConstraintCreateBall"); + lib.bindSymbol(cast(void**)&NewtonBallSetUserCallback, "NewtonBallSetUserCallback"); + lib.bindSymbol(cast(void**)&NewtonBallGetJointAngle, "NewtonBallGetJointAngle"); + lib.bindSymbol(cast(void**)&NewtonBallGetJointOmega, "NewtonBallGetJointOmega"); + lib.bindSymbol(cast(void**)&NewtonBallGetJointForce, "NewtonBallGetJointForce"); + lib.bindSymbol(cast(void**)&NewtonBallSetConeLimits, "NewtonBallSetConeLimits"); + + // lib.bindSymbol(cast(void**)&NewtonConstraintCreateHinge, "NewtonConstraintCreateHinge"); + // lib.bindSymbol(cast(void**)&NewtonHingeSetUserCallback, "NewtonHingeSetUserCallback"); + // lib.bindSymbol(cast(void**)&NewtonHingeGetJointAngle, "NewtonHingeGetJointAngle"); + // lib.bindSymbol(cast(void**)&NewtonHingeGetJointOmega, "NewtonHingeGetJointOmega"); + // lib.bindSymbol(cast(void**)&NewtonHingeGetJointForce, "NewtonHingeGetJointForce"); + // lib.bindSymbol(cast(void**)&NewtonHingeCalculateStopAlpha, "NewtonHingeCalculateStopAlpha"); + + lib.bindSymbol(cast(void**)&NewtonConstraintCreateSlider, "NewtonConstraintCreateSlider"); + lib.bindSymbol(cast(void**)&NewtonSliderSetUserCallback, "NewtonSliderSetUserCallback"); + lib.bindSymbol(cast(void**)&NewtonSliderGetJointPosit, "NewtonSliderGetJointPosit"); + lib.bindSymbol(cast(void**)&NewtonSliderGetJointVeloc, "NewtonSliderGetJointVeloc"); + lib.bindSymbol(cast(void**)&NewtonSliderGetJointForce, "NewtonSliderGetJointForce"); + lib.bindSymbol(cast(void**)&NewtonSliderCalculateStopAccel, "NewtonSliderCalculateStopAccel"); + + lib.bindSymbol(cast(void**)&NewtonConstraintCreateCorkscrew, "NewtonConstraintCreateCorkscrew"); + lib.bindSymbol(cast(void**)&NewtonCorkscrewSetUserCallback, "NewtonCorkscrewSetUserCallback"); + lib.bindSymbol(cast(void**)&NewtonCorkscrewGetJointPosit, "NewtonCorkscrewGetJointPosit"); + lib.bindSymbol(cast(void**)&NewtonCorkscrewGetJointAngle, "NewtonCorkscrewGetJointAngle"); + lib.bindSymbol(cast(void**)&NewtonCorkscrewGetJointVeloc, "NewtonCorkscrewGetJointVeloc"); + lib.bindSymbol(cast(void**)&NewtonCorkscrewGetJointOmega, "NewtonCorkscrewGetJointOmega"); + lib.bindSymbol(cast(void**)&NewtonCorkscrewGetJointForce, "NewtonCorkscrewGetJointForce"); + lib.bindSymbol(cast(void**)&NewtonCorkscrewCalculateStopAlpha, "NewtonCorkscrewCalculateStopAlpha"); + lib.bindSymbol(cast(void**)&NewtonCorkscrewCalculateStopAccel, "NewtonCorkscrewCalculateStopAccel"); + + lib.bindSymbol(cast(void**)&NewtonConstraintCreateUniversal, "NewtonConstraintCreateUniversal"); + lib.bindSymbol(cast(void**)&NewtonUniversalSetUserCallback, "NewtonUniversalSetUserCallback"); + lib.bindSymbol(cast(void**)&NewtonUniversalGetJointAngle0, "NewtonUniversalGetJointAngle0"); + lib.bindSymbol(cast(void**)&NewtonUniversalGetJointAngle1, "NewtonUniversalGetJointAngle1"); + lib.bindSymbol(cast(void**)&NewtonUniversalGetJointOmega0, "NewtonUniversalGetJointOmega0"); + lib.bindSymbol(cast(void**)&NewtonUniversalGetJointOmega1, "NewtonUniversalGetJointOmega1"); + lib.bindSymbol(cast(void**)&NewtonUniversalGetJointForce, "NewtonUniversalGetJointForce"); + lib.bindSymbol(cast(void**)&NewtonUniversalCalculateStopAlpha0, "NewtonUniversalCalculateStopAlpha0"); + lib.bindSymbol(cast(void**)&NewtonUniversalCalculateStopAlpha1, "NewtonUniversalCalculateStopAlpha1"); + + lib.bindSymbol(cast(void**)&NewtonConstraintCreateUpVector, "NewtonConstraintCreateUpVector"); + lib.bindSymbol(cast(void**)&NewtonUpVectorGetPin, "NewtonUpVectorGetPin"); + lib.bindSymbol(cast(void**)&NewtonUpVectorSetPin, "NewtonUpVectorSetPin"); + + lib.bindSymbol(cast(void**)&NewtonConstraintCreateUserJoint, "NewtonConstraintCreateUserJoint"); + lib.bindSymbol(cast(void**)&NewtonUserJointGetSolverModel, "NewtonUserJointGetSolverModel"); + lib.bindSymbol(cast(void**)&NewtonUserJointSetSolverModel, "NewtonUserJointSetSolverModel"); + lib.bindSymbol(cast(void**)&NewtonUserJointSetFeedbackCollectorCallback, "NewtonUserJointSetFeedbackCollectorCallback"); + lib.bindSymbol(cast(void**)&NewtonUserJointAddLinearRow, "NewtonUserJointAddLinearRow"); + lib.bindSymbol(cast(void**)&NewtonUserJointAddAngularRow, "NewtonUserJointAddAngularRow"); + lib.bindSymbol(cast(void**)&NewtonUserJointAddGeneralRow, "NewtonUserJointAddGeneralRow"); + lib.bindSymbol(cast(void**)&NewtonUserJointSetRowMinimumFriction, "NewtonUserJointSetRowMinimumFriction"); + lib.bindSymbol(cast(void**)&NewtonUserJointSetRowMaximumFriction, "NewtonUserJointSetRowMaximumFriction"); + lib.bindSymbol(cast(void**)&NewtonUserJointCalculateRowZeroAccelaration, "NewtonUserJointCalculateRowZeroAccelaration"); + lib.bindSymbol(cast(void**)&NewtonUserJointGetRowAcceleration, "NewtonUserJointGetRowAcceleration"); + lib.bindSymbol(cast(void**)&NewtonUserJointSetRowAsInverseDynamics, "NewtonUserJointSetRowAsInverseDynamics"); + lib.bindSymbol(cast(void**)&NewtonUserJointSetRowAcceleration, "NewtonUserJointSetRowAcceleration"); + lib.bindSymbol(cast(void**)&NewtonUserJointSetRowSpringDamperAcceleration, "NewtonUserJointSetRowSpringDamperAcceleration"); + lib.bindSymbol(cast(void**)&NewtonUserJointSetRowStiffness, "NewtonUserJointSetRowStiffness"); + lib.bindSymbol(cast(void**)&NewtonUserJoinRowsCount, "NewtonUserJoinRowsCount"); + lib.bindSymbol(cast(void**)&NewtonUserJointGetGeneralRow, "NewtonUserJointGetGeneralRow"); + lib.bindSymbol(cast(void**)&NewtonUserJointGetRowForce, "NewtonUserJointGetRowForce"); + lib.bindSymbol(cast(void**)&NewtonUserJointSubmitImmediateModeConstraint, "NewtonUserJointSubmitImmediateModeConstraint"); + + lib.bindSymbol(cast(void**)&NewtonMeshCreate, "NewtonMeshCreate"); + lib.bindSymbol(cast(void**)&NewtonMeshCreateFromMesh, "NewtonMeshCreateFromMesh"); + lib.bindSymbol(cast(void**)&NewtonMeshCreateFromCollision, "NewtonMeshCreateFromCollision"); + lib.bindSymbol(cast(void**)&NewtonMeshCreateTetrahedraIsoSurface, "NewtonMeshCreateTetrahedraIsoSurface"); + lib.bindSymbol(cast(void**)&NewtonMeshCreateConvexHull, "NewtonMeshCreateConvexHull"); + lib.bindSymbol(cast(void**)&NewtonMeshCreateVoronoiConvexDecomposition, "NewtonMeshCreateVoronoiConvexDecomposition"); + lib.bindSymbol(cast(void**)&NewtonMeshCreateFromSerialization, "NewtonMeshCreateFromSerialization"); + lib.bindSymbol(cast(void**)&NewtonMeshDestroy, "NewtonMeshDestroy"); + lib.bindSymbol(cast(void**)&NewtonMeshSerialize, "NewtonMeshSerialize"); + lib.bindSymbol(cast(void**)&NewtonMeshSaveOFF, "NewtonMeshSaveOFF"); + lib.bindSymbol(cast(void**)&NewtonMeshLoadOFF, "NewtonMeshLoadOFF"); + lib.bindSymbol(cast(void**)&NewtonMeshLoadTetrahedraMesh, "NewtonMeshLoadTetrahedraMesh"); + lib.bindSymbol(cast(void**)&NewtonMeshApplyTransform, "NewtonMeshApplyTransform"); + lib.bindSymbol(cast(void**)&NewtonMeshCalculateOOBB, "NewtonMeshCalculateOOBB"); + lib.bindSymbol(cast(void**)&NewtonMeshCalculateVertexNormals, "NewtonMeshCalculateVertexNormals"); + lib.bindSymbol(cast(void**)&NewtonMeshApplySphericalMapping, "NewtonMeshApplySphericalMapping"); + lib.bindSymbol(cast(void**)&NewtonMeshApplyCylindricalMapping, "NewtonMeshApplyCylindricalMapping"); + lib.bindSymbol(cast(void**)&NewtonMeshApplyBoxMapping, "NewtonMeshApplyBoxMapping"); + lib.bindSymbol(cast(void**)&NewtonMeshApplyAngleBasedMapping, "NewtonMeshApplyAngleBasedMapping"); + lib.bindSymbol(cast(void**)&NewtonCreateTetrahedraLinearBlendSkinWeightsChannel, "NewtonCreateTetrahedraLinearBlendSkinWeightsChannel"); + lib.bindSymbol(cast(void**)&NewtonMeshOptimize, "NewtonMeshOptimize"); + lib.bindSymbol(cast(void**)&NewtonMeshOptimizePoints, "NewtonMeshOptimizePoints"); + lib.bindSymbol(cast(void**)&NewtonMeshOptimizeVertex, "NewtonMeshOptimizeVertex"); + lib.bindSymbol(cast(void**)&NewtonMeshIsOpenMesh, "NewtonMeshIsOpenMesh"); + lib.bindSymbol(cast(void**)&NewtonMeshFixTJoints, "NewtonMeshFixTJoints"); + lib.bindSymbol(cast(void**)&NewtonMeshPolygonize, "NewtonMeshPolygonize"); + lib.bindSymbol(cast(void**)&NewtonMeshTriangulate, "NewtonMeshTriangulate"); + lib.bindSymbol(cast(void**)&NewtonMeshUnion, "NewtonMeshUnion"); + lib.bindSymbol(cast(void**)&NewtonMeshDifference, "NewtonMeshDifference"); + lib.bindSymbol(cast(void**)&NewtonMeshIntersection, "NewtonMeshIntersection"); + lib.bindSymbol(cast(void**)&NewtonMeshClip, "NewtonMeshClip"); + lib.bindSymbol(cast(void**)&NewtonMeshConvexMeshIntersection, "NewtonMeshConvexMeshIntersection"); + lib.bindSymbol(cast(void**)&NewtonMeshSimplify, "NewtonMeshSimplify"); + lib.bindSymbol(cast(void**)&NewtonMeshApproximateConvexDecomposition, "NewtonMeshApproximateConvexDecomposition"); + lib.bindSymbol(cast(void**)&NewtonRemoveUnusedVertices, "NewtonRemoveUnusedVertices"); + lib.bindSymbol(cast(void**)&NewtonMeshBeginBuild, "NewtonMeshBeginBuild"); + lib.bindSymbol(cast(void**)&NewtonMeshBeginFace, "NewtonMeshBeginFace"); + lib.bindSymbol(cast(void**)&NewtonMeshAddPoint, "NewtonMeshAddPoint"); + lib.bindSymbol(cast(void**)&NewtonMeshAddLayer, "NewtonMeshAddLayer"); + lib.bindSymbol(cast(void**)&NewtonMeshAddMaterial, "NewtonMeshAddMaterial"); + lib.bindSymbol(cast(void**)&NewtonMeshAddNormal, "NewtonMeshAddNormal"); + lib.bindSymbol(cast(void**)&NewtonMeshAddBinormal, "NewtonMeshAddBinormal"); + lib.bindSymbol(cast(void**)&NewtonMeshAddUV0, "NewtonMeshAddUV0"); + lib.bindSymbol(cast(void**)&NewtonMeshAddUV1, "NewtonMeshAddUV1"); + lib.bindSymbol(cast(void**)&NewtonMeshEndFace, "NewtonMeshEndFace"); + lib.bindSymbol(cast(void**)&NewtonMeshEndBuild, "NewtonMeshEndBuild"); + lib.bindSymbol(cast(void**)&NewtonMeshClearVertexFormat, "NewtonMeshClearVertexFormat"); + lib.bindSymbol(cast(void**)&NewtonMeshBuildFromVertexListIndexList, "NewtonMeshBuildFromVertexListIndexList"); + lib.bindSymbol(cast(void**)&NewtonMeshGetPointCount, "NewtonMeshGetPointCount"); + lib.bindSymbol(cast(void**)&NewtonMeshGetIndexToVertexMap, "NewtonMeshGetIndexToVertexMap"); + lib.bindSymbol(cast(void**)&NewtonMeshGetVertexDoubleChannel, "NewtonMeshGetVertexDoubleChannel"); + lib.bindSymbol(cast(void**)&NewtonMeshGetVertexChannel, "NewtonMeshGetVertexChannel"); + lib.bindSymbol(cast(void**)&NewtonMeshGetNormalChannel, "NewtonMeshGetNormalChannel"); + lib.bindSymbol(cast(void**)&NewtonMeshGetBinormalChannel, "NewtonMeshGetBinormalChannel"); + lib.bindSymbol(cast(void**)&NewtonMeshGetUV0Channel, "NewtonMeshGetUV0Channel"); + lib.bindSymbol(cast(void**)&NewtonMeshGetUV1Channel, "NewtonMeshGetUV1Channel"); + lib.bindSymbol(cast(void**)&NewtonMeshGetVertexColorChannel, "NewtonMeshGetVertexColorChannel"); + lib.bindSymbol(cast(void**)&NewtonMeshHasNormalChannel, "NewtonMeshHasNormalChannel"); + lib.bindSymbol(cast(void**)&NewtonMeshHasBinormalChannel, "NewtonMeshHasBinormalChannel"); + lib.bindSymbol(cast(void**)&NewtonMeshHasUV0Channel, "NewtonMeshHasUV0Channel"); + lib.bindSymbol(cast(void**)&NewtonMeshHasUV1Channel, "NewtonMeshHasUV1Channel"); + lib.bindSymbol(cast(void**)&NewtonMeshHasVertexColorChannel, "NewtonMeshHasVertexColorChannel"); + lib.bindSymbol(cast(void**)&NewtonMeshBeginHandle, "NewtonMeshBeginHandle"); + lib.bindSymbol(cast(void**)&NewtonMeshEndHandle, "NewtonMeshEndHandle"); + lib.bindSymbol(cast(void**)&NewtonMeshFirstMaterial, "NewtonMeshFirstMaterial"); + lib.bindSymbol(cast(void**)&NewtonMeshNextMaterial, "NewtonMeshNextMaterial"); + lib.bindSymbol(cast(void**)&NewtonMeshMaterialGetMaterial, "NewtonMeshMaterialGetMaterial"); + lib.bindSymbol(cast(void**)&NewtonMeshMaterialGetIndexCount, "NewtonMeshMaterialGetIndexCount"); + lib.bindSymbol(cast(void**)&NewtonMeshMaterialGetIndexStream, "NewtonMeshMaterialGetIndexStream"); + lib.bindSymbol(cast(void**)&NewtonMeshMaterialGetIndexStreamShort, "NewtonMeshMaterialGetIndexStreamShort"); + lib.bindSymbol(cast(void**)&NewtonMeshCreateFirstSingleSegment, "NewtonMeshCreateFirstSingleSegment"); + lib.bindSymbol(cast(void**)&NewtonMeshCreateNextSingleSegment, "NewtonMeshCreateNextSingleSegment"); + lib.bindSymbol(cast(void**)&NewtonMeshCreateFirstLayer, "NewtonMeshCreateFirstLayer"); + lib.bindSymbol(cast(void**)&NewtonMeshCreateNextLayer, "NewtonMeshCreateNextLayer"); + lib.bindSymbol(cast(void**)&NewtonMeshGetTotalFaceCount, "NewtonMeshGetTotalFaceCount"); + lib.bindSymbol(cast(void**)&NewtonMeshGetTotalIndexCount, "NewtonMeshGetTotalIndexCount"); + lib.bindSymbol(cast(void**)&NewtonMeshGetFaces, "NewtonMeshGetFaces"); + lib.bindSymbol(cast(void**)&NewtonMeshGetVertexCount, "NewtonMeshGetVertexCount"); + lib.bindSymbol(cast(void**)&NewtonMeshGetVertexStrideInByte, "NewtonMeshGetVertexStrideInByte"); + lib.bindSymbol(cast(void**)&NewtonMeshGetVertexArray, "NewtonMeshGetVertexArray"); + lib.bindSymbol(cast(void**)&NewtonMeshGetFirstVertex, "NewtonMeshGetFirstVertex"); + lib.bindSymbol(cast(void**)&NewtonMeshGetNextVertex, "NewtonMeshGetNextVertex"); + lib.bindSymbol(cast(void**)&NewtonMeshGetVertexIndex, "NewtonMeshGetVertexIndex"); + lib.bindSymbol(cast(void**)&NewtonMeshGetFirstPoint, "NewtonMeshGetFirstPoint"); + lib.bindSymbol(cast(void**)&NewtonMeshGetNextPoint, "NewtonMeshGetNextPoint"); + lib.bindSymbol(cast(void**)&NewtonMeshGetPointIndex, "NewtonMeshGetPointIndex"); + lib.bindSymbol(cast(void**)&NewtonMeshGetVertexIndexFromPoint, "NewtonMeshGetVertexIndexFromPoint"); + lib.bindSymbol(cast(void**)&NewtonMeshGetFirstEdge, "NewtonMeshGetFirstEdge"); + lib.bindSymbol(cast(void**)&NewtonMeshGetNextEdge, "NewtonMeshGetNextEdge"); + lib.bindSymbol(cast(void**)&NewtonMeshGetEdgeIndices, "NewtonMeshGetEdgeIndices"); + lib.bindSymbol(cast(void**)&NewtonMeshGetFirstFace, "NewtonMeshGetFirstFace"); + lib.bindSymbol(cast(void**)&NewtonMeshGetNextFace, "NewtonMeshGetNextFace"); + lib.bindSymbol(cast(void**)&NewtonMeshIsFaceOpen, "NewtonMeshIsFaceOpen"); + lib.bindSymbol(cast(void**)&NewtonMeshGetFaceMaterial, "NewtonMeshGetFaceMaterial"); + lib.bindSymbol(cast(void**)&NewtonMeshGetFaceIndexCount, "NewtonMeshGetFaceIndexCount"); + lib.bindSymbol(cast(void**)&NewtonMeshGetFaceIndices, "NewtonMeshGetFaceIndices"); + lib.bindSymbol(cast(void**)&NewtonMeshGetFacePointIndices, "NewtonMeshGetFacePointIndices"); + lib.bindSymbol(cast(void**)&NewtonMeshCalculateFaceNormal, "NewtonMeshCalculateFaceNormal"); + lib.bindSymbol(cast(void**)&NewtonMeshSetFaceMaterial, "NewtonMeshSetFaceMaterial"); + + loadedVersion = NewtonSupport.newton314; + + if (errorCount() != errCount) + return NewtonSupport.badLibrary; + + return loadedVersion; +} diff --git a/src/bindbc/newton/package.d b/src/bindbc/newton/package.d new file mode 100644 index 0000000..1598ecc --- /dev/null +++ b/src/bindbc/newton/package.d @@ -0,0 +1,30 @@ +/* +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +*/ + +module bindbc.newton; + +public import bindbc.newton.types; +public import bindbc.newton.binddynamic; diff --git a/src/bindbc/newton/types.d b/src/bindbc/newton/types.d new file mode 100644 index 0000000..9bdafeb --- /dev/null +++ b/src/bindbc/newton/types.d @@ -0,0 +1,419 @@ +/* +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. +*/ +module bindbc.newton.types; + +private { + import core.stdc.config; +} + +enum NewtonSupport { + noLibrary, + badLibrary, + newton314 +} + +enum newtonSupport = NewtonSupport.newton314; + +extern(C): + +alias dLong = long; +alias dFloat32 = float; +alias dFloat64 = double; +version(_NEWTON_USE_DOUBLE) alias dFloat = double; +else alias dFloat = float; + +enum NEWTON_MAJOR_VERSION = 3; +enum NEWTON_MINOR_VERSION = 14; + +enum NEWTON_BROADPHASE_DEFAULT = 0; +enum NEWTON_BROADPHASE_PERSINTENT = 1; + +enum NEWTON_DYNAMIC_BODY = 0; +enum NEWTON_KINEMATIC_BODY = 1; +enum NEWTON_DYNAMIC_ASYMETRIC_BODY = 2; +// #define NEWTON_DEFORMABLE_BODY 2 + +enum SERIALIZE_ID_SPHERE = 0; +enum SERIALIZE_ID_CAPSULE = 1; +enum SERIALIZE_ID_CYLINDER = 2; +enum SERIALIZE_ID_CHAMFERCYLINDER = 3; +enum SERIALIZE_ID_BOX = 4; +enum SERIALIZE_ID_CONE = 5; +enum SERIALIZE_ID_CONVEXHULL = 6; +enum SERIALIZE_ID_NULL = 7; +enum SERIALIZE_ID_COMPOUND = 8; +enum SERIALIZE_ID_TREE = 9; +enum SERIALIZE_ID_HEIGHTFIELD = 10; +enum SERIALIZE_ID_CLOTH_PATCH = 11; +enum SERIALIZE_ID_DEFORMABLE_SOLID = 12; +enum SERIALIZE_ID_USERMESH = 13; +enum SERIALIZE_ID_SCENE = 14; +enum SERIALIZE_ID_FRACTURED_COMPOUND = 15; + +struct NewtonMesh{} +struct NewtonBody{} +struct NewtonWorld{} +struct NewtonJoint{} +struct NewtonMaterial{} +struct NewtonCollision{} +struct NewtonInverseDynamics{} +struct NewtonDeformableMeshSegment{} +struct NewtonInverseDynamicsEffector{} +struct NewtonFracturedCompoundMeshPart{} + +struct NewtonCollisionMaterial +{ + void* m_userData; + int m_userId; + int m_userFlags; + dFloat[8] m_userParam; +} + +struct NewtonBoxParam +{ + dFloat m_x; + dFloat m_y; + dFloat m_z; +} + +struct NewtonSphereParam +{ + dFloat m_radio; +} + +struct NewtonCapsuleParam +{ + dFloat m_radio0; + dFloat m_radio1; + dFloat m_height; +} + +struct NewtonCylinderParam +{ + dFloat m_radio0; + dFloat m_radio1; + dFloat m_height; +} + +struct NewtonConeParam +{ + dFloat m_radio; + dFloat m_height; +} + +struct NewtonChamferCylinderParam +{ + dFloat m_radio; + dFloat m_height; +} + +struct NewtonConvexHullParam +{ + int m_vertexCount; + int m_vertexStrideInBytes; + int m_faceCount; + dFloat* m_vertex; +} + +struct NewtonCompoundCollisionParam +{ + int m_chidrenCount; +} + +struct NewtonCollisionTreeParam +{ + int m_vertexCount; + int m_indexCount; +} + +struct NewtonDeformableMeshParam +{ + int m_vertexCount; + int m_triangleCount; + int m_vrtexStrideInBytes; + ushort* m_indexList; + dFloat* m_vertexList; +} + +struct NewtonHeightFieldCollisionParam +{ + int m_width; + int m_height; + int m_gridsDiagonals; + int m_elevationDataType; // 0 = 32 bit floats, 1 = unsigned 16 bit integers + dFloat m_verticalScale; + dFloat m_horizonalScale_x; + dFloat m_horizonalScale_z; + dFloat m_horizonalDisplacementScale_x; + dFloat m_horizonalDisplacementScale_z; + void* m_vertialElevation; + short* m_horizotalDisplacement; + char* m_atributes; +} + +struct NewtonSceneCollisionParam +{ + int m_childrenProxyCount; +} + +struct NewtonCollisionInfoRecord +{ + dFloat[4][4] m_offsetMatrix; + NewtonCollisionMaterial m_collisionMaterial; + int m_collisionType; // tag id to identify the collision primitive + + union + { + NewtonBoxParam m_box; + NewtonConeParam m_cone; + NewtonSphereParam m_sphere; + NewtonCapsuleParam m_capsule; + NewtonCylinderParam m_cylinder; + NewtonChamferCylinderParam m_chamferCylinder; + NewtonConvexHullParam m_convexHull; + NewtonDeformableMeshParam m_deformableMesh; + NewtonCompoundCollisionParam m_compoundCollision; + NewtonCollisionTreeParam m_collisionTree; + NewtonHeightFieldCollisionParam m_heightField; + NewtonSceneCollisionParam m_sceneCollision; + dFloat[64] m_paramArray; // user define collision can use this to store information + } +} + +struct NewtonJointRecord +{ + dFloat[4][4] m_attachmenMatrix_0; + dFloat[4][4] m_attachmenMatrix_1; + dFloat[3] m_minLinearDof; + dFloat[3] m_maxLinearDof; + dFloat[3] m_minAngularDof; + dFloat[3] m_maxAngularDof; + const(NewtonBody)* m_attachBody_0; + const(NewtonBody)* m_attachBody_1; + dFloat[64] m_extraParameters; + int m_bodiesCollisionOn; + char[128] m_descriptionType; +} + +struct NewtonUserMeshCollisionCollideDesc +{ + dFloat[4] m_boxP0; // lower bounding box of intersection query in local space + dFloat[4] m_boxP1; // upper bounding box of intersection query in local space + dFloat[4] m_boxDistanceTravel; // max distance that box bpxP0 and boxP1 can travel on this timestep, used this for continue collision mode. + int m_threadNumber; // current thread executing this query + int m_faceCount; // the application should set here how many polygons intersect the query box + int m_vertexStrideInBytes; // the application should set here the size of each vertex + dFloat m_skinThickness; // this is the minimum skin separation specified by the material between these two colliding shapes + void* m_userData; // user data passed to the collision geometry at creation time + + NewtonBody* m_objBody; // pointer to the colliding body + NewtonBody* m_polySoupBody; // pointer to the rigid body owner of this collision tree + NewtonCollision* m_objCollision; // collision shape of the colliding body, (no necessarily the collision of m_objBody) + NewtonCollision* m_polySoupCollision; // collision shape of the collision tree, (no necessarily the collision of m_polySoupBody) + + dFloat* m_vertex; // the application should set here the pointer to the global vertex of the mesh. + int* m_faceIndexCount; // the application should set here the pointer to the vertex count of each face. + int* m_faceVertexIndex; // the application should set here the pointer index array for each vertex on a face. + // the format of a face is I0, I1, I2, I3, ..., M, N, E0, E1, E2, ..., A + // I0, I1, I2, .. are the indices to the vertex, relative to m_vertex pointer + // M is the index to the material sub shape id + // N in the index to the vertex normal relative to m_vertex pointer + // E0, E1, E2, ... are the indices of the the face normal that is shared to that face edge, when the edge does not share a face normal then the edge index is set to index N, which the index to the face normal + // A is and estimate of the largest diagonal of the face, this used internally as a hint to improve floating point accuracy and algorithm performance. +} + +struct NewtonWorldConvexCastReturnInfo +{ + dFloat[4] m_point; // collision point in global space + dFloat[4] m_normal; // surface normal at collision point in global space + //dFloat m_normalOnHitPoint[4]; // surface normal at the surface of the hit body, + // is the same as the normal calculated by a ray cast hitting the body at the hit point + dLong m_contactID; // collision ID at contact point + const(NewtonBody)* m_hitBody; // body hit at contact point + dFloat m_penetration; // contact penetration at collision point +} + +struct NewtonUserMeshCollisionRayHitDesc +{ + dFloat[4] m_p0; // ray origin in collision local space + dFloat[4] m_p1; // ray destination in collision local space + dFloat[4] m_normalOut; // copy here the normal at the ray intersection + dLong m_userIdOut; // copy here a user defined id for further feedback + void* m_userData; // user data passed to the collision geometry at creation time +} + +struct NewtonHingeSliderUpdateDesc +{ + dFloat m_accel; + dFloat m_minFriction; + dFloat m_maxFriction; + dFloat m_timestep; +} + +struct NewtonUserContactPoint +{ + dFloat[4] m_point; + dFloat[4] m_normal; + long m_shapeId0; + long m_shapeId1; + dFloat m_penetration; + int[3] m_unused; +} + +struct NewtonImmediateModeConstraint +{ + dFloat[8][6] m_jacobian01; + dFloat[8][6] m_jacobian10; + dFloat[8] m_minFriction; + dFloat[8] m_maxFriction; + dFloat[8] m_jointAccel; + dFloat[8] m_jointStiffness; +} + +// data structure for interfacing with NewtonMesh +struct NewtonMeshDoubleData +{ + dFloat64* m_data; + int* m_indexList; + int m_strideInBytes; +} + +struct NewtonMeshFloatData +{ + dFloat* m_data; + int* m_indexList; + int m_strideInBytes; +} + +struct NewtonMeshVertexFormat +{ + int m_faceCount; + int* m_faceIndexCount; + int* m_faceMaterial; + NewtonMeshDoubleData m_vertex; + NewtonMeshFloatData m_normal; + NewtonMeshFloatData m_binormal; + NewtonMeshFloatData m_uv0; + NewtonMeshFloatData m_uv1; + NewtonMeshFloatData m_vertexColor; +} + +// Newton callback functions +alias NewtonAllocMemory = void* function (int sizeInBytes); +alias NewtonFreeMemory = void function (void* ptr, int sizeInBytes); + +alias NewtonWorldDestructorCallback = void function (const NewtonWorld* world); +alias NewtonPostUpdateCallback = void function (const NewtonWorld* world, dFloat timestep); + +alias NewtonWorldListenerDebugCallback = void function (const NewtonWorld* world, void* listener, void* debugContext); +alias NewtonWorldListenerBodyDestroyCallback = void function (const NewtonWorld* world, void* listenerUserData, NewtonBody* body_); +alias NewtonWorldUpdateListenerCallback = void function (const NewtonWorld* world, void* listenerUserData, dFloat timestep); +alias NewtonWorldDestroyListenerCallback = void function (const NewtonWorld* world, void* listenerUserData); + +alias NewtonGetTimeInMicrosencondsCallback = dLong function (); + +alias NewtonSerializeCallback = void function (void* serializeHandle, const void* buffer, int size); +alias NewtonDeserializeCallback = void function (void* serializeHandle, void* buffer, int size); + +alias NewtonOnBodySerializationCallback = void function (NewtonBody* body_, void* userData, NewtonSerializeCallback function_, void* serializeHandle); +alias NewtonOnBodyDeserializationCallback = void function (NewtonBody* body_, void* userData, NewtonDeserializeCallback function_, void* serializeHandle); + +alias NewtonOnJointSerializationCallback = void function (const NewtonJoint* joint, NewtonSerializeCallback function_, void* serializeHandle); +alias NewtonOnJointDeserializationCallback = void function (NewtonBody* body0, NewtonBody* body1, NewtonDeserializeCallback function_, void* serializeHandle); + +alias NewtonOnUserCollisionSerializationCallback = void function (void* userData, NewtonSerializeCallback function_, void* serializeHandle); + +// user collision callbacks +alias NewtonUserMeshCollisionDestroyCallback = void function (void* userData); +alias NewtonUserMeshCollisionRayHitCallback = dFloat function (NewtonUserMeshCollisionRayHitDesc* lineDescData); +alias NewtonUserMeshCollisionGetCollisionInfo = void function (void* userData, NewtonCollisionInfoRecord* infoRecord); +alias NewtonUserMeshCollisionAABBTest = int function (void* userData, const dFloat* boxP0, const dFloat* boxP1); +alias NewtonUserMeshCollisionGetFacesInAABB = int function ( + void* userData, + const dFloat* p0, + const dFloat* p1, + const dFloat** vertexArray, + int* vertexCount, + int* vertexStrideInBytes, + const int* indexList, + int maxIndexCount, + const int* userDataList); +alias NewtonUserMeshCollisionCollideCallback = void function (NewtonUserMeshCollisionCollideDesc* collideDescData, const void* continueCollisionHandle); + +alias NewtonTreeCollisionFaceCallback = int function (void* context, const dFloat* polygon, int strideInBytes, const int* indexArray, int indexCount); + +alias NewtonCollisionTreeRayCastCallback = dFloat function (const NewtonBody* body_, const NewtonCollision* treeCollision, dFloat intersection, dFloat* normal, int faceId, void* usedData); +alias NewtonHeightFieldRayCastCallback = dFloat function (const NewtonBody* body_, const NewtonCollision* heightFieldCollision, dFloat intersection, int row, int col, dFloat* normal, int faceId, void* usedData); + +alias NewtonCollisionCopyConstructionCallback = void function (const NewtonWorld* newtonWorld, NewtonCollision* collision, const NewtonCollision* sourceCollision); +alias NewtonCollisionDestructorCallback = void function (const NewtonWorld* newtonWorld, const NewtonCollision* collision); + +// collision tree call back (obsoleted no recommended) +alias NewtonTreeCollisionCallback = void function ( + const NewtonBody* bodyWithTreeCollision, + const NewtonBody* body_, + int faceID, + int vertexCount, + const dFloat* vertex, + int vertexStrideInBytes); + +alias NewtonBodyDestructor = void function (const NewtonBody* body_); +alias NewtonApplyForceAndTorque = extern(C) void function (const NewtonBody* body_, dFloat timestep, int threadIndex); +alias NewtonSetTransform = void function (const NewtonBody* body_, const dFloat* matrix, int threadIndex); + +alias NewtonIslandUpdate = int function (const NewtonWorld* newtonWorld, const(void)* islandHandle, int bodyCount); + +alias NewtonFractureCompoundCollisionOnEmitCompoundFractured = void function (NewtonBody* fracturedBody); +alias NewtonFractureCompoundCollisionOnEmitChunk = void function (NewtonBody* chunkBody, NewtonFracturedCompoundMeshPart* fracturexChunkMesh, const NewtonCollision* fracturedCompountCollision); +alias NewtonFractureCompoundCollisionReconstructMainMeshCallBack = void function (NewtonBody* body_, NewtonFracturedCompoundMeshPart* mainMesh, const NewtonCollision* fracturedCompountCollision); + +alias NewtonWorldRayPrefilterCallback = uint function (const NewtonBody* body_, const NewtonCollision* collision, void* userData); +alias NewtonWorldRayFilterCallback = dFloat function (const NewtonBody* body_, const NewtonCollision* shapeHit, const dFloat* hitContact, const dFloat* hitNormal, long collisionID, void* userData, dFloat intersectParam); + +alias NewtonOnAABBOverlap = int function (const NewtonJoint* contact, dFloat timestep, int threadIndex); +alias NewtonContactsProcess = void function (const NewtonJoint* contact, dFloat timestep, int threadIndex); +// typedef int (*NewtonOnAABBOverlap) (const NewtonMaterial* const material, const NewtonBody* const body0, const NewtonBody* const body1, int threadIndex); +// typedef int (*NewtonOnCompoundSubCollisionAABBOverlap) (const NewtonMaterial* const material, const NewtonBody* const body0, const void* const collisionNode0, const NewtonBody* const body1, const void* const collisionNode1, int threadIndex); +alias NewtonOnCompoundSubCollisionAABBOverlap = int function (const NewtonJoint* contact, dFloat timestep, const NewtonBody* body0, const void* collisionNode0, const NewtonBody* body1, const void* collisionNode1, int threadIndex); +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); + +alias NewtonBodyIterator = int function (const NewtonBody* body_, void* userData); +alias NewtonJointIterator = void function (const NewtonJoint* joint, void* userData); +alias NewtonCollisionIterator = void function (void* userData, int vertexCount, const dFloat* faceArray, int faceId); + +alias NewtonBallCallback = void function (const NewtonJoint* ball, dFloat timestep); +alias NewtonHingeCallback = uint function (const NewtonJoint* hinge, NewtonHingeSliderUpdateDesc* desc); +alias NewtonSliderCallback = uint function (const NewtonJoint* slider, NewtonHingeSliderUpdateDesc* desc); +alias NewtonUniversalCallback = uint function (const NewtonJoint* universal, NewtonHingeSliderUpdateDesc* desc); +alias NewtonCorkscrewCallback = uint function (const NewtonJoint* corkscrew, NewtonHingeSliderUpdateDesc* desc); + +alias NewtonUserBilateralCallback = void function (const NewtonJoint* userJoint, dFloat timestep, int threadIndex); +alias NewtonUserBilateralGetInfoCallback = void function (const NewtonJoint* userJoint, NewtonJointRecord* info); + +alias NewtonConstraintDestructor = void function (const NewtonJoint* me); + +alias NewtonJobTask = void function (NewtonWorld* world, void* userData, int threadIndex); +alias NewtonReportProgress = int function (dFloat normalizedProgressPercent, void* userData);