Skip to content

2D Collision Simulation optimized to handle large amount of circles/particles In Unity.

Notifications You must be signed in to change notification settings

ElyesBRD/2D-Collision-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

2D Collision Simulation

A unity project that simulates 2D circles moving around and colliding with each other using physics principles. For Optimization im using bounding volume hierarchy method, and im trying to implement other solutions for Optimization in the future.

How much can it handle

5K+ particles with a low end pc gives about 2fps, still didnt test it with a powerful pc. It depends in the amount of spread/Radius of the particles.

How To Use

After opening the project in unity (Unity 2021.3.16f1 version was created with):

  • Select "SimulationHandler" in the Hierarchy.
  • in the inspector you gonna find a script called "Collision Simulation Handler".
  • there you can Control all the variables you need for the simulation.
  • Start the Scene.

How To Open Build Mode

  • Open the Repo Folder
  • Open File Called: "Collision Simulation"
  • Open File Called: "build"
  • Open: "Collision Simulation.exe"
  • (to close the simulation window: press Alt + F4, or Alt + Enter and then Close window button)

Note

The prject is finished, but it just needs some UI so you can build it and play with it.