public void UpdateFilter(ref KinectInterop.BodyFrameData bodyFrame)
{
if (this.init == false)
{
this.Init(); // initialize with default parameters
}
KinectInterop.SmoothParameters tempSmoothingParams = new KinectInterop.SmoothParameters();
tempSmoothingParams.smoothing = this.smoothParameters.smoothing;
tempSmoothingParams.correction = this.smoothParameters.correction;
tempSmoothingParams.prediction = this.smoothParameters.prediction;
KinectManager manager = KinectManager.Instance;
int bodyCount = manager.GetBodyCount();
for (int bodyIndex = 0; bodyIndex < bodyCount; bodyIndex++)
{
if (bodyFrame.bodyData[bodyIndex].bIsTracked != 0)
{
FilterBodyJoints(ref bodyFrame.bodyData[bodyIndex], bodyIndex, ref tempSmoothingParams);
}
}
}