Account for stacks in angle calculation #36012
Open
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.
The stable version of "correct" angle calculation.
Made with doubles in mind since they're the main issues when it comes to angle-related bonuses.
Flashlight changes are not included intentionally because I'm not sure what is expected here.
PRing this for research and discussion purposes (in the sense that is it needed at all), also to calculate sheet of deltas.
Brief explanation of "why it's so complex":
It calculates 3 angles, where first angle is normal, second is accounting for one double, third is accounting for two doubles in a row. Each angle has weight of how likely that the respective objects are stacked.
Compared to "stack threshold" approach - this one is smooth and stable, meaning that as distance between notes in the stack would increase - it would be smoothly transitioning between "stacked" and "non-stacked" values, instead of big jump when distance passed certain threshold.