common.bmx 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. ' common.bmx
  2. SuperStrict
  3. Import "source.bmx"
  4. Const NEWTON_DYNAMIC_BODY:Int = 0
  5. Const NEWTON_KINEMATIC_BODY :Int = 1
  6. Const NEWTON_DEFORMABLE_BODY:Int = 2
  7. Extern
  8. Function bmx_newtondynamics_NewtonCreate:Byte Ptr(obj:Object)
  9. Function NewtonDestroy(world:Byte Ptr)
  10. Function NewtonDestroyAllBodies(world:Byte Ptr)
  11. Function NewtonInvalidateCache(world:Byte Ptr)
  12. Function NewtonUpdate(world:Byte Ptr, timestep:Float)
  13. Function NewtonSetFrictionModel(world:Byte Ptr, model:Int)
  14. Function NewtonSetMinimumFrameRate(world:Byte Ptr, framerate:Float)
  15. Function NewtonSetContactMergeTolerance(world:Byte Ptr, tolerance:Float)
  16. Function bmx_newtondynamics_NewtonCreateDynamicBody:Byte Ptr(obj:Object, world:Byte Ptr, coll:Byte Ptr, matrix:Float Ptr)
  17. Function bmx_newtondynamics_NewtonCreateSphere:Byte Ptr(obj:Object, world:Byte Ptr, radius:Float, shapeID:Int, offsetMatrix:Float Ptr)
  18. Function bmx_newtondynamics_NewtonCreateBox:Byte Ptr(obj:Object, world:Byte Ptr, dx:Float, dy:Float, dz:Float, shapeID:Int, offsetMatrix:Float Ptr)
  19. Function bmx_newtondynamics_NewtonCreateTreeCollision:Byte Ptr(obj:Object, world:Byte Ptr, shapeID:Int)
  20. Function bmx_newtondynamics_NewtonCreateCylinder:Byte Ptr(obj:Object, world:Byte Ptr, radius:Float, height:Float, shapeID:Int, offsetMatrix:Float Ptr)
  21. Function NewtonMeshCreate:Byte Ptr(world:Byte Ptr)
  22. Function bmx_newtondynamics_NewtonWorldRayCast(world:Byte Ptr, p0x:Float, p0y:Float, p0z:Float, p1x:Float, p1y:Float, p1z:Float, ..
  23. fcb:Float(bodyPtr:Byte Ptr, collPtr:Byte Ptr, hitContact:Float Ptr, hitNormal:Float Ptr, delPtr:Byte Ptr, intersectParam:Float), ..
  24. delegate:Object, _pfcb:Int(bodyPtr:Byte Ptr, collPtr:Byte Ptr, delPtr:Byte Ptr), threadIndex:Int)
  25. Function NewtonWorldGetBodyCount:Int(world:Byte Ptr)
  26. Function NewtonWorldGetConstraintCount:Int(world:Byte Ptr)
  27. Function NewtonDestroyCollision(coll:Byte Ptr)
  28. Function NewtonTreeCollisionBeginBuild(coll:Byte Ptr)
  29. Function NewtonTreeCollisionEndBuild(coll:Byte Ptr, optimize:Int)
  30. Function NewtonTreeCollisionAddFace(coll:Byte Ptr, vertexCount:Int, vertexPtr:Float Ptr, strideInBytes:Int, faceAttribute:Int)
  31. ' new
  32. Function NewtonBodySetUserData(body:Byte Ptr, userData:Object)
  33. Function NewtonBodyGetUserData:Object(body:Byte Ptr)
  34. Function NewtonCollisionGetUserData:Object(coll:Byte Ptr)
  35. Function bmx_newtondynamics_RayCastDelegateFromPtr:Object(del:Byte Ptr)
  36. Function NewtonBodySetMassMatrix(body:Byte Ptr, mass:Float, Ixx:Float, Iyy:Float, Izz:Float)
  37. Function NewtonDestroyBody(body:Byte Ptr)
  38. Function NewtonBodyGetMatrix(body:Byte Ptr, matrix:Float Ptr)
  39. Function NewtonBodySetForceAndTorqueCallback(body:Byte Ptr, callback(body:Byte Ptr, timestamp:Float, threadIndex:Int))
  40. Function NewtonBodySetSimulationState(body:Byte Ptr, state:Int)
  41. Function NewtonBodyGetSimulationState:Int(body:Byte Ptr)
  42. Function NewtonBodyGetType:Int(body:Byte Ptr)
  43. Function NewtonBodyGetCollidable:Int(body:Byte Ptr)
  44. Function NewtonBodySetCollidable(body:Byte Ptr, collidableState:Int)
  45. Function NewtonBodyGetMassMatrix(body:Byte Ptr, mass:Float Ptr, Ixx:Float Ptr, Iyy:Float Ptr, Izz:Float Ptr)
  46. Function NewtonBodySetMassProperties(body:Byte Ptr, mass:Float, coll:Byte Ptr)
  47. Function NewtonBodySetLinearDamping(body:Byte Ptr, linearDamp:Float)
  48. Function NewtonBodyGetInvMass(body:Byte Ptr, mass:Float Ptr, Ixx:Float Ptr, Iyy:Float Ptr, Izz:Float Ptr)
  49. Function NewtonBodyGetInertiaMatrix(body:Byte Ptr, matrix:Float Ptr)
  50. Function NewtonBodyGetInvInertiaMatrix(body:Byte Ptr, matrix:Float Ptr)
  51. Function NewtonBodySetMatrix(body:Byte Ptr, matrix:Float Ptr)
  52. Function NewtonBodySetTransformCallback(body:Byte Ptr, callback(body:Byte Ptr, matrix:Float Ptr, threadIndex:Int))
  53. Function bmx_newtondynamics_NewtonBodyGetRotation(body:Byte Ptr, q0:Float Ptr, q1:Float Ptr, q2:Float Ptr, q3:Float Ptr)
  54. Function bmx_newtondynamics_NewtonBodyGetOmega(body:Byte Ptr, ox:Float Ptr, oy:Float Ptr, oz:Float Ptr)
  55. Function bmx_newtondynamics_NewtonBodyGetVelocity(body:Byte Ptr, vx:Float Ptr, vy:Float Ptr, vz:Float Ptr)
  56. Function bmx_newtondynamics_NewtonBodyGetForce(body:Byte Ptr, fx:Float Ptr, fy:Float Ptr, fz:Float Ptr)
  57. Function bmx_newtondynamics_NewtonBodyGetTorque(body:Byte Ptr, tx:Float Ptr, ty:Float Ptr, tz:Float Ptr)
  58. Function bmx_newtondynamics_NewtonBodyGetForceAcc(body:Byte Ptr, fx:Float Ptr, fy:Float Ptr, fz:Float Ptr)
  59. Function bmx_newtondynamics_NewtonBodyGetTorqueAcc(body:Byte Ptr, tx:Float Ptr, ty:Float Ptr, tz:Float Ptr)
  60. Function bmx_newtondynamics_NewtonBodyGetCentreOfMass(body:Byte Ptr, cx:Float Ptr, cy:Float Ptr, cz:Float Ptr)
  61. Function bmx_newtondynamics_NewtonBodySetAngularDamping(body:Byte Ptr, aX:Float, aY:Float, aZ:Float)
  62. Function bmx_newtondynamics_NewtonBodyGetAngularDamping(body:Byte Ptr, aX:Float Ptr, aY:Float Ptr, aZ:Float Ptr)
  63. Function bmx_newtondynamics_NewtonBodySetOmega(body:Byte Ptr, ox:Float, oy:Float, oz:Float, ow:Float)
  64. Function bmx_newtondynamics_NewtonBodySetVelocity(body:Byte Ptr, vx:Float, vy:Float, vz:Float, vw:Float)
  65. Function bmx_newtondynamics_NewtonBodySetForce(body:Byte Ptr, fx:Float, fy:Float, yz:Float, fw:Float)
  66. Function bmx_newtondynamics_NewtonBodySetTorque(body:Byte Ptr, tx:Float, ty:Float, tz:Float, tw:Float)
  67. Function bmx_newtondynamics_NewtonBodyGetAABB(body:Byte Ptr, p0x:Float Ptr, p0y:Float Ptr, p0z:Float Ptr, p1x:Float Ptr, p1y:Float Ptr, p1z:Float Ptr)
  68. Function bmx_newtondynamics_NewtonBodyAddForce(body:Byte Ptr, fx:Float, fy:Float, yz:Float)
  69. Function bmx_newtondynamics_NewtonBodyAddTorque(body:Byte Ptr, tx:Float, ty:Float, tz:Float)
  70. Function bmx_newtondynamics_NewtonBodyCalculateInverseDynamicsForce(body:Byte Ptr, timestep:Float, vx:Float, vy:Float, vz:Float, fx:Float Ptr, fy:Float Ptr, fz:Float Ptr)
  71. Function bmx_newtondynamics_matrix_GetEulerAngles(frontX:Float Ptr, pitch0:Float Ptr, yaw0:Float Ptr, roll0:Float Ptr, pitch1:Float Ptr, yaw1:Float Ptr, roll1:Float Ptr)
  72. Function NewtonMeshDestroy(mesh:Byte Ptr)
  73. Function NewtonMeshApplyTransform(mesh:Byte Ptr, matrix:Float Ptr)
  74. Function NewtonMeshCalculateOOBB(mesh:Byte Ptr, matrix:Float Ptr, x:Float Ptr, y:Float Ptr, z:Float Ptr)
  75. Function NewtonMeshCalculateVertexNormals(mesh:Byte Ptr, angle:Float)
  76. Function NewtonMeshApplySphericalMapping(mesh:Byte Ptr, material:Int)
  77. Function NewtonMeshApplyCylindricalMapping(mesh:Byte Ptr, cylinderMaterial:Int, capMaterial:Int)
  78. Function NewtonMeshApplyBoxMapping(mesh:Byte Ptr, front:Int, side:Int, top:Int)
  79. Function NewtonMeshIsOpenMesh:Int(mesh:Byte Ptr)
  80. Function NewtonMeshFixTJoints(mesh:Byte Ptr)
  81. Function NewtonMeshPolygonize(mesh:Byte Ptr)
  82. Function NewtonMeshTriangulate(mesh:Byte Ptr)
  83. Function NewtonMeshBeginFace(mesh:Byte Ptr)
  84. Function NewtonMeshAddFace(mesh:Byte Ptr, vertexCount:Int, vertex:Float Ptr, strideInBytes:Int, materialIndex:Int)
  85. Function NewtonMeshEndFace(mesh:Byte Ptr)
  86. Function NewtonMeshGetVertexCount:Int(mesh:Byte Ptr)
  87. Function NewtonMeshGetVertexStrideInByte:Int(mesh:Byte Ptr)
  88. Function NewtonMeshGetVertexArray:Double Ptr(mesh:Byte Ptr)
  89. Function NewtonMeshGetTotalFaceCount:Int(mesh:Byte Ptr)
  90. Function NewtonMeshGetTotalIndexCount:Int(mesh:Byte Ptr)
  91. Function NewtonMeshGetPointCount:Int(mesh:Byte Ptr)
  92. Function NewtonMeshGetPointStrideInByte:Int(mesh:Byte Ptr)
  93. Function NewtonMeshGetPointArray:Double Ptr(mesh:Byte Ptr)
  94. Function NewtonMeshGetNormalArray:Double Ptr(mesh:Byte Ptr)
  95. Function NewtonMeshGetUV0Array:Double Ptr(mesh:Byte Ptr)
  96. Function NewtonMeshGetUV1Array:Double Ptr(mesh:Byte Ptr)
  97. End Extern