示例#1
0
void SplineTrack::bounding_polygon(Polygon& poly) const
{
   const float step = 0.01f;
   const float fudge = 0.8f;

   for (float t = 0.0f; t <= 1.0f; t += step) {
      Vector<float> v = curve.offset(t, fudge);
      poly.push_back(make_point(v.x, v.z));
   }

   for (float t = 1.0f; t >= 0.0f; t -= step) {
      Vector<float> v = curve.offset(t, -fudge);
      poly.push_back(make_point(v.x, v.z));
   }
}