SuperTuxKart
check_lap.hpp
1 //
2 // SuperTuxKart - a fun racing game with go-kart
3 // Copyright (C) 2010-2015 Joerg Henrichs
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 3
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 
19 #ifndef HEADER_CHECK_LAP_HPP
20 #define HEADER_CHECK_LAP_HPP
21 
22 #include "tracks/check_structure.hpp"
23 #include "utils/cpp2011.hpp"
24 
25 class XMLNode;
26 class CheckManager;
27 
34 class CheckLap : public CheckStructure
35 {
36 private:
38  std::vector<float> m_previous_distance;
39 
40 public:
41  CheckLap(const XMLNode &node, unsigned int index);
42  virtual ~CheckLap() {};
43  virtual bool isTriggered(const Vec3 &old_pos, const Vec3 &new_pos,
44  int indx) OVERRIDE;
45  virtual void reset(const Track &track) OVERRIDE;
46  virtual bool triggeringCheckline() const OVERRIDE { return true; }
47 }; // CheckLine
48 
49 #endif
50 
Implements a simple lap test.
Definition: check_lap.hpp:34
A wrapper around bullets btVector3 to include conventient conversion functions (e....
Definition: vec3.hpp:34
CheckLap(const XMLNode &node, unsigned int index)
Constructor for a lap line.
Definition: check_lap.cpp:35
Controls all checks structures of a track.
Definition: check_manager.hpp:39
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_lap.cpp:61
virtual void reset(const Track &track) OVERRIDE
Initialises the 'previous positions' of all karts with the start position defined for this track.
Definition: check_lap.cpp:44
utility class used to parse XML files
Definition: xml_node.hpp:47
Virtual base class for a check structure.
Definition: check_structure.hpp:51
std::vector< float > m_previous_distance
Store the previous distance along track.
Definition: check_lap.hpp:38
Definition: track.hpp:96