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