Example #1
0
 /// <summary>
 /// Update the Oriented Points
 /// </summary>
 public void UpdateOPs(StreetComponent _comp = null)
 {
     OPs = new OrientedPoint[segments + 1];
     for (int i = 0; i <= segments; i++)
     {
         float t = 1.0f / segments * i;
         OPs[i] = new OrientedPoint(GetPositionAt(t), GetOrientationUp(t), t);
     }
     if (_comp != null && _comp is Street)
     {
         Street s = (Street)_comp;
         if (s != null && s.ID > 0)
         {
             s.ClearSegmentsCorner();
             for (int i = 0; i < OPs.Length; i++)
             {
                 s.AddSegmentsCorner(OPs[i].Position + GetNormalAt(OPs[i].t));
                 s.AddSegmentsCorner(OPs[i].Position - GetNormalAt(OPs[i].t));
             }
         }
     }
 }