Skip to content

A spring system implemented in Unity to compare the commonly used integration methods.

License

Notifications You must be signed in to change notification settings

michidk/Spring-System-Integration-Method-Comparison

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring System Integration Method Comparison

Following the lecture "Game Physics" at Technical University of Munich (WS17/18), I wanted to implement an actual spring system in Unity to compare the different integration methods.

Screenshot

Requirements

Unity 2019.3

Usage

Open the project with Unity, double click the scene "Scenes/Demo" and enter "Play"-mode. Now move the cube in the editor or the sphere in the game preview using the arrow/WASD keys.

The integration method can be changed in the Simulator component.

All integration method implementations are contained in the "Scripts/Integration" folder.

Comparison

To compare the integrators a bit better, I created a codepen to visualize the performance on a exponential function:

Comparison

The horizontal axis shows the timesteps, the vertical axis the estimated result of the exponential function. As you can see, Runge-Kutta integration (RK4) ist the most accurate method. This was to be expected since its a fourth-order method, which is the highest order of all tested methods.

About

A spring system implemented in Unity to compare the commonly used integration methods.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages