bool GuideRibbonEllipse::transform(const D3DXMATRIX& mat)
{
   if (! GuideRibbon::transform(mat)) { return false; }

   calcParameters();
   return true;
}
bool GuideRibbonEllipse::replace(size_t idx, const D3DXVECTOR3& v)
{
   if (! GuideRibbon::replace(idx, v)) { return false; }

   switch (idx) {
      case JOINT_CENTER:
         calcParameters();
         return true;

      case JOINT_RADIUS:
         _rx = _edit_points[idx].x - _x;
         _ry = _edit_points[idx].y - _y;
         calcPlayPoints();
         return true;

      case JOINT_BEGIN: //atan2 returnes -PI..PI
         _arg0 = atan2(_edit_points[idx].y-_y, _edit_points[idx].x-_x);
         calcPlayPoints();
         return true;

      case JOINT_END:
         _arg1 = atan2(_edit_points[idx].y-_y, _edit_points[idx].x-_x);
         calcPlayPoints();
         return true;

      case JOINT_DIRECTION:
         {
            float a = atan2(_edit_points[idx].y-_y, _edit_points[idx].x-_x);
            if (_arg0 <= a) {
               _dir = (a < (_arg0 + FLOAT_PI));
            } else {
               _dir = (a < (_arg0 - FLOAT_PI));
            }
            calcPlayPoints();
         }
         return true;
   }
   return false;
}
Beispiel #3
0
RAINPARAMETERS::RAINPARAMETERS (int MAP, float dDMR)
{
  calcParameters (MAP, dDMR);
}