-
Notifications
You must be signed in to change notification settings - Fork 85
Fixed issue where selecting edge would select another edge #614
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
Conversation
…ld happen when one of the edge point was behind the camera near plane, and was fixed by clipping that point behind the camera to the plane.
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## master #614 +/- ##
==========================================
+ Coverage 33.05% 33.66% +0.60%
==========================================
Files 277 277
Lines 34736 34785 +49
==========================================
+ Hits 11483 11709 +226
+ Misses 23253 23076 -177
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 6 files with indirect coverage changes 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great PR. I really like the comprehensive set of tests you've added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested:
- Repro steps on repro project
- Repro steps on blank project using a new PB cube
- Selecting/unselecting multiple edges with ctrl/cmd
- Performing actions with the selected edges
- Undo/redo
- Switched between edge, vertex, and face selection
- Selected edges, vertices, and faces outside of the camera
- Since bisection shows that the fix for PBLD-241 caused this issue, I also reproed the steps for that bug to ensure that fix is still working as intended
CHANGELOG.md
Outdated
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. | |||
- [PBLD-231] Fixed a bug where Extrude was not being disabled in the context menu when 'allow non-manifold actions' was not selected in the ProBuilder preferences. | |||
- [PBLD-238] Fixed a bug that could cause users to lose any work that they did on a ProBuilder mesh between two usages of tool actions that had previews (options overlays). | |||
- [PBLD-222] Fixed crash by preventing user from probuilderizing a gameobject that has isPartOfStaticBatch set to true. | |||
- [PBLD-242] Fixed a bug where edges were being incorrectly selected when one or both vertices were behind the camera's near plane, causing flipped lines and inconsistent selection behavior. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be under in a new section (unreleased or 6.0.7) since we just released 6.0.6
Purpose of this PR
The bug was caused by the camera clipping an edge, where one of its vertices was behind the camera's near plane. This led to the point inverting itself, causing the edge to flip direction and resulting in incorrect edge selection. To fix this, I implemented logic to clip edge points against the camera's near plane, ensuring that edges partially behind the camera are correctly processed. A new method (ClipPointToNearPlane) calculates the intersection of points with the near plane, and ProcessEdgePoints ensures accurate handling of edges with one or both vertices behind the camera. This resolves the issue of incorrect edge selection and ensures proper edge rendering and interaction.
Links
https://jira.unity3d.com/browse/PBLD-241
Comments to Reviewers
N/A