summaryrefslogtreecommitdiff
path: root/scene/resources/separation_ray_shape_2d.h
diff options
context:
space:
mode:
authorK. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>2023-03-13 07:13:25 -0700
committerRĂ©mi Verschelde <rverschelde@gmail.com>2023-05-12 12:06:59 +0200
commit0c312c7a08cfc807de809ba281553927209b9a79 (patch)
tree5002ae592aa4fde110a68e5b92eb54d17fa8a71d /scene/resources/separation_ray_shape_2d.h
parentc8d64e8580da5bf53ccbb5790389b310d3d68e2d (diff)
Fix CSG edge case causing intersection line to hit on common edge of 2 triangles.
The previous implementation assumed that the intersection entered or exited a shape when it hit right on the common edge of 2 triangles. However, there is also a case where it just "skirts" the other shape on the outside. To fix this, we added code to check the intersection distance and if the normals of the faces are pointed in the same direction as the intersection or not (e.g. inner product > 0). This handles the case where the intersection line hits the common edge of 2 triangles and skirts the other shape on the outside. Extended code to cover a third case. Fixes #58637. Co-authored-by: OldBelge <StevenGeens@users.noreply.github.com> (cherry picked from commit eaa84bc682dfb7f1f97970c7f4dfd4c6e63ba681)
Diffstat (limited to 'scene/resources/separation_ray_shape_2d.h')
0 files changed, 0 insertions, 0 deletions