RigsofRods
Soft-body Physics Simulation
RaceSystem.cpp
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 
23 
24 #include "RaceSystem.h"
25 
26 #include "AppContext.h"
27 #include "GameContext.h"
28 
29 using namespace RoR;
30 
31 void RaceSystem::UpdateDirectionArrow(char* text, Ogre::Vector3 position)
32 {
33  if (text == nullptr)
34  {
35  m_dir_arrow_visible = false;
36  m_dir_arrow_target = Ogre::Vector3::ZERO;
37  }
38  else
39  {
40  m_dir_arrow_visible = true;
41  m_dir_arrow_text = text;
42  m_dir_arrow_target = position;
43  }
44 }
45 
47 {
49  m_race_time_diff = 0.0f;
50  m_race_id = id;
51 }
52 
54 {
55  m_race_start_time = 0.0f;
56  m_race_id = -1;
57 }
58 
60 {
62 }
GameContext.h
Game state manager and message-queue provider.
RaceSystem.h
Counterpart to Neorej16's race system script.
RoR::RaceSystem::UpdateDirectionArrow
void UpdateDirectionArrow(char *text, Ogre::Vector3 position)
Definition: RaceSystem.cpp:31
RoR::RaceSystem::m_dir_arrow_target
Ogre::Vector3 m_dir_arrow_target
Definition: RaceSystem.h:54
AppContext.h
System integration layer; inspired by OgreBites::ApplicationContext.
RoR::RaceSystem::GetRaceTime
float GetRaceTime() const
Definition: RaceSystem.cpp:59
RoR::RaceSystem::m_race_start_time
float m_race_start_time
Definition: RaceSystem.h:59
RoR::ActorManager::GetTotalTime
float GetTotalTime() const
Definition: ActorManager.h:96
RoR::RaceSystem::m_dir_arrow_text
std::string m_dir_arrow_text
Definition: RaceSystem.h:53
RoR::RaceSystem::StopRaceTimer
void StopRaceTimer()
Definition: RaceSystem.cpp:53
RoR::RaceSystem::m_race_id
int m_race_id
Definition: RaceSystem.h:56
RoR::App::GetGameContext
GameContext * GetGameContext()
Definition: Application.cpp:280
RoR::RaceSystem::StartRaceTimer
void StartRaceTimer(int id)
Definition: RaceSystem.cpp:46
RoR::RaceSystem::m_race_time_diff
float m_race_time_diff
Definition: RaceSystem.h:57
RoR::RaceSystem::m_dir_arrow_visible
bool m_dir_arrow_visible
Definition: RaceSystem.h:52
RoR
Definition: AppContext.h:36
RoR::GameContext::GetActorManager
ActorManager * GetActorManager()
Definition: GameContext.h:127