RigsofRods
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ActorManager.cpp
Go to the documentation of this file.
1 /*
2  This source file is part of Rigs of Rods
3  Copyright 2005-2012 Pierre-Michel Ricordel
4  Copyright 2007-2012 Thomas Fischer
5  Copyright 2013-2020 Petr Ohlidal
6 
7  For more information, see http://www.rigsofrods.org/
8 
9  Rigs of Rods is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License version 3, as
11  published by the Free Software Foundation.
12 
13  Rigs of Rods is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
25 
26 #include "ActorManager.h"
27 
28 #include "Actor.h"
29 #include "Application.h"
30 #include "ApproxMath.h"
31 #include "CacheSystem.h"
32 #include "ContentManager.h"
33 #include "ChatSystem.h"
34 #include "Collisions.h"
35 #include "DashBoardManager.h"
36 #include "DynamicCollisions.h"
37 #include "Engine.h"
38 #include "GameContext.h"
39 #include "GfxScene.h"
40 #include "GUIManager.h"
41 #include "Console.h"
42 #include "GUI_TopMenubar.h"
43 #include "InputEngine.h"
44 #include "Language.h"
45 #include "MovableText.h"
46 #include "Network.h"
47 #include "PointColDetector.h"
48 #include "Replay.h"
49 #include "RigDef_Validator.h"
50 #include "RigDef_Serializer.h"
51 #include "ActorSpawner.h"
52 #include "ScriptEngine.h"
53 #include "SoundScriptManager.h"
54 #include "Terrain.h"
55 #include "ThreadPool.h"
56 #include "TuneupFileFormat.h"
57 #include "Utils.h"
58 #include "VehicleAI.h"
59 
60 #include <fmt/format.h>
61 
62 using namespace Ogre;
63 using namespace RoR;
64 
65 const ActorPtr ActorManager::ACTORPTR_NULL; // Dummy value to be returned as const reference.
66 
67 ActorManager::ActorManager()
68  : m_dt_remainder(0.0f)
69  , m_forced_awake(false)
70  , m_physics_steps(2000)
71  , m_simulation_speed(1.0f)
72 {
73  // Create worker thread (used for physics calculations)
74  m_sim_thread_pool = std::unique_ptr<ThreadPool>(new ThreadPool(1));
75 }
76 
78 {
79  this->SyncWithSimThread(); // Wait for sim task to finish
80 }
81 
83 {
85  {
86  rq.asr_instance_id = this->GetActorNextInstanceId();
87  }
88  ActorPtr actor = new Actor(rq.asr_instance_id, static_cast<int>(m_actors.size()), def, rq);
89 
91  {
92  actor->sendStreamSetup();
93  }
94 
95  LOG(" == Spawning vehicle: " + def->name);
96 
97  ActorSpawner spawner;
98  spawner.ConfigureSections(actor->m_section_config, def);
100  spawner.ConfigureAssetPacks(actor, def);
101  spawner.ProcessNewActor(actor, rq, def);
102 
103  if (App::diag_actor_dump->getBool())
104  {
105  actor->WriteDiagnosticDump(actor->ar_filename + "_dump_raw.txt"); // Saves file to 'logs'
106  }
107 
108  /* POST-PROCESSING */
109 
110  actor->ar_initial_node_positions.resize(actor->ar_num_nodes);
111  actor->ar_initial_beam_defaults.resize(actor->ar_num_beams);
112  actor->ar_initial_node_masses.resize(actor->ar_num_nodes);
113 
114  actor->UpdateBoundingBoxes(); // (records the unrotated dimensions for 'veh_aab_size')
115 
116  // Apply spawn position & spawn rotation
117  for (int i = 0; i < actor->ar_num_nodes; i++)
118  {
119  actor->ar_nodes[i].AbsPosition = rq.asr_position + rq.asr_rotation * (actor->ar_nodes[i].AbsPosition - rq.asr_position);
120  actor->ar_nodes[i].RelPosition = actor->ar_nodes[i].AbsPosition - actor->ar_origin;
121  };
122 
123  /* Place correctly */
124  if (spawner.GetMemoryRequirements().num_fixes == 0)
125  {
126  Ogre::Vector3 vehicle_position = rq.asr_position;
127 
128  // check if over-sized
129  actor->UpdateBoundingBoxes();
130  vehicle_position.x += vehicle_position.x - actor->ar_bounding_box.getCenter().x;
131  vehicle_position.z += vehicle_position.z - actor->ar_bounding_box.getCenter().z;
132 
133  float miny = 0.0f;
134 
135  if (!actor->m_preloaded_with_terrain)
136  {
137  miny = vehicle_position.y;
138  }
139 
140  if (rq.asr_spawnbox != nullptr)
141  {
142  miny = rq.asr_spawnbox->relo.y + rq.asr_spawnbox->center.y;
143  }
144 
145  if (rq.asr_free_position)
146  actor->resetPosition(vehicle_position, true);
147  else
148  actor->resetPosition(vehicle_position.x, vehicle_position.z, true, miny);
149 
150  if (rq.asr_spawnbox != nullptr)
151  {
152  bool inside = true;
153 
154  for (int i = 0; i < actor->ar_num_nodes; i++)
155  inside = (inside && App::GetGameContext()->GetTerrain()->GetCollisions()->isInside(actor->ar_nodes[i].AbsPosition, rq.asr_spawnbox, 0.2f));
156 
157  if (!inside)
158  {
159  Vector3 gpos = Vector3(vehicle_position.x, 0.0f, vehicle_position.z);
160 
161  gpos -= rq.asr_rotation * Vector3((rq.asr_spawnbox->hi.x - rq.asr_spawnbox->lo.x + actor->ar_bounding_box.getMaximum().x - actor->ar_bounding_box.getMinimum().x) * 0.6f, 0.0f, 0.0f);
162 
163  actor->resetPosition(gpos.x, gpos.z, true, miny);
164  }
165  }
166  }
167  else
168  {
169  actor->resetPosition(rq.asr_position, true);
170  }
171  actor->UpdateBoundingBoxes();
172 
173  //compute final mass
174  actor->recalculateNodeMasses();
175  actor->ar_initial_total_mass = actor->ar_total_mass;
176  actor->ar_original_dry_mass = actor->ar_dry_mass;
177  actor->ar_original_load_mass = actor->ar_load_mass;
178  actor->ar_orig_minimass = actor->ar_minimass;
179  for (int i = 0; i < actor->ar_num_nodes; i++)
180  {
181  actor->ar_initial_node_masses[i] = actor->ar_nodes[i].mass;
182  }
183 
184  //setup default sounds
185  if (!actor->m_disable_default_sounds)
186  {
188  }
189 
190  //compute node connectivity graph
191  actor->calcNodeConnectivityGraph();
192 
193  actor->UpdateBoundingBoxes();
194  actor->calculateAveragePosition();
195 
196  // calculate minimum camera radius
197  actor->calculateAveragePosition();
198  for (int i = 0; i < actor->ar_num_nodes; i++)
199  {
200  Real dist = actor->ar_nodes[i].AbsPosition.squaredDistance(actor->m_avg_node_position);
201  if (dist > actor->m_min_camera_radius)
202  {
203  actor->m_min_camera_radius = dist;
204  }
205  }
206  actor->m_min_camera_radius = std::sqrt(actor->m_min_camera_radius) * 1.2f; // twenty percent buffer
207 
208  // fix up submesh collision model
209  std::string subMeshGroundModelName = spawner.GetSubmeshGroundmodelName();
210  if (!subMeshGroundModelName.empty())
211  {
213  if (!actor->ar_submesh_ground_model)
214  {
216  }
217  }
218 
219  // Set beam defaults
220  for (int i = 0; i < actor->ar_num_beams; i++)
221  {
222  actor->ar_beams[i].initial_beam_strength = actor->ar_beams[i].strength;
224  actor->ar_initial_beam_defaults[i] = std::make_pair(actor->ar_beams[i].k, actor->ar_beams[i].d);
225  }
226 
227  actor->m_spawn_rotation = actor->getRotation();
228 
230 
231  actor->NotifyActorCameraChanged(); // setup sounds properly
232 
233  // calculate the number of wheel nodes
234  actor->m_wheel_node_count = 0;
235  for (int i = 0; i < actor->ar_num_nodes; i++)
236  {
237  if (actor->ar_nodes[i].nd_tyre_node)
238  actor->m_wheel_node_count++;
239  }
240 
241  // search m_net_first_wheel_node
242  actor->m_net_first_wheel_node = actor->ar_num_nodes;
243  for (int i = 0; i < actor->ar_num_nodes; i++)
244  {
245  if (actor->ar_nodes[i].nd_tyre_node || actor->ar_nodes[i].nd_rim_node)
246  {
247  actor->m_net_first_wheel_node = i;
248  break;
249  }
250  }
251 
252  // Initialize visuals
253  actor->updateVisual();
255 
256  // perform full visual update only if the vehicle won't be immediately driven by player.
257  if (actor->isPreloadedWithTerrain() || // .tobj file - Spawned sleeping somewhere on terrain
258  rq.asr_origin == ActorSpawnRequest::Origin::CONFIG_FILE || // RoR.cfg or commandline - not entered by default
259  actor->ar_num_cinecams == 0) // Not intended for player-controlling
260  {
261  actor->GetGfxActor()->UpdateSimDataBuffer(); // Initial fill of sim data buffers
262 
263  actor->GetGfxActor()->UpdateFlexbodies(); // Push tasks to threadpool
264  actor->GetGfxActor()->UpdateWheelVisuals(); // Push tasks to threadpool
265  actor->GetGfxActor()->UpdateCabMesh();
266  actor->GetGfxActor()->UpdateWingMeshes();
267  actor->GetGfxActor()->UpdateProps(0.f, false);
268  actor->GetGfxActor()->UpdateRods(); // beam visuals
269  actor->GetGfxActor()->FinishWheelUpdates(); // Sync tasks from threadpool
270  actor->GetGfxActor()->FinishFlexbodyTasks(); // Sync tasks from threadpool
271  }
272 
274 
275  if (actor->ar_engine)
276  {
278  actor->ar_engine->startEngine();
279  else
280  actor->ar_engine->offStart();
281  }
282  // pressurize tires
283  if (actor->getTyrePressure().IsEnabled())
284  {
285  actor->getTyrePressure().ModifyTyrePressure(0.f); // Initialize springiness of pressure-beams.
286  }
287 
289 
290  if (App::mp_state->getEnum<MpState>() == RoR::MpState::CONNECTED)
291  {
292  // network buffer layout (without RoRnet::VehicleState):
293  // -----------------------------------------------------
294 
295  // - 3 floats (x,y,z) for the reference node 0
296  // - ar_num_nodes - 1 times 3 short ints (compressed position info)
297  actor->m_net_node_buf_size = sizeof(float) * 3 + (actor->m_net_first_wheel_node - 1) * sizeof(short int) * 3;
299  // - ar_num_wheels times a float for the wheel rotation
300  actor->m_net_wheel_buf_size = actor->ar_num_wheels * sizeof(float);
302  // - bit array (made of ints) for the prop animation key states
304  (actor->m_prop_anim_key_states.size() / 8) + // whole chars
305  (size_t)(actor->m_prop_anim_key_states.size() % 8 != 0); // remainder: 0 or 1 chars
307 
309  {
311  if (actor->ar_engine)
312  {
313  actor->ar_engine->startEngine();
314  }
315  }
316 
317  actor->m_net_username = rq.asr_net_username;
318  actor->m_net_color_num = rq.asr_net_color;
319  }
320  else if (App::sim_replay_enabled->getBool())
321  {
322  actor->m_replay_handler = new Replay(actor, App::sim_replay_length->getInt());
323  }
324 
325  // Launch scripts (FIXME: ignores sectionconfig)
326  for (RigDef::Script const& script_def : def->root_module->scripts)
327  {
329  }
330 
331  LOG(" ===== DONE LOADING VEHICLE");
332 
333  if (App::diag_actor_dump->getBool())
334  {
335  actor->WriteDiagnosticDump(actor->ar_filename + "_dump_recalc.txt"); // Saves file to 'logs'
336  }
337 
338  m_actors.push_back(ActorPtr(actor));
339 
340  return actor;
341 }
342 
344 {
345  m_stream_mismatches.erase(sourceid);
346 
347  for (ActorPtr& actor : m_actors)
348  {
349  if (actor->ar_state != ActorState::NETWORKED_OK)
350  continue;
351 
352  if (actor->ar_net_source_id == sourceid)
353  {
355  }
356  }
357 }
358 
359 #ifdef USE_SOCKETW
360 void ActorManager::HandleActorStreamData(std::vector<RoR::NetRecvPacket> packet_buffer)
361 {
362  // Sort by stream source
363  std::stable_sort(packet_buffer.begin(), packet_buffer.end(),
364  [](const RoR::NetRecvPacket& a, const RoR::NetRecvPacket& b)
365  { return a.header.source > b.header.source; });
366  // Compress data stream by eliminating all but the last update from every consecutive group of stream data updates
367  auto it = std::unique(packet_buffer.rbegin(), packet_buffer.rend(),
368  [](const RoR::NetRecvPacket& a, const RoR::NetRecvPacket& b)
369  { return !memcmp(&a.header, &b.header, sizeof(RoRnet::Header)) &&
370  a.header.command == RoRnet::MSG2_STREAM_DATA; });
371  packet_buffer.erase(packet_buffer.begin(), it.base());
372  for (auto& packet : packet_buffer)
373  {
374  if (packet.header.command == RoRnet::MSG2_STREAM_REGISTER)
375  {
376  RoRnet::StreamRegister* reg = (RoRnet::StreamRegister *)packet.buffer;
377  if (reg->type == 0)
378  {
379  reg->name[127] = 0;
380  // NOTE: The filename is by default in "Bundle-qualified" format, i.e. "mybundle.zip:myactor.truck"
381  std::string filename_maybe_bundlequalified = SanitizeUtf8CString(reg->name);
382  std::string filename;
383  std::string bundlename;
384  SplitBundleQualifiedFilename(filename_maybe_bundlequalified, /*out:*/ bundlename, /*out:*/ filename);
385 
386  RoRnet::UserInfo info;
387  BitMask_t peeropts = BitMask_t(0);
388  if (!App::GetNetwork()->GetUserInfo(reg->origin_sourceid, info)
389  || !App::GetNetwork()->GetUserPeerOpts(reg->origin_sourceid, peeropts))
390  {
391  RoR::LogFormat("[RoR] Invalid STREAM_REGISTER, user id %d does not exist", reg->origin_sourceid);
392  reg->status = -1;
393  }
394  else if (filename.empty())
395  {
396  RoR::LogFormat("[RoR] Invalid STREAM_REGISTER (user '%s', ID %d), filename is empty string", info.username, reg->origin_sourceid);
397  reg->status = -1;
398  }
399  else
400  {
401  Str<200> text;
402  text << _L("spawned a new vehicle: ") << filename;
405 
406  LOG("[RoR] Creating remote actor for " + TOSTRING(reg->origin_sourceid) + ":" + TOSTRING(reg->origin_streamid));
407 
408  CacheEntryPtr actor_entry = App::GetCacheSystem()->FindEntryByFilename(LT_AllBeam, /*partial:*/false, filename_maybe_bundlequalified);
409 
410  if (!actor_entry)
411  {
414  _L("Mod not installed: ") + filename);
415  RoR::LogFormat("[RoR] Cannot create remote actor (not installed), filename: '%s'", filename_maybe_bundlequalified.c_str());
417  reg->status = -1;
418  }
419  else
420  {
421  auto actor_reg = reinterpret_cast<RoRnet::ActorStreamRegister*>(reg);
423  {
424  int offset = actor_reg->time - m_net_timer.getMilliseconds();
425  m_stream_time_offsets[reg->origin_sourceid] = offset - 100;
426  }
429  rq->asr_cache_entry = actor_entry;
430  if (strnlen(actor_reg->skin, 60) < 60 && actor_reg->skin[0] != '\0')
431  {
432  rq->asr_skin_entry = App::GetCacheSystem()->FetchSkinByName(actor_reg->skin); // FIXME: fetch skin by name+guid! ~ 03/2019
433  }
434  if (strnlen(actor_reg->sectionconfig, 60) < 60)
435  {
436  rq->asr_config = actor_reg->sectionconfig;
437  }
439  rq->asr_net_color = info.colournum;
440  rq->asr_net_peeropts = peeropts;
441  rq->net_source_id = reg->origin_sourceid;
442  rq->net_stream_id = reg->origin_streamid;
443 
445  MSG_SIM_SPAWN_ACTOR_REQUESTED, (void*)rq));
446 
447  reg->status = 1;
448  }
449  }
450 
452  }
453  }
454  else if (packet.header.command == RoRnet::MSG2_STREAM_REGISTER_RESULT)
455  {
456  RoRnet::StreamRegister* reg = (RoRnet::StreamRegister *)packet.buffer;
457  for (ActorPtr& actor: m_actors)
458  {
459  if (actor->ar_net_source_id == reg->origin_sourceid && actor->ar_net_stream_id == reg->origin_streamid)
460  {
461  int sourceid = packet.header.source;
462  actor->ar_net_stream_results[sourceid] = reg->status;
463 
464  String message = "";
465  switch (reg->status)
466  {
467  case 1: message = "successfully loaded stream"; break;
468  case -2: message = "detected mismatch stream"; break;
469  default: message = "could not load stream"; break;
470  }
471  LOG("Client " + TOSTRING(sourceid) + " " + message + " " + TOSTRING(reg->origin_streamid) +
472  " with name '" + reg->name + "', result code: " + TOSTRING(reg->status));
473  break;
474  }
475  }
476  }
477  else if (packet.header.command == RoRnet::MSG2_STREAM_UNREGISTER)
478  {
479  ActorPtr b = this->GetActorByNetworkLinks(packet.header.source, packet.header.streamid);
480  if (b)
481  {
483  {
485  }
486  }
487  m_stream_mismatches[packet.header.source].erase(packet.header.streamid);
488  }
489  else if (packet.header.command == RoRnet::MSG2_USER_LEAVE)
490  {
491  this->RemoveStreamSource(packet.header.source);
492  }
493  else if (packet.header.command == RoRnet::MSG2_STREAM_DATA)
494  {
495  for (ActorPtr& actor: m_actors)
496  {
497  if (actor->ar_state != ActorState::NETWORKED_OK)
498  continue;
499  if (packet.header.source == actor->ar_net_source_id && packet.header.streamid == actor->ar_net_stream_id)
500  {
501  actor->pushNetwork(packet.buffer, packet.header.size);
502  break;
503  }
504  }
505  }
506  }
507 }
508 #endif // USE_SOCKETW
509 
511 {
512  auto search = m_stream_time_offsets.find(sourceid);
513  if (search != m_stream_time_offsets.end())
514  {
515  return search->second;
516  }
517  return 0;
518 }
519 
520 void ActorManager::UpdateNetTimeOffset(int sourceid, int offset)
521 {
522  if (m_stream_time_offsets.find(sourceid) != m_stream_time_offsets.end())
523  {
524  m_stream_time_offsets[sourceid] += offset;
525  }
526 }
527 
529 {
530  if (!m_stream_mismatches[sourceid].empty())
531  return 0;
532 
533  for (ActorPtr& actor: m_actors)
534  {
535  if (actor->ar_state != ActorState::NETWORKED_OK)
536  continue;
537 
538  if (actor->ar_net_source_id == sourceid)
539  {
540  return 1;
541  }
542  }
543 
544  return 2;
545 }
546 
548 {
549  int result = 2;
550 
551  for (ActorPtr& actor: m_actors)
552  {
553  if (actor->ar_state == ActorState::NETWORKED_OK)
554  continue;
555 
556  int stream_result = actor->ar_net_stream_results[sourceid];
557  if (stream_result == -1 || stream_result == -2)
558  return 0;
559  if (stream_result == 1)
560  result = 1;
561  }
562 
563  return result;
564 }
565 
566 const ActorPtr& ActorManager::GetActorByNetworkLinks(int source_id, int stream_id)
567 {
568  for (ActorPtr& actor: m_actors)
569  {
570  if (actor->ar_net_source_id == source_id && actor->ar_net_stream_id == stream_id)
571  {
572  return actor;
573  }
574  }
575 
576  return ACTORPTR_NULL;
577 }
578 
580 {
581  if (m_actors[a]->ar_collision_bounding_boxes.empty() && m_actors[b]->ar_collision_bounding_boxes.empty())
582  {
583  return m_actors[a]->ar_bounding_box.intersects(m_actors[b]->ar_bounding_box);
584  }
585  else if (m_actors[a]->ar_collision_bounding_boxes.empty())
586  {
587  for (const auto& bbox_b : m_actors[b]->ar_collision_bounding_boxes)
588  if (bbox_b.intersects(m_actors[a]->ar_bounding_box))
589  return true;
590  }
591  else if (m_actors[b]->ar_collision_bounding_boxes.empty())
592  {
593  for (const auto& bbox_a : m_actors[a]->ar_collision_bounding_boxes)
594  if (bbox_a.intersects(m_actors[b]->ar_bounding_box))
595  return true;
596  }
597  else
598  {
599  for (const auto& bbox_a : m_actors[a]->ar_collision_bounding_boxes)
600  for (const auto& bbox_b : m_actors[b]->ar_collision_bounding_boxes)
601  if (bbox_a.intersects(bbox_b))
602  return true;
603  }
604 
605  return false;
606 }
607 
609 {
610  if (m_actors[a]->ar_predicted_coll_bounding_boxes.empty() && m_actors[b]->ar_predicted_coll_bounding_boxes.empty())
611  {
612  return m_actors[a]->ar_predicted_bounding_box.intersects(m_actors[b]->ar_predicted_bounding_box);
613  }
614  else if (m_actors[a]->ar_predicted_coll_bounding_boxes.empty())
615  {
616  for (const auto& bbox_b : m_actors[b]->ar_predicted_coll_bounding_boxes)
617  if (bbox_b.intersects(m_actors[a]->ar_predicted_bounding_box))
618  return true;
619  }
620  else if (m_actors[b]->ar_predicted_coll_bounding_boxes.empty())
621  {
622  for (const auto& bbox_a : m_actors[a]->ar_predicted_coll_bounding_boxes)
623  if (bbox_a.intersects(m_actors[b]->ar_predicted_bounding_box))
624  return true;
625  }
626  else
627  {
628  for (const auto& bbox_a : m_actors[a]->ar_predicted_coll_bounding_boxes)
629  for (const auto& bbox_b : m_actors[b]->ar_predicted_coll_bounding_boxes)
630  if (bbox_a.intersects(bbox_b))
631  return true;
632  }
633 
634  return false;
635 }
636 
637 void ActorManager::RecursiveActivation(int j, std::vector<bool>& visited)
638 {
639  if (visited[j] || m_actors[j]->ar_state != ActorState::LOCAL_SIMULATED)
640  return;
641 
642  visited[j] = true;
643 
644  for (unsigned int t = 0; t < m_actors.size(); t++)
645  {
646  if (t == j || visited[t])
647  continue;
649  {
650  m_actors[t]->ar_sleep_counter = 0.0f;
651  this->RecursiveActivation(t, visited);
652  }
654  {
655  m_actors[t]->ar_sleep_counter = 0.0f;
656  m_actors[t]->ar_state = ActorState::LOCAL_SIMULATED;
657  this->RecursiveActivation(t, visited);
658  }
659  }
660 }
661 
663 {
664  if (source_actor->ar_forward_commands)
665  {
666  auto linked_actors = source_actor->ar_linked_actors;
667 
668  for (ActorPtr& actor : this->GetActors())
669  {
670  if (actor != source_actor && actor->ar_import_commands &&
671  (actor->getPosition().distance(source_actor->getPosition()) <
672  actor->m_min_camera_radius + source_actor->m_min_camera_radius))
673  {
674  // activate the truck
675  if (actor->ar_state == ActorState::LOCAL_SLEEPING)
676  {
677  actor->ar_sleep_counter = 0.0f;
678  actor->ar_state = ActorState::LOCAL_SIMULATED;
679  }
680 
681  if (App::sim_realistic_commands->getBool())
682  {
683  if (std::find(linked_actors.begin(), linked_actors.end(), actor) == linked_actors.end())
684  continue;
685  }
686 
687  // forward commands
688  for (int j = 1; j <= MAX_COMMANDS; j++) // BEWARE: commandkeys are indexed 1-MAX_COMMANDS!
689  {
690  actor->ar_command_key[j].playerInputValue = std::max(source_actor->ar_command_key[j].playerInputValue,
691  source_actor->ar_command_key[j].commandValue);
692  }
693  if (source_actor->ar_toggle_ties)
694  {
695  //actor->tieToggle();
698  rq->alr_actor_instance_id = actor->ar_instance_id;
699  rq->alr_tie_group = -1;
701 
702  }
703  if (source_actor->ar_toggle_ropes)
704  {
705  //actor->ropeToggle(-1);
708  rq->alr_actor_instance_id = actor->ar_instance_id;
709  rq->alr_rope_group = -1;
711  }
712  }
713  }
714  // just send brake and lights to the connected trucks, and no one else :)
715  for (auto hook : source_actor->ar_hooks)
716  {
717  if (!hook.hk_locked_actor || hook.hk_locked_actor == source_actor)
718  continue;
719 
720  // forward brakes
721  hook.hk_locked_actor->ar_brake = source_actor->ar_brake;
722  if (hook.hk_locked_actor->ar_parking_brake != source_actor->ar_trailer_parking_brake)
723  {
724  hook.hk_locked_actor->parkingbrakeToggle();
725  }
726 
727  // forward lights
728  hook.hk_locked_actor->importLightStateMask(source_actor->getLightStateMask());
729  }
730  }
731 }
732 
734 {
735  for (auto& entry: inter_actor_links)
736  {
737  auto& actor_pair = entry.second;
738  if ((actor_pair.first == a1 && actor_pair.second == a2) ||
739  (actor_pair.first == a2 && actor_pair.second == a1))
740  {
741  return true;
742  }
743  }
744  return false;
745 }
746 
747 void ActorManager::UpdateSleepingState(ActorPtr player_actor, float dt)
748 {
749  if (!m_forced_awake)
750  {
751  for (ActorPtr& actor: m_actors)
752  {
753  if (actor->ar_state != ActorState::LOCAL_SIMULATED)
754  continue;
755  if (actor->ar_driveable == AI)
756  continue;
757  if (actor->getVelocity().squaredLength() > 0.01f)
758  {
759  actor->ar_sleep_counter = 0.0f;
760  continue;
761  }
762 
763  actor->ar_sleep_counter += dt;
764 
765  if (actor->ar_sleep_counter >= 10.0f)
766  {
767  actor->ar_state = ActorState::LOCAL_SLEEPING;
768  }
769  }
770  }
771 
772  if (player_actor && player_actor->ar_state == ActorState::LOCAL_SLEEPING)
773  {
774  player_actor->ar_state = ActorState::LOCAL_SIMULATED;
775  }
776 
777  std::vector<bool> visited(m_actors.size());
778  // Recursivly activate all actors which can be reached from current actor
779  if (player_actor && player_actor->ar_state == ActorState::LOCAL_SIMULATED)
780  {
781  player_actor->ar_sleep_counter = 0.0f;
782  this->RecursiveActivation(player_actor->ar_vector_index, visited);
783  }
784  // Snowball effect (activate all actors which might soon get hit by a moving actor)
785  for (unsigned int t = 0; t < m_actors.size(); t++)
786  {
787  if (m_actors[t]->ar_state == ActorState::LOCAL_SIMULATED && m_actors[t]->ar_sleep_counter == 0.0f)
788  this->RecursiveActivation(t, visited);
789  }
790 }
791 
793 {
794  for (ActorPtr& actor: m_actors)
795  {
796  if (actor->ar_state == ActorState::LOCAL_SLEEPING)
797  {
798  actor->ar_state = ActorState::LOCAL_SIMULATED;
799  actor->ar_sleep_counter = 0.0f;
800  }
801  }
802 }
803 
805 {
806  m_forced_awake = false;
807  for (ActorPtr& actor: m_actors)
808  {
809  if (actor->ar_state == ActorState::LOCAL_SIMULATED)
810  {
811  actor->ar_state = ActorState::LOCAL_SLEEPING;
812  }
813  }
814 }
815 
816 ActorPtr ActorManager::FindActorInsideBox(Collisions* collisions, const Ogre::String& inst, const Ogre::String& box)
817 {
818  // try to find the desired actor (the one in the box)
819  ActorPtr ret = nullptr;
820  for (ActorPtr& actor: m_actors)
821  {
822  if (collisions->isInside(actor->ar_nodes[0].AbsPosition, inst, box))
823  {
824  if (ret == nullptr)
825  // first actor found
826  ret = actor;
827  else
828  // second actor found -> unclear which one was meant
829  return nullptr;
830  }
831  }
832  return ret;
833 }
834 
835 void ActorManager::RepairActor(Collisions* collisions, const Ogre::String& inst, const Ogre::String& box, bool keepPosition)
836 {
837  ActorPtr actor = this->FindActorInsideBox(collisions, inst, box);
838  if (actor != nullptr)
839  {
841 
843  rq->amr_actor = actor->ar_instance_id;
846  }
847 }
848 
849 std::pair<ActorPtr, float> ActorManager::GetNearestActor(Vector3 position)
850 {
851  ActorPtr nearest_actor = nullptr;
852  float min_squared_distance = std::numeric_limits<float>::max();
853  for (ActorPtr& actor : m_actors)
854  {
855  float squared_distance = position.squaredDistance(actor->ar_nodes[0].AbsPosition);
856  if (squared_distance < min_squared_distance)
857  {
858  min_squared_distance = squared_distance;
859  nearest_actor = actor;
860  }
861  }
862  return std::make_pair(nearest_actor, std::sqrt(min_squared_distance));
863 }
864 
865 void ActorManager::CleanUpSimulation() // Called after simulation finishes
866 {
867  while (m_actors.size() > 0)
868  {
869  this->DeleteActorInternal(m_actors.back()); // OK to invoke here - CleanUpSimulation() - processing `MSG_SIM_UNLOAD_TERRAIN_REQUESTED`
870  }
871 
872  m_total_sim_time = 0.f;
874  m_simulation_paused = false;
875  m_simulation_speed = 1.f;
876 }
877 
879 {
880  if (actor == nullptr || actor->ar_state == ActorState::DISPOSED)
881  return;
882 
883  this->SyncWithSimThread();
884 
885 #ifdef USE_SOCKETW
886  if (App::mp_state->getEnum<MpState>() == RoR::MpState::CONNECTED)
887  {
888  if (actor->ar_state != ActorState::NETWORKED_OK)
889  {
891  }
892  else if (std::count_if(m_actors.begin(), m_actors.end(), [actor](ActorPtr& b)
893  { return b->ar_net_source_id == actor->ar_net_source_id; }) == 1)
894  {
895  // We're deleting the last actor from this stream source, reset the stream time offset
897  }
898  }
899 #endif // USE_SOCKETW
900 
901  // Unload actor's scripts
902  std::vector<ScriptUnitID_t> unload_list;
903  for (auto& pair : App::GetScriptEngine()->getScriptUnits())
904  {
905  if (pair.second.associatedActor == actor)
906  unload_list.push_back(pair.first);
907  }
908  for (ScriptUnitID_t id : unload_list)
909  {
911  }
912 
913  // Remove FreeForces referencing this actor
914  m_free_forces.erase(
915  std::remove_if(
916  m_free_forces.begin(),
917  m_free_forces.end(),
918  [actor](FreeForce& item) { return item.ffc_base_actor == actor || item.ffc_target_actor == actor; }),
919  m_free_forces.end());
920 
921  // Only dispose(), do not `delete`; a script may still hold pointer to the object.
922  actor->dispose();
923 
924  EraseIf(m_actors, [actor](ActorPtr& curActor) { return actor == curActor; });
925 
926  // Upate actor indices
927  for (unsigned int i = 0; i < m_actors.size(); i++)
928  m_actors[i]->ar_vector_index = i;
929 }
930 
931 // ACTORLIST for cycling with hotkeys
932 // ----------------------------------
933 
934 int FindPivotActorId(ActorPtr player, ActorPtr prev_player)
935 {
936  if (player != nullptr)
937  return player->ar_vector_index;
938  else if (prev_player != nullptr)
939  return prev_player->ar_vector_index + 1;
940  return -1;
941 }
942 
944 {
945  bool retval = !actor->isPreloadedWithTerrain();
946 
947  // Exclude remote actors, if desired
948  if (!App::mp_cyclethru_net_actors->getBool())
949  {
951  {
952  retval = false;
953  }
954  }
955 
956  return retval;
957 }
958 
960 {
961  int pivot_index = FindPivotActorId(player, prev_player);
962 
963  for (int i = pivot_index + 1; i < m_actors.size(); i++)
964  {
966  return m_actors[i];
967  }
968 
969  for (int i = 0; i < pivot_index; i++)
970  {
972  return m_actors[i];
973  }
974 
975  if (pivot_index >= 0)
976  {
977  if (ShouldIncludeActorInList(m_actors[pivot_index]))
978  return m_actors[pivot_index];
979  }
980 
981  return ACTORPTR_NULL;
982 }
983 
985 {
986  int pivot_index = FindPivotActorId(player, prev_player);
987 
988  for (int i = pivot_index - 1; i >= 0; i--)
989  {
991  return m_actors[i];
992  }
993 
994  for (int i = static_cast<int>(m_actors.size()) - 1; i > pivot_index; i--)
995  {
997  return m_actors[i];
998  }
999 
1000  if (pivot_index >= 0)
1001  {
1002  if (ShouldIncludeActorInList(m_actors[pivot_index]))
1003  return m_actors[pivot_index];
1004  }
1005 
1006  return ACTORPTR_NULL;
1007 }
1008 
1009 // END actorlist
1010 
1012 {
1013  for (ActorPtr& actor: m_actors)
1014  {
1015  if (actor->ar_rescuer_flag)
1016  {
1017  return actor;
1018  }
1019  }
1020  return ACTORPTR_NULL;
1021 }
1022 
1024 {
1025  float dt = m_simulation_time;
1026 
1027  // do not allow dt > 1/20
1028  dt = std::min(dt, 1.0f / 20.0f);
1029 
1030  dt *= m_simulation_speed;
1031 
1032  dt += m_dt_remainder;
1033  m_physics_steps = dt / PHYSICS_DT;
1034  if (m_physics_steps == 0)
1035  {
1036  return;
1037  }
1038 
1040  dt = PHYSICS_DT * m_physics_steps;
1041 
1042  this->SyncWithSimThread();
1043 
1044  this->UpdateSleepingState(player_actor, dt);
1045 
1046  for (ActorPtr& actor: m_actors)
1047  {
1048  actor->HandleInputEvents(dt);
1049  actor->HandleAngelScriptEvents(dt);
1050 
1051 #ifdef USE_ANGELSCRIPT
1052  if (actor->ar_vehicle_ai && actor->ar_vehicle_ai->isActive())
1053  actor->ar_vehicle_ai->update(dt, 0);
1054 #endif // USE_ANGELSCRIPT
1055 
1056  if (actor->ar_engine)
1057  {
1058  if (actor->ar_driveable == TRUCK)
1059  {
1060  this->UpdateTruckFeatures(actor, dt);
1061  }
1062  if (actor->ar_state == ActorState::LOCAL_SLEEPING)
1063  {
1064  actor->ar_engine->UpdateEngine(dt, 1);
1065  }
1066  actor->ar_engine->UpdateEngineAudio();
1067  }
1068 
1069  // Always update indicator states - used by 'u' type flares.
1070  actor->updateDashBoards(dt);
1071 
1072  // Blinkers (turn signals) must always be updated
1073  actor->updateFlareStates(dt);
1074 
1075  if (actor->ar_state != ActorState::LOCAL_SLEEPING)
1076  {
1077  actor->updateVisual(dt);
1078  if (actor->ar_update_physics && App::gfx_skidmarks_mode->getInt() > 0)
1079  {
1080  actor->updateSkidmarks();
1081  }
1082  }
1083  if (App::mp_state->getEnum<MpState>() == RoR::MpState::CONNECTED)
1084  {
1085  // FIXME: Hidden actors must also be updated to workaround a glitch, see https://github.com/RigsOfRods/rigs-of-rods/issues/2911
1086  if (actor->ar_state == ActorState::NETWORKED_OK || actor->ar_state == ActorState::NETWORKED_HIDDEN)
1087  actor->calcNetwork();
1088  else
1089  actor->sendStreamData();
1090  }
1091  }
1092 
1093  if (player_actor != nullptr)
1094  {
1095  this->ForwardCommands(player_actor);
1096  if (player_actor->ar_toggle_ties)
1097  {
1098  //player_actor->tieToggle();
1101  rq->alr_actor_instance_id = player_actor->ar_instance_id;
1102  rq->alr_tie_group = -1;
1104 
1105  player_actor->ar_toggle_ties = false;
1106  }
1107  if (player_actor->ar_toggle_ropes)
1108  {
1109  //player_actor->ropeToggle(-1);
1112  rq->alr_actor_instance_id = player_actor->ar_instance_id;
1113  rq->alr_rope_group = -1;
1115 
1116  player_actor->ar_toggle_ropes = false;
1117  }
1118 
1119  player_actor->ForceFeedbackStep(m_physics_steps);
1120 
1121  if (player_actor->ar_state == ActorState::LOCAL_REPLAY)
1122  {
1123  player_actor->getReplay()->replayStepActor();
1124  }
1125  }
1126 
1127  auto func = std::function<void()>([this]()
1128  {
1129  this->UpdatePhysicsSimulation();
1130  });
1131  m_sim_task = m_sim_thread_pool->RunTask(func);
1132 
1133  m_total_sim_time += dt;
1134 
1135  if (!App::app_async_physics->getBool())
1136  m_sim_task->join();
1137 }
1138 
1140 {
1141  for (ActorPtr& actor: m_actors)
1142  {
1143  if (actor->ar_instance_id == actor_id)
1144  {
1145  return actor;
1146  }
1147  }
1148  return ACTORPTR_NULL;
1149 }
1150 
1152 {
1153  for (ActorPtr& actor: m_actors)
1154  {
1155  actor->UpdatePhysicsOrigin();
1156  }
1157  for (int i = 0; i < m_physics_steps; i++)
1158  {
1159  {
1160  std::vector<std::function<void()>> tasks;
1161  for (ActorPtr& actor: m_actors)
1162  {
1163  if (actor->ar_update_physics = actor->CalcForcesEulerPrepare(i == 0))
1164  {
1165  auto func = std::function<void()>([this, i, &actor]()
1166  {
1167  actor->CalcForcesEulerCompute(i == 0, m_physics_steps);
1168  });
1169  tasks.push_back(func);
1170  }
1171  }
1172  App::GetThreadPool()->Parallelize(tasks);
1173  for (ActorPtr& actor: m_actors)
1174  {
1175  if (actor->ar_update_physics)
1176  {
1177  actor->CalcBeamsInterActor();
1178  }
1179  }
1180  }
1181  {
1182  std::vector<std::function<void()>> tasks;
1183  for (ActorPtr& actor: m_actors)
1184  {
1185  if (actor->m_inter_point_col_detector != nullptr && (actor->ar_update_physics ||
1186  (App::mp_pseudo_collisions->getBool() && actor->ar_state == ActorState::NETWORKED_OK)))
1187  {
1188  auto func = std::function<void()>([this, &actor]()
1189  {
1190  actor->m_inter_point_col_detector->UpdateInterPoint();
1191  if (actor->ar_collision_relevant)
1192  {
1193  ResolveInterActorCollisions(PHYSICS_DT,
1194  *actor->m_inter_point_col_detector,
1195  actor->ar_num_collcabs,
1196  actor->ar_collcabs,
1197  actor->ar_cabs,
1198  actor->ar_inter_collcabrate,
1199  actor->ar_nodes,
1200  actor->ar_collision_range,
1201  *actor->ar_submesh_ground_model);
1202  }
1203  });
1204  tasks.push_back(func);
1205  }
1206  }
1207  App::GetThreadPool()->Parallelize(tasks);
1208  }
1209 
1210  // Apply FreeForces - intentionally as a separate pass over all actors
1211  this->CalcFreeForces();
1212  }
1213  for (ActorPtr& actor: m_actors)
1214  {
1215  actor->m_ongoing_reset = false;
1216  if (actor->ar_update_physics && m_physics_steps > 0)
1217  {
1218  Vector3 camera_gforces = actor->m_camera_gforces_accu / m_physics_steps;
1219  actor->m_camera_gforces_accu = Vector3::ZERO;
1220  actor->m_camera_gforces = actor->m_camera_gforces * 0.5f + camera_gforces * 0.5f;
1221  actor->calculateLocalGForces();
1222  actor->calculateAveragePosition();
1223  actor->m_avg_node_velocity = actor->m_avg_node_position - actor->m_avg_node_position_prev;
1224  actor->m_avg_node_velocity /= (m_physics_steps * PHYSICS_DT);
1225  actor->m_avg_node_position_prev = actor->m_avg_node_position;
1226  actor->ar_top_speed = std::max(actor->ar_top_speed, actor->ar_nodes[0].Velocity.length());
1227  }
1228  }
1229 }
1230 
1232 {
1233  if (m_sim_task)
1234  m_sim_task->join();
1235 }
1236 
1237 void HandleErrorLoadingFile(std::string type, std::string filename, std::string exception_msg)
1238 {
1239  RoR::Str<200> msg;
1240  msg << "Failed to load '" << filename << "' (type: '" << type << "'), message: " << exception_msg;
1243 }
1244 
1245 void HandleErrorLoadingTruckfile(std::string filename, std::string exception_msg)
1246 {
1247  HandleErrorLoadingFile("actor", filename, exception_msg);
1248 }
1249 
1251 {
1252  // Check the actor exists in mod cache
1253  if (rq.asr_cache_entry == nullptr)
1254  {
1255  HandleErrorLoadingTruckfile(rq.asr_filename, "Truckfile not found in ModCache (probably not installed)");
1256  return nullptr;
1257  }
1258 
1259  // If already parsed, re-use
1260  if (rq.asr_cache_entry->actor_def != nullptr)
1261  {
1262  return rq.asr_cache_entry->actor_def;
1263  }
1264 
1265  // Load the 'truckfile'
1266  try
1267  {
1269  Ogre::DataStreamPtr stream = Ogre::ResourceGroupManager::getSingleton().openResource(rq.asr_cache_entry->fname, rq.asr_cache_entry->resource_group);
1270 
1271  if (!stream || !stream->isReadable())
1272  {
1273  HandleErrorLoadingTruckfile(rq.asr_cache_entry->fname, "Unable to open/read truckfile");
1274  return nullptr;
1275  }
1276 
1277  RoR::LogFormat("[RoR] Parsing truckfile '%s'", rq.asr_cache_entry->fname.c_str());
1278  RigDef::Parser parser;
1279  parser.Prepare();
1280  parser.ProcessOgreStream(stream.get(), rq.asr_cache_entry->resource_group);
1281  parser.Finalize();
1282 
1283  auto def = parser.GetFile();
1284 
1285  // VALIDATING
1286  LOG(" == Validating vehicle: " + def->name);
1287 
1288  RigDef::Validator validator;
1289  validator.Setup(def);
1290 
1292  {
1293  // Workaround: Some terrains pre-load truckfiles with special purpose:
1294  // "soundloads" = play sound effect at certain spot
1295  // "fixes" = structures of N/B fixed to the ground
1296  // These files can have no beams. Possible extensions: .load or .fixed
1297  std::string file_extension = rq.asr_cache_entry->fname.substr(rq.asr_cache_entry->fname.find_last_of('.'));
1298  Ogre::StringUtil::toLowerCase(file_extension);
1299  if ((file_extension == ".load") || (file_extension == ".fixed"))
1300  {
1301  validator.SetCheckBeams(false);
1302  }
1303  }
1304 
1305  validator.Validate(); // Sends messages to console
1306 
1307  def->hash = Sha1Hash(stream->getAsString());
1308 
1309  rq.asr_cache_entry->actor_def = def;
1310  return def;
1311  }
1312  catch (Ogre::Exception& oex)
1313  {
1314  HandleErrorLoadingTruckfile(rq.asr_cache_entry->fname, oex.getDescription().c_str());
1315  return nullptr;
1316  }
1317  catch (std::exception& stex)
1318  {
1320  return nullptr;
1321  }
1322  catch (...)
1323  {
1324  HandleErrorLoadingTruckfile(rq.asr_cache_entry->fname, "<Unknown exception occurred>");
1325  return nullptr;
1326  }
1327 }
1328 
1329 void ActorManager::ExportActorDef(RigDef::DocumentPtr def, std::string filename, std::string rg_name)
1330 {
1331  try
1332  {
1333  Ogre::ResourceGroupManager& rgm = Ogre::ResourceGroupManager::getSingleton();
1334 
1335  // Open OGRE stream for writing
1336  Ogre::DataStreamPtr stream = rgm.createResource(filename, rg_name, /*overwrite=*/true);
1337  if (stream.isNull() || !stream->isWriteable())
1338  {
1339  OGRE_EXCEPT(Ogre::Exception::ERR_CANNOT_WRITE_TO_FILE,
1340  "Stream NULL or not writeable, filename: '" + filename
1341  + "', resource group: '" + rg_name + "'");
1342  }
1343 
1344  // Serialize actor to string
1345  RigDef::Serializer serializer(def);
1346  serializer.Serialize();
1347 
1348  // Flush the string to file
1349  stream->write(serializer.GetOutput().c_str(), serializer.GetOutput().size());
1350  stream->close();
1351  }
1352  catch (Ogre::Exception& oex)
1353  {
1355  fmt::format(_LC("Truck", "Failed to export truck '{}' to resource group '{}', message: {}"),
1356  filename, rg_name, oex.getFullDescription()));
1357  }
1358 }
1359 
1360 std::vector<ActorPtr> ActorManager::GetLocalActors()
1361 {
1362  std::vector<ActorPtr> actors;
1363  for (ActorPtr& actor: m_actors)
1364  {
1365  if (actor->ar_state != ActorState::NETWORKED_OK)
1366  actors.push_back(actor);
1367  }
1368  return actors;
1369 }
1370 
1372 {
1373  // Simulation pace adjustment (slowmotion)
1374  if (!App::GetGameContext()->GetRaceSystem().IsRaceInProgress())
1375  {
1376  // EV_COMMON_ACCELERATE_SIMULATION
1377  if (App::GetInputEngine()->getEventBoolValue(EV_COMMON_ACCELERATE_SIMULATION))
1378  {
1379  float simulation_speed = this->GetSimulationSpeed() * pow(2.0f, dt / 2.0f);
1380  this->SetSimulationSpeed(simulation_speed);
1381  String ssmsg = _L("New simulation speed: ") + TOSTRING(Round(simulation_speed * 100.0f, 1)) + "%";
1383  }
1384 
1385  // EV_COMMON_DECELERATE_SIMULATION
1386  if (App::GetInputEngine()->getEventBoolValue(EV_COMMON_DECELERATE_SIMULATION))
1387  {
1388  float simulation_speed = this->GetSimulationSpeed() * pow(0.5f, dt / 2.0f);
1389  this->SetSimulationSpeed(simulation_speed);
1390  String ssmsg = _L("New simulation speed: ") + TOSTRING(Round(simulation_speed * 100.0f, 1)) + "%";
1392  }
1393 
1394  // EV_COMMON_RESET_SIMULATION_PACE
1395  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_RESET_SIMULATION_PACE))
1396  {
1397  float simulation_speed = this->GetSimulationSpeed();
1398  if (simulation_speed != 1.0f)
1399  {
1400  m_last_simulation_speed = simulation_speed;
1401  this->SetSimulationSpeed(1.0f);
1402  std::string ssmsg = _L("Simulation speed reset.");
1404  }
1405  else if (m_last_simulation_speed != 1.0f)
1406  {
1408  String ssmsg = _L("New simulation speed: ") + TOSTRING(Round(m_last_simulation_speed * 100.0f, 1)) + "%";
1410  }
1411  }
1412 
1413  // Special adjustment while racing
1414  if (App::GetGameContext()->GetRaceSystem().IsRaceInProgress() && this->GetSimulationSpeed() != 1.0f)
1415  {
1417  this->SetSimulationSpeed(1.f);
1418  }
1419  }
1420 
1421  // EV_COMMON_TOGGLE_PHYSICS - Freeze/unfreeze physics
1422  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_TOGGLE_PHYSICS))
1423  {
1425 
1426  if (m_simulation_paused)
1427  {
1428  String ssmsg = _L("Physics paused");
1430  }
1431  else
1432  {
1433  String ssmsg = _L("Physics unpaused");
1435  }
1436  }
1437 
1438  // Calculate simulation time
1439  if (m_simulation_paused)
1440  {
1441  m_simulation_time = 0.f;
1442 
1443  // Frozen physics stepping
1444  if (this->GetSimulationSpeed() > 0.0f)
1445  {
1446  // EV_COMMON_REPLAY_FAST_FORWARD - Advance simulation while pressed
1447  // EV_COMMON_REPLAY_FORWARD - Advanced simulation one step
1448  if (App::GetInputEngine()->getEventBoolValue(EV_COMMON_REPLAY_FAST_FORWARD) ||
1449  App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_REPLAY_FORWARD))
1450  {
1452  }
1453  }
1454  }
1455  else
1456  {
1457  m_simulation_time = dt;
1458  }
1459 }
1460 
1462 {
1463  if (vehicle->isBeingReset() || vehicle->ar_physics_paused)
1464  return;
1465 #ifdef USE_ANGELSCRIPT
1466  if (vehicle->ar_vehicle_ai && vehicle->ar_vehicle_ai->isActive())
1467  return;
1468 #endif // USE_ANGELSCRIPT
1469 
1470  EnginePtr engine = vehicle->ar_engine;
1471 
1472  if (engine && engine->hasContact() &&
1473  engine->getAutoMode() == SimGearboxMode::AUTO &&
1474  engine->getAutoShift() != Engine::NEUTRAL)
1475  {
1476  Ogre::Vector3 dirDiff = vehicle->getDirection();
1477  Ogre::Degree pitchAngle = Ogre::Radian(asin(dirDiff.dotProduct(Ogre::Vector3::UNIT_Y)));
1478 
1479  if (std::abs(pitchAngle.valueDegrees()) > 2.0f)
1480  {
1481  if (engine->getAutoShift() > Engine::NEUTRAL && vehicle->ar_avg_wheel_speed < +0.02f && pitchAngle.valueDegrees() > 0.0f ||
1482  engine->getAutoShift() < Engine::NEUTRAL && vehicle->ar_avg_wheel_speed > -0.02f && pitchAngle.valueDegrees() < 0.0f)
1483  {
1484  // anti roll back in SimGearboxMode::AUTO (DRIVE, TWO, ONE) mode
1485  // anti roll forth in SimGearboxMode::AUTO (REAR) mode
1486  float g = std::abs(App::GetGameContext()->GetTerrain()->getGravity());
1487  float downhill_force = std::abs(sin(pitchAngle.valueRadians()) * vehicle->getTotalMass()) * g;
1488  float engine_force = std::abs(engine->getTorque()) / vehicle->getAvgPropedWheelRadius();
1489  float ratio = std::max(0.0f, 1.0f - (engine_force / downhill_force));
1490  if (vehicle->ar_avg_wheel_speed * pitchAngle.valueDegrees() > 0.0f)
1491  {
1492  ratio *= sqrt((0.02f - vehicle->ar_avg_wheel_speed) / 0.02f);
1493  }
1494  vehicle->ar_brake = sqrt(ratio);
1495  }
1496  }
1497  else if (vehicle->ar_brake == 0.0f && !vehicle->ar_parking_brake && engine->getTorque() == 0.0f)
1498  {
1499  float ratio = std::max(0.0f, 0.2f - std::abs(vehicle->ar_avg_wheel_speed)) / 0.2f;
1500  vehicle->ar_brake = ratio;
1501  }
1502  }
1503 
1504  if (vehicle->cc_mode)
1505  {
1506  vehicle->UpdateCruiseControl(dt);
1507  }
1508  if (vehicle->sl_enabled)
1509  {
1510  // check speed limit
1511  if (engine && engine->getGear() != 0)
1512  {
1513  float accl = (vehicle->sl_speed_limit - std::abs(vehicle->ar_wheel_speed / 1.02f)) * 2.0f;
1514  engine->setAcc(Ogre::Math::Clamp(accl, 0.0f, engine->getAcc()));
1515  }
1516  }
1517 
1518  BITMASK_SET(vehicle->m_lightmask, RoRnet::LIGHTMASK_BRAKES, (vehicle->ar_brake > 0.01f && !vehicle->ar_parking_brake));
1519  BITMASK_SET(vehicle->m_lightmask, RoRnet::LIGHTMASK_REVERSE, (vehicle->ar_engine && vehicle->ar_engine->getGear() < 0));
1520 }
1521 
1523 {
1524  for (FreeForce& freeforce: m_free_forces)
1525  {
1526  // Sanity checks
1527  ROR_ASSERT(freeforce.ffc_base_actor != nullptr);
1528  ROR_ASSERT(freeforce.ffc_base_actor->ar_state != ActorState::DISPOSED);
1529  ROR_ASSERT(freeforce.ffc_base_node != NODENUM_INVALID);
1530  ROR_ASSERT(freeforce.ffc_base_node <= freeforce.ffc_base_actor->ar_num_nodes);
1531 
1532 
1533  switch (freeforce.ffc_type)
1534  {
1536  freeforce.ffc_base_actor->ar_nodes[freeforce.ffc_base_node].Forces += freeforce.ffc_force_magnitude * freeforce.ffc_force_const_direction;
1537  break;
1538 
1540  {
1541  const Vector3 force_direction = (freeforce.ffc_target_coords - freeforce.ffc_base_actor->ar_nodes[freeforce.ffc_base_node].AbsPosition).normalisedCopy();
1542  freeforce.ffc_base_actor->ar_nodes[freeforce.ffc_base_node].Forces += freeforce.ffc_force_magnitude * force_direction;
1543  }
1544  break;
1545 
1547  {
1548  // Sanity checks
1549  ROR_ASSERT(freeforce.ffc_target_actor != nullptr);
1550  ROR_ASSERT(freeforce.ffc_target_actor->ar_state != ActorState::DISPOSED);
1551  ROR_ASSERT(freeforce.ffc_target_node != NODENUM_INVALID);
1552  ROR_ASSERT(freeforce.ffc_target_node <= freeforce.ffc_target_actor->ar_num_nodes);
1553 
1554  const Vector3 force_direction = (freeforce.ffc_target_actor->ar_nodes[freeforce.ffc_target_node].AbsPosition - freeforce.ffc_base_actor->ar_nodes[freeforce.ffc_base_node].AbsPosition).normalisedCopy();
1555  freeforce.ffc_base_actor->ar_nodes[freeforce.ffc_base_node].Forces += freeforce.ffc_force_magnitude * force_direction;
1556  }
1557  break;
1558 
1561  {
1562  // Sanity checks
1563  ROR_ASSERT(freeforce.ffc_target_actor != nullptr);
1564  ROR_ASSERT(freeforce.ffc_target_actor->ar_state != ActorState::DISPOSED);
1565  ROR_ASSERT(freeforce.ffc_target_node != NODENUM_INVALID);
1566  ROR_ASSERT(freeforce.ffc_target_node <= freeforce.ffc_target_actor->ar_num_nodes);
1567 
1568  // ---- BEGIN COPYPASTE of `Actor::CalcBeamsInterActor()` ----
1569 
1570  // Calculate beam length
1571  node_t* p1 = &freeforce.ffc_base_actor->ar_nodes[freeforce.ffc_base_node];
1572  node_t* p2 = &freeforce.ffc_target_actor->ar_nodes[freeforce.ffc_target_node];
1573  const Vector3 dis = p1->AbsPosition - p2->AbsPosition;
1574 
1575  Real dislen = dis.squaredLength();
1576  const Real inverted_dislen = fast_invSqrt(dislen);
1577 
1578  dislen *= inverted_dislen;
1579 
1580  // Calculate beam's deviation from normal
1581  Real difftoBeamL = dislen - freeforce.ffc_halfb_L;
1582 
1583  Real k = freeforce.ffc_halfb_spring;
1584  Real d = freeforce.ffc_halfb_damp;
1585 
1586  if (freeforce.ffc_type == FreeForceType::HALFBEAM_ROPE && difftoBeamL < 0.0f)
1587  {
1588  k = 0.0f;
1589  d *= 0.1f;
1590  }
1591 
1592  // Calculate beam's rate of change
1593  Vector3 v = p1->Velocity - p2->Velocity;
1594 
1595  float slen = -k * (difftoBeamL)-d * v.dotProduct(dis) * inverted_dislen;
1596  freeforce.ffc_halfb_stress = slen;
1597 
1598  // Fast test for deformation
1599  float len = std::abs(slen);
1600  if (len > freeforce.ffc_halfb_minmaxposnegstress)
1601  {
1602  if (k != 0.0f)
1603  {
1604  // Actual deformation tests
1605  if (slen > freeforce.ffc_halfb_maxposstress && difftoBeamL < 0.0f) // compression
1606  {
1607  Real yield_length = freeforce.ffc_halfb_maxposstress / k;
1608  Real deform = difftoBeamL + yield_length * (1.0f - freeforce.ffc_halfb_plastic_coef);
1609  Real Lold = freeforce.ffc_halfb_L;
1610  freeforce.ffc_halfb_L += deform;
1611  freeforce.ffc_halfb_L = std::max(MIN_BEAM_LENGTH, freeforce.ffc_halfb_L);
1612  slen = slen - (slen - freeforce.ffc_halfb_maxposstress) * 0.5f;
1613  len = slen;
1614  if (freeforce.ffc_halfb_L > 0.0f && Lold > freeforce.ffc_halfb_L)
1615  {
1616  freeforce.ffc_halfb_maxposstress *= Lold / freeforce.ffc_halfb_L;
1617  freeforce.ffc_halfb_minmaxposnegstress = std::min(freeforce.ffc_halfb_maxposstress, -freeforce.ffc_halfb_maxnegstress);
1618  freeforce.ffc_halfb_minmaxposnegstress = std::min(freeforce.ffc_halfb_minmaxposnegstress, freeforce.ffc_halfb_strength);
1619  }
1620  // For the compression case we do not remove any of the beam's
1621  // strength for structure stability reasons
1622  //freeforce.ffc_halfb_strength += deform * k * 0.5f;
1623 
1625  fmt::format("{}", slen), fmt::format("{}", freeforce.ffc_halfb_maxposstress));
1626  }
1627  else if (slen < freeforce.ffc_halfb_maxnegstress && difftoBeamL > 0.0f) // expansion
1628  {
1629  Real yield_length = freeforce.ffc_halfb_maxnegstress / k;
1630  Real deform = difftoBeamL + yield_length * (1.0f - freeforce.ffc_halfb_plastic_coef);
1631  Real Lold = freeforce.ffc_halfb_L;
1632  freeforce.ffc_halfb_L += deform;
1633  slen = slen - (slen - freeforce.ffc_halfb_maxnegstress) * 0.5f;
1634  len = -slen;
1635  if (Lold > 0.0f && freeforce.ffc_halfb_L > Lold)
1636  {
1637  freeforce.ffc_halfb_maxnegstress *= freeforce.ffc_halfb_L / Lold;
1638  freeforce.ffc_halfb_minmaxposnegstress = std::min(freeforce.ffc_halfb_maxposstress, -freeforce.ffc_halfb_maxnegstress);
1639  freeforce.ffc_halfb_minmaxposnegstress = std::min(freeforce.ffc_halfb_minmaxposnegstress, freeforce.ffc_halfb_strength);
1640  }
1641  freeforce.ffc_halfb_strength -= deform * k;
1642 
1644  fmt::format("{}", slen), fmt::format("{}", freeforce.ffc_halfb_maxnegstress));
1645  }
1646  }
1647 
1648  // Test if the beam should break
1649  if (len > freeforce.ffc_halfb_strength)
1650  {
1651  // Sound effect.
1652  // Sound volume depends on springs stored energy
1653  SOUND_MODULATE(freeforce.ffc_base_actor->ar_instance_id, SS_MOD_BREAK, 0.5 * k * difftoBeamL * difftoBeamL);
1654  SOUND_PLAY_ONCE(freeforce.ffc_base_actor->ar_instance_id, SS_TRIG_BREAK);
1655 
1656  freeforce.ffc_type = FreeForceType::DUMMY;
1657 
1659  fmt::format("{}", len), fmt::format("{}", freeforce.ffc_halfb_strength));
1660  }
1661  }
1662 
1663  // At last update the beam forces
1664  Vector3 f = dis;
1665  f *= (slen * inverted_dislen);
1666  p1->Forces += f;
1667  // ---- END COPYPASTE of `Actor::CalcBeamsInterActor()` ----
1668  }
1669  break;
1670 
1671  default:
1672  break;
1673  }
1674  }
1675 }
1676 
1677 static bool ProcessFreeForce(FreeForceRequest* rq, FreeForce& freeforce)
1678 {
1679  // internal helper for processing add/modify requests, with checks
1680  // ---------------------------------------------------------------
1681 
1682  // Unchecked stuff
1683  freeforce.ffc_id = (FreeForceID_t)rq->ffr_id;
1684  freeforce.ffc_type = (FreeForceType)rq->ffr_type;
1685  freeforce.ffc_force_magnitude = (float)rq->ffr_force_magnitude;
1687  freeforce.ffc_target_coords = rq->ffr_target_coords;
1688 
1689  // Base actor
1691  ROR_ASSERT(freeforce.ffc_base_actor != nullptr && freeforce.ffc_base_actor->ar_state != ActorState::DISPOSED);
1692  if (!freeforce.ffc_base_actor || freeforce.ffc_base_actor->ar_state == ActorState::DISPOSED)
1693  {
1695  fmt::format("Cannot add free force with ID {} to actor {}: Base actor not found or disposed", freeforce.ffc_id, rq->ffr_base_actor));
1696  return false;
1697  }
1698 
1699  // Base node
1700  ROR_ASSERT(rq->ffr_base_node >= 0);
1703  if (rq->ffr_base_node < 0 || rq->ffr_base_node >= NODENUM_MAX || rq->ffr_base_node >= freeforce.ffc_base_actor->ar_num_nodes)
1704  {
1706  fmt::format("Cannot add free force with ID {} to actor {}: Invalid base node number {}", freeforce.ffc_id, rq->ffr_base_actor, rq->ffr_base_node));
1707  return false;
1708  }
1709  freeforce.ffc_base_node = (NodeNum_t)rq->ffr_base_node;
1710 
1711  if (freeforce.ffc_type == FreeForceType::TOWARDS_NODE ||
1714  {
1715  // Target actor
1717  ROR_ASSERT(freeforce.ffc_target_actor != nullptr && freeforce.ffc_target_actor->ar_state != ActorState::DISPOSED);
1718  if (!freeforce.ffc_target_actor || freeforce.ffc_target_actor->ar_state == ActorState::DISPOSED)
1719  {
1721  fmt::format("Cannot add free force of type 'TOWARDS_NODE' with ID {} to actor {}: Target actor not found or disposed", freeforce.ffc_id, rq->ffr_target_actor));
1722  return false;
1723  }
1724 
1725  // Target node
1726  ROR_ASSERT(rq->ffr_target_node >= 0);
1729  if (rq->ffr_target_node < 0 || rq->ffr_target_node >= NODENUM_MAX || rq->ffr_target_node >= freeforce.ffc_target_actor->ar_num_nodes)
1730  {
1732  fmt::format("Cannot add free force of type 'TOWARDS_NODE' with ID {} to actor {}: Invalid target node number {}", freeforce.ffc_id, rq->ffr_target_actor, rq->ffr_target_node));
1733  return false;
1734  }
1735  freeforce.ffc_target_node = (NodeNum_t)rq->ffr_target_node;
1736 
1737  if (freeforce.ffc_type == FreeForceType::HALFBEAM_GENERIC ||
1739  {
1740  freeforce.ffc_halfb_spring = (float)rq->ffr_halfb_spring;
1741  freeforce.ffc_halfb_damp = (float)rq->ffr_halfb_damp;
1742  freeforce.ffc_halfb_strength = (float)rq->ffr_halfb_strength;
1743  freeforce.ffc_halfb_deform = (float)rq->ffr_halfb_deform;
1744  freeforce.ffc_halfb_diameter = (float)rq->ffr_halfb_diameter;
1745  freeforce.ffc_halfb_plastic_coef = (float)rq->ffr_halfb_plastic_coef;
1746 
1747  freeforce.ffc_halfb_minmaxposnegstress = (float)rq->ffr_halfb_deform;
1748  freeforce.ffc_halfb_maxposstress = (float)rq->ffr_halfb_deform;
1749  freeforce.ffc_halfb_maxnegstress = -(float)rq->ffr_halfb_deform;
1750 
1751  // Calc length
1752  const Ogre::Vector3 base_pos = freeforce.ffc_base_actor->ar_nodes[freeforce.ffc_base_node].AbsPosition;
1753  const Ogre::Vector3 target_pos = freeforce.ffc_target_actor->ar_nodes[freeforce.ffc_target_node].AbsPosition;
1754  freeforce.ffc_halfb_L = target_pos.distance(base_pos);
1755  }
1756  }
1757 
1758  return true;
1759 }
1760 
1761 bool ActorManager::FindFreeForce(FreeForceID_t id, ActorManager::FreeForceVec_t::iterator& out_itor)
1762 {
1763  out_itor = std::find_if(m_free_forces.begin(), m_free_forces.end(), [id](FreeForce& item) { return id == item.ffc_id; });
1764  return out_itor != m_free_forces.end();
1765 }
1766 
1768 {
1769  // Make sure ID is unique
1770  ActorManager::FreeForceVec_t::iterator it;
1771  if (this->FindFreeForce(rq->ffr_id, it))
1772  {
1774  fmt::format("Cannot add free force with ID {}: ID already in use", rq->ffr_id));
1775  return;
1776  }
1777 
1778  FreeForce freeforce;
1779  if (ProcessFreeForce(rq, freeforce))
1780  {
1781  m_free_forces.push_back(freeforce);
1783  }
1784 }
1785 
1787 {
1788  ActorManager::FreeForceVec_t::iterator it;
1789  if (!this->FindFreeForce(rq->ffr_id, it))
1790  {
1792  fmt::format("Cannot modify free force with ID {}: ID not found", rq->ffr_id));
1793  return;
1794  }
1795 
1796  FreeForce& freeforce = *it;
1797  if (ProcessFreeForce(rq, freeforce))
1798  {
1799  *it = freeforce;
1801  }
1802 }
1803 
1805 {
1806  ActorManager::FreeForceVec_t::iterator it;
1807  if (!this->FindFreeForce(id, it))
1808  {
1810  fmt::format("Cannot remove free force with ID {}: ID not found", id));
1811  return;
1812  }
1813 
1814  m_free_forces.erase(it);
1816 }
ROR_ASSERT
#define ROR_ASSERT(_EXPR)
Definition: Application.h:40
GameContext.h
Game state manager and message-queue provider.
RoR::ScriptEngine::unloadScript
void unloadScript(ScriptUnitID_t unique_id)
Unloads a script.
Definition: ScriptEngine.cpp:1066
RoR::Actor::ar_avg_wheel_speed
float ar_avg_wheel_speed
Physics state; avg wheel speed in m/s.
Definition: Actor.h:426
MAX_COMMANDS
static const int MAX_COMMANDS
maximum number of commands per actor
Definition: SimConstants.h:28
RoR::GfxActor::SetDebugView
void SetDebugView(DebugViewType dv)
Definition: GfxActor.cpp:1577
RoR::Actor::resetPosition
void resetPosition(Ogre::Vector3 translation, bool setInitPosition)
Moves the actor to given world coords (pivot point is node 0).
Definition: Actor.cpp:1340
RoR::Actor::cc_mode
bool cc_mode
Cruise Control.
Definition: Actor.h:388
RoR::App::GetNetwork
Network * GetNetwork()
Definition: Application.cpp:300
RoRnet::ActorStreamRegister
< Must preserve mem. layout of RoRnet::StreamRegister
Definition: RoRnet.h:158
RoR::ActorManager::GetSimulationSpeed
float GetSimulationSpeed() const
Definition: ActorManager.h:93
RoR::ActorManager::CheckNetworkStreamsOk
int CheckNetworkStreamsOk(int sourceid)
Definition: ActorManager.cpp:528
RoR::EV_COMMON_REPLAY_FORWARD
@ EV_COMMON_REPLAY_FORWARD
Definition: InputEngine.h:254
RoR::Actor
Softbody object; can be anything from soda can to a space shuttle Constructed from a truck definition...
Definition: Actor.h:50
RoR::Actor::ar_vehicle_ai
VehicleAIPtr ar_vehicle_ai
Definition: Actor.h:421
RoR::ActorSpawnRequest::asr_net_color
int asr_net_color
Definition: SimData.h:846
RoR::ActorSpawnRequest::asr_free_position
bool asr_free_position
Disables the automatic spawn position adjustment.
Definition: SimData.h:850
RoRnet::MSG2_STREAM_UNREGISTER
@ MSG2_STREAM_UNREGISTER
remove stream
Definition: RoRnet.h:65
RoR::node_t::Velocity
Ogre::Vector3 Velocity
Definition: SimData.h:268
BITMASK_SET
void BITMASK_SET(BitMask_t &mask, BitMask_t flag, bool val)
Definition: BitFlags.h:19
RoR::Actor::m_section_config
Ogre::String m_section_config
Definition: Actor.h:582
RoR::ActorSpawnRequest::Origin::NETWORK
@ NETWORK
Remote controlled.
RoR::MSG_SIM_MODIFY_ACTOR_REQUESTED
@ MSG_SIM_MODIFY_ACTOR_REQUESTED
Payload = RoR::ActorModifyRequest* (owner)
Definition: Application.h:122
RoR::FreeForce::ffc_target_node
NodeNum_t ffc_target_node
Definition: SimData.h:766
RoR::EV_COMMON_TOGGLE_PHYSICS
@ EV_COMMON_TOGGLE_PHYSICS
toggle physics on/off
Definition: InputEngine.h:270
RoR::Actor::ar_physics_paused
bool ar_physics_paused
Actor physics individually paused by user.
Definition: Actor.h:491
RoRnet::ActorStreamRegister::time
int32_t time
initial time stamp
Definition: RoRnet.h:168
RoR::FreeForceRequest::ffr_target_node
int64_t ffr_target_node
Definition: SimData.h:797
RoR::GfxActor::UpdateSimDataBuffer
void UpdateSimDataBuffer()
Copies sim. data from Actor to GfxActor for later update.
Definition: GfxActor.cpp:1731
RoR::TRUCK
@ TRUCK
its a truck (or other land vehicle)
Definition: SimData.h:85
RoR::Actor::ar_filename
std::string ar_filename
Attribute; filled at spawn.
Definition: Actor.h:447
RoR::MpState::CONNECTED
@ CONNECTED
RoR::ActorManager::GetNetTimeOffset
int GetNetTimeOffset(int sourceid)
Definition: ActorManager.cpp:510
RoR::ActorManager::ACTORPTR_NULL
static const ActorPtr ACTORPTR_NULL
Definition: ActorManager.h:129
RoR::ActorSpawner::ConfigureSections
void ConfigureSections(Ogre::String const &sectionconfig, RigDef::DocumentPtr def)
Definition: ActorSpawner.cpp:90
RoR::TyrePressure::ModifyTyrePressure
bool ModifyTyrePressure(float v)
Definition: TyrePressure.cpp:64
RoR::FreeForce::ffc_halfb_plastic_coef
float ffc_halfb_plastic_coef
Definition: SimData.h:773
RigDef_Serializer.h
RoR::ActorSpawnRequest::Origin::CONFIG_FILE
@ CONFIG_FILE
'Preselected vehicle' in RoR.cfg or command line
RoR::ActorSpawnRequest::asr_origin
Origin asr_origin
Definition: SimData.h:843
RoR::ActorSpawner::ActorMemoryRequirements::num_fixes
size_t num_fixes
Definition: ActorSpawner.h:84
RoR::Actor::ar_vector_index
unsigned int ar_vector_index
Sim attr; actor element index in std::vector<m_actors>
Definition: Actor.h:401
RoR::node_t::AbsPosition
Ogre::Vector3 AbsPosition
absolute position in the world (shaky)
Definition: SimData.h:267
RoR::ActorManager::m_actors
ActorPtrVec m_actors
Use MSG_SIM_{SPAWN/DELETE}_ACTOR_REQUESTED
Definition: ActorManager.h:147
VehicleAI.h
Simple waypoint AI.
RoR::App::diag_actor_dump
CVar * diag_actor_dump
Definition: Application.cpp:158
RoR::Actor::ar_parking_brake
bool ar_parking_brake
Definition: Actor.h:438
RoR::Collisions
Definition: Collisions.h:80
RoRnet::UserInfo
Definition: RoRnet.h:178
RoR::ActorLinkingRequest
Estabilishing a physics linkage between 2 actors modifies a global linkage table and triggers immedia...
Definition: SimData.h:908
RoR::FreeForce::ffc_halfb_maxposstress
float ffc_halfb_maxposstress
Definition: SimData.h:778
DashBoardManager.h
RoR::Actor::ar_linked_actors
ActorPtrVec ar_linked_actors
BEWARE: Includes indirect links, see DetermineLinkedActors(); Other actors linked using 'hooks/ties/r...
Definition: Actor.h:489
RoR::Actor::ar_instance_id
ActorInstanceID_t ar_instance_id
Static attr; session-unique ID.
Definition: Actor.h:400
RoR::Actor::m_net_first_wheel_node
int m_net_first_wheel_node
Network attr; Determines data buffer layout; calculated on spawn.
Definition: Actor.h:645
RoR::Actor::ar_num_nodes
int ar_num_nodes
Definition: Actor.h:317
HandleErrorLoadingTruckfile
void HandleErrorLoadingTruckfile(std::string filename, std::string exception_msg)
Definition: ActorManager.cpp:1245
RoR::Actor::ar_bounding_box
Ogre::AxisAlignedBox ar_bounding_box
standard bounding box (surrounds all nodes of an actor)
Definition: Actor.h:342
RoR::FreeForce::ffc_halfb_maxnegstress
float ffc_halfb_maxnegstress
Definition: SimData.h:779
RigDef::Parser::GetFile
RigDef::DocumentPtr GetFile()
Definition: RigDef_Parser.h:77
RigDef::Parser::Finalize
void Finalize()
Definition: RigDef_Parser.cpp:2998
ContentManager.h
GUI_TopMenubar.h
RoR::FreeForceType::HALFBEAM_GENERIC
@ HALFBEAM_GENERIC
Like TOWARDS_NODE, but parametrized like a beam in truck fileformat.
RoR::App::gfx_skidmarks_mode
CVar * gfx_skidmarks_mode
Definition: Application.cpp:247
ThreadPool.h
RoR::NODENUM_INVALID
static const NodeNum_t NODENUM_INVALID
Definition: ForwardDeclarations.h:55
RoR::ActorState::LOCAL_REPLAY
@ LOCAL_REPLAY
RoR::GfxActor::UpdateRods
void UpdateRods()
Definition: GfxActor.cpp:1647
RoR::Collisions::defaultgm
ground_model_t * defaultgm
Definition: Collisions.h:174
format
Truck file format(technical spec)
RoR::ActorManager::AddFreeForce
void AddFreeForce(FreeForceRequest *rq)
Definition: ActorManager.cpp:1767
HandleErrorLoadingFile
void HandleErrorLoadingFile(std::string type, std::string filename, std::string exception_msg)
Definition: ActorManager.cpp:1237
RoR::collision_box_t::lo
Ogre::Vector3 lo
absolute collision box
Definition: SimData.h:686
RoR::ActorManager::inter_actor_links
std::map< beam_t *, std::pair< ActorPtr, ActorPtr > > inter_actor_links
Definition: ActorManager.h:126
RoR::Actor::sendStreamSetup
void sendStreamSetup()
Definition: Actor.cpp:1985
RoR::Engine::getAutoMode
SimGearboxMode getAutoMode()
Definition: Engine.cpp:842
RoR::FreeForceType::DUMMY
@ DUMMY
No force.
RoR::DebugViewType
DebugViewType
Definition: GfxData.h:101
fast_invSqrt
float fast_invSqrt(const float v)
Definition: ApproxMath.h:124
RoR::ActorState::DISPOSED
@ DISPOSED
removed from simulation, still in memory to satisfy pointers.
RoRnet::LIGHTMASK_REVERSE
@ LIGHTMASK_REVERSE
reverse light on
Definition: RoRnet.h:119
RoR::ActorManager::RemoveStreamSource
void RemoveStreamSource(int sourceid)
Definition: ActorManager.cpp:343
RoR::ActorLinkingRequest::alr_type
ActorLinkingRequestType alr_type
Definition: SimData.h:911
RoR::Actor::m_min_camera_radius
Ogre::Real m_min_camera_radius
Definition: Actor.h:595
RoR::CVar::getBool
bool getBool() const
Definition: CVar.h:98
RoR::TRIGGER_EVENT_ASYNC
void TRIGGER_EVENT_ASYNC(scriptEvents type, int arg1, int arg2ex=0, int arg3ex=0, int arg4ex=0, std::string arg5ex="", std::string arg6ex="", std::string arg7ex="", std::string arg8ex="")
Asynchronously (via MSG_SIM_SCRIPT_EVENT_TRIGGERED) invoke script function eventCallbackEx(),...
Definition: ScriptEngine.h:51
RoR::Actor::ar_brake
Ogre::Real ar_brake
Physics state; braking intensity.
Definition: Actor.h:423
RoR::Actor::sl_enabled
bool sl_enabled
Speed limiter;.
Definition: Actor.h:394
RoR::ActorManager::FindActorInsideBox
ActorPtr FindActorInsideBox(Collisions *collisions, const Ogre::String &inst, const Ogre::String &box)
Definition: ActorManager.cpp:816
RoR::Actor::ar_dry_mass
float ar_dry_mass
User-defined (editable via NBUtil); from 'globals' arg#1 - default for all nodes.
Definition: Actor.h:292
RoR::Replay::replayStepActor
void replayStepActor()
Definition: Replay.cpp:215
RigDef::Parser
Checks the rig-def file syntax and pulls data to File object.
Definition: RigDef_Parser.h:56
RoR::beam_t::strength
float strength
Definition: SimData.h:317
RoR::ActorManager::CheckActorCollAabbIntersect
bool CheckActorCollAabbIntersect(int a, int b)
Returns whether or not the bounding boxes of truck a and truck b intersect. Based on the truck collis...
Definition: ActorManager.cpp:579
RoR::Round
Ogre::Real Round(Ogre::Real value, unsigned short ndigits=0)
Definition: Utils.cpp:101
RoR::FreeForce::ffc_force_magnitude
float ffc_force_magnitude
Definition: SimData.h:759
RoR::LogFormat
void LogFormat(const char *format,...)
Improved logging utility. Uses fixed 2Kb buffer.
Definition: Application.cpp:440
DynamicCollisions.h
RoR::SplitBundleQualifiedFilename
void SplitBundleQualifiedFilename(const std::string &bundleQualifiedFilename, std::string &out_bundleName, std::string &out_filename)
Definition: Utils.cpp:239
RoRnet::StreamRegister::origin_sourceid
int32_t origin_sourceid
origin sourceid
Definition: RoRnet.h:152
RoR::App::sim_replay_length
CVar * sim_replay_length
Definition: Application.cpp:102
RoR::collision_box_t::hi
Ogre::Vector3 hi
absolute collision box
Definition: SimData.h:687
RoR::FREEFORCESACTIVITY_REMOVED
@ FREEFORCESACTIVITY_REMOVED
Definition: ScriptEvents.h:109
RoR::Actor::ar_toggle_ropes
bool ar_toggle_ropes
Sim state.
Definition: Actor.h:527
Console.h
RoR::Console::putMessage
void putMessage(MessageArea area, MessageType type, std::string const &msg, std::string icon="")
Definition: Console.cpp:103
RoR::Actor::ar_hooks
std::vector< hook_t > ar_hooks
Definition: Actor.h:338
RoR::FreeForce::ffc_halfb_minmaxposnegstress
float ffc_halfb_minmaxposnegstress
Definition: SimData.h:777
RoR::Actor::ar_trailer_parking_brake
bool ar_trailer_parking_brake
Definition: Actor.h:439
RoR::CacheEntry::resource_group
Ogre::String resource_group
Resource group of the loaded bundle. Empty if not loaded yet.
Definition: CacheSystem.h:89
RoR::ActorManager::GetActors
ActorPtrVec & GetActors()
Definition: ActorManager.h:121
MovableText.h
This creates a billboarding object that displays a text.
RoR::Actor::sl_speed_limit
float sl_speed_limit
Speed limiter;.
Definition: Actor.h:395
RoR::ActorSpawner::ConfigureAddonParts
void ConfigureAddonParts(TuneupDefPtr &tuneup_def)
Definition: ActorSpawner.cpp:109
RoR::ActorManager::GetActorByNetworkLinks
const ActorPtr & GetActorByNetworkLinks(int source_id, int stream_id)
Definition: ActorManager.cpp:566
RoR::SE_GENERIC_NEW_TRUCK
@ SE_GENERIC_NEW_TRUCK
triggered when the user spawns a new actor, the argument refers to the actor ID
Definition: ScriptEvents.h:47
RoR::ActorManager::FetchPreviousVehicleOnList
const ActorPtr & FetchPreviousVehicleOnList(ActorPtr player, ActorPtr prev_player)
Definition: ActorManager.cpp:984
RoR::GfxActor::UpdateCabMesh
void UpdateCabMesh()
Definition: GfxActor.cpp:1907
TuneupFileFormat.h
The vehicle tuning system; applies addonparts and user overrides to vehicles.
RoR::GfxActor::FinishFlexbodyTasks
void FinishFlexbodyTasks()
Definition: GfxActor.cpp:3186
RigDef::Serializer::GetOutput
std::string GetOutput() const
Definition: RigDef_Serializer.h:42
RoR::FreeForce::ffc_target_actor
ActorPtr ffc_target_actor
Definition: SimData.h:765
RoR::FreeForceType
FreeForceType
Definition: SimData.h:743
RoR::Actor::GetGfxActor
GfxActor * GetGfxActor()
Definition: Actor.h:281
RoR::ActorManager::GetNearestActor
std::pair< ActorPtr, float > GetNearestActor(Ogre::Vector3 position)
Definition: ActorManager.cpp:849
RoR::ActorManager::SyncWithSimThread
void SyncWithSimThread()
Definition: ActorManager.cpp:1231
RoR::ActorLinkingRequestType::ROPE_TOGGLE
@ ROPE_TOGGLE
RoR::ActorState::LOCAL_SIMULATED
@ LOCAL_SIMULATED
simulated (local) actor
Engine.h
Utils.h
RoR::ActorManager::AreActorsDirectlyLinked
bool AreActorsDirectlyLinked(const ActorPtr &a1, const ActorPtr &a2)
Definition: ActorManager.cpp:733
RoR::ActorSpawnRequest::asr_filename
std::string asr_filename
Can be in "Bundle-qualified" format, i.e. "mybundle.zip:myactor.truck".
Definition: SimData.h:835
RoR::node_t::RelPosition
Ogre::Vector3 RelPosition
relative to the local physics origin (one origin per actor) (shaky)
Definition: SimData.h:266
RigDef::Validator::Validate
bool Validate()
Definition: RigDef_Validator.cpp:56
RoR::Network::GetUserPeerOpts
bool GetUserPeerOpts(int uid, BitMask_t &result)
Definition: Network.cpp:731
RoR::FreeForceRequest::ffr_halfb_diameter
double ffr_halfb_diameter
Definition: SimData.h:803
Language.h
RoR::FreeForceRequest::ffr_base_actor
int64_t ffr_base_actor
Definition: SimData.h:791
RoR::ActorManager::m_stream_time_offsets
std::map< int, int > m_stream_time_offsets
Networking: A network time offset for each stream source.
Definition: ActorManager.h:143
RoR::FreeForce::ffc_halfb_spring
float ffc_halfb_spring
Definition: SimData.h:768
RefCountingObjectPtr< Actor >
ActorSpawner.h
Vehicle spawning logic.
RoR::Console::CONSOLE_SYSTEM_ERROR
@ CONSOLE_SYSTEM_ERROR
Definition: Console.h:52
RigDef::Parser::ProcessOgreStream
void ProcessOgreStream(Ogre::DataStream *stream, Ogre::String resource_group)
Definition: RigDef_Parser.cpp:3570
RoR::FreeForce::ffc_base_node
NodeNum_t ffc_base_node
Definition: SimData.h:761
GUIManager.h
RoR::Actor::ar_forward_commands
bool ar_forward_commands
Sim state.
Definition: Actor.h:525
RoR::NODENUM_MAX
static const NodeNum_t NODENUM_MAX
Definition: ForwardDeclarations.h:56
ActorManager.h
Actor.h
RoR::collision_box_t::center
Ogre::Vector3 center
center of rotation
Definition: SimData.h:688
RoR::App::GetScriptEngine
ScriptEngine * GetScriptEngine()
Definition: Application.cpp:295
RoR::App::mp_cyclethru_net_actors
CVar * mp_cyclethru_net_actors
Include remote actors when cycling through with CTRL + [ and CTRL + ].
Definition: Application.cpp:127
RoR::ActorSpawner
Processes a RigDef::Document (parsed from 'truck' file format) into a simulated gameplay object (Acto...
Definition: ActorSpawner.h:70
RoR::Console::CONSOLE_SYSTEM_NOTICE
@ CONSOLE_SYSTEM_NOTICE
Definition: Console.h:51
RoR::Actor::m_net_wheel_buf_size
size_t m_net_wheel_buf_size
For incoming/outgoing traffic; calculated on spawn.
Definition: Actor.h:641
RoR::ActorSpawnRequest
Definition: SimData.h:817
RoR::Actor::ar_wheel_speed
float ar_wheel_speed
Physics state; wheel speed in m/s.
Definition: Actor.h:424
RoR::ActorManager::SendAllActorsSleeping
void SendAllActorsSleeping()
Definition: ActorManager.cpp:804
RoR::SimGearboxMode::AUTO
@ AUTO
Automatic shift.
RoR::beam_t::initial_beam_strength
float initial_beam_strength
for reset
Definition: SimData.h:334
RoR::FreeForce::ffc_id
FreeForceID_t ffc_id
Definition: SimData.h:757
RoR::ActorManager::AddStreamMismatch
void AddStreamMismatch(int sourceid, int streamid)
Definition: ActorManager.h:87
RoR::GfxActor::FinishWheelUpdates
void FinishWheelUpdates()
Definition: GfxActor.cpp:1933
RoR::App::mp_state
CVar * mp_state
Definition: Application.cpp:115
RoR::FreeForceRequest::ffr_force_const_direction
Ogre::Vector3 ffr_force_const_direction
Definition: SimData.h:794
Replay.h
RoR::ActorModifyRequest::amr_actor
ActorInstanceID_t amr_actor
Definition: SimData.h:875
RoR::Actor::getReplay
Replay * getReplay()
Definition: Actor.cpp:4591
RoR::EV_COMMON_ACCELERATE_SIMULATION
@ EV_COMMON_ACCELERATE_SIMULATION
accelerate the simulation speed
Definition: InputEngine.h:222
RoR::GfxActor::UpdateProps
void UpdateProps(float dt, bool is_player_actor)
Definition: GfxActor.cpp:2258
RoR::FreeForce::ffc_type
FreeForceType ffc_type
Definition: SimData.h:758
RoR::Actor::m_disable_default_sounds
bool m_disable_default_sounds
Spawner context; TODO: remove.
Definition: Actor.h:671
RoR::ActorSpawnRequest::asr_config
Ogre::String asr_config
Definition: SimData.h:836
TOSTRING
#define TOSTRING(x)
Definition: Application.h:56
RoR::Actor::getAvgPropedWheelRadius
float getAvgPropedWheelRadius()
Definition: Actor.h:270
RoR::Actor::isPreloadedWithTerrain
bool isPreloadedWithTerrain() const
Definition: Actor.h:251
RoR::VehicleAI::isActive
bool isActive()
Returns the status of the AI.
Definition: VehicleAI.cpp:58
RoR::ActorManager::m_simulation_speed
float m_simulation_speed
slow motion < 1.0 < fast motion
Definition: ActorManager.h:152
RoR::ActorManager::m_stream_mismatches
std::map< int, std::set< int > > m_stream_mismatches
Networking: A set of streams without a corresponding actor in the actor-array for each stream source.
Definition: ActorManager.h:142
RoR::Engine::offStart
void offStart()
Quick start of vehicle engine.
Definition: Engine.cpp:1013
RoR::FreeForceType::TOWARDS_COORDS
@ TOWARDS_COORDS
Constant force directed towards ffc_target_coords
RoR::ActorInstanceID_t
int ActorInstanceID_t
Unique sequentially generated ID of an actor in session. Use ActorManager::GetActorById()
Definition: ForwardDeclarations.h:38
RoR::ActorManager::CalcFreeForces
void CalcFreeForces()
Apply FreeForces - intentionally as a separate pass over all actors.
Definition: ActorManager.cpp:1522
RoR::ActorManager::UpdateSleepingState
void UpdateSleepingState(ActorPtr player_actor, float dt)
Definition: ActorManager.cpp:747
RoR::SE_GENERIC_FREEFORCES_ACTIVITY
@ SE_GENERIC_FREEFORCES_ACTIVITY
Triggered on freeforce add/update/delete or breaking; args: #1 freeForcesActivityType,...
Definition: ScriptEvents.h:64
RoR::Actor::ar_beams
beam_t * ar_beams
Definition: Actor.h:320
RoR::ActorManager::PredictActorCollAabbIntersect
bool PredictActorCollAabbIntersect(int a, int b)
Returns whether or not the bounding boxes of truck a and truck b might intersect during the next fram...
Definition: ActorManager.cpp:608
RoR::ActorManager::m_simulation_paused
bool m_simulation_paused
Definition: ActorManager.h:155
RoRnet::MSG2_STREAM_DATA
@ MSG2_STREAM_DATA
stream data
Definition: RoRnet.h:66
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::ActorManager::m_dt_remainder
float m_dt_remainder
Keeps track of the rounding error in the time step calculation.
Definition: ActorManager.h:151
RoR::Actor::ar_load_mass
float ar_load_mass
User-defined (editable via NBUtil); from 'globals' arg#2 - only applies to nodes with 'l' flag.
Definition: Actor.h:294
RoR::Str< 200 >
RoR::FreeForceRequest::ffr_base_node
int64_t ffr_base_node
Definition: SimData.h:792
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::Collisions::getGroundModelByString
ground_model_t * getGroundModelByString(const Ogre::String name)
Definition: Collisions.cpp:365
RoR::ActorManager::RemoveFreeForce
void RemoveFreeForce(FreeForceID_t id)
Definition: ActorManager.cpp:1804
RoR::Actor::ar_engine
EnginePtr ar_engine
Definition: Actor.h:403
RigDef::Validator
Performs a formal validation of the file (missing required parts, conflicts of modules,...
Definition: RigDef_Validator.h:47
RoR::beam_t::d
float d
damping factor
Definition: SimData.h:312
RigDef_Validator.h
.truck format validator
RoR::ActorModifyRequest
Definition: SimData.h:857
RoR::FreeForce::ffc_force_const_direction
Ogre::Vector3 ffc_force_const_direction
Expected to be normalized; only effective with FreeForceType::CONSTANT
Definition: SimData.h:763
RoR::GfxScene::RegisterGfxActor
void RegisterGfxActor(RoR::GfxActor *gfx_actor)
Definition: GfxScene.cpp:289
CacheSystem.h
A database of user-installed content alias 'mods' (vehicles, terrains...)
RoR::Actor::ar_total_mass
float ar_total_mass
Calculated; total mass in Kg.
Definition: Actor.h:297
RigDef::Serializer::Serialize
void Serialize()
Definition: RigDef_Serializer.cpp:50
RoR::collision_box_t::relo
Ogre::Vector3 relo
relative collision box
Definition: SimData.h:694
RoR::ActorManager::m_sim_task
std::shared_ptr< Task > m_sim_task
Definition: ActorManager.h:162
RoR::ActorSpawner::ConfigureAssetPacks
void ConfigureAssetPacks(ActorPtr actor, RigDef::DocumentPtr def)
Definition: ActorSpawner.cpp:143
RoR::ActorManager::HandleActorStreamData
void HandleActorStreamData(std::vector< RoR::NetRecvPacket > packet)
Definition: ActorManager.cpp:360
RoR::Engine::setAcc
void setAcc(float val)
Definition: Engine.cpp:852
RoR::ACTORINSTANCEID_INVALID
static const ActorInstanceID_t ACTORINSTANCEID_INVALID
Definition: ForwardDeclarations.h:39
RoRnet::MSG2_STREAM_REGISTER
@ MSG2_STREAM_REGISTER
create new stream
Definition: RoRnet.h:63
RoR::ActorSpawnRequest::asr_cache_entry
CacheEntryPtr asr_cache_entry
Optional, overrides 'asr_filename' and 'asr_cache_entry_num'.
Definition: SimData.h:834
ScriptEngine.h
RoR::Actor::getTyrePressure
TyrePressure & getTyrePressure()
Definition: Actor.h:232
RoR::GameContext::PushMessage
void PushMessage(Message m)
Doesn't guarantee order! Use ChainMessage() if order matters.
Definition: GameContext.cpp:66
strnlen
#define strnlen(str, len)
Definition: InputEngine.cpp:400
RoR::ActorManager::GetLocalActors
std::vector< ActorPtr > GetLocalActors()
Definition: ActorManager.cpp:1360
RoR::ActorManager::m_sim_thread_pool
std::unique_ptr< ThreadPool > m_sim_thread_pool
Definition: ActorManager.h:161
RoR::Replay
Definition: Replay.h:39
RoR::ThreadPool
Facilitates execution of (small) tasks on separate threads.
Definition: ThreadPool.h:105
RoR::Actor::updateVisual
void updateVisual(float dt=0)
Definition: Actor.cpp:3259
ChatSystem.h
RoR::ActorSpawner::ProcessNewActor
void ProcessNewActor(ActorPtr actor, ActorSpawnRequest rq, RigDef::DocumentPtr def)
Definition: ActorSpawnerFlow.cpp:59
RoR::Actor::ar_origin
Ogre::Vector3 ar_origin
Physics state; base position for softbody nodes.
Definition: Actor.h:409
RoR::Str::ToCStr
const char * ToCStr() const
Definition: Str.h:46
RoR::ActorState::LOCAL_SLEEPING
@ LOCAL_SLEEPING
sleeping (local) actor
RoR::FreeForce::ffc_halfb_strength
float ffc_halfb_strength
Breaking threshold.
Definition: SimData.h:771
RoR::FreeForceID_t
int FreeForceID_t
Unique sequentially generated ID of FreeForce; use ActorManager::GetFreeForceNextId().
Definition: ForwardDeclarations.h:67
RoR::Actor::ar_command_key
CmdKeyArray ar_command_key
BEWARE: commandkeys are indexed 1-MAX_COMMANDS!
Definition: Actor.h:341
RoR::FreeForceType::CONSTANT
@ CONSTANT
Constant force given by direction and magnitude.
RoR::Terrain::GetCollisions
Collisions * GetCollisions()
Definition: Terrain.h:85
RoR::CacheEntry::actor_def
RigDef::DocumentPtr actor_def
Cached actor definition (aka truckfile) after first spawn.
Definition: CacheSystem.h:91
RoR::Actor::getPosition
Ogre::Vector3 getPosition()
Definition: Actor.cpp:371
RoR::FreeForceRequest::ffr_halfb_deform
double ffr_halfb_deform
Definition: SimData.h:801
RoR::FreeForceRequest::ffr_target_coords
Ogre::Vector3 ffr_target_coords
Definition: SimData.h:795
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:284
RoR::Actor::NotifyActorCameraChanged
void NotifyActorCameraChanged()
Logic: sound, display; Notify this vehicle that camera changed;.
Definition: Actor.cpp:3866
RoR::Actor::ForceFeedbackStep
void ForceFeedbackStep(int steps)
Definition: Actor.cpp:1826
RoR::Actor::WriteDiagnosticDump
void WriteDiagnosticDump(std::string const &filename)
Definition: Actor.cpp:4654
RoR::EV_COMMON_REPLAY_FAST_FORWARD
@ EV_COMMON_REPLAY_FAST_FORWARD
Definition: InputEngine.h:253
RoR::ActorLinkingRequest::alr_rope_group
int alr_rope_group
Definition: SimData.h:918
RoR::Actor::ar_import_commands
bool ar_import_commands
Sim state.
Definition: Actor.h:526
RoR::Actor::ar_minimass
std::vector< float > ar_minimass
minimum node mass in Kg - can be scaled in-game via NBUtil
Definition: Actor.h:309
FindPivotActorId
int FindPivotActorId(ActorPtr player, ActorPtr prev_player)
Definition: ActorManager.cpp:934
RigDef::Validator::Setup
void Setup(RigDef::DocumentPtr file)
Prepares the validation.
Definition: RigDef_Validator.cpp:85
RoR::ActorManager::UpdateNetTimeOffset
void UpdateNetTimeOffset(int sourceid, int offset)
Definition: ActorManager.cpp:520
RoR::ActorManager::m_physics_steps
int m_physics_steps
Definition: ActorManager.h:150
Application.h
Central state/object manager and communications hub.
RoR::Actor::m_net_propanimkey_buf_size
size_t m_net_propanimkey_buf_size
For incoming/outgoing traffic; calculated on spawn.
Definition: Actor.h:642
RoR::App::GetConsole
Console * GetConsole()
Definition: Application.cpp:286
RoR::FreeForce::ffc_base_actor
ActorPtr ffc_base_actor
Definition: SimData.h:760
RoR::Actor::m_net_color_num
int m_net_color_num
Definition: Actor.h:648
RigDef::Parser::Prepare
void Prepare()
Definition: RigDef_Parser.cpp:2867
RoRnet::MSG2_STREAM_REGISTER_RESULT
@ MSG2_STREAM_REGISTER_RESULT
result of a stream creation
Definition: RoRnet.h:64
SoundScriptManager.h
RoR::node_t
Physics: A vertex in the softbody structure.
Definition: SimData.h:259
RoR::FreeForce::ffc_halfb_damp
float ffc_halfb_damp
Definition: SimData.h:769
RoR::Actor::ar_initial_beam_defaults
std::vector< std::pair< float, float > > ar_initial_beam_defaults
Definition: Actor.h:322
RoR::App::GetGameContext
GameContext * GetGameContext()
Definition: Application.cpp:296
RoR::Actor::UpdateCruiseControl
void UpdateCruiseControl(float dt)
Defined in 'gameplay/CruiseControl.cpp'.
Definition: CruiseControl.cpp:48
RoR::ActorManager::FetchRescueVehicle
const ActorPtr & FetchRescueVehicle()
Definition: ActorManager.cpp:1011
RoR::Actor::m_lightmask
BitMask_t m_lightmask
RoRnet::Lightmask.
Definition: Actor.h:654
RoR::FreeForceRequest::ffr_force_magnitude
double ffr_force_magnitude
Definition: SimData.h:790
RoR::FreeForce::ffc_halfb_L
float ffc_halfb_L
Length at rest, including permanent deformations.
Definition: SimData.h:775
RigDef::Validator::SetCheckBeams
void SetCheckBeams(bool check_beams)
Definition: RigDef_Validator.h:77
RoR::FreeForce
Global force affecting particular (base) node of particular (base) actor; added ad-hoc by scripts.
Definition: SimData.h:754
RoR::ActorManager::m_total_sim_time
float m_total_sim_time
Definition: ActorManager.h:156
RoR::Actor::m_prop_anim_key_states
std::vector< PropAnimKeyState > m_prop_anim_key_states
Definition: Actor.h:636
RoR::Actor::ar_initial_total_mass
float ar_initial_total_mass
Calculated; total mass in Kg (snapshot at spawn)
Definition: Actor.h:298
RoR::Actor::ar_sleep_counter
float ar_sleep_counter
Sim state; idle time counter.
Definition: Actor.h:436
RoR::Actor::m_spawn_rotation
float m_spawn_rotation
Definition: Actor.h:603
RoR::Actor::getDirection
Ogre::Vector3 getDirection()
average actor velocity, calculated using the actor positions of the last two frames
Definition: Actor.cpp:366
RoR::ActorSpawnRequest::net_stream_id
int net_stream_id
Definition: SimData.h:849
RoR::ActorSpawnRequest::Origin::TERRN_DEF
@ TERRN_DEF
Preloaded with terrain.
RoR::ActorSpawnRequest::asr_skin_entry
CacheEntryPtr asr_skin_entry
Definition: SimData.h:840
RoRnet::LIGHTMASK_BRAKES
@ LIGHTMASK_BRAKES
brake lights on
Definition: RoRnet.h:118
RoR::ActorSpawnRequest::asr_net_username
std::string asr_net_username
Definition: SimData.h:845
RoR::ActorManager::m_simulation_time
float m_simulation_time
Amount of time the physics simulation is going to be advanced.
Definition: ActorManager.h:154
RoR::Actor::ar_num_beams
int ar_num_beams
Definition: Actor.h:321
RoR::ActorManager::SetSimulationSpeed
void SetSimulationSpeed(float speed)
Definition: ActorManager.h:92
RoR::Actor::m_preloaded_with_terrain
bool m_preloaded_with_terrain
Spawn context (TODO: remove!)
Definition: Actor.h:667
RigDef::Serializer
Serializes the RigDef::File data structure to string.
Definition: RigDef_Serializer.h:37
RoR::Actor::m_replay_handler
Replay * m_replay_handler
Definition: Actor.h:599
RoR::Actor::getTotalMass
float getTotalMass(bool withLocked=true)
Definition: Actor.cpp:832
RoR::tryConvertUTF
std::string tryConvertUTF(const char *buffer)
Definition: Utils.cpp:61
RoR::Actor::m_net_total_buffer_size
size_t m_net_total_buffer_size
For incoming/outgoing traffic; calculated on spawn.
Definition: Actor.h:643
ApproxMath.h
_LC
#define _LC(ctx, str)
Definition: Language.h:38
RoR::Actor::ar_original_load_mass
float ar_original_load_mass
Un-edited value from 'globals' arg#2.
Definition: Actor.h:295
RoR::ActorManager::m_last_simulation_speed
float m_last_simulation_speed
previously used time ratio between real time (evt.timeSinceLastFrame) and physics time ('dt' used in ...
Definition: ActorManager.h:153
RoR::Actor::ar_num_cinecams
int ar_num_cinecams
Sim attr;.
Definition: Actor.h:405
RoRnet::StreamRegister::status
int32_t status
initial stream status
Definition: RoRnet.h:151
RoR::ActorManager::ExportActorDef
void ExportActorDef(RigDef::DocumentPtr def, std::string filename, std::string rg_name)
Definition: ActorManager.cpp:1329
PointColDetector.h
RoR::ActorManager::RecursiveActivation
void RecursiveActivation(int j, std::vector< bool > &visited)
Definition: ActorManager.cpp:637
RoR::SanitizeUtf8CString
std::string SanitizeUtf8CString(const char *start, const char *end=nullptr)
Definition: Utils.cpp:128
RoRnet::StreamRegister::type
int32_t type
0 = Actor, 1 = Character, 3 = ChatSystem
Definition: RoRnet.h:150
RoR::FREEFORCESACTIVITY_BROKEN
@ FREEFORCESACTIVITY_BROKEN
Only with HALFBEAM_* types; arg #5 (string containing float) the applied force, arg #6 (string contai...
Definition: ScriptEvents.h:112
RoR::ActorManager::DeleteActorInternal
void DeleteActorInternal(ActorPtr actor)
Do not call directly; use GameContext::DeleteActor()
Definition: ActorManager.cpp:878
RigDef::Script
Definition: RigDef_File.h:1051
RoR::Actor::m_net_node_buf_size
size_t m_net_node_buf_size
For incoming/outgoing traffic; calculated on spawn.
Definition: Actor.h:640
SOUND_MODULATE
#define SOUND_MODULATE(_ACTOR_, _MOD_, _VALUE_)
Definition: SoundScriptManager.h:40
RoR::App::sim_realistic_commands
CVar * sim_realistic_commands
Definition: Application.cpp:104
RoR::Actor::ar_initial_node_positions
std::vector< Ogre::Vector3 > ar_initial_node_positions
Absolute world positions, for resetting to pristine state.
Definition: Actor.h:312
RoR::App::GetCacheSystem
CacheSystem * GetCacheSystem()
Definition: Application.cpp:288
RoR::Sha1Hash
std::string Sha1Hash(std::string const &data)
Definition: Utils.cpp:141
RoR::CacheSystem::FetchSkinByName
CacheEntryPtr FetchSkinByName(std::string const &skin_name)
Definition: CacheSystem.cpp:1673
ProcessFreeForce
static bool ProcessFreeForce(FreeForceRequest *rq, FreeForce &freeforce)
Definition: ActorManager.cpp:1677
RoR::SS_TRIG_BREAK
@ SS_TRIG_BREAK
Definition: SoundScriptManager.h:82
RoRnet::UserInfo::colournum
int32_t colournum
colour set by server
Definition: RoRnet.h:183
RigDef::Script::filename
std::string filename
Definition: RigDef_File.h:1053
RoRnet::StreamRegister::name
char name[128]
file name
Definition: RoRnet.h:154
RoR::Actor::ar_nodes
node_t * ar_nodes
Definition: Actor.h:302
RoR::FreeForceRequest::ffr_halfb_spring
double ffr_halfb_spring
Definition: SimData.h:799
RoR::FreeForceRequest
Common for ADD and MODIFY requests; tailored for use with AngelScript thru GameScript::pushMessage().
Definition: SimData.h:783
RoRnet::UserInfo::username
char username[RORNET_MAX_USERNAME_LEN]
the nickname of the user (UTF-8)
Definition: RoRnet.h:185
RoR::ActorLinkingRequest::alr_tie_group
int alr_tie_group
Definition: SimData.h:916
RoR::Actor::ar_toggle_ties
bool ar_toggle_ties
Sim state.
Definition: Actor.h:528
RoR::Actor::getRotation
float getRotation()
Definition: Actor.cpp:356
RoR::Actor::ar_orig_minimass
std::vector< float > ar_orig_minimass
minimum node mass in Kg - original unscaled values
Definition: Actor.h:310
RoR::node_t::nd_rim_node
bool nd_rim_node
Attr; This node is part of a rim (only wheel types with separate rim nodes)
Definition: SimData.h:283
RoR::FreeForce::ffc_halfb_diameter
float ffc_halfb_diameter
Definition: SimData.h:772
RoR::beam_t::k
float k
tensile spring
Definition: SimData.h:311
RoR::CacheSystem::LoadResource
void LoadResource(CacheEntryPtr &t)
Loads the associated resource bundle if not already done.
Definition: CacheSystem.cpp:1538
RoR::MSG_SIM_ACTOR_LINKING_REQUESTED
@ MSG_SIM_ACTOR_LINKING_REQUESTED
Payload = RoR::ActorLinkingRequest* (owner)
Definition: Application.h:132
RoR::Message
Unified game event system - all requests and state changes are reported using a message.
Definition: GameContext.h:51
RoR::Actor::ar_initial_node_masses
std::vector< float > ar_initial_node_masses
Definition: Actor.h:311
RoR::ActorManager::m_net_timer
Ogre::Timer m_net_timer
Definition: ActorManager.h:144
_L
#define _L
Definition: ErrorUtils.cpp:35
PHYSICS_DT
#define PHYSICS_DT
Definition: SimConstants.h:20
RoR::Console::putNetMessage
void putNetMessage(int user_id, MessageType type, const char *text)
Definition: Console.cpp:108
RoR::Actor::recalculateNodeMasses
void recalculateNodeMasses()
Definition: Actor.cpp:702
RoR::ActorManager::~ActorManager
~ActorManager()
Definition: ActorManager.cpp:77
SOUND_PLAY_ONCE
#define SOUND_PLAY_ONCE(_ACTOR_, _TRIG_)
Definition: SoundScriptManager.h:34
RoR::Actor::dispose
void dispose()
Effectively destroys the object but keeps it in memory to satisfy shared pointers.
Definition: Actor.cpp:89
RoR::ActorSpawnRequest::asr_debugview
int asr_debugview
Definition: SimData.h:844
RoR::FreeForceRequest::ffr_halfb_damp
double ffr_halfb_damp
Definition: SimData.h:800
RoR::ActorManager::UpdateInputEvents
void UpdateInputEvents(float dt)
Definition: ActorManager.cpp:1371
RoR::Actor::m_working_tuneup_def
TuneupDefPtr m_working_tuneup_def
Each actor gets unique instance, even if loaded from .tuneup file in modcache.
Definition: Actor.h:629
RoR::Engine::getAcc
float getAcc()
Definition: Engine.cpp:880
RoR::GfxActor::UpdateWingMeshes
void UpdateWingMeshes()
Definition: GfxActor.cpp:3359
RoR::beam_t::minmaxposnegstress
float minmaxposnegstress
Definition: SimData.h:314
RoR::FreeForceType::TOWARDS_NODE
@ TOWARDS_NODE
Constant force directed towards ffc_target_node
MIN_BEAM_LENGTH
static const float MIN_BEAM_LENGTH
minimum beam lenght is 10 centimeters
Definition: SimConstants.h:55
RoR::MSG_SIM_SPAWN_ACTOR_REQUESTED
@ MSG_SIM_SPAWN_ACTOR_REQUESTED
Payload = RoR::ActorSpawnRequest* (owner)
Definition: Application.h:121
RoR::Actor::ar_num_wheels
int ar_num_wheels
Definition: Actor.h:357
RoRnet::StreamRegister::origin_streamid
int32_t origin_streamid
origin streamid
Definition: RoRnet.h:153
RoR::App::GetInputEngine
InputEngine * GetInputEngine()
Definition: Application.cpp:287
RoR::ActorManager::ModifyFreeForce
void ModifyFreeForce(FreeForceRequest *rq)
Definition: ActorManager.cpp:1786
RoR::EraseIf
void EraseIf(std::vector< T, A > &c, Predicate pred)
Definition: Utils.h:75
RoR::Actor::m_avg_node_position
Ogre::Vector3 m_avg_node_position
average node position
Definition: Actor.h:594
RoR::ActorPtr
RefCountingObjectPtr< Actor > ActorPtr
Definition: ForwardDeclarations.h:228
RoR::ActorLinkingRequest::alr_actor_instance_id
ActorInstanceID_t alr_actor_instance_id
Definition: SimData.h:910
RoR::MSG_SIM_DELETE_ACTOR_REQUESTED
@ MSG_SIM_DELETE_ACTOR_REQUESTED
Payload = RoR::ActorPtr* (owner)
Definition: Application.h:123
RoR::LT_AllBeam
@ LT_AllBeam
Definition: Application.h:469
ShouldIncludeActorInList
bool ShouldIncludeActorInList(const ActorPtr &actor)
Definition: ActorManager.cpp:943
RoR::ScriptCategory::ACTOR
@ ACTOR
Defined in truck file under 'scripts', contains global variable BeamClass@ thisActor.
RoR::ActorSpawnRequest::net_source_id
int net_source_id
Definition: SimData.h:848
RoR::ActorManager::UpdateTruckFeatures
void UpdateTruckFeatures(ActorPtr vehicle, float dt)
Definition: ActorManager.cpp:1461
RoR::ActorManager::ForwardCommands
void ForwardCommands(ActorPtr source_actor)
Fowards things to trailers.
Definition: ActorManager.cpp:662
Terrain.h
RoR::Actor::ar_net_stream_id
int ar_net_stream_id
Definition: Actor.h:451
RoR::Collisions::isInside
bool isInside(Ogre::Vector3 pos, const Ogre::String &inst, const Ogre::String &box, float border=0)
Definition: Collisions.cpp:1202
RoR::Actor::ar_submesh_ground_model
ground_model_t * ar_submesh_ground_model
Definition: Actor.h:437
RoR::ActorState::NETWORKED_HIDDEN
@ NETWORKED_HIDDEN
not simulated, not updated (remote)
BitMask_t
uint32_t BitMask_t
Definition: BitFlags.h:7
RoR::ActorManager::FetchActorDef
RigDef::DocumentPtr FetchActorDef(RoR::ActorSpawnRequest &rq)
Definition: ActorManager.cpp:1250
RoR::FREEFORCESACTIVITY_DEFORMED
@ FREEFORCESACTIVITY_DEFORMED
Only with HALFBEAM_* types; arg #5 (string containing float) the actual stress, arg #6 (string contai...
Definition: ScriptEvents.h:111
InputEngine.h
Handles controller inputs from player. Defines input events and binding mechanism,...
Ogre
Definition: ExtinguishableFireAffector.cpp:35
RoR::Actor::m_wheel_node_count
int m_wheel_node_count
Static attr; filled at spawn.
Definition: Actor.h:616
RoR::ActorSpawner::SetupDefaultSoundSources
static void SetupDefaultSoundSources(ActorPtr const &actor)
Definition: ActorSpawner.cpp:6428
RoR::Console::CONSOLE_MSGTYPE_ACTOR
@ CONSOLE_MSGTYPE_ACTOR
Parsing/spawn/simulation messages for actors.
Definition: Console.h:63
RoR::ActorManager::RepairActor
void RepairActor(Collisions *collisions, const Ogre::String &inst, const Ogre::String &box, bool keepPosition=false)
Definition: ActorManager.cpp:835
RoR::Actor::ar_original_dry_mass
float ar_original_dry_mass
Un-edited value from 'globals' arg#1.
Definition: Actor.h:293
RoR::ActorSpawnRequest::asr_net_peeropts
BitMask_t asr_net_peeropts
RoRnet::PeerOptions to be applied after spawn.
Definition: SimData.h:847
RigDef::DocumentPtr
std::shared_ptr< Document > DocumentPtr
Definition: ForwardDeclarations.h:281
RoR::Console::CONSOLE_SYSTEM_WARNING
@ CONSOLE_SYSTEM_WARNING
Definition: Console.h:53
RoR::App::app_async_physics
CVar * app_async_physics
Definition: Application.cpp:83
RoR::ScriptUnitID_t
int ScriptUnitID_t
Unique sequentially generated ID of a loaded and running scriptin session. Use ScriptEngine::getScrip...
Definition: ForwardDeclarations.h:41
RoR::ScriptEngine::loadScript
ScriptUnitID_t loadScript(Ogre::String filename, ScriptCategory category=ScriptCategory::TERRAIN, ActorPtr associatedActor=nullptr, std::string buffer="")
Loads a script.
Definition: ScriptEngine.cpp:828
RoR::CVar::getInt
int getInt() const
Definition: CVar.h:97
RoR::Console::CONSOLE_MSGTYPE_INFO
@ CONSOLE_MSGTYPE_INFO
Generic message.
Definition: Console.h:60
RoR::Actor::calculateAveragePosition
void calculateAveragePosition()
Definition: Actor.cpp:1155
RoR::ActorManager::m_forced_awake
bool m_forced_awake
disables sleep counters
Definition: ActorManager.h:149
RoR::SS_MOD_BREAK
@ SS_MOD_BREAK
Definition: SoundScriptManager.h:136
RoR::FreeForceRequest::ffr_id
int64_t ffr_id
Definition: SimData.h:788
RoR::SS_TRIG_REPAIR
@ SS_TRIG_REPAIR
Definition: SoundScriptManager.h:67
RoR::ActorSpawnRequest::asr_position
Ogre::Vector3 asr_position
Definition: SimData.h:837
RoR::ActorManager::FindFreeForce
bool FindFreeForce(FreeForceID_t id, FreeForceVec_t::iterator &out_itor)
Definition: ActorManager.cpp:1761
RoR::ActorSpawner::GetSubmeshGroundmodelName
std::string GetSubmeshGroundmodelName()
Definition: ActorSpawner.cpp:1324
RoR::ActorManager::WakeUpAllActors
void WakeUpAllActors()
Definition: ActorManager.cpp:792
RoR::Engine::getAutoShift
int getAutoShift()
Definition: Engine.cpp:1181
RoR::FreeForce::ffc_halfb_deform
float ffc_halfb_deform
Definition: SimData.h:770
RoR::Actor::ar_net_source_id
int ar_net_source_id
Unique ID of remote player who spawned this actor.
Definition: Actor.h:450
Collisions.h
RoR::node_t::mass
Ogre::Real mass
Definition: SimData.h:271
RoR::EV_COMMON_RESET_SIMULATION_PACE
@ EV_COMMON_RESET_SIMULATION_PACE
reset the simulation speed
Definition: InputEngine.h:224
RoR::ActorState::NETWORKED_OK
@ NETWORKED_OK
not simulated (remote) actor
RoR::ThreadPool::Parallelize
void Parallelize(const std::vector< std::function< void()>> &task_funcs)
Run collection of tasks in parallel and wait until all have finished.
Definition: ThreadPool.h:193
RoR::App::GetThreadPool
ThreadPool * GetThreadPool()
Definition: Application.cpp:290
RoR::ActorManager::UpdateActors
void UpdateActors(ActorPtr player_actor)
Definition: ActorManager.cpp:1023
RoR::EV_COMMON_DECELERATE_SIMULATION
@ EV_COMMON_DECELERATE_SIMULATION
decelerate the simulation speed
Definition: InputEngine.h:223
RoR::NetRecvPacket
Definition: Network.h:93
RoR::ActorLinkingRequestType::TIE_TOGGLE
@ TIE_TOGGLE
RoR::Actor::ar_state
ActorState ar_state
Definition: Actor.h:488
RoR::GfxActor::UpdateFlexbodies
void UpdateFlexbodies()
Definition: GfxActor.cpp:3147
RoR::ActorManager::FetchNextVehicleOnList
const ActorPtr & FetchNextVehicleOnList(ActorPtr player, ActorPtr prev_player)
Definition: ActorManager.cpp:959
RoR::FreeForceRequest::ffr_halfb_strength
double ffr_halfb_strength
Definition: SimData.h:802
RoR::Actor::getLightStateMask
BitMask_t getLightStateMask() const
Definition: Actor.h:194
RoR::GfxActor::UpdateWheelVisuals
void UpdateWheelVisuals()
Definition: GfxActor.cpp:1915
RoR::AI
@ AI
machine controlled by an Artificial Intelligence
Definition: SimData.h:89
RoR::ActorSpawnRequest::asr_instance_id
ActorInstanceID_t asr_instance_id
Optional; see ActorManager::GetActorNextInstanceID();.
Definition: SimData.h:833
RoR::Engine::startEngine
void startEngine()
Quick engine start. Plays sounds.
Definition: Engine.cpp:995
RoR::ActorSpawner::GetMemoryRequirements
ActorMemoryRequirements const & GetMemoryRequirements()
Definition: ActorSpawner.h:107
RoR::FreeForce::ffc_target_coords
Ogre::Vector3 ffc_target_coords
Definition: SimData.h:764
RoR::TyrePressure::IsEnabled
bool IsEnabled() const
Definition: TyrePressure.h:47
RoR::FreeForceType::HALFBEAM_ROPE
@ HALFBEAM_ROPE
Like TOWARDS_NODE, but parametrized like a rope-beam in truck fileformat.
RoR::Engine::getGear
int getGear()
Definition: Engine.cpp:1038
RoR::Network::AddPacket
void AddPacket(int streamid, int type, int len, const char *content)
Definition: Network.cpp:608
RoR::ActorModifyRequest::amr_type
Type amr_type
Definition: SimData.h:876
RoR::ActorSpawnRequest::asr_spawnbox
collision_box_t * asr_spawnbox
Definition: SimData.h:839
RoR::ActorSpawnRequest::asr_rotation
Ogre::Quaternion asr_rotation
Definition: SimData.h:838
RoR::FreeForceRequest::ffr_type
int64_t ffr_type
Definition: SimData.h:789
RoR::Actor::m_net_username
std::string m_net_username
Definition: Actor.h:647
RoR::Actor::UpdateBoundingBoxes
void UpdateBoundingBoxes()
Definition: Actor.cpp:1190
RoR
Definition: AppContext.h:36
Network.h
RoR::ActorManager::GetActorById
const ActorPtr & GetActorById(ActorInstanceID_t actor_id)
Definition: ActorManager.cpp:1139
RoR::App::sim_spawn_running
CVar * sim_spawn_running
Definition: Application.cpp:100
RoR::ActorManager::m_free_forces
FreeForceVec_t m_free_forces
Global forces added ad-hoc by scripts.
Definition: ActorManager.h:157
RoR::beam_t::default_beam_deform
float default_beam_deform
for reset
Definition: SimData.h:335
RoR::ActorManager::CleanUpSimulation
void CleanUpSimulation()
Call this after simulation loop finishes.
Definition: ActorManager.cpp:865
RoR::App::GetGfxScene
GfxScene * GetGfxScene()
Definition: Application.cpp:292
RoR::GameContext::GetActorManager
ActorManager * GetActorManager()
Definition: GameContext.h:127
RoRnet::MSG2_USER_LEAVE
@ MSG2_USER_LEAVE
user leaves
Definition: RoRnet.h:58
RoR::Engine::getTorque
float getTorque()
Definition: Engine.cpp:913
RoR::ActorManager::CreateNewActor
ActorPtr CreateNewActor(ActorSpawnRequest rq, RigDef::DocumentPtr def)
Definition: ActorManager.cpp:82
RoR::Engine::NEUTRAL
@ NEUTRAL
Definition: Engine.h:170
RoR::FreeForceRequest::ffr_target_actor
int64_t ffr_target_actor
Definition: SimData.h:796
RoR::ActorManager::UpdatePhysicsSimulation
void UpdatePhysicsSimulation()
Definition: ActorManager.cpp:1151
RoR::App::sim_replay_enabled
CVar * sim_replay_enabled
Definition: Application.cpp:101
RoR::ActorManager::CheckNetRemoteStreamsOk
int CheckNetRemoteStreamsOk(int sourceid)
Definition: ActorManager.cpp:547
RoR::FREEFORCESACTIVITY_ADDED
@ FREEFORCESACTIVITY_ADDED
Definition: ScriptEvents.h:107
RoR::ActorModifyRequest::Type::RESET_ON_SPOT
@ RESET_ON_SPOT
RoR::App::mp_pseudo_collisions
CVar * mp_pseudo_collisions
Definition: Application.cpp:120
RoR::Actor::isBeingReset
bool isBeingReset() const
Definition: Actor.h:285
RoR::FreeForceRequest::ffr_halfb_plastic_coef
double ffr_halfb_plastic_coef
Definition: SimData.h:804
RoR::GameContext::GetTerrain
const TerrainPtr & GetTerrain()
Definition: GameContext.h:117
RoR::CacheEntry::fname
Ogre::String fname
filename
Definition: CacheSystem.h:67
RoR::Actor::calcNodeConnectivityGraph
void calcNodeConnectivityGraph()
Definition: Actor.cpp:896
RoR::node_t::Forces
Ogre::Vector3 Forces
Definition: SimData.h:269
RoRnet::StreamRegister
< Sent from the client to server and vice versa, to broadcast a new stream
Definition: RoRnet.h:148
RoR::FREEFORCESACTIVITY_MODIFIED
@ FREEFORCESACTIVITY_MODIFIED
Definition: ScriptEvents.h:108