Rigs of Rods 2023.09
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
RaceSystem.h
Go to the documentation of this file.
1/*
2 This source file is part of Rigs of Rods
3 Copyright 2005-2012 Pierre-Michel Ricordel
4 Copyright 2007-2012 Thomas Fischer
5 Copyright 2015-2020 Petr Ohlidal
6
7 For more information, see http://www.rigsofrods.org/
8
9 Rigs of Rods is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License version 3, as
11 published by the Free Software Foundation.
12
13 Rigs of Rods is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#pragma once
23
26
27#include <Ogre.h>
28
29namespace RoR {
30
32{
33public:
34 void StartRaceTimer(int id);
35 void StopRaceTimer();
36 bool IsRaceInProgress() const { return m_race_id != -1; }
37 int GetRaceId() const { return m_race_id; }
38 float GetRaceTime() const;
39 void ResetRaceUI();
40
41 void SetRaceTimeDiff(float diff) { m_race_time_diff = diff; };
42 float GetRaceTimeDiff() const { return m_race_time_diff; };
43
44 void SetRaceBestTime(float time) { m_race_best_time = time; };
45 float GetRaceBestTime() const { return m_race_best_time; };
46
47 void UpdateDirectionArrow(char* text, Ogre::Vector3 position);
48 Ogre::Vector3 GetDirArrowTarget() { return m_dir_arrow_target; }
49 std::string const& GetDirArrowText() const { return m_dir_arrow_text; }
50 bool IsDirArrowVisible() const { return m_dir_arrow_visible; }
51
52private:
53 bool m_dir_arrow_visible = false;
54 std::string m_dir_arrow_text;
55 Ogre::Vector3 m_dir_arrow_target = Ogre::Vector3::ZERO;
56
57 int m_race_id = -1;
58 float m_race_time_diff = 0.f;
59 float m_race_best_time = 0.f;
60 float m_race_start_time = 0.f;
61};
62
63} // namespace RoR
float GetRaceTime() const
bool m_dir_arrow_visible
Definition RaceSystem.h:53
float m_race_best_time
Definition RaceSystem.h:59
float m_race_start_time
Definition RaceSystem.h:60
Ogre::Vector3 m_dir_arrow_target
Definition RaceSystem.h:55
std::string const & GetDirArrowText() const
Definition RaceSystem.h:49
Ogre::Vector3 GetDirArrowTarget()
Definition RaceSystem.h:48
int GetRaceId() const
Definition RaceSystem.h:37
void UpdateDirectionArrow(char *text, Ogre::Vector3 position)
void SetRaceBestTime(float time)
Definition RaceSystem.h:44
float GetRaceTimeDiff() const
Definition RaceSystem.h:42
void StartRaceTimer(int id)
bool IsRaceInProgress() const
Definition RaceSystem.h:36
float GetRaceBestTime() const
Definition RaceSystem.h:45
float m_race_time_diff
Definition RaceSystem.h:58
std::string m_dir_arrow_text
Definition RaceSystem.h:54
void SetRaceTimeDiff(float diff)
Definition RaceSystem.h:41
bool IsDirArrowVisible() const
Definition RaceSystem.h:50