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

Fix graphene_box_get_center() #166

Merged
merged 5 commits into from
Aug 8, 2019
Merged

Fix graphene_box_get_center() #166

merged 5 commits into from
Aug 8, 2019

Conversation

ebassi
Copy link
Owner

@ebassi ebassi commented Aug 8, 2019

Fixes #165

Proposed changes:

  • Fix various box methods to handle empty and infinite boxes
  • Fix graphene_box_get_center() to take into account the box.min point
  • Fix graphene_box_get_bounding_sphere() to use the box center instead of open coding it

Test suite changes:

  • Add expectations to the graphene_box_get_center() specification that check the behaviour of the function when box.min is not centered in (0, 0, 0)

We cannot rely on a consistent behaviour with infinities across
different platforms, architectures, toolchains, and SIMD
implementations. This means we need to check if a box's minimum and
maximum vertices contain infinities before comparing the vertices.
Before we go into SIMD operations, we need to check for infinities,
given that we might end up in an empty or infinite box.
We're subtracting the minimum and maximum coordinates, but that only
works if the minimum point is centered in (0, 0, 0).
Instead of open-coding it, we should reuse the existing Box API, so we
avoid duplicating bugs.

Fixes: #165
Add more expectations on the behaviour of get_center(), especially when
the minimum point of the box is not centered in (0, 0, 0).
@ebassi ebassi merged commit f869b01 into master Aug 8, 2019
@ebassi ebassi deleted the issue-165 branch August 8, 2019 13:45
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.

graphene_box_get_bounding_sphere is incorrect
1 participant