コード例 #1
0
        private void DrawLines(Part draw, WingStats wing, Color color, bool drawTransform = true)
        {
            Vector3 leadRoot  = draw.transform.position + draw.transform.TransformDirection(wing.rootMidChordOffset + Vector3.up * wing.rootChordLength / 2);
            Vector3 trailRoot = draw.transform.position + draw.transform.TransformDirection(wing.rootMidChordOffset - Vector3.up * wing.rootChordLength / 2);

            Vector3 leadTip  = draw.transform.position + draw.transform.TransformDirection(wing.tipMidChordOffset + Vector3.up * wing.tipChordLength / 2);
            Vector3 trailTip = draw.transform.position + draw.transform.TransformDirection(wing.tipMidChordOffset - Vector3.up * wing.tipChordLength / 2);

            DrawTools.DrawLine(leadRoot, trailRoot, color);
            DrawTools.DrawLine(leadTip, trailTip, color);
            if (drawTransform)
            {
                DrawTools.DrawTransform(draw.transform, 0.25f);
            }
        }
コード例 #2
0
 public void OnRenderObject()
 {
     if (currentPart && window)
     {
         DrawLines(currentPart, main, Color.magenta);
         if (controlSurface)
         {
             DrawLines(currentPart, srf, Color.cyan, false);
         }
         if (showHits)
         {
             DrawTools.DrawPoint(debugRootLeadHit, Color.red);
             DrawTools.DrawPoint(debugRootTrailHit, Color.blue);
             DrawTools.DrawPoint(debugTipLeadHit, Color.green);
             DrawTools.DrawPoint(debugTipTrailHit, Color.cyan);
         }
     }
 }