Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-06-21 10:25:10 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-06-21 10:27:56 +0300
commit4044c29069aa3230767fa6d1a3dec196718f80df (patch)
tree3dfb3b888ff25a5c73c7201bb9ee6ffa4da6295e /source/blender/editors/include
parent54d651c34459ee482490752f6d64727f15068b4e (diff)
Fix T32214: Wireframe edge select fails with verts behind the view
This resolves a long standing bug in edge selection (picking, circle, box & lasso). Now when one of the edges vertices fails to project into screen space, the edge is clipped by the viewport to calculate an on-screen location that can be used instead. This isn't default as it may be important for the on the screen location not to be clipped by the viewport.
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r--source/blender/editors/include/ED_view3d.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index bdaea7d8bff..d86041aa6e8 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -196,12 +196,38 @@ typedef enum {
V3D_PROJ_TEST_CLIP_NEAR = (1 << 2),
V3D_PROJ_TEST_CLIP_FAR = (1 << 3),
V3D_PROJ_TEST_CLIP_ZERO = (1 << 4),
+ /**
+ * Clip the contents of the data being iterated over.
+ * Currently this is only used to edges when projecting into screen space.
+ *
+ * Clamp the edge within the viewport limits defined by
+ * #V3D_PROJ_TEST_CLIP_WIN, #V3D_PROJ_TEST_CLIP_NEAR & #V3D_PROJ_TEST_CLIP_FAR.
+ * This resolves the problem of a visible edge having one of it's vertices
+ * behind the viewport. See: T32214.
+ *
+ * This is not default behavior as it may be important for the screen-space location
+ * of an edges vertex to represent that vertices location (instead of a location along the edge).
+ *
+ * \note Perspective views should enable #V3D_PROJ_TEST_CLIP_WIN along with
+ * #V3D_PROJ_TEST_CLIP_NEAR as the near-plane-clipped location of a point
+ * may become very large (even infinite) when projected into screen-space.
+ * Unless the that point happens to coincide with the camera's point of view.
+ *
+ * Use #V3D_PROJ_TEST_CLIP_CONTENT_DEFAULT instead of #V3D_PROJ_TEST_CLIP_CONTENT,
+ * to avoid accidentally enabling near clipping without clipping by window bounds.
+ */
+ V3D_PROJ_TEST_CLIP_CONTENT = (1 << 5),
} eV3DProjTest;
#define V3D_PROJ_TEST_CLIP_DEFAULT \
(V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN | V3D_PROJ_TEST_CLIP_NEAR)
#define V3D_PROJ_TEST_ALL \
- (V3D_PROJ_TEST_CLIP_DEFAULT | V3D_PROJ_TEST_CLIP_FAR | V3D_PROJ_TEST_CLIP_ZERO)
+ (V3D_PROJ_TEST_CLIP_DEFAULT | V3D_PROJ_TEST_CLIP_FAR | V3D_PROJ_TEST_CLIP_ZERO | \
+ V3D_PROJ_TEST_CLIP_CONTENT)
+
+#define V3D_PROJ_TEST_CLIP_CONTENT_DEFAULT \
+ (V3D_PROJ_TEST_CLIP_CONTENT | V3D_PROJ_TEST_CLIP_NEAR | V3D_PROJ_TEST_CLIP_FAR | \
+ V3D_PROJ_TEST_CLIP_WIN)
/* view3d_iterators.c */