jonas4climate / PhysicsSim

Attempt at building a Physics Simulator from scratch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Physics Simulator

In this private project I am creating a Physics Simulator in Java from scratch.

The simulator is currently used to simulate gravity in 3D space and is capable of simulating n-body-simulations such as the Sun-Earth-Moon system over years with high accuracy and short runtime.

The simulator comes with a variety of features including

  • extensive output/logging
  • collision detection and handling (physically accurate inelastic collision)
  • easy and centralized customizability in the Setup class
  • real-time mode

The project is built with gradle but alternatively can also be run using the makefile.

For Makefile usage:

  • make or make compile will compile the code into a binary folder
  • All documentation can be generated by running make javadoc.
  • Use make run to generate your own simulation with output to terminal or make log to move output into a log file.
  • make clean will remove docs, binaries and logs

Have a look into the example.log file and modify the Setup.java class for your customized simulation. If you need more detailed features, add those to the main Sim.java class. Please use constants and predefined objects of the Util.java class.

Example log file:

log

The current version is fully capable to simulate the collision and gravity segments of the Physics engine but no GUI has been implemented yet (looking into that).

About

Attempt at building a Physics Simulator from scratch

License:GNU General Public License v3.0


Languages

Language:Java 95.3%Language:Python 3.4%Language:Makefile 1.4%