Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2016-01-23 02:44:03 +0300
committerJoshua Leung <aligorith@gmail.com>2016-05-17 17:27:26 +0300
commit8524aab99b8488c353ebebc6af2eeccd6d7d41b4 (patch)
treec83f7cd69a504bdf2b2580ee5eaa098551f43e11
parent96e6d12c533766e3f2d592d150329bd439528035 (diff)
Code Cleanup - More style cleanups and removing unneeded extra steps
-rw-r--r--source/blender/blenkernel/intern/armature.c41
1 files changed, 18 insertions, 23 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 5b87c1dc2da..9ec3faa84b0 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);