Simple 2D car physics
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
marco Added marco's original cardemo source for archival purposes Sep 26, 2016
public Added marco's original cardemo source for archival purposes Sep 26, 2016
LICENSE Initial commit Mar 31, 2015
readme.md

readme.md

#Simple 2D Car Physics Sim

Demo: http://www.spacejack.ca/projects/carphysics2d/

This is a Javascript adaptation of the ideas found in Marco Monster's often-referenced car physics paper and demo. His original paper has been archived here. His demo code, written in C, was archived by a user on gamedev.net here (from this thread.) A Java version was archived here.

This Javascript implementation additionally borrows some ideas from Siorki's js13k 2013 entry which also credits Marco's original paper. Siorki added some nice extras like variable front/rear size and axle distance to centre of gravity, as well as adding the vehicle's angular velocity to wheel velocity.

I've attempted to write this demo so that the details of the sim are clear and easily hackable. You can run it with or without a web server by loading index.html in your browser.

See the Car.js source for the physics implementation, in particular the doPhysics method.

####Additional Reference

Brian Beckman's The Physics of Racing

####License

MIT