VOOZH about

URL: https://www.nuget.org/packages/HughPH.Box2D

⇱ NuGet Gallery | HughPH.Box2D 2026.5.5.222




HughPH.Box2D 2026.5.5.222

dotnet add package HughPH.Box2D --version 2026.5.5.222
 
 
NuGet\Install-Package HughPH.Box2D -Version 2026.5.5.222
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HughPH.Box2D" Version="2026.5.5.222" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HughPH.Box2D" Version="2026.5.5.222" />
 
Directory.Packages.props
<PackageReference Include="HughPH.Box2D" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add HughPH.Box2D --version 2026.5.5.222
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: HughPH.Box2D, 2026.5.5.222"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package HughPH.Box2D@2026.5.5.222
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=HughPH.Box2D&version=2026.5.5.222
 
Install as a Cake Addin
#tool nuget:?package=HughPH.Box2D&version=2026.5.5.222
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Box2D-dotnet-bindings

Box2D 3.x Bindings for dotnet (C#, F#, VB, ...)

Doxygen documentation

Includes native binaries for:

Platform Architecture Tested
Windows x64 Yes
Windows x86 No
Windows arm64 No
Linux x64 Yes
Linux x86 No
Linux arm64 No
MacOS x64 No
MacOS arm64 Yes

Please submit a github issue if you try an untested platform and it works or doesn't work.

What is it?

This is a "link" from dotnet to Box2D 3.x, with an API that should be more familiar and comfortable to dotnet users. World has a Bodies property, Body has a Shapes property and a Joints property, and so on. Delegates are fully formed, rather than being vague IntPtrs. All methods and most properties are PascalCased and have XML documentation.

How is this better than Box2D.NetStandard/another port of Box2D 2.x?

Box2D 3.x contains significant efficiency improvements that make use of SIMD intrinsics. While it's not impossible to implement in C# - intrinsics have been available since dotnet 6 - it's probably unlikely that Box2D 3.x will be ported into Box2D.NetStandard: one of the challenges with Box2D.NetStandard has always been keeping it up-to-date with changes to Box2D 2.x, and the performance was never on par. Since Box2D 3.x builds to shared libraries, it makes much more sense all round to simply write bindings to that library than to put time into porting it. It also means I can target .net standard 2.1 instead of dotnet 6 or above.

How is this better than Hexa.NET.Box2D or Box2D.NET?

Hexa.NET.Box2D & Box2D.NET.Release (/Box2D.NET.Debug)

These are auto-generated with different code generators, and are each a direct mapping of Box2D's "flat" C API. That means they require you to use pointers and unsafe code, and they may not have the same level of documentation as this library.

Box2D.NET (not Box2D.NET.Release)

Box2D.NET is a copy-paste code port of Box2D even down to the Tracy integration. The project is well documented, exposes no pointers and has generic delegates, but it allocates on the heap, which causes GC pressure and potentially delays while GC runs.

Box2D-dotnet-bindings (this project/package)

By contrast, this is a hand-crafted API that is designed to be more idiomatic to dotnet coders. These bindings also have full XmlDoc comments and fully defined delegates, and overloads that take generic type arguments and consume and deliver Spans of data instead of pointers. Heap allocation is consciously kept to a minimum. The world can be browsed in the debugger.

"Better" is probably subjective: this library is designed to bring quality of life improvements. This API is complete up to 3.1.1 and will be upgraded as new versions of Box2D are released.

Getting things working

Just install this package. It should work. If not, please raise an issue in the github repository

Known limitations / quirks

  • The native binaries are built from Erin's Box2D latest release tag.
  • Extensions to the Box2D API won't appear automagically. Please feel free to submit a PR if you want to add something.
Product Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 is compatible.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 is compatible.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 is compatible.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 is compatible.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 netstandard2.1 is compatible. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on HughPH.Box2D:

Package Downloads
Sparkle

A fast, Cross-platform .NET 10 C# 14 game engine.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on HughPH.Box2D:

Repository Stars
MrScautHD/Sparkle
A fast, Cross-platform .NET 10 C# 14 game engine.