hi there,
The documentation that comes with the Tokamak API will tell you what functions are available, and what they do - although it is a bit cryptic. Calling the DLL from darkbasic, you would have to use the decorated C++ function names, which is no fun at all in my opinion. I was messing around with it a while ago with the intention of creating a dll that would be easy to call in DBC. I got frustrated because of the lack of documentation available.
I started working with the ODE dll with the same intentions. I got much further on that, and it actually helped me to understand Tokamak a little better. But like so many projects, that one is also sitting in a basement cabinet somewhere.
Anyway, check out this website for some info on Tokamak:
http://www.adamdawes.com/programming/tokamak/index.html
And here is a list of the decorated C++ functions. Reference the API docs to match which function does what with the real function names.
??0neAnimatedBody@@IAE@XZ
??0neCollisionTable@@IAE@XZ
??0neGeometry@@IAE@XZ
??0neJoint@@IAE@XZ
??0neJointController@@IAE@XZ
??0neRigidBody@@IAE@XZ
??0neRigidBodyController@@IAE@XZ
??0neSensor@@IAE@XZ
??0neSimulator@@IAE@XZ
??4neAnimatedBody@@IAEAAV0@ABV0@@Z
??4neCollisionTable@@IAEAAV0@ABV0@@Z
??4neGeometry@@IAEAAV0@ABV0@@Z
??4neJoint@@IAEAAV0@ABV0@@Z
??4neJointController@@IAEAAV0@ABV0@@Z
??4neRigidBody@@IAEAAV0@ABV0@@Z
??4neRigidBodyController@@IAEAAV0@ABV0@@Z
??4neSensor@@IAEAAV0@ABV0@@Z
??4neSimulator@@IAEAAV0@ABV0@@Z
?Active@neAnimatedBody@@QAEHXZ
?Active@neAnimatedBody@@QAEXHPAV1@@Z
?Active@neAnimatedBody@@QAEXHPAVneRigidBody@@@Z
?Active@neRigidBody@@QAEHXZ
?Active@neRigidBody@@QAEXHPAV1@@Z
?Active@neRigidBody@@QAEXHPAVneAnimatedBody@@@Z
?AddController@neJoint@@QAEPAVneJointController@@PAVneJointControllerCallback@@H@Z
?AddController@neRigidBody@@QAEPAVneRigidBodyController@@PAVneRigidBodyControllerCallback@@H@Z
?AddGeometry@neAnimatedBody@@QAEPAVneGeometry@@XZ
?AddGeometry@neRigidBody@@QAEPAVneGeometry@@XZ
?AddSensor@neAnimatedBody@@QAEPAVneSensor@@XZ
?AddSensor@neRigidBody@@QAEPAVneSensor@@XZ
?Advance@neSimulator@@QAEXMHPAVnePerformanceReport@@@Z
?Advance@neSimulator@@QAEXMMMPAVnePerformanceReport@@@Z
?ApplyImpulse@neRigidBody@@QAEXABUneV3@@0@Z
?ApplyImpulse@neRigidBody@@QAEXABUneV3@@@Z
?ApplyTwist@neRigidBody@@QAEXABUneV3@@@Z
?BeginIterateController@neJoint@@QAEXXZ
?BeginIterateController@neRigidBody@@QAEXXZ
?BeginIterateGeometry@neAnimatedBody@@QAEXXZ
?BeginIterateGeometry@neRigidBody@@QAEXXZ
?BeginIterateSensor@neAnimatedBody@@QAEXXZ
?BeginIterateSensor@neRigidBody@@QAEXXZ
?BreakGeometry@neAnimatedBody@@QAEPAVneRigidBody@@PAVneGeometry@@@Z
?BreakGeometry@neRigidBody@@QAEPAV1@PAVneGeometry@@@Z
?CollideConnected@neAnimatedBody@@QAEHXZ
?CollideConnected@neAnimatedBody@@QAEXH@Z
?CollideConnected@neRigidBody@@QAEHXZ
?CollideConnected@neRigidBody@@QAEXH@Z
?CollideDirectlyConnected@neAnimatedBody@@QAEHXZ
?CollideDirectlyConnected@neAnimatedBody@@QAEXH@Z
?CollideDirectlyConnected@neRigidBody@@QAEHXZ
?CollideDirectlyConnected@neRigidBody@@QAEXH@Z
?CreateAnimatedBody@neSimulator@@QAEPAVneAnimatedBody@@XZ
?CreateJoint@neSimulator@@QAEPAVneJoint@@PAVneRigidBody@@0@Z
?CreateJoint@neSimulator@@QAEPAVneJoint@@PAVneRigidBody@@@Z
?CreateJoint@neSimulator@@QAEPAVneJoint@@PAVneRigidBody@@PAVneAnimatedBody@@@Z
?CreateRigidBody@neSimulator@@QAEPAVneRigidBody@@XZ
?CreateRigidParticle@neSimulator@@QAEPAVneRigidBody@@XZ
?CreateSimulator@neSimulator@@SAPAV1@ABVneSimulatorSizeInfo@@PAVneAllocatorAbstract@@PBUneV3@@@Z
?DestroySimulator@neSimulator@@SAXPAV1@@Z
?Enable@neJoint@@QAEHXZ
?Enable@neJoint@@QAEXH@Z
?EnableLimit2@neJoint@@QAEHXZ
?EnableLimit2@neJoint@@QAEXH@Z
?EnableLimit@neJoint@@QAEHXZ
?EnableLimit@neJoint@@QAEXH@Z
?EnableMotor2@neJoint@@QAEHXZ
?EnableMotor2@neJoint@@QAEXH@Z
?EnableMotor@neJoint@@QAEHXZ
?EnableMotor@neJoint@@QAEXH@Z
?FreeAnimatedBody@neSimulator@@QAEXPAVneAnimatedBody@@@Z
?FreeJoint@neSimulator@@QAEXPAVneJoint@@@Z
?FreeRigidBody@neSimulator@@QAEXPAVneRigidBody@@@Z
?FreeTerrainMesh@neSimulator@@QAEXXZ
?Get@neCollisionTable@@QAE?AW4neReponseBitFlag@1@HH@Z
?GetAngularDamping@neRigidBody@@QAEMXZ
?GetAngularMomentum@neRigidBody@@QAE?AUneV3@@XZ
?GetAngularVelocity@neRigidBody@@QAE?AUneV3@@XZ
?GetAnimatedBodyB@neJoint@@QAEPAVneAnimatedBody@@XZ
?GetBoxSize@neGeometry@@QAEHAAUneV3@@@Z
?GetBreakageAbsorption@neGeometry@@QAEMXZ
?GetBreakageCallback@neSimulator@@QAEP6AXPAEW4neBodyType@@PAVneGeometry@@PAVneRigidBody@@@ZXZ
?GetBreakageFlag@neGeometry@@QAE?AW4neBreakFlag@1@XZ
?GetBreakageInertiaTensor@neGeometry@@QAE?AUneV3@@XZ
?GetBreakageMagnitude@neGeometry@@QAEMXZ
?GetBreakageMass@neGeometry@@QAEMXZ
?GetBreakageNeighbourRadius@neGeometry@@QAEMXZ
?GetBreakagePlane@neGeometry@@QAE?AUneV3@@XZ
?GetCollisionCallback@neSimulator@@QAEP6AXAAUneCollisionInfo@@@ZXZ
?GetCollisionID@neAnimatedBody@@QAEHXZ
?GetCollisionID@neRigidBody@@QAEHXZ
?GetCollisionTable@neSimulator@@QAEPAVneCollisionTable@@XZ
?GetControllerForce@neRigidBodyController@@QAE?AUneV3@@XZ
?GetControllerForceBodyA@neJointController@@QAE?AUneV3@@XZ
?GetControllerForceBodyB@neJointController@@QAE?AUneV3@@XZ
?GetControllerTorque@neRigidBodyController@@QAE?AUneV3@@XZ
?GetControllerTorqueBodyA@neJointController@@QAE?AUneV3@@XZ
?GetControllerTorqueBodyB@neJointController@@QAE?AUneV3@@XZ
?GetConvexMesh@neGeometry@@QAEHAAPAE@Z
?GetCurrentSizeInfo@neSimulator@@QAE?AVneSimulatorSizeInfo@@XZ
?GetCustomCDRB2ABCallback@neSimulator@@QAEP6AHPAVneRigidBody@@PAVneAnimatedBody@@AAUneCustomCDInfo@@@ZXZ
?GetCustomCDRB2RBCallback@neSimulator@@QAEP6AHPAVneRigidBody@@0AAUneCustomCDInfo@@@ZXZ
?GetCylinder@neGeometry@@QAEHAAM0@Z
?GetDampingFactor@neJoint@@QAEMXZ
?GetDetectAnimatedBody@neSensor@@QAEPAVneAnimatedBody@@XZ
?GetDetectContactPoint@neSensor@@QAE?AUneV3@@XZ
?GetDetectDepth@neSensor@@QAEMXZ
?GetDetectMaterial@neSensor@@QAEHXZ
?GetDetectNormal@neSensor@@QAE?AUneV3@@XZ
?GetDetectRigidBody@neSensor@@QAEPAVneRigidBody@@XZ
?GetEpsilon@neJoint@@QAEMXZ
?GetForce@neRigidBody@@QAE?AUneV3@@XZ
?GetGeometryCount@neAnimatedBody@@QAEHXZ
?GetGeometryCount@neRigidBody@@QAEHXZ
?GetIteration@neJoint@@QAEHXZ
?GetJoint@neJointController@@QAEPAVneJoint@@XZ
?GetJointFrameA@neJoint@@QAE?AUneT3@@XZ
?GetJointFrameB@neJoint@@QAE?AUneT3@@XZ
?GetJointLength@neJoint@@QAEMXZ
?GetLinePos@neSensor@@QAE?AUneV3@@XZ
?GetLineUnitVector@neSensor@@QAE?AUneV3@@XZ
?GetLineVector@neSensor@@QAE?AUneV3@@XZ
?GetLinearDamping@neRigidBody@@QAEMXZ
?GetLogOutputCallback@neSimulator@@QAEP6AXPAD@ZXZ
?GetLowerLimit2@neJoint@@QAEMXZ
?GetLowerLimit@neJoint@@QAEMXZ
?GetMass@neRigidBody@@QAEMXZ
?GetMaterial@neSimulator@@QAE_NHAAM0@Z
?GetMaterialIndex@neGeometry@@QAEHXZ
?GetMaxCollisionID@neCollisionTable@@QAEHXZ
?GetMemoryAllocated@neSimulator@@QAEXAAH@Z
?GetMotor2@neJoint@@QAEXAAW4MotorType@1@AAM1@Z
?GetMotor@neJoint@@QAEXAAW4MotorType@1@AAM1@Z
?GetNextController@neJoint@@QAEPAVneJointController@@XZ
?GetNextController@neRigidBody@@QAEPAVneRigidBodyController@@XZ
?GetNextGeometry@neAnimatedBody@@QAEPAVneGeometry@@XZ
?GetNextGeometry@neRigidBody@@QAEPAVneGeometry@@XZ
?GetNextSensor@neAnimatedBody@@QAEPAVneSensor@@XZ
?GetNextSensor@neRigidBody@@QAEPAVneSensor@@XZ
?GetPos@neAnimatedBody@@QAE?AUneV3@@XZ
?GetPos@neRigidBody@@QAE?AUneV3@@XZ
?GetRigidBody@neRigidBodyController@@QAEPAVneRigidBody@@XZ
?GetRigidBodyA@neJoint@@QAEPAVneRigidBody@@XZ
?GetRigidBodyB@neJoint@@QAEPAVneRigidBody@@XZ
?GetRotationM3@neAnimatedBody@@QAE?AUneM3@@XZ
?GetRotationM3@neRigidBody@@QAE?AUneM3@@XZ
?GetRotationQ@neAnimatedBody@@QAE?AUneQ@@XZ
?GetRotationQ@neRigidBody@@QAE?AUneQ@@XZ
?GetSleepingParameter@neRigidBody@@QAEMXZ
?GetSphereDiameter@neGeometry@@QAEHAAM@Z
?GetStartSizeInfo@neSimulator@@QAE?AVneSimulatorSizeInfo@@XZ
?GetTerrainTriangleQueryCallback@neSimulator@@QAEP6AXABUneV3@@0PAPAHPAPAVneTriangle@@PAPAU2@PAH4PAVneRigidBody@@@ZXZ
?GetTorque@neRigidBody@@QAE?AUneV3@@XZ
?GetTransform@neAnimatedBody@@QAE?AUneT3@@XZ
?GetTransform@neGeometry@@QAE?AUneT3@@XZ
?GetTransform@neRigidBody@@QAE?AUneT3@@XZ
?GetType@neJoint@@QAE?AW4ConstraintType@1@XZ
?GetUpperLimit2@neJoint@@QAEMXZ
?GetUpperLimit@neJoint@@QAEMXZ
?GetUserData@neAnimatedBody@@QAEIXZ
?GetUserData@neGeometry@@QAEIXZ
?GetUserData@neRigidBody@@QAEIXZ
?GetUserData@neSensor@@QAEIXZ
?GetVelocity@neRigidBody@@QAE?AUneV3@@XZ
?GetVelocityAtPoint@neRigidBody@@QAE?AUneV3@@ABU2@@Z
?Gravity@neSimulator@@QAE?AUneV3@@XZ
?Gravity@neSimulator@@QAEXABUneV3@@@Z
?GravityEnable@neRigidBody@@QAEHXZ
?GravityEnable@neRigidBody@@QAEXH@Z
?IsIdle@neRigidBody@@QAEHXZ
?RemoveController@neJoint@@QAEHPAVneJointController@@@Z
?RemoveController@neRigidBody@@QAEHPAVneRigidBodyController@@@Z
?RemoveGeometry@neAnimatedBody@@QAEHPAVneGeometry@@@Z
?RemoveGeometry@neRigidBody@@QAEHPAVneGeometry@@@Z
?RemoveSensor@neAnimatedBody@@QAEHPAVneSensor@@@Z
?RemoveSensor@neRigidBody@@QAEHPAVneSensor@@@Z
?Set@neCollisionTable@@QAEXHHW4neReponseBitFlag@1@@Z
?SetAngularDamping@neRigidBody@@QAEXM@Z
?SetAngularMomentum@neRigidBody@@QAEXABUneV3@@@Z
?SetBoxSize@neGeometry@@QAEXABUneV3@@@Z
?SetBoxSize@neGeometry@@QAEXMMM@Z
?SetBreakageAbsorption@neGeometry@@QAEXM@Z
?SetBreakageCallback@neSimulator@@QAEXP6AXPAEW4neBodyType@@PAVneGeometry@@PAVneRigidBody@@@Z@Z
?SetBreakageFlag@neGeometry@@QAEXW4neBreakFlag@1@@Z
?SetBreakageInertiaTensor@neGeometry@@QAEXABUneV3@@@Z
?SetBreakageMagnitude@neGeometry@@QAEXM@Z
?SetBreakageMass@neGeometry@@QAEXM@Z
?SetBreakageNeighbourRadius@neGeometry@@QAEXM@Z
?SetBreakagePlane@neGeometry@@QAEXABUneV3@@@Z
?SetCollisionCallback@neSimulator@@QAEXP6AXAAUneCollisionInfo@@@Z@Z
?SetCollisionID@neAnimatedBody@@QAEXH@Z
?SetCollisionID@neRigidBody@@QAEXH@Z
?SetControllerForce@neRigidBodyController@@QAEXABUneV3@@@Z
?SetControllerForceBodyA@neJointController@@QAEXABUneV3@@@Z
?SetControllerForceBodyB@neJointController@@QAEXABUneV3@@@Z
?SetControllerForceWithTorque@neRigidBodyController@@QAEXABUneV3@@0@Z
?SetControllerForceWithTorqueBodyA@neJointController@@QAEXABUneV3@@0@Z
?SetControllerForceWithTorqueBodyB@neJointController@@QAEXABUneV3@@0@Z
?SetControllerTorque@neRigidBodyController@@QAEXABUneV3@@@Z
?SetControllerTorqueBodyA@neJointController@@QAEXABUneV3@@@Z
?SetControllerTorqueBodyB@neJointController@@QAEXABUneV3@@@Z
?SetConvexMesh@neGeometry@@QAEXPAE@Z
?SetCustomCDRB2ABCallback@neSimulator@@QAEXP6AHPAVneRigidBody@@PAVneAnimatedBody@@AAUneCustomCDInfo@@@Z@Z
?SetCustomCDRB2RBCallback@neSimulator@@QAEXP6AHPAVneRigidBody@@0AAUneCustomCDInfo@@@Z@Z
?SetCylinder@neGeometry@@QAEXMM@Z
?SetDampingFactor@neJoint@@QAEXM@Z
?SetEpsilon@neJoint@@QAEXM@Z
?SetForce@neRigidBody@@QAEXABUneV3@@0@Z
?SetForce@neRigidBody@@QAEXABUneV3@@@Z
?SetInertiaTensor@neRigidBody@@QAEXABUneM3@@@Z
?SetInertiaTensor@neRigidBody@@QAEXABUneV3@@@Z
?SetIteration@neJoint@@QAEXH@Z
?SetJointFrameA@neJoint@@QAEXABUneT3@@@Z
?SetJointFrameB@neJoint@@QAEXABUneT3@@@Z
?SetJointFrameWorld@neJoint@@QAEXABUneT3@@@Z
?SetJointLength@neJoint@@QAEXM@Z
?SetLineSensor@neSensor@@QAEXABUneV3@@0@Z
?SetLinearDamping@neRigidBody@@QAEXM@Z
?SetLogOutputCallback@neSimulator@@QAEXP6AXPAD@Z@Z
?SetLogOutputLevel@neSimulator@@QAEXW4LOG_OUTPUT_LEVEL@1@@Z
?SetLowerLimit2@neJoint@@QAEXM@Z
?SetLowerLimit@neJoint@@QAEXM@Z
?SetMass@neRigidBody@@QAEXM@Z
?SetMaterial@neSimulator@@QAE_NHMM@Z
?SetMaterialIndex@neGeometry@@QAEXH@Z
?SetMotor2@neJoint@@QAEXW4MotorType@1@MM@Z
?SetMotor@neJoint@@QAEXW4MotorType@1@MM@Z
?SetPos@neAnimatedBody@@QAEXABUneV3@@@Z
?SetPos@neRigidBody@@QAEXABUneV3@@@Z
?SetRotation@neAnimatedBody@@QAEXABUneM3@@@Z
?SetRotation@neAnimatedBody@@QAEXABUneQ@@@Z
?SetRotation@neRigidBody@@QAEXABUneM3@@@Z
?SetRotation@neRigidBody@@QAEXABUneQ@@@Z
?SetSleepingParameter@neRigidBody@@QAEXM@Z
?SetSphereDiameter@neGeometry@@QAEXM@Z
?SetTerrainMesh@neSimulator@@QAEXPAVneTriangleMesh@@@Z
?SetTerrainTriangleQueryCallback@neSimulator@@QAEXP6AXABUneV3@@0PAPAHPAPAVneTriangle@@PAPAU2@PAH4PAVneRigidBody@@@Z@Z
?SetTorque@neRigidBody@@QAEXABUneV3@@@Z
?SetTransform@neGeometry@@QAEXAAUneT3@@@Z
?SetType@neJoint@@QAEXW4ConstraintType@1@@Z
?SetUpperLimit2@neJoint@@QAEXM@Z
?SetUpperLimit@neJoint@@QAEXM@Z
?SetUserData@neAnimatedBody@@QAEXI@Z
?SetUserData@neGeometry@@QAEXI@Z
?SetUserData@neRigidBody@@QAEXI@Z
?SetUserData@neSensor@@QAEXI@Z
?SetVelocity@neRigidBody@@QAEXABUneV3@@@Z
?UpdateBoundingInfo@neAnimatedBody@@QAEXXZ
?UpdateBoundingInfo@neRigidBody@@QAEXXZ
?UpdateInertiaTensor@neRigidBody@@QAEXXZ
?UseCustomCollisionDetection@neAnimatedBody@@QAEHXZ
?UseCustomCollisionDetection@neAnimatedBody@@QAEXHPBUneT3@@M@Z
?UseCustomCollisionDetection@neRigidBody@@QAEHXZ
?UseCustomCollisionDetection@neRigidBody@@QAEXHPBUneT3@@M@Z
?neBoxInertiaTensor@@YA?AUneV3@@ABU1@M@Z
?neBoxInertiaTensor@@YA?AUneV3@@MMMM@Z
?neCylinderInertiaTensor@@YA?AUneV3@@MMM@Z
?neSphereInertiaTensor@@YA?AUneV3@@MM@Z
One of the main problems I had was getting pointer information out of the DLL and back into DBC. For the sake of clarity, a pointer points to a memory location where the data you want is stored. From what I can tell, DBC doesn't have any means to reference a memory location. It can send a pointer via memblocks, but I don't know how to make it "look at" or point to a specific memory address.
I was thinking that an intermediary dll - a sort of "buddy" dll - could be created to companion Tokamak or ODE, that could change the reference to a pointer to the hard data and send the data back to DBC as floats, or integers, or whatever, that DBC could use. Once that was done, a series of functions could be written in DBC that would break up the data appropriately based on the prototypes of the original ODE or Tokamak dll function.
Enjoy your day.