body_kick_two_step.h

説明を見る。
00001 // -*-c++-*-
00002 
00009 /*
00010  *Copyright:
00011 
00012  Copyright (C) Hidehisa AKIYAMA
00013 
00014  This code is free software; you can redistribute it and/or
00015  modify it under the terms of the GNU Lesser General Public
00016  License as published by the Free Software Foundation; either
00017  version 2.1 of the License, or (at your option) any later version.
00018 
00019  This library is distributed in the hope that it will be useful,
00020  but WITHOUT ANY WARRANTY; without even the implied warranty of
00021  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00022  Lesser General Public License for more details.
00023 
00024  You should have received a copy of the GNU Lesser General Public
00025  License along with this library; if not, write to the Free Software
00026  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00027 
00028  *EndCopyright:
00029  */
00030 
00032 
00033 #ifndef RCSC_ACTION_BODY_KICK_TWO_STEP_H
00034 #define RCSC_ACTION_BODY_KICK_TWO_STEP_H
00035 
00036 #include <rcsc/player/soccer_action.h>
00037 #include <rcsc/geom/vector_2d.h>
00038 
00039 namespace rcsc {
00040 
00049 class Body_KickTwoStep
00050     : public BodyAction {
00051 public:
00052 
00057     struct SubTarget {
00058         Vector2D ball_pos_; 
00059         Vector2D ball_vel_; 
00060         double opp_dist2_; 
00061 
00068         SubTarget( const Vector2D & ball_pos,
00069                    const Vector2D & ball_vel,
00070                    const double & opp_dist2 )
00071             : ball_pos_( ball_pos )
00072             , ball_vel_( ball_vel )
00073             , opp_dist2_( opp_dist2 )
00074           { }
00075     };
00076 
00078     static const double DEFAULT_MIN_DIST2;
00079 
00080 private:
00082     const Vector2D M_target_point;
00084     double M_first_speed;
00086     const bool M_enforce_kick;
00087 
00089     Vector2D M_ball_result_pos;
00091     Vector2D M_ball_result_vel;
00093     int M_kick_step;
00094 public:
00101     Body_KickTwoStep( const Vector2D & target_point,
00102                       const double & first_speed,
00103                       const bool enforce = false )
00104         : M_target_point( target_point )
00105         , M_first_speed( first_speed )
00106         , M_enforce_kick( enforce )
00107         , M_ball_result_pos( Vector2D::INVALIDATED )
00108         , M_ball_result_vel( Vector2D::INVALIDATED )
00109         , M_kick_step( 0 )
00110       { }
00111 
00117     bool execute( PlayerAgent * agent );
00118 
00119 
00124     const
00125     Vector2D & ballResultPos() const
00126       {
00127           return M_ball_result_pos;
00128       }
00129 
00134     const
00135     Vector2D & ballResultVel() const
00136       {
00137           return M_ball_result_vel;
00138       }
00139 
00144     int kickStep() const
00145       {
00146           return M_kick_step;
00147       }
00148 
00149 
00157     static
00158     bool is_opp_kickable( const PlayerAgent * agent,
00159                           const Vector2D & rel_pos,
00160                           double * min_dist2 );
00161 
00178     static
00179     bool simulate_one_kick( Vector2D * achieved_vel,
00180                             double * kick_power,
00181                             double * opp_dist2,
00182                             const Vector2D & target_rpos,
00183                             const double & first_speed,
00184                             const Vector2D & my_rpos,
00185                             const Vector2D & my_vel,
00186                             const AngleDeg & my_body,
00187                             const Vector2D & ball_rpos,
00188                             const Vector2D & ball_vel,
00189                             const PlayerAgent * agent,
00190                             const bool enforce );
00191 
00208     static
00209     bool simulate_two_kick( Vector2D * achieved_vel,
00210                             Vector2D * next_vel,
00211                             const Vector2D & target_rpos,
00212                             const double & first_speed,
00213                             const Vector2D & my_rpos,
00214                             const Vector2D & my_vel,
00215                             const AngleDeg & my_body,
00216                             const Vector2D & ball_rpos,
00217                             const Vector2D & ball_vel,
00218                             const PlayerAgent * agent,
00219                             const bool enforce );
00220 };
00221 
00222 }
00223 
00224 #endif

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