 |
RigsofRods
Soft-body Physics Simulation
|
Go to the documentation of this file.
76 #include <OgreMaterialManager.h>
77 #include <OgreSceneManager.h>
78 #include <OgreMovableObject.h>
79 #include <OgreParticleSystem.h>
80 #include <OgreEntity.h>
82 #include <fmt/format.h>
93 if (sectionconfig !=
"")
95 auto result = def->user_modules.find(sectionconfig);
97 if (result != def->user_modules.end())
100 LOG(
" == ActorSpawner: Module added to configuration: " + sectionconfig);
128 LOG(
" == ActorSpawner: Addon part added to configuration: " + addonpart);
158 for (
auto& def: module_def->
nodes)
267 for (
size_t i = 0; i < req.
num_nodes; ++i)
333 #ifdef USE_ANGELSCRIPT
335 #endif // USE_ANGELSCRIPT
405 "Failed to load built-in material 'tracks/simple'; disabling 'SimpleMaterials'");
475 float proped_wheels_radius_sum = 0.0f;
515 if ((a1 == i - 1) && (a2 == i - 0))
548 float max_dist = 0.0f;
562 float offset = atan2(dir.dotProduct(Ogre::Vector3::UNIT_Z), dir.dotProduct(Ogre::Vector3::UNIT_X));
582 Ogre::Vector3 cross = dir_node_offset.crossProduct(roll_node_offset);
636 if (wcent.x>prop.x && wcent.x<prop.x+15.0)
639 if (wcent.y>prop.y-radius && wcent.y<prop.y+radius)
644 float pleft=prop.z+radius;
645 float pright=prop.z-radius;
647 if (pleft<aleft) aleft=pleft;
649 if (pright>aright) aright=pright;
653 float wratio=(aleft-aright)/(wleft-wright);
677 Ogre::Entity* afterburn_ent =
nullptr;
687 propname, nozzle_ent, afterburn_ent);
786 Ogre::String
const & airfoil,
795 this->
ComposeName(
"turboprop", aeroengine_index).c_str(),
884 this->
ComposeName(
"airbrake", airbrake_idx).c_str(),
915 ab->
offset = Ogre::Vector3::ZERO;
948 this->GetNodeIndexOrThrow(def.
nodes[2]),
949 this->GetNodeIndexOrThrow(def.
nodes[3]),
950 this->GetNodeIndexOrThrow(def.
nodes[4]),
951 this->GetNodeIndexOrThrow(def.
nodes[5]),
952 this->GetNodeIndexOrThrow(def.
nodes[6]),
953 this->GetNodeIndexOrThrow(def.
nodes[7]),
968 Ogre::Entity* entity =
nullptr;
996 if (node1 != previous_wing.
fa->
nfld)
1031 left_green_prop.
pp_beacon_bbs[0]->setMaterialName(
"tracks/greenflare");
1035 left_green_prop.
pp_beacon_bbs[0]->setDefaultDimensions(0.5, 0.5);
1053 left_flash_prop.
pp_beacon_light[0]->setDiffuseColour( Ogre::ColourValue(1.0, 1.0, 1.0));
1054 left_flash_prop.
pp_beacon_light[0]->setSpecularColour( Ogre::ColourValue(1.0, 1.0, 1.0));
1055 left_flash_prop.
pp_beacon_light[0]->setAttenuation(50.0, 1.0, 0.3, 0.0);
1065 left_flash_prop.
pp_beacon_bbs[0]->setMaterialName(
"tracks/flare");
1069 left_flash_prop.
pp_beacon_bbs[0]->setDefaultDimensions(1.0, 1.0);
1094 right_red_prop.
pp_beacon_bbs[0]->setMaterialName(
"tracks/redflare");
1098 right_red_prop.
pp_beacon_bbs[0]->setDefaultDimensions(0.5, 0.5);
1116 right_flash_prop.
pp_beacon_light[0]->setDiffuseColour( Ogre::ColourValue(1.0, 1.0, 1.0));
1117 right_flash_prop.
pp_beacon_light[0]->setSpecularColour( Ogre::ColourValue(1.0, 1.0, 1.0));
1118 right_flash_prop.
pp_beacon_light[0]->setAttenuation(50.0, 1.0, 0.3, 0.0);
1128 right_flash_prop.
pp_beacon_bbs[0]->setMaterialName(
"tracks/flare");
1132 right_flash_prop.
pp_beacon_bbs[0]->setDefaultDimensions(1.0, 1.0);
1163 return (((
x-ref).crossProduct(
y-ref)).length()+((
x-aref).crossProduct(
y-aref)).length())*0.5f;
1180 #endif // USE_OPENAL
1187 #endif // USE_OPENAL
1197 if (sound_script ==
nullptr)
1217 #endif // USE_OPENAL
1222 auto itor = def.
nodes.begin();
1223 auto end = def.
nodes.end();
1224 for(; itor != end; ++itor)
1246 if (def.
key ==
"helpMaterial")
1250 else if (def.
key ==
"speedoMax")
1253 if (maxKph > 10 && maxKph < 32000)
1264 else if (def.
key ==
"useMaxRPM")
1268 else if (def.
key ==
"shifterAnimTime")
1295 if (template_name ==
"" || template_name ==
"default")
1297 template_name =
"tracks/Smoke";
1305 if (exhaust.
smoker ==
nullptr)
1307 std::stringstream msg;
1308 msg <<
"Failed to create particle system '" << name <<
"' (template: '" << template_name <<
"')";
1328 for (; module_itor != module_end; ++module_itor)
1330 if (! module_itor->get()->submesh_groundmodel.empty())
1332 return module_itor->get()->submesh_groundmodel[0];
1335 return std::string();
1347 std::vector<RigDef::Texcoord>::iterator texcoord_itor = def.
texcoords.begin();
1348 for ( ; texcoord_itor != def.
texcoords.end(); texcoord_itor++)
1366 for ( ; cab_itor != cab_itor_end; ++cab_itor)
1374 std::stringstream msg;
1375 msg <<
"Collcab limit (" <<
MAX_CABS <<
") exceeded";
1380 bool mk_buoyance =
false;
1423 std::stringstream msg;
1424 msg <<
"Collcab limit (" <<
MAX_CABS <<
") exceeded";
1430 std::stringstream msg;
1431 msg <<
"Buoycab limit (" <<
MAX_CABS <<
") exceeded";
1533 std::vector<unsigned int> node_indices;
1534 bool nodes_found =
true;
1540 nodes_found =
false;
1543 node_indices.push_back(node);
1547 std::vector<ForvertTempData> forverts_tmp;
1548 for (
size_t i = 0; i < def.
forvert.size(); i++)
1550 const auto& forvert_item = def.
forvert[i];
1561 fmt::format(
"Flexbody {}({}) 'forvert'{}/{}: Some nodes not resolved (nref {}->{}, nx {}->{}, ny {}->{}).",
1570 forverts_tmp.push_back(fvtd);
1604 catch (Ogre::Exception&)
1627 pprop.
pp_id = prop_id;
1636 prop.
pp_id = prop_id;
1643 prop.
pp_rot = Ogre::Quaternion(Ogre::Degree(prop.
pp_rota.z), Ogre::Vector3::UNIT_Z)
1644 * Ogre::Quaternion(Ogre::Degree(prop.
pp_rota.y), Ogre::Vector3::UNIT_Y)
1645 * Ogre::Quaternion(Ogre::Degree(prop.
pp_rota.x), Ogre::Vector3::UNIT_X);
1665 Ogre::Vector3 steering_wheel_offset = Ogre::Vector3::ZERO;
1668 steering_wheel_offset = Ogre::Vector3(-0.67, -0.61,0.24);
1672 steering_wheel_offset = Ogre::Vector3(0.67, -0.61,0.24);
1674 if (steering_wheel_offset != Ogre::Vector3::ZERO)
1687 this->ComposeName(
"steering wheel entity @ prop", prop_id),
1699 this->ComposeName(
"prop entity", prop_id),
1748 pp_beacon_light->setType(Ogre::Light::LT_SPOTLIGHT);
1751 pp_beacon_light->setAttenuation(50.0, 1.0, 0.3, 0.0);
1752 pp_beacon_light->setSpotlightRange( Ogre::Degree(35), Ogre::Degree(45) );
1753 pp_beacon_light->setCastShadows(
false);
1754 pp_beacon_light->setVisible(
false);
1759 if (flare_billboard_sys)
1761 flare_billboard_sys->createBillboard(0,0,0);
1762 flare_billboard_sys->setMaterialName(prop.
pp_media[1]);
1764 flare_scene_node->attachObject(flare_billboard_sys);
1766 flare_scene_node->setVisible(
false);
1780 pp_beacon_light->setType(Ogre::Light::LT_POINT);
1781 pp_beacon_light->setDiffuseColour( Ogre::ColourValue(1.0, 0.0, 0.0));
1782 pp_beacon_light->setSpecularColour( Ogre::ColourValue(1.0, 0.0, 0.0));
1783 pp_beacon_light->setAttenuation(50.0, 1.0, 0.3, 0.0);
1784 pp_beacon_light->setCastShadows(
false);
1785 pp_beacon_light->setVisible(
false);
1789 if (flare_billboard_sys)
1791 flare_billboard_sys->createBillboard(0,0,0);
1792 flare_billboard_sys->setMaterialName(
"tracks/redbeaconflare");
1794 flare_billboard_sys->setDefaultDimensions(1.0, 1.0);
1795 flare_scene_node->attachObject(flare_billboard_sys);
1797 flare_scene_node->setVisible(
false);
1809 for (
int k=0; k<4; k++)
1819 prop.
pp_beacon_light[k]->setDiffuseColour( Ogre::ColourValue(1.0, 0.0, 0.0));
1820 prop.
pp_beacon_light[k]->setSpecularColour( Ogre::ColourValue(1.0, 0.0, 0.0));
1824 prop.
pp_beacon_light[k]->setDiffuseColour( Ogre::ColourValue(0.0, 0.5, 1.0));
1825 prop.
pp_beacon_light[k]->setSpecularColour( Ogre::ColourValue(0.0, 0.5, 1.0));
1828 prop.
pp_beacon_light[k]->setSpotlightRange( Ogre::Degree(35), Ogre::Degree(45) );
1839 prop.
pp_beacon_bbs[k]->setMaterialName(
"tracks/brightredflare");
1843 prop.
pp_beacon_bbs[k]->setMaterialName(
"tracks/brightblueflare");
1872 if (anim_def.
ratio == 0)
1874 std::stringstream msg;
1875 msg <<
"Prop (mesh: " << def.
mesh_name <<
") has invalid animation ratio (0), using it anyway (compatibility)...";
2003 std::list<RigDef::Animation::MotorSource>::iterator source_itor = anim_def.
motor_sources.begin();
2004 for ( ; source_itor != anim_def.
motor_sources.end(); source_itor++)
2009 anim.
animOpt3 =
static_cast<float>(source_itor->motor);
2013 anim.
animOpt3 =
static_cast<float>(source_itor->motor);
2017 anim.
animOpt3 =
static_cast<float>(source_itor->motor);
2021 anim.
animOpt3 =
static_cast<float>(source_itor->motor);
2025 anim.
animOpt3 =
static_cast<float>(source_itor->motor);
2031 anim.
animOpt3 =
static_cast<float>(source_itor->motor);
2066 anim.
animOpt3 =
static_cast<float>(link_id);
2104 const bool use_default_lower_limit = (anim_def.
lower_limit == 0.f);
2105 const bool use_default_upper_limit = (anim_def.
upper_limit == 0.f);
2167 float size = def.
size;
2172 if (blink_delay == -2)
2196 flare.
blinkdelay = (blink_delay == -1) ? 0.5f : blink_delay / 1000.f;
2218 fmt::format(
"Bad flare control num {}, must be 1-{}, using 1.",
2225 fmt::format(
"Bad flare control num {}, must be 1-{}, using {}.",
2247 std::string flare_name = this->
ComposeName(
"Flare", flare_id);
2248 if (!is_placeholder)
2262 if (flare.
bbs ==
nullptr)
2268 flare.
bbs->createBillboard(0,0,0);
2271 if (using_default_material)
2275 material_name =
"tracks/brakeflare";
2279 material_name =
"tracks/blinkflare";
2283 material_name =
"tracks/greenflare";
2287 material_name =
"tracks/redflare";
2291 material_name =
"tracks/flare";
2298 flare.
bbs->setMaterial(material);
2299 flare.
snode->attachObject(flare.
bbs);
2303 flare.
light =
nullptr;
2310 flare.
light->setType(Ogre::Light::LT_SPOTLIGHT);
2311 flare.
light->setDiffuseColour( Ogre::ColourValue(1, 1, 1));
2312 flare.
light->setSpecularColour( Ogre::ColourValue(1, 1, 1));
2313 flare.
light->setAttenuation(200, 0.9, 0, 0);
2314 flare.
light->setSpotlightRange( Ogre::Degree(35), Ogre::Degree(45) );
2315 flare.
light->setCastShadows(
false);
2320 flare.
light->setType(Ogre::Light::LT_SPOTLIGHT);
2321 flare.
light->setDiffuseColour(Ogre::ColourValue(1, 1, 1));
2322 flare.
light->setSpecularColour(Ogre::ColourValue(1, 1, 1));
2323 flare.
light->setAttenuation(400, 0.9, 0, 0);
2324 flare.
light->setSpotlightRange(Ogre::Degree(35), Ogre::Degree(45));
2325 flare.
light->setCastShadows(
false);
2330 flare.
light->setType(Ogre::Light::LT_SPOTLIGHT);
2331 flare.
light->setDiffuseColour(Ogre::ColourValue(1, 1, 1));
2332 flare.
light->setSpecularColour(Ogre::ColourValue(1, 1, 1));
2333 flare.
light->setAttenuation(400, 0.9, 0, 0);
2334 flare.
light->setSpotlightRange(Ogre::Degree(35), Ogre::Degree(45));
2335 flare.
light->setCastShadows(
false);
2343 flare.
light->setDiffuseColour( Ogre::ColourValue(1.0, 0, 0));
2344 flare.
light->setSpecularColour( Ogre::ColourValue(1.0, 0, 0));
2345 flare.
light->setAttenuation(10.0, 1.0, 0, 0);
2350 flare.
light->setDiffuseColour(Ogre::ColourValue(1, 1, 1));
2351 flare.
light->setSpecularColour(Ogre::ColourValue(1, 1, 1));
2352 flare.
light->setAttenuation(20.0, 1, 0, 0);
2357 flare.
light->setDiffuseColour( Ogre::ColourValue(1.0, 0, 0));
2358 flare.
light->setSpecularColour( Ogre::ColourValue(1.0, 0, 0));
2359 flare.
light->setAttenuation(10.0, 1.0, 0, 0);
2364 flare.
light->setDiffuseColour( Ogre::ColourValue(1, 1, 0));
2365 flare.
light->setSpecularColour( Ogre::ColourValue(1, 1, 0));
2366 flare.
light->setAttenuation(10.0, 1, 1, 0);
2371 flare.
light->setDiffuseColour( Ogre::ColourValue(1, 1, 1));
2372 flare.
light->setSpecularColour( Ogre::ColourValue(1, 1, 1));
2373 flare.
light->setAttenuation(1.0, 1.0, 1, 0.2);
2378 flare.
light->setDiffuseColour(Ogre::ColourValue(1, 1, 1));
2379 flare.
light->setSpecularColour(Ogre::ColourValue(1, 1, 1));
2380 flare.
light->setAttenuation(5.0, 1.0, 1, 0.2);
2385 if (flare.
light !=
nullptr)
2387 flare.
light->setType(Ogre::Light::LT_SPOTLIGHT);
2388 flare.
light->setSpotlightRange( Ogre::Degree(35), Ogre::Degree(45) );
2389 flare.
light->setCastShadows(
false);
2431 Ogre::MaterialPtr src_mat = Ogre::MaterialManager::getSingleton().getByName(source_name, rg_name);
2434 std::stringstream msg;
2435 msg <<
"Built-in material '" << source_name <<
"' missing! Skipping...";
2437 return Ogre::MaterialPtr();
2440 return src_mat->clone(clone_name);
2459 if (!Ogre::ResourceGroupManager::getSingleton().resourceExists(resource_group, def.
diffuse_map))
2466 !Ogre::ResourceGroupManager::getSingleton().resourceExists(resource_group, def.
damaged_diffuse_map))
2473 !Ogre::ResourceGroupManager::getSingleton().resourceExists(resource_group, def.
specular_map))
2486 if (!Ogre::MaterialManager::getSingleton().getByName(def.
name, module_rg))
2488 LOG(
fmt::format(
"[RoR] DBG ActorSpawner::ProcessManagedMaterial(): Creating placeholder for material '{}' in group '{}'", def.
name, module_rg));
2493 LOG(
fmt::format(
"[RoR] DBG ActorSpawner::ProcessManagedMaterial(): Placeholder already exists: '{}' in group '{}'", def.
name, module_rg));
2498 Ogre::MaterialPtr material;
2502 material = Ogre::MaterialManager::getSingleton().getByName(
"tracks/transred")->clone(custom_name,
true, resource_group);
2506 std::string mat_name_base
2508 ?
"managed/flexmesh_standard"
2509 :
"managed/flexmesh_transparent";
2601 Ogre::String mat_name_base
2603 ?
"managed/mesh_standard"
2604 :
"managed/mesh_transparent";
2653 material->getTechnique(
"BaseTechnique")->getPass(
"BaseRender")->setCullingMode(Ogre::CULL_NONE);
2658 material->getTechnique(
"BaseTechnique")->getPass(
"SpecularMapping1")->setCullingMode(Ogre::CULL_NONE);
2662 material->getTechnique(
"BaseTechnique")->getPass(
"Specular")->setCullingMode(Ogre::CULL_NONE);
2668 material->compile();
2685 RoR::LogFormat(
"[RoR|Spawner] Collision box: re-assigning node '%s' from box ID '%d' to '%d'",
2714 _out_axle_wheel = i;
2737 std::stringstream msg;
2738 msg <<
"Couldn't find wheel with axis nodes '" << def.
wheels[0][0].
ToString()
2745 std::stringstream msg;
2746 msg <<
"Couldn't find wheel with axis nodes '" << def.
wheels[1][0].
ToString()
2760 for (
auto itor = def.
options.begin(); itor != end; ++itor)
2800 AddMessage(
Message::TYPE_ERROR,
"You cannot have both an inter-axle differential and a transfercase between the same two axles, skipping...");
2887 std::stringstream msg;
2889 <<
") must be positive nonzero number. Using it anyway (compatibility)";
2917 std::vector<RigDef::TorqueCurve::Sample>::iterator itor = def.
samples.begin();
2918 for ( ; itor != def.
samples.end(); itor++)
2920 target_torque_curve->
AddCurveSample(itor->power, itor->torque_percent);
2940 if (particle.
psys ==
nullptr)
2942 std::stringstream msg;
2943 msg <<
"Failed to create particle system '" << name <<
"' (template: '" << def.
particle_system_name <<
"')";
2949 particle.
snode->attachObject(particle.
psys);
3091 if (rail_group ==
nullptr)
3093 std::stringstream msg;
3094 msg <<
"Specified rail group id '" << def.
railgroup_id <<
"' not found. Ignoring slidenode...";
3102 if (rail_group !=
nullptr)
3121 std::stringstream msg;
3122 msg <<
"Failed to find node by reference: " << node_ref.
ToString();
3129 std::vector<RigDef::Node::Range> & node_ranges,
3130 std::vector<NodeNum_t> & out_node_indices
3133 std::vector<RigDef::Node::Range>::iterator itor = node_ranges.begin();
3134 for ( ; itor != node_ranges.end(); itor++)
3136 if (itor->IsRange())
3150 std::stringstream msg;
3151 msg <<
"Encountered non-existent node '" << itor->end.ToString() <<
"' in range [" << itor->start.ToString() <<
" - " << itor->end.ToString() <<
"], "
3154 if (itor->end.Str().empty())
3156 msg <<
" However, this node must be accepted anyway for backwards compatibility."
3157 <<
" Please fix this as soon as possible.";
3158 end = itor->end.Num();
3175 for (
NodeNum_t i = start; i <= end; i++)
3177 out_node_indices.push_back(i);
3191 std::vector<NodeNum_t> node_indices;
3196 for (
unsigned int i = 0; i < node_indices.size() - 1; i++)
3199 if (beam ==
nullptr)
3201 std::stringstream msg;
3202 msg <<
"No beam between nodes indexed '" << node_indices[i] <<
"' and '" << node_indices[i + 1] <<
"'";
3212 for (
size_t i = 1; i < (num_seg - 1); ++i)
3219 const bool is_loop = (node_indices.front() == node_indices.back());
3256 if (node ==
nullptr)
3266 if (itor->hk_hook_node == node)
3273 if (hook ==
nullptr)
3275 std::stringstream msg;
3276 msg <<
"Node '" << def.
node.
ToString() <<
"' is not a hook-node (not marked with flag 'h'), ignoring...";
3307 int beam_index = -1;
3324 auto itor = lockgroup.
nodes.begin();
3325 auto end = lockgroup.
nodes.end();
3326 for (; itor != end; ++itor)
3339 bool invisible =
false;
3341 bool shock_trigger_enabled =
true;
3342 bool triggerblocker =
false;
3343 bool triggerblocker_inverted =
false;
3344 bool cmdkeyblock =
false;
3345 bool hooktoggle =
false;
3346 bool enginetrigger =
false;
3348 bool trigger_cmdkeyblock_state_short =
false;
3349 bool trigger_cmdkeyblock_state_long =
true;
3359 shock_trigger_enabled =
false;
3364 triggerblocker =
true;
3376 sbound = abs(sbound-1);
3382 triggerblocker_inverted =
true;
3401 enginetrigger =
true;
3404 if (!triggerblocker && !triggerblocker_inverted && !hooktoggle && !enginetrigger)
3413 else if (!hooktoggle && !enginetrigger)
3422 else if (enginetrigger)
3462 LOG(
"Trigger added. BeamID " +
TOSTRING(beam_index));
3466 beam.
shock = &shock;
3467 shock.
beamid = beam_index;
3469 if (!triggerblocker && !triggerblocker_inverted)
3479 if (!triggerblocker_inverted)
3495 if (cmdkeyblock && !triggerblocker)
3497 trigger_cmdkeyblock_state_short =
true;
3505 shock.
flags = shockflag;
3534 for (
unsigned int i = 0; i < 4; i++)
3570 for (
unsigned int i = 0; i < 4; i++)
3606 std::string start_function;
3607 std::string stop_function;
3634 Ogre::String start_function;
3635 Ogre::String stop_function;
3703 float center_length = 0.f;
3729 contract_command->
beams.push_back(cmd_beam);
3739 extend_command->
beams.push_back(cmd_beam);
3762 bool must_insert_qpair =
true;
3769 must_insert_qpair =
false;
3777 if (must_insert_qpair)
3790 float anim_option = 0;
3952 std::shared_ptr<RigDef::BeamDefaults> & beam_defaults,
3962 float strength = beam_defaults->breaking_threshold;
3968 float plastic_coef = beam_defaults->plastic_deform_coef;
3981 bool invisible =
false;
3982 unsigned int hydro_flags = 0;
4076 short_bound /= beam_length;
4077 long_bound /= beam_length;
4082 short_bound = (beam_length - short_bound) / beam_length;
4083 long_bound = (long_bound - beam_length) / beam_length;
4085 if (long_bound < 0.f)
4089 "Metric shock length calculation failed, 'short_bound' less than beams spawn length. Resetting to beam's spawn length (short_bound = 0)"
4094 if (short_bound > 1.f)
4098 "Metric shock length calculation failed, 'short_bound' less than 0 meters. Resetting to 0 meters (short_bound = 1)"
4129 shock.
flags = shock_flags;
4145 beam.
shock = & shock;
4146 shock.
beamid = beam_index;
4165 short_bound /= beam_length;
4166 long_bound /= beam_length;
4171 short_bound = (beam_length - short_bound) / beam_length;
4172 long_bound = (long_bound - beam_length) / beam_length;
4174 if (long_bound < 0.f)
4178 "Metric shock length calculation failed, 'short_bound' less than beams spawn length. Resetting to beam's spawn length (short_bound = 0)"
4183 if (short_bound > 1.f)
4187 "Metric shock length calculation failed, 'short_bound' less than 0 meters. Resetting to 0 meters (short_bound = 1)"
4218 shock.
flags = shock_flags;
4232 beam.
shock = & shock;
4233 shock.
beamid = beam_index;
4259 short_bound /= beam_length;
4260 long_bound /= beam_length;
4279 shock.
flags = shock_flags;
4294 beam.
shock = & shock;
4295 shock.
beamid = beam_index;
4309 node_t* swap = axis_node_1;
4310 axis_node_1 = axis_node_2;
4315 node_t *rigidity_node =
nullptr;
4316 node_t *axis_node_closest_to_rigidity_node =
nullptr;
4322 axis_node_closest_to_rigidity_node = ((distance_1 < distance_2)) ? axis_node_1 : axis_node_2;
4331 wheel.
wh_width = axis_vector.length();
4332 axis_vector.normalise();
4333 Ogre::Vector3 rim_ray_vector = axis_vector.perpendicular() * override_rim_radius;
4334 Ogre::Quaternion rim_ray_rotator = Ogre::Quaternion(Ogre::Degree(-360.f / (def.
num_rays * 2)), axis_vector);
4337 for (
unsigned int i = 0; i < def.
num_rays; i++)
4342 Ogre::Vector3 ray_point = axis_node_1->
RelPosition + rim_ray_vector;
4343 rim_ray_vector = rim_ray_rotator * rim_ray_vector;
4348 outer_node.
mass = node_mass;
4357 ray_point = axis_node_2->
RelPosition + rim_ray_vector;
4358 rim_ray_vector = rim_ray_rotator * rim_ray_vector;
4363 inner_node.
mass = node_mass;
4376 Ogre::Vector3 tyre_ray_vector = axis_vector.perpendicular() * override_tire_radius;
4377 Ogre::Quaternion& tyre_ray_rotator = rim_ray_rotator;
4378 tyre_ray_vector = tyre_ray_rotator * tyre_ray_vector;
4381 for (
unsigned int i = 0; i < def.
num_rays; i++)
4385 Ogre::Vector3 ray_point = axis_node_1->
RelPosition + tyre_ray_vector;
4386 tyre_ray_vector = tyre_ray_rotator * tyre_ray_vector;
4390 outer_node.
mass = node_mass;
4401 ray_point = axis_node_2->
RelPosition + tyre_ray_vector;
4402 tyre_ray_vector = tyre_ray_rotator * tyre_ray_vector;
4406 inner_node.
mass = node_mass;
4417 wheel.
wh_nodes[i * 2] = & outer_node;
4418 wheel.
wh_nodes[(i * 2) + 1] = & inner_node;
4435 for (
unsigned int i = 0; i < def.
num_rays; i++)
4440 unsigned int rim_outer_node_index = base_node_index + (i * 2);
4450 unsigned int rim_next_outer_node_index = base_node_index + (((i + 1) % def.
num_rays) * 2);
4462 for (
unsigned int i = 0; i < def.
num_rays; i++)
4464 int rim_node_index = base_node_index + i*2;
4465 int tyre_node_index = base_node_index + i*2 + def.
num_rays*2;
4470 int tyre_base_index = (i == 0) ? tyre_node_index + (def.
num_rays * 2) : tyre_node_index;
4479 int index = (i == 0) ? tyre_node_index + (def.
num_rays * 2) - 1 : tyre_node_index - 1;
4488 int rimnode = rim_node_index;
4496 if (rigidity_node !=
nullptr)
4498 if (axis_node_closest_to_rigidity_node == axis_node_1)
4500 axis_node_closest_to_rigidity_node = &
m_actor->
ar_nodes[base_node_index+i*2+rays*2];
4503 axis_node_closest_to_rigidity_node = &
m_actor->
ar_nodes[base_node_index+i*2+1+rays*2];
4505 unsigned int beam_index =
AddWheelBeam(rigidity_node, axis_node_closest_to_rigidity_node, tyre_spring, tyre_damp, def.
beam_defaults);
4514 float support_beams_short_bound = 1.0f - ((override_rim_radius / override_tire_radius) * 0.95f);
4516 for (
unsigned int i=0; i<def.
num_rays; i++)
4519 unsigned int tirenode = base_node_index + i*2 + def.
num_rays*2;
4520 unsigned int beam_index;
4561 override_rim_radius,
4578 if (def_node_1 == def_node_2)
4580 throw Exception(
"Wheel axis nodes must not be set to single node!");
4586 out_node_1 = def_node_2;
4587 out_node_2 = def_node_1;
4591 out_node_1 = def_node_1;
4592 out_node_2 = def_node_2;
4600 node_t* axis_node_1 =
nullptr;
4601 node_t* axis_node_2 =
nullptr;
4605 this->BuildWheelObjectAndNodes(
4666 node_t* axis_node_1 =
nullptr;
4667 node_t* axis_node_2 =
nullptr;
4673 this->BuildWheelObjectAndNodes(
4703 float tyre_spring = def.
spring;
4704 float tyre_damp = def.
damping;
4746 unsigned int num_rays,
4748 Ogre::String mesh_name,
4749 Ogre::String mesh_rg,
4750 Ogre::String material_name,
4751 Ogre::String material_rg,
4782 catch (Ogre::Exception& e)
4791 unsigned int num_rays,
4794 node_t *reference_arm_node,
4795 unsigned int reserve_nodes,
4796 unsigned int reserve_beams,
4800 std::shared_ptr<RigDef::NodeDefaults> node_defaults,
4809 float axis_length = axis_vector.length();
4810 axis_vector.normalise();
4819 wheel.
wh_width = (wheel_width < 0) ? axis_length : wheel_width;
4835 Ogre::Vector3 ray_vector = axis_vector.perpendicular() * wheel_radius;
4836 Ogre::Quaternion ray_rotator = Ogre::Quaternion(Ogre::Degree(-360.0 / (num_rays * 2)), axis_vector);
4838 for (
unsigned int i = 0; i < num_rays; i++)
4841 Ogre::Vector3 ray_point = axis_node_1->
RelPosition + ray_vector;
4843 ray_vector = ray_rotator * ray_vector;
4846 InitNode(outer_node, ray_point, node_defaults);
4847 outer_node.
mass = wheel_mass / (2.f * num_rays);
4856 ray_point = axis_node_2->
RelPosition + ray_vector;
4858 ray_vector = ray_rotator * ray_vector;
4861 InitNode(inner_node, ray_point, node_defaults);
4862 inner_node.
mass = wheel_mass / (2.f * num_rays);
4871 wheel.
wh_nodes[i * 2] = & outer_node;
4872 wheel.
wh_nodes[(i * 2) + 1] = & inner_node;
4878 unsigned int options = (defaults->options | node_def.
options);
4888 unsigned int num_rays,
4896 std::shared_ptr<RigDef::BeamDefaults> beam_defaults,
4902 bool rigidity_beam_side_1 =
false;
4903 node_t *rigidity_node =
nullptr;
4909 rigidity_beam_side_1 = distance_1 < distance_2;
4912 for (
unsigned int i = 0; i < num_rays; i++)
4915 unsigned int outer_ring_node_index = base_node_index + (i * 2);
4919 AddWheelBeam(axis_node_1, outer_ring_node, tyre_spring, tyre_damping, beam_defaults, 0.66f, max_extension);
4920 AddWheelBeam(axis_node_2, inner_ring_node, tyre_spring, tyre_damping, beam_defaults, 0.66f, max_extension);
4921 AddWheelBeam(axis_node_2, outer_ring_node, tyre_spring, tyre_damping, beam_defaults);
4922 AddWheelBeam(axis_node_1, inner_ring_node, tyre_spring, tyre_damping, beam_defaults);
4925 unsigned int next_outer_ring_node_index = base_node_index + (((i + 1) % num_rays) * 2);
4929 AddWheelBeam(outer_ring_node, inner_ring_node, rim_spring, rim_damping, beam_defaults);
4930 AddWheelBeam(outer_ring_node, next_outer_ring_node, rim_spring, rim_damping, beam_defaults);
4931 AddWheelBeam(inner_ring_node, next_inner_ring_node, rim_spring, rim_damping, beam_defaults);
4932 AddWheelBeam(inner_ring_node, next_outer_ring_node, rim_spring, rim_damping, beam_defaults);
4935 if (rigidity_node !=
nullptr)
4937 node_t *target_node = (rigidity_beam_side_1) ? outer_ring_node : inner_ring_node;
4938 unsigned int beam_index =
AddWheelBeam(rigidity_node, target_node, tyre_spring, tyre_damping, beam_defaults, -1.f, -1.f,
BEAM_VIRTUAL);
4948 node_t* axis_node_1 =
nullptr;
4949 node_t* axis_node_2 =
nullptr;
4954 this->BuildWheelObjectAndNodes(
5019 node_t* axis_node_1 =
nullptr;
5020 node_t* axis_node_2 =
nullptr;
5026 bool rigidity_beam_side_1 =
false;
5032 rigidity_beam_side_1 = distance_1 < distance_2;
5042 axis_vector.normalise();
5043 Ogre::Vector3 rim_ray_vector = Ogre::Vector3(0, override_rim_radius, 0);
5044 Ogre::Quaternion rim_ray_rotator = Ogre::Quaternion(Ogre::Degree(-360.f / wheel_2_def.
num_rays), axis_vector);
5047 wheel.
wh_width = axis_vector.length();
5050 for (
unsigned int i = 0; i < wheel_2_def.
num_rays; i++)
5052 float node_mass = wheel_2_def.
mass / (4.f * wheel_2_def.
num_rays);
5055 Ogre::Vector3 ray_point = axis_node_1->
RelPosition + rim_ray_vector;
5059 outer_node.
mass = node_mass;
5067 ray_point = axis_node_2->
RelPosition + rim_ray_vector;
5071 inner_node.
mass = node_mass;
5082 rim_ray_vector = rim_ray_rotator * rim_ray_vector;
5085 Ogre::Vector3 tyre_ray_vector = Ogre::Vector3(0, override_tire_radius, 0);
5086 Ogre::Quaternion tyre_ray_rotator = Ogre::Quaternion(Ogre::Degree(-180.f / wheel_2_def.
num_rays), axis_vector);
5087 tyre_ray_vector = tyre_ray_rotator * tyre_ray_vector;
5090 for (
unsigned int i = 0; i < wheel_2_def.
num_rays; i++)
5093 Ogre::Vector3 ray_point = axis_node_1->
RelPosition + tyre_ray_vector;
5097 outer_node.
mass = (0.67f * wheel_2_def.
mass) / (2.f * wheel_2_def.
num_rays);
5107 ray_point = axis_node_2->
RelPosition + tyre_ray_vector;
5111 inner_node.
mass = (0.33f * wheel_2_def.
mass) / (2.f * wheel_2_def.
num_rays);
5121 wheel.
wh_nodes[i * 2] = & outer_node;
5122 wheel.
wh_nodes[(i * 2) + 1] = & inner_node;
5124 tyre_ray_vector = rim_ray_rotator * tyre_ray_vector;
5142 for (
unsigned int i = 0; i < wheel_2_def.
num_rays; i++)
5147 unsigned int rim_outer_node_index = base_node_index + (i * 2);
5151 unsigned int beam_index;
5152 beam_index =
AddWheelRimBeam(wheel_2_def, axis_node_1, rim_outer_node);
5154 beam_index =
AddWheelRimBeam(wheel_2_def, axis_node_2, rim_inner_node);
5160 unsigned int rim_next_outer_node_index = base_node_index + (((i + 1) % wheel_2_def.
num_rays) * 2);
5176 (rigidity_beam_side_1) ? rim_outer_node : rim_inner_node
5183 unsigned int tyre_node_index = rim_outer_node_index + (2 * wheel_2_def.
num_rays);
5186 unsigned int tyre_next_node_index = rim_next_outer_node_index + (2 * wheel_2_def.
num_rays);
5191 AddTyreBeam(wheel_2_def, tyre_outer_node, tyre_next_outer_node);
5192 AddTyreBeam(wheel_2_def, tyre_outer_node, tyre_next_inner_node);
5193 AddTyreBeam(wheel_2_def, tyre_inner_node, tyre_next_outer_node);
5194 AddTyreBeam(wheel_2_def, tyre_inner_node, tyre_next_inner_node);
5196 AddTyreBeam(wheel_2_def, tyre_outer_node, rim_outer_node);
5197 AddTyreBeam(wheel_2_def, tyre_outer_node, rim_next_outer_node);
5198 AddTyreBeam(wheel_2_def, tyre_inner_node, rim_inner_node);
5199 AddTyreBeam(wheel_2_def, tyre_inner_node, rim_next_inner_node);
5201 AddTyreBeam(wheel_2_def, tyre_outer_node, rim_inner_node);
5202 AddTyreBeam(wheel_2_def, tyre_outer_node, rim_next_inner_node);
5203 AddTyreBeam(wheel_2_def, tyre_inner_node, rim_outer_node);
5204 AddTyreBeam(wheel_2_def, tyre_inner_node, rim_next_outer_node);
5206 AddTyreBeam(wheel_2_def, axis_node_1, tyre_outer_node);
5207 AddTyreBeam(wheel_2_def, axis_node_2, tyre_inner_node);
5244 override_rim_radius / override_tire_radius
5253 unsigned int num_rays,
5254 Ogre::String
const& face_material_name,
5255 Ogre::String
const& face_material_rg,
5256 Ogre::String
const& band_material_name,
5257 Ogre::String
const& band_material_rg,
5270 const std::string wheel_mesh_name = this->
ComposeName(
"mesh @ wheel*", wheel_index);
5276 static_cast<NodeNum_t>(node_base_index),
5278 face_material_name, face_material_rg,
5279 band_material_name, band_material_rg,
5284 const std::string instance_name = this->
ComposeName(
"entity @ wheel*", wheel_index);
5292 catch (Ogre::Exception& e)
5306 std::string rim_mesh_name,
5307 std::string rim_mesh_rg,
5308 std::string tire_mesh_name,
5309 std::string tire_mesh_rg)
5327 int num_nodes = num_rays * 4;
5328 std::vector<unsigned int> node_indices;
5329 node_indices.reserve(num_nodes);
5330 for (
int i = 0; i < num_nodes; ++i)
5332 node_indices.push_back( node_base_index + i );
5334 std::vector<ForvertTempData> forverts;
5343 Ogre::Vector3(0.5f, 0.5f, 0.f),
5344 Ogre::Vector3(0.f, 0.f, 0.f),
5351 if (flexbody ==
nullptr)
5358 catch (Ogre::Exception& e)
5361 "Failed to create flexbodywheel visuals '" + tire_mesh_name +
"', reason:" + e.getDescription());
5370 std::shared_ptr<RigDef::BeamDefaults> beam_defaults,
5371 float max_contraction,
5372 float max_extension,
5381 if (max_contraction > 0.f)
5442 if (force < 1.f || force > 20.f)
5444 std::stringstream msg;
5445 msg <<
"Clamping 'regulating_force' value '" << force <<
"' to allowed range <1 - 20>";
5447 force = (force < 1.f) ? 1.f : 20.f;
5459 if (pulse <= 1.0f || pulse >= 2000.0f)
5475 if (force < 1.f || force > 20.f)
5477 std::stringstream msg;
5478 msg <<
"Clamping 'regulating_force' value '" << force <<
"' to allowed range <1 - 20>";
5480 force = (force < 1.f) ? 1.f : 20.f;
5491 if (pulse <= 1.0f || pulse >= 2000.0f)
5522 m_actor->
ar_engine->
SetTurboOptions(def.
version, def.
tinertiaFactor, def.
nturbos, def.
param1, def.
param2, def.
param3, def.
param4, def.
param5, def.
param6, def.
param7, def.
param8, def.
param9, def.
param10, def.
param11);
5599 std::stringstream msg;
5600 msg <<
"Failed to retrieve required node: " << node_ref.
ToString();
5629 if (node !=
nullptr)
5639 node_t* ar_nodes[] = {
nullptr,
nullptr};
5641 if (ar_nodes[0] ==
nullptr)
5647 if (ar_nodes[1] ==
nullptr)
5658 beam.
k = def.
defaults->GetScaledSpringiness();
5659 beam.
d = def.
defaults->GetScaledDamping();
5667 float beam_strength = def.
defaults->GetScaledBreakingThreshold();
5790 if (beam_defaults->_is_user_defined)
5792 default_deform = beam_defaults->deformation_threshold;
5793 if (!beam_defaults->_enable_advanced_deformation && default_deform <
BEAM_DEFORM)
5805 if (default_deform < beam_creak)
5807 default_deform = beam_creak;
5810 float deformation_threshold = default_deform * beam_defaults->scale.deformation_threshold_constant;
5819 std::string material_name = material_override;
5820 if (material_name.empty())
5824 material_name =
"tracks/Chrome";
5828 material_name = beam_defaults->beam_material_name;
5833 auto material = it->second;
5836 material_name = material->getName();
5850 entity->setMaterialName(material_name);
5853 beamx.
rod_diameter = beam_defaults->visual_beam_diameter;
5864 beamx.
rod_scenenode->setScale(beam_defaults->visual_beam_diameter, -1, beam_defaults->visual_beam_diameter);
5868 catch (Ogre::Exception& e)
5877 beam.
L = beam_length;
5878 beam.
refL = beam_length;
5901 txt <<
": " << text;
5906 cm_type = RoR::Console::MessageType::CONSOLE_SYSTEM_ERROR;
5910 cm_type = RoR::Console::MessageType::CONSOLE_SYSTEM_WARNING;
5914 cm_type = RoR::Console::MessageType::CONSOLE_SYSTEM_NOTICE;
5928 bool is_imported = node_ref.GetImportState_IsValid();
5929 bool is_named = (is_imported ? node_ref.GetImportState_IsResolvedNamed() : node_ref.GetRegularState_IsNamed());
5938 std::stringstream msg;
5939 msg <<
"Failed to resolve node-ref (node not found):" << node_ref.
ToString();
5950 std::stringstream msg;
5976 if (node ==
nullptr)
5978 std::stringstream msg;
5979 msg <<
"Required node not found: " << node_ref.
ToString();
5989 std::stringstream msg;
5990 msg <<
"Attempt to add node with 'INVALID' flag: " <<
id.ToString() <<
" (number of nodes at this point: " <<
m_actor->
ar_num_nodes <<
")";
5995 if (
id.IsTypeNamed())
5998 auto insert_result =
m_named_nodes.insert(std::make_pair(
id.
Str(), new_index));
5999 if (! insert_result.second)
6001 std::stringstream msg;
6002 msg <<
"Ignoring named node! Duplicate name: " <<
id.Str() <<
" (number of nodes at this point: " <<
m_actor->
ar_num_nodes <<
")";
6012 if (
id.IsTypeNumbered())
6016 std::stringstream msg;
6017 msg <<
"Duplicate node number, previous definition will be overriden! - " <<
id.ToString() <<
" (number of nodes at this point: " <<
m_actor->
ar_num_nodes <<
")";
6026 throw Exception(
"Invalid Node::Id without type flags!");
6175 if (exhaust.
smoker ==
nullptr)
6183 exhaust.
smoker->setMaterialName(mat->getName(), mat->getGroup());
6215 for (
unsigned int i = 0; i < 8; i++)
6236 Ogre::Vector3
const & position,
6237 std::shared_ptr<RigDef::NodeDefaults> node_defaults
6254 Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName(def.
material_name);
6261 std::stringstream msg;
6262 msg <<
"Material '" << def.
material_name <<
"' defined in section 'globals' not found. Trying material 'tracks/transred'";
6278 std::stringstream msg;
6279 msg <<
"Axle limit (" <<
MAX_WHEELS/2 <<
") exceeded";
6290 std::stringstream msg;
6302 std::stringstream msg;
6315 std::stringstream msg;
6327 std::stringstream msg;
6328 msg <<
"Cab limit (" <<
MAX_CABS <<
") exceeded";
6339 std::stringstream msg;
6351 std::stringstream msg;
6363 std::stringstream msg;
6549 Ogre::String index_str =
TOSTRING(i+1);
6617 for (
auto& def: module->materialflarebindings)
6619 if (def.material_name == material_name)
6632 for (
auto& def: module->videocameras)
6634 if (def.material_name == material_name)
6652 return lookup_res->second.material;
6658 if (mat_lookup_name ==
"mirror")
6663 static int mirror_counter = 0;
6664 const std::string new_mat_name = this->
ComposeName(
"RenderMaterial", mirror_counter);
6666 lookup_entry.
material = Ogre::MaterialManager::getSingleton().getByName(
"mirror")->clone(new_mat_name,
true, mat_lookup_rg);
6674 if (videocam_def !=
nullptr)
6676 Ogre::MaterialPtr video_mat_shared;
6680 video_mat_shared = found_managedmat->second;
6684 video_mat_shared = Ogre::MaterialManager::getSingleton().getByName(mat_lookup_name);
6687 if (video_mat_shared)
6691 lookup_entry.
material = video_mat_shared->clone(video_mat_name,
true, mat_lookup_rg);
6697 std::stringstream msg;
6698 msg <<
"VideoCamera material '" << mat_lookup_name <<
"' not found! Ignoring videocamera.";
6705 if (mat_flare_def !=
nullptr)
6715 auto skin_res = skin_def->replace_materials.find(mat_lookup_name);
6716 if (skin_res != skin_def->replace_materials.end())
6718 Ogre::MaterialPtr skin_mat = Ogre::MaterialManager::getSingleton().getByName(
6722 lookup_entry.
material = skin_mat->clone(this->
ComposeName(skin_mat->getName()),
true, mat_lookup_rg);
6728 std::stringstream buf;
6732 <<
"')! Ignoring it...";
6743 lookup_entry.
material = mmat_res->second;
6748 Ogre::MaterialPtr orig_mat = Ogre::MaterialManager::getSingleton().getByName(mat_lookup_name, mat_lookup_rg);
6751 std::stringstream buf;
6752 buf <<
"Material doesn't exist:" << mat_lookup_name;
6754 return Ogre::MaterialPtr();
6757 lookup_entry.
material = orig_mat->clone(this->
ComposeName(orig_mat->getName()),
true, mat_lookup_rg);
6769 for (
auto& technique: lookup_entry.
material->getTechniques())
6771 for (
auto& pass: technique->getPasses())
6773 for (
auto& tex_unit: pass->getTextureUnitStates())
6776 if (tex_unit->getTextureName() ==
"dashtexture")
6781 std::stringstream msg;
6782 msg <<
"Warning: '" << mat_lookup_name
6783 <<
"' references 'dashtexture', but Renderdash isn't created yet! Texture will be blank.";
6794 const size_t num_frames = tex_unit->getNumFrames();
6795 for (
size_t i = 0; i < num_frames; ++i)
6804 Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton().getByName(
6812 tex = Ogre::TextureManager::getSingleton().create(
6815 tex_unit->_setTexturePtr(tex, i);
6819 tex_unit->setFrameTextureName(query->second, (
unsigned int)i);
6831 catch (Ogre::Exception& e)
6833 std::stringstream msg;
6834 msg <<
"Exception while customizing material \"" << mat_lookup_name <<
"\", message: " << e.getFullDescription();
6837 return Ogre::MaterialPtr();
6844 static unsigned int simple_mat_counter = 0;
6846 newmat->getTechnique(0)->getPass(0)->setAmbient(color);
6882 size_t num_sub_entities = ent->getNumSubEntities();
6883 for (
size_t i = 0; i < num_sub_entities; i++)
6885 Ogre::SubEntity* subent = ent->getSubEntity(i);
6886 subent->setMaterial(mat);
6893 size_t subent_max = ent->getNumSubEntities();
6894 for (
size_t i = 0; i < subent_max; ++i)
6896 Ogre::SubEntity* subent = ent->getSubEntity(i);
6898 if (subent->getMaterial())
6903 subent->setMaterial(own_mat);
6917 if (entry.second.material_flare_def !=
nullptr)
6920 entry.second.material_flare_def->flare_number, entry.second.material);
6925 entry.second.material, entry.second.mirror_prop_type, entry.second.mirror_prop_scenenode);
6927 else if (entry.second.video_camera_def !=
nullptr)
6943 for (
auto& gs: module->guisettings)
6945 if (gs.key ==
"dashboard")
6949 else if (gs.key ==
"texturedashboard")
6981 mat->getNumTechniques() > 0 &&
6982 mat->getTechnique(0)->getNumPasses() > 0 &&
6983 mat->getTechnique(0)->getPass(0)->getNumTextureUnitStates() > 0 &&
6984 mat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->getNumFrames() > 0)
6987 Ogre::TextureManager::getSingleton().getByName(
6991 catch (Ogre::Exception& e)
6994 "Failed to load `help` material '" +
m_help_material_name +
"', message:" + e.getFullDescription());
7003 const float eps = 0.001f;
7006 Ogre::Plane pl = Ogre::Plane((ax1 - ax2).normalisedCopy(), 0);
7012 float a1len = a1.normalise();
7013 float a2len = a2.normalise();
7014 float a3len = a3.normalise();
7015 float a4len = a4.normalise();
7016 if ((std::max(a1len, a3len) / std::min(a1len, a3len) > 1.f + eps) ||
7017 (std::max(a2len, a4len) / std::min(a2len, a4len) > 1.f + eps))
7027 float b1len = b1.normalise();
7028 float b2len = b2.normalise();
7029 float b3len = b3.normalise();
7030 float b4len = b4.normalise();
7031 if ((std::max(b1len, b3len) / std::min(b1len, b3len) > 1.f + eps) ||
7032 (std::max(b2len, b4len) / std::min(b2len, b4len) > 1.f + eps))
7038 float rot1 = a1.dotProduct(b1);
7039 float rot2 = a2.dotProduct(b2);
7040 float rot3 = a3.dotProduct(b3);
7041 float rot4 = a4.dotProduct(b4);
7042 if ((std::max(rot1, rot2) / std::min(rot1, rot2) > 1.f + eps) ||
7043 (std::max(rot2, rot3) / std::min(rot2, rot3) > 1.f + eps) ||
7044 (std::max(rot3, rot4) / std::min(rot3, rot4) > 1.f + eps) ||
7045 (std::max(rot4, rot1) / std::min(rot4, rot1) > 1.f + eps))
7056 Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().create(
7057 "VideoCamDebugMat-" +
TOSTRING(
counter), Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
7059 mat->getTechnique(0)->getPass(0)->createTextureUnitState();
7060 mat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureFiltering(Ogre::TFO_ANISOTROPIC);
7061 mat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureAnisotropy(3);
7062 mat->setLightingEnabled(
false);
7063 mat->setReceiveShadows(
false);
7066 mo->begin(mat->getName(), Ogre::RenderOperation::OT_LINE_LIST);
7067 Ogre::ColourValue pos_mark_col(1.f, 0.82f, 0.26f);
7068 Ogre::ColourValue dir_mark_col(0.f, 1.f, 1.f);
7069 const float pos_mark_len = 0.8f;
7070 const float dir_mark_len = 4.f;
7072 mo->position(pos_mark_len,0,0);
7073 mo->colour(pos_mark_col);
7074 mo->position(-pos_mark_len,0,0);
7075 mo->colour(pos_mark_col);
7077 mo->position(0,pos_mark_len,0);
7078 mo->colour(pos_mark_col);
7079 mo->position(0,-pos_mark_len,0);
7080 mo->colour(pos_mark_col);
7082 mo->position(0,0,pos_mark_len);
7083 mo->colour(pos_mark_col);
7084 mo->position(0,0,0);
7085 mo->colour(pos_mark_col);
7087 mo->position(0,0,-dir_mark_len);
7088 mo->colour(dir_mark_col);
7089 mo->position(0,0,0);
7090 mo->colour(dir_mark_col);
7124 float rotation_z = def->
rotation.z + 180;
7128 rotation_z += 180.0f;
7131 = Ogre::Quaternion(Ogre::Degree(rotation_z), Ogre::Vector3::UNIT_Z)
7132 * Ogre::Quaternion(Ogre::Degree(def->
rotation.y), Ogre::Vector3::UNIT_Y)
7133 * Ogre::Quaternion(Ogre::Degree(def->
rotation.x), Ogre::Vector3::UNIT_X);
7163 vcam.
vcam_render_tex = Ogre::TextureManager::getSingleton().createManual(
7165 Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
7171 Ogre::TU_RENDERTARGET);
7190 vcam.
vcam_material->getTechnique(0)->getPass(0)->setLightingEnabled(
false);
7196 vp->setClearEveryFrame(
true);
7200 vp->setOverlaysEnabled(
false);
7206 vcam.
vcam_material->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureUScale(-1);
7212 vp->setClearEveryFrame(
true);
7216 vp->setOverlaysEnabled(
false);
7230 catch (std::exception & ex)
7243 static int mprop_counter = 0;
7266 vcam.
vcam_render_tex = Ogre::TextureManager::getSingleton().createManual(
7267 this->
ComposeName(
"texture @ mirror", mprop_counter)
7274 , Ogre::TU_RENDERTARGET);
7288 v->setClearEveryFrame(
true);
7290 v->setOverlaysEnabled(
false);
7295 vcam.
vcam_material->getTechnique(0)->getPass(0)->setLightingEnabled(
false);
7300 catch (std::exception & ex)
7315 catch (Ogre::Exception& ogre_e)
7320 <<
") " << ogre_e.getFullDescription();
7324 catch (std::exception& std_e)
7339 Ogre::NameValuePairList params;
7341 params[
"templateName"] = template_name;
7344 name, Ogre::ParticleSystemFactory::FACTORY_TYPE_NAME, ¶ms);
7345 Ogre::ParticleSystem* psys =
static_cast<Ogre::ParticleSystem*
>(obj);
7349 for (
size_t i = 0; i < psys->getNumEmitters(); i++)
7351 psys->getEmitter(i)->setEnabled(
false);
7373 Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName(
m_cab_material_name);
7382 char transmatname[256];
7383 static int trans_counter = 0;
7385 Ogre::MaterialPtr transmat=mat->clone(transmatname);
7386 if (mat->getTechnique(0)->getNumPasses()>1)
7388 transmat->getTechnique(0)->removePass(1);
7390 transmat->getTechnique(0)->getPass(0)->setAlphaRejectSettings(Ogre::CMPF_LESS_EQUAL, 128);
7391 transmat->getTechnique(0)->getPass(0)->setDepthWriteEnabled(
false);
7392 if (transmat->getTechnique(0)->getPass(0)->getNumTextureUnitStates()>0)
7394 transmat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureFiltering(Ogre::TFO_NONE);
7396 transmat->compile();
7400 char backmatname[256];
7401 static int back_counter = 0;
7403 Ogre::MaterialPtr backmat=mat->clone(backmatname);
7404 if (mat->getTechnique(0)->getNumPasses()>1)
7406 backmat->getTechnique(0)->removePass(1);
7408 if (transmat->getTechnique(0)->getPass(0)->getNumTextureUnitStates()>0)
7410 backmat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setColourOperationEx(
7414 Ogre::ColourValue(0,0,0),
7415 Ogre::ColourValue(0,0,0)
7420 backmat->setReceiveShadows(
false);
7426 char cab_material_name_cstr[1000] = {};
7428 std::string mesh_name = this->
ComposeName(
"mesh @ cab");
7436 cab_material_name_cstr,
7443 Ogre::Entity *ec =
nullptr;
7450 cab_scene_node->attachObject(ec);
7463 catch (Ogre::Exception& e)
7481 Ogre::Technique* tech = m->getTechnique(0);
7484 Ogre::Pass* p = tech->getPass(0);
7489 p->setSelfIllumination(Ogre::ColourValue::ZERO);
7519 Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton().load(
7525 tus->setTexture(tex);
static const BitMask_t OPTION_u_INPUT_AILERON_ELEVATOR
#define ROR_ASSERT(_EXPR)
Game state manager and message-queue provider.
int16_t nd_coll_bbox_id
Optional attribute (-1 = none) - multiple collision bounding boxes defined in truckfile.
static const BitMask64_t SOURCE_EVENT
std::shared_ptr< BeamDefaults > beam_defaults
float ar_anim_previous_crank
For 'animator' with flag 'torque'.
void ResolveUnwantedAndTweakedElements(TuneupDefPtr &tuneup, CacheEntryPtr &addonpart_entry)
Evaluates 'addonpart_unwanted_*' elements, respecting 'protected_*' directives in the tuneup.
void setInertialReferences(node_t *refl, node_t *refr, node_t *refb, node_t *refc)
DifferentialTypeVec options
Order matters!
void ProcessWing(RigDef::Wing &def)
std::string * ar_nodes_name
Name in truck file, only if defined with 'nodes2'.
static const int MAX_COMMANDS
maximum number of commands per actor
int tr_ax_2
This axle is only driven in 4WD mode.
node_t * wh_rim_nodes[50]
void LoadAssetPack(CacheEntryPtr &t_dest, Ogre::String const &assetpack_filename)
Adds asset pack to the requesting cache entry's resource group.
float spring_out
spring value applied when shock extending
static const BitMask64_t SOURCE_ANGLE_OF_ATTACK
static const BitMask_t OPTION_c_COMMAND_STYLE
std::vector< Ogre::AxisAlignedBox > ar_collision_bounding_boxes
smart bounding boxes, used for determining the state of an actor (every box surrounds only a subset o...
std::shared_ptr< RigDef::Document::Module > m_current_module
For resolving addonparts.
bool cc_mode
Cruise Control.
Ogre::Quaternion vcam_rotation
static const BitMask_t OPTION_PITCH
const PropAnimFlag_t PROP_ANIM_FLAG_AIRSPEED
static const BitMask_t OPTION_e_INPUT_ELEVATOR
const PropAnimFlag_t PROP_ANIM_FLAG_TORQUE
int last_debug_state
smart debug output
int ar_num_contactable_nodes
Total number of nodes which can contact ground or cabs.
std::shared_ptr< BeamDefaults > beam_defaults
SoundScriptManager * GetSoundScriptManager()
static const BitMask_t CONSTRAINT_ATTACH_FOREIGN
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'.
BitMask_t constraint_flags
static const BitMask64_t SOURCE_FLAP
RoR::CmdKeyInertia command_inertia
const PropAnimFlag_t PROP_ANIM_FLAG_SHIFTER
'shifterman1, shifterman2, sequential, shifterlin, autoshifterlin'; animOpt3: see RoR::ShifterPropAni...
WheelSide
Used by rig-def/addonpart/tuneup formats to specify wheel rim mesh orientation.
static const BitMask64_t SOURCE_VERTICAL_VELOCITY
float m_odometer_user
GUI state.
static const BitMask_t OPTION_A_INV_TRIGGER_BLOCKER
float damp_out_fast
Damping value applied when shock is commpressing faster than split out velocity.
bool nd_contacter
Attr; User-defined.
SoundScriptInstancePtr ssi
NodeNum_t ar_main_camera_node_pos
Sim attr; ar_camera_node_pos[0] >= 0 ? ar_camera_node_pos[0] : 0.
VehicleAIPtr ar_vehicle_ai
bool CheckSubmeshLimit(unsigned int count)
float upper_limit
The upper limit for the animation.
float extension_break_limit
Node::Ref blade_tip_nodes[4]
static const BitMask_t OPTION_p_10xTOUGHER
Ogre::String dname
name parsed from the file
std::vector< SlideNode > m_slidenodes
all the SlideNodes available on this actor
std::vector< Node::Ref > nodes
const PropAnimMode_t PROP_ANIM_MODE_OFFSET_X
@ LIGHTMASK_CUSTOM9
custom light 9 on
void ProcessHook(RigDef::Hook &def)
bool cmb_is_force_restricted
Attribute defined in truckfile.
static const BitMask_t SOURCE_AERO_TORQUE
static CameraMode_t CAMERA_MODE_ALWAYS_HIDDEN
static void AddSoundSource(ActorPtr const &vehicle, SoundScriptInstancePtr sound_script, NodeNum_t node_index, int type=-2)
NodeNum_t ar_camera_node_dir[MAX_CAMERAS]
Physics attr; 'camera' = frame of reference; back node.
void ProcessHydro(RigDef::Hydro &def)
std::shared_ptr< BeamDefaults > beam_defaults
CameraSettings camera_settings
static const BitMask_t OPTION_x_EXHAUST_POINT
Legacy parser resolved references on-the-fly and the condition to check named nodes was "are there an...
RigDef::Keyword m_current_keyword
For error reports.
std::shared_ptr< Inertia > inertia_defaults
CameraMode_t pp_camera_mode_orig
Dynamic visibility mode {0 and higher = cinecam index}.
const PropAnimFlag_t PROP_ANIM_FLAG_AIRBRAKE
bool nd_immovable
Attr; User-defined.
@ VCAM_ROLE_TRACKING_VIDEOCAM
const PropAnimFlag_t PROP_ANIM_FLAG_AOA
void ProcessSubmesh(RigDef::Submesh &def)
void CreateBeamVisuals(beam_t &beam, int beam_index, bool visible, std::shared_ptr< RigDef::BeamDefaults > const &beam_defaults, std::string material_override="")
int ar_buoycabs[MAX_CABS]
void ProcessGlobals(RigDef::Globals &def)
static const BitMask_t OPTION_SHIFT_BACK_FORTH
static Ogre::Vector3 getTweakedCineCameraPosition(TuneupDefPtr &tuneup_entry, CineCameraID_t cinecamid, Ogre::Vector3 orig_val)
std::string m_custom_resource_group
Ogre::BillboardSet * bbs
This remains nullptr if removed via addonpart_unwanted_flare or Tuning UI.
std::shared_ptr< Inertia > inertia_defaults
bool wasDashboardHudLoaded() const
static const float NODE_FRICTION_COEF_DEFAULT
static const BitMask64_t SOURCE_AUTOSHIFTERLIN
void ProcessFlare2(RigDef::Flare2 &def)
float default_braking_force
bool option_o_1press_center
std::vector< Forvert > forvert
static const BitMask_t SOURCE_AERO_PITCH
node_t * m_fusealge_back
Physics attr; defined in truckfile.
collcab_rate_t ar_inter_collcabrate[MAX_CABS]
beam_t & GetBeam(unsigned int index)
NodeNum_t ar_extern_camera_node
std::shared_ptr< NodeDefaults > node_defaults
int control_number
Only 'u' type flares.
void ProcessRope(RigDef::Rope &def)
WingControlSurface control_surface
bool CheckCameraRailLimit(unsigned int count)
void UpdateSimDataBuffer()
Copies sim. data from Actor to GfxActor for later update.
@ TRUCK
its a truck (or other land vehicle)
ExtCameraMode ar_extern_camera_mode
static const BitMask_t OPTION_s_SOFT_BUMP_BOUNDS
Visuals of softbody beam (beam_t struct); Partially updated along with SimBuffer.
Ogre::MaterialPtr vcam_material
void SetSimpleDelay(RoR::CmdKeyInertiaConfig &cfg, float start_delay, float stop_delay, std::string start_function, std::string stop_function)
Ogre::RenderWindow * CreateCustomRenderWindow(std::string const &name, int width, int height)
void ProcessSoundSource(RigDef::SoundSource &def)
void SetEngineOptions(float einertia, char etype, float eclutch, float ctime, float stime, float pstime, float irpm, float srpm, float maximix, float minimix, float ebraking)
@ LIGHTMASK_CUSTOM4
custom light 4 on
Ogre::String start_function
static const int MAX_CLIGHTS
See RoRnet::Lightmask and enum events in InputEngine.h.
unsigned int texture_width
float alb_pulse_time
Anti-lock brake attribute;.
@ SHOCK_FLAG_TRG_BLOCKER_A
int spaceCurveEvenly(Ogre::SimpleSpline *spline)
Spaces the points of a spline evenly; this is needed for the correct calculation of the Ogre simple s...
std::shared_ptr< BeamDefaults > beam_defaults
RigDef::MaterialFlareBinding * FindFlareBindingForMaterial(std::string const &material_name)
Returns NULL if none found.
void ConfigureSections(Ogre::String const §ionconfig, RigDef::DocumentPtr def)
float springin
shocks2 & shocks3
const PropAnimFlag_t PROP_ANIM_FLAG_BRAKE
int m_num_wheel_diffs
Physics attr.
float post_shift_time
Seconds.
static const BitMask_t OPTION_R_ACTIVE_RIGHT
CameraManager * GetCameraManager()
static const BitMask_t SOURCE_AERO_RPM
Ogre::Vector3 AbsPosition
absolute position in the world (shaky)
TorqueCurve * getTorqueCurve()
const std::string & Str() const
float pp_beacon_rot_angle[4]
Radians.
void ProcessMinimass(RigDef::Minimass &def)
bool m_trigger_debug_enabled
Logging state.
float long_bound
Maximum extension. The longest length a shock can be, as a proportion of its original length....
void ProcessEngine(RigDef::Engine &def)
void ProcessGuiSettings(RigDef::GuiSettings &def)
const PropAnimMode_t PROP_ANIM_MODE_ROTA_Z
int mode
A special constant or cinecam index.
void setMaterialName(Ogre::String m)
static const BitMask_t OPTION_SEQUENTIAL_SHIFT
std::string wh_arg_media2
bool wasDashboardRttLoaded() const
static const float BEAM_DEFORM
RigDef::DocumentPtr m_file
float lower_limit
The lower limit for the animation.
bool trigger_enabled
general trigger,switch and blocker state
std::vector< Wheel > wheels
int dashboard_link
Only 'd' type flares, valid values are DD_*.
static const BitMask_t OPTION_ALTIMETER_1K
const PropAnimFlag_t PROP_ANIM_FLAG_DASHBOARD
Used with dashboard system inputs, see enum DashData in file DashBoardManager.h.
bool nd_cinecam_node
Attr; User-defined.
std::vector< float > gear_ratios
bool ar_collision_relevant
Physics state;.
void ProcessBrakes(RigDef::Brakes &def)
Ogre::TexturePtr vcam_render_tex
bool sn_attach_foreign
Attach/detach to rails only on other vehicles.
Ogre::Entity * GetTireEntity()
std::string ToString() const
Ogre::SimpleSpline * getUsedSpline()
Returns the used spline.
ActorInstanceID_t ar_instance_id
Static attr; session-unique ID.
float cc_target_rpm
Cruise Control.
A series of RailSegment-s for SlideNode to slide along. Can be closed in a loop.
@ LOADDASHBOARD_RTT_TEXTURE
Will be drawn to texture. Unless STACKABLE, it prevents the default dashboard from loading.
Ogre::SceneNode * m_particles_parent_scenenode
this isn't used for moving/hiding things, just helps developers inspect the scene graph.
CameraSettings camera_settings
float split_vel_out
Split velocity in (m/s) - threshold for slow / fast damping during extension.
void CheckAndLoadFlexbodyCache()
@ LIGHTMASK_CUSTOM10
custom light 10 on
static const BitMask_t OPTION_SHIFT_LEFT_RIGHT
Ogre::SceneNode * m_actor_grouping_scenenode
Topmost common parent; this isn't used for moving things, just helps developers inspect the scene gra...
float tc_ratio
Regulating force.
static const BitMask_t MODE_BOUNCE
Ogre::Entity * getEntity()
std::vector< Ogre::SceneNode * > m_deletion_scene_nodes
For unloading vehicle; filled at spawn.
std::vector< Shock2 > shocks2
RigDef::Keyword wh_arg_keyword
static const BitMask64_t SOURCE_TACHO
std::vector< Command2 > commands2
static bool isPropAnyhowRemoved(TuneupDefPtr &tuneup_def, PropID_t prop_id)
static const BitMask_t OPTION_PITCH
const PropAnimMode_t PROP_ANIM_MODE_ROTA_X
int m_num_axle_diffs
Physics attr.
bool sn_attach_self
Attach/detach to rails on the current vehicle only.
Differential * m_wheel_diffs[MAX_WHEELS/2]
Physics.
float m_fusealge_width
Physics attr; defined in truckfile.
float hb_ref_length
Idle length in meters.
Ogre::String damaged_diffuse_map
static const BitMask_t OPTION_CLUTCH
AppContext * GetAppContext()
static const NodeNum_t NODENUM_INVALID
std::vector< UniqueCommandKeyPair > ar_unique_commandkey_pairs
UI helper for displaying command control keys to user (must be built at spawn).
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 ProcessExtCamera(RigDef::ExtCamera &def)
bool nd_contactable
Attr; This node will be treated as contacter on inter truck collisions.
void ProcessRotator(RigDef::Rotator &def)
std::vector< Wing > wings
Ogre::Vector3 * ar_nodes_spawn_offsets
Relative positions (incl. Tuning system tweaks) from the definition file, for spawn-like resetting (i...
ground_model_t * defaultgm
void ProcessHelp(RigDef::Help &def)
static const int8_t INVALID_BBOX
Truck file format(technical spec)
void SetBeamDeformationThreshold(beam_t &beam, std::shared_ptr< RigDef::BeamDefaults > beam_defaults)
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'
bool nd_override_mass
User defined attr; mass is user-specified rather than calculated (override the calculation)
static const BitMask_t OPTION_FLAP
bool nx_no_particles
User-defined attr; disable all particles.
CVar * diag_simple_materials
Ogre::String particle_system_name
void AddExhaust(NodeNum_t emitter_node_idx, NodeNum_t direction_node_idx)
void ProcessShock(RigDef::Shock &def)
std::shared_ptr< BeamDefaults > beam_defaults
static const BitMask_t CONSTRAINT_ATTACH_SELF
static const BitMask_t OPTION_ANGLE_OF_ATTACK
static const BitMask64_t SOURCE_PARKING
int longbound_trigger_action
int ar_buoycab_types[MAX_CABS]
void ProcessLockgroup(RigDef::Lockgroup &lockgroup)
int m_proped_wheel_pairs[MAX_WHEELS]
Physics attr; For inter-differential locking.
void CreateWheelSkidmarks(WheelID_t wheel_index)
Ogre::SceneNode * wx_scenenode
Consists of static mesh, representing the rim, and dynamic mesh, representing the tire.
@ LIGHTMASK_REVERSE
reverse light on
Ogre::MaterialPtr m_simple_material_base
bool uses_inertia
Only 'flares3'.
RigDef::DocumentPtr m_definition
CVar * gfx_particles_mode
static const BitMask64_t SOURCE_BOAT_RUDDER
bool sl_enabled
Speed limiter;.
NodeNum_t FindNodeIndex(RigDef::Node::Ref &node_ref, bool silent=false)
float ar_dry_mass
User-defined (editable via NBUtil); from 'globals' arg#1 - default for all nodes.
BackmeshType backmesh_type
float spring_in
Spring value applied when the shock is compressing.
void AddCurveSample(float rpm, float progress, Ogre::String const &model=customModel)
Adds a point to the torque curve graph.
CVar * gfx_enable_videocams
int pos
Index into ar_ropables.
void ProcessCamera(RigDef::Camera &def)
std::vector< Rope > ropes
float cmb_engine_coupling
Attr from truckfile.
static const BitMask_t OPTION_AIR_BRAKE
float trigger_boundary_t
optional value to tune trigger_switch_state autorelease
NodeNum_t vcam_node_center
static const BitMask_t OPTION_m_METRIC
void SetVisible(bool visible)
void ProcessContacter(RigDef::Node::Ref &node_ref)
void SetCurrentKeyword(RigDef::Keyword keyword)
static const BitMask_t OPTION_L_ACTIVE_LEFT
void LogFormat(const char *format,...)
Improved logging utility. Uses fixed 2Kb buffer.
std::vector< Node::Range > rail_node_ranges
static const BitMask64_t SOURCE_PITCH
std::vector< Airbrake > airbrakes
void ProcessMeshWheel2(RigDef::MeshWheel2 &def)
static const BitMask_t SOURCE_AERO_STATUS
static const BitMask_t OPTION_BOAT_THROTTLE
void ProcessFusedrag(RigDef::Fusedrag &def)
const PropAnimMode_t PROP_ANIM_MODE_NOFLIP
std::vector< Node::Ref > nodes
Ogre::TexturePtr getTexture()
float precompression
Changes compression or extension of the suspension when the truck spawns. This can be used to "level"...
CVar * ui_default_boat_dash
string; name of the '.dashboard' file in modcache.
std::vector< Node > nodes
Ogre::Vector3 pp_offset_orig
Used with ANIM_FLAG_OFFSET*.
std::string vcam_mat_name_orig
For display in Tuning UI: Original material name from rig-def file, without per-actor stamping.
System integration layer; inspired by OgreBites::ApplicationContext.
static const BitMask_t OPTION_n_INPUT_NORMAL
void ProcessAirbrake(RigDef::Airbrake &def)
void ProcessTorqueCurve(RigDef::TorqueCurve &def)
void putMessage(MessageArea area, MessageType type, std::string const &msg, std::string icon="")
float m_turbo_inertia_factor
std::vector< hook_t > ar_hooks
User input state for animated props with 'source:event'.
static const BitMask64_t SOURCE_ALTIMETER_10K
int CParticleID_t
Index into GfxActor::m_cparticles, use RoR::CPARTICLEID_INVALID as empty value.
CVar * sim_no_self_collisions
float hk_min_length
Absolute value in meters.
unsigned int spin_right_key
std::shared_ptr< RigDef::Document::Module > TransformToRigDefModule(CacheEntryPtr &addonpart_entry)
transforms the addonpart to RigDef::File::Module (fake 'section/end_section') used for spawning.
Ogre::SceneNode * mirror_prop_scenenode
This class loads and processes a torque curve for a vehicle.
bool tr_4wd_mode
Enables 4WD mode.
std::vector< wheeldetacher_t > ar_wheeldetachers
RoR::WheelPropulsion propulsion
float ComputeWingArea(Ogre::Vector3 const &ref, Ogre::Vector3 const &x, Ogre::Vector3 const &y, Ogre::Vector3 const &aref)
Ogre::String resource_group
Resource group of the loaded bundle. Empty if not loaded yet.
static const BitMask_t OPTION_p_NO_PARTICLES
static const BitMask_t OPTION_u_INVULNERABLE
@ LIGHTMASK_CUSTOM7
custom light 7 on
bool m_generate_wing_position_lights
std::vector< tie_t > ar_ties
Ogre::RenderTexture * vcam_render_target
float dampout
shocks2 & shocks3
float sl_speed_limit
Speed limiter;.
float cc_target_speed_lower_limit
Cruise Control.
void ConfigureAddonParts(TuneupDefPtr &tuneup_def)
static const float NODE_LOADWEIGHT_DEFAULT
static const float BEAM_PLASTIC_COEF_DEFAULT
A visual mesh, forming a chassis for softbody actor At most one instance is created per actor.
bool nx_no_sparks
User-defined attr;.
Ogre::Real wh_mass
Total rotational mass of the wheel.
std::string getTruckFileResourceGroup()
static const BitMask_t OPTION_TORQUE
NodeNum_t ar_main_camera_node_dir
Sim attr; ar_camera_node_dir[0] >= 0 ? ar_camera_node_dir[0] : 0.
const PropAnimFlag_t PROP_ANIM_FLAG_PBRAKE
RoR::FlexFactory m_flex_factory
bool ar_hide_in_actor_list
Hide in list of spawned actors (available in top menubar). Useful for fixed-place machinery,...
std::set< std::string > use_addonparts
Addonpart filenames.
Designed to be run on main/rendering loop (FPS)
static const BitMask_t MODE_EVENT_LOCK
static const BitMask_t OPTION_SPEEDO
NodeNum_t vcam_node_dir_y
static Ogre::Vector3 getTweakedPropOffset(TuneupDefPtr &tuneup_entry, PropID_t prop_id, Ogre::Vector3 orig_val)
static Ogre::Vector3 getTweakedPropRotation(TuneupDefPtr &tuneup_entry, PropID_t prop_id, Ogre::Vector3 orig_val)
const PropAnimFlag_t PROP_ANIM_FLAG_ARUDDER
std::map< std::string, Ogre::MaterialPtr > m_managed_materials
Ogre::Vector3 RelPosition
relative to the local physics origin (one origin per actor) (shaky)
const PropAnimFlag_t PROP_ANIM_FLAG_RPM
@ VCAM_ROLE_TRACKING_MIRROR_NOFLIP
A MIRROR_NOFLIP(2) with tracking node set.
static const BitMask_t OPTION_BRAKES
void SetBeamSpring(beam_t &beam, float spring)
char pp_beacon_type
Special prop: beacon {0 = none, 'b' = user-specified, 'r' = red, 'p' = police lightbar,...
std::shared_ptr< commandbeam_state_t > cmb_state
std::vector< bool > ar_beams_user_defined
True for 'beams', false for wheels/cinecam/hooknode/wings/rotators etc...
static const BitMask64_t SOURCE_SHIFTERLIN
static const float HOOK_SPEED_DEFAULT
Ogre::SceneNode * vcam_debug_node
void ValidateRotator(int id, int axis1, int axis2, NodeNum_t *nodes1, NodeNum_t *nodes2)
static const BitMask64_t SOURCE_AIR_RUDDER
RigDef::VideoCamera * FindVideoCameraByMaterial(std::string const &material_name)
Returns NULL if none found.
float long_bound
Maximum extension limit, in percentage ( 1.00 = 100% )
const PropAnimFlag_t PROP_ANIM_FLAG_ALTIMETER
void CalcMemoryRequirements(ActorMemoryRequirements &req, RigDef::Document::Module *module_def)
float wh_arg_simple_spring
Whole wheel or just tire, depending on type.
bool IsValidAnyState() const
NodeNum_t RegisterNode(RigDef::Node::Id &id)
DashBoardManager * ar_dashboard
static const BitMask_t OPTION_m_NO_MOUSE_GRAB
static const BitMask64_t SOURCE_AIRSPEED
Skidmark * m_skid_trails[MAX_WHEELS *2]
Ogre::Vector3 pp_wheel_pos
const PropAnimMode_t PROP_ANIM_MODE_ROTA_Y
void setAutoMode(SimGearboxMode mode)
int di_idx_2
array location of wheel / axle 2
float sbd_break
set beam default for breaking threshold
static const BitMask_t OPTION_B_TRIGGER_BLOCKER
bool pp_aero_propeller_spin
Special - blurred spinning propeller effect.
void _ProcessKeyInertia(RigDef::Inertia &inertia, RigDef::Inertia &inertia_defaults, RoR::CmdKeyInertia &contract_key, RoR::CmdKeyInertia &extend_key)
std::shared_ptr< BeamDefaults > beam_defaults
node_t & GetAndInitFreeNode(Ogre::Vector3 const &position)
float m_avg_proped_wheel_radius
Physics attr, filled at spawn - Average proped wheel radius.
static const BitMask64_t SOURCE_ELEVATOR
void AddDifferentialType(DiffType diff)
float animratio
A coefficient for the animation, prop degree if used with mode: rotation and propoffset if used with ...
void _ProcessSimpleInertia(RigDef::Inertia &def, RoR::SimpleInertia &obj)
int ExhaustID_t
Index into GfxActor::m_exhausts, use RoR::EXHAUSTID_INVALID as empty value.
Ogre::String predefined_func_name
ActorPtr rod_target_actor
@ LIGHTMASK_BLINK_LEFT
left blinker on
void ProcessAxle(RigDef::Axle &def)
Ogre::RenderWindow * vcam_render_window
RoR::CommandkeyID_t extend_key
WheelPropulsion wh_propulsed
Ogre::SceneManager * GetSceneManager()
static const BitMask64_t SOURCE_ROLL
void ProcessEngturbo(RigDef::Engturbo &def)
bool tc_nodash
Hide the dashboard indicator?
static const BitMask_t SOURCE_GEAR_FORWARD
Ogre::MaterialPtr m_cab_trans_material
const PropAnimFlag_t PROP_ANIM_FLAG_STEERING
static const BitMask_t OPTION_INVISIBLE
float damp_in
Damping value applied when the shock is compressing.
const PropAnimFlag_t PROP_ANIM_FLAG_GEAR
'gearreverse' (animOpt3=-1), 'gearneutral' (animOpt3=0), 'gear#' (animOpt3=#)
float damp_out
damping value applied when shock extending
float clutch_time
Seconds.
float spring_out
Spring value applied when shock extending.
void ProcessEngoption(RigDef::Engoption &def)
float wh_arg_rim_damping
Not used by 'wheels' (1) and 'meshwheels' (1).
int ar_num_contacters
Total number of nodes which can selfcontact cabs.
float refL
reference length
bool CheckCabLimit(unsigned int count)
Airfoil * m_fusealge_airfoil
Physics attr; defined in truckfile.
@ FAULTY_MESH_PLACEHOLDER
static const BitMask_t MODE_ROTATION_Y
std::vector< BitMask_t > ar_nodes_options
merged options from 'nodes' and 'set_node_defaults'
static const BitMask_t OPTION_RPM
Ogre::SceneNode * pp_wheel_scene_node
static const BitMask64_t SOURCE_AILERON
static const BitMask_t OPTION_g_INPUT_ELEVATOR_RUDDER
void ProcessShock3(RigDef::Shock3 &def)
RoR::VideoCamRole camera_role
bool m_has_command_beams
Physics attr;.
float ar_posnode_spawn_height
Ogre::String tyre_mesh_name
std::vector< float > ar_nodes_default_loadweights
'set_node_defaults': load weight.
void AddMessage(Message type, Ogre::String const &text)
Maintenance.
std::vector< MeshWheel2 > meshwheels2
A land vehicle engine + transmission.
void ProcessAnimator(RigDef::Animator &def)
float short_bound
Maximum contraction. The shortest length the shock can be, as a proportion of its original length....
void addwash(int propid, float ratio)
static const BitMask_t OPTION_m_METRIC
Node::Ref alt_reference_node
float spring_rate
The 'stiffness' of the shock. The higher the value, the less the shock will move for a given bump.
void SetupNewEntity(Ogre::Entity *e, Ogre::ColourValue simple_color)
Full texture and material setup.
Ogre::ManualObject * CreateVideocameraDebugMesh()
void ProcessFlaregroupNoImport(RigDef::FlaregroupNoImport &def)
static std::string getTweakedFlexbodyMediaRG(TuneupDefPtr &tuneup_def, FlexbodyID_t flexbody_id, int media_idx, const std::string &orig_val)
Ogre::MaterialPtr InstantiateManagedMaterial(Ogre::String const &rg_name, Ogre::String const &source_name, Ogre::String const &clone_name)
#define BITMASK_SET_0(VAR, FLAGS)
std::shared_ptr< SkinDocument > SkinDocumentPtr
MeshObject * pp_wheel_mesh_obj
Simulation: An edge in the softbody structure.
Ogre::ParticleSystem * psys
AeroEngine * ar_aeroengines[MAX_AEROENGINES]
static const BitMask_t MODE_AUTO_ANIMATE
void ProcessShock2(RigDef::Shock2 &def)
static const BitMask_t OPTION_l_LOAD_WEIGHT
Ogre::Camera * GetCamera()
ManagedMaterialsOptions options
Ogre::MaterialPtr FindOrCreateCustomizedMaterial(const std::string &mat_lookup_name, const std::string &mat_lookup_rg)
@ SHOCK_FLAG_TRG_HOOK_LOCK
static void ResetUnwantedAndTweakedElements(TuneupDefPtr &tuneup)
int * ar_nodes_id
Number in truck file, -1 for nodes generated by wheels/cinecam.
RoR::Renderdash * m_oldstyle_renderdash
#define BITMASK_IS_0(VAR, FLAGS)
Screwprop * ar_screwprops[MAX_SCREWPROPS]
CVar * gfx_window_videocams
Ogre::String material_name
void CreateVideoCamera(RigDef::VideoCamera *def)
@ DD_PARKINGBRAKE
chassis pitch
static const BitMask_t OPTION_TORQUE
NodeNum_t ResolveNodeRef(RigDef::Node::Ref const &node_ref)
bool CheckAeroEngineLimit(unsigned int count)
void ProcessMeshWheel(RigDef::MeshWheel &def)
ropable_t * rp_locked_ropable
std::vector< Cinecam > cinecam
NodeNum_t rod_node1
Node index - may change during simulation!
static const float DEFAULT_COLLISION_RANGE
CVar * gfx_alt_actor_materials
int VideoCameraID_t
Index into GfxActor::m_videocameras, use RoR::VIDEOCAMERAID_INVALID as empty value.
bool _has_load_weight_override
std::string dashboard_link
Only 'd' type flares.
std::vector< Wheel2 > wheels2
bool cmb_is_contraction
Attribute defined at spawn.
const PropAnimFlag_t PROP_ANIM_FLAG_AETORQUE
void ProcessRopable(RigDef::Ropable &def)
static const BitMask_t OPTION_i_INVISIBLE
std::vector< authorinfo_t > authors
static const BitMask_t OPTION_LONG_LIMIT
Ogre::SceneNode * smokeNode
static const BitMask_t OPTION_i_INVISIBLE
virtual int getNoderef()=0
uint16_t NodeNum_t
Node position within Actor::ar_nodes; use RoR::NODENUM_INVALID as empty value.
static const BitMask64_t SOURCE_BOAT_THROTTLE
CVar * ui_default_truck_dash
string; name of the '.dashboard' file in modcache.
float ar_load_mass
User-defined (editable via NBUtil); from 'globals' arg#2 - only applies to nodes with 'l' flag.
CVar * diag_log_beam_break
@ UNLOCKED
lock not locked
const PropAnimFlag_t PROP_ANIM_FLAG_PERMANENT
int ar_airbrake_intensity
Physics state; values 0-5.
static bool isManagedMatAnyhowRemoved(TuneupDefPtr &tuneup_def, const std::string &matname)
static const BitMask_t OPTION_ACCEL
Wrapper for classic c-string (local buffer) Refresher: strlen() excludes '\0' terminator; strncat() A...
node_t * m_fusealge_front
Physics attr; defined in truckfile.
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,...
RoR::WheelBraking braking
NodeNum_t ar_camera_node_roll[MAX_CAMERAS]
Physics attr; 'camera' = frame of reference; left node.
TransferCase * m_transfer_case
Physics.
Ogre::Vector3 offset
gfx attribute
unsigned int texture_height
static const int DEFAULT_DETACHER_GROUP
std::vector< flare_t > ar_flares
float ti_min_length
Proportional to orig; length.
Ogre::String band_material_name
bool tc_notoggle
Disable in-game toggle?
static bool isFlexbodyAnyhowRemoved(TuneupDefPtr &tuneup_def, FlexbodyID_t flexbody_id)
static const BitMask64_t SOURCE_DIFFLOCK
static const BitMask64_t SOURCE_AIR_BRAKE
@ LIGHTMASK_CUSTOM3
custom light 3 on
static const float HOOK_FORCE_DEFAULT
unsigned int AddTyreBeam(RigDef::Wheel2 &wheel_2_def, node_t *node_1, node_t *node_2)
static const BitMask_t OPTION_M_ABSOLUTE_METRIC
std::vector< CabTexcoord > m_oldstyle_cab_texcoords
void ProcessTurboprop2(RigDef::Turboprop2 &def)
int m_num_command_beams
TODO: Remove! Spawner context only; likely unused feature.
Gfx attributes/state of a softbody node.
@ FAULTY_FORSET_PLACEHOLDER
@ ALL_VEHICLES_ALL_LIGHTS
All vehicles, all lights.
collcab_rate_t ar_intra_collcabrate[MAX_CABS]
float sbd_damp
set beam default for damping
void ProcessAuthor(RigDef::Author &def)
bool CheckTexcoordLimit(unsigned int count)
std::vector< Rotator2 > rotators2
A database of user-installed content alias 'mods' (vehicles, terrains...)
const PropAnimMode_t PROP_ANIM_MODE_AUTOANIMATE
float ar_total_mass
Calculated; total mass in Kg.
int trigger_cmdshort
F-key for trigger injection shortbound-check.
float cmb_center_length
Attr computed at spawn.
bool cmb_needs_engine
Attribute defined in truckfile.
Ogre::ParticleSystem * CreateParticleSystem(std::string const &name, std::string const &template_name)
float cc_target_speed
Cruise Control.
Ogre::SceneNode * m_props_parent_scenenode
this isn't used for moving/hiding things, just helps developers inspect the scene graph.
float load_weight_override
void ConfigureAssetPacks(ActorPtr actor, RigDef::DocumentPtr def)
static const BitMask_t OPTION_x_START_DISABLED
Ogre::Light * pp_beacon_light[4]
std::string wh_arg_media1
static const BitMask_t OPTION_a_INPUT_AILERON
void ProcessSpeedLimiter(RigDef::SpeedLimiter &def)
#define BITMASK_IS_1(VAR, FLAGS)
static const BitMask_t MODE_OFFSET_Z
std::string m_help_material_name
std::string vcam_off_tex_name
Used when videocamera is offline.
PointColDetector * m_inter_point_col_detector
Physics.
int setTorqueModel(Ogre::String name)
Sets the torque model which is used for the vehicle.
RigDef::VideoCamera * video_camera_def
static std::string getTweakedPropMedia(TuneupDefPtr &tuneup_entry, PropID_t prop_id, int media_idx, const std::string &orig_val)
std::shared_ptr< Inertia > inertia_defaults
std::vector< Animator > animators
TyrePressure & getTyrePressure()
const PropAnimFlag_t PROP_ANIM_FLAG_FLAP
static const BitMask_t OPTION_c_CONTACT
Node::Ref alt_orientation_node
const PropAnimFlag_t PROP_ANIM_FLAG_DIFFLOCK
FlexBody * CreateFlexBody(FlexbodyID_t flexbody_id, const NodeNum_t ref_node, const NodeNum_t x_node, const NodeNum_t y_node, Ogre::Vector3 offset, Ogre::Vector3 rotation, std::vector< unsigned int > &node_indices, std::vector< ForvertTempData > &forvert_data, const std::string &mesh_name, const std::string &resource_group_name)
std::vector< Trigger > triggers
void GetWheelAxisNodes(RigDef::BaseWheel &def, node_t *&out_node_1, node_t *&out_node_2)
static const float ROTATOR_TOLERANCE_DEFAULT
CVar * diag_log_beam_trigger
#define BITMASK_SET_1(VAR, FLAGS)
RoR::CmdKeyInertia hb_inertia
int WheelID_t
Index to Actor::ar_wheels, use RoR::WHEELID_INVALID as empty value.
void ProcessFlare3(RigDef::Flare3 &def)
Ogre::String specular_map
const PropAnimFlag_t PROP_ANIM_FLAG_AESTATUS
static const int MAX_SUBMESHES
maximum number of submeshes per actor
float trigger_switch_state
needed to avoid doubleswitch, bool and timer in one
std::vector< RailSegment > rg_segments
< beams updating length based on simulation variables, generally known as actuators.
static const int LOCKGROUP_NOLOCK
Ogre::Vector3 ar_origin
Physics state; base position for softbody nodes.
int wh_beam_start
BeamID to export 'set_beam_defaults' parameters from.
const char * ToCStr() const
void ProcessFlexbody(RigDef::Flexbody &def)
static const BitMask_t OPTION_ALTIMETER_10K
@ LOCAL_SLEEPING
sleeping (local) actor
CameraMode_t fb_camera_mode_active
Dynamic visibility mode {0 and higher = cinecam index}.
static const BitMask_t OPTION_STATUS
bool nd_cab_node
Attr; This node is part of collision triangle.
Ogre::Camera * vcam_ogre_camera
float cmb_speed
Attr; Rate of contraction/extension.
float short_bound
Maximum contraction limit, in percentage ( 1.00 = 100% )
@ BEAM_VIRTUAL
Excluded from mass calculations, visuals permanently disabled.
bool nd_no_mouse_grab
Attr; User-defined.
static const int MAX_CAMERAS
maximum number of cameras per actor
Ogre::String rim_mesh_name
static const BitMask_t OPTION_ROLL
int trigger_cmdlong
F-key for trigger injection longbound-check.
void loadDashBoard(const std::string &filename, BitMask_t flags)
void ProcessFixedNode(RigDef::Node::Ref node_ref)
float spring_in
Spring value applied when the shock is compressing.
CmdKeyArray ar_command_key
BEWARE: commandkeys are indexed 1-MAX_COMMANDS!
Ogre::Entity * abx_entity
float precompression
Changes compression or extension of the suspension when the truck spawns. This can be used to "level"...
SkinDocumentPtr skin_def
Cached skin info, added on first use or during cache rebuild.
Collisions * GetCollisions()
static const float HOOK_RANGE_DEFAULT
std::string getTruckFileName()
static const BitMask_t MODE_OFFSET_X
static const BitMask_t OPTION_BOAT_RUDDER
void SetNodes(NodeNum_t front, NodeNum_t back, NodeNum_t ref)
NodeNum_t pos
This node's index in Actor::ar_nodes array.
std::vector< std::string > m_description
bool nd_tyre_node
Attr; This node is part of a tyre (note some wheel types don't use rim nodes at all)
static const BitMask_t MODE_ROTATION_Z
beam_t & GetAndInitFreeBeam(node_t &node_1, node_t &node_2)
void ProcessScrewprop(RigDef::Screwprop &def)
static const BitMask_t OPTION_THROTTLE
static const BitMask_t OPTION_v_INPUT_InvAILERON_ELEVATOR
std::map< std::string, CustomMaterial > m_material_substitutions
Maps original material names (shared) to their actor-specific substitutes; There's 1 substitute per 1...
std::vector< Sample > samples
CVar * diag_log_beam_deform
#define SOUND_START(_ACTOR_, _TRIG_)
static const BitMask64_t SOURCE_STEERING_WHEEL
static const BitMask_t OPTION_TURBO
std::vector< Rotator > rotators
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'
const PropAnimFlag_t PROP_ANIM_FLAG_SIGNALSTALK
Turn indicator stalk position (-1=left, 0=off, 1=right)
int ar_collcabs[MAX_CABS]
node_t * wh_near_attach_node
A mesh attached to vehicle frame via 3 nodes.
@ VCAM_ROLE_MIRROR_NOFLIP
Same as VCAM_ROLE_MIRROR, but without flipping the texture horizontally (expects texcoords to be alre...
std::map< Ogre::String, unsigned int > m_named_nodes
std::vector< float > ar_minimass
minimum node mass in Kg - can be scaled in-game via NBUtil
const PropAnimFlag_t PROP_ANIM_FLAG_VVI
float progress_factor_spring_out
Progression factor springout, 0 = disabled, 1...x as multipliers, example:maximum springrate == sprin...
float expansion_trigger_limit
bool nd_loaded_mass
User-defined attr; mass is calculated from 'globals/loaded-mass' rather than 'globals/dry-mass' - set...
NodeNum_t ar_exhaust_dir_node
Old-format exhaust (one per vehicle) backwards direction node.
const PropAnimMode_t PROP_ANIM_MODE_OFFSET_Z
float shock_precompression
Only for export.
Central state/object manager and communications hub.
float long_bound
Maximum extension limit, in percentage ( 1.00 = 100% )
void ProcessBeam(RigDef::Beam &def)
int getLinkIDForName(Ogre::String &str)
BitMask_t m_flaregroups_no_import
RoRnet::Lightmask.
unsigned int AddWheelRimBeam(RigDef::Wheel2 &wheel_2_def, node_t *node_1, node_t *node_2)
@ SHOCK_FLAG_TRG_CONTINUOUS
const PropAnimMode_t PROP_ANIM_MODE_BOUNCE
@ VCAM_ROLE_MIRROR
Flips the video output and when not in driver cam, acts like a natural mirror, not a screen.
std::vector< float > ar_nodes_override_loadweights
'nodes': 'l' flag and number.
void ProcessCollisionRange(RigDef::CollisionRange &def)
static const BitMask64_t SOURCE_SHIFT_LEFT_RIGHT
@ CURR_VEHICLE_HEAD_ONLY
Only current vehicle, main lights.
Physics: A vertex in the softbody structure.
float cmb_boundary_length
Attr; Maximum/minimum length proportional to orig. len.
std::vector< float > gear_ratios
std::shared_ptr< Inertia > inertia_defaults
float damp_in_fast
Damping value applied when shock is commpressing faster than split in velocity.
std::string GetCurrentElementMediaRG()
Where to load media from (the addonpart's bundle or vehicle's bundle?)
float global_minimass
'minimass' - used where 'set_default_minimass' is not applied.
void AdjustNodeBuoyancy(node_t &node, RigDef::Node &node_def, std::shared_ptr< RigDef::NodeDefaults > defaults)
For user-defined nodes.
std::vector< Ogre::Entity * > m_deletion_entities
For unloading vehicle; filled at spawn.
GameContext * GetGameContext()
const char * KeywordToString(RigDef::Keyword keyword)
const PropAnimFlag_t PROP_ANIM_FLAG_ACCEL
float max_inclination_angle
void ProcessNode(RigDef::Node &def)
AeroAnimator aero_animator
Ogre::MaterialPtr m_managedmat_placeholder_template
An 'error marker' material (bright magenta) to generate managedmaterial placeholders from.
static const BitMask_t OPTION_s_CMD_NUM_SWITCH
float springout
shocks2 & shocks3
static const BitMask64_t SOURCE_HEADING
DifferentialTypeVec options
Order matters!
std::vector< Shock > shocks
@ VCAM_ROLE_MIRROR_PROP_RIGHT
The classic 'special prop/rear view mirror'.
static std::string getTweakedFlexbodyMedia(TuneupDefPtr &tuneup_entry, FlexbodyID_t flexbody_id, int media_idx, const std::string &orig_val)
float progress_factor_spring_in
Progression factor for springin. A value of 0 disables this option. 1...x as multipliers,...
Designed to be run in physics loop (2khz)
@ AIRPLANE
its an airplane
void CreateMirrorPropVideoCam(Ogre::MaterialPtr custom_mat, CustomMaterial::MirrorPropType type, Ogre::SceneNode *prop_scenenode)
void ProcessSlidenode(RigDef::SlideNode &def)
int shortbound_trigger_action
void AddBeam(int beam_id)
NodeNum_t vcam_node_lookat
Only for VCAM_ROLE_TRACK_CAM.
static const BitMask_t OPTION_y_INPUT_InvAILERON_RUDDER
std::vector< PropAnimKeyState > m_prop_anim_key_states
static const BitMask64_t SOURCE_PERMANENT
void ProcessRailGroup(RigDef::RailGroup &def)
static const BitMask_t OPTION_s_SUPPORT
@ LIGHTMASK_CUSTOM5
custom light 5 on
static std::string getTweakedManagedMatMediaRG(TuneupDefPtr &tuneup_def, const std::string &matname, int media_idx, const std::string &orig_val)
static float getTweakedWheelRimRadius(TuneupDefPtr &tuneup_entry, WheelID_t wheel_id, float orig_val)
Ogre::SceneNode * m_flares_parent_scenenode
this isn't used for moving/hiding things, just helps developers inspect the scene graph.
bool cmb_is_1press
Attribute defined in truckfile.
bool ar_camera_node_roll_inv[MAX_CAMERAS]
Physics attr; 'camera' = frame of reference; indicates roll node is right instead of left.
const PropAnimFlag_t PROP_ANIM_FLAG_THROTTLE
GfxFlaresMode m_flares_mode
Snapshot of cvar 'gfx_flares_mode' on spawn.
int ar_nodes_name_top_length
For nicely formatted diagnostic output.
@ l_SKIP_LOADED
Only apply minimum mass to nodes without "L" option.
static const BitMask_t OPTION_b_KEY_BLOCKER
static const BitMask_t OPTION_AIRSPEED
Ogre::MaterialPtr mat_instance
An Ogre::Camera mounted on the actor and rendering into either in-scene texture or external window.
@ VCAM_ROLE_TRACKING_MIRROR
A MIRROR(1) with tracking node set.
static const BitMask_t OPTION_i_INVISIBLE
@ LIGHTMASK_BRAKES
brake lights on
static const BitMask64_t SOURCE_ALTIMETER_1K
Ogre::SceneNode * abx_scenenode
void SetBeamStrength(beam_t &beam, float strength)
uint16_t hb_beam_index
Index to Actor::ar_beams array.
virtual float getRadius()=0
std::vector< RailGroup * > m_railgroups
all the available RailGroups for this actor
Ogre::SceneNode * GetSceneNode()
static bool CheckSoundScriptLimit(ActorPtr const &vehicle, unsigned int count)
void ProcessDescription(Ogre::String const &line)
std::string m_cab_material_name
Original name defined in truckfile/globals.
void ProcessInterAxle(RigDef::InterAxle &def)
std::shared_ptr< BeamDefaults > defaults
char m_engine_type
't' = truck (default), 'c' = car ('engoption' attr #2)
int tr_ax_1
This axle is always driven.
void ProcessParticle(RigDef::Particle &def)
void ProcessCollisionBox(RigDef::CollisionBox &def)
Ogre::String face_material_name
CacheEntryPtr & getUsedActorEntry()
The actor entry itself.
float parking_brake_force
const PropAnimFlag_t PROP_ANIM_FLAG_PITCH
float wh_arg_simple_damping
Whole wheel or just tire, depending on type.
void ProcessTie(RigDef::Tie &def)
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)
float option_min_range_meters
const PropAnimFlag_t PROP_ANIM_FLAG_TURBO
void UpdateCollcabContacterNodes()
Ogre::SceneNode * vcam_prop_scenenode
Only for VCAM_ROLE_MIRROR_PROP_*.
Ogre::SceneNode * rod_scenenode
int ar_num_cinecams
Sim attr;.
static const BitMask_t OPTION_h_UNLOCKS_HOOK_GROUP
void SaveFlexbodiesToCache()
static const BitMask_t OPTION_D_CONTACT_BUOYANT
float ar_collision_range
Physics attr.
bool nx_may_get_wet
Attr; enables water drip and vapour.
static const BitMask_t OPTION_t_CONTINUOUS
void SetBeamDamping(beam_t &beam, float damping)
static const BitMask64_t SOURCE_GEAR_NEUTRAL
static const BitMask64_t SOURCE_ACCEL
std::vector< Texcoord > texcoords
@ SHOCK_FLAG_TRG_CMD_SWITCH
Ogre::SceneNode * m_curr_mirror_prop_scenenode
bool m_disable_smoke
Stops/starts smoke particles (i.e. exhausts, turbojets).
static const float WHEEL_FRICTION_COEF
std::vector< Cab > cab_triangles
float precompression
Changes compression or extension of the suspension when the truck spawns. This can be used to "level"...
static bool isFlareAnyhowRemoved(TuneupDefPtr &tuneup_def, FlareID_t flare_id)
NodeNum_t vcam_node_alt_pos
std::string uckp_description
std::shared_ptr< BeamDefaults > beam_defaults
std::vector< bool > ar_beams_invisible
Used only by the exporter (for rendering, invisible beams simply get no mesh).
const PropAnimFlag_t PROP_ANIM_FLAG_HEADING
bool CheckAxleLimit(unsigned int count)
float wh_arg_rim_spring
Not used by 'wheels' (1) and 'meshwheels' (1).
std::string pp_media[2]
Redundant, for Tuning UI. Media1 = prop mesh name, Media2 = steeringwheel mesh/beaconprop flare mat.
void enableInducedDrag(float span, float area, bool l)
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.
static const BitMask_t OPTION_s_BUOYANT_NO_DRAG
static const int MAX_CAMERARAIL
maximum number of camera rail points
static Ogre::Vector3 getTweakedFlexbodyRotation(TuneupDefPtr &tuneup_entry, FlexbodyID_t flexbody_id, Ogre::Vector3 orig_val)
static const float DEFAULT_SPEEDO_MAX_KPH
@ TUNING_REMOVED_PLACEHOLDER
bool CreateNewCurve(Ogre::String const &name=customModel)
Creates new torque curve.
float ar_brake_force
Physics attr; filled at spawn.
#define SOUND_MODULATE(_ACTOR_, _MOD_, _VALUE_)
float global_min_mass_Kg
minimum node mass in Kg - only effective where DefaultMinimass was not set.
BitMask_t hb_flags
Only for 'hydros'.
@ LIGHTMASK_CUSTOM8
custom light 8 on
bool ar_is_police
Gfx/sfx attr.
bool cc_can_brake
Cruise Control.
float alb_timer
Anti-lock brake state;.
static const float HOOK_LOCK_TIMER_DEFAULT
static const BitMask_t OPTION_s_DISABLE_ON_HIGH_SPEED
bool alb_mode
Anti-lock brake state; Enabled? {1/0}.
void ProcessSoundSource2(RigDef::SoundSource2 &def)
BitMask_t hb_anim_flags
Only for 'animators'.
@ LIGHTMASK_CUSTOM2
custom light 2 on
static const BitMask_t OPTION_E_ENGINE_TRIGGER
static const BitMask_t OPTION_y_EXHAUST_DIRECTION
CacheSystem * GetCacheSystem()
void ProcessAntiLockBrakes(RigDef::AntiLockBrakes &def)
CameraMode_t fb_camera_mode_orig
Dynamic visibility mode {0 and higher = cinecam index}.
int m_num_proped_wheels
Physics attr, filled at spawn - Number of propelled wheels.
void ProcessWheel(RigDef::Wheel &def)
static const BitMask64_t SOURCE_TURBO
Node::Ref rotating_plate_nodes[4]
void ProcessCameraRail(RigDef::CameraRail &def)
int controlnumber
Only 'u' type flares, valid values 0-9, maps to EV_TRUCK_LIGHTTOGGLE01 to 10.
Ogre::String material_name
float animOpt3
MULTIPURPOSE.
std::vector< Node::Ref > node_list
static const BitMask_t OPTION_b_EXTRA_BUOYANCY
static void AddSoundSourceInstance(ActorPtr const &vehicle, Ogre::String const &sound_script_name, int node_index, int type=-2)
static const float ROTATOR_FORCE_DEFAULT
UI helper for displaying command control keys to user.
std::vector< PropAnim > pp_animations
std::vector< Shock3 > shocks3
CameraMode_t pp_camera_mode_active
Dynamic visibility mode {0 and higher = cinecam index}.
bool m_has_axles_section
Temporary (legacy parsing helper) until central diffs are implemented.
int m_airplane_left_light
@ LOADDASHBOARD_SCREEN_HUD
Will be drawn to screen. Unless STACKABLE, it prevents the default dashboard from loading.
void RegisterCabMesh(Ogre::Entity *ent, Ogre::SceneNode *snode, FlexObj *flexobj)
void ProcessExhaust(RigDef::Exhaust &def)
static const BitMask_t OPTION_c_NO_GROUND_CONTACT
static const float BEAM_CREAK_DEFAULT
NodeNum_t rod_node2
Node index - may change during simulation!
Ogre::String particle_name
MirrorPropType mirror_prop_type
static Ogre::Vector3 getTweakedFlexbodyOffset(TuneupDefPtr &tuneup_entry, FlexbodyID_t flexbody_id, Ogre::Vector3 orig_val)
bool nd_rim_node
Attr; This node is part of a rim (only wheel types with separate rim nodes)
std::shared_ptr< BeamDefaults > beam_defaults
static const BitMask_t CONSTRAINT_ATTACH_NONE
static const BitMask_t OPTION_ALTIMETER_100K
static const BitMask_t OPTION_h_INPUT_InvELEVATOR_RUDDER
static std::string getTweakedPropMediaRG(TuneupDefPtr &tuneup_def, PropID_t prop_id, int media_idx, const std::string &orig_val)
CacheEntryPtr m_used_skin_entry
Graphics.
Abstract node ID (numbered or named) Node name is always available.
NodeNum_t vcam_node_dir_z
std::vector< FlexBodyWheel > flexbodywheels
static const BitMask_t OPTION_h_HOOK_POINT
void LoadResource(CacheEntryPtr &t)
Loads the associated resource bundle if not already done.
static const int MAX_SOUNDSCRIPTS_PER_TRUCK
maximum number of soundsscripts per actor
static const BitMask_t SOURCE_AERO_THROTTLE
ActorType ar_driveable
Sim attr; marks vehicle type and features.
virtual AeroEngineType getType()=0
node_t * GetNodePointer(RigDef::Node::Ref const &node_ref)
void ProcessProp(RigDef::Prop &def)
Resource group override is used with addonparts.
@ SHOCK_FLAG_TRG_CMD_BLOCKER
bool pp_aero_propeller_blade
Special - single blade mesh.
NodeNum_t ar_exhaust_pos_node
Old-format exhaust (one per vehicle) emitter node.
Differential * m_axle_diffs[1+MAX_WHEELS/2]
Physics.
static const BitMask64_t SOURCE_BRAKES
int ar_masscount
Calculated; Number of nodes loaded with l option.
static bool isExhaustAnyhowRemoved(TuneupDefPtr &tuneup_def, ExhaustID_t exhaust_id)
bool alb_nodash
Anti-lock brake attribute: Hide the dashboard indicator?
PointColDetector * m_intra_point_col_detector
Physics.
float m_odometer_total
GUI state.
float alb_minspeed
Anti-lock brake attribute;.
@ LIGHTMASK_CUSTOM1
custom light 1 on
float contraction_trigger_limit
std::shared_ptr< NodeDefaults > node_defaults
std::vector< rope_t > ar_ropes
static std::string getTweakedWheelMediaRG(TuneupDefPtr &tuneup_def, WheelID_t wheel_id, int media_idx, const std::string &orig_val)
const PropAnimFlag_t PROP_ANIM_FLAG_AEPITCH
float split_vel_in
Split velocity in (m/s) - threshold for slow / fast damping during compression.
const PropAnimFlag_t PROP_ANIM_FLAG_ELEVATORS
@ HYDRO_FLAG_REV_ELEVATOR
void ProcessPistonprop(RigDef::Pistonprop &def)
Ogre::String band_material_name
int FlareID_t
Index into Actor::ar_flares, use RoR::FLAREID_INVALID as empty value.
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)
void ProcessTurbojet(RigDef::Turbojet &def)
float dampin
shocks2 & shocks3
int rg_id
Spawn context - matching separately defined rails with slidenodes.
float alb_ratio
Anti-lock brake attribute: Regulating force.
static const BitMask_t OPTION_j_INVISIBLE
float ar_anim_shift_timer
For 'animator' with flag 'shifter'.
static WheelSide getTweakedWheelSide(TuneupDefPtr &tuneup_entry, WheelID_t wheel_id, WheelSide orig_val)
void CalculateBeamLength(beam_t &beam)
float short_bound
Maximum contraction limit, in percentage ( 1.00 = 100% )
Ogre::Vector3 m_spawn_position
const PropAnimFlag_t PROP_ANIM_FLAG_BRUDDER
InputEngine * GetInputEngine()
static float getTweakedWheelTireRadius(TuneupDefPtr &tuneup_entry, WheelID_t wheel_id, float orig_val)
int detacher_group
Attribute: detacher group number (integer)
void ProcessCruiseControl(RigDef::CruiseControl &def)
Submesh for old-style actor body (the "cab")
float progress_factor_damp_in
Progression factor for dampin. 0 = disabled, 1...x as multipliers, example:maximum dampingrate == spr...
std::shared_ptr< Inertia > inertia_defaults
static const BitMask_t OPTION_M_ABSOLUTE_METRIC
ropable_t * ti_locked_ropable
std::shared_ptr< BeamDefaults > beam_defaults
@ SHOCK_FLAG_TRG_HOOK_UNLOCK
static const int LOCKGROUP_DEFAULT
unsigned int forum_account_id
std::vector< Ogre::AxisAlignedBox > ar_predicted_coll_bounding_boxes
RailGroup * CreateRail(std::vector< RigDef::Node::Range > &node_ranges)
static std::string getTweakedManagedMatMedia(TuneupDefPtr &tuneup_def, const std::string &matname, int media_idx, const std::string &orig_val)
static const BitMask_t CONSTRAINT_ATTACH_ALL
std::vector< commandbeam_t > beams
WheelSide wh_arg_side
Only for 'meshwheels*' and 'flexbodywheels'.
Texture coordinates for old-style actor body (the "cab")
RoR::CommandkeyID_t contract_key
bool nd_no_ground_contact
User-defined attr; node ignores contact with ground.
static const BitMask_t MODE_ROTATION_X
FlexMeshWheel * CreateFlexMeshWheel(unsigned int wheel_index, int axis_node_1_index, int axis_node_2_index, int nstart, int nrays, float rim_radius, bool rim_reverse, std::string const &rim_mesh_name, std::string const &rim_mesh_rg, std::string const &tire_material_name, std::string const &tire_material_rg)
std::vector< Hydro > hydros
static const int MAX_CABS
maximum number of cabs per actor
const PropAnimFlag_t PROP_ANIM_FLAG_SPEEDO
Ogre::SceneNode * m_wheels_parent_scenenode
this isn't used for moving/hiding things, just helps developers inspect the scene graph.
std::list< MotorSource > motor_sources
bool cmb_is_1press_center
Attribute defined in truckfile.
DashboardSpecial special_prop_dashboard
static const BitMask64_t SOURCE_DASHBOARD
Ogre::Vector3 vcam_pos_offset
RigDef::MaterialFlareBinding * material_flare_def
std::string wx_rim_mesh_name
Redundant, for Tuning UI. Only for 'meshwheels[2]' and 'flexbodywheels'.
static const BitMask64_t SOURCE_GEAR_REVERSE
float node_collision_range
ground_model_t * ar_submesh_ground_model
Node::Ref blade_tip_nodes[4]
bool m_apply_simple_materials
static const BitMask_t OPTION_r_ROPE
static const BitMask64_t SOURCE_CLUTCH
Represents an airfoil http://en.wikipedia.org/wiki/Airfoil.
float hb_anim_param
Only for 'animators'.
static const BitMask_t MODE_OFFSET_Y
Ogre::String airfoil_name
float hb_speed
Rate of change.
static Ogre::Vector3 getTweakedNodePosition(TuneupDefPtr &tuneup_entry, NodeNum_t nodenum, Ogre::Vector3 orig_val)
static const BitMask64_t SOURCE_SIGNALSTALK
MeshObject * pp_mesh_obj
Optional; NULL if removed via tuneup/addonpart.
float sbd_spring
set beam default for spring
static const BitMask_t OPTION_F_10xTOUGHER_BUOYANT
int control_number
Only 'u' type flares.
float damp_in
Damping value applied when the shock is compressing.
std::vector< Node::Ref > nodes
static const BitMask_t OPTION_i_INVISIBLE
void ProcessRotator2(RigDef::Rotator2 &def)
void CreateMaterialFlare(int flare_index, Ogre::MaterialPtr mat)
bool _attachment_rate_set
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)
Manager for all visuals belonging to a single actor.
static void SetupDefaultSoundSources(ActorPtr const &actor)
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.
std::shared_ptr< BeamDefaults > beam_defaults
bool alb_notoggle
Anti-lock brake attribute: Disable in-game toggle?
CustomMaterial::MirrorPropType m_curr_mirror_prop_type
bool ti_no_self_lock
Attribute.
shock_t * ar_shocks
Shock absorbers.
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)
bool cmb_plays_sound
Attribute defined in truckfile.
@ CONSOLE_MSGTYPE_ACTOR
Parsing/spawn/simulation messages for actors.
std::vector< hydrobeam_t > ar_hydros
unsigned int _SectionWheels2AddBeam(RigDef::Wheel2 &wheel_2_def, node_t *node_1, node_t *node_2)
std::shared_ptr< Document > DocumentPtr
float pp_beacon_rot_rate[4]
Radians per second.
@ SHOCK1
either 'shock1' (with flag BEAM_HYDRO) or a wheel beam
void ProcessCommand(RigDef::Command2 &def)
void setVisible(bool visibility)
static const BitMask_t OPTION_r_BUOYANT_ONLY_DRAG
RoR::CmdKeyInertiaConfig & GetInertiaConfig()
std::string particleSystemName
Name in .particle file ~ for display in Tuning UI.
TurbojetVisual tjet_visual
static const int MAX_WHEELS
maximum number of wheels per actor
std::vector< Node::Range > node_list
static const BitMask_t OPTION_m_METRIC
NOTE: Modcache processes this format directly using RoR::GenericDocument, see RoR::CacheSystem::FillA...
static const BitMask_t OPTION_PARKING
NodeNum_t GetNodeIndexOrThrow(RigDef::Node::Ref const &id)
ActorMemoryRequirements m_memory_requirements
float pp_wheel_rot_degree
std::shared_ptr< NodeDefaults > node_defaults
static const BitMask64_t SOURCE_SHIFT_BACK_FORTH
int di_idx_1
array location of wheel / axle 1
static const BitMask_t OPTION_SHORT_LIMIT
int FlexbodyID_t
Index to GfxActor::m_flexbodies, use RoR::FLEXBODYID_INVALID as empty value.
void SetDefaultRail(RailGroup *rail)
Sets rail to initially use when spawned or reset.
static const BitMask_t OPTION_H_LOCKS_HOOK_GROUP
std::string GetSubmeshGroundmodelName()
wheel_t ar_wheels[MAX_WHEELS]
static const BitMask_t OPTION_S_INVULNERABLE_BUOYANT
static const BitMask_t OPTION_i_INVISIBLE
bool alb_pulse_state
Anti-lock brake state;.
int m_airplane_right_light
float damping
The 'resistance to motion' of the shock. The best value is given by this equation: 2 * sqrt(suspended...
NodeNum_t ar_camera_node_pos[MAX_CAMERAS]
Physics attr; 'camera' = frame of reference; origin node.
beam_t & AddBeam(node_t &node_1, node_t &node_2, std::shared_ptr< RigDef::BeamDefaults > &defaults, int detacher_group)
Flexbody = A deformable mesh; updated on CPU every frame, then uploaded to video memory.
bool m_engine_has_air
Engine attribute.
void ProcessWheelDetacher(RigDef::WheelDetacher &def)
bool _max_attach_dist_set
std::shared_ptr< BeamDefaults > beam_defaults
void InitBeam(beam_t &beam, node_t *node_1, node_t *node_2)
Node::Ref base_plate_nodes[4]
@ NETWORKED_OK
not simulated (remote) actor
bool m_beam_break_debug_enabled
Logging state.
static const int MAX_SCREWPROPS
maximum number of boat screws per actor
float damp_out
Damping value applied when shock extending.
Ogre::BillboardSet * pp_beacon_bbs[4]
void AssignManagedMaterialTexture(Ogre::TextureUnitState *tus, const std::string &mm_name, int media_id, const std::string &tex_name)
Helper for ProcessManagedMaterial()
bool option_c_auto_center
Ogre::SceneNode * pp_scene_node
The pivot scene node (parented to root-node).
unsigned int spin_left_key
uint16_t cmb_beam_index
Index to Actor::ar_beams array.
bool cmb_is_autocentering
Attribute defined in truckfile.
const PropAnimFlag_t PROP_ANIM_FLAG_CLUTCH
float damp_in_slow
Damping value applied when shock is commpressing slower than split in velocity.
int16_t nd_lockgroup
Optional attribute (-1 = default, 9999 = deny lock) - used in the hook lock logic.
std::vector< ropable_t > ar_ropables
void SetTurboOptions(int type, float tinertiaFactor, int nturbos, float param1, float param2, float param3, float param4, float param5, float param6, float param7, float param8, float param9, float param10, float param11)
void ProcessFlexBodyWheel(RigDef::FlexBodyWheel &def)
int mode
0 and higher = cinecam index
Ogre::String material_name
static const BitMask_t OPTION_TACHO
beam_t * FindBeamInRig(NodeNum_t node_a, NodeNum_t node_b)
void ProcessTractionControl(RigDef::TractionControl &def)
float m_handbrake_force
Physics attr; defined in truckfile.
node_t * GetBeamNodePointer(RigDef::Node::Ref const &node_ref)
Ogre::MaterialPtr CreateSimpleMaterial(Ogre::ColourValue color)
static std::string getTweakedWheelMedia(TuneupDefPtr &tuneup_entry, WheelID_t wheel_id, int media_idx, const std::string &orig_val)
Ogre::ColourValue emissive_color
static const BitMask64_t SOURCE_TORQUE
< Node resolution must be done in ActorSpawner, but vert resolution in FlexBody
const PropAnimFlag_t PROP_ANIM_FLAG_ROLL
Ogre::String stop_function
static const BitMask_t OPTION_s_DISABLE_SELF_LOCK
static const BitMask64_t SOURCE_ALTIMETER_100K
void ProcessTrigger(RigDef::Trigger &def)
std::vector< Beam > beams
Ogre::ParticleSystem * smoker
This remains nullptr if removed via addonpart_unwanted_exhaust or Tuning UI.
std::vector< Airbrake * > ar_airbrakes
Ogre::String material_name
static const BitMask_t OPTION_r_INPUT_RUDDER
static const BitMask_t MODE_NO_FLIP
NodeNum_t ar_camera_rail[MAX_CAMERARAIL]
Nodes defining camera-movement spline.
TuneupDefPtr & getWorkingTuneupDef()
NodeNum_t ar_main_camera_node_roll
Sim attr; ar_camera_node_roll[0] >= 0 ? ar_camera_node_roll[0] : 0.
static VideoCamRole getTweakedVideoCameraRole(TuneupDefPtr &tuneup_def, VideoCameraID_t camera_id, VideoCamRole orig_val)
Node::Ref reference_arm_node
soundsource_t ar_soundsources[MAX_SOUNDSCRIPTS_PER_TRUCK]
std::shared_ptr< DefaultMinimass > default_minimass
int ar_num_shocks
Number of shock absorbers.
Ogre::String dash_link_name
bool ar_guisettings_use_engine_max_rpm
std::list< std::shared_ptr< RigDef::Document::Module > > m_selected_modules
std::unique_ptr< GfxActor > m_gfx_actor
bool m_beam_deform_debug_enabled
Logging state.
void setCastShadows(bool b)
@ LIGHTMASK_BLINK_RIGHT
right blinker on
void ProcessTransferCase(RigDef::TransferCase &def)
node_t * GetNodePointerOrThrow(RigDef::Node::Ref const &node_ref)
Ogre::Quaternion ar_main_camera_dir_corr
Sim attr;.
CVar * gfx_reduce_shadows
BeaconSpecial special_prop_beacon
const PropAnimFlag_t PROP_ANIM_FLAG_AILERONS
NodeNum_t wh_arg_rigidity_node
bool ar_has_active_shocks
Are there active stabilizer shocks?
Ogre::SceneNode * pp_beacon_scene_node[4]
float progress_factor_damp_out
Progression factor dampout, 0 = disabled, 1...x as multipliers, example:maximum dampingrate == spring...
ActorManager * GetActorManager()
void ProcessCinecam(RigDef::Cinecam &def)
float ar_guisettings_shifter_anim_time
Ogre::MaterialPtr material
float default_beam_diameter
for export only
int PropID_t
Index to GfxActor::m_props, use RoR::PROPID_INVALID as empty value.
static const BitMask_t OPTION_i_INVISIBLE
bool ar_minimass_skip_loaded_nodes
std::map< std::string, Ogre::MaterialPtr > ar_managed_materials
static const int MAX_AEROENGINES
maximum number of aero engines per actor
std::shared_ptr< BeamDefaults > beam_defaults
const PropAnimFlag_t PROP_ANIM_FLAG_BTHROTTLE
Ogre::String face_material_name
static const BitMask_t OPTION_b_BUOYANT
const PropAnimFlag_t PROP_ANIM_FLAG_EVENT
void InitNode(node_t &node, Ogre::Vector3 const &position)
@ VCAM_ROLE_MIRROR_PROP_LEFT
The classic 'special prop/rear view mirror'.
static const BitMask_t OPTION_x_INPUT_AILERON_RUDDER
@ LIGHTMASK_CUSTOM6
custom light 6 on
std::vector< MeshWheel > meshwheels
Ogre::String sound_script_name
NodeNum_t ar_cinecam_node[MAX_CAMERAS]
Sim attr; Cine-camera node indexes.
static const int MAX_TEXCOORDS
maximum number of texture coordinates per actor
void ProcessManagedMaterial(RigDef::ManagedMaterial &def)
std::unique_ptr< Buoyance > m_buoyance
Physics.
const PropAnimMode_t PROP_ANIM_MODE_OFFSET_Y
const PropAnimFlag_t PROP_ANIM_FLAG_TACHO
float damp_out_slow
Damping value applied when shock is commpressing slower than split out velocity.
Ogre::String flare_material_name
void SetupVisuals(RigDef::Turbojet &def, int num, std::string const &propname, Ogre::Entity *nozzle, Ogre::Entity *afterburner_flame)
void ProcessWheel2(RigDef::Wheel2 &def)
std::vector< Node::Ref > fixes
SimpleInertia inertia
Only 'flares3'.
float ar_guisettings_speedo_max_kph
std::list< Animation > animations
std::vector< CabSubmesh > m_oldstyle_cab_submeshes
const TerrainPtr & GetTerrain()
Ogre::String fname
filename
static const BitMask_t OPTION_f_NO_SPARKS
static const BitMask_t OPTION_VERTICAL_VELOCITY
static const BitMask_t OPTION_GEAR_SELECT
static const BitMask64_t SOURCE_SEQUENTIAL_SHIFT
int SetCmdKeyDelay(RoR::CmdKeyInertiaConfig &cfg, float start_delay, float stop_delay, std::string start_function, std::string stop_function)
int pp_aero_engine_idx
Special - a turboprop/pistonprop reference.
static const BitMask64_t SOURCE_SPEEDO
bool CheckScrewpropLimit(unsigned int count)