Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_normal_edit.cc
| Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | static void generate_vert_coordinates(Mesh *mesh, | ||||
| } | } | ||||
| if (ob_center != nullptr) { | if (ob_center != nullptr) { | ||||
| float inv_obmat[4][4]; | float inv_obmat[4][4]; | ||||
| /* Translate our coordinates so that center of ob_center is at (0, 0, 0). */ | /* Translate our coordinates so that center of ob_center is at (0, 0, 0). */ | ||||
| /* Get ob_center (world) coordinates in ob local coordinates. | /* Get ob_center (world) coordinates in ob local coordinates. | ||||
| * No need to take into account ob_center's space here, see T44027. */ | * No need to take into account ob_center's space here, see T44027. */ | ||||
| invert_m4_m4(inv_obmat, ob->obmat); | invert_m4_m4(inv_obmat, ob->object_to_world); | ||||
| mul_v3_m4v3(diff, inv_obmat, ob_center->obmat[3]); | mul_v3_m4v3(diff, inv_obmat, ob_center->object_to_world[3]); | ||||
| negate_v3(diff); | negate_v3(diff); | ||||
| do_diff = true; | do_diff = true; | ||||
| } | } | ||||
| else if (offset != nullptr && !is_zero_v3(offset)) { | else if (offset != nullptr && !is_zero_v3(offset)) { | ||||
| negate_v3_v3(diff, offset); | negate_v3_v3(diff, offset); | ||||
| do_diff = true; | do_diff = true; | ||||
| ▲ Show 20 Lines • Show All 271 Lines • ▼ Show 20 Lines | float(*nos)[3] = static_cast<float(*)[3]>( | ||||
| MEM_malloc_arrayN(size_t(loops_num), sizeof(*nos), __func__)); | MEM_malloc_arrayN(size_t(loops_num), sizeof(*nos), __func__)); | ||||
| float target_co[3]; | float target_co[3]; | ||||
| int i; | int i; | ||||
| /* Get target's center coordinates in ob local coordinates. */ | /* Get target's center coordinates in ob local coordinates. */ | ||||
| float mat[4][4]; | float mat[4][4]; | ||||
| invert_m4_m4(mat, ob->obmat); | invert_m4_m4(mat, ob->object_to_world); | ||||
| mul_m4_m4m4(mat, mat, ob_target->obmat); | mul_m4_m4m4(mat, mat, ob_target->object_to_world); | ||||
| copy_v3_v3(target_co, mat[3]); | copy_v3_v3(target_co, mat[3]); | ||||
| if (use_parallel_normals) { | if (use_parallel_normals) { | ||||
| float no[3]; | float no[3]; | ||||
| sub_v3_v3v3(no, target_co, enmd->offset); | sub_v3_v3v3(no, target_co, enmd->offset); | ||||
| normalize_v3(no); | normalize_v3(no); | ||||
| ▲ Show 20 Lines • Show All 399 Lines • Show Last 20 Lines | |||||