Using a physics library in C++

Archives Forums/Blitz3D SDK Programming/Using a physics library in C++

IKG(Posted 2007) [#1]
Ok, so I'm considering buying the SDK so I can use B3D with C++. Problem is, I've been relying on a B3D ODE wrapper this entire time and I've never used a 3rd-party-library in C++ before.

I guess what I'm trying to ask is how much different would it be to "import" the raw ODE library and substitute for the old wrapper? The examples I'm looking at in the ODE wiki use geometry to move around and such - all which are generated by code using Direct X (http://gpwiki.org/index.php/ODE_Object_tutorial). If I'm going to load a model using a B3D command, will I be able to use an ODE function the same way I would have originally with the B3D wrapper?

I hope I'm making sense :(


JoeRetro(Posted 2007) [#2]
You should be able to use JV_ODE (if you own it). Here's an example done in BlitzMax.

http://www.blitzbasic.com/Community/posts.php?topic=70189#785170


IKG(Posted 2007) [#3]
Yes, I do own it. Although it's only a wrapper so what does it help make easier than just using the ODE SDK? And how would I import it for C++ use?


ZJP(Posted 2007) [#4]
I'm found a solution. The Explicitly Dll calling
http://msdn2.microsoft.com/en-us/library/784bt7z7
(VS.80).aspx
HINSTANCE hDLL;               // Handle to DLL
LPFNDLLFUNC1 lpfnDllFunc1;    // Function pointer
DWORD dwParam1;
UINT  uParam2, uReturnVal;

hDLL = LoadLibrary("MyDLL");
if (hDLL != NULL)
{
   lpfnDllFunc1 = (LPFNDLLFUNC1)GetProcAddress(hDLL,
                                           "DLLFunc1");
   if (!lpfnDllFunc1)
   {
      // handle the error
      FreeLibrary(hDLL);       
      return SOME_ERROR_CODE;
   }
   else
   {
      // call the function
      uReturnVal = lpfnDllFunc1(dwParam1, uParam2);
   }
}



ZJP(Posted 2007) [#5]
Coming soon with Physx
http://rubux.swargo.com/?module=forum&action=topic&id=30&pid=4#4


IKG(Posted 2007) [#6]
Thanks guys, but I would still like to know how much different it would be to start from scratch using the official ODE SDK and if it's possible.

And I'll stay with ODE.. Physx is crap.


ZJP(Posted 2007) [#7]
How to convert the Blitz3D DECLS
http://www.blitzbasic.com/Community/posts.php?topic=70890


IKG(Posted 2007) [#8]
Alright, I can see that I'm just going to have to use the JV wrapper since everyone seems to keep avoiding my main question.

Would I place that bit of code anywhere, like at the top? I don't really know how to use it and what to fill in..