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:
Diffstat (limited to 'source/blender/ikplugin')
-rw-r--r--source/blender/ikplugin/intern/iksolver_plugin.c3
-rw-r--r--source/blender/ikplugin/intern/itasc_plugin.cpp5
2 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/ikplugin/intern/iksolver_plugin.c b/source/blender/ikplugin/intern/iksolver_plugin.c
index 86bdc7e1ab6..af15333ece5 100644
--- a/source/blender/ikplugin/intern/iksolver_plugin.c
+++ b/source/blender/ikplugin/intern/iksolver_plugin.c
@@ -334,7 +334,8 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
IK_SetStiffness(seg, IK_Z, pchan->stiffness[2]);
if (tree->stretch && (pchan->ikstretch > 0.0f)) {
- double ikstretch = (double)pchan->ikstretch * (double)pchan->ikstretch;
+ const float ikstretch = pchan->ikstretch * pchan->ikstretch;
+ /* this function does its own clamping */
IK_SetStiffness(seg, IK_TRANS_Y, 1.0f - ikstretch);
IK_SetLimit(seg, IK_TRANS_Y, IK_STRETCH_STIFF_MIN, IK_STRETCH_STIFF_MAX);
}
diff --git a/source/blender/ikplugin/intern/itasc_plugin.cpp b/source/blender/ikplugin/intern/itasc_plugin.cpp
index 1154605c673..516a4c7fdda 100644
--- a/source/blender/ikplugin/intern/itasc_plugin.cpp
+++ b/source/blender/ikplugin/intern/itasc_plugin.cpp
@@ -1254,8 +1254,9 @@ static IK_Scene *convert_tree(Scene *blscene, Object *ob, bPoseChannel *pchan)
joint = bone->name;
joint += ":TY";
ret = arm->addSegment(joint, parent, KDL::Joint::TransY, rot[ikchan->ndof - 1]);
- float ikstretch = pchan->ikstretch * pchan->ikstretch;
- weight[1] = (1.0 - minf(1.0 - ikstretch, 0.99));
+ const float ikstretch = pchan->ikstretch * pchan->ikstretch;
+ /* why invert twice here? */
+ weight[1] = (1.0 - minf(1.0 - ikstretch, 1.0f - IK_STRETCH_STIFF_EPS));
weights.push_back(weight[1]);
}
if (!ret)