资源简介
robocup 2D中较强的yushan底层代码,虽说已经开源了,但是一些人可能找不到,分享分享
代码片段和文件信息
// -*-c++-*-
/*!
\file basic_actions.cpp
\brief basic player actions Source File
*/
/*
*Copyright:
Copyright (C) Hidehisa AKIYAMA
This code is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License or (at your option) any later version.
This library is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not write to the Free Software
Foundation Inc. 59 Temple Place Suite 330 Boston MA 02111-1307 USA
*EndCopyright:
*/
/////////////////////////////////////////////////////////////////////
#ifdef HAVE_CONFIG_H
#include
#endif
#include “basic_actions.h“
#include “bhv_scan_field.h“
#include “neck_scan_field.h“
#include “neck_scan_players.h“
#include yer/player_agent.h>
#include
#include
#include
//#define DEBUG
//#define DEBUG_NECK_TURN_TO_BALL
namespace rcsc {
/////////////////////////////////////////////////////////////////////
/*-------------------------------------------------------------------*/
/*!
*/
bool
Body_TurnToAngle::execute( PlayerAgent * agent )
{
dlog.addText( Logger::ACTION
__FILE__“: Body_TurnToAngle“ );
const Selfobject & self = agent->world().self();
if ( ! self.faceValid() )
{
agent->doTurn( 0.0 );
return false;
}
agent->doTurn( M_angle - self.body() );
return true;
}
/////////////////////////////////////////////////////////////////////
/*-------------------------------------------------------------------*/
/*!
*/
bool
Body_TurnToPoint::execute( PlayerAgent * agent )
{
dlog.addText( Logger::ACTION
__FILE__“: Body_TurnToPoint“ );
const Selfobject & self = agent->world().self();
if ( ! self.posValid() )
{
return agent->doTurn( 60.0 );
}
// relative angle from my predicted pos & body angle to point
Vector2D my_point = self.inertiaPoint( M_cycle );
AngleDeg target_rel_angle
= ( M_point - my_point ).th() - self.body();
// not consider about max effective turn (inertia moment)
// try to face to point greedy
agent->doTurn( target_rel_angle );
if ( target_rel_angle.abs() < 1.0 )
{
return false;
}
return true;
}
/////////////////////////////////////////////////////////////////////
/*-------------------------------------------------------------------*/
/*!
*/
bool
Body_TurnToBall::execute( PlayerAgent * agent )
{
dlog.addText( Logger::ACTION
__FILE__“: Body_TurnToBall“ );
if ( ! agent->world().ba
相关资源
- Box2D篮球小游戏
- 论文研究-面向2D虚拟试穿的服装推理
- 基于cocos2d-x的2187小游戏
- CA_CFAR_2D.rar
- qt opengl 2d纹理到球面
- 基于cocos2d-x 3.8 开发的 愤怒的小鸟d
- AK1052D AllInOne蓝牙模块 安凯蓝牙模块
- Victoriandemo 横板过关游戏 跑酷 cocos
- 2D游戏素材中人物的4方位行走图
- cocos2dx 3.2 2048游戏可执行源码
- 电摩500W直流无刷电机 ANSOFT 2D 仿真设
- a1acf4e820b492d7f9d7c47636ddf3c5.txt
- RoboCup机器人比赛资料
- b7bc79d087b2d734fb41e951f0b7454e.rar
- cocos2dx +lua 斜45度A星寻路算法
- lis2ds12驱动代码260499
- 51单片机PID控制含DAC0832DA转换程序完全
- GB2ShapeCache-x 对应cocos2dx 3.x版本创建接
- STM32 STM32F103C8T6 CAN从机+4DI2DO 硬件设计
- cocos2d-x 滚动字幕和公告
- robocup世界冠军代码
- cocos2dx-3.17 坦克大战游戏 lua代码和资
- D2d通信模拟代码
- cocos2dx v2.2.6 超级玛丽源代码
- e22ca2d2753819c5f0d9ad7021ec88d3.rar
- CASIA-WEBFACE数据集
- unity模拟流动的水的液体物理效果
- cocos2dx模仿人要慌绳子的物理小demo
- dx9_2d_demo_game directx9实现2D游戏例程
- QT闹钟alarm
评论
共有 条评论