[Bf-blender-cvs] [16e7573169d] soc-2021-curves: Merge branch 'master' into soc-2021-curves

dilithjay noreply at git.blender.org
Sat Dec 25 13:28:02 CET 2021


Commit: 16e7573169dea6f14f4cf62576516c16d0ad536b
Author: dilithjay
Date:   Fri Dec 24 21:08:34 2021 +0530
Branches: soc-2021-curves
https://developer.blender.org/rB16e7573169dea6f14f4cf62576516c16d0ad536b

Merge branch 'master' into soc-2021-curves

===================================================================



===================================================================

diff --cc source/blender/editors/sculpt_paint/sculpt.c
index b764d0e1b5b,ea13bb7adca..6f0616b966d
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@@ -1329,105 -1329,8 +1329,10 @@@ static void sculpt_rake_data_update(str
    }
  }
  
- static void sculpt_rake_rotate(const SculptSession *ss,
-                                const float sculpt_co[3],
-                                const float v_co[3],
-                                float factor,
-                                float r_delta[3])
- {
-   float vec_rot[3];
- 
- #if 0
-   /* lerp */
-   sub_v3_v3v3(vec_rot, v_co, sculpt_co);
-   mul_qt_v3(ss->cache->rake_rotation_symmetry, vec_rot);
-   add_v3_v3(vec_rot, sculpt_co);
-   sub_v3_v3v3(r_delta, vec_rot, v_co);
-   mul_v3_fl(r_delta, factor);
- #else
-   /* slerp */
-   float q_interp[4];
-   sub_v3_v3v3(vec_rot, v_co, sculpt_co);
- 
-   copy_qt_qt(q_interp, ss->cache->rake_rotation_symmetry);
-   pow_qt_fl_normalized(q_interp, factor);
-   mul_qt_v3(q_interp, vec_rot);
- 
-   add_v3_v3(vec_rot, sculpt_co);
-   sub_v3_v3v3(r_delta, vec_rot, v_co);
- #endif
- }
- 
- /**
-  * Align the grab delta to the brush normal.
-  *
-  * \param grab_delta: Typically from `ss->cache->grab_delta_symmetry`.
-  */
- static void sculpt_project_v3_normal_align(SculptSession *ss,
-                                            const float normal_weight,
-                                            float grab_delta[3])
- {
-   /* Signed to support grabbing in (to make a hole) as well as out. */
-   const float len_signed = dot_v3v3(ss->cache->sculpt_normal_symm, grab_delta);
- 
-   /* This scale effectively projects the offset so dragging follows the cursor,
-    * as the normal points towards the view, the scale increases. */
-   float len_view_scale;
-   {
-     float view_aligned_normal[3];
-     project_plane_v3_v3v3(
-         view_aligned_normal, ss->cache->sculpt_normal_symm, ss->cache->view_normal);
-     len_view_scale = fabsf(dot_v3v3(view_aligned_normal, ss->cache->sculpt_normal_symm));
-     len_view_scale = (len_view_scale > FLT_EPSILON) ? 1.0f / len_view_scale : 1.0f;
-   }
- 
-   mul_v3_fl(grab_delta, 1.0f - normal_weight);
-   madd_v3_v3fl(
-       grab_delta, ss->cache->sculpt_normal_symm, (len_signed * normal_weight) * len_view_scale);
- }
- 
  /** \} */
  
- /* -------------------------------------------------------------------- */
- /** \name SculptProjectVector
-  *
-  * Fast-path for #project_plane_v3_v3v3
-  * \{ */
- 
- typedef struct SculptProjectVector {
-   float plane[3];
-   float len_sq;
-   float len_sq_inv_neg;
-   bool is_valid;
- 
- } SculptProjectVector;
- 
- /**
-  * \param plane: Direction, can be any length.
-  */
- static void sculpt_project_v3_cache_init(SculptProjectVector *spvc, const float plane[3])
- {
-   copy_v3_v3(spvc->plane, plane);
-   spvc->len_sq = len_squared_v3(spvc->plane);
-   spvc->is_valid = (spvc->len_sq > FLT_EPSILON);
-   spvc->len_sq_inv_neg = (spvc->is_valid) ? -1.0f / spvc->len_sq : 0.0f;
- }
- 
- /**
-  * Calculate the projection.
-  */
- static void sculpt_project_v3(const SculptProjectVector *spvc, const float vec[3], float r_vec[3])
- {
- #if 0
-   project_plane_v3_v3v3(r_vec, vec, spvc->plane);
- #else
-   /* inline the projection, cache `-1.0 / dot_v3_v3(v_proj, v_proj)` */
-   madd_v3_v3fl(r_vec, spvc->plane, dot_v3v3(vec, spvc->plane) * spvc->len_sq_inv_neg);
- #endif
- }
- 
 +/** \} */
 +
  /* -------------------------------------------------------------------- */
  /** \name Sculpt Dynamic Topology
   * \{ */



More information about the Bf-blender-cvs mailing list