All Projects → spacejack → Carphysics2d

spacejack / Carphysics2d

Licence: mit
Simple 2D car physics

Programming Languages

javascript
184084 projects - #8 most used programming language

#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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].