Physics Engines

Blitz3D Forums/Blitz3D Programming/Physics Engines

.rIKmAN.(Posted 2004) [#1]
Does anyone know if there are any other Physics Engines being "wrapped" for use in Blitz?
I have found a half done wrapper for Newton (www.phyicsengine.com), but other than Sweenies excellent Tokamak wrapper, we`re pretty short.

I ask as Toka is reportedly pants for anything involving car physics, and I don`t have a good enough grasp of Physics yet to write my own.

Oh, I`m talking 3D here too, not 2D, just to clarify.
Nothing too elaborate, just simple accelerate, brake, turning according to speed etc...

Cheers guys


ChrML(Posted 2004) [#2]
Currently I'm into basic car physics (like you said, not too elaborate). I've got very far on that (most frictions, and forces are working as they should), however, I'm sorry to say that I won't release it into public when done (as I want it to be unique for my game, and not something that 10 other games has).

If tokomak is so good that everyone says it is, then applying the neccessary forces and frictions needed to create realistic car physics shouldn't be that hard in it, I guess, lol, idunno (I'm making mine from scratch).


.rIKmAN.(Posted 2004) [#3]
From what I`ve read (and played with) Toka`s friction model is useless for car physics :(

Glad to see you got your own physics working though, you got any tips to point me in the right direction (other than monsters site or the PhOR series?


ChrML(Posted 2004) [#4]
@.rIKmAN: Yes :), the first tip is to me patient. Car physics takes lots of efford, really hard thinking, headbanging, and so on.

The first thing that is important is that you have the basic rolling, and turning correct before you go on with skidding, and ways to calculate the sideway force. The backwheels always points against the wheel infront (ie, left backwheel always points against left frontwheel). Just a hint on basic rolling to get the wheels properly positioned. When everything looks correct at that stage (which is important, otherwize you can't build more on top of it, like skidding).

I talked to a guy I know about the car physics, and he said that the "Physics of Racing" serie is slightly incorrect according to new knowledge, and that the formulas at those pages are very bad explained (which is true), however, the PhOR serie helped me a lot with understanding how it all works.

When you got basic rolling to work, you can start with skidding. It's quite easy to know when it will start to skid, as most (standard) tires by today can handle .8 - 1G on asphalt. 1G on earth = ~9.8 m/s, so just remember that if any force pushing the car anywhere (backwards on accelleration, forward on breaking, or sideway when turning) is higher than 9.8 m/s, then the tires skid (the slowdown rate is the friction between the tires and the road). Then even when it skids, continue to calculate the forces, as the car hooks bak to normal rolling state when the force pushing the car falls back below about 1G (which happens as the car slows down due to friction). When you got it all work on asphalt, then it's very easy to add other friction values for wet asphalt, snow, ice, grass and similar.


I really can't explain everything here, but I hope this helps you a bit into the right direction. Remember, on top of this, a LOT of tweaking and headbanging is needed to get it correct. Good luck ;)!