public void Conrolled(CNTRL_ID CID, bool inc) { switch (CID.ID) { case 1: float ksin = ksi + (inc ? -1 : 1); if (ksin >= 20 && ksin <= 90) { ksi = ksin; } break; case 2: float ns = s + (inc ? 0.01f : -0.01f); if (ns >= 0 && ns <= 0.7f) { s = ns; } break; case 3: bt += inc ? 1 : -1; break; case 4: al += inc ? 1 : -1; break; case 5: sc += inc ? 0.01f : -0.01f; break; } }
public void Conrolled(CNTRL_ID CID, bool inc) { switch (CID.ID) { case 1: gm += inc? 1 : -1; om += inc? 1 : -1; break; case 2: float ds = inc ? 0.01f : -0.01f; if (s + ds >= 0.3f && s + ds <= maxs) { s += ds; om = (float)(Math.Acos((a * a + s * s - b * b) / (2 * a * s)) * 180 / Math.PI) + gm; } break; case 3: bt += inc ? 1 : -1; break; case 4: al += inc ? 1 : -1; break; case 5: sc += inc ? 0.01f : -0.01f; break; } }
private void Form1_KeyDown(object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.A: RC.Conrolled(CNTRL_ID.GetFirstId(), true); break; case Keys.D: RC.Conrolled(CNTRL_ID.GetFirstId(), false); break; case Keys.W: RC.Conrolled(CNTRL_ID.GetSecondId(), true); break; case Keys.S: RC.Conrolled(CNTRL_ID.GetSecondId(), false); break; case Keys.Q: RC.Conrolled(CNTRL_ID.GetThirdId(), true); break; case Keys.E: RC.Conrolled(CNTRL_ID.GetThirdId(), false); break; case Keys.NumPad2: RC.Conrolled(CNTRL_ID.GetFourthId(), true); break; case Keys.NumPad8: RC.Conrolled(CNTRL_ID.GetFourthId(), false); break; case Keys.Add: RC.Conrolled(CNTRL_ID.GetFifthId(), true); break; case Keys.Subtract: RC.Conrolled(CNTRL_ID.GetFifthId(), false); break; } }