First of all This is by NO means car physics. It's a fudge that gives me something like mario kart physics. Which is what i'm after.
Still much work to do. Slamming into walls makes it go haywire and sometimes it will clip the edge of those hills and go haywire.
None the less about 90% done as far as physics are concerned
Thanks to fubarpk for his help in the design and TESTING
Added source code
V1.3
1. Separated out the walls to prevent tunneling. There is some code there in CheckWalls() which turns off the engine if the collision is abrupt
There are three methods for calculating the direction of linear force: VEHICLE/GROUND/AVERAGE
- VEHICLE : Direction is the car facing forward
- GROUND: Direction is where the wheels contact the ground
- AVERAGE(Current setting): Average of GROUND and VEHICLE
Added some debug switches to show what's going on
V1.4
Environment changes
v1.5
Walls have a little bounce back
v1.6
Changes;
1. Throttle velocity when falling from a great height
2. First person camera (C to toggle cameras) very early, needs more easing of the camera and modelling to show windscreen frame etc
3. Brakes... Who am i kidding, it's just an excuse to drift
4. Added massive ramp
Bugs;
It still tunnels if you slam into the side of the small ramps where they meet the ground. It forces the car into the ground. For now i'm calling it a design flaw and will probably change the shape of the ramp
v1.7
1. Tunneling changes
2. SCALE_3D value scales forces/values to the scale of the 3D environment (Not sure i've got every value yet)
3. Changed environment to prevent pinching
Note that it is set to a VERY high speed. Hoping you guys will bash it and find tunneling