-
Notifications
You must be signed in to change notification settings - Fork 26
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
fixture.computeDistance gives incorrect results for CircleShape #99
Comments
Thanks for the fix, could you provide it as a PR and add some test cases? |
I'll give it a shot, but I'm not too familiar with the internals of this project. It will actually be my first PR on github. Do you have any guidance about where tests would go, and is there a document I should read first? |
You can read this one if you want: The test can go in here (there are sadly not that many tests yet, but we try to at least make them for bug fixes so that we don't get regressions): And feel free to ask questions if you get stuck. :) |
Thanks, I'll read through that contributing doc. You have the same link twice though. |
Fixed! |
I created a PR (#100) but I'm not sure what happens next. I can't assign anyone. The github docs suggest that I can't assign it since I don't have write access, so I'm not clear on what normally happens to get it assigned. |
# Description <!-- Provide a description of what this PR is doing. If you're modifying existing behavior, describe the existing behavior, how this PR is changing it, and what motivated the change. If this is a breaking change, specify explicitly which APIs have been changed. --> ## Checklist <!-- Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (`[x]`). This will ensure a smooth and quick review process. --> - [x] The title of my PR starts with a [Conventional Commit] prefix (`fix:`, `feat:`, `docs:` etc). - [x] I have read the [Contributor Guide] and followed the process outlined for submitting PRs. - [x] I have updated/added tests for ALL new/updated/fixed functionality. - [ ] (N/A) I have updated/added relevant documentation in `docs` and added dartdoc comments with `///`. - [ ] (N/A) I have updated/added relevant examples in `examples`. ## Breaking Change <!-- Does your PR require Flame users to manually update their apps to accommodate your change? If the PR is a breaking change this should be indicated with suffix "!" (for example, `feat!:`, `fix!:`). See [Conventional Commit] for details. --> - [ ] Yes, this is a breaking change. - [x] No, this is *not* a breaking change. ## Related Issues <!-- Provide a list of issues related to this PR from the [issue database]. Indicate which of these issues are resolved or fixed by this PR, i.e. Fixes #xxxx* !--> Fixes #99. <!-- Links --> [issue database]: https://github.com/flame-engine/flame/issues [Contributor Guide]: https://github.com/flame-engine/flame/blob/main/CONTRIBUTING.md [Flame Style Guide]: https://github.com/flame-engine/flame/blob/main/STYLEGUIDE.md [Conventional Commit]: https://conventionalcommits.org Co-authored-by: drrnbrns <[email protected]>
Using version 0.14.0 of forge2d,
CircleShape.computeDistanceToOut
isn't returning the right values. Note: I've included a fix that works well below.This code logs distance and normals for both
CircleShape
andPolygonShape
(the latter works fine and is just for comparison). If you draw or think about the locations, you'll see that thecircleDistance
reported is way off. FlipCircleShape
toCircleShapeWithFix
and you'll see correct values.Expand for test case
Test case
Expand for provided working code
Working code for
CircleShape.computeDistanceToOut
Provided as a class, but the intent is to simply use the code in
computeDistanceToOut
. In my app, I have a large number of different cases that all work well with this fixed code.The text was updated successfully, but these errors were encountered: