Fix T43715: IK pole target + stretch not working for a single bone chain.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Sun, 20 Sep 2015 23:48:37 +0000 (01:48 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Sun, 20 Sep 2015 23:59:50 +0000 (01:59 +0200)
intern/iksolver/intern/IK_Solver.cpp

index 65ea4d64ab137c2e8ee8d3ad7d086b46b3890a26..eb18cde335685ad6aea8e4fd5a32a89c7f1978e0 100644 (file)
@@ -292,6 +292,7 @@ void IK_SolverAddGoal(IK_Solver *solver, IK_Segment *tip, float goal[3], float w
        IK_QSolver *qsolver = (IK_QSolver *)solver;
        IK_QSegment *qtip = (IK_QSegment *)tip;
 
+       // in case of composite segment the second segment is the tip
        if (qtip->Composite())
                qtip = qtip->Composite();
 
@@ -310,6 +311,7 @@ void IK_SolverAddGoalOrientation(IK_Solver *solver, IK_Segment *tip, float goal[
        IK_QSolver *qsolver = (IK_QSolver *)solver;
        IK_QSegment *qtip = (IK_QSegment *)tip;
 
+       // in case of composite segment the second segment is the tip
        if (qtip->Composite())
                qtip = qtip->Composite();
 
@@ -331,6 +333,10 @@ void IK_SolverSetPoleVectorConstraint(IK_Solver *solver, IK_Segment *tip, float
        IK_QSolver *qsolver = (IK_QSolver *)solver;
        IK_QSegment *qtip = (IK_QSegment *)tip;
 
+       // in case of composite segment the second segment is the tip
+       if (qtip->Composite())
+               qtip = qtip->Composite();
+
        MT_Vector3 qgoal(goal);
        MT_Vector3 qpolegoal(polegoal);