[Bf-blender-cvs] [8524aab] BendyBones: Code Cleanup - More style cleanups and removing unneeded extra steps
Joshua Leung
noreply at git.blender.org
Tue May 17 16:40:12 CEST 2016
Commit: 8524aab99b8488c353ebebc6af2eeccd6d7d41b4
Author: Joshua Leung
Date: Sat Jan 23 12:44:03 2016 +1300
Branches: BendyBones
https://developer.blender.org/rB8524aab99b8488c353ebebc6af2eeccd6d7d41b4
Code Cleanup - More style cleanups and removing unneeded extra steps
===================================================================
M source/blender/blenkernel/intern/armature.c
===================================================================
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 5b87c1d..9ec3faa 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -602,23 +602,18 @@ void b_bone_spline_setup(bPoseChannel *pchan, int rest, Mat4 result_array[MAX_BB
}
/* add extra rolls */
- float extraRoll1 = bone->roll1;
-
- if (bone->flag & BONE_ADD_PARENT_END_ROLL){
- extraRoll1 = extraRoll1 + prev->bone->roll2;
- }
- float extraRoll2 = bone->roll2;
-
- roll1 = roll1 + extraRoll1;
- roll2 = roll2 + extraRoll2;
-
- /* extra curve x / y */
+ roll1 += bone->roll1;
+ roll2 += bone->roll2;
+
+ if (bone->flag & BONE_ADD_PARENT_END_ROLL)
+ roll1 += prev->bone->roll2;
- h1[0] = h1[0] + bone->curveInX;
- h1[2] = h1[2] + bone->curveInY;
+ /* extra curve x / y */
+ h1[0] += bone->curveInX;
+ h1[2] += bone->curveInY;
- h2[0] = h2[0] + bone->curveOutX;
- h2[2] = h2[2] + bone->curveOutY;
+ h2[0] += bone->curveOutX;
+ h2[2] += bone->curveOutY;
/* make curve */
if (bone->segments > MAX_BBONE_SUBDIV)
@@ -645,21 +640,21 @@ void b_bone_spline_setup(bPoseChannel *pchan, int rest, Mat4 result_array[MAX_BB
}
float scaleFactorIn = 1.0;
- if (a <= bone->segments - 1){
- scaleFactorIn = 1.0 + (bone->scaleIn - 1.0)*((1.0*(bone->segments - a - 1)) / (1.0*(bone->segments - 1)));
+ if (a <= bone->segments - 1) {
+ scaleFactorIn = 1.0f + (bone->scaleIn - 1.0f) * ((1.0f * (bone->segments - a - 1)) / (1.0f * (bone->segments - 1)));
}
- float scaleFactorOut = 1.0;
- if (a >= 0){
- scaleFactorOut = 1.0 + (bone->scaleOut - 1.0)*((1.0*(a + 1)) / (1.0*(bone->segments - 1)));
+ float scaleFactorOut = 1.0f;
+ if (a >= 0) {
+ scaleFactorOut = 1.0 + (bone->scaleOut - 1.0f) * ((1.0f * (a + 1)) / (1.0f * (bone->segments - 1)));
}
float bscalemat[4][4], ibscalemat[4][4];
float bscale[3];
- bscale[0] = 1.0*scaleFactorIn*scaleFactorOut;
- bscale[1] = 1.0 / bone->segments;
- bscale[2] = 1.0*scaleFactorIn*scaleFactorOut;
+ bscale[0] = 1.0f * scaleFactorIn * scaleFactorOut;
+ bscale[1] = 1.0f / bone->segments;
+ bscale[2] = 1.0f * scaleFactorIn * scaleFactorOut;
size_to_mat4(bscalemat, bscale);
More information about the Bf-blender-cvs
mailing list