Skip to content

Simple 2D Soft Physics Engine fully written in Java with libGDX

Notifications You must be signed in to change notification settings

exigow/soft-physics-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Soft Physics Engine

![alt text] (https://raw.githubusercontent.com/exigow/soft-physics-engine/master/screenshots/logo.png "Soft Physics Engine logo")

A simple 2D soft physics engine fully written in Java.

Design goal

The main goal is to provide easy-to-use, feature-rich physics engine completely written in Java, where each model can be parametrized on-the-fly during simulation by simply assigning the new value of the field. It is as simple as it sounds.

Demos

Library contains several usage examples in an interesting way, or showing some feature.

Demos are interactive. You can grab every particle using left mouse button on desktop. Multi-touch has been tested on mobile devices too.

Dependencies

  • [libGDX] (https://github.com/libgdx/libgdx) - cross-platform Java game development framework

    Used only to show demos including window creation, particles/joints rendering, texturing, mouse gripping, etc. This part can be easily converted into something else like Slick2d or raw LWJGL.

  • [JOML] (https://github.com/JOML-CI/JOML) - Java math library for OpenGL rendering calculations

    Responsible for engine's math. This library is fast, GC-friendly and produces clean code (this is the reason why I do not use the built-in math with libGDX, which is fast ofc, but not readable).

Future

Things to do:

  • parts of the world are just mutable DTO's (data transfer objects), created using static inner classes (builders or smth) to achieve major design goal (still wip)
  • add minimal sample to README.md
  • collisions (to debate)
  • fixed constant length joint (temporarily it can be achieved with 'hard spring' but may cause some glitches)
  • vector calculations on primitive types, losing code readability :( (or find another way to improve the performance of the GC)
  • particle weight

About

Simple 2D Soft Physics Engine fully written in Java with libGDX

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages