codingben / box2d-netstandard

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

Added chain contacts #13

Closed HughPH closed 4 years ago

HughPH commented 4 years ago

Also replaced ContactRegister array with a Switch Expression. After 5 distinct items, a Switch Statement or Switch Array is implemented as a hash table lookup. This avoids a couple of if statements, and also makes clear where there are gaps. Also replaced Matrix3x2.Invert with custom code, again avoiding if statements. This is 10-15% faster than using Matrix3x2.Invert.

codingben commented 4 years ago

@HughPH Hey! :)

New package version after your PR: https://www.nuget.org/packages/Box2D.NetStandard/2.0.2-alpha