Skip to content

Commit

Permalink
Change to interpTime from deltaTime and tweaked filter values.
Browse files Browse the repository at this point in the history
  • Loading branch information
salmoncheeks committed Jan 13, 2025
1 parent b4ed8ed commit 0bf3ceb
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public partial class BasisNetworkReceiver : BasisNetworkPlayer
public bool HasAvatarInitalized;

public BasicOneEuroFilterParallelJob oneEuroFilterJob;
public float MinCutoff = .05f;
public float MinCutoff = 0.001f;
public float Beta = 5f;
public float DerivativeCutoff = 1.0f;

Expand Down Expand Up @@ -119,6 +119,7 @@ public void Compute(double TimeAsDouble)
ForceUpdateFilters();
}

oneEuroFilterJob.DeltaTime = interpolationTime;
EuroFilterHandle = oneEuroFilterJob.Schedule(LocalAvatarSyncMessage.StoredBones,64,musclesHandle);
}
}
Expand Down Expand Up @@ -322,7 +323,7 @@ public void ForceUpdateFilters()
{
InputValues = musclesPreEuro,
OutputValues = EuroValuesOutput,
DeltaTime = Time.deltaTime,
DeltaTime = interpolationTime,
MinCutoff = MinCutoff,
Beta = Beta,
DerivativeCutoff = DerivativeCutoff,
Expand All @@ -332,7 +333,7 @@ public void ForceUpdateFilters()
}
private float Alpha(float cutoff)
{
float te = 1.0f / (1.0f / Time.deltaTime);
float te = 1.0f / (1.0f / interpolationTime);
float tau = 1.0f / (2.0f * Mathf.PI * cutoff);
return 1.0f / (1.0f + tau / te);
}
Expand Down

0 comments on commit 0bf3ceb

Please sign in to comment.