internal void Calc_dynamics(int lr, AirPlane ap, Vector3D dv) { fv.SetVec(0.0D, 0.0D, 0.0D); tv.SetVec(0.0D, 0.0D, 0.0D); if (flag == 0) { return; } ac = AirPlane.Get_point(ac_base, lr).Sub(ap.inp.cg); vd = Dynamics.VWithRot(ap.pMotion.vc, ap.pMotion.omega, ac); vd = vd.Add(dv); v = vd.Length(); q = (0.5D * v * v * ap.atmos.rho); Bearing3 br = new Bearing3(ap.pMotion.vc.R2l()); angle = br.pitch.GetValue(); sfus = (s_pi * Math.Cos(angle) + s_side * Math.Sin(angle)); d = (q * cd_s / s_pi * sfus); du = vd.SclProd(-1.0D).NmlVec(); fv = du.SclProd(d); mfus = (q * vfus * Math.Sin(-2.0D * angle)); tv.SetVec(0.0D, mfus, 0.0D); Matrix44 mat = new Matrix44(); mat.SetRxMat(-br.roll.GetValue()); tv = tv.MultMat(mat); }
public void DrawPadLock(Graphics g, AirPlane ap) { double r = 110.0D; double l = 20.0D; //g.SetColor(padLockColor); // g.SetFont(padFont); PadlockObject pobj = ap.pilot.pObjList.PadlockObj(ap); if (pobj != null) { Vector3D vec = pobj.RPosPilotView(ap); Vector3D vec2 = clip.Vs_point_clip_3df(vec); if (vec2 != null) { vec2 = proj.Project(vec2); vec2 = clip.Vs_point_clip2d(vec2); } if (vec2 != null) { int x0 = (int)(vec2.x + 0.5D); int y0 = (int)(vec2.y + 0.5D); g.DrawRectangle(new Pen(padLockColor), x0 - 10, y0 - 10, 1, 1); //g.DrawRect(x0 + 8, y0 - 10, 1, 1); //g.DrawRect(x0 + 8, y0 + 8, 1, 1); //g.DrawRect(x0 - 10, y0 + 8, 1, 1); //g.DrawString(pobj.name, x0 + 12, y0 + 9); } else { Bearing3 be3 = pobj.Bearing2PilotView(ap); double sinr = -System.Math.Sin(be3.roll.GetValue()); double cosr = -System.Math.Cos(be3.roll.GetValue()); double w = l * System.Math.Sin(be3.pitch.GetValue() / 2.0D); double h = l * System.Math.Cos(be3.pitch.GetValue() / 2.0D); int x0_0 = 300 + (int)(r * sinr); int y0_1 = 200 + (int)(r * cosr); int x1 = 300 + (int)((r + l) * sinr); int y1 = 200 + (int)((r + l) * cosr); Jp.Maker1.Util.Symbol.DrawArrow(g, x0_0, y0_1, x1, y1, (int)h, (int)w); //g.DrawString(pobj.name, (x0_0 + x1) / 2 + (int)(l * 0.71D), (y0_1 + y1) / 2 + (int)(l * 0.71D)); g.DrawString(pobj.name, padFont, new SolidBrush(padLockColor), (x0_0 + x1) / 2 + (int)(l * 0.71D), (y0_1 + y1) / 2 + (int)(l * 0.71D)); } } }