Skip to content
Snippets Groups Projects
Commit 415bee63 authored by Jonathan Ehret's avatar Jonathan Ehret
Browse files

readd direct setting for small angles, to,e.g., improve fixating while an animation is running

parent cfdaeab6
Branches
No related tags found
No related merge requests found
......@@ -224,6 +224,17 @@ void FAnimNode_VHGazing::UpdateCurrentRotation(FGazingBoneData& GazingBoneData,
FQuat TargetRotQuat = TargetRotation.Quaternion();
const float Angle = FMath::RadiansToDegrees(CurrRotQuat.AngularDistance(TargetRotQuat));
//float MinAngle = DeltaTime * GazingPartData.MaxVelocity;
const float MinAngle = 5.0f; //the above would somewhat make more sense, during testing, however, this magic number performed much better...
if (Angle < MinAngle && GazingBoneData.AmplitudeCurrMovement == 0.0f)
{
// any rotation below MinAngle, is directly applied to avoid jittering etc. with moving targets and especially parallel full-body animations
// so if this is only a small correction movement, apply it!
GazingBoneData.CurrentRotation = TargetRotation;
return;
}
//we need to keep track how far this movement went to adapt speeds according to https://doi.org/10.1145/2724731
if (Angle > GazingBoneData.AmplitudeCurrMovement) {
GazingBoneData.AmplitudeCurrMovement = Angle;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment