Eric Coleman
Gladiator
USA
811 Posts |
Posted - May 04 2006 : 9:56:57 PM
|
A static screenshot really doesn't say much but I've got the very basics of ODE working, which is gravity. There is a wiki, but not much in the way of tutorials, so I'm having to learn a lot of stuff on my own. ODE is great because it's free and open source, but it's not a free ride, you still need to do a lot of work to make sure your simulation works properly.
Attached to this post is the BAS and DLL file if you want to experiment. A few things need explaining first. ODE uses the standard C calling convention, and in hindsight I probably could have converted this to a VB compatible DLL with much less work than I did. Anyways, consider this version of the VB compatible DLL as an alpha version, it's not even to beta stage yet. If you download the ODE source code it comes with VC 6 and VC 7 probjects. This DLL is hack of the VC 6 version since this is intended for VB 5/6. The VC6 project included with the source has a DLL project that exports a lot of functions. This DLL is not compatible with VB, so this is where most of my work has been, in changing the calling convention of those functions. HOWEVER, I did not follow this source code in determining which functions to convert, I followed the doc file, the huge one, that comes with the ODE source. The BAS file is commented heavily, mostly copy and paste, and will let you know from which section in the documentation that I found the function. There is a difference between the functions the documentation lists and the functions exported by the default ODE VC6 DLL. I opted to export the the functions listed in the documentation instead of the ones exported in the default DLL. Warning: There may be some leftover functions that are exported but not in the included vb BAS file, they're most likely the wrong calling convention and will give you an error if you try to use them. So, only use what's listed in the BAS file and you should OK.
There are a few functions that could not be easily converted to a VB, so I created some alternate functions that are VB compatible. There only a few variations and the VB functions have the same name as the original but with "VB" on the end of the name. It's mostly the "get" functions which return the the data type instead of a pointer to the data type. If a pointer is returned a memcopy must be performed to copy the memory at the pointer location to a variable of the appropriate type. Instead of having VB worry about that I do that in the DLL for you.
There are also some call back functions associated with the collision detection. In section 10.5.2, 10.7.6 you'll see some commented VB functions that serve as a prototype for your callback function. Your callback function can be any name, but the parameter list must exactly match the prototypes in the BAS file. I haven't tested the collision detection yet. I'll post an update when I do.
Download Attachment: screen1.jpg 55.82 KB
Download Attachment: vbgamer_ODE.zip 132.2 KB |
|
Walrus
Squire
Slovenia
34 Posts |
Posted - May 11 2006 : 04:57:11 AM
|
Sounds interesting. Maybe you could include a VB project that makes use of the bas file? It seems it would take a lot of time to figure how to use it.
|
|
|
Eric Coleman
Gladiator
USA
811 Posts |
Posted - May 13 2006 : 07:05:21 AM
|
It's taking me a long time to figure out how to use it as well. A physics engine is not easy to use, and there isn't much information on the internet on how to use this. Of course, this physics library depends on how you organize data in your game. There is no "right" way to use the library.
I am trying to get some examples of this working, which is what that screenshot is of. I don't think examples are going to help much. It would be more of a demonstration of what can be done, and not how to properly do it. |
|
|
Walrus
Squire
Slovenia
34 Posts |
Posted - May 13 2006 : 08:06:28 AM
|
I understand. However, I'd still like to see examples, when you get them to work, eventhough I am not planning to (try to) use the code myself, at least not soon.
|
|
|
Almar
Moderator
Netherlands
192 Posts |
Posted - May 18 2006 : 4:52:21 PM
|
ODE is alright. I'm using it in my game as well. It takes a lot of time to tweak things though. One tiny error can be fatal.
Especially when adding joints. I find the documentation lacking. The examples run too fast, and I cannot seem to recompile them.
But overall, I think it works very enat. I had cannonballs nicely rolling around the terrain |
|
|
|
|