Hi all,
After building my game project using Tokamak, then running into a known static mesh/terrain bug (destroying the toksim doesn't free up the terrain data which I didn't know about at the time :S), I didn't want to abandon Tokamak or change to the new ODE wrapper (still early days for ODE :)
Researching some more I found out Tokamak had a second way to use static meshes, using a callback function. Instead of just sending the whole static mesh to the collision engine, the callback function gets called for every rigidbody in the scene. Within it you can do some checks and build a small array of just the triangles that will likely collide with the rigidbody.
The routine I borrowed from Adam Dawes tutorial number 5 ( www.adamdawes.com ), and it seems to work just as quick.
Theres also an upside to using this method, you can modify the terrain data realtime! Although you'd have to be careful that you're not moving a vert or tri and subsequentialy causing an intersection with any rigid body (the collision will be missed!)
Sweenie is currently working on his own Physics engine (go Sweenie!!!) so I didn't want to bug him too much, that's why I thought I'd have a go at updating it.
I'm a C++ noob! And working on this was hard, but careful reading of Sweenies wrapper source really helped me out (cheers Sweenie!)
Breakages!
This was pretty much the last thing to be added to the wrapper to make it complete, and there's still a few things to be done, but the guts of it have been added, demo here:
http://www.tomspeed.com/breakages.zip
Extract to a temporary folder and run.
NOTE: These DLLs are NOT updates to wrapper v0.6, they're specific to this demo only, so don't go copying them anywhere else or you may screw up your Tokamak :)
Updated wrapper source will be released when the breakages are in and tests show no bugs/memory leaks. Tokamak's been 100% stable for me until the terrain bug, I'd like to keep it that way!
Credit goes to Sweenie for all his hard work on this and Adam Dawes for the terrain callback stuff.
Cheers!
Tom
After building my game project using Tokamak, then running into a known static mesh/terrain bug (destroying the toksim doesn't free up the terrain data which I didn't know about at the time :S), I didn't want to abandon Tokamak or change to the new ODE wrapper (still early days for ODE :)
Researching some more I found out Tokamak had a second way to use static meshes, using a callback function. Instead of just sending the whole static mesh to the collision engine, the callback function gets called for every rigidbody in the scene. Within it you can do some checks and build a small array of just the triangles that will likely collide with the rigidbody.
The routine I borrowed from Adam Dawes tutorial number 5 ( www.adamdawes.com ), and it seems to work just as quick.
Theres also an upside to using this method, you can modify the terrain data realtime! Although you'd have to be careful that you're not moving a vert or tri and subsequentialy causing an intersection with any rigid body (the collision will be missed!)
Sweenie is currently working on his own Physics engine (go Sweenie!!!) so I didn't want to bug him too much, that's why I thought I'd have a go at updating it.
I'm a C++ noob! And working on this was hard, but careful reading of Sweenies wrapper source really helped me out (cheers Sweenie!)
Breakages!
This was pretty much the last thing to be added to the wrapper to make it complete, and there's still a few things to be done, but the guts of it have been added, demo here:
http://www.tomspeed.com/breakages.zip
Extract to a temporary folder and run.
NOTE: These DLLs are NOT updates to wrapper v0.6, they're specific to this demo only, so don't go copying them anywhere else or you may screw up your Tokamak :)
Updated wrapper source will be released when the breakages are in and tests show no bugs/memory leaks. Tokamak's been 100% stable for me until the terrain bug, I'd like to keep it that way!
Credit goes to Sweenie for all his hard work on this and Adam Dawes for the terrain callback stuff.
Cheers!
Tom