interception.h

説明を見る。
00001 // -*-c++-*-
00002 
00008 /*
00009  *Copyright:
00010 
00011  Copyright (C) Hidehisa AKIYAMA
00012 
00013  This code is free software; you can redistribute it and/or
00014  modify it under the terms of the GNU Lesser General Public
00015  License as published by the Free Software Foundation; either
00016  version 2.1 of the License, or (at your option) any later version.
00017 
00018  This library is distributed in the hope that it will be useful,
00019  but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00021  Lesser General Public License for more details.
00022 
00023  You should have received a copy of the GNU Lesser General Public
00024  License along with this library; if not, write to the Free Software
00025  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00026 
00027  *EndCopyright:
00028  */
00029 
00031 
00032 #ifndef RCSC_PLAYER_INTERCEPTION_H
00033 #define RCSC_PLAYER_INTERCEPTION_H
00034 
00035 #include <rcsc/common/player_type.h>
00036 #include <rcsc/geom/vector_2d.h>
00037 
00038 namespace rcsc {
00039 
00044 class Interception {
00045 public:
00046     static const double NEVER_CYCLE;
00047 
00048 private:
00050     const Vector2D M_ball_first_pos;
00052     const double M_ball_first_speed;
00054     const AngleDeg M_ball_vel_angle;
00055 
00057     const double M_ball_x_constant;
00059     const double M_ball_x_d_constant;
00060 
00061 public:
00062 
00063     /*
00064       \brief create with ball info
00065       \param ball_pos ball first poitiion
00066       \param ball_first_speed ball first speed
00067       \param ball_vel_angle ball velocity direction
00068 
00069       When we use this utility in pass route evaluation,
00070       next cycle info should be set to ball_pos and ball_vel.
00071     */
00072     Interception( const Vector2D & ball_pos,
00073                   const double & ball_first_speed,
00074                   const AngleDeg & ball_vel_angle );
00075 
00076     /*
00077       \brief create with ball info
00078       \param ball_pos ball first poitiion
00079       \param ball_vel ball first velocity
00080 
00081       When we use this utility in pass route evaluation,
00082       next cycle info should be set to ball_pos and ball_vel.
00083     */
00084     Interception( const Vector2D & ball_pos,
00085                   const Vector2D & ball_vel );
00086 
00100     double getReachCycle( const Vector2D & player_pos,
00101                           const Vector2D * player_vel,
00102                           const AngleDeg * player_angle,
00103                           const int player_count,
00104                           const double & control_buf,
00105                           const double & player_max_speed ) const;
00106 
00119     double getReachCycleGreedly( const Vector2D & player_pos,
00120                                  const Vector2D * player_vel, // if unknown, NULL
00121                                  const AngleDeg * player_angle, // if unknown, NULL
00122                                  const int player_count,
00123                                  const double & control_buf,
00124                                  const double & player_max_speed ) const; // if unknown, NULL
00125 
00126 };
00127 
00128 }
00129 
00130 #endif

librcscに対してThu May 1 15:41:21 2008に生成されました。  doxygen 1.5.0