A 100% Java 2D collision detection and physics engine. Designed to be fast, stable, extensible, and easy to use. dyn4j is free for use in commercial and non-commercial applications
Download<dependency>
<groupId>org.dyn4j</groupId>
<artifactId>dyn4j</artifactId>
<version>5.0.2</version>
</dependency>Written entirely in Java with zero dependencies running on Java 1.6 or higher.
Over 2,000 automated JUnit tests, suite of samples, and Sandbox GUI application.
Getting started is easy with Javadocs, wiki, and more.
Open source and free to use in commercial and non-commercial applications.
The sample repo contains a simple Java2D framework (and a JOGL example) along with a number of sample simulations.
The easiest way to get started is to clone the dyn4j-samples repo locally as shown below.
You can also get started by downloading the latest version of the library, adding it to your project, and then taking a look at the UsingGraphics2D and UsingJogl sample applications. Check out the rest of the samples for additional help.
It's recommend to go through the getting started page first. If you do get stuck, take a look at the javadocs or start a discussion on GitHub.
A quick 2 minute video showing the use of the samples GitHub project to get started using dyn4j
This update focuses on a few minor performance improvements, fixes and enhancements.
This update fixes a few issues discovered while enhancing the samples project. This update does change the behavior of the SolvedContact.isSolved method and removes the code that resets the enabled and tangentVelocity properties on the ContactConstraint.
This major update overhauls the org.dyn4j.dynamics.joint package. This update allows the creation of new joints with an arbitrary number of bodies (whereas only one-body or two-body joints were possible before). This release sees all joints inherit from standard interfaces for things like limits, motors, and springs with the intent to make the API surface identical among all the joints.