Box2D.NET is a C# port of the Box2D physics engine.
If you'd like to support the project, we'd appreciate starring(⭐) our repos on Github for more visibility.
- 🌿 Purity - Fully implemented in pure C#.
- 💻 Compatibility - Ensuring seamless integration with the .NET platform and Unity3D.
- 🌍 Cross-Platform Support - Easily integrates with all major platforms, including Linux, Windows, macOS
Box2D.NET is divided into multiple modules, each contained in its own folder:
- Box2D.NET : A C# port of the Box2D physics engine for 2D physics simulations.
- Box2D.NET.Shared : Shared code and utilities for Box2D.NET, for use in sample projects and by library users.
- Box2D.NET.Samples : Sample projects to showcase the features of Box2D.NET
- Box2D.NET.Test : Unit tests for Box2D.NET.
- To verify the run for all modules, run Box2D.NET.Samples
- on the Windows platform, you need to install the redistributable package
- Microsoft Visual C++ Redistributable Package
dotnet run --project src/Box2D.NET.Samples --framework net9.0 -c Release
- There are a few ways to integrate Box2D.NET into your project.
- Source integration is the most popular and most flexible. Additionally, NuGet installation will also be supported in the future.
You can use the original Box2D documentation as a reference, since the Box2D.NET API closely mirrors the original implementation. If you are new to Box2D, we recommend starting with the original documentation to learn the basics and core concepts.
Key Naming Conventions:
- Properties and methods: Start with lowercase (matches original Box2D)
- Classes and structs: Start with Uppercase (differs from original Box2D)