Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial BulletSharp and BulletSharpTest System.Numerics port. #84

Merged
merged 1 commit into from
Apr 2, 2022

Conversation

epicabsol
Copy link
Contributor

This PR updates the BulletSharp(.DotNetCore) and BulletSharpTest projects to use the math types in System.Numerics.

I have not addressed a double-precision branch, as the System.Numerics double-precision functionality has not yet arrived in .NET, and I believe that even just single-precision will be helpful to have ported.

The tests in Program.cs pass with the exception of the garbage collection ones. I'm not sure how to proceed there. I was not able to get Visual Studio to run the NUnit tests at all.

The demos should all be portable, even if it's tedious. I can do this if there is interest.

@AndresTraks
Copy link
Owner

Thanks for the PR!
There's a few more considerations, but I think this is the right move.

Switching to System.Numerics is a breaking change, but we can up the major version to 3 like Bullet did. The Vector3 and Matrix4x4 classes in System.Numerics seem to have all the necessary methods. If there's something missing, it could be added with extension methods or static helper classes.

The double precision branch can keep using the BulletSharp.Math classes for now. The double/single precision versions don't need to be as compatible as possible.

IIRC, the garbage collection tests were inconsistent to begin with, because forcing a garbage collection didn't always work. The important thing there is that unmanaged recources get deallocated when objects go out of scope.

I haven't had much time to work on BulletSharp in recent years, but .NET versioning still seems messy. I understand that .NET Standard is the best for supporting all the different .NET implementations and that .NET Standard 2.1 is required for System.Numerics support.

You can work on the demos if you like, but I'll try to find some time to review them too.

@AndresTraks
Copy link
Owner

I started with BasicDemo here: f007c2d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants