diff options
author | Sergey Sharybin <sergey@blender.org> | 2022-11-02 16:41:49 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2022-11-02 17:42:23 +0300 |
commit | 38c7fd36ff7a6eb4522a688d38faa086a6313ae6 (patch) | |
tree | ea1136a788b1d3db9d46f9a19900c396e30ce3f1 /source/blender/editors/physics | |
parent | 0fc958a174192b2b25c4187c170ec4a394dc308a (diff) |
Refactor: Rename Object->imat to Object->world_to_object
The goal is to improve clarity and readability, without
introducing big design changes.
Follows the recent obmat to object_to_world refactor: the
similar naming is used, and it is a run-time only rename,
meaning, there is no affect on .blend files.
This patch does not touch the redundant inversions. Those
can be removed in almost (if not all) cases, but it would
be the best to do it as a separate change.
Differential Revision: https://developer.blender.org/D16367
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 6dc3860fdf2..22295c260e2 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -3920,8 +3920,8 @@ static void brush_puff(PEData *data, int point_index, float mouse_distance) mul_m4_v3(mat, co); /* Use `kco` as the object space version of world-space `co`, - * `ob->imat` is set before calling. */ - mul_v3_m4v3(kco, data->ob->imat, co); + * `ob->world_to_object` is set before calling. */ + mul_v3_m4v3(kco, data->ob->world_to_object, co); point_index = BLI_kdtree_3d_find_nearest(edit->emitter_field, kco, NULL); if (point_index == -1) { @@ -4010,8 +4010,8 @@ static void brush_puff(PEData *data, int point_index, float mouse_distance) mul_m4_v3(mat, oco); /* Use `kco` as the object space version of world-space `co`, - * `ob->imat` is set before calling. */ - mul_v3_m4v3(kco, data->ob->imat, oco); + * `ob->world_to_object` is set before calling. */ + mul_v3_m4v3(kco, data->ob->world_to_object, oco); point_index = BLI_kdtree_3d_find_nearest(edit->emitter_field, kco, NULL); if (point_index != -1) { @@ -4797,7 +4797,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) data.combfac = 1.0f - data.combfac; } - invert_m4_m4(ob->imat, ob->object_to_world); + invert_m4_m4(ob->world_to_object, ob->object_to_world); ED_view3d_win_to_delta(region, xy_delta, bedit->zfac, vec); data.dvec = vec; @@ -4865,7 +4865,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) } data.invert = (brush->invert ^ flip); - invert_m4_m4(ob->imat, ob->object_to_world); + invert_m4_m4(ob->world_to_object, ob->object_to_world); foreach_mouse_hit_point(&data, brush_puff, selected); } @@ -4895,7 +4895,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) data.smoothfac = brush->strength; - invert_m4_m4(ob->imat, ob->object_to_world); + invert_m4_m4(ob->world_to_object, ob->object_to_world); foreach_mouse_hit_key(&data, brush_smooth_get, selected); @@ -5112,7 +5112,7 @@ static bool shape_cut_test_point(PEData *data, ParticleEditSettings *pset, Parti userdata.num_hits = 0; float co_shape[3]; - mul_v3_m4v3(co_shape, pset->shape_object->imat, key->co); + mul_v3_m4v3(co_shape, pset->shape_object->world_to_object, key->co); BLI_bvhtree_ray_cast_all( shape_bvh->tree, co_shape, dir, 0.0f, BVH_RAYCAST_DIST_MAX, point_inside_bvh_cb, &userdata); @@ -5153,8 +5153,8 @@ static void shape_cut(PEData *data, int pa_index) float dir_shape[3]; float len_shape; - mul_v3_m4v3(co_curr_shape, pset->shape_object->imat, key->co); - mul_v3_m4v3(co_next_shape, pset->shape_object->imat, (key + 1)->co); + mul_v3_m4v3(co_curr_shape, pset->shape_object->world_to_object, key->co); + mul_v3_m4v3(co_next_shape, pset->shape_object->world_to_object, (key + 1)->co); sub_v3_v3v3(dir_shape, co_next_shape, co_curr_shape); len_shape = normalize_v3(dir_shape); |