Skip to content

rtroilo/carphysics2d

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#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

About

Simple 2D car physics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 49.0%
  • C 40.7%
  • HTML 6.3%
  • CSS 4.0%