diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2020-06-18 06:00:43 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2020-06-18 06:01:05 +0300 |
commit | d8206602feed27088b0b07bfb567f67754ad0359 (patch) | |
tree | 5b70a8979148b8401d9b8ed15e654a1b922773c3 /source/blender/blenlib/BLI_math_geom.h | |
parent | 18ccf328ac5611221e073aebaddde1b0b2169984 (diff) |
Transform: Snap to the intersection between constraint and geometry
This commit changes the behavior of 4 snapping combinations:
**1. While constraining to a plane, snap to an edge element:**
The snap is made at the intersection between the edge direction and the
constraint plane.
**2. While constraining to a plane, snap to a face element:**
The snap is made to the nearest point between the snap point and the
line that intersects the face plane with the constraint plane.
**3. While constraining to an axis, snap to an edge/line element:**
The snap is made to the nearest point on the axis to the edge/line.
**4. While constraining to an axis, snap to a face element:**
The snap is made at the intersection of the axis and the plane defined
by the face.
To avoid unpredictable jumps outside view boundaries, an alignment
check is made for each of these snapping combinations.
Resolve/fix T66422
Differential Revision: https://developer.blender.org/D5608
Diffstat (limited to 'source/blender/blenlib/BLI_math_geom.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_geom.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h index 563bcad5d14..f51486c5e7b 100644 --- a/source/blender/blenlib/BLI_math_geom.h +++ b/source/blender/blenlib/BLI_math_geom.h @@ -190,6 +190,10 @@ float dist_squared_to_projected_aabb_simple(const float projmat[4][4], const float bbmin[3], const float bbmax[3]); +float closest_to_ray_v3(float r_close[3], + const float p[3], + const float ray_orig[3], + const float ray_dir[3]); float closest_to_line_v2(float r_close[2], const float p[2], const float l1[2], const float l2[2]); double closest_to_line_v2_db(double r_close[2], const double p[2], |