Cleanup: Combine x_tilt and y_tilt into single float2

Part of #126672

Pull Request: https://projects.blender.org/blender/blender/pulls/126711
This commit is contained in:
Sean Kim
2024-08-24 01:26:17 +02:00
committed by Sean Kim
parent 47a54b664a
commit 43f5b1b5fc
2 changed files with 4 additions and 6 deletions

View File

@@ -2811,10 +2811,10 @@ void SCULPT_tilt_apply_to_normal(float r_normal[3],
const float rot_max = M_PI_2 * tilt_strength * SCULPT_TILT_SENSITIVITY;
mul_v3_mat3_m4v3(r_normal, cache->vc->obact->object_to_world().ptr(), r_normal);
float normal_tilt_y[3];
rotate_v3_v3v3fl(normal_tilt_y, r_normal, cache->vc->rv3d->viewinv[0], cache->y_tilt * rot_max);
rotate_v3_v3v3fl(normal_tilt_y, r_normal, cache->vc->rv3d->viewinv[0], cache->tilt.y * rot_max);
float normal_tilt_xy[3];
rotate_v3_v3v3fl(
normal_tilt_xy, normal_tilt_y, cache->vc->rv3d->viewinv[1], cache->x_tilt * rot_max);
normal_tilt_xy, normal_tilt_y, cache->vc->rv3d->viewinv[1], cache->tilt.x * rot_max);
mul_v3_mat3_m4v3(r_normal, cache->vc->obact->world_to_object().ptr(), normal_tilt_xy);
normalize_v3(r_normal);
}
@@ -4544,8 +4544,7 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt &sd, Object &ob, Po
cache.pressure = RNA_float_get(ptr, "pressure");
}
cache.x_tilt = RNA_float_get(ptr, "x_tilt");
cache.y_tilt = RNA_float_get(ptr, "y_tilt");
cache.tilt = {RNA_float_get(ptr, "x_tilt"), RNA_float_get(ptr, "y_tilt")};
/* Truly temporary data that isn't stored in properties. */
if (SCULPT_stroke_is_first_brush_step_of_symmetry_pass(*ss.cache)) {

View File

@@ -178,8 +178,7 @@ struct StrokeCache {
*/
float bstrength;
float normal_weight; /* from brush (with optional override) */
float x_tilt;
float y_tilt;
float2 tilt;
/* Position of the mouse corresponding to the stroke location, modified by the paint_stroke
* operator according to the stroke type. */