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.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
29using namespace RoR;
30
31void 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 {
41 m_dir_arrow_text = text;
42 m_dir_arrow_target = position;
43 }
44}
45
52
54{
55 m_race_start_time = 0.0f;
56 m_race_id = -1;
57}
58
63
65{
66 this->StopRaceTimer();
67 this->UpdateDirectionArrow(nullptr, Ogre::Vector3::ZERO); // hide arrow
68}
System integration layer; inspired by OgreBites::ApplicationContext.
Game state manager and message-queue provider.
Counterpart to Neorej16's race system script.
float GetTotalTime() const
ActorManager * GetActorManager()
float GetRaceTime() const
bool m_dir_arrow_visible
Definition RaceSystem.h:53
float m_race_start_time
Definition RaceSystem.h:60
Ogre::Vector3 m_dir_arrow_target
Definition RaceSystem.h:55
void UpdateDirectionArrow(char *text, Ogre::Vector3 position)
void StartRaceTimer(int id)
float m_race_time_diff
Definition RaceSystem.h:58
std::string m_dir_arrow_text
Definition RaceSystem.h:54
GameContext * GetGameContext()