superstrict
ModuleInfo "Version: 1.00"
ModuleInfo "License: zlib"
ModuleInfo "Copyright: Newton Dynamics - 2003-2011 Julio Jerez and Alain Suero"
ModuleInfo "Copyright: Wrapper - 2015-2016 Bruce A Henderson"
ModuleInfo "History: 1.00"
ModuleInfo "History: Initial Release."
ModuleInfo "CC_OPTS: -D_NEWTON_STATIC_LIB"
ModuleInfo "CC_OPTS: -DPTW32_BUILD -DPTW32_STATIC_LIB -D_MINGW_64_VER"
ModuleInfo "CC_OPTS: -msse -msse3 -mfpmath=sse -ffloat-store -ffast-math -freciprocal-math -funsafe-math-optimizations -fsingle-precision-constant"
import brl.blitz
NEWTON_DYNAMIC_BODY%=0
NEWTON_KINEMATIC_BODY%=1
NEWTON_DEFORMABLE_BODY%=2
bmx_newtondynamics_NewtonCreate@*(obj:Object)="bmx_newtondynamics_NewtonCreate"
NewtonDestroy(world@*)="NewtonDestroy"
NewtonDestroyAllBodies(world@*)="NewtonDestroyAllBodies"
NewtonInvalidateCache(world@*)="NewtonInvalidateCache"
NewtonUpdate(world@*,timestep#)="NewtonUpdate"
NewtonSetFrictionModel(world@*,model%)="NewtonSetFrictionModel"
NewtonSetMinimumFrameRate(world@*,framerate#)="NewtonSetMinimumFrameRate"
NewtonSetContactMergeTolerance(world@*,tolerance#)="NewtonSetContactMergeTolerance"
bmx_newtondynamics_NewtonCreateDynamicBody@*(obj:Object,world@*,coll@*,matrix#*)="bmx_newtondynamics_NewtonCreateDynamicBody"
bmx_newtondynamics_NewtonCreateSphere@*(obj:Object,world@*,radius#,shapeID%,offsetMatrix#*)="bmx_newtondynamics_NewtonCreateSphere"
bmx_newtondynamics_NewtonCreateBox@*(obj:Object,world@*,dx#,dy#,dz#,shapeID%,offsetMatrix#*)="bmx_newtondynamics_NewtonCreateBox"
bmx_newtondynamics_NewtonCreateTreeCollision@*(obj:Object,world@*,shapeID%)="bmx_newtondynamics_NewtonCreateTreeCollision"
bmx_newtondynamics_NewtonCreateCylinder@*(obj:Object,world@*,radius#,height#,shapeID%,offsetMatrix#*)="bmx_newtondynamics_NewtonCreateCylinder"
NewtonMeshCreate@*(world@*)="NewtonMeshCreate"
bmx_newtondynamics_NewtonWorldRayCast(world@*,p0x#,p0y#,p0z#,p1x#,p1y#,p1z#,fcb#(bodyPtr@*,collPtr@*,hitContact#*,hitNormal#*,delPtr@*,intersectParam#),delegate:Object,_pfcb%(bodyPtr@*,collPtr@*,delPtr@*),threadIndex%)="bmx_newtondynamics_NewtonWorldRayCast"
NewtonWorldGetBodyCount%(world@*)="NewtonWorldGetBodyCount"
NewtonWorldGetConstraintCount%(world@*)="NewtonWorldGetConstraintCount"
NewtonDestroyCollision(coll@*)="NewtonDestroyCollision"
NewtonTreeCollisionBeginBuild(coll@*)="NewtonTreeCollisionBeginBuild"
NewtonTreeCollisionEndBuild(coll@*,optimize%)="NewtonTreeCollisionEndBuild"
NewtonTreeCollisionAddFace(coll@*,vertexCount%,vertexPtr#*,strideInBytes%,faceAttribute%)="NewtonTreeCollisionAddFace"
NewtonDestroyBody(body@*)="NewtonDestroyBody"
NewtonBodyGetMatrix(body@*,matrix#*)="NewtonBodyGetMatrix"
NewtonBodySetForceAndTorqueCallback(body@*,callback(body@*,timestamp#,threadIndex%))="NewtonBodySetForceAndTorqueCallback"
NewtonBodySetSimulationState(body@*,state%)="NewtonBodySetSimulationState"
NewtonBodyGetSimulationState%(body@*)="NewtonBodyGetSimulationState"
NewtonBodyGetType%(body@*)="NewtonBodyGetType"
NewtonBodyGetCollidable%(body@*)="NewtonBodyGetCollidable"
NewtonBodySetCollidable(body@*,collidableState%)="NewtonBodySetCollidable"
NewtonBodyGetMassMatrix(body@*,mass#*,Ixx#*,Iyy#*,Izz#*)="NewtonBodyGetMassMatrix"
NewtonBodySetMassProperties(body@*,mass#,coll@*)="NewtonBodySetMassProperties"
NewtonBodySetLinearDamping(body@*,linearDamp#)="NewtonBodySetLinearDamping"
NewtonBodyGetInvMass(body@*,mass#*,Ixx#*,Iyy#*,Izz#*)="NewtonBodyGetInvMass"
NewtonBodyGetInertiaMatrix(body@*,matrix#*)="NewtonBodyGetInertiaMatrix"
NewtonBodyGetInvInertiaMatrix(body@*,matrix#*)="NewtonBodyGetInvInertiaMatrix"
NewtonBodySetMatrix(body@*,matrix#*)="NewtonBodySetMatrix"
NewtonBodySetTransformCallback(body@*,callback(body@*,matrix#*,threadIndex%))="NewtonBodySetTransformCallback"
bmx_newtondynamics_NewtonBodyGetRotation(body@*,q0#*,q1#*,q2#*,q3#*)="bmx_newtondynamics_NewtonBodyGetRotation"
bmx_newtondynamics_NewtonBodyGetOmega(body@*,ox#*,oy#*,oz#*)="bmx_newtondynamics_NewtonBodyGetOmega"
bmx_newtondynamics_NewtonBodyGetVelocity(body@*,vx#*,vy#*,vz#*)="bmx_newtondynamics_NewtonBodyGetVelocity"
bmx_newtondynamics_NewtonBodyGetForce(body@*,fx#*,fy#*,fz#*)="bmx_newtondynamics_NewtonBodyGetForce"
bmx_newtondynamics_NewtonBodyGetTorque(body@*,tx#*,ty#*,tz#*)="bmx_newtondynamics_NewtonBodyGetTorque"
bmx_newtondynamics_NewtonBodyGetForceAcc(body@*,fx#*,fy#*,fz#*)="bmx_newtondynamics_NewtonBodyGetForceAcc"
bmx_newtondynamics_NewtonBodyGetTorqueAcc(body@*,tx#*,ty#*,tz#*)="bmx_newtondynamics_NewtonBodyGetTorqueAcc"
bmx_newtondynamics_NewtonBodyGetCentreOfMass(body@*,cx#*,cy#*,cz#*)="bmx_newtondynamics_NewtonBodyGetCentreOfMass"
bmx_newtondynamics_NewtonBodySetAngularDamping(body@*,aX#,aY#,aZ#)="bmx_newtondynamics_NewtonBodySetAngularDamping"
bmx_newtondynamics_NewtonBodyGetAngularDamping(body@*,aX#*,aY#*,aZ#*)="bmx_newtondynamics_NewtonBodyGetAngularDamping"
bmx_newtondynamics_NewtonBodySetOmega(body@*,ox#,oy#,oz#,ow#)="bmx_newtondynamics_NewtonBodySetOmega"
bmx_newtondynamics_NewtonBodySetVelocity(body@*,vx#,vy#,vz#,vw#)="bmx_newtondynamics_NewtonBodySetVelocity"
bmx_newtondynamics_NewtonBodySetForce(body@*,fx#,fy#,yz#,fw#)="bmx_newtondynamics_NewtonBodySetForce"
bmx_newtondynamics_NewtonBodySetTorque(body@*,tx#,ty#,tz#,tw#)="bmx_newtondynamics_NewtonBodySetTorque"
bmx_newtondynamics_NewtonBodyGetAABB(body@*,p0x#*,p0y#*,p0z#*,p1x#*,p1y#*,p1z#*)="bmx_newtondynamics_NewtonBodyGetAABB"
bmx_newtondynamics_NewtonBodyAddForce(body@*,fx#,fy#,yz#)="bmx_newtondynamics_NewtonBodyAddForce"
bmx_newtondynamics_NewtonBodyAddTorque(body@*,tx#,ty#,tz#)="bmx_newtondynamics_NewtonBodyAddTorque"
bmx_newtondynamics_NewtonBodyCalculateInverseDynamicsForce(body@*,timestep#,vx#,vy#,vz#,fx#*,fy#*,fz#*)="bmx_newtondynamics_NewtonBodyCalculateInverseDynamicsForce"
bmx_newtondynamics_matrix_GetEulerAngles(frontX#*,pitch0#*,yaw0#*,roll0#*,pitch1#*,yaw1#*,roll1#*)="bmx_newtondynamics_matrix_GetEulerAngles"
NewtonMeshDestroy(mesh@*)="NewtonMeshDestroy"
NewtonMeshApplyTransform(mesh@*,matrix#*)="NewtonMeshApplyTransform"
NewtonMeshCalculateOOBB(mesh@*,matrix#*,x#*,y#*,z#*)="NewtonMeshCalculateOOBB"
NewtonMeshCalculateVertexNormals(mesh@*,angle#)="NewtonMeshCalculateVertexNormals"
NewtonMeshApplySphericalMapping(mesh@*,material%)="NewtonMeshApplySphericalMapping"
NewtonMeshApplyCylindricalMapping(mesh@*,cylinderMaterial%,capMaterial%)="NewtonMeshApplyCylindricalMapping"
NewtonMeshApplyBoxMapping(mesh@*,front%,side%,top%)="NewtonMeshApplyBoxMapping"
NewtonMeshIsOpenMesh%(mesh@*)="NewtonMeshIsOpenMesh"
NewtonMeshFixTJoints(mesh@*)="NewtonMeshFixTJoints"
NewtonMeshPolygonize(mesh@*)="NewtonMeshPolygonize"
NewtonMeshTriangulate(mesh@*)="NewtonMeshTriangulate"
NewtonMeshBeginFace(mesh@*)="NewtonMeshBeginFace"
NewtonMeshAddFace(mesh@*,vertexCount%,vertex#*,strideInBytes%,materialIndex%)="NewtonMeshAddFace"
NewtonMeshEndFace(mesh@*)="NewtonMeshEndFace"
NewtonMeshGetVertexCount%(mesh@*)="NewtonMeshGetVertexCount"
NewtonMeshGetVertexStrideInByte%(mesh@*)="NewtonMeshGetVertexStrideInByte"
NewtonMeshGetVertexArray!*(mesh@*)="NewtonMeshGetVertexArray"
NewtonMeshGetTotalFaceCount%(mesh@*)="NewtonMeshGetTotalFaceCount"
NewtonMeshGetTotalIndexCount%(mesh@*)="NewtonMeshGetTotalIndexCount"
NewtonMeshGetPointCount%(mesh@*)="NewtonMeshGetPointCount"
NewtonMeshGetPointStrideInByte%(mesh@*)="NewtonMeshGetPointStrideInByte"
NewtonMeshGetPointArray!*(mesh@*)="NewtonMeshGetPointArray"
NewtonMeshGetNormalArray!*(mesh@*)="NewtonMeshGetNormalArray"
NewtonMeshGetUV0Array!*(mesh@*)="NewtonMeshGetUV0Array"
NewtonMeshGetUV1Array!*(mesh@*)="NewtonMeshGetUV1Array"
TNWorld^Object{
.worldPtr@*&
-New()="_newton_dynamics_TNWorld_New"
+Create:TNWorld()="newton_dynamics_TNWorld_Create_TTNWorld"
-CreateDynamicBody:TNBody(collision:TNCollision,matrix:TNMatrix,custom:TNBody="bbNullObject")="newton_dynamics_TNWorld_CreateDynamicBody_TTNCollisionTTNMatrixTTNBody"
-CreateTreeCollision:TNTreeCollision(shapeID%=0,custom:TNTreeCollision="bbNullObject")="newton_dynamics_TNWorld_CreateTreeCollision_iTTNTreeCollision"
-CreateSphere:TNCollision(radius#,shapeID%=0,offsetMatrix:TNMatrix="bbNullObject",custom:TNCollision="bbNullObject")="newton_dynamics_TNWorld_CreateSphere_fiTTNMatrixTTNCollision"
-CreateBox:TNCollision(dx#,dy#,dz#,shapeID%=0,offsetMatrix:TNMatrix="bbNullObject",custom:TNCollision="bbNullObject")="newton_dynamics_TNWorld_CreateBox_fffiTTNMatrixTTNCollision"
-CreateCylinder:TNCollision(radius#,height#,shapeID%=0,offsetMatrix:TNMatrix="bbNullObject",custom:TNCollision="bbNullObject")="newton_dynamics_TNWorld_CreateCylinder_ffiTTNMatrixTTNCollision"
-CreateMesh:TNMesh()="newton_dynamics_TNWorld_CreateMesh"
-SetFrictionModel(model%)="newton_dynamics_TNWorld_SetFrictionModel_i"
-SetMinimumFrameRate(framerate#)="newton_dynamics_TNWorld_SetMinimumFrameRate_f"
-SetContactMergeTolerance(tolerance#)="newton_dynamics_TNWorld_SetContactMergeTolerance_f"
-InvalidateCache()="newton_dynamics_TNWorld_InvalidateCache"
-Update(timestep#)="newton_dynamics_TNWorld_Update_f"
-GetBodyCount%()="newton_dynamics_TNWorld_GetBodyCount"
-GetConstraintCount%()="newton_dynamics_TNWorld_GetConstraintCount"
-RayCast(p0x#,p0y#,p0z#,p1x#,p1y#,p1z#,delegate:TNRayCastDelegate,threadIndex%=0)="newton_dynamics_TNWorld_RayCast_ffffffTTNRayCastDelegatei"
-Destroy()="newton_dynamics_TNWorld_Destroy"
}="newton_dynamics_TNWorld"
TNRayCastDelegate^Object{
.prefilter%&
-New()="_newton_dynamics_TNRayCastDelegate_New"
-OnPreFilter%(body:TNBody,collision:TNCollision)="newton_dynamics_TNRayCastDelegate_OnPreFilter_TTNBodyTTNCollision"
-OnFilter#(body:TNBody,shapeHit:TNCollision,hitContact#*,hitNormal#*,intersectParam#)="newton_dynamics_TNRayCastDelegate_OnFilter_TTNBodyTTNCollisionpfpff"
+_prefilterCallback%(bodyPtr@*,collPtr@*,delPtr@*)="newton_dynamics_TNRayCastDelegate__prefilterCallback_i_pbpbpb"
+_filterCallback#(bodyPtr@*,collPtr@*,hitContact#*,hitNormal#*,delPtr@*,intersectParam#)="newton_dynamics_TNRayCastDelegate__filterCallback_f_pbpbpfpfpbf"
}="newton_dynamics_TNRayCastDelegate"
TNCollision^Object{
.collisionPtr@*&
-New()="_newton_dynamics_TNCollision_New"
-Destroy()="newton_dynamics_TNCollision_Destroy"
}="newton_dynamics_TNCollision"
TNTreeCollision^TNCollision{
-New()="_newton_dynamics_TNTreeCollision_New"
-BeginBuild()="newton_dynamics_TNTreeCollision_BeginBuild"
-EndBuild(optimize%)="newton_dynamics_TNTreeCollision_EndBuild_i"
-AddFace(vertexCount%,vertexPtr#*,strideInBytes%,faceAttribute%)="newton_dynamics_TNTreeCollision_AddFace_ipfii"
}="newton_dynamics_TNTreeCollision"
TNBody^Object{
.bodyPtr@*&
._fatCallback(body:TNBody,timestamp#,threadIndex%)&
._transCallback(body:TNBody,matrix#*,threadIndex%)&
-New()="_newton_dynamics_TNBody_New"
-OnForceAndTorque(timestamp#,threadIndex%)="newton_dynamics_TNBody_OnForceAndTorque_fi"
-OnTransform(matrix#*,threadIndex%)="newton_dynamics_TNBody_OnTransform_pfi"
-SetMatrix(matrix:TNMatrix)="newton_dynamics_TNBody_SetMatrix_TTNMatrix"
-GetMatrix(matrix:TNMatrix)="newton_dynamics_TNBody_GetMatrix_TTNMatrix"
-GetMassMatrix(mass# Var,Ixx# Var,Iyy# Var,Izz# Var)="newton_dynamics_TNBody_GetMassMatrix_vfvfvfvf"
-GetRotation(q0# Var,q1# Var,q2# Var,q3# Var)="newton_dynamics_TNBody_GetRotation_vfvfvfvf"
-GetInvMass(mass# Var,Ixx# Var,Iyy# Var,Izz# Var)="newton_dynamics_TNBody_GetInvMass_vfvfvfvf"
-GetInertiaMatrix(matrix:TNMatrix)="newton_dynamics_TNBody_GetInertiaMatrix_TTNMatrix"
-GetInvInertiaMatrix(matrix:TNMatrix)="newton_dynamics_TNBody_GetInvInertiaMatrix_TTNMatrix"
-GetOmega(ox# Var,oy# Var,oz# Var)="newton_dynamics_TNBody_GetOmega_vfvfvf"
-GetVelocity(vx# Var,vy# Var,vz# Var)="newton_dynamics_TNBody_GetVelocity_vfvfvf"
-GetForce(fx# Var,fy# Var,fz# Var)="newton_dynamics_TNBody_GetForce_vfvfvf"
-GetTorque(tx# Var,ty# Var,tz# Var)="newton_dynamics_TNBody_GetTorque_vfvfvf"
-GetForceAcc(fx# Var,fy# Var,fz# Var)="newton_dynamics_TNBody_GetForceAcc_vfvfvf"
-GetTorqueAcc(tx# Var,ty# Var,tz# Var)="newton_dynamics_TNBody_GetTorqueAcc_vfvfvf"
-GetCentreOfMass(cx# Var,cy# Var,cz# Var)="newton_dynamics_TNBody_GetCentreOfMass_vfvfvf"
-GetAngularDamping(aX# Var,aY# Var,aZ# Var)="newton_dynamics_TNBody_GetAngularDamping_vfvfvf"
-NewtonBodyGetAABB(p0x# Var,p0y# Var,p0z# Var,p1x# Var,p1y# Var,p1z# Var)="newton_dynamics_TNBody_NewtonBodyGetAABB_vfvfvfvfvfvf"
-SetAngularDamping(aX#,aY#,aZ#)="newton_dynamics_TNBody_SetAngularDamping_fff"
-SetForceAndTorqueCallback(callback(body:TNBody,timestamp#,threadIndex%))="newton_dynamics_TNBody_SetForceAndTorqueCallback_F_TTNBodyfi_v_"
-SetTransformCallback(callback(body:TNBody,matrix#*,threadIndex%))="newton_dynamics_TNBody_SetTransformCallback_F_TTNBodypfi_v_"
-SetOmega(ox#,oy#,oz#,ow#)="newton_dynamics_TNBody_SetOmega_ffff"
-SetForce(fx#,fy#,fz#,fw#)="newton_dynamics_TNBody_SetForce_ffff"
-SetVelocity(vx#,vy#,vz#,vw#)="newton_dynamics_TNBody_SetVelocity_ffff"
-SetTorque(tx#,ty#,tz#,tw#)="newton_dynamics_TNBody_SetTorque_ffff"
-SetMassProperties(mass#,collision:TNCollision)="newton_dynamics_TNBody_SetMassProperties_fTTNCollision"
-SetLinearDamping(linearDamp#)="newton_dynamics_TNBody_SetLinearDamping_f"
-GetType%()="newton_dynamics_TNBody_GetType"
-GetCollidable%()="newton_dynamics_TNBody_GetCollidable"
-SetCollidable(collidableState%)="newton_dynamics_TNBody_SetCollidable_i"
-AddForce(fx#,fy#,fz#)="newton_dynamics_TNBody_AddForce_fff"
-AddTorque(tx#,ty#,tz#)="newton_dynamics_TNBody_AddTorque_fff"
-CalculateInverseDynamicsForce(timestep#,vx#,vy#,vz#,fx# Var,fy# Var,fz# Var)="newton_dynamics_TNBody_CalculateInverseDynamicsForce_ffffvfvfvf"
+_forceAndTorqueCallback(bodyPtr@*,timestamp#,threadIndex%)="newton_dynamics_TNBody__forceAndTorqueCallback_v_pbfi"
+_defaultForceAndTorqueCallback(bodyPtr@*,timestamp#,threadIndex%)="newton_dynamics_TNBody__defaultForceAndTorqueCallback_v_pbfi"
+_transformCallback(bodyPtr@*,matrix#*,threadIndex%)="newton_dynamics_TNBody__transformCallback_v_pbpfi"
+_defaultTransformCallback(bodyPtr@*,matrix#*,threadIndex%)="newton_dynamics_TNBody__defaultTransformCallback_v_pbpfi"
-Destroy()="newton_dynamics_TNBody_Destroy"
}="newton_dynamics_TNBody"
TNMesh^Object{
.meshPtr@*&
-New()="_newton_dynamics_TNMesh_New"
-ApplyTransform(matrix:TNMatrix)="newton_dynamics_TNMesh_ApplyTransform_TTNMatrix"
-CalculateOOBB(matrix:TNMatrix,x# Var,y# Var,z# Var)="newton_dynamics_TNMesh_CalculateOOBB_TTNMatrixvfvfvf"
-CalculateVertexNormals(angle#)="newton_dynamics_TNMesh_CalculateVertexNormals_f"
-ApplySphericalMapping(material%)="newton_dynamics_TNMesh_ApplySphericalMapping_i"
-ApplyCylindricalMapping(cylinderMaterial%,capMaterial%)="newton_dynamics_TNMesh_ApplyCylindricalMapping_ii"
-ApplyBoxMapping(front%,side%,top%)="newton_dynamics_TNMesh_ApplyBoxMapping_iii"
-IsOpenMesh%()="newton_dynamics_TNMesh_IsOpenMesh"
-FixTJoints()="newton_dynamics_TNMesh_FixTJoints"
-Polygonize()="newton_dynamics_TNMesh_Polygonize"
-Triangulate()="newton_dynamics_TNMesh_Triangulate"
-BeginFace()="newton_dynamics_TNMesh_BeginFace"
-AddFace(vertexCount%,vertex#*,strideInBytes%,materialIndex%)="newton_dynamics_TNMesh_AddFace_ipfii"
-EndFace()="newton_dynamics_TNMesh_EndFace"
-GetTotalFaceCount%()="newton_dynamics_TNMesh_GetTotalFaceCount"
-GetTotalIndexCount%()="newton_dynamics_TNMesh_GetTotalIndexCount"
-GetPointCount%()="newton_dynamics_TNMesh_GetPointCount"
-GetPointStrideInByte%()="newton_dynamics_TNMesh_GetPointStrideInByte"
-GetPointArray!*()="newton_dynamics_TNMesh_GetPointArray"
-GetNormalArray!*()="newton_dynamics_TNMesh_GetNormalArray"
-GetUV0Array!*()="newton_dynamics_TNMesh_GetUV0Array"
-GetUV1Array!*()="newton_dynamics_TNMesh_GetUV1Array"
-GetVertexCount%()="newton_dynamics_TNMesh_GetVertexCount"
-GetVertexStrideInByte%()="newton_dynamics_TNMesh_GetVertexStrideInByte"
-MeshGetVertexArray!*()="newton_dynamics_TNMesh_MeshGetVertexArray"
-Destroy()="newton_dynamics_TNMesh_Destroy"
}="newton_dynamics_TNMesh"
TNMatrix^Object{
.frontX#&
.frontY#&
.frontZ#&
.frontW#&
.upX#&
.upY#&
.upZ#&
.upW#&
.rightX#&
.rightY#&
.rightZ#&
.rightW#&
.positX#&
.positY#&
.positZ#&
.positW#&
-New()="_newton_dynamics_TNMatrix_New"
+GetIdentityMatrix:TNMatrix()="newton_dynamics_TNMatrix_GetIdentityMatrix_TTNMatrix"
-GetEulerAngles(pitch0# Var,yaw0# Var,roll0# Var,pitch1# Var,yaw1# Var,roll1# Var)="newton_dynamics_TNMatrix_GetEulerAngles_vfvfvfvfvfvf"
}="newton_dynamics_TNMatrix"
NewtonBodyGetUserData:TNBody(body@*)="NewtonBodyGetUserData"
NewtonCollisionGetUserData:TNCollision(coll@*)="NewtonCollisionGetUserData"
bmx_newtondynamics_RayCastDelegateFromPtr:TNRayCastDelegate(del@*)="bmx_newtondynamics_RayCastDelegateFromPtr"