mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-12-06 08:42:32 -08:00
tweak default filtering for more prediction
This commit is contained in:
1 parent
5a38235814
commit
0256c472e1
3 files changed
+10
-7
No files matched your search
@@ -116,8 +116,8 @@ data class SkeletonTogglesConfig(
|
||||
// Used in SkeletonConfig
|
||||
@Serializable
|
||||
data class SkeletonRatiosConfig(
|
||||
val smoothingStrength: Float = 0.15f,
|
||||
val predictionStrength: Float = 0.3f,
|
||||
val smoothingStrength: Float = 0.10f,
|
||||
val predictionStrength: Float = 0.35f,
|
||||
val spineCurvature: Float = 0.75f,
|
||||
val imputeSpineFromUpperToLower: Float = DEFAULT_SPINE_UPPER_LOWER,
|
||||
val interpolateUpperLegsTwistWithLowerLegs: Float = 0.85f,
|
||||
|
||||
@@ -61,11 +61,14 @@ class VelocityComputedProcessor :
|
||||
for ((bodyPart, bone) in mutableComputedSkeleton) {
|
||||
val lastVelocitySample = lastVelocities[bodyPart]
|
||||
|
||||
// Compute current velocity
|
||||
// Compute velocity
|
||||
val currentBoneSample = BoneSample(bone.rotation, bone.tailPosition)
|
||||
|
||||
val currentVelocity = lastVelocitySample?.boneSample?.let { computeVelocity(currentBoneSample, it, deltaTime) } ?: ZERO_VELOCITY
|
||||
val smoothedVelocity = smoothVelocity(currentVelocity, lastVelocitySample?.velocity ?: ZERO_VELOCITY, deltaTime)
|
||||
val smoothedVelocity = if (lastVelocitySample != null) {
|
||||
val currentVelocity = computeVelocity(currentBoneSample, lastVelocitySample.boneSample, deltaTime)
|
||||
smoothVelocity(currentVelocity, lastVelocitySample.velocity, deltaTime)
|
||||
} else {
|
||||
ZERO_VELOCITY
|
||||
}
|
||||
|
||||
mutableComputedSkeleton[bodyPart] = bone.copy(velocity = smoothedVelocity)
|
||||
lastVelocities[bodyPart] = VelocitySample(currentBoneSample, smoothedVelocity)
|
||||
|
||||
@@ -33,7 +33,7 @@ private const val UPSAMPLING_TIME_CARRYOVER_MAX = 0.9f
|
||||
private const val SMOOTHING_MS_MAX = 75.0
|
||||
|
||||
// Prediction
|
||||
private const val PREDICTION_MS_MAX = 30.0
|
||||
private const val PREDICTION_MS_MAX = 32.0
|
||||
private const val PREVIOUS_PREDICTION_DECAY = 0.25f
|
||||
|
||||
private data class BoneSample(
|
||||
|
||||
Reference in new issue
Block a user