Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_correctivesmooth.c
| Show First 20 Lines • Show All 406 Lines • ▼ Show 20 Lines | static bool calc_tangent_loop(const float v_dir_prev[3], | ||||
| cross_v3_v3v3(r_tspace[2], v_dir_prev, v_dir_next); | cross_v3_v3v3(r_tspace[2], v_dir_prev, v_dir_next); | ||||
| normalize_v3(r_tspace[2]); | normalize_v3(r_tspace[2]); | ||||
| /* Make orthogonal using `r_tspace[2]` as a basis. | /* Make orthogonal using `r_tspace[2]` as a basis. | ||||
| * | * | ||||
| * NOTE: while it seems more logical to use `v_dir_prev` & `v_dir_next` as separate X/Y axis | * NOTE: while it seems more logical to use `v_dir_prev` & `v_dir_next` as separate X/Y axis | ||||
| * (instead of combining them as is done here). It's not necessary as the directions of the | * (instead of combining them as is done here). It's not necessary as the directions of the | ||||
| * axis aren't important as long as the difference between tangent matrices is equivalent. | * axis aren't important as long as the difference between tangent matrices is equivalent. | ||||
| * Some computations can be skipped by combining the the two directions, | * Some computations can be skipped by combining the two directions, | ||||
| * using the cross product for the 3rd axes. */ | * using the cross product for the 3rd axes. */ | ||||
| add_v3_v3(r_tspace[0], r_tspace[1]); | add_v3_v3(r_tspace[0], r_tspace[1]); | ||||
| normalize_v3(r_tspace[0]); | normalize_v3(r_tspace[0]); | ||||
| cross_v3_v3v3(r_tspace[1], r_tspace[2], r_tspace[0]); | cross_v3_v3v3(r_tspace[1], r_tspace[2], r_tspace[0]); | ||||
| return true; | return true; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 452 Lines • Show Last 20 Lines | |||||