Feature: added support for influence factor in IK constraint.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10854 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
experimental
Kae..pl 11 years ago
parent 821d6b6aa3
commit 27a7fde24d
  1. 4
      engine/src/blender/com/jme3/scene/plugins/blender/constraints/definitions/ConstraintDefinitionIK.java

@ -40,7 +40,7 @@ public class ConstraintDefinitionIK extends ConstraintDefinition {
@Override
public void bake(Space ownerSpace, Space targetSpace, Transform targetTransform, float influence) {
if (needToCompute) {
if (needToCompute && influence != 0) {
ConstraintHelper constraintHelper = blenderContext.getHelper(ConstraintHelper.class);
BoneContext[] boneContexts = this.getBones();
float b = chainLength;
@ -73,6 +73,8 @@ public class ConstraintDefinitionIK extends ConstraintDefinition {
} else {
theta = vectorA.angleBetween(vectorC) - FastMath.acos(-(b * b - a * a - c * c) / (2 * a * c));
}
theta *= influence;
if (theta != 0) {
Vector3f vectorR = vectorA.cross(vectorC);

Loading…
Cancel
Save