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 Unaligned Sort Triggering #2997

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

douira
Copy link
Collaborator

@douira douira commented Jan 28, 2025

Fixes a bug with the plane-based triggering system where unaligned trigger planes would be wrongly not be added to the triggering system if the same same normal was already present.

This was caused by a buggy equals implementation in AlignableNormal.

Since unaligned trigger planes are only used by the very rarely employed dynamic topo sorting mode, this is unlikely to have any actual effects until quad splitting #2993, which makes use of unaligned trigger planes more commonly, is added.

I have gotten reports (at least one, maybe two) of crashes within the sort triggering code (months ago), but I don't know whether those were related to this (and I can't find them anymore on discord).

This PR is a cherry pick of commit d3f4953, originally authored as part of #2993. When/if this gets merged, that PR will probably require merge conflict resolution.

… later would not be added to the triggering system even though they should have been,

this was caused by a buggy equals implementation in AlignableNormal.
remove AlignableNormal and replace with a Vector3f & int pair in NormalList and NormalPlanes,
associated refactors to remove custom hashing strategy usage again,
@douira douira force-pushed the fix-unaligned-sort-triggering branch from a9ad28e to 18cc7ff Compare January 28, 2025 02:20
@jellysquid3
Copy link
Member

Thanks, this seems good overall. And I'm happy that we aren't subclassing Vector3f anymore.

@douira
Copy link
Collaborator Author

douira commented Jan 30, 2025

I've added two small bug fix commits. The first for fixing an old but obscure bug that only has relevance with quad splitting, but technically did also exist otherwise. The second corrects a mistake I made during the refactor in this PR. The hashmap of unaligned normals was getting corrupted because I was using a shared scratch object as the hashmap key which mutated the hashmap's key, breaking the hashmap in the process.

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