Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
ActorSpawner.h
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
26
27
28#pragma once
29
30#include "Application.h"
31#include "RigDef_Parser.h"
32#include "RTTLayer.h"
33#include "SimData.h"
34#include "FlexFactory.h"
35#include "FlexObj.h"
36
37#include <OgreString.h>
38#include <string>
39
40namespace RoR {
41
44
72{
73 friend class RoR::FlexFactory; // Needs to use `ComposeName()` and `SetupNewEntity()`
74 friend class RoR::GfxActor; // Needs to use `ComposeName()`
75
76public:
77
79 {
80 size_t num_nodes = 0;
81 size_t num_beams = 0;
82 size_t num_shocks = 0;
83 size_t num_rotators = 0;
84 size_t num_wings = 0;
85 size_t num_airbrakes = 0;
86 size_t num_fixes = 0;
87 // ... more to come ...
88 };
89
90 enum struct Message
91 {
95 };
96
99 void ConfigureSections(Ogre::String const & sectionconfig, RigDef::DocumentPtr def);
100 void ConfigureAddonParts(ActorPtr actor);
101 void ConfigureAssetPacks(ActorPtr actor);
103 static void SetupDefaultSoundSources(ActorPtr const& actor);
105
110 std::string GetSubmeshGroundmodelName();
112
113private:
114
145
146 struct Exception: public std::runtime_error
147 {
148 Exception(Ogre::String const & message):runtime_error(message) {}
149 };
150
153 // PLEASE maintain alphabetical order
157 void ProcessAuthor(RigDef::Author & def);
158 void ProcessAxle(RigDef::Axle & def);
159 void ProcessBeam(RigDef::Beam & def);
160 void ProcessBrakes(RigDef::Brakes & def);
162 void ProcessCamera(RigDef::Camera & def);
167 void ProcessContacter(RigDef::Node::Ref & node_ref);
170 void ProcessDescription(Ogre::String const& line);
171 void ProcessEngine(RigDef::Engine & def);
176 void ProcessFixedNode(RigDef::Node::Ref node_ref); // 'fixes'
177 void ProcessFlare2(RigDef::Flare2 & def);
178 void ProcessFlare3(RigDef::Flare3 & def);
185 void ProcessHelp(RigDef::Help & def);
186 void ProcessHook(RigDef::Hook & def);
187 void ProcessHydro(RigDef::Hydro & def);
189 void ProcessLockgroup(RigDef::Lockgroup & lockgroup);
194 void ProcessNode(RigDef::Node & def);
197 void ProcessProp(RigDef::Prop & def);
200 void ProcessRope(RigDef::Rope & def);
204 void ProcessScript(RigDef::Script& def);
205 void ProcessShock(RigDef::Shock & def);
206 void ProcessShock2(RigDef::Shock2 & def);
207 void ProcessShock3(RigDef::Shock3 & def);
213 void ProcessTie(RigDef::Tie & def);
221 void ProcessWheel(RigDef::Wheel & def);
222 void ProcessWheel2(RigDef::Wheel2 & def);
223 void ProcessWing(RigDef::Wing & def);
225
228
229 void BuildAeroEngine(
230 NodeNum_t ref_node_index,
231 NodeNum_t back_node_index,
232 NodeNum_t blade_1_node_index,
233 NodeNum_t blade_2_node_index,
234 NodeNum_t blade_3_node_index,
235 NodeNum_t blade_4_node_index,
236 NodeNum_t couplenode_index,
237 bool is_turboprops,
238 Ogre::String const & airfoil,
239 float power,
240 float pitch);
241
243
245 RigDef::Inertia & inertia,
246 RigDef::Inertia & inertia_defaults,
247 RoR::CmdKeyInertia& contract_key,
248 RoR::CmdKeyInertia& extend_key);
249
251 void BuildWheelBeams(
252 unsigned int num_rays,
253 NodeNum_t base_node_index,
254 node_t *axis_node_1,
255 node_t *axis_node_2,
256 float tyre_spring,
257 float tyre_damping,
258 float rim_spring,
259 float rim_damping,
260 std::shared_ptr<RigDef::BeamDefaults> beam_defaults,
261 RigDef::Node::Ref const & rigidity_node_id,
262 float max_extension = 0.f);
263
265 unsigned int AddWheelBeam(
266 node_t *node_1,
267 node_t *node_2,
268 float spring,
269 float damping,
270 std::shared_ptr<RigDef::BeamDefaults> beam_defaults,
271 float max_contraction = -1.f,
272 float max_extension = -1.f,
273 BeamType type = BEAM_NORMAL);
274
279 WheelID_t wheel_id,
280 unsigned int num_rays,
281 node_t *axis_node_1,
282 node_t *axis_node_2,
283 node_t *reference_arm_node,
284 unsigned int reserve_nodes,
285 unsigned int reserve_beams,
286 float wheel_radius,
287 WheelPropulsion propulsion,
288 WheelBraking braking,
289 std::shared_ptr<RigDef::NodeDefaults> node_defaults,
290 float wheel_mass,
291 float wheel_width = -1.f);
292
295 void InitNode(node_t & node, Ogre::Vector3 const & position);
296 void InitNode(unsigned int node_index, Ogre::Vector3 const & position);
297 void InitNode(node_t & node, Ogre::Vector3 const & position, std::shared_ptr<RigDef::NodeDefaults> node_defaults);
298 beam_t& AddBeam(node_t & node_1, node_t & node_2, std::shared_ptr<RigDef::BeamDefaults> & defaults, int detacher_group);
299 unsigned int AddWheelRimBeam(RigDef::Wheel2 & wheel_2_def, node_t *node_1, node_t *node_2);
300 unsigned int AddTyreBeam(RigDef::Wheel2 & wheel_2_def, node_t *node_1, node_t *node_2);
301 unsigned int _SectionWheels2AddBeam(RigDef::Wheel2 & wheel_2_def, node_t *node_1, node_t *node_2);
302 void GetWheelAxisNodes(RigDef::BaseWheel& def, node_t*& out_node_1, node_t*& out_node_2);
303 void AddExhaust(NodeNum_t emitter_node_idx, NodeNum_t direction_node_idx);
304 RailGroup* CreateRail(std::vector<RigDef::Node::Range> & node_ranges);
305 void InitializeRig();
306 void FinalizeRig();
307 void AddBaseFlare(RigDef::FlareBase& flare_def);
309
312 void CalcMemoryRequirements(ActorMemoryRequirements& req, RigDef::Document::Module* module_def);
314 void WashCalculator();
315 void AdjustNodeBuoyancy(node_t & node, RigDef::Node & node_def, std::shared_ptr<RigDef::NodeDefaults> defaults);
316 void AdjustNodeBuoyancy(node_t & node, std::shared_ptr<RigDef::NodeDefaults> defaults);
317 void InitBeam(beam_t & beam, node_t *node_1, node_t *node_2);
318 void CalculateBeamLength(beam_t & beam);
319 void SetBeamStrength(beam_t & beam, float strength);
320 void SetBeamSpring(beam_t & beam, float spring);
321 void SetBeamDamping(beam_t & beam, float damping);
322 void SetBeamDeformationThreshold(beam_t & beam, std::shared_ptr<RigDef::BeamDefaults> beam_defaults);
323 void ValidateRotator(int id, int axis1, int axis2, NodeNum_t *nodes1, NodeNum_t *nodes2);
324
326 std::string ComposeName(const std::string& object, int number = -1);
327
331 bool AssignWheelToAxle(int & _out_axle_wheel, node_t *axis_node_1, node_t *axis_node_2);
332
333 // GetFree*(): Gets a free slot; checks limits, sets it's array position and updates 'free_node' index.
336 node_t& GetAndInitFreeNode(Ogre::Vector3 const & position);
337 beam_t& GetAndInitFreeBeam(node_t & node_1, node_t & node_2);
339
340 float ComputeWingArea(
341 Ogre::Vector3 const & ref,
342 Ogre::Vector3 const & x,
343 Ogre::Vector3 const & y,
344 Ogre::Vector3 const & aref);
345
349 std::vector<RigDef::Node::Range> & node_ranges,
350 std::vector<NodeNum_t> & out_node_indices);
352
355 NodeNum_t ResolveNodeRef(RigDef::Node::Ref const & node_ref, bool optional = false);
356 node_t* GetNodePointer(RigDef::Node::Ref const & node_ref);
358 beam_t& GetBeam(unsigned int index);
359 beam_t* FindBeamInRig(NodeNum_t node_a, NodeNum_t node_b);
362
365 bool CheckAxleLimit(unsigned int count);
366 bool CheckSubmeshLimit(unsigned int count);
367 bool CheckTexcoordLimit(unsigned int count);
368 bool CheckCabLimit(unsigned int count);
369 bool CheckCameraRailLimit(unsigned int count);
370 static bool CheckSoundScriptLimit(ActorPtr const& vehicle, unsigned int count);
371 bool CheckAeroEngineLimit(unsigned int count);
372 bool CheckScrewpropLimit(unsigned int count);
374
377 void CreateBeamVisuals(beam_t& beam, int beam_index, bool visible, std::shared_ptr<RigDef::BeamDefaults> const& beam_defaults, std::string material_override="");
378 void CreateWheelSkidmarks(WheelID_t wheel_index);
379 void FinalizeGfxSetup();
380 Ogre::MaterialPtr FindOrCreateCustomizedMaterial(const std::string& mat_lookup_name, const std::string& mat_lookup_rg);
381 Ogre::MaterialPtr CreateSimpleMaterial(Ogre::ColourValue color);
382 Ogre::ParticleSystem* CreateParticleSystem(std::string const & name, std::string const & template_name);
383 RigDef::MaterialFlareBinding* FindFlareBindingForMaterial(std::string const & material_name);
384 RigDef::VideoCamera* FindVideoCameraByMaterial(std::string const & material_name);
386 void CreateMirrorPropVideoCam(Ogre::MaterialPtr custom_mat, CustomMaterial::MirrorPropType type, Ogre::SceneNode* prop_scenenode);
387 void SetupNewEntity(Ogre::Entity* e, Ogre::ColourValue simple_color);
388 Ogre::MaterialPtr InstantiateManagedMaterial(Ogre::String const & rg_name, Ogre::String const & source_name, Ogre::String const & clone_name);
389 void CreateCabVisual();
390 void CreateMaterialFlare(int flare_index, Ogre::MaterialPtr mat);
391 std::string GetCurrentElementMediaRG();
392 void AssignManagedMaterialTexture(Ogre::TextureUnitState* tus, const std::string & mm_name, int media_id, const std::string& tex_name);
396
399 WheelID_t wheel_id,
400 NodeNum_t node_base_index,
401 unsigned int def_num_rays,
402 Ogre::String const& face_material_name,
403 Ogre::String const& face_material_rg,
404 Ogre::String const& band_material_name,
405 Ogre::String const& band_material_rg,
406 bool separate_rim,
407 float rim_ratio = 1.f
408 );
409
411 WheelID_t wheel_id,
412 NodeNum_t node_base_index,
413 NodeNum_t axis_node_1,
414 NodeNum_t axis_node_2,
415 int num_rays,
416 float radius,
417 WheelSide side,
418 std::string rim_mesh_name,
419 std::string rim_mesh_rg,
420 std::string tire_mesh_name,
421 std::string tire_mesh_rg);
422
424 WheelID_t wheel_id,
425 NodeNum_t base_node_index,
426 NodeNum_t axis_node_1_index,
427 NodeNum_t axis_node_2_index,
428 unsigned int num_rays,
429 WheelSide side,
430 Ogre::String mesh_name,
431 Ogre::String mesh_rg,
432 Ogre::String material_name,
433 Ogre::String material_rg,
434 float rim_radius);
436
439 static void AddSoundSource(ActorPtr const& vehicle, SoundScriptInstancePtr sound_script, NodeNum_t node_index, int type = -2);
440 static void AddSoundSourceInstance(ActorPtr const& vehicle, Ogre::String const & sound_script_name, int node_index, int type = -2);
442
445 void AddMessage(Message type, Ogre::String const & text);
447 void HandleException();
449
451 {
452 // Minimum node mass
454 };
455
460 std::list<std::shared_ptr<RigDef::Document::Module>>
462 Ogre::Vector3 m_spawn_position;
468
481 std::vector<CabTexcoord> m_oldstyle_cab_texcoords;
482 std::vector<CabSubmesh> m_oldstyle_cab_submeshes;
484 std::shared_ptr<RigDef::Document::Module> m_current_module;
485 std::map<Ogre::String, unsigned int> m_named_nodes;
487
491 std::map<std::string, CustomMaterial> m_material_substitutions;
492 std::map<std::string, Ogre::MaterialPtr> m_managed_materials;
494 Ogre::MaterialPtr m_cab_trans_material;
495 Ogre::MaterialPtr m_simple_material_base;
497 std::vector<RTTLayer*> m_texturedashboard_rtt_layers;
500 // Grouping nodes for diagnostics:
501 Ogre::SceneNode* m_actor_grouping_scenenode = nullptr;
502 Ogre::SceneNode* m_wheels_parent_scenenode = nullptr;
503 Ogre::SceneNode* m_props_parent_scenenode = nullptr;
504 Ogre::SceneNode* m_flexbodies_parent_scenenode = nullptr;
505 Ogre::SceneNode* m_flares_parent_scenenode = nullptr;
506 Ogre::SceneNode* m_particles_parent_scenenode = nullptr;
508};
509
511
512} // namespace RoR
Central state/object manager and communications hub.
Checks the rig-def file syntax and loads data to memory.
Core data structures for simulation; Everything affected by by either physics, network or user intera...
Abstract node ID (numbered or named) Node name is always available.
Definition RigDef_Node.h:45
Legacy parser resolved references on-the-fly and the condition to check named nodes was "are there an...
Definition RigDef_Node.h:78
Processes a RigDef::Document (parsed from 'truck' file format) into a simulated gameplay object (Acto...
void ProcessAntiLockBrakes(RigDef::AntiLockBrakes &def)
std::map< std::string, Ogre::MaterialPtr > m_managed_materials
void CreateMeshWheelVisuals(WheelID_t wheel_id, NodeNum_t base_node_index, NodeNum_t axis_node_1_index, NodeNum_t axis_node_2_index, unsigned int num_rays, WheelSide side, Ogre::String mesh_name, Ogre::String mesh_rg, Ogre::String material_name, Ogre::String material_rg, float rim_radius)
static void AddSoundSource(ActorPtr const &vehicle, SoundScriptInstancePtr sound_script, NodeNum_t node_index, int type=-2)
void ConfigureAssetPacks(ActorPtr actor)
void ConfigureAddonParts(ActorPtr actor)
static bool CheckSoundScriptLimit(ActorPtr const &vehicle, unsigned int count)
void InitBeam(beam_t &beam, node_t *node_1, node_t *node_2)
void ProcessFlare2(RigDef::Flare2 &def)
RigDef::MaterialFlareBinding * FindFlareBindingForMaterial(std::string const &material_name)
Returns NULL if none found.
unsigned int AddTyreBeam(RigDef::Wheel2 &wheel_2_def, node_t *node_1, node_t *node_2)
std::list< std::shared_ptr< RigDef::Document::Module > > m_selected_modules
void ProcessScrewprop(RigDef::Screwprop &def)
RTTLayer * m_renderdash_rtt_layer
The built-in 'renderdash' material.
bool CheckTexcoordLimit(unsigned int count)
bool AssignWheelToAxle(int &_out_axle_wheel, node_t *axis_node_1, node_t *axis_node_2)
Finds wheel with given axle nodes and returns it's index.
void ProcessFixedNode(RigDef::Node::Ref node_ref)
void CalculateBeamLength(beam_t &beam)
void SetBeamDeformationThreshold(beam_t &beam, std::shared_ptr< RigDef::BeamDefaults > beam_defaults)
void _ProcessKeyInertia(RigDef::Inertia &inertia, RigDef::Inertia &inertia_defaults, RoR::CmdKeyInertia &contract_key, RoR::CmdKeyInertia &extend_key)
void GetWheelAxisNodes(RigDef::BaseWheel &def, node_t *&out_node_1, node_t *&out_node_2)
void ProcessGlobals(RigDef::Globals &def)
std::vector< CabSubmesh > m_oldstyle_cab_submeshes
void ProcessHydro(RigDef::Hydro &def)
void ValidateRotator(int id, int axis1, int axis2, NodeNum_t *nodes1, NodeNum_t *nodes2)
CustomMaterial::MirrorPropType m_curr_mirror_prop_type
node_t & GetAndInitFreeNode(Ogre::Vector3 const &position)
void UpdateCollcabContacterNodes()
void ProcessRotator2(RigDef::Rotator2 &def)
void ProcessTractionControl(RigDef::TractionControl &def)
static void AddSoundSourceInstance(ActorPtr const &vehicle, Ogre::String const &sound_script_name, int node_index, int type=-2)
ActorPtr GetActor()
void InitNode(node_t &node, Ogre::Vector3 const &position)
void ProcessMeshWheel2(RigDef::MeshWheel2 &def)
void SetBeamSpring(beam_t &beam, float spring)
void ProcessMinimass(RigDef::Minimass &def)
void ProcessEngturbo(RigDef::Engturbo &def)
void CreateWheelSkidmarks(WheelID_t wheel_index)
void ProcessProp(RigDef::Prop &def)
Resource group override is used with addonparts.
bool m_generate_wing_position_lights
node_t * GetNodePointerOrThrow(RigDef::Node::Ref const &node_ref)
void ConfigureSections(Ogre::String const &sectionconfig, RigDef::DocumentPtr def)
void BuildAeroEngine(NodeNum_t ref_node_index, NodeNum_t back_node_index, NodeNum_t blade_1_node_index, NodeNum_t blade_2_node_index, NodeNum_t blade_3_node_index, NodeNum_t blade_4_node_index, NodeNum_t couplenode_index, bool is_turboprops, Ogre::String const &airfoil, float power, float pitch)
void ProcessWheelDetacher(RigDef::WheelDetacher &def)
node_t * GetNodePointer(RigDef::Node::Ref const &node_ref)
void ProcessSlidenode(RigDef::SlideNode &def)
void ProcessSoundSource2(RigDef::SoundSource2 &def)
void ProcessExtCamera(RigDef::ExtCamera &def)
void ProcessSoundSource(RigDef::SoundSource &def)
Ogre::ParticleSystem * CreateParticleSystem(std::string const &name, std::string const &template_name)
Ogre::MaterialPtr m_managedmat_placeholder_template
An 'error marker' material (bright magenta) to generate managedmaterial placeholders from.
void SetBeamDamping(beam_t &beam, float damping)
NodeNum_t RegisterNode(RigDef::Node::Id &id)
void ProcessBeam(RigDef::Beam &def)
void SetCurrentKeyword(RigDef::Keyword keyword)
void ProcessRope(RigDef::Rope &def)
void ProcessParticle(RigDef::Particle &def)
unsigned int _SectionWheels2AddBeam(RigDef::Wheel2 &wheel_2_def, node_t *node_1, node_t *node_2)
void ProcessFlare3(RigDef::Flare3 &def)
std::map< std::string, CustomMaterial > m_material_substitutions
Maps original material names (shared) to their actor-specific substitutes; There's 1 substitute per 1...
void ProcessCruiseControl(RigDef::CruiseControl &def)
void ProcessHook(RigDef::Hook &def)
NodeNum_t GetNodeIndexOrThrow(RigDef::Node::Ref const &id)
void ProcessTurbojet(RigDef::Turbojet &def)
void ProcessExhaust(RigDef::Exhaust &def)
void ProcessFlexbody(RigDef::Flexbody &def)
void ProcessRopable(RigDef::Ropable &def)
void ProcessNewActor(ActorPtr actor, ActorSpawnRequest rq, RigDef::DocumentPtr def)
void ProcessShock(RigDef::Shock &def)
unsigned int AddWheelBeam(node_t *node_1, node_t *node_2, float spring, float damping, std::shared_ptr< RigDef::BeamDefaults > beam_defaults, float max_contraction=-1.f, float max_extension=-1.f, BeamType type=BEAM_NORMAL)
'wheels', 'meshwheels', 'meshwheels2'
void CreateFlexBodyWheelVisuals(WheelID_t wheel_id, NodeNum_t node_base_index, NodeNum_t axis_node_1, NodeNum_t axis_node_2, int num_rays, float radius, WheelSide side, std::string rim_mesh_name, std::string rim_mesh_rg, std::string tire_mesh_name, std::string tire_mesh_rg)
void ProcessTurboprop2(RigDef::Turboprop2 &def)
void SetupNewEntity(Ogre::Entity *e, Ogre::ColourValue simple_color)
Full texture and material setup.
void ProcessAuthor(RigDef::Author &def)
Ogre::MaterialPtr FindOrCreateCustomizedMaterial(const std::string &mat_lookup_name, const std::string &mat_lookup_rg)
void ProcessAxle(RigDef::Axle &def)
void ProcessWheel(RigDef::Wheel &def)
void AdjustNodeBuoyancy(node_t &node, RigDef::Node &node_def, std::shared_ptr< RigDef::NodeDefaults > defaults)
For user-defined nodes.
Ogre::MaterialPtr m_simple_material_base
void ProcessGuiSettings(RigDef::GuiSettings &def)
std::string GetSubmeshGroundmodelName()
void ProcessTransferCase(RigDef::TransferCase &def)
Ogre::SceneNode * m_flares_parent_scenenode
this isn't used for moving/hiding things, just helps developers inspect the scene graph.
beam_t & GetBeam(unsigned int index)
beam_t * FindBeamInRig(NodeNum_t node_a, NodeNum_t node_b)
void SetBeamStrength(beam_t &beam, float strength)
std::map< Ogre::String, unsigned int > m_named_nodes
void CreateWheelVisuals(WheelID_t wheel_id, NodeNum_t node_base_index, unsigned int def_num_rays, Ogre::String const &face_material_name, Ogre::String const &face_material_rg, Ogre::String const &band_material_name, Ogre::String const &band_material_rg, bool separate_rim, float rim_ratio=1.f)
Ogre::MaterialPtr m_cab_trans_material
void AssignManagedMaterialTexture(Ogre::TextureUnitState *tus, const std::string &mm_name, int media_id, const std::string &tex_name)
Helper for ProcessManagedMaterial()
bool CheckCameraRailLimit(unsigned int count)
void ProcessWheel2(RigDef::Wheel2 &def)
bool CollectNodesFromRanges(std::vector< RigDef::Node::Range > &node_ranges, std::vector< NodeNum_t > &out_node_indices)
Parses list of node-ranges into list of individual nodes.
void ProcessScript(RigDef::Script &def)
unsigned int AddWheelRimBeam(RigDef::Wheel2 &wheel_2_def, node_t *node_1, node_t *node_2)
bool CheckScrewpropLimit(unsigned int count)
void CreateMirrorPropVideoCam(Ogre::MaterialPtr custom_mat, CustomMaterial::MirrorPropType type, Ogre::SceneNode *prop_scenenode)
void ProcessRailGroup(RigDef::RailGroup &def)
float ComputeWingArea(Ogre::Vector3 const &ref, Ogre::Vector3 const &x, Ogre::Vector3 const &y, Ogre::Vector3 const &aref)
Ogre::SceneNode * m_particles_parent_scenenode
this isn't used for moving/hiding things, just helps developers inspect the scene graph.
void ProcessContacter(RigDef::Node::Ref &node_ref)
void ProcessSpeedLimiter(RigDef::SpeedLimiter &def)
void ProcessEngine(RigDef::Engine &def)
ActorSpawnState m_state
void ProcessWing(RigDef::Wing &def)
bool CheckAxleLimit(unsigned int count)
std::shared_ptr< RigDef::Document::Module > m_current_module
For resolving addonparts.
RailGroup * CreateRail(std::vector< RigDef::Node::Range > &node_ranges)
void ProcessSubmesh(RigDef::Submesh &def)
void ProcessAnimator(RigDef::Animator &def)
void ProcessNode(RigDef::Node &def)
RigDef::DocumentPtr m_file
void ProcessCinecam(RigDef::Cinecam &def)
void ProcessFlaregroupNoImport(RigDef::FlaregroupNoImport &def)
void ProcessManagedMaterial(RigDef::ManagedMaterial &def)
void ProcessShock3(RigDef::Shock3 &def)
ActorMemoryRequirements const & GetMemoryRequirements()
void CreateBeamVisuals(beam_t &beam, int beam_index, bool visible, std::shared_ptr< RigDef::BeamDefaults > const &beam_defaults, std::string material_override="")
beam_t & GetAndInitFreeBeam(node_t &node_1, node_t &node_2)
void _ProcessSimpleInertia(RigDef::Inertia &def, RoR::SimpleInertia &obj)
void ProcessFusedrag(RigDef::Fusedrag &def)
void CreateMaterialFlare(int flare_index, Ogre::MaterialPtr mat)
void ProcessCommand(RigDef::Command2 &def)
std::string m_custom_resource_group
Ogre::SceneNode * m_wheels_parent_scenenode
this isn't used for moving/hiding things, just helps developers inspect the scene graph.
Ogre::SceneNode * m_props_parent_scenenode
this isn't used for moving/hiding things, just helps developers inspect the scene graph.
ActorMemoryRequirements m_memory_requirements
void ProcessCamera(RigDef::Camera &def)
bool CheckSubmeshLimit(unsigned int count)
beam_t & AddBeam(node_t &node_1, node_t &node_2, std::shared_ptr< RigDef::BeamDefaults > &defaults, int detacher_group)
void ProcessTie(RigDef::Tie &def)
void ProcessFlexBodyWheel(RigDef::FlexBodyWheel &def)
void ProcessPistonprop(RigDef::Pistonprop &def)
void ProcessInterAxle(RigDef::InterAxle &def)
void ProcessBrakes(RigDef::Brakes &def)
void CalcMemoryRequirements(ActorMemoryRequirements &req, RigDef::Document::Module *module_def)
void BuildWheelBeams(unsigned int num_rays, NodeNum_t base_node_index, node_t *axis_node_1, node_t *axis_node_2, float tyre_spring, float tyre_damping, float rim_spring, float rim_damping, std::shared_ptr< RigDef::BeamDefaults > beam_defaults, RigDef::Node::Ref const &rigidity_node_id, float max_extension=0.f)
'wheels', 'meshwheels'
void CreateVideoCamera(RigDef::VideoCamera *def)
void ProcessMeshWheel(RigDef::MeshWheel &def)
void ProcessCustomDashInputs(RigDef::CustomDashboardInput &def)
void ProcessLockgroup(RigDef::Lockgroup &lockgroup)
RoR::FlexFactory m_flex_factory
void ProcessHelp(RigDef::Help &def)
std::string ComposeName(const std::string &object, int number=-1)
Creates name containing actor ID token, i.e. "Object#1 (filename.truck [Instance ID 1])".
void ProcessAirbrake(RigDef::Airbrake &def)
void ProcessRotator(RigDef::Rotator &def)
std::vector< CabTexcoord > m_oldstyle_cab_texcoords
static void SetupDefaultSoundSources(ActorPtr const &actor)
Ogre::MaterialPtr CreateSimpleMaterial(Ogre::ColourValue color)
bool CheckCabLimit(unsigned int count)
void AddBaseFlare(RigDef::FlareBase &flare_def)
void ProcessShock2(RigDef::Shock2 &def)
Ogre::Vector3 m_spawn_position
RigDef::VideoCamera * FindVideoCameraByMaterial(std::string const &material_name)
Returns NULL if none found.
Ogre::SceneNode * m_flexbodies_parent_scenenode
this isn't used for moving/hiding things, just helps developers inspect the scene graph.
std::string m_cab_material_name
Original name defined in truckfile/globals.
Ogre::MaterialPtr InstantiateManagedMaterial(Ogre::String const &rg_name, Ogre::String const &source_name, Ogre::String const &clone_name)
shock_t & GetFreeShock()
void ProcessTrigger(RigDef::Trigger &def)
void ProcessCameraRail(RigDef::CameraRail &def)
Ogre::SceneNode * m_curr_mirror_prop_scenenode
std::vector< RTTLayer * > m_texturedashboard_rtt_layers
layouts specified in 'guisettings/texturedashboard'.
void ProcessCollisionBox(RigDef::CollisionBox &def)
NodeNum_t ResolveNodeRef(RigDef::Node::Ref const &node_ref, bool optional=false)
void ProcessTorqueCurve(RigDef::TorqueCurve &def)
RigDef::Keyword m_current_keyword
For error reports.
std::string GetCurrentElementMediaRG()
Where to load media from (the addonpart's bundle or vehicle's bundle?)
void ProcessDescription(Ogre::String const &line)
void AddMessage(Message type, Ogre::String const &text)
Maintenance.
void AddExhaust(NodeNum_t emitter_node_idx, NodeNum_t direction_node_idx)
void BuildWheelObjectAndNodes(WheelID_t wheel_id, unsigned int num_rays, node_t *axis_node_1, node_t *axis_node_2, node_t *reference_arm_node, unsigned int reserve_nodes, unsigned int reserve_beams, float wheel_radius, WheelPropulsion propulsion, WheelBraking braking, std::shared_ptr< RigDef::NodeDefaults > node_defaults, float wheel_mass, float wheel_width=-1.f)
Sets up wheel and builds nodes for sections 'wheels', 'meshwheels' and 'meshwheels2'.
void ProcessCollisionRange(RigDef::CollisionRange &def)
Ogre::SceneNode * m_actor_grouping_scenenode
Topmost common parent; this isn't used for moving things, just helps developers inspect the scene gra...
bool CheckAeroEngineLimit(unsigned int count)
void ProcessEngoption(RigDef::Engoption &def)
Designed to be run in physics loop (2khz)
RTT texture 'slot' within MyGUI system; we can only create them, not destroy, so we reuse.
Definition RTTLayer.h:13
Designed to be run on main/rendering loop (FPS)
BeamType
Definition SimData.h:62
static const float DEFAULT_MINIMASS
minimum node mass in Kg
@ BEAM_NORMAL
Definition SimData.h:63
std::shared_ptr< Document > DocumentPtr
WheelSide
Used by rig-def/addonpart/tuneup formats to specify wheel rim mesh orientation.
int WheelID_t
Index to Actor::ar_wheels, use RoR::WHEELID_INVALID as empty value.
uint16_t NodeNum_t
Node position within Actor::ar_nodes; use RoR::NODENUM_INVALID as empty value.
WheelPropulsion
WheelBraking
float global_minimass
'minimass' - used where 'set_default_minimass' is not applied.
RigDef::VideoCamera * video_camera_def
CustomMaterial(Ogre::MaterialPtr &mat)
RigDef::MaterialFlareBinding * material_flare_def
Ogre::SceneNode * mirror_prop_scenenode
Exception(Ogre::String const &message)
Unified game event system - all requests and state changes are reported using a message.
Definition GameContext.h:52
A series of RailSegment-s for SlideNode to slide along. Can be closed in a loop.
Definition SlideNode.h:54
Simulation: An edge in the softbody structure.
Definition SimData.h:305
Physics: A vertex in the softbody structure.
Definition SimData.h:260