Rigs of Rods 2023.09
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 "SimData.h"
33#include "FlexFactory.h"
34#include "FlexObj.h"
35
36#include <OgreString.h>
37#include <string>
38
39namespace RoR {
40
43
71{
72 friend class RoR::FlexFactory; // Needs to use `ComposeName()` and `SetupNewEntity()`
73
74public:
75
77 {
78 size_t num_nodes = 0;
79 size_t num_beams = 0;
80 size_t num_shocks = 0;
81 size_t num_rotators = 0;
82 size_t num_wings = 0;
83 size_t num_airbrakes = 0;
84 size_t num_fixes = 0;
85 // ... more to come ...
86 };
87
88 enum struct Message
89 {
93 };
94
97 void ConfigureSections(Ogre::String const & sectionconfig, RigDef::DocumentPtr def);
98 void ConfigureAddonParts(ActorPtr actor);
99 void ConfigureAssetPacks(ActorPtr actor);
101 static void SetupDefaultSoundSources(ActorPtr const& actor);
103
108 std::string GetSubmeshGroundmodelName();
110
111private:
112
143
144 struct Exception: public std::runtime_error
145 {
146 Exception(Ogre::String const & message):runtime_error(message) {}
147 };
148
151 // PLEASE maintain alphabetical order
155 void ProcessAuthor(RigDef::Author & def);
156 void ProcessAxle(RigDef::Axle & def);
157 void ProcessBeam(RigDef::Beam & def);
158 void ProcessBrakes(RigDef::Brakes & def);
160 void ProcessCamera(RigDef::Camera & def);
165 void ProcessContacter(RigDef::Node::Ref & node_ref);
168 void ProcessDescription(Ogre::String const& line);
169 void ProcessEngine(RigDef::Engine & def);
174 void ProcessFixedNode(RigDef::Node::Ref node_ref); // 'fixes'
175 void ProcessFlare2(RigDef::Flare2 & def);
176 void ProcessFlare3(RigDef::Flare3 & def);
183 void ProcessHelp(RigDef::Help & def);
184 void ProcessHook(RigDef::Hook & def);
185 void ProcessHydro(RigDef::Hydro & def);
187 void ProcessLockgroup(RigDef::Lockgroup & lockgroup);
192 void ProcessNode(RigDef::Node & def);
195 void ProcessProp(RigDef::Prop & def);
198 void ProcessRope(RigDef::Rope & def);
202 void ProcessShock(RigDef::Shock & def);
203 void ProcessShock2(RigDef::Shock2 & def);
204 void ProcessShock3(RigDef::Shock3 & def);
210 void ProcessTie(RigDef::Tie & def);
218 void ProcessWheel(RigDef::Wheel & def);
219 void ProcessWheel2(RigDef::Wheel2 & def);
220 void ProcessWing(RigDef::Wing & def);
222
225
226 void BuildAeroEngine(
227 NodeNum_t ref_node_index,
228 NodeNum_t back_node_index,
229 NodeNum_t blade_1_node_index,
230 NodeNum_t blade_2_node_index,
231 NodeNum_t blade_3_node_index,
232 NodeNum_t blade_4_node_index,
233 NodeNum_t couplenode_index,
234 bool is_turboprops,
235 Ogre::String const & airfoil,
236 float power,
237 float pitch);
238
240
242 RigDef::Inertia & inertia,
243 RigDef::Inertia & inertia_defaults,
244 RoR::CmdKeyInertia& contract_key,
245 RoR::CmdKeyInertia& extend_key);
246
248 void BuildWheelBeams(
249 unsigned int num_rays,
250 NodeNum_t base_node_index,
251 node_t *axis_node_1,
252 node_t *axis_node_2,
253 float tyre_spring,
254 float tyre_damping,
255 float rim_spring,
256 float rim_damping,
257 std::shared_ptr<RigDef::BeamDefaults> beam_defaults,
258 RigDef::Node::Ref const & rigidity_node_id,
259 float max_extension = 0.f);
260
262 unsigned int AddWheelBeam(
263 node_t *node_1,
264 node_t *node_2,
265 float spring,
266 float damping,
267 std::shared_ptr<RigDef::BeamDefaults> beam_defaults,
268 float max_contraction = -1.f,
269 float max_extension = -1.f,
270 BeamType type = BEAM_NORMAL);
271
276 WheelID_t wheel_id,
277 unsigned int num_rays,
278 node_t *axis_node_1,
279 node_t *axis_node_2,
280 node_t *reference_arm_node,
281 unsigned int reserve_nodes,
282 unsigned int reserve_beams,
283 float wheel_radius,
284 WheelPropulsion propulsion,
285 WheelBraking braking,
286 std::shared_ptr<RigDef::NodeDefaults> node_defaults,
287 float wheel_mass,
288 float wheel_width = -1.f);
289
292 void InitNode(node_t & node, Ogre::Vector3 const & position);
293 void InitNode(unsigned int node_index, Ogre::Vector3 const & position);
294 void InitNode(node_t & node, Ogre::Vector3 const & position, std::shared_ptr<RigDef::NodeDefaults> node_defaults);
295 beam_t& AddBeam(node_t & node_1, node_t & node_2, std::shared_ptr<RigDef::BeamDefaults> & defaults, int detacher_group);
296 unsigned int AddWheelRimBeam(RigDef::Wheel2 & wheel_2_def, node_t *node_1, node_t *node_2);
297 unsigned int AddTyreBeam(RigDef::Wheel2 & wheel_2_def, node_t *node_1, node_t *node_2);
298 unsigned int _SectionWheels2AddBeam(RigDef::Wheel2 & wheel_2_def, node_t *node_1, node_t *node_2);
299 void GetWheelAxisNodes(RigDef::BaseWheel& def, node_t*& out_node_1, node_t*& out_node_2);
300 void AddExhaust(NodeNum_t emitter_node_idx, NodeNum_t direction_node_idx);
301 RailGroup* CreateRail(std::vector<RigDef::Node::Range> & node_ranges);
302 void InitializeRig();
303 void FinalizeRig();
304 void AddBaseFlare(RigDef::FlareBase& flare_def);
306
309 void CalcMemoryRequirements(ActorMemoryRequirements& req, RigDef::Document::Module* module_def);
311 void WashCalculator();
312 void AdjustNodeBuoyancy(node_t & node, RigDef::Node & node_def, std::shared_ptr<RigDef::NodeDefaults> defaults);
313 void AdjustNodeBuoyancy(node_t & node, std::shared_ptr<RigDef::NodeDefaults> defaults);
314 void InitBeam(beam_t & beam, node_t *node_1, node_t *node_2);
315 void CalculateBeamLength(beam_t & beam);
316 void SetBeamStrength(beam_t & beam, float strength);
317 void SetBeamSpring(beam_t & beam, float spring);
318 void SetBeamDamping(beam_t & beam, float damping);
319 void SetBeamDeformationThreshold(beam_t & beam, std::shared_ptr<RigDef::BeamDefaults> beam_defaults);
320 void ValidateRotator(int id, int axis1, int axis2, NodeNum_t *nodes1, NodeNum_t *nodes2);
321
323 std::string ComposeName(const std::string& object, int number = -1);
324
328 bool AssignWheelToAxle(int & _out_axle_wheel, node_t *axis_node_1, node_t *axis_node_2);
329
330 // GetFree*(): Gets a free slot; checks limits, sets it's array position and updates 'free_node' index.
333 node_t& GetAndInitFreeNode(Ogre::Vector3 const & position);
334 beam_t& GetAndInitFreeBeam(node_t & node_1, node_t & node_2);
336
337 float ComputeWingArea(
338 Ogre::Vector3 const & ref,
339 Ogre::Vector3 const & x,
340 Ogre::Vector3 const & y,
341 Ogre::Vector3 const & aref);
342
346 std::vector<RigDef::Node::Range> & node_ranges,
347 std::vector<NodeNum_t> & out_node_indices);
349
352 NodeNum_t ResolveNodeRef(RigDef::Node::Ref const & node_ref, bool optional = false);
353 node_t* GetNodePointer(RigDef::Node::Ref const & node_ref);
355 beam_t& GetBeam(unsigned int index);
356 beam_t* FindBeamInRig(NodeNum_t node_a, NodeNum_t node_b);
359
362 bool CheckAxleLimit(unsigned int count);
363 bool CheckSubmeshLimit(unsigned int count);
364 bool CheckTexcoordLimit(unsigned int count);
365 bool CheckCabLimit(unsigned int count);
366 bool CheckCameraRailLimit(unsigned int count);
367 static bool CheckSoundScriptLimit(ActorPtr const& vehicle, unsigned int count);
368 bool CheckAeroEngineLimit(unsigned int count);
369 bool CheckScrewpropLimit(unsigned int count);
371
374 void CreateBeamVisuals(beam_t& beam, int beam_index, bool visible, std::shared_ptr<RigDef::BeamDefaults> const& beam_defaults, std::string material_override="");
375 void CreateWheelSkidmarks(WheelID_t wheel_index);
376 void FinalizeGfxSetup();
377 Ogre::MaterialPtr FindOrCreateCustomizedMaterial(const std::string& mat_lookup_name, const std::string& mat_lookup_rg);
378 Ogre::MaterialPtr CreateSimpleMaterial(Ogre::ColourValue color);
379 Ogre::ParticleSystem* CreateParticleSystem(std::string const & name, std::string const & template_name);
380 RigDef::MaterialFlareBinding* FindFlareBindingForMaterial(std::string const & material_name);
381 RigDef::VideoCamera* FindVideoCameraByMaterial(std::string const & material_name);
383 void CreateMirrorPropVideoCam(Ogre::MaterialPtr custom_mat, CustomMaterial::MirrorPropType type, Ogre::SceneNode* prop_scenenode);
384 void SetupNewEntity(Ogre::Entity* e, Ogre::ColourValue simple_color);
385 Ogre::MaterialPtr InstantiateManagedMaterial(Ogre::String const & rg_name, Ogre::String const & source_name, Ogre::String const & clone_name);
386 void CreateCabVisual();
387 void CreateMaterialFlare(int flare_index, Ogre::MaterialPtr mat);
388 std::string GetCurrentElementMediaRG();
389 void AssignManagedMaterialTexture(Ogre::TextureUnitState* tus, const std::string & mm_name, int media_id, const std::string& tex_name);
390
393 WheelID_t wheel_id,
394 NodeNum_t node_base_index,
395 unsigned int def_num_rays,
396 Ogre::String const& face_material_name,
397 Ogre::String const& face_material_rg,
398 Ogre::String const& band_material_name,
399 Ogre::String const& band_material_rg,
400 bool separate_rim,
401 float rim_ratio = 1.f
402 );
403
405 WheelID_t wheel_id,
406 NodeNum_t node_base_index,
407 NodeNum_t axis_node_1,
408 NodeNum_t axis_node_2,
409 int num_rays,
410 float radius,
411 WheelSide side,
412 std::string rim_mesh_name,
413 std::string rim_mesh_rg,
414 std::string tire_mesh_name,
415 std::string tire_mesh_rg);
416
418 WheelID_t wheel_id,
419 NodeNum_t base_node_index,
420 NodeNum_t axis_node_1_index,
421 NodeNum_t axis_node_2_index,
422 unsigned int num_rays,
423 WheelSide side,
424 Ogre::String mesh_name,
425 Ogre::String mesh_rg,
426 Ogre::String material_name,
427 Ogre::String material_rg,
428 float rim_radius);
430
433 static void AddSoundSource(ActorPtr const& vehicle, SoundScriptInstancePtr sound_script, NodeNum_t node_index, int type = -2);
434 static void AddSoundSourceInstance(ActorPtr const& vehicle, Ogre::String const & sound_script_name, int node_index, int type = -2);
436
439 void AddMessage(Message type, Ogre::String const & text);
441 void HandleException();
443
445 {
446 // Minimum node mass
448 };
449
454 std::list<std::shared_ptr<RigDef::Document::Module>>
456 Ogre::Vector3 m_spawn_position;
462
476 std::vector<CabTexcoord> m_oldstyle_cab_texcoords;
477 std::vector<CabSubmesh> m_oldstyle_cab_submeshes;
479 std::shared_ptr<RigDef::Document::Module> m_current_module;
480 std::map<Ogre::String, unsigned int> m_named_nodes;
482
486 std::map<std::string, CustomMaterial> m_material_substitutions;
487 std::map<std::string, Ogre::MaterialPtr> m_managed_materials;
489 Ogre::MaterialPtr m_cab_trans_material;
490 Ogre::MaterialPtr m_simple_material_base;
494 // Grouping nodes for diagnostics:
495 Ogre::SceneNode* m_actor_grouping_scenenode = nullptr;
496 Ogre::SceneNode* m_wheels_parent_scenenode = nullptr;
497 Ogre::SceneNode* m_props_parent_scenenode = nullptr;
498 Ogre::SceneNode* m_flexbodies_parent_scenenode = nullptr;
499 Ogre::SceneNode* m_flares_parent_scenenode = nullptr;
500 Ogre::SceneNode* m_particles_parent_scenenode = nullptr;
502};
503
505
506} // 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)
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()
RoR::Renderdash * m_oldstyle_renderdash
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.
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
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?)
std::string m_help_material_name
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)
'renderdash' is a name of a classic Render-To-Texture animated material with gauges and other dashboa...
Definition Renderdash.h:35
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