Extern
'================================================
' World Functions
'================================================
Function NewtonCreate:Byte Ptr( mallocFnt: Byte Ptr, mfreeFnt:Byte Ptr)
Function NewtonDestroy(nWorld: Byte Ptr)
Function NewtonUpdate(newtonWorld: Byte Ptr, time:Float)
Function NewtonDestroyAllBodies(newtonWorld: Byte Ptr)
Function NewtonSetSolverModel(NewtonWorld:Byte Ptr, model:Int)
Function NewtonSetFrictionModel(NewtonWorld:Byte Ptr, model:Int)
Function NewtonGetTimeStep:Float(NewtonWorld:Byte Ptr)
Function NewtonSetMinimumFrameRate(NewtonWorld:Byte Ptr, frameRate:Float)
Function NewtonSetBodyLeaveWorldEvent(NewtonWorld:Byte Ptr, BodyLeaveWorld_callback:Byte Ptr)
Function NewtonSetWorldSize(newtonWorld:Byte Ptr, minPoint: Byte Ptr, maxPoint:Byte Ptr)
Function NewtonWorldFreezeBody(NewtonWorld:Byte Ptr, body:Byte Ptr)
Function NewtonWorldUnfreezeBody(newtonWorld:Byte Ptr, body:Byte Ptr)
Function NewtonWorldForEachBodyDo(NewtonWorld:Byte Ptr, BodyIterator_callback:Byte Ptr)
Function NewtonWorldSetUserData(NewtonWorld:Byte Ptr, userData:Byte Ptr)
Function NewtonWorldGetUserData:Byte Ptr(NewtonWorld:Byte Ptr)
Function NewtonWorldGetVersion:Int(NewtonWorld:Byte Ptr)
Function NewtonWorldRayCast(NewtonWorld:Byte Ptr, p0:Byte Ptr, p1:Byte Ptr, WorldRayFilterCallback:Byte Ptr, userData:Byte Ptr)
Function NewtonWorldCollide:Int(NewtonWorld:Byte Ptr, maxSize:Int,collsionA:Byte Ptr, matrixA:Byte Ptr, collsionB:Byte Ptr, matrixB:Byte Ptr, contacts:Byte Ptr, normals:Byte Ptr, penetration:Byte Ptr)
Function NewtonMaterialGetDefaultGroupID:Int(NewtonWorld:Byte Ptr)
Function NewtonMaterialCreateGroupID:Int(NewtonWorld:Byte Ptr)
Function NewtonMaterialDestroyAllGroupID(NewtonWorld:Byte Ptr)
Function NewtonMaterialSetDefaultSoftness(NewtonWorld:Byte Ptr, id0:Int, id1:Int, value:Float)
Function NewtonMaterialSetDefaultElasticity(NewtonWorld:Byte Ptr, id0:Int, id1:Int, elasticCoef:Float)
Function NewtonMaterialSetDefaultCollidable(NewtonWorld:Byte Ptr, id0:Int, id1:Int, state:Int)
Function NewtonMaterialSetDefaultFriction(NewtonWorld:Byte Ptr, id0:Int, id1:Int, staticFriction:Float, kineticFriction:Float)
Function NewtonMaterialSetCollisionCallback(NewtonWorld:Byte Ptr, id0:Int, id1:Int, userData:Byte Ptr, begin:Byte Ptr, process:Byte Ptr, NEnd:Byte Ptr)
Function NewtonMaterialGetUserData:Byte Ptr(NewtonWorld:Byte Ptr, id0:Int, id1:Int)
Function NewtonMaterialDisableContact (material:Byte Ptr)
Function NewtonMaterialGetCurrentTimestep:Float(material:Byte Ptr)
Function NewtonMaterialGetMaterialPairUserData:Byte Ptr(material:Byte Ptr)
Function NewtonMaterialGetContactFaceAttribute:Int(material: Byte Ptr)
Function NewtonMaterialGetBodyCollisionID:Int(material: Byte Ptr, body:Byte Ptr)
Function NewtonMaterialGetContactNormalSpeed:Float(material:Byte Ptr, contactlHandle:Byte Ptr)
Function NewtonMaterialGetContactForce(material: Byte Ptr, force:Byte Ptr)
Function NewtonMaterialGetContactPositionAndNormal(material:Byte Ptr, posit:Byte Ptr, normal:Byte Ptr)
Function NewtonMaterialGetContactTangentDirections(material:Byte Ptr, dir0:Byte Ptr, dir:Byte Ptr)
Function NewtonMaterialGetContactTangentSpeed:Float(material:Byte Ptr, NewtonContact:Byte Ptr, index:Int)

Function NewtonSetPlatformArchitecture(world:Byte Ptr,mode:Int)

Function NewtonMaterialSetContactSoftness(NewtonMaterial:Byte Ptr, softness:Float)
Function NewtonMaterialSetContactElasticity(NewtonMaterial:Byte Ptr, restitution:Float)
Function NewtonMaterialSetContactFrictionState(NewtonMaterial:Byte Ptr, state:Int, index:Int)
Function NewtonMaterialSetContactStaticFrictionCoef(NewtonMaterial:Byte Ptr, coef:Float, index:Int)
Function NewtonMaterialSetContactKineticFrictionCoef(NewtonMaterial:Byte Ptr, coef:Float, index:Int)
Function NewtonMaterialSetContactTangentAcceleration(NewtonMaterial:Byte Ptr , accel:Float , index:Int)
Function NewtonMaterialSetContactNormalAcceleration(NewtonMaterial:Byte Ptr, accel:Float)
Function NewtonMaterialSetContactNormalDirection(NewtonMaterial:Byte Ptr, dir:Byte Ptr)




Function NewtonMaterialContactRotateTangentDirections(NewtonMaterial:Byte Ptr, directionVector:Byte Ptr)

'================================================
' convex collision primitives creation functions
'================================================
Function NewtonCreateNull:Byte Ptr(NewtonWorld:Byte Ptr)	'NewtonCollision
Function NewtonCreateSphere:Byte Ptr(NewtonWorld:Byte Ptr, radiusX:Float, radiusY:Float, radiusZ:Float, offsetMatrix:Byte Ptr)
Function NewtonCreateBox:Byte Ptr(NewtonWorld:Byte Ptr, dx:Float, dy:Float, dz:Float, offsetMatrix:Byte Ptr)
Function NewtonCreateCone:Byte Ptr(NewtonWorld:Byte Ptr, radius:Float, height:Float, offsetMatrix:Byte Ptr)
Function NewtonCreateCapsule:Byte Ptr(NewtonWorld:Byte Ptr, radius:Float, height:Float, offsetMatrix:Byte Ptr)
Function NewtonCreateCylinder:Byte Ptr(NewtonWorld:Byte Ptr, radius:Float, height:Float, offsetMatrix:Byte Ptr)
Function NewtonCreateChamferCylinder:Byte Ptr(NewtonWorld:Byte Ptr, radius:Float, height:Float, offsetMatrix:Byte Ptr)
Function NewtonCreateConvexHull:Byte Ptr(NewtonWorld:Byte Ptr, count:Int, vertexCloud:Byte Ptr, strideInBytes:Int, offsetMatrix:Byte Ptr)
Function NewtonCreateConvexHullModifier:Byte Ptr(NewtonWorld:Byte Ptr, convexHullCollision:Byte Ptr)
Function NewtonConvexHullModifierGetMatrix(convexHullCollision:Byte Ptr, matrix:Byte Ptr)
Function NewtonConvexHullModifierSetMatrix(convexHullCollision:Byte Ptr, matrix:Byte Ptr)
	
Function NewtonConvexCollisionSetUserID(convexCollision:Byte Ptr, id:Int)
Function NewtonConvexCollisionGetUserID:Int(convexCollision:Byte Ptr)

'================================================
'complex collision primitives creation functions
'================================================
Function NewtonCreateCompoundCollision:Byte Ptr(NewtonWorld:Byte Ptr, count:Int, collisionPrimitiveArray:Byte Ptr[])
Function NewtonCreateUserMeshCollision:Byte Ptr(NewtonWorld:Byte Ptr, minBox:Byte Ptr, maxBox:Byte Ptr, userData:Byte Ptr, collideCallback:Byte Ptr, rayHitCallback:Byte Ptr, destroyCallback:Byte Ptr)

'================================================
' CollisionTree Utility functions
'================================================
Function NewtonCreateTreeCollision:Byte Ptr(NewtonWorld:Byte Ptr, userCallback:Byte Ptr)
Function NewtonTreeCollisionBeginBuild(NewtonCollision: Byte Ptr)
Function NewtonTreeCollisionAddFace(NewtonCollision: Byte Ptr, vertexCount:Int, vertexPtr: Byte Ptr, strideInBytes:Int, faceAttribute:Int)
Function NewtonTreeCollisionEndBuild(NewtonCollision: Byte Ptr, optimize:Int)
'	NEWTON_API void NewtonTreeCollisionSerialize (Const NewtonCollision* treeCollision, NewtonSerialize serializeFunction, 
'		void* serializeHandle);
Function NewtonCreateTreeCollisionFromSerialization:Byte Ptr(NewtonWorld:Byte Ptr, userCallback:Byte Ptr,deserializeFunction:Byte Ptr, serializeHandle:Byte Ptr)
Function NewtonTreeCollisionGetFaceAtribute:Int(NewtonCollision:Byte Ptr, faceIndexArray:Byte Ptr) 
Function NewtonTreeCollisionSetFaceAtribute(NewtonCollision: Byte Ptr, faceIndexArray: Byte Ptr, attribute:Int) 

'================================================
' Collision Miscelaneos Function
'================================================
Function NewtonReleaseCollision(NewtonWorld:Byte Ptr, NewtonCollision:Byte Ptr)
Function NewtonCollisionCalculateAABB(NewtonCollision:Byte Ptr, matrix:Byte Ptr, p0:Byte Ptr, p1:Byte Ptr)
Function NewtonCollisionRayCast:Float(NewtonCollision:Byte Ptr, p0:Byte Ptr, p1:Byte Ptr, normals:Byte Ptr, attribute:Byte Ptr)

'================================================
' transforms utility functions
'================================================
Function NewtonGetEulerAngle(matrix:Byte Ptr, eulersAngles:Byte Ptr)
Function NewtonSetEulerAngle(eulersAngles:Byte Ptr, matrix:Byte Ptr)

'================================================
' body manipulation functions
'================================================
Function NewtonCreateBody:Byte Ptr(NewtonWorld:Byte Ptr, NewtonCollision:Byte Ptr)
Function NewtonDestroyBody(NewtonWorld:Byte Ptr, body:Byte Ptr)

Function NewtonBodyAddForce(body:Byte Ptr, force:Byte Ptr)
Function NewtonBodyAddTorque(body:Byte Ptr, torque:Byte Ptr)

Function NewtonBodySetMatrix(body:Byte Ptr, matrix:Byte Ptr)
Function NewtonBodySetMatrixRecursive(body:Byte Ptr, matrix:Byte Ptr)
Function NewtonBodySetMassMatrix(body:Byte Ptr, mass:Float, Ixx:Float, Iyy:Float, Izz:Float)
Function NewtonBodySetMaterialGroupID(body:Byte Ptr, id:Int)
Function NewtonBodySetContinuousCollisionMode(body:Byte Ptr, state:Int)
Function NewtonBodySetJointRecursiveCollision(body:Byte Ptr, state:Int)
Function NewtonBodySetOmega(body:Byte Ptr, omega:Byte Ptr)
Function NewtonBodySetVelocity(body:Byte Ptr, velocity:Byte Ptr)
Function NewtonBodySetForce (body:Byte Ptr, force:Byte Ptr)
Function NewtonBodySetTorque(body:Byte Ptr, torque:Byte Ptr)
Function NewtonBodySetLinearDamping(body:Byte Ptr, linearDamp:Float)
Function NewtonBodySetAngularDamping(body:Byte Ptr, angularDamp:Byte Ptr)
Function NewtonBodySetUserData(body:Byte Ptr, userData:Byte Ptr)
Function NewtonBodyCoriolisForcesMode(body:Byte Ptr, mode:Int)
Function NewtonBodySetCollision(body:Byte Ptr, collision:Byte Ptr)
Function NewtonBodySetAutoFreeze(body:Byte Ptr, state:Int)
Function NewtonBodySetFreezeTreshold(body:Byte Ptr, freezeSpeed2:Float, freezeOmega2:Float, framesCount:Int)
	
Function NewtonBodySetTransformCallback(body:Byte Ptr, SetTransform_callback:Byte Ptr)
Function NewtonBodySetDestructorCallback(body:Byte Ptr, BodyDest_callback:Byte Ptr)
Function NewtonBodySetAutoactiveCallback(body:Byte Ptr, BodyActState_callback:Byte Ptr)
Function NewtonBodySetForceAndTorqueCallback(body:Byte Ptr, ApplyForceTorque_callback:Byte Ptr)

Function NewtonBodyGetWorld:Byte Ptr(body:Byte Ptr)
Function NewtonBodyGetUserData:Byte Ptr(body:Byte Ptr)
Function NewtonBodyGetCollision:Byte Ptr(body:Byte Ptr)
Function NewtonBodyGetMaterialGroupID:Int(body:Byte Ptr)
Function NewtonBodyGetContinuousCollisionMode:Int(body:Byte Ptr)
Function NewtonBodyGetJointRecursiveCollision:Int(body:Byte Ptr)
Function NewtonBodyGetMatrix(body:Byte Ptr, matrix:Byte Ptr)
Function NewtonBodyGetMassMatrix(body:Byte Ptr, mass:Byte Ptr, Ixx:Byte Ptr, Iyy:Byte Ptr, Izz:Byte Ptr)
Function NewtonBodyGetInvMass(body:Byte Ptr, invMass:Byte Ptr, invIxx:Byte Ptr, invIyy:Byte Ptr, invIzz:Byte Ptr)
Function NewtonBodyGetOmega(body:Byte Ptr, vector:Byte Ptr)
Function NewtonBodyGetVelocity(body:Byte Ptr, vector:Byte Ptr)
Function NewtonBodyGetForce(body:Byte Ptr, vector:Byte Ptr)
Function NewtonBodyGetTorque(body:Byte Ptr, vector:Byte Ptr)
	
Function NewtonBodyGetSleepingState:Int(body:Byte Ptr)
Function NewtonBodyGetAutoFreeze:Int(body:Byte Ptr)
Function NewtonBodyGetLinearDamping:Float(body:Byte Ptr)
Function NewtonBodyGetAngularDamping (body:Byte Ptr, vector:Byte Ptr)
Function NewtonBodyGetAABB (body:Byte Ptr, p0:Byte Ptr, p1:Byte Ptr)	
Function NewtonBodyGetFreezeTreshold(body:Byte Ptr, freezeSpeed2:Byte Ptr, freezeOmega2:Byte Ptr)
Function NewtonBodyGetTotalVolume:Float(body:Byte Ptr)
Function NewtonBodyAddBuoyancyForce(body:Byte Ptr, fluidDensity:Float, fluidLinearViscosity:Float, fluidAngularViscosity:Float,gravityVector:Byte Ptr, buoyancyPlane:Byte Ptr, context:Byte Ptr)

Function NewtonBodyForEachPolygonDo (body:Byte Ptr, CollisionIterator_callback:Byte Ptr)
Function NewtonAddBodyImpulse(body:Byte Ptr, pointDeltaVeloc:Byte Ptr, pointPosit:Byte Ptr)

'================================================
' Common joint funtions
'================================================
Function NewtonJointGetUserData:Byte Ptr(joint:Byte Ptr)
Function NewtonJointSetUserData(joint:Byte Ptr, userData:Byte Ptr)

Function NewtonJointGetCollisionState:Int(joint:Byte Ptr)
Function NewtonJointSetCollisionState(joint:Byte Ptr, state:Int)

Function NewtonJointGetStiffness:Float(joint:Byte Ptr)
Function NewtonJointSetStiffness(joint:Byte Ptr, state:Float)

Function NewtonDestroyJoint(NewtonWorld:Byte Ptr, joint:Byte Ptr)
Function NewtonJointSetDestructor(joint:Byte Ptr, destructor:Byte Ptr)

'================================================
' Ball And Socket joint functions
'================================================
Function NewtonConstraintCreateBall:Byte Ptr(NewtonWorld:Byte Ptr, pivotPoint:Byte Ptr, childBody:Byte Ptr, parentBody:Byte Ptr)
Function NewtonBallSetUserCallback(ball:Byte Ptr, BallCallBack_callback:Byte Ptr)
Function NewtonBallGetJointAngle (ball:Byte Ptr, angle:Byte Ptr)
Function NewtonBallGetJointOmega (ball:Byte Ptr, omega:Byte Ptr)
Function NewtonBallGetJointForce (ball:Byte Ptr, force:Byte Ptr)
Function NewtonBallSetConeLimits (ball:Byte Ptr, pin:Byte Ptr, maxConeAngle:Float, maxTwistAngle:Float)

'================================================
' Hinge joint functions
'================================================
Function NewtonConstraintCreateHinge:Byte Ptr(NewtonWorld:Byte Ptr, pivotPoint:Byte Ptr, pinDir:Byte Ptr, childBody:Byte Ptr, parentBody:Byte Ptr)

Function NewtonHingeSetUserCallback(hinge:Byte Ptr, HingeCallBack_callback:Byte Ptr)
Function NewtonHingeGetJointAngle:Float(hinge:Byte Ptr)
Function NewtonHingeGetJointOmega:Float(hinge:Byte Ptr)
Function NewtonHingeGetJointForce(hinge:Byte Ptr,  force:Byte Ptr)
Function NewtonHingeCalculateStopAlpha:Float(hinge:Byte Ptr, desc:Byte Ptr, angle:Float)


'================================================
' Slider joint functions
'================================================
Function NewtonConstraintCreateSlider:Byte Ptr(NewtonWorld:Byte Ptr,pivotPoint:Byte Ptr, pinDir:Byte Ptr, childBody:Byte Ptr, parentBody:Byte Ptr)
Function NewtonSliderSetUserCallback(slider:Byte Ptr, SliderCallBack_callback:Byte Ptr)
Function NewtonSliderGetJointPosit:Float(slider:Byte Ptr)
Function NewtonSliderGetJointVeloc:Float(slider:Byte Ptr)
Function NewtonSliderGetJointForce (slider:Byte Ptr,  force:Byte Ptr)
Function NewtonSliderCalculateStopAccel:Float(slider:Byte Ptr, desc:Byte Ptr, position:Float)


'================================================
' Corkscrew joint functions
'================================================
Function NewtonConstraintCreateCorkscrew:Byte Ptr(NewtonWorld:Byte Ptr,pivotPoint:Byte Ptr, pinDir:Byte Ptr, childBody:Byte Ptr, parentBody:Byte Ptr)
Function NewtonCorkscrewSetUserCallback(corkscrew:Byte Ptr, CorkscrewCallBack_callback:Byte Ptr)
Function NewtonCorkscrewGetJointPosit:Float (corkscrew:Byte Ptr)
Function NewtonCorkscrewGetJointAngle:Float( corkscrew:Byte Ptr)
Function NewtonCorkscrewGetJointVeloc:Float(corkscrew:Byte Ptr)
Function NewtonCorkscrewGetJointOmega:Float( corkscrew:Byte Ptr)
Function NewtonCorkscrewGetJointForce(corkscrew:Byte Ptr, force:Byte Ptr)
Function NewtonCorkscrewCalculateStopAlpha:Float(corkscrew:Byte Ptr, desc:Byte Ptr, angle:Float)
Function NewtonCorkscrewCalculateStopAccel:Float(corkscrew:Byte Ptr, desc:Byte Ptr, position:Float)


'================================================
' Universal joint functions
'================================================
Function NewtonConstraintCreateUniversal:Byte Ptr(NewtonWorld:Byte Ptr, pivotPoint:Byte Ptr, pinDir0:Byte Ptr, pinDir1:Byte Ptr, childBody:Byte Ptr, parentBody:Byte Ptr)
Function NewtonUniversalSetUserCallback(universal:Byte Ptr, UniversalCallBack_callback:Byte Ptr)
Function NewtonUniversalGetJointAngle0:Float( universal:Byte Ptr)
Function NewtonUniversalGetJointAngle1:Float(universal:Byte Ptr)
Function NewtonUniversalGetJointOmega0:Float( universal:Byte Ptr)
Function NewtonUniversalGetJointOmega1:Float (universal:Byte Ptr)
Function NewtonUniversalGetJointForce(universal:Byte Ptr, force:Byte Ptr)
Function NewtonUniversalCalculateStopAlpha0:Float(universal:Byte Ptr, desc:Byte Ptr, angle:Float)
Function NewtonUniversalCalculateStopAlpha1:Float(universal:Byte Ptr, desc:Byte Ptr, angle:Float)


'================================================
'Up vector joint functions
'================================================
Function NewtonConstraintCreateUpVector:Byte Ptr(NewtonWorld:Byte Ptr, pinDir:Byte Ptr, body:Byte Ptr) 
Function NewtonUpVectorGetPin(upVector:Byte Ptr, pin:Byte Ptr)
Function NewtonUpVectorSetPin(upVector:Byte Ptr, pin:Byte Ptr)


'================================================
' User defined bilateral Joint
'================================================
Function NewtonConstraintCreateUserJoint:Byte Ptr(NewtonWorld:Byte Ptr, maxDOF:Int, UserBilateralCallBack_callback:Byte Ptr, childBody:Byte Ptr, parentBody:Byte Ptr) 
Function NewtonUserJointAddLinearRow(joint:Byte Ptr, pivot0:Byte Ptr, pivot1:Byte Ptr, dir:Byte Ptr)
Function NewtonUserJointAddAngularRow(joint:Byte Ptr, relativeAngle:Float, dir:Byte Ptr)
Function NewtonUserJointSetRowMinimunFriction(joint:Byte Ptr,  friction:Float)
Function NewtonUserJointSetRowMaximunFriction( joint:Float, friction:Float)
Function NewtonUserJointSetRowAcceleration(joint:Byte Ptr,  acceleration:Float)
Function NewtonUserJointSetRowStiffness( joint:Float,stiffness:Float)
Function NewtonUserJointGetRowForce:Float(joint:Byte Ptr, row:Int)


'================================================
' Ragdoll joint contatiner funtion
'================================================
Function NewtonCreateRagDoll:Byte Ptr(NewtonWorld:Byte Ptr)
Function NewtonDestroyRagDoll(NewtonWorld:Byte Ptr, ragDoll:Byte Ptr)

Function NewtonRagDollBegin( ragDoll:Byte Ptr)
Function NewtonRagDollEnd( ragDoll:Byte Ptr)


Function NewtonRagDollFindBone:Byte Ptr( ragDoll:Byte Ptr, id:Int)
Function NewtonRagDollGetRootBone:Byte Ptr( ragDoll:Byte Ptr)

Function NewtonRagDollSetForceAndTorqueCallback( ragDoll:Byte Ptr, ApplyForceAndTorque_callback:Byte Ptr)
Function NewtonRagDollSetTransformCallback(ragDoll:Byte Ptr, SetRagDollTransform_callback:Byte Ptr)
Function NewtonRagDollAddBone:Byte Ptr(ragDoll:Byte Ptr, parent:Byte Ptr, userData:Byte Ptr, mass:Float, matrix:Byte Ptr, boneCollision:Byte Ptr, size:Byte Ptr)

Function NewtonRagDollBoneGetUserData:Byte Ptr( bone:Byte Ptr)
Function NewtonRagDollBoneGetBody:Byte Ptr( bone:Byte Ptr)
Function NewtonRagDollBoneSetID(bone:Byte Ptr, id:Int)


Function NewtonRagDollBoneSetLimits(bone:Byte Ptr, coneDir:Byte Ptr, minConeAngle:Float, maxConeAngle:Float, maxTwistAngle:Float, bilateralConeDir:Byte Ptr, negativeBilateralConeAngle:Float, positiveBilateralConeAngle:Float)
	

Function NewtonRagDollBoneGetLocalMatrix(bone:Byte Ptr,  matrix:Byte Ptr)
Function NewtonRagDollBoneGetFunctionMatrix( bone:Byte Ptr,  matrix:Byte Ptr)


'================================================
' Vehicle joint functions
'================================================
Function NewtonConstraintCreateVehicle:Byte Ptr(NewtonWorld:Byte Ptr, upDir:Byte Ptr, body:Byte Ptr) 
Function NewtonVehicleReset(vehicle:Byte Ptr) 
Function NewtonVehicleSetTireCallback(vehicle:Byte Ptr, update:Byte Ptr)
Function NewtonVehicleAddTire:Int(vehicle:Byte Ptr, localMatrix:Byte Ptr, pin:Byte Ptr, mass:Float, width:Float, radius:Float, suspesionShock:Float, suspesionSpring:Float, suspesionLength:Float, userData:Byte Ptr, collisionID:Int)
Function NewtonVehicleRemoveTire(vehicle:Byte Ptr, tireIndex:Int)
Function NewtonVehicleBalanceTires(vehicle:Byte Ptr, gravityMag:Float)

Function NewtonVehicleGetFirstTireID:Int(vehicle:Byte Ptr)
Function NewtonVehicleGetNextTireID:Int(vehicle:Byte Ptr, tireId:Int)

Function NewtonVehicleTireIsAirBorne:Int (vehicle:Byte Ptr, tireId:Int)
Function NewtonVehicleTireLostSideGrip:Int(vehicle:Byte Ptr, tireId:Int)
Function NewtonVehicleTireLostTraction:Int(vehicle:Byte Ptr, tireId:Int)

Function NewtonVehicleGetTireUserData:Byte Ptr(vehicle:Byte Ptr, tireId:Int)
Function NewtonVehicleGetTireOmega:Float(vehicle:Byte Ptr, tireId:Int)
Function NewtonVehicleGetTireNormalLoad:Float(vehicle:Byte Ptr, tireId:Int)
Function NewtonVehicleGetTireSteerAngle:Float (vehicle:Byte Ptr, tireId:Int)
Function NewtonVehicleGetTireLateralSpeed:Float(vehicle:Byte Ptr, tireId:Int)
Function NewtonVehicleGetTireLongitudinalSpeed:Float(vehicle:Byte Ptr, tireId:Int)
Function hicleGetTireMatrix(vehicle:Byte Ptr, tireId:Int , matrix:Byte Ptr)


Function NewtonVehicleSetTireTorque(vehicle:Byte Ptr, tireId:Int, torque:Float)
Function NewtonVehicleSetTireSteerAngle(vehicle:Byte Ptr, tireId:Int,  angle:Float)
	
Function NewtonVehicleSetTireMaxSideSleepSpeed(vehicle:Byte Ptr, tireId:Int, speed:Float)
Function NewtonVehicleSetTireSideSleepCoeficient(vehicle:Byte Ptr, tireId:Int,  coeficient:Float)
Function NewtonVehicleSetTireMaxLongitudinalSlideSpeed(vehicle:Byte Ptr, tireId:Int, speed:Float)
Function NewtonVehicleSetTireLongitudinalSlideCoeficient(vehicle:Byte Ptr, tireId:Int, coeficient:Float)

Function NewtonVehicleTireCalculateMaxBrakeAcceleration:Float(vehicle:Byte Ptr, tireId:Int)
Function NewtonVehicleTireSetBrakeAcceleration(vehicle:Byte Ptr, tireId:Int,  accelaration:Float, torqueLimit:Float)

Function NewtonConvexCollisionCalculateInertialMatrix(body:Byte Ptr,inertia:Byte Ptr,mass:Byte Ptr)
Function NewtonBodySetCentreOfMass(Node:Byte Ptr,Massp:Byte Ptr)
Function NewtonConvexCollisionCalculateVolume:Float(body:Byte Ptr)
'Function NewtonMaterialContactRotateTangentDirections(NewtonMaterial:Byte Ptr, directionVector:Byte Ptr)
Function NewtonMaterialSetContinuousCollisionMode(NewtonWorld:Byte Ptr, id0:Int,id1:Int,state:Int)


End Extern
