RigsofRods
Soft-body Physics Simulation
RigDef_Serializer.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-2020 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 
25 
26 #include "RigDef_Serializer.h"
27 
28 #include "Actor.h"
29 #include "RigDef_File.h"
30 
31 #include <fstream>
32 #include <OgreStringConverter.h>
33 #include <iomanip>
34 
35 using namespace RoR;
36 using namespace RigDef;
37 using namespace std;
38 
39 Serializer::Serializer(RigDef::DocumentPtr def_file, Ogre::String const & file_path):
40  m_file_path(file_path),
41  m_rig_def(def_file),
42  m_node_id_width(5),
43  m_float_precision(6),
44  m_inertia_function_width(10),
45  m_bool_width(5), // strlen("false") == 5
46  m_command_key_width(2),
47  m_float_width(10)
48 {}
49 
51 {}
52 
54 {
55  // Open file
56  m_stream.open(m_file_path);
57  m_stream.precision(m_float_precision); // Permanent
58 
59  // Write header
60  m_stream << m_rig_def->name << endl << endl;
61 
62  // Write banner
63  m_stream
64  << "; ---------------------------------------------------------------------------- ;" << endl
65  << "; Rigs of Rods project (www.rigsofrods.org) ;" << endl
66  << "; ========================================= ;" << endl
67  << "; ;" << endl
68  << "; This is a rig definition file. ;" << endl
69  << "; See http://www.rigsofrods.org/wiki/pages/Truck_Description_File for details. ;" << endl
70  << "; ---------------------------------------------------------------------------- ;" << endl
71  << endl;
72 
73  // Select source
74  Document::Module* source_module = m_rig_def->root_module.get();
75 
76  // Write individual elements
77 
78  // About
79  ProcessDescription(source_module);
80  ProcessAuthors(source_module);
81  ProcessGlobals(source_module);
82  ProcessFileinfo(source_module);
83  ProcessGuid(source_module);
84  WriteFlags();
85  ProcessManagedMaterialsAndOptions(source_module);
86 
87  // Structure
88  ProcessNodes(source_module);
89  ProcessBeams(source_module);
90  ProcessShocks(source_module);
91  ProcessShocks2(source_module);
92  ProcessHydros(source_module);
93  ProcessCommands2(source_module);
94  ProcessSlideNodes(source_module);
95  ProcessTies(source_module);
96  ProcessRopes(source_module);
97  ProcessFixes(source_module);
98 
99  // Wheels
100  ProcessMeshWheels(source_module);
101  ProcessMeshWheels2(source_module);
102  ProcessWheels(source_module);
103  ProcessWheels2(source_module);
104  ProcessFlexBodyWheels(source_module);
105 
106  // Driving
107  ProcessEngine(source_module);
108  ProcessEngoption(source_module);
109  ProcessBrakes(source_module);
110  ProcessAntiLockBrakes(source_module);
111  ProcessTractionControl(source_module);
112  ProcessTorqueCurve(source_module);
113  ProcessCruiseControl(source_module);
114  ProcessSpeedLimiter(source_module);
115  ProcessAxles(source_module);
116  ProcessTransferCase(source_module);
117  ProcessInterAxles(source_module);
118 
119  // Features
120  ProcessCinecam(source_module);
121  ProcessAnimators(source_module);
122  ProcessContacters(source_module);
123  ProcessTriggers(source_module);
124  ProcessLockgroups(source_module);
125  ProcessHooks(source_module);
126  ProcessRailGroups(source_module);
127  ProcessRopables(source_module);
128  ProcessParticles(source_module);
129  ProcessCollisionBoxes(source_module);
130  // TODO: detacher_group
131  ProcessFlares2(source_module);
132  ProcessMaterialFlareBindings(source_module);
133  ProcessPropsAndAnimations(source_module);
134  ProcessSubmesh(source_module);
135  ProcessSubmeshGroundmodel(source_module);
136  ProcessExhausts(source_module);
137  ProcessGuiSettings(source_module);
138  ProcessSetSkeletonSettings(source_module);
139  ProcessVideocamera(source_module);
140  ProcessExtCamera(source_module);
141  ProcessSoundsources(source_module);
142  ProcessSoundsources2(source_module);
143 
144  // Aerial
145  ProcessWings(source_module);
146  ProcessAirbrakes(source_module);
147  ProcessTurboprops(source_module);
148  ProcessFusedrag(source_module);
149  ProcessPistonprops(source_module);
150  ProcessTurbojets(source_module);
151 
152  // Marine
153  ProcessScrewprops(source_module);
154 
155  // Finalize
156  m_stream << "end" << endl;
157  m_stream.close();
158 }
159 
161 {
162  if (module->pistonprops.empty())
163  {
164  return;
165  }
166  m_stream << "pistonprops" << endl;
167  auto end_itor = module->pistonprops.end();
168  for (auto itor = module->pistonprops.begin(); itor != end_itor; ++itor)
169  {
170  auto & def = *itor;
171 
172  m_stream << "\n\t" << def.reference_node.ToString()
173  << ", " << def.axis_node.ToString()
174  << ", " << def.blade_tip_nodes[0].ToString()
175  << ", " << def.blade_tip_nodes[1].ToString()
176  << ", " << def.blade_tip_nodes[2].ToString()
177  << ", " << def.blade_tip_nodes[3].ToString()
178  << ", " << (def.couple_node.IsValidAnyState() ? def.couple_node.ToString() : "-1")
179  << ", " << def.turbine_power_kW
180  << ", " << def.pitch
181  << ", " << def.airfoil;
182  }
183  m_stream << endl << endl; // Empty line
184 }
185 
187 {
188  if (module->turbojets.empty())
189  {
190  return;
191  }
192  m_stream << "turbojets" << endl;
193  auto end_itor = module->turbojets.end();
194  for (auto itor = module->turbojets.begin(); itor != end_itor; ++itor)
195  {
196  auto & def = *itor;
197 
198  m_stream << "\n\t" << def.front_node.ToString()
199  << ", " << def.back_node.ToString()
200  << ", " << def.side_node.ToString()
201  << ", " << def.is_reversable
202  << ", " << def.dry_thrust
203  << ", " << def.wet_thrust
204  << ", " << def.front_diameter
205  << ", " << def.back_diameter
206  << ", " << def.nozzle_length;
207  }
208  m_stream << endl << endl; // Empty line
209 }
210 
212 {
213  if (module->screwprops.empty())
214  {
215  return;
216  }
217  m_stream << "screwprops" << endl;
218  auto end_itor = module->screwprops.end();
219  for (auto itor = module->screwprops.begin(); itor != end_itor; ++itor)
220  {
221  auto & def = *itor;
222 
223  m_stream << "\n\t" << def.prop_node.ToString()
224  << ", " << def.back_node.ToString()
225  << ", " << def.top_node.ToString()
226  << ", " << def.power;
227  }
228  m_stream << endl << endl; // Empty line
229 }
230 
232 {
233 
234  m_stream << ";fusedrag -- STUB" << endl;
235 
236  m_stream << endl << endl; // Empty line
237 }
238 
240 {
241  if (module->turboprops2.empty())
242  {
243  return;
244  }
245  m_stream << "turboprops" << endl;
246  auto end_itor = module->turboprops2.end();
247  for (auto itor = module->turboprops2.begin(); itor != end_itor; ++itor)
248  {
249  RigDef::Turboprop2 & def = *itor;
250 
251  m_stream << "\n\t" << def.reference_node.ToString()
252  << ", " << def.axis_node.ToString()
253  << ", " << def.blade_tip_nodes[0].ToString()
254  << ", " << def.blade_tip_nodes[1].ToString()
255  << ", " << def.blade_tip_nodes[2].ToString()
256  << ", " << def.blade_tip_nodes[3].ToString()
257  << ", " << def.turbine_power_kW
258  << ", " << def.airfoil;
259  }
260  m_stream << endl << endl; // Empty line
261 }
262 
264 {
265  if (module->airbrakes.empty())
266  {
267  return;
268  }
269  m_stream << "airbrakes" << endl;
270  auto end_itor = module->airbrakes.end();
271  for (auto itor = module->airbrakes.begin(); itor != end_itor; ++itor)
272  {
273  RigDef::Airbrake & def = *itor;
274 
275  m_stream << "\n\t" << def.reference_node.ToString()
276  << ", " << def.x_axis_node.ToString()
277  << ", " << def.y_axis_node.ToString()
278  << ", " << (def.aditional_node.IsValidAnyState() ? def.aditional_node.ToString() : "-1")
279  << ", " << def.offset.x
280  << ", " << def.offset.y
281  << ", " << def.offset.z
282  << ", " << def.width
283  << ", " << def.height
284  << ", " << def.max_inclination_angle
285  << ", " << def.texcoord_x1
286  << ", " << def.texcoord_y1
287  << ", " << def.texcoord_x2
288  << ", " << def.texcoord_y2
289  << ", " << def.lift_coefficient;
290  }
291  m_stream << endl << endl; // Empty line
292 }
293 
295 {
296  if (module->wings.empty())
297  {
298  return;
299  }
300  m_stream << "wings" << endl;
301  auto end_itor = module->wings.end();
302  for (auto itor = module->wings.begin(); itor != end_itor; ++itor)
303  {
304  RigDef::Wing & def = *itor;
305 
306  m_stream << "\n\t" << def.nodes[0].ToString()
307  << ", " << def.nodes[1].ToString()
308  << ", " << def.nodes[2].ToString()
309  << ", " << def.nodes[3].ToString()
310  << ", " << def.nodes[4].ToString()
311  << ", " << def.nodes[5].ToString()
312  << ", " << def.nodes[6].ToString()
313  << ", " << def.nodes[7].ToString()
314  << ", " << def.tex_coords[0]
315  << ", " << def.tex_coords[1]
316  << ", " << def.tex_coords[2]
317  << ", " << def.tex_coords[3]
318  << ", " << def.tex_coords[4]
319  << ", " << def.tex_coords[5]
320  << ", " << def.tex_coords[6]
321  << ", " << def.tex_coords[7]
322  << ", " << (char)def.control_surface
323  << ", " << def.chord_point
324  << ", " << def.min_deflection
325  << ", " << def.max_deflection
326  << ", " << def.airfoil
327  << ", " << def.efficacy_coef;
328  }
329  m_stream << endl << endl; // Empty line
330 }
331 
333 {
334  if (module->soundsources.empty())
335  {
336  return;
337  }
338  m_stream << "soundsources" << endl;
339  auto end_itor = module->soundsources.end();
340  for (auto itor = module->soundsources.begin(); itor != end_itor; ++itor)
341  {
342  RigDef::SoundSource & def = *itor;
343 
344  m_stream << "\n\t" << def.node.ToString() << ", " << def.sound_script_name;
345  }
346  m_stream << endl << endl; // Empty line
347 }
348 
350 {
351  if (module->soundsources2.empty())
352  {
353  return;
354  }
355  m_stream << "soundsources2" << endl;
356  auto end_itor = module->soundsources2.end();
357  for (auto itor = module->soundsources2.begin(); itor != end_itor; ++itor)
358  {
359  RigDef::SoundSource2 & def = *itor;
360 
361  m_stream << "\n\t" << def.node.ToString()
362  << ", " << def.mode
363  << ", " << def.sound_script_name;
364  }
365  m_stream << endl << endl; // Empty line
366 }
367 
369 {
370  if (module->extcamera.size() == 0)
371  {
372  return;
373  }
374  RigDef::ExtCamera* def = &module->extcamera[0];
375  m_stream << "extcamera ";
376 
377  switch (def->mode)
378  {
379  case ExtCameraMode::NODE:
380  m_stream << "node " << def->node.ToString();
381  break;
382  case ExtCameraMode::CINECAM:
383  m_stream << "cinecam";
384  break;
385  case ExtCameraMode::CLASSIC:
386  default:
387  m_stream << "classic";
388  break;
389  }
390  m_stream << "\n\n";
391 }
392 
394 {
395  if (module->videocameras.empty())
396  {
397  return;
398  }
399  m_stream << "videocamera" << endl;
400  auto end_itor = module->videocameras.end();
401  for (auto itor = module->videocameras.begin(); itor != end_itor; ++itor)
402  {
403  RigDef::VideoCamera & def = *itor;
404 
405  m_stream << "\n\t" << def.reference_node.ToString()
406  << ", " << def.left_node.ToString()
407  << ", " << def.bottom_node.ToString()
408  << ", " << (def.alt_reference_node.IsValidAnyState() ? def.alt_reference_node.ToString() : "-1")
409  << ", " << (def.alt_orientation_node.IsValidAnyState() ? def.alt_orientation_node.ToString() : "-1")
410  << ", " << def.offset.x
411  << ", " << def.offset.y
412  << ", " << def.offset.z
413  << ", " << def.rotation.x
414  << ", " << def.rotation.y
415  << ", " << def.rotation.z
416  << ", " << def.field_of_view
417  << ", " << def.texture_width
418  << ", " << def.texture_height
419  << ", " << def.min_clip_distance
420  << ", " << def.max_clip_distance
421  << ", " << def.camera_role
422  << ", " << def.camera_mode
423  << ", " << def.material_name;
424  if (!def.camera_name.empty())
425  {
426  m_stream << ", " << def.camera_name;
427  }
428  }
429  m_stream << endl << endl; // Empty line
430 }
431 
433 {
434  RigDef::SkeletonSettings& def = module->set_skeleton_settings[module->set_skeleton_settings.size() - 1];
435  m_stream << "set_skeleton_settings " << def.visibility_range_meters << ", " << def.beam_thickness_meters << "\n\n";
436 }
437 
439 {
440  if (module->guisettings.empty())
441  {
442  return;
443  }
444  m_stream << "guisettings";
445  for (GuiSettings& gs: module->guisettings)
446  {
447  m_stream << "\n\t" << gs.key << "=" << gs.value;
448  }
449  m_stream << endl << endl; // Empty line
450 }
451 
453 {
454  if (module->exhausts.empty())
455  {
456  return;
457  }
458  m_stream << "exhausts" << endl;
459  auto end_itor = module->exhausts.end();
460  for (auto itor = module->exhausts.begin(); itor != end_itor; ++itor)
461  {
462  RigDef::Exhaust & def = *itor;
463 
464  m_stream << "\n\t" << def.reference_node.ToString()
465  << ", " << def.direction_node.ToString()
466  << ", " << def.particle_name;
467  }
468  m_stream << endl << endl; // Empty line
469 }
470 
472 {
473  // TODO
474  m_stream << ";submesh_groundmodel -- STUB"<< endl << endl; // Empty line
475 }
476 
478 {
479  if (module->submeshes.empty())
480  {
481  return;
482  }
483  m_stream << "submesh" << endl;
484  auto end_itor = module->submeshes.end();
485  for (auto itor = module->submeshes.begin(); itor != end_itor; ++itor)
486  {
487  RigDef::Submesh & def = *itor;
488 
489  if (def.texcoords.size() > 0)
490  {
491  m_stream << "\n\ttexcoords";
492  auto texcoord_end = def.texcoords.end();
493  for (auto texcoord_itor = def.texcoords.begin(); texcoord_itor != texcoord_end; ++texcoord_itor)
494  {
495  m_stream << "\n\t" << texcoord_itor->node.ToString() << ", " << texcoord_itor->u << ", " << texcoord_itor->v;
496  }
497  }
498  if (def.cab_triangles.size() > 0)
499  {
500  m_stream << "\n\tcab";
501  auto cab_end = def.cab_triangles.end();
502  for (auto cab_itor = def.cab_triangles.begin(); cab_itor != cab_end; ++cab_itor)
503  {
504  m_stream << "\n\t" << cab_itor->nodes[0].ToString()
505  << ", " << cab_itor->nodes[1].ToString()
506  << ", " << cab_itor->nodes[2].ToString()
507  << ", n";
508 
509  // Options
510  if (BITMASK_IS_1(cab_itor->options, Cab::OPTION_c_CONTACT )) m_stream << (char)CabOption::c_CONTACT;
511  if (BITMASK_IS_1(cab_itor->options, Cab::OPTION_b_BUOYANT )) m_stream << (char)CabOption::b_BUOYANT;
512  if (BITMASK_IS_1(cab_itor->options, Cab::OPTION_p_10xTOUGHER )) m_stream << (char)CabOption::p_10xTOUGHER;
519  }
520  }
521  if (def.backmesh)
522  {
523  m_stream << "\n\tbackmesh";
524  }
525  }
526  m_stream << endl << endl; // Empty line
527 }
528 
529 #define PROP_ANIMATION_ADD_FLAG(FLAGS_VAR, AND_VAR, BITMASK_CONST, NAME_STR) \
530  if (AND_VAR) { m_stream << " | "; } \
531  if (BITMASK_IS_1((FLAGS_VAR), RigDef::Animation::BITMASK_CONST)) { \
532  AND_VAR = true; \
533  m_stream << NAME_STR; \
534  }
535 
537 {
538  m_stream << "\n\tadd_animation " << anim.ratio
539  << ", " << anim.lower_limit
540  << ", " << anim.upper_limit
541  << ", source: ";
542 
543  // Source flags
544  bool join = false;
545  unsigned int src_flags = anim.source;
546  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_AIRSPEED , "airspeed");
547  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_VERTICAL_VELOCITY, "vvi");
548  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_ALTIMETER_100K , "altimeter100k");
549  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_ALTIMETER_10K , "altimeter10k");
550  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_ALTIMETER_1K , "altimeter1k");
551  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_ANGLE_OF_ATTACK , "aoa");
552  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_FLAP , "flap");
553  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_AIR_BRAKE , "airbrake");
554  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_ROLL , "roll");
555  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_PITCH , "pitch");
556  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_BRAKES , "brakes");
557  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_ACCEL , "accel");
558  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_CLUTCH , "clutch");
559  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_SPEEDO , "speedo");
560  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_TACHO , "tacho");
561  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_TURBO , "turbo");
562  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_PARKING , "parking");
563  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_SHIFT_LEFT_RIGHT , "shifterman1");
564  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_SHIFT_BACK_FORTH , "shifterman2");
565  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_SEQUENTIAL_SHIFT , "sequential");
566  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_SHIFTERLIN , "shifterlin");
567  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_TORQUE , "torque");
568  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_HEADING , "heading");
569  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_DIFFLOCK , "difflock");
570  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_BOAT_RUDDER , "rudderboat");
571  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_BOAT_THROTTLE , "throttleboat");
572  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_STEERING_WHEEL , "steeringwheel");
573  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_AILERON , "aileron");
574  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_ELEVATOR , "elevator");
575  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_AIR_RUDDER , "rudderair");
576  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_PERMANENT , "permanent");
577  PROP_ANIMATION_ADD_FLAG(src_flags, join, SOURCE_EVENT , "event");
578 
579  m_stream << ", mode: ";
580  join = false;
581  unsigned int mode_flags = anim.mode;
582  PROP_ANIMATION_ADD_FLAG(mode_flags, join, MODE_ROTATION_X , "x-rotation");
583  PROP_ANIMATION_ADD_FLAG(mode_flags, join, MODE_ROTATION_Y , "y-rotation");
584  PROP_ANIMATION_ADD_FLAG(mode_flags, join, MODE_ROTATION_Z , "z-rotation");
585  PROP_ANIMATION_ADD_FLAG(mode_flags, join, MODE_OFFSET_X , "x-offset");
586  PROP_ANIMATION_ADD_FLAG(mode_flags, join, MODE_OFFSET_Y , "y-offset");
587  PROP_ANIMATION_ADD_FLAG(mode_flags, join, MODE_OFFSET_Z , "z-offset");
588  PROP_ANIMATION_ADD_FLAG(mode_flags, join, MODE_AUTO_ANIMATE, "autoanimate");
589  PROP_ANIMATION_ADD_FLAG(mode_flags, join, MODE_NO_FLIP , "noflip");
590  PROP_ANIMATION_ADD_FLAG(mode_flags, join, MODE_BOUNCE , "bounce");
591  PROP_ANIMATION_ADD_FLAG(mode_flags, join, MODE_EVENT_LOCK , "eventlock");
592 
594  {
595  m_stream << ", event: " << anim.event_name;
596  }
597 }
598 
600 {
601  if (module->flexbodies.empty())
602  {
603  return;
604  }
605  m_stream << "flexbodies" << endl;
606  auto end_itor = module->flexbodies.end();
607  for (auto itor = module->flexbodies.begin(); itor != end_itor; ++itor)
608  {
609  RigDef::Flexbody* def = &*itor;
610 
611  // Prop-like line
612  m_stream << "\n\t" << def->reference_node.ToString()
613  << ", " << def->x_axis_node.ToString()
614  << ", " << def->y_axis_node.ToString()
615  << ", " << def->offset.x
616  << ", " << def->offset.y
617  << ", " << def->offset.z
618  << ", " << def->rotation.x
619  << ", " << def->rotation.y
620  << ", " << def->rotation.z
621  << ", " << def->mesh_name;
622 
623  // Forset line
624  m_stream << "\n\t\tforset (node list)";
625  auto forset_end = def->node_list.end();
626  auto forset_itor = def->node_list.begin();
627  bool first = true;
628  for (; forset_itor != forset_end; ++forset_itor)
629  {
630  if (!first)
631  {
632  m_stream << ", ";
633  }
634  m_stream << forset_itor->ToString();
635  first = false;
636  }
637 
638  // Animations
639  auto anim_end = def->animations.end();
640  for (auto anim_itor = def->animations.begin(); anim_itor != anim_end; ++anim_itor)
641  {
642  ProcessDirectiveAddAnimation(*anim_itor);
643  }
644  }
645  m_stream << endl << endl; // Empty line
646 }
647 
649 {
650  if (module->props.empty())
651  {
652  return;
653  }
654  m_stream << "props" << endl;
655  auto end_itor = module->props.end();
656  for (auto itor = module->props.begin(); itor != end_itor; ++itor)
657  {
658  RigDef::Prop & def = *itor;
659 
660  m_stream << "\n\t" << def.reference_node.ToString()
661  << ", " << def.x_axis_node.ToString()
662  << ", " << def.y_axis_node.ToString()
663  << ", " << def.offset.x
664  << ", " << def.offset.y
665  << ", " << def.offset.z
666  << ", " << def.rotation.x
667  << ", " << def.rotation.y
668  << ", " << def.rotation.z
669  << ", ";
670  if (def.special == SpecialProp::NONE)
671  {
672  m_stream << def.mesh_name;
673  continue;
674  }
675 
676  // Special props
677  if (def.special == SpecialProp::BEACON)
678  {
679  m_stream << def.mesh_name
681  << " " << def.special_prop_beacon.color.r
682  << ", " << def.special_prop_beacon.color.g
683  << ", " << def.special_prop_beacon.color.b;
684  }
686  {
688  << " " << def.special_prop_dashboard.offset.x
689  << ", " << def.special_prop_dashboard.offset.y
690  << ", " << def.special_prop_dashboard.offset.z
691  << ", " << def.special_prop_dashboard.rotation_angle;
692  }
693 
694  // Animations
695  auto anim_end = def.animations.end();
696  for (auto anim_itor = def.animations.begin(); anim_itor != anim_end; ++anim_itor)
697  {
698  ProcessDirectiveAddAnimation(*anim_itor);
699  }
700  }
701  m_stream << endl << endl; // Empty line
702 }
703 
705 {
706  if (module->materialflarebindings.empty())
707  {
708  return;
709  }
710  m_stream << "materialflarebindings" << endl;
711  auto end_itor = module->materialflarebindings.end();
712  for (auto itor = module->materialflarebindings.begin(); itor != end_itor; ++itor)
713  {
714  RigDef::MaterialFlareBinding & def = *itor;
715  m_stream << "\n\t" << def.flare_number << ", " << def.material_name;
716  }
717  m_stream << endl << endl; // Empty line
718 }
719 
721 {
722  if (module->flares2.empty())
723  {
724  return;
725  }
726  m_stream << "flares2" << endl;
727  auto end_itor = module->flares2.end();
728  for (auto itor = module->flares2.begin(); itor != end_itor; ++itor)
729  {
730  RigDef::Flare2 & def = *itor;
731 
732  m_stream << "\n\t" << def.reference_node.ToString()
733  << ", " << def.node_axis_x.ToString()
734  << ", " << def.node_axis_y.ToString()
735  << ", " << def.offset.x
736  << ", " << def.offset.y
737  << ", " << (char)def.type
738  << ", " << def.control_number
739  << ", " << def.blink_delay_milis
740  << ", " << def.size
741  << " " << def.material_name;
742  }
743  m_stream << endl << endl; // Empty line
744 }
745 
747 {
748  if (module->managedmaterials.empty())
749  {
750  return;
751  }
752  m_stream << "managedmaterials" << endl;
753  auto end_itor = module->managedmaterials.end();
754  bool first = true;
755  ManagedMaterialsOptions mm_options;
756  for (auto itor = module->managedmaterials.begin(); itor != end_itor; ++itor)
757  {
758  RigDef::ManagedMaterial & def = *itor;
759 
760  if (first || (mm_options.double_sided != def.options.double_sided))
761  {
762  mm_options.double_sided = def.options.double_sided;
763  m_stream << "\n\tset_managedmaterials_options " << (int) mm_options.double_sided;
764  }
765  // Name
766  m_stream << "\n\t" << def.name << " ";
767  // Type
768  switch (def.type)
769  {
771  m_stream << "flexmesh_standard ";
772  break;
774  m_stream << "flexmesh_transparent ";
775  break;
777  m_stream << "mesh_standard ";
778  break;
780  m_stream << "mesh_transparent ";
781  break;
782  default:
783  ;
784  }
785  // Diffuse texture filename
786  m_stream << def.diffuse_map << " ";
787  // Diffuse damage-texture filename
789  {
790  m_stream << (def.damaged_diffuse_map.empty() ? "-" : def.damaged_diffuse_map) << " ";
791  }
792  // Specular texture
793  m_stream << (def.specular_map.empty() ? "-" : def.specular_map);
794 
795  first = false;
796  }
797  m_stream << endl << endl; // Empty line
798 }
799 
801 {
802  if (module->collisionboxes.empty())
803  {
804  return;
805  }
806  m_stream << "collisionboxes" << endl;
807  auto end_itor = module->collisionboxes.end();
808  for (auto itor = module->collisionboxes.begin(); itor != end_itor; ++itor)
809  {
810  RigDef::CollisionBox & def = *itor;
811 
812  auto nodes_end = def.nodes.end();
813  auto node_itor = def.nodes.begin();
814  m_stream << node_itor->ToString();
815  ++node_itor;
816  for (; node_itor != nodes_end; ++node_itor)
817  {
818  m_stream << ", " << node_itor->ToString();
819  }
820  }
821  m_stream << endl << endl; // Empty line
822 }
823 
825 {
826  if (module->axles.empty())
827  {
828  return;
829  }
830  m_stream << "axles" << endl;
831  auto end_itor = module->axles.end();
832  for (auto itor = module->axles.begin(); itor != end_itor; ++itor)
833  {
834  RigDef::Axle & def = *itor;
835 
836  m_stream << "\n\t"
837  << "w1(" << def.wheels[0][0].ToString() << " " << def.wheels[0][1].ToString() << "), "
838  << "w2(" << def.wheels[1][0].ToString() << " " << def.wheels[1][1].ToString() << ")";
839  if (! def.options.empty())
840  {
841  m_stream << ", d(";
842  auto end = def.options.end();
843  for (auto itor = def.options.begin(); itor != end; ++itor)
844  {
845  m_stream << (char)*itor;
846  }
847  m_stream << ")";
848  }
849  }
850  m_stream << endl << endl; // Empty line
851 }
852 
854 {
855  if (module->interaxles.empty())
856  {
857  return;
858  }
859  m_stream << "interaxles" << endl;
860  auto end_itor = module->interaxles.end();
861  for (auto itor = module->interaxles.begin(); itor != end_itor; ++itor)
862  {
863  RigDef::InterAxle & def = *itor;
864 
865  m_stream << "\n\t"
866  << def.a1 << ", "
867  << def.a2;
868  if (! def.options.empty())
869  {
870  m_stream << ", d(";
871  auto end = def.options.end();
872  for (auto itor = def.options.begin(); itor != end; ++itor)
873  {
874  m_stream << (char)*itor;
875  }
876  m_stream << ")";
877  }
878  }
879  m_stream << endl << endl; // Empty line
880 }
881 
883 {
884  if (module->transfercase.size() == 0)
885  {
886  return;
887  }
888  TransferCase& def = module->transfercase[module->transfercase.size() - 1];
889 
890  m_stream << "transfercase\t"
891  << def.a1 << ", "
892  << def.a2 << ", "
893  << def.has_2wd << ", "
894  << def.has_2wd_lo;
895  for (float gear_ratio : def.gear_ratios)
896  {
897  m_stream << ", " << gear_ratio;
898  }
899  m_stream << endl << endl;
900 }
901 
903 {
904  if (module->cruisecontrol.size() == 0)
905  {
906  return;
907  }
908 
909  RigDef::CruiseControl& cruisecontrol = module->cruisecontrol[module->cruisecontrol.size() - 1];
910 
911  m_stream << "cruisecontrol "
912  << cruisecontrol.min_speed << ", "
913  << (int) cruisecontrol.autobrake
914  << endl << endl;
915 
916 }
917 
919 {
920  if (module->speedlimiter.size() == 0)
921  {
922  return;
923  }
924  m_stream << "speedlimiter "
925  << module->speedlimiter[module->speedlimiter.size() - 1].max_speed
926  << endl << endl;
927 }
928 
930 {
931  if (module->torquecurve.size() == 0)
932  {
933  return;
934  }
935  m_stream << "torquecurve" << endl;
936  if (module->torquecurve[0].predefined_func_name.empty())
937  {
938  auto itor_end = module->torquecurve[0].samples.end();
939  auto itor = module->torquecurve[0].samples.begin();
940  for (; itor != itor_end; ++itor)
941  {
942  m_stream << "\n\t" << itor->power << ", " << itor->torque_percent;
943  }
944  }
945  else
946  {
947  m_stream << "\n\t" << module->torquecurve[0].predefined_func_name;
948  }
949  m_stream << endl << endl; // Empty line
950 }
951 
953 {
954  if (module->particles.empty())
955  {
956  return;
957  }
958  m_stream << "particles" << endl;
959  auto end_itor = module->particles.end();
960  for (auto itor = module->particles.begin(); itor != end_itor; ++itor)
961  {
962  RigDef::Particle & def = *itor;
963 
964  m_stream << "\n\t"
965  << setw(m_node_id_width) << def.emitter_node.ToString() << ", "
966  << setw(m_node_id_width) << def.reference_node.ToString() << ", "
967  << def.particle_system_name;
968  }
969  m_stream << endl << endl; // Empty line
970 }
971 
973 {
974  if (module->ropables.empty())
975  {
976  return;
977  }
978  m_stream << "ropables" << endl;
979  auto end_itor = module->ropables.end();
980  for (auto itor = module->ropables.begin(); itor != end_itor; ++itor)
981  {
982  RigDef::Ropable & def = *itor;
983 
984  m_stream << "\n\t" << def.node.ToString()
985  << ", " << def.group
986  << ", " << (int) def.has_multilock;
987  }
988  m_stream << endl << endl; // Empty line
989 }
990 
992 {
993  if (module->ties.empty())
994  {
995  return;
996  }
997  m_stream << "ties" << endl;
998  auto end_itor = module->ties.end();
999  for (auto itor = module->ties.begin(); itor != end_itor; ++itor)
1000  {
1001  RigDef::Tie & def = *itor;
1002 
1003  m_stream << "\n\t" << def.root_node.ToString()
1004  << ", " << setw(m_float_width) << def.max_reach_length
1005  << ", " << setw(m_float_width) << def.auto_shorten_rate
1006  << ", " << setw(m_float_width) << def.min_length
1007  << ", " << setw(m_float_width) << def.max_length
1008  << ", " << (BITMASK_IS_1(def.options, Tie::OPTION_i_INVISIBLE) ? "i" : "n")
1009  << ", " << (BITMASK_IS_1(def.options, Tie::OPTION_s_DISABLE_SELF_LOCK) ? "s" : "")
1010  << ", " << setw(m_float_width) << def.max_stress
1011  << ", " << def.group;
1012  }
1013  m_stream << endl << endl; // Empty line
1014 }
1015 
1017 {
1018  if (module->fixes.empty())
1019  {
1020  return;
1021  }
1022  m_stream << "fixes" << endl;
1023  auto end_itor = module->fixes.end();
1024  for (auto itor = module->fixes.begin(); itor != end_itor; ++itor)
1025  {
1026  m_stream << "\n\t" << setw(m_node_id_width) << itor->ToString();
1027  }
1028  m_stream << endl << endl; // Empty line
1029 }
1030 
1032 {
1033  if (module->ropes.empty())
1034  {
1035  return;
1036  }
1037  m_stream << "ropes" << endl;
1038  auto end_itor = module->ropes.end();
1039  bool first = true;
1040  BeamDefaults* beam_defaults = nullptr;
1041  for (auto itor = module->ropes.begin(); itor != end_itor; ++itor)
1042  {
1043  RigDef::Rope & def = *itor;
1044 
1045  if (first || (def.beam_defaults.get() != beam_defaults))
1046  {
1047  ProcessBeamDefaults(def.beam_defaults.get(), "\t");
1048  }
1049 
1050  m_stream << "\n\t"
1051  << setw(m_node_id_width) << def.root_node.ToString() << ", "
1052  << setw(m_node_id_width) << def.end_node.ToString();
1053  if (def.invisible)
1054  {
1055  m_stream << ", i";
1056  }
1057  first = false;
1058  }
1059  m_stream << endl << endl; // Empty line
1060 }
1061 
1063 {
1064  if (module->railgroups.empty())
1065  {
1066  return;
1067  }
1068  m_stream << "railgroups" << endl << endl;
1069  auto end_itor = module->railgroups.end();
1070  for (auto itor = module->railgroups.begin(); itor != end_itor; ++itor)
1071  {
1072  RigDef::RailGroup & def = *itor;
1073 
1074  m_stream << "\n\t" << def.id;
1075  auto node_end = def.node_list.end();
1076  for (auto node_itor = def.node_list.begin(); node_itor != node_end; ++node_itor)
1077  {
1078  m_stream << ", " << node_itor->start.ToString();
1079  if (node_itor->IsRange())
1080  {
1081  m_stream << " - " << node_itor->end.ToString();
1082  }
1083  }
1084  }
1085  m_stream << endl << endl; // Empty line
1086 }
1087 
1089 {
1090  if (module->slidenodes.empty())
1091  {
1092  return;
1093  }
1094  m_stream << "slidenodes" << endl << endl;
1095  auto end_itor = module->slidenodes.end();
1096  for (auto itor = module->slidenodes.begin(); itor != end_itor; ++itor)
1097  {
1098  RigDef::SlideNode & def = *itor;
1099 
1100  m_stream << "\n\t" << def.slide_node.ToString();
1101 
1102  // Define rail - either list of nodes, or raigroup ID
1103  if (!def.rail_node_ranges.empty())
1104  {
1105  auto end = def.rail_node_ranges.end();
1106  auto itor = def.rail_node_ranges.begin();
1107  for (; itor != end; ++itor)
1108  {
1109  m_stream << ", " << itor->start.ToString();
1110  if (itor->IsRange())
1111  {
1112  m_stream << " - " << itor->end.ToString();
1113  }
1114  }
1115  }
1116  else
1117  {
1118  m_stream << ", g" << def.railgroup_id;
1119  }
1120 
1121  // Optional args
1122  if (def._spring_rate_set) { m_stream << ", s" << def.spring_rate; }
1123  if (def._break_force_set) { m_stream << ", b" << def.break_force; }
1124  if (def._tolerance_set) { m_stream << ", t" << def.tolerance; }
1125  if (def._attachment_rate_set) { m_stream << ", r" << def.attachment_rate; }
1126  if (def._max_attach_dist_set) { m_stream << ", d" << def.max_attach_dist; }
1127 
1128  // Constraint flags (cX)
1133  }
1134  m_stream << endl << endl; // Empty line
1135 }
1136 
1138 {
1139  if (module->hooks.empty())
1140  {
1141  return;
1142  }
1143  m_stream << "hooks" << endl << endl;
1144  auto end_itor = module->hooks.end();
1145  for (auto itor = module->hooks.begin(); itor != end_itor; ++itor)
1146  {
1147  RigDef::Hook & def = *itor;
1148 
1149  m_stream << "\n\t" << def.node.ToString();
1150 
1151  // Boolean options
1152  if (def.flag_auto_lock) { m_stream << ", auto-lock"; }
1153  if (def.flag_no_disable) { m_stream << ", nodisable"; }
1154  if (def.flag_no_rope) { m_stream << ", norope"; }
1155  if (def.flag_self_lock) { m_stream << ", self-lock"; }
1156  if (def.flag_visible) { m_stream << ", visible"; }
1157 
1158  // Key-value options
1159  m_stream
1160  << ", hookrange: " << def.option_hook_range
1161  << ", speedcoef: " << def.option_speed_coef
1162  << ", maxforce: " << def.option_max_force
1163  << ", hookgroup: " << def.option_hookgroup
1164  << ", lockgroup: " << def.option_lockgroup
1165  << ", timer: " << def.option_timer
1166  << ", shortlimit: "<< def.option_min_range_meters;
1167  }
1168  m_stream << endl << endl; // Empty line
1169 }
1170 
1172 {
1173  if (module->lockgroups.empty())
1174  {
1175  return;
1176  }
1177  m_stream << "lockgroups" << endl << endl;
1178  auto end_itor = module->lockgroups.end();
1179  for (auto itor = module->lockgroups.begin(); itor != end_itor; ++itor)
1180  {
1181  RigDef::Lockgroup & def = *itor;
1182 
1183  m_stream << "\n\t" << def.number;
1184  auto nodes_end = def.nodes.end();
1185  for (auto nodes_itor = def.nodes.begin(); nodes_itor != nodes_end; ++nodes_itor)
1186  {
1187  m_stream << ", " << nodes_itor->ToString();
1188  }
1189  }
1190  m_stream << endl << endl; // Empty line
1191 }
1192 
1194 {
1195  if (module->triggers.empty())
1196  {
1197  return;
1198  }
1199  m_stream << "animators" << endl << endl;
1200  auto end_itor = module->triggers.end();
1201  for (auto itor = module->triggers.begin(); itor != end_itor; ++itor)
1202  {
1203  RigDef::Trigger & def = *itor;
1204 
1205  m_stream << "\n\t"
1206  << def.nodes[0].ToString() << ", "
1207  << def.nodes[1].ToString() << ", "
1208  << def.contraction_trigger_limit << ", "
1209  << def.expansion_trigger_limit << ", "
1210  << def.shortbound_trigger_action << ", "
1211  << def.longbound_trigger_action << ", ";
1212 
1224 
1225  m_stream << " " << def.boundary_timer;
1226  }
1227  m_stream << endl << endl; // Empty line
1228 }
1229 
1230 #define ANIMATOR_ADD_FLAG(DEF_VAR, AND_VAR, BITMASK_CONST, NAME_STR) \
1231  if (AND_VAR) { m_stream << " | "; } \
1232  if (BITMASK_IS_1((DEF_VAR).flags, RigDef::Animator::BITMASK_CONST)) { \
1233  AND_VAR = true; \
1234  m_stream << NAME_STR; \
1235  }
1236 
1237 #define ANIMATOR_ADD_AERIAL_FLAG(DEF_VAR, AND_VAR, BITMASK_CONST, NAME_STR) \
1238  if (AND_VAR) { m_stream << " | "; } \
1239  if (BITMASK_IS_1((DEF_VAR).aero_animator.flags, RigDef::AeroAnimator::BITMASK_CONST)) { \
1240  AND_VAR = true; \
1241  m_stream << NAME_STR << DEF_VAR.aero_animator.engine_idx + 1; \
1242  }
1243 
1244 #define ANIMATOR_ADD_LIMIT(DEF_VAR, AND_VAR, BITMASK_CONST, NAME_STR, VALUE) \
1245  if (AND_VAR) { m_stream << " | "; } \
1246  if (BITMASK_IS_1((DEF_VAR).aero_animator.flags, RigDef::Animator::BITMASK_CONST)) { \
1247  AND_VAR = true; \
1248  m_stream << NAME_STR << ": " << VALUE; \
1249  }
1250 
1252 {
1253  if (module->animators.empty())
1254  {
1255  return;
1256  }
1257  m_stream << "animators" << endl << endl;
1258  auto end_itor = module->animators.end();
1259  for (auto itor = module->animators.begin(); itor != end_itor; ++itor)
1260  {
1261  RigDef::Animator & def = *itor;
1262 
1263  m_stream << "\t"
1264  << def.nodes[0].ToString() << ", "
1265  << def.nodes[1].ToString() << ", "
1266  << def.lenghtening_factor << ", ";
1267 
1268  // Options
1269  bool bAnd = false;
1270  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_VISIBLE , "vis")
1271  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_INVISIBLE , "inv")
1272  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_AIRSPEED , "airspeed")
1273  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_VERTICAL_VELOCITY, "vvi")
1274  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_ALTIMETER_100K , "altimeter100k")
1275  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_ALTIMETER_10K , "altimeter10k")
1276  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_ALTIMETER_1K , "altimeter1k")
1277  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_ANGLE_OF_ATTACK , "aoa")
1278  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_FLAP , "flap")
1279  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_AIR_BRAKE , "airbrake")
1280  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_ROLL , "roll")
1281  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_PITCH , "pitch")
1282  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_BRAKES , "brakes")
1283  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_ACCEL , "accel")
1284  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_CLUTCH , "clutch")
1285  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_SPEEDO , "speedo")
1286  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_TACHO , "tacho")
1287  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_TURBO , "turbo")
1288  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_PARKING , "parking")
1289  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_SHIFT_LEFT_RIGHT , "shifterman1")
1290  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_SHIFT_BACK_FORTH , "shifterman2")
1291  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_SEQUENTIAL_SHIFT , "sequential")
1292  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_GEAR_SELECT , "shifterlin")
1293  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_TORQUE , "torque")
1294  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_DIFFLOCK , "difflock")
1295  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_BOAT_RUDDER , "rudderboat")
1296  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_BOAT_THROTTLE , "throttleboat")
1297  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_SHORT_LIMIT , "shortlimit")
1298  ANIMATOR_ADD_FLAG(def, bAnd, OPTION_LONG_LIMIT , "longlimit")
1299 
1300  ANIMATOR_ADD_AERIAL_FLAG(def, bAnd, OPTION_THROTTLE , "throttle")
1301  ANIMATOR_ADD_AERIAL_FLAG(def, bAnd, OPTION_RPM , "rpm")
1302  ANIMATOR_ADD_AERIAL_FLAG(def, bAnd, OPTION_TORQUE , "aerotorq")
1303  ANIMATOR_ADD_AERIAL_FLAG(def, bAnd, OPTION_PITCH , "aeropit")
1304  ANIMATOR_ADD_AERIAL_FLAG(def, bAnd, OPTION_STATUS , "aerostatus")
1305 
1306  ANIMATOR_ADD_LIMIT(def, bAnd, OPTION_SHORT_LIMIT , "shortlimit", def.short_limit)
1307  ANIMATOR_ADD_LIMIT(def, bAnd, OPTION_LONG_LIMIT , "longlimit", def.long_limit)
1308  }
1309  m_stream << endl << endl; // Empty line
1310 }
1311 
1313 {
1314  if (module->contacters.empty())
1315  {
1316  return;
1317  }
1318  m_stream << "contacters" << endl << endl;
1319  auto end_itor = module->rotators.end();
1320  for (auto itor = module->rotators.begin(); itor != end_itor; ++itor)
1321  {
1322  }
1323  m_stream << endl << endl; // Empty line
1324 }
1325 
1327 {
1328  if (module->rotators.empty())
1329  {
1330  return;
1331  }
1332  m_stream << "rotators" << endl << endl;
1333  auto end_itor = module->rotators.end();
1334  for (auto itor = module->rotators.begin(); itor != end_itor; ++itor)
1335  {
1336  Rotator & def = *itor;
1337 
1338  // Axis nodes
1339  m_stream
1340  << def.axis_nodes[0].ToString() << ", "
1341  << def.axis_nodes[1].ToString() << ", ";
1342 
1343  // Baseplate nodes
1344  for (int i = 0; i < 4; ++i)
1345  {
1346  m_stream << def.base_plate_nodes[i].ToString() << ", ";
1347  }
1348 
1349  // Rotating plate nodes
1350  for (int i = 0; i < 4; ++i)
1351  {
1352  m_stream << def.rotating_plate_nodes[i].ToString() << ", ";
1353  }
1354 
1355  // Attributes
1356  m_stream << def.rate << ", " << def.spin_left_key << ", " << def.spin_right_key << ", ";
1357 
1358  // Inertia
1359  m_stream
1360  << def.inertia.start_delay_factor << ", "
1361  << def.inertia.stop_delay_factor << ", "
1362  << def.inertia.start_function << ", "
1363  << def.inertia.stop_function << ", "
1364  << def.engine_coupling << ", "
1365  << (def.needs_engine ? "true" : "false");
1366  }
1367  m_stream << endl << endl; // Empty line
1368 }
1369 
1371 {
1372  if (module->rotators2.empty())
1373  {
1374  return;
1375  }
1376  m_stream << "rotators2" << endl << endl;
1377  auto end_itor = module->rotators2.end();
1378  for (auto itor = module->rotators2.begin(); itor != end_itor; ++itor)
1379  {
1380  Rotator2 & def = *itor;
1381 
1382  // Axis nodes
1383  m_stream
1384  << def.axis_nodes[0].ToString() << ", "
1385  << def.axis_nodes[1].ToString() << ", ";
1386 
1387  // Baseplate nodes
1388  for (int i = 0; i < 4; ++i)
1389  {
1390  m_stream << def.base_plate_nodes[i].ToString() << ", ";
1391  }
1392 
1393  // Rotating plate nodes
1394  for (int i = 0; i < 4; ++i)
1395  {
1396  m_stream << def.rotating_plate_nodes[i].ToString() << ", ";
1397  }
1398 
1399  // Attributes
1400  m_stream
1401  << def.rate << ", "
1402  << def.spin_left_key << ", "
1403  << def.spin_right_key << ", "
1404  << def.rotating_force << ", "
1405  << def.tolerance << ", "
1406  << def.description << ", ";
1407 
1408  // Inertia
1409  m_stream
1410  << def.inertia.start_delay_factor << ", "
1411  << def.inertia.stop_delay_factor << ", "
1412  << def.inertia.start_function << ", "
1413  << def.inertia.stop_function << ", "
1414  << def.engine_coupling << ", "
1415  << (def.needs_engine ? "true" : "false");
1416  }
1417  m_stream << endl << endl; // Empty line
1418 }
1419 
1421 {
1422  if (module->flexbodywheels.empty())
1423  {
1424  return;
1425  }
1426  m_stream << "flexbodywheels" << endl << endl;
1427  auto end_itor = module->flexbodywheels.end();
1428  for (auto itor = module->flexbodywheels.begin(); itor != end_itor; ++itor)
1429  {
1430  m_stream << "\t"
1431  << setw(m_float_width) << itor->tyre_radius << ", "
1432  << setw(m_float_width) << itor->rim_radius << ", "
1433  << setw(m_float_width) << itor->width << ", "
1434  << setw(3) << itor->num_rays << ", "
1435  << setw(m_node_id_width) << itor->nodes[0].ToString() << ", "
1436  << setw(m_node_id_width) << itor->nodes[1].ToString() << ", "
1437  << setw(m_node_id_width) << itor->rigidity_node.ToString() << ", "
1438  << setw(3) << (int)itor->braking << ", "
1439  << setw(3) << (int)itor->propulsion << ", "
1440  << setw(m_node_id_width) << itor->reference_arm_node.ToString() << ", "
1441  << setw(m_float_width) << itor->mass << ", "
1442  << setw(m_float_width) << itor->tyre_springiness << ", "
1443  << setw(m_float_width) << itor->tyre_damping << ", "
1444  << (static_cast<char>(itor->side)) << ", "
1445  << itor->rim_mesh_name << " " // Separator = space!
1446  << itor->tyre_mesh_name
1447  << endl;
1448  }
1449 
1450  m_stream << endl; // Empty line
1451 }
1452 
1454 {
1455  if (module->tractioncontrol.size() == 0) { return; }
1456 
1457  RigDef::TractionControl& def = module->tractioncontrol[module->tractioncontrol.size() - 1];
1458 
1459  m_stream << "TractionControl "
1460  << def.regulation_force << ", "
1461  << def.wheel_slip << ", "
1462  << def.fade_speed << ", "
1463  << def.pulse_per_sec << ", mode: " << (def.attr_is_on ? "ON" : "OFF");
1464  // Modes
1465  if (def.attr_no_dashboard) { m_stream << " & NODASH "; }
1466  if (def.attr_no_toggle) { m_stream << " & NOTOGGLE "; }
1467 }
1468 
1470 {
1471  Brakes& brakes = module->brakes[module->brakes.size() - 1];
1472 
1473  m_stream << "brakes\n\t"
1474  << brakes.default_braking_force << ", "
1475  << brakes.parking_brake_force;
1476 }
1477 
1479 {
1480  if (module->antilockbrakes.size() == 0) { return; }
1481 
1482  RigDef::AntiLockBrakes* alb = &module->antilockbrakes[module->antilockbrakes.size() - 1];
1483 
1484  m_stream << "AntiLockBrakes "
1485  << alb->regulation_force << ", "
1486  << alb->min_speed << ", "
1487  << alb->pulse_per_sec << ", mode: " << (alb->attr_is_on ? "ON" : "OFF");
1488  // Modes
1489  if (alb->attr_no_dashboard) { m_stream << " & NODASH "; }
1490  if (alb->attr_no_toggle) { m_stream << " & NOTOGGLE "; }
1491 }
1492 
1494 {
1495  if (module->engine.size() == 0)
1496  {
1497  return;
1498  }
1499 
1500  Engine& engine = module->engine[module->engine.size() - 1];
1501 
1502  m_stream << "engine"
1503  "\n;\t"
1504  "ShiftDownRPM,"
1505  " ShiftUpRPM,"
1506  " Torque,"
1507  " GlobalGear,"
1508  " ReverseGear,"
1509  " NeutralGear,"
1510  " Forward gears...\n\t"
1511  << setw(12) << engine.shift_down_rpm << ", "
1512  << setw(10) << engine.shift_up_rpm << ", "
1513  << setw(10) << engine.torque << ", "
1514  << setw(10) << engine.global_gear_ratio << ", "
1515  << setw(11) << engine.reverse_gear_ratio << ", "
1516  << setw(11) << engine.neutral_gear_ratio;
1517 
1518  auto itor = engine.gear_ratios.begin();
1519  auto end = engine.gear_ratios.end();
1520  for (; itor != end; ++itor)
1521  {
1522  m_stream << ", " << *itor;
1523  }
1524  m_stream << ", -1.0" /*terminator*/ << endl << endl;
1525 }
1526 
1528 {
1529  if (module->engoption.size() == 0)
1530  {
1531  return;
1532  }
1533 
1534  Engoption& engoption = module->engoption[module->engoption.size() - 1];
1535 
1536  m_stream << "engoption"
1537  "\n;\t"
1538  "EngInertia,"
1539  " EngineType,"
1540  " ClutchForce,"
1541  " ShiftTime,"
1542  " ClutchTime,"
1543  " PostShiftTime,"
1544  " StallRPM,"
1545  " IdleRPM,"
1546  " MaxIdleMixture,"
1547  " MinIdleMixture"
1548  " BrakingForce"
1549  "\n\t"
1550  << setw(10) << engoption.inertia << ", "
1551  << setw(10) << (char)engoption.type << ", "
1552  << setw(11) << engoption.clutch_force << ", "
1553  << setw( 9) << engoption.shift_time << ", "
1554  << setw(10) << engoption.clutch_time << ", "
1555  << setw(13) << engoption.post_shift_time << ", "
1556  << setw( 8) << engoption.stall_rpm << ", "
1557  << setw( 7) << engoption.idle_rpm << ", "
1558  << setw(14) << engoption.max_idle_mixture << ", "
1559  << setw(14) << engoption.min_idle_mixture << ", "
1560  << setw(15) << engoption.braking_torque;
1561 
1562  m_stream << endl << endl;
1563 }
1564 
1566 {
1567  if (module->help.size() == 0)
1568  {
1569  return;
1570  }
1571  m_stream << "help\n\t" << module->help[module->help.size() - 1].material << endl << endl;
1572 }
1573 
1575 {
1576  if (module->wheels2.empty())
1577  {
1578  return;
1579  }
1580  m_stream << "wheels2" << endl << endl;
1581  auto end_itor = module->wheels2.end();
1582  for (auto itor = module->wheels2.begin(); itor != end_itor; ++itor)
1583  {
1584  m_stream << "\t"
1585  << setw(m_float_width) << itor->tyre_radius << ", "
1586  << setw(m_float_width) << itor->rim_radius << ", "
1587  << setw(m_float_width) << itor->width << ", "
1588  << setw(3) << itor->num_rays << ", "
1589  << setw(m_node_id_width) << itor->nodes[0].ToString() << ", "
1590  << setw(m_node_id_width) << itor->nodes[1].ToString() << ", "
1591  << setw(m_node_id_width) << itor->rigidity_node.ToString() << ", "
1592  << setw(3) << (int)itor->braking << ", "
1593  << setw(3) << (int)itor->propulsion << ", "
1594  << setw(m_node_id_width) << itor->reference_arm_node.ToString() << ", "
1595  << setw(m_float_width) << itor->mass << ", "
1596  << setw(m_float_width) << itor->rim_springiness << ", "
1597  << setw(m_float_width) << itor->rim_damping << ", "
1598  << setw(m_float_width) << itor->tyre_springiness << ", "
1599  << setw(m_float_width) << itor->tyre_damping << ", "
1600  << itor->face_material_name << " " // Separator = space!
1601  << itor->band_material_name << " " // Separator = space!
1602  ;
1603  m_stream << endl;
1604  }
1605 
1606  m_stream << endl; // Empty line
1607 }
1608 
1610 {
1611  if (module->wheels.empty())
1612  {
1613  return;
1614  }
1615  m_stream << "wheels" << endl << endl;
1616  auto end_itor = module->wheels.end();
1617  for (auto itor = module->wheels.begin(); itor != end_itor; ++itor)
1618  {
1619  m_stream << "\t"
1620  << setw(m_float_width) << itor->radius << ", "
1621  << setw(m_float_width) << itor->width << ", "
1622  << setw(3) << itor->num_rays << ", "
1623  << setw(m_node_id_width) << itor->nodes[0].ToString() << ", "
1624  << setw(m_node_id_width) << itor->nodes[1].ToString() << ", "
1625  << setw(m_node_id_width) << itor->rigidity_node.ToString() << ", "
1626  << setw(3) << (int)itor->braking << ", "
1627  << setw(3) << (int)itor->propulsion << ", "
1628  << setw(m_node_id_width) << itor->reference_arm_node.ToString() << ", "
1629  << setw(m_float_width) << itor->mass << ", "
1630  << setw(m_float_width) << itor->springiness << ", "
1631  << setw(m_float_width) << itor->damping << ", "
1632  << itor->face_material_name << " " // Separator = space!
1633  << itor->band_material_name << " " // Separator = space!
1634  ;
1635  m_stream << endl;
1636  }
1637 
1638  m_stream << endl; // Empty line
1639 }
1640 
1642 {
1643  m_stream << "\t"
1644  << setw(m_float_width) << def.tyre_radius << ", "
1645  << setw(m_float_width) << def.rim_radius << ", "
1646  << setw(m_float_width) << def.width << ", "
1647  << setw(3) << def.num_rays << ", "
1648  << setw(m_node_id_width) << def.nodes[0].ToString() << ", "
1649  << setw(m_node_id_width) << def.nodes[1].ToString() << ", "
1650  << setw(m_node_id_width) << def.rigidity_node.ToString() << ", "
1651  << setw(3) << (int)def.braking << ", "
1652  << setw(3) << (int)def.propulsion << ", "
1653  << setw(m_node_id_width) << def.reference_arm_node.ToString() << ", "
1654  << setw(m_float_width) << def.mass << ", "
1655  << setw(m_float_width) << def.spring << ", "
1656  << setw(m_float_width) << def.damping << ", "
1657  << (static_cast<char>(def.side)) << ", "
1658  << def.mesh_name << " " // Separator = space!
1659  << def.material_name;
1660  m_stream << endl;
1661 }
1662 
1664 {
1665  if (module->meshwheels.empty()) { return; }
1666 
1667  m_stream << "meshwheels" << "\n\n";
1668 
1669  for (MeshWheel& def: module->meshwheels)
1670  {
1671  this->ExportBaseMeshWheel(def);
1672  }
1673 
1674  m_stream << endl; // Empty line
1675 }
1676 
1678 {
1679  if (module->meshwheels2.empty()) { return; }
1680 
1681  m_stream << "meshwheels2" << "\n\n";
1682 
1683  for (MeshWheel2& def: module->meshwheels2)
1684  {
1685  this->ExportBaseMeshWheel(def);
1686  }
1687 
1688  m_stream << endl; // Empty line
1689 }
1690 
1692 {
1693  if (module->cinecam.empty())
1694  {
1695  return;
1696  }
1697 
1698  m_stream << "cinecam" << endl << endl;
1699 
1700  for (auto itor = module->cinecam.begin(); itor != module->cinecam.end(); ++itor)
1701  {
1702  m_stream << "\t"
1703  << setw(m_float_width) << itor->position.x << ", "
1704  << setw(m_float_width) << itor->position.y << ", "
1705  << setw(m_float_width) << itor->position.z << ", ";
1706  m_stream
1707  << setw(m_node_id_width) << itor->nodes[0].ToString() << ", "
1708  << setw(m_node_id_width) << itor->nodes[1].ToString() << ", "
1709  << setw(m_node_id_width) << itor->nodes[2].ToString() << ", "
1710  << setw(m_node_id_width) << itor->nodes[3].ToString() << ", "
1711  << setw(m_node_id_width) << itor->nodes[4].ToString() << ", "
1712  << setw(m_node_id_width) << itor->nodes[5].ToString() << ", "
1713  << setw(m_node_id_width) << itor->nodes[6].ToString() << ", "
1714  << setw(m_node_id_width) << itor->nodes[7].ToString() << ", ";
1715  m_stream
1716  << setw(m_float_width) << itor->spring << ", "
1717  << setw(m_float_width) << itor->damping;
1718  }
1719 
1720  m_stream << endl; // Empty line
1721 }
1722 
1724 {
1725  if (module->beams.empty())
1726  {
1727  return;
1728  }
1729 
1730  // Group beams by presets
1731  std::map< BeamDefaults*, std::vector<Beam*> > beams_by_preset;
1732  auto itor_end = module->beams.end();
1733  for (auto itor = module->beams.begin(); itor != itor_end; ++itor)
1734  {
1735  Beam & beam = *itor;
1736  BeamDefaults* preset = beam.defaults.get();
1737 
1738  // Ensure preset is in map
1739  auto found_itor = beams_by_preset.find(preset);
1740  if (found_itor == beams_by_preset.end())
1741  {
1742  // Preset not in map, insert it and add beam.
1743  std::vector<Beam*> list;
1744  list.reserve(100);
1745  list.push_back(&beam);
1746  beams_by_preset.insert(std::make_pair(preset, list));
1747  }
1748  else
1749  {
1750  // Preset in map, just add beam.
1751  found_itor->second.push_back(&beam);
1752  }
1753  }
1754 
1755  // Write beams to file
1756  m_stream << "beams" << endl << endl;
1757  auto preset_itor_end = beams_by_preset.end();
1758  for (auto preset_itor = beams_by_preset.begin(); preset_itor != preset_itor_end; ++preset_itor)
1759  {
1760  // Write preset
1761  BeamDefaults* preset = preset_itor->first;
1762  ProcessBeamDefaults(preset);
1763 
1764  // Write beams
1765  std::vector<Beam*> & beam_list = preset_itor->second;
1766  auto beam_itor_end = beam_list.end();
1767  for (auto beam_itor = beam_list.begin(); beam_itor != beam_itor_end; ++beam_itor)
1768  {
1769  Beam & beam = *(*beam_itor);
1770  ProcessBeam(beam);
1771  }
1772  }
1773 
1774  // Empty line
1775  m_stream << endl;
1776 }
1777 
1779 {
1780  if (module->shocks.empty())
1781  {
1782  return;
1783  }
1784 
1785  // Group beams by presets
1786  std::map< BeamDefaults*, std::vector<Shock*> > shocks_by_preset;
1787  auto itor_end = module->shocks.end();
1788  for (auto itor = module->shocks.begin(); itor != itor_end; ++itor)
1789  {
1790  Shock & shock = *itor;
1791  BeamDefaults* preset = shock.beam_defaults.get();
1792 
1793  // Ensure preset is in map
1794  auto found_itor = shocks_by_preset.find(preset);
1795  if (found_itor == shocks_by_preset.end())
1796  {
1797  // Preset not in map, insert it and add shock.
1798  std::vector<Shock*> list;
1799  list.reserve(100);
1800  list.push_back(&shock);
1801  shocks_by_preset.insert(std::make_pair(preset, list));
1802  }
1803  else
1804  {
1805  // Preset in map, just add shock.
1806  found_itor->second.push_back(&shock);
1807  }
1808  }
1809 
1810  // Write shocks to file
1811  m_stream << "shocks" << endl << endl;
1812  auto preset_itor_end = shocks_by_preset.end();
1813  for (auto preset_itor = shocks_by_preset.begin(); preset_itor != preset_itor_end; ++preset_itor)
1814  {
1815  // Write preset
1816  BeamDefaults* preset = preset_itor->first;
1817  ProcessBeamDefaults(preset);
1818 
1819  // Write shocks
1820  auto shock_list = preset_itor->second;
1821  auto shock_itor_end = shock_list.end();
1822  for (auto shock_itor = shock_list.begin(); shock_itor != shock_itor_end; ++shock_itor)
1823  {
1824  Shock & shock = *(*shock_itor);
1825  ProcessShock(shock);
1826  }
1827  }
1828 
1829  // Empty line
1830  m_stream << endl;
1831 }
1832 
1834 {
1835  if (module->shocks2.empty())
1836  {
1837  return;
1838  }
1839 
1840  // Group beams by presets
1841  std::map< BeamDefaults*, std::vector<Shock2*> > shocks_by_preset;
1842  auto itor_end = module->shocks2.end();
1843  for (auto itor = module->shocks2.begin(); itor != itor_end; ++itor)
1844  {
1845  Shock2 & shock = *itor;
1846  BeamDefaults* preset = shock.beam_defaults.get();
1847 
1848  // Ensure preset is in map
1849  auto found_itor = shocks_by_preset.find(preset);
1850  if (found_itor == shocks_by_preset.end())
1851  {
1852  // Preset not in map, insert it and add shock.
1853  std::vector<Shock2*> list;
1854  list.reserve(100);
1855  list.push_back(&shock);
1856  shocks_by_preset.insert(std::make_pair(preset, list));
1857  }
1858  else
1859  {
1860  // Preset in map, just add shock.
1861  found_itor->second.push_back(&shock);
1862  }
1863  }
1864 
1865  // Write shocks to file
1866  m_stream << "shocks2" << endl << endl;
1867  auto preset_itor_end = shocks_by_preset.end();
1868  for (auto preset_itor = shocks_by_preset.begin(); preset_itor != preset_itor_end; ++preset_itor)
1869  {
1870  // Write preset
1871  BeamDefaults* preset = preset_itor->first;
1872  ProcessBeamDefaults(preset);
1873 
1874  // Write shocks
1875  auto shock_list = preset_itor->second;
1876  auto shock_itor_end = shock_list.end();
1877  for (auto shock_itor = shock_list.begin(); shock_itor != shock_itor_end; ++shock_itor)
1878  {
1879  Shock2 & shock = *(*shock_itor);
1880  ProcessShock2(shock);
1881  }
1882  }
1883 
1884  // Empty line
1885  m_stream << endl;
1886 }
1887 
1889 {
1890  if (module->shocks3.empty())
1891  {
1892  return;
1893  }
1894 
1895  // Group beams by presets
1896  std::map< BeamDefaults*, std::vector<Shock3*> > shocks_by_preset;
1897  auto itor_end = module->shocks3.end();
1898  for (auto itor = module->shocks3.begin(); itor != itor_end; ++itor)
1899  {
1900  Shock3 & shock = *itor;
1901  BeamDefaults* preset = shock.beam_defaults.get();
1902 
1903  // Ensure preset is in map
1904  auto found_itor = shocks_by_preset.find(preset);
1905  if (found_itor == shocks_by_preset.end())
1906  {
1907  // Preset not in map, insert it and add shock.
1908  std::vector<Shock3*> list;
1909  list.reserve(100);
1910  list.push_back(&shock);
1911  shocks_by_preset.insert(std::make_pair(preset, list));
1912  }
1913  else
1914  {
1915  // Preset in map, just add shock.
1916  found_itor->second.push_back(&shock);
1917  }
1918  }
1919 
1920  // Write shocks to file
1921  m_stream << "shocks3" << endl << endl;
1922  auto preset_itor_end = shocks_by_preset.end();
1923  for (auto preset_itor = shocks_by_preset.begin(); preset_itor != preset_itor_end; ++preset_itor)
1924  {
1925  // Write preset
1926  BeamDefaults* preset = preset_itor->first;
1927  ProcessBeamDefaults(preset);
1928 
1929  // Write shocks
1930  auto shock_list = preset_itor->second;
1931  auto shock_itor_end = shock_list.end();
1932  for (auto shock_itor = shock_list.begin(); shock_itor != shock_itor_end; ++shock_itor)
1933  {
1934  Shock3 & shock = *(*shock_itor);
1935  ProcessShock3(shock);
1936  }
1937  }
1938 
1939  // Empty line
1940  m_stream << endl;
1941 }
1942 
1944 {
1945  if (module->hydros.empty())
1946  {
1947  return;
1948  }
1949 
1950  // Group by presets
1951  std::map< BeamDefaults*, std::vector<Hydro*> > grouped_by_preset;
1952  auto itor_end = module->hydros.end();
1953  for (auto itor = module->hydros.begin(); itor != itor_end; ++itor)
1954  {
1955  Hydro & hydro = *itor;
1956  BeamDefaults* preset = hydro.beam_defaults.get();
1957 
1958  // Ensure preset is in map
1959  auto found_itor = grouped_by_preset.find(preset);
1960  if (found_itor == grouped_by_preset.end())
1961  {
1962  // Preset not in map, insert it and add hydro.
1963  std::vector<Hydro*> list;
1964  list.reserve(100);
1965  list.push_back(&hydro);
1966  grouped_by_preset.insert(std::make_pair(preset, list));
1967  }
1968  else
1969  {
1970  // Preset in map, just add hydro.
1971  found_itor->second.push_back(&hydro);
1972  }
1973  }
1974 
1975  // Write hydros to file
1976  m_stream << "hydros" << endl << endl;
1977  auto preset_itor_end = grouped_by_preset.end();
1978  for (auto preset_itor = grouped_by_preset.begin(); preset_itor != preset_itor_end; ++preset_itor)
1979  {
1980  // Write preset
1981  BeamDefaults* preset = preset_itor->first;
1982  ProcessBeamDefaults(preset);
1983 
1984  // Write hydros
1985  auto hydro_list = preset_itor->second;
1986  auto hydro_itor_end = hydro_list.end();
1987  for (auto hydro_itor = hydro_list.begin(); hydro_itor != hydro_itor_end; ++hydro_itor)
1988  {
1989  Hydro & hydro = *(*hydro_itor);
1990  ProcessHydro(hydro);
1991  }
1992  }
1993 
1994  // Empty line
1995  m_stream << endl << endl;
1996 }
1997 
1999 {
2000  if (module->commands2.empty())
2001  {
2002  return;
2003  }
2004 
2005  // Group by presets and _format_version
2006  std::map< BeamDefaults*, std::vector<Command2*> > commands_by_preset;
2007  auto itor_end = module->commands2.end();
2008  for (auto itor = module->commands2.begin(); itor != itor_end; ++itor)
2009  {
2010  Command2 & command = *itor;
2011  BeamDefaults* preset = command.beam_defaults.get();
2012 
2013  // Ensure preset is in map
2014  auto found_itor = commands_by_preset.find(preset);
2015  if (found_itor == commands_by_preset.end())
2016  {
2017  // Preset not in map, insert it and add command.
2018  std::vector<Command2*> list;
2019  list.reserve(100);
2020  list.push_back(&command);
2021  commands_by_preset.insert(std::make_pair(preset, list));
2022  }
2023  else
2024  {
2025  // Preset in map, just add command.
2026  found_itor->second.push_back(&command);
2027  }
2028  }
2029 
2030  // Write section "commands2" to file (commands from section "commands" are converted)
2031  m_stream << "commands" << endl << endl;
2032  auto preset_itor_end = commands_by_preset.end();
2033  for (auto preset_itor = commands_by_preset.begin(); preset_itor != preset_itor_end; ++preset_itor)
2034  {
2035  // Write preset
2036  BeamDefaults* preset = preset_itor->first;
2037  ProcessBeamDefaults(preset);
2038 
2039  // Write hydros
2040  auto command_list = preset_itor->second;
2041  auto command_itor_end = command_list.end();
2042  for (auto command_itor = command_list.begin(); command_itor != command_itor_end; ++command_itor)
2043  {
2044  Command2 & command = *(*command_itor);
2045  ProcessCommand2(command);
2046  }
2047  }
2048 
2049  // Empty line
2050  m_stream << endl;
2051 }
2052 
2054 {
2055  m_stream << "\t"
2056  << std::setw(m_node_id_width) << def.nodes[0].ToString() << ", "
2057  << std::setw(m_node_id_width) << def.nodes[1].ToString() << ", ";
2058 
2059  m_stream << std::setw(m_float_width) << def.shorten_rate << ", ";
2060  m_stream << std::setw(m_float_width) << def.lengthen_rate << ", ";
2061  m_stream << std::setw(m_float_width) << def.max_contraction << ", "; // So-called 'shortbound'
2062  m_stream << std::setw(m_float_width) << def.max_extension << ", "; // So-called 'longbound'
2063  m_stream << std::setw(m_command_key_width) << def.contract_key << ", ";
2064  m_stream << std::setw(m_command_key_width) << def.extend_key << ", ";
2065 
2066  // Options
2067  bool dummy = true;
2068  if (def.option_c_auto_center) { m_stream << "c"; dummy = false; }
2069  if (def.option_f_not_faster) { m_stream << "f"; dummy = false; }
2070  if (def.option_i_invisible) { m_stream << "i"; dummy = false; }
2071  if (def.option_o_1press_center) { m_stream << "o"; dummy = false; }
2072  if (def.option_p_1press) { m_stream << "p"; dummy = false; }
2073  if (def.option_r_rope) { m_stream << "r"; dummy = false; }
2074  if (dummy) { m_stream << "n"; } // Placeholder, does nothing
2075 
2076  m_stream << ", ";
2077 
2078  // Description
2079  m_stream << (def.description.length() > 0 ? def.description : "_") << ", ";
2080 
2081  // Inertia
2082  m_stream << std::setw(m_float_width) << def.inertia.start_delay_factor << ", ";
2083  m_stream << std::setw(m_float_width) << def.inertia.stop_delay_factor << ", ";
2084  m_stream << std::setw(m_inertia_function_width) << def.inertia.start_function << ", ";
2085  m_stream << std::setw(m_inertia_function_width) << def.inertia.stop_function << ", ";
2086  m_stream << std::setw(m_float_width) << def.affect_engine << ", ";
2087  m_stream << std::setw(m_bool_width) << (def.needs_engine ? "true" : "false");
2088  m_stream << endl;
2089 }
2090 
2092 {
2093  m_stream << "\t"
2094  << std::setw(m_node_id_width) << def.nodes[0].ToString() << ", "
2095  << std::setw(m_node_id_width) << def.nodes[1].ToString() << ", ";
2096 
2097  m_stream << std::setw(m_float_width) << def.lenghtening_factor << ", ";
2098 
2099  // Options
2112  if (def.options == 0) m_stream << (char)HydroOption::n_INPUT_NORMAL;
2113  m_stream << ", ";
2114 
2115  // Inertia
2116  Inertia & inertia = def.inertia;
2117  m_stream << std::setw(m_float_width) << inertia.start_delay_factor << ", ";
2118  m_stream << std::setw(m_float_width) << inertia.stop_delay_factor;
2119  if (!inertia.start_function.empty())
2120  {
2121  m_stream << ", " << std::setw(m_inertia_function_width) << inertia.start_function;
2122  if (!inertia.stop_function.empty())
2123  {
2124  m_stream << ", " << std::setw(m_inertia_function_width) << inertia.stop_function;
2125  }
2126  }
2127  m_stream << endl;
2128 }
2129 
2131 {
2132  m_stream << "\t"
2133  << std::setw(m_node_id_width) << def.nodes[0].ToString() << ", "
2134  << std::setw(m_node_id_width) << def.nodes[1].ToString() << ", ";
2135  m_stream << std::setw(m_float_width) << def.spring_rate << ", ";
2136  m_stream << std::setw(m_float_width) << def.damping << ", ";
2137  m_stream << std::setw(m_float_width) << def.short_bound << ", ";
2138  m_stream << std::setw(m_float_width) << def.long_bound << ", ";
2139  m_stream << std::setw(m_float_width) << def.precompression << ", ";
2140 
2141  // Options
2142  if (def.options == 0)
2143  {
2144  m_stream << "n"; // Placeholder
2145  }
2146  else
2147  {
2149  {
2150  m_stream << "i";
2151  }
2153  {
2154  m_stream << "m";
2155  }
2157  {
2158  m_stream << "L";
2159  }
2161  {
2162  m_stream << "R";
2163  }
2164  }
2165 
2166  // Empty line
2167  m_stream << endl;
2168 }
2169 
2171 {
2172  m_stream << "\t"
2173  << std::setw(m_node_id_width) << def.nodes[0].ToString() << ", "
2174  << std::setw(m_node_id_width) << def.nodes[1].ToString() << ", ";
2175 
2176  m_stream << std::setw(m_float_width) << def.spring_in << ", ";
2177  m_stream << std::setw(m_float_width) << def.damp_in << ", ";
2178  m_stream << std::setw(m_float_width) << def.progress_factor_spring_in << ", ";
2179  m_stream << std::setw(m_float_width) << def.progress_factor_damp_in << ", ";
2180 
2181  m_stream << std::setw(m_float_width) << def.spring_out << ", ";
2182  m_stream << std::setw(m_float_width) << def.damp_out << ", ";
2183  m_stream << std::setw(m_float_width) << def.progress_factor_spring_out << ", ";
2184  m_stream << std::setw(m_float_width) << def.progress_factor_damp_out << ", ";
2185 
2186  m_stream << std::setw(m_float_width) << def.short_bound << ", ";
2187  m_stream << std::setw(m_float_width) << def.long_bound << ", ";
2188  m_stream << std::setw(m_float_width) << def.precompression << ", ";
2189 
2190  // Options
2191  if (def.options != 0)
2192  {
2193  m_stream << "n"; // Placeholder
2194  }
2195  else
2196  {
2198  {
2199  m_stream << "i";
2200  }
2202  {
2203  m_stream << "m";
2204  }
2206  {
2207  m_stream << "M";
2208  }
2210  {
2211  m_stream << "s";
2212  }
2213  }
2214 
2215  // Empty line
2216  m_stream << endl;
2217 }
2218 
2220 {
2221  m_stream << "\t"
2222  << std::setw(m_node_id_width) << def.nodes[0].ToString() << ", "
2223  << std::setw(m_node_id_width) << def.nodes[1].ToString() << ", ";
2224 
2225  m_stream << std::setw(m_float_width) << def.spring_in << ", ";
2226  m_stream << std::setw(m_float_width) << def.damp_in << ", ";
2227  m_stream << std::setw(m_float_width) << def.damp_in_slow << ", ";
2228  m_stream << std::setw(m_float_width) << def.split_vel_in << ", ";
2229  m_stream << std::setw(m_float_width) << def.damp_in_fast << ", ";
2230 
2231  m_stream << std::setw(m_float_width) << def.spring_out << ", ";
2232  m_stream << std::setw(m_float_width) << def.damp_out << ", ";
2233  m_stream << std::setw(m_float_width) << def.damp_out_slow << ", ";
2234  m_stream << std::setw(m_float_width) << def.split_vel_out << ", ";
2235  m_stream << std::setw(m_float_width) << def.damp_out_fast << ", ";
2236 
2237  m_stream << std::setw(m_float_width) << def.short_bound << ", ";
2238  m_stream << std::setw(m_float_width) << def.long_bound << ", ";
2239  m_stream << std::setw(m_float_width) << def.precompression << ", ";
2240 
2241  // Options
2242  if (def.options != 0)
2243  {
2244  m_stream << "n"; // Placeholder
2245  }
2246  else
2247  {
2249  {
2250  m_stream << "i";
2251  }
2253  {
2254  m_stream << "m";
2255  }
2257  {
2258  m_stream << "M";
2259  }
2260  }
2261 
2262  // Empty line
2263  m_stream << endl;
2264 }
2265 
2266 void Serializer::ProcessBeamDefaults(BeamDefaults* beam_defaults, const char* prefix)
2267 {
2268  if (beam_defaults == nullptr)
2269  {
2270  return;
2271  }
2272  m_stream << prefix << "set_beam_defaults " // Align with "set_beam_defaults_scale"
2273  << beam_defaults->springiness << ", "
2274  << beam_defaults->damping_constant << ", "
2275  << beam_defaults->deformation_threshold << ", "
2276  << beam_defaults->breaking_threshold << ", "
2277  << beam_defaults->visual_beam_diameter << ", "
2278  << beam_defaults->beam_material_name << ", "
2279  << beam_defaults->plastic_deform_coef
2280  << endl;
2281 
2282  BeamDefaultsScale & scale = beam_defaults->scale;
2283  m_stream << prefix << "set_beam_defaults_scale "
2284  << scale.springiness << ", "
2285  << scale.damping_constant << ", "
2286  << scale.deformation_threshold_constant << ", "
2287  << scale.breaking_threshold_constant
2288  << endl;
2289 }
2290 
2292 {
2293  m_stream << "\t"
2294  << std::setw(m_node_id_width) << beam.nodes[0].ToString() << ", "
2295  << std::setw(m_node_id_width) << beam.nodes[1].ToString() << ", ";
2296 
2297  // Options
2298  if (beam.options == 0u)
2299  {
2300  m_stream << "n"; // Placeholder
2301  }
2302  else
2303  {
2305  {
2306  m_stream << "i";
2307  }
2309  {
2310  m_stream << "r";
2311  }
2313  {
2314  m_stream << "s";
2315  }
2316  }
2317 
2318  if (beam._has_extension_break_limit)
2319  {
2320  m_stream << ", " << beam.extension_break_limit;
2321  }
2322 
2323  m_stream << endl;
2324 }
2325 
2327 {
2328  if (module->nodes.empty())
2329  {
2330  return;
2331  }
2332 
2333  // Group nodes by presets + find node-zero
2334  // TODO: Handle minimass presets!
2335  std::map< NodeDefaults*, std::vector<Node*> > nodes_by_presets;
2336  Node* node_zero = nullptr;
2337  auto itor_end = module->nodes.end();
2338  for (auto itor = module->nodes.begin(); itor != itor_end; ++itor)
2339  {
2340  Node & node = *itor;
2341 
2342  // Check zero node
2343  if (node.id.IsValid() && node.id.Str().empty() && node.id.Num() == 0)
2344  {
2345  if (node_zero != nullptr)
2346  {
2347  throw std::runtime_error("FATAL: Multiple nodes zero!!!");
2348  }
2349  node_zero = &node;
2350  continue;
2351  }
2352 
2353  NodeDefaults* preset = node.node_defaults.get();
2354 
2355  // Ensure preset is in map
2356  auto found_itor = nodes_by_presets.find(preset);
2357  if (found_itor == nodes_by_presets.end())
2358  {
2359  // Preset not in map, insert it and add node.
2360  std::vector<Node*> list;
2361  list.reserve(100);
2362  list.push_back(&node);
2363  nodes_by_presets.insert(std::make_pair(preset, list));
2364  }
2365  else
2366  {
2367  // Preset in map, just add node.
2368  found_itor->second.push_back(&node);
2369  }
2370  }
2371 
2372  // == Write nodes to file ==
2373  m_stream << "nodes" << endl << endl;
2374 
2375  // Node zero first
2376  if (node_zero == nullptr)
2377  {
2378  throw std::runtime_error("FATAL: Node zero not defined!!!");
2379  }
2380  ProcessNodeDefaults(node_zero->node_defaults.get());
2381  ProcessNode(*node_zero);
2382 
2383  // Other numbered nodes
2384  auto preset_itor_end = nodes_by_presets.end();
2385  for (auto preset_itor = nodes_by_presets.begin(); preset_itor != preset_itor_end; ++preset_itor)
2386  {
2387  // Write preset
2388  NodeDefaults* preset = preset_itor->first;
2389  ProcessNodeDefaults(preset);
2390 
2391  // Write nodes
2392  std::vector<Node*> & node_list = preset_itor->second;
2393  auto node_itor_end = node_list.end();
2394  for (auto node_itor = node_list.begin(); node_itor != node_itor_end; ++node_itor)
2395  {
2396  Node & node = *(*node_itor);
2397  if (node.id.Str().empty()) // Numbered nodes only
2398  {
2399  ProcessNode(node);
2400  }
2401  }
2402  }
2403 
2404  // Other named nodes
2405  m_stream << endl << endl << "nodes2" << endl << endl;
2406  for (auto preset_itor = nodes_by_presets.begin(); preset_itor != preset_itor_end; ++preset_itor)
2407  {
2408  // Write preset
2409  NodeDefaults* preset = preset_itor->first;
2410  ProcessNodeDefaults(preset);
2411 
2412  // Write nodes
2413  std::vector<Node*> & node_list = preset_itor->second;
2414  auto node_itor_end = node_list.end();
2415  for (auto node_itor = node_list.begin(); node_itor != node_itor_end; ++node_itor)
2416  {
2417  Node & node = *(*node_itor);
2418  if (!node.id.Str().empty() && node.id.Num() == 0) // Named nodes only
2419  {
2420  ProcessNode(node);
2421  }
2422  }
2423  }
2424 
2425  // Empty line
2426  m_stream << endl;
2427 }
2428 
2430 {
2431  m_stream << "set_node_defaults ";
2432  if (node_defaults == nullptr)
2433  {
2434  m_stream << "-1, -1, -1, -1, n" << endl;
2435  return;
2436  }
2437 
2438  m_stream
2439  << node_defaults->load_weight << ", "
2440  << node_defaults->friction << ", "
2441  << node_defaults->volume << ", "
2442  << node_defaults->surface << ", ";
2443 
2444  ProcessNodeOptions(node_defaults->options);
2445 
2446  m_stream << endl;
2447 }
2448 
2449 void Serializer::ProcessNodeOptions(unsigned int options)
2450 {
2451  // Mouse grab
2452  m_stream << (BITMASK_IS_1(options, Node::OPTION_m_NO_MOUSE_GRAB) ? "m" : "n");
2453 
2455  {
2456  m_stream << "b";
2457  }
2459  {
2460  m_stream << "c";
2461  }
2462  if (BITMASK_IS_1(options, Node::OPTION_f_NO_SPARKS))
2463  {
2464  m_stream << "f";
2465  }
2467  {
2468  m_stream << "h";
2469  }
2471  {
2472  m_stream << "l";
2473  }
2474  if (BITMASK_IS_1(options, Node::OPTION_L_LOG))
2475  {
2476  m_stream << "L";
2477  }
2479  {
2480  m_stream << "p";
2481  }
2483  {
2484  m_stream << "x";
2485  }
2487  {
2488  m_stream << "y";
2489  }
2490 }
2491 
2493 {
2494  m_stream
2495  << "\t"
2496  << std::setw(m_node_id_width) << node.id.ToString() << ", "
2497  << std::setw(m_float_width) << node.position.x << ", "
2498  << std::setw(m_float_width) << node.position.y << ", "
2499  << std::setw(m_float_width) << node.position.z << ", ";
2500 
2502 
2503  // Load mass
2504  if (node._has_load_weight_override)
2505  {
2506  m_stream << " " << node.load_weight_override;
2507  }
2508  m_stream << endl;
2509 }
2510 
2512 {
2513  if (m_rig_def->enable_advanced_deformation)
2514  {
2515  m_stream << "enable_advanced_deformation" << endl << endl;
2516  }
2517  if (m_rig_def->hide_in_chooser)
2518  {
2519  m_stream << "hideInChooser" << endl << endl;
2520  }
2521  if (m_rig_def->slide_nodes_connect_instantly)
2522  {
2523  m_stream << "slidenode_connect_instantly" << endl << endl;
2524  }
2525  if (m_rig_def->lockgroup_default_nolock)
2526  {
2527  m_stream << "lockgroup_default_nolock" << endl << endl;
2528  }
2529  if (m_rig_def->rollon)
2530  {
2531  m_stream << "rollon" << endl << endl;
2532  }
2533  if (m_rig_def->rescuer)
2534  {
2535  m_stream << "rescuer" << endl << endl;
2536  }
2537  if (m_rig_def->disable_default_sounds)
2538  {
2539  m_stream << "disabledefaultsounds" << endl << endl;
2540  }
2541  if (m_rig_def->forward_commands)
2542  {
2543  m_stream << "forwardcommands" << endl << endl;
2544  }
2545  if (m_rig_def->import_commands)
2546  {
2547  m_stream << "importcommands" << endl << endl;
2548  }
2549 }
2550 
2552 {
2553  if (module->fileinfo.size() > 0)
2554  {
2555  Fileinfo& data = module->fileinfo[module->fileinfo.size() - 1];
2556 
2557  m_stream << "fileinfo ";
2558  m_stream << data.unique_id;
2559  m_stream << ", " << data.category_id;
2560  m_stream << ", " << data.file_version;
2561 
2562  m_stream << endl << endl;
2563  }
2564 }
2565 
2567 {
2568  if (! module->guid.empty())
2569  {
2570  m_stream << "guid " << module->guid[module->guid.size() - 1].guid << endl << endl;
2571  }
2572 }
2573 
2575 {
2576  if (module->description.size() != 0)
2577  {
2578  m_stream << "description";
2579  for (auto itor = module->description.begin(); itor != module->description.end(); ++itor)
2580  {
2581  std::string line = *itor;
2582  m_stream << endl << line;
2583  }
2584  m_stream << endl << "end_description" << endl << endl;
2585  }
2586 }
2587 
2589 {
2590  for (auto itor = module->author.begin(); itor != module->author.end(); ++itor)
2591  {
2592  Author & def = *itor;
2593  m_stream << "author " << def.type << " ";
2594  if (def._has_forum_account)
2595  {
2596  m_stream << def.forum_account_id << " ";
2597  }
2598  else
2599  {
2600  m_stream << "-1 ";
2601  }
2602  m_stream << def.name << " " << def.email << endl;
2603  }
2604  m_stream << endl;
2605 }
2606 
2608 {
2609  if (module->globals.size() == 0)
2610  {
2611  return;
2612  }
2613 
2614  m_stream << "globals\n\t"
2615  << module->globals[0].dry_mass << ", "
2616  << module->globals[0].cargo_mass;
2617  if (!module->globals[0].material_name.empty())
2618  {
2619  m_stream << ", " << module->globals[0].material_name;
2620  }
2621  m_stream << endl << endl;
2622 }
RigDef::Serializer::m_file_path
Ogre::String m_file_path
Definition: RigDef_Serializer.h:161
ANIMATOR_ADD_LIMIT
#define ANIMATOR_ADD_LIMIT(DEF_VAR, AND_VAR, BITMASK_CONST, NAME_STR, VALUE)
Definition: RigDef_Serializer.cpp:1244
RigDef::Hydro::OPTION_u_INPUT_AILERON_ELEVATOR
static const BitMask_t OPTION_u_INPUT_AILERON_ELEVATOR
Definition: RigDef_File.h:981
RigDef::Command2::contract_key
unsigned int contract_key
Definition: RigDef_File.h:770
RigDef::Animation::SOURCE_EVENT
static const BitMask64_t SOURCE_EVENT
Definition: RigDef_File.h:525
RigDef::Command2::beam_defaults
std::shared_ptr< BeamDefaults > beam_defaults
Definition: RigDef_File.h:777
RigDef::Document::Module::globals
std::vector< Globals > globals
Definition: RigDef_File.h:1516
RigDef::InterAxle::options
DifferentialTypeVec options
Order matters!
Definition: RigDef_File.h:1003
RigDef::Engine::shift_up_rpm
float shift_up_rpm
Definition: RigDef_File.h:808
RigDef::HydroOption::e_INPUT_ELEVATOR
@ e_INPUT_ELEVATOR
RigDef::Command2::extend_key
unsigned int extend_key
Definition: RigDef_File.h:771
RigDef::Shock2::spring_out
float spring_out
spring value applied when shock extending
Definition: RigDef_File.h:1212
RigDef::Trigger::OPTION_c_COMMAND_STYLE
static const BitMask_t OPTION_c_COMMAND_STYLE
Definition: RigDef_File.h:1372
ANIMATOR_ADD_AERIAL_FLAG
#define ANIMATOR_ADD_AERIAL_FLAG(DEF_VAR, AND_VAR, BITMASK_CONST, NAME_STR)
Definition: RigDef_Serializer.cpp:1237
RigDef::Hydro::OPTION_e_INPUT_ELEVATOR
static const BitMask_t OPTION_e_INPUT_ELEVATOR
Definition: RigDef_File.h:980
RigDef::Serializer::ProcessWings
void ProcessWings(Document::Module *module)
Definition: RigDef_Serializer.cpp:294
RigDef::Shock3::beam_defaults
std::shared_ptr< BeamDefaults > beam_defaults
Definition: RigDef_File.h:1247
RigDef::Airbrake::texcoord_x1
float texcoord_x1
Definition: RigDef_File.h:469
RigDef::SlideNode::CONSTRAINT_ATTACH_FOREIGN
static const BitMask_t CONSTRAINT_ATTACH_FOREIGN
Definition: RigDef_File.h:1260
RigDef::SlideNode::constraint_flags
BitMask_t constraint_flags
Definition: RigDef_File.h:1266
PROP_ANIMATION_ADD_FLAG
#define PROP_ANIMATION_ADD_FLAG(FLAGS_VAR, AND_VAR, BITMASK_CONST, NAME_STR)
Definition: RigDef_Serializer.cpp:529
RigDef::Engoption::min_idle_mixture
float min_idle_mixture
Definition: RigDef_File.h:827
RigDef::Wing::tex_coords
float tex_coords[8]
Definition: RigDef_File.h:1465
RigDef::Trigger::OPTION_A_INV_TRIGGER_BLOCKER
static const BitMask_t OPTION_A_INV_TRIGGER_BLOCKER
Definition: RigDef_File.h:1376
RigDef::MaterialFlareBinding::material_name
Ogre::String material_name
Definition: RigDef_File.h:1034
RigDef::Shock3::damp_out_fast
float damp_out_fast
Damping value applied when shock is commpressing faster than split out velocity.
Definition: RigDef_File.h:1242
RigDef::Prop::DashboardSpecial::offset
Ogre::Vector3 offset
Definition: RigDef_File.h:1089
RigDef::Beam::extension_break_limit
float extension_break_limit
Definition: RigDef_File.h:634
RigDef::VideoCamera::left_node
Node::Ref left_node
Definition: RigDef_File.h:1422
RigDef::Serializer::ProcessBrakes
void ProcessBrakes(Document::Module *module)
Definition: RigDef_Serializer.cpp:1469
RigDef::Turboprop2::blade_tip_nodes
Node::Ref blade_tip_nodes[4]
Definition: RigDef_File.h:1411
RigDef::Cab::OPTION_p_10xTOUGHER
static const BitMask_t OPTION_p_10xTOUGHER
Definition: RigDef_File.h:713
RigDef::Serializer::ProcessFileinfo
void ProcessFileinfo(Document::Module *module)
Definition: RigDef_Serializer.cpp:2551
RigDef::GuiSettings
Definition: RigDef_File.h:942
RigDef::SlideNode::tolerance
float tolerance
Definition: RigDef_File.h:1271
RigDef::Document::Module::screwprops
std::vector< Screwprop > screwprops
Definition: RigDef_File.h:1538
RigDef::Turboprop2::axis_node
Node::Ref axis_node
Definition: RigDef_File.h:1410
RigDef::Serializer::ProcessMeshWheels2
void ProcessMeshWheels2(Document::Module *module)
Definition: RigDef_Serializer.cpp:1677
RigDef::Rope::beam_defaults
std::shared_ptr< BeamDefaults > beam_defaults
Definition: RigDef_File.h:1137
RigDef::Serializer::ProcessFlexBodyWheels
void ProcessFlexBodyWheels(Document::Module *module)
Definition: RigDef_Serializer.cpp:1420
RigDef::Node::OPTION_x_EXHAUST_POINT
static const BitMask_t OPTION_x_EXHAUST_POINT
Definition: RigDef_Node.h:148
RigDef::ExtCamera::node
Node::Ref node
Definition: RigDef_File.h:861
RigDef::Serializer::ProcessNodes
void ProcessNodes(Document::Module *)
Definition: RigDef_Serializer.cpp:2326
RigDef::InterAxle::a2
int a2
Definition: RigDef_File.h:1002
RigDef::Hydro::inertia
Inertia inertia
Definition: RigDef_File.h:993
RigDef::Command2::option_f_not_faster
bool option_f_not_faster
Definition: RigDef_File.h:784
RigDef::Prop
Definition: RigDef_File.h:1078
RigDef::Serializer::ProcessRotators2
void ProcessRotators2(Document::Module *module)
Definition: RigDef_Serializer.cpp:1370
RigDef::Serializer::ProcessVideocamera
void ProcessVideocamera(Document::Module *module)
Definition: RigDef_Serializer.cpp:393
RigDef::BeamDefaultsScale::breaking_threshold_constant
float breaking_threshold_constant
Definition: RigDef_File.h:652
RigDef::NodeDefaults::options
unsigned int options
Bit flags.
Definition: RigDef_File.h:1057
RigDef::Tie::group
int group
Definition: RigDef_File.h:1327
RigDef::TractionControl::fade_speed
float fade_speed
Definition: RigDef_File.h:1353
RigDef::Document::Module::hooks
std::vector< Hook > hooks
Definition: RigDef_File.h:1520
RigDef::Prop::offset
Ogre::Vector3 offset
Definition: RigDef_File.h:1109
RigDef::Engine::neutral_gear_ratio
float neutral_gear_ratio
Definition: RigDef_File.h:812
RigDef::Brakes::default_braking_force
float default_braking_force
Definition: RigDef_File.h:705
RigDef::Command2::option_o_1press_center
bool option_o_1press_center
Definition: RigDef_File.h:786
RigDef::Document::Module::brakes
std::vector< Brakes > brakes
Definition: RigDef_File.h:1493
RigDef::VideoCamera::min_clip_distance
float min_clip_distance
Definition: RigDef_File.h:1431
RigDef::Animation::lower_limit
float lower_limit
Definition: RigDef_File.h:545
RigDef::Wing::control_surface
WingControlSurface control_surface
Definition: RigDef_File.h:1466
RigDef::Rotator::needs_engine
bool needs_engine
Definition: RigDef_File.h:1152
RigDef::Shock2::OPTION_s_SOFT_BUMP_BOUNDS
static const BitMask_t OPTION_s_SOFT_BUMP_BOUNDS
Definition: RigDef_File.h:1203
RigDef::ManagedMaterial::diffuse_map
Ogre::String diffuse_map
Definition: RigDef_File.h:1026
RigDef::Hook::option_hookgroup
int option_hookgroup
Definition: RigDef_File.h:961
RigDef::TractionControl::attr_no_dashboard
bool attr_no_dashboard
Definition: RigDef_File.h:1356
RigDef::Serializer::m_inertia_function_width
int m_inertia_function_width
Definition: RigDef_Serializer.h:168
RigDef::Serializer::ProcessTurboprops
void ProcessTurboprops(Document::Module *module)
Definition: RigDef_Serializer.cpp:239
RigDef::Serializer::ProcessGuiSettings
void ProcessGuiSettings(Document::Module *module)
Definition: RigDef_Serializer.cpp:438
RigDef::Serializer::ProcessShocks3
void ProcessShocks3(Document::Module *)
Definition: RigDef_Serializer.cpp:1888
RigDef::Inertia::start_function
Ogre::String start_function
Definition: RigDef_File.h:450
RigDef::VideoCamera::texture_width
unsigned int texture_width
Definition: RigDef_File.h:1429
RigDef::Flare2::type
RoR::FlareType type
Definition: RigDef_File.h:882
RigDef::Animator::long_limit
float long_limit
Definition: RigDef_File.h:592
RigDef::Serializer::ProcessTurbojets
void ProcessTurbojets(Document::Module *module)
Definition: RigDef_Serializer.cpp:186
RigDef_Serializer.h
RigDef::Author
Definition: RigDef_File.h:611
RigDef::Engoption::post_shift_time
float post_shift_time
Seconds.
Definition: RigDef_File.h:823
RigDef::Shock::OPTION_R_ACTIVE_RIGHT
static const BitMask_t OPTION_R_ACTIVE_RIGHT
Definition: RigDef_File.h:1184
RigDef::ManagedMaterialType::MESH_STANDARD
@ MESH_STANDARD
RigDef::Shock::long_bound
float long_bound
Maximum extension. The longest length a shock can be, as a proportion of its original length....
Definition: RigDef_File.h:1191
RigDef::NodeDefaults::surface
float surface
Definition: RigDef_File.h:1056
RigDef::SoundSource2::mode
int mode
A special constant or cinecam index.
Definition: RigDef_File.h:1288
RigDef::Airbrake::texcoord_y1
float texcoord_y1
Definition: RigDef_File.h:471
RigDef::Engoption::shift_time
float shift_time
Seconds.
Definition: RigDef_File.h:821
RigDef::Animation
Definition: RigDef_File.h:476
RigDef::AntiLockBrakes::attr_no_dashboard
bool attr_no_dashboard
Definition: RigDef_File.h:607
RigDef::Document::Module::wheels
std::vector< Wheel > wheels
Definition: RigDef_File.h:1560
RigDef::Command2::max_extension
float max_extension
Definition: RigDef_File.h:769
RigDef::Animator::nodes
Node::Ref nodes[2]
Definition: RigDef_File.h:588
RigDef::HydroOption::y_INPUT_InvAILERON_RUDDER
@ y_INPUT_InvAILERON_RUDDER
RigDef::Engine::gear_ratios
std::vector< float > gear_ratios
Definition: RigDef_File.h:813
RigDef::Tie::auto_shorten_rate
float auto_shorten_rate
Definition: RigDef_File.h:1320
RigDef::MaterialFlareBinding::flare_number
unsigned int flare_number
Definition: RigDef_File.h:1033
RigDef::Tie::min_length
float min_length
Definition: RigDef_File.h:1321
RigDef::Node::Ref::ToString
std::string ToString() const
Definition: RigDef_Node.cpp:103
RigDef::Serializer::m_float_precision
int m_float_precision
Definition: RigDef_Serializer.h:163
RigDef::Turboprop2::airfoil
Ogre::String airfoil
Definition: RigDef_File.h:1413
RigDef::Prop::DashboardSpecial::mesh_name
Ogre::String mesh_name
Definition: RigDef_File.h:1092
RigDef::SkeletonSettings
Definition: RigDef_File.h:1251
RigDef::Engine::global_gear_ratio
float global_gear_ratio
Definition: RigDef_File.h:810
RigDef::Document::Module::pistonprops
std::vector< Pistonprop > pistonprops
Definition: RigDef_File.h:1531
RigDef::Shock3::split_vel_out
float split_vel_out
Split velocity in (m/s) - threshold for slow / fast damping during extension.
Definition: RigDef_File.h:1241
RigDef::RailGroup
Definition: RigDef_File.h:1119
RigDef::TriggerOption::s_CMD_NUM_SWITCH
@ s_CMD_NUM_SWITCH
switch that exchanges cmdshort/cmdshort for all triggers with the same commandnumbers,...
RigDef::Document::Module::lockgroups
std::vector< Lockgroup > lockgroups
Definition: RigDef_File.h:1523
RigDef::HydroOption::a_INPUT_AILERON
@ a_INPUT_AILERON
RigDef::VideoCamera::camera_mode
int camera_mode
Definition: RigDef_File.h:1434
RigDef::Hook::flag_auto_lock
bool flag_auto_lock
Definition: RigDef_File.h:966
RigDef::Document::Module::shocks2
std::vector< Shock2 > shocks2
Definition: RigDef_File.h:1541
RigDef::Document::Module::commands2
std::vector< Command2 > commands2
Definition: RigDef_File.h:1498
RigDef::Serializer::ProcessCommands2
void ProcessCommands2(Document::Module *)
Definition: RigDef_Serializer.cpp:1998
RigDef::Prop::rotation
Ogre::Vector3 rotation
Definition: RigDef_File.h:1110
RigDef::NodeDefaults::volume
float volume
Definition: RigDef_File.h:1055
RigDef::ManagedMaterial::damaged_diffuse_map
Ogre::String damaged_diffuse_map
Definition: RigDef_File.h:1027
RigDef::Engoption::type
EngineType type
Definition: RigDef_File.h:819
RigDef::Serializer::ProcessCollisionBoxes
void ProcessCollisionBoxes(Document::Module *module)
Definition: RigDef_Serializer.cpp:800
RigDef::Rotator::rate
float rate
Definition: RigDef_File.h:1146
RigDef::Document::Module::wings
std::vector< Wing > wings
Definition: RigDef_File.h:1562
RigDef::BeamDefaults::deformation_threshold
float deformation_threshold
Definition: RigDef_File.h:692
RigDef::Particle::particle_system_name
Ogre::String particle_system_name
Definition: RigDef_File.h:1064
RigDef::Hydro
Definition: RigDef_File.h:972
RigDef::Shock::beam_defaults
std::shared_ptr< BeamDefaults > beam_defaults
Definition: RigDef_File.h:1194
RigDef::SlideNode::CONSTRAINT_ATTACH_SELF
static const BitMask_t CONSTRAINT_ATTACH_SELF
Definition: RigDef_File.h:1261
RigDef::CollisionBox
Definition: RigDef_File.h:753
RigDef::SlideNode::break_force
float break_force
Definition: RigDef_File.h:1270
RigDef::Command2::shorten_rate
float shorten_rate
Definition: RigDef_File.h:766
RigDef::Ropable
Definition: RigDef_File.h:1125
RigDef::Trigger::longbound_trigger_action
int longbound_trigger_action
Definition: RigDef_File.h:1391
RigDef::SlideNode::attachment_rate
float attachment_rate
Definition: RigDef_File.h:1272
RigDef::BaseMeshWheel::side
RoR::WheelSide side
Definition: RigDef_File.h:424
RigDef::SoundSource::node
Node::Ref node
Definition: RigDef_File.h:1279
RigDef::Wing::chord_point
float chord_point
Definition: RigDef_File.h:1467
RigDef::Shock2::spring_in
float spring_in
Spring value applied when the shock is compressing.
Definition: RigDef_File.h:1208
RigDef::BaseWheel::width
float width
Definition: RigDef_File.h:410
RigDef::Flexbody::rotation
Ogre::Vector3 rotation
Definition: RigDef_File.h:901
RigDef::Airbrake
Definition: RigDef_File.h:457
RigDef::Document::Module::cruisecontrol
std::vector< CruiseControl > cruisecontrol
Definition: RigDef_File.h:1499
RigDef::Document::Module::ropes
std::vector< Rope > ropes
Definition: RigDef_File.h:1535
RigDef::Flexbody::offset
Ogre::Vector3 offset
Definition: RigDef_File.h:900
RigDef::Tie::options
BitMask_t options
Definition: RigDef_File.h:1323
RigDef::Flare2
Definition: RigDef_File.h:876
RigDef::Shock::OPTION_m_METRIC
static const BitMask_t OPTION_m_METRIC
Definition: RigDef_File.h:1185
RigDef::Serializer::ProcessRopables
void ProcessRopables(Document::Module *module)
Definition: RigDef_Serializer.cpp:972
RigDef::Serializer::ProcessBeamDefaults
void ProcessBeamDefaults(BeamDefaults *beam_defaults, const char *prefix="")
Definition: RigDef_Serializer.cpp:2266
RigDef::Shock::OPTION_L_ACTIVE_LEFT
static const BitMask_t OPTION_L_ACTIVE_LEFT
Definition: RigDef_File.h:1183
RigDef::Serializer::ProcessHydro
void ProcessHydro(Hydro &def)
Definition: RigDef_Serializer.cpp:2091
RigDef::SlideNode::rail_node_ranges
std::vector< Node::Range > rail_node_ranges
Definition: RigDef_File.h:1265
RigDef::GuiSettings::key
std::string key
Definition: RigDef_File.h:944
RigDef::Document::Module::help
std::vector< Help > help
Definition: RigDef_File.h:1519
RigDef::Document::Module::airbrakes
std::vector< Airbrake > airbrakes
Definition: RigDef_File.h:1486
RigDef::Trigger
Definition: RigDef_File.h:1369
RigDef::CollisionBox::nodes
std::vector< Node::Ref > nodes
Definition: RigDef_File.h:755
RigDef::Shock3::precompression
float precompression
Changes compression or extension of the suspension when the truck spawns. This can be used to "level"...
Definition: RigDef_File.h:1245
RigDef::Document::Module::nodes
std::vector< Node > nodes
Definition: RigDef_File.h:1529
RigDef::Airbrake::lift_coefficient
float lift_coefficient
Definition: RigDef_File.h:473
RigDef::BeamDefaults::springiness
float springiness
Definition: RigDef_File.h:690
RigDef::Hydro::OPTION_n_INPUT_NORMAL
static const BitMask_t OPTION_n_INPUT_NORMAL
Definition: RigDef_File.h:988
RigDef::Command2::description
Ogre::String description
Definition: RigDef_File.h:772
RigDef::Serializer::ExportBaseMeshWheel
void ExportBaseMeshWheel(BaseMeshWheel &def)
Definition: RigDef_Serializer.cpp:1641
RigDef::Flare2::node_axis_y
Node::Ref node_axis_y
Definition: RigDef_File.h:880
RigDef::Trigger::nodes
Node::Ref nodes[2]
Definition: RigDef_File.h:1383
RigDef::Axle::wheels
Node::Ref wheels[2][2]
Definition: RigDef_File.h:622
RigDef::VideoCamera::camera_role
int camera_role
Definition: RigDef_File.h:1433
RigDef::Rotator::spin_right_key
unsigned int spin_right_key
Definition: RigDef_File.h:1148
RigDef::BeamDefaults
Definition: RigDef_File.h:655
RigDef::Flare2::blink_delay_milis
int blink_delay_milis
Definition: RigDef_File.h:885
RigDef::Document::Module::slidenodes
std::vector< SlideNode > slidenodes
Definition: RigDef_File.h:1545
RigDef::Document::Module
Definition: RigDef_File.h:1479
RigDef::Node::OPTION_p_NO_PARTICLES
static const BitMask_t OPTION_p_NO_PARTICLES
Definition: RigDef_Node.h:154
RigDef::Cab::OPTION_u_INVULNERABLE
static const BitMask_t OPTION_u_INVULNERABLE
Definition: RigDef_File.h:714
RigDef::Flexbody::animations
std::list< Animation > animations
Definition: RigDef_File.h:903
RigDef::TriggerOption::c_COMMAND_STYLE
@ c_COMMAND_STYLE
trigger is set with commandstyle boundaries instead of shocksytle
RigDef::VideoCamera::rotation
Ogre::Vector3 rotation
Definition: RigDef_File.h:1427
RigDef::Serializer::ProcessShock2
void ProcessShock2(Shock2 &def)
Definition: RigDef_Serializer.cpp:2170
RigDef::Airbrake::y_axis_node
Node::Ref y_axis_node
Definition: RigDef_File.h:463
RigDef::Turboprop2::turbine_power_kW
float turbine_power_kW
Definition: RigDef_File.h:1412
RigDef::SlideNode::_spring_rate_set
bool _spring_rate_set
Definition: RigDef_File.h:1269
RigDef::TriggerOption::B_TRIGGER_BLOCKER
@ B_TRIGGER_BLOCKER
Blocker that enable/disable other triggers.
RigDef::Particle
Definition: RigDef_File.h:1060
RigDef::ManagedMaterialType::MESH_TRANSPARENT
@ MESH_TRANSPARENT
RigDef::Serializer::ProcessAuthors
void ProcessAuthors(Document::Module *module)
Definition: RigDef_Serializer.cpp:2588
RigDef::Engine::shift_down_rpm
float shift_down_rpm
Definition: RigDef_File.h:807
RigDef::CabOption::b_BUOYANT
@ b_BUOYANT
RigDef::NodeDefaults::friction
float friction
Definition: RigDef_File.h:1054
RigDef::Serializer::ProcessShock
void ProcessShock(Shock &def)
Definition: RigDef_Serializer.cpp:2130
RigDef::CabOption::D_CONTACT_BUOYANT
@ D_CONTACT_BUOYANT
RigDef::Document::Module::axles
std::vector< Axle > axles
Definition: RigDef_File.h:1491
RigDef::Engoption::braking_torque
float braking_torque
Definition: RigDef_File.h:828
RigDef::SkeletonSettings::beam_thickness_meters
float beam_thickness_meters
Definition: RigDef_File.h:1254
RigDef::Flexbody::reference_node
Node::Ref reference_node
Definition: RigDef_File.h:897
RigDef::BeamDefaults::breaking_threshold
float breaking_threshold
Definition: RigDef_File.h:693
RigDef::Document::Module::author
std::vector< Author > author
Definition: RigDef_File.h:1490
RigDef::Animator::short_limit
float short_limit
Definition: RigDef_File.h:591
RigDef::SlideNode::_tolerance_set
bool _tolerance_set
Definition: RigDef_File.h:1271
RigDef::TriggerOption::t_CONTINUOUS
@ t_CONTINUOUS
this trigger sends values between 0 and 1
RigDef::Shock2::long_bound
float long_bound
Maximum extension limit, in percentage ( 1.00 = 100% )
Definition: RigDef_File.h:1217
RigDef::Node::Ref::IsValidAnyState
bool IsValidAnyState() const
Definition: RigDef_Node.h:101
RigDef::Serializer::ProcessEngine
void ProcessEngine(Document::Module *module)
Definition: RigDef_Serializer.cpp:1493
RigDef::Serializer::ProcessNodeOptions
void ProcessNodeOptions(unsigned int options)
Definition: RigDef_Serializer.cpp:2449
RigDef::Node::OPTION_m_NO_MOUSE_GRAB
static const BitMask_t OPTION_m_NO_MOUSE_GRAB
Definition: RigDef_Node.h:146
RigDef::Rotator::axis_nodes
Node::Ref axis_nodes[2]
Definition: RigDef_File.h:1143
RigDef::BeamDefaultsScale
Definition: RigDef_File.h:640
RigDef::Trigger::options
BitMask_t options
Definition: RigDef_File.h:1386
RigDef::NodeDefaults
Definition: RigDef_File.h:1049
RigDef::Serializer::ProcessManagedMaterialsAndOptions
void ProcessManagedMaterialsAndOptions(Document::Module *module)
Definition: RigDef_Serializer.cpp:746
RigDef::Hook
Definition: RigDef_File.h:953
RigDef::Hydro::options
BitMask_t options
Definition: RigDef_File.h:992
RigDef::Serializer::ProcessFusedrag
void ProcessFusedrag(Document::Module *module)
Definition: RigDef_Serializer.cpp:231
RigDef::HydroOption::u_INPUT_AILERON_ELEVATOR
@ u_INPUT_AILERON_ELEVATOR
RigDef::Document::Module::submeshes
std::vector< Submesh > submeshes
Definition: RigDef_File.h:1550
RigDef::AntiLockBrakes
Definition: RigDef_File.h:599
RigDef::Trigger::OPTION_B_TRIGGER_BLOCKER
static const BitMask_t OPTION_B_TRIGGER_BLOCKER
Definition: RigDef_File.h:1375
RigDef::InterAxle::a1
int a1
Definition: RigDef_File.h:1001
RigDef::Document::Module::guisettings
std::vector< GuiSettings > guisettings
Definition: RigDef_File.h:1518
RigDef::Ropable::has_multilock
bool has_multilock
Definition: RigDef_File.h:1129
Actor.h
RigDef::Ropable::node
Node::Ref node
Definition: RigDef_File.h:1127
RigDef::TractionControl::pulse_per_sec
float pulse_per_sec
Definition: RigDef_File.h:1354
RigDef::Shock3::damp_in
float damp_in
Damping value applied when the shock is compressing.
Definition: RigDef_File.h:1234
RigDef::Shock2::damp_out
float damp_out
damping value applied when shock extending
Definition: RigDef_File.h:1213
RigDef::TriggerOption::x_START_DISABLED
@ x_START_DISABLED
this trigger is disabled on startup, default is enabled
RigDef::Engoption::clutch_time
float clutch_time
Seconds.
Definition: RigDef_File.h:822
RigDef::Shock3::spring_out
float spring_out
Spring value applied when shock extending.
Definition: RigDef_File.h:1235
RigDef::Brakes
Definition: RigDef_File.h:703
RigDef::Command2
Definition: RigDef_File.h:763
RigDef::Tie::max_stress
float max_stress
Definition: RigDef_File.h:1324
RigDef::SlideNode::max_attach_dist
float max_attach_dist
Definition: RigDef_File.h:1274
RigDef::SoundSource2
Definition: RigDef_File.h:1283
RigDef::TriggerOption::i_INVISIBLE
@ i_INVISIBLE
invisible
RigDef::Particle::emitter_node
Node::Ref emitter_node
Definition: RigDef_File.h:1062
RigDef::Serializer::ProcessSlideNodes
void ProcessSlideNodes(Document::Module *module)
Definition: RigDef_Serializer.cpp:1088
RigDef::Author::name
Ogre::String name
Definition: RigDef_File.h:615
RigDef::Hydro::OPTION_g_INPUT_ELEVATOR_RUDDER
static const BitMask_t OPTION_g_INPUT_ELEVATOR_RUDDER
Definition: RigDef_File.h:985
RigDef::Command2::option_r_rope
bool option_r_rope
Definition: RigDef_File.h:782
RigDef::Serializer::ProcessTriggers
void ProcessTriggers(Document::Module *module)
Definition: RigDef_Serializer.cpp:1193
RigDef::BaseMeshWheel::rim_radius
float rim_radius
Definition: RigDef_File.h:427
RigDef::Node::position
Ogre::Vector3 position
Definition: RigDef_Node.h:159
RigDef::Fileinfo
Definition: RigDef_File.h:869
RigDef::Document::Module::meshwheels2
std::vector< MeshWheel2 > meshwheels2
Definition: RigDef_File.h:1527
RigDef::Serializer::WriteFlags
void WriteFlags()
Definition: RigDef_Serializer.cpp:2511
RigDef::CabOption::S_INVULNERABLE_BUOYANT
@ S_INVULNERABLE_BUOYANT
RigDef::Shock::short_bound
float short_bound
Maximum contraction. The shortest length the shock can be, as a proportion of its original length....
Definition: RigDef_File.h:1190
RigDef::Shock2::OPTION_m_METRIC
static const BitMask_t OPTION_m_METRIC
Definition: RigDef_File.h:1204
RigDef::Document::Module::set_skeleton_settings
std::vector< SkeletonSettings > set_skeleton_settings
Definition: RigDef_File.h:1544
RigDef::BeamDefaults::damping_constant
float damping_constant
Definition: RigDef_File.h:691
RigDef::BaseMeshWheel::spring
float spring
Definition: RigDef_File.h:429
RigDef::VideoCamera::alt_reference_node
Node::Ref alt_reference_node
Definition: RigDef_File.h:1424
RigDef::Shock::spring_rate
float spring_rate
The 'stiffness' of the shock. The higher the value, the less the shock will move for a given bump.
Definition: RigDef_File.h:1188
RigDef::Fileinfo::unique_id
Ogre::String unique_id
Definition: RigDef_File.h:871
RigDef::Engoption::max_idle_mixture
float max_idle_mixture
Definition: RigDef_File.h:826
RigDef::Document::Module::turbojets
std::vector< Turbojet > turbojets
Definition: RigDef_File.h:1556
RigDef::Serializer::ProcessEngoption
void ProcessEngoption(Document::Module *module)
Definition: RigDef_Serializer.cpp:1527
RigDef::Serializer::ProcessRopes
void ProcessRopes(Document::Module *module)
Definition: RigDef_Serializer.cpp:1031
RigDef::Command2::option_p_1press
bool option_p_1press
Definition: RigDef_File.h:785
RigDef::Document::Module::ties
std::vector< Tie > ties
Definition: RigDef_File.h:1551
RigDef::Command2::inertia
Inertia inertia
Definition: RigDef_File.h:773
RigDef::ManagedMaterial::type
ManagedMaterialType type
Definition: RigDef_File.h:1024
RigDef::Node::OPTION_l_LOAD_WEIGHT
static const BitMask_t OPTION_l_LOAD_WEIGHT
Definition: RigDef_Node.h:156
RigDef::ManagedMaterial::options
ManagedMaterialsOptions options
Definition: RigDef_File.h:1025
RigDef::ManagedMaterial::name
Ogre::String name
Definition: RigDef_File.h:1023
RigDef::Prop::special
SpecialProp special
Definition: RigDef_File.h:1114
RigDef::Serializer::m_float_width
int m_float_width
Definition: RigDef_Serializer.h:164
RigDef::ManagedMaterialType::FLEXMESH_STANDARD
@ FLEXMESH_STANDARD
RigDef::Serializer::ProcessCinecam
void ProcessCinecam(Document::Module *)
Definition: RigDef_Serializer.cpp:1691
RigDef::AntiLockBrakes::attr_no_toggle
bool attr_no_toggle
Definition: RigDef_File.h:608
RigDef::Flare2::material_name
Ogre::String material_name
Definition: RigDef_File.h:887
RigDef::BaseWheel::mass
float mass
Definition: RigDef_File.h:417
RigDef::Document::Module::contacters
std::vector< Node::Ref > contacters
Definition: RigDef_File.h:1500
RigDef::Document::Module::cinecam
std::vector< Cinecam > cinecam
Definition: RigDef_File.h:1497
RigDef::Serializer::ProcessNodeDefaults
void ProcessNodeDefaults(NodeDefaults *node_defaults)
Definition: RigDef_Serializer.cpp:2429
RigDef::Node::_has_load_weight_override
bool _has_load_weight_override
Definition: RigDef_Node.h:162
RigDef::Document::Module::wheels2
std::vector< Wheel2 > wheels2
Definition: RigDef_File.h:1561
RigDef::Engoption
Definition: RigDef_File.h:816
RigDef::Shock2::OPTION_i_INVISIBLE
static const BitMask_t OPTION_i_INVISIBLE
Definition: RigDef_File.h:1202
RigDef::Trigger::OPTION_i_INVISIBLE
static const BitMask_t OPTION_i_INVISIBLE
Definition: RigDef_File.h:1371
RigDef::Beam::_has_extension_break_limit
bool _has_extension_break_limit
Definition: RigDef_File.h:635
RigDef::CruiseControl::min_speed
float min_speed
Definition: RigDef_File.h:791
RigDef::Author::_has_forum_account
bool _has_forum_account
Definition: RigDef_File.h:617
RigDef::AntiLockBrakes::min_speed
unsigned int min_speed
Definition: RigDef_File.h:604
RigDef::VideoCamera::texture_height
unsigned int texture_height
Definition: RigDef_File.h:1430
RigDef::SlideNode::spring_rate
float spring_rate
Definition: RigDef_File.h:1269
RigDef::Document::Module::transfercase
std::vector< TransferCase > transfercase
Definition: RigDef_File.h:1554
RigDef::Shock2
Definition: RigDef_File.h:1198
RigDef::BaseWheel::num_rays
unsigned int num_rays
Definition: RigDef_File.h:411
RigDef::Shock2::OPTION_M_ABSOLUTE_METRIC
static const BitMask_t OPTION_M_ABSOLUTE_METRIC
Definition: RigDef_File.h:1205
RigDef::Inertia::stop_delay_factor
float stop_delay_factor
Definition: RigDef_File.h:449
RigDef::Serializer::ProcessPropsAndAnimations
void ProcessPropsAndAnimations(Document::Module *module)
Definition: RigDef_Serializer.cpp:648
RigDef::Serializer::ProcessContacters
void ProcessContacters(Document::Module *module)
Definition: RigDef_Serializer.cpp:1312
RigDef::Serializer::ProcessTorqueCurve
void ProcessTorqueCurve(Document::Module *module)
Definition: RigDef_Serializer.cpp:929
RigDef::BaseWheel::rigidity_node
Node::Ref rigidity_node
Definition: RigDef_File.h:413
RigDef::Document::Module::rotators2
std::vector< Rotator2 > rotators2
Definition: RigDef_File.h:1537
RigDef::Document::Module::description
std::vector< Ogre::String > description
Definition: RigDef_File.h:1502
RigDef::Hydro::nodes
Node::Ref nodes[2]
Definition: RigDef_File.h:990
RigDef::Serializer::Serialize
void Serialize()
Definition: RigDef_Serializer.cpp:53
RigDef::Serializer::ProcessAnimators
void ProcessAnimators(Document::Module *module)
Definition: RigDef_Serializer.cpp:1251
RigDef
Definition: RigDef_File.cpp:32
RigDef::Node::load_weight_override
float load_weight_override
Definition: RigDef_Node.h:161
RigDef::Serializer::ProcessExtCamera
void ProcessExtCamera(Document::Module *module)
Definition: RigDef_Serializer.cpp:368
RigDef::Trigger::OPTION_x_START_DISABLED
static const BitMask_t OPTION_x_START_DISABLED
Definition: RigDef_File.h:1373
RigDef::Serializer::ProcessWheels2
void ProcessWheels2(Document::Module *module)
Definition: RigDef_Serializer.cpp:1574
RigDef::CruiseControl::autobrake
int autobrake
Definition: RigDef_File.h:792
RigDef::Serializer::ProcessFlares2
void ProcessFlares2(Document::Module *module)
Definition: RigDef_Serializer.cpp:720
RigDef::Node::Id::Str
const std::string & Str() const
Definition: RigDef_Node.h:61
RigDef::Serializer::ProcessPistonprops
void ProcessPistonprops(Document::Module *module)
Definition: RigDef_Serializer.cpp:160
RigDef::Hydro::OPTION_a_INPUT_AILERON
static const BitMask_t OPTION_a_INPUT_AILERON
Definition: RigDef_File.h:978
RigDef::TractionControl
Definition: RigDef_File.h:1347
BITMASK_IS_1
#define BITMASK_IS_1(VAR, FLAGS)
Definition: BitFlags.h:14
RigDef::SlideNode::slide_node
Node::Ref slide_node
Definition: RigDef_File.h:1264
RigDef::Document::Module::animators
std::vector< Animator > animators
Definition: RigDef_File.h:1487
RigDef::Wing::max_deflection
float max_deflection
Definition: RigDef_File.h:1469
RigDef::Document::Module::turboprops2
std::vector< Turboprop2 > turboprops2
Definition: RigDef_File.h:1557
RigDef::Node::id
Id id
Definition: RigDef_Node.h:158
RigDef::Cab::OPTION_c_CONTACT
static const BitMask_t OPTION_c_CONTACT
Definition: RigDef_File.h:711
RigDef::VideoCamera::alt_orientation_node
Node::Ref alt_orientation_node
Definition: RigDef_File.h:1425
RigDef::VideoCamera::bottom_node
Node::Ref bottom_node
Definition: RigDef_File.h:1423
RigDef::Engine::torque
float torque
Definition: RigDef_File.h:809
RigDef::Document::Module::triggers
std::vector< Trigger > triggers
Definition: RigDef_File.h:1555
RigDef::Flare2::reference_node
Node::Ref reference_node
Definition: RigDef_File.h:878
RigDef::Tie::max_length
float max_length
Definition: RigDef_File.h:1322
RigDef::Serializer::ProcessGuid
void ProcessGuid(Document::Module *module)
Definition: RigDef_Serializer.cpp:2566
RigDef::ManagedMaterial::specular_map
Ogre::String specular_map
Definition: RigDef_File.h:1028
RigDef::Serializer::m_command_key_width
int m_command_key_width
Definition: RigDef_Serializer.h:167
RigDef::Flare2::offset
Ogre::Vector3 offset
Definition: RigDef_File.h:881
RigDef::Fileinfo::file_version
int file_version
Definition: RigDef_File.h:873
RigDef::Serializer::ProcessAntiLockBrakes
void ProcessAntiLockBrakes(Document::Module *module)
Definition: RigDef_Serializer.cpp:1478
RigDef::SlideNode::railgroup_id
int railgroup_id
Definition: RigDef_File.h:1273
RigDef::Shock2::short_bound
float short_bound
Maximum contraction limit, in percentage ( 1.00 = 100% )
Definition: RigDef_File.h:1216
RigDef::Airbrake::height
float height
Definition: RigDef_File.h:467
RigDef::Shock3::spring_in
float spring_in
Spring value applied when the shock is compressing.
Definition: RigDef_File.h:1233
RigDef::Shock2::precompression
float precompression
Changes compression or extension of the suspension when the truck spawns. This can be used to "level"...
Definition: RigDef_File.h:1218
RigDef::Tie::max_reach_length
float max_reach_length
Definition: RigDef_File.h:1319
RigDef::Wing::nodes
Node::Ref nodes[8]
Definition: RigDef_File.h:1464
RigDef::Airbrake::reference_node
Node::Ref reference_node
Definition: RigDef_File.h:461
RigDef::Document::Module::extcamera
std::vector< ExtCamera > extcamera
Definition: RigDef_File.h:1507
RigDef::Hydro::OPTION_v_INPUT_InvAILERON_ELEVATOR
static const BitMask_t OPTION_v_INPUT_InvAILERON_ELEVATOR
Definition: RigDef_File.h:982
RigDef::MeshWheel
Definition: RigDef_File.h:1043
RigDef::ManagedMaterial
Definition: RigDef_File.h:1021
RigDef::TransferCase::a1
int a1
Definition: RigDef_File.h:1362
RigDef::Document::Module::rotators
std::vector< Rotator > rotators
Definition: RigDef_File.h:1536
RigDef::Airbrake::aditional_node
Node::Ref aditional_node
Definition: RigDef_File.h:464
RigDef::BeamDefaults::scale
BeamDefaultsScale scale
Definition: RigDef_File.h:700
RigDef::Serializer::ProcessMeshWheels
void ProcessMeshWheels(Document::Module *module)
Definition: RigDef_Serializer.cpp:1663
RigDef::InterAxle
Definition: RigDef_File.h:999
RigDef::Serializer::ProcessBeams
void ProcessBeams(Document::Module *)
Definition: RigDef_Serializer.cpp:1723
RigDef::Node::OPTION_L_LOG
static const BitMask_t OPTION_L_LOG
Definition: RigDef_Node.h:155
RigDef::Shock2::progress_factor_spring_out
float progress_factor_spring_out
Progression factor springout, 0 = disabled, 1...x as multipliers, example:maximum springrate == sprin...
Definition: RigDef_File.h:1214
RigDef::Engoption::clutch_force
float clutch_force
Definition: RigDef_File.h:820
RigDef::Trigger::expansion_trigger_limit
float expansion_trigger_limit
Definition: RigDef_File.h:1385
RigDef::TriggerOption::A_INV_TRIGGER_BLOCKER
@ A_INV_TRIGGER_BLOCKER
Blocker that enable/disable other triggers, reversed activation method (inverted Blocker style,...
RigDef::Shock3::long_bound
float long_bound
Maximum extension limit, in percentage ( 1.00 = 100% )
Definition: RigDef_File.h:1244
RigDef::SlideNode::_break_force_set
bool _break_force_set
Definition: RigDef_File.h:1270
RigDef::Flexbody::mesh_name
Ogre::String mesh_name
Definition: RigDef_File.h:902
RigDef::Serializer::ProcessLockgroups
void ProcessLockgroups(Document::Module *module)
Definition: RigDef_Serializer.cpp:1171
RigDef::AntiLockBrakes::attr_is_on
bool attr_is_on
Definition: RigDef_File.h:606
RigDef::Serializer::ProcessSoundsources2
void ProcessSoundsources2(Document::Module *module)
Definition: RigDef_Serializer.cpp:349
RigDef::TransferCase::gear_ratios
std::vector< float > gear_ratios
Definition: RigDef_File.h:1366
RigDef::Submesh
Definition: RigDef_File.h:1299
RigDef::Shock3::damp_in_fast
float damp_in_fast
Damping value applied when shock is commpressing faster than split in velocity.
Definition: RigDef_File.h:1239
RigDef::Shock3::nodes
Node::Ref nodes[2]
Definition: RigDef_File.h:1232
RigDef::Document::Module::flares2
std::vector< Flare2 > flares2
Definition: RigDef_File.h:1511
RigDef::Hook::flag_no_disable
bool flag_no_disable
Definition: RigDef_File.h:967
RigDef::Animation::ratio
float ratio
Definition: RigDef_File.h:544
RigDef::Airbrake::max_inclination_angle
float max_inclination_angle
Definition: RigDef_File.h:468
RigDef::Wing::min_deflection
float min_deflection
Definition: RigDef_File.h:1468
RigDef::Inertia
Definition: RigDef_File.h:441
RigDef::Trigger::OPTION_s_CMD_NUM_SWITCH
static const BitMask_t OPTION_s_CMD_NUM_SWITCH
Definition: RigDef_File.h:1377
RigDef::Animation::mode
BitMask_t mode
Definition: RigDef_File.h:549
RigDef::Axle::options
DifferentialTypeVec options
Order matters!
Definition: RigDef_File.h:623
RigDef::BaseMeshWheel::damping
float damping
Definition: RigDef_File.h:430
RigDef::Shock
Definition: RigDef_File.h:1180
RigDef::Document::Module::shocks
std::vector< Shock > shocks
Definition: RigDef_File.h:1540
RigDef::Command2::lengthen_rate
float lengthen_rate
Definition: RigDef_File.h:767
RigDef::BaseMeshWheel
Definition: RigDef_File.h:422
RigDef::Shock2::progress_factor_spring_in
float progress_factor_spring_in
Progression factor for springin. A value of 0 disables this option. 1...x as multipliers,...
Definition: RigDef_File.h:1210
RigDef::Serializer::ProcessScrewprops
void ProcessScrewprops(Document::Module *module)
Definition: RigDef_Serializer.cpp:211
RigDef::Trigger::shortbound_trigger_action
int shortbound_trigger_action
Definition: RigDef_File.h:1390
RigDef::Hydro::OPTION_y_INPUT_InvAILERON_RUDDER
static const BitMask_t OPTION_y_INPUT_InvAILERON_RUDDER
Definition: RigDef_File.h:984
RigDef::Beam::OPTION_s_SUPPORT
static const BitMask_t OPTION_s_SUPPORT
Definition: RigDef_File.h:630
RigDef::Rotator::engine_coupling
float engine_coupling
Definition: RigDef_File.h:1151
RigDef::Serializer::ProcessRotators
void ProcessRotators(Document::Module *module)
Definition: RigDef_Serializer.cpp:1326
RigDef::Hook::option_hook_range
float option_hook_range
Definition: RigDef_File.h:958
RigDef::BeamDefaults::visual_beam_diameter
float visual_beam_diameter
Definition: RigDef_File.h:694
RigDef::Shock3::options
BitMask_t options
Definition: RigDef_File.h:1246
RigDef::HydroOption::g_INPUT_ELEVATOR_RUDDER
@ g_INPUT_ELEVATOR_RUDDER
RigDef::Trigger::OPTION_b_KEY_BLOCKER
static const BitMask_t OPTION_b_KEY_BLOCKER
Definition: RigDef_File.h:1374
RigDef::Serializer::ProcessSoundsources
void ProcessSoundsources(Document::Module *module)
Definition: RigDef_Serializer.cpp:332
RigDef::Serializer::ProcessHooks
void ProcessHooks(Document::Module *module)
Definition: RigDef_Serializer.cpp:1137
RigDef::SpecialProp::BEACON
@ BEACON
RigDef::Engoption::stall_rpm
float stall_rpm
Definition: RigDef_File.h:825
RigDef::MaterialFlareBinding
Definition: RigDef_File.h:1031
RigDef::TriggerOption::b_KEY_BLOCKER
@ b_KEY_BLOCKER
Set the CommandKeys that are set in a commandkeyblocker or trigger to blocked on startup,...
RigDef::Beam::OPTION_i_INVISIBLE
static const BitMask_t OPTION_i_INVISIBLE
Definition: RigDef_File.h:628
RigDef::Prop::mesh_name
Ogre::String mesh_name
Definition: RigDef_File.h:1111
RigDef::HydroOption::r_INPUT_RUDDER
@ r_INPUT_RUDDER
RigDef::VideoCamera::field_of_view
float field_of_view
Definition: RigDef_File.h:1428
RigDef::Document::Module::engine
std::vector< Engine > engine
Definition: RigDef_File.h:1503
RigDef::Rope::invisible
bool invisible
Definition: RigDef_File.h:1136
RigDef::Node::Id::Num
unsigned int Num() const
Definition: RigDef_Node.h:62
RigDef::Serializer::ProcessWheels
void ProcessWheels(Document::Module *module)
Definition: RigDef_Serializer.cpp:1609
RigDef::Beam::defaults
std::shared_ptr< BeamDefaults > defaults
Definition: RigDef_File.h:637
RigDef::Lockgroup
Definition: RigDef_File.h:1006
RigDef::Hook::option_max_force
float option_max_force
Definition: RigDef_File.h:960
RigDef::Flare2::node_axis_x
Node::Ref node_axis_x
Definition: RigDef_File.h:879
RigDef::Animator
Definition: RigDef_File.h:556
RigDef::Document::Module::exhausts
std::vector< Exhaust > exhausts
Definition: RigDef_File.h:1506
RigDef::TriggerOption::H_LOCKS_HOOK_GROUP
@ H_LOCKS_HOOK_GROUP
RigDef::Brakes::parking_brake_force
float parking_brake_force
Definition: RigDef_File.h:706
RigDef::NodeDefaults::load_weight
float load_weight
Definition: RigDef_File.h:1053
RigDef::Author::email
Ogre::String email
Definition: RigDef_File.h:616
RigDef::Rope::end_node
Node::Ref end_node
Definition: RigDef_File.h:1135
RigDef::Flexbody
Definition: RigDef_File.h:895
RigDef::Serializer::ProcessCommand2
void ProcessCommand2(Command2 &def)
Definition: RigDef_Serializer.cpp:2053
RigDef::Document::Module::railgroups
std::vector< RailGroup > railgroups
Definition: RigDef_File.h:1533
RigDef::Hook::option_min_range_meters
float option_min_range_meters
Definition: RigDef_File.h:964
RigDef::SpecialProp::DASHBOARD_RIGHT
@ DASHBOARD_RIGHT
RigDef::Command2::option_i_invisible
bool option_i_invisible
Definition: RigDef_File.h:781
RigDef::Trigger::OPTION_h_UNLOCKS_HOOK_GROUP
static const BitMask_t OPTION_h_UNLOCKS_HOOK_GROUP
Definition: RigDef_File.h:1378
RigDef::VideoCamera
Definition: RigDef_File.h:1417
RigDef::Cab::OPTION_D_CONTACT_BUOYANT
static const BitMask_t OPTION_D_CONTACT_BUOYANT
Definition: RigDef_File.h:717
RigDef::TriggerOption::h_UNLOCKS_HOOK_GROUP
@ h_UNLOCKS_HOOK_GROUP
RigDef::Shock2::nodes
Node::Ref nodes[2]
Definition: RigDef_File.h:1207
RigDef::TransferCase
Definition: RigDef_File.h:1360
RigDef::Rotator::inertia
Inertia inertia
Definition: RigDef_File.h:1149
RigDef::Trigger::OPTION_t_CONTINUOUS
static const BitMask_t OPTION_t_CONTINUOUS
Definition: RigDef_File.h:1380
RigDef::Submesh::texcoords
std::vector< Texcoord > texcoords
Definition: RigDef_File.h:1302
RigDef::Wing::airfoil
Ogre::String airfoil
Definition: RigDef_File.h:1470
RigDef::HydroOption::n_INPUT_NORMAL
@ n_INPUT_NORMAL
RigDef::Submesh::cab_triangles
std::vector< Cab > cab_triangles
Definition: RigDef_File.h:1303
RigDef::Shock::precompression
float precompression
Changes compression or extension of the suspension when the truck spawns. This can be used to "level"...
Definition: RigDef_File.h:1192
RigDef::Shock2::beam_defaults
std::shared_ptr< BeamDefaults > beam_defaults
Definition: RigDef_File.h:1220
RigDef::Turboprop2
Definition: RigDef_File.h:1407
RigDef::Serializer::ProcessSubmeshGroundmodel
void ProcessSubmeshGroundmodel(Document::Module *module)
Definition: RigDef_Serializer.cpp:471
RigDef::TractionControl::wheel_slip
float wheel_slip
Definition: RigDef_File.h:1352
RigDef::Serializer::m_rig_def
RigDef::DocumentPtr m_rig_def
Definition: RigDef_Serializer.h:162
RigDef::Document::Module::props
std::vector< Prop > props
Definition: RigDef_File.h:1532
RigDef::Serializer::ProcessFlexbodies
void ProcessFlexbodies(Document::Module *module)
Definition: RigDef_Serializer.cpp:599
RigDef::Serializer::ProcessAirbrakes
void ProcessAirbrakes(Document::Module *module)
Definition: RigDef_Serializer.cpp:263
RigDef::Inertia::start_delay_factor
float start_delay_factor
Definition: RigDef_File.h:448
RigDef::Prop::y_axis_node
Node::Ref y_axis_node
Definition: RigDef_File.h:1108
RigDef::TractionControl::attr_is_on
bool attr_is_on
Definition: RigDef_File.h:1355
RigDef::Serializer::ProcessShocks2
void ProcessShocks2(Document::Module *)
Definition: RigDef_Serializer.cpp:1833
RigDef::Serializer::ProcessTies
void ProcessTies(Document::Module *module)
Definition: RigDef_Serializer.cpp:991
RigDef::Cab::OPTION_s_BUOYANT_NO_DRAG
static const BitMask_t OPTION_s_BUOYANT_NO_DRAG
Definition: RigDef_File.h:715
RigDef::BaseMeshWheel::tyre_radius
float tyre_radius
Definition: RigDef_File.h:428
RigDef::VideoCamera::offset
Ogre::Vector3 offset
Definition: RigDef_File.h:1426
RigDef::Hydro::OPTION_s_DISABLE_ON_HIGH_SPEED
static const BitMask_t OPTION_s_DISABLE_ON_HIGH_SPEED
Definition: RigDef_File.h:976
RigDef::Engine::reverse_gear_ratio
float reverse_gear_ratio
Definition: RigDef_File.h:811
RigDef::Document::Module::fileinfo
std::vector< Fileinfo > fileinfo
Definition: RigDef_File.h:1510
RigDef::Trigger::OPTION_E_ENGINE_TRIGGER
static const BitMask_t OPTION_E_ENGINE_TRIGGER
Definition: RigDef_File.h:1381
RigDef::Node::OPTION_y_EXHAUST_DIRECTION
static const BitMask_t OPTION_y_EXHAUST_DIRECTION
Definition: RigDef_Node.h:149
RigDef::BeamDefaultsScale::deformation_threshold_constant
float deformation_threshold_constant
Definition: RigDef_File.h:651
RigDef::ManagedMaterialsOptions::double_sided
bool double_sided
Definition: RigDef_File.h:1018
RigDef::Serializer::ProcessExhausts
void ProcessExhausts(Document::Module *module)
Definition: RigDef_Serializer.cpp:452
RigDef::Exhaust::direction_node
Node::Ref direction_node
Definition: RigDef_File.h:854
RigDef::Rotator::rotating_plate_nodes
Node::Ref rotating_plate_nodes[4]
Definition: RigDef_File.h:1145
RigDef::CabOption::r_BUOYANT_ONLY_DRAG
@ r_BUOYANT_ONLY_DRAG
RigDef::Flexbody::node_list
std::vector< Node::Ref > node_list
Definition: RigDef_File.h:905
RigDef::Node::OPTION_b_EXTRA_BUOYANCY
static const BitMask_t OPTION_b_EXTRA_BUOYANCY
Definition: RigDef_Node.h:153
RigDef::Serializer::ProcessAxles
void ProcessAxles(Document::Module *module)
Definition: RigDef_Serializer.cpp:824
RigDef::Document::Module::shocks3
std::vector< Shock3 > shocks3
Definition: RigDef_File.h:1542
RigDef::BaseWheel::propulsion
WheelPropulsion propulsion
Definition: RigDef_File.h:415
RigDef::SkeletonSettings::visibility_range_meters
float visibility_range_meters
Definition: RigDef_File.h:1253
RigDef::Node::OPTION_c_NO_GROUND_CONTACT
static const BitMask_t OPTION_c_NO_GROUND_CONTACT
Definition: RigDef_Node.h:150
RigDef::HydroOption::j_INVISIBLE
@ j_INVISIBLE
RigDef::Exhaust::particle_name
Ogre::String particle_name
Definition: RigDef_File.h:855
RigDef::Exhaust::reference_node
Node::Ref reference_node
Definition: RigDef_File.h:853
RigDef::Tie
Definition: RigDef_File.h:1313
RigDef::SlideNode::CONSTRAINT_ATTACH_NONE
static const BitMask_t CONSTRAINT_ATTACH_NONE
Definition: RigDef_File.h:1262
RigDef::Hydro::OPTION_h_INPUT_InvELEVATOR_RUDDER
static const BitMask_t OPTION_h_INPUT_InvELEVATOR_RUDDER
Definition: RigDef_File.h:986
RigDef::Flare2::size
float size
Definition: RigDef_File.h:886
RigDef::Document::Module::flexbodywheels
std::vector< FlexBodyWheel > flexbodywheels
Definition: RigDef_File.h:1514
RigDef::ManagedMaterialType::FLEXMESH_TRANSPARENT
@ FLEXMESH_TRANSPARENT
RigDef::Document::Module::materialflarebindings
std::vector< MaterialFlareBinding > materialflarebindings
Definition: RigDef_File.h:1525
RigDef::Node::OPTION_h_HOOK_POINT
static const BitMask_t OPTION_h_HOOK_POINT
Definition: RigDef_Node.h:151
RigDef::BeamDefaults::plastic_deform_coef
float plastic_deform_coef
Definition: RigDef_File.h:696
RigDef::Rotator2::tolerance
float tolerance
Definition: RigDef_File.h:1158
RigDef::Rotator
Definition: RigDef_File.h:1141
RigDef::Serializer::ProcessSetSkeletonSettings
void ProcessSetSkeletonSettings(Document::Module *module)
Definition: RigDef_Serializer.cpp:432
RigDef::TransferCase::has_2wd
bool has_2wd
Definition: RigDef_File.h:1364
RigDef::Trigger::boundary_timer
float boundary_timer
Definition: RigDef_File.h:1387
RigDef::Serializer::ProcessHelp
void ProcessHelp(Document::Module *module)
Definition: RigDef_Serializer.cpp:1565
RigDef::Document::Module::videocameras
std::vector< VideoCamera > videocameras
Definition: RigDef_File.h:1558
RigDef::Airbrake::texcoord_y2
float texcoord_y2
Definition: RigDef_File.h:472
RigDef::Engine
Definition: RigDef_File.h:805
RigDef::Serializer::ProcessBeam
void ProcessBeam(Beam &beam)
Definition: RigDef_Serializer.cpp:2291
RigDef::Trigger::contraction_trigger_limit
float contraction_trigger_limit
Definition: RigDef_File.h:1384
RigDef::Node::node_defaults
std::shared_ptr< NodeDefaults > node_defaults
Definition: RigDef_Node.h:163
RigDef::TriggerOption::E_ENGINE_TRIGGER
@ E_ENGINE_TRIGGER
this trigger is used to control an engine
RigDef::Serializer::ProcessDirectiveAddAnimation
void ProcessDirectiveAddAnimation(RigDef::Animation &anim)
Definition: RigDef_Serializer.cpp:536
RigDef::Author::type
Ogre::String type
Definition: RigDef_File.h:613
RigDef::Shock3::split_vel_in
float split_vel_in
Split velocity in (m/s) - threshold for slow / fast damping during compression.
Definition: RigDef_File.h:1238
RigDef::TractionControl::attr_no_toggle
bool attr_no_toggle
Definition: RigDef_File.h:1357
RigDef::Serializer::ProcessSpeedLimiter
void ProcessSpeedLimiter(Document::Module *module)
Definition: RigDef_Serializer.cpp:918
RigDef::Beam::options
BitMask_t options
Definition: RigDef_File.h:633
RigDef::Document::Module::antilockbrakes
std::vector< AntiLockBrakes > antilockbrakes
Definition: RigDef_File.h:1488
RigDef::Hydro::OPTION_j_INVISIBLE
static const BitMask_t OPTION_j_INVISIBLE
Definition: RigDef_File.h:974
RigDef::Animation::source
BitMask64_t source
Definition: RigDef_File.h:547
RigDef::Shock3::short_bound
float short_bound
Maximum contraction limit, in percentage ( 1.00 = 100% )
Definition: RigDef_File.h:1243
RigDef::CabOption::s_BUOYANT_NO_DRAG
@ s_BUOYANT_NO_DRAG
RigDef::Engoption::idle_rpm
float idle_rpm
Definition: RigDef_File.h:824
RigDef::Shock2::progress_factor_damp_in
float progress_factor_damp_in
Progression factor for dampin. 0 = disabled, 1...x as multipliers, example:maximum dampingrate == spr...
Definition: RigDef_File.h:1211
RigDef::Shock3::OPTION_M_ABSOLUTE_METRIC
static const BitMask_t OPTION_M_ABSOLUTE_METRIC
Definition: RigDef_File.h:1230
RigDef::Node::options
BitMask_t options
Definition: RigDef_Node.h:160
RigDef::BeamDefaultsScale::springiness
float springiness
Definition: RigDef_File.h:649
RigDef::Serializer::ProcessSubmesh
void ProcessSubmesh(Document::Module *module)
Definition: RigDef_Serializer.cpp:477
RigDef::Rotator2
Definition: RigDef_File.h:1155
RigDef::Shock::options
BitMask_t options
Definition: RigDef_File.h:1193
RigDef::Command2::affect_engine
float affect_engine
Definition: RigDef_File.h:774
RigDef::Author::forum_account_id
unsigned int forum_account_id
Definition: RigDef_File.h:614
RigDef::Serializer::ProcessTransferCase
void ProcessTransferCase(Document::Module *module)
Definition: RigDef_Serializer.cpp:882
RigDef::BaseMeshWheel::mesh_name
Ogre::String mesh_name
Definition: RigDef_File.h:425
RigDef::Serializer::m_node_id_width
int m_node_id_width
Definition: RigDef_Serializer.h:166
RigDef::SlideNode::CONSTRAINT_ATTACH_ALL
static const BitMask_t CONSTRAINT_ATTACH_ALL
Definition: RigDef_File.h:1259
RigDef::Shock3
Definition: RigDef_File.h:1224
RigDef::Exhaust
Definition: RigDef_File.h:851
RigDef::Document::Module::flexbodies
std::vector< Flexbody > flexbodies
Definition: RigDef_File.h:1513
ANIMATOR_ADD_FLAG
#define ANIMATOR_ADD_FLAG(DEF_VAR, AND_VAR, BITMASK_CONST, NAME_STR)
Definition: RigDef_Serializer.cpp:1230
RigDef::Airbrake::width
float width
Definition: RigDef_File.h:466
RigDef::Document::Module::hydros
std::vector< Hydro > hydros
Definition: RigDef_File.h:1521
RigDef::VideoCamera::max_clip_distance
float max_clip_distance
Definition: RigDef_File.h:1432
RigDef::CabOption::u_INVULNERABLE
@ u_INVULNERABLE
RigDef::Document::Module::ropables
std::vector< Ropable > ropables
Definition: RigDef_File.h:1534
RigDef::HydroOption::s_DISABLE_ON_HIGH_SPEED
@ s_DISABLE_ON_HIGH_SPEED
RigDef::Document::Module::managedmaterials
std::vector< ManagedMaterial > managedmaterials
Definition: RigDef_File.h:1524
RigDef::Prop::special_prop_dashboard
DashboardSpecial special_prop_dashboard
Definition: RigDef_File.h:1116
RigDef::SpecialProp::DASHBOARD_LEFT
@ DASHBOARD_LEFT
RigDef::Beam::OPTION_r_ROPE
static const BitMask_t OPTION_r_ROPE
Definition: RigDef_File.h:629
RigDef::BeamDefaultsScale::damping_constant
float damping_constant
Definition: RigDef_File.h:650
RigDef::Cab::OPTION_F_10xTOUGHER_BUOYANT
static const BitMask_t OPTION_F_10xTOUGHER_BUOYANT
Definition: RigDef_File.h:718
RigDef::Flare2::control_number
int control_number
Only 'u' type flares.
Definition: RigDef_File.h:883
RigDef::Shock2::damp_in
float damp_in
Damping value applied when the shock is compressing.
Definition: RigDef_File.h:1209
RigDef::Lockgroup::nodes
std::vector< Node::Ref > nodes
Definition: RigDef_File.h:1013
RigDef::Tie::OPTION_i_INVISIBLE
static const BitMask_t OPTION_i_INVISIBLE
Definition: RigDef_File.h:1315
RigDef::Axle
Definition: RigDef_File.h:620
RigDef::Shock2::options
BitMask_t options
Definition: RigDef_File.h:1219
RigDef::Serializer::ProcessHydros
void ProcessHydros(Document::Module *)
Definition: RigDef_Serializer.cpp:1943
RigDef::SlideNode::_attachment_rate_set
bool _attachment_rate_set
Definition: RigDef_File.h:1272
RigDef::Document::Module::collisionboxes
std::vector< CollisionBox > collisionboxes
Definition: RigDef_File.h:1496
RigDef::Shock::nodes
Node::Ref nodes[2]
Definition: RigDef_File.h:1187
RigDef::Serializer::ProcessShock3
void ProcessShock3(Shock3 &def)
Definition: RigDef_Serializer.cpp:2219
RigDef::HydroOption::x_INPUT_AILERON_RUDDER
@ x_INPUT_AILERON_RUDDER
RigDef::Tie::root_node
Node::Ref root_node
Definition: RigDef_File.h:1318
RigDef::TransferCase::has_2wd_lo
bool has_2wd_lo
Definition: RigDef_File.h:1365
RigDef::Lockgroup::number
int number
Definition: RigDef_File.h:1012
RigDef::Node
Definition: RigDef_Node.h:39
RigDef::DocumentPtr
std::shared_ptr< Document > DocumentPtr
Definition: RigDef_Prerequisites.h:38
RigDef::Cab::OPTION_r_BUOYANT_ONLY_DRAG
static const BitMask_t OPTION_r_BUOYANT_ONLY_DRAG
Definition: RigDef_File.h:716
RigDef::BaseWheel::nodes
Node::Ref nodes[2]
Definition: RigDef_File.h:412
RigDef::VideoCamera::reference_node
Node::Ref reference_node
Definition: RigDef_File.h:1421
RigDef::SoundSource
Definition: RigDef_File.h:1277
RigDef::RailGroup::node_list
std::vector< Node::Range > node_list
Definition: RigDef_File.h:1122
RigDef::Shock3::OPTION_m_METRIC
static const BitMask_t OPTION_m_METRIC
Definition: RigDef_File.h:1229
RigDef::Document::Module::torquecurve
std::vector< TorqueCurve > torquecurve
Definition: RigDef_File.h:1552
RigDef::Document::Module::speedlimiter
std::vector< SpeedLimiter > speedlimiter
Definition: RigDef_File.h:1548
RigDef::BaseWheel::braking
WheelBraking braking
Definition: RigDef_File.h:414
RigDef::Serializer::m_stream
std::ofstream m_stream
Definition: RigDef_Serializer.h:160
RigDef::HydroOption::h_INPUT_InvELEVATOR_RUDDER
@ h_INPUT_InvELEVATOR_RUDDER
RigDef::Airbrake::texcoord_x2
float texcoord_x2
Definition: RigDef_File.h:470
RigDef::Hook::option_lockgroup
int option_lockgroup
Definition: RigDef_File.h:962
RigDef::Hook::flag_no_rope
bool flag_no_rope
Definition: RigDef_File.h:968
RigDef::SpecialProp::NONE
@ NONE
RigDef::CabOption::p_10xTOUGHER
@ p_10xTOUGHER
RigDef::AntiLockBrakes::regulation_force
float regulation_force
Definition: RigDef_File.h:603
RigDef::Trigger::OPTION_H_LOCKS_HOOK_GROUP
static const BitMask_t OPTION_H_LOCKS_HOOK_GROUP
Definition: RigDef_File.h:1379
RigDef::Cab::OPTION_S_INVULNERABLE_BUOYANT
static const BitMask_t OPTION_S_INVULNERABLE_BUOYANT
Definition: RigDef_File.h:719
RigDef::Serializer::ProcessTractionControl
void ProcessTractionControl(Document::Module *module)
Definition: RigDef_Serializer.cpp:1453
RigDef::Shock::OPTION_i_INVISIBLE
static const BitMask_t OPTION_i_INVISIBLE
Definition: RigDef_File.h:1182
RigDef::Shock::damping
float damping
The 'resistance to motion' of the shock. The best value is given by this equation: 2 * sqrt(suspended...
Definition: RigDef_File.h:1189
RigDef::Animator::lenghtening_factor
float lenghtening_factor
Definition: RigDef_File.h:589
RigDef::Rotator2::description
Ogre::String description
Definition: RigDef_File.h:1159
RigDef::Document::Module::soundsources
std::vector< SoundSource > soundsources
Definition: RigDef_File.h:1546
RigDef::Prop::reference_node
Node::Ref reference_node
Definition: RigDef_File.h:1106
RigDef::SlideNode::_max_attach_dist_set
bool _max_attach_dist_set
Definition: RigDef_File.h:1274
RigDef::Hydro::beam_defaults
std::shared_ptr< BeamDefaults > beam_defaults
Definition: RigDef_File.h:995
RigDef::Rotator::base_plate_nodes
Node::Ref base_plate_nodes[4]
Definition: RigDef_File.h:1144
RigDef::Serializer::m_bool_width
int m_bool_width
Definition: RigDef_Serializer.h:165
RigDef::Flexbody::x_axis_node
Node::Ref x_axis_node
Definition: RigDef_File.h:898
RigDef::Serializer::ProcessParticles
void ProcessParticles(Document::Module *module)
Definition: RigDef_Serializer.cpp:952
RigDef::Animation::event_name
Ogre::String event_name
Definition: RigDef_File.h:550
RigDef::Airbrake::x_axis_node
Node::Ref x_axis_node
Definition: RigDef_File.h:462
RigDef::Particle::reference_node
Node::Ref reference_node
Definition: RigDef_File.h:1063
RigDef::Node::Id::ToString
std::string ToString() const
Definition: RigDef_Node.cpp:129
RigDef::Serializer::ProcessMaterialFlareBindings
void ProcessMaterialFlareBindings(Document::Module *module)
Definition: RigDef_Serializer.cpp:704
RigDef::Shock3::damp_out
float damp_out
Damping value applied when shock extending.
Definition: RigDef_File.h:1236
RigDef::Command2::option_c_auto_center
bool option_c_auto_center
Definition: RigDef_File.h:783
RigDef::Rotator::spin_left_key
unsigned int spin_left_key
Definition: RigDef_File.h:1147
RigDef::Serializer::ProcessRailGroups
void ProcessRailGroups(Document::Module *module)
Definition: RigDef_Serializer.cpp:1062
RigDef::Shock3::damp_in_slow
float damp_in_slow
Damping value applied when shock is commpressing slower than split in velocity.
Definition: RigDef_File.h:1237
RigDef::BeamDefaults::beam_material_name
Ogre::String beam_material_name
Definition: RigDef_File.h:695
RigDef::Serializer::ProcessDescription
void ProcessDescription(Document::Module *module)
Definition: RigDef_Serializer.cpp:2574
RigDef::Hydro::lenghtening_factor
float lenghtening_factor
Definition: RigDef_File.h:991
RigDef::VideoCamera::material_name
Ogre::String material_name
Definition: RigDef_File.h:1435
RigDef::Command2::max_contraction
float max_contraction
Definition: RigDef_File.h:768
RigDef::Command2::nodes
Node::Ref nodes[2]
Definition: RigDef_File.h:765
RigDef::AntiLockBrakes::pulse_per_sec
float pulse_per_sec
Definition: RigDef_File.h:605
RigDef::Serializer::ProcessCruiseControl
void ProcessCruiseControl(Document::Module *module)
Definition: RigDef_Serializer.cpp:902
RigDef::Beam
Definition: RigDef_File.h:626
RigDef::Rotator2::rotating_force
float rotating_force
Definition: RigDef_File.h:1157
RigDef::Hook::option_timer
float option_timer
Definition: RigDef_File.h:963
RigDef::GuiSettings::value
std::string value
Definition: RigDef_File.h:945
RigDef::Serializer::ProcessFixes
void ProcessFixes(Document::Module *module)
Definition: RigDef_Serializer.cpp:1016
RigDef::Serializer::ProcessNode
void ProcessNode(Node &node)
Definition: RigDef_Serializer.cpp:2492
RigDef::Prop::x_axis_node
Node::Ref x_axis_node
Definition: RigDef_File.h:1107
RigDef::Animation::upper_limit
float upper_limit
Definition: RigDef_File.h:546
RigDef::ExtCamera::mode
RoR::ExtCameraMode mode
Definition: RigDef_File.h:860
RigDef::Inertia::stop_function
Ogre::String stop_function
Definition: RigDef_File.h:451
RigDef::Tie::OPTION_s_DISABLE_SELF_LOCK
static const BitMask_t OPTION_s_DISABLE_SELF_LOCK
Definition: RigDef_File.h:1316
RigDef::Prop::DashboardSpecial::rotation_angle
float rotation_angle
Definition: RigDef_File.h:1091
RigDef::Document::Module::particles
std::vector< Particle > particles
Definition: RigDef_File.h:1530
RigDef::Engoption::inertia
float inertia
Definition: RigDef_File.h:818
RigDef::Document::Module::beams
std::vector< Beam > beams
Definition: RigDef_File.h:1492
RigDef::CruiseControl
Definition: RigDef_File.h:789
RigDef::BaseMeshWheel::material_name
Ogre::String material_name
Definition: RigDef_File.h:426
RigDef::Hydro::OPTION_r_INPUT_RUDDER
static const BitMask_t OPTION_r_INPUT_RUDDER
Definition: RigDef_File.h:979
RigDef::Wing
Definition: RigDef_File.h:1462
RigDef::Serializer::ProcessInterAxles
void ProcessInterAxles(Document::Module *module)
Definition: RigDef_Serializer.cpp:853
RigDef::BaseWheel::reference_arm_node
Node::Ref reference_arm_node
Definition: RigDef_File.h:416
RigDef::Serializer::~Serializer
virtual ~Serializer()
Definition: RigDef_Serializer.cpp:50
RigDef_File.h
Data structures representing 'truck' file format, see https://docs.rigsofrods.org/vehicle-creation/fi...
RigDef::Serializer::ProcessGlobals
void ProcessGlobals(Document::Module *module)
Definition: RigDef_Serializer.cpp:2607
RoR
Definition: AppContext.h:36
RigDef::ManagedMaterialsOptions
Definition: RigDef_File.h:1016
RigDef::Hook::flag_visible
bool flag_visible
Definition: RigDef_File.h:969
RigDef::Document::Module::interaxles
std::vector< InterAxle > interaxles
Definition: RigDef_File.h:1522
RigDef::Prop::special_prop_beacon
BeaconSpecial special_prop_beacon
Definition: RigDef_File.h:1115
RigDef::Command2::needs_engine
bool needs_engine
Definition: RigDef_File.h:775
RigDef::RailGroup::id
unsigned int id
Definition: RigDef_File.h:1121
RigDef::ExtCamera
Definition: RigDef_File.h:858
RigDef::Shock2::progress_factor_damp_out
float progress_factor_damp_out
Progression factor dampout, 0 = disabled, 1...x as multipliers, example:maximum dampingrate == spring...
Definition: RigDef_File.h:1215
RigDef::Flexbody::y_axis_node
Node::Ref y_axis_node
Definition: RigDef_File.h:899
RigDef::Rope
Definition: RigDef_File.h:1132
RigDef::Shock3::OPTION_i_INVISIBLE
static const BitMask_t OPTION_i_INVISIBLE
Definition: RigDef_File.h:1228
RigDef::Airbrake::offset
Ogre::Vector3 offset
Definition: RigDef_File.h:465
RigDef::Hook::option_speed_coef
float option_speed_coef
Definition: RigDef_File.h:959
RigDef::Ropable::group
int group
Definition: RigDef_File.h:1128
RigDef::Cab::OPTION_b_BUOYANT
static const BitMask_t OPTION_b_BUOYANT
Definition: RigDef_File.h:712
RigDef::Wing::efficacy_coef
float efficacy_coef
Definition: RigDef_File.h:1471
RigDef::CabOption::F_10xTOUGHER_BUOYANT
@ F_10xTOUGHER_BUOYANT
RigDef::Hydro::OPTION_x_INPUT_AILERON_RUDDER
static const BitMask_t OPTION_x_INPUT_AILERON_RUDDER
Definition: RigDef_File.h:983
RigDef::SlideNode
Definition: RigDef_File.h:1257
RigDef::TractionControl::regulation_force
float regulation_force
Definition: RigDef_File.h:1351
RigDef::TransferCase::a2
int a2
Definition: RigDef_File.h:1363
RigDef::MeshWheel2
Definition: RigDef_File.h:1046
RigDef::Hook::flag_self_lock
bool flag_self_lock
Definition: RigDef_File.h:965
RigDef::Document::Module::meshwheels
std::vector< MeshWheel > meshwheels
Definition: RigDef_File.h:1526
RigDef::Document::Module::engoption
std::vector< Engoption > engoption
Definition: RigDef_File.h:1504
RigDef::SoundSource::sound_script_name
Ogre::String sound_script_name
Definition: RigDef_File.h:1280
RigDef::HydroOption::v_INPUT_InvAILERON_ELEVATOR
@ v_INPUT_InvAILERON_ELEVATOR
RigDef::Document::Module::tractioncontrol
std::vector< TractionControl > tractioncontrol
Definition: RigDef_File.h:1553
RigDef::CabOption::c_CONTACT
@ c_CONTACT
RigDef::Shock3::damp_out_slow
float damp_out_slow
Damping value applied when shock is commpressing slower than split out velocity.
Definition: RigDef_File.h:1240
RigDef::Prop::BeaconSpecial::flare_material_name
Ogre::String flare_material_name
Definition: RigDef_File.h:1102
RigDef::Serializer::ProcessShocks
void ProcessShocks(Document::Module *)
Definition: RigDef_Serializer.cpp:1778
RigDef::Turboprop2::reference_node
Node::Ref reference_node
Definition: RigDef_File.h:1409
RigDef::Document::Module::fixes
std::vector< Node::Ref > fixes
Definition: RigDef_File.h:1509
RigDef::Prop::animations
std::list< Animation > animations
Definition: RigDef_File.h:1112
RigDef::Hook::node
Node::Ref node
Definition: RigDef_File.h:957
RigDef::Document::Module::soundsources2
std::vector< SoundSource2 > soundsources2
Definition: RigDef_File.h:1547
RigDef::Beam::nodes
Node::Ref nodes[2]
Definition: RigDef_File.h:632
RigDef::Document::Module::guid
std::vector< Guid > guid
Definition: RigDef_File.h:1517
RigDef::Rope::root_node
Node::Ref root_node
Definition: RigDef_File.h:1134
RigDef::Fileinfo::category_id
int category_id
Definition: RigDef_File.h:872
RigDef::VideoCamera::camera_name
Ogre::String camera_name
Definition: RigDef_File.h:1436
RigDef::Submesh::backmesh
bool backmesh
Definition: RigDef_File.h:1301
RigDef::Node::OPTION_f_NO_SPARKS
static const BitMask_t OPTION_f_NO_SPARKS
Definition: RigDef_Node.h:147
RigDef::Prop::BeaconSpecial::color
Ogre::ColourValue color
Definition: RigDef_File.h:1103