Thanks Matthew
LLX, I think you're pointing to the fact that the documentation of the DLL is not fantastic, and that may well be true as the driving force in the release of the DLL was the fact that the basic functionality was there so those that can may as well make use of it.
To try to help tho, here's a rundown, with actual code, of exactly what you need to do wo use the DLL in your programs
1) Define to friendly string variables the weird function names from the DLL. From now on in your program you can use your variable to reference the wierd name, which is far easier to remember:
Dll_CreateCollisionObject$ = "?CreateCollisionObject@@YAKPAK@Z"
and so on (just copy that section from the example dba files as )....
2) Load the DLL:
load dll "DBCollisions.dll",1
3) Check that the DLL is OK and (Optionally) that all its functions (methods) are available for use:
if dll exist(1) = 0 then end
if dll call exist(1, Dll_CreateCollisionObject$) = 0 then end
4) Load in a model you'd like to use as your World:
CollisionObjNo = LoadObject("Level2.3ds")
5) Make a Mesh out of the loaded model:
Make mesh from object 1, CollisionObjNo
6) Make a Memblock from our new mesh:
Make memblock from mesh 1,1
7) Get a pointer (handle) to the New Memblock Mesh:
MeshPtr = GET MEMBLOCK PTR(1)
8) Tell the DLL to create a collision Mesh using our World model:
OK = call dll(1, Dll_CreateCollisionObject$, MeshPtr)
9) At the top of your game loop, store your player's OLD position:
` Define Radius and Gravity
Radius# = 50 : Gravity# = 5
While Exit = 0
' Store old player positions
player__oldx = player__x
player__oldy = player__y
player__oldz = player__z
10) After getting user input and working out the new postion of your player (as you normally would), Call the DLL method with your parameters:
...
`Get user input and work out new player positions as normal
...
` Call the DLL giving it the info for this frame
bHit = call dll(1, Dll_UpdateSlidingCollision$, Radius#, Gravity#, player__x#, player__y#, player__z#, player__oldx#, player__oldy#, player__oldz#)
11) Get the DLL to tell us where to put our player in case they hit something:
player__x# = call dll(1, Dll_NewPlayerX$)
player__y# = call dll(1, Dll_NewPlayerY$)
player__z# = call dll(1, Dll_NewPlayerZ$)
12) So these new co-ords can now be used to place you player:
Position Object PlayerObjNo, player__x#, player__y#, player__z#
Sync
WhileEnd
13) Finally at the end of your program, delete the Reference to the DLL:
` Free the Dll
delete dll 1
I hope that helps