Potential refactor of outer billiards machinery - #79
Open
davidjamesromano wants to merge 5 commits into
Open
Conversation
It was taking whichever of the first 100 hops landed nearest to the start and calling that the period, so points whose orbit never closed still got colored. That is what was breaking the far left and right of the frame - they are the only parts far enough from the table for a period to run past 100. Raised the limit to 300, since the real periods out there reach about 150.
The borders were being cut out of the color layer rather than drawn on top of it, so they were really just gaps letting the background through. They were also cut three times deeper than the white lines meant to cover them, and got cut even when those lines were turned off.
Most orbits close well before the step limit, so there is no point walking the rest of it after the period is found and the lines are drawn.
The pivot is undefined exactly where two corners tie for clockwise-most, so how close that tie comes is how close the singularity is - and that is the same number the pivot search already computes. The ray structs, the code that builds them, and the copy of them to the GPU all go away.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug fix: The areas where the singularities would go were cutting color from where it should have been. This has been fixed.
Singularities don't need their own geometry. Pivot is undefined exactly where corners tie for clockwise, and the pivot search already computes how close the time comes, so SingularRay and everything associated with it is gone. Definitely tidied up the code a bit.
Bumped max period from 100 to 500 to resolve the bug with odd coloring. Increase this for better results and slower performance.