33#include <OgreStringConverter.h>
35#include <unordered_map>
44 m_inertia_function_width(10),
46 m_command_key_width(2),
54 <<
"; ---------------------------------------------------------------------------- ;" << endl
55 <<
"; Project: Rigs of Rods (http://www.rigsofrods.org) ;" << endl
56 <<
"; File format: https://docs.rigsofrods.org/vehicle-creation/fileformat-truck ;" << endl
57 <<
"; ---------------------------------------------------------------------------- ;" << endl
77 for (
auto module_itor:
m_rig_def->user_modules)
181 auto end_itor =
module->pistonprops.end();
182 for (
auto itor = module->
pistonprops.begin(); itor != end_itor; ++itor)
194 <<
", " << setw(
m_node_id_width) << (def.couple_node.IsValidAnyState() ? def.couple_node.Str() :
"-1")
197 <<
", " << def.airfoil
210 auto end_itor =
module->turbojets.end();
211 for (
auto itor = module->
turbojets.begin(); itor != end_itor; ++itor)
220 <<
", " << setw(2) << def.is_reversable
238 auto end_itor =
module->screwprops.end();
239 for (
auto itor = module->
screwprops.begin(); itor != end_itor; ++itor)
259 m_stream << m_dataline_indentstr
260 << setw(m_node_id_width) << def.front_node.Str() << ", "
261 << setw(m_node_id_width) << def.rear_node.Str() << ", ";
270 m_stream <<
", " << def.airfoil_name
284 auto end_itor =
module->turboprops2.end();
285 for (
auto itor = module->
turboprops2.begin(); itor != end_itor; ++itor)
311 auto end_itor =
module->airbrakes.end();
312 for (
auto itor = module->
airbrakes.begin(); itor != end_itor; ++itor)
340 if (module->
wings.empty())
345 auto end_itor =
module->wings.end();
346 for (
auto itor = module->
wings.begin(); itor != end_itor; ++itor)
386 auto end_itor =
module->soundsources.end();
387 for (
auto itor = module->
soundsources.begin(); itor != end_itor; ++itor)
405 m_stream <<
"soundsources2" << endl;
406 auto end_itor =
module->soundsources2.end();
407 for (
auto itor = module->
soundsources2.begin(); itor != end_itor; ++itor)
414 <<
", " << setw(2) << def.
mode
428 m_stream <<
"customdashboardinputs" << endl;
429 auto end_itor =
module->customdashboardinputs.end();
469 case ExtCameraMode::NODE:
472 case ExtCameraMode::CINECAM:
475 case ExtCameraMode::CLASSIC:
490 auto end_itor =
module->videocameras.end();
491 for (
auto itor = module->
videocameras.begin(); itor != end_itor; ++itor)
546 m_stream << m_dataline_indentstr << gs.key << " " << gs.value
559 auto end_itor =
module->exhausts.end();
560 for (
auto itor = module->
exhausts.begin(); itor != end_itor; ++itor)
581 m_stream <<
"submesh_groundmodel " <<
module->submesh_groundmodel.back() << endl << endl;
588 m_stream << "submesh" << endl;
590 if (def.texcoords.size() > 0)
593 auto texcoord_end = def.texcoords.end();
594 for (
auto texcoord_itor = def.texcoords.begin(); texcoord_itor != texcoord_end; ++texcoord_itor)
599 if (def.cab_triangles.size() > 0)
602 auto cab_end = def.cab_triangles.end();
603 for (
auto cab_itor = def.cab_triangles.begin(); cab_itor != cab_end; ++cab_itor)
631inline void PropAnimFlag(std::stringstream& out,
int flags,
bool& join,
unsigned int mask,
const char* name,
char joiner =
'|')
631inline void PropAnimFlag(std::stringstream& out,
int flags,
bool& join,
unsigned int mask,
const char* name,
char joiner =
'|') {
…}
716 auto end_itor =
module->flexbodies.end();
717 for (
auto itor = module->
flexbodies.begin(); itor != end_itor; ++itor)
739 auto forset_itor = def->
node_list.begin();
741 for (; forset_itor != forset_end; ++forset_itor)
755 for (
auto anim_itor = def->
animations.begin(); anim_itor != anim_end; ++anim_itor)
765 if (module->
props.empty())
770 auto end_itor =
module->props.end();
771 for (
auto itor = module->
props.begin(); itor != end_itor; ++itor)
814 for (
auto anim_itor = def.
animations.begin(); anim_itor != anim_end; ++anim_itor)
828 m_stream <<
"materialflarebindings" << endl;
829 auto end_itor =
module->materialflarebindings.end();
846 auto end_itor =
module->flares2.end();
847 for (
auto itor = module->
flares2.begin(); itor != end_itor; ++itor)
859 <<
", " << (char)def.
type
877 size_t name_w = 0, type_w = 0, tex1_w = 0, tex2_w = 1, tex3_w = 1;
880 name_w = std::max(name_w, mm.name.length());
882 tex1_w = std::max(tex1_w, mm.diffuse_map.size());
883 tex2_w = std::max(tex2_w, mm.damaged_diffuse_map.length());
884 tex3_w = std::max(tex3_w, mm.specular_map.length());
887 m_stream <<
"managedmaterials" << std::left << endl;
892 if (first || (mm_options.
double_sided != def.options.double_sided))
895 m_stream <<
"set_managedmaterials_options " << (int) mm_options.
double_sided
899 m_stream << m_dataline_indentstr
900 << setw(name_w) << def.name <<
" "
902 << setw(tex1_w) << def.diffuse_map <<
" ";
907 m_stream << setw(tex2_w) << (def.damaged_diffuse_map.empty() ?
"-" : def.damaged_diffuse_map) <<
" ";
911 m_stream << setw(tex2_w) <<
"" <<
" ";
914 m_stream << setw(tex3_w) << (def.specular_map.empty() ?
"-" : def.specular_map);
920 m_stream << std::right;
930 m_stream <<
"collisionboxes" << endl;
931 auto end_itor =
module->collisionboxes.end();
932 for (
auto itor = module->
collisionboxes.begin(); itor != end_itor; ++itor)
938 auto nodes_end = def.
nodes.end();
939 auto node_itor = def.
nodes.begin();
942 for (; node_itor != nodes_end; ++node_itor)
944 m_stream <<
", " << node_itor->Str();
954 if (module->
axles.empty())
959 auto end_itor =
module->axles.end();
960 for (
auto itor = module->
axles.begin(); itor != end_itor; ++itor)
973 for (
auto itor = def.
options.begin(); itor != end; ++itor)
991 auto end_itor =
module->interaxles.end();
992 for (
auto itor = module->
interaxles.begin(); itor != end_itor; ++itor)
1005 for (
auto itor = def.
options.begin(); itor != end; ++itor)
1022 TransferCase& def =
module->transfercase[module->transfercase.size() - 1];
1059 <<
module->speedlimiter[module->speedlimiter.size() - 1].max_speed
1070 if (module->
torquecurve[0].predefined_func_name.empty())
1072 auto itor_end =
module->torquecurve[0].samples.end();
1073 auto itor =
module->torquecurve[0].samples.begin();
1074 for (; itor != itor_end; ++itor)
1093 auto end_itor =
module->particles.end();
1094 for (
auto itor = module->
particles.begin(); itor != end_itor; ++itor)
1116 auto end_itor =
module->ropables.end();
1117 for (
auto itor = module->
ropables.begin(); itor != end_itor; ++itor)
1124 <<
", " << def.
group
1133 if (module->
ties.empty())
1138 auto end_itor =
module->ties.end();
1139 for (
auto itor = module->
ties.begin(); itor != end_itor; ++itor)
1153 <<
", " << def.
group;
1161 if (module->
fixes.empty())
1166 auto end_itor =
module->fixes.end();
1167 for (
auto itor = module->
fixes.begin(); itor != end_itor; ++itor)
1176 if (module->
ropes.empty())
1181 auto end_itor =
module->ropes.end();
1184 for (
auto itor = module->
ropes.begin(); itor != end_itor; ++itor)
1214 m_stream <<
"railgroups" << endl << endl;
1215 auto end_itor =
module->railgroups.end();
1216 for (
auto itor = module->
railgroups.begin(); itor != end_itor; ++itor)
1224 for (
auto node_itor = def.
node_list.begin(); node_itor != node_end; ++node_itor)
1226 m_stream <<
", " << node_itor->start.Str();
1227 if (node_itor->IsRange())
1229 m_stream <<
" - " << node_itor->end.Str();
1243 m_stream <<
"slidenodes" << endl << endl;
1244 auto end_itor =
module->slidenodes.end();
1245 for (
auto itor = module->
slidenodes.begin(); itor != end_itor; ++itor)
1258 for (; itor != end; ++itor)
1260 m_stream <<
", " << itor->start.Str();
1261 if (itor->IsRange())
1263 m_stream <<
" - " << itor->end.Str();
1292 if (module->
hooks.empty())
1296 m_stream <<
"hooks" << endl << endl;
1297 auto end_itor =
module->hooks.end();
1298 for (
auto itor = module->
hooks.begin(); itor != end_itor; ++itor)
1334 m_stream <<
"lockgroups" << endl << endl;
1335 auto end_itor =
module->lockgroups.end();
1336 for (
auto itor = module->
lockgroups.begin(); itor != end_itor; ++itor)
1343 auto nodes_end = def.
nodes.end();
1344 for (
auto nodes_itor = def.
nodes.begin(); nodes_itor != nodes_end; ++nodes_itor)
1346 m_stream <<
", " << nodes_itor->Str();
1359 m_stream <<
"animators" << endl << endl;
1360 auto end_itor =
module->triggers.end();
1361 for (
auto itor = module->
triggers.begin(); itor != end_itor; ++itor)
1393#define ANIMATOR_ADD_FLAG(DEF_VAR, AND_VAR, BITMASK_CONST, NAME_STR) \
1394 if (AND_VAR) { m_stream << " | "; } \
1395 if (BITMASK_IS_1((DEF_VAR).flags, RigDef::Animator::BITMASK_CONST)) { \
1397 m_stream << NAME_STR; \
1393#define ANIMATOR_ADD_FLAG(DEF_VAR, AND_VAR, BITMASK_CONST, NAME_STR) \ …
1400#define ANIMATOR_ADD_AERIAL_FLAG(DEF_VAR, AND_VAR, BITMASK_CONST, NAME_STR) \
1401 if (AND_VAR) { m_stream << " | "; } \
1402 if (BITMASK_IS_1((DEF_VAR).aero_animator.flags, RigDef::AeroAnimator::BITMASK_CONST)) { \
1404 m_stream << NAME_STR << DEF_VAR.aero_animator.engine_idx + 1; \
1400#define ANIMATOR_ADD_AERIAL_FLAG(DEF_VAR, AND_VAR, BITMASK_CONST, NAME_STR) \ …
1407#define ANIMATOR_ADD_LIMIT(DEF_VAR, AND_VAR, BITMASK_CONST, NAME_STR, VALUE) \
1408 if (AND_VAR) { m_stream << " | "; } \
1409 if (BITMASK_IS_1((DEF_VAR).aero_animator.flags, RigDef::Animator::BITMASK_CONST)) { \
1411 m_stream << NAME_STR << ": " << VALUE; \
1407#define ANIMATOR_ADD_LIMIT(DEF_VAR, AND_VAR, BITMASK_CONST, NAME_STR, VALUE) \ …
1420 m_stream <<
"animators" << endl << endl;
1421 auto end_itor =
module->animators.end();
1422 for (
auto itor = module->
animators.begin(); itor != end_itor; ++itor)
1484 m_stream <<
"contacters" << endl << endl;
1488 m_stream << setw(m_node_id_width) << node.Str() << endl;
1500 m_stream <<
"rotators" << endl << endl;
1501 auto end_itor =
module->rotators.end();
1502 for (
auto itor = module->
rotators.begin(); itor != end_itor; ++itor)
1514 for (
int i = 0; i < 4; ++i)
1520 for (
int i = 0; i < 4; ++i)
1551 size_t desc_w = 0, startf_w = 0, stopf_w = 0;
1554 desc_w = std::max(desc_w, def.description.length());
1555 startf_w = std::max(startf_w, def.inertia.start_function.length());
1556 stopf_w = std::max(stopf_w, def.inertia.stop_function.length());
1560 m_stream <<
"rotators2" << endl << endl;
1561 auto end_itor =
module->rotators2.end();
1562 for (
auto itor = module->rotators2.begin(); itor != end_itor; ++itor)
1564 this->ExportDocComment(module,
Keyword::ROTATORS, std::distance(module->rotators2.begin(), itor));
1573 for (
int i = 0; i < 4; ++i)
1579 for (
int i = 0; i < 4; ++i)
1586 << setw(m_float_width) << def.
rate <<
", "
1590 << setw(m_float_width) << def.
tolerance <<
", "
1615 m_stream <<
"flexbodywheels" << endl << endl;
1616 auto end_itor =
module->flexbodywheels.end();
1617 for (
auto itor = module->
flexbodywheels.begin(); itor != end_itor; ++itor)
1619 this->
UpdatePresets(itor->beam_defaults.get(), itor->node_defaults.get(),
nullptr);
1626 << setw(3) << itor->num_rays <<
", "
1630 << setw(3) << (int)itor->braking <<
", "
1631 << setw(3) << (int)itor->propulsion <<
", "
1638 << (
static_cast<char>(itor->side)) <<
", "
1639 << itor->rim_mesh_name <<
" "
1640 << itor->tyre_mesh_name
1658 <<
"mode: " << (def.
attr_is_on ?
"ON" :
"OFF");
1669 if (module->
brakes.size() == 0) {
return; }
1671 Brakes& brakes =
module->brakes[module->brakes.size() - 1];
1690 <<
"mode: " << (alb->
attr_is_on ?
"ON" :
"OFF");
1700 if (module->
engine.size() == 0)
1705 Engine& engine =
module->engine[module->engine.size() - 1];
1715 " Forward gears...\n\t"
1718 << setw(10) << engine.
torque <<
", "
1725 for (; itor != end; ++itor)
1729 m_stream <<
", -1.0" << endl << endl;
1739 Engoption& engoption =
module->engoption[module->engoption.size() - 1];
1755 << setw(10) << engoption.
inertia <<
", "
1756 << setw(10) << (char)engoption.
type <<
", "
1761 << setw( 8) << engoption.
stall_rpm <<
", "
1762 << setw( 7) << engoption.
idle_rpm <<
", "
1772 if (module->
help.size() == 0)
1776 m_stream <<
"help\n\t" <<
module->help[module->help.size() - 1].material << endl << endl;
1787 m_stream <<
"wheels2" << endl << endl;
1788 auto end_itor =
module->wheels2.end();
1789 for (
auto itor = module->
wheels2.begin(); itor != end_itor; ++itor)
1791 this->
UpdatePresets(itor->beam_defaults.get(), itor->node_defaults.get(),
nullptr);
1798 << setw(3) << itor->num_rays <<
", "
1802 << setw(3) << (int)itor->braking <<
", "
1803 << setw(3) << (int)itor->propulsion <<
", "
1810 << itor->face_material_name <<
" "
1811 << itor->band_material_name <<
" "
1821 if (module->
wheels.empty())
1827 m_stream <<
"wheels" << endl << endl;
1831 << setw(3) <<
"nrays, "
1835 << setw(3) <<
"brk, "
1836 << setw(3) <<
"pwr, "
1844 auto end_itor =
module->wheels.end();
1845 for (
auto itor = module->
wheels.begin(); itor != end_itor; ++itor)
1847 this->
UpdatePresets(itor->beam_defaults.get(), itor->node_defaults.get(),
nullptr);
1853 << setw(3) << itor->num_rays <<
", "
1857 << setw(3) << (int)itor->braking <<
", "
1858 << setw(3) << (int)itor->propulsion <<
", "
1863 << itor->face_material_name <<
" "
1864 << itor->band_material_name <<
" "
1884 << setw(3) << (int)def.
braking <<
", "
1890 << (
static_cast<char>(def.
side)) <<
", "
1902 m_stream <<
"meshwheels" <<
"\n\n";
1904 for (
MeshWheel& def:
module->meshwheels)
1906 this->ExportBaseMeshWheel(def);
1919 m_stream <<
"meshwheels2" <<
"\n\n";
1923 this->ExportBaseMeshWheel(def);
1937 for (
auto& camera:
module->cameras)
1940 << setw(m_node_id_width) << camera.center_node.Str() << ", "
1941 << setw(m_node_id_width) << camera.back_node.Str() << ", "
1942 << setw(m_node_id_width) << camera.left_node.Str() << "\n";
1954 m_stream <<
"cinecam" << endl << endl;
1956 for (
auto itor = module->
cinecam.begin(); itor !=
module->cinecam.end(); ++itor)
1983 if (module->
beams.empty())
1989 m_stream <<
"beams" << endl << endl;
1992 for (
size_t i = 0; i <
module->beams.size(); i++)
1994 Beam& beam =
module->beams[i];
1995 if (prev_defaults != beam.
defaults.get())
1998 prev_defaults = beam.
defaults.get();
2010 if (module->
shocks.empty())
2016 m_stream <<
"shocks" << endl << endl;
2019 for (
size_t i = 0; i <
module->shocks.size(); i++)
2021 Shock& shock =
module->shocks[i];
2043 m_stream <<
"shocks2" << endl << endl;
2046 for (
size_t i = 0; i <
module->shocks2.size(); i++)
2048 Shock2& shock2 =
module->shocks2[i];
2070 m_stream <<
"shocks3" << endl << endl;
2073 for (
size_t i = 0; i <
module->shocks3.size(); i++)
2075 Shock3& shock3 =
module->shocks3[i];
2092 if (module->
hydros.empty())
2098 m_stream <<
"hydros" << endl << endl;
2101 for (
size_t i = 0; i <
module->hydros.size(); i++)
2103 Hydro& hydro =
module->hydros[i];
2125 m_stream <<
"commands" << endl << endl;
2128 for (
size_t i = 0; i <
module->commands2.size(); i++)
2130 Command2& command =
module->commands2[i];
2212 if (inertia.start_delay_factor != 0 && inertia.stop_delay_factor != 0)
2217 if (!inertia.start_function.empty())
2220 if (!inertia.stop_function.empty())
2367 if (beam_defaults !=
nullptr)
2369 m_stream << fmt::format(
"{}set_beam_defaults {}, {}, {}, {}, {}, {}, {}\n",
2381 m_stream << fmt::format(
"{}set_beam_defaults {}, {}, {}, {}, {}, {}, {}\n",
2423 if (module->
nodes.empty())
2429 m_stream <<
"nodes" << endl << endl;
2431 size_t num_named = 0;
2434 for (
size_t i = 0; i <
module->nodes.size(); i++)
2436 Node& node =
module->nodes[i];
2437 if (node.
id.IsTypeNamed())
2443 if (preset != prev_preset)
2446 prev_preset = preset;
2450 if (dminimass != prev_dminimass)
2453 prev_dminimass = dminimass;
2462 m_stream << endl << endl <<
"nodes2" << endl;
2464 for (
size_t i = 0; i <
module->nodes.size(); i++)
2466 Node& node =
module->nodes[i];
2467 if (!node.
id.IsTypeNamed())
2473 if (preset != prev_preset)
2476 prev_preset = preset;
2480 if (dminimass != prev_dminimass)
2483 prev_dminimass = dminimass;
2497 if (node_defaults !=
nullptr)
2499 m_stream << fmt::format(
"{}set_node_defaults {}, {}, {}, {}, {}\n",
2509 m_stream << fmt::format(
"{}set_node_defaults {}, {}, {}, {}, {}\n",
2538 m_stream << fmt::format(
"{}set_default_minimass {}\n",
2545 m_stream << fmt::format(
"{}{}, {:>{}}, {:>{}}, {:>{}}, {}, {}\n",
2557 if (
m_rig_def->enable_advanced_deformation)
2559 m_stream <<
"enable_advanced_deformation" << endl << endl;
2563 m_stream <<
"hideInChooser" << endl << endl;
2565 if (
m_rig_def->slide_nodes_connect_instantly)
2567 m_stream <<
"slidenode_connect_instantly" << endl << endl;
2569 if (
m_rig_def->lockgroup_default_nolock)
2571 m_stream <<
"lockgroup_default_nolock" << endl << endl;
2575 m_stream <<
"rollon" << endl << endl;
2579 m_stream <<
"rescuer" << endl << endl;
2583 m_stream <<
"disabledefaultsounds" << endl << endl;
2587 m_stream <<
"forwardcommands" << endl << endl;
2591 m_stream <<
"importcommands" << endl << endl;
2599 Fileinfo& data =
module->fileinfo[module->fileinfo.size() - 1];
2612 if (! module->
guid.empty())
2614 m_stream <<
"guid " <<
module->guid[module->guid.size() - 1].guid << endl << endl;
2623 for (
auto itor = module->
description.begin(); itor !=
module->description.end(); ++itor)
2625 std::string line = *itor;
2628 m_stream << endl <<
"end_description" << endl << endl;
2634 for (
auto itor = module->
author.begin(); itor !=
module->author.end(); ++itor)
2653 if (module->
globals.size() == 0)
2659 <<
module->globals[0].dry_mass << ", "
2660 << module->globals[0].cargo_mass;
2661 if (!module->
globals[0].material_name.empty())
2663 m_stream <<
", " <<
module->globals[0].material_name;
2699 [
keyword, vectorpos](
const RigDef::DocComment& dc) { return dc.commented_keyword == keyword && dc.commented_datapos == (int)vectorpos; });
#define BITMASK_IS_1(VAR, FLAGS)
Data structures representing 'truck' file format, see https://docs.rigsofrods.org/vehicle-creation/fi...
#define ANIMATOR_ADD_FLAG(DEF_VAR, AND_VAR, BITMASK_CONST, NAME_STR)
void PropAnimFlag(std::stringstream &out, int flags, bool &join, unsigned int mask, const char *name, char joiner='|')
#define ANIMATOR_ADD_LIMIT(DEF_VAR, AND_VAR, BITMASK_CONST, NAME_STR, VALUE)
#define ANIMATOR_ADD_AERIAL_FLAG(DEF_VAR, AND_VAR, BITMASK_CONST, NAME_STR)
std::string const & Str() const
Legacy parser resolved references on-the-fly and the condition to check named nodes was "are there an...
bool IsValidAnyState() const
std::string const & Str() const
void ProcessRopables(Document::Module *module)
void ProcessAntiLockBrakes(Document::Module *module)
void ProcessBrakes(Document::Module *module)
void ProcessTurboprops(Document::Module *module)
void ProcessScrewprops(Document::Module *module)
void ProcessShock2(Shock2 &def)
void ProcessAuthors(Document::Module *module)
std::string m_setdefaults_indentstr
'set_beam_defaults' for example
void ProcessExhausts(Document::Module *module)
void ProcessDefaultMinimass(DefaultMinimass *default_minimass)
void ProcessHelp(Document::Module *module)
void ProcessDirectiveAddAnimation(RigDef::Animation &anim)
NodeDefaults * m_current_node_defaults
void ProcessCollisionBoxes(Document::Module *module)
void ExportBaseMeshWheel(BaseMeshWheel &def)
void ProcessAirbrakes(Document::Module *module)
void ProcessInterAxles(Document::Module *module)
void ProcessFusedrag(Document::Module *module)
void ProcessSubmeshGroundmodel(Document::Module *module)
void ProcessSoundsources2(Document::Module *module)
void ProcessRopes(Document::Module *module)
void ProcessShocks(Document::Module *)
void ProcessNode(Node &node)
void ProcessNodeDefaults(NodeDefaults *node_defaults)
void ProcessCameras(Document::Module *module)
void ProcessMeshWheels2(Document::Module *module)
void ProcessBeam(Beam &beam)
void ProcessWings(Document::Module *module)
void ProcessParticles(Document::Module *module)
void ProcessGlobals(Document::Module *module)
std::string RigidityNodeToStr(Node::Ref node)
void ProcessCinecam(Document::Module *)
DefaultMinimass * m_current_default_minimass
void ProcessWheels2(Document::Module *module)
void ProcessRailGroups(Document::Module *module)
void ProcessSubmesh(Document::Module *module)
void ProcessHooks(Document::Module *module)
void ProcessWheels(Document::Module *module)
void ProcessCommand2(Command2 &def)
void ProcessEngoption(Document::Module *module)
void ProcessPistonprops(Document::Module *module)
void ProcessFileinfo(Document::Module *module)
void ProcessHydro(Hydro &def)
void ProcessShock3(Shock3 &def)
void ProcessFlexbodies(Document::Module *module)
void ProcessContacters(Document::Module *module)
void ProcessTriggers(Document::Module *module)
void ProcessBeamDefaults(BeamDefaults *beam_defaults)
void ProcessGuid(Document::Module *module)
void ProcessDescription(Document::Module *module)
void ProcessCommands2(Document::Module *)
std::stringstream m_stream
void ProcessAnimators(Document::Module *module)
void UpdatePresets(BeamDefaults *beam, NodeDefaults *node, DefaultMinimass *minimass)
void ProcessCustomDashboardInputs(Document::Module *module)
int m_inertia_function_width
void ProcessTies(Document::Module *module)
void ProcessShocks3(Document::Module *)
void ProcessFlexBodyWheels(Document::Module *module)
void ProcessShock(Shock &def)
std::string NodeOptionsToStr(BitMask_t options)
void ProcessTractionControl(Document::Module *module)
void ProcessMaterialFlareBindings(Document::Module *module)
void ProcessGuiSettings(Document::Module *module)
void ProcessNodes(Document::Module *)
void ProcessMeshWheels(Document::Module *module)
void ProcessFixes(Document::Module *module)
void ProcessPropsAndAnimations(Document::Module *module)
void SerializeModule(std::shared_ptr< RigDef::Document::Module > m)
void ProcessHydros(Document::Module *)
void ExportDocComment(Document::Module *module, RigDef::Keyword keyword, ptrdiff_t vectorpos)
void ProcessSetSkeletonSettings(Document::Module *module)
void ProcessTurbojets(Document::Module *module)
void ProcessLockgroups(Document::Module *module)
void ProcessFlares2(Document::Module *module)
void ProcessShocks2(Document::Module *)
Serializer(RigDef::DocumentPtr rig_def)
void ProcessSoundsources(Document::Module *module)
void ProcessRotators(Document::Module *module)
void ProcessBeams(Document::Module *)
RigDef::DocumentPtr m_rig_def
BeamDefaults * m_current_beam_defaults
void ProcessManagedMaterialsAndOptions(Document::Module *module)
std::string m_dataline_indentstr
a node or a beam line for example
void ProcessSpeedLimiter(Document::Module *module)
void ProcessTorqueCurve(Document::Module *module)
void ProcessVideocamera(Document::Module *module)
void ProcessCruiseControl(Document::Module *module)
void ProcessRotators2(Document::Module *module)
void ProcessAxles(Document::Module *module)
void ProcessSlideNodes(Document::Module *module)
void ProcessExtCamera(Document::Module *module)
void ProcessEngine(Document::Module *module)
void ProcessTransferCase(Document::Module *module)
static const float DEFAULT_SPRING
static const float BEAM_DEFORM
static const float DEFAULT_DAMP
static const float BEAM_BREAK
const char * ROOT_MODULE_NAME
@ c_COMMAND_STYLE
trigger is set with commandstyle boundaries instead of shocksytle
@ s_CMD_NUM_SWITCH
switch that exchanges cmdshort/cmdshort for all triggers with the same commandnumbers,...
@ t_CONTINUOUS
this trigger sends values between 0 and 1
@ A_INV_TRIGGER_BLOCKER
Blocker that enable/disable other triggers, reversed activation method (inverted Blocker style,...
@ B_TRIGGER_BLOCKER
Blocker that enable/disable other triggers.
@ E_ENGINE_TRIGGER
this trigger is used to control an engine
@ x_START_DISABLED
this trigger is disabled on startup, default is enabled
@ b_KEY_BLOCKER
Set the CommandKeys that are set in a commandkeyblocker or trigger to blocked on startup,...
std::shared_ptr< Document > DocumentPtr
@ v_INPUT_InvAILERON_ELEVATOR
@ h_INPUT_InvELEVATOR_RUDDER
@ g_INPUT_ELEVATOR_RUDDER
@ u_INPUT_AILERON_ELEVATOR
@ y_INPUT_InvAILERON_RUDDER
@ s_DISABLE_ON_HIGH_SPEED
float max_inclination_angle
static const BitMask64_t SOURCE_TURBO
static const BitMask64_t SOURCE_SEQUENTIAL_SHIFT
static const BitMask64_t SOURCE_AIR_RUDDER
static const BitMask_t MODE_ROTATION_X
static const BitMask64_t SOURCE_ALTIMETER_1K
static const BitMask_t MODE_OFFSET_Y
static const BitMask64_t SOURCE_SHIFT_LEFT_RIGHT
static const BitMask_t MODE_NO_FLIP
static const BitMask64_t SOURCE_FLAP
static const BitMask64_t SOURCE_SPEEDO
static const BitMask64_t SOURCE_DIFFLOCK
static const BitMask64_t SOURCE_ALTIMETER_10K
static const BitMask64_t SOURCE_AIRSPEED
static const BitMask_t MODE_AUTO_ANIMATE
static const BitMask64_t SOURCE_ROLL
static const BitMask64_t SOURCE_BOAT_THROTTLE
static const BitMask64_t SOURCE_CLUTCH
static const BitMask_t MODE_OFFSET_Z
static const BitMask64_t SOURCE_PITCH
static const BitMask64_t SOURCE_TACHO
static const BitMask64_t SOURCE_AILERON
static const BitMask_t MODE_ROTATION_Y
static const BitMask64_t SOURCE_ELEVATOR
static const BitMask64_t SOURCE_PERMANENT
static const BitMask_t MODE_EVENT_LOCK
static const BitMask64_t SOURCE_STEERING_WHEEL
static const BitMask64_t SOURCE_PARKING
static const BitMask64_t SOURCE_SHIFT_BACK_FORTH
static const BitMask64_t SOURCE_ACCEL
static const BitMask64_t SOURCE_AIR_BRAKE
static const BitMask64_t SOURCE_ANGLE_OF_ATTACK
static const BitMask64_t SOURCE_VERTICAL_VELOCITY
static const BitMask_t MODE_OFFSET_X
static const BitMask_t MODE_BOUNCE
static const BitMask64_t SOURCE_SHIFTERLIN
static const BitMask64_t SOURCE_ALTIMETER_100K
static const BitMask64_t SOURCE_BOAT_RUDDER
static const BitMask64_t SOURCE_BRAKES
static const BitMask64_t SOURCE_TORQUE
static const BitMask_t MODE_ROTATION_Z
static const BitMask64_t SOURCE_EVENT
static const BitMask64_t SOURCE_HEADING
unsigned int forum_account_id
DifferentialTypeVec options
Order matters!
Ogre::String material_name
RoR::WheelBraking braking
std::shared_ptr< BeamDefaults > beam_defaults
std::shared_ptr< NodeDefaults > node_defaults
RoR::WheelPropulsion propulsion
Node::Ref reference_arm_node
Ogre::String beam_material_name
float plastic_deform_coef
float visual_beam_diameter
float deformation_threshold
static const BitMask_t OPTION_r_ROPE
bool _has_extension_break_limit
std::shared_ptr< BeamDefaults > defaults
float extension_break_limit
static const BitMask_t OPTION_i_INVISIBLE
static const BitMask_t OPTION_s_SUPPORT
float default_braking_force
float parking_brake_force
static const BitMask_t OPTION_r_BUOYANT_ONLY_DRAG
static const BitMask_t OPTION_p_10xTOUGHER
static const BitMask_t OPTION_s_BUOYANT_NO_DRAG
static const BitMask_t OPTION_F_10xTOUGHER_BUOYANT
static const BitMask_t OPTION_b_BUOYANT
static const BitMask_t OPTION_D_CONTACT_BUOYANT
static const BitMask_t OPTION_S_INVULNERABLE_BUOYANT
static const BitMask_t OPTION_c_CONTACT
static const BitMask_t OPTION_u_INVULNERABLE
std::vector< Node::Ref > nodes
RoR::CommandkeyID_t extend_key
RoR::CommandkeyID_t contract_key
std::shared_ptr< BeamDefaults > beam_defaults
bool option_o_1press_center
bool option_c_auto_center
float min_mass_Kg
minimum node mass in Kg
std::vector< Node::Ref > fixes
std::vector< Wheel2 > wheels2
std::vector< Exhaust > exhausts
std::vector< Ropable > ropables
std::vector< Prop > props
std::vector< CollisionBox > collisionboxes
std::vector< InterAxle > interaxles
std::vector< Rotator2 > rotators2
std::vector< SoundSource2 > soundsources2
std::vector< Rotator > rotators
std::vector< SkeletonSettings > set_skeleton_settings
std::vector< Ogre::String > submesh_groundmodel
std::vector< Wing > wings
std::vector< CustomDashboardInput > customdashboardinputs
std::vector< GuiSettings > guisettings
std::vector< AntiLockBrakes > antilockbrakes
std::vector< DocComment > _comments
std::vector< Ogre::String > description
std::vector< MeshWheel2 > meshwheels2
std::vector< Turbojet > turbojets
std::vector< Particle > particles
std::vector< VideoCamera > videocameras
std::vector< Shock > shocks
std::vector< CruiseControl > cruisecontrol
std::vector< Shock2 > shocks2
std::vector< Hook > hooks
std::vector< Pistonprop > pistonprops
std::vector< TractionControl > tractioncontrol
std::vector< Author > author
std::vector< MeshWheel > meshwheels
std::vector< Animator > animators
std::vector< SoundSource > soundsources
std::vector< Cinecam > cinecam
std::vector< ManagedMaterial > managedmaterials
std::vector< SpeedLimiter > speedlimiter
std::vector< FlexBodyWheel > flexbodywheels
std::vector< TransferCase > transfercase
std::vector< Flexbody > flexbodies
std::vector< Globals > globals
std::vector< Lockgroup > lockgroups
std::vector< Node > nodes
std::vector< Rope > ropes
std::vector< Node::Ref > contacters
std::vector< Wheel > wheels
std::vector< Engoption > engoption
std::vector< Command2 > commands2
std::vector< TorqueCurve > torquecurve
std::vector< Trigger > triggers
std::vector< MaterialFlareBinding > materialflarebindings
std::vector< ExtCamera > extcamera
std::vector< Turboprop2 > turboprops2
std::vector< RailGroup > railgroups
std::vector< Fileinfo > fileinfo
std::vector< Engine > engine
std::vector< Axle > axles
std::vector< Shock3 > shocks3
std::vector< Hydro > hydros
std::vector< Screwprop > screwprops
std::vector< SlideNode > slidenodes
std::vector< Beam > beams
std::vector< Brakes > brakes
std::vector< Camera > cameras
std::vector< Flare2 > flares2
std::vector< Airbrake > airbrakes
std::vector< float > gear_ratios
float post_shift_time
Seconds.
float clutch_time
Seconds.
Ogre::String particle_name
Ogre::String material_name
int control_number
Only 'u' type flares.
std::list< Animation > animations
std::vector< Node::Ref > node_list
float option_min_range_meters
static const BitMask_t OPTION_e_INPUT_ELEVATOR
static const BitMask_t OPTION_s_DISABLE_ON_HIGH_SPEED
static const BitMask_t OPTION_h_INPUT_InvELEVATOR_RUDDER
static const BitMask_t OPTION_g_INPUT_ELEVATOR_RUDDER
static const BitMask_t OPTION_y_INPUT_InvAILERON_RUDDER
static const BitMask_t OPTION_j_INVISIBLE
static const BitMask_t OPTION_v_INPUT_InvAILERON_ELEVATOR
static const BitMask_t OPTION_a_INPUT_AILERON
static const BitMask_t OPTION_r_INPUT_RUDDER
static const BitMask_t OPTION_n_INPUT_NORMAL
static const BitMask_t OPTION_u_INPUT_AILERON_ELEVATOR
static const BitMask_t OPTION_x_INPUT_AILERON_RUDDER
std::shared_ptr< BeamDefaults > beam_defaults
Ogre::String start_function
Ogre::String stop_function
DifferentialTypeVec options
Order matters!
std::vector< Node::Ref > nodes
static const char * TypeToStr(ManagedMaterialType type)
Ogre::String material_name
unsigned int flare_number
unsigned int options
Bit flags.
static const BitMask_t OPTION_c_NO_GROUND_CONTACT
static const BitMask_t OPTION_p_NO_PARTICLES
std::shared_ptr< DefaultMinimass > default_minimass
bool _has_load_weight_override
static const BitMask_t OPTION_f_NO_SPARKS
static const BitMask_t OPTION_b_EXTRA_BUOYANCY
static const BitMask_t OPTION_L_LOG
static const BitMask_t OPTION_x_EXHAUST_POINT
static const BitMask_t OPTION_e_TERRAIN_EDIT_POINT
std::shared_ptr< NodeDefaults > node_defaults
float load_weight_override
static const BitMask_t OPTION_h_HOOK_POINT
static const BitMask_t OPTION_m_NO_MOUSE_GRAB
static const BitMask_t OPTION_l_LOAD_WEIGHT
static const BitMask_t OPTION_y_EXHAUST_DIRECTION
Ogre::String particle_system_name
Ogre::String flare_material_name
DashboardSpecial special_prop_dashboard
BeaconSpecial special_prop_beacon
std::list< Animation > animations
std::vector< Node::Range > node_list
std::shared_ptr< BeamDefaults > beam_defaults
unsigned int spin_left_key
Node::Ref base_plate_nodes[4]
Node::Ref rotating_plate_nodes[4]
unsigned int spin_right_key
static const BitMask_t OPTION_i_INVISIBLE
float short_bound
Maximum contraction limit, in percentage ( 1.00 = 100% )
float progress_factor_damp_out
Progression factor dampout, 0 = disabled, 1...x as multipliers, example:maximum dampingrate == spring...
float damp_out
damping value applied when shock extending
float progress_factor_damp_in
Progression factor for dampin. 0 = disabled, 1...x as multipliers, example:maximum dampingrate == spr...
std::shared_ptr< BeamDefaults > beam_defaults
static const BitMask_t OPTION_m_METRIC
float spring_in
Spring value applied when the shock is compressing.
static const BitMask_t OPTION_s_SOFT_BUMP_BOUNDS
float precompression
Changes compression or extension of the suspension when the truck spawns. This can be used to "level"...
float progress_factor_spring_out
Progression factor springout, 0 = disabled, 1...x as multipliers, example:maximum springrate == sprin...
static const BitMask_t OPTION_M_ABSOLUTE_METRIC
float spring_out
spring value applied when shock extending
float long_bound
Maximum extension limit, in percentage ( 1.00 = 100% )
float damp_in
Damping value applied when the shock is compressing.
float progress_factor_spring_in
Progression factor for springin. A value of 0 disables this option. 1...x as multipliers,...
float damp_in_slow
Damping value applied when shock is commpressing slower than split in velocity.
float spring_in
Spring value applied when the shock is compressing.
float spring_out
Spring value applied when shock extending.
static const BitMask_t OPTION_M_ABSOLUTE_METRIC
float damp_in
Damping value applied when the shock is compressing.
float split_vel_in
Split velocity in (m/s) - threshold for slow / fast damping during compression.
float precompression
Changes compression or extension of the suspension when the truck spawns. This can be used to "level"...
static const BitMask_t OPTION_i_INVISIBLE
static const BitMask_t OPTION_m_METRIC
std::shared_ptr< BeamDefaults > beam_defaults
float damp_out
Damping value applied when shock extending.
float long_bound
Maximum extension limit, in percentage ( 1.00 = 100% )
float short_bound
Maximum contraction limit, in percentage ( 1.00 = 100% )
float damp_out_slow
Damping value applied when shock is commpressing slower than split out velocity.
float damp_out_fast
Damping value applied when shock is commpressing faster than split out velocity.
float damp_in_fast
Damping value applied when shock is commpressing faster than split in velocity.
float split_vel_out
Split velocity in (m/s) - threshold for slow / fast damping during extension.
static const BitMask_t OPTION_L_ACTIVE_LEFT
std::shared_ptr< BeamDefaults > beam_defaults
float damping
The 'resistance to motion' of the shock. The best value is given by this equation: 2 * sqrt(suspended...
float spring_rate
The 'stiffness' of the shock. The higher the value, the less the shock will move for a given bump.
static const BitMask_t OPTION_m_METRIC
float precompression
Changes compression or extension of the suspension when the truck spawns. This can be used to "level"...
float short_bound
Maximum contraction. The shortest length the shock can be, as a proportion of its original length....
float long_bound
Maximum extension. The longest length a shock can be, as a proportion of its original length....
static const BitMask_t OPTION_i_INVISIBLE
static const BitMask_t OPTION_R_ACTIVE_RIGHT
float visibility_range_meters
float beam_thickness_meters
static const BitMask_t CONSTRAINT_ATTACH_ALL
static const BitMask_t CONSTRAINT_ATTACH_NONE
static const BitMask_t CONSTRAINT_ATTACH_FOREIGN
bool _attachment_rate_set
static const BitMask_t CONSTRAINT_ATTACH_SELF
bool _max_attach_dist_set
BitMask_t constraint_flags
std::vector< Node::Range > rail_node_ranges
int mode
A special constant or cinecam index.
Ogre::String sound_script_name
static const BitMask_t OPTION_i_INVISIBLE
static const BitMask_t OPTION_s_DISABLE_SELF_LOCK
std::vector< float > gear_ratios
static const BitMask_t OPTION_B_TRIGGER_BLOCKER
static const BitMask_t OPTION_s_CMD_NUM_SWITCH
static const BitMask_t OPTION_h_UNLOCKS_HOOK_GROUP
static const BitMask_t OPTION_i_INVISIBLE
static const BitMask_t OPTION_t_CONTINUOUS
static const BitMask_t OPTION_E_ENGINE_TRIGGER
static const BitMask_t OPTION_c_COMMAND_STYLE
static const BitMask_t OPTION_b_KEY_BLOCKER
float contraction_trigger_limit
static const BitMask_t OPTION_x_START_DISABLED
int longbound_trigger_action
float expansion_trigger_limit
static const BitMask_t OPTION_H_LOCKS_HOOK_GROUP
static const BitMask_t OPTION_A_INV_TRIGGER_BLOCKER
int shortbound_trigger_action
Node::Ref blade_tip_nodes[4]
RoR::VideoCamRole camera_role
Ogre::String material_name
unsigned int texture_width
Node::Ref alt_orientation_node
Node::Ref alt_reference_node
unsigned int texture_height
WingControlSurface control_surface