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