Beispiel #1
0
            //set distortion parameters for K1 Radial Distortion method
            private void SetK1RadialDistortion(float k1Red, float k1Green, float k1Blue, Vector2 center)
            {
                // disable distortion if there is no distortion for this HMD
                if (k1Red == 0 && k1Green == 0 && k1Blue == 0)
                {
                    if (DistortionEffect)
                    {
                        DistortionEffect.enabled = false;
                    }
                    return;
                }
                // Otherwise try to create distortion and set its parameters
                var distortionFactory = new K1RadialDistortionFactory();
                var effect            = distortionFactory.GetOrCreateDistortion(this);

                if (effect)
                {
                    effect.k1Red   = k1Red;
                    effect.k1Green = k1Green;
                    effect.k1Blue  = k1Blue;
                    effect.center  = center;
                }
            }
 //set distortion parameters for K1 Radial Distortion method
 private void SetK1RadialDistortion(float k1Red, float k1Green, float k1Blue, Vector2 center)
 {
     // disable distortion if there is no distortion for this HMD
     if (k1Red == 0 && k1Green == 0 && k1Blue == 0)
     {
         if (DistortionEffect)
         {
             DistortionEffect.enabled = false;
         }
         return;
     }
     // Otherwise try to create distortion and set its parameters
     var distortionFactory = new K1RadialDistortionFactory();
     var effect = distortionFactory.GetOrCreateDistortion(this);
     if (effect)
     {
         effect.k1Red = k1Red;
         effect.k1Green = k1Green;
         effect.k1Blue = k1Blue;
         effect.center = center;
     }
 }