19#ifndef HEADER_SOCCER_AI_HPP
20#define HEADER_SOCCER_AI_HPP
22#include "karts/controller/arena_ai.hpp"
24#include "LinearMath/btTransform.h"
28#include "graphics/irr_driver.hpp"
41 irr::scene::ISceneNode *m_red_sphere;
42 irr::scene::ISceneNode *m_blue_sphere;
78 virtual bool canSkid(
float steer_fraction) OVERRIDE
82 bool find_sta) OVERRIDE;
104 virtual void update (
int ticks) OVERRIDE;
105 virtual void reset() OVERRIDE;
An abstract interface for the actual karts.
Definition: abstract_kart.hpp:62
A base class for AI that use navmesh to work.
Definition: arena_ai.hpp:42
bool m_mini_skid
True if AI can skid, currently only do when close to target, see doSkiddingTest().
Definition: arena_ai.hpp:77
The actual soccer AI.
Definition: soccer_ai.hpp:37
virtual bool canSkid(float steer_fraction) OVERRIDE
Return true if AI can skid now.
Definition: soccer_ai.hpp:78
virtual float getKartDistance(const AbstractKart *kart) const OVERRIDE
Return the distance based on graph distance matrix to any kart.
Definition: soccer_ai.cpp:507
bool m_overtake_ball
Define which way to handle to ball, either steer with it, or overtake it (Defense).
Definition: soccer_ai.hpp:56
bool m_chasing_ball
True if AI should steer with the ball.
Definition: soccer_ai.hpp:62
float rotateSlope(float old_slope, bool rotate_up)
Used in determineOvertakePosition to adjust the overtake position which is calculated by slope of lin...
Definition: soccer_ai.cpp:476
virtual bool forceBraking() OVERRIDE
If true, AI will always try to brake for this frame.
Definition: soccer_ai.hpp:86
bool determineOvertakePosition(const Vec3 &ball_lc, const Vec3 &aim_lc, Vec3 *overtake_lc)
Used in determineBallAimingPosition to pick a correct point to overtake the ball.
Definition: soccer_ai.cpp:334
virtual bool isKartOnRoad() const OVERRIDE
If true, AI stays on the ArenaNode correctly, otherwise RescueAnimation will be done after sometime.
Definition: soccer_ai.cpp:514
virtual bool isWaiting() const OVERRIDE
If true, AI will stop moving.
Definition: soccer_ai.cpp:501
virtual int getCurrentNode() const OVERRIDE
Return the current ArenaNode the AI located on.
Definition: soccer_ai.cpp:495
virtual void reset() OVERRIDE
Resets the AI when a race is restarted.
Definition: soccer_ai.cpp:92
virtual bool ignorePathFinding() OVERRIDE
If true, AI will drive directly to target without path finding.
Definition: soccer_ai.hpp:92
bool m_force_brake
True if forceBraking() is needed to be called.
Definition: soccer_ai.hpp:59
virtual void findClosestKart(bool consider_difficulty, bool find_sta) OVERRIDE
Find the closest kart around this AI, it won't find the kart with same team, consider_difficulty and ...
Definition: soccer_ai.cpp:141
virtual void resetAfterStop() OVERRIDE
Overridden if any action is needed to be done when AI stopped moving or changed driving direction.
Definition: soccer_ai.hpp:99
KartTeam m_opp_team
Save the opposite team of this AI team.
Definition: soccer_ai.hpp:52
virtual void findTarget() OVERRIDE
Find a suitable target to follow, it will first call SoccerWorld::getBallChaser to check if this AI s...
Definition: soccer_ai.cpp:182
bool isOvertakable(const Vec3 &ball_lc)
Used in determineBallAimingPosition to test if AI can overtake the ball by testing distance.
Definition: soccer_ai.cpp:305
btTransform m_front_transform
The front point of kart with the same rotation of center mass, used to determine point for aiming wit...
Definition: soccer_ai.hpp:66
KartTeam m_cur_team
Save the team this AI belongs to.
Definition: soccer_ai.hpp:49
virtual void update(int ticks) OVERRIDE
Update m_front_transform for ball aiming functions, also make AI stop after goal.
Definition: soccer_ai.cpp:110
SoccerWorld * m_world
Keep a pointer to world.
Definition: soccer_ai.hpp:46
Vec3 determineBallAimingPosition()
Determine the point for aiming when try to steer or overtake the ball.
Definition: soccer_ai.cpp:225
An implementation of WorldWithRank, to provide the soccer game mode Notice: In soccer world,...
Definition: soccer_world.hpp:40
A wrapper around bullets btVector3 to include conventient conversion functions (e....
Definition: vec3.hpp:35