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:
authorCampbell Barton <ideasman42@gmail.com>2012-07-29 21:49:14 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-07-29 21:49:14 +0400
commitf608b3c44402ef5c58217481d93e7fa83c9cd7cf (patch)
treecc8211154eb5a3cf9e1d89484cbe48facd51b90e /source/blender/ikplugin
parentc41e1e434ab9defa35178ad8886d81b60d889e9a (diff)
code cleanup:
- building without python works again - rename maxi/mini to i_max/i_min (so thay are available for function names) - some minor edits to IK stretch setting (no functional changes).
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)