19#ifndef HEADER_CHECK_GOAL_HPP
20#define HEADER_CHECK_GOAL_HPP
22#include "tracks/check_structure.hpp"
23#include "utils/cpp2011.hpp"
65 virtual void update(
float dt) OVERRIDE;
66 virtual void trigger(
unsigned int kart_index) OVERRIDE;
69 virtual void reset(
const Track &track) OVERRIDE;
76 return (point == POINT_LAST ? m_p3 :
77 (point == POINT_CENTER ? m_p2 :
m_p1));
Implements a simple checkline that will score a point when the soccer ball crosses it.
Definition: check_goal.hpp:38
Vec3 m_previous_ball_position
Previois ball position.
Definition: check_goal.hpp:49
virtual CheckStructure * clone() OVERRIDE
Clone to child process for server usage (atm no sound or scripting).
Definition: check_goal.hpp:80
virtual void reset(const Track &track) OVERRIDE
Initialises the 'previous positions' of all karts with the start position defined for this track.
Definition: check_goal.cpp:102
bool m_first_goal
Which team is this goal for?
Definition: check_goal.hpp:52
Vec3 m_p1
Used by AIs to test whether the ball is likely to goal.
Definition: check_goal.hpp:58
PointLocation
Used by AIs to test whether the ball is likely to goal.
Definition: check_goal.hpp:42
virtual void update(float dt) OVERRIDE
Checks the soccer balls to see if they crossed the line and trigger the goal accordingly.
Definition: check_goal.cpp:52
virtual void trigger(unsigned int kart_index) OVERRIDE
Called when the goal line is triggered.
Definition: check_goal.cpp:75
virtual bool isTriggered(const Vec3 &old_pos, const Vec3 &new_pos, int indx) OVERRIDE
True if going from old_pos to new_pos crosses this checkline.
Definition: check_goal.cpp:89
core::line2df m_line
The line that is tested for being crossed.
Definition: check_goal.hpp:55
Virtual base class for a check structure.
Definition: check_structure.hpp:52
Definition: track.hpp:114
A wrapper around bullets btVector3 to include conventient conversion functions (e....
Definition: vec3.hpp:35
utility class used to parse XML files
Definition: xml_node.hpp:48