Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/armature.c
| Show First 20 Lines • Show All 592 Lines • ▼ Show 20 Lines | if (next) { | ||||
| /* find the next roll to interpolate as well */ | /* find the next roll to interpolate as well */ | ||||
| if (rest) | if (rest) | ||||
| mul_m4_m4m4(difmat, imat, next->bone->arm_mat); | mul_m4_m4m4(difmat, imat, next->bone->arm_mat); | ||||
| else | else | ||||
| mul_m4_m4m4(difmat, imat, next->pose_mat); | mul_m4_m4m4(difmat, imat, next->pose_mat); | ||||
| copy_m3_m4(result, difmat); /* the desired rotation at beginning of next bone */ | copy_m3_m4(result, difmat); /* the desired rotation at beginning of next bone */ | ||||
| vec_roll_to_mat3(h2, 0.0f, mat3); /* the result of vec_roll without roll */ | vec_roll_to_mat3(h2, 0.0f, mat3); /* the result of vec_roll without roll */ | ||||
aligorith: Mark these as `const float` too | |||||
| invert_m3_m3(imat3, mat3); | invert_m3_m3(imat3, mat3); | ||||
| mul_m3_m3m3(mat3, imat3, result); /* the matrix transforming vec_roll to desired roll */ | mul_m3_m3m3(mat3, imat3, result); /* the matrix transforming vec_roll to desired roll */ | ||||
| roll2 = atan2f(mat3[2][0], mat3[2][2]); | roll2 = atan2f(mat3[2][0], mat3[2][2]); | ||||
| } | } | ||||
| else { | else { | ||||
| h2[0] = 0.0f; h2[1] = 1.0f; h2[2] = 0.0f; | h2[0] = 0.0f; h2[1] = 1.0f; h2[2] = 0.0f; | ||||
| roll2 = 0.0; | roll2 = 0.0; | ||||
| } | } | ||||
| { | { | ||||
| const float circle_factor = length * (cubic_tangent_factor_circle_v3(h1, h2) / 0.75f); | const float circle_factor = length * (cubic_tangent_factor_circle_v3(h1, h2) / 0.75f); | ||||
| const float hlength1 = bone->ease1 * circle_factor; | const float combined_ease1 = bone->ease1 + (!rest ? pchan->ease1 : 0.0f); | ||||
| const float hlength2 = bone->ease2 * circle_factor; | const float combined_ease2 = bone->ease2 + (!rest ? pchan->ease2 : 0.0f); | ||||
| const float hlength1 = combined_ease1 * circle_factor; | |||||
| const float hlength2 = combined_ease2 * circle_factor; | |||||
| /* and only now negate h2 */ | /* and only now negate h2 */ | ||||
| mul_v3_fl(h1, hlength1); | mul_v3_fl(h1, hlength1); | ||||
| mul_v3_fl(h2, -hlength2); | mul_v3_fl(h2, -hlength2); | ||||
| } | } | ||||
| /* Add effects from bbone properties over the top | /* Add effects from bbone properties over the top | ||||
| * - These properties allow users to hand-animate the | * - These properties allow users to hand-animate the | ||||
| ▲ Show 20 Lines • Show All 1,846 Lines • Show Last 20 Lines | |||||
Mark these as const float too