diff options
Diffstat (limited to 'source/blender/editors/physics/particle_edit.c')
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index e6d0aca7902..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) { @@ -3930,7 +3930,7 @@ static void brush_puff(PEData *data, int point_index, float mouse_distance) copy_v3_v3(co_root, co); copy_v3_v3(no_root, &edit->emitter_cosnos[point_index * 6 + 3]); - mul_mat3_m4_v3(data->ob->obmat, no_root); /* normal into global-space */ + mul_mat3_m4_v3(data->ob->object_to_world, no_root); /* normal into global-space */ normalize_v3(no_root); if (puff_volume) { @@ -4010,14 +4010,14 @@ 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) { copy_v3_v3(onor, &edit->emitter_cosnos[point_index * 6 + 3]); - mul_mat3_m4_v3(data->ob->obmat, onor); /* Normal into world-space. */ - mul_mat3_m4_v3(imat, onor); /* World-space into particle-space. */ + mul_mat3_m4_v3(data->ob->object_to_world, onor); /* Normal into world-space. */ + mul_mat3_m4_v3(imat, onor); /* World-space into particle-space. */ normalize_v3(onor); } else { @@ -4412,7 +4412,7 @@ static int brush_add(const bContext *C, PEData *data, short number) short size = pset->brush[PE_BRUSH_ADD].size; RNG *rng; - invert_m4_m4(imat, ob->obmat); + invert_m4_m4(imat, ob->object_to_world); if (psys->flag & PSYS_GLOBAL_HAIR) { return 0; @@ -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->obmat); + 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->obmat); + 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->obmat); + 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); |