38#include <OgreException.h>
39#include <OgreString.h>
40#include <OgreStringVector.h>
41#include <OgreStringConverter.h>
52 return (c ==
' ') || (c ==
'\t');
57 return IsWhitespace(c) || (c ==
':') || (c ==
'|') || (c ==
',');
62 if (s1.size() != s2.size()) {
return false; }
63 for (
size_t i = 0; i < s1.size(); ++i)
65 if (tolower(s1[i]) != tolower(s2[i])) {
return false; }
97 if (c >=
'a' && c <=
'z')
332 fmt::format(
"Not enough arguments (got {}, {} needed), skipping line",
m_num_args, min_args));
455 Ogre::StringVector tokens = Ogre::StringUtil::split(
m_current_line + 15,
",");
465 for (
unsigned int i=4; i<tokens.size(); i++)
467 Ogre::StringVector args2 = Ogre::StringUtil::split(tokens[i],
":");
468 Ogre::StringUtil::trim(args2[0]);
469 Ogre::StringUtil::toLowerCase(args2[0]);
471 if (args2[0] ==
"mode" && args2.size() == 2)
473 Ogre::StringVector attrs = Ogre::StringUtil::split(args2[1],
"&");
474 auto itor = attrs.begin();
475 auto endi = attrs.end();
476 for (; itor != endi; ++itor)
478 std::string attr = *itor;
479 Ogre::StringUtil::trim(attr);
480 Ogre::StringUtil::toLowerCase(attr);
482 else if (strncmp(attr.c_str(),
"notoggle", 8) == 0) { tc.
attr_no_toggle =
true; }
483 else if (strncmp(attr.c_str(),
"on", 2) == 0) { tc.
attr_is_on =
true; }
484 else if (strncmp(attr.c_str(),
"off", 3) == 0) { tc.
attr_is_on =
false; }
746 Ogre::StringUtil::trim(attr);
747 const bool has_value = (i < (
m_num_args - 1));
758 else if ((attr ==
"selflock") ||(attr ==
"self-lock") ||(attr ==
"self_lock") ) { hook.
flag_self_lock =
true; }
759 else if ((attr ==
"autolock") ||(attr ==
"auto-lock") ||(attr ==
"auto_lock") ) { hook.
flag_auto_lock =
true; }
760 else if ((attr ==
"nodisable")||(attr ==
"no-disable")||(attr ==
"no_disable")) { hook.
flag_no_disable =
true; }
761 else if ((attr ==
"norope") ||(attr ==
"no-rope") ||(attr ==
"no_rope") ) { hook.
flag_no_rope =
true; }
762 else if ((attr ==
"visible") ||(attr ==
"vis") ) { hook.
flag_visible =
true; }
955 std::string input = input_pos;
956 std::regex pattern(R
"((\d+)\s*-\s*(\d+)|(\d+))");
959 std::string::const_iterator searchStart(input.cbegin());
960 while (std::regex_search(searchStart, input.cend(), matches, pattern))
962 if (matches[1].matched && matches[2].matched)
965 int start = std::stoi(matches[1].str());
966 int end = std::stoi(matches[2].str());
967 for (
int i = start; i <= end; ++i)
973 else if (matches[3].matched)
976 forvert.
vert_index = std::stoi(matches[3].str());
979 searchStart = matches.suffix().first;
993 std::string line = _line;
994 char* pos = &line[0] + 6;
995 while (*pos ==
' ' || *pos ==
':' || *pos ==
',') { pos++; }
1002 while (*end !=
'-' && *end !=
',' && *end != 0) end++;
1005 val1 = strtoul(pos, 0, 10);
1010 while (*end !=
',' && *end != 0) end++;
1013 val2 = strtoul(pos, 0, 10);
1017 Node::Ref(std::to_string(val1), val1, Node::Ref::IMPORT_STATE_IS_VALID, line_number),
1018 Node::Ref(std::to_string(val2), val2, Node::Ref::IMPORT_STATE_IS_VALID, line_number)));
1052 switch (flare2.
type)
1087 switch (flare3.
type)
1191 Ogre::StringVector tokens = Ogre::StringUtil::split(
m_current_line + 14,
",");
1206 for (
auto itor = tokens.begin() + 3; itor != tokens.end(); ++itor)
1208 Ogre::StringVector entry = Ogre::StringUtil::split(*itor,
":");
1209 Ogre::StringUtil::trim(entry[0]);
1210 if (entry.size() > 1) Ogre::StringUtil::trim(entry[1]);
1212 const int WARN_LEN = 500;
1213 char warn_msg[WARN_LEN] =
"";
1215 if (entry.size() == 1)
1222 else { snprintf(warn_msg, WARN_LEN,
"Invalid keyword: %s", entry[0].c_str()); }
1224 else if (entry.size() == 2 && (entry[0] ==
"mode" || entry[0] ==
"event" || entry[0] ==
"source" || entry[0] ==
"link"))
1226 Ogre::StringVector values = Ogre::StringUtil::split(entry[1],
"|");
1227 if (entry[0] ==
"mode")
1229 for (
auto itor = values.begin(); itor != values.end(); ++itor)
1231 std::string value = *itor;
1232 Ogre::StringUtil::trim(value);
1241 else { snprintf(warn_msg, WARN_LEN,
"Invalid 'mode': %s, ignoring...", entry[1].c_str()); }
1244 else if (entry[0] ==
"event")
1247 Ogre::StringUtil::trim(animation.
event_name);
1248 Ogre::StringUtil::toUpperCase(animation.
event_name);
1250 else if (entry[0] ==
"link")
1255 else if (entry[0] ==
"source")
1257 for (
auto itor = values.begin(); itor != values.end(); ++itor)
1259 std::string value = *itor;
1260 Ogre::StringUtil::trim(value);
1305 if (entry[1].compare(0, 8,
"throttle") == 0)
1310 else if (entry[1].compare(0, 3,
"rpm") == 0)
1315 else if (entry[1].compare(0, 8,
"aerotorq") == 0)
1320 else if (entry[1].compare(0, 7,
"aeropit") == 0)
1325 else if (entry[1].compare(0, 10,
"aerostatus") == 0)
1331 else if (entry[1].compare(0, 4,
"gear") == 0)
1338 snprintf(warn_msg, WARN_LEN,
"Invalid 'source': %s, ignoring...", entry[1].c_str());
1347 snprintf(warn_msg, WARN_LEN,
"Invalid keyword: %s, ignoring...", entry[0].c_str());
1352 snprintf(warn_msg, WARN_LEN,
"Invalid item: %s, ignoring...", entry[0].c_str());
1355 if (warn_msg[0] !=
'\0')
1358 fmt::format(
"Ignoring invalid token '{}' ({})", itor->c_str(), warn_msg));
1368 Ogre::StringVector tokens = Ogre::StringUtil::split(
m_current_line + 15,
",");
1377 for (
unsigned int i=3; i<tokens.size(); i++)
1379 Ogre::StringVector args2 = Ogre::StringUtil::split(tokens[i],
":");
1380 Ogre::StringUtil::trim(args2[0]);
1381 Ogre::StringUtil::toLowerCase(args2[0]);
1382 if (args2[0] ==
"mode" && args2.size() == 2)
1384 Ogre::StringVector attrs = Ogre::StringUtil::split(args2[1],
"&");
1385 auto itor = attrs.begin();
1386 auto endi = attrs.end();
1387 for (; itor != endi; ++itor)
1389 std::string attr = *itor;
1390 Ogre::StringUtil::trim(attr);
1391 Ogre::StringUtil::toLowerCase(attr);
1393 else if (strncmp(attr.c_str(),
"notoggle", 8) == 0) { alb.
attr_no_toggle =
true; }
1394 else if (strncmp(attr.c_str(),
"on", 2) == 0) { alb.
attr_is_on =
true; }
1395 else if (strncmp(attr.c_str(),
"off", 3) == 0) { alb.
attr_is_on =
false; }
1515 fmt::format(
"Dashboard value \"{}\" has an invalid data type. Ignoring it.", dashVal.
name));
1526 const int max_args = (is_commands2 ? 8 : 7);
1560 std::string options_str = this->
GetArgStr(pos++);
1562 for (
auto itor = options_str.begin(); itor != options_str.end(); ++itor)
1564 const char c = *itor;
1565 if ((winner == 0) && (c ==
'o' || c ==
'p' || c ==
'c')) { winner = c; }
1577 fmt::format(
"ignoring unknown flag '{}'", c));
1587 char ignored =
'\0';
1600 if (ignored != 0 && winner ==
'c')
1603 "Command cannot be one-pressed and self centering at the same time, ignoring flag '%c'");
1605 else if (ignored != 0 && (winner ==
'o' || winner ==
'p'))
1608 "Command already has a one-pressed c.mode, ignoring flag '%c'");
1627 Ogre::StringVector tokens = Ogre::StringUtil::split(
m_current_line,
",");
1628 Ogre::StringVector::iterator iter = tokens.begin();
1629 for ( ; iter != tokens.end(); iter++)
1702 Ogre::StringVector tokens = Ogre::StringUtil::split(
m_current_line,
",");
1703 Ogre::StringVector::iterator iter = tokens.begin();
1704 for ( ; iter != tokens.end(); iter++)
1706 std::smatch results;
1707 if (! std::regex_search(*iter, results, Regexes::SECTION_AXLES_PROPERTY))
1714 if (results[1].matched)
1716 unsigned int wheel_index =
PARSEINT(results[2]) - 1;
1720 else if (results[5].matched)
1733 if (args.size() < 2) {
return; }
1740 std::smatch results;
1741 if (! std::regex_search(args[2], results, Regexes::SECTION_AXLES_PROPERTY))
1748 if (results[5].matched)
1915 Ogre::StringVector args = Ogre::StringUtil::split(
m_current_line,
",");
1917 if (args.size() == 1u)
1921 else if (args.size() == 2u)
1969 fmt::format(
"ignoring invalid option '{}'", c));
2003 if (soundsource2.
mode < -2)
2006 fmt::format(
"invalid mode {}, falling back to default -2", soundsource2.
mode));
2007 soundsource2.
mode = -2;
2016 Ogre::StringVector args = Ogre::StringUtil::split(
m_current_line,
", ");
2023 bool in_rail_node_list =
true;
2025 for (
auto itor = args.begin() + 1; itor != args.end(); ++itor)
2027 char c = toupper(itor->at(0));
2033 in_rail_node_list =
false;
2038 in_rail_node_list =
false;
2043 in_rail_node_list =
false;
2048 in_rail_node_list =
false;
2053 in_rail_node_list =
false;
2058 in_rail_node_list =
false;
2061 switch (itor->at(1))
2077 fmt::format(
"Ignoring invalid option '{}'", itor->at(1)));
2080 in_rail_node_list =
false;
2083 if (in_rail_node_list)
2177 int node_id_num =
PARSEINT(node_id_str);
2178 if (node_id_num < 0)
2184 unsigned int flags = Node::Ref::IMPORT_STATE_IS_VALID |
2185 Node::Ref::REGULAR_STATE_IS_VALID | Node::Ref::REGULAR_STATE_IS_NAMED;
2188 flags |= Node::Ref::IMPORT_STATE_MUST_CHECK_NAMED_FIRST;
2228 LOG(fmt::format(
"[RoR|RigDef::Parser] parsed FlaregroupNoImport ({} {})", (
char)fni.
type, fni.
control_number));
2237 float stop_delay = 0;
2240 if (start_delay < 0 || stop_delay < 0)
2340 Ogre::StringUtil::trim(fileinfo.
unique_id);
2382 Ogre::StringVector args = Ogre::StringUtil::split(
m_current_line,
",");
2389 for (
auto itor = args.begin() + 1; itor != args.end(); itor++)
2477 int comment_start =
static_cast<int>(line_in.find_first_of(
";"));
2478 if (comment_start != Ogre::String::npos)
2480 line_out = line_in.substr(0, comment_start);
2484 comment_start =
static_cast<int>(line_in.find_last_of(
"/"));
2485 if (comment_start != Ogre::String::npos)
2487 while (comment_start >= 0)
2489 char c = line_in[comment_start - 1];
2490 if (c !=
'/' && c !=
' ' && c !=
'\t')
2496 line_out = line_in.substr(0, comment_start);
2515 std::string node_name = this->
GetArgStr(0);
2525 const unsigned int node_num = this->
GetArgUint(0);
2550 "Node has load-weight-override value specified, but option 'l' is not present. Ignoring value...");
2703 for (
char c: options_str)
2716 fmt::format(
"ignoring invalid differential type '{}'", c));
2736 float support_break_limit = 0.0f;
2737 float support_break_factor = this->
GetArgInt(3);
2738 if (support_break_factor > 0.0f)
2740 support_break_limit = support_break_factor;
2753 if (args.size() < 4) {
return; }
2765 Ogre::StringVector attrs = Ogre::StringUtil::split(args[3],
"|");
2767 auto itor = attrs.begin();
2768 auto endi = attrs.end();
2769 for (; itor != endi; ++itor)
2771 Ogre::String token = *itor;
2772 Ogre::StringUtil::trim(token);
2773 std::smatch results;
2774 bool is_shortlimit =
false;
2777 if (std::regex_search(token, results, Regexes::PARSE_ANIMATORS_NUMBERED_KEYWORD))
2787 else if ((is_shortlimit = (token.compare(0, 10,
"shortlimit") == 0)) || (token.compare(0, 9,
"longlimit") == 0))
2789 Ogre::StringVector fields = Ogre::StringUtil::split(token,
":");
2790 if (fields.size() > 1)
2794 animator.
short_limit = std::strtod(fields[1].c_str(),
nullptr);
2799 animator.
long_limit = std::strtod(fields[1].c_str(),
nullptr);
2865 fmt::format(
"{}:{} ({}): {}",
2872 std::smatch results;
2873 std::regex_search(line, results, Regexes::IDENTIFY_KEYWORD_IGNORE_CASE);
2877 for (
unsigned int i = 1; i < results.size(); i++)
2879 std::ssub_match sub = results[i];
2951 std::string new_module_name;
2985 auto search_itor =
m_definition->user_modules.find(new_module_name);
3033 return std::string(
m_args[index].start,
m_args[index].length);
3046 case (
char)WheelSide::RIGHT:
3047 case (
char)WheelSide::LEFT:
3052 fmt::format(
"Bad arg~{} 'side' (value: {}), parsing as 'l' for backwards compatibility.", index + 1, c));
3053 return WheelSide::LEFT;
3060 char* out_end =
nullptr;
3061 long res = std::strtol(
m_args[index].start, &out_end, 10);
3065 fmt::format(
"Cannot parse argument [{}] as integer, errno: {}", index + 1, errno));
3068 if (out_end ==
m_args[index].start)
3071 fmt::format(
"Argument [{}] is not valid integer", index + 1));
3074 else if (out_end != (
m_args[index].start +
m_args[index].length))
3077 fmt::format(
"Integer argument [{}] has invalid trailing characters", index + 1));
3084 return static_cast<int>(this->
GetArgLong(index));
3089 std::string rigidity_node = this->
GetArgStr(index);
3090 if (rigidity_node !=
"9999")
3102 case (
int)WheelPropulsion::NONE:
3103 case (
int)WheelPropulsion::FORWARD:
3104 case (
int)WheelPropulsion::BACKWARD:
3109 fmt::format(
"Bad value of param ~{} (propulsion), using 0 (no propulsion)", index + 1));
3110 return WheelPropulsion::NONE;
3119 case (
int)WheelBraking::NONE:
3120 case (
int)WheelBraking::FOOT_HAND:
3121 case (
int)WheelBraking::FOOT_HAND_SKID_LEFT:
3122 case (
int)WheelBraking::FOOT_HAND_SKID_RIGHT:
3123 case (
int)WheelBraking::FOOT_ONLY:
3128 fmt::format(
"Bad value of param ~{} (braking), using 0 (not braked)", index + 1));
3129 return WheelBraking::NONE;
3140 if (! (Ogre::StringConverter::parseReal(this->
GetArgStr(index)) == -1.f))
3149 return static_cast<unsigned>(this->
GetArgLong(index));
3158 case (
char)FlareType::HEADLIGHT:
3159 case (
char)FlareType::HIGH_BEAM:
3160 case (
char)FlareType::FOG_LIGHT:
3162 case (
char)FlareType::TAIL_LIGHT:
3163 case (
char)FlareType::BRAKE_LIGHT:
3164 case (
char)FlareType::REVERSE_LIGHT:
3166 case (
char)FlareType::SIDELIGHT:
3167 case (
char)FlareType::BLINKER_LEFT:
3168 case (
char)FlareType::BLINKER_RIGHT:
3169 case (
char)FlareType::USER:
3170 case (
char)FlareType::DASHBOARD:
3175 fmt::format(
"Invalid flare type '{}', falling back to type 'f' (front light)...", in));
3176 return FlareType::HEADLIGHT;
3182 std::string str = this->
GetArgStr(index);
3183 if (str ==
"classic")
return ExtCameraMode::CLASSIC;
3184 if (str ==
"cinecam")
return ExtCameraMode::CINECAM;
3185 if (str ==
"node")
return ExtCameraMode::NODE;
3188 fmt::format(
"Invalid ExtCameraMode '{}', falling back to type 'classic'...", str));
3189 return ExtCameraMode::CLASSIC;
3194 return (
float) Ogre::StringConverter::parseReal(this->
GetArgStr(index), 0.f);
3199 return (
float) Ogre::StringConverter::parseReal(str, 0.f);
3210 long res = std::strtol(str,
nullptr, 10);
3214 fmt::format(
"Cannot parse argument '{}' as int, errno: {}", str, errno));
3217 return static_cast<unsigned>(res);
3232 return Ogre::StringConverter::parseBool(this->
GetArgStr(index));
3259 fmt::format(
"invalid WingControlSurface '{}', falling back to 'n' (none)", c);
3266 std::string tex_name = this->
GetArgStr(index);
3267 return (tex_name.at(0) !=
'-') ? tex_name :
"";
3282 fmt::format(
"Not a valid minimass option: {}, falling back to 'n' (dummy)", this->
GetArgStr(index)));
3307 fmt::format(
"ignoring invalid flag '{}'", c));
3334 fmt::format(
"ignoring invalid option '{}'", c));
3355 fmt::format(
"ignoring invalid option '{}'", c));
3393 fmt::format(
"ignoring invalid option '{}'", c));
3417 fmt::format(
"ignoring invalid option '{}'", c));
3440 fmt::format(
"ignoring invalid option '{}'", c));
3462 fmt::format(
"ignoring invalid option '{}'", c));
3491 fmt::format(
"ignoring invalid option '{}'", c));
3515 std::string str = this->
GetArgStr(index);
3516 if (str ==
"bool")
return DC_BOOL;
3517 if (str ==
"int")
return DC_INT;
3518 if (str ==
"float")
return DC_FLOAT;
3519 if (str ==
"string")
return DC_CHAR;
3522 fmt::format(
"Not a valid dashboard input data type: '{}'", str));
3537 fmt::format(
"invalid EngineType '{}', falling back to 't' (truck)", c);
3544 std::string str = this->
GetArgStr(index);
3551 fmt::format(
"Not a valid ManagedMaterialType: '{}'", str));
3566 fmt::format(
"Invalid value of 'camera role' ({}), videocamera will not work", role));
3579 if ((arg_len == 0) && is_arg)
3584 else if ((arg_len > 0) && !is_arg)
3612 while (!stream->eof())
3619 catch (Ogre::Exception &ex)
3622 fmt::format(
"Could not read truck file: {}", ex.getFullDescription()));
3632 const char* raw_start = raw_line_buf;
3636 while (
IsWhitespace(*raw_start) && (raw_start != raw_end))
3642 if (raw_start == raw_end)
3649 if ((*raw_start ==
';') || (*raw_start ==
'/'))
3660 utf8::replace_invalid(raw_start, raw_end, out_start,
'?');
Central state/object manager and communications hub.
void LOG(const char *msg)
Legacy alias - formerly a macro.
#define BITMASK_IS_1(VAR, FLAGS)
#define BITMASK_SET_1(VAR, FLAGS)
A database of user-installed content alias 'mods' (vehicles, terrains...)
Data structures representing 'truck' file format, see https://docs.rigsofrods.org/vehicle-creation/fi...
Checks the rig-def file syntax and loads data to memory.
Defines regular expressions to verify and pull data from rig-def file. 'E' stands for Expression.
void SetNum(unsigned int id_num)
void setStr(std::string const &id_str)
Legacy parser resolved references on-the-fly and the condition to check named nodes was "are there an...
bool IsValidAnyState() const
char m_current_line[LINE_BUFFER_LENGTH]
int ParseArgInt(const char *str)
void ParseManagedMaterials()
bool GetArgBool(int index)
BitMask_t GetArgBeamOptions(int index)
RigDef::DocumentPtr m_definition
std::shared_ptr< DefaultMinimass > m_set_default_minimass
void ParseRotatorsUnified()
int m_current_detacher_group
void ParseTractionControl()
Ogre::String m_resource_group
void ParseDirectiveSetDefaultMinimass()
std::shared_ptr< NodeDefaults > m_ror_node_defaults
void ParseMaterialFlareBindings()
BitMask_t GetArgShock3Options(int index)
static const int LINE_MAX_ARGS
void ParseWheelDetachers()
WingControlSurface GetArgWingSurface(int index)
std::shared_ptr< Inertia > m_ror_default_inertia
RoR::VideoCamRole GetArgVideoCamRole(int index)
Node::Ref GetArgRigidityNode(int index)
RoR::WheelBraking GetArgBraking(int index)
Node::Ref _ParseNodeRef(std::string const &node_id_str)
void ParseCustomDashboardInputs()
void ParseDirectiveSetInertiaDefaults()
BitMask_t GetArgShockOptions(int index)
Token m_args[LINE_MAX_ARGS]
Tokens of current line.
void ParseAntiLockBrakes()
std::shared_ptr< Document::Module > m_root_module
std::shared_ptr< Submesh > m_current_submesh
Parser state.
void ParseCruiseControl()
void ParseDirectiveForvert()
void ParseDirectivePropCameraMode()
Node::Ref GetArgNodeRef(int index)
MinimassOption GetArgMinimassOption(int index)
void BeginBlock(RigDef::Keyword keyword)
static const int LINE_BUFFER_LENGTH
void ParseDirectiveSetManagedMaterialsOptions()
RoR::FlareType GetArgFlareType(int index)
bool m_any_named_node_defined
Parser state.
static void ProcessForsetLine(RigDef::Flexbody &def, const std::string &line, int line_number=-1)
std::string GetArgStr(int index)
int GetArgDashboardInputDataType(int index)
void ParseFlexBodyWheel()
void ParseDirectiveSetBeamDefaultsScale()
unsigned int m_current_line_number
unsigned GetArgUint(int index)
void ParseDirectiveDefaultSkin()
RoR::WheelSide GetArgWheelSide(int index)
ManagedMaterialType GetArgManagedMatType(int index)
void ParseDirectiveSubmesh()
ManagedMaterialsOptions m_current_managed_material_options
void ParseDirectiveBackmesh()
EngineType GetArgEngineType(int index)
BitMask_t GetArgNodeOptions(int index)
static SpecialProp IdentifySpecialProp(const std::string &str)
long GetArgLong(int index)
bool CheckNumArguments(int num_required_args)
void ParseSetSkeletonSettings()
void _ParseBaseMeshWheel(BaseMeshWheel &mesh_wheel)
void ProcessGlobalDirective(Keyword keyword)
Directives that should only appear in root module.
std::string GetArgManagedTex(int index)
float ParseArgFloat(const char *str)
std::shared_ptr< Document::Module > m_current_module
void LogMessage(RoR::Console::MessageType type, std::string const &msg)
Adds a message to console.
void ProcessCurrentLine()
std::shared_ptr< CameraRail > m_current_camera_rail
Parser state.
std::shared_ptr< BeamDefaults > m_user_beam_defaults
void ParseDirectiveAddAnimation()
void ParseFileFormatVersion()
void ParseDirectiveSectionConfig()
RoR::WheelPropulsion GetArgPropulsion(int index)
SequentialImporter m_sequential_importer
BitMask_t GetArgCabOptions(int index)
static Keyword IdentifyKeyword(const std::string &line)
int TokenizeCurrentLine()
void ParseCommandsUnified()
std::shared_ptr< NodeDefaults > m_user_node_defaults
int m_num_args
Number of tokens on current line.
void ParseFlaregroupsNoImport()
std::shared_ptr< Inertia > m_user_default_inertia
void ParseDirectiveFlexbodyCameraMode()
static void _TrimTrailingComments(std::string const &line_in, std::string &line_out)
void ParseDirectiveSetBeamDefaults()
void ParseFlaresUnified()
void ParseOptionalInertia(Inertia &inertia, int index)
void ParseSoundsources2()
void ParseSubmeshGroundModel()
RoR::ExtCameraMode GetArgExtCameraMode(int index)
void ProcessRawLine(const char *line)
char GetArgChar(int index)
BitMask_t GetArgTriggerOptions(int index)
void ParseSetCollisionRange()
DocComment m_pending_doc_comment
To be linked with the following element.
unsigned ParseArgUint(const char *str)
BitMask_t GetArgHydroOptions(int index)
BitMask_t GetArgShock2Options(int index)
void ProcessChangeModuleLine(Keyword keyword)
void ParseTurbopropsUnified()
float GetArgFloat(int index)
void ProcessOgreStream(Ogre::DataStream *stream, Ogre::String resource_group)
void ParseDirectiveForset()
void ParseDirectiveSection()
void FlushPendingDocComment(size_t vectorlen, RigDef::Keyword keyword)
void ParseDirectiveSetNodeDefaults()
void ParseDirectiveDetacherGroup()
void _ParseDifferentialTypes(DifferentialTypeVec &diff_types, std::string const &options_str)
Node::Ref GetArgNullableNode(int index)
bool AddNamedNode(std::string const &name)
void AddGeneratedNode(Keyword generated_from, NodeMapEntry::OriginDetail detail=NodeMapEntry::DETAIL_UNDEFINED)
void Process(RigDef::DocumentPtr def)
Traverse whole rig definition and resolve all node references.
void GenerateNodesForWheel(Keyword generated_from, int num_rays, bool has_rigidity_node)
bool AddNumberedNode(unsigned int number)
@ CONSOLE_MSGTYPE_ACTOR
Parsing/spawn/simulation messages for actors.
void putMessage(MessageArea area, MessageType type, std::string const &msg, std::string icon="")
const char * KeywordToString(RigDef::Keyword keyword)
@ SLIDENODE_CONNECT_INSTANTLY
@ SET_BEAM_DEFAULTS_SCALE
@ ENABLE_ADVANCED_DEFORMATION
@ SET_MANAGEDMATERIALS_OPTIONS
@ LOCKGROUP_DEFAULT_NOLOCK
static const float BEAM_SKELETON_DIAMETER
static const float DEFAULT_SPRING
static const float DEFAULT_BEAM_DIAMETER
5 centimeters default beam width
static const float BEAM_DEFORM
static const float DEFAULT_DAMP
static const float BEAM_PLASTIC_COEF_DEFAULT
static const float BEAM_BREAK
const char * ROOT_MODULE_NAME
@ M_ABSOLUTE_METRIC
Absolute metric values for shortbound/longbound, settings apply without regarding to the original len...
@ m_METRIC
metric values for shortbound/longbound applying to the length of the beam.
@ 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,...
@ S_RIGHT_HAND_STABILATOR
std::vector< DifferentialType > DifferentialTypeVec
@ l_SKIP_LOADED
Only apply minimum mass to nodes without "L" option.
std::shared_ptr< Document > DocumentPtr
bool IsWhitespace(char c)
@ s_SOFT_BUMP_BOUNDS
soft bump boundaries, use when shocks reach limiters too often and "jumprebound" (default is hard bum...
@ M_ABSOLUTE_METRIC
Absolute metric values for shortbound/longbound, settings apply without regarding to the original len...
@ m_METRIC
metric values for shortbound/longbound applying to the length of the beam.
@ v_INPUT_InvAILERON_ELEVATOR
@ h_INPUT_InvELEVATOR_RUDDER
@ g_INPUT_ELEVATOR_RUDDER
@ u_INPUT_AILERON_ELEVATOR
@ i_INVISIBLE_INPUT_NORMAL
For backwards compatibility; combines flags 'j' and 'n'.
@ y_INPUT_InvAILERON_RUDDER
@ s_DISABLE_ON_HIGH_SPEED
bool StrEqualsNocase(std::string const &s1, std::string const &s2)
WheelSide
Used by rig-def/addonpart/tuneup formats to specify wheel rim mesh orientation.
@ VCAM_ROLE_MIRROR
Flips the video output and when not in driver cam, acts like a natural mirror, not a screen.
@ VCAM_ROLE_TRACKING_VIDEOCAM
@ VCAM_ROLE_MIRROR_NOFLIP
Same as VCAM_ROLE_MIRROR, but without flipping the texture horizontally (expects texcoords to be alre...
static const BitMask_t OPTION_THROTTLE
static const BitMask_t OPTION_RPM
static const BitMask_t OPTION_TORQUE
static const BitMask_t OPTION_PITCH
static const BitMask_t OPTION_STATUS
float max_inclination_angle
static const BitMask_t SOURCE_AERO_PITCH
static const BitMask_t SOURCE_AERO_STATUS
static const BitMask_t SOURCE_AERO_RPM
static const BitMask_t SOURCE_AERO_TORQUE
static const BitMask_t SOURCE_AERO_THROTTLE
static const BitMask_t SOURCE_GEAR_FORWARD
static const BitMask64_t SOURCE_GEAR_REVERSE
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 BitMask64_t SOURCE_AUTOSHIFTERLIN
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
Ogre::String dash_link_name
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_IGNITION
static const BitMask64_t SOURCE_AIR_BRAKE
static const BitMask64_t SOURCE_GEAR_NEUTRAL
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
std::list< MotorSource > motor_sources
static const BitMask64_t SOURCE_BRAKES
static const BitMask64_t SOURCE_TORQUE
static const BitMask_t MODE_ROTATION_Z
static const BitMask64_t SOURCE_DASHBOARD
static const BitMask64_t SOURCE_EVENT
static const BitMask64_t SOURCE_HEADING
static const BitMask64_t SOURCE_SIGNALSTALK
static const BitMask_t OPTION_ALTIMETER_100K
static const BitMask_t OPTION_ALTIMETER_1K
static const BitMask_t OPTION_SPEEDO
static const BitMask_t OPTION_ACCEL
static const BitMask_t OPTION_AIR_BRAKE
static const BitMask_t OPTION_ANGLE_OF_ATTACK
static const BitMask_t OPTION_BOAT_RUDDER
static const BitMask_t OPTION_ROLL
static const BitMask_t OPTION_SEQUENTIAL_SHIFT
static const BitMask_t OPTION_PARKING
static const BitMask_t OPTION_VISIBLE
static const BitMask_t OPTION_TURBO
static const BitMask_t OPTION_SHIFT_BACK_FORTH
static const BitMask_t OPTION_PITCH
AeroAnimator aero_animator
static const BitMask_t OPTION_AIRSPEED
std::shared_ptr< Inertia > inertia_defaults
static const BitMask_t OPTION_BOAT_THROTTLE
static const BitMask_t OPTION_SHORT_LIMIT
static const BitMask_t OPTION_ALTIMETER_10K
static const BitMask_t OPTION_VERTICAL_VELOCITY
static const BitMask_t OPTION_FLAP
std::shared_ptr< BeamDefaults > beam_defaults
static const BitMask_t OPTION_DIFFLOCK
static const BitMask_t OPTION_BRAKES
static const BitMask_t OPTION_TORQUE
static const BitMask_t OPTION_SHIFT_LEFT_RIGHT
static const BitMask_t OPTION_LONG_LIMIT
static const BitMask_t OPTION_INVISIBLE
static const BitMask_t OPTION_CLUTCH
static const BitMask_t OPTION_GEAR_SELECT
static const BitMask_t OPTION_TACHO
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
bool _is_plastic_deform_coef_user_defined
Ogre::String beam_material_name
float plastic_deform_coef
float visual_beam_diameter
float deformation_threshold
bool _is_user_defined
Informs whether these data were read from "set_beam_defaults" directive or filled in by the parser on...
bool _enable_advanced_deformation
Informs whether "enable_advanced_deformation" directive preceded these defaults.
float deformation_threshold_constant
float breaking_threshold_constant
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::shared_ptr< BeamDefaults > beam_defaults
std::shared_ptr< NodeDefaults > node_defaults
std::vector< Node::Ref > nodes
float node_collision_range
std::shared_ptr< Inertia > inertia_defaults
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
std::vector< float > gear_ratios
float post_shift_time
Seconds.
float clutch_time
Seconds.
Ogre::String particle_name
std::shared_ptr< Inertia > inertia_defaults
Ogre::String material_name
int control_number
Only 'u' type flares.
std::string dashboard_link
Only 'd' type flares.
int control_number
Only 'u' type flares.
Ogre::String tyre_mesh_name
Ogre::String rim_mesh_name
std::vector< Node::Range > node_list_to_import
Manually specified (vert => node) bindings for flexbody deformation (overrides 'forset').
Ogre::String airfoil_name
Ogre::String material_name
float option_min_range_meters
static const BitMask_t OPTION_e_INPUT_ELEVATOR
std::shared_ptr< Inertia > inertia_defaults
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
ManagedMaterialsOptions options
Ogre::String specular_map
Ogre::String damaged_diffuse_map
Ogre::String material_name
unsigned int flare_number
float global_min_mass_Kg
minimum node mass in Kg - only effective where DefaultMinimass was not set.
std::shared_ptr< BeamDefaults > beam_defaults
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
Node::Ref blade_tip_nodes[4]
Ogre::String flare_material_name
DashboardSpecial special_prop_dashboard
BeaconSpecial special_prop_beacon
std::vector< Node::Range > node_list
std::shared_ptr< BeamDefaults > beam_defaults
std::shared_ptr< Inertia > inertia_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::shared_ptr< BeamDefaults > beam_defaults
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
std::shared_ptr< BeamDefaults > beam_defaults
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
Ogre::String face_material_name
Ogre::String band_material_name
Ogre::String band_material_name
Ogre::String face_material_name
WingControlSurface control_surface