codingben / box2d-netstandard

C# port of Box2D - Erin Catto's 2D Physics Engine
https://box2d.org
MIT License
271 stars 53 forks source link
box2d

Box2D Logo

Box2D .NET Standard

Build Box2D Examples Build

Box2D .NET Standard is the port of Box2D from C++ to C# by Ben Oukhanov & Hugh Phoenix-Hulme 2020.

Loosely based on Box2DX by Ihar Kalasouski 2008.

Current Status

Known issues

In v1.0.x:

In v2.4.x:

Source

Folder Structure

├── docs
│   └── images
├── examples
│   ├── Box2D.Window
│   ├── Box2D.WindowTests
│   └── Box2D.WorldTests
└── src
    └── box2dx
        ├── Box2D.NetStandard
        │   ├── Collision
        │   ├── Common
        │   ├── Dynamics
        │   │   ├── Bodies
        │   │   ├── Contacts
        │   │   ├── Fixtures
        │   │   ├── Joints
        │   │   └── World
        └── Box2D.NetStandard.UnitTests

Contributing

Please read and follow the contributing guidelines.

Features

Collision

Physics

System

Documentation

License

Original C++ Box2D is developed by Erin Catto, under the MIT license.

[^1] .net standard 2.0 lacks System.MathF which is a dependency. System.Numerics.Vectors is not part of .net standard 2.0, but it is available as a Nuget package. There is a discussion here about including System.MathF in System.Runtime.Extensions but it was decided not to do so. We also use stackalloc, Span, System.HashCode, Math.Clamp and range expressions, which are not supported in .net standard 2.0.