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 (see the New BSD License).
Written entirely in Java with zero dependencies running on Java 1.6 or higher.
Over 1,000 automated JUnit tests 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.
Getting started is as simple as downloading the latest version of the library, adding it to your project, and then taking a look at the ExampleJava2D and ExampleJOGL sample applications. Check out the samples for additional help.
Watch this 6 minute Quick Start Guide to see just how easy it is.
If you do get stuck though, take a look at the Documentation and Javadocs or start a topic on the forums.
Quick Start Guide
Notes: The ExampleGraphics2D class now requires the Graphics2DRenderer class as well.
The primary goals for this release were performance enhancements and API clean up. It took a lot longer than I had expected but I’m very happy with the results. Highlights include improvements in the performance of collision detection and ray casting operations and a much cleaner public API and more thorough javadoc comments. The API has been changed a[…]
Due to Google’s decision to drop Google Code, I’ve moved the project to GitHub. In truth, I’ve been contemplating this for a while now, but have had reservations about lost version history. I feel this will help others contribute bug fixes and allow them to create their own forks and branches easier than before. I[…]
This is a maintenance release of dyn4j that includes a bug fix for a StackOverflowException thrown from the raycast(Ray, double, boolean, boolean, List) method. This release also includes some very minor performance tweaks. See the change detail in the release notes. The Sandbox app was updated to fix a bug in the Java code exporter (Rays[…]
This is a maintenance release of dyn4j that includes some major bug fixes. See the change detail in the release notes. The Sandbox app was not updated in this release.
This release of dyn4j includes some major bug fixes for the SweepLine class and other related convex decomposition classes. It also includes some enhancements to the World.detect methods. See the change detail in the release notes. A new release of the Sandbox was published for this release for a small bug fix.
This release of dyn4j is a maintenance release to fix a bug in the Vector2.distance(double,double) method. It also had a few methods added to the Body class to get BodyFixture(s) at a given world space point. See the change detail in the release notes. A new release of the Sandbox was published for this release due[…]
This release of dyn4j is a maintenance release to fix bugs in the Ellipse.contains, Ellipse.getHalfHeight and HalfEllipse.contains methods. This release also had a bug fix in the Graphics2DRenderer class. See the change detail in the release notes. This release has one breaking change: the Ellipse.getPointClosestToPoint method has been removed. This method was based on an incorrect[…]
This release of dyn4j is a maintenance release to fix a bug in the Segment.getSegmentIntersection method. A new method, setSlackEnabled, was also added to the PulleyJoint class to support a rope like constraint. See the changes in the release notes. This release should not contain any breaking changes. No new release of the Sandbox was published[…]
This release of dyn4j includes a number of new features including 4 new primitive shapes and convex casting. In addition, a number of new helper methods have been added to the Geometry class. See all the changes in the release notes. This release should not contain any breaking changes unless you were using anything in[…]
This release of dyn4j is a small maintenance release to fix a bug introduced in 3.1.3. With this some flip methods have been added to the Geometry class to allow flipping of polygons about arbitrary axes and points. This release should not contain any breaking changes unless you were using or storing shape, fixture, body,[…]