Skip to content

Supply normals for edge hits#7039

Merged
BMagnu merged 3 commits into
scp-fs2open:masterfrom
BMagnu:model_edge_normal
Sep 16, 2025
Merged

Supply normals for edge hits#7039
BMagnu merged 3 commits into
scp-fs2open:masterfrom
BMagnu:model_edge_normal

Conversation

@BMagnu

@BMagnu BMagnu commented Sep 16, 2025

Copy link
Copy Markdown
Member

Now, you may be asking, "how can an edge have a sensible normal".
In FSO, we have a lot of places that expect to get a valid normal for every collision. So what to do in the case of an edge hit? In most cases, especially for VFX, it's enough to get a normal that's sufficiently close and contiguous compared to surrounding normals. As such, returning the normal of any of the faces that an edge belongs to is likely going to be a sufficient approximation.
There's a few places that still calculate manual normals in case of an edge hit with a different strategy, but as these don't rely on the value returned by the collision code, we can ignore them here.

This fixes several particle related bugs where a proper normal was expected, and restores normal-alignment functionality for beams that was removed in #7038

@BMagnu BMagnu added the fix A fix for bugs, not-a-bugs, and/or regressions. label Sep 16, 2025
@BMagnu BMagnu merged commit 7875e5f into scp-fs2open:master Sep 16, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A fix for bugs, not-a-bugs, and/or regressions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants