Example #1
0
 private void CreateSmootherType(SmoothingTypes type, float factor, out PXCMDataSmoothing.Smoother1D smoother)
 {
     switch (type)
     {
     case SmoothingTypes.Quadratic:
         smoother = _dataSmoothing.Create1DQuadratic(factor);
         break;
     case SmoothingTypes.Stabilizer:
         smoother = _dataSmoothing.Create1DStabilizer(7, factor);
         break;
     case SmoothingTypes.Weighted:
         smoother = _dataSmoothing.Create1DWeighted((int)factor);
         break;
     case SmoothingTypes.Spring:
     default:
         smoother = _dataSmoothing.Create1DSpring(factor);
         break;
     }
 }
    //Close any ongoing Session
    void OnDisable()
    {
        if (smoother3D != null) {
            for (int i=0;i<MaxHands;i++) {
                if (smoother3D[i] !=null) {
                    for (int j=0;j<MaxJoints;j++) {
                        smoother3D[i][j].Dispose();
                        smoother3D[i][j]=null;
                    }
                }
            }
            smoother3D=null;
        }

        if (ds != null) {
            ds.Dispose();
            ds=null;
        }

        if (sm != null) {
            sm.Close ();
            sm.Dispose ();
            sm = null;
        }
    }