RigsofRods
Soft-body Physics Simulation
ActorSpawner.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 
22 
27 
28 
29 #include "ActorSpawner.h"
30 
31 #include "AddonPartFileFormat.h"
32 #include "AppContext.h"
33 #include "AirBrake.h"
34 #include "Airfoil.h"
35 #include "Application.h"
36 #include "ApproxMath.h"
37 #include "AutoPilot.h"
38 #include "Actor.h"
39 #include "ActorManager.h"
40 #include "BitFlags.h"
41 #include "Buoyance.h"
42 #include "CacheSystem.h"
43 #include "CameraManager.h"
44 #include "CmdKeyInertia.h"
45 #include "Collisions.h"
46 #include "DashBoardManager.h"
47 #include "Differentials.h"
48 #include "EngineSim.h"
49 #include "FlexAirfoil.h"
50 #include "FlexBody.h"
51 #include "FlexMesh.h"
52 #include "FlexMeshWheel.h"
53 #include "FlexObj.h"
54 #include "GameContext.h"
55 #include "GfxActor.h"
56 #include "GfxScene.h"
57 #include "Console.h"
58 #include "InputEngine.h"
59 #include "Language.h"
60 #include "MeshObject.h"
61 #include "PointColDetector.h"
62 #include "Renderdash.h"
63 #include "ScrewProp.h"
64 #include "Skidmark.h"
65 #include "SkinFileFormat.h"
66 #include "SlideNode.h"
67 #include "SoundScriptManager.h"
68 #include "Terrain.h"
69 #include "TorqueCurve.h"
70 #include "TuneupFileFormat.h"
71 #include "TurboJet.h"
72 #include "TurboProp.h"
73 #include "Utils.h"
74 #include "VehicleAI.h"
75 
76 #include <OgreMaterialManager.h>
77 #include <OgreSceneManager.h>
78 #include <OgreMovableObject.h>
79 #include <OgreParticleSystem.h>
80 #include <OgreEntity.h>
81 #include <climits>
82 #include <fmt/format.h>
83 
84 using namespace RoR;
85 
86 /* -------------------------------------------------------------------------- */
87 // Prepare for loading
88 /* -------------------------------------------------------------------------- */
89 
90 void ActorSpawner::ConfigureSections(Ogre::String const & sectionconfig, RigDef::DocumentPtr def)
91 {
92  m_selected_modules.push_back(def->root_module);
93  if (sectionconfig != "")
94  {
95  auto result = def->user_modules.find(sectionconfig);
96 
97  if (result != def->user_modules.end())
98  {
99  m_selected_modules.push_back(result->second);
100  LOG(" == ActorSpawner: Module added to configuration: " + sectionconfig);
101  }
102  else
103  {
104  this->AddMessage(Message::TYPE_WARNING, "Selected module not found: " + sectionconfig);
105  }
106  }
107 }
108 
110 {
111  if (tuneup_def)
112  {
114 
115  for (const std::string& addonpart: tuneup_def->use_addonparts)
116  {
117  CacheEntryPtr addonpart_entry = App::GetCacheSystem()->FindEntryByFilename(LT_AddonPart, /*partial:*/false, addonpart);
118  if (addonpart_entry)
119  {
120  App::GetCacheSystem()->LoadResource(addonpart_entry);
121 
122  AddonPartUtility util;
123  util.ResolveUnwantedAndTweakedElements(tuneup_def, addonpart_entry);
124  auto module = util.TransformToRigDefModule(addonpart_entry);
125  if (module)
126  {
127  m_selected_modules.push_back(module);
128  LOG(" == ActorSpawner: Addon part added to configuration: " + addonpart);
129  }
130  else
131  {
132  this->AddMessage(Message::TYPE_WARNING, fmt::format(_L("Could not load addon part '{}' (file '{}')"), addonpart_entry->dname, addonpart_entry->fname));
133  }
134  }
135  else
136  {
137  this->AddMessage(Message::TYPE_WARNING, fmt::format(_L("Requested addon part '{}' is not installed"), addonpart));
138  }
139  }
140  }
141 }
142 
144 {
145  for (auto& module: m_selected_modules)
146  {
147  for (RigDef::Assetpack const& assetpack: module->assetpacks)
148  {
150  }
151  }
152 }
153 
155 {
156  // 'nodes'
157  req.num_nodes += module_def->nodes.size();
158  for (auto& def: module_def->nodes)
159  {
161  {
162  req.num_beams += 1;
163  }
164  }
165 
166  // 'beams'
167  req.num_beams += module_def->beams.size();
168 
169  // 'ties'
170  req.num_beams += module_def->ties.size();
171 
172  // 'ropes'
173  req.num_beams += module_def->ropes.size();
174 
175  // 'hydros'
176  req.num_beams += module_def->hydros.size();
177 
178  // 'triggers'
179  req.num_beams += module_def->triggers.size();
180  req.num_shocks += module_def->triggers.size();
181 
182  // 'animators'
183  req.num_beams += module_def->animators.size();
184 
185  // 'cinecam'
186  req.num_nodes += module_def->cinecam.size();
187  req.num_beams += module_def->cinecam.size() * 8;
188 
189  // 'shocks', 'shocks2', 'shocks3'
190  req.num_beams += module_def->shocks.size();
191  req.num_shocks += module_def->shocks.size();
192  req.num_beams += module_def->shocks2.size();
193  req.num_shocks += module_def->shocks2.size();
194  req.num_beams += module_def->shocks3.size();
195  req.num_shocks += module_def->shocks3.size();
196 
197  // 'commands' and 'commands2' (unified)
198  req.num_beams += module_def->commands2.size();
199 
200  // 'rotators'
201  req.num_rotators += module_def->rotators.size();
202  req.num_rotators += module_def->rotators2.size();
203 
204  // 'wings'
205  req.num_wings += module_def->wings.size();
206 
207  // 'wheels'
208  for (RigDef::Wheel& wheel: module_def->wheels)
209  {
210  req.num_nodes += wheel.num_rays * 2; // BuildWheelObjectAndNodes()
211  req.num_beams += wheel.num_rays * ((wheel.rigidity_node.IsValidAnyState()) ? 9 : 8); // BuildWheelBeams()
212  }
213 
214  // 'wheels2'
215  for (RigDef::Wheel2& wheel2: module_def->wheels2)
216  {
217  req.num_nodes += wheel2.num_rays * 4;
218  // Rim beams: num_rays*10 (*11 with valid rigidity_node)
219  // Tyre beams: num_rays*14
220  req.num_beams += wheel2.num_rays * ((wheel2.rigidity_node.IsValidAnyState()) ? 25 : 24);
221  }
222 
223  // 'meshwheels' & 'meshwheels2'
224  for (RigDef::MeshWheel& meshwheel: module_def->meshwheels)
225  {
226  req.num_nodes += meshwheel.num_rays * 2; // BuildWheelObjectAndNodes()
227  req.num_beams += meshwheel.num_rays * ((meshwheel.rigidity_node.IsValidAnyState()) ? 9 : 8); // BuildWheelBeams()
228  }
229  for (RigDef::MeshWheel2& meshwheel2: module_def->meshwheels2)
230  {
231  req.num_nodes += meshwheel2.num_rays * 2; // BuildWheelObjectAndNodes()
232  req.num_beams += meshwheel2.num_rays * ((meshwheel2.rigidity_node.IsValidAnyState()) ? 9 : 8); // BuildWheelBeams()
233  }
234 
235  // 'flexbodywheels'
236  for (RigDef::FlexBodyWheel& flexwheel: module_def->flexbodywheels)
237  {
238  req.num_nodes += flexwheel.num_rays * 4;
239  // Rim beams: num_rays*8
240  // Tyre beams: num_rays*10 (num_rays*11 with valid rigidity_node)
241  // Support beams: num_rays*2
242  req.num_beams += flexwheel.num_rays * ((flexwheel.rigidity_node.IsValidAnyState()) ? 21 : 20);
243  }
244 
245  // 'airbrakes'
246  req.num_airbrakes += module_def->airbrakes.size();
247 
248  // 'fixes'
249  req.num_fixes += module_def->fixes.size();
250 }
251 
253 {
255  for (auto module: m_selected_modules) // _Root_ module is included
256  {
257  this->CalcMemoryRequirements(req, module.get());
258  }
259 
260  // Allocate memory as needed
261  m_actor->ar_beams = new beam_t[req.num_beams];
262  m_actor->ar_nodes = new node_t[req.num_nodes];
263  m_actor->ar_nodes_id = new int[req.num_nodes];
264  for (size_t i = 0; i < req.num_nodes; ++i)
265  {
266  m_actor->ar_nodes_id[i] = -1;
267  }
268  m_actor->ar_nodes_name = new std::string[req.num_nodes];
269 
270  if (req.num_shocks > 0)
271  m_actor->ar_shocks = new shock_t[req.num_shocks];
272 
273  if (req.num_rotators > 0)
275 
276  if (req.num_wings > 0)
277  m_actor->ar_wings = new wing_t[req.num_wings];
278 
279  m_actor->ar_minimass.resize(req.num_nodes);
280 
281  m_actor->exhausts.clear();
282  memset(m_actor->ar_custom_particles, 0, sizeof(cparticle_t) * MAX_CPARTICLES);
286  memset(m_actor->ar_collcabs, 0, sizeof(int) * MAX_CABS);
287  memset(m_actor->ar_inter_collcabrate, 0, sizeof(collcab_rate_t) * MAX_CABS);
289  memset(m_actor->ar_intra_collcabrate, 0, sizeof(collcab_rate_t) * MAX_CABS);
290  memset(m_actor->ar_buoycabs, 0, sizeof(int) * MAX_CABS);
292  memset(m_actor->ar_buoycab_types, 0, sizeof(int) * MAX_CABS);
293  memset(m_actor->m_skid_trails, 0, sizeof(Skidmark *) * (MAX_WHEELS*2));
294 
295  m_actor->authors.clear();
296 
299 
300  m_actor->m_masscount=0;
305  m_actor->ar_origin=Ogre::Vector3::ZERO;
306  m_actor->m_slidenodes.clear();
309 
311  m_actor->m_fusealge_airfoil = nullptr;
312  m_actor->m_fusealge_front = nullptr;
313  m_actor->m_fusealge_back = nullptr;
315  m_actor->ar_brake_force=30000.0;
317 
319 
322  for (int i = 0; i < MAX_CAMERAS; ++i)
323  {
327  }
328 
329 #ifdef USE_ANGELSCRIPT
331 #endif // USE_ANGELSCRIPT
332 
334  m_actor->alb_minspeed = 0.0f;
335  m_actor->alb_mode = false;
336  m_actor->alb_nodash = true;
337  m_actor->alb_notoggle = false;
338  m_actor->alb_pulse_time = 2000.0f;
339  m_actor->alb_pulse_state = false;
340  m_actor->alb_ratio = 1.0f;
341  m_actor->alb_timer = 0.0f;
343 
344  m_actor->cc_mode = false;
345  m_actor->cc_can_brake = false;
346  m_actor->cc_target_rpm = 0.0f;
347  m_actor->cc_target_speed = 0.0f;
349 
351 
353 
355 
356  m_actor->sl_enabled = false;
357  m_actor->sl_speed_limit = 0.f;
358 
359  m_actor->tc_mode = false;
360  m_actor->tc_nodash = true;
361  m_actor->tc_notoggle = false;
362  m_actor->tc_pulse_time = 2000.0f;
363  m_actor->tc_pulse_state = false;
364  m_actor->tc_ratio = 1.f;
365  m_actor->tc_timer = 0.f;
366 
368 
369  /* Collisions */
370 
371  if (!App::sim_no_collisions->getBool())
372  {
374  }
375 
376  if (!App::sim_no_self_collisions->getBool())
377  {
379  }
380 
382 
383  // Lights mode
385 
387 
389 
391 
392  m_managedmat_placeholder_template = Ogre::MaterialManager::getSingleton().getByName("rigsofrods/managedmaterial-placeholder"); // Built-in
393 
396  {
397  m_simple_material_base = Ogre::MaterialManager::getSingleton().getByName("tracks/simple"); // Built-in material
398  if (m_simple_material_base.isNull())
399  {
401  "Failed to load built-in material 'tracks/simple'; disabling 'SimpleMaterials'");
402  m_apply_simple_materials = false;
403  }
404  }
405 
408 }
409 
411 {
412  // we should post-process the torque curve if existing
413  if (m_actor->ar_engine)
414  {
416  if (result)
417  {
419  if (result == 1)
420  {
421  AddMessage(Message::TYPE_ERROR, "TorqueCurve: Points (rpm) must be in an ascending order. Using default curve");
422  }
423  }
424 
425  //Gearbox
426  m_actor->ar_engine->SetAutoMode(App::sim_gearbox_mode->getEnum<SimGearboxMode>());
427  }
428 
429  // Sanitize trigger_cmdshort and trigger_cmdlong
430  for (int i=0; i<m_actor->ar_num_beams; i++)
431  {
432  shock_t* shock = m_actor->ar_beams[i].shock;
433  if (shock && ((shock->flags & SHOCK_FLAG_TRG_BLOCKER) || (shock->flags & SHOCK_FLAG_TRG_BLOCKER_A)))
434  {
435  shock->trigger_cmdshort = std::min(shock->trigger_cmdshort, m_actor->ar_num_beams - i - 1);
436  shock->trigger_cmdlong = std::min(shock->trigger_cmdlong , m_actor->ar_num_beams - i - 1);
437  }
438  }
439 
440  //calculate gwps height offset
441  //get a starting value
443  //start at 0 to avoid a crash whith a 1-node truck
444  for (int i=0; i<m_actor->ar_num_nodes; i++)
445  {
446  // scan and store the y-coord for the lowest node of the truck
448  {
450  }
451  }
452 
456 
458 
459  // Calculate mass of each wheel (without rim)
460  for (int i = 0; i < m_actor->ar_num_wheels; i++)
461  {
462  m_actor->ar_wheels[i].wh_mass = 0.0f;
463  for (int j = 0; j < m_actor->ar_wheels[i].wh_num_nodes; j++)
464  {
466  }
467  }
468 
469  if (m_actor->m_num_proped_wheels > 0)
470  {
471  float proped_wheels_radius_sum = 0.0f;
472  for (int i = 0; i < m_actor->ar_num_wheels; i++)
473  {
474  if (m_actor->ar_wheels[i].wh_propulsed > 0)
475  {
476  proped_wheels_radius_sum += m_actor->ar_wheels[i].wh_radius;
477  }
478  }
479  m_actor->m_avg_proped_wheel_radius = proped_wheels_radius_sum / m_actor->m_num_proped_wheels;
480  }
481 
482  // Automatically build interwheel differentials from proped wheel pairs
483  if (m_actor->m_num_wheel_diffs == 0)
484  {
485  for (int i = 1; i < m_actor->m_num_proped_wheels; i++)
486  {
487  if (i % 2)
488  {
489  Differential *diff = new Differential();
490 
491  diff->di_idx_1 = m_actor->m_proped_wheel_pairs[i - 1];
492  diff->di_idx_2 = m_actor->m_proped_wheel_pairs[i - 0];
493 
495 
498  }
499  }
500  }
501 
502  // Automatically build interaxle differentials from interwheel differentials pairs
503  if (m_actor->m_num_axle_diffs == 0)
504  {
505  for (int i = 1; i < m_actor->m_num_wheel_diffs; i++)
506  {
508  {
511  if ((a1 == i - 1) && (a2 == i - 0))
512  continue;
513  }
514 
515  Differential *diff = new Differential();
516 
517  diff->di_idx_1 = i - 1;
518  diff->di_idx_2 = i - 0;
519 
522  else
524 
527  }
528  }
529 
530  // Automatically build an additional interaxle differential for the transfer case
532  {
533  Differential *diff = new Differential();
538  }
539 
541  {
543  // Step 1: Find a suitable camera node dir
544  float max_dist = 0.0f;
545  NodeNum_t furthest_node = 0;
546  for (int i = 0; i < m_actor->ar_num_nodes; i++)
547  {
548  float dist = m_actor->ar_nodes[i].RelPosition.squaredDistance(ref);
549  if (dist > max_dist)
550  {
551  max_dist = dist;
552  furthest_node = (NodeNum_t)i;
553  }
554  }
555  m_actor->ar_main_camera_node_dir = furthest_node;
556  // Step 2: Correct the misalignment
557  Ogre::Vector3 dir = m_actor->ar_nodes[furthest_node].RelPosition - ref;
558  float offset = atan2(dir.dotProduct(Ogre::Vector3::UNIT_Z), dir.dotProduct(Ogre::Vector3::UNIT_X));
559  m_actor->ar_main_camera_dir_corr = Ogre::Quaternion(Ogre::Radian(offset), Ogre::Vector3::UNIT_Y);
560  }
561 
563  {
564  // store the y-difference between the trucks lowest node and the campos-node for the gwps system
566  }
567  else
568  {
569  //this can not be an airplane, just set it to 0.
571  }
572 
573  //cameras workaround
574  for (int i=0; i<m_actor->ar_num_cameras; i++)
575  {
578  Ogre::Vector3 cross = dir_node_offset.crossProduct(roll_node_offset);
579 
580  m_actor->ar_camera_node_roll_inv[i]=cross.y > 0;
582  {
583  AddMessage(Message::TYPE_WARNING, "camera definition is probably invalid and has been corrected. It should be center, back, left");
584  }
585  }
586 
587  //wing closure
588  if (m_first_wing_index!=-1)
589  {
590  if (m_actor->ar_autopilot != nullptr)
591  {
597  );
598  }
599  //inform wing segments
601 
604  //wash calculator
605  WashCalculator();
606  }
607 
609 
611 
613 }
614 
615 /* -------------------------------------------------------------------------- */
616 // Processing functions and utilities.
617 /* -------------------------------------------------------------------------- */
618 
620 {
621  //we will compute wash
622  int w,p;
623  for (p=0; p<m_actor->ar_num_aeroengines; p++)
624  {
625  Ogre::Vector3 prop=m_actor->ar_nodes[m_actor->ar_aeroengines[p]->getNoderef()].RelPosition;
626  float radius=m_actor->ar_aeroengines[p]->getRadius();
627  for (w=0; w<m_actor->ar_num_wings; w++)
628  {
629  //left wash
631  //check if wing is near enough along X (less than 15m back)
632  if (wcent.x>prop.x && wcent.x<prop.x+15.0)
633  {
634  //check if it's okay vertically
635  if (wcent.y>prop.y-radius && wcent.y<prop.y+radius)
636  {
637  //okay, compute wash coverage ratio along Z
638  float wleft=(m_actor->ar_nodes[m_actor->ar_wings[w].fa->nfld].RelPosition).z;
639  float wright=(m_actor->ar_nodes[m_actor->ar_wings[w].fa->nfrd].RelPosition).z;
640  float pleft=prop.z+radius;
641  float pright=prop.z-radius;
642  float aleft=wleft;
643  if (pleft<aleft) aleft=pleft;
644  float aright=wright;
645  if (pright>aright) aright=pright;
646  if (aright<aleft)
647  {
648  //we have a wash
649  float wratio=(aleft-aright)/(wleft-wright);
650  m_actor->ar_wings[w].fa->addwash(p, wratio);
651  Ogre::String msg = "Wing "+TOSTRING(w)+" is washed by prop "+TOSTRING(p)+" at "+TOSTRING((float)(wratio*100.0))+"%";
653  }
654  }
655  }
656  }
657  }
658 }
659 
661 {
662  NodeNum_t front,back,ref;
663  front = GetNodeIndexOrThrow(def.front_node);
664  back = GetNodeIndexOrThrow(def.back_node);
665  ref = GetNodeIndexOrThrow(def.side_node);
666 
667  Turbojet *tj = new Turbojet(m_actor, front, back, ref, def);
668 
669  // Visuals
670  std::string nozzle_name = this->ComposeName("nozzle @ turbojet", m_actor->ar_num_aeroengines);
671  Ogre::Entity* nozzle_ent = App::GetGfxScene()->GetSceneManager()->createEntity(nozzle_name, "nozzle.mesh", m_custom_resource_group);
672  this->SetupNewEntity(nozzle_ent, Ogre::ColourValue(1, 0.5, 0.5));
673  Ogre::Entity* afterburn_ent = nullptr;
674  if (def.wet_thrust > 0.f)
675  {
676  std::string flame_name = this->ComposeName("ab flame @ turbojet", m_actor->ar_num_aeroengines);
677  afterburn_ent = App::GetGfxScene()->GetSceneManager()->createEntity(flame_name, "abflame.mesh", m_custom_resource_group);
678  this->SetupNewEntity(afterburn_ent, Ogre::ColourValue(1, 1, 0));
679  }
680  std::string propname = this->ComposeName("turbojet", m_actor->ar_num_aeroengines);
681  tj->tjet_visual.SetNodes(front, back, ref);
683  propname, nozzle_ent, afterburn_ent);
684  if (!m_actor->m_disable_smoke)
685  {
686  tj->tjet_visual.SetVisible(true);
687  }
688 
692  {
694  }
695 
697 }
698 
699 std::string ActorSpawner::ComposeName(const std::string& object, int number /* = -1 */)
700 {
701  // Under OGRE, each scene node must have a GLOBALLY unique name, even if under different parents.
702  // For that reason the names are intentionally repetitive - the critical part is the Instance ID.
703  // ----------------------------------------------------------------------------------------------
704 
705  if (number != -1)
706  {
707  return fmt::format("{}#{} ({} [Instance ID {}])",
708  object, number, m_actor->getTruckFileName(), m_actor->getInstanceId());
709  }
710  else
711  {
712  return fmt::format("{} ({} [Instance ID {}])",
714  }
715 }
716 
718 {
719  if (! CheckScrewpropLimit(1))
720  {
721  return;
722  }
723 
725  m_actor,
729  def.power
730  );
733 }
734 
736 {
737  //parse fusedrag
738  NodeNum_t front_node_idx = GetNodeIndexOrThrow(def.front_node);
739  float width = 1.f;
740  float factor = 1.f;
741  char fusefoil[256];
742  strncpy(fusefoil, def.airfoil_name.c_str(), 255);
743 
744  if (def.autocalc)
745  {
746  // fusedrag autocalculation
747 
748  // calculate fusedrag by truck size
749  factor = def.area_coefficient;
750  width = (m_fuse_z_max - m_fuse_z_min) * (m_fuse_y_max - m_fuse_y_min) * factor;
751 
752  m_actor->m_fusealge_airfoil = new Airfoil(fusefoil);
753 
754  m_actor->m_fusealge_front = & m_actor->ar_nodes[front_node_idx];
755  m_actor->m_fusealge_back = & m_actor->ar_nodes[front_node_idx]; // This equals v0.38 / v0.4.0.7, but it's probably a bug
756  m_actor->m_fusealge_width = width;
757  AddMessage(Message::TYPE_INFO, "Fusedrag autocalculation size: "+TOSTRING(width)+" m^2");
758  }
759  else
760  {
761  // original fusedrag calculation
762 
763  width = def.approximate_width;
764 
765  m_actor->m_fusealge_airfoil = new Airfoil(fusefoil);
766 
767  m_actor->m_fusealge_front = & m_actor->ar_nodes[front_node_idx];
768  m_actor->m_fusealge_back = & m_actor->ar_nodes[front_node_idx]; // This equals v0.38 / v0.4.0.7, but it's probably a bug
769  m_actor->m_fusealge_width = width;
770  }
771 }
772 
774  NodeNum_t ref_node_index,
775  NodeNum_t back_node_index,
776  NodeNum_t blade_1_node_index,
777  NodeNum_t blade_2_node_index,
778  NodeNum_t blade_3_node_index,
779  NodeNum_t blade_4_node_index,
780  NodeNum_t couplenode_index,
781  bool is_turboprops,
782  Ogre::String const & airfoil,
783  float power,
784  float pitch
785  )
786 {
787  int aeroengine_index = m_actor->ar_num_aeroengines;
788 
789  Turboprop *turbo_prop = new Turboprop(
790  m_actor,
791  this->ComposeName("turboprop", aeroengine_index).c_str(),
792  ref_node_index,
793  back_node_index,
794  blade_1_node_index,
795  blade_2_node_index,
796  blade_3_node_index,
797  blade_4_node_index,
798  couplenode_index,
799  power,
800  airfoil,
802  ! is_turboprops,
803  pitch
804  );
805 
809 
810  /* Autopilot */
812  {
814  }
815 
816  /* Visuals */
817  float scale = m_actor->ar_nodes[ref_node_index].RelPosition.distance(m_actor->ar_nodes[blade_1_node_index].RelPosition) / 2.25f;
818  for (RoR::Prop& prop: m_actor->m_gfx_actor->m_props)
819  {
820  if ((prop.pp_node_ref == ref_node_index) && (prop.pp_aero_propeller_blade || prop.pp_aero_propeller_spin))
821  {
822  prop.pp_scene_node->scale(scale, scale, scale);
823  prop.pp_aero_engine_idx = aeroengine_index;
824  }
825  }
826 }
827 
829 {
830  const NodeNum_t p3_node_index = (def.blade_tip_nodes[2].IsValidAnyState()) ? GetNodeIndexOrThrow(def.blade_tip_nodes[2]) : -1;
831  const NodeNum_t p4_node_index = (def.blade_tip_nodes[3].IsValidAnyState()) ? GetNodeIndexOrThrow(def.blade_tip_nodes[3]) : -1;
832  const NodeNum_t couple_node_index = (def.couple_node.IsValidAnyState()) ? GetNodeIndexOrThrow(def.couple_node) : -1;
833 
839  p3_node_index,
840  p4_node_index,
841  couple_node_index,
842  true,
843  def.airfoil,
844  def.turbine_power_kW,
845  -10
846  );
847 }
848 
849 void ActorSpawner::ProcessDescription(Ogre::String const& line)
850 {
851  m_actor->m_description.push_back(line);
852 }
853 
855 {
856  const NodeNum_t p3_node_index = (def.blade_tip_nodes[2].IsValidAnyState()) ? GetNodeIndexOrThrow(def.blade_tip_nodes[2]) : -1;
857  const NodeNum_t p4_node_index = (def.blade_tip_nodes[3].IsValidAnyState()) ? GetNodeIndexOrThrow(def.blade_tip_nodes[3]) : -1;
858  const NodeNum_t couple_node_index = (def.couple_node.IsValidAnyState()) ? GetNodeIndexOrThrow(def.couple_node) : -1;
859 
865  p3_node_index,
866  p4_node_index,
867  couple_node_index,
868  false,
869  def.airfoil,
870  def.turbine_power_kW,
871  def.pitch
872  );
873 }
874 
876 {
877  const int airbrake_idx = static_cast<int>(m_actor->ar_airbrakes.size());
878  Airbrake* ab = new Airbrake(
879  m_actor,
880  this->ComposeName("airbrake", airbrake_idx).c_str(),
881  airbrake_idx,
886  def.offset,
887  def.width,
888  def.height,
891  def.texcoord_x1,
892  def.texcoord_y1,
893  def.texcoord_x2,
894  def.texcoord_y2,
895  def.lift_coefficient
896  );
897  m_actor->ar_airbrakes.push_back(ab);
898 
899  AirbrakeGfx abx;
900  // entity
901  abx.abx_entity = ab->ec;
902  ab->ec = nullptr;
903  // mesh
904  abx.abx_mesh = ab->msh;
905  ab->msh.setNull();
906  // scenenode
907  abx.abx_scenenode = ab->snode;
908  ab->snode = nullptr;
909  // offset
910  abx.abx_offset = ab->offset;
911  ab->offset = Ogre::Vector3::ZERO;
912  // Nodes - just copy
913  abx.abx_ref_node = ab->noderef->pos;
914  abx.abx_x_node = ab->nodex->pos;
915  abx.abx_y_node = ab->nodey->pos;
916 
917  m_actor->m_gfx_actor->m_gfx_airbrakes.push_back(abx);
918 }
919 
921 {
922  if ((m_first_wing_index != -1) && (m_actor->ar_wings[m_actor->ar_num_wings - 1].fa == nullptr))
923  {
924  this->AddMessage(Message::TYPE_ERROR, "Unable to process wing, previous wing has no Airfoil");
925  return;
926  }
927 
928  if (def.airfoil == "") // May happen for malformed `wings` entry in truckfile
929  {
930  this->AddMessage(Message::TYPE_ERROR, "Unable to process wing, no Airfoil defined");
931  return;
932  }
933 
934  m_actor->GetGfxActor()->UpdateSimDataBuffer(); // fill all current nodes - needed to setup flexing meshes
935 
936  NodeNum_t node1 = this->GetNodeIndexOrThrow(def.nodes[1]);
937 
938  const std::string wing_name = this->ComposeName("wing", m_actor->ar_num_wings);
939  auto flex_airfoil = new FlexAirfoil(
940  wing_name,
941  m_actor,
942  this->GetNodeIndexOrThrow(def.nodes[0]),
943  node1,
944  this->GetNodeIndexOrThrow(def.nodes[2]),
945  this->GetNodeIndexOrThrow(def.nodes[3]),
946  this->GetNodeIndexOrThrow(def.nodes[4]),
947  this->GetNodeIndexOrThrow(def.nodes[5]),
948  this->GetNodeIndexOrThrow(def.nodes[6]),
949  this->GetNodeIndexOrThrow(def.nodes[7]),
951  Ogre::Vector2(def.tex_coords[0], def.tex_coords[1]),
952  Ogre::Vector2(def.tex_coords[2], def.tex_coords[3]),
953  Ogre::Vector2(def.tex_coords[4], def.tex_coords[5]),
954  Ogre::Vector2(def.tex_coords[6], def.tex_coords[7]),
955  (char)def.control_surface,
956  def.chord_point,
957  def.min_deflection,
958  def.max_deflection,
959  def.airfoil,
960  def.efficacy_coef,
962  );
963 
964  Ogre::Entity* entity = nullptr;
965  try
966  {
967  const std::string wing_instance_name = this->ComposeName("entity @ wing", m_actor->ar_num_wings);
968  entity = App::GetGfxScene()->GetSceneManager()->createEntity(wing_instance_name, wing_name);
969  m_actor->m_deletion_entities.emplace_back(entity);
970  this->SetupNewEntity(entity, Ogre::ColourValue(0.5, 1, 0));
971  }
972  catch (...)
973  {
974  this->AddMessage(Message::TYPE_ERROR, std::string("Failed to load mesh (flexbody wing): ") + wing_name);
975  delete flex_airfoil;
976  return;
977  }
978 
979  // induced drag
980  if (m_first_wing_index == -1)
981  {
984  m_actor->ar_nodes[flex_airfoil->nfld].AbsPosition, m_actor->ar_nodes[flex_airfoil->nfrd].AbsPosition,
985  m_actor->ar_nodes[flex_airfoil->nbld].AbsPosition, m_actor->ar_nodes[flex_airfoil->nbrd].AbsPosition
986  );
987  }
988  else
989  {
990  wing_t & previous_wing = m_actor->ar_wings[m_actor->ar_num_wings - 1];
991 
992  if (node1 != previous_wing.fa->nfld)
993  {
994  wing_t & start_wing = m_actor->ar_wings[m_first_wing_index];
995 
996  //discontinuity
997  //inform wing segments
998  float span = m_actor->ar_nodes[start_wing.fa->nfrd].RelPosition.distance(m_actor->ar_nodes[previous_wing.fa->nfld].RelPosition );
999 
1000  start_wing.fa->enableInducedDrag(span, m_wing_area, false);
1001  previous_wing.fa->enableInducedDrag(span, m_wing_area, true);
1002 
1003  //we want also to add positional lights for first wing
1005  {
1006  //Left green
1007  m_airplane_left_light=previous_wing.fa->nfld;
1008  RoR::Prop left_green_prop;
1009 
1010  left_green_prop.pp_node_ref=previous_wing.fa->nfld;
1011  left_green_prop.pp_node_x=previous_wing.fa->nflu;
1012  left_green_prop.pp_node_y=previous_wing.fa->nfld; //ignored
1013  left_green_prop.pp_offset.x=0.5;
1014  left_green_prop.pp_offset.y=0.0;
1015  left_green_prop.pp_offset.z=0.0;
1016  left_green_prop.pp_beacon_rot_angle[0]=0.0;
1017  left_green_prop.pp_beacon_rot_rate[0]=1.0;
1018  left_green_prop.pp_beacon_type='L';
1019  left_green_prop.pp_beacon_light[0]=nullptr; //no light
1020  //the flare billboard
1021  left_green_prop.pp_beacon_scene_node[0] = m_flares_parent_scenenode->createChildSceneNode(this->ComposeName("left green flare @ wing", m_actor->ar_num_wings));
1022  left_green_prop.pp_beacon_bbs[0]=App::GetGfxScene()->GetSceneManager()->createBillboardSet(this->ComposeName("left green flare bbs @ wing", m_actor->ar_num_wings),1);
1023  left_green_prop.pp_beacon_bbs[0]->createBillboard(0,0,0);
1024  if (left_green_prop.pp_beacon_bbs[0])
1025  {
1026  left_green_prop.pp_beacon_bbs[0]->setVisibilityFlags(DEPTHMAP_DISABLED);
1027  left_green_prop.pp_beacon_bbs[0]->setMaterialName("tracks/greenflare");
1028  left_green_prop.pp_beacon_scene_node[0]->attachObject(left_green_prop.pp_beacon_bbs[0]);
1029  }
1030  left_green_prop.pp_beacon_scene_node[0]->setVisible(false);
1031  left_green_prop.pp_beacon_bbs[0]->setDefaultDimensions(0.5, 0.5);
1032  m_actor->m_gfx_actor->m_props.push_back(left_green_prop);
1033 
1034  //Left flash
1035  RoR::Prop left_flash_prop;
1036 
1037  left_flash_prop.pp_node_ref=previous_wing.fa->nbld;
1038  left_flash_prop.pp_node_x=previous_wing.fa->nblu;
1039  left_flash_prop.pp_node_y=previous_wing.fa->nbld; //ignored
1040  left_flash_prop.pp_offset.x=0.5;
1041  left_flash_prop.pp_offset.y=0.0;
1042  left_flash_prop.pp_offset.z=0.0;
1043  left_flash_prop.pp_beacon_rot_angle[0]=0.5; //alt
1044  left_flash_prop.pp_beacon_rot_rate[0]=1.0;
1045  left_flash_prop.pp_beacon_type='w';
1046  //light
1047  left_flash_prop.pp_beacon_light[0]=App::GetGfxScene()->GetSceneManager()->createLight(this->ComposeName("left flash light @ wing", m_actor->ar_num_wings));
1048  left_flash_prop.pp_beacon_light[0]->setType(Ogre::Light::LT_POINT);
1049  left_flash_prop.pp_beacon_light[0]->setDiffuseColour( Ogre::ColourValue(1.0, 1.0, 1.0));
1050  left_flash_prop.pp_beacon_light[0]->setSpecularColour( Ogre::ColourValue(1.0, 1.0, 1.0));
1051  left_flash_prop.pp_beacon_light[0]->setAttenuation(50.0, 1.0, 0.3, 0.0);
1052  left_flash_prop.pp_beacon_light[0]->setCastShadows(false);
1053  left_flash_prop.pp_beacon_light[0]->setVisible(false);
1054  //the flare billboard
1055  left_flash_prop.pp_beacon_scene_node[0] = m_flares_parent_scenenode->createChildSceneNode(this->ComposeName("left flash flare @ wing", m_actor->ar_num_wings));
1056  left_flash_prop.pp_beacon_bbs[0]=App::GetGfxScene()->GetSceneManager()->createBillboardSet(this->ComposeName("left flash flare bbs @ wing", m_actor->ar_num_wings),1);
1057  left_flash_prop.pp_beacon_bbs[0]->createBillboard(0,0,0);
1058  if (left_flash_prop.pp_beacon_bbs[0])
1059  {
1060  left_flash_prop.pp_beacon_bbs[0]->setVisibilityFlags(DEPTHMAP_DISABLED);
1061  left_flash_prop.pp_beacon_bbs[0]->setMaterialName("tracks/flare");
1062  left_flash_prop.pp_beacon_scene_node[0]->attachObject(left_flash_prop.pp_beacon_bbs[0]);
1063  }
1064  left_flash_prop.pp_beacon_scene_node[0]->setVisible(false);
1065  left_flash_prop.pp_beacon_bbs[0]->setDefaultDimensions(1.0, 1.0);
1066  m_actor->m_gfx_actor->m_props.push_back(left_flash_prop);
1067 
1068  //Right red
1069  m_airplane_right_light=previous_wing.fa->nfrd;
1070  RoR::Prop right_red_prop;
1071 
1072 
1073  right_red_prop.pp_node_ref=start_wing.fa->nfrd;
1074  right_red_prop.pp_node_x=start_wing.fa->nfru;
1075  right_red_prop.pp_node_y=start_wing.fa->nfrd; //ignored
1076  right_red_prop.pp_offset.x=0.5;
1077  right_red_prop.pp_offset.y=0.0;
1078  right_red_prop.pp_offset.z=0.0;
1079  right_red_prop.pp_beacon_rot_angle[0]=0.0;
1080  right_red_prop.pp_beacon_rot_rate[0]=1.0;
1081  right_red_prop.pp_beacon_type='R';
1082  right_red_prop.pp_beacon_light[0]=nullptr; /* No light */
1083  //the flare billboard
1084  right_red_prop.pp_beacon_scene_node[0] = m_flares_parent_scenenode->createChildSceneNode(this->ComposeName("right red flare @ wing", m_actor->ar_num_wings));
1085  right_red_prop.pp_beacon_bbs[0]=App::GetGfxScene()->GetSceneManager()->createBillboardSet(this->ComposeName("right red flare bbs @ wing", m_actor->ar_num_wings),1);
1086  right_red_prop.pp_beacon_bbs[0]->createBillboard(0,0,0);
1087  if (right_red_prop.pp_beacon_bbs[0])
1088  {
1089  right_red_prop.pp_beacon_bbs[0]->setVisibilityFlags(DEPTHMAP_DISABLED);
1090  right_red_prop.pp_beacon_bbs[0]->setMaterialName("tracks/redflare");
1091  right_red_prop.pp_beacon_scene_node[0]->attachObject(right_red_prop.pp_beacon_bbs[0]);
1092  }
1093  right_red_prop.pp_beacon_scene_node[0]->setVisible(false);
1094  right_red_prop.pp_beacon_bbs[0]->setDefaultDimensions(0.5, 0.5);
1095  m_actor->m_gfx_actor->m_props.push_back(right_red_prop);
1096 
1097  //Right flash
1098  RoR::Prop right_flash_prop;
1099 
1100  right_flash_prop.pp_node_ref=start_wing.fa->nbrd;
1101  right_flash_prop.pp_node_x=start_wing.fa->nbru;
1102  right_flash_prop.pp_node_y=start_wing.fa->nbrd; //ignored
1103  right_flash_prop.pp_offset.x=0.5;
1104  right_flash_prop.pp_offset.y=0.0;
1105  right_flash_prop.pp_offset.z=0.0;
1106  right_flash_prop.pp_beacon_rot_angle[0]=0.5; //alt
1107  right_flash_prop.pp_beacon_rot_rate[0]=1.0;
1108  right_flash_prop.pp_beacon_type='w';
1109  //light
1110  right_flash_prop.pp_beacon_light[0]=App::GetGfxScene()->GetSceneManager()->createLight(this->ComposeName("right flash flare light @ wing", m_actor->ar_num_wings));
1111  right_flash_prop.pp_beacon_light[0]->setType(Ogre::Light::LT_POINT);
1112  right_flash_prop.pp_beacon_light[0]->setDiffuseColour( Ogre::ColourValue(1.0, 1.0, 1.0));
1113  right_flash_prop.pp_beacon_light[0]->setSpecularColour( Ogre::ColourValue(1.0, 1.0, 1.0));
1114  right_flash_prop.pp_beacon_light[0]->setAttenuation(50.0, 1.0, 0.3, 0.0);
1115  right_flash_prop.pp_beacon_light[0]->setCastShadows(false);
1116  right_flash_prop.pp_beacon_light[0]->setVisible(false);
1117  //the flare billboard
1118  right_flash_prop.pp_beacon_scene_node[0] = m_flares_parent_scenenode->createChildSceneNode(this->ComposeName("right flash flare @ wing", m_actor->ar_num_wings));
1119  right_flash_prop.pp_beacon_bbs[0]=App::GetGfxScene()->GetSceneManager()->createBillboardSet(this->ComposeName("right flash flare bbs @ wing", m_actor->ar_num_wings),1);
1120  right_flash_prop.pp_beacon_bbs[0]->createBillboard(0,0,0);
1121  if (right_flash_prop.pp_beacon_bbs[0] != nullptr)
1122  {
1123  right_flash_prop.pp_beacon_bbs[0]->setVisibilityFlags(DEPTHMAP_DISABLED);
1124  right_flash_prop.pp_beacon_bbs[0]->setMaterialName("tracks/flare");
1125  right_flash_prop.pp_beacon_scene_node[0]->attachObject(right_flash_prop.pp_beacon_bbs[0]);
1126  }
1127  right_flash_prop.pp_beacon_scene_node[0]->setVisible(false);
1128  right_flash_prop.pp_beacon_bbs[0]->setDefaultDimensions(1.0, 1.0);
1129  m_actor->m_gfx_actor->m_props.push_back(right_flash_prop);
1130 
1131  m_generate_wing_position_lights = false; // Already done
1132  }
1133 
1136  m_actor->ar_nodes[flex_airfoil->nfld].AbsPosition, m_actor->ar_nodes[flex_airfoil->nfrd].AbsPosition,
1137  m_actor->ar_nodes[flex_airfoil->nbld].AbsPosition, m_actor->ar_nodes[flex_airfoil->nbrd].AbsPosition
1138  );
1139  }
1140  else
1141  {
1143  m_actor->ar_nodes[flex_airfoil->nfld].AbsPosition, m_actor->ar_nodes[flex_airfoil->nfrd].AbsPosition,
1144  m_actor->ar_nodes[flex_airfoil->nbld].AbsPosition, m_actor->ar_nodes[flex_airfoil->nbrd].AbsPosition
1145  );
1146  }
1147  }
1148 
1149  // Add new wing to rig
1150  m_actor->ar_wings[m_actor->ar_num_wings].fa = flex_airfoil;
1152  m_actor->ar_wings[m_actor->ar_num_wings].cnode->attachObject(entity);
1153 
1154  ++m_actor->ar_num_wings;
1155 }
1156 
1157 float ActorSpawner::ComputeWingArea(Ogre::Vector3 const & ref, Ogre::Vector3 const & x, Ogre::Vector3 const & y, Ogre::Vector3 const & aref)
1158 {
1159  return (((x-ref).crossProduct(y-ref)).length()+((x-aref).crossProduct(y-aref)).length())*0.5f;
1160 }
1161 
1163 {
1164 #ifdef USE_OPENAL
1165  NodeNum_t node = ResolveNodeRef(def.node);
1166  if (node == NODENUM_INVALID)
1167  {
1168  return;
1169  }
1171  m_actor,
1173  node,
1174  def.mode
1175  );
1176 #endif // USE_OPENAL
1177 }
1178 
1179 void ActorSpawner::AddSoundSourceInstance(ActorPtr const& vehicle, Ogre::String const & sound_script_name, int node_index, int type)
1180 {
1181 #ifdef USE_OPENAL
1182  AddSoundSource(vehicle, App::GetSoundScriptManager()->createInstance(sound_script_name, vehicle->ar_instance_id), (NodeNum_t)node_index);
1183 #endif // USE_OPENAL
1184 }
1185 
1186 void ActorSpawner::AddSoundSource(ActorPtr const& vehicle, SoundScriptInstancePtr sound_script, NodeNum_t node_index, int type)
1187 {
1188  if (! CheckSoundScriptLimit(vehicle, 1))
1189  {
1190  return;
1191  }
1192 
1193  if (sound_script == nullptr)
1194  {
1195  return;
1196  }
1197 
1198  vehicle->ar_soundsources[vehicle->ar_num_soundsources].ssi=sound_script;
1199  vehicle->ar_soundsources[vehicle->ar_num_soundsources].nodenum=node_index;
1200  vehicle->ar_soundsources[vehicle->ar_num_soundsources].type=type;
1201  vehicle->ar_num_soundsources++;
1202 }
1203 
1205 {
1206 #ifdef USE_OPENAL
1208  m_actor,
1211  -2
1212  );
1213 #endif // USE_OPENAL
1214 }
1215 
1217 {
1218  auto itor = def.nodes.begin();
1219  auto end = def.nodes.end();
1220  for(; itor != end; ++itor)
1221  {
1222  if (! CheckCameraRailLimit(1))
1223  {
1224  return;
1225  }
1228  }
1229 }
1230 
1232 {
1234  if (def.node.IsValidAnyState())
1235  {
1237  }
1238 }
1239 
1241 {
1242  if (def.key == "helpMaterial")
1243  {
1244  m_help_material_name = (def.value != "") ? def.value : m_help_material_name;
1245  }
1246  else if (def.key == "speedoMax")
1247  {
1248  float maxKph = PARSEREAL(def.value);
1249  if (maxKph > 10 && maxKph < 32000)
1250  {
1252  }
1253  else
1254  {
1256  fmt::format("Invalid 'speedoMax' ({}), allowed range is <10 -32000>, using default ({})", maxKph, DEFAULT_SPEEDO_MAX_KPH));
1258  }
1259  }
1260  else if (def.key == "useMaxRPM")
1261  {
1263  }
1264  else if (def.key == "shifterAnimTime")
1265  {
1267  }
1268 
1269  // NOTE: Dashboard layouts are processed later
1270 }
1271 
1273 {
1274  NodeNum_t node = GetNodeIndexOrThrow(node_ref);
1275  m_actor->ar_nodes[node].nd_immovable = true;
1276 }
1277 
1279 {
1280  if (m_actor->m_disable_smoke)
1281  {
1282  return;
1283  }
1284 
1285  const ExhaustID_t exhaust_id = (ExhaustID_t)m_actor->exhausts.size();
1286  exhaust_t exhaust;
1287  exhaust.emitterNode = this->GetNodeIndexOrThrow(def.reference_node);
1288  exhaust.directionNode = this->GetNodeIndexOrThrow(def.direction_node);
1289 
1290  std::string template_name = def.particle_name;
1291  if (template_name == "" || template_name == "default")
1292  {
1293  template_name = "tracks/Smoke"; // defined in `particles/smoke.particle`
1294  }
1295  exhaust.particleSystemName = template_name;
1296 
1298  {
1299  std::string name = this->ComposeName(template_name.c_str(), (int)m_actor->exhausts.size());
1300  exhaust.smoker = this->CreateParticleSystem(name, template_name);
1301  if (exhaust.smoker == nullptr)
1302  {
1303  std::stringstream msg;
1304  msg << "Failed to create particle system '" << name << "' (template: '" << template_name <<"')";
1305  AddMessage(Message::TYPE_ERROR, msg.str());
1306  return;
1307  }
1308 
1309  exhaust.smokeNode = m_particles_parent_scenenode->createChildSceneNode(this->ComposeName("exhaust", (int)m_actor->exhausts.size()));
1310  exhaust.smokeNode->attachObject(exhaust.smoker);
1311  exhaust.smokeNode->setPosition(m_actor->ar_nodes[exhaust.emitterNode].AbsPosition);
1312 
1313  m_actor->m_gfx_actor->SetNodeHot(exhaust.emitterNode, true);
1314  m_actor->m_gfx_actor->SetNodeHot(exhaust.directionNode, true);
1315  }
1316 
1317  m_actor->exhausts.push_back(exhaust);
1318 }
1319 
1321 {
1322  auto module_itor = m_selected_modules.begin();
1323  auto module_end = m_selected_modules.end();
1324  for (; module_itor != module_end; ++module_itor)
1325  {
1326  if (! module_itor->get()->submesh_groundmodel.empty())
1327  {
1328  return module_itor->get()->submesh_groundmodel[0];
1329  }
1330  }
1331  return std::string();
1332 };
1333 
1335 {
1336  if (! CheckSubmeshLimit(1))
1337  {
1338  return;
1339  }
1340 
1341  /* TEXCOORDS */
1342 
1343  std::vector<RigDef::Texcoord>::iterator texcoord_itor = def.texcoords.begin();
1344  for ( ; texcoord_itor != def.texcoords.end(); texcoord_itor++)
1345  {
1346  if (! CheckTexcoordLimit(1))
1347  {
1348  break;
1349  }
1350 
1351  CabTexcoord texcoord;
1352  texcoord.node_id = GetNodeIndexOrThrow(texcoord_itor->node);
1353  texcoord.texcoord_u = texcoord_itor->u;
1354  texcoord.texcoord_v = texcoord_itor->v;
1355  m_oldstyle_cab_texcoords.push_back(texcoord);
1356  }
1357 
1358  /* CAB */
1359 
1360  auto cab_itor = def.cab_triangles.begin();
1361  auto cab_itor_end = def.cab_triangles.end();
1362  for ( ; cab_itor != cab_itor_end; ++cab_itor)
1363  {
1364  if (! CheckCabLimit(1))
1365  {
1366  return;
1367  }
1368  else if (m_actor->ar_num_collcabs >= MAX_CABS)
1369  {
1370  std::stringstream msg;
1371  msg << "Collcab limit (" << MAX_CABS << ") exceeded";
1372  AddMessage(Message::TYPE_ERROR, msg.str());
1373  return;
1374  }
1375 
1376  bool mk_buoyance = false;
1377 
1378  m_actor->ar_cabs[m_actor->ar_num_cabs*3]=GetNodeIndexOrThrow(cab_itor->nodes[0]);
1379  m_actor->ar_cabs[m_actor->ar_num_cabs*3+1]=GetNodeIndexOrThrow(cab_itor->nodes[1]);
1380  m_actor->ar_cabs[m_actor->ar_num_cabs*3+2]=GetNodeIndexOrThrow(cab_itor->nodes[2]);
1381 
1382  // TODO: Clean this up properly ~ ulteq 10/2018
1383  if (BITMASK_IS_1(cab_itor->options, RigDef::Cab::OPTION_c_CONTACT) ||
1384  BITMASK_IS_1(cab_itor->options, RigDef::Cab::OPTION_p_10xTOUGHER) ||
1386  {
1389  }
1390  if (BITMASK_IS_1(cab_itor->options, RigDef::Cab::OPTION_b_BUOYANT))
1391  {
1395  mk_buoyance = true;
1396  }
1397  if (BITMASK_IS_1(cab_itor->options, RigDef::Cab::OPTION_r_BUOYANT_ONLY_DRAG))
1398  {
1402  mk_buoyance = true;
1403  }
1404  if (BITMASK_IS_1(cab_itor->options, RigDef::Cab::OPTION_s_BUOYANT_NO_DRAG))
1405  {
1409  mk_buoyance = true;
1410  }
1411 
1412  if (BITMASK_IS_1(cab_itor->options, RigDef::Cab::OPTION_D_CONTACT_BUOYANT) ||
1415  {
1416 
1418  {
1419  std::stringstream msg;
1420  msg << "Collcab limit (" << MAX_CABS << ") exceeded";
1421  AddMessage(Message::TYPE_ERROR, msg.str());
1422  return;
1423  }
1424  else if (m_actor->ar_num_buoycabs >= MAX_CABS)
1425  {
1426  std::stringstream msg;
1427  msg << "Buoycab limit (" << MAX_CABS << ") exceeded";
1428  AddMessage(Message::TYPE_ERROR, msg.str());
1429  return;
1430  }
1431 
1437  mk_buoyance = true;
1438  }
1439 
1440  if (mk_buoyance && (m_actor->m_buoyance == nullptr))
1441  {
1442  Buoyance* buoy = new Buoyance(App::GetGfxScene()->GetDustPool("splash"), App::GetGfxScene()->GetDustPool("ripple"));
1443  m_actor->m_buoyance.reset(buoy);
1444  }
1445  m_actor->ar_num_cabs++;
1446  }
1447 
1448  //close the current mesh
1449  CabSubmesh submesh;
1450  submesh.texcoords_pos = m_oldstyle_cab_texcoords.size();
1451  submesh.cabs_pos = static_cast<unsigned int>(m_actor->ar_num_cabs);
1453  m_oldstyle_cab_submeshes.push_back(submesh);
1454 
1455  /* BACKMESH */
1456 
1457  if (def.backmesh)
1458  {
1459 
1460  // Check limit
1461  if (! CheckCabLimit(1))
1462  {
1463  return;
1464  }
1465 
1466  // === add an extra front mesh ===
1467  //texcoords
1468  int uv_start = (m_oldstyle_cab_submeshes.size()==1) ? 0 : static_cast<int>((m_oldstyle_cab_submeshes.rbegin()+1)->texcoords_pos);
1469  for (size_t i=uv_start; i<m_oldstyle_cab_submeshes.back().texcoords_pos; i++)
1470  {
1472  }
1473  //cab
1474  int cab_start = (m_oldstyle_cab_submeshes.size()==1) ? 0 : static_cast<int>((m_oldstyle_cab_submeshes.rbegin()+1)->cabs_pos);
1475  for (size_t i=cab_start; i<m_oldstyle_cab_submeshes.back().cabs_pos; i++)
1476  {
1480  m_actor->ar_num_cabs++;
1481  }
1482  // Finalize
1483  CabSubmesh submesh;
1485  submesh.texcoords_pos = m_oldstyle_cab_texcoords.size();
1486  submesh.cabs_pos = static_cast<unsigned int>(m_actor->ar_num_cabs);
1487  m_oldstyle_cab_submeshes.push_back(submesh);
1488 
1489  // === add an extra back mesh ===
1490  //texcoords
1491  uv_start = (m_oldstyle_cab_submeshes.size()==1) ? 0 : static_cast<int>((m_oldstyle_cab_submeshes.rbegin()+1)->texcoords_pos);
1492  for (size_t i=uv_start; i<m_oldstyle_cab_submeshes.back().texcoords_pos; i++)
1493  {
1495  }
1496 
1497  //cab
1498  cab_start = (m_oldstyle_cab_submeshes.size()==1) ? 0 : static_cast<int>((m_oldstyle_cab_submeshes.rbegin()+1)->cabs_pos);
1499  for (size_t i=cab_start; i<m_oldstyle_cab_submeshes.back().cabs_pos; i++)
1500  {
1504  m_actor->ar_num_cabs++;
1505  }
1506 
1507  //close the current mesh
1508  CabSubmesh submesh2;
1509  submesh2.texcoords_pos = m_oldstyle_cab_texcoords.size();
1510  submesh2.cabs_pos = static_cast<unsigned int>(m_actor->ar_num_cabs);
1512  m_oldstyle_cab_submeshes.push_back(submesh2);
1513  }
1514 }
1515 
1517 {
1518  const FlexbodyID_t flexbody_id = (FlexbodyID_t)m_actor->m_gfx_actor->m_flexbodies.size();
1519 
1520  // Check if disabled by .tuneup mod.
1522  {
1523  // Create placeholder
1524  m_actor->m_gfx_actor->m_flexbodies.emplace_back(new FlexBody(FlexBody::PlaceholderType::TUNING_REMOVED_PLACEHOLDER, flexbody_id, def.mesh_name));
1525  return;
1526  }
1527 
1528  // Collect nodes
1529  std::vector<unsigned int> node_indices;
1530  bool nodes_found = true;
1531  for (auto& node_def: def.node_list)
1532  {
1533  NodeNum_t node = this->ResolveNodeRef(node_def);
1534  if (node == NODENUM_INVALID)
1535  {
1536  nodes_found = false;
1537  break;
1538  }
1539  node_indices.push_back(node);
1540  }
1541 
1542  if (! nodes_found)
1543  {
1544  this->AddMessage(Message::TYPE_ERROR, "Failed to collect nodes from 'forset' at flexbody: " + def.mesh_name);
1545  // Create placeholder too keep the order of flexbodies (helps Tuning and diagnostics)
1546  m_actor->m_gfx_actor->m_flexbodies.emplace_back(new FlexBody(FlexBody::PlaceholderType::FAULTY_FORSET_PLACEHOLDER, flexbody_id, def.mesh_name));
1547  return;
1548  }
1549 
1550  m_actor->GetGfxActor()->UpdateSimDataBuffer(); // fill all current nodes - needed to setup flexing meshes
1551 
1552  try
1553  {
1555  (FlexbodyID_t)m_actor->m_gfx_actor->m_flexbodies.size(),
1556  this->GetNodeIndexOrThrow(def.reference_node),
1557  this->GetNodeIndexOrThrow(def.x_axis_node),
1558  this->GetNodeIndexOrThrow(def.y_axis_node),
1561  node_indices,
1563  TuneupUtil::getTweakedFlexbodyMediaRG(m_actor->getWorkingTuneupDef(), flexbody_id, 0, this->GetCurrentElementMediaRG())
1564  );
1565 
1566  // Dynamic visibility - same as with props
1567  flexbody->fb_camera_mode_orig = def.camera_settings.mode;
1568  flexbody->fb_camera_mode_active = def.camera_settings.mode;
1569  m_actor->m_gfx_actor->m_flexbodies.emplace_back(flexbody);
1570  }
1571  catch (Ogre::Exception& e)
1572  {
1573  // Ogre::Exception description already logged by OGRE
1574  this->AddMessage(Message::TYPE_ERROR, "Failed to create flexbody '" + def.mesh_name + "'");
1575  // Create placeholder too keep the order of flexbodies (helps Tuning and diagnostics)
1576  m_actor->m_gfx_actor->m_flexbodies.emplace_back(new FlexBody(FlexBody::PlaceholderType::FAULTY_MESH_PLACEHOLDER, flexbody_id, def.mesh_name));
1577  }
1578 }
1579 
1581 {
1584 }
1585 
1587 {
1588  PropID_t prop_id = static_cast<int>(m_actor->m_gfx_actor->m_props.size());
1589 
1590  // Check if removed via .tuneup
1592  {
1593  RoR::Prop pprop; // placeholder
1594  pprop.pp_id = prop_id;
1598  m_actor->m_gfx_actor->m_props.push_back(pprop);
1599  return;
1600  }
1601 
1602  RoR::Prop prop;
1603  prop.pp_id = prop_id;
1605  prop.pp_node_x = this->GetNodeIndexOrThrow(def.x_axis_node);
1606  prop.pp_node_y = this->GetNodeIndexOrThrow(def.y_axis_node);
1608  prop.pp_offset_orig = prop.pp_offset;
1610  prop.pp_rot = Ogre::Quaternion(Ogre::Degree(prop.pp_rota.z), Ogre::Vector3::UNIT_Z)
1611  * Ogre::Quaternion(Ogre::Degree(prop.pp_rota.y), Ogre::Vector3::UNIT_Y)
1612  * Ogre::Quaternion(Ogre::Degree(prop.pp_rota.x), Ogre::Vector3::UNIT_X);
1613  prop.pp_camera_mode_active = def.camera_settings.mode; /* Handles default value */
1614  prop.pp_camera_mode_orig = def.camera_settings.mode; /* Handles default value */
1615  prop.pp_wheel_rot_degree = 160.f; // ??
1616 
1617  /* SPECIAL PROPS */
1618 
1619  /* Rear view mirror (left) */
1621  {
1623  }
1624 
1625  /* Rear view mirror (right) */
1627  {
1629  }
1630 
1631  /* Custom steering wheel */
1632  Ogre::Vector3 steering_wheel_offset = Ogre::Vector3::ZERO;
1634  {
1635  steering_wheel_offset = Ogre::Vector3(-0.67, -0.61,0.24);
1636  }
1638  {
1639  steering_wheel_offset = Ogre::Vector3(0.67, -0.61,0.24);
1640  }
1641  if (steering_wheel_offset != Ogre::Vector3::ZERO)
1642  {
1644  {
1645  steering_wheel_offset = def.special_prop_dashboard.offset;
1646  }
1648  prop.pp_wheel_scene_node = m_props_parent_scenenode->createChildSceneNode(this->ComposeName("steering wheel @ prop", prop_id));
1649  prop.pp_wheel_pos = steering_wheel_offset;
1651  prop.pp_wheel_mesh_obj = new MeshObject(
1652  prop.pp_media[1],
1653  TuneupUtil::getTweakedPropMediaRG(m_actor->getWorkingTuneupDef(), prop_id, 1, this->GetCurrentElementMediaRG()),
1654  this->ComposeName("steering wheel entity @ prop", prop_id),
1655  prop.pp_wheel_scene_node
1656  );
1657  this->SetupNewEntity(prop.pp_wheel_mesh_obj->getEntity(), Ogre::ColourValue(0, 0.5, 0.5));
1658  }
1659 
1660  /* CREATE THE PROP */
1661  prop.pp_scene_node = m_props_parent_scenenode->createChildSceneNode(this->ComposeName("prop", prop_id));
1663  prop.pp_mesh_obj = new MeshObject(
1664  prop.pp_media[0],
1665  TuneupUtil::getTweakedPropMediaRG(m_actor->getWorkingTuneupDef(), prop_id, 0, this->GetCurrentElementMediaRG()),
1666  this->ComposeName("prop entity", prop_id),
1667  prop.pp_scene_node);
1668 
1669  prop.pp_mesh_obj->setCastShadows(true); // Orig code {{ prop.pp_mesh_obj->setCastShadows(shadowmode != 0); }}, shadowmode has default value 1 and changes with undocumented directive 'set_shadows'
1670 
1672  {
1673  prop.pp_aero_propeller_spin = true;
1674  prop.pp_mesh_obj->setCastShadows(false);
1675  prop.pp_scene_node->setVisible(false);
1676  }
1678  {
1679  prop.pp_aero_propeller_blade = true;
1680  }
1682  {
1683  //driver seat, used to position the driver and make the seat translucent at times
1684  if (m_actor->m_gfx_actor->m_driverseat_prop_index == -1)
1685  {
1686  m_actor->m_gfx_actor->m_driverseat_prop_index = prop_id;
1687  prop.pp_mesh_obj->setMaterialName("driversseat");
1688  }
1689  else
1690  {
1691  this->AddMessage(Message::TYPE_INFO, "Found more than one 'seat[2]' special props. Only the first one will be the driver's seat.");
1692  }
1693  }
1695  {
1696  // Same as DRIVER_SEAT, except it doesn't force the "driversseat" material
1697  if (m_actor->m_gfx_actor->m_driverseat_prop_index == -1)
1698  {
1699  m_actor->m_gfx_actor->m_driverseat_prop_index = prop_id;
1700  }
1701  else
1702  {
1703  this->AddMessage(Message::TYPE_INFO, "Found more than one 'seat[2]' special props. Only the first one will be the driver's seat.");
1704  }
1705  }
1707  {
1709  {
1710  prop.pp_beacon_type = 'b';
1711  prop.pp_beacon_rot_angle[0] = 2.0 * 3.14 * frand();
1712  prop.pp_beacon_rot_rate[0] = 4.0 * 3.14 + frand() - 0.5;
1713  /* the light */
1714  auto pp_beacon_light = App::GetGfxScene()->GetSceneManager()->createLight();
1715  pp_beacon_light->setType(Ogre::Light::LT_SPOTLIGHT);
1716  pp_beacon_light->setDiffuseColour(def.special_prop_beacon.color);
1717  pp_beacon_light->setSpecularColour(def.special_prop_beacon.color);
1718  pp_beacon_light->setAttenuation(50.0, 1.0, 0.3, 0.0);
1719  pp_beacon_light->setSpotlightRange( Ogre::Degree(35), Ogre::Degree(45) );
1720  pp_beacon_light->setCastShadows(false);
1721  pp_beacon_light->setVisible(false);
1722  /* the flare billboard */
1724  auto flare_scene_node = m_flares_parent_scenenode->createChildSceneNode(this->ComposeName("beacon @ prop", prop_id));
1725  auto flare_billboard_sys = App::GetGfxScene()->GetSceneManager()->createBillboardSet(1); //(propname,1);
1726  if (flare_billboard_sys)
1727  {
1728  flare_billboard_sys->createBillboard(0,0,0);
1729  flare_billboard_sys->setMaterialName(prop.pp_media[1]);
1730  flare_billboard_sys->setVisibilityFlags(DEPTHMAP_DISABLED);
1731  flare_scene_node->attachObject(flare_billboard_sys);
1732  }
1733  flare_scene_node->setVisible(false);
1734 
1735  // Complete
1736  prop.pp_beacon_scene_node[0] = flare_scene_node;
1737  prop.pp_beacon_bbs[0] = flare_billboard_sys;
1738  prop.pp_beacon_light[0] = pp_beacon_light;
1739  }
1740  else if(def.special == RigDef::SpecialProp::REDBEACON)
1741  {
1742  prop.pp_beacon_rot_angle[0] = 0.f;
1743  prop.pp_beacon_rot_rate[0] = 1.0;
1744  prop.pp_beacon_type = 'r';
1745  //the light
1746  auto pp_beacon_light=App::GetGfxScene()->GetSceneManager()->createLight();//propname);
1747  pp_beacon_light->setType(Ogre::Light::LT_POINT);
1748  pp_beacon_light->setDiffuseColour( Ogre::ColourValue(1.0, 0.0, 0.0));
1749  pp_beacon_light->setSpecularColour( Ogre::ColourValue(1.0, 0.0, 0.0));
1750  pp_beacon_light->setAttenuation(50.0, 1.0, 0.3, 0.0);
1751  pp_beacon_light->setCastShadows(false);
1752  pp_beacon_light->setVisible(false);
1753  //the flare billboard
1754  auto flare_scene_node = m_flares_parent_scenenode->createChildSceneNode(this->ComposeName("redbeacon @ prop", prop_id));
1755  auto flare_billboard_sys = App::GetGfxScene()->GetSceneManager()->createBillboardSet(1); //propname,1);
1756  if (flare_billboard_sys)
1757  {
1758  flare_billboard_sys->createBillboard(0,0,0);
1759  flare_billboard_sys->setMaterialName("tracks/redbeaconflare");
1760  flare_billboard_sys->setVisibilityFlags(DEPTHMAP_DISABLED);
1761  flare_billboard_sys->setDefaultDimensions(1.0, 1.0);
1762  flare_scene_node->attachObject(flare_billboard_sys);
1763  }
1764  flare_scene_node->setVisible(false);
1765 
1766  // Finalize
1767  prop.pp_beacon_light[0] = pp_beacon_light;
1768  prop.pp_beacon_scene_node[0] = flare_scene_node;
1769  prop.pp_beacon_bbs[0] = flare_billboard_sys;
1770 
1771  }
1772  else if(def.special == RigDef::SpecialProp::LIGHTBAR)
1773  {
1774  m_actor->ar_is_police = true;
1775  prop.pp_beacon_type='p';
1776  for (int k=0; k<4; k++)
1777  {
1778  prop.pp_beacon_rot_angle[k] = 2.0 * 3.14 * frand();
1779  prop.pp_beacon_rot_rate[k] = 4.0 * 3.14 + frand() - 0.5;
1780  prop.pp_beacon_bbs[k] = nullptr;
1781  //the light
1782  prop.pp_beacon_light[k]=App::GetGfxScene()->GetSceneManager()->createLight();
1783  prop.pp_beacon_light[k]->setType(Ogre::Light::LT_SPOTLIGHT);
1784  if (k>1)
1785  {
1786  prop.pp_beacon_light[k]->setDiffuseColour( Ogre::ColourValue(1.0, 0.0, 0.0));
1787  prop.pp_beacon_light[k]->setSpecularColour( Ogre::ColourValue(1.0, 0.0, 0.0));
1788  }
1789  else
1790  {
1791  prop.pp_beacon_light[k]->setDiffuseColour( Ogre::ColourValue(0.0, 0.5, 1.0));
1792  prop.pp_beacon_light[k]->setSpecularColour( Ogre::ColourValue(0.0, 0.5, 1.0));
1793  }
1794  prop.pp_beacon_light[k]->setAttenuation(50.0, 1.0, 0.3, 0.0);
1795  prop.pp_beacon_light[k]->setSpotlightRange( Ogre::Degree(35), Ogre::Degree(45) );
1796  prop.pp_beacon_light[k]->setCastShadows(false);
1797  prop.pp_beacon_light[k]->setVisible(false);
1798  //the flare billboard
1799  prop.pp_beacon_scene_node[k] = m_flares_parent_scenenode->createChildSceneNode(this->ComposeName(fmt::format("lightbar {}/4 @ prop", k), prop_id));
1800  prop.pp_beacon_bbs[k]=App::GetGfxScene()->GetSceneManager()->createBillboardSet(1);
1801  prop.pp_beacon_bbs[k]->createBillboard(0,0,0);
1802  if (prop.pp_beacon_bbs[k])
1803  {
1804  if (k>1)
1805  {
1806  prop.pp_beacon_bbs[k]->setMaterialName("tracks/brightredflare");
1807  }
1808  else
1809  {
1810  prop.pp_beacon_bbs[k]->setMaterialName("tracks/brightblueflare");
1811  }
1812 
1813  prop.pp_beacon_bbs[k]->setVisibilityFlags(DEPTHMAP_DISABLED);
1814  prop.pp_beacon_scene_node[k]->attachObject(prop.pp_beacon_bbs[k]);
1815  }
1816  prop.pp_beacon_scene_node[k]->setVisible(false);
1817  }
1818  }
1819 
1821  {
1823  }
1824  }
1825 
1826  this->SetupNewEntity(prop.pp_mesh_obj->getEntity(), Ogre::ColourValue(1.f, 1.f, 0.f));
1827 
1828  m_curr_mirror_prop_scenenode = nullptr;
1830 
1831  /* PROCESS ANIMATIONS */
1832 
1833  for (RigDef::Animation& anim_def: def.animations)
1834  {
1835  PropAnim anim;
1836 
1837  /* Arg #1: ratio */
1838  anim.animratio = anim_def.ratio;
1839  if (anim_def.ratio == 0)
1840  {
1841  std::stringstream msg;
1842  msg << "Prop (mesh: " << def.mesh_name << ") has invalid animation ratio (0), using it anyway (compatibility)...";
1843  AddMessage(Message::TYPE_WARNING, msg.str());
1844  }
1845 
1846  /* Arg #2: option1 (lower limit) */
1847  anim.lower_limit = anim_def.lower_limit; /* Handles default */
1848 
1849  /* Arg #3: option2 (upper limit) */
1850  anim.upper_limit = anim_def.upper_limit; /* Handles default */
1851 
1852  /* Arg #4: source */
1853  if (BITMASK_IS_1(anim_def.source, RigDef::Animation::SOURCE_AIRSPEED)) { /* (NOTE: code formatting relaxed) */
1855  }
1858  }
1861  anim.animOpt3 = 1.f;
1862  }
1865  anim.animOpt3 = 2.f;
1866  }
1869  anim.animOpt3 = 3.f;
1870  }
1873  }
1876  }
1879  }
1882  }
1885  }
1888  }
1891  }
1894  }
1897  }
1900  }
1903  }
1906  }
1909  anim.animOpt3 = SHIFTERMAN1;
1910  }
1913  anim.animOpt3 = SHIFTERMAN2;
1914  }
1917  anim.animOpt3 = SHIFTERSEQ;
1918  }
1921  anim.animOpt3 = SHIFTERLIN;
1922  }
1925  anim.animOpt3 = AUTOSHIFTERLIN;
1926  }
1929  }
1932  }
1935  }
1938  }
1941  }
1944  }
1947  }
1950  }
1953  }
1956  }
1959  }
1962  anim.animOpt3 = -1;
1963  }
1966  anim.animOpt3 = 0;
1967  }
1968 
1969  /* Motor/Gear-indexed sources */
1970  std::list<RigDef::Animation::MotorSource>::iterator source_itor = anim_def.motor_sources.begin();
1971  for ( ; source_itor != anim_def.motor_sources.end(); source_itor++)
1972  {
1973  // aeroengines
1976  anim.animOpt3 = static_cast<float>(source_itor->motor);
1977  }
1980  anim.animOpt3 = static_cast<float>(source_itor->motor);
1981  }
1984  anim.animOpt3 = static_cast<float>(source_itor->motor);
1985  }
1988  anim.animOpt3 = static_cast<float>(source_itor->motor);
1989  }
1992  anim.animOpt3 = static_cast<float>(source_itor->motor);
1993  }
1994 
1995  // gears (hack)
1998  anim.animOpt3 = static_cast<float>(source_itor->motor);
1999  }
2000  }
2001 
2002  // Source 'event' - make sure there is parameter 'event:'
2004  anim_def.event_name != "")
2005  {
2006  int event_id = RoR::App::GetInputEngine()->resolveEventName(anim_def.event_name);
2007  if (event_id == -1)
2008  {
2009  AddMessage(Message::TYPE_ERROR, "Unknown animation event: " + anim_def.event_name);
2010  }
2011  else
2012  {
2013  PropAnimKeyState state;
2015  state.event_id = static_cast<events>(event_id);
2016  m_actor->m_prop_anim_key_states.push_back(state);
2018  }
2019  }
2020 
2021  // Source 'dashboard' - make sure there is parameter 'link:'
2023  anim_def.dash_link_name != "")
2024  {
2025  int link_id = m_actor->ar_dashboard->getLinkIDForName(anim_def.dash_link_name);
2026  if (link_id == -1)
2027  {
2028  AddMessage(Message::TYPE_ERROR, "Unknown animation dashboard link: " + anim_def.dash_link_name);
2029  }
2030  else
2031  {
2033  anim.animOpt3 = static_cast<float>(link_id);
2034  }
2035  }
2036 
2037  if (anim.animFlags == 0)
2038  {
2039  AddMessage(Message::TYPE_ERROR, fmt::format("Prop (mesh: '{}') will not be animated, no valid `source` was set.", def.mesh_name));
2040  }
2041 
2042  /* Anim modes */
2045  }
2048  }
2051  }
2054  }
2057  }
2060  }
2061  if (anim.animMode == 0)
2062  {
2063  AddMessage(Message::TYPE_ERROR, fmt::format("Prop (mesh: '{}') will not be animated, no valid `mode` was set.", def.mesh_name));
2064  }
2065 
2067  {
2069 
2070  // Flag whether default lower and/or upper animation limit constraints are effective
2071  const bool use_default_lower_limit = (anim_def.lower_limit == 0.f);
2072  const bool use_default_upper_limit = (anim_def.upper_limit == 0.f);
2073 
2075  anim.lower_limit = (use_default_lower_limit) ? (-180.f) : (anim_def.lower_limit + prop.pp_rota.x);
2076  anim.upper_limit = (use_default_upper_limit) ? ( 180.f) : (anim_def.upper_limit + prop.pp_rota.x);
2077  }
2079  anim.lower_limit = (use_default_lower_limit) ? (-180.f) : (anim_def.lower_limit + prop.pp_rota.y);
2080  anim.upper_limit = (use_default_upper_limit) ? ( 180.f) : (anim_def.upper_limit + prop.pp_rota.y);
2081  }
2083  anim.lower_limit = (use_default_lower_limit) ? (-180.f) : (anim_def.lower_limit + prop.pp_rota.z);
2084  anim.upper_limit = (use_default_upper_limit) ? ( 180.f) : (anim_def.upper_limit + prop.pp_rota.z);
2085  }
2087  anim.lower_limit = (use_default_lower_limit) ? (-10.f) : (anim_def.lower_limit + prop.pp_offset_orig.x);
2088  anim.upper_limit = (use_default_upper_limit) ? ( 10.f) : (anim_def.upper_limit + prop.pp_offset_orig.x);
2089  }
2091  anim.lower_limit = (use_default_lower_limit) ? (-10.f) : (anim_def.lower_limit + prop.pp_offset_orig.y);
2092  anim.upper_limit = (use_default_upper_limit) ? ( 10.f) : (anim_def.upper_limit + prop.pp_offset_orig.y);
2093  }
2095  anim.lower_limit = (use_default_lower_limit) ? (-10.f) : (anim_def.lower_limit + prop.pp_offset_orig.z);
2096  anim.upper_limit = (use_default_upper_limit) ? ( 10.f) : (anim_def.upper_limit + prop.pp_offset_orig.z);
2097  }
2098  }
2100  {
2102  }
2104  {
2106  anim.animOpt5 = 1.f;
2107  }
2108 
2109  prop.pp_animations.push_back(anim);
2110  }
2111 
2112  m_actor->m_gfx_actor->m_props.push_back(prop);
2113 }
2114 
2116 {
2117  // Do the common processing
2118  this->ProcessFlare2(def);
2119 
2120  // Now setup the extra inertia feature
2121  flare_t& f = m_actor->ar_flares.back();
2122  f.uses_inertia = true;
2124 }
2125 
2127 {
2128  // This processes both 'flares' and 'flares2' (the parser auto-imports 'flares' as `RigDef::Flare2`)
2129  // -------------------------------------------------------------------------------------------------
2130 
2131  if (m_actor->m_flares_mode == GfxFlaresMode::NONE) { return; }
2132 
2133  int blink_delay = def.blink_delay_milis;
2134  float size = def.size;
2135  const FlareID_t flare_id = static_cast<FlareID_t>(m_actor->ar_flares.size());
2136  const bool is_placeholder = TuneupUtil::isFlareAnyhowRemoved(m_actor->getWorkingTuneupDef(), flare_id);
2137 
2138  /* Backwards compatibility */
2139  if (blink_delay == -2)
2140  {
2142  {
2143  blink_delay = -1; /* Default blink */
2144  }
2145  else
2146  {
2147  blink_delay = 0; /* Default no blink */
2148  }
2149  }
2150 
2151  if (size == -2.f && def.type == FlareType::HEADLIGHT)
2152  {
2153  size = 1.f;
2154  }
2155  else if ((size == -2.f && def.type != FlareType::HEADLIGHT) || size == -1.f)
2156  {
2157  size = 0.5f;
2158  }
2159 
2160  flare_t flare;
2161  flare.fl_type = def.type;
2162  flare.controlnumber = -1;
2163  flare.blinkdelay = (blink_delay == -1) ? 0.5f : blink_delay / 1000.f;
2164  flare.blinkdelay_curr = 0.f;
2165  flare.blinkdelay_state = false;
2167  flare.nodex = GetNodeIndexOrThrow(def.node_axis_x);
2168  flare.nodey = GetNodeIndexOrThrow(def.node_axis_y);
2169  flare.offsetx = def.offset.x;
2170  flare.offsety = def.offset.y;
2171  flare.offsetz = def.offset.z;
2172  flare.size = size;
2173 
2174  if (def.type == FlareType::USER)
2175  {
2176  // control number: convert from 1-10 to 0-9
2177  if (def.control_number == 12) // Special case - legacy parking brake indicator
2178  {
2179  flare.fl_type = FlareType::DASHBOARD;
2181  }
2182  else if (def.control_number < 1)
2183  {
2185  fmt::format("Bad flare control num {}, must be 1-{}, using 1.",
2186  def.control_number, MAX_CLIGHTS));
2187  flare.controlnumber = 0;
2188  }
2189  else if (def.control_number > MAX_CLIGHTS)
2190  {
2192  fmt::format("Bad flare control num {}, must be 1-{}, using {}.",
2194  flare.controlnumber = MAX_CLIGHTS-1;
2195  }
2196  else
2197  {
2198  flare.controlnumber = def.control_number - 1;
2199  }
2200  }
2201 
2202  if (def.type == FlareType::DASHBOARD)
2203  {
2205  if (flare.dashboard_link == -1)
2206  {
2208  fmt::format("Skipping 'd' flare, invalid input link '{}'", def.dashboard_link));
2209  return;
2210  }
2211  }
2212 
2213  /* Visuals */
2214  std::string flare_name = this->ComposeName("Flare", flare_id);
2215  if (!is_placeholder)
2216  {
2217  flare.snode = m_flares_parent_scenenode->createChildSceneNode(this->ComposeName("flareX", flare_id));
2218  flare.bbs = App::GetGfxScene()->GetSceneManager()->createBillboardSet(flare_name, 1);
2219  }
2220 
2221  // Backwards compatibility:
2222  // before 't' (tail light) was introduced in 2022, tail lights were indicated as 'f' (headlight) + custom material.
2223  bool using_default_material = (def.material_name.length() == 0 || def.material_name == "default");
2224  if (flare.fl_type == FlareType::HEADLIGHT && !using_default_material)
2225  {
2227  }
2228 
2229  if (flare.bbs == nullptr)
2230  {
2231  AddMessage(Message::TYPE_WARNING, "Failed to create flare: '" + flare_name + "', continuing without it (compatibility)...");
2232  }
2233  else
2234  {
2235  flare.bbs->createBillboard(0,0,0);
2236  flare.bbs->setVisibilityFlags(DEPTHMAP_DISABLED);
2237  std::string material_name = def.material_name;
2238  if (using_default_material)
2239  {
2240  if (flare.fl_type == FlareType::BRAKE_LIGHT)
2241  {
2242  material_name = "tracks/brakeflare";
2243  }
2244  else if (flare.fl_type == FlareType::BLINKER_LEFT || (flare.fl_type == FlareType::BLINKER_RIGHT))
2245  {
2246  material_name = "tracks/blinkflare";
2247  }
2248  else if (flare.fl_type == FlareType::DASHBOARD)
2249  {
2250  material_name = "tracks/greenflare";
2251  }
2252  else if (flare.fl_type == FlareType::TAIL_LIGHT)
2253  {
2254  material_name = "tracks/redflare";
2255  }
2256  else
2257  {
2258  material_name = "tracks/flare";
2259  }
2260  }
2261 
2262  Ogre::MaterialPtr material = this->FindOrCreateCustomizedMaterial(material_name, this->GetCurrentElementMediaRG());
2263  if (!material.isNull())
2264  {
2265  flare.bbs->setMaterial(material);
2266  flare.snode->attachObject(flare.bbs);
2267  }
2268  }
2269  flare.intensity = 1.f;
2270  flare.light = nullptr;
2271 
2272  if ((App::gfx_flares_mode->getEnum<GfxFlaresMode>() >= GfxFlaresMode::CURR_VEHICLE_HEAD_ONLY) && size > 0.001 && !is_placeholder)
2273  {
2274  if (flare.fl_type == FlareType::HEADLIGHT)
2275  {
2276  flare.light=App::GetGfxScene()->GetSceneManager()->createLight(flare_name);
2277  flare.light->setType(Ogre::Light::LT_SPOTLIGHT);
2278  flare.light->setDiffuseColour( Ogre::ColourValue(1, 1, 1));
2279  flare.light->setSpecularColour( Ogre::ColourValue(1, 1, 1));
2280  flare.light->setAttenuation(200, 0.9, 0, 0);
2281  flare.light->setSpotlightRange( Ogre::Degree(35), Ogre::Degree(45) );
2282  flare.light->setCastShadows(false);
2283  }
2284  else if (flare.fl_type == FlareType::HIGH_BEAM)
2285  {
2286  flare.light = App::GetGfxScene()->GetSceneManager()->createLight(flare_name);
2287  flare.light->setType(Ogre::Light::LT_SPOTLIGHT);
2288  flare.light->setDiffuseColour(Ogre::ColourValue(1, 1, 1));
2289  flare.light->setSpecularColour(Ogre::ColourValue(1, 1, 1));
2290  flare.light->setAttenuation(400, 0.9, 0, 0);
2291  flare.light->setSpotlightRange(Ogre::Degree(35), Ogre::Degree(45));
2292  flare.light->setCastShadows(false);
2293  }
2294  else if (flare.fl_type == FlareType::FOG_LIGHT)
2295  {
2296  flare.light = App::GetGfxScene()->GetSceneManager()->createLight(flare_name);
2297  flare.light->setType(Ogre::Light::LT_SPOTLIGHT);
2298  flare.light->setDiffuseColour(Ogre::ColourValue(1, 1, 1));
2299  flare.light->setSpecularColour(Ogre::ColourValue(1, 1, 1));
2300  flare.light->setAttenuation(400, 0.9, 0, 0);
2301  flare.light->setSpotlightRange(Ogre::Degree(35), Ogre::Degree(45));
2302  flare.light->setCastShadows(false);
2303  }
2304  }
2305  if ((App::gfx_flares_mode->getEnum<GfxFlaresMode>() >= GfxFlaresMode::ALL_VEHICLES_ALL_LIGHTS) && size > 0.001 && !is_placeholder)
2306  {
2307  if (flare.fl_type == FlareType::TAIL_LIGHT)
2308  {
2309  flare.light=App::GetGfxScene()->GetSceneManager()->createLight(flare_name);
2310  flare.light->setDiffuseColour( Ogre::ColourValue(1.0, 0, 0));
2311  flare.light->setSpecularColour( Ogre::ColourValue(1.0, 0, 0));
2312  flare.light->setAttenuation(10.0, 1.0, 0, 0);
2313  }
2314  else if (flare.fl_type == FlareType::REVERSE_LIGHT)
2315  {
2316  flare.light=App::GetGfxScene()->GetSceneManager()->createLight(flare_name);
2317  flare.light->setDiffuseColour(Ogre::ColourValue(1, 1, 1));
2318  flare.light->setSpecularColour(Ogre::ColourValue(1, 1, 1));
2319  flare.light->setAttenuation(20.0, 1, 0, 0);
2320  }
2321  else if (flare.fl_type == FlareType::BRAKE_LIGHT)
2322  {
2323  flare.light=App::GetGfxScene()->GetSceneManager()->createLight(flare_name);
2324  flare.light->setDiffuseColour( Ogre::ColourValue(1.0, 0, 0));
2325  flare.light->setSpecularColour( Ogre::ColourValue(1.0, 0, 0));
2326  flare.light->setAttenuation(10.0, 1.0, 0, 0);
2327  }
2328  else if (flare.fl_type == FlareType::BLINKER_LEFT || (flare.fl_type == FlareType::BLINKER_RIGHT))
2329  {
2330  flare.light=App::GetGfxScene()->GetSceneManager()->createLight(flare_name);
2331  flare.light->setDiffuseColour( Ogre::ColourValue(1, 1, 0));
2332  flare.light->setSpecularColour( Ogre::ColourValue(1, 1, 0));
2333  flare.light->setAttenuation(10.0, 1, 1, 0);
2334  }
2335  else if (flare.fl_type == FlareType::USER)
2336  {
2337  flare.light=App::GetGfxScene()->GetSceneManager()->createLight(flare_name);
2338  flare.light->setDiffuseColour( Ogre::ColourValue(1, 1, 1));
2339  flare.light->setSpecularColour( Ogre::ColourValue(1, 1, 1));
2340  flare.light->setAttenuation(1.0, 1.0, 1, 0.2);
2341  }
2342  else if (flare.fl_type == FlareType::SIDELIGHT)
2343  {
2344  flare.light = App::GetGfxScene()->GetSceneManager()->createLight(flare_name);
2345  flare.light->setDiffuseColour(Ogre::ColourValue(1, 1, 1));
2346  flare.light->setSpecularColour(Ogre::ColourValue(1, 1, 1));
2347  flare.light->setAttenuation(5.0, 1.0, 1, 0.2);
2348  }
2349  }
2350 
2351  /* Finalize light */
2352  if (flare.light != nullptr)
2353  {
2354  flare.light->setType(Ogre::Light::LT_SPOTLIGHT);
2355  flare.light->setSpotlightRange( Ogre::Degree(35), Ogre::Degree(45) );
2356  flare.light->setCastShadows(false);
2357  }
2358  m_actor->ar_flares.push_back(flare);
2359 }
2360 
2361 Ogre::MaterialPtr ActorSpawner::InstantiateManagedMaterial(const Ogre::String& rg_name, Ogre::String const & source_name, Ogre::String const & clone_name)
2362 {
2363  Ogre::MaterialPtr src_mat = Ogre::MaterialManager::getSingleton().getByName(source_name, rg_name);
2364  if (src_mat.isNull())
2365  {
2366  std::stringstream msg;
2367  msg << "Built-in material '" << source_name << "' missing! Skipping...";
2368  AddMessage(Message::TYPE_ERROR, msg.str());
2369  return Ogre::MaterialPtr();
2370  }
2371 
2372  return src_mat->clone(clone_name);
2373 }
2374 
2376 {
2377  // This is how textures map between `RigDef::Document` (*.truck etc...) and `RoR::TuneupDef` (*.tuneup):
2378  // def.diffuse_map ~~ tuneup.media[0]
2379  // def.specular_map ~~ tuneup.media[1]
2380  // def.damaged_diffuse_map ~~ tuneup.media[2]
2381  // ==========================================================================
2382 
2383  if (m_managed_materials.find(def.name) != m_managed_materials.end())
2384  {
2385  this->AddMessage(Message::TYPE_ERROR, "Duplicate managed material name: '" + def.name + "'. Ignoring definition...");
2386  return;
2387  }
2388 
2389  // Check all textures exist
2390  std::string resource_group = this->GetCurrentElementMediaRG();
2391  if (!Ogre::ResourceGroupManager::getSingleton().resourceExists(resource_group, def.diffuse_map))
2392  {
2393  this->AddMessage(Message::TYPE_WARNING, "Skipping managed material, missing texture file: " + def.diffuse_map);
2394  return;
2395  }
2396 
2397  if (def.damaged_diffuse_map != "" &&
2398  !Ogre::ResourceGroupManager::getSingleton().resourceExists(resource_group, def.damaged_diffuse_map))
2399  {
2400  this->AddMessage(Message::TYPE_WARNING, "Damage texture not found: " + def.damaged_diffuse_map);
2401  def.damaged_diffuse_map = "";
2402  }
2403 
2404  if (def.specular_map != "" &&
2405  !Ogre::ResourceGroupManager::getSingleton().resourceExists(resource_group, def.specular_map))
2406  {
2407  this->AddMessage(Message::TYPE_WARNING, "Specular texture not found: " + def.specular_map);
2408  def.specular_map = "";
2409  }
2410 
2411  // Create fallback placeholders
2412  // This is necessary to load meshes with original material names (= unchanged managed mat names)
2413  // - if not found, OGRE substitutes them with 'BaseWhite' which breaks subsequent processing.
2414  // Note this must be done for all addonparts, too, as any of them can use managed materials defined in the truck file.
2415  for (auto& module: m_selected_modules)
2416  {
2417  std::string module_rg = (module->origin_addonpart) ? module->origin_addonpart->resource_group : m_actor->getTruckFileResourceGroup();
2418  if (Ogre::MaterialManager::getSingleton().getByName(def.name, module_rg).isNull())
2419  {
2420  LOG(fmt::format("[RoR] DBG ActorSpawner::ProcessManagedMaterial(): Creating placeholder for material '{}' in group '{}'", def.name, module_rg));
2421  m_managedmat_placeholder_template->clone(def.name, /*changeGroup=*/true, module_rg);
2422  }
2423  else
2424  {
2425  LOG(fmt::format("[RoR] DBG ActorSpawner::ProcessManagedMaterial(): Placeholder already exists: '{}' in group '{}'", def.name, module_rg));
2426  }
2427  }
2428 
2429  std::string custom_name = this->ComposeName(def.name);
2430  Ogre::MaterialPtr material;
2432  {
2433  // Create a placeholder material
2434  material = Ogre::MaterialManager::getSingleton().getByName("tracks/transred")->clone(custom_name, /*changeGroup:*/true, resource_group);
2435  }
2437  {
2438  std::string mat_name_base
2440  ? "managed/flexmesh_standard"
2441  : "managed/flexmesh_transparent";
2442 
2443  if (def.damaged_diffuse_map != "")
2444  {
2445  if (def.specular_map != "")
2446  {
2447  /* FLEXMESH, damage, specular */
2448  if (App::gfx_alt_actor_materials->getBool())
2449  {
2450  material = this->InstantiateManagedMaterial(resource_group, mat_name_base + "/speculardamage", custom_name);
2451  }
2452  else
2453  {
2454  material = this->InstantiateManagedMaterial(resource_group, mat_name_base + "/speculardamage_nicemetal", custom_name);
2455  }
2456 
2457  if (material.isNull())
2458  {
2459  return;
2460  }
2461 
2462  if (App::gfx_alt_actor_materials->getBool())
2463  {
2464  this->AssignManagedMaterialTexture(material->getTechnique("BaseTechnique")->getPass("BaseRender")->getTextureUnitState("Diffuse_Map"), def.name, 0, def.diffuse_map);
2465  this->AssignManagedMaterialTexture(material->getTechnique("BaseTechnique")->getPass("BaseRender")->getTextureUnitState("Dmg_Diffuse_Map"), def.name, 2, def.damaged_diffuse_map);
2466  this->AssignManagedMaterialTexture(material->getTechnique("BaseTechnique")->getPass("SpecularMapping1")->getTextureUnitState("SpecularMapping1_Tex"), def.name, 1, def.specular_map);
2467  }
2468  else
2469  {
2470  this->AssignManagedMaterialTexture(material->getTechnique("BaseTechnique")->getPass("BaseRender")->getTextureUnitState("Diffuse_Map"), def.name, 0, def.diffuse_map);
2471  this->AssignManagedMaterialTexture(material->getTechnique("BaseTechnique")->getPass("BaseRender")->getTextureUnitState("Dmg_Diffuse_Map"), def.name, 2, def.damaged_diffuse_map);
2472  this->AssignManagedMaterialTexture(material->getTechnique("BaseTechnique")->getPass("BaseRender")->getTextureUnitState("Specular_Map"), def.name, 1, def.specular_map);
2473  this->AssignManagedMaterialTexture(material->getTechnique("BaseTechnique")->getPass("Specular")->getTextureUnitState("Specular_Map"), def.name, 1, def.specular_map);
2474  }
2475  }
2476  else
2477  {
2478  /* FLEXMESH, damage, no_specular */
2479  material = this->InstantiateManagedMaterial(resource_group, mat_name_base + "/damageonly", custom_name);
2480  if (material.isNull())
2481  {
2482  return;
2483  }
2484  this->AssignManagedMaterialTexture(material->getTechnique("BaseTechnique")->getPass("BaseRender")->getTextureUnitState("Diffuse_Map"), def.name, 0, def.diffuse_map);
2485  this->AssignManagedMaterialTexture(material->getTechnique("BaseTechnique")->getPass("BaseRender")->getTextureUnitState("Dmg_Diffuse_Map"), def.name, 2, def.damaged_diffuse_map);
2486  }
2487  }
2488  else
2489  {
2490  if (def.specular_map != "")
2491  {
2492  /* FLEXMESH, no_damage, specular */
2493  if (App::gfx_alt_actor_materials->getBool())
2494  {
2495  material = this->InstantiateManagedMaterial(resource_group, mat_name_base + "/specularonly", custom_name);
2496  }
2497  else
2498  {
2499  material = this->InstantiateManagedMaterial(resource_group, mat_name_base + "/specularonly_nicemetal", custom_name);
2500  }
2501 
2502  if (material.isNull())
2503  {
2504  return;
2505  }
2506 
2507  if (App::gfx_alt_actor_materials->getBool())
2508  {
2509  this->AssignManagedMaterialTexture(material->getTechnique("BaseTechnique")->getPass("BaseRender")->getTextureUnitState("Diffuse_Map"), def.name, 0, def.diffuse_map);
2510  this->AssignManagedMaterialTexture(material->getTechnique("BaseTechnique")->getPass("SpecularMapping1")->getTextureUnitState("SpecularMapping1_Tex"), def.name, 1, def.specular_map);
2511  }
2512  else
2513  {
2514  this->AssignManagedMaterialTexture(material->getTechnique("BaseTechnique")->getPass("BaseRender")->getTextureUnitState("Diffuse_Map") , def.name, 0, def.diffuse_map);
2515  this->AssignManagedMaterialTexture(material->getTechnique("BaseTechnique")->getPass("BaseRender")->getTextureUnitState("Specular_Map"), def.name, 1, def.specular_map);
2516  this->AssignManagedMaterialTexture(material->getTechnique("BaseTechnique")->getPass("Specular")->getTextureUnitState("Specular_Map") , def.name, 1, def.specular_map);
2517  }
2518  }
2519  else
2520  {
2521  /* FLEXMESH, no_damage, no_specular */
2522  material = this->InstantiateManagedMaterial(resource_group, mat_name_base + "/simple", custom_name);
2523  if (material.isNull())
2524  {
2525  return;
2526  }
2527  this->AssignManagedMaterialTexture(material->getTechnique("BaseTechnique")->getPass("BaseRender")->getTextureUnitState("Diffuse_Map"), def.name, 0, def.diffuse_map);
2528  }
2529  }
2530  }
2532  {
2533  Ogre::String mat_name_base
2535  ? "managed/mesh_standard"
2536  : "managed/mesh_transparent";
2537 
2538  if (def.specular_map != "")
2539  {
2540  /* MESH, specular */
2541  if (App::gfx_alt_actor_materials->getBool())
2542  {
2543  material = this->InstantiateManagedMaterial(resource_group, mat_name_base + "/specular", custom_name);
2544  }
2545  else
2546  {
2547  material = this->InstantiateManagedMaterial(resource_group, mat_name_base + "/specular_nicemetal", custom_name);
2548  }
2549 
2550  if (material.isNull())
2551  {
2552  return;
2553  }
2554 
2555  if (App::gfx_alt_actor_materials->getBool())
2556  {
2557  this->AssignManagedMaterialTexture(material->getTechnique("BaseTechnique")->getPass("BaseRender")->getTextureUnitState("Diffuse_Map"), def.name, 0, def.diffuse_map);
2558  this->AssignManagedMaterialTexture(material->getTechnique("BaseTechnique")->getPass("SpecularMapping1")->getTextureUnitState("SpecularMapping1_Tex"), def.name, 1, def.specular_map);
2559  }
2560  else
2561  {
2562  this->AssignManagedMaterialTexture(material->getTechnique("BaseTechnique")->getPass("BaseRender")->getTextureUnitState("Diffuse_Map") ,def.name, 0, def.diffuse_map);
2563  this->AssignManagedMaterialTexture(material->getTechnique("BaseTechnique")->getPass("BaseRender")->getTextureUnitState("Specular_Map"),def.name, 1, def.specular_map);
2564  this->AssignManagedMaterialTexture(material->getTechnique("BaseTechnique")->getPass("Specular")->getTextureUnitState("Specular_Map") ,def.name, 1, def.specular_map);
2565  }
2566  }
2567  else
2568  {
2569  /* MESH, no_specular */
2570  material = this->InstantiateManagedMaterial(resource_group, mat_name_base + "/simple", custom_name);
2571  if (material.isNull())
2572  {
2573  return;
2574  }
2575  this->AssignManagedMaterialTexture(material->getTechnique("BaseTechnique")->getPass("BaseRender")->getTextureUnitState("Diffuse_Map"), def.name, 0, def.diffuse_map);
2576 
2577  }
2578  }
2579 
2582  {
2583  if (def.options.double_sided)
2584  {
2585  material->getTechnique("BaseTechnique")->getPass("BaseRender")->setCullingMode(Ogre::CULL_NONE);
2586  if (def.specular_map != "")
2587  {
2588  if (App::gfx_alt_actor_materials->getBool())
2589  {
2590  material->getTechnique("BaseTechnique")->getPass("SpecularMapping1")->setCullingMode(Ogre::CULL_NONE);
2591  }
2592  else
2593  {
2594  material->getTechnique("BaseTechnique")->getPass("Specular")->setCullingMode(Ogre::CULL_NONE);
2595  }
2596  }
2597  }
2598  }
2599 
2600  material->compile();
2601  m_managed_materials.insert(std::make_pair(def.name, material));
2602 }
2603 
2605 {
2606  int8_t bbox_id = static_cast<int8_t>(m_actor->ar_collision_bounding_boxes.size());
2607  for (RigDef::Node::Ref& node_ref: def.nodes)
2608  {
2609  NodeNum_t node = this->ResolveNodeRef(node_ref);
2610  if (node == NODENUM_INVALID)
2611  {
2612  RoR::LogFormat("[RoR|Spawner] Collision box: skipping invalid node '%s'", node_ref.ToString().c_str());
2613  continue;
2614  }
2616  {
2617  RoR::LogFormat("[RoR|Spawner] Collision box: re-assigning node '%s' from box ID '%d' to '%d'",
2618  node_ref.ToString().c_str(),
2620  bbox_id);
2621  }
2622  m_actor->ar_nodes[node].nd_coll_bbox_id = bbox_id;
2623  }
2624 
2625  m_actor->ar_collision_bounding_boxes.push_back(Ogre::AxisAlignedBox()); // Updated later
2626  m_actor->ar_predicted_coll_bounding_boxes.push_back(Ogre::AxisAlignedBox());
2627 }
2628 
2630 {
2631  if (def.node_collision_range >= 0.f)
2633  else
2635 }
2636 
2637 bool ActorSpawner::AssignWheelToAxle(int & _out_axle_wheel, node_t *axis_node_1, node_t *axis_node_2)
2638 {
2639  for (int i = 0; i < m_actor->ar_num_wheels; i++)
2640  {
2641  wheel_t & wheel = m_actor->ar_wheels[i];
2642  if ( (wheel.wh_axis_node_0 == axis_node_1 && wheel.wh_axis_node_1 == axis_node_2)
2643  || (wheel.wh_axis_node_0 == axis_node_2 && wheel.wh_axis_node_1 == axis_node_1)
2644  )
2645  {
2646  _out_axle_wheel = i;
2647  return true;
2648  }
2649  }
2650  return false;
2651 }
2652 
2654 {
2655  if (! CheckAxleLimit(1))
2656  {
2657  return;
2658  }
2659 
2660  node_t *wheel_1_node_1 = GetNodePointerOrThrow(def.wheels[0][0]);
2661  node_t *wheel_1_node_2 = GetNodePointerOrThrow(def.wheels[0][1]);
2662  node_t *wheel_2_node_1 = GetNodePointerOrThrow(def.wheels[1][0]);
2663  node_t *wheel_2_node_2 = GetNodePointerOrThrow(def.wheels[1][1]);
2664 
2665  Differential *diff = new Differential();
2666 
2667  if (! AssignWheelToAxle(diff->di_idx_1, wheel_1_node_1, wheel_1_node_2))
2668  {
2669  std::stringstream msg;
2670  msg << "Couldn't find wheel with axis nodes '" << def.wheels[0][0].ToString()
2671  << "' and '" << def.wheels[0][1].ToString() << "'";
2672  AddMessage(Message::TYPE_WARNING, msg.str());
2673  }
2674 
2675  if (! AssignWheelToAxle(diff->di_idx_2, wheel_2_node_1, wheel_2_node_2))
2676  {
2677  std::stringstream msg;
2678  msg << "Couldn't find wheel with axis nodes '" << def.wheels[1][0].ToString()
2679  << "' and '" << def.wheels[1][1].ToString() << "'";
2680  AddMessage(Message::TYPE_WARNING, msg.str());
2681  }
2682 
2683  if (def.options.size() == 0)
2684  {
2685  AddMessage(Message::TYPE_INFO, "No differential defined, defaulting to Open & Locked");
2688  }
2689  else
2690  {
2691  auto end = def.options.end();
2692  for (auto itor = def.options.begin(); itor != end; ++itor)
2693  {
2694  switch (*itor)
2695  {
2698  break;
2701  break;
2704  break;
2707  break;
2708  default:
2709  AddMessage(Message::TYPE_WARNING, fmt::format("Unknown differential type: '{}'", (char)*itor));
2710  break;
2711  }
2712  }
2713  }
2714 
2717 }
2718 
2720 {
2721  if (def.a1 == def.a2 || std::min(def.a1, def.a2) < 0 || std::max(def.a1 , def.a2) >= m_actor->m_num_wheel_diffs)
2722  {
2723  AddMessage(Message::TYPE_ERROR, "Invalid 'interaxle' axle ids, skipping...");
2724  return;
2725  }
2726 
2727  if (m_actor->m_transfer_case)
2728  {
2729  if ((m_actor->m_transfer_case->tr_ax_1 == def.a1 && m_actor->m_transfer_case->tr_ax_2 == def.a2) ||
2731  {
2732  AddMessage(Message::TYPE_ERROR, "You cannot have both an inter-axle differential and a transfercase between the same two axles, skipping...");
2733  return;
2734  }
2735  }
2736 
2737  Differential *diff = new Differential();
2738 
2739  diff->di_idx_1 = def.a1;
2740  diff->di_idx_2 = def.a2;
2741 
2742  if (def.options.size() == 0)
2743  {
2744  AddMessage(Message::TYPE_INFO, "No differential defined, defaulting to Locked");
2746  }
2747  else
2748  {
2749  for (RigDef::DifferentialType val: def.options)
2750  {
2751  switch (val)
2752  {
2755  break;
2758  break;
2761  break;
2764  break;
2765  default:
2766  AddMessage(Message::TYPE_WARNING, fmt::format("Unknown differential type: '{}'", (char)val));
2767  break;
2768  }
2769  }
2770  }
2771 
2774 }
2775 
2777 {
2778  if (def.a1 == def.a2 || def.a1 < 0 || std::max(def.a1 , def.a2) >= m_actor->m_num_wheel_diffs)
2779  {
2780  AddMessage(Message::TYPE_ERROR, "Invalid 'transfercase' axle ids, skipping...");
2781  return;
2782  }
2783  if (def.a2 < 0) // No 4WD mode
2784  {
2785  if (!def.has_2wd) // No 2WD mode
2786  {
2787  AddMessage(Message::TYPE_ERROR, "Invalid 'transfercase': Define alternate axle or allow 2WD, skipping...");
2788  return;
2789  }
2790  else // Only 2WD
2791  {
2792  AddMessage(Message::TYPE_INFO, "No alternate axle defined, defaulting to 2WD only");
2793  }
2794  }
2795 
2796  m_actor->m_transfer_case = new TransferCase(def.a1, def.a2, def.has_2wd, def.has_2wd_lo, def.gear_ratios);
2797 
2798  for (int i = 0; i < m_actor->ar_num_wheels; i++)
2799  {
2800  m_actor->ar_wheels[i].wh_propulsed = false;
2801  }
2805  if (!def.has_2wd)
2806  {
2811  }
2812 }
2813 
2815 {
2818  {
2819  std::stringstream msg;
2820  msg << "Invalid parameter 'lower_limit' (" << m_actor->cc_target_speed_lower_limit
2821  << ") must be positive nonzero number. Using it anyway (compatibility)";
2822  }
2823  m_actor->cc_can_brake = def.autobrake != 0;
2824 }
2825 
2827 {
2828  m_actor->sl_enabled = true;
2830 }
2831 
2833 {
2834  if (m_actor->ar_engine == nullptr)
2835  {
2836  AddMessage(Message::TYPE_WARNING, "Section 'torquecurve' found but no 'engine' defined, skipping...");
2837  return;
2838  }
2839 
2840  TorqueCurve *target_torque_curve = m_actor->ar_engine->getTorqueCurve();
2841 
2842  if (def.predefined_func_name.length() != 0)
2843  {
2844  target_torque_curve->setTorqueModel(def.predefined_func_name);
2845  }
2846  else
2847  {
2848  target_torque_curve->CreateNewCurve(); /* Use default name for custom curve */
2849  std::vector<RigDef::TorqueCurve::Sample>::iterator itor = def.samples.begin();
2850  for ( ; itor != def.samples.end(); itor++)
2851  {
2852  target_torque_curve->AddCurveSample(itor->power, itor->torque_percent);
2853  }
2854  }
2855 }
2856 
2858 {
2859  if (App::gfx_particles_mode->getInt() != 1)
2860  {
2861  return;
2862  }
2863 
2864  int particle_index = m_actor->ar_num_custom_particles;
2865  cparticle_t & particle = m_actor->ar_custom_particles[particle_index];
2866 
2869 
2870  std::string name = this->ComposeName(def.particle_system_name.c_str(), particle_index);
2871  particle.psys = this->CreateParticleSystem(name, def.particle_system_name);
2872  if (particle.psys == nullptr)
2873  {
2874  std::stringstream msg;
2875  msg << "Failed to create particle system '" << name << "' (template: '" << def.particle_system_name <<"')";
2876  AddMessage(Message::TYPE_ERROR, msg.str());
2877  return;
2878  }
2879 
2880  particle.snode = m_particles_parent_scenenode->createChildSceneNode(this->ComposeName("cparticles", m_actor->ar_num_custom_particles));
2881  particle.snode->attachObject(particle.psys);
2882  particle.snode->setPosition(m_actor->ar_nodes[particle.emitterNode].AbsPosition);
2883 
2884  /* Shut down the emitters */
2885  particle.active = false;
2886  for (unsigned int i = 0; i < particle.psys->getNumEmitters(); i++)
2887  {
2888  particle.psys->getEmitter(i)->setEnabled(false);
2889  }
2890 
2892 }
2893 
2895 {
2896  ropable_t ropable;
2897  ropable.node = GetNodePointerOrThrow(def.node);
2898  ropable.pos = static_cast<int>(m_actor->ar_ropables.size());
2899  ropable.group = def.group;
2900  ropable.attached_ties = 0;
2901  ropable.attached_ropes = 0;
2902  ropable.multilock = def.has_multilock;
2903  m_actor->ar_ropables.push_back(ropable);
2904 }
2905 
2907 {
2909  node_t & node_2 = m_actor->ar_nodes[( (node_1.pos == 0) ? 1 : 0 )];
2910 
2911  int beam_index = m_actor->ar_num_beams;
2912  beam_t & beam = AddBeam(node_1, node_2, def.beam_defaults, def.detacher_group);
2913  SetBeamStrength(beam, def.beam_defaults->GetScaledBreakingThreshold());
2914  beam.k = def.beam_defaults->GetScaledSpringiness();
2915  beam.d = def.beam_defaults->GetScaledDamping();
2916  beam.bm_type = BEAM_HYDRO;
2917  beam.L = def.max_reach_length;
2918  beam.refL = def.max_reach_length;
2919  beam.bounded = ROPE;
2920  beam.bm_disabled = true;
2921 
2923  {
2924  this->CreateBeamVisuals(beam, beam_index, false, def.beam_defaults);
2925  }
2926 
2927  /* Register tie */
2928  tie_t tie;
2929  tie.ti_group = def.group;
2930  tie.ti_tying = false;
2931  tie.ti_tied = false;
2932  tie.ti_beam = & beam;
2933  tie.ti_locked_actor = nullptr;
2934  tie.ti_locked_ropable = nullptr;
2936  tie.ti_max_stress = def.max_stress;
2937  tie.ti_min_length = def.min_length;
2939  m_actor->ar_ties.push_back(tie);
2940 
2941  m_actor->m_has_command_beams = true;
2942 }
2943 
2945 {
2946  node_t & root_node = m_actor->ar_nodes[GetNodeIndexOrThrow(def.root_node)];
2947  node_t & end_node = m_actor->ar_nodes[GetNodeIndexOrThrow(def.end_node)];
2948 
2949  /* Add beam */
2950  int beam_index = m_actor->ar_num_beams;
2951  beam_t & beam = AddBeam(root_node, end_node, def.beam_defaults, def.detacher_group);
2952  SetBeamStrength(beam, def.beam_defaults->GetScaledBreakingThreshold());
2953  beam.k = def.beam_defaults->GetScaledSpringiness();
2954  beam.d = def.beam_defaults->GetScaledDamping();
2955  beam.bounded = ROPE;
2956  beam.bm_type = BEAM_HYDRO;
2957  beam.L = root_node.AbsPosition.distance(end_node.AbsPosition);
2958  beam.refL = beam.L;
2959 
2960  this->CreateBeamVisuals(beam, beam_index, true, def.beam_defaults, "tracks/beam");
2961 
2962  /* Register rope */
2963  rope_t rope;
2964  rope.rp_beam = & beam;
2965  rope.rp_locked = UNLOCKED;
2966  rope.rp_locked_ropable = nullptr;
2967  rope.rp_group = 0; // Orig: hardcoded in BTS_ROPES. TODO: To be used.
2968  m_actor->ar_ropes.push_back(rope);
2969 }
2970 
2972 {
2973  RailGroup* rail_group = this->CreateRail(def.node_list);
2974  rail_group->rg_id = def.id;
2975  m_actor->m_railgroups.push_back(rail_group);
2976 }
2977 
2979 {
2981  SlideNode slide_node(& node, nullptr);
2982 
2983  // Optional args
2984  if (def._spring_rate_set) { slide_node.SetSpringRate(def.spring_rate); }
2985  if (def._break_force_set) { slide_node.SetBreakForce(def.break_force); }
2986  if (def._tolerance_set) { slide_node.SetCorThreshold(def.tolerance); }
2987  if (def._attachment_rate_set) { slide_node.SetAttachmentRate(def.attachment_rate); }
2988  if (def._max_attach_dist_set) { slide_node.SetAttachmentDistance(def.max_attach_dist); }
2989 
2990  // Constraints
2992  {
2993  slide_node.sn_attach_self = true;
2994  slide_node.sn_attach_foreign = true;
2995  }
2997  {
2998  slide_node.sn_attach_self = true;
2999  slide_node.sn_attach_foreign = false;
3000  }
3002  {
3003  slide_node.sn_attach_self = false;
3004  slide_node.sn_attach_foreign = true;
3005  }
3007  {
3008  slide_node.sn_attach_self = false;
3009  slide_node.sn_attach_foreign = false;
3010  }
3011 
3012  // RailGroup
3013  RailGroup *rail_group = nullptr;
3014  if (def._railgroup_id_set)
3015  {
3016  std::vector<RailGroup*>::iterator itor = m_actor->m_railgroups.begin();
3017  for ( ; itor != m_actor->m_railgroups.end(); itor++)
3018  {
3019  if ((*itor)->rg_id == def.railgroup_id)
3020  {
3021  rail_group = *itor;
3022  break;
3023  }
3024  }
3025 
3026  if (rail_group == nullptr)
3027  {
3028  std::stringstream msg;
3029  msg << "Specified rail group id '" << def.railgroup_id << "' not found. Ignoring slidenode...";
3030  AddMessage(Message::TYPE_ERROR, msg.str());
3031  return;
3032  }
3033  }
3034  else if (def.rail_node_ranges.size() > 0)
3035  {
3036  rail_group = this->CreateRail(def.rail_node_ranges);
3037  if (rail_group != nullptr)
3038  {
3039  m_actor->m_railgroups.push_back(rail_group);
3040  }
3041  }
3042  else
3043  {
3044  AddMessage(Message::TYPE_ERROR, "No RailGroup available for SlideNode, skipping...");
3045  }
3046 
3047  slide_node.SetDefaultRail(rail_group);
3048  m_actor->m_slidenodes.push_back(slide_node);
3049 }
3050 
3051 NodeNum_t ActorSpawner::FindNodeIndex(RigDef::Node::Ref & node_ref, bool silent /* = false */)
3052 {
3053  NodeNum_t node = ResolveNodeRef(node_ref);
3054  if (node == NODENUM_INVALID && !silent)
3055  {
3056  std::stringstream msg;
3057  msg << "Failed to find node by reference: " << node_ref.ToString();
3058  AddMessage(Message::TYPE_ERROR, msg.str());
3059  }
3060  return node;
3061 }
3062 
3064  std::vector<RigDef::Node::Range> & node_ranges,
3065  std::vector<NodeNum_t> & out_node_indices
3066  )
3067 {
3068  std::vector<RigDef::Node::Range>::iterator itor = node_ranges.begin();
3069  for ( ; itor != node_ranges.end(); itor++)
3070  {
3071  if (itor->IsRange())
3072  {
3073 
3074  NodeNum_t start = FindNodeIndex(itor->start, /* silent= */ false);
3075  if (start == NODENUM_INVALID)
3076  {
3077  AddMessage(Message::TYPE_WARNING, fmt::format("Invalid start node in range: {}", itor->start.ToString()));
3078  return false;
3079  }
3080 
3081  NodeNum_t end = FindNodeIndex(itor->end, /* silent= */ true);
3082 
3083  if (end == NODENUM_INVALID)
3084  {
3085  std::stringstream msg;
3086  msg << "Encountered non-existent node '" << itor->end.ToString() << "' in range [" << itor->start.ToString() << " - " << itor->end.ToString() << "], "
3087  << "highest node index is '" << m_actor->ar_num_nodes - 1 << "'.";
3088 
3089  if (itor->end.Str().empty()) /* If the node is numeric... */
3090  {
3091  msg << " However, this node must be accepted anyway for backwards compatibility."
3092  << " Please fix this as soon as possible.";
3093  end = itor->end.Num();
3094  AddMessage(Message::TYPE_ERROR, msg.str());
3095  }
3096  else
3097  {
3098  AddMessage(Message::TYPE_ERROR, msg.str());
3099  return false;
3100  }
3101  }
3102 
3103  if (end < start)
3104  {
3105  NodeNum_t swap = start;
3106  start = end;
3107  end = swap;
3108  }
3109 
3110  for (NodeNum_t i = start; i <= end; i++)
3111  {
3112  out_node_indices.push_back(i);
3113  }
3114  }
3115  else
3116  {
3117  out_node_indices.push_back(GetNodeIndexOrThrow(itor->start));
3118  }
3119  }
3120  return true;
3121 }
3122 
3123 RailGroup *ActorSpawner::CreateRail(std::vector<RigDef::Node::Range> & node_ranges)
3124 {
3125  // Collect nodes
3126  std::vector<NodeNum_t> node_indices;
3127  this->CollectNodesFromRanges(node_ranges, node_indices);
3128 
3129  // Build the rail
3130  RailGroup* rg = new RailGroup();
3131  for (unsigned int i = 0; i < node_indices.size() - 1; i++)
3132  {
3133  beam_t *beam = FindBeamInRig(node_indices[i], node_indices[i + 1]);
3134  if (beam == nullptr)
3135  {
3136  std::stringstream msg;
3137  msg << "No beam between nodes indexed '" << node_indices[i] << "' and '" << node_indices[i + 1] << "'";
3138  AddMessage(Message::TYPE_ERROR, msg.str());
3139  delete rg;
3140  return nullptr;
3141  }
3142  rg->rg_segments.emplace_back(beam);
3143  }
3144 
3145  // Link middle segments
3146  const size_t num_seg = rg->rg_segments.size();
3147  for (size_t i = 1; i < (num_seg - 1); ++i)
3148  {
3149  rg->rg_segments[i].rs_prev = &rg->rg_segments[i - 1];
3150  rg->rg_segments[i].rs_next = &rg->rg_segments[i + 1];
3151  }
3152 
3153  // Link end segments
3154  const bool is_loop = (node_indices.front() == node_indices.back());
3155  if (rg->rg_segments.size() > 1)
3156  {
3157  rg->rg_segments[0].rs_next = &rg->rg_segments[1];
3158  rg->rg_segments[num_seg - 1].rs_prev = &rg->rg_segments[num_seg - 2];
3159  if (is_loop)
3160  {
3161  rg->rg_segments[0].rs_prev = &rg->rg_segments[num_seg - 1];
3162  rg->rg_segments[num_seg - 1].rs_next = &rg->rg_segments[0];
3163  }
3164  }
3165 
3166  return rg; // Transfers memory ownership
3167 }
3168 
3170 {
3171  node_t *node_a = & m_actor->ar_nodes[node_a_index];
3172  node_t *node_b = & m_actor->ar_nodes[node_b_index];
3173 
3174  for (unsigned int i = 0; i < static_cast<unsigned int>(m_actor->ar_num_beams); i++)
3175  {
3176  if (
3177  (GetBeam(i).p1 == node_a && GetBeam(i).p2 == node_b)
3178  || (GetBeam(i).p2 == node_a && GetBeam(i).p1 == node_b)
3179  )
3180  {
3181  return & GetBeam(i);
3182  }
3183  }
3184  return nullptr;
3185 }
3186 
3188 {
3189  /* Find the node */
3190  node_t *node = GetNodePointer(def.node);
3191  if (node == nullptr)
3192  {
3193  return;
3194  }
3195 
3196  /* Find the hook */
3197  hook_t *hook = nullptr;
3198  std::vector <hook_t>::iterator itor = m_actor->ar_hooks.begin();
3199  for (; itor != m_actor->ar_hooks.end(); itor++)
3200  {
3201  if (itor->hk_hook_node == node)
3202  {
3203  hook = &*itor;
3204  break;
3205  }
3206  }
3207 
3208  if (hook == nullptr)
3209  {
3210  std::stringstream msg;
3211  msg << "Node '" << def.node.ToString() << "' is not a hook-node (not marked with flag 'h'), ignoring...";
3212  AddMessage(Message::TYPE_ERROR, msg.str());
3213  return;
3214  }
3215 
3216  /* Process options */
3217  hook->hk_lockrange = def.option_hook_range;
3219  hook->hk_maxforce = def.option_max_force;
3220  hook->hk_group = def.option_hookgroup;
3221  hook->hk_lockgroup = def.option_lockgroup;
3222  hook->hk_timer = 0.f; // Hardcoded in BTS_HOOKS
3223  hook->hk_timer_preset = def.option_timer;
3225  hook->hk_selflock = def.flag_self_lock;
3226  hook->hk_nodisable = def.flag_no_disable;
3227  if (def.flag_auto_lock)
3228  {
3229  hook->hk_autolock = true;
3230  if (hook->hk_group == -1)
3231  {
3232  hook->hk_group = -2; /* only overwrite hgroup when its still default (-1) */
3233  }
3234  }
3235  if (def.flag_no_rope)
3236  {
3237  hook->hk_beam->bounded = NOSHOCK;
3238  }
3239  if (!def.flag_visible) // NOTE: This flag can only hide a visible beam - it won't show a beam defined with 'invisible' flag.
3240  {
3241  // Find beam index
3242  int beam_index = -1;
3243  for (int i = 0; i < m_actor->ar_num_beams; ++i)
3244  {
3245  if (hook->hk_beam == &m_actor->ar_beams[i])
3246  {
3247  beam_index = i;
3248  break;
3249  }
3250  }
3251 
3252  // Erase beam visuals (only exist if defined without 'invisible' flag - we don't know at this point)
3253  m_actor->m_gfx_actor->RemoveBeam(beam_index);
3254  }
3255 }
3256 
3258 {
3259  auto itor = lockgroup.nodes.begin();
3260  auto end = lockgroup.nodes.end();
3261  for (; itor != end; ++itor)
3262  {
3263  NodeNum_t node = this->GetNodeIndexOrThrow(*itor);
3264  m_actor->ar_nodes[node].nd_lockgroup = lockgroup.number;
3265  }
3266 }
3267 
3269 {
3270  float sbound = def.contraction_trigger_limit; // shortbound
3271  float lbound = def.expansion_trigger_limit; // longbound
3272 
3273  // options
3274  bool invisible = false;
3276  bool shock_trigger_enabled = true;
3277  bool triggerblocker = false;
3278  bool triggerblocker_inverted = false;
3279  bool cmdkeyblock = false;
3280  bool hooktoggle = false;
3281  bool enginetrigger = false;
3282 
3283  bool trigger_cmdkeyblock_state_short = false;
3284  bool trigger_cmdkeyblock_state_long = true;
3285  if (def.longbound_trigger_action != -1) trigger_cmdkeyblock_state_long = false;
3286 
3287  // now 'parse' the options
3289  {
3290  invisible = true;
3291  }
3292  if (BITMASK_IS_1(def.options, RigDef::Trigger::OPTION_x_START_DISABLED)) // this trigger is disabled on startup, default is enabled
3293  {
3294  shock_trigger_enabled = false;
3295  }
3296  if (BITMASK_IS_1(def.options, RigDef::Trigger::OPTION_B_TRIGGER_BLOCKER)) // Blocker that enable/disable other triggers
3297  {
3298  shockflag |= SHOCK_FLAG_TRG_BLOCKER;
3299  triggerblocker = true;
3300  }
3301  if (BITMASK_IS_1(def.options, RigDef::Trigger::OPTION_b_KEY_BLOCKER)) // Set the CommandKeys that are set in a commandkeyblocker or trigger to blocked on startup, default is released
3302  {
3303  cmdkeyblock = true;
3304  }
3305  if (BITMASK_IS_1(def.options, RigDef::Trigger::OPTION_s_CMD_NUM_SWITCH)) // switch that exchanges cmdshort/cmdshort for all triggers with the same commandnumbers, default false
3306  {
3307  shockflag |= SHOCK_FLAG_TRG_CMD_SWITCH;
3308  }
3309  if (BITMASK_IS_1(def.options, RigDef::Trigger::OPTION_c_COMMAND_STYLE)) // trigger is set with commandstyle boundaries instead of shocksytle
3310  {
3311  sbound = abs(sbound-1);
3312  lbound = lbound-1;
3313  }
3314  if (BITMASK_IS_1(def.options, RigDef::Trigger::OPTION_A_INV_TRIGGER_BLOCKER)) // Blocker that enable/disable other triggers, reversed activation method (inverted Blocker style, auto-ON)
3315  {
3316  shockflag |= SHOCK_FLAG_TRG_BLOCKER_A;
3317  triggerblocker_inverted = true;
3318  }
3320  {
3321  shockflag |= SHOCK_FLAG_TRG_HOOK_UNLOCK;
3322  hooktoggle = true;
3323  }
3325  {
3326  shockflag |= SHOCK_FLAG_TRG_HOOK_LOCK;
3327  hooktoggle = true;
3328  }
3329  if (BITMASK_IS_1(def.options, RigDef::Trigger::OPTION_t_CONTINUOUS)) // this trigger sends values between 0 and 1
3330  {
3331  shockflag |= SHOCK_FLAG_TRG_CONTINUOUS;
3332  }
3333  if (BITMASK_IS_1(def.options, RigDef::Trigger::OPTION_E_ENGINE_TRIGGER)) // this trigger is used to control an engine
3334  {
3335  shockflag |= SHOCK_FLAG_TRG_ENGINE;
3336  enginetrigger = true;
3337  }
3338 
3339  if (!triggerblocker && !triggerblocker_inverted && !hooktoggle && !enginetrigger)
3340  {
3341  // make the full check
3343  {
3344  AddMessage(Message::TYPE_ERROR, fmt::format("Wrong 'shortbound_trigger_action': '{}' - must be between 1 and {}. Trigger deactivated.", def.shortbound_trigger_action, MAX_COMMANDS));
3345  return;
3346  }
3347  }
3348  else if (!hooktoggle && !enginetrigger)
3349  {
3350  // this is a Trigger-Blocker, make special check
3351  if (def.shortbound_trigger_action < 0 || def.longbound_trigger_action < 0)
3352  {
3353  AddMessage(Message::TYPE_ERROR, "Wrong command-eventnumber (Triggers). Trigger-Blocker deactivated.");
3354  return;
3355  }
3356  }
3357  else if (enginetrigger)
3358  {
3359  if (triggerblocker || triggerblocker_inverted || hooktoggle || (shockflag & SHOCK_FLAG_TRG_CMD_SWITCH))
3360  {
3361  AddMessage(Message::TYPE_ERROR, "Error: Wrong command-eventnumber (Triggers). Engine trigger deactivated.");
3362  return;
3363  }
3364  }
3365 
3366  // `add_beam()`
3367  const NodeNum_t node_1_index = FindNodeIndex(def.nodes[0]);
3368  const NodeNum_t node_2_index = FindNodeIndex(def.nodes[1]);
3369  if (node_1_index == NODENUM_INVALID || node_2_index == NODENUM_INVALID)
3370  {
3371  this->AddMessage(Message::TYPE_WARNING, "Skipping trigger, some nodes not found");
3372  return;
3373  }
3374  int beam_index = m_actor->ar_num_beams;
3375  beam_t & beam = AddBeam(m_actor->ar_nodes[node_1_index], m_actor->ar_nodes[node_2_index], def.beam_defaults, def.detacher_group);
3376  beam.bm_type = BEAM_HYDRO;
3377  SetBeamStrength(beam, def.beam_defaults->breaking_threshold);
3378  SetBeamSpring(beam, 0.f);
3379  SetBeamDamping(beam, 0.f);
3380  CalculateBeamLength(beam);
3381  beam.shortbound = sbound;
3382  beam.longbound = lbound;
3383  beam.bounded = TRIGGER;
3384 
3385  if (!invisible)
3386  {
3387  this->CreateBeamVisuals(beam, beam_index, true, def.beam_defaults);
3388  }
3389  // end `add_beam()`
3390 
3392  {
3393  LOG("Trigger added. BeamID " + TOSTRING(beam_index));
3394  }
3395 
3396  shock_t& shock = this->GetFreeShock();
3397  beam.shock = &shock;
3398  shock.beamid = beam_index;
3399  shock.trigger_switch_state = 0.0f; // used as bool and countdowntimer, dont touch!
3400  if (!triggerblocker && !triggerblocker_inverted) // this is no triggerblocker (A/B)
3401  {
3403  if (def.longbound_trigger_action != -1 || (def.longbound_trigger_action == -1 && hooktoggle)) // this is a trigger or a hooktoggle
3405  else // this is a commandkeyblocker
3406  shockflag |= SHOCK_FLAG_TRG_CMD_BLOCKER;
3407  }
3408  else // this is a triggerblocker
3409  {
3410  if (!triggerblocker_inverted)
3411  {
3412  //normal BLOCKER
3413  shockflag |= SHOCK_FLAG_TRG_BLOCKER;
3416  }
3417  else
3418  {
3419  //inverted BLOCKER
3420  shockflag |= SHOCK_FLAG_TRG_BLOCKER_A;
3423  }
3424  }
3425 
3426  if (cmdkeyblock && !triggerblocker)
3427  {
3428  trigger_cmdkeyblock_state_short = true;
3429  if (def.longbound_trigger_action != -1) trigger_cmdkeyblock_state_long = true;
3430  }
3431  if (def.boundary_timer > 0)
3432  shock.trigger_boundary_t = def.boundary_timer;
3433  else
3434  shock.trigger_boundary_t = 1.0f;
3435 
3436  shock.flags = shockflag;
3437  shock.trigger_enabled = shock_trigger_enabled;
3438  shock.sbd_spring = def.beam_defaults->springiness;
3439  shock.sbd_damp = def.beam_defaults->damping_constant;
3440  shock.last_debug_state = 0;
3441 
3442  // Note this is a special 'array' object - any negative indices are valid!
3443  m_actor->ar_command_key[def.shortbound_trigger_action].trigger_cmdkeyblock_state = trigger_cmdkeyblock_state_short;
3444  m_actor->ar_command_key[def.longbound_trigger_action].trigger_cmdkeyblock_state = trigger_cmdkeyblock_state_long;
3445 }
3446 
3448 {
3449  unsigned int node_index = GetNodeIndexOrThrow(node_ref);
3450  m_actor->ar_nodes[node_index].nd_contacter = true;
3451 };
3452 
3454 {
3456 
3457  rotator.angle = 0;
3458  rotator.rate = def.rate;
3459  rotator.axis1 = GetNodeIndexOrThrow(def.axis_nodes[0]);
3460  rotator.axis2 = GetNodeIndexOrThrow(def.axis_nodes[1]);
3461  rotator.force = ROTATOR_FORCE_DEFAULT;
3463  rotator.engine_coupling = def.engine_coupling;
3464  rotator.needs_engine = def.needs_engine;
3465  for (unsigned int i = 0; i < 4; i++)
3466  {
3467  rotator.nodes1[i] = GetNodeIndexOrThrow(def.base_plate_nodes[i]);
3468  rotator.nodes2[i] = GetNodeIndexOrThrow(def.rotating_plate_nodes[i]);
3469  }
3470 
3471  // Validate the reference structure
3472  this->ValidateRotator(m_actor->ar_num_rotators + 1, rotator.axis1, rotator.axis2, rotator.nodes1, rotator.nodes2);
3473 
3474  // Rotate left key
3475  m_actor->ar_command_key[def.spin_left_key].rotators.push_back(- (m_actor->ar_num_rotators + 1));
3476  m_actor->ar_command_key[def.spin_left_key].description = "Rotate_Left/Right";
3477 
3478  // Rotate right key
3479  m_actor->ar_command_key[def.spin_right_key].rotators.push_back(m_actor->ar_num_rotators + 1);
3480 
3482  m_actor->ar_command_key[def.spin_left_key].rotator_inertia,
3483  m_actor->ar_command_key[def.spin_right_key].rotator_inertia);
3484 
3486  m_actor->m_has_command_beams = true;
3487 }
3488 
3490 {
3492 
3493  rotator.angle = 0;
3494  rotator.rate = def.rate;
3495  rotator.axis1 = GetNodeIndexOrThrow(def.axis_nodes[0]);
3496  rotator.axis2 = GetNodeIndexOrThrow(def.axis_nodes[1]);
3497  rotator.force = def.rotating_force; // Default value is set in constructor
3498  rotator.tolerance = def.tolerance; // Default value is set in constructor
3499  rotator.engine_coupling = def.engine_coupling;
3500  rotator.needs_engine = def.needs_engine;
3501  for (unsigned int i = 0; i < 4; i++)
3502  {
3503  rotator.nodes1[i] = GetNodeIndexOrThrow(def.base_plate_nodes[i]);
3504  rotator.nodes2[i] = GetNodeIndexOrThrow(def.rotating_plate_nodes[i]);
3505  }
3506 
3507  // Validate the reference structure
3508  this->ValidateRotator(m_actor->ar_num_rotators + 1, rotator.axis1, rotator.axis2, rotator.nodes1, rotator.nodes2);
3509 
3510  // Rotate left key
3511  m_actor->ar_command_key[def.spin_left_key].rotators.push_back(- (m_actor->ar_num_rotators + 1));
3512  if (! def.description.empty())
3513  {
3514  m_actor->ar_command_key[def.spin_left_key].description = def.description;
3515  }
3516  else
3517  {
3518  m_actor->ar_command_key[def.spin_left_key].description = "Rotate_Left/Right";
3519  }
3520 
3521  // Rotate right key
3522  m_actor->ar_command_key[def.spin_right_key].rotators.push_back(m_actor->ar_num_rotators + 1);
3523 
3525  m_actor->ar_command_key[def.spin_left_key].rotator_inertia,
3526  m_actor->ar_command_key[def.spin_right_key].rotator_inertia);
3527 
3529  m_actor->m_has_command_beams = true;
3530 }
3531 
3533 {
3534  // TODO: refactor _ProcessKeyInertia() to use this.
3535 
3536  // Handle placeholders
3537  std::string start_function;
3538  std::string stop_function;
3539  if (inertia.start_function != "" && inertia.start_function != "/" && inertia.start_function != "-")
3540  {
3541  start_function = inertia.start_function;
3542  }
3543  if (inertia.stop_function != "" && inertia.stop_function != "/" && inertia.stop_function != "-")
3544  {
3545  stop_function = inertia.stop_function;
3546  }
3547 
3548  obj.SetSimpleDelay(
3549  App::GetGameContext()->GetActorManager()->GetInertiaConfig(),
3550  inertia.start_delay_factor,
3551  inertia.stop_delay_factor,
3552  start_function,
3553  stop_function
3554  );
3555 }
3556 
3558  RigDef::Inertia & inertia,
3559  RigDef::Inertia & inertia_defaults,
3560  RoR::CmdKeyInertia& contract_cmd,
3561  RoR::CmdKeyInertia& extend_cmd
3562 )
3563 {
3564  /* Handle placeholders */
3565  Ogre::String start_function;
3566  Ogre::String stop_function;
3567  if (! inertia.start_function.empty() && inertia.start_function != "/" && inertia.start_function != "-")
3568  {
3569  start_function = inertia.start_function;
3570  }
3571  if (! inertia.stop_function.empty() && inertia.stop_function != "/" && inertia.stop_function != "-")
3572  {
3573  stop_function = inertia.stop_function;
3574  }
3575  if (inertia.start_delay_factor != 0.f && inertia.stop_delay_factor != 0.f)
3576  {
3577  contract_cmd.SetCmdKeyDelay(
3578  App::GetGameContext()->GetActorManager()->GetInertiaConfig(),
3579  inertia.start_delay_factor,
3580  inertia.stop_delay_factor,
3581  start_function,
3582  stop_function
3583  );
3584 
3585  extend_cmd.SetCmdKeyDelay(
3586  App::GetGameContext()->GetActorManager()->GetInertiaConfig(),
3587  inertia.start_delay_factor,
3588  inertia.stop_delay_factor,
3589  start_function,
3590  stop_function
3591  );
3592  }
3593  else if (inertia_defaults.start_delay_factor > 0 || inertia_defaults.stop_delay_factor > 0)
3594  {
3595  contract_cmd.SetCmdKeyDelay(
3596  App::GetGameContext()->GetActorManager()->GetInertiaConfig(),
3597  inertia_defaults.start_delay_factor,
3598  inertia_defaults.stop_delay_factor,
3599  inertia_defaults.start_function,
3600  inertia_defaults.stop_function
3601  );
3602 
3603  extend_cmd.SetCmdKeyDelay(
3604  App::GetGameContext()->GetActorManager()->GetInertiaConfig(),
3605  inertia_defaults.start_delay_factor,
3606  inertia_defaults.stop_delay_factor,
3607  inertia_defaults.start_function,
3608  inertia_defaults.stop_function
3609  );
3610  }
3611 }
3612 
3614 {
3615  const NodeNum_t beam_index = m_actor->ar_num_beams;
3616  const NodeNum_t node_1_index = FindNodeIndex(def.nodes[0]);
3617  const NodeNum_t node_2_index = FindNodeIndex(def.nodes[1]);
3618  if (node_1_index == NODENUM_INVALID || node_2_index == NODENUM_INVALID)
3619  {
3620  AddMessage(Message::TYPE_ERROR, "Failed to fetch node");
3621  return;
3622  }
3623  beam_t & beam = AddBeam(m_actor->ar_nodes[node_1_index], m_actor->ar_nodes[node_2_index], def.beam_defaults, def.detacher_group);
3624  CalculateBeamLength(beam);
3625  SetBeamStrength(beam, def.beam_defaults->GetScaledBreakingThreshold()); /* Override settings from AddBeam() */
3626  SetBeamSpring(beam, def.beam_defaults->GetScaledSpringiness());
3627  SetBeamDamping(beam, def.beam_defaults->GetScaledDamping());
3628  beam.bm_type = BEAM_HYDRO;
3629 
3630  /* Options */
3631  if (def.option_r_rope) { beam.bounded = ROPE; }
3632 
3633  /* set the middle of the command, so its not required to recalculate this everytime ... */
3634  float center_length = 0.f;
3635  if (def.max_extension > def.max_contraction)
3636  {
3637  center_length = (def.max_extension - def.max_contraction) / 2 + def.max_contraction;
3638  }
3639  else
3640  {
3641  center_length = (def.max_contraction - def.max_extension) / 2 + def.max_extension;
3642  }
3643 
3644  /* Add keys */
3645  command_t* contract_command = &m_actor->ar_command_key[def.contract_key];
3646  commandbeam_t cmd_beam;
3647  cmd_beam.cmb_beam_index = static_cast<uint16_t>(beam_index);
3648  cmd_beam.cmb_is_contraction = true;
3649  cmd_beam.cmb_speed = def.shorten_rate;
3650  cmd_beam.cmb_boundary_length = def.max_contraction;
3653  cmd_beam.cmb_needs_engine = def.needs_engine;
3654  cmd_beam.cmb_is_1press = def.option_p_1press;
3656  cmd_beam.cmb_plays_sound = def.plays_sound;
3657  cmd_beam.cmb_engine_coupling = def.affect_engine;
3658  cmd_beam.cmb_center_length = center_length;
3659  cmd_beam.cmb_state = std::shared_ptr<commandbeam_state_t>(new commandbeam_state_t);
3660  contract_command->beams.push_back(cmd_beam);
3661  if (contract_command->description.empty())
3662  {
3663  contract_command->description = def.description;
3664  }
3665 
3666  command_t* extend_command = &m_actor->ar_command_key[def.extend_key];
3667  cmd_beam.cmb_is_contraction = false;
3668  cmd_beam.cmb_speed = def.lengthen_rate;
3669  cmd_beam.cmb_boundary_length = def.max_extension;
3670  extend_command->beams.push_back(cmd_beam);
3671  if (extend_command->description.empty())
3672  {
3673  extend_command->description = def.description;
3674  }
3675 
3677  contract_command->command_inertia,
3678  extend_command->command_inertia);
3679 
3680  if (! def.option_i_invisible)
3681  {
3682  this->CreateBeamVisuals(beam, beam_index, true, def.beam_defaults);
3683  }
3684 
3686  m_actor->m_has_command_beams = true;
3687 
3688  // Update the unique pair list
3689  bool must_insert_qpair = true;
3691  {
3692  // seek match on both keys (in any order)
3693  if ((def.contract_key == qpair.uckp_key1 && def.extend_key == qpair.uckp_key2)
3694  || (def.contract_key == qpair.uckp_key2 && def.extend_key == qpair.uckp_key1))
3695  {
3696  must_insert_qpair = false;
3697  if (def.description != "")
3698  {
3699  qpair.uckp_description = def.description; // Last description always wins
3700  }
3701  break;
3702  }
3703  }
3704  if (must_insert_qpair)
3705  {
3706  UniqueCommandKeyPair qpair;
3707  qpair.uckp_key1 = def.contract_key;
3708  qpair.uckp_key2 = def.extend_key;
3709  qpair.uckp_description = def.description;
3710  m_actor->ar_unique_commandkey_pairs.push_back(qpair);
3711  }
3712 }
3713 
3715 {
3716  int anim_flags = 0;
3717  float anim_option = 0;
3718 
3719  /* Options. '{' intentionally misplaced. */
3720 
3722  BITMASK_SET_1(anim_flags, ANIM_FLAG_AIRSPEED);
3723  }
3725  BITMASK_SET_1(anim_flags, ANIM_FLAG_VVI);
3726  }
3728  BITMASK_SET_1(anim_flags, ANIM_FLAG_AOA);
3729  }
3731  BITMASK_SET_1(anim_flags, ANIM_FLAG_FLAP);
3732  }
3734  BITMASK_SET_1(anim_flags, ANIM_FLAG_AIRBRAKE);
3735  }
3737  BITMASK_SET_1(anim_flags, ANIM_FLAG_ROLL);
3738  }
3740  BITMASK_SET_1(anim_flags, ANIM_FLAG_PITCH);
3741  }
3743  BITMASK_SET_1(anim_flags, ANIM_FLAG_BRAKE);
3744  }
3746  BITMASK_SET_1(anim_flags, ANIM_FLAG_ACCEL);
3747  }
3749  BITMASK_SET_1(anim_flags, ANIM_FLAG_CLUTCH);
3750  }
3752  BITMASK_SET_1(anim_flags, ANIM_FLAG_SPEEDO);
3753  }
3755  BITMASK_SET_1(anim_flags, ANIM_FLAG_TACHO);
3756  }
3758  BITMASK_SET_1(anim_flags, ANIM_FLAG_TURBO);
3759  }
3761  BITMASK_SET_1(anim_flags, ANIM_FLAG_PBRAKE);
3762  }
3764  BITMASK_SET_1(anim_flags, ANIM_FLAG_TORQUE);
3765  }
3767  BITMASK_SET_1(anim_flags, ANIM_FLAG_BTHROTTLE);
3768  }
3770  BITMASK_SET_1(anim_flags, ANIM_FLAG_BRUDDER);
3771  }
3773  BITMASK_SET_1(anim_flags, ANIM_FLAG_SHIFTER);
3774  anim_option = 1.f;
3775  }
3777  BITMASK_SET_1(anim_flags, ANIM_FLAG_SHIFTER);
3778  anim_option = 2.f;
3779  }
3781  BITMASK_SET_1(anim_flags, ANIM_FLAG_SHIFTER);
3782  anim_option = 3.f;
3783  }
3785  BITMASK_SET_1(anim_flags, ANIM_FLAG_SHIFTER);
3786  anim_option = 4.f;
3787  }
3789  BITMASK_SET_1(anim_flags, ANIM_FLAG_ALTIMETER);
3790  anim_option = 1.f;
3791  }
3793  BITMASK_SET_1(anim_flags, ANIM_FLAG_ALTIMETER);
3794  anim_option = 2.f;
3795  }
3797  BITMASK_SET_1(anim_flags, ANIM_FLAG_ALTIMETER);
3798  anim_option = 3.f;
3799  }
3800 
3801  /* Aerial */
3803  BITMASK_SET_1(anim_flags, ANIM_FLAG_THROTTLE);
3804  anim_option = static_cast<float>(def.aero_animator.engine_idx);
3805  }
3807  BITMASK_SET_1(anim_flags, ANIM_FLAG_RPM);
3808  anim_option = static_cast<float>(def.aero_animator.engine_idx);
3809  }
3811  BITMASK_SET_1(anim_flags, ANIM_FLAG_AETORQUE);
3812  anim_option = static_cast<float>(def.aero_animator.engine_idx);
3813  }
3815  BITMASK_SET_1(anim_flags, ANIM_FLAG_AEPITCH);
3816  anim_option = static_cast<float>(def.aero_animator.engine_idx);
3817  }
3819  BITMASK_SET_1(anim_flags, ANIM_FLAG_AESTATUS);
3820  anim_option = static_cast<float>(def.aero_animator.engine_idx);
3821  }
3822 
3823  unsigned int beam_index = m_actor->ar_num_beams;
3824  NodeNum_t n1 = this->GetNodeIndexOrThrow(def.nodes[0]);
3825  NodeNum_t n2 = this->GetNodeIndexOrThrow(def.nodes[1]);
3826  beam_t & beam = AddBeam(m_actor->ar_nodes[n1], m_actor->ar_nodes[n2], def.beam_defaults, def.detacher_group);
3827  /* set the limits to something with sense by default */
3828  beam.shortbound = 0.99999f;
3829  beam.longbound = 1000000.0f;
3830  beam.bm_type = BEAM_HYDRO;
3831  CalculateBeamLength(beam);
3832  SetBeamStrength(beam, def.beam_defaults->GetScaledBreakingThreshold());
3833  SetBeamSpring(beam, def.beam_defaults->GetScaledSpringiness());
3834  SetBeamDamping(beam, def.beam_defaults->GetScaledDamping());
3835 
3837  {
3838  this->CreateBeamVisuals(beam, beam_index, true, def.beam_defaults);
3839  }
3840 
3842  {
3843  beam.shortbound = def.short_limit;
3844  }
3846  {
3847  beam.longbound = def.long_limit;
3848  }
3849 
3850  hydrobeam_t hb;
3851  hb.hb_beam_index = static_cast<uint16_t>(beam_index);
3852  hb.hb_speed = def.lenghtening_factor;
3853  hb.hb_ref_length = beam.L;
3854  hb.hb_flags = 0;
3855  hb.hb_anim_flags = anim_flags;
3856  hb.hb_anim_param = anim_option;
3857 
3858  if (def.inertia_defaults->start_delay_factor > 0 && def.inertia_defaults->stop_delay_factor > 0)
3859  {
3862  def.inertia_defaults->start_delay_factor,
3863  def.inertia_defaults->stop_delay_factor,
3864  def.inertia_defaults->start_function,
3865  def.inertia_defaults->stop_function
3866  );
3867  }
3868 
3869  m_actor->ar_hydros.push_back(hb);
3870 }
3871 
3873  node_t & node_1,
3874  node_t & node_2,
3875  std::shared_ptr<RigDef::BeamDefaults> & beam_defaults,
3876  int detacher_group
3877 )
3878 {
3879  /* Init */
3880  beam_t & beam = GetAndInitFreeBeam(node_1, node_2);
3881  beam.detacher_group = detacher_group;
3882  beam.bm_disabled = false;
3883 
3884  /* Breaking threshold (strength) */
3885  float strength = beam_defaults->breaking_threshold;
3886  beam.strength = strength;
3887 
3888  /* Deformation */
3889  SetBeamDeformationThreshold(beam, beam_defaults);
3890 
3891  float plastic_coef = beam_defaults->plastic_deform_coef;
3892  beam.plastic_coef = plastic_coef;
3893 
3894  return beam;
3895 }
3896 
3897 void ActorSpawner::SetBeamStrength(beam_t & beam, float strength)
3898 {
3899  beam.strength = strength;
3900 }
3901 
3903 {
3904  bool invisible = false;
3905  unsigned int hydro_flags = 0;
3906 
3908  {
3909  invisible = true;
3910  }
3912  {
3913  hydro_flags |= HYDRO_FLAG_SPEED;
3914  }
3916  {
3917  hydro_flags |= HYDRO_FLAG_AILERON;
3918  }
3920  {
3921  hydro_flags |= HYDRO_FLAG_RUDDER;
3922  }
3924  {
3925  hydro_flags |= HYDRO_FLAG_ELEVATOR;
3926  }
3928  {
3929  hydro_flags |= (HYDRO_FLAG_AILERON | HYDRO_FLAG_ELEVATOR);
3930  }
3932  {
3933  hydro_flags |= (HYDRO_FLAG_REV_AILERON | HYDRO_FLAG_ELEVATOR);
3934  }
3936  {
3937  hydro_flags |= (HYDRO_FLAG_AILERON | HYDRO_FLAG_RUDDER);
3938  }
3940  {
3941  hydro_flags |= (HYDRO_FLAG_REV_AILERON | HYDRO_FLAG_RUDDER);
3942  }
3944  {
3945  hydro_flags |= (HYDRO_FLAG_ELEVATOR | HYDRO_FLAG_RUDDER);
3946  }
3948  {
3949  hydro_flags |= (HYDRO_FLAG_REV_ELEVATOR | HYDRO_FLAG_RUDDER);
3950  }
3952  {
3953  hydro_flags |= HYDRO_FLAG_DIR;
3954  }
3955 
3956  node_t & node_1 = m_actor->ar_nodes[this->GetNodeIndexOrThrow(def.nodes[0])];
3957  node_t & node_2 = m_actor->ar_nodes[this->GetNodeIndexOrThrow(def.nodes[1])];
3958 
3959  int beam_index = m_actor->ar_num_beams;
3960  beam_t & beam = AddBeam(node_1, node_2, def.beam_defaults, def.detacher_group);
3961  SetBeamStrength(beam, def.beam_defaults->GetScaledBreakingThreshold());
3962  CalculateBeamLength(beam);
3963  beam.bm_type = BEAM_HYDRO;
3964  beam.k = def.beam_defaults->GetScaledSpringiness();
3965  beam.d = def.beam_defaults->GetScaledDamping();
3966 
3967  if (!invisible)
3968  {
3969  this->CreateBeamVisuals(beam, beam_index, true, def.beam_defaults);
3970  }
3971 
3972  hydrobeam_t hb;
3973  hb.hb_flags = hydro_flags;
3974  hb.hb_speed = def.lenghtening_factor;
3975  hb.hb_beam_index = static_cast<uint16_t>(beam_index);
3976  hb.hb_ref_length = beam.L;
3977  hb.hb_anim_flags = 0;
3978  hb.hb_anim_param = 0.f;
3980 
3981  m_actor->ar_hydros.push_back(hb);
3982 }
3983 
3985 {
3986  node_t & node_1 = m_actor->ar_nodes[this->GetNodeIndexOrThrow(def.nodes[0])];
3987  node_t & node_2 = m_actor->ar_nodes[this->GetNodeIndexOrThrow(def.nodes[1])];
3988  float short_bound = def.short_bound;
3989  float long_bound = def.long_bound;
3990  unsigned int shock_flags = SHOCK_FLAG_NORMAL | SHOCK_FLAG_ISSHOCK3;
3991 
3993  {
3994  float beam_length = node_1.AbsPosition.distance(node_2.AbsPosition);
3995  short_bound /= beam_length;
3996  long_bound /= beam_length;
3997  }
3999  {
4000  float beam_length = node_1.AbsPosition.distance(node_2.AbsPosition);
4001  short_bound = (beam_length - short_bound) / beam_length;
4002  long_bound = (long_bound - beam_length) / beam_length;
4003 
4004  if (long_bound < 0.f)
4005  {
4006  AddMessage(
4008  "Metric shock length calculation failed, 'short_bound' less than beams spawn length. Resetting to beam's spawn length (short_bound = 0)"
4009  );
4010  long_bound = 0.f;
4011  }
4012 
4013  if (short_bound > 1.f)
4014  {
4015  AddMessage(
4017  "Metric shock length calculation failed, 'short_bound' less than 0 meters. Resetting to 0 meters (short_bound = 1)"
4018  );
4019  short_bound = 1.f;
4020  }
4021  }
4022 
4023  int beam_index = m_actor->ar_num_beams;
4024  beam_t & beam = AddBeam(node_1, node_2, def.beam_defaults, def.detacher_group);
4025  SetBeamStrength(beam, def.beam_defaults->breaking_threshold * 4.f);
4026  beam.bm_type = BEAM_HYDRO;
4027  beam.bounded = SHOCK3;
4028  beam.k = def.spring_in;
4029  beam.d = def.damp_in;
4030  beam.shortbound = short_bound;
4031  beam.longbound = long_bound;
4032 
4033  /* Length + pre-compression */
4034  CalculateBeamLength(beam);
4035  beam.L *= def.precompression;
4036  beam.refL *= def.precompression;
4037 
4039  {
4040  this->CreateBeamVisuals(beam, beam_index, true, def.beam_defaults);
4041  }
4042 
4043  shock_t & shock = GetFreeShock();
4044  shock.flags = shock_flags;
4045  shock.sbd_spring = def.beam_defaults->springiness;
4046  shock.sbd_damp = def.beam_defaults->damping_constant;
4047  shock.springin = def.spring_in;
4048  shock.dampin = def.damp_in;
4049  shock.springout = def.spring_out;
4050  shock.dampout = def.damp_out;
4051  shock.splitin = def.split_vel_in;
4052  shock.dslowin = def.damp_in_slow;
4053  shock.dfastin = def.damp_in_fast;
4054  shock.splitout = def.split_vel_out;
4055  shock.dslowout = def.damp_out_slow;
4056  shock.dfastout = def.damp_out_fast;
4057 
4058  beam.shock = & shock;
4059  shock.beamid = beam_index;
4060 }
4061 
4063 {
4064  node_t & node_1 = m_actor->ar_nodes[this->GetNodeIndexOrThrow(def.nodes[0])];
4065  node_t & node_2 = m_actor->ar_nodes[this->GetNodeIndexOrThrow(def.nodes[1])];
4066  float short_bound = def.short_bound;
4067  float long_bound = def.long_bound;
4068  unsigned int shock_flags = SHOCK_FLAG_NORMAL | SHOCK_FLAG_ISSHOCK2;
4069 
4071  {
4072  BITMASK_SET_0(shock_flags, SHOCK_FLAG_NORMAL); /* Not normal anymore */
4073  BITMASK_SET_1(shock_flags, SHOCK_FLAG_SOFTBUMP);
4074  }
4076  {
4077  float beam_length = node_1.AbsPosition.distance(node_2.AbsPosition);
4078  short_bound /= beam_length;
4079  long_bound /= beam_length;
4080  }
4082  {
4083  float beam_length = node_1.AbsPosition.distance(node_2.AbsPosition);
4084  short_bound = (beam_length - short_bound) / beam_length;
4085  long_bound = (long_bound - beam_length) / beam_length;
4086 
4087  if (long_bound < 0.f)
4088  {
4089  AddMessage(
4091  "Metric shock length calculation failed, 'short_bound' less than beams spawn length. Resetting to beam's spawn length (short_bound = 0)"
4092  );
4093  long_bound = 0.f;
4094  }
4095 
4096  if (short_bound > 1.f)
4097  {
4098  AddMessage(
4100  "Metric shock length calculation failed, 'short_bound' less than 0 meters. Resetting to 0 meters (short_bound = 1)"
4101  );
4102  short_bound = 1.f;
4103  }
4104  }
4105 
4106  int beam_index = m_actor->ar_num_beams;
4107  beam_t & beam = AddBeam(node_1, node_2, def.beam_defaults, def.detacher_group);
4108  SetBeamStrength(beam, def.beam_defaults->breaking_threshold * 4.f);
4109  beam.bm_type = BEAM_HYDRO;
4110  beam.bounded = SHOCK2;
4111  beam.k = def.spring_in;
4112  beam.d = def.damp_in;
4113  beam.shortbound = short_bound;
4114  beam.longbound = long_bound;
4115 
4116  /* Length + pre-compression */
4117  CalculateBeamLength(beam);
4118  beam.L *= def.precompression;
4119  beam.refL *= def.precompression;
4120 
4122  {
4123  this->CreateBeamVisuals(beam, beam_index, true, def.beam_defaults);
4124  }
4125 
4126  shock_t & shock = GetFreeShock();
4127  shock.flags = shock_flags;
4128  shock.sbd_spring = def.beam_defaults->springiness;
4129  shock.sbd_damp = def.beam_defaults->damping_constant;
4130  shock.springin = def.spring_in;
4131  shock.dampin = def.damp_in;
4132  shock.springout = def.spring_out;
4133  shock.dampout = def.damp_out;
4134  shock.sprogin = def.progress_factor_spring_in;
4135  shock.dprogin = def.progress_factor_damp_in;
4137  shock.dprogout = def.progress_factor_damp_out;
4138 
4139  beam.shock = & shock;
4140  shock.beamid = beam_index;
4141 }
4142 
4144 {
4145  node_t & node_1 = m_actor->ar_nodes[this->GetNodeIndexOrThrow(def.nodes[0])];
4146  node_t & node_2 = m_actor->ar_nodes[this->GetNodeIndexOrThrow(def.nodes[1])];
4147  float short_bound = def.short_bound;
4148  float long_bound = def.long_bound;
4149  unsigned int shock_flags = SHOCK_FLAG_NORMAL;
4150 
4152  {
4153  BITMASK_SET_0(shock_flags, SHOCK_FLAG_NORMAL); /* Not normal anymore */
4154  BITMASK_SET_1(shock_flags, SHOCK_FLAG_LACTIVE);
4155  m_actor->ar_has_active_shocks = true;
4156  }
4158  {
4159  BITMASK_SET_0(shock_flags, SHOCK_FLAG_NORMAL); /* Not normal anymore */
4160  BITMASK_SET_1(shock_flags, SHOCK_FLAG_RACTIVE);
4161  m_actor->ar_has_active_shocks = true;
4162  }
4164  {
4165  float beam_length = node_1.AbsPosition.distance(node_2.AbsPosition);
4166  short_bound /= beam_length;
4167  long_bound /= beam_length;
4168  }
4169 
4170  int beam_index = m_actor->ar_num_beams;
4171  beam_t & beam = AddBeam(node_1, node_2, def.beam_defaults, def.detacher_group);
4172  beam.shortbound = short_bound;
4173  beam.longbound = long_bound;
4174  beam.bounded = SHOCK1;
4175  beam.bm_type = BEAM_HYDRO;
4176  beam.k = def.spring_rate;
4177  beam.d = def.damping;
4178  SetBeamStrength(beam, def.beam_defaults->breaking_threshold * 4.f);
4179 
4180  /* Length + pre-compression */
4181  CalculateBeamLength(beam);
4182  beam.L *= def.precompression;
4183  beam.refL *= def.precompression;
4184 
4185  shock_t & shock = GetFreeShock();
4186  shock.flags = shock_flags;
4187  shock.sbd_spring = def.beam_defaults->springiness;
4188  shock.sbd_damp = def.beam_defaults->damping_constant;
4189 
4191  {
4192  this->CreateBeamVisuals(beam, beam_index, true, def.beam_defaults);
4193  }
4194 
4195  beam.shock = & shock;
4196  shock.beamid = beam_index;
4197 }
4198 
4200 {
4201  NodeNum_t base_node_index = m_actor->ar_num_nodes;
4202  WheelID_t wheel_id = m_actor->ar_num_wheels;
4203  wheel_t & wheel = m_actor->ar_wheels[wheel_id];
4204 
4205  node_t *axis_node_1 = &m_actor->ar_nodes[this->GetNodeIndexOrThrow(def.nodes[0])];
4206  node_t *axis_node_2 = &m_actor->ar_nodes[this->GetNodeIndexOrThrow(def.nodes[1])];
4207  // Enforce the "second node must have a larger Z coordinate than the first" constraint
4208  if (axis_node_1->AbsPosition.z > axis_node_2->AbsPosition.z)
4209  {
4210  node_t* swap = axis_node_1;
4211  axis_node_1 = axis_node_2;
4212  axis_node_2 = swap;
4213  }
4214 
4215  // Rigidity node
4216  node_t *rigidity_node = nullptr;
4217  node_t *axis_node_closest_to_rigidity_node = nullptr;
4218  if (def.rigidity_node.IsValidAnyState())
4219  {
4220  rigidity_node = GetNodePointer(def.rigidity_node);
4221  Ogre::Real distance_1 = (rigidity_node->RelPosition - axis_node_1->RelPosition).length();
4222  Ogre::Real distance_2 = (rigidity_node->RelPosition - axis_node_2->RelPosition).length();
4223  axis_node_closest_to_rigidity_node = ((distance_1 < distance_2)) ? axis_node_1 : axis_node_2;
4224  }
4225 
4226  // Tweaks
4227  float override_rim_radius = TuneupUtil::getTweakedWheelRimRadius(m_actor->getWorkingTuneupDef(), wheel_id, def.rim_radius);
4228  float override_tire_radius = TuneupUtil::getTweakedWheelTireRadius(m_actor->getWorkingTuneupDef(), wheel_id, def.tyre_radius);
4229 
4230  // Node&beam generation
4231  Ogre::Vector3 axis_vector = axis_node_2->RelPosition - axis_node_1->RelPosition;
4232  wheel.wh_width = axis_vector.length(); // wheel_def.width is ignored.
4233  axis_vector.normalise();
4234  Ogre::Vector3 rim_ray_vector = axis_vector.perpendicular() * override_rim_radius;
4235  Ogre::Quaternion rim_ray_rotator = Ogre::Quaternion(Ogre::Degree(-360.f / (def.num_rays * 2)), axis_vector);
4236 
4237  // Rim nodes
4238  for (unsigned int i = 0; i < def.num_rays; i++)
4239  {
4240  float node_mass = def.mass / (4.f * def.num_rays);
4241 
4242  // Outer ring
4243  Ogre::Vector3 ray_point = axis_node_1->RelPosition + rim_ray_vector;
4244  rim_ray_vector = rim_ray_rotator * rim_ray_vector;
4245 
4246  node_t & outer_node = GetFreeNode();
4247  InitNode(outer_node, ray_point, def.node_defaults);
4248 
4249  outer_node.mass = node_mass;
4250  outer_node.friction_coef = def.node_defaults->friction;
4251  outer_node.nd_rim_node = true;
4252  AdjustNodeBuoyancy(outer_node, def.node_defaults);
4254 
4255  m_actor->m_gfx_actor->m_gfx_nodes.push_back(NodeGfx(outer_node.pos));
4256 
4257  // Inner ring
4258  ray_point = axis_node_2->RelPosition + rim_ray_vector;
4259  rim_ray_vector = rim_ray_rotator * rim_ray_vector;
4260 
4261  node_t & inner_node = GetFreeNode();
4262  InitNode(inner_node, ray_point, def.node_defaults);
4263 
4264  inner_node.mass = node_mass;
4265  inner_node.friction_coef = def.node_defaults->friction;
4266  inner_node.nd_rim_node = true;
4267  AdjustNodeBuoyancy(inner_node, def.node_defaults);
4269 
4270  m_actor->m_gfx_actor->m_gfx_nodes.push_back(NodeGfx(inner_node.pos));
4271 
4272  // Wheel object
4273  wheel.wh_rim_nodes[i * 2] = & outer_node;
4274  wheel.wh_rim_nodes[(i * 2) + 1] = & inner_node;
4275  }
4276 
4277  Ogre::Vector3 tyre_ray_vector = axis_vector.perpendicular() * override_tire_radius;
4278  Ogre::Quaternion& tyre_ray_rotator = rim_ray_rotator;
4279  tyre_ray_vector = tyre_ray_rotator * tyre_ray_vector;
4280 
4281  // Tyre nodes
4282  for (unsigned int i = 0; i < def.num_rays; i++)
4283  {
4284  /* Outer ring */
4285  float node_mass = def.mass / (4.f * def.num_rays);
4286  Ogre::Vector3 ray_point = axis_node_1->RelPosition + tyre_ray_vector;
4287  tyre_ray_vector = tyre_ray_rotator * tyre_ray_vector;
4288 
4289  node_t & outer_node = GetFreeNode();
4290  InitNode(outer_node, ray_point);
4291  outer_node.mass = node_mass;
4292  outer_node.friction_coef = def.node_defaults->friction;
4293  outer_node.volume_coef = def.node_defaults->volume;
4294  outer_node.surface_coef = def.node_defaults->surface;
4295  outer_node.nd_contacter = true;
4296  outer_node.nd_tyre_node = true;
4297  AdjustNodeBuoyancy(outer_node, def.node_defaults);
4298 
4299  m_actor->m_gfx_actor->m_gfx_nodes.push_back(NodeGfx(outer_node.pos));
4300 
4301  // Inner ring
4302  ray_point = axis_node_2->RelPosition + tyre_ray_vector;
4303  tyre_ray_vector = tyre_ray_rotator * tyre_ray_vector;
4304 
4305  node_t & inner_node = GetFreeNode();
4306  InitNode(inner_node, ray_point);
4307  inner_node.mass = node_mass;
4308  inner_node.friction_coef = def.node_defaults->friction;
4309  inner_node.volume_coef = def.node_defaults->volume;
4310  inner_node.surface_coef = def.node_defaults->surface;
4311  inner_node.nd_contacter = true;
4312  inner_node.nd_tyre_node = true;
4313  AdjustNodeBuoyancy(inner_node, def.node_defaults);
4314 
4315  m_actor->m_gfx_actor->m_gfx_nodes.push_back(NodeGfx(inner_node.pos));
4316 
4317  // Wheel object
4318  wheel.wh_nodes[i * 2] = & outer_node;
4319  wheel.wh_nodes[(i * 2) + 1] = & inner_node;
4320  }
4321 
4322  // Beams
4323  float rim_spring = def.rim_springiness;
4324  float rim_damp = def.rim_damping;
4325  float tyre_spring = def.tyre_springiness;
4326  float tyre_damp = def.tyre_damping;
4327  float tread_spring = def.beam_defaults->springiness;
4328  float tread_damp = def.beam_defaults->damping_constant;
4329 
4330  for (unsigned int i = 0; i < def.num_rays; i++)
4331  {
4332  // --- Rim ---
4333 
4334  // Rim axis to rim ring
4335  unsigned int rim_outer_node_index = base_node_index + (i * 2);
4336  node_t *rim_outer_node = & m_actor->ar_nodes[rim_outer_node_index];
4337  node_t *rim_inner_node = & m_actor->ar_nodes[rim_outer_node_index + 1];
4338 
4339  AddWheelBeam(axis_node_1, rim_outer_node, rim_spring, rim_damp, def.beam_defaults);
4340  AddWheelBeam(axis_node_2, rim_inner_node, rim_spring, rim_damp, def.beam_defaults);
4341  AddWheelBeam(axis_node_2, rim_outer_node, rim_spring, rim_damp, def.beam_defaults);
4342  AddWheelBeam(axis_node_1, rim_inner_node, rim_spring, rim_damp, def.beam_defaults);
4343 
4344  // Reinforcement rim ring
4345  unsigned int rim_next_outer_node_index = base_node_index + (((i + 1) % def.num_rays) * 2);
4346  node_t *rim_next_outer_node = & m_actor->ar_nodes[rim_next_outer_node_index];
4347  node_t *rim_next_inner_node = & m_actor->ar_nodes[rim_next_outer_node_index + 1];
4348 
4349  AddWheelBeam(rim_outer_node, rim_inner_node, rim_spring, rim_damp, def.beam_defaults);
4350  AddWheelBeam(rim_outer_node, rim_next_outer_node, rim_spring, rim_damp, def.beam_defaults);
4351  AddWheelBeam(rim_inner_node, rim_next_inner_node, rim_spring, rim_damp, def.beam_defaults);
4352  AddWheelBeam(rim_inner_node, rim_next_outer_node, rim_spring, rim_damp, def.beam_defaults);
4353  }
4354 
4355  // Tyre beams
4356  // Quick&dirty port from original SerializedRig::addWheel3()
4357  for (unsigned int i = 0; i < def.num_rays; i++)
4358  {
4359  int rim_node_index = base_node_index + i*2;
4360  int tyre_node_index = base_node_index + i*2 + def.num_rays*2;
4361  node_t * rim_node = & m_actor->ar_nodes[rim_node_index];
4362 
4363  AddWheelBeam(rim_node, & m_actor->ar_nodes[tyre_node_index], tyre_spring/2.f, tyre_damp, def.beam_defaults);
4364 
4365  int tyre_base_index = (i == 0) ? tyre_node_index + (def.num_rays * 2) : tyre_node_index;
4366  AddWheelBeam(rim_node, & m_actor->ar_nodes[tyre_base_index - 1], tyre_spring/2.f, tyre_damp, def.beam_defaults);
4367  AddWheelBeam(rim_node, & m_actor->ar_nodes[tyre_base_index - 2], tyre_spring/2.f, tyre_damp, def.beam_defaults);
4368 
4369  node_t * next_rim_node = & m_actor->ar_nodes[rim_node_index + 1];
4370  AddWheelBeam(next_rim_node, & m_actor->ar_nodes[tyre_node_index], tyre_spring/2.f, tyre_damp, def.beam_defaults);
4371  AddWheelBeam(next_rim_node, & m_actor->ar_nodes[tyre_node_index + 1], tyre_spring/2.f, tyre_damp, def.beam_defaults);
4372 
4373  {
4374  int index = (i == 0) ? tyre_node_index + (def.num_rays * 2) - 1 : tyre_node_index - 1;
4375  node_t * tyre_node = & m_actor->ar_nodes[index];
4376  AddWheelBeam(next_rim_node, tyre_node, tyre_spring/2.f, tyre_damp, def.beam_defaults);
4377  }
4378 
4379  //reinforcement (tire tread)
4380  {
4381  // Very messy port :(
4382  // Aliases
4383  int rimnode = rim_node_index;
4384  int rays = def.num_rays;
4385 
4386  AddWheelBeam(&m_actor->ar_nodes[rimnode+rays*2], &m_actor->ar_nodes[base_node_index+i*2+1+rays*2], tread_spring, tread_damp, def.beam_defaults);
4387  AddWheelBeam(&m_actor->ar_nodes[rimnode+rays*2], &m_actor->ar_nodes[base_node_index+((i+1)%rays)*2+rays*2], tread_spring, tread_damp, def.beam_defaults);
4388  AddWheelBeam(&m_actor->ar_nodes[base_node_index+i*2+1+rays*2], &m_actor->ar_nodes[base_node_index+((i+1)%rays)*2+1+rays*2], tread_spring, tread_damp, def.beam_defaults);
4389  AddWheelBeam(&m_actor->ar_nodes[rimnode+1+rays*2], &m_actor->ar_nodes[base_node_index+((i+1)%rays)*2+rays*2], tread_spring, tread_damp, def.beam_defaults);
4390 
4391  if (rigidity_node != nullptr)
4392  {
4393  if (axis_node_closest_to_rigidity_node == axis_node_1)
4394  {
4395  axis_node_closest_to_rigidity_node = & m_actor->ar_nodes[base_node_index+i*2+rays*2];
4396  } else
4397  {
4398  axis_node_closest_to_rigidity_node = & m_actor->ar_nodes[base_node_index+i*2+1+rays*2];
4399  };
4400  unsigned int beam_index = AddWheelBeam(rigidity_node, axis_node_closest_to_rigidity_node, tyre_spring, tyre_damp, def.beam_defaults);
4401  GetBeam(beam_index).bm_type = BEAM_VIRTUAL;
4402  }
4403  }
4404  }
4405 
4406  // Calculate the point where the support beams get stiff and prevent the tire tread nodes
4407  // bounce into the rim rimradius / tire radius and add 5%, this is a shortbound calc in % !
4408 
4409  float support_beams_short_bound = 1.0f - ((override_rim_radius / override_tire_radius) * 0.95f);
4410 
4411  for (unsigned int i=0; i<def.num_rays; i++)
4412  {
4413  // tiretread anti collapse reinforcements, using precalced support beams
4414  unsigned int tirenode = base_node_index + i*2 + def.num_rays*2;
4415  unsigned int beam_index;
4416 
4417  beam_index = AddWheelBeam(axis_node_1, &m_actor->ar_nodes[tirenode], tyre_spring/2.f, tyre_damp, def.beam_defaults);
4418  GetBeam(beam_index).shortbound = support_beams_short_bound;
4419  GetBeam(beam_index).longbound = 0.f;
4420  GetBeam(beam_index).bounded = SHOCK1;
4421 
4422  beam_index = AddWheelBeam(axis_node_2, &m_actor->ar_nodes[tirenode + 1], tyre_spring/2.f, tyre_damp, def.beam_defaults);
4423  GetBeam(beam_index).shortbound = support_beams_short_bound;
4424  GetBeam(beam_index).longbound = 0.f;
4425  GetBeam(beam_index).bounded = SHOCK1;
4426  }
4427 
4428  // Wheel object
4429  wheel.wh_braking = this->TranslateBrakingDef(def.braking);
4430  wheel.wh_propulsed = (int)def.propulsion;
4431  wheel.wh_num_nodes = 2 * def.num_rays;
4432  wheel.wh_num_rim_nodes = wheel.wh_num_nodes;
4433  wheel.wh_axis_node_0 = axis_node_1;
4434  wheel.wh_axis_node_1 = axis_node_2;
4435  wheel.wh_radius = override_tire_radius;
4436  wheel.wh_rim_radius = override_rim_radius;
4437  wheel.wh_arm_node = this->GetNodePointer(def.reference_arm_node);
4438 
4440  {
4441  // for inter-differential locking
4444  }
4445 
4446  // Find near attach
4447  Ogre::Real length_1 = (axis_node_1->RelPosition - wheel.wh_arm_node->RelPosition).length();
4448  Ogre::Real length_2 = (axis_node_2->RelPosition - wheel.wh_arm_node->RelPosition).length();
4449  wheel.wh_near_attach_node = (length_1 < length_2) ? axis_node_1 : axis_node_2;
4450 
4451  this->CreateFlexBodyWheelVisuals(wheel_id,
4452  base_node_index,
4453  axis_node_1->pos,
4454  axis_node_2->pos,
4455  def.num_rays,
4456  override_rim_radius,
4462  );
4463 
4464  // Commit the wheel
4466 }
4467 
4469 {
4470  switch (def)
4471  {
4477  default: return wheel_t::BrakeCombo::NONE;
4478  }
4479 }
4480 
4481 void ActorSpawner::GetWheelAxisNodes(RigDef::BaseWheel& def, node_t*& out_node_1, node_t*& out_node_2)
4482 {
4483  node_t *def_node_1 = GetNodePointerOrThrow(def.nodes[0]);
4484  node_t *def_node_2 = GetNodePointerOrThrow(def.nodes[1]);
4485 
4486  /* Enforce the "second node must have a larger Z coordinate than the first" constraint */
4487  if (def_node_1->AbsPosition.z > def_node_2->AbsPosition.z)
4488  {
4489  out_node_1 = def_node_2;
4490  out_node_2 = def_node_1;
4491  }
4492  else
4493  {
4494  out_node_1 = def_node_1;
4495  out_node_2 = def_node_2;
4496  }
4497 }
4498 
4500 {
4501  WheelID_t wheel_id = m_actor->ar_num_wheels;
4502 
4503  node_t* axis_node_1 = nullptr;
4504  node_t* axis_node_2 = nullptr;
4505  this->GetWheelAxisNodes(meshwheel_def, axis_node_1, axis_node_2);
4506 
4507  NodeNum_t base_node_index = (NodeNum_t)m_actor->ar_num_nodes;
4508  this->BuildWheelObjectAndNodes(
4509  wheel_id,
4510  meshwheel_def.num_rays,
4511  axis_node_1,
4512  axis_node_2,
4513  GetNodePointer(meshwheel_def.reference_arm_node), /*optional*/
4514  meshwheel_def.num_rays * 2,
4515  meshwheel_def.num_rays * 8,
4517  meshwheel_def.propulsion,
4518  meshwheel_def.braking,
4519  meshwheel_def.node_defaults,
4520  meshwheel_def.mass
4521  );
4522 
4523  this->BuildWheelBeams(
4524  meshwheel_def.num_rays,
4525  base_node_index,
4526  axis_node_1,
4527  axis_node_2,
4528  meshwheel_def.spring, /* Tyre */
4529  meshwheel_def.damping, /* Tyre */
4530  meshwheel_def.spring, /* Rim */
4531  meshwheel_def.damping, /* Rim */
4532  meshwheel_def.beam_defaults,
4533  meshwheel_def.rigidity_node
4534  );
4535 
4536  this->CreateMeshWheelVisuals(
4537  wheel_id,
4538  base_node_index,
4539  axis_node_1->pos,
4540  axis_node_2->pos,
4541  meshwheel_def.num_rays,
4542  TuneupUtil::getTweakedWheelSide(m_actor->getWorkingTuneupDef(), wheel_id, meshwheel_def.side),
4547  meshwheel_def.rim_radius
4548  );
4549 
4550  this->CreateWheelSkidmarks(wheel_id);
4551 
4553 }
4554 
4556 {
4557  WheelID_t wheel_id = m_actor->ar_num_wheels;
4558 
4559  node_t* axis_node_1 = nullptr;
4560  node_t* axis_node_2 = nullptr;
4561  this->GetWheelAxisNodes(def, axis_node_1, axis_node_2);
4562 
4563  NodeNum_t base_node_index = (NodeNum_t)m_actor->ar_num_nodes;
4564 
4565  this->BuildWheelObjectAndNodes(
4566  wheel_id,
4567  def.num_rays,
4568  axis_node_1,
4569  axis_node_2,
4571  def.num_rays * 2,
4572  def.num_rays * 8,
4574  def.propulsion,
4575  def.braking,
4576  def.node_defaults,
4577  def.mass
4578  );
4579 
4580  /* --- Beams --- */
4581  /* Use data from directive 'set_beam_defaults' for the tiretread beams */
4582  float tyre_spring = def.spring;
4583  float tyre_damp = def.damping;
4584  float rim_spring = def.beam_defaults->springiness;
4585  float rim_damp = def.beam_defaults->damping_constant;
4586 
4588  def.num_rays,
4589  base_node_index,
4590  axis_node_1,
4591  axis_node_2,
4592  tyre_spring,
4593  tyre_damp,
4594  rim_spring,
4595  rim_damp,
4596  def.beam_defaults,
4597  def.rigidity_node,
4598  0.15 // max_extension
4599  );
4600 
4601  this->CreateMeshWheelVisuals(
4602  wheel_id,
4603  base_node_index,
4604  axis_node_1->pos,
4605  axis_node_2->pos,
4606  def.num_rays,
4612  def.rim_radius
4613  );
4614 
4615  CreateWheelSkidmarks(wheel_id);
4616 
4618 }
4619 
4621  WheelID_t wheel_index,
4622  NodeNum_t base_node_index,
4623  NodeNum_t axis_node_1_index,
4624  NodeNum_t axis_node_2_index,
4625  unsigned int num_rays,
4626  WheelSide side,
4627  Ogre::String mesh_name,
4628  Ogre::String mesh_rg,
4629  Ogre::String material_name,
4630  Ogre::String material_rg,
4631  float rim_radius
4632 )
4633 {
4634  m_actor->GetGfxActor()->UpdateSimDataBuffer(); // fill all current nodes - needed to setup flexing meshes
4635 
4636  try
4637  {
4639  wheel_index,
4640  axis_node_1_index,
4641  axis_node_2_index,
4642  base_node_index,
4643  num_rays,
4644  rim_radius,
4645  side != WheelSide::RIGHT,
4646  mesh_name,
4647  mesh_rg,
4648  material_name,
4649  material_rg);
4650  Ogre::SceneNode* scene_node = m_wheels_parent_scenenode->createChildSceneNode(this->ComposeName("meshwheel*", wheel_index));
4651  scene_node->attachObject(flexmesh_wheel->GetTireEntity());
4652 
4653  WheelGfx visual_wheel;
4654  visual_wheel.wx_wheel_id = wheel_index;
4655  visual_wheel.wx_flex_mesh = flexmesh_wheel;
4656  visual_wheel.wx_scenenode = scene_node;
4657  visual_wheel.wx_side = side;
4658  visual_wheel.wx_rim_mesh_name = mesh_name;
4659  m_actor->m_gfx_actor->m_wheels.push_back(visual_wheel);
4660  }
4661  catch (Ogre::Exception& e)
4662  {
4663  this->AddMessage(Message::TYPE_ERROR, "Failed to create meshwheel visuals: " + e.getDescription());
4664  return;
4665  }
4666 }
4667 
4669  WheelID_t wheel_id,
4670  unsigned int num_rays,
4671  node_t *axis_node_1,
4672  node_t *axis_node_2,
4673  node_t *reference_arm_node,
4674  unsigned int reserve_nodes,
4675  unsigned int reserve_beams,
4676  float wheel_radius,
4677  RigDef::WheelPropulsion propulsion,
4678  RigDef::WheelBraking braking,
4679  std::shared_ptr<RigDef::NodeDefaults> node_defaults,
4680  float wheel_mass,
4681  float wheel_width /* Default: -1.f */
4682 )
4683 {
4684  wheel_t & wheel = m_actor->ar_wheels[wheel_id];
4685 
4686  /* Axis */
4687  Ogre::Vector3 axis_vector = axis_node_2->RelPosition - axis_node_1->RelPosition;
4688  float axis_length = axis_vector.length();
4689  axis_vector.normalise();
4690 
4691  /* Wheel object */
4692  wheel.wh_braking = this->TranslateBrakingDef(braking);
4693  wheel.wh_propulsed = (int)propulsion;
4694  wheel.wh_num_nodes = 2 * num_rays;
4695  wheel.wh_axis_node_0 = axis_node_1;
4696  wheel.wh_axis_node_1 = axis_node_2;
4697  wheel.wh_radius = wheel_radius;
4698  wheel.wh_width = (wheel_width < 0) ? axis_length : wheel_width;
4699  wheel.wh_arm_node = reference_arm_node;
4700 
4701  /* Find near attach */
4702  Ogre::Real length_1 = (axis_node_1->RelPosition - wheel.wh_arm_node->RelPosition).length();
4703  Ogre::Real length_2 = (axis_node_2->RelPosition - wheel.wh_arm_node->RelPosition).length();
4704  wheel.wh_near_attach_node = (length_1 < length_2) ? axis_node_1 : axis_node_2;
4705 
4706  if (propulsion != RigDef::WheelPropulsion::NONE)
4707  {
4708  /* for inter-differential locking */
4711  }
4712 
4713  /* Nodes */
4714  Ogre::Vector3 ray_vector = axis_vector.perpendicular() * wheel_radius;
4715  Ogre::Quaternion ray_rotator = Ogre::Quaternion(Ogre::Degree(-360.0 / (num_rays * 2)), axis_vector);
4716 
4717  for (unsigned int i = 0; i < num_rays; i++)
4718  {
4719  /* Outer ring */
4720  Ogre::Vector3 ray_point = axis_node_1->RelPosition + ray_vector;
4721  ray_vector = ray_rotator * ray_vector;
4722 
4723  node_t & outer_node = GetFreeNode();
4724  InitNode(outer_node, ray_point, node_defaults);
4725  outer_node.mass = wheel_mass / (2.f * num_rays);
4726  outer_node.nd_contacter = true;
4727  outer_node.nd_tyre_node = true;
4728  AdjustNodeBuoyancy(outer_node, node_defaults);
4729 
4730  m_actor->m_gfx_actor->m_gfx_nodes.push_back(NodeGfx(outer_node.pos));
4731 
4732  /* Inner ring */
4733  ray_point = axis_node_2->RelPosition + ray_vector;
4734  ray_vector = ray_rotator * ray_vector;
4735 
4736  node_t & inner_node = GetFreeNode();
4737  InitNode(inner_node, ray_point, node_defaults);
4738  inner_node.mass = wheel_mass / (2.f * num_rays);
4739  inner_node.nd_contacter = true;
4740  inner_node.nd_tyre_node = true;
4741  AdjustNodeBuoyancy(inner_node, node_defaults);
4742 
4743  m_actor->m_gfx_actor->m_gfx_nodes.push_back(NodeGfx(inner_node.pos));
4744 
4745  /* Wheel object */
4746  wheel.wh_nodes[i * 2] = & outer_node;
4747  wheel.wh_nodes[(i * 2) + 1] = & inner_node;
4748  }
4749 }
4750 
4751 void ActorSpawner::AdjustNodeBuoyancy(node_t & node, RigDef::Node & node_def, std::shared_ptr<RigDef::NodeDefaults> defaults)
4752 {
4753  unsigned int options = (defaults->options | node_def.options); // Merge flags
4755 }
4756 
4757 void ActorSpawner::AdjustNodeBuoyancy(node_t & node, std::shared_ptr<RigDef::NodeDefaults> defaults)
4758 {
4759  node.buoyancy = BITMASK_IS_1(defaults->options, RigDef::Node::OPTION_b_EXTRA_BUOYANCY) ? 10000.f : m_actor->m_dry_mass/15.f;
4760 }
4761 
4763  unsigned int num_rays,
4764  NodeNum_t base_node_index,
4765  node_t *axis_node_1,
4766  node_t *axis_node_2,
4767  float tyre_spring,
4768  float tyre_damping,
4769  float rim_spring,
4770  float rim_damping,
4771  std::shared_ptr<RigDef::BeamDefaults> beam_defaults,
4772  RigDef::Node::Ref const & rigidity_node_id,
4773  float max_extension // = 0.f
4774 )
4775 {
4776  /* Find out where to connect rigidity node */
4777  bool rigidity_beam_side_1 = false;
4778  node_t *rigidity_node = nullptr;
4779  if (rigidity_node_id.IsValidAnyState())
4780  {
4781  rigidity_node = GetNodePointerOrThrow(rigidity_node_id);
4782  float distance_1 = rigidity_node->RelPosition.distance(axis_node_1->RelPosition);
4783  float distance_2 = rigidity_node->RelPosition.distance(axis_node_2->RelPosition);
4784  rigidity_beam_side_1 = distance_1 < distance_2;
4785  }
4786 
4787  for (unsigned int i = 0; i < num_rays; i++)
4788  {
4789  /* Bounded */
4790  unsigned int outer_ring_node_index = base_node_index + (i * 2);
4791  node_t *outer_ring_node = & m_actor->ar_nodes[outer_ring_node_index];
4792  node_t *inner_ring_node = & m_actor->ar_nodes[outer_ring_node_index + 1];
4793 
4794  AddWheelBeam(axis_node_1, outer_ring_node, tyre_spring, tyre_damping, beam_defaults, 0.66f, max_extension);
4795  AddWheelBeam(axis_node_2, inner_ring_node, tyre_spring, tyre_damping, beam_defaults, 0.66f, max_extension);
4796  AddWheelBeam(axis_node_2, outer_ring_node, tyre_spring, tyre_damping, beam_defaults);
4797  AddWheelBeam(axis_node_1, inner_ring_node, tyre_spring, tyre_damping, beam_defaults);
4798 
4799  /* Reinforcement */
4800  unsigned int next_outer_ring_node_index = base_node_index + (((i + 1) % num_rays) * 2);
4801  node_t *next_outer_ring_node = & m_actor->ar_nodes[next_outer_ring_node_index];
4802  node_t *next_inner_ring_node = & m_actor->ar_nodes[next_outer_ring_node_index + 1];
4803 
4804  AddWheelBeam(outer_ring_node, inner_ring_node, rim_spring, rim_damping, beam_defaults);
4805  AddWheelBeam(outer_ring_node, next_outer_ring_node, rim_spring, rim_damping, beam_defaults);
4806  AddWheelBeam(inner_ring_node, next_inner_ring_node, rim_spring, rim_damping, beam_defaults);
4807  AddWheelBeam(inner_ring_node, next_outer_ring_node, rim_spring, rim_damping, beam_defaults);
4808 
4809  /* Rigidity beams */
4810  if (rigidity_node != nullptr)
4811  {
4812  node_t *target_node = (rigidity_beam_side_1) ? outer_ring_node : inner_ring_node;
4813  unsigned int beam_index = AddWheelBeam(rigidity_node, target_node, tyre_spring, tyre_damping, beam_defaults, -1.f, -1.f, BEAM_VIRTUAL);
4814  m_actor->ar_beams[beam_index].bm_type = BEAM_VIRTUAL;
4815  }
4816  }
4817 }
4818 
4820 {
4821  WheelID_t wheel_id = m_actor->ar_num_wheels;
4822 
4823  node_t* axis_node_1 = nullptr;
4824  node_t* axis_node_2 = nullptr;
4825  this->GetWheelAxisNodes(wheel_def, axis_node_1, axis_node_2);
4826 
4827  NodeNum_t base_node_index = (NodeNum_t)m_actor->ar_num_nodes;
4828 
4829  this->BuildWheelObjectAndNodes(
4830  wheel_id,
4831  wheel_def.num_rays,
4832  axis_node_1,
4833  axis_node_2,
4835  wheel_def.num_rays * 2,
4836  wheel_def.num_rays * 8,
4838  wheel_def.propulsion,
4839  wheel_def.braking,
4840  wheel_def.node_defaults,
4841  wheel_def.mass,
4842  -1.f // Set width to axis length (width in definition is ignored)
4843  );
4844 
4845  this->BuildWheelBeams(
4846  wheel_def.num_rays,
4847  base_node_index,
4848  axis_node_1,
4849  axis_node_2,
4850  wheel_def.springiness, /* Tyre */
4851  wheel_def.damping, /* Tyre */
4852  wheel_def.springiness, /* Rim */
4853  wheel_def.damping, /* Rim */
4854  wheel_def.beam_defaults,
4855  wheel_def.rigidity_node
4856  );
4857 
4858  this->CreateWheelVisuals(
4859  wheel_id,
4860  base_node_index,
4861  wheel_def.num_rays,
4866  /*separate_rim:*/false
4867  );
4868 
4869  CreateWheelSkidmarks(wheel_id);
4870 
4872  return wheel_id;
4873 }
4874 
4876 {
4877  // Always create, even if disabled by config
4878  m_actor->m_skid_trails[wheel_index] = new RoR::Skidmark(
4879  RoR::App::GetGfxScene()->GetSkidmarkConf(), &m_actor->ar_wheels[wheel_index], m_particles_parent_scenenode, 300, 20);
4880 }
4881 
4883 {
4884  WheelID_t wheel_id = m_actor->ar_num_wheels;
4885 
4886  node_t* axis_node_1 = nullptr;
4887  node_t* axis_node_2 = nullptr;
4888  this->GetWheelAxisNodes(wheel_2_def, axis_node_1, axis_node_2);
4889 
4890  NodeNum_t base_node_index = (NodeNum_t)m_actor->ar_num_nodes;
4891 
4892  /* Find out where to connect rigidity node */
4893  bool rigidity_beam_side_1 = false;
4894  if (wheel_2_def.rigidity_node.IsValidAnyState())
4895  {
4896  node_t & rigidity_node = m_actor->ar_nodes[this->GetNodeIndexOrThrow(wheel_2_def.rigidity_node)];
4897  Ogre::Real distance_1 = (rigidity_node.RelPosition - axis_node_1->RelPosition).length();
4898  Ogre::Real distance_2 = (rigidity_node.RelPosition - axis_node_2->RelPosition).length();
4899  rigidity_beam_side_1 = distance_1 < distance_2;
4900  }
4901 
4902  // Tweaks
4903  float override_rim_radius = TuneupUtil::getTweakedWheelRimRadius(m_actor->getWorkingTuneupDef(), wheel_id, wheel_2_def.rim_radius);
4904  float override_tire_radius = TuneupUtil::getTweakedWheelTireRadius(m_actor->getWorkingTuneupDef(), wheel_id, wheel_2_def.tyre_radius);
4905 
4906  /* Node&beam generation */
4907  wheel_t& wheel = m_actor->ar_wheels[wheel_id];
4908  Ogre::Vector3 axis_vector = axis_node_2->RelPosition - axis_node_1->RelPosition;
4909  axis_vector.normalise();
4910  Ogre::Vector3 rim_ray_vector = Ogre::Vector3(0, override_rim_radius, 0);
4911  Ogre::Quaternion rim_ray_rotator = Ogre::Quaternion(Ogre::Degree(-360.f / wheel_2_def.num_rays), axis_vector);
4912 
4913  /* Width */
4914  wheel.wh_width = axis_vector.length(); /* wheel_def.width is ignored. */
4915 
4916  /* Rim nodes */
4917  for (unsigned int i = 0; i < wheel_2_def.num_rays; i++)
4918  {
4919  float node_mass = wheel_2_def.mass / (4.f * wheel_2_def.num_rays);
4920 
4921  /* Outer ring */
4922  Ogre::Vector3 ray_point = axis_node_1->RelPosition + rim_ray_vector;
4923 
4924  node_t & outer_node = GetFreeNode();
4925  InitNode(outer_node, ray_point, wheel_2_def.node_defaults);
4926  outer_node.mass = node_mass;
4927  outer_node.nd_rim_node = true;
4928 
4930 
4931  m_actor->m_gfx_actor->m_gfx_nodes.push_back(NodeGfx(outer_node.pos));
4932 
4933  /* Inner ring */
4934  ray_point = axis_node_2->RelPosition + rim_ray_vector;
4935 
4936  node_t & inner_node = GetFreeNode();
4937  InitNode(inner_node, ray_point, wheel_2_def.node_defaults);
4938  inner_node.mass = node_mass;
4939  inner_node.nd_rim_node = true;
4940 
4942 
4943  m_actor->m_gfx_actor->m_gfx_nodes.push_back(NodeGfx(inner_node.pos));
4944 
4945  /* Wheel object */
4946  wheel.wh_rim_nodes[i * 2] = & outer_node;
4947  wheel.wh_rim_nodes[(i * 2) + 1] = & inner_node;
4948 
4949  rim_ray_vector = rim_ray_rotator * rim_ray_vector;
4950  }
4951 
4952  Ogre::Vector3 tyre_ray_vector = Ogre::Vector3(0, override_tire_radius, 0);
4953  Ogre::Quaternion tyre_ray_rotator = Ogre::Quaternion(Ogre::Degree(-180.f / wheel_2_def.num_rays), axis_vector);
4954  tyre_ray_vector = tyre_ray_rotator * tyre_ray_vector;
4955 
4956  /* Tyre nodes */
4957  for (unsigned int i = 0; i < wheel_2_def.num_rays; i++)
4958  {
4959  /* Outer ring */
4960  Ogre::Vector3 ray_point = axis_node_1->RelPosition + tyre_ray_vector;
4961 
4962  node_t & outer_node = GetFreeNode();
4963  InitNode(outer_node, ray_point);
4964  outer_node.mass = (0.67f * wheel_2_def.mass) / (2.f * wheel_2_def.num_rays);
4965  outer_node.friction_coef = wheel.wh_width * WHEEL_FRICTION_COEF;
4966  outer_node.volume_coef = wheel_2_def.node_defaults->volume;
4967  outer_node.surface_coef = wheel_2_def.node_defaults->surface;
4968  outer_node.nd_contacter = true;
4969  outer_node.nd_tyre_node = true;
4970 
4971  m_actor->m_gfx_actor->m_gfx_nodes.push_back(NodeGfx(outer_node.pos));
4972 
4973  /* Inner ring */
4974  ray_point = axis_node_2->RelPosition + tyre_ray_vector;
4975 
4976  node_t & inner_node = GetFreeNode();
4977  InitNode(inner_node, ray_point);
4978  inner_node.mass = (0.33f * wheel_2_def.mass) / (2.f * wheel_2_def.num_rays);
4979  inner_node.friction_coef = wheel.wh_width * WHEEL_FRICTION_COEF;
4980  inner_node.volume_coef = wheel_2_def.node_defaults->volume;
4981  inner_node.surface_coef = wheel_2_def.node_defaults->surface;
4982  inner_node.nd_contacter = true;
4983  inner_node.nd_tyre_node = true;
4984 
4985  m_actor->m_gfx_actor->m_gfx_nodes.push_back(NodeGfx(inner_node.pos));
4986 
4987  /* Wheel object */
4988  wheel.wh_nodes[i * 2] = & outer_node;
4989  wheel.wh_nodes[(i * 2) + 1] = & inner_node;
4990 
4991  tyre_ray_vector = rim_ray_rotator * tyre_ray_vector; // This is OK
4992  }
4993 
4994  /* Beams */
4995  for (unsigned int i = 0; i < wheel_2_def.num_rays; i++)
4996  {
4997  /* --- Rim --- */
4998 
4999  /* Bounded */
5000  unsigned int rim_outer_node_index = base_node_index + (i * 2);
5001  node_t *rim_outer_node = & m_actor->ar_nodes[rim_outer_node_index];
5002  node_t *rim_inner_node = & m_actor->ar_nodes[rim_outer_node_index + 1];
5003 
5004  unsigned int beam_index;
5005  beam_index = AddWheelRimBeam(wheel_2_def, axis_node_1, rim_outer_node);
5006  GetBeam(beam_index).shortbound = 0.66;
5007  beam_index = AddWheelRimBeam(wheel_2_def, axis_node_2, rim_inner_node);
5008  GetBeam(beam_index).shortbound = 0.66;
5009  AddWheelRimBeam(wheel_2_def, axis_node_2, rim_outer_node);
5010  AddWheelRimBeam(wheel_2_def, axis_node_1, rim_inner_node);
5011 
5012  /* Reinforcement */
5013  unsigned int rim_next_outer_node_index = base_node_index + (((i + 1) % wheel_2_def.num_rays) * 2);
5014  node_t *rim_next_outer_node = & m_actor->ar_nodes[rim_next_outer_node_index];
5015  node_t *rim_next_inner_node = & m_actor->ar_nodes[rim_next_outer_node_index + 1];
5016 
5017  AddWheelRimBeam(wheel_2_def, axis_node_1, rim_outer_node);
5018  AddWheelRimBeam(wheel_2_def, rim_outer_node, rim_inner_node);
5019  AddWheelRimBeam(wheel_2_def, rim_outer_node, rim_next_outer_node);
5020  AddWheelRimBeam(wheel_2_def, rim_inner_node, rim_next_inner_node);
5021  AddWheelRimBeam(wheel_2_def, rim_outer_node, rim_next_inner_node);
5022  AddWheelRimBeam(wheel_2_def, rim_inner_node, rim_next_outer_node);
5023 
5024  /* -- Rigidity -- */
5025  if (wheel_2_def.rigidity_node.IsValidAnyState())
5026  {
5027  unsigned int rig_beam_index = AddWheelRimBeam(wheel_2_def,
5028  GetNodePointer(wheel_2_def.rigidity_node),
5029  (rigidity_beam_side_1) ? rim_outer_node : rim_inner_node
5030  );
5031  m_actor->ar_beams[rig_beam_index].bm_type = BEAM_VIRTUAL;
5032  }
5033 
5034  /* --- Tyre --- */
5035 
5036  unsigned int tyre_node_index = rim_outer_node_index + (2 * wheel_2_def.num_rays);
5037  node_t *tyre_outer_node = & m_actor->ar_nodes[tyre_node_index];
5038  node_t *tyre_inner_node = & m_actor->ar_nodes[tyre_node_index + 1];
5039  unsigned int tyre_next_node_index = rim_next_outer_node_index + (2 * wheel_2_def.num_rays);
5040  node_t *tyre_next_outer_node = & m_actor->ar_nodes[tyre_next_node_index];
5041  node_t *tyre_next_inner_node = & m_actor->ar_nodes[tyre_next_node_index + 1];
5042 
5043  /* Tyre band */
5044  AddTyreBeam(wheel_2_def, tyre_outer_node, tyre_next_outer_node);
5045  AddTyreBeam(wheel_2_def, tyre_outer_node, tyre_next_inner_node);
5046  AddTyreBeam(wheel_2_def, tyre_inner_node, tyre_next_outer_node);
5047  AddTyreBeam(wheel_2_def, tyre_inner_node, tyre_next_inner_node);
5048  /* Tyre sidewalls */
5049  AddTyreBeam(wheel_2_def, tyre_outer_node, rim_outer_node);
5050  AddTyreBeam(wheel_2_def, tyre_outer_node, rim_next_outer_node);
5051  AddTyreBeam(wheel_2_def, tyre_inner_node, rim_inner_node);
5052  AddTyreBeam(wheel_2_def, tyre_inner_node, rim_next_inner_node);
5053  /* Reinforcement */
5054  AddTyreBeam(wheel_2_def, tyre_outer_node, rim_inner_node);
5055  AddTyreBeam(wheel_2_def, tyre_outer_node, rim_next_inner_node);
5056  AddTyreBeam(wheel_2_def, tyre_inner_node, rim_outer_node);
5057  AddTyreBeam(wheel_2_def, tyre_inner_node, rim_next_outer_node);
5058  /* Backpressure, bounded */
5059  AddTyreBeam(wheel_2_def, axis_node_1, tyre_outer_node);
5060  AddTyreBeam(wheel_2_def, axis_node_2, tyre_inner_node);
5061  }
5062 
5063  /* Wheel object */
5064  wheel.wh_braking = this->TranslateBrakingDef(wheel_2_def.braking);
5065  wheel.wh_propulsed = (int)wheel_2_def.propulsion;
5066  wheel.wh_num_nodes = 2 * wheel_2_def.num_rays;
5067  wheel.wh_num_rim_nodes = wheel.wh_num_nodes;
5068  wheel.wh_axis_node_0 = axis_node_1;
5069  wheel.wh_axis_node_1 = axis_node_2;
5070  wheel.wh_radius = override_tire_radius;
5071  wheel.wh_rim_radius = override_rim_radius;
5072  wheel.wh_arm_node = this->GetNodePointer(wheel_2_def.reference_arm_node);
5073 
5074  if (wheel_2_def.propulsion != RigDef::WheelPropulsion::NONE)
5075  {
5076  /* for inter-differential locking */
5079  }
5080 
5081  /* Find near attach */
5082  Ogre::Real length_1 = (axis_node_1->RelPosition - wheel.wh_arm_node->RelPosition).length();
5083  Ogre::Real length_2 = (axis_node_2->RelPosition - wheel.wh_arm_node->RelPosition).length();
5084  wheel.wh_near_attach_node = (length_1 < length_2) ? axis_node_1 : axis_node_2;
5085 
5086  CreateWheelSkidmarks(static_cast<unsigned>(m_actor->ar_num_wheels));
5087 
5088  this->CreateWheelVisuals(
5089  wheel_id,
5090  base_node_index,
5091  wheel_2_def.num_rays,
5096  /*separate_rim:*/true,
5097  /*rim_ratio:*/override_rim_radius / override_tire_radius
5098  );
5099 
5101  return wheel_id;
5102 }
5103 
5105  WheelID_t wheel_index,
5106  NodeNum_t node_base_index,
5107  unsigned int num_rays,
5108  Ogre::String const& face_material_name,
5109  Ogre::String const& face_material_rg,
5110  Ogre::String const& band_material_name,
5111  Ogre::String const& band_material_rg,
5112  bool separate_rim,
5113  float rim_ratio
5114 )
5115 {
5116  m_actor->GetGfxActor()->UpdateSimDataBuffer(); // fill all current nodes - needed to setup flexing meshes
5117 
5118  wheel_t & wheel = m_actor->ar_wheels[wheel_index];
5119 
5120  try
5121  {
5122  WheelGfx visual_wheel;
5123 
5124  const std::string wheel_mesh_name = this->ComposeName("mesh @ wheel*", wheel_index);
5125  visual_wheel.wx_flex_mesh = new FlexMesh(
5126  wheel_mesh_name,
5127  m_actor->m_gfx_actor.get(),
5128  wheel.wh_axis_node_0->pos,
5129  wheel.wh_axis_node_1->pos,
5130  static_cast<NodeNum_t>(node_base_index), // FIXME - node_base_index should be also NodeNum_t
5131  num_rays,
5132  face_material_name, face_material_rg,
5133  band_material_name, band_material_rg,
5134  separate_rim,
5135  rim_ratio
5136  );
5137 
5138  const std::string instance_name = this->ComposeName("entity @ wheel*", wheel_index);
5139  Ogre::Entity *ec = App::GetGfxScene()->GetSceneManager()->createEntity(instance_name, wheel_mesh_name);
5140  this->SetupNewEntity(ec, Ogre::ColourValue(0, 0.5, 0.5));
5141  visual_wheel.wx_scenenode = m_wheels_parent_scenenode->createChildSceneNode(this->ComposeName("wheel", wheel_index));
5142  m_actor->m_deletion_entities.emplace_back(ec);
5143  visual_wheel.wx_scenenode->attachObject(ec);
5144  m_actor->m_gfx_actor->m_wheels.push_back(visual_wheel);
5145  }
5146  catch (Ogre::Exception& e)
5147  {
5148  AddMessage(Message::TYPE_ERROR, "Failed to create wheel visuals: " + e.getFullDescription());
5149  }
5150 }
5151 
5153  WheelID_t wheel_id,
5154  NodeNum_t node_base_index,
5155  NodeNum_t axis_node_1,
5156  NodeNum_t axis_node_2,
5157  int num_rays,
5158  float radius,
5159  WheelSide side,
5160  std::string rim_mesh_name,
5161  std::string rim_mesh_rg,
5162  std::string tire_mesh_name,
5163  std::string tire_mesh_rg)
5164 {
5165  m_actor->GetGfxActor()->UpdateSimDataBuffer(); // fill all current nodes - needed to setup flexing meshes
5166 
5167  this->CreateMeshWheelVisuals(
5168  wheel_id,
5169  node_base_index,
5170  axis_node_1,
5171  axis_node_2,
5172  num_rays,
5173  side,
5174  rim_mesh_name,
5175  rim_mesh_rg,
5176  "tracks/trans", // Use a builtin transparent material for the generated tire mesh, to effectively disable it.
5178  radius
5179  );
5180 
5181  int num_nodes = num_rays * 4;
5182  std::vector<unsigned int> node_indices;
5183  node_indices.reserve(num_nodes);
5184  for (int i = 0; i < num_nodes; ++i)
5185  {
5186  node_indices.push_back( node_base_index + i );
5187  }
5188 
5189  try
5190  {
5191  auto* flexbody = m_flex_factory.CreateFlexBody(
5192  (FlexbodyID_t)m_actor->m_gfx_actor->m_flexbodies.size(),
5193  node_base_index,
5194  axis_node_1,
5195  axis_node_2,
5196  Ogre::Vector3(0.5f, 0.5f, 0.f),
5197  Ogre::Vector3(0.f, 0.f, 0.f),
5198  node_indices,
5199  tire_mesh_name,
5200  tire_mesh_rg
5201  );
5202 
5203  if (flexbody == nullptr)
5204  return; // Error already logged
5205 
5206  this->CreateWheelSkidmarks(wheel_id);
5207 
5208  m_actor->m_gfx_actor->m_flexbodies.push_back(flexbody);
5209  }
5210  catch (Ogre::Exception& e)
5211  {
5213  "Failed to create flexbodywheel visuals '" + tire_mesh_name + "', reason:" + e.getDescription());
5214  }
5215 }
5216 
5218  node_t *node_1,
5219  node_t *node_2,
5220  float spring,
5221  float damping,
5222  std::shared_ptr<RigDef::BeamDefaults> beam_defaults,
5223  float max_contraction, /* Default: -1.f */
5224  float max_extension, /* Default: -1.f */
5225  BeamType type /* Default: BEAM_INVISIBLE */
5226 )
5227 {
5228  unsigned int index = m_actor->ar_num_beams;
5229  beam_t & beam = AddBeam(*node_1, *node_2, beam_defaults, DEFAULT_DETACHER_GROUP);
5230  beam.bm_type = type;
5231  beam.k = spring;
5232  beam.d = damping;
5233  if (max_contraction > 0.f)
5234  {
5235  beam.shortbound = max_contraction;
5236  beam.longbound = max_extension;
5237  beam.bounded = SHOCK1;
5238  }
5239  CalculateBeamLength(beam);
5240 
5241  return index;
5242 }
5243 
5244 unsigned int ActorSpawner::AddWheelRimBeam(RigDef::Wheel2 & wheel_2_def, node_t *node_1, node_t *node_2)
5245 {
5246  unsigned int beam_index = _SectionWheels2AddBeam(wheel_2_def, node_1, node_2);
5247  beam_t & beam = GetBeam(beam_index);
5248  beam.k = wheel_2_def.rim_springiness;
5249  beam.d = wheel_2_def.rim_damping;
5250  return beam_index;
5251 }
5252 
5253 unsigned int ActorSpawner::AddTyreBeam(RigDef::Wheel2 & wheel_2_def, node_t *node_1, node_t *node_2)
5254 {
5255  unsigned int beam_index = _SectionWheels2AddBeam(wheel_2_def, node_1, node_2);
5256  beam_t & beam = GetBeam(beam_index);
5257  beam.k = wheel_2_def.tyre_springiness;
5258  beam.d = wheel_2_def.tyre_damping;
5259 
5260  m_actor->getTyrePressure().AddBeam((int)beam_index);
5261 
5262  return beam_index;
5263 }
5264 
5265 unsigned int ActorSpawner::_SectionWheels2AddBeam(RigDef::Wheel2 & wheel_2_def, node_t *node_1, node_t *node_2)
5266 {
5267  unsigned int index = m_actor->ar_num_beams;
5268  beam_t & beam = GetFreeBeam();
5269  InitBeam(beam, node_1, node_2);
5270  beam.bm_type = BEAM_NORMAL;
5271  SetBeamStrength(beam, wheel_2_def.beam_defaults->breaking_threshold);
5272  SetBeamDeformationThreshold(beam, wheel_2_def.beam_defaults);
5273  return index;
5274 }
5275 
5277 {
5278  this->AddWheel2(def);
5279 };
5280 
5282 {
5283  this->AddWheel(def);
5284 };
5285 
5287 {
5288  if (def.wheel_id > m_actor->ar_num_wheels - 1)
5289  {
5290  AddMessage(Message::TYPE_ERROR, std::string("Invalid wheel_id: ") + TOSTRING(def.wheel_id));
5291  return;
5292  }
5293 
5294  wheeldetacher_t obj;
5295  obj.wd_wheel_id = def.wheel_id;
5297  m_actor->ar_wheeldetachers.push_back(obj);
5298 };
5299 
5301 {
5302  /* #1: regulating_force */
5303  float force = def.regulation_force;
5304  if (force < 1.f || force > 20.f)
5305  {
5306  std::stringstream msg;
5307  msg << "Clamping 'regulating_force' value '" << force << "' to allowed range <1 - 20>";
5308  AddMessage(Message::TYPE_INFO, msg.str());
5309  force = (force < 1.f) ? 1.f : 20.f;
5310  }
5311  m_actor->tc_ratio = force;
5312 
5313  /* #2: wheelslip */
5314  // no longer needed
5315 
5316  /* #3: fade_speed */
5317  // no longer needed
5318 
5319  /* #4: pulse/sec */
5320  float pulse = def.pulse_per_sec;
5321  if (pulse <= 1.0f || pulse >= 2000.0f)
5322  {
5323  pulse = 2000.0f;
5324  }
5325  m_actor->tc_pulse_time = 1 / pulse;
5326 
5327  /* #4: mode */
5328  m_actor->tc_mode = def.attr_is_on;
5331 };
5332 
5334 {
5335  /* #1: regulating_force */
5336  float force = def.regulation_force;
5337  if (force < 1.f || force > 20.f)
5338  {
5339  std::stringstream msg;
5340  msg << "Clamping 'regulating_force' value '" << force << "' to allowed range <1 - 20>";
5341  AddMessage(Message::TYPE_INFO, msg.str());
5342  force = (force < 1.f) ? 1.f : 20.f;
5343  }
5344  m_actor->alb_ratio = force;
5345 
5346  /* #2: min_speed */
5347  /* Wheelspeed adaption: 60 sec * 60 mins / 1000(kilometer) = 3.6 to get meter per sec */
5348  float min_speed = def.min_speed / 3.6f;
5349  m_actor->alb_minspeed = std::max(0.5f, min_speed);
5350 
5351  /* #3: pulse_per_sec */
5352  float pulse = def.pulse_per_sec;
5353  if (pulse <= 1.0f || pulse >= 2000.0f)
5354  {
5355  pulse = 2000.0f;
5356  }
5357  m_actor->alb_pulse_time = 1 / pulse;
5358 
5359  /* #4: mode */
5360  m_actor->alb_mode = def.attr_is_on;
5363 }
5364 
5366 {
5369  if (def.parking_brake_force != -1.f)
5370  {
5372  }
5373 };
5374 
5376 {
5377  /* Is this a land vehicle? */
5378  if (m_actor->ar_engine == nullptr)
5379  {
5380  AddMessage(Message::TYPE_WARNING, "Section 'engturbo' found but no engine defined. Skipping ...");
5381  return;
5382  }
5383 
5384  m_actor->ar_engine->SetTurboOptions(def.version, def.tinertiaFactor, def.nturbos, def.param1, def.param2, def.param3, def.param4, def.param5, def.param6, def.param7, def.param8, def.param9, def.param10, def.param11);
5385 };
5386 
5388 {
5389  /* Is this a land vehicle? */
5390  if (m_actor->ar_engine == nullptr)
5391  {
5392  AddMessage(Message::TYPE_WARNING, "Section 'engoption' found but no engine defined. Skipping ...");
5393  return;
5394  }
5395 
5396  if (def.idle_rpm > 0 && def.stall_rpm > 0 && def.stall_rpm > def.idle_rpm)
5397  {
5398  AddMessage(Message::TYPE_WARNING, "Stall RPM is set higher than Idle RPM.");
5399  }
5400 
5401  /* Process it */
5403  def.inertia,
5404  (char)def.type,
5405  def.clutch_force,
5406  def.shift_time,
5407  def.clutch_time,
5408  def.post_shift_time,
5409  def.idle_rpm,
5410  def.stall_rpm,
5411  def.max_idle_mixture,
5412  def.min_idle_mixture,
5413  def.braking_torque
5414  );
5415 };
5416 
5418 {
5419  /* Process it */
5421 
5422  /* Process gear list to EngineSim-compatible format */
5423  /* TODO: Move this to EngineSim::EngineSim() */
5424  std::vector<float> gears_compat;
5425  gears_compat.reserve(2 + def.gear_ratios.size());
5426  gears_compat.push_back(def.reverse_gear_ratio);
5427  gears_compat.push_back(def.neutral_gear_ratio);
5428  std::vector<float>::iterator itor = def.gear_ratios.begin();
5429  for (; itor < def.gear_ratios.end(); itor++)
5430  {
5431  gears_compat.push_back(*itor);
5432  }
5433 
5434  m_actor->ar_engine = new EngineSim(
5435  def.shift_down_rpm,
5436  def.shift_up_rpm,
5437  def.torque,
5438  gears_compat,
5439  def.global_gear_ratio,
5440  m_actor
5441  );
5442 
5443  m_actor->ar_engine->SetAutoMode(App::sim_gearbox_mode->getEnum<SimGearboxMode>());
5444 };
5445 
5447 {
5449 };
5450 
5452 {
5453  authorinfo_t author;
5454  author.type = def.type;
5455  author.name = def.name;
5456  author.email = def.email;
5457  if (def._has_forum_account)
5458  {
5459  author.id = def.forum_account_id;
5460  }
5461  m_actor->authors.push_back(author);
5462 };
5463 
5465 {
5466  NodeNum_t node = this->ResolveNodeRef(node_ref);
5467  if (node == NODENUM_INVALID)
5468  {
5469  std::stringstream msg;
5470  msg << "Failed to retrieve required node: " << node_ref.ToString();
5471  throw Exception(msg.str());
5472  }
5473  return node;
5474 }
5475 
5477 {
5478  if (def.center_node.IsValidAnyState())
5479  {
5481  }
5482 
5483  if (def.back_node.IsValidAnyState())
5484  {
5486  }
5487 
5488  if (def.left_node.IsValidAnyState())
5489  {
5491  }
5492 
5494 };
5495 
5497 {
5498  node_t* node = GetNodePointer(node_ref);
5499  if (node != nullptr)
5500  {
5501  return node;
5502  }
5503  return nullptr;
5504 }
5505 
5507 {
5508  // Nodes
5509  node_t* ar_nodes[] = {nullptr, nullptr};
5510  ar_nodes[0] = GetBeamNodePointer(def.nodes[0]);
5511  if (ar_nodes[0] == nullptr)
5512  {
5513  AddMessage(Message::TYPE_WARNING, std::string("Ignoring beam, could not find node: ") + def.nodes[0].ToString());
5514  return;
5515  }
5516  ar_nodes[1] = GetBeamNodePointer(def.nodes[1]);
5517  if (ar_nodes[1] == nullptr)
5518  {
5519  AddMessage(Message::TYPE_WARNING, std::string("Ignoring beam, could not find node: ") + def.nodes[1].ToString());
5520  return;
5521  }
5522 
5523  // Beam
5524  int beam_index = m_actor->ar_num_beams;
5525  beam_t & beam = AddBeam(*ar_nodes[0], *ar_nodes[1], def.defaults, def.detacher_group);
5526  beam.bm_type = BEAM_NORMAL;
5527  beam.k = def.defaults->GetScaledSpringiness();
5528  beam.d = def.defaults->GetScaledDamping();
5529  beam.bounded = NOSHOCK; // Orig: if (shortbound) ... hardcoded in BTS_BEAMS
5530 
5531  /* Calculate length */
5532  // orig = precompression hardcoded to 1
5533  CalculateBeamLength(beam);
5534 
5535  /* Strength */
5536  float beam_strength = def.defaults->GetScaledBreakingThreshold();
5537  beam.strength = beam_strength;
5538 
5539  /* Options */
5541  {
5542  beam.bounded = ROPE;
5543  }
5545  {
5546  beam.bounded = SUPPORTBEAM;
5547  beam.longbound = def.extension_break_limit;
5548  }
5549 
5551  {
5552  this->CreateBeamVisuals(beam, beam_index, true, def.defaults);
5553  }
5554 }
5555 
5556 void ActorSpawner::SetBeamDeformationThreshold(beam_t & beam, std::shared_ptr<RigDef::BeamDefaults> beam_defaults)
5557 {
5558  /*
5559  ---------------------------------------------------------------------------
5560  Old parser logic
5561  ---------------------------------------------------------------------------
5562 
5563  VAR default_deform = BEAM_DEFORM (400,000)
5564  VAR default_deform_scale = 1
5565  VAR beam_creak = BEAM_CREAK_DEFAULT (100,000)
5566  VAR enable_advanced_deformation = false
5567 
5568 
5569  add_beam()
5570  IF default_deform < beam_creak
5571  default_deform = beam_creak
5572  END IF
5573 
5574  VAR beam;
5575  beam.default_deform = default_deform * default_deform_scale
5576  END
5577 
5578 
5579  enable_advanced_deformation:
5580  READ enable_advanced_deformation
5581 
5582 
5583  set_beam_defaults:
5584  READ default_deform
5585  VAR default_deform_user_defined
5586  READ default_deform_scale
5587  VAR plastic_coef_user_defined
5588 
5589  IF (!enable_advanced_deformation && default_deform < BEAM_DEFORM)
5590  default_deform = BEAM_DEFORM;
5591  END IF
5592 
5593  IF (plastic_coef_user_defined)
5594  beam_creak = 0
5595  END IF
5596 
5597  ---------------------------------------------------------------------------
5598  TruckParser2013
5599  ---------------------------------------------------------------------------
5600 
5601  VAR beam_defaults
5602  {
5603  default_deform = BEAM_DEFORM
5604  scale.default_deform = 1
5605  _enable_advanced_deformation = false
5606  _user_defined = false
5607  _default_deform_set = false
5608  _plastic_coef_user_defined = false
5609  }
5610 
5611 
5612  set_beam_defaults:
5613  READ beam_defaults
5614 
5615 
5616  add_beam:
5617 
5618  // Init
5619 
5620  VAR default_deform = BEAM_DEFORM;
5621  VAR beam_creak = BEAM_CREAK_DEFAULT;
5622 
5623  // Old 'set_beam_defaults'
5624 
5625  IF (beam_defaults._is_user_defined)
5626 
5627  default_deform = beam_defaults.default_deform
5628  IF (!beam_defaults._enable_advanced_deformation && default_deform < BEAM_DEFORM)
5629  default_deform = BEAM_DEFORM;
5630  END IF
5631 
5632  IF (beam_defaults._plastic_coef_user_defined && beam_defaults.plastic_coef >= 0)
5633  beam_creak = 0
5634  END IF
5635 
5636  END IF
5637 
5638  // Old 'add_beam'
5639 
5640  IF default_deform < beam_creak
5641  default_deform = beam_creak
5642  END IF
5643 
5644  VAR beam;
5645  beam.default_deform = default_deform * beam_defaults.scale.default_deform
5646 
5647  ---------------------------------------------------------------------------
5648  */
5649 
5650  // Old init
5651  float default_deform = BEAM_DEFORM;
5652  float beam_creak = BEAM_CREAK_DEFAULT;
5653 
5654  // Old 'set_beam_defaults'
5655  if (beam_defaults->_is_user_defined)
5656  {
5657  default_deform = beam_defaults->deformation_threshold;
5658  if (!beam_defaults->_enable_advanced_deformation && default_deform < BEAM_DEFORM)
5659  {
5660  default_deform = BEAM_DEFORM;
5661  }
5662 
5663  if (beam_defaults->_is_plastic_deform_coef_user_defined && beam_defaults->plastic_deform_coef >= 0.f)
5664  {
5665  beam_creak = 0.f;
5666  }
5667  }
5668 
5669  // Old 'add_beam'
5670  if (default_deform < beam_creak)
5671  {
5672  default_deform = beam_creak;
5673  }
5674 
5675  float deformation_threshold = default_deform * beam_defaults->scale.deformation_threshold_constant;
5676 
5677  beam.minmaxposnegstress = deformation_threshold;
5678  beam.maxposstress = deformation_threshold;
5679  beam.maxnegstress = -(deformation_threshold);
5680 }
5681 
5682 void ActorSpawner::CreateBeamVisuals(beam_t const & beam, int beam_index, bool visible, std::shared_ptr<RigDef::BeamDefaults> const& beam_defaults, std::string material_override)
5683 {
5684  std::string material_name = material_override;
5685  if (material_name.empty())
5686  {
5687  if (beam.bm_type == BEAM_HYDRO)
5688  {
5689  material_name = "tracks/Chrome";
5690  }
5691  else
5692  {
5693  material_name = beam_defaults->beam_material_name;
5694  // Check for existing substitute
5695  auto it = m_managed_materials.find(material_name);
5696  if (it != m_managed_materials.end())
5697  {
5698  auto material = it->second;
5699  if (!material.isNull())
5700  {
5701  material_name = material->getName();
5702  }
5703  }
5704  }
5705  }
5706 
5707  if (m_actor->m_gfx_actor->m_gfx_beams_parent_scenenode == nullptr)
5708  {
5709  m_actor->m_gfx_actor->m_gfx_beams_parent_scenenode = m_actor_grouping_scenenode->createChildSceneNode(this->ComposeName("beams"));
5710  }
5711 
5712  try
5713  {
5714  Ogre::Entity* entity = App::GetGfxScene()->GetSceneManager()->createEntity(this->ComposeName("beam", beam_index), "beam.mesh");
5715  entity->setMaterialName(material_name);
5716 
5717  BeamGfx beamx;
5718  beamx.rod_diameter_mm = uint16_t(beam_defaults->visual_beam_diameter * 1000.f);
5719  beamx.rod_beam_index = static_cast<uint16_t>(beam_index);
5720  beamx.rod_node1 = beam.p1->pos;
5721  beamx.rod_node2 = beam.p2->pos;
5722  beamx.rod_target_actor = m_actor;
5723  beamx.rod_is_visible = false;
5724 
5725  beamx.rod_scenenode = m_actor->m_gfx_actor->m_gfx_beams_parent_scenenode->createChildSceneNode(this->ComposeName("beam", beam_index));
5726  beamx.rod_scenenode->attachObject(entity);
5727  beamx.rod_scenenode->setVisible(visible, /*cascade:*/ false);
5728  beamx.rod_scenenode->setScale(beam_defaults->visual_beam_diameter, -1, beam_defaults->visual_beam_diameter);
5729 
5730  m_actor->m_gfx_actor->m_gfx_beams.push_back(beamx);
5731  }
5732  catch (Ogre::Exception& e)
5733  {
5734  this->AddMessage(Message::TYPE_WARNING, fmt::format("Could not create beam visuals: {}", e.getFullDescription()));
5735  }
5736 }
5737 
5739 {
5740  float beam_length = (beam.p1->RelPosition - beam.p2->RelPosition).length();
5741  beam.L = beam_length;
5742  beam.refL = beam_length;
5743 }
5744 
5745 void ActorSpawner::InitBeam(beam_t & beam, node_t *node_1, node_t *node_2)
5746 {
5747  beam.p1 = node_1;
5748  beam.p2 = node_2;
5749 
5750  /* Length */
5751  CalculateBeamLength(beam);
5752 }
5753 
5754 void ActorSpawner::AddMessage(ActorSpawner::Message type, Ogre::String const & text)
5755 {
5756  Str<4000> txt;
5757  if (m_file)
5758  {
5759  txt << m_file->name;
5760  }
5762  {
5763  txt << " (" << RigDef::KeywordToString(m_current_keyword) << ")";
5764  }
5765  txt << ": " << text;
5766  RoR::Console::MessageType cm_type;
5767  switch (type)
5768  {
5769  case Message::TYPE_ERROR:
5770  cm_type = RoR::Console::MessageType::CONSOLE_SYSTEM_ERROR;
5771  break;
5772 
5773  case Message::TYPE_WARNING:
5774  cm_type = RoR::Console::MessageType::CONSOLE_SYSTEM_WARNING;
5775  break;
5776 
5777  default:
5778  cm_type = RoR::Console::MessageType::CONSOLE_SYSTEM_NOTICE;
5779  break;
5780  }
5781 
5783 }
5784 
5786 {
5787  if (!node_ref.IsValidAnyState())
5788  {
5789  AddMessage(Message::TYPE_ERROR, std::string("Attempt to resolve invalid node reference: ") + node_ref.ToString());
5790  return NODENUM_INVALID;
5791  }
5792  bool is_imported = node_ref.GetImportState_IsValid();
5793  bool is_named = (is_imported ? node_ref.GetImportState_IsResolvedNamed() : node_ref.GetRegularState_IsNamed());
5794  if (is_named)
5795  {
5796  auto result = m_named_nodes.find(node_ref.Str());
5797  if (result != m_named_nodes.end())
5798  {
5799  return (NodeNum_t)result->second;
5800  }
5801 
5802  std::stringstream msg;
5803  msg << "Failed to resolve node-ref (node not found):" << node_ref.ToString();
5804  AddMessage(Message::TYPE_ERROR, msg.str());
5805 
5806  return NODENUM_INVALID;
5807  }
5808  else
5809  {
5810  // Imported nodes pass without check
5811  if (!is_imported && (node_ref.Num() >= static_cast<unsigned int>(m_actor->ar_num_nodes)))
5812  {
5813 
5814  std::stringstream msg;
5815  msg << "Failed to resolve node-ref (node index too big, node count is: "<<m_actor->ar_num_nodes<<"): " << node_ref.ToString();
5816  AddMessage(Message::TYPE_ERROR, msg.str());
5817 
5818  return NODENUM_INVALID;
5819  }
5820  return (NodeNum_t)node_ref.Num();
5821  }
5822 }
5823 
5825 {
5826  NodeNum_t node = ResolveNodeRef(node_ref);
5827  if (node != NODENUM_INVALID)
5828  {
5829  return & m_actor->ar_nodes[node];
5830  }
5831  else
5832  {
5833  return nullptr;
5834  }
5835 }
5836 
5838 {
5839  node_t *node = GetNodePointer(node_ref);
5840  if (node == nullptr)
5841  {
5842  std::stringstream msg;
5843  msg << "Required node not found: " << node_ref.ToString();
5844  throw Exception(msg.str());
5845  }
5846  return node;
5847 }
5848 
5849 std::pair<unsigned int, bool> ActorSpawner::AddNode(RigDef::Node::Id & id)
5850 {
5851  if (!id.IsValid())
5852  {
5853  std::stringstream msg;
5854  msg << "Attempt to add node with 'INVALID' flag: " << id.ToString() << " (number of nodes at this point: " << m_actor->ar_num_nodes << ")";
5855  this->AddMessage(Message::TYPE_ERROR, msg.str());
5856  return std::make_pair(0, false);
5857  }
5858 
5859  if (id.IsTypeNamed())
5860  {
5861  unsigned int new_index = static_cast<unsigned int>(m_actor->ar_num_nodes);
5862  auto insert_result = m_named_nodes.insert(std::make_pair(id.Str(), new_index));
5863  if (! insert_result.second)
5864  {
5865  std::stringstream msg;
5866  msg << "Ignoring named node! Duplicate name: " << id.Str() << " (number of nodes at this point: " << m_actor->ar_num_nodes << ")";
5867  this->AddMessage(Message::TYPE_ERROR, msg.str());
5868  return std::make_pair(0, false);
5869  }
5870  m_actor->ar_nodes_name[new_index] = id.Str();
5871  m_actor->ar_nodes_id[new_index] = m_actor->ar_num_nodes;
5872  m_actor->ar_nodes_name_top_length = std::max(m_actor->ar_nodes_name_top_length, (int)id.Str().length());
5873  m_actor->ar_num_nodes++;
5874  return std::make_pair(new_index, true);
5875  }
5876  if (id.IsTypeNumbered())
5877  {
5878  if (id.Num() < static_cast<unsigned int>(m_actor->ar_num_nodes))
5879  {
5880  std::stringstream msg;
5881  msg << "Duplicate node number, previous definition will be overriden! - " << id.ToString() << " (number of nodes at this point: " << m_actor->ar_num_nodes << ")";
5882  this->AddMessage(Message::TYPE_WARNING, msg.str());
5883  }
5884  unsigned int new_index = static_cast<unsigned int>(m_actor->ar_num_nodes);
5885  m_actor->ar_nodes_id[new_index] = id.Num();
5886  m_actor->ar_num_nodes++;
5887  return std::make_pair(new_index, true);
5888  }
5889  // Invalid node ID without type flag!
5890  throw Exception("Invalid Node::Id without type flags!");
5891 }
5892 
5894 {
5895  std::pair<unsigned int, bool> inserted_node = AddNode(def.id);
5896  if (! inserted_node.second)
5897  {
5898  return;
5899  }
5900 
5901  node_t & node = m_actor->ar_nodes[inserted_node.first];
5902  node.pos = inserted_node.first; /* Node index */
5903 
5904  /* Positioning */
5905  Ogre::Vector3 node_position = m_spawn_position + TuneupUtil::getTweakedNodePosition(m_actor->getWorkingTuneupDef(), node.pos, def.position);
5906  ROR_ASSERT(!std::isnan(node_position.x));
5907  ROR_ASSERT(!std::isnan(node_position.y));
5908  ROR_ASSERT(!std::isnan(node_position.z));
5909  node.AbsPosition = node_position;
5910  node.RelPosition = node_position - m_actor->ar_origin;
5911 
5912  node.friction_coef = def.node_defaults->friction;
5913  node.volume_coef = def.node_defaults->volume;
5914  node.surface_coef = def.node_defaults->surface;
5915 
5916  /* Mass */
5917  if (def.default_minimass)
5918  {
5919  m_actor->ar_minimass[inserted_node.first] = def.default_minimass->min_mass_Kg;
5920  }
5921  else
5922  {
5923  m_actor->ar_minimass[inserted_node.first] = m_state.global_minimass;
5924  }
5925 
5926  if (def.node_defaults->load_weight >= 0.f) // The >= operator is in orig.
5927  {
5928  // orig = further override of hardcoded default.
5929  node.mass = def.node_defaults->load_weight;
5930  node.nd_override_mass = true;
5931  node.nd_loaded_mass = true;
5932  }
5933  else
5934  {
5935  node.mass = 10; // Hardcoded in original (bts_nodes, call to init_node())
5936  node.nd_loaded_mass = false;
5937  }
5938 
5939  /* Lockgroup */
5941 
5942  /* Options */
5943  unsigned int options = def.options | def.node_defaults->options; /* Merge bit flags */
5945  {
5946  node.nd_loaded_mass = true;
5947  if (def._has_load_weight_override)
5948  {
5949  node.nd_override_mass = true;
5950  node.mass = def.load_weight_override;
5951  }
5952  else
5953  {
5954  m_actor->m_masscount++;
5955  }
5956  }
5958  {
5959  /* Link [current-node] -> [node-0] */
5960  /* If current node is 0, link [node-0] -> [node-1] */
5961  node_t & node_2 = m_actor->ar_nodes[((node.pos == 0) ? 1 : 0)];
5962  unsigned int beam_index = m_actor->ar_num_beams;
5963 
5964  beam_t & beam = AddBeam(node, node_2, def.beam_defaults, def.detacher_group);
5965  SetBeamStrength(beam, def.beam_defaults->GetScaledBreakingThreshold() * 100.f);
5966  beam.bm_type = BEAM_HYDRO;
5967  beam.d = def.beam_defaults->GetScaledDamping() * 0.1f;
5968  beam.k = def.beam_defaults->GetScaledSpringiness();
5969  beam.bounded = ROPE;
5970  beam.bm_disabled = true;
5971  beam.L = HOOK_RANGE_DEFAULT;
5972  beam.refL = HOOK_RANGE_DEFAULT;
5974  CreateBeamVisuals(beam, beam_index, false, def.beam_defaults);
5975 
5976  // Logic cloned from SerializedRig.cpp, section BTS_NODES
5977  hook_t hook;
5978  hook.hk_hook_node = & node;
5979  hook.hk_group = -1;
5980  hook.hk_locked = UNLOCKED;
5981  hook.hk_lock_node = nullptr;
5982  hook.hk_locked_actor = nullptr;
5983  hook.hk_lockgroup = -1;
5984  hook.hk_beam = & beam;
5988  hook.hk_selflock = false;
5989  hook.hk_nodisable = false;
5990  hook.hk_timer = 0.0f;
5992  hook.hk_autolock = false;
5993  hook.hk_min_length = 0.f;
5994  m_actor->ar_hooks.push_back(hook);
5995  }
5996  AdjustNodeBuoyancy(node, def, def.node_defaults);
5999 
6002 
6003  // Update "fusedrag" autocalc y & z span
6004  if (def.position.z < m_fuse_z_min) { m_fuse_z_min = def.position.z; }
6005  if (def.position.z > m_fuse_z_max) { m_fuse_z_max = def.position.z; }
6006  if (def.position.y < m_fuse_y_min) { m_fuse_y_min = def.position.y; }
6007  if (def.position.y > m_fuse_y_max) { m_fuse_y_max = def.position.y; }
6008 
6009  // GFX
6010  NodeGfx nfx(node.pos);
6015  m_actor->m_gfx_actor->m_gfx_nodes.push_back(nfx);
6016 }
6017 
6019  NodeNum_t emitter_node_idx,
6020  NodeNum_t direction_node_idx
6021  )
6022 {
6023  exhaust_t exhaust;
6024  exhaust.emitterNode = emitter_node_idx;
6025  exhaust.directionNode = direction_node_idx;
6026 
6027  exhaust.smoker = App::GetGfxScene()->GetSceneManager()->createParticleSystem(
6028  this->ComposeName("exhaust", (int)m_actor->exhausts.size()),
6029  /*quota=*/500, // Default value
6031 
6032  if (exhaust.smoker == nullptr)
6033  {
6034  AddMessage(Message::TYPE_ERROR, "Failed to create exhaust");
6035  return;
6036  }
6037  exhaust.smoker->setVisibilityFlags(DEPTHMAP_DISABLED); // Disable particles in depthmap
6038 
6039  Ogre::MaterialPtr mat = this->FindOrCreateCustomizedMaterial("tracks/Smoke", m_custom_resource_group);
6040  exhaust.smoker->setMaterialName(mat->getName(), mat->getGroup());
6041 
6042  exhaust.smokeNode = m_particles_parent_scenenode->createChildSceneNode(this->ComposeName("exhaust", (int)m_actor->exhausts.size()));
6043  exhaust.smokeNode->attachObject(exhaust.smoker);
6044  exhaust.smokeNode->setPosition(m_actor->ar_nodes[exhaust.emitterNode].AbsPosition);
6045 
6046  m_actor->m_gfx_actor->SetNodeHot(exhaust.emitterNode, true);
6047  m_actor->m_gfx_actor->SetNodeHot(exhaust.directionNode, true);
6048 
6049  m_actor->exhausts.push_back(exhaust);
6050 }
6051 
6053 {
6054  // Node
6055  Ogre::Vector3 node_pos = m_spawn_position + def.position;
6056  node_t & camera_node = GetAndInitFreeNode(node_pos);
6057  camera_node.nd_no_ground_contact = true; // Orig: hardcoded in BTS_CINECAM
6058  camera_node.friction_coef = NODE_FRICTION_COEF_DEFAULT; // Node defaults are ignored here.
6059  AdjustNodeBuoyancy(camera_node, def.node_defaults);
6060  camera_node.volume_coef = def.node_defaults->volume;
6061  camera_node.surface_coef = def.node_defaults->surface;
6062  // NOTE: Not applying the 'node_mass' value here for backwards compatibility - this node must go through initial `Actor::RecalculateNodeMasses()` pass with default weight.
6063 
6064  m_actor->ar_minimass[camera_node.pos] = m_state.global_minimass;
6065 
6068 
6069  // Beams
6070  for (unsigned int i = 0; i < 8; i++)
6071  {
6072  int beam_index = m_actor->ar_num_beams;
6073  node_t& node = m_actor->ar_nodes[this->GetNodeIndexOrThrow(def.nodes[i])];
6074  beam_t & beam = AddBeam(camera_node, node, def.beam_defaults, DEFAULT_DETACHER_GROUP);
6075  beam.bm_type = BEAM_NORMAL;
6076  CalculateBeamLength(beam);
6077  beam.k = def.spring;
6078  beam.d = def.damping;
6079  }
6080 };
6081 
6082 void ActorSpawner::InitNode(node_t & node, Ogre::Vector3 const & position)
6083 {
6084  /* Position */
6085  node.AbsPosition = position;
6086  node.RelPosition = position - m_actor->ar_origin;
6087 }
6088 
6090  node_t & node,
6091  Ogre::Vector3 const & position,
6092  std::shared_ptr<RigDef::NodeDefaults> node_defaults
6093 )
6094 {
6095  InitNode(node, position);
6096  node.friction_coef = node_defaults->friction;
6097  node.volume_coef = node_defaults->volume;
6098  node.surface_coef = node_defaults->surface;
6099 }
6100 
6102 {
6103  m_actor->m_dry_mass = def.dry_mass;
6105 
6106  // NOTE: Don't do any material pre-processing here; it'll be done on actual entities (via `SetupNewEntity()`).
6107  if (! def.material_name.empty())
6108  {
6109  Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName(def.material_name); // Check if exists (compatibility)
6110  if (!mat.isNull())
6111  {
6113  }
6114  else
6115  {
6116  std::stringstream msg;
6117  msg << "Material '" << def.material_name << "' defined in section 'globals' not found. Trying material 'tracks/transred'";
6118  this->AddMessage(Message::TYPE_ERROR, msg.str());
6119 
6120  m_cab_material_name = "tracks/transred";
6121  }
6122  }
6123 }
6124 
6125 /* -------------------------------------------------------------------------- */
6126 // Limits.
6127 /* -------------------------------------------------------------------------- */
6128 
6129 bool ActorSpawner::CheckParticleLimit(unsigned int count)
6130 {
6132  {
6133  std::stringstream msg;
6134  msg << "Particle limit (" << MAX_CPARTICLES << ") exceeded";
6135  AddMessage(Message::TYPE_ERROR, msg.str());
6136  return false;
6137  }
6138  return true;
6139 }
6140 
6141 bool ActorSpawner::CheckAxleLimit(unsigned int count)
6142 {
6143  if ((m_actor->m_num_wheel_diffs + count) > MAX_WHEELS/2)
6144  {
6145  std::stringstream msg;
6146  msg << "Axle limit (" << MAX_WHEELS/2 << ") exceeded";
6147  AddMessage(Message::TYPE_ERROR, msg.str());
6148  return false;
6149  }
6150  return true;
6151 }
6152 
6153 bool ActorSpawner::CheckSubmeshLimit(unsigned int count)
6154 {
6155  if ((m_oldstyle_cab_submeshes.size() + count) > MAX_SUBMESHES)
6156  {
6157  std::stringstream msg;
6158  msg << "Submesh limit (" << MAX_SUBMESHES << ") exceeded";
6159  AddMessage(Message::TYPE_ERROR, msg.str());
6160  return false;
6161  }
6162  return true;
6163 }
6164 
6165 bool ActorSpawner::CheckTexcoordLimit(unsigned int count)
6166 {
6167  if ((m_oldstyle_cab_texcoords.size() + count) > MAX_TEXCOORDS)
6168  {
6169  std::stringstream msg;
6170  msg << "Texcoord limit (" << MAX_TEXCOORDS << ") exceeded";
6171  AddMessage(Message::TYPE_ERROR, msg.str());
6172  return false;
6173  }
6174  return true;
6175 }
6176 
6177 /* Static version */
6178 bool ActorSpawner::CheckSoundScriptLimit(ActorPtr const& vehicle, unsigned int count)
6179 {
6180  if ((vehicle->ar_num_soundsources + count) > MAX_SOUNDSCRIPTS_PER_TRUCK)
6181  {
6182  std::stringstream msg;
6183  msg << "SoundScript limit (" << MAX_SOUNDSCRIPTS_PER_TRUCK << ") exceeded";
6184  LOG(msg.str());
6185  return false;
6186  }
6187  return true;
6188 }
6189 
6190 bool ActorSpawner::CheckCabLimit(unsigned int count)
6191 {
6192  if ((m_actor->ar_num_cabs + count) > MAX_CABS)
6193  {
6194  std::stringstream msg;
6195  msg << "Cab limit (" << MAX_CABS << ") exceeded";
6196  AddMessage(Message::TYPE_ERROR, msg.str());
6197  return false;
6198  }
6199  return true;
6200 }
6201 
6202 bool ActorSpawner::CheckCameraRailLimit(unsigned int count)
6203 {
6204  if ((m_actor->ar_num_camera_rails + count) > MAX_CAMERARAIL)
6205  {
6206  std::stringstream msg;
6207  msg << "CameraRail limit (" << MAX_CAMERARAIL << ") exceeded";
6208  AddMessage(Message::TYPE_ERROR, msg.str());
6209  return false;
6210  }
6211  return true;
6212 }
6213 
6214 bool ActorSpawner::CheckAeroEngineLimit(unsigned int count)
6215 {
6216  if ((m_actor->ar_num_aeroengines + count) > MAX_AEROENGINES)
6217  {
6218  std::stringstream msg;
6219  msg << "AeroEngine limit (" << MAX_AEROENGINES << ") exceeded";
6220  AddMessage(Message::TYPE_ERROR, msg.str());
6221  return false;
6222  }
6223  return true;
6224 }
6225 
6226 bool ActorSpawner::CheckScrewpropLimit(unsigned int count)
6227 {
6228  if ((m_actor->ar_num_screwprops + count) > MAX_SCREWPROPS)
6229  {
6230  std::stringstream msg;
6231  msg << "Screwprop limit (" << MAX_SCREWPROPS << ") exceeded";
6232  AddMessage(Message::TYPE_ERROR, msg.str());
6233  return false;
6234  }
6235  return true;
6236 }
6237 
6238 void ActorSpawner::InitNode(unsigned int node_index, Ogre::Vector3 const & position)
6239 {
6240  InitNode(m_actor->ar_nodes[node_index], position);
6241 }
6242 
6243 beam_t & ActorSpawner::GetBeam(unsigned int index)
6244 {
6245  return m_actor->ar_beams[index];
6246 }
6247 
6249 {
6251  node.pos = m_actor->ar_num_nodes;
6252  m_actor->ar_num_nodes++;
6253  return node;
6254 }
6255 
6257 {
6259  m_actor->ar_num_beams++;
6260  return beam;
6261 }
6262 
6264 {
6267  return shock;
6268 }
6269 
6271 {
6272  beam_t & beam = GetFreeBeam();
6273  beam.p1 = & node_1;
6274  beam.p2 = & node_2;
6275  return beam;
6276 }
6277 
6278 node_t & ActorSpawner::GetAndInitFreeNode(Ogre::Vector3 const & position)
6279 {
6280  node_t & node = GetFreeNode();
6281  InitNode(node, position);
6282  return node;
6283 }
6284 
6285 void ActorSpawner::SetBeamSpring(beam_t & beam, float spring)
6286 {
6287  beam.k = spring;
6288 }
6289 
6290 void ActorSpawner::SetBeamDamping(beam_t & beam, float damping)
6291 {
6292  beam.d = damping;
6293 }
6294 
6296 {
6297  int trucknum = vehicle->ar_instance_id;
6298  int ar_exhaust_pos_node = vehicle->ar_exhaust_pos_node;
6299 
6300 #ifdef USE_OPENAL
6301  if (App::GetSoundScriptManager()->isDisabled())
6302  {
6303  return;
6304  }
6305 
6306  //engine
6307  if (vehicle->ar_engine != nullptr) /* Land vehicle */
6308  {
6309  if (vehicle->ar_engine->m_engine_type == 't')
6310  {
6311  AddSoundSourceInstance(vehicle, "tracks/default_diesel", ar_exhaust_pos_node);
6312  AddSoundSourceInstance(vehicle, "tracks/default_force", ar_exhaust_pos_node);
6313  AddSoundSourceInstance(vehicle, "tracks/default_brakes", 0);
6314  AddSoundSourceInstance(vehicle, "tracks/default_parkbrakes", 0);
6315  AddSoundSourceInstance(vehicle, "tracks/default_reverse_beep", 0);
6316  }
6317  if (vehicle->ar_engine->m_engine_type == 'c')
6318  AddSoundSourceInstance(vehicle, "tracks/default_car", ar_exhaust_pos_node);
6319  if (vehicle->ar_engine->HasTurbo())
6320  {
6321  if (vehicle->ar_engine->m_turbo_inertia_factor >= 3)
6322  AddSoundSourceInstance(vehicle, "tracks/default_turbo_big", ar_exhaust_pos_node);
6323  else if (vehicle->ar_engine->m_turbo_inertia_factor <= 0.5)
6324  AddSoundSourceInstance(vehicle, "tracks/default_turbo_small", ar_exhaust_pos_node);
6325  else
6326  AddSoundSourceInstance(vehicle, "tracks/default_turbo_mid", ar_exhaust_pos_node);
6327 
6328  AddSoundSourceInstance(vehicle, "tracks/default_turbo_bov", ar_exhaust_pos_node);
6329  AddSoundSourceInstance(vehicle, "tracks/default_wastegate_flutter", ar_exhaust_pos_node);
6330  }
6331 
6332  if (vehicle->ar_engine->m_engine_has_air)
6333  AddSoundSourceInstance(vehicle, "tracks/default_air_purge", 0);
6334  //starter
6335  AddSoundSourceInstance(vehicle, "tracks/default_starter", 0);
6336  // turn signals
6337  AddSoundSourceInstance(vehicle, "tracks/default_turn_signal", 0);
6338  }
6339  if (vehicle->ar_driveable==TRUCK)
6340  {
6341  //horn
6342  if (vehicle->ar_is_police)
6343  AddSoundSourceInstance(vehicle, "tracks/default_police", 0);
6344  else
6345  AddSoundSourceInstance(vehicle, "tracks/default_horn", 0);
6346  //shift
6347  AddSoundSourceInstance(vehicle, "tracks/default_shift", 0);
6348  }
6349  //pump
6350  if (vehicle->m_has_command_beams)
6351  {
6352  AddSoundSourceInstance(vehicle, "tracks/default_pump", 0);
6353  }
6354  //antilock brake
6355  if (vehicle->alb_mode || !vehicle->alb_notoggle)
6356  {
6357  AddSoundSourceInstance(vehicle, "tracks/default_antilock", 0);
6358  }
6359  //tractioncontrol
6360  if (vehicle->tc_mode || !vehicle->tc_notoggle)
6361  {
6362  AddSoundSourceInstance(vehicle, "tracks/default_tractioncontrol", 0);
6363  }
6364  //screetch
6365  if ((vehicle->ar_driveable==TRUCK || vehicle->ar_driveable==AIRPLANE) && vehicle->ar_num_wheels != 0)
6366  {
6367  AddSoundSourceInstance(vehicle, "tracks/default_screetch", 0);
6368  }
6369  //break & creak
6370  AddSoundSourceInstance(vehicle, "tracks/default_break", 0);
6371  AddSoundSourceInstance(vehicle, "tracks/default_creak", 0);
6372  //boat engine
6373  if (vehicle->ar_driveable==BOAT)
6374  {
6375  if (vehicle->m_total_mass>50000.0)
6376  AddSoundSourceInstance(vehicle, "tracks/default_marine_large", ar_exhaust_pos_node);
6377  else
6378  AddSoundSourceInstance(vehicle, "tracks/default_marine_small", ar_exhaust_pos_node);
6379  //no start/stop engine for boats, so set sound always on!
6380  SOUND_START(trucknum, SS_TRIG_ENGINE);
6381  SOUND_MODULATE(trucknum, SS_MOD_ENGINE, 0.5);
6382  }
6383  //airplane warnings
6384  if (vehicle->ar_driveable==AIRPLANE)
6385  {
6386  AddSoundSourceInstance(vehicle, "tracks/default_gpws_10", 0);
6387  AddSoundSourceInstance(vehicle, "tracks/default_gpws_20", 0);
6388  AddSoundSourceInstance(vehicle, "tracks/default_gpws_30", 0);
6389  AddSoundSourceInstance(vehicle, "tracks/default_gpws_40", 0);
6390  AddSoundSourceInstance(vehicle, "tracks/default_gpws_50", 0);
6391  AddSoundSourceInstance(vehicle, "tracks/default_gpws_100", 0);
6392 
6393  AddSoundSourceInstance(vehicle, "tracks/default_gpws_pullup", 0);
6394  AddSoundSourceInstance(vehicle, "tracks/default_gpws_minimums", 0);
6395  AddSoundSourceInstance(vehicle, "tracks/default_gpws_apdisconnect", 0);
6396  AddSoundSourceInstance(vehicle, "tracks/default_aoa_warning", 0);
6397 
6398  AddSoundSourceInstance(vehicle, "tracks/default_aivionic_chat01", 0);
6399  AddSoundSourceInstance(vehicle, "tracks/default_aivionic_chat02", 0);
6400  AddSoundSourceInstance(vehicle, "tracks/default_aivionic_chat03", 0);
6401  AddSoundSourceInstance(vehicle, "tracks/default_aivionic_chat04", 0);
6402  AddSoundSourceInstance(vehicle, "tracks/default_aivionic_chat05", 0);
6403  AddSoundSourceInstance(vehicle, "tracks/default_aivionic_chat06", 0);
6404  AddSoundSourceInstance(vehicle, "tracks/default_aivionic_chat07", 0);
6405  AddSoundSourceInstance(vehicle, "tracks/default_aivionic_chat08", 0);
6406  AddSoundSourceInstance(vehicle, "tracks/default_aivionic_chat09", 0);
6407  AddSoundSourceInstance(vehicle, "tracks/default_aivionic_chat10", 0);
6408  AddSoundSourceInstance(vehicle, "tracks/default_aivionic_chat11", 0);
6409  AddSoundSourceInstance(vehicle, "tracks/default_aivionic_chat12", 0);
6410  AddSoundSourceInstance(vehicle, "tracks/default_aivionic_chat13", 0);
6411  }
6412  //airplane engines
6413  for (int i=0; i<vehicle->ar_num_aeroengines && i<8; i++)
6414  {
6415  int turbojet_node = vehicle->ar_aeroengines[i]->getNoderef();
6416  Ogre::String index_str = TOSTRING(i+1);
6417 
6418  if (vehicle->ar_aeroengines[i]->getType() == AeroEngineType::AE_TURBOJET)
6419  {
6420  AddSoundSourceInstance(vehicle, "tracks/default_turbojet_start" + index_str, turbojet_node);
6421  AddSoundSourceInstance(vehicle, "tracks/default_turbojet_lopower" + index_str, turbojet_node);
6422  AddSoundSourceInstance(vehicle, "tracks/default_turbojet_hipower" + index_str, turbojet_node);
6423  if (((Turbojet*)(vehicle->ar_aeroengines[i]))->tjet_afterburnable)
6424  {
6425  AddSoundSourceInstance(vehicle, "tracks/default_turbojet_afterburner" + index_str, turbojet_node);
6426  }
6427  }
6428  else if (vehicle->ar_aeroengines[i]->getType() == AeroEngineType::AE_XPROP)
6429  {
6430  if (((Turboprop*)vehicle->ar_aeroengines[i])->is_piston)
6431  {
6432  AddSoundSourceInstance(vehicle, "tracks/default_pistonprop_start" + index_str, turbojet_node);
6433  AddSoundSourceInstance(vehicle, "tracks/default_pistonprop_lopower" + index_str, turbojet_node);
6434  AddSoundSourceInstance(vehicle, "tracks/default_pistonprop_hipower" + index_str, turbojet_node);
6435  }
6436  else
6437  {
6438  AddSoundSourceInstance(vehicle, "tracks/default_turboprop_start" + index_str, turbojet_node);
6439  AddSoundSourceInstance(vehicle, "tracks/default_turboprop_lopower" + index_str, turbojet_node);
6440  AddSoundSourceInstance(vehicle, "tracks/default_turboprop_hipower" + index_str, turbojet_node);
6441  }
6442  }
6443  }
6444 
6445  // linked sounds
6446  for (int i=0; i<vehicle->m_num_command_beams; i++)
6447  {
6448  AddSoundSource(vehicle, App::GetSoundScriptManager()->createInstance(Ogre::String("tracks/linked/default_command/extend"), trucknum, SL_COMMAND, i), 0);
6449  AddSoundSource(vehicle, App::GetSoundScriptManager()->createInstance(Ogre::String("tracks/linked/default_command/retract"), trucknum, SL_COMMAND, -i), 0);
6450  }
6451 
6452 #endif //OPENAL
6453 }
6454 
6456 {
6457  for (int i=0; i<m_actor->ar_num_collcabs; i++)
6458  {
6459  int tmpv = m_actor->ar_collcabs[i] * 3;
6460  m_actor->ar_nodes[m_actor->ar_cabs[tmpv]].nd_cab_node = true;
6461  m_actor->ar_nodes[m_actor->ar_cabs[tmpv+1]].nd_cab_node = true;
6462  m_actor->ar_nodes[m_actor->ar_cabs[tmpv+2]].nd_cab_node = true;
6463  }
6464  for (int i = 0; i < m_actor->ar_num_nodes; i++)
6465  {
6466  if (m_actor->ar_nodes[i].nd_contacter)
6467  {
6470  }
6471  else if (!m_actor->ar_nodes[i].nd_no_ground_contact &&
6473  {
6474  m_actor->ar_nodes[i].nd_contactable = true;
6476  }
6477  }
6478 }
6479 
6481 {
6482  for (auto& module: m_selected_modules)
6483  {
6484  for (auto& def: module->materialflarebindings)
6485  {
6486  if (def.material_name == material_name)
6487  {
6488  return &def;
6489  }
6490  }
6491  }
6492  return nullptr;
6493 }
6494 
6496 {
6497  for (auto& module: m_selected_modules)
6498  {
6499  for (auto& def: module->videocameras)
6500  {
6501  if (def.material_name == material_name)
6502  {
6503  return &def;
6504  }
6505  }
6506  }
6507 
6508  return nullptr;
6509 }
6510 
6511 Ogre::MaterialPtr ActorSpawner::FindOrCreateCustomizedMaterial(const std::string& mat_lookup_name, const std::string& mat_lookup_rg)
6512 {
6513  try
6514  {
6515  // Check for existing substitute
6516  auto lookup_res = m_material_substitutions.find(mat_lookup_name);
6517  if (lookup_res != m_material_substitutions.end())
6518  {
6519  return lookup_res->second.material;
6520  }
6521 
6522  CustomMaterial lookup_entry;
6523 
6524  // Query old-style mirrors (=special props, hardcoded material name 'mirror')
6525  if (mat_lookup_name == "mirror")
6526  {
6529  lookup_entry.material_flare_def = nullptr;
6530  static int mirror_counter = 0;
6531  const std::string new_mat_name = this->ComposeName("RenderMaterial", mirror_counter);
6532  ++mirror_counter;
6533  lookup_entry.material = Ogre::MaterialManager::getSingleton().getByName("mirror")->clone(new_mat_name, true, mat_lookup_rg);
6534  // Special case - register under generated name. This is because all mirrors use the same material 'mirror'
6535  m_material_substitutions.insert(std::make_pair(new_mat_name, lookup_entry));
6536  return lookup_entry.material; // Done!
6537  }
6538 
6539  // Query 'videocameras'
6540  RigDef::VideoCamera* videocam_def = this->FindVideoCameraByMaterial(mat_lookup_name);
6541  if (videocam_def != nullptr)
6542  {
6543  Ogre::MaterialPtr video_mat_shared;
6544  auto found_managedmat = m_managed_materials.find(mat_lookup_name);
6545  if (found_managedmat != m_managed_materials.end())
6546  {
6547  video_mat_shared = found_managedmat->second;
6548  }
6549  else
6550  {
6551  video_mat_shared = Ogre::MaterialManager::getSingleton().getByName(mat_lookup_name);
6552  }
6553 
6554  if (!video_mat_shared.isNull())
6555  {
6556  lookup_entry.video_camera_def = videocam_def;
6557  const std::string video_mat_name = this->ComposeName(videocam_def->material_name);
6558  lookup_entry.material = video_mat_shared->clone(video_mat_name, true, mat_lookup_rg);
6559  m_material_substitutions.insert(std::make_pair(mat_lookup_name, lookup_entry));
6560  return lookup_entry.material; // Done!
6561  }
6562  else
6563  {
6564  std::stringstream msg;
6565  msg << "VideoCamera material '" << mat_lookup_name << "' not found! Ignoring videocamera.";
6566  this->AddMessage(Message::TYPE_WARNING, msg.str());
6567  }
6568  }
6569 
6570  // Resolve 'materialflarebindings'.
6571  RigDef::MaterialFlareBinding* mat_flare_def = this->FindFlareBindingForMaterial(mat_lookup_name);
6572  if (mat_flare_def != nullptr)
6573  {
6574  lookup_entry.material_flare_def = mat_flare_def;
6575  }
6576 
6577  // Query .skin material replacements
6578  if (m_actor->m_used_skin_entry != nullptr)
6579  {
6580  std::shared_ptr<RoR::SkinDef>& skin_def = m_actor->m_used_skin_entry->skin_def;
6581 
6582  auto skin_res = skin_def->replace_materials.find(mat_lookup_name);
6583  if (skin_res != skin_def->replace_materials.end())
6584  {
6585  Ogre::MaterialPtr skin_mat = Ogre::MaterialManager::getSingleton().getByName(
6586  skin_res->second, m_actor->m_used_skin_entry->resource_group);
6587  if (!skin_mat.isNull())
6588  {
6589  lookup_entry.material = skin_mat->clone(this->ComposeName(skin_mat->getName()), /*changeGroup=*/true, mat_lookup_rg);
6590  m_material_substitutions.insert(std::make_pair(mat_lookup_name, lookup_entry));
6591  return lookup_entry.material;
6592  }
6593  else
6594  {
6595  std::stringstream buf;
6596  buf << "Material '" << skin_res->second << "' from skin '" << m_actor->m_used_skin_entry->dname
6597  << "' not found (filename: '" << m_actor->m_used_skin_entry->fname
6598  << "', resource group: '"<< m_actor->m_used_skin_entry->resource_group
6599  <<"')! Ignoring it...";
6600  this->AddMessage(Message::TYPE_ERROR, buf.str());
6601  }
6602  }
6603  }
6604 
6605  // Acquire substitute - either use managedmaterial or generate new by cloning.
6606  auto mmat_res = m_managed_materials.find(mat_lookup_name);
6607  if (mmat_res != m_managed_materials.end())
6608  {
6609  // Use managedmaterial as substitute
6610  lookup_entry.material = mmat_res->second;
6611  }
6612  else
6613  {
6614  // Generate new substitute
6615  Ogre::MaterialPtr orig_mat = Ogre::MaterialManager::getSingleton().getByName(mat_lookup_name, mat_lookup_rg);
6616  if (orig_mat.isNull())
6617  {
6618  std::stringstream buf;
6619  buf << "Material doesn't exist:" << mat_lookup_name;
6620  this->AddMessage(Message::TYPE_ERROR, buf.str());
6621  return Ogre::MaterialPtr(); // NULL
6622  }
6623 
6624  lookup_entry.material = orig_mat->clone(this->ComposeName(orig_mat->getName()), true, mat_lookup_rg);
6625  /*
6626  02:53:47: [RoR|Actor|Error] (Keyword: managedmaterials) Ogre::ItemIdentityException::ItemIdentityException: Texture Pointer is empty. in TextureUnitState::setTexture at C:\Users\Petr\.conan2\p\b\ogre3ff3740bbb9785\b\OgreMain\src\OgreTextureUnitState.cpp (line 271)
6627  02:55:17: [RoR|ContentManager] Skipping resource with duplicate name: 'pushbar1 (gavrilmv4.truck [Instance ID 1])' (origin: '')
6628  */
6629  ROR_ASSERT(lookup_entry.material);
6630  }
6631 
6632  // Register the substitute
6633  m_material_substitutions.insert(std::make_pair(mat_lookup_name, lookup_entry));
6634 
6635  // Finally, query texture replacements - .skin and builtins
6636  for (auto& technique: lookup_entry.material->getTechniques())
6637  {
6638  for (auto& pass: technique->getPasses())
6639  {
6640  for (auto& tex_unit: pass->getTextureUnitStates())
6641  {
6642  // Built-ins
6643  if (tex_unit->getTextureName() == "dashtexture")
6644  {
6645  if (!m_oldstyle_renderdash)
6646  {
6647  // This is technically a bug, but does it matter at all? Let's watch ~ only_a_ptr, 05/2019
6648  std::stringstream msg;
6649  msg << "Warning: '" << mat_lookup_name
6650  << "' references 'dashtexture', but Renderdash isn't created yet! Texture will be blank.";
6651  this->AddMessage(Message::TYPE_WARNING, msg.str());
6652  }
6653  else
6654  {
6655  tex_unit->setTexture(m_oldstyle_renderdash->getTexture());
6656  }
6657  }
6658  // .skin
6659  else if (m_actor->m_used_skin_entry != nullptr)
6660  {
6661  const size_t num_frames = tex_unit->getNumFrames();
6662  for (size_t i = 0; i < num_frames; ++i)
6663  {
6664  const auto end = m_actor->m_used_skin_entry->skin_def->replace_textures.end();
6665  const auto query = m_actor->m_used_skin_entry->skin_def->replace_textures.find(tex_unit->getFrameTextureName((unsigned int)i));
6666  if (query != end)
6667  {
6668  // Skin has replacement for this texture
6669  if (m_actor->m_used_skin_entry->resource_group != mat_lookup_rg) // The skin comes from a SkinZip bundle (different resource group)
6670  {
6671  Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton().getByName(
6672  query->second, m_actor->m_used_skin_entry->resource_group);
6673  if (tex.isNull())
6674  {
6675  // `Ogre::TextureManager` doesn't automatically register all images in resource groups,
6676  // it waits for `Ogre::Resource`s to be created explicitly.
6677  // Normally this is done by `Ogre::MaterialManager` when loading a material.
6678  // In this case we must do it manually
6679  tex = Ogre::TextureManager::getSingleton().create(
6680  query->second, m_actor->m_used_skin_entry->resource_group);
6681  }
6682  tex_unit->_setTexturePtr(tex, i);
6683  }
6684  else // The skin lives in the vehicle bundle (same resource group)
6685  {
6686  tex_unit->setFrameTextureName(query->second, (unsigned int)i);
6687  }
6688  }
6689  }
6690  }
6691  } // texture unit states
6692  } // passes
6693  } // techniques
6694 
6695 
6696  return lookup_entry.material;
6697  }
6698  catch (Ogre::Exception& e)
6699  {
6700  std::stringstream msg;
6701  msg << "Exception while customizing material \"" << mat_lookup_name << "\", message: " << e.getFullDescription();
6702  this->AddMessage(Message::TYPE_ERROR, msg.str());
6703  }
6704  return Ogre::MaterialPtr(); // NULL
6705 }
6706 
6707 Ogre::MaterialPtr ActorSpawner::CreateSimpleMaterial(Ogre::ColourValue color)
6708 {
6710 
6711  static unsigned int simple_mat_counter = 0;
6712  Ogre::MaterialPtr newmat = m_simple_material_base->clone(this->ComposeName("simple material", simple_mat_counter++));
6713  newmat->getTechnique(0)->getPass(0)->setAmbient(color);
6714 
6715  return newmat;
6716 }
6717 
6718 void ActorSpawner::SetupNewEntity(Ogre::Entity* ent, Ogre::ColourValue simple_color)
6719 {
6720  // RULE: Each actor must have it's own material instances (a lookup table is kept for OrigName->CustomName)
6721  //
6722  // Setup routine:
6723  //
6724  // 1. If "SimpleMaterials" (plain color surfaces denoting component type) are enabled in config file,
6725  // material is generated (not saved to lookup table) and processing ends.
6726  // 2. If the material name is 'mirror', it's a special prop - rear view mirror.
6727  // material is generated, added to lookup table under generated name (special case) and processing ends.
6728  // 3. If the material is a 'videocamera' of any subtype, material is created, added to lookup table and processing ends.
6729  // 4 'materialflarebindngs' are resolved -> binding is persisted in lookup table.
6730  // 5 SkinZIP _material replacements_ are queried. If match is found, it's added to lookup table and processing ends.
6731  // 6. ManagedMaterials are queried. If match is found, it's added to lookup table and processing ends.
6732  // 7. Orig. material is cloned to create substitute.
6733  // 8. SkinZIP _texture replacements_ are queried. If match is found, substitute material is updated.
6734  // 9. Material is added to lookup table, processing ends.
6735  // ==========================================================
6736 
6737  if (ent == nullptr)
6738  {
6739  // Dirty but I don't see any alternative ... ~ ulteq, 10/2018
6740  AddMessage(Message::TYPE_WARNING, "Failed to create entity: continuing without it ...");
6741  return;
6742  }
6743 
6744  // Use simple materials if applicable
6746  {
6747  Ogre::MaterialPtr mat = this->CreateSimpleMaterial(simple_color);
6748 
6749  size_t num_sub_entities = ent->getNumSubEntities();
6750  for (size_t i = 0; i < num_sub_entities; i++)
6751  {
6752  Ogre::SubEntity* subent = ent->getSubEntity(i);
6753  subent->setMaterial(mat);
6754  }
6755 
6756  return; // Done!
6757  }
6758 
6759  // Create unique sub-entity (=instance of submesh) materials
6760  size_t subent_max = ent->getNumSubEntities();
6761  for (size_t i = 0; i < subent_max; ++i)
6762  {
6763  Ogre::SubEntity* subent = ent->getSubEntity(i);
6764 
6765  if (!subent->getMaterial().isNull())
6766  {
6767  Ogre::MaterialPtr own_mat = this->FindOrCreateCustomizedMaterial(subent->getMaterialName(), subent->getSubMesh()->parent->getGroup());
6768  if (!own_mat.isNull())
6769  {
6770  subent->setMaterial(own_mat);
6771  }
6772  }
6773  }
6774 }
6775 
6777 {
6778  // Check and warn if there are unclaimed managed materials
6779  // TODO &*&*
6780 
6781  // Process special materials
6782  for (auto& entry: m_material_substitutions)
6783  {
6784  if (entry.second.material_flare_def != nullptr) // 'materialflarebindings'
6785  {
6786  this->CreateMaterialFlare(
6787  entry.second.material_flare_def->flare_number, entry.second.material);
6788  }
6789  else if (entry.second.mirror_prop_type != CustomMaterial::MirrorPropType::MPROP_NONE) // special 'prop' - rear view mirror
6790  {
6792  entry.second.material, entry.second.mirror_prop_type, entry.second.mirror_prop_scenenode);
6793  }
6794  else if (entry.second.video_camera_def != nullptr) // 'videocameras'
6795  {
6797  this->CreateVideoCamera(entry.second.video_camera_def);
6798  this->SetCurrentKeyword(RigDef::Keyword::INVALID); // Logging
6799  }
6800  }
6801 
6802  if (!App::gfx_enable_videocams->getBool())
6803  {
6805  }
6806 
6807  // Load dashboard layouts
6808  for (auto& module: m_selected_modules)
6809  {
6810  for (auto& gs: module->guisettings)
6811  {
6812  if (gs.key == "dashboard")
6813  {
6814  m_actor->ar_dashboard->loadDashBoard(gs.value, false);
6815  }
6816  else if (gs.key == "texturedashboard")
6817  {
6818  m_actor->ar_dashboard->loadDashBoard(gs.value, true);
6819  }
6820  }
6821  }
6822 
6823  // If none specified, load default dashboard layouts
6825  {
6826  if (m_actor->ar_driveable == TRUCK) // load default for a truck
6827  {
6828  if (App::gfx_speedo_digital->getBool())
6829  {
6830  if (App::gfx_speedo_imperial->getBool())
6831  {
6832  if (m_actor->ar_engine->getMaxRPM() > 3500)
6833  {
6834  m_actor->ar_dashboard->loadDashBoard("default_dashboard7000_mph.layout", false); //7000 rpm tachometer thanks to Klink
6835  m_actor->ar_dashboard->loadDashBoard("default_dashboard7000_mph.layout", true);
6836  }
6837  else
6838  {
6839  m_actor->ar_dashboard->loadDashBoard("default_dashboard3500_mph.layout", false);
6840  m_actor->ar_dashboard->loadDashBoard("default_dashboard3500_mph.layout", true);
6841  }
6842  }
6843  else
6844  {
6845  if (m_actor->ar_engine->getMaxRPM() > 3500)
6846  {
6847  m_actor->ar_dashboard->loadDashBoard("default_dashboard7000.layout", false); //7000 rpm tachometer thanks to Klink
6848  m_actor->ar_dashboard->loadDashBoard("default_dashboard7000.layout", true);
6849  }
6850  else
6851  {
6852  m_actor->ar_dashboard->loadDashBoard("default_dashboard3500.layout", false);
6853  m_actor->ar_dashboard->loadDashBoard("default_dashboard3500.layout", true);
6854  }
6855  }
6856  }
6857  else // Analog speedometer
6858  {
6859  if (App::gfx_speedo_imperial->getBool())
6860  {
6861  if (m_actor->ar_engine->getMaxRPM() > 3500)
6862  {
6863  m_actor->ar_dashboard->loadDashBoard("default_dashboard7000_analog_mph.layout", false); //7000 rpm tachometer thanks to Klink
6864  m_actor->ar_dashboard->loadDashBoard("default_dashboard7000_analog_mph.layout", true);
6865  }
6866  else
6867  {
6868  m_actor->ar_dashboard->loadDashBoard("default_dashboard3500_analog_mph.layout", false);
6869  m_actor->ar_dashboard->loadDashBoard("default_dashboard3500_analog_mph.layout", true);
6870  }
6871  }
6872  else
6873  {
6874  if (m_actor->ar_engine->getMaxRPM() > 3500)
6875  {
6876  m_actor->ar_dashboard->loadDashBoard("default_dashboard7000_analog.layout", false); //7000 rpm tachometer thanks to Klink
6877  m_actor->ar_dashboard->loadDashBoard("default_dashboard7000_analog.layout", true);
6878  }
6879  else
6880  {
6881  m_actor->ar_dashboard->loadDashBoard("default_dashboard3500_analog.layout", false);
6882  m_actor->ar_dashboard->loadDashBoard("default_dashboard3500_analog.layout", true);
6883  }
6884  }
6885  }
6886  }
6887  else if (m_actor->ar_driveable == BOAT)
6888  {
6889  m_actor->ar_dashboard->loadDashBoard("default_dashboard_boat.layout", false);
6890  m_actor->ar_dashboard->loadDashBoard("default_dashboard_boat.layout", true);
6891  }
6892  }
6893 
6894  m_actor->ar_dashboard->setVisible(false);
6895 
6896  if (!m_help_material_name.empty())
6897  {
6898  try
6899  {
6900  Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName(m_help_material_name, m_custom_resource_group);
6901  m_actor->m_gfx_actor->m_help_mat = mat;
6902  if (mat &&
6903  mat->getNumTechniques() > 0 &&
6904  mat->getTechnique(0)->getNumPasses() > 0 &&
6905  mat->getTechnique(0)->getPass(0)->getNumTextureUnitStates() > 0 &&
6906  mat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->getNumFrames() > 0)
6907  {
6908  m_actor->m_gfx_actor->m_help_tex =
6909  Ogre::TextureManager::getSingleton().getByName(
6910  mat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->getFrameTextureName(0), m_custom_resource_group);
6911  }
6912  }
6913  catch (Ogre::Exception& e)
6914  {
6916  "Failed to load `help` material '" + m_help_material_name + "', message:" + e.getFullDescription());
6917  }
6918  }
6919 
6921 }
6922 
6923 void ActorSpawner::ValidateRotator(int id, int axis1, int axis2, NodeNum_t *nodes1, NodeNum_t *nodes2)
6924 {
6925  const float eps = 0.001f;
6926  const Ogre::Vector3 ax1 = m_actor->ar_nodes[axis1].AbsPosition;
6927  const Ogre::Vector3 ax2 = m_actor->ar_nodes[axis2].AbsPosition;
6928  Ogre::Plane pl = Ogre::Plane((ax1 - ax2).normalisedCopy(), 0);
6929 
6930  Ogre::Vector3 a1 = pl.projectVector(ax1 - m_actor->ar_nodes[nodes1[0]].AbsPosition);
6931  Ogre::Vector3 a2 = pl.projectVector(ax1 - m_actor->ar_nodes[nodes1[1]].AbsPosition);
6932  Ogre::Vector3 a3 = pl.projectVector(ax1 - m_actor->ar_nodes[nodes1[2]].AbsPosition);
6933  Ogre::Vector3 a4 = pl.projectVector(ax1 - m_actor->ar_nodes[nodes1[3]].AbsPosition);
6934  float a1len = a1.normalise();
6935  float a2len = a2.normalise();
6936  float a3len = a3.normalise();
6937  float a4len = a4.normalise();
6938  if ((std::max(a1len, a3len) / std::min(a1len, a3len) > 1.f + eps) ||
6939  (std::max(a2len, a4len) / std::min(a2len, a4len) > 1.f + eps))
6940  {
6941  Ogre::String msg = Ogre::StringUtil::format("Off-centered axis on base plate of rotator %d", id);
6943  }
6944 
6945  Ogre::Vector3 b1 = pl.projectVector(ax2 - m_actor->ar_nodes[nodes2[0]].AbsPosition);
6946  Ogre::Vector3 b2 = pl.projectVector(ax2 - m_actor->ar_nodes[nodes2[1]].AbsPosition);
6947  Ogre::Vector3 b3 = pl.projectVector(ax2 - m_actor->ar_nodes[nodes2[2]].AbsPosition);
6948  Ogre::Vector3 b4 = pl.projectVector(ax2 - m_actor->ar_nodes[nodes2[3]].AbsPosition);
6949  float b1len = b1.normalise();
6950  float b2len = b2.normalise();
6951  float b3len = b3.normalise();
6952  float b4len = b4.normalise();
6953  if ((std::max(b1len, b3len) / std::min(b1len, b3len) > 1.f + eps) ||
6954  (std::max(b2len, b4len) / std::min(b2len, b4len) > 1.f + eps))
6955  {
6956  Ogre::String msg = Ogre::StringUtil::format("Off-centered axis on rotating plate of rotator %d", id);
6958  }
6959 
6960  float rot1 = a1.dotProduct(b1);
6961  float rot2 = a2.dotProduct(b2);
6962  float rot3 = a3.dotProduct(b3);
6963  float rot4 = a4.dotProduct(b4);
6964  if ((std::max(rot1, rot2) / std::min(rot1, rot2) > 1.f + eps) ||
6965  (std::max(rot2, rot3) / std::min(rot2, rot3) > 1.f + eps) ||
6966  (std::max(rot3, rot4) / std::min(rot3, rot4) > 1.f + eps) ||
6967  (std::max(rot4, rot1) / std::min(rot4, rot1) > 1.f + eps))
6968  {
6969  Ogre::String msg = Ogre::StringUtil::format("Misaligned plates on rotator %d", id);
6971  }
6972 }
6973 
6974 Ogre::ManualObject* CreateVideocameraDebugMesh()
6975 {
6976  // Create material
6977  static size_t counter = 0;
6978  Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().create(
6979  "VideoCamDebugMat-" + TOSTRING(counter), Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
6980  ++counter;
6981  mat->getTechnique(0)->getPass(0)->createTextureUnitState();
6982  mat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureFiltering(Ogre::TFO_ANISOTROPIC);
6983  mat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureAnisotropy(3);
6984  mat->setLightingEnabled(false);
6985  mat->setReceiveShadows(false);
6986  // Create mesh
6987  Ogre::ManualObject* mo = App::GetGfxScene()->GetSceneManager()->createManualObject(); // TODO: Eliminate gEnv
6988  mo->begin(mat->getName(), Ogre::RenderOperation::OT_LINE_LIST);
6989  Ogre::ColourValue pos_mark_col(1.f, 0.82f, 0.26f);
6990  Ogre::ColourValue dir_mark_col(0.f, 1.f, 1.f); // TODO: This comes out green in simulation - why? ~ only_a_ptr, 05/2017
6991  const float pos_mark_len = 0.8f;
6992  const float dir_mark_len = 4.f;
6993  // X
6994  mo->position(pos_mark_len,0,0);
6995  mo->colour(pos_mark_col);
6996  mo->position(-pos_mark_len,0,0);
6997  mo->colour(pos_mark_col);
6998  // Y
6999  mo->position(0,pos_mark_len,0);
7000  mo->colour(pos_mark_col);
7001  mo->position(0,-pos_mark_len,0);
7002  mo->colour(pos_mark_col);
7003  // +Z
7004  mo->position(0,0,pos_mark_len);
7005  mo->colour(pos_mark_col);
7006  mo->position(0,0,0);
7007  mo->colour(pos_mark_col);
7008  // -Z = the direction
7009  mo->position(0,0,-dir_mark_len);
7010  mo->colour(dir_mark_col);
7011  mo->position(0,0,0);
7012  mo->colour(dir_mark_col);
7013  mo->end(); // Don't forget this!
7014 
7015  return mo;
7016 }
7017 
7019 {
7020  try
7021  {
7022  RoR::VideoCamera vcam;
7023 
7025  if (vcam.vcam_material.isNull())
7026  {
7027  this->AddMessage(Message::TYPE_ERROR, "Failed to create VideoCamera with material: " + def->material_name);
7028  return;
7029  }
7030 
7031  switch (def->camera_role)
7032  {
7033  case -1: vcam.vcam_type = VCTYPE_VIDEOCAM; break;
7034  case 0: vcam.vcam_type = VCTYPE_TRACKING_VIDEOCAM; break;
7035  case 1: vcam.vcam_type = VCTYPE_MIRROR; break;
7036  default:
7037  this->AddMessage(Message::TYPE_ERROR, "VideoCamera (mat: " + def->material_name + ") has invalid 'role': " + TOSTRING(def->camera_role));
7038  return;
7039  }
7040 
7042  vcam.vcam_node_dir_y = this->GetNodeIndexOrThrow(def->bottom_node);
7043  vcam.vcam_node_dir_z = this->GetNodeIndexOrThrow(def->left_node);
7044  vcam.vcam_pos_offset = def->offset;
7045 
7046  //rotate camera picture 180 degrees, skip for mirrors
7047  float rotation_z = (def->camera_role != 1) ? def->rotation.z + 180 : def->rotation.z;
7048  vcam.vcam_rotation
7049  = Ogre::Quaternion(Ogre::Degree(rotation_z), Ogre::Vector3::UNIT_Z)
7050  * Ogre::Quaternion(Ogre::Degree(def->rotation.y), Ogre::Vector3::UNIT_Y)
7051  * Ogre::Quaternion(Ogre::Degree(def->rotation.x), Ogre::Vector3::UNIT_X);
7052 
7053  // set alternative camposition (optional)
7055  {
7057  }
7058  else
7059  {
7060  vcam.vcam_node_alt_pos = vcam.vcam_node_center;
7061  }
7062 
7063  // set alternative lookat position (optional)
7065  {
7066  // This is a tracker camera
7069  }
7070 
7071  // TODO: Eliminate gEnv
7072  vcam.vcam_ogre_camera = App::GetGfxScene()->GetSceneManager()->createCamera(vcam.vcam_material->getName() + "_camera");
7073 
7074  if (!App::gfx_window_videocams->getBool())
7075  {
7076  vcam.vcam_render_tex = Ogre::TextureManager::getSingleton().createManual(
7077  vcam.vcam_material->getName() + "_texture",
7078  Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
7079  Ogre::TEX_TYPE_2D,
7080  def->texture_width,
7081  def->texture_height,
7082  0, // no mip maps
7083  Ogre::PF_R8G8B8,
7084  Ogre::TU_RENDERTARGET);
7085  vcam.vcam_render_target = vcam.vcam_render_tex->getBuffer()->getRenderTarget();
7086  vcam.vcam_render_target->setAutoUpdated(false);
7087  }
7088  else
7089  {
7090  const std::string window_name = (!def->camera_name.empty()) ? def->camera_name : def->material_name;
7092  vcam.vcam_render_window->setAutoUpdated(false);
7093  vcam.vcam_render_window->setDeactivateOnFocusChange(false);
7094 
7095  // TODO: disable texture mirrors
7096  }
7097 
7098  vcam.vcam_ogre_camera->setNearClipDistance(def->min_clip_distance);
7099  vcam.vcam_ogre_camera->setFarClipDistance(def->max_clip_distance);
7100  vcam.vcam_ogre_camera->setFOVy(Ogre::Degree(def->field_of_view));
7101  const float aspect_ratio = static_cast<float>(def->texture_width) / static_cast<float>(def->texture_height);
7102  vcam.vcam_ogre_camera->setAspectRatio(aspect_ratio);
7103  vcam.vcam_material->getTechnique(0)->getPass(0)->setLightingEnabled(false);
7104  vcam.vcam_off_tex_name = "Chrome.dds"; // Built-in gray texture
7105 
7106  if (vcam.vcam_render_target)
7107  {
7108  Ogre::Viewport* vp = vcam.vcam_render_target->addViewport(vcam.vcam_ogre_camera);
7109  vp->setClearEveryFrame(true);
7110  vp->setBackgroundColour(App::GetCameraManager()->GetCamera()->getViewport()->getBackgroundColour());
7111  vp->setVisibilityMask(~HIDE_MIRROR);
7112  vp->setVisibilityMask(~DEPTHMAP_DISABLED);
7113  vp->setOverlaysEnabled(false);
7114 
7115  vcam.vcam_material->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName(vcam.vcam_render_tex->getName());
7116 
7117  // this is a mirror, flip the image left<>right to have a mirror and not a cameraimage
7118  if (def->camera_role == 1)
7119  vcam.vcam_material->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureUScale(-1);
7120  }
7121 
7122  if (vcam.vcam_render_window)
7123  {
7124  Ogre::Viewport* vp = vcam.vcam_render_window->addViewport(vcam.vcam_ogre_camera);
7125  vp->setClearEveryFrame(true);
7126  vp->setBackgroundColour(App::GetCameraManager()->GetCamera()->getViewport()->getBackgroundColour());
7127  vp->setVisibilityMask(~HIDE_MIRROR);
7128  vp->setVisibilityMask(~DEPTHMAP_DISABLED);
7129  vp->setOverlaysEnabled(false);
7130  vcam.vcam_material->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName(vcam.vcam_off_tex_name);
7131  }
7132 
7133  if (App::diag_videocameras->getBool())
7134  {
7135  Ogre::ManualObject* mo = CreateVideocameraDebugMesh(); // local helper function
7136  vcam.vcam_debug_node = App::GetGfxScene()->GetSceneManager()->getRootSceneNode()->createChildSceneNode(
7137  this->ComposeName("debug @ videocamera", (int)m_actor->m_gfx_actor->m_videocameras.size()));
7138  vcam.vcam_debug_node->attachObject(mo);
7139  }
7140 
7141  m_actor->m_gfx_actor->m_videocameras.push_back(vcam);
7142  }
7143  catch (std::exception & ex)
7144  {
7145  this->AddMessage(Message::TYPE_ERROR, ex.what());
7146  }
7147  catch (...)
7148  {
7149  this->AddMessage(Message::TYPE_ERROR, "An unknown exception has occured");
7150  }
7151 }
7152 
7154  Ogre::MaterialPtr custom_mat, CustomMaterial::MirrorPropType type, Ogre::SceneNode* prop_scenenode)
7155 {
7156  static int mprop_counter = 0;
7157  try
7158  {
7159  // Prepare videocamera entry
7160  RoR::VideoCamera vcam;
7161  vcam.vcam_off_tex_name = "mirror.dds";
7162  vcam.vcam_prop_scenenode = prop_scenenode;
7163  switch (type)
7164  {
7167  break;
7168 
7171  break;
7172 
7173  default:
7174  this->AddMessage(Message::TYPE_ERROR, "Cannot create mirror prop of type 'MPROP_NONE'");
7175  return;
7176  }
7177 
7178  // Create rendering texture
7179  vcam.vcam_render_tex = Ogre::TextureManager::getSingleton().createManual(
7180  this->ComposeName("texture @ mirror", mprop_counter)
7182  , Ogre::TEX_TYPE_2D
7183  , 128
7184  , 256
7185  , 0
7186  , Ogre::PF_R8G8B8
7187  , Ogre::TU_RENDERTARGET);
7188 
7189  // Create OGRE camera
7190  vcam.vcam_ogre_camera = App::GetGfxScene()->GetSceneManager()->createCamera(this->ComposeName("camera @ mirror prop", mprop_counter));
7191  vcam.vcam_ogre_camera->setNearClipDistance(0.2f);
7192  vcam.vcam_ogre_camera->setFarClipDistance(App::GetCameraManager()->GetCamera()->getFarClipDistance());
7193  vcam.vcam_ogre_camera->setFOVy(Ogre::Degree(50));
7194  vcam.vcam_ogre_camera->setAspectRatio(
7195  (App::GetCameraManager()->GetCamera()->getViewport()->getActualWidth() / App::GetCameraManager()->GetCamera()->getViewport()->getActualHeight()) / 2.0f);
7196 
7197  // Setup rendering
7198  vcam.vcam_render_target = vcam.vcam_render_tex->getBuffer()->getRenderTarget();
7199  vcam.vcam_render_target->setActive(true);
7200  Ogre::Viewport* v = vcam.vcam_render_target->addViewport(vcam.vcam_ogre_camera);
7201  v->setClearEveryFrame(true);
7202  v->setBackgroundColour(App::GetCameraManager()->GetCamera()->getViewport()->getBackgroundColour());
7203  v->setOverlaysEnabled(false);
7204 
7205  // Setup material
7206  vcam.vcam_material = custom_mat;
7207  vcam.vcam_material->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName(vcam.vcam_render_tex->getName());
7208  vcam.vcam_material->getTechnique(0)->getPass(0)->setLightingEnabled(false);
7209 
7210  // Submit the videocamera
7211  m_actor->m_gfx_actor->m_videocameras.push_back(vcam);
7212  }
7213  catch (std::exception & ex)
7214  {
7215  this->AddMessage(Message::TYPE_ERROR, ex.what());
7216  }
7217  catch (...)
7218  {
7219  this->AddMessage(Message::TYPE_ERROR, "An unknown exception has occured");
7220  }
7221  ++mprop_counter;
7222 }
7223 
7225 {
7226  try { throw; } // Rethrow
7227 
7228  catch (Ogre::Exception& ogre_e)
7229  {
7230  // Add the message silently, OGRE already printed it to RoR.log
7231  RoR::Str<2000> txt;
7232  txt << "(Keyword: " << RigDef::KeywordToString(m_current_keyword)
7233  << ") " << ogre_e.getFullDescription();
7236  }
7237  catch (std::exception& std_e)
7238  {
7239  this->AddMessage(Message::TYPE_ERROR, std_e.what());
7240  }
7241  catch (...)
7242  {
7243  this->AddMessage(Message::TYPE_ERROR, "An unknown exception has occurred");
7244  }
7245 }
7246 
7247 Ogre::ParticleSystem* ActorSpawner::CreateParticleSystem(std::string const & name, std::string const & template_name)
7248 {
7249  // None of `Ogre::SceneManager::createParticleSystem()` overloads
7250  // lets us specify both resource group and template name.
7251 
7252  Ogre::NameValuePairList params;
7253  params["resourceGroup"] = m_custom_resource_group;
7254  params["templateName"] = template_name;
7255 
7256  Ogre::MovableObject* obj = App::GetGfxScene()->GetSceneManager()->createMovableObject(
7257  name, Ogre::ParticleSystemFactory::FACTORY_TYPE_NAME, &params);
7258  Ogre::ParticleSystem* psys = static_cast<Ogre::ParticleSystem*>(obj);
7259  psys->setVisibilityFlags(DEPTHMAP_DISABLED); // disable particles in depthmap
7260  return psys;
7261 }
7262 
7264 {
7267 
7268  //the cab materials are as follow:
7269  //texname: base texture with emissive(2 pass) or without emissive if none available(1 pass), alpha cutting
7270  //texname-trans: transparency texture (1 pass)
7271  //texname-back: backface texture: black+alpha cutting (1 pass)
7272  //texname-noem: base texture without emissive (1 pass), alpha cutting
7273 
7274  //material passes must be:
7275  //0: normal texture
7276  //1: transparent (windows)
7277  //2: emissive
7278 
7279  Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName(m_cab_material_name);
7280  if (mat.isNull())
7281  {
7282  Ogre::String msg = "Material '"+m_cab_material_name+"' missing!";
7284  return;
7285  }
7286 
7287  //-trans
7288  char transmatname[256];
7289  static int trans_counter = 0;
7290  sprintf(transmatname, "%s-trans-%d", m_cab_material_name.c_str(), trans_counter++);
7291  Ogre::MaterialPtr transmat=mat->clone(transmatname);
7292  if (mat->getTechnique(0)->getNumPasses()>1) // If there's the "emissive pass", remove it from the 'transmat'
7293  {
7294  transmat->getTechnique(0)->removePass(1);
7295  }
7296  transmat->getTechnique(0)->getPass(0)->setAlphaRejectSettings(Ogre::CMPF_LESS_EQUAL, 128);
7297  transmat->getTechnique(0)->getPass(0)->setDepthWriteEnabled(false);
7298  if (transmat->getTechnique(0)->getPass(0)->getNumTextureUnitStates()>0)
7299  {
7300  transmat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureFiltering(Ogre::TFO_NONE);
7301  }
7302  transmat->compile();
7303  m_cab_trans_material = transmat;
7304 
7305  //-back
7306  char backmatname[256];
7307  static int back_counter = 0;
7308  sprintf(backmatname, "%s-back-%d", m_cab_material_name.c_str(), back_counter++);
7309  Ogre::MaterialPtr backmat=mat->clone(backmatname);
7310  if (mat->getTechnique(0)->getNumPasses()>1)// If there's the "emissive pass", remove it from the 'transmat'
7311  {
7312  backmat->getTechnique(0)->removePass(1);
7313  }
7314  if (transmat->getTechnique(0)->getPass(0)->getNumTextureUnitStates()>0)
7315  {
7316  backmat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setColourOperationEx(
7317  Ogre::LBX_SOURCE1,
7318  Ogre::LBS_MANUAL,
7319  Ogre::LBS_MANUAL,
7320  Ogre::ColourValue(0,0,0),
7321  Ogre::ColourValue(0,0,0)
7322  );
7323  }
7324  if (App::gfx_reduce_shadows->getBool())
7325  {
7326  backmat->setReceiveShadows(false);
7327  }
7328  backmat->compile();
7329 
7330  m_actor->GetGfxActor()->UpdateSimDataBuffer(); // fill all current nodes - needed to setup flexing meshes
7331 
7332  char cab_material_name_cstr[1000] = {};
7333  strncpy(cab_material_name_cstr, m_cab_material_name.c_str(), 999);
7334  std::string mesh_name = this->ComposeName("mesh @ cab");
7335  FlexObj* cab_mesh =new FlexObj(
7336  m_actor->m_gfx_actor.get(),
7337  m_actor->ar_nodes,
7340  m_actor->ar_cabs,
7342  cab_material_name_cstr,
7343  mesh_name.c_str(),
7344  backmatname,
7345  transmatname
7346  );
7347 
7348  Ogre::SceneNode* cab_scene_node = m_actor_grouping_scenenode->createChildSceneNode(this->ComposeName("cab"));
7349  Ogre::Entity *ec = nullptr;
7350  try
7351  {
7352  ec = App::GetGfxScene()->GetSceneManager()->createEntity(this->ComposeName("entity @ cab"), mesh_name);
7353  this->SetupNewEntity(ec, Ogre::ColourValue(0.5, 1, 0.5));
7354  if (ec)
7355  {
7356  cab_scene_node->attachObject(ec);
7357  }
7358 
7359  // Process "emissive cab" materials
7360  auto search_itor = m_material_substitutions.find(m_cab_material_name);
7361  if (search_itor != m_material_substitutions.end())
7362  {
7363  m_actor->m_gfx_actor->RegisterCabMaterial(search_itor->second.material, m_cab_trans_material);
7364  }
7365  m_actor->m_gfx_actor->SetCabLightsActive(false); // Reset emissive lights to "off" state
7366 
7367  m_actor->GetGfxActor()->RegisterCabMesh(ec, cab_scene_node, cab_mesh);
7368  }
7369  catch (Ogre::Exception& e)
7370  {
7371  this->AddMessage(Message::TYPE_ERROR, "error creating cab mesh: "+e.getFullDescription());
7372  if (ec)
7373  {
7374  App::GetGfxScene()->GetSceneManager()->destroyEntity(ec);
7375  }
7376  }
7377 }
7378 
7379 void ActorSpawner::CreateMaterialFlare(int flareid, Ogre::MaterialPtr m)
7380 {
7381  RoR::FlareMaterial binding;
7382  binding.flare_index = flareid;
7383  binding.mat_instance = m;
7384 
7385  if (m.isNull())
7386  return;
7387  Ogre::Technique* tech = m->getTechnique(0);
7388  if (!tech)
7389  return;
7390  Ogre::Pass* p = tech->getPass(0);
7391  if (!p)
7392  return;
7393  // save emissive colour and then set to zero (light disabled by default)
7394  binding.emissive_color = p->getSelfIllumination();
7395  p->setSelfIllumination(Ogre::ColourValue::ZERO);
7396 
7397  m_actor->m_gfx_actor->m_flare_materials.push_back(binding);
7398 }
7399 
7401 {
7402  // Media (Textures/Materials/meshes) can be either in AddonPart bundle or the vehicle bundle.
7403  // =========================================================================================
7404 
7405  if (m_current_module->origin_addonpart)
7406  {
7407  return m_current_module->origin_addonpart->resource_group;
7408  }
7409  else
7410  {
7412  }
7413 }
7414 
7415 void ActorSpawner::AssignManagedMaterialTexture(Ogre::TextureUnitState* tus, const std::string & mm_name, int media_id, const std::string& tex_name)
7416 {
7417  // Helper for `ProcessManagedMaterial()`, resolves tweaks
7418  // ======================================================
7419 
7420  try
7421  {
7422  ROR_ASSERT(tus);
7423  if (tus)
7424  {
7425  Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton().load(
7426  TuneupUtil::getTweakedManagedMatMedia(m_actor->getWorkingTuneupDef(), mm_name, media_id, tex_name),
7427  TuneupUtil::getTweakedManagedMatMediaRG(m_actor->getWorkingTuneupDef(), mm_name, media_id, this->GetCurrentElementMediaRG()));
7428 
7429  if (tex)
7430  {
7431  tus->setTexture(tex);
7432  }
7433  }
7434  }
7435  catch (...) // Exception is already logged by OGRE
7436  {
7437  }
7438 }
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
ROR_ASSERT
#define ROR_ASSERT(_EXPR)
Definition: Application.h:40
GameContext.h
Game state manager and message-queue provider.
RoR::node_t::nd_coll_bbox_id
int16_t nd_coll_bbox_id
Optional attribute (-1 = none) - multiple collision bounding boxes defined in truckfile.
Definition: SimData.h:305
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
RoR::Actor::ar_anim_previous_crank
float ar_anim_previous_crank
For 'animator' with flag 'torque'.
Definition: Actor.h:341
RoR::VCTYPE_MIRROR
@ VCTYPE_MIRROR
Definition: GfxData.h:224
RoR::AddonPartUtility::ResolveUnwantedAndTweakedElements
void ResolveUnwantedAndTweakedElements(TuneupDefPtr &tuneup, CacheEntryPtr &addonpart_entry)
Evaluates 'addonpart_unwanted_*' elements, respecting 'protected_*' directives in the tuneup.
Definition: AddonPartFileFormat.cpp:132
RoR::Autopilot::setInertialReferences
void setInertialReferences(node_t *refl, node_t *refr, node_t *refb, node_t *refc)
Definition: AutoPilot.cpp:82
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
RoR::ActorSpawner::ProcessWing
void ProcessWing(RigDef::Wing &def)
Definition: ActorSpawner.cpp:920
RoR::Actor::ar_nodes_name
std::string * ar_nodes_name
Name in truck file, only if defined with 'nodes2'.
Definition: Actor.h:275
RoR::flare_t::offsety
float offsety
Definition: SimData.h:621
MAX_COMMANDS
static const int MAX_COMMANDS
maximum number of commands per actor
Definition: SimConstants.h:28
RoR::TransferCase::tr_ax_2
int tr_ax_2
This axle is only driven in 4WD mode.
Definition: Differentials.h:50
RoR::wheel_t::wh_rim_nodes
node_t * wh_rim_nodes[50]
Definition: SimData.h:435
RoR::AirbrakeGfx::abx_ref_node
NodeNum_t abx_ref_node
Definition: GfxData.h:307
RoR::VCTYPE_VIDEOCAM
@ VCTYPE_VIDEOCAM
Definition: GfxData.h:222
RigDef::SpecialProp::AERO_PROP_SPIN
@ AERO_PROP_SPIN
RigDef::Command2::extend_key
unsigned int extend_key
Definition: RigDef_File.h:771
RoR::rope_t::rp_group
int rp_group
Definition: SimData.h:513
RoR::SL_COMMAND
@ SL_COMMAND
Definition: SoundScriptManager.h:160
RoR::CacheSystem::LoadAssetPack
void LoadAssetPack(CacheEntryPtr &t_dest, Ogre::String const &assetpack_filename)
Adds asset pack to the requesting cache entry's resource group.
Definition: CacheSystem.cpp:1263
RigDef::Shock2::spring_out
float spring_out
spring value applied when shock extending
Definition: RigDef_File.h:1212
RigDef::Animation::SOURCE_ANGLE_OF_ATTACK
static const BitMask64_t SOURCE_ANGLE_OF_ATTACK
Definition: RigDef_File.h:499
RigDef::Trigger::OPTION_c_COMMAND_STYLE
static const BitMask_t OPTION_c_COMMAND_STYLE
Definition: RigDef_File.h:1372
RoR::wing_t::fa
FlexAirfoil * fa
Definition: SimData.h:539
RoR::Actor::ar_collision_bounding_boxes
std::vector< Ogre::AxisAlignedBox > ar_collision_bounding_boxes
smart bounding boxes, used for determining the state of an actor (every box surrounds only a subset o...
Definition: Actor.h:310
RoR::rotator_t::nodes2
NodeNum_t nodes2[4]
Definition: SimData.h:603
RoR::ActorSpawner::m_current_module
std::shared_ptr< RigDef::Document::Module > m_current_module
For resolving addonparts.
Definition: ActorSpawner.h:482
RoR::Actor::cc_mode
bool cc_mode
Cruise Control.
Definition: Actor.h:358
RoR::VideoCamera::vcam_rotation
Ogre::Quaternion vcam_rotation
Definition: GfxData.h:239
RigDef::Animator::OPTION_PITCH
static const BitMask_t OPTION_PITCH
Definition: RigDef_File.h:569
RoR::SHOCK_FLAG_SOFTBUMP
@ SHOCK_FLAG_SOFTBUMP
Definition: SimData.h:202
RoR::PROP_ANIM_FLAG_AIRSPEED
const PropAnimFlag_t PROP_ANIM_FLAG_AIRSPEED
Definition: GfxData.h:44
RoR::ActorSpawner::CustomMaterial::MirrorPropType::MPROP_RIGHT
@ MPROP_RIGHT
RigDef::Hydro::OPTION_e_INPUT_ELEVATOR
static const BitMask_t OPTION_e_INPUT_ELEVATOR
Definition: RigDef_File.h:980
RoR::PROP_ANIM_FLAG_TORQUE
const PropAnimFlag_t PROP_ANIM_FLAG_TORQUE
Definition: GfxData.h:65
RoR::shock_t::last_debug_state
int last_debug_state
smart debug output
Definition: SimData.h:380
RigDef::FlexBodyWheel::rim_springiness
float rim_springiness
Definition: RigDef_File.h:912
RoR::Actor::ar_num_contactable_nodes
int ar_num_contactable_nodes
Total number of nodes which can contact ground or cabs.
Definition: Actor.h:315
RigDef::Shock3::beam_defaults
std::shared_ptr< BeamDefaults > beam_defaults
Definition: RigDef_File.h:1247
RoR::App::GetSoundScriptManager
SoundScriptManager * GetSoundScriptManager()
Definition: Application.cpp:277
RigDef::SpecialProp::DRIVER_SEAT
@ DRIVER_SEAT
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
RigDef::Animation::SOURCE_FLAP
static const BitMask64_t SOURCE_FLAP
Definition: RigDef_File.h:500
RoR::ANIM_FLAG_BRUDDER
@ ANIM_FLAG_BRUDDER
Definition: SimData.h:171
RigDef::Engoption::min_idle_mixture
float min_idle_mixture
Definition: RigDef_File.h:827
RoR::command_t::command_inertia
RoR::CmdKeyInertia command_inertia
Definition: SimData.h:585
RoR::PROP_ANIM_FLAG_SHIFTER
const PropAnimFlag_t PROP_ANIM_FLAG_SHIFTER
'shifterman1, shifterman2, sequential, shifterlin, autoshifterlin'; animOpt3: see RoR::ShifterPropAni...
Definition: GfxData.h:61
RigDef::Animation::SOURCE_VERTICAL_VELOCITY
static const BitMask64_t SOURCE_VERTICAL_VELOCITY
Definition: RigDef_File.h:495
RoR::Actor::m_odometer_user
float m_odometer_user
GUI state.
Definition: Actor.h:576
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::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
RoR::node_t::nd_contacter
bool nd_contacter
Attr; User-defined.
Definition: SimData.h:312
RoR::soundsource_t::ssi
SoundScriptInstancePtr ssi
Definition: SimData.h:416
RigDef::WheelBraking::FOOT_ONLY
@ FOOT_ONLY
RoR::SHOCK3
@ SHOCK3
shock3
Definition: SimData.h:110
RoR::Actor::ar_main_camera_node_pos
NodeNum_t ar_main_camera_node_pos
Sim attr; ar_camera_node_pos[0] >= 0 ? ar_camera_node_pos[0] : 0.
Definition: Actor.h:382
RoR::Actor::ar_vehicle_ai
VehicleAIPtr ar_vehicle_ai
Definition: Actor.h:391
RoR::ActorSpawner::CheckSubmeshLimit
bool CheckSubmeshLimit(unsigned int count)
Definition: ActorSpawner.cpp:6153
RoR::PropAnim::upper_limit
float upper_limit
The upper limit for the animation.
Definition: GfxData.h:153
RigDef::VideoCamera::left_node
Node::Ref left_node
Definition: RigDef_File.h:1422
RigDef::Beam::extension_break_limit
float extension_break_limit
Definition: RigDef_File.h:634
RoR::WheelGfx::wx_side
WheelSide wx_side
Definition: GfxData.h:297
RigDef::Turboprop2::blade_tip_nodes
Node::Ref blade_tip_nodes[4]
Definition: RigDef_File.h:1411
RoR::Airbrake::nodex
node_t * nodex
Definition: AirBrake.h:51
RoR::rotator_t::rate
float rate
Definition: SimData.h:607
RigDef::Cab::OPTION_p_10xTOUGHER
static const BitMask_t OPTION_p_10xTOUGHER
Definition: RigDef_File.h:713
RoR::CacheEntry::dname
Ogre::String dname
name parsed from the file
Definition: CacheSystem.h:70
RigDef::BaseWheel2::rim_radius
float rim_radius
Definition: RigDef_File.h:435
RigDef::Wheel
Definition: RigDef_File.h:1439
RoR::Actor::m_slidenodes
std::vector< SlideNode > m_slidenodes
all the SlideNodes available on this actor
Definition: Actor.h:534
RigDef::CameraRail::nodes
std::vector< Node::Ref > nodes
Definition: RigDef_File.h:734
RoR::ActorSpawner::ActorMemoryRequirements::num_rotators
size_t num_rotators
Definition: ActorSpawner.h:81
RoR::exhaust_t::directionNode
NodeNum_t directionNode
Definition: SimData.h:641
RoR::PROP_ANIM_MODE_OFFSET_X
const PropAnimMode_t PROP_ANIM_MODE_OFFSET_X
Definition: GfxData.h:85
RoR::ActorSpawner::ProcessHook
void ProcessHook(RigDef::Hook &def)
Definition: ActorSpawner.cpp:3187
RigDef::SlideNode::_railgroup_id_set
bool _railgroup_id_set
Definition: RigDef_File.h:1273
RigDef::GuiSettings
Definition: RigDef_File.h:942
RoR::App::gfx_speedo_imperial
CVar * gfx_speedo_imperial
Definition: Application.cpp:246
RoR::commandbeam_t::cmb_is_force_restricted
bool cmb_is_force_restricted
Attribute defined in truckfile.
Definition: SimData.h:564
RigDef::SlideNode::tolerance
float tolerance
Definition: RigDef_File.h:1271
RoR::ANIM_FLAG_ACCEL
@ ANIM_FLAG_ACCEL
Definition: SimData.h:153
RigDef::Turboprop2::axis_node
Node::Ref axis_node
Definition: RigDef_File.h:1410
RigDef::Animation::MotorSource::SOURCE_AERO_TORQUE
static const BitMask_t SOURCE_AERO_TORQUE
Definition: RigDef_File.h:483
RoR::ActorSpawner::AddSoundSource
static void AddSoundSource(ActorPtr const &vehicle, SoundScriptInstancePtr sound_script, NodeNum_t node_index, int type=-2)
Definition: ActorSpawner.cpp:1186
RoR::wing_t::cnode
Ogre::SceneNode * cnode
Definition: SimData.h:540
RoR::Actor::ar_camera_node_dir
NodeNum_t ar_camera_node_dir[MAX_CAMERAS]
Physics attr; 'camera' = frame of reference; back node.
Definition: Actor.h:386
RoR::shock_t::dslowin
float dslowin
shocks3
Definition: SimData.h:393
RoR::hook_t::hk_timer
float hk_timer
Definition: SimData.h:488
RoR::Airbrake::snode
Ogre::SceneNode * snode
Definition: AirBrake.h:49
RoR::ActorSpawner::ProcessHydro
void ProcessHydro(RigDef::Hydro &def)
Definition: ActorSpawner.cpp:3902
RoR::FlareType::REVERSE_LIGHT
@ REVERSE_LIGHT
y
float y
Definition: (ValueTypes) quaternion.h:6
RigDef::Rope::beam_defaults
std::shared_ptr< BeamDefaults > beam_defaults
Definition: RigDef_File.h:1137
RigDef::Flexbody::camera_settings
CameraSettings camera_settings
Definition: RigDef_File.h:906
RoR::EngineSim::getMaxRPM
float getMaxRPM() const
Definition: EngineSim.h:97
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
RoR::SHIFTERLIN
@ SHIFTERLIN
Definition: GfxData.h:134
RigDef::InterAxle::a2
int a2
Definition: RigDef_File.h:1002
RigDef::Node::Ref
Legacy parser resolved references on-the-fly and the condition to check named nodes was "are there an...
Definition: RigDef_Node.h:77
RoR::ActorSpawner::m_current_keyword
RigDef::Keyword m_current_keyword
For error reports.
Definition: ActorSpawner.h:481
RigDef::Command2::inertia_defaults
std::shared_ptr< Inertia > inertia_defaults
Definition: RigDef_File.h:778
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
RoR::Prop::pp_camera_mode_orig
CameraMode_t pp_camera_mode_orig
Dynamic visibility mode {0 and higher = cinecam index}.
Definition: GfxData.h:180
RoR::PROP_ANIM_FLAG_AIRBRAKE
const PropAnimFlag_t PROP_ANIM_FLAG_AIRBRAKE
Definition: GfxData.h:49
RigDef::Prop
Definition: RigDef_File.h:1078
RigDef::WheelDetacher::wheel_id
int wheel_id
Definition: RigDef_File.h:1458
RoR::node_t::nd_immovable
bool nd_immovable
Attr; User-defined.
Definition: SimData.h:316
RoR::HYDRO_FLAG_DIR
@ HYDRO_FLAG_DIR
Definition: SimData.h:132
PARSEREAL
#define PARSEREAL(x)
Definition: Application.h:58
RoR::PROP_ANIM_FLAG_AOA
const PropAnimFlag_t PROP_ANIM_FLAG_AOA
Definition: GfxData.h:47
FlexMeshWheel.h
RoR::ActorSpawner::ProcessSubmesh
void ProcessSubmesh(RigDef::Submesh &def)
Definition: ActorSpawner.cpp:1334
RoR::Actor::ar_buoycabs
int ar_buoycabs[MAX_CABS]
Definition: Actor.h:334
RigDef::Tie::group
int group
Definition: RigDef_File.h:1327
RoR::ActorSpawner::ProcessGlobals
void ProcessGlobals(RigDef::Globals &def)
Definition: ActorSpawner.cpp:6101
RigDef::Animator::OPTION_SHIFT_BACK_FORTH
static const BitMask_t OPTION_SHIFT_BACK_FORTH
Definition: RigDef_File.h:578
RoR::ActorSpawner::m_custom_resource_group
std::string m_custom_resource_group
Definition: ActorSpawner.h:461
RoR::flare_t::bbs
Ogre::BillboardSet * bbs
This remains nullptr if removed via addonpart_unwanted_flare or Tuning UI.
Definition: SimData.h:624
RigDef::Hydro::inertia_defaults
std::shared_ptr< Inertia > inertia_defaults
Definition: RigDef_File.h:994
RigDef::Prop::offset
Ogre::Vector3 offset
Definition: RigDef_File.h:1109
NODE_FRICTION_COEF_DEFAULT
static const float NODE_FRICTION_COEF_DEFAULT
Definition: SimConstants.h:67
RigDef::Camera::left_node
Node::Ref left_node
Definition: RigDef_File.h:729
RigDef::Animation::SOURCE_AUTOSHIFTERLIN
static const BitMask64_t SOURCE_AUTOSHIFTERLIN
Definition: RigDef_File.h:528
RoR::BeamType
BeamType
Definition: SimData.h:69
RigDef::Engine::neutral_gear_ratio
float neutral_gear_ratio
Definition: RigDef_File.h:812
RoR::ActorSpawner::ProcessFlare2
void ProcessFlare2(RigDef::Flare2 &def)
Definition: ActorSpawner.cpp:2126
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
RoR::rope_t::rp_beam
beam_t * rp_beam
Definition: SimData.h:514
RigDef::Animation::MotorSource::SOURCE_AERO_PITCH
static const BitMask_t SOURCE_AERO_PITCH
Definition: RigDef_File.h:484
RigDef::Cinecam::position
Ogre::Vector3 position
Definition: RigDef_File.h:744
RoR::Actor::m_fusealge_back
node_t * m_fusealge_back
Physics attr; defined in truckfile.
Definition: Actor.h:573
RoR::Actor::ar_inter_collcabrate
collcab_rate_t ar_inter_collcabrate[MAX_CABS]
Definition: Actor.h:331
RoR::ActorSpawner::GetBeam
beam_t & GetBeam(unsigned int index)
Definition: ActorSpawner.cpp:6243
RoR::Actor::ar_extern_camera_node
NodeNum_t ar_extern_camera_node
Definition: Actor.h:367
RigDef::Cinecam::node_defaults
std::shared_ptr< NodeDefaults > node_defaults
Definition: RigDef_File.h:750
RoR::FlareType::BLINKER_LEFT
@ BLINKER_LEFT
RigDef::VideoCamera::min_clip_distance
float min_clip_distance
Definition: RigDef_File.h:1431
RoR::shock_t::dprogout
float dprogout
shocks2
Definition: SimData.h:390
RoR::ActorSpawner::ProcessRope
void ProcessRope(RigDef::Rope &def)
Definition: ActorSpawner.cpp:2944
RoR::flare_t::size
float size
Definition: SimData.h:632
RigDef::Animation::lower_limit
float lower_limit
Definition: RigDef_File.h:545
RigDef::Wing::control_surface
WingControlSurface control_surface
Definition: RigDef_File.h:1466
RoR::ActorSpawner::CheckCameraRailLimit
bool CheckCameraRailLimit(unsigned int count)
Definition: ActorSpawner.cpp:6202
RoR::GfxActor::UpdateSimDataBuffer
void UpdateSimDataBuffer()
Copies sim. data from Actor to GfxActor for later update.
Definition: GfxActor.cpp:1727
RoR::TRUCK
@ TRUCK
its a truck (or other land vehicle)
Definition: SimData.h:93
RoR::Actor::ar_extern_camera_mode
ExtCameraMode ar_extern_camera_mode
Definition: Actor.h:366
RigDef::Rotator::needs_engine
bool needs_engine
Definition: RigDef_File.h:1152
RoR::ropable_t::multilock
bool multilock
Attribute.
Definition: SimData.h:504
RigDef::Shock2::OPTION_s_SOFT_BUMP_BOUNDS
static const BitMask_t OPTION_s_SOFT_BUMP_BOUNDS
Definition: RigDef_File.h:1203
RigDef::CollisionRange
Definition: RigDef_File.h:758
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
RoR::BeamGfx
Visuals of softbody beam (beam_t struct); Partially updated along with SimBuffer.
Definition: GfxData.h:276
RigDef::TractionControl::attr_no_dashboard
bool attr_no_dashboard
Definition: RigDef_File.h:1356
RoR::VideoCamera::vcam_material
Ogre::MaterialPtr vcam_material
Definition: GfxData.h:241
RoR::SimpleInertia::SetSimpleDelay
void SetSimpleDelay(RoR::CmdKeyInertiaConfig &cfg, float start_delay, float stop_delay, std::string start_function, std::string stop_function)
Definition: CmdKeyInertia.cpp:189
RoR::AppContext::CreateCustomRenderWindow
Ogre::RenderWindow * CreateCustomRenderWindow(std::string const &name, int width, int height)
Definition: AppContext.cpp:390
RoR::ActorSpawner::ProcessSoundSource
void ProcessSoundSource(RigDef::SoundSource &def)
Definition: ActorSpawner.cpp:1204
RoR::AirbrakeGfx::abx_mesh
Ogre::MeshPtr abx_mesh
Definition: GfxData.h:303
RigDef::Inertia::start_function
Ogre::String start_function
Definition: RigDef_File.h:450
RigDef::Engturbo
Definition: RigDef_File.h:831
MAX_CLIGHTS
static const int MAX_CLIGHTS
See RoRnet::Lightmask and enum events in InputEngine.h.
Definition: SimConstants.h:35
RigDef::VideoCamera::texture_width
unsigned int texture_width
Definition: RigDef_File.h:1429
RoR::FlexAirfoil::nfld
NodeNum_t nfld
Definition: FlexAirfoil.h:59
RigDef::Flare2::type
RoR::FlareType type
Definition: RigDef_File.h:882
RoR::HYDRO_FLAG_REV_AILERON
@ HYDRO_FLAG_REV_AILERON
Definition: SimData.h:136
RoR::Actor::alb_pulse_time
float alb_pulse_time
Anti-lock brake attribute;.
Definition: Actor.h:345
RoR::SHOCK_FLAG_TRG_BLOCKER_A
@ SHOCK_FLAG_TRG_BLOCKER_A
Definition: SimData.h:207
RoR::HYDRO_FLAG_SPEED
@ HYDRO_FLAG_SPEED
Definition: SimData.h:131
RigDef::Animator::long_limit
float long_limit
Definition: RigDef_File.h:592
RoR::TorqueCurve::spaceCurveEvenly
int spaceCurveEvenly(Ogre::SimpleSpline *spline)
Spaces the points of a spline evenly; this is needed for the correct calculation of the Ogre simple s...
Definition: TorqueCurve.cpp:172
RigDef::Node::beam_defaults
std::shared_ptr< BeamDefaults > beam_defaults
Definition: RigDef_Node.h:165
RoR::ActorSpawner::FindFlareBindingForMaterial
RigDef::MaterialFlareBinding * FindFlareBindingForMaterial(std::string const &material_name)
Returns NULL if none found.
Definition: ActorSpawner.cpp:6480
RoR::ActorSpawner::ConfigureSections
void ConfigureSections(Ogre::String const &sectionconfig, RigDef::DocumentPtr def)
Definition: ActorSpawner.cpp:90
RoR::LT_AddonPart
@ LT_AddonPart
Definition: Application.h:304
RoR::shock_t::springin
float springin
shocks2 & shocks3
Definition: SimData.h:382
RoR::Actor::ar_custom_particles
cparticle_t ar_custom_particles[MAX_CPARTICLES]
Definition: Actor.h:319
RoR::PROP_ANIM_FLAG_BRAKE
const PropAnimFlag_t PROP_ANIM_FLAG_BRAKE
Definition: GfxData.h:55
RoR::Actor::m_num_wheel_diffs
int m_num_wheel_diffs
Physics attr.
Definition: Actor.h:566
RoR::ActorSpawner::AddWheel2
WheelID_t AddWheel2(RigDef::Wheel2 &wheel_2_def)
Definition: ActorSpawner.cpp:4882
RoR::FlareType::FOG_LIGHT
@ FOG_LIGHT
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
RoR::App::GetCameraManager
CameraManager * GetCameraManager()
Definition: Application.cpp:275
RigDef::Animation::MotorSource::SOURCE_AERO_RPM
static const BitMask_t SOURCE_AERO_RPM
Definition: RigDef_File.h:482
RoR::ActorSpawner::ActorMemoryRequirements::num_fixes
size_t num_fixes
Definition: ActorSpawner.h:84
RigDef::ManagedMaterialType::MESH_STANDARD
@ MESH_STANDARD
RoR::node_t::AbsPosition
Ogre::Vector3 AbsPosition
absolute position in the world (shaky)
Definition: SimData.h:294
VehicleAI.h
Simple waypoint AI.
RigDef::Node::Ref::Str
const std::string & Str() const
Definition: RigDef_Node.h:94
RoR::Prop::pp_beacon_rot_angle
float pp_beacon_rot_angle[4]
Radians.
Definition: GfxData.h:195
RoR::ActorSpawner::ProcessMinimass
void ProcessMinimass(RigDef::Minimass &def)
Definition: ActorSpawner.cpp:1580
RoR::Actor::m_trigger_debug_enabled
bool m_trigger_debug_enabled
Logging state.
Definition: Actor.h:626
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
RoR::ActorSpawner::ProcessEngine
void ProcessEngine(RigDef::Engine &def)
Definition: ActorSpawner.cpp:5417
RoR::Prop::pp_offset
Ogre::Vector3 pp_offset
Definition: GfxData.h:168
RoR::ActorSpawner::ProcessGuiSettings
void ProcessGuiSettings(RigDef::GuiSettings &def)
Definition: ActorSpawner.cpp:1240
RoR::PROP_ANIM_MODE_ROTA_Z
const PropAnimMode_t PROP_ANIM_MODE_ROTA_Z
Definition: GfxData.h:84
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
MeshObject::setMaterialName
void setMaterialName(Ogre::String m)
Definition: MeshObject.cpp:43
RigDef::Animator::OPTION_SEQUENTIAL_SHIFT
static const BitMask_t OPTION_SEQUENTIAL_SHIFT
Definition: RigDef_File.h:579
RigDef::Engoption::shift_time
float shift_time
Seconds.
Definition: RigDef_File.h:821
RigDef::Animation
Definition: RigDef_File.h:476
BEAM_DEFORM
static const float BEAM_DEFORM
Definition: SimConstants.h:61
RoR::ActorSpawner::m_file
RigDef::DocumentPtr m_file
Definition: ActorSpawner.h:456
RoR::PropAnim::lower_limit
float lower_limit
The lower limit for the animation.
Definition: GfxData.h:152
RoR::ActorSpawner::m_fuse_z_min
float m_fuse_z_min
Definition: ActorSpawner.h:474
RoR::shock_t::splitin
float splitin
shocks3
Definition: SimData.h:392
RoR::shock_t::trigger_enabled
bool trigger_enabled
general trigger,switch and blocker state
Definition: SimData.h:375
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
RoR::CacheEntry::skin_def
std::shared_ptr< RoR::SkinDef > skin_def
Cached skin info, added on first use or during cache rebuild.
Definition: CacheSystem.h:92
RoR::HIDE_MIRROR
@ HIDE_MIRROR
Definition: Application.h:286
RigDef::Animator::nodes
Node::Ref nodes[2]
Definition: RigDef_File.h:588
RoR::flare_t::dashboard_link
int dashboard_link
Only 'd' type flares, valid values are DD_*.
Definition: SimData.h:628
RigDef::Animator::OPTION_ALTIMETER_1K
static const BitMask_t OPTION_ALTIMETER_1K
Definition: RigDef_File.h:564
RoR::wheel_t::wh_nodes
node_t * wh_nodes[50]
Definition: SimData.h:433
RoR::PROP_ANIM_FLAG_DASHBOARD
const PropAnimFlag_t PROP_ANIM_FLAG_DASHBOARD
Used with dashboard system inputs, see enum DashData in file DashBoardManager.h.
Definition: GfxData.h:76
RoR::beam_t::p1
node_t * p1
Definition: SimData.h:335
RigDef::Engine::gear_ratios
std::vector< float > gear_ratios
Definition: RigDef_File.h:813
RoR::Actor::ar_collision_relevant
bool ar_collision_relevant
Physics state;.
Definition: Actor.h:471
RigDef::Tie::auto_shorten_rate
float auto_shorten_rate
Definition: RigDef_File.h:1320
RoR::ActorSpawner::ProcessBrakes
void ProcessBrakes(RigDef::Brakes &def)
Definition: ActorSpawner.cpp:5365
DashBoardManager.h
RoR::VideoCamera::vcam_render_tex
Ogre::TexturePtr vcam_render_tex
Definition: GfxData.h:245
RigDef::Tie::min_length
float min_length
Definition: RigDef_File.h:1321
RoR::SlideNode::sn_attach_foreign
bool sn_attach_foreign
Attach/detach to rails only on other vehicles.
Definition: SlideNode.h:107
RoR::FlexMeshWheel::GetTireEntity
Ogre::Entity * GetTireEntity()
Definition: FlexMeshWheel.h:48
RigDef::Node::Ref::ToString
std::string ToString() const
Definition: RigDef_Node.cpp:103
RoR::TorqueCurve::getUsedSpline
Ogre::SimpleSpline * getUsedSpline()
Returns the used spline.
Definition: TorqueCurve.h:81
RoR::PropAnim::animMode
PropAnimMode_t animMode
Definition: GfxData.h:142
RoR::Actor::ar_instance_id
ActorInstanceID_t ar_instance_id
Static attr; session-unique ID.
Definition: Actor.h:370
RigDef::Turboprop2::airfoil
Ogre::String airfoil
Definition: RigDef_File.h:1413
RoR::CacheSystem::FindEntryByFilename
CacheEntryPtr FindEntryByFilename(RoR::LoaderType type, bool partial, const std::string &filename)
Returns NULL if none found.
Definition: CacheSystem.cpp:184
z
float z
Definition: (ValueTypes) quaternion.h:7
RigDef::Flare3
Definition: RigDef_File.h:890
RoR::Actor::ar_num_nodes
int ar_num_nodes
Definition: Actor.h:277
RigDef::Prop::DashboardSpecial::mesh_name
Ogre::String mesh_name
Definition: RigDef_File.h:1092
RoR::Actor::cc_target_rpm
float cc_target_rpm
Cruise Control.
Definition: Actor.h:360
RoR::RailGroup
A series of RailSegment-s for SlideNode to slide along. Can be closed in a loop.
Definition: SlideNode.h:53
RigDef::Engine::global_gear_ratio
float global_gear_ratio
Definition: RigDef_File.h:810
RoR::ActorSpawner::m_particles_parent_scenenode
Ogre::SceneNode * m_particles_parent_scenenode
this isn't used for moving/hiding things, just helps developers inspect the scene graph.
Definition: ActorSpawner.h:503
RigDef::Prop::camera_settings
CameraSettings camera_settings
Definition: RigDef_File.h:1113
RoR::FlareMaterial::flare_index
int flare_index
Definition: GfxData.h:314
RoR::EngineSim::m_engine_has_air
bool m_engine_has_air
Engine attribute.
Definition: EngineSim.h:175
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
RoR::FlexFactory::CheckAndLoadFlexbodyCache
void CheckAndLoadFlexbodyCache()
Definition: FlexFactory.cpp:407
RoR::SS_TRIG_ENGINE
@ SS_TRIG_ENGINE
Definition: SoundScriptManager.h:54
Renderdash.h
RigDef::Animator::OPTION_SHIFT_LEFT_RIGHT
static const BitMask_t OPTION_SHIFT_LEFT_RIGHT
Definition: RigDef_File.h:577
RoR::ActorSpawner::m_actor_grouping_scenenode
Ogre::SceneNode * m_actor_grouping_scenenode
Topmost common parent; this isn't used for moving things, just helps developers inspect the scene gra...
Definition: ActorSpawner.h:498
RoR::Actor::tc_ratio
float tc_ratio
Traction control attribute: Regulating force.
Definition: Actor.h:350
RigDef::SpecialProp::AERO_PROP_BLADE
@ AERO_PROP_BLADE
RoR::PropAnim::animFlags
PropAnimFlag_t animFlags
Definition: GfxData.h:141
RigDef::Animation::MODE_BOUNCE
static const BitMask_t MODE_BOUNCE
Definition: RigDef_File.h:541
RigDef::Hook::flag_auto_lock
bool flag_auto_lock
Definition: RigDef_File.h:966
MeshObject::getEntity
Ogre::Entity * getEntity()
Definition: MeshObject.h:43
RoR::DashBoardManager::loadDashBoard
int loadDashBoard(Ogre::String filename, bool textureLayer)
Definition: DashBoardManager.cpp:173
RigDef::Engturbo::param3
float param3
Definition: RigDef_File.h:840
RoR::Actor::m_deletion_scene_nodes
std::vector< Ogre::SceneNode * > m_deletion_scene_nodes
For unloading vehicle; filled at spawn.
Definition: Actor.h:537
RigDef::Document::Module::shocks2
std::vector< Shock2 > shocks2
Definition: RigDef_File.h:1541
RoR::shock_t::sprogin
float sprogin
shocks2
Definition: SimData.h:387
RigDef::Animation::SOURCE_TACHO
static const BitMask64_t SOURCE_TACHO
Definition: RigDef_File.h:508
RigDef::Document::Module::commands2
std::vector< Command2 > commands2
Definition: RigDef_File.h:1498
RoR::TuneupUtil::isPropAnyhowRemoved
static bool isPropAnyhowRemoved(TuneupDefPtr &tuneup_def, PropID_t prop_id)
Definition: TuneupFileFormat.cpp:267
RoR::node_t::surface_coef
Ogre::Real surface_coef
Definition: SimData.h:301
RigDef::Fusedrag::approximate_width
float approximate_width
Definition: RigDef_File.h:925
RigDef::Assetpack::filename
std::string filename
Definition: RigDef_File.h:405
RigDef::AeroAnimator::OPTION_PITCH
static const BitMask_t OPTION_PITCH
Definition: RigDef_File.h:396
RoR::exhaust_t::smoker
Ogre::ParticleSystem * smoker
This remains nullptr if removed via addonpart_unwanted_exhaust or Tuning UI.
Definition: SimData.h:643
RoR::Actor::exhausts
std::vector< exhaust_t > exhausts
Definition: Actor.h:292
RigDef::Command2::detacher_group
int detacher_group
Definition: RigDef_File.h:779
RigDef::Prop::rotation
Ogre::Vector3 rotation
Definition: RigDef_File.h:1110
RoR::PROP_ANIM_MODE_ROTA_X
const PropAnimMode_t PROP_ANIM_MODE_ROTA_X
Definition: GfxData.h:82
RigDef::Fusedrag::autocalc
bool autocalc
Definition: RigDef_File.h:922
RigDef::Engturbo::version
int version
Definition: RigDef_File.h:835
RoR::Actor::m_num_axle_diffs
int m_num_axle_diffs
Physics attr.
Definition: Actor.h:564
RoR::SlideNode::sn_attach_self
bool sn_attach_self
Attach/detach to rails on the current vehicle only.
Definition: SlideNode.h:106
RoR::Actor::m_wheel_diffs
Differential * m_wheel_diffs[MAX_WHEELS/2]
Physics.
Definition: Actor.h:565
RoR::Actor::m_fusealge_width
float m_fusealge_width
Physics attr; defined in truckfile.
Definition: Actor.h:574
RoR::hydrobeam_t::hb_ref_length
float hb_ref_length
Idle length in meters.
Definition: SimData.h:591
RigDef::ManagedMaterial::damaged_diffuse_map
Ogre::String damaged_diffuse_map
Definition: RigDef_File.h:1027
RoR::Buoyance::BUOY_DRAGLESS
@ BUOY_DRAGLESS
Definition: Buoyance.h:39
RigDef::Engoption::type
EngineType type
Definition: RigDef_File.h:819
RigDef::Animator::OPTION_CLUTCH
static const BitMask_t OPTION_CLUTCH
Definition: RigDef_File.h:572
RoR::wheel_t::wh_num_nodes
int wh_num_nodes
Definition: SimData.h:432
RoR::App::GetAppContext
AppContext * GetAppContext()
Definition: Application.cpp:266
RigDef::Rotator::rate
float rate
Definition: RigDef_File.h:1146
RoR::NODENUM_INVALID
static const NodeNum_t NODENUM_INVALID
Definition: ForwardDeclarations.h:53
RoR::Actor::ar_unique_commandkey_pairs
std::vector< UniqueCommandKeyPair > ar_unique_commandkey_pairs
UI helper for displaying command control keys to user (must be built at spawn).
Definition: Actor.h:313
RoR::ActorSpawner::ComposeName
std::string ComposeName(const std::string &object, int number=-1)
Creates name containing actor ID token, i.e. "Object#1 (filename.truck [Instance ID 1])".
Definition: ActorSpawner.cpp:699
RoR::SHIFTERMAN2
@ SHIFTERMAN2
Definition: GfxData.h:132
RoR::ActorSpawner::ProcessExtCamera
void ProcessExtCamera(RigDef::ExtCamera &def)
Definition: ActorSpawner.cpp:1231
RoR::node_t::nd_contactable
bool nd_contactable
Attr; This node will be treated as contacter on inter truck collisions.
Definition: SimData.h:313
RoR::ActorSpawner::ProcessRotator
void ProcessRotator(RigDef::Rotator &def)
Definition: ActorSpawner.cpp:3453
RigDef::Document::Module::wings
std::vector< Wing > wings
Definition: RigDef_File.h:1562
RigDef::Wheel::radius
float radius
Definition: RigDef_File.h:1441
RoR::cparticle_t::snode
Ogre::SceneNode * snode
Definition: SimData.h:653
RoR::Collisions::defaultgm
ground_model_t * defaultgm
Definition: Collisions.h:174
RoR::ActorSpawner::ProcessHelp
void ProcessHelp(RigDef::Help &def)
Definition: ActorSpawner.cpp:5446
RoR::node_t::INVALID_BBOX
static const int8_t INVALID_BBOX
Definition: SimData.h:288
RoR::tie_t::ti_locked_actor
ActorPtr ti_locked_actor
Definition: SimData.h:524
format
Truck file format(technical spec)
RoR::ActorSpawner::SetBeamDeformationThreshold
void SetBeamDeformationThreshold(beam_t &beam, std::shared_ptr< RigDef::BeamDefaults > beam_defaults)
Definition: ActorSpawner.cpp:5556
RigDef::Screwprop::back_node
Node::Ref back_node
Definition: RigDef_File.h:1165
RoR::ActorSpawner::BuildWheelBeams
void BuildWheelBeams(unsigned int num_rays, NodeNum_t base_node_index, node_t *axis_node_1, node_t *axis_node_2, float tyre_spring, float tyre_damping, float rim_spring, float rim_damping, std::shared_ptr< RigDef::BeamDefaults > beam_defaults, RigDef::Node::Ref const &rigidity_node_id, float max_extension=0.f)
'wheels', 'meshwheels'
Definition: ActorSpawner.cpp:4762
RoR::flare_t::blinkdelay_state
bool blinkdelay_state
Definition: SimData.h:631
RoR::node_t::nd_override_mass
bool nd_override_mass
User defined attr; mass is user-specified rather than calculated (override the calculation)
Definition: SimData.h:319
RigDef::Animator::OPTION_FLAP
static const BitMask_t OPTION_FLAP
Definition: RigDef_File.h:566
RoR::NodeGfx::nx_no_particles
bool nx_no_particles
User-defined attr; disable all particles.
Definition: GfxData.h:267
RoR::App::diag_simple_materials
CVar * diag_simple_materials
Definition: Application.cpp:150
RigDef::Particle::particle_system_name
Ogre::String particle_system_name
Definition: RigDef_File.h:1064
AutoPilot.h
RigDef::Camera
Definition: RigDef_File.h:725
RoR::ActorSpawner::AddExhaust
void AddExhaust(NodeNum_t emitter_node_idx, NodeNum_t direction_node_idx)
Definition: ActorSpawner.cpp:6018
RigDef::Hydro
Definition: RigDef_File.h:972
RoR::wheel_t
Definition: SimData.h:421
RoR::ActorSpawner::ProcessShock
void ProcessShock(RigDef::Shock &def)
Definition: ActorSpawner.cpp:4143
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::Animator::OPTION_ANGLE_OF_ATTACK
static const BitMask_t OPTION_ANGLE_OF_ATTACK
Definition: RigDef_File.h:565
RigDef::Animation::SOURCE_PARKING
static const BitMask64_t SOURCE_PARKING
Definition: RigDef_File.h:510
RigDef::Command2::shorten_rate
float shorten_rate
Definition: RigDef_File.h:766
RoR::NOSHOCK
@ NOSHOCK
not a shock
Definition: SimData.h:107
RoR::hook_t::hk_lock_node
node_t * hk_lock_node
Definition: SimData.h:492
RigDef::Ropable
Definition: RigDef_File.h:1125
RigDef::Trigger::longbound_trigger_action
int longbound_trigger_action
Definition: RigDef_File.h:1391
RoR::soundsource_t::type
int type
Definition: SimData.h:418
RoR::Airbrake::ec
Ogre::Entity * ec
Definition: AirBrake.h:59
RoR::Actor::ar_buoycab_types
int ar_buoycab_types[MAX_CABS]
Definition: Actor.h:335
RoR::ActorSpawner::ProcessLockgroup
void ProcessLockgroup(RigDef::Lockgroup &lockgroup)
Definition: ActorSpawner.cpp:3257
RoR::wheel_t::wh_num_rim_nodes
int wh_num_rim_nodes
Definition: SimData.h:434
RoR::Actor::m_proped_wheel_pairs
int m_proped_wheel_pairs[MAX_WHEELS]
Physics attr; For inter-differential locking.
Definition: Actor.h:538
RoR::ActorSpawner::CreateWheelSkidmarks
void CreateWheelSkidmarks(WheelID_t wheel_index)
Definition: ActorSpawner.cpp:4875
RoR::BEAM_NORMAL
@ BEAM_NORMAL
Definition: SimData.h:71
RigDef::SlideNode::attachment_rate
float attachment_rate
Definition: RigDef_File.h:1272
RoR::WheelGfx::wx_scenenode
Ogre::SceneNode * wx_scenenode
Definition: GfxData.h:296
RoR::soundsource_t::nodenum
NodeNum_t nodenum
Definition: SimData.h:417
RigDef::BaseMeshWheel::side
RoR::WheelSide side
Definition: RigDef_File.h:424
RoR::ANIM_FLAG_BTHROTTLE
@ ANIM_FLAG_BTHROTTLE
Definition: SimData.h:172
RoR::FlexMeshWheel
Consists of static mesh, representing the rim, and dynamic mesh, representing the tire.
Definition: FlexMeshWheel.h:40
RoR::ActorSpawner::m_simple_material_base
Ogre::MaterialPtr m_simple_material_base
Definition: ActorSpawner.h:493
RoR::flare_t::uses_inertia
bool uses_inertia
Only 'flares3'.
Definition: SimData.h:634
RigDef::SoundSource::node
Node::Ref node
Definition: RigDef_File.h:1279
RoR::Actor::m_definition
RigDef::DocumentPtr m_definition
Definition: Actor.h:530
RoR::ANIM_FLAG_ALTIMETER
@ ANIM_FLAG_ALTIMETER
Definition: SimData.h:145
RoR::App::gfx_particles_mode
CVar * gfx_particles_mode
Definition: Application.cpp:227
RigDef::Animation::SOURCE_BOAT_RUDDER
static const BitMask64_t SOURCE_BOAT_RUDDER
Definition: RigDef_File.h:518
RoR::CVar::getBool
bool getBool() const
Definition: CVar.h:98
RigDef::Wing::chord_point
float chord_point
Definition: RigDef_File.h:1467
RoR::Prop::pp_id
PropID_t pp_id
Definition: GfxData.h:164
RoR::Actor::sl_enabled
bool sl_enabled
Speed limiter;.
Definition: Actor.h:364
RoR::ActorSpawner::FindNodeIndex
NodeNum_t FindNodeIndex(RigDef::Node::Ref &node_ref, bool silent=false)
Definition: ActorSpawner.cpp:3051
RoR::CabSubmesh::backmesh_type
BackmeshType backmesh_type
Definition: FlexObj.h:52
RigDef::Shock2::spring_in
float spring_in
Spring value applied when the shock is compressing.
Definition: RigDef_File.h:1208
RoR::Actor::ar_engine
EngineSim * ar_engine
Definition: Actor.h:373
RigDef::Flexbody::rotation
Ogre::Vector3 rotation
Definition: RigDef_File.h:901
RigDef::Airbrake
Definition: RigDef_File.h:457
RoR::TorqueCurve::AddCurveSample
void AddCurveSample(float rpm, float progress, Ogre::String const &model=customModel)
Adds a point to the torque curve graph.
Definition: TorqueCurve.cpp:151
RoR::App::gfx_enable_videocams
CVar * gfx_enable_videocams
Definition: Application.cpp:228
RoR::ropable_t::attached_ropes
int attached_ropes
State.
Definition: SimData.h:503
RoR::hook_t::hk_beam
beam_t * hk_beam
Definition: SimData.h:493
RoR::ropable_t::pos
int pos
Index into ar_ropables.
Definition: SimData.h:500
RigDef::KeywordToString
const char * KeywordToString(Keyword keyword)
Definition: RigDef_File.cpp:174
RoR::ActorSpawner::ProcessCamera
void ProcessCamera(RigDef::Camera &def)
Definition: ActorSpawner.cpp:5476
RigDef::Document::Module::ropes
std::vector< Rope > ropes
Definition: RigDef_File.h:1535
RoR::commandbeam_t::cmb_engine_coupling
float cmb_engine_coupling
Attr from truckfile.
Definition: SimData.h:557
RoR::Actor::tc_pulse_time
float tc_pulse_time
Traction control attribute;.
Definition: Actor.h:352
RigDef::Flexbody::offset
Ogre::Vector3 offset
Definition: RigDef_File.h:900
RoR::beam_t::strength
float strength
Definition: SimData.h:343
RoR::Buoyance::BUOY_NORMAL
@ BUOY_NORMAL
Definition: Buoyance.h:39
RoR::Actor::m_masscount
int m_masscount
Physics attr; Number of nodes loaded with l option.
Definition: Actor.h:579
RigDef::Tie::options
BitMask_t options
Definition: RigDef_File.h:1323
RigDef::Animator::OPTION_AIR_BRAKE
static const BitMask_t OPTION_AIR_BRAKE
Definition: RigDef_File.h:567
RoR::FlareType::USER
@ USER
RigDef::Flare2
Definition: RigDef_File.h:876
RoR::AeroEngineType::AE_TURBOJET
@ AE_TURBOJET
RoR::shock_t::trigger_boundary_t
float trigger_boundary_t
optional value to tune trigger_switch_state autorelease
Definition: SimData.h:377
RigDef::Help
Definition: RigDef_File.h:948
RoR::VideoCamera::vcam_node_center
NodeNum_t vcam_node_center
Definition: GfxData.h:234
RigDef::Shock::OPTION_m_METRIC
static const BitMask_t OPTION_m_METRIC
Definition: RigDef_File.h:1185
RoR::TurbojetVisual::SetVisible
void SetVisible(bool visible)
Definition: TurboJet.cpp:214
RoR::ActorSpawner::ProcessContacter
void ProcessContacter(RigDef::Node::Ref &node_ref)
Definition: ActorSpawner.cpp:3447
RoR::ActorSpawner::SetCurrentKeyword
void SetCurrentKeyword(RigDef::Keyword keyword)
Definition: ActorSpawner.h:443
RigDef::DifferentialType
DifferentialType
Definition: RigDef_File.h:225
CameraManager.h
RoR::ANIM_FLAG_AOA
@ ANIM_FLAG_AOA
Definition: SimData.h:146
RigDef::Shock::OPTION_L_ACTIVE_LEFT
static const BitMask_t OPTION_L_ACTIVE_LEFT
Definition: RigDef_File.h:1183
RoR::LogFormat
void LogFormat(const char *format,...)
Improved logging utility. Uses fixed 2Kb buffer.
Definition: Application.cpp:424
RoR::flare_t::fl_type
FlareType fl_type
Definition: SimData.h:626
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
RoR::SHOCK_FLAG_NORMAL
@ SHOCK_FLAG_NORMAL
Definition: SimData.h:197
RoR::ActorSpawner::Message::TYPE_INFO
@ TYPE_INFO
RigDef::Animation::SOURCE_PITCH
static const BitMask64_t SOURCE_PITCH
Definition: RigDef_File.h:503
RoR::FlareType::SIDELIGHT
@ SIDELIGHT
RigDef::Cinecam::spring
float spring
Definition: RigDef_File.h:746
RigDef::Document::Module::airbrakes
std::vector< Airbrake > airbrakes
Definition: RigDef_File.h:1486
RoR::ActorSpawner::ProcessMeshWheel2
void ProcessMeshWheel2(RigDef::MeshWheel2 &def)
Definition: ActorSpawner.cpp:4555
RigDef::Animation::MotorSource::SOURCE_AERO_STATUS
static const BitMask_t SOURCE_AERO_STATUS
Definition: RigDef_File.h:485
RigDef::Animator::OPTION_BOAT_THROTTLE
static const BitMask_t OPTION_BOAT_THROTTLE
Definition: RigDef_File.h:584
RigDef::Trigger
Definition: RigDef_File.h:1369
RoR::ActorSpawner::ProcessFusedrag
void ProcessFusedrag(RigDef::Fusedrag &def)
Definition: ActorSpawner.cpp:735
RoR::PROP_ANIM_MODE_NOFLIP
const PropAnimMode_t PROP_ANIM_MODE_NOFLIP
Definition: GfxData.h:89
RigDef::CollisionBox::nodes
std::vector< Node::Ref > nodes
Definition: RigDef_File.h:755
RoR::Renderdash::getTexture
Ogre::TexturePtr getTexture()
Definition: Renderdash.h:41
MeshObject.h
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
RoR::Prop::pp_offset_orig
Ogre::Vector3 pp_offset_orig
Used with ANIM_FLAG_OFFSET*.
Definition: GfxData.h:169
RigDef::Airbrake::lift_coefficient
float lift_coefficient
Definition: RigDef_File.h:473
AppContext.h
System integration layer; inspired by OgreBites::ApplicationContext.
RigDef::Engturbo::param8
float param8
Definition: RigDef_File.h:845
RoR::Actor::ar_num_rotators
int ar_num_rotators
Definition: Actor.h:288
Console.h
RigDef::Hydro::OPTION_n_INPUT_NORMAL
static const BitMask_t OPTION_n_INPUT_NORMAL
Definition: RigDef_File.h:988
RoR::FlareType::HEADLIGHT
@ HEADLIGHT
RoR::rotator_t::axis2
NodeNum_t axis2
Definition: SimData.h:605
RoR::ActorSpawner::ProcessAirbrake
void ProcessAirbrake(RigDef::Airbrake &def)
Definition: ActorSpawner.cpp:875
RigDef::Command2::description
Ogre::String description
Definition: RigDef_File.h:772
RoR::ActorSpawner::ProcessTorqueCurve
void ProcessTorqueCurve(RigDef::TorqueCurve &def)
Definition: ActorSpawner.cpp:2832
RoR::Console::putMessage
void putMessage(MessageArea area, MessageType type, std::string const &msg, std::string icon="")
Definition: Console.cpp:97
RoR::Actor::ar_hooks
std::vector< hook_t > ar_hooks
Definition: Actor.h:296
RoR::FlareType::BLINKER_RIGHT
@ BLINKER_RIGHT
RoR::PropAnimKeyState
User input state for animated props with 'source:event'.
Definition: SimData.h:658
RigDef::Flare2::node_axis_y
Node::Ref node_axis_y
Definition: RigDef_File.h:880
RigDef::Animation::SOURCE_ALTIMETER_10K
static const BitMask64_t SOURCE_ALTIMETER_10K
Definition: RigDef_File.h:497
RigDef::Pistonprop
Definition: RigDef_File.h:1067
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
RoR::App::sim_no_self_collisions
CVar * sim_no_self_collisions
Definition: Application.cpp:107
RoR::EngineSim
A land vehicle engine + transmission.
Definition: EngineSim.h:35
RigDef::VideoCamera::camera_role
int camera_role
Definition: RigDef_File.h:1433
RoR::hook_t::hk_min_length
float hk_min_length
Absolute value in meters.
Definition: SimData.h:490
RigDef::WheelBraking::FOOT_HAND_SKID_RIGHT
@ FOOT_HAND_SKID_RIGHT
RigDef::Rotator::spin_right_key
unsigned int spin_right_key
Definition: RigDef_File.h:1148
RoR::AddonPartUtility::TransformToRigDefModule
std::shared_ptr< RigDef::Document::Module > TransformToRigDefModule(CacheEntryPtr &addonpart_entry)
transforms the addonpart to RigDef::File::Module (fake 'section/end_section') used for spawning.
Definition: AddonPartFileFormat.cpp:49
RoR::DashBoardManager::WasDashboardLoaded
bool WasDashboardLoaded() const
Definition: DashBoardManager.h:236
RoR::ActorSpawner::CustomMaterial::mirror_prop_scenenode
Ogre::SceneNode * mirror_prop_scenenode
Definition: ActorSpawner.h:141
RoR::exhaust_t
Definition: SimData.h:638
RigDef::Screwprop::power
float power
Definition: RigDef_File.h:1167
RoR::TorqueCurve
This class loads and processes a torque curve for a vehicle.
Definition: TorqueCurve.h:42
RoR::ActorSpawner::CustomMaterial
Definition: ActorSpawner.h:113
RoR::TransferCase::tr_4wd_mode
bool tr_4wd_mode
Enables 4WD mode.
Definition: Differentials.h:53
RigDef::Flare2::blink_delay_milis
int blink_delay_milis
Definition: RigDef_File.h:885
RoR::Actor::ar_wheeldetachers
std::vector< wheeldetacher_t > ar_wheeldetachers
Definition: Actor.h:307
RigDef::Document::Module
Definition: RigDef_File.h:1479
RoR::ActorSpawner::ComputeWingArea
float ComputeWingArea(Ogre::Vector3 const &ref, Ogre::Vector3 const &x, Ogre::Vector3 const &y, Ogre::Vector3 const &aref)
Definition: ActorSpawner.cpp:1157
RoR::CacheEntry::resource_group
Ogre::String resource_group
Resource group of the loaded bundle. Empty if not loaded yet.
Definition: CacheSystem.h:89
RigDef::Node::OPTION_p_NO_PARTICLES
static const BitMask_t OPTION_p_NO_PARTICLES
Definition: RigDef_Node.h:154
RoR::WheelGfx
Definition: GfxData.h:292
RigDef::Cab::OPTION_u_INVULNERABLE
static const BitMask_t OPTION_u_INVULNERABLE
Definition: RigDef_File.h:714
RoR::ActorSpawner::m_generate_wing_position_lights
bool m_generate_wing_position_lights
Definition: ActorSpawner.h:462
RoR::Actor::ar_ties
std::vector< tie_t > ar_ties
Definition: Actor.h:295
RoR::VideoCamera::vcam_render_target
Ogre::RenderTexture * vcam_render_target
Definition: GfxData.h:244
RoR::CAMERA_MODE_ALWAYS_HIDDEN
static CameraMode_t CAMERA_MODE_ALWAYS_HIDDEN
Definition: GfxData.h:124
RoR::shock_t::dampout
float dampout
shocks2 & shocks3
Definition: SimData.h:385
RoR::Actor::sl_speed_limit
float sl_speed_limit
Speed limiter;.
Definition: Actor.h:365
RoR::Actor::cc_target_speed_lower_limit
float cc_target_speed_lower_limit
Cruise Control.
Definition: Actor.h:362
RigDef::Shock::detacher_group
int detacher_group
Definition: RigDef_File.h:1195
RoR::ActorSpawner::ConfigureAddonParts
void ConfigureAddonParts(TuneupDefPtr &tuneup_def)
Definition: ActorSpawner.cpp:109
RoR::rotator_t::axis1
NodeNum_t axis1
rot axis
Definition: SimData.h:604
RoR::FlexObj
A visual mesh, forming a chassis for softbody actor At most one instance is created per actor.
Definition: FlexObj.h:59
RoR::authorinfo_t
Definition: SimData.h:824
RoR::Prop::pp_rot
Ogre::Quaternion pp_rot
Definition: GfxData.h:171
RoR::flare_t::nodey
NodeNum_t nodey
Definition: SimData.h:619
RoR::CabSubmesh::BACKMESH_NONE
@ BACKMESH_NONE
Definition: FlexObj.h:48
RoR::EngineSim::SetAutoMode
void SetAutoMode(RoR::SimGearboxMode mode)
Definition: EngineSim.cpp:847
RigDef::VideoCamera::rotation
Ogre::Vector3 rotation
Definition: RigDef_File.h:1427
RoR::EngineSim::HasTurbo
bool HasTurbo() const
Definition: EngineSim.h:92
TuneupFileFormat.h
The vehicle tuning system; applies addonparts and user overrides to vehicles.
RoR::FlexAirfoil::nflu
NodeNum_t nflu
Definition: FlexAirfoil.h:61
RigDef::Airbrake::y_axis_node
Node::Ref y_axis_node
Definition: RigDef_File.h:463
RigDef::FlexBodyWheel
Definition: RigDef_File.h:909
RoR::ActorSpawner::ActorMemoryRequirements::num_beams
size_t num_beams
Definition: ActorSpawner.h:79
RigDef::Turboprop2::turbine_power_kW
float turbine_power_kW
Definition: RigDef_File.h:1412
RoR::NodeGfx::nx_no_sparks
bool nx_no_sparks
User-defined attr;.
Definition: GfxData.h:271
RigDef::SlideNode::_spring_rate_set
bool _spring_rate_set
Definition: RigDef_File.h:1269
RoR::wheel_t::wh_mass
Ogre::Real wh_mass
Total rotational mass of the wheel.
Definition: SimData.h:448
RigDef::Tie::detacher_group
int detacher_group
Definition: RigDef_File.h:1326
RoR::Actor::getTruckFileResourceGroup
std::string getTruckFileResourceGroup()
Definition: Actor.cpp:4704
Airfoil.h
RigDef::Engturbo::param6
float param6
Definition: RigDef_File.h:843
RigDef::Animator::OPTION_TORQUE
static const BitMask_t OPTION_TORQUE
Definition: RigDef_File.h:581
RoR::Actor::ar_main_camera_node_dir
NodeNum_t ar_main_camera_node_dir
Sim attr; ar_camera_node_dir[0] >= 0 ? ar_camera_node_dir[0] : 0.
Definition: Actor.h:383
RigDef::Particle
Definition: RigDef_File.h:1060
RoR::Buoyance::BUOY_DRAGONLY
@ BUOY_DRAGONLY
Definition: Buoyance.h:39
RoR::Actor::GetGfxActor
GfxActor * GetGfxActor()
Definition: Actor.h:263
RoR::BeamGfx::rod_diameter_mm
uint16_t rod_diameter_mm
Diameter in millimeters.
Definition: GfxData.h:284
RoR::VISCOUS_DIFF
@ VISCOUS_DIFF
Definition: Differentials.h:61
RigDef::ManagedMaterialType::MESH_TRANSPARENT
@ MESH_TRANSPARENT
RoR::PROP_ANIM_FLAG_PBRAKE
const PropAnimFlag_t PROP_ANIM_FLAG_PBRAKE
Definition: GfxData.h:59
RoR::ANIM_FLAG_SPEEDO
@ ANIM_FLAG_SPEEDO
Definition: SimData.h:157
RoR::ActorSpawner::m_flex_factory
RoR::FlexFactory m_flex_factory
Definition: ActorSpawner.h:488
RoR::Actor::ar_num_cabs
int ar_num_cabs
Definition: Actor.h:328
RoR::Actor::ar_hide_in_actor_list
bool ar_hide_in_actor_list
Hide in list of spawned actors (available in top menubar). Useful for fixed-place machinery,...
Definition: Actor.h:339
RoR::TuneupDef::use_addonparts
std::set< std::string > use_addonparts
Addonpart filenames.
Definition: TuneupFileFormat.h:109
RigDef::Engine::shift_down_rpm
float shift_down_rpm
Definition: RigDef_File.h:807
RoR::SimpleInertia
Designed to be run on main/rendering loop (FPS)
Definition: CmdKeyInertia.h:66
RoR::tie_t::ti_tying
bool ti_tying
State.
Definition: SimData.h:534
RigDef::Animation::MODE_EVENT_LOCK
static const BitMask_t MODE_EVENT_LOCK
Definition: RigDef_File.h:542
RigDef::Animator::OPTION_SPEEDO
static const BitMask_t OPTION_SPEEDO
Definition: RigDef_File.h:573
RigDef::CameraRail
Definition: RigDef_File.h:732
RoR::hook_t
Definition: SimData.h:474
RigDef::Animator::detacher_group
int detacher_group
Definition: RigDef_File.h:596
RoR::EngineSim::getTorqueCurve
TorqueCurve * getTorqueCurve()
Definition: EngineSim.h:101
RoR::VideoCamera::vcam_node_dir_y
NodeNum_t vcam_node_dir_y
Definition: GfxData.h:235
RoR::TuneupUtil::getTweakedPropOffset
static Ogre::Vector3 getTweakedPropOffset(TuneupDefPtr &tuneup_entry, PropID_t prop_id, Ogre::Vector3 orig_val)
Definition: TuneupFileFormat.cpp:273
RigDef::Engoption::braking_torque
float braking_torque
Definition: RigDef_File.h:828
RoR::TuneupUtil::getTweakedPropRotation
static Ogre::Vector3 getTweakedPropRotation(TuneupDefPtr &tuneup_entry, PropID_t prop_id, Ogre::Vector3 orig_val)
Definition: TuneupFileFormat.cpp:287
RoR::PROP_ANIM_FLAG_ARUDDER
const PropAnimFlag_t PROP_ANIM_FLAG_ARUDDER
Definition: GfxData.h:71
RoR::ActorSpawner::m_managed_materials
std::map< std::string, Ogre::MaterialPtr > m_managed_materials
Definition: ActorSpawner.h:490
Utils.h
RigDef::Flexbody::reference_node
Node::Ref reference_node
Definition: RigDef_File.h:897
RigDef::WheelPropulsion
WheelPropulsion
Definition: RigDef_File.h:250
RoR::node_t::RelPosition
Ogre::Vector3 RelPosition
relative to the local physics origin (one origin per actor) (shaky)
Definition: SimData.h:293
RoR::PROP_ANIM_FLAG_RPM
const PropAnimFlag_t PROP_ANIM_FLAG_RPM
Definition: GfxData.h:53
Differentials.h
RigDef::Animator::OPTION_BRAKES
static const BitMask_t OPTION_BRAKES
Definition: RigDef_File.h:570
RoR::ActorSpawner::SetBeamSpring
void SetBeamSpring(beam_t &beam, float spring)
Definition: ActorSpawner.cpp:6285
RoR::Prop::pp_beacon_type
char pp_beacon_type
Special prop: beacon {0 = none, 'b' = user-specified, 'r' = red, 'p' = police lightbar,...
Definition: GfxData.h:190
RoR::FlareType::TAIL_LIGHT
@ TAIL_LIGHT
RoR::commandbeam_t::cmb_state
std::shared_ptr< commandbeam_state_t > cmb_state
Definition: SimData.h:571
RigDef::Animator::short_limit
float short_limit
Definition: RigDef_File.h:591
RigDef::Animation::SOURCE_SHIFTERLIN
static const BitMask64_t SOURCE_SHIFTERLIN
Definition: RigDef_File.h:514
HOOK_SPEED_DEFAULT
static const float HOOK_SPEED_DEFAULT
Definition: SimConstants.h:76
RigDef::SlideNode::_tolerance_set
bool _tolerance_set
Definition: RigDef_File.h:1271
RoR::VideoCamera::vcam_debug_node
Ogre::SceneNode * vcam_debug_node
Definition: GfxData.h:246
RoR::ActorSpawner::ValidateRotator
void ValidateRotator(int id, int axis1, int axis2, NodeNum_t *nodes1, NodeNum_t *nodes2)
Definition: ActorSpawner.cpp:6923
Language.h
RoR::hook_t::hk_timer_preset
float hk_timer_preset
Definition: SimData.h:489
RoR::GfxActor::SortFlexbodies
void SortFlexbodies()
Definition: GfxActor.cpp:3110
RigDef::Wheel::damping
float damping
Definition: RigDef_File.h:1443
RigDef::Animation::SOURCE_AIR_RUDDER
static const BitMask64_t SOURCE_AIR_RUDDER
Definition: RigDef_File.h:523
RoR::ActorSpawner::FindVideoCameraByMaterial
RigDef::VideoCamera * FindVideoCameraByMaterial(std::string const &material_name)
Returns NULL if none found.
Definition: ActorSpawner.cpp:6495
RigDef::Shock2::long_bound
float long_bound
Maximum extension limit, in percentage ( 1.00 = 100% )
Definition: RigDef_File.h:1217
RoR::PROP_ANIM_FLAG_ALTIMETER
const PropAnimFlag_t PROP_ANIM_FLAG_ALTIMETER
Definition: GfxData.h:46
RoR::ActorSpawner::CalcMemoryRequirements
void CalcMemoryRequirements(ActorMemoryRequirements &req, RigDef::Document::Module *module_def)
Definition: ActorSpawner.cpp:154
RigDef::Node::Ref::IsValidAnyState
bool IsValidAnyState() const
Definition: RigDef_Node.h:101
RoR::FlexFactory
Definition: FlexFactory.h:163
RoR::Actor::ar_dashboard
DashBoardManager * ar_dashboard
Definition: Actor.h:427
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::Trigger::options
BitMask_t options
Definition: RigDef_File.h:1386
RoR::SHIFTERSEQ
@ SHIFTERSEQ
Definition: GfxData.h:133
RigDef::Animation::SOURCE_AIRSPEED
static const BitMask64_t SOURCE_AIRSPEED
Definition: RigDef_File.h:494
RoR::Actor::m_skid_trails
Skidmark * m_skid_trails[MAX_WHEELS *2]
Definition: Actor.h:585
RoR::Prop::pp_wheel_pos
Ogre::Vector3 pp_wheel_pos
Definition: GfxData.h:185
RigDef::Hook
Definition: RigDef_File.h:953
RoR::PROP_ANIM_MODE_ROTA_Y
const PropAnimMode_t PROP_ANIM_MODE_ROTA_Y
Definition: GfxData.h:83
RigDef::Hydro::options
BitMask_t options
Definition: RigDef_File.h:992
RoR::VehicleAI
Definition: VehicleAI.h:61
RefCountingObjectPtr< TuneupDef >
RoR::Differential::di_idx_2
int di_idx_2
array location of wheel / axle 2
Definition: Differentials.h:72
ActorSpawner.h
Vehicle spawning logic.
RoR::ANIM_FLAG_TORQUE
@ ANIM_FLAG_TORQUE
Definition: SimData.h:164
RoR::Differential
Definition: Differentials.h:66
RigDef::Pistonprop::airfoil
Ogre::String airfoil
Definition: RigDef_File.h:1075
RoR::Console::CONSOLE_SYSTEM_ERROR
@ CONSOLE_SYSTEM_ERROR
Definition: Console.h:52
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
RoR::Prop::pp_aero_propeller_spin
bool pp_aero_propeller_spin
Special - blurred spinning propeller effect.
Definition: GfxData.h:200
RoR::flare_t::offsetz
float offsetz
Definition: SimData.h:622
RigDef::InterAxle::a1
int a1
Definition: RigDef_File.h:1001
RoR::ActorSpawner::_ProcessKeyInertia
void _ProcessKeyInertia(RigDef::Inertia &inertia, RigDef::Inertia &inertia_defaults, RoR::CmdKeyInertia &contract_key, RoR::CmdKeyInertia &extend_key)
Definition: ActorSpawner.cpp:3557
RigDef::Tie::beam_defaults
std::shared_ptr< BeamDefaults > beam_defaults
Definition: RigDef_File.h:1325
RoR::ActorSpawner::GetAndInitFreeNode
node_t & GetAndInitFreeNode(Ogre::Vector3 const &position)
Definition: ActorSpawner.cpp:6278
RoR::shock_t::dprogin
float dprogin
shocks2
Definition: SimData.h:388
RoR::Actor::m_avg_proped_wheel_radius
float m_avg_proped_wheel_radius
Physics attr, filled at spawn - Average proped wheel radius.
Definition: Actor.h:540
RigDef::Animation::SOURCE_ELEVATOR
static const BitMask64_t SOURCE_ELEVATOR
Definition: RigDef_File.h:522
ActorManager.h
RoR::Actor::getInstanceId
int getInstanceId()
Definition: Actor.h:225
RoR::EngineSim::m_engine_type
char m_engine_type
Engine attribute {'t' = truck (default), 'c' = car}.
Definition: EngineSim.h:179
RoR::Differential::AddDifferentialType
void AddDifferentialType(DiffType diff)
Definition: Differentials.h:75
RoR::PropAnim::animratio
float animratio
A coefficient for the animation, prop degree if used with mode: rotation and propoffset if used with ...
Definition: GfxData.h:140
RigDef::Ropable::has_multilock
bool has_multilock
Definition: RigDef_File.h:1129
RoR::ActorSpawner::_ProcessSimpleInertia
void _ProcessSimpleInertia(RigDef::Inertia &def, RoR::SimpleInertia &obj)
Definition: ActorSpawner.cpp:3532
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
RoR::CabTexcoord::texcoord_u
float texcoord_u
Definition: FlexObj.h:41
RoR::ExhaustID_t
int ExhaustID_t
Index into Actor::exhausts, use RoR::EXHAUSTID_INVALID as empty value.
Definition: ForwardDeclarations.h:71
RigDef::TorqueCurve::predefined_func_name
Ogre::String predefined_func_name
Definition: RigDef_File.h:1344
RoR::BeamGfx::rod_target_actor
ActorPtr rod_target_actor
Definition: GfxData.h:288
RoR::ActorSpawner::ProcessAxle
void ProcessAxle(RigDef::Axle &def)
Definition: ActorSpawner.cpp:2653
RoR::VideoCamera::vcam_render_window
Ogre::RenderWindow * vcam_render_window
Definition: GfxData.h:247
RoR::hydrobeam_t::hb_anim_flags
int hb_anim_flags
Animators (beams updating length based on simulation variables)
Definition: SimData.h:594
RoR::tie_t::ti_group
int ti_group
Definition: SimData.h:527
RoR::collcab_rate_t
Definition: SimData.h:403
RoR::GfxScene::GetSceneManager
Ogre::SceneManager * GetSceneManager()
Definition: GfxScene.h:64
w
float w
Definition: (ValueTypes) quaternion.h:4
RigDef::Animation::SOURCE_ROLL
static const BitMask64_t SOURCE_ROLL
Definition: RigDef_File.h:502
RoR::ActorSpawner::ProcessEngturbo
void ProcessEngturbo(RigDef::Engturbo &def)
Definition: ActorSpawner.cpp:5375
RoR::Actor::tc_nodash
bool tc_nodash
Traction control attribute; Hide the dashboard indicator?
Definition: Actor.h:354
RigDef::Animation::MotorSource::SOURCE_GEAR_FORWARD
static const BitMask_t SOURCE_GEAR_FORWARD
Definition: RigDef_File.h:487
RoR::ActorSpawner::m_cab_trans_material
Ogre::MaterialPtr m_cab_trans_material
Definition: ActorSpawner.h:492
RoR::PROP_ANIM_FLAG_STEERING
const PropAnimFlag_t PROP_ANIM_FLAG_STEERING
Definition: GfxData.h:68
RigDef::Animator::OPTION_INVISIBLE
static const BitMask_t OPTION_INVISIBLE
Definition: RigDef_File.h:559
RigDef::Shock3::damp_in
float damp_in
Damping value applied when the shock is compressing.
Definition: RigDef_File.h:1234
RoR::PROP_ANIM_FLAG_GEAR
const PropAnimFlag_t PROP_ANIM_FLAG_GEAR
'gearreverse' (animOpt3=-1), 'gearneutral' (animOpt3=0), 'gear#' (animOpt3=#)
Definition: GfxData.h:78
RigDef::Shock2::damp_out
float damp_out
damping value applied when shock extending
Definition: RigDef_File.h:1213
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
EngineSim.h
RoR::ActorSpawner::ProcessEngoption
void ProcessEngoption(RigDef::Engoption &def)
Definition: ActorSpawner.cpp:5387
RigDef::Brakes
Definition: RigDef_File.h:703
RigDef::Command2
Definition: RigDef_File.h:763
RoR::ActorSpawner::ActorMemoryRequirements::num_shocks
size_t num_shocks
Definition: ActorSpawner.h:80
RigDef::Tie::max_stress
float max_stress
Definition: RigDef_File.h:1324
RoR::Actor::ar_num_contacters
int ar_num_contacters
Total number of nodes which can selfcontact cabs.
Definition: Actor.h:316
RoR::beam_t::refL
float refL
reference length
Definition: SimData.h:356
RigDef::SlideNode::max_attach_dist
float max_attach_dist
Definition: RigDef_File.h:1274
RoR::ActorSpawner::CheckCabLimit
bool CheckCabLimit(unsigned int count)
Definition: ActorSpawner.cpp:6190
RoR::Actor::m_fusealge_airfoil
Airfoil * m_fusealge_airfoil
Physics attr; defined in truckfile.
Definition: Actor.h:571
RigDef::Engturbo::param9
float param9
Definition: RigDef_File.h:846
RoR::VCTYPE_MIRROR_PROP_LEFT
@ VCTYPE_MIRROR_PROP_LEFT
The classic 'special prop/rear view mirror'.
Definition: GfxData.h:225
RoR::FlexBody::PlaceholderType::FAULTY_MESH_PLACEHOLDER
@ FAULTY_MESH_PLACEHOLDER
RigDef::Animation::MODE_ROTATION_Y
static const BitMask_t MODE_ROTATION_Y
Definition: RigDef_File.h:534
RigDef::SoundSource2
Definition: RigDef_File.h:1283
RoR::ANIM_FLAG_RPM
@ ANIM_FLAG_RPM
Definition: SimData.h:152
RoR::tie_t::ti_tied
bool ti_tied
State.
Definition: SimData.h:533
RigDef::AeroAnimator::OPTION_RPM
static const BitMask_t OPTION_RPM
Definition: RigDef_File.h:394
RoR::Actor::ar_num_soundsources
int ar_num_soundsources
Definition: Actor.h:322
RoR::ropable_t::node
node_t * node
Definition: SimData.h:499
RoR::Prop::pp_wheel_scene_node
Ogre::SceneNode * pp_wheel_scene_node
Definition: GfxData.h:186
RoR::Actor::tc_pulse_state
bool tc_pulse_state
Traction control state;.
Definition: Actor.h:353
RigDef::Particle::emitter_node
Node::Ref emitter_node
Definition: RigDef_File.h:1062
RoR::wheel_t::BrakeCombo::FOOT_HAND_SKID_LEFT
@ FOOT_HAND_SKID_LEFT
RoR::ActorSpawner::ActorMemoryRequirements::num_airbrakes
size_t num_airbrakes
Definition: ActorSpawner.h:83
RigDef::Author::name
Ogre::String name
Definition: RigDef_File.h:615
RigDef::Animation::SOURCE_AILERON
static const BitMask64_t SOURCE_AILERON
Definition: RigDef_File.h:521
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
RoR::ActorSpawner::ProcessShock3
void ProcessShock3(RigDef::Shock3 &def)
Definition: ActorSpawner.cpp:3984
RoR::Prop::pp_node_ref
NodeNum_t pp_node_ref
Definition: GfxData.h:165
RoR::Actor::m_has_command_beams
bool m_has_command_beams
Physics attr;.
Definition: Actor.h:621
RoR::cparticle_t::directionNode
NodeNum_t directionNode
Definition: SimData.h:651
RigDef::BaseMeshWheel::rim_radius
float rim_radius
Definition: RigDef_File.h:427
RoR::Actor::ar_posnode_spawn_height
float ar_posnode_spawn_height
Definition: Actor.h:390
RigDef::FlexBodyWheel::tyre_mesh_name
Ogre::String tyre_mesh_name
Definition: RigDef_File.h:915
RoR::Skidmark
Definition: Skidmark.h:58
RoR::App::sim_gearbox_mode
CVar * sim_gearbox_mode
Definition: Application.cpp:108
RigDef::Node::position
Ogre::Vector3 position
Definition: RigDef_Node.h:159
RoR::PropAnim
Definition: GfxData.h:138
RoR::ROPE
@ ROPE
Definition: SimData.h:113
RoR::ActorSpawner::AddMessage
void AddMessage(Message type, Ogre::String const &text)
Maintenance.
Definition: ActorSpawner.cpp:5754
RigDef::Document::Module::meshwheels2
std::vector< MeshWheel2 > meshwheels2
Definition: RigDef_File.h:1527
RoR::ActorSpawner::ProcessAnimator
void ProcessAnimator(RigDef::Animator &def)
Definition: ActorSpawner.cpp:3714
RoR::ActorSpawner::CustomMaterial::MirrorPropType::MPROP_NONE
@ MPROP_NONE
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
RoR::FlexAirfoil::addwash
void addwash(int propid, float ratio)
Definition: FlexAirfoil.cpp:583
RigDef::Shock2::OPTION_m_METRIC
static const BitMask_t OPTION_m_METRIC
Definition: RigDef_File.h:1204
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::AeroAnimator::flags
BitMask_t flags
Definition: RigDef_File.h:399
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
RoR::ActorSpawner::SetupNewEntity
void SetupNewEntity(Ogre::Entity *e, Ogre::ColourValue simple_color)
Full texture and material setup.
Definition: ActorSpawner.cpp:6718
RigDef::Engoption::max_idle_mixture
float max_idle_mixture
Definition: RigDef_File.h:826
CreateVideocameraDebugMesh
Ogre::ManualObject * CreateVideocameraDebugMesh()
Definition: ActorSpawner.cpp:6974
RoR::SHOCK_FLAG_LACTIVE
@ SHOCK_FLAG_LACTIVE
Definition: SimData.h:198
RoR::Prop::pp_node_y
NodeNum_t pp_node_y
Definition: GfxData.h:167
RoR::TuneupUtil::getTweakedFlexbodyMediaRG
static std::string getTweakedFlexbodyMediaRG(TuneupDefPtr &tuneup_def, FlexbodyID_t flexbody_id, int media_idx, const std::string &orig_val)
Definition: TuneupFileFormat.cpp:407
RoR::wheel_t::wh_propulsed
int wh_propulsed
Definition: SimData.h:441
RoR::ActorSpawner::InstantiateManagedMaterial
Ogre::MaterialPtr InstantiateManagedMaterial(Ogre::String const &rg_name, Ogre::String const &source_name, Ogre::String const &clone_name)
Definition: ActorSpawner.cpp:2361
BITMASK_SET_0
#define BITMASK_SET_0(VAR, FLAGS)
Definition: BitFlags.h:16
RigDef::Command2::option_p_1press
bool option_p_1press
Definition: RigDef_File.h:785
TurboJet.h
RigDef::Document::Module::ties
std::vector< Tie > ties
Definition: RigDef_File.h:1551
RoR::TransferCase
Definition: Differentials.h:43
RoR::Prop::pp_wheel_mesh_obj
MeshObject * pp_wheel_mesh_obj
Definition: GfxData.h:184
RigDef::Command2::inertia
Inertia inertia
Definition: RigDef_File.h:773
TOSTRING
#define TOSTRING(x)
Definition: Application.h:56
RoR::beam_t
Simulation: An edge in the softbody structure.
Definition: SimData.h:330
RoR::Actor::ar_aeroengines
AeroEngine * ar_aeroengines[MAX_AEROENGINES]
Definition: Actor.h:323
RigDef::ManagedMaterial::type
ManagedMaterialType type
Definition: RigDef_File.h:1024
ScrewProp.h
RigDef::Animation::MODE_AUTO_ANIMATE
static const BitMask_t MODE_AUTO_ANIMATE
Definition: RigDef_File.h:539
SlideNode.h
RigDef::Command2::plays_sound
bool plays_sound
Definition: RigDef_File.h:776
RoR::PropAnimKeyState::event_id
events event_id
Definition: SimData.h:663
RoR::ActorSpawner::ProcessShock2
void ProcessShock2(RigDef::Shock2 &def)
Definition: ActorSpawner.cpp:4062
RigDef::Node::OPTION_l_LOAD_WEIGHT
static const BitMask_t OPTION_l_LOAD_WEIGHT
Definition: RigDef_Node.h:156
RoR::CameraManager::GetCamera
Ogre::Camera * GetCamera()
Definition: CameraManager.h:64
RigDef::ManagedMaterial::options
ManagedMaterialsOptions options
Definition: RigDef_File.h:1025
RoR::ActorSpawner::FindOrCreateCustomizedMaterial
Ogre::MaterialPtr FindOrCreateCustomizedMaterial(const std::string &mat_lookup_name, const std::string &mat_lookup_rg)
Definition: ActorSpawner.cpp:6511
RoR::SHOCK_FLAG_TRG_HOOK_LOCK
@ SHOCK_FLAG_TRG_HOOK_LOCK
Definition: SimData.h:209
RigDef::ManagedMaterial::name
Ogre::String name
Definition: RigDef_File.h:1023
RigDef::Prop::special
SpecialProp special
Definition: RigDef_File.h:1114
RoR::shock_t::dfastin
float dfastin
shocks3
Definition: SimData.h:394
RigDef::ManagedMaterialType::FLEXMESH_STANDARD
@ FLEXMESH_STANDARD
RoR::FlareType::DASHBOARD
@ DASHBOARD
RigDef::Screwprop::top_node
Node::Ref top_node
Definition: RigDef_File.h:1166
RoR::ActorSpawner::CheckParticleLimit
bool CheckParticleLimit(unsigned int count)
Definition: ActorSpawner.cpp:6129
RoR::AddonPartUtility::ResetUnwantedAndTweakedElements
static void ResetUnwantedAndTweakedElements(TuneupDefPtr &tuneup)
Definition: AddonPartFileFormat.cpp:190
RoR::Actor::ar_nodes_id
int * ar_nodes_id
Number in truck file, -1 for nodes generated by wheels/cinecam.
Definition: Actor.h:274
RoR::exhaust_t::emitterNode
NodeNum_t emitterNode
Definition: SimData.h:640
RoR::ActorSpawner::m_oldstyle_renderdash
RoR::Renderdash * m_oldstyle_renderdash
Definition: ActorSpawner.h:494
BITMASK_IS_0
#define BITMASK_IS_0(VAR, FLAGS)
Definition: BitFlags.h:13
RoR::Actor::ar_screwprops
Screwprop * ar_screwprops[MAX_SCREWPROPS]
Definition: Actor.h:325
RigDef::AntiLockBrakes::attr_no_toggle
bool attr_no_toggle
Definition: RigDef_File.h:608
RoR::App::gfx_window_videocams
CVar * gfx_window_videocams
Definition: Application.cpp:229
RoR::AirbrakeGfx::abx_x_node
NodeNum_t abx_x_node
Definition: GfxData.h:308
RigDef::Flare2::material_name
Ogre::String material_name
Definition: RigDef_File.h:887
RigDef::Wheel2::rim_damping
float rim_damping
Definition: RigDef_File.h:1451
RoR::ActorSpawner::CreateVideoCamera
void CreateVideoCamera(RigDef::VideoCamera *def)
Definition: ActorSpawner.cpp:7018
RigDef::BaseWheel::mass
float mass
Definition: RigDef_File.h:417
RoR::DD_PARKINGBRAKE
@ DD_PARKINGBRAKE
chassis pitch
Definition: DashBoardManager.h:111
RigDef::AeroAnimator::OPTION_TORQUE
static const BitMask_t OPTION_TORQUE
Definition: RigDef_File.h:395
RigDef::Camera::back_node
Node::Ref back_node
Definition: RigDef_File.h:728
RoR::ropable_t::attached_ties
int attached_ties
State.
Definition: SimData.h:502
RoR::ActorSpawner::ResolveNodeRef
NodeNum_t ResolveNodeRef(RigDef::Node::Ref const &node_ref)
Definition: ActorSpawner.cpp:5785
RoR::ActorSpawner::CheckAeroEngineLimit
bool CheckAeroEngineLimit(unsigned int count)
Definition: ActorSpawner.cpp:6214
RoR::ActorSpawner::ProcessMeshWheel
void ProcessMeshWheel(RigDef::MeshWheel &def)
Definition: ActorSpawner.cpp:4499
RoR::rope_t::rp_locked_ropable
ropable_t * rp_locked_ropable
Definition: SimData.h:515
RigDef::Document::Module::cinecam
std::vector< Cinecam > cinecam
Definition: RigDef_File.h:1497
RoR::BeamGfx::rod_node1
NodeNum_t rod_node1
Node index - may change during simulation!
Definition: GfxData.h:286
DEFAULT_COLLISION_RANGE
static const float DEFAULT_COLLISION_RANGE
Definition: SimConstants.h:53
RigDef::Pistonprop::couple_node
Node::Ref couple_node
Definition: RigDef_File.h:1072
RoR::App::gfx_alt_actor_materials
CVar * gfx_alt_actor_materials
Definition: Application.cpp:250
RoR::Actor::ar_beams
beam_t * ar_beams
Definition: Actor.h:281
RoR::FlareType::BRAKE_LIGHT
@ BRAKE_LIGHT
RoR::wheel_t::wh_width
float wh_width
Definition: SimData.h:453
RigDef::Node::_has_load_weight_override
bool _has_load_weight_override
Definition: RigDef_Node.h:162
RigDef::ManagedMaterialType::INVALID
@ INVALID
RigDef::Flare2::dashboard_link
std::string dashboard_link
Only 'd' type flares.
Definition: RigDef_File.h:884
RigDef::Document::Module::wheels2
std::vector< Wheel2 > wheels2
Definition: RigDef_File.h:1561
CmdKeyInertia.h
RoR::commandbeam_t::cmb_is_contraction
bool cmb_is_contraction
Attribute defined at spawn.
Definition: SimData.h:563
RoR::FlexAirfoil::nbld
NodeNum_t nbld
Definition: FlexAirfoil.h:63
RoR::PROP_ANIM_FLAG_AETORQUE
const PropAnimFlag_t PROP_ANIM_FLAG_AETORQUE
Definition: GfxData.h:62
RoR::UniqueCommandKeyPair::uckp_key2
CommandkeyID_t uckp_key2
Definition: SimData.h:699
RoR::EngineSim::SetTurboOptions
void SetTurboOptions(int type, float tinertiaFactor, int nturbos, float param1, float param2, float param3, float param4, float param5, float param6, float param7, float param8, float param9, float param10, float param11)
Sets turbo options.
Definition: EngineSim.cpp:129
RoR::ActorSpawner::ProcessRopable
void ProcessRopable(RigDef::Ropable &def)
Definition: ActorSpawner.cpp:2894
RigDef::Engoption
Definition: RigDef_File.h:816
RigDef::Shock2::OPTION_i_INVISIBLE
static const BitMask_t OPTION_i_INVISIBLE
Definition: RigDef_File.h:1202
RoR::Actor::authors
std::vector< authorinfo_t > authors
Definition: Actor.h:291
RigDef::Animator::OPTION_LONG_LIMIT
static const BitMask_t OPTION_LONG_LIMIT
Definition: RigDef_File.h:586
BitFlags.h
Bit operations.
RoR::App::gfx_speedo_digital
CVar * gfx_speedo_digital
Definition: Application.cpp:245
RigDef::Turbojet::front_node
Node::Ref front_node
Definition: RigDef_File.h:1396
RigDef::Trigger::OPTION_i_INVISIBLE
static const BitMask_t OPTION_i_INVISIBLE
Definition: RigDef_File.h:1371
RoR::AeroEngine::getNoderef
virtual int getNoderef()=0
RoR::NodeNum_t
uint16_t NodeNum_t
Node position within Actor::ar_nodes; use RoR::NODENUM_INVALID as empty value.
Definition: ForwardDeclarations.h:52
RoR::Actor::ar_num_aeroengines
int ar_num_aeroengines
Definition: Actor.h:324
RigDef::Animation::SOURCE_BOAT_THROTTLE
static const BitMask64_t SOURCE_BOAT_THROTTLE
Definition: RigDef_File.h:519
RigDef::CruiseControl::min_speed
float min_speed
Definition: RigDef_File.h:791
RoR::App::diag_log_beam_break
CVar * diag_log_beam_break
Definition: Application.cpp:147
RoR::Actor::ar_rotators
rotator_t * ar_rotators
Definition: Actor.h:287
RigDef::Author::_has_forum_account
bool _has_forum_account
Definition: RigDef_File.h:617
RigDef::Turboprop2::couple_node
Node::Ref couple_node
Definition: RigDef_File.h:1414
RoR::wheel_t::BrakeCombo::FOOT_ONLY
@ FOOT_ONLY
RoR::UNLOCKED
@ UNLOCKED
lock not locked
Definition: SimData.h:83
RigDef::AntiLockBrakes::min_speed
unsigned int min_speed
Definition: RigDef_File.h:604
RoR::HYDRO_FLAG_AILERON
@ HYDRO_FLAG_AILERON
Definition: SimData.h:133
RoR::PROP_ANIM_FLAG_PERMANENT
const PropAnimFlag_t PROP_ANIM_FLAG_PERMANENT
Definition: GfxData.h:74
RoR::wheel_t::wh_rim_radius
Ogre::Real wh_rim_radius
Definition: SimData.h:443
RoR::Actor::ar_airbrake_intensity
int ar_airbrake_intensity
Physics state; values 0-5.
Definition: Actor.h:421
RoR::TuneupUtil::isManagedMatAnyhowRemoved
static bool isManagedMatAnyhowRemoved(TuneupDefPtr &tuneup_def, const std::string &matname)
Definition: TuneupFileFormat.cpp:464
RoR::hook_t::hk_locked
HookState hk_locked
Definition: SimData.h:479
RigDef::Animator::OPTION_ACCEL
static const BitMask_t OPTION_ACCEL
Definition: RigDef_File.h:571
RoR::Str
Wrapper for classic c-string (local buffer) Refresher: strlen() excludes '\0' terminator; strncat() A...
Definition: Str.h:35
RoR::Actor::m_fusealge_front
node_t * m_fusealge_front
Physics attr; defined in truckfile.
Definition: Actor.h:572
RoR::Actor::ar_camera_node_roll
NodeNum_t ar_camera_node_roll[MAX_CAMERAS]
Physics attr; 'camera' = frame of reference; left node.
Definition: Actor.h:387
RoR::Actor::m_transfer_case
TransferCase * m_transfer_case
Physics.
Definition: Actor.h:567
RoR::rotator_t::engine_coupling
float engine_coupling
Definition: SimData.h:610
RoR::Airbrake::offset
Ogre::Vector3 offset
gfx attribute
Definition: AirBrake.h:54
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
DEFAULT_DETACHER_GROUP
static const int DEFAULT_DETACHER_GROUP
Definition: SimConstants.h:79
RoR::Actor::ar_flares
std::vector< flare_t > ar_flares
Definition: Actor.h:297
RoR::beam_t::bounded
SpecialBeam bounded
Definition: SimData.h:347
RigDef::Globals::dry_mass
float dry_mass
Definition: RigDef_File.h:932
RoR::tie_t::ti_min_length
float ti_min_length
Proportional to orig; length.
Definition: SimData.h:530
RigDef::Wheel2::band_material_name
Ogre::String band_material_name
Definition: RigDef_File.h:1453
RoR::Actor::tc_notoggle
bool tc_notoggle
Traction control attribute; Disable in-game toggle?
Definition: Actor.h:355
RoR::WheelGfx::wx_flex_mesh
Flexable * wx_flex_mesh
Definition: GfxData.h:295
RigDef::Shock2
Definition: RigDef_File.h:1198
RoR::tie_t::ti_contract_speed
float ti_contract_speed
Definition: SimData.h:528
RoR::TuneupUtil::isFlexbodyAnyhowRemoved
static bool isFlexbodyAnyhowRemoved(TuneupDefPtr &tuneup_def, FlexbodyID_t flexbody_id)
Definition: TuneupFileFormat.cpp:359
RigDef::Animation::SOURCE_DIFFLOCK
static const BitMask64_t SOURCE_DIFFLOCK
Definition: RigDef_File.h:517
RoR::beam_t::d
float d
damping factor
Definition: SimData.h:338
RigDef::Animation::SOURCE_AIR_BRAKE
static const BitMask64_t SOURCE_AIR_BRAKE
Definition: RigDef_File.h:501
RoR::ActorSpawner::ActorMemoryRequirements
Definition: ActorSpawner.h:76
RigDef::BaseWheel::num_rays
unsigned int num_rays
Definition: RigDef_File.h:411
RoR::Buoyance
Definition: Buoyance.h:30
HOOK_FORCE_DEFAULT
static const float HOOK_FORCE_DEFAULT
Definition: SimConstants.h:74
RoR::Actor::ar_num_wings
int ar_num_wings
Definition: Actor.h:290
RoR::ActorSpawner::AddTyreBeam
unsigned int AddTyreBeam(RigDef::Wheel2 &wheel_2_def, node_t *node_1, node_t *node_2)
Definition: ActorSpawner.cpp:5253
RigDef::Shock2::OPTION_M_ABSOLUTE_METRIC
static const BitMask_t OPTION_M_ABSOLUTE_METRIC
Definition: RigDef_File.h:1205
RoR::Turboprop
Definition: TurboProp.h:38
RoR::authorinfo_t::name
Ogre::String name
Definition: SimData.h:828
RigDef::Inertia::stop_delay_factor
float stop_delay_factor
Definition: RigDef_File.h:449
RoR::ActorSpawner::m_oldstyle_cab_texcoords
std::vector< CabTexcoord > m_oldstyle_cab_texcoords
Definition: ActorSpawner.h:479
RoR::ActorSpawner::ProcessTurboprop2
void ProcessTurboprop2(RigDef::Turboprop2 &def)
Definition: ActorSpawner.cpp:828
RoR::ActorSpawner::TranslateBrakingDef
wheel_t::BrakeCombo TranslateBrakingDef(RigDef::WheelBraking def)
Definition: ActorSpawner.cpp:4468
RoR::Actor::m_num_command_beams
int m_num_command_beams
TODO: Remove! Spawner context only; likely unused feature.
Definition: Actor.h:577
RoR::ActorSpawner::AddWheel
WheelID_t AddWheel(RigDef::Wheel &wheel)
Definition: ActorSpawner.cpp:4819
RoR::NodeGfx
Gfx attributes/state of a softbody node.
Definition: GfxData.h:252
RoR::FlexBody::PlaceholderType::FAULTY_FORSET_PLACEHOLDER
@ FAULTY_FORSET_PLACEHOLDER
RoR::GfxFlaresMode::ALL_VEHICLES_ALL_LIGHTS
@ ALL_VEHICLES_ALL_LIGHTS
All vehicles, all lights.
RoR::Actor::ar_intra_collcabrate
collcab_rate_t ar_intra_collcabrate[MAX_CABS]
Definition: Actor.h:332
RoR::shock_t::sbd_damp
float sbd_damp
set beam default for damping
Definition: SimData.h:400
RoR::commandbeam_state_t
Definition: SimData.h:543
RoR::ActorSpawner::ProcessAuthor
void ProcessAuthor(RigDef::Author &def)
Definition: ActorSpawner.cpp:5451
RoR::ActorSpawner::CheckTexcoordLimit
bool CheckTexcoordLimit(unsigned int count)
Definition: ActorSpawner.cpp:6165
RigDef::Pistonprop::axis_node
Node::Ref axis_node
Definition: RigDef_File.h:1070
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
CacheSystem.h
A database of user-installed content alias 'mods' (vehicles, terrains...)
RigDef::Hydro::nodes
Node::Ref nodes[2]
Definition: RigDef_File.h:990
RoR::PROP_ANIM_MODE_AUTOANIMATE
const PropAnimMode_t PROP_ANIM_MODE_AUTOANIMATE
Definition: GfxData.h:88
RoR::shock_t::trigger_cmdshort
int trigger_cmdshort
F-key for trigger injection shortbound-check.
Definition: SimData.h:379
RoR::commandbeam_t::cmb_center_length
float cmb_center_length
Attr computed at spawn.
Definition: SimData.h:558
RoR::commandbeam_t::cmb_needs_engine
bool cmb_needs_engine
Attribute defined in truckfile.
Definition: SimData.h:565
RoR::ActorSpawner::CreateParticleSystem
Ogre::ParticleSystem * CreateParticleSystem(std::string const &name, std::string const &template_name)
Definition: ActorSpawner.cpp:7247
RoR::Actor::cc_target_speed
float cc_target_speed
Cruise Control.
Definition: Actor.h:361
RoR::CabSubmesh::BACKMESH_OPAQUE
@ BACKMESH_OPAQUE
Definition: FlexObj.h:48
RoR::ActorSpawner::m_props_parent_scenenode
Ogre::SceneNode * m_props_parent_scenenode
this isn't used for moving/hiding things, just helps developers inspect the scene graph.
Definition: ActorSpawner.h:500
RigDef::Node::load_weight_override
float load_weight_override
Definition: RigDef_Node.h:161
RoR::ActorSpawner::ConfigureAssetPacks
void ConfigureAssetPacks(ActorPtr actor, RigDef::DocumentPtr def)
Definition: ActorSpawner.cpp:143
RigDef::Trigger::OPTION_x_START_DISABLED
static const BitMask_t OPTION_x_START_DISABLED
Definition: RigDef_File.h:1373
RoR::Prop::pp_beacon_light
Ogre::Light * pp_beacon_light[4]
Definition: GfxData.h:193
RigDef::Wheel2
Definition: RigDef_File.h:1448
RigDef::CruiseControl::autobrake
int autobrake
Definition: RigDef_File.h:792
RoR::rotator_t::needs_engine
bool needs_engine
Definition: SimData.h:601
RoR::shock_t::beamid
int beamid
Definition: SimData.h:372
RoR::ANIM_FLAG_CLUTCH
@ ANIM_FLAG_CLUTCH
Definition: SimData.h:155
RoR::OPEN_DIFF
@ OPEN_DIFF
Definition: Differentials.h:60
RoR::Actor::ar_num_collcabs
int ar_num_collcabs
Definition: Actor.h:333
RigDef::Hydro::OPTION_a_INPUT_AILERON
static const BitMask_t OPTION_a_INPUT_AILERON
Definition: RigDef_File.h:978
RoR::ActorSpawner::ProcessSpeedLimiter
void ProcessSpeedLimiter(RigDef::SpeedLimiter &def)
Definition: ActorSpawner.cpp:2826
RigDef::DifferentialType::o_OPEN
@ o_OPEN
RigDef::TractionControl
Definition: RigDef_File.h:1347
BITMASK_IS_1
#define BITMASK_IS_1(VAR, FLAGS)
Definition: BitFlags.h:14
RigDef::Animation::MODE_OFFSET_Z
static const BitMask_t MODE_OFFSET_Z
Definition: RigDef_File.h:538
RoR::ActorSpawner::m_help_material_name
std::string m_help_material_name
Definition: ActorSpawner.h:470
RoR::Autopilot
Definition: AutoPilot.h:34
RoR::Actor::ar_num_custom_particles
int ar_num_custom_particles
Definition: Actor.h:320
RoR::hook_t::hk_autolock
bool hk_autolock
Definition: SimData.h:483
RoR::FlexMesh
Definition: FlexMesh.h:44
RoR::FlexAirfoil::nfrd
NodeNum_t nfrd
Definition: FlexAirfoil.h:60
RoR::VideoCamera::vcam_off_tex_name
std::string vcam_off_tex_name
Used when videocamera is offline.
Definition: GfxData.h:242
RoR::hook_t::hk_selflock
bool hk_selflock
Definition: SimData.h:482
MAX_CPARTICLES
static const int MAX_CPARTICLES
maximum number of custom particles per actor
Definition: SimConstants.h:33
RoR::Actor::m_inter_point_col_detector
PointColDetector * m_inter_point_col_detector
Physics.
Definition: Actor.h:542
RoR::TorqueCurve::setTorqueModel
int setTorqueModel(Ogre::String name)
Sets the torque model which is used for the vehicle.
Definition: TorqueCurve.cpp:157
RigDef::SlideNode::slide_node
Node::Ref slide_node
Definition: RigDef_File.h:1264
RoR::ActorSpawner::CustomMaterial::video_camera_def
RigDef::VideoCamera * video_camera_def
Definition: ActorSpawner.h:139
RoR::wheel_t::wh_axis_node_1
node_t * wh_axis_node_1
Definition: SimData.h:440
RoR::TuneupUtil::getTweakedPropMedia
static std::string getTweakedPropMedia(TuneupDefPtr &tuneup_entry, PropID_t prop_id, int media_idx, const std::string &orig_val)
Definition: TuneupFileFormat.cpp:301
RigDef::Rotator::inertia_defaults
std::shared_ptr< Inertia > inertia_defaults
Definition: RigDef_File.h:1150
RigDef::Help::material
std::string material
Definition: RigDef_File.h:950
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
RoR::Actor::getTyrePressure
TyrePressure & getTyrePressure()
Definition: Actor.h:214
RigDef::Node::id
Id id
Definition: RigDef_Node.h:158
RoR::PROP_ANIM_FLAG_FLAP
const PropAnimFlag_t PROP_ANIM_FLAG_FLAP
Definition: GfxData.h:48
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
RoR::PROP_ANIM_FLAG_DIFFLOCK
const PropAnimFlag_t PROP_ANIM_FLAG_DIFFLOCK
Definition: GfxData.h:67
RigDef::Engine::torque
float torque
Definition: RigDef_File.h:809
TorqueCurve.h
torquecurve loader.
RigDef::Document::Module::triggers
std::vector< Trigger > triggers
Definition: RigDef_File.h:1555
RoR::ActorSpawner::GetWheelAxisNodes
void GetWheelAxisNodes(RigDef::BaseWheel &def, node_t *&out_node_1, node_t *&out_node_2)
Definition: ActorSpawner.cpp:4481
ROTATOR_TOLERANCE_DEFAULT
static const float ROTATOR_TOLERANCE_DEFAULT
Definition: SimConstants.h:73
RoR::SHIFTERMAN1
@ SHIFTERMAN1
Definition: GfxData.h:131
RoR::App::diag_log_beam_trigger
CVar * diag_log_beam_trigger
Definition: Application.cpp:149
BITMASK_SET_1
#define BITMASK_SET_1(VAR, FLAGS)
Definition: BitFlags.h:17
RigDef::Flare2::reference_node
Node::Ref reference_node
Definition: RigDef_File.h:878
RoR::hydrobeam_t::hb_inertia
RoR::CmdKeyInertia hb_inertia
Definition: SimData.h:596
RoR::WheelID_t
int WheelID_t
Index to Actor::ar_wheels, use RoR::WHEELID_INVALID as empty value.
Definition: ForwardDeclarations.h:56
RigDef::Trigger::detacher_group
int detacher_group
Definition: RigDef_File.h:1389
RoR::ActorSpawner::ProcessFlare3
void ProcessFlare3(RigDef::Flare3 &def)
Definition: ActorSpawner.cpp:2115
RoR::flare_t::nodex
NodeNum_t nodex
Definition: SimData.h:618
RigDef::ManagedMaterial::specular_map
Ogre::String specular_map
Definition: RigDef_File.h:1028
RoR::PROP_ANIM_FLAG_AESTATUS
const PropAnimFlag_t PROP_ANIM_FLAG_AESTATUS
Definition: GfxData.h:64
RoR::cparticle_t::active
bool active
Definition: SimData.h:652
MAX_SUBMESHES
static const int MAX_SUBMESHES
maximum number of submeshes per actor
Definition: SimConstants.h:25
RoR::shock_t::trigger_switch_state
float trigger_switch_state
needed to avoid doubleswitch, bool and timer in one
Definition: SimData.h:376
RoR::RailGroup::rg_segments
std::vector< RailSegment > rg_segments
Definition: SlideNode.h:60
RoR::hydrobeam_t
Definition: SimData.h:588
RigDef::Cinecam
Definition: RigDef_File.h:742
RigDef::Lockgroup::LOCKGROUP_NOLOCK
static const int LOCKGROUP_NOLOCK
Definition: RigDef_File.h:1010
RoR::Actor::ar_origin
Ogre::Vector3 ar_origin
Physics state; base position for softbody nodes.
Definition: Actor.h:379
RoR::Str::ToCStr
const char * ToCStr() const
Definition: Str.h:46
RigDef::Flare2::offset
Ogre::Vector3 offset
Definition: RigDef_File.h:881
RoR::ANIM_FLAG_FLAP
@ ANIM_FLAG_FLAP
Definition: SimData.h:147
RoR::tie_t::ti_max_stress
float ti_max_stress
Definition: SimData.h:529
RoR::ActorSpawner::ProcessFlexbody
void ProcessFlexbody(RigDef::Flexbody &def)
Definition: ActorSpawner.cpp:1516
RigDef::Animator::OPTION_ALTIMETER_10K
static const BitMask_t OPTION_ALTIMETER_10K
Definition: RigDef_File.h:563
RoR::ActorSpawner::Message
Message
Definition: ActorSpawner.h:88
RoR::wheel_t::BrakeCombo::FOOT_HAND_SKID_RIGHT
@ FOOT_HAND_SKID_RIGHT
RigDef::SlideNode::railgroup_id
int railgroup_id
Definition: RigDef_File.h:1273
RoR::ActorState::LOCAL_SLEEPING
@ LOCAL_SLEEPING
sleeping (local) actor
RoR::FlexBody::fb_camera_mode_active
CameraMode_t fb_camera_mode_active
Dynamic visibility mode {0 and higher = cinecam index}.
Definition: FlexBody.h:73
RigDef::AeroAnimator::OPTION_STATUS
static const BitMask_t OPTION_STATUS
Definition: RigDef_File.h:397
RoR::node_t::nd_cab_node
bool nd_cab_node
Attr; This node is part of collision triangle.
Definition: SimData.h:309
RoR::VideoCamera::vcam_ogre_camera
Ogre::Camera * vcam_ogre_camera
Definition: GfxData.h:243
RoR::commandbeam_t::cmb_speed
float cmb_speed
Attr; Rate of contraction/extension.
Definition: SimData.h:559
RigDef::Shock2::short_bound
float short_bound
Maximum contraction limit, in percentage ( 1.00 = 100% )
Definition: RigDef_File.h:1216
RoR::ActorSpawner::CreateCabVisual
void CreateCabVisual()
Definition: ActorSpawner.cpp:7263
RoR::BEAM_VIRTUAL
@ BEAM_VIRTUAL
Excluded from mass calculations, visuals permanently disabled.
Definition: SimData.h:73
RoR::node_t::nd_no_mouse_grab
bool nd_no_mouse_grab
Attr; User-defined.
Definition: SimData.h:321
MAX_CAMERAS
static const int MAX_CAMERAS
maximum number of cameras per actor
Definition: SimConstants.h:29
RoR::Console::MessageType
MessageType
Definition: Console.h:46
RigDef::FlexBodyWheel::rim_mesh_name
Ogre::String rim_mesh_name
Definition: RigDef_File.h:914
RigDef::Animator::OPTION_ROLL
static const BitMask_t OPTION_ROLL
Definition: RigDef_File.h:568
RoR::ActorSpawner::FinalizeRig
void FinalizeRig()
Definition: ActorSpawner.cpp:410
RoR::shock_t::trigger_cmdlong
int trigger_cmdlong
F-key for trigger injection longbound-check.
Definition: SimData.h:378
RoR::ActorSpawner::ProcessFixedNode
void ProcessFixedNode(RigDef::Node::Ref node_ref)
Definition: ActorSpawner.cpp:1272
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
RoR::Actor::ar_command_key
CmdKeyArray ar_command_key
BEWARE: commandkeys are indexed 1-MAX_COMMANDS!
Definition: Actor.h:299
RoR::AirbrakeGfx::abx_entity
Ogre::Entity * abx_entity
Definition: GfxData.h:305
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
RoR::Terrain::GetCollisions
Collisions * GetCollisions()
Definition: Terrain.h:83
RigDef::Prop::DashboardSpecial::_offset_is_set
bool _offset_is_set
Definition: RigDef_File.h:1090
RoR::AUTOSHIFTERLIN
@ AUTOSHIFTERLIN
Definition: GfxData.h:135
HOOK_RANGE_DEFAULT
static const float HOOK_RANGE_DEFAULT
Definition: SimConstants.h:75
RoR::Actor::getTruckFileName
std::string getTruckFileName()
Definition: Actor.h:221
RigDef::Animation::MODE_OFFSET_X
static const BitMask_t MODE_OFFSET_X
Definition: RigDef_File.h:536
RigDef::Animator::OPTION_BOAT_RUDDER
static const BitMask_t OPTION_BOAT_RUDDER
Definition: RigDef_File.h:583
RigDef::Wing::nodes
Node::Ref nodes[8]
Definition: RigDef_File.h:1464
RoR::ActorSpawner::HandleException
void HandleException()
Definition: ActorSpawner.cpp:7224
RoR::TurbojetVisual::SetNodes
void SetNodes(NodeNum_t front, NodeNum_t back, NodeNum_t ref)
Definition: TurboJet.cpp:104
RoR::node_t::pos
NodeNum_t pos
This node's index in Actor::ar_nodes array.
Definition: SimData.h:304
RoR::Actor::m_description
std::vector< std::string > m_description
Definition: Actor.h:591
RigDef::Engturbo::param11
float param11
Definition: RigDef_File.h:848
RigDef::Airbrake::reference_node
Node::Ref reference_node
Definition: RigDef_File.h:461
GfxScene.h
RoR::node_t::nd_tyre_node
bool nd_tyre_node
Attr; This node is part of a tyre (note some wheel types don't use rim nodes at all)
Definition: SimData.h:311
RigDef::Animation::MODE_ROTATION_Z
static const BitMask_t MODE_ROTATION_Z
Definition: RigDef_File.h:535
RoR::ActorSpawner::GetAndInitFreeBeam
beam_t & GetAndInitFreeBeam(node_t &node_1, node_t &node_2)
Definition: ActorSpawner.cpp:6270
RoR::ActorSpawner::ProcessScrewprop
void ProcessScrewprop(RigDef::Screwprop &def)
Definition: ActorSpawner.cpp:717
RigDef::Engturbo::param1
float param1
Definition: RigDef_File.h:838
RigDef::AeroAnimator::OPTION_THROTTLE
static const BitMask_t OPTION_THROTTLE
Definition: RigDef_File.h:393
RigDef::Hydro::OPTION_v_INPUT_InvAILERON_ELEVATOR
static const BitMask_t OPTION_v_INPUT_InvAILERON_ELEVATOR
Definition: RigDef_File.h:982
RoR::ActorSpawner::m_material_substitutions
std::map< std::string, CustomMaterial > m_material_substitutions
Maps original material names (shared) to their actor-specific substitutes; There's 1 substitute per 1...
Definition: ActorSpawner.h:489
RigDef::TorqueCurve::samples
std::vector< Sample > samples
Definition: RigDef_File.h:1343
RoR::App::diag_log_beam_deform
CVar * diag_log_beam_deform
Definition: Application.cpp:148
RoR::ANIM_FLAG_VVI
@ ANIM_FLAG_VVI
Definition: SimData.h:144
SOUND_START
#define SOUND_START(_ACTOR_, _TRIG_)
Definition: SoundScriptManager.h:35
RigDef::MeshWheel
Definition: RigDef_File.h:1043
RigDef::Animation::SOURCE_STEERING_WHEEL
static const BitMask64_t SOURCE_STEERING_WHEEL
Definition: RigDef_File.h:520
RigDef::Animator::OPTION_TURBO
static const BitMask_t OPTION_TURBO
Definition: RigDef_File.h:575
RoR::WheelSide::RIGHT
@ RIGHT
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
RoR::ActorSpawner::AddWheelBeam
unsigned int AddWheelBeam(node_t *node_1, node_t *node_2, float spring, float damping, std::shared_ptr< RigDef::BeamDefaults > beam_defaults, float max_contraction=-1.f, float max_extension=-1.f, BeamType type=BEAM_NORMAL)
'wheels', 'meshwheels', 'meshwheels2'
Definition: ActorSpawner.cpp:5217
RoR::PROP_ANIM_FLAG_SIGNALSTALK
const PropAnimFlag_t PROP_ANIM_FLAG_SIGNALSTALK
Turn indicator stalk position (-1=left, 0=off, 1=right)
Definition: GfxData.h:77
RigDef::Airbrake::aditional_node
Node::Ref aditional_node
Definition: RigDef_File.h:464
RoR::Actor::ar_collcabs
int ar_collcabs[MAX_CABS]
Definition: Actor.h:330
RoR::shock_t::splitout
float splitout
shocks3
Definition: SimData.h:395
RoR::wheeldetacher_t::wd_detacher_group
int wd_detacher_group
Definition: SimData.h:468
RoR::command_t
Definition: SimData.h:574
RoR::ActorSpawner::m_actor
ActorPtr m_actor
Definition: ActorSpawner.h:455
RoR::flare_t::intensity
float intensity
Definition: SimData.h:633
RoR::wheel_t::wh_near_attach_node
node_t * wh_near_attach_node
Definition: SimData.h:438
RoR::Prop
A mesh attached to vehicle frame via 3 nodes.
Definition: GfxData.h:162
RigDef::InterAxle
Definition: RigDef_File.h:999
RoR::Actor::ar_cabs
int ar_cabs[MAX_CABS *3]
Definition: Actor.h:327
RoR::ANIM_FLAG_AESTATUS
@ ANIM_FLAG_AESTATUS
Definition: SimData.h:163
RigDef::BaseWheel
Definition: RigDef_File.h:408
RigDef::Node::detacher_group
int detacher_group
Definition: RigDef_Node.h:166
RoR::ActorSpawner::m_named_nodes
std::map< Ogre::String, unsigned int > m_named_nodes
Definition: ActorSpawner.h:483
MeshObject
Definition: MeshObject.h:35
RoR::Actor::ar_minimass
std::vector< float > ar_minimass
minimum node mass in Kg
Definition: Actor.h:278
RoR::PROP_ANIM_FLAG_VVI
const PropAnimFlag_t PROP_ANIM_FLAG_VVI
Definition: GfxData.h:45
RoR::SHOCK2
@ SHOCK2
shock2
Definition: SimData.h:109
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
RoR::hook_t::hk_nodisable
bool hk_nodisable
Definition: SimData.h:484
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
RoR::node_t::nd_loaded_mass
bool nd_loaded_mass
User defined attr; mass is calculated from 'globals/loaded-mass' rather than 'globals/dry-mass'.
Definition: SimData.h:317
RoR::ActorSpawner::Message::TYPE_WARNING
@ TYPE_WARNING
RoR::Actor::ar_exhaust_dir_node
NodeNum_t ar_exhaust_dir_node
Old-format exhaust (one per vehicle) backwards direction node.
Definition: Actor.h:369
RoR::AirbrakeGfx
Definition: GfxData.h:301
RoR::PROP_ANIM_MODE_OFFSET_Z
const PropAnimMode_t PROP_ANIM_MODE_OFFSET_Z
Definition: GfxData.h:87
RoR::ActorSpawner::FinalizeGfxSetup
void FinalizeGfxSetup()
Definition: ActorSpawner.cpp:6776
RigDef::DifferentialType::v_VISCOUS
@ v_VISCOUS
Application.h
Central state/object manager and communications hub.
RigDef::Shock3::long_bound
float long_bound
Maximum extension limit, in percentage ( 1.00 = 100% )
Definition: RigDef_File.h:1244
RoR::App::GetConsole
Console * GetConsole()
Definition: Application.cpp:270
RigDef::SlideNode::_break_force_set
bool _break_force_set
Definition: RigDef_File.h:1270
RoR::ActorSpawner::ProcessBeam
void ProcessBeam(RigDef::Beam &def)
Definition: ActorSpawner.cpp:5506
RigDef::Turbojet::wet_thrust
float wet_thrust
Definition: RigDef_File.h:1401
RoR::DashBoardManager::getLinkIDForName
int getLinkIDForName(Ogre::String &str)
Definition: DashBoardManager.cpp:150
RoR::ActorSpawner::AddNode
std::pair< unsigned int, bool > AddNode(RigDef::Node::Id &id)
Definition: ActorSpawner.cpp:5849
RoR::ActorSpawner::AddWheelRimBeam
unsigned int AddWheelRimBeam(RigDef::Wheel2 &wheel_2_def, node_t *node_1, node_t *node_2)
Definition: ActorSpawner.cpp:5244
RigDef::Animator::flags
BitMask_t flags
Definition: RigDef_File.h:590
RoR::SHOCK_FLAG_TRG_CONTINUOUS
@ SHOCK_FLAG_TRG_CONTINUOUS
Definition: SimData.h:210
RoR::PROP_ANIM_MODE_BOUNCE
const PropAnimMode_t PROP_ANIM_MODE_BOUNCE
Definition: GfxData.h:90
RoR::ActorSpawner::m_fuse_z_max
float m_fuse_z_max
Definition: ActorSpawner.h:475
RigDef::Flexbody::mesh_name
Ogre::String mesh_name
Definition: RigDef_File.h:902
RoR::Airbrake::nodey
node_t * nodey
Definition: AirBrake.h:52
RoR::command_t::description
Ogre::String description
Definition: SimData.h:583
RoR::PointColDetector
Definition: PointColDetector.h:32
RigDef::Screwprop::prop_node
Node::Ref prop_node
Definition: RigDef_File.h:1164
RigDef::AntiLockBrakes::attr_is_on
bool attr_is_on
Definition: RigDef_File.h:606
RoR::ActorSpawner::CustomMaterial::MirrorPropType
MirrorPropType
Definition: ActorSpawner.h:115
RigDef::Engturbo::param4
float param4
Definition: RigDef_File.h:841
RigDef::Keyword::INVALID
@ INVALID
RoR::ActorSpawner::ProcessCollisionRange
void ProcessCollisionRange(RigDef::CollisionRange &def)
Definition: ActorSpawner.cpp:2629
RigDef::Animation::SOURCE_SHIFT_LEFT_RIGHT
static const BitMask64_t SOURCE_SHIFT_LEFT_RIGHT
Definition: RigDef_File.h:511
SoundScriptManager.h
RoR::GfxFlaresMode::CURR_VEHICLE_HEAD_ONLY
@ CURR_VEHICLE_HEAD_ONLY
Only current vehicle, main lights.
RoR::node_t
Physics: A vertex in the softbody structure.
Definition: SimData.h:286
RigDef::Shock3::detacher_group
int detacher_group
Definition: RigDef_File.h:1248
RigDef::Engturbo::param2
float param2
Definition: RigDef_File.h:839
RoR::commandbeam_t::cmb_boundary_length
float cmb_boundary_length
Attr; Maximum/minimum length proportional to orig. len.
Definition: SimData.h:560
RigDef::TransferCase::gear_ratios
std::vector< float > gear_ratios
Definition: RigDef_File.h:1366
RigDef::Flare3::inertia_defaults
std::shared_ptr< Inertia > inertia_defaults
Definition: RigDef_File.h:892
RigDef::Submesh
Definition: RigDef_File.h:1299
RoR::hook_t::hk_maxforce
float hk_maxforce
Definition: SimData.h:485
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
RoR::ActorSpawner::GetCurrentElementMediaRG
std::string GetCurrentElementMediaRG()
Where to load media from (the addonpart's bundle or vehicle's bundle?)
Definition: ActorSpawner.cpp:7400
RoR::ActorSpawner::ActorSpawnState::global_minimass
float global_minimass
'minimass' - used where 'set_default_minimass' is not applied.
Definition: ActorSpawner.h:450
RoR::ActorSpawner::AdjustNodeBuoyancy
void AdjustNodeBuoyancy(node_t &node, RigDef::Node &node_def, std::shared_ptr< RigDef::NodeDefaults > defaults)
For user-defined nodes.
Definition: ActorSpawner.cpp:4751
RoR::Actor::m_deletion_entities
std::vector< Ogre::Entity * > m_deletion_entities
For unloading vehicle; filled at spawn.
Definition: Actor.h:536
FlexBody.h
RigDef::Shock3::nodes
Node::Ref nodes[2]
Definition: RigDef_File.h:1232
RoR::FlexAirfoil::nbru
NodeNum_t nbru
Definition: FlexAirfoil.h:66
RoR::App::GetGameContext
GameContext * GetGameContext()
Definition: Application.cpp:280
RigDef::Hook::flag_no_disable
bool flag_no_disable
Definition: RigDef_File.h:967
RoR::CVar::getEnum
T getEnum() const
Definition: CVar.h:99
RoR::PROP_ANIM_FLAG_ACCEL
const PropAnimFlag_t PROP_ANIM_FLAG_ACCEL
Definition: GfxData.h:54
RigDef::Animation::ratio
float ratio
Definition: RigDef_File.h:544
RigDef::Airbrake::max_inclination_angle
float max_inclination_angle
Definition: RigDef_File.h:468
RoR::ActorSpawner::ProcessNode
void ProcessNode(RigDef::Node &def)
Definition: ActorSpawner.cpp:5893
RigDef::Wing::min_deflection
float min_deflection
Definition: RigDef_File.h:1468
RoR::node_t::friction_coef
Ogre::Real friction_coef
Definition: SimData.h:300
RigDef::Inertia
Definition: RigDef_File.h:441
RoR::wheel_t::BrakeCombo
BrakeCombo
Wheels are braked by three mechanisms: A footbrake, a handbrake/parkingbrake, and directional brakes ...
Definition: SimData.h:423
RigDef::Animator::aero_animator
AeroAnimator aero_animator
Definition: RigDef_File.h:593
RoR::ActorSpawner::m_managedmat_placeholder_template
Ogre::MaterialPtr m_managedmat_placeholder_template
An 'error marker' material (bright magenta) to generate managedmaterial placeholders from.
Definition: ActorSpawner.h:491
RigDef::Trigger::OPTION_s_CMD_NUM_SWITCH
static const BitMask_t OPTION_s_CMD_NUM_SWITCH
Definition: RigDef_File.h:1377
RoR::shock_t::springout
float springout
shocks2 & shocks3
Definition: SimData.h:384
RigDef::Animation::mode
BitMask_t mode
Definition: RigDef_File.h:549
RigDef::Animation::SOURCE_HEADING
static const BitMask64_t SOURCE_HEADING
Definition: RigDef_File.h:516
RigDef::Axle::options
DifferentialTypeVec options
Order matters!
Definition: RigDef_File.h:623
RoR::ActorSpawner::m_wing_area
float m_wing_area
Definition: ActorSpawner.h:471
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
RoR::shock_t::sprogout
float sprogout
shocks2
Definition: SimData.h:389
RoR::Actor::tc_timer
float tc_timer
Traction control state;.
Definition: Actor.h:356
RoR::TuneupUtil::getTweakedFlexbodyMedia
static std::string getTweakedFlexbodyMedia(TuneupDefPtr &tuneup_entry, FlexbodyID_t flexbody_id, int media_idx, const std::string &orig_val)
Definition: TuneupFileFormat.cpp:393
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
RoR::InputEngine::resolveEventName
static int resolveEventName(Ogre::String eventName)
Definition: InputEngine.cpp:2000
RoR::CmdKeyInertia
Designed to be run in physics loop (2khz)
Definition: CmdKeyInertia.h:45
RoR::AIRPLANE
@ AIRPLANE
its an airplane
Definition: SimData.h:94
RoR::Actor::ar_autopilot
Autopilot * ar_autopilot
Definition: Actor.h:376
RoR::Actor::m_dry_mass
float m_dry_mass
Physics attr;.
Definition: Actor.h:580
RoR::rotator_t::tolerance
float tolerance
Definition: SimData.h:609
RoR::ActorSpawner::CreateMirrorPropVideoCam
void CreateMirrorPropVideoCam(Ogre::MaterialPtr custom_mat, CustomMaterial::MirrorPropType type, Ogre::SceneNode *prop_scenenode)
Definition: ActorSpawner.cpp:7153
RoR::ActorSpawner::ProcessSlidenode
void ProcessSlidenode(RigDef::SlideNode &def)
Definition: ActorSpawner.cpp:2978
RigDef::Trigger::shortbound_trigger_action
int shortbound_trigger_action
Definition: RigDef_File.h:1390
RoR::BeamGfx::rod_is_visible
bool rod_is_visible
Definition: GfxData.h:289
RoR::TyrePressure::AddBeam
void AddBeam(int beam_id)
Definition: TyrePressure.h:46
RoR::VideoCamera::vcam_node_lookat
NodeNum_t vcam_node_lookat
Only for VCTYPE_TRACK_CAM.
Definition: GfxData.h:238
RoR::HYDRO_FLAG_ELEVATOR
@ HYDRO_FLAG_ELEVATOR
Definition: SimData.h:135
RoR::ActorSpawner::m_fuse_y_max
float m_fuse_y_max
Definition: ActorSpawner.h:477
RigDef::Hydro::OPTION_y_INPUT_InvAILERON_RUDDER
static const BitMask_t OPTION_y_INPUT_InvAILERON_RUDDER
Definition: RigDef_File.h:984
RoR::node_t::buoyancy
Ogre::Real buoyancy
Definition: SimData.h:299
RoR::Actor::m_prop_anim_key_states
std::vector< PropAnimKeyState > m_prop_anim_key_states
Definition: Actor.h:592
RigDef::Animation::SOURCE_PERMANENT
static const BitMask64_t SOURCE_PERMANENT
Definition: RigDef_File.h:524
RoR::ActorSpawner::ProcessRailGroup
void ProcessRailGroup(RigDef::RailGroup &def)
Definition: ActorSpawner.cpp:2971
RigDef::Beam::OPTION_s_SUPPORT
static const BitMask_t OPTION_s_SUPPORT
Definition: RigDef_File.h:630
RoR::ANIM_FLAG_AETORQUE
@ ANIM_FLAG_AETORQUE
Definition: SimData.h:161
RigDef::Rotator::engine_coupling
float engine_coupling
Definition: RigDef_File.h:1151
RoR::App::diag_videocameras
CVar * diag_videocameras
Definition: Application.cpp:139
RigDef::Hook::option_hook_range
float option_hook_range
Definition: RigDef_File.h:958
RoR::TuneupUtil::getTweakedManagedMatMediaRG
static std::string getTweakedManagedMatMediaRG(TuneupDefPtr &tuneup_def, const std::string &matname, int media_idx, const std::string &orig_val)
Definition: TuneupFileFormat.cpp:514
RoR::TuneupUtil::getTweakedWheelRimRadius
static float getTweakedWheelRimRadius(TuneupDefPtr &tuneup_entry, WheelID_t wheel_id, float orig_val)
Definition: TuneupFileFormat.cpp:137
RoR::Actor::ar_num_screwprops
int ar_num_screwprops
Definition: Actor.h:326
RigDef::Hydro::detacher_group
int detacher_group
Definition: RigDef_File.h:996
RoR::ActorSpawner::m_flares_parent_scenenode
Ogre::SceneNode * m_flares_parent_scenenode
this isn't used for moving/hiding things, just helps developers inspect the scene graph.
Definition: ActorSpawner.h:502
RoR::commandbeam_t::cmb_is_1press
bool cmb_is_1press
Attribute defined in truckfile.
Definition: SimData.h:568
RoR::Actor::ar_camera_node_roll_inv
bool ar_camera_node_roll_inv[MAX_CAMERAS]
Physics attr; 'camera' = frame of reference; indicates roll node is right instead of left.
Definition: Actor.h:388
RoR::hook_t::hk_locked_actor
ActorPtr hk_locked_actor
Definition: SimData.h:494
RigDef::BaseWheel2::tyre_damping
float tyre_damping
Definition: RigDef_File.h:438
RoR::beam_t::plastic_coef
float plastic_coef
Definition: SimData.h:345
RoR::SHOCK_FLAG_RACTIVE
@ SHOCK_FLAG_RACTIVE
Definition: SimData.h:199
RigDef::SpecialProp::MIRROR_LEFT
@ MIRROR_LEFT
RigDef::Shock3::options
BitMask_t options
Definition: RigDef_File.h:1246
RoR::ANIM_FLAG_ROLL
@ ANIM_FLAG_ROLL
Definition: SimData.h:149
RoR::PROP_ANIM_FLAG_THROTTLE
const PropAnimFlag_t PROP_ANIM_FLAG_THROTTLE
Definition: GfxData.h:52
RoR::Actor::m_flares_mode
GfxFlaresMode m_flares_mode
Snapshot of cvar 'gfx_flares_mode' on spawn.
Definition: Actor.h:609
RoR::Actor::ar_nodes_name_top_length
int ar_nodes_name_top_length
For nicely formatted diagnostic output.
Definition: Actor.h:276
RigDef::Engturbo::param5
float param5
Definition: RigDef_File.h:842
RigDef::MinimassOption::l_SKIP_LOADED
@ l_SKIP_LOADED
Only apply minimum mass to nodes without "L" option.
RoR::CabTexcoord::node_id
int node_id
Definition: FlexObj.h:40
RoR::SUPPORTBEAM
@ SUPPORTBEAM
Definition: SimData.h:112
RoR::ActorSpawner::CustomMaterial::MirrorPropType::MPROP_LEFT
@ MPROP_LEFT
FlexMesh.h
RigDef::Trigger::OPTION_b_KEY_BLOCKER
static const BitMask_t OPTION_b_KEY_BLOCKER
Definition: RigDef_File.h:1374
RigDef::Animator::OPTION_AIRSPEED
static const BitMask_t OPTION_AIRSPEED
Definition: RigDef_File.h:560
RoR::FlareMaterial::mat_instance
Ogre::MaterialPtr mat_instance
Definition: GfxData.h:315
RoR::VideoCamera
An Ogre::Camera mounted on the actor and rendering into either in-scene texture or external window.
Definition: GfxData.h:231
RoR::beam_t::bm_type
BeamType bm_type
Definition: SimData.h:348
RigDef::SpecialProp::BEACON
@ BEACON
RigDef::Engoption::stall_rpm
float stall_rpm
Definition: RigDef_File.h:825
RigDef::Engturbo::tinertiaFactor
float tinertiaFactor
Definition: RigDef_File.h:836
RigDef::MaterialFlareBinding
Definition: RigDef_File.h:1031
RigDef::Beam::OPTION_i_INVISIBLE
static const BitMask_t OPTION_i_INVISIBLE
Definition: RigDef_File.h:628
RoR::wheeldetacher_t
Definition: SimData.h:465
RigDef::Animation::SOURCE_ALTIMETER_1K
static const BitMask64_t SOURCE_ALTIMETER_1K
Definition: RigDef_File.h:498
RoR::AirbrakeGfx::abx_scenenode
Ogre::SceneNode * abx_scenenode
Definition: GfxData.h:304
RoR::ActorSpawner::SetBeamStrength
void SetBeamStrength(beam_t &beam, float strength)
Definition: ActorSpawner.cpp:3897
RigDef::Prop::mesh_name
Ogre::String mesh_name
Definition: RigDef_File.h:1111
RoR::VideoCamState::VCSTATE_DISABLED
@ VCSTATE_DISABLED
RoR::App::gfx_flares_mode
CVar * gfx_flares_mode
Definition: Application.cpp:215
RigDef::VideoCamera::field_of_view
float field_of_view
Definition: RigDef_File.h:1428
RoR::hydrobeam_t::hb_beam_index
uint16_t hb_beam_index
Index to Actor::ar_beams array.
Definition: SimData.h:590
RoR::AeroEngine::getRadius
virtual float getRadius()=0
RoR::tie_t::ti_beam
beam_t * ti_beam
Definition: SimData.h:525
RoR::Actor::m_railgroups
std::vector< RailGroup * > m_railgroups
all the available RailGroups for this actor
Definition: Actor.h:535
RigDef::SpeedLimiter
Definition: RigDef_File.h:1291
MeshObject::GetSceneNode
Ogre::SceneNode * GetSceneNode()
Definition: MeshObject.h:44
RoR::ActorSpawner::CheckSoundScriptLimit
static bool CheckSoundScriptLimit(ActorPtr const &vehicle, unsigned int count)
Definition: ActorSpawner.cpp:6178
RoR::ActorSpawner::ProcessDescription
void ProcessDescription(Ogre::String const &line)
Definition: ActorSpawner.cpp:849
RoR::Actor::ar_num_beams
int ar_num_beams
Definition: Actor.h:282
RoR::ActorSpawner::m_cab_material_name
std::string m_cab_material_name
Original name defined in truckfile/globals.
Definition: ActorSpawner.h:469
RoR::ActorSpawner::ProcessInterAxle
void ProcessInterAxle(RigDef::InterAxle &def)
Definition: ActorSpawner.cpp:2719
frand
float frand()
Definition: ApproxMath.h:31
RigDef::Beam::defaults
std::shared_ptr< BeamDefaults > defaults
Definition: RigDef_File.h:637
RoR::wheeldetacher_t::wd_wheel_id
int wd_wheel_id
Definition: SimData.h:467
RigDef::Lockgroup
Definition: RigDef_File.h:1006
RigDef::Hook::option_max_force
float option_max_force
Definition: RigDef_File.h:960
RoR::CabTexcoord::texcoord_v
float texcoord_v
Definition: FlexObj.h:42
RigDef::BaseWheel2::tyre_springiness
float tyre_springiness
Definition: RigDef_File.h:437
RoR::TransferCase::tr_ax_1
int tr_ax_1
This axle is always driven.
Definition: Differentials.h:47
RigDef::Flare2::node_axis_x
Node::Ref node_axis_x
Definition: RigDef_File.h:879
RoR::ActorSpawner::ProcessParticle
void ProcessParticle(RigDef::Particle &def)
Definition: ActorSpawner.cpp:2857
RoR::ActorSpawner::ProcessCollisionBox
void ProcessCollisionBox(RigDef::CollisionBox &def)
Definition: ActorSpawner.cpp:2604
RigDef::Animator
Definition: RigDef_File.h:556
RoR::VCTYPE_MIRROR_PROP_RIGHT
@ VCTYPE_MIRROR_PROP_RIGHT
The classic 'special prop/rear view mirror'.
Definition: GfxData.h:226
ApproxMath.h
RigDef::Wheel2::face_material_name
Ogre::String face_material_name
Definition: RigDef_File.h:1452
RoR::ActorSpawner::m_state
ActorSpawnState m_state
Definition: ActorSpawner.h:468
RoR::Actor::getUsedActorEntry
CacheEntryPtr & getUsedActorEntry()
The actor entry itself.
Definition: Actor.cpp:4709
RoR::cparticle_t
Definition: SimData.h:648
RigDef::SpeedLimiter::max_speed
float max_speed
Definition: RigDef_File.h:1293
RigDef::Brakes::parking_brake_force
float parking_brake_force
Definition: RigDef_File.h:706
RoR::ActorSpawner::ActorMemoryRequirements::num_nodes
size_t num_nodes
Definition: ActorSpawner.h:78
RoR::Actor::tc_mode
bool tc_mode
Traction control state; Enabled? {1/0}.
Definition: Actor.h:351
RoR::PROP_ANIM_FLAG_PITCH
const PropAnimFlag_t PROP_ANIM_FLAG_PITCH
Definition: GfxData.h:51
RigDef::Author::email
Ogre::String email
Definition: RigDef_File.h:616
RigDef::Rope::end_node
Node::Ref end_node
Definition: RigDef_File.h:1135
RoR::Prop::pp_rota
Ogre::Vector3 pp_rota
Definition: GfxData.h:170
RigDef::Flexbody
Definition: RigDef_File.h:895
RoR::ActorSpawner::ProcessTie
void ProcessTie(RigDef::Tie &def)
Definition: ActorSpawner.cpp:2906
RoR::ActorSpawner::CreateMeshWheelVisuals
void CreateMeshWheelVisuals(WheelID_t wheel_id, NodeNum_t base_node_index, NodeNum_t axis_node_1_index, NodeNum_t axis_node_2_index, unsigned int num_rays, WheelSide side, Ogre::String mesh_name, Ogre::String mesh_rg, Ogre::String material_name, Ogre::String material_rg, float rim_radius)
Definition: ActorSpawner.cpp:4620
RigDef::Hook::option_min_range_meters
float option_min_range_meters
Definition: RigDef_File.h:964
RoR::PROP_ANIM_FLAG_TURBO
const PropAnimFlag_t PROP_ANIM_FLAG_TURBO
Definition: GfxData.h:60
RigDef::SpecialProp::DASHBOARD_RIGHT
@ DASHBOARD_RIGHT
RoR::ActorSpawner::UpdateCollcabContacterNodes
void UpdateCollcabContacterNodes()
Definition: ActorSpawner.cpp:6455
RigDef::Engturbo::param10
float param10
Definition: RigDef_File.h:847
RoR::VCTYPE_TRACKING_VIDEOCAM
@ VCTYPE_TRACKING_VIDEOCAM
Definition: GfxData.h:223
RoR::VideoCamera::vcam_prop_scenenode
Ogre::SceneNode * vcam_prop_scenenode
Only for VCTYPE_MIRROR_PROP_*.
Definition: GfxData.h:248
RoR::BeamGfx::rod_scenenode
Ogre::SceneNode * rod_scenenode
Definition: GfxData.h:282
RoR::PropAnim::animOpt5
float animOpt5
Definition: GfxData.h:151
RoR::Actor::ar_num_cinecams
int ar_num_cinecams
Sim attr;.
Definition: Actor.h:375
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
FlexAirfoil.h
RoR::FlexFactory::SaveFlexbodiesToCache
void SaveFlexbodiesToCache()
Definition: FlexFactory.cpp:417
RigDef::Cab::OPTION_D_CONTACT_BUOYANT
static const BitMask_t OPTION_D_CONTACT_BUOYANT
Definition: RigDef_File.h:717
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
RoR::Actor::ar_collision_range
float ar_collision_range
Physics attr.
Definition: Actor.h:428
RoR::NodeGfx::nx_may_get_wet
bool nx_may_get_wet
Attr; enables water drip and vapour.
Definition: GfxData.h:268
RigDef::Trigger::OPTION_t_CONTINUOUS
static const BitMask_t OPTION_t_CONTINUOUS
Definition: RigDef_File.h:1380
RoR::EngineSim::SetEngineOptions
void SetEngineOptions(float einertia, char etype, float eclutch, float ctime, float stime, float pstime, float irpm, float srpm, float maximix, float minimix, float ebraking)
Sets engine options.
Definition: EngineSim.cpp:197
RigDef::FlexBodyWheel::side
RoR::WheelSide side
Definition: RigDef_File.h:911
RoR::ActorSpawner::SetBeamDamping
void SetBeamDamping(beam_t &beam, float damping)
Definition: ActorSpawner.cpp:6290
RigDef::Animation::SOURCE_GEAR_NEUTRAL
static const BitMask64_t SOURCE_GEAR_NEUTRAL
Definition: RigDef_File.h:529
RigDef::Animation::SOURCE_ACCEL
static const BitMask64_t SOURCE_ACCEL
Definition: RigDef_File.h:505
RigDef::Submesh::texcoords
std::vector< Texcoord > texcoords
Definition: RigDef_File.h:1302
RoR::SHOCK_FLAG_TRG_CMD_SWITCH
@ SHOCK_FLAG_TRG_CMD_SWITCH
Definition: SimData.h:205
RoR::ANIM_FLAG_BRAKE
@ ANIM_FLAG_BRAKE
Definition: SimData.h:154
RoR::ActorSpawner::m_curr_mirror_prop_scenenode
Ogre::SceneNode * m_curr_mirror_prop_scenenode
Definition: ActorSpawner.h:496
PointColDetector.h
RigDef::WheelBraking::FOOT_HAND_SKID_LEFT
@ FOOT_HAND_SKID_LEFT
RigDef::Wing::airfoil
Ogre::String airfoil
Definition: RigDef_File.h:1470
RoR::Actor::m_disable_smoke
bool m_disable_smoke
Stops/starts smoke particles (i.e. exhausts, turbojets).
Definition: Actor.h:628
WHEEL_FRICTION_COEF
static const float WHEEL_FRICTION_COEF
Definition: SimConstants.h:63
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
RoR::TuneupUtil::isFlareAnyhowRemoved
static bool isFlareAnyhowRemoved(TuneupDefPtr &tuneup_def, FlareID_t flare_id)
Definition: TuneupFileFormat.cpp:450
RoR::VideoCamera::vcam_node_alt_pos
NodeNum_t vcam_node_alt_pos
Definition: GfxData.h:237
RoR::UniqueCommandKeyPair::uckp_description
std::string uckp_description
Definition: SimData.h:697
RigDef::Shock2::beam_defaults
std::shared_ptr< BeamDefaults > beam_defaults
Definition: RigDef_File.h:1220
RigDef::Turboprop2
Definition: RigDef_File.h:1407
RoR::PROP_ANIM_FLAG_HEADING
const PropAnimFlag_t PROP_ANIM_FLAG_HEADING
Definition: GfxData.h:66
RoR::ActorSpawner::CheckAxleLimit
bool CheckAxleLimit(unsigned int count)
Definition: ActorSpawner.cpp:6141
RoR::authorinfo_t::email
Ogre::String email
Definition: SimData.h:829
RoR::Prop::pp_media
std::string pp_media[2]
Redundant, for Tuning UI. Media1 = prop mesh name, Media2 = steeringwheel mesh/beaconprop flare mat.
Definition: GfxData.h:174
RoR::Actor::m_total_mass
float m_total_mass
Physics state; total mass in Kg.
Definition: Actor.h:551
RoR::authorinfo_t::type
Ogre::String type
Definition: SimData.h:827
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::Fusedrag::front_node
Node::Ref front_node
Definition: RigDef_File.h:923
RigDef::SpecialProp::DRIVER_SEAT_2
@ DRIVER_SEAT_2
RoR::FlexAirfoil::enableInducedDrag
void enableInducedDrag(float span, float area, bool l)
Definition: FlexAirfoil.cpp:575
RoR::ActorSpawner::CollectNodesFromRanges
bool CollectNodesFromRanges(std::vector< RigDef::Node::Range > &node_ranges, std::vector< NodeNum_t > &out_node_indices)
Parses list of node-ranges into list of individual nodes.
Definition: ActorSpawner.cpp:3063
RoR::SHOCK_FLAG_ISSHOCK3
@ SHOCK_FLAG_ISSHOCK3
Definition: SimData.h:201
RigDef::Cab::OPTION_s_BUOYANT_NO_DRAG
static const BitMask_t OPTION_s_BUOYANT_NO_DRAG
Definition: RigDef_File.h:715
MAX_CAMERARAIL
static const int MAX_CAMERARAIL
maximum number of camera rail points
Definition: SimConstants.h:34
RoR::flare_t::snode
Ogre::SceneNode * snode
Definition: SimData.h:623
RigDef::BaseMeshWheel::tyre_radius
float tyre_radius
Definition: RigDef_File.h:428
RoR::hydrobeam_t::hb_flags
int hb_flags
Definition: SimData.h:593
RoR::ANIM_FLAG_PBRAKE
@ ANIM_FLAG_PBRAKE
Definition: SimData.h:158
RoR::TuneupUtil::getTweakedFlexbodyRotation
static Ogre::Vector3 getTweakedFlexbodyRotation(TuneupDefPtr &tuneup_entry, FlexbodyID_t flexbody_id, Ogre::Vector3 orig_val)
Definition: TuneupFileFormat.cpp:379
DEFAULT_SPEEDO_MAX_KPH
static const float DEFAULT_SPEEDO_MAX_KPH
Definition: SimConstants.h:80
RoR::FlexBody::PlaceholderType::TUNING_REMOVED_PLACEHOLDER
@ TUNING_REMOVED_PLACEHOLDER
RoR::TorqueCurve::CreateNewCurve
bool CreateNewCurve(Ogre::String const &name=customModel)
Creates new torque curve.
Definition: TorqueCurve.cpp:135
RoR::Actor::ar_brake_force
float ar_brake_force
Physics attr; filled at spawn.
Definition: Actor.h:377
SOUND_MODULATE
#define SOUND_MODULATE(_ACTOR_, _MOD_, _VALUE_)
Definition: SoundScriptManager.h:40
RigDef::Minimass::global_min_mass_Kg
float global_min_mass_Kg
minimum node mass in Kg - only effective where DefaultMinimass was not set.
Definition: RigDef_File.h:1039
RoR::Actor::ar_is_police
bool ar_is_police
Gfx/sfx attr.
Definition: Actor.h:472
RigDef::VideoCamera::offset
Ogre::Vector3 offset
Definition: RigDef_File.h:1426
RoR::shock_t::dslowout
float dslowout
shocks3
Definition: SimData.h:396
Skidmark.h
RoR::Actor::cc_can_brake
bool cc_can_brake
Cruise Control.
Definition: Actor.h:359
RoR::Actor::alb_timer
float alb_timer
Anti-lock brake state;.
Definition: Actor.h:349
HOOK_LOCK_TIMER_DEFAULT
static const float HOOK_LOCK_TIMER_DEFAULT
Definition: SimConstants.h:77
RigDef::Hydro::OPTION_s_DISABLE_ON_HIGH_SPEED
static const BitMask_t OPTION_s_DISABLE_ON_HIGH_SPEED
Definition: RigDef_File.h:976
RoR::Actor::alb_mode
bool alb_mode
Anti-lock brake state; Enabled? {1/0}.
Definition: Actor.h:344
RoR::ActorSpawner::ProcessSoundSource2
void ProcessSoundSource2(RigDef::SoundSource2 &def)
Definition: ActorSpawner.cpp:1162
RigDef::Engine::reverse_gear_ratio
float reverse_gear_ratio
Definition: RigDef_File.h:811
RoR::wheel_t::wh_arm_node
node_t * wh_arm_node
Definition: SimData.h:437
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
RoR::App::GetCacheSystem
CacheSystem * GetCacheSystem()
Definition: Application.cpp:272
RigDef::ManagedMaterialsOptions::double_sided
bool double_sided
Definition: RigDef_File.h:1018
RoR::rope_t
Definition: SimData.h:507
RoR::node_t::volume_coef
Ogre::Real volume_coef
Definition: SimData.h:302
RigDef::Engturbo::nturbos
int nturbos
Definition: RigDef_File.h:837
RoR::ActorSpawner::ProcessAntiLockBrakes
void ProcessAntiLockBrakes(RigDef::AntiLockBrakes &def)
Definition: ActorSpawner.cpp:5333
RoR::wheel_t::BrakeCombo::FOOT_HAND
@ FOOT_HAND
RoR::FlexBody::fb_camera_mode_orig
CameraMode_t fb_camera_mode_orig
Dynamic visibility mode {0 and higher = cinecam index}.
Definition: FlexBody.h:74
RoR::Actor::m_num_proped_wheels
int m_num_proped_wheels
Physics attr, filled at spawn - Number of propelled wheels.
Definition: Actor.h:539
RoR::CabSubmesh::BACKMESH_TRANSPARENT
@ BACKMESH_TRANSPARENT
Definition: FlexObj.h:48
RoR::ActorSpawner::BuildWheelObjectAndNodes
void BuildWheelObjectAndNodes(WheelID_t wheel_id, unsigned int num_rays, node_t *axis_node_1, node_t *axis_node_2, node_t *reference_arm_node, unsigned int reserve_nodes, unsigned int reserve_beams, float wheel_radius, RigDef::WheelPropulsion propulsion, RigDef::WheelBraking braking, std::shared_ptr< RigDef::NodeDefaults > node_defaults, float wheel_mass, float wheel_width=-1.f)
Sets up wheel and builds nodes for sections 'wheels', 'meshwheels' and 'meshwheels2'.
Definition: ActorSpawner.cpp:4668
RoR::ActorSpawner::ProcessWheel
void ProcessWheel(RigDef::Wheel &def)
Definition: ActorSpawner.cpp:5281
RigDef::Animation::SOURCE_TURBO
static const BitMask64_t SOURCE_TURBO
Definition: RigDef_File.h:509
RigDef::Exhaust::direction_node
Node::Ref direction_node
Definition: RigDef_File.h:854
RoR::wheel_t::wh_radius
Ogre::Real wh_radius
Definition: SimData.h:442
RigDef::Rotator::rotating_plate_nodes
Node::Ref rotating_plate_nodes[4]
Definition: RigDef_File.h:1145
RoR::ActorSpawner::ProcessCameraRail
void ProcessCameraRail(RigDef::CameraRail &def)
Definition: ActorSpawner.cpp:1216
RoR::CabSubmesh::cabs_pos
size_t cabs_pos
Definition: FlexObj.h:54
RoR::DashBoardManager
Definition: DashBoardManager.h:205
RoR::SHOCK_FLAG_TRG_ENGINE
@ SHOCK_FLAG_TRG_ENGINE
Definition: SimData.h:211
RoR::flare_t::controlnumber
int controlnumber
Only 'u' type flares, valid values 0-9, maps to EV_TRUCK_LIGHTTOGGLE01 to 10.
Definition: SimData.h:627
RoR::Airbrake::msh
Ogre::MeshPtr msh
Definition: AirBrake.h:48
RigDef::Globals::material_name
Ogre::String material_name
Definition: RigDef_File.h:934
RoR::PropAnim::animOpt3
float animOpt3
MULTIPURPOSE.
Definition: GfxData.h:150
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
RoR::ActorSpawner::AddSoundSourceInstance
static void AddSoundSourceInstance(ActorPtr const &vehicle, Ogre::String const &sound_script_name, int node_index, int type=-2)
Definition: ActorSpawner.cpp:1179
TurboProp.h
RoR::Actor::ar_nodes
node_t * ar_nodes
Definition: Actor.h:273
RoR::authorinfo_t::id
int id
Definition: SimData.h:826
ROTATOR_FORCE_DEFAULT
static const float ROTATOR_FORCE_DEFAULT
Definition: SimConstants.h:72
RoR::UniqueCommandKeyPair
UI helper for displaying command control keys to user.
Definition: SimData.h:695
RoR::Prop::pp_animations
std::vector< PropAnim > pp_animations
Definition: GfxData.h:175
RigDef::Document::Module::shocks3
std::vector< Shock3 > shocks3
Definition: RigDef_File.h:1542
RoR::Prop::pp_camera_mode_active
CameraMode_t pp_camera_mode_active
Dynamic visibility mode {0 and higher = cinecam index}.
Definition: GfxData.h:179
RoR::ActorSpawner::WashCalculator
void WashCalculator()
Definition: ActorSpawner.cpp:619
RoR::Actor::m_has_axles_section
bool m_has_axles_section
Temporary (legacy parsing helper) until central diffs are implemented.
Definition: Actor.h:589
RigDef::BaseWheel::propulsion
WheelPropulsion propulsion
Definition: RigDef_File.h:415
RoR::ActorSpawner::m_airplane_left_light
int m_airplane_left_light
Definition: ActorSpawner.h:472
RoR::GfxActor::RegisterCabMesh
void RegisterCabMesh(Ogre::Entity *ent, Ogre::SceneNode *snode, FlexObj *flexobj)
Definition: GfxActor.cpp:3293
RoR::ActorSpawner::ProcessExhaust
void ProcessExhaust(RigDef::Exhaust &def)
Definition: ActorSpawner.cpp:1278
RigDef::Node::OPTION_c_NO_GROUND_CONTACT
static const BitMask_t OPTION_c_NO_GROUND_CONTACT
Definition: RigDef_Node.h:150
BEAM_CREAK_DEFAULT
static const float BEAM_CREAK_DEFAULT
Definition: SimConstants.h:62
RoR::BeamGfx::rod_node2
NodeNum_t rod_node2
Node index - may change during simulation!
Definition: GfxData.h:287
RigDef::Exhaust::particle_name
Ogre::String particle_name
Definition: RigDef_File.h:855
RoR::ActorSpawner::CustomMaterial::mirror_prop_type
MirrorPropType mirror_prop_type
Definition: ActorSpawner.h:140
RoR::ANIM_FLAG_AEPITCH
@ ANIM_FLAG_AEPITCH
Definition: SimData.h:162
RoR::cparticle_t::psys
Ogre::ParticleSystem * psys
Definition: SimData.h:654
RigDef::Exhaust::reference_node
Node::Ref reference_node
Definition: RigDef_File.h:853
RoR::TuneupUtil::getTweakedFlexbodyOffset
static Ogre::Vector3 getTweakedFlexbodyOffset(TuneupDefPtr &tuneup_entry, FlexbodyID_t flexbody_id, Ogre::Vector3 orig_val)
Definition: TuneupFileFormat.cpp:365
RoR::node_t::nd_rim_node
bool nd_rim_node
Attr; This node is part of a rim (only wheel types with separate rim nodes)
Definition: SimData.h:310
RigDef::Tie
Definition: RigDef_File.h:1313
SkinFileFormat.h
RigDef::Animator::beam_defaults
std::shared_ptr< BeamDefaults > beam_defaults
Definition: RigDef_File.h:595
RigDef::SlideNode::CONSTRAINT_ATTACH_NONE
static const BitMask_t CONSTRAINT_ATTACH_NONE
Definition: RigDef_File.h:1262
RoR::App::sim_no_collisions
CVar * sim_no_collisions
Definition: Application.cpp:106
RigDef::Animator::OPTION_ALTIMETER_100K
static const BitMask_t OPTION_ALTIMETER_100K
Definition: RigDef_File.h:562
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
RoR::TuneupUtil::getTweakedPropMediaRG
static std::string getTweakedPropMediaRG(TuneupDefPtr &tuneup_def, PropID_t prop_id, int media_idx, const std::string &orig_val)
Definition: TuneupFileFormat.cpp:316
RoR::Actor::m_used_skin_entry
CacheEntryPtr m_used_skin_entry
Graphics.
Definition: Actor.h:583
RigDef::WheelBraking::NONE
@ NONE
RigDef::Node::Id
Abstract node ID (numbered or named) Node name is always available.
Definition: RigDef_Node.h:44
RigDef::WheelDetacher
Definition: RigDef_File.h:1456
RoR::HYDRO_FLAG_RUDDER
@ HYDRO_FLAG_RUDDER
Definition: SimData.h:134
RoR::hook_t::hk_lockrange
float hk_lockrange
Definition: SimData.h:486
RoR::GfxFlaresMode
GfxFlaresMode
Definition: Application.h:238
RoR::VideoCamera::vcam_node_dir_z
NodeNum_t vcam_node_dir_z
Definition: GfxData.h:236
RigDef::Document::Module::flexbodywheels
std::vector< FlexBodyWheel > flexbodywheels
Definition: RigDef_File.h:1514
Buoyance.h
RigDef::ManagedMaterialType::FLEXMESH_TRANSPARENT
@ FLEXMESH_TRANSPARENT
RoR::beam_t::k
float k
tensile spring
Definition: SimData.h:337
RigDef::Node::OPTION_h_HOOK_POINT
static const BitMask_t OPTION_h_HOOK_POINT
Definition: RigDef_Node.h:151
RoR::EngineSim::m_turbo_inertia_factor
float m_turbo_inertia_factor
Definition: EngineSim.h:230
RoR::BEAM_HYDRO
@ BEAM_HYDRO
Definition: SimData.h:72
RoR::flare_t
Definition: SimData.h:615
RoR::CacheSystem::LoadResource
void LoadResource(CacheEntryPtr &t)
Loads the associated resource bundle if not already done.
Definition: CacheSystem.cpp:1434
MAX_SOUNDSCRIPTS_PER_TRUCK
static const int MAX_SOUNDSCRIPTS_PER_TRUCK
maximum number of soundsscripts per actor
Definition: SimConstants.h:32
RigDef::Rotator2::tolerance
float tolerance
Definition: RigDef_File.h:1158
RigDef::Rotator
Definition: RigDef_File.h:1141
RoR::tie_t
Definition: SimData.h:519
RigDef::Turbojet::side_node
Node::Ref side_node
Definition: RigDef_File.h:1398
RigDef::Animation::MotorSource::SOURCE_AERO_THROTTLE
static const BitMask_t SOURCE_AERO_THROTTLE
Definition: RigDef_File.h:481
RoR::Actor::ar_driveable
ActorType ar_driveable
Sim attr; marks vehicle type and features.
Definition: Actor.h:372
RigDef::Minimass::option
MinimassOption option
Definition: RigDef_File.h:1040
RoR::AeroEngine::getType
virtual AeroEngineType getType()=0
RoR::ActorSpawner::GetNodePointer
node_t * GetNodePointer(RigDef::Node::Ref const &node_ref)
Definition: ActorSpawner.cpp:5824
RoR::ActorSpawner::ProcessProp
void ProcessProp(RigDef::Prop &def)
Resource group override is used with addonparts.
Definition: ActorSpawner.cpp:1586
RigDef::TransferCase::has_2wd
bool has_2wd
Definition: RigDef_File.h:1364
RoR::WheelGfx::wx_wheel_id
WheelID_t wx_wheel_id
Definition: GfxData.h:294
RoR::SHOCK_FLAG_TRG_CMD_BLOCKER
@ SHOCK_FLAG_TRG_CMD_BLOCKER
Definition: SimData.h:206
_L
#define _L
Definition: ErrorUtils.cpp:34
RigDef::Fusedrag
Definition: RigDef_File.h:918
RoR::Screwprop
Definition: ScrewProp.h:34
RoR::TRIGGER
@ TRIGGER
trigger
Definition: SimData.h:111
RoR::Prop::pp_aero_propeller_blade
bool pp_aero_propeller_blade
Special - single blade mesh.
Definition: GfxData.h:199
RigDef::Trigger::boundary_timer
float boundary_timer
Definition: RigDef_File.h:1387
RoR::Actor::ar_exhaust_pos_node
NodeNum_t ar_exhaust_pos_node
Old-format exhaust (one per vehicle) emitter node.
Definition: Actor.h:368
RoR::Actor::m_axle_diffs
Differential * m_axle_diffs[1+MAX_WHEELS/2]
Physics.
Definition: Actor.h:563
RigDef::Animation::SOURCE_BRAKES
static const BitMask64_t SOURCE_BRAKES
Definition: RigDef_File.h:504
RigDef::DifferentialType::s_SPLIT
@ s_SPLIT
RigDef::Globals::cargo_mass
float cargo_mass
Definition: RigDef_File.h:933
RoR::TuneupUtil::isExhaustAnyhowRemoved
static bool isExhaustAnyhowRemoved(TuneupDefPtr &tuneup_def, ExhaustID_t exhaust_id)
Definition: TuneupFileFormat.cpp:457
RoR::Actor::alb_nodash
bool alb_nodash
Anti-lock brake attribute: Hide the dashboard indicator?
Definition: Actor.h:347
RoR::Actor::m_intra_point_col_detector
PointColDetector * m_intra_point_col_detector
Physics.
Definition: Actor.h:543
RigDef::Wheel::springiness
float springiness
Definition: RigDef_File.h:1442
RoR::Actor::m_odometer_total
float m_odometer_total
GUI state.
Definition: Actor.h:575
RoR::Actor::alb_minspeed
float alb_minspeed
Anti-lock brake attribute;.
Definition: Actor.h:343
RigDef::Airbrake::texcoord_y2
float texcoord_y2
Definition: RigDef_File.h:472
RoR::beam_t::longbound
float longbound
Definition: SimData.h:355
RigDef::Engine
Definition: RigDef_File.h:805
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
RoR::Actor::ar_ropes
std::vector< rope_t > ar_ropes
Definition: Actor.h:293
RoR::Actor::ar_num_cameras
int ar_num_cameras
Definition: Actor.h:380
RigDef::Author::type
Ogre::String type
Definition: RigDef_File.h:613
RoR::TuneupUtil::getTweakedWheelMediaRG
static std::string getTweakedWheelMediaRG(TuneupDefPtr &tuneup_def, WheelID_t wheel_id, int media_idx, const std::string &orig_val)
Definition: TuneupFileFormat.cpp:166
RoR::PROP_ANIM_FLAG_AEPITCH
const PropAnimFlag_t PROP_ANIM_FLAG_AEPITCH
Definition: GfxData.h:63
RigDef::WheelBraking::FOOT_HAND
@ FOOT_HAND
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
RoR::commandbeam_t
Definition: SimData.h:554
RoR::PROP_ANIM_FLAG_ELEVATORS
const PropAnimFlag_t PROP_ANIM_FLAG_ELEVATORS
Definition: GfxData.h:75
RoR::ActorSpawner::Message::TYPE_ERROR
@ TYPE_ERROR
RoR::beam_t::maxnegstress
float maxnegstress
Definition: SimData.h:342
RigDef::Beam::detacher_group
int detacher_group
Definition: RigDef_File.h:636
RoR::HYDRO_FLAG_REV_ELEVATOR
@ HYDRO_FLAG_REV_ELEVATOR
Definition: SimData.h:138
RoR::ActorSpawner::ProcessPistonprop
void ProcessPistonprop(RigDef::Pistonprop &def)
Definition: ActorSpawner.cpp:854
RigDef::TractionControl::attr_no_toggle
bool attr_no_toggle
Definition: RigDef_File.h:1357
RoR::cparticle_t::emitterNode
NodeNum_t emitterNode
Definition: SimData.h:650
RoR::beam_t::minmaxposnegstress
float minmaxposnegstress
Definition: SimData.h:340
RigDef::Wheel::band_material_name
Ogre::String band_material_name
Definition: RigDef_File.h:1445
RoR::FlareID_t
int FlareID_t
Index into Actor::ar_flares, use RoR::FLAREID_INVALID as empty value.
Definition: ForwardDeclarations.h:68
RoR::wheel_t::wh_axis_node_0
node_t * wh_axis_node_0
Definition: SimData.h:439
RoR::Actor::ar_wings
wing_t * ar_wings
Definition: Actor.h:289
RoR::ActorSpawner::m_fuse_y_min
float m_fuse_y_min
Definition: ActorSpawner.h:476
RoR::ActorSpawner::CreateWheelVisuals
void CreateWheelVisuals(WheelID_t wheel_id, NodeNum_t node_base_index, unsigned int def_num_rays, Ogre::String const &face_material_name, Ogre::String const &face_material_rg, Ogre::String const &band_material_name, Ogre::String const &band_material_rg, bool separate_rim, float rim_ratio=1.f)
Definition: ActorSpawner.cpp:5104
RoR::GfxFlaresMode::NONE
@ NONE
None (fastest)
RoR::ActorSpawner::GetFreeShock
shock_t & GetFreeShock()
Definition: ActorSpawner.cpp:6263
RigDef::Beam::options
BitMask_t options
Definition: RigDef_File.h:633
RoR::ActorSpawner::ProcessTurbojet
void ProcessTurbojet(RigDef::Turbojet &def)
Definition: ActorSpawner.cpp:660
RoR::shock_t::dampin
float dampin
shocks2 & shocks3
Definition: SimData.h:383
RoR::RailGroup::rg_id
int rg_id
Spawn context - matching separately defined rails with slidenodes.
Definition: SlideNode.h:61
RoR::flare_t::blinkdelay_curr
float blinkdelay_curr
Definition: SimData.h:630
RoR::Actor::alb_ratio
float alb_ratio
Anti-lock brake attribute: Regulating force.
Definition: Actor.h:342
RigDef::Hydro::OPTION_j_INVISIBLE
static const BitMask_t OPTION_j_INVISIBLE
Definition: RigDef_File.h:974
RoR::Actor::ar_anim_shift_timer
float ar_anim_shift_timer
For 'animator' with flag 'shifter'.
Definition: Actor.h:357
RoR::TuneupUtil::getTweakedWheelSide
static WheelSide getTweakedWheelSide(TuneupDefPtr &tuneup_entry, WheelID_t wheel_id, WheelSide orig_val)
Definition: TuneupFileFormat.cpp:193
RoR::ropable_t::group
int group
Definition: SimData.h:501
RoR::hook_t::hk_lockgroup
int hk_lockgroup
Definition: SimData.h:481
RigDef::Camera::center_node
Node::Ref center_node
Definition: RigDef_File.h:727
RigDef::Animation::source
BitMask64_t source
Definition: RigDef_File.h:547
RoR::Actor::ar_num_wheels
int ar_num_wheels
Definition: Actor.h:318
RoR::ActorSpawner::CalculateBeamLength
void CalculateBeamLength(beam_t &beam)
Definition: ActorSpawner.cpp:5738
RigDef::FlexBodyWheel::rim_damping
float rim_damping
Definition: RigDef_File.h:913
RigDef::Shock3::short_bound
float short_bound
Maximum contraction limit, in percentage ( 1.00 = 100% )
Definition: RigDef_File.h:1243
RoR::ActorSpawner::m_spawn_position
Ogre::Vector3 m_spawn_position
Definition: ActorSpawner.h:459
RoR::PROP_ANIM_FLAG_BRUDDER
const PropAnimFlag_t PROP_ANIM_FLAG_BRUDDER
Definition: GfxData.h:72
RigDef::Engoption::idle_rpm
float idle_rpm
Definition: RigDef_File.h:824
RigDef::Engturbo::param7
float param7
Definition: RigDef_File.h:844
RoR::App::GetInputEngine
InputEngine * GetInputEngine()
Definition: Application.cpp:271
RoR::TuneupUtil::getTweakedWheelTireRadius
static float getTweakedWheelTireRadius(TuneupDefPtr &tuneup_entry, WheelID_t wheel_id, float orig_val)
Definition: TuneupFileFormat.cpp:123
RoR::beam_t::detacher_group
int detacher_group
Attribute: detacher group number (integer)
Definition: SimData.h:346
RoR::ANIM_FLAG_PITCH
@ ANIM_FLAG_PITCH
Definition: SimData.h:150
RigDef::AeroAnimator::engine_idx
unsigned int engine_idx
Definition: RigDef_File.h:400
RoR::ActorSpawner::ProcessCruiseControl
void ProcessCruiseControl(RigDef::CruiseControl &def)
Definition: ActorSpawner.cpp:2814
RoR::CabSubmesh
Submesh for old-style actor body (the "cab")
Definition: FlexObj.h:46
RigDef::BaseWheel2::tyre_radius
float tyre_radius
Definition: RigDef_File.h:436
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::Animator::inertia_defaults
std::shared_ptr< Inertia > inertia_defaults
Definition: RigDef_File.h:594
RigDef::Shock3::OPTION_M_ABSOLUTE_METRIC
static const BitMask_t OPTION_M_ABSOLUTE_METRIC
Definition: RigDef_File.h:1230
RoR::tie_t::ti_locked_ropable
ropable_t * ti_locked_ropable
Definition: SimData.h:526
RigDef::Node::options
BitMask_t options
Definition: RigDef_Node.h:160
RigDef::BaseWheel::beam_defaults
std::shared_ptr< BeamDefaults > beam_defaults
Definition: RigDef_File.h:419
RoR::FlareMaterial
Definition: GfxData.h:312
RigDef::SpecialProp::REDBEACON
@ REDBEACON
RoR::SHOCK_FLAG_TRG_HOOK_UNLOCK
@ SHOCK_FLAG_TRG_HOOK_UNLOCK
Definition: SimData.h:208
RigDef::Rotator2
Definition: RigDef_File.h:1155
RigDef::Shock::options
BitMask_t options
Definition: RigDef_File.h:1193
RigDef::DifferentialType::l_LOCKED
@ l_LOCKED
RigDef::Command2::affect_engine
float affect_engine
Definition: RigDef_File.h:774
RigDef::Lockgroup::LOCKGROUP_DEFAULT
static const int LOCKGROUP_DEFAULT
Definition: RigDef_File.h:1009
RigDef::Shock2::detacher_group
int detacher_group
Definition: RigDef_File.h:1221
RoR::ActorSpawner::InitializeRig
void InitializeRig()
Definition: ActorSpawner.cpp:252
RigDef::Author::forum_account_id
unsigned int forum_account_id
Definition: RigDef_File.h:614
RoR::Actor::ar_predicted_coll_bounding_boxes
std::vector< Ogre::AxisAlignedBox > ar_predicted_coll_bounding_boxes
Definition: Actor.h:311
RoR::ActorSpawner::CreateRail
RailGroup * CreateRail(std::vector< RigDef::Node::Range > &node_ranges)
Definition: ActorSpawner.cpp:3123
RigDef::BaseMeshWheel::mesh_name
Ogre::String mesh_name
Definition: RigDef_File.h:425
RoR::TuneupUtil::getTweakedManagedMatMedia
static std::string getTweakedManagedMatMedia(TuneupDefPtr &tuneup_def, const std::string &matname, int media_idx, const std::string &orig_val)
Definition: TuneupFileFormat.cpp:499
RoR::ActorSpawner::m_first_wing_index
int m_first_wing_index
Definition: ActorSpawner.h:478
RigDef::SlideNode::CONSTRAINT_ATTACH_ALL
static const BitMask_t CONSTRAINT_ATTACH_ALL
Definition: RigDef_File.h:1259
RoR::flare_t::light
Ogre::Light * light
Definition: SimData.h:625
RoR::command_t::beams
std::vector< commandbeam_t > beams
Definition: SimData.h:581
RigDef::Shock3
Definition: RigDef_File.h:1224
RoR::BeamGfx::rod_beam_index
uint16_t rod_beam_index
Definition: GfxData.h:283
RigDef::Exhaust
Definition: RigDef_File.h:851
RoR::beam_t::p2
node_t * p2
Definition: SimData.h:336
RoR::AeroEngineType::AE_XPROP
@ AE_XPROP
RoR::CabTexcoord
Texture coordinates for old-style actor body (the "cab")
Definition: FlexObj.h:38
RigDef::Airbrake::width
float width
Definition: RigDef_File.h:466
RoR::node_t::nd_no_ground_contact
bool nd_no_ground_contact
User-defined attr; node ignores contact with ground.
Definition: SimData.h:318
RigDef::Animation::MODE_ROTATION_X
static const BitMask_t MODE_ROTATION_X
Definition: RigDef_File.h:533
RoR::Actor::ar_num_camera_rails
int ar_num_camera_rails
Definition: Actor.h:338
RoR::FlexFactory::CreateFlexMeshWheel
FlexMeshWheel * CreateFlexMeshWheel(unsigned int wheel_index, int axis_node_1_index, int axis_node_2_index, int nstart, int nrays, float rim_radius, bool rim_reverse, std::string const &rim_mesh_name, std::string const &rim_mesh_rg, std::string const &tire_material_name, std::string const &tire_material_rg)
Definition: FlexFactory.cpp:114
RigDef::Document::Module::hydros
std::vector< Hydro > hydros
Definition: RigDef_File.h:1521
MAX_CABS
static const int MAX_CABS
maximum number of cabs per actor
Definition: SimConstants.h:27
RigDef::VideoCamera::max_clip_distance
float max_clip_distance
Definition: RigDef_File.h:1432
RoR::PROP_ANIM_FLAG_SPEEDO
const PropAnimFlag_t PROP_ANIM_FLAG_SPEEDO
Definition: GfxData.h:58
RoR::ActorSpawner::m_wheels_parent_scenenode
Ogre::SceneNode * m_wheels_parent_scenenode
this isn't used for moving/hiding things, just helps developers inspect the scene graph.
Definition: ActorSpawner.h:499
RoR::rotator_t::angle
float angle
Definition: SimData.h:606
RigDef::Animation::motor_sources
std::list< MotorSource > motor_sources
Definition: RigDef_File.h:548
Terrain.h
RoR::commandbeam_t::cmb_is_1press_center
bool cmb_is_1press_center
Attribute defined in truckfile.
Definition: SimData.h:569
RigDef::Prop::special_prop_dashboard
DashboardSpecial special_prop_dashboard
Definition: RigDef_File.h:1116
RigDef::Animation::SOURCE_DASHBOARD
static const BitMask64_t SOURCE_DASHBOARD
Definition: RigDef_File.h:526
RoR::VideoCamera::vcam_pos_offset
Ogre::Vector3 vcam_pos_offset
Definition: GfxData.h:240
RoR::ActorSpawner::CustomMaterial::material_flare_def
RigDef::MaterialFlareBinding * material_flare_def
Definition: ActorSpawner.h:138
RoR::WheelGfx::wx_rim_mesh_name
std::string wx_rim_mesh_name
Redundant, for Tuning UI. Only for 'meshwheels[2]' and 'flexbodywheels'.
Definition: GfxData.h:298
RigDef::Animation::SOURCE_GEAR_REVERSE
static const BitMask64_t SOURCE_GEAR_REVERSE
Definition: RigDef_File.h:530
RoR::ANIM_FLAG_TURBO
@ ANIM_FLAG_TURBO
Definition: SimData.h:159
RigDef::SpecialProp::DASHBOARD_LEFT
@ DASHBOARD_LEFT
RigDef::CollisionRange::node_collision_range
float node_collision_range
Definition: RigDef_File.h:760
RoR::FlexAirfoil
Definition: FlexAirfoil.h:33
RoR::Actor::ar_submesh_ground_model
ground_model_t * ar_submesh_ground_model
Definition: Actor.h:407
RigDef::Pistonprop::blade_tip_nodes
Node::Ref blade_tip_nodes[4]
Definition: RigDef_File.h:1071
RoR::ActorSpawner::m_apply_simple_materials
bool m_apply_simple_materials
Definition: ActorSpawner.h:460
RigDef::Beam::OPTION_r_ROPE
static const BitMask_t OPTION_r_ROPE
Definition: RigDef_File.h:629
RigDef::Animation::SOURCE_CLUTCH
static const BitMask64_t SOURCE_CLUTCH
Definition: RigDef_File.h:506
RoR::Airfoil
Represents an airfoil http://en.wikipedia.org/wiki/Airfoil.
Definition: Airfoil.h:31
RoR::exhaust_t::smokeNode
Ogre::SceneNode * smokeNode
Definition: SimData.h:642
RoR::hydrobeam_t::hb_anim_param
float hb_anim_param
Animators (beams updating length based on simulation variables)
Definition: SimData.h:595
RigDef::Animation::MODE_OFFSET_Y
static const BitMask_t MODE_OFFSET_Y
Definition: RigDef_File.h:537
RigDef::Fusedrag::airfoil_name
Ogre::String airfoil_name
Definition: RigDef_File.h:926
RoR::hydrobeam_t::hb_speed
float hb_speed
Rate of change.
Definition: SimData.h:592
RoR::TuneupUtil::getTweakedNodePosition
static Ogre::Vector3 getTweakedNodePosition(TuneupDefPtr &tuneup_entry, NodeNum_t nodenum, Ogre::Vector3 orig_val)
Definition: TuneupFileFormat.cpp:236
RigDef::Animation::SOURCE_SIGNALSTALK
static const BitMask64_t SOURCE_SIGNALSTALK
Definition: RigDef_File.h:527
RoR::Prop::pp_mesh_obj
MeshObject * pp_mesh_obj
Optional; NULL if removed via tuneup/addonpart.
Definition: GfxData.h:173
RoR::shock_t::sbd_spring
float sbd_spring
set beam default for spring
Definition: SimData.h:399
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
RoR::beam_t::shortbound
float shortbound
Definition: SimData.h:354
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
BitMask_t
uint32_t BitMask_t
Definition: BitFlags.h:7
RigDef::Axle
Definition: RigDef_File.h:620
RoR::rotator_t::nodes1
NodeNum_t nodes1[4]
Definition: SimData.h:602
RoR::ActorSpawner::GetFreeNode
node_t & GetFreeNode()
Definition: ActorSpawner.cpp:6248
RoR::ActorSpawner::ProcessRotator2
void ProcessRotator2(RigDef::Rotator2 &def)
Definition: ActorSpawner.cpp:3489
RigDef::Shock2::options
BitMask_t options
Definition: RigDef_File.h:1219
InputEngine.h
Handles controller inputs from player. Defines input events and binding mechanism,...
RoR::ActorSpawner::CreateMaterialFlare
void CreateMaterialFlare(int flare_index, Ogre::MaterialPtr mat)
Definition: ActorSpawner.cpp:7379
RigDef::Fusedrag::area_coefficient
float area_coefficient
Definition: RigDef_File.h:927
RigDef::SlideNode::_attachment_rate_set
bool _attachment_rate_set
Definition: RigDef_File.h:1272
RoR::ActorSpawner::CreateFlexBodyWheelVisuals
void CreateFlexBodyWheelVisuals(WheelID_t wheel_id, NodeNum_t node_base_index, NodeNum_t axis_node_1, NodeNum_t axis_node_2, int num_rays, float radius, WheelSide side, std::string rim_mesh_name, std::string rim_mesh_rg, std::string tire_mesh_name, std::string tire_mesh_rg)
Definition: ActorSpawner.cpp:5152
GfxActor.h
Manager for all visuals belonging to a single actor.
RoR::ActorSpawner::CreateBeamVisuals
void CreateBeamVisuals(beam_t const &beam, int beam_index, bool visible, std::shared_ptr< RigDef::BeamDefaults > const &beam_defaults, std::string material_override="")
Definition: ActorSpawner.cpp:5682
RigDef::Shock::nodes
Node::Ref nodes[2]
Definition: RigDef_File.h:1187
RoR::ActorSpawner::ActorMemoryRequirements::num_wings
size_t num_wings
Definition: ActorSpawner.h:82
RoR::ActorSpawner::SetupDefaultSoundSources
static void SetupDefaultSoundSources(ActorPtr const &actor)
Definition: ActorSpawner.cpp:6295
RoR::ActorSpawner::AssignWheelToAxle
bool AssignWheelToAxle(int &_out_axle_wheel, node_t *axis_node_1, node_t *axis_node_2)
Finds wheel with given axle nodes and returns it's index.
Definition: ActorSpawner.cpp:2637
RigDef::Cinecam::beam_defaults
std::shared_ptr< BeamDefaults > beam_defaults
Definition: RigDef_File.h:749
RoR::Actor::alb_notoggle
bool alb_notoggle
Anti-lock brake attribute: Disable in-game toggle?
Definition: Actor.h:348
RoR::ActorSpawner::m_curr_mirror_prop_type
CustomMaterial::MirrorPropType m_curr_mirror_prop_type
Definition: ActorSpawner.h:495
RigDef::Tie::root_node
Node::Ref root_node
Definition: RigDef_File.h:1318
RoR::tie_t::ti_no_self_lock
bool ti_no_self_lock
Attribute.
Definition: SimData.h:532
RoR::Actor::ar_shocks
shock_t * ar_shocks
Shock absorbers.
Definition: Actor.h:284
RoR::ActorSpawner::BuildAeroEngine
void BuildAeroEngine(NodeNum_t ref_node_index, NodeNum_t back_node_index, NodeNum_t blade_1_node_index, NodeNum_t blade_2_node_index, NodeNum_t blade_3_node_index, NodeNum_t blade_4_node_index, NodeNum_t couplenode_index, bool is_turboprops, Ogre::String const &airfoil, float power, float pitch)
Definition: ActorSpawner.cpp:773
RoR::commandbeam_t::cmb_plays_sound
bool cmb_plays_sound
Attribute defined in truckfile.
Definition: SimData.h:567
RoR::rope_t::rp_locked
int rp_locked
Definition: SimData.h:512
RoR::Console::CONSOLE_MSGTYPE_ACTOR
@ CONSOLE_MSGTYPE_ACTOR
Parsing/spawn/simulation messages for actors.
Definition: Console.h:63
RigDef::TransferCase::has_2wd_lo
bool has_2wd_lo
Definition: RigDef_File.h:1365
RoR::Actor::ar_hydros
std::vector< hydrobeam_t > ar_hydros
Definition: Actor.h:329
RoR::ActorSpawner::_SectionWheels2AddBeam
unsigned int _SectionWheels2AddBeam(RigDef::Wheel2 &wheel_2_def, node_t *node_1, node_t *node_2)
Definition: ActorSpawner.cpp:5265
RoR::SPLIT_DIFF
@ SPLIT_DIFF
Definition: Differentials.h:59
RigDef::Lockgroup::number
int number
Definition: RigDef_File.h:1012
AddonPartFileFormat.h
RigDef::Node
Definition: RigDef_Node.h:39
RigDef::DocumentPtr
std::shared_ptr< Document > DocumentPtr
Definition: RigDef_Prerequisites.h:38
RoR::Prop::pp_beacon_rot_rate
float pp_beacon_rot_rate[4]
Radians per second.
Definition: GfxData.h:194
RoR::Console::CONSOLE_SYSTEM_WARNING
@ CONSOLE_SYSTEM_WARNING
Definition: Console.h:53
RoR::AirbrakeGfx::abx_y_node
NodeNum_t abx_y_node
Definition: GfxData.h:309
RoR::SHOCK1
@ SHOCK1
shock1
Definition: SimData.h:108
RoR::SS_MOD_ENGINE
@ SS_MOD_ENGINE
Definition: SoundScriptManager.h:125
RoR::ActorSpawner::ProcessCommand
void ProcessCommand(RigDef::Command2 &def)
Definition: ActorSpawner.cpp:3613
RoR::DashBoardManager::setVisible
void setVisible(bool visibility)
Definition: DashBoardManager.cpp:214
RigDef::Cab::OPTION_r_BUOYANT_ONLY_DRAG
static const BitMask_t OPTION_r_BUOYANT_ONLY_DRAG
Definition: RigDef_File.h:716
RoR::ActorManager::GetInertiaConfig
RoR::CmdKeyInertiaConfig & GetInertiaConfig()
Definition: ActorManager.h:97
RoR::AirbrakeGfx::abx_offset
Ogre::Vector3 abx_offset
Definition: GfxData.h:306
RigDef::BaseWheel::nodes
Node::Ref nodes[2]
Definition: RigDef_File.h:412
FlexObj.h
RigDef::VideoCamera::reference_node
Node::Ref reference_node
Definition: RigDef_File.h:1421
RoR::CVar::getInt
int getInt() const
Definition: CVar.h:97
RoR::Turbojet::tjet_visual
TurbojetVisual tjet_visual
Definition: TurboJet.h:102
MAX_WHEELS
static const int MAX_WHEELS
maximum number of wheels per actor
Definition: SimConstants.h:24
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
RoR::AddonPartUtility
NOTE: Modcache processes this format directly using RoR::GenericDocument, see RoR::CacheSystem::FillA...
Definition: AddonPartFileFormat.h:56
RigDef::BaseWheel::braking
WheelBraking braking
Definition: RigDef_File.h:414
RigDef::Animator::OPTION_PARKING
static const BitMask_t OPTION_PARKING
Definition: RigDef_File.h:576
RoR::WheelSide
WheelSide
Used by rig-def/addonpart/tuneup formats to specify wheel rim mesh orientation.
Definition: GfxData.h:115
RoR::SHOCK_FLAG_ISTRIGGER
@ SHOCK_FLAG_ISTRIGGER
Definition: SimData.h:203
RoR::ActorSpawner::GetNodeIndexOrThrow
NodeNum_t GetNodeIndexOrThrow(RigDef::Node::Ref const &id)
Definition: ActorSpawner.cpp:5464
RoR::rotator_t::force
float force
Definition: SimData.h:608
RigDef::Keyword::VIDEOCAMERA
@ VIDEOCAMERA
RoR::ActorSpawner::m_memory_requirements
ActorMemoryRequirements m_memory_requirements
Definition: ActorSpawner.h:463
RoR::Prop::pp_wheel_rot_degree
float pp_wheel_rot_degree
Definition: GfxData.h:187
RigDef::BaseWheel::node_defaults
std::shared_ptr< NodeDefaults > node_defaults
Definition: RigDef_File.h:418
RigDef::Airbrake::texcoord_x2
float texcoord_x2
Definition: RigDef_File.h:470
RoR::exhaust_t::particleSystemName
std::string particleSystemName
Name in .particle file ~ for display in Tuning UI.
Definition: SimData.h:644
RigDef::Animation::SOURCE_SHIFT_BACK_FORTH
static const BitMask64_t SOURCE_SHIFT_BACK_FORTH
Definition: RigDef_File.h:512
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
RoR::ANIM_FLAG_AIRSPEED
@ ANIM_FLAG_AIRSPEED
Definition: SimData.h:143
RoR::Differential::di_idx_1
int di_idx_1
array location of wheel / axle 1
Definition: Differentials.h:69
RigDef::Animator::OPTION_SHORT_LIMIT
static const BitMask_t OPTION_SHORT_LIMIT
Definition: RigDef_File.h:585
RoR::FlexbodyID_t
int FlexbodyID_t
Index to GfxActor::m_flexbodies, use RoR::FLEXBODYID_INVALID as empty value.
Definition: ForwardDeclarations.h:62
RoR::SlideNode::SetDefaultRail
void SetDefaultRail(RailGroup *rail)
Sets rail to initially use when spawned or reset.
Definition: SlideNode.h:82
RoR::SHOCK_FLAG_TRG_BLOCKER
@ SHOCK_FLAG_TRG_BLOCKER
Definition: SimData.h:204
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
RoR::ActorSpawner::GetSubmeshGroundmodelName
std::string GetSubmeshGroundmodelName()
Definition: ActorSpawner.cpp:1320
RigDef::Assetpack
Definition: RigDef_File.h:403
RoR::Actor::ar_wheels
wheel_t ar_wheels[MAX_WHEELS]
Definition: Actor.h:317
RigDef::Cab::OPTION_S_INVULNERABLE_BUOYANT
static const BitMask_t OPTION_S_INVULNERABLE_BUOYANT
Definition: RigDef_File.h:719
RigDef::Shock::OPTION_i_INVISIBLE
static const BitMask_t OPTION_i_INVISIBLE
Definition: RigDef_File.h:1182
RoR::Actor::alb_pulse_state
bool alb_pulse_state
Anti-lock brake state;.
Definition: Actor.h:346
RoR::hook_t::hk_hook_node
node_t * hk_hook_node
Definition: SimData.h:491
RoR::ActorSpawner::m_airplane_right_light
int m_airplane_right_light
Definition: ActorSpawner.h:473
AirBrake.h
RoR::FlexAirfoil::nblu
NodeNum_t nblu
Definition: FlexAirfoil.h:65
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
RoR::Actor::ar_camera_node_pos
NodeNum_t ar_camera_node_pos[MAX_CAMERAS]
Physics attr; 'camera' = frame of reference; origin node.
Definition: Actor.h:385
RoR::CabSubmesh::texcoords_pos
size_t texcoords_pos
Definition: FlexObj.h:53
RigDef::Animator::lenghtening_factor
float lenghtening_factor
Definition: RigDef_File.h:589
RigDef::Rotator2::description
Ogre::String description
Definition: RigDef_File.h:1159
RigDef::Prop::reference_node
Node::Ref reference_node
Definition: RigDef_File.h:1106
RoR::ActorSpawner::AddBeam
beam_t & AddBeam(node_t &node_1, node_t &node_2, std::shared_ptr< RigDef::BeamDefaults > &defaults, int detacher_group)
Definition: ActorSpawner.cpp:3872
RoR::Turbojet
Definition: TurboJet.h:62
RoR::FlexBody
Flexbody = A deformable mesh; updated on CPU every frame, then uploaded to video memory.
Definition: FlexBody.h:43
Collisions.h
RoR::ActorSpawner::ProcessWheelDetacher
void ProcessWheelDetacher(RigDef::WheelDetacher &def)
Definition: ActorSpawner.cpp:5286
RoR::Airbrake::noderef
node_t * noderef
Definition: AirBrake.h:50
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
RoR::ActorSpawner::InitBeam
void InitBeam(beam_t &beam, node_t *node_1, node_t *node_2)
Definition: ActorSpawner.cpp:5745
RoR::node_t::mass
Ogre::Real mass
Definition: SimData.h:298
RigDef::Rotator::base_plate_nodes
Node::Ref base_plate_nodes[4]
Definition: RigDef_File.h:1144
RoR::FlexAirfoil::nfru
NodeNum_t nfru
Definition: FlexAirfoil.h:62
RigDef::Flexbody::x_axis_node
Node::Ref x_axis_node
Definition: RigDef_File.h:898
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
RoR::events
events
Definition: InputEngine.h:74
RigDef::Pistonprop::reference_node
Node::Ref reference_node
Definition: RigDef_File.h:1069
RoR::BOAT
@ BOAT
its a boat
Definition: SimData.h:95
RoR::ActorState::NETWORKED_OK
@ NETWORKED_OK
not simulated (remote) actor
RoR::Actor::m_beam_break_debug_enabled
bool m_beam_break_debug_enabled
Logging state.
Definition: Actor.h:624
MAX_SCREWPROPS
static const int MAX_SCREWPROPS
maximum number of boat screws per actor
Definition: SimConstants.h:31
RigDef::Shock3::damp_out
float damp_out
Damping value applied when shock extending.
Definition: RigDef_File.h:1236
RoR::Prop::pp_beacon_bbs
Ogre::BillboardSet * pp_beacon_bbs[4]
Definition: GfxData.h:191
RoR::flare_t::offsetx
float offsetx
Definition: SimData.h:620
RoR::ANIM_FLAG_TACHO
@ ANIM_FLAG_TACHO
Definition: SimData.h:156
RoR::ActorSpawner::AssignManagedMaterialTexture
void AssignManagedMaterialTexture(Ogre::TextureUnitState *tus, const std::string &mm_name, int media_id, const std::string &tex_name)
Helper for ProcessManagedMaterial()
Definition: ActorSpawner.cpp:7415
RigDef::Command2::option_c_auto_center
bool option_c_auto_center
Definition: RigDef_File.h:783
RoR::Prop::pp_scene_node
Ogre::SceneNode * pp_scene_node
The pivot scene node (parented to root-node).
Definition: GfxData.h:172
RigDef::Rotator::spin_left_key
unsigned int spin_left_key
Definition: RigDef_File.h:1147
RoR::commandbeam_t::cmb_beam_index
uint16_t cmb_beam_index
Index to Actor::ar_beams array.
Definition: SimData.h:556
RoR::commandbeam_t::cmb_is_autocentering
bool cmb_is_autocentering
Attribute defined in truckfile.
Definition: SimData.h:566
RoR::DEPTHMAP_DISABLED
@ DEPTHMAP_DISABLED
Definition: Application.h:285
RoR::PROP_ANIM_FLAG_CLUTCH
const PropAnimFlag_t PROP_ANIM_FLAG_CLUTCH
Definition: GfxData.h:56
RigDef::Minimass
Definition: RigDef_File.h:1037
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
RoR::FlareType::HIGH_BEAM
@ HIGH_BEAM
RoR::node_t::nd_lockgroup
int16_t nd_lockgroup
Optional attribute (-1 = default, 9999 = deny lock) - used in the hook lock logic.
Definition: SimData.h:306
RoR::Actor::ar_ropables
std::vector< ropable_t > ar_ropables
Definition: Actor.h:294
RigDef::Turbojet
Definition: RigDef_File.h:1394
RoR::UniqueCommandKeyPair::uckp_key1
CommandkeyID_t uckp_key1
Definition: SimData.h:698
RoR::flare_t::blinkdelay
float blinkdelay
Definition: SimData.h:629
RoR::ActorSpawner::ProcessFlexBodyWheel
void ProcessFlexBodyWheel(RigDef::FlexBodyWheel &def)
Definition: ActorSpawner.cpp:4199
RigDef::CameraSettings::mode
int mode
0 and higher = cinecam index
Definition: RigDef_File.h:739
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
RoR::ANIM_FLAG_THROTTLE
@ ANIM_FLAG_THROTTLE
Definition: SimData.h:151
RoR::Actor::ar_state
ActorState ar_state
Definition: Actor.h:440
RigDef::Animator::OPTION_TACHO
static const BitMask_t OPTION_TACHO
Definition: RigDef_File.h:574
RoR::ActorSpawner::FindBeamInRig
beam_t * FindBeamInRig(NodeNum_t node_a, NodeNum_t node_b)
Definition: ActorSpawner.cpp:3169
RoR::ActorSpawner::ProcessTractionControl
void ProcessTractionControl(RigDef::TractionControl &def)
Definition: ActorSpawner.cpp:5300
RoR::Actor::m_handbrake_force
float m_handbrake_force
Physics attr; defined in truckfile.
Definition: Actor.h:570
RoR::wheel_t::wh_braking
BrakeCombo wh_braking
Definition: SimData.h:436
RigDef::Command2::nodes
Node::Ref nodes[2]
Definition: RigDef_File.h:765
RoR::hook_t::hk_group
int hk_group
Definition: SimData.h:480
RoR::ActorSpawner::GetBeamNodePointer
node_t * GetBeamNodePointer(RigDef::Node::Ref const &node_ref)
Definition: ActorSpawner.cpp:5496
RigDef::AntiLockBrakes::pulse_per_sec
float pulse_per_sec
Definition: RigDef_File.h:605
RoR::SlideNode
Definition: SlideNode.h:64
RoR::ActorSpawner::CreateSimpleMaterial
Ogre::MaterialPtr CreateSimpleMaterial(Ogre::ColourValue color)
Definition: ActorSpawner.cpp:6707
RigDef::Beam
Definition: RigDef_File.h:626
RoR::TuneupUtil::getTweakedWheelMedia
static std::string getTweakedWheelMedia(TuneupDefPtr &tuneup_entry, WheelID_t wheel_id, int media_idx, const std::string &orig_val)
Definition: TuneupFileFormat.cpp:151
RigDef::Node::Ref::Num
unsigned int Num() const
Definition: RigDef_Node.h:95
RoR::FlareMaterial::emissive_color
Ogre::ColourValue emissive_color
Definition: GfxData.h:316
counter
static int counter
Definition: SurveyMapTextureCreator.cpp:33
RigDef::Rotator2::rotating_force
float rotating_force
Definition: RigDef_File.h:1157
RigDef::Screwprop
Definition: RigDef_File.h:1162
RigDef::Hook::option_timer
float option_timer
Definition: RigDef_File.h:963
RigDef::GuiSettings::value
std::string value
Definition: RigDef_File.h:945
RigDef::Animation::SOURCE_TORQUE
static const BitMask64_t SOURCE_TORQUE
Definition: RigDef_File.h:515
RoR::beam_t::shock
shock_t * shock
Definition: SimData.h:358
RigDef::Prop::x_axis_node
Node::Ref x_axis_node
Definition: RigDef_File.h:1107
RoR::PropAnimKeyState::eventlock_present
bool eventlock_present
Definition: SimData.h:660
RigDef::Animation::upper_limit
float upper_limit
Definition: RigDef_File.h:546
RoR::PROP_ANIM_FLAG_ROLL
const PropAnimFlag_t PROP_ANIM_FLAG_ROLL
Definition: GfxData.h:50
RoR::Prop::pp_node_x
NodeNum_t pp_node_x
Definition: GfxData.h:166
RigDef::ExtCamera::mode
RoR::ExtCameraMode mode
Definition: RigDef_File.h:860
RoR::FlexAirfoil::nbrd
NodeNum_t nbrd
Definition: FlexAirfoil.h:64
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::Animation::SOURCE_ALTIMETER_100K
static const BitMask64_t SOURCE_ALTIMETER_100K
Definition: RigDef_File.h:496
RigDef::Prop::DashboardSpecial::rotation_angle
float rotation_angle
Definition: RigDef_File.h:1091
RoR::ropable_t
Definition: SimData.h:497
RigDef::Engoption::inertia
float inertia
Definition: RigDef_File.h:818
RoR::ActorSpawner::GetFreeBeam
beam_t & GetFreeBeam()
Definition: ActorSpawner.cpp:6256
RoR::ActorSpawner::ProcessTrigger
void ProcessTrigger(RigDef::Trigger &def)
Definition: ActorSpawner.cpp:3268
RigDef::Document::Module::beams
std::vector< Beam > beams
Definition: RigDef_File.h:1492
RigDef::CruiseControl
Definition: RigDef_File.h:789
RoR::Actor::ar_airbrakes
std::vector< Airbrake * > ar_airbrakes
Definition: Actor.h:298
RigDef::WheelBraking
WheelBraking
Definition: RigDef_File.h:241
RigDef::BaseMeshWheel::material_name
Ogre::String material_name
Definition: RigDef_File.h:426
RigDef::Rope::detacher_group
int detacher_group
Definition: RigDef_File.h:1138
RigDef::Hydro::OPTION_r_INPUT_RUDDER
static const BitMask_t OPTION_r_INPUT_RUDDER
Definition: RigDef_File.h:979
RigDef::Animation::MODE_NO_FLIP
static const BitMask_t MODE_NO_FLIP
Definition: RigDef_File.h:540
RoR::Actor::ar_camera_rail
NodeNum_t ar_camera_rail[MAX_CAMERARAIL]
Nodes defining camera-movement spline.
Definition: Actor.h:337
RoR::Actor::getWorkingTuneupDef
TuneupDefPtr & getWorkingTuneupDef()
Definition: Actor.cpp:4719
RigDef::Wing
Definition: RigDef_File.h:1462
RoR::Actor::ar_main_camera_node_roll
NodeNum_t ar_main_camera_node_roll
Sim attr; ar_camera_node_roll[0] >= 0 ? ar_camera_node_roll[0] : 0.
Definition: Actor.h:384
RigDef::BaseWheel::reference_arm_node
Node::Ref reference_arm_node
Definition: RigDef_File.h:416
RoR::Actor::ar_soundsources
soundsource_t ar_soundsources[MAX_SOUNDSCRIPTS_PER_TRUCK]
Definition: Actor.h:321
RoR::VideoCamera::vcam_type
VideoCamType vcam_type
Definition: GfxData.h:233
RigDef::Node::default_minimass
std::shared_ptr< DefaultMinimass > default_minimass
Definition: RigDef_Node.h:164
RoR::Actor::ar_num_shocks
int ar_num_shocks
Number of shock absorbers.
Definition: Actor.h:285
RigDef::Animation::dash_link_name
Ogre::String dash_link_name
Definition: RigDef_File.h:551
RoR::Actor::ar_guisettings_use_engine_max_rpm
bool ar_guisettings_use_engine_max_rpm
Definition: Actor.h:435
RoR
Definition: AppContext.h:36
RigDef::SpecialProp::MIRROR_RIGHT
@ MIRROR_RIGHT
RoR::Actor::m_load_mass
float m_load_mass
Physics attr; predefined load mass in Kg.
Definition: Actor.h:578
RoR::ActorSpawner::m_selected_modules
std::list< std::shared_ptr< RigDef::Document::Module > > m_selected_modules
Definition: ActorSpawner.h:458
RoR::Actor::m_gfx_actor
std::unique_ptr< GfxActor > m_gfx_actor
Definition: Actor.h:531
RoR::Actor::m_beam_deform_debug_enabled
bool m_beam_deform_debug_enabled
Logging state.
Definition: Actor.h:625
RigDef::Hook::flag_visible
bool flag_visible
Definition: RigDef_File.h:969
RoR::LOCKED_DIFF
@ LOCKED_DIFF
Definition: Differentials.h:62
MeshObject::setCastShadows
void setCastShadows(bool b)
Definition: MeshObject.cpp:51
x
float x
Definition: (ValueTypes) quaternion.h:5
RoR::ActorSpawner::ProcessTransferCase
void ProcessTransferCase(RigDef::TransferCase &def)
Definition: ActorSpawner.cpp:2776
RoR::soundsource_t
Definition: SimData.h:411
RoR::ActorSpawner::GetNodePointerOrThrow
node_t * GetNodePointerOrThrow(RigDef::Node::Ref const &node_ref)
Definition: ActorSpawner.cpp:5837
RoR::Actor::ar_main_camera_dir_corr
Ogre::Quaternion ar_main_camera_dir_corr
Sim attr;.
Definition: Actor.h:381
RoR::App::gfx_reduce_shadows
CVar * gfx_reduce_shadows
Definition: Application.cpp:248
RigDef::Globals
Definition: RigDef_File.h:930
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
RoR::PROP_ANIM_FLAG_AILERONS
const PropAnimFlag_t PROP_ANIM_FLAG_AILERONS
Definition: GfxData.h:70
RigDef::Pistonprop::pitch
float pitch
Definition: RigDef_File.h:1074
RigDef::ExtCamera
Definition: RigDef_File.h:858
RoR::Actor::ar_has_active_shocks
bool ar_has_active_shocks
Are there active stabilizer shocks?
Definition: Actor.h:286
RoR::Prop::pp_beacon_scene_node
Ogre::SceneNode * pp_beacon_scene_node[4]
Definition: GfxData.h:192
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
RoR::App::GetGfxScene
GfxScene * GetGfxScene()
Definition: Application.cpp:276
RoR::GameContext::GetActorManager
ActorManager * GetActorManager()
Definition: GameContext.h:127
RigDef::Cinecam::nodes
Node::Ref nodes[8]
Definition: RigDef_File.h:745
RigDef::Rope
Definition: RigDef_File.h:1132
RoR::ActorSpawner::ProcessCinecam
void ProcessCinecam(RigDef::Cinecam &def)
Definition: ActorSpawner.cpp:6052
RoR::Actor::ar_guisettings_shifter_anim_time
float ar_guisettings_shifter_anim_time
Definition: Actor.h:437
RoR::ActorSpawner::CustomMaterial::material
Ogre::MaterialPtr material
Definition: ActorSpawner.h:137
RoR::PropID_t
int PropID_t
Index to GfxActor::m_props, use RoR::PROPID_INVALID as empty value.
Definition: ForwardDeclarations.h:59
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
RoR::Actor::ar_minimass_skip_loaded_nodes
bool ar_minimass_skip_loaded_nodes
Definition: Actor.h:279
RigDef::Wheel2::rim_springiness
float rim_springiness
Definition: RigDef_File.h:1450
RoR::Actor::ar_managed_materials
std::map< std::string, Ogre::MaterialPtr > ar_managed_materials
Definition: Actor.h:312
RigDef::Hook::option_speed_coef
float option_speed_coef
Definition: RigDef_File.h:959
MAX_AEROENGINES
static const int MAX_AEROENGINES
maximum number of aero engines per actor
Definition: SimConstants.h:30
RigDef::Trigger::beam_defaults
std::shared_ptr< BeamDefaults > beam_defaults
Definition: RigDef_File.h:1388
RigDef::Ropable::group
int group
Definition: RigDef_File.h:1128
RoR::PROP_ANIM_FLAG_BTHROTTLE
const PropAnimFlag_t PROP_ANIM_FLAG_BTHROTTLE
Definition: GfxData.h:73
RoR::beam_t::bm_disabled
bool bm_disabled
Definition: SimData.h:351
RigDef::Wheel::face_material_name
Ogre::String face_material_name
Definition: RigDef_File.h:1444
RoR::Airbrake
Definition: AirBrake.h:35
RigDef::Cab::OPTION_b_BUOYANT
static const BitMask_t OPTION_b_BUOYANT
Definition: RigDef_File.h:712
RoR::PROP_ANIM_FLAG_EVENT
const PropAnimFlag_t PROP_ANIM_FLAG_EVENT
Definition: GfxData.h:69
RoR::wheel_t::BrakeCombo::NONE
@ NONE
RigDef::Wing::efficacy_coef
float efficacy_coef
Definition: RigDef_File.h:1471
RoR::ActorSpawner::InitNode
void InitNode(node_t &node, Ogre::Vector3 const &position)
Definition: ActorSpawner.cpp:6082
RigDef::Hydro::OPTION_x_INPUT_AILERON_RUDDER
static const BitMask_t OPTION_x_INPUT_AILERON_RUDDER
Definition: RigDef_File.h:983
RigDef::SpecialProp::LIGHTBAR
@ LIGHTBAR
RoR::Actor::ar_num_buoycabs
int ar_num_buoycabs
Definition: Actor.h:336
RigDef::SlideNode
Definition: RigDef_File.h:1257
RigDef::Cinecam::damping
float damping
Definition: RigDef_File.h:747
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::SoundSource::sound_script_name
Ogre::String sound_script_name
Definition: RigDef_File.h:1280
RoR::Actor::ar_cinecam_node
NodeNum_t ar_cinecam_node[MAX_CAMERAS]
Sim attr; Cine-camera node indexes.
Definition: Actor.h:374
MAX_TEXCOORDS
static const int MAX_TEXCOORDS
maximum number of texture coordinates per actor
Definition: SimConstants.h:26
RoR::wing_t
Definition: SimData.h:537
RoR::ActorSpawner::ProcessManagedMaterial
void ProcessManagedMaterial(RigDef::ManagedMaterial &def)
Definition: ActorSpawner.cpp:2375
RoR::Actor::m_buoyance
std::unique_ptr< Buoyance > m_buoyance
Physics.
Definition: Actor.h:581
RigDef::Pistonprop::turbine_power_kW
float turbine_power_kW
Definition: RigDef_File.h:1073
RoR::ANIM_FLAG_AIRBRAKE
@ ANIM_FLAG_AIRBRAKE
Definition: SimData.h:148
RigDef::WheelDetacher::detacher_group
int detacher_group
Definition: RigDef_File.h:1459
RoR::PROP_ANIM_MODE_OFFSET_Y
const PropAnimMode_t PROP_ANIM_MODE_OFFSET_Y
Definition: GfxData.h:86
RigDef::TorqueCurve
Definition: RigDef_File.h:1330
RoR::PROP_ANIM_FLAG_TACHO
const PropAnimFlag_t PROP_ANIM_FLAG_TACHO
Definition: GfxData.h:57
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
RoR::shock_t::dfastout
float dfastout
shocks3
Definition: SimData.h:397
RoR::TurbojetVisual::SetupVisuals
void SetupVisuals(RigDef::Turbojet &def, int num, std::string const &propname, Ogre::Entity *nozzle, Ogre::Entity *afterburner_flame)
Definition: TurboJet.cpp:73
RoR::ActorSpawner::Exception
Definition: ActorSpawner.h:144
RoR::beam_t::L
float L
length
Definition: SimData.h:339
RigDef::Turboprop2::reference_node
Node::Ref reference_node
Definition: RigDef_File.h:1409
RoR::ActorSpawner::ProcessWheel2
void ProcessWheel2(RigDef::Wheel2 &def)
Definition: ActorSpawner.cpp:5276
RigDef::Document::Module::fixes
std::vector< Node::Ref > fixes
Definition: RigDef_File.h:1509
RoR::flare_t::inertia
SimpleInertia inertia
Only 'flares3'.
Definition: SimData.h:635
RoR::Actor::ar_guisettings_speedo_max_kph
float ar_guisettings_speedo_max_kph
Definition: Actor.h:436
RoR::flare_t::noderef
NodeNum_t noderef
Definition: SimData.h:617
RigDef::Prop::animations
std::list< Animation > animations
Definition: RigDef_File.h:1112
RigDef::Hook::node
Node::Ref node
Definition: RigDef_File.h:957
RigDef::WheelPropulsion::NONE
@ NONE
RoR::rotator_t
Definition: SimData.h:599
RigDef::Beam::nodes
Node::Ref nodes[2]
Definition: RigDef_File.h:632
RoR::ActorSpawner::m_oldstyle_cab_submeshes
std::vector< CabSubmesh > m_oldstyle_cab_submeshes
Definition: ActorSpawner.h:480
RoR::SHOCK_FLAG_ISSHOCK2
@ SHOCK_FLAG_ISSHOCK2
Definition: SimData.h:200
RigDef::Rope::root_node
Node::Ref root_node
Definition: RigDef_File.h:1134
RoR::GameContext::GetTerrain
const TerrainPtr & GetTerrain()
Definition: GameContext.h:117
RigDef::VideoCamera::camera_name
Ogre::String camera_name
Definition: RigDef_File.h:1436
RoR::CacheEntry::fname
Ogre::String fname
filename
Definition: CacheSystem.h:67
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::Animator::OPTION_VERTICAL_VELOCITY
static const BitMask_t OPTION_VERTICAL_VELOCITY
Definition: RigDef_File.h:561
RigDef::Turbojet::back_node
Node::Ref back_node
Definition: RigDef_File.h:1397
RoR::beam_t::maxposstress
float maxposstress
Definition: SimData.h:341
RigDef::Animator::OPTION_GEAR_SELECT
static const BitMask_t OPTION_GEAR_SELECT
Definition: RigDef_File.h:580
RoR::hook_t::hk_lockspeed
float hk_lockspeed
Definition: SimData.h:487
RigDef::Animation::SOURCE_SEQUENTIAL_SHIFT
static const BitMask64_t SOURCE_SEQUENTIAL_SHIFT
Definition: RigDef_File.h:513
RoR::shock_t::flags
int flags
Definition: SimData.h:373
RoR::shock_t
Definition: SimData.h:368
RoR::FlexFactory::CreateFlexBody
FlexBody * CreateFlexBody(FlexbodyID_t flexbody_id, const NodeNum_t ref_node, const NodeNum_t x_node, const NodeNum_t y_node, Ogre::Vector3 offset, Ogre::Vector3 rotation, std::vector< unsigned int > &node_indices, const std::string &mesh_name, const std::string &resource_group_name)
Definition: FlexFactory.cpp:63
RoR::CmdKeyInertia::SetCmdKeyDelay
int SetCmdKeyDelay(RoR::CmdKeyInertiaConfig &cfg, float start_delay, float stop_delay, std::string start_function, std::string stop_function)
Definition: CmdKeyInertia.cpp:87
RoR::ANIM_FLAG_SHIFTER
@ ANIM_FLAG_SHIFTER
Definition: SimData.h:160
RoR::Prop::pp_aero_engine_idx
int pp_aero_engine_idx
Special - a turboprop/pistonprop reference.
Definition: GfxData.h:198
RigDef::Animation::SOURCE_SPEEDO
static const BitMask64_t SOURCE_SPEEDO
Definition: RigDef_File.h:507
RigDef::Prop::BeaconSpecial::color
Ogre::ColourValue color
Definition: RigDef_File.h:1103
RoR::ActorSpawner::CheckScrewpropLimit
bool CheckScrewpropLimit(unsigned int count)
Definition: ActorSpawner.cpp:6226