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
SimData.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 2013-2023 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#include "SimData.h"
23
24#include "Actor.h"
25#include "CacheSystem.h"
26#include "TuneupFileFormat.h"
27
28using namespace RoR;
29
31{
32 // Constructs `CacheEntryPtr` - doesn't compile without `#include CacheSystem.h` - not pretty if in header (even if auto-generated by C++).
33 // Also `TuneupDefPtr` which needs `#include TuneupFileFormat.h`
34}
35
37{
38 // Destructs `CacheEntryPtr` - doesn't compile without `#include CacheSystem.h` - not pretty if in header (even if auto-generated by C++).
39 // Also `TuneupDefPtr` which needs `#include TuneupFileFormat.h`
40}
41
43{
44 // Constructs `ActorPtr` - doesn't compile without `#include Actor.h` - not pretty if in header (even if auto-generated by C++).
45}
46
48{
49 // Destructs `ActorPtr` - doesn't compile without `#include Actor.h` - not pretty if in header (even if auto-generated by C++).
50}
51
53{
54 // Constructs `ActorPtr` - doesn't compile without `#include Actor.h` - not pretty if in header (even if auto-generated by C++).
55}
56
58{
59 // Destructs `ActorPtr` - doesn't compile without `#include Actor.h` - not pretty if in header (even if auto-generated by C++).
60}
61
63{
64 // Constructs `ActorPtr` - doesn't compile without `#include Actor.h` - not pretty if in header (even if auto-generated by C++).
65
66 // Bitfields cannot be initialized in-class (C++ limitation).
67 ti_no_self_lock = false;
68 ti_tied = false;
69 ti_tying = false;
70}
71
73{
74 // Destructs `ActorPtr` - doesn't compile without `#include Actor.h` - not pretty if in header (even if auto-generated by C++).
75}
76
78{
79 // Constructs `ActorPtr` - doesn't compile without `#include Actor.h` - not pretty if in header (even if auto-generated by C++).
80}
81
83{
84 // Destructs `ActorPtr` - doesn't compile without `#include Actor.h` - not pretty if in header (even if auto-generated by C++).
85}
86
88{
89 // Constructs `ActorPtr` - doesn't compile without `#include Actor.h` - not pretty if in header (even if auto-generated by C++).
90}
91
93{
94 // Destructs `ActorPtr` - doesn't compile without `#include Actor.h` - not pretty if in header (even if auto-generated by C++).
95}
96
98{
99 // Constructs `CacheEntryPtr` which is a `RefCountingObjectPtr<>` so it doesn't compile without `#include "TuneupFileFormat.h"` and thus should not be in header.
100}
101
103{
104 // Destructs `CacheEntryPtr` which is a `RefCountingObjectPtr<>` so it doesn't compile without `#include "TuneupFileFormat.h"` and thus should not be in header.
105}
106
108{
109 switch (attr)
110 {
111 case ACTORSIMATTR_NONE: return "NONE";
112
113 // TractionControl
114 case ACTORSIMATTR_TC_RATIO: return "TC_RATIO";
115 case ACTORSIMATTR_TC_PULSE_TIME: return "TC_PULSE_TIME";
116 case ACTORSIMATTR_TC_WHEELSLIP_CONSTANT: return "TC_WHEELSLIP_CONSTANT";
117
118 // Engine
119 case ACTORSIMATTR_ENGINE_SHIFTDOWN_RPM: return "ENGINE_SHIFTDOWN_RPM";
120 case ACTORSIMATTR_ENGINE_SHIFTUP_RPM: return "ENGINE_SHIFTUP_RPM";
121 case ACTORSIMATTR_ENGINE_TORQUE: return "ENGINE_TORQUE";
122 case ACTORSIMATTR_ENGINE_DIFF_RATIO: return "ENGINE_DIFF_RATIO";
123 case ACTORSIMATTR_ENGINE_GEAR_RATIOS_ARRAY: return "ENGINE_GEAR_RATIOS_ARRAY";
124
125 // Engoption
126 case ACTORSIMATTR_ENGOPTION_ENGINE_INERTIA: return "ENGOPTION_ENGINE_INERTIA";
127 case ACTORSIMATTR_ENGOPTION_ENGINE_TYPE: return "ENGOPTION_ENGINE_TYPE";
128 case ACTORSIMATTR_ENGOPTION_CLUTCH_FORCE: return "ENGOPTION_CLUTCH_FORCE";
129 case ACTORSIMATTR_ENGOPTION_SHIFT_TIME: return "ENGOPTION_SHIFT_TIME";
130 case ACTORSIMATTR_ENGOPTION_CLUTCH_TIME: return "ENGOPTION_CLUTCH_TIME";
131 case ACTORSIMATTR_ENGOPTION_POST_SHIFT_TIME: return "ENGOPTION_POST_SHIFT_TIME";
132 case ACTORSIMATTR_ENGOPTION_STALL_RPM: return "ENGOPTION_STALL_RPM";
133 case ACTORSIMATTR_ENGOPTION_IDLE_RPM: return "ENGOPTION_IDLE_RPM";
134 case ACTORSIMATTR_ENGOPTION_MAX_IDLE_MIXTURE: return "ENGOPTION_MAX_IDLE_MIXTURE";
135 case ACTORSIMATTR_ENGOPTION_MIN_IDLE_MIXTURE: return "ENGOPTION_MIN_IDLE_MIXTURE";
136 case ACTORSIMATTR_ENGOPTION_BRAKING_TORQUE: return "ENGOPTION_BRAKING_TORQUE";
137
138 // Engturbo2 (actually 'engturbo' with type=2)
139 case ACTORSIMATTR_ENGTURBO2_INERTIA_FACTOR: return "ENGTURBO2_INERTIA_FACTOR";
140 case ACTORSIMATTR_ENGTURBO2_NUM_TURBOS: return "ENGTURBO2_NUM_TURBOS";
141 case ACTORSIMATTR_ENGTURBO2_MAX_RPM: return "ENGTURBO2_MAX_RPM";
142 case ACTORSIMATTR_ENGTURBO2_ENGINE_RPM_OP: return "ENGTURBO2_ENGINE_RPM_OP";
143 case ACTORSIMATTR_ENGTURBO2_BOV_ENABLED: return "ENGTURBO2_BOV_ENABLED";
144 case ACTORSIMATTR_ENGTURBO2_BOV_MIN_PSI: return "ENGTURBO2_BOV_MIN_PSI";
145 case ACTORSIMATTR_ENGTURBO2_WASTEGATE_ENABLED: return "ENGTURBO2_WASTEGATE_ENABLED";
146 case ACTORSIMATTR_ENGTURBO2_WASTEGATE_MAX_PSI: return "ENGTURBO2_WASTEGATE_MAX_PSI";
147 case ACTORSIMATTR_ENGTURBO2_WASTEGATE_THRESHOLD_N: return "ENGTURBO2_WASTEGATE_THRESHOLD_N";
148 case ACTORSIMATTR_ENGTURBO2_WASTEGATE_THRESHOLD_P: return "ENGTURBO2_WASTEGATE_THRESHOLD_P";
149 case ACTORSIMATTR_ENGTURBO2_ANTILAG_ENABLED: return "ENGTURBO2_ANTILAG_ENABLED";
150 case ACTORSIMATTR_ENGTURBO2_ANTILAG_CHANCE: return "ENGTURBO2_ANTILAG_CHANCE";
151 case ACTORSIMATTR_ENGTURBO2_ANTILAG_MIN_RPM: return "ENGTURBO2_ANTILAG_MIN_RPM";
152 case ACTORSIMATTR_ENGTURBO2_ANTILAG_POWER: return "ENGTURBO2_ANTILAG_POWER";
153
154 default: return "";
155 }
156}
A database of user-installed content alias 'mods' (vehicles, terrains...)
Core data structures for simulation; Everything affected by by either physics, network or user intera...
The vehicle tuning system; applies addonparts and user overrides to vehicles.
ActorSimAttr
Parameter to Actor::setSimAttribute() and Actor::getSimAttribute(); allows advanced users to tweak ph...
Definition SimData.h:925
@ ACTORSIMATTR_ENGOPTION_MIN_IDLE_MIXTURE
Min throttle to maintain idle RPM - Param #10 of 'engoption'.
Definition SimData.h:950
@ ACTORSIMATTR_ENGTURBO2_WASTEGATE_THRESHOLD_N
1 - WgThreshold ~ calculated from Param #10 of 'engturbo2'
Definition SimData.h:962
@ ACTORSIMATTR_ENGOPTION_BRAKING_TORQUE
How much engine brakes on zero throttle - Param #11 of 'engoption'.
Definition SimData.h:951
@ ACTORSIMATTR_ENGINE_TORQUE
Engine torque in newton-meters (N/m) - Param #3 of 'engine'.
Definition SimData.h:936
@ ACTORSIMATTR_ENGOPTION_CLUTCH_FORCE
Definition SimData.h:943
@ ACTORSIMATTR_ENGTURBO2_ANTILAG_CHANCE
Definition SimData.h:965
@ ACTORSIMATTR_ENGTURBO2_WASTEGATE_THRESHOLD_P
1 + WgThreshold ~ calculated from Param #10 of 'engturbo2'
Definition SimData.h:963
@ ACTORSIMATTR_ENGOPTION_CLUTCH_TIME
Definition SimData.h:945
@ ACTORSIMATTR_ENGTURBO2_WASTEGATE_MAX_PSI
Definition SimData.h:961
@ ACTORSIMATTR_ENGOPTION_ENGINE_TYPE
Definition SimData.h:942
@ ACTORSIMATTR_ENGTURBO2_WASTEGATE_ENABLED
Definition SimData.h:960
@ ACTORSIMATTR_ENGTURBO2_ANTILAG_POWER
Definition SimData.h:967
@ ACTORSIMATTR_ENGTURBO2_INERTIA_FACTOR
Time to spool up - Param #2 of 'engturbo2'.
Definition SimData.h:954
@ ACTORSIMATTR_ENGOPTION_POST_SHIFT_TIME
Time (in seconds) until full torque is transferred - Param #6 of 'engoption'.
Definition SimData.h:946
@ ACTORSIMATTR_ENGTURBO2_BOV_MIN_PSI
Blow-off valve PSI threshold - Param #7 of 'engturbo2'.
Definition SimData.h:959
@ ACTORSIMATTR_ENGINE_GEAR_RATIOS_ARRAY
Gearbox - Format: "<reverse_gear> <neutral_gear> <forward_gear 1> [<forward gear 2>]....
Definition SimData.h:938
@ ACTORSIMATTR_TC_PULSE_TIME
Pulse duration in seconds, safe values <0.00005 - 1>
Definition SimData.h:930
@ ACTORSIMATTR_ENGOPTION_STALL_RPM
RPM where engine stalls - Param #7 of 'engoption'.
Definition SimData.h:947
@ ACTORSIMATTR_ENGOPTION_MAX_IDLE_MIXTURE
Max throttle to maintain idle RPM - Param #9 of 'engoption'.
Definition SimData.h:949
@ ACTORSIMATTR_ENGTURBO2_NUM_TURBOS
Number of turbos - Param #3 of 'engturbo2'.
Definition SimData.h:955
@ ACTORSIMATTR_ENGOPTION_ENGINE_INERTIA
Definition SimData.h:941
@ ACTORSIMATTR_ENGTURBO2_ANTILAG_MIN_RPM
Definition SimData.h:966
@ ACTORSIMATTR_TC_WHEELSLIP_CONSTANT
Minimum wheel slip threshold, safe value = 0.25.
Definition SimData.h:931
@ ACTORSIMATTR_ENGTURBO2_MAX_RPM
MaxPSI * 10000 ~ calculated from Param #4 of 'engturbo2'.
Definition SimData.h:956
@ ACTORSIMATTR_ENGOPTION_IDLE_RPM
Target idle RPM - Param #8 of 'engoption'.
Definition SimData.h:948
@ ACTORSIMATTR_ENGTURBO2_ANTILAG_ENABLED
Definition SimData.h:964
@ ACTORSIMATTR_ENGINE_SHIFTUP_RPM
Automatic transmission - Param #2 of 'engine'.
Definition SimData.h:935
@ ACTORSIMATTR_ENGTURBO2_BOV_ENABLED
Blow-off valve - Param #6 of 'engturbo2'.
Definition SimData.h:958
@ ACTORSIMATTR_ENGTURBO2_ENGINE_RPM_OP
Engine RPM threshold for turbo to operate - Param #5 of 'engturbo2'.
Definition SimData.h:957
@ ACTORSIMATTR_ENGOPTION_SHIFT_TIME
Definition SimData.h:944
@ ACTORSIMATTR_NONE
Definition SimData.h:926
@ ACTORSIMATTR_TC_RATIO
Regulating force, safe values: <1 - 20>
Definition SimData.h:929
@ ACTORSIMATTR_ENGINE_SHIFTDOWN_RPM
Automatic transmission - Param #1 of 'engine'.
Definition SimData.h:934
@ ACTORSIMATTR_ENGINE_DIFF_RATIO
Differential ratio (aka global gear ratio) - Param #4 of 'engine'.
Definition SimData.h:937
const char * ActorSimAttrToString(ActorSimAttr attr)
Definition SimData.cpp:107
bool ti_tying
State.
Definition SimData.h:516
bool ti_no_self_lock
Attribute.
Definition SimData.h:514
bool ti_tied
State.
Definition SimData.h:515