mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-02 13:06:46 +01:00
12c5bb35e7
The split of Driver.cpp, DynObj.cpp and Train.cpp took five helpers out of their anonymous namespaces. outside() is used in offtrack.cpp alone and goes back into its anonymous namespace. The four shared by the parts of a class go into a namespace of its module: vehicle_ai (brake_response_horizon, uphill_stopping_distance), vehicle_dynamic (seconds_since) and vehicle_cab (is_hold_coil_lever). The rename of mover to physics also hit comments where the word meant something else: "prime mover" and "move the master controller" are back.
84 lines
2.2 KiB
C++
84 lines
2.2 KiB
C++
/*
|
|
This Source Code Form is subject to the
|
|
terms of the Mozilla Public License, v.
|
|
2.0. If a copy of the MPL was not
|
|
distributed with this file, You can
|
|
obtain one at
|
|
http://mozilla.org/MPL/2.0/.
|
|
*/
|
|
/*
|
|
MaSzyna EU07 locomotive simulator
|
|
Copyright (C) 2001-2004 Marcin Wozniak, Maciej Czapkiewicz and others
|
|
|
|
*/
|
|
|
|
// the constants and helpers the files of the vehicles of the scenery share: only they include this header
|
|
|
|
#pragma once
|
|
|
|
#include "vehicle/DynObj.h"
|
|
#include "physics/vehicle.h"
|
|
#include "vehicle/lightsprogrammer.h"
|
|
#include "simulation/simulation.h"
|
|
#include "simulation/blackboxrecorder.h"
|
|
#include "rendering/lightarray.h"
|
|
#include "vehicle/Camera.h"
|
|
#include "vehicle/Train.h"
|
|
#include "vehicle/odometer.h"
|
|
#include "vehicle/pulleemode.h"
|
|
#include "vehicle/Driver.h"
|
|
#include <algorithm>
|
|
#include <chrono>
|
|
#include <cmath>
|
|
#include <format>
|
|
#include <random>
|
|
#include <iterator>
|
|
#include <numbers>
|
|
#include <optional>
|
|
#include <string_view>
|
|
#include <unordered_set>
|
|
#include <utility>
|
|
#include <vector>
|
|
#include "utilities/Globals.h"
|
|
#include "utilities/Timer.h"
|
|
#include "utilities/workerpool.h"
|
|
#include "utilities/Logs.h"
|
|
#include "utilities/glmHelpers.h"
|
|
#include "Console.h"
|
|
#include "world/Traction.h"
|
|
#include "audio/sound.h"
|
|
#include "model/MdlMngr.h"
|
|
#include "model/Model3d.h"
|
|
#include "vehicle/doorwings.h"
|
|
#include "rendering/renderer.h"
|
|
#include "editor/editorTerrainStreamer.hpp"
|
|
#include "application/uitranscripts.h"
|
|
#include "input/messaging.h"
|
|
#include "application/application.h"
|
|
#include "vehicle/Driver.h"
|
|
|
|
// Ra: taki zapis funkcjonuje lepiej, ale może nie jest optymalny
|
|
#define vWorldFront glm::vec3(0, 0, 1)
|
|
#define vWorldUp glm::vec3(0, 1, 0)
|
|
#define vWorldLeft glm::cross(vWorldUp, vWorldFront)
|
|
|
|
#define M_2PI 6.283185307179586476925286766559;
|
|
|
|
TSubModel *
|
|
GetSubmodelFromName( TModel3d * const Model, std::string const Name );
|
|
|
|
|
|
// the time spent off the track in a frame which makes it worth a warning [s]
|
|
constexpr double off_track_slow { 0.02 };
|
|
|
|
|
|
using off_track_clock = std::chrono::steady_clock;
|
|
|
|
// what the split parts of TDynamicObject share, kept out of the global namespace
|
|
namespace vehicle_dynamic {
|
|
|
|
double seconds_since( off_track_clock::time_point const Start );
|
|
|
|
} // namespace vehicle_dynamic
|
|
|