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
RigDef_File.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-2021 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 RoR::WheelSide 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 RoR::WheelSide for more details.
17
18 You should have received a copy of the GNU General Public RoR::WheelSide
19 along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
20*/
21
25
26#include "RigDef_File.h"
27
28#include "Actor.h"
29#include "CacheSystem.h"
30#include "SimConstants.h"
31
32namespace RigDef
33{
34
35const char* ROOT_MODULE_NAME = "_Root_"; // Static
36
37/* -------------------------------------------------------------------------- */
38/* Sections */
39/* */
40/* This is the place to set defaults. */
41/* -------------------------------------------------------------------------- */
42
44 offset(Ogre::Vector3::ZERO),
45 width(0),
46 height(0),
47 max_inclination_angle(0),
48 texcoord_x1(0),
49 texcoord_x2(0),
50 texcoord_y1(0),
51 texcoord_y2(0),
52 lift_coefficient(1.f) // This is default
53{}
54
56 regulation_force(0),
57 min_speed(0),
58 pulse_per_sec(0),
59 attr_is_on(true),
60 attr_no_dashboard(false),
61 attr_no_toggle(false)
62{}
63
65tinertiaFactor(1),
66nturbos(1),
67param1(9999), //used for default values
68param2(9999),
69param3(9999),
70param4(9999),
71param5(9999),
72param6(9999),
73param7(9999),
74param8(9999),
75param9(9999),
76param10(9999),
77param11(9999)
78{}
79
81 autocalc(false),
82 approximate_width(0),
83 area_coefficient(1.f), // Default
84 airfoil_name("NACA0009.afl")
85{}
86
88 flag_self_lock (false),
89 flag_auto_lock (false),
90 flag_no_disable(false),
91 flag_no_rope (false),
92 flag_visible (false),
93 option_hook_range(HOOK_RANGE_DEFAULT),
94 option_speed_coef(1.0f),
95 option_max_force(HOOK_FORCE_DEFAULT),
96 option_hookgroup(-1),
97 option_lockgroup(NODE_LOCKGROUP_DEFAULT),
98 option_timer(HOOK_LOCK_TIMER_DEFAULT),
99 option_min_range_meters(0.f)
100{}
101
103 load_weight(-1.f),
104 friction(1),
105 volume(1),
106 surface(1),
107 options(0)
108{}
109
111 spring_in(0),
112 damp_in(0),
113 progress_factor_spring_in(0),
114 progress_factor_damp_in(0),
115 spring_out(0),
116 damp_out(0),
117 progress_factor_spring_out(0),
118 progress_factor_damp_out(0),
119 short_bound(0),
120 long_bound(0),
121 precompression(0),
122 options(0),
123 detacher_group(0)
124{}
125
127 spring_in(0),
128 damp_in(0),
129 damp_in_slow(0),
130 split_vel_in(0),
131 damp_in_fast(0),
132 spring_out(0),
133 damp_out(0),
134 damp_out_slow(0),
135 split_vel_out(0),
136 damp_out_fast(0),
137 short_bound(0),
138 long_bound(0),
139 precompression(0),
140 options(0),
141 detacher_group(0)
142{}
143
145 regulation_force(0),
146 wheel_slip(0),
147 fade_speed(0),
148 pulse_per_sec(0),
149 attr_is_on(false),
150 attr_no_dashboard(false),
151 attr_no_toggle(false)
152{}
153
154void Animation::AddMotorSource(unsigned int source, unsigned int motor)
155{
156 Animation::MotorSource motor_source;
157 motor_source.source = source;
158 motor_source.motor = motor;
159 this->motor_sources.push_back(motor_source);
160}
161
163{
164 switch (type)
165 {
166 case ManagedMaterialType::FLEXMESH_STANDARD: return "flexmesh_standard";
167 case ManagedMaterialType::FLEXMESH_TRANSPARENT: return "flexmesh_transparent";
168 case ManagedMaterialType::MESH_STANDARD: return "mesh_standard";
169 case ManagedMaterialType::MESH_TRANSPARENT: return "mesh_transparent";
170 default: return "";
171 }
172}
173
174Document::Module::Module(Ogre::String const & name):
175 name(name)
176{}
177
179 hide_in_chooser(false),
181 rollon(false),
182 forward_commands(false),
183 import_commands(false),
185 rescuer(false),
188{
189 root_module = std::make_shared<Document::Module>(ROOT_MODULE_NAME); // Required to exist.
190}
191
192} /* namespace RigDef */
A database of user-installed content alias 'mods' (vehicles, terrains...)
Data structures representing 'truck' file format, see https://docs.rigsofrods.org/vehicle-creation/fi...
static const int NODE_LOCKGROUP_DEFAULT
static const float HOOK_LOCK_TIMER_DEFAULT
static const float HOOK_RANGE_DEFAULT
static const float HOOK_FORCE_DEFAULT
const char * ROOT_MODULE_NAME
ManagedMaterialType
Definition RigDef_File.h:79
BitMask64_t source
void AddMotorSource(BitMask_t source, unsigned int motor)
std::list< MotorSource > motor_sources
Module(Ogre::String const &name)
bool lockgroup_default_nolock
std::shared_ptr< Module > root_module
Required to exist. shared_ptr is used for unified handling with other modules.
bool slide_nodes_connect_instantly
bool enable_advanced_deformation
static const char * TypeToStr(ManagedMaterialType type)
ManagedMaterialType type