⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 freemarkpos.cpp.svn-base

📁 一个巴西大学编写的2D仿真组足球机器人程序
💻 SVN-BASE
字号:
#include "FreeMarkPos.h"SoccerCommand FreeMarkPos::primaryAction(){   oponnent = WM->getClosestInSetTo( OBJECT_SET_OPPONENTS,WM->getAgentObjectType() );   distRelOpon = WM->getRelativeDistance( oponnent );   distRelBall = WM->getRelativeDistance( OBJECT_BALL );   if( distRelOpon < distRelBall )   {      posRelOpon = WM->getRelativePosition( oponnent );      posRelBall = WM->getRelativePosition( OBJECT_BALL );      aux = posRelBall.operator *(posRelOpon);      angulo = (acos(aux.modulo(aux)/(distRelBall*distRelOpon)))*180/3.14159;      if( angulo < 30 )      {         if( posRelOpon.modulo(posRelOpon) < 10 )         {            if(WM->getAgentGlobalPosition().getX() >  WM->getGlobalPosition(OBJECT_BALL).getX() + 10)            {               aux= WM->getAgentGlobalPosition();               aux=(posRelBall.operator *( 0.5 ).operator +((posRelBall.operator *( 0.5 )).normal(posRelBall))).operator - (aux);               return moveToPos( aux , PS->getPlayerWhenToTurnAngle() );            }         }      }//       else//       {//          if( WM->getAgentStamina().getStamina() > SS->getRecoverDecThr()*SS->getStaminaMax()+800 )//          {//             moveToPos( (WM->getBallPos() - WM->getAgentGlobalPosition())/20 + WM->getStrategicPosition(), PS->getPlayerWhenToTurnAngle() );//          }//       }   }}SoccerCommand FreeMarkPos::cuncurrentAction(){   return turnNeckToPoint( OBJECT_BALL , primarySoc );}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -