|
RigsofRods
Soft-body Physics Simulation
|
Go to the documentation of this file.
33 #define CHECK_SECTION_IN_ALL_MODULES(_CLASS_, _FIELD_, _FUNCTION_) \
35 std::list<std::shared_ptr<RigDef::Document::Module>>::iterator module_itor = m_selected_modules.begin(); \
36 for (; module_itor != m_selected_modules.end(); module_itor++) \
38 std::vector<_CLASS_>::iterator section_itor = module_itor->get()->_FIELD_.begin(); \
39 for (; section_itor != module_itor->get()->_FIELD_.end(); section_itor++) \
41 if (! _FUNCTION_(*section_itor))\
43 section_itor = module_itor->get()->_FIELD_.erase(section_itor); \
44 if (section_itor == module_itor->get()->_FIELD_.end()) \
98 cm_type = RoR::Console::MessageType::CONSOLE_SYSTEM_ERROR;
103 cm_type = RoR::Console::MessageType::CONSOLE_SYSTEM_WARNING;
107 cm_type = RoR::Console::MessageType::CONSOLE_SYSTEM_NOTICE;
116 Ogre::String *containing_module_name =
nullptr;
118 std::list<std::shared_ptr<RigDef::Document::Module>>::iterator module_itor =
m_selected_modules.begin();
121 if (! module_itor->get()->submesh_groundmodel.empty())
123 if (containing_module_name ==
nullptr)
125 containing_module_name = & module_itor->get()->name;
129 std::stringstream text;
130 text <<
"Duplicate inline-section 'submesh_groundmodel'; found in modules: '"
131 << *containing_module_name <<
"' & '" << module_itor->get()->name <<
"'";
143 std::map< Ogre::String, std::shared_ptr<RigDef::Document::Module> >::iterator result
144 =
m_file->user_modules.find(module_name);
146 if (result !=
m_file->user_modules.end())
157 std::shared_ptr<RigDef::Engine> engine;
158 std::list<std::shared_ptr<RigDef::Document::Module>>::iterator module_itor =
m_selected_modules.begin();
161 if (module_itor->get()->engine.size() > 0)
163 if (module_itor->get()->engine[module_itor->get()->engine.size() - 1].gear_ratios.size() > 0)
179 std::list<Ogre::String> bad_fields;
185 bad_fields.push_back(
"spring_in_rate");
189 bad_fields.push_back(
"damping_in_rate");
193 bad_fields.push_back(
"spring_out_rate");
197 bad_fields.push_back(
"damping_out_rate");
201 bad_fields.push_back(
"spring_in_progression_factor");
205 bad_fields.push_back(
"damping_in_progression_factor");
209 bad_fields.push_back(
"spring_out_progression_factor");
213 bad_fields.push_back(
"damping_out_progression_factor");
217 bad_fields.push_back(
"max_contraction");
221 bad_fields.push_back(
"max_extension");
225 bad_fields.push_back(
"precompression");
228 if (bad_fields.size() > 0)
230 std::stringstream msg;
231 msg <<
"Invalid values in section 'shocks2', fields: ";
232 std::list<Ogre::String>::iterator itor = bad_fields.begin();
234 for( ; itor != bad_fields.end(); itor++)
236 msg << (first ?
"" :
", ") << *itor;
248 std::list<Ogre::String> bad_fields;
254 bad_fields.push_back(
"spring_in_rate");
258 bad_fields.push_back(
"damping_in_rate");
262 bad_fields.push_back(
"spring_out_rate");
266 bad_fields.push_back(
"damping_out_rate");
270 bad_fields.push_back(
"damp_in_slow");
274 bad_fields.push_back(
"split_in");
278 bad_fields.push_back(
"damp_in_fast");
282 bad_fields.push_back(
"damp_out_slow");
286 bad_fields.push_back(
"split_out");
290 bad_fields.push_back(
"damp_out_fast");
294 bad_fields.push_back(
"max_contraction");
298 bad_fields.push_back(
"max_extension");
302 bad_fields.push_back(
"precompression");
305 if (bad_fields.size() > 0)
307 std::stringstream msg;
308 msg <<
"Invalid values in section 'shocks3', fields: ";
309 std::list<Ogre::String>::iterator itor = bad_fields.begin();
311 for( ; itor != bad_fields.end(); itor++)
313 msg << (first ?
"" :
", ") << *itor;
326 unsigned int source_check = def.
flags;
348 std::stringstream msg;
349 msg <<
"Section 'commands' or 'commands2': Invalid 'extend_key': ";
358 std::stringstream msg;
359 msg <<
"Section 'commands' or 'commands2': Invalid 'contract_key': ";
375 std::stringstream msg;
376 msg <<
"Wrong parameter 'control_number' (" << def.
control_number <<
"), must be in range <-1, 500>";
383 std::stringstream msg;
384 msg <<
"Wrong parameter 'blink_delay_milis' (" << def.
blink_delay_milis <<
"), must be in range <-2, 60000>";
405 if (! trigger_blocker && ! inv_trigger_blocker && ! hook_toggle )
410 std::stringstream msg;
412 msg <<
"; Alloved range is <0 - " <<
MAX_COMMANDS <<
">. ";
413 msg <<
"Trigger deactivated.";
418 else if (! hook_toggle)
423 std::stringstream msg;
425 msg <<
"; Alloved range is <0 - " <<
MAX_COMMANDS <<
">. ";
426 msg <<
"Trigger deactivated.";
432 std::stringstream msg;
434 msg <<
"; Alloved range is <0 - " <<
MAX_COMMANDS <<
">. ";
435 msg <<
"Trigger deactivated.";
bool CheckShock2(RigDef::Shock2 &shock2)
unsigned int contract_key
static const int MAX_COMMANDS
maximum number of commands per actor
float spring_out
spring value applied when shock extending
static const BitMask_t OPTION_A_INV_TRIGGER_BLOCKER
float damp_out_fast
Damping value applied when shock is commpressing faster than split out velocity.
bool CheckFlare2(RigDef::Flare2 &def)
unsigned int texture_width
#define CHECK_SECTION_IN_ALL_MODULES(_CLASS_, _FIELD_, _FUNCTION_)
This is a raw Ogre binding for Imgui No project cmake file
bool CheckVideoCamera(RigDef::VideoCamera &def)
Section 'videocamera'.
bool CheckTrigger(RigDef::Trigger &def)
float split_vel_out
Split velocity in (m/s) - threshold for slow / fast damping during extension.
std::list< std::shared_ptr< RigDef::Document::Module > > m_selected_modules
int longbound_trigger_action
float spring_in
Spring value applied when the shock is compressing.
float precompression
Changes compression or extension of the suspension when the truck spawns. This can be used to "level"...
void putMessage(MessageArea area, MessageType type, std::string const &msg, std::string icon="")
bool CheckCommand(RigDef::Command2 &def)
void Setup(RigDef::DocumentPtr file)
Prepares the validation.
float long_bound
Maximum extension limit, in percentage ( 1.00 = 100% )
static const BitMask_t OPTION_B_TRIGGER_BLOCKER
static const BitMask_t OPTION_INVISIBLE
float damp_in
Damping value applied when the shock is compressing.
float damp_out
damping value applied when shock extending
float spring_out
Spring value applied when shock extending.
bool CheckShock3(RigDef::Shock3 &shock3)
#define BITMASK_SET_0(VAR, FLAGS)
bool CheckSectionSubmeshGroundmodel()
Inline-ection 'submesh_groundmodel', unique across all modules.
#define BITMASK_IS_0(VAR, FLAGS)
static const BitMask_t OPTION_LONG_LIMIT
unsigned int texture_height
void AddMessage(Validator::Message::Type type, Ogre::String const &text)
bool CheckAnimator(RigDef::Animator &def)
#define BITMASK_IS_1(VAR, FLAGS)
float short_bound
Maximum contraction limit, in percentage ( 1.00 = 100% )
float spring_in
Spring value applied when the shock is compressing.
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...
Central state/object manager and communications hub.
float long_bound
Maximum extension limit, in percentage ( 1.00 = 100% )
float damp_in_fast
Damping value applied when shock is commpressing faster than split in velocity.
AeroAnimator aero_animator
static const BitMask_t OPTION_s_CMD_NUM_SWITCH
float progress_factor_spring_in
Progression factor for springin. A value of 0 disables this option. 1...x as multipliers,...
int shortbound_trigger_action
static const BitMask_t OPTION_h_UNLOCKS_HOOK_GROUP
static const BitMask_t OPTION_VISIBLE
static const BitMask_t OPTION_E_ENGINE_TRIGGER
RigDef::DocumentPtr m_file
The parsed input file.
float split_vel_in
Split velocity in (m/s) - threshold for slow / fast damping during compression.
float short_bound
Maximum contraction limit, in percentage ( 1.00 = 100% )
float progress_factor_damp_in
Progression factor for dampin. 0 = disabled, 1...x as multipliers, example:maximum dampingrate == spr...
int control_number
Only 'u' type flares.
float damp_in
Damping value applied when the shock is compressing.
@ CONSOLE_MSGTYPE_ACTOR
Parsing/spawn/simulation messages for actors.
std::shared_ptr< Document > DocumentPtr
static const BitMask_t OPTION_SHORT_LIMIT
static const BitMask_t OPTION_H_LOCKS_HOOK_GROUP
bool AddModule(Ogre::String const &module_name)
Adds a vehicle module to the validated configuration.
bool CheckGearbox()
Checks there's at least 1 forward gear.
float damp_out
Damping value applied when shock extending.
float damp_in_slow
Damping value applied when shock is commpressing slower than split in velocity.
float progress_factor_damp_out
Progression factor dampout, 0 = disabled, 1...x as multipliers, example:maximum dampingrate == spring...
float damp_out_slow
Damping value applied when shock is commpressing slower than split out velocity.