Skip to content

GameDev46/Physics_Engine

Repository files navigation

GameDev46 - grass_sim GameDev46 - CPP_Projects

Static Badge

stars - physics_engine forks - physics_engine

gamedev46 gamedev46

physics_engine

A 2D physics engine programmed in C++ that makes use of verlet integration to implement simple physics

Usage

You may use any version of the physics engine you would like, but I reccomend using the newest version as it will be more stable and have a larger variety of features and tools than the versions before it!

Instructions are included within the application and can be toggle on and off with the H key:

P Key - Pause / Play the simulation Left Click and Hold - Pan camera / Move node Right Click on Node and then Right Click on another Node - Creates a spring joint between the 2 nodes Right Click twice on Node - Switches the node between being frozen in place and being able to move Middle Mouse Button / F Key over node - View any connected springs properties Front Side Mouse Button / Q Key - Create a new node Back Side Mouse Button / E Key over node - Destroy the node

If you wish to edit the program or just change the UI or colours to your liking, open the main C++ file using an appropriate code editing software and then when you are finished editing the code simply run the command...

g++ main.cpp -o physicsEngineModded.exe -O1 -Wall -std=c++11 -Wno-missing-braces -I include/ -L lib/ -lraylib -lopengl32 -lgdi32 -lwinmm

...to compile your new code into an exe file. You will however need to install the g++ compiler if you haven't already done so, but a useful tutorial can be found on the official VS code website (note that this is for both C and C++). Once this is done simply run the physicsEngineModded.exe file and watch as your changes come to life in your new version!

Screenshots

   

Update Log

V0.3.1

  • Initial release

V0.3.2

  • Bug fixes
  • UI changes and fixes
  • More customisation options (spring constant)

V0.4.1

  • Bug fixes (again)
  • Some more UI changes + fixes
  • Natural length of springs can now be edited
  • More stable simulation

V0.4.6

  • Collisions now take mass of each object into account
  • Objects mass can now be changed
  • Objects radius can now be changed
  • Added more world settings
  • Gravity can now be changed
  • Made it easier to edit objects values
  • UI overhaul
  • Added in draggable panels with more customisation options

V0.4.7

  • Made it clearer when the simulation is paused
  • Fixed some UI bugs

V0.5.1

  • Added panel icons
  • Extra inspector panel to make editing objects properties easier
  • Fixed some more UI bugs where values would not set properly
  • Added in a better collision system using momentum (can be toggled to the previous version)
  • Added in ability to toggle whether an object can collide or not
  • Fixed a bug where Gravitational Potential Energy was not calculated correctly

V0.5.4

  • Added in a new save and load panel
  • Fixed UI bug where texboxes would change whenever the user clicked

V0.5.5

  • Added in a new widget which can help to stop users from accidentally rewriting save files
  • Fixed a bug where loading non-existent files crashed the program
  • Switched the system energy value from Kilojoules to Megajoules

About

A 2D physics engine programmed in C++ that makes use of verlet integration to implement simply physics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors