public override void Accept(ConnectionHandler ch, EriverProtocol packet) { XConfSettings xconf = new XConfSettings( Properties.Settings.Default.ScreenHeight, Properties.Settings.Default.ScreenWidth, Properties.Settings.Default.TrackerDeltaX, Properties.Settings.Default.TrackerDeltaY, Properties.Settings.Default.TrackerDeltaZ, Properties.Settings.Default.TrackerDeltaAngle); //ch.GetTracker().SetXConfig(xconf, packet.StartCalibration.Angle); ch.GetTracker().StartCalibration(defaultAction(ch, packet)); }
void ITracker.SetXConfig(XConfSettings xconfig, double angle) { //Do XConfig //XConfSettings xconf = new XConfSettings(512, 290, 0, 20, 3, 2); //Dreamhack values /* Read from file in future. try { using(Open("eriver.xconf", "r") as File f) { XConfSettings.load(xconf, f); } } catch (IOError e) { Console.WriteLine("No XConf file. Continuing without..."); } */ double[] x= new double[]{(-xconfig.Width)/2 + xconfig.Dx, xconfig.Width/2 - xconfig.Dx, (-xconfig.Width)/2 + xconfig.Dx}; double[] y= new double[]{xconfig.Height+xconfig.Dy, xconfig.Height+xconfig.Dy, xconfig.Dy}; double[] z= new double[]{xconfig.Dz, xconfig.Dz, xconfig.Dz}; double theta = Math.PI * ((angle + xconfig.Dangle) / 180); XConfiguration xconf = new XConfiguration(); xconf.UpperLeft = new Point3D( x[0], Math.Cos(theta)*y[0] - Math.Sin(theta)*z[0], Math.Sin(theta)*y[0] + Math.Cos(theta)*z[0]); xconf.UpperRight = new Point3D( x[1], Math.Cos(theta)*y[1] - Math.Sin(theta)*z[1], Math.Sin(theta)*y[1] + Math.Cos(theta)*z[1]); xconf.LowerLeft = new Point3D( x[2], Math.Cos(theta)*y[2] - Math.Sin(theta)*z[2], Math.Sin(theta)*y[2] + Math.Cos(theta)*z[2]); et.SetXConfiguration(xconf); //(UpperLeft, UpperRight, LowerLeft); }
void ITracker.SetXConfig(XConfSettings settings, double angle) { aspectRatio = settings.Height / settings.Width; dx = settings.Dx; dy = settings.Dy; }