Fix clamp linear translation limit causing jittering in some assets.

[FYI] Benn.Gallagher


#ROBOMERGE-SOURCE: CL 5768103 via CL 5768104 via CL 5768828 via CL 5770632

[CL 5770745 by satchit subramanian in Main branch]
This commit is contained in:
satchit subramanian
2019-04-05 19:59:27 -04:00
parent f58f54b8c5
commit 886c3821ab
@@ -197,6 +197,7 @@ void FAnimNode_RigidBody::InitializeNewBodyTransformsDuringSimulation(FComponent
const FTransform WSBodyTM = BodyRelativeTransform * Bodies[OutputData.ParentBodyIndex]->GetWorldTransform();
Bodies[BodyIndex]->SetWorldTransform(WSBodyTM);
BodyAnimData[BodyIndex].RefPoseLength = BodyRelativeTransform.GetLocation().Size();
}
// If we don't have a parent body, then we can just grab the incoming pose in component space.
else
@@ -323,6 +324,10 @@ void FAnimNode_RigidBody::EvaluateSkeletalControl_AnyThread(FComponentSpacePoseC
BodyTM = ConvertCSTransformToSimSpace(SimulationSpace, ComponentSpaceTM, CompWorldSpaceTM, BaseBoneTM);
Bodies[BodyIndex]->SetWorldTransform(BodyTM);
if (OutputData.ParentBodyIndex != INDEX_NONE)
{
BodyAnimData[BodyIndex].RefPoseLength = BodyTM.GetRelativeTransform(Bodies[OutputData.ParentBodyIndex]->GetWorldTransform()).GetLocation().Size();
}
}
}
break;
@@ -338,6 +343,10 @@ void FAnimNode_RigidBody::EvaluateSkeletalControl_AnyThread(FComponentSpacePoseC
const FTransform& ComponentSpaceTM = Output.Pose.GetComponentSpaceTransform(OutputData.CompactPoseBoneIndex);
const FTransform BodyTM = ConvertCSTransformToSimSpace(SimulationSpace, ComponentSpaceTM, CompWorldSpaceTM, BaseBoneTM);
Bodies[BodyIndex]->SetWorldTransform(BodyTM);
if (OutputData.ParentBodyIndex != INDEX_NONE)
{
BodyAnimData[BodyIndex].RefPoseLength = BodyTM.GetRelativeTransform(Bodies[OutputData.ParentBodyIndex]->GetWorldTransform()).GetLocation().Size();
}
}
}
break;