Try TORCS, The Open Racing Car Simulator. It is a highly portable multi platform (Windows, Mac OS, Linux, PlayStation) car racing simulation. The source code of TORCS is licensed under the GPL ("Open Source"). It has great well-commented 3D Engine!
TORCS features more than 50 different pre-made 3D car models, tens of tracks. Graphic features lighting, smoke, skidmarks and glowing brake disks. The simulation features a simple damage model, collisions, tire and wheel properties (springs, dampers, stiffness, ...), aerodynamics (ground effect, spoilers, ...) and much more.
You can very easy enhance general TORCS system engine, because it is highly modular.
The source code of TORCS has following directory structure:
.
|-- doc
|-- drivers
| `-- human
| `-- tracks
| `-- dirt-2
|-- interfaces
|-- libs
| |-- client
| |-- confscreens
| |-- learning
| |-- math
| |-- portability
| |-- raceengineclient
| |-- racescreens
| |-- robottools
| |-- tgf
| |-- tgfclient
| `-- txml
| `-- gennmtab
|-- linux
|-- modules
| |-- graphic
| | `-- ssggraph
| |-- simu
| | `-- simuv2
| | `-- SOLID-2.0
| | |-- include
| | | |-- 3D
| | | `-- SOLID
| | `-- src
| |-- telemetry
| `-- track
|-- raceman
|-- tools
| |-- accc
| |-- nfs2ac
| |-- nfsperf
| |-- package
| | `-- specfiles
| |-- texmapper
| `-- trackgen
`-- windows
|-- dll
|-- include
| |-- AL
| |-- GL
| `-- plib
`-- lib
as you can see, it has a lot of different projects inside, e.g. SOLID is library for collision detection, simuv2 contains all interesting physics-related things.
Just try TORCS!